{"version":3,"sources":["../src/components/TagPicker/useTagPicker.ts"],"sourcesContent":["'use client';\n\nimport { useMergedRefs } from '@fluentui/react-utilities';\nimport { useTagPickerBase_unstable } from '@fluentui/react-tag-picker';\n\nimport { resolvePositioningShorthand, usePositioning } from '../../positioning';\nimport type { TagPickerProps, TagPickerState } from './TagPicker.types';\n\n/**\n * Returns the state for a headless TagPicker.\n */\nexport const useTagPicker = (props: TagPickerProps): TagPickerState => {\n  const { positioning, ...baseProps } = props;\n  const { targetRef, containerRef } = usePositioning(resolvePositioningShorthand(positioning));\n\n  const baseState = useTagPickerBase_unstable(baseProps);\n  const popoverRef = useMergedRefs<HTMLDivElement>(baseState.popoverRef, containerRef);\n\n  return {\n    ...baseState,\n    // Required by the shared styled TagPicker state/context contract. Headless base hooks do not\n    // consume these presentation values; inline is behavioral and keeps the popover in DOM order.\n    appearance: 'outline',\n    inline: true,\n    size: 'medium',\n    targetRef: targetRef as unknown as TagPickerState['targetRef'],\n    popoverRef,\n  };\n};\n"],"names":["useTagPicker","props","positioning","baseProps","targetRef","containerRef","usePositioning","resolvePositioningShorthand","baseState","useTagPickerBase_unstable","popoverRef","useMergedRefs","appearance","inline","size"],"mappings":"AAAA;;;;;+BAWaA;;;eAAAA;;;gCATiB;gCACY;6BAEkB;AAMrD,MAAMA,eAAe,CAACC;IAC3B,MAAM,EAAEC,WAAW,EAAE,GAAGC,WAAW,GAAGF;IACtC,MAAM,EAAEG,SAAS,EAAEC,YAAY,EAAE,GAAGC,IAAAA,2BAAc,EAACC,IAAAA,wCAA2B,EAACL;IAE/E,MAAMM,YAAYC,IAAAA,yCAAyB,EAACN;IAC5C,MAAMO,aAAaC,IAAAA,6BAAa,EAAiBH,UAAUE,UAAU,EAAEL;IAEvE,OAAO;QACL,GAAGG,SAAS;QACZ,6FAA6F;QAC7F,8FAA8F;QAC9FI,YAAY;QACZC,QAAQ;QACRC,MAAM;QACNV,WAAWA;QACXM;IACF;AACF"}