/**
 * @license
 * Copyright 2025-2026 Open Home Foundation
 * SPDX-License-Identifier: Apache-2.0
 */
function isRecord(value) {
  return typeof value === "object" && value !== null;
}
class BindingEntryDataTransformer {
  static {
    this.KEY_MAPPING = {
      "1": "node",
      "2": "group",
      "3": "endpoint",
      "4": "cluster",
      "254": "fabricIndex"
    };
  }
  static transform(input) {
    if (!isRecord(input)) {
      throw new Error("Invalid input: expected an object");
    }
    const result = {};
    const keyMapping = BindingEntryDataTransformer.KEY_MAPPING;
    for (const key in input) {
      if (key in keyMapping) {
        const mappedKey = keyMapping[key];
        if (mappedKey) {
          const value = input[key];
          if (value == null) {
            continue;
          }
          if (mappedKey === "node") {
            if (typeof value === "number" || typeof value === "bigint") {
              result.node = value;
            }
          } else {
            result[mappedKey] = Number(value);
          }
        }
      }
    }
    return result;
  }
}
export {
  BindingEntryDataTransformer
};
//# sourceMappingURL=model.js.map
