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UvE,EACxB,CAkBAuE,SAAAA,CAAUvE,GACR,MAAM+D,EAAQ/D,EAAQa,WAIhB2D,EAAW,GAAGT,KAHR/D,EAAQE,kBAIduE,EAAcjJ,KAAK8H,eAAetH,IAAIwI,GAC5C,GAAIC,EACF,IAAK,IAAI/G,EAAI,EAAGA,EAAI+G,EAAY7G,OAAQF,IACtC,GAAIsC,EAAQkB,QAAQuD,EAAY/G,IAAK,OAAO+G,EAAY/G,GAK5D,MAAMgH,EAAiBlJ,KAAK+H,iBAAiBvH,IAAI+H,GACjD,GAAIW,EACF,IAAK,IAAIhH,EAAI,EAAGA,EAAIgH,EAAe9G,OAAQF,IACzC,GAAIsC,EAAQkB,QAAQwD,EAAehH,IAAK,OAAOgH,EAAehH,GAKlE,IAAK,IAAIA,EAAI,EAAGA,EAAIlC,KAAKgI,eAAe5F,OAAQF,IAC9C,GAAIsC,EAAQkB,QAAQ1F,KAAKgI,eAAe9F,IAAK,OAAOlC,KAAKgI,eAAe9F,GAG1E,OAAO,IACT,ECnLF,SAAiBjB,WAAU,EAAE6E,QAAO,EAAE+B,cAAaA,G","sources":["webpack://pem/webpack/universalModuleDefinition","webpack://pem/webpack/bootstrap","webpack://pem/webpack/runtime/define property getters","webpack://pem/webpack/runtime/hasOwnProperty shorthand","webpack://pem/webpack/runtime/make namespace object","webpack://pem/./src/Expression.js","webpack://pem/./src/Matcher.js","webpack://pem/./src/ExpressionSet.js","webpack://pem/./src/index.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"pem\"] = factory();\n\telse\n\t\troot[\"pem\"] = factory();\n})(this, () => {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * Expression - Parses and stores a tag pattern expression\n * \n * Patterns are parsed once and stored in an optimized structure for fast matching.\n * \n * @example\n * const expr = new Expression(\"root.users.user\");\n * const expr2 = new Expression(\"..user[id]:first\");\n * const expr3 = new Expression(\"root/users/user\", { separator: '/' });\n */\nexport default class Expression {\n  /**\n   * Create a new Expression\n   * @param {string} pattern - Pattern string (e.g., \"root.users.user\", \"..user[id]\")\n   * @param {Object} options - Configuration options\n   * @param {string} options.separator - Path separator (default: '.')\n   */\n  constructor(pattern, options = {}, data) {\n    this.pattern = pattern;\n    this.separator = options.separator || '.';\n    this.segments = this._parse(pattern);\n    this.data = data;\n    // Cache expensive checks for performance (O(1) instead of O(n))\n    this._hasDeepWildcard = this.segments.some(seg => seg.type === 'deep-wildcard');\n    this._hasAttributeCondition = this.segments.some(seg => seg.attrName !== undefined);\n    this._hasPositionSelector = this.segments.some(seg => seg.position !== undefined);\n  }\n\n  /**\n   * Parse pattern string into segments\n   * @private\n   * @param {string} pattern - Pattern to parse\n   * @returns {Array} Array of segment objects\n   */\n  _parse(pattern) {\n    const segments = [];\n\n    // Split by separator but handle \"..\" specially\n    let i = 0;\n    let currentPart = '';\n\n    while (i < pattern.length) {\n      if (pattern[i] === this.separator) {\n        // Check if next char is also separator (deep wildcard)\n        if (i + 1 < pattern.length && pattern[i + 1] === this.separator) {\n          // Flush current part if any\n          if (currentPart.trim()) {\n            segments.push(this._parseSegment(currentPart.trim()));\n            currentPart = '';\n          }\n          // Add deep wildcard\n          segments.push({ type: 'deep-wildcard' });\n          i += 2; // Skip both separators\n        } else {\n          // Regular separator\n          if (currentPart.trim()) {\n            segments.push(this._parseSegment(currentPart.trim()));\n          }\n          currentPart = '';\n          i++;\n        }\n      } else {\n        currentPart += pattern[i];\n        i++;\n      }\n    }\n\n    // Flush remaining part\n    if (currentPart.trim()) {\n      segments.push(this._parseSegment(currentPart.trim()));\n    }\n\n    return segments;\n  }\n\n  /**\n   * Parse a single segment\n   * @private\n   * @param {string} part - Segment string (e.g., \"user\", \"ns::user\", \"user[id]\", \"ns::user:first\")\n   * @returns {Object} Segment object\n   */\n  _parseSegment(part) {\n    const segment = { type: 'tag' };\n\n    // NEW NAMESPACE SYNTAX (v2.0):\n    // ============================\n    // Namespace uses DOUBLE colon (::)\n    // Position uses SINGLE colon (:)\n    // \n    // Examples:\n    //   \"user\"              → tag\n    //   \"user:first\"        → tag + position\n    //   \"user[id]\"          → tag + attribute\n    //   \"user[id]:first\"    → tag + attribute + position\n    //   \"ns::user\"          → namespace + tag\n    //   \"ns::user:first\"    → namespace + tag + position\n    //   \"ns::user[id]\"      → namespace + tag + attribute\n    //   \"ns::user[id]:first\" → namespace + tag + attribute + position\n    //   \"ns::first\"         → namespace + tag named \"first\" (NO ambiguity!)\n    //\n    // This eliminates all ambiguity:\n    //   :: = namespace separator\n    //   :  = position selector\n    //   [] = attributes\n\n    // Step 1: Extract brackets [attr] or [attr=value]\n    let bracketContent = null;\n    let withoutBrackets = part;\n\n    const bracketMatch = part.match(/^([^\\[]+)(\\[[^\\]]*\\])(.*)$/);\n    if (bracketMatch) {\n      withoutBrackets = bracketMatch[1] + bracketMatch[3];\n      if (bracketMatch[2]) {\n        const content = bracketMatch[2].slice(1, -1);\n        if (content) {\n          bracketContent = content;\n        }\n      }\n    }\n\n    // Step 2: Check for namespace (double colon ::)\n    let namespace = undefined;\n    let tagAndPosition = withoutBrackets;\n\n    if (withoutBrackets.includes('::')) {\n      const nsIndex = withoutBrackets.indexOf('::');\n      namespace = withoutBrackets.substring(0, nsIndex).trim();\n      tagAndPosition = withoutBrackets.substring(nsIndex + 2).trim(); // Skip ::\n\n      if (!namespace) {\n        throw new Error(`Invalid namespace in pattern: ${part}`);\n      }\n    }\n\n    // Step 3: Parse tag and position (single colon :)\n    let tag = undefined;\n    let positionMatch = null;\n\n    if (tagAndPosition.includes(':')) {\n      const colonIndex = tagAndPosition.lastIndexOf(':'); // Use last colon for position\n      const tagPart = tagAndPosition.substring(0, colonIndex).trim();\n      const posPart = tagAndPosition.substring(colonIndex + 1).trim();\n\n      // Verify position is a valid keyword\n      const isPositionKeyword = ['first', 'last', 'odd', 'even'].includes(posPart) ||\n        /^nth\\(\\d+\\)$/.test(posPart);\n\n      if (isPositionKeyword) {\n        tag = tagPart;\n        positionMatch = posPart;\n      } else {\n        // Not a valid position keyword, treat whole thing as tag\n        tag = tagAndPosition;\n      }\n    } else {\n      tag = tagAndPosition;\n    }\n\n    if (!tag) {\n      throw new Error(`Invalid segment pattern: ${part}`);\n    }\n\n    segment.tag = tag;\n    if (namespace) {\n      segment.namespace = namespace;\n    }\n\n    // Step 4: Parse attributes\n    if (bracketContent) {\n      if (bracketContent.includes('=')) {\n        const eqIndex = bracketContent.indexOf('=');\n        segment.attrName = bracketContent.substring(0, eqIndex).trim();\n        segment.attrValue = bracketContent.substring(eqIndex + 1).trim();\n      } else {\n        segment.attrName = bracketContent.trim();\n      }\n    }\n\n    // Step 5: Parse position selector\n    if (positionMatch) {\n      const nthMatch = positionMatch.match(/^nth\\((\\d+)\\)$/);\n      if (nthMatch) {\n        segment.position = 'nth';\n        segment.positionValue = parseInt(nthMatch[1], 10);\n      } else {\n        segment.position = positionMatch;\n      }\n    }\n\n    return segment;\n  }\n\n  /**\n   * Get the number of segments\n   * @returns {number}\n   */\n  get length() {\n    return this.segments.length;\n  }\n\n  /**\n   * Check if expression contains deep wildcard\n   * @returns {boolean}\n   */\n  hasDeepWildcard() {\n    return this._hasDeepWildcard;\n  }\n\n  /**\n   * Check if expression has attribute conditions\n   * @returns {boolean}\n   */\n  hasAttributeCondition() {\n    return this._hasAttributeCondition;\n  }\n\n  /**\n   * Check if expression has position selectors\n   * @returns {boolean}\n   */\n  hasPositionSelector() {\n    return this._hasPositionSelector;\n  }\n\n  /**\n   * Get string representation\n   * @returns {string}\n   */\n  toString() {\n    return this.pattern;\n  }\n}","import ExpressionSet from \"./ExpressionSet.js\";\n\n/**\n * MatcherView - A lightweight read-only view over a Matcher's internal state.\n *\n * Created once by Matcher and reused across all callbacks. Holds a direct\n * reference to the parent Matcher so it always reflects current parser state\n * with zero copying or freezing overhead.\n *\n * Users receive this via {@link Matcher#readOnly} or directly from parser\n * callbacks. It exposes all query and matching methods but has no mutation\n * methods — misuse is caught at the TypeScript level rather than at runtime.\n *\n * @example\n * const matcher = new Matcher();\n * const view = matcher.readOnly();\n *\n * matcher.push(\"root\", {});\n * view.getCurrentTag(); // \"root\"\n * view.getDepth();      // 1\n */\nexport class MatcherView {\n  /**\n   * @param {Matcher} matcher - The parent Matcher instance to read from.\n   */\n  constructor(matcher) {\n    this._matcher = matcher;\n  }\n\n  /**\n   * Get the path separator used by the parent matcher.\n   * @returns {string}\n   */\n  get separator() {\n    return this._matcher.separator;\n  }\n\n  /**\n   * Get current tag name.\n   * @returns {string|undefined}\n   */\n  getCurrentTag() {\n    const path = this._matcher.path;\n    return path.length > 0 ? path[path.length - 1].tag : undefined;\n  }\n\n  /**\n   * Get current namespace.\n   * @returns {string|undefined}\n   */\n  getCurrentNamespace() {\n    const path = this._matcher.path;\n    return path.length > 0 ? path[path.length - 1].namespace : undefined;\n  }\n\n  /**\n   * Get current node's attribute value.\n   * @param {string} attrName\n   * @returns {*}\n   */\n  getAttrValue(attrName) {\n    const path = this._matcher.path;\n    if (path.length === 0) return undefined;\n    return path[path.length - 1].values?.[attrName];\n  }\n\n  /**\n   * Check if current node has an attribute.\n   * @param {string} attrName\n   * @returns {boolean}\n   */\n  hasAttr(attrName) {\n    const path = this._matcher.path;\n    if (path.length === 0) return false;\n    const current = path[path.length - 1];\n    return current.values !== undefined && attrName in current.values;\n  }\n\n  /**\n   * Get current node's sibling position (child index in parent).\n   * @returns {number}\n   */\n  getPosition() {\n    const path = this._matcher.path;\n    if (path.length === 0) return -1;\n    return path[path.length - 1].position ?? 0;\n  }\n\n  /**\n   * Get current node's repeat counter (occurrence count of this tag name).\n   * @returns {number}\n   */\n  getCounter() {\n    const path = this._matcher.path;\n    if (path.length === 0) return -1;\n    return path[path.length - 1].counter ?? 0;\n  }\n\n  /**\n   * Get current node's sibling index (alias for getPosition).\n   * @returns {number}\n   * @deprecated Use getPosition() or getCounter() instead\n   */\n  getIndex() {\n    return this.getPosition();\n  }\n\n  /**\n   * Get current path depth.\n   * @returns {number}\n   */\n  getDepth() {\n    return this._matcher.path.length;\n  }\n\n  /**\n   * Get path as string.\n   * @param {string} [separator] - Optional separator (uses default if not provided)\n   * @param {boolean} [includeNamespace=true]\n   * @returns {string}\n   */\n  toString(separator, includeNamespace = true) {\n    return this._matcher.toString(separator, includeNamespace);\n  }\n\n  /**\n   * Get path as array of tag names.\n   * @returns {string[]}\n   */\n  toArray() {\n    return this._matcher.path.map(n => n.tag);\n  }\n\n  /**\n   * Match current path against an Expression.\n   * @param {Expression} expression\n   * @returns {boolean}\n   */\n  matches(expression) {\n    return this._matcher.matches(expression);\n  }\n\n  /**\n   * Match any expression in the given set against the current path.\n   * @param {ExpressionSet} exprSet\n   * @returns {boolean}\n   */\n  matchesAny(exprSet) {\n    return exprSet.matchesAny(this._matcher);\n  }\n}\n\n/**\n * Matcher - Tracks current path in XML/JSON tree and matches against Expressions.\n *\n * The matcher maintains a stack of nodes representing the current path from root to\n * current tag. It only stores attribute values for the current (top) node to minimize\n * memory usage. Sibling tracking is used to auto-calculate position and counter.\n *\n * Use {@link Matcher#readOnly} to obtain a {@link MatcherView} safe to pass to\n * user callbacks — it always reflects current state with no Proxy overhead.\n *\n * @example\n * const matcher = new Matcher();\n * matcher.push(\"root\", {});\n * matcher.push(\"users\", {});\n * matcher.push(\"user\", { id: \"123\", type: \"admin\" });\n *\n * const expr = new Expression(\"root.users.user\");\n * matcher.matches(expr); // true\n */\nexport default class Matcher {\n  /**\n   * Create a new Matcher.\n   * @param {Object} [options={}]\n   * @param {string} [options.separator='.'] - Default path separator\n   */\n  constructor(options = {}) {\n    this.separator = options.separator || '.';\n    this.path = [];\n    this.siblingStacks = [];\n    // Each path node: { tag, values, position, counter, namespace? }\n    // values only present for current (last) node\n    // Each siblingStacks entry: Map<tagName, count> tracking occurrences at each level\n    this._pathStringCache = null;\n    this._view = new MatcherView(this);\n  }\n\n  /**\n   * Push a new tag onto the path.\n   * @param {string} tagName\n   * @param {Object|null} [attrValues=null]\n   * @param {string|null} [namespace=null]\n   */\n  push(tagName, attrValues = null, namespace = null) {\n    this._pathStringCache = null;\n\n    // Remove values from previous current node (now becoming ancestor)\n    if (this.path.length > 0) {\n      this.path[this.path.length - 1].values = undefined;\n    }\n\n    // Get or create sibling tracking for current level\n    const currentLevel = this.path.length;\n    if (!this.siblingStacks[currentLevel]) {\n      this.siblingStacks[currentLevel] = new Map();\n    }\n\n    const siblings = this.siblingStacks[currentLevel];\n\n    // Create a unique key for sibling tracking that includes namespace\n    const siblingKey = namespace ? `${namespace}:${tagName}` : tagName;\n\n    // Calculate counter (how many times this tag appeared at this level)\n    const counter = siblings.get(siblingKey) || 0;\n\n    // Calculate position (total children at this level so far)\n    let position = 0;\n    for (const count of siblings.values()) {\n      position += count;\n    }\n\n    // Update sibling count for this tag\n    siblings.set(siblingKey, counter + 1);\n\n    // Create new node\n    const node = {\n      tag: tagName,\n      position: position,\n      counter: counter\n    };\n\n    if (namespace !== null && namespace !== undefined) {\n      node.namespace = namespace;\n    }\n\n    if (attrValues !== null && attrValues !== undefined) {\n      node.values = attrValues;\n    }\n\n    this.path.push(node);\n  }\n\n  /**\n   * Pop the last tag from the path.\n   * @returns {Object|undefined} The popped node\n   */\n  pop() {\n    if (this.path.length === 0) return undefined;\n    this._pathStringCache = null;\n\n    const node = this.path.pop();\n\n    if (this.siblingStacks.length > this.path.length + 1) {\n      this.siblingStacks.length = this.path.length + 1;\n    }\n\n    return node;\n  }\n\n  /**\n   * Update current node's attribute values.\n   * Useful when attributes are parsed after push.\n   * @param {Object} attrValues\n   */\n  updateCurrent(attrValues) {\n    if (this.path.length > 0) {\n      const current = this.path[this.path.length - 1];\n      if (attrValues !== null && attrValues !== undefined) {\n        current.values = attrValues;\n      }\n    }\n  }\n\n  /**\n   * Get current tag name.\n   * @returns {string|undefined}\n   */\n  getCurrentTag() {\n    return this.path.length > 0 ? this.path[this.path.length - 1].tag : undefined;\n  }\n\n  /**\n   * Get current namespace.\n   * @returns {string|undefined}\n   */\n  getCurrentNamespace() {\n    return this.path.length > 0 ? this.path[this.path.length - 1].namespace : undefined;\n  }\n\n  /**\n   * Get current node's attribute value.\n   * @param {string} attrName\n   * @returns {*}\n   */\n  getAttrValue(attrName) {\n    if (this.path.length === 0) return undefined;\n    return this.path[this.path.length - 1].values?.[attrName];\n  }\n\n  /**\n   * Check if current node has an attribute.\n   * @param {string} attrName\n   * @returns {boolean}\n   */\n  hasAttr(attrName) {\n    if (this.path.length === 0) return false;\n    const current = this.path[this.path.length - 1];\n    return current.values !== undefined && attrName in current.values;\n  }\n\n  /**\n   * Get current node's sibling position (child index in parent).\n   * @returns {number}\n   */\n  getPosition() {\n    if (this.path.length === 0) return -1;\n    return this.path[this.path.length - 1].position ?? 0;\n  }\n\n  /**\n   * Get current node's repeat counter (occurrence count of this tag name).\n   * @returns {number}\n   */\n  getCounter() {\n    if (this.path.length === 0) return -1;\n    return this.path[this.path.length - 1].counter ?? 0;\n  }\n\n  /**\n   * Get current node's sibling index (alias for getPosition).\n   * @returns {number}\n   * @deprecated Use getPosition() or getCounter() instead\n   */\n  getIndex() {\n    return this.getPosition();\n  }\n\n  /**\n   * Get current path depth.\n   * @returns {number}\n   */\n  getDepth() {\n    return this.path.length;\n  }\n\n  /**\n   * Get path as string.\n   * @param {string} [separator] - Optional separator (uses default if not provided)\n   * @param {boolean} [includeNamespace=true]\n   * @returns {string}\n   */\n  toString(separator, includeNamespace = true) {\n    const sep = separator || this.separator;\n    const isDefault = (sep === this.separator && includeNamespace === true);\n\n    if (isDefault) {\n      if (this._pathStringCache !== null) {\n        return this._pathStringCache;\n      }\n      const result = this.path.map(n =>\n        (n.namespace) ? `${n.namespace}:${n.tag}` : n.tag\n      ).join(sep);\n      this._pathStringCache = result;\n      return result;\n    }\n\n    return this.path.map(n =>\n      (includeNamespace && n.namespace) ? `${n.namespace}:${n.tag}` : n.tag\n    ).join(sep);\n  }\n\n  /**\n   * Get path as array of tag names.\n   * @returns {string[]}\n   */\n  toArray() {\n    return this.path.map(n => n.tag);\n  }\n\n  /**\n   * Reset the path to empty.\n   */\n  reset() {\n    this._pathStringCache = null;\n    this.path = [];\n    this.siblingStacks = [];\n  }\n\n  /**\n   * Match current path against an Expression.\n   * @param {Expression} expression\n   * @returns {boolean}\n   */\n  matches(expression) {\n    const segments = expression.segments;\n\n    if (segments.length === 0) {\n      return false;\n    }\n\n    if (expression.hasDeepWildcard()) {\n      return this._matchWithDeepWildcard(segments);\n    }\n\n    return this._matchSimple(segments);\n  }\n\n  /**\n   * @private\n   */\n  _matchSimple(segments) {\n    if (this.path.length !== segments.length) {\n      return false;\n    }\n\n    for (let i = 0; i < segments.length; i++) {\n      if (!this._matchSegment(segments[i], this.path[i], i === this.path.length - 1)) {\n        return false;\n      }\n    }\n\n    return true;\n  }\n\n  /**\n   * @private\n   */\n  _matchWithDeepWildcard(segments) {\n    let pathIdx = this.path.length - 1;\n    let segIdx = segments.length - 1;\n\n    while (segIdx >= 0 && pathIdx >= 0) {\n      const segment = segments[segIdx];\n\n      if (segment.type === 'deep-wildcard') {\n        segIdx--;\n\n        if (segIdx < 0) {\n          return true;\n        }\n\n        const nextSeg = segments[segIdx];\n        let found = false;\n\n        for (let i = pathIdx; i >= 0; i--) {\n          if (this._matchSegment(nextSeg, this.path[i], i === this.path.length - 1)) {\n            pathIdx = i - 1;\n            segIdx--;\n            found = true;\n            break;\n          }\n        }\n\n        if (!found) {\n          return false;\n        }\n      } else {\n        if (!this._matchSegment(segment, this.path[pathIdx], pathIdx === this.path.length - 1)) {\n          return false;\n        }\n        pathIdx--;\n        segIdx--;\n      }\n    }\n\n    return segIdx < 0;\n  }\n\n  /**\n   * @private\n   */\n  _matchSegment(segment, node, isCurrentNode) {\n    if (segment.tag !== '*' && segment.tag !== node.tag) {\n      return false;\n    }\n\n    if (segment.namespace !== undefined) {\n      if (segment.namespace !== '*' && segment.namespace !== node.namespace) {\n        return false;\n      }\n    }\n\n    if (segment.attrName !== undefined) {\n      if (!isCurrentNode) {\n        return false;\n      }\n\n      if (!node.values || !(segment.attrName in node.values)) {\n        return false;\n      }\n\n      if (segment.attrValue !== undefined) {\n        if (String(node.values[segment.attrName]) !== String(segment.attrValue)) {\n          return false;\n        }\n      }\n    }\n\n    if (segment.position !== undefined) {\n      if (!isCurrentNode) {\n        return false;\n      }\n\n      const counter = node.counter ?? 0;\n\n      if (segment.position === 'first' && counter !== 0) {\n        return false;\n      } else if (segment.position === 'odd' && counter % 2 !== 1) {\n        return false;\n      } else if (segment.position === 'even' && counter % 2 !== 0) {\n        return false;\n      } else if (segment.position === 'nth' && counter !== segment.positionValue) {\n        return false;\n      }\n    }\n\n    return true;\n  }\n\n  /**\n   * Match any expression in the given set against the current path.\n   * @param {ExpressionSet} exprSet\n   * @returns {boolean}\n   */\n  matchesAny(exprSet) {\n    return exprSet.matchesAny(this);\n  }\n\n  /**\n   * Create a snapshot of current state.\n   * @returns {Object}\n   */\n  snapshot() {\n    return {\n      path: this.path.map(node => ({ ...node })),\n      siblingStacks: this.siblingStacks.map(map => new Map(map))\n    };\n  }\n\n  /**\n   * Restore state from snapshot.\n   * @param {Object} snapshot\n   */\n  restore(snapshot) {\n    this._pathStringCache = null;\n    this.path = snapshot.path.map(node => ({ ...node }));\n    this.siblingStacks = snapshot.siblingStacks.map(map => new Map(map));\n  }\n\n  /**\n   * Return the read-only {@link MatcherView} for this matcher.\n   *\n   * The same instance is returned on every call — no allocation occurs.\n   * It always reflects the current parser state and is safe to pass to\n   * user callbacks without risk of accidental mutation.\n   *\n   * @returns {MatcherView}\n   *\n   * @example\n   * const view = matcher.readOnly();\n   * // pass view to callbacks — it stays in sync automatically\n   * view.matches(expr);       // ✓\n   * view.getCurrentTag();     // ✓\n   * // view.push(...)         // ✗ method does not exist — caught by TypeScript\n   */\n  readOnly() {\n    return this._view;\n  }\n}","/**\n * ExpressionSet - An indexed collection of Expressions for efficient bulk matching\n *\n * Instead of iterating all expressions on every tag, ExpressionSet pre-indexes\n * them at insertion time by depth and terminal tag name. At match time, only\n * the relevant bucket is evaluated — typically reducing checks from O(E) to O(1)\n * lookup plus O(small bucket) matches.\n *\n * Three buckets are maintained:\n *  - `_byDepthAndTag`  — exact depth + exact tag name  (tightest, used first)\n *  - `_wildcardByDepth` — exact depth + wildcard tag `*` (depth-matched only)\n *  - `_deepWildcards`  — expressions containing `..`  (cannot be depth-indexed)\n *\n * @example\n * import { Expression, ExpressionSet } from 'fast-xml-tagger';\n *\n * // Build once at config time\n * const stopNodes = new ExpressionSet();\n * stopNodes.add(new Expression('root.users.user'));\n * stopNodes.add(new Expression('root.config.setting'));\n * stopNodes.add(new Expression('..script'));\n *\n * // Query on every tag — hot path\n * if (stopNodes.matchesAny(matcher)) { ... }\n */\nexport default class ExpressionSet {\n  constructor() {\n    /** @type {Map<string, import('./Expression.js').default[]>} depth:tag → expressions */\n    this._byDepthAndTag = new Map();\n\n    /** @type {Map<number, import('./Expression.js').default[]>} depth → wildcard-tag expressions */\n    this._wildcardByDepth = new Map();\n\n    /** @type {import('./Expression.js').default[]} expressions containing deep wildcard (..) */\n    this._deepWildcards = [];\n\n    /** @type {Set<string>} pattern strings already added — used for deduplication */\n    this._patterns = new Set();\n\n    /** @type {boolean} whether the set is sealed against further additions */\n    this._sealed = false;\n  }\n\n  /**\n   * Add an Expression to the set.\n   * Duplicate patterns (same pattern string) are silently ignored.\n   *\n   * @param {import('./Expression.js').default} expression - A pre-constructed Expression instance\n   * @returns {this} for chaining\n   * @throws {TypeError} if called after seal()\n   *\n   * @example\n   * set.add(new Expression('root.users.user'));\n   * set.add(new Expression('..script'));\n   */\n  add(expression) {\n    if (this._sealed) {\n      throw new TypeError(\n        'ExpressionSet is sealed. Create a new ExpressionSet to add more expressions.'\n      );\n    }\n\n    // Deduplicate by pattern string\n    if (this._patterns.has(expression.pattern)) return this;\n    this._patterns.add(expression.pattern);\n\n    if (expression.hasDeepWildcard()) {\n      this._deepWildcards.push(expression);\n      return this;\n    }\n\n    const depth = expression.length;\n    const lastSeg = expression.segments[expression.segments.length - 1];\n    const tag = lastSeg?.tag;\n\n    if (!tag || tag === '*') {\n      // Can index by depth but not by tag\n      if (!this._wildcardByDepth.has(depth)) this._wildcardByDepth.set(depth, []);\n      this._wildcardByDepth.get(depth).push(expression);\n    } else {\n      // Tightest bucket: depth + tag\n      const key = `${depth}:${tag}`;\n      if (!this._byDepthAndTag.has(key)) this._byDepthAndTag.set(key, []);\n      this._byDepthAndTag.get(key).push(expression);\n    }\n\n    return this;\n  }\n\n  /**\n   * Add multiple expressions at once.\n   *\n   * @param {import('./Expression.js').default[]} expressions - Array of Expression instances\n   * @returns {this} for chaining\n   *\n   * @example\n   * set.addAll([\n   *   new Expression('root.users.user'),\n   *   new Expression('root.config.setting'),\n   * ]);\n   */\n  addAll(expressions) {\n    for (const expr of expressions) this.add(expr);\n    return this;\n  }\n\n  /**\n   * Check whether a pattern string is already present in the set.\n   *\n   * @param {import('./Expression.js').default} expression\n   * @returns {boolean}\n   */\n  has(expression) {\n    return this._patterns.has(expression.pattern);\n  }\n\n  /**\n   * Number of expressions in the set.\n   * @type {number}\n   */\n  get size() {\n    return this._patterns.size;\n  }\n\n  /**\n   * Seal the set against further modifications.\n   * Useful to prevent accidental mutations after config is built.\n   * Calling add() or addAll() on a sealed set throws a TypeError.\n   *\n   * @returns {this}\n   */\n  seal() {\n    this._sealed = true;\n    return this;\n  }\n\n  /**\n   * Whether the set has been sealed.\n   * @type {boolean}\n   */\n  get isSealed() {\n    return this._sealed;\n  }\n\n  /**\n   * Test whether the matcher's current path matches any expression in the set.\n   *\n   * Evaluation order (cheapest → most expensive):\n   *  1. Exact depth + tag bucket  — O(1) lookup, typically 0–2 expressions\n   *  2. Depth-only wildcard bucket — O(1) lookup, rare\n   *  3. Deep-wildcard list         — always checked, but usually small\n   *\n   * @param {import('./Matcher.js').default} matcher - Matcher instance (or readOnly view)\n   * @returns {boolean} true if any expression matches the current path\n   *\n   * @example\n   * if (stopNodes.matchesAny(matcher)) {\n   *   // handle stop node\n   * }\n   */\n  matchesAny(matcher) {\n    return this.findMatch(matcher) !== null;\n  }\n  /**\n * Find and return the first Expression that matches the matcher's current path.\n *\n * Uses the same evaluation order as matchesAny (cheapest → most expensive):\n *  1. Exact depth + tag bucket\n *  2. Depth-only wildcard bucket\n *  3. Deep-wildcard list\n *\n * @param {import('./Matcher.js').default} matcher - Matcher instance (or readOnly view)\n * @returns {import('./Expression.js').default | null} the first matching Expression, or null\n *\n * @example\n * const expr = stopNodes.findMatch(matcher);\n * if (expr) {\n *   // access expr.config, expr.pattern, etc.\n * }\n */\n  findMatch(matcher) {\n    const depth = matcher.getDepth();\n    const tag = matcher.getCurrentTag();\n\n    // 1. Tightest bucket — most expressions live here\n    const exactKey = `${depth}:${tag}`;\n    const exactBucket = this._byDepthAndTag.get(exactKey);\n    if (exactBucket) {\n      for (let i = 0; i < exactBucket.length; i++) {\n        if (matcher.matches(exactBucket[i])) return exactBucket[i];\n      }\n    }\n\n    // 2. Depth-matched wildcard-tag expressions\n    const wildcardBucket = this._wildcardByDepth.get(depth);\n    if (wildcardBucket) {\n      for (let i = 0; i < wildcardBucket.length; i++) {\n        if (matcher.matches(wildcardBucket[i])) return wildcardBucket[i];\n      }\n    }\n\n    // 3. Deep wildcards — cannot be pre-filtered by depth or tag\n    for (let i = 0; i < this._deepWildcards.length; i++) {\n      if (matcher.matches(this._deepWildcards[i])) return this._deepWildcards[i];\n    }\n\n    return null;\n  }\n}\n","/**\n * fast-xml-tagger - XML/JSON path matching library\n * \n * Provides efficient path tracking and pattern matching for XML/JSON parsers.\n * \n * @example\n * import { Expression, Matcher } from 'fast-xml-tagger';\n * \n * // Create expression (parse once)\n * const expr = new Expression(\"root.users.user[id]\");\n * \n * // Create matcher (track path)\n * const matcher = new Matcher();\n * matcher.push(\"root\", [], {}, 0);\n * matcher.push(\"users\", [], {}, 0);\n * matcher.push(\"user\", [\"id\", \"type\"], { id: \"123\", type: \"admin\" }, 0);\n * \n * // Match\n * if (matcher.matches(expr)) {\n *   console.log(\"Match found!\");\n * }\n */\n\nimport Expression from './Expression.js';\nimport Matcher from './Matcher.js';\nimport ExpressionSet from './ExpressionSet.js';\n\nexport { Expression, Matcher, ExpressionSet };\nexport default { Expression, Matcher, ExpressionSet };\n"],"names":["root","factory","exports","module","define","amd","this","__webpack_require__","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","Expression","constructor","pattern","options","data","separator","segments","_parse","_hasDeepWildcard","some","seg","type","_hasAttributeCondition","undefined","attrName","_hasPositionSelector","position","i","currentPart","length","trim","push","_parseSegment","part","segment","bracketContent","withoutBrackets","bracketMatch","match","content","slice","namespace","tag","tagAndPosition","includes","nsIndex","indexOf","substring","Error","positionMatch","colonIndex","lastIndexOf","tagPart","posPart","test","eqIndex","attrValue","nthMatch","positionValue","parseInt","hasDeepWildcard","hasAttributeCondition","hasPositionSelector","toString","MatcherView","matcher","_matcher","getCurrentTag","path","getCurrentNamespace","getAttrValue","values","hasAttr","current","getPosition","getCounter","counter","getIndex","getDepth","includeNamespace","toArray","map","n","matches","expression","matchesAny","exprSet","Matcher","siblingStacks","_pathStringCache","_view","tagName","attrValues","currentLevel","Map","siblings","siblingKey","count","set","node","pop","updateCurrent","sep","result","join","reset","_matchWithDeepWildcard","_matchSimple","_matchSegment","pathIdx","segIdx","nextSeg","found","isCurrentNode","String","snapshot","restore","readOnly","ExpressionSet","_byDepthAndTag","_wildcardByDepth","_deepWildcards","_patterns","Set","_sealed","add","TypeError","has","depth","lastSeg","addAll","expressions","expr","size","seal","isSealed","findMatch","exactKey","exactBucket","wildcardBucket"],"sourceRoot":""}