"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 ClientNode_exports = {};
__export(ClientNode_exports, {
  ClientNode: () => ClientNode
});
module.exports = __toCommonJS(ClientNode_exports);
var import_EndpointInitializer = require("#endpoint/properties/EndpointInitializer.js");
var import_general = require("#general");
var import_ClientEndpointInitializer = require("./client/ClientEndpointInitializer.js");
var import_ClientNodeLifecycle = require("./ClientNodeLifecycle.js");
var import_Node = require("./Node.js");
var import_ServerNode = require("./ServerNode.js");
/**
 * @license
 * Copyright 2022-2024 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
class ClientNode extends import_Node.Node {
  #fabricId;
  #nodeId;
  constructor(options) {
    super({
      id: `${options.fabricId}:${options.nodeId}`,
      number: 0,
      type: import_Node.Node.CommonRootEndpoint,
      owner: options.owner
    });
    this.#fabricId = options.fabricId;
    this.#nodeId = options.nodeId;
    this.env.set(import_EndpointInitializer.EndpointInitializer, new import_ClientEndpointInitializer.ClientEndpointInitializer());
  }
  get fabricId() {
    return this.#fabricId;
  }
  get nodeId() {
    return this.#nodeId;
  }
  get lifecycle() {
    return super.lifecycle;
  }
  get owner() {
    return super.owner;
  }
  set owner(node) {
    if (!(node instanceof import_ServerNode.ServerNode)) {
      throw new import_general.ImplementationError("Client node owner must be a server node");
    }
    super.owner = node;
  }
  createRuntime() {
    throw new import_general.NotImplementedError();
  }
  get container() {
    return this.owner?.nodes;
  }
  createLifecycle() {
    return new import_ClientNodeLifecycle.ClientNodeLifecycle(this);
  }
}
//# sourceMappingURL=ClientNode.js.map
