var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var comments_exports = {};
__export(comments_exports, {
  buildCommentsApiClientMethods: () => buildCommentsApiClientMethods
});
module.exports = __toCommonJS(comments_exports);
function buildCommentsApiClientMethods(input) {
  const { request, handleApiError, normalizeSavedItemKindInput, normalizeCreatorItemSlug, normalizePositiveIntegerInput } = input;
  return {
    async fetchContentComments(kind, creatorUsername, itemName) {
      const normalizedKind = normalizeSavedItemKindInput(kind);
      const creator = normalizeCreatorItemSlug(creatorUsername, "creator");
      const name = normalizeCreatorItemSlug(itemName, "name");
      const response = await request({
        method: "GET",
        path: `/comments/${encodeURIComponent(normalizedKind)}/${encodeURIComponent(creator)}/${encodeURIComponent(name)}`
      });
      if (response.status !== 200) {
        handleApiError(response, "fetch_content_comments");
      }
      return response.body;
    },
    async createContentComment(kind, creatorUsername, itemName, requestBody) {
      const normalizedKind = normalizeSavedItemKindInput(kind);
      const creator = normalizeCreatorItemSlug(creatorUsername, "creator");
      const name = normalizeCreatorItemSlug(itemName, "name");
      const response = await request({
        method: "POST",
        path: `/me/comments/${encodeURIComponent(normalizedKind)}/${encodeURIComponent(creator)}/${encodeURIComponent(name)}`,
        body: requestBody
      });
      if (response.status !== 200) {
        handleApiError(response, "create_content_comment");
      }
      return response.body;
    },
    async likeContentComment(commentId) {
      const normalizedCommentId = normalizePositiveIntegerInput(commentId, "invalid_comment_id");
      const response = await request({
        method: "PUT",
        path: `/me/comments/${encodeURIComponent(String(normalizedCommentId))}/likes`
      });
      if (response.status !== 200) {
        handleApiError(response, "like_content_comment");
      }
      return response.body;
    },
    async unlikeContentComment(commentId) {
      const normalizedCommentId = normalizePositiveIntegerInput(commentId, "invalid_comment_id");
      const response = await request({
        method: "DELETE",
        path: `/me/comments/${encodeURIComponent(String(normalizedCommentId))}/likes`
      });
      if (response.status !== 200) {
        handleApiError(response, "unlike_content_comment");
      }
      return response.body;
    },
    async dislikeContentComment(commentId) {
      const normalizedCommentId = normalizePositiveIntegerInput(commentId, "invalid_comment_id");
      const response = await request({
        method: "PUT",
        path: `/me/comments/${encodeURIComponent(String(normalizedCommentId))}/dislikes`
      });
      if (response.status !== 200) {
        handleApiError(response, "dislike_content_comment");
      }
      return response.body;
    },
    async undislikeContentComment(commentId) {
      const normalizedCommentId = normalizePositiveIntegerInput(commentId, "invalid_comment_id");
      const response = await request({
        method: "DELETE",
        path: `/me/comments/${encodeURIComponent(String(normalizedCommentId))}/dislikes`
      });
      if (response.status !== 200) {
        handleApiError(response, "undislike_content_comment");
      }
      return response.body;
    },
    async reportComment(commentId, requestBody) {
      const normalizedCommentId = normalizePositiveIntegerInput(commentId, "invalid_comment_id");
      const response = await request({
        method: "POST",
        path: `/me/reports/comments/${encodeURIComponent(String(normalizedCommentId))}`,
        body: requestBody
      });
      if (response.status !== 200) {
        handleApiError(response, "report_comment");
      }
      return response.body;
    },
    async deleteContentComment(commentId) {
      const normalizedCommentId = normalizePositiveIntegerInput(commentId, "invalid_comment_id");
      const response = await request({
        method: "DELETE",
        path: `/me/comments/${encodeURIComponent(String(normalizedCommentId))}`
      });
      if (response.status !== 200) {
        handleApiError(response, "delete_content_comment");
      }
      return response.body;
    }
  };
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  buildCommentsApiClientMethods
});
