"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 instances_exports = {};
__export(instances_exports, {
  TableFormFieldsMessageType: () => TableFormFieldsMessageType,
  TableFormFieldsPropController: () => TableFormFieldsPropController,
  createPropController: () => createPropController
});
module.exports = __toCommonJS(instances_exports);
var import_descriptors = require("./descriptors");
var import_prop_controllers = require("@makeswift/prop-controllers");
var import_controls = require("@makeswift/controls");
const TableFormFieldsMessageType = {
  TABLE_FORM_LAYOUT_CHANGE: "TABLE_FORM_LAYOUT_CHANGE",
  TABLE_FORM_FIELD_LAYOUT_CHANGE: "TABLE_FORM_FIELD_LAYOUT_CHANGE"
};
class TableFormFieldsPropController extends import_controls.ControlInstance {
  recv = () => {
  };
  child(_key) {
    return void 0;
  }
  tableFormLayoutChange(payload) {
    this.sendMessage({ type: TableFormFieldsMessageType.TABLE_FORM_LAYOUT_CHANGE, payload });
  }
  tableFormFieldLayoutChange(payload) {
    this.sendMessage({ type: TableFormFieldsMessageType.TABLE_FORM_FIELD_LAYOUT_CHANGE, payload });
  }
}
function createPropController(descriptor, send) {
  if (!(0, import_descriptors.isLegacyDescriptor)(descriptor)) {
    return descriptor.createInstance(send);
  }
  switch (descriptor.type) {
    case import_prop_controllers.Types.TableFormFields:
      return new TableFormFieldsPropController(send);
    default:
      return new import_controls.DefaultControlInstance(send);
  }
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  TableFormFieldsMessageType,
  TableFormFieldsPropController,
  createPropController
});
//# sourceMappingURL=instances.js.map