"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 b={};_chunkXD2OIZABjs.b.call(void 0, b,{default:()=>F});var g,F,M=_chunkXD2OIZABjs.a.call(void 0, ()=>{"use strict";g=function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"input"}],n=[{kind:"Variable",name:"input",variableName:"input"}],a={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},t={alias:null,args:null,concreteType:"ErrorType",kind:"LinkedField",name:"errors",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"field",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"messages",storageKey:null}],storageKey:null};return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"ReadMessagesMutation",selections:[{alias:null,args:n,concreteType:"ChatRoomReadMessagesPayload",kind:"LinkedField",name:"chatRoomReadMessages",plural:!1,selections:[{alias:null,args:null,concreteType:"ChatRoom",kind:"LinkedField",name:"room",plural:!1,selections:[a,{args:null,kind:"FragmentSpread",name:"UnreadMessagesCountFragment"}],storageKey:null},t],storageKey:null}],type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"ReadMessagesMutation",selections:[{alias:null,args:n,concreteType:"ChatRoomReadMessagesPayload",kind:"LinkedField",name:"chatRoomReadMessages",plural:!1,selections:[{alias:null,args:null,concreteType:"ChatRoom",kind:"LinkedField",name:"room",plural:!1,selections:[a,{alias:null,args:null,concreteType:"UnreadMessageCount",kind:"LinkedField",name:"unreadMessages",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"count",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"markedUnread",storageKey:null},a],storageKey:null}],storageKey:null},t],storageKey:null}]},params:{cacheID:"4bebc93464740f3be7c5f5fdd1a3d6df",id:null,metadata:{},name:"ReadMessagesMutation",operationKind:"mutation",text:`mutation ReadMessagesMutation(
  $input: ChatRoomReadMessagesInput!
) {
  chatRoomReadMessages(input: $input) {
    room {
      id
      ...UnreadMessagesCountFragment
    }
    errors {
      field
      messages
    }
  }
}

fragment UnreadMessagesCountFragment on ChatRoom {
  id
  unreadMessages {
    count
    markedUnread
    id
  }
}
`}}}();g.hash="eeed77ccb23fc338a5f401cb106e66fb";F=g});var _utils = require('@baseapp-frontend/utils');var _reactrelay = require('react-relay');function c(e){"@babel/helpers - typeof";return c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},c(e)}var s;function v(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),a.push.apply(a,t)}return a}function R(e){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?v(Object(a),!0).forEach(function(t){j(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):v(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}function j(e,n,a){return(n=_(n))in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function _(e){var n=P(e,"string");return c(n)=="symbol"?n:n+""}function P(e,n){if(c(e)!="object"||!e)return e;var a=e[Symbol.toPrimitive];if(a!==void 0){var t=a.call(e,n||"default");if(c(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function T(e,n){return w(e)||I(e,n)||A(e,n)||K()}function K(){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 A(e,n){if(e){if(typeof e=="string")return h(e,n);var a={}.toString.call(e).slice(8,-1);return a==="Object"&&e.constructor&&(a=e.constructor.name),a==="Map"||a==="Set"?Array.from(e):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?h(e,n):void 0}}function h(e,n){(n==null||n>e.length)&&(n=e.length);for(var a=0,t=Array(n);a<n;a++)t[a]=e[a];return t}function I(e,n){var a=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(a!=null){var t,l,m,i,u=[],d=!0,r=!1;try{if(m=(a=a.call(e)).next,n===0){if(Object(a)!==a)return;d=!1}else for(;!(d=(t=m.call(a)).done)&&(u.push(t.value),u.length!==n);d=!0);}catch(p){r=!0,l=p}finally{try{if(!d&&a.return!=null&&(i=a.return(),Object(i)!==i))return}finally{if(r)throw l}}return u}}function w(e){if(Array.isArray(e))return e}var $=(s!==void 0||(s=(M(),_chunkXD2OIZABjs.c.call(void 0, b)),s.hash&&s.hash!=="eeed77ccb23fc338a5f401cb106e66fb"&&console.error("The definition of 'ReadMessagesMutation' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data.")),s),q= exports.b =function(){var n=_utils.useNotification.call(void 0, ),a=n.sendToast,t=_reactrelay.useMutation.call(void 0, $),l=T(t,2),m=l[0],i=l[1],u=function(r){return m(R(R({},r),{},{onCompleted:function(y,o){var f;_optionalChain([o, 'optionalAccess', _2 => _2.forEach, 'call', _3 => _3(function(k){a(k.message,{type:"error"})})]),r==null||(f=r.onCompleted)===null||f===void 0||f.call(r,y,o)},onError:function(y){var o;a(y.message,{type:"error"}),r==null||(o=r.onError)===null||o===void 0||o.call(r,y)}}))};return[u,i]};exports.a = $; exports.b = q;
//# sourceMappingURL=chunk-DE4Q7XYV.js.map