"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 _chunk2QL2RIUWjs = require('./chunk-2QL2RIUW.js');var _chunkYTIWBXSRjs = require('./chunk-YTIWBXSR.js');var _authentication = require('@baseapp-frontend/authentication');var _avatars = require('@baseapp-frontend/design-system/components/web/avatars');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 y(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)?y(t,e):void 0}}function y(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function R(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,s,a,u=[],o=!0,c=!1;try{if(s=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;o=!1}else for(;!(o=(n=s.call(r)).done)&&(u.push(n.value),u.length!==e);o=!0);}catch(m){c=!0,i=m}finally{try{if(!o&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return u}}function M(t){if(Array.isArray(t))return t}var F=function(e){var r=e.profile,n=e.onChatCreation,i=_reactrelay.useFragment.call(void 0, _chunk2QL2RIUWjs.a,r),s=i.id,a=i.image,u=i.name,o=i.urlPath,c=_chunkYTIWBXSRjs.b.call(void 0, ),m=I(c,2),b=m[0],x=m[1],_=_authentication.useCurrentProfile.call(void 0, ),l=_.currentProfile;return _jsxruntime.jsxs.call(void 0, _chunkNVB32N52js.a,{children:[_jsxruntime.jsx.call(void 0, _avatars.AvatarWithPlaceholder,{width:48,height:48,src:_optionalChain([a, '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, _material.Typography,{variant:"subtitle2",children:u}),_jsxruntime.jsx.call(void 0, _material.Typography,{variant:"caption",color:"text.secondary",children:_optionalChain([o, 'optionalAccess', _3 => _3.path])&&"@".concat(o.path)})]}),_jsxruntime.jsx.call(void 0, _lab.LoadingButton,{color:"inherit",variant:"outlined",size:"small",onClick:function(){l!=null&&l.id&&b({variables:{input:{profileId:l.id,participants:[s]},connections:[_reactrelay.ConnectionHandler.getConnectionID(l.id,"roomsList_chatRooms",{unreadMessages:!1,archived:!1,q:""}),_reactrelay.ConnectionHandler.getConnectionID(l.id,"roomsList_chatRooms",{unreadMessages:!0,archived:!1,q:""})]},onCompleted:n})},loading:x,sx:{maxWidth:"fit-content",justifySelf:"end"},children:"Message"})]},"chat-room-item-".concat(s))},$= exports.a =F;exports.a = $;
//# sourceMappingURL=chunk-X5SXS2YT.js.map