"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:()=>K});var f,K,M=_chunkXD2OIZABjs.a.call(void 0, ()=>{"use strict";f=function(){var e={defaultValue:null,kind:"LocalArgument",name:"connections"},n={defaultValue:null,kind:"LocalArgument",name:"input"},a=[{kind:"Variable",name:"input",variableName:"input"}],l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},r={alias:null,args:null,kind:"ScalarField",name:"messageType",storageKey:null},s={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},o=[l];return{fragment:{argumentDefinitions:[e,n],kind:"Fragment",metadata:null,name:"SendMessageMutation",selections:[{alias:null,args:a,concreteType:"ChatRoomSendMessagePayload",kind:"LinkedField",name:"chatRoomSendMessage",plural:!1,selections:[{alias:null,args:null,concreteType:"MessageEdge",kind:"LinkedField",name:"message",plural:!1,selections:[{alias:null,args:null,concreteType:"Message",kind:"LinkedField",name:"node",plural:!1,selections:[l,r,{args:null,kind:"FragmentSpread",name:"MessageItemFragment"}],storageKey:null}],storageKey:null},s],storageKey:null}],type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[n,e],kind:"Operation",name:"SendMessageMutation",selections:[{alias:null,args:a,concreteType:"ChatRoomSendMessagePayload",kind:"LinkedField",name:"chatRoomSendMessage",plural:!1,selections:[{alias:null,args:null,concreteType:"MessageEdge",kind:"LinkedField",name:"message",plural:!1,selections:[{alias:null,args:null,concreteType:"Message",kind:"LinkedField",name:"node",plural:!1,selections:[l,r,{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:o,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:o,storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"verb",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,filters:null,handle:"prependEdge",key:"",kind:"LinkedHandle",name:"message",handleArgs:[{kind:"Variable",name:"connections",variableName:"connections"}]},s],storageKey:null}]},params:{cacheID:"f1f83794e980cf67bbad0227c12a8467",id:null,metadata:{},name:"SendMessageMutation",operationKind:"mutation",text:`mutation SendMessageMutation(
  $input: ChatRoomSendMessageInput!
) {
  chatRoomSendMessage(input: $input) {
    message {
      node {
        id
        messageType
        ...MessageItemFragment
      }
    }
    errors {
      field
      messages
    }
  }
}

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