(this["webpackJsonpreact-21-22"]=this["webpackJsonpreact-21-22"]||[]).push([[2],{492:function(e,t){},494:function(e,t){},591:function(e,t,n){"use strict";n.r(t);var o=n(141),a=n(7),c=n(607),r=n(574),i=n(21),s=n(0),l=n(509),d=n(510),b=n(22),j=n(14),f=n(147),p=n(608),u=n(596),m=n(618),h=n(316),x=n.n(h),g=n(315),O=n.n(g),v=n(152),y=n.n(v),C=n(274),w=n.n(C),S=n(27),k=Object(f.a)((function(e){return Object(a.jsx)(u.a,Object(j.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(-2),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"8px 8px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(4)}}}}})),N=Object(r.a)({container:{position:"absolute",maxWidth:"100%",top:"92vh",right:20,zIndex:10,cursor:"pointer"}}),I=function(e){var t=e.setPopup,n=N(),c=Object(i.b)(),r=Object(s.useState)(null),l=Object(o.a)(r,2),d=l[0],b=l[1],j=Boolean(d),f=function(){t(!1),b(null)};return Object(a.jsxs)("div",{className:n.container,children:[Object(a.jsx)(p.a,{onClick:function(e){return b(e.currentTarget)},sx:{bgcolor:"rgb(41, 139, 231)",width:56,height:56},children:d?Object(a.jsx)(y.a,{}):Object(a.jsx)(O.a,{})}),Object(a.jsxs)(k,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:d,open:j,onClose:f,children:[Object(a.jsxs)(m.a,{onClick:function(){f(),c(Object(S.a)("contact"))},children:[Object(a.jsx)(w.a,{}),"New Contact"]}),Object(a.jsxs)(m.a,{onClick:function(){f(),c(Object(S.a)("contacts"))},children:[Object(a.jsx)(x.a,{}),"Contacts"]})]})]})},T=n(38),z=n(621),R=n(597),M=n(622),A=n(616),D=n(584),E=n(578),L=n(51),W=Object(r.a)({stackItem:{display:"flex",flexDirection:"column",justifyContent:"center",alignContent:"center",alignItems:"center",padding:5,borderRadius:5,cursor:"pointer","&:hover":{background:"#eeeded"}},titleName:{color:"#575757",fontSize:16,paddingTop:5}}),B=function(e){var t=e.handleListItemClick,n=e.chat,o=W(),c=n.name,r=n.lastName,i=n.color,s=n.avatarUrl,l=n.companionId;return Object(a.jsxs)("div",{onClick:function(){return t(l)},className:o.stackItem,children:[Object(a.jsx)(p.a,{alt:c,src:s?"".concat(L.l,"/").concat(s):void 0,sx:{background:i,width:54,height:54},children:"".concat(Object(L.e)(c)).concat(Object(L.e)(r))}),Object(a.jsx)(E.a,{variant:"h6",className:o.titleName,children:"".concat(Object(L.e)(c)).concat(Object(L.p)(c,8,1))})]})},P=n(580),F=n(582),Y=n(581),U=Object(r.a)({listItemInnerText:{display:"flex",alignContent:"center",alignItems:"center",flexWrap:"nowrap"},listItem_iconAvatar:{marginRight:10},listItem_iconRight:{marginRight:10},listItem_icon_time:{fontSize:12,marginLeft:5,paddingBottom:25,color:"#1b1b1b"}}),_=function(e){var t=e.chat,n=e.handleListItemClick,o=U(),c=t.name,r=t.lastName,i=t.avatarUrl,s=t.color,l=t.companionId,d=t.lastMessage,b=t.lastMessageCreatedAt,j=t.createdAt;return Object(a.jsxs)(P.a,{onClick:function(){return n(l)},children:[Object(a.jsx)(Y.a,{className:o.listItem_iconAvatar,children:Object(a.jsx)(p.a,{alt:c,src:i?"".concat(L.l,"/").concat(i):void 0,sx:{background:s,width:54,height:54},children:!i&&"".concat(Object(L.e)(c)).concat(Object(L.e)(r))})}),Object(a.jsx)(F.a,{primary:"".concat(Object(L.e)(c)).concat(Object(L.p)(c,15,1)," \n ").concat(Object(L.e)(r)).concat(Object(L.p)(r,15,1)),secondary:"".concat(d?Object(L.p)(d,35):"".concat(Object(L.e)(c)).concat(Object(L.p)(c,8,1)," joined Telegram"))}),Object(a.jsx)(Y.a,{className:o.listItem_iconRight,children:Object(a.jsx)(E.a,{className:o.listItem_icon_time,variant:"h6",color:"initial",children:Object(L.r)(b||j)})})]})},H=n(598),$=n(626),V=function(e){var t=e.name;return Object(a.jsx)(D.a,{sx:{width:"100%"},spacing:2,children:Object(a.jsxs)(H.a,{severity:"info",children:[Object(a.jsx)($.a,{children:"Warning"}),Object(a.jsx)("strong",{style:{wordBreak:"break-word"},children:t})]})})},G=Object(r.a)({stack:{display:"flex",justifyContent:"space-around",paddingTop:20},container:{width:"100%",maxHeight:"88vh",overflowY:"scroll",position:"absolute",animationDuration:"0.2s",animationDirection:"normal",animation:"$moveElement","&::-webkit-scrollbar":{width:"0.4em"},"&::-webkit-scrollbar-track":{boxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",webkitBoxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",backgroundColor:"#eceeec"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#ccc8c8"},"&::-webkit-scrollbar-thumb:focus":{backgroundColor:"#959595"},"&::-webkit-scrollbar-thumb:active":{backgroundColor:"#959595"}},"@keyframes moveElement":{"0%":{left:"-100%"},"100%":{left:"0%"}}}),q=function(e){var t=e.value,n=e.date,o=e.filteredAndSortedChats,c=e.handleListItemClick,r=G();return Object(a.jsxs)(a.Fragment,{children:[!t&&!n&&o.length>0&&Object(a.jsx)(D.a,{direction:"row",className:r.stack,children:o.slice(0,6).map((function(e){return Object(a.jsx)(B,{handleListItemClick:c,chat:e},e.companionId)}))}),(t||n)&&o.length>0&&Object(a.jsx)(A.a,{className:r.container,component:"nav","aria-label":"main mailbox folders",children:o.map((function(e){return Object(a.jsx)(_,{handleListItemClick:c,chat:e},e.companionId)}))}),(t||n)&&0===o.length&&Object(a.jsx)(V,{name:"Can not find Chat by request: ".concat(t)}),!t&&!n&&0===o.length&&Object(a.jsx)(V,{name:"You do not have any Chats yet!"})]})},K=n(605),J=n(612),Q=n(184),X=n.n(Q),Z=n(585),ee=Object(r.a)({container:{width:"100%",maxHeight:"88vh",overflowY:"scroll",position:"absolute",animationDuration:"0.2s",animationDirection:"normal",animation:"$moveElement","&::-webkit-scrollbar":{width:"0.4em"},"&::-webkit-scrollbar-track":{boxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",webkitBoxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",backgroundColor:"#eceeec"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#ccc8c8"},"&::-webkit-scrollbar-thumb:focus":{backgroundColor:"#959595"},"&::-webkit-scrollbar-thumb:active":{backgroundColor:"#959595"}},folderIcon:{margin:"auto 0px",color:"#54b0fc"},listItem:{cursor:"pointer","&:hover":{backgroundColor:"#f0f0f0"}},"@keyframes moveElement":{"0%":{left:"-100%"},"100%":{left:"0%"}}}),te=function(e){var t=e.filteredAndSortedMessages,n=e.value,o=e.date,c=e.handleScrollToTheMessage,r=ee();return Object(a.jsxs)(a.Fragment,{children:[t.length>0&&Object(a.jsx)(A.a,{className:r.container,children:t.map((function(e){var t=e.createdAt,n=e.fullType,o=e._id,i=e.companionId,s=e.name,l=e.avatarUrl,d=e.lastName,b=e.color;return Object(a.jsxs)("div",{children:[Object(a.jsxs)(K.a,{onClick:function(){return c(o,i)},alignItems:"flex-start",className:r.listItem,children:[Object(a.jsx)(J.a,{children:Object(a.jsx)(p.a,{alt:s,src:l?"".concat(L.l,"/").concat(l):void 0,sx:{background:b,width:40,height:40},children:"".concat(Object(L.e)(s)).concat(Object(L.e)(d))})}),Object(a.jsx)(F.a,{primary:n,secondary:Object(L.r)(t)}),Object(a.jsx)(X.a,{className:r.folderIcon,fontSize:"large"})]}),Object(a.jsx)(Z.a,{variant:"inset"})]},t)}))}),(n||o)&&0===t.length&&Object(a.jsx)(V,{name:"Can not find Files by request: ".concat(n)}),!n&&!o&&0===t.length&&Object(a.jsx)(V,{name:"You do not have Files yet!"})]})},ne=n(627),oe=n(629),ae=n(245),ce=n.n(ae),re=n(221),ie=n.n(re),se=n(222),le=n.n(se),de=Object(r.a)({overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflow:"auto",boxSizing:"border-box",display:"flex",justifyContent:"center",alignContent:"center",alignItems:"center"},topBar:{position:"fixed",top:0,left:0,height:"7vh",width:"100vw",display:"flex",alignContent:"center",alignItems:"center",justifyContent:"space-between",backgroundColor:"rgba(65, 65, 65, 0.9)",zIndex:10,padding:"0px 20px"},wrapperCredentials:{display:"flex",alignContent:"center",alignItems:"center"},wrapperIcons:{display:"flex",alignContent:"center",alignItems:"center"},magnifying:{marginLeft:5,cursor:"pointer",color:"#e9e7e7",padding:0,"&:hover":{color:"#ffffff",transform:"scale(1.1)"}},downloadIcon:{marginLeft:5,cursor:"pointer",color:"#e9e7e7",padding:0,borderRadius:"50%","&:hover":{backgroundColor:"#ffffff",color:"#b8b7b7"}},iconCloseOverlay:{marginLeft:5,cursor:"pointer",color:"#e9e7e7",padding:0,"&:hover":{color:"#ffffff",transform:"rotate(180deg)",transition:"all 250ms ease-out "}},wrapperImage:{borderRadius:5,maxWidth:500,maxHeight:750,display:"flex",overflow:"auto"},innerImage:{objectFit:"cover"},img:{cursor:"pointer","&:hover":{scale:.98}}}),be=function(e){var t=e.message,n=e.fullType,c=e.updatedAt,r=e.handleScrollToTheMessage,i=e.id,l=e.companionId,d=e.name,b=e.lastName,j=e.color,f=de(),u=Object(s.useState)(!1),m=Object(o.a)(u,2),h=m[0],x=m[1],g=Object(s.useState)(1),O=Object(o.a)(g,2),v=O[0],C=O[1],w=Object(s.useRef)(null),S=function(e){var t=e.target.id;"overlay"!==t&&"close"!==t||(x(!1),C(1))},k="".concat(L.l,"/").concat(t);return h?Object(a.jsxs)("div",{onClick:function(e){S(e),r(i,l)},id:"overlay",className:f.overlay,children:[Object(a.jsxs)("div",{className:f.topBar,children:[Object(a.jsxs)("div",{className:f.wrapperCredentials,children:[Object(a.jsx)(Y.a,{children:Object(a.jsx)(p.a,{alt:d,src:k||void 0,sx:{background:j,width:44,height:44},children:!k&&"".concat(Object(L.e)(d)).concat(Object(L.e)(b))})}),Object(a.jsx)(F.a,{primary:"".concat(Object(L.e)(d)).concat(Object(L.p)(d,15,1),"\n ").concat(Object(L.e)(b)).concat(Object(L.p)(b,15,1)),primaryTypographyProps:{color:"#ffffff"},secondary:Object(L.r)(c),secondaryTypographyProps:{color:"#ffffff"}})]}),Object(a.jsxs)("div",{className:f.wrapperIcons,children:[Object(a.jsx)(ie.a,{onClick:function(){v>=.5&&(w.current.style.transform="scale(".concat(v-.25,",").concat(v-.25,")"),w.current.style.transformOrigin="".concat(50/v-.25,"px ").concat(50/v-.25,"px"),C(v-.25))},className:f.magnifying,fontSize:"large"}),Object(a.jsx)(le.a,{onClick:function(){v<5&&(w.current.style.transform="scale(".concat(v+.25,",").concat(v+.25,")"),w.current.style.transformOrigin="".concat(50/v+.25,"px ").concat(50/v+.25,"px"),C(v+.25))},className:f.magnifying,fontSize:"large"}),Object(a.jsx)(ce.a,{onClick:function(){return Object(L.g)(k,n)},className:f.downloadIcon,fontSize:"large"}),Object(a.jsx)(y.a,{id:"close",onClick:S,className:f.iconCloseOverlay,fontSize:"large"})]})]}),Object(a.jsx)("div",{ref:w,className:f.wrapperImage,children:Object(a.jsx)("img",{className:f.innerImage,width:"100%",height:"auto",alt:"imageItem",src:k})})]}):Object(a.jsx)(oe.a,{children:Object(a.jsx)("img",{onClick:function(){return!h&&x(!0)},className:f.img,src:"".concat(k,"?w=164&h=164&fit=crop&auto=format"),srcSet:"".concat(k,"?w=164&h=164&fit=crop&auto=format&dpr=2 2x"),alt:"imageItem",loading:"lazy"})})},je=Object(r.a)({container:{width:"100%",maxHeight:"88vh",overflowY:"scroll",position:"absolute",animationDuration:"0.2s",animationDirection:"normal",animation:"$moveElement","&::-webkit-scrollbar":{width:"0.4em"},"&::-webkit-scrollbar-track":{boxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",webkitBoxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",backgroundColor:"#eceeec"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#ccc8c8"},"&::-webkit-scrollbar-thumb:focus":{backgroundColor:"#959595"},"&::-webkit-scrollbar-thumb:active":{backgroundColor:"#959595"}},"@keyframes moveElement":{"0%":{left:"-100%"},"100%":{left:"0%"}}}),fe=function(e){var t=e.filteredAndSortedMessages,n=e.value,o=e.date,c=e.handleScrollToTheMessage,r=je();return Object(a.jsxs)(a.Fragment,{children:[t.length>0&&Object(a.jsx)(ne.a,{className:r.container,cols:3,rowHeight:164,children:t.map((function(e){var t=e.message,n=e.createdAt,o=e.fullType,r=e.updatedAt,i=e._id,s=e.companionId,l=e.name,d=e.lastName,b=e.color;return Object(a.jsx)(be,{message:t,fullType:o,updatedAt:r,handleScrollToTheMessage:c,id:i,companionId:s,name:l,lastName:d,color:b},n)}))}),(n||o)&&0===t.length&&Object(a.jsx)(V,{name:"Can not find Media by request: ".concat(n)}),!n&&!o&&0===t.length&&Object(a.jsx)(V,{name:"You do not have Media yet!"})]})},pe=n(159),ue=n.n(pe),me=Object(r.a)({container:{width:"100%",maxHeight:"88vh",overflowY:"scroll",position:"absolute",animationDuration:"0.2s",animationDirection:"normal",animation:"$moveElement","&::-webkit-scrollbar":{width:"0.4em"},"&::-webkit-scrollbar-track":{boxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",webkitBoxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",backgroundColor:"#eceeec"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#ccc8c8"},"&::-webkit-scrollbar-thumb:focus":{backgroundColor:"#959595"},"&::-webkit-scrollbar-thumb:active":{backgroundColor:"#959595"}},listItem:{cursor:"pointer","&:hover":{backgroundColor:"#f0f0f0"}},folderIcon:{margin:"auto 0px",color:"#54b0fc"},"@keyframes moveElement":{"0%":{left:"-100%"},"100%":{left:"0%"}}}),he=function(e){var t=e.filteredAndSortedMessages,n=e.value,o=e.date,c=e.handleScrollToTheMessage,r=me();return Object(a.jsxs)(a.Fragment,{children:[t.length>0&&Object(a.jsx)(A.a,{className:r.container,children:t.map((function(e){var t=e.message,n=e.createdAt,o=e.lastName,i=e.name,s=e.color,l=e.avatarUrl,d=e._id,b=e.companionId;return Object(a.jsxs)("div",{children:[Object(a.jsxs)(K.a,{onClick:function(){return c(d,b)},alignItems:"flex-start",className:r.listItem,children:[Object(a.jsx)(J.a,{children:Object(a.jsx)(p.a,{alt:i,src:l?"".concat(L.l,"/").concat(l):void 0,sx:{background:s,width:40,height:40},children:"".concat(Object(L.e)(i)).concat(Object(L.e)(o))})}),Object(a.jsx)(F.a,{style:{wordBreak:"break-word",marginRight:2},primary:t,secondary:Object(L.r)(n),secondaryTypographyProps:{color:"#020202",paddingTop:.5}}),Object(a.jsx)(ue.a,{className:r.folderIcon,fontSize:"large"})]}),Object(a.jsx)(Z.a,{variant:"inset"})]},n)}))}),(n||o)&&0===t.length&&Object(a.jsx)(V,{name:"Can not find Text by request: ".concat(n)}),!n&&!o&&0===t.length&&Object(a.jsx)(V,{name:"You do not have Text yet!"})]})},xe=n(189),ge=n.n(xe),Oe=Object(r.a)({container:{width:"100%",maxHeight:"88vh",overflowY:"scroll",position:"absolute",animationDuration:"0.2s",animationDirection:"normal",animation:"$moveElement","&::-webkit-scrollbar":{width:"0.4em"},"&::-webkit-scrollbar-track":{boxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",webkitBoxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",backgroundColor:"#eceeec"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#ccc8c8"},"&::-webkit-scrollbar-thumb:focus":{backgroundColor:"#959595"},"&::-webkit-scrollbar-thumb:active":{backgroundColor:"#959595"}},folderIcon:{margin:"auto 0px",color:"#54b0fc"},listItem:{cursor:"pointer","&:hover":{backgroundColor:"#f0f0f0"}},"@keyframes moveElement":{"0%":{left:"-100%"},"100%":{left:"0%"}}}),ve=function(e){var t=e.filteredAndSortedMessages,n=e.value,o=e.date,c=e.handleScrollToTheMessage,r=Oe();return Object(a.jsxs)(a.Fragment,{children:[t.length>0&&Object(a.jsx)(A.a,{className:r.container,children:t.map((function(e){var t=e.createdAt,n=e.fullType,o=e._id,i=e.companionId,s=e.name,l=e.avatarUrl,d=e.lastName,b=e.color;return Object(a.jsxs)("div",{children:[Object(a.jsxs)(K.a,{onClick:function(){return c(o,i)},alignItems:"flex-start",className:r.listItem,children:[Object(a.jsx)(J.a,{children:Object(a.jsx)(p.a,{alt:s,src:l?"".concat(L.l,"/").concat(l):void 0,sx:{background:b,width:40,height:40},children:"".concat(Object(L.e)(s)).concat(Object(L.e)(d))})}),Object(a.jsx)(F.a,{primary:n,secondary:Object(L.r)(t)}),Object(a.jsx)(ge.a,{className:r.folderIcon,fontSize:"large"})]}),Object(a.jsx)(Z.a,{variant:"inset"})]},t)}))}),(n||o)&&0===t.length&&Object(a.jsx)(V,{name:"Can not find Audio by request: ".concat(n)}),!n&&!o&&0===t.length&&Object(a.jsx)(V,{name:"You do not have Audio yet!"})]})},ye=n(190),Ce=n.n(ye),we=Object(r.a)({container:{width:"100%",maxHeight:"88vh",overflowY:"scroll",position:"absolute",animationDuration:"0.2s",animationDirection:"normal",animation:"$moveElement","&::-webkit-scrollbar":{width:"0.4em"},"&::-webkit-scrollbar-track":{boxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",webkitBoxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",backgroundColor:"#eceeec"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#ccc8c8"},"&::-webkit-scrollbar-thumb:focus":{backgroundColor:"#959595"},"&::-webkit-scrollbar-thumb:active":{backgroundColor:"#959595"}},folderIcon:{margin:"auto 0px",color:"#54b0fc"},listItem:{cursor:"pointer","&:hover":{backgroundColor:"#f0f0f0"}},"@keyframes moveElement":{"0%":{left:"-100%"},"100%":{left:"0%"}}}),Se=function(e){var t=e.filteredAndSortedMessages,n=e.value,o=e.date,c=e.handleScrollToTheMessage,r=we();return Object(a.jsxs)(a.Fragment,{children:[t.length>0&&Object(a.jsx)(A.a,{className:r.container,children:t.map((function(e){var t=e.createdAt,n=e.fullType,o=e._id,i=e.companionId,s=e.name,l=e.avatarUrl,d=e.lastName,b=e.color;return Object(a.jsxs)("div",{children:[Object(a.jsxs)(K.a,{onClick:function(){return c(o,i)},alignItems:"flex-start",className:r.listItem,children:[Object(a.jsx)(J.a,{children:Object(a.jsx)(p.a,{alt:s,src:l?"".concat(L.l,"/").concat(l):void 0,sx:{background:b,width:40,height:40},children:"".concat(Object(L.e)(s)).concat(Object(L.e)(d))})}),Object(a.jsx)(F.a,{primary:n,secondary:Object(L.r)(t)}),Object(a.jsx)(Ce.a,{className:r.folderIcon,fontSize:"large"})]},t),Object(a.jsx)(Z.a,{variant:"inset"})]},t)}))}),(n||o)&&0===t.length&&Object(a.jsx)(V,{name:"Can not find Video by request: ".concat(n)}),!n&&!o&&0===t.length&&Object(a.jsx)(V,{name:"You do not have Video yet!"})]})},ke=n(1),Ne=n.n(ke),Ie=n(4),Te=n(45),ze=n(17),Re=n(47),Me=function(){return function(){var e=Object(Ie.a)(Ne.a.mark((function e(t){var n;return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(ze.f)();case 3:(n=e.sent)&&t(Object(Re.b)(n)),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),t(Object(Re.a)());case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}()},Ae=n(26),De=Object(Ae.a)([function(e){return e.chats}],(function(e){return e})),Ee=Object(Ae.a)([function(e){return e.allMessages.messages}],(function(e){return e})),Le=function(e){return e.control.leftIsOpen},We=function(e){return e.control.rightIsOpen},Be=function(e){return e.control.scrollChat},Pe=function(e){return e.control.openPinned},Fe=function(e){return e.control},Ye=n(33),Ue=function(e){return function(){var t=Object(Ie.a)(Ne.a.mark((function t(n){var o;return Ne.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Object(ze.G)(e);case 3:(o=t.sent)&&n(Object(Ye.c)(o)),t.next=9;break;case 7:t.prev=7,t.t0=t.catch(0);case 9:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(e){return t.apply(this,arguments)}}()},_e=function(e){return function(){var t=Object(Ie.a)(Ne.a.mark((function t(n){var o;return Ne.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Object(ze.e)(e);case 3:(o=t.sent)&&n(Object(Ye.a)(o)),t.next=9;break;case 7:t.prev=7,t.t0=t.catch(0);case 9:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(e){return t.apply(this,arguments)}}()},He=Object(Ae.a)([function(e){return e.pinnedMessages}],(function(e){return e})),$e=Object(r.a)({container:{height:"5vh",display:"flex",alignContent:"end",alignItems:"end",width:"100%",borderBottom:"solid 2px #dddddd"}}),Ve=Object(f.a)((function(e){return Object(a.jsx)(R.a,Object(j.a)(Object(j.a)({},e),{},{TabIndicatorProps:{children:Object(a.jsx)("span",{className:"MuiTabs-indicatorSpan"})}}))}))({"& .MuiTabs-flexContainer":{display:"flex",width:"100%",padding:"0px 10px",justifyContent:"space-between"},"& .MuiTabs-indicator":{height:0,backgroundColor:"transparent",borderBottom:"3px solid #1976d2",borderLeft:"3px solid transparent",borderRight:"3px solid transparent"}}),Ge=Object(f.a)((function(e){return Object(a.jsx)(z.a,Object(j.a)({disableRipple:!0},e))}))({fontSize:"1rem",fontWeight:550,textTransform:"none",minWidth:"auto"}),qe=function(e){var t=e.value,n=e.setValue,c=e.sort,r=e.date,l=e.setDate,d=e.setDisabled,b=e.chatDivRef,j=$e(),f=Object(i.b)(),p=Object(i.c)(De),u=p.chats,m=p.total,h=Object(i.c)(Ee),x=Object(i.c)(He),g=Object(i.c)(Fe),O=g.leftIsOpen,v=g.rightIsOpen,y=g.openPinned,C=Object(s.useState)(0),w=Object(o.a)(C,2),k=w[0],N=w[1],I=function(e,t){var n=e.current.childNodes[0].childNodes,o=Object(T.a)(n).find((function(e){return e.id===t}));o&&((o=Object(T.a)(o.childNodes).slice(-1)[0]).style.backgroundColor="rgba(70, 70, 70, 0.4)",o.style.boxShadow="0px 0px 6px 0px #ffffff",o.scrollIntoView({behavior:"smooth"}),setTimeout((function(){o.style.backgroundColor="unset",o.style.boxShadow="unset"}),2e3))},z=function(e,t){y&&!x.some((function(n){return n._id===e&&n.companionId===t}))&&f(Object(S.b)(!1)),b.current&&b.current.id===t?I(b,e):b.current&&b.current.id!==t?(v&&f(Object(S.c)("")),f(Ue(t)),setTimeout((function(){b.current&&I(b,e)}),3e3)):b.current||(v&&f(Object(S.c)("")),f(Ue(t)),setTimeout((function(){b.current&&I(b,e)}),3e3))};Object(s.useEffect)((function(){l("")}),[l]),Object(s.useEffect)((function(){f(0===k?Object(S.a)("searchChats"):Object(S.a)("searchAllMessages"))}),[k,f]),Object(s.useEffect)((function(){0===k&&d("0"===m)}),[k,m,d]),Object(s.useEffect)((function(){var e=function(){"searchChats"===O?f(Me()):"searchAllMessages"===O&&f(function(){var e=Object(Ie.a)(Ne.a.mark((function e(t){var n;return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(ze.d)();case 3:(n=e.sent)&&t(Object(Te.b)(n)),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),t(Object(Te.a)());case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}())};e();var t=setInterval(e,L.o);return function(){return clearInterval(t)}}),[O,f]);var R=Object(s.useMemo)((function(){return Object(L.q)(u,c).filter((function(e){var n=e.name+" "+e.lastName;return r?n.toLowerCase().includes(t.toLowerCase())&&Object(L.s)(r)===Object(L.s)(e.lastMessageCreatedAt?e.lastMessageCreatedAt:e.createdAt)?e:void 0:n.toLowerCase().includes(t.toLowerCase())}))}),[u,r,t,c]),A=Object(s.useMemo)((function(){var e=h.filter((function(e){return L.c[0===k?0:k-1].includes(e.type)}));return k>0&&d(!(e.length>0)),Object(L.d)(Object(L.h)("createdAt",e,c),r,t)}),[h,r,k,c,t,d]);return Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(M.a,{className:j.container,children:Object(a.jsxs)(Ve,{sx:{width:"100%"},onChange:function(e,o){N(o),t&&n(""),r&&l("")},value:k,"aria-label":"wrapped label tabs example",children:[Object(a.jsx)(Ge,{label:"Chats"}),Object(a.jsx)(Ge,{label:"Files"}),Object(a.jsx)(Ge,{label:"Media"}),Object(a.jsx)(Ge,{label:"Text"}),Object(a.jsx)(Ge,{label:"Audio"}),Object(a.jsx)(Ge,{label:"Video"})]})}),0===k&&Object(a.jsx)(q,{value:t,date:r,filteredAndSortedChats:R,handleListItemClick:function(e){v&&f(Object(S.c)("")),y&&f(Object(S.b)(!1)),f(Ue(e))}}),1===k&&Object(a.jsx)(te,{filteredAndSortedMessages:A,value:t,date:r,handleScrollToTheMessage:z}),2===k&&Object(a.jsx)(fe,{filteredAndSortedMessages:A,value:t,date:r,handleScrollToTheMessage:z}),3===k&&Object(a.jsx)(he,{filteredAndSortedMessages:A,value:t,date:r,handleScrollToTheMessage:z}),4===k&&Object(a.jsx)(ve,{filteredAndSortedMessages:A,value:t,date:r,handleScrollToTheMessage:z}),5===k&&Object(a.jsx)(Se,{filteredAndSortedMessages:A,value:t,date:r,handleScrollToTheMessage:z})]})},Ke=n(620),Je=n(421),Qe=n.n(Je),Xe=n(249),Ze=n.n(Xe),et=n(603),tt=n(224),nt=n.n(tt),ot=n(624),at=n(623),ct=n(279),rt=n.n(ct),it=n(592),st=Object(r.a)({container:{position:"absolute"}}),lt=function(e){var t=e.date,n=e.disabled,o=e.changeDate,c=e.handleOnOpen,r=st();return Object(a.jsx)(it.a,{className:r.container,inputVariant:"outlined",orientation:"portrait",variant:"dialog",openTo:"date",autoOk:!0,disabled:n,value:t||new Date,onOpen:c,onChange:o})},dt=n(39),bt=Object(f.a)("div")((function(e){e.theme;return{position:"relative",borderRadius:"20px",backgroundColor:"#f1f0f0",width:"100%",margin:"0 5% 0 5%"}})),jt=Object(f.a)("div")((function(e){return{padding:e.theme.spacing(0,2),height:"100%",position:"absolute",pointerEvents:"none",display:"flex",alignItems:"center",justifyContent:"center"}})),ft=Object(f.a)(et.a)((function(e){var t=e.theme;return{color:"inherit","& .MuiInputBase-input":{fontWeight:500,borderRadius:"20px",padding:t.spacing(1,1,1,0),paddingLeft:"calc(1em + ".concat(t.spacing(4),")"),transition:t.transitions.create("width"),width:"100%"}}})),pt=Object(r.a)({toolBar:{display:"flex",alignContent:"center",alignItems:"center",color:"#b1aeae",height:"7vh",padding:0,margin:0},activeSearch:{outline:"2px solid #2184f7",color:"#2184f7"},iconBtn:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}},iconArrow:{"&:hover":{transform:"rotate(360deg)",transition:"all 250ms ease-out "}}}),ut={inputProps:{"aria-label":"Switch demo"}},mt=function(e){var t=e.handleClick,n=e.handleOpenIsSearch,o=e.handleSearch,c=e.leftIsOpen,r=e.value,s=e.sort,l=e.setDate,d=e.date,b=e.disabled,f=Object(i.b)(),p=pt();return Object(a.jsxs)(at.a,{className:p.toolBar,children:[Object(a.jsx)(Ke.a,{onClick:t,children:c?Object(a.jsx)(nt.a,{className:p.iconArrow}):Object(a.jsx)(Qe.a,{className:p.iconBtn})}),Object(a.jsxs)("div",{onFocus:n,style:{display:"flex",width:"100%"},children:[Object(a.jsxs)(bt,{id:"search",className:r?p.activeSearch:void 0,children:[Object(a.jsx)(jt,{id:"search",children:Object(a.jsx)(Ze.a,{id:"search"})}),Object(a.jsx)(ft,{id:"search",value:r,onChange:o,placeholder:b?"Disabled":"Search",inputProps:{"aria-label":"search"},disabled:b})]}),Object(a.jsxs)(Ke.a,{"aria-label":"delete",size:"medium",disabled:b,children:[Object(a.jsx)(lt,{date:d,disabled:b,changeDate:l,handleOnOpen:function(){return l("")}}),Object(a.jsx)(rt.a,{fontSize:"medium",style:{color:d?"#2184f7":"#b1aeae"}})]}),Object(a.jsx)(ot.a,Object(j.a)(Object(j.a)({id:"sort",onClick:function(){Object(ze.M)({sort:!s}),setTimeout((function(){f(Object(dt.b)())}),1e3)},checked:s},ut),{},{disabled:b}))]})]})},ht=n(326),xt=n.n(ht),gt=n(325),Ot=n.n(gt),vt=n(166),yt=n.n(vt),Ct=n(599),wt=n(194),St=n.n(wt),kt=n(186),Nt=n.n(kt),It=n(171),Tt=n.n(It),zt=n(609),Rt=Object(r.a)({modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},titleWrapper:{display:"flex",justifyContent:"flex-start",alignContent:"center",alignItems:"center"}}),Mt=function(e){var t=e.setModal,n=e.chat,o=Rt(),c=Object(i.b)(),r=n.name,s=n.lastName,l=n.avatarUrl,d=n.color,b=n.companionId;return Object(a.jsx)("div",{onClick:function(e){var n=e.target.id;if("overlay"===n||"cancel"===n)return t(!1);"delete"===n&&(Object(ze.p)(b),t(!1),c(Object(Ye.b)()),c(Object(S.c)("")))},className:o.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:o.modalDelete,children:[Object(a.jsxs)("div",{className:o.titleWrapper,children:[Object(a.jsx)(p.a,{alt:r,src:l?"".concat(L.l,"/").concat(l):void 0,sx:{background:d,width:38,height:38,marginRight:2},children:"".concat(Object(L.e)(r)).concat(Object(L.e)(s))}),Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete chat"})]}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete the\n chat with ".concat("".concat(Object(L.e)(r)).concat(Object(L.p)(r,15,1)," \n ").concat(Object(L.e)(s)).concat(Object(L.p)(s,15,1)),"?")}),Object(a.jsx)(zt.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE CHAT"}),Object(a.jsx)(zt.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})},At=Object(f.a)((function(e){return Object(a.jsx)(u.a,Object(j.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(0),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"8px 8px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(4)}}}}})),Dt=Object(f.a)(Ct.a)((function(e){var t=e.theme;return{"& .MuiBadge-badge":{backgroundColor:"#44b700",color:"#44b700",boxShadow:"0 0 0 2px ".concat(t.palette.background.paper),"&::after":{position:"absolute",top:0,left:0,width:"100%",height:"100%",borderRadius:"50%",animation:"ripple 1.2s infinite ease-in-out",border:"1px solid currentColor",content:'""'}},"@keyframes ripple":{"0%":{transform:"scale(.8)",opacity:1},"100%":{transform:"scale(2.4)",opacity:0}}}})),Et=Object(r.a)({listItemInnerText:{display:"flex",alignContent:"center",alignItems:"center",flexWrap:"nowrap"},listItemInnerText__icon:{marginLeft:5},listItem_iconAvatar:{marginRight:10},listItem_iconRight:{marginRight:10,display:"flex",alignItems:"center",justifyContent:"center",alignContent:"center",flexDirection:"column"},listItem_iconTimeChecked:{display:"flex",flexWrap:"nowrap",alignItems:"center",justifyContent:"center",alignContent:"center",marginBottom:2},listItem_iconRightBtn:{cursor:"pointer",background:"#0ac40a",borderRadius:"50%",color:"#ffffff",border:"none",height:24,width:24,textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center",alignContent:"center",fontSize:12,marginLeft:10,"&:hover":{outline:"solid 3px #3ee415"}},listItem_iconRightBtnMute:{cursor:"pointer",background:"#a7aaa7",borderRadius:"50%",color:"#ffffff",border:"none",height:24,width:24,textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center",alignContent:"center",fontSize:12,marginLeft:10,"&:hover":{outline:"solid 3px #cccbcb"}},pinnedIcon:{transform:"rotate(45deg)"},listIconsRightContainer:{marginLeft:"auto",display:"flex",alignItems:"center",justifyContent:"center",alignContent:"center"},listItem_icon_time:{fontSize:12,marginLeft:5},listItem_typing:{animation:"ripple 4s infinite ease-in-out"},listItem_dots:{fontWeight:"bold",display:"inline-block",fontFamily:"monospace",clipPath:"inset(0 3ch 0 0)",animation:"$run 2s steps(5) infinite"},"@keyframes run":{to:{clipPath:"inset(0 -1ch 0 0)"}},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}}}),Lt=function(e){var t=e.chat,n=e.handleListItemClick,c=e.handleNewMsgs,r=e.id,i=e.pinned,l=e.selectedCompanionId,d=Et(),b=Object(s.useState)(null),j=Object(o.a)(b,2),f=j[0],u=j[1],h=Object(s.useState)(!1),x=Object(o.a)(h,2),g=x[0],O=x[1],v=Object(s.useState)(!1),C=Object(o.a)(v,2),w=C[0],S=C[1],k=Boolean(f),N=t.name,I=t.lastName,T=t.avatarUrl,z=t.color,R=t.companionId,M=t.mute,A=t.seen,D=t.total,W=t.watched,B=t.typing,U=t.online,_=t.lastMessage,H=t.lastMessageCreatedAt,$=t.createdAt,V=t.seenCompanion,G=R===l,q=function(e){"mute"===e&&Object(ze.k)(R),"delete"===e&&S(!0),u(null),O(!1)};return Object(a.jsxs)(a.Fragment,{children:[w&&Object(a.jsx)(Mt,{setModal:S,chat:t}),Object(a.jsxs)(P.a,{sx:{backgroundColor:G?"#26afee":g?"rgba(0, 0, 0, 0.1)":"transparent","&:hover":{backgroundColor:G?"#26afee":"rgba(0, 0, 0, 0.1)"}},onClick:function(){return n(R)},onContextMenu:function(e){return function(e){e.preventDefault(),u(e.currentTarget),O(!0)}(e)},children:[Object(a.jsx)(Y.a,{className:d.listItem_iconAvatar,children:Object(a.jsx)(Dt,{overlap:"circular",variant:"true"===U?"dot":"standard",anchorOrigin:{vertical:"bottom",horizontal:"right"},children:Object(a.jsx)(p.a,{alt:N,src:T?"".concat(L.l,"/").concat(T):void 0,sx:{background:z,width:54,height:54},children:!T&&"".concat(Object(L.e)(N)).concat(Object(L.e)(I))})})}),Object(a.jsx)(F.a,{primaryTypographyProps:{color:G?"#ffffff":"#000000"},primary:Object(a.jsxs)("div",{className:d.listItemInnerText,children:[Object(a.jsx)("span",{children:"".concat(Object(L.e)(N)).concat(Object(L.p)(N,15,1)," \n ").concat(Object(L.e)(I)).concat(Object(L.p)(I,15,1))}),M&&Object(a.jsx)(Ot.a,{style:{color:G?"#ffffff":"#959595"},className:d.listItemInnerText__icon,fontSize:"small"})]}),secondary:B?Object(a.jsxs)("span",{style:{color:G?"#ffffff":"#4d4d4d"},className:d.listItem_typing,children:["typing",Object(a.jsx)("span",{style:{color:G?"#ffffff":"#1b1b1b"},className:d.listItem_dots,children:"..."})]}):_?Object(L.p)(_,28):"".concat(Object(L.e)(N)).concat(Object(L.p)(N,15,1)," joined Telegram"),secondaryTypographyProps:{color:G?"#ffffff":"#000000"}}),Object(a.jsxs)(Y.a,{className:d.listItem_iconRight,children:[Object(a.jsxs)("div",{className:d.listItem_iconTimeChecked,children:[W&&Object(a.jsx)(St.a,{style:{color:G?"#ffffff":"#18bd03"},fontSize:"small"}),!W&&VA&&Object(a.jsx)("button",{onClick:function(e){return c(e,R)},style:{outline:G?"none":void 0,color:G&&!M?"#26afee":G?"#ffffff":void 0,backgroundColor:G&&!M?"#ffffff":G?"#a7aaa7":void 0},className:M?d.listItem_iconRightBtnMute:d.listItem_iconRightBtn,children:D-A})]})]})]}),Object(a.jsxs)(At,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:f,open:k,onClose:q,children:[Object(a.jsxs)(m.a,{onClick:function(){return q("mute")},children:[M?Object(a.jsx)(xt.a,{}):Object(a.jsx)(Ot.a,{}),M?"Unmute chat":"Mute chat"]}),Object(a.jsxs)(m.a,{onClick:function(){return function(e,t){Object(ze.m)(e,!t),q(void 0)}(r,i)},children:[i?Object(a.jsx)(y.a,{className:d.iconClose}):Object(a.jsx)(Tt.a,{}),i?"Unpin chat":"Pin chat"]}),Object(a.jsxs)(m.a,{style:{color:"#f02a2a"},onClick:function(){return q("delete")},children:[Object(a.jsx)(yt.a,{style:{color:"#f02a2a"}}),"Delete chat"]})]})]})},Wt=n(52),Bt=n(25),Pt=Object(r.a)({list:{width:"100%",maxHeight:"93vh",overflowY:"scroll","&::-webkit-scrollbar":{width:"0.4em"},"&::-webkit-scrollbar-track":{boxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",webkitBoxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",backgroundColor:"#eceeec"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#ccc8c8"},"&::-webkit-scrollbar-thumb:focus":{backgroundColor:"#959595"},"&::-webkit-scrollbar-thumb:active":{backgroundColor:"#959595"}}}),Ft=function(e){var t=e.sort,n=e.setDisabled,o=Pt(),c=Object(i.b)(),r=Object(s.useRef)(null),l=Object(i.c)(Bt.d),d=Object(i.c)(De),b=d.total,j=d.chats,f=Object(i.c)(Wt.b),p=function(e){c(Object(S.c)("")),c(Object(S.b)(!1)),c(_e(e)),f.companionId!==e&&setTimeout((function(){return c(Object(S.d)(!0))}),500)},u=function(e,t){e.stopPropagation(),c(Object(S.c)("")),c(Object(S.b)(!1)),c(_e(t)),setTimeout((function(){return c(Object(S.d)(!0))}),500)},m=Object(s.useCallback)((function(e){c(_e(e)),c(Object(S.b)(!1)),c(Object(S.c)("")),setTimeout((function(){return c(Object(S.d)(!0))}),500)}),[c]),h=Object(s.useMemo)((function(){var e=[],n=Object(L.q)(j,t).filter((function(t){return!0===t.pinned?void e.push(t):t}));return[].concat(e,Object(T.a)(n))}),[j,t]);return Object(s.useEffect)((function(){var e=function(){return c(Me())};e();var t=setInterval(e,L.o);return function(){return clearInterval(t)}}),[c]),Object(s.useEffect)((function(){r.current&&r.current.forEach((function(e,t){var n=e.total-e.seen,o=h[t];void 0!==o&&(o.total-o.seen>n&&!o.mute&&(!l&&Object(L.k)("".concat(L.m,"/telegramReceive.mp3")),Object(L.i)(o.name,(function(){return m(o.companionId)}))))})),r.current=h}),[f,h,m,c,l]),Object(s.useEffect)((function(){n("0"===b)}),[b,n]),"0"!==b?Object(a.jsx)(A.a,{className:o.list,component:"nav","aria-label":"main mailbox folders",children:h.map((function(e){return Object(a.jsx)(Lt,{chat:e,handleListItemClick:p,handleNewMsgs:u,id:e._id,pinned:e.pinned,selectedCompanionId:f.companionId},e.number)}))}):Object(a.jsx)(V,{name:"You do not have Chats yet!"})},Yt=n(614),Ut=n(615),_t=n(422),Ht=n.n(_t),$t=n(423),Vt=n.n($t),Gt=n(327),qt=n.n(Gt),Kt=n(424),Jt=n.n(Kt),Qt=n(425),Xt=n.n(Qt),Zt=Object(r.a)({overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100},container:{position:"absolute",width:270,maxWidth:"100%",top:60,left:15,zIndex:10,visibility:"visible"},list:{background:"#fdfdfd"},listItemLast:{textAlign:"center"},listIcon:{marginRight:15},listIconText:{marginRight:15,paddingLeft:6}}),en={inputProps:{"aria-label":"Switch demo"}},tn=function(e){var t=e.nightMode,n=e.silentMode,o=Zt(),c=Object(i.b)();return Object(s.useEffect)((function(){var e=function(){return c(Object(dt.b)())};e();var t=setInterval(e,L.o);return function(){return clearInterval(t)}}),[c]),Object(a.jsx)("div",{className:o.overlay,id:"overlay",children:Object(a.jsx)(Yt.a,{className:o.container,children:Object(a.jsxs)(Ut.a,{className:o.list,children:[Object(a.jsxs)(m.a,{onClick:function(){return c(Object(S.a)("contact"))},children:[Object(a.jsx)(Y.a,{className:o.listIcon,children:Object(a.jsx)(w.a,{fontSize:"medium"})}),Object(a.jsx)(F.a,{children:"New Contact"})]}),Object(a.jsxs)(m.a,{onClick:function(){return c(Object(S.a)("contacts"))},children:[Object(a.jsx)(Y.a,{className:o.listIcon,children:Object(a.jsx)(x.a,{fontSize:"medium"})}),Object(a.jsx)(F.a,{children:"Contacts"})]}),Object(a.jsxs)(m.a,{onClick:function(){return c(Object(S.a)("settings"))},children:[Object(a.jsx)(Y.a,{className:o.listIcon,children:Object(a.jsx)(Ht.a,{fontSize:"medium"})}),Object(a.jsx)(F.a,{children:"Settings"})]}),Object(a.jsxs)(m.a,{style:{cursor:"default"},children:[Object(a.jsx)(Y.a,{className:o.listIcon,children:Object(a.jsx)(Vt.a,{fontSize:"medium"})}),Object(a.jsx)(F.a,{children:"Night Mode"}),Object(a.jsx)(ot.a,Object(j.a)(Object(j.a)({onClick:function(){return Object(ze.M)({nightMode:!t})},checked:t},en),{},{style:{cursor:"pointer"}}))]}),Object(a.jsxs)(m.a,{style:{cursor:"default"},children:[Object(a.jsx)(Y.a,{className:o.listIcon,children:Object(a.jsx)(qt.a,{fontSize:"medium"})}),Object(a.jsx)(F.a,{children:"Silent Mode"}),Object(a.jsx)(ot.a,Object(j.a)(Object(j.a)({onClick:function(){return Object(ze.M)({silentMode:!n})},checked:n},en),{},{style:{cursor:"pointer"}}))]}),Object(a.jsx)("a",{style:{textDecoration:"none",color:"inherit"},target:"blank",href:"https://www.makeuseof.com/tag/useful-telegram-features/",children:Object(a.jsxs)(m.a,{children:[Object(a.jsx)(Y.a,{className:o.listIcon,children:Object(a.jsx)(Jt.a,{fontSize:"medium"})}),Object(a.jsx)(F.a,{children:"Telegram Features"})]})}),Object(a.jsx)("a",{style:{textDecoration:"none",color:"inherit"},target:"blank",href:"https://bugs.telegram.org/?tag_ids=41&sort=time",children:Object(a.jsxs)(m.a,{children:[Object(a.jsx)(Y.a,{className:o.listIcon,children:Object(a.jsx)(Xt.a,{fontSize:"medium"})}),Object(a.jsx)(F.a,{children:"Report bug"})]})}),Object(a.jsx)("a",{style:{textDecoration:"none",color:"inherit"},target:"blank",href:"https://www.msn.com/en-in/money/tech/telegram-webk-and-webz-web-apps-launched-whats-the-difference/ar-BB1fOwLR",children:Object(a.jsxs)(m.a,{children:[Object(a.jsx)(Y.a,{className:o.listIconText,children:"K"}),Object(a.jsx)(F.a,{children:"Switch to K Version"})]})}),Object(a.jsx)("a",{style:{textDecoration:"none",color:"inherit"},target:"blank",href:"https://desktop.telegram.org/changelog",children:Object(a.jsxs)(m.a,{children:[Object(a.jsx)(Y.a,{className:o.listIconText,children:"W"}),Object(a.jsx)(F.a,{children:"Switch to Old Version"})]})}),Object(a.jsx)(Z.a,{}),Object(a.jsx)(m.a,{style:{cursor:"default"},children:Object(a.jsx)(F.a,{secondary:"Telegram WebZ 1.32.3",className:o.listItemLast})})]})})})},nn=n(170),on=Object(f.a)((function(e){return Object(a.jsx)(u.a,Object(j.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(0),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"8px 8px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(4)}}}}})),an=Object(r.a)({listItem_iconAvatar:{marginRight:10},modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},titleWrapper:{display:"flex",justifyContent:"flex-start",alignContent:"center",alignItems:"center"},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}},pinnedIcon:{marginLeft:"auto",transform:"rotate(45deg)",color:"#959595"}}),cn=function(e){var t=e.contact,n=e.handleListItemClick,c=e.rightIsOpen,r=e.id,l=e.pinned,d=an(),b=Object(i.b)(),j=Object(s.useState)(null),f=Object(o.a)(j,2),u=f[0],h=f[1],x=Object(s.useState)(!1),g=Object(o.a)(x,2),O=g[0],v=g[1],C=Object(s.useState)(!1),w=Object(o.a)(C,2),k=w[0],N=w[1],I=Boolean(u),T=t.name,z=t.lastName,R=t.avatarUrl,M=t.color,A=t.companionId,D=t.createdAt,E=t.number,W=t._id,B=function(e){"copy"===e&&Object(L.a)("Number"),"delete"===e&&N(!0),h(null),v(!1)};return Object(a.jsxs)("div",{children:[Object(a.jsxs)(P.a,{selected:O,onClick:function(){return n(A)},onContextMenu:function(e){return function(e){e.preventDefault(),h(e.currentTarget),v(!0)}(e)},children:[Object(a.jsx)(Y.a,{className:d.listItem_iconAvatar,children:Object(a.jsx)(p.a,{alt:T,src:R?"".concat(L.l,"/").concat(R):void 0,sx:{background:M,width:54,height:54},children:!R&&"".concat(Object(L.e)(T)).concat(Object(L.e)(z))})}),Object(a.jsx)(F.a,{primary:"".concat(Object(L.e)(T)).concat(Object(L.p)(T,15,1),"\n ").concat(Object(L.e)(z)).concat(Object(L.p)(z,15,1)),secondary:"Registered since ".concat(Object(L.r)(D))}),l&&Object(a.jsx)(Tt.a,{className:d.pinnedIcon,fontSize:"small"})]}),Object(a.jsxs)(on,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:u,open:I,onClose:B,children:[Object(a.jsx)(nn.CopyToClipboard,{onCopy:function(){return B("copy")},text:E,children:Object(a.jsxs)(m.a,{children:[Object(a.jsx)(ue.a,{}),"Copy number"]})}),Object(a.jsxs)(m.a,{onClick:function(){return function(e,t){Object(ze.n)(e,!t),B(void 0)}(r,l)},children:[l?Object(a.jsx)(y.a,{className:d.iconClose}):Object(a.jsx)(Tt.a,{}),l?"Unpin contact":"Pin contact"]}),Object(a.jsxs)(m.a,{style:{color:"#f02a2a"},onClick:function(){return B("delete")},children:[Object(a.jsx)(yt.a,{style:{color:"#f02a2a"}}),"Delete contact"]})]}),k&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return N(!1);"delete"===t&&("edit"===c&&b(Object(S.c)("credentials")),Object(ze.q)(W),N(!1))},className:d.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:d.modalDelete,children:[Object(a.jsxs)("div",{className:d.titleWrapper,children:[Object(a.jsx)(p.a,{alt:T,src:R?"".concat(L.l,"/").concat(R):void 0,sx:{background:M,width:38,height:38,marginRight:2},children:"".concat(Object(L.e)(T)).concat(Object(L.e)(z))}),Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete contact"})]}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete contact\n ".concat("".concat(Object(L.e)(T)).concat(Object(L.p)(T,15,1),"\n ").concat(Object(L.e)(z)).concat(Object(L.p)(z,15,1)),"?")}),Object(a.jsx)(zt.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE CONTACT"}),Object(a.jsx)(zt.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})},rn=Object(Ae.a)([function(e){return e.contacts.contacts}],(function(e){return e})),sn=Object(Ae.a)([function(e){return e.contacts}],(function(e){return e})),ln=n(46),dn=function(){return function(){var e=Object(Ie.a)(Ne.a.mark((function e(t){var n;return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(ze.g)();case 3:(n=e.sent)&&t(Object(ln.b)(n)),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),t(Object(ln.a)());case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}()},bn=function(e){return function(){var t=Object(Ie.a)(Ne.a.mark((function t(n){return Ne.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Object(ze.a)(e);case 3:t.next=7;break;case 5:t.prev=5,t.t0=t.catch(0);case 7:case"end":return t.stop()}}),t,null,[[0,5]])})));return function(e){return t.apply(this,arguments)}}()},jn=Object(r.a)({list:{width:"100%",maxHeight:"93vh",overflowY:"scroll","&::-webkit-scrollbar":{width:"0.4em"},"&::-webkit-scrollbar-track":{boxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",webkitBoxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",backgroundColor:"#eceeec"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#ccc8c8"},"&::-webkit-scrollbar-thumb:focus":{backgroundColor:"#959595"},"&::-webkit-scrollbar-thumb:active":{backgroundColor:"#959595"}}}),fn=function(e){var t=e.value,n=e.handleClick,o=e.sort,c=e.date,r=e.setDisabled,l=jn(),d=Object(i.b)(),b=Object(i.c)(sn),j=b.total,f=b.contacts,p=Object(i.c)(We),u=function(e){n(),d(Object(S.c)("")),d(Object(S.b)(!1)),d(Ue(e))};Object(s.useEffect)((function(){d(Object(S.a)("contacts"))}),[d]),Object(s.useEffect)((function(){r("0"===j)}),[j,r]),Object(s.useEffect)((function(){var e=function(){return d(dn())};e();var t=setInterval(e,L.o);return function(){return clearInterval(t)}}),[d]);var m=Object(s.useMemo)((function(){var e=[],n=Object(L.h)("name",f,o).filter((function(e){var n=e.name+" "+e.lastName;return c?n.toLowerCase().includes(t.toLowerCase())&&Object(L.s)(c)===Object(L.s)(e.createdAt)?e:void 0:n.toLowerCase().includes(t.toLowerCase())})).filter((function(t){return!0===t.pinned?void e.push(t):t}));return[].concat(e,Object(T.a)(n))}),[f,c,t,o]);return"0"!==j?Object(a.jsx)(A.a,{className:l.list,component:"nav","aria-label":"main mailbox folders",children:m.length>0?m.map((function(e){return Object(a.jsx)(cn,{contact:e,handleListItemClick:u,rightIsOpen:p,id:e._id,pinned:e.pinned},e.number)})):Object(a.jsx)(V,{name:"Can not find Contact by request : ".concat(t)})}):Object(a.jsx)(V,{name:"You do not have Contact yet!"})},pn=n(593),un=n(587),mn=Object(r.a)({toolBar:{color:"#b1aeae",height:"7vh"},iconArrow:{"&:hover":{transform:"rotate(360deg)",transition:"all 250ms ease-out "}}}),hn=function(e){var t=e.handleClick,n=mn();return Object(a.jsx)(at.a,{className:n.toolBar,children:Object(a.jsx)(Ke.a,{onClick:t,children:Object(a.jsx)(nt.a,{className:n.iconArrow})})})},xn=Object(r.a)({container:{display:"flex",alignItems:"center",alignContent:"center",flexDirection:"column",width:350,margin:"0 auto",paddingBottom:24},title:{marginBottom:20,textAlign:"center"},buttonNext:{marginTop:20,height:50,color:"#f8f8f8",backgroundColor:"#1d74c5"},textField:{marginBottom:20}}),gn=function(e){var t=e.handleClick,n=xn(),c=Object(i.b)(),r=Object(s.useState)(""),l=Object(o.a)(r,2),d=l[0],b=l[1],j=function(){var e=Object(Ie.a)(Ne.a.mark((function e(){return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c(bn(d)),c(Object(S.a)("contacts"));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),f=function(){return!(d.length<13||d.length>13)&&(d.slice(0,1),!0)};return Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(hn,{handleClick:t}),Object(a.jsxs)("div",{onKeyDown:function(e){"Enter"===e.code&&f()&&j()},className:n.container,children:[Object(a.jsx)(E.a,{className:n.title,variant:"h5",color:"initial",children:"Add new contact"}),Object(a.jsx)(pn.a,{id:"number",name:"NUMBER",label:"Write down a number,+ is requirement",value:d,fullWidth:!0,variant:"outlined",onChange:function(e){var t=e.target.value.split(" ").join("").trim();b(t)},className:n.textField,required:!0}),f()&&Object(a.jsx)(un.a,{onClick:j,className:n.buttonNext,color:"primary",variant:"contained",fullWidth:!0,children:" ADD"})]})]})},On=n(187),vn=n.n(On),yn=n(429),Cn=n.n(yn),wn=n(328),Sn=n.n(wn),kn=Object(f.a)((function(e){return Object(a.jsx)(u.a,Object(j.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(5),minWidth:180,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"4px 4px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(4)}}}}})),Nn=function(){var e=Object(i.b)(),t=Object(s.useState)(null),n=Object(o.a)(t,2),c=n[0],r=n[1],l=Boolean(c),d=function(t){"logout"===t&&e(Object(dt.d)()),r(null)};return Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(Ke.a,{onClick:function(e){return r(e.currentTarget)},"aria-label":"delete",style:{marginLeft:5},size:"medium",children:Object(a.jsx)(Sn.a,{fontSize:"medium"})}),Object(a.jsx)(kn,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:c,open:l,onClose:d,children:Object(a.jsxs)(m.a,{style:{fontWeight:500},onClick:function(){return d("logout")},children:[Object(a.jsx)(Cn.a,{}),"Log Out"]})})]})},In=Object(r.a)({container:{width:"100%",height:"7vh",padding:10,display:"flex",alignContent:"center",alignItems:"center",backgroundColor:"#ffffff"},iconArrow:{"&:hover":{transform:"rotate(360deg)",transition:"all 250ms ease-out "}}}),Tn=function(e){var t=e.handleClick,n=In(),o=Object(i.b)();return Object(a.jsxs)(D.a,{className:n.container,direction:"row",spacing:21,children:[Object(a.jsx)(Ke.a,{onClick:t,"aria-label":"delete",size:"medium",children:Object(a.jsx)(nt.a,{className:n.iconArrow,fontSize:"medium"})}),Object(a.jsx)(E.a,{style:{marginLeft:20,color:"#474747"},variant:"h6",color:"initial",children:"Settings"}),Object(a.jsx)(Ke.a,{onClick:function(){return o(Object(S.a)("edit"))},style:{marginLeft:"auto"},"aria-label":"delete",size:"medium",children:Object(a.jsx)(vn.a,{fontSize:"medium"})}),Object(a.jsx)(Nn,{})]})},zn=n(329),Rn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAAD6AQMAAACyIsh+AAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAANQTFRFAAAAp3o92gAAAAF0Uk5TAEDm2GYAAAAeSURBVHic7cEBAQAAAIIg/69uSEABAAAAAAAAAL8GIDoAASo5tcIAAAAASUVORK5CYII=",Mn=Object(r.a)({modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},titleWrapper:{display:"flex",justifyContent:"flex-start",alignContent:"center",alignItems:"center"}}),An=function(e){var t=e.setModal,n=e.index,o=e.setIndex,c=Mn();return Object(a.jsx)("div",{onClick:function(e){var a=e.target.id;if("overlay"===a||"cancel"===a)return t(!1);"delete"===a&&(Object(ze.t)(n),o(n-1),t(!1))},className:c.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:c.modalDelete,children:[Object(a.jsx)("div",{className:c.titleWrapper,children:Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete image"})}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete the Image?"}),Object(a.jsx)(zt.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE IMAGE"}),Object(a.jsx)(zt.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})},Dn=Object(r.a)({container:{width:"100%",backgroundColor:"#ffffff",position:"relative"},nameTitle:{position:"absolute",color:"#ffffff",backgroundColor:"rgb(0,0,0)",borderRadius:10,padding:8,fontSize:18,zIndex:10,top:"6%",left:"50%",marginLeft:"-45%",opacity:.7,transition:"opacity .35s ease-in-out"},timeTitle:{position:"absolute",color:"#ffffff",backgroundColor:"rgb(0,0,0)",borderRadius:10,padding:4,fontSize:15,top:"1%",left:"50%",marginLeft:"-45%",opacity:.7,transition:"opacity .35s ease-in-out"},countryTitle:{position:"absolute",color:"#ffffff",backgroundColor:"rgb(0,0,0)",borderRadius:10,padding:4,fontSize:15,top:"13%",left:"50%",marginLeft:"-45%",opacity:.7,transition:"opacity .35s ease-in-out"},credentialsTitle:{position:"absolute",color:"#ffffff",fontSize:100,top:"30%",left:"38%"},credentialsLowTitle:{position:"absolute",color:"#ffffff",fontSize:25,top:"90%",left:"9%"},iconDeleteWrapper:{position:"absolute",top:"1%",right:"9%"},iconDelete:{"&:hover":{opacity:1,color:"#fa0000",animation:"$shake 0.5s"}},"@keyframes shake":{"0%":{transform:"translate(0.5px, 0.5px) rotate(0deg)"},"10%":{transform:"translate(-0.5px, -1px) rotate(-1deg)"},"20%":{transform:"translate(-1.5px, 0px) rotate(1deg)"},"30%":{transform:"translate(1.5px, 1px) rotate(0deg)"},"40%":{transform:"translate(0.5px, -0.5px) rotate(1deg)"},"50%":{transform:"translate(-0.5px, 1px) rotate(-1deg)"},"60%":{transform:"translate(-1.5px, 0.5px) rotate(0deg)"},"70%":{transform:"translate(1.5px, 0.5px) rotate(-1deg)"},"80%":{transform:"translate(-0.5px, -0.5px) rotate(1deg)"},"90%":{transform:"translate(0.5px, 1px) rotate(0deg)"},"100%":{transform:"translate(0.5px, -1px) rotate(-1deg)"}}}),En=function(){var e=Dn(),t=Object(i.c)(Bt.a),n=t.name,c=t.lastName,r=t.avatarsArr,l=t.online,d=t.createdAt,b=t.color,j=t.country,f=Object(s.useState)(!1),u=Object(o.a)(f,2),m=u[0],h=u[1],x=Object(s.useState)(0),g=Object(o.a)(x,2),O=g[0],v=g[1],y=0!==r.length;return Object(a.jsxs)("div",{className:e.container,children:[m&&Object(a.jsx)(An,{setModal:h,index:O,setIndex:v}),Object(a.jsx)(zn.Carousel,{onChange:function(e){return v(e)},selectedItem:O,children:y?r.map((function(e){var t=e.avatarUrl,n=e.updatedAt;return Object(a.jsxs)("div",{children:[Object(a.jsx)("img",{alt:"pic",src:"".concat(L.l,"/").concat(t)}),Object(a.jsx)("p",{className:"legend",children:Object(L.r)(n)})]},t)})):[Object(a.jsxs)("div",{children:[Object(a.jsx)("img",{alt:"transparentPic",src:Rn,style:{background:"linear-gradient(to bottom, ".concat(b,", ").concat(b," 80%, #5d5d5d 100%)")}}),Object(a.jsx)("p",{className:"legend",children:Object(L.r)(d)})]})]}),Object(a.jsx)("span",{className:e.nameTitle,children:"".concat(Object(L.e)(n)).concat(Object(L.p)(n,15,1),"\n ").concat(Object(L.e)(c)).concat(Object(L.p)(c,15,1))}),Object(a.jsx)("span",{className:e.timeTitle,children:"true"===l?"online":"last seen ".concat(Object(L.r)(l))}),Object(a.jsx)("span",{className:e.countryTitle,children:j}),!y&&Object(a.jsx)("span",{className:e.credentialsTitle,children:"".concat(Object(L.e)(n)).concat(Object(L.e)(c))}),!y&&Object(a.jsx)("span",{className:e.credentialsLowTitle,children:"".concat(Object(L.e)(n)).concat(Object(L.e)(c))}),r.length>0&&Object(a.jsx)("div",{className:e.iconDeleteWrapper,children:Object(a.jsx)(p.a,{className:e.iconDelete,onClick:function(){return h(!0)},sx:{width:36,height:36,backgroundColor:"rgb(0,0,0)",color:"#ffffff",opacity:.5,cursor:"pointer"},children:Object(a.jsx)(yt.a,{fontSize:"medium"})})})]})},Ln=n(250),Wn=n.n(Ln),Bn=Object(r.a)({container:{width:"100%",backgroundColor:"#ffffff"}}),Pn=function(){var e=Bn(),t=Object(i.c)(Bt.c);return Object(a.jsx)(Yt.a,{className:e.container,children:Object(a.jsx)(Ut.a,{children:Object(a.jsx)(nn.CopyToClipboard,{onCopy:function(){return Object(L.a)("Number")},text:t,children:Object(a.jsxs)(m.a,{children:[Object(a.jsx)(Y.a,{style:{marginRight:15},children:Object(a.jsx)(Wn.a,{fontSize:"medium"})}),Object(a.jsx)(F.a,{primary:t,secondary:"Copy number"})]})})})})},Fn=function(e){var t=e.handleClick,n=Object(i.b)();return Object(s.useEffect)((function(){var e=function(){return n(Object(dt.b)())};e();var t=setInterval(e,L.o);return function(){return clearInterval(t)}}),[n]),Object(a.jsxs)("div",{style:{backgroundColor:"#f3f2f2",height:"100%",width:"100%"},children:[Object(a.jsx)(Tn,{handleClick:t}),Object(a.jsx)(En,{}),Object(a.jsx)(Pn,{})]})},Yn=Object(r.a)({container:{paddingLeft:10,height:"7vh",width:"100%",display:"flex",alignContent:"center",alignItems:"center",backgroundColor:"#ffffff"},iconArrow:{"&:hover":{transform:"rotate(360deg)",transition:"all 250ms ease-out "}}}),Un=function(){var e=Yn(),t=Object(i.b)();return Object(a.jsxs)(D.a,{className:e.container,direction:"row",spacing:21,children:[Object(a.jsx)(Ke.a,{onClick:function(){return t(Object(S.a)("settings"))},"aria-label":"delete",size:"medium",children:Object(a.jsx)(nt.a,{className:e.iconArrow,fontSize:"medium"})}),Object(a.jsx)(E.a,{style:{marginLeft:20,color:"#474747"},variant:"h6",color:"initial",children:"Edit profile"})]})},_n=n(335),Hn=n.n(_n),$n=n(282),Vn=n.n($n),Gn=n(283),qn=n.n(Gn),Kn=n(293),Jn=n(281),Qn=n.n(Jn),Xn=Object(r.a)({container:{display:"flex",alignItems:"center",alignContent:"center",flexDirection:"column",width:"100%",padding:20,paddingTop:0,position:"relative",backgroundColor:"#ffffff"},imgWrapper:{marginBottom:30,width:"100%",display:"flex",flexWrap:"nowrap",alignItems:"center",alignContent:"center",flexDirection:"row",justifyContent:"center"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden",display:"flex",justifyContent:"center",alignContent:"center",alignItems:"center",flexDirection:"column"},capturedPicture:{borderRadius:10,border:"solid 2px rgb(62, 149, 231)"},capturePhoto:{color:"#ffffff",cursor:"pointer","&:hover":{color:"#48ff00",animation:"$rotating 2s linear infinite"}},"@keyframes rotating":{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}}}),Zn=function(e){var t=Xn(),n=e.user,o=e.name,c=e.setName,r=e.lastName,i=e.setLastName,l=e.openBtn,d=e.setOpenBtn,b=e.file,f=e.setFile,u=e.camera,m=e.setCamera,h=e.selfie,x=e.setSelfie,g=n.avatarUrl,O=n.color,v=n.silentMode,y=Object(Kn.a)({noDrag:!0,accept:"image/*"}),C=y.getRootProps,w=y.getInputProps,S=y.acceptedFiles,k=function(e){!l&&d(!0);var t=Object(L.f)(e.target.value);switch(e.target.name){case"name":c(t);break;case"lastName":i(t)}};return Object(s.useEffect)((function(){S.slice(-1)[0]&&(f(S.slice(-1)[0]),x(!1),d(!0))}),[f,x,d,S]),Object(a.jsxs)("div",{className:t.container,children:[Object(a.jsxs)("div",{className:t.imgWrapper,children:[Object(a.jsxs)("div",Object(j.a)(Object(j.a)({},C()),{},{children:[Object(a.jsx)(Hn.a,{fontSize:"large",sx:{color:b?"rgb(62, 149, 231)":"#6b6b6b","&:hover":{color:"rgb(41, 139, 231)"},cursor:"pointer"}}),Object(a.jsx)("input",Object(j.a)({},w()))]})),Object(a.jsx)(J.a,{style:{margin:"0px 20px"},children:Object(a.jsx)(p.a,{alt:o,src:g?"".concat(L.l,"/").concat(g):void 0,sx:{background:O,width:120,height:120,fontSize:30},children:"".concat(Object(L.e)(o)).concat(Object(L.e)(r))})}),Object(a.jsx)(Vn.a,{onClick:function(){m(!0),b&&f(null)},fontSize:"large",sx:{color:h?"rgb(62, 149, 231)":"#6b6b6b","&:hover":{color:"rgb(41, 139, 231)"},cursor:"pointer"}})]}),u&&Object(a.jsx)("div",{onClick:function(e){"overlay"===e.target.id&&m(!1)},id:"overlay",className:t.overlay,children:Object(a.jsx)(Qn.a,{audio:!1,screenshotFormat:"image/jpeg",width:"40%",videoConstraints:{width:1280,height:720,facingMode:"user"},style:{marginBottom:30},children:function(e){var n=e.getScreenshot;return Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(qn.a,{onClick:function(){x(n()),d(!0),!v&&Object(L.j)("".concat(L.m,"/cameraCapture.mp3"))},className:t.capturePhoto,fontSize:"large",style:{marginBottom:30}}),Object(a.jsx)("img",{className:t.capturedPicture,width:"300",height:"174",style:{visibility:h?"visible":"hidden"},src:h,alt:"chosen pic"})]})}})}),Object(a.jsx)(pn.a,{id:"name",name:"name",label:"Name",value:o,fullWidth:!0,variant:"outlined",onChange:k,style:{marginBottom:30}}),Object(a.jsx)(pn.a,{id:"lastName",name:"lastName",label:"LastName",value:r,fullWidth:!0,variant:"outlined",onChange:k})]})},eo=Object(r.a)({container:{position:"absolute",content:"",top:"92vh",right:20},avatarArrow:{cursor:"pointer","&:hover":{backgroundColor:"rgb(62, 149, 231)"}}}),to=function(e){var t=e.handleSubmit,n=eo();return Object(a.jsx)("div",{className:n.container,children:Object(a.jsx)(p.a,{onClick:t,className:n.avatarArrow,sx:{width:56,height:56,backgroundColor:"rgb(41, 139, 231)",color:"#ffffff"},children:Object(a.jsx)(Nt.a,{fontSize:"medium"})})})},no=Object(r.a)({container:{width:"100%",height:"100%",backgroundColor:"#f3f2f2",position:"relative"}}),oo=function(){var e=no(),t=Object(i.b)(),n=Object(i.c)(Bt.a),c=Object(s.useState)(""),r=Object(o.a)(c,2),l=r[0],d=r[1],b=Object(s.useState)(""),j=Object(o.a)(b,2),f=j[0],p=j[1],u=Object(s.useState)(!1),m=Object(o.a)(u,2),h=m[0],x=m[1],g=Object(s.useState)(!1),O=Object(o.a)(g,2),v=O[0],y=O[1],C=Object(s.useState)(null),w=Object(o.a)(C,2),S=w[0],k=w[1],N=Object(s.useState)(null),I=Object(o.a)(N,2),T=I[0],z=I[1],R=n.name,M=n.lastName,A=function(){var e=Object(Ie.a)(Ne.a.mark((function e(){var t;return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l===R&&f===M){e.next=3;break}return e.next=3,Object(ze.K)({name:l,lastName:f,originalName:l,originalLastName:f});case 3:if(S&&fetch(S).then((function(e){return e.blob()})).then((function(e){var t=new File([e],"selfie",{type:"image/jpeg"}),n=new FormData;n.append("avatar",t),Object(ze.N)(n)})),!T){e.next=9;break}return(t=new FormData).append("avatar",T),e.next=9,Object(ze.N)(t);case 9:T&&z(null),S&&k(null),h&&x(!1);case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(s.useEffect)((function(){var e=function(){return!h&&t(Object(dt.b)())};e();var n=setInterval(e,L.o);return function(){return clearInterval(n)}}),[h,t]),Object(s.useEffect)((function(){R&&d(R),M&&p(M)}),[R,M]),Object(a.jsxs)("div",{className:e.container,children:[h&&Object(a.jsx)(to,{handleSubmit:A}),Object(a.jsx)(Un,{}),Object(a.jsx)(Zn,{user:n,name:l,setName:d,lastName:f,setLastName:p,openBtn:h,setOpenBtn:x,file:T,setFile:z,camera:v,setCamera:y,selfie:S,setSelfie:k})]})},ao=function(e){var t=e.chatDivRef,n=Object(i.b)(),r=Object(i.c)(Bt.a),l=r.sort,d=r.nightMode,j=r.silentMode,f=Object(i.c)(Le),p=Object(s.useState)(!1),u=Object(o.a)(p,2),m=u[0],h=u[1],x=Object(s.useState)(!1),g=Object(o.a)(x,2),O=g[0],v=g[1],y=Object(s.useState)(!0),C=Object(o.a)(y,2),w=C[0],k=C[1],N=Object(s.useState)(""),T=Object(o.a)(N,2),z=T[0],R=T[1],M=Object(s.useState)(""),A=Object(o.a)(M,2),D=A[0],E=A[1],L=Object(s.useRef)(null),W=function(){n(Object(S.a)("")),h(!0)};return Object(s.useEffect)((function(){R(""),E(""),h(!1),v(!1)}),[f]),Object(s.useEffect)((function(){var e=function(e){"overlay"===e.target.id&&(h(!1),v(!1))};if(!L.current){var t=document.getElementById("modal-root");t&&(t.addEventListener("click",e),L.current=t)}return function(){L.current&&(L.current.removeEventListener("click",e),L.current=null)}}),[]),Object(a.jsxs)(c.a,{item:!0,lg:3,style:{position:"relative",backgroundColor:"#ffffff"},onMouseEnter:function(){return!O&&v(!0)},onMouseLeave:function(){return O&&v(!1)},children:[""===f||"contacts"===f||"searchChats"===f||"searchAllMessages"===f?Object(a.jsx)(mt,{handleClick:W,handleOpenIsSearch:function(e){var t=e.target.id;""===f&&"sort"===t||""===f&&n(Object(S.a)("searchChats"))},sort:l,handleSearch:function(e){return R(e.target.value)},leftIsOpen:f,value:z,setDate:E,date:D,disabled:w}):null,"searchChats"===f||"searchAllMessages"===f?Object(a.jsx)(qe,{value:z,setValue:R,sort:l,date:D,setDate:E,setDisabled:k,chatDivRef:t}):null,""===f&&Object(a.jsx)(Ft,{sort:l,setDisabled:k}),""===f&&O&&Object(a.jsx)(I,{setPopup:v}),m&&L.current&&Object(b.createPortal)(Object(a.jsx)(tn,{nightMode:d,silentMode:j}),L.current),"contacts"===f&&Object(a.jsx)(fn,{handleClick:W,value:z,sort:l,date:D,setDisabled:k}),"contact"===f&&Object(a.jsx)(gn,{handleClick:W}),"settings"===f&&Object(a.jsx)(Fn,{handleClick:W}),"edit"===f&&Object(a.jsx)(oo,{})]})},co=n(625),ro=function(){var e=Object(i.b)(),t=Object(i.c)(Wt.a),n=t.name,o=t.lastName,c=t.avatarUrl,r=t.color,s=t.online;return Object(a.jsxs)(P.a,{onClick:function(){return e(Object(S.c)("credentials"))},children:[Object(a.jsx)(Y.a,{children:Object(a.jsx)(p.a,{alt:n,src:c?"".concat(L.l,"/").concat(c):void 0,sx:{background:r,width:44,height:44},children:!c&&"".concat(Object(L.e)(n)).concat(Object(L.e)(o))})}),Object(a.jsx)(F.a,{primary:"".concat(Object(L.e)(n)).concat(Object(L.p)(n,15,1),"\n ").concat(Object(L.e)(o)).concat(Object(L.p)(o,15,1)),secondaryTypographyProps:{color:"#0379af"},secondary:"true"===s?"online":"last seen ".concat(Object(L.r)(s))})]})},io=n(174),so=n.n(io),lo=Object(f.a)((function(e){return Object(a.jsx)(u.a,Object(j.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(-2),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"14px 14px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(4)}}}}})),bo=function(e){var t=e.setModalDelete,n=e.setIsSomeSelected,c=Object(s.useState)(null),r=Object(o.a)(c,2),l=r[0],d=r[1],b=Boolean(l),j=Object(i.c)(Wt.a),f=j.companionId,p=j.mute,u=function(e){"mute"===e&&Object(ze.k)(f),"deleteModal"===e&&t(!0),d(null)};return Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(Ke.a,{onClick:function(e){e.stopPropagation(),d(e.currentTarget)},"aria-label":"delete",size:"medium",children:Object(a.jsx)(Sn.a,{fontSize:"medium"})}),Object(a.jsxs)(lo,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:l,open:b,onClose:u,children:[Object(a.jsxs)(m.a,{onClick:function(){return u("mute")},children:[p?Object(a.jsx)(xt.a,{}):Object(a.jsx)(Ot.a,{}),p?"Unmute":"Mute"]}),Object(a.jsxs)(m.a,{onClick:function(){n(!0),u(void 0)},children:[Object(a.jsx)(so.a,{}),"Select message"]}),Object(a.jsxs)(m.a,{style:{color:"#f02a2a"},onClick:function(){return u("deleteModal")},children:[Object(a.jsx)(yt.a,{style:{color:"#f02a2a"}}),"Delete chat"]})]})]})},jo=Object(r.a)({modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},titleWrapper:{display:"flex",justifyContent:"flex-start",alignContent:"center",alignItems:"center"}}),fo=function(e){var t=e.setModalDelete,n=jo(),o=Object(i.b)(),c=Object(i.c)(Wt.a),r=c.name,s=c.lastName,l=c.avatarUrl,d=c.color,b=c.companionId;return Object(a.jsx)("div",{onClick:function(e){var n=e.target.id;if("overlay"===n||"cancel"===n)return t(!1);"delete"===n&&(Object(ze.p)(b),t(!1),o(Object(Ye.b)()),o(Object(S.c)("")))},className:n.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:n.modalDelete,children:[Object(a.jsxs)("div",{className:n.titleWrapper,children:[Object(a.jsx)(p.a,{alt:r,src:l?"".concat(L.l,"/").concat(l):void 0,sx:{background:d,width:38,height:38,marginRight:2},children:"".concat(Object(L.e)(r)).concat(Object(L.e)(s))}),Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete chat"})]}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete the\n chat with ".concat("".concat(Object(L.e)(r)).concat(Object(L.p)(r,15,1)," \n ").concat(Object(L.e)(s)).concat(Object(L.p)(s,15,1)),"?")}),Object(a.jsx)(zt.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE CHAT"}),Object(a.jsx)(zt.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})},po=Object(r.a)({container:{marginLeft:20,display:"flex",alignContent:"center",alignItems:"center"}}),uo=function(e){var t=e.setIsSomeSelected,n=e.handleStartCall,c=po(),r=Object(i.b)(),l=Object(s.useState)(!1),d=Object(o.a)(l,2),b=d[0],j=d[1];return Object(a.jsxs)(D.a,{className:c.container,direction:"row",children:[Object(a.jsx)(Ke.a,{onClick:function(e){e.stopPropagation(),r(Object(S.c)("search"))},"aria-label":"delete",size:"medium",children:Object(a.jsx)(Ze.a,{fontSize:"medium"})}),Object(a.jsx)(Ke.a,{onClick:n,"aria-label":"delete",size:"medium",children:Object(a.jsx)(Wn.a,{fontSize:"medium"})}),Object(a.jsx)(bo,{setModalDelete:j,setIsSomeSelected:t}),b&&Object(a.jsx)(fo,{setModalDelete:j})]})},mo=n(437),ho=n.n(mo),xo=n(199),go=n.n(xo),Oo=Object(r.a)({container:{marginLeft:20,display:"flex",alignContent:"center",alignItems:"center",position:"relative"},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}},listWrapper:{background:"#fdfdfd",padding:0},listWrapperDashes:{position:"absolute",top:0,width:2,height:"100%",display:"flex",flexDirection:"column",justifyContent:"space-around",flexWrap:"nowrap",listStyle:"none"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},modalUnpin:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},folderIcon:{color:"#54b0fc"}}),vo=function(e){var t=e.chatDivRef,n=e.handleOpenPinned,c=Oo(),r=Object(i.c)(He),l=Object(s.useState)(null),d=Object(o.a)(l,2),b=d[0],j=d[1],f=Object(s.useState)(0),p=Object(o.a)(f,2),u=p[0],h=p[1],x=Object(s.useState)(!1),g=Object(o.a)(x,2),O=g[0],v=g[1],C=100/r.length,w=C-C/100*20;return Object(s.useEffect)((function(){j(r[u])}),[r,u]),b?Object(a.jsxs)(D.a,{className:c.container,direction:"row",children:[Object(a.jsx)("ul",{className:c.listWrapperDashes,children:r.map((function(e){var t=e._id;return Object(a.jsx)("li",{style:{backgroundColor:b._id===t?"#00aeff":"#addbf0",height:"".concat(w,"%")}},t)}))}),Object(a.jsx)("ul",{className:c.listWrapper,children:Object(a.jsxs)(m.a,{onClick:function(){var e,n=t.current.childNodes[0].childNodes;r.length-1===u?(h(0),e=Object(T.a)(n).find((function(e){return e.id===r[0]._id}))):(h((function(e){return e+1})),e=Object(T.a)(n).find((function(e){return e.id===r[u+1]._id}))),e&&((e=Object(T.a)(e.childNodes).slice(-1)[0]).style.backgroundColor="rgba(70, 70, 70, 0.4)",e.style.boxShadow="0px 0px 6px 0px #ffffff",e.scrollIntoView({behavior:"smooth"}),setTimeout((function(){e.style.backgroundColor="unset",e.style.boxShadow="unset"}),2e3))},children:[Object(a.jsx)(F.a,{style:{margin:"0px 10px 0px 20px"},primary:"Pinned Message ".concat(u+1," of ").concat(r.length),primaryTypographyProps:{color:"#0379af",fontSize:16},secondary:"Type : ".concat(b.type.toUpperCase()),secondaryTypographyProps:{fontSize:16}}),"text"===b.type&&Object(a.jsx)(ue.a,{className:c.folderIcon,fontSize:"large"}),"audio"===b.type&&Object(a.jsx)(ge.a,{className:c.folderIcon,fontSize:"large"}),"video"===b.type&&Object(a.jsx)(Ce.a,{className:c.folderIcon,fontSize:"large"}),"image"===b.type&&Object(a.jsx)(go.a,{className:c.folderIcon,fontSize:"large"}),"pdf"===b.type&&Object(a.jsx)(X.a,{className:c.folderIcon,fontSize:"large"}),"docx"===b.type&&Object(a.jsx)(X.a,{className:c.folderIcon,fontSize:"large"})]})}),Object(a.jsx)(Ke.a,{onClick:function(){return v(!0)},"aria-label":"delete",size:"medium",children:Object(a.jsx)(y.a,{className:c.iconClose,fontSize:"medium"})}),Object(a.jsx)(Ke.a,{onClick:n,"aria-label":"delete",size:"medium",children:Object(a.jsx)(ho.a,{fontSize:"medium"})}),O&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return v(!1);if("unpin"===t&&b){if(Object(ze.o)(b._id,!b.pinned),v(!1),u-1>=0)return h((function(e){return e-1}));h(0)}},className:c.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:c.modalUnpin,children:[Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Telegram"}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Would you like to unpin this message?"}),Object(a.jsx)(zt.a,{id:"unpin",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"UNPIN"}),Object(a.jsx)(zt.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]}):null},yo=Object(r.a)({toolBar:{color:"#6e6d6d",display:"flex",justifyContent:"space-between",backgroundColor:"#ffffff",height:"7vh"},toolBarPinned:{color:"#6e6d6d",display:"flex",alignItems:"center",alignContent:"center",backgroundColor:"#ffffff",height:"7vh",cursor:"pointer"},pinnedBack:{display:"flex",width:"100%",alignContent:"center",alignItems:"center",flexWrap:"nowrap"},credentials:{background:"#fdfdfd",width:"100%",height:"100%",margin:"0 auto"},toolBarRight:{display:"flex"},buttonDelete:{color:"#f8f8f8",backgroundColor:"#1d74c5"},modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},iconArrow:{"&:hover":{transform:"rotate(360deg)",transition:"all 250ms ease-out "}}}),Co=function(e){var t=e.chatDivRef,n=e.selectedArr,c=e.isSomeSelected,r=e.setIsSomeSelected,l=e.handleClearSelect,d=e.openPinned,b=e.pinnedMessagesMemo,j=e.handleStartCall,f=yo(),p=Object(i.b)(),u=Object(i.c)(Wt.b).companionId,m=Object(s.useState)(!1),h=Object(o.a)(m,2),x=h[0],g=h[1];return Object(a.jsxs)(a.Fragment,{children:[!c&&d&&b.length>0&&Object(a.jsx)(co.a,{position:"static",children:Object(a.jsxs)(at.a,{className:f.toolBarPinned,children:[Object(a.jsxs)("div",{onClick:function(e){e.stopPropagation(),p(Object(S.c)("credentials"))},className:f.pinnedBack,children:[Object(a.jsx)(Ke.a,{onClick:function(e){e.stopPropagation(),p(Object(S.b)(!1))},"aria-label":"delete",size:"medium",children:Object(a.jsx)(nt.a,{className:f.iconArrow,fontSize:"medium"})}),Object(a.jsx)(E.a,{style:{marginLeft:20,color:"#474747"},variant:"h6",color:"initial",children:"".concat(b.length," pinned messages")})]}),Object(a.jsx)(uo,{setIsSomeSelected:r,handleStartCall:j})]})}),!d&&!c&&Object(a.jsx)(co.a,{position:"static",children:Object(a.jsxs)(at.a,{className:f.toolBar,children:[Object(a.jsx)(ro,{}),Object(a.jsxs)("div",{className:f.toolBarRight,children:[Object(a.jsx)(vo,{chatDivRef:t,handleOpenPinned:function(){return p(Object(S.b)(!0))}}),Object(a.jsx)(uo,{setIsSomeSelected:r,handleStartCall:j})]})]})}),c&&Object(a.jsxs)(co.a,{position:"static",children:[Object(a.jsxs)(at.a,{className:f.toolBar,children:[Object(a.jsx)(zt.a,{color:"primary",onClick:function(){return g(!0)},variant:"contained",className:f.buttonDelete,style:{visibility:0===n.length?"hidden":"visible",fontWeight:500},children:"DELETE ".concat(n.length)}),Object(a.jsx)(zt.a,{onClick:l,style:{color:"#1d74c5",fontWeight:500},children:"CANCEL"})]}),x&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t)return g(!1);"cancel"===t&&(l(),g(!1)),"delete"===t&&(Object(ze.s)(u,n),l(),g(!1))},className:f.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:f.modalDelete,children:[Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete messages"}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete messages?"}),Object(a.jsx)(zt.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGES"}),Object(a.jsx)(zt.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})]})},wo=n(438),So=n.n(wo),ko=Object(r.a)({avatarArrowWrapper:{position:"absolute",right:20,top:"70vh",width:56},avatarArrow:{cursor:"pointer","&:hover":{backgroundColor:"rgb(41, 139, 231)",color:"#ffffff"}},listSeenIcon:{position:"absolute",top:-8,left:16,borderRadius:"50%",color:"#ffffff",border:"none",height:24,width:24,textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center",alignContent:"center",fontSize:12,zIndex:10,cursor:"pointer"}}),No=function(e){var t=e.isArrow,n=e.handleScrollTo,o=e.isNew,c=e.openPinned,r=ko();return Object(a.jsxs)("div",{className:r.avatarArrowWrapper,style:{display:t?"block":"none"},children:[Object(a.jsx)("button",{onClick:n,style:{display:o.new&&!c?"block":"none",background:o.mute?"#a7aaa7":"#0ac40a"},className:r.listSeenIcon,children:o.new}),Object(a.jsx)(p.a,{onClick:n,className:r.avatarArrow,sx:{backgroundColor:"#ffffff",width:56,height:56,color:"#6b6b6b"},children:Object(a.jsx)(So.a,{fontSize:"medium"})})]})},Io=n(443),To=n.n(Io),zo=n(444),Ro=n.n(zo),Mo=n(336),Ao=n.n(Mo),Do=n(442),Eo=n.n(Do),Lo=n(447),Wo=n.n(Lo),Bo=n(445),Po=n.n(Bo),Fo=n(446),Yo=n.n(Fo),Uo=n(439),_o=n.n(Uo),Ho=n(628),$o=n(440),Vo=Object(r.a)({container:{width:"100%",position:"relative"},dropZone:{width:"100%",display:"flex",position:"relative",height:20,zIndex:10}}),Go=function(e){var t=e.children,n=e.setFile,o=e.setValue,c=e.accept,r=e.setType,i=e.prevType,l=Vo(),d=Object(Kn.a)({noDrag:!0,accept:c,onFileDialogCancel:function(){return r(i)}}),b=d.getRootProps,f=d.getInputProps,p=d.acceptedFiles;return Object(s.useEffect)((function(){p.slice(-1)[0]&&(o(""),n(p.slice(-1)[0]))}),[n,o,p]),Object(a.jsxs)("div",{className:l.container,children:[t,Object(a.jsx)("div",Object(j.a)(Object(j.a)({},b({className:l.dropZone})),{},{children:Object(a.jsx)("input",Object(j.a)({placeholder:"Photo or Video"},f()))}))]})},qo=Object(r.a)({list:{background:"#fdfdfd"},listIcon:{position:"absolute",left:0},listText:{position:"absolute",left:40}}),Ko=function(e){var t=e.setIsOpenMenu,n=e.setFile,o=e.setValue,c=e.setType,r=e.type,i=qo(),l=function(e){var t=Object(s.useRef)();return Object(s.useEffect)((function(){t.current=e})),t.current}(r),d=function(e){t(!1),c(e)};return Object(a.jsxs)(Ut.a,{className:i.list,children:[Object(a.jsx)(m.a,{onClick:function(){return d("content")},children:Object(a.jsxs)(Go,{setFile:n,setValue:o,setType:c,prevType:l,accept:"image/*,video/*,audio/*",children:[Object(a.jsx)(Y.a,{className:i.listIcon,children:Object(a.jsx)(X.a,{fontSize:"medium"})}),Object(a.jsx)(F.a,{className:i.listText,children:"Upload Image/Audio/Video"})]})}),Object(a.jsx)(m.a,{onClick:function(){return d("application")},children:Object(a.jsxs)(Go,{setFile:n,setValue:o,setType:c,prevType:l,accept:"application/pdf,\r application/vnd.openxmlformats-officedocument.wordprocessingml.document",children:[Object(a.jsx)(Y.a,{className:i.listIcon,children:Object(a.jsx)(X.a,{fontSize:"medium"})}),Object(a.jsx)(F.a,{className:i.listText,children:"Upload File"})]})})]})},Jo=n(172),Qo=n.n(Jo),Xo=Object(r.a)({replyTop:{position:"absolute",left:0,top:"-7vh",height:"6vh",width:"100%",borderRadius:8,display:"flex",flexWrap:"nowrap",alignContent:"center",alignItems:"center",color:"#6b6b6b",border:"solid 2px rgb(41, 139, 231)",backgroundColor:"#ffffff",padding:"0px 5px",zIndex:2},replyIconClose:{cursor:"pointer",marginLeft:5,marginRight:5,"&:hover":{color:"#f02a2a",transform:"rotate(180deg)",transition:"all 250ms ease-out "}},replyListWrapper:{width:"100%"},replyColumn:{height:"80%",width:2,backgroundColor:"rgb(41, 139, 231)",marginRight:10},folderIcon:{color:"#54b0fc"}}),Zo=function(e){var t=e.isReply,n=e.handleCloseReply,o=e.handleScrollToTheMessage,c=Xo();return Object(a.jsxs)("div",{className:c.replyTop,children:[Object(a.jsx)(Qo.a,{style:{margin:"0px 7px",color:"rgb(41, 139, 231)"}}),Object(a.jsx)("div",{className:c.replyColumn}),Object(a.jsx)("ul",{className:c.replyListWrapper,children:Object(a.jsxs)(m.a,{onClick:function(){return o(t._id)},children:[Object(a.jsx)(F.a,{primary:"".concat(Object(L.e)(t.name)).concat(Object(L.p)(t.name,15,1)," \n ").concat(Object(L.e)(t.lastName)).concat(Object(L.p)(t.lastName,15,1)),primaryTypographyProps:{color:"rgb(41, 139, 231)",fontSize:16},secondary:"Type : ".concat(t.type.toUpperCase()),secondaryTypographyProps:{fontSize:16}}),"text"===t.type&&Object(a.jsx)(ue.a,{className:c.folderIcon,fontSize:"large"}),"audio"===t.type&&Object(a.jsx)(ge.a,{className:c.folderIcon,fontSize:"large"}),"video"===t.type&&Object(a.jsx)(Ce.a,{className:c.folderIcon,fontSize:"large"}),"image"===t.type&&Object(a.jsx)(go.a,{className:c.folderIcon,fontSize:"large"}),"pdf"===t.type&&Object(a.jsx)(X.a,{className:c.folderIcon,fontSize:"large"}),"docx"===t.type&&Object(a.jsx)(X.a,{className:c.folderIcon,fontSize:"large"})]})}),Object(a.jsx)(y.a,{onClick:n,className:c.replyIconClose})]})},ea=Object(r.a)({forwardTop:{position:"absolute",left:0,top:"-7vh",height:"6vh",width:"100%",borderRadius:8,display:"flex",flexWrap:"nowrap",alignContent:"center",alignItems:"center",color:"#6b6b6b",border:"solid 2px rgb(41, 139, 231)",backgroundColor:"#ffffff",padding:"0px 5px",zIndex:2},forwardIconClose:{cursor:"pointer",marginLeft:5,marginRight:5,"&:hover":{color:"#f02a2a",transform:"rotate(180deg)",transition:"all 250ms ease-out "}},forwardListWrapper:{width:"100%"},forwardColumn:{height:"80%",width:2,backgroundColor:"rgb(41, 139, 231)",marginRight:10},folderIcon:{color:"#54b0fc"}}),ta=function(e){var t=e.companionId,n=e.isForward,o=e.handleCloseForward,c=e.handleScrollToTheMessage,r=e.setIsForward,s=ea(),l=Object(i.b)();return Object(a.jsxs)("div",{className:s.forwardTop,children:[Object(a.jsx)(Qo.a,{style:{margin:"0px 7px",color:"rgb(41, 139, 231)",transform:"rotateY(180deg)"}}),Object(a.jsx)("div",{className:s.forwardColumn}),Object(a.jsx)("ul",{className:s.forwardListWrapper,children:Object(a.jsxs)(m.a,{onClick:function(){if(t===n.companionId)return c(n._id);r(void 0),l(Object(S.c)("")),l(Object(S.b)(!1)),l(_e(n.companionId)),setTimeout((function(){return c(n._id)}),2e3)},children:[Object(a.jsx)(F.a,{primary:"".concat(Object(L.e)(n.name)).concat(Object(L.p)(n.name,15,1)," \n ").concat(Object(L.e)(n.lastName)).concat(Object(L.p)(n.lastName,15,1)),primaryTypographyProps:{color:"rgb(41, 139, 231)",fontSize:16},secondary:"Type : ".concat(n.type.toUpperCase()),secondaryTypographyProps:{fontSize:16}}),"text"===n.type&&Object(a.jsx)(ue.a,{className:s.folderIcon,fontSize:"large"}),"audio"===n.type&&Object(a.jsx)(ge.a,{className:s.folderIcon,fontSize:"large"}),"video"===n.type&&Object(a.jsx)(Ce.a,{className:s.folderIcon,fontSize:"large"}),"image"===n.type&&Object(a.jsx)(go.a,{className:s.folderIcon,fontSize:"large"}),"pdf"===n.type&&Object(a.jsx)(X.a,{className:s.folderIcon,fontSize:"large"}),"docx"===n.type&&Object(a.jsx)(X.a,{className:s.folderIcon,fontSize:"large"})]})}),Object(a.jsx)(y.a,{onClick:o,className:s.forwardIconClose})]})},na=Object(r.a)({editTop:{position:"absolute",left:0,top:"-7vh",height:"6vh",width:"100%",borderRadius:8,display:"flex",flexWrap:"nowrap",alignContent:"center",alignItems:"center",color:"#6b6b6b",border:"solid 2px rgb(41, 139, 231)",backgroundColor:"#ffffff",padding:"0px 5px",zIndex:2},editListWrapper:{width:"100%",wordBreak:"break-word",overflowY:"auto",height:"6vh"},editIconClose:{cursor:"pointer",marginLeft:5,marginRight:5,"&:hover":{color:"#f02a2a",transform:"rotate(180deg)",transition:"all 250ms ease-out "}},editColumn:{height:"80%",width:2,backgroundColor:"rgb(41, 139, 231)",marginRight:10}}),oa=function(e){var t=e.isEdit,n=e.handleCloseEdit,o=e.handleScrollToTheMessage,c=na();return Object(a.jsxs)("div",{className:c.editTop,children:[Object(a.jsx)(vn.a,{style:{margin:"0px 7px",color:"rgb(41, 139, 231)"}}),Object(a.jsx)("div",{className:c.editColumn}),Object(a.jsx)("ul",{className:c.editListWrapper,children:Object(a.jsx)("li",{onClick:function(){return o(t._id)},children:Object(a.jsx)(F.a,{primary:"Edit ".concat("text"===t.type?"Message and Caption":"only Caption"),primaryTypographyProps:{color:"rgb(41, 139, 231)",fontSize:16},secondary:"text"===t.type?"Message: ".concat(t.message," , Caption: ").concat(t.caption):"Caption: ".concat(t.caption),secondaryTypographyProps:{fontSize:16}})})}),Object(a.jsx)(y.a,{onClick:n,className:c.editIconClose})]})},aa=Object(r.a)({container:{width:"35vw",height:"6vh",position:"fixed",bottom:"2vh",borderRadius:8,padding:10,display:"flex",flexWrap:"nowrap",alignContent:"start",alignItems:"start",color:"#6b6b6b",border:"solid 2px #ffffff",backgroundColor:"#ffffff"},containerActive:{width:"35vw",height:"6vh",position:"fixed",bottom:"2vh",borderRadius:8,padding:10,display:"flex",flexWrap:"nowrap",alignContent:"start",alignItems:"start",border:"solid 2px rgb(41, 139, 231)",backgroundColor:"#ffffff"},textarea:{width:"100%",height:"100%",outline:"none",border:"none",padding:"0px 10px",marginLeft:8,marginRight:8,overflowY:"auto",resize:"none","&::placeholder":{color:"inherit",fontWeight:600,fontSize:20}},attachIcon:{transform:"rotate(30deg)"},borderTop:{position:"absolute",left:0,top:-21,width:"100%",height:1,background:"#ffffff"},filesMenu:{background:"#fdfdfd",position:"absolute",width:"15vw",maxWidth:"100%",left:"61%",bottom:"9vh",zIndex:10,visibility:"visible",borderRadius:10,padding:"4px 6px"},emoji:{position:"absolute",zIndex:10,visibility:"visible"},captionTextField:{zIndex:10,visibility:"visible",width:"35vw",backgroundColor:"#ffffff",borderRadius:4,height:"6vh",overflowY:"auto"},iconCancel:{position:"absolute",left:-72,bottom:-1,display:"flex",backgroundColor:"#ffffff",color:"rgb(243, 69, 69)",border:"solid 4px rgb(243, 69, 69)",borderRadius:"50%","&:hover":{backgroundColor:"rgb(243, 69, 69)",color:"#ffffff"}},avatarCamera:{position:"absolute",left:-72,bottom:-1,display:"flex",borderRadius:"50%",zIndex:10,border:"solid 14px #ffffff","&:hover":{backgroundColor:"rgb(41, 139, 231)",border:"solid 14px rgb(41, 139, 231)",color:"#ffffff"}},avatarRight:{position:"absolute",right:-72,bottom:-1,display:"flex",borderRadius:"50%",zIndex:10,border:"solid 14px #ffffff","&:hover":{backgroundColor:"rgb(41, 139, 231)",border:"solid 14px rgb(41, 139, 231)",color:"#ffffff"}},pauseLeft:{position:"absolute",left:-72,bottom:-1,zIndex:10},pauseRight:{position:"absolute",right:-72,bottom:-1,zIndex:10},avatarPause:{backgroundColor:"#ffffff",cursor:"pointer",animation:"$shake 1s",animationIterationCount:"infinite","&:hover":{backgroundColor:"rgb(41, 139, 231)",color:"#ffffff"}},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100},ringContainerLeft:{position:"absolute",left:-25,top:-25,zIndex:10},ringContainerRight:{position:"absolute",right:-25,top:-25,zIndex:10},circle:{width:15,height:15,backgroundColor:"rgb(255, 4, 4)",borderRadius:"50%",position:"relative"},ringRing:{border:"3px solid rgb(255, 4, 4)",borderRadius:"50%",height:25,width:25,position:"absolute",right:-5,top:-5,animation:"$pulsate 1s ease-out",animationIterationCount:"infinite",opacity:0},"@keyframes pulsate":{"0%":{transform:"scale(0.1, 0.1)",opacity:0},"50%":{opacity:1},"100%":{transform:"scale(1.2, 1.2)",opacity:0}},"@keyframes shake":{"0%":{transform:"translate(0.5px, 0.5px) rotate(0deg)"},"10%":{transform:"translate(-0.5px, -1px) rotate(-1deg)"},"20%":{transform:"translate(-1.5px, 0px) rotate(1deg)"},"30%":{transform:"translate(1.5px, 1px) rotate(0deg)"},"40%":{transform:"translate(0.5px, -0.5px) rotate(1deg)"},"50%":{transform:"translate(-0.5px, 1px) rotate(-1deg)"},"60%":{transform:"translate(-1.5px, 0.5px) rotate(0deg)"},"70%":{transform:"translate(1.5px, 0.5px) rotate(-1deg)"},"80%":{transform:"translate(-0.5px, -0.5px) rotate(1deg)"},"90%":{transform:"translate(0.5px, 1px) rotate(0deg)"},"100%":{transform:"translate(0.5px, -1px) rotate(-1deg)"}},overlayCamera:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden",display:"flex",justifyContent:"center",alignContent:"center",alignItems:"center",flexDirection:"column"},capturedPicture:{borderRadius:10,border:"solid 2px rgb(62, 149, 231)"},capturePhoto:{color:"#ffffff",cursor:"pointer","&:hover":{color:"#48ff00",animation:"$rotating 2s linear infinite"}},"@keyframes rotating":{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}}}),ca=function(e){var t=e.isArrow,n=e.silentMode,c=e.isReply,r=e.setIsReply,l=e.isForward,d=e.setIsForward,b=e.isEdit,j=e.setIsEdit,f=e.modalForward,u=e.handleScrollToTheMessage,m=aa(),h=Object(i.c)(Wt.a).companionId,x=Object(i.c)(We),g=Object(s.useState)(""),O=Object(o.a)(g,2),v=O[0],C=O[1],w=Object(s.useState)(!1),S=Object(o.a)(w,2),k=S[0],N=S[1],I=Object(s.useState)(""),T=Object(o.a)(I,2),z=T[0],R=T[1],M=Object(s.useState)(!1),A=Object(o.a)(M,2),D=A[0],E=A[1],W=Object(s.useState)(!1),B=Object(o.a)(W,2),P=B[0],F=B[1],Y=Object(s.useState)(!1),U=Object(o.a)(Y,2),_=U[0],H=U[1],$=Object(s.useState)(!1),V=Object(o.a)($,2),G=V[0],q=V[1],K=Object(s.useState)(!1),J=Object(o.a)(K,2),Q=J[0],X=J[1],Z=Object(s.useState)(!1),ee=Object(o.a)(Z,2),te=ee[0],ne=ee[1],oe=Object(s.useState)(!1),ae=Object(o.a)(oe,2),ce=ae[0],re=ae[1],ie=Object(s.useState)(""),se=Object(o.a)(ie,2),le=se[0],de=se[1],be=Object(s.useState)(null),je=Object(o.a)(be,2),fe=je[0],pe=je[1],ue=Object(s.useState)(null),me=Object(o.a)(ue,2),he=me[0],xe=me[1],ge=Object($o.useReactMediaRecorder)({audio:!0,blobPropertyBag:{type:"audio/mp3"}}),Oe=ge.startRecording,ve=ge.stopRecording,ye=ge.mediaBlobUrl,Ce=ge.clearBlobUrl,we=Object($o.useReactMediaRecorder)({video:!0,blobPropertyBag:{type:"video/mp4"}}),Se=we.startRecording,ke=we.stopRecording,Te=we.mediaBlobUrl,Re=we.clearBlobUrl,Me=function(e,t,n){"input"===n&&(C((function(e){return e+t.emoji})),H(!1)),"caption"===n&&(R((function(e){return e+t.emoji})),q(!1))},Ae=function(){N(!1),X(!1),ne(!1),C(""),R(""),de(""),Ce(),Re(),F(!1),H(!1),E(!1),q(!1),pe(null),xe(null)},De=function(){var e=Object(Ie.a)(Ne.a.mark((function e(){var t,o,a,i,s,f;return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:!v||c||l||b||Object(ze.y)(h,v,z.trim()),v&&c&&!l&&!b&&(Object(ze.B)(c._id,v,z.trim()),r(void 0)),v&&l&&!b&&!c&&(Object(ze.A)(l._id,l.companionIdForwardToAndFrom,v,z.trim()),d(void 0)),!b||l||c||(Object(ze.z)(b._id,v,z.trim()),j(void 0)),ye&&"recording"===le&&((t=new XMLHttpRequest).open("GET",ye,!0),t.responseType="blob",t.onload=function(){if(200===t.status){var e=t.response,n=new File([e],"audio.mp3",{type:"audio/mpeg"}),o=new FormData;o.append("audio",n),Object(ze.v)(h,o,z.trim()),Ce()}},t.send()),Te&&"filming"===le&&((o=new XMLHttpRequest).open("GET",Te,!0),o.responseType="blob",o.onload=function(){if(200===o.status){var e=o.response,t=new File([e],"video.mp4",{type:"video/mp4"}),n=new FormData;n.append("video",t),Object(ze.C)(h,n,z.trim()),Re()}},o.send()),k&&le&&"base64"!==le&&(k.type.includes("image")&&"content"===le&&((a=new FormData).append("image",k),Object(ze.x)(h,a,z.trim())),k.type.includes("audio")&&"content"===le&&((i=new FormData).append("audio",k),Object(ze.v)(h,i,z.trim())),k.type.includes("video")&&"content"===le&&((s=new FormData).append("video",k),Object(ze.C)(h,s,z.trim())),k.type.includes("application")&&"application"===le&&((f=new FormData).append("file",k),Object(ze.w)(h,f,z.trim()))),"string"===typeof k&&"base64"===le&&fetch(k).then((function(e){return e.blob()})).then((function(e){var t=new File([e],"selfie",{type:"image/jpeg"}),n=new FormData;n.append("image",t),Object(ze.x)(h,n,z.trim())})),Ae(),!n&&Object(L.j)("".concat(L.m,"/send.mp3"));case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ee=function(){var e=Object(Ie.a)(Ne.a.mark((function e(){return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(ze.H)(h,!0);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Le=function(){var e=Object(Ie.a)(Ne.a.mark((function e(){return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(ze.H)(h,!1);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Be=function(){if(Q)return pe("stopped"),void ve();Oe(),pe("recording"),de("recording"),X(!0)},Pe=function(){if(te)return xe("stopped"),void ke();Se(),xe("recording"),de("filming"),ne(!0)},Fe=Object(s.useCallback)((function(){ve(),ke(),Ce(),Re(),pe(null),xe(null),X(!1),ne(!1),N(!1),C(""),R(""),de(""),F(!1),H(!1),E(!1),q(!1)}),[Re,Ce,ke,ve]);return Object(s.useEffect)((function(){Fe()}),[c,l,b,h]),Object(s.useEffect)((function(){r(void 0),j(void 0)}),[h,r,j]),Object(s.useEffect)((function(){b&&("text"===b.type&&C(b.message?b.message:""),R(b.caption?b.caption:""))}),[b,h]),Object(s.useEffect)((function(){var e=null===l||void 0===l?void 0:l.companionIdForwardToAndFrom;e&&e!==h&&d(void 0)}),[h]),Object(a.jsxs)("div",{className:v&&b&&"text"===b.type||b&&"text"!==b.type||v&&!b||k||"stopped"===fe||"stopped"===he?m.containerActive:m.container,children:[t&&Object(a.jsx)("div",{className:m.borderTop}),c&&Object(a.jsx)(Zo,{isReply:c,handleCloseReply:function(){r(void 0),Ae()},handleScrollToTheMessage:u}),b&&Object(a.jsx)(oa,{isEdit:b,handleCloseEdit:function(){j(void 0),Ae()},handleScrollToTheMessage:u}),l&&!f&&Object(a.jsx)(ta,{companionId:h,isForward:l,handleCloseForward:function(){d(void 0),Ae()},handleScrollToTheMessage:u,setIsForward:d}),te&&"stopped"!==he&&Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)("div",{className:m.pauseLeft,children:Object(a.jsx)(p.a,{onClick:Pe,className:m.avatarPause,sx:{backgroundColor:"#ffffff",color:"#6b6b6b",width:56,height:56},children:Object(a.jsx)(Eo.a,{fontSize:"large"})})}),Object(a.jsxs)("div",{className:m.ringContainerLeft,children:[Object(a.jsx)("div",{className:m.ringRing}),Object(a.jsx)("div",{className:m.circle})]})]}),Q&&"stopped"!==fe&&Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)("div",{className:m.pauseRight,children:Object(a.jsx)(p.a,{onClick:Be,className:m.avatarPause,sx:{backgroundColor:"#ffffff",color:"#6b6b6b",width:56,height:56},children:Object(a.jsx)(Eo.a,{fontSize:"large"})})}),Object(a.jsxs)("div",{className:m.ringContainerRight,children:[Object(a.jsx)("div",{className:m.ringRing}),Object(a.jsx)("div",{className:m.circle})]})]}),Object(a.jsx)(y.a,{onClick:Ae,fontSize:"small",className:m.iconCancel,sx:{width:56,height:56,display:k||v&&!c&&!l&&!b||"stopped"===fe&&le||"stopped"===he&&le?"inline-block":"none"}}),Object(a.jsx)(Ao.a,{onClick:Pe,className:m.avatarCamera,sx:{backgroundColor:"#ffffff",color:"#6b6b6b",width:56,height:56},style:{display:null!==fe||"stopped"===he||k||v||te||c||l||b?"none":"block"}}),Object(a.jsx)(To.a,{onClick:De,className:m.avatarRight,sx:{backgroundColor:"#ffffff",color:"rgb(41, 139, 231)",width:56,height:56},style:{display:v&&b&&"text"===b.type||b&&"text"!==b.type||v&&!b||k||"stopped"===fe||"stopped"===he?"block":"none"}}),Object(a.jsx)(Ro.a,{onClick:Be,className:m.avatarRight,sx:{backgroundColor:"#ffffff",color:"#6b6b6b",width:56,height:56},style:{display:v||k||"stopped"===fe||null!==he||Q||c||l||b?"none":"block"}}),Object(a.jsx)(Po.a,{onClick:function(){return!_&&H(!0)},fontSize:"medium",sx:{color:_?"rgb(41, 139, 231)":"#6b6b6b",cursor:"pointer",pointerEvents:k||fe||he||b&&"text"!==b.type?"none":"auto","&:hover":{color:"rgb(41, 139, 231)"},marginRight:1}}),Object(a.jsx)(Yo.a,{onClick:function(){return!D&&E(!0)},fontSize:"medium",sx:{color:D||z?"rgb(41, 139, 231)":"#6b6b6b",cursor:"pointer",pointerEvents:v||k||"stopped"===fe||"stopped"===he||b&&"text"!==b.type?"auto":"none","&:hover":{color:"rgb(41, 139, 231)"}}}),Object(a.jsx)("div",{onClick:function(e){return"overlay"===e.target.id&&_&&H(!1)},className:m.overlay,id:"overlay",style:{display:_?"block":"none"},children:Object(a.jsx)("div",{className:m.emoji,style:{left:x?"32.5vw":"45vw",bottom:"9vh"},children:Object(a.jsx)(_o.a,{onEmojiClick:function(e,t){return Me(0,t,"input")}})})}),Object(a.jsxs)("div",{onClick:function(e){if("overlay"===e.target.id){if(G)return q(!1);D&&E(!1)}},className:m.overlay,id:"overlay",style:{display:D?"block":"none"},children:[G&&Object(a.jsx)("div",{className:m.emoji,style:{left:x?"32.5vw":"45vw",bottom:c||l||b?"23vh":"16vh"},children:Object(a.jsx)(_o.a,{onEmojiClick:function(e,t){return Me(0,t,"caption")}})}),Object(a.jsx)(pn.a,{multiline:!0,className:m.captionTextField,onChange:function(e){return R(e.target.value)},style:{left:x?"32.5vw":"45vw",top:c||l||b?"78.5vh":"85vh"},placeholder:"Caption",value:z,id:"caption",name:"caption",variant:"outlined",InputProps:{startAdornment:Object(a.jsx)(Ho.a,{position:"start",sx:{marginRight:4},children:Object(a.jsx)(Po.a,{onClick:function(){return!_&&q(!0)},sx:{color:G?"rgb(41, 139, 231)":"#6b6b6b",cursor:"pointer","&:hover":{color:"rgb(41, 139, 231)"},position:"fixed",top:c||l||b?"80vh":"86.5vh"}})})}})]}),Object(a.jsx)("textarea",{disabled:!!(k||"recording"===le||"filming"===le||b&&"text"!==b.type),value:v,onBlur:Le,onFocus:Ee,onChange:function(e){return C(e.target.value)},className:m.textarea,placeholder:k?"The File is ready to send":null===fe&&null===he?"Message":"".concat("stopped"===fe||"stopped"===he?"recording"===le||"filming"===le?"Recorded":"Message":"Recording in progress..."),rows:1,style:{color:v||k||"recording"===le||"filming"===le?"rgb(41, 139, 231)":"#6b6b6b"}}),Object(a.jsx)(Vn.a,{onClick:function(){return re(!0)},fontSize:"medium",sx:{color:ce||"base64"===le?"rgb(62, 149, 231)":"#6b6b6b",marginRight:1,cursor:"pointer",pointerEvents:"content"===le||"application"===le||v||null!==fe||null!==he||c||l||b?"none":"auto","&:hover":{color:"rgb(41, 139, 231)"}}}),Object(a.jsx)(Wo.a,{onClick:function(){return!P&&F(!0)},className:m.attachIcon,fontSize:"medium",sx:{color:P||"content"===le||"application"===le?"rgb(41, 139, 231)":"#6b6b6b",cursor:"pointer",pointerEvents:"base64"===le||v||null!==fe||null!==he||c||l||b?"none":"auto","&:hover":{color:"rgb(41, 139, 231)"}}}),Object(a.jsx)("div",{onClick:function(e){return"overlay"===e.target.id&&P&&F(!1)},className:m.overlay,id:"overlay",style:{display:P?"block":"none"},children:Object(a.jsx)("div",{className:m.filesMenu,style:{left:x?"52.5vw":"65vw"},children:Object(a.jsx)(Ko,{setFile:N,setValue:C,setIsOpenMenu:F,setType:de,type:le})})}),ce&&Object(a.jsx)("div",{onClick:function(e){"overlay"===e.target.id&&re(!1)},id:"overlay",className:m.overlayCamera,children:Object(a.jsx)(Qn.a,{audio:!1,screenshotFormat:"image/jpeg",width:"40%",videoConstraints:{width:1280,height:720,facingMode:"user"},style:{marginBottom:30},children:function(e){var t=e.getScreenshot;return Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(qn.a,{onClick:function(){return function(e){N(e()),de("base64"),!n&&Object(L.j)("".concat(L.m,"/cameraCapture.mp3"))}(t)},className:m.capturePhoto,fontSize:"large",style:{marginBottom:30}}),Object(a.jsx)("img",{className:m.capturedPicture,width:"300",height:"174",style:{visibility:k?"visible":"hidden"},src:k,alt:"chosen pic"})]})}})})]})},ra=Object(r.a)({unpinBar:{backgroundColor:"#ffffff",color:"#2b97fd",display:"flex",justifyContent:"center",alignContent:"center",alignItems:"center",width:"100%",height:"7vh",position:"fixed",cursor:"pointer",bottom:"0vh",fontSize:18,"&:hover":{color:"#0084ff"}}}),ia=function(e){var t=e.pinnedMessagesMemo,n=e.handleUnpinAll,o=ra();return Object(a.jsx)("div",{onClick:n,className:o.unpinBar,children:"UNPIN ALL ".concat(t.length," MESSAGES")})},sa=n(619),la=n(602),da=n(200),ba=n.n(da),ja=Object(f.a)((function(e){return Object(a.jsx)(u.a,Object(j.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(0),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"4px 4px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(2)}}}}})),fa=Object(r.a)({container:{display:"flex",alignItems:"flex-start",alignContent:"flex-start",flexDirection:"column",borderRadius:7,position:"relative",padding:"4px 0px 4px 22px"},wrapper:{position:"relative",display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",maxWidth:450,minWidth:200,padding:5,borderRadius:7,wordBreak:"break-word",textAlign:"left",font:"400 .9em 'Open Sans', sans-serif"},wrapperInner:{position:"relative",display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",width:"100%",cursor:"pointer",padding:"0px 10px","&:hover":{backgroundColor:"rgba(104, 105, 104, 0.2)"}},deletedInformation:{display:"flex",justifyContent:"start",alignItems:"center",alignContent:"center"},informationWrapper:{display:"flex",alignItems:"center",alignContent:"center",justifyContent:"flex-end",width:"100%",paddingRight:3},time:{fontSize:".65em",fontWeight:600,color:"#414141"},modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},emojiTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"0.2rem",right:-40},emojiCompanionTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"2.2rem",right:-40},emoji:{cursor:"pointer",fontSize:"1.7rem",transition:"all 0.3s","&:hover":{transform:"scale(1.5)"}},emojiActive:{cursor:"pointer",fontSize:"1.2rem",animation:"$emoji 0.6s ease-out",animationDirection:"forwards",animationIterationCount:1},"@keyframes emoji":{"5%":{transform:"translateY(1rem)"},"10%":{transform:"translateY(0) scale(1)",opacity:1},"50%":{transform:"translateY(-4rem) scale(1.5) rotateY(90deg)"},"80%":{opacity:0},"100%":{transform:"translateY(-8rem) scale(2) rotateY(180deg)",opacity:0}},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}},checkboxSelect:{position:"absolute",left:-64,top:-10,pointerEvents:"auto"},folderIcon:{color:"#535353",marginRight:5},column:{position:"absolute",content:"",width:2,left:0,top:"10%",height:"80%",backgroundColor:"#535353"},avatarIcon:{position:"absolute",left:-54,bottom:0},tongueOne:{content:"''",position:"absolute",width:"0",height:"0",borderLeft:"15px solid transparent",borderRight:"15px solid transparent",bottom:"0px",left:"-15px"},tongueTwo:{content:"''",position:"absolute",width:"0",height:"0",borderLeft:"16px solid transparent",borderRight:"16px solid transparent",bottom:"0px",left:"-17px"}}),pa={inputProps:{"aria-label":"Checkbox demo"}},ua=function(e){var t=e.tongue,n=e.watched,c=e.edited,r=e.companionIdForwardToAndFrom,i=e.avatarUrl,l=e.color,d=e.message,b=e.name,f=e.lastName,u=e.forwardReplyName,h=e.forwardReplyLastName,x=e.caption,g=e.createdAt,O=e.emoji,v=e.emojiCompanion,C=e.pinned,w=e.isSomeSelected,S=e.isSelected,k=e.handleSelected,N=e._id,I=e.nightMode,T=e.handleReply,z=e.handleForward,R=(e.handleEdit,e.handleOpenTheChat),M=fa(),A=Object(s.useState)(null),D=Object(o.a)(A,2),E=D[0],W=D[1],B=Object(s.useState)(!1),P=Object(o.a)(B,2),Y=P[0],U=P[1],_=Object(s.useState)(!1),H=Object(o.a)(_,2),$=H[0],V=H[1],G=Boolean(E),q=S(N),K=function(e){"copy"===e&&Object(L.a)("Text"),"delete"===e&&V(!0),W(null),U(!1)};return Object(a.jsx)("div",{className:M.container,style:{marginBottom:t?12:0},children:Object(a.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),W(e.currentTarget),U(!0)}(e)},className:M.wrapper,style:{backgroundColor:Y?"#babdbc":"#ffffff",pointerEvents:w?"none":"auto"},children:[Object(a.jsx)(sa.a,{style:{color:"#00b333"},variant:"h6",align:"right",children:"".concat(Object(L.e)(b)).concat(Object(L.p)(b,15,1)," \n ").concat(Object(L.e)(f)).concat(Object(L.p)(f,15,1))}),Object(a.jsxs)("div",{className:M.wrapperInner,onClick:function(){return R(r)},children:[Object(a.jsx)("div",{className:M.column}),Object(a.jsx)(sa.a,{style:{color:"#535353"},variant:"h6",align:"right",children:"".concat(r?"Forwarded from":"Replied to"," ").concat(Object(L.e)(u)).concat(Object(L.p)(u,15,1),"\n ").concat(Object(L.e)(h)).concat(Object(L.p)(h,15,1))}),Object(a.jsxs)("div",{className:M.deletedInformation,children:[Object(a.jsx)(yt.a,{className:M.folderIcon,fontSize:"large"}),Object(a.jsx)(sa.a,{style:{color:"#535353"},variant:"h6",align:"right",children:"The Message was Deleted"})]})]}),Object(a.jsx)(F.a,{primary:d,primaryTypographyProps:{color:"#000000"}}),Object(a.jsx)(F.a,{secondary:x,secondaryTypographyProps:{color:"#000000"}}),Object(a.jsxs)("div",{className:M.informationWrapper,children:[Object(a.jsx)("div",{className:M.time,style:{color:"#959595"},children:"".concat(c?"edited ":"").concat(Object(L.t)(g))}),n&&Object(a.jsx)(ba.a,{style:{color:"#959595",marginLeft:5},fontSize:"small"})]}),t&&Object(a.jsx)("div",{className:M.avatarIcon,children:Object(a.jsx)(p.a,{alt:b,src:i?"".concat(L.l,"/").concat(i):void 0,sx:{background:l,width:40,height:40},children:!i&&"".concat(Object(L.e)(b)).concat(Object(L.e)(f))})}),t&&Object(a.jsx)("span",{className:M.tongueOne,style:{borderBottom:"15px solid ".concat(Y?"#babdbc":"#ffffff")}}),t&&Object(a.jsx)("span",{className:M.tongueTwo,style:{borderBottom:"17px solid ".concat(Y?"#babdbc":"#ffffff")}}),v&&Object(a.jsx)("div",{className:M.emojiCompanionTitle,children:L.b[Number(v)]}),O&&Object(a.jsx)("div",{className:M.emojiTitle,children:L.b[Number(O)]}),w&&Object(a.jsx)("div",{className:M.checkboxSelect,children:Object(a.jsx)(la.a,Object(j.a)(Object(j.a)({},pa),{},{checked:q,sx:{color:I?"#ffffff":"#00ff48","&.Mui-checked":{color:I?"#ffffff":"#00ff48"}},onClick:function(){return k(N)}}))}),Object(a.jsxs)(ja,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:E,open:G,onClose:K,children:[Object(a.jsx)(m.a,{onClick:function(e){var t=e.target.id;t===O?Object(ze.L)(N,""):Object(ze.L)(N,t)},style:{cursor:"none"},children:L.b.map((function(e,t){return Object(a.jsx)("div",{className:O===String(t)?M.emojiActive:M.emoji,id:String(t),children:e},e)}))}),Object(a.jsx)(Z.a,{}),Object(a.jsxs)(m.a,{onClick:function(){T(N),K(void 0)},children:[Object(a.jsx)(Qo.a,{}),"Reply"]}),Object(a.jsxs)(m.a,{onClick:function(){z(N),K(void 0)},children:[Object(a.jsx)(Qo.a,{style:{transform:"rotateY(180deg)"}}),"Forward"]}),Object(a.jsx)(nn.CopyToClipboard,{onCopy:function(){return K("copy")},text:"".concat(d," ").concat(x),children:Object(a.jsxs)(m.a,{children:[Object(a.jsx)(ue.a,{}),"Copy Text"]})}),Object(a.jsxs)(m.a,{onClick:function(){Object(ze.o)(N,!C),K(void 0)},children:[C?Object(a.jsx)(y.a,{className:M.iconClose}):Object(a.jsx)(Tt.a,{}),C?"Unpin":"Pin"]}),Object(a.jsxs)(m.a,{onClick:function(){k(N),K(void 0)},children:[Object(a.jsx)(so.a,{}),"Select"]}),Object(a.jsxs)(m.a,{style:{color:"#f02a2a"},onClick:function(){return K("delete")},children:[Object(a.jsx)(yt.a,{style:{color:"#f02a2a"}}),"Delete"]})]}),$&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return V(!1);"delete"===t&&(Object(ze.r)(N),V(!1))},className:M.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:M.modalDelete,children:[Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(a.jsx)(zt.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(a.jsx)(zt.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})})},ma=Object(f.a)((function(e){return Object(a.jsx)(u.a,Object(j.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(0),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"4px 4px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(2)}}}}})),ha=Object(r.a)({container:{display:"flex",alignItems:"flex-start",alignContent:"flex-start",flexDirection:"column",borderRadius:7,position:"relative",padding:"4px 0px 4px 22px"},wrapper:{position:"relative",display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",maxWidth:450,minWidth:200,padding:5,borderRadius:7,wordBreak:"break-word",textAlign:"left",font:"400 .9em 'Open Sans', sans-serif"},wrapperInner:{display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column"},informationWrapper:{display:"flex",alignItems:"center",alignContent:"center",justifyContent:"flex-end",width:"100%",paddingRight:3},time:{fontSize:".65em",fontWeight:600,color:"#414141"},modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},emojiTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"0.2rem",right:-40},emojiCompanionTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"2.2rem",right:-40},emoji:{cursor:"pointer",fontSize:"1.7rem",transition:"all 0.3s","&:hover":{transform:"scale(1.5)"}},emojiActive:{cursor:"pointer",fontSize:"1.2rem",animation:"$emoji 0.6s ease-out",animationDirection:"forwards",animationIterationCount:1},"@keyframes emoji":{"5%":{transform:"translateY(1rem)"},"10%":{transform:"translateY(0) scale(1)",opacity:1},"50%":{transform:"translateY(-4rem) scale(1.5) rotateY(90deg)"},"80%":{opacity:0},"100%":{transform:"translateY(-8rem) scale(2) rotateY(180deg)",opacity:0}},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}},checkboxSelect:{position:"absolute",left:-64,top:-10,pointerEvents:"auto"},avatarIcon:{position:"absolute",left:-54,bottom:0},tongueOne:{content:"''",position:"absolute",width:"0",height:"0",borderLeft:"15px solid transparent",borderRight:"15px solid transparent",bottom:"0px",left:"-15px"},tongueTwo:{content:"''",position:"absolute",width:"0",height:"0",borderLeft:"16px solid transparent",borderRight:"16px solid transparent",bottom:"0px",left:"-17px"}}),xa={inputProps:{"aria-label":"Checkbox demo"}},ga=function(e){var t=e.message,n=e.tongue,c=e.watched,r=e.edited,i=e.avatarUrl,l=e.color,d=e.name,b=e.lastName,f=e.createdAt,u=e.caption,h=e.emoji,x=e.emojiCompanion,g=e.pinned,O=e.isSomeSelected,v=e.isSelected,C=e.handleSelected,w=e._id,S=e.nightMode,k=e.handleReply,N=e.handleForward,I=ha(),T=Object(s.useState)(null),z=Object(o.a)(T,2),R=z[0],M=z[1],A=Object(s.useState)(!1),D=Object(o.a)(A,2),E=D[0],W=D[1],B=Object(s.useState)(!1),P=Object(o.a)(B,2),Y=P[0],U=P[1],_=Boolean(R),H=v(w),$=function(e){"copy"===e&&Object(L.a)("Text"),"delete"===e&&U(!0),M(null),W(!1)};return Object(a.jsx)("div",{className:I.container,style:{marginBottom:n?12:0},children:Object(a.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),M(e.currentTarget),W(!0)}(e)},className:I.wrapper,style:{backgroundColor:E?"#babdbc":"#ffffff",pointerEvents:O?"none":"auto"},children:[Object(a.jsx)(sa.a,{style:{color:"#00b333"},variant:"h6",align:"right",children:"".concat(Object(L.e)(d)).concat(Object(L.p)(d,15,1)," \n ").concat(Object(L.e)(b)).concat(Object(L.p)(b,15,1))}),Object(a.jsxs)("div",{className:I.wrapperInner,children:[Object(a.jsx)(F.a,{primary:t,primaryTypographyProps:{color:"#000000"}}),Object(a.jsx)(F.a,{secondary:u,secondaryTypographyProps:{color:"#000000"}})]}),Object(a.jsxs)("div",{className:I.informationWrapper,children:[Object(a.jsx)("div",{className:I.time,style:{color:"#959595"},children:"".concat(r?"edited ":"").concat(Object(L.t)(f))}),c&&Object(a.jsx)(ba.a,{style:{color:"#959595",marginLeft:5},fontSize:"small"})]}),n&&Object(a.jsx)("div",{className:I.avatarIcon,children:Object(a.jsx)(p.a,{alt:d,src:i?"".concat(L.l,"/").concat(i):void 0,sx:{background:l,width:40,height:40},children:!i&&"".concat(Object(L.e)(d)).concat(Object(L.e)(b))})}),n&&Object(a.jsx)("span",{className:I.tongueOne,style:{borderBottom:"15px solid ".concat(E?"#babdbc":"#ffffff")}}),n&&Object(a.jsx)("span",{className:I.tongueTwo,style:{borderBottom:"17px solid ".concat(E?"#babdbc":"#ffffff")}}),x&&Object(a.jsx)("div",{className:I.emojiCompanionTitle,children:L.b[Number(x)]}),h&&Object(a.jsx)("div",{className:I.emojiTitle,children:L.b[Number(h)]}),O&&Object(a.jsx)("div",{className:I.checkboxSelect,children:Object(a.jsx)(la.a,Object(j.a)(Object(j.a)({},xa),{},{checked:H,sx:{color:S?"#ffffff":"#00ff48","&.Mui-checked":{color:S?"#ffffff":"#00ff48"}},onClick:function(){return C(w)}}))}),Object(a.jsxs)(ma,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:R,open:_,onClose:$,children:[Object(a.jsx)(m.a,{onClick:function(e){var t=e.target.id;t===h?Object(ze.L)(w,""):Object(ze.L)(w,t)},style:{cursor:"none"},children:L.b.map((function(e,t){return Object(a.jsx)("div",{className:h===String(t)?I.emojiActive:I.emoji,id:String(t),children:e},e)}))}),Object(a.jsx)(Z.a,{}),Object(a.jsxs)(m.a,{onClick:function(){k(w),$(void 0)},children:[Object(a.jsx)(Qo.a,{}),"Reply"]}),Object(a.jsxs)(m.a,{onClick:function(){N(w),$(void 0)},children:[Object(a.jsx)(Qo.a,{style:{transform:"rotateY(180deg)"}}),"Forward"]}),Object(a.jsx)(nn.CopyToClipboard,{onCopy:function(){return $("copy")},text:"".concat(t||""," ").concat(u||""),children:Object(a.jsxs)(m.a,{children:[Object(a.jsx)(ue.a,{}),"Copy Text"]})}),Object(a.jsxs)(m.a,{onClick:function(){Object(ze.o)(w,!g),$(void 0)},children:[g?Object(a.jsx)(y.a,{className:I.iconClose}):Object(a.jsx)(Tt.a,{}),g?"Unpin":"Pin"]}),Object(a.jsxs)(m.a,{onClick:function(){C(w),$(void 0)},children:[Object(a.jsx)(so.a,{}),"Select"]}),Object(a.jsxs)(m.a,{style:{color:"#f02a2a"},onClick:function(){return $("delete")},children:[Object(a.jsx)(yt.a,{style:{color:"#f02a2a"}}),"Delete"]})]}),Y&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return U(!1);"delete"===t&&(Object(ze.r)(w),U(!1))},className:I.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:I.modalDelete,children:[Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(a.jsx)(zt.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(a.jsx)(zt.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})})},Oa=n(181),va=n.n(Oa),ya=Object(f.a)((function(e){return Object(a.jsx)(u.a,Object(j.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(0),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"4px 4px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(2)}}}}})),Ca=Object(r.a)({container:{display:"flex",alignItems:"flex-start",alignContent:"flex-start",flexDirection:"column",borderRadius:7,position:"relative",padding:"4px 0px 4px 22px"},wrapper:{position:"relative",display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",maxWidth:450,minWidth:200,padding:5,borderRadius:7,wordBreak:"break-word",textAlign:"left",font:"400 .9em 'Open Sans', sans-serif"},wrapperInner:{position:"relative",display:"flex",alignItems:"center",alignContent:"center",width:"100%",cursor:"pointer","&:hover":{backgroundColor:"rgba(104, 105, 104, 0.2)"}},wrapperInnerMessage:{display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",marginLeft:20},informationWrapper:{display:"flex",alignItems:"center",alignContent:"center",justifyContent:"flex-end",width:"100%",paddingRight:3},time:{fontSize:".65em",fontWeight:600,color:"#414141"},copyIcon:{color:"#b56ff7",cursor:"pointer",marginRight:7,"&:hover":{color:"#9c3bf8"}},modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},emojiTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"0.2rem",right:-40},emojiCompanionTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"2.2rem",right:-40},emoji:{cursor:"pointer",fontSize:"1.7rem",transition:"all 0.3s","&:hover":{transform:"scale(1.5)"}},emojiActive:{cursor:"pointer",fontSize:"1.2rem",animation:"$emoji 0.6s ease-out",animationDirection:"forwards",animationIterationCount:1},"@keyframes emoji":{"5%":{transform:"translateY(1rem)"},"10%":{transform:"translateY(0) scale(1)",opacity:1},"50%":{transform:"translateY(-4rem) scale(1.5) rotateY(90deg)"},"80%":{opacity:0},"100%":{transform:"translateY(-8rem) scale(2) rotateY(180deg)",opacity:0}},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}},folderIcon:{color:"#26afee"},replyListItem:{display:"flex",width:"100%",flexWrap:"nowrap",alignContent:"center",alignItems:"center"},checkboxSelect:{position:"absolute",left:-64,top:-10,pointerEvents:"auto"},column:{position:"absolute",content:"",width:2,left:43,top:"10%",height:"80%",backgroundColor:"#26afee"},avatarIcon:{position:"absolute",left:-54,bottom:0},tongueOne:{content:"''",position:"absolute",width:"0",height:"0",borderLeft:"15px solid transparent",borderRight:"15px solid transparent",bottom:"0px",left:"-15px"},tongueTwo:{content:"''",position:"absolute",width:"0",height:"0",borderLeft:"16px solid transparent",borderRight:"16px solid transparent",bottom:"0px",left:"-17px"}}),wa={inputProps:{"aria-label":"Checkbox demo"}},Sa=function(e){var t=e.url,n=e.tongue,c=e.watched,r=e.edited,i=e.avatarUrl,l=e.color,d=e.replyMessage,b=e.message,f=e.name,u=e.lastName,h=e.replyName,x=e.replyLastName,g=e.replyCaption,O=e.createdAt,v=e.caption,C=e.emoji,w=e.emojiCompanion,S=e.pinned,k=e.isSomeSelected,N=e.isSelected,I=e.handleSelected,T=e._id,z=e.nightMode,R=e.handleReply,M=e.handleForward,A=e.fullType,D=e.handleScrollToTheMessage,E=e.oldId,W=Ca(),B=Object(s.useState)(null),P=Object(o.a)(B,2),Y=P[0],U=P[1],_=Object(s.useState)(!1),H=Object(o.a)(_,2),$=H[0],V=H[1],G=Object(s.useState)(!1),q=Object(o.a)(G,2),K=q[0],J=q[1],Q=Boolean(Y),ee=N(T),te=function(e){"copy"===e&&Object(L.a)("Text"),"delete"===e&&J(!0),U(null),V(!1)};return Object(a.jsx)("div",{className:W.container,style:{marginBottom:n?12:0},children:Object(a.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),U(e.currentTarget),V(!0)}(e)},className:W.wrapper,style:{backgroundColor:$?"#babdbc":"#ffffff",pointerEvents:k?"none":"auto"},children:[Object(a.jsx)(sa.a,{style:{color:"#00b333"},variant:"h6",align:"right",children:"".concat(Object(L.e)(f)).concat(Object(L.p)(f,15,1)," \n ").concat(Object(L.e)(u)).concat(Object(L.p)(u,15,1))}),Object(a.jsxs)("div",{className:W.wrapperInner,children:[null===A&&Object(a.jsx)(ue.a,{className:W.folderIcon,fontSize:"large"}),A&&A.includes("audio")&&Object(a.jsx)(ge.a,{className:W.folderIcon,fontSize:"large"}),A&&A.includes("video")&&Object(a.jsx)(Ce.a,{className:W.folderIcon,fontSize:"large"}),A&&A.includes("image")&&Object(a.jsx)(go.a,{className:W.folderIcon,fontSize:"large"}),A&&A.includes("application")&&Object(a.jsx)(X.a,{className:W.folderIcon,fontSize:"large"}),Object(a.jsx)("div",{className:W.column}),Object(a.jsxs)("div",{className:W.wrapperInnerMessage,onClick:function(){return D(E)},children:[Object(a.jsx)(sa.a,{style:{color:"#26afee"},variant:"h6",align:"right",children:"Replied to ".concat(Object(L.e)(h)).concat(Object(L.p)(h,15,1),"\n ").concat(Object(L.e)(x)).concat(Object(L.p)(x,15,1))}),Object(a.jsx)(F.a,{primary:null===A?d:A,primaryTypographyProps:{color:"#535353"}}),Object(a.jsx)(F.a,{secondary:g,secondaryTypographyProps:{color:"#535353"}})]})]}),Object(a.jsx)(F.a,{primary:b,primaryTypographyProps:{color:"#000000"}}),Object(a.jsx)(F.a,{secondary:v,secondaryTypographyProps:{color:"#000000"}}),Object(a.jsxs)("div",{className:W.informationWrapper,children:[Object(a.jsx)("div",{className:W.time,style:{color:"#959595"},children:"".concat(r?"edited ":"").concat(Object(L.t)(O))}),c&&Object(a.jsx)(ba.a,{style:{color:"#959595",marginLeft:5},fontSize:"small"})]}),n&&Object(a.jsx)("div",{className:W.avatarIcon,children:Object(a.jsx)(p.a,{alt:f,src:i?"".concat(L.l,"/").concat(i):void 0,sx:{background:l,width:40,height:40},children:!i&&"".concat(Object(L.e)(f)).concat(Object(L.e)(u))})}),n&&Object(a.jsx)("span",{className:W.tongueOne,style:{borderBottom:"15px solid ".concat($?"#babdbc":"#ffffff")}}),n&&Object(a.jsx)("span",{className:W.tongueTwo,style:{borderBottom:"17px solid ".concat($?"#babdbc":"#ffffff")}}),w&&Object(a.jsx)("div",{className:W.emojiCompanionTitle,children:L.b[Number(w)]}),C&&Object(a.jsx)("div",{className:W.emojiTitle,children:L.b[Number(C)]}),k&&Object(a.jsx)("div",{className:W.checkboxSelect,children:Object(a.jsx)(la.a,Object(j.a)(Object(j.a)({},wa),{},{checked:ee,sx:{color:z?"#ffffff":"#00ff48","&.Mui-checked":{color:z?"#ffffff":"#00ff48"}},onClick:function(){return I(T)}}))}),Object(a.jsxs)(ya,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:Y,open:Q,onClose:te,children:[Object(a.jsx)(m.a,{onClick:function(e){var t=e.target.id;t===C?Object(ze.L)(T,""):Object(ze.L)(T,t)},style:{cursor:"none"},children:L.b.map((function(e,t){return Object(a.jsx)("div",{className:C===String(t)?W.emojiActive:W.emoji,id:String(t),children:e},e)}))}),Object(a.jsx)(Z.a,{}),Object(a.jsxs)(m.a,{onClick:function(){R(T),te(void 0)},children:[Object(a.jsx)(Qo.a,{}),"Reply"]}),Object(a.jsxs)(m.a,{onClick:function(){M(T),te(void 0)},children:[Object(a.jsx)(Qo.a,{style:{transform:"rotateY(180deg)"}}),"Forward"]}),A&&Object(a.jsxs)(m.a,{onClick:function(){return Object(L.g)(t,A)},children:[Object(a.jsx)(va.a,{}),"Download"]}),Object(a.jsx)(nn.CopyToClipboard,{onCopy:function(){return te("copy")},text:"".concat(d&&null===A?d:A," ").concat(g||""," ").concat(b||""," ").concat(v||""),children:Object(a.jsxs)(m.a,{children:[Object(a.jsx)(ue.a,{}),"Copy Text"]})}),Object(a.jsxs)(m.a,{onClick:function(){Object(ze.o)(T,!S),te(void 0)},children:[S?Object(a.jsx)(y.a,{className:W.iconClose}):Object(a.jsx)(Tt.a,{}),S?"Unpin":"Pin"]}),Object(a.jsxs)(m.a,{onClick:function(){I(T),te(void 0)},children:[Object(a.jsx)(so.a,{}),"Select"]}),Object(a.jsxs)(m.a,{style:{color:"#f02a2a"},onClick:function(){return te("delete")},children:[Object(a.jsx)(yt.a,{style:{color:"#f02a2a"}}),"Delete"]})]}),K&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return J(!1);"delete"===t&&(Object(ze.r)(T),J(!1))},className:W.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:W.modalDelete,children:[Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(a.jsx)(zt.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(a.jsx)(zt.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})})},ka=Object(f.a)((function(e){return Object(a.jsx)(u.a,Object(j.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(0),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"4px 4px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(2)}}}}})),Na=Object(r.a)({container:{display:"flex",alignItems:"flex-start",alignContent:"flex-start",flexDirection:"column",borderRadius:7,position:"relative",padding:"4px 0px 4px 22px"},wrapper:{position:"relative",display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",maxWidth:450,minWidth:200,padding:5,borderRadius:7,wordBreak:"break-word",textAlign:"left",font:"400 .9em 'Open Sans', sans-serif"},wrapperInner:{position:"relative",display:"flex",alignItems:"center",alignContent:"center",width:"100%",cursor:"pointer","&:hover":{backgroundColor:"rgba(104, 105, 104, 0.2)"}},wrapperInnerMessage:{display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",marginLeft:20},informationWrapper:{display:"flex",alignItems:"center",alignContent:"center",justifyContent:"flex-end",width:"100%",paddingRight:3},time:{fontSize:".65em",fontWeight:600,color:"#414141"},modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},emojiTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"0.2rem",right:-40},emojiCompanionTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"2.2rem",right:-40},emoji:{cursor:"pointer",fontSize:"1.7rem",transition:"all 0.3s","&:hover":{transform:"scale(1.5)"}},emojiActive:{cursor:"pointer",fontSize:"1.2rem",animation:"$emoji 0.6s ease-out",animationDirection:"forwards",animationIterationCount:1},"@keyframes emoji":{"5%":{transform:"translateY(1rem)"},"10%":{transform:"translateY(0) scale(1)",opacity:1},"50%":{transform:"translateY(-4rem) scale(1.5) rotateY(90deg)"},"80%":{opacity:0},"100%":{transform:"translateY(-8rem) scale(2) rotateY(180deg)",opacity:0}},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}},checkboxSelect:{position:"absolute",left:-64,top:-10,pointerEvents:"auto"},folderIcon:{color:"#26afee"},column:{position:"absolute",content:"",width:2,left:43,top:"10%",height:"80%",backgroundColor:"#26afee"},avatarIcon:{position:"absolute",left:-54,bottom:0},tongueOne:{content:"''",position:"absolute",width:"0",height:"0",borderLeft:"15px solid transparent",borderRight:"15px solid transparent",bottom:"0px",left:"-15px"},tongueTwo:{content:"''",position:"absolute",width:"0",height:"0",borderLeft:"16px solid transparent",borderRight:"16px solid transparent",bottom:"0px",left:"-17px"}}),Ia={inputProps:{"aria-label":"Checkbox demo"}},Ta=function(e){var t=e.url,n=e.companionIdForwardToAndFrom,c=e.oldId,r=e.tongue,i=e.watched,l=e.edited,d=e.avatarUrl,b=e.color,f=e.message,u=e.name,h=e.lastName,x=e.forwardName,g=e.forwardLastName,O=e.forwardMessage,v=e.forwardCaption,C=e.createdAt,w=e.caption,S=e.emoji,k=e.emojiCompanion,N=e.pinned,I=e.isSomeSelected,T=e.isSelected,z=e.handleSelected,R=e._id,M=e.nightMode,A=e.handleReply,D=e.handleForward,E=e.handleScrollToTheChat,W=e.fullType,B=Na(),P=Object(s.useState)(null),Y=Object(o.a)(P,2),U=Y[0],_=Y[1],H=Object(s.useState)(!1),$=Object(o.a)(H,2),V=$[0],G=$[1],q=Object(s.useState)(!1),K=Object(o.a)(q,2),J=K[0],Q=K[1],ee=Boolean(U),te=T(R),ne=function(e){"copy"===e&&Object(L.a)("Text"),"delete"===e&&Q(!0),_(null),G(!1)};return Object(a.jsx)("div",{className:B.container,style:{marginBottom:r?12:0},children:Object(a.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),_(e.currentTarget),G(!0)}(e)},className:B.wrapper,style:{backgroundColor:V?"#babdbc":"#ffffff",pointerEvents:I?"none":"auto"},children:[Object(a.jsx)(sa.a,{style:{color:"#00b333"},variant:"h6",align:"right",children:"".concat(Object(L.e)(u)).concat(Object(L.p)(u,15,1)," \n ").concat(Object(L.e)(h)).concat(Object(L.p)(h,15,1))}),Object(a.jsxs)("div",{className:B.wrapperInner,children:[null===W&&Object(a.jsx)(ue.a,{className:B.folderIcon,fontSize:"large"}),W&&W.includes("audio")&&Object(a.jsx)(ge.a,{className:B.folderIcon,fontSize:"large"}),W&&W.includes("video")&&Object(a.jsx)(Ce.a,{className:B.folderIcon,fontSize:"large"}),W&&W.includes("image")&&Object(a.jsx)(go.a,{className:B.folderIcon,fontSize:"large"}),W&&W.includes("application")&&Object(a.jsx)(X.a,{className:B.folderIcon,fontSize:"large"}),Object(a.jsx)("div",{className:B.column}),Object(a.jsxs)("div",{className:B.wrapperInnerMessage,onClick:function(){return E(n,c)},children:[Object(a.jsx)(sa.a,{style:{color:"#26afee"},variant:"h6",align:"right",children:"Forwarded from ".concat(Object(L.e)(x)).concat(Object(L.p)(x,15,1),"\n ").concat(Object(L.e)(g)).concat(Object(L.p)(g,15,1))}),Object(a.jsx)(F.a,{primary:null===W?O:W,primaryTypographyProps:{color:"#535353"}}),Object(a.jsx)(F.a,{secondary:v,secondaryTypographyProps:{color:"#535353"}})]})]}),Object(a.jsx)(F.a,{primary:f,primaryTypographyProps:{color:"#000000"}}),Object(a.jsx)(F.a,{secondary:w,secondaryTypographyProps:{color:"#000000"}}),Object(a.jsxs)("div",{className:B.informationWrapper,children:[Object(a.jsx)("div",{className:B.time,style:{color:"#959595"},children:"".concat(l?"edited ":"").concat(Object(L.t)(C))}),i&&Object(a.jsx)(ba.a,{style:{color:"#959595",marginLeft:5},fontSize:"small"})]}),r&&Object(a.jsx)("div",{className:B.avatarIcon,children:Object(a.jsx)(p.a,{alt:u,src:d?"".concat(L.l,"/").concat(d):void 0,sx:{background:b,width:40,height:40},children:!d&&"".concat(Object(L.e)(u)).concat(Object(L.e)(h))})}),r&&Object(a.jsx)("span",{className:B.tongueOne,style:{borderBottom:"15px solid ".concat(V?"#babdbc":"#ffffff")}}),r&&Object(a.jsx)("span",{className:B.tongueTwo,style:{borderBottom:"17px solid ".concat(V?"#babdbc":"#ffffff")}}),k&&Object(a.jsx)("div",{className:B.emojiCompanionTitle,children:L.b[Number(k)]}),S&&Object(a.jsx)("div",{className:B.emojiTitle,children:L.b[Number(S)]}),I&&Object(a.jsx)("div",{className:B.checkboxSelect,children:Object(a.jsx)(la.a,Object(j.a)(Object(j.a)({},Ia),{},{checked:te,sx:{color:M?"#ffffff":"#00ff48","&.Mui-checked":{color:M?"#ffffff":"#00ff48"}},onClick:function(){return z(R)}}))}),Object(a.jsxs)(ka,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:U,open:ee,onClose:ne,children:[Object(a.jsx)(m.a,{onClick:function(e){var t=e.target.id;t===S?Object(ze.L)(R,""):Object(ze.L)(R,t)},style:{cursor:"none"},children:L.b.map((function(e,t){return Object(a.jsx)("div",{className:S===String(t)?B.emojiActive:B.emoji,id:String(t),children:e},e)}))}),Object(a.jsx)(Z.a,{}),Object(a.jsxs)(m.a,{onClick:function(){A(R),ne(void 0)},children:[Object(a.jsx)(Qo.a,{}),"Reply"]}),Object(a.jsxs)(m.a,{onClick:function(){D(R),ne(void 0)},children:[Object(a.jsx)(Qo.a,{style:{transform:"rotateY(180deg)"}}),"Forward"]}),W&&Object(a.jsxs)(m.a,{onClick:function(){return Object(L.g)(t,W)},children:[Object(a.jsx)(va.a,{}),"Download"]}),Object(a.jsx)(nn.CopyToClipboard,{onCopy:function(){return ne("copy")},text:"".concat(O&&null===W?O:W," ").concat(v||""," ").concat(f||""," ").concat(w||""),children:Object(a.jsxs)(m.a,{children:[Object(a.jsx)(ue.a,{}),"Copy Text"]})}),Object(a.jsxs)(m.a,{onClick:function(){Object(ze.o)(R,!N),ne(void 0)},children:[N?Object(a.jsx)(y.a,{className:B.iconClose}):Object(a.jsx)(Tt.a,{}),N?"Unpin":"Pin"]}),Object(a.jsxs)(m.a,{onClick:function(){z(R),ne(void 0)},children:[Object(a.jsx)(so.a,{}),"Select"]}),Object(a.jsxs)(m.a,{style:{color:"#f02a2a"},onClick:function(){return ne("delete")},children:[Object(a.jsx)(yt.a,{style:{color:"#f02a2a"}}),"Delete"]})]}),J&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return Q(!1);"delete"===t&&(Object(ze.r)(R),Q(!1))},className:B.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:B.modalDelete,children:[Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(a.jsx)(zt.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(a.jsx)(zt.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})})},za=Object(f.a)((function(e){return Object(a.jsx)(u.a,Object(j.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(0),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"4px 4px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(2)}}}}})),Ra=Object(r.a)({container:{display:"flex",alignItems:"flex-start",alignContent:"flex-start",flexDirection:"column",borderRadius:7,position:"relative",padding:"4px 0px 4px 22px"},wrapper:{position:"relative",display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",width:400,borderRadius:7,padding:5},informationWrapper:{display:"flex",alignItems:"center",alignContent:"center",justifyContent:"flex-end",width:"100%",paddingRight:3},time:{fontSize:".65em",fontWeight:600,color:"#414141"},image:{borderRadius:7,width:"100%",maxHeight:"auto",cursor:"pointer"},bntDownload:{backgroundColor:"inherit",color:"#54b0fc",width:30,height:30,"&:hover":{backgroundColor:"#54b0fc",color:"#ffffff"}},overlay:{position:"fixed",top:0,left:0,width:"100vw",minHeight:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflow:"auto",boxSizing:"border-box",display:"flex",justifyContent:"center",alignContent:"center",alignItems:"center"},topBar:{position:"fixed",top:0,left:0,height:"7vh",width:"100vw",display:"flex",alignContent:"center",alignItems:"center",justifyContent:"space-between",backgroundColor:"rgba(65, 65, 65, 0.9)",zIndex:10,padding:"0px 20px"},wrapperCredentials:{display:"flex",alignContent:"center",alignItems:"center"},wrapperIcons:{display:"flex",alignContent:"center",alignItems:"center"},magnifying:{marginLeft:5,cursor:"pointer",color:"#e9e7e7",padding:0,"&:hover":{color:"#ffffff",transform:"scale(1.1)"}},downloadIcon:{marginLeft:5,cursor:"pointer",color:"#e9e7e7",padding:0,borderRadius:"50%","&:hover":{backgroundColor:"#ffffff",color:"#b8b7b7"}},iconCloseOverlay:{marginLeft:5,cursor:"pointer",color:"#e9e7e7",padding:0,"&:hover":{color:"#ffffff",transform:"rotate(180deg)",transition:"all 250ms ease-out "}},wrapperImage:{borderRadius:5,maxWidth:500,maxHeight:750,display:"flex",overflow:"auto"},innerImage:{objectFit:"cover"},modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlayDelete:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},emojiTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"0.2rem",right:-40},emojiCompanionTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"2.2rem",right:-40},emoji:{cursor:"pointer",fontSize:"1.7rem",transition:"all 0.3s","&:hover":{transform:"scale(1.5)"}},emojiActive:{cursor:"pointer",fontSize:"1.2rem",animation:"$emoji 0.6s ease-out",animationDirection:"forwards",animationIterationCount:1},"@keyframes emoji":{"5%":{transform:"translateY(1rem)"},"10%":{transform:"translateY(0) scale(1)",opacity:1},"50%":{transform:"translateY(-4rem) scale(1.5) rotateY(90deg)"},"80%":{opacity:0},"100%":{transform:"translateY(-8rem) scale(2) rotateY(180deg)",opacity:0}},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}},checkboxSelect:{position:"absolute",left:-64,top:-10,pointerEvents:"auto"},avatarIcon:{position:"absolute",left:-54,bottom:0},tongueOne:{content:"''",position:"absolute",width:"0",height:"0",borderLeft:"15px solid transparent",borderRight:"15px solid transparent",bottom:"0px",left:"-15px"},tongueTwo:{content:"''",position:"absolute",width:"0",height:"0",borderLeft:"16px solid transparent",borderRight:"16px solid transparent",bottom:"0px",left:"-17px"}}),Ma={inputProps:{"aria-label":"Checkbox demo"}},Aa=function(e){var t=e.url,n=e.tongue,c=e.watched,r=e.edited,i=e.avatarUrl,l=e.color,d=e.createdAt,b=e.fullType,f=e.caption,u=e.emoji,h=e.emojiCompanion,x=e.pinned,g=e.isSomeSelected,O=e.isSelected,v=e.handleSelected,C=e._id,w=e.name,S=e.lastName,k=e.nightMode,N=e.handleReply,I=e.handleForward,T=Ra(),z=Object(s.useState)(!1),R=Object(o.a)(z,2),M=R[0],A=R[1],D=Object(s.useState)(null),E=Object(o.a)(D,2),W=E[0],B=E[1],P=Object(s.useState)(!1),U=Object(o.a)(P,2),_=U[0],H=U[1],$=Object(s.useState)(1),V=Object(o.a)($,2),G=V[0],q=V[1],K=Object(s.useRef)(null),J=Object(s.useState)(!1),Q=Object(o.a)(J,2),X=Q[0],ee=Q[1],te=Boolean(W),ne=O(C),oe=function(e){var t=e.target.id;"overlay"!==t&&"close"!==t||(A(!1),K.current.style.transform="scale(1)",q(1))},ae=function(e){"copy"===e&&Object(L.a)("Text"),"delete"===e&&ee(!0),B(null),H(!1)};return M?Object(a.jsxs)("div",{onClick:oe,id:"overlay",className:T.overlay,children:[Object(a.jsxs)("div",{className:T.topBar,children:[Object(a.jsxs)("div",{className:T.wrapperCredentials,children:[Object(a.jsx)(Y.a,{children:Object(a.jsx)(p.a,{alt:w,src:t||void 0,sx:{background:l,width:44,height:44},children:!t&&"".concat(Object(L.e)(w)).concat(Object(L.e)(S))})}),Object(a.jsx)(F.a,{primary:"".concat(Object(L.e)(w)).concat(Object(L.p)(w,15,1),"\n ").concat(Object(L.e)(S)).concat(Object(L.p)(S,15,1)),primaryTypographyProps:{color:"#ffffff"},secondary:Object(L.r)(d),secondaryTypographyProps:{color:"#ffffff"}})]}),Object(a.jsxs)("div",{className:T.wrapperIcons,children:[Object(a.jsx)(ie.a,{onClick:function(){G>=.5&&(K.current.style.transform="scale(".concat(G-.25,",").concat(G-.25,")"),K.current.style.transformOrigin="".concat(50/G-.25,"px ").concat(50/G-.25,"px"),q(G-.25))},className:T.magnifying,fontSize:"large"}),Object(a.jsx)(le.a,{onClick:function(){G<5&&(K.current.style.transform="scale(".concat(G+.25,",").concat(G+.25,")"),K.current.style.transformOrigin="".concat(50/G+.25,"px ").concat(50/G+.25,"px"),q(G+.25))},className:T.magnifying,fontSize:"large"}),Object(a.jsx)(ce.a,{onClick:function(){return Object(L.g)(t,b)},className:T.downloadIcon,fontSize:"large"}),Object(a.jsx)(y.a,{id:"close",onClick:oe,className:T.iconCloseOverlay,fontSize:"large"})]})]}),Object(a.jsx)("div",{ref:K,className:T.wrapperImage,children:Object(a.jsx)("img",{className:T.innerImage,width:"100%",height:"auto",alt:"imageItem",src:t})})]}):Object(a.jsx)("div",{className:T.container,style:{marginBottom:n?12:0},children:Object(a.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),B(e.currentTarget),H(!0)}(e)},className:T.wrapper,style:{backgroundColor:_?"#babdbc":"#ffffff",pointerEvents:g?"none":"auto"},children:[Object(a.jsx)(sa.a,{style:{color:"#00b333",marginBottom:10},variant:"h6",align:"right",children:"".concat(Object(L.e)(w)).concat(Object(L.p)(w,15,1)," \n ").concat(Object(L.e)(S)).concat(Object(L.p)(S,15,1))}),Object(a.jsx)("img",{onClick:function(){return!M&&A(!0)},className:T.image,alt:"message pic",src:t,style:{backgroundColor:t?"":l},width:"300",height:"400"}),Object(a.jsx)(F.a,{style:{wordBreak:"break-word"},secondary:f,secondaryTypographyProps:{color:"#000000"}}),Object(a.jsxs)("div",{className:T.informationWrapper,children:[Object(a.jsx)("div",{className:T.time,style:{color:"#959595"},children:"".concat(r?"edited ":"").concat(Object(L.t)(d))}),c&&Object(a.jsx)(ba.a,{style:{color:"#959595",marginLeft:5},fontSize:"small"})]}),n&&Object(a.jsx)("div",{className:T.avatarIcon,children:Object(a.jsx)(p.a,{alt:w,src:i?"".concat(L.l,"/").concat(i):void 0,sx:{background:l,width:40,height:40},children:!i&&"".concat(Object(L.e)(w)).concat(Object(L.e)(S))})}),n&&Object(a.jsx)("span",{className:T.tongueOne,style:{borderBottom:"15px solid ".concat(_?"#babdbc":"#ffffff")}}),n&&Object(a.jsx)("span",{className:T.tongueTwo,style:{borderBottom:"17px solid ".concat(_?"#babdbc":"#ffffff")}}),h&&Object(a.jsx)("div",{className:T.emojiCompanionTitle,children:L.b[Number(h)]}),u&&Object(a.jsx)("div",{className:T.emojiTitle,children:L.b[Number(u)]}),g&&Object(a.jsx)("div",{className:T.checkboxSelect,children:Object(a.jsx)(la.a,Object(j.a)(Object(j.a)({},Ma),{},{checked:ne,sx:{color:k?"#ffffff":"#00ff48","&.Mui-checked":{color:k?"#ffffff":"#00ff48"}},onClick:function(){return v(C)}}))}),Object(a.jsxs)(za,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:W,open:te,onClose:ae,children:[Object(a.jsx)(m.a,{onClick:function(e){var t=e.target.id;t===u?Object(ze.L)(C,""):Object(ze.L)(C,t)},style:{cursor:"none"},children:L.b.map((function(e,t){return Object(a.jsx)("div",{className:u===String(t)?T.emojiActive:T.emoji,id:String(t),children:e},e)}))}),Object(a.jsx)(Z.a,{}),Object(a.jsxs)(m.a,{onClick:function(){N(C),ae(void 0)},children:[Object(a.jsx)(Qo.a,{}),"Reply"]}),Object(a.jsxs)(m.a,{onClick:function(){I(C),ae(void 0)},children:[Object(a.jsx)(Qo.a,{style:{transform:"rotateY(180deg)"}}),"Forward"]}),Object(a.jsxs)(m.a,{onClick:function(){return Object(L.g)(t,b)},children:[Object(a.jsx)(va.a,{}),"Download"]}),f&&Object(a.jsx)(nn.CopyToClipboard,{onCopy:function(){return ae("copy")},text:f,children:Object(a.jsxs)(m.a,{children:[Object(a.jsx)(ue.a,{}),"Copy Text"]})}),Object(a.jsxs)(m.a,{onClick:function(){Object(ze.o)(C,!x),ae(void 0)},children:[x?Object(a.jsx)(y.a,{className:T.iconClose}):Object(a.jsx)(Tt.a,{}),x?"Unpin":"Pin"]}),Object(a.jsxs)(m.a,{onClick:function(){v(C),ae(void 0)},children:[Object(a.jsx)(so.a,{}),"Select"]}),Object(a.jsxs)(m.a,{style:{color:"#f02a2a"},onClick:function(){return ae("delete")},children:[Object(a.jsx)(yt.a,{style:{color:"#f02a2a"}}),"Delete"]})]}),X&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return ee(!1);"delete"===t&&(Object(ze.r)(C),ee(!1))},className:T.overlayDelete,id:"overlay",children:Object(a.jsxs)("div",{className:T.modalDelete,children:[Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(a.jsx)(zt.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(a.jsx)(zt.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})})},Da=n(337),Ea=n.n(Da),La=Object(f.a)((function(e){return Object(a.jsx)(u.a,Object(j.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(0),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"4px 4px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(2)}}}}})),Wa=Object(r.a)({container:{display:"flex",alignItems:"flex-start",alignContent:"flex-start",flexDirection:"column",borderRadius:7,position:"relative",padding:"4px 0px 4px 22px"},wrapper:{position:"relative",display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",padding:5,width:350,borderRadius:7},informationWrapper:{display:"flex",alignItems:"center",alignContent:"center",justifyContent:"flex-end",width:"100%",paddingRight:3},time:{fontSize:".65em",fontWeight:600,color:"#414141"},player:{borderRadius:7,width:"100%"},modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},emojiTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"0.2rem",right:-40},emojiCompanionTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"2.2rem",right:-40},emoji:{cursor:"pointer",fontSize:"1.7rem",transition:"all 0.3s","&:hover":{transform:"scale(1.5)"}},emojiActive:{cursor:"pointer",fontSize:"1.2rem",animation:"$emoji 0.6s ease-out",animationDirection:"forwards",animationIterationCount:1},"@keyframes emoji":{"5%":{transform:"translateY(1rem)"},"10%":{transform:"translateY(0) scale(1)",opacity:1},"50%":{transform:"translateY(-4rem) scale(1.5) rotateY(90deg)"},"80%":{opacity:0},"100%":{transform:"translateY(-8rem) scale(2) rotateY(180deg)",opacity:0}},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}},checkboxSelect:{position:"absolute",left:-64,top:-10,pointerEvents:"auto"},avatarIcon:{position:"absolute",left:-54,bottom:10},tongueOne:{content:"''",position:"absolute",width:"0",height:"0",borderLeft:"15px solid transparent",borderRight:"15px solid transparent",bottom:"0px",left:"-15px"},tongueTwo:{content:"''",position:"absolute",width:"0",height:"0",borderLeft:"16px solid transparent",borderRight:"16px solid transparent",bottom:"0px",left:"-17px"}}),Ba={inputProps:{"aria-label":"Checkbox demo"}},Pa=function(e){var t=e.url,n=e.tongue,c=e.watched,r=e.edited,i=e.avatarUrl,l=e.color,d=e.name,b=e.lastName,f=e.createdAt,u=e.fullType,h=e.caption,x=e.emoji,g=e.emojiCompanion,O=e.pinned,v=e.isSomeSelected,C=e.isSelected,w=e.handleSelected,S=e._id,k=e.nightMode,N=e.handleReply,I=e.handleForward,T=Wa(),z=Object(s.useState)(null),R=Object(o.a)(z,2),M=R[0],A=R[1],D=Object(s.useState)(!1),E=Object(o.a)(D,2),W=E[0],B=E[1],P=Object(s.useState)(!1),Y=Object(o.a)(P,2),U=Y[0],_=Y[1],H=Boolean(M),$=C(S),V=function(e){"copy"===e&&Object(L.a)("Text"),"delete"===e&&_(!0),A(null),B(!1)};return Object(a.jsx)("div",{className:T.container,style:{marginBottom:n?12:0},children:Object(a.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),A(e.currentTarget),B(!0)}(e)},className:T.wrapper,style:{backgroundColor:W?"#babdbc":"#ffffff",pointerEvents:v?"none":"auto"},children:[Object(a.jsx)(sa.a,{style:{color:"#00b333",marginBottom:10},variant:"h6",align:"right",children:"".concat(Object(L.e)(d)).concat(Object(L.p)(d,15,1)," \n ").concat(Object(L.e)(b)).concat(Object(L.p)(b,15,1))}),Object(a.jsx)(Ea.a,{className:T.player,src:t,controls:!0}),Object(a.jsx)(F.a,{style:{wordBreak:"break-word"},secondary:h,secondaryTypographyProps:{color:"#000000"}}),Object(a.jsxs)("div",{className:T.informationWrapper,children:[Object(a.jsx)("div",{className:T.time,style:{color:"#959595"},children:"".concat(r?"edited ":"").concat(Object(L.t)(f))}),c&&Object(a.jsx)(ba.a,{style:{color:"#959595",marginLeft:5},fontSize:"small"})]}),n&&Object(a.jsx)("div",{className:T.avatarIcon,children:Object(a.jsx)(p.a,{alt:d,src:i?"".concat(L.l,"/").concat(i):void 0,sx:{background:l,width:40,height:40},children:!i&&"".concat(Object(L.e)(d)).concat(Object(L.e)(b))})}),n&&Object(a.jsx)("span",{className:T.tongueOne,style:{borderBottom:"15px solid ".concat(W?"#babdbc":"#ffffff")}}),n&&Object(a.jsx)("span",{className:T.tongueTwo,style:{borderBottom:"17px solid ".concat(W?"#babdbc":"#ffffff")}}),g&&Object(a.jsx)("div",{className:T.emojiCompanionTitle,children:L.b[Number(g)]}),x&&Object(a.jsx)("div",{className:T.emojiTitle,children:L.b[Number(x)]}),v&&Object(a.jsx)("div",{className:T.checkboxSelect,children:Object(a.jsx)(la.a,Object(j.a)(Object(j.a)({},Ba),{},{checked:$,sx:{color:k?"#ffffff":"#00ff48","&.Mui-checked":{color:k?"#ffffff":"#00ff48"}},onClick:function(){return w(S)}}))}),Object(a.jsxs)(La,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:M,open:H,onClose:V,children:[Object(a.jsx)(m.a,{onClick:function(e){var t=e.target.id;t===x?Object(ze.L)(S,""):Object(ze.L)(S,t)},style:{cursor:"none"},children:L.b.map((function(e,t){return Object(a.jsx)("div",{className:x===String(t)?T.emojiActive:T.emoji,id:String(t),children:e},e)}))}),Object(a.jsx)(Z.a,{}),Object(a.jsxs)(m.a,{onClick:function(){N(S),V(void 0)},children:[Object(a.jsx)(Qo.a,{}),"Reply"]}),Object(a.jsxs)(m.a,{onClick:function(){I(S),V(void 0)},children:[Object(a.jsx)(Qo.a,{style:{transform:"rotateY(180deg)"}}),"Forward"]}),Object(a.jsxs)(m.a,{onClick:function(){return Object(L.g)(t,u)},children:[Object(a.jsx)(va.a,{}),"Download"]}),h&&Object(a.jsx)(nn.CopyToClipboard,{onCopy:function(){return V("copy")},text:h,children:Object(a.jsxs)(m.a,{children:[Object(a.jsx)(ue.a,{}),"Copy Text"]})}),Object(a.jsxs)(m.a,{onClick:function(){Object(ze.o)(S,!O),V(void 0)},children:[O?Object(a.jsx)(y.a,{className:T.iconClose}):Object(a.jsx)(Tt.a,{}),O?"Unpin":"Pin"]}),Object(a.jsxs)(m.a,{onClick:function(){w(S),V(void 0)},children:[Object(a.jsx)(so.a,{}),"Select"]}),Object(a.jsxs)(m.a,{style:{color:"#f02a2a"},onClick:function(){return V("delete")},children:[Object(a.jsx)(yt.a,{style:{color:"#f02a2a"}}),"Delete"]})]}),U&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return _(!1);"delete"===t&&(Object(ze.r)(S),_(!1))},className:T.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:T.modalDelete,children:[Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(a.jsx)(zt.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(a.jsx)(zt.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})})},Fa=n(338).Player,Ya=Object(f.a)((function(e){return Object(a.jsx)(u.a,Object(j.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(0),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"4px 4px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(2)}}}}})),Ua=Object(r.a)({container:{display:"flex",alignItems:"flex-start",alignContent:"flex-start",flexDirection:"column",borderRadius:7,position:"relative",padding:"4px 0px 4px 22px"},wrapper:{position:"relative",display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",width:400,padding:5,borderRadius:7},informationWrapper:{display:"flex",alignItems:"center",alignContent:"center",justifyContent:"flex-end",width:"100%",paddingRight:3},time:{fontSize:".65em",fontWeight:600,color:"#414141"},bntDownload:{backgroundColor:"inherit",color:"#54b0fc",width:30,height:30,marginLeft:5,"&:hover":{backgroundColor:"#54b0fc",color:"#ffffff"}},player:{backgroundColor:"#ffffff",width:"100%"},playerActive:{backgroundColor:"#babdbc",width:"100%"},modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},emojiTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"0.2rem",right:-40},emojiCompanionTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"2.2rem",right:-40},emoji:{cursor:"pointer",fontSize:"1.7rem",transition:"all 0.3s","&:hover":{transform:"scale(1.5)"}},emojiActive:{cursor:"pointer",fontSize:"1.2rem",animation:"$emoji 0.6s ease-out",animationDirection:"forwards",animationIterationCount:1},"@keyframes emoji":{"5%":{transform:"translateY(1rem)"},"10%":{transform:"translateY(0) scale(1)",opacity:1},"50%":{transform:"translateY(-4rem) scale(1.5) rotateY(90deg)"},"80%":{opacity:0},"100%":{transform:"translateY(-8rem) scale(2) rotateY(180deg)",opacity:0}},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}},checkboxSelect:{position:"absolute",left:-64,top:-10,pointerEvents:"auto"},avatarIcon:{position:"absolute",left:-54,bottom:0},tongueOne:{content:"''",position:"absolute",width:"0",height:"0",borderLeft:"15px solid transparent",borderRight:"15px solid transparent",bottom:"0px",left:"-15px"},tongueTwo:{content:"''",position:"absolute",width:"0",height:"0",borderLeft:"16px solid transparent",borderRight:"16px solid transparent",bottom:"0px",left:"-17px"}}),_a={inputProps:{"aria-label":"Checkbox demo"}},Ha=function(e){var t=e.url,n=e.tongue,c=e.watched,r=e.edited,i=e.avatarUrl,l=e.color,d=e.name,b=e.lastName,f=e.createdAt,u=e.fullType,h=e.caption,x=e.emoji,g=e.emojiCompanion,O=e.pinned,v=e.isSomeSelected,C=e.isSelected,w=e.handleSelected,S=e._id,k=e.nightMode,N=e.handleReply,I=e.handleForward,T=Ua(),z=Object(s.useState)(null),R=Object(o.a)(z,2),M=R[0],A=R[1],D=Object(s.useState)(!1),E=Object(o.a)(D,2),W=E[0],B=E[1],P=Object(s.useState)(!1),Y=Object(o.a)(P,2),U=Y[0],_=Y[1],H=Boolean(M),$=C(S),V=function(e){"copy"===e&&Object(L.a)("Text"),"delete"===e&&_(!0),A(null),B(!1)};return Object(a.jsx)("div",{className:T.container,style:{marginBottom:n?12:0},children:Object(a.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),A(e.currentTarget),B(!0)}(e)},className:T.wrapper,style:{backgroundColor:W?"#babdbc":"#ffffff",pointerEvents:v?"none":"auto"},children:[Object(a.jsx)(sa.a,{style:{color:"#00b333",marginBottom:10},variant:"h6",align:"right",children:"".concat(Object(L.e)(d)).concat(Object(L.p)(d,15,1)," \n ").concat(Object(L.e)(b)).concat(Object(L.p)(b,15,1))}),Object(a.jsx)(Fa,{className:W?T.playerActive:T.player,playsInline:!0,src:t}),Object(a.jsx)(F.a,{style:{wordBreak:"break-word"},secondary:h,secondaryTypographyProps:{color:"#000000"}}),Object(a.jsxs)("div",{className:T.informationWrapper,children:[Object(a.jsx)("div",{className:T.time,style:{color:"#959595"},children:"".concat(r?"edited ":"").concat(Object(L.t)(f))}),c&&Object(a.jsx)(ba.a,{style:{color:"#959595",marginLeft:5},fontSize:"small"})]}),n&&Object(a.jsx)("div",{className:T.avatarIcon,children:Object(a.jsx)(p.a,{alt:d,src:i?"".concat(L.l,"/").concat(i):void 0,sx:{background:l,width:40,height:40},children:!i&&"".concat(Object(L.e)(d)).concat(Object(L.e)(b))})}),n&&Object(a.jsx)("span",{className:T.tongueOne,style:{borderBottom:"15px solid ".concat(W?"#babdbc":"#ffffff")}}),n&&Object(a.jsx)("span",{className:T.tongueTwo,style:{borderBottom:"17px solid ".concat(W?"#babdbc":"#ffffff")}}),g&&Object(a.jsx)("div",{className:T.emojiCompanionTitle,children:L.b[Number(g)]}),x&&Object(a.jsx)("div",{className:T.emojiTitle,children:L.b[Number(x)]}),v&&Object(a.jsx)("div",{className:T.checkboxSelect,children:Object(a.jsx)(la.a,Object(j.a)(Object(j.a)({},_a),{},{checked:$,sx:{color:k?"#ffffff":"#00ff48","&.Mui-checked":{color:k?"#ffffff":"#00ff48"}},onClick:function(){return w(S)}}))}),Object(a.jsxs)(Ya,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:M,open:H,onClose:V,children:[Object(a.jsx)(m.a,{onClick:function(e){var t=e.target.id;t===x?Object(ze.L)(S,""):Object(ze.L)(S,t)},style:{cursor:"none"},children:L.b.map((function(e,t){return Object(a.jsx)("div",{className:x===String(t)?T.emojiActive:T.emoji,id:String(t),children:e},e)}))}),Object(a.jsx)(Z.a,{}),Object(a.jsxs)(m.a,{onClick:function(){N(S),V(void 0)},children:[Object(a.jsx)(Qo.a,{}),"Reply"]}),Object(a.jsxs)(m.a,{onClick:function(){I(S),V(void 0)},children:[Object(a.jsx)(Qo.a,{style:{transform:"rotateY(180deg)"}}),"Forward"]}),Object(a.jsxs)(m.a,{onClick:function(){return Object(L.g)(t,u)},children:[Object(a.jsx)(va.a,{}),"Download"]}),h&&Object(a.jsx)(nn.CopyToClipboard,{onCopy:function(){return V("copy")},text:h,children:Object(a.jsxs)(m.a,{children:[Object(a.jsx)(ue.a,{}),"Copy Text"]})}),Object(a.jsxs)(m.a,{onClick:function(){Object(ze.o)(S,!O),V(void 0)},children:[O?Object(a.jsx)(y.a,{className:T.iconClose}):Object(a.jsx)(Tt.a,{}),O?"Unpin":"Pin"]}),Object(a.jsxs)(m.a,{onClick:function(){w(S),V(void 0)},children:[Object(a.jsx)(so.a,{}),"Select"]}),Object(a.jsxs)(m.a,{style:{color:"#f02a2a"},onClick:function(){return V("delete")},children:[Object(a.jsx)(yt.a,{style:{color:"#f02a2a"}}),"Delete"]})]}),U&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return _(!1);"delete"===t&&(Object(ze.r)(S),_(!1))},className:T.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:T.modalDelete,children:[Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(a.jsx)(zt.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(a.jsx)(zt.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})})},$a=n(367),Va=Object(f.a)((function(e){return Object(a.jsx)(u.a,Object(j.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(0),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"4px 4px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(2)}}}}})),Ga=Object(r.a)({container:{display:"flex",alignItems:"flex-start",alignContent:"flex-start",flexDirection:"column",borderRadius:7,padding:"4px 0px 4px 22px"},wrapper:{position:"relative",display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",maxWidth:450,minWidth:300,padding:5,borderRadius:7},informationWrapper:{display:"flex",alignItems:"center",alignContent:"center",justifyContent:"flex-end",width:"100%",paddingRight:3},time:{fontSize:".65em",fontWeight:600,color:"#414141"},overlay:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(104, 105, 104, 0.6)",border:"solid 2px #0084ff",cursor:"auto",zIndex:100,overflow:"auto"},wrapperIcons:{position:"absolute",top:14,right:40,display:"flex",alignContent:"center",alignItems:"center",padding:"2px 10px",borderRadius:10,backgroundColor:"rgba(65, 65, 65, 0.9)",zIndex:150},magnifying:{cursor:"pointer",color:"#e9e7e7",padding:0,marginRight:10,"&:hover":{color:"#ffffff",transform:"scale(1.1)"}},iconCloseOverlay:{marginLeft:5,cursor:"pointer",color:"#e9e7e7",padding:0,"&:hover":{color:"#ffffff",transform:"rotate(180deg)",transition:"all 250ms ease-out "}},modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlayDelete:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},emojiTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"0.2rem",right:-40},emojiCompanionTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"2.2rem",right:-40},emoji:{cursor:"pointer",fontSize:"1.7rem",transition:"all 0.3s","&:hover":{transform:"scale(1.5)"}},emojiActive:{cursor:"pointer",fontSize:"1.2rem",animation:"$emoji 0.6s ease-out",animationDirection:"forwards",animationIterationCount:1},"@keyframes emoji":{"5%":{transform:"translateY(1rem)"},"10%":{transform:"translateY(0) scale(1)",opacity:1},"50%":{transform:"translateY(-4rem) scale(1.5) rotateY(90deg)"},"80%":{opacity:0},"100%":{transform:"translateY(-8rem) scale(2) rotateY(180deg)",opacity:0}},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}},checkboxSelect:{position:"absolute",left:-64,top:-10,pointerEvents:"auto"},folderIcon:{marginRight:7,color:"#54b0fc",cursor:"pointer","&:hover":{color:"#016cc3"}},avatarIcon:{position:"absolute",left:-54,bottom:0},tongueOne:{content:"''",position:"absolute",width:"0",height:"0",borderLeft:"15px solid transparent",borderRight:"15px solid transparent",bottom:"0px",left:"-15px"},tongueTwo:{content:"''",position:"absolute",width:"0",height:"0",borderLeft:"16px solid transparent",borderRight:"16px solid transparent",bottom:"0px",left:"-17px"}}),qa={inputProps:{"aria-label":"Checkbox demo"}},Ka=function(e){var t=e.url,n=e.tongue,c=e.watched,r=e.edited,i=e.avatarUrl,l=e.color,d=e.name,b=e.lastName,f=e.createdAt,u=e.type,h=e.caption,x=e.emoji,g=e.emojiCompanion,O=e.pinned,v=e.isSomeSelected,C=e.isSelected,w=e.handleSelected,S=e._id,k=e.nightMode,N=e.handleReply,I=e.handleForward,T=Ga(),z=Object(s.useState)(!1),R=Object(o.a)(z,2),M=R[0],A=R[1],D=Object(s.useState)(null),E=Object(o.a)(D,2),W=E[0],B=E[1],P=Object(s.useState)(!1),Y=Object(o.a)(P,2),U=Y[0],_=Y[1],H=Object(s.useState)(1),$=Object(o.a)(H,2),V=$[0],G=$[1],q=Object(s.useState)(!1),K=Object(o.a)(q,2),J=K[0],Q=K[1],X=Object(s.useRef)(null),ee=Boolean(W),te=C(S),ne=function(e){var t=e.target.id;"overlay"!==t&&"close"!==t||(A(!1),G(1))},oe=function(e){"copy"===e&&Object(L.a)("Text"),"delete"===e&&Q(!0),B(null),_(!1)};return Object(a.jsxs)("div",{className:T.container,style:{marginBottom:n?12:0},children:[M&&Object(a.jsxs)("div",{className:T.wrapperIcons,children:[Object(a.jsx)(ie.a,{onClick:function(){V>=.5&&(X.current.style.transform="scale(".concat(V-.25,",").concat(V-.25,")"),X.current.style.transformOrigin="".concat(50/V-.25,"px ").concat(50/V-.25,"px"),G(V-.25))},className:T.magnifying,fontSize:"large"}),Object(a.jsx)(le.a,{onClick:function(){V<5&&(X.current.style.transform="scale(".concat(V+.25,",").concat(V+.25,")"),X.current.style.transformOrigin="".concat(50/V+.25,"px ").concat(50/V+.25,"px"),G(V+.25))},className:T.magnifying,fontSize:"large"}),Object(a.jsx)(y.a,{id:"close",onClick:ne,className:T.iconCloseOverlay,fontSize:"large"})]}),M&&Object(a.jsx)("div",{className:T.overlay,id:"overlay",onClick:ne,children:Object(a.jsx)("div",{ref:X,children:Object(a.jsx)($a,{allowFullScreen:!0,fileType:u,filePath:t,onError:ne})})}),Object(a.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),B(e.currentTarget),_(!0)}(e)},className:T.wrapper,style:{backgroundColor:U?"#babdbc":"#ffffff",pointerEvents:v?"none":"auto"},children:[Object(a.jsx)(sa.a,{style:{color:"#00b333",marginBottom:10},variant:"h6",align:"right",children:"".concat(Object(L.e)(d)).concat(Object(L.p)(d,15,1)," \n ").concat(Object(L.e)(b)).concat(Object(L.p)(b,15,1))}),!M&&Object(a.jsx)(zt.a,{fullWidth:!0,onClick:function(){return!M&&A(!0)},variant:"contained",color:"warning",style:{fontWeight:500,fontSize:18},children:"Read File"}),Object(a.jsx)(F.a,{style:{wordBreak:"break-word"},secondary:h,secondaryTypographyProps:{color:"#000000"}}),Object(a.jsxs)("div",{className:T.informationWrapper,children:[Object(a.jsx)("div",{className:T.time,style:{color:"#959595"},children:"".concat(r?"edited ":"").concat(Object(L.t)(f))}),c&&Object(a.jsx)(ba.a,{style:{color:"#959595",marginLeft:5},fontSize:"small"})]}),n&&Object(a.jsx)("div",{className:T.avatarIcon,children:Object(a.jsx)(p.a,{alt:d,src:i?"".concat(L.l,"/").concat(i):void 0,sx:{background:l,width:40,height:40},children:!i&&"".concat(Object(L.e)(d)).concat(Object(L.e)(b))})}),n&&Object(a.jsx)("span",{className:T.tongueOne,style:{borderBottom:"15px solid ".concat(U?"#babdbc":"#ffffff")}}),n&&Object(a.jsx)("span",{className:T.tongueTwo,style:{borderBottom:"17px solid ".concat(U?"#babdbc":"#ffffff")}}),g&&Object(a.jsx)("div",{className:T.emojiCompanionTitle,children:L.b[Number(g)]}),x&&Object(a.jsx)("div",{className:T.emojiTitle,children:L.b[Number(x)]}),v&&Object(a.jsx)("div",{className:T.checkboxSelect,children:Object(a.jsx)(la.a,Object(j.a)(Object(j.a)({},qa),{},{checked:te,sx:{color:k?"#ffffff":"#00ff48","&.Mui-checked":{color:k?"#ffffff":"#00ff48"}},onClick:function(){return w(S)}}))}),Object(a.jsxs)(Va,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:W,open:ee,onClose:oe,children:[Object(a.jsx)(m.a,{onClick:function(e){var t=e.target.id;t===x?Object(ze.L)(S,""):Object(ze.L)(S,t)},style:{cursor:"none"},children:L.b.map((function(e,t){return Object(a.jsx)("div",{className:x===String(t)?T.emojiActive:T.emoji,id:String(t),children:e},e)}))}),Object(a.jsx)(Z.a,{}),Object(a.jsxs)(m.a,{onClick:function(){N(S),oe(void 0)},children:[Object(a.jsx)(Qo.a,{}),"Reply"]}),Object(a.jsxs)(m.a,{onClick:function(){I(S),oe(void 0)},children:[Object(a.jsx)(Qo.a,{style:{transform:"rotateY(180deg)"}}),"Forward"]}),Object(a.jsxs)(m.a,{onClick:function(e){e.stopPropagation(),Object(L.g)(t,u)},children:[Object(a.jsx)(va.a,{}),"Download"]}),h&&Object(a.jsx)(nn.CopyToClipboard,{onCopy:function(){return oe("copy")},text:h,children:Object(a.jsxs)(m.a,{children:[Object(a.jsx)(ue.a,{}),"Copy Text"]})}),Object(a.jsxs)(m.a,{onClick:function(){Object(ze.o)(S,!O),oe(void 0)},children:[O?Object(a.jsx)(y.a,{className:T.iconClose}):Object(a.jsx)(Tt.a,{}),O?"Unpin":"Pin"]}),Object(a.jsxs)(m.a,{onClick:function(){w(S),oe(void 0)},children:[Object(a.jsx)(so.a,{}),"Select"]}),Object(a.jsxs)(m.a,{style:{color:"#f02a2a"},onClick:function(){return oe("delete")},children:[Object(a.jsx)(yt.a,{style:{color:"#f02a2a"}}),"Delete"]})]}),J&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return Q(!1);"delete"===t&&(Object(ze.r)(S),Q(!1))},className:T.overlayDelete,id:"overlay",children:Object(a.jsxs)("div",{className:T.modalDelete,children:[Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(a.jsx)(zt.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(a.jsx)(zt.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})]})},Ja=Object(f.a)((function(e){return Object(a.jsx)(u.a,Object(j.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(0),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"4px 4px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(2)}}}}})),Qa=Object(r.a)({container:{display:"flex",alignItems:"flex-end",alignContent:"flex-end",flexDirection:"column",borderRadius:7,position:"relative",padding:"4px 22px 4px 0px"},wrapper:{position:"relative",display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",maxWidth:450,minWidth:200,padding:5,borderRadius:7,wordBreak:"break-word",textAlign:"left",font:"400 .9em 'Open Sans', sans-serif"},wrapperInner:{position:"relative",display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",width:"100%",cursor:"pointer",padding:"0px 10px","&:hover":{backgroundColor:"rgba(104, 105, 104, 0.2)"}},deletedInformation:{display:"flex",justifyContent:"start",alignItems:"center",alignContent:"center"},informationWrapper:{display:"flex",alignItems:"center",alignContent:"center",justifyContent:"flex-end",width:"100%",paddingRight:3},time:{fontSize:".65em",fontWeight:600},modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},emojiTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"0.2rem",left:-40},emojiCompanionTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"2.2rem",left:-40},emoji:{cursor:"pointer",fontSize:"1.7rem",transition:"all 0.3s","&:hover":{transform:"scale(1.5)"}},emojiActive:{cursor:"pointer",fontSize:"1.2rem",animation:"$emoji 0.6s ease-out",animationDirection:"forwards",animationIterationCount:1},"@keyframes emoji":{"5%":{transform:"translateY(1rem)"},"10%":{transform:"translateY(0) scale(1)",opacity:1},"50%":{transform:"translateY(-4rem) scale(1.5) rotateY(90deg)"},"80%":{opacity:0},"100%":{transform:"translateY(-8rem) scale(2) rotateY(180deg)",opacity:0}},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}},checkboxSelect:{position:"absolute",right:-64,top:-10,pointerEvents:"auto"},folderIcon:{color:"#535353",marginRight:5},column:{position:"absolute",content:"",width:2,left:0,top:"10%",height:"80%",backgroundColor:"#535353"},avatarIcon:{position:"absolute",right:-54,bottom:0},tongueOne:{content:"''",position:"absolute",width:"0",height:"0",borderRight:"15px solid transparent",borderLeft:"15px solid transparent",bottom:"0px",right:"-15px"},tongueTwo:{content:"''",position:"absolute",width:"0",height:"0",borderRight:"16px solid transparent",borderLeft:"16px solid transparent",bottom:"0px",right:"-17px"}}),Xa={inputProps:{"aria-label":"Checkbox demo"}},Za=function(e){var t=e.tongue,n=e.watched,c=e.edited,r=e.avatarUrl,i=e.companionIdForwardToAndFrom,l=e.color,d=e.message,b=e.name,f=e.lastName,u=e.forwardReplyName,h=e.forwardReplyLastName,x=e.caption,g=e.createdAt,O=e.emoji,v=e.emojiCompanion,C=e.pinned,w=e.isSomeSelected,S=e.isSelected,k=e.handleSelected,N=e._id,I=e.nightMode,T=e.handleReply,z=e.handleForward,R=e.handleEdit,M=e.handleOpenTheChat,A=Qa(),D=Object(s.useState)(null),E=Object(o.a)(D,2),W=E[0],B=E[1],P=Object(s.useState)(!1),Y=Object(o.a)(P,2),U=Y[0],_=Y[1],H=Object(s.useState)(!1),$=Object(o.a)(H,2),V=$[0],G=$[1],q=Boolean(W),K=S(N),J=function(e){"copy"===e&&Object(L.a)("Text"),"delete"===e&&G(!0),B(null),_(!1)};return Object(a.jsx)("div",{className:A.container,style:{marginBottom:t?12:0},children:Object(a.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),B(e.currentTarget),_(!0)}(e)},className:A.wrapper,style:{backgroundColor:U?"#ced8d7":"#deffa9",pointerEvents:w?"none":"auto"},children:[Object(a.jsx)(sa.a,{style:{color:"#26afee"},variant:"h6",align:"right",children:"".concat(Object(L.e)(b)).concat(Object(L.p)(b,15,1)," \n ").concat(Object(L.e)(f)).concat(Object(L.p)(f,15,1))}),Object(a.jsxs)("div",{className:A.wrapperInner,onClick:function(){return M(i)},children:[Object(a.jsx)("div",{className:A.column}),Object(a.jsx)(sa.a,{style:{color:"#535353"},variant:"h6",align:"right",children:"".concat(i?"Forwarded from":"Replied to"," ").concat(Object(L.e)(u)).concat(Object(L.p)(u,15,1),"\n ").concat(Object(L.e)(h)).concat(Object(L.p)(h,15,1))}),Object(a.jsxs)("div",{className:A.deletedInformation,children:[Object(a.jsx)(yt.a,{className:A.folderIcon,fontSize:"large"}),Object(a.jsx)(sa.a,{style:{color:"#535353"},variant:"h6",align:"right",children:"The Message was Deleted"})]})]}),Object(a.jsx)(F.a,{primary:d,primaryTypographyProps:{color:"#000000"}}),Object(a.jsx)(F.a,{secondary:x,secondaryTypographyProps:{color:"#000000"}}),Object(a.jsxs)("div",{className:A.informationWrapper,children:[Object(a.jsx)("div",{className:A.time,style:{color:"#18bd03"},children:"".concat(c?"edited ":"").concat(Object(L.t)(g))}),n?Object(a.jsx)(St.a,{style:{color:"#18bd03",marginLeft:5},fontSize:"small"}):Object(a.jsx)(Nt.a,{style:{color:"#18bd03",marginLeft:5},fontSize:"small"})]}),t&&Object(a.jsx)("div",{className:A.avatarIcon,children:Object(a.jsx)(p.a,{alt:b,src:r?"".concat(L.l,"/").concat(r):void 0,sx:{background:l,width:40,height:40},children:!r&&"".concat(Object(L.e)(b)).concat(Object(L.e)(f))})}),t&&Object(a.jsx)("span",{className:A.tongueOne,style:{borderBottom:"15px solid ".concat(U?"#ced8d7":"#deffa9")}}),t&&Object(a.jsx)("span",{className:A.tongueTwo,style:{borderBottom:"17px solid ".concat(U?"#ced8d7":"#deffa9")}}),v&&Object(a.jsx)("div",{className:A.emojiCompanionTitle,children:L.b[Number(v)]}),O&&Object(a.jsx)("div",{className:A.emojiTitle,children:L.b[Number(O)]}),w&&Object(a.jsx)("div",{className:A.checkboxSelect,children:Object(a.jsx)(la.a,Object(j.a)(Object(j.a)({},Xa),{},{checked:K,sx:{color:I?"#ffffff":"#00ff48","&.Mui-checked":{color:I?"#ffffff":"#00ff48"}},onClick:function(){return k(N)}}))}),Object(a.jsxs)(Ja,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:W,open:q,onClose:J,children:[Object(a.jsx)(m.a,{onClick:function(e){var t=e.target.id;t===O?Object(ze.L)(N,""):Object(ze.L)(N,t)},style:{cursor:"none"},children:L.b.map((function(e,t){return Object(a.jsx)("div",{className:O===String(t)?A.emojiActive:A.emoji,id:String(t),children:e},e)}))}),Object(a.jsx)(Z.a,{}),Object(a.jsxs)(m.a,{onClick:function(){T(N),J(void 0)},children:[Object(a.jsx)(Qo.a,{}),"Reply"]}),Object(a.jsxs)(m.a,{onClick:function(){z(N),J(void 0)},children:[Object(a.jsx)(Qo.a,{style:{transform:"rotateY(180deg)"}}),"Forward"]}),Object(a.jsxs)(m.a,{onClick:function(){R(N),J(void 0)},children:[Object(a.jsx)(vn.a,{}),"Edit"]}),Object(a.jsx)(nn.CopyToClipboard,{onCopy:function(){return J("copy")},text:"".concat(d," ").concat(x),children:Object(a.jsxs)(m.a,{children:[Object(a.jsx)(ue.a,{}),"Copy Text"]})}),Object(a.jsxs)(m.a,{onClick:function(){Object(ze.o)(N,!C),J(void 0)},children:[C?Object(a.jsx)(y.a,{className:A.iconClose}):Object(a.jsx)(Tt.a,{}),C?"Unpin":"Pin"]}),Object(a.jsxs)(m.a,{onClick:function(){k(N),J(void 0)},children:[Object(a.jsx)(so.a,{}),"Select"]}),Object(a.jsxs)(m.a,{style:{color:"#f02a2a"},onClick:function(){return J("delete")},children:[Object(a.jsx)(yt.a,{style:{color:"#f02a2a"}}),"Delete"]})]}),V&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return G(!1);"delete"===t&&(Object(ze.r)(N),G(!1))},className:A.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:A.modalDelete,children:[Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(a.jsx)(zt.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(a.jsx)(zt.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})})},ec=Object(f.a)((function(e){return Object(a.jsx)(u.a,Object(j.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(0),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"4px 4px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(2)}}}}})),tc=Object(r.a)({container:{display:"flex",alignItems:"flex-end",alignContent:"flex-end",flexDirection:"column",borderRadius:7,position:"relative",padding:"4px 22px 4px 0px"},wrapper:{position:"relative",display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",maxWidth:450,minWidth:200,padding:5,borderRadius:7,wordBreak:"break-word",textAlign:"left",font:"400 .9em 'Open Sans', sans-serif"},wrapperInner:{display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column"},informationWrapper:{display:"flex",alignItems:"center",alignContent:"center",justifyContent:"flex-end",width:"100%",paddingRight:3},time:{fontSize:".65em",fontWeight:600},modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},emojiTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"0.2rem",left:-40},emojiCompanionTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"2.2rem",left:-40},emoji:{cursor:"pointer",fontSize:"1.7rem",transition:"all 0.3s","&:hover":{transform:"scale(1.5)"}},emojiActive:{cursor:"pointer",fontSize:"1.2rem",animation:"$emoji 0.6s ease-out",animationDirection:"forwards",animationIterationCount:1},"@keyframes emoji":{"5%":{transform:"translateY(1rem)"},"10%":{transform:"translateY(0) scale(1)",opacity:1},"50%":{transform:"translateY(-4rem) scale(1.5) rotateY(90deg)"},"80%":{opacity:0},"100%":{transform:"translateY(-8rem) scale(2) rotateY(180deg)",opacity:0}},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}},checkboxSelect:{position:"absolute",right:-64,top:-10,pointerEvents:"auto"},avatarIcon:{position:"absolute",right:-54,bottom:0},tongueOne:{content:"''",position:"absolute",width:"0",height:"0",borderRight:"15px solid transparent",borderLeft:"15px solid transparent",bottom:"0px",right:"-15px"},tongueTwo:{content:"''",position:"absolute",width:"0",height:"0",borderRight:"16px solid transparent",borderLeft:"16px solid transparent",bottom:"0px",right:"-17px"}}),nc={inputProps:{"aria-label":"Checkbox demo"}},oc=function(e){var t=e.message,n=e.tongue,c=e.watched,r=e.edited,i=e.avatarUrl,l=e.color,d=e.name,b=e.lastName,f=e.createdAt,u=e.caption,h=e.emoji,x=e.emojiCompanion,g=e.pinned,O=e.isSomeSelected,v=e.isSelected,C=e.handleSelected,w=e._id,S=e.nightMode,k=e.handleReply,N=e.handleForward,I=e.handleEdit,T=tc(),z=Object(s.useState)(null),R=Object(o.a)(z,2),M=R[0],A=R[1],D=Object(s.useState)(!1),E=Object(o.a)(D,2),W=E[0],B=E[1],P=Object(s.useState)(!1),Y=Object(o.a)(P,2),U=Y[0],_=Y[1],H=Boolean(M),$=v(w),V=function(e){"copy"===e&&Object(L.a)("Text"),"delete"===e&&_(!0),A(null),B(!1)};return Object(a.jsx)("div",{className:T.container,style:{marginBottom:n?12:0},children:Object(a.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),A(e.currentTarget),B(!0)}(e)},className:T.wrapper,style:{backgroundColor:W?"#ced8d7":"#deffa9",pointerEvents:O?"none":"auto"},children:[Object(a.jsx)(sa.a,{style:{color:"#26afee"},variant:"h6",align:"right",children:"".concat(Object(L.e)(d)).concat(Object(L.p)(d,15,1)," \n ").concat(Object(L.e)(b)).concat(Object(L.p)(b,15,1))}),Object(a.jsxs)("div",{className:T.wrapperInner,children:[Object(a.jsx)(F.a,{primary:t,primaryTypographyProps:{color:"#000000"}}),Object(a.jsx)(F.a,{secondary:u,secondaryTypographyProps:{color:"#000000"}})]}),Object(a.jsxs)("div",{className:T.informationWrapper,children:[Object(a.jsx)("div",{className:T.time,style:{color:"#18bd03"},children:"".concat(r?"edited ":"").concat(Object(L.t)(f))}),c?Object(a.jsx)(St.a,{style:{color:"#18bd03",marginLeft:5},fontSize:"small"}):Object(a.jsx)(Nt.a,{style:{color:"#18bd03",marginLeft:5},fontSize:"small"})]}),n&&Object(a.jsx)("div",{className:T.avatarIcon,children:Object(a.jsx)(p.a,{alt:d,src:i?"".concat(L.l,"/").concat(i):void 0,sx:{background:l,width:40,height:40},children:!i&&"".concat(Object(L.e)(d)).concat(Object(L.e)(b))})}),n&&Object(a.jsx)("span",{className:T.tongueOne,style:{borderBottom:"15px solid ".concat(W?"#ced8d7":"#deffa9")}}),n&&Object(a.jsx)("span",{className:T.tongueTwo,style:{borderBottom:"17px solid ".concat(W?"#ced8d7":"#deffa9")}}),x&&Object(a.jsx)("div",{className:T.emojiCompanionTitle,children:L.b[Number(x)]}),h&&Object(a.jsx)("div",{className:T.emojiTitle,children:L.b[Number(h)]}),O&&Object(a.jsx)("div",{className:T.checkboxSelect,children:Object(a.jsx)(la.a,Object(j.a)(Object(j.a)({},nc),{},{checked:$,sx:{color:S?"#ffffff":"#00ff48","&.Mui-checked":{color:S?"#ffffff":"#00ff48"}},onClick:function(){return C(w)}}))}),Object(a.jsxs)(ec,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:M,open:H,onClose:V,children:[Object(a.jsx)(m.a,{onClick:function(e){var t=e.target.id;t===h?Object(ze.L)(w,""):Object(ze.L)(w,t)},style:{cursor:"none"},children:L.b.map((function(e,t){return Object(a.jsx)("div",{className:h===String(t)?T.emojiActive:T.emoji,id:String(t),children:e},e)}))}),Object(a.jsx)(Z.a,{}),Object(a.jsxs)(m.a,{onClick:function(){k(w),V(void 0)},children:[Object(a.jsx)(Qo.a,{}),"Reply"]}),Object(a.jsxs)(m.a,{onClick:function(){N(w),V(void 0)},children:[Object(a.jsx)(Qo.a,{style:{transform:"rotateY(180deg)"}}),"Forward"]}),Object(a.jsxs)(m.a,{onClick:function(){I(w),V(void 0)},children:[Object(a.jsx)(vn.a,{}),"Edit"]}),Object(a.jsx)(nn.CopyToClipboard,{onCopy:function(){return V("copy")},text:"".concat(t||""," ").concat(u||""),children:Object(a.jsxs)(m.a,{children:[Object(a.jsx)(ue.a,{}),"Copy Text"]})}),Object(a.jsxs)(m.a,{onClick:function(){Object(ze.o)(w,!g),V(void 0)},children:[g?Object(a.jsx)(y.a,{className:T.iconClose}):Object(a.jsx)(Tt.a,{}),g?"Unpin":"Pin"]}),Object(a.jsxs)(m.a,{onClick:function(){C(w),V(void 0)},children:[Object(a.jsx)(so.a,{}),"Select"]}),Object(a.jsxs)(m.a,{style:{color:"#f02a2a"},onClick:function(){return V("delete")},children:[Object(a.jsx)(yt.a,{style:{color:"#f02a2a"}}),"Delete"]})]}),U&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return _(!1);"delete"===t&&(Object(ze.r)(w),_(!1))},className:T.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:T.modalDelete,children:[Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(a.jsx)(zt.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(a.jsx)(zt.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})})},ac=Object(f.a)((function(e){return Object(a.jsx)(u.a,Object(j.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(0),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"4px 4px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(2)}}}}})),cc=Object(r.a)({container:{display:"flex",alignItems:"flex-end",alignContent:"flex-end",flexDirection:"column",borderRadius:7,position:"relative",padding:"4px 22px 4px 0px"},wrapper:{position:"relative",display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",maxWidth:450,minWidth:200,padding:5,borderRadius:7,wordBreak:"break-word",textAlign:"left",font:"400 .9em 'Open Sans', sans-serif"},wrapperInner:{position:"relative",display:"flex",alignItems:"center",alignContent:"center",width:"100%",cursor:"pointer","&:hover":{backgroundColor:"rgba(104, 105, 104, 0.2)"}},wrapperInnerMessage:{display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",marginLeft:20},informationWrapper:{display:"flex",alignItems:"center",alignContent:"center",justifyContent:"flex-end",width:"100%",paddingRight:3},time:{fontSize:".65em",fontWeight:600},modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},emojiTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"0.2rem",left:-40},emojiCompanionTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"2.2rem",left:-40},emoji:{cursor:"pointer",fontSize:"1.7rem",transition:"all 0.3s","&:hover":{transform:"scale(1.5)"}},emojiActive:{cursor:"pointer",fontSize:"1.2rem",animation:"$emoji 0.6s ease-out",animationDirection:"forwards",animationIterationCount:1},"@keyframes emoji":{"5%":{transform:"translateY(1rem)"},"10%":{transform:"translateY(0) scale(1)",opacity:1},"50%":{transform:"translateY(-4rem) scale(1.5) rotateY(90deg)"},"80%":{opacity:0},"100%":{transform:"translateY(-8rem) scale(2) rotateY(180deg)",opacity:0}},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}},folderIcon:{color:"#00b333"},checkboxSelect:{position:"absolute",right:-64,top:-10,pointerEvents:"auto"},column:{position:"absolute",content:"",width:2,left:43,top:"10%",height:"80%",backgroundColor:"#00b333"},avatarIcon:{position:"absolute",right:-54,bottom:0},tongueOne:{content:"''",position:"absolute",width:"0",height:"0",borderRight:"15px solid transparent",borderLeft:"15px solid transparent",bottom:"0px",right:"-15px"},tongueTwo:{content:"''",position:"absolute",width:"0",height:"0",borderRight:"16px solid transparent",borderLeft:"16px solid transparent",bottom:"0px",right:"-17px"}}),rc={inputProps:{"aria-label":"Checkbox demo"}},ic=function(e){var t=e.url,n=e.tongue,c=e.watched,r=e.edited,i=e.avatarUrl,l=e.color,d=e.replyMessage,b=e.message,f=e.name,u=e.lastName,h=e.replyName,x=e.replyLastName,g=e.replyCaption,O=e.createdAt,v=e.caption,C=e.emoji,w=e.emojiCompanion,S=e.pinned,k=e.isSomeSelected,N=e.isSelected,I=e.handleSelected,T=e._id,z=e.nightMode,R=e.handleReply,M=e.handleForward,A=e.handleEdit,D=e.fullType,E=e.handleScrollToTheMessage,W=e.oldId,B=cc(),P=Object(s.useState)(null),Y=Object(o.a)(P,2),U=Y[0],_=Y[1],H=Object(s.useState)(!1),$=Object(o.a)(H,2),V=$[0],G=$[1],q=Object(s.useState)(!1),K=Object(o.a)(q,2),J=K[0],Q=K[1],ee=Boolean(U),te=N(T),ne=function(e){"copy"===e&&Object(L.a)("Text"),"delete"===e&&Q(!0),_(null),G(!1)};return Object(a.jsx)("div",{className:B.container,style:{marginBottom:n?12:0},children:Object(a.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),_(e.currentTarget),G(!0)}(e)},className:B.wrapper,style:{backgroundColor:V?"#ced8d7":"#deffa9",pointerEvents:k?"none":"auto"},children:[Object(a.jsx)(sa.a,{style:{color:"#26afee"},variant:"h6",align:"right",children:"".concat(Object(L.e)(f)).concat(Object(L.p)(f,15,1)," \n ").concat(Object(L.e)(u)).concat(Object(L.p)(u,15,1))}),Object(a.jsxs)("div",{className:B.wrapperInner,children:[null===D&&Object(a.jsx)(ue.a,{className:B.folderIcon,fontSize:"large"}),D&&D.includes("audio")&&Object(a.jsx)(ge.a,{className:B.folderIcon,fontSize:"large"}),D&&D.includes("video")&&Object(a.jsx)(Ce.a,{className:B.folderIcon,fontSize:"large"}),D&&D.includes("image")&&Object(a.jsx)(go.a,{className:B.folderIcon,fontSize:"large"}),D&&D.includes("application")&&Object(a.jsx)(X.a,{className:B.folderIcon,fontSize:"large"}),Object(a.jsx)("div",{className:B.column}),Object(a.jsxs)("div",{className:B.wrapperInnerMessage,onClick:function(){return E(W)},children:[Object(a.jsx)(sa.a,{style:{color:"#00b333"},variant:"h6",align:"right",children:"Replied to ".concat(Object(L.e)(h)).concat(Object(L.p)(h,15,1),"\n ").concat(Object(L.e)(x)).concat(Object(L.p)(x,15,1))}),Object(a.jsx)(F.a,{primary:null===D?d:D,primaryTypographyProps:{color:"#535353"}}),Object(a.jsx)(F.a,{secondary:g,secondaryTypographyProps:{color:"#535353"}})]})]}),Object(a.jsx)(F.a,{primary:b,primaryTypographyProps:{color:"#000000"}}),Object(a.jsx)(F.a,{secondary:v,secondaryTypographyProps:{color:"#000000"}}),Object(a.jsxs)("div",{className:B.informationWrapper,children:[Object(a.jsx)("div",{className:B.time,style:{color:"#18bd03"},children:"".concat(r?"edited ":"").concat(Object(L.t)(O))}),c?Object(a.jsx)(St.a,{style:{color:"#18bd03",marginLeft:5},fontSize:"small"}):Object(a.jsx)(Nt.a,{style:{color:"#18bd03",marginLeft:5},fontSize:"small"})]}),n&&Object(a.jsx)("div",{className:B.avatarIcon,children:Object(a.jsx)(p.a,{alt:f,src:i?"".concat(L.l,"/").concat(i):void 0,sx:{background:l,width:40,height:40},children:!i&&"".concat(Object(L.e)(f)).concat(Object(L.e)(u))})}),n&&Object(a.jsx)("span",{className:B.tongueOne,style:{borderBottom:"15px solid ".concat(V?"#ced8d7":"#deffa9")}}),n&&Object(a.jsx)("span",{className:B.tongueTwo,style:{borderBottom:"17px solid ".concat(V?"#ced8d7":"#deffa9")}}),w&&Object(a.jsx)("div",{className:B.emojiCompanionTitle,children:L.b[Number(w)]}),C&&Object(a.jsx)("div",{className:B.emojiTitle,children:L.b[Number(C)]}),k&&Object(a.jsx)("div",{className:B.checkboxSelect,children:Object(a.jsx)(la.a,Object(j.a)(Object(j.a)({},rc),{},{checked:te,sx:{color:z?"#ffffff":"#00ff48","&.Mui-checked":{color:z?"#ffffff":"#00ff48"}},onClick:function(){return I(T)}}))}),Object(a.jsxs)(ac,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:U,open:ee,onClose:ne,children:[Object(a.jsx)(m.a,{onClick:function(e){var t=e.target.id;t===C?Object(ze.L)(T,""):Object(ze.L)(T,t)},style:{cursor:"none"},children:L.b.map((function(e,t){return Object(a.jsx)("div",{className:C===String(t)?B.emojiActive:B.emoji,id:String(t),children:e},e)}))}),Object(a.jsx)(Z.a,{}),Object(a.jsxs)(m.a,{onClick:function(){R(T),ne(void 0)},children:[Object(a.jsx)(Qo.a,{}),"Reply"]}),Object(a.jsxs)(m.a,{onClick:function(){M(T),ne(void 0)},children:[Object(a.jsx)(Qo.a,{style:{transform:"rotateY(180deg)"}}),"Forward"]}),D&&Object(a.jsxs)(m.a,{onClick:function(){return Object(L.g)(t,D)},children:[Object(a.jsx)(va.a,{}),"Download"]}),Object(a.jsxs)(m.a,{onClick:function(){A(T),ne(void 0)},children:[Object(a.jsx)(vn.a,{}),"Edit"]}),Object(a.jsx)(nn.CopyToClipboard,{onCopy:function(){return ne("copy")},text:"".concat(d&&null===D?d:D," ").concat(g||""," ").concat(b||""," ").concat(v||""),children:Object(a.jsxs)(m.a,{children:[Object(a.jsx)(ue.a,{}),"Copy Text"]})}),Object(a.jsxs)(m.a,{onClick:function(){Object(ze.o)(T,!S),ne(void 0)},children:[S?Object(a.jsx)(y.a,{className:B.iconClose}):Object(a.jsx)(Tt.a,{}),S?"Unpin":"Pin"]}),Object(a.jsxs)(m.a,{onClick:function(){I(T),ne(void 0)},children:[Object(a.jsx)(so.a,{}),"Select"]}),Object(a.jsxs)(m.a,{style:{color:"#f02a2a"},onClick:function(){return ne("delete")},children:[Object(a.jsx)(yt.a,{style:{color:"#f02a2a"}}),"Delete"]})]}),J&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return Q(!1);"delete"===t&&(Object(ze.r)(T),Q(!1))},className:B.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:B.modalDelete,children:[Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(a.jsx)(zt.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(a.jsx)(zt.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})})},sc=Object(f.a)((function(e){return Object(a.jsx)(u.a,Object(j.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(0),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"4px 4px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(2)}}}}})),lc=Object(r.a)({container:{display:"flex",alignItems:"flex-end",alignContent:"flex-end",flexDirection:"column",borderRadius:7,position:"relative",padding:"4px 22px 4px 0px"},wrapper:{position:"relative",display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",maxWidth:450,minWidth:200,padding:5,borderRadius:7,wordBreak:"break-word",textAlign:"left",font:"400 .9em 'Open Sans', sans-serif"},wrapperInner:{position:"relative",display:"flex",alignItems:"center",alignContent:"center",width:"100%",cursor:"pointer","&:hover":{backgroundColor:"rgba(104, 105, 104, 0.2)"}},wrapperInnerMessage:{display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",marginLeft:20},informationWrapper:{display:"flex",alignItems:"center",alignContent:"center",justifyContent:"flex-end",width:"100%",paddingRight:3},time:{fontSize:".65em",fontWeight:600},modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},emojiTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"0.2rem",left:-40},emojiCompanionTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"2.2rem",left:-40},emoji:{cursor:"pointer",fontSize:"1.7rem",transition:"all 0.3s","&:hover":{transform:"scale(1.5)"}},emojiActive:{cursor:"pointer",fontSize:"1.2rem",animation:"$emoji 0.6s ease-out",animationDirection:"forwards",animationIterationCount:1},"@keyframes emoji":{"5%":{transform:"translateY(1rem)"},"10%":{transform:"translateY(0) scale(1)",opacity:1},"50%":{transform:"translateY(-4rem) scale(1.5) rotateY(90deg)"},"80%":{opacity:0},"100%":{transform:"translateY(-8rem) scale(2) rotateY(180deg)",opacity:0}},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}},checkboxSelect:{position:"absolute",right:-64,top:-10,pointerEvents:"auto"},folderIcon:{color:"#00b333"},column:{position:"absolute",content:"",width:2,left:43,top:"10%",height:"80%",backgroundColor:"#00b333"},avatarIcon:{position:"absolute",right:-54,bottom:0},tongueOne:{content:"''",position:"absolute",width:"0",height:"0",borderRight:"15px solid transparent",borderLeft:"15px solid transparent",bottom:"0px",right:"-15px"},tongueTwo:{content:"''",position:"absolute",width:"0",height:"0",borderRight:"16px solid transparent",borderLeft:"16px solid transparent",bottom:"0px",right:"-17px"}}),dc={inputProps:{"aria-label":"Checkbox demo"}},bc=function(e){var t=e.url,n=e.oldId,c=e.companionIdForwardToAndFrom,r=e.tongue,i=e.watched,l=e.edited,d=e.avatarUrl,b=e.color,f=e.message,u=e.name,h=e.lastName,x=e.forwardName,g=e.forwardLastName,O=e.forwardMessage,v=e.forwardCaption,C=e.caption,w=e.createdAt,S=e.emoji,k=e.emojiCompanion,N=e.pinned,I=e.isSomeSelected,T=e.isSelected,z=e.handleSelected,R=e._id,M=e.nightMode,A=e.handleReply,D=e.handleForward,E=e.handleEdit,W=e.handleScrollToTheChat,B=e.fullType,P=lc(),Y=Object(s.useState)(null),U=Object(o.a)(Y,2),_=U[0],H=U[1],$=Object(s.useState)(!1),V=Object(o.a)($,2),G=V[0],q=V[1],K=Object(s.useState)(!1),J=Object(o.a)(K,2),Q=J[0],ee=J[1],te=Boolean(_),ne=T(R),oe=function(e){"copy"===e&&Object(L.a)("Text"),"delete"===e&&ee(!0),H(null),q(!1)};return Object(a.jsx)("div",{className:P.container,style:{marginBottom:r?12:0},children:Object(a.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),H(e.currentTarget),q(!0)}(e)},className:P.wrapper,style:{backgroundColor:G?"#ced8d7":"#deffa9",pointerEvents:I?"none":"auto"},children:[Object(a.jsx)(sa.a,{style:{color:"#26afee"},variant:"h6",align:"right",children:"".concat(Object(L.e)(u)).concat(Object(L.p)(u,15,1)," \n ").concat(Object(L.e)(h)).concat(Object(L.p)(h,15,1))}),Object(a.jsxs)("div",{className:P.wrapperInner,children:[null===B&&Object(a.jsx)(ue.a,{className:P.folderIcon,fontSize:"large"}),B&&B.includes("audio")&&Object(a.jsx)(ge.a,{className:P.folderIcon,fontSize:"large"}),B&&B.includes("video")&&Object(a.jsx)(Ce.a,{className:P.folderIcon,fontSize:"large"}),B&&B.includes("image")&&Object(a.jsx)(go.a,{className:P.folderIcon,fontSize:"large"}),B&&B.includes("application")&&Object(a.jsx)(X.a,{className:P.folderIcon,fontSize:"large"}),Object(a.jsx)("div",{className:P.column}),Object(a.jsxs)("div",{className:P.wrapperInnerMessage,onClick:function(){return W(c,n)},children:[Object(a.jsx)(sa.a,{style:{color:"#00b333"},variant:"h6",align:"right",children:"Forwarded from ".concat(Object(L.e)(x)).concat(Object(L.p)(x,15,1),"\n ").concat(Object(L.e)(g)).concat(Object(L.p)(g,15,1))}),Object(a.jsx)(F.a,{primary:null===B?O:B,primaryTypographyProps:{color:"#535353"}}),Object(a.jsx)(F.a,{secondary:v,secondaryTypographyProps:{color:"#535353"}})]})]}),Object(a.jsx)(F.a,{primary:f,primaryTypographyProps:{color:"#000000"}}),Object(a.jsx)(F.a,{secondary:C,secondaryTypographyProps:{color:"#000000"}}),Object(a.jsxs)("div",{className:P.informationWrapper,children:[Object(a.jsx)("div",{className:P.time,style:{color:"#18bd03"},children:"".concat(l?"edited ":"").concat(Object(L.t)(w))}),i?Object(a.jsx)(St.a,{style:{color:"#18bd03",marginLeft:5},fontSize:"small"}):Object(a.jsx)(Nt.a,{style:{color:"#18bd03",marginLeft:5},fontSize:"small"})]}),r&&Object(a.jsx)("div",{className:P.avatarIcon,children:Object(a.jsx)(p.a,{alt:u,src:d?"".concat(L.l,"/").concat(d):void 0,sx:{background:b,width:40,height:40},children:!d&&"".concat(Object(L.e)(u)).concat(Object(L.e)(h))})}),r&&Object(a.jsx)("span",{className:P.tongueOne,style:{borderBottom:"15px solid ".concat(G?"#ced8d7":"#deffa9")}}),r&&Object(a.jsx)("span",{className:P.tongueTwo,style:{borderBottom:"17px solid ".concat(G?"#ced8d7":"#deffa9")}}),k&&Object(a.jsx)("div",{className:P.emojiCompanionTitle,children:L.b[Number(k)]}),S&&Object(a.jsx)("div",{className:P.emojiTitle,children:L.b[Number(S)]}),I&&Object(a.jsx)("div",{className:P.checkboxSelect,children:Object(a.jsx)(la.a,Object(j.a)(Object(j.a)({},dc),{},{checked:ne,sx:{color:M?"#ffffff":"#00ff48","&.Mui-checked":{color:M?"#ffffff":"#00ff48"}},onClick:function(){return z(R)}}))}),Object(a.jsxs)(sc,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:_,open:te,onClose:oe,children:[Object(a.jsx)(m.a,{onClick:function(e){var t=e.target.id;t===S?Object(ze.L)(R,""):Object(ze.L)(R,t)},style:{cursor:"none"},children:L.b.map((function(e,t){return Object(a.jsx)("div",{className:S===String(t)?P.emojiActive:P.emoji,id:String(t),children:e},e)}))}),Object(a.jsx)(Z.a,{}),Object(a.jsxs)(m.a,{onClick:function(){A(R),oe(void 0)},children:[Object(a.jsx)(Qo.a,{}),"Reply"]}),Object(a.jsxs)(m.a,{onClick:function(){D(R),oe(void 0)},children:[Object(a.jsx)(Qo.a,{style:{transform:"rotateY(180deg)"}}),"Forward"]}),B&&Object(a.jsxs)(m.a,{onClick:function(){return Object(L.g)(t,B)},children:[Object(a.jsx)(va.a,{}),"Download"]}),Object(a.jsxs)(m.a,{onClick:function(){E(R),oe(void 0)},children:[Object(a.jsx)(vn.a,{}),"Edit"]}),Object(a.jsx)(nn.CopyToClipboard,{onCopy:function(){return oe("copy")},text:"".concat(O&&null===B?O:B," ").concat(v||""," ").concat(f||""," ").concat(C||""),children:Object(a.jsxs)(m.a,{children:[Object(a.jsx)(ue.a,{}),"Copy Text"]})}),Object(a.jsxs)(m.a,{onClick:function(){Object(ze.o)(R,!N),oe(void 0)},children:[N?Object(a.jsx)(y.a,{className:P.iconClose}):Object(a.jsx)(Tt.a,{}),N?"Unpin":"Pin"]}),Object(a.jsxs)(m.a,{onClick:function(){z(R),oe(void 0)},children:[Object(a.jsx)(so.a,{}),"Select"]}),Object(a.jsxs)(m.a,{style:{color:"#f02a2a"},onClick:function(){return oe("delete")},children:[Object(a.jsx)(yt.a,{style:{color:"#f02a2a"}}),"Delete"]})]}),Q&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return ee(!1);"delete"===t&&(Object(ze.r)(R),ee(!1))},className:P.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:P.modalDelete,children:[Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(a.jsx)(zt.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(a.jsx)(zt.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})})},jc=Object(f.a)((function(e){return Object(a.jsx)(u.a,Object(j.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(0),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"4px 4px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(2)}}}}})),fc=Object(r.a)({container:{display:"flex",alignItems:"flex-end",alignContent:"flex-end",flexDirection:"column",borderRadius:7,position:"relative",padding:"4px 22px 4px 0px"},wrapper:{position:"relative",display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",width:400,borderRadius:7,padding:5},informationWrapper:{display:"flex",alignItems:"center",alignContent:"center",justifyContent:"flex-end",width:"100%",paddingRight:3},time:{fontSize:".65em",fontWeight:600},image:{borderRadius:7,width:"100%",maxHeight:"auto",cursor:"pointer"},overlay:{position:"fixed",top:0,left:0,width:"100vw",minHeight:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflow:"auto",boxSizing:"border-box",display:"flex",justifyContent:"center",alignContent:"center",alignItems:"center"},topBar:{position:"fixed",top:0,left:0,height:"7vh",width:"100vw",display:"flex",alignContent:"center",alignItems:"center",justifyContent:"space-between",backgroundColor:"rgba(65, 65, 65, 0.9)",zIndex:10,padding:"0px 20px"},wrapperCredentials:{display:"flex",alignContent:"center",alignItems:"center"},wrapperIcons:{display:"flex",alignContent:"center",alignItems:"center"},magnifying:{marginLeft:5,cursor:"pointer",color:"#e9e7e7",padding:0,"&:hover":{color:"#ffffff",transform:"scale(1.1)"}},downloadIcon:{marginLeft:5,cursor:"pointer",color:"#e9e7e7",padding:0,borderRadius:"50%","&:hover":{backgroundColor:"#ffffff",color:"#b8b7b7"}},iconCloseOverlay:{marginLeft:5,cursor:"pointer",color:"#e9e7e7",padding:0,"&:hover":{color:"#ffffff",transform:"rotate(180deg)",transition:"all 250ms ease-out "}},wrapperImage:{borderRadius:5,maxWidth:500,maxHeight:750,display:"flex",overflow:"auto"},innerImage:{objectFit:"cover"},modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlayDelete:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},emojiTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"0.2rem",left:-40},emojiCompanionTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"2.2rem",left:-40},emoji:{cursor:"pointer",fontSize:"1.7rem",transition:"all 0.3s","&:hover":{transform:"scale(1.5)"}},emojiActive:{cursor:"pointer",fontSize:"1.2rem",animation:"$emoji 0.6s ease-out",animationDirection:"forwards",animationIterationCount:1},"@keyframes emoji":{"5%":{transform:"translateY(1rem)"},"10%":{transform:"translateY(0) scale(1)",opacity:1},"50%":{transform:"translateY(-4rem) scale(1.5) rotateY(90deg)"},"80%":{opacity:0},"100%":{transform:"translateY(-8rem) scale(2) rotateY(180deg)",opacity:0}},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}},checkboxSelect:{position:"absolute",right:-64,top:-10,pointerEvents:"auto"},avatarIcon:{position:"absolute",right:-54,bottom:0},tongueOne:{content:"''",position:"absolute",width:"0",height:"0",borderRight:"15px solid transparent",borderLeft:"15px solid transparent",bottom:"0px",right:"-15px"},tongueTwo:{content:"''",position:"absolute",width:"0",height:"0",borderRight:"16px solid transparent",borderLeft:"16px solid transparent",bottom:"0px",right:"-17px"}}),pc={inputProps:{"aria-label":"Checkbox demo"}},uc=function(e){var t=e.url,n=e.tongue,c=e.watched,r=e.edited,i=e.avatarUrl,l=e.color,d=e.createdAt,b=e.fullType,f=e.caption,u=e.emoji,h=e.emojiCompanion,x=e.pinned,g=e.isSomeSelected,O=e.isSelected,v=e.handleSelected,C=e._id,w=e.name,S=e.lastName,k=e.nightMode,N=e.handleReply,I=e.handleForward,T=e.handleEdit,z=fc(),R=Object(s.useState)(!1),M=Object(o.a)(R,2),A=M[0],D=M[1],E=Object(s.useState)(null),W=Object(o.a)(E,2),B=W[0],P=W[1],U=Object(s.useState)(!1),_=Object(o.a)(U,2),H=_[0],$=_[1],V=Object(s.useState)(!1),G=Object(o.a)(V,2),q=G[0],K=G[1],J=Object(s.useState)(1),Q=Object(o.a)(J,2),X=Q[0],ee=Q[1],te=Object(s.useRef)(null),ne=Boolean(B),oe=O(C),ae=function(e){var t=e.target.id;"overlay"!==t&&"close"!==t||(D(!1),te.current.style.transform="scale(1)",ee(1))},re=function(e){"copy"===e&&Object(L.a)("Text"),"delete"===e&&K(!0),P(null),$(!1)};return A?Object(a.jsxs)("div",{onClick:ae,id:"overlay",className:z.overlay,children:[Object(a.jsxs)("div",{className:z.topBar,children:[Object(a.jsxs)("div",{className:z.wrapperCredentials,children:[Object(a.jsx)(Y.a,{children:Object(a.jsx)(p.a,{alt:w,src:t||void 0,sx:{background:l,width:44,height:44},children:!t&&"".concat(Object(L.e)(w)).concat(Object(L.e)(S))})}),Object(a.jsx)(F.a,{primary:"".concat(Object(L.e)(w)).concat(Object(L.p)(w,15,1),"\n ").concat(Object(L.e)(S)).concat(Object(L.p)(S,15,1)),primaryTypographyProps:{color:"#ffffff"},secondary:Object(L.r)(d),secondaryTypographyProps:{color:"#ffffff"}})]}),Object(a.jsxs)("div",{className:z.wrapperIcons,children:[Object(a.jsx)(ie.a,{onClick:function(){X>=.5&&(te.current.style.transform="scale(".concat(X-.25,",").concat(X-.25,")"),te.current.style.transformOrigin="".concat(50/X-.25,"px ").concat(50/X-.25,"px"),ee(X-.25))},className:z.magnifying,fontSize:"large"}),Object(a.jsx)(le.a,{onClick:function(){X<5&&(te.current.style.transform="scale(".concat(X+.25,",").concat(X+.25,")"),te.current.style.transformOrigin="".concat(50/X+.25,"px ").concat(50/X+.25,"px"),ee(X+.25))},className:z.magnifying,fontSize:"large"}),Object(a.jsx)(ce.a,{onClick:function(){return Object(L.g)(t,b)},className:z.downloadIcon,fontSize:"large"}),Object(a.jsx)(y.a,{id:"close",onClick:ae,className:z.iconCloseOverlay,fontSize:"large"})]})]}),Object(a.jsx)("div",{ref:te,className:z.wrapperImage,children:Object(a.jsx)("img",{className:z.innerImage,width:"100%",height:"auto",alt:"imageItem",src:t})})]}):Object(a.jsx)("div",{className:z.container,style:{marginBottom:n?12:0},children:Object(a.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),P(e.currentTarget),$(!0)}(e)},className:z.wrapper,style:{backgroundColor:H?"#ced8d7":"#deffa9",pointerEvents:g?"none":"auto"},children:[Object(a.jsx)(sa.a,{style:{color:"#26afee",marginBottom:10},variant:"h6",align:"right",children:"".concat(Object(L.e)(w)).concat(Object(L.p)(w,15,1)," \n ").concat(Object(L.e)(S)).concat(Object(L.p)(S,15,1))}),Object(a.jsx)("img",{onClick:function(){return!A&&D(!0)},className:z.image,alt:"message pic",src:t,style:{backgroundColor:t?"":l},width:"300",height:"400"}),Object(a.jsx)(F.a,{style:{wordBreak:"break-word"},secondary:f,secondaryTypographyProps:{color:"#000000"}}),Object(a.jsxs)("div",{className:z.informationWrapper,children:[Object(a.jsx)("div",{className:z.time,style:{color:"#18bd03"},children:"".concat(r?"edited ":"").concat(Object(L.t)(d))}),c?Object(a.jsx)(St.a,{style:{color:"#18bd03",marginLeft:5},fontSize:"small"}):Object(a.jsx)(Nt.a,{style:{color:"#18bd03",marginLeft:5},fontSize:"small"})]}),n&&Object(a.jsx)("div",{className:z.avatarIcon,children:Object(a.jsx)(p.a,{alt:w,src:i?"".concat(L.l,"/").concat(i):void 0,sx:{background:l,width:40,height:40},children:!i&&"".concat(Object(L.e)(w)).concat(Object(L.e)(S))})}),n&&Object(a.jsx)("span",{className:z.tongueOne,style:{borderBottom:"15px solid ".concat(H?"#ced8d7":"#deffa9")}}),n&&Object(a.jsx)("span",{className:z.tongueTwo,style:{borderBottom:"17px solid ".concat(H?"#ced8d7":"#deffa9")}}),h&&Object(a.jsx)("div",{className:z.emojiCompanionTitle,children:L.b[Number(h)]}),u&&Object(a.jsx)("div",{className:z.emojiTitle,children:L.b[Number(u)]}),g&&Object(a.jsx)("div",{className:z.checkboxSelect,children:Object(a.jsx)(la.a,Object(j.a)(Object(j.a)({},pc),{},{checked:oe,sx:{color:k?"#ffffff":"#00ff48","&.Mui-checked":{color:k?"#ffffff":"#00ff48"}},onClick:function(){return v(C)}}))}),Object(a.jsxs)(jc,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:B,open:ne,onClose:re,children:[Object(a.jsx)(m.a,{onClick:function(e){var t=e.target.id;t===u?Object(ze.L)(C,""):Object(ze.L)(C,t)},style:{cursor:"none"},children:L.b.map((function(e,t){return Object(a.jsx)("div",{className:u===String(t)?z.emojiActive:z.emoji,id:String(t),children:e},e)}))}),Object(a.jsx)(Z.a,{}),Object(a.jsxs)(m.a,{onClick:function(){N(C),re(void 0)},children:[Object(a.jsx)(Qo.a,{}),"Reply"]}),Object(a.jsxs)(m.a,{onClick:function(){I(C),re(void 0)},children:[Object(a.jsx)(Qo.a,{style:{transform:"rotateY(180deg)"}}),"Forward"]}),Object(a.jsxs)(m.a,{onClick:function(){T(C),re(void 0)},children:[Object(a.jsx)(vn.a,{}),"Edit"]}),Object(a.jsxs)(m.a,{onClick:function(){return Object(L.g)(t,b)},children:[Object(a.jsx)(va.a,{}),"Download"]}),f&&Object(a.jsx)(nn.CopyToClipboard,{onCopy:function(){return re("copy")},text:f,children:Object(a.jsxs)(m.a,{children:[Object(a.jsx)(ue.a,{}),"Copy Text"]})}),Object(a.jsxs)(m.a,{onClick:function(){Object(ze.o)(C,!x),re(void 0)},children:[x?Object(a.jsx)(y.a,{className:z.iconClose}):Object(a.jsx)(Tt.a,{}),x?"Unpin":"Pin"]}),Object(a.jsxs)(m.a,{onClick:function(){v(C),re(void 0)},children:[Object(a.jsx)(so.a,{}),"Select"]}),Object(a.jsxs)(m.a,{style:{color:"#f02a2a"},onClick:function(){return re("delete")},children:[Object(a.jsx)(yt.a,{style:{color:"#f02a2a"}}),"Delete"]})]}),q&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return K(!1);"delete"===t&&(Object(ze.r)(C),K(!1))},className:z.overlayDelete,id:"overlay",children:Object(a.jsxs)("div",{className:z.modalDelete,children:[Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(a.jsx)(zt.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(a.jsx)(zt.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})})},mc=Object(f.a)((function(e){return Object(a.jsx)(u.a,Object(j.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(0),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"4px 4px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(2)}}}}})),hc=Object(r.a)({container:{display:"flex",alignItems:"flex-end",alignContent:"flex-end",flexDirection:"column",borderRadius:7,position:"relative",padding:"4px 22px 4px 0px"},wrapper:{position:"relative",display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",padding:5,width:350,borderRadius:7},informationWrapper:{display:"flex",alignItems:"center",alignContent:"center",justifyContent:"flex-end",width:"100%",paddingRight:3},time:{fontSize:".65em",fontWeight:600},player:{borderRadius:7,width:"100%"},modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},emojiTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"0.2rem",left:-40},emojiCompanionTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"2.2rem",left:-40},emoji:{cursor:"pointer",fontSize:"1.7rem",transition:"all 0.3s","&:hover":{transform:"scale(1.5)"}},emojiActive:{cursor:"pointer",fontSize:"1.2rem",animation:"$emoji 0.6s ease-out",animationDirection:"forwards",animationIterationCount:1},"@keyframes emoji":{"5%":{transform:"translateY(1rem)"},"10%":{transform:"translateY(0) scale(1)",opacity:1},"50%":{transform:"translateY(-4rem) scale(1.5) rotateY(90deg)"},"80%":{opacity:0},"100%":{transform:"translateY(-8rem) scale(2) rotateY(180deg)",opacity:0}},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}},checkboxSelect:{position:"absolute",right:-64,top:-10,pointerEvents:"auto"},avatarIcon:{position:"absolute",right:-54,bottom:0},tongueOne:{content:"''",position:"absolute",width:"0",height:"0",borderRight:"15px solid transparent",borderLeft:"15px solid transparent",bottom:"0px",right:"-15px"},tongueTwo:{content:"''",position:"absolute",width:"0",height:"0",borderRight:"16px solid transparent",borderLeft:"16px solid transparent",bottom:"0px",right:"-17px"}}),xc={inputProps:{"aria-label":"Checkbox demo"}},gc=function(e){var t=e.url,n=e.tongue,c=e.watched,r=e.edited,i=e.avatarUrl,l=e.color,d=e.name,b=e.lastName,f=e.createdAt,u=e.fullType,h=e.caption,x=e._id,g=e.emoji,O=e.emojiCompanion,v=e.pinned,C=e.isSomeSelected,w=e.isSelected,S=e.handleSelected,k=e.nightMode,N=e.handleReply,I=e.handleForward,T=e.handleEdit,z=hc(),R=Object(s.useState)(null),M=Object(o.a)(R,2),A=M[0],D=M[1],E=Object(s.useState)(!1),W=Object(o.a)(E,2),B=W[0],P=W[1],Y=Object(s.useState)(!1),U=Object(o.a)(Y,2),_=U[0],H=U[1],$=Boolean(A),V=w(x),G=function(e){"copy"===e&&Object(L.a)("Text"),"delete"===e&&H(!0),D(null),P(!1)};return Object(a.jsx)("div",{className:z.container,style:{marginBottom:n?12:0},children:Object(a.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),D(e.currentTarget),P(!0)}(e)},className:z.wrapper,style:{backgroundColor:B?"#ced8d7":"#deffa9",pointerEvents:C?"none":"auto"},children:[Object(a.jsx)(sa.a,{style:{color:"#26afee",marginBottom:10},variant:"h6",align:"right",children:"".concat(Object(L.e)(d)).concat(Object(L.p)(d,15,1)," \n ").concat(Object(L.e)(b)).concat(Object(L.p)(b,15,1))}),Object(a.jsx)(Ea.a,{className:z.player,src:t,controls:!0}),Object(a.jsx)(F.a,{style:{wordBreak:"break-word"},secondary:h,secondaryTypographyProps:{color:"#000000"}}),Object(a.jsxs)("div",{className:z.informationWrapper,children:[Object(a.jsx)("div",{className:z.time,style:{color:"#18bd03"},children:"".concat(r?"edited ":"").concat(Object(L.t)(f))}),c?Object(a.jsx)(St.a,{style:{color:"#18bd03",marginLeft:5},fontSize:"small"}):Object(a.jsx)(Nt.a,{style:{color:"#18bd03",marginLeft:5},fontSize:"small"})]}),n&&Object(a.jsx)("div",{className:z.avatarIcon,children:Object(a.jsx)(p.a,{alt:d,src:i?"".concat(L.l,"/").concat(i):void 0,sx:{background:l,width:40,height:40},children:!i&&"".concat(Object(L.e)(d)).concat(Object(L.e)(b))})}),n&&Object(a.jsx)("span",{className:z.tongueOne,style:{borderBottom:"15px solid ".concat(B?"#ced8d7":"#deffa9")}}),n&&Object(a.jsx)("span",{className:z.tongueTwo,style:{borderBottom:"17px solid ".concat(B?"#ced8d7":"#deffa9")}}),O&&Object(a.jsx)("div",{className:z.emojiCompanionTitle,children:L.b[Number(O)]}),g&&Object(a.jsx)("div",{className:z.emojiTitle,children:L.b[Number(g)]}),C&&Object(a.jsx)("div",{className:z.checkboxSelect,children:Object(a.jsx)(la.a,Object(j.a)(Object(j.a)({},xc),{},{checked:V,sx:{color:k?"#ffffff":"#00ff48","&.Mui-checked":{color:k?"#ffffff":"#00ff48"}},onClick:function(){return S(x)}}))}),Object(a.jsxs)(mc,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:A,open:$,onClose:G,children:[Object(a.jsx)(m.a,{onClick:function(e){var t=e.target.id;t===g?Object(ze.L)(x,""):Object(ze.L)(x,t)},style:{cursor:"none"},children:L.b.map((function(e,t){return Object(a.jsx)("div",{className:g===String(t)?z.emojiActive:z.emoji,id:String(t),children:e},e)}))}),Object(a.jsx)(Z.a,{}),Object(a.jsxs)(m.a,{onClick:function(){N(x),G(void 0)},children:[Object(a.jsx)(Qo.a,{}),"Reply"]}),Object(a.jsxs)(m.a,{onClick:function(){I(x),G(void 0)},children:[Object(a.jsx)(Qo.a,{style:{transform:"rotateY(180deg)"}}),"Forward"]}),Object(a.jsxs)(m.a,{onClick:function(){T(x),G(void 0)},children:[Object(a.jsx)(vn.a,{}),"Edit"]}),Object(a.jsxs)(m.a,{onClick:function(){return Object(L.g)(t,u)},children:[Object(a.jsx)(va.a,{}),"Download"]}),h&&Object(a.jsx)(nn.CopyToClipboard,{onCopy:function(){return G("copy")},text:h,children:Object(a.jsxs)(m.a,{children:[Object(a.jsx)(ue.a,{}),"Copy Text"]})}),Object(a.jsxs)(m.a,{onClick:function(){Object(ze.o)(x,!v),G(void 0)},children:[v?Object(a.jsx)(y.a,{className:z.iconClose}):Object(a.jsx)(Tt.a,{}),v?"Unpin":"Pin"]}),Object(a.jsxs)(m.a,{onClick:function(){S(x),G(void 0)},children:[Object(a.jsx)(so.a,{}),"Select"]}),Object(a.jsxs)(m.a,{style:{color:"#f02a2a"},onClick:function(){return G("delete")},children:[Object(a.jsx)(yt.a,{style:{color:"#f02a2a"}}),"Delete"]})]}),_&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return H(!1);"delete"===t&&(Object(ze.r)(x),H(!1))},className:z.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:z.modalDelete,children:[Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(a.jsx)(zt.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(a.jsx)(zt.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})})},Oc=n(338).Player,vc=Object(f.a)((function(e){return Object(a.jsx)(u.a,Object(j.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(0),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"4px 4px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(2)}}}}})),yc=Object(r.a)({container:{display:"flex",alignItems:"flex-end",alignContent:"flex-end",flexDirection:"column",borderRadius:7,position:"relative",padding:"4px 22px 4px 0px"},wrapper:{position:"relative",display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",width:400,padding:5,borderRadius:7},informationWrapper:{display:"flex",alignItems:"center",alignContent:"center",justifyContent:"flex-end",width:"100%",paddingRight:3},time:{fontSize:".65em",fontWeight:600},player:{backgroundColor:"#deffa9",width:"100%"},playerActive:{backgroundColor:"#ced8d7",width:"100%"},modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},emojiTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"0.2rem",left:-40},emojiCompanionTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"2.2rem",left:-40},emoji:{cursor:"pointer",fontSize:"1.7rem",transition:"all 0.3s","&:hover":{transform:"scale(1.5)"}},emojiActive:{cursor:"pointer",fontSize:"1.2rem",animation:"$emoji 0.6s ease-out",animationDirection:"forwards",animationIterationCount:1},"@keyframes emoji":{"5%":{transform:"translateY(1rem)"},"10%":{transform:"translateY(0) scale(1)",opacity:1},"50%":{transform:"translateY(-4rem) scale(1.5) rotateY(90deg)"},"80%":{opacity:0},"100%":{transform:"translateY(-8rem) scale(2) rotateY(180deg)",opacity:0}},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}},checkboxSelect:{position:"absolute",right:-64,top:-10,pointerEvents:"auto"},avatarIcon:{position:"absolute",right:-54,bottom:0},tongueOne:{content:"''",position:"absolute",width:"0",height:"0",borderRight:"15px solid transparent",borderLeft:"15px solid transparent",bottom:"0px",right:"-15px"},tongueTwo:{content:"''",position:"absolute",width:"0",height:"0",borderRight:"16px solid transparent",borderLeft:"16px solid transparent",bottom:"0px",right:"-17px"}}),Cc={inputProps:{"aria-label":"Checkbox demo"}},wc=function(e){var t=e.url,n=e.tongue,c=e.watched,r=e.edited,i=e.avatarUrl,l=e.color,d=e.name,b=e.lastName,f=e.createdAt,u=e.fullType,h=e.caption,x=e.emoji,g=e.emojiCompanion,O=e.pinned,v=e.isSomeSelected,C=e.isSelected,w=e.handleSelected,S=e._id,k=e.nightMode,N=e.handleReply,I=e.handleForward,T=e.handleEdit,z=yc(),R=Object(s.useState)(null),M=Object(o.a)(R,2),A=M[0],D=M[1],E=Object(s.useState)(!1),W=Object(o.a)(E,2),B=W[0],P=W[1],Y=Object(s.useState)(!1),U=Object(o.a)(Y,2),_=U[0],H=U[1],$=Boolean(A),V=C(S),G=function(e){"copy"===e&&Object(L.a)("Text"),"delete"===e&&H(!0),D(null),P(!1)};return Object(a.jsx)("div",{className:z.container,style:{marginBottom:n?12:0},children:Object(a.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),D(e.currentTarget),P(!0)}(e)},className:z.wrapper,style:{backgroundColor:B?"#ced8d7":"#deffa9",pointerEvents:v?"none":"auto"},children:[Object(a.jsx)(sa.a,{style:{color:"#26afee",marginBottom:10},variant:"h6",align:"right",children:"".concat(Object(L.e)(d)).concat(Object(L.p)(d,15,1)," \n ").concat(Object(L.e)(b)).concat(Object(L.p)(b,15,1))}),Object(a.jsx)(Oc,{className:B?z.playerActive:z.player,playsInline:!0,src:t}),Object(a.jsx)(F.a,{style:{wordBreak:"break-word"},secondary:h,secondaryTypographyProps:{color:"#000000"}}),Object(a.jsxs)("div",{className:z.informationWrapper,children:[Object(a.jsx)("div",{className:z.time,style:{color:"#18bd03"},children:"".concat(r?"edited ":"").concat(Object(L.t)(f))}),c?Object(a.jsx)(St.a,{style:{color:"#18bd03",marginLeft:5},fontSize:"small"}):Object(a.jsx)(Nt.a,{style:{color:"#18bd03",marginLeft:5},fontSize:"small"})]}),n&&Object(a.jsx)("div",{className:z.avatarIcon,children:Object(a.jsx)(p.a,{alt:d,src:i?"".concat(L.l,"/").concat(i):void 0,sx:{background:l,width:40,height:40},children:!i&&"".concat(Object(L.e)(d)).concat(Object(L.e)(b))})}),n&&Object(a.jsx)("span",{className:z.tongueOne,style:{borderBottom:"15px solid ".concat(B?"#ced8d7":"#deffa9")}}),n&&Object(a.jsx)("span",{className:z.tongueTwo,style:{borderBottom:"17px solid ".concat(B?"#ced8d7":"#deffa9")}}),g&&Object(a.jsx)("div",{className:z.emojiCompanionTitle,children:L.b[Number(g)]}),x&&Object(a.jsx)("div",{className:z.emojiTitle,children:L.b[Number(x)]}),v&&Object(a.jsx)("div",{className:z.checkboxSelect,children:Object(a.jsx)(la.a,Object(j.a)(Object(j.a)({},Cc),{},{checked:V,sx:{color:k?"#ffffff":"#00ff48","&.Mui-checked":{color:k?"#ffffff":"#00ff48"}},onClick:function(){return w(S)}}))}),Object(a.jsxs)(vc,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:A,open:$,onClose:G,children:[Object(a.jsx)(m.a,{onClick:function(e){var t=e.target.id;t===x?Object(ze.L)(S,""):Object(ze.L)(S,t)},style:{cursor:"none"},children:L.b.map((function(e,t){return Object(a.jsx)("div",{className:x===String(t)?z.emojiActive:z.emoji,id:String(t),children:e},e)}))}),Object(a.jsx)(Z.a,{}),Object(a.jsxs)(m.a,{onClick:function(){N(S),G(void 0)},children:[Object(a.jsx)(Qo.a,{}),"Reply"]}),Object(a.jsxs)(m.a,{onClick:function(){I(S),G(void 0)},children:[Object(a.jsx)(Qo.a,{style:{transform:"rotateY(180deg)"}}),"Forward"]}),Object(a.jsxs)(m.a,{onClick:function(){T(S),G(void 0)},children:[Object(a.jsx)(vn.a,{}),"Edit"]}),Object(a.jsxs)(m.a,{onClick:function(){return Object(L.g)(t,u)},children:[Object(a.jsx)(va.a,{}),"Download"]}),h&&Object(a.jsx)(nn.CopyToClipboard,{onCopy:function(){return G("copy")},text:h,children:Object(a.jsxs)(m.a,{children:[Object(a.jsx)(ue.a,{}),"Copy Text"]})}),Object(a.jsxs)(m.a,{onClick:function(){Object(ze.o)(S,!O),G(void 0)},children:[O?Object(a.jsx)(y.a,{className:z.iconClose}):Object(a.jsx)(Tt.a,{}),O?"Unpin":"Pin"]}),Object(a.jsxs)(m.a,{onClick:function(){w(S),G(void 0)},children:[Object(a.jsx)(so.a,{}),"Select"]}),Object(a.jsxs)(m.a,{style:{color:"#f02a2a"},onClick:function(){return G("delete")},children:[Object(a.jsx)(yt.a,{style:{color:"#f02a2a"}}),"Delete"]})]}),_&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return H(!1);"delete"===t&&(Object(ze.r)(S),H(!1))},className:z.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:z.modalDelete,children:[Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(a.jsx)(zt.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(a.jsx)(zt.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})})},Sc=n(367),kc=Object(f.a)((function(e){return Object(a.jsx)(u.a,Object(j.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(0),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"4px 4px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(2)}}}}})),Nc=Object(r.a)({container:{display:"flex",alignItems:"flex-end",alignContent:"flex-end",flexDirection:"column",borderRadius:7,padding:"4px 22px 4px 0px"},wrapper:{position:"relative",display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",maxWidth:450,minWidth:300,padding:5,borderRadius:7},informationWrapper:{display:"flex",alignItems:"center",alignContent:"center",justifyContent:"flex-end",width:"100%",paddingRight:3},time:{fontSize:".65em",fontWeight:600},overlay:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(104, 105, 104, 0.6)",border:"solid 2px #0084ff",cursor:"auto",zIndex:100,overflow:"auto"},wrapperIcons:{position:"absolute",top:14,right:30,display:"flex",alignContent:"center",alignItems:"center",padding:"2px 10px",borderRadius:10,backgroundColor:"rgba(65, 65, 65, 0.9)",zIndex:150},magnifying:{cursor:"pointer",color:"#e9e7e7",padding:0,marginRight:10,"&:hover":{color:"#ffffff",transform:"scale(1.1)"}},iconCloseOverlay:{marginLeft:5,cursor:"pointer",color:"#e9e7e7",padding:0,"&:hover":{color:"#ffffff",transform:"rotate(180deg)",transition:"all 250ms ease-out "}},modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlayDelete:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},emojiTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"0.2rem",left:-40},emojiCompanionTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"2.2rem",left:-40},emoji:{cursor:"pointer",fontSize:"1.7rem",transition:"all 0.3s","&:hover":{transform:"scale(1.5)"}},emojiActive:{cursor:"pointer",fontSize:"1.2rem",animation:"$emoji 0.6s ease-out",animationDirection:"forwards",animationIterationCount:1},"@keyframes emoji":{"5%":{transform:"translateY(1rem)"},"10%":{transform:"translateY(0) scale(1)",opacity:1},"50%":{transform:"translateY(-4rem) scale(1.5) rotateY(90deg)"},"80%":{opacity:0},"100%":{transform:"translateY(-8rem) scale(2) rotateY(180deg)",opacity:0}},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}},checkboxSelect:{position:"absolute",right:-64,top:-10,pointerEvents:"auto"},avatarIcon:{position:"absolute",right:-54,bottom:0},tongueOne:{content:"''",position:"absolute",width:"0",height:"0",borderRight:"15px solid transparent",borderLeft:"15px solid transparent",bottom:"0px",right:"-15px"},tongueTwo:{content:"''",position:"absolute",width:"0",height:"0",borderRight:"16px solid transparent",borderLeft:"16px solid transparent",bottom:"0px",right:"-17px"}}),Ic={inputProps:{"aria-label":"Checkbox demo"}},Tc=function(e){var t=e.url,n=e.tongue,c=e.watched,r=e.edited,i=e.avatarUrl,l=e.color,d=e.name,b=e.lastName,f=e.createdAt,u=e.type,h=e.caption,x=e.emoji,g=e.emojiCompanion,O=e.pinned,v=e.isSomeSelected,C=e.isSelected,w=e.handleSelected,S=e._id,k=e.nightMode,N=e.handleReply,I=e.handleForward,T=e.handleEdit,z=Nc(),R=Object(s.useState)(!1),M=Object(o.a)(R,2),A=M[0],D=M[1],E=Object(s.useState)(null),W=Object(o.a)(E,2),B=W[0],P=W[1],Y=Object(s.useState)(!1),U=Object(o.a)(Y,2),_=U[0],H=U[1],$=Object(s.useState)(1),V=Object(o.a)($,2),G=V[0],q=V[1],K=Object(s.useState)(!1),J=Object(o.a)(K,2),Q=J[0],X=J[1],ee=Boolean(B),te=C(S),ne=Object(s.useRef)(null),oe=function(e){var t=e.target.id;"overlay"!==t&&"close"!==t||(D(!1),q(1))},ae=function(e){"copy"===e&&Object(L.a)("Text"),"delete"===e&&X(!0),P(null),H(!1)};return Object(a.jsxs)("div",{className:z.container,style:{marginBottom:n?12:0},children:[A&&Object(a.jsxs)("div",{className:z.wrapperIcons,children:[Object(a.jsx)(ie.a,{onClick:function(){G>=.5&&(ne.current.style.transform="scale(".concat(G-.25,",").concat(G-.25,")"),ne.current.style.transformOrigin="".concat(50/G-.25,"px ").concat(50/G-.25,"px"),q(G-.25))},className:z.magnifying,fontSize:"large"}),Object(a.jsx)(le.a,{onClick:function(){G<5&&(ne.current.style.transform="scale(".concat(G+.25,",").concat(G+.25,")"),ne.current.style.transformOrigin="".concat(50/G+.25,"px ").concat(50/G+.25,"px"),q(G+.25))},className:z.magnifying,fontSize:"large"}),Object(a.jsx)(y.a,{id:"close",onClick:oe,className:z.iconCloseOverlay,fontSize:"large"})]}),A&&Object(a.jsx)("div",{className:z.overlay,id:"overlay",onClick:oe,children:Object(a.jsx)("div",{ref:ne,children:Object(a.jsx)(Sc,{allowFullScreen:!0,fileType:u,filePath:t,onError:oe})})}),Object(a.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),P(e.currentTarget),H(!0)}(e)},className:z.wrapper,style:{backgroundColor:_?"#ced8d7":"#deffa9",pointerEvents:v?"none":"auto"},children:[Object(a.jsx)(sa.a,{style:{color:"#26afee",marginBottom:10},variant:"h6",align:"right",children:"".concat(Object(L.e)(d)).concat(Object(L.p)(d,15,1)," \n ").concat(Object(L.e)(b)).concat(Object(L.p)(b,15,1))}),!A&&Object(a.jsx)(zt.a,{fullWidth:!0,onClick:function(){return!A&&D(!0)},variant:"contained",color:"warning",style:{fontWeight:500,fontSize:18},children:"Read File"}),Object(a.jsx)(F.a,{style:{wordBreak:"break-word"},secondary:h,secondaryTypographyProps:{color:"#000000"}}),Object(a.jsxs)("div",{className:z.informationWrapper,children:[Object(a.jsx)("div",{className:z.time,style:{color:"#18bd03"},children:"".concat(r?"edited ":"").concat(Object(L.t)(f))}),c?Object(a.jsx)(St.a,{style:{color:"#18bd03",marginLeft:5},fontSize:"small"}):Object(a.jsx)(Nt.a,{style:{color:"#18bd03",marginLeft:5},fontSize:"small"})]}),n&&Object(a.jsx)("div",{className:z.avatarIcon,children:Object(a.jsx)(p.a,{alt:d,src:i?"".concat(L.l,"/").concat(i):void 0,sx:{background:l,width:40,height:40},children:!i&&"".concat(Object(L.e)(d)).concat(Object(L.e)(b))})}),n&&Object(a.jsx)("span",{className:z.tongueOne,style:{borderBottom:"15px solid ".concat(_?"#ced8d7":"#deffa9")}}),n&&Object(a.jsx)("span",{className:z.tongueTwo,style:{borderBottom:"17px solid ".concat(_?"#ced8d7":"#deffa9")}}),g&&Object(a.jsx)("div",{className:z.emojiCompanionTitle,children:L.b[Number(g)]}),x&&Object(a.jsx)("div",{className:z.emojiTitle,children:L.b[Number(x)]}),v&&Object(a.jsx)("div",{className:z.checkboxSelect,children:Object(a.jsx)(la.a,Object(j.a)(Object(j.a)({},Ic),{},{checked:te,sx:{color:k?"#ffffff":"#00ff48","&.Mui-checked":{color:k?"#ffffff":"#00ff48"}},onClick:function(){return w(S)}}))}),Object(a.jsxs)(kc,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:B,open:ee,onClose:ae,children:[Object(a.jsx)(m.a,{onClick:function(e){var t=e.target.id;t===x?Object(ze.L)(S,""):Object(ze.L)(S,t)},style:{cursor:"none"},children:L.b.map((function(e,t){return Object(a.jsx)("div",{className:x===String(t)?z.emojiActive:z.emoji,id:String(t),children:e},e)}))}),Object(a.jsx)(Z.a,{}),Object(a.jsxs)(m.a,{onClick:function(){N(S),ae(void 0)},children:[Object(a.jsx)(Qo.a,{}),"Reply"]}),Object(a.jsxs)(m.a,{onClick:function(){I(S),ae(void 0)},children:[Object(a.jsx)(Qo.a,{style:{transform:"rotateY(180deg)"}}),"Forward"]}),Object(a.jsxs)(m.a,{onClick:function(){T(S),ae(void 0)},children:[Object(a.jsx)(vn.a,{}),"Edit"]}),Object(a.jsxs)(m.a,{onClick:function(e){e.stopPropagation(),Object(L.g)(t,u)},children:[Object(a.jsx)(va.a,{}),"Download"]}),h&&Object(a.jsx)(nn.CopyToClipboard,{onCopy:function(){return ae("copy")},text:h,children:Object(a.jsxs)(m.a,{children:[Object(a.jsx)(ue.a,{}),"Copy Text"]})}),Object(a.jsxs)(m.a,{onClick:function(){Object(ze.o)(S,!O),ae(void 0)},children:[O?Object(a.jsx)(y.a,{className:z.iconClose}):Object(a.jsx)(Tt.a,{}),O?"Unpin":"Pin"]}),Object(a.jsxs)(m.a,{onClick:function(){w(S),ae(void 0)},children:[Object(a.jsx)(so.a,{}),"Select"]}),Object(a.jsxs)(m.a,{style:{color:"#f02a2a"},onClick:function(){return ae("delete")},children:[Object(a.jsx)(yt.a,{style:{color:"#f02a2a"}}),"Delete"]})]}),Q&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return X(!1);"delete"===t&&(Object(ze.r)(S),X(!1))},className:z.overlayDelete,id:"overlay",children:Object(a.jsxs)("div",{className:z.modalDelete,children:[Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(a.jsx)(zt.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(a.jsx)(zt.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})]})},zc=Object(r.a)({container:{display:"flex",justifyContent:"center",marginBottom:12},wrapper:{textAlign:"center",padding:"1px 10px 3px 10px",backgroundColor:"rgba(104, 105, 104, 0.8)",color:"#ffffff",borderRadius:7,fontSize:".85em",fontWeight:600}}),Rc=function(e){var t=e.message,n=zc();return Object(a.jsx)("div",{className:n.container,children:Object(a.jsx)("span",{className:n.wrapper,children:t})})},Mc=Object(r.a)({container:{position:"absolute"}}),Ac=function(e){var t=e.date,n=e.disabled,o=e.changeDate,c=e.handleOnOpen,r=Mc();return Object(a.jsx)(it.a,{className:r.container,inputVariant:"outlined",orientation:"portrait",variant:"dialog",openTo:"date",autoOk:!0,disabled:n,value:t||new Date,onOpen:c,onChange:o})},Dc=Object(f.a)("div")((function(){return{position:"relative",borderRadius:"20px",backgroundColor:"#f1f0f0",width:"100%",margin:"0px 5px"}})),Ec=Object(f.a)("div")((function(e){return{padding:e.theme.spacing(0,2),height:"100%",position:"absolute",pointerEvents:"none",display:"flex",alignItems:"center",justifyContent:"center"}})),Lc=Object(f.a)(et.a)((function(e){var t=e.theme;return{color:"inherit","& .MuiInputBase-input":{fontWeight:500,borderRadius:"20px",padding:t.spacing(1,1,1,0),paddingLeft:"calc(1em + ".concat(t.spacing(4),")"),transition:t.transitions.create("width"),width:"100%"}}})),Wc=Object(r.a)({toolBar:{color:"#b1aeae",height:"7vh",width:"100%",display:"flex",flexWrap:"nowrap",alignItems:"center",alignContent:"center",padding:"0px 5px"},searchBarActive:{outline:"2px solid #2184f7",color:"#2184f7"},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}}}),Bc={inputProps:{"aria-label":"Switch demo"}},Pc=function(e){var t=e.handleSearch,n=e.value,o=e.total,c=e.sort,r=e.setDate,s=e.date,l=Wc(),d=Object(i.b)(),b="0"===o;return Object(a.jsxs)("div",{className:l.toolBar,children:[Object(a.jsx)(Ke.a,{"aria-label":"delete",size:"medium",children:Object(a.jsx)(y.a,{id:"cancel",className:l.iconClose,fontSize:"medium"})}),Object(a.jsxs)(Dc,{className:!n||b?void 0:l.searchBarActive,children:[Object(a.jsx)(Ec,{children:Object(a.jsx)(Ze.a,{})}),Object(a.jsx)(Lc,{disabled:b,onChange:t,placeholder:b?"Disabled":"Search",value:n,inputProps:{"aria-label":"search"}})]}),Object(a.jsxs)(Ke.a,{"aria-label":"delete",size:"medium",disabled:b,children:[Object(a.jsx)(Ac,{date:s,disabled:b,changeDate:r,handleOnOpen:function(){return r("")}}),Object(a.jsx)(rt.a,{fontSize:"medium",style:{color:s?"#2184f7":"#b1aeae"}})]}),Object(a.jsx)(ot.a,Object(j.a)(Object(j.a)({onClick:function(){Object(ze.M)({sort:!c}),setTimeout((function(){d(Object(dt.b)())}),1e3)},checked:c},Bc),{},{disabled:b}))]})},Fc=Object(f.a)(Ct.a)((function(e){var t=e.theme;return{"& .MuiBadge-badge":{backgroundColor:"#44b700",color:"#44b700",boxShadow:"0 0 0 2px ".concat(t.palette.background.paper),"&::after":{position:"absolute",top:0,left:0,width:"100%",height:"100%",borderRadius:"50%",animation:"ripple 1.2s infinite ease-in-out",border:"1px solid currentColor",content:'""'}},"@keyframes ripple":{"0%":{transform:"scale(.8)",opacity:1},"100%":{transform:"scale(2.4)",opacity:0}}}})),Yc=Object(r.a)({listItem_iconAvatar:{marginRight:10}}),Uc=function(e){var t=e.name,n=e.lastName,o=e.avatarUrl,c=e.color,r=e.online,i=e.companionId,s=e.handleForwardTo,l=Yc();return Object(a.jsx)("div",{children:Object(a.jsxs)(P.a,{onClick:function(){return s(i)},children:[Object(a.jsx)(Y.a,{className:l.listItem_iconAvatar,children:Object(a.jsx)(Fc,{overlap:"circular",variant:"true"===r?"dot":"standard",anchorOrigin:{vertical:"bottom",horizontal:"right"},children:Object(a.jsx)(p.a,{alt:t,src:o?"".concat(L.l,"/").concat(o):void 0,sx:{background:c,width:54,height:54},children:!o&&"".concat(Object(L.e)(t)).concat(Object(L.e)(n))})})}),Object(a.jsx)(F.a,{primary:"".concat(Object(L.e)(t)).concat(Object(L.p)(t,15,1),"\n ").concat(Object(L.e)(n)).concat(Object(L.p)(n,15,1)),secondaryTypographyProps:{color:"#0379af"},secondary:"true"===r?"online":"last seen ".concat(Object(L.r)(r))})]})})},_c=Object(r.a)({list:{width:"100%",maxHeight:"63vh",overflowY:"scroll","&::-webkit-scrollbar":{width:"0.4em"},"&::-webkit-scrollbar-track":{boxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",webkitBoxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",backgroundColor:"#eceeec"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#ccc8c8"},"&::-webkit-scrollbar-thumb:focus":{backgroundColor:"#959595"},"&::-webkit-scrollbar-thumb:active":{backgroundColor:"#959595"}}}),Hc=function(e){var t=e.value,n=e.date,o=e.filteredAndSorted,c=e.handleForwardTo,r=_c();return Object(a.jsx)(a.Fragment,{children:Object(a.jsxs)(A.a,{className:r.list,component:"nav","aria-label":"main mailbox folders",children:[o.map((function(e){var t=e.name,n=e.lastName,o=e.avatarUrl,r=e.color,i=e.online,s=e.companionId,l=e.number;return Object(a.jsx)(Uc,{name:t,lastName:n,avatarUrl:o,color:r,online:i,companionId:s,handleForwardTo:c},l)})),(t||n)&&0===o.length&&Object(a.jsx)(V,{name:"Can not find Chat by request: ".concat(t)}),!t&&!n&&0===o.length&&Object(a.jsx)(V,{name:"You do not have any Chats yet!"})]})})},$c=Object(r.a)({overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},container:{backgroundColor:"white",width:"22vw",position:"absolute",top:"15vh",height:"70vh",left:"39vw",display:"flex",flexWrap:"wrap",alignItems:"start",alignContent:"start",borderRadius:10}}),Vc=function(e){var t=e.setModalForward,n=e.setIsForward,c=e.companionId,r=$c(),l=Object(i.b)(),d=Object(i.c)(Bt.e),b=Object(i.c)(De),f=b.total,p=b.chats,u=Object(s.useState)(""),m=Object(o.a)(u,2),h=m[0],x=m[1],g=Object(s.useState)(""),O=Object(o.a)(g,2),v=O[0],y=O[1],C=Object(s.useMemo)((function(){return Object(L.q)(p,d).filter((function(e){var t=e.name+" "+e.lastName;return v?t.toLowerCase().includes(h.toLowerCase())&&Object(L.s)(v)===Object(L.s)(e.lastMessageCreatedAt?e.lastMessageCreatedAt:e.createdAt)?e:void 0:t.toLowerCase().includes(h.toLowerCase())}))}),[p,v,h,d]);return Object(a.jsx)("div",{onClick:function(e){var o=e.target.id;"overlay"!==o&&"cancel"!==o||(t(!1),n(void 0))},className:r.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:r.container,children:[Object(a.jsx)(Pc,{handleSearch:function(e){return x(e.target.value)},value:h,total:f,sort:d,date:v,setDate:y}),Object(a.jsx)(Hc,{value:h,date:v,filteredAndSorted:C,handleForwardTo:function(e){t(!1),l(Object(S.c)("")),l(Object(S.b)(!1)),l(_e(e)),n((function(t){return t?Object(j.a)(Object(j.a)({},t),{},{companionIdForwardToAndFrom:e}):t})),c!==e&&setTimeout((function(){return l(Object(S.d)(!0))}),500)}})]})})},Gc=function(e){return e.messages.messages},qc=Object(Ae.a)([Gc],(function(e){return e})),Kc=n(43),Jc=n(44),Qc=function(e){return function(){var t=Object(Ie.a)(Ne.a.mark((function t(n){var o;return Ne.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:try{(o=Object(L.h)("updatedAt",e.filter((function(e){return!0===e.pinned})),!0))&&n(Object(Jc.b)(o))}catch(a){n(Object(Jc.a)())}case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},Xc=function(e,t){return function(){var n=Object(Ie.a)(Ne.a.mark((function n(o){var a;return Ne.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,Object(ze.h)(e);case 3:(a=n.sent)&&(o(Object(Kc.b)(a)),o(Qc(a.messages))),t&&t(),n.next=11;break;case 8:n.prev=8,n.t0=n.catch(0),o(Object(Kc.a)());case 11:case"end":return n.stop()}}),n,null,[[0,8]])})));return function(e){return n.apply(this,arguments)}}()},Zc=n(467),er=Object(r.a)({container:{height:"93vh",width:"100%",display:"flex",alignItems:"center",alignContent:"center",flexDirection:"column",position:"relative"},messagesScroll:{paddingTop:30,overflowY:"scroll",maxHeight:"83vh",width:"100%",display:"flex",justifyContent:"center","&::-webkit-scrollbar":{width:"0.4em"},"&::-webkit-scrollbar-track":{boxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",webkitBoxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",backgroundColor:"#eceeec"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#ccc8c8"},"&::-webkit-scrollbar-thumb:focus":{backgroundColor:"#959595"},"&::-webkit-scrollbar-thumb:active":{backgroundColor:"#959595"}},messagesEmpty:{overflowY:"hidden",width:"100%",display:"flex",justifyContent:"center",paddingTop:30},messagesBody:{width:"60%"}}),tr=function(e){var t,n,c,r=e.chatDivRef,l=e.selectedArr,d=e.setSelectedArr,b=e.isSomeSelected,j=e.setIsSomeSelected,f=e.openPinned,p=e.pinnedMessagesMemo,u=e.handleUnpinAll,m=er(),h=Object(i.b)(),x=Object(i.c)(qc),g=Object(i.c)(Bt.a),O=g.number,v=g.nightMode,y=g.silentMode,C=Object(i.c)(Wt.a),w=C.companionId,k=C.total,N=C.seen,I=C.mute,z=C.seenCompanion,R=C.number,M=Object(i.c)(Be),A=Object(s.useState)(!1),D=Object(o.a)(A,2),E=D[0],W=D[1],B=Object(s.useState)({new:0,mute:!1}),P=Object(o.a)(B,2),F=P[0],Y=P[1],U=Object(s.useState)(void 0),_=Object(o.a)(U,2),H=_[0],$=_[1],G=Object(s.useState)(void 0),q=Object(o.a)(G,2),K=q[0],J=q[1],Q=Object(s.useState)(void 0),X=Object(o.a)(Q,2),Z=X[0],ee=X[1],te=Object(s.useState)(!1),ne=Object(o.a)(te,2),oe=ne[0],ae=ne[1],ce=function(e){return Math.round(new Date(e).getTime()/1e3)},re=function(e){return l.some((function(t){return t===e}))},ie=function(e){!b&&j(!0),l.some((function(t){return t===e}))?d(l.filter((function(t){return t!==e}))):d([].concat(Object(T.a)(l),[e]))},se=function(e){f&&h(Object(S.b)(!1)),Z&&ee(void 0),$(pe.find((function(t){return t._id===e})))},le=function(e){f&&h(Object(S.b)(!1)),H&&$(void 0),Z&&ee(void 0),J(pe.find((function(t){return t._id===e}))),ae(!0)},de=function(e){f&&h(Object(S.b)(!1)),H&&$(void 0),ee(pe.find((function(t){return t._id===e})))},be=Object(s.useCallback)((function(){r.current&&r.current.scrollTo({top:r.current.scrollHeight,behavior:"smooth"})}),[r]),je=Object(s.useCallback)((function(e){var t=e.target,n=t.scrollHeight,o=t.scrollTop,a=t.clientHeight,c=n-Math.floor(o);k!==N&&c-a<10&&!f&&Object(ze.u)(w),W(c!==a)}),[k,N,w,f]),fe=Zc(je,300),pe=Object(s.useMemo)((function(){return f?p:x}),[x,p,f]),ue=function(e){var t=r.current.childNodes[0].childNodes,n=Object(T.a)(t).find((function(t){return t.id===e}));n&&((n=Object(T.a)(n.childNodes).slice(-1)[0]).style.backgroundColor="rgba(70, 70, 70, 0.4)",n.style.boxShadow="0px 0px 6px 0px #ffffff",n.scrollIntoView({behavior:"smooth"}),setTimeout((function(){n.style.backgroundColor="unset",n.style.boxShadow="unset"}),2e3))},me=function(e,t){if(w===e)return ue(t);h(Object(S.c)("")),h(Object(S.b)(!1)),h(Ue(e)),setTimeout((function(){return ue(t)}),2e3)},he=function(e){e&&w!==e&&(h(Object(S.c)("")),h(Object(S.b)(!1)),h(Ue(e)))};return Object(s.useEffect)((function(){M&&(h(Xc(w,be)),h(Object(S.d)(!1)))}),[h,be,M,w]),Object(s.useEffect)((function(){var e=function(){h(_e(w)),h(Xc(w,null))};e();var t=setInterval(e,L.o);return function(){return clearInterval(t)}}),[h,w]),Object(s.useEffect)((function(){Y({new:k-N,mute:I})}),[k,N,I]),Object(s.useEffect)((function(){if(r.current&&f){var e=r.current;e.scrollHeight===e.clientHeight&&E&&W(!1)}}),[r,f,p.length,E]),Object(s.useEffect)((function(){var e=setInterval((function(){if(r.current&&!f){var e=r.current,t=e.scrollHeight,n=e.clientHeight;k!==N&&t===n&&Object(ze.u)(w)}}),L.o);return function(){return clearInterval(e)}}),[k,N,r,w,f]),Object(a.jsxs)("div",{className:m.container,children:[Object(a.jsx)(No,{isArrow:E,isNew:F,handleScrollTo:be,openPinned:f}),K&&oe&&Object(a.jsx)(Vc,{setModalForward:ae,setIsForward:J,companionId:w}),Object(a.jsx)("div",{id:w,ref:r,onScroll:fe,className:x.length>0?m.messagesScroll:m.messagesEmpty,children:Object(a.jsx)("div",{className:m.messagesBody,children:x.length>0?pe.map((function(e,o){var r,i,s=e.replyMessage,l=e.message,d=e.name,j=e.lastName,f=e.avatarUrl,p=e.color,u=e.pinned,m=e.createdAt,h=e.number,x=e.type,g=e.fullType,y=e.replyName,C=e.replyLastName,w=e.replyCaption,S=e.caption,k=e.emoji,I=e.emojiCompanion,T=e._id,M=e.oldId,A=e.forwardName,D=e.forwardLastName,E=e.companionIdForwardToAndFrom,W=e.forwardMessage,B=e.forwardCaption,P=e.edited,F=e.deleted,Y=!(z-(o+1)<0),U=!1,_=pe[o+1];!c&&R===h&&N-(o+1)<0&&(r=!0,c=!0),t?Object(L.s)(t)!==Object(L.s)(m)&&(t=m,i=!0):(i=!0,t=m),!n&&_&&_.number===h?(U=!(ce(_.createdAt)-ce(m)<600),n=h):!n&&_&&_.number!==h?(U=!0,n=null):n&&_&&n===h&&_.number===h?(U=!(ce(_.createdAt)-ce(m)<600),n=h):n&&_&&n===h&&_.number!==h||n&&!_&&n===h?(U=!0,n=null):n&&!_&&n!==h&&(U=!1,n=h),pe.length-1===o&&(U=!0),_&&Object(L.s)(_.createdAt)!==Object(L.s)(m)&&(U=!0);var H="".concat(L.l,"/").concat(l),$="".concat(L.l,"/").concat(W),V="".concat(L.l,"/").concat(s);if(h!==O){if("text"===x&&!M&&!E&&!F)return Object(a.jsxs)("div",{id:T,style:{borderRadius:7},children:[i&&Object(a.jsx)(Rc,{message:Object(L.s)(m)}),r&&Object(a.jsx)(Rc,{message:"Unread Messages"}),Object(a.jsx)(ga,{message:l,tongue:U,watched:!c,edited:P,avatarUrl:f,color:p,createdAt:m,name:d,lastName:j,caption:S,emoji:k,emojiCompanion:I,pinned:u,isSomeSelected:b,isSelected:re,handleSelected:ie,_id:T,nightMode:v,handleReply:se,handleForward:le})]},m);if("text"===x&&F)return Object(a.jsxs)("div",{id:T,style:{borderRadius:7},children:[i&&Object(a.jsx)(Rc,{message:Object(L.s)(m)}),r&&Object(a.jsx)(Rc,{message:"Unread Messages"}),Object(a.jsx)(ua,{tongue:U,watched:Y,edited:P,companionIdForwardToAndFrom:E,avatarUrl:f,color:p,name:d,lastName:j,forwardReplyName:E?A:y,forwardReplyLastName:E?D:C,message:l,createdAt:m,caption:S,emoji:k,emojiCompanion:I,pinned:u,isSomeSelected:b,isSelected:re,handleSelected:ie,_id:T,nightMode:v,handleReply:se,handleForward:le,handleEdit:de,handleOpenTheChat:he})]},m);if("text"===x&&E)return Object(a.jsxs)("div",{id:T,style:{borderRadius:7},children:[i&&Object(a.jsx)(Rc,{message:Object(L.s)(m)}),r&&Object(a.jsx)(Rc,{message:"Unread Messages"}),Object(a.jsx)(Ta,{url:$,companionIdForwardToAndFrom:E,oldId:M,tongue:U,watched:!c,edited:P,avatarUrl:f,color:p,name:d,lastName:j,forwardName:A,forwardLastName:D,forwardMessage:W,forwardCaption:B,message:l,createdAt:m,caption:S,emoji:k,emojiCompanion:I,pinned:u,isSomeSelected:b,isSelected:re,handleSelected:ie,_id:T,nightMode:v,handleReply:se,handleForward:le,fullType:g,handleScrollToTheChat:me})]},m);if("text"===x&&M)return Object(a.jsxs)("div",{id:T,style:{borderRadius:7},children:[i&&Object(a.jsx)(Rc,{message:Object(L.s)(m)}),r&&Object(a.jsx)(Rc,{message:"Unread Messages"}),Object(a.jsx)(Sa,{url:V,tongue:U,watched:!c,edited:P,avatarUrl:f,color:p,replyMessage:s,message:l,createdAt:m,name:d,lastName:j,replyName:y,replyLastName:C,replyCaption:w,caption:S,emoji:k,emojiCompanion:I,pinned:u,isSomeSelected:b,isSelected:re,handleSelected:ie,_id:T,nightMode:v,handleReply:se,handleForward:le,fullType:g,handleScrollToTheMessage:ue,oldId:M})]},m);if("image"===x)return Object(a.jsxs)("div",{id:T,style:{borderRadius:7},children:[i&&Object(a.jsx)(Rc,{message:Object(L.s)(m)}),r&&Object(a.jsx)(Rc,{message:"Unread Messages"}),Object(a.jsx)(Aa,{url:H,tongue:U,watched:!c,edited:P,avatarUrl:f,color:p,createdAt:m,fullType:g,caption:S,emoji:k,emojiCompanion:I,pinned:u,isSomeSelected:b,isSelected:re,handleSelected:ie,_id:T,name:d,lastName:j,nightMode:v,handleReply:se,handleForward:le})]},m);if("audio"===x)return Object(a.jsxs)("div",{id:T,style:{borderRadius:7},children:[i&&Object(a.jsx)(Rc,{message:Object(L.s)(m)}),r&&Object(a.jsx)(Rc,{message:"Unread Messages"}),Object(a.jsx)(Pa,{url:H,tongue:U,watched:!c,edited:P,avatarUrl:f,color:p,name:d,lastName:j,createdAt:m,fullType:g,caption:S,emoji:k,emojiCompanion:I,pinned:u,isSomeSelected:b,isSelected:re,handleSelected:ie,_id:T,nightMode:v,handleReply:se,handleForward:le})]},m);if("video"===x)return Object(a.jsxs)("div",{id:T,style:{borderRadius:7},children:[i&&Object(a.jsx)(Rc,{message:Object(L.s)(m)}),r&&Object(a.jsx)(Rc,{message:"Unread Messages"}),Object(a.jsx)(Ha,{url:H,tongue:U,watched:!c,edited:P,avatarUrl:f,color:p,name:d,lastName:j,createdAt:m,fullType:g,caption:S,emoji:k,emojiCompanion:I,pinned:u,isSomeSelected:b,isSelected:re,handleSelected:ie,_id:T,nightMode:v,handleReply:se,handleForward:le})]},m);if(x)return Object(a.jsxs)("div",{id:T,style:{borderRadius:7},children:[i&&Object(a.jsx)(Rc,{message:Object(L.s)(m)}),r&&Object(a.jsx)(Rc,{message:"Unread Messages"}),Object(a.jsx)(Ka,{url:H,tongue:U,watched:!c,edited:P,avatarUrl:f,color:p,name:d,lastName:j,createdAt:m,type:x,caption:S,emoji:k,emojiCompanion:I,pinned:u,isSomeSelected:b,isSelected:re,handleSelected:ie,_id:T,nightMode:v,handleReply:se,handleForward:le})]},m)}else{if("text"===x&&!M&&!E&&!F)return Object(a.jsxs)("div",{id:T,style:{borderRadius:7},children:[i&&Object(a.jsx)(Rc,{message:Object(L.s)(m)}),r&&Object(a.jsx)(Rc,{message:"Unread Messages"}),Object(a.jsx)(oc,{message:l,tongue:U,watched:Y,edited:P,avatarUrl:f,color:p,createdAt:m,name:d,lastName:j,caption:S,emoji:k,emojiCompanion:I,pinned:u,isSomeSelected:b,isSelected:re,handleSelected:ie,_id:T,nightMode:v,handleReply:se,handleForward:le,handleEdit:de})]},m);if("text"===x&&F)return Object(a.jsxs)("div",{id:T,style:{borderRadius:7},children:[i&&Object(a.jsx)(Rc,{message:Object(L.s)(m)}),r&&Object(a.jsx)(Rc,{message:"Unread Messages"}),Object(a.jsx)(Za,{tongue:U,watched:Y,edited:P,companionIdForwardToAndFrom:E,avatarUrl:f,color:p,name:d,lastName:j,forwardReplyName:E?A:y,forwardReplyLastName:E?D:C,message:l,createdAt:m,caption:S,emoji:k,emojiCompanion:I,pinned:u,isSomeSelected:b,isSelected:re,handleSelected:ie,_id:T,nightMode:v,handleReply:se,handleForward:le,handleEdit:de,handleOpenTheChat:he})]},m);if("text"===x&&E)return Object(a.jsxs)("div",{id:T,style:{borderRadius:7},children:[i&&Object(a.jsx)(Rc,{message:Object(L.s)(m)}),r&&Object(a.jsx)(Rc,{message:"Unread Messages"}),Object(a.jsx)(bc,{url:$,oldId:M,companionIdForwardToAndFrom:E,tongue:U,watched:Y,edited:P,avatarUrl:f,color:p,name:d,lastName:j,forwardName:A,forwardLastName:D,forwardMessage:W,forwardCaption:B,message:l,createdAt:m,caption:S,emoji:k,emojiCompanion:I,pinned:u,isSomeSelected:b,isSelected:re,handleSelected:ie,_id:T,nightMode:v,handleReply:se,handleForward:le,handleEdit:de,fullType:g,handleScrollToTheChat:me})]},m);if("text"===x&&M)return Object(a.jsxs)("div",{id:T,style:{borderRadius:7},children:[i&&Object(a.jsx)(Rc,{message:Object(L.s)(m)}),r&&Object(a.jsx)(Rc,{message:"Unread Messages"}),Object(a.jsx)(ic,{url:V,tongue:U,watched:Y,edited:P,avatarUrl:f,color:p,replyMessage:s,message:l,createdAt:m,name:d,lastName:j,replyName:y,replyLastName:C,replyCaption:w,caption:S,emoji:k,emojiCompanion:I,pinned:u,isSomeSelected:b,isSelected:re,handleSelected:ie,_id:T,nightMode:v,handleReply:se,handleForward:le,handleEdit:de,fullType:g,handleScrollToTheMessage:ue,oldId:M})]},m);if("image"===x)return Object(a.jsxs)("div",{id:T,style:{borderRadius:7},children:[i&&Object(a.jsx)(Rc,{message:Object(L.s)(m)}),r&&Object(a.jsx)(Rc,{message:"Unread Messages"}),Object(a.jsx)(uc,{url:H,tongue:U,watched:Y,edited:P,avatarUrl:f,color:p,createdAt:m,fullType:g,caption:S,emoji:k,emojiCompanion:I,pinned:u,isSomeSelected:b,isSelected:re,handleSelected:ie,_id:T,name:d,lastName:j,nightMode:v,handleReply:se,handleForward:le,handleEdit:de})]},m);if("audio"===x)return Object(a.jsxs)("div",{id:T,style:{borderRadius:7},children:[i&&Object(a.jsx)(Rc,{message:Object(L.s)(m)}),r&&Object(a.jsx)(Rc,{message:"Unread Messages"}),Object(a.jsx)(gc,{url:H,tongue:U,watched:Y,edited:P,avatarUrl:f,color:p,name:d,lastName:j,createdAt:m,fullType:g,caption:S,emoji:k,emojiCompanion:I,pinned:u,isSomeSelected:b,isSelected:re,handleSelected:ie,_id:T,nightMode:v,handleReply:se,handleForward:le,handleEdit:de})]},m);if("video"===x)return Object(a.jsxs)("div",{id:T,style:{borderRadius:7},children:[i&&Object(a.jsx)(Rc,{message:Object(L.s)(m)}),r&&Object(a.jsx)(Rc,{message:"Unread Messages"}),Object(a.jsx)(wc,{url:H,tongue:U,watched:Y,edited:P,avatarUrl:f,color:p,name:d,lastName:j,createdAt:m,fullType:g,caption:S,emoji:k,emojiCompanion:I,pinned:u,isSomeSelected:b,isSelected:re,handleSelected:ie,_id:T,nightMode:v,handleReply:se,handleForward:le,handleEdit:de})]},m);if(x)return Object(a.jsxs)("div",{id:T,style:{borderRadius:7},children:[i&&Object(a.jsx)(Rc,{message:Object(L.s)(m)}),r&&Object(a.jsx)(Rc,{message:"Unread Messages"}),Object(a.jsx)(Tc,{url:H,tongue:U,watched:Y,edited:P,avatarUrl:f,color:p,name:d,lastName:j,createdAt:m,type:x,caption:S,emoji:k,emojiCompanion:I,pinned:u,isSomeSelected:b,isSelected:re,handleSelected:ie,_id:T,nightMode:v,handleReply:se,handleForward:le,handleEdit:de})]},m)}})):Object(a.jsx)(V,{name:"You do not have messages yet!"})})}),!f&&!b&&Object(a.jsx)(ca,{isArrow:E,silentMode:y,isReply:H,setIsReply:$,isForward:K,setIsForward:J,isEdit:Z,setIsEdit:ee,modalForward:oe,handleScrollToTheMessage:ue}),f&&!b&&Object(a.jsx)(ia,{pinnedMessagesMemo:p,handleUnpinAll:u})]})},nr=function(e){var t=e.rightIsOpen,n=e.chatDivRef,r=e.companionId,l=e.backgroundImage,d=e.handleStartCall,b=Object(i.b)(),j=Object(i.c)(He),f=Object(i.c)(Pe),p=Object(s.useState)([]),u=Object(o.a)(p,2),m=u[0],h=u[1],x=Object(s.useState)(!1),g=Object(o.a)(x,2),O=g[0],v=g[1];return Object(s.useEffect)((function(){0===j.length&&f&&b(Object(S.b)(!1))}),[f,j,b]),Object(s.useEffect)((function(){v(!1),h([])}),[r]),Object(a.jsxs)(c.a,{item:!0,lg:t?8:12,children:[Object(a.jsx)(c.a,{item:!0,lg:12,children:Object(a.jsx)(Co,{chatDivRef:n,selectedArr:m,isSomeSelected:O,handleClearSelect:function(){m.length>0&&h([]),O&&v(!1)},setIsSomeSelected:v,openPinned:f,pinnedMessagesMemo:j,handleStartCall:d})}),Object(a.jsx)(c.a,{item:!0,lg:12,style:{backgroundImage:l},children:Object(a.jsx)(tr,{chatDivRef:n,selectedArr:m,setSelectedArr:h,isSomeSelected:O,setIsSomeSelected:v,openPinned:f,pinnedMessagesMemo:j,handleUnpinAll:function(){f&&b(Object(S.b)(!1)),Object(ze.I)(j.map((function(e){return e._id})))}})})]})},or=Object(r.a)({container:{position:"absolute"}}),ar=function(e){var t=e.disabled,n=e.date,o=e.changeDate,c=e.handleOnOpen,r=or();return Object(a.jsx)(it.a,{disabled:t,className:r.container,inputVariant:"outlined",orientation:"portrait",variant:"dialog",openTo:"date",autoOk:!0,value:n||new Date,onOpen:c,onChange:o})},cr=Object(f.a)("div")((function(e){e.theme;return{position:"relative",borderRadius:"20px",backgroundColor:"#f1f0f0",width:"100%",margin:"0 5% 0 5%"}})),rr=Object(f.a)("div")((function(e){return{padding:e.theme.spacing(0,2),height:"100%",position:"absolute",pointerEvents:"none",display:"flex",alignItems:"center",justifyContent:"center"}})),ir=Object(f.a)(et.a)((function(e){var t=e.theme;return{color:"inherit","& .MuiInputBase-input":{fontWeight:500,borderRadius:"20px",padding:t.spacing(1,1,1,0),paddingLeft:"calc(1em + ".concat(t.spacing(4),")"),transition:t.transitions.create("width"),width:"100%"}}})),sr=Object(r.a)({toolBar:{color:"#b1aeae",height:"7vh"},searchBarActive:{outline:"2px solid #2184f7",color:"#2184f7"}}),lr={inputProps:{"aria-label":"Switch demo"}},dr=function(e){var t=e.handleSearch,n=e.value,o=e.setDate,c=e.date,r=Object(i.b)(),s=sr(),l=Object(i.c)(Wt.a),d=l.sort,b=l.companionId,f=!(Object(i.c)(Gc).length>0);return Object(a.jsxs)(at.a,{className:s.toolBar,children:[Object(a.jsx)(Ke.a,{onClick:function(){return r(Object(S.c)(""))},"aria-label":"delete",size:"medium",children:Object(a.jsx)(y.a,{fontSize:"medium"})}),Object(a.jsxs)(cr,{className:!n||f?void 0:s.searchBarActive,children:[Object(a.jsx)(rr,{children:Object(a.jsx)(Ze.a,{})}),Object(a.jsx)(ir,{disabled:f,onChange:t,placeholder:f?"Disabled":"Search",value:n,inputProps:{"aria-label":"search"}})]}),Object(a.jsxs)(Ke.a,{"aria-label":"delete",size:"medium",disabled:f,children:[Object(a.jsx)(ar,{disabled:f,date:c,changeDate:o,handleOnOpen:function(){return o("")}}),Object(a.jsx)(rt.a,{fontSize:"medium",style:{color:c?"#2184f7":"#b1aeae"}})]}),Object(a.jsx)(ot.a,Object(j.a)(Object(j.a)({onClick:function(){return Object(ze.F)(b)},checked:d},lr),{},{disabled:f}))]})},br=Object(r.a)({container:{height:"100%",backgroundColor:"#ffffff"},list:{maxHeight:"93vh",overflowY:"scroll","&::-webkit-scrollbar":{width:"0.4em"},"&::-webkit-scrollbar-track":{boxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",webkitBoxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",backgroundColor:"#eceeec"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#ccc8c8"},"&::-webkit-scrollbar-thumb:focus":{backgroundColor:"#959595"},"&::-webkit-scrollbar-thumb:active":{backgroundColor:"#959595"}},listItem:{cursor:"pointer","&:hover":{backgroundColor:"#f0f0f0"}},folderIcon:{margin:"auto 0px",color:"#54b0fc"}}),jr=function(e){var t=e.chatDivRef,n=br(),c=Object(i.c)(Wt.a).sort,r=Object(i.c)(Pe),l=Object(i.c)(qc),d=Object(i.c)(He),b=Object(s.useState)(""),j=Object(o.a)(b,2),f=j[0],u=j[1],m=Object(s.useState)(""),h=Object(o.a)(m,2),x=h[0],g=h[1],O=Object(s.useMemo)((function(){return Object(L.h)("createdAt",r?d:l,c).filter((function(e){return x?e.message.toLowerCase().includes(f.toLowerCase())&&Object(L.s)(x)===Object(L.s)(e.createdAt)?e:void 0:e.message.toLowerCase().includes(f.toLowerCase())}))}),[l,x,c,f,r,d]);return Object(a.jsxs)("div",{className:n.container,children:[Object(a.jsx)(dr,{handleSearch:function(e){return u(e.target.value)},value:f,setDate:g,date:x}),Object(a.jsx)("div",{className:l.length>0?n.list:void 0,children:l.length>0?O.length>0?Object(a.jsx)(A.a,{sx:{width:"100%"},children:O.map((function(e){var o=e.name,c=e.lastName,r=e.avatarUrl,i=e.color,s=e.message,l=e.createdAt,d=e._id,b=e.fullType,j=e.type;return Object(a.jsxs)("div",{children:[Object(a.jsxs)(K.a,{onClick:function(){return function(e){var n=t.current.childNodes[0].childNodes,o=Object(T.a)(n).find((function(t){return t.id===e}));o&&((o=Object(T.a)(o.childNodes).slice(-1)[0]).style.backgroundColor="rgba(70, 70, 70, 0.4)",o.style.boxShadow="0px 0px 6px 0px #ffffff",o.scrollIntoView({behavior:"smooth"}),setTimeout((function(){o.style.backgroundColor="unset",o.style.boxShadow="unset"}),2e3))}(d)},alignItems:"flex-start",className:n.listItem,children:[Object(a.jsx)(J.a,{children:Object(a.jsx)(p.a,{alt:o,src:r?"".concat(L.l,"/").concat(r):void 0,sx:{background:i,width:40,height:40,marginRight:2},children:!r&&"".concat(Object(L.e)(o)).concat(Object(L.e)(c))})}),Object(a.jsx)(F.a,{primary:"".concat(Object(L.e)(o)).concat(Object(L.p)(o,15,1)," \n ").concat(Object(L.e)(c)).concat(Object(L.p)(c,15,1)),secondary:Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(sa.a,{sx:{display:"block",wordBreak:"break-word"},component:"span",variant:"body2",color:"text.primary",children:"text"===j?s:b}),Object(L.r)(l)]})}),"text"===j&&Object(a.jsx)(ue.a,{className:n.folderIcon,fontSize:"large"}),"text"!==j&&b.includes("audio")&&Object(a.jsx)(ge.a,{className:n.folderIcon,fontSize:"large"}),"text"!==j&&b.includes("video")&&Object(a.jsx)(Ce.a,{className:n.folderIcon,fontSize:"large"}),"text"!==j&&b.includes("image")&&Object(a.jsx)(go.a,{className:n.folderIcon,fontSize:"large"}),"text"!==j&&b.includes("application")&&Object(a.jsx)(X.a,{className:n.folderIcon,fontSize:"large"})]}),Object(a.jsx)(Z.a,{variant:"inset"})]},l)}))}):Object(a.jsx)(V,{name:"Can not find message by request: ".concat(f)}):Object(a.jsx)(V,{name:"You do not have messages yet!"})})]})},fr=Object(r.a)({container:{display:"flex",alignContent:"center",alignItems:"center",height:"7vh"},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}}}),pr=function(){var e=Object(i.b)(),t=fr(),n=Object(i.c)(rn),c=Object(i.c)(Wt.a).number,r=Object(s.useState)(!1),l=Object(o.a)(r,2),d=l[0],b=l[1];return Object(s.useEffect)((function(){var e=n.find((function(e){return e.number===c}));b(!!e)}),[n,c]),Object(a.jsxs)(D.a,{className:t.container,direction:"row",children:[Object(a.jsx)(Ke.a,{onClick:function(){return e(Object(S.c)(""))},"aria-label":"delete",size:"medium",children:Object(a.jsx)(y.a,{className:t.iconClose,fontSize:"medium"})}),Object(a.jsx)(E.a,{variant:"h6",color:"initial",style:{marginLeft:20,color:"#474747"},children:"Profile"}),Object(a.jsx)(Ke.a,{style:{marginLeft:"auto",marginRight:"3%"},"aria-label":"delete",size:"medium",children:d?Object(a.jsx)(vn.a,{onClick:function(){return e(Object(S.c)("edit"))},fontSize:"medium"}):Object(a.jsx)(w.a,{onClick:function(){return e(bn(c))},fontSize:"medium"})})]})},ur=Object(r.a)({container:{position:"relative"},timeTitle:{position:"absolute",color:"#ffffff",backgroundColor:"rgb(0,0,0)",borderRadius:10,padding:4,fontSize:15,top:"1%",left:"50%",marginLeft:"-45%",opacity:.7,transition:"opacity .35s ease-in-out"},nameTitle:{position:"absolute",color:"#ffffff",backgroundColor:"rgb(0,0,0)",borderRadius:10,padding:8,fontSize:18,zIndex:10,top:"6%",left:"50%",marginLeft:"-45%",opacity:.7,transition:"opacity .35s ease-in-out"},countryTitle:{position:"absolute",color:"#ffffff",backgroundColor:"rgb(0,0,0)",borderRadius:10,padding:4,fontSize:15,top:"13%",left:"50%",marginLeft:"-45%",opacity:.7,transition:"opacity .35s ease-in-out"},credentialsTitle:{position:"absolute",color:"#ffffff",fontSize:100,top:"30%",left:"38%"},credentialsLowTitle:{position:"absolute",color:"#ffffff",fontSize:25,top:"90%",left:"9%"}}),mr=function(){var e=ur(),t=Object(i.c)(Wt.a),n=t.name,o=t.lastName,c=t.online,r=t.avatarsArr,s=t.createdAt,l=t.color,d=t.country,b=0!==r.length;return Object(a.jsxs)("div",{className:e.container,children:[Object(a.jsx)(zn.Carousel,{children:b?r.map((function(e){var t=e.avatarUrl,n=e.updatedAt;return Object(a.jsxs)("div",{children:[Object(a.jsx)("img",{alt:"pic",src:"".concat(L.l,"/").concat(t)}),Object(a.jsx)("p",{className:"legend",children:Object(L.r)(n)})]})})):[Object(a.jsxs)("div",{children:[Object(a.jsx)("img",{alt:"transparentPic",src:Rn,style:{background:"linear-gradient(to bottom, ".concat(l,", ").concat(l," 80%, #5d5d5d 100%)")}}),Object(a.jsx)("p",{className:"legend",children:Object(L.r)(s)})]})]}),Object(a.jsx)("span",{className:e.timeTitle,children:"true"===c?"online":"last seen ".concat(Object(L.r)(c))}),Object(a.jsx)("span",{className:e.nameTitle,children:"".concat(Object(L.e)(n)).concat(Object(L.p)(n,15,1),"\n ").concat(Object(L.e)(o)).concat(Object(L.p)(o,15,1))}),Object(a.jsx)("span",{className:e.countryTitle,children:d}),!b&&Object(a.jsx)("span",{className:e.credentialsTitle,children:"".concat(Object(L.e)(n)).concat(Object(L.e)(o))}),!b&&Object(a.jsx)("span",{className:e.credentialsLowTitle,children:"".concat(Object(L.e)(n)).concat(Object(L.e)(o))})]})},hr=n(469),xr=n.n(hr),gr=n(468),Or=n.n(gr),vr=Object(r.a)({listIcon:{marginRight:15}}),yr={inputProps:{"aria-label":"Switch demo"}},Cr=function(e){var t=e.disabled,n=vr(),o=Object(i.c)(Wt.a),c=o.number,r=o.mute,s=o.sort,l=o.companionId,d=o.originalName,b=o.originalLastName,f="".concat(Object(L.e)(d)).concat(Object(L.p)(d,15,1),"\n ").concat(Object(L.e)(b)).concat(Object(L.p)(b,15,1));return Object(a.jsx)(Yt.a,{children:Object(a.jsxs)(Ut.a,{children:[Object(a.jsx)(nn.CopyToClipboard,{onCopy:function(){return Object(L.a)("Number")},text:c,children:Object(a.jsxs)(m.a,{children:[Object(a.jsx)(Y.a,{className:n.listIcon,children:Object(a.jsx)(Wn.a,{fontSize:"medium"})}),Object(a.jsx)(F.a,{primary:c,secondary:"Copy number"})]})}),Object(a.jsx)(Z.a,{variant:"inset"}),Object(a.jsx)(nn.CopyToClipboard,{onCopy:function(){return Object(L.a)("Username")},text:f,children:Object(a.jsxs)(m.a,{style:{cursor:"pointer"},children:[Object(a.jsx)(Y.a,{className:n.listIcon,children:Object(a.jsx)(Or.a,{fontSize:"medium"})}),Object(a.jsx)(F.a,{primary:f,secondary:"Username"})]})}),Object(a.jsx)(Z.a,{variant:"inset"}),Object(a.jsxs)(m.a,{style:{cursor:"default"},children:[Object(a.jsx)(Y.a,{className:n.listIcon,children:Object(a.jsx)(qt.a,{fontSize:"medium"})}),Object(a.jsx)(F.a,{primary:"Notification"}),Object(a.jsx)(ot.a,Object(j.a)(Object(j.a)({style:{cursor:"pointer"},onClick:function(){return Object(ze.k)(l)}},yr),{},{checked:!r}))]}),Object(a.jsx)(Z.a,{variant:"inset"}),Object(a.jsxs)(m.a,{disabled:t,style:{cursor:"default"},children:[Object(a.jsx)(Y.a,{className:n.listIcon,children:Object(a.jsx)(xr.a,{fontSize:"medium"})}),Object(a.jsx)(F.a,{primary:"Sort by Date"}),Object(a.jsx)(ot.a,Object(j.a)(Object(j.a)({style:{cursor:"pointer"},onClick:function(){return Object(ze.F)(l)}},yr),{},{checked:s}))]})]})})},wr=Object(r.a)({container:{position:"absolute",animationDuration:"0.2s",animationDirection:"normal",animation:"$moveElement"},folderIcon:{margin:"auto 0px",color:"#54b0fc"},listItem:{cursor:"pointer","&:hover":{backgroundColor:"#f0f0f0"}},"@keyframes moveElement":{"0%":{left:"100%"},"100%":{left:"0%"}}}),Sr=function(e){var t=e.filteredAndSorted,n=e.handleScrollToTheMessage,o=e.openPinned,c=wr();return t.length>0?Object(a.jsx)(A.a,{className:c.container,children:t.map((function(e){e.message;var t=e.createdAt,o=e.fullType,r=e._id,i=e.name,s=e.avatarUrl,l=e.lastName,d=e.color;return Object(a.jsxs)("div",{children:[Object(a.jsxs)(K.a,{onClick:function(){return n(r)},alignItems:"flex-start",className:c.listItem,children:[Object(a.jsx)(J.a,{children:Object(a.jsx)(p.a,{alt:i,src:s?"".concat(L.l,"/").concat(s):void 0,sx:{background:d,width:40,height:40,marginRight:2},children:!s&&"".concat(Object(L.e)(i)).concat(Object(L.e)(l))})}),Object(a.jsx)(F.a,{primary:o,secondary:Object(L.r)(t)}),Object(a.jsx)(ge.a,{className:c.folderIcon,fontSize:"large"})]}),Object(a.jsx)(Z.a,{variant:"inset"})]},t)}))}):Object(a.jsx)(V,{name:"You do not have ".concat(o&&"Pinned"," Audio yet!")})},kr=Object(r.a)({overlay:{position:"fixed",top:0,left:0,width:"100vw",minHeight:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",boxSizing:"border-box",display:"flex",justifyContent:"center",alignContent:"center",alignItems:"center",overflow:"auto"},topBar:{position:"fixed",top:0,left:0,height:"7vh",width:"100vw",display:"flex",alignContent:"center",alignItems:"center",justifyContent:"space-between",backgroundColor:"rgba(65, 65, 65, 0.9)",zIndex:10,padding:"0px 20px"},wrapperCredentials:{display:"flex",alignContent:"center",alignItems:"center"},wrapperIcons:{display:"flex",alignContent:"center",alignItems:"center"},magnifying:{marginLeft:5,cursor:"pointer",color:"#e9e7e7",padding:0,"&:hover":{color:"#ffffff",transform:"scale(1.1)"}},downloadIcon:{marginLeft:5,cursor:"pointer",color:"#e9e7e7",padding:0,borderRadius:"50%","&:hover":{backgroundColor:"#ffffff",color:"#b8b7b7"}},iconClose:{marginLeft:5,cursor:"pointer",color:"#e9e7e7",padding:0,"&:hover":{color:"#ffffff",transform:"rotate(180deg)",transition:"all 250ms ease-out "}},wrapperImage:{borderRadius:5,maxWidth:500,maxHeight:750,display:"flex",overflow:"auto"},innerImage:{objectFit:"cover"},img:{cursor:"pointer","&:hover":{scale:.98}}}),Nr=function(e){var t=e.message,n=e.fullType,c=e.updatedAt,r=e.handleScrollToTheMessage,i=e.id,l=e.name,d=e.lastName,b=e.avatarUrl,j=e.color,f=kr(),u="".concat(L.l,"/").concat(t),m=Object(s.useState)(!1),h=Object(o.a)(m,2),x=h[0],g=h[1],O=Object(s.useState)(1),v=Object(o.a)(O,2),C=v[0],w=v[1],S=Object(s.useRef)(null),k=function(e){var t=e.target.id;"overlay"!==t&&"close"!==t||(g(!1),w(1))};return x?Object(a.jsxs)("div",{id:"overlay",onClick:function(e){k(e),r(i)},className:f.overlay,children:[Object(a.jsxs)("div",{className:f.topBar,children:[Object(a.jsxs)("div",{className:f.wrapperCredentials,children:[Object(a.jsx)(Y.a,{children:Object(a.jsx)(p.a,{alt:l,src:b?"".concat(L.l,"/").concat(b):void 0,sx:{background:j,width:44,height:44},children:!b&&"".concat(Object(L.e)(l)).concat(Object(L.e)(d))})}),Object(a.jsx)(F.a,{primary:"".concat(Object(L.e)(l)).concat(Object(L.p)(l,15,1),"\n ").concat(Object(L.e)(d)).concat(Object(L.p)(d,15,1)),primaryTypographyProps:{color:"#ffffff"},secondary:Object(L.r)(c),secondaryTypographyProps:{color:"#ffffff"}})]}),Object(a.jsxs)("div",{className:f.wrapperIcons,children:[Object(a.jsx)(ie.a,{onClick:function(){C>=.5&&(S.current.style.transform="scale(".concat(C-.25,",").concat(C-.25,")"),S.current.style.transformOrigin="".concat(50/C-.25,"px ").concat(50/C-.25,"px"),w(C-.25))},className:f.magnifying,fontSize:"large"}),Object(a.jsx)(le.a,{onClick:function(){C<5&&(S.current.style.transform="scale(".concat(C+.25,",").concat(C+.25,")"),S.current.style.transformOrigin="".concat(50/C+.25,"px ").concat(50/C+.25,"px"),w(C+.25))},className:f.magnifying,fontSize:"large"}),Object(a.jsx)(ce.a,{onClick:function(){return Object(L.g)(u,n)},className:f.downloadIcon,fontSize:"large"}),Object(a.jsx)(y.a,{id:"close",onClick:k,className:f.iconClose,fontSize:"large"})]})]}),Object(a.jsx)("div",{ref:S,className:f.wrapperImage,children:Object(a.jsx)("img",{className:f.innerImage,width:"100%",height:"auto",alt:"imageItem",src:u})})]}):Object(a.jsx)(oe.a,{children:Object(a.jsx)("img",{onClick:function(){return!x&&g(!0)},className:f.img,src:"".concat(u,"?w=164&h=164&fit=crop&auto=format"),srcSet:"".concat(u,"?w=164&h=164&fit=crop&auto=format&dpr=2 2x"),alt:"imageItem",loading:"lazy"})})},Ir=Object(r.a)({container:{position:"absolute",animationDuration:"0.2s",animationDirection:"normal",animation:"$moveElement"},"@keyframes moveElement":{"0%":{left:"100%"},"100%":{left:"0%"}}}),Tr=function(e){var t=e.filteredAndSorted,n=e.handleScrollToTheMessage,o=e.openPinned,c=Ir();return t.length>0?Object(a.jsx)(ne.a,{className:c.container,sx:{width:"100%",height:"auto",overflow:"hidden"},cols:3,rowHeight:164,children:t.map((function(e){var t=e.message,o=e.createdAt,c=e.fullType,r=e.updatedAt,i=e._id,s=e.name,l=e.lastName,d=e.avatarUrl,b=e.color;return Object(a.jsx)(Nr,{message:t,fullType:c,updatedAt:r,handleScrollToTheMessage:n,id:i,name:s,lastName:l,avatarUrl:d,color:b},o)}))}):Object(a.jsx)(V,{name:"You do not have ".concat(o&&"Pinned"," Media yet!")})},zr=Object(r.a)({container:{position:"absolute",animationDuration:"0.2s",animationDirection:"normal",animation:"$moveElement"},folderIcon:{margin:"auto 0px",color:"#54b0fc"},listItem:{cursor:"pointer","&:hover":{backgroundColor:"#f0f0f0"}},"@keyframes moveElement":{"0%":{left:"100%"},"100%":{left:"0%"}}}),Rr=function(e){var t=e.filteredAndSorted,n=e.handleScrollToTheMessage,o=e.openPinned,c=zr();return t.length>0?Object(a.jsx)(A.a,{className:c.container,children:t.map((function(e){var t=e.createdAt,o=e.fullType,r=e._id,i=e.name,s=e.avatarUrl,l=e.lastName,d=e.color;return Object(a.jsxs)("div",{children:[Object(a.jsxs)(K.a,{onClick:function(){return n(r)},alignItems:"flex-start",className:c.listItem,children:[Object(a.jsx)(J.a,{children:Object(a.jsx)(p.a,{alt:i,src:s?"".concat(L.l,"/").concat(s):void 0,sx:{background:d,width:40,height:40,marginRight:2},children:!s&&"".concat(Object(L.e)(i)).concat(Object(L.e)(l))})}),Object(a.jsx)(F.a,{primary:o,secondary:Object(L.r)(t)}),Object(a.jsx)(X.a,{className:c.folderIcon,fontSize:"large"})]}),Object(a.jsx)(Z.a,{variant:"inset"})]},t)}))}):Object(a.jsx)(V,{name:"You do not have ".concat(o&&"Pinned"," Files yet!")})},Mr=Object(r.a)({container:{position:"absolute",animationDuration:"0.2s",animationDirection:"normal",animation:"$moveElement"},listItem:{cursor:"pointer","&:hover":{backgroundColor:"#f0f0f0"}},folderIcon:{margin:"auto 0px",color:"#54b0fc"},"@keyframes moveElement":{"0%":{left:"100%"},"100%":{left:"0%"}}}),Ar=function(e){var t=e.filteredAndSorted,n=e.handleScrollToTheMessage,o=e.openPinned,c=Mr();return t.length>0?Object(a.jsx)(A.a,{className:c.container,children:t.map((function(e){var t=e.message,o=e.createdAt,r=e.lastName,i=e.name,s=e.color,l=e.avatarUrl,d=e._id;return Object(a.jsxs)("div",{children:[Object(a.jsxs)(K.a,{onClick:function(){return n(d)},alignItems:"flex-start",className:c.listItem,children:[Object(a.jsx)(J.a,{children:Object(a.jsx)(p.a,{alt:i,src:l?"".concat(L.l,"/").concat(l):void 0,sx:{background:s,width:38,height:38},children:"".concat(Object(L.e)(i)).concat(Object(L.e)(r))})}),Object(a.jsx)(F.a,{style:{wordBreak:"break-word",marginRight:2},primary:t,secondary:Object(L.r)(o),secondaryTypographyProps:{color:"#020202",paddingTop:.5}}),Object(a.jsx)(ue.a,{className:c.folderIcon,fontSize:"large"})]}),Object(a.jsx)(Z.a,{variant:"inset"})]},o)}))}):Object(a.jsx)(V,{name:"You do not have ".concat(o&&"Pinned"," Text yet!")})},Dr=Object(r.a)({container:{position:"absolute",animationDuration:"0.2s",animationDirection:"normal",animation:"$moveElement"},folderIcon:{margin:"auto 0px",color:"#54b0fc"},listItem:{cursor:"pointer","&:hover":{backgroundColor:"#f0f0f0"}},"@keyframes moveElement":{"0%":{left:"100%"},"100%":{left:"0%"}}}),Er=function(e){var t=e.filteredAndSorted,n=e.handleScrollToTheMessage,o=e.openPinned,c=Dr();return t.length>0?Object(a.jsx)(A.a,{className:c.container,children:t.map((function(e){e.message;var t=e.createdAt,o=e.fullType,r=e._id,i=e.name,s=e.avatarUrl,l=e.lastName,d=e.color;return Object(a.jsxs)("div",{children:[Object(a.jsxs)(K.a,{onClick:function(){return n(r)},alignItems:"flex-start",className:c.listItem,children:[Object(a.jsx)(J.a,{children:Object(a.jsx)(p.a,{alt:i,src:s?"".concat(L.l,"/").concat(s):void 0,sx:{background:d,width:40,height:40,marginRight:2},children:!s&&"".concat(Object(L.e)(i)).concat(Object(L.e)(l))})}),Object(a.jsx)(F.a,{primary:o,secondary:Object(L.r)(t)}),Object(a.jsx)(Ce.a,{className:c.folderIcon,fontSize:"large"})]},t),Object(a.jsx)(Z.a,{variant:"inset"})]},t)}))}):Object(a.jsx)(V,{name:"You do not have ".concat(o&&"Pinned"," Video yet!")})},Lr=Object(r.a)({container:{height:"7vh",display:"flex",alignContent:"end",alignItems:"end",width:"100%",borderBottom:"solid 2px #dddddd"}}),Wr=Object(f.a)((function(e){return Object(a.jsx)(R.a,Object(j.a)(Object(j.a)({},e),{},{TabIndicatorProps:{children:Object(a.jsx)("span",{className:"MuiTabs-indicatorSpan"})}}))}))({"& .MuiTabs-flexContainer":{display:"flex",width:"100%",padding:"0px 10px",justifyContent:"space-between"},"& .MuiTabs-indicator":{height:0,backgroundColor:"transparent",borderBottom:"3px solid #1976d2",borderLeft:"3px solid transparent",borderRight:"3px solid transparent"}}),Br=Object(f.a)((function(e){return Object(a.jsx)(z.a,Object(j.a)({disableRipple:!0},e))}))((function(){return{fontSize:"1rem",fontWeight:550,textTransform:"none",minWidth:"auto"}})),Pr=function(e){var t=e.setDisabled,n=e.chatDivRef,c=Lr(),r=Object(i.c)(Wt.a).sort,l=Object(i.c)(Pe),d=Object(i.c)(qc),b=Object(i.c)(He),j=Object(s.useState)(0),f=Object(o.a)(j,2),p=f[0],u=f[1],m=function(e){var t=n.current.childNodes[0].childNodes,o=Object(T.a)(t).find((function(t){return t.id===e}));o&&((o=Object(T.a)(o.childNodes).slice(-1)[0]).style.backgroundColor="rgba(70, 70, 70, 0.4)",o.style.boxShadow="0px 0px 6px 0px #ffffff",o.scrollIntoView({behavior:"smooth"}),setTimeout((function(){o.style.backgroundColor="unset",o.style.boxShadow="unset"}),2e3))},h=Object(s.useMemo)((function(){return Object(L.h)("createdAt",l?b:d,r).filter((function(e){return L.c[p].includes(e.type)}))}),[p,d,l,b,r]);return Object(s.useEffect)((function(){t(!(h.length>0))}),[h,t]),Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(M.a,{className:c.container,children:Object(a.jsxs)(Wr,{sx:{width:"100%"},onChange:function(e,t){return u(t)},value:p,"aria-label":"wrapped label tabs example",children:[Object(a.jsx)(Br,{label:"Files"}),Object(a.jsx)(Br,{label:"Media"}),Object(a.jsx)(Br,{label:"Text"}),Object(a.jsx)(Br,{label:"Audio"}),Object(a.jsx)(Br,{label:"Video"})]})}),0===p&&Object(a.jsx)(Rr,{filteredAndSorted:h,handleScrollToTheMessage:m,openPinned:l}),1===p&&Object(a.jsx)(Tr,{filteredAndSorted:h,handleScrollToTheMessage:m,openPinned:l}),2===p&&Object(a.jsx)(Ar,{filteredAndSorted:h,handleScrollToTheMessage:m,openPinned:l}),3===p&&Object(a.jsx)(Sr,{filteredAndSorted:h,handleScrollToTheMessage:m,openPinned:l}),4===p&&Object(a.jsx)(Er,{filteredAndSorted:h,handleScrollToTheMessage:m,openPinned:l})]})},Fr=Object(r.a)({container:{backgroundColor:"#ffffff",height:"100%",width:"100%",position:"relative"},scrollContainer:{overflowY:"scroll",maxHeight:"93vh",width:"100%","&::-webkit-scrollbar":{width:"0.4em"},"&::-webkit-scrollbar-track":{boxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",webkitBoxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",backgroundColor:"#eceeec"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#ccc8c8"},"&::-webkit-scrollbar-thumb:focus":{backgroundColor:"#959595"},"&::-webkit-scrollbar-thumb:active":{backgroundColor:"#959595"}}}),Yr=function(e){var t=e.chatDivRef,n=Fr(),c=Object(i.b)(),r=Object(i.c)(Le),l=Object(s.useState)(!1),d=Object(o.a)(l,2),b=d[0],j=d[1];return Object(s.useEffect)((function(){var e=function(){return"contacts"!==r&&c(dn())};e();var t=setInterval(e,L.o);return function(){return clearInterval(t)}}),[r,c]),Object(a.jsxs)("div",{className:n.container,children:[Object(a.jsx)(pr,{}),Object(a.jsxs)("div",{className:n.scrollContainer,children:[Object(a.jsx)(mr,{}),Object(a.jsx)(Cr,{disabled:b}),Object(a.jsx)(Pr,{setDisabled:j,chatDivRef:t})]})]})},Ur=Object(r.a)({container:{height:"7vh",width:"100%",display:"flex",alignContent:"center",alignItems:"center",backgroundColor:"#ffffff"},iconArrow:{"&:hover":{transform:"rotate(360deg)",transition:"all 250ms ease-out "}}}),_r=function(){var e=Object(i.b)(),t=Ur();return Object(a.jsxs)(D.a,{className:t.container,direction:"row",spacing:21,children:[Object(a.jsx)(Ke.a,{onClick:function(){return e(Object(S.c)("credentials"))},"aria-label":"delete",size:"medium",children:Object(a.jsx)(nt.a,{className:t.iconArrow,fontSize:"medium"})}),Object(a.jsx)(E.a,{style:{marginLeft:20,color:"#474747"},variant:"h6",color:"initial",children:"Edit chat"})]})},Hr=Object(r.a)({container:{display:"flex",alignItems:"center",alignContent:"center",flexDirection:"column",width:"100%",margin:"0 auto",padding:20,marginBottom:15,position:"relative",backgroundColor:"#ffffff"},textField:{marginBottom:20},notifications:{width:"100%",display:"flex",justifyContent:"flex-start",alignContent:"start",alignItems:"start",marginBottom:"auto"},avatarArrow:{cursor:"pointer",alignSelf:"flex-end","&:hover":{backgroundColor:"rgb(62, 149, 231)"}}}),$r={inputProps:{"aria-label":"Checkbox demo"}},Vr=function(e){var t=Hr(),n=e.chat,o=e.name,c=e.setName,r=e.lastName,i=e.setLastName,s=e.mute,l=e.setMute,d=e.openBtn,b=e.setOpenBtn,f=n.avatarUrl,u=n.color,m=n.originalName,h=n.originalLastName,x=function(e){!d&&b(!0);var t=Object(L.f)(e.target.value);switch(e.target.name){case"name":c(t);break;case"lastName":i(t)}};return Object(a.jsxs)("div",{className:t.container,children:[Object(a.jsx)(J.a,{style:{marginBottom:10},children:Object(a.jsx)(p.a,{alt:o,src:f?"".concat(L.l,"/").concat(f):void 0,sx:{background:u,width:120,height:120,marginRight:2,fontSize:30},children:"".concat(Object(L.e)(o)).concat(Object(L.e)(r))})}),Object(a.jsx)(E.a,{style:{color:"#080808",fontSize:22,fontWeight:500},children:"".concat(Object(L.e)(m)).concat(Object(L.p)(m,15,1)," \n ").concat(Object(L.e)(h)).concat(Object(L.p)(h,15,1))}),Object(a.jsx)(E.a,{style:{fontSize:17,marginBottom:20},children:"original name"}),Object(a.jsx)(pn.a,{id:"name",name:"name",label:"Name",value:o,fullWidth:!0,variant:"outlined",onChange:x,className:t.textField}),Object(a.jsx)(pn.a,{id:"lastName",name:"lastName",label:"LastName",value:r,fullWidth:!0,variant:"outlined",onChange:x,className:t.textField}),Object(a.jsxs)("div",{className:t.notifications,children:[Object(a.jsx)(la.a,Object(j.a)(Object(j.a)({onChange:function(){l(!s),!d&&b(!0)}},$r),{},{checked:!s,style:{marginRight:20}})),Object(a.jsx)(F.a,{primary:"Notifications",primaryTypographyProps:{color:"#0e0d0d"},secondary:s?"Enabled":"Disabled"})]})]})},Gr=Object(r.a)({container:{width:"100%",padding:"20px 10px 20px 10px",backgroundColor:"#ffffff"},modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},titleWrapper:{display:"flex",justifyContent:"flex-start",alignContent:"center",alignItems:"center"}}),qr=function(e){var t=e.isContact,n=Gr(),c=Object(i.b)(),r=t._id,l=t.avatarUrl,d=t.color,b=t.name,j=t.lastName,f=Object(s.useState)(!1),u=Object(o.a)(f,2),h=u[0],x=u[1];return Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)("ul",{className:n.container,children:Object(a.jsxs)(m.a,{onClick:function(){return x(!0)},style:{fontSize:19,color:"#f02a2a"},children:[Object(a.jsx)(yt.a,{fontSize:"medium",style:{marginRight:27}}),"Delete contact"]})}),h&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return x(!1);"delete"===t&&(c(Object(S.c)("credentials")),Object(ze.q)(r),x(!1))},className:n.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:n.modalDelete,children:[Object(a.jsxs)("div",{className:n.titleWrapper,children:[Object(a.jsx)(p.a,{alt:b,src:l?"".concat(L.l,"/").concat(l):void 0,sx:{background:d,width:38,height:38,marginRight:2},children:"".concat(Object(L.e)(b)).concat(Object(L.e)(j))}),Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete contact"})]}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete contact\n ".concat("".concat(Object(L.e)(b)).concat(Object(L.p)(b,15,1),"\n ").concat(Object(L.e)(j)).concat(Object(L.p)(j,15,1)),"?")}),Object(a.jsx)(zt.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE CONTACT"}),Object(a.jsx)(zt.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})},Kr=Object(r.a)({container:{position:"absolute",top:"92vh",left:20},avatarArrow:{cursor:"pointer","&:hover":{backgroundColor:"rgb(62, 149, 231)"}}}),Jr=function(e){var t=e.handleSubmit,n=Kr();return Object(a.jsx)("div",{className:n.container,children:Object(a.jsx)(p.a,{onClick:t,className:n.avatarArrow,sx:{width:56,height:56,backgroundColor:"rgb(41, 139, 231)",color:"#ffffff"},children:Object(a.jsx)(Nt.a,{fontSize:"medium"})})})},Qr=Object(r.a)({editBar:{backgroundColor:"#f3f2f2",height:"100%",position:"relative"}}),Xr=function(){var e=Qr(),t=Object(i.c)(rn),n=Object(i.c)(Wt.a),c=Object(s.useState)(!1),r=Object(o.a)(c,2),l=r[0],d=r[1],b=Object(s.useState)(""),j=Object(o.a)(b,2),f=j[0],p=j[1],u=Object(s.useState)(""),m=Object(o.a)(u,2),h=m[0],x=m[1],g=Object(s.useState)(!0),O=Object(o.a)(g,2),v=O[0],y=O[1],C=Object(s.useState)(!1),w=Object(o.a)(C,2),S=w[0],k=w[1],N=n.name,I=n.lastName,T=n.mute,z=n.companionId,R=n._id;return Object(s.useEffect)((function(){var e=t.find((function(e){return e.number===n.number}));e&&d(e)}),[t,n.number]),Object(s.useEffect)((function(){p(N),x(I),y(!T)}),[N,I,T]),Object(a.jsxs)("div",{className:e.editBar,children:[S&&Object(a.jsx)(Jr,{handleSubmit:function(){v!==!T&&Object(ze.k)(z),f===N&&h===I||Object(ze.J)(l._id,R,f,h,z),S&&k(!1)}}),Object(a.jsx)(_r,{}),Object(a.jsx)(Vr,{chat:n,name:f,setName:p,lastName:h,setLastName:x,mute:v,setMute:y,openBtn:S,setOpenBtn:k}),Object(a.jsx)(qr,{isContact:l})]})},Zr=function(e){var t=e.rightIsOpen,n=e.chatDivRef;return Object(a.jsxs)(c.a,{item:!0,lg:t?4:0,children:["credentials"===t&&Object(a.jsx)(Yr,{chatDivRef:n}),"search"===t&&Object(a.jsx)(jr,{chatDivRef:n}),"edit"===t&&Object(a.jsx)(Xr,{})]})},ei=n(503),ti=n.n(ei),ni=n(504),oi=n.n(ni),ai=n(505),ci=n.n(ai),ri=n(507),ii=n.n(ri),si=n(506),li=n.n(si),di=n(470),bi=Object(r.a)({container:{position:"absolute",left:0,top:0,width:"100vw",height:"100vh",overflow:"hidden",zIndex:100,display:"flex",justifyContent:"center",alignItems:"center",alignContent:"center",backgroundColor:"rgba(104, 105, 104, 0.6)"},shareScreenActive:{width:"30%",borderRadius:7,margin:"auto",border:"solid 2px #0084ff"},shareScreenDisabled:{width:0,height:0},modalCall:{background:"rgb(36, 36, 36)",display:"flex",flexDirection:"column",justifyContent:"start",alignItems:"center",justifyItems:"center",width:"34vw",height:"90vh",borderRadius:7},rightIcons:{display:"flex",justifyContent:"end",alignContent:"center",alignItems:"center",width:"100%"},rightIconWrapper:{color:"#ffffff",cursor:"pointer",padding:"3px 10px 3px 10px","&:hover":{backgroundColor:"rgb(80, 80, 80)"}},rightIconWrapperClose:{color:"#ffffff",cursor:"pointer",padding:"3px 10px 3px 10px",borderTopRightRadius:7,"&:hover":{backgroundColor:"#f02a2a"}},bottomWrapper:{display:"flex",justifyContent:"center",padding:5},bottomItem:{display:"flex",flexDirection:"column",justifyContent:"center",alignContent:"center",alignItems:"center",cursor:"pointer",width:80},bottomIcon:{cursor:"pointer"},bottomIconEndAccept:{cursor:"pointer","&:hover":{animation:"$shake 1s",animationIterationCount:"infinite"}},ringPulsate:{backgroundColor:"rgb(80, 80, 80)",borderRadius:"50%",height:60,width:60,position:"absolute",left:10,top:-8,animation:"$pulsate 1.5s ease-out",animationIterationCount:"infinite",opacity:0},titleIconBottom:{color:"#ffffff",fontSize:13,paddingTop:7},"@keyframes pulsate":{"0%":{transform:"scale(1, 1)",opacity:0},"50%":{opacity:1},"100%":{transform:"scale(1.2, 1.2)",opacity:0}},"@keyframes shake":{"0%":{transform:"rotate(0deg)"},"11%":{transform:"rotate(10deg)"},"22%":{transform:"rotate(20deg)"},"33%":{transform:"rotate(30deg)"},"44%":{transform:"rotate(20deg)"},"55%":{transform:"rotate(10deg)"},"66%":{transform:"rotate(0deg)"},"77%":{transform:"rotate(-10deg)"},"88%":{transform:"rotate(-20deg)"},"100%":{transform:"rotate(-30deg)"}}}),ji=function(e){var t=e.callStatus,n=e.setCallStatus,c=e.socket,r=(e.myVideoRef,bi()),l=Object(i.c)(Bt.a)._id,d=Object(i.c)(Wt.a),b=(Object(s.useRef)(null),Object(s.useRef)(null),Object(s.useRef)(null)),j=Object(s.useRef)(null),f=Object(s.useState)(""),u=Object(o.a)(f,2),m=u[0],h=u[1],x=Object(s.useState)(""),g=Object(o.a)(x,2),O=g[0],v=g[1],C=Object(s.useState)(""),w=Object(o.a)(C,2),S=w[0],k=w[1],N=Object(s.useState)(""),I=Object(o.a)(N,2),T=I[0],z=I[1],R=Object(s.useState)(""),M=Object(o.a)(R,2),A=M[0],D=M[1],W=Object(s.useState)(""),B=Object(o.a)(W,2),P=B[0],Y=B[1],U=Object(s.useState)(""),_=Object(o.a)(U,2),H=_[0],$=_[1],V=Object(s.useState)(""),G=Object(o.a)(V,2),q=G[0],K=G[1],Q=function(){j.current.destroy(),n("")},X=Object(s.useCallback)(Object(Ie.a)(Ne.a.mark((function e(){var t,o;return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,navigator.mediaDevices.getUserMedia({video:!0,audio:!0});case 2:t=e.sent,(o=new di({initiator:!0,trickle:!1,stream:t})).on("signal",(function(e){c.emit("callTo",{to:d.socketId,signalData:e,from:m,userId:l,companionId:d.companionId}),n("ringing")})),o.on("stream",(function(e){console.log(e,"user stream")})),c.on("acceptedCall",(function(e){var t=e.signal;o.signal(t),n("accepted"),console.log(t,"signal accepted from companion")})),j.current=o;case 8:case"end":return e.stop()}}),e)}))),[d.socketId,d.companionId,l,c,n,m]),Z=Object(s.useCallback)(Object(Ie.a)(Ne.a.mark((function e(){var t,n;return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,navigator.mediaDevices.getUserMedia({video:!0,audio:!0});case 2:t=e.sent,(n=new di({initiator:!1,trickle:!1,stream:t})).on("signal",(function(e){c.emit("answerCall",{signal:e,to:O})})),n.on("stream",(function(e){b.current.srcObject=e})),n.signal(S),j.current=n;case 8:case"end":return e.stop()}}),e)}))),[c,O,S]);return Object(s.useEffect)((function(){c.on("me",(function(e){h(e),Object(ze.E)(e)})),c.on("incomeCall",(function(e){n("is calling you"),z(e.name),D(e.lastName),Y(e.avatarUrl),$(e.color),K(e.number),v(e.from),k(e.signal)}))}),[c,n,z,D,v,k]),Object(s.useEffect)((function(){"requesting"===t&&X()}),[t,X]),Object(s.useEffect)((function(){""===t&&(z(d.name),D(d.lastName),Y(d.avatarUrl),$(d.color),K(d.number))}),[t,d]),Object(a.jsx)("div",{className:r.container,style:{top:t?0:"-100%"},children:Object(a.jsxs)("div",{className:r.modalCall,children:[Object(a.jsxs)("div",{className:r.rightIcons,style:{marginBottom:0},children:[Object(a.jsx)("div",{className:r.rightIconWrapper,children:Object(a.jsx)(ti.a,{fontSize:"small"})}),Object(a.jsx)("div",{className:r.rightIconWrapper,children:Object(a.jsx)(oi.a,{fontSize:"small"})}),Object(a.jsx)("div",{className:r.rightIconWrapperClose,onClick:Q,children:Object(a.jsx)(y.a,{fontSize:"small"})})]}),Object(a.jsx)(J.a,{style:{marginBottom:5},children:Object(a.jsx)(p.a,{alt:T,src:P?"".concat(L.l,"/").concat(P):void 0,sx:{background:H,width:120,height:120,marginRight:2,fontSize:30,zIndex:0},children:"".concat(Object(L.e)(T)).concat(Object(L.e)(A))})}),Object(a.jsxs)("div",{style:{marginBottom:"auto"},children:[Object(a.jsx)(F.a,{primary:"".concat(Object(L.e)(T)).concat(Object(L.p)(T,15,1),"\n ").concat(Object(L.e)(A)).concat(Object(L.p)(A,15,1)),primaryTypographyProps:{color:"#dfdfdf",fontSize:20,fontWeight:500}}),Object(a.jsx)(F.a,{primary:q,primaryTypographyProps:{color:"#ffffff",fontSize:15,fontWeight:500,textAlign:"center"}}),Object(a.jsx)(F.a,{secondary:t+"...",secondaryTypographyProps:{color:"#dfdfdf",textAlign:"center"}})]}),Object(a.jsx)("video",{className:r.shareScreenActive,ref:b,playsInline:!0,autoPlay:!0}),Object(a.jsxs)("div",{className:r.bottomWrapper,children:[!1,Object(a.jsxs)("div",{className:r.bottomItem,children:[Object(a.jsx)(p.a,{className:r.bottomIcon,sx:{backgroundColor:"rgb(88, 88, 88)",color:"#ffffff",width:44,height:44,zIndex:0},children:Object(a.jsx)(ci.a,{fontSize:"medium"})}),Object(a.jsx)(E.a,{variant:"h6",className:r.titleIconBottom,children:"Stop Video"})]}),Object(a.jsxs)("div",{className:r.bottomItem,children:[Object(a.jsx)(p.a,{className:r.bottomIconEndAccept,onClick:Q,sx:{backgroundColor:"#f02a2a",color:"#ffffff",width:44,height:44,zIndex:0},children:Object(a.jsx)(li.a,{fontSize:"medium"})}),Object(a.jsx)(E.a,{variant:"h6",className:r.titleIconBottom,children:"is calling you"===t?"Decline":"End Call"})]}),"is calling you"===t&&Object(a.jsxs)("div",{className:r.bottomItem,style:{position:"relative"},children:[Object(a.jsx)("div",{className:r.ringPulsate}),Object(a.jsx)(p.a,{className:r.bottomIconEndAccept,onClick:Z,sx:{backgroundColor:"#21f519",color:"#ffffff",width:44,height:44,zIndex:0},children:Object(a.jsx)(Wn.a,{fontSize:"medium"})}),Object(a.jsx)(E.a,{variant:"h6",className:r.titleIconBottom,children:"Accept"})]}),Object(a.jsxs)("div",{className:r.bottomItem,children:[Object(a.jsx)(p.a,{className:r.bottomIcon,sx:{backgroundColor:"rgb(88, 88, 88)",color:"#ffffff",width:44,height:44,zIndex:0},children:Object(a.jsx)(ii.a,{fontSize:"medium"})}),Object(a.jsx)(E.a,{variant:"h6",className:r.titleIconBottom,children:"Mute"})]})]})]})})},fi=n.p+"static/media/wallpaper.8f0d1af7.jpg",pi=n.p+"static/media/wallpaperNight.63a4f24a.jpg",ui=Object(l.a)(L.n),mi=Object(r.a)({container:{minHeight:"100vh",maxHeight:"100vh"},centralAndRight:{display:"flex"},myVideo:{width:250,height:"auto",cursor:"pointer",position:"absolute",top:0,left:0,zIndex:150,backgroundColor:"#28e217"}});t.default=function(){var e=mi(),t=Object(i.c)(We),n=Object(s.useRef)(null),r=Object(s.useRef)(null),l=Object(i.c)(Bt.b),b=Object(i.c)(Wt.b).companionId,j=Object(s.useState)(""),f=Object(o.a)(j,2),p=f[0],u=f[1],m="url(".concat(l?pi:fi,")");return Object(a.jsxs)(c.a,{className:e.container,container:!0,spacing:0,children:[Object(a.jsx)("video",{className:e.myVideo,ref:n,playsInline:!0,autoPlay:!0,muted:!0}),Object(a.jsx)(d.a,{target:n.current,draggable:!0,throttleDrag:0,hideDefaultLines:!0,renderDirections:[],rotationPosition:"none",origin:!1,onDrag:function(e){var t=e.target,n=e.transform;return t.style.transform=n}}),Object(a.jsx)(ji,{callStatus:p,setCallStatus:u,socket:ui,myVideoRef:n}),Object(a.jsx)(ao,{chatDivRef:r}),b?Object(a.jsxs)(c.a,{item:!0,lg:9,className:e.centralAndRight,children:[Object(a.jsx)(nr,{rightIsOpen:t,chatDivRef:r,companionId:b,backgroundImage:m,handleStartCall:function(){return u("requesting")}}),Object(a.jsx)(Zr,{rightIsOpen:t,chatDivRef:r})]}):Object(a.jsx)(c.a,{item:!0,lg:9,style:{backgroundImage:m}})]})}}}]); //# sourceMappingURL=HomePage.fc85d94f.chunk.js.map