"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 _chunkXD2OIZABjs = require('./chunk-XD2OIZAB.js');var d={};_chunkXD2OIZABjs.b.call(void 0, d,{default:()=>m});var t,m,u=_chunkXD2OIZABjs.a.call(void 0, ()=>{"use strict";t=function(){var s=[{defaultValue:null,kind:"LocalArgument",name:"profileId"}],a=[{kind:"Variable",name:"profileId",variableName:"profileId"}],e={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"totalCount",storageKey:null},o={alias:null,args:null,kind:"ScalarField",name:"count",storageKey:null},r={alias:null,args:null,kind:"ScalarField",name:"markedUnread",storageKey:null},i={alias:null,args:null,concreteType:"MessageConnection",kind:"LinkedField",name:"allMessages",plural:!1,selections:[{alias:null,args:null,concreteType:"MessageEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"Message",kind:"LinkedField",name:"node",plural:!1,selections:[e,{alias:null,args:null,kind:"ScalarField",name:"isRead",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null};return{fragment:{argumentDefinitions:s,kind:"Fragment",metadata:null,name:"useMessageCountUpdateSubscription",selections:[{alias:null,args:a,concreteType:"ChatRoomOnMessagesCountUpdate",kind:"LinkedField",name:"chatRoomOnMessagesCountUpdate",plural:!1,selections:[{alias:null,args:null,concreteType:"Profile",kind:"LinkedField",name:"profile",plural:!1,selections:[e,{alias:null,args:null,concreteType:"ChatRoomConnection",kind:"LinkedField",name:"chatRooms",plural:!1,selections:[l,{alias:null,args:null,concreteType:"ChatRoomEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"ChatRoom",kind:"LinkedField",name:"node",plural:!1,selections:[e,{alias:null,args:null,concreteType:"UnreadMessageCount",kind:"LinkedField",name:"unreadMessages",plural:!1,selections:[o,r],storageKey:null},i],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],type:"Subscription",abstractKey:null},kind:"Request",operation:{argumentDefinitions:s,kind:"Operation",name:"useMessageCountUpdateSubscription",selections:[{alias:null,args:a,concreteType:"ChatRoomOnMessagesCountUpdate",kind:"LinkedField",name:"chatRoomOnMessagesCountUpdate",plural:!1,selections:[{alias:null,args:null,concreteType:"Profile",kind:"LinkedField",name:"profile",plural:!1,selections:[e,{alias:null,args:null,concreteType:"ChatRoomConnection",kind:"LinkedField",name:"chatRooms",plural:!1,selections:[l,{alias:null,args:null,concreteType:"ChatRoomEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"ChatRoom",kind:"LinkedField",name:"node",plural:!1,selections:[e,{alias:null,args:null,concreteType:"UnreadMessageCount",kind:"LinkedField",name:"unreadMessages",plural:!1,selections:[o,r,e],storageKey:null},i],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}]},params:{cacheID:"ee87a4300f113870813418b0a818d031",id:null,metadata:{},name:"useMessageCountUpdateSubscription",operationKind:"subscription",text:`subscription useMessageCountUpdateSubscription(
  $profileId: ID!
) {
  chatRoomOnMessagesCountUpdate(profileId: $profileId) {
    profile {
      id
      chatRooms {
        totalCount
        edges {
          node {
            id
            unreadMessages {
              count
              markedUnread
              id
            }
            allMessages {
              edges {
                node {
                  id
                  isRead
                }
              }
            }
          }
        }
      }
    }
  }
}
`}}}();t.hash="57b09f90d1cdf7f57abc3956378d6b27";m=t});var _react = require('react');var _authentication = require('@baseapp-frontend/authentication');var _reactrelay = require('react-relay');var n,C=(n!==void 0||(n=(u(),_chunkXD2OIZABjs.c.call(void 0, d)),n.hash&&n.hash!=="57b09f90d1cdf7f57abc3956378d6b27"&&console.error("The definition of 'useMessageCountUpdateSubscription' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data.")),n),R= exports.a =function(){var a=_authentication.useCurrentProfile.call(void 0, ),e=a.currentProfile,l=_react.useMemo.call(void 0, function(){return{subscription:C,onError:console.error,variables:{profileId:_optionalChain([e, 'optionalAccess', _ => _.id])}}},[_optionalChain([e, 'optionalAccess', _2 => _2.id])]);return _reactrelay.useSubscription.call(void 0, l)};exports.a = R;
//# sourceMappingURL=chunk-SKWAOS77.js.map