HomePage.64718e77.chunk.js 149 KB

12
  1. (this["webpackJsonpreact-21-22"]=this["webpackJsonpreact-21-22"]||[]).push([[2],{491:function(e,t,n){"use strict";n.r(t);var o=n(7),a=n(506),r=n(140),c=n(0),i=n(19),s=n(21),l=n(14),d=n(474),b=n(142),j=n(507),u=n(495),p=n(516),f=n(269),x=n.n(f),h=n(268),m=n.n(h),g=n(207),O=n.n(g),v=n(237),y=n.n(v),C=Object(b.a)((function(e){return Object(o.jsx)(u.a,Object(l.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)}}}}})),w=Object(d.a)({container:{position:"absolute",maxWidth:"100%",top:"92vh",right:20,zIndex:10,cursor:"pointer"}}),k=function(e){var t=e.handleSelectedMenu,n=e.setIsMenuSm,a=w(),i=Object(c.useState)(null),s=Object(r.a)(i,2),l=s[0],d=s[1],b=Boolean(l),u=function(){n(!1),d(null)};return Object(o.jsxs)("div",{className:a.container,children:[Object(o.jsx)(j.a,{onClick:function(e){return d(e.currentTarget)},sx:{bgcolor:"rgb(41, 139, 231)",width:56,height:56},children:l?Object(o.jsx)(O.a,{}):Object(o.jsx)(m.a,{})}),Object(o.jsxs)(C,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:l,open:b,onClose:u,children:[Object(o.jsxs)(p.a,{onClick:function(){u(),t(3)},children:[Object(o.jsx)(y.a,{}),"New Contact"]}),Object(o.jsxs)(p.a,{onClick:function(){u(),t(1)},children:[Object(o.jsx)(x.a,{}),"Contacts"]})]})]})},N=n(514),S=n(484),I=n(478),z=n(51),R=Object(d.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}}),A=function(e){var t=e.handleListItemClick,n=e.chat,a=R(),r=n.name,c=n.lastName,i=n.color,s=n.avatarUrl,l=n.companionId;return Object(o.jsxs)("div",{onClick:function(){return t(l)},className:a.stackItem,children:[Object(o.jsx)(j.a,{alt:r,src:s?"".concat(z.j,"/").concat(s):void 0,sx:{background:i,width:54,height:54},children:"".concat(Object(z.c)(r)).concat(Object(z.c)(c))}),Object(o.jsx)(I.a,{variant:"h6",className:a.titleName,children:"".concat(Object(z.c)(r)).concat(Object(z.l)(r,8,1))})]})},D=n(480),M=n(482),B=n(481),T=Object(d.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"}}),E=function(e){var t=e.chat,n=e.handleListItemClick,a=T(),r=t.name,c=t.lastName,i=t.avatarUrl,s=t.color,l=t.companionId,d=t.lastMessage,b=t.lastMessageCreatedAt,u=t.createdAt;return Object(o.jsxs)(D.a,{onClick:function(){return n(l)},children:[Object(o.jsx)(B.a,{className:a.listItem_iconAvatar,children:Object(o.jsx)(j.a,{alt:r,src:i?"".concat(z.j,"/").concat(i):void 0,sx:{background:s,width:54,height:54},children:!i&&"".concat(Object(z.c)(r)).concat(Object(z.c)(c))})}),Object(o.jsx)(M.a,{primary:"".concat(Object(z.c)(r)).concat(Object(z.l)(r,15,1)," \n ").concat(Object(z.c)(c)).concat(Object(z.l)(c,15,1)),secondary:"".concat(d?Object(z.l)(d,35):"".concat(Object(z.c)(r)).concat(Object(z.l)(r,8,1)," joined Telegram"))}),Object(o.jsx)(B.a,{className:a.listItem_iconRight,children:Object(o.jsx)(I.a,{className:a.listItem_icon_time,variant:"h6",color:"initial",children:Object(z.n)(b||u)})})]})},L=n(497),W=n(522),_=function(e){var t=e.name;return Object(o.jsx)(S.a,{sx:{width:"100%"},spacing:2,children:Object(o.jsxs)(L.a,{severity:"info",children:[Object(o.jsx)(W.a,{children:"Warning"}),Object(o.jsx)("strong",{children:t})]})})},F=Object(d.a)({stack:{display:"flex",justifyContent:"space-around",paddingTop:20},container:{width:"100%",maxHeight:"86vh",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"}}}),P=function(e){var t=e.value,n=e.date,a=e.filteredAndSorted,r=e.handleListItemClick,c=F();return Object(o.jsxs)(o.Fragment,{children:[!t&&!n&&a.length>0&&Object(o.jsx)(S.a,{direction:"row",className:c.stack,children:a.slice(0,6).map((function(e){return Object(o.jsx)(A,{handleListItemClick:r,chat:e},e.companionId)}))}),(t||n)&&a.length>0&&Object(o.jsx)(N.a,{className:c.container,component:"nav","aria-label":"main mailbox folders",children:a.map((function(e){return Object(o.jsx)(E,{handleListItemClick:r,chat:e},e.companionId)}))}),(t||n)&&0===a.length&&Object(o.jsx)(_,{name:"Can not find Chat by request: ".concat(t)}),!t&&!n&&0===a.length&&Object(o.jsx)(_,{name:"You do not have any Chats yet!"})]})},Y=n(505),H=n(523),U=n(238),V=n.n(U),q=n(485),G=Object(d.a)({container:{width:"100%",maxHeight:"86vh",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"}},folderIcon:{color:"#54b0fc",cursor:"pointer","&:hover":{color:"#016cc3"}},listItem:{"&:hover":{backgroundColor:"#f0f0f0"}}}),Z=function(e){var t=e.messagesMemo,n=e.value,a=e.date,r=e.sort,i=e.setDisabled,s=G(),l=t.filter((function(e){return"text"!==e.type})),d=Object(z.b)(Object(z.f)("createdAt",l,r),a,n);return Object(c.useEffect)((function(){i(!(l.length>0))}),[l,i]),Object(o.jsxs)(o.Fragment,{children:[d.length>0&&Object(o.jsx)(N.a,{className:s.container,children:d.map((function(e){var t=e.message,n=e.createdAt,a=e.fullType;return Object(o.jsxs)("div",{children:[Object(o.jsxs)(Y.a,{alignItems:"flex-start",className:s.listItem,children:[Object(o.jsx)(H.a,{children:Object(o.jsx)(V.a,{onClick:function(){return Object(z.e)("".concat(z.j,"/").concat(t),a)},className:s.folderIcon,fontSize:"large"})}),Object(o.jsx)(M.a,{primary:a,secondary:Object(z.n)(n)})]}),Object(o.jsx)(q.a,{variant:"inset"})]},n)}))}),(n||a)&&0===d.length&&Object(o.jsx)(_,{name:"Can not find Files by request: ".concat(n)}),!n&&!a&&0===d.length&&Object(o.jsx)(_,{name:"You do not have Files yet!"})]})},$=n(524),K=n(525),J=n(208),X=n.n(J),Q=Object(d.a)({overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden",boxSizing:"border-box",display:"flex",justifyContent:"center",alignContent:"center",alignItems:"center"},wrapper:{width:"30%",maxHeight:"80%",position:"relative",display:"flex"},downloadIcon:{position:"absolute",content:"",right:0,top:-40,cursor:"pointer",color:"#e9e7e7",padding:0,borderRadius:"50%","&:hover":{backgroundColor:"#ffffff",color:"#b8b7b7"}},img:{cursor:"pointer","&:hover":{scale:.98}},time:{position:"absolute",content:"",color:"#ffffff",top:-30,left:0,borderRadius:10,padding:"2px 6px 2px 6px",backgroundColor:"#707070"}}),ee=function(e){var t=e.message,n=e.fullType,a=e.updatedAt,i=Q(),s=Object(c.useState)(!1),l=Object(r.a)(s,2),d=l[0],b=l[1],j="".concat(z.j,"/").concat(t);return d?Object(o.jsx)("div",{onClick:function(e){return"overlay"===e.target.id&&d&&b(!1)},id:"overlay",className:i.overlay,children:Object(o.jsxs)("div",{className:i.wrapper,children:[Object(o.jsx)("span",{className:i.time,children:Object(z.n)(a)}),Object(o.jsx)(X.a,{className:i.downloadIcon,fontSize:"large",onClick:function(){return Object(z.e)(j,n)}}),Object(o.jsx)("img",{width:"100%",height:"auto",alt:"imageItem",src:j})]})}):Object(o.jsx)(K.a,{children:Object(o.jsx)("img",{onClick:function(){return!d&&b(!0)},className:i.img,src:"".concat(j,"?w=164&h=164&fit=crop&auto=format"),srcSet:"".concat(j,"?w=164&h=164&fit=crop&auto=format&dpr=2 2x"),alt:"imageItem",loading:"lazy"})})},te=Object(d.a)({container:{width:"100%",maxHeight:"86vh",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"}}}),ne=function(e){var t=e.messagesMemo,n=e.value,a=e.date,r=e.sort,i=e.setDisabled,s=te(),l=t.filter((function(e){return"image"===e.type})),d=Object(z.b)(Object(z.f)("createdAt",l,r),a,n);return Object(c.useEffect)((function(){i(!(l.length>0))}),[l,i]),Object(o.jsxs)(o.Fragment,{children:[d.length>0&&Object(o.jsx)($.a,{className:s.container,cols:3,rowHeight:164,children:d.map((function(e){var t=e.message,n=e.createdAt,a=e.fullType,r=e.updatedAt;return Object(o.jsx)(ee,{message:t,fullType:a,updatedAt:r},n)}))}),(n||a)&&0===d.length&&Object(o.jsx)(_,{name:"Can not find Media by request: ".concat(n)}),!n&&!a&&0===d.length&&Object(o.jsx)(_,{name:"You do not have Media yet!"})]})},oe=n(165),ae=n.n(oe),re=n(160),ce=Object(d.a)({container:{width:"100%",maxHeight:"86vh",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:{"&:hover":{backgroundColor:"#f0f0f0"}},copyIcon:{color:"#54b0fc",cursor:"pointer","&:hover":{color:"#016cc3"}}}),ie=function(e){var t=e.messagesMemo,n=e.value,a=e.date,r=e.sort,i=e.setDisabled,s=ce(),l=t.filter((function(e){return"text"===e.type})),d=Object(z.b)(Object(z.f)("createdAt",l,r),a,n);return Object(c.useEffect)((function(){i(!(l.length>0))}),[l,i]),Object(o.jsxs)(o.Fragment,{children:[d.length>0&&Object(o.jsx)(N.a,{className:s.container,children:d.map((function(e){var t=e.message,n=e.createdAt,a=e.lastName,r=e.name,c=e.color,i=e.avatarUrl;return Object(o.jsxs)("div",{children:[Object(o.jsxs)(Y.a,{alignItems:"flex-start",className:s.listItem,children:[Object(o.jsx)(H.a,{children:Object(o.jsx)(j.a,{alt:r,src:i?"".concat(z.j,"/").concat(i):void 0,sx:{background:c,width:38,height:38},children:"".concat(Object(z.c)(r)).concat(Object(z.c)(a))})}),Object(o.jsx)(M.a,{style:{wordBreak:"break-word",marginRight:2},primary:t,secondary:Object(z.n)(n),secondaryTypographyProps:{color:"#020202",paddingTop:.5}}),Object(o.jsx)(re.CopyToClipboard,{onCopy:function(){return Object(z.a)("Message")},text:t,children:Object(o.jsx)(ae.a,{className:s.copyIcon,fontSize:"large"})})]}),Object(o.jsx)(q.a,{variant:"inset"})]},n)}))}),(n||a)&&0===d.length&&Object(o.jsx)(_,{name:"Can not find Text by request: ".concat(n)}),!n&&!a&&0===d.length&&Object(o.jsx)(_,{name:"You do not have Text yet!"})]})},se=n(271),le=n.n(se),de=Object(d.a)({container:{width:"100%",maxHeight:"86vh",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"}},folderIcon:{color:"#54b0fc",cursor:"pointer","&:hover":{color:"#016cc3"}},listItem:{"&:hover":{backgroundColor:"#f0f0f0"}}}),be=function(e){var t=e.messagesMemo,n=e.value,a=e.date,r=e.sort,i=e.setDisabled,s=de(),l=t.filter((function(e){return"audio"===e.type})),d=Object(z.b)(Object(z.f)("createdAt",l,r),a,n);return Object(c.useEffect)((function(){i(!(l.length>0))}),[l,i]),Object(o.jsxs)(o.Fragment,{children:[d.length>0&&Object(o.jsx)(N.a,{className:s.container,children:d.map((function(e){var t=e.message,n=e.createdAt,a=e.fullType;return Object(o.jsxs)("div",{children:[Object(o.jsxs)(Y.a,{alignItems:"flex-start",className:s.listItem,children:[Object(o.jsx)(H.a,{children:Object(o.jsx)(le.a,{onClick:function(){return Object(z.e)("".concat(z.j,"/").concat(t),a)},className:s.folderIcon,fontSize:"large"})}),Object(o.jsx)(M.a,{primary:a,secondary:Object(z.n)(n)})]}),Object(o.jsx)(q.a,{variant:"inset"})]},n)}))}),(n||a)&&0===d.length&&Object(o.jsx)(_,{name:"Can not find Audio by request: ".concat(n)}),!n&&!a&&0===d.length&&Object(o.jsx)(_,{name:"You do not have Audio yet!"})]})},je=n(272),ue=n.n(je),pe=Object(d.a)({container:{width:"100%",maxHeight:"86vh",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"}},folderIcon:{color:"#54b0fc",cursor:"pointer","&:hover":{color:"#016cc3"}},listItem:{"&:hover":{backgroundColor:"#f0f0f0"}}}),fe=function(e){var t=e.messagesMemo,n=e.value,a=e.date,r=e.sort,i=e.setDisabled,s=pe(),l=t.filter((function(e){return"video"===e.type})),d=Object(z.b)(Object(z.f)("createdAt",l,r),a,n);return Object(c.useEffect)((function(){i(!(l.length>0))}),[l,i]),Object(o.jsxs)(o.Fragment,{children:[d.length>0&&Object(o.jsx)(N.a,{className:s.container,children:d.map((function(e){var t=e.message,n=e.createdAt,a=e.fullType;return Object(o.jsxs)("div",{children:[Object(o.jsxs)(Y.a,{alignItems:"flex-start",className:s.listItem,children:[Object(o.jsx)(H.a,{children:Object(o.jsx)(ue.a,{onClick:function(){return Object(z.e)("".concat(z.j,"/").concat(t),a)},className:s.folderIcon,fontSize:"large"})}),Object(o.jsx)(M.a,{primary:a,secondary:Object(z.n)(n)})]},n),Object(o.jsx)(q.a,{variant:"inset"})]},n)}))}),(n||a)&&0===d.length&&Object(o.jsx)(_,{name:"Can not find Video by request: ".concat(n)}),!n&&!a&&0===d.length&&Object(o.jsx)(_,{name:"You do not have Video yet!"})]})},xe=n(1),he=n.n(xe),me=n(5),ge=n(43),Oe=n(16),ve=n(45),ye=function(){return function(){var e=Object(me.a)(he.a.mark((function e(t){var n;return he.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(Oe.f)();case 3:(n=e.sent)&&t(Object(ve.b)(n)),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),t(Object(ve.a)());case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}()},Ce=n(25),we=Object(Ce.a)([function(e){return e.chats}],(function(e){return e})),ke=Object(Ce.a)([function(e){return e.allMessages.messages}],(function(e){return e})),Ne=function(e){return e.control.rightIsOpen},Se=function(e){return e.control.scrollChat},Ie=function(e){return e.control},ze=n(32),Re=function(e){return function(){var t=Object(me.a)(he.a.mark((function t(n){var o;return he.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Object(Oe.y)(e);case 3:(o=t.sent)&&n(Object(ze.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)}}()},Ae=n(29),De=Object(d.a)({container:{height:"7vh",borderBottom:"solid 2px #dddddd",display:"flex",justifyContent:"space-around",alignContent:"center",alignItems:"center",flexWrap:"nowrap",color:"rgba(0, 0, 0, 0.6)"},item:{height:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignContent:"center",alignItems:"center",cursor:"pointer"},icon:{fontSize:"1rem",lineHeight:0,marginBottom:0,fontWeight:600},underline:{fontSize:"2.2rem",lineHeight:0}}),Me=function(e){var t=e.value,n=e.setValue,a=e.sort,s=e.date,l=e.setDate,d=e.setDisabled,b=De(),j=Object(i.b)(),u=Object(i.c)(we),p=u.chats,f=u.total,x=Object(i.c)(ke),h=Object(i.c)(Ie),m=h.leftIsOpen,g=h.rightIsOpen,O=Object(c.useState)(0),v=Object(r.a)(O,2),y=v[0],C=v[1],w=function(e){C(e),t&&n(""),s&&l("")};Object(c.useEffect)((function(){l("")}),[l]),Object(c.useEffect)((function(){j(0===y?Object(Ae.a)("chats"):Object(Ae.a)("allMessages"))}),[y,j]),Object(c.useEffect)((function(){0===y&&d("0"===f)}),[y,f,d]),Object(c.useEffect)((function(){var e=function(){"chats"===m?j(ye()):"allMessages"===m&&j(function(){var e=Object(me.a)(he.a.mark((function e(t){var n;return he.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(Oe.d)();case 3:(n=e.sent)&&t(Object(ge.b)(n)),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),t(Object(ge.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,z.k);return function(){return clearInterval(t)}}),[m,j]);var k=Object(z.m)(p,a).filter((function(e){var n=e.name+" "+e.lastName;return s?n.toLowerCase().includes(t.toLowerCase())&&Object(z.o)(s)===Object(z.o)(e.lastMessageCreatedAt?e.lastMessageCreatedAt:e.createdAt)?e:void 0:n.toLowerCase().includes(t.toLowerCase())}));return Object(o.jsxs)(o.Fragment,{children:[Object(o.jsxs)("div",{className:b.container,children:[Object(o.jsxs)("div",{className:b.item,style:{color:0===y?"#1976d2":"rgba(0, 0, 0, 0.6)"},onClick:function(){return w(0)},children:[Object(o.jsx)("span",{className:b.icon,children:"Chats"}),Object(o.jsx)("span",{className:b.underline,children:"___"})]}),Object(o.jsxs)("div",{className:b.item,style:{color:1===y?"#1976d2":"rgba(0, 0, 0, 0.6)"},onClick:function(){return w(1)},children:[Object(o.jsx)("span",{className:b.icon,children:"Files"}),Object(o.jsx)("span",{className:b.underline,children:"___"})]}),Object(o.jsxs)("div",{className:b.item,style:{color:2===y?"#1976d2":"rgba(0, 0, 0, 0.6)"},onClick:function(){return w(2)},children:[Object(o.jsx)("span",{className:b.icon,children:"Media"}),Object(o.jsx)("span",{className:b.underline,children:"___"})]}),Object(o.jsxs)("div",{className:b.item,style:{color:3===y?"#1976d2":"rgba(0, 0, 0, 0.6)"},onClick:function(){return w(3)},children:[Object(o.jsx)("span",{className:b.icon,children:"Text"}),Object(o.jsx)("span",{className:b.underline,children:"___"})]}),Object(o.jsxs)("div",{className:b.item,style:{color:4===y?"#1976d2":"rgba(0, 0, 0, 0.6)"},onClick:function(){return w(4)},children:[Object(o.jsx)("span",{className:b.icon,children:"Audio"}),Object(o.jsx)("span",{className:b.underline,children:"___"})]}),Object(o.jsxs)("div",{className:b.item,style:{color:5===y?"#1976d2":"rgba(0, 0, 0, 0.6)"},onClick:function(){return w(5)},children:[Object(o.jsx)("span",{className:b.icon,children:"Video"}),Object(o.jsx)("span",{className:b.underline,children:"___"})]})]}),0===y&&Object(o.jsx)(P,{value:t,date:s,filteredAndSorted:k,handleListItemClick:function(e){g&&j(Object(Ae.b)("")),j(Re(e))}}),1===y&&Object(o.jsx)(Z,{messagesMemo:x,value:t,date:s,sort:a,setDisabled:d}),2===y&&Object(o.jsx)(ne,{messagesMemo:x,value:t,date:s,sort:a,setDisabled:d}),3===y&&Object(o.jsx)(ie,{messagesMemo:x,value:t,date:s,sort:a,setDisabled:d}),4===y&&Object(o.jsx)(be,{messagesMemo:x,value:t,date:s,sort:a,setDisabled:d}),5===y&&Object(o.jsx)(fe,{messagesMemo:x,value:t,date:s,sort:a,setDisabled:d})]})},Be=n(518),Te=n(517),Ee=n(366),Le=n.n(Ee),We=n(241),_e=n.n(We),Fe=n(502),Pe=n(200),Ye=n.n(Pe),He=n(519),Ue=n(282),Ve=n.n(Ue),qe=n(492),Ge=Object(d.a)({container:{position:"absolute"}}),Ze=function(e){var t=e.date,n=e.disabled,a=e.changeDate,r=e.handleOnOpen,c=Ge();return Object(o.jsx)(qe.a,{className:c.container,inputVariant:"outlined",orientation:"portrait",variant:"dialog",openTo:"date",autoOk:!0,disabled:n,value:t||new Date,onOpen:r,onChange:a})},$e=Object(b.a)("div")((function(e){e.theme;return{position:"relative",borderRadius:"20px",backgroundColor:"#f1f0f0",width:"100%",margin:"0 5% 0 5%"}})),Ke=Object(b.a)("div")((function(e){return{padding:e.theme.spacing(0,2),height:"100%",position:"absolute",pointerEvents:"none",display:"flex",alignItems:"center",justifyContent:"center"}})),Je=Object(b.a)(Fe.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%"}}})),Xe=Object(d.a)({toolBar:{color:"#b1aeae",height:"7vh"},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 "}}}),Qe={inputProps:{"aria-label":"Switch demo"}},et=function(e){var t=e.handleClick,n=e.handleOpenIsSearch,a=e.handleSearch,r=e.isSearch,c=e.value,i=e.sort,s=e.setDate,d=e.date,b=e.disabled,j=Xe();return Object(o.jsxs)(Be.a,{className:j.toolBar,children:[Object(o.jsx)(Te.a,{onClick:t,children:r?Object(o.jsx)(Ye.a,{className:j.iconArrow}):Object(o.jsx)(Le.a,{className:j.iconBtn})}),Object(o.jsxs)("div",{onFocus:n,style:{display:"flex",width:"100%"},children:[Object(o.jsxs)($e,{className:c?j.activeSearch:void 0,children:[Object(o.jsx)(Ke,{children:Object(o.jsx)(_e.a,{})}),Object(o.jsx)(Je,{value:c,onChange:a,placeholder:b?"Disabled":"Search",inputProps:{"aria-label":"search"},disabled:b})]}),Object(o.jsxs)(Te.a,{"aria-label":"delete",size:"medium",disabled:b,children:[Object(o.jsx)(Ze,{date:d,disabled:b,changeDate:s,handleOnOpen:function(){return s("")}}),Object(o.jsx)(Ve.a,{fontSize:"medium",style:{color:d?"#2184f7":"#b1aeae"}})]}),Object(o.jsx)(He.a,Object(l.a)(Object(l.a)({onClick:function(){return Object(Oe.C)({sort:!i})},checked:i},Qe),{},{disabled:b}))]})]})},tt=n(284),nt=n.n(tt),ot=n(283),at=n.n(ot),rt=n(161),ct=n.n(rt),it=n(498),st=n(367),lt=n.n(st),dt=n(508),bt=Object(d.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"}}),jt=function(e){var t=e.setModal,n=e.chat,a=bt(),r=n.name,c=n.lastName,i=n.avatarUrl,s=n.color,l=n.companionId;return Object(o.jsx)("div",{onClick:function(e){var n=e.target.id;if("overlay"===n||"cancel"===n)return t(!1);"delete"===n&&(Object(Oe.m)(l),t(!1))},className:a.overlay,id:"overlay",children:Object(o.jsxs)("div",{className:a.modalDelete,children:[Object(o.jsxs)("div",{className:a.titleWrapper,children:[Object(o.jsx)(j.a,{alt:r,src:i?"".concat(z.j,"/").concat(i):void 0,sx:{background:s,width:38,height:38,marginRight:2},children:"".concat(Object(z.c)(r)).concat(Object(z.c)(c))}),Object(o.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete chat"})]}),Object(o.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete the\n chat with ".concat("".concat(Object(z.c)(r)).concat(Object(z.l)(r,15,1)," \n ").concat(Object(z.c)(c)).concat(Object(z.l)(c,15,1)),"?")}),Object(o.jsx)(dt.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE CHAT"}),Object(o.jsx)(dt.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})},ut=Object(b.a)((function(e){return Object(o.jsx)(u.a,Object(l.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)}}}}})),pt=Object(b.a)(it.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}}}})),ft=Object(d.a)({listItemInnerText:{display:"flex",alignContent:"center",alignItems:"center",flexWrap:"nowrap"},listItemInnerText__icon:{marginLeft:5,color:"#959595"},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:{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:"auto","&:hover":{outline:"solid 3px #3ee415"}},listItem_iconRightBtnMute:{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:"auto","&:hover":{outline:"solid 3px #cccbcb"}},listItem_iconRightBtnHidden:{background:"inherit",borderRadius:"50%",border:"none",height:24,width:24,textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center",alignContent:"center",fontSize:12,marginLeft:"auto"},listItem_icon_time:{fontSize:12,marginLeft:5,color:"#1b1b1b"},listItem_typing:{color:"#4d4d4d",animation:"ripple 4s infinite ease-in-out"},listItem_dots:{color:"#1b1b1b",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)"}}}),xt=function(e){var t=e.chat,n=e.handleListItemClick,a=e.handleNewMsgs,i=ft(),s=Object(c.useState)(null),l=Object(r.a)(s,2),d=l[0],b=l[1],u=Object(c.useState)(!1),f=Object(r.a)(u,2),x=f[0],h=f[1],m=Object(c.useState)(!1),g=Object(r.a)(m,2),O=g[0],v=g[1],y=Boolean(d),C=t.name,w=t.lastName,k=t.avatarUrl,N=t.color,S=t.companionId,R=t.mute,A=t.seen,T=t.total,E=t.watched,L=t.typing,W=t.online,_=t.lastMessage,F=t.lastMessageCreatedAt,P=t.createdAt,Y=function(e){"mute"===e&&Object(Oe.k)(S),"delete"===e&&v(!0),b(null),h(!1)};return Object(o.jsxs)("div",{children:[O&&Object(o.jsx)(jt,{setModal:v,chat:t}),Object(o.jsxs)(D.a,{selected:x,onClick:function(){return n(S)},onContextMenu:function(e){return function(e){e.preventDefault(),b(e.currentTarget),h(!0)}(e)},children:[Object(o.jsx)(B.a,{className:i.listItem_iconAvatar,children:Object(o.jsx)(pt,{overlap:"circular",variant:"true"===W?"dot":"standard",anchorOrigin:{vertical:"bottom",horizontal:"right"},children:Object(o.jsx)(j.a,{alt:C,src:k?"".concat(z.j,"/").concat(k):void 0,sx:{background:N,width:54,height:54},children:!k&&"".concat(Object(z.c)(C)).concat(Object(z.c)(w))})})}),Object(o.jsx)(M.a,{primary:Object(o.jsxs)("div",{className:i.listItemInnerText,children:[Object(o.jsx)("span",{children:"".concat(Object(z.c)(C)).concat(Object(z.l)(C,15,1)," \n ").concat(Object(z.c)(w)).concat(Object(z.l)(w,15,1))}),R&&Object(o.jsx)(at.a,{className:i.listItemInnerText__icon,fontSize:"small"})]}),secondary:L?Object(o.jsxs)("span",{className:i.listItem_typing,children:["typing",Object(o.jsx)("span",{className:i.listItem_dots,children:"..."})]}):_?Object(z.l)(_,35):"".concat(Object(z.c)(C)).concat(Object(z.l)(C,8,1)," joined Telegram")}),Object(o.jsxs)(B.a,{className:i.listItem_iconRight,children:[Object(o.jsxs)("div",{className:i.listItem_iconTimeChecked,children:[E&&Object(o.jsx)(lt.a,{style:{color:"#18bd03"},fontSize:"small"}),Object(o.jsx)(I.a,{className:i.listItem_icon_time,variant:"h6",color:"initial",children:Object(z.n)(F||P)})]}),_&&T>A?Object(o.jsx)("button",{onClick:function(e){return a(e,S)},className:R?i.listItem_iconRightBtnMute:i.listItem_iconRightBtn,children:T-A}):Object(o.jsx)("button",{className:i.listItem_iconRightBtnHidden})]})]}),Object(o.jsxs)(ut,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:d,open:y,onClose:Y,children:[Object(o.jsxs)(p.a,{onClick:function(){return Y("mute")},children:[R?Object(o.jsx)(nt.a,{}):Object(o.jsx)(at.a,{}),R?"Unmute chat":"Mute chat"]}),Object(o.jsxs)(p.a,{style:{color:"#f02a2a"},onClick:function(){return Y("delete")},children:[Object(o.jsx)(ct.a,{style:{color:"#f02a2a"}}),"Delete chat"]})]})]})},ht=n(52),mt=Object(d.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"}}}),gt=function(e){var t=e.sort,n=mt(),a=Object(i.b)(),r=Object(c.useRef)(null),s=Object(i.c)(we),l=s.total,d=s.chats,b=Object(i.c)(ht.b),j=Object(i.c)(Ie),u=j.leftIsOpen,p=j.rightIsOpen,f=function(e){p&&a(Object(Ae.b)("")),a(Re(e))},x=function(e,t){e.stopPropagation(),a(Object(Ae.c)(!0)),p&&a(Object(Ae.b)("")),a(Re(t))},h=Object(c.useCallback)((function(e){a(Re(e)),a(Object(Ae.c)(!0))}),[a]),m=Object(z.m)(d,t);return Object(c.useEffect)((function(){a(Object(Ae.a)("chats"))}),[a]),Object(c.useEffect)((function(){var e=function(){return"chats"===u&&a(ye())};e();var t=setInterval(e,z.k);return function(){return clearInterval(t)}}),[u,a]),Object(c.useEffect)((function(){b.companionId&&!m.find((function(e){return e.companionId===b.companionId}))&&a(Object(ze.b)()),r.current&&r.current.forEach((function(e,t){var n=e.total-e.seen,o=m[t];void 0!==o&&(o.total-o.seen>n&&!o.mute&&(Object(z.i)("".concat(z.j,"/receive.mp3")),Object(z.g)(o.name,(function(){return h(o.companionId)}))))})),r.current=m}),[b,m,h,a]),"0"!==l?Object(o.jsx)(N.a,{className:n.list,component:"nav","aria-label":"main mailbox folders",children:m.map((function(e){return Object(o.jsx)(xt,{chat:e,handleListItemClick:f,handleNewMsgs:x},e.number)}))}):Object(o.jsx)(_,{name:"You do not have Chats yet!"})},Ot=n(512),vt=n(513),yt=n(368),Ct=n.n(yt),wt=n(369),kt=n.n(wt),Nt=n(370),St=n.n(Nt),It=n(371),zt=n.n(It),Rt=n(37),At=Object(d.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}}),Dt={inputProps:{"aria-label":"Switch demo"}},Mt=function(e){var t=e.handleSelectedMenu,n=e.nightMode,a=At(),r=Object(i.b)();return Object(c.useEffect)((function(){var e=function(){return r(Object(Rt.b)())};e();var t=setInterval(e,z.k);return function(){return clearInterval(t)}}),[r]),Object(o.jsx)("div",{className:a.overlay,id:"overlay",children:Object(o.jsx)(Ot.a,{className:a.container,children:Object(o.jsxs)(vt.a,{className:a.list,children:[Object(o.jsxs)(p.a,{onClick:function(){return t(3)},children:[Object(o.jsx)(B.a,{className:a.listIcon,children:Object(o.jsx)(y.a,{fontSize:"medium"})}),Object(o.jsx)(M.a,{children:"New Contact"})]}),Object(o.jsxs)(p.a,{onClick:function(){return t(1)},children:[Object(o.jsx)(B.a,{className:a.listIcon,children:Object(o.jsx)(x.a,{fontSize:"medium"})}),Object(o.jsx)(M.a,{children:"Contacts"})]}),Object(o.jsxs)(p.a,{onClick:function(){return t(2)},children:[Object(o.jsx)(B.a,{className:a.listIcon,children:Object(o.jsx)(Ct.a,{fontSize:"medium"})}),Object(o.jsx)(M.a,{children:"Settings"})]}),Object(o.jsxs)(p.a,{style:{cursor:"default"},children:[Object(o.jsx)(B.a,{className:a.listIcon,children:Object(o.jsx)(kt.a,{fontSize:"medium"})}),Object(o.jsx)(M.a,{children:"Night Mode"}),Object(o.jsx)(He.a,Object(l.a)(Object(l.a)({onClick:function(){return Object(Oe.C)({nightMode:!n})},checked:n},Dt),{},{style:{cursor:"pointer"}}))]}),Object(o.jsx)("a",{style:{textDecoration:"none",color:"inherit"},target:"blank",href:"https://www.makeuseof.com/tag/useful-telegram-features/",children:Object(o.jsxs)(p.a,{children:[Object(o.jsx)(B.a,{className:a.listIcon,children:Object(o.jsx)(St.a,{fontSize:"medium"})}),Object(o.jsx)(M.a,{children:"Telegram Features"})]})}),Object(o.jsx)("a",{style:{textDecoration:"none",color:"inherit"},target:"blank",href:"https://bugs.telegram.org/?tag_ids=41&sort=time",children:Object(o.jsxs)(p.a,{children:[Object(o.jsx)(B.a,{className:a.listIcon,children:Object(o.jsx)(zt.a,{fontSize:"medium"})}),Object(o.jsx)(M.a,{children:"Report bug"})]})}),Object(o.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(o.jsxs)(p.a,{children:[Object(o.jsx)(B.a,{className:a.listIconText,children:"K"}),Object(o.jsx)(M.a,{children:"Switch to K Version"})]})}),Object(o.jsx)("a",{style:{textDecoration:"none",color:"inherit"},target:"blank",href:"https://desktop.telegram.org/changelog",children:Object(o.jsxs)(p.a,{children:[Object(o.jsx)(B.a,{className:a.listIconText,children:"W"}),Object(o.jsx)(M.a,{children:"Switch to Old Version"})]})}),Object(o.jsx)(q.a,{}),Object(o.jsx)(p.a,{style:{cursor:"default"},children:Object(o.jsx)(M.a,{secondary:"Telegram WebZ 1.32.3",className:a.listItemLast})})]})})})},Bt=Object(b.a)((function(e){return Object(o.jsx)(u.a,Object(l.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)}}}}})),Tt=Object(d.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"}}),Et=function(e){var t=e.contact,n=e.handleListItemClick,a=e.rightIsOpen,s=Tt(),l=Object(i.b)(),d=Object(c.useState)(null),b=Object(r.a)(d,2),u=b[0],f=b[1],x=Object(c.useState)(!1),h=Object(r.a)(x,2),m=h[0],g=h[1],O=Object(c.useState)(!1),v=Object(r.a)(O,2),y=v[0],C=v[1],w=Boolean(u),k=t.name,N=t.lastName,S=t.avatarUrl,I=t.color,R=t.companionId,A=t.createdAt,T=t.number,E=t._id,L=function(e){"copy"===e&&Object(z.a)("Number"),"delete"===e&&C(!0),f(null),g(!1)};return Object(o.jsxs)("div",{children:[Object(o.jsxs)(D.a,{selected:m,onClick:function(){return n(R)},onContextMenu:function(e){return function(e){e.preventDefault(),f(e.currentTarget),g(!0)}(e)},children:[Object(o.jsx)(B.a,{className:s.listItem_iconAvatar,children:Object(o.jsx)(j.a,{alt:k,src:S?"".concat(z.j,"/").concat(S):void 0,sx:{background:I,width:54,height:54},children:!S&&"".concat(Object(z.c)(k)).concat(Object(z.c)(N))})}),Object(o.jsx)(M.a,{primary:"".concat(Object(z.c)(k)).concat(Object(z.l)(k,15,1),"\n ").concat(Object(z.c)(N)).concat(Object(z.l)(N,15,1)),secondary:"Registered since ".concat(Object(z.n)(A))})]}),Object(o.jsxs)(Bt,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:u,open:w,onClose:L,children:[Object(o.jsx)(re.CopyToClipboard,{onCopy:function(){return L("copy")},text:T,children:Object(o.jsxs)(p.a,{children:[Object(o.jsx)(ae.a,{}),"Copy number"]})}),Object(o.jsxs)(p.a,{style:{color:"#f02a2a"},onClick:function(){return L("delete")},children:[Object(o.jsx)(ct.a,{style:{color:"#f02a2a"}}),"Delete contact"]})]}),y&&Object(o.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return C(!1);"delete"===t&&("edit"===a&&l(Object(Ae.b)("credentials")),Object(Oe.n)(E),C(!1))},className:s.overlay,id:"overlay",children:Object(o.jsxs)("div",{className:s.modalDelete,children:[Object(o.jsxs)("div",{className:s.titleWrapper,children:[Object(o.jsx)(j.a,{alt:k,src:S?"".concat(z.j,"/").concat(S):void 0,sx:{background:I,width:38,height:38,marginRight:2},children:"".concat(Object(z.c)(k)).concat(Object(z.c)(N))}),Object(o.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete contact"})]}),Object(o.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete contact\n ".concat("".concat(Object(z.c)(k)).concat(Object(z.l)(k,15,1),"\n ").concat(Object(z.c)(N)).concat(Object(z.l)(N,15,1)),"?")}),Object(o.jsx)(dt.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE CONTACT"}),Object(o.jsx)(dt.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})},Lt=function(e){return e.contacts},Wt=Object(Ce.a)([function(e){return e.contacts.contacts}],(function(e){return e})),_t=n(44),Ft=function(){return function(){var e=Object(me.a)(he.a.mark((function e(t){var n;return he.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(Oe.g)();case 3:(n=e.sent)&&t(Object(_t.b)(n)),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),t(Object(_t.a)());case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}()},Pt=function(e){return function(){var t=Object(me.a)(he.a.mark((function t(n){return he.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Object(Oe.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)}}()},Yt=Object(d.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"}}}),Ht=function(e){var t=e.value,n=e.handleClick,a=e.sort,r=e.date,s=e.setDisabled,l=Yt(),d=Object(i.b)(),b=Object(i.c)(Lt),j=b.total,u=b.contacts,p=Object(i.c)(Ie),f=p.leftIsOpen,x=p.rightIsOpen,h=function(e){n(),x&&d(Object(Ae.b)("")),d(Re(e))},m=Object(z.f)("name",u,a).filter((function(e){var n=e.name+" "+e.lastName;return r?n.toLowerCase().includes(t.toLowerCase())&&Object(z.o)(r)===Object(z.o)(e.createdAt)?e:void 0:n.toLowerCase().includes(t.toLowerCase())}));return Object(c.useEffect)((function(){d(Object(Ae.a)("contacts"))}),[d]),Object(c.useEffect)((function(){s("0"===j)}),[j,s]),Object(c.useEffect)((function(){var e=function(){return"contacts"===f&&d(Ft())};e();var t=setInterval(e,z.k);return function(){return clearInterval(t)}}),[f,d]),"0"!==j?Object(o.jsx)(N.a,{className:l.list,component:"nav","aria-label":"main mailbox folders",children:m.length>0?m.map((function(e){return Object(o.jsx)(Et,{contact:e,handleListItemClick:h,rightIsOpen:x},e.number)})):Object(o.jsx)(_,{name:"Can not find Contact by request : ".concat(t)})}):Object(o.jsx)(_,{name:"You do not have Contact yet!"})},Ut=n(493),Vt=n(487),qt=Object(d.a)({toolBar:{color:"#b1aeae",height:"7vh"},iconArrow:{"&:hover":{transform:"rotate(360deg)",transition:"all 250ms ease-out "}}}),Gt=function(e){var t=e.handleClick,n=qt();return Object(o.jsx)(Be.a,{className:n.toolBar,children:Object(o.jsx)(Te.a,{onClick:t,children:Object(o.jsx)(Ye.a,{className:n.iconArrow})})})},Zt=Object(d.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}}),$t=function(e){var t=e.setSelectedIndex,n=e.handleClick,a=Zt(),s=Object(i.b)(),l=Object(c.useState)(""),d=Object(r.a)(l,2),b=d[0],j=d[1],u=function(){var e=Object(me.a)(he.a.mark((function e(){return he.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s(Pt(b)),j(""),t(1);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),p=function(){return!(b.length<13||b.length>13)&&(b.slice(0,1),!0)};return Object(c.useEffect)((function(){s(Object(Ae.a)(""))}),[s]),Object(o.jsxs)(o.Fragment,{children:[Object(o.jsx)(Gt,{handleClick:n}),Object(o.jsxs)("div",{onKeyDown:function(e){"Enter"===e.code&&p()&&u()},className:a.container,children:[Object(o.jsx)(I.a,{className:a.title,variant:"h5",color:"initial",children:"Add new contact"}),Object(o.jsx)(Ut.a,{id:"number",name:"NUMBER",label:"Write down a number,+ is requirement",value:b,fullWidth:!0,variant:"outlined",onChange:function(e){var t=e.target.value.split(" ").join("").trim();j(t)},className:a.textField,required:!0}),p()&&Object(o.jsx)(Vt.a,{onClick:u,className:a.buttonNext,color:"primary",variant:"contained",fullWidth:!0,children:" ADD"})]})]})},Kt=n(286),Jt=n.n(Kt),Xt=n(372),Qt=n.n(Xt),en=n(285),tn=n.n(en),nn=Object(b.a)((function(e){return Object(o.jsx)(u.a,Object(l.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)}}}}})),on=function(){var e=Object(i.b)(),t=Object(c.useState)(null),n=Object(r.a)(t,2),a=n[0],s=n[1],l=Boolean(a),d=function(t){"logout"===t&&e(Object(Rt.d)()),s(null)};return Object(o.jsxs)(o.Fragment,{children:[Object(o.jsx)(Te.a,{onClick:function(e){return s(e.currentTarget)},"aria-label":"delete",style:{marginLeft:5},size:"medium",children:Object(o.jsx)(tn.a,{fontSize:"medium"})}),Object(o.jsx)(nn,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:a,open:l,onClose:d,children:Object(o.jsxs)(p.a,{style:{fontWeight:500},onClick:function(){return d("logout")},children:[Object(o.jsx)(Qt.a,{}),"Log Out"]})})]})},an=Object(d.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 "}}}),rn=function(e){var t=e.setSelectedIndex,n=e.handleClick,a=an();return Object(o.jsxs)(S.a,{className:a.container,direction:"row",spacing:21,children:[Object(o.jsx)(Te.a,{onClick:n,"aria-label":"delete",size:"medium",children:Object(o.jsx)(Ye.a,{className:a.iconArrow,fontSize:"medium"})}),Object(o.jsx)(I.a,{style:{marginLeft:20,color:"#474747"},variant:"h6",color:"initial",children:"Settings"}),Object(o.jsx)(Te.a,{onClick:function(){return t(4)},style:{marginLeft:"auto"},"aria-label":"delete",size:"medium",children:Object(o.jsx)(Jt.a,{fontSize:"medium"})}),Object(o.jsx)(on,{})]})},cn=n(24),sn=n(287),ln=Object(d.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"}}),dn=function(e){var t=e.setModal,n=e.index,a=e.setIndex,r=ln();return Object(o.jsx)("div",{onClick:function(e){var o=e.target.id;if("overlay"===o||"cancel"===o)return t(!1);"delete"===o&&(Object(Oe.p)(n),a(n-1),t(!1))},className:r.overlay,id:"overlay",children:Object(o.jsxs)("div",{className:r.modalDelete,children:[Object(o.jsx)("div",{className:r.titleWrapper,children:Object(o.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete image"})}),Object(o.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete the Image?"}),Object(o.jsx)(dt.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE IMAGE"}),Object(o.jsx)(dt.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})},bn=Object(d.a)({container:{width:"100%",backgroundColor:"#ffffff",position:"relative"},nameTile:{position:"absolute",color:"#ffffff",backgroundColor:"rgb(0,0,0)",borderRadius:10,padding:8,fontSize:18,zIndex:10,top:"7%",left:"50%",marginLeft:"-45%",opacity:.7,transition:"opacity .35s ease-in-out"},timeTile:{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"},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)"}}}),jn=function(){var e=bn(),t=Object(i.c)(cn.b),n=t.name,a=t.lastName,s=t.avatarsArr,l=t.online,d=Object(c.useState)(!1),b=Object(r.a)(d,2),u=b[0],p=b[1],f=Object(c.useState)(0),x=Object(r.a)(f,2),h=x[0],m=x[1];return Object(o.jsxs)("div",{className:e.container,children:[u&&Object(o.jsx)(dn,{setModal:p,index:h,setIndex:m}),Object(o.jsx)(sn.Carousel,{onChange:function(e){return m(e)},selectedItem:h,children:s.map((function(e){var t=e.avatarUrl,n=e.updatedAt;return Object(o.jsxs)("div",{children:[Object(o.jsx)("img",{alt:"pic",src:"".concat(z.j,"/").concat(t)}),Object(o.jsx)("p",{className:"legend",children:Object(z.n)(n)})]},t)}))}),Object(o.jsx)("span",{className:e.nameTile,children:"".concat(Object(z.c)(n)).concat(Object(z.l)(n,15,1),"\n ").concat(Object(z.c)(a)).concat(Object(z.l)(a,15,1))}),Object(o.jsx)("span",{className:e.timeTile,children:"true"===l?"online":"last seen ".concat(Object(z.n)(l))}),s.length>1&&Object(o.jsx)("div",{className:e.iconDeleteWrapper,children:Object(o.jsx)(j.a,{className:e.iconDelete,onClick:function(){return p(!0)},sx:{width:36,height:36,backgroundColor:"rgb(0,0,0)",color:"#ffffff",opacity:.5,cursor:"pointer"},children:Object(o.jsx)(ct.a,{fontSize:"medium"})})})]})},un=n(293),pn=n.n(un),fn=Object(d.a)({container:{width:"100%",backgroundColor:"#ffffff"}}),xn=function(){var e=fn(),t=Object(i.c)(cn.a);return Object(o.jsx)(Ot.a,{className:e.container,children:Object(o.jsx)(vt.a,{children:Object(o.jsx)(re.CopyToClipboard,{onCopy:function(){return Object(z.a)("Number")},text:t,children:Object(o.jsxs)(p.a,{children:[Object(o.jsx)(B.a,{style:{marginRight:15},children:Object(o.jsx)(pn.a,{fontSize:"medium"})}),Object(o.jsx)(M.a,{primary:t,secondary:"Phone"})]})})})})},hn=function(e){var t=e.setSelectedIndex,n=e.handleClick,a=Object(i.b)();return Object(c.useEffect)((function(){var e=function(){return a(Object(Rt.b)())};e();var t=setInterval(e,z.k);return function(){return clearInterval(t)}}),[a]),Object(o.jsxs)("div",{style:{backgroundColor:"#f3f2f2",height:"100%",width:"100%"},children:[Object(o.jsx)(rn,{setSelectedIndex:t,handleClick:n}),Object(o.jsx)(jn,{}),Object(o.jsx)(xn,{})]})},mn=Object(d.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 "}}}),gn=function(e){var t=e.setSelectedIndex,n=mn();return Object(o.jsxs)(S.a,{className:n.container,direction:"row",spacing:21,children:[Object(o.jsx)(Te.a,{onClick:function(){return t(2)},"aria-label":"delete",size:"medium",children:Object(o.jsx)(Ye.a,{className:n.iconArrow,fontSize:"medium"})}),Object(o.jsx)(I.a,{style:{marginLeft:20,color:"#474747"},variant:"h6",color:"initial",children:"Edit profile"})]})},On=n(380),vn=n.n(On),yn=n(251),Cn=Object(d.a)({container:{display:"flex",alignItems:"center",alignContent:"center",flexDirection:"column",width:"100%",padding:20,paddingTop:0,position:"relative",backgroundColor:"#ffffff"},imgWrapper:{cursor:"pointer",marginBottom:30,position:"relative"},imgDropZoneOverlay:{position:"absolute",width:120,height:120,borderRadius:"50%",backgroundColor:"#6868687d",left:0,zIndex:1,display:"flex",justifyContent:"center",alignContent:"center",alignItems:"center"},addPhoto:{color:"#ffffff",transform:"scale(1.1)","&:hover":{transform:"scale(1.3)"}},avatarArrow:{cursor:"pointer",alignSelf:"flex-end","&:hover":{backgroundColor:"rgb(62, 149, 231)"}}}),wn=function(e){var t=Cn(),n=e.user,a=e.name,r=e.setName,i=e.lastName,s=e.setLastName,d=e.openBtn,b=e.setOpenBtn,u=e.setFile,p=n.avatarUrl,f=n.color,x=Object(yn.a)({noDrag:!0,accept:"image/*"}),h=x.getRootProps,m=x.getInputProps,g=x.acceptedFiles,O=function(e){!d&&b(!0);var t=Object(z.d)(e.target.value);switch(e.target.name){case"name":r(t);break;case"lastName":s(t)}};return Object(c.useEffect)((function(){g.slice(-1)[0]&&(u(g.slice(-1)[0]),b(!0))}),[u,b,g]),Object(o.jsxs)("div",{className:t.container,children:[Object(o.jsxs)(H.a,{className:t.imgWrapper,children:[Object(o.jsxs)("div",Object(l.a)(Object(l.a)({},h({className:t.imgDropZoneOverlay})),{},{children:[Object(o.jsx)(vn.a,{className:t.addPhoto,fontSize:"large"}),Object(o.jsx)("input",Object(l.a)({},m()))]})),Object(o.jsx)(j.a,{alt:a,src:p?"".concat(z.j,"/").concat(p):void 0,sx:{background:f,width:120,height:120},children:"".concat(Object(z.c)(a)).concat(Object(z.c)(i))})]}),Object(o.jsx)(Ut.a,{id:"name",name:"name",label:"Name",value:a,fullWidth:!0,variant:"outlined",onChange:O,style:{marginBottom:20}}),Object(o.jsx)(Ut.a,{id:"lastName",name:"lastName",label:"LastName",value:i,fullWidth:!0,variant:"outlined",onChange:O})]})},kn=n(294),Nn=n.n(kn),Sn=Object(d.a)({container:{position:"absolute",content:"",top:"92vh",right:20},avatarArrow:{cursor:"pointer","&:hover":{backgroundColor:"rgb(62, 149, 231)"}}}),In=function(e){var t=e.handleSubmit,n=Sn();return Object(o.jsx)("div",{className:n.container,children:Object(o.jsx)(j.a,{onClick:t,className:n.avatarArrow,sx:{width:56,height:56,backgroundColor:"rgb(41, 139, 231)",color:"#ffffff"},children:Object(o.jsx)(Nn.a,{fontSize:"medium"})})})},zn=Object(d.a)({container:{width:"100%",height:"100%",backgroundColor:"#f3f2f2",position:"relative"}}),Rn=function(e){var t=e.setSelectedIndex,n=zn(),a=Object(i.b)(),s=Object(i.c)(cn.b),l=Object(c.useState)(""),d=Object(r.a)(l,2),b=d[0],j=d[1],u=Object(c.useState)(""),p=Object(r.a)(u,2),f=p[0],x=p[1],h=Object(c.useState)(!1),m=Object(r.a)(h,2),g=m[0],O=m[1],v=Object(c.useState)(null),y=Object(r.a)(v,2),C=y[0],w=y[1],k=s.name,N=s.lastName,S=function(){var e=Object(me.a)(he.a.mark((function e(){var t;return he.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(b===k&&f===N){e.next=3;break}return e.next=3,Object(Oe.B)({name:b,lastName:f,originalName:b,originalLastName:f});case 3:if(!C){e.next=8;break}return(t=new FormData).append("avatar",C),e.next=8,Object(Oe.D)(t);case 8:C&&w(null),g&&O(!1);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(c.useEffect)((function(){var e=function(){return!g&&a(Object(Rt.b)())};e();var t=setInterval(e,z.k);return function(){return clearInterval(t)}}),[g,a]),Object(c.useEffect)((function(){k&&j(k),N&&x(N)}),[k,N]),Object(o.jsxs)("div",{className:n.container,children:[g&&Object(o.jsx)(In,{handleSubmit:S}),Object(o.jsx)(gn,{setSelectedIndex:t}),Object(o.jsx)(wn,{user:s,name:b,setName:j,lastName:f,setLastName:x,openBtn:g,setOpenBtn:O,file:C,setFile:w})]})},An=function(){var e=Object(i.b)(),t=Object(i.c)(cn.b),n=t.sort,l=t.nightMode,d=Object(c.useState)(!1),b=Object(r.a)(d,2),j=b[0],u=b[1],p=Object(c.useState)(!1),f=Object(r.a)(p,2),x=f[0],h=f[1],m=Object(c.useState)(!1),g=Object(r.a)(m,2),O=g[0],v=g[1],y=Object(c.useState)(null),C=Object(r.a)(y,2),w=C[0],N=C[1],S=Object(c.useState)(!1),I=Object(r.a)(S,2),z=I[0],R=I[1],A=Object(c.useState)(""),D=Object(r.a)(A,2),M=D[0],B=D[1],T=Object(c.useState)(""),E=Object(r.a)(T,2),L=E[0],W=E[1],_=Object(c.useRef)(null),F=function(){if(e(Object(Ae.a)("")),B(""),W(""),w&&N(null),!j)return h(!x);u(!1),R(!1)},P=function(e){u(!0),h(!1),v(!1),B(""),W(""),N(e)};return Object(c.useEffect)((function(){var e=function(e){"overlay"===e.target.id&&(h(!1),v(!1))};if(!_.current){var t=document.getElementById("modal-root");t&&(t.addEventListener("click",e),_.current=t)}return function(){_.current&&(_.current.removeEventListener("click",e),_.current=null)}}),[]),Object(o.jsxs)(a.a,{item:!0,lg:3,style:{position:"relative",backgroundColor:"#ffffff"},onMouseEnter:function(){O||v(!0)},onMouseLeave:function(){O&&v(!1)},children:[2!==w&&3!==w&&4!==w&&Object(o.jsx)(et,{handleClick:F,handleOpenIsSearch:function(){return!j&&u(!0)},sort:n,handleSearch:function(e){return B(e.target.value)},isSearch:j,value:M,setDate:W,date:L,disabled:z}),!w&&j&&Object(o.jsx)(Me,{value:M,setValue:B,sort:n,date:L,setDate:W,setDisabled:R}),!w&&!j&&Object(o.jsx)(gt,{sort:n}),!w&&O&&!j&&Object(o.jsx)(k,{handleSelectedMenu:P,setIsMenuSm:v}),x&&_.current&&Object(s.createPortal)(Object(o.jsx)(Mt,{handleSelectedMenu:P,nightMode:l}),_.current),1===w&&Object(o.jsx)(Ht,{handleClick:F,value:M,sort:n,date:L,setDisabled:R}),2===w&&Object(o.jsx)(hn,{setSelectedIndex:N,handleClick:F}),3===w&&Object(o.jsx)($t,{setSelectedIndex:N,handleClick:F}),4===w&&Object(o.jsx)(Rn,{setSelectedIndex:N})]})},Dn=n(520),Mn=function(){var e=Object(i.b)(),t=Object(i.c)(ht.a),n=t.name,a=t.lastName,r=t.avatarUrl,c=t.color,s=t.online;return Object(o.jsxs)(D.a,{onClick:function(){return e(Object(Ae.b)("credentials"))},children:[Object(o.jsx)(B.a,{children:Object(o.jsx)(j.a,{alt:n,src:r?"".concat(z.j,"/").concat(r):void 0,sx:{background:c,width:44,height:44},children:!r&&"".concat(Object(z.c)(n)).concat(Object(z.c)(a))})}),Object(o.jsx)(M.a,{primary:"".concat(Object(z.c)(n)).concat(Object(z.l)(n,15,1),"\n ").concat(Object(z.c)(a)).concat(Object(z.l)(a,15,1)),secondaryTypographyProps:{color:"#0379af"},secondary:"true"===s?"online":"last seen ".concat(Object(z.n)(s))})]})},Bn=Object(b.a)((function(e){return Object(o.jsx)(u.a,Object(l.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)}}}}})),Tn=function(e){var t=e.setModal,n=Object(i.b)(),a=Object(c.useState)(null),s=Object(r.a)(a,2),l=s[0],d=s[1],b=Boolean(l),j=Object(i.c)(ht.a),u=j.companionId,f=j.mute,x=function(e){"mute"===e&&Object(Oe.k)(u),"deleteModal"===e&&t(!0),n(Object(Ae.b)("")),d(null)};return Object(o.jsxs)(o.Fragment,{children:[Object(o.jsx)(Te.a,{onClick:function(e){n(Object(Ae.b)("menu")),d(e.currentTarget)},"aria-label":"delete",size:"medium",children:Object(o.jsx)(tn.a,{fontSize:"medium"})}),Object(o.jsxs)(Bn,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:l,open:b,onClose:x,children:[Object(o.jsxs)(p.a,{onClick:function(){return x("mute")},children:[f?Object(o.jsx)(nt.a,{}):Object(o.jsx)(at.a,{}),f?"Unmute":"Mute"]}),Object(o.jsxs)(p.a,{style:{color:"#f02a2a"},onClick:function(){return x("deleteModal")},children:[Object(o.jsx)(ct.a,{style:{color:"#f02a2a"}}),"Delete chat"]})]})]})},En=Object(d.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"}}),Ln=function(e){var t=e.setModal,n=En(),a=Object(i.c)(ht.a),r=a.name,c=a.lastName,s=a.avatarUrl,l=a.color,d=a.companionId;return Object(o.jsx)("div",{onClick:function(e){var n=e.target.id;if("overlay"===n||"cancel"===n)return t(!1);"delete"===n&&(Object(Oe.m)(d),t(!1))},className:n.overlay,id:"overlay",children:Object(o.jsxs)("div",{className:n.modalDelete,children:[Object(o.jsxs)("div",{className:n.titleWrapper,children:[Object(o.jsx)(j.a,{alt:r,src:s?"".concat(z.j,"/").concat(s):void 0,sx:{background:l,width:38,height:38,marginRight:2},children:"".concat(Object(z.c)(r)).concat(Object(z.c)(c))}),Object(o.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete chat"})]}),Object(o.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete the\n chat with ".concat("".concat(Object(z.c)(r)).concat(Object(z.l)(r,15,1)," \n ").concat(Object(z.c)(c)).concat(Object(z.l)(c,15,1)),"?")}),Object(o.jsx)(dt.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE CHAT"}),Object(o.jsx)(dt.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})},Wn=Object(d.a)({container:{marginLeft:20}}),_n=function(){var e=Wn(),t=Object(i.b)(),n=Object(c.useState)(!1),a=Object(r.a)(n,2),s=a[0],l=a[1];return Object(o.jsxs)(S.a,{className:e.container,direction:"row",children:[Object(o.jsx)(Te.a,{onClick:function(){return t(Object(Ae.b)("search"))},"aria-label":"delete",size:"medium",children:Object(o.jsx)(_e.a,{fontSize:"medium"})}),Object(o.jsx)(Tn,{setModal:l}),s&&Object(o.jsx)(Ln,{setModal:l})]})},Fn=Object(d.a)({toolBar:{color:"#6e6d6d",display:"flex",justifyContent:"space-between",backgroundColor:"#ffffff",height:"7vh"}}),Pn=function(){var e=Fn();return Object(o.jsx)(Dn.a,{position:"static",children:Object(o.jsxs)(Be.a,{className:e.toolBar,children:[Object(o.jsx)(Mn,{}),Object(o.jsx)(_n,{})]})})},Yn=n(381),Hn=n.n(Yn),Un=Object(d.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"}}),Vn=function(e){var t=e.isArrow,n=e.handleScrollTo,a=e.isNew,r=Un();return Object(o.jsxs)("div",{className:r.avatarArrowWrapper,style:{display:t?"block":"none"},children:[Object(o.jsx)("button",{onClick:n,style:{display:a.new?"block":"none",background:a.mute?"#a7aaa7":"#0ac40a"},className:r.listSeenIcon,children:a.new}),Object(o.jsx)(j.a,{onClick:n,className:r.avatarArrow,sx:{backgroundColor:"#ffffff",width:56,height:56,color:"#6b6b6b"},children:Object(o.jsx)(Hn.a,{fontSize:"medium"})})]})},qn=n(387),Gn=n.n(qn),Zn=n(388),$n=n.n(Zn),Kn=n(386),Jn=n.n(Kn),Xn=n(385),Qn=n.n(Xn),eo=n(390),to=n.n(eo),no=n(389),oo=n.n(no),ao=n(382),ro=n.n(ao),co=n(383),io=n(243),so=n.n(io),lo=Object(d.a)({container:{width:"100%",position:"relative"},dropZone:{width:"100%",display:"flex",position:"relative",height:20,zIndex:10}}),bo=function(e){var t=e.children,n=e.setFile,a=e.setValue,r=e.accept,i=lo(),s=Object(yn.a)({noDrag:!0,accept:r}),d=s.getRootProps,b=s.getInputProps,j=s.acceptedFiles;return Object(c.useEffect)((function(){j.slice(-1)[0]&&(a(""),n(j.slice(-1)[0]))}),[n,a,j]),Object(o.jsxs)("div",{className:i.container,children:[t,Object(o.jsx)("div",Object(l.a)(Object(l.a)({},d({className:i.dropZone})),{},{children:Object(o.jsx)("input",Object(l.a)({placeholder:"Photo or Video"},b()))}))]})},jo=Object(d.a)({list:{background:"#fdfdfd"},listIcon:{position:"absolute",left:0},listText:{position:"absolute",left:40}}),uo=function(e){var t=e.setIsOpenMenu,n=e.setFile,a=e.setValue,r=e.setType,c=jo(),i=function(e){r(e),t(!1)};return Object(o.jsxs)(vt.a,{className:c.list,children:[Object(o.jsx)(p.a,{onClick:function(){return i("content")},children:Object(o.jsxs)(bo,{setFile:n,setValue:a,accept:"image/*,video/*,audio/*",children:[Object(o.jsx)(B.a,{className:c.listIcon,children:Object(o.jsx)(so.a,{fontSize:"medium"})}),Object(o.jsx)(M.a,{className:c.listText,children:"Upload Image/Audio/Video"})]})}),Object(o.jsx)(p.a,{onClick:function(){return i("application")},children:Object(o.jsxs)(bo,{setFile:n,setValue:a,accept:"application/pdf,\r application/vnd.openxmlformats-officedocument.wordprocessingml.document",children:[Object(o.jsx)(B.a,{className:c.listIcon,children:Object(o.jsx)(so.a,{fontSize:"medium"})}),Object(o.jsx)(M.a,{className:c.listText,children:"Upload File"})]})})]})},po=Object(d.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:"-2vh",width:"100%",height:1,background:"#ffffff"},filesMenu:{background:"#fdfdfd",position:"absolute",width:"15vw",maxWidth:"100%",left:"61%",bottom:"10vh",zIndex:10,visibility:"visible",borderRadius:10,padding:"4px 6px"},emoji:{position:"absolute",bottom:"10vh",zIndex:10,visibility:"visible"},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)"}}}),fo=function(e){var t=e.isArrow,n=po(),a=Object(i.c)(ht.a).companionId,s=Object(i.c)(Ne),l=Object(c.useState)(""),d=Object(r.a)(l,2),b=d[0],u=d[1],p=Object(c.useState)(!1),f=Object(r.a)(p,2),x=f[0],h=f[1],m=Object(c.useState)(!1),g=Object(r.a)(m,2),v=g[0],y=g[1],C=Object(c.useState)(!1),w=Object(r.a)(C,2),k=w[0],N=w[1],S=Object(c.useState)(!1),I=Object(r.a)(S,2),R=I[0],A=I[1],D=Object(c.useState)(!1),M=Object(r.a)(D,2),B=M[0],T=M[1],E=Object(c.useState)(""),L=Object(r.a)(E,2),W=L[0],_=L[1],F=Object(co.useReactMediaRecorder)({audio:!0}),P=F.status,Y=F.startRecording,H=F.stopRecording,U=F.mediaBlobUrl,V=F.clearBlobUrl,q=Object(co.useReactMediaRecorder)({video:!0}),G=q.status,Z=q.startRecording,$=q.stopRecording,K=q.mediaBlobUrl,J=q.clearBlobUrl,X=function(){x&&h(!1),R&&A(!1),B&&T(!1),b&&u(""),W&&_(""),U&&V(),K&&J(),v&&y(!1),k&&N(!1)},Q=function(){var e=Object(me.a)(he.a.mark((function e(){var t,n,o,r,c,i;return he.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(b&&Object(Oe.u)(a,b),U&&"recording"===W&&((t=new XMLHttpRequest).open("GET",U,!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(Oe.r)(a,o),V()}},t.send()),K&&"filming"===W&&((n=new XMLHttpRequest).open("GET",K,!0),n.responseType="blob",n.onload=function(){if(200===n.status){var e=n.response,t=new File([e],"video.mp4",{type:"video/mp4"}),o=new FormData;o.append("video",t),Object(Oe.v)(a,o),J()}},n.send()),!x||!W){e.next=12;break}if(!x.type.includes("image")||"content"!==W){e.next=9;break}return(o=new FormData).append("image",x),e.next=9,Object(Oe.t)(a,o);case 9:x.type.includes("audio")&&"content"===W&&((r=new FormData).append("audio",x),Object(Oe.r)(a,r)),x.type.includes("video")&&"content"===W&&((c=new FormData).append("video",x),Object(Oe.v)(a,c)),x.type.includes("application")&&"application"===W&&((i=new FormData).append("file",x),Object(Oe.s)(a,i));case 12:X(),Object(z.h)("".concat(z.j,"/send.mp3"));case 14:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ee=function(){var e=Object(me.a)(he.a.mark((function e(){return he.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(Oe.z)(a,!0);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),te=function(){var e=Object(me.a)(he.a.mark((function e(){return he.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(Oe.z)(a,!1);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ne=function(){if(R)return H();Y(),_("recording"),A(!0)},oe=function(){if(B)return $();Z(),_("filming"),T(!0)};return Object(o.jsxs)("div",{className:b||x||"stopped"===P||"stopped"===G?n.containerActive:n.container,children:[t&&Object(o.jsx)("div",{className:n.borderTop}),B&&"stopped"!==G&&Object(o.jsxs)(o.Fragment,{children:[Object(o.jsx)("div",{className:n.pauseLeft,children:Object(o.jsx)(j.a,{onClick:oe,className:n.avatarPause,sx:{backgroundColor:"#ffffff",color:"#6b6b6b",width:56,height:56},children:Object(o.jsx)(Qn.a,{fontSize:"large"})})}),Object(o.jsxs)("div",{className:n.ringContainerLeft,children:[Object(o.jsx)("div",{className:n.ringRing}),Object(o.jsx)("div",{className:n.circle})]})]}),R&&"stopped"!==P&&Object(o.jsxs)(o.Fragment,{children:[Object(o.jsx)("div",{className:n.pauseRight,children:Object(o.jsx)(j.a,{onClick:ne,className:n.avatarPause,sx:{backgroundColor:"#ffffff",color:"#6b6b6b",width:56,height:56},children:Object(o.jsx)(Qn.a,{fontSize:"large"})})}),Object(o.jsxs)("div",{className:n.ringContainerRight,children:[Object(o.jsx)("div",{className:n.ringRing}),Object(o.jsx)("div",{className:n.circle})]})]}),Object(o.jsx)(O.a,{onClick:X,fontSize:"small",className:n.iconCancel,sx:{width:56,height:56,display:x||b||"stopped"===P||"stopped"===G?"inline-block":"none"}}),Object(o.jsx)(Jn.a,{onClick:oe,className:n.avatarCamera,sx:{backgroundColor:"#ffffff",color:"#6b6b6b",width:56,height:56},style:{display:"idle"!==P||"stopped"===G||x||b||B?"none":"block"}}),Object(o.jsx)(Gn.a,{onClick:Q,className:n.avatarRight,sx:{backgroundColor:"#ffffff",color:"rgb(41, 139, 231)",width:56,height:56},style:{display:b||x||"stopped"===P||"stopped"===G?"block":"none"}}),Object(o.jsx)($n.a,{onClick:ne,className:n.avatarRight,sx:{backgroundColor:"#ffffff",color:"#6b6b6b",width:56,height:56},style:{display:b||x||"stopped"===P||"idle"!==G||R?"none":"block"}}),Object(o.jsx)(oo.a,{onClick:function(){return!k&&N(!0)},fontSize:"medium",sx:{color:k?"rgb(41, 139, 231)":"#6b6b6b",cursor:"pointer",pointerEvents:x||"idle"!==P||"idle"!==G?"none":"auto","&:hover":{color:"rgb(41, 139, 231)"}}}),Object(o.jsx)("div",{onClick:function(e){return"overlay"===e.target.id&&k&&N(!1)},className:n.overlay,id:"overlay",style:{display:k?"block":"none"},children:Object(o.jsx)("div",{className:n.emoji,style:{left:s&&"menu"!==s?"32.5vw":"45vw"},children:Object(o.jsx)(ro.a,{onEmojiClick:function(e,t){u((function(e){return e+t.emoji})),N(!1)}})})}),Object(o.jsx)("textarea",{disabled:!(!x&&"idle"===P&&"idle"===G),value:b,onBlur:te,onFocus:ee,onChange:function(e){return u(e.target.value)},className:n.textarea,placeholder:x?"The File is ready to send":"idle"===P&&"idle"===G?"Message ":"".concat("stopped"===P||"stopped"===G?"Recorded":"Recording in progress"),rows:1,style:{color:b||x||"idle"!==P||"idle"!==G?"rgb(41, 139, 231)":"#6b6b6b"}}),Object(o.jsx)(to.a,{onClick:function(){return!v&&y(!0)},className:n.attachIcon,fontSize:"medium",sx:{color:v?"rgb(41, 139, 231)":"#6b6b6b",cursor:"pointer",pointerEvents:b||"idle"!==P||"idle"!==G?"none":"auto","&:hover":{color:"rgb(41, 139, 231)"}}}),Object(o.jsx)("div",{onClick:function(e){return"overlay"===e.target.id&&v&&y(!1)},className:n.overlay,id:"overlay",style:{display:v?"block":"none"},children:Object(o.jsx)("div",{className:n.filesMenu,style:{left:s&&"menu"!==s?"52.5vw":"65vw"},children:Object(o.jsx)(uo,{setFile:h,setValue:u,setIsOpenMenu:y,setType:_})})})]})},xo=Object(b.a)((function(e){return Object(o.jsx)(u.a,Object(l.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)}}}}})),ho=Object(d.a)({container:{display:"flex",justifyContent:"flex-start",marginBottom:15},wrapper:{position:"relative",display:"flex",alignItems:"center",alignContent:"center",maxWidth:450,padding:"10px",paddingBottom:18,backgroundColor:"#ffffff",border:"1px solid #f0f0f0",borderRadius:7},message:{wordBreak:"break-word",textAlign:"left",font:"400 .9em 'Open Sans', sans-serif","&:after":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"15px solid #ffffff",borderLeft:"15px solid transparent",borderRight:"15px solid transparent",bottom:"0px",left:"-15px"},"&:before":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"17px solid #ffffff",borderLeft:"16px solid transparent",borderRight:"16px solid transparent",bottom:"-1px",left:"-17px"}},messageActive:{wordBreak:"break-word",textAlign:"left",font:"400 .9em 'Open Sans', sans-serif","&:after":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"15px solid #babdbc",borderLeft:"15px solid transparent",borderRight:"15px solid transparent",bottom:"0px",left:"-15px"},"&:before":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"17px solid #babdbc",borderLeft:"16px solid transparent",borderRight:"16px solid transparent",bottom:"-1px",left:"-17px"}},copyIcon:{color:"#b56ff7",cursor:"pointer",marginRight:7,"&:hover":{color:"#9c3bf8"}},time:{position:"absolute",fontSize:".65em",fontWeight:600,bottom:6,right:6,color:"#414141",padding:3,borderRadius:5},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"}}),mo=function(e){var t=e.message,n=e.name,a=e.lastName,i=e.createdAt,s=e._id,l=ho(),d=Object(c.useState)(null),b=Object(r.a)(d,2),j=b[0],u=b[1],f=Object(c.useState)(!1),x=Object(r.a)(f,2),h=x[0],m=x[1],g=Object(c.useState)(!1),O=Object(r.a)(g,2),v=O[0],y=O[1],C=Boolean(j),w=function(e){"copy"===e&&Object(z.a)("Message"),"delete"===e&&y(!0),u(null),m(!1)};return Object(o.jsx)("div",{className:l.container,children:Object(o.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),u(e.currentTarget),m(!0)}(e)},className:l.wrapper,style:{backgroundColor:h?"#babdbc":void 0,border:h?"#babdbc":void 0},children:[Object(o.jsx)(re.CopyToClipboard,{onCopy:function(){return Object(z.a)("Message")},text:t,children:Object(o.jsx)(ae.a,{className:l.copyIcon,fontSize:"large"})}),Object(o.jsx)(M.a,{className:h?l.messageActive:l.message,primary:"".concat(Object(z.c)(n)).concat(Object(z.l)(n,15,1)," \n ").concat(Object(z.c)(a)).concat(Object(z.l)(a,15,1)),primaryTypographyProps:{color:"#0379af"},secondary:t,secondaryTypographyProps:{color:"#0e0d0d"}}),Object(o.jsx)("div",{className:l.time,children:Object(z.p)(i)}),Object(o.jsxs)(xo,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:j,open:C,onClose:w,children:[Object(o.jsx)(re.CopyToClipboard,{onCopy:function(){return w("copy")},text:t,children:Object(o.jsxs)(p.a,{children:[Object(o.jsx)(ae.a,{}),"Copy message"]})}),Object(o.jsxs)(p.a,{style:{color:"#f02a2a"},onClick:function(){return w("delete")},children:[Object(o.jsx)(ct.a,{style:{color:"#f02a2a"}}),"Delete message"]})]}),v&&Object(o.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return y(!1);"delete"===t&&(Object(Oe.o)(s),y(!1))},className:l.overlay,id:"overlay",children:Object(o.jsxs)("div",{className:l.modalDelete,children:[Object(o.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(o.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(o.jsx)(dt.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(o.jsx)(dt.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})})},go=n(489),Oo=n(295),vo=n.n(Oo),yo=n(181),Co=n.n(yo),wo=Object(b.a)((function(e){return Object(o.jsx)(u.a,Object(l.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)}}}}})),ko=Object(d.a)({container:{display:"flex",justifyContent:"flex-start",marginBottom:15},wrapper:{width:400,position:"relative",display:"flex",alignItems:"center",alignContent:"center",justifyContent:"space-between",borderRadius:7,padding:"12px 5px 12px 5px",backgroundColor:"#ffffff","&:after":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"15px solid #ffffff",borderLeft:"15px solid transparent",borderRight:"15px solid transparent",bottom:"0px",left:"-15px"},"&:before":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"17px solid #ffffff",borderLeft:"16px solid transparent",borderRight:"16px solid transparent",bottom:"0px",left:"-17px"}},wrapperActive:{width:400,position:"relative",display:"flex",alignItems:"center",alignContent:"center",justifyContent:"space-between",borderRadius:7,padding:"12px 5px 12px 5px",backgroundColor:"#babdbc","&:after":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"15px solid #babdbc",borderLeft:"15px solid transparent",borderRight:"15px solid transparent",bottom:"0px",left:"-15px"},"&:before":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"17px solid #babdbc",borderLeft:"16px solid transparent",borderRight:"16px solid transparent",bottom:"0px",left:"-17px"}},image:{borderRadius:7,width:300,maxHeight:400,cursor:"pointer"},time:{position:"absolute",fontSize:".65em",fontWeight:600,bottom:0,right:6,color:"#414141",padding:3,borderRadius:5},bntDownload:{backgroundColor:"inherit",color:"#54b0fc",width:30,height:30,"&:hover":{backgroundColor:"#54b0fc",color:"#ffffff"}},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden",boxSizing:"border-box",display:"flex",justifyContent:"center",alignContent:"center",alignItems:"center"},wrapperOverlayImg:{width:"30%",maxHeight:"80%",position:"relative",display:"flex"},overlayDownloadIcon:{position:"absolute",content:"",right:0,top:-40,cursor:"pointer",color:"#e9e7e7",padding:0,borderRadius:"50%","&:hover":{backgroundColor:"#ffffff",color:"#b8b7b7"}},overlayTime:{position:"absolute",content:"",color:"#ffffff",top:-30,left:0,borderRadius:10,padding:"2px 6px 2px 6px",backgroundColor:"#707070"},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"}}),No=function(e){var t=e.url,n=e.createdAt,a=e.color,i=(e.message,e.messages,e.fullType),s=e._id,l=ko(),d=Object(c.useState)(!1),b=Object(r.a)(d,2),j=b[0],u=b[1],f=Object(c.useState)(null),x=Object(r.a)(f,2),h=x[0],m=x[1],g=Object(c.useState)(!1),O=Object(r.a)(g,2),v=O[0],y=O[1],C=Object(c.useState)(!1),w=Object(r.a)(C,2),k=w[0],N=w[1],S=Boolean(h),I=function(e){"copy"===e&&Object(z.a)("Link"),"delete"===e&&N(!0),m(null),y(!1)};return j?Object(o.jsx)("div",{onClick:function(e){return"overlay"===e.target.id&&j&&u(!1)},id:"overlay",className:l.overlay,children:Object(o.jsxs)("div",{className:l.wrapperOverlayImg,children:[Object(o.jsx)("span",{className:l.overlayTime,children:Object(z.n)(n)}),Object(o.jsx)(X.a,{className:l.overlayDownloadIcon,fontSize:"large",onClick:function(){return Object(z.e)(t,i)}}),Object(o.jsx)("img",{width:"100%",height:"auto",alt:"imageItem",src:t})]})}):Object(o.jsx)("div",{className:l.container,children:Object(o.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),m(e.currentTarget),y(!0)}(e)},className:v?l.wrapperActive:l.wrapper,children:[Object(o.jsx)(vo.a,{fontSize:"large",style:{color:"#bd9a00"}}),Object(o.jsx)("img",{onClick:function(){return!j&&u(!0)},className:l.image,alt:"message pic",src:t,style:{backgroundColor:t?"":a},width:"300",height:"400"}),Object(o.jsx)(go.a,{onClick:function(){return Object(z.e)(t,i)},className:l.bntDownload,children:Object(o.jsx)(Co.a,{fontSize:"medium"})}),Object(o.jsx)("div",{className:l.time,children:Object(z.p)(n)}),Object(o.jsxs)(wo,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:h,open:S,onClose:I,children:[Object(o.jsx)(re.CopyToClipboard,{onCopy:function(){return I("copy")},text:t,children:Object(o.jsxs)(p.a,{children:[Object(o.jsx)(ae.a,{}),"Copy Image link"]})}),Object(o.jsxs)(p.a,{style:{color:"#f02a2a"},onClick:function(){return I("delete")},children:[Object(o.jsx)(ct.a,{style:{color:"#f02a2a"}}),"Delete message"]})]}),k&&Object(o.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return N(!1);"delete"===t&&(Object(Oe.o)(s),N(!1))},className:l.overlayDelete,id:"overlay",children:Object(o.jsxs)("div",{className:l.modalDelete,children:[Object(o.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(o.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(o.jsx)(dt.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(o.jsx)(dt.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})})},So=n(297),Io=n.n(So),zo=n(296),Ro=n.n(zo),Ao=Object(b.a)((function(e){return Object(o.jsx)(u.a,Object(l.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)}}}}})),Do=Object(d.a)({container:{display:"flex",justifyContent:"flex-start",marginBottom:15},wrapper:{position:"relative",display:"flex",justifyContent:"space-between",alignContent:"center",alignItems:"center",padding:"12px 5px 12px 5px",backgroundColor:"#ffffff",borderRadius:7,"&:after":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"15px solid #ffffff",borderLeft:"15px solid transparent",borderRight:"15px solid transparent",bottom:"0px",left:"-15px"},"&:before":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"17px solid #ffffff",borderLeft:"16px solid transparent",borderRight:"16px solid transparent",bottom:"0px",left:"-17px"}},wrapperActive:{position:"relative",display:"flex",justifyContent:"space-between",alignContent:"center",alignItems:"center",padding:"12px 5px 12px 5px",backgroundColor:"#babdbc",borderRadius:7,"&:after":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"15px solid #babdbc",borderLeft:"15px solid transparent",borderRight:"15px solid transparent",bottom:"0px",left:"-15px"},"&:before":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"17px solid #babdbc",borderLeft:"16px solid transparent",borderRight:"16px solid transparent",bottom:"0px",left:"-17px"}},bntDownload:{backgroundColor:"inherit",color:"#54b0fc",width:30,height:30,"&:hover":{backgroundColor:"#54b0fc",color:"#ffffff"}},player:{margin:"0 5px 0 5px",borderRadius:7},time:{position:"absolute",fontSize:".65em",fontWeight:600,bottom:0,right:6,color:"#414141",padding:3,borderRadius:5},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"}}),Mo=function(e){var t=e.url,n=e.createdAt,a=e.fullType,i=e._id,s=Do(),l=Object(c.useState)(null),d=Object(r.a)(l,2),b=d[0],j=d[1],u=Object(c.useState)(!1),f=Object(r.a)(u,2),x=f[0],h=f[1],m=Object(c.useState)(!1),g=Object(r.a)(m,2),O=g[0],v=g[1],y=Boolean(b),C=function(e){"copy"===e&&Object(z.a)("Link"),"delete"===e&&v(!0),j(null),h(!1)};return Object(o.jsx)("div",{className:s.container,children:Object(o.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),j(e.currentTarget),h(!0)}(e)},className:x?s.wrapperActive:s.wrapper,children:[Object(o.jsx)(Io.a,{fontSize:"large",style:{color:"#0294c0"}}),Object(o.jsx)(Ro.a,{className:s.player,src:t,controls:!0}),Object(o.jsx)(go.a,{onClick:function(){return Object(z.e)(t,a)},className:s.bntDownload,children:Object(o.jsx)(Co.a,{fontSize:"medium"})}),Object(o.jsx)("div",{className:s.time,children:Object(z.p)(n)}),Object(o.jsxs)(Ao,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:b,open:y,onClose:C,children:[Object(o.jsx)(re.CopyToClipboard,{onCopy:function(){return C("copy")},text:t,children:Object(o.jsxs)(p.a,{children:[Object(o.jsx)(ae.a,{}),"Copy Audio link"]})}),Object(o.jsxs)(p.a,{style:{color:"#f02a2a"},onClick:function(){return C("delete")},children:[Object(o.jsx)(ct.a,{style:{color:"#f02a2a"}}),"Delete message"]})]}),O&&Object(o.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return v(!1);"delete"===t&&(Object(Oe.o)(i),v(!1))},className:s.overlay,id:"overlay",children:Object(o.jsxs)("div",{className:s.modalDelete,children:[Object(o.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(o.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(o.jsx)(dt.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(o.jsx)(dt.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})})},Bo=n(327),To=n.n(Bo),Eo=n(298).Player,Lo=Object(b.a)((function(e){return Object(o.jsx)(u.a,Object(l.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)}}}}})),Wo=Object(d.a)({container:{display:"flex",justifyContent:"flex-start",marginBottom:15},wrapper:{position:"relative",display:"flex",justifyContent:"space-between",alignContent:"center",alignItems:"center",width:400,padding:"12px 5px 12px 5px",backgroundColor:"#ffffff",borderRadius:7,"&:after":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"15px solid #ffffff",borderLeft:"15px solid transparent",borderRight:"15px solid transparent",bottom:"0px",left:"-15px"},"&:before":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"17px solid #ffffff",borderLeft:"16px solid transparent",borderRight:"16px solid transparent",bottom:"0px",left:"-17px"}},wrapperActive:{position:"relative",display:"flex",justifyContent:"space-between",alignContent:"center",alignItems:"center",width:400,padding:"12px 5px 12px 5px",backgroundColor:"#babdbc",borderRadius:7,"&:after":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"15px solid #babdbc",borderLeft:"15px solid transparent",borderRight:"15px solid transparent",bottom:"0px",left:"-15px"},"&:before":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"17px solid #babdbc",borderLeft:"16px solid transparent",borderRight:"16px solid transparent",bottom:"0px",left:"-17px"}},bntDownload:{backgroundColor:"inherit",color:"#54b0fc",width:30,height:30,marginLeft:5,"&:hover":{backgroundColor:"#54b0fc",color:"#ffffff"}},time:{position:"absolute",fontSize:".65em",fontWeight:600,bottom:0,right:6,color:"#414141",padding:3,borderRadius:5},player:{backgroundColor:"#ffffff"},playerActive:{backgroundColor:"#babdbc"},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"}}),_o=function(e){var t=e.url,n=e.createdAt,a=e.fullType,i=e._id,s=Wo(),l=Object(c.useState)(null),d=Object(r.a)(l,2),b=d[0],j=d[1],u=Object(c.useState)(!1),f=Object(r.a)(u,2),x=f[0],h=f[1],m=Object(c.useState)(!1),g=Object(r.a)(m,2),O=g[0],v=g[1],y=Boolean(b),C=function(e){"copy"===e&&Object(z.a)("Link"),"delete"===e&&v(!0),j(null),h(!1)};return Object(o.jsx)("div",{className:s.container,children:Object(o.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),j(e.currentTarget),h(!0)}(e)},className:x?s.wrapperActive:s.wrapper,children:[Object(o.jsx)(To.a,{fontSize:"large",style:{color:"#03b003"}}),Object(o.jsx)(Eo,{className:x?s.playerActive:s.player,playsInline:!0,src:t}),Object(o.jsx)(go.a,{onClick:function(){return Object(z.e)(t,a)},className:s.bntDownload,children:Object(o.jsx)(Co.a,{fontSize:"medium"})}),Object(o.jsx)("div",{className:s.time,children:Object(z.p)(n)}),Object(o.jsxs)(Lo,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:b,open:y,onClose:C,children:[Object(o.jsx)(re.CopyToClipboard,{onCopy:function(){return C("copy")},text:t,children:Object(o.jsxs)(p.a,{children:[Object(o.jsx)(ae.a,{}),"Copy Video link"]})}),Object(o.jsxs)(p.a,{style:{color:"#f02a2a"},onClick:function(){return C("delete")},children:[Object(o.jsx)(ct.a,{style:{color:"#f02a2a"}}),"Delete message"]})]}),O&&Object(o.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return v(!1);"delete"===t&&(Object(Oe.o)(i),v(!1))},className:s.overlay,id:"overlay",children:Object(o.jsxs)("div",{className:s.modalDelete,children:[Object(o.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(o.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(o.jsx)(dt.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(o.jsx)(dt.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})})},Fo=n(328),Po=Object(b.a)((function(e){return Object(o.jsx)(u.a,Object(l.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)}}}}})),Yo=Object(d.a)({container:{display:"flex",justifyContent:"flex-start",marginBottom:15},wrapper:{position:"relative",display:"flex",justifyContent:"space-between",alignContent:"center",alignItems:"center",width:200,padding:"5px 5px 12px 5px",backgroundColor:"#ffffff",borderRadius:7,"&:after":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"15px solid #ffffff",borderLeft:"15px solid transparent",borderRight:"15px solid transparent",bottom:"0px",left:"-15px"},"&:before":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"17px solid #ffffff",borderLeft:"16px solid transparent",borderRight:"16px solid transparent",bottom:"0px",left:"-17px"}},wrapperActive:{position:"relative",display:"flex",justifyContent:"space-between",alignContent:"center",alignItems:"center",width:200,padding:"5px 5px 12px 5px",backgroundColor:"#babdbc",borderRadius:7,"&:after":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"15px solid #babdbc",borderLeft:"15px solid transparent",borderRight:"15px solid transparent",bottom:"0px",left:"-15px"},"&:before":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"17px solid #babdbc",borderLeft:"16px solid transparent",borderRight:"16px solid transparent",bottom:"0px",left:"-17px"}},bntDownload:{backgroundColor:"inherit",color:"#54b0fc",width:30,height:30,"&:hover":{backgroundColor:"#54b0fc",color:"#ffffff"}},title:{margin:"0 30px 0 5px",color:"#0e0d0d",cursor:"pointer","&:hover":{color:"#54b0fc"}},time:{position:"absolute",fontSize:".65em",fontWeight:600,bottom:0,right:6,color:"#414141",padding:3,borderRadius:5},overlay:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(104, 105, 104, 0.6)",border:"solid 2px #0084ff",cursor:"pointer",zIndex:100},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"}}),Ho=function(e){var t=e.url,n=e.createdAt,a=e.type,i=e._id,s=Yo(),l=Object(c.useState)(!1),d=Object(r.a)(l,2),b=d[0],j=d[1],u=Object(c.useState)(null),f=Object(r.a)(u,2),x=f[0],h=f[1],m=Object(c.useState)(!1),g=Object(r.a)(m,2),O=g[0],v=g[1],y=Object(c.useState)(!1),C=Object(r.a)(y,2),w=C[0],k=C[1],N=Boolean(x),S=function(){return b&&j(!1)},I=function(e){"copy"===e&&Object(z.a)("Link"),"delete"===e&&k(!0),h(null),v(!1)};return Object(o.jsxs)("div",{className:s.container,children:[b&&Object(o.jsx)("div",{className:s.overlay,id:"overlay",onClick:S,children:Object(o.jsx)(Fo,{allowFullScreen:!0,fileType:a,filePath:t,onError:S})}),Object(o.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),h(e.currentTarget),v(!0)}(e)},className:O?s.wrapperActive:s.wrapper,children:[Object(o.jsx)(so.a,{fontSize:"large",style:{color:"#99b401"}}),!b&&Object(o.jsx)("span",{className:s.title,onClick:function(){return!b&&j(!0)},children:"Read File"}),Object(o.jsx)("a",{href:t,target:"_blank",rel:"noreferrer",download:!0,children:Object(o.jsx)(go.a,{className:s.bntDownload,children:Object(o.jsx)(Co.a,{fontSize:"medium"})})}),Object(o.jsx)("div",{className:s.time,children:Object(z.p)(n)}),Object(o.jsxs)(Po,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:x,open:N,onClose:I,children:[Object(o.jsx)(re.CopyToClipboard,{onCopy:function(){return I("copy")},text:t,children:Object(o.jsxs)(p.a,{children:[Object(o.jsx)(ae.a,{}),"Copy File link"]})}),Object(o.jsxs)(p.a,{style:{color:"#f02a2a"},onClick:function(){return I("delete")},children:[Object(o.jsx)(ct.a,{style:{color:"#f02a2a"}}),"Delete message"]})]}),w&&Object(o.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return k(!1);"delete"===t&&(Object(Oe.o)(i),k(!1))},className:s.overlayDelete,id:"overlay",children:Object(o.jsxs)("div",{className:s.modalDelete,children:[Object(o.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(o.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(o.jsx)(dt.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(o.jsx)(dt.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})]})},Uo=Object(b.a)((function(e){return Object(o.jsx)(u.a,Object(l.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)}}}}})),Vo=Object(d.a)({container:{display:"flex",justifyContent:"flex-end",marginBottom:15},wrapper:{position:"relative",display:"flex",alignItems:"center",alignContent:"center",maxWidth:450,padding:"10px",paddingBottom:18,backgroundColor:"#deffa9",border:"1px solid #d5ff91",borderRadius:7},message:{wordBreak:"break-word",textAlign:"left",font:"400 .9em 'Open Sans', sans-serif","&:after":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"15px solid #deffa9",borderLeft:"15px solid transparent",borderRight:"15px solid transparent",bottom:"0",right:"-15px"},"&:before":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"17px solid #deffa9",borderLeft:"16px solid transparent",borderRight:"16px solid transparent",bottom:"-1px",right:"-17px"}},messageActive:{wordBreak:"break-word",textAlign:"left",font:"400 .9em 'Open Sans', sans-serif","&:after":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"15px solid #ced8d7",borderLeft:"15px solid transparent",borderRight:"15px solid transparent",bottom:"0",right:"-15px"},"&:before":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"17px solid #ced8d7",borderLeft:"16px solid transparent",borderRight:"16px solid transparent",bottom:"-1px",right:"-17px"}},copyIcon:{color:"#b56ff7",cursor:"pointer",marginRight:7,"&:hover":{color:"#9c3bf8"}},time:{position:"absolute",fontSize:".65em",fontWeight:600,bottom:6,right:6,color:"#414141",padding:3,borderRadius:5},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"}}),qo=function(e){var t=e.message,n=e.name,a=e.lastName,i=e.createdAt,s=e._id,l=Vo(),d=Object(c.useState)(null),b=Object(r.a)(d,2),j=b[0],u=b[1],f=Object(c.useState)(!1),x=Object(r.a)(f,2),h=x[0],m=x[1],g=Object(c.useState)(!1),O=Object(r.a)(g,2),v=O[0],y=O[1],C=Boolean(j),w=function(e){"copy"===e&&Object(z.a)("Message"),"delete"===e&&y(!0),u(null),m(!1)};return Object(o.jsx)("div",{className:l.container,children:Object(o.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),u(e.currentTarget),m(!0)}(e)},className:l.wrapper,style:{backgroundColor:h?"#ced8d7":void 0,border:h?"#ced8d7":void 0},children:[Object(o.jsx)(re.CopyToClipboard,{onCopy:function(){return Object(z.a)("Message")},text:t,children:Object(o.jsx)(ae.a,{className:l.copyIcon,fontSize:"large"})}),Object(o.jsx)(M.a,{className:h?l.messageActive:l.message,primary:"".concat(Object(z.c)(n)).concat(Object(z.l)(n,15,1)," \n ").concat(Object(z.c)(a)).concat(Object(z.l)(a,15,1)),primaryTypographyProps:{color:"#42aee0"},secondary:t,secondaryTypographyProps:{color:"#0e0d0d"}}),Object(o.jsx)("div",{className:l.time,children:Object(z.p)(i)}),Object(o.jsxs)(Uo,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:j,open:C,onClose:w,children:[Object(o.jsx)(re.CopyToClipboard,{onCopy:function(){return w("copy")},text:t,children:Object(o.jsxs)(p.a,{children:[Object(o.jsx)(ae.a,{}),"Copy message"]})}),Object(o.jsxs)(p.a,{style:{color:"#f02a2a"},onClick:function(){return w("delete")},children:[Object(o.jsx)(ct.a,{style:{color:"#f02a2a"}}),"Delete message"]})]}),v&&Object(o.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return y(!1);"delete"===t&&(Object(Oe.o)(s),y(!1))},className:l.overlay,id:"overlay",children:Object(o.jsxs)("div",{className:l.modalDelete,children:[Object(o.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(o.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(o.jsx)(dt.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(o.jsx)(dt.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})})},Go=Object(b.a)((function(e){return Object(o.jsx)(u.a,Object(l.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)}}}}})),Zo=Object(d.a)({container:{display:"flex",justifyContent:"flex-end",marginBottom:15},wrapper:{width:400,position:"relative",display:"flex",alignItems:"center",alignContent:"center",justifyContent:"space-between",borderRadius:7,padding:"12px 5px 12px 5px",backgroundColor:"#deffa9","&:after":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"15px solid #deffa9",borderLeft:"15px solid transparent",borderRight:"15px solid transparent",bottom:"0",right:"-15px"},"&:before":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"17px solid #deffa9",borderLeft:"16px solid transparent",borderRight:"16px solid transparent",bottom:"0px",right:"-17px"}},wrapperActive:{width:400,position:"relative",display:"flex",alignItems:"center",alignContent:"center",justifyContent:"space-between",borderRadius:7,padding:"12px 5px 12px 5px",backgroundColor:"#ced8d7","&:after":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"15px solid #ced8d7",borderLeft:"15px solid transparent",borderRight:"15px solid transparent",bottom:"0",right:"-15px"},"&:before":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"17px solid #ced8d7",borderLeft:"16px solid transparent",borderRight:"16px solid transparent",bottom:"0px",right:"-17px"}},image:{borderRadius:7,width:300,maxHeight:400,cursor:"pointer"},time:{position:"absolute",fontSize:".65em",fontWeight:600,bottom:0,right:6,color:"#414141",padding:3,borderRadius:5},bntDownload:{backgroundColor:"inherit",color:"#54b0fc",width:30,height:30,"&:hover":{backgroundColor:"#54b0fc",color:"#ffffff"}},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden",boxSizing:"border-box",display:"flex",justifyContent:"center",alignContent:"center",alignItems:"center"},wrapperOverlayImg:{width:"30%",maxHeight:"80%",position:"relative",display:"flex"},overlayDownloadIcon:{position:"absolute",content:"",right:0,top:-40,cursor:"pointer",color:"#e9e7e7",padding:0,borderRadius:"50%","&:hover":{backgroundColor:"#ffffff",color:"#b8b7b7"}},overlayTime:{position:"absolute",content:"",color:"#ffffff",top:-30,left:0,borderRadius:10,padding:"2px 6px 2px 6px",backgroundColor:"#707070"},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"}}),$o=function(e){var t=e.url,n=e.createdAt,a=e.color,i=(e.message,e.messages,e.fullType),s=e._id,l=Zo(),d=Object(c.useState)(!1),b=Object(r.a)(d,2),j=b[0],u=b[1],f=Object(c.useState)(null),x=Object(r.a)(f,2),h=x[0],m=x[1],g=Object(c.useState)(!1),O=Object(r.a)(g,2),v=O[0],y=O[1],C=Object(c.useState)(!1),w=Object(r.a)(C,2),k=w[0],N=w[1],S=Boolean(h),I=function(e){"copy"===e&&Object(z.a)("Link"),"delete"===e&&N(!0),m(null),y(!1)};return j?Object(o.jsx)("div",{onClick:function(e){return"overlay"===e.target.id&&j&&u(!1)},id:"overlay",className:l.overlay,children:Object(o.jsxs)("div",{className:l.wrapperOverlayImg,children:[Object(o.jsx)("span",{className:l.overlayTime,children:Object(z.n)(n)}),Object(o.jsx)(X.a,{className:l.overlayDownloadIcon,fontSize:"large",onClick:function(){return Object(z.e)(t,i)}}),Object(o.jsx)("img",{width:"100%",height:"auto",alt:"imageItem",src:t})]})}):Object(o.jsx)("div",{className:l.container,children:Object(o.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),m(e.currentTarget),y(!0)}(e)},className:v?l.wrapperActive:l.wrapper,children:[Object(o.jsx)(vo.a,{fontSize:"large",style:{color:"#bd9a00"}}),Object(o.jsx)("img",{onClick:function(){return!j&&u(!0)},className:l.image,alt:"message pic",src:t,style:{backgroundColor:t?"":a},width:"300",height:"400"}),Object(o.jsx)(go.a,{onClick:function(){return Object(z.e)(t,i)},className:l.bntDownload,children:Object(o.jsx)(Co.a,{fontSize:"medium"})}),Object(o.jsx)("div",{className:l.time,children:Object(z.p)(n)}),Object(o.jsxs)(Go,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:h,open:S,onClose:I,children:[Object(o.jsx)(re.CopyToClipboard,{onCopy:function(){return I("copy")},text:t,children:Object(o.jsxs)(p.a,{children:[Object(o.jsx)(ae.a,{}),"Copy Image link"]})}),Object(o.jsxs)(p.a,{style:{color:"#f02a2a"},onClick:function(){return I("delete")},children:[Object(o.jsx)(ct.a,{style:{color:"#f02a2a"}}),"Delete message"]})]}),k&&Object(o.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return N(!1);"delete"===t&&(Object(Oe.o)(s),N(!1))},className:l.overlayDelete,id:"overlay",children:Object(o.jsxs)("div",{className:l.modalDelete,children:[Object(o.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(o.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(o.jsx)(dt.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(o.jsx)(dt.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})})},Ko=Object(b.a)((function(e){return Object(o.jsx)(u.a,Object(l.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)}}}}})),Jo=Object(d.a)({container:{display:"flex",justifyContent:"flex-end",marginBottom:15},wrapper:{position:"relative",display:"flex",justifyContent:"space-between",alignContent:"center",alignItems:"center",padding:"12px 5px 12px 5px",backgroundColor:"#deffa9",borderRadius:7,"&:after":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"15px solid #deffa9",borderLeft:"15px solid transparent",borderRight:"15px solid transparent",bottom:"0",right:"-15px"},"&:before":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"17px solid #deffa9",borderLeft:"16px solid transparent",borderRight:"16px solid transparent",bottom:"0px",right:"-17px"}},wrapperActive:{position:"relative",display:"flex",justifyContent:"space-between",alignContent:"center",alignItems:"center",padding:"12px 5px 12px 5px",backgroundColor:"#ced8d7",borderRadius:7,"&:after":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"15px solid #ced8d7",borderLeft:"15px solid transparent",borderRight:"15px solid transparent",bottom:"0",right:"-15px"},"&:before":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"17px solid #ced8d7",borderLeft:"16px solid transparent",borderRight:"16px solid transparent",bottom:"0px",right:"-17px"}},bntDownload:{backgroundColor:"inherit",color:"#54b0fc",width:30,height:30,"&:hover":{backgroundColor:"#54b0fc",color:"#ffffff"}},player:{margin:"0 5px 0 5px",borderRadius:7},time:{position:"absolute",fontSize:".65em",fontWeight:600,bottom:0,right:6,color:"#414141",padding:3,borderRadius:5},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"}}),Xo=function(e){var t=e.url,n=e.createdAt,a=e.fullType,i=e._id,s=Jo(),l=Object(c.useState)(null),d=Object(r.a)(l,2),b=d[0],j=d[1],u=Object(c.useState)(!1),f=Object(r.a)(u,2),x=f[0],h=f[1],m=Object(c.useState)(!1),g=Object(r.a)(m,2),O=g[0],v=g[1],y=Boolean(b),C=function(e){"copy"===e&&Object(z.a)("Link"),"delete"===e&&v(!0),j(null),h(!1)};return Object(o.jsx)("div",{className:s.container,children:Object(o.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),j(e.currentTarget),h(!0)}(e)},className:x?s.wrapperActive:s.wrapper,children:[Object(o.jsx)(Io.a,{fontSize:"large",style:{color:"#0294c0"}}),Object(o.jsx)(Ro.a,{className:s.player,src:t,controls:!0}),Object(o.jsx)(go.a,{onClick:function(){return Object(z.e)(t,a)},className:s.bntDownload,children:Object(o.jsx)(Co.a,{fontSize:"medium"})}),Object(o.jsx)("div",{className:s.time,children:Object(z.p)(n)}),Object(o.jsxs)(Ko,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:b,open:y,onClose:C,children:[Object(o.jsx)(re.CopyToClipboard,{onCopy:function(){return C("copy")},text:t,children:Object(o.jsxs)(p.a,{children:[Object(o.jsx)(ae.a,{}),"Copy Audio link"]})}),Object(o.jsxs)(p.a,{style:{color:"#f02a2a"},onClick:function(){return C("delete")},children:[Object(o.jsx)(ct.a,{style:{color:"#f02a2a"}}),"Delete message"]})]}),O&&Object(o.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return v(!1);"delete"===t&&(Object(Oe.o)(i),v(!1))},className:s.overlay,id:"overlay",children:Object(o.jsxs)("div",{className:s.modalDelete,children:[Object(o.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(o.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(o.jsx)(dt.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(o.jsx)(dt.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})})},Qo=n(298).Player,ea=Object(b.a)((function(e){return Object(o.jsx)(u.a,Object(l.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)}}}}})),ta=Object(d.a)({container:{display:"flex",justifyContent:"flex-end",marginBottom:15},wrapper:{position:"relative",display:"flex",justifyContent:"space-between",alignContent:"center",alignItems:"center",width:400,padding:"12px 5px 12px 5px",backgroundColor:"#deffa9",borderRadius:7,"&:after":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"15px solid #deffa9",borderLeft:"15px solid transparent",borderRight:"15px solid transparent",bottom:"0",right:"-15px"},"&:before":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"17px solid #deffa9",borderLeft:"16px solid transparent",borderRight:"16px solid transparent",bottom:"0px",right:"-17px"}},wrapperActive:{position:"relative",display:"flex",justifyContent:"space-between",alignContent:"center",alignItems:"center",width:400,padding:"12px 5px 12px 5px",backgroundColor:"#ced8d7",borderRadius:7,"&:after":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"15px solid #ced8d7",borderLeft:"15px solid transparent",borderRight:"15px solid transparent",bottom:"0",right:"-15px"},"&:before":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"17px solid #ced8d7",borderLeft:"16px solid transparent",borderRight:"16px solid transparent",bottom:"0px",right:"-17px"}},bntDownload:{backgroundColor:"inherit",color:"#54b0fc",width:30,height:30,marginLeft:5,"&:hover":{backgroundColor:"#54b0fc",color:"#ffffff"}},time:{position:"absolute",fontSize:".65em",fontWeight:600,bottom:0,right:6,color:"#414141",padding:3,borderRadius:5},player:{backgroundColor:"#deffa9"},playerActive:{backgroundColor:"#ced8d7"},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"}}),na=function(e){var t=e.url,n=e.createdAt,a=e.fullType,i=e._id,s=ta(),l=Object(c.useState)(null),d=Object(r.a)(l,2),b=d[0],j=d[1],u=Object(c.useState)(!1),f=Object(r.a)(u,2),x=f[0],h=f[1],m=Object(c.useState)(!1),g=Object(r.a)(m,2),O=g[0],v=g[1],y=Boolean(b),C=function(e){"copy"===e&&Object(z.a)("Link"),"delete"===e&&v(!0),j(null),h(!1)};return Object(o.jsx)("div",{className:s.container,children:Object(o.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),j(e.currentTarget),h(!0)}(e)},className:x?s.wrapperActive:s.wrapper,children:[Object(o.jsx)(To.a,{fontSize:"large",style:{color:"#03b003"}}),Object(o.jsx)(Qo,{className:x?s.playerActive:s.player,playsInline:!0,src:t}),Object(o.jsx)(go.a,{onClick:function(){return Object(z.e)(t,a)},className:s.bntDownload,children:Object(o.jsx)(Co.a,{fontSize:"medium"})}),Object(o.jsx)("div",{className:s.time,children:Object(z.p)(n)}),Object(o.jsxs)(ea,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:b,open:y,onClose:C,children:[Object(o.jsx)(re.CopyToClipboard,{onCopy:function(){return C("copy")},text:t,children:Object(o.jsxs)(p.a,{children:[Object(o.jsx)(ae.a,{}),"Copy Video link"]})}),Object(o.jsxs)(p.a,{style:{color:"#f02a2a"},onClick:function(){return C("delete")},children:[Object(o.jsx)(ct.a,{style:{color:"#f02a2a"}}),"Delete message"]})]}),O&&Object(o.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return v(!1);"delete"===t&&(Object(Oe.o)(i),v(!1))},className:s.overlay,id:"overlay",children:Object(o.jsxs)("div",{className:s.modalDelete,children:[Object(o.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(o.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(o.jsx)(dt.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(o.jsx)(dt.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})})},oa=n(328),aa=Object(b.a)((function(e){return Object(o.jsx)(u.a,Object(l.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(d.a)({container:{display:"flex",justifyContent:"flex-end",marginBottom:15},wrapper:{position:"relative",display:"flex",justifyContent:"space-between",alignContent:"center",alignItems:"center",width:200,padding:"5px 5px 12px 5px",backgroundColor:"#deffa9",borderRadius:7,"&:after":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"15px solid #deffa9",borderLeft:"15px solid transparent",borderRight:"15px solid transparent",bottom:"0",right:"-15px"},"&:before":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"17px solid #deffa9",borderLeft:"16px solid transparent",borderRight:"16px solid transparent",bottom:"0px",right:"-17px"}},wrapperActive:{position:"relative",display:"flex",justifyContent:"space-between",alignContent:"center",alignItems:"center",width:200,padding:"5px 5px 12px 5px",backgroundColor:"#ced8d7",borderRadius:7,"&:after":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"15px solid #ced8d7",borderLeft:"15px solid transparent",borderRight:"15px solid transparent",bottom:"0",right:"-15px"},"&:before":{content:"''",position:"absolute",width:"0",height:"0",borderBottom:"17px solid #ced8d7",borderLeft:"16px solid transparent",borderRight:"16px solid transparent",bottom:"0px",right:"-17px"}},bntDownload:{backgroundColor:"inherit",color:"#54b0fc",width:30,height:30,"&:hover":{backgroundColor:"#54b0fc",color:"#ffffff"}},title:{margin:"0 30px 0 5px",color:"#0e0d0d",cursor:"pointer","&:hover":{color:"#54b0fc"}},time:{position:"absolute",fontSize:".65em",fontWeight:600,bottom:0,right:6,color:"#414141",padding:3,borderRadius:5},overlay:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(104, 105, 104, 0.6)",border:"solid 2px #0084ff",cursor:"pointer",zIndex:100},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"}}),ca=function(e){var t=e.url,n=e.createdAt,a=e.type,i=e._id,s=ra(),l=Object(c.useState)(!1),d=Object(r.a)(l,2),b=d[0],j=d[1],u=Object(c.useState)(null),f=Object(r.a)(u,2),x=f[0],h=f[1],m=Object(c.useState)(!1),g=Object(r.a)(m,2),O=g[0],v=g[1],y=Object(c.useState)(!1),C=Object(r.a)(y,2),w=C[0],k=C[1],N=Boolean(x),S=function(){return b&&j(!1)},I=function(e){"copy"===e&&Object(z.a)("Link"),"delete"===e&&k(!0),h(null),v(!1)};return Object(o.jsxs)("div",{className:s.container,children:[b&&Object(o.jsx)("div",{className:s.overlay,id:"overlay",onClick:S,children:Object(o.jsx)(oa,{allowFullScreen:!0,fileType:a,filePath:t,onError:S})}),Object(o.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),h(e.currentTarget),v(!0)}(e)},className:O?s.wrapperActive:s.wrapper,children:[Object(o.jsx)(so.a,{fontSize:"large",style:{color:"#99b401"}}),!b&&Object(o.jsx)("span",{className:s.title,onClick:function(){return!b&&j(!0)},children:"Read File"}),Object(o.jsx)("a",{href:t,target:"_blank",rel:"noreferrer",download:!0,children:Object(o.jsx)(go.a,{className:s.bntDownload,children:Object(o.jsx)(Co.a,{fontSize:"medium"})})}),Object(o.jsx)("div",{className:s.time,children:Object(z.p)(n)}),Object(o.jsxs)(aa,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:x,open:N,onClose:I,children:[Object(o.jsx)(re.CopyToClipboard,{onCopy:function(){return I("copy")},text:t,children:Object(o.jsxs)(p.a,{children:[Object(o.jsx)(ae.a,{}),"Copy File link"]})}),Object(o.jsxs)(p.a,{style:{color:"#f02a2a"},onClick:function(){return I("delete")},children:[Object(o.jsx)(ct.a,{style:{color:"#f02a2a"}}),"Delete message"]})]}),w&&Object(o.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return k(!1);"delete"===t&&(Object(Oe.o)(i),k(!1))},className:s.overlayDelete,id:"overlay",children:Object(o.jsxs)("div",{className:s.modalDelete,children:[Object(o.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(o.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(o.jsx)(dt.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(o.jsx)(dt.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})]})},ia=Object(d.a)({container:{display:"flex",justifyContent:"center",marginBottom:15},wrapper:{textAlign:"center",padding:"1px 10px 3px 10px",backgroundColor:"rgba(104, 105, 104, 0.8)",color:"#ffffff",borderRadius:7,fontSize:".85em",fontWeight:600}}),sa=function(e){var t=e.message,n=ia();return Object(o.jsx)("div",{className:n.container,children:Object(o.jsx)("span",{className:n.wrapper,children:t})})},la=function(e){return e.messages.messages},da=Object(Ce.a)([la],(function(e){return e})),ba=n(42),ja=function(e,t){return function(){var n=Object(me.a)(he.a.mark((function n(o){var a;return he.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,Object(Oe.h)(e);case 3:(a=n.sent)&&o(Object(ba.b)(a)),t&&t(),n.next=11;break;case 8:n.prev=8,n.t0=n.catch(0),o(Object(ba.a)());case 11:case"end":return n.stop()}}),n,null,[[0,8]])})));return function(e){return n.apply(this,arguments)}}()},ua=n(410),pa=Object(d.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%"}}),fa=function(){var e,t=pa(),n=Object(i.b)(),a=Object(i.c)(da),s=Object(i.c)(cn.a),l=Object(i.c)(ht.a),d=l.companionId,b=l.total,j=l.seen,u=l.mute,p=Object(i.c)(Se),f=Object(c.useState)(!1),x=Object(r.a)(f,2),h=x[0],m=x[1],g=Object(c.useState)({new:0,mute:!1}),O=Object(r.a)(g,2),v=O[0],y=O[1],C=Object(c.useRef)(null),w=function(){C.current&&C.current.scrollTo({top:C.current.scrollHeight,behavior:"smooth"})},k=Object(c.useCallback)((function(e){var t=e.target,n=t.scrollHeight,o=t.scrollTop,a=t.clientHeight,r=n-Math.floor(o);b!==j&&r-a<10&&Object(Oe.q)(d),m(r!==a)}),[b,j,d]),N=ua(k,300);return Object(c.useEffect)((function(){p&&(n(ja(d,w)),n(Object(Ae.c)(!1)))}),[n,p,d]),Object(c.useEffect)((function(){var e=function(){var e;n((e=d,function(){var t=Object(me.a)(he.a.mark((function t(n){var o;return he.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Object(Oe.e)(e);case 3:(o=t.sent)&&n(Object(ze.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)}}())),n(ja(d,null))};e();var t=setInterval(e,z.k);return function(){return clearInterval(t)}}),[n,d]),Object(c.useEffect)((function(){y({new:b-j,mute:u})}),[b,j,u]),Object(c.useEffect)((function(){if(C.current){var e=C.current,t=e.scrollHeight,n=e.clientHeight;b!==j&&t===n&&Object(Oe.q)(d)}}),[b,j,d]),Object(o.jsxs)("div",{className:t.container,children:[Object(o.jsx)(Vn,{isArrow:h,isNew:v,handleScrollTo:w}),Object(o.jsx)("div",{ref:C,onScroll:N,className:a.length>0?t.messagesScroll:t.messagesEmpty,children:Object(o.jsx)("div",{className:t.messagesBody,children:a.length>0?a.map((function(t){var n,r=t.message,c=t.name,i=t.lastName,l=t.color,d=t.createdAt,b=t.number,j=t.type,u=t.fullType,p=t._id;e?Object(z.o)(e)!==Object(z.o)(d)&&(e=d,n=!0):(n=!0,e=d);var f="".concat(z.j,"/").concat(r);if(b!==s){if("text"===j)return Object(o.jsxs)("div",{children:[n&&Object(o.jsx)(sa,{message:Object(z.o)(d)}),Object(o.jsx)(mo,{message:r,createdAt:d,name:c,lastName:i,_id:p})]},d);if("image"===j)return Object(o.jsxs)("div",{children:[n&&Object(o.jsx)(sa,{message:Object(z.o)(d)}),Object(o.jsx)(No,{url:f,createdAt:d,color:l,message:r,messages:a,fullType:u,_id:p})]},d);if("audio"===j)return Object(o.jsxs)("div",{children:[n&&Object(o.jsx)(sa,{message:Object(z.o)(d)}),Object(o.jsx)(Mo,{url:f,createdAt:d,fullType:u,_id:p})]},d);if("video"===j)return Object(o.jsxs)("div",{children:[n&&Object(o.jsx)(sa,{message:Object(z.o)(d)}),Object(o.jsx)(_o,{url:f,createdAt:d,fullType:u,_id:p})]},d);if(j)return Object(o.jsxs)("div",{children:[n&&Object(o.jsx)(sa,{message:Object(z.o)(d)}),Object(o.jsx)(Ho,{url:f,createdAt:d,type:j,_id:p})]},d)}else{if("text"===j)return Object(o.jsxs)("div",{children:[n&&Object(o.jsx)(sa,{message:Object(z.o)(d)}),Object(o.jsx)(qo,{message:r,createdAt:d,name:c,lastName:i,_id:p})]},d);if("image"===j)return Object(o.jsxs)("div",{children:[n&&Object(o.jsx)(sa,{message:Object(z.o)(d)}),Object(o.jsx)($o,{url:f,createdAt:d,color:l,message:r,messages:a,fullType:u,_id:p})]},d);if("audio"===j)return Object(o.jsxs)("div",{children:[n&&Object(o.jsx)(sa,{message:Object(z.o)(d)}),Object(o.jsx)(Xo,{url:f,createdAt:d,fullType:u,_id:p})]},d);if("video"===j)return Object(o.jsxs)("div",{children:[n&&Object(o.jsx)(sa,{message:Object(z.o)(d)}),Object(o.jsx)(na,{url:f,createdAt:d,fullType:u,_id:p})]},d);if(j)return Object(o.jsxs)("div",{children:[n&&Object(o.jsx)(sa,{message:Object(z.o)(d)}),Object(o.jsx)(ca,{url:f,createdAt:d,type:j,_id:p})]},d)}})):Object(o.jsx)(_,{name:"You do not have messages yet!"})})}),Object(o.jsx)(fo,{isArrow:h})]})},xa=n(521),ha=Object(d.a)({container:{position:"absolute"}}),ma=function(e){var t=e.disabled,n=e.date,a=e.changeDate,r=e.handleOnOpen,c=ha();return Object(o.jsx)(qe.a,{disabled:t,className:c.container,inputVariant:"outlined",orientation:"portrait",variant:"dialog",openTo:"date",autoOk:!0,value:n||new Date,onOpen:r,onChange:a})},ga=Object(b.a)("div")((function(e){e.theme;return{position:"relative",borderRadius:"20px",backgroundColor:"#f1f0f0",width:"100%",margin:"0 5% 0 5%"}})),Oa=Object(b.a)("div")((function(e){return{padding:e.theme.spacing(0,2),height:"100%",position:"absolute",pointerEvents:"none",display:"flex",alignItems:"center",justifyContent:"center"}})),va=Object(b.a)(Fe.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%"}}})),ya=Object(d.a)({toolBar:{color:"#b1aeae",height:"7vh"},searchBarActive:{outline:"2px solid #2184f7",color:"#2184f7"}}),Ca={inputProps:{"aria-label":"Switch demo"}},wa=function(e){var t=e.handleSearch,n=e.value,a=e.setDate,r=e.date,c=Object(i.b)(),s=ya(),d=Object(i.c)(ht.a),b=d.sort,j=d.companionId,u=!(Object(i.c)(la).length>0);return Object(o.jsxs)(Be.a,{className:s.toolBar,children:[Object(o.jsx)(Te.a,{onClick:function(){return c(Object(Ae.b)(""))},"aria-label":"delete",size:"medium",children:Object(o.jsx)(O.a,{fontSize:"medium"})}),Object(o.jsxs)(ga,{className:!n||u?void 0:s.searchBarActive,children:[Object(o.jsx)(Oa,{children:Object(o.jsx)(_e.a,{})}),Object(o.jsx)(va,{disabled:u,onChange:t,placeholder:u?"Disabled":"Search",value:n,inputProps:{"aria-label":"search"}})]}),Object(o.jsxs)(Te.a,{"aria-label":"delete",size:"medium",disabled:u,children:[Object(o.jsx)(ma,{disabled:u,date:r,changeDate:a,handleOnOpen:function(){return a("")}}),Object(o.jsx)(Ve.a,{fontSize:"medium",style:{color:r?"#2184f7":"#b1aeae"}})]}),Object(o.jsx)(He.a,Object(l.a)(Object(l.a)({onClick:function(){return Object(Oe.x)(j)},checked:b},Ca),{},{disabled:u}))]})},ka=Object(d.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:{"&:hover":{backgroundColor:"#f0f0f0"}}}),Na=function(){var e=ka(),t=Object(i.c)(ht.a).sort,n=Object(i.c)(la),a=Object(c.useState)(""),s=Object(r.a)(a,2),l=s[0],d=s[1],b=Object(c.useState)(""),u=Object(r.a)(b,2),p=u[0],f=u[1],x=function(e){return e.filter((function(e){return p?e.message.toLowerCase().includes(l.toLowerCase())&&Object(z.o)(p)===Object(z.o)(e.createdAt)?e:void 0:e.message.toLowerCase().includes(l.toLowerCase())}))}(Object(z.f)("createdAt",n,t));return Object(o.jsxs)("div",{className:e.container,children:[Object(o.jsx)(wa,{handleSearch:function(e){return d(e.target.value)},value:l,setDate:f,date:p}),Object(o.jsx)("div",{className:n.length>0?e.list:void 0,children:n.length>0?x.length>0?Object(o.jsx)(N.a,{sx:{width:"100%"},children:x.map((function(t){var n=t.name,a=t.lastName,r=t.avatarUrl,c=t.color,i=t.message,s=t.createdAt;return Object(o.jsxs)("div",{children:[Object(o.jsxs)(Y.a,{alignItems:"flex-start",className:e.listItem,children:[Object(o.jsx)(H.a,{children:Object(o.jsx)(j.a,{alt:n,src:r?"".concat(z.j,"/").concat(r):void 0,sx:{background:c,width:44,height:44,marginRight:2},children:!r&&"".concat(Object(z.c)(n)).concat(Object(z.c)(a))})}),Object(o.jsx)(M.a,{primary:"".concat(Object(z.c)(n)).concat(Object(z.l)(n,15,1)," \n ").concat(Object(z.c)(a)).concat(Object(z.l)(a,15,1)),secondary:Object(o.jsxs)(o.Fragment,{children:[Object(o.jsx)(xa.a,{sx:{display:"block",wordBreak:"break-word"},component:"span",variant:"body2",color:"text.primary",children:i}),Object(z.n)(s)]})})]}),Object(o.jsx)(q.a,{variant:"inset"})]},s)}))}):Object(o.jsx)(_,{name:"Can not find message by request: ".concat(l)}):Object(o.jsx)(_,{name:"You do not have messages yet!"})})]})},Sa=Object(d.a)({container:{display:"flex",alignContent:"center",alignItems:"center",height:"7vh"},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}}}),Ia=function(){var e=Object(i.b)(),t=Sa(),n=Object(i.c)(Wt),a=Object(i.c)(ht.a).number,s=Object(c.useState)(!1),l=Object(r.a)(s,2),d=l[0],b=l[1];return Object(c.useEffect)((function(){var e=n.find((function(e){return e.number===a}));b(!!e)}),[n,a]),Object(o.jsxs)(S.a,{className:t.container,direction:"row",children:[Object(o.jsx)(Te.a,{onClick:function(){return e(Object(Ae.b)(""))},"aria-label":"delete",size:"medium",children:Object(o.jsx)(O.a,{className:t.iconClose,fontSize:"medium"})}),Object(o.jsx)(I.a,{variant:"h6",color:"initial",style:{marginLeft:20,color:"#474747"},children:"Profile"}),Object(o.jsx)(Te.a,{style:{marginLeft:"auto",marginRight:"3%"},"aria-label":"delete",size:"medium",children:d?Object(o.jsx)(Jt.a,{onClick:function(){return e(Object(Ae.b)("edit"))},fontSize:"medium"}):Object(o.jsx)(y.a,{onClick:function(){return e(Pt(a))},fontSize:"medium"})})]})},za=Object(d.a)({container:{position:"relative"},nameTile:{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"},timeTile:{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"}}),Ra=function(){var e=za(),t=Object(i.c)(ht.a),n=t.name,a=t.lastName,r=t.online,c=t.avatarsArr;return Object(o.jsxs)("div",{className:e.container,children:[Object(o.jsx)(sn.Carousel,{children:c.map((function(e){var t=e.avatarUrl,n=e.updatedAt;return Object(o.jsxs)("div",{children:[Object(o.jsx)("img",{alt:"pic",src:"".concat(z.j,"/").concat(t)}),Object(o.jsx)("p",{className:"legend",children:Object(z.n)(n)})]})}))}),Object(o.jsx)("span",{className:e.nameTile,children:"".concat(Object(z.c)(n)).concat(Object(z.l)(n,15,1),"\n ").concat(Object(z.c)(a)).concat(Object(z.l)(a,15,1))}),Object(o.jsx)("span",{className:e.timeTile,children:"true"===r?"online":"last seen ".concat(Object(z.n)(r))})]})},Aa=n(412),Da=n.n(Aa),Ma=n(413),Ba=n.n(Ma),Ta=n(411),Ea=n.n(Ta),La=Object(d.a)({listIcon:{marginRight:15}}),Wa={inputProps:{"aria-label":"Switch demo"}},_a=function(e){var t=e.disabled,n=La(),a=Object(i.c)(ht.a),r=a.number,c=a.mute,s=a.sort,d=a.companionId,b=a.originalName,j=a.originalLastName,u="".concat(Object(z.c)(b)).concat(Object(z.l)(b,15,1),"\n ").concat(Object(z.c)(j)).concat(Object(z.l)(j,15,1));return Object(o.jsx)(Ot.a,{children:Object(o.jsxs)(vt.a,{children:[Object(o.jsx)(re.CopyToClipboard,{onCopy:function(){return Object(z.a)("Number")},text:r,children:Object(o.jsxs)(p.a,{children:[Object(o.jsx)(B.a,{className:n.listIcon,children:Object(o.jsx)(pn.a,{fontSize:"medium"})}),Object(o.jsx)(M.a,{primary:r,secondary:"Phone"})]})}),Object(o.jsx)(q.a,{variant:"inset"}),Object(o.jsx)(re.CopyToClipboard,{onCopy:function(){return Object(z.a)("Username")},text:u,children:Object(o.jsxs)(p.a,{style:{cursor:"pointer"},children:[Object(o.jsx)(B.a,{className:n.listIcon,children:Object(o.jsx)(Ea.a,{fontSize:"medium"})}),Object(o.jsx)(M.a,{primary:u,secondary:"Username"})]})}),Object(o.jsx)(q.a,{variant:"inset"}),Object(o.jsxs)(p.a,{style:{cursor:"default"},children:[Object(o.jsx)(B.a,{className:n.listIcon,children:Object(o.jsx)(Da.a,{fontSize:"medium"})}),Object(o.jsx)(M.a,{primary:"Notification"}),Object(o.jsx)(He.a,Object(l.a)(Object(l.a)({style:{cursor:"pointer"},onClick:function(){return Object(Oe.k)(d)}},Wa),{},{checked:!c}))]}),Object(o.jsx)(q.a,{variant:"inset"}),Object(o.jsxs)(p.a,{disabled:t,style:{cursor:"default"},children:[Object(o.jsx)(B.a,{className:n.listIcon,children:Object(o.jsx)(Ba.a,{fontSize:"medium"})}),Object(o.jsx)(M.a,{primary:"Sort by Date"}),Object(o.jsx)(He.a,Object(l.a)(Object(l.a)({style:{cursor:"pointer"},onClick:function(){return Object(Oe.x)(d)}},Wa),{},{checked:s}))]})]})})},Fa=Object(d.a)({folderIcon:{color:"#54b0fc",cursor:"pointer","&:hover":{color:"#016cc3"}},listItem:{"&:hover":{backgroundColor:"#f0f0f0"}}}),Pa=function(e){var t=e.filteredAndSorted,n=Fa();return t.length>0?Object(o.jsx)(N.a,{children:t.map((function(e){var t=e.message,a=e.createdAt,r=e.fullType;return Object(o.jsxs)("div",{children:[Object(o.jsxs)(Y.a,{alignItems:"flex-start",className:n.listItem,children:[Object(o.jsx)(H.a,{children:Object(o.jsx)(le.a,{onClick:function(){return Object(z.e)("".concat(z.j,"/").concat(t),r)},className:n.folderIcon,fontSize:"large"})}),Object(o.jsx)(M.a,{primary:r,secondary:Object(z.n)(a)})]}),Object(o.jsx)(q.a,{variant:"inset"})]},a)}))}):Object(o.jsx)(_,{name:"You do not have Audio yet!"})},Ya=Object(d.a)({overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden",boxSizing:"border-box",display:"flex",justifyContent:"center",alignContent:"center",alignItems:"center"},wrapper:{width:"30%",maxHeight:"80%",position:"relative",display:"flex"},downloadIcon:{position:"absolute",content:"",right:0,top:-40,cursor:"pointer",color:"#e9e7e7",padding:0,borderRadius:"50%","&:hover":{backgroundColor:"#ffffff",color:"#b8b7b7"}},img:{cursor:"pointer","&:hover":{scale:.98}},time:{position:"absolute",content:"",color:"#ffffff",top:-30,left:0,borderRadius:10,padding:"2px 6px 2px 6px",backgroundColor:"#707070"}}),Ha=function(e){var t=e.message,n=e.fullType,a=e.updatedAt,i=Ya(),s=Object(c.useState)(!1),l=Object(r.a)(s,2),d=l[0],b=l[1],j="".concat(z.j,"/").concat(t);return d?Object(o.jsx)("div",{onClick:function(e){return"overlay"===e.target.id&&d&&b(!1)},id:"overlay",className:i.overlay,children:Object(o.jsxs)("div",{className:i.wrapper,children:[Object(o.jsx)("span",{className:i.time,children:Object(z.n)(a)}),Object(o.jsx)(X.a,{className:i.downloadIcon,fontSize:"large",onClick:function(){return Object(z.e)(j,n)}}),Object(o.jsx)("img",{width:"100%",height:"auto",alt:"imageItem",src:j})]})}):Object(o.jsx)(K.a,{children:Object(o.jsx)("img",{onClick:function(){return!d&&b(!0)},className:i.img,src:"".concat(j,"?w=164&h=164&fit=crop&auto=format"),srcSet:"".concat(j,"?w=164&h=164&fit=crop&auto=format&dpr=2 2x"),alt:"imageItem",loading:"lazy"})})},Ua=function(e){var t=e.filteredAndSorted;return t.length>0?Object(o.jsx)($.a,{sx:{width:"100%",height:"auto",overflow:"hidden"},cols:3,rowHeight:164,children:t.map((function(e){var t=e.message,n=e.createdAt,a=e.fullType,r=e.updatedAt;return Object(o.jsx)(Ha,{message:t,fullType:a,updatedAt:r},n)}))}):Object(o.jsx)(_,{name:"You do not have Media yet!"})},Va=Object(d.a)({folderIcon:{color:"#54b0fc",cursor:"pointer","&:hover":{color:"#016cc3"}},listItem:{"&:hover":{backgroundColor:"#f0f0f0"}}}),qa=function(e){var t=e.filteredAndSorted,n=Va();return t.length>0?Object(o.jsx)(N.a,{children:t.map((function(e){var t=e.message,a=e.createdAt,r=e.fullType;return Object(o.jsxs)("div",{children:[Object(o.jsxs)(Y.a,{alignItems:"flex-start",className:n.listItem,children:[Object(o.jsx)(H.a,{children:Object(o.jsx)(V.a,{onClick:function(){return Object(z.e)("".concat(z.j,"/").concat(t),r)},className:n.folderIcon,fontSize:"large"})}),Object(o.jsx)(M.a,{primary:r,secondary:Object(z.n)(a)})]}),Object(o.jsx)(q.a,{variant:"inset"})]},a)}))}):Object(o.jsx)(_,{name:"You do not have Files yet!"})},Ga=Object(d.a)({listItem:{"&:hover":{backgroundColor:"#f0f0f0"}},copyIcon:{color:"#54b0fc",cursor:"pointer","&:hover":{color:"#016cc3"}}}),Za=function(e){var t=e.filteredAndSorted,n=Ga();return t.length>0?Object(o.jsx)(N.a,{children:t.map((function(e){var t=e.message,a=e.createdAt,r=e.lastName,c=e.name,i=e.color,s=e.avatarUrl;return Object(o.jsxs)("div",{children:[Object(o.jsxs)(Y.a,{alignItems:"flex-start",className:n.listItem,children:[Object(o.jsx)(H.a,{children:Object(o.jsx)(j.a,{alt:c,src:s?"".concat(z.j,"/").concat(s):void 0,sx:{background:i,width:38,height:38},children:"".concat(Object(z.c)(c)).concat(Object(z.c)(r))})}),Object(o.jsx)(M.a,{style:{wordBreak:"break-word",marginRight:2},primary:t,secondary:Object(z.n)(a),secondaryTypographyProps:{color:"#020202",paddingTop:.5}}),Object(o.jsx)(re.CopyToClipboard,{onCopy:function(){return Object(z.a)("Message")},text:t,children:Object(o.jsx)(ae.a,{className:n.copyIcon,fontSize:"large"})})]}),Object(o.jsx)(q.a,{variant:"inset"})]},a)}))}):Object(o.jsx)(_,{name:"You do not have Text yet!"})},$a=Object(d.a)({folderIcon:{color:"#54b0fc",cursor:"pointer","&:hover":{color:"#016cc3"}},listItem:{"&:hover":{backgroundColor:"#f0f0f0"}}}),Ka=function(e){var t=e.filteredAndSorted,n=$a();return t.length>0?Object(o.jsx)(N.a,{children:t.map((function(e){var t=e.message,a=e.createdAt,r=e.fullType;return Object(o.jsxs)("div",{children:[Object(o.jsxs)(Y.a,{alignItems:"flex-start",className:n.listItem,children:[Object(o.jsx)(H.a,{children:Object(o.jsx)(ue.a,{onClick:function(){return Object(z.e)("".concat(z.j,"/").concat(t),r)},className:n.folderIcon,fontSize:"large"})}),Object(o.jsx)(M.a,{primary:r,secondary:Object(z.n)(a)})]},a),Object(o.jsx)(q.a,{variant:"inset"})]},a)}))}):Object(o.jsx)(_,{name:"You do not have Audio yet!"})},Ja=Object(d.a)({container:{borderBottom:"solid 2px #dddddd",display:"flex",justifyContent:"space-around",alignContent:"center",alignItems:"center",flexWrap:"nowrap",height:"7vh",color:"rgba(0, 0, 0, 0.6)"},item:{height:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignContent:"center",alignItems:"center",cursor:"pointer"},icon:{fontSize:"1rem",lineHeight:0,marginBottom:0,fontWeight:600},underline:{fontSize:"2.5rem",lineHeight:0}}),Xa=function(e){var t=e.setDisabled,n=Ja(),a=Object(i.c)(ht.a).sort,s=Object(i.c)(da),l=Object(c.useState)(0),d=Object(r.a)(l,2),b=d[0],j=d[1],u=function(e){return j(e)},p=["text","image","text","audio","video"],f=Object(z.f)("createdAt",s,a).filter((function(e){if(0!==b){if(e.type===p[b])return e}else if(e.type!==p[b])return e}));return Object(c.useEffect)((function(){t(!(f.length>0))}),[f,t]),Object(o.jsxs)(o.Fragment,{children:[Object(o.jsxs)("div",{className:n.container,children:[Object(o.jsxs)("div",{className:n.item,style:{color:0===b?"#1976d2":"rgba(0, 0, 0, 0.6)"},onClick:function(){return u(0)},children:[Object(o.jsx)("span",{className:n.icon,children:"Files"}),Object(o.jsx)("span",{className:n.underline,children:"___"})]}),Object(o.jsxs)("div",{className:n.item,style:{color:1===b?"#1976d2":"rgba(0, 0, 0, 0.6)"},onClick:function(){return u(1)},children:[Object(o.jsx)("span",{className:n.icon,children:"Media"}),Object(o.jsx)("span",{className:n.underline,children:"___"})]}),Object(o.jsxs)("div",{className:n.item,style:{color:2===b?"#1976d2":"rgba(0, 0, 0, 0.6)"},onClick:function(){return u(2)},children:[Object(o.jsx)("span",{className:n.icon,children:"Text"}),Object(o.jsx)("span",{className:n.underline,children:"___"})]}),Object(o.jsxs)("div",{className:n.item,style:{color:3===b?"#1976d2":"rgba(0, 0, 0, 0.6)"},onClick:function(){return u(3)},children:[Object(o.jsx)("span",{className:n.icon,children:"Audio"}),Object(o.jsx)("span",{className:n.underline,children:"___"})]}),Object(o.jsxs)("div",{className:n.item,style:{color:4===b?"#1976d2":"rgba(0, 0, 0, 0.6)"},onClick:function(){return u(4)},children:[Object(o.jsx)("span",{className:n.icon,children:"Video"}),Object(o.jsx)("span",{className:n.underline,children:"___"})]})]}),0===b&&Object(o.jsx)(qa,{filteredAndSorted:f}),1===b&&Object(o.jsx)(Ua,{filteredAndSorted:f}),2===b&&Object(o.jsx)(Za,{filteredAndSorted:f}),3===b&&Object(o.jsx)(Pa,{filteredAndSorted:f}),4===b&&Object(o.jsx)(Ka,{filteredAndSorted:f})]})},Qa=Object(d.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"}}}),er=function(){var e=Qa(),t=Object(i.b)(),n=Object(i.c)(Ie).leftIsOpen,a=Object(c.useState)(!1),s=Object(r.a)(a,2),l=s[0],d=s[1];return Object(c.useEffect)((function(){var e=function(){return"contacts"!==n&&t(Ft())};e();var o=setInterval(e,z.k);return function(){return clearInterval(o)}}),[n,t]),Object(o.jsxs)("div",{className:e.container,children:[Object(o.jsx)(Ia,{}),Object(o.jsxs)("div",{className:e.scrollContainer,children:[Object(o.jsx)(Ra,{}),Object(o.jsx)(_a,{disabled:l}),Object(o.jsx)(Xa,{setDisabled:d})]})]})},tr=Object(d.a)({container:{height:"7vh",width:"100%",display:"flex",alignContent:"center",alignItems:"center",backgroundColor:"#ffffff"},iconArrow:{"&:hover":{transform:"rotate(360deg)",transition:"all 250ms ease-out "}}}),nr=function(){var e=Object(i.b)(),t=tr();return Object(o.jsxs)(S.a,{className:t.container,direction:"row",spacing:21,children:[Object(o.jsx)(Te.a,{onClick:function(){return e(Object(Ae.b)("credentials"))},"aria-label":"delete",size:"medium",children:Object(o.jsx)(Ye.a,{className:t.iconArrow,fontSize:"medium"})}),Object(o.jsx)(I.a,{style:{marginLeft:20,color:"#474747"},variant:"h6",color:"initial",children:"Edit chat"})]})},or=n(501),ar=Object(d.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)"}}}),rr={inputProps:{"aria-label":"Checkbox demo"}},cr=function(e){var t=ar(),n=e.chat,a=e.name,r=e.setName,c=e.lastName,i=e.setLastName,s=e.mute,d=e.setMute,b=e.openBtn,u=e.setOpenBtn,p=n.avatarUrl,f=n.color,x=n.originalName,h=n.originalLastName,m=function(e){!b&&u(!0);var t=Object(z.d)(e.target.value);switch(e.target.name){case"name":r(t);break;case"lastName":i(t)}};return Object(o.jsxs)("div",{className:t.container,children:[Object(o.jsx)(H.a,{style:{marginBottom:10},children:Object(o.jsx)(j.a,{alt:a,src:p?"".concat(z.j,"/").concat(p):void 0,sx:{background:f,width:120,height:120,marginRight:2},children:"".concat(Object(z.c)(a)).concat(Object(z.c)(c))})}),Object(o.jsx)(I.a,{style:{color:"#080808",fontSize:22,fontWeight:500},children:"".concat(Object(z.c)(x)).concat(Object(z.l)(x,15,1)," \n ").concat(Object(z.c)(h)).concat(Object(z.l)(h,15,1))}),Object(o.jsx)(I.a,{style:{fontSize:17,marginBottom:20},children:"original name"}),Object(o.jsx)(Ut.a,{id:"name",name:"name",label:"Name",value:a,fullWidth:!0,variant:"outlined",onChange:m,className:t.textField}),Object(o.jsx)(Ut.a,{id:"lastName",name:"lastName",label:"LastName",value:c,fullWidth:!0,variant:"outlined",onChange:m,className:t.textField}),Object(o.jsxs)("div",{className:t.notifications,children:[Object(o.jsx)(or.a,Object(l.a)(Object(l.a)({onChange:function(){d(!s),!b&&u(!0)}},rr),{},{checked:!s,style:{marginRight:20}})),Object(o.jsx)(M.a,{primary:"Notifications",primaryTypographyProps:{color:"#0e0d0d"},secondary:s?"Enabled":"Disabled"})]})]})},ir=Object(d.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"}}),sr=function(e){var t=e.isContact,n=ir(),a=Object(i.b)(),s=t._id,l=t.avatarUrl,d=t.color,b=t.name,u=t.lastName,f=Object(c.useState)(!1),x=Object(r.a)(f,2),h=x[0],m=x[1];return Object(o.jsxs)(o.Fragment,{children:[Object(o.jsx)("ul",{className:n.container,children:Object(o.jsxs)(p.a,{onClick:function(){return m(!0)},style:{fontSize:19,color:"#f02a2a"},children:[Object(o.jsx)(ct.a,{fontSize:"medium",style:{marginRight:27}}),"Delete contact"]})}),h&&Object(o.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return m(!1);"delete"===t&&(a(Object(Ae.b)("credentials")),Object(Oe.n)(s),m(!1))},className:n.overlay,id:"overlay",children:Object(o.jsxs)("div",{className:n.modalDelete,children:[Object(o.jsxs)("div",{className:n.titleWrapper,children:[Object(o.jsx)(j.a,{alt:b,src:l?"".concat(z.j,"/").concat(l):void 0,sx:{background:d,width:38,height:38,marginRight:2},children:"".concat(Object(z.c)(b)).concat(Object(z.c)(u))}),Object(o.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete contact"})]}),Object(o.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete contact\n ".concat("".concat(Object(z.c)(b)).concat(Object(z.l)(b,15,1),"\n ").concat(Object(z.c)(u)).concat(Object(z.l)(u,15,1)),"?")}),Object(o.jsx)(dt.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE CONTACT"}),Object(o.jsx)(dt.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})},lr=Object(d.a)({container:{position:"absolute",top:"92vh",left:20},avatarArrow:{cursor:"pointer","&:hover":{backgroundColor:"rgb(62, 149, 231)"}}}),dr=function(e){var t=e.handleSubmit,n=lr();return Object(o.jsx)("div",{className:n.container,children:Object(o.jsx)(j.a,{onClick:t,className:n.avatarArrow,sx:{width:56,height:56,backgroundColor:"rgb(41, 139, 231)",color:"#ffffff"},children:Object(o.jsx)(Nn.a,{fontSize:"medium"})})})},br=Object(d.a)({editBar:{backgroundColor:"#f3f2f2",height:"100%",position:"relative"}}),jr=function(){var e=br(),t=Object(i.b)(),n=Object(i.c)(Ie).leftIsOpen,a=Object(i.c)(Wt),s=Object(i.c)(ht.a),l=Object(c.useState)(!1),d=Object(r.a)(l,2),b=d[0],j=d[1],u=Object(c.useState)(""),p=Object(r.a)(u,2),f=p[0],x=p[1],h=Object(c.useState)(""),m=Object(r.a)(h,2),g=m[0],O=m[1],v=Object(c.useState)(!0),y=Object(r.a)(v,2),C=y[0],w=y[1],k=Object(c.useState)(!1),N=Object(r.a)(k,2),S=N[0],I=N[1],R=s.name,A=s.lastName,D=s.mute,M=s.companionId,B=s._id;return Object(c.useEffect)((function(){var e=function(){return"contacts"!==n&&t(Ft())};e();var o=setInterval(e,z.k);return function(){return clearInterval(o)}}),[n,t]),Object(c.useEffect)((function(){var e=a.find((function(e){return e.number===s.number}));e&&j(e)}),[a,s.number]),Object(c.useEffect)((function(){x(R),O(A),w(!D)}),[R,A,D]),Object(o.jsxs)("div",{className:e.editBar,children:[S&&Object(o.jsx)(dr,{handleSubmit:function(){C!==!D&&Object(Oe.k)(M),f===R&&g===A||Object(Oe.A)(b._id,B,f,g,M),S&&I(!1)}}),Object(o.jsx)(nr,{}),Object(o.jsx)(cr,{chat:s,name:f,setName:x,lastName:g,setLastName:O,mute:C,setMute:w,openBtn:S,setOpenBtn:I}),Object(o.jsx)(sr,{isContact:b})]})},ur=function(){var e=Object(i.c)(Ne);return Object(o.jsxs)(o.Fragment,{children:["credentials"===e&&Object(o.jsx)(er,{}),"search"===e&&Object(o.jsx)(Na,{}),"edit"===e&&Object(o.jsx)(jr,{})]})},pr=Object(d.a)({chatBar:{background:"linear-gradient(to bottom right, #e7f097 , #b1e667,#f4f75e)"}}),fr=function(){var e=pr(),t=Object(i.c)(Ne),n=t&&"menu"!==t;return Object(i.c)(ht.b)._id?Object(o.jsxs)(a.a,{item:!0,lg:9,style:{display:"flex"},children:[Object(o.jsxs)(a.a,{item:!0,lg:n?8:12,children:[Object(o.jsx)(a.a,{item:!0,lg:12,children:Object(o.jsx)(Pn,{})}),Object(o.jsx)(a.a,{item:!0,lg:12,className:e.chatBar,children:Object(o.jsx)(fa,{})})]}),Object(o.jsx)(a.a,{item:!0,lg:n?4:0,children:Object(o.jsx)(ur,{})})]}):Object(o.jsx)(a.a,{item:!0,lg:9,className:e.chatBar})},xr=Object(d.a)({container:{minHeight:"100vh",maxHeight:"100vh"}});t.default=function(){var e=xr();return Object(o.jsxs)(a.a,{className:e.container,container:!0,spacing:0,children:[Object(o.jsx)(An,{}),Object(o.jsx)(fr,{})]})}}}]);
  2. //# sourceMappingURL=HomePage.64718e77.chunk.js.map