"use strict";
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 slot_exports = {};
__export(slot_exports, {
  Slot: () => Slot,
  SlotControl: () => import_controls.SlotControl,
  SlotDefinition: () => SlotDefinition
});
module.exports = __toCommonJS(slot_exports);
var import_controls = require("@makeswift/controls");
var import_slot = require("../runtimes/react/controls/slot");
class BaseDefinition extends import_controls.SlotDefinition {
}
class SlotDefinition extends BaseDefinition {
  static deserialize(data) {
    if (data.type !== SlotDefinition.type) {
      throw new Error(`Slot: expected type ${SlotDefinition.type}, got ${data.type}`);
    }
    return Slot();
  }
  resolveValue(data, _resolver, _stylesheet, control) {
    const stableValue = (0, import_controls.StableValue)({
      name: SlotDefinition.type,
      read: () => (0, import_slot.renderSlot)({ data, control: control ?? null })
    });
    return {
      ...stableValue,
      triggerResolve: async () => {
      }
    };
  }
}
function Slot() {
  return new SlotDefinition();
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  Slot,
  SlotControl,
  SlotDefinition
});
//# sourceMappingURL=slot.js.map