"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 M={};_chunkXD2OIZABjs.b.call(void 0, M,{default:()=>O});var f,O,b=_chunkXD2OIZABjs.a.call(void 0, ()=>{"use strict";f=function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"input"}],n=[{kind:"Variable",name:"input",variableName:"input"}],t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},a={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},r=[t];return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"MessageDeleteMutation",selections:[{alias:null,args:n,concreteType:"ChatRoomDeleteMessagePayload",kind:"LinkedField",name:"chatRoomDeleteMessage",plural:!1,selections:[{alias:null,args:null,concreteType:"MessageEdge",kind:"LinkedField",name:"deletedMessage",plural:!1,selections:[{alias:null,args:null,concreteType:"Message",kind:"LinkedField",name:"node",plural:!1,selections:[t,{args:null,kind:"FragmentSpread",name:"MessageItemFragment"}],storageKey:null}],storageKey:null},a],storageKey:null}],type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"MessageDeleteMutation",selections:[{alias:null,args:n,concreteType:"ChatRoomDeleteMessagePayload",kind:"LinkedField",name:"chatRoomDeleteMessage",plural:!1,selections:[{alias:null,args:null,concreteType:"MessageEdge",kind:"LinkedField",name:"deletedMessage",plural:!1,selections:[{alias:null,args:null,concreteType:"Message",kind:"LinkedField",name:"node",plural:!1,selections:[t,{alias:null,args:null,kind:"ScalarField",name:"content",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"created",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"deleted",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"extraData",storageKey:null},{alias:null,args:null,concreteType:"Message",kind:"LinkedField",name:"inReplyTo",plural:!1,selections:r,storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"isRead",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"pk",storageKey:null},{alias:null,args:null,concreteType:"Profile",kind:"LinkedField",name:"profile",plural:!1,selections:r,storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"verb",storageKey:null}],storageKey:null}],storageKey:null},a],storageKey:null}]},params:{cacheID:"57bd31ca9624f859028a3c854a98f61b",id:null,metadata:{},name:"MessageDeleteMutation",operationKind:"mutation",text:`mutation MessageDeleteMutation(
  $input: ChatRoomDeleteMessageInput!
) {
  chatRoomDeleteMessage(input: $input) {
    deletedMessage {
      node {
        id
        ...MessageItemFragment
      }
    }
    errors {
      field
      messages
    }
  }
}

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