{"version":3,"sources":["../src/components/TagPicker/TagPickerOption/useTagPickerOption.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { slot } from '@fluentui/react-utilities';\nimport { optionClassNames } from '@fluentui/react-combobox';\n\nimport { useOption } from '../../Dropdown/Option';\nimport type { TagPickerOptionProps, TagPickerOptionState } from './TagPickerOption.types';\n\n/**\n * Returns the state for a headless TagPickerOption.\n *\n */\nexport const useTagPickerOption = (props: TagPickerOptionProps, ref: React.Ref<HTMLElement>): TagPickerOptionState => {\n  const optionState = useOption(props, ref);\n\n  /* eslint-disable react-hooks/immutability -- decorate the base option state */\n  // The shared TagPicker base currently discovers active-descendant options by this class.\n  optionState.root.className = optionState.root.className\n    ? `${optionClassNames.root} ${optionState.root.className}`\n    : optionClassNames.root;\n  /* eslint-enable react-hooks/immutability */\n\n  return {\n    ...optionState,\n    components: {\n      // eslint-disable-next-line @typescript-eslint/no-deprecated\n      ...optionState.components,\n      media: 'div',\n      secondaryContent: 'span',\n    },\n    media: slot.optional(props.media, { elementType: 'div' }),\n    secondaryContent: slot.optional(props.secondaryContent, { elementType: 'span' }),\n    // Force role=\"option\": useOption / useOptionBase_unstable may emit role=\"menuitemcheckbox\" in\n    // multiselect mode, but TagPickerList is a listbox whose items must be role=\"option\".\n    root: slot.always(\n      { ...optionState.root, role: 'option', 'aria-checked': props['aria-checked'] },\n      { elementType: 'div' },\n    ),\n  };\n};\n"],"names":["useTagPickerOption","props","ref","optionState","useOption","root","className","optionClassNames","components","media","secondaryContent","slot","optional","elementType","always","role"],"mappings":"AAAA;;;;;+BAaaA;;;eAAAA;;;gCAVQ;+BACY;wBAEP;AAOnB,MAAMA,qBAAqB,CAACC,OAA6BC;IAC9D,MAAMC,cAAcC,IAAAA,iBAAS,EAACH,OAAOC;IAErC,6EAA6E,GAC7E,yFAAyF;IACzFC,YAAYE,IAAI,CAACC,SAAS,GAAGH,YAAYE,IAAI,CAACC,SAAS,GACnD,GAAGC,+BAAgB,CAACF,IAAI,CAAC,CAAC,EAAEF,YAAYE,IAAI,CAACC,SAAS,EAAE,GACxDC,+BAAgB,CAACF,IAAI;IACzB,0CAA0C,GAE1C,OAAO;QACL,GAAGF,WAAW;QACdK,YAAY;YACV,4DAA4D;YAC5D,GAAGL,YAAYK,UAAU;YACzBC,OAAO;YACPC,kBAAkB;QACpB;QACAD,OAAOE,oBAAI,CAACC,QAAQ,CAACX,MAAMQ,KAAK,EAAE;YAAEI,aAAa;QAAM;QACvDH,kBAAkBC,oBAAI,CAACC,QAAQ,CAACX,MAAMS,gBAAgB,EAAE;YAAEG,aAAa;QAAO;QAC9E,8FAA8F;QAC9F,sFAAsF;QACtFR,MAAMM,oBAAI,CAACG,MAAM,CACf;YAAE,GAAGX,YAAYE,IAAI;YAAEU,MAAM;YAAU,gBAAgBd,KAAK,CAAC,eAAe;QAAC,GAC7E;YAAEY,aAAa;QAAM;IAEzB;AACF"}