/**
 * The `tera:` office catalogue — every built-in asset, in one list.
 *
 * Importing this module registers all of them into the shared `kit`, which is
 * what `kit.ts` says that registry is for. A self-hoster who wants their own
 * registry instead calls `registerOfficeAssets(mine)`; one who wants ours plus
 * theirs registers `acme:desk.standing` with `overrides: "tera:desk.workstation"`
 * afterwards and every desk in every pack becomes theirs, with no fork.
 *
 * ### What is deliberately not here
 *
 * There is no `shell.wall`, `shell.door` or `shell.window` (CONTRACT.md §2).
 * Walls are the `Floorplan`'s wall runs and a door or a window is an `Opening`
 * punched out of one; `Plan` hands each solid run left over to the `wallRun`
 * part in `parts.ts`. Shipping door props beside door-shaped holes would put
 * every opening in the scene twice, or — worse, because it is invisible until
 * somebody walks through a wall — leave the collider with no gap where the door
 * is.
 *
 * Forty assets is not a furniture catalogue and is not trying to be. It is
 * the set that gets a real floor plate looking like an office: somewhere to
 * work, somewhere to sit, somewhere to meet, somewhere to put things, something
 * to look at, something alive, and light.
 *
 * ### Why the count keeps going up, and why more *instances* would not have done
 *
 * Fifteen of these arrived at once — thirteen studio props and two devices — and
 * the reason is a property of `furnish.ts` rather than an appetite for
 * furniture. Props are batched by **(asset, colorKey)** and every instance in a
 * batch is geometrically identical, `ctx.rand` included. So a room that looks
 * sparse cannot be fixed by placing more of what is already there: ten more
 * shelves are the same shelf with the same books on it in ten places. Apparent
 * density is a function of how many distinct *kinds* a floor uses, and that
 * makes the length of this list the lever a pack author actually has.
 *
 * The catalogue is now three groups:
 *
 *  - the **office kit** (`desks`, `seating`, `tables`, `storage`, `screens`,
 *    `lighting`, `surfaces`, `greenery`) — a floor plate of desks and meetings;
 *  - the **habitat kit** (`habitat.ts`) — a studio home rather than an office;
 *  - the **studio kit** (`studio.ts`) and the **devices** (`devices.ts`) — a
 *    working production floor: a courtyard, a robotics lab, a model loft, and
 *    the two instruments the smart-device layer drives.
 */

import { kit, type AnyAsset, type AssetRegistry } from "../kit.ts";
import { deskPartition, deskPedestal, deskWorkstation } from "./desks.ts";
import { DEVICE_ASSETS, deviceMicDesk, deviceSpeakerDesk } from "./devices.ts";
import { plantPotted, plantTall } from "./greenery.ts";
import {
  bedPlatform,
  kitchenIsland,
  kitchenRun,
  lightFloor,
  seatStool,
  sofaModular,
  storageWardrobe,
} from "./habitat.ts";
import { lightPendant, lightTroffer } from "./lighting.ts";
import { robotOptimus } from "./optimus.ts";
import { screenMonitor, screenWallDisplay } from "./screens.ts";
import { seatLounge, seatTaskChair } from "./seating.ts";
import { storageLocker, storageShelf } from "./storage.ts";
import {
  STUDIO_ASSETS,
  acousticBaffle,
  benchLab,
  benchSlat,
  cameraTripod,
  canopyParasol,
  cartTool,
  caseStack,
  dividerSlat,
  dockRobot,
  lightSoftbox,
  planterTrough,
  rackEquipment,
  shelfWall,
} from "./studio.ts";
import { rug, whiteboard } from "./surfaces.ts";
import { tableMeeting, tableSide } from "./tables.ts";

export const OFFICE_ASSETS: readonly AnyAsset[] = [
  deskWorkstation,
  deskPedestal,
  deskPartition,
  seatTaskChair,
  seatLounge,
  tableMeeting,
  tableSide,
  storageShelf,
  storageLocker,
  screenMonitor,
  screenWallDisplay,
  plantPotted,
  plantTall,
  lightPendant,
  lightTroffer,
  robotOptimus,
  rug,
  whiteboard,
  bedPlatform,
  sofaModular,
  kitchenRun,
  kitchenIsland,
  storageWardrobe,
  seatStool,
  lightFloor,
  ...STUDIO_ASSETS,
  ...DEVICE_ASSETS,
];

/** Register the built-in catalogue into a registry. Defaults to the shared one. */
export function registerOfficeAssets(registry: AssetRegistry = kit): AssetRegistry {
  return registry.registerAll(OFFICE_ASSETS);
}

registerOfficeAssets();

export {
  deskPartition,
  deskPedestal,
  deskWorkstation,
  lightPendant,
  lightTroffer,
  robotOptimus,
  plantPotted,
  plantTall,
  rug,
  screenMonitor,
  screenWallDisplay,
  seatLounge,
  seatTaskChair,
  storageLocker,
  storageShelf,
  tableMeeting,
  tableSide,
  whiteboard,
  bedPlatform,
  sofaModular,
  kitchenRun,
  kitchenIsland,
  storageWardrobe,
  seatStool,
  lightFloor,
  planterTrough,
  benchSlat,
  canopyParasol,
  benchLab,
  rackEquipment,
  cartTool,
  dockRobot,
  caseStack,
  lightSoftbox,
  cameraTripod,
  acousticBaffle,
  dividerSlat,
  shelfWall,
  deviceMicDesk,
  deviceSpeakerDesk,
};

export { DEVICE_ASSET_IDS, DEVICE_INDICATOR_NAME } from "./devices.ts";
export { STUDIO_ASSET_IDS } from "./studio.ts";
