@oracle/oraclejet-preact 21.0.0 → 21.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (898) hide show
  1. package/amd/{BaseDiagram-295ed9cc.js → BaseDiagram-7845a7ae.js} +2 -2
  2. package/amd/{BaseDiagram-295ed9cc.js.map → BaseDiagram-7845a7ae.js.map} +1 -1
  3. package/amd/{BaseNavigationListItem-299cbfab.js → BaseNavigationListItem-0efcad58.js} +2 -2
  4. package/amd/{BaseNavigationListItem-299cbfab.js.map → BaseNavigationListItem-0efcad58.js.map} +1 -1
  5. package/amd/{CollapsibleNavigationListExternalLinkItem-fcf1805d.js → CollapsibleNavigationListExternalLinkItem-06a92293.js} +2 -2
  6. package/amd/{CollapsibleNavigationListExternalLinkItem-fcf1805d.js.map → CollapsibleNavigationListExternalLinkItem-06a92293.js.map} +1 -1
  7. package/amd/{ColorInputText-55b31f03.js → ColorInputText-3ac0f956.js} +2 -2
  8. package/amd/{ColorInputText-55b31f03.js.map → ColorInputText-3ac0f956.js.map} +1 -1
  9. package/amd/ColorPickerVariants.styles.css +1 -1
  10. package/amd/ColorPickerVariants.styles2.css +1 -1
  11. package/amd/ColorSwatchVariants.styles.css +1 -1
  12. package/amd/ColorSwatchVariants.styles2.css +1 -1
  13. package/amd/ContainerDiagram-5e392270.js +2 -0
  14. package/amd/{ContainerDiagram-521f402a.js.map → ContainerDiagram-5e392270.js.map} +1 -1
  15. package/amd/ConveyorBeltVariants.styles.css +6 -6
  16. package/amd/ConveyorBeltVariants.styles2.css +6 -6
  17. package/amd/{Diagram-b73d20a3.js → Diagram-3ef5b038.js} +2 -2
  18. package/amd/{Diagram-b73d20a3.js.map → Diagram-3ef5b038.js.map} +1 -1
  19. package/amd/DiagramStyles.styles2.css +16 -10
  20. package/amd/DiagramStyles.styles3.css +10 -16
  21. package/amd/DrawerPopupVariants.styles.css +5 -5
  22. package/amd/DrawerPopupVariants.styles2.css +5 -5
  23. package/amd/Expander-4b1f2445.js +2 -0
  24. package/amd/{Expander-150fa95e.js.map → Expander-4b1f2445.js.map} +1 -1
  25. package/amd/FormLayoutVariants.styles.css +14 -14
  26. package/amd/FormLayoutVariants.styles2.css +14 -14
  27. package/amd/IndentedCellLayout-dc0896ab.js +1 -1
  28. package/amd/IndentedCellLayout-dc0896ab.js.map +1 -1
  29. package/amd/{InputColor-019b9397.js → InputColor-96a82077.js} +2 -2
  30. package/amd/{InputColor-019b9397.js.map → InputColor-96a82077.js.map} +1 -1
  31. package/amd/InputDatePicker-37824ba4.js +2 -0
  32. package/amd/{InputDatePicker-613800d1.js.map → InputDatePicker-37824ba4.js.map} +1 -1
  33. package/amd/ListStyles.styles.css +105 -7
  34. package/amd/ListStyles.styles2.css +7 -105
  35. package/amd/MeterCircleVariants.styles.css +8 -8
  36. package/amd/MeterCircleVariants.styles2.css +8 -8
  37. package/amd/NavigationListExternalLinkItem-382cd5a2.js +2 -0
  38. package/amd/{NavigationListExternalLinkItem-3d98a9e8.js.map → NavigationListExternalLinkItem-382cd5a2.js.map} +1 -1
  39. package/amd/NavigationListLinkItem-8ed2c18d.js +2 -0
  40. package/amd/{NavigationListLinkItem-c4b2b73c.js.map → NavigationListLinkItem-8ed2c18d.js.map} +1 -1
  41. package/amd/OverflowTabBar-9e7277f4.js +2 -0
  42. package/amd/OverflowTabBar-9e7277f4.js.map +1 -0
  43. package/amd/OverflowTabBarItem-7d80beed.js +2 -0
  44. package/amd/{OverflowTabBarItem-11f199ee.js.map → OverflowTabBarItem-7d80beed.js.map} +1 -1
  45. package/amd/PRIVATE_BaseDiagram.js +1 -1
  46. package/amd/PRIVATE_List/themes/ListStyles.css.js +1 -1
  47. package/amd/PRIVATE_List.js +1 -1
  48. package/amd/PRIVATE_SelectCommon.js +1 -1
  49. package/amd/PRIVATE_Table.js +1 -1
  50. package/amd/PRIVATE_TableList/themes/ListStyles.css.js +1 -1
  51. package/amd/PRIVATE_TableList/themes/redwood/ListTheme.js +1 -1
  52. package/amd/PRIVATE_TableList/themes/redwood/ListTheme.js.map +1 -1
  53. package/amd/PRIVATE_TableList/themes/redwood/ListVariants.css.js +1 -1
  54. package/amd/PRIVATE_TableList/themes/stable/ListTheme.js +1 -1
  55. package/amd/PRIVATE_TableList/themes/stable/ListTheme.js.map +1 -1
  56. package/amd/PRIVATE_TableList/themes/stable/ListVariants.css.js +1 -1
  57. package/amd/PRIVATE_TableList.js +1 -1
  58. package/amd/ProgressBarVariants.styles.css +1 -1
  59. package/amd/ProgressBarVariants.styles2.css +1 -1
  60. package/amd/ProgressCircleVariants.styles.css +4 -4
  61. package/amd/ProgressCircleVariants.styles2.css +4 -4
  62. package/amd/RadioIconVariants.styles.css +3 -3
  63. package/amd/RadioIconVariants.styles2.css +3 -3
  64. package/amd/{ReorderableTabBar-35cce8ac.js → ReorderableTabBar-7fb56c0b.js} +2 -2
  65. package/amd/{ReorderableTabBar-35cce8ac.js.map → ReorderableTabBar-7fb56c0b.js.map} +1 -1
  66. package/amd/SortControl-eb114fee.js +2 -0
  67. package/amd/{SortControl-115bc431.js.map → SortControl-eb114fee.js.map} +1 -1
  68. package/amd/TabBar-34e0073f.js +2 -0
  69. package/amd/TabBar-34e0073f.js.map +1 -0
  70. package/amd/{TabBarItem-191d0223.js → TabBarItem-60866864.js} +2 -2
  71. package/amd/{TabBarItem-191d0223.js.map → TabBarItem-60866864.js.map} +1 -1
  72. package/amd/TabBarItemVariants.styles.css +3 -3
  73. package/amd/TabBarItemVariants.styles2.css +3 -3
  74. package/amd/{TabBarLinkItem-5f376f4e.js → TabBarLinkItem-7b5b5b73.js} +2 -2
  75. package/amd/{TabBarLinkItem-5f376f4e.js.map → TabBarLinkItem-7b5b5b73.js.map} +1 -1
  76. package/amd/TabBarMixed-b61a657d.js +2 -0
  77. package/amd/{TabBarMixed-e16ca418.js.map → TabBarMixed-b61a657d.js.map} +1 -1
  78. package/amd/{Table-76c8555b.js → Table-caf0eeb9.js} +2 -2
  79. package/amd/{Table-76c8555b.js.map → Table-caf0eeb9.js.map} +1 -1
  80. package/amd/{TableDisplay-938d743b.js → TableDisplay-d2efde54.js} +2 -2
  81. package/amd/{TableDisplay-938d743b.js.map → TableDisplay-d2efde54.js.map} +1 -1
  82. package/amd/{TableView-490cc209.js → TableView-94381f75.js} +2 -2
  83. package/amd/{TableView-490cc209.js.map → TableView-94381f75.js.map} +1 -1
  84. package/amd/Theme-redwood/theme.css +301 -306
  85. package/amd/Theme-stable/theme.css +542 -537
  86. package/amd/TrainVariants.styles.css +6 -6
  87. package/amd/TrainVariants.styles2.css +6 -6
  88. package/amd/{TreeTableView-1b66b880.js → TreeTableView-ef0d26bd.js} +2 -2
  89. package/amd/{TreeTableView-1b66b880.js.map → TreeTableView-ef0d26bd.js.map} +1 -1
  90. package/amd/UNSAFE_CollapsibleNavigationList.js +1 -1
  91. package/amd/UNSAFE_ColorInputText.js +1 -1
  92. package/amd/UNSAFE_ColorPalette.js +1 -1
  93. package/amd/UNSAFE_ColorPicker/themes/redwood/ColorPickerTheme.js +1 -1
  94. package/amd/UNSAFE_ColorPicker/themes/redwood/ColorPickerTheme.js.map +1 -1
  95. package/amd/UNSAFE_ColorPicker/themes/redwood/ColorPickerVariants.css.js +1 -1
  96. package/amd/UNSAFE_ColorPicker/themes/stable/ColorPickerTheme.js +1 -1
  97. package/amd/UNSAFE_ColorPicker/themes/stable/ColorPickerTheme.js.map +1 -1
  98. package/amd/UNSAFE_ColorPicker/themes/stable/ColorPickerVariants.css.js +1 -1
  99. package/amd/UNSAFE_ColorPicker.js +1 -1
  100. package/amd/UNSAFE_ColorSwatch/themes/redwood/ColorSwatchTheme.js +1 -1
  101. package/amd/UNSAFE_ColorSwatch/themes/redwood/ColorSwatchTheme.js.map +1 -1
  102. package/amd/UNSAFE_ColorSwatch/themes/redwood/ColorSwatchVariants.css.js +1 -1
  103. package/amd/UNSAFE_ColorSwatch/themes/stable/ColorSwatchTheme.js +1 -1
  104. package/amd/UNSAFE_ColorSwatch/themes/stable/ColorSwatchTheme.js.map +1 -1
  105. package/amd/UNSAFE_ColorSwatch/themes/stable/ColorSwatchVariants.css.js +1 -1
  106. package/amd/UNSAFE_ColorSwatch.js +1 -1
  107. package/amd/UNSAFE_ContainerDiagram/themes/DiagramStyles.css.js +1 -1
  108. package/amd/UNSAFE_ContainerDiagram.js +1 -1
  109. package/amd/UNSAFE_ConveyorBelt/themes/redwood/ConveyorBeltTheme.js +1 -1
  110. package/amd/UNSAFE_ConveyorBelt/themes/redwood/ConveyorBeltTheme.js.map +1 -1
  111. package/amd/UNSAFE_ConveyorBelt/themes/redwood/ConveyorBeltVariants.css.js +1 -1
  112. package/amd/UNSAFE_ConveyorBelt/themes/stable/ConveyorBeltTheme.js +1 -1
  113. package/amd/UNSAFE_ConveyorBelt/themes/stable/ConveyorBeltTheme.js.map +1 -1
  114. package/amd/UNSAFE_ConveyorBelt/themes/stable/ConveyorBeltVariants.css.js +1 -1
  115. package/amd/UNSAFE_ConveyorBelt.js +1 -1
  116. package/amd/UNSAFE_Diagram/themes/DiagramStyles.css.js +1 -1
  117. package/amd/UNSAFE_Diagram.js +1 -1
  118. package/amd/UNSAFE_DrawerPopup/themes/redwood/DrawerPopupTheme.js +1 -1
  119. package/amd/UNSAFE_DrawerPopup/themes/redwood/DrawerPopupTheme.js.map +1 -1
  120. package/amd/UNSAFE_DrawerPopup/themes/redwood/DrawerPopupVariants.css.js +1 -1
  121. package/amd/UNSAFE_DrawerPopup/themes/stable/DrawerPopupTheme.js +1 -1
  122. package/amd/UNSAFE_DrawerPopup/themes/stable/DrawerPopupTheme.js.map +1 -1
  123. package/amd/UNSAFE_DrawerPopup/themes/stable/DrawerPopupVariants.css.js +1 -1
  124. package/amd/UNSAFE_DrawerPopup.js +1 -1
  125. package/amd/UNSAFE_Expander.js +1 -1
  126. package/amd/UNSAFE_FormLayout/themes/redwood/FormLayoutTheme.js +1 -1
  127. package/amd/UNSAFE_FormLayout/themes/redwood/FormLayoutTheme.js.map +1 -1
  128. package/amd/UNSAFE_FormLayout/themes/redwood/FormLayoutVariants.css.js +1 -1
  129. package/amd/UNSAFE_FormLayout/themes/stable/FormLayoutTheme.js +1 -1
  130. package/amd/UNSAFE_FormLayout/themes/stable/FormLayoutTheme.js.map +1 -1
  131. package/amd/UNSAFE_FormLayout/themes/stable/FormLayoutVariants.css.js +1 -1
  132. package/amd/UNSAFE_FormLayout.js +1 -1
  133. package/amd/UNSAFE_HierarchicalList.js +1 -1
  134. package/amd/UNSAFE_IconProgressButton.js +1 -1
  135. package/amd/UNSAFE_IndentedCellLayout.js +1 -1
  136. package/amd/UNSAFE_InlineSelectSingle.js +1 -1
  137. package/amd/UNSAFE_InputColor.js +1 -1
  138. package/amd/UNSAFE_InputDatePicker.js +1 -1
  139. package/amd/UNSAFE_InputSearch.js +1 -1
  140. package/amd/UNSAFE_InputSearch.js.map +1 -1
  141. package/amd/UNSAFE_InputTimePicker.js +1 -1
  142. package/amd/UNSAFE_InputTimePicker.js.map +1 -1
  143. package/amd/UNSAFE_ListView.js +1 -1
  144. package/amd/UNSAFE_MeterCircle/themes/redwood/MeterCircleTheme.js +1 -1
  145. package/amd/UNSAFE_MeterCircle/themes/redwood/MeterCircleTheme.js.map +1 -1
  146. package/amd/UNSAFE_MeterCircle/themes/redwood/MeterCircleVariants.css.js +1 -1
  147. package/amd/UNSAFE_MeterCircle/themes/stable/MeterCircleTheme.js +1 -1
  148. package/amd/UNSAFE_MeterCircle/themes/stable/MeterCircleTheme.js.map +1 -1
  149. package/amd/UNSAFE_MeterCircle/themes/stable/MeterCircleVariants.css.js +1 -1
  150. package/amd/UNSAFE_MeterCircle.js +1 -1
  151. package/amd/UNSAFE_NavigationList.js +1 -1
  152. package/amd/UNSAFE_OverflowTabBar.js +1 -1
  153. package/amd/UNSAFE_ProgressBar/themes/redwood/ProgressBarTheme.js +1 -1
  154. package/amd/UNSAFE_ProgressBar/themes/redwood/ProgressBarTheme.js.map +1 -1
  155. package/amd/UNSAFE_ProgressBar/themes/redwood/ProgressBarVariants.css.js +1 -1
  156. package/amd/UNSAFE_ProgressBar/themes/stable/ProgressBarTheme.js +1 -1
  157. package/amd/UNSAFE_ProgressBar/themes/stable/ProgressBarTheme.js.map +1 -1
  158. package/amd/UNSAFE_ProgressBar/themes/stable/ProgressBarVariants.css.js +1 -1
  159. package/amd/UNSAFE_ProgressBar.js +1 -1
  160. package/amd/UNSAFE_ProgressButton.js +1 -1
  161. package/amd/UNSAFE_ProgressButtonLabelLayout.js +1 -1
  162. package/amd/UNSAFE_ProgressCircle/themes/redwood/ProgressCircleTheme.js +1 -1
  163. package/amd/UNSAFE_ProgressCircle/themes/redwood/ProgressCircleTheme.js.map +1 -1
  164. package/amd/UNSAFE_ProgressCircle/themes/redwood/ProgressCircleVariants.css.js +1 -1
  165. package/amd/UNSAFE_ProgressCircle/themes/stable/ProgressCircleTheme.js +1 -1
  166. package/amd/UNSAFE_ProgressCircle/themes/stable/ProgressCircleTheme.js.map +1 -1
  167. package/amd/UNSAFE_ProgressCircle/themes/stable/ProgressCircleVariants.css.js +1 -1
  168. package/amd/UNSAFE_ProgressCircle.js +1 -1
  169. package/amd/UNSAFE_RadioItem/themes/redwood/RadioIconTheme.js +1 -1
  170. package/amd/UNSAFE_RadioItem/themes/redwood/RadioIconTheme.js.map +1 -1
  171. package/amd/UNSAFE_RadioItem/themes/redwood/RadioIconVariants.css.js +1 -1
  172. package/amd/UNSAFE_RadioItem/themes/stable/RadioIconTheme.js +1 -1
  173. package/amd/UNSAFE_RadioItem/themes/stable/RadioIconTheme.js.map +1 -1
  174. package/amd/UNSAFE_RadioItem/themes/stable/RadioIconVariants.css.js +1 -1
  175. package/amd/UNSAFE_RadioItem.js +1 -1
  176. package/amd/UNSAFE_Refresher.js +1 -1
  177. package/amd/UNSAFE_ReorderableTabBar.js +1 -1
  178. package/amd/UNSAFE_RichSelectionItem.js +1 -1
  179. package/amd/UNSAFE_RichSelectionItem.js.map +1 -1
  180. package/amd/UNSAFE_SelectMultiple.js +1 -1
  181. package/amd/UNSAFE_SelectSingle.js +1 -1
  182. package/amd/UNSAFE_SortControl.js +1 -1
  183. package/amd/UNSAFE_TabBar.js +1 -1
  184. package/amd/UNSAFE_TabBarCommon/themes/redwood/TabBarItemTheme.js +1 -1
  185. package/amd/UNSAFE_TabBarCommon/themes/redwood/TabBarItemTheme.js.map +1 -1
  186. package/amd/UNSAFE_TabBarCommon/themes/redwood/TabBarItemVariants.css.js +1 -1
  187. package/amd/UNSAFE_TabBarCommon/themes/stable/TabBarItemTheme.js +1 -1
  188. package/amd/UNSAFE_TabBarCommon/themes/stable/TabBarItemTheme.js.map +1 -1
  189. package/amd/UNSAFE_TabBarCommon/themes/stable/TabBarItemVariants.css.js +1 -1
  190. package/amd/UNSAFE_TabBarCommon.js +1 -1
  191. package/amd/UNSAFE_TabBarMixed.js +1 -1
  192. package/amd/UNSAFE_TableDisplay.js +1 -1
  193. package/amd/UNSAFE_TableView.js +1 -1
  194. package/amd/UNSAFE_TimePicker.js +1 -1
  195. package/amd/UNSAFE_Train/themes/redwood/TrainTheme.js +1 -1
  196. package/amd/UNSAFE_Train/themes/redwood/TrainTheme.js.map +1 -1
  197. package/amd/UNSAFE_Train/themes/redwood/TrainVariants.css.js +1 -1
  198. package/amd/UNSAFE_Train/themes/stable/TrainTheme.js +1 -1
  199. package/amd/UNSAFE_Train/themes/stable/TrainTheme.js.map +1 -1
  200. package/amd/UNSAFE_Train/themes/stable/TrainVariants.css.js +1 -1
  201. package/amd/UNSAFE_Train.js +1 -1
  202. package/amd/UNSAFE_TreeTableView.js +1 -1
  203. package/amd/UNSAFE_TreeView.js +1 -1
  204. package/amd/UNSAFE_VirtualizedListView.js +1 -1
  205. package/amd/hooks/PRIVATE_useDetectHorizontalOverflow.js +1 -1
  206. package/amd/hooks/PRIVATE_useTabBar.js +1 -1
  207. package/amd/useDetectHorizontalOverflow-88d9b328.js +2 -0
  208. package/amd/useDetectHorizontalOverflow-88d9b328.js.map +1 -0
  209. package/amd/useTabBar-edf8f8a1.js +2 -0
  210. package/amd/useTabBar-edf8f8a1.js.map +1 -0
  211. package/cjs/AvatarVariants.styles.css +25 -25
  212. package/cjs/AvatarVariants.styles2.css +25 -25
  213. package/cjs/{BaseCardView-e38589c6.js → BaseCardView-f3b3402b.js} +4 -1
  214. package/cjs/{BaseCardView-e38589c6.js.map → BaseCardView-f3b3402b.js.map} +1 -1
  215. package/cjs/ButtonLabelLayoutVariants.styles.css +8 -8
  216. package/cjs/ButtonLabelLayoutVariants.styles2.css +8 -8
  217. package/cjs/CheckboxIconVariants.styles.css +7 -7
  218. package/cjs/CheckboxIconVariants.styles2.css +7 -7
  219. package/cjs/ColorPickerVariants.styles.css +1 -1
  220. package/cjs/ColorPickerVariants.styles2.css +1 -1
  221. package/cjs/ConveyorBeltVariants.styles.css +6 -6
  222. package/cjs/ConveyorBeltVariants.styles2.css +6 -6
  223. package/cjs/DiagramStyles.styles.css +12 -81
  224. package/cjs/DiagramStyles.styles2.css +81 -12
  225. package/cjs/InputSearchVariants.styles.css +3 -3
  226. package/cjs/InputSearchVariants.styles2.css +3 -3
  227. package/cjs/{List-eea800fd.js → List-436100e1.js} +3 -1
  228. package/cjs/{List-eea800fd.js.map → List-436100e1.js.map} +1 -1
  229. package/cjs/MeterBarVariants.styles.css +4 -4
  230. package/cjs/MeterBarVariants.styles2.css +4 -4
  231. package/cjs/NavigationListItemVariants.styles.css +5 -5
  232. package/cjs/NavigationListItemVariants.styles2.css +5 -5
  233. package/cjs/PRIVATE_BaseCardView.js +1 -1
  234. package/cjs/PRIVATE_SelectCommon.js +2 -2
  235. package/cjs/PRIVATE_TableList.js +1 -1
  236. package/cjs/ProgressBarVariants.styles.css +1 -1
  237. package/cjs/ProgressBarVariants.styles2.css +1 -1
  238. package/cjs/ProgressCircleVariants.styles.css +4 -4
  239. package/cjs/ProgressCircleVariants.styles2.css +4 -4
  240. package/cjs/RadioIconVariants.styles.css +3 -3
  241. package/cjs/RadioIconVariants.styles2.css +3 -3
  242. package/cjs/{TabBar-1cd4ac17.js → TabBar-ba4bcd32.js} +9 -5
  243. package/cjs/TabBar-ba4bcd32.js.map +1 -0
  244. package/cjs/TabBarItemVariants.styles.css +3 -3
  245. package/cjs/TabBarItemVariants.styles2.css +3 -3
  246. package/cjs/Theme-redwood/theme.css +413 -413
  247. package/cjs/Theme-stable/theme.css +559 -559
  248. package/cjs/{TimePicker-25997417.js → TimePicker-fe817eb1.js} +2 -2
  249. package/cjs/{TimePicker-25997417.js.map → TimePicker-fe817eb1.js.map} +1 -1
  250. package/cjs/UNSAFE_CardFlexView.js +1 -1
  251. package/cjs/UNSAFE_CardGridView.js +1 -1
  252. package/cjs/UNSAFE_ColorInputText.js +82 -82
  253. package/cjs/UNSAFE_HierarchicalList.js +1 -1
  254. package/cjs/UNSAFE_InlineSelectSingle.js +3 -3
  255. package/cjs/UNSAFE_InputColor.js +82 -82
  256. package/cjs/UNSAFE_InputSearch.js +1 -1
  257. package/cjs/UNSAFE_InputTimePicker.js +2 -2
  258. package/cjs/UNSAFE_ListView.js +1 -1
  259. package/cjs/UNSAFE_OverflowTabBar.js +9 -5
  260. package/cjs/UNSAFE_OverflowTabBar.js.map +1 -1
  261. package/cjs/UNSAFE_ReorderableTabBar.js +13 -13
  262. package/cjs/UNSAFE_RichSelectionItem.js +1 -1
  263. package/cjs/UNSAFE_SelectMultiple.js +2 -2
  264. package/cjs/UNSAFE_SelectSingle.js +3 -3
  265. package/cjs/UNSAFE_TabBar.js +3 -3
  266. package/cjs/UNSAFE_TabBarMixed.js +26 -26
  267. package/cjs/UNSAFE_TabBarMixed.js.map +1 -1
  268. package/cjs/UNSAFE_TextArea.js +174 -72
  269. package/cjs/UNSAFE_TextArea.js.map +1 -1
  270. package/cjs/UNSAFE_TextAreaAutosize.js +3 -3
  271. package/cjs/UNSAFE_TextAreaAutosize.js.map +1 -1
  272. package/cjs/UNSAFE_TimePicker.js +2 -2
  273. package/cjs/UNSAFE_TreeView.js +1 -1
  274. package/cjs/dropdownStyles.styles.css +104 -6
  275. package/cjs/dropdownStyles.styles2.css +6 -104
  276. package/cjs/hooks/PRIVATE_useDetectHorizontalOverflow.js +1 -1
  277. package/cjs/hooks/PRIVATE_useTabBar.js +1 -1
  278. package/cjs/{useDetectHorizontalOverflow-622817d4.js → useDetectHorizontalOverflow-15084cbf.js} +30 -58
  279. package/cjs/useDetectHorizontalOverflow-15084cbf.js.map +1 -0
  280. package/cjs/{useDisplayValue-ce2d071e.js → useDisplayValue-777c9be5.js} +2 -2
  281. package/cjs/{useDisplayValue-ce2d071e.js.map → useDisplayValue-777c9be5.js.map} +1 -1
  282. package/cjs/{useSelectCommon-544c22ee.js → useSelectCommon-bb44fdb6.js} +2 -2
  283. package/cjs/{useSelectCommon-544c22ee.js.map → useSelectCommon-bb44fdb6.js.map} +1 -1
  284. package/cjs/{useTabBar-ec20851a.js → useTabBar-1cfaf3e6.js} +2 -5
  285. package/cjs/useTabBar-1cfaf3e6.js.map +1 -0
  286. package/cjs/useTextAreaAltEnter-27263abe.js +68 -0
  287. package/cjs/useTextAreaAltEnter-27263abe.js.map +1 -0
  288. package/es/BaseBarChart-26b0e87c.js +3 -3
  289. package/es/BaseBarGroup-ff0495d8.js +1 -1
  290. package/es/{BaseButton-77bb9d91.js → BaseButton-f3a607e1.js} +2 -2
  291. package/es/{BaseButton-77bb9d91.js.map → BaseButton-f3a607e1.js.map} +1 -1
  292. package/es/BaseCardView-21ee7272.js +6 -6
  293. package/es/BaseDiagram-c48f2fc4.js +7 -7
  294. package/es/BaseNavigationListItem-973e1502.js +5 -5
  295. package/es/BaseRichSelection-b0ee75b8.js +9 -9
  296. package/es/BaseSelector-33194eea.js +1 -1
  297. package/es/BaseSwatchView-028f6717.js +2 -2
  298. package/es/{Button-64b2d5c7.js → Button-166a6aa3.js} +2 -2
  299. package/es/{Button-64b2d5c7.js.map → Button-166a6aa3.js.map} +1 -1
  300. package/es/ButtonSet-6cba414c.js +2 -2
  301. package/es/ButtonSetButton-125e316b.js +1 -1
  302. package/es/ButtonSetIconButton-8b969ad2.js +4 -4
  303. package/es/{Center-e2a7c4c7.js → Center-0388bd0c.js} +2 -2
  304. package/es/{Center-e2a7c4c7.js.map → Center-0388bd0c.js.map} +1 -1
  305. package/es/Chart-5d837bee.js +11 -11
  306. package/es/CheckboxControl-777f547a.js +6 -6
  307. package/es/CheckboxRadioField-b332f3ef.js +6 -6
  308. package/es/CheckboxRadioLabelValueLayout-05524fdf.js +1 -1
  309. package/es/CheckboxSetContext-1be56556.js +9 -0
  310. package/es/CheckboxSetContext-1be56556.js.map +1 -0
  311. package/es/Chip-a0b982b3.js +1 -1
  312. package/es/ClearIcon-f9ae8ca2.js +1 -1
  313. package/es/CollapseIcon-134ba4b8.js +1 -1
  314. package/es/Collapsible-6a2da8e9.js +2 -2
  315. package/es/ColorPalette-660c0665.js +4 -4
  316. package/es/{ColorPicker-d399a2dc.js → ColorPicker-98ba93ac.js} +3 -3
  317. package/es/{ColorPicker-d399a2dc.js.map → ColorPicker-98ba93ac.js.map} +1 -1
  318. package/es/ColorSwatch-ac777ee8.js +5 -5
  319. package/es/{CompactLabelAssistance-db24bf83.js → CompactLabelAssistance-44907e8b.js} +6 -6
  320. package/es/{CompactLabelAssistance-db24bf83.js.map → CompactLabelAssistance-44907e8b.js.map} +1 -1
  321. package/es/CompactUserAssistance-80d7ed0f.js +6 -6
  322. package/es/ComponentMessageContainer-f95c0576.js +4 -4
  323. package/es/{DatePicker-56fb4fcf.js → DatePicker-659b8c72.js} +8 -8
  324. package/es/{DatePicker-56fb4fcf.js.map → DatePicker-659b8c72.js.map} +1 -1
  325. package/es/DatePickerHeader-2fa4dff3.js +3 -3
  326. package/es/{Dialog-6fc62c1d.js → Dialog-c1502d03.js} +7 -7
  327. package/es/{Dialog-6fc62c1d.js.map → Dialog-c1502d03.js.map} +1 -1
  328. package/es/DirectionalCollapseArrowIcon-1f47a4a6.js +1 -1
  329. package/es/DirectionalExpandArrowIcon-ddaa04dc.js +1 -1
  330. package/es/{Dropdown-a3e401ae.js → Dropdown-e3f6f436.js} +6 -6
  331. package/es/{Dropdown-a3e401ae.js.map → Dropdown-e3f6f436.js.map} +1 -1
  332. package/es/{EmbeddedIconButton-3824dbe1.js → EmbeddedIconButton-8dca2a64.js} +2 -2
  333. package/es/{EmbeddedIconButton-3824dbe1.js.map → EmbeddedIconButton-8dca2a64.js.map} +1 -1
  334. package/es/{EmbeddedTextField-12d0e0a7.js → EmbeddedTextField-e4b319a0.js} +2 -2
  335. package/es/{EmbeddedTextField-12d0e0a7.js.map → EmbeddedTextField-e4b319a0.js.map} +1 -1
  336. package/es/{EnvironmentProvider-12bbb301.js → EnvironmentProvider-60423f29.js} +3 -3
  337. package/es/{EnvironmentProvider-12bbb301.js.map → EnvironmentProvider-60423f29.js.map} +1 -1
  338. package/es/Expander-19633442.js +2 -2
  339. package/es/FilmStrip-c0155ba5.js +1 -1
  340. package/es/{Flex-f0f1bb0d.js → Flex-f5fe143f.js} +2 -2
  341. package/es/{Flex-f0f1bb0d.js.map → Flex-f5fe143f.js.map} +1 -1
  342. package/es/{Floating-87cd2bbf.js → Floating-91e0f4c1.js} +4 -4
  343. package/es/{Floating-87cd2bbf.js.map → Floating-91e0f4c1.js.map} +1 -1
  344. package/es/FormLayoutVariants.styles.css +14 -14
  345. package/es/FormLayoutVariants.styles2.css +14 -14
  346. package/es/{Grid-45385814.js → Grid-67dc57cb.js} +2 -2
  347. package/es/{Grid-45385814.js.map → Grid-67dc57cb.js.map} +1 -1
  348. package/es/{HighlightText-39c46ea1.js → HighlightText-790fa99f.js} +2 -2
  349. package/es/{HighlightText-39c46ea1.js.map → HighlightText-790fa99f.js.map} +1 -1
  350. package/es/Icon-c0fda273.js +3 -3
  351. package/es/IconButton-94077753.js +4 -4
  352. package/es/IconSwitchButton-ced93277.js +4 -4
  353. package/es/IconToggleButton-8605dd2d.js +4 -4
  354. package/es/{IconUserAssistance-b03771f5.js → IconUserAssistance-16f55b57.js} +3 -3
  355. package/es/{IconUserAssistance-b03771f5.js.map → IconUserAssistance-16f55b57.js.map} +1 -1
  356. package/es/InlineHelp-6a8bd475.js +1 -1
  357. package/es/InlineUserAssistance-5d329af5.js +5 -5
  358. package/es/InputDateMask-9255cb45.js +6 -6
  359. package/es/InputSearchVariants.styles.css +3 -3
  360. package/es/InputSearchVariants.styles2.css +3 -3
  361. package/es/InputTimeMask-8f552768.js +6 -6
  362. package/es/Label-293073f5.js +8 -8
  363. package/es/LabelValueLayout-cb1f7711.js +1 -1
  364. package/es/{Layer-937ca8d8.js → Layer-542de448.js} +3 -3
  365. package/es/{Layer-937ca8d8.js.map → Layer-542de448.js.map} +1 -1
  366. package/es/{LayerHost-20500ac8.js → LayerHost-c4481db3.js} +2 -2
  367. package/es/{LayerHost-20500ac8.js.map → LayerHost-c4481db3.js.map} +1 -1
  368. package/es/{LayerManager-55001240.js → LayerManager-4b79a6a2.js} +2 -2
  369. package/es/{LayerManager-55001240.js.map → LayerManager-4b79a6a2.js.map} +1 -1
  370. package/es/Link-530a365a.js +1 -1
  371. package/es/List-5419d582.js +4 -4
  372. package/es/List-eab74f6d.js +8 -8
  373. package/es/{ListItemLayout-bcebf158.js → ListItemLayout-bc6fb853.js} +2 -2
  374. package/es/{ListItemLayout-bcebf158.js.map → ListItemLayout-bc6fb853.js.map} +1 -1
  375. package/es/ListStyles.styles.css +7 -105
  376. package/es/ListStyles.styles2.css +105 -7
  377. package/es/{LiveRegion-bd98c133.js → LiveRegion-74d90422.js} +2 -2
  378. package/es/{LiveRegion-bd98c133.js.map → LiveRegion-74d90422.js.map} +1 -1
  379. package/es/{MaxLengthLiveRegion-8551ea6a.js → MaxLengthLiveRegion-96ac8f1c.js} +3 -3
  380. package/es/{MaxLengthLiveRegion-8551ea6a.js.map → MaxLengthLiveRegion-96ac8f1c.js.map} +1 -1
  381. package/es/MenuItemVariants.styles.css +8 -8
  382. package/es/MenuItemVariants.styles2.css +8 -8
  383. package/es/Message-f941b6ee.js +2 -2
  384. package/es/{MessageLayer-0523ebac.js → MessageLayer-7aad786a.js} +6 -6
  385. package/es/{MessageLayer-0523ebac.js.map → MessageLayer-7aad786a.js.map} +1 -1
  386. package/es/MessagesManager-a42ca15e.js +3 -3
  387. package/es/MeterCircleVariants.styles.css +8 -8
  388. package/es/MeterCircleVariants.styles2.css +8 -8
  389. package/es/Modal-863676e2.js +3 -3
  390. package/es/{MonthView-31ced05b.js → MonthView-5ba0a449.js} +5 -5
  391. package/es/{MonthView-31ced05b.js.map → MonthView-5ba0a449.js.map} +1 -1
  392. package/es/NavigationList-0281b772.js +4 -4
  393. package/es/{NumberInputText-8c8fffa0.js → NumberInputText-e001d629.js} +7 -7
  394. package/es/{NumberInputText-8c8fffa0.js.map → NumberInputText-e001d629.js.map} +1 -1
  395. package/es/OverflowTabBarItem-75b943ec.js +8 -8
  396. package/es/PRIVATE_BaseBarChart.js +37 -37
  397. package/es/PRIVATE_BaseCardView.js +22 -22
  398. package/es/PRIVATE_BaseDiagram.js +30 -30
  399. package/es/PRIVATE_BaseSelector.js +17 -17
  400. package/es/PRIVATE_BaseSwatchView.js +18 -18
  401. package/es/PRIVATE_Chart.js +36 -36
  402. package/es/PRIVATE_CheckboxControl.js +25 -25
  403. package/es/PRIVATE_CheckboxRadioField.js +27 -27
  404. package/es/PRIVATE_ClearIcon.js +18 -18
  405. package/es/PRIVATE_DatePickerHeader.js +20 -20
  406. package/es/PRIVATE_DatePickerLayout.js +4 -4
  407. package/es/PRIVATE_EmbeddedIconButton.js +6 -6
  408. package/es/PRIVATE_EmbeddedTextField.js +18 -18
  409. package/es/PRIVATE_FilmStrip.js +17 -17
  410. package/es/PRIVATE_FormControls.js +21 -21
  411. package/es/PRIVATE_IconSwitchButton.js +17 -17
  412. package/es/PRIVATE_Icons/CheckboxCrossed.js +16 -16
  413. package/es/PRIVATE_Icons/CheckboxMixed.js +16 -16
  414. package/es/PRIVATE_Icons/CheckboxOff.js +16 -16
  415. package/es/PRIVATE_Icons/CheckboxOn.js +16 -16
  416. package/es/PRIVATE_Icons/None.js +16 -16
  417. package/es/PRIVATE_InputBase.js +28 -28
  418. package/es/PRIVATE_List/themes/ListStyles.css.js +1 -1
  419. package/es/PRIVATE_List.js +22 -22
  420. package/es/PRIVATE_Message.js +20 -20
  421. package/es/PRIVATE_MessageLayer.js +12 -12
  422. package/es/PRIVATE_MonthView.js +20 -20
  423. package/es/PRIVATE_MonthYearGridView.js +7 -7
  424. package/es/PRIVATE_PlotArea.js +5 -5
  425. package/es/PRIVATE_RevealToggleIcon.js +18 -18
  426. package/es/PRIVATE_RichSelectionCommon.js +28 -28
  427. package/es/PRIVATE_SelectCommon.js +33 -33
  428. package/es/PRIVATE_StyledCard.js +17 -17
  429. package/es/PRIVATE_StyledCheckbox.js +16 -16
  430. package/es/PRIVATE_StyledSwitch.js +4 -4
  431. package/es/PRIVATE_SwatchFlexView.js +18 -18
  432. package/es/PRIVATE_Table.js +39 -39
  433. package/es/PRIVATE_TableList/themes/ListStyles.css.js +1 -1
  434. package/es/PRIVATE_TableList/themes/redwood/ListTheme.js +1 -1
  435. package/es/PRIVATE_TableList/themes/redwood/ListVariants.css.js +1 -1
  436. package/es/PRIVATE_TableList/themes/stable/ListTheme.js +1 -1
  437. package/es/PRIVATE_TableList/themes/stable/ListVariants.css.js +1 -1
  438. package/es/PRIVATE_TableList.js +29 -29
  439. package/es/PRIVATE_ThemedIcons/CalendarIcon.js +16 -16
  440. package/es/PRIVATE_ThemedIcons/ChartMarqueeSelectIcon.js +16 -16
  441. package/es/PRIVATE_ThemedIcons/ChartPanIcon.js +16 -16
  442. package/es/PRIVATE_ThemedIcons/ChartZoomIcon.js +16 -16
  443. package/es/PRIVATE_ThemedIcons/CheckIcon.js +16 -16
  444. package/es/PRIVATE_ThemedIcons/CheckboxCrossedIcon.js +16 -16
  445. package/es/PRIVATE_ThemedIcons/CheckboxMixedIcon.js +16 -16
  446. package/es/PRIVATE_ThemedIcons/CheckboxOffIcon.js +16 -16
  447. package/es/PRIVATE_ThemedIcons/CheckboxOnIcon.js +16 -16
  448. package/es/PRIVATE_ThemedIcons/CloseIcon.js +16 -16
  449. package/es/PRIVATE_ThemedIcons/CollapseIcon.js +17 -17
  450. package/es/PRIVATE_ThemedIcons/CollapseUpIcon.js +16 -16
  451. package/es/PRIVATE_ThemedIcons/DecrementIcon.js +16 -16
  452. package/es/PRIVATE_ThemedIcons/DeleteIcon.js +16 -16
  453. package/es/PRIVATE_ThemedIcons/DirectionalCollapseArrowIcon.js +17 -17
  454. package/es/PRIVATE_ThemedIcons/DirectionalExpandArrowIcon.js +17 -17
  455. package/es/PRIVATE_ThemedIcons/DragHandleIcon.js +16 -16
  456. package/es/PRIVATE_ThemedIcons/DropdownArrowIcon.js +16 -16
  457. package/es/PRIVATE_ThemedIcons/ExpandIcon.js +16 -16
  458. package/es/PRIVATE_ThemedIcons/HelpIcon.js +16 -16
  459. package/es/PRIVATE_ThemedIcons/IncrementIcon.js +16 -16
  460. package/es/PRIVATE_ThemedIcons/MenuButtonDropdownIcon.js +16 -16
  461. package/es/PRIVATE_ThemedIcons/MessageConfirmationIcon.js +16 -16
  462. package/es/PRIVATE_ThemedIcons/MessageErrorIcon.js +16 -16
  463. package/es/PRIVATE_ThemedIcons/MessageInfoIcon.js +16 -16
  464. package/es/PRIVATE_ThemedIcons/MessageWarningIcon.js +16 -16
  465. package/es/PRIVATE_ThemedIcons/MinusIcon.js +16 -16
  466. package/es/PRIVATE_ThemedIcons/NavDownIcon.js +16 -16
  467. package/es/PRIVATE_ThemedIcons/None.js +16 -16
  468. package/es/PRIVATE_ThemedIcons/OverviewHorizontalDragHandleIcon.js +16 -16
  469. package/es/PRIVATE_ThemedIcons/PlusIcon.js +16 -16
  470. package/es/PRIVATE_ThemedIcons/RadioOffIcon.js +16 -16
  471. package/es/PRIVATE_ThemedIcons/RadioOnIcon.js +16 -16
  472. package/es/PRIVATE_ThemedIcons/SortAscendingIcon.js +16 -16
  473. package/es/PRIVATE_ThemedIcons/SortDescendingIcon.js +16 -16
  474. package/es/PRIVATE_ThemedIcons/UnsortedIcon.js +16 -16
  475. package/es/PRIVATE_ThemedIcons/ViewHideIcon.js +16 -16
  476. package/es/PRIVATE_ThemedIcons/ViewIcon.js +16 -16
  477. package/es/PRIVATE_TimeComponent.js +19 -19
  478. package/es/PRIVATE_TruncatingLink.js +16 -16
  479. package/es/PRIVATE_VisOverview.js +16 -16
  480. package/es/PRIVATE_VisStatusMessage.js +5 -5
  481. package/es/PRIVATE_VisTabularDatatip.js +4 -4
  482. package/es/PolarChartWithDimensions-76ff5180.js +7 -7
  483. package/es/{Popup-83eb0d14.js → Popup-5e092ea2.js} +10 -10
  484. package/es/{Popup-83eb0d14.js.map → Popup-5e092ea2.js.map} +1 -1
  485. package/es/ProgressBarVariants.styles.css +1 -1
  486. package/es/ProgressBarVariants.styles2.css +1 -1
  487. package/es/ProgressButtonLabelLayout-66b9ffed.js +3 -3
  488. package/es/{ProgressCircle-840273b1.js → ProgressCircle-5f423576.js} +2 -2
  489. package/es/{ProgressCircle-840273b1.js.map → ProgressCircle-5f423576.js.map} +1 -1
  490. package/es/ProgressCircleVariants.styles.css +4 -4
  491. package/es/ProgressCircleVariants.styles2.css +4 -4
  492. package/es/RadioItem-1a4b2f6c.js +6 -6
  493. package/es/ReadonlyTextField-bddb2cdf.js +2 -2
  494. package/es/ReadonlyTextFieldInput-bc7ef76e.js +1 -1
  495. package/es/{ReferenceLineArea-6408ffab.js → ReferenceLineArea-ee334176.js} +3 -3
  496. package/es/{ReferenceLineArea-6408ffab.js.map → ReferenceLineArea-ee334176.js.map} +1 -1
  497. package/es/RevealToggleIcon-f599e415.js +1 -1
  498. package/es/{SectionedContent-55b8f8c6.js → SectionedContent-ce3d19ab.js} +5 -5
  499. package/es/{SectionedContent-55b8f8c6.js.map → SectionedContent-ce3d19ab.js.map} +1 -1
  500. package/es/SegmentStyles.styles.css +12 -9
  501. package/es/SegmentStyles.styles2.css +9 -12
  502. package/es/SelectMenuGroupContext-ea5310eb.js +6 -6
  503. package/es/{SelectMobileDropdown-cec84a47.js → SelectMobileDropdown-502af91c.js} +7 -7
  504. package/es/{SelectMobileDropdown-cec84a47.js.map → SelectMobileDropdown-502af91c.js.map} +1 -1
  505. package/es/SelectMobileFieldInput-bd65672b.js +4 -4
  506. package/es/{SelectorAll-855a2050.js → SelectorAll-4b170e2f.js} +5 -5
  507. package/es/{SelectorAll-855a2050.js.map → SelectorAll-4b170e2f.js.map} +1 -1
  508. package/es/Sheet-9a10abc4.js +2 -2
  509. package/es/SortControl-73376bf0.js +3 -3
  510. package/es/SplitMenuButtonTheme.styles.css +4 -4
  511. package/es/SplitMenuButtonTheme.styles2.css +4 -4
  512. package/es/StyledCard-0e89c7fd.js +1 -1
  513. package/es/{StyledLabelValueLayout-69ac5e9a.js → StyledLabelValueLayout-1ebe21b2.js} +2 -2
  514. package/es/{StyledLabelValueLayout-69ac5e9a.js.map → StyledLabelValueLayout-1ebe21b2.js.map} +1 -1
  515. package/es/StyledSwitch-dc6a94af.js +2 -2
  516. package/es/StyledTextField-56e1a6e7.js +3 -3
  517. package/es/Submenu-481b3c39.js +1 -1
  518. package/es/{TabBar-36932ca2.js → TabBar-de0cb67b.js} +14 -12
  519. package/es/TabBar-de0cb67b.js.map +1 -0
  520. package/es/TabBarContextMenu-41639eb7.js +2 -2
  521. package/es/TabBarItemVariants.styles.css +3 -3
  522. package/es/TabBarItemVariants.styles2.css +3 -3
  523. package/es/TabBarLayout-5876474d.js +1 -1
  524. package/es/Table-fd39c1b5.js +9 -9
  525. package/es/TableColGroup-2f67372c.js +1 -1
  526. package/es/{TextField-0a9a5a57.js → TextField-a556da78.js} +2 -2
  527. package/es/{TextField-0a9a5a57.js.map → TextField-a556da78.js.map} +1 -1
  528. package/es/TextFieldContent-5e5ed450.js +2 -2
  529. package/es/{TextureDefs-295dccbd.js → TextureDefs-7373dec8.js} +2 -2
  530. package/es/{TextureDefs-295dccbd.js.map → TextureDefs-7373dec8.js.map} +1 -1
  531. package/es/Theme-redwood/theme.css +361 -371
  532. package/es/Theme-stable/theme.css +459 -449
  533. package/es/TimeComponentCanvas2D-e22cb491.js +6 -6
  534. package/es/TimePicker-aba30924.js +2 -2
  535. package/es/ToggleButton-d2b3a635.js +1 -1
  536. package/es/TreeItemLayout-7783b7bf.js +2 -2
  537. package/es/TruncatingLink-e0338cb2.js +4 -4
  538. package/es/TruncatingText-868308d3.js +1 -1
  539. package/es/UNSAFE_AccordionItemMultiple.js +18 -18
  540. package/es/UNSAFE_AccordionItemSingle.js +18 -18
  541. package/es/UNSAFE_ActionCard.js +17 -17
  542. package/es/UNSAFE_BarChart.js +37 -37
  543. package/es/UNSAFE_BareButton.js +2 -2
  544. package/es/UNSAFE_BaseButton.js +5 -5
  545. package/es/UNSAFE_Button.js +6 -6
  546. package/es/UNSAFE_ButtonSet.js +17 -17
  547. package/es/UNSAFE_ButtonSetButton.js +5 -5
  548. package/es/UNSAFE_ButtonSetIconButton.js +17 -17
  549. package/es/UNSAFE_ButtonSetItem.js +18 -18
  550. package/es/UNSAFE_ButtonSetMultiple.js +17 -17
  551. package/es/UNSAFE_ButtonSetSingle.js +17 -17
  552. package/es/UNSAFE_Card.js +17 -17
  553. package/es/UNSAFE_CardFlexView.js +22 -22
  554. package/es/UNSAFE_CardGridView.js +22 -22
  555. package/es/UNSAFE_Center.js +5 -5
  556. package/es/UNSAFE_Checkbox.js +25 -25
  557. package/es/UNSAFE_CheckboxItem.js +77 -139
  558. package/es/UNSAFE_CheckboxItem.js.map +1 -1
  559. package/es/UNSAFE_CheckboxRadioField.js +4 -4
  560. package/es/UNSAFE_CheckboxSet.js +75 -41
  561. package/es/UNSAFE_CheckboxSet.js.map +1 -1
  562. package/es/UNSAFE_Chip.js +2 -2
  563. package/es/UNSAFE_Collapsible.js +18 -18
  564. package/es/UNSAFE_CollapsibleNavigationList.js +28 -28
  565. package/es/UNSAFE_ColorInputText.js +109 -109
  566. package/es/UNSAFE_ColorPalette.js +21 -21
  567. package/es/UNSAFE_ColorPicker.js +23 -23
  568. package/es/UNSAFE_ColorSwatch.js +18 -18
  569. package/es/UNSAFE_ComboChart.js +38 -38
  570. package/es/UNSAFE_ComponentMessage.js +20 -20
  571. package/es/UNSAFE_ContainerDiagram.js +30 -30
  572. package/es/UNSAFE_ConveyorBelt.js +18 -18
  573. package/es/UNSAFE_DatePicker.js +27 -27
  574. package/es/UNSAFE_Diagram.js +30 -30
  575. package/es/UNSAFE_Dialog.js +22 -22
  576. package/es/UNSAFE_DragHandle.js +17 -17
  577. package/es/UNSAFE_DrawerLayout.js +12 -12
  578. package/es/UNSAFE_DrawerPopup.js +11 -11
  579. package/es/UNSAFE_Dropdown.js +15 -15
  580. package/es/UNSAFE_Environment.js +4 -4
  581. package/es/UNSAFE_Expander.js +20 -20
  582. package/es/UNSAFE_FilePicker.js +4 -4
  583. package/es/UNSAFE_FilmStrip.js +19 -19
  584. package/es/UNSAFE_Flex.js +4 -4
  585. package/es/UNSAFE_Floating.js +11 -11
  586. package/es/UNSAFE_FormLayout/themes/redwood/FormLayoutTheme.js +1 -1
  587. package/es/UNSAFE_FormLayout/themes/redwood/FormLayoutVariants.css.js +1 -1
  588. package/es/UNSAFE_FormLayout/themes/stable/FormLayoutTheme.js +1 -1
  589. package/es/UNSAFE_FormLayout/themes/stable/FormLayoutVariants.css.js +1 -1
  590. package/es/UNSAFE_FormLayout.js +3 -3
  591. package/es/UNSAFE_Gantt.js +23 -23
  592. package/es/UNSAFE_Grid.js +4 -4
  593. package/es/UNSAFE_HierarchicalList.js +30 -30
  594. package/es/UNSAFE_HighlightText.js +4 -4
  595. package/es/UNSAFE_Icon.js +16 -16
  596. package/es/UNSAFE_IconButton.js +17 -17
  597. package/es/UNSAFE_IconMenuButton.js +26 -26
  598. package/es/UNSAFE_IconProgressButton.js +22 -22
  599. package/es/UNSAFE_IconToggleButton.js +17 -17
  600. package/es/UNSAFE_IndentedCellLayout/themes/redwood/IndentedCellLayoutBaseTheme.css.js +1 -1
  601. package/es/UNSAFE_IndentedCellLayout/themes/stable/IndentedCellLayoutBaseTheme.css.js +1 -1
  602. package/es/UNSAFE_IndentedCellLayout.js +1 -1
  603. package/es/UNSAFE_Indexer.js +19 -19
  604. package/es/UNSAFE_InlineSelectSingle.js +36 -36
  605. package/es/UNSAFE_InputColor.js +108 -108
  606. package/es/UNSAFE_InputDateMask/themes/SegmentStyles.css.js +1 -1
  607. package/es/UNSAFE_InputDateMask.js +30 -30
  608. package/es/UNSAFE_InputDatePicker.js +39 -39
  609. package/es/UNSAFE_InputPassword.js +28 -28
  610. package/es/UNSAFE_InputSearch/themes/redwood/InputSearchTheme.js +1 -1
  611. package/es/UNSAFE_InputSearch/themes/redwood/InputSearchVariants.css.js +1 -1
  612. package/es/UNSAFE_InputSearch/themes/stable/InputSearchTheme.js +1 -1
  613. package/es/UNSAFE_InputSearch/themes/stable/InputSearchVariants.css.js +1 -1
  614. package/es/UNSAFE_InputSearch.js +35 -35
  615. package/es/UNSAFE_InputSensitiveText.js +29 -29
  616. package/es/UNSAFE_InputText.js +30 -30
  617. package/es/UNSAFE_InputTimeMask/themes/SegmentStyles.css.js +1 -1
  618. package/es/UNSAFE_InputTimeMask.js +29 -29
  619. package/es/UNSAFE_InputTimePicker.js +39 -39
  620. package/es/UNSAFE_Label.js +25 -25
  621. package/es/UNSAFE_LabelValueLayout.js +4 -4
  622. package/es/UNSAFE_LabelledLink.js +27 -27
  623. package/es/UNSAFE_Layer.js +8 -8
  624. package/es/UNSAFE_Legend.js +29 -29
  625. package/es/UNSAFE_LineAreaChart.js +38 -38
  626. package/es/UNSAFE_Link.js +2 -2
  627. package/es/UNSAFE_ListGroupHeaderLayout.js +5 -5
  628. package/es/UNSAFE_ListItemLayout.js +5 -5
  629. package/es/UNSAFE_ListView.js +29 -29
  630. package/es/UNSAFE_LiveRegion.js +4 -4
  631. package/es/UNSAFE_Menu/themes/redwood/MenuItemTheme.js +1 -1
  632. package/es/UNSAFE_Menu/themes/redwood/MenuItemVariants.css.js +1 -1
  633. package/es/UNSAFE_Menu/themes/stable/MenuItemTheme.js +1 -1
  634. package/es/UNSAFE_Menu/themes/stable/MenuItemVariants.css.js +1 -1
  635. package/es/UNSAFE_Menu.js +27 -27
  636. package/es/UNSAFE_MenuButton.js +26 -26
  637. package/es/UNSAFE_MessageBanner.js +20 -20
  638. package/es/UNSAFE_MessageToast.js +22 -22
  639. package/es/UNSAFE_MeterBar.js +16 -16
  640. package/es/UNSAFE_MeterCircle/themes/redwood/MeterCircleTheme.js +1 -1
  641. package/es/UNSAFE_MeterCircle/themes/redwood/MeterCircleVariants.css.js +1 -1
  642. package/es/UNSAFE_MeterCircle/themes/stable/MeterCircleTheme.js +1 -1
  643. package/es/UNSAFE_MeterCircle/themes/stable/MeterCircleVariants.css.js +1 -1
  644. package/es/UNSAFE_MeterCircle.js +18 -18
  645. package/es/UNSAFE_Modal.js +8 -8
  646. package/es/UNSAFE_NavigationList.js +28 -28
  647. package/es/UNSAFE_NumberInputText.js +32 -32
  648. package/es/UNSAFE_OverflowTabBar.js +39 -35
  649. package/es/UNSAFE_OverflowTabBar.js.map +1 -1
  650. package/es/UNSAFE_PictoChart.js +26 -26
  651. package/es/UNSAFE_PieChart.js +30 -30
  652. package/es/UNSAFE_PolarBarChart.js +31 -31
  653. package/es/UNSAFE_PolarLineAreaChart.js +31 -31
  654. package/es/UNSAFE_Popup.js +18 -18
  655. package/es/UNSAFE_ProgressBar/themes/redwood/ProgressBarTheme.js +1 -1
  656. package/es/UNSAFE_ProgressBar/themes/redwood/ProgressBarVariants.css.js +1 -1
  657. package/es/UNSAFE_ProgressBar/themes/stable/ProgressBarTheme.js +1 -1
  658. package/es/UNSAFE_ProgressBar/themes/stable/ProgressBarVariants.css.js +1 -1
  659. package/es/UNSAFE_ProgressBar.js +5 -5
  660. package/es/UNSAFE_ProgressButton.js +22 -22
  661. package/es/UNSAFE_ProgressButtonLabelLayout.js +11 -11
  662. package/es/UNSAFE_ProgressCircle/themes/redwood/ProgressCircleTheme.js +1 -1
  663. package/es/UNSAFE_ProgressCircle/themes/redwood/ProgressCircleVariants.css.js +1 -1
  664. package/es/UNSAFE_ProgressCircle/themes/stable/ProgressCircleTheme.js +1 -1
  665. package/es/UNSAFE_ProgressCircle/themes/stable/ProgressCircleVariants.css.js +1 -1
  666. package/es/UNSAFE_ProgressCircle.js +5 -5
  667. package/es/UNSAFE_RadioItem.js +25 -25
  668. package/es/UNSAFE_RadioSet.js +27 -27
  669. package/es/UNSAFE_RangeBarChart.js +37 -37
  670. package/es/UNSAFE_RatingGauge.js +18 -18
  671. package/es/UNSAFE_Refresher.js +5 -5
  672. package/es/UNSAFE_ReorderableTabBar.js +33 -33
  673. package/es/UNSAFE_RichCheckboxSet.js +65 -69
  674. package/es/UNSAFE_RichCheckboxSet.js.map +1 -1
  675. package/es/UNSAFE_RichRadioSet.js +29 -29
  676. package/es/UNSAFE_RichSelectionItem.js +122 -177
  677. package/es/UNSAFE_RichSelectionItem.js.map +1 -1
  678. package/es/UNSAFE_ScatterChart.js +37 -37
  679. package/es/UNSAFE_SectionalLegend.js +29 -29
  680. package/es/UNSAFE_SelectMultiple.js +40 -40
  681. package/es/UNSAFE_SelectSingle.js +39 -39
  682. package/es/UNSAFE_SelectionCard.js +17 -17
  683. package/es/UNSAFE_Selector.js +17 -17
  684. package/es/UNSAFE_SelectorAll.js +19 -19
  685. package/es/UNSAFE_Sheet.js +11 -11
  686. package/es/UNSAFE_Slider.js +28 -28
  687. package/es/UNSAFE_SortControl.js +19 -19
  688. package/es/UNSAFE_SplitMenuButton/themes/redwood/SplitMenuButtonTheme.css.js +1 -1
  689. package/es/UNSAFE_SplitMenuButton/themes/stable/SplitMenuButtonTheme.css.js +1 -1
  690. package/es/UNSAFE_SplitMenuButton.js +27 -27
  691. package/es/UNSAFE_SwipeActions.js +26 -26
  692. package/es/UNSAFE_Switch/themes/redwood/SwitchBaseTheme.css.js +1 -1
  693. package/es/UNSAFE_Switch/themes/redwood/SwitchTheme.js +1 -1
  694. package/es/UNSAFE_Switch/themes/stable/SwitchBaseTheme.css.js +1 -1
  695. package/es/UNSAFE_Switch/themes/stable/SwitchTheme.js +1 -1
  696. package/es/UNSAFE_Switch.js +27 -27
  697. package/es/UNSAFE_TabBar.js +34 -34
  698. package/es/UNSAFE_TabBarCommon/themes/redwood/TabBarItemTheme.js +1 -1
  699. package/es/UNSAFE_TabBarCommon/themes/redwood/TabBarItemVariants.css.js +1 -1
  700. package/es/UNSAFE_TabBarCommon/themes/stable/TabBarItemTheme.js +1 -1
  701. package/es/UNSAFE_TabBarCommon/themes/stable/TabBarItemVariants.css.js +1 -1
  702. package/es/UNSAFE_TabBarCommon.js +30 -30
  703. package/es/UNSAFE_TabBarMixed.js +32 -32
  704. package/es/UNSAFE_TabBarMixed.js.map +1 -1
  705. package/es/UNSAFE_TableDisplay.js +19 -19
  706. package/es/UNSAFE_TableView.js +39 -39
  707. package/es/UNSAFE_TagCloud.js +27 -27
  708. package/es/UNSAFE_TextArea.js +29 -29
  709. package/es/UNSAFE_TextAreaAutosize.js +29 -29
  710. package/es/UNSAFE_TextField.js +21 -21
  711. package/es/UNSAFE_TimePicker.js +30 -30
  712. package/es/UNSAFE_ToggleButton.js +5 -5
  713. package/es/UNSAFE_Toolbar.js +4 -4
  714. package/es/UNSAFE_Train.js +17 -17
  715. package/es/UNSAFE_TreeItemLayout.js +5 -5
  716. package/es/UNSAFE_TreeTableView.js +39 -39
  717. package/es/UNSAFE_TreeView.js +30 -30
  718. package/es/UNSAFE_TruncatingBadge.js +17 -17
  719. package/es/UNSAFE_TruncatingText.js +17 -17
  720. package/es/UNSAFE_UserAssistance.js +26 -26
  721. package/es/UNSAFE_View.js +7 -7
  722. package/es/UNSAFE_VirtualizedListView.js +22 -22
  723. package/es/UNSAFE_VisInvalidDataMessage.js +6 -6
  724. package/es/UNSAFE_VisNoDataMessage.js +6 -6
  725. package/es/UNSAFE_VisProgressiveLoader.js +5 -5
  726. package/es/UNSAFE_WindowOverlay.js +4 -4
  727. package/es/{View-5e006875.js → View-0ee9645e.js} +5 -5
  728. package/es/{View-5e006875.js.map → View-0ee9645e.js.map} +1 -1
  729. package/es/{VisStatusMessage-091fb10e.js → VisStatusMessage-56f961f5.js} +2 -2
  730. package/es/{VisStatusMessage-091fb10e.js.map → VisStatusMessage-56f961f5.js.map} +1 -1
  731. package/es/{VisTabularDatatip-e3acfb61.js → VisTabularDatatip-e71cef20.js} +2 -2
  732. package/es/{VisTabularDatatip-e3acfb61.js.map → VisTabularDatatip-e71cef20.js.map} +1 -1
  733. package/es/{WindowOverlay-05bff667.js → WindowOverlay-9f2cbaa0.js} +2 -2
  734. package/es/{WindowOverlay-05bff667.js.map → WindowOverlay-9f2cbaa0.js.map} +1 -1
  735. package/es/{YearsGridView-db24fc9f.js → YearsGridView-6a5c2c74.js} +4 -4
  736. package/es/{YearsGridView-db24fc9f.js.map → YearsGridView-6a5c2c74.js.map} +1 -1
  737. package/es/hoc/PRIVATE_withDirectionIcon.js +4 -4
  738. package/es/hoc/PRIVATE_withThemeIcon.js +3 -3
  739. package/es/hoc/UNSAFE_withThemeProps.js +3 -3
  740. package/es/hooks/PRIVATE_useChartContextMenu.js +24 -24
  741. package/es/hooks/PRIVATE_useChartDatatip.js +14 -14
  742. package/es/hooks/PRIVATE_useChartEvents.js +20 -20
  743. package/es/hooks/PRIVATE_useChartMarquee.js +19 -19
  744. package/es/hooks/PRIVATE_useCollectionFocusRing.js +17 -17
  745. package/es/hooks/PRIVATE_useCssVars.js +7 -7
  746. package/es/hooks/PRIVATE_useCurrentKey.js +4 -4
  747. package/es/hooks/PRIVATE_useDatatip.js +12 -12
  748. package/es/hooks/PRIVATE_useDetectHorizontalOverflow.js +17 -17
  749. package/es/hooks/PRIVATE_useFloating.js +4 -4
  750. package/es/hooks/PRIVATE_useItemAction.js +17 -17
  751. package/es/hooks/PRIVATE_useListCommon.js +18 -18
  752. package/es/hooks/PRIVATE_useOutsideMousedown.js +9 -9
  753. package/es/hooks/PRIVATE_useRadioFocusManager.js +4 -4
  754. package/es/hooks/PRIVATE_useReorderable.js +19 -19
  755. package/es/hooks/PRIVATE_useRovingTabIndexContainer.js +4 -4
  756. package/es/hooks/PRIVATE_useSelection.js +4 -4
  757. package/es/hooks/PRIVATE_useTabBar.js +28 -28
  758. package/es/hooks/PRIVATE_useTabbableModeSet.js +17 -17
  759. package/es/hooks/PRIVATE_useTooltipOnTruncation.js +17 -17
  760. package/es/hooks/PRIVATE_useVisContextMenu.js +24 -24
  761. package/es/hooks/PRIVATE_useVisDragModeControls.js +19 -19
  762. package/es/hooks/PRIVATE_useVisEvents.js +4 -4
  763. package/es/hooks/PRIVATE_useVisMeterEvents.js +14 -14
  764. package/es/hooks/PRIVATE_useVisSelection.js +15 -15
  765. package/es/hooks/UNSAFE_useBareButton.js +2 -2
  766. package/es/hooks/UNSAFE_useColorScheme.js +3 -3
  767. package/es/hooks/UNSAFE_useCurrentBgColor.js +2 -2
  768. package/es/hooks/UNSAFE_useDensity.js +3 -3
  769. package/es/hooks/UNSAFE_useHiddenTestMethod.js +3 -3
  770. package/es/hooks/UNSAFE_useOutsideClick.js +8 -8
  771. package/es/hooks/UNSAFE_usePrefixSuffix.js +4 -4
  772. package/es/hooks/UNSAFE_useScale.js +3 -3
  773. package/es/hooks/UNSAFE_useTestId.js +3 -3
  774. package/es/hooks/UNSAFE_useTheme.js +3 -3
  775. package/es/hooks/UNSAFE_useThemeInterpolations.js +6 -6
  776. package/es/hooks/UNSAFE_useTooltip.js +17 -17
  777. package/es/hooks/UNSAFE_useTranslationBundle.js +3 -3
  778. package/es/hooks/UNSAFE_useUser.js +3 -3
  779. package/es/{popupUtils-c052da19.js → popupUtils-87073802.js} +2 -2
  780. package/es/{popupUtils-c052da19.js.map → popupUtils-87073802.js.map} +1 -1
  781. package/es/{tooltipUtils-8f52a37e.js → tooltipUtils-f2f90085.js} +5 -5
  782. package/es/{tooltipUtils-8f52a37e.js.map → tooltipUtils-f2f90085.js.map} +1 -1
  783. package/es/useBareButton-3d8d3267.js +1 -1
  784. package/es/useCellNavigation-74703ae5.js +1 -1
  785. package/es/useChartContextMenu-f63e0e70.js +2 -2
  786. package/es/{useChartDatatip-7a0287e7.js → useChartDatatip-c8797dc7.js} +4 -4
  787. package/es/{useChartDatatip-7a0287e7.js.map → useChartDatatip-c8797dc7.js.map} +1 -1
  788. package/es/{useColorScheme-febcabc0.js → useColorScheme-0d2625c5.js} +2 -2
  789. package/es/{useColorScheme-febcabc0.js.map → useColorScheme-0d2625c5.js.map} +1 -1
  790. package/es/useContextMenu-5730737d.js +2 -2
  791. package/es/{useCssVars-663740c4.js → useCssVars-697799fa.js} +5 -5
  792. package/es/{useCssVars-663740c4.js.map → useCssVars-697799fa.js.map} +1 -1
  793. package/es/{useCurrentKey-89b60d32.js → useCurrentKey-2cdeda49.js} +2 -2
  794. package/es/{useCurrentKey-89b60d32.js.map → useCurrentKey-2cdeda49.js.map} +1 -1
  795. package/es/{useDatatip-e234ee0a.js → useDatatip-73d51f39.js} +4 -4
  796. package/es/{useDatatip-e234ee0a.js.map → useDatatip-73d51f39.js.map} +1 -1
  797. package/es/{useDatatipAndCursor-0b8febe5.js → useDatatipAndCursor-142787d4.js} +2 -2
  798. package/es/{useDatatipAndCursor-0b8febe5.js.map → useDatatipAndCursor-142787d4.js.map} +1 -1
  799. package/es/{useDensity-482708e7.js → useDensity-9c3ef227.js} +2 -2
  800. package/es/{useDensity-482708e7.js.map → useDensity-9c3ef227.js.map} +1 -1
  801. package/es/{useDetectHorizontalOverflow-9b684feb.js → useDetectHorizontalOverflow-5b505e78.js} +30 -58
  802. package/es/useDetectHorizontalOverflow-5b505e78.js.map +1 -0
  803. package/es/useDisplayValue-f7c80ffe.js +6 -6
  804. package/es/{useFloating-38c13cfa.js → useFloating-98ad16ec.js} +2 -2
  805. package/es/{useFloating-38c13cfa.js.map → useFloating-98ad16ec.js.map} +1 -1
  806. package/es/{useHiddenTestMethod-dc102488.js → useHiddenTestMethod-4bb568f0.js} +2 -2
  807. package/es/{useHiddenTestMethod-dc102488.js.map → useHiddenTestMethod-4bb568f0.js.map} +1 -1
  808. package/es/useInputBase-6dc2e103.js +6 -6
  809. package/es/{useKeyboardEvents-ce2d5783.js → useKeyboardEvents-18678615.js} +2 -2
  810. package/es/{useKeyboardEvents-ce2d5783.js.map → useKeyboardEvents-18678615.js.map} +1 -1
  811. package/es/useLegendContextMenu-a6e566c4.js +6 -6
  812. package/es/{useMeterDatatip-e21c0d4b.js → useMeterDatatip-27882514.js} +3 -3
  813. package/es/{useMeterDatatip-e21c0d4b.js.map → useMeterDatatip-27882514.js.map} +1 -1
  814. package/es/useNavigation-a4715511.js +1 -1
  815. package/es/{useOutsideClick-552699e3.js → useOutsideClick-cad76f8b.js} +2 -2
  816. package/es/{useOutsideClick-552699e3.js.map → useOutsideClick-cad76f8b.js.map} +1 -1
  817. package/es/{useOutsideMousedown-36235b3d.js → useOutsideMousedown-9da55345.js} +2 -2
  818. package/es/{useOutsideMousedown-36235b3d.js.map → useOutsideMousedown-9da55345.js.map} +1 -1
  819. package/es/{usePopupAnimation-83d1dde8.js → usePopupAnimation-c12f24ba.js} +2 -2
  820. package/es/{usePopupAnimation-83d1dde8.js.map → usePopupAnimation-c12f24ba.js.map} +1 -1
  821. package/es/{usePrefixSuffix-7a0fb41b.js → usePrefixSuffix-56167b97.js} +2 -2
  822. package/es/{usePrefixSuffix-7a0fb41b.js.map → usePrefixSuffix-56167b97.js.map} +1 -1
  823. package/es/{useRadioFocusManager-d14e0331.js → useRadioFocusManager-afcb8a84.js} +2 -2
  824. package/es/{useRadioFocusManager-d14e0331.js.map → useRadioFocusManager-afcb8a84.js.map} +1 -1
  825. package/es/{useReorderableItem-936082ee.js → useReorderableItem-c47eebbe.js} +3 -3
  826. package/es/{useReorderableItem-936082ee.js.map → useReorderableItem-c47eebbe.js.map} +1 -1
  827. package/es/{useRovingTabIndexContainer-50d6566f.js → useRovingTabIndexContainer-51de19b5.js} +2 -2
  828. package/es/{useRovingTabIndexContainer-50d6566f.js.map → useRovingTabIndexContainer-51de19b5.js.map} +1 -1
  829. package/es/{useScale-9936da9d.js → useScale-4a98c348.js} +2 -2
  830. package/es/{useScale-9936da9d.js.map → useScale-4a98c348.js.map} +1 -1
  831. package/es/useSelectCommon-480b6641.js +5 -5
  832. package/es/{useSelectDrill-93387909.js → useSelectDrill-81f36802.js} +2 -2
  833. package/es/{useSelectDrill-93387909.js.map → useSelectDrill-81f36802.js.map} +1 -1
  834. package/es/{useSelection-429274e4.js → useSelection-584c64a6.js} +2 -2
  835. package/es/{useSelection-429274e4.js.map → useSelection-584c64a6.js.map} +1 -1
  836. package/es/{useSelection-58503244.js → useSelection-9f099db0.js} +6 -6
  837. package/es/{useSelection-58503244.js.map → useSelection-9f099db0.js.map} +1 -1
  838. package/es/{useTabBar-04a0093f.js → useTabBar-f068eee4.js} +6 -9
  839. package/es/useTabBar-f068eee4.js.map +1 -0
  840. package/es/{useTestId-20c68501.js → useTestId-2c0e08d3.js} +2 -2
  841. package/es/{useTestId-20c68501.js.map → useTestId-2c0e08d3.js.map} +1 -1
  842. package/es/{useTheme-eef5d217.js → useTheme-2c44fa3e.js} +2 -2
  843. package/es/{useTheme-eef5d217.js.map → useTheme-2c44fa3e.js.map} +1 -1
  844. package/es/{useThemeInterpolations-2d6f0d78.js → useThemeInterpolations-9df8ad1a.js} +5 -5
  845. package/es/{useThemeInterpolations-2d6f0d78.js.map → useThemeInterpolations-9df8ad1a.js.map} +1 -1
  846. package/es/{useTooltip-8decbde6.js → useTooltip-7779b267.js} +2 -2
  847. package/es/{useTooltip-8decbde6.js.map → useTooltip-7779b267.js.map} +1 -1
  848. package/es/{useTooltipControlled-ccfa2705.js → useTooltipControlled-729b3aac.js} +5 -5
  849. package/es/{useTooltipControlled-ccfa2705.js.map → useTooltipControlled-729b3aac.js.map} +1 -1
  850. package/es/{useTooltipOnTruncation-2df1e74f.js → useTooltipOnTruncation-5e2c2a50.js} +4 -4
  851. package/es/{useTooltipOnTruncation-2df1e74f.js.map → useTooltipOnTruncation-5e2c2a50.js.map} +1 -1
  852. package/es/{useTranslationBundle-ded09d52.js → useTranslationBundle-752de59a.js} +2 -2
  853. package/es/{useTranslationBundle-ded09d52.js.map → useTranslationBundle-752de59a.js.map} +1 -1
  854. package/es/useTruncationTooltip-fd1dac2a.js +3 -3
  855. package/es/{useUser-e1199cab.js → useUser-2c24ff59.js} +2 -2
  856. package/es/{useUser-e1199cab.js.map → useUser-2c24ff59.js.map} +1 -1
  857. package/es/useVisDragModeControls-092e8ac4.js +1 -1
  858. package/es/{useVisEvents-012f2a18.js → useVisEvents-454b5545.js} +2 -2
  859. package/es/{useVisEvents-012f2a18.js.map → useVisEvents-454b5545.js.map} +1 -1
  860. package/es/utils/PRIVATE_collectionUtils.js +17 -17
  861. package/es/utils/PRIVATE_tabBarUtils.js +17 -17
  862. package/es/utils/PRIVATE_tooltipUtils.js +14 -14
  863. package/es/utils/PRIVATE_visTestUtils.js +4 -4
  864. package/es/utils/UNSAFE_popupUtils.js +8 -8
  865. package/es/{withDirectionIcon-abc3124a.js → withDirectionIcon-dec377dd.js} +2 -2
  866. package/es/{withDirectionIcon-abc3124a.js.map → withDirectionIcon-dec377dd.js.map} +1 -1
  867. package/es/withThemeProps-3565a045.js +2 -2
  868. package/package.json +2 -2
  869. package/types/UNSAFE_TabBarMixed/useTabBarMixed.d.ts +1 -1
  870. package/amd/ContainerDiagram-521f402a.js +0 -2
  871. package/amd/Expander-150fa95e.js +0 -2
  872. package/amd/InputDatePicker-613800d1.js +0 -2
  873. package/amd/NavigationListExternalLinkItem-3d98a9e8.js +0 -2
  874. package/amd/NavigationListLinkItem-c4b2b73c.js +0 -2
  875. package/amd/OverflowTabBar-37f590ba.js +0 -2
  876. package/amd/OverflowTabBar-37f590ba.js.map +0 -1
  877. package/amd/OverflowTabBarItem-11f199ee.js +0 -2
  878. package/amd/SortControl-115bc431.js +0 -2
  879. package/amd/TabBar-dc8cadc2.js +0 -2
  880. package/amd/TabBar-dc8cadc2.js.map +0 -1
  881. package/amd/TabBarMixed-e16ca418.js +0 -2
  882. package/amd/useDetectHorizontalOverflow-7f5bba36.js +0 -2
  883. package/amd/useDetectHorizontalOverflow-7f5bba36.js.map +0 -1
  884. package/amd/useTabBar-2d8fc9aa.js +0 -2
  885. package/amd/useTabBar-2d8fc9aa.js.map +0 -1
  886. package/cjs/TabBar-1cd4ac17.js.map +0 -1
  887. package/cjs/TextArea-d65e3f5b.js +0 -207
  888. package/cjs/TextArea-d65e3f5b.js.map +0 -1
  889. package/cjs/useDetectHorizontalOverflow-622817d4.js.map +0 -1
  890. package/cjs/useTabBar-ec20851a.js.map +0 -1
  891. package/es/CheckboxSet-3e0ce80c.js +0 -52
  892. package/es/CheckboxSet-3e0ce80c.js.map +0 -1
  893. package/es/TabBar-36932ca2.js.map +0 -1
  894. package/es/useDetectHorizontalOverflow-9b684feb.js.map +0 -1
  895. package/es/useTabBar-04a0093f.js.map +0 -1
  896. /package/amd/UNSAFE_IndentedCellLayout/themes/{redwood → stable}/IndentedCellLayoutBaseTheme.styles.css +0 -0
  897. /package/es/UNSAFE_IndentedCellLayout/themes/{redwood → stable}/IndentedCellLayoutBaseTheme.styles.css +0 -0
  898. /package/es/UNSAFE_Switch/themes/{redwood → stable}/SwitchBaseTheme.styles.css +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"UNSAFE_InputSearch.js","sources":["../../src/UNSAFE_RedwoodIcons/Search/Search.tsx","../../src/UNSAFE_InputSearch/InputSearchBase.tsx","../../src/UNSAFE_InputSearch/utils.ts","../../src/UNSAFE_InputSearch/InputSearchSuggestions.tsx","../../src/UNSAFE_InputSearch/InputSearchDesktopSuggestions.tsx","../../src/UNSAFE_InputSearch/InputSearchMobileDropdown.tsx","../../src/UNSAFE_InputSearch/useInputSearch.ts","../../src/UNSAFE_InputSearch/InputSearch.tsx"],"sourcesContent":["/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates. All rights reserved.\n * https://www.oracle.com/contracts/docs/cloud_csa_online_v062223_us_eng.pdf?download=false&er=221886\n * @ignore\n */\n// DO NOT MODIFY THIS FILE MANUALLY!\n// This file is automatically generated based on the corresponding SVG image in\n// the packages/oraclejet-preact/resources/icons folder.\nimport { ComponentProps } from 'preact';\nimport { Icon } from '../../UNSAFE_Icon';\ntype Props = Omit<ComponentProps<typeof Icon>, 'viewBox' | 'children'>;\nconst SvgSearch = (props: Props) => (\n <Icon viewBox=\"0 0 24 24\" {...props}>\n <path\n d=\"M10 2a8 8 0 0 1 6.317 12.91l5.383 5.384-1.414 1.414-5.386-5.384A8 8 0 1 1 10 2zm0 2a6 6 0 1 0 0 12 6 6 0 0 0 0-12z\"\n fill=\"currentcolor\"\n fillRule=\"evenodd\"\n />\n </Icon>\n);\nexport { SvgSearch as Search };\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport type { ComponentProps, ComponentChildren, Ref, JSX } from 'preact';\nimport { forwardRef } from 'preact/compat';\nimport { useCallback, useEffect, useImperativeHandle, useMemo, useRef } from 'preact/hooks';\nimport type { UnpackSignals } from '@oracle/oraclejet-internal-utilities/attributeUtils';\nimport type { BundleType } from '#resources/nls/bundle';\nimport { LiveRegion } from '#UNSAFE_LiveRegion';\nimport { Text } from '#UNSAFE_Text';\nimport { useFocusableTextField } from '#hooks/UNSAFE_useFocusableTextField';\nimport type { FocusableHandle } from '#hooks/UNSAFE_useFocusableTextField';\nimport { FormFieldContext } from '#hooks/UNSAFE_useFormFieldContext';\nimport { useTabbableMode } from '#hooks/UNSAFE_useTabbableMode';\nimport type { TestIdProps } from '#hooks/UNSAFE_useTestId';\nimport { useTextField } from '#hooks/UNSAFE_useTextField';\nimport { useTranslationBundle } from '#hooks/UNSAFE_useTranslationBundle';\nimport { useComponentTheme } from '#hooks/UNSAFE_useComponentTheme';\nimport { Search } from '#UNSAFE_RedwoodIcons/Search';\nimport { TextFieldInput, TextField } from '#UNSAFE_TextField';\nimport { mergeRefs } from '#utils/PRIVATE_refUtils';\nimport type { InputSearchStyles, InputSearchVariantOptions } from './themes/InputSearchStyles.css';\nimport { InputSearchRedwoodTheme } from './themes/redwood/InputSearchTheme';\n\ntype TextFieldInputProps = ComponentProps<typeof TextFieldInput>;\ntype TextFieldProps = ComponentProps<typeof TextField>;\n\ntype FocusWithinProps = Pick<\n Parameters<typeof useFocusableTextField<HTMLInputElement, HTMLDivElement>>[0],\n 'onBlurWithin' | 'onFocusWithin'\n>;\ntype MouseDownProps = Pick<UnpackSignals<JSX.IntrinsicElements['div']>, 'onMouseDown'>;\ntype ClickProps = Pick<UnpackSignals<JSX.IntrinsicElements['div']>, 'onClick'>;\n\n/**\n * Props for the internal InputSearch text field renderer.\n */\ntype Props = TestIdProps & {\n /**\n * A short hint to display before the user enters a value.\n * @default undefined\n */\n placeholder?: TextFieldInputProps['placeholder'];\n\n /**\n * The type of the input element. Use 'search' for mobile and 'text' for desktop.\n * Type is determined in the parent InputSearch component based on device.\n */\n type: 'search' | 'text';\n\n /**\n * The current display value of the component.\n * @default undefined\n */\n value?: TextFieldInputProps['value'];\n\n /**\n * Desktop-only floating autocomplete suggestion shown adjacent to the typed input\n * when the first match is a substring rather than a prefix match.\n */\n floatingAutocompleteText?: string;\n\n /**\n * Assistive text announced from the mobile input field's live region.\n */\n liveRegionText?: string;\n\n /**\n * Callback invoked when the user presses Enter while focused in the field.\n */\n onCommit?: (value: string) => void;\n\n /**\n * Callback invoked each time the user changes the value of the field. For example, if the user\n * types 'abcd', this callback will be called four times with the value as 'a', 'ab', 'abc' and 'abcd'\n * respectively.\n * @default undefined\n */\n onInput?: TextFieldInputProps['onInput'];\n\n /**\n * Callback invoked for keydown events on the input element.\n */\n onKeyDown?: TextFieldInputProps['onKeyDown'];\n\n /**\n * Callback invoked when focus enters the text field.\n */\n onFocus?: FocusWithinProps['onFocusWithin'];\n\n /**\n * Callback invoked when focus leaves the text field.\n */\n onBlur?: FocusWithinProps['onBlurWithin'];\n\n /**\n * Callback invoked when the field chrome is pressed.\n */\n onMouseDown?: MouseDownProps['onMouseDown'];\n\n /**\n * Callback invoked when the field is clicked or tapped.\n */\n onClick?: ClickProps['onClick'];\n\n /**\n * Ref for the underlying input element.\n */\n inputRef?: Ref<HTMLInputElement>;\n\n /**\n * ID of the currently active suggestion option announced to assistive technologies.\n */\n ariaActiveDescendant?: UnpackSignals<JSX.AriaAttributes>['aria-activedescendant'];\n\n /**\n * Indicates that the field can present inline/list autocomplete behavior.\n */\n ariaAutoComplete?: TextFieldInputProps['aria-autocomplete'];\n\n /**\n * Associates the interactive input with descriptive text.\n */\n ariaDescribedBy?: TextFieldInputProps['aria-describedby'];\n\n /**\n * Indicates that suggestion content is still loading.\n */\n ariaBusy?: UnpackSignals<JSX.AriaAttributes>['aria-busy'];\n\n /**\n * Associates the input with the popup element that contains suggestions.\n */\n ariaControls?: UnpackSignals<JSX.AriaAttributes>['aria-controls'];\n\n /**\n * Reflects whether the suggestions popup is currently expanded.\n */\n ariaExpanded?: UnpackSignals<JSX.AriaAttributes>['aria-expanded'];\n\n /**\n * Identifies the popup type exposed by the search field when suggestions are available.\n */\n ariaHasPopup?: UnpackSignals<JSX.AriaAttributes>['aria-haspopup'];\n\n /**\n * Renders a display-only launcher field for phone overlays.\n */\n displayOnly?: boolean;\n\n /**\n * Optional start content override used by the mobile overlay header.\n */\n startContent?: ComponentChildren;\n\n /**\n * Optional end content override used by the mobile overlay header.\n */\n endContent?: ComponentChildren;\n\n /**\n * Native autocomplete value forwarded to the interactive input element.\n */\n autoComplete?: TextFieldInputProps['autoComplete'];\n\n /**\n * Spellcheck setting forwarded to the interactive input element.\n */\n spellcheck?: TextFieldInputProps['spellcheck'];\n\n /**\n * Visual style variant forwarded to the underlying TextField container.\n */\n textFieldStyleVariant?: TextFieldProps['styleVariant'];\n\n /**\n * The display variant of the component. The hero variant increases padding and font size to make\n * the component more prominent (e.g., on a landing page or header). It is not affected by\n * compact-density settings.\n * @default 'standard'\n */\n variant?: 'hero' | 'standard';\n};\n\n/**\n * An InputSearch displays a text field optimized for search with search icon.\n */\nconst InputSearchBase = forwardRef(\n (\n {\n displayOnly = false,\n endContent,\n ariaActiveDescendant,\n ariaAutoComplete,\n ariaDescribedBy,\n ariaBusy,\n ariaControls,\n ariaExpanded,\n ariaHasPopup,\n autoComplete,\n floatingAutocompleteText,\n liveRegionText,\n inputRef,\n spellcheck,\n variant = 'standard',\n onBlur,\n onClick,\n onCommit,\n onFocus,\n onInput,\n onKeyDown,\n onMouseDown,\n placeholder,\n startContent,\n textFieldStyleVariant,\n testId,\n type,\n value\n }: Props,\n ref?: Ref<FocusableHandle>\n ) => {\n const translations = useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\n // TODO: get final verdict from UX if aria label is customizable. always use the translation for now.\n const ariaLabel = translations.accSearch();\n const enabledElementRef = useRef<HTMLInputElement>(null);\n const readonlyElementRef = useRef<HTMLDivElement>(null);\n const { isTabbable, tabbableModeProps } = useTabbableMode();\n\n const {\n focusProps,\n isFocused,\n methods: focusMethods\n } = useFocusableTextField<HTMLInputElement, HTMLDivElement>({\n enabledElementRef,\n isReadonly: displayOnly,\n readonlyElementRef,\n onBlurWithin: onBlur,\n onFocusWithin: onFocus\n });\n\n const { formFieldContext, inputProps, textFieldProps } = useTextField({\n isFocused,\n value\n });\n\n // Sync combobox state onto the actual inner input because TextFieldInput does not\n // forward every aria prop we need for the suggestion popup relationship.\n useEffect(() => {\n const inputElement = enabledElementRef.current;\n\n if (!inputElement) {\n return;\n }\n\n // Sync ARIA attributes that TextFieldInput does not forward to the inner input.\n // Keep these writes explicit instead of looping over attribute names so JAF does not\n // flag the DOM mutation as an untagged dynamic setAttribute call.\n if (ariaActiveDescendant === undefined) {\n inputElement.removeAttribute('aria-activedescendant');\n } else {\n inputElement.setAttribute('aria-activedescendant', String(ariaActiveDescendant));\n }\n\n if (ariaBusy) {\n inputElement.setAttribute('aria-busy', 'true');\n } else {\n inputElement.removeAttribute('aria-busy');\n }\n\n if (ariaHasPopup === undefined) {\n inputElement.removeAttribute('aria-haspopup');\n } else {\n inputElement.setAttribute('aria-haspopup', String(ariaHasPopup));\n }\n }, [ariaActiveDescendant, ariaBusy, ariaHasPopup]);\n\n // InputSearch commits only on explicit submit actions, not on blur. Because TextFieldInput's\n // generic commit handling is tied to blur-based commit behavior, InputSearchBase handles Enter clicks\n // directly and translates them into the commit event consumed by the parent InputSearch.\n const handleKeyDown = useCallback(\n (event: KeyboardEvent) => {\n onKeyDown?.(event);\n\n if (!event.defaultPrevented && event.key === 'Enter' && !event.repeat) {\n const currentValue = (event.currentTarget as HTMLInputElement).value;\n // Only dispatch the current value. The parent InputSearch is responsible for deciding\n // whether this explicit submit should emit an onCommit detail event.\n onCommit?.(currentValue);\n }\n },\n [onCommit, onKeyDown]\n );\n\n // Keep the merged ref stable unless the caller-provided input ref changes.\n const mergedInputRef = useMemo(\n () => mergeRefs<HTMLInputElement>(enabledElementRef, inputRef),\n [inputRef]\n );\n\n // The phone launcher is display-only markup, so it forwards key events to the parent\n // InputSearch logic instead of trying to implement combobox keyboard behavior here.\n const handleDisplayOnlyKeyDown = useCallback(\n (event: KeyboardEvent) => {\n onKeyDown?.(event as never);\n },\n [onKeyDown]\n );\n\n useImperativeHandle(ref!, () => focusMethods, [focusMethods]);\n\n const { styles: inputSearchStyles, variantClasses: iconClasses } = useComponentTheme<\n InputSearchVariantOptions,\n InputSearchStyles\n >(InputSearchRedwoodTheme, {\n target: 'icon',\n variant\n });\n\n const hasSuggestionsPopup = ariaControls !== undefined;\n const floatingAutocomplete =\n !displayOnly && floatingAutocompleteText ? (\n <div aria-hidden=\"true\" className={inputSearchStyles.floatingAutocompleteContainer}>\n <span className={inputSearchStyles.floatingAutocompleteHiddenValue}>{value ?? ''}</span>\n <span className={inputSearchStyles.floatingAutocompleteText}>\n {'\\xa0\\u2014\\xa0'}\n {floatingAutocompleteText}\n </span>\n </div>\n ) : null;\n\n const mainContent = displayOnly ? (\n <div\n className={inputSearchStyles.displayContents}\n onClickCapture={onClick}\n onMouseDownCapture={onMouseDown}>\n <div className={inputSearchStyles.mobileLauncherContainer}>\n <div\n aria-busy={ariaBusy}\n aria-controls={ariaControls}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-label={ariaLabel}\n className={inputSearchStyles.mobileLauncher}\n onKeyDown={handleDisplayOnlyKeyDown}\n onBlur={focusProps.onFocusOut}\n onFocus={focusProps.onFocusIn}\n ref={readonlyElementRef}\n role={hasSuggestionsPopup ? 'combobox' : undefined}\n {...(isTabbable ? { tabIndex: 0 } : tabbableModeProps)}>\n <span className={inputSearchStyles.mobileLauncherContent}>\n <Text variant={value ? 'inherit' : 'secondary'}>{value || placeholder}</Text>\n </span>\n </div>\n </div>\n </div>\n ) : (\n <div\n className={inputSearchStyles.displayContents}\n onClickCapture={onClick}\n onMouseDownCapture={onMouseDown}>\n <TextFieldInput\n {...inputProps}\n aria-activedescendant={ariaActiveDescendant}\n aria-label={ariaLabel}\n aria-autocomplete={ariaAutoComplete}\n aria-busy={ariaBusy}\n aria-controls={ariaControls}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n autoComplete={autoComplete}\n hasEndContent={endContent !== undefined}\n hasStartContent={startContent !== undefined}\n inputRef={mergedInputRef}\n placeholder={placeholder}\n role={hasSuggestionsPopup ? 'combobox' : undefined}\n spellcheck={spellcheck}\n value={value}\n type={type}\n onInput={onInput}\n onKeyDown={handleKeyDown}\n />\n <LiveRegion>{liveRegionText}</LiveRegion>\n {floatingAutocomplete}\n </div>\n );\n\n const searchIcon = (\n // wrapper needed to properly position and size the icon within the TextField for hero variant\n <span className={iconClasses}>\n <Search />\n </span>\n );\n\n return (\n <FormFieldContext.Provider value={formFieldContext}>\n {/* In display-only mobile mode, clicks can land on TextField chrome outside the launcher\n content. Capture them here so the parent InputSearch still opens the overlay. */}\n <div\n className={inputSearchStyles.displayContents}\n onClickCapture={displayOnly ? onClick : undefined}>\n <TextField\n {...textFieldProps}\n endContent={endContent}\n mainContent={mainContent}\n startContent={startContent ?? searchIcon}\n styleVariant={textFieldStyleVariant ?? textFieldProps.styleVariant}\n onBlur={displayOnly ? undefined : focusProps.onFocusOut}\n onFocus={displayOnly ? undefined : focusProps.onFocusIn}\n onMouseDown={onMouseDown}\n testId={testId !== undefined ? `${testId}-base` : undefined}\n />\n </div>\n </FormFieldContext.Provider>\n );\n }\n);\n\nexport { InputSearchBase };\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * Licensed under The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport { error } from '#utils/UNSAFE_logger';\nimport { getClientHints } from '#utils/PRIVATE_clientHints';\nimport type {\n Data,\n InputSearchSuggestion,\n InputSearchSuggestionItemContext,\n InputSearchSuggestionItemText\n} from './InputSearch';\n\nconst loggedSuggestionItemTextErrors = new Set<string>();\n\nfunction logSuggestionItemTextErrorOnce(message: string) {\n // UNSAFE_logger does not dedupe repeated messages, so guard invalid prop logs locally.\n if (loggedSuggestionItemTextErrors.has(message)) {\n return;\n }\n\n loggedSuggestionItemTextErrors.add(message);\n error(() => message);\n}\n\n/**\n * Helper function to determine whether the current device is a phone.\n */\nexport function isPhone() {\n return getClientHints().deviceType === 'phone';\n}\n\n/**\n * Returns whether suggestion display text contains the current query text.\n */\nexport function suggestionTextContainsQuery(suggestionText: string, query: string) {\n const normalizedQuery = query.toLowerCase();\n return normalizedQuery !== '' && suggestionText.toLowerCase().includes(normalizedQuery);\n}\n\n/**\n * Returns whether any top-level primitive suggestion value contains the current query text.\n */\nexport function suggestionDataContainsQuery<T extends InputSearchSuggestion<Data>>(\n suggestion: T,\n query: string\n) {\n const normalizedQuery = query.toLowerCase();\n\n if (normalizedQuery === '') {\n return false;\n }\n\n return Object.values(suggestion).some((value) => {\n if (typeof value === 'string') {\n return value.toLowerCase().includes(normalizedQuery);\n }\n\n if (typeof value === 'number') {\n return String(value).includes(normalizedQuery);\n }\n\n return false;\n });\n}\n\ntype GetItemTextOptions<T extends InputSearchSuggestion<Data>> = {\n index?: number;\n suggestionItemText?: InputSearchSuggestionItemText<T>;\n};\n/**\n * Derive the display text for an item, defaulting to the `label` field.\n */\nexport function getItemText<T extends InputSearchSuggestion<Data>>(\n item: T,\n { index = -1, suggestionItemText }: GetItemTextOptions<T> = {}\n): string {\n const resolvedItemText = suggestionItemText;\n\n if (resolvedItemText == null) {\n // Keep the default path cheap by reading the conventional `label` field directly.\n return typeof item['label'] === 'string' ? item['label'] : '';\n }\n\n if (typeof resolvedItemText === 'string') {\n if (Object.prototype.hasOwnProperty.call(item, resolvedItemText)) {\n const itemTextValue = item[resolvedItemText];\n\n if (typeof itemTextValue === 'string') {\n return itemTextValue;\n }\n\n if (itemTextValue === undefined) {\n return '';\n }\n\n logSuggestionItemTextErrorOnce(\n `InputSearch: suggestionItemText field must resolve to a string: ${resolvedItemText}`\n );\n return '';\n }\n\n // Invalid field names should not break rendering; log and render an empty string instead.\n logSuggestionItemTextErrorOnce(\n `InputSearch: suggestionItemText specifies field that does not exist: ${resolvedItemText}`\n );\n return '';\n }\n\n if (typeof suggestionItemText === 'function') {\n // Callbacks can derive text from the full item plus its position in the rendered list.\n return suggestionItemText({\n data: item,\n index\n } satisfies InputSearchSuggestionItemContext<T>);\n }\n\n return '';\n}\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * Licensed under The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport type { ComponentChildren } from 'preact';\nimport { useCallback, useEffect, useMemo, useRef } from 'preact/hooks';\nimport type { CollectionData } from '#UNSAFE_Collection';\nimport { List } from '#PRIVATE_TableList';\nimport { dropdownStyles } from '#PRIVATE_SelectCommon/themes/dropdownStyles.css';\nimport { useComponentTheme } from '#hooks/UNSAFE_useComponentTheme';\nimport { HighlightText } from '#UNSAFE_HighlightText';\nimport { Skeleton } from '#UNSAFE_Skeleton';\nimport { classNames } from '#utils/UNSAFE_classNames';\nimport type {\n Data,\n InputSearchSuggestionItemRendererProps,\n InputSearchSuggestionItemText,\n InputSearchSuggestion\n} from './InputSearch';\nimport type { InputSearchStyles } from './themes/InputSearchStyles.css';\nimport { InputSearchRedwoodTheme } from './themes/redwood/InputSearchTheme';\nimport { getItemText } from './utils';\n\nconst LIST_GRIDLINES = { item: 'hidden', top: 'hidden', bottom: 'hidden' } as const;\n\n/**\n * Props for the shared suggestion list content rendered by desktop and phone InputSearch popups.\n */\ntype InputSearchSuggestionsProps<T extends InputSearchSuggestion<Data>> = {\n /**\n * Accessible label applied to the rendered listbox.\n */\n ariaLabel: string;\n\n /**\n * Generates the option id used by `aria-activedescendant`.\n */\n getOptionId: (index: number) => string;\n\n /**\n * Pointer-hovered suggestion index.\n */\n hoveredIndex: number;\n\n /**\n * Base id for the listbox element.\n */\n id: string;\n\n /**\n * Distinguishes pointer highlight from keyboard-managed focus.\n */\n interactionMode?: 'keyboard' | 'pointer';\n\n /**\n * Whether loading skeletons should render instead of suggestion options.\n */\n isLoading: boolean;\n\n /**\n * Optional custom renderer for each suggestion row.\n */\n suggestionItemRenderer?: (\n suggestionItemRendererProps: InputSearchSuggestionItemRendererProps<T>\n ) => ComponentChildren;\n\n /**\n * Optional text mapping for default suggestion rendering.\n */\n suggestionItemText?: InputSearchSuggestionItemText<T>;\n\n /**\n * Keyboard-focused suggestion index.\n */\n keyboardFocusedIndex: number;\n\n /**\n * Whether to draw the keyboard focus indicator for the active suggestion.\n */\n showKeyboardFocusIndicator: boolean;\n\n /**\n * Skeleton row count used while loading.\n */\n loadingSkeletonCount: number;\n\n /**\n * Mutable option element registry for aria/focus coordination.\n */\n optionRefs: (HTMLElement | null)[];\n\n /**\n * Updates the hovered suggestion index.\n */\n onHoverIndexChange: (index: number) => void;\n\n /**\n * Clears pointer hover state when the pointer leaves the list.\n */\n onPointerLeave?: () => void;\n\n /**\n * Commits a selected suggestion back to InputSearch.\n */\n onSuggestionSelection: (suggestion: T, index: number) => void;\n\n /**\n * Current user-entered text used for highlight rendering.\n */\n searchText: string;\n\n /**\n * Suggestions currently available for rendering.\n */\n suggestions: readonly T[];\n};\n\n/**\n * Renders the shared InputSearch suggestion listbox content used by desktop popups\n * and the mobile fullscreen overlay.\n *\n * @template T The suggestion item shape rendered in the list.\n */\nexport function InputSearchSuggestions<T extends InputSearchSuggestion<Data>>({\n ariaLabel,\n getOptionId,\n hoveredIndex,\n id,\n interactionMode,\n isLoading,\n suggestionItemText,\n suggestionItemRenderer,\n keyboardFocusedIndex,\n showKeyboardFocusIndicator,\n loadingSkeletonCount,\n optionRefs,\n onHoverIndexChange,\n onPointerLeave,\n onSuggestionSelection,\n searchText,\n suggestions\n}: InputSearchSuggestionsProps<T>) {\n const {\n styles: { focusRingStyle, item, listbox }\n } = useComponentTheme<never, InputSearchStyles>(InputSearchRedwoodTheme);\n const listWrapperRef = useRef<HTMLDivElement>(null);\n\n // Determines which suggestion row should receive visual highlight treatment.\n //\n // Priority order (most to least preferred):\n // 1. Pointer hover when user is actively using mouse/touch (interactionMode === 'pointer')\n // 2. Keyboard focus (via aria-activedescendant or arrow navigation)\n // 3. Fallback to any hover state\n //\n // This ensures commit behavior (Enter key or click) stays aligned with what the\n // user is visually focused on. The List component uses currentItemOverride\n // to drive its internal highlight state.\n const visualActiveIndex =\n interactionMode === 'pointer' && hoveredIndex >= 0\n ? hoveredIndex\n : keyboardFocusedIndex >= 0\n ? keyboardFocusedIndex\n : hoveredIndex >= 0\n ? hoveredIndex\n : undefined;\n const collectionData = useMemo<CollectionData<number, T>[]>(\n () =>\n suggestions.map((suggestion, index) => ({\n data: suggestion,\n metadata: { key: index }\n })),\n [suggestions]\n );\n const currentItemOverride = useMemo(\n () => (visualActiveIndex !== undefined ? { rowKey: visualActiveIndex } : undefined),\n [visualActiveIndex]\n );\n const currentItemVariant = visualActiveIndex !== undefined ? 'highlight' : 'none';\n\n // Map List-owned DOM events back to the suggestion array index.\n const getOptionIndex = useCallback(\n (element: EventTarget | null) => {\n const optionElement = (element as HTMLElement | null)?.closest(\n '[role=\"option\"]'\n ) as HTMLElement | null;\n if (!optionElement) {\n return -1;\n }\n\n const registeredOptionIndex = optionRefs.indexOf(optionElement);\n if (registeredOptionIndex >= 0) {\n return registeredOptionIndex;\n }\n\n const optionElements =\n listWrapperRef.current?.querySelectorAll<HTMLElement>('[role=\"option\"]');\n return optionElements ? Array.prototype.indexOf.call(optionElements, optionElement) : -1;\n },\n [optionRefs]\n );\n\n const handleSuggestionMouseDown = useCallback(\n (event: MouseEvent) => {\n const optionIndex = getOptionIndex(event.target);\n if (optionIndex < 0) {\n return;\n }\n\n // Keep focus on the active search field until click selection completes.\n event.preventDefault();\n },\n [getOptionIndex]\n );\n\n // Commit the suggestion associated with the pressed option after pointer release.\n const handleSuggestionAction = useCallback(\n (event: MouseEvent) => {\n const optionIndex = getOptionIndex(event.target);\n if (optionIndex < 0) {\n return;\n }\n\n const suggestion = suggestions[optionIndex];\n if (!suggestion) {\n return;\n }\n\n onSuggestionSelection(suggestion, optionIndex);\n event.stopPropagation();\n },\n [getOptionIndex, onSuggestionSelection, suggestions]\n );\n\n // Track pointer hover as an index so the visual highlight can stay independent of keyboard focus.\n const handleSuggestionHover = useCallback(\n (event: Event) => {\n const optionIndex = getOptionIndex(event.target);\n if (optionIndex >= 0) {\n onHoverIndexChange(optionIndex);\n }\n },\n [getOptionIndex, onHoverIndexChange]\n );\n\n // Synchronize List-created option ids and refs after render so aria-activedescendant\n // can reference the correct DOM node even though List owns the option elements.\n useEffect(() => {\n optionRefs.length = 0;\n\n if (isLoading) {\n return;\n }\n\n const listboxElement = listWrapperRef.current?.querySelector<HTMLElement>('[role=\"listbox\"]');\n\n if (listboxElement) {\n listboxElement.id = id;\n }\n\n if (suggestions.length === 0) {\n return;\n }\n\n const optionElements = listWrapperRef.current?.querySelectorAll<HTMLElement>('[role=\"option\"]');\n\n optionElements?.forEach((element, index) => {\n element.id = getOptionId(index);\n optionRefs[index] = element;\n });\n }, [getOptionId, id, isLoading, optionRefs, suggestions]);\n\n if (isLoading) {\n return (\n <div\n aria-busy=\"true\"\n aria-label={ariaLabel}\n class={listbox}\n id={id}\n role=\"listbox\"\n tabIndex={-1}>\n {Array.from({ length: Math.max(1, loadingSkeletonCount) }, (_, index) => (\n <div key={`${id}-${index}`} class={item} role=\"presentation\">\n <Skeleton height=\"4x\" />\n </div>\n ))}\n </div>\n );\n }\n\n return (\n <div\n class={listbox}\n ref={listWrapperRef}\n onMouseDownCapture={handleSuggestionMouseDown}\n onMouseUpCapture={handleSuggestionAction}\n onPointerOverCapture={handleSuggestionHover}\n onPointerMoveCapture={handleSuggestionHover}\n onPointerLeave={onPointerLeave}\n onPointerCancel={onPointerLeave}>\n <List<number, T>\n aria-label={ariaLabel}\n collectionData={collectionData}\n currentItemOverride={currentItemOverride}\n currentItemVariant={currentItemVariant}\n gridlines={LIST_GRIDLINES}\n itemPadding=\"disabled\"\n role=\"listbox\">\n {({ data: suggestion, index }) => (\n <div\n class={classNames([\n dropdownStyles.singleSelectItem,\n index === keyboardFocusedIndex && showKeyboardFocusIndicator && focusRingStyle\n ])}>\n {suggestionItemRenderer ? (\n suggestionItemRenderer({\n data: suggestion,\n index,\n searchText: searchText === '' ? undefined : searchText\n })\n ) : (\n <HighlightText matchText={searchText}>\n {getItemText(suggestion, {\n index,\n suggestionItemText\n })}\n </HighlightText>\n )}\n </div>\n )}\n </List>\n </div>\n );\n}\n\nexport type { InputSearchSuggestionsProps };\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * Licensed under The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport type { ComponentChildren, RefObject } from 'preact';\nimport { useEffect } from 'preact/hooks';\nimport { Dropdown, DropdownList } from '#PRIVATE_SelectCommon';\nimport { useTranslationBundle } from '#hooks/UNSAFE_useTranslationBundle';\nimport type { BundleType } from '#resources/nls/bundle';\nimport type {\n Data,\n InputSearchCollectionRendererProps,\n InputSearchSuggestion\n} from './InputSearch';\nimport { styles as inputSearchStyles } from './themes/InputSearchStyles.css';\nimport { InputSearchSuggestions } from './InputSearchSuggestions';\nimport type { InputSearchSuggestionsProps } from './InputSearchSuggestions';\n\n/**\n * Props for the desktop-only suggestion popup content shared between loading and loaded states.\n */\ntype Props<T extends InputSearchSuggestion<Data>> = {\n /** Input element used to position the dropdown. */\n anchorRef: RefObject<HTMLElement>;\n /** Wrapper around collection-mode content for focus management. */\n collectionContainerRef: RefObject<HTMLDivElement>;\n /** Optional collection renderer used in collection mode. */\n collectionRenderer?: (props: InputSearchCollectionRendererProps<T>) => ComponentChildren;\n /** Collection renderer context shared across surfaces. */\n collectionRendererContext: InputSearchCollectionRendererProps<T>;\n /** Root dropdown element reference for popup measurement and dismissal. */\n dropdownRef: RefObject<HTMLDivElement>;\n /** Generates the option id used by `aria-activedescendant`. */\n getOptionId: (index: number) => string;\n /** Pointer-hovered suggestion index. */\n hoveredIndex: number;\n /** Base id for the listbox and popup content. */\n id: string;\n /** Distinguishes pointer highlight from keyboard-managed focus. */\n interactionMode?: 'keyboard' | 'pointer';\n /** Optional text mapping for default suggestion rendering. */\n suggestionItemText?: InputSearchSuggestionsProps<T>['suggestionItemText'];\n /** Optional custom renderer for each suggestion row. */\n suggestionItemRenderer?: InputSearchSuggestionsProps<T>['suggestionItemRenderer'];\n /** Whether the popup should render loading skeletons instead of suggestions. */\n isLoading: boolean;\n /** Whether collection mode is active. */\n isCollectionMode: boolean;\n /** Whether the dropdown is currently open. */\n isOpen: boolean;\n /** Keyboard-focused suggestion index used for active descendant and commit. */\n keyboardFocusedIndex: number;\n /** Whether to draw the keyboard focus indicator for the active suggestion. */\n showKeyboardFocusIndicator: boolean;\n /** Skeleton row count used to preserve popup height during async loads. */\n loadingSkeletonCount: number;\n /** Dismiss callback forwarded to the popup container. */\n onAutoDismiss: (event?: Event) => void;\n /** Converts collection row clicks into row-action commits. */\n onCollectionClickCapture: (event: MouseEvent) => void;\n /** Handles Escape while focus is inside the rendered collection. */\n onCollectionKeyDownCapture: (event: KeyboardEvent) => void;\n /** Handles focus leaving the rendered collection. */\n onCollectionFocusOut: (event: FocusEvent) => void;\n /** Mutable option element registry for keyboard navigation and aria wiring. */\n optionRefs: (HTMLElement | null)[];\n /** Updates the hovered suggestion index. */\n onHoverIndexChange: (index: number) => void;\n /** Clears pointer hover state when the pointer leaves the popup. */\n onPointerLeave: () => void;\n /** Commits a selected suggestion back to `InputSearch`. */\n onSuggestionSelection: (suggestion: T, index: number) => void;\n /** Current user-entered text used for highlight rendering. */\n searchText: string;\n /** Suggestions currently available for rendering. */\n suggestions: readonly T[];\n};\n\n/**\n * Renders the desktop InputSearch popup and keeps listbox option ids aligned with\n * the input's active-descendant model.\n */\nexport function InputSearchDesktopSuggestions<T extends InputSearchSuggestion<Data>>({\n anchorRef,\n collectionContainerRef,\n collectionRenderer,\n collectionRendererContext,\n dropdownRef,\n getOptionId,\n hoveredIndex,\n id,\n interactionMode,\n isCollectionMode,\n isLoading,\n suggestionItemText,\n suggestionItemRenderer,\n isOpen,\n keyboardFocusedIndex,\n showKeyboardFocusIndicator,\n loadingSkeletonCount,\n onAutoDismiss,\n onCollectionClickCapture,\n onCollectionFocusOut,\n onCollectionKeyDownCapture,\n optionRefs,\n onHoverIndexChange,\n onPointerLeave,\n onSuggestionSelection,\n searchText,\n suggestions\n}: Props<T>) {\n const translations = useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\n const ariaLabel = translations.accSearch();\n\n // The collection renderer can mount table/list internals asynchronously. Keep the rendered\n // collection labelled even when the actual grid/listbox appears after the popup opens. The\n // renderer dependency also gives swapped renderers a synchronous label pass before observation.\n useEffect(() => {\n if (!isCollectionMode) {\n return;\n }\n\n const collectionContainer = collectionContainerRef.current;\n if (!collectionContainer) {\n return;\n }\n\n const applyCollectionLabel = () => {\n const tableElement = collectionContainer.querySelector<HTMLElement>(\n '[role=\"grid\"], [role=\"treegrid\"]'\n );\n const listElement = collectionContainer.querySelector<HTMLElement>(\n '[role=\"listbox\"], [role=\"list\"]'\n );\n\n if (tableElement && !tableElement.hasAttribute('aria-label')) {\n tableElement.setAttribute('aria-label', ariaLabel);\n return;\n }\n\n if (listElement && !listElement.hasAttribute('aria-label')) {\n listElement.setAttribute('aria-label', ariaLabel);\n }\n };\n\n applyCollectionLabel();\n\n if (typeof MutationObserver === 'undefined') {\n return;\n }\n\n const observer = new MutationObserver(() => {\n applyCollectionLabel();\n });\n\n observer.observe(collectionContainer, { childList: true, subtree: true });\n\n return () => {\n observer.disconnect();\n };\n }, [ariaLabel, collectionContainerRef, collectionRenderer, isCollectionMode]);\n\n return (\n <Dropdown\n anchorRef={anchorRef}\n dropdownRef={dropdownRef}\n id={`${id}-popup`}\n isOpen={isOpen}\n onAutoDismiss={onAutoDismiss}>\n <DropdownList hasBottomGap={true} hasTopGap={true} id={`${id}-content`} isLoading={isLoading}>\n {isCollectionMode && collectionRenderer ? (\n <div\n aria-label={ariaLabel}\n id={id}\n onClickCapture={onCollectionClickCapture}\n onFocusOut={onCollectionFocusOut}\n onKeyDownCapture={onCollectionKeyDownCapture}\n ref={collectionContainerRef}\n role=\"dialog\">\n <div class={inputSearchStyles.collectionWrapper}>\n {collectionRenderer(collectionRendererContext)}\n </div>\n </div>\n ) : (\n <InputSearchSuggestions\n ariaLabel={ariaLabel}\n getOptionId={getOptionId}\n hoveredIndex={hoveredIndex}\n id={id}\n interactionMode={interactionMode}\n isLoading={isLoading}\n keyboardFocusedIndex={keyboardFocusedIndex}\n showKeyboardFocusIndicator={showKeyboardFocusIndicator}\n loadingSkeletonCount={loadingSkeletonCount}\n suggestionItemRenderer={suggestionItemRenderer}\n suggestionItemText={suggestionItemText}\n onHoverIndexChange={onHoverIndexChange}\n onPointerLeave={onPointerLeave}\n onSuggestionSelection={onSuggestionSelection}\n optionRefs={optionRefs}\n searchText={searchText}\n suggestions={suggestions}\n />\n )}\n </DropdownList>\n </Dropdown>\n );\n}\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * Licensed under The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport type { ComponentChildren, ComponentProps, Ref, RefObject } from 'preact';\nimport { useEffect } from 'preact/hooks';\nimport { ClearIcon } from '#PRIVATE_ClearIcon/ClearIcon';\nimport { DropdownList, SelectMobileDropdown } from '#PRIVATE_SelectCommon';\nimport { HiddenAccessible } from '#UNSAFE_HiddenAccessible';\nimport { IconButton } from '#UNSAFE_IconButton';\nimport { NavLeft } from '#UNSAFE_RedwoodIcons/NavLeft';\nimport type { FocusableHandle } from '#hooks/UNSAFE_useFocusableTextField';\nimport { useTranslationBundle } from '#hooks/UNSAFE_useTranslationBundle';\nimport type { BundleType } from '#resources/nls/bundle';\nimport type {\n Data,\n InputSearchCollectionRendererProps,\n InputSearchSuggestion\n} from './InputSearch';\nimport { InputSearchBase } from './InputSearchBase';\nimport { InputSearchSuggestions, type InputSearchSuggestionsProps } from './InputSearchSuggestions';\nimport { styles as inputSearchStyles } from './themes/InputSearchStyles.css';\n\n/**\n * Suggestion-list props forwarded directly to the shared overlay list renderer.\n */\ntype PickedInputSearchSuggestionsProps<T extends InputSearchSuggestion<Data>> = Pick<\n InputSearchSuggestionsProps<T>,\n | 'getOptionId'\n | 'hoveredIndex'\n | 'id'\n | 'interactionMode'\n | 'isLoading'\n | 'suggestionItemRenderer'\n | 'suggestionItemText'\n | 'keyboardFocusedIndex'\n | 'showKeyboardFocusIndicator'\n | 'loadingSkeletonCount'\n | 'onHoverIndexChange'\n | 'onPointerLeave'\n | 'onSuggestionSelection'\n | 'optionRefs'\n | 'searchText'\n | 'suggestions'\n>;\n\ntype InputSearchBaseProps = ComponentProps<typeof InputSearchBase>;\n\n/**\n * Props for the mobile full-screen InputSearch overlay.\n */\ntype Props<T extends InputSearchSuggestion<Data>> = PickedInputSearchSuggestionsProps<T> & {\n /**\n * ID of the keyboard-active option mirrored onto the overlay input.\n */\n activeDescendantId?: string;\n\n /**\n * Announces whether overlay suggestions support inline autocomplete.\n */\n ariaAutoComplete?: InputSearchBaseProps['ariaAutoComplete'];\n\n /**\n * Associates the overlay input with descriptive text.\n */\n ariaDescribedBy?: InputSearchBaseProps['ariaDescribedBy'];\n\n /**\n * Wrapper around collection-mode content for focus management.\n */\n collectionContainerRef: RefObject<HTMLDivElement>;\n\n /**\n * Optional collection renderer used in collection mode.\n */\n collectionRenderer?: (props: InputSearchCollectionRendererProps<T>) => ComponentChildren;\n\n /**\n * Collection renderer context shared across surfaces.\n */\n collectionRendererContext: InputSearchCollectionRendererProps<T>;\n\n /**\n * Ref for the interactive input element rendered in the overlay header.\n */\n inputRef?: InputSearchBaseProps['inputRef'];\n\n /**\n * Imperative handle exposed while the mobile overlay field is the active input.\n */\n inputSearchRef?: Ref<FocusableHandle>;\n\n /**\n * Whether the full-screen mobile overlay is currently open.\n */\n isOpen: boolean;\n\n /**\n * Whether collection mode is active.\n */\n isCollectionMode: boolean;\n\n /**\n * Value displayed in the overlay input, including any inline autocomplete preview.\n */\n renderedValue: string;\n\n /**\n * Assistive text announced from the overlay field's live region.\n */\n liveRegionText?: InputSearchBaseProps['liveRegionText'];\n\n /**\n * Callback invoked when focus leaves the overlay input.\n */\n onBlur?: InputSearchBaseProps['onBlur'];\n\n /**\n * Clears the current query from the overlay input.\n */\n onClear: () => void;\n\n /**\n * Closes the mobile overlay without committing a new value.\n */\n onClose: () => void;\n\n /**\n * Commits the current overlay input value.\n */\n onCommit: (value: string) => void;\n\n /**\n * Handles pointer selection while focus is inside the rendered collection.\n */\n onCollectionClickCapture: (event: MouseEvent) => void;\n\n /**\n * Handles focus leaving the rendered collection.\n */\n onCollectionFocusOut: (event: FocusEvent) => void;\n\n /**\n * Handles Escape while focus is inside the rendered collection.\n */\n onCollectionKeyDownCapture: (event: KeyboardEvent) => void;\n\n /**\n * Callback invoked when focus enters the overlay input.\n */\n onFocus?: InputSearchBaseProps['onFocus'];\n\n /**\n * Callback invoked when the overlay input value changes.\n */\n onInput?: InputSearchBaseProps['onInput'];\n\n /**\n * Handles keyboard navigation and submission keys from the overlay input.\n */\n onKeyDown?: InputSearchBaseProps['onKeyDown'];\n\n /**\n * Placeholder text shown inside the overlay input.\n */\n placeholder?: string;\n\n /**\n * ID of the mobile dialog container and the basis for its hidden label id.\n */\n popupId: string;\n\n /**\n * Root test id used to derive stable hooks for internal mobile affordances.\n */\n testId?: string;\n};\n\n/**\n * Renders the phone-specific full-screen InputSearch overlay, including the search field\n * in the header and the shared suggestions list in the body.\n */\nexport function InputSearchMobileDropdown<T extends InputSearchSuggestion<Data>>({\n activeDescendantId,\n ariaAutoComplete,\n ariaDescribedBy,\n collectionContainerRef,\n collectionRenderer,\n collectionRendererContext,\n getOptionId,\n hoveredIndex,\n id,\n inputRef,\n inputSearchRef,\n interactionMode,\n isCollectionMode,\n isLoading,\n suggestionItemText,\n suggestionItemRenderer,\n isOpen,\n liveRegionText,\n keyboardFocusedIndex,\n showKeyboardFocusIndicator,\n loadingSkeletonCount,\n onBlur,\n onClear,\n onClose,\n onCollectionClickCapture,\n onCollectionFocusOut,\n onCollectionKeyDownCapture,\n onCommit,\n onFocus,\n onHoverIndexChange,\n onInput,\n onKeyDown,\n onPointerLeave,\n onSuggestionSelection,\n optionRefs,\n placeholder,\n popupId,\n renderedValue,\n searchText,\n suggestions,\n testId\n}: Props<T>) {\n const translations = useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\n const backButtonAriaLabel = translations.selectMultiple_back();\n const searchAriaLabel = translations.accSearch();\n const dialogLabelId = `${popupId}-label`;\n // Only render the clear affordance when there is typed text to clear from the overlay field.\n const clearButtonTestId = testId !== undefined ? `${testId}-mobile-clear` : undefined;\n const endContent =\n searchText !== '' ? <ClearIcon onClick={onClear} testId={clearButtonTestId} /> : undefined;\n // Put the close/back action inside the field chrome so the header stays compact on phones.\n const startContent = (\n <IconButton aria-label={backButtonAriaLabel} onAction={onClose} size=\"xs\" variant=\"ghost\">\n <NavLeft />\n </IconButton>\n );\n\n // Collection renderers can mount their table/list body after the dialog itself. Reapply the\n // search label as those internals appear so the mobile collection popup remains named for\n // screen readers.\n // The renderer dependency also gives swapped renderers a synchronous label pass before observation.\n useEffect(() => {\n if (!isCollectionMode) {\n return;\n }\n\n const collectionContainer = collectionContainerRef.current;\n if (!collectionContainer) {\n return;\n }\n\n const applyCollectionLabel = () => {\n const tableElement = collectionContainer.querySelector<HTMLElement>(\n '[role=\"grid\"], [role=\"treegrid\"]'\n );\n const listElement = collectionContainer.querySelector<HTMLElement>(\n '[role=\"listbox\"], [role=\"list\"]'\n );\n\n if (tableElement && !tableElement.hasAttribute('aria-label')) {\n tableElement.setAttribute('aria-label', searchAriaLabel);\n return;\n }\n\n if (listElement && !listElement.hasAttribute('aria-label')) {\n listElement.setAttribute('aria-label', searchAriaLabel);\n }\n };\n\n applyCollectionLabel();\n\n if (typeof MutationObserver === 'undefined') {\n return;\n }\n\n const observer = new MutationObserver(() => {\n applyCollectionLabel();\n });\n\n observer.observe(collectionContainer, { childList: true, subtree: true });\n\n return () => {\n observer.disconnect();\n };\n }, [collectionContainerRef, collectionRenderer, isCollectionMode, searchAriaLabel]);\n\n return (\n <SelectMobileDropdown\n header={\n <>\n {/* The mobile dialog needs a label even though the visible header is composed from controls\n instead of a dedicated title element. */}\n <HiddenAccessible id={dialogLabelId}>{searchAriaLabel}</HiddenAccessible>\n <InputSearchBase\n ariaActiveDescendant={activeDescendantId}\n ariaAutoComplete={ariaAutoComplete}\n ariaBusy={isLoading ? true : undefined}\n ariaControls={isCollectionMode ? popupId : id}\n ariaDescribedBy={ariaDescribedBy}\n ariaExpanded={isOpen}\n ariaHasPopup={isCollectionMode ? 'dialog' : 'listbox'}\n autoComplete=\"off\"\n endContent={endContent}\n inputRef={inputRef}\n // iOS VoiceOver announces dialog updates reliably when the live region stays with the active input.\n liveRegionText={liveRegionText}\n onBlur={onBlur}\n onCommit={onCommit}\n onFocus={onFocus}\n onInput={onInput}\n onKeyDown={onKeyDown}\n placeholder={placeholder}\n ref={inputSearchRef}\n spellcheck={false}\n startContent={startContent}\n type=\"search\"\n value={renderedValue}\n />\n </>\n }\n id={popupId}\n isOpen={isOpen}\n labelId={dialogLabelId}>\n <DropdownList hasTopGap={!isCollectionMode} hasBottomGap={true} isLoading={isLoading}>\n {isCollectionMode && collectionRenderer ? (\n <div\n id={id}\n class={inputSearchStyles.collectionOuterWrapper}\n onClickCapture={onCollectionClickCapture}\n onFocusOut={onCollectionFocusOut}\n onKeyDownCapture={onCollectionKeyDownCapture}\n ref={collectionContainerRef}>\n <div class={inputSearchStyles.collectionWrapper}>\n {collectionRenderer(collectionRendererContext)}\n </div>\n </div>\n ) : (\n <InputSearchSuggestions\n ariaLabel={searchAriaLabel}\n getOptionId={getOptionId}\n hoveredIndex={hoveredIndex}\n id={id}\n interactionMode={interactionMode}\n isLoading={isLoading}\n keyboardFocusedIndex={keyboardFocusedIndex}\n showKeyboardFocusIndicator={showKeyboardFocusIndicator}\n loadingSkeletonCount={loadingSkeletonCount}\n onHoverIndexChange={onHoverIndexChange}\n onPointerLeave={onPointerLeave}\n onSuggestionSelection={onSuggestionSelection}\n optionRefs={optionRefs}\n searchText={searchText}\n suggestionItemRenderer={suggestionItemRenderer}\n suggestionItemText={suggestionItemText}\n suggestions={suggestions}\n />\n )}\n </DropdownList>\n </SelectMobileDropdown>\n );\n}\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * Licensed under The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport {\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState\n} from 'preact/hooks';\nimport type { ComponentProps } from 'preact';\nimport { error } from '#utils/UNSAFE_logger';\nimport type { ValueUpdateDetail } from '#utils/UNSAFE_valueUpdateDetail';\nimport type {\n Data,\n InputSearchCollectionItemContext,\n InputSearchCollectionRendererProps,\n InputSearchCommitDetail,\n Key,\n InputSearchSuggestion,\n InputSearchSuggestionItemKey,\n InputSearchSuggestionItemText\n} from './InputSearch';\nimport { InputSearchBase } from './InputSearchBase';\nimport {\n getItemText,\n isPhone,\n suggestionDataContainsQuery,\n suggestionTextContainsQuery\n} from './utils';\n\ntype SearchBaseProps = ComponentProps<typeof InputSearchBase>;\n\n// Mobile collection mode commits rows from captured taps. These descendants should own their\n// own tap/click behavior so tapping a nested button, link, input, etc. does not commit the row.\nconst interactiveCollectionDescendantSelector = [\n 'button',\n 'a[href]',\n 'input',\n 'select',\n 'textarea',\n 'summary',\n 'label',\n '[contenteditable=\"\"]',\n '[contenteditable=\"true\"]',\n '[role=\"button\"]',\n '[role=\"link\"]',\n '[role=\"checkbox\"]',\n '[role=\"combobox\"]',\n '[role=\"menuitem\"]',\n '[role=\"menuitemcheckbox\"]',\n '[role=\"menuitemradio\"]',\n '[role=\"radio\"]',\n '[role=\"slider\"]',\n '[role=\"spinbutton\"]',\n '[role=\"switch\"]',\n '[role=\"tab\"]',\n '[role=\"textbox\"]'\n].join(', ');\n// Collection renderers can expose focus and row markers either through InputSearch-specific\n// attributes or through the underlying JET table/list DOM that InputSearch integrates with.\nconst collectionFocusTargetSelectors = [\n '[data-oj-input-search-focus-target=\"true\"]',\n '[tabindex=\"0\"]',\n '[role=\"grid\"], [role=\"treegrid\"], [role=\"listbox\"]',\n 'oj-c-table, oj-c-list-view'\n] as const;\n// Shift+Tab boundary detection needs the real tabbable order inside the rendered collection so we\n// only override focus when the user is leaving from the first collection tab stop.\nconst collectionTabbableSelector = [\n 'button:not([disabled]):not([hidden])',\n '[href]:not([hidden])',\n 'input:not([disabled]):not([hidden])',\n 'select:not([disabled]):not([hidden])',\n 'textarea:not([disabled]):not([hidden])',\n '[tabindex]:not([tabindex=\"-1\"]):not([disabled]):not([hidden])',\n 'video:not([disabled]):not([hidden])',\n '[contenteditable]:not([contenteditable=\"false\"])'\n].join(', ');\nconst collectionKeyElementSelector = '[data-oj-key], [data-oj-input-search-key]';\n// Reuse shared empty collection structures so non-collection mode can skip the keyed work\n// without allocating fresh arrays/maps on every render.\nconst EMPTY_COLLECTION_ITEM_CONTEXTS: readonly InputSearchCollectionItemContext<\n InputSearchSuggestion<Data>\n>[] = [];\nconst EMPTY_COLLECTION_CONTEXT_MAP = new Map<\n Key,\n InputSearchCollectionItemContext<InputSearchSuggestion<Data>>\n>();\n// Collection wrappers can expose their focus target after asynchronous rendering settles. Ten\n// 50 ms retries give that work up to 500 ms without polling forever when no target is available.\nconst COLLECTION_FOCUS_RETRY_LIMIT = 10;\nconst COLLECTION_FOCUS_RETRY_DELAY = 50;\n// Separate caches keep navigation, typed key matching, and legacy string fallback cheap once the\n// rendered collection suggestions have been normalized.\nconst EMPTY_COLLECTION_KEY_INDEX_MAP = new Map<Key, number>();\nconst EMPTY_COLLECTION_TYPED_KEY_MAP = new Map<\n string,\n InputSearchCollectionItemContext<InputSearchSuggestion<Data>>\n>();\nconst EMPTY_COLLECTION_LEGACY_KEY_MAP = new Map<\n string,\n InputSearchCollectionItemContext<InputSearchSuggestion<Data>>\n>();\n\n/**\n * Props accepted by {@link useInputSearch}.\n */\ntype UseInputSearchProps<T extends InputSearchSuggestion<Data>> = {\n /**\n * Enables desktop autocomplete typeahead preview.\n * When set to `off`, suggestions still render, but typing does not automatically preview or\n * focus the first suggestion. Phone input keeps typed text raw until explicit navigation.\n */\n autocomplete?: 'on' | 'off';\n\n /**\n * Optional collection renderer used for collection-mode suggestion rendering.\n */\n collectionRenderer?: (props: InputSearchCollectionRendererProps<T>) => unknown;\n\n /**\n * Called when the user commits the current value by pressing Enter or selecting a suggestion.\n */\n onCommit?: (detail: InputSearchCommitDetail<T>) => void;\n\n /**\n * Internal bridge used when focus leaves collection-mode popup content.\n */\n onCollectionBlur?: (detail: ValueUpdateDetail<string>) => void;\n\n /**\n * Internal Core Pack bridge that prevents a dismissed collection autocomplete preview from\n * reappearing when the committed freeform value is reopened.\n */\n suppressCollectionAutocomplete?: boolean;\n\n /**\n * Internal Core Pack bridge that allows a matching collection row to stay highlighted while a\n * dismissed autocomplete prefix is edited and the replacement DataProvider result is pending.\n */\n allowSuppressedCollectionHighlight?: boolean;\n\n /**\n * Called when the visible field value changes without a native input event.\n */\n onDisplayValueChanged?: (detail: ValueUpdateDetail<string>) => void;\n\n /**\n * Called when the input value changes.\n */\n onInput?: (detail: ValueUpdateDetail<string>) => void;\n\n /**\n * Specifies the text to render for a suggestion. Provide either a top-level data field name or\n * a callback that returns the display text from the suggestion context. Defaults to `label`.\n */\n suggestionItemText?: InputSearchSuggestionItemText<T>;\n\n /**\n * Whether suggestions use custom row content that can expose matchable text outside\n * suggestionItemText.\n */\n hasSuggestionItemRenderer?: boolean;\n\n /**\n * Stable key resolver required for collection-mode suggestions.\n */\n suggestionItemKey?: InputSearchSuggestionItemKey<T>;\n\n /**\n * Suggestions to render in the dropdown or mobile overlay.\n * Pass `null` to show the loading state while suggestions are being fetched.\n */\n suggestions?: readonly T[] | null;\n\n /**\n * Controlled input value.\n */\n value?: string;\n};\n\ntype SuggestionNavigationDirection = 'next' | 'previous';\ntype SelectionRange = { end: number | null; start: number | null };\nconst EMPTY_SUGGESTIONS: readonly InputSearchSuggestion<Data>[] = [];\n\n/**\n * Returns whether an event target is contained by an element, crossing through shadow hosts.\n *\n * Collection templates can render real JET components with shadow DOM, so focus and pointer\n * events often report a shadow descendant instead of a light-DOM child of the popup.\n */\nfunction isElementWithinTarget(\n node: EventTarget | null,\n container: Element | null | undefined\n): boolean {\n if (!(node instanceof Node) || !container) {\n return false;\n }\n\n if (container.contains(node)) {\n return true;\n }\n\n const root = node.getRootNode();\n\n return typeof ShadowRoot !== 'undefined' && root instanceof ShadowRoot\n ? isElementWithinTarget(root.host, container)\n : false;\n}\n\n/**\n * Resolves the currently focused element through nested shadow roots.\n */\nfunction getDeepActiveElement(): Element | null {\n let activeElement = document.activeElement;\n\n while (\n activeElement instanceof HTMLElement &&\n activeElement.shadowRoot?.activeElement instanceof Element\n ) {\n activeElement = activeElement.shadowRoot.activeElement;\n }\n\n return activeElement;\n}\n\n/**\n * Finds matching elements under a root, including descendants inside component shadow roots.\n */\nfunction querySelectorAllDeep(root: ParentNode, selector: string): HTMLElement[] {\n const matches: HTMLElement[] = [];\n\n const collectMatches = (currentRoot: ParentNode) => {\n if (currentRoot instanceof HTMLElement && currentRoot.matches(selector)) {\n matches.push(currentRoot);\n }\n\n currentRoot.querySelectorAll<HTMLElement>(selector).forEach((element) => {\n matches.push(element);\n });\n\n currentRoot.querySelectorAll<HTMLElement>('*').forEach((element) => {\n if (element.shadowRoot) {\n collectMatches(element.shadowRoot);\n }\n });\n };\n\n collectMatches(root);\n return matches;\n}\n\n/**\n * Filters out collection descendants that match a tabbable selector but cannot actually receive\n * keyboard focus because they are hidden or removed from layout.\n */\nfunction isVisibleCollectionTabbable(element: HTMLElement): boolean {\n if (element.offsetParent === null) {\n return false;\n }\n\n return window.getComputedStyle(element).visibility !== 'hidden';\n}\n\n/**\n * Reads row key markers from custom collection renderers or JET collection rows.\n *\n * InputSearch does not set these attributes here. JET table/list rows already expose\n * `data-oj-key`/`data-oj-key-type`; custom renderers can use the InputSearch-prefixed fallback.\n */\nfunction getCollectionKeyAttributes(element: HTMLElement) {\n return {\n keyAttribute:\n element.getAttribute('data-oj-input-search-key') ?? element.getAttribute('data-oj-key'),\n keyTypeAttribute:\n element.getAttribute('data-oj-input-search-key-type') ??\n element.getAttribute('data-oj-key-type')\n };\n}\n\n/**\n * Matches a DOM row marker to a collection key without collapsing numeric and string keys.\n */\nfunction isTypedCollectionKeyMatch(element: HTMLElement, key: Key) {\n const { keyAttribute, keyTypeAttribute } = getCollectionKeyAttributes(element);\n\n if (keyAttribute === null) {\n return false;\n }\n\n if (typeof key === 'number') {\n return keyTypeAttribute === 'number' && keyAttribute === String(key);\n }\n\n return keyTypeAttribute !== 'number' && keyAttribute === key;\n}\n\n/**\n * Legacy fallback for collection rows that do not expose a key type marker.\n */\nfunction isLegacyCollectionKeyMatch(element: HTMLElement, key: Key) {\n const { keyAttribute } = getCollectionKeyAttributes(element);\n\n return keyAttribute === String(key);\n}\n\nfunction getTypedCollectionKeyLookup(key: Key | string, keyType?: 'number' | 'string') {\n const resolvedKeyType = keyType ?? (typeof key === 'number' ? 'number' : ('string' as const));\n\n return `${resolvedKeyType}:${String(key)}`;\n}\n\nfunction isValidCollectionElement(\n element: HTMLElement | null | undefined,\n collectionContainer: HTMLElement\n) {\n return !!element?.isConnected && collectionContainer.contains(element);\n}\n\n/**\n * Hook that manages InputSearch state and behavior.\n */\nexport function useInputSearch<T extends InputSearchSuggestion<Data>>({\n autocomplete = 'on',\n hasSuggestionItemRenderer = false,\n collectionRenderer,\n suggestionItemKey,\n suggestionItemText,\n onCommit,\n onCollectionBlur,\n suppressCollectionAutocomplete = false,\n allowSuppressedCollectionHighlight = false,\n onDisplayValueChanged,\n onInput,\n suggestions,\n value: propValue\n}: UseInputSearchProps<T>) {\n const dropdownId = useId();\n const rootRef = useRef<HTMLDivElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n const dropdownRef = useRef<HTMLDivElement>(null);\n const collectionContainerRef = useRef<HTMLDivElement>(null);\n const optionRefs = useRef<(HTMLElement | null)[]>([]);\n const pendingTypeaheadSyncRef = useRef(false);\n const pendingAcceptedCaretPositionRef = useRef<number | null>(null);\n const pendingTypeaheadAcceptedCaretPositionRef = useRef<number | null>(null);\n const suppressAutocompleteRef = useRef(false);\n const commitRawValueOnEnterRef = useRef(false);\n const acceptedAutocompleteValueRef = useRef<string | null>(null);\n const shouldHighlightSuppressedPrefixRef = useRef(true);\n const pendingControlledRestoreValueRef = useRef<string | null>(null);\n const pendingControlledInputRef = useRef<{\n caretPosition?: number | null;\n previousCommitValue?: string;\n shouldHighlightSuppressedPrefix: boolean;\n shouldSuppressAutocomplete: boolean;\n value: string;\n } | null>(null);\n const pendingControlledCollectionCommitValueRef = useRef<string | null>(null);\n const pendingControlledCollectionCommitPreviousValueRef = useRef<string | null>(null);\n const lastRenderedSuggestionCountRef = useRef(1);\n const mobileOverlayFocusTimerRef = useRef<number | undefined>();\n const collectionTapActionTimerRef = useRef<number | undefined>();\n const collectionFocusRetryTimerRef = useRef<number | undefined>();\n const collectionFocusRetryCountRef = useRef(0);\n const collectionFocusTargetsRef = useRef<HTMLElement[]>([]);\n const collectionScrollTargetCacheRef = useRef(new Map<string, HTMLElement>());\n const savedCaretRangeRef = useRef<SelectionRange | null>(null);\n const hasCollectionFocusSinceOpenRef = useRef(false);\n const pendingCollectionInputOpenRef = useRef(false);\n const shouldFocusCollectionRef = useRef(false);\n const hasDispatchedCollectionBlurRef = useRef(false);\n const shouldRestoreCollectionInputValueOnFocusRef = useRef(false);\n const isControlled = propValue !== undefined;\n const isPhoneDevice = isPhone();\n const isCollectionMode = collectionRenderer !== undefined && suggestionItemKey !== undefined;\n const isAutocompletePreviewOn = autocomplete === 'on';\n const isCollectionAutocompleteHighlightOn =\n isAutocompletePreviewOn ||\n (allowSuppressedCollectionHighlight && suppressAutocompleteRef.current);\n const isAutocompleteOn = isAutocompletePreviewOn && !isCollectionMode;\n const inputType: SearchBaseProps['type'] = isPhoneDevice ? 'search' : 'text';\n const hasSuggestions = suggestions !== undefined;\n const hasSuggestionsDropdown = hasSuggestions && !isPhoneDevice;\n const hasSuggestionsOverlay = hasSuggestions && isPhoneDevice;\n const isSuggestionsLoading = hasSuggestions && suggestions === null;\n // Use a module-level empty array so suggestion-dependent effects do not rerun every render while\n // suggestions are absent or loading.\n const suggestionItems: readonly T[] = suggestions ?? (EMPTY_SUGGESTIONS as readonly T[]);\n const [isDropdownOpen, setIsDropdownOpen] = useState(false);\n const [hoveredSuggestionIndex, setHoveredSuggestionIndex] = useState(-1);\n const [keyboardFocusedSuggestionIndex, setKeyboardFocusedSuggestionIndex] = useState(-1);\n const [showKeyboardFocusIndicator, setShowKeyboardFocusIndicator] = useState(false);\n const [interactionMode, setInteractionMode] = useState<'keyboard' | 'pointer'>();\n const [filterText, setFilterText] = useState(propValue ?? '');\n const [renderedValue, setRenderedValue] = useState(propValue ?? '');\n const [floatingAutocompleteText, setFloatingAutocompleteText] = useState<string | null>(null);\n const [lastAnnouncedEmptyQuery, setLastAnnouncedEmptyQuery] = useState('');\n const [autocompleteRange, setAutocompleteRange] = useState<{ start: number; end: number } | null>(\n null\n );\n const isDropdownOpenRef = useRef(false);\n const [currentRowKeyOverride, setCurrentRowKeyOverride] = useState<\n InputSearchCollectionItemContext<T>['key'] | undefined\n >();\n const [collectionFocusRequest, setCollectionFocusRequest] = useState(0);\n const currentRowKeyOverrideRef = useRef<InputSearchCollectionItemContext<T>['key'] | undefined>();\n const [committedRowKey, setCommittedRowKey] = useState<\n InputSearchCollectionItemContext<T>['key'] | undefined\n >();\n const filterTextRef = useRef(propValue ?? '');\n const renderedValueRef = useRef(propValue ?? '');\n const lastPropValueRef = useRef(propValue ?? '');\n const currentCommitValueRef = useRef(propValue);\n const overlayDismissRestoreValueRef = useRef(propValue ?? '');\n\n const updateRenderedValue = useCallback(\n (nextRenderedValue: string, options?: { notifyDisplayValueChanged?: boolean }) => {\n const previousValue = renderedValueRef.current;\n renderedValueRef.current = nextRenderedValue;\n setRenderedValue(nextRenderedValue);\n\n if (options?.notifyDisplayValueChanged && previousValue !== nextRenderedValue) {\n onDisplayValueChanged?.({\n previousValue,\n value: nextRenderedValue\n });\n }\n },\n [onDisplayValueChanged]\n );\n\n // Resolve the text used for default rendering, autocomplete previews, and suggestion commits.\n const getRenderedItemText = useCallback(\n (suggestion: T, index: number) =>\n getItemText(suggestion, {\n suggestionItemText,\n index\n }),\n [suggestionItemText]\n );\n\n const doesSuggestionMatchQuery = useCallback(\n (suggestion: T, index: number, query: string) => {\n const suggestionLabel = getRenderedItemText(suggestion, index);\n\n return (\n suggestionTextContainsQuery(suggestionLabel, query) ||\n (hasSuggestionItemRenderer && suggestionDataContainsQuery(suggestion, query))\n );\n },\n [getRenderedItemText, hasSuggestionItemRenderer]\n );\n\n // Surface a development-time error when collectionRenderer is supplied without stable keys.\n useEffect(() => {\n if (collectionRenderer !== undefined && suggestionItemKey === undefined) {\n error(\n () => 'InputSearch: suggestionItemKey is required when collectionRenderer is provided.'\n );\n }\n }, [collectionRenderer, suggestionItemKey]);\n\n // Collection mode needs stable row keys for current-row, selected-row, and commit details.\n // Non-collection listbox mode can fall back to rendered indexes.\n const getSuggestionKey = useCallback(\n (suggestion: T, index: number) => {\n if (suggestionItemKey === undefined) {\n return isCollectionMode ? undefined : index;\n }\n\n if (typeof suggestionItemKey === 'function') {\n return suggestionItemKey({ data: suggestion, index });\n }\n\n const keyValue = suggestion[suggestionItemKey];\n return typeof keyValue === 'string' || typeof keyValue === 'number' ? keyValue : undefined;\n },\n [isCollectionMode, suggestionItemKey]\n );\n\n // Normalize suggestion data to the richer context shape used by collection mode commits.\n const getSuggestionItemContext = useCallback(\n (suggestion: T, index: number): InputSearchCollectionItemContext<T> | undefined => {\n const key = getSuggestionKey(suggestion, index);\n\n if (key === undefined) {\n return undefined;\n }\n\n return {\n data: suggestion,\n index,\n key,\n metadata: { key }\n };\n },\n [getSuggestionKey]\n );\n\n // Keep collection-only keyed structures off the non-collection listbox path.\n const collectionItemContexts = useMemo(() => {\n if (!isCollectionMode) {\n return EMPTY_COLLECTION_ITEM_CONTEXTS as readonly InputSearchCollectionItemContext<T>[];\n }\n\n // Normalize the rendered suggestions once so keyboard navigation, row actions, and\n // DOM-to-context lookup can all share the same keyed collection view.\n return suggestionItems.reduce<InputSearchCollectionItemContext<T>[]>(\n (itemContexts, suggestion, index) => {\n const itemContext = getSuggestionItemContext(suggestion, index);\n\n if (itemContext) {\n itemContexts.push(itemContext);\n }\n\n return itemContexts;\n },\n []\n );\n }, [getSuggestionItemContext, isCollectionMode, suggestionItems]);\n\n // Keyed lookup keeps row actions and current-row changes aligned with the rendered suggestions\n // even when collection internals report only a row key.\n const suggestionContextMap = useMemo(() => {\n if (!isCollectionMode) {\n return EMPTY_COLLECTION_CONTEXT_MAP as Map<\n InputSearchCollectionItemContext<T>['key'],\n InputSearchCollectionItemContext<T>\n >;\n }\n\n const contextMap = new Map<\n InputSearchCollectionItemContext<T>['key'],\n InputSearchCollectionItemContext<T>\n >();\n\n collectionItemContexts.forEach((itemContext) => {\n contextMap.set(itemContext.key, itemContext);\n });\n\n return contextMap;\n }, [collectionItemContexts, isCollectionMode]);\n\n const collectionItemIndexMap = useMemo(() => {\n if (!isCollectionMode) {\n return EMPTY_COLLECTION_KEY_INDEX_MAP as Map<\n InputSearchCollectionItemContext<T>['key'],\n number\n >;\n }\n\n // Arrow navigation only needs key -> index lookup after the contexts are normalized.\n const indexMap = new Map<InputSearchCollectionItemContext<T>['key'], number>();\n\n collectionItemContexts.forEach((itemContext, index) => {\n indexMap.set(itemContext.key, index);\n });\n\n return indexMap;\n }, [collectionItemContexts, isCollectionMode]);\n\n const collectionTypedKeyMap = useMemo(() => {\n if (!isCollectionMode) {\n return EMPTY_COLLECTION_TYPED_KEY_MAP as Map<string, InputSearchCollectionItemContext<T>>;\n }\n\n // Preserve numeric-vs-string key identity for renderer DOM markers such as \"1\" vs 1.\n const typedKeyMap = new Map<string, InputSearchCollectionItemContext<T>>();\n\n collectionItemContexts.forEach((itemContext) => {\n typedKeyMap.set(getTypedCollectionKeyLookup(itemContext.key), itemContext);\n });\n\n return typedKeyMap;\n }, [collectionItemContexts, isCollectionMode]);\n\n const collectionLegacyKeyMap = useMemo(() => {\n if (!isCollectionMode) {\n return EMPTY_COLLECTION_LEGACY_KEY_MAP as Map<string, InputSearchCollectionItemContext<T>>;\n }\n\n const legacyKeyMap = new Map<string, InputSearchCollectionItemContext<T>>();\n\n collectionItemContexts.forEach((itemContext) => {\n const legacyKey = String(itemContext.key);\n\n if (!legacyKeyMap.has(legacyKey)) {\n legacyKeyMap.set(legacyKey, itemContext);\n }\n });\n\n return legacyKeyMap;\n }, [collectionItemContexts, isCollectionMode]);\n\n const resetSuggestionFocusState = useCallback(() => {\n setHoveredSuggestionIndex(-1);\n setKeyboardFocusedSuggestionIndex(-1);\n setShowKeyboardFocusIndicator(false);\n setInteractionMode(undefined);\n }, []);\n\n const clearCollectionCurrentRow = useCallback(() => {\n currentRowKeyOverrideRef.current = undefined;\n setCurrentRowKeyOverride(undefined);\n }, []);\n\n const saveInputCaretRange = useCallback(() => {\n const inputElement = inputRef.current;\n\n if (inputElement && document.activeElement === inputElement) {\n savedCaretRangeRef.current = {\n end: inputElement.selectionEnd,\n start: inputElement.selectionStart\n };\n }\n }, []);\n\n const openDropdown = useCallback(() => {\n hasDispatchedCollectionBlurRef.current = false;\n hasCollectionFocusSinceOpenRef.current = false;\n shouldRestoreCollectionInputValueOnFocusRef.current = false;\n isDropdownOpenRef.current = true;\n setIsDropdownOpen(true);\n }, []);\n\n const resetAutocomplete = useCallback(\n (nextRenderedValue?: string) => {\n const restoredValue = nextRenderedValue ?? filterTextRef.current;\n setAutocompleteRange(null);\n setFloatingAutocompleteText(null);\n updateRenderedValue(restoredValue, {\n notifyDisplayValueChanged: true\n });\n },\n [updateRenderedValue]\n );\n\n // A Core Pack freeform commit can follow dismissal of a collection autocomplete preview. Keep\n // that preview suppressed until the next input event so reopening shows the committed filter,\n // rather than restoring the old first-row preview.\n useEffect(() => {\n if (isCollectionMode && suppressCollectionAutocomplete) {\n suppressAutocompleteRef.current = true;\n resetAutocomplete();\n }\n }, [isCollectionMode, resetAutocomplete, suppressCollectionAutocomplete]);\n\n const restoreCaretToRawPrefixEnd = useCallback(() => {\n const caretPosition = filterTextRef.current.length;\n\n queueMicrotask(() => {\n const inputElement = inputRef.current;\n\n if (inputElement && document.activeElement === inputElement) {\n inputElement.setSelectionRange(caretPosition, caretPosition);\n }\n });\n }, []);\n\n const restoreCollectionInputValue = useCallback(() => {\n hasCollectionFocusSinceOpenRef.current = false;\n shouldFocusCollectionRef.current = false;\n clearCollectionCurrentRow();\n suppressAutocompleteRef.current = true;\n resetAutocomplete();\n }, [clearCollectionCurrentRow, resetAutocomplete]);\n\n // Build the displayed input value for inline autocomplete while preserving the user's typed casing.\n const buildAutocompletePreviewValue = useCallback(\n (suggestionLabel: string) =>\n filterTextRef.current + suggestionLabel.slice(filterTextRef.current.length),\n []\n );\n\n // Apply the visual-only suggestion preview used by keyboard navigation and typeahead.\n const applyKeyboardFocusPreview = useCallback(\n (suggestion: T, index: number, options?: { autocomplete?: boolean; floating?: boolean }) => {\n const suggestionLabel = getRenderedItemText(suggestion, index);\n\n if (options?.autocomplete) {\n const previewValue = buildAutocompletePreviewValue(suggestionLabel);\n const autocompleteStart = filterTextRef.current.length;\n updateRenderedValue(previewValue, { notifyDisplayValueChanged: true });\n setFloatingAutocompleteText(null);\n setAutocompleteRange(\n previewValue.length > autocompleteStart\n ? {\n start: autocompleteStart,\n end: previewValue.length\n }\n : null\n );\n return;\n }\n\n if (options?.floating) {\n updateRenderedValue(filterTextRef.current, { notifyDisplayValueChanged: true });\n setFloatingAutocompleteText(suggestionLabel);\n setAutocompleteRange(null);\n return;\n }\n\n updateRenderedValue(suggestionLabel, { notifyDisplayValueChanged: true });\n setFloatingAutocompleteText(null);\n setAutocompleteRange(null);\n },\n [buildAutocompletePreviewValue, getRenderedItemText, updateRenderedValue]\n );\n\n // Closing the popup either restores the raw typed filter text (blur/dismiss paths)\n // or preserves the committed/selected display value for commit and selection paths.\n const closeDropdown = useCallback(\n (options?: { preserveDisplayValue?: boolean }) => {\n const preserveDisplayValue = options?.preserveDisplayValue === true;\n pendingTypeaheadSyncRef.current = false;\n if (collectionTapActionTimerRef.current !== undefined) {\n window.clearTimeout(collectionTapActionTimerRef.current);\n collectionTapActionTimerRef.current = undefined;\n }\n if (collectionFocusRetryTimerRef.current !== undefined) {\n window.clearTimeout(collectionFocusRetryTimerRef.current);\n collectionFocusRetryTimerRef.current = undefined;\n }\n collectionFocusRetryCountRef.current = 0;\n hasCollectionFocusSinceOpenRef.current = false;\n shouldFocusCollectionRef.current = false;\n shouldRestoreCollectionInputValueOnFocusRef.current = false;\n isDropdownOpenRef.current = false;\n setIsDropdownOpen(false);\n resetSuggestionFocusState();\n clearCollectionCurrentRow();\n\n if (!preserveDisplayValue) {\n suppressAutocompleteRef.current = false;\n resetAutocomplete();\n } else {\n setAutocompleteRange(null);\n }\n },\n [clearCollectionCurrentRow, resetAutocomplete, resetSuggestionFocusState]\n );\n\n // Collection blur is dispatched once per close path so Core Pack blur writeback cannot race with\n // row action commits or repeated focusout/focusin events from nested collection internals.\n const blurCollectionAndClose = useCallback(() => {\n if (!isCollectionMode || !isDropdownOpen || hasDispatchedCollectionBlurRef.current) {\n return;\n }\n\n hasDispatchedCollectionBlurRef.current = true;\n onCollectionBlur?.({ value: renderedValueRef.current });\n closeDropdown();\n }, [closeDropdown, isCollectionMode, isDropdownOpen, onCollectionBlur]);\n\n // Auto-dismiss receives events from popup infrastructure. In collection mode, Tab is allowed to\n // move focus normally while outside clicks/blur paths commit the current display value on close.\n const handleDropdownAutoDismiss = useCallback(\n (event?: Event) => {\n if (isCollectionMode) {\n if (event instanceof KeyboardEvent && event.key === 'Tab') {\n return;\n }\n\n blurCollectionAndClose();\n return;\n }\n\n closeDropdown();\n },\n [blurCollectionAndClose, closeDropdown, isCollectionMode]\n );\n\n // Collection focus can land inside table/list shadow DOM or inside the popup wrapper itself.\n // Treat those targets as internal so blur writeback waits until focus truly leaves the\n // collection popup.\n const isFocusMovingIntoCollection = useCallback(\n (event: Event) => {\n if (!isCollectionMode) {\n return false;\n }\n\n const focusEvent = event as FocusEvent;\n const popupElement = document.getElementById(`${dropdownId}-popup`);\n\n return (\n isElementWithinTarget(focusEvent.relatedTarget, collectionContainerRef.current) ||\n isElementWithinTarget(focusEvent.relatedTarget, popupElement)\n );\n },\n [dropdownId, isCollectionMode]\n );\n\n // Collection focusout is the main blur path for keyboard and pointer interaction inside\n // the collection body.\n const handleCollectionFocusOut = useCallback(\n (event: FocusEvent) => {\n if (isCollectionMode && isElementWithinTarget(event.relatedTarget, inputRef.current)) {\n if (shouldRestoreCollectionInputValueOnFocusRef.current) {\n restoreCollectionInputValue();\n shouldRestoreCollectionInputValueOnFocusRef.current = false;\n }\n return;\n }\n\n if (!isCollectionMode || !isDropdownOpen) {\n return;\n }\n\n if (isFocusMovingIntoCollection(event)) {\n shouldRestoreCollectionInputValueOnFocusRef.current = false;\n return;\n }\n\n if (shouldRestoreCollectionInputValueOnFocusRef.current) {\n restoreCollectionInputValue();\n shouldRestoreCollectionInputValueOnFocusRef.current = false;\n }\n\n blurCollectionAndClose();\n },\n [\n blurCollectionAndClose,\n isCollectionMode,\n isDropdownOpen,\n isFocusMovingIntoCollection,\n restoreCollectionInputValue\n ]\n );\n\n // Some collection components move focus without bubbling a useful focusout through our wrapper.\n // A document-level focusin closes the collection popup when focus leaves the popup,\n // collection, and input.\n const handleDocumentFocusIn = useCallback(\n (event: FocusEvent) => {\n const popupElement = document.getElementById(`${dropdownId}-popup`);\n const isFocusLeavingCollection =\n isElementWithinTarget(event.relatedTarget, collectionContainerRef.current) ||\n isElementWithinTarget(event.relatedTarget, popupElement);\n\n if (\n !isCollectionMode ||\n !isDropdownOpen ||\n !isFocusLeavingCollection ||\n isElementWithinTarget(event.target, collectionContainerRef.current) ||\n isElementWithinTarget(event.target, popupElement) ||\n isElementWithinTarget(event.target, inputRef.current)\n ) {\n return;\n }\n\n blurCollectionAndClose();\n },\n [blurCollectionAndClose, dropdownId, isCollectionMode, isDropdownOpen]\n );\n\n // Install the document focus fallback only while the collection popup is open.\n useEffect(() => {\n if (!isCollectionMode || !isDropdownOpen) {\n return;\n }\n\n document.addEventListener('focusin', handleDocumentFocusIn);\n\n return () => {\n document.removeEventListener('focusin', handleDocumentFocusIn);\n };\n }, [handleDocumentFocusIn, isCollectionMode, isDropdownOpen]);\n\n const handleInputBlur = useCallback(\n (event: Event) => {\n if (isFocusMovingIntoCollection(event)) {\n return;\n }\n\n closeDropdown();\n },\n [closeDropdown, isFocusMovingIntoCollection]\n );\n\n const syncControlledValue = useCallback(\n (nextValue: string) => {\n filterTextRef.current = nextValue;\n renderedValueRef.current = nextValue;\n lastPropValueRef.current = nextValue;\n overlayDismissRestoreValueRef.current = nextValue;\n acceptedAutocompleteValueRef.current = null;\n commitRawValueOnEnterRef.current = false;\n setFilterText(nextValue);\n setRenderedValue(nextValue);\n setFloatingAutocompleteText(null);\n setAutocompleteRange(null);\n suppressAutocompleteRef.current = false;\n shouldHighlightSuppressedPrefixRef.current = true;\n },\n [setFilterText, setRenderedValue]\n );\n\n // Apply accepted input text to both refs and state, and open the right suggestion surface.\n const applyInputValue = useCallback(\n (\n nextValue: string,\n shouldSuppressAutocomplete: boolean,\n options?: { shouldHighlightSuppressedPrefix?: boolean }\n ) => {\n setLastAnnouncedEmptyQuery('');\n suppressAutocompleteRef.current = shouldSuppressAutocomplete;\n shouldHighlightSuppressedPrefixRef.current = options?.shouldHighlightSuppressedPrefix ?? true;\n pendingTypeaheadSyncRef.current = hasSuggestions;\n if (isCollectionMode) {\n setCommittedRowKey(undefined);\n // A shorter prefix still matches the current row after the user dismisses autocomplete.\n // Preserve that visual collection highlight while the replacement DataProvider result is\n // pending; the raw input and Enter commit remain unchanged.\n if (!shouldSuppressAutocomplete || !allowSuppressedCollectionHighlight) {\n clearCollectionCurrentRow();\n }\n }\n filterTextRef.current = nextValue;\n renderedValueRef.current = nextValue;\n setFilterText(nextValue);\n setRenderedValue(nextValue);\n setFloatingAutocompleteText(null);\n setAutocompleteRange(null);\n\n if (hasSuggestionsDropdown) {\n pendingCollectionInputOpenRef.current = false;\n openDropdown();\n setHoveredSuggestionIndex(-1);\n setKeyboardFocusedSuggestionIndex(-1);\n setInteractionMode('keyboard');\n } else if (hasSuggestionsOverlay) {\n pendingCollectionInputOpenRef.current = false;\n openDropdown();\n resetSuggestionFocusState();\n } else {\n pendingCollectionInputOpenRef.current = isCollectionMode && !hasSuggestions;\n }\n },\n [\n allowSuppressedCollectionHighlight,\n clearCollectionCurrentRow,\n hasSuggestions,\n hasSuggestionsDropdown,\n hasSuggestionsOverlay,\n isCollectionMode,\n openDropdown,\n resetSuggestionFocusState\n ]\n );\n\n // Sync external controlled updates into the internal field state before paint, but avoid\n // clobbering temporary preview text unless the controlled value itself changed.\n useLayoutEffect(() => {\n const nextValue = propValue ?? '';\n const controlledValueChanged = lastPropValueRef.current !== nextValue;\n const localStateDiverged =\n filterTextRef.current !== nextValue || renderedValueRef.current !== nextValue;\n const shouldPreserveTransientSuggestionDisplay =\n hasSuggestions &&\n isDropdownOpen &&\n renderedValueRef.current !== filterTextRef.current &&\n (autocompleteRange !== null ||\n (isCollectionMode && currentRowKeyOverride !== undefined) ||\n (hasSuggestionsDropdown && keyboardFocusedSuggestionIndex >= 0));\n const pendingControlledCollectionCommitValue =\n pendingControlledCollectionCommitValueRef.current;\n\n if (\n !isControlled ||\n (shouldPreserveTransientSuggestionDisplay &&\n !controlledValueChanged &&\n pendingControlledCollectionCommitValue === null)\n ) {\n return;\n }\n\n const pendingControlledCollectionCommitPreviousValue =\n pendingControlledCollectionCommitPreviousValueRef.current;\n\n if (pendingControlledCollectionCommitValue !== null) {\n if (nextValue === pendingControlledCollectionCommitValue) {\n pendingControlledCollectionCommitValueRef.current = null;\n pendingControlledCollectionCommitPreviousValueRef.current = null;\n } else if (nextValue === pendingControlledCollectionCommitPreviousValue) {\n pendingControlledCollectionCommitValueRef.current = null;\n pendingControlledCollectionCommitPreviousValueRef.current = null;\n currentCommitValueRef.current = nextValue;\n setCommittedRowKey(undefined);\n clearCollectionCurrentRow();\n syncControlledValue(nextValue);\n } else if (controlledValueChanged) {\n pendingControlledCollectionCommitValueRef.current = null;\n pendingControlledCollectionCommitPreviousValueRef.current = null;\n currentCommitValueRef.current = nextValue;\n setCommittedRowKey(undefined);\n clearCollectionCurrentRow();\n }\n }\n\n const pendingControlledInput = pendingControlledInputRef.current;\n\n if (pendingControlledInput !== null) {\n if (controlledValueChanged && nextValue === pendingControlledInput.value) {\n pendingControlledInputRef.current = null;\n lastPropValueRef.current = nextValue;\n currentCommitValueRef.current = pendingControlledInput.previousCommitValue;\n applyInputValue(nextValue, pendingControlledInput.shouldSuppressAutocomplete, {\n shouldHighlightSuppressedPrefix: pendingControlledInput.shouldHighlightSuppressedPrefix\n });\n\n const acceptedCaretPosition = pendingControlledInput.caretPosition;\n if (acceptedCaretPosition !== undefined && acceptedCaretPosition !== null) {\n queueMicrotask(() => {\n const inputElement = inputRef.current;\n\n if (inputElement && document.activeElement === inputElement) {\n inputElement.setSelectionRange(acceptedCaretPosition, acceptedCaretPosition);\n }\n });\n }\n return;\n }\n\n if (controlledValueChanged) {\n pendingControlledInputRef.current = null;\n } else {\n return;\n }\n }\n\n const pendingControlledRestoreValue = pendingControlledRestoreValueRef.current;\n\n if (pendingControlledRestoreValue !== null) {\n if (nextValue === pendingControlledRestoreValue) {\n pendingControlledRestoreValueRef.current = null;\n } else if (\n filterTextRef.current === pendingControlledRestoreValue &&\n renderedValueRef.current === pendingControlledRestoreValue\n ) {\n return;\n } else {\n pendingControlledRestoreValueRef.current = null;\n }\n }\n\n if (controlledValueChanged) {\n if (localStateDiverged) {\n currentCommitValueRef.current = nextValue;\n }\n lastPropValueRef.current = nextValue;\n }\n\n if (localStateDiverged) {\n syncControlledValue(nextValue);\n }\n }, [\n applyInputValue,\n autocompleteRange,\n committedRowKey,\n filterText,\n hasSuggestions,\n hasSuggestionsDropdown,\n currentRowKeyOverride,\n isDropdownOpen,\n isControlled,\n isCollectionMode,\n keyboardFocusedSuggestionIndex,\n propValue,\n renderedValue,\n syncControlledValue\n ]);\n\n // Close and reset dropdown state when suggestions are unavailable.\n useEffect(() => {\n if (!hasSuggestions) {\n closeDropdown();\n }\n }, [closeDropdown, hasSuggestions]);\n\n // Clear cached option refs after the popup closes.\n useEffect(() => {\n if (!isDropdownOpen) {\n optionRefs.current = [];\n }\n }, [isDropdownOpen]);\n\n // Clear hover and keyboard focus while loading placeholder content.\n useEffect(() => {\n if (isSuggestionsLoading) {\n resetSuggestionFocusState();\n }\n }, [isSuggestionsLoading, resetSuggestionFocusState]);\n\n // Cache the last non-loading suggestion count so the loading skeleton can preserve popup height.\n useEffect(() => {\n if (!isSuggestionsLoading && suggestionItems.length > 0) {\n lastRenderedSuggestionCountRef.current = suggestionItems.length;\n }\n }, [isSuggestionsLoading, suggestionItems.length]);\n\n // Collection DOM can be recreated as the rendered suggestions change, so invalidate cached\n // focus/row elements and lazily repopulate them on the next keyboard interaction.\n useEffect(() => {\n collectionFocusTargetsRef.current = [];\n collectionScrollTargetCacheRef.current.clear();\n }, [collectionItemContexts, isCollectionMode, isDropdownOpen, isSuggestionsLoading]);\n\n // Clamp keyboard focus when the suggestion list shrinks.\n useEffect(() => {\n const suggestionItemsLength = suggestionItems.length;\n\n if (\n suggestions !== undefined &&\n suggestions !== null &&\n keyboardFocusedSuggestionIndex >= suggestionItemsLength\n ) {\n setKeyboardFocusedSuggestionIndex(suggestionItemsLength > 0 ? suggestionItemsLength - 1 : -1);\n }\n }, [keyboardFocusedSuggestionIndex, suggestionItems.length, suggestions]);\n\n // Keep collection current-row state valid as filtering/loading changes the available rows.\n useEffect(() => {\n if (!isCollectionMode || !isDropdownOpen || isSuggestionsLoading) {\n return;\n }\n\n // Drop stale current-row overrides when filtering removes the previously highlighted row.\n if (collectionItemContexts.length === 0) {\n clearCollectionCurrentRow();\n return;\n }\n\n if (currentRowKeyOverride === undefined) {\n return;\n }\n\n if (!suggestionContextMap.has(currentRowKeyOverride)) {\n clearCollectionCurrentRow();\n }\n }, [\n clearCollectionCurrentRow,\n currentRowKeyOverride,\n isCollectionMode,\n isDropdownOpen,\n isSuggestionsLoading,\n suggestionContextMap,\n collectionItemContexts.length\n ]);\n\n // In desktop collection mode, the first typed candidate can be previewed as the current row\n // without moving focus into the collection body.\n useEffect(() => {\n if (\n !isCollectionMode ||\n !isCollectionAutocompleteHighlightOn ||\n !hasSuggestionsDropdown ||\n !isDropdownOpen ||\n isSuggestionsLoading ||\n (suppressAutocompleteRef.current && !allowSuppressedCollectionHighlight) ||\n shouldRestoreCollectionInputValueOnFocusRef.current ||\n collectionItemContexts.length === 0\n ) {\n return;\n }\n\n const typedFilterText = filterText;\n\n if (typedFilterText.length === 0) {\n return;\n }\n\n const firstItemContext = collectionItemContexts[0];\n const firstItemText = getRenderedItemText(firstItemContext.data, firstItemContext.index);\n\n // Containment is intentional here: collection autocomplete supports a query embedded in the\n // suggestion text, such as \"fox\" matching \"Firefox\", rather than only prefix matches.\n if (!suggestionTextContainsQuery(firstItemText, typedFilterText)) {\n return;\n }\n\n currentRowKeyOverrideRef.current = firstItemContext.key;\n setCurrentRowKeyOverride(firstItemContext.key);\n }, [\n allowSuppressedCollectionHighlight,\n filterText,\n getRenderedItemText,\n hasSuggestionsDropdown,\n isCollectionAutocompleteHighlightOn,\n isCollectionMode,\n isDropdownOpen,\n isSuggestionsLoading,\n collectionItemContexts\n ]);\n\n // Reflect the collection current row into the launcher text only while collection focus is active;\n // otherwise keep typed text available for continued filtering and autocomplete preview.\n useEffect(() => {\n if (!isCollectionMode || !isDropdownOpen) {\n return;\n }\n\n const currentItemContext =\n currentRowKeyOverride !== undefined\n ? suggestionContextMap.get(currentRowKeyOverride)\n : undefined;\n const currentItemText =\n currentItemContext !== undefined\n ? getRenderedItemText(currentItemContext.data, currentItemContext.index)\n : undefined;\n const deepActiveElement = getDeepActiveElement();\n const isCollectionFocused = isElementWithinTarget(\n deepActiveElement,\n collectionContainerRef.current\n );\n if (isCollectionFocused) {\n hasCollectionFocusSinceOpenRef.current = true;\n }\n const shouldRenderCurrentItemText =\n !shouldRestoreCollectionInputValueOnFocusRef.current &&\n (isCollectionFocused || hasCollectionFocusSinceOpenRef.current);\n const hasTypedFilterText = filterTextRef.current.length > 0;\n const shouldAutocompleteCollection =\n !shouldRenderCurrentItemText &&\n currentItemText !== undefined &&\n isAutocompletePreviewOn &&\n hasSuggestionsDropdown &&\n hasTypedFilterText &&\n !suppressAutocompleteRef.current &&\n currentItemText.toLowerCase().startsWith(filterTextRef.current.toLowerCase());\n const shouldShowFloatingCollectionAutocomplete =\n !shouldRenderCurrentItemText &&\n currentItemText !== undefined &&\n isAutocompletePreviewOn &&\n hasSuggestionsDropdown &&\n hasTypedFilterText &&\n !suppressAutocompleteRef.current &&\n suggestionTextContainsQuery(currentItemText, filterTextRef.current) &&\n !shouldAutocompleteCollection;\n\n if (shouldAutocompleteCollection) {\n const previewValue = buildAutocompletePreviewValue(currentItemText);\n const autocompleteStart = filterTextRef.current.length;\n renderedValueRef.current = previewValue;\n setRenderedValue(previewValue);\n setFloatingAutocompleteText(null);\n setAutocompleteRange(\n previewValue.length > autocompleteStart\n ? {\n start: autocompleteStart,\n end: previewValue.length\n }\n : null\n );\n return;\n }\n\n if (shouldShowFloatingCollectionAutocomplete) {\n renderedValueRef.current = filterTextRef.current;\n setRenderedValue(filterTextRef.current);\n setFloatingAutocompleteText(currentItemText);\n setAutocompleteRange(null);\n return;\n }\n\n const nextRenderedValue =\n shouldRenderCurrentItemText && currentItemText !== undefined\n ? currentItemText\n : filterTextRef.current;\n\n renderedValueRef.current = nextRenderedValue;\n setRenderedValue(nextRenderedValue);\n setFloatingAutocompleteText(null);\n setAutocompleteRange(null);\n }, [\n currentRowKeyOverride,\n buildAutocompletePreviewValue,\n getRenderedItemText,\n hasSuggestionsDropdown,\n isAutocompletePreviewOn,\n isCollectionMode,\n isDropdownOpen,\n collectionItemContexts,\n suggestionContextMap\n ]);\n\n // Keep the keyboard-focused option visible while navigating the popup.\n useEffect(() => {\n const activeOption = optionRefs.current[keyboardFocusedSuggestionIndex];\n activeOption?.scrollIntoView({ block: 'nearest' });\n }, [keyboardFocusedSuggestionIndex]);\n\n // Mirror the autocomplete preview range onto the native input selection.\n useLayoutEffect(() => {\n if (!autocompleteRange) {\n return;\n }\n\n const inputElement = inputRef.current;\n\n if (!inputElement) {\n return;\n }\n\n inputElement.setSelectionRange(autocompleteRange.start, autocompleteRange.end);\n }, [autocompleteRange, renderedValue]);\n\n // Arrow-key acceptance keeps the full autocompleted value and then collapses the\n // selection to the requested caret position once the raw filter text has caught up.\n useLayoutEffect(() => {\n const pendingAcceptedCaretPosition = pendingAcceptedCaretPositionRef.current;\n\n if (pendingAcceptedCaretPosition === null) {\n return;\n }\n\n const inputElement = inputRef.current;\n\n if (!inputElement) {\n return;\n }\n\n inputElement.setSelectionRange(pendingAcceptedCaretPosition, pendingAcceptedCaretPosition);\n pendingAcceptedCaretPositionRef.current = null;\n }, [filterText, renderedValue]);\n\n // Once new suggestions arrive for a typed query, decide whether to preview the first\n // starts-with match inline or fall back to the raw typed filter text.\n useEffect(() => {\n if (\n !hasSuggestions ||\n isCollectionMode ||\n !pendingTypeaheadSyncRef.current ||\n !isDropdownOpen ||\n isSuggestionsLoading\n ) {\n return;\n }\n\n pendingTypeaheadSyncRef.current = false;\n const pendingTypeaheadAcceptedCaretPosition = pendingTypeaheadAcceptedCaretPositionRef.current;\n pendingTypeaheadAcceptedCaretPositionRef.current = null;\n\n const firstSuggestion = suggestionItems[0];\n const normalizedFilterText = filterTextRef.current.toLowerCase();\n const firstSuggestionLabel = firstSuggestion ? getRenderedItemText(firstSuggestion, 0) : '';\n const firstSuggestionMatchesQuery = firstSuggestion\n ? doesSuggestionMatchQuery(firstSuggestion, 0, filterTextRef.current)\n : false;\n const hasTypedFilterText = filterTextRef.current.length > 0;\n const hasInlineAutocompleteSurface = hasSuggestionsDropdown || hasSuggestionsOverlay;\n const shouldAutocomplete =\n isAutocompleteOn &&\n hasInlineAutocompleteSurface &&\n hasTypedFilterText &&\n !suppressAutocompleteRef.current &&\n firstSuggestionLabel.toLowerCase().startsWith(normalizedFilterText);\n const shouldShowFloatingAutocomplete =\n isAutocompleteOn &&\n hasSuggestionsDropdown &&\n hasTypedFilterText &&\n !suppressAutocompleteRef.current &&\n firstSuggestionMatchesQuery &&\n !shouldAutocomplete;\n const shouldHighlightSuppressedPrefix =\n isAutocompleteOn &&\n hasTypedFilterText &&\n suppressAutocompleteRef.current &&\n shouldHighlightSuppressedPrefixRef.current &&\n firstSuggestionLabel.toLowerCase().startsWith(normalizedFilterText);\n\n if (\n firstSuggestion &&\n hasTypedFilterText &&\n isAutocompleteOn &&\n (shouldAutocomplete || shouldShowFloatingAutocomplete || shouldHighlightSuppressedPrefix)\n ) {\n setKeyboardFocusedSuggestionIndex(0);\n setShowKeyboardFocusIndicator(false);\n setInteractionMode('keyboard');\n\n if (shouldAutocomplete) {\n if (pendingTypeaheadAcceptedCaretPosition !== null) {\n const previewValue = buildAutocompletePreviewValue(firstSuggestionLabel);\n updateRenderedValue(previewValue);\n setFloatingAutocompleteText(null);\n setAutocompleteRange(null);\n\n queueMicrotask(() => {\n const inputElement = inputRef.current;\n\n if (inputElement && document.activeElement === inputElement) {\n inputElement.setSelectionRange(\n pendingTypeaheadAcceptedCaretPosition,\n pendingTypeaheadAcceptedCaretPosition\n );\n }\n });\n return;\n }\n\n applyKeyboardFocusPreview(firstSuggestion, 0, { autocomplete: true });\n return;\n }\n\n if (shouldShowFloatingAutocomplete) {\n applyKeyboardFocusPreview(firstSuggestion, 0, { floating: true });\n return;\n }\n\n if (shouldHighlightSuppressedPrefix) {\n updateRenderedValue(filterTextRef.current, { notifyDisplayValueChanged: true });\n setFloatingAutocompleteText(null);\n setAutocompleteRange(null);\n return;\n }\n\n updateRenderedValue(filterTextRef.current, { notifyDisplayValueChanged: true });\n setFloatingAutocompleteText(null);\n setAutocompleteRange(null);\n return;\n }\n\n if (\n firstSuggestion &&\n hasTypedFilterText &&\n isAutocompleteOn &&\n hasSuggestionsDropdown &&\n suppressAutocompleteRef.current &&\n shouldHighlightSuppressedPrefixRef.current &&\n firstSuggestionMatchesQuery\n ) {\n setKeyboardFocusedSuggestionIndex(0);\n setInteractionMode('keyboard');\n updateRenderedValue(filterTextRef.current, { notifyDisplayValueChanged: true });\n setFloatingAutocompleteText(null);\n setAutocompleteRange(null);\n return;\n }\n\n if (\n firstSuggestion &&\n hasTypedFilterText &&\n isAutocompleteOn &&\n hasSuggestionsDropdown &&\n suppressAutocompleteRef.current &&\n shouldHighlightSuppressedPrefixRef.current &&\n suggestionTextContainsQuery(firstSuggestionLabel, filterTextRef.current)\n ) {\n setKeyboardFocusedSuggestionIndex(0);\n setInteractionMode('keyboard');\n renderedValueRef.current = filterTextRef.current;\n setRenderedValue(filterTextRef.current);\n setFloatingAutocompleteText(null);\n setAutocompleteRange(null);\n return;\n }\n\n setKeyboardFocusedSuggestionIndex(-1);\n setShowKeyboardFocusIndicator(false);\n setFloatingAutocompleteText(null);\n setAutocompleteRange(null);\n updateRenderedValue(filterTextRef.current, { notifyDisplayValueChanged: true });\n }, [\n applyKeyboardFocusPreview,\n buildAutocompletePreviewValue,\n doesSuggestionMatchQuery,\n getRenderedItemText,\n hasSuggestions,\n hasSuggestionsDropdown,\n hasSuggestionsOverlay,\n isAutocompleteOn,\n isCollectionMode,\n isDropdownOpen,\n isSuggestionsLoading,\n suggestionItems,\n updateRenderedValue\n ]);\n\n // Previewing a suggestion updates only the rendered field text and optional selection\n // range; callers still own keyboard focus movement and any eventual commit behavior.\n const previewSuggestion = useCallback(\n (\n suggestion: T | undefined,\n index: number,\n options?: { autocomplete?: boolean; floating?: boolean }\n ) => {\n if (!suggestion) {\n return;\n }\n\n applyKeyboardFocusPreview(suggestion, index, options);\n },\n [applyKeyboardFocusPreview]\n );\n\n // Arrow navigation owns the keyboard-focused index and decides when the first\n // suggestion should also be previewed as inline autocomplete or floating partial-match text.\n const moveKeyboardFocus = useCallback(\n (direction: SuggestionNavigationDirection) => {\n pendingTypeaheadSyncRef.current = false;\n commitRawValueOnEnterRef.current = false;\n openDropdown();\n setHoveredSuggestionIndex(-1);\n setInteractionMode('keyboard');\n setFloatingAutocompleteText(null);\n setAutocompleteRange(null);\n\n if (suggestionItems.length === 0) {\n return;\n }\n\n setKeyboardFocusedSuggestionIndex((prev) => {\n const nextIndex =\n direction === 'next'\n ? prev < suggestionItems.length - 1\n ? prev + 1\n : suggestionItems.length - 1\n : prev === -1\n ? suggestionItems.length - 1\n : Math.max(prev - 1, 0);\n const nextSuggestion = suggestionItems[nextIndex];\n const nextSuggestionLabel = nextSuggestion\n ? getRenderedItemText(nextSuggestion, nextIndex)\n : '';\n const shouldAutocomplete =\n isAutocompleteOn &&\n (hasSuggestionsDropdown || hasSuggestionsOverlay) &&\n nextIndex === 0 &&\n filterTextRef.current.length > 0 &&\n nextSuggestionLabel.toLowerCase().startsWith(filterTextRef.current.toLowerCase());\n const shouldShowFloatingAutocomplete =\n isAutocompleteOn &&\n hasSuggestionsDropdown &&\n nextIndex === 0 &&\n filterTextRef.current.length > 0 &&\n !!nextSuggestion &&\n doesSuggestionMatchQuery(nextSuggestion, nextIndex, filterTextRef.current) &&\n !shouldAutocomplete;\n\n previewSuggestion(nextSuggestion, nextIndex, {\n autocomplete: shouldAutocomplete,\n floating: shouldShowFloatingAutocomplete\n });\n return nextIndex;\n });\n setShowKeyboardFocusIndicator(true);\n },\n [\n getRenderedItemText,\n doesSuggestionMatchQuery,\n hasSuggestionsDropdown,\n hasSuggestionsOverlay,\n isAutocompleteOn,\n openDropdown,\n previewSuggestion,\n suggestionItems\n ]\n );\n\n const moveCollectionCurrentRow = useCallback(\n (direction: SuggestionNavigationDirection) => {\n pendingTypeaheadSyncRef.current = false;\n if (!isDropdownOpenRef.current) {\n openDropdown();\n }\n setHoveredSuggestionIndex(-1);\n setInteractionMode('keyboard');\n setFloatingAutocompleteText(null);\n setAutocompleteRange(null);\n collectionFocusRetryCountRef.current = 0;\n\n if (collectionItemContexts.length === 0) {\n return;\n }\n\n // Navigation skips suggestions without stable keys because collection current-row state is\n // key-based.\n const currentIndex =\n currentRowKeyOverride === undefined\n ? -1\n : // Reuse the keyed index map instead of walking the whole collection on every arrow key.\n collectionItemIndexMap.get(currentRowKeyOverride) ?? -1;\n const isNavigatingFromLauncherWithPreviewedRow =\n currentIndex !== -1 &&\n filterTextRef.current.length > 0 &&\n !hasCollectionFocusSinceOpenRef.current &&\n document.activeElement === inputRef.current;\n const nextIndex = isNavigatingFromLauncherWithPreviewedRow\n ? currentIndex\n : direction === 'next'\n ? Math.min(currentIndex + 1, collectionItemContexts.length - 1)\n : currentIndex === -1\n ? collectionItemContexts.length - 1\n : Math.max(currentIndex - 1, 0);\n\n if (isNavigatingFromLauncherWithPreviewedRow) {\n hasCollectionFocusSinceOpenRef.current = true;\n }\n\n const previousKey = currentRowKeyOverrideRef.current;\n const nextKey = collectionItemContexts[nextIndex]?.key;\n currentRowKeyOverrideRef.current = nextKey;\n setCurrentRowKeyOverride(nextKey);\n\n if (nextKey === previousKey) {\n setCollectionFocusRequest((prev) => prev + 1);\n }\n },\n [collectionItemContexts, collectionItemIndexMap, currentRowKeyOverride, openDropdown]\n );\n\n // Explicit launcher activation opens suggestions. Desktop uses this instead of focus so\n // keyboard Tab can land on the field without immediately fetching or showing suggestions.\n const openSuggestions = useCallback(() => {\n pendingTypeaheadSyncRef.current = false;\n pendingCollectionInputOpenRef.current = false;\n\n if (hasSuggestionsDropdown) {\n if (isCollectionMode) {\n saveInputCaretRange();\n }\n openDropdown();\n setHoveredSuggestionIndex(-1);\n setInteractionMode(undefined);\n } else if (hasSuggestionsOverlay) {\n openDropdown();\n resetSuggestionFocusState();\n }\n }, [\n hasSuggestionsDropdown,\n hasSuggestionsOverlay,\n isCollectionMode,\n openDropdown,\n resetSuggestionFocusState,\n saveInputCaretRange\n ]);\n\n useEffect(() => {\n if (\n !pendingCollectionInputOpenRef.current ||\n !isCollectionMode ||\n isDropdownOpen ||\n (!hasSuggestionsDropdown && !hasSuggestionsOverlay)\n ) {\n return;\n }\n\n pendingCollectionInputOpenRef.current = false;\n\n if (document.activeElement !== inputRef.current) {\n return;\n }\n\n openSuggestions();\n }, [\n hasSuggestionsDropdown,\n hasSuggestionsOverlay,\n isCollectionMode,\n isDropdownOpen,\n openSuggestions\n ]);\n\n // Open the popup on input and track the latest typed value.\n const handleInput = useCallback(\n (detail: ValueUpdateDetail<string>) => {\n const nativeInputValue = detail.value ?? '';\n const previousFilterText = filterTextRef.current;\n const previousRenderedValue = renderedValueRef.current;\n const selectedAutocompleteRange = autocompleteRange;\n const nextValue =\n selectedAutocompleteRange &&\n nativeInputValue.startsWith(previousRenderedValue) &&\n nativeInputValue.length > previousRenderedValue.length\n ? previousFilterText + nativeInputValue.slice(previousRenderedValue.length)\n : nativeInputValue;\n const hasAutocompletePreview =\n autocompleteRange !== null && autocompleteRange.end > autocompleteRange.start;\n pendingControlledRestoreValueRef.current = null;\n const isShorteningPrefixEdit =\n nextValue.length < previousFilterText.length &&\n previousFilterText.toLowerCase().startsWith(nextValue.toLowerCase());\n const shouldSuppressAutocomplete = hasAutocompletePreview\n ? nextValue === previousFilterText\n : isShorteningPrefixEdit && floatingAutocompleteText === null;\n const isEditingAcceptedAutocompleteValue =\n acceptedAutocompleteValueRef.current !== null &&\n previousFilterText === acceptedAutocompleteValueRef.current &&\n nextValue !== acceptedAutocompleteValueRef.current;\n const isContinuingSuppressedPrefixEdit =\n commitRawValueOnEnterRef.current && !hasAutocompletePreview && isShorteningPrefixEdit;\n const shouldKeepRawCommitAfterSuppressedEdit =\n commitRawValueOnEnterRef.current && shouldSuppressAutocomplete;\n // The first Delete/Backspace dismisses the inline preview without a native input edit. Once\n // the user shortens that raw prefix again, restore the matching visual highlight while\n // keeping raw Enter commit authoritative over the highlighted suggestion.\n const shouldHighlightSuppressedPrefix =\n !isEditingAcceptedAutocompleteValue &&\n !isPhoneDevice &&\n (!shouldKeepRawCommitAfterSuppressedEdit || isContinuingSuppressedPrefixEdit);\n\n if (nextValue !== acceptedAutocompleteValueRef.current) {\n acceptedAutocompleteValueRef.current = null;\n }\n commitRawValueOnEnterRef.current = shouldKeepRawCommitAfterSuppressedEdit;\n\n if (isControlled) {\n const previousCommitValue =\n pendingControlledInputRef.current?.previousCommitValue ?? currentCommitValueRef.current;\n const inputCaretPosition = inputRef.current?.selectionStart ?? null;\n const caretPosition =\n inputCaretPosition !== null && inputCaretPosition !== nextValue.length\n ? inputCaretPosition\n : undefined;\n\n pendingControlledInputRef.current = {\n caretPosition,\n previousCommitValue,\n shouldHighlightSuppressedPrefix,\n shouldSuppressAutocomplete,\n value: nextValue\n };\n currentCommitValueRef.current = lastPropValueRef.current;\n pendingTypeaheadSyncRef.current = false;\n onInput?.({\n ...detail,\n value: nextValue\n });\n\n if (inputRef.current) {\n inputRef.current.value = renderedValueRef.current;\n }\n return;\n }\n\n applyInputValue(nextValue, shouldSuppressAutocomplete, { shouldHighlightSuppressedPrefix });\n onInput?.({\n ...detail,\n value: nextValue\n });\n },\n [\n applyInputValue,\n autocompleteRange,\n floatingAutocompleteText,\n isControlled,\n isPhoneDevice,\n onInput\n ]\n );\n\n // InputSearchBase emits only the submitted value for commit events, so\n // derive previousValue from the tracked controlled refs here.\n const commitValue = useCallback(\n (committedValue: string, itemContext?: InputSearchCommitDetail<T>['itemContext']) => {\n const nextCommittedValue =\n isControlled && itemContext === undefined && pendingControlledInputRef.current !== null\n ? lastPropValueRef.current\n : committedValue;\n const previousCommitValue = currentCommitValueRef.current;\n const committedKey = itemContext && 'key' in itemContext ? itemContext.key : undefined;\n\n pendingControlledInputRef.current = null;\n pendingControlledRestoreValueRef.current = null;\n pendingTypeaheadSyncRef.current = false;\n pendingCollectionInputOpenRef.current = false;\n acceptedAutocompleteValueRef.current = null;\n commitRawValueOnEnterRef.current = false;\n if (isControlled && itemContext !== undefined) {\n pendingControlledCollectionCommitValueRef.current = nextCommittedValue;\n pendingControlledCollectionCommitPreviousValueRef.current = lastPropValueRef.current;\n }\n filterTextRef.current = nextCommittedValue;\n renderedValueRef.current = nextCommittedValue;\n currentCommitValueRef.current = nextCommittedValue;\n overlayDismissRestoreValueRef.current = nextCommittedValue;\n setCommittedRowKey(committedKey);\n currentRowKeyOverrideRef.current = undefined;\n setCurrentRowKeyOverride(undefined);\n setFilterText(nextCommittedValue);\n setRenderedValue(nextCommittedValue);\n setFloatingAutocompleteText(null);\n setAutocompleteRange(null);\n suppressAutocompleteRef.current = false;\n shouldHighlightSuppressedPrefixRef.current = true;\n\n onCommit?.(\n itemContext\n ? {\n itemContext,\n previousValue: previousCommitValue,\n value: nextCommittedValue\n }\n : {\n previousValue: previousCommitValue,\n value: nextCommittedValue\n }\n );\n },\n [isControlled, onCommit]\n );\n\n const handleOverlayDismiss = useCallback(() => {\n const restoredValue = overlayDismissRestoreValueRef.current;\n const previousValue = filterTextRef.current;\n\n pendingTypeaheadSyncRef.current = false;\n pendingControlledRestoreValueRef.current = propValue !== undefined ? restoredValue : null;\n acceptedAutocompleteValueRef.current = null;\n commitRawValueOnEnterRef.current = false;\n filterTextRef.current = restoredValue;\n renderedValueRef.current = restoredValue;\n setFilterText(restoredValue);\n setRenderedValue(restoredValue);\n setFloatingAutocompleteText(null);\n setAutocompleteRange(null);\n setLastAnnouncedEmptyQuery('');\n suppressAutocompleteRef.current = false;\n shouldHighlightSuppressedPrefixRef.current = true;\n closeDropdown();\n\n if (previousValue !== restoredValue) {\n onInput?.({ previousValue, value: restoredValue });\n }\n }, [closeDropdown, onInput, propValue]);\n\n const handleOverlayCommit = useCallback(\n (committedValue: string) => {\n commitValue(committedValue);\n closeDropdown({ preserveDisplayValue: true });\n },\n [closeDropdown, commitValue]\n );\n\n // Collection templates can expose focus targets in light DOM or inside nested JET shadow roots.\n const getCollectionFocusTargets = useCallback(() => {\n const collectionContainer = collectionContainerRef.current;\n\n if (!collectionContainer) {\n return [];\n }\n\n const cachedFocusTargets = collectionFocusTargetsRef.current.filter((focusTarget) =>\n isValidCollectionElement(focusTarget, collectionContainer)\n );\n\n if (cachedFocusTargets.length > 0) {\n return cachedFocusTargets;\n }\n\n // Collection renderers can hide focusable targets inside shadow roots, so refresh lazily\n // only after the previous cache becomes stale.\n const focusTargets: HTMLElement[] = [];\n const seenFocusTargets = new Set<HTMLElement>();\n\n collectionFocusTargetSelectors.forEach((selector) => {\n querySelectorAllDeep(collectionContainer, selector).forEach((element) => {\n if (!seenFocusTargets.has(element)) {\n seenFocusTargets.add(element);\n focusTargets.push(element);\n }\n });\n });\n\n collectionFocusTargetsRef.current = focusTargets;\n return focusTargets;\n }, []);\n\n // Locate the DOM row for the current key so keyboard navigation keeps it in view.\n const getCollectionScrollTarget = useCallback(\n (key: InputSearchCollectionItemContext<T>['key']) => {\n const collectionContainer = collectionContainerRef.current;\n\n if (!collectionContainer || key === undefined) {\n return null;\n }\n\n const typedKeyLookup = getTypedCollectionKeyLookup(key);\n const cachedScrollTarget = collectionScrollTargetCacheRef.current.get(typedKeyLookup);\n\n if (isValidCollectionElement(cachedScrollTarget, collectionContainer)) {\n return cachedScrollTarget;\n }\n\n if (cachedScrollTarget) {\n collectionScrollTargetCacheRef.current.delete(typedKeyLookup);\n }\n\n // Fall back to a deep scan only when the keyed element cache misses or the DOM was recreated.\n const keyElements = querySelectorAllDeep(collectionContainer, collectionKeyElementSelector);\n const scrollTarget =\n keyElements.find((element) => isTypedCollectionKeyMatch(element, key)) ??\n keyElements.find((element) => isLegacyCollectionKeyMatch(element, key)) ??\n null;\n\n if (scrollTarget) {\n collectionScrollTargetCacheRef.current.set(typedKeyLookup, scrollTarget);\n }\n\n return scrollTarget;\n },\n []\n );\n\n // Restore launcher focus after collection interactions while preserving the typed caret when asked.\n const restoreInputFocus = useCallback((options?: { restoreCaret?: boolean }) => {\n const inputElement = inputRef.current;\n\n if (!inputElement) {\n return;\n }\n\n inputElement.focus();\n\n if (options?.restoreCaret) {\n const savedRange = savedCaretRangeRef.current;\n\n inputElement.setSelectionRange(\n savedRange?.start ?? filterTextRef.current.length,\n savedRange?.end ?? savedRange?.start ?? filterTextRef.current.length\n );\n return;\n }\n\n inputElement.setSelectionRange(filterTextRef.current.length, filterTextRef.current.length);\n }, []);\n\n // Move focus from the text field into the rendered collection body after ArrowUp/ArrowDown.\n const focusCollection = useCallback(() => {\n saveInputCaretRange();\n\n const focusTargets = getCollectionFocusTargets();\n\n if (focusTargets.length === 0) {\n return false;\n }\n\n const didFocusCollection = focusTargets.some((focusTarget) => {\n focusTarget.focus();\n const activeElement = getDeepActiveElement();\n const isCompletingFocusTarget =\n focusTarget.tabIndex >= 0 ||\n focusTarget.getAttribute('data-oj-input-search-focus-target') === 'true';\n const didFocus =\n isCompletingFocusTarget &&\n (activeElement === focusTarget || isElementWithinTarget(activeElement, focusTarget));\n\n if (didFocus) {\n hasCollectionFocusSinceOpenRef.current = true;\n }\n\n return didFocus;\n });\n\n if (!didFocusCollection) {\n collectionFocusTargetsRef.current = [];\n }\n\n return didFocusCollection;\n }, [getCollectionFocusTargets, saveInputCaretRange]);\n\n // Match Select's Shift+Tab boundary behavior by checking whether focus is currently on the\n // first tabbable collection descendant. Internal collection tab navigation should keep working.\n const isShiftTabLeavingCollectionBoundary = useCallback(() => {\n const collectionContainer = collectionContainerRef.current;\n if (!collectionContainer) {\n return false;\n }\n\n const tabbableElements = querySelectorAllDeep(\n collectionContainer,\n collectionTabbableSelector\n ).filter(isVisibleCollectionTabbable);\n\n if (tabbableElements.length === 0) {\n return false;\n }\n\n const firstTabbable = tabbableElements[0];\n const shallowActiveElement = document.activeElement;\n const deepActiveElement = getDeepActiveElement();\n\n return shallowActiveElement === firstTabbable || deepActiveElement === firstTabbable;\n }, [collectionContainerRef]);\n\n // Remove the popup immediately once keyboard focus is leaving it so the browser computes the\n // next tab stop relative to the input launcher instead of a stale collection cell.\n const removeDropdownElement = useCallback(() => {\n dropdownRef.current?.parentElement?.removeChild(dropdownRef.current);\n }, []);\n\n const handlePersistCurrentRowKey = useCallback(\n ({ value }: { value?: InputSearchCollectionItemContext<T>['key'] }) => {\n if (!isDropdownOpenRef.current) {\n return;\n }\n\n currentRowKeyOverrideRef.current = value;\n setCurrentRowKeyOverride(value);\n },\n []\n );\n\n // Explicit row actions commit the row text and keep the committed key selected on reopen.\n const handleCollectionRowAction = useCallback(\n ({ context }: { context: InputSearchCollectionItemContext<T> }) => {\n if (collectionTapActionTimerRef.current !== undefined) {\n window.clearTimeout(collectionTapActionTimerRef.current);\n collectionTapActionTimerRef.current = undefined;\n }\n\n const committedText = getRenderedItemText(context.data, context.index);\n\n commitValue(committedText, context);\n closeDropdown({ preserveDisplayValue: true });\n },\n [closeDropdown, commitValue, getRenderedItemText]\n );\n\n // Resolve a tapped collection element back to the normalized suggestion item context.\n const getCollectionItemContextFromElement = useCallback(\n (element: Element) => {\n const collectionContainer = collectionContainerRef.current;\n const keyElement = element.closest<HTMLElement>('[data-oj-input-search-key], [data-oj-key]');\n\n if (!collectionContainer || !keyElement || !collectionContainer.contains(keyElement)) {\n return undefined;\n }\n\n const keyAttribute =\n keyElement.getAttribute('data-oj-input-search-key') ??\n keyElement.getAttribute('data-oj-key');\n const keyTypeAttribute =\n keyElement.getAttribute('data-oj-input-search-key-type') ??\n keyElement.getAttribute('data-oj-key-type');\n\n if (keyAttribute === null) {\n return undefined;\n }\n\n if (keyTypeAttribute === 'number' || keyTypeAttribute === 'string') {\n return collectionTypedKeyMap.get(\n getTypedCollectionKeyLookup(keyAttribute, keyTypeAttribute)\n );\n }\n\n // Older/custom rows may omit key-type markers, so keep a legacy string lookup as a fallback.\n return (\n collectionTypedKeyMap.get(getTypedCollectionKeyLookup(keyAttribute, 'string')) ??\n collectionLegacyKeyMap.get(keyAttribute)\n );\n },\n [collectionLegacyKeyMap, collectionTypedKeyMap]\n );\n\n // Capture real collection row clicks so rendered list/table rows commit consistently.\n const handleCollectionClickCapture = useCallback(\n (event: MouseEvent) => {\n if (!isCollectionMode || !isDropdownOpen || event.defaultPrevented) {\n return;\n }\n\n const target = event.target;\n\n if (!(target instanceof Element) || !collectionContainerRef.current?.contains(target)) {\n return;\n }\n\n const actionableElement = target.closest(\n '[role=\"gridcell\"], [role=\"cell\"], [role=\"option\"], [role=\"listitem\"], [role=\"row\"]'\n );\n\n if (!actionableElement || !collectionContainerRef.current.contains(actionableElement)) {\n return;\n }\n\n const interactiveDescendant = target.closest(interactiveCollectionDescendantSelector);\n\n if (\n interactiveDescendant &&\n interactiveDescendant !== actionableElement &&\n actionableElement.contains(interactiveDescendant)\n ) {\n return;\n }\n\n if (collectionTapActionTimerRef.current !== undefined) {\n window.clearTimeout(collectionTapActionTimerRef.current);\n }\n\n const tappedItemContext = getCollectionItemContextFromElement(actionableElement);\n\n collectionTapActionTimerRef.current = window.setTimeout(() => {\n collectionTapActionTimerRef.current = undefined;\n\n if (event.defaultPrevented) {\n return;\n }\n\n const currentItemContext =\n currentRowKeyOverrideRef.current === undefined\n ? undefined\n : suggestionContextMap.get(currentRowKeyOverrideRef.current);\n const itemContext = tappedItemContext ?? currentItemContext;\n\n if (itemContext) {\n handleCollectionRowAction({ context: itemContext });\n }\n }, 0);\n },\n [\n getCollectionItemContextFromElement,\n handleCollectionRowAction,\n isCollectionMode,\n isDropdownOpen,\n suggestionContextMap\n ]\n );\n\n // Escape closes collection mode from inside the rendered collection. Enter commits the current\n // row when focus is inside the collection. Shift+Tab restores the raw typed text before focus\n // leaves the collection so blur writeback does not commit the preview row.\n const handleCollectionKeyDownCapture = useCallback(\n (event: KeyboardEvent) => {\n if (event.key === 'Enter' && !event.repeat) {\n const target = event.target;\n const collectionContainer = collectionContainerRef.current;\n\n if (\n !isCollectionMode ||\n !isDropdownOpen ||\n event.defaultPrevented ||\n !(target instanceof Element) ||\n !isElementWithinTarget(target, collectionContainer)\n ) {\n return;\n }\n\n const interactiveDescendant = target.closest(interactiveCollectionDescendantSelector);\n\n if (\n interactiveDescendant &&\n isElementWithinTarget(interactiveDescendant, collectionContainer)\n ) {\n return;\n }\n\n const currentItemContext =\n currentRowKeyOverrideRef.current === undefined\n ? undefined\n : suggestionContextMap.get(currentRowKeyOverrideRef.current);\n const itemContext = currentItemContext ?? getCollectionItemContextFromElement(target);\n\n if (itemContext) {\n event.preventDefault();\n event.stopPropagation();\n handleCollectionRowAction({ context: itemContext });\n }\n\n return;\n }\n\n if (event.key === 'Tab' && event.shiftKey) {\n if (hasSuggestionsDropdown && isShiftTabLeavingCollectionBoundary()) {\n restoreCollectionInputValue();\n restoreInputFocus({ restoreCaret: true });\n blurCollectionAndClose();\n removeDropdownElement();\n return;\n }\n\n shouldRestoreCollectionInputValueOnFocusRef.current = true;\n return;\n }\n\n if (event.key !== 'Escape') {\n return;\n }\n\n event.preventDefault();\n shouldFocusCollectionRef.current = false;\n shouldRestoreCollectionInputValueOnFocusRef.current = false;\n closeDropdown();\n },\n [\n blurCollectionAndClose,\n closeDropdown,\n getCollectionItemContextFromElement,\n handleCollectionRowAction,\n hasSuggestionsDropdown,\n isCollectionMode,\n isDropdownOpen,\n isShiftTabLeavingCollectionBoundary,\n removeDropdownElement,\n restoreCollectionInputValue,\n restoreInputFocus,\n suggestionContextMap\n ]\n );\n\n // Desktop/mobile Enter handling can use this to commit the active collection row.\n const commitCurrentCollectionSelection = useCallback(() => {\n if (!isDropdownOpen || currentRowKeyOverride === undefined) {\n return false;\n }\n\n const itemContext = suggestionContextMap.get(currentRowKeyOverride);\n\n if (!itemContext) {\n return false;\n }\n\n handleCollectionRowAction({ context: itemContext });\n return true;\n }, [currentRowKeyOverride, handleCollectionRowAction, isDropdownOpen, suggestionContextMap]);\n\n // Collapse the desktop popup when no suggestions remain after loading completes.\n useEffect(() => {\n if (\n hasSuggestionsDropdown &&\n isDropdownOpen &&\n !isSuggestionsLoading &&\n suggestionItems.length === 0\n ) {\n closeDropdown();\n }\n }, [\n closeDropdown,\n hasSuggestionsDropdown,\n isDropdownOpen,\n isSuggestionsLoading,\n suggestionItems.length\n ]);\n\n // Announce empty results only once per typed query while the popup stays open.\n useEffect(() => {\n // trim the input value to avoid announcing empty results for queries that are only whitespace.\n const currentQuery = filterTextRef.current.trim();\n const shouldAnnounceEmptyResults =\n hasSuggestions &&\n isDropdownOpen &&\n !isSuggestionsLoading &&\n suggestionItems.length === 0 &&\n currentQuery !== '' &&\n lastAnnouncedEmptyQuery !== currentQuery;\n\n if (shouldAnnounceEmptyResults) {\n setLastAnnouncedEmptyQuery(currentQuery);\n }\n }, [\n hasSuggestions,\n isDropdownOpen,\n isSuggestionsLoading,\n lastAnnouncedEmptyQuery,\n suggestionItems.length\n ]);\n\n const currentQuery = filterText.trim();\n const shouldAnnounceNoMatches =\n hasSuggestions &&\n !isSuggestionsLoading &&\n currentQuery !== '' &&\n suggestionItems.length === 0 &&\n lastAnnouncedEmptyQuery === currentQuery;\n const shouldAnnounceResults =\n hasSuggestions &&\n !isSuggestionsLoading &&\n currentQuery !== '' &&\n suggestionItems.length > 0 &&\n isDropdownOpen;\n\n // Phone keeps its full-screen suggestions flow attached to focus because opening the overlay\n // moves focus into a separate modal field. Desktop launcher focus alone should not open.\n const handleFocus = useCallback(() => {\n if (hasSuggestionsOverlay) {\n openSuggestions();\n }\n }, [hasSuggestionsOverlay, openSuggestions]);\n\n // Commit a suggestion label as the next submitted value. Pointer-based selection\n // restores focus to the input so keyboard interaction can continue immediately.\n const handleSuggestionSelection = useCallback(\n (suggestion: T, index: number, options?: { restoreFocus?: boolean }) => {\n const itemContext = isCollectionMode\n ? getSuggestionItemContext(suggestion, index)\n : { data: suggestion, index };\n commitValue(getRenderedItemText(suggestion, index), itemContext);\n closeDropdown({ preserveDisplayValue: true });\n\n if (options?.restoreFocus) {\n inputRef.current?.focus();\n }\n },\n [closeDropdown, commitValue, getRenderedItemText, getSuggestionItemContext, isCollectionMode]\n );\n\n // Pointer hover affects visuals, but keyboard focus remains authoritative for aria-activedescendant.\n const handleHoverIndexChange = useCallback((index: number) => {\n setHoveredSuggestionIndex(index);\n setInteractionMode('pointer');\n }, []);\n\n // Clearing from the mobile overlay behaves like a fresh input event: reset the\n // query and announcement state, keep the overlay open, and refocus the field.\n const handleOverlayClear = useCallback(() => {\n const previousValue = filterTextRef.current;\n\n pendingTypeaheadSyncRef.current = false;\n suppressAutocompleteRef.current = false;\n acceptedAutocompleteValueRef.current = null;\n commitRawValueOnEnterRef.current = false;\n shouldHighlightSuppressedPrefixRef.current = true;\n // Back should preserve an explicit mobile clear instead of restoring the prior commit.\n overlayDismissRestoreValueRef.current = '';\n setLastAnnouncedEmptyQuery('');\n filterTextRef.current = '';\n renderedValueRef.current = '';\n setFilterText('');\n setRenderedValue('');\n setFloatingAutocompleteText(null);\n setAutocompleteRange(null);\n clearCollectionCurrentRow();\n openDropdown();\n resetSuggestionFocusState();\n onInput?.({ previousValue, value: '' });\n inputRef.current?.focus();\n }, [clearCollectionCurrentRow, onInput, openDropdown, resetSuggestionFocusState]);\n\n const handlePointerLeave = useCallback(() => {\n setHoveredSuggestionIndex(-1);\n setInteractionMode(keyboardFocusedSuggestionIndex >= 0 ? 'keyboard' : undefined);\n }, [keyboardFocusedSuggestionIndex]);\n\n // Deleting the selected suffix of an inline autocomplete preview follows legacy\n // ojinputsearch behavior: keep the typed prefix, clear the highlighted option,\n // and let the next Enter commit the raw prefix instead of selecting the suggestion.\n const dismissAutocompletePreview = useCallback(() => {\n pendingTypeaheadSyncRef.current = false;\n suppressAutocompleteRef.current = true;\n acceptedAutocompleteValueRef.current = null;\n commitRawValueOnEnterRef.current = true;\n shouldHighlightSuppressedPrefixRef.current = false;\n resetAutocomplete(filterTextRef.current);\n restoreCaretToRawPrefixEnd();\n setHoveredSuggestionIndex(-1);\n setKeyboardFocusedSuggestionIndex(-1);\n setShowKeyboardFocusIndicator(false);\n setInteractionMode(undefined);\n }, [resetAutocomplete, restoreCaretToRawPrefixEnd]);\n\n const clearFullySelectedValue = useCallback(() => {\n const previousValue = renderedValueRef.current;\n\n pendingControlledRestoreValueRef.current = null;\n pendingTypeaheadSyncRef.current = false;\n acceptedAutocompleteValueRef.current = null;\n commitRawValueOnEnterRef.current = false;\n shouldHighlightSuppressedPrefixRef.current = true;\n applyInputValue('', false);\n resetSuggestionFocusState();\n onInput?.({ previousValue, value: '' });\n }, [applyInputValue, onInput, resetSuggestionFocusState]);\n\n // Arrow-key acceptance of an inline starts-with preview should promote the\n // rendered text into the raw filter value so controlled parents stay in sync.\n const acceptAutocompletePreview = useCallback(\n (acceptedValue: string, caretPosition?: number) => {\n const previousValue = filterTextRef.current;\n\n pendingTypeaheadSyncRef.current = hasSuggestions;\n pendingAcceptedCaretPositionRef.current = caretPosition ?? null;\n pendingTypeaheadAcceptedCaretPositionRef.current = caretPosition ?? null;\n acceptedAutocompleteValueRef.current = acceptedValue;\n commitRawValueOnEnterRef.current = false;\n shouldHighlightSuppressedPrefixRef.current = true;\n filterTextRef.current = acceptedValue;\n renderedValueRef.current = acceptedValue;\n setLastAnnouncedEmptyQuery('');\n setFilterText(acceptedValue);\n setRenderedValue(acceptedValue);\n setFloatingAutocompleteText(null);\n setAutocompleteRange(null);\n suppressAutocompleteRef.current = false;\n setHoveredSuggestionIndex(-1);\n setInteractionMode('keyboard');\n onInput?.({ previousValue, value: acceptedValue });\n\n if (caretPosition !== undefined) {\n queueMicrotask(() => {\n const inputElement = inputRef.current;\n\n if (inputElement && document.activeElement === inputElement) {\n inputElement.setSelectionRange(caretPosition, caretPosition);\n }\n });\n }\n },\n [hasSuggestions, onInput]\n );\n\n // Handle popup keyboard navigation and keyboard-based suggestion selection.\n const handleKeyDown = useCallback(\n (event: KeyboardEvent) => {\n if (event.defaultPrevented || !hasSuggestions) {\n return;\n }\n\n const hasAutocompletePreview =\n autocompleteRange !== null && autocompleteRange.end > autocompleteRange.start;\n\n switch (event.key) {\n case 'Tab': {\n if (isCollectionMode && hasSuggestionsDropdown && isDropdownOpen) {\n // Match Select behavior: leave the component from the input on Tab/Shift+Tab instead\n // of tunneling focus into the collection body, while preserving the typed raw value.\n restoreCollectionInputValue();\n blurCollectionAndClose();\n removeDropdownElement();\n }\n break;\n }\n case 'ArrowDown': {\n event.preventDefault();\n if (isCollectionMode) {\n if (hasSuggestionsDropdown && !isDropdownOpen) {\n openSuggestions();\n break;\n }\n shouldFocusCollectionRef.current = true;\n moveCollectionCurrentRow('next');\n break;\n }\n if (hasSuggestionsDropdown && !isDropdownOpen) {\n openSuggestions();\n break;\n }\n moveKeyboardFocus('next');\n break;\n }\n case 'ArrowUp': {\n event.preventDefault();\n if (isCollectionMode) {\n if (hasSuggestionsDropdown && !isDropdownOpen) {\n openSuggestions();\n break;\n }\n shouldFocusCollectionRef.current = true;\n moveCollectionCurrentRow('previous');\n break;\n }\n if (hasSuggestionsDropdown && !isDropdownOpen) {\n openSuggestions();\n break;\n }\n moveKeyboardFocus('previous');\n break;\n }\n case 'Escape': {\n if (isDropdownOpen) {\n event.preventDefault();\n if (isCollectionMode) {\n shouldFocusCollectionRef.current = false;\n restoreInputFocus({ restoreCaret: true });\n }\n closeDropdown();\n }\n break;\n }\n case 'ArrowLeft':\n case 'ArrowRight': {\n if (hasAutocompletePreview && autocompleteRange) {\n event.preventDefault();\n const caretPosition =\n event.key === 'ArrowLeft' ? autocompleteRange.start : renderedValueRef.current.length;\n acceptAutocompletePreview(renderedValueRef.current, caretPosition);\n }\n break;\n }\n case 'Backspace':\n case 'Delete': {\n const inputElement = inputRef.current;\n const selectionStart = inputElement?.selectionStart;\n const selectionEnd = inputElement?.selectionEnd;\n const hasTextSelection =\n selectionStart != null && selectionEnd != null && selectionStart !== selectionEnd;\n const isFullValueSelected =\n hasTextSelection &&\n selectionStart === 0 &&\n selectionEnd === renderedValueRef.current.length;\n\n if (isFullValueSelected) {\n event.preventDefault();\n clearFullySelectedValue();\n } else if (autocompleteRange !== null) {\n event.preventDefault();\n dismissAutocompletePreview();\n }\n break;\n }\n case 'Enter': {\n if (isCollectionMode) {\n break;\n }\n\n if (\n isDropdownOpen &&\n keyboardFocusedSuggestionIndex >= 0 &&\n !commitRawValueOnEnterRef.current\n ) {\n const suggestion = suggestionItems[keyboardFocusedSuggestionIndex];\n if (suggestion) {\n event.preventDefault();\n handleSuggestionSelection(suggestion, keyboardFocusedSuggestionIndex);\n }\n }\n break;\n }\n default:\n break;\n }\n },\n [\n acceptAutocompletePreview,\n blurCollectionAndClose,\n clearFullySelectedValue,\n closeDropdown,\n dismissAutocompletePreview,\n handleSuggestionSelection,\n hasSuggestions,\n hasSuggestionsDropdown,\n autocompleteRange,\n isCollectionMode,\n isDropdownOpen,\n keyboardFocusedSuggestionIndex,\n moveCollectionCurrentRow,\n moveKeyboardFocus,\n openSuggestions,\n removeDropdownElement,\n restoreInputFocus,\n restoreCollectionInputValue,\n suggestionItems\n ]\n );\n\n // Desktop only stays open while there is loading or renderable suggestion content, but\n // phone keeps the overlay open after loading even with zero suggestions so the dialog\n // and search field remain available. The focus effect below relies on that distinction.\n const shouldRenderSuggestions = isDropdownOpen && suggestionItems.length > 0;\n const shouldRenderLoading = isDropdownOpen && isSuggestionsLoading;\n const shouldKeepOverlayOpen = hasSuggestionsOverlay && isDropdownOpen && !isSuggestionsLoading;\n const isPopupOpen = shouldRenderLoading || shouldRenderSuggestions || shouldKeepOverlayOpen;\n const activeDescendantId =\n !isCollectionMode && isPopupOpen && !isSuggestionsLoading && keyboardFocusedSuggestionIndex >= 0\n ? `${dropdownId}-option-${keyboardFocusedSuggestionIndex}`\n : undefined;\n const renderedSuggestions = shouldRenderSuggestions ? suggestionItems : [];\n const loadingSkeletonCount = shouldRenderLoading ? lastRenderedSuggestionCountRef.current : 1;\n // Select only the committed row that still exists in the current suggestion set.\n const selectedKeys = useMemo(() => {\n if (committedRowKey === undefined) {\n return undefined;\n }\n\n if (!isSuggestionsLoading && !suggestionContextMap.has(committedRowKey)) {\n return undefined;\n }\n\n return new Set([committedRowKey]);\n }, [committedRowKey, isSuggestionsLoading, suggestionContextMap]);\n // This context is the contract between InputSearch and arbitrary collection renderers.\n // Keep it memoized so collection components do not see fresh callbacks on every render.\n const collectionRendererContext = useMemo<InputSearchCollectionRendererProps<T>>(\n () => ({\n currentRowKeyOverride,\n getSuggestionKey,\n onPersistCurrentRowKey: handlePersistCurrentRowKey,\n onRowAction: handleCollectionRowAction,\n searchText: filterText === '' ? undefined : filterText,\n selected: selectedKeys,\n suggestions\n }),\n [\n currentRowKeyOverride,\n filterText,\n getSuggestionKey,\n handleCollectionRowAction,\n handlePersistCurrentRowKey,\n selectedKeys,\n suggestions\n ]\n );\n\n // Focus the mobile overlay input during layout so the focus handoff can stay\n // tied to the opening gesture before the browser paints the dialog.\n useLayoutEffect(() => {\n if (\n !hasSuggestionsOverlay ||\n !isPopupOpen ||\n (isCollectionMode && shouldFocusCollectionRef.current)\n ) {\n return;\n }\n\n // Focus immediately after the overlay input mounts so mobile browsers, especially iOS,\n // can keep the focus change tied to the original tap and bring up the virtual keyboard.\n inputRef.current?.focus();\n }, [hasSuggestionsOverlay, isCollectionMode, isPopupOpen]);\n\n // Retry mobile overlay focus after the launcher event completes in case the\n // original tap/click steals focus back from the newly mounted dialog input.\n useEffect(() => {\n if (\n !hasSuggestionsOverlay ||\n !isPopupOpen ||\n (isCollectionMode && shouldFocusCollectionRef.current)\n ) {\n return;\n }\n\n // Defer focus until after the launcher click/tap completes so the mobile\n // overlay input can still reclaim focus if the launcher tap/click steals it back.\n mobileOverlayFocusTimerRef.current = window.setTimeout(() => {\n mobileOverlayFocusTimerRef.current = undefined;\n\n if (document.activeElement !== inputRef.current) {\n inputRef.current?.focus();\n }\n }, 0);\n\n return () => {\n if (mobileOverlayFocusTimerRef.current !== undefined) {\n window.clearTimeout(mobileOverlayFocusTimerRef.current);\n mobileOverlayFocusTimerRef.current = undefined;\n }\n };\n }, [hasSuggestionsOverlay, isCollectionMode, isPopupOpen]);\n\n // Move focus into the collection once ArrowUp/ArrowDown has requested collection focus.\n useEffect(() => {\n if (\n !isCollectionMode ||\n !isPopupOpen ||\n (shouldRenderLoading && collectionItemContexts.length === 0) ||\n !shouldFocusCollectionRef.current\n ) {\n return;\n }\n\n // Keyboard ArrowUp/ArrowDown from the launcher requests focus into the collection. The actual\n // target might not be focusable until after table/list rendering settles, so use the bounded\n // retry window declared above rather than treating the first missing target as a failure.\n if (focusCollection()) {\n shouldFocusCollectionRef.current = false;\n collectionFocusRetryCountRef.current = 0;\n return;\n }\n\n if (collectionFocusRetryCountRef.current >= COLLECTION_FOCUS_RETRY_LIMIT) {\n collectionFocusRetryCountRef.current = 0;\n shouldFocusCollectionRef.current = false;\n return;\n }\n\n if (collectionFocusRetryTimerRef.current === undefined) {\n collectionFocusRetryCountRef.current += 1;\n collectionFocusRetryTimerRef.current = window.setTimeout(() => {\n collectionFocusRetryTimerRef.current = undefined;\n\n if (shouldFocusCollectionRef.current) {\n setCollectionFocusRequest((prev) => prev + 1);\n }\n }, COLLECTION_FOCUS_RETRY_DELAY);\n }\n }, [\n collectionFocusRequest,\n collectionItemContexts.length,\n currentRowKeyOverride,\n focusCollection,\n isCollectionMode,\n isPopupOpen,\n shouldRenderLoading\n ]);\n\n // Scroll the current collection row into view after current-row state changes.\n useEffect(() => {\n if (\n !isCollectionMode ||\n !isPopupOpen ||\n shouldRenderLoading ||\n currentRowKeyOverride === undefined\n ) {\n return;\n }\n\n // Keep the preview/current row visible while keyboard navigation drives collection state.\n getCollectionScrollTarget(currentRowKeyOverride)?.scrollIntoView({ block: 'nearest' });\n }, [\n currentRowKeyOverride,\n getCollectionScrollTarget,\n isCollectionMode,\n isPopupOpen,\n shouldRenderLoading\n ]);\n\n // Clear delayed mobile collection tap commits if the hook unmounts before the timer fires.\n useEffect(() => {\n return () => {\n if (collectionTapActionTimerRef.current !== undefined) {\n window.clearTimeout(collectionTapActionTimerRef.current);\n }\n if (collectionFocusRetryTimerRef.current !== undefined) {\n window.clearTimeout(collectionFocusRetryTimerRef.current);\n }\n };\n }, []);\n\n const shouldCommitRawValueOnEnter = useCallback(() => commitRawValueOnEnterRef.current, []);\n\n return {\n collectionContainerRef,\n collectionRendererContext,\n activeDescendantId,\n closeDropdown,\n commitCurrentCollectionSelection,\n dropdownId,\n dropdownRef,\n handleDropdownAutoDismiss,\n handleOverlayDismiss,\n handleInputBlur,\n handleCommit: commitValue,\n handleCollectionClickCapture,\n handleCollectionFocusOut,\n handleCollectionRowAction,\n handleCollectionKeyDownCapture,\n handleFocus,\n handleHoverIndexChange,\n handleInput,\n handleKeyDown,\n handleOverlayClear,\n handleOverlayCommit,\n handlePointerLeave,\n handleSuggestionSelection,\n hasSuggestionsDropdown,\n hasSuggestionsOverlay,\n isCollectionMode,\n filterText,\n hoveredSuggestionIndex,\n inputRef,\n inputType,\n interactionMode,\n isPopupOpen,\n keyboardFocusedSuggestionIndex,\n showKeyboardFocusIndicator,\n loadingSkeletonCount,\n floatingAutocompleteText,\n optionRefs: optionRefs.current,\n openSuggestions,\n renderedSuggestions,\n renderedValue,\n rootRef,\n shouldAnnounceNoMatches,\n shouldAnnounceResults,\n shouldCommitRawValueOnEnter,\n shouldRenderLoading\n };\n}\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * Licensed under The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport type { ComponentChildren, ComponentProps, Ref } from 'preact';\nimport { forwardRef } from 'preact/compat';\nimport { useCallback, useEffect, useImperativeHandle, useMemo, useRef } from 'preact/hooks';\nimport { useTestId } from '#hooks/UNSAFE_useTestId';\nimport { useTranslationBundle } from '#hooks/UNSAFE_useTranslationBundle';\nimport type { FocusableHandle } from '#hooks/UNSAFE_useFocusableTextField';\nimport type { ValueUpdateDetail } from '#utils/UNSAFE_valueUpdateDetail';\nimport type { BundleType } from '#resources/nls/bundle';\nimport { InputSearchBase } from './InputSearchBase';\nimport { InputSearchDesktopSuggestions } from './InputSearchDesktopSuggestions';\nimport { InputSearchMobileDropdown } from './InputSearchMobileDropdown';\nimport { useComponentTheme } from '#hooks/UNSAFE_useComponentTheme';\nimport type { InputSearchVariantOptions, InputSearchStyles } from './themes/InputSearchStyles.css';\nimport { InputSearchRedwoodTheme } from './themes/redwood/InputSearchTheme';\nimport { useInputSearch } from './useInputSearch';\n\n/**\n * Property key type supported by InputSearch suggestion records.\n */\ntype Key = string | number;\n\n/**\n * Generic suggestion record shape accepted by InputSearch.\n */\ntype Data = Record<Key, unknown>;\n\n/**\n * Suggestions can use any object shape. If suggestionItemText is not specified, then the component will\n * attempt to render as text the 'label' field in the suggestion by default.\n */\ntype InputSearchSuggestion<T extends Data> = T;\n\n/**\n * Context passed to suggestion-based callbacks.\n *\n * Preact InputSearch receives suggestions as an array, so the context intentionally exposes the\n * selected suggestion data and its rendered array index.\n */\ntype InputSearchSuggestionItemContext<\n T extends InputSearchSuggestion<Data> = InputSearchSuggestion<Data>\n> = {\n /**\n * Suggestion data object supplied through the `suggestions` property.\n */\n data: T;\n\n /**\n * Index of the suggestion in the rendered suggestions array.\n */\n index: number;\n};\n\n/**\n * Context passed to collection-mode callbacks and keyed suggestion commits.\n */\ntype InputSearchCollectionItemContext<\n T extends InputSearchSuggestion<Data> = InputSearchSuggestion<Data>\n> = InputSearchSuggestionItemContext<T> & {\n /**\n * Stable key for the rendered suggestion item.\n * Required for collection-mode current-row, selected-row, and row-action handling.\n */\n key: Key;\n\n /**\n * Metadata for the rendered suggestion item when a stable key is available.\n */\n metadata: { key: Key };\n};\n\ntype InputSearchCommitItemContext<\n T extends InputSearchSuggestion<Data> = InputSearchSuggestion<Data>\n> = InputSearchSuggestionItemContext<T> | InputSearchCollectionItemContext<T>;\n\n/**\n * Top-level suggestion keys whose values can be rendered directly as text.\n */\ntype InputSearchSuggestionTextField<\n T extends InputSearchSuggestion<Data> = InputSearchSuggestion<Data>\n> = string extends keyof T\n ? Extract<keyof T, string>\n : Extract<\n {\n [K in keyof T]-?: Exclude<T[K], undefined> extends string ? K : never;\n }[keyof T],\n string\n >;\n\n/**\n * Top-level suggestion keys whose values can be resolved to stable row keys.\n */\ntype InputSearchSuggestionKeyField<\n T extends InputSearchSuggestion<Data> = InputSearchSuggestion<Data>\n> = string extends keyof T\n ? Extract<keyof T, string>\n : Extract<\n {\n [K in keyof T]-?: Exclude<T[K], undefined> extends Key ? K : never;\n }[keyof T],\n string\n >;\n\n/**\n * Props passed to a custom suggestion renderer.\n */\ntype InputSearchSuggestionItemRendererProps<\n T extends InputSearchSuggestion<Data> = InputSearchSuggestion<Data>\n> = InputSearchSuggestionItemContext<T> & {\n /**\n * User-entered search text.\n * This property will be undefined when the suggestions are shown before typing.\n */\n searchText?: string;\n};\n\n/**\n * Specifies how to derive the text string for a suggestion.\n */\ntype InputSearchSuggestionItemText<\n T extends InputSearchSuggestion<Data> = InputSearchSuggestion<Data>\n> =\n | InputSearchSuggestionTextField<T>\n | ((itemContext: InputSearchSuggestionItemContext<T>) => string);\n\n/**\n * Specifies how to derive a stable key for collection-mode suggestions.\n */\ntype InputSearchSuggestionItemKey<\n T extends InputSearchSuggestion<Data> = InputSearchSuggestion<Data>\n> = InputSearchSuggestionKeyField<T> | ((itemContext: InputSearchSuggestionItemContext<T>) => Key);\n\n/**\n * Render function for a suggestion.\n */\ntype InputSearchSuggestionItemRenderer<\n T extends InputSearchSuggestion<Data> = InputSearchSuggestion<Data>\n> = (\n /**\n * Context for the suggestion row being rendered.\n */\n suggestionItemRendererProps: InputSearchSuggestionItemRendererProps<T>\n) => ComponentChildren;\n\n/**\n * Props passed to a custom collection renderer.\n */\ntype InputSearchCollectionRendererProps<\n T extends InputSearchSuggestion<Data> = InputSearchSuggestion<Data>\n> = {\n /**\n * Current suggestion source supplied to InputSearch.\n */\n suggestions: readonly T[] | null | undefined;\n\n /**\n * Resolves a stable row key for collection-mode suggestions.\n */\n getSuggestionKey: (data: T, index: number) => Key | undefined;\n\n /**\n * Overrides the current preview row in the rendered collection.\n */\n currentRowKeyOverride?: Key;\n\n /**\n * Callback invoked when the collection wants to persist a new current row.\n */\n onPersistCurrentRowKey: (detail: { value?: Key }) => void;\n\n /**\n * Callback invoked when the user explicitly performs an action on a row.\n */\n onRowAction: (detail: { context: InputSearchCollectionItemContext<T> }) => void;\n\n /**\n * User-entered search text.\n */\n searchText?: string;\n\n /**\n * Selected keys in the collection while collection mode is active.\n */\n selected?: Set<Key>;\n};\n\n/**\n * Render function for collection-mode suggestions.\n */\ntype InputSearchCollectionRenderer<\n T extends InputSearchSuggestion<Data> = InputSearchSuggestion<Data>\n> = (collectionRendererProps: InputSearchCollectionRendererProps<T>) => ComponentChildren;\n\n/**\n * Commit detail emitted when the user submits the current query or selects a suggestion.\n */\ntype InputSearchCommitDetail<T extends InputSearchSuggestion<Data> = InputSearchSuggestion<Data>> =\n ValueUpdateDetail<string> & {\n /**\n * Selected item context when the commit came from choosing a suggestion.\n * The context always contains the selected suggestion data and rendered array index.\n * Collection-mode commits also include a stable key and metadata.\n * This will be undefined for freeform Enter submits and clear-to-empty commits.\n */\n itemContext?: InputSearchCommitItemContext<T>;\n };\n\n// TODO: JET-44222 Desktop clear search button\ntype InputSearchBaseProps = ComponentProps<typeof InputSearchBase>;\n\n/**\n * Props shared by both suggestion-list and collection-mode InputSearch configurations.\n */\ntype InputSearchCommonProps<T extends InputSearchSuggestion<Data> = InputSearchSuggestion<Data>> = {\n /**\n * Associates the input with descriptive text.\n * @default undefined\n */\n 'aria-describedby'?: InputSearchBaseProps['ariaDescribedBy'];\n\n /**\n * Specifies whether suggestions can enable autocomplete typeahead preview.\n * When set to `on`, prefix matches can preview the first suggestion inline. Desktop partial\n * matches can also preview the first suggestion as floating text, but phones suppress floating\n * autocomplete and keep non-prefix matches raw. When set to `off`, suggestions still render, but\n * typing does not automatically preview or focus the first suggestion until the user navigates to\n * it explicitly.\n * @default 'on'\n */\n autocomplete?: 'on' | 'off';\n\n /**\n * Callback invoked when the user commits the entered value by pressing Enter or selecting a suggestion.\n * Suggestion selection commits include `itemContext` with the selected suggestion data and rendered array index.\n * @default undefined\n */\n onCommit?: (detail: InputSearchCommitDetail<T>) => void;\n\n /**\n * Internal callback invoked when the visible field value changes without a native input event.\n * Used by wrappers that expose raw display value while keeping `onInput` tied to user edits.\n * @default undefined\n */\n onDisplayValueChanged?: (detail: ValueUpdateDetail<string>) => void;\n\n /**\n * Callback invoked each time the user changes the value of the field.\n * @default undefined\n */\n onInput?: InputSearchBaseProps['onInput'];\n\n /**\n * A short hint to display before the user enters a value.\n * @default undefined\n */\n placeholder?: InputSearchBaseProps['placeholder'];\n\n /**\n * External suggestions to render in the dropdown.\n * Pass `null` to show the loading state while suggestions are being fetched.\n * On desktop and tablet, suggestions render in an anchored popup listbox.\n * On phones, suggestions render in a full-screen dialog.\n * If suggestionItemText is not specified, then the component will attempt to render as text the `label`\n * field in the suggestion by default.\n * @default undefined\n */\n suggestions?: readonly T[] | null;\n\n /**\n * Specifies the text to render for a suggestion. Set this to either a string-valued top-level\n * data field name or a callback that returns the display text from a suggestion context.\n * By default, the component uses the `label` field.\n *\n * This text is used for the selected value and, if no `suggestionItemRenderer` is provided, for\n * each dropdown suggestion. Default search term highlighting is still applied in the dropdown.\n * @default 'label'\n */\n suggestionItemText?: InputSearchSuggestionItemText<T>;\n\n /**\n * Custom render function for each suggestion row in the dropdown.\n *\n * The renderer receives an `InputSearchSuggestionItemRendererProps` object containing:\n * - `data`: The full suggestion object\n * - `index`: The suggestion's position in the list\n * - `searchText`: The current user input (undefined before any typing occurs)\n *\n * Use the `HighlightText` component inside your renderer to preserve search term\n * highlighting. The committed value will still be derived from `suggestionItemText`\n * (or the `label` field by default). The `onCommit` event will include `itemContext`\n * with the selected suggestion context.\n *\n * **Performance note**: Complex renderers are invoked on every list render. Consider\n * memoization for expensive computations.\n *\n * @example\n * ```tsx\n * suggestionItemRenderer={({ data, searchText }) => (\n * <ListItemLayout\n * primary={<HighlightText matchText={searchText}>{data.label}</HighlightText>}\n * tertiary={<Text>{data.category}</Text>}\n * />\n * )}\n * ```\n * @default undefined\n */\n suggestionItemRenderer?: InputSearchSuggestionItemRenderer<T>;\n\n /**\n * Test id forwarded to the root element.\n * @default undefined\n */\n testId?: InputSearchBaseProps['testId'];\n\n /**\n * The current display value of the component.\n * @default undefined\n */\n value?: InputSearchBaseProps['value'];\n\n /**\n * The display variant of the component.\n * @default 'standard'\n */\n variant?: InputSearchBaseProps['variant'];\n};\n\ntype InputSearchNonCollectionModeProps<\n T extends InputSearchSuggestion<Data> = InputSearchSuggestion<Data>\n> = InputSearchCommonProps<T> & {\n /**\n * @default undefined\n */\n collectionRenderer?: undefined;\n\n /**\n * Specifies the stable key for each suggestion when `collectionRenderer` is provided.\n * Set this to either a top-level field name whose value is a string/number or a callback\n * that derives a stable key from the suggestion context.\n *\n * @default undefined\n */\n suggestionItemKey?: InputSearchSuggestionItemKey<T>;\n};\n\ntype InputSearchCollectionModeProps<\n T extends InputSearchSuggestion<Data> = InputSearchSuggestion<Data>\n> = InputSearchCommonProps<T> & {\n /**\n * Custom renderer for collection-mode suggestions. When supplied, InputSearch uses collection\n * semantics and delegates row rendering and interaction to the rendered collection.\n *\n * `suggestionItemKey` is required whenever `collectionRenderer` is provided.\n */\n collectionRenderer: InputSearchCollectionRenderer<T>;\n\n /**\n * Specifies the stable key for each suggestion when `collectionRenderer` is provided.\n * Set this to either a top-level field name whose value is a string/number or a callback\n * that derives a stable key from the suggestion context.\n */\n suggestionItemKey: InputSearchSuggestionItemKey<T>;\n};\n\n/**\n * Props for `InputSearch`.\n */\ntype InputSearchProps<T extends InputSearchSuggestion<Data> = InputSearchSuggestion<Data>> =\n | InputSearchNonCollectionModeProps<T>\n | InputSearchCollectionModeProps<T>;\n\ntype InputSearchInternalProps<T extends InputSearchSuggestion<Data> = InputSearchSuggestion<Data>> =\n InputSearchProps<T> & {\n /**\n * Internal bridge invoked when focus leaves collection-mode popup content.\n */\n onCollectionBlur?: (detail: ValueUpdateDetail<string>) => void;\n /** Internal Core Pack bridge for a dismissed collection autocomplete preview. */\n suppressCollectionAutocomplete?: boolean;\n /** Internal Core Pack bridge for a matching suppressed collection row highlight. */\n allowSuppressedCollectionHighlight?: boolean;\n };\n\n/**\n * Generic component signature restored after forwardRef erases the generic props.\n */\ntype InputSearchComponent = (<T extends InputSearchSuggestion<Data> = InputSearchSuggestion<Data>>(\n props: InputSearchProps<T> & { ref?: Ref<FocusableHandle> }\n) => ComponentChildren) & {\n displayName?: string;\n};\n\n/**\n * InputSearch provides a text field for entering queries and can display an optional suggestions dropdown.\n *\n * - On desktop and tablet, the input type is set to `text` and suggestions render in an anchored popup.\n * - On phones, suggestions render in a full-screen dialog and the dialog input uses `type=\"search\"`.\n */\nconst InputSearchInternal = forwardRef(\n <T extends InputSearchSuggestion<Data> = InputSearchSuggestion<Data>>(\n componentProps: InputSearchInternalProps<T>,\n ref?: Ref<FocusableHandle>\n ) => {\n const {\n 'aria-describedby': ariaDescribedBy,\n autocomplete = 'on',\n collectionRenderer,\n suggestionItemKey,\n suggestionItemRenderer,\n suggestionItemText,\n onCommit,\n onCollectionBlur,\n onDisplayValueChanged,\n onInput,\n allowSuppressedCollectionHighlight,\n suppressCollectionAutocomplete,\n suggestions,\n testId,\n value,\n variant = 'standard',\n ...restProps\n } = componentProps;\n\n const testIdProps = useTestId(testId);\n const translations = useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\n const launcherRef = useRef<FocusableHandle>(null);\n const mobileInputRef = useRef<FocusableHandle>(null);\n const shouldRestoreLauncherFocusRef = useRef(false);\n const shouldIgnoreNextLauncherFocusRef = useRef(false);\n const shouldIgnoreNextLauncherPressRef = useRef(false);\n const shouldIgnorePairedLauncherClickRef = useRef(false);\n const shouldIgnoreNextSyntheticLauncherClickRef = useRef(false);\n const didHandleLauncherActivationRef = useRef(false);\n const lastMobileCommitTimeRef = useRef<number | undefined>();\n const wasPopupOpenRef = useRef(false);\n const launcherActivationResetTimerRef = useRef<number | undefined>();\n const launcherFocusRestoreTimerRef = useRef<number | undefined>();\n const launcherPressIgnoreResetTimerRef = useRef<number | undefined>();\n const {\n collectionContainerRef,\n collectionRendererContext,\n activeDescendantId,\n closeDropdown,\n commitCurrentCollectionSelection,\n dropdownId,\n dropdownRef,\n filterText,\n handleCollectionClickCapture,\n handleCollectionFocusOut,\n handleCollectionKeyDownCapture,\n handleCommit,\n handleDropdownAutoDismiss,\n handleOverlayDismiss,\n handleFocus,\n handleHoverIndexChange,\n handleInputBlur,\n handleInput,\n handleKeyDown,\n handleOverlayClear,\n handleOverlayCommit,\n handlePointerLeave,\n handleSuggestionSelection,\n hasSuggestionsDropdown,\n hasSuggestionsOverlay,\n hoveredSuggestionIndex,\n inputRef,\n inputType,\n interactionMode,\n isCollectionMode,\n isPopupOpen,\n keyboardFocusedSuggestionIndex,\n showKeyboardFocusIndicator,\n loadingSkeletonCount,\n floatingAutocompleteText,\n openSuggestions,\n optionRefs,\n renderedSuggestions,\n renderedValue,\n rootRef,\n shouldAnnounceNoMatches,\n shouldAnnounceResults,\n shouldCommitRawValueOnEnter,\n shouldRenderLoading\n } = useInputSearch<T>({\n autocomplete,\n collectionRenderer,\n hasSuggestionItemRenderer: suggestionItemRenderer !== undefined,\n onCommit,\n onCollectionBlur,\n onDisplayValueChanged,\n onInput,\n allowSuppressedCollectionHighlight,\n suppressCollectionAutocomplete,\n suggestionItemKey,\n suggestionItemText,\n suggestions,\n value\n });\n\n const { classes } = useComponentTheme<InputSearchVariantOptions, InputSearchStyles>(\n InputSearchRedwoodTheme,\n { variant }\n );\n\n // Keep option ids stable for a popup instance so aria-activedescendant can target\n // either the desktop listbox rows or the mobile overlay rows consistently.\n const getOptionId = useCallback(\n (index: number) => `${dropdownId}-option-${index}`,\n [dropdownId]\n );\n\n // Desktop pointer selection keeps focus on the launcher input so keyboard interaction\n // can continue from the same field immediately after the suggestion is committed.\n const handleSuggestionSelectionWithFocus = useCallback(\n (suggestion: T, index: number) =>\n handleSuggestionSelection(suggestion, index, { restoreFocus: true }),\n [handleSuggestionSelection]\n );\n\n const handleDesktopCollectionRowAction = useCallback(\n (detail: Parameters<typeof collectionRendererContext.onRowAction>[0]) => {\n collectionRendererContext.onRowAction(detail);\n // Desktop collection rows can move DOM focus into table/list internals. Restore the\n // launcher so keyboard users can continue from the search field after a row commit.\n launcherRef.current?.focus();\n },\n [collectionRendererContext]\n );\n\n // Escape can originate inside the rendered desktop collection rather than the launcher input.\n // When it closes the popup, send focus back to the launcher to match listbox mode.\n const handleDesktopCollectionKeyDownCapture = useCallback(\n (event: KeyboardEvent) => {\n handleCollectionKeyDownCapture(event);\n\n if (event.defaultPrevented && (event.key === 'Escape' || event.key === 'Enter')) {\n launcherRef.current?.focus();\n }\n },\n [handleCollectionKeyDownCapture]\n );\n\n // Mobile close paths restore focus after the overlay unmounts; mark the next launcher\n // focus event as synthetic so it does not immediately reopen the overlay.\n const restoreLauncherFocus = useCallback(() => {\n shouldRestoreLauncherFocusRef.current = true;\n shouldIgnoreNextLauncherFocusRef.current = true;\n }, []);\n\n // Ignore the focus event caused by overlay teardown. The launcher stays passive on focus\n // so touch focus does not open the mobile overlay before the activating click/tap lands.\n const handleLauncherFocus = useCallback(() => {\n if (shouldIgnoreNextLauncherFocusRef.current) {\n shouldIgnoreNextLauncherFocusRef.current = false;\n }\n }, []);\n\n // Launcher activation can arrive as both mousedown and click; mark the first\n // event for this task so the paired event does not reopen or re-toggle the overlay.\n const markLauncherActivationHandled = useCallback(() => {\n didHandleLauncherActivationRef.current = true;\n\n if (launcherActivationResetTimerRef.current !== undefined) {\n window.clearTimeout(launcherActivationResetTimerRef.current);\n }\n\n launcherActivationResetTimerRef.current = window.setTimeout(() => {\n launcherActivationResetTimerRef.current = undefined;\n didHandleLauncherActivationRef.current = false;\n }, 0);\n }, []);\n\n // Clear the short-lived suppression window used after mobile overlay commits.\n const clearLauncherPressIgnoreTimer = useCallback(() => {\n if (launcherPressIgnoreResetTimerRef.current !== undefined) {\n window.clearTimeout(launcherPressIgnoreResetTimerRef.current);\n launcherPressIgnoreResetTimerRef.current = undefined;\n }\n }, []);\n\n // Ignore only the immediate synthetic launcher activation that can follow a restored-focus\n // mobile Enter commit. If its mousedown is seen, the paired click remains suppressed below.\n const ignoreNextLauncherActivation = useCallback(() => {\n shouldIgnoreNextLauncherPressRef.current = true;\n shouldIgnorePairedLauncherClickRef.current = true;\n shouldIgnoreNextSyntheticLauncherClickRef.current = true;\n lastMobileCommitTimeRef.current = window.performance.now();\n clearLauncherPressIgnoreTimer();\n launcherPressIgnoreResetTimerRef.current = window.setTimeout(() => {\n launcherPressIgnoreResetTimerRef.current = undefined;\n shouldIgnoreNextLauncherPressRef.current = false;\n shouldIgnorePairedLauncherClickRef.current = false;\n shouldIgnoreNextSyntheticLauncherClickRef.current = false;\n }, 0);\n }, [clearLauncherPressIgnoreTimer]);\n\n // Explicit launcher presses open suggestions. On desktop this matches legacy click-to-open\n // behavior, and on phone it also handles taps after the overlay closes while focus remains.\n const handleLauncherPress = useCallback(\n (event?: MouseEvent) => {\n if (!event || event.button !== 0) {\n return;\n }\n\n if (didHandleLauncherActivationRef.current) {\n return;\n }\n\n if (shouldIgnoreNextLauncherPressRef.current) {\n shouldIgnoreNextLauncherPressRef.current = false;\n clearLauncherPressIgnoreTimer();\n\n if (hasSuggestionsOverlay && event.type === 'mousedown') {\n shouldIgnorePairedLauncherClickRef.current = true;\n }\n\n return;\n }\n\n if (shouldIgnorePairedLauncherClickRef.current && event.type === 'click') {\n shouldIgnorePairedLauncherClickRef.current = false;\n shouldIgnoreNextSyntheticLauncherClickRef.current = false;\n lastMobileCommitTimeRef.current = undefined;\n markLauncherActivationHandled();\n return;\n }\n\n const isRecentSyntheticClick =\n event.type === 'click' &&\n event.detail === 0 &&\n lastMobileCommitTimeRef.current !== undefined &&\n window.performance.now() - lastMobileCommitTimeRef.current < 500;\n\n if (\n (shouldIgnoreNextSyntheticLauncherClickRef.current || isRecentSyntheticClick) &&\n event.type === 'click' &&\n event.detail === 0\n ) {\n shouldIgnoreNextSyntheticLauncherClickRef.current = false;\n lastMobileCommitTimeRef.current = undefined;\n markLauncherActivationHandled();\n return;\n }\n\n if (event.type === 'click') {\n shouldIgnoreNextSyntheticLauncherClickRef.current = false;\n lastMobileCommitTimeRef.current = undefined;\n }\n\n if (hasSuggestionsOverlay && event.type === 'mousedown') {\n return;\n }\n\n markLauncherActivationHandled();\n\n if (isPopupOpen) {\n return;\n }\n\n openSuggestions();\n },\n [\n clearLauncherPressIgnoreTimer,\n hasSuggestionsOverlay,\n isPopupOpen,\n markLauncherActivationHandled,\n openSuggestions\n ]\n );\n\n // Clear transient launcher activation timers if the component unmounts while a\n // mouse/click pairing or post-commit suppression window is still pending.\n useEffect(() => {\n return () => {\n if (launcherActivationResetTimerRef.current !== undefined) {\n window.clearTimeout(launcherActivationResetTimerRef.current);\n launcherActivationResetTimerRef.current = undefined;\n }\n if (launcherFocusRestoreTimerRef.current !== undefined) {\n window.clearTimeout(launcherFocusRestoreTimerRef.current);\n launcherFocusRestoreTimerRef.current = undefined;\n }\n clearLauncherPressIgnoreTimer();\n };\n }, [clearLauncherPressIgnoreTimer]);\n\n // The phone launcher is a display-only combobox trigger, so keyboard activation must\n // open the overlay directly instead of falling through to submit-oriented input handling.\n const handleLauncherKeyDown = useCallback(\n (event: KeyboardEvent) => {\n if (\n isCollectionMode &&\n event.key === 'Enter' &&\n isPopupOpen &&\n collectionRendererContext.currentRowKeyOverride !== undefined &&\n !shouldCommitRawValueOnEnter()\n ) {\n event.preventDefault();\n commitCurrentCollectionSelection();\n return;\n }\n\n if (\n hasSuggestionsOverlay &&\n !isPopupOpen &&\n (event.key === 'Enter' ||\n event.key === ' ' ||\n event.key === 'ArrowDown' ||\n event.key === 'ArrowUp')\n ) {\n event.preventDefault();\n openSuggestions();\n return;\n }\n\n handleKeyDown(event);\n },\n [\n collectionRendererContext.currentRowKeyOverride,\n commitCurrentCollectionSelection,\n handleKeyDown,\n hasSuggestionsOverlay,\n isCollectionMode,\n isPopupOpen,\n openSuggestions,\n shouldCommitRawValueOnEnter\n ]\n );\n\n // Raw Enter submits from the desktop launcher should also dismiss the popup so the\n // committed field value and popup visibility stay in sync after explicit submission.\n const handleLauncherCommit = useCallback(\n (value: string) => {\n handleCommit(value);\n\n if (hasSuggestionsDropdown && isPopupOpen) {\n closeDropdown({ preserveDisplayValue: true });\n }\n },\n [closeDropdown, handleCommit, hasSuggestionsDropdown, isPopupOpen]\n );\n\n // Closing the phone overlay should return users to the launcher input once the\n // overlay finishes closing, instead of leaving focus on an unmounted control.\n const handleMobileClose = useCallback(() => {\n restoreLauncherFocus();\n handleOverlayDismiss();\n }, [handleOverlayDismiss, restoreLauncherFocus]);\n\n // Raw Enter in the phone overlay should follow legacy ojinputsearch sequencing:\n // commit and close the dialog first, then restore launcher focus after teardown.\n const handleMobileCommit = useCallback(\n (value: string) => {\n // Enter on the focused overlay input can dispatch a synthetic press to the launcher\n // after focus is restored; consume that one press so submit behaves as close, not reopen.\n ignoreNextLauncherActivation();\n handleOverlayCommit(value);\n restoreLauncherFocus();\n },\n [handleOverlayCommit, ignoreNextLauncherActivation, restoreLauncherFocus]\n );\n\n // Suggestion selection in the mobile overlay follows the same focus handoff as the\n // explicit close action because the overlay input disappears after selection.\n const handleMobileSuggestionSelection = useCallback(\n (suggestion: T, index: number) => {\n ignoreNextLauncherActivation();\n restoreLauncherFocus();\n handleSuggestionSelection(suggestion, index);\n },\n [handleSuggestionSelection, ignoreNextLauncherActivation, restoreLauncherFocus]\n );\n\n const handleMobileCollectionRowAction = useCallback(\n (detail: Parameters<typeof collectionRendererContext.onRowAction>[0]) => {\n // Collection row actions close the mobile overlay, so use the same focus and synthetic\n // launcher-click suppression path as ordinary suggestion selection.\n ignoreNextLauncherActivation();\n restoreLauncherFocus();\n collectionRendererContext.onRowAction(detail);\n },\n [collectionRendererContext, ignoreNextLauncherActivation, restoreLauncherFocus]\n );\n\n const handleMobileCollectionClickCapture = useCallback(\n (event: MouseEvent) => {\n // Captured taps can commit rows after collection internals finish their own click handling.\n // Prepare the overlay-close focus path before the delayed commit runs.\n ignoreNextLauncherActivation();\n restoreLauncherFocus();\n handleCollectionClickCapture(event);\n },\n [handleCollectionClickCapture, ignoreNextLauncherActivation, restoreLauncherFocus]\n );\n\n const handleMobileCollectionKeyDownCapture = useCallback(\n (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n // Hardware-keyboard Escape is supported in the mobile overlay even though touch users\n // normally use the visible back button.\n ignoreNextLauncherActivation();\n event.preventDefault();\n handleMobileClose();\n return;\n }\n\n handleCollectionKeyDownCapture(event);\n\n if (event.defaultPrevented && event.key === 'Enter') {\n ignoreNextLauncherActivation();\n restoreLauncherFocus();\n }\n },\n [\n handleCollectionKeyDownCapture,\n handleMobileClose,\n ignoreNextLauncherActivation,\n restoreLauncherFocus\n ]\n );\n\n const desktopCollectionRendererContext = useMemo(\n () => ({\n ...collectionRendererContext,\n // Desktop row commits should restore focus to the launcher after collection internals fire.\n onRowAction: handleDesktopCollectionRowAction\n }),\n [collectionRendererContext, handleDesktopCollectionRowAction]\n );\n\n const mobileCollectionRendererContext = useMemo(\n () => ({\n ...collectionRendererContext,\n // Mobile row commits should close the overlay and suppress the follow-up launcher click.\n onRowAction: handleMobileCollectionRowAction\n }),\n [collectionRendererContext, handleMobileCollectionRowAction]\n );\n\n // Enter on the mobile overlay can select the keyboard-active suggestion before the\n // base input falls through to raw commit handling. Route that selection through the\n // mobile path so focus restoration and synthetic launcher-press suppression still apply.\n const handleMobileKeyDown = useCallback(\n (event: KeyboardEvent) => {\n if (\n isCollectionMode &&\n event.key === 'Enter' &&\n isPopupOpen &&\n collectionRendererContext.currentRowKeyOverride !== undefined &&\n !shouldCommitRawValueOnEnter()\n ) {\n event.preventDefault();\n ignoreNextLauncherActivation();\n commitCurrentCollectionSelection();\n restoreLauncherFocus();\n return;\n }\n\n if (isCollectionMode && event.key === 'Escape' && isPopupOpen) {\n event.preventDefault();\n ignoreNextLauncherActivation();\n handleMobileClose();\n return;\n }\n\n if (\n !isCollectionMode &&\n event.key === 'Enter' &&\n isPopupOpen &&\n keyboardFocusedSuggestionIndex >= 0 &&\n !shouldCommitRawValueOnEnter()\n ) {\n const suggestion = renderedSuggestions[keyboardFocusedSuggestionIndex];\n\n if (suggestion) {\n event.preventDefault();\n handleMobileSuggestionSelection(suggestion, keyboardFocusedSuggestionIndex);\n return;\n }\n }\n\n handleKeyDown(event);\n },\n [\n collectionRendererContext.currentRowKeyOverride,\n commitCurrentCollectionSelection,\n handleKeyDown,\n handleMobileClose,\n handleMobileSuggestionSelection,\n ignoreNextLauncherActivation,\n isCollectionMode,\n isPopupOpen,\n keyboardFocusedSuggestionIndex,\n renderedSuggestions,\n restoreLauncherFocus,\n shouldCommitRawValueOnEnter\n ]\n );\n\n // Focus the mounted overlay input as soon as its ref is attached so phone launches can\n // keep the virtual-keyboard handoff as close to the opening gesture as possible.\n const handleMobileInputRef = useCallback(\n (element: HTMLInputElement | null) => {\n inputRef.current = element;\n\n if (element && isPopupOpen) {\n element.focus();\n }\n },\n [inputRef, isPopupOpen]\n );\n\n // The public imperative handle should always target whichever input is currently\n // interactive: the launcher by default, or the mobile overlay input while open.\n const getActiveHandle = useCallback(() => {\n if (hasSuggestionsOverlay && isPopupOpen) {\n return mobileInputRef.current ?? launcherRef.current;\n }\n\n return launcherRef.current;\n }, [hasSuggestionsOverlay, isPopupOpen]);\n\n // Forward focus APIs to the active input without treating imperative calls\n // as launcher gestures that open the phone suggestions dialog.\n useImperativeHandle(\n ref!,\n () => ({\n focus: () => {\n getActiveHandle()?.focus();\n },\n blur: () => {\n getActiveHandle()?.blur();\n }\n }),\n [getActiveHandle]\n );\n\n // Wait until the popup is fully closed before restoring launcher focus; doing it\n // earlier can bounce focus between the mobile overlay input and the launcher.\n useEffect(() => {\n if (isPopupOpen) {\n wasPopupOpenRef.current = true;\n return;\n }\n\n const didJustClose = wasPopupOpenRef.current;\n wasPopupOpenRef.current = false;\n\n if (!shouldRestoreLauncherFocusRef.current && !(didJustClose && hasSuggestionsOverlay)) {\n return;\n }\n\n shouldRestoreLauncherFocusRef.current = false;\n\n if (launcherFocusRestoreTimerRef.current !== undefined) {\n window.clearTimeout(launcherFocusRestoreTimerRef.current);\n }\n\n launcherFocusRestoreTimerRef.current = window.setTimeout(() => {\n launcherFocusRestoreTimerRef.current = undefined;\n launcherRef.current?.focus();\n }, 0);\n }, [hasSuggestionsOverlay, isPopupOpen]);\n\n const liveRegionText = (() => {\n if ((hasSuggestionsDropdown || hasSuggestionsOverlay) && shouldRenderLoading) {\n return translations.menu_stateLoading();\n }\n\n if (shouldAnnounceNoMatches) {\n return translations.select_noMatchesFound();\n }\n\n if (!shouldAnnounceResults) {\n return '';\n }\n\n if (renderedSuggestions.length === 1) {\n return translations.select_oneMatchFound();\n }\n\n return translations.select_sizeMatchesFound({ TOTAL_SIZE: `${renderedSuggestions.length}` });\n })();\n\n const mobilePopupId = `${dropdownId}-popup`;\n const launcherAutoComplete = hasSuggestionsDropdown\n ? isCollectionMode\n ? undefined\n : autocomplete === 'on'\n ? 'both'\n : 'list'\n : undefined;\n const launcherControls = hasSuggestionsDropdown\n ? dropdownId\n : hasSuggestionsOverlay\n ? mobilePopupId\n : undefined;\n const launcherExpanded = suggestions !== undefined ? isPopupOpen : undefined;\n\n const dropdown = !isPopupOpen ? null : hasSuggestionsDropdown ? (\n <InputSearchDesktopSuggestions\n anchorRef={rootRef}\n collectionContainerRef={collectionContainerRef}\n collectionRenderer={collectionRenderer}\n collectionRendererContext={desktopCollectionRendererContext}\n dropdownRef={dropdownRef}\n hoveredIndex={hoveredSuggestionIndex}\n keyboardFocusedIndex={keyboardFocusedSuggestionIndex}\n showKeyboardFocusIndicator={showKeyboardFocusIndicator}\n getOptionId={getOptionId}\n id={dropdownId}\n interactionMode={interactionMode}\n isCollectionMode={isCollectionMode}\n isLoading={shouldRenderLoading}\n isOpen={isPopupOpen}\n loadingSkeletonCount={loadingSkeletonCount}\n onAutoDismiss={handleDropdownAutoDismiss}\n onCollectionClickCapture={handleCollectionClickCapture}\n onCollectionFocusOut={handleCollectionFocusOut}\n onCollectionKeyDownCapture={handleDesktopCollectionKeyDownCapture}\n onHoverIndexChange={handleHoverIndexChange}\n onPointerLeave={handlePointerLeave}\n onSuggestionSelection={handleSuggestionSelectionWithFocus}\n optionRefs={optionRefs}\n searchText={filterText}\n suggestionItemText={suggestionItemText}\n suggestionItemRenderer={suggestionItemRenderer}\n suggestions={renderedSuggestions}\n />\n ) : (\n <InputSearchMobileDropdown\n activeDescendantId={activeDescendantId}\n ariaAutoComplete={isCollectionMode ? undefined : autocomplete === 'on' ? 'both' : 'list'}\n ariaDescribedBy={ariaDescribedBy}\n collectionContainerRef={collectionContainerRef}\n collectionRenderer={collectionRenderer}\n collectionRendererContext={mobileCollectionRendererContext}\n getOptionId={getOptionId}\n hoveredIndex={hoveredSuggestionIndex}\n id={dropdownId}\n inputRef={handleMobileInputRef}\n inputSearchRef={mobileInputRef}\n interactionMode={interactionMode}\n isCollectionMode={isCollectionMode}\n isLoading={shouldRenderLoading}\n isOpen={isPopupOpen}\n keyboardFocusedIndex={keyboardFocusedSuggestionIndex}\n showKeyboardFocusIndicator={showKeyboardFocusIndicator}\n liveRegionText={liveRegionText}\n loadingSkeletonCount={loadingSkeletonCount}\n onClear={handleOverlayClear}\n onClose={handleMobileClose}\n onCommit={handleMobileCommit}\n onCollectionClickCapture={handleMobileCollectionClickCapture}\n onCollectionFocusOut={handleCollectionFocusOut}\n onCollectionKeyDownCapture={handleMobileCollectionKeyDownCapture}\n onFocus={handleFocus}\n onHoverIndexChange={handleHoverIndexChange}\n onInput={handleInput}\n onKeyDown={handleMobileKeyDown}\n onPointerLeave={handlePointerLeave}\n onSuggestionSelection={handleMobileSuggestionSelection}\n optionRefs={optionRefs}\n placeholder={restProps.placeholder}\n popupId={mobilePopupId}\n renderedValue={renderedValue}\n searchText={filterText}\n suggestionItemText={suggestionItemText}\n suggestionItemRenderer={suggestionItemRenderer}\n suggestions={renderedSuggestions}\n testId={testId}\n />\n );\n\n return (\n <div {...testIdProps} className={classes} ref={rootRef}>\n <InputSearchBase\n {...restProps}\n ariaActiveDescendant={activeDescendantId}\n ariaAutoComplete={launcherAutoComplete}\n ariaBusy={shouldRenderLoading ? true : undefined}\n ariaControls={launcherControls}\n ariaDescribedBy={ariaDescribedBy}\n ariaExpanded={launcherExpanded}\n ariaHasPopup={\n isCollectionMode || hasSuggestionsOverlay\n ? 'dialog'\n : hasSuggestionsDropdown\n ? 'listbox'\n : undefined\n }\n displayOnly={hasSuggestionsOverlay}\n floatingAutocompleteText={floatingAutocompleteText ?? undefined}\n inputRef={inputRef}\n liveRegionText={liveRegionText}\n onBlur={hasSuggestionsOverlay ? undefined : handleInputBlur}\n onClick={handleLauncherPress}\n onCommit={handleLauncherCommit}\n onFocus={handleLauncherFocus}\n onInput={handleInput}\n onKeyDown={handleLauncherKeyDown}\n onMouseDown={handleLauncherPress}\n testId={testId}\n ref={launcherRef}\n type={inputType}\n value={renderedValue}\n variant={variant}\n />\n {dropdown}\n </div>\n );\n }\n);\n\nexport const InputSearch = InputSearchInternal as InputSearchComponent;\n\nInputSearch.displayName = 'InputSearch';\n\nexport type {\n Data,\n Key,\n InputSearchCollectionItemContext,\n InputSearchCollectionRendererProps,\n InputSearchCommitDetail,\n InputSearchProps,\n InputSearchSuggestion,\n InputSearchSuggestionItemKey,\n InputSearchSuggestionItemContext,\n InputSearchSuggestionItemRendererProps,\n InputSearchSuggestionItemText\n};\n"],"names":["SvgSearch","props","_jsx","Icon","viewBox","children","jsx","d","fill","fillRule","InputSearchBase","forwardRef","displayOnly","endContent","ariaActiveDescendant","ariaAutoComplete","ariaDescribedBy","ariaBusy","ariaControls","ariaExpanded","ariaHasPopup","autoComplete","floatingAutocompleteText","liveRegionText","inputRef","spellcheck","variant","onBlur","onClick","onCommit","onFocus","onInput","onKeyDown","onMouseDown","placeholder","startContent","textFieldStyleVariant","testId","type","value","ref","ariaLabel","useTranslationBundle","accSearch","enabledElementRef","useRef","readonlyElementRef","isTabbable","tabbableModeProps","useTabbableMode","focusProps","isFocused","methods","focusMethods","useFocusableTextField","isReadonly","onBlurWithin","onFocusWithin","formFieldContext","inputProps","textFieldProps","useTextField","useEffect","inputElement","current","undefined","removeAttribute","setAttribute","String","handleKeyDown","useCallback","event","defaultPrevented","key","repeat","currentValue","currentTarget","mergedInputRef","useMemo","mergeRefs","handleDisplayOnlyKeyDown","useImperativeHandle","styles","inputSearchStyles","variantClasses","iconClasses","useComponentTheme","InputSearchRedwoodTheme","target","hasSuggestionsPopup","floatingAutocomplete","_jsxs","className","floatingAutocompleteContainer","floatingAutocompleteHiddenValue","mainContent","displayContents","onClickCapture","onMouseDownCapture","mobileLauncherContainer","mobileLauncher","onFocusOut","onFocusIn","role","tabIndex","mobileLauncherContent","Text","jsxs","TextFieldInput","hasEndContent","hasStartContent","LiveRegion","searchIcon","Search","FormFieldContext","Provider","TextField","styleVariant","loggedSuggestionItemTextErrors","Set","logSuggestionItemTextErrorOnce","message","has","add","error","suggestionTextContainsQuery","suggestionText","query","normalizedQuery","toLowerCase","includes","getItemText","item","index","suggestionItemText","resolvedItemText","Object","prototype","hasOwnProperty","call","itemTextValue","data","LIST_GRIDLINES","top","bottom","InputSearchSuggestions","getOptionId","hoveredIndex","id","interactionMode","isLoading","suggestionItemRenderer","keyboardFocusedIndex","showKeyboardFocusIndicator","loadingSkeletonCount","optionRefs","onHoverIndexChange","onPointerLeave","onSuggestionSelection","searchText","suggestions","focusRingStyle","listbox","listWrapperRef","visualActiveIndex","collectionData","map","suggestion","metadata","currentItemOverride","rowKey","currentItemVariant","getOptionIndex","element","optionElement","closest","registeredOptionIndex","indexOf","optionElements","querySelectorAll","Array","handleSuggestionMouseDown","preventDefault","handleSuggestionAction","optionIndex","stopPropagation","handleSuggestionHover","length","listboxElement","querySelector","forEach","class","from","Math","max","_","Skeleton","height","onMouseUpCapture","onPointerOverCapture","onPointerMoveCapture","onPointerCancel","List","gridlines","itemPadding","classNames","dropdownStyles","singleSelectItem","HighlightText","matchText","InputSearchDesktopSuggestions","anchorRef","collectionContainerRef","collectionRenderer","collectionRendererContext","dropdownRef","isCollectionMode","isOpen","onAutoDismiss","onCollectionClickCapture","onCollectionFocusOut","onCollectionKeyDownCapture","collectionContainer","applyCollectionLabel","tableElement","listElement","hasAttribute","MutationObserver","observer","observe","childList","subtree","disconnect","Dropdown","DropdownList","hasBottomGap","hasTopGap","onKeyDownCapture","collectionWrapper","InputSearchMobileDropdown","activeDescendantId","inputSearchRef","onClear","onClose","popupId","renderedValue","translations","backButtonAriaLabel","selectMultiple_back","searchAriaLabel","dialogLabelId","clearButtonTestId","ClearIcon","IconButton","onAction","size","NavLeft","SelectMobileDropdown","header","_Fragment","HiddenAccessible","labelId","collectionOuterWrapper","interactiveCollectionDescendantSelector","join","collectionFocusTargetSelectors","collectionTabbableSelector","EMPTY_COLLECTION_ITEM_CONTEXTS","EMPTY_COLLECTION_CONTEXT_MAP","Map","EMPTY_COLLECTION_KEY_INDEX_MAP","EMPTY_COLLECTION_TYPED_KEY_MAP","EMPTY_COLLECTION_LEGACY_KEY_MAP","EMPTY_SUGGESTIONS","isElementWithinTarget","node","container","Node","contains","root","getRootNode","ShadowRoot","host","getDeepActiveElement","activeElement","document","HTMLElement","shadowRoot","Element","querySelectorAllDeep","selector","matches","collectMatches","currentRoot","push","isVisibleCollectionTabbable","offsetParent","window","getComputedStyle","visibility","getCollectionKeyAttributes","keyAttribute","getAttribute","keyTypeAttribute","getTypedCollectionKeyLookup","keyType","isValidCollectionElement","isConnected","useInputSearch","autocomplete","hasSuggestionItemRenderer","suggestionItemKey","onCollectionBlur","suppressCollectionAutocomplete","allowSuppressedCollectionHighlight","onDisplayValueChanged","propValue","dropdownId","useId","rootRef","pendingTypeaheadSyncRef","pendingAcceptedCaretPositionRef","pendingTypeaheadAcceptedCaretPositionRef","suppressAutocompleteRef","commitRawValueOnEnterRef","acceptedAutocompleteValueRef","shouldHighlightSuppressedPrefixRef","pendingControlledRestoreValueRef","pendingControlledInputRef","pendingControlledCollectionCommitValueRef","pendingControlledCollectionCommitPreviousValueRef","lastRenderedSuggestionCountRef","mobileOverlayFocusTimerRef","collectionTapActionTimerRef","collectionFocusRetryTimerRef","collectionFocusRetryCountRef","collectionFocusTargetsRef","collectionScrollTargetCacheRef","savedCaretRangeRef","hasCollectionFocusSinceOpenRef","pendingCollectionInputOpenRef","shouldFocusCollectionRef","hasDispatchedCollectionBlurRef","shouldRestoreCollectionInputValueOnFocusRef","isControlled","isPhoneDevice","getClientHints","deviceType","isAutocompletePreviewOn","isCollectionAutocompleteHighlightOn","isAutocompleteOn","inputType","hasSuggestions","hasSuggestionsDropdown","hasSuggestionsOverlay","isSuggestionsLoading","suggestionItems","isDropdownOpen","setIsDropdownOpen","useState","hoveredSuggestionIndex","setHoveredSuggestionIndex","keyboardFocusedSuggestionIndex","setKeyboardFocusedSuggestionIndex","setShowKeyboardFocusIndicator","setInteractionMode","filterText","setFilterText","setRenderedValue","setFloatingAutocompleteText","lastAnnouncedEmptyQuery","setLastAnnouncedEmptyQuery","autocompleteRange","setAutocompleteRange","isDropdownOpenRef","currentRowKeyOverride","setCurrentRowKeyOverride","collectionFocusRequest","setCollectionFocusRequest","currentRowKeyOverrideRef","committedRowKey","setCommittedRowKey","filterTextRef","renderedValueRef","lastPropValueRef","currentCommitValueRef","overlayDismissRestoreValueRef","updateRenderedValue","nextRenderedValue","options","previousValue","notifyDisplayValueChanged","getRenderedItemText","doesSuggestionMatchQuery","values","some","suggestionDataContainsQuery","getSuggestionKey","keyValue","getSuggestionItemContext","collectionItemContexts","reduce","itemContexts","itemContext","suggestionContextMap","contextMap","set","collectionItemIndexMap","indexMap","collectionTypedKeyMap","typedKeyMap","collectionLegacyKeyMap","legacyKeyMap","legacyKey","resetSuggestionFocusState","clearCollectionCurrentRow","saveInputCaretRange","end","selectionEnd","start","selectionStart","openDropdown","resetAutocomplete","restoredValue","restoreCaretToRawPrefixEnd","caretPosition","queueMicrotask","setSelectionRange","restoreCollectionInputValue","buildAutocompletePreviewValue","suggestionLabel","slice","applyKeyboardFocusPreview","previewValue","autocompleteStart","floating","closeDropdown","preserveDisplayValue","clearTimeout","blurCollectionAndClose","handleDropdownAutoDismiss","KeyboardEvent","isFocusMovingIntoCollection","focusEvent","popupElement","getElementById","relatedTarget","handleCollectionFocusOut","handleDocumentFocusIn","isFocusLeavingCollection","addEventListener","removeEventListener","handleInputBlur","syncControlledValue","nextValue","applyInputValue","shouldSuppressAutocomplete","shouldHighlightSuppressedPrefix","useLayoutEffect","controlledValueChanged","localStateDiverged","shouldPreserveTransientSuggestionDisplay","pendingControlledCollectionCommitValue","pendingControlledCollectionCommitPreviousValue","pendingControlledInput","previousCommitValue","acceptedCaretPosition","pendingControlledRestoreValue","clear","suggestionItemsLength","typedFilterText","firstItemContext","currentItemContext","get","currentItemText","isCollectionFocused","shouldRenderCurrentItemText","hasTypedFilterText","shouldAutocompleteCollection","startsWith","shouldShowFloatingCollectionAutocomplete","activeOption","scrollIntoView","block","pendingAcceptedCaretPosition","pendingTypeaheadAcceptedCaretPosition","firstSuggestion","normalizedFilterText","firstSuggestionLabel","firstSuggestionMatchesQuery","shouldAutocomplete","shouldShowFloatingAutocomplete","previewSuggestion","moveKeyboardFocus","direction","prev","nextIndex","nextSuggestion","nextSuggestionLabel","moveCollectionCurrentRow","currentIndex","isNavigatingFromLauncherWithPreviewedRow","min","previousKey","nextKey","openSuggestions","handleInput","detail","nativeInputValue","previousFilterText","previousRenderedValue","hasAutocompletePreview","isShorteningPrefixEdit","isEditingAcceptedAutocompleteValue","isContinuingSuppressedPrefixEdit","shouldKeepRawCommitAfterSuppressedEdit","inputCaretPosition","commitValue","committedValue","nextCommittedValue","committedKey","handleOverlayDismiss","handleOverlayCommit","getCollectionFocusTargets","cachedFocusTargets","filter","focusTarget","focusTargets","seenFocusTargets","getCollectionScrollTarget","typedKeyLookup","cachedScrollTarget","delete","keyElements","scrollTarget","find","isTypedCollectionKeyMatch","isLegacyCollectionKeyMatch","restoreInputFocus","focus","restoreCaret","savedRange","focusCollection","didFocusCollection","didFocus","isShiftTabLeavingCollectionBoundary","tabbableElements","firstTabbable","shallowActiveElement","deepActiveElement","removeDropdownElement","parentElement","removeChild","handlePersistCurrentRowKey","handleCollectionRowAction","context","committedText","getCollectionItemContextFromElement","keyElement","handleCollectionClickCapture","actionableElement","interactiveDescendant","tappedItemContext","setTimeout","handleCollectionKeyDownCapture","shiftKey","commitCurrentCollectionSelection","currentQuery","trim","shouldAnnounceNoMatches","shouldAnnounceResults","handleFocus","handleSuggestionSelection","restoreFocus","handleHoverIndexChange","handleOverlayClear","handlePointerLeave","dismissAutocompletePreview","clearFullySelectedValue","acceptAutocompletePreview","acceptedValue","shouldRenderSuggestions","shouldRenderLoading","isPopupOpen","renderedSuggestions","selectedKeys","onPersistCurrentRowKey","onRowAction","selected","shouldCommitRawValueOnEnter","handleCommit","InputSearchInternal","componentProps","restProps","testIdProps","useTestId","launcherRef","mobileInputRef","shouldRestoreLauncherFocusRef","shouldIgnoreNextLauncherFocusRef","shouldIgnoreNextLauncherPressRef","shouldIgnorePairedLauncherClickRef","shouldIgnoreNextSyntheticLauncherClickRef","didHandleLauncherActivationRef","lastMobileCommitTimeRef","wasPopupOpenRef","launcherActivationResetTimerRef","launcherFocusRestoreTimerRef","launcherPressIgnoreResetTimerRef","classes","handleSuggestionSelectionWithFocus","handleDesktopCollectionRowAction","handleDesktopCollectionKeyDownCapture","restoreLauncherFocus","handleLauncherFocus","markLauncherActivationHandled","clearLauncherPressIgnoreTimer","ignoreNextLauncherActivation","performance","now","handleLauncherPress","button","isRecentSyntheticClick","handleLauncherKeyDown","handleLauncherCommit","handleMobileClose","handleMobileCommit","handleMobileSuggestionSelection","handleMobileCollectionRowAction","handleMobileCollectionClickCapture","handleMobileCollectionKeyDownCapture","desktopCollectionRendererContext","mobileCollectionRendererContext","handleMobileKeyDown","handleMobileInputRef","getActiveHandle","blur","didJustClose","menu_stateLoading","select_noMatchesFound","select_oneMatchFound","select_sizeMatchesFound","TOTAL_SIZE","mobilePopupId","launcherAutoComplete","launcherControls","launcherExpanded","dropdown","InputSearch","displayName"],"mappings":"25ZAYA,MAAMA,GAAaC,GACjBC,MAACC,EAAAA,KAAI,CAACC,QAAQ,eAAgBH,EAC5BI,SAAAH,EAAAI,IAAA,OAAA,CACEC,EAAE,qHACFC,KAAK,eACLC,SAAS,cC+KTC,G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nkB,qBAAsBkO,EACtBjO,iBAAkBqnB,GAClBnnB,WAAUqjB,SAA6BrgB,EACvC/C,aAAcmnB,GACdrnB,gBAAiBA,EACjBG,aAAcmnB,GACdlnB,aACEoM,IAAoB0I,GAChB,SACAD,GACA,eACAhS,EAENrD,YAAasV,GACb5U,yBAA0BA,SAA4B2C,EACtDzC,SAAUA,GACVD,eAAgBA,GAChBI,OAAQuU,QAAwBjS,EAAYmY,GAC5Cxa,QAASglB,GACT/kB,SAAUmlB,GACVllB,QAASwkB,GACTvkB,QAAS2d,GACT1d,UAAW+kB,GACX9kB,YAAa2kB,GACbvkB,OAAQA,EACRG,IAAK4iB,EACL9iB,KAAMyT,GACNxT,MAAO8M,GACP3N,QAASA,IAEV6mB,KAEH,IAIOC,GAAczD,GAE3ByD,GAAYC,YAAc"}
1
+ {"version":3,"file":"UNSAFE_InputSearch.js","sources":["../../src/UNSAFE_RedwoodIcons/Search/Search.tsx","../../src/UNSAFE_InputSearch/InputSearchBase.tsx","../../src/UNSAFE_InputSearch/utils.ts","../../src/UNSAFE_InputSearch/InputSearchSuggestions.tsx","../../src/UNSAFE_InputSearch/InputSearchDesktopSuggestions.tsx","../../src/UNSAFE_InputSearch/InputSearchMobileDropdown.tsx","../../src/UNSAFE_InputSearch/useInputSearch.ts","../../src/UNSAFE_InputSearch/InputSearch.tsx"],"sourcesContent":["/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates. All rights reserved.\n * https://www.oracle.com/contracts/docs/cloud_csa_online_v062223_us_eng.pdf?download=false&er=221886\n * @ignore\n */\n// DO NOT MODIFY THIS FILE MANUALLY!\n// This file is automatically generated based on the corresponding SVG image in\n// the packages/oraclejet-preact/resources/icons folder.\nimport { ComponentProps } from 'preact';\nimport { Icon } from '../../UNSAFE_Icon';\ntype Props = Omit<ComponentProps<typeof Icon>, 'viewBox' | 'children'>;\nconst SvgSearch = (props: Props) => (\n <Icon viewBox=\"0 0 24 24\" {...props}>\n <path\n d=\"M10 2a8 8 0 0 1 6.317 12.91l5.383 5.384-1.414 1.414-5.386-5.384A8 8 0 1 1 10 2zm0 2a6 6 0 1 0 0 12 6 6 0 0 0 0-12z\"\n fill=\"currentcolor\"\n fillRule=\"evenodd\"\n />\n </Icon>\n);\nexport { SvgSearch as Search };\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport type { ComponentProps, ComponentChildren, Ref, JSX } from 'preact';\nimport { forwardRef } from 'preact/compat';\nimport { useCallback, useEffect, useImperativeHandle, useMemo, useRef } from 'preact/hooks';\nimport type { UnpackSignals } from '@oracle/oraclejet-internal-utilities/attributeUtils';\nimport type { BundleType } from '#resources/nls/bundle';\nimport { LiveRegion } from '#UNSAFE_LiveRegion';\nimport { Text } from '#UNSAFE_Text';\nimport { useFocusableTextField } from '#hooks/UNSAFE_useFocusableTextField';\nimport type { FocusableHandle } from '#hooks/UNSAFE_useFocusableTextField';\nimport { FormFieldContext } from '#hooks/UNSAFE_useFormFieldContext';\nimport { useTabbableMode } from '#hooks/UNSAFE_useTabbableMode';\nimport type { TestIdProps } from '#hooks/UNSAFE_useTestId';\nimport { useTextField } from '#hooks/UNSAFE_useTextField';\nimport { useTranslationBundle } from '#hooks/UNSAFE_useTranslationBundle';\nimport { useComponentTheme } from '#hooks/UNSAFE_useComponentTheme';\nimport { Search } from '#UNSAFE_RedwoodIcons/Search';\nimport { TextFieldInput, TextField } from '#UNSAFE_TextField';\nimport { mergeRefs } from '#utils/PRIVATE_refUtils';\nimport type { InputSearchStyles, InputSearchVariantOptions } from './themes/InputSearchStyles.css';\nimport { InputSearchRedwoodTheme } from './themes/redwood/InputSearchTheme';\n\ntype TextFieldInputProps = ComponentProps<typeof TextFieldInput>;\ntype TextFieldProps = ComponentProps<typeof TextField>;\n\ntype FocusWithinProps = Pick<\n Parameters<typeof useFocusableTextField<HTMLInputElement, HTMLDivElement>>[0],\n 'onBlurWithin' | 'onFocusWithin'\n>;\ntype MouseDownProps = Pick<UnpackSignals<JSX.IntrinsicElements['div']>, 'onMouseDown'>;\ntype ClickProps = Pick<UnpackSignals<JSX.IntrinsicElements['div']>, 'onClick'>;\n\n/**\n * Props for the internal InputSearch text field renderer.\n */\ntype Props = TestIdProps & {\n /**\n * A short hint to display before the user enters a value.\n * @default undefined\n */\n placeholder?: TextFieldInputProps['placeholder'];\n\n /**\n * The type of the input element. Use 'search' for mobile and 'text' for desktop.\n * Type is determined in the parent InputSearch component based on device.\n */\n type: 'search' | 'text';\n\n /**\n * The current display value of the component.\n * @default undefined\n */\n value?: TextFieldInputProps['value'];\n\n /**\n * Desktop-only floating autocomplete suggestion shown adjacent to the typed input\n * when the first match is a substring rather than a prefix match.\n */\n floatingAutocompleteText?: string;\n\n /**\n * Assistive text announced from the mobile input field's live region.\n */\n liveRegionText?: string;\n\n /**\n * Callback invoked when the user presses Enter while focused in the field.\n */\n onCommit?: (value: string) => void;\n\n /**\n * Callback invoked each time the user changes the value of the field. For example, if the user\n * types 'abcd', this callback will be called four times with the value as 'a', 'ab', 'abc' and 'abcd'\n * respectively.\n * @default undefined\n */\n onInput?: TextFieldInputProps['onInput'];\n\n /**\n * Callback invoked for keydown events on the input element.\n */\n onKeyDown?: TextFieldInputProps['onKeyDown'];\n\n /**\n * Callback invoked when focus enters the text field.\n */\n onFocus?: FocusWithinProps['onFocusWithin'];\n\n /**\n * Callback invoked when focus leaves the text field.\n */\n onBlur?: FocusWithinProps['onBlurWithin'];\n\n /**\n * Callback invoked when the field chrome is pressed.\n */\n onMouseDown?: MouseDownProps['onMouseDown'];\n\n /**\n * Callback invoked when the field is clicked or tapped.\n */\n onClick?: ClickProps['onClick'];\n\n /**\n * Ref for the underlying input element.\n */\n inputRef?: Ref<HTMLInputElement>;\n\n /**\n * ID of the currently active suggestion option announced to assistive technologies.\n */\n ariaActiveDescendant?: UnpackSignals<JSX.AriaAttributes>['aria-activedescendant'];\n\n /**\n * Indicates that the field can present inline/list autocomplete behavior.\n */\n ariaAutoComplete?: TextFieldInputProps['aria-autocomplete'];\n\n /**\n * Associates the interactive input with descriptive text.\n */\n ariaDescribedBy?: TextFieldInputProps['aria-describedby'];\n\n /**\n * Indicates that suggestion content is still loading.\n */\n ariaBusy?: UnpackSignals<JSX.AriaAttributes>['aria-busy'];\n\n /**\n * Associates the input with the popup element that contains suggestions.\n */\n ariaControls?: UnpackSignals<JSX.AriaAttributes>['aria-controls'];\n\n /**\n * Reflects whether the suggestions popup is currently expanded.\n */\n ariaExpanded?: UnpackSignals<JSX.AriaAttributes>['aria-expanded'];\n\n /**\n * Identifies the popup type exposed by the search field when suggestions are available.\n */\n ariaHasPopup?: UnpackSignals<JSX.AriaAttributes>['aria-haspopup'];\n\n /**\n * Renders a display-only launcher field for phone overlays.\n */\n displayOnly?: boolean;\n\n /**\n * Optional start content override used by the mobile overlay header.\n */\n startContent?: ComponentChildren;\n\n /**\n * Optional end content override used by the mobile overlay header.\n */\n endContent?: ComponentChildren;\n\n /**\n * Native autocomplete value forwarded to the interactive input element.\n */\n autoComplete?: TextFieldInputProps['autoComplete'];\n\n /**\n * Spellcheck setting forwarded to the interactive input element.\n */\n spellcheck?: TextFieldInputProps['spellcheck'];\n\n /**\n * Visual style variant forwarded to the underlying TextField container.\n */\n textFieldStyleVariant?: TextFieldProps['styleVariant'];\n\n /**\n * The display variant of the component. The hero variant increases padding and font size to make\n * the component more prominent (e.g., on a landing page or header). It is not affected by\n * compact-density settings.\n * @default 'standard'\n */\n variant?: 'hero' | 'standard';\n};\n\n/**\n * An InputSearch displays a text field optimized for search with search icon.\n */\nconst InputSearchBase = forwardRef(\n (\n {\n displayOnly = false,\n endContent,\n ariaActiveDescendant,\n ariaAutoComplete,\n ariaDescribedBy,\n ariaBusy,\n ariaControls,\n ariaExpanded,\n ariaHasPopup,\n autoComplete,\n floatingAutocompleteText,\n liveRegionText,\n inputRef,\n spellcheck,\n variant = 'standard',\n onBlur,\n onClick,\n onCommit,\n onFocus,\n onInput,\n onKeyDown,\n onMouseDown,\n placeholder,\n startContent,\n textFieldStyleVariant,\n testId,\n type,\n value\n }: Props,\n ref?: Ref<FocusableHandle>\n ) => {\n const translations = useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\n // TODO: get final verdict from UX if aria label is customizable. always use the translation for now.\n const ariaLabel = translations.accSearch();\n const enabledElementRef = useRef<HTMLInputElement>(null);\n const readonlyElementRef = useRef<HTMLDivElement>(null);\n const { isTabbable, tabbableModeProps } = useTabbableMode();\n\n const {\n focusProps,\n isFocused,\n methods: focusMethods\n } = useFocusableTextField<HTMLInputElement, HTMLDivElement>({\n enabledElementRef,\n isReadonly: displayOnly,\n readonlyElementRef,\n onBlurWithin: onBlur,\n onFocusWithin: onFocus\n });\n\n const { formFieldContext, inputProps, textFieldProps } = useTextField({\n isFocused,\n value\n });\n\n // Sync combobox state onto the actual inner input because TextFieldInput does not\n // forward every aria prop we need for the suggestion popup relationship.\n useEffect(() => {\n const inputElement = enabledElementRef.current;\n\n if (!inputElement) {\n return;\n }\n\n // Sync ARIA attributes that TextFieldInput does not forward to the inner input.\n // Keep these writes explicit instead of looping over attribute names so JAF does not\n // flag the DOM mutation as an untagged dynamic setAttribute call.\n if (ariaActiveDescendant === undefined) {\n inputElement.removeAttribute('aria-activedescendant');\n } else {\n inputElement.setAttribute('aria-activedescendant', String(ariaActiveDescendant));\n }\n\n if (ariaBusy) {\n inputElement.setAttribute('aria-busy', 'true');\n } else {\n inputElement.removeAttribute('aria-busy');\n }\n\n if (ariaHasPopup === undefined) {\n inputElement.removeAttribute('aria-haspopup');\n } else {\n inputElement.setAttribute('aria-haspopup', String(ariaHasPopup));\n }\n }, [ariaActiveDescendant, ariaBusy, ariaHasPopup]);\n\n // InputSearch commits only on explicit submit actions, not on blur. Because TextFieldInput's\n // generic commit handling is tied to blur-based commit behavior, InputSearchBase handles Enter clicks\n // directly and translates them into the commit event consumed by the parent InputSearch.\n const handleKeyDown = useCallback(\n (event: KeyboardEvent) => {\n onKeyDown?.(event);\n\n if (!event.defaultPrevented && event.key === 'Enter' && !event.repeat) {\n const currentValue = (event.currentTarget as HTMLInputElement).value;\n // Only dispatch the current value. The parent InputSearch is responsible for deciding\n // whether this explicit submit should emit an onCommit detail event.\n onCommit?.(currentValue);\n }\n },\n [onCommit, onKeyDown]\n );\n\n // Keep the merged ref stable unless the caller-provided input ref changes.\n const mergedInputRef = useMemo(\n () => mergeRefs<HTMLInputElement>(enabledElementRef, inputRef),\n [inputRef]\n );\n\n // The phone launcher is display-only markup, so it forwards key events to the parent\n // InputSearch logic instead of trying to implement combobox keyboard behavior here.\n const handleDisplayOnlyKeyDown = useCallback(\n (event: KeyboardEvent) => {\n onKeyDown?.(event as never);\n },\n [onKeyDown]\n );\n\n useImperativeHandle(ref!, () => focusMethods, [focusMethods]);\n\n const { styles: inputSearchStyles, variantClasses: iconClasses } = useComponentTheme<\n InputSearchVariantOptions,\n InputSearchStyles\n >(InputSearchRedwoodTheme, {\n target: 'icon',\n variant\n });\n\n const hasSuggestionsPopup = ariaControls !== undefined;\n const floatingAutocomplete =\n !displayOnly && floatingAutocompleteText ? (\n <div aria-hidden=\"true\" className={inputSearchStyles.floatingAutocompleteContainer}>\n <span className={inputSearchStyles.floatingAutocompleteHiddenValue}>{value ?? ''}</span>\n <span className={inputSearchStyles.floatingAutocompleteText}>\n {'\\xa0\\u2014\\xa0'}\n {floatingAutocompleteText}\n </span>\n </div>\n ) : null;\n\n const mainContent = displayOnly ? (\n <div\n className={inputSearchStyles.displayContents}\n onClickCapture={onClick}\n onMouseDownCapture={onMouseDown}>\n <div className={inputSearchStyles.mobileLauncherContainer}>\n <div\n aria-busy={ariaBusy}\n aria-controls={ariaControls}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-label={ariaLabel}\n className={inputSearchStyles.mobileLauncher}\n onKeyDown={handleDisplayOnlyKeyDown}\n onBlur={focusProps.onFocusOut}\n onFocus={focusProps.onFocusIn}\n ref={readonlyElementRef}\n role={hasSuggestionsPopup ? 'combobox' : undefined}\n {...(isTabbable ? { tabIndex: 0 } : tabbableModeProps)}>\n <span className={inputSearchStyles.mobileLauncherContent}>\n <Text variant={value ? 'inherit' : 'secondary'}>{value || placeholder}</Text>\n </span>\n </div>\n </div>\n </div>\n ) : (\n <div\n className={inputSearchStyles.displayContents}\n onClickCapture={onClick}\n onMouseDownCapture={onMouseDown}>\n <TextFieldInput\n {...inputProps}\n aria-activedescendant={ariaActiveDescendant}\n aria-label={ariaLabel}\n aria-autocomplete={ariaAutoComplete}\n aria-busy={ariaBusy}\n aria-controls={ariaControls}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n autoComplete={autoComplete}\n hasEndContent={endContent !== undefined}\n hasStartContent={startContent !== undefined}\n inputRef={mergedInputRef}\n placeholder={placeholder}\n role={hasSuggestionsPopup ? 'combobox' : undefined}\n spellcheck={spellcheck}\n value={value}\n type={type}\n onInput={onInput}\n onKeyDown={handleKeyDown}\n />\n <LiveRegion>{liveRegionText}</LiveRegion>\n {floatingAutocomplete}\n </div>\n );\n\n const searchIcon = (\n // wrapper needed to properly position and size the icon within the TextField for hero variant\n <span className={iconClasses}>\n <Search />\n </span>\n );\n\n return (\n <FormFieldContext.Provider value={formFieldContext}>\n {/* In display-only mobile mode, clicks can land on TextField chrome outside the launcher\n content. Capture them here so the parent InputSearch still opens the overlay. */}\n <div\n className={inputSearchStyles.displayContents}\n onClickCapture={displayOnly ? onClick : undefined}>\n <TextField\n {...textFieldProps}\n endContent={endContent}\n mainContent={mainContent}\n startContent={startContent ?? searchIcon}\n styleVariant={textFieldStyleVariant ?? textFieldProps.styleVariant}\n onBlur={displayOnly ? undefined : focusProps.onFocusOut}\n onFocus={displayOnly ? undefined : focusProps.onFocusIn}\n onMouseDown={onMouseDown}\n testId={testId !== undefined ? `${testId}-base` : undefined}\n />\n </div>\n </FormFieldContext.Provider>\n );\n }\n);\n\nexport { InputSearchBase };\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * Licensed under The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport { error } from '#utils/UNSAFE_logger';\nimport { getClientHints } from '#utils/PRIVATE_clientHints';\nimport type {\n Data,\n InputSearchSuggestion,\n InputSearchSuggestionItemContext,\n InputSearchSuggestionItemText\n} from './InputSearch';\n\nconst loggedSuggestionItemTextErrors = new Set<string>();\n\nfunction logSuggestionItemTextErrorOnce(message: string) {\n // UNSAFE_logger does not dedupe repeated messages, so guard invalid prop logs locally.\n if (loggedSuggestionItemTextErrors.has(message)) {\n return;\n }\n\n loggedSuggestionItemTextErrors.add(message);\n error(() => message);\n}\n\n/**\n * Helper function to determine whether the current device is a phone.\n */\nexport function isPhone() {\n return getClientHints().deviceType === 'phone';\n}\n\n/**\n * Returns whether suggestion display text contains the current query text.\n */\nexport function suggestionTextContainsQuery(suggestionText: string, query: string) {\n const normalizedQuery = query.toLowerCase();\n return normalizedQuery !== '' && suggestionText.toLowerCase().includes(normalizedQuery);\n}\n\n/**\n * Returns whether any top-level primitive suggestion value contains the current query text.\n */\nexport function suggestionDataContainsQuery<T extends InputSearchSuggestion<Data>>(\n suggestion: T,\n query: string\n) {\n const normalizedQuery = query.toLowerCase();\n\n if (normalizedQuery === '') {\n return false;\n }\n\n return Object.values(suggestion).some((value) => {\n if (typeof value === 'string') {\n return value.toLowerCase().includes(normalizedQuery);\n }\n\n if (typeof value === 'number') {\n return String(value).includes(normalizedQuery);\n }\n\n return false;\n });\n}\n\ntype GetItemTextOptions<T extends InputSearchSuggestion<Data>> = {\n index?: number;\n suggestionItemText?: InputSearchSuggestionItemText<T>;\n};\n/**\n * Derive the display text for an item, defaulting to the `label` field.\n */\nexport function getItemText<T extends InputSearchSuggestion<Data>>(\n item: T,\n { index = -1, suggestionItemText }: GetItemTextOptions<T> = {}\n): string {\n const resolvedItemText = suggestionItemText;\n\n if (resolvedItemText == null) {\n // Keep the default path cheap by reading the conventional `label` field directly.\n return typeof item['label'] === 'string' ? item['label'] : '';\n }\n\n if (typeof resolvedItemText === 'string') {\n if (Object.prototype.hasOwnProperty.call(item, resolvedItemText)) {\n const itemTextValue = item[resolvedItemText];\n\n if (typeof itemTextValue === 'string') {\n return itemTextValue;\n }\n\n if (itemTextValue === undefined) {\n return '';\n }\n\n logSuggestionItemTextErrorOnce(\n `InputSearch: suggestionItemText field must resolve to a string: ${resolvedItemText}`\n );\n return '';\n }\n\n // Invalid field names should not break rendering; log and render an empty string instead.\n logSuggestionItemTextErrorOnce(\n `InputSearch: suggestionItemText specifies field that does not exist: ${resolvedItemText}`\n );\n return '';\n }\n\n if (typeof suggestionItemText === 'function') {\n // Callbacks can derive text from the full item plus its position in the rendered list.\n return suggestionItemText({\n data: item,\n index\n } satisfies InputSearchSuggestionItemContext<T>);\n }\n\n return '';\n}\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * Licensed under The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport type { ComponentChildren } from 'preact';\nimport { useCallback, useEffect, useMemo, useRef } from 'preact/hooks';\nimport type { CollectionData } from '#UNSAFE_Collection';\nimport { List } from '#PRIVATE_TableList';\nimport { dropdownStyles } from '#PRIVATE_SelectCommon/themes/dropdownStyles.css';\nimport { useComponentTheme } from '#hooks/UNSAFE_useComponentTheme';\nimport { HighlightText } from '#UNSAFE_HighlightText';\nimport { Skeleton } from '#UNSAFE_Skeleton';\nimport { classNames } from '#utils/UNSAFE_classNames';\nimport type {\n Data,\n InputSearchSuggestionItemRendererProps,\n InputSearchSuggestionItemText,\n InputSearchSuggestion\n} from './InputSearch';\nimport type { InputSearchStyles } from './themes/InputSearchStyles.css';\nimport { InputSearchRedwoodTheme } from './themes/redwood/InputSearchTheme';\nimport { getItemText } from './utils';\n\nconst LIST_GRIDLINES = { item: 'hidden', top: 'hidden', bottom: 'hidden' } as const;\n\n/**\n * Props for the shared suggestion list content rendered by desktop and phone InputSearch popups.\n */\ntype InputSearchSuggestionsProps<T extends InputSearchSuggestion<Data>> = {\n /**\n * Accessible label applied to the rendered listbox.\n */\n ariaLabel: string;\n\n /**\n * Generates the option id used by `aria-activedescendant`.\n */\n getOptionId: (index: number) => string;\n\n /**\n * Pointer-hovered suggestion index.\n */\n hoveredIndex: number;\n\n /**\n * Base id for the listbox element.\n */\n id: string;\n\n /**\n * Distinguishes pointer highlight from keyboard-managed focus.\n */\n interactionMode?: 'keyboard' | 'pointer';\n\n /**\n * Whether loading skeletons should render instead of suggestion options.\n */\n isLoading: boolean;\n\n /**\n * Optional custom renderer for each suggestion row.\n */\n suggestionItemRenderer?: (\n suggestionItemRendererProps: InputSearchSuggestionItemRendererProps<T>\n ) => ComponentChildren;\n\n /**\n * Optional text mapping for default suggestion rendering.\n */\n suggestionItemText?: InputSearchSuggestionItemText<T>;\n\n /**\n * Keyboard-focused suggestion index.\n */\n keyboardFocusedIndex: number;\n\n /**\n * Whether to draw the keyboard focus indicator for the active suggestion.\n */\n showKeyboardFocusIndicator: boolean;\n\n /**\n * Skeleton row count used while loading.\n */\n loadingSkeletonCount: number;\n\n /**\n * Mutable option element registry for aria/focus coordination.\n */\n optionRefs: (HTMLElement | null)[];\n\n /**\n * Updates the hovered suggestion index.\n */\n onHoverIndexChange: (index: number) => void;\n\n /**\n * Clears pointer hover state when the pointer leaves the list.\n */\n onPointerLeave?: () => void;\n\n /**\n * Commits a selected suggestion back to InputSearch.\n */\n onSuggestionSelection: (suggestion: T, index: number) => void;\n\n /**\n * Current user-entered text used for highlight rendering.\n */\n searchText: string;\n\n /**\n * Suggestions currently available for rendering.\n */\n suggestions: readonly T[];\n};\n\n/**\n * Renders the shared InputSearch suggestion listbox content used by desktop popups\n * and the mobile fullscreen overlay.\n *\n * @template T The suggestion item shape rendered in the list.\n */\nexport function InputSearchSuggestions<T extends InputSearchSuggestion<Data>>({\n ariaLabel,\n getOptionId,\n hoveredIndex,\n id,\n interactionMode,\n isLoading,\n suggestionItemText,\n suggestionItemRenderer,\n keyboardFocusedIndex,\n showKeyboardFocusIndicator,\n loadingSkeletonCount,\n optionRefs,\n onHoverIndexChange,\n onPointerLeave,\n onSuggestionSelection,\n searchText,\n suggestions\n}: InputSearchSuggestionsProps<T>) {\n const {\n styles: { focusRingStyle, item, listbox }\n } = useComponentTheme<never, InputSearchStyles>(InputSearchRedwoodTheme);\n const listWrapperRef = useRef<HTMLDivElement>(null);\n\n // Determines which suggestion row should receive visual highlight treatment.\n //\n // Priority order (most to least preferred):\n // 1. Pointer hover when user is actively using mouse/touch (interactionMode === 'pointer')\n // 2. Keyboard focus (via aria-activedescendant or arrow navigation)\n // 3. Fallback to any hover state\n //\n // This ensures commit behavior (Enter key or click) stays aligned with what the\n // user is visually focused on. The List component uses currentItemOverride\n // to drive its internal highlight state.\n const visualActiveIndex =\n interactionMode === 'pointer' && hoveredIndex >= 0\n ? hoveredIndex\n : keyboardFocusedIndex >= 0\n ? keyboardFocusedIndex\n : hoveredIndex >= 0\n ? hoveredIndex\n : undefined;\n const collectionData = useMemo<CollectionData<number, T>[]>(\n () =>\n suggestions.map((suggestion, index) => ({\n data: suggestion,\n metadata: { key: index }\n })),\n [suggestions]\n );\n const currentItemOverride = useMemo(\n () => (visualActiveIndex !== undefined ? { rowKey: visualActiveIndex } : undefined),\n [visualActiveIndex]\n );\n const currentItemVariant = visualActiveIndex !== undefined ? 'highlight' : 'none';\n\n // Map List-owned DOM events back to the suggestion array index.\n const getOptionIndex = useCallback(\n (element: EventTarget | null) => {\n const optionElement = (element as HTMLElement | null)?.closest(\n '[role=\"option\"]'\n ) as HTMLElement | null;\n if (!optionElement) {\n return -1;\n }\n\n const registeredOptionIndex = optionRefs.indexOf(optionElement);\n if (registeredOptionIndex >= 0) {\n return registeredOptionIndex;\n }\n\n const optionElements =\n listWrapperRef.current?.querySelectorAll<HTMLElement>('[role=\"option\"]');\n return optionElements ? Array.prototype.indexOf.call(optionElements, optionElement) : -1;\n },\n [optionRefs]\n );\n\n const handleSuggestionMouseDown = useCallback(\n (event: MouseEvent) => {\n const optionIndex = getOptionIndex(event.target);\n if (optionIndex < 0) {\n return;\n }\n\n // Keep focus on the active search field until click selection completes.\n event.preventDefault();\n },\n [getOptionIndex]\n );\n\n // Commit the suggestion associated with the pressed option after pointer release.\n const handleSuggestionAction = useCallback(\n (event: MouseEvent) => {\n const optionIndex = getOptionIndex(event.target);\n if (optionIndex < 0) {\n return;\n }\n\n const suggestion = suggestions[optionIndex];\n if (!suggestion) {\n return;\n }\n\n onSuggestionSelection(suggestion, optionIndex);\n event.stopPropagation();\n },\n [getOptionIndex, onSuggestionSelection, suggestions]\n );\n\n // Track pointer hover as an index so the visual highlight can stay independent of keyboard focus.\n const handleSuggestionHover = useCallback(\n (event: Event) => {\n const optionIndex = getOptionIndex(event.target);\n if (optionIndex >= 0) {\n onHoverIndexChange(optionIndex);\n }\n },\n [getOptionIndex, onHoverIndexChange]\n );\n\n // Synchronize List-created option ids and refs after render so aria-activedescendant\n // can reference the correct DOM node even though List owns the option elements.\n useEffect(() => {\n optionRefs.length = 0;\n\n if (isLoading) {\n return;\n }\n\n const listboxElement = listWrapperRef.current?.querySelector<HTMLElement>('[role=\"listbox\"]');\n\n if (listboxElement) {\n listboxElement.id = id;\n }\n\n if (suggestions.length === 0) {\n return;\n }\n\n const optionElements = listWrapperRef.current?.querySelectorAll<HTMLElement>('[role=\"option\"]');\n\n optionElements?.forEach((element, index) => {\n element.id = getOptionId(index);\n optionRefs[index] = element;\n });\n }, [getOptionId, id, isLoading, optionRefs, suggestions]);\n\n if (isLoading) {\n return (\n <div\n aria-busy=\"true\"\n aria-label={ariaLabel}\n class={listbox}\n id={id}\n role=\"listbox\"\n tabIndex={-1}>\n {Array.from({ length: Math.max(1, loadingSkeletonCount) }, (_, index) => (\n <div key={`${id}-${index}`} class={item} role=\"presentation\">\n <Skeleton height=\"4x\" />\n </div>\n ))}\n </div>\n );\n }\n\n return (\n <div\n class={listbox}\n ref={listWrapperRef}\n onMouseDownCapture={handleSuggestionMouseDown}\n onMouseUpCapture={handleSuggestionAction}\n onPointerOverCapture={handleSuggestionHover}\n onPointerMoveCapture={handleSuggestionHover}\n onPointerLeave={onPointerLeave}\n onPointerCancel={onPointerLeave}>\n <List<number, T>\n aria-label={ariaLabel}\n collectionData={collectionData}\n currentItemOverride={currentItemOverride}\n currentItemVariant={currentItemVariant}\n gridlines={LIST_GRIDLINES}\n itemPadding=\"disabled\"\n role=\"listbox\">\n {({ data: suggestion, index }) => (\n <div\n class={classNames([\n dropdownStyles.singleSelectItem,\n index === keyboardFocusedIndex && showKeyboardFocusIndicator && focusRingStyle\n ])}>\n {suggestionItemRenderer ? (\n suggestionItemRenderer({\n data: suggestion,\n index,\n searchText: searchText === '' ? undefined : searchText\n })\n ) : (\n <HighlightText matchText={searchText}>\n {getItemText(suggestion, {\n index,\n suggestionItemText\n })}\n </HighlightText>\n )}\n </div>\n )}\n </List>\n </div>\n );\n}\n\nexport type { InputSearchSuggestionsProps };\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * Licensed under The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport type { ComponentChildren, RefObject } from 'preact';\nimport { useEffect } from 'preact/hooks';\nimport { Dropdown, DropdownList } from '#PRIVATE_SelectCommon';\nimport { useTranslationBundle } from '#hooks/UNSAFE_useTranslationBundle';\nimport type { BundleType } from '#resources/nls/bundle';\nimport type {\n Data,\n InputSearchCollectionRendererProps,\n InputSearchSuggestion\n} from './InputSearch';\nimport { styles as inputSearchStyles } from './themes/InputSearchStyles.css';\nimport { InputSearchSuggestions } from './InputSearchSuggestions';\nimport type { InputSearchSuggestionsProps } from './InputSearchSuggestions';\n\n/**\n * Props for the desktop-only suggestion popup content shared between loading and loaded states.\n */\ntype Props<T extends InputSearchSuggestion<Data>> = {\n /** Input element used to position the dropdown. */\n anchorRef: RefObject<HTMLElement>;\n /** Wrapper around collection-mode content for focus management. */\n collectionContainerRef: RefObject<HTMLDivElement>;\n /** Optional collection renderer used in collection mode. */\n collectionRenderer?: (props: InputSearchCollectionRendererProps<T>) => ComponentChildren;\n /** Collection renderer context shared across surfaces. */\n collectionRendererContext: InputSearchCollectionRendererProps<T>;\n /** Root dropdown element reference for popup measurement and dismissal. */\n dropdownRef: RefObject<HTMLDivElement>;\n /** Generates the option id used by `aria-activedescendant`. */\n getOptionId: (index: number) => string;\n /** Pointer-hovered suggestion index. */\n hoveredIndex: number;\n /** Base id for the listbox and popup content. */\n id: string;\n /** Distinguishes pointer highlight from keyboard-managed focus. */\n interactionMode?: 'keyboard' | 'pointer';\n /** Optional text mapping for default suggestion rendering. */\n suggestionItemText?: InputSearchSuggestionsProps<T>['suggestionItemText'];\n /** Optional custom renderer for each suggestion row. */\n suggestionItemRenderer?: InputSearchSuggestionsProps<T>['suggestionItemRenderer'];\n /** Whether the popup should render loading skeletons instead of suggestions. */\n isLoading: boolean;\n /** Whether collection mode is active. */\n isCollectionMode: boolean;\n /** Whether the dropdown is currently open. */\n isOpen: boolean;\n /** Keyboard-focused suggestion index used for active descendant and commit. */\n keyboardFocusedIndex: number;\n /** Whether to draw the keyboard focus indicator for the active suggestion. */\n showKeyboardFocusIndicator: boolean;\n /** Skeleton row count used to preserve popup height during async loads. */\n loadingSkeletonCount: number;\n /** Dismiss callback forwarded to the popup container. */\n onAutoDismiss: (event?: Event) => void;\n /** Converts collection row clicks into row-action commits. */\n onCollectionClickCapture: (event: MouseEvent) => void;\n /** Handles Escape while focus is inside the rendered collection. */\n onCollectionKeyDownCapture: (event: KeyboardEvent) => void;\n /** Handles focus leaving the rendered collection. */\n onCollectionFocusOut: (event: FocusEvent) => void;\n /** Mutable option element registry for keyboard navigation and aria wiring. */\n optionRefs: (HTMLElement | null)[];\n /** Updates the hovered suggestion index. */\n onHoverIndexChange: (index: number) => void;\n /** Clears pointer hover state when the pointer leaves the popup. */\n onPointerLeave: () => void;\n /** Commits a selected suggestion back to `InputSearch`. */\n onSuggestionSelection: (suggestion: T, index: number) => void;\n /** Current user-entered text used for highlight rendering. */\n searchText: string;\n /** Suggestions currently available for rendering. */\n suggestions: readonly T[];\n};\n\n/**\n * Renders the desktop InputSearch popup and keeps listbox option ids aligned with\n * the input's active-descendant model.\n */\nexport function InputSearchDesktopSuggestions<T extends InputSearchSuggestion<Data>>({\n anchorRef,\n collectionContainerRef,\n collectionRenderer,\n collectionRendererContext,\n dropdownRef,\n getOptionId,\n hoveredIndex,\n id,\n interactionMode,\n isCollectionMode,\n isLoading,\n suggestionItemText,\n suggestionItemRenderer,\n isOpen,\n keyboardFocusedIndex,\n showKeyboardFocusIndicator,\n loadingSkeletonCount,\n onAutoDismiss,\n onCollectionClickCapture,\n onCollectionFocusOut,\n onCollectionKeyDownCapture,\n optionRefs,\n onHoverIndexChange,\n onPointerLeave,\n onSuggestionSelection,\n searchText,\n suggestions\n}: Props<T>) {\n const translations = useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\n const ariaLabel = translations.accSearch();\n\n // The collection renderer can mount table/list internals asynchronously. Keep the rendered\n // collection labelled even when the actual grid/listbox appears after the popup opens. The\n // renderer dependency also gives swapped renderers a synchronous label pass before observation.\n useEffect(() => {\n if (!isCollectionMode) {\n return;\n }\n\n const collectionContainer = collectionContainerRef.current;\n if (!collectionContainer) {\n return;\n }\n\n const applyCollectionLabel = () => {\n const tableElement = collectionContainer.querySelector<HTMLElement>(\n '[role=\"grid\"], [role=\"treegrid\"]'\n );\n const listElement = collectionContainer.querySelector<HTMLElement>(\n '[role=\"listbox\"], [role=\"list\"]'\n );\n\n if (tableElement && !tableElement.hasAttribute('aria-label')) {\n tableElement.setAttribute('aria-label', ariaLabel);\n return;\n }\n\n if (listElement && !listElement.hasAttribute('aria-label')) {\n listElement.setAttribute('aria-label', ariaLabel);\n }\n };\n\n applyCollectionLabel();\n\n if (typeof MutationObserver === 'undefined') {\n return;\n }\n\n const observer = new MutationObserver(() => {\n applyCollectionLabel();\n });\n\n observer.observe(collectionContainer, { childList: true, subtree: true });\n\n return () => {\n observer.disconnect();\n };\n }, [ariaLabel, collectionContainerRef, collectionRenderer, isCollectionMode]);\n\n return (\n <Dropdown\n anchorRef={anchorRef}\n dropdownRef={dropdownRef}\n id={`${id}-popup`}\n isOpen={isOpen}\n onAutoDismiss={onAutoDismiss}>\n <DropdownList hasBottomGap={true} hasTopGap={true} id={`${id}-content`} isLoading={isLoading}>\n {isCollectionMode && collectionRenderer ? (\n <div\n aria-label={ariaLabel}\n id={id}\n onClickCapture={onCollectionClickCapture}\n onFocusOut={onCollectionFocusOut}\n onKeyDownCapture={onCollectionKeyDownCapture}\n ref={collectionContainerRef}\n role=\"dialog\">\n <div class={inputSearchStyles.collectionWrapper}>\n {collectionRenderer(collectionRendererContext)}\n </div>\n </div>\n ) : (\n <InputSearchSuggestions\n ariaLabel={ariaLabel}\n getOptionId={getOptionId}\n hoveredIndex={hoveredIndex}\n id={id}\n interactionMode={interactionMode}\n isLoading={isLoading}\n keyboardFocusedIndex={keyboardFocusedIndex}\n showKeyboardFocusIndicator={showKeyboardFocusIndicator}\n loadingSkeletonCount={loadingSkeletonCount}\n suggestionItemRenderer={suggestionItemRenderer}\n suggestionItemText={suggestionItemText}\n onHoverIndexChange={onHoverIndexChange}\n onPointerLeave={onPointerLeave}\n onSuggestionSelection={onSuggestionSelection}\n optionRefs={optionRefs}\n searchText={searchText}\n suggestions={suggestions}\n />\n )}\n </DropdownList>\n </Dropdown>\n );\n}\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * Licensed under The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport type { ComponentChildren, ComponentProps, Ref, RefObject } from 'preact';\nimport { useEffect } from 'preact/hooks';\nimport { ClearIcon } from '#PRIVATE_ClearIcon/ClearIcon';\nimport { DropdownList, SelectMobileDropdown } from '#PRIVATE_SelectCommon';\nimport { HiddenAccessible } from '#UNSAFE_HiddenAccessible';\nimport { IconButton } from '#UNSAFE_IconButton';\nimport { NavLeft } from '#UNSAFE_RedwoodIcons/NavLeft';\nimport type { FocusableHandle } from '#hooks/UNSAFE_useFocusableTextField';\nimport { useTranslationBundle } from '#hooks/UNSAFE_useTranslationBundle';\nimport type { BundleType } from '#resources/nls/bundle';\nimport type {\n Data,\n InputSearchCollectionRendererProps,\n InputSearchSuggestion\n} from './InputSearch';\nimport { InputSearchBase } from './InputSearchBase';\nimport { InputSearchSuggestions, type InputSearchSuggestionsProps } from './InputSearchSuggestions';\nimport { styles as inputSearchStyles } from './themes/InputSearchStyles.css';\n\n/**\n * Suggestion-list props forwarded directly to the shared overlay list renderer.\n */\ntype PickedInputSearchSuggestionsProps<T extends InputSearchSuggestion<Data>> = Pick<\n InputSearchSuggestionsProps<T>,\n | 'getOptionId'\n | 'hoveredIndex'\n | 'id'\n | 'interactionMode'\n | 'isLoading'\n | 'suggestionItemRenderer'\n | 'suggestionItemText'\n | 'keyboardFocusedIndex'\n | 'showKeyboardFocusIndicator'\n | 'loadingSkeletonCount'\n | 'onHoverIndexChange'\n | 'onPointerLeave'\n | 'onSuggestionSelection'\n | 'optionRefs'\n | 'searchText'\n | 'suggestions'\n>;\n\ntype InputSearchBaseProps = ComponentProps<typeof InputSearchBase>;\n\n/**\n * Props for the mobile full-screen InputSearch overlay.\n */\ntype Props<T extends InputSearchSuggestion<Data>> = PickedInputSearchSuggestionsProps<T> & {\n /**\n * ID of the keyboard-active option mirrored onto the overlay input.\n */\n activeDescendantId?: string;\n\n /**\n * Announces whether overlay suggestions support inline autocomplete.\n */\n ariaAutoComplete?: InputSearchBaseProps['ariaAutoComplete'];\n\n /**\n * Associates the overlay input with descriptive text.\n */\n ariaDescribedBy?: InputSearchBaseProps['ariaDescribedBy'];\n\n /**\n * Wrapper around collection-mode content for focus management.\n */\n collectionContainerRef: RefObject<HTMLDivElement>;\n\n /**\n * Optional collection renderer used in collection mode.\n */\n collectionRenderer?: (props: InputSearchCollectionRendererProps<T>) => ComponentChildren;\n\n /**\n * Collection renderer context shared across surfaces.\n */\n collectionRendererContext: InputSearchCollectionRendererProps<T>;\n\n /**\n * Ref for the interactive input element rendered in the overlay header.\n */\n inputRef?: InputSearchBaseProps['inputRef'];\n\n /**\n * Imperative handle exposed while the mobile overlay field is the active input.\n */\n inputSearchRef?: Ref<FocusableHandle>;\n\n /**\n * Whether the full-screen mobile overlay is currently open.\n */\n isOpen: boolean;\n\n /**\n * Whether collection mode is active.\n */\n isCollectionMode: boolean;\n\n /**\n * Value displayed in the overlay input, including any inline autocomplete preview.\n */\n renderedValue: string;\n\n /**\n * Assistive text announced from the overlay field's live region.\n */\n liveRegionText?: InputSearchBaseProps['liveRegionText'];\n\n /**\n * Callback invoked when focus leaves the overlay input.\n */\n onBlur?: InputSearchBaseProps['onBlur'];\n\n /**\n * Clears the current query from the overlay input.\n */\n onClear: () => void;\n\n /**\n * Closes the mobile overlay without committing a new value.\n */\n onClose: () => void;\n\n /**\n * Commits the current overlay input value.\n */\n onCommit: (value: string) => void;\n\n /**\n * Handles pointer selection while focus is inside the rendered collection.\n */\n onCollectionClickCapture: (event: MouseEvent) => void;\n\n /**\n * Handles focus leaving the rendered collection.\n */\n onCollectionFocusOut: (event: FocusEvent) => void;\n\n /**\n * Handles Escape while focus is inside the rendered collection.\n */\n onCollectionKeyDownCapture: (event: KeyboardEvent) => void;\n\n /**\n * Callback invoked when focus enters the overlay input.\n */\n onFocus?: InputSearchBaseProps['onFocus'];\n\n /**\n * Callback invoked when the overlay input value changes.\n */\n onInput?: InputSearchBaseProps['onInput'];\n\n /**\n * Handles keyboard navigation and submission keys from the overlay input.\n */\n onKeyDown?: InputSearchBaseProps['onKeyDown'];\n\n /**\n * Placeholder text shown inside the overlay input.\n */\n placeholder?: string;\n\n /**\n * ID of the mobile dialog container and the basis for its hidden label id.\n */\n popupId: string;\n\n /**\n * Root test id used to derive stable hooks for internal mobile affordances.\n */\n testId?: string;\n};\n\n/**\n * Renders the phone-specific full-screen InputSearch overlay, including the search field\n * in the header and the shared suggestions list in the body.\n */\nexport function InputSearchMobileDropdown<T extends InputSearchSuggestion<Data>>({\n activeDescendantId,\n ariaAutoComplete,\n ariaDescribedBy,\n collectionContainerRef,\n collectionRenderer,\n collectionRendererContext,\n getOptionId,\n hoveredIndex,\n id,\n inputRef,\n inputSearchRef,\n interactionMode,\n isCollectionMode,\n isLoading,\n suggestionItemText,\n suggestionItemRenderer,\n isOpen,\n liveRegionText,\n keyboardFocusedIndex,\n showKeyboardFocusIndicator,\n loadingSkeletonCount,\n onBlur,\n onClear,\n onClose,\n onCollectionClickCapture,\n onCollectionFocusOut,\n onCollectionKeyDownCapture,\n onCommit,\n onFocus,\n onHoverIndexChange,\n onInput,\n onKeyDown,\n onPointerLeave,\n onSuggestionSelection,\n optionRefs,\n placeholder,\n popupId,\n renderedValue,\n searchText,\n suggestions,\n testId\n}: Props<T>) {\n const translations = useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\n const backButtonAriaLabel = translations.selectMultiple_back();\n const searchAriaLabel = translations.accSearch();\n const dialogLabelId = `${popupId}-label`;\n // Only render the clear affordance when there is typed text to clear from the overlay field.\n const clearButtonTestId = testId !== undefined ? `${testId}-mobile-clear` : undefined;\n const endContent =\n searchText !== '' ? <ClearIcon onClick={onClear} testId={clearButtonTestId} /> : undefined;\n // Put the close/back action inside the field chrome so the header stays compact on phones.\n const startContent = (\n <IconButton aria-label={backButtonAriaLabel} onAction={onClose} size=\"xs\" variant=\"ghost\">\n <NavLeft />\n </IconButton>\n );\n\n // Collection renderers can mount their table/list body after the dialog itself. Reapply the\n // search label as those internals appear so the mobile collection popup remains named for\n // screen readers.\n // The renderer dependency also gives swapped renderers a synchronous label pass before observation.\n useEffect(() => {\n if (!isCollectionMode) {\n return;\n }\n\n const collectionContainer = collectionContainerRef.current;\n if (!collectionContainer) {\n return;\n }\n\n const applyCollectionLabel = () => {\n const tableElement = collectionContainer.querySelector<HTMLElement>(\n '[role=\"grid\"], [role=\"treegrid\"]'\n );\n const listElement = collectionContainer.querySelector<HTMLElement>(\n '[role=\"listbox\"], [role=\"list\"]'\n );\n\n if (tableElement && !tableElement.hasAttribute('aria-label')) {\n tableElement.setAttribute('aria-label', searchAriaLabel);\n return;\n }\n\n if (listElement && !listElement.hasAttribute('aria-label')) {\n listElement.setAttribute('aria-label', searchAriaLabel);\n }\n };\n\n applyCollectionLabel();\n\n if (typeof MutationObserver === 'undefined') {\n return;\n }\n\n const observer = new MutationObserver(() => {\n applyCollectionLabel();\n });\n\n observer.observe(collectionContainer, { childList: true, subtree: true });\n\n return () => {\n observer.disconnect();\n };\n }, [collectionContainerRef, collectionRenderer, isCollectionMode, searchAriaLabel]);\n\n return (\n <SelectMobileDropdown\n header={\n <>\n {/* The mobile dialog needs a label even though the visible header is composed from controls\n instead of a dedicated title element. */}\n <HiddenAccessible id={dialogLabelId}>{searchAriaLabel}</HiddenAccessible>\n <InputSearchBase\n ariaActiveDescendant={activeDescendantId}\n ariaAutoComplete={ariaAutoComplete}\n ariaBusy={isLoading ? true : undefined}\n ariaControls={isCollectionMode ? popupId : id}\n ariaDescribedBy={ariaDescribedBy}\n ariaExpanded={isOpen}\n ariaHasPopup={isCollectionMode ? 'dialog' : 'listbox'}\n autoComplete=\"off\"\n endContent={endContent}\n inputRef={inputRef}\n // iOS VoiceOver announces dialog updates reliably when the live region stays with the active input.\n liveRegionText={liveRegionText}\n onBlur={onBlur}\n onCommit={onCommit}\n onFocus={onFocus}\n onInput={onInput}\n onKeyDown={onKeyDown}\n placeholder={placeholder}\n ref={inputSearchRef}\n spellcheck={false}\n startContent={startContent}\n type=\"search\"\n value={renderedValue}\n />\n </>\n }\n id={popupId}\n isOpen={isOpen}\n labelId={dialogLabelId}>\n <DropdownList hasTopGap={!isCollectionMode} hasBottomGap={true} isLoading={isLoading}>\n {isCollectionMode && collectionRenderer ? (\n <div\n id={id}\n class={inputSearchStyles.collectionOuterWrapper}\n onClickCapture={onCollectionClickCapture}\n onFocusOut={onCollectionFocusOut}\n onKeyDownCapture={onCollectionKeyDownCapture}\n ref={collectionContainerRef}>\n <div class={inputSearchStyles.collectionWrapper}>\n {collectionRenderer(collectionRendererContext)}\n </div>\n </div>\n ) : (\n <InputSearchSuggestions\n ariaLabel={searchAriaLabel}\n getOptionId={getOptionId}\n hoveredIndex={hoveredIndex}\n id={id}\n interactionMode={interactionMode}\n isLoading={isLoading}\n keyboardFocusedIndex={keyboardFocusedIndex}\n showKeyboardFocusIndicator={showKeyboardFocusIndicator}\n loadingSkeletonCount={loadingSkeletonCount}\n onHoverIndexChange={onHoverIndexChange}\n onPointerLeave={onPointerLeave}\n onSuggestionSelection={onSuggestionSelection}\n optionRefs={optionRefs}\n searchText={searchText}\n suggestionItemRenderer={suggestionItemRenderer}\n suggestionItemText={suggestionItemText}\n suggestions={suggestions}\n />\n )}\n </DropdownList>\n </SelectMobileDropdown>\n );\n}\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * Licensed under The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport {\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState\n} from 'preact/hooks';\nimport type { ComponentProps } from 'preact';\nimport { error } from '#utils/UNSAFE_logger';\nimport type { ValueUpdateDetail } from '#utils/UNSAFE_valueUpdateDetail';\nimport type {\n Data,\n InputSearchCollectionItemContext,\n InputSearchCollectionRendererProps,\n InputSearchCommitDetail,\n Key,\n InputSearchSuggestion,\n InputSearchSuggestionItemKey,\n InputSearchSuggestionItemText\n} from './InputSearch';\nimport { InputSearchBase } from './InputSearchBase';\nimport {\n getItemText,\n isPhone,\n suggestionDataContainsQuery,\n suggestionTextContainsQuery\n} from './utils';\n\ntype SearchBaseProps = ComponentProps<typeof InputSearchBase>;\n\n// Mobile collection mode commits rows from captured taps. These descendants should own their\n// own tap/click behavior so tapping a nested button, link, input, etc. does not commit the row.\nconst interactiveCollectionDescendantSelector = [\n 'button',\n 'a[href]',\n 'input',\n 'select',\n 'textarea',\n 'summary',\n 'label',\n '[contenteditable=\"\"]',\n '[contenteditable=\"true\"]',\n '[role=\"button\"]',\n '[role=\"link\"]',\n '[role=\"checkbox\"]',\n '[role=\"combobox\"]',\n '[role=\"menuitem\"]',\n '[role=\"menuitemcheckbox\"]',\n '[role=\"menuitemradio\"]',\n '[role=\"radio\"]',\n '[role=\"slider\"]',\n '[role=\"spinbutton\"]',\n '[role=\"switch\"]',\n '[role=\"tab\"]',\n '[role=\"textbox\"]'\n].join(', ');\n// Collection renderers can expose focus and row markers either through InputSearch-specific\n// attributes or through the underlying JET table/list DOM that InputSearch integrates with.\nconst collectionFocusTargetSelectors = [\n '[data-oj-input-search-focus-target=\"true\"]',\n '[tabindex=\"0\"]',\n '[role=\"grid\"], [role=\"treegrid\"], [role=\"listbox\"]',\n 'oj-c-table, oj-c-list-view'\n] as const;\n// Shift+Tab boundary detection needs the real tabbable order inside the rendered collection so we\n// only override focus when the user is leaving from the first collection tab stop.\nconst collectionTabbableSelector = [\n 'button:not([disabled]):not([hidden])',\n '[href]:not([hidden])',\n 'input:not([disabled]):not([hidden])',\n 'select:not([disabled]):not([hidden])',\n 'textarea:not([disabled]):not([hidden])',\n '[tabindex]:not([tabindex=\"-1\"]):not([disabled]):not([hidden])',\n 'video:not([disabled]):not([hidden])',\n '[contenteditable]:not([contenteditable=\"false\"])'\n].join(', ');\nconst collectionKeyElementSelector = '[data-oj-key], [data-oj-input-search-key]';\n// Reuse shared empty collection structures so non-collection mode can skip the keyed work\n// without allocating fresh arrays/maps on every render.\nconst EMPTY_COLLECTION_ITEM_CONTEXTS: readonly InputSearchCollectionItemContext<\n InputSearchSuggestion<Data>\n>[] = [];\nconst EMPTY_COLLECTION_CONTEXT_MAP = new Map<\n Key,\n InputSearchCollectionItemContext<InputSearchSuggestion<Data>>\n>();\n// Collection wrappers can expose their focus target after asynchronous rendering settles. Ten\n// 50 ms retries give that work up to 500 ms without polling forever when no target is available.\nconst COLLECTION_FOCUS_RETRY_LIMIT = 10;\nconst COLLECTION_FOCUS_RETRY_DELAY = 50;\n// Separate caches keep navigation, typed key matching, and legacy string fallback cheap once the\n// rendered collection suggestions have been normalized.\nconst EMPTY_COLLECTION_KEY_INDEX_MAP = new Map<Key, number>();\nconst EMPTY_COLLECTION_TYPED_KEY_MAP = new Map<\n string,\n InputSearchCollectionItemContext<InputSearchSuggestion<Data>>\n>();\nconst EMPTY_COLLECTION_LEGACY_KEY_MAP = new Map<\n string,\n InputSearchCollectionItemContext<InputSearchSuggestion<Data>>\n>();\n\n/**\n * Props accepted by {@link useInputSearch}.\n */\ntype UseInputSearchProps<T extends InputSearchSuggestion<Data>> = {\n /**\n * Enables desktop autocomplete typeahead preview.\n * When set to `off`, suggestions still render, but typing does not automatically preview or\n * focus the first suggestion. Phone input keeps typed text raw until explicit navigation.\n */\n autocomplete?: 'on' | 'off';\n\n /**\n * Optional collection renderer used for collection-mode suggestion rendering.\n */\n collectionRenderer?: (props: InputSearchCollectionRendererProps<T>) => unknown;\n\n /**\n * Called when the user commits the current value by pressing Enter or selecting a suggestion.\n */\n onCommit?: (detail: InputSearchCommitDetail<T>) => void;\n\n /**\n * Internal bridge used when focus leaves collection-mode popup content.\n */\n onCollectionBlur?: (detail: ValueUpdateDetail<string>) => void;\n\n /**\n * Internal Core Pack bridge that prevents a dismissed collection autocomplete preview from\n * reappearing when the committed freeform value is reopened.\n */\n suppressCollectionAutocomplete?: boolean;\n\n /**\n * Internal Core Pack bridge that allows a matching collection row to stay highlighted while a\n * dismissed autocomplete prefix is edited and the replacement DataProvider result is pending.\n */\n allowSuppressedCollectionHighlight?: boolean;\n\n /**\n * Called when the visible field value changes without a native input event.\n */\n onDisplayValueChanged?: (detail: ValueUpdateDetail<string>) => void;\n\n /**\n * Called when the input value changes.\n */\n onInput?: (detail: ValueUpdateDetail<string>) => void;\n\n /**\n * Specifies the text to render for a suggestion. Provide either a top-level data field name or\n * a callback that returns the display text from the suggestion context. Defaults to `label`.\n */\n suggestionItemText?: InputSearchSuggestionItemText<T>;\n\n /**\n * Whether suggestions use custom row content that can expose matchable text outside\n * suggestionItemText.\n */\n hasSuggestionItemRenderer?: boolean;\n\n /**\n * Stable key resolver required for collection-mode suggestions.\n */\n suggestionItemKey?: InputSearchSuggestionItemKey<T>;\n\n /**\n * Suggestions to render in the dropdown or mobile overlay.\n * Pass `null` to show the loading state while suggestions are being fetched.\n */\n suggestions?: readonly T[] | null;\n\n /**\n * Controlled input value.\n */\n value?: string;\n};\n\ntype SuggestionNavigationDirection = 'next' | 'previous';\ntype SelectionRange = { end: number | null; start: number | null };\nconst EMPTY_SUGGESTIONS: readonly InputSearchSuggestion<Data>[] = [];\n\n/**\n * Returns whether an event target is contained by an element, crossing through shadow hosts.\n *\n * Collection templates can render real JET components with shadow DOM, so focus and pointer\n * events often report a shadow descendant instead of a light-DOM child of the popup.\n */\nfunction isElementWithinTarget(\n node: EventTarget | null,\n container: Element | null | undefined\n): boolean {\n if (!(node instanceof Node) || !container) {\n return false;\n }\n\n if (container.contains(node)) {\n return true;\n }\n\n const root = node.getRootNode();\n\n return typeof ShadowRoot !== 'undefined' && root instanceof ShadowRoot\n ? isElementWithinTarget(root.host, container)\n : false;\n}\n\n/**\n * Resolves the currently focused element through nested shadow roots.\n */\nfunction getDeepActiveElement(): Element | null {\n let activeElement = document.activeElement;\n\n while (\n activeElement instanceof HTMLElement &&\n activeElement.shadowRoot?.activeElement instanceof Element\n ) {\n activeElement = activeElement.shadowRoot.activeElement;\n }\n\n return activeElement;\n}\n\n/**\n * Finds matching elements under a root, including descendants inside component shadow roots.\n */\nfunction querySelectorAllDeep(root: ParentNode, selector: string): HTMLElement[] {\n const matches: HTMLElement[] = [];\n\n const collectMatches = (currentRoot: ParentNode) => {\n if (currentRoot instanceof HTMLElement && currentRoot.matches(selector)) {\n matches.push(currentRoot);\n }\n\n currentRoot.querySelectorAll<HTMLElement>(selector).forEach((element) => {\n matches.push(element);\n });\n\n currentRoot.querySelectorAll<HTMLElement>('*').forEach((element) => {\n if (element.shadowRoot) {\n collectMatches(element.shadowRoot);\n }\n });\n };\n\n collectMatches(root);\n return matches;\n}\n\n/**\n * Filters out collection descendants that match a tabbable selector but cannot actually receive\n * keyboard focus because they are hidden or removed from layout.\n */\nfunction isVisibleCollectionTabbable(element: HTMLElement): boolean {\n if (element.offsetParent === null) {\n return false;\n }\n\n return window.getComputedStyle(element).visibility !== 'hidden';\n}\n\n/**\n * Reads row key markers from custom collection renderers or JET collection rows.\n *\n * InputSearch does not set these attributes here. JET table/list rows already expose\n * `data-oj-key`/`data-oj-key-type`; custom renderers can use the InputSearch-prefixed fallback.\n */\nfunction getCollectionKeyAttributes(element: HTMLElement) {\n return {\n keyAttribute:\n element.getAttribute('data-oj-input-search-key') ?? element.getAttribute('data-oj-key'),\n keyTypeAttribute:\n element.getAttribute('data-oj-input-search-key-type') ??\n element.getAttribute('data-oj-key-type')\n };\n}\n\n/**\n * Matches a DOM row marker to a collection key without collapsing numeric and string keys.\n */\nfunction isTypedCollectionKeyMatch(element: HTMLElement, key: Key) {\n const { keyAttribute, keyTypeAttribute } = getCollectionKeyAttributes(element);\n\n if (keyAttribute === null) {\n return false;\n }\n\n if (typeof key === 'number') {\n return keyTypeAttribute === 'number' && keyAttribute === String(key);\n }\n\n return keyTypeAttribute !== 'number' && keyAttribute === key;\n}\n\n/**\n * Legacy fallback for collection rows that do not expose a key type marker.\n */\nfunction isLegacyCollectionKeyMatch(element: HTMLElement, key: Key) {\n const { keyAttribute } = getCollectionKeyAttributes(element);\n\n return keyAttribute === String(key);\n}\n\nfunction getTypedCollectionKeyLookup(key: Key | string, keyType?: 'number' | 'string') {\n const resolvedKeyType = keyType ?? (typeof key === 'number' ? 'number' : ('string' as const));\n\n return `${resolvedKeyType}:${String(key)}`;\n}\n\nfunction isValidCollectionElement(\n element: HTMLElement | null | undefined,\n collectionContainer: HTMLElement\n) {\n return !!element?.isConnected && collectionContainer.contains(element);\n}\n\n/**\n * Hook that manages InputSearch state and behavior.\n */\nexport function useInputSearch<T extends InputSearchSuggestion<Data>>({\n autocomplete = 'on',\n hasSuggestionItemRenderer = false,\n collectionRenderer,\n suggestionItemKey,\n suggestionItemText,\n onCommit,\n onCollectionBlur,\n suppressCollectionAutocomplete = false,\n allowSuppressedCollectionHighlight = false,\n onDisplayValueChanged,\n onInput,\n suggestions,\n value: propValue\n}: UseInputSearchProps<T>) {\n const dropdownId = useId();\n const rootRef = useRef<HTMLDivElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n const dropdownRef = useRef<HTMLDivElement>(null);\n const collectionContainerRef = useRef<HTMLDivElement>(null);\n const optionRefs = useRef<(HTMLElement | null)[]>([]);\n const pendingTypeaheadSyncRef = useRef(false);\n const pendingAcceptedCaretPositionRef = useRef<number | null>(null);\n const pendingTypeaheadAcceptedCaretPositionRef = useRef<number | null>(null);\n const suppressAutocompleteRef = useRef(false);\n const commitRawValueOnEnterRef = useRef(false);\n const acceptedAutocompleteValueRef = useRef<string | null>(null);\n const shouldHighlightSuppressedPrefixRef = useRef(true);\n const pendingControlledRestoreValueRef = useRef<string | null>(null);\n const pendingControlledInputRef = useRef<{\n caretPosition?: number | null;\n previousCommitValue?: string;\n shouldHighlightSuppressedPrefix: boolean;\n shouldSuppressAutocomplete: boolean;\n value: string;\n } | null>(null);\n const pendingControlledCollectionCommitValueRef = useRef<string | null>(null);\n const pendingControlledCollectionCommitPreviousValueRef = useRef<string | null>(null);\n const lastRenderedSuggestionCountRef = useRef(1);\n const mobileOverlayFocusTimerRef = useRef<number | undefined>();\n const collectionTapActionTimerRef = useRef<number | undefined>();\n const collectionFocusRetryTimerRef = useRef<number | undefined>();\n const collectionFocusRetryCountRef = useRef(0);\n const collectionFocusTargetsRef = useRef<HTMLElement[]>([]);\n const collectionScrollTargetCacheRef = useRef(new Map<string, HTMLElement>());\n const savedCaretRangeRef = useRef<SelectionRange | null>(null);\n const hasCollectionFocusSinceOpenRef = useRef(false);\n const pendingCollectionInputOpenRef = useRef(false);\n const shouldFocusCollectionRef = useRef(false);\n const hasDispatchedCollectionBlurRef = useRef(false);\n const shouldRestoreCollectionInputValueOnFocusRef = useRef(false);\n const isControlled = propValue !== undefined;\n const isPhoneDevice = isPhone();\n const isCollectionMode = collectionRenderer !== undefined && suggestionItemKey !== undefined;\n const isAutocompletePreviewOn = autocomplete === 'on';\n const isCollectionAutocompleteHighlightOn =\n isAutocompletePreviewOn ||\n (allowSuppressedCollectionHighlight && suppressAutocompleteRef.current);\n const isAutocompleteOn = isAutocompletePreviewOn && !isCollectionMode;\n const inputType: SearchBaseProps['type'] = isPhoneDevice ? 'search' : 'text';\n const hasSuggestions = suggestions !== undefined;\n const hasSuggestionsDropdown = hasSuggestions && !isPhoneDevice;\n const hasSuggestionsOverlay = hasSuggestions && isPhoneDevice;\n const isSuggestionsLoading = hasSuggestions && suggestions === null;\n // Use a module-level empty array so suggestion-dependent effects do not rerun every render while\n // suggestions are absent or loading.\n const suggestionItems: readonly T[] = suggestions ?? (EMPTY_SUGGESTIONS as readonly T[]);\n const [isDropdownOpen, setIsDropdownOpen] = useState(false);\n const [hoveredSuggestionIndex, setHoveredSuggestionIndex] = useState(-1);\n const [keyboardFocusedSuggestionIndex, setKeyboardFocusedSuggestionIndex] = useState(-1);\n const [showKeyboardFocusIndicator, setShowKeyboardFocusIndicator] = useState(false);\n const [interactionMode, setInteractionMode] = useState<'keyboard' | 'pointer'>();\n const [filterText, setFilterText] = useState(propValue ?? '');\n const [renderedValue, setRenderedValue] = useState(propValue ?? '');\n const [floatingAutocompleteText, setFloatingAutocompleteText] = useState<string | null>(null);\n const [lastAnnouncedEmptyQuery, setLastAnnouncedEmptyQuery] = useState('');\n const [autocompleteRange, setAutocompleteRange] = useState<{ start: number; end: number } | null>(\n null\n );\n const isDropdownOpenRef = useRef(false);\n const [currentRowKeyOverride, setCurrentRowKeyOverride] = useState<\n InputSearchCollectionItemContext<T>['key'] | undefined\n >();\n const [collectionFocusRequest, setCollectionFocusRequest] = useState(0);\n const currentRowKeyOverrideRef = useRef<InputSearchCollectionItemContext<T>['key'] | undefined>();\n const [committedRowKey, setCommittedRowKey] = useState<\n InputSearchCollectionItemContext<T>['key'] | undefined\n >();\n const filterTextRef = useRef(propValue ?? '');\n const renderedValueRef = useRef(propValue ?? '');\n const lastPropValueRef = useRef(propValue ?? '');\n const currentCommitValueRef = useRef(propValue);\n const overlayDismissRestoreValueRef = useRef(propValue ?? '');\n\n const updateRenderedValue = useCallback(\n (nextRenderedValue: string, options?: { notifyDisplayValueChanged?: boolean }) => {\n const previousValue = renderedValueRef.current;\n renderedValueRef.current = nextRenderedValue;\n setRenderedValue(nextRenderedValue);\n\n if (options?.notifyDisplayValueChanged && previousValue !== nextRenderedValue) {\n onDisplayValueChanged?.({\n previousValue,\n value: nextRenderedValue\n });\n }\n },\n [onDisplayValueChanged]\n );\n\n // Resolve the text used for default rendering, autocomplete previews, and suggestion commits.\n const getRenderedItemText = useCallback(\n (suggestion: T, index: number) =>\n getItemText(suggestion, {\n suggestionItemText,\n index\n }),\n [suggestionItemText]\n );\n\n const doesSuggestionMatchQuery = useCallback(\n (suggestion: T, index: number, query: string) => {\n const suggestionLabel = getRenderedItemText(suggestion, index);\n\n return (\n suggestionTextContainsQuery(suggestionLabel, query) ||\n (hasSuggestionItemRenderer && suggestionDataContainsQuery(suggestion, query))\n );\n },\n [getRenderedItemText, hasSuggestionItemRenderer]\n );\n\n // Surface a development-time error when collectionRenderer is supplied without stable keys.\n useEffect(() => {\n if (collectionRenderer !== undefined && suggestionItemKey === undefined) {\n error(\n () => 'InputSearch: suggestionItemKey is required when collectionRenderer is provided.'\n );\n }\n }, [collectionRenderer, suggestionItemKey]);\n\n // Collection mode needs stable row keys for current-row, selected-row, and commit details.\n // Non-collection listbox mode can fall back to rendered indexes.\n const getSuggestionKey = useCallback(\n (suggestion: T, index: number) => {\n if (suggestionItemKey === undefined) {\n return isCollectionMode ? undefined : index;\n }\n\n if (typeof suggestionItemKey === 'function') {\n return suggestionItemKey({ data: suggestion, index });\n }\n\n const keyValue = suggestion[suggestionItemKey];\n return typeof keyValue === 'string' || typeof keyValue === 'number' ? keyValue : undefined;\n },\n [isCollectionMode, suggestionItemKey]\n );\n\n // Normalize suggestion data to the richer context shape used by collection mode commits.\n const getSuggestionItemContext = useCallback(\n (suggestion: T, index: number): InputSearchCollectionItemContext<T> | undefined => {\n const key = getSuggestionKey(suggestion, index);\n\n if (key === undefined) {\n return undefined;\n }\n\n return {\n data: suggestion,\n index,\n key,\n metadata: { key }\n };\n },\n [getSuggestionKey]\n );\n\n // Keep collection-only keyed structures off the non-collection listbox path.\n const collectionItemContexts = useMemo(() => {\n if (!isCollectionMode) {\n return EMPTY_COLLECTION_ITEM_CONTEXTS as readonly InputSearchCollectionItemContext<T>[];\n }\n\n // Normalize the rendered suggestions once so keyboard navigation, row actions, and\n // DOM-to-context lookup can all share the same keyed collection view.\n return suggestionItems.reduce<InputSearchCollectionItemContext<T>[]>(\n (itemContexts, suggestion, index) => {\n const itemContext = getSuggestionItemContext(suggestion, index);\n\n if (itemContext) {\n itemContexts.push(itemContext);\n }\n\n return itemContexts;\n },\n []\n );\n }, [getSuggestionItemContext, isCollectionMode, suggestionItems]);\n\n // Keyed lookup keeps row actions and current-row changes aligned with the rendered suggestions\n // even when collection internals report only a row key.\n const suggestionContextMap = useMemo(() => {\n if (!isCollectionMode) {\n return EMPTY_COLLECTION_CONTEXT_MAP as Map<\n InputSearchCollectionItemContext<T>['key'],\n InputSearchCollectionItemContext<T>\n >;\n }\n\n const contextMap = new Map<\n InputSearchCollectionItemContext<T>['key'],\n InputSearchCollectionItemContext<T>\n >();\n\n collectionItemContexts.forEach((itemContext) => {\n contextMap.set(itemContext.key, itemContext);\n });\n\n return contextMap;\n }, [collectionItemContexts, isCollectionMode]);\n\n const collectionItemIndexMap = useMemo(() => {\n if (!isCollectionMode) {\n return EMPTY_COLLECTION_KEY_INDEX_MAP as Map<\n InputSearchCollectionItemContext<T>['key'],\n number\n >;\n }\n\n // Arrow navigation only needs key -> index lookup after the contexts are normalized.\n const indexMap = new Map<InputSearchCollectionItemContext<T>['key'], number>();\n\n collectionItemContexts.forEach((itemContext, index) => {\n indexMap.set(itemContext.key, index);\n });\n\n return indexMap;\n }, [collectionItemContexts, isCollectionMode]);\n\n const collectionTypedKeyMap = useMemo(() => {\n if (!isCollectionMode) {\n return EMPTY_COLLECTION_TYPED_KEY_MAP as Map<string, InputSearchCollectionItemContext<T>>;\n }\n\n // Preserve numeric-vs-string key identity for renderer DOM markers such as \"1\" vs 1.\n const typedKeyMap = new Map<string, InputSearchCollectionItemContext<T>>();\n\n collectionItemContexts.forEach((itemContext) => {\n typedKeyMap.set(getTypedCollectionKeyLookup(itemContext.key), itemContext);\n });\n\n return typedKeyMap;\n }, [collectionItemContexts, isCollectionMode]);\n\n const collectionLegacyKeyMap = useMemo(() => {\n if (!isCollectionMode) {\n return EMPTY_COLLECTION_LEGACY_KEY_MAP as Map<string, InputSearchCollectionItemContext<T>>;\n }\n\n const legacyKeyMap = new Map<string, InputSearchCollectionItemContext<T>>();\n\n collectionItemContexts.forEach((itemContext) => {\n const legacyKey = String(itemContext.key);\n\n if (!legacyKeyMap.has(legacyKey)) {\n legacyKeyMap.set(legacyKey, itemContext);\n }\n });\n\n return legacyKeyMap;\n }, [collectionItemContexts, isCollectionMode]);\n\n const resetSuggestionFocusState = useCallback(() => {\n setHoveredSuggestionIndex(-1);\n setKeyboardFocusedSuggestionIndex(-1);\n setShowKeyboardFocusIndicator(false);\n setInteractionMode(undefined);\n }, []);\n\n const clearCollectionCurrentRow = useCallback(() => {\n currentRowKeyOverrideRef.current = undefined;\n setCurrentRowKeyOverride(undefined);\n }, []);\n\n const saveInputCaretRange = useCallback(() => {\n const inputElement = inputRef.current;\n\n if (inputElement && document.activeElement === inputElement) {\n savedCaretRangeRef.current = {\n end: inputElement.selectionEnd,\n start: inputElement.selectionStart\n };\n }\n }, []);\n\n const openDropdown = useCallback(() => {\n hasDispatchedCollectionBlurRef.current = false;\n hasCollectionFocusSinceOpenRef.current = false;\n shouldRestoreCollectionInputValueOnFocusRef.current = false;\n isDropdownOpenRef.current = true;\n setIsDropdownOpen(true);\n }, []);\n\n const resetAutocomplete = useCallback(\n (nextRenderedValue?: string) => {\n const restoredValue = nextRenderedValue ?? filterTextRef.current;\n setAutocompleteRange(null);\n setFloatingAutocompleteText(null);\n updateRenderedValue(restoredValue, {\n notifyDisplayValueChanged: true\n });\n },\n [updateRenderedValue]\n );\n\n // A Core Pack freeform commit can follow dismissal of a collection autocomplete preview. Keep\n // that preview suppressed until the next input event so reopening shows the committed filter,\n // rather than restoring the old first-row preview.\n useEffect(() => {\n if (isCollectionMode && suppressCollectionAutocomplete) {\n suppressAutocompleteRef.current = true;\n resetAutocomplete();\n }\n }, [isCollectionMode, resetAutocomplete, suppressCollectionAutocomplete]);\n\n const restoreCaretToRawPrefixEnd = useCallback(() => {\n const caretPosition = filterTextRef.current.length;\n\n queueMicrotask(() => {\n const inputElement = inputRef.current;\n\n if (inputElement && document.activeElement === inputElement) {\n inputElement.setSelectionRange(caretPosition, caretPosition);\n }\n });\n }, []);\n\n const restoreCollectionInputValue = useCallback(() => {\n hasCollectionFocusSinceOpenRef.current = false;\n shouldFocusCollectionRef.current = false;\n clearCollectionCurrentRow();\n suppressAutocompleteRef.current = true;\n resetAutocomplete();\n }, [clearCollectionCurrentRow, resetAutocomplete]);\n\n // Build the displayed input value for inline autocomplete while preserving the user's typed casing.\n const buildAutocompletePreviewValue = useCallback(\n (suggestionLabel: string) =>\n filterTextRef.current + suggestionLabel.slice(filterTextRef.current.length),\n []\n );\n\n // Apply the visual-only suggestion preview used by keyboard navigation and typeahead.\n const applyKeyboardFocusPreview = useCallback(\n (suggestion: T, index: number, options?: { autocomplete?: boolean; floating?: boolean }) => {\n const suggestionLabel = getRenderedItemText(suggestion, index);\n\n if (options?.autocomplete) {\n const previewValue = buildAutocompletePreviewValue(suggestionLabel);\n const autocompleteStart = filterTextRef.current.length;\n updateRenderedValue(previewValue, { notifyDisplayValueChanged: true });\n setFloatingAutocompleteText(null);\n setAutocompleteRange(\n previewValue.length > autocompleteStart\n ? {\n start: autocompleteStart,\n end: previewValue.length\n }\n : null\n );\n return;\n }\n\n if (options?.floating) {\n updateRenderedValue(filterTextRef.current, { notifyDisplayValueChanged: true });\n setFloatingAutocompleteText(suggestionLabel);\n setAutocompleteRange(null);\n return;\n }\n\n updateRenderedValue(suggestionLabel, { notifyDisplayValueChanged: true });\n setFloatingAutocompleteText(null);\n setAutocompleteRange(null);\n },\n [buildAutocompletePreviewValue, getRenderedItemText, updateRenderedValue]\n );\n\n // Closing the popup either restores the raw typed filter text (blur/dismiss paths)\n // or preserves the committed/selected display value for commit and selection paths.\n const closeDropdown = useCallback(\n (options?: { preserveDisplayValue?: boolean }) => {\n const preserveDisplayValue = options?.preserveDisplayValue === true;\n pendingTypeaheadSyncRef.current = false;\n if (collectionTapActionTimerRef.current !== undefined) {\n window.clearTimeout(collectionTapActionTimerRef.current);\n collectionTapActionTimerRef.current = undefined;\n }\n if (collectionFocusRetryTimerRef.current !== undefined) {\n window.clearTimeout(collectionFocusRetryTimerRef.current);\n collectionFocusRetryTimerRef.current = undefined;\n }\n collectionFocusRetryCountRef.current = 0;\n hasCollectionFocusSinceOpenRef.current = false;\n shouldFocusCollectionRef.current = false;\n shouldRestoreCollectionInputValueOnFocusRef.current = false;\n isDropdownOpenRef.current = false;\n setIsDropdownOpen(false);\n resetSuggestionFocusState();\n clearCollectionCurrentRow();\n\n if (!preserveDisplayValue) {\n suppressAutocompleteRef.current = false;\n resetAutocomplete();\n } else {\n setAutocompleteRange(null);\n }\n },\n [clearCollectionCurrentRow, resetAutocomplete, resetSuggestionFocusState]\n );\n\n // Collection blur is dispatched once per close path so Core Pack blur writeback cannot race with\n // row action commits or repeated focusout/focusin events from nested collection internals.\n const blurCollectionAndClose = useCallback(() => {\n if (!isCollectionMode || !isDropdownOpen || hasDispatchedCollectionBlurRef.current) {\n return;\n }\n\n hasDispatchedCollectionBlurRef.current = true;\n onCollectionBlur?.({ value: renderedValueRef.current });\n closeDropdown();\n }, [closeDropdown, isCollectionMode, isDropdownOpen, onCollectionBlur]);\n\n // Auto-dismiss receives events from popup infrastructure. In collection mode, Tab is allowed to\n // move focus normally while outside clicks/blur paths commit the current display value on close.\n const handleDropdownAutoDismiss = useCallback(\n (event?: Event) => {\n if (isCollectionMode) {\n if (event instanceof KeyboardEvent && event.key === 'Tab') {\n return;\n }\n\n blurCollectionAndClose();\n return;\n }\n\n closeDropdown();\n },\n [blurCollectionAndClose, closeDropdown, isCollectionMode]\n );\n\n // Collection focus can land inside table/list shadow DOM or inside the popup wrapper itself.\n // Treat those targets as internal so blur writeback waits until focus truly leaves the\n // collection popup.\n const isFocusMovingIntoCollection = useCallback(\n (event: Event) => {\n if (!isCollectionMode) {\n return false;\n }\n\n const focusEvent = event as FocusEvent;\n const popupElement = document.getElementById(`${dropdownId}-popup`);\n\n return (\n isElementWithinTarget(focusEvent.relatedTarget, collectionContainerRef.current) ||\n isElementWithinTarget(focusEvent.relatedTarget, popupElement)\n );\n },\n [dropdownId, isCollectionMode]\n );\n\n // Collection focusout is the main blur path for keyboard and pointer interaction inside\n // the collection body.\n const handleCollectionFocusOut = useCallback(\n (event: FocusEvent) => {\n if (isCollectionMode && isElementWithinTarget(event.relatedTarget, inputRef.current)) {\n if (shouldRestoreCollectionInputValueOnFocusRef.current) {\n restoreCollectionInputValue();\n shouldRestoreCollectionInputValueOnFocusRef.current = false;\n }\n return;\n }\n\n if (!isCollectionMode || !isDropdownOpen) {\n return;\n }\n\n if (isFocusMovingIntoCollection(event)) {\n shouldRestoreCollectionInputValueOnFocusRef.current = false;\n return;\n }\n\n if (shouldRestoreCollectionInputValueOnFocusRef.current) {\n restoreCollectionInputValue();\n shouldRestoreCollectionInputValueOnFocusRef.current = false;\n }\n\n blurCollectionAndClose();\n },\n [\n blurCollectionAndClose,\n isCollectionMode,\n isDropdownOpen,\n isFocusMovingIntoCollection,\n restoreCollectionInputValue\n ]\n );\n\n // Some collection components move focus without bubbling a useful focusout through our wrapper.\n // A document-level focusin closes the collection popup when focus leaves the popup,\n // collection, and input.\n const handleDocumentFocusIn = useCallback(\n (event: FocusEvent) => {\n const popupElement = document.getElementById(`${dropdownId}-popup`);\n const isFocusLeavingCollection =\n isElementWithinTarget(event.relatedTarget, collectionContainerRef.current) ||\n isElementWithinTarget(event.relatedTarget, popupElement);\n\n if (\n !isCollectionMode ||\n !isDropdownOpen ||\n !isFocusLeavingCollection ||\n isElementWithinTarget(event.target, collectionContainerRef.current) ||\n isElementWithinTarget(event.target, popupElement) ||\n isElementWithinTarget(event.target, inputRef.current)\n ) {\n return;\n }\n\n blurCollectionAndClose();\n },\n [blurCollectionAndClose, dropdownId, isCollectionMode, isDropdownOpen]\n );\n\n // Install the document focus fallback only while the collection popup is open.\n useEffect(() => {\n if (!isCollectionMode || !isDropdownOpen) {\n return;\n }\n\n document.addEventListener('focusin', handleDocumentFocusIn);\n\n return () => {\n document.removeEventListener('focusin', handleDocumentFocusIn);\n };\n }, [handleDocumentFocusIn, isCollectionMode, isDropdownOpen]);\n\n const handleInputBlur = useCallback(\n (event: Event) => {\n if (isFocusMovingIntoCollection(event)) {\n return;\n }\n\n closeDropdown();\n },\n [closeDropdown, isFocusMovingIntoCollection]\n );\n\n const syncControlledValue = useCallback(\n (nextValue: string) => {\n filterTextRef.current = nextValue;\n renderedValueRef.current = nextValue;\n lastPropValueRef.current = nextValue;\n overlayDismissRestoreValueRef.current = nextValue;\n acceptedAutocompleteValueRef.current = null;\n commitRawValueOnEnterRef.current = false;\n setFilterText(nextValue);\n setRenderedValue(nextValue);\n setFloatingAutocompleteText(null);\n setAutocompleteRange(null);\n suppressAutocompleteRef.current = false;\n shouldHighlightSuppressedPrefixRef.current = true;\n },\n [setFilterText, setRenderedValue]\n );\n\n // Apply accepted input text to both refs and state, and open the right suggestion surface.\n const applyInputValue = useCallback(\n (\n nextValue: string,\n shouldSuppressAutocomplete: boolean,\n options?: { shouldHighlightSuppressedPrefix?: boolean }\n ) => {\n setLastAnnouncedEmptyQuery('');\n suppressAutocompleteRef.current = shouldSuppressAutocomplete;\n shouldHighlightSuppressedPrefixRef.current = options?.shouldHighlightSuppressedPrefix ?? true;\n pendingTypeaheadSyncRef.current = hasSuggestions;\n if (isCollectionMode) {\n setCommittedRowKey(undefined);\n // A shorter prefix still matches the current row after the user dismisses autocomplete.\n // Preserve that visual collection highlight while the replacement DataProvider result is\n // pending; the raw input and Enter commit remain unchanged.\n if (!shouldSuppressAutocomplete || !allowSuppressedCollectionHighlight) {\n clearCollectionCurrentRow();\n }\n }\n filterTextRef.current = nextValue;\n renderedValueRef.current = nextValue;\n setFilterText(nextValue);\n setRenderedValue(nextValue);\n setFloatingAutocompleteText(null);\n setAutocompleteRange(null);\n\n if (hasSuggestionsDropdown) {\n pendingCollectionInputOpenRef.current = false;\n openDropdown();\n setHoveredSuggestionIndex(-1);\n setKeyboardFocusedSuggestionIndex(-1);\n setInteractionMode('keyboard');\n } else if (hasSuggestionsOverlay) {\n pendingCollectionInputOpenRef.current = false;\n openDropdown();\n resetSuggestionFocusState();\n } else {\n pendingCollectionInputOpenRef.current = isCollectionMode && !hasSuggestions;\n }\n },\n [\n allowSuppressedCollectionHighlight,\n clearCollectionCurrentRow,\n hasSuggestions,\n hasSuggestionsDropdown,\n hasSuggestionsOverlay,\n isCollectionMode,\n openDropdown,\n resetSuggestionFocusState\n ]\n );\n\n // Sync external controlled updates into the internal field state before paint, but avoid\n // clobbering temporary preview text unless the controlled value itself changed.\n useLayoutEffect(() => {\n const nextValue = propValue ?? '';\n const controlledValueChanged = lastPropValueRef.current !== nextValue;\n const localStateDiverged =\n filterTextRef.current !== nextValue || renderedValueRef.current !== nextValue;\n const shouldPreserveTransientSuggestionDisplay =\n hasSuggestions &&\n isDropdownOpen &&\n renderedValueRef.current !== filterTextRef.current &&\n (autocompleteRange !== null ||\n (isCollectionMode && currentRowKeyOverride !== undefined) ||\n (hasSuggestionsDropdown && keyboardFocusedSuggestionIndex >= 0));\n const pendingControlledCollectionCommitValue =\n pendingControlledCollectionCommitValueRef.current;\n\n if (\n !isControlled ||\n (shouldPreserveTransientSuggestionDisplay &&\n !controlledValueChanged &&\n pendingControlledCollectionCommitValue === null)\n ) {\n return;\n }\n\n const pendingControlledCollectionCommitPreviousValue =\n pendingControlledCollectionCommitPreviousValueRef.current;\n\n if (pendingControlledCollectionCommitValue !== null) {\n if (nextValue === pendingControlledCollectionCommitValue) {\n pendingControlledCollectionCommitValueRef.current = null;\n pendingControlledCollectionCommitPreviousValueRef.current = null;\n } else if (nextValue === pendingControlledCollectionCommitPreviousValue) {\n pendingControlledCollectionCommitValueRef.current = null;\n pendingControlledCollectionCommitPreviousValueRef.current = null;\n currentCommitValueRef.current = nextValue;\n setCommittedRowKey(undefined);\n clearCollectionCurrentRow();\n syncControlledValue(nextValue);\n } else if (controlledValueChanged) {\n pendingControlledCollectionCommitValueRef.current = null;\n pendingControlledCollectionCommitPreviousValueRef.current = null;\n currentCommitValueRef.current = nextValue;\n setCommittedRowKey(undefined);\n clearCollectionCurrentRow();\n }\n }\n\n const pendingControlledInput = pendingControlledInputRef.current;\n\n if (pendingControlledInput !== null) {\n if (controlledValueChanged && nextValue === pendingControlledInput.value) {\n pendingControlledInputRef.current = null;\n lastPropValueRef.current = nextValue;\n currentCommitValueRef.current = pendingControlledInput.previousCommitValue;\n applyInputValue(nextValue, pendingControlledInput.shouldSuppressAutocomplete, {\n shouldHighlightSuppressedPrefix: pendingControlledInput.shouldHighlightSuppressedPrefix\n });\n\n const acceptedCaretPosition = pendingControlledInput.caretPosition;\n if (acceptedCaretPosition !== undefined && acceptedCaretPosition !== null) {\n queueMicrotask(() => {\n const inputElement = inputRef.current;\n\n if (inputElement && document.activeElement === inputElement) {\n inputElement.setSelectionRange(acceptedCaretPosition, acceptedCaretPosition);\n }\n });\n }\n return;\n }\n\n if (controlledValueChanged) {\n pendingControlledInputRef.current = null;\n } else {\n return;\n }\n }\n\n const pendingControlledRestoreValue = pendingControlledRestoreValueRef.current;\n\n if (pendingControlledRestoreValue !== null) {\n if (nextValue === pendingControlledRestoreValue) {\n pendingControlledRestoreValueRef.current = null;\n } else if (\n filterTextRef.current === pendingControlledRestoreValue &&\n renderedValueRef.current === pendingControlledRestoreValue\n ) {\n return;\n } else {\n pendingControlledRestoreValueRef.current = null;\n }\n }\n\n if (controlledValueChanged) {\n if (localStateDiverged) {\n currentCommitValueRef.current = nextValue;\n }\n lastPropValueRef.current = nextValue;\n }\n\n if (localStateDiverged) {\n syncControlledValue(nextValue);\n }\n }, [\n applyInputValue,\n autocompleteRange,\n committedRowKey,\n filterText,\n hasSuggestions,\n hasSuggestionsDropdown,\n currentRowKeyOverride,\n isDropdownOpen,\n isControlled,\n isCollectionMode,\n keyboardFocusedSuggestionIndex,\n propValue,\n renderedValue,\n syncControlledValue\n ]);\n\n // Close and reset dropdown state when suggestions are unavailable.\n useEffect(() => {\n if (!hasSuggestions) {\n closeDropdown();\n }\n }, [closeDropdown, hasSuggestions]);\n\n // Clear cached option refs after the popup closes.\n useEffect(() => {\n if (!isDropdownOpen) {\n optionRefs.current = [];\n }\n }, [isDropdownOpen]);\n\n // Clear hover and keyboard focus while loading placeholder content.\n useEffect(() => {\n if (isSuggestionsLoading) {\n resetSuggestionFocusState();\n }\n }, [isSuggestionsLoading, resetSuggestionFocusState]);\n\n // Cache the last non-loading suggestion count so the loading skeleton can preserve popup height.\n useEffect(() => {\n if (!isSuggestionsLoading && suggestionItems.length > 0) {\n lastRenderedSuggestionCountRef.current = suggestionItems.length;\n }\n }, [isSuggestionsLoading, suggestionItems.length]);\n\n // Collection DOM can be recreated as the rendered suggestions change, so invalidate cached\n // focus/row elements and lazily repopulate them on the next keyboard interaction.\n useEffect(() => {\n collectionFocusTargetsRef.current = [];\n collectionScrollTargetCacheRef.current.clear();\n }, [collectionItemContexts, isCollectionMode, isDropdownOpen, isSuggestionsLoading]);\n\n // Clamp keyboard focus when the suggestion list shrinks.\n useEffect(() => {\n const suggestionItemsLength = suggestionItems.length;\n\n if (\n suggestions !== undefined &&\n suggestions !== null &&\n keyboardFocusedSuggestionIndex >= suggestionItemsLength\n ) {\n setKeyboardFocusedSuggestionIndex(suggestionItemsLength > 0 ? suggestionItemsLength - 1 : -1);\n }\n }, [keyboardFocusedSuggestionIndex, suggestionItems.length, suggestions]);\n\n // Keep collection current-row state valid as filtering/loading changes the available rows.\n useEffect(() => {\n if (!isCollectionMode || !isDropdownOpen || isSuggestionsLoading) {\n return;\n }\n\n // Drop stale current-row overrides when filtering removes the previously highlighted row.\n if (collectionItemContexts.length === 0) {\n clearCollectionCurrentRow();\n return;\n }\n\n if (currentRowKeyOverride === undefined) {\n return;\n }\n\n if (!suggestionContextMap.has(currentRowKeyOverride)) {\n clearCollectionCurrentRow();\n }\n }, [\n clearCollectionCurrentRow,\n currentRowKeyOverride,\n isCollectionMode,\n isDropdownOpen,\n isSuggestionsLoading,\n suggestionContextMap,\n collectionItemContexts.length\n ]);\n\n // In desktop collection mode, the first typed candidate can be previewed as the current row\n // without moving focus into the collection body.\n useEffect(() => {\n if (\n !isCollectionMode ||\n !isCollectionAutocompleteHighlightOn ||\n !hasSuggestionsDropdown ||\n !isDropdownOpen ||\n isSuggestionsLoading ||\n (suppressAutocompleteRef.current && !allowSuppressedCollectionHighlight) ||\n shouldRestoreCollectionInputValueOnFocusRef.current ||\n collectionItemContexts.length === 0\n ) {\n return;\n }\n\n const typedFilterText = filterText;\n\n if (typedFilterText.length === 0) {\n return;\n }\n\n const firstItemContext = collectionItemContexts[0];\n const firstItemText = getRenderedItemText(firstItemContext.data, firstItemContext.index);\n\n // Containment is intentional here: collection autocomplete supports a query embedded in the\n // suggestion text, such as \"fox\" matching \"Firefox\", rather than only prefix matches.\n if (!suggestionTextContainsQuery(firstItemText, typedFilterText)) {\n return;\n }\n\n currentRowKeyOverrideRef.current = firstItemContext.key;\n setCurrentRowKeyOverride(firstItemContext.key);\n }, [\n allowSuppressedCollectionHighlight,\n filterText,\n getRenderedItemText,\n hasSuggestionsDropdown,\n isCollectionAutocompleteHighlightOn,\n isCollectionMode,\n isDropdownOpen,\n isSuggestionsLoading,\n collectionItemContexts\n ]);\n\n // Reflect the collection current row into the launcher text only while collection focus is active;\n // otherwise keep typed text available for continued filtering and autocomplete preview.\n useEffect(() => {\n if (!isCollectionMode || !isDropdownOpen) {\n return;\n }\n\n const currentItemContext =\n currentRowKeyOverride !== undefined\n ? suggestionContextMap.get(currentRowKeyOverride)\n : undefined;\n const currentItemText =\n currentItemContext !== undefined\n ? getRenderedItemText(currentItemContext.data, currentItemContext.index)\n : undefined;\n const deepActiveElement = getDeepActiveElement();\n const isCollectionFocused = isElementWithinTarget(\n deepActiveElement,\n collectionContainerRef.current\n );\n if (isCollectionFocused) {\n hasCollectionFocusSinceOpenRef.current = true;\n }\n const shouldRenderCurrentItemText =\n !shouldRestoreCollectionInputValueOnFocusRef.current &&\n (isCollectionFocused || hasCollectionFocusSinceOpenRef.current);\n const hasTypedFilterText = filterTextRef.current.length > 0;\n const shouldAutocompleteCollection =\n !shouldRenderCurrentItemText &&\n currentItemText !== undefined &&\n isAutocompletePreviewOn &&\n hasSuggestionsDropdown &&\n hasTypedFilterText &&\n !suppressAutocompleteRef.current &&\n currentItemText.toLowerCase().startsWith(filterTextRef.current.toLowerCase());\n const shouldShowFloatingCollectionAutocomplete =\n !shouldRenderCurrentItemText &&\n currentItemText !== undefined &&\n isAutocompletePreviewOn &&\n hasSuggestionsDropdown &&\n hasTypedFilterText &&\n !suppressAutocompleteRef.current &&\n suggestionTextContainsQuery(currentItemText, filterTextRef.current) &&\n !shouldAutocompleteCollection;\n\n if (shouldAutocompleteCollection) {\n const previewValue = buildAutocompletePreviewValue(currentItemText);\n const autocompleteStart = filterTextRef.current.length;\n renderedValueRef.current = previewValue;\n setRenderedValue(previewValue);\n setFloatingAutocompleteText(null);\n setAutocompleteRange(\n previewValue.length > autocompleteStart\n ? {\n start: autocompleteStart,\n end: previewValue.length\n }\n : null\n );\n return;\n }\n\n if (shouldShowFloatingCollectionAutocomplete) {\n renderedValueRef.current = filterTextRef.current;\n setRenderedValue(filterTextRef.current);\n setFloatingAutocompleteText(currentItemText);\n setAutocompleteRange(null);\n return;\n }\n\n const nextRenderedValue =\n shouldRenderCurrentItemText && currentItemText !== undefined\n ? currentItemText\n : filterTextRef.current;\n\n renderedValueRef.current = nextRenderedValue;\n setRenderedValue(nextRenderedValue);\n setFloatingAutocompleteText(null);\n setAutocompleteRange(null);\n }, [\n currentRowKeyOverride,\n buildAutocompletePreviewValue,\n getRenderedItemText,\n hasSuggestionsDropdown,\n isAutocompletePreviewOn,\n isCollectionMode,\n isDropdownOpen,\n collectionItemContexts,\n suggestionContextMap\n ]);\n\n // Keep the keyboard-focused option visible while navigating the popup.\n useEffect(() => {\n const activeOption = optionRefs.current[keyboardFocusedSuggestionIndex];\n activeOption?.scrollIntoView({ block: 'nearest' });\n }, [keyboardFocusedSuggestionIndex]);\n\n // Mirror the autocomplete preview range onto the native input selection.\n useLayoutEffect(() => {\n if (!autocompleteRange) {\n return;\n }\n\n const inputElement = inputRef.current;\n\n if (!inputElement) {\n return;\n }\n\n inputElement.setSelectionRange(autocompleteRange.start, autocompleteRange.end);\n }, [autocompleteRange, renderedValue]);\n\n // Arrow-key acceptance keeps the full autocompleted value and then collapses the\n // selection to the requested caret position once the raw filter text has caught up.\n useLayoutEffect(() => {\n const pendingAcceptedCaretPosition = pendingAcceptedCaretPositionRef.current;\n\n if (pendingAcceptedCaretPosition === null) {\n return;\n }\n\n const inputElement = inputRef.current;\n\n if (!inputElement) {\n return;\n }\n\n inputElement.setSelectionRange(pendingAcceptedCaretPosition, pendingAcceptedCaretPosition);\n pendingAcceptedCaretPositionRef.current = null;\n }, [filterText, renderedValue]);\n\n // Once new suggestions arrive for a typed query, decide whether to preview the first\n // starts-with match inline or fall back to the raw typed filter text.\n useEffect(() => {\n if (\n !hasSuggestions ||\n isCollectionMode ||\n !pendingTypeaheadSyncRef.current ||\n !isDropdownOpen ||\n isSuggestionsLoading\n ) {\n return;\n }\n\n pendingTypeaheadSyncRef.current = false;\n const pendingTypeaheadAcceptedCaretPosition = pendingTypeaheadAcceptedCaretPositionRef.current;\n pendingTypeaheadAcceptedCaretPositionRef.current = null;\n\n const firstSuggestion = suggestionItems[0];\n const normalizedFilterText = filterTextRef.current.toLowerCase();\n const firstSuggestionLabel = firstSuggestion ? getRenderedItemText(firstSuggestion, 0) : '';\n const firstSuggestionMatchesQuery = firstSuggestion\n ? doesSuggestionMatchQuery(firstSuggestion, 0, filterTextRef.current)\n : false;\n const hasTypedFilterText = filterTextRef.current.length > 0;\n const hasInlineAutocompleteSurface = hasSuggestionsDropdown || hasSuggestionsOverlay;\n const shouldAutocomplete =\n isAutocompleteOn &&\n hasInlineAutocompleteSurface &&\n hasTypedFilterText &&\n !suppressAutocompleteRef.current &&\n firstSuggestionLabel.toLowerCase().startsWith(normalizedFilterText);\n const shouldShowFloatingAutocomplete =\n isAutocompleteOn &&\n hasSuggestionsDropdown &&\n hasTypedFilterText &&\n !suppressAutocompleteRef.current &&\n firstSuggestionMatchesQuery &&\n !shouldAutocomplete;\n const shouldHighlightSuppressedPrefix =\n isAutocompleteOn &&\n hasTypedFilterText &&\n suppressAutocompleteRef.current &&\n shouldHighlightSuppressedPrefixRef.current &&\n firstSuggestionLabel.toLowerCase().startsWith(normalizedFilterText);\n\n if (\n firstSuggestion &&\n hasTypedFilterText &&\n isAutocompleteOn &&\n (shouldAutocomplete || shouldShowFloatingAutocomplete || shouldHighlightSuppressedPrefix)\n ) {\n setKeyboardFocusedSuggestionIndex(0);\n setShowKeyboardFocusIndicator(false);\n setInteractionMode('keyboard');\n\n if (shouldAutocomplete) {\n if (pendingTypeaheadAcceptedCaretPosition !== null) {\n const previewValue = buildAutocompletePreviewValue(firstSuggestionLabel);\n updateRenderedValue(previewValue);\n setFloatingAutocompleteText(null);\n setAutocompleteRange(null);\n\n queueMicrotask(() => {\n const inputElement = inputRef.current;\n\n if (inputElement && document.activeElement === inputElement) {\n inputElement.setSelectionRange(\n pendingTypeaheadAcceptedCaretPosition,\n pendingTypeaheadAcceptedCaretPosition\n );\n }\n });\n return;\n }\n\n applyKeyboardFocusPreview(firstSuggestion, 0, { autocomplete: true });\n return;\n }\n\n if (shouldShowFloatingAutocomplete) {\n applyKeyboardFocusPreview(firstSuggestion, 0, { floating: true });\n return;\n }\n\n if (shouldHighlightSuppressedPrefix) {\n updateRenderedValue(filterTextRef.current, { notifyDisplayValueChanged: true });\n setFloatingAutocompleteText(null);\n setAutocompleteRange(null);\n return;\n }\n\n updateRenderedValue(filterTextRef.current, { notifyDisplayValueChanged: true });\n setFloatingAutocompleteText(null);\n setAutocompleteRange(null);\n return;\n }\n\n if (\n firstSuggestion &&\n hasTypedFilterText &&\n isAutocompleteOn &&\n hasSuggestionsDropdown &&\n suppressAutocompleteRef.current &&\n shouldHighlightSuppressedPrefixRef.current &&\n firstSuggestionMatchesQuery\n ) {\n setKeyboardFocusedSuggestionIndex(0);\n setInteractionMode('keyboard');\n updateRenderedValue(filterTextRef.current, { notifyDisplayValueChanged: true });\n setFloatingAutocompleteText(null);\n setAutocompleteRange(null);\n return;\n }\n\n if (\n firstSuggestion &&\n hasTypedFilterText &&\n isAutocompleteOn &&\n hasSuggestionsDropdown &&\n suppressAutocompleteRef.current &&\n shouldHighlightSuppressedPrefixRef.current &&\n suggestionTextContainsQuery(firstSuggestionLabel, filterTextRef.current)\n ) {\n setKeyboardFocusedSuggestionIndex(0);\n setInteractionMode('keyboard');\n renderedValueRef.current = filterTextRef.current;\n setRenderedValue(filterTextRef.current);\n setFloatingAutocompleteText(null);\n setAutocompleteRange(null);\n return;\n }\n\n setKeyboardFocusedSuggestionIndex(-1);\n setShowKeyboardFocusIndicator(false);\n setFloatingAutocompleteText(null);\n setAutocompleteRange(null);\n updateRenderedValue(filterTextRef.current, { notifyDisplayValueChanged: true });\n }, [\n applyKeyboardFocusPreview,\n buildAutocompletePreviewValue,\n doesSuggestionMatchQuery,\n getRenderedItemText,\n hasSuggestions,\n hasSuggestionsDropdown,\n hasSuggestionsOverlay,\n isAutocompleteOn,\n isCollectionMode,\n isDropdownOpen,\n isSuggestionsLoading,\n suggestionItems,\n updateRenderedValue\n ]);\n\n // Previewing a suggestion updates only the rendered field text and optional selection\n // range; callers still own keyboard focus movement and any eventual commit behavior.\n const previewSuggestion = useCallback(\n (\n suggestion: T | undefined,\n index: number,\n options?: { autocomplete?: boolean; floating?: boolean }\n ) => {\n if (!suggestion) {\n return;\n }\n\n applyKeyboardFocusPreview(suggestion, index, options);\n },\n [applyKeyboardFocusPreview]\n );\n\n // Arrow navigation owns the keyboard-focused index and decides when the first\n // suggestion should also be previewed as inline autocomplete or floating partial-match text.\n const moveKeyboardFocus = useCallback(\n (direction: SuggestionNavigationDirection) => {\n pendingTypeaheadSyncRef.current = false;\n commitRawValueOnEnterRef.current = false;\n openDropdown();\n setHoveredSuggestionIndex(-1);\n setInteractionMode('keyboard');\n setFloatingAutocompleteText(null);\n setAutocompleteRange(null);\n\n if (suggestionItems.length === 0) {\n return;\n }\n\n setKeyboardFocusedSuggestionIndex((prev) => {\n const nextIndex =\n direction === 'next'\n ? prev < suggestionItems.length - 1\n ? prev + 1\n : suggestionItems.length - 1\n : prev === -1\n ? suggestionItems.length - 1\n : Math.max(prev - 1, 0);\n const nextSuggestion = suggestionItems[nextIndex];\n const nextSuggestionLabel = nextSuggestion\n ? getRenderedItemText(nextSuggestion, nextIndex)\n : '';\n const shouldAutocomplete =\n isAutocompleteOn &&\n (hasSuggestionsDropdown || hasSuggestionsOverlay) &&\n nextIndex === 0 &&\n filterTextRef.current.length > 0 &&\n nextSuggestionLabel.toLowerCase().startsWith(filterTextRef.current.toLowerCase());\n const shouldShowFloatingAutocomplete =\n isAutocompleteOn &&\n hasSuggestionsDropdown &&\n nextIndex === 0 &&\n filterTextRef.current.length > 0 &&\n !!nextSuggestion &&\n doesSuggestionMatchQuery(nextSuggestion, nextIndex, filterTextRef.current) &&\n !shouldAutocomplete;\n\n previewSuggestion(nextSuggestion, nextIndex, {\n autocomplete: shouldAutocomplete,\n floating: shouldShowFloatingAutocomplete\n });\n return nextIndex;\n });\n setShowKeyboardFocusIndicator(true);\n },\n [\n getRenderedItemText,\n doesSuggestionMatchQuery,\n hasSuggestionsDropdown,\n hasSuggestionsOverlay,\n isAutocompleteOn,\n openDropdown,\n previewSuggestion,\n suggestionItems\n ]\n );\n\n const moveCollectionCurrentRow = useCallback(\n (direction: SuggestionNavigationDirection) => {\n pendingTypeaheadSyncRef.current = false;\n if (!isDropdownOpenRef.current) {\n openDropdown();\n }\n setHoveredSuggestionIndex(-1);\n setInteractionMode('keyboard');\n setFloatingAutocompleteText(null);\n setAutocompleteRange(null);\n collectionFocusRetryCountRef.current = 0;\n\n if (collectionItemContexts.length === 0) {\n return;\n }\n\n // Navigation skips suggestions without stable keys because collection current-row state is\n // key-based.\n const currentIndex =\n currentRowKeyOverride === undefined\n ? -1\n : // Reuse the keyed index map instead of walking the whole collection on every arrow key.\n collectionItemIndexMap.get(currentRowKeyOverride) ?? -1;\n const isNavigatingFromLauncherWithPreviewedRow =\n currentIndex !== -1 &&\n filterTextRef.current.length > 0 &&\n !hasCollectionFocusSinceOpenRef.current &&\n document.activeElement === inputRef.current;\n const nextIndex = isNavigatingFromLauncherWithPreviewedRow\n ? currentIndex\n : direction === 'next'\n ? Math.min(currentIndex + 1, collectionItemContexts.length - 1)\n : currentIndex === -1\n ? collectionItemContexts.length - 1\n : Math.max(currentIndex - 1, 0);\n\n if (isNavigatingFromLauncherWithPreviewedRow) {\n hasCollectionFocusSinceOpenRef.current = true;\n }\n\n const previousKey = currentRowKeyOverrideRef.current;\n const nextKey = collectionItemContexts[nextIndex]?.key;\n currentRowKeyOverrideRef.current = nextKey;\n setCurrentRowKeyOverride(nextKey);\n\n if (nextKey === previousKey) {\n setCollectionFocusRequest((prev) => prev + 1);\n }\n },\n [collectionItemContexts, collectionItemIndexMap, currentRowKeyOverride, openDropdown]\n );\n\n // Explicit launcher activation opens suggestions. Desktop uses this instead of focus so\n // keyboard Tab can land on the field without immediately fetching or showing suggestions.\n const openSuggestions = useCallback(() => {\n pendingTypeaheadSyncRef.current = false;\n pendingCollectionInputOpenRef.current = false;\n\n if (hasSuggestionsDropdown) {\n if (isCollectionMode) {\n saveInputCaretRange();\n }\n openDropdown();\n setHoveredSuggestionIndex(-1);\n setInteractionMode(undefined);\n } else if (hasSuggestionsOverlay) {\n openDropdown();\n resetSuggestionFocusState();\n }\n }, [\n hasSuggestionsDropdown,\n hasSuggestionsOverlay,\n isCollectionMode,\n openDropdown,\n resetSuggestionFocusState,\n saveInputCaretRange\n ]);\n\n useEffect(() => {\n if (\n !pendingCollectionInputOpenRef.current ||\n !isCollectionMode ||\n isDropdownOpen ||\n (!hasSuggestionsDropdown && !hasSuggestionsOverlay)\n ) {\n return;\n }\n\n pendingCollectionInputOpenRef.current = false;\n\n if (document.activeElement !== inputRef.current) {\n return;\n }\n\n openSuggestions();\n }, [\n hasSuggestionsDropdown,\n hasSuggestionsOverlay,\n isCollectionMode,\n isDropdownOpen,\n openSuggestions\n ]);\n\n // Open the popup on input and track the latest typed value.\n const handleInput = useCallback(\n (detail: ValueUpdateDetail<string>) => {\n const nativeInputValue = detail.value ?? '';\n const previousFilterText = filterTextRef.current;\n const previousRenderedValue = renderedValueRef.current;\n const selectedAutocompleteRange = autocompleteRange;\n const nextValue =\n selectedAutocompleteRange &&\n nativeInputValue.startsWith(previousRenderedValue) &&\n nativeInputValue.length > previousRenderedValue.length\n ? previousFilterText + nativeInputValue.slice(previousRenderedValue.length)\n : nativeInputValue;\n const hasAutocompletePreview =\n autocompleteRange !== null && autocompleteRange.end > autocompleteRange.start;\n pendingControlledRestoreValueRef.current = null;\n const isShorteningPrefixEdit =\n nextValue.length < previousFilterText.length &&\n previousFilterText.toLowerCase().startsWith(nextValue.toLowerCase());\n const shouldSuppressAutocomplete = hasAutocompletePreview\n ? nextValue === previousFilterText\n : isShorteningPrefixEdit && floatingAutocompleteText === null;\n const isEditingAcceptedAutocompleteValue =\n acceptedAutocompleteValueRef.current !== null &&\n previousFilterText === acceptedAutocompleteValueRef.current &&\n nextValue !== acceptedAutocompleteValueRef.current;\n const isContinuingSuppressedPrefixEdit =\n commitRawValueOnEnterRef.current && !hasAutocompletePreview && isShorteningPrefixEdit;\n const shouldKeepRawCommitAfterSuppressedEdit =\n commitRawValueOnEnterRef.current && shouldSuppressAutocomplete;\n // The first Delete/Backspace dismisses the inline preview without a native input edit. Once\n // the user shortens that raw prefix again, restore the matching visual highlight while\n // keeping raw Enter commit authoritative over the highlighted suggestion.\n const shouldHighlightSuppressedPrefix =\n !isEditingAcceptedAutocompleteValue &&\n !isPhoneDevice &&\n (!shouldKeepRawCommitAfterSuppressedEdit || isContinuingSuppressedPrefixEdit);\n\n if (nextValue !== acceptedAutocompleteValueRef.current) {\n acceptedAutocompleteValueRef.current = null;\n }\n commitRawValueOnEnterRef.current = shouldKeepRawCommitAfterSuppressedEdit;\n\n if (isControlled) {\n const previousCommitValue =\n pendingControlledInputRef.current?.previousCommitValue ?? currentCommitValueRef.current;\n const inputCaretPosition = inputRef.current?.selectionStart ?? null;\n const caretPosition =\n inputCaretPosition !== null && inputCaretPosition !== nextValue.length\n ? inputCaretPosition\n : undefined;\n\n pendingControlledInputRef.current = {\n caretPosition,\n previousCommitValue,\n shouldHighlightSuppressedPrefix,\n shouldSuppressAutocomplete,\n value: nextValue\n };\n currentCommitValueRef.current = lastPropValueRef.current;\n pendingTypeaheadSyncRef.current = false;\n onInput?.({\n ...detail,\n value: nextValue\n });\n\n if (inputRef.current) {\n inputRef.current.value = renderedValueRef.current;\n }\n return;\n }\n\n applyInputValue(nextValue, shouldSuppressAutocomplete, { shouldHighlightSuppressedPrefix });\n onInput?.({\n ...detail,\n value: nextValue\n });\n },\n [\n applyInputValue,\n autocompleteRange,\n floatingAutocompleteText,\n isControlled,\n isPhoneDevice,\n onInput\n ]\n );\n\n // InputSearchBase emits only the submitted value for commit events, so\n // derive previousValue from the tracked controlled refs here.\n const commitValue = useCallback(\n (committedValue: string, itemContext?: InputSearchCommitDetail<T>['itemContext']) => {\n const nextCommittedValue =\n isControlled && itemContext === undefined && pendingControlledInputRef.current !== null\n ? lastPropValueRef.current\n : committedValue;\n const previousCommitValue = currentCommitValueRef.current;\n const committedKey = itemContext && 'key' in itemContext ? itemContext.key : undefined;\n\n pendingControlledInputRef.current = null;\n pendingControlledRestoreValueRef.current = null;\n pendingTypeaheadSyncRef.current = false;\n pendingCollectionInputOpenRef.current = false;\n acceptedAutocompleteValueRef.current = null;\n commitRawValueOnEnterRef.current = false;\n if (isControlled && itemContext !== undefined) {\n pendingControlledCollectionCommitValueRef.current = nextCommittedValue;\n pendingControlledCollectionCommitPreviousValueRef.current = lastPropValueRef.current;\n }\n filterTextRef.current = nextCommittedValue;\n renderedValueRef.current = nextCommittedValue;\n currentCommitValueRef.current = nextCommittedValue;\n overlayDismissRestoreValueRef.current = nextCommittedValue;\n setCommittedRowKey(committedKey);\n currentRowKeyOverrideRef.current = undefined;\n setCurrentRowKeyOverride(undefined);\n setFilterText(nextCommittedValue);\n setRenderedValue(nextCommittedValue);\n setFloatingAutocompleteText(null);\n setAutocompleteRange(null);\n suppressAutocompleteRef.current = false;\n shouldHighlightSuppressedPrefixRef.current = true;\n\n onCommit?.(\n itemContext\n ? {\n itemContext,\n previousValue: previousCommitValue,\n value: nextCommittedValue\n }\n : {\n previousValue: previousCommitValue,\n value: nextCommittedValue\n }\n );\n },\n [isControlled, onCommit]\n );\n\n const handleOverlayDismiss = useCallback(() => {\n const restoredValue = overlayDismissRestoreValueRef.current;\n const previousValue = filterTextRef.current;\n\n pendingTypeaheadSyncRef.current = false;\n pendingControlledRestoreValueRef.current = propValue !== undefined ? restoredValue : null;\n acceptedAutocompleteValueRef.current = null;\n commitRawValueOnEnterRef.current = false;\n filterTextRef.current = restoredValue;\n renderedValueRef.current = restoredValue;\n setFilterText(restoredValue);\n setRenderedValue(restoredValue);\n setFloatingAutocompleteText(null);\n setAutocompleteRange(null);\n setLastAnnouncedEmptyQuery('');\n suppressAutocompleteRef.current = false;\n shouldHighlightSuppressedPrefixRef.current = true;\n closeDropdown();\n\n if (previousValue !== restoredValue) {\n onInput?.({ previousValue, value: restoredValue });\n }\n }, [closeDropdown, onInput, propValue]);\n\n const handleOverlayCommit = useCallback(\n (committedValue: string) => {\n commitValue(committedValue);\n closeDropdown({ preserveDisplayValue: true });\n },\n [closeDropdown, commitValue]\n );\n\n // Collection templates can expose focus targets in light DOM or inside nested JET shadow roots.\n const getCollectionFocusTargets = useCallback(() => {\n const collectionContainer = collectionContainerRef.current;\n\n if (!collectionContainer) {\n return [];\n }\n\n const cachedFocusTargets = collectionFocusTargetsRef.current.filter((focusTarget) =>\n isValidCollectionElement(focusTarget, collectionContainer)\n );\n\n if (cachedFocusTargets.length > 0) {\n return cachedFocusTargets;\n }\n\n // Collection renderers can hide focusable targets inside shadow roots, so refresh lazily\n // only after the previous cache becomes stale.\n const focusTargets: HTMLElement[] = [];\n const seenFocusTargets = new Set<HTMLElement>();\n\n collectionFocusTargetSelectors.forEach((selector) => {\n querySelectorAllDeep(collectionContainer, selector).forEach((element) => {\n if (!seenFocusTargets.has(element)) {\n seenFocusTargets.add(element);\n focusTargets.push(element);\n }\n });\n });\n\n collectionFocusTargetsRef.current = focusTargets;\n return focusTargets;\n }, []);\n\n // Locate the DOM row for the current key so keyboard navigation keeps it in view.\n const getCollectionScrollTarget = useCallback(\n (key: InputSearchCollectionItemContext<T>['key']) => {\n const collectionContainer = collectionContainerRef.current;\n\n if (!collectionContainer || key === undefined) {\n return null;\n }\n\n const typedKeyLookup = getTypedCollectionKeyLookup(key);\n const cachedScrollTarget = collectionScrollTargetCacheRef.current.get(typedKeyLookup);\n\n if (isValidCollectionElement(cachedScrollTarget, collectionContainer)) {\n return cachedScrollTarget;\n }\n\n if (cachedScrollTarget) {\n collectionScrollTargetCacheRef.current.delete(typedKeyLookup);\n }\n\n // Fall back to a deep scan only when the keyed element cache misses or the DOM was recreated.\n const keyElements = querySelectorAllDeep(collectionContainer, collectionKeyElementSelector);\n const scrollTarget =\n keyElements.find((element) => isTypedCollectionKeyMatch(element, key)) ??\n keyElements.find((element) => isLegacyCollectionKeyMatch(element, key)) ??\n null;\n\n if (scrollTarget) {\n collectionScrollTargetCacheRef.current.set(typedKeyLookup, scrollTarget);\n }\n\n return scrollTarget;\n },\n []\n );\n\n // Restore launcher focus after collection interactions while preserving the typed caret when asked.\n const restoreInputFocus = useCallback((options?: { restoreCaret?: boolean }) => {\n const inputElement = inputRef.current;\n\n if (!inputElement) {\n return;\n }\n\n inputElement.focus();\n\n if (options?.restoreCaret) {\n const savedRange = savedCaretRangeRef.current;\n\n inputElement.setSelectionRange(\n savedRange?.start ?? filterTextRef.current.length,\n savedRange?.end ?? savedRange?.start ?? filterTextRef.current.length\n );\n return;\n }\n\n inputElement.setSelectionRange(filterTextRef.current.length, filterTextRef.current.length);\n }, []);\n\n // Move focus from the text field into the rendered collection body after ArrowUp/ArrowDown.\n const focusCollection = useCallback(() => {\n saveInputCaretRange();\n\n const focusTargets = getCollectionFocusTargets();\n\n if (focusTargets.length === 0) {\n return false;\n }\n\n const didFocusCollection = focusTargets.some((focusTarget) => {\n focusTarget.focus();\n const activeElement = getDeepActiveElement();\n const isCompletingFocusTarget =\n focusTarget.tabIndex >= 0 ||\n focusTarget.getAttribute('data-oj-input-search-focus-target') === 'true';\n const didFocus =\n isCompletingFocusTarget &&\n (activeElement === focusTarget || isElementWithinTarget(activeElement, focusTarget));\n\n if (didFocus) {\n hasCollectionFocusSinceOpenRef.current = true;\n }\n\n return didFocus;\n });\n\n if (!didFocusCollection) {\n collectionFocusTargetsRef.current = [];\n }\n\n return didFocusCollection;\n }, [getCollectionFocusTargets, saveInputCaretRange]);\n\n // Match Select's Shift+Tab boundary behavior by checking whether focus is currently on the\n // first tabbable collection descendant. Internal collection tab navigation should keep working.\n const isShiftTabLeavingCollectionBoundary = useCallback(() => {\n const collectionContainer = collectionContainerRef.current;\n if (!collectionContainer) {\n return false;\n }\n\n const tabbableElements = querySelectorAllDeep(\n collectionContainer,\n collectionTabbableSelector\n ).filter(isVisibleCollectionTabbable);\n\n if (tabbableElements.length === 0) {\n return false;\n }\n\n const firstTabbable = tabbableElements[0];\n const shallowActiveElement = document.activeElement;\n const deepActiveElement = getDeepActiveElement();\n\n return shallowActiveElement === firstTabbable || deepActiveElement === firstTabbable;\n }, [collectionContainerRef]);\n\n // Remove the popup immediately once keyboard focus is leaving it so the browser computes the\n // next tab stop relative to the input launcher instead of a stale collection cell.\n const removeDropdownElement = useCallback(() => {\n dropdownRef.current?.parentElement?.removeChild(dropdownRef.current);\n }, []);\n\n const handlePersistCurrentRowKey = useCallback(\n ({ value }: { value?: InputSearchCollectionItemContext<T>['key'] }) => {\n if (!isDropdownOpenRef.current) {\n return;\n }\n\n currentRowKeyOverrideRef.current = value;\n setCurrentRowKeyOverride(value);\n },\n []\n );\n\n // Explicit row actions commit the row text and keep the committed key selected on reopen.\n const handleCollectionRowAction = useCallback(\n ({ context }: { context: InputSearchCollectionItemContext<T> }) => {\n if (collectionTapActionTimerRef.current !== undefined) {\n window.clearTimeout(collectionTapActionTimerRef.current);\n collectionTapActionTimerRef.current = undefined;\n }\n\n const committedText = getRenderedItemText(context.data, context.index);\n\n commitValue(committedText, context);\n closeDropdown({ preserveDisplayValue: true });\n },\n [closeDropdown, commitValue, getRenderedItemText]\n );\n\n // Resolve a tapped collection element back to the normalized suggestion item context.\n const getCollectionItemContextFromElement = useCallback(\n (element: Element) => {\n const collectionContainer = collectionContainerRef.current;\n const keyElement = element.closest<HTMLElement>('[data-oj-input-search-key], [data-oj-key]');\n\n if (!collectionContainer || !keyElement || !collectionContainer.contains(keyElement)) {\n return undefined;\n }\n\n const keyAttribute =\n keyElement.getAttribute('data-oj-input-search-key') ??\n keyElement.getAttribute('data-oj-key');\n const keyTypeAttribute =\n keyElement.getAttribute('data-oj-input-search-key-type') ??\n keyElement.getAttribute('data-oj-key-type');\n\n if (keyAttribute === null) {\n return undefined;\n }\n\n if (keyTypeAttribute === 'number' || keyTypeAttribute === 'string') {\n return collectionTypedKeyMap.get(\n getTypedCollectionKeyLookup(keyAttribute, keyTypeAttribute)\n );\n }\n\n // Older/custom rows may omit key-type markers, so keep a legacy string lookup as a fallback.\n return (\n collectionTypedKeyMap.get(getTypedCollectionKeyLookup(keyAttribute, 'string')) ??\n collectionLegacyKeyMap.get(keyAttribute)\n );\n },\n [collectionLegacyKeyMap, collectionTypedKeyMap]\n );\n\n // Capture real collection row clicks so rendered list/table rows commit consistently.\n const handleCollectionClickCapture = useCallback(\n (event: MouseEvent) => {\n if (!isCollectionMode || !isDropdownOpen || event.defaultPrevented) {\n return;\n }\n\n const target = event.target;\n\n if (!(target instanceof Element) || !collectionContainerRef.current?.contains(target)) {\n return;\n }\n\n const actionableElement = target.closest(\n '[role=\"gridcell\"], [role=\"cell\"], [role=\"option\"], [role=\"listitem\"], [role=\"row\"]'\n );\n\n if (!actionableElement || !collectionContainerRef.current.contains(actionableElement)) {\n return;\n }\n\n const interactiveDescendant = target.closest(interactiveCollectionDescendantSelector);\n\n if (\n interactiveDescendant &&\n interactiveDescendant !== actionableElement &&\n actionableElement.contains(interactiveDescendant)\n ) {\n return;\n }\n\n if (collectionTapActionTimerRef.current !== undefined) {\n window.clearTimeout(collectionTapActionTimerRef.current);\n }\n\n const tappedItemContext = getCollectionItemContextFromElement(actionableElement);\n\n collectionTapActionTimerRef.current = window.setTimeout(() => {\n collectionTapActionTimerRef.current = undefined;\n\n if (event.defaultPrevented) {\n return;\n }\n\n const currentItemContext =\n currentRowKeyOverrideRef.current === undefined\n ? undefined\n : suggestionContextMap.get(currentRowKeyOverrideRef.current);\n const itemContext = tappedItemContext ?? currentItemContext;\n\n if (itemContext) {\n handleCollectionRowAction({ context: itemContext });\n }\n }, 0);\n },\n [\n getCollectionItemContextFromElement,\n handleCollectionRowAction,\n isCollectionMode,\n isDropdownOpen,\n suggestionContextMap\n ]\n );\n\n // Escape closes collection mode from inside the rendered collection. Enter commits the current\n // row when focus is inside the collection. Shift+Tab restores the raw typed text before focus\n // leaves the collection so blur writeback does not commit the preview row.\n const handleCollectionKeyDownCapture = useCallback(\n (event: KeyboardEvent) => {\n if (event.key === 'Enter' && !event.repeat) {\n const target = event.target;\n const collectionContainer = collectionContainerRef.current;\n\n if (\n !isCollectionMode ||\n !isDropdownOpen ||\n event.defaultPrevented ||\n !(target instanceof Element) ||\n !isElementWithinTarget(target, collectionContainer)\n ) {\n return;\n }\n\n const interactiveDescendant = target.closest(interactiveCollectionDescendantSelector);\n\n if (\n interactiveDescendant &&\n isElementWithinTarget(interactiveDescendant, collectionContainer)\n ) {\n return;\n }\n\n const currentItemContext =\n currentRowKeyOverrideRef.current === undefined\n ? undefined\n : suggestionContextMap.get(currentRowKeyOverrideRef.current);\n const itemContext = currentItemContext ?? getCollectionItemContextFromElement(target);\n\n if (itemContext) {\n event.preventDefault();\n event.stopPropagation();\n handleCollectionRowAction({ context: itemContext });\n }\n\n return;\n }\n\n if (event.key === 'Tab' && event.shiftKey) {\n if (hasSuggestionsDropdown && isShiftTabLeavingCollectionBoundary()) {\n restoreCollectionInputValue();\n restoreInputFocus({ restoreCaret: true });\n blurCollectionAndClose();\n removeDropdownElement();\n return;\n }\n\n shouldRestoreCollectionInputValueOnFocusRef.current = true;\n return;\n }\n\n if (event.key !== 'Escape') {\n return;\n }\n\n event.preventDefault();\n shouldFocusCollectionRef.current = false;\n shouldRestoreCollectionInputValueOnFocusRef.current = false;\n closeDropdown();\n },\n [\n blurCollectionAndClose,\n closeDropdown,\n getCollectionItemContextFromElement,\n handleCollectionRowAction,\n hasSuggestionsDropdown,\n isCollectionMode,\n isDropdownOpen,\n isShiftTabLeavingCollectionBoundary,\n removeDropdownElement,\n restoreCollectionInputValue,\n restoreInputFocus,\n suggestionContextMap\n ]\n );\n\n // Desktop/mobile Enter handling can use this to commit the active collection row.\n const commitCurrentCollectionSelection = useCallback(() => {\n if (!isDropdownOpen || currentRowKeyOverride === undefined) {\n return false;\n }\n\n const itemContext = suggestionContextMap.get(currentRowKeyOverride);\n\n if (!itemContext) {\n return false;\n }\n\n handleCollectionRowAction({ context: itemContext });\n return true;\n }, [currentRowKeyOverride, handleCollectionRowAction, isDropdownOpen, suggestionContextMap]);\n\n // Collapse the desktop popup when no suggestions remain after loading completes.\n useEffect(() => {\n if (\n hasSuggestionsDropdown &&\n isDropdownOpen &&\n !isSuggestionsLoading &&\n suggestionItems.length === 0\n ) {\n closeDropdown();\n }\n }, [\n closeDropdown,\n hasSuggestionsDropdown,\n isDropdownOpen,\n isSuggestionsLoading,\n suggestionItems.length\n ]);\n\n // Announce empty results only once per typed query while the popup stays open.\n useEffect(() => {\n // trim the input value to avoid announcing empty results for queries that are only whitespace.\n const currentQuery = filterTextRef.current.trim();\n const shouldAnnounceEmptyResults =\n hasSuggestions &&\n isDropdownOpen &&\n !isSuggestionsLoading &&\n suggestionItems.length === 0 &&\n currentQuery !== '' &&\n lastAnnouncedEmptyQuery !== currentQuery;\n\n if (shouldAnnounceEmptyResults) {\n setLastAnnouncedEmptyQuery(currentQuery);\n }\n }, [\n hasSuggestions,\n isDropdownOpen,\n isSuggestionsLoading,\n lastAnnouncedEmptyQuery,\n suggestionItems.length\n ]);\n\n const currentQuery = filterText.trim();\n const shouldAnnounceNoMatches =\n hasSuggestions &&\n !isSuggestionsLoading &&\n currentQuery !== '' &&\n suggestionItems.length === 0 &&\n lastAnnouncedEmptyQuery === currentQuery;\n const shouldAnnounceResults =\n hasSuggestions &&\n !isSuggestionsLoading &&\n currentQuery !== '' &&\n suggestionItems.length > 0 &&\n isDropdownOpen;\n\n // Phone keeps its full-screen suggestions flow attached to focus because opening the overlay\n // moves focus into a separate modal field. Desktop launcher focus alone should not open.\n const handleFocus = useCallback(() => {\n if (hasSuggestionsOverlay) {\n openSuggestions();\n }\n }, [hasSuggestionsOverlay, openSuggestions]);\n\n // Commit a suggestion label as the next submitted value. Pointer-based selection\n // restores focus to the input so keyboard interaction can continue immediately.\n const handleSuggestionSelection = useCallback(\n (suggestion: T, index: number, options?: { restoreFocus?: boolean }) => {\n const itemContext = isCollectionMode\n ? getSuggestionItemContext(suggestion, index)\n : { data: suggestion, index };\n commitValue(getRenderedItemText(suggestion, index), itemContext);\n closeDropdown({ preserveDisplayValue: true });\n\n if (options?.restoreFocus) {\n inputRef.current?.focus();\n }\n },\n [closeDropdown, commitValue, getRenderedItemText, getSuggestionItemContext, isCollectionMode]\n );\n\n // Pointer hover affects visuals, but keyboard focus remains authoritative for aria-activedescendant.\n const handleHoverIndexChange = useCallback((index: number) => {\n setHoveredSuggestionIndex(index);\n setInteractionMode('pointer');\n }, []);\n\n // Clearing from the mobile overlay behaves like a fresh input event: reset the\n // query and announcement state, keep the overlay open, and refocus the field.\n const handleOverlayClear = useCallback(() => {\n const previousValue = filterTextRef.current;\n\n pendingTypeaheadSyncRef.current = false;\n suppressAutocompleteRef.current = false;\n acceptedAutocompleteValueRef.current = null;\n commitRawValueOnEnterRef.current = false;\n shouldHighlightSuppressedPrefixRef.current = true;\n // Back should preserve an explicit mobile clear instead of restoring the prior commit.\n overlayDismissRestoreValueRef.current = '';\n setLastAnnouncedEmptyQuery('');\n filterTextRef.current = '';\n renderedValueRef.current = '';\n setFilterText('');\n setRenderedValue('');\n setFloatingAutocompleteText(null);\n setAutocompleteRange(null);\n clearCollectionCurrentRow();\n openDropdown();\n resetSuggestionFocusState();\n onInput?.({ previousValue, value: '' });\n inputRef.current?.focus();\n }, [clearCollectionCurrentRow, onInput, openDropdown, resetSuggestionFocusState]);\n\n const handlePointerLeave = useCallback(() => {\n setHoveredSuggestionIndex(-1);\n setInteractionMode(keyboardFocusedSuggestionIndex >= 0 ? 'keyboard' : undefined);\n }, [keyboardFocusedSuggestionIndex]);\n\n // Deleting the selected suffix of an inline autocomplete preview follows legacy\n // ojinputsearch behavior: keep the typed prefix, clear the highlighted option,\n // and let the next Enter commit the raw prefix instead of selecting the suggestion.\n const dismissAutocompletePreview = useCallback(() => {\n pendingTypeaheadSyncRef.current = false;\n suppressAutocompleteRef.current = true;\n acceptedAutocompleteValueRef.current = null;\n commitRawValueOnEnterRef.current = true;\n shouldHighlightSuppressedPrefixRef.current = false;\n resetAutocomplete(filterTextRef.current);\n restoreCaretToRawPrefixEnd();\n setHoveredSuggestionIndex(-1);\n setKeyboardFocusedSuggestionIndex(-1);\n setShowKeyboardFocusIndicator(false);\n setInteractionMode(undefined);\n }, [resetAutocomplete, restoreCaretToRawPrefixEnd]);\n\n const clearFullySelectedValue = useCallback(() => {\n const previousValue = renderedValueRef.current;\n\n pendingControlledRestoreValueRef.current = null;\n pendingTypeaheadSyncRef.current = false;\n acceptedAutocompleteValueRef.current = null;\n commitRawValueOnEnterRef.current = false;\n shouldHighlightSuppressedPrefixRef.current = true;\n applyInputValue('', false);\n resetSuggestionFocusState();\n onInput?.({ previousValue, value: '' });\n }, [applyInputValue, onInput, resetSuggestionFocusState]);\n\n // Arrow-key acceptance of an inline starts-with preview should promote the\n // rendered text into the raw filter value so controlled parents stay in sync.\n const acceptAutocompletePreview = useCallback(\n (acceptedValue: string, caretPosition?: number) => {\n const previousValue = filterTextRef.current;\n\n pendingTypeaheadSyncRef.current = hasSuggestions;\n pendingAcceptedCaretPositionRef.current = caretPosition ?? null;\n pendingTypeaheadAcceptedCaretPositionRef.current = caretPosition ?? null;\n acceptedAutocompleteValueRef.current = acceptedValue;\n commitRawValueOnEnterRef.current = false;\n shouldHighlightSuppressedPrefixRef.current = true;\n filterTextRef.current = acceptedValue;\n renderedValueRef.current = acceptedValue;\n setLastAnnouncedEmptyQuery('');\n setFilterText(acceptedValue);\n setRenderedValue(acceptedValue);\n setFloatingAutocompleteText(null);\n setAutocompleteRange(null);\n suppressAutocompleteRef.current = false;\n setHoveredSuggestionIndex(-1);\n setInteractionMode('keyboard');\n onInput?.({ previousValue, value: acceptedValue });\n\n if (caretPosition !== undefined) {\n queueMicrotask(() => {\n const inputElement = inputRef.current;\n\n if (inputElement && document.activeElement === inputElement) {\n inputElement.setSelectionRange(caretPosition, caretPosition);\n }\n });\n }\n },\n [hasSuggestions, onInput]\n );\n\n // Handle popup keyboard navigation and keyboard-based suggestion selection.\n const handleKeyDown = useCallback(\n (event: KeyboardEvent) => {\n if (event.defaultPrevented || !hasSuggestions) {\n return;\n }\n\n const hasAutocompletePreview =\n autocompleteRange !== null && autocompleteRange.end > autocompleteRange.start;\n\n switch (event.key) {\n case 'Tab': {\n if (isCollectionMode && hasSuggestionsDropdown && isDropdownOpen) {\n // Match Select behavior: leave the component from the input on Tab/Shift+Tab instead\n // of tunneling focus into the collection body, while preserving the typed raw value.\n restoreCollectionInputValue();\n blurCollectionAndClose();\n removeDropdownElement();\n }\n break;\n }\n case 'ArrowDown': {\n event.preventDefault();\n if (isCollectionMode) {\n if (hasSuggestionsDropdown && !isDropdownOpen) {\n openSuggestions();\n break;\n }\n shouldFocusCollectionRef.current = true;\n moveCollectionCurrentRow('next');\n break;\n }\n if (hasSuggestionsDropdown && !isDropdownOpen) {\n openSuggestions();\n break;\n }\n moveKeyboardFocus('next');\n break;\n }\n case 'ArrowUp': {\n event.preventDefault();\n if (isCollectionMode) {\n if (hasSuggestionsDropdown && !isDropdownOpen) {\n openSuggestions();\n break;\n }\n shouldFocusCollectionRef.current = true;\n moveCollectionCurrentRow('previous');\n break;\n }\n if (hasSuggestionsDropdown && !isDropdownOpen) {\n openSuggestions();\n break;\n }\n moveKeyboardFocus('previous');\n break;\n }\n case 'Escape': {\n if (isDropdownOpen) {\n event.preventDefault();\n if (isCollectionMode) {\n shouldFocusCollectionRef.current = false;\n restoreInputFocus({ restoreCaret: true });\n }\n closeDropdown();\n }\n break;\n }\n case 'ArrowLeft':\n case 'ArrowRight': {\n if (hasAutocompletePreview && autocompleteRange) {\n event.preventDefault();\n const caretPosition =\n event.key === 'ArrowLeft' ? autocompleteRange.start : renderedValueRef.current.length;\n acceptAutocompletePreview(renderedValueRef.current, caretPosition);\n }\n break;\n }\n case 'Backspace':\n case 'Delete': {\n const inputElement = inputRef.current;\n const selectionStart = inputElement?.selectionStart;\n const selectionEnd = inputElement?.selectionEnd;\n const hasTextSelection =\n selectionStart != null && selectionEnd != null && selectionStart !== selectionEnd;\n const isFullValueSelected =\n hasTextSelection &&\n selectionStart === 0 &&\n selectionEnd === renderedValueRef.current.length;\n\n if (isFullValueSelected) {\n event.preventDefault();\n clearFullySelectedValue();\n } else if (autocompleteRange !== null) {\n event.preventDefault();\n dismissAutocompletePreview();\n }\n break;\n }\n case 'Enter': {\n if (isCollectionMode) {\n break;\n }\n\n if (\n isDropdownOpen &&\n keyboardFocusedSuggestionIndex >= 0 &&\n !commitRawValueOnEnterRef.current\n ) {\n const suggestion = suggestionItems[keyboardFocusedSuggestionIndex];\n if (suggestion) {\n event.preventDefault();\n handleSuggestionSelection(suggestion, keyboardFocusedSuggestionIndex);\n }\n }\n break;\n }\n default:\n break;\n }\n },\n [\n acceptAutocompletePreview,\n blurCollectionAndClose,\n clearFullySelectedValue,\n closeDropdown,\n dismissAutocompletePreview,\n handleSuggestionSelection,\n hasSuggestions,\n hasSuggestionsDropdown,\n autocompleteRange,\n isCollectionMode,\n isDropdownOpen,\n keyboardFocusedSuggestionIndex,\n moveCollectionCurrentRow,\n moveKeyboardFocus,\n openSuggestions,\n removeDropdownElement,\n restoreInputFocus,\n restoreCollectionInputValue,\n suggestionItems\n ]\n );\n\n // Desktop only stays open while there is loading or renderable suggestion content, but\n // phone keeps the overlay open after loading even with zero suggestions so the dialog\n // and search field remain available. The focus effect below relies on that distinction.\n const shouldRenderSuggestions = isDropdownOpen && suggestionItems.length > 0;\n const shouldRenderLoading = isDropdownOpen && isSuggestionsLoading;\n const shouldKeepOverlayOpen = hasSuggestionsOverlay && isDropdownOpen && !isSuggestionsLoading;\n const isPopupOpen = shouldRenderLoading || shouldRenderSuggestions || shouldKeepOverlayOpen;\n const activeDescendantId =\n !isCollectionMode && isPopupOpen && !isSuggestionsLoading && keyboardFocusedSuggestionIndex >= 0\n ? `${dropdownId}-option-${keyboardFocusedSuggestionIndex}`\n : undefined;\n const renderedSuggestions = shouldRenderSuggestions ? suggestionItems : [];\n const loadingSkeletonCount = shouldRenderLoading ? lastRenderedSuggestionCountRef.current : 1;\n // Select only the committed row that still exists in the current suggestion set.\n const selectedKeys = useMemo(() => {\n if (committedRowKey === undefined) {\n return undefined;\n }\n\n if (!isSuggestionsLoading && !suggestionContextMap.has(committedRowKey)) {\n return undefined;\n }\n\n return new Set([committedRowKey]);\n }, [committedRowKey, isSuggestionsLoading, suggestionContextMap]);\n // This context is the contract between InputSearch and arbitrary collection renderers.\n // Keep it memoized so collection components do not see fresh callbacks on every render.\n const collectionRendererContext = useMemo<InputSearchCollectionRendererProps<T>>(\n () => ({\n currentRowKeyOverride,\n getSuggestionKey,\n onPersistCurrentRowKey: handlePersistCurrentRowKey,\n onRowAction: handleCollectionRowAction,\n searchText: filterText === '' ? undefined : filterText,\n selected: selectedKeys,\n suggestions\n }),\n [\n currentRowKeyOverride,\n filterText,\n getSuggestionKey,\n handleCollectionRowAction,\n handlePersistCurrentRowKey,\n selectedKeys,\n suggestions\n ]\n );\n\n // Focus the mobile overlay input during layout so the focus handoff can stay\n // tied to the opening gesture before the browser paints the dialog.\n useLayoutEffect(() => {\n if (\n !hasSuggestionsOverlay ||\n !isPopupOpen ||\n (isCollectionMode && shouldFocusCollectionRef.current)\n ) {\n return;\n }\n\n // Focus immediately after the overlay input mounts so mobile browsers, especially iOS,\n // can keep the focus change tied to the original tap and bring up the virtual keyboard.\n inputRef.current?.focus();\n }, [hasSuggestionsOverlay, isCollectionMode, isPopupOpen]);\n\n // Retry mobile overlay focus after the launcher event completes in case the\n // original tap/click steals focus back from the newly mounted dialog input.\n useEffect(() => {\n if (\n !hasSuggestionsOverlay ||\n !isPopupOpen ||\n (isCollectionMode && shouldFocusCollectionRef.current)\n ) {\n return;\n }\n\n // Defer focus until after the launcher click/tap completes so the mobile\n // overlay input can still reclaim focus if the launcher tap/click steals it back.\n mobileOverlayFocusTimerRef.current = window.setTimeout(() => {\n mobileOverlayFocusTimerRef.current = undefined;\n\n if (document.activeElement !== inputRef.current) {\n inputRef.current?.focus();\n }\n }, 0);\n\n return () => {\n if (mobileOverlayFocusTimerRef.current !== undefined) {\n window.clearTimeout(mobileOverlayFocusTimerRef.current);\n mobileOverlayFocusTimerRef.current = undefined;\n }\n };\n }, [hasSuggestionsOverlay, isCollectionMode, isPopupOpen]);\n\n // Move focus into the collection once ArrowUp/ArrowDown has requested collection focus.\n useEffect(() => {\n if (\n !isCollectionMode ||\n !isPopupOpen ||\n (shouldRenderLoading && collectionItemContexts.length === 0) ||\n !shouldFocusCollectionRef.current\n ) {\n return;\n }\n\n // Keyboard ArrowUp/ArrowDown from the launcher requests focus into the collection. The actual\n // target might not be focusable until after table/list rendering settles, so use the bounded\n // retry window declared above rather than treating the first missing target as a failure.\n if (focusCollection()) {\n shouldFocusCollectionRef.current = false;\n collectionFocusRetryCountRef.current = 0;\n return;\n }\n\n if (collectionFocusRetryCountRef.current >= COLLECTION_FOCUS_RETRY_LIMIT) {\n collectionFocusRetryCountRef.current = 0;\n shouldFocusCollectionRef.current = false;\n return;\n }\n\n if (collectionFocusRetryTimerRef.current === undefined) {\n collectionFocusRetryCountRef.current += 1;\n collectionFocusRetryTimerRef.current = window.setTimeout(() => {\n collectionFocusRetryTimerRef.current = undefined;\n\n if (shouldFocusCollectionRef.current) {\n setCollectionFocusRequest((prev) => prev + 1);\n }\n }, COLLECTION_FOCUS_RETRY_DELAY);\n }\n }, [\n collectionFocusRequest,\n collectionItemContexts.length,\n currentRowKeyOverride,\n focusCollection,\n isCollectionMode,\n isPopupOpen,\n shouldRenderLoading\n ]);\n\n // Scroll the current collection row into view after current-row state changes.\n useEffect(() => {\n if (\n !isCollectionMode ||\n !isPopupOpen ||\n shouldRenderLoading ||\n currentRowKeyOverride === undefined\n ) {\n return;\n }\n\n // Keep the preview/current row visible while keyboard navigation drives collection state.\n getCollectionScrollTarget(currentRowKeyOverride)?.scrollIntoView({ block: 'nearest' });\n }, [\n currentRowKeyOverride,\n getCollectionScrollTarget,\n isCollectionMode,\n isPopupOpen,\n shouldRenderLoading\n ]);\n\n // Clear delayed mobile collection tap commits if the hook unmounts before the timer fires.\n useEffect(() => {\n return () => {\n if (collectionTapActionTimerRef.current !== undefined) {\n window.clearTimeout(collectionTapActionTimerRef.current);\n }\n if (collectionFocusRetryTimerRef.current !== undefined) {\n window.clearTimeout(collectionFocusRetryTimerRef.current);\n }\n };\n }, []);\n\n const shouldCommitRawValueOnEnter = useCallback(() => commitRawValueOnEnterRef.current, []);\n\n return {\n collectionContainerRef,\n collectionRendererContext,\n activeDescendantId,\n closeDropdown,\n commitCurrentCollectionSelection,\n dropdownId,\n dropdownRef,\n handleDropdownAutoDismiss,\n handleOverlayDismiss,\n handleInputBlur,\n handleCommit: commitValue,\n handleCollectionClickCapture,\n handleCollectionFocusOut,\n handleCollectionRowAction,\n handleCollectionKeyDownCapture,\n handleFocus,\n handleHoverIndexChange,\n handleInput,\n handleKeyDown,\n handleOverlayClear,\n handleOverlayCommit,\n handlePointerLeave,\n handleSuggestionSelection,\n hasSuggestionsDropdown,\n hasSuggestionsOverlay,\n isCollectionMode,\n filterText,\n hoveredSuggestionIndex,\n inputRef,\n inputType,\n interactionMode,\n isPopupOpen,\n keyboardFocusedSuggestionIndex,\n showKeyboardFocusIndicator,\n loadingSkeletonCount,\n floatingAutocompleteText,\n optionRefs: optionRefs.current,\n openSuggestions,\n renderedSuggestions,\n renderedValue,\n rootRef,\n shouldAnnounceNoMatches,\n shouldAnnounceResults,\n shouldCommitRawValueOnEnter,\n shouldRenderLoading\n };\n}\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * Licensed under The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport type { ComponentChildren, ComponentProps, Ref } from 'preact';\nimport { forwardRef } from 'preact/compat';\nimport { useCallback, useEffect, useImperativeHandle, useMemo, useRef } from 'preact/hooks';\nimport { useTestId } from '#hooks/UNSAFE_useTestId';\nimport { useTranslationBundle } from '#hooks/UNSAFE_useTranslationBundle';\nimport type { FocusableHandle } from '#hooks/UNSAFE_useFocusableTextField';\nimport type { ValueUpdateDetail } from '#utils/UNSAFE_valueUpdateDetail';\nimport type { BundleType } from '#resources/nls/bundle';\nimport { InputSearchBase } from './InputSearchBase';\nimport { InputSearchDesktopSuggestions } from './InputSearchDesktopSuggestions';\nimport { InputSearchMobileDropdown } from './InputSearchMobileDropdown';\nimport { useComponentTheme } from '#hooks/UNSAFE_useComponentTheme';\nimport type { InputSearchVariantOptions, InputSearchStyles } from './themes/InputSearchStyles.css';\nimport { InputSearchRedwoodTheme } from './themes/redwood/InputSearchTheme';\nimport { useInputSearch } from './useInputSearch';\n\n/**\n * Property key type supported by InputSearch suggestion records.\n */\ntype Key = string | number;\n\n/**\n * Generic suggestion record shape accepted by InputSearch.\n */\ntype Data = Record<Key, unknown>;\n\n/**\n * Suggestions can use any object shape. If suggestionItemText is not specified, then the component will\n * attempt to render as text the 'label' field in the suggestion by default.\n */\ntype InputSearchSuggestion<T extends Data> = T;\n\n/**\n * Context passed to suggestion-based callbacks.\n *\n * Preact InputSearch receives suggestions as an array, so the context intentionally exposes the\n * selected suggestion data and its rendered array index.\n */\ntype InputSearchSuggestionItemContext<\n T extends InputSearchSuggestion<Data> = InputSearchSuggestion<Data>\n> = {\n /**\n * Suggestion data object supplied through the `suggestions` property.\n */\n data: T;\n\n /**\n * Index of the suggestion in the rendered suggestions array.\n */\n index: number;\n};\n\n/**\n * Context passed to collection-mode callbacks and keyed suggestion commits.\n */\ntype InputSearchCollectionItemContext<\n T extends InputSearchSuggestion<Data> = InputSearchSuggestion<Data>\n> = InputSearchSuggestionItemContext<T> & {\n /**\n * Stable key for the rendered suggestion item.\n * Required for collection-mode current-row, selected-row, and row-action handling.\n */\n key: Key;\n\n /**\n * Metadata for the rendered suggestion item when a stable key is available.\n */\n metadata: { key: Key };\n};\n\ntype InputSearchCommitItemContext<\n T extends InputSearchSuggestion<Data> = InputSearchSuggestion<Data>\n> = InputSearchSuggestionItemContext<T> | InputSearchCollectionItemContext<T>;\n\n/**\n * Top-level suggestion keys whose values can be rendered directly as text.\n */\ntype InputSearchSuggestionTextField<\n T extends InputSearchSuggestion<Data> = InputSearchSuggestion<Data>\n> = string extends keyof T\n ? Extract<keyof T, string>\n : Extract<\n {\n [K in keyof T]-?: Exclude<T[K], undefined> extends string ? K : never;\n }[keyof T],\n string\n >;\n\n/**\n * Top-level suggestion keys whose values can be resolved to stable row keys.\n */\ntype InputSearchSuggestionKeyField<\n T extends InputSearchSuggestion<Data> = InputSearchSuggestion<Data>\n> = string extends keyof T\n ? Extract<keyof T, string>\n : Extract<\n {\n [K in keyof T]-?: Exclude<T[K], undefined> extends Key ? K : never;\n }[keyof T],\n string\n >;\n\n/**\n * Props passed to a custom suggestion renderer.\n */\ntype InputSearchSuggestionItemRendererProps<\n T extends InputSearchSuggestion<Data> = InputSearchSuggestion<Data>\n> = InputSearchSuggestionItemContext<T> & {\n /**\n * User-entered search text.\n * This property will be undefined when the suggestions are shown before typing.\n */\n searchText?: string;\n};\n\n/**\n * Specifies how to derive the text string for a suggestion.\n */\ntype InputSearchSuggestionItemText<\n T extends InputSearchSuggestion<Data> = InputSearchSuggestion<Data>\n> =\n | InputSearchSuggestionTextField<T>\n | ((itemContext: InputSearchSuggestionItemContext<T>) => string);\n\n/**\n * Specifies how to derive a stable key for collection-mode suggestions.\n */\ntype InputSearchSuggestionItemKey<\n T extends InputSearchSuggestion<Data> = InputSearchSuggestion<Data>\n> = InputSearchSuggestionKeyField<T> | ((itemContext: InputSearchSuggestionItemContext<T>) => Key);\n\n/**\n * Render function for a suggestion.\n */\ntype InputSearchSuggestionItemRenderer<\n T extends InputSearchSuggestion<Data> = InputSearchSuggestion<Data>\n> = (\n /**\n * Context for the suggestion row being rendered.\n */\n suggestionItemRendererProps: InputSearchSuggestionItemRendererProps<T>\n) => ComponentChildren;\n\n/**\n * Props passed to a custom collection renderer.\n */\ntype InputSearchCollectionRendererProps<\n T extends InputSearchSuggestion<Data> = InputSearchSuggestion<Data>\n> = {\n /**\n * Current suggestion source supplied to InputSearch.\n */\n suggestions: readonly T[] | null | undefined;\n\n /**\n * Resolves a stable row key for collection-mode suggestions.\n */\n getSuggestionKey: (data: T, index: number) => Key | undefined;\n\n /**\n * Overrides the current preview row in the rendered collection.\n */\n currentRowKeyOverride?: Key;\n\n /**\n * Callback invoked when the collection wants to persist a new current row.\n */\n onPersistCurrentRowKey: (detail: { value?: Key }) => void;\n\n /**\n * Callback invoked when the user explicitly performs an action on a row.\n */\n onRowAction: (detail: { context: InputSearchCollectionItemContext<T> }) => void;\n\n /**\n * User-entered search text.\n */\n searchText?: string;\n\n /**\n * Selected keys in the collection while collection mode is active.\n */\n selected?: Set<Key>;\n};\n\n/**\n * Render function for collection-mode suggestions.\n */\ntype InputSearchCollectionRenderer<\n T extends InputSearchSuggestion<Data> = InputSearchSuggestion<Data>\n> = (collectionRendererProps: InputSearchCollectionRendererProps<T>) => ComponentChildren;\n\n/**\n * Commit detail emitted when the user submits the current query or selects a suggestion.\n */\ntype InputSearchCommitDetail<T extends InputSearchSuggestion<Data> = InputSearchSuggestion<Data>> =\n ValueUpdateDetail<string> & {\n /**\n * Selected item context when the commit came from choosing a suggestion.\n * The context always contains the selected suggestion data and rendered array index.\n * Collection-mode commits also include a stable key and metadata.\n * This will be undefined for freeform Enter submits and clear-to-empty commits.\n */\n itemContext?: InputSearchCommitItemContext<T>;\n };\n\n// TODO: JET-44222 Desktop clear search button\ntype InputSearchBaseProps = ComponentProps<typeof InputSearchBase>;\n\n/**\n * Props shared by both suggestion-list and collection-mode InputSearch configurations.\n */\ntype InputSearchCommonProps<T extends InputSearchSuggestion<Data> = InputSearchSuggestion<Data>> = {\n /**\n * Associates the input with descriptive text.\n * @default undefined\n */\n 'aria-describedby'?: InputSearchBaseProps['ariaDescribedBy'];\n\n /**\n * Specifies whether suggestions can enable autocomplete typeahead preview.\n * When set to `on`, prefix matches can preview the first suggestion inline. Desktop partial\n * matches can also preview the first suggestion as floating text, but phones suppress floating\n * autocomplete and keep non-prefix matches raw. When set to `off`, suggestions still render, but\n * typing does not automatically preview or focus the first suggestion until the user navigates to\n * it explicitly.\n * @default 'on'\n */\n autocomplete?: 'on' | 'off';\n\n /**\n * Callback invoked when the user commits the entered value by pressing Enter or selecting a suggestion.\n * Suggestion selection commits include `itemContext` with the selected suggestion data and rendered array index.\n * @default undefined\n */\n onCommit?: (detail: InputSearchCommitDetail<T>) => void;\n\n /**\n * Internal callback invoked when the visible field value changes without a native input event.\n * Used by wrappers that expose raw display value while keeping `onInput` tied to user edits.\n * @default undefined\n */\n onDisplayValueChanged?: (detail: ValueUpdateDetail<string>) => void;\n\n /**\n * Callback invoked each time the user changes the value of the field.\n * @default undefined\n */\n onInput?: InputSearchBaseProps['onInput'];\n\n /**\n * A short hint to display before the user enters a value.\n * @default undefined\n */\n placeholder?: InputSearchBaseProps['placeholder'];\n\n /**\n * External suggestions to render in the dropdown.\n * Pass `null` to show the loading state while suggestions are being fetched.\n * On desktop and tablet, suggestions render in an anchored popup listbox.\n * On phones, suggestions render in a full-screen dialog.\n * If suggestionItemText is not specified, then the component will attempt to render as text the `label`\n * field in the suggestion by default.\n * @default undefined\n */\n suggestions?: readonly T[] | null;\n\n /**\n * Specifies the text to render for a suggestion. Set this to either a string-valued top-level\n * data field name or a callback that returns the display text from a suggestion context.\n * By default, the component uses the `label` field.\n *\n * This text is used for the selected value and, if no `suggestionItemRenderer` is provided, for\n * each dropdown suggestion. Default search term highlighting is still applied in the dropdown.\n * @default 'label'\n */\n suggestionItemText?: InputSearchSuggestionItemText<T>;\n\n /**\n * Custom render function for each suggestion row in the dropdown.\n *\n * The renderer receives an `InputSearchSuggestionItemRendererProps` object containing:\n * - `data`: The full suggestion object\n * - `index`: The suggestion's position in the list\n * - `searchText`: The current user input (undefined before any typing occurs)\n *\n * Use the `HighlightText` component inside your renderer to preserve search term\n * highlighting. The committed value will still be derived from `suggestionItemText`\n * (or the `label` field by default). The `onCommit` event will include `itemContext`\n * with the selected suggestion context.\n *\n * **Performance note**: Complex renderers are invoked on every list render. Consider\n * memoization for expensive computations.\n *\n * @example\n * ```tsx\n * suggestionItemRenderer={({ data, searchText }) => (\n * <ListItemLayout\n * primary={<HighlightText matchText={searchText}>{data.label}</HighlightText>}\n * tertiary={<Text>{data.category}</Text>}\n * />\n * )}\n * ```\n * @default undefined\n */\n suggestionItemRenderer?: InputSearchSuggestionItemRenderer<T>;\n\n /**\n * Test id forwarded to the root element.\n * @default undefined\n */\n testId?: InputSearchBaseProps['testId'];\n\n /**\n * The current display value of the component.\n * @default undefined\n */\n value?: InputSearchBaseProps['value'];\n\n /**\n * The display variant of the component.\n * @default 'standard'\n */\n variant?: InputSearchBaseProps['variant'];\n};\n\ntype InputSearchNonCollectionModeProps<\n T extends InputSearchSuggestion<Data> = InputSearchSuggestion<Data>\n> = InputSearchCommonProps<T> & {\n /**\n * @default undefined\n */\n collectionRenderer?: undefined;\n\n /**\n * Specifies the stable key for each suggestion when `collectionRenderer` is provided.\n * Set this to either a top-level field name whose value is a string/number or a callback\n * that derives a stable key from the suggestion context.\n *\n * @default undefined\n */\n suggestionItemKey?: InputSearchSuggestionItemKey<T>;\n};\n\ntype InputSearchCollectionModeProps<\n T extends InputSearchSuggestion<Data> = InputSearchSuggestion<Data>\n> = InputSearchCommonProps<T> & {\n /**\n * Custom renderer for collection-mode suggestions. When supplied, InputSearch uses collection\n * semantics and delegates row rendering and interaction to the rendered collection.\n *\n * `suggestionItemKey` is required whenever `collectionRenderer` is provided.\n */\n collectionRenderer: InputSearchCollectionRenderer<T>;\n\n /**\n * Specifies the stable key for each suggestion when `collectionRenderer` is provided.\n * Set this to either a top-level field name whose value is a string/number or a callback\n * that derives a stable key from the suggestion context.\n */\n suggestionItemKey: InputSearchSuggestionItemKey<T>;\n};\n\n/**\n * Props for `InputSearch`.\n */\ntype InputSearchProps<T extends InputSearchSuggestion<Data> = InputSearchSuggestion<Data>> =\n | InputSearchNonCollectionModeProps<T>\n | InputSearchCollectionModeProps<T>;\n\ntype InputSearchInternalProps<T extends InputSearchSuggestion<Data> = InputSearchSuggestion<Data>> =\n InputSearchProps<T> & {\n /**\n * Internal bridge invoked when focus leaves collection-mode popup content.\n */\n onCollectionBlur?: (detail: ValueUpdateDetail<string>) => void;\n /** Internal Core Pack bridge for a dismissed collection autocomplete preview. */\n suppressCollectionAutocomplete?: boolean;\n /** Internal Core Pack bridge for a matching suppressed collection row highlight. */\n allowSuppressedCollectionHighlight?: boolean;\n };\n\n/**\n * Generic component signature restored after forwardRef erases the generic props.\n */\ntype InputSearchComponent = (<T extends InputSearchSuggestion<Data> = InputSearchSuggestion<Data>>(\n props: InputSearchProps<T> & { ref?: Ref<FocusableHandle> }\n) => ComponentChildren) & {\n displayName?: string;\n};\n\n/**\n * InputSearch provides a text field for entering queries and can display an optional suggestions dropdown.\n *\n * - On desktop and tablet, the input type is set to `text` and suggestions render in an anchored popup.\n * - On phones, suggestions render in a full-screen dialog and the dialog input uses `type=\"search\"`.\n */\nconst InputSearchInternal = forwardRef(\n <T extends InputSearchSuggestion<Data> = InputSearchSuggestion<Data>>(\n componentProps: InputSearchInternalProps<T>,\n ref?: Ref<FocusableHandle>\n ) => {\n const {\n 'aria-describedby': ariaDescribedBy,\n autocomplete = 'on',\n collectionRenderer,\n suggestionItemKey,\n suggestionItemRenderer,\n suggestionItemText,\n onCommit,\n onCollectionBlur,\n onDisplayValueChanged,\n onInput,\n allowSuppressedCollectionHighlight,\n suppressCollectionAutocomplete,\n suggestions,\n testId,\n value,\n variant = 'standard',\n ...restProps\n } = componentProps;\n\n const testIdProps = useTestId(testId);\n const translations = useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\n const launcherRef = useRef<FocusableHandle>(null);\n const mobileInputRef = useRef<FocusableHandle>(null);\n const shouldRestoreLauncherFocusRef = useRef(false);\n const shouldIgnoreNextLauncherFocusRef = useRef(false);\n const shouldIgnoreNextLauncherPressRef = useRef(false);\n const shouldIgnorePairedLauncherClickRef = useRef(false);\n const shouldIgnoreNextSyntheticLauncherClickRef = useRef(false);\n const didHandleLauncherActivationRef = useRef(false);\n const lastMobileCommitTimeRef = useRef<number | undefined>();\n const wasPopupOpenRef = useRef(false);\n const launcherActivationResetTimerRef = useRef<number | undefined>();\n const launcherFocusRestoreTimerRef = useRef<number | undefined>();\n const launcherPressIgnoreResetTimerRef = useRef<number | undefined>();\n const {\n collectionContainerRef,\n collectionRendererContext,\n activeDescendantId,\n closeDropdown,\n commitCurrentCollectionSelection,\n dropdownId,\n dropdownRef,\n filterText,\n handleCollectionClickCapture,\n handleCollectionFocusOut,\n handleCollectionKeyDownCapture,\n handleCommit,\n handleDropdownAutoDismiss,\n handleOverlayDismiss,\n handleFocus,\n handleHoverIndexChange,\n handleInputBlur,\n handleInput,\n handleKeyDown,\n handleOverlayClear,\n handleOverlayCommit,\n handlePointerLeave,\n handleSuggestionSelection,\n hasSuggestionsDropdown,\n hasSuggestionsOverlay,\n hoveredSuggestionIndex,\n inputRef,\n inputType,\n interactionMode,\n isCollectionMode,\n isPopupOpen,\n keyboardFocusedSuggestionIndex,\n showKeyboardFocusIndicator,\n loadingSkeletonCount,\n floatingAutocompleteText,\n openSuggestions,\n optionRefs,\n renderedSuggestions,\n renderedValue,\n rootRef,\n shouldAnnounceNoMatches,\n shouldAnnounceResults,\n shouldCommitRawValueOnEnter,\n shouldRenderLoading\n } = useInputSearch<T>({\n autocomplete,\n collectionRenderer,\n hasSuggestionItemRenderer: suggestionItemRenderer !== undefined,\n onCommit,\n onCollectionBlur,\n onDisplayValueChanged,\n onInput,\n allowSuppressedCollectionHighlight,\n suppressCollectionAutocomplete,\n suggestionItemKey,\n suggestionItemText,\n suggestions,\n value\n });\n\n const { classes } = useComponentTheme<InputSearchVariantOptions, InputSearchStyles>(\n InputSearchRedwoodTheme,\n { variant }\n );\n\n // Keep option ids stable for a popup instance so aria-activedescendant can target\n // either the desktop listbox rows or the mobile overlay rows consistently.\n const getOptionId = useCallback(\n (index: number) => `${dropdownId}-option-${index}`,\n [dropdownId]\n );\n\n // Desktop pointer selection keeps focus on the launcher input so keyboard interaction\n // can continue from the same field immediately after the suggestion is committed.\n const handleSuggestionSelectionWithFocus = useCallback(\n (suggestion: T, index: number) =>\n handleSuggestionSelection(suggestion, index, { restoreFocus: true }),\n [handleSuggestionSelection]\n );\n\n const handleDesktopCollectionRowAction = useCallback(\n (detail: Parameters<typeof collectionRendererContext.onRowAction>[0]) => {\n collectionRendererContext.onRowAction(detail);\n // Desktop collection rows can move DOM focus into table/list internals. Restore the\n // launcher so keyboard users can continue from the search field after a row commit.\n launcherRef.current?.focus();\n },\n [collectionRendererContext]\n );\n\n // Escape can originate inside the rendered desktop collection rather than the launcher input.\n // When it closes the popup, send focus back to the launcher to match listbox mode.\n const handleDesktopCollectionKeyDownCapture = useCallback(\n (event: KeyboardEvent) => {\n handleCollectionKeyDownCapture(event);\n\n if (event.defaultPrevented && (event.key === 'Escape' || event.key === 'Enter')) {\n launcherRef.current?.focus();\n }\n },\n [handleCollectionKeyDownCapture]\n );\n\n // Mobile close paths restore focus after the overlay unmounts; mark the next launcher\n // focus event as synthetic so it does not immediately reopen the overlay.\n const restoreLauncherFocus = useCallback(() => {\n shouldRestoreLauncherFocusRef.current = true;\n shouldIgnoreNextLauncherFocusRef.current = true;\n }, []);\n\n // Ignore the focus event caused by overlay teardown. The launcher stays passive on focus\n // so touch focus does not open the mobile overlay before the activating click/tap lands.\n const handleLauncherFocus = useCallback(() => {\n if (shouldIgnoreNextLauncherFocusRef.current) {\n shouldIgnoreNextLauncherFocusRef.current = false;\n }\n }, []);\n\n // Launcher activation can arrive as both mousedown and click; mark the first\n // event for this task so the paired event does not reopen or re-toggle the overlay.\n const markLauncherActivationHandled = useCallback(() => {\n didHandleLauncherActivationRef.current = true;\n\n if (launcherActivationResetTimerRef.current !== undefined) {\n window.clearTimeout(launcherActivationResetTimerRef.current);\n }\n\n launcherActivationResetTimerRef.current = window.setTimeout(() => {\n launcherActivationResetTimerRef.current = undefined;\n didHandleLauncherActivationRef.current = false;\n }, 0);\n }, []);\n\n // Clear the short-lived suppression window used after mobile overlay commits.\n const clearLauncherPressIgnoreTimer = useCallback(() => {\n if (launcherPressIgnoreResetTimerRef.current !== undefined) {\n window.clearTimeout(launcherPressIgnoreResetTimerRef.current);\n launcherPressIgnoreResetTimerRef.current = undefined;\n }\n }, []);\n\n // Ignore only the immediate synthetic launcher activation that can follow a restored-focus\n // mobile Enter commit. If its mousedown is seen, the paired click remains suppressed below.\n const ignoreNextLauncherActivation = useCallback(() => {\n shouldIgnoreNextLauncherPressRef.current = true;\n shouldIgnorePairedLauncherClickRef.current = true;\n shouldIgnoreNextSyntheticLauncherClickRef.current = true;\n lastMobileCommitTimeRef.current = window.performance.now();\n clearLauncherPressIgnoreTimer();\n launcherPressIgnoreResetTimerRef.current = window.setTimeout(() => {\n launcherPressIgnoreResetTimerRef.current = undefined;\n shouldIgnoreNextLauncherPressRef.current = false;\n shouldIgnorePairedLauncherClickRef.current = false;\n shouldIgnoreNextSyntheticLauncherClickRef.current = false;\n }, 0);\n }, [clearLauncherPressIgnoreTimer]);\n\n // Explicit launcher presses open suggestions. On desktop this matches legacy click-to-open\n // behavior, and on phone it also handles taps after the overlay closes while focus remains.\n const handleLauncherPress = useCallback(\n (event?: MouseEvent) => {\n if (!event || event.button !== 0) {\n return;\n }\n\n if (didHandleLauncherActivationRef.current) {\n return;\n }\n\n if (shouldIgnoreNextLauncherPressRef.current) {\n shouldIgnoreNextLauncherPressRef.current = false;\n clearLauncherPressIgnoreTimer();\n\n if (hasSuggestionsOverlay && event.type === 'mousedown') {\n shouldIgnorePairedLauncherClickRef.current = true;\n }\n\n return;\n }\n\n if (shouldIgnorePairedLauncherClickRef.current && event.type === 'click') {\n shouldIgnorePairedLauncherClickRef.current = false;\n shouldIgnoreNextSyntheticLauncherClickRef.current = false;\n lastMobileCommitTimeRef.current = undefined;\n markLauncherActivationHandled();\n return;\n }\n\n const isRecentSyntheticClick =\n event.type === 'click' &&\n event.detail === 0 &&\n lastMobileCommitTimeRef.current !== undefined &&\n window.performance.now() - lastMobileCommitTimeRef.current < 500;\n\n if (\n (shouldIgnoreNextSyntheticLauncherClickRef.current || isRecentSyntheticClick) &&\n event.type === 'click' &&\n event.detail === 0\n ) {\n shouldIgnoreNextSyntheticLauncherClickRef.current = false;\n lastMobileCommitTimeRef.current = undefined;\n markLauncherActivationHandled();\n return;\n }\n\n if (event.type === 'click') {\n shouldIgnoreNextSyntheticLauncherClickRef.current = false;\n lastMobileCommitTimeRef.current = undefined;\n }\n\n if (hasSuggestionsOverlay && event.type === 'mousedown') {\n return;\n }\n\n markLauncherActivationHandled();\n\n if (isPopupOpen) {\n return;\n }\n\n openSuggestions();\n },\n [\n clearLauncherPressIgnoreTimer,\n hasSuggestionsOverlay,\n isPopupOpen,\n markLauncherActivationHandled,\n openSuggestions\n ]\n );\n\n // Clear transient launcher activation timers if the component unmounts while a\n // mouse/click pairing or post-commit suppression window is still pending.\n useEffect(() => {\n return () => {\n if (launcherActivationResetTimerRef.current !== undefined) {\n window.clearTimeout(launcherActivationResetTimerRef.current);\n launcherActivationResetTimerRef.current = undefined;\n }\n if (launcherFocusRestoreTimerRef.current !== undefined) {\n window.clearTimeout(launcherFocusRestoreTimerRef.current);\n launcherFocusRestoreTimerRef.current = undefined;\n }\n clearLauncherPressIgnoreTimer();\n };\n }, [clearLauncherPressIgnoreTimer]);\n\n // The phone launcher is a display-only combobox trigger, so keyboard activation must\n // open the overlay directly instead of falling through to submit-oriented input handling.\n const handleLauncherKeyDown = useCallback(\n (event: KeyboardEvent) => {\n if (\n isCollectionMode &&\n event.key === 'Enter' &&\n isPopupOpen &&\n collectionRendererContext.currentRowKeyOverride !== undefined &&\n !shouldCommitRawValueOnEnter()\n ) {\n event.preventDefault();\n commitCurrentCollectionSelection();\n return;\n }\n\n if (\n hasSuggestionsOverlay &&\n !isPopupOpen &&\n (event.key === 'Enter' ||\n event.key === ' ' ||\n event.key === 'ArrowDown' ||\n event.key === 'ArrowUp')\n ) {\n event.preventDefault();\n openSuggestions();\n return;\n }\n\n handleKeyDown(event);\n },\n [\n collectionRendererContext.currentRowKeyOverride,\n commitCurrentCollectionSelection,\n handleKeyDown,\n hasSuggestionsOverlay,\n isCollectionMode,\n isPopupOpen,\n openSuggestions,\n shouldCommitRawValueOnEnter\n ]\n );\n\n // Raw Enter submits from the desktop launcher should also dismiss the popup so the\n // committed field value and popup visibility stay in sync after explicit submission.\n const handleLauncherCommit = useCallback(\n (value: string) => {\n handleCommit(value);\n\n if (hasSuggestionsDropdown && isPopupOpen) {\n closeDropdown({ preserveDisplayValue: true });\n }\n },\n [closeDropdown, handleCommit, hasSuggestionsDropdown, isPopupOpen]\n );\n\n // Closing the phone overlay should return users to the launcher input once the\n // overlay finishes closing, instead of leaving focus on an unmounted control.\n const handleMobileClose = useCallback(() => {\n restoreLauncherFocus();\n handleOverlayDismiss();\n }, [handleOverlayDismiss, restoreLauncherFocus]);\n\n // Raw Enter in the phone overlay should follow legacy ojinputsearch sequencing:\n // commit and close the dialog first, then restore launcher focus after teardown.\n const handleMobileCommit = useCallback(\n (value: string) => {\n // Enter on the focused overlay input can dispatch a synthetic press to the launcher\n // after focus is restored; consume that one press so submit behaves as close, not reopen.\n ignoreNextLauncherActivation();\n handleOverlayCommit(value);\n restoreLauncherFocus();\n },\n [handleOverlayCommit, ignoreNextLauncherActivation, restoreLauncherFocus]\n );\n\n // Suggestion selection in the mobile overlay follows the same focus handoff as the\n // explicit close action because the overlay input disappears after selection.\n const handleMobileSuggestionSelection = useCallback(\n (suggestion: T, index: number) => {\n ignoreNextLauncherActivation();\n restoreLauncherFocus();\n handleSuggestionSelection(suggestion, index);\n },\n [handleSuggestionSelection, ignoreNextLauncherActivation, restoreLauncherFocus]\n );\n\n const handleMobileCollectionRowAction = useCallback(\n (detail: Parameters<typeof collectionRendererContext.onRowAction>[0]) => {\n // Collection row actions close the mobile overlay, so use the same focus and synthetic\n // launcher-click suppression path as ordinary suggestion selection.\n ignoreNextLauncherActivation();\n restoreLauncherFocus();\n collectionRendererContext.onRowAction(detail);\n },\n [collectionRendererContext, ignoreNextLauncherActivation, restoreLauncherFocus]\n );\n\n const handleMobileCollectionClickCapture = useCallback(\n (event: MouseEvent) => {\n // Captured taps can commit rows after collection internals finish their own click handling.\n // Prepare the overlay-close focus path before the delayed commit runs.\n ignoreNextLauncherActivation();\n restoreLauncherFocus();\n handleCollectionClickCapture(event);\n },\n [handleCollectionClickCapture, ignoreNextLauncherActivation, restoreLauncherFocus]\n );\n\n const handleMobileCollectionKeyDownCapture = useCallback(\n (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n // Hardware-keyboard Escape is supported in the mobile overlay even though touch users\n // normally use the visible back button.\n ignoreNextLauncherActivation();\n event.preventDefault();\n handleMobileClose();\n return;\n }\n\n handleCollectionKeyDownCapture(event);\n\n if (event.defaultPrevented && event.key === 'Enter') {\n ignoreNextLauncherActivation();\n restoreLauncherFocus();\n }\n },\n [\n handleCollectionKeyDownCapture,\n handleMobileClose,\n ignoreNextLauncherActivation,\n restoreLauncherFocus\n ]\n );\n\n const desktopCollectionRendererContext = useMemo(\n () => ({\n ...collectionRendererContext,\n // Desktop row commits should restore focus to the launcher after collection internals fire.\n onRowAction: handleDesktopCollectionRowAction\n }),\n [collectionRendererContext, handleDesktopCollectionRowAction]\n );\n\n const mobileCollectionRendererContext = useMemo(\n () => ({\n ...collectionRendererContext,\n // Mobile row commits should close the overlay and suppress the follow-up launcher click.\n onRowAction: handleMobileCollectionRowAction\n }),\n [collectionRendererContext, handleMobileCollectionRowAction]\n );\n\n // Enter on the mobile overlay can select the keyboard-active suggestion before the\n // base input falls through to raw commit handling. Route that selection through the\n // mobile path so focus restoration and synthetic launcher-press suppression still apply.\n const handleMobileKeyDown = useCallback(\n (event: KeyboardEvent) => {\n if (\n isCollectionMode &&\n event.key === 'Enter' &&\n isPopupOpen &&\n collectionRendererContext.currentRowKeyOverride !== undefined &&\n !shouldCommitRawValueOnEnter()\n ) {\n event.preventDefault();\n ignoreNextLauncherActivation();\n commitCurrentCollectionSelection();\n restoreLauncherFocus();\n return;\n }\n\n if (isCollectionMode && event.key === 'Escape' && isPopupOpen) {\n event.preventDefault();\n ignoreNextLauncherActivation();\n handleMobileClose();\n return;\n }\n\n if (\n !isCollectionMode &&\n event.key === 'Enter' &&\n isPopupOpen &&\n keyboardFocusedSuggestionIndex >= 0 &&\n !shouldCommitRawValueOnEnter()\n ) {\n const suggestion = renderedSuggestions[keyboardFocusedSuggestionIndex];\n\n if (suggestion) {\n event.preventDefault();\n handleMobileSuggestionSelection(suggestion, keyboardFocusedSuggestionIndex);\n return;\n }\n }\n\n handleKeyDown(event);\n },\n [\n collectionRendererContext.currentRowKeyOverride,\n commitCurrentCollectionSelection,\n handleKeyDown,\n handleMobileClose,\n handleMobileSuggestionSelection,\n ignoreNextLauncherActivation,\n isCollectionMode,\n isPopupOpen,\n keyboardFocusedSuggestionIndex,\n renderedSuggestions,\n restoreLauncherFocus,\n shouldCommitRawValueOnEnter\n ]\n );\n\n // Focus the mounted overlay input as soon as its ref is attached so phone launches can\n // keep the virtual-keyboard handoff as close to the opening gesture as possible.\n const handleMobileInputRef = useCallback(\n (element: HTMLInputElement | null) => {\n inputRef.current = element;\n\n if (element && isPopupOpen) {\n element.focus();\n }\n },\n [inputRef, isPopupOpen]\n );\n\n // The public imperative handle should always target whichever input is currently\n // interactive: the launcher by default, or the mobile overlay input while open.\n const getActiveHandle = useCallback(() => {\n if (hasSuggestionsOverlay && isPopupOpen) {\n return mobileInputRef.current ?? launcherRef.current;\n }\n\n return launcherRef.current;\n }, [hasSuggestionsOverlay, isPopupOpen]);\n\n // Forward focus APIs to the active input without treating imperative calls\n // as launcher gestures that open the phone suggestions dialog.\n useImperativeHandle(\n ref!,\n () => ({\n focus: () => {\n getActiveHandle()?.focus();\n },\n blur: () => {\n getActiveHandle()?.blur();\n }\n }),\n [getActiveHandle]\n );\n\n // Wait until the popup is fully closed before restoring launcher focus; doing it\n // earlier can bounce focus between the mobile overlay input and the launcher.\n useEffect(() => {\n if (isPopupOpen) {\n wasPopupOpenRef.current = true;\n return;\n }\n\n const didJustClose = wasPopupOpenRef.current;\n wasPopupOpenRef.current = false;\n\n if (!shouldRestoreLauncherFocusRef.current && !(didJustClose && hasSuggestionsOverlay)) {\n return;\n }\n\n shouldRestoreLauncherFocusRef.current = false;\n\n if (launcherFocusRestoreTimerRef.current !== undefined) {\n window.clearTimeout(launcherFocusRestoreTimerRef.current);\n }\n\n launcherFocusRestoreTimerRef.current = window.setTimeout(() => {\n launcherFocusRestoreTimerRef.current = undefined;\n launcherRef.current?.focus();\n }, 0);\n }, [hasSuggestionsOverlay, isPopupOpen]);\n\n const liveRegionText = (() => {\n if ((hasSuggestionsDropdown || hasSuggestionsOverlay) && shouldRenderLoading) {\n return translations.menu_stateLoading();\n }\n\n if (shouldAnnounceNoMatches) {\n return translations.select_noMatchesFound();\n }\n\n if (!shouldAnnounceResults) {\n return '';\n }\n\n if (renderedSuggestions.length === 1) {\n return translations.select_oneMatchFound();\n }\n\n return translations.select_sizeMatchesFound({ TOTAL_SIZE: `${renderedSuggestions.length}` });\n })();\n\n const mobilePopupId = `${dropdownId}-popup`;\n const launcherAutoComplete = hasSuggestionsDropdown\n ? isCollectionMode\n ? undefined\n : autocomplete === 'on'\n ? 'both'\n : 'list'\n : undefined;\n const launcherControls = hasSuggestionsDropdown\n ? dropdownId\n : hasSuggestionsOverlay\n ? mobilePopupId\n : undefined;\n const launcherExpanded = suggestions !== undefined ? isPopupOpen : undefined;\n\n const dropdown = !isPopupOpen ? null : hasSuggestionsDropdown ? (\n <InputSearchDesktopSuggestions\n anchorRef={rootRef}\n collectionContainerRef={collectionContainerRef}\n collectionRenderer={collectionRenderer}\n collectionRendererContext={desktopCollectionRendererContext}\n dropdownRef={dropdownRef}\n hoveredIndex={hoveredSuggestionIndex}\n keyboardFocusedIndex={keyboardFocusedSuggestionIndex}\n showKeyboardFocusIndicator={showKeyboardFocusIndicator}\n getOptionId={getOptionId}\n id={dropdownId}\n interactionMode={interactionMode}\n isCollectionMode={isCollectionMode}\n isLoading={shouldRenderLoading}\n isOpen={isPopupOpen}\n loadingSkeletonCount={loadingSkeletonCount}\n onAutoDismiss={handleDropdownAutoDismiss}\n onCollectionClickCapture={handleCollectionClickCapture}\n onCollectionFocusOut={handleCollectionFocusOut}\n onCollectionKeyDownCapture={handleDesktopCollectionKeyDownCapture}\n onHoverIndexChange={handleHoverIndexChange}\n onPointerLeave={handlePointerLeave}\n onSuggestionSelection={handleSuggestionSelectionWithFocus}\n optionRefs={optionRefs}\n searchText={filterText}\n suggestionItemText={suggestionItemText}\n suggestionItemRenderer={suggestionItemRenderer}\n suggestions={renderedSuggestions}\n />\n ) : (\n <InputSearchMobileDropdown\n activeDescendantId={activeDescendantId}\n ariaAutoComplete={isCollectionMode ? undefined : autocomplete === 'on' ? 'both' : 'list'}\n ariaDescribedBy={ariaDescribedBy}\n collectionContainerRef={collectionContainerRef}\n collectionRenderer={collectionRenderer}\n collectionRendererContext={mobileCollectionRendererContext}\n getOptionId={getOptionId}\n hoveredIndex={hoveredSuggestionIndex}\n id={dropdownId}\n inputRef={handleMobileInputRef}\n inputSearchRef={mobileInputRef}\n interactionMode={interactionMode}\n isCollectionMode={isCollectionMode}\n isLoading={shouldRenderLoading}\n isOpen={isPopupOpen}\n keyboardFocusedIndex={keyboardFocusedSuggestionIndex}\n showKeyboardFocusIndicator={showKeyboardFocusIndicator}\n liveRegionText={liveRegionText}\n loadingSkeletonCount={loadingSkeletonCount}\n onClear={handleOverlayClear}\n onClose={handleMobileClose}\n onCommit={handleMobileCommit}\n onCollectionClickCapture={handleMobileCollectionClickCapture}\n onCollectionFocusOut={handleCollectionFocusOut}\n onCollectionKeyDownCapture={handleMobileCollectionKeyDownCapture}\n onFocus={handleFocus}\n onHoverIndexChange={handleHoverIndexChange}\n onInput={handleInput}\n onKeyDown={handleMobileKeyDown}\n onPointerLeave={handlePointerLeave}\n onSuggestionSelection={handleMobileSuggestionSelection}\n optionRefs={optionRefs}\n placeholder={restProps.placeholder}\n popupId={mobilePopupId}\n renderedValue={renderedValue}\n searchText={filterText}\n suggestionItemText={suggestionItemText}\n suggestionItemRenderer={suggestionItemRenderer}\n suggestions={renderedSuggestions}\n testId={testId}\n />\n );\n\n return (\n <div {...testIdProps} className={classes} ref={rootRef}>\n <InputSearchBase\n {...restProps}\n ariaActiveDescendant={activeDescendantId}\n ariaAutoComplete={launcherAutoComplete}\n ariaBusy={shouldRenderLoading ? true : undefined}\n ariaControls={launcherControls}\n ariaDescribedBy={ariaDescribedBy}\n ariaExpanded={launcherExpanded}\n ariaHasPopup={\n isCollectionMode || hasSuggestionsOverlay\n ? 'dialog'\n : hasSuggestionsDropdown\n ? 'listbox'\n : undefined\n }\n displayOnly={hasSuggestionsOverlay}\n floatingAutocompleteText={floatingAutocompleteText ?? undefined}\n inputRef={inputRef}\n liveRegionText={liveRegionText}\n onBlur={hasSuggestionsOverlay ? undefined : handleInputBlur}\n onClick={handleLauncherPress}\n onCommit={handleLauncherCommit}\n onFocus={handleLauncherFocus}\n onInput={handleInput}\n onKeyDown={handleLauncherKeyDown}\n onMouseDown={handleLauncherPress}\n testId={testId}\n ref={launcherRef}\n type={inputType}\n value={renderedValue}\n variant={variant}\n />\n {dropdown}\n </div>\n );\n }\n);\n\nexport const InputSearch = InputSearchInternal as InputSearchComponent;\n\nInputSearch.displayName = 'InputSearch';\n\nexport type {\n Data,\n Key,\n InputSearchCollectionItemContext,\n InputSearchCollectionRendererProps,\n InputSearchCommitDetail,\n InputSearchProps,\n InputSearchSuggestion,\n InputSearchSuggestionItemKey,\n InputSearchSuggestionItemContext,\n InputSearchSuggestionItemRendererProps,\n InputSearchSuggestionItemText\n};\n"],"names":["SvgSearch","props","_jsx","Icon","viewBox","children","jsx","d","fill","fillRule","InputSearchBase","forwardRef","displayOnly","endContent","ariaActiveDescendant","ariaAutoComplete","ariaDescribedBy","ariaBusy","ariaControls","ariaExpanded","ariaHasPopup","autoComplete","floatingAutocompleteText","liveRegionText","inputRef","spellcheck","variant","onBlur","onClick","onCommit","onFocus","onInput","onKeyDown","onMouseDown","placeholder","startContent","textFieldStyleVariant","testId","type","value","ref","ariaLabel","useTranslationBundle","accSearch","enabledElementRef","useRef","readonlyElementRef","isTabbable","tabbableModeProps","useTabbableMode","focusProps","isFocused","methods","focusMethods","useFocusableTextField","isReadonly","onBlurWithin","onFocusWithin","formFieldContext","inputProps","textFieldProps","useTextField","useEffect","inputElement","current","undefined","removeAttribute","setAttribute","String","handleKeyDown","useCallback","event","defaultPrevented","key","repeat","currentValue","currentTarget","mergedInputRef","useMemo","mergeRefs","handleDisplayOnlyKeyDown","useImperativeHandle","styles","inputSearchStyles","variantClasses","iconClasses","useComponentTheme","InputSearchRedwoodTheme","target","hasSuggestionsPopup","floatingAutocomplete","_jsxs","className","floatingAutocompleteContainer","floatingAutocompleteHiddenValue","mainContent","displayContents","onClickCapture","onMouseDownCapture","mobileLauncherContainer","mobileLauncher","onFocusOut","onFocusIn","role","tabIndex","mobileLauncherContent","Text","jsxs","TextFieldInput","hasEndContent","hasStartContent","LiveRegion","searchIcon","Search","FormFieldContext","Provider","TextField","styleVariant","loggedSuggestionItemTextErrors","Set","logSuggestionItemTextErrorOnce","message","has","add","error","suggestionTextContainsQuery","suggestionText","query","normalizedQuery","toLowerCase","includes","getItemText","item","index","suggestionItemText","resolvedItemText","Object","prototype","hasOwnProperty","call","itemTextValue","data","LIST_GRIDLINES","top","bottom","InputSearchSuggestions","getOptionId","hoveredIndex","id","interactionMode","isLoading","suggestionItemRenderer","keyboardFocusedIndex","showKeyboardFocusIndicator","loadingSkeletonCount","optionRefs","onHoverIndexChange","onPointerLeave","onSuggestionSelection","searchText","suggestions","focusRingStyle","listbox","listWrapperRef","visualActiveIndex","collectionData","map","suggestion","metadata","currentItemOverride","rowKey","currentItemVariant","getOptionIndex","element","optionElement","closest","registeredOptionIndex","indexOf","optionElements","querySelectorAll","Array","handleSuggestionMouseDown","preventDefault","handleSuggestionAction","optionIndex","stopPropagation","handleSuggestionHover","length","listboxElement","querySelector","forEach","class","from","Math","max","_","Skeleton","height","onMouseUpCapture","onPointerOverCapture","onPointerMoveCapture","onPointerCancel","List","gridlines","itemPadding","classNames","dropdownStyles","singleSelectItem","HighlightText","matchText","InputSearchDesktopSuggestions","anchorRef","collectionContainerRef","collectionRenderer","collectionRendererContext","dropdownRef","isCollectionMode","isOpen","onAutoDismiss","onCollectionClickCapture","onCollectionFocusOut","onCollectionKeyDownCapture","collectionContainer","applyCollectionLabel","tableElement","listElement","hasAttribute","MutationObserver","observer","observe","childList","subtree","disconnect","Dropdown","DropdownList","hasBottomGap","hasTopGap","onKeyDownCapture","collectionWrapper","InputSearchMobileDropdown","activeDescendantId","inputSearchRef","onClear","onClose","popupId","renderedValue","translations","backButtonAriaLabel","selectMultiple_back","searchAriaLabel","dialogLabelId","clearButtonTestId","ClearIcon","IconButton","onAction","size","NavLeft","SelectMobileDropdown","header","_Fragment","HiddenAccessible","labelId","collectionOuterWrapper","interactiveCollectionDescendantSelector","join","collectionFocusTargetSelectors","collectionTabbableSelector","EMPTY_COLLECTION_ITEM_CONTEXTS","EMPTY_COLLECTION_CONTEXT_MAP","Map","EMPTY_COLLECTION_KEY_INDEX_MAP","EMPTY_COLLECTION_TYPED_KEY_MAP","EMPTY_COLLECTION_LEGACY_KEY_MAP","EMPTY_SUGGESTIONS","isElementWithinTarget","node","container","Node","contains","root","getRootNode","ShadowRoot","host","getDeepActiveElement","activeElement","document","HTMLElement","shadowRoot","Element","querySelectorAllDeep","selector","matches","collectMatches","currentRoot","push","isVisibleCollectionTabbable","offsetParent","window","getComputedStyle","visibility","getCollectionKeyAttributes","keyAttribute","getAttribute","keyTypeAttribute","getTypedCollectionKeyLookup","keyType","isValidCollectionElement","isConnected","useInputSearch","autocomplete","hasSuggestionItemRenderer","suggestionItemKey","onCollectionBlur","suppressCollectionAutocomplete","allowSuppressedCollectionHighlight","onDisplayValueChanged","propValue","dropdownId","useId","rootRef","pendingTypeaheadSyncRef","pendingAcceptedCaretPositionRef","pendingTypeaheadAcceptedCaretPositionRef","suppressAutocompleteRef","commitRawValueOnEnterRef","acceptedAutocompleteValueRef","shouldHighlightSuppressedPrefixRef","pendingControlledRestoreValueRef","pendingControlledInputRef","pendingControlledCollectionCommitValueRef","pendingControlledCollectionCommitPreviousValueRef","lastRenderedSuggestionCountRef","mobileOverlayFocusTimerRef","collectionTapActionTimerRef","collectionFocusRetryTimerRef","collectionFocusRetryCountRef","collectionFocusTargetsRef","collectionScrollTargetCacheRef","savedCaretRangeRef","hasCollectionFocusSinceOpenRef","pendingCollectionInputOpenRef","shouldFocusCollectionRef","hasDispatchedCollectionBlurRef","shouldRestoreCollectionInputValueOnFocusRef","isControlled","isPhoneDevice","getClientHints","deviceType","isAutocompletePreviewOn","isCollectionAutocompleteHighlightOn","isAutocompleteOn","inputType","hasSuggestions","hasSuggestionsDropdown","hasSuggestionsOverlay","isSuggestionsLoading","suggestionItems","isDropdownOpen","setIsDropdownOpen","useState","hoveredSuggestionIndex","setHoveredSuggestionIndex","keyboardFocusedSuggestionIndex","setKeyboardFocusedSuggestionIndex","setShowKeyboardFocusIndicator","setInteractionMode","filterText","setFilterText","setRenderedValue","setFloatingAutocompleteText","lastAnnouncedEmptyQuery","setLastAnnouncedEmptyQuery","autocompleteRange","setAutocompleteRange","isDropdownOpenRef","currentRowKeyOverride","setCurrentRowKeyOverride","collectionFocusRequest","setCollectionFocusRequest","currentRowKeyOverrideRef","committedRowKey","setCommittedRowKey","filterTextRef","renderedValueRef","lastPropValueRef","currentCommitValueRef","overlayDismissRestoreValueRef","updateRenderedValue","nextRenderedValue","options","previousValue","notifyDisplayValueChanged","getRenderedItemText","doesSuggestionMatchQuery","values","some","suggestionDataContainsQuery","getSuggestionKey","keyValue","getSuggestionItemContext","collectionItemContexts","reduce","itemContexts","itemContext","suggestionContextMap","contextMap","set","collectionItemIndexMap","indexMap","collectionTypedKeyMap","typedKeyMap","collectionLegacyKeyMap","legacyKeyMap","legacyKey","resetSuggestionFocusState","clearCollectionCurrentRow","saveInputCaretRange","end","selectionEnd","start","selectionStart","openDropdown","resetAutocomplete","restoredValue","restoreCaretToRawPrefixEnd","caretPosition","queueMicrotask","setSelectionRange","restoreCollectionInputValue","buildAutocompletePreviewValue","suggestionLabel","slice","applyKeyboardFocusPreview","previewValue","autocompleteStart","floating","closeDropdown","preserveDisplayValue","clearTimeout","blurCollectionAndClose","handleDropdownAutoDismiss","KeyboardEvent","isFocusMovingIntoCollection","focusEvent","popupElement","getElementById","relatedTarget","handleCollectionFocusOut","handleDocumentFocusIn","isFocusLeavingCollection","addEventListener","removeEventListener","handleInputBlur","syncControlledValue","nextValue","applyInputValue","shouldSuppressAutocomplete","shouldHighlightSuppressedPrefix","useLayoutEffect","controlledValueChanged","localStateDiverged","shouldPreserveTransientSuggestionDisplay","pendingControlledCollectionCommitValue","pendingControlledCollectionCommitPreviousValue","pendingControlledInput","previousCommitValue","acceptedCaretPosition","pendingControlledRestoreValue","clear","suggestionItemsLength","typedFilterText","firstItemContext","currentItemContext","get","currentItemText","isCollectionFocused","shouldRenderCurrentItemText","hasTypedFilterText","shouldAutocompleteCollection","startsWith","shouldShowFloatingCollectionAutocomplete","activeOption","scrollIntoView","block","pendingAcceptedCaretPosition","pendingTypeaheadAcceptedCaretPosition","firstSuggestion","normalizedFilterText","firstSuggestionLabel","firstSuggestionMatchesQuery","shouldAutocomplete","shouldShowFloatingAutocomplete","previewSuggestion","moveKeyboardFocus","direction","prev","nextIndex","nextSuggestion","nextSuggestionLabel","moveCollectionCurrentRow","currentIndex","isNavigatingFromLauncherWithPreviewedRow","min","previousKey","nextKey","openSuggestions","handleInput","detail","nativeInputValue","previousFilterText","previousRenderedValue","hasAutocompletePreview","isShorteningPrefixEdit","isEditingAcceptedAutocompleteValue","isContinuingSuppressedPrefixEdit","shouldKeepRawCommitAfterSuppressedEdit","inputCaretPosition","commitValue","committedValue","nextCommittedValue","committedKey","handleOverlayDismiss","handleOverlayCommit","getCollectionFocusTargets","cachedFocusTargets","filter","focusTarget","focusTargets","seenFocusTargets","getCollectionScrollTarget","typedKeyLookup","cachedScrollTarget","delete","keyElements","scrollTarget","find","isTypedCollectionKeyMatch","isLegacyCollectionKeyMatch","restoreInputFocus","focus","restoreCaret","savedRange","focusCollection","didFocusCollection","didFocus","isShiftTabLeavingCollectionBoundary","tabbableElements","firstTabbable","shallowActiveElement","deepActiveElement","removeDropdownElement","parentElement","removeChild","handlePersistCurrentRowKey","handleCollectionRowAction","context","committedText","getCollectionItemContextFromElement","keyElement","handleCollectionClickCapture","actionableElement","interactiveDescendant","tappedItemContext","setTimeout","handleCollectionKeyDownCapture","shiftKey","commitCurrentCollectionSelection","currentQuery","trim","shouldAnnounceNoMatches","shouldAnnounceResults","handleFocus","handleSuggestionSelection","restoreFocus","handleHoverIndexChange","handleOverlayClear","handlePointerLeave","dismissAutocompletePreview","clearFullySelectedValue","acceptAutocompletePreview","acceptedValue","shouldRenderSuggestions","shouldRenderLoading","isPopupOpen","renderedSuggestions","selectedKeys","onPersistCurrentRowKey","onRowAction","selected","shouldCommitRawValueOnEnter","handleCommit","InputSearchInternal","componentProps","restProps","testIdProps","useTestId","launcherRef","mobileInputRef","shouldRestoreLauncherFocusRef","shouldIgnoreNextLauncherFocusRef","shouldIgnoreNextLauncherPressRef","shouldIgnorePairedLauncherClickRef","shouldIgnoreNextSyntheticLauncherClickRef","didHandleLauncherActivationRef","lastMobileCommitTimeRef","wasPopupOpenRef","launcherActivationResetTimerRef","launcherFocusRestoreTimerRef","launcherPressIgnoreResetTimerRef","classes","handleSuggestionSelectionWithFocus","handleDesktopCollectionRowAction","handleDesktopCollectionKeyDownCapture","restoreLauncherFocus","handleLauncherFocus","markLauncherActivationHandled","clearLauncherPressIgnoreTimer","ignoreNextLauncherActivation","performance","now","handleLauncherPress","button","isRecentSyntheticClick","handleLauncherKeyDown","handleLauncherCommit","handleMobileClose","handleMobileCommit","handleMobileSuggestionSelection","handleMobileCollectionRowAction","handleMobileCollectionClickCapture","handleMobileCollectionKeyDownCapture","desktopCollectionRendererContext","mobileCollectionRendererContext","handleMobileKeyDown","handleMobileInputRef","getActiveHandle","blur","didJustClose","menu_stateLoading","select_noMatchesFound","select_oneMatchFound","select_sizeMatchesFound","TOTAL_SIZE","mobilePopupId","launcherAutoComplete","launcherControls","launcherExpanded","dropdown","InputSearch","displayName"],"mappings":"45ZAYA,MAAMA,GAAaC,GACjBC,MAACC,EAAAA,KAAI,CAACC,QAAQ,eAAgBH,EAC5BI,SAAAH,EAAAI,IAAA,OAAA,CACEC,EAAE,qHACFC,KAAK,eACLC,SAAS,cC+KTC,GAAkBC,EAAUA,YAChC,EAEIC,eAAc,EACdC,aACAC,uBACAC,mBACAC,kBACAC,WACAC,eACAC,eACAC,eACAC,eACAC,2BACAC,iBACAC,WACAC,aACAC,UAAU,WACVC,SACAC,UACAC,WACAC,UACAC,UACAC,YACAC,cACAC,cACAC,eACAC,wBACAC,SACAC,OACAC,SAEFC,KAEA,MAEMC,EAFeC,uBAAiC,4BAEvBC,YACzBC,EAAoBC,SAAyB,MAC7CC,EAAqBD,S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