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 api_exports = {};
__export(api_exports, {
  APP_LAUNCH_CONTEXT_VALUES: () => APP_LAUNCH_CONTEXT_VALUES,
  APP_LIST_SORT_VALUES: () => APP_LIST_SORT_VALUES,
  APP_MORE_COLLECTION_KEYS: () => APP_MORE_COLLECTION_KEYS,
  ApiError: () => ApiError,
  BOOST_SKU_VALUES: () => BOOST_SKU_VALUES,
  COLLECTION_SLUG_REGEX: () => COLLECTION_SLUG_REGEX,
  ENGAGEMENT_EVENT_TYPE_VALUES: () => ENGAGEMENT_EVENT_TYPE_VALUES,
  ENGAGEMENT_TARGET_KIND_VALUES: () => ENGAGEMENT_TARGET_KIND_VALUES,
  FEEDBACK_CATEGORY_VALUES: () => FEEDBACK_CATEGORY_VALUES,
  FEEDBACK_CLIENT_VALUES: () => FEEDBACK_CLIENT_VALUES,
  FEEDBACK_STATUS_VALUES: () => FEEDBACK_STATUS_VALUES,
  FOLLOWING_APP_SECTION_VALUES: () => FOLLOWING_APP_SECTION_VALUES,
  FOLLOWING_FEED_SECTION_VALUES: () => FOLLOWING_FEED_SECTION_VALUES,
  FOLLOWING_SORT_VALUES: () => FOLLOWING_SORT_VALUES,
  FREE_CREDIT_OBJECTIVE_VALUES: () => FREE_CREDIT_OBJECTIVE_VALUES,
  FREE_CREDIT_REWARD_STATUS_VALUES: () => FREE_CREDIT_REWARD_STATUS_VALUES,
  HOME_GAMES_COLLECTION_IDS: () => HOME_GAMES_COLLECTION_IDS,
  LIBRARY_CATEGORY_VALUES: () => LIBRARY_CATEGORY_VALUES,
  LIBRARY_SORT_VALUES: () => LIBRARY_SORT_VALUES,
  MODERATION_REPORT_REASON_CODE_VALUES: () => MODERATION_REPORT_REASON_CODE_VALUES,
  MUSIC_PROMPT_MAX_LENGTH: () => MUSIC_PROMPT_MAX_LENGTH,
  NOTIFICATION_EVENT_TYPE_VALUES: () => NOTIFICATION_EVENT_TYPE_VALUES,
  NOTIFICATION_PREVIEW_KIND_VALUES: () => NOTIFICATION_PREVIEW_KIND_VALUES,
  NOTIFICATION_STATUS_VALUES: () => NOTIFICATION_STATUS_VALUES,
  SAVED_ITEM_KIND_VALUES: () => SAVED_ITEM_KIND_VALUES,
  SEARCH_ASSET_TYPE_VALUES: () => SEARCH_ASSET_TYPE_VALUES,
  SEARCH_KIND_VALUES: () => SEARCH_KIND_VALUES,
  SEARCH_MODE_VALUES: () => SEARCH_MODE_VALUES,
  SEARCH_RESULT_KIND_VALUES: () => SEARCH_RESULT_KIND_VALUES,
  SEARCH_SORT_VALUES: () => SEARCH_SORT_VALUES,
  TAG_GROUP_SORT_VALUES: () => TAG_GROUP_SORT_VALUES,
  TAG_SLUG_REGEX: () => TAG_SLUG_REGEX,
  UnsupportedClientError: () => UnsupportedClientError,
  isPaginationMeta: () => isPaginationMeta,
  isValidCollectionSlug: () => isValidCollectionSlug,
  isValidTagSlug: () => isValidTagSlug,
  normalizeCollectionSlug: () => normalizeCollectionSlug,
  normalizeTagRef: () => normalizeTagRef,
  normalizeTagSlug: () => normalizeTagSlug,
  parseTagRef: () => parseTagRef
});
module.exports = __toCommonJS(api_exports);
const TAG_SLUG_REGEX = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
const APP_MORE_COLLECTION_KEYS = [
  "by-creator",
  "similar",
  "remixes",
  "contains",
  "uses"
];
const FEEDBACK_CLIENT_VALUES = [
  "cli",
  "web",
  "games-ios",
  "music-ios",
  "games-android",
  "mac",
  "other"
];
const FEEDBACK_CATEGORY_VALUES = [
  "bug",
  "feature",
  "question",
  "content",
  "account",
  "other"
];
const FEEDBACK_STATUS_VALUES = [
  "sent",
  "ignored",
  "planned",
  "done"
];
const SEARCH_RESULT_KIND_VALUES = ["creator", "app", "asset", "asset-spec", "pack"];
const SEARCH_KIND_VALUES = ["all", ...SEARCH_RESULT_KIND_VALUES];
const SEARCH_MODE_VALUES = ["grouped", "flat"];
const SEARCH_ASSET_TYPE_VALUES = ["image", "video", "audio", "song", "sfx", "3d"];
const SEARCH_SORT_VALUES = [
  "relevance",
  "views",
  "recent",
  "updated",
  "used",
  "newest",
  "likes",
  "downloads",
  "remixes",
  "comments",
  "assets",
  "apps",
  "alpha"
];
const APP_LIST_SORT_VALUES = [
  "newest",
  "updated",
  "views",
  "likes",
  "used"
];
const SAVED_ITEM_KIND_VALUES = ["APP", "ASSET", "PACK"];
const TAG_GROUP_SORT_VALUES = ["alpha", "popularity"];
function isValidTagSlug(value) {
  return typeof value === "string" && TAG_SLUG_REGEX.test(value);
}
function normalizeTagSlug(value) {
  const normalized = value.trim().toLowerCase();
  if (!TAG_SLUG_REGEX.test(normalized)) {
    throw new Error(`invalid_tag_slug:${value}`);
  }
  return normalized;
}
const COLLECTION_SLUG_REGEX = TAG_SLUG_REGEX;
function isValidCollectionSlug(value) {
  return typeof value === "string" && COLLECTION_SLUG_REGEX.test(value);
}
function normalizeCollectionSlug(value) {
  const normalized = value.trim().toLowerCase();
  if (!COLLECTION_SLUG_REGEX.test(normalized)) {
    throw new Error(`invalid_collection_slug:${value}`);
  }
  return normalized;
}
function parseTagRef(value) {
  if (typeof value !== "string") {
    return null;
  }
  const trimmed = value.trim().toLowerCase();
  const parts = trimmed.split("/");
  if (parts.length !== 2) {
    return null;
  }
  const groupSlug = parts[0];
  const tagSlug = parts[1];
  if (!groupSlug || !tagSlug) {
    return null;
  }
  if (!TAG_SLUG_REGEX.test(groupSlug) || !TAG_SLUG_REGEX.test(tagSlug)) {
    return null;
  }
  return { groupSlug, tagSlug };
}
function normalizeTagRef(value) {
  const parsed = parseTagRef(value);
  if (!parsed) {
    throw new Error(`invalid_tag_ref:${value}`);
  }
  return `${parsed.groupSlug}/${parsed.tagSlug}`;
}
const ENGAGEMENT_EVENT_TYPE_VALUES = [
  "VIEW",
  "LAUNCH",
  "PLAY",
  "DOWNLOAD",
  "LIKE",
  "UNLIKE",
  "DISLIKE",
  "UNDISLIKE",
  "SAVE",
  "UNSAVE",
  "FOLLOW",
  "UNFOLLOW"
];
const ENGAGEMENT_TARGET_KIND_VALUES = ["CREATOR", "APP", "ASSET", "PACK"];
const APP_LAUNCH_CONTEXT_VALUES = ["CARD", "DETAIL", "OTHER"];
const NOTIFICATION_EVENT_TYPE_VALUES = [
  "NEW_CONTENT",
  "UPDATED",
  "CONTENT_COMMENT",
  "CONTENT_REPLY",
  "CONTENT_LIKE",
  "NEW_FOLLOWER",
  "ASSET_PURCHASED",
  "PAYMENT_SUCCEEDED",
  "PAYMENT_REFUNDED",
  "ADMIN_ACTION",
  "AI_JOB_SUCCEEDED",
  "AI_JOB_FAILED"
];
const LIBRARY_CATEGORY_VALUES = [
  "games",
  "demos",
  "tools",
  "templates",
  "images",
  "music",
  "sfx",
  "videos",
  "3d",
  "packs"
];
const LIBRARY_SORT_VALUES = ["saved_desc", "alpha_asc"];
const FOLLOWING_SORT_VALUES = ["activity_desc", "alpha_asc"];
const NOTIFICATION_STATUS_VALUES = ["all", "unread"];
const NOTIFICATION_PREVIEW_KIND_VALUES = ["item", "person", "credit", "account"];
const FOLLOWING_APP_SECTION_VALUES = ["games", "demos", "tools", "templates"];
const FOLLOWING_FEED_SECTION_VALUES = [
  ...FOLLOWING_APP_SECTION_VALUES,
  "images",
  "music",
  "sfx",
  "speech",
  "videos",
  "3d",
  "packs"
];
const MODERATION_REPORT_REASON_CODE_VALUES = [
  "SPAM",
  "HARASSMENT",
  "NSFW",
  "COPYRIGHT",
  "IMPERSONATION",
  "OTHER"
];
const FREE_CREDIT_OBJECTIVE_VALUES = [
  "WELCOME",
  "PLAY_GAME",
  "FOLLOW_CREATOR",
  "INVITED",
  "SHARE_CODE",
  "ENABLE_PUSH",
  "CREATE_SONG",
  "CREATE_IMAGE",
  "CREATE_3D",
  "CLI_LOGIN",
  "PUBLISH_GAME",
  "BOOST_GAME"
];
const FREE_CREDIT_REWARD_STATUS_VALUES = ["INCOMPLETE", "CLAIMABLE", "CLAIMED"];
const HOME_GAMES_COLLECTION_IDS = {
  FOR_YOU_GAMES: "for_you_games",
  TOP_GAMES: "top_games",
  MOST_LIKED_GAMES: "most_liked_games",
  BOOSTED_GAMES: "boosted_games",
  TOP_CREATORS: "top_creators",
  FEATURED_GAMES: "featured_games",
  NEW_GAMES: "new_games",
  GAME_GENRES: "game_genres",
  CONTINUE_PLAYING: "continue_playing",
  FOLLOWING_CREATORS: "following_creators"
};
function isPaginationMeta(value) {
  if (typeof value !== "object" || value === null) {
    return false;
  }
  const meta = value;
  const limit = meta["limit"];
  const offset = meta["offset"];
  const count = meta["count"];
  const hasMore = meta["hasMore"];
  return Number.isInteger(limit) && Number.isInteger(offset) && Number.isInteger(count) && limit >= 0 && offset >= 0 && count >= 0 && typeof hasMore === "boolean";
}
class UnsupportedClientError extends Error {
  code;
  details;
  constructor(code, message, details = null) {
    super(message);
    this.name = "UnsupportedClientError";
    this.code = code;
    this.details = details;
  }
}
const BOOST_SKU_VALUES = ["boost_1", "boost_3", "boost_7", "boost_14", "boost_31"];
const MUSIC_PROMPT_MAX_LENGTH = 4e3;
class ApiError extends Error {
  status;
  code;
  details;
  constructor(message, status, code, details = null) {
    super(message);
    this.name = "ApiError";
    this.status = status;
    this.details = details;
    if (code !== void 0) {
      this.code = code;
    }
  }
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  APP_LAUNCH_CONTEXT_VALUES,
  APP_LIST_SORT_VALUES,
  APP_MORE_COLLECTION_KEYS,
  ApiError,
  BOOST_SKU_VALUES,
  COLLECTION_SLUG_REGEX,
  ENGAGEMENT_EVENT_TYPE_VALUES,
  ENGAGEMENT_TARGET_KIND_VALUES,
  FEEDBACK_CATEGORY_VALUES,
  FEEDBACK_CLIENT_VALUES,
  FEEDBACK_STATUS_VALUES,
  FOLLOWING_APP_SECTION_VALUES,
  FOLLOWING_FEED_SECTION_VALUES,
  FOLLOWING_SORT_VALUES,
  FREE_CREDIT_OBJECTIVE_VALUES,
  FREE_CREDIT_REWARD_STATUS_VALUES,
  HOME_GAMES_COLLECTION_IDS,
  LIBRARY_CATEGORY_VALUES,
  LIBRARY_SORT_VALUES,
  MODERATION_REPORT_REASON_CODE_VALUES,
  MUSIC_PROMPT_MAX_LENGTH,
  NOTIFICATION_EVENT_TYPE_VALUES,
  NOTIFICATION_PREVIEW_KIND_VALUES,
  NOTIFICATION_STATUS_VALUES,
  SAVED_ITEM_KIND_VALUES,
  SEARCH_ASSET_TYPE_VALUES,
  SEARCH_KIND_VALUES,
  SEARCH_MODE_VALUES,
  SEARCH_RESULT_KIND_VALUES,
  SEARCH_SORT_VALUES,
  TAG_GROUP_SORT_VALUES,
  TAG_SLUG_REGEX,
  UnsupportedClientError,
  isPaginationMeta,
  isValidCollectionSlug,
  isValidTagSlug,
  normalizeCollectionSlug,
  normalizeTagRef,
  normalizeTagSlug,
  parseTagRef
});
