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 app_exports = {};
__export(app_exports, {
  APP_SURFACE_VALUES: () => APP_SURFACE_VALUES,
  APP_TYPE_DEFAULT_DISPLAY: () => APP_TYPE_DEFAULT_DISPLAY,
  APP_TYPE_VALUES: () => APP_TYPE_VALUES,
  DEFAULT_APP_SURFACE_TARGETS: () => DEFAULT_APP_SURFACE_TARGETS,
  DEFAULT_APP_TYPE: () => DEFAULT_APP_TYPE,
  getDefaultAppDisplayMetadata: () => getDefaultAppDisplayMetadata,
  isAppSurface: () => isAppSurface,
  isAppType: () => isAppType,
  normalizeAppSurfaceList: () => normalizeAppSurfaceList,
  normalizeAppType: () => normalizeAppType,
  parseAppSurface: () => parseAppSurface,
  parseAppType: () => parseAppType
});
module.exports = __toCommonJS(app_exports);
const APP_TYPE_VALUES = ["GAME", "TEMPLATE", "TOOL", "DEMO"];
const DEFAULT_APP_TYPE = "GAME";
const APP_SURFACE_VALUES = ["DESKTOP", "MOBILE_LANDSCAPE", "MOBILE_PORTRAIT"];
const DEFAULT_APP_SURFACE_TARGETS = ["DESKTOP", "MOBILE_LANDSCAPE"];
function isAppType(value) {
  if (typeof value !== "string") {
    return false;
  }
  return APP_TYPE_VALUES.includes(value.trim().toUpperCase());
}
function parseAppType(value) {
  if (typeof value !== "string") {
    return null;
  }
  const normalized = value.trim().toUpperCase();
  return isAppType(normalized) ? normalized : null;
}
function normalizeAppType(value, fallback = DEFAULT_APP_TYPE) {
  const parsed = parseAppType(value);
  return parsed ?? fallback;
}
function isAppSurface(value) {
  if (typeof value !== "string") {
    return false;
  }
  return APP_SURFACE_VALUES.includes(value.trim().toUpperCase());
}
function parseAppSurface(value) {
  if (typeof value !== "string") {
    return null;
  }
  const normalized = value.trim().toUpperCase();
  return isAppSurface(normalized) ? normalized : null;
}
function normalizeAppSurfaceList(value, fallback = DEFAULT_APP_SURFACE_TARGETS) {
  if (Array.isArray(value)) {
    const parsed = value.map((entry) => parseAppSurface(entry)).filter((entry) => Boolean(entry));
    if (parsed.length > 0) {
      return Array.from(new Set(parsed));
    }
  }
  return Array.from(fallback);
}
const APP_TYPE_DEFAULT_DISPLAY = {
  GAME: { emoji: "\u{1F680}", color: "#FF383C" },
  TOOL: { emoji: "\u{1F6E0}\uFE0F", color: "#0088FF" },
  TEMPLATE: { emoji: "\u{1F4CB}", color: "#8E8E93" },
  DEMO: { emoji: "\u{1F4A1}", color: "#000000" }
};
function getDefaultAppDisplayMetadata(type) {
  return APP_TYPE_DEFAULT_DISPLAY[type] ?? APP_TYPE_DEFAULT_DISPLAY[DEFAULT_APP_TYPE];
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  APP_SURFACE_VALUES,
  APP_TYPE_DEFAULT_DISPLAY,
  APP_TYPE_VALUES,
  DEFAULT_APP_SURFACE_TARGETS,
  DEFAULT_APP_TYPE,
  getDefaultAppDisplayMetadata,
  isAppSurface,
  isAppType,
  normalizeAppSurfaceList,
  normalizeAppType,
  parseAppSurface,
  parseAppType
});
