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/pisellFloorMapLayout/utils/floorMapDataBindingUtils.ts
var floorMapDataBindingUtils_exports = {};
__export(floorMapDataBindingUtils_exports, {
  findFloorMapRowByDataBinding: () => findFloorMapRowByDataBinding,
  getFloorMapBindingPlaceholderReason: () => getFloorMapBindingPlaceholderReason
});
module.exports = __toCommonJS(floorMapDataBindingUtils_exports);
function findFloorMapRowByDataBinding(item, dataSources) {
  var _a;
  const binding = (_a = item._sceneElement) == null ? void 0 : _a.dataBinding;
  if (!(binding == null ? void 0 : binding.dataSourceKey) || binding.recordId == null) return void 0;
  const list = dataSources[binding.dataSourceKey];
  const rid = String(binding.recordId);
  return list == null ? void 0 : list.find((r) => r.id === rid);
}
function getFloorMapBindingPlaceholderReason(item, dataSources) {
  var _a;
  if (findFloorMapRowByDataBinding(item, dataSources)) return null;
  const binding = (_a = item._sceneElement) == null ? void 0 : _a.dataBinding;
  const hasKey = Boolean(
    (binding == null ? void 0 : binding.dataSourceKey) && String(binding.dataSourceKey).trim() !== ""
  );
  const rid = (binding == null ? void 0 : binding.recordId) != null ? String(binding.recordId).trim() : "";
  if (!hasKey) return "missing_data_source_key";
  if (!rid) return "missing_record_id";
  if (rid.startsWith("new_")) return "new_unsaved_slot";
  return "record_not_in_list";
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  findFloorMapRowByDataBinding,
  getFloorMapBindingPlaceholderReason
});
