"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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 _chunkZ7YFFB66js = require('./chunk-Z7YFFB66.js');var _chunkTQO5DI2Sjs = require('./chunk-TQO5DI2S.js');var _chunk6RT4APSPjs = require('./chunk-6RT4APSP.js');var _authentication = require('@baseapp-frontend/authentication');var _reactrelay = require('react-relay');var _relayconnectionhandlerplus = require('relay-connection-handler-plus'); var _relayconnectionhandlerplus2 = _interopRequireDefault(_relayconnectionhandlerplus);var _=function(r){var n,o=_reactrelay.useFragment.call(void 0, _chunkZ7YFFB66js.a,r);return{title:_optionalChain([o, 'optionalAccess', _2 => _2.title]),avatar:o==null||(n=o.image)===null||n===void 0?void 0:n.url}},P=function(r){var n,o,d=_authentication.useCurrentProfile.call(void 0, ),m=d.currentProfile,u=_reactrelay.useFragment.call(void 0, _chunkTQO5DI2Sjs.a,r);if(!(u!=null&&u.participants))return{title:"Error: No participants"};var e=u.participants.edges.find(function(l){var v,i;return(l==null||(v=l.node)===null||v===void 0||(v=v.profile)===null||v===void 0?void 0:v.id)&&(l==null||(i=l.node)===null||i===void 0||(i=i.profile)===null||i===void 0?void 0:i.id)!==_optionalChain([m, 'optionalAccess', _3 => _3.id])});return{title:e==null||(n=e.node)===null||n===void 0||(n=n.profile)===null||n===void 0?void 0:n.name,avatar:e==null||(o=e.node)===null||o===void 0||(o=o.profile)===null||o===void 0||(o=o.image)===null||o===void 0?void 0:o.url}},S= exports.b =function(r){var n=P(r),o=_(r);return r.isGroup?o:n},T= exports.c =function(r){if(r!=null)return"".concat(r," member").concat(r!==1?"s":"")},G= exports.d =function(r,n,o){var d=r.get(n);return d?_relayconnectionhandlerplus2.default.getConnections(d,"roomsList_chatRooms",o):[]},I= exports.e =function(r){var n,o,d,m=_authentication.useCurrentProfile.call(void 0, ),u=m.currentProfile,e=r==null||(n=r.edges)===null||n===void 0?void 0:n.find(function(i){var t;return(i==null||(t=i.node)===null||t===void 0||(t=t.profile)===null||t===void 0?void 0:t.id)===_optionalChain([u, 'optionalAccess', _4 => _4.id])}),l=(e==null||(o=e.node)===null||o===void 0?void 0:o.role)===_chunk6RT4APSPjs.c.admin,v=l&&(r==null||(d=r.edges)===null||d===void 0?void 0:d.filter(function(i){var t;return(i==null||(t=i.node)===null||t===void 0?void 0:t.role)===_chunk6RT4APSPjs.c.admin}).length)===1;return{isAdmin:l,isSoleAdmin:v}};exports.a = _; exports.b = S; exports.c = T; exports.d = G; exports.e = I;
//# sourceMappingURL=chunk-74X4UOY6.js.map