{"version":3,"file":"get-context-item-index.cjs","sources":["../../../../src/core/utils/get-context-item-index/get-context-item-index.ts"],"sourcesContent":["import { findElementAncestor } from '../find-element-ancestor/find-element-ancestor';\n\nexport function getContextItemIndex(\n  elementSelector: string,\n  parentSelector: string,\n  node: HTMLElement\n) {\n  if (!node) {\n    return null;\n  }\n\n  return Array.from(\n    findElementAncestor(node, parentSelector)?.querySelectorAll(elementSelector) || []\n  ).findIndex((element) => element === node);\n}\n"],"names":["findElementAncestor"],"mappings":";;;;AAEgB,SAAA,mBAAA,CACd,eACA,EAAA,cAAA,EACA,IACA,EAAA;AACA,EAAA,IAAI,CAAC,IAAM,EAAA;AACT,IAAO,OAAA,IAAA;AAAA;AAGT,EAAA,OAAO,KAAM,CAAA,IAAA;AAAA,IACXA,wCAAoB,IAAM,EAAA,cAAc,GAAG,gBAAiB,CAAA,eAAe,KAAK;AAAC,GACjF,CAAA,SAAA,CAAU,CAAC,OAAA,KAAY,YAAY,IAAI,CAAA;AAC3C;;;;"}