"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkNVB32N52js = require('./chunk-NVB32N52.js');var _chunkEVQXPO7Njs = require('./chunk-EVQXPO7N.js');var _chunkCXSDPRQ5js = require('./chunk-CXSDPRQ5.js');var _authentication = require('@baseapp-frontend/authentication');var _avatars = require('@baseapp-frontend/design-system/components/web/avatars');var _typographies = require('@baseapp-frontend/design-system/components/web/typographies');var _lab = require('@mui/lab');var _material = require('@mui/material');var _reactrelay = require('react-relay');var _jsxruntime = require('react/jsx-runtime');function I(t,e){return M(t)||R(t,e)||j(t,e)||A()}function A(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function j(t,e){if(t){if(typeof t=="string")return v(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?v(t,e):void 0}}function v(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,o=Array(e);r<e;r++)o[r]=t[r];return o}function R(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var o,c,i,l,n=[],s=!0,a=!1;try{if(i=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(o=i.call(r)).done)&&(n.push(o.value),n.length!==e);s=!0);}catch(f){a=!0,c=f}finally{try{if(!s&&r.return!=null&&(l=r.return(),Object(l)!==l))return}finally{if(a)throw c}}return n}}function M(t){if(Array.isArray(t))return t}var k=function(e){var r,o=e.profile,c=e.onChatCreation,i=_reactrelay.useFragment.call(void 0, _chunkEVQXPO7Njs.a,o),l=i.id,n=i.image,s=i.name,a=i.urlPath,f=_chunkCXSDPRQ5js.b.call(void 0, ),d=I(f,2),b=d[0],_=d[1],x=_authentication.useCurrentProfile.call(void 0, ),u=x.currentProfile;return _jsxruntime.jsxs.call(void 0, _chunkNVB32N52js.a,{children:[_jsxruntime.jsx.call(void 0, _avatars.AvatarWithPlaceholder,{width:48,height:48,src:_optionalChain([n, 'optionalAccess', _2 => _2.url]),sx:{alignSelf:"center",justifySelf:"center"}}),_jsxruntime.jsxs.call(void 0, _material.Box,{sx:{display:"grid",gridTemplateRows:"repeat(2, minmax(0, 1fr))"},children:[_jsxruntime.jsx.call(void 0, _typographies.TypographyWithEllipsis,{variant:"subtitle2",children:s}),_jsxruntime.jsx.call(void 0, _material.Typography,{variant:"caption",color:"text.secondary",children:_optionalChain([a, 'optionalAccess', _3 => _3.path])&&"@".concat((r=a.path)===null||r===void 0?void 0:r.replace("/",""))})]}),_jsxruntime.jsx.call(void 0, _lab.LoadingButton,{color:"inherit",variant:"outlined",size:"small",onClick:function(){u!=null&&u.id&&b({variables:{input:{profileId:u.id,participants:[l]},connections:[_reactrelay.ConnectionHandler.getConnectionID(u.id,"roomsList_chatRooms",{unreadMessages:!1,archived:!1,q:""}),_reactrelay.ConnectionHandler.getConnectionID(u.id,"roomsList_chatRooms",{unreadMessages:!0,archived:!1,q:""})]},onCompleted:c})},loading:_,sx:{maxWidth:"fit-content",justifySelf:"end"},children:"Message"})]},"chat-room-item-".concat(l))},K= exports.a =k;exports.a = K;
//# sourceMappingURL=chunk-MXKYLPQ5.js.map