/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { AccessLevel } from "@matter/model";
import { BitmapSchema, NodeId, WildcardPathFlagsBitmap } from "@matter/types";
const WildcardPathFlagsCodec = BitmapSchema(WildcardPathFlagsBitmap);
const FallbackLimits = {
  fabricScoped: false,
  fabricSensitive: false,
  readable: true,
  readLevel: AccessLevel.View,
  timed: false,
  largeMessage: false,
  writable: true,
  writeLevel: AccessLevel.Administer
};
class DataResponse {
  // Configuration
  #session;
  #node;
  // The node ID may be expensive to retrieve and is invariant, so we cache it here
  #cachedNodeId;
  constructor(node, session) {
    this.#node = node;
    this.#session = session;
  }
  get node() {
    return this.#node;
  }
  get session() {
    return this.#session;
  }
  /**
   * Update the session for processing subsequent chunks.
   * This allows reusing the same response instance while maintaining state across chunks.
   */
  updateSession(session) {
    this.#session = session;
  }
  /**
   * The node ID used to filter paths with node ID specified.  Unsure if this is ever actually used.
   */
  get nodeId() {
    if (this.#cachedNodeId === void 0) {
      this.#cachedNodeId = (this.#session.fabric && this.#node.nodeIdFor(this.#session.fabric)) ?? NodeId.UNSPECIFIED_NODE_ID;
    }
    return this.#cachedNodeId;
  }
  join(...name) {
    return this.#session.transaction?.join(...name);
  }
}
export {
  DataResponse,
  FallbackLimits,
  WildcardPathFlagsCodec
};
//# sourceMappingURL=DataResponse.js.map
