"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 _chunkF2NTRH3Djs = require('./chunk-F2NTRH3D.js');var _chunkI2NIE2XOjs = require('./chunk-I2NIE2XO.js');var _chunkQWDLFHT5js = require('./chunk-QWDLFHT5.js');var _chunkEVQXPO7Njs = require('./chunk-EVQXPO7N.js');var _chunk6RT4APSPjs = require('./chunk-6RT4APSP.js');var _authentication = require('@baseapp-frontend/authentication');var _avatars = require('@baseapp-frontend/design-system/components/web/avatars');var _icons = require('@baseapp-frontend/design-system/components/web/icons');var _popovers = require('@baseapp-frontend/design-system/components/web/popovers');var _common = require('@baseapp-frontend/design-system/hooks/common');var _material = require('@mui/material');var _reactrelay = require('react-relay');var _jsxruntime = require('react/jsx-runtime');var F=function(m){var h=m.hasAdminPermissions,i=m.groupMember,A=m.initiateRemoval,n=_reactrelay.useFragment.call(void 0, _chunkEVQXPO7Njs.a,i.profile),d=n.id,s=n.image,v=n.name,t=n.urlPath,C=!!(t!=null&&t.path),g=_optionalChain([i, 'optionalAccess', _2 => _2.role])===_chunk6RT4APSPjs.c.admin,b=h,w=_authentication.useCurrentProfile.call(void 0, ),c=w.currentProfile,o=_common.usePopover.call(void 0, ),l=_optionalChain([c, 'optionalAccess', _3 => _3.id])===d,p=function(){o.onClose(),A(d,v)},I=function(){return l?_jsxruntime.jsx.call(void 0, _chunkI2NIE2XOjs.a,{isMe:l,onViewProfileClicked:o.onClose,onRemoveClicked:p}):!l&&h?_jsxruntime.jsx.call(void 0, _chunkF2NTRH3Djs.a,{onViewProfileClicked:o.onClose,onToggleAdminClicked:o.onClose,onRemoveClicked:p}):_jsxruntime.jsx.call(void 0, _chunkI2NIE2XOjs.a,{isMe:l,onViewProfileClicked:o.onClose,onRemoveClicked:p})};return _jsxruntime.jsxs.call(void 0, _chunkQWDLFHT5js.a,{children:[_jsxruntime.jsx.call(void 0, _avatars.AvatarWithPlaceholder,{width:48,height:48,src:_optionalChain([s, 'optionalAccess', _4 => _4.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:v}),_jsxruntime.jsxs.call(void 0, _material.Box,{sx:{alignItems:"center",display:"grid",gridTemplateColumns:"min-content min-content min-content"},children:[_jsxruntime.jsx.call(void 0, _material.Typography,{variant:"caption",color:"text.secondary",children:C&&"@".concat(t.path)}),g&&C&&_jsxruntime.jsx.call(void 0, _material.Box,{sx:{display:"inline-block",height:"6px",width:"6px",borderRadius:"50%",backgroundColor:"text.disabled",marginX:"8px"}}),_jsxruntime.jsx.call(void 0, _material.Typography,{variant:"caption",color:"primary.light",children:g&&_chunk6RT4APSPjs.d})]})]}),b?_jsxruntime.jsxs.call(void 0, _material.Box,{children:[_jsxruntime.jsx.call(void 0, _material.IconButton,{onClick:o.onOpen,"aria-label":"Show admin options",children:_jsxruntime.jsx.call(void 0, _icons.ThreeDotsIcon,{sx:{fontSize:"24px"}})}),_jsxruntime.jsx.call(void 0, _popovers.Popover,{open:o.open,onClose:o.onClose,children:I()})]}):_jsxruntime.jsx.call(void 0, _material.Box,{})]},"profile-".concat(d))},Y= exports.a =F;exports.a = Y;
//# sourceMappingURL=chunk-RVKSEYZF.js.map