{"version":3,"file":"find-mention-occurrences.cjs","names":["walkMentions"],"sources":["../../../../src/components/Mentions/utils/find-mention-occurrences.ts"],"sourcesContent":["/*\n * Derived from react-mentions 4.4.10 (https://github.com/signavio/react-mentions)\n * — BSD-3-Clause, Copyright (c) 2018 Signavio GmbH. See ../LICENSE for the full license text.\n *\n * Local changes compared to react-mentions 4.4.10:\n * - Renamed from getMentions to findMentionOccurrences (the public getMentions wraps it)\n * - Derived from the spans of walkMentions instead of an iterateMentionsMarkup callback\n * - Each occurrence also carries the trigger of the source that produced it\n * - TypeScript types adjusted for the Mantine build, formatted with oxfmt\n */\n\nimport type { MentionOccurrence } from '../Mentions.types';\nimport type { MentionConfig } from './types';\nimport { walkMentions, type MentionSpan } from './walk-mentions';\n\nexport function toMentionOccurrence(span: MentionSpan): MentionOccurrence {\n  return {\n    id: span.id,\n    display: span.display,\n    index: span.markupStart,\n    plainTextIndex: span.plainStart,\n    trigger: span.trigger,\n  };\n}\n\nexport function findMentionOccurrences(\n  value: string,\n  configs: MentionConfig[]\n): MentionOccurrence[] {\n  return walkMentions(value, configs).spans.map(toMentionOccurrence);\n}\n"],"mappings":";;;AAeA,SAAgB,oBAAoB,MAAsC;CACxE,OAAO;EACL,IAAI,KAAK;EACT,SAAS,KAAK;EACd,OAAO,KAAK;EACZ,gBAAgB,KAAK;EACrB,SAAS,KAAK;CAChB;AACF;AAEA,SAAgB,uBACd,OACA,SACqB;CACrB,OAAOA,sBAAAA,aAAa,OAAO,OAAO,CAAC,CAAC,MAAM,IAAI,mBAAmB;AACnE"}