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);

// src/components/pisellRecordBoard/shellFrame/ResourceWall/venueWallUtils.ts
var venueWallUtils_exports = {};
__export(venueWallUtils_exports, {
  VENUE_WALL_STATUS_COLOR_MAP: () => VENUE_WALL_STATUS_COLOR_MAP,
  alphaColor: () => alphaColor,
  clamp: () => clamp,
  deriveVenueWallStatus: () => deriveVenueWallStatus,
  formatVenueWallCountdown: () => formatVenueWallCountdown
});
module.exports = __toCommonJS(venueWallUtils_exports);
var VENUE_WALL_STATUS_COLOR_MAP = {
  inUse: {
    key: "inUse",
    label: "In Use",
    note: "This court is currently in use.",
    color: "#6f4ae6",
    noteBg: "rgba(111,74,230,0.92)"
  },
  endingSoon: {
    key: "endingSoon",
    label: "Ending Soon",
    note: "Please leave on time to avoid overtime charges.",
    color: "#f59e0b",
    noteBg: "rgba(245,158,11,0.96)"
  },
  expired: {
    key: "expired",
    label: "Expired",
    note: "This booking has ended. Please clear the court.",
    color: "#ef4444",
    noteBg: "rgba(239,68,68,0.96)"
  },
  available: {
    key: "available",
    label: "Available",
    note: "This court is now available.",
    color: "#10b981",
    noteBg: "rgba(16,185,129,0.18)"
  },
  boardingSoon: {
    key: "boardingSoon",
    label: "Boarding Soon",
    note: "Please check in to start.",
    color: "#6f4ae6",
    noteBg: "rgba(111,74,230,0.18)"
  },
  late: {
    key: "late",
    label: "Late",
    note: "Please check in as soon as possible.",
    /** 与 available 同色板一致；主倒计时红色在 VenueWallCard 内单独覆盖 */
    color: "#10b981",
    noteBg: "rgba(16,185,129,0.18)"
  }
};
function alphaColor(hex, alpha) {
  const clean = hex.replace("#", "");
  const full = clean.length === 3 ? clean.split("").map((c) => c + c).join("") : clean;
  const num = parseInt(full, 16);
  const r = num >> 16 & 255;
  const g = num >> 8 & 255;
  const b = num & 255;
  return `rgba(${r}, ${g}, ${b}, ${alpha})`;
}
var clamp = (value, min, max) => Math.max(min, Math.min(max, value));
function deriveVenueWallStatus(card) {
  const s = card.status;
  if (s === "available") return "available";
  if (s === "boardingSoon") return "boardingSoon";
  if (s === "late") return "late";
  if (s === "endingSoon") return "endingSoon";
  if (s === "expired") return "expired";
  if (s === "inUse") return "inUse";
  if (card.currentBooking === "Available to Book") return "available";
  const rm = card.remainingMin;
  if (rm != null && rm <= 0) return "expired";
  if (rm != null && rm <= 10) return "endingSoon";
  return "inUse";
}
function formatVenueWallCountdown(min) {
  if (min < 0) return `${Math.abs(min)}m overtime`;
  if (min === 0) return "Ending now";
  return `${min}m left`;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  VENUE_WALL_STATUS_COLOR_MAP,
  alphaColor,
  clamp,
  deriveVenueWallStatus,
  formatVenueWallCountdown
});
