import{a as K,b as I,c as _}from"./chunk-XEHBQAFR.mjs";var F={};I(F,{default:()=>L});var v,L,S=K(()=>{"use strict";v=function(){var t=[{defaultValue:null,kind:"LocalArgument",name:"connections"},{defaultValue:null,kind:"LocalArgument",name:"targetObjectId"}],n=[{kind:"Variable",name:"targetObjectId",variableName:"targetObjectId"}],e={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},l={args:null,kind:"FragmentSpread",name:"CommentItem_comment"},i={alias:null,args:null,kind:"ScalarField",name:"total",storageKey:null},o={alias:null,args:null,concreteType:"CommentsCount",kind:"LinkedField",name:"commentsCount",plural:!1,selections:[i,{alias:null,args:null,kind:"ScalarField",name:"main",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"replies",storageKey:null}],storageKey:null},s={alias:null,args:null,kind:"ScalarField",name:"deletedCommentId",storageKey:null},r={alias:null,args:null,kind:"ScalarField",name:"pk",storageKey:null},m={alias:null,args:null,kind:"ScalarField",name:"body",storageKey:null},d={alias:null,args:null,kind:"ScalarField",name:"isPinned",storageKey:null},u={alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"user",plural:!1,selections:[e,r,{alias:null,args:null,kind:"ScalarField",name:"fullName",storageKey:null},{alias:null,args:[{kind:"Literal",name:"height",value:50},{kind:"Literal",name:"width",value:50}],concreteType:"File",kind:"LinkedField",name:"avatar",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"url",storageKey:null}],storageKey:"avatar(height:50,width:50)"}],storageKey:null},c={alias:null,args:null,kind:"ScalarField",name:"created",storageKey:null},g=[i],p={alias:null,args:null,concreteType:"CommentsCount",kind:"LinkedField",name:"commentsCount",plural:!1,selections:g,storageKey:null},y={alias:"canChange",args:[{kind:"Literal",name:"perm",value:"change"}],kind:"ScalarField",name:"hasPerm",storageKey:'hasPerm(perm:"change")'},C={alias:"canDelete",args:[{kind:"Literal",name:"perm",value:"delete"}],kind:"ScalarField",name:"hasPerm",storageKey:'hasPerm(perm:"delete")'},k={alias:"canReport",args:[{kind:"Literal",name:"perm",value:"report"}],kind:"ScalarField",name:"hasPerm",storageKey:'hasPerm(perm:"report")'},f={alias:"canPin",args:[{kind:"Literal",name:"perm",value:"pin"}],kind:"ScalarField",name:"hasPerm",storageKey:'hasPerm(perm:"pin")'},h={kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"ReactionsCount",kind:"LinkedField",name:"reactionsCount",plural:!1,selections:g,storageKey:null},{alias:null,args:null,concreteType:"Reaction",kind:"LinkedField",name:"myReaction",plural:!1,selections:[e,{alias:null,args:null,kind:"ScalarField",name:"reactionType",storageKey:null}],storageKey:null}],type:"ReactionsInterface",abstractKey:"__isReactionsInterface"},b={kind:"TypeDiscriminator",abstractKey:"__isCommentsInterface"};return{fragment:{argumentDefinitions:t,kind:"Fragment",metadata:null,name:"CommentsSubscription",selections:[{alias:null,args:n,concreteType:"OnCommentChange",kind:"LinkedField",name:"onCommentChange",plural:!1,selections:[{alias:null,args:null,concreteType:"CommentEdge",kind:"LinkedField",name:"createdComment",plural:!1,selections:[{alias:null,args:null,concreteType:"Comment",kind:"LinkedField",name:"node",plural:!1,selections:[e,l,{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"target",plural:!1,selections:[o],storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"Comment",kind:"LinkedField",name:"updatedComment",plural:!1,selections:[l],storageKey:null},s],storageKey:null}],type:"Subscription",abstractKey:null},kind:"Request",operation:{argumentDefinitions:t,kind:"Operation",name:"CommentsSubscription",selections:[{alias:null,args:n,concreteType:"OnCommentChange",kind:"LinkedField",name:"onCommentChange",plural:!1,selections:[{alias:null,args:null,concreteType:"CommentEdge",kind:"LinkedField",name:"createdComment",plural:!1,selections:[{alias:null,args:null,concreteType:"Comment",kind:"LinkedField",name:"node",plural:!1,selections:[e,r,m,d,u,c,p,y,C,k,f,{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"target",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},o,e],storageKey:null},h,b],storageKey:null}],storageKey:null},{alias:null,args:null,filters:null,handle:"prependEdge",key:"",kind:"LinkedHandle",name:"createdComment",handleArgs:[{kind:"Variable",name:"connections",variableName:"connections"}]},{alias:null,args:null,concreteType:"Comment",kind:"LinkedField",name:"updatedComment",plural:!1,selections:[e,r,m,d,u,c,p,y,C,k,f,h,b],storageKey:null},s,{alias:null,args:null,filters:null,handle:"deleteRecord",key:"",kind:"ScalarHandle",name:"deletedCommentId"}],storageKey:null}]},params:{cacheID:"e23e08eb3ec21610ecbc8771eed8f73f",id:null,metadata:{},name:"CommentsSubscription",operationKind:"subscription",text:`subscription CommentsSubscription(
  $targetObjectId: ID
) {
  onCommentChange(targetObjectId: $targetObjectId) {
    createdComment {
      node {
        id
        ...CommentItem_comment
        target {
          __typename
          commentsCount {
            total
            main
            replies
          }
          id
        }
      }
    }
    updatedComment {
      ...CommentItem_comment
      id
    }
    deletedCommentId
  }
}

fragment CommentItem_comment on Comment {
  id
  pk
  body
  isPinned
  user {
    id
    pk
    fullName
    avatar(width: 50, height: 50) {
      url
    }
  }
  created
  commentsCount {
    total
  }
  canChange: hasPerm(perm: "change")
  canDelete: hasPerm(perm: "delete")
  canReport: hasPerm(perm: "report")
  canPin: hasPerm(perm: "pin")
  ...ReactionButton_target
  ...CommentItem_target
}

fragment CommentItem_target on CommentsInterface {
  __isCommentsInterface: __typename
  id
}

fragment ReactionButton_target on ReactionsInterface {
  __isReactionsInterface: __typename
  id
  reactionsCount {
    total
  }
  myReaction {
    id
    reactionType
  }
}
`}}}();v.hash="f649494aea3b062943d369c8368ca337";L=v});import{useMemo as R}from"react";import{ConnectionHandler as T,useSubscription as P}from"react-relay";var a,O=(a!==void 0||(a=(S(),_(F)),a.hash&&a.hash!=="f649494aea3b062943d369c8368ca337"&&console.error("The definition of 'CommentsSubscription' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data.")),a),x=function(n){var e=R(function(){var l=[];return n&&l.push(T.getConnectionID(n,"CommentsList_comments")),{subscription:O,onError:console.error,variables:{connections:l,targetObjectId:n}}},[n]);return P(e)},q=function(n){var e=n.targetObjectId;return x(e),null};export{O as a,x as b,q as c};
//# sourceMappingURL=chunk-DYIP5QQG.mjs.map