"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const findElementAncestor = require("../find-element-ancestor/find-element-ancestor.cjs");
function getContextItemIndex(elementSelector, parentSelector, node) {
  var _a;
  if (!node) {
    return null;
  }
  return Array.from(
    ((_a = findElementAncestor.findElementAncestor(node, parentSelector)) == null ? void 0 : _a.querySelectorAll(elementSelector)) || []
  ).findIndex((element) => element === node);
}
exports.getContextItemIndex = getContextItemIndex;
