@element-plus/nightly 0.0.20250808 → 0.0.20250810

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 (509) hide show
  1. package/attributes.json +1 -1
  2. package/dist/index.full.js +2735 -845
  3. package/dist/index.full.min.js +14 -14
  4. package/dist/index.full.min.js.map +1 -1
  5. package/dist/index.full.min.mjs +15 -15
  6. package/dist/index.full.min.mjs.map +1 -1
  7. package/dist/index.full.mjs +2735 -846
  8. package/dist/locale/af.js +1 -1
  9. package/dist/locale/af.min.js +1 -1
  10. package/dist/locale/af.min.mjs +1 -1
  11. package/dist/locale/af.mjs +1 -1
  12. package/dist/locale/ar-eg.js +1 -1
  13. package/dist/locale/ar-eg.min.js +1 -1
  14. package/dist/locale/ar-eg.min.mjs +1 -1
  15. package/dist/locale/ar-eg.mjs +1 -1
  16. package/dist/locale/ar.js +1 -1
  17. package/dist/locale/ar.min.js +1 -1
  18. package/dist/locale/ar.min.mjs +1 -1
  19. package/dist/locale/ar.mjs +1 -1
  20. package/dist/locale/az.js +1 -1
  21. package/dist/locale/az.min.js +1 -1
  22. package/dist/locale/az.min.mjs +1 -1
  23. package/dist/locale/az.mjs +1 -1
  24. package/dist/locale/bg.js +1 -1
  25. package/dist/locale/bg.min.js +1 -1
  26. package/dist/locale/bg.min.mjs +1 -1
  27. package/dist/locale/bg.mjs +1 -1
  28. package/dist/locale/bn.js +1 -1
  29. package/dist/locale/bn.min.js +1 -1
  30. package/dist/locale/bn.min.mjs +1 -1
  31. package/dist/locale/bn.mjs +1 -1
  32. package/dist/locale/ca.js +1 -1
  33. package/dist/locale/ca.min.js +1 -1
  34. package/dist/locale/ca.min.mjs +1 -1
  35. package/dist/locale/ca.mjs +1 -1
  36. package/dist/locale/ckb.js +1 -1
  37. package/dist/locale/ckb.min.js +1 -1
  38. package/dist/locale/ckb.min.mjs +1 -1
  39. package/dist/locale/ckb.mjs +1 -1
  40. package/dist/locale/cs.js +1 -1
  41. package/dist/locale/cs.min.js +1 -1
  42. package/dist/locale/cs.min.mjs +1 -1
  43. package/dist/locale/cs.mjs +1 -1
  44. package/dist/locale/da.js +1 -1
  45. package/dist/locale/da.min.js +1 -1
  46. package/dist/locale/da.min.mjs +1 -1
  47. package/dist/locale/da.mjs +1 -1
  48. package/dist/locale/de.js +1 -1
  49. package/dist/locale/de.min.js +1 -1
  50. package/dist/locale/de.min.mjs +1 -1
  51. package/dist/locale/de.mjs +1 -1
  52. package/dist/locale/el.js +1 -1
  53. package/dist/locale/el.min.js +1 -1
  54. package/dist/locale/el.min.mjs +1 -1
  55. package/dist/locale/el.mjs +1 -1
  56. package/dist/locale/en.js +1 -1
  57. package/dist/locale/en.min.js +1 -1
  58. package/dist/locale/en.min.mjs +1 -1
  59. package/dist/locale/en.mjs +1 -1
  60. package/dist/locale/eo.js +1 -1
  61. package/dist/locale/eo.min.js +1 -1
  62. package/dist/locale/eo.min.mjs +1 -1
  63. package/dist/locale/eo.mjs +1 -1
  64. package/dist/locale/es.js +1 -1
  65. package/dist/locale/es.min.js +1 -1
  66. package/dist/locale/es.min.mjs +1 -1
  67. package/dist/locale/es.mjs +1 -1
  68. package/dist/locale/et.js +1 -1
  69. package/dist/locale/et.min.js +1 -1
  70. package/dist/locale/et.min.mjs +1 -1
  71. package/dist/locale/et.mjs +1 -1
  72. package/dist/locale/eu.js +1 -1
  73. package/dist/locale/eu.min.js +1 -1
  74. package/dist/locale/eu.min.mjs +1 -1
  75. package/dist/locale/eu.mjs +1 -1
  76. package/dist/locale/fa.js +1 -1
  77. package/dist/locale/fa.min.js +1 -1
  78. package/dist/locale/fa.min.mjs +1 -1
  79. package/dist/locale/fa.mjs +1 -1
  80. package/dist/locale/fi.js +1 -1
  81. package/dist/locale/fi.min.js +1 -1
  82. package/dist/locale/fi.min.mjs +1 -1
  83. package/dist/locale/fi.mjs +1 -1
  84. package/dist/locale/fr.js +1 -1
  85. package/dist/locale/fr.min.js +1 -1
  86. package/dist/locale/fr.min.mjs +1 -1
  87. package/dist/locale/fr.mjs +1 -1
  88. package/dist/locale/he.js +1 -1
  89. package/dist/locale/he.min.js +1 -1
  90. package/dist/locale/he.min.mjs +1 -1
  91. package/dist/locale/he.mjs +1 -1
  92. package/dist/locale/hi.js +1 -1
  93. package/dist/locale/hi.min.js +1 -1
  94. package/dist/locale/hi.min.mjs +1 -1
  95. package/dist/locale/hi.mjs +1 -1
  96. package/dist/locale/hr.js +1 -1
  97. package/dist/locale/hr.min.js +1 -1
  98. package/dist/locale/hr.min.mjs +1 -1
  99. package/dist/locale/hr.mjs +1 -1
  100. package/dist/locale/hu.js +1 -1
  101. package/dist/locale/hu.min.js +1 -1
  102. package/dist/locale/hu.min.mjs +1 -1
  103. package/dist/locale/hu.mjs +1 -1
  104. package/dist/locale/hy-am.js +1 -1
  105. package/dist/locale/hy-am.min.js +1 -1
  106. package/dist/locale/hy-am.min.mjs +1 -1
  107. package/dist/locale/hy-am.mjs +1 -1
  108. package/dist/locale/id.js +1 -1
  109. package/dist/locale/id.min.js +1 -1
  110. package/dist/locale/id.min.mjs +1 -1
  111. package/dist/locale/id.mjs +1 -1
  112. package/dist/locale/it.js +1 -1
  113. package/dist/locale/it.min.js +1 -1
  114. package/dist/locale/it.min.mjs +1 -1
  115. package/dist/locale/it.mjs +1 -1
  116. package/dist/locale/ja.js +1 -1
  117. package/dist/locale/ja.min.js +1 -1
  118. package/dist/locale/ja.min.mjs +1 -1
  119. package/dist/locale/ja.mjs +1 -1
  120. package/dist/locale/kk.js +1 -1
  121. package/dist/locale/kk.min.js +1 -1
  122. package/dist/locale/kk.min.mjs +1 -1
  123. package/dist/locale/kk.mjs +1 -1
  124. package/dist/locale/km.js +1 -1
  125. package/dist/locale/km.min.js +1 -1
  126. package/dist/locale/km.min.mjs +1 -1
  127. package/dist/locale/km.mjs +1 -1
  128. package/dist/locale/ko.js +1 -1
  129. package/dist/locale/ko.min.js +1 -1
  130. package/dist/locale/ko.min.mjs +1 -1
  131. package/dist/locale/ko.mjs +1 -1
  132. package/dist/locale/ku.js +1 -1
  133. package/dist/locale/ku.min.js +1 -1
  134. package/dist/locale/ku.min.mjs +1 -1
  135. package/dist/locale/ku.mjs +1 -1
  136. package/dist/locale/ky.js +1 -1
  137. package/dist/locale/ky.min.js +1 -1
  138. package/dist/locale/ky.min.mjs +1 -1
  139. package/dist/locale/ky.mjs +1 -1
  140. package/dist/locale/lo.js +1 -1
  141. package/dist/locale/lo.min.js +1 -1
  142. package/dist/locale/lo.min.mjs +1 -1
  143. package/dist/locale/lo.mjs +1 -1
  144. package/dist/locale/lt.js +1 -1
  145. package/dist/locale/lt.min.js +1 -1
  146. package/dist/locale/lt.min.mjs +1 -1
  147. package/dist/locale/lt.mjs +1 -1
  148. package/dist/locale/lv.js +1 -1
  149. package/dist/locale/lv.min.js +1 -1
  150. package/dist/locale/lv.min.mjs +1 -1
  151. package/dist/locale/lv.mjs +1 -1
  152. package/dist/locale/mg.js +1 -1
  153. package/dist/locale/mg.min.js +1 -1
  154. package/dist/locale/mg.min.mjs +1 -1
  155. package/dist/locale/mg.mjs +1 -1
  156. package/dist/locale/mn.js +1 -1
  157. package/dist/locale/mn.min.js +1 -1
  158. package/dist/locale/mn.min.mjs +1 -1
  159. package/dist/locale/mn.mjs +1 -1
  160. package/dist/locale/ms.js +1 -1
  161. package/dist/locale/ms.min.js +1 -1
  162. package/dist/locale/ms.min.mjs +1 -1
  163. package/dist/locale/ms.mjs +1 -1
  164. package/dist/locale/my.js +1 -1
  165. package/dist/locale/my.min.js +1 -1
  166. package/dist/locale/my.min.mjs +1 -1
  167. package/dist/locale/my.mjs +1 -1
  168. package/dist/locale/nb-no.js +1 -1
  169. package/dist/locale/nb-no.min.js +1 -1
  170. package/dist/locale/nb-no.min.mjs +1 -1
  171. package/dist/locale/nb-no.mjs +1 -1
  172. package/dist/locale/nl.js +1 -1
  173. package/dist/locale/nl.min.js +1 -1
  174. package/dist/locale/nl.min.mjs +1 -1
  175. package/dist/locale/nl.mjs +1 -1
  176. package/dist/locale/no.js +1 -1
  177. package/dist/locale/no.min.js +1 -1
  178. package/dist/locale/no.min.mjs +1 -1
  179. package/dist/locale/no.mjs +1 -1
  180. package/dist/locale/pa.js +1 -1
  181. package/dist/locale/pa.min.js +1 -1
  182. package/dist/locale/pa.min.mjs +1 -1
  183. package/dist/locale/pa.mjs +1 -1
  184. package/dist/locale/pl.js +1 -1
  185. package/dist/locale/pl.min.js +1 -1
  186. package/dist/locale/pl.min.mjs +1 -1
  187. package/dist/locale/pl.mjs +1 -1
  188. package/dist/locale/pt-br.js +1 -1
  189. package/dist/locale/pt-br.min.js +1 -1
  190. package/dist/locale/pt-br.min.mjs +1 -1
  191. package/dist/locale/pt-br.mjs +1 -1
  192. package/dist/locale/pt.js +1 -1
  193. package/dist/locale/pt.min.js +1 -1
  194. package/dist/locale/pt.min.mjs +1 -1
  195. package/dist/locale/pt.mjs +1 -1
  196. package/dist/locale/ro.js +1 -1
  197. package/dist/locale/ro.min.js +1 -1
  198. package/dist/locale/ro.min.mjs +1 -1
  199. package/dist/locale/ro.mjs +1 -1
  200. package/dist/locale/ru.js +1 -1
  201. package/dist/locale/ru.min.js +1 -1
  202. package/dist/locale/ru.min.mjs +1 -1
  203. package/dist/locale/ru.mjs +1 -1
  204. package/dist/locale/sk.js +1 -1
  205. package/dist/locale/sk.min.js +1 -1
  206. package/dist/locale/sk.min.mjs +1 -1
  207. package/dist/locale/sk.mjs +1 -1
  208. package/dist/locale/sl.js +1 -1
  209. package/dist/locale/sl.min.js +1 -1
  210. package/dist/locale/sl.min.mjs +1 -1
  211. package/dist/locale/sl.mjs +1 -1
  212. package/dist/locale/sr.js +1 -1
  213. package/dist/locale/sr.min.js +1 -1
  214. package/dist/locale/sr.min.mjs +1 -1
  215. package/dist/locale/sr.mjs +1 -1
  216. package/dist/locale/sv.js +1 -1
  217. package/dist/locale/sv.min.js +1 -1
  218. package/dist/locale/sv.min.mjs +1 -1
  219. package/dist/locale/sv.mjs +1 -1
  220. package/dist/locale/sw.js +1 -1
  221. package/dist/locale/sw.min.js +1 -1
  222. package/dist/locale/sw.min.mjs +1 -1
  223. package/dist/locale/sw.mjs +1 -1
  224. package/dist/locale/ta.js +1 -1
  225. package/dist/locale/ta.min.js +1 -1
  226. package/dist/locale/ta.min.mjs +1 -1
  227. package/dist/locale/ta.mjs +1 -1
  228. package/dist/locale/te.js +1 -1
  229. package/dist/locale/te.min.js +1 -1
  230. package/dist/locale/te.min.mjs +1 -1
  231. package/dist/locale/te.mjs +1 -1
  232. package/dist/locale/th.js +1 -1
  233. package/dist/locale/th.min.js +1 -1
  234. package/dist/locale/th.min.mjs +1 -1
  235. package/dist/locale/th.mjs +1 -1
  236. package/dist/locale/tk.js +1 -1
  237. package/dist/locale/tk.min.js +1 -1
  238. package/dist/locale/tk.min.mjs +1 -1
  239. package/dist/locale/tk.mjs +1 -1
  240. package/dist/locale/tr.js +1 -1
  241. package/dist/locale/tr.min.js +1 -1
  242. package/dist/locale/tr.min.mjs +1 -1
  243. package/dist/locale/tr.mjs +1 -1
  244. package/dist/locale/ug-cn.js +1 -1
  245. package/dist/locale/ug-cn.min.js +1 -1
  246. package/dist/locale/ug-cn.min.mjs +1 -1
  247. package/dist/locale/ug-cn.mjs +1 -1
  248. package/dist/locale/uk.js +1 -1
  249. package/dist/locale/uk.min.js +1 -1
  250. package/dist/locale/uk.min.mjs +1 -1
  251. package/dist/locale/uk.mjs +1 -1
  252. package/dist/locale/uz-uz.js +1 -1
  253. package/dist/locale/uz-uz.min.js +1 -1
  254. package/dist/locale/uz-uz.min.mjs +1 -1
  255. package/dist/locale/uz-uz.mjs +1 -1
  256. package/dist/locale/vi.js +1 -1
  257. package/dist/locale/vi.min.js +1 -1
  258. package/dist/locale/vi.min.mjs +1 -1
  259. package/dist/locale/vi.mjs +1 -1
  260. package/dist/locale/zh-cn.js +1 -1
  261. package/dist/locale/zh-cn.min.js +1 -1
  262. package/dist/locale/zh-cn.min.mjs +1 -1
  263. package/dist/locale/zh-cn.mjs +1 -1
  264. package/dist/locale/zh-hk.js +1 -1
  265. package/dist/locale/zh-hk.min.js +1 -1
  266. package/dist/locale/zh-hk.min.mjs +1 -1
  267. package/dist/locale/zh-hk.mjs +1 -1
  268. package/dist/locale/zh-mo.js +1 -1
  269. package/dist/locale/zh-mo.min.js +1 -1
  270. package/dist/locale/zh-mo.min.mjs +1 -1
  271. package/dist/locale/zh-mo.mjs +1 -1
  272. package/dist/locale/zh-tw.js +1 -1
  273. package/dist/locale/zh-tw.min.js +1 -1
  274. package/dist/locale/zh-tw.min.mjs +1 -1
  275. package/dist/locale/zh-tw.mjs +1 -1
  276. package/es/components/backtop/index.mjs +2 -2
  277. package/es/components/backtop/src/backtop.mjs +53 -21
  278. package/es/components/backtop/src/backtop.mjs.map +1 -1
  279. package/es/components/backtop/src/backtop2.mjs +21 -53
  280. package/es/components/backtop/src/backtop2.mjs.map +1 -1
  281. package/es/components/badge/index.mjs +2 -2
  282. package/es/components/badge/src/badge.mjs +71 -32
  283. package/es/components/badge/src/badge.mjs.map +1 -1
  284. package/es/components/badge/src/badge2.mjs +32 -71
  285. package/es/components/badge/src/badge2.mjs.map +1 -1
  286. package/es/components/breadcrumb/index.mjs +2 -2
  287. package/es/components/breadcrumb/src/breadcrumb-item.mjs +56 -8
  288. package/es/components/breadcrumb/src/breadcrumb-item.mjs.map +1 -1
  289. package/es/components/breadcrumb/src/breadcrumb-item2.mjs +8 -56
  290. package/es/components/breadcrumb/src/breadcrumb-item2.mjs.map +1 -1
  291. package/es/components/config-provider/src/config-provider-props.d.ts +7 -0
  292. package/es/components/config-provider/src/config-provider-props.mjs +3 -0
  293. package/es/components/config-provider/src/config-provider-props.mjs.map +1 -1
  294. package/es/components/config-provider/src/config-provider.d.ts +12 -0
  295. package/es/components/dialog/index.mjs +1 -1
  296. package/es/components/dialog/src/dialog-content.d.ts +3 -3
  297. package/es/components/dialog/src/dialog-content.mjs +12 -3
  298. package/es/components/dialog/src/dialog-content.mjs.map +1 -1
  299. package/es/components/dialog/src/dialog-content.vue.d.ts +9 -9
  300. package/es/components/dialog/src/dialog-content2.mjs +4 -4
  301. package/es/components/dialog/src/dialog-content2.mjs.map +1 -1
  302. package/es/components/dialog/src/dialog.d.ts +12 -5
  303. package/es/components/dialog/src/dialog.mjs +3 -3
  304. package/es/components/dialog/src/dialog.mjs.map +1 -1
  305. package/es/components/dialog/src/dialog.vue.d.ts +11 -11
  306. package/es/components/dialog/src/dialog2.mjs +6 -4
  307. package/es/components/dialog/src/dialog2.mjs.map +1 -1
  308. package/es/components/dialog/src/use-dialog.d.ts +4 -1
  309. package/es/components/dialog/src/use-dialog.mjs +37 -12
  310. package/es/components/dialog/src/use-dialog.mjs.map +1 -1
  311. package/es/components/drawer/src/drawer.d.ts +4 -4
  312. package/es/components/drawer/src/drawer.vue.d.ts +11 -11
  313. package/es/components/dropdown/src/dropdown.mjs +1 -1
  314. package/es/components/image/src/image.vue.d.ts +1 -1
  315. package/es/components/image-viewer/src/image-viewer.vue.d.ts +1 -1
  316. package/es/components/index.mjs +13 -13
  317. package/es/components/input/src/utils.mjs +3 -3
  318. package/es/components/input/src/utils.mjs.map +1 -1
  319. package/es/components/input-tag/src/input-tag.vue.d.ts +1 -1
  320. package/es/components/menu/index.mjs +2 -2
  321. package/es/components/menu/src/menu-item.mjs +100 -15
  322. package/es/components/menu/src/menu-item.mjs.map +1 -1
  323. package/es/components/menu/src/menu-item2.mjs +15 -100
  324. package/es/components/menu/src/menu-item2.mjs.map +1 -1
  325. package/es/components/message/src/message.vue.d.ts +1 -1
  326. package/es/components/message-box/src/index.vue.d.ts +1 -1
  327. package/es/components/notification/src/notification.vue.d.ts +1 -1
  328. package/es/components/pagination/src/components/pager.mjs +16 -210
  329. package/es/components/pagination/src/components/pager.mjs.map +1 -1
  330. package/es/components/pagination/src/components/pager2.mjs +210 -16
  331. package/es/components/pagination/src/components/pager2.mjs.map +1 -1
  332. package/es/components/pagination/src/pagination.mjs +1 -1
  333. package/es/components/popper/index.mjs +4 -4
  334. package/es/components/popper/src/content.mjs +130 -88
  335. package/es/components/popper/src/content.mjs.map +1 -1
  336. package/es/components/popper/src/content2.mjs +88 -130
  337. package/es/components/popper/src/content2.mjs.map +1 -1
  338. package/es/components/popper/src/popper.mjs +32 -22
  339. package/es/components/popper/src/popper.mjs.map +1 -1
  340. package/es/components/popper/src/popper2.mjs +22 -32
  341. package/es/components/popper/src/popper2.mjs.map +1 -1
  342. package/es/components/radio/index.mjs +2 -2
  343. package/es/components/radio/src/radio-group.mjs +34 -65
  344. package/es/components/radio/src/radio-group.mjs.map +1 -1
  345. package/es/components/radio/src/radio-group2.mjs +65 -34
  346. package/es/components/radio/src/radio-group2.mjs.map +1 -1
  347. package/es/components/slider/src/button.mjs +91 -19
  348. package/es/components/slider/src/button.mjs.map +1 -1
  349. package/es/components/slider/src/button2.mjs +19 -91
  350. package/es/components/slider/src/button2.mjs.map +1 -1
  351. package/es/components/slider/src/slider2.mjs +1 -1
  352. package/es/components/statistic/index.mjs +2 -2
  353. package/es/components/statistic/src/statistic.mjs +25 -69
  354. package/es/components/statistic/src/statistic.mjs.map +1 -1
  355. package/es/components/statistic/src/statistic2.mjs +69 -25
  356. package/es/components/statistic/src/statistic2.mjs.map +1 -1
  357. package/es/components/switch/index.mjs +2 -2
  358. package/es/components/switch/src/switch.mjs +72 -227
  359. package/es/components/switch/src/switch.mjs.map +1 -1
  360. package/es/components/switch/src/switch2.mjs +227 -72
  361. package/es/components/switch/src/switch2.mjs.map +1 -1
  362. package/es/components/tabs/index.mjs +1 -1
  363. package/es/components/tabs/src/tab-bar.mjs +87 -11
  364. package/es/components/tabs/src/tab-bar.mjs.map +1 -1
  365. package/es/components/tabs/src/tab-bar2.mjs +11 -87
  366. package/es/components/tabs/src/tab-bar2.mjs.map +1 -1
  367. package/es/components/tabs/src/tab-nav.mjs +1 -1
  368. package/es/components/tooltip/src/content.mjs +1 -1
  369. package/es/components/tooltip/src/content2.mjs +1 -1
  370. package/es/components/tooltip/src/tooltip.mjs +1 -1
  371. package/es/components/tooltip-v2/index.mjs +1 -1
  372. package/es/components/tooltip-v2/src/root.mjs +17 -79
  373. package/es/components/tooltip-v2/src/root.mjs.map +1 -1
  374. package/es/components/tooltip-v2/src/root2.mjs +79 -17
  375. package/es/components/tooltip-v2/src/root2.mjs.map +1 -1
  376. package/es/components/tooltip-v2/src/tooltip.mjs +1 -1
  377. package/es/components/tooltip-v2/src/tooltip2.mjs +2 -2
  378. package/es/components/tour/index.mjs +2 -2
  379. package/es/components/tour/src/tour.mjs +69 -154
  380. package/es/components/tour/src/tour.mjs.map +1 -1
  381. package/es/components/tour/src/tour.vue.d.ts +1 -1
  382. package/es/components/tour/src/tour2.mjs +154 -69
  383. package/es/components/tour/src/tour2.mjs.map +1 -1
  384. package/es/components/tree/src/tree.vue.d.ts +1 -1
  385. package/es/index.d.ts +66 -38
  386. package/es/index.mjs +13 -13
  387. package/es/version.d.ts +1 -1
  388. package/es/version.mjs +1 -1
  389. package/es/version.mjs.map +1 -1
  390. package/lib/components/backtop/index.js +2 -2
  391. package/lib/components/backtop/src/backtop.js +53 -22
  392. package/lib/components/backtop/src/backtop.js.map +1 -1
  393. package/lib/components/backtop/src/backtop2.js +22 -53
  394. package/lib/components/backtop/src/backtop2.js.map +1 -1
  395. package/lib/components/badge/index.js +2 -2
  396. package/lib/components/badge/src/badge.js +71 -32
  397. package/lib/components/badge/src/badge.js.map +1 -1
  398. package/lib/components/badge/src/badge2.js +32 -71
  399. package/lib/components/badge/src/badge2.js.map +1 -1
  400. package/lib/components/breadcrumb/index.js +2 -2
  401. package/lib/components/breadcrumb/src/breadcrumb-item.js +56 -8
  402. package/lib/components/breadcrumb/src/breadcrumb-item.js.map +1 -1
  403. package/lib/components/breadcrumb/src/breadcrumb-item2.js +8 -56
  404. package/lib/components/breadcrumb/src/breadcrumb-item2.js.map +1 -1
  405. package/lib/components/config-provider/src/config-provider-props.d.ts +7 -0
  406. package/lib/components/config-provider/src/config-provider-props.js +3 -0
  407. package/lib/components/config-provider/src/config-provider-props.js.map +1 -1
  408. package/lib/components/config-provider/src/config-provider.d.ts +12 -0
  409. package/lib/components/dialog/index.js +1 -0
  410. package/lib/components/dialog/index.js.map +1 -1
  411. package/lib/components/dialog/src/dialog-content.d.ts +3 -3
  412. package/lib/components/dialog/src/dialog-content.js +12 -3
  413. package/lib/components/dialog/src/dialog-content.js.map +1 -1
  414. package/lib/components/dialog/src/dialog-content.vue.d.ts +9 -9
  415. package/lib/components/dialog/src/dialog-content2.js +4 -4
  416. package/lib/components/dialog/src/dialog-content2.js.map +1 -1
  417. package/lib/components/dialog/src/dialog.d.ts +12 -5
  418. package/lib/components/dialog/src/dialog.js +3 -2
  419. package/lib/components/dialog/src/dialog.js.map +1 -1
  420. package/lib/components/dialog/src/dialog.vue.d.ts +11 -11
  421. package/lib/components/dialog/src/dialog2.js +6 -4
  422. package/lib/components/dialog/src/dialog2.js.map +1 -1
  423. package/lib/components/dialog/src/use-dialog.d.ts +4 -1
  424. package/lib/components/dialog/src/use-dialog.js +37 -12
  425. package/lib/components/dialog/src/use-dialog.js.map +1 -1
  426. package/lib/components/drawer/src/drawer.d.ts +4 -4
  427. package/lib/components/drawer/src/drawer.vue.d.ts +11 -11
  428. package/lib/components/dropdown/src/dropdown.js +1 -1
  429. package/lib/components/image/src/image.vue.d.ts +1 -1
  430. package/lib/components/image-viewer/src/image-viewer.vue.d.ts +1 -1
  431. package/lib/components/index.js +13 -12
  432. package/lib/components/index.js.map +1 -1
  433. package/lib/components/input/src/utils.js +3 -3
  434. package/lib/components/input/src/utils.js.map +1 -1
  435. package/lib/components/input-tag/src/input-tag.vue.d.ts +1 -1
  436. package/lib/components/menu/index.js +2 -2
  437. package/lib/components/menu/src/menu-item.js +100 -16
  438. package/lib/components/menu/src/menu-item.js.map +1 -1
  439. package/lib/components/menu/src/menu-item2.js +16 -100
  440. package/lib/components/menu/src/menu-item2.js.map +1 -1
  441. package/lib/components/message/src/message.vue.d.ts +1 -1
  442. package/lib/components/message-box/src/index.vue.d.ts +1 -1
  443. package/lib/components/notification/src/notification.vue.d.ts +1 -1
  444. package/lib/components/pagination/src/components/pager.js +16 -210
  445. package/lib/components/pagination/src/components/pager.js.map +1 -1
  446. package/lib/components/pagination/src/components/pager2.js +210 -16
  447. package/lib/components/pagination/src/components/pager2.js.map +1 -1
  448. package/lib/components/pagination/src/pagination.js +1 -1
  449. package/lib/components/popper/index.js +4 -4
  450. package/lib/components/popper/src/content.js +130 -93
  451. package/lib/components/popper/src/content.js.map +1 -1
  452. package/lib/components/popper/src/content2.js +93 -130
  453. package/lib/components/popper/src/content2.js.map +1 -1
  454. package/lib/components/popper/src/popper.js +32 -25
  455. package/lib/components/popper/src/popper.js.map +1 -1
  456. package/lib/components/popper/src/popper2.js +25 -32
  457. package/lib/components/popper/src/popper2.js.map +1 -1
  458. package/lib/components/radio/index.js +2 -2
  459. package/lib/components/radio/src/radio-group.js +35 -65
  460. package/lib/components/radio/src/radio-group.js.map +1 -1
  461. package/lib/components/radio/src/radio-group2.js +65 -35
  462. package/lib/components/radio/src/radio-group2.js.map +1 -1
  463. package/lib/components/slider/src/button.js +91 -20
  464. package/lib/components/slider/src/button.js.map +1 -1
  465. package/lib/components/slider/src/button2.js +20 -91
  466. package/lib/components/slider/src/button2.js.map +1 -1
  467. package/lib/components/slider/src/slider2.js +1 -1
  468. package/lib/components/statistic/index.js +2 -2
  469. package/lib/components/statistic/src/statistic.js +25 -69
  470. package/lib/components/statistic/src/statistic.js.map +1 -1
  471. package/lib/components/statistic/src/statistic2.js +69 -25
  472. package/lib/components/statistic/src/statistic2.js.map +1 -1
  473. package/lib/components/switch/index.js +2 -2
  474. package/lib/components/switch/src/switch.js +72 -226
  475. package/lib/components/switch/src/switch.js.map +1 -1
  476. package/lib/components/switch/src/switch2.js +226 -72
  477. package/lib/components/switch/src/switch2.js.map +1 -1
  478. package/lib/components/tabs/index.js +1 -1
  479. package/lib/components/tabs/src/tab-bar.js +87 -11
  480. package/lib/components/tabs/src/tab-bar.js.map +1 -1
  481. package/lib/components/tabs/src/tab-bar2.js +11 -87
  482. package/lib/components/tabs/src/tab-bar2.js.map +1 -1
  483. package/lib/components/tabs/src/tab-nav.js +1 -1
  484. package/lib/components/tooltip/src/content.js +1 -1
  485. package/lib/components/tooltip/src/content2.js +1 -1
  486. package/lib/components/tooltip/src/tooltip.js +1 -1
  487. package/lib/components/tooltip-v2/index.js +1 -1
  488. package/lib/components/tooltip-v2/src/root.js +17 -79
  489. package/lib/components/tooltip-v2/src/root.js.map +1 -1
  490. package/lib/components/tooltip-v2/src/root2.js +79 -17
  491. package/lib/components/tooltip-v2/src/root2.js.map +1 -1
  492. package/lib/components/tooltip-v2/src/tooltip.js +1 -1
  493. package/lib/components/tooltip-v2/src/tooltip2.js +2 -2
  494. package/lib/components/tour/index.js +2 -2
  495. package/lib/components/tour/src/tour.js +69 -153
  496. package/lib/components/tour/src/tour.js.map +1 -1
  497. package/lib/components/tour/src/tour.vue.d.ts +1 -1
  498. package/lib/components/tour/src/tour2.js +153 -69
  499. package/lib/components/tour/src/tour2.js.map +1 -1
  500. package/lib/components/tree/src/tree.vue.d.ts +1 -1
  501. package/lib/index.d.ts +66 -38
  502. package/lib/index.js +13 -12
  503. package/lib/index.js.map +1 -1
  504. package/lib/version.d.ts +1 -1
  505. package/lib/version.js +1 -1
  506. package/lib/version.js.map +1 -1
  507. package/package.json +2 -2
  508. package/tags.json +1 -1
  509. package/web-types.json +1 -1
@@ -1,4 +1,4 @@
1
- /*! Element Plus v0.0.20250808 */
1
+ /*! Element Plus v0.0.20250810 */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue')) :
@@ -3040,7 +3040,7 @@
3040
3040
  return number;
3041
3041
  }
3042
3042
 
3043
- function clamp(number, lower, upper) {
3043
+ function clamp$1(number, lower, upper) {
3044
3044
  if (upper === void 0) {
3045
3045
  upper = lower;
3046
3046
  lower = void 0;
@@ -4649,7 +4649,7 @@
4649
4649
  }
4650
4650
 
4651
4651
  var WRAP_FLIP_FLAG = 512;
4652
- function flip$1(func) {
4652
+ function flip$2(func) {
4653
4653
  return createWrap(func, WRAP_FLIP_FLAG);
4654
4654
  }
4655
4655
 
@@ -4984,7 +4984,7 @@
4984
4984
  var nodeIsDate = nodeUtil && nodeUtil.isDate;
4985
4985
  var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
4986
4986
 
4987
- function isElement$2(value) {
4987
+ function isElement$3(value) {
4988
4988
  return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
4989
4989
  }
4990
4990
 
@@ -5195,7 +5195,7 @@
5195
5195
  return result;
5196
5196
  }
5197
5197
 
5198
- function max$3(array) {
5198
+ function max$4(array) {
5199
5199
  return array && array.length ? baseExtremum(array, identity, baseGt) : void 0;
5200
5200
  }
5201
5201
 
@@ -5244,7 +5244,7 @@
5244
5244
  };
5245
5245
  });
5246
5246
 
5247
- function min$3(array) {
5247
+ function min$4(array) {
5248
5248
  return array && array.length ? baseExtremum(array, identity, baseLt) : void 0;
5249
5249
  }
5250
5250
 
@@ -5963,7 +5963,7 @@
5963
5963
  return array == null ? array : nativeReverse.call(array);
5964
5964
  }
5965
5965
 
5966
- var round$1 = createRound("round");
5966
+ var round$2 = createRound("round");
5967
5967
 
5968
5968
  function arraySample(array) {
5969
5969
  var length = array.length;
@@ -6034,7 +6034,7 @@
6034
6034
 
6035
6035
  var mapTag = "[object Map]";
6036
6036
  var setTag = "[object Set]";
6037
- function size(collection) {
6037
+ function size$1(collection) {
6038
6038
  if (collection == null) {
6039
6039
  return 0;
6040
6040
  }
@@ -6970,7 +6970,7 @@
6970
6970
  sample,
6971
6971
  sampleSize,
6972
6972
  shuffle,
6973
- size,
6973
+ size: size$1,
6974
6974
  some,
6975
6975
  sortBy
6976
6976
  };
@@ -6990,7 +6990,7 @@
6990
6990
  debounce,
6991
6991
  defer,
6992
6992
  delay,
6993
- flip: flip$1,
6993
+ flip: flip$2,
6994
6994
  memoize,
6995
6995
  negate,
6996
6996
  once,
@@ -7023,7 +7023,7 @@
7023
7023
  isBoolean: isBoolean$1,
7024
7024
  isBuffer,
7025
7025
  isDate,
7026
- isElement: isElement$2,
7026
+ isElement: isElement$3,
7027
7027
  isEmpty: isEmpty$1,
7028
7028
  isEqual: isEqual$1,
7029
7029
  isEqualWith,
@@ -7069,21 +7069,21 @@
7069
7069
  ceil,
7070
7070
  divide,
7071
7071
  floor: floor$1,
7072
- max: max$3,
7072
+ max: max$4,
7073
7073
  maxBy,
7074
7074
  mean,
7075
7075
  meanBy,
7076
- min: min$3,
7076
+ min: min$4,
7077
7077
  minBy,
7078
7078
  multiply,
7079
- round: round$1,
7079
+ round: round$2,
7080
7080
  subtract,
7081
7081
  sum: sum$1,
7082
7082
  sumBy
7083
7083
  };
7084
7084
 
7085
7085
  var number = {
7086
- clamp,
7086
+ clamp: clamp$1,
7087
7087
  inRange,
7088
7088
  random
7089
7089
  };
@@ -7811,7 +7811,7 @@
7811
7811
  const isBoolean = (val) => typeof val === "boolean";
7812
7812
  const isNumber = (val) => typeof val === "number";
7813
7813
  const isEmpty = (val) => !val && val !== 0 || isArray$1(val) && val.length === 0 || isObject$1(val) && !Object.keys(val).length;
7814
- const isElement$1 = (e) => {
7814
+ const isElement$2 = (e) => {
7815
7815
  if (typeof Element === "undefined")
7816
7816
  return false;
7817
7817
  return e instanceof Element;
@@ -10115,36 +10115,156 @@
10115
10115
  };
10116
10116
  };
10117
10117
 
10118
- function getSide(placement) {
10118
+ /**
10119
+ * Custom positioning reference element.
10120
+ * @see https://floating-ui.com/docs/virtual-elements
10121
+ */
10122
+
10123
+ const sides = ['top', 'right', 'bottom', 'left'];
10124
+ const alignments = ['start', 'end'];
10125
+ const placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), []);
10126
+ const min$3 = Math.min;
10127
+ const max$3 = Math.max;
10128
+ const round$1 = Math.round;
10129
+ const createCoords = v => ({
10130
+ x: v,
10131
+ y: v
10132
+ });
10133
+ const oppositeSideMap = {
10134
+ left: 'right',
10135
+ right: 'left',
10136
+ bottom: 'top',
10137
+ top: 'bottom'
10138
+ };
10139
+ const oppositeAlignmentMap = {
10140
+ start: 'end',
10141
+ end: 'start'
10142
+ };
10143
+ function clamp(start, value, end) {
10144
+ return max$3(start, min$3(value, end));
10145
+ }
10146
+ function evaluate(value, param) {
10147
+ return typeof value === 'function' ? value(param) : value;
10148
+ }
10149
+ function getSide$1(placement) {
10119
10150
  return placement.split('-')[0];
10120
10151
  }
10121
-
10122
- function getAlignment(placement) {
10152
+ function getAlignment$1(placement) {
10123
10153
  return placement.split('-')[1];
10124
10154
  }
10125
-
10126
- function getMainAxisFromPlacement(placement) {
10127
- return ['top', 'bottom'].includes(getSide(placement)) ? 'x' : 'y';
10155
+ function getOppositeAxis(axis) {
10156
+ return axis === 'x' ? 'y' : 'x';
10128
10157
  }
10129
-
10130
- function getLengthFromAxis(axis) {
10158
+ function getAxisLength(axis) {
10131
10159
  return axis === 'y' ? 'height' : 'width';
10132
10160
  }
10161
+ function getSideAxis(placement) {
10162
+ return ['top', 'bottom'].includes(getSide$1(placement)) ? 'y' : 'x';
10163
+ }
10164
+ function getAlignmentAxis(placement) {
10165
+ return getOppositeAxis(getSideAxis(placement));
10166
+ }
10167
+ function getAlignmentSides$1(placement, rects, rtl) {
10168
+ if (rtl === void 0) {
10169
+ rtl = false;
10170
+ }
10171
+ const alignment = getAlignment$1(placement);
10172
+ const alignmentAxis = getAlignmentAxis(placement);
10173
+ const length = getAxisLength(alignmentAxis);
10174
+ let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
10175
+ if (rects.reference[length] > rects.floating[length]) {
10176
+ mainAlignmentSide = getOppositePlacement$1(mainAlignmentSide);
10177
+ }
10178
+ return [mainAlignmentSide, getOppositePlacement$1(mainAlignmentSide)];
10179
+ }
10180
+ function getExpandedPlacements$1(placement) {
10181
+ const oppositePlacement = getOppositePlacement$1(placement);
10182
+ return [getOppositeAlignmentPlacement$1(placement), oppositePlacement, getOppositeAlignmentPlacement$1(oppositePlacement)];
10183
+ }
10184
+ function getOppositeAlignmentPlacement$1(placement) {
10185
+ return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
10186
+ }
10187
+ function getSideList(side, isStart, rtl) {
10188
+ const lr = ['left', 'right'];
10189
+ const rl = ['right', 'left'];
10190
+ const tb = ['top', 'bottom'];
10191
+ const bt = ['bottom', 'top'];
10192
+ switch (side) {
10193
+ case 'top':
10194
+ case 'bottom':
10195
+ if (rtl) return isStart ? rl : lr;
10196
+ return isStart ? lr : rl;
10197
+ case 'left':
10198
+ case 'right':
10199
+ return isStart ? tb : bt;
10200
+ default:
10201
+ return [];
10202
+ }
10203
+ }
10204
+ function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
10205
+ const alignment = getAlignment$1(placement);
10206
+ let list = getSideList(getSide$1(placement), direction === 'start', rtl);
10207
+ if (alignment) {
10208
+ list = list.map(side => side + "-" + alignment);
10209
+ if (flipAlignment) {
10210
+ list = list.concat(list.map(getOppositeAlignmentPlacement$1));
10211
+ }
10212
+ }
10213
+ return list;
10214
+ }
10215
+ function getOppositePlacement$1(placement) {
10216
+ return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
10217
+ }
10218
+ function expandPaddingObject$1(padding) {
10219
+ return {
10220
+ top: 0,
10221
+ right: 0,
10222
+ bottom: 0,
10223
+ left: 0,
10224
+ ...padding
10225
+ };
10226
+ }
10227
+ function getPaddingObject(padding) {
10228
+ return typeof padding !== 'number' ? expandPaddingObject$1(padding) : {
10229
+ top: padding,
10230
+ right: padding,
10231
+ bottom: padding,
10232
+ left: padding
10233
+ };
10234
+ }
10235
+ function rectToClientRect$1(rect) {
10236
+ const {
10237
+ x,
10238
+ y,
10239
+ width,
10240
+ height
10241
+ } = rect;
10242
+ return {
10243
+ width,
10244
+ height,
10245
+ top: y,
10246
+ left: x,
10247
+ right: x + width,
10248
+ bottom: y + height,
10249
+ x,
10250
+ y
10251
+ };
10252
+ }
10133
10253
 
10134
- function computeCoordsFromPlacement(_ref, placement, rtl) {
10254
+ function computeCoordsFromPlacement$1(_ref, placement, rtl) {
10135
10255
  let {
10136
10256
  reference,
10137
10257
  floating
10138
10258
  } = _ref;
10259
+ const sideAxis = getSideAxis(placement);
10260
+ const alignmentAxis = getAlignmentAxis(placement);
10261
+ const alignLength = getAxisLength(alignmentAxis);
10262
+ const side = getSide$1(placement);
10263
+ const isVertical = sideAxis === 'y';
10139
10264
  const commonX = reference.x + reference.width / 2 - floating.width / 2;
10140
10265
  const commonY = reference.y + reference.height / 2 - floating.height / 2;
10141
- const mainAxis = getMainAxisFromPlacement(placement);
10142
- const length = getLengthFromAxis(mainAxis);
10143
- const commonAlign = reference[length] / 2 - floating[length] / 2;
10144
- const side = getSide(placement);
10145
- const isVertical = mainAxis === 'x';
10266
+ const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
10146
10267
  let coords;
10147
-
10148
10268
  switch (side) {
10149
10269
  case 'top':
10150
10270
  coords = {
@@ -10152,65 +10272,57 @@
10152
10272
  y: reference.y - floating.height
10153
10273
  };
10154
10274
  break;
10155
-
10156
10275
  case 'bottom':
10157
10276
  coords = {
10158
10277
  x: commonX,
10159
10278
  y: reference.y + reference.height
10160
10279
  };
10161
10280
  break;
10162
-
10163
10281
  case 'right':
10164
10282
  coords = {
10165
10283
  x: reference.x + reference.width,
10166
10284
  y: commonY
10167
10285
  };
10168
10286
  break;
10169
-
10170
10287
  case 'left':
10171
10288
  coords = {
10172
10289
  x: reference.x - floating.width,
10173
10290
  y: commonY
10174
10291
  };
10175
10292
  break;
10176
-
10177
10293
  default:
10178
10294
  coords = {
10179
10295
  x: reference.x,
10180
10296
  y: reference.y
10181
10297
  };
10182
10298
  }
10183
-
10184
- switch (getAlignment(placement)) {
10299
+ switch (getAlignment$1(placement)) {
10185
10300
  case 'start':
10186
- coords[mainAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
10301
+ coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
10187
10302
  break;
10188
-
10189
10303
  case 'end':
10190
- coords[mainAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
10304
+ coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
10191
10305
  break;
10192
10306
  }
10193
-
10194
10307
  return coords;
10195
10308
  }
10196
10309
 
10197
10310
  /**
10198
10311
  * Computes the `x` and `y` coordinates that will place the floating element
10199
- * next to a reference element when it is given a certain positioning strategy.
10312
+ * next to a given reference element.
10200
10313
  *
10201
10314
  * This export does not have any `platform` interface logic. You will need to
10202
10315
  * write one for the platform you are using Floating UI with.
10203
10316
  */
10204
-
10205
- const computePosition$1 = async (reference, floating, config) => {
10317
+ const computePosition$3 = async (reference, floating, config) => {
10206
10318
  const {
10207
10319
  placement = 'bottom',
10208
10320
  strategy = 'absolute',
10209
10321
  middleware = [],
10210
10322
  platform
10211
10323
  } = config;
10324
+ const validMiddleware = middleware.filter(Boolean);
10212
10325
  const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
10213
-
10214
10326
  let rects = await platform.getElementRects({
10215
10327
  reference,
10216
10328
  floating,
@@ -10219,16 +10331,15 @@
10219
10331
  let {
10220
10332
  x,
10221
10333
  y
10222
- } = computeCoordsFromPlacement(rects, placement, rtl);
10334
+ } = computeCoordsFromPlacement$1(rects, placement, rtl);
10223
10335
  let statefulPlacement = placement;
10224
10336
  let middlewareData = {};
10225
10337
  let resetCount = 0;
10226
-
10227
- for (let i = 0; i < middleware.length; i++) {
10338
+ for (let i = 0; i < validMiddleware.length; i++) {
10228
10339
  const {
10229
10340
  name,
10230
10341
  fn
10231
- } = middleware[i];
10342
+ } = validMiddleware[i];
10232
10343
  const {
10233
10344
  x: nextX,
10234
10345
  y: nextY,
@@ -10250,20 +10361,19 @@
10250
10361
  });
10251
10362
  x = nextX != null ? nextX : x;
10252
10363
  y = nextY != null ? nextY : y;
10253
- middlewareData = { ...middlewareData,
10254
- [name]: { ...middlewareData[name],
10364
+ middlewareData = {
10365
+ ...middlewareData,
10366
+ [name]: {
10367
+ ...middlewareData[name],
10255
10368
  ...data
10256
10369
  }
10257
10370
  };
10258
-
10259
10371
  if (reset && resetCount <= 50) {
10260
10372
  resetCount++;
10261
-
10262
10373
  if (typeof reset === 'object') {
10263
10374
  if (reset.placement) {
10264
10375
  statefulPlacement = reset.placement;
10265
10376
  }
10266
-
10267
10377
  if (reset.rects) {
10268
10378
  rects = reset.rects === true ? await platform.getElementRects({
10269
10379
  reference,
@@ -10271,18 +10381,14 @@
10271
10381
  strategy
10272
10382
  }) : reset.rects;
10273
10383
  }
10274
-
10275
10384
  ({
10276
10385
  x,
10277
10386
  y
10278
- } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
10387
+ } = computeCoordsFromPlacement$1(rects, statefulPlacement, rtl));
10279
10388
  }
10280
-
10281
10389
  i = -1;
10282
- continue;
10283
10390
  }
10284
10391
  }
10285
-
10286
10392
  return {
10287
10393
  x,
10288
10394
  y,
@@ -10292,49 +10398,19 @@
10292
10398
  };
10293
10399
  };
10294
10400
 
10295
- function expandPaddingObject(padding) {
10296
- return {
10297
- top: 0,
10298
- right: 0,
10299
- bottom: 0,
10300
- left: 0,
10301
- ...padding
10302
- };
10303
- }
10304
-
10305
- function getSideObjectFromPadding(padding) {
10306
- return typeof padding !== 'number' ? expandPaddingObject(padding) : {
10307
- top: padding,
10308
- right: padding,
10309
- bottom: padding,
10310
- left: padding
10311
- };
10312
- }
10313
-
10314
- function rectToClientRect(rect) {
10315
- return { ...rect,
10316
- top: rect.y,
10317
- left: rect.x,
10318
- right: rect.x + rect.width,
10319
- bottom: rect.y + rect.height
10320
- };
10321
- }
10322
-
10323
10401
  /**
10324
10402
  * Resolves with an object of overflow side offsets that determine how much the
10325
- * element is overflowing a given clipping boundary.
10403
+ * element is overflowing a given clipping boundary on each side.
10326
10404
  * - positive = overflowing the boundary by that number of pixels
10327
10405
  * - negative = how many pixels left before it will overflow
10328
10406
  * - 0 = lies flush with the boundary
10329
10407
  * @see https://floating-ui.com/docs/detectOverflow
10330
10408
  */
10331
- async function detectOverflow(middlewareArguments, options) {
10409
+ async function detectOverflow$1(state, options) {
10332
10410
  var _await$platform$isEle;
10333
-
10334
10411
  if (options === void 0) {
10335
10412
  options = {};
10336
10413
  }
10337
-
10338
10414
  const {
10339
10415
  x,
10340
10416
  y,
@@ -10342,176 +10418,251 @@
10342
10418
  rects,
10343
10419
  elements,
10344
10420
  strategy
10345
- } = middlewareArguments;
10421
+ } = state;
10346
10422
  const {
10347
10423
  boundary = 'clippingAncestors',
10348
10424
  rootBoundary = 'viewport',
10349
10425
  elementContext = 'floating',
10350
10426
  altBoundary = false,
10351
10427
  padding = 0
10352
- } = options;
10353
- const paddingObject = getSideObjectFromPadding(padding);
10428
+ } = evaluate(options, state);
10429
+ const paddingObject = getPaddingObject(padding);
10354
10430
  const altContext = elementContext === 'floating' ? 'reference' : 'floating';
10355
10431
  const element = elements[altBoundary ? altContext : elementContext];
10356
- const clippingClientRect = rectToClientRect(await platform.getClippingRect({
10432
+ const clippingClientRect = rectToClientRect$1(await platform.getClippingRect({
10357
10433
  element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
10358
10434
  boundary,
10359
10435
  rootBoundary,
10360
10436
  strategy
10361
10437
  }));
10362
- const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
10363
- rect: elementContext === 'floating' ? { ...rects.floating,
10364
- x,
10365
- y
10366
- } : rects.reference,
10367
- offsetParent: await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)),
10438
+ const rect = elementContext === 'floating' ? {
10439
+ x,
10440
+ y,
10441
+ width: rects.floating.width,
10442
+ height: rects.floating.height
10443
+ } : rects.reference;
10444
+ const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
10445
+ const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
10446
+ x: 1,
10447
+ y: 1
10448
+ } : {
10449
+ x: 1,
10450
+ y: 1
10451
+ };
10452
+ const elementClientRect = rectToClientRect$1(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
10453
+ elements,
10454
+ rect,
10455
+ offsetParent,
10368
10456
  strategy
10369
- }) : rects[elementContext]);
10457
+ }) : rect);
10370
10458
  return {
10371
- top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
10372
- bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
10373
- left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
10374
- right: elementClientRect.right - clippingClientRect.right + paddingObject.right
10459
+ top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
10460
+ bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
10461
+ left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
10462
+ right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
10375
10463
  };
10376
10464
  }
10377
10465
 
10378
- const min$2 = Math.min;
10379
- const max$2 = Math.max;
10380
-
10381
- function within(min$1, value, max$1) {
10382
- return max$2(min$1, min$2(value, max$1));
10383
- }
10384
-
10385
10466
  /**
10386
- * Positions an inner element of the floating element such that it is centered
10387
- * to the reference element.
10467
+ * Provides data to position an inner element of the floating element so that it
10468
+ * appears centered to the reference element.
10388
10469
  * @see https://floating-ui.com/docs/arrow
10389
10470
  */
10390
- const arrow = options => ({
10471
+ const arrow$2 = options => ({
10391
10472
  name: 'arrow',
10392
10473
  options,
10393
-
10394
- async fn(middlewareArguments) {
10395
- // Since `element` is required, we don't Partial<> the type
10396
- const {
10397
- element,
10398
- padding = 0
10399
- } = options != null ? options : {};
10474
+ async fn(state) {
10400
10475
  const {
10401
10476
  x,
10402
10477
  y,
10403
10478
  placement,
10404
10479
  rects,
10405
- platform
10406
- } = middlewareArguments;
10407
-
10480
+ platform,
10481
+ elements,
10482
+ middlewareData
10483
+ } = state;
10484
+ // Since `element` is required, we don't Partial<> the type.
10485
+ const {
10486
+ element,
10487
+ padding = 0
10488
+ } = evaluate(options, state) || {};
10408
10489
  if (element == null) {
10409
-
10410
10490
  return {};
10411
10491
  }
10412
-
10413
- const paddingObject = getSideObjectFromPadding(padding);
10492
+ const paddingObject = getPaddingObject(padding);
10414
10493
  const coords = {
10415
10494
  x,
10416
10495
  y
10417
10496
  };
10418
- const axis = getMainAxisFromPlacement(placement);
10419
- const alignment = getAlignment(placement);
10420
- const length = getLengthFromAxis(axis);
10497
+ const axis = getAlignmentAxis(placement);
10498
+ const length = getAxisLength(axis);
10421
10499
  const arrowDimensions = await platform.getDimensions(element);
10422
- const minProp = axis === 'y' ? 'top' : 'left';
10423
- const maxProp = axis === 'y' ? 'bottom' : 'right';
10500
+ const isYAxis = axis === 'y';
10501
+ const minProp = isYAxis ? 'top' : 'left';
10502
+ const maxProp = isYAxis ? 'bottom' : 'right';
10503
+ const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';
10424
10504
  const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
10425
10505
  const startDiff = coords[axis] - rects.reference[axis];
10426
10506
  const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
10427
- let clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
10507
+ let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
10428
10508
 
10429
- if (clientSize === 0) {
10430
- clientSize = rects.floating[length];
10509
+ // DOM platform can return `window` as the `offsetParent`.
10510
+ if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {
10511
+ clientSize = elements.floating[clientProp] || rects.floating[length];
10431
10512
  }
10513
+ const centerToReference = endDiff / 2 - startDiff / 2;
10432
10514
 
10433
- const centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the floating element if the center
10434
- // point is outside the floating element's bounds
10515
+ // If the padding is large enough that it causes the arrow to no longer be
10516
+ // centered, modify the padding so that it is centered.
10517
+ const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
10518
+ const minPadding = min$3(paddingObject[minProp], largestPossiblePadding);
10519
+ const maxPadding = min$3(paddingObject[maxProp], largestPossiblePadding);
10435
10520
 
10436
- const min = paddingObject[minProp];
10437
- const max = clientSize - arrowDimensions[length] - paddingObject[maxProp];
10521
+ // Make sure the arrow doesn't overflow the floating element if the center
10522
+ // point is outside the floating element's bounds.
10523
+ const min$1 = minPadding;
10524
+ const max = clientSize - arrowDimensions[length] - maxPadding;
10438
10525
  const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
10439
- const offset = within(min, center, max); // Make sure that arrow points at the reference
10440
-
10441
- const alignmentPadding = alignment === 'start' ? paddingObject[minProp] : paddingObject[maxProp];
10442
- const shouldAddOffset = alignmentPadding > 0 && center !== offset && rects.reference[length] <= rects.floating[length];
10443
- const alignmentOffset = shouldAddOffset ? center < min ? min - center : max - center : 0;
10526
+ const offset = clamp(min$1, center, max);
10527
+
10528
+ // If the reference is small enough that the arrow's padding causes it to
10529
+ // to point to nothing for an aligned placement, adjust the offset of the
10530
+ // floating element itself. To ensure `shift()` continues to take action,
10531
+ // a single reset is performed when this is true.
10532
+ const shouldAddOffset = !middlewareData.arrow && getAlignment$1(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
10533
+ const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;
10444
10534
  return {
10445
- [axis]: coords[axis] - alignmentOffset,
10535
+ [axis]: coords[axis] + alignmentOffset,
10446
10536
  data: {
10447
10537
  [axis]: offset,
10448
- centerOffset: center - offset
10449
- }
10538
+ centerOffset: center - offset - alignmentOffset,
10539
+ ...(shouldAddOffset && {
10540
+ alignmentOffset
10541
+ })
10542
+ },
10543
+ reset: shouldAddOffset
10450
10544
  };
10451
10545
  }
10452
-
10453
10546
  });
10454
10547
 
10455
- const hash$1 = {
10456
- left: 'right',
10457
- right: 'left',
10458
- bottom: 'top',
10459
- top: 'bottom'
10460
- };
10461
- function getOppositePlacement(placement) {
10462
- return placement.replace(/left|right|bottom|top/g, matched => hash$1[matched]);
10548
+ function getPlacementList(alignment, autoAlignment, allowedPlacements) {
10549
+ const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment$1(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment$1(placement) !== alignment)] : allowedPlacements.filter(placement => getSide$1(placement) === placement);
10550
+ return allowedPlacementsSortedByAlignment.filter(placement => {
10551
+ if (alignment) {
10552
+ return getAlignment$1(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement$1(placement) !== placement : false);
10553
+ }
10554
+ return true;
10555
+ });
10463
10556
  }
10464
-
10465
- function getAlignmentSides(placement, rects, rtl) {
10466
- if (rtl === void 0) {
10467
- rtl = false;
10557
+ /**
10558
+ * Optimizes the visibility of the floating element by choosing the placement
10559
+ * that has the most space available automatically, without needing to specify a
10560
+ * preferred placement. Alternative to `flip`.
10561
+ * @see https://floating-ui.com/docs/autoPlacement
10562
+ */
10563
+ const autoPlacement = function (options) {
10564
+ if (options === void 0) {
10565
+ options = {};
10468
10566
  }
10567
+ return {
10568
+ name: 'autoPlacement',
10569
+ options,
10570
+ async fn(state) {
10571
+ var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;
10572
+ const {
10573
+ rects,
10574
+ middlewareData,
10575
+ placement,
10576
+ platform,
10577
+ elements
10578
+ } = state;
10579
+ const {
10580
+ crossAxis = false,
10581
+ alignment,
10582
+ allowedPlacements = placements,
10583
+ autoAlignment = true,
10584
+ ...detectOverflowOptions
10585
+ } = evaluate(options, state);
10586
+ const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;
10587
+ const overflow = await detectOverflow$1(state, detectOverflowOptions);
10588
+ const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;
10589
+ const currentPlacement = placements$1[currentIndex];
10590
+ if (currentPlacement == null) {
10591
+ return {};
10592
+ }
10593
+ const alignmentSides = getAlignmentSides$1(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
10469
10594
 
10470
- const alignment = getAlignment(placement);
10471
- const mainAxis = getMainAxisFromPlacement(placement);
10472
- const length = getLengthFromAxis(mainAxis);
10473
- let mainAlignmentSide = mainAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
10474
-
10475
- if (rects.reference[length] > rects.floating[length]) {
10476
- mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
10477
- }
10595
+ // Make `computeCoords` start from the right place.
10596
+ if (placement !== currentPlacement) {
10597
+ return {
10598
+ reset: {
10599
+ placement: placements$1[0]
10600
+ }
10601
+ };
10602
+ }
10603
+ const currentOverflows = [overflow[getSide$1(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];
10604
+ const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {
10605
+ placement: currentPlacement,
10606
+ overflows: currentOverflows
10607
+ }];
10608
+ const nextPlacement = placements$1[currentIndex + 1];
10478
10609
 
10479
- return {
10480
- main: mainAlignmentSide,
10481
- cross: getOppositePlacement(mainAlignmentSide)
10610
+ // There are more placements to check.
10611
+ if (nextPlacement) {
10612
+ return {
10613
+ data: {
10614
+ index: currentIndex + 1,
10615
+ overflows: allOverflows
10616
+ },
10617
+ reset: {
10618
+ placement: nextPlacement
10619
+ }
10620
+ };
10621
+ }
10622
+ const placementsSortedByMostSpace = allOverflows.map(d => {
10623
+ const alignment = getAlignment$1(d.placement);
10624
+ return [d.placement, alignment && crossAxis ?
10625
+ // Check along the mainAxis and main crossAxis side.
10626
+ d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :
10627
+ // Check only the mainAxis.
10628
+ d.overflows[0], d.overflows];
10629
+ }).sort((a, b) => a[1] - b[1]);
10630
+ const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,
10631
+ // Aligned placements should not check their opposite crossAxis
10632
+ // side.
10633
+ getAlignment$1(d[0]) ? 2 : 3).every(v => v <= 0));
10634
+ const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];
10635
+ if (resetPlacement !== placement) {
10636
+ return {
10637
+ data: {
10638
+ index: currentIndex + 1,
10639
+ overflows: allOverflows
10640
+ },
10641
+ reset: {
10642
+ placement: resetPlacement
10643
+ }
10644
+ };
10645
+ }
10646
+ return {};
10647
+ }
10482
10648
  };
10483
- }
10484
-
10485
- const hash = {
10486
- start: 'end',
10487
- end: 'start'
10488
10649
  };
10489
- function getOppositeAlignmentPlacement(placement) {
10490
- return placement.replace(/start|end/g, matched => hash[matched]);
10491
- }
10492
-
10493
- function getExpandedPlacements(placement) {
10494
- const oppositePlacement = getOppositePlacement(placement);
10495
- return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
10496
- }
10497
10650
 
10498
10651
  /**
10499
- * Changes the placement of the floating element to one that will fit if the
10500
- * initially specified `placement` does not.
10652
+ * Optimizes the visibility of the floating element by flipping the `placement`
10653
+ * in order to keep it in view when the preferred placement(s) will overflow the
10654
+ * clipping boundary. Alternative to `autoPlacement`.
10501
10655
  * @see https://floating-ui.com/docs/flip
10502
10656
  */
10503
- const flip = function (options) {
10657
+ const flip$1 = function (options) {
10504
10658
  if (options === void 0) {
10505
10659
  options = {};
10506
10660
  }
10507
-
10508
10661
  return {
10509
10662
  name: 'flip',
10510
10663
  options,
10511
-
10512
- async fn(middlewareArguments) {
10513
- var _middlewareData$flip;
10514
-
10664
+ async fn(state) {
10665
+ var _middlewareData$arrow, _middlewareData$flip;
10515
10666
  const {
10516
10667
  placement,
10517
10668
  middlewareData,
@@ -10519,48 +10670,56 @@
10519
10670
  initialPlacement,
10520
10671
  platform,
10521
10672
  elements
10522
- } = middlewareArguments;
10673
+ } = state;
10523
10674
  const {
10524
10675
  mainAxis: checkMainAxis = true,
10525
10676
  crossAxis: checkCrossAxis = true,
10526
10677
  fallbackPlacements: specifiedFallbackPlacements,
10527
10678
  fallbackStrategy = 'bestFit',
10679
+ fallbackAxisSideDirection = 'none',
10528
10680
  flipAlignment = true,
10529
10681
  ...detectOverflowOptions
10530
- } = options;
10531
- const side = getSide(placement);
10532
- const isBasePlacement = side === initialPlacement;
10533
- const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
10682
+ } = evaluate(options, state);
10683
+
10684
+ // If a reset by the arrow was caused due to an alignment offset being
10685
+ // added, we should skip any logic now since `flip()` has already done its
10686
+ // work.
10687
+ // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643
10688
+ if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
10689
+ return {};
10690
+ }
10691
+ const side = getSide$1(placement);
10692
+ const initialSideAxis = getSideAxis(initialPlacement);
10693
+ const isBasePlacement = getSide$1(initialPlacement) === initialPlacement;
10694
+ const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
10695
+ const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement$1(initialPlacement)] : getExpandedPlacements$1(initialPlacement));
10696
+ const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';
10697
+ if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
10698
+ fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
10699
+ }
10534
10700
  const placements = [initialPlacement, ...fallbackPlacements];
10535
- const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);
10701
+ const overflow = await detectOverflow$1(state, detectOverflowOptions);
10536
10702
  const overflows = [];
10537
10703
  let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
10538
-
10539
10704
  if (checkMainAxis) {
10540
10705
  overflows.push(overflow[side]);
10541
10706
  }
10542
-
10543
10707
  if (checkCrossAxis) {
10544
- const {
10545
- main,
10546
- cross
10547
- } = getAlignmentSides(placement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
10548
- overflows.push(overflow[main], overflow[cross]);
10708
+ const sides = getAlignmentSides$1(placement, rects, rtl);
10709
+ overflows.push(overflow[sides[0]], overflow[sides[1]]);
10549
10710
  }
10550
-
10551
10711
  overflowsData = [...overflowsData, {
10552
10712
  placement,
10553
10713
  overflows
10554
- }]; // One or more sides is overflowing
10714
+ }];
10555
10715
 
10716
+ // One or more sides is overflowing.
10556
10717
  if (!overflows.every(side => side <= 0)) {
10557
- var _middlewareData$flip$, _middlewareData$flip2;
10558
-
10559
- const nextIndex = ((_middlewareData$flip$ = (_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) != null ? _middlewareData$flip$ : 0) + 1;
10718
+ var _middlewareData$flip2, _overflowsData$filter;
10719
+ const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
10560
10720
  const nextPlacement = placements[nextIndex];
10561
-
10562
10721
  if (nextPlacement) {
10563
- // Try next placement and re-run the lifecycle
10722
+ // Try next placement and re-run the lifecycle.
10564
10723
  return {
10565
10724
  data: {
10566
10725
  index: nextIndex,
@@ -10572,27 +10731,36 @@
10572
10731
  };
10573
10732
  }
10574
10733
 
10575
- let resetPlacement = 'bottom';
10576
-
10577
- switch (fallbackStrategy) {
10578
- case 'bestFit':
10579
- {
10580
- var _overflowsData$map$so;
10581
-
10582
- const placement = (_overflowsData$map$so = overflowsData.map(d => [d, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0].placement;
10734
+ // First, find the candidates that fit on the mainAxis side of overflow,
10735
+ // then find the placement that fits the best on the main crossAxis side.
10736
+ let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
10583
10737
 
10584
- if (placement) {
10585
- resetPlacement = placement;
10738
+ // Otherwise fallback.
10739
+ if (!resetPlacement) {
10740
+ switch (fallbackStrategy) {
10741
+ case 'bestFit':
10742
+ {
10743
+ var _overflowsData$filter2;
10744
+ const placement = (_overflowsData$filter2 = overflowsData.filter(d => {
10745
+ if (hasFallbackAxisSideDirection) {
10746
+ const currentSideAxis = getSideAxis(d.placement);
10747
+ return currentSideAxis === initialSideAxis ||
10748
+ // Create a bias to the `y` side axis due to horizontal
10749
+ // reading directions favoring greater width.
10750
+ currentSideAxis === 'y';
10751
+ }
10752
+ return true;
10753
+ }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
10754
+ if (placement) {
10755
+ resetPlacement = placement;
10756
+ }
10757
+ break;
10586
10758
  }
10587
-
10759
+ case 'initialPlacement':
10760
+ resetPlacement = initialPlacement;
10588
10761
  break;
10589
- }
10590
-
10591
- case 'initialPlacement':
10592
- resetPlacement = initialPlacement;
10593
- break;
10762
+ }
10594
10763
  }
10595
-
10596
10764
  if (placement !== resetPlacement) {
10597
10765
  return {
10598
10766
  reset: {
@@ -10601,27 +10769,229 @@
10601
10769
  };
10602
10770
  }
10603
10771
  }
10604
-
10605
10772
  return {};
10606
10773
  }
10774
+ };
10775
+ };
10607
10776
 
10777
+ function getSideOffsets(overflow, rect) {
10778
+ return {
10779
+ top: overflow.top - rect.height,
10780
+ right: overflow.right - rect.width,
10781
+ bottom: overflow.bottom - rect.height,
10782
+ left: overflow.left - rect.width
10783
+ };
10784
+ }
10785
+ function isAnySideFullyClipped(overflow) {
10786
+ return sides.some(side => overflow[side] >= 0);
10787
+ }
10788
+ /**
10789
+ * Provides data to hide the floating element in applicable situations, such as
10790
+ * when it is not in the same clipping context as the reference element.
10791
+ * @see https://floating-ui.com/docs/hide
10792
+ */
10793
+ const hide = function (options) {
10794
+ if (options === void 0) {
10795
+ options = {};
10796
+ }
10797
+ return {
10798
+ name: 'hide',
10799
+ options,
10800
+ async fn(state) {
10801
+ const {
10802
+ rects
10803
+ } = state;
10804
+ const {
10805
+ strategy = 'referenceHidden',
10806
+ ...detectOverflowOptions
10807
+ } = evaluate(options, state);
10808
+ switch (strategy) {
10809
+ case 'referenceHidden':
10810
+ {
10811
+ const overflow = await detectOverflow$1(state, {
10812
+ ...detectOverflowOptions,
10813
+ elementContext: 'reference'
10814
+ });
10815
+ const offsets = getSideOffsets(overflow, rects.reference);
10816
+ return {
10817
+ data: {
10818
+ referenceHiddenOffsets: offsets,
10819
+ referenceHidden: isAnySideFullyClipped(offsets)
10820
+ }
10821
+ };
10822
+ }
10823
+ case 'escaped':
10824
+ {
10825
+ const overflow = await detectOverflow$1(state, {
10826
+ ...detectOverflowOptions,
10827
+ altBoundary: true
10828
+ });
10829
+ const offsets = getSideOffsets(overflow, rects.floating);
10830
+ return {
10831
+ data: {
10832
+ escapedOffsets: offsets,
10833
+ escaped: isAnySideFullyClipped(offsets)
10834
+ }
10835
+ };
10836
+ }
10837
+ default:
10838
+ {
10839
+ return {};
10840
+ }
10841
+ }
10842
+ }
10608
10843
  };
10609
10844
  };
10610
10845
 
10611
- async function convertValueToCoords(middlewareArguments, value) {
10846
+ function getBoundingRect(rects) {
10847
+ const minX = min$3(...rects.map(rect => rect.left));
10848
+ const minY = min$3(...rects.map(rect => rect.top));
10849
+ const maxX = max$3(...rects.map(rect => rect.right));
10850
+ const maxY = max$3(...rects.map(rect => rect.bottom));
10851
+ return {
10852
+ x: minX,
10853
+ y: minY,
10854
+ width: maxX - minX,
10855
+ height: maxY - minY
10856
+ };
10857
+ }
10858
+ function getRectsByLine(rects) {
10859
+ const sortedRects = rects.slice().sort((a, b) => a.y - b.y);
10860
+ const groups = [];
10861
+ let prevRect = null;
10862
+ for (let i = 0; i < sortedRects.length; i++) {
10863
+ const rect = sortedRects[i];
10864
+ if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {
10865
+ groups.push([rect]);
10866
+ } else {
10867
+ groups[groups.length - 1].push(rect);
10868
+ }
10869
+ prevRect = rect;
10870
+ }
10871
+ return groups.map(rect => rectToClientRect$1(getBoundingRect(rect)));
10872
+ }
10873
+ /**
10874
+ * Provides improved positioning for inline reference elements that can span
10875
+ * over multiple lines, such as hyperlinks or range selections.
10876
+ * @see https://floating-ui.com/docs/inline
10877
+ */
10878
+ const inline = function (options) {
10879
+ if (options === void 0) {
10880
+ options = {};
10881
+ }
10882
+ return {
10883
+ name: 'inline',
10884
+ options,
10885
+ async fn(state) {
10886
+ const {
10887
+ placement,
10888
+ elements,
10889
+ rects,
10890
+ platform,
10891
+ strategy
10892
+ } = state;
10893
+ // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a
10894
+ // ClientRect's bounds, despite the event listener being triggered. A
10895
+ // padding of 2 seems to handle this issue.
10896
+ const {
10897
+ padding = 2,
10898
+ x,
10899
+ y
10900
+ } = evaluate(options, state);
10901
+ const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);
10902
+ const clientRects = getRectsByLine(nativeClientRects);
10903
+ const fallback = rectToClientRect$1(getBoundingRect(nativeClientRects));
10904
+ const paddingObject = getPaddingObject(padding);
10905
+ function getBoundingClientRect() {
10906
+ // There are two rects and they are disjoined.
10907
+ if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {
10908
+ // Find the first rect in which the point is fully inside.
10909
+ return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;
10910
+ }
10911
+
10912
+ // There are 2 or more connected rects.
10913
+ if (clientRects.length >= 2) {
10914
+ if (getSideAxis(placement) === 'y') {
10915
+ const firstRect = clientRects[0];
10916
+ const lastRect = clientRects[clientRects.length - 1];
10917
+ const isTop = getSide$1(placement) === 'top';
10918
+ const top = firstRect.top;
10919
+ const bottom = lastRect.bottom;
10920
+ const left = isTop ? firstRect.left : lastRect.left;
10921
+ const right = isTop ? firstRect.right : lastRect.right;
10922
+ const width = right - left;
10923
+ const height = bottom - top;
10924
+ return {
10925
+ top,
10926
+ bottom,
10927
+ left,
10928
+ right,
10929
+ width,
10930
+ height,
10931
+ x: left,
10932
+ y: top
10933
+ };
10934
+ }
10935
+ const isLeftSide = getSide$1(placement) === 'left';
10936
+ const maxRight = max$3(...clientRects.map(rect => rect.right));
10937
+ const minLeft = min$3(...clientRects.map(rect => rect.left));
10938
+ const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);
10939
+ const top = measureRects[0].top;
10940
+ const bottom = measureRects[measureRects.length - 1].bottom;
10941
+ const left = minLeft;
10942
+ const right = maxRight;
10943
+ const width = right - left;
10944
+ const height = bottom - top;
10945
+ return {
10946
+ top,
10947
+ bottom,
10948
+ left,
10949
+ right,
10950
+ width,
10951
+ height,
10952
+ x: left,
10953
+ y: top
10954
+ };
10955
+ }
10956
+ return fallback;
10957
+ }
10958
+ const resetRects = await platform.getElementRects({
10959
+ reference: {
10960
+ getBoundingClientRect
10961
+ },
10962
+ floating: elements.floating,
10963
+ strategy
10964
+ });
10965
+ if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {
10966
+ return {
10967
+ reset: {
10968
+ rects: resetRects
10969
+ }
10970
+ };
10971
+ }
10972
+ return {};
10973
+ }
10974
+ };
10975
+ };
10976
+
10977
+ // For type backwards-compatibility, the `OffsetOptions` type was also
10978
+ // Derivable.
10979
+
10980
+ async function convertValueToCoords$1(state, options) {
10612
10981
  const {
10613
10982
  placement,
10614
10983
  platform,
10615
10984
  elements
10616
- } = middlewareArguments;
10985
+ } = state;
10617
10986
  const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
10618
- const side = getSide(placement);
10619
- const alignment = getAlignment(placement);
10620
- const isVertical = getMainAxisFromPlacement(placement) === 'x';
10987
+ const side = getSide$1(placement);
10988
+ const alignment = getAlignment$1(placement);
10989
+ const isVertical = getSideAxis(placement) === 'y';
10621
10990
  const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
10622
10991
  const crossAxisMulti = rtl && isVertical ? -1 : 1;
10623
- const rawValue = typeof value === 'function' ? value(middlewareArguments) : value; // eslint-disable-next-line prefer-const
10992
+ const rawValue = evaluate(options, state);
10624
10993
 
10994
+ // eslint-disable-next-line prefer-const
10625
10995
  let {
10626
10996
  mainAxis,
10627
10997
  crossAxis,
@@ -10636,11 +11006,9 @@
10636
11006
  alignmentAxis: null,
10637
11007
  ...rawValue
10638
11008
  };
10639
-
10640
11009
  if (alignment && typeof alignmentAxis === 'number') {
10641
11010
  crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
10642
11011
  }
10643
-
10644
11012
  return isVertical ? {
10645
11013
  x: crossAxis * crossAxisMulti,
10646
11014
  y: mainAxis * mainAxisMulti
@@ -10649,60 +11017,66 @@
10649
11017
  y: crossAxis * crossAxisMulti
10650
11018
  };
10651
11019
  }
11020
+
10652
11021
  /**
10653
- * Displaces the floating element from its reference element.
11022
+ * Modifies the placement by translating the floating element along the
11023
+ * specified axes.
11024
+ * A number (shorthand for `mainAxis` or distance), or an axes configuration
11025
+ * object may be passed.
10654
11026
  * @see https://floating-ui.com/docs/offset
10655
11027
  */
10656
-
10657
- const offset = function (value) {
10658
- if (value === void 0) {
10659
- value = 0;
11028
+ const offset$1 = function (options) {
11029
+ if (options === void 0) {
11030
+ options = 0;
10660
11031
  }
10661
-
10662
11032
  return {
10663
11033
  name: 'offset',
10664
- options: value,
10665
-
10666
- async fn(middlewareArguments) {
11034
+ options,
11035
+ async fn(state) {
11036
+ var _middlewareData$offse, _middlewareData$arrow;
10667
11037
  const {
10668
11038
  x,
10669
- y
10670
- } = middlewareArguments;
10671
- const diffCoords = await convertValueToCoords(middlewareArguments, value);
11039
+ y,
11040
+ placement,
11041
+ middlewareData
11042
+ } = state;
11043
+ const diffCoords = await convertValueToCoords$1(state, options);
11044
+
11045
+ // If the placement is the same and the arrow caused an alignment offset
11046
+ // then we don't need to change the positioning coordinates.
11047
+ if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
11048
+ return {};
11049
+ }
10672
11050
  return {
10673
11051
  x: x + diffCoords.x,
10674
11052
  y: y + diffCoords.y,
10675
- data: diffCoords
11053
+ data: {
11054
+ ...diffCoords,
11055
+ placement
11056
+ }
10676
11057
  };
10677
11058
  }
10678
-
10679
11059
  };
10680
11060
  };
10681
11061
 
10682
- function getCrossAxis(axis) {
10683
- return axis === 'x' ? 'y' : 'x';
10684
- }
10685
-
10686
11062
  /**
10687
- * Shifts the floating element in order to keep it in view when it will overflow
10688
- * a clipping boundary.
11063
+ * Optimizes the visibility of the floating element by shifting it in order to
11064
+ * keep it in view when it will overflow the clipping boundary.
10689
11065
  * @see https://floating-ui.com/docs/shift
10690
11066
  */
10691
- const shift = function (options) {
11067
+ const shift$1 = function (options) {
10692
11068
  if (options === void 0) {
10693
11069
  options = {};
10694
11070
  }
10695
-
10696
11071
  return {
10697
11072
  name: 'shift',
10698
11073
  options,
10699
-
10700
- async fn(middlewareArguments) {
11074
+ async fn(state) {
10701
11075
  const {
10702
11076
  x,
10703
11077
  y,
10704
11078
  placement
10705
- } = middlewareArguments;
11079
+ } = state;
10706
11080
  const {
10707
11081
  mainAxis: checkMainAxis = true,
10708
11082
  crossAxis: checkCrossAxis = false,
@@ -10719,424 +11093,547 @@
10719
11093
  }
10720
11094
  },
10721
11095
  ...detectOverflowOptions
10722
- } = options;
11096
+ } = evaluate(options, state);
10723
11097
  const coords = {
10724
11098
  x,
10725
11099
  y
10726
11100
  };
10727
- const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);
10728
- const mainAxis = getMainAxisFromPlacement(getSide(placement));
10729
- const crossAxis = getCrossAxis(mainAxis);
11101
+ const overflow = await detectOverflow$1(state, detectOverflowOptions);
11102
+ const crossAxis = getSideAxis(getSide$1(placement));
11103
+ const mainAxis = getOppositeAxis(crossAxis);
10730
11104
  let mainAxisCoord = coords[mainAxis];
10731
11105
  let crossAxisCoord = coords[crossAxis];
10732
-
10733
11106
  if (checkMainAxis) {
10734
11107
  const minSide = mainAxis === 'y' ? 'top' : 'left';
10735
11108
  const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
10736
11109
  const min = mainAxisCoord + overflow[minSide];
10737
11110
  const max = mainAxisCoord - overflow[maxSide];
10738
- mainAxisCoord = within(min, mainAxisCoord, max);
11111
+ mainAxisCoord = clamp(min, mainAxisCoord, max);
10739
11112
  }
10740
-
10741
11113
  if (checkCrossAxis) {
10742
11114
  const minSide = crossAxis === 'y' ? 'top' : 'left';
10743
11115
  const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
10744
11116
  const min = crossAxisCoord + overflow[minSide];
10745
11117
  const max = crossAxisCoord - overflow[maxSide];
10746
- crossAxisCoord = within(min, crossAxisCoord, max);
11118
+ crossAxisCoord = clamp(min, crossAxisCoord, max);
10747
11119
  }
10748
-
10749
- const limitedCoords = limiter.fn({ ...middlewareArguments,
11120
+ const limitedCoords = limiter.fn({
11121
+ ...state,
10750
11122
  [mainAxis]: mainAxisCoord,
10751
11123
  [crossAxis]: crossAxisCoord
10752
11124
  });
10753
- return { ...limitedCoords,
11125
+ return {
11126
+ ...limitedCoords,
10754
11127
  data: {
10755
11128
  x: limitedCoords.x - x,
10756
11129
  y: limitedCoords.y - y
10757
11130
  }
10758
11131
  };
10759
11132
  }
10760
-
10761
11133
  };
10762
11134
  };
10763
-
10764
- function isWindow(value) {
10765
- return value && value.document && value.location && value.alert && value.setInterval;
10766
- }
10767
- function getWindow(node) {
10768
- if (node == null) {
10769
- return window;
11135
+ /**
11136
+ * Built-in `limiter` that will stop `shift()` at a certain point.
11137
+ */
11138
+ const limitShift = function (options) {
11139
+ if (options === void 0) {
11140
+ options = {};
10770
11141
  }
11142
+ return {
11143
+ options,
11144
+ fn(state) {
11145
+ const {
11146
+ x,
11147
+ y,
11148
+ placement,
11149
+ rects,
11150
+ middlewareData
11151
+ } = state;
11152
+ const {
11153
+ offset = 0,
11154
+ mainAxis: checkMainAxis = true,
11155
+ crossAxis: checkCrossAxis = true
11156
+ } = evaluate(options, state);
11157
+ const coords = {
11158
+ x,
11159
+ y
11160
+ };
11161
+ const crossAxis = getSideAxis(placement);
11162
+ const mainAxis = getOppositeAxis(crossAxis);
11163
+ let mainAxisCoord = coords[mainAxis];
11164
+ let crossAxisCoord = coords[crossAxis];
11165
+ const rawOffset = evaluate(offset, state);
11166
+ const computedOffset = typeof rawOffset === 'number' ? {
11167
+ mainAxis: rawOffset,
11168
+ crossAxis: 0
11169
+ } : {
11170
+ mainAxis: 0,
11171
+ crossAxis: 0,
11172
+ ...rawOffset
11173
+ };
11174
+ if (checkMainAxis) {
11175
+ const len = mainAxis === 'y' ? 'height' : 'width';
11176
+ const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;
11177
+ const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;
11178
+ if (mainAxisCoord < limitMin) {
11179
+ mainAxisCoord = limitMin;
11180
+ } else if (mainAxisCoord > limitMax) {
11181
+ mainAxisCoord = limitMax;
11182
+ }
11183
+ }
11184
+ if (checkCrossAxis) {
11185
+ var _middlewareData$offse, _middlewareData$offse2;
11186
+ const len = mainAxis === 'y' ? 'width' : 'height';
11187
+ const isOriginSide = ['top', 'left'].includes(getSide$1(placement));
11188
+ const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
11189
+ const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
11190
+ if (crossAxisCoord < limitMin) {
11191
+ crossAxisCoord = limitMin;
11192
+ } else if (crossAxisCoord > limitMax) {
11193
+ crossAxisCoord = limitMax;
11194
+ }
11195
+ }
11196
+ return {
11197
+ [mainAxis]: mainAxisCoord,
11198
+ [crossAxis]: crossAxisCoord
11199
+ };
11200
+ }
11201
+ };
11202
+ };
10771
11203
 
10772
- if (!isWindow(node)) {
10773
- const ownerDocument = node.ownerDocument;
10774
- return ownerDocument ? ownerDocument.defaultView || window : window;
11204
+ /**
11205
+ * Provides data that allows you to change the size of the floating element —
11206
+ * for instance, prevent it from overflowing the clipping boundary or match the
11207
+ * width of the reference element.
11208
+ * @see https://floating-ui.com/docs/size
11209
+ */
11210
+ const size = function (options) {
11211
+ if (options === void 0) {
11212
+ options = {};
10775
11213
  }
11214
+ return {
11215
+ name: 'size',
11216
+ options,
11217
+ async fn(state) {
11218
+ const {
11219
+ placement,
11220
+ rects,
11221
+ platform,
11222
+ elements
11223
+ } = state;
11224
+ const {
11225
+ apply = () => {},
11226
+ ...detectOverflowOptions
11227
+ } = evaluate(options, state);
11228
+ const overflow = await detectOverflow$1(state, detectOverflowOptions);
11229
+ const side = getSide$1(placement);
11230
+ const alignment = getAlignment$1(placement);
11231
+ const isYAxis = getSideAxis(placement) === 'y';
11232
+ const {
11233
+ width,
11234
+ height
11235
+ } = rects.floating;
11236
+ let heightSide;
11237
+ let widthSide;
11238
+ if (side === 'top' || side === 'bottom') {
11239
+ heightSide = side;
11240
+ widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';
11241
+ } else {
11242
+ widthSide = side;
11243
+ heightSide = alignment === 'end' ? 'top' : 'bottom';
11244
+ }
11245
+ const maximumClippingHeight = height - overflow.top - overflow.bottom;
11246
+ const maximumClippingWidth = width - overflow.left - overflow.right;
11247
+ const overflowAvailableHeight = min$3(height - overflow[heightSide], maximumClippingHeight);
11248
+ const overflowAvailableWidth = min$3(width - overflow[widthSide], maximumClippingWidth);
11249
+ const noShift = !state.middlewareData.shift;
11250
+ let availableHeight = overflowAvailableHeight;
11251
+ let availableWidth = overflowAvailableWidth;
11252
+ if (isYAxis) {
11253
+ availableWidth = alignment || noShift ? min$3(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth;
11254
+ } else {
11255
+ availableHeight = alignment || noShift ? min$3(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight;
11256
+ }
11257
+ if (noShift && !alignment) {
11258
+ const xMin = max$3(overflow.left, 0);
11259
+ const xMax = max$3(overflow.right, 0);
11260
+ const yMin = max$3(overflow.top, 0);
11261
+ const yMax = max$3(overflow.bottom, 0);
11262
+ if (isYAxis) {
11263
+ availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max$3(overflow.left, overflow.right));
11264
+ } else {
11265
+ availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max$3(overflow.top, overflow.bottom));
11266
+ }
11267
+ }
11268
+ await apply({
11269
+ ...state,
11270
+ availableWidth,
11271
+ availableHeight
11272
+ });
11273
+ const nextDimensions = await platform.getDimensions(elements.floating);
11274
+ if (width !== nextDimensions.width || height !== nextDimensions.height) {
11275
+ return {
11276
+ reset: {
11277
+ rects: true
11278
+ }
11279
+ };
11280
+ }
11281
+ return {};
11282
+ }
11283
+ };
11284
+ };
10776
11285
 
10777
- return node;
10778
- }
10779
-
10780
- function getComputedStyle$1(element) {
10781
- return getWindow(element).getComputedStyle(element);
11286
+ function getNodeName$1(node) {
11287
+ if (isNode$1(node)) {
11288
+ return (node.nodeName || '').toLowerCase();
11289
+ }
11290
+ // Mocked nodes in testing environments may not be instances of Node. By
11291
+ // returning `#document` an infinite loop won't occur.
11292
+ // https://github.com/floating-ui/floating-ui/issues/2317
11293
+ return '#document';
10782
11294
  }
10783
-
10784
- function getNodeName(node) {
10785
- return isWindow(node) ? '' : node ? (node.nodeName || '').toLowerCase() : '';
11295
+ function getWindow$1(node) {
11296
+ var _node$ownerDocument;
11297
+ return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
10786
11298
  }
10787
-
10788
- function getUAString() {
10789
- const uaData = navigator.userAgentData;
10790
-
10791
- if (uaData != null && uaData.brands) {
10792
- return uaData.brands.map(item => item.brand + "/" + item.version).join(' ');
10793
- }
10794
-
10795
- return navigator.userAgent;
11299
+ function getDocumentElement$1(node) {
11300
+ var _ref;
11301
+ return (_ref = (isNode$1(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
10796
11302
  }
10797
-
10798
- function isHTMLElement(value) {
10799
- return value instanceof getWindow(value).HTMLElement;
11303
+ function isNode$1(value) {
11304
+ return value instanceof Node || value instanceof getWindow$1(value).Node;
10800
11305
  }
10801
- function isElement(value) {
10802
- return value instanceof getWindow(value).Element;
11306
+ function isElement$1(value) {
11307
+ return value instanceof Element || value instanceof getWindow$1(value).Element;
10803
11308
  }
10804
- function isNode(value) {
10805
- return value instanceof getWindow(value).Node;
11309
+ function isHTMLElement$1(value) {
11310
+ return value instanceof HTMLElement || value instanceof getWindow$1(value).HTMLElement;
10806
11311
  }
10807
- function isShadowRoot(node) {
10808
- // Browsers without `ShadowRoot` support
11312
+ function isShadowRoot$1(value) {
11313
+ // Browsers without `ShadowRoot` support.
10809
11314
  if (typeof ShadowRoot === 'undefined') {
10810
11315
  return false;
10811
11316
  }
10812
-
10813
- const OwnElement = getWindow(node).ShadowRoot;
10814
- return node instanceof OwnElement || node instanceof ShadowRoot;
11317
+ return value instanceof ShadowRoot || value instanceof getWindow$1(value).ShadowRoot;
10815
11318
  }
10816
- function isOverflowElement(element) {
10817
- // Firefox wants us to check `-x` and `-y` variations as well
11319
+ function isOverflowElement$1(element) {
10818
11320
  const {
10819
11321
  overflow,
10820
11322
  overflowX,
10821
- overflowY
10822
- } = getComputedStyle$1(element);
10823
- return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
10824
- }
10825
- function isTableElement(element) {
10826
- return ['table', 'td', 'th'].includes(getNodeName(element));
11323
+ overflowY,
11324
+ display
11325
+ } = getComputedStyle$2(element);
11326
+ return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
10827
11327
  }
10828
- function isContainingBlock(element) {
10829
- // TODO: Try and use feature detection here instead
10830
- const isFirefox = /firefox/i.test(getUAString());
10831
- const css = getComputedStyle$1(element); // This is non-exhaustive but covers the most common CSS properties that
10832
- // create a containing block.
10833
- // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
10834
-
10835
- return css.transform !== 'none' || css.perspective !== 'none' || // @ts-ignore (TS 4.1 compat)
10836
- css.contain === 'paint' || ['transform', 'perspective'].includes(css.willChange) || isFirefox && css.willChange === 'filter' || isFirefox && (css.filter ? css.filter !== 'none' : false);
11328
+ function isTableElement$1(element) {
11329
+ return ['table', 'td', 'th'].includes(getNodeName$1(element));
10837
11330
  }
10838
- function isLayoutViewport() {
10839
- // Not Safari
10840
- return !/^((?!chrome|android).)*safari/i.test(getUAString()); // Feature detection for this fails in various ways
10841
- // • Always-visible scrollbar or not
10842
- // Width of <html>, etc.
10843
- // const vV = win.visualViewport;
10844
- // return vV ? Math.abs(win.innerWidth / vV.scale - vV.width) < 0.5 : true;
11331
+ function isTopLayer(element) {
11332
+ return [':popover-open', ':modal'].some(selector => {
11333
+ try {
11334
+ return element.matches(selector);
11335
+ } catch (e) {
11336
+ return false;
11337
+ }
11338
+ });
10845
11339
  }
11340
+ function isContainingBlock$1(elementOrCss) {
11341
+ const webkit = isWebKit();
11342
+ const css = isElement$1(elementOrCss) ? getComputedStyle$2(elementOrCss) : elementOrCss;
10846
11343
 
10847
- const min$1 = Math.min;
10848
- const max$1 = Math.max;
10849
- const round = Math.round;
10850
-
10851
- function getBoundingClientRect(element, includeScale, isFixedStrategy) {
10852
- var _win$visualViewport$o, _win$visualViewport, _win$visualViewport$o2, _win$visualViewport2;
10853
-
10854
- if (includeScale === void 0) {
10855
- includeScale = false;
10856
- }
10857
-
10858
- if (isFixedStrategy === void 0) {
10859
- isFixedStrategy = false;
10860
- }
10861
-
10862
- const clientRect = element.getBoundingClientRect();
10863
- let scaleX = 1;
10864
- let scaleY = 1;
10865
-
10866
- if (includeScale && isHTMLElement(element)) {
10867
- scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
10868
- scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
11344
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
11345
+ return css.transform !== 'none' || css.perspective !== 'none' || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));
11346
+ }
11347
+ function getContainingBlock$1(element) {
11348
+ let currentNode = getParentNode$1(element);
11349
+ while (isHTMLElement$1(currentNode) && !isLastTraversableNode(currentNode)) {
11350
+ if (isContainingBlock$1(currentNode)) {
11351
+ return currentNode;
11352
+ } else if (isTopLayer(currentNode)) {
11353
+ return null;
11354
+ }
11355
+ currentNode = getParentNode$1(currentNode);
10869
11356
  }
10870
-
10871
- const win = isElement(element) ? getWindow(element) : window;
10872
- const addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
10873
- const x = (clientRect.left + (addVisualOffsets ? (_win$visualViewport$o = (_win$visualViewport = win.visualViewport) == null ? void 0 : _win$visualViewport.offsetLeft) != null ? _win$visualViewport$o : 0 : 0)) / scaleX;
10874
- const y = (clientRect.top + (addVisualOffsets ? (_win$visualViewport$o2 = (_win$visualViewport2 = win.visualViewport) == null ? void 0 : _win$visualViewport2.offsetTop) != null ? _win$visualViewport$o2 : 0 : 0)) / scaleY;
10875
- const width = clientRect.width / scaleX;
10876
- const height = clientRect.height / scaleY;
10877
- return {
10878
- width,
10879
- height,
10880
- top: y,
10881
- right: x + width,
10882
- bottom: y + height,
10883
- left: x,
10884
- x,
10885
- y
10886
- };
11357
+ return null;
10887
11358
  }
10888
-
10889
- function getDocumentElement(node) {
10890
- return ((isNode(node) ? node.ownerDocument : node.document) || window.document).documentElement;
11359
+ function isWebKit() {
11360
+ if (typeof CSS === 'undefined' || !CSS.supports) return false;
11361
+ return CSS.supports('-webkit-backdrop-filter', 'none');
10891
11362
  }
10892
-
10893
- function getNodeScroll(element) {
10894
- if (isElement(element)) {
11363
+ function isLastTraversableNode(node) {
11364
+ return ['html', 'body', '#document'].includes(getNodeName$1(node));
11365
+ }
11366
+ function getComputedStyle$2(element) {
11367
+ return getWindow$1(element).getComputedStyle(element);
11368
+ }
11369
+ function getNodeScroll$1(element) {
11370
+ if (isElement$1(element)) {
10895
11371
  return {
10896
11372
  scrollLeft: element.scrollLeft,
10897
11373
  scrollTop: element.scrollTop
10898
11374
  };
10899
11375
  }
10900
-
10901
11376
  return {
10902
- scrollLeft: element.pageXOffset,
10903
- scrollTop: element.pageYOffset
11377
+ scrollLeft: element.scrollX,
11378
+ scrollTop: element.scrollY
10904
11379
  };
10905
11380
  }
10906
-
10907
- function getWindowScrollBarX(element) {
10908
- // If <html> has a CSS width greater than the viewport, then this will be
10909
- // incorrect for RTL.
10910
- return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
11381
+ function getParentNode$1(node) {
11382
+ if (getNodeName$1(node) === 'html') {
11383
+ return node;
11384
+ }
11385
+ const result =
11386
+ // Step into the shadow DOM of the parent of a slotted node.
11387
+ node.assignedSlot ||
11388
+ // DOM Element detected.
11389
+ node.parentNode ||
11390
+ // ShadowRoot detected.
11391
+ isShadowRoot$1(node) && node.host ||
11392
+ // Fallback.
11393
+ getDocumentElement$1(node);
11394
+ return isShadowRoot$1(result) ? result.host : result;
11395
+ }
11396
+ function getNearestOverflowAncestor$1(node) {
11397
+ const parentNode = getParentNode$1(node);
11398
+ if (isLastTraversableNode(parentNode)) {
11399
+ return node.ownerDocument ? node.ownerDocument.body : node.body;
11400
+ }
11401
+ if (isHTMLElement$1(parentNode) && isOverflowElement$1(parentNode)) {
11402
+ return parentNode;
11403
+ }
11404
+ return getNearestOverflowAncestor$1(parentNode);
10911
11405
  }
10912
-
10913
- function isScaled(element) {
10914
- const rect = getBoundingClientRect(element);
10915
- return round(rect.width) !== element.offsetWidth || round(rect.height) !== element.offsetHeight;
11406
+ function getOverflowAncestors$1(node, list, traverseIframes) {
11407
+ var _node$ownerDocument2;
11408
+ if (list === void 0) {
11409
+ list = [];
11410
+ }
11411
+ if (traverseIframes === void 0) {
11412
+ traverseIframes = true;
11413
+ }
11414
+ const scrollableAncestor = getNearestOverflowAncestor$1(node);
11415
+ const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
11416
+ const win = getWindow$1(scrollableAncestor);
11417
+ if (isBody) {
11418
+ return list.concat(win, win.visualViewport || [], isOverflowElement$1(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors$1(win.frameElement) : []);
11419
+ }
11420
+ return list.concat(scrollableAncestor, getOverflowAncestors$1(scrollableAncestor, [], traverseIframes));
10916
11421
  }
10917
11422
 
10918
- function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
10919
- const isOffsetParentAnElement = isHTMLElement(offsetParent);
10920
- const documentElement = getDocumentElement(offsetParent);
10921
- const rect = getBoundingClientRect(element, // @ts-ignore - checked above (TS 4.1 compat)
10922
- isOffsetParentAnElement && isScaled(offsetParent), strategy === 'fixed');
10923
- let scroll = {
10924
- scrollLeft: 0,
10925
- scrollTop: 0
10926
- };
10927
- const offsets = {
10928
- x: 0,
10929
- y: 0
10930
- };
10931
-
10932
- if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
10933
- if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
10934
- scroll = getNodeScroll(offsetParent);
10935
- }
10936
-
10937
- if (isHTMLElement(offsetParent)) {
10938
- const offsetRect = getBoundingClientRect(offsetParent, true);
10939
- offsets.x = offsetRect.x + offsetParent.clientLeft;
10940
- offsets.y = offsetRect.y + offsetParent.clientTop;
10941
- } else if (documentElement) {
10942
- offsets.x = getWindowScrollBarX(documentElement);
10943
- }
11423
+ function getCssDimensions(element) {
11424
+ const css = getComputedStyle$2(element);
11425
+ // In testing environments, the `width` and `height` properties are empty
11426
+ // strings for SVG elements, returning NaN. Fallback to `0` in this case.
11427
+ let width = parseFloat(css.width) || 0;
11428
+ let height = parseFloat(css.height) || 0;
11429
+ const hasOffset = isHTMLElement$1(element);
11430
+ const offsetWidth = hasOffset ? element.offsetWidth : width;
11431
+ const offsetHeight = hasOffset ? element.offsetHeight : height;
11432
+ const shouldFallback = round$1(width) !== offsetWidth || round$1(height) !== offsetHeight;
11433
+ if (shouldFallback) {
11434
+ width = offsetWidth;
11435
+ height = offsetHeight;
10944
11436
  }
10945
-
10946
11437
  return {
10947
- x: rect.left + scroll.scrollLeft - offsets.x,
10948
- y: rect.top + scroll.scrollTop - offsets.y,
10949
- width: rect.width,
10950
- height: rect.height
11438
+ width,
11439
+ height,
11440
+ $: shouldFallback
10951
11441
  };
10952
11442
  }
10953
11443
 
10954
- function getParentNode(node) {
10955
- if (getNodeName(node) === 'html') {
10956
- return node;
10957
- }
10958
-
10959
- return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
10960
- // @ts-ignore
10961
- node.assignedSlot || // step into the shadow DOM of the parent of a slotted node
10962
- node.parentNode || ( // DOM Element detected
10963
- isShadowRoot(node) ? node.host : null) || // ShadowRoot detected
10964
- getDocumentElement(node) // fallback
10965
-
10966
- );
11444
+ function unwrapElement(element) {
11445
+ return !isElement$1(element) ? element.contextElement : element;
10967
11446
  }
10968
11447
 
10969
- function getTrueOffsetParent(element) {
10970
- if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {
10971
- return null;
11448
+ function getScale(element) {
11449
+ const domElement = unwrapElement(element);
11450
+ if (!isHTMLElement$1(domElement)) {
11451
+ return createCoords(1);
10972
11452
  }
11453
+ const rect = domElement.getBoundingClientRect();
11454
+ const {
11455
+ width,
11456
+ height,
11457
+ $
11458
+ } = getCssDimensions(domElement);
11459
+ let x = ($ ? round$1(rect.width) : rect.width) / width;
11460
+ let y = ($ ? round$1(rect.height) : rect.height) / height;
10973
11461
 
10974
- return composedOffsetParent(element);
10975
- }
10976
- /**
10977
- * Polyfills the old offsetParent behavior from before the spec was changed:
10978
- * https://github.com/w3c/csswg-drafts/issues/159
10979
- */
10980
-
10981
-
10982
- function composedOffsetParent(element) {
10983
- let {
10984
- offsetParent
10985
- } = element;
10986
- let ancestor = element;
10987
- let foundInsideSlot = false;
10988
-
10989
- while (ancestor && ancestor !== offsetParent) {
10990
- const {
10991
- assignedSlot
10992
- } = ancestor;
10993
-
10994
- if (assignedSlot) {
10995
- let newOffsetParent = assignedSlot.offsetParent;
10996
-
10997
- if (getComputedStyle$1(assignedSlot).display === 'contents') {
10998
- const hadStyleAttribute = assignedSlot.hasAttribute('style');
10999
- const oldDisplay = assignedSlot.style.display;
11000
- assignedSlot.style.display = getComputedStyle$1(ancestor).display;
11001
- newOffsetParent = assignedSlot.offsetParent;
11002
- assignedSlot.style.display = oldDisplay;
11003
-
11004
- if (!hadStyleAttribute) {
11005
- assignedSlot.removeAttribute('style');
11006
- }
11007
- }
11008
-
11009
- ancestor = assignedSlot;
11010
-
11011
- if (offsetParent !== newOffsetParent) {
11012
- offsetParent = newOffsetParent;
11013
- foundInsideSlot = true;
11014
- }
11015
- } else if (isShadowRoot(ancestor) && ancestor.host && foundInsideSlot) {
11016
- break;
11017
- }
11462
+ // 0, NaN, or Infinity should always fallback to 1.
11018
11463
 
11019
- ancestor = isShadowRoot(ancestor) && ancestor.host || ancestor.parentNode;
11464
+ if (!x || !Number.isFinite(x)) {
11465
+ x = 1;
11020
11466
  }
11021
-
11022
- return offsetParent;
11023
- }
11024
-
11025
- function getContainingBlock(element) {
11026
- let currentNode = getParentNode(element);
11027
-
11028
- if (isShadowRoot(currentNode)) {
11029
- currentNode = currentNode.host;
11467
+ if (!y || !Number.isFinite(y)) {
11468
+ y = 1;
11030
11469
  }
11470
+ return {
11471
+ x,
11472
+ y
11473
+ };
11474
+ }
11031
11475
 
11032
- while (isHTMLElement(currentNode) && !['html', 'body'].includes(getNodeName(currentNode))) {
11033
- if (isContainingBlock(currentNode)) {
11034
- return currentNode;
11035
- } else {
11036
- const parent = currentNode.parentNode;
11037
- currentNode = isShadowRoot(parent) ? parent.host : parent;
11038
- }
11476
+ const noOffsets = /*#__PURE__*/createCoords(0);
11477
+ function getVisualOffsets(element) {
11478
+ const win = getWindow$1(element);
11479
+ if (!isWebKit() || !win.visualViewport) {
11480
+ return noOffsets;
11039
11481
  }
11040
-
11041
- return null;
11042
- } // Gets the closest ancestor positioned element. Handles some edge cases,
11043
- // such as table ancestors and cross browser bugs.
11044
-
11045
-
11046
- function getOffsetParent(element) {
11047
- const window = getWindow(element);
11048
- let offsetParent = getTrueOffsetParent(element);
11049
-
11050
- while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === 'static') {
11051
- offsetParent = getTrueOffsetParent(offsetParent);
11482
+ return {
11483
+ x: win.visualViewport.offsetLeft,
11484
+ y: win.visualViewport.offsetTop
11485
+ };
11486
+ }
11487
+ function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
11488
+ if (isFixed === void 0) {
11489
+ isFixed = false;
11052
11490
  }
11053
-
11054
- if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle$1(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {
11055
- return window;
11491
+ if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow$1(element)) {
11492
+ return false;
11056
11493
  }
11057
-
11058
- return offsetParent || getContainingBlock(element) || window;
11494
+ return isFixed;
11059
11495
  }
11060
11496
 
11061
- function getDimensions(element) {
11062
- if (isHTMLElement(element)) {
11063
- return {
11064
- width: element.offsetWidth,
11065
- height: element.offsetHeight
11066
- };
11497
+ function getBoundingClientRect$1(element, includeScale, isFixedStrategy, offsetParent) {
11498
+ if (includeScale === void 0) {
11499
+ includeScale = false;
11067
11500
  }
11068
-
11069
- const rect = getBoundingClientRect(element);
11070
- return {
11071
- width: rect.width,
11072
- height: rect.height
11073
- };
11501
+ if (isFixedStrategy === void 0) {
11502
+ isFixedStrategy = false;
11503
+ }
11504
+ const clientRect = element.getBoundingClientRect();
11505
+ const domElement = unwrapElement(element);
11506
+ let scale = createCoords(1);
11507
+ if (includeScale) {
11508
+ if (offsetParent) {
11509
+ if (isElement$1(offsetParent)) {
11510
+ scale = getScale(offsetParent);
11511
+ }
11512
+ } else {
11513
+ scale = getScale(element);
11514
+ }
11515
+ }
11516
+ const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
11517
+ let x = (clientRect.left + visualOffsets.x) / scale.x;
11518
+ let y = (clientRect.top + visualOffsets.y) / scale.y;
11519
+ let width = clientRect.width / scale.x;
11520
+ let height = clientRect.height / scale.y;
11521
+ if (domElement) {
11522
+ const win = getWindow$1(domElement);
11523
+ const offsetWin = offsetParent && isElement$1(offsetParent) ? getWindow$1(offsetParent) : offsetParent;
11524
+ let currentWin = win;
11525
+ let currentIFrame = currentWin.frameElement;
11526
+ while (currentIFrame && offsetParent && offsetWin !== currentWin) {
11527
+ const iframeScale = getScale(currentIFrame);
11528
+ const iframeRect = currentIFrame.getBoundingClientRect();
11529
+ const css = getComputedStyle$2(currentIFrame);
11530
+ const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
11531
+ const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
11532
+ x *= iframeScale.x;
11533
+ y *= iframeScale.y;
11534
+ width *= iframeScale.x;
11535
+ height *= iframeScale.y;
11536
+ x += left;
11537
+ y += top;
11538
+ currentWin = getWindow$1(currentIFrame);
11539
+ currentIFrame = currentWin.frameElement;
11540
+ }
11541
+ }
11542
+ return rectToClientRect$1({
11543
+ width,
11544
+ height,
11545
+ x,
11546
+ y
11547
+ });
11074
11548
  }
11075
11549
 
11076
- function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
11550
+ function convertOffsetParentRelativeRectToViewportRelativeRect$1(_ref) {
11077
11551
  let {
11552
+ elements,
11078
11553
  rect,
11079
11554
  offsetParent,
11080
11555
  strategy
11081
11556
  } = _ref;
11082
- const isOffsetParentAnElement = isHTMLElement(offsetParent);
11083
- const documentElement = getDocumentElement(offsetParent);
11084
-
11085
- if (offsetParent === documentElement) {
11557
+ const isFixed = strategy === 'fixed';
11558
+ const documentElement = getDocumentElement$1(offsetParent);
11559
+ const topLayer = elements ? isTopLayer(elements.floating) : false;
11560
+ if (offsetParent === documentElement || topLayer && isFixed) {
11086
11561
  return rect;
11087
11562
  }
11088
-
11089
11563
  let scroll = {
11090
11564
  scrollLeft: 0,
11091
11565
  scrollTop: 0
11092
11566
  };
11093
- const offsets = {
11094
- x: 0,
11095
- y: 0
11096
- };
11097
-
11098
- if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
11099
- if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
11100
- scroll = getNodeScroll(offsetParent);
11567
+ let scale = createCoords(1);
11568
+ const offsets = createCoords(0);
11569
+ const isOffsetParentAnElement = isHTMLElement$1(offsetParent);
11570
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
11571
+ if (getNodeName$1(offsetParent) !== 'body' || isOverflowElement$1(documentElement)) {
11572
+ scroll = getNodeScroll$1(offsetParent);
11101
11573
  }
11102
-
11103
- if (isHTMLElement(offsetParent)) {
11104
- const offsetRect = getBoundingClientRect(offsetParent, true);
11574
+ if (isHTMLElement$1(offsetParent)) {
11575
+ const offsetRect = getBoundingClientRect$1(offsetParent);
11576
+ scale = getScale(offsetParent);
11105
11577
  offsets.x = offsetRect.x + offsetParent.clientLeft;
11106
11578
  offsets.y = offsetRect.y + offsetParent.clientTop;
11107
- } // This doesn't appear to be need to be negated.
11108
- // else if (documentElement) {
11109
- // offsets.x = getWindowScrollBarX(documentElement);
11110
- // }
11111
-
11579
+ }
11112
11580
  }
11581
+ return {
11582
+ width: rect.width * scale.x,
11583
+ height: rect.height * scale.y,
11584
+ x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
11585
+ y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
11586
+ };
11587
+ }
11113
11588
 
11114
- return { ...rect,
11115
- x: rect.x - scroll.scrollLeft + offsets.x,
11116
- y: rect.y - scroll.scrollTop + offsets.y
11589
+ function getClientRects(element) {
11590
+ return Array.from(element.getClientRects());
11591
+ }
11592
+
11593
+ function getWindowScrollBarX$1(element) {
11594
+ // If <html> has a CSS width greater than the viewport, then this will be
11595
+ // incorrect for RTL.
11596
+ return getBoundingClientRect$1(getDocumentElement$1(element)).left + getNodeScroll$1(element).scrollLeft;
11597
+ }
11598
+
11599
+ // Gets the entire size of the scrollable document area, even extending outside
11600
+ // of the `<html>` and `<body>` rect bounds if horizontally scrollable.
11601
+ function getDocumentRect$1(element) {
11602
+ const html = getDocumentElement$1(element);
11603
+ const scroll = getNodeScroll$1(element);
11604
+ const body = element.ownerDocument.body;
11605
+ const width = max$3(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
11606
+ const height = max$3(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
11607
+ let x = -scroll.scrollLeft + getWindowScrollBarX$1(element);
11608
+ const y = -scroll.scrollTop;
11609
+ if (getComputedStyle$2(body).direction === 'rtl') {
11610
+ x += max$3(html.clientWidth, body.clientWidth) - width;
11611
+ }
11612
+ return {
11613
+ width,
11614
+ height,
11615
+ x,
11616
+ y
11117
11617
  };
11118
11618
  }
11119
11619
 
11120
- function getViewportRect(element, strategy) {
11121
- const win = getWindow(element);
11122
- const html = getDocumentElement(element);
11620
+ function getViewportRect$1(element, strategy) {
11621
+ const win = getWindow$1(element);
11622
+ const html = getDocumentElement$1(element);
11123
11623
  const visualViewport = win.visualViewport;
11124
11624
  let width = html.clientWidth;
11125
11625
  let height = html.clientHeight;
11126
11626
  let x = 0;
11127
11627
  let y = 0;
11128
-
11129
11628
  if (visualViewport) {
11130
11629
  width = visualViewport.width;
11131
11630
  height = visualViewport.height;
11132
- const layoutViewport = isLayoutViewport();
11133
-
11134
- if (layoutViewport || !layoutViewport && strategy === 'fixed') {
11631
+ const visualViewportBased = isWebKit();
11632
+ if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {
11135
11633
  x = visualViewport.offsetLeft;
11136
11634
  y = visualViewport.offsetTop;
11137
11635
  }
11138
11636
  }
11139
-
11140
11637
  return {
11141
11638
  width,
11142
11639
  height,
@@ -11145,23 +11642,16 @@
11145
11642
  };
11146
11643
  }
11147
11644
 
11148
- // of the `<html>` and `<body>` rect bounds if horizontally scrollable
11149
-
11150
- function getDocumentRect(element) {
11151
- var _element$ownerDocumen;
11152
-
11153
- const html = getDocumentElement(element);
11154
- const scroll = getNodeScroll(element);
11155
- const body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
11156
- const width = max$1(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
11157
- const height = max$1(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
11158
- let x = -scroll.scrollLeft + getWindowScrollBarX(element);
11159
- const y = -scroll.scrollTop;
11160
-
11161
- if (getComputedStyle$1(body || html).direction === 'rtl') {
11162
- x += max$1(html.clientWidth, body ? body.clientWidth : 0) - width;
11163
- }
11164
-
11645
+ // Returns the inner client rect, subtracting scrollbars if present.
11646
+ function getInnerBoundingClientRect$1(element, strategy) {
11647
+ const clientRect = getBoundingClientRect$1(element, true, strategy === 'fixed');
11648
+ const top = clientRect.top + element.clientTop;
11649
+ const left = clientRect.left + element.clientLeft;
11650
+ const scale = isHTMLElement$1(element) ? getScale(element) : createCoords(1);
11651
+ const width = element.clientWidth * scale.x;
11652
+ const height = element.clientHeight * scale.y;
11653
+ const x = left * scale.x;
11654
+ const y = top * scale.y;
11165
11655
  return {
11166
11656
  width,
11167
11657
  height,
@@ -11169,125 +11659,86 @@
11169
11659
  y
11170
11660
  };
11171
11661
  }
11172
-
11173
- function getNearestOverflowAncestor(node) {
11174
- const parentNode = getParentNode(node);
11175
-
11176
- if (['html', 'body', '#document'].includes(getNodeName(parentNode))) {
11177
- // @ts-ignore assume body is always available
11178
- return node.ownerDocument.body;
11179
- }
11180
-
11181
- if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
11182
- return parentNode;
11183
- }
11184
-
11185
- return getNearestOverflowAncestor(parentNode);
11186
- }
11187
-
11188
- function getOverflowAncestors(node, list) {
11189
- var _node$ownerDocument;
11190
-
11191
- if (list === void 0) {
11192
- list = [];
11662
+ function getClientRectFromClippingAncestor$1(element, clippingAncestor, strategy) {
11663
+ let rect;
11664
+ if (clippingAncestor === 'viewport') {
11665
+ rect = getViewportRect$1(element, strategy);
11666
+ } else if (clippingAncestor === 'document') {
11667
+ rect = getDocumentRect$1(getDocumentElement$1(element));
11668
+ } else if (isElement$1(clippingAncestor)) {
11669
+ rect = getInnerBoundingClientRect$1(clippingAncestor, strategy);
11670
+ } else {
11671
+ const visualOffsets = getVisualOffsets(element);
11672
+ rect = {
11673
+ ...clippingAncestor,
11674
+ x: clippingAncestor.x - visualOffsets.x,
11675
+ y: clippingAncestor.y - visualOffsets.y
11676
+ };
11193
11677
  }
11194
-
11195
- const scrollableAncestor = getNearestOverflowAncestor(node);
11196
- const isBody = scrollableAncestor === ((_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.body);
11197
- const win = getWindow(scrollableAncestor);
11198
- const target = isBody ? [win].concat(win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : []) : scrollableAncestor;
11199
- const updatedList = list.concat(target);
11200
- return isBody ? updatedList : // @ts-ignore: isBody tells us target will be an HTMLElement here
11201
- updatedList.concat(getOverflowAncestors(target));
11678
+ return rectToClientRect$1(rect);
11202
11679
  }
11203
-
11204
- function contains(parent, child) {
11205
- const rootNode = child.getRootNode == null ? void 0 : child.getRootNode(); // First, attempt with faster native method
11206
-
11207
- if (parent.contains(child)) {
11208
- return true;
11209
- } // then fallback to custom implementation with Shadow DOM support
11210
- else if (rootNode && isShadowRoot(rootNode)) {
11211
- let next = child;
11212
-
11213
- do {
11214
- // use `===` replace node.isSameNode()
11215
- if (next && parent === next) {
11216
- return true;
11217
- } // @ts-ignore: need a better way to handle this...
11218
-
11219
-
11220
- next = next.parentNode || next.host;
11221
- } while (next);
11680
+ function hasFixedPositionAncestor(element, stopNode) {
11681
+ const parentNode = getParentNode$1(element);
11682
+ if (parentNode === stopNode || !isElement$1(parentNode) || isLastTraversableNode(parentNode)) {
11683
+ return false;
11222
11684
  }
11223
-
11224
- return false;
11225
- }
11226
-
11227
- function getInnerBoundingClientRect(element, strategy) {
11228
- const clientRect = getBoundingClientRect(element, false, strategy === 'fixed');
11229
- const top = clientRect.top + element.clientTop;
11230
- const left = clientRect.left + element.clientLeft;
11231
- return {
11232
- top,
11233
- left,
11234
- x: left,
11235
- y: top,
11236
- right: left + element.clientWidth,
11237
- bottom: top + element.clientHeight,
11238
- width: element.clientWidth,
11239
- height: element.clientHeight
11240
- };
11685
+ return getComputedStyle$2(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
11241
11686
  }
11242
11687
 
11243
- function getClientRectFromClippingAncestor(element, clippingParent, strategy) {
11244
- if (clippingParent === 'viewport') {
11245
- return rectToClientRect(getViewportRect(element, strategy));
11688
+ // A "clipping ancestor" is an `overflow` element with the characteristic of
11689
+ // clipping (or hiding) child elements. This returns all clipping ancestors
11690
+ // of the given element up the tree.
11691
+ function getClippingElementAncestors(element, cache) {
11692
+ const cachedResult = cache.get(element);
11693
+ if (cachedResult) {
11694
+ return cachedResult;
11246
11695
  }
11696
+ let result = getOverflowAncestors$1(element, [], false).filter(el => isElement$1(el) && getNodeName$1(el) !== 'body');
11697
+ let currentContainingBlockComputedStyle = null;
11698
+ const elementIsFixed = getComputedStyle$2(element).position === 'fixed';
11699
+ let currentNode = elementIsFixed ? getParentNode$1(element) : element;
11247
11700
 
11248
- if (isElement(clippingParent)) {
11249
- return getInnerBoundingClientRect(clippingParent, strategy);
11701
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
11702
+ while (isElement$1(currentNode) && !isLastTraversableNode(currentNode)) {
11703
+ const computedStyle = getComputedStyle$2(currentNode);
11704
+ const currentNodeIsContaining = isContainingBlock$1(currentNode);
11705
+ if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
11706
+ currentContainingBlockComputedStyle = null;
11707
+ }
11708
+ const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement$1(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
11709
+ if (shouldDropCurrentNode) {
11710
+ // Drop non-containing blocks.
11711
+ result = result.filter(ancestor => ancestor !== currentNode);
11712
+ } else {
11713
+ // Record last containing block for next iteration.
11714
+ currentContainingBlockComputedStyle = computedStyle;
11715
+ }
11716
+ currentNode = getParentNode$1(currentNode);
11250
11717
  }
11718
+ cache.set(element, result);
11719
+ return result;
11720
+ }
11251
11721
 
11252
- return rectToClientRect(getDocumentRect(getDocumentElement(element)));
11253
- } // A "clipping ancestor" is an overflowable container with the characteristic of
11254
- // clipping (or hiding) overflowing elements with a position different from
11255
- // `initial`
11256
-
11257
-
11258
- function getClippingAncestors(element) {
11259
- const clippingAncestors = getOverflowAncestors(element);
11260
- const canEscapeClipping = ['absolute', 'fixed'].includes(getComputedStyle$1(element).position);
11261
- const clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
11262
-
11263
- if (!isElement(clipperElement)) {
11264
- return [];
11265
- } // @ts-ignore isElement check ensures we return Array<Element>
11266
-
11267
-
11268
- return clippingAncestors.filter(clippingAncestors => isElement(clippingAncestors) && contains(clippingAncestors, clipperElement) && getNodeName(clippingAncestors) !== 'body');
11269
- } // Gets the maximum area that the element is visible in due to any number of
11270
- // clipping ancestors
11271
-
11272
-
11273
- function getClippingRect(_ref) {
11722
+ // Gets the maximum area that the element is visible in due to any number of
11723
+ // clipping ancestors.
11724
+ function getClippingRect$1(_ref) {
11274
11725
  let {
11275
11726
  element,
11276
11727
  boundary,
11277
11728
  rootBoundary,
11278
11729
  strategy
11279
11730
  } = _ref;
11280
- const mainClippingAncestors = boundary === 'clippingAncestors' ? getClippingAncestors(element) : [].concat(boundary);
11281
- const clippingAncestors = [...mainClippingAncestors, rootBoundary];
11731
+ const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
11732
+ const clippingAncestors = [...elementClippingAncestors, rootBoundary];
11282
11733
  const firstClippingAncestor = clippingAncestors[0];
11283
11734
  const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
11284
- const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
11285
- accRect.top = max$1(rect.top, accRect.top);
11286
- accRect.right = min$1(rect.right, accRect.right);
11287
- accRect.bottom = min$1(rect.bottom, accRect.bottom);
11288
- accRect.left = max$1(rect.left, accRect.left);
11735
+ const rect = getClientRectFromClippingAncestor$1(element, clippingAncestor, strategy);
11736
+ accRect.top = max$3(rect.top, accRect.top);
11737
+ accRect.right = min$3(rect.right, accRect.right);
11738
+ accRect.bottom = min$3(rect.bottom, accRect.bottom);
11739
+ accRect.left = max$3(rect.left, accRect.left);
11289
11740
  return accRect;
11290
- }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
11741
+ }, getClientRectFromClippingAncestor$1(element, firstClippingAncestor, strategy));
11291
11742
  return {
11292
11743
  width: clippingRect.right - clippingRect.left,
11293
11744
  height: clippingRect.bottom - clippingRect.top,
@@ -11296,115 +11747,210 @@
11296
11747
  };
11297
11748
  }
11298
11749
 
11299
- const platform = {
11300
- getClippingRect,
11301
- convertOffsetParentRelativeRectToViewportRelativeRect,
11302
- isElement,
11303
- getDimensions,
11304
- getOffsetParent,
11305
- getDocumentElement,
11306
- getElementRects: _ref => {
11307
- let {
11308
- reference,
11309
- floating,
11310
- strategy
11311
- } = _ref;
11312
- return {
11313
- reference: getRectRelativeToOffsetParent(reference, getOffsetParent(floating), strategy),
11314
- floating: { ...getDimensions(floating),
11315
- x: 0,
11316
- y: 0
11317
- }
11318
- };
11319
- },
11320
- getClientRects: element => Array.from(element.getClientRects()),
11321
- isRTL: element => getComputedStyle$1(element).direction === 'rtl'
11322
- };
11750
+ function getDimensions$1(element) {
11751
+ const {
11752
+ width,
11753
+ height
11754
+ } = getCssDimensions(element);
11755
+ return {
11756
+ width,
11757
+ height
11758
+ };
11759
+ }
11323
11760
 
11324
- /**
11325
- * Automatically updates the position of the floating element when necessary.
11326
- * @see https://floating-ui.com/docs/autoUpdate
11327
- */
11328
- function autoUpdate(reference, floating, update, options) {
11329
- if (options === void 0) {
11330
- options = {};
11761
+ function getRectRelativeToOffsetParent$1(element, offsetParent, strategy) {
11762
+ const isOffsetParentAnElement = isHTMLElement$1(offsetParent);
11763
+ const documentElement = getDocumentElement$1(offsetParent);
11764
+ const isFixed = strategy === 'fixed';
11765
+ const rect = getBoundingClientRect$1(element, true, isFixed, offsetParent);
11766
+ let scroll = {
11767
+ scrollLeft: 0,
11768
+ scrollTop: 0
11769
+ };
11770
+ const offsets = createCoords(0);
11771
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
11772
+ if (getNodeName$1(offsetParent) !== 'body' || isOverflowElement$1(documentElement)) {
11773
+ scroll = getNodeScroll$1(offsetParent);
11774
+ }
11775
+ if (isOffsetParentAnElement) {
11776
+ const offsetRect = getBoundingClientRect$1(offsetParent, true, isFixed, offsetParent);
11777
+ offsets.x = offsetRect.x + offsetParent.clientLeft;
11778
+ offsets.y = offsetRect.y + offsetParent.clientTop;
11779
+ } else if (documentElement) {
11780
+ offsets.x = getWindowScrollBarX$1(documentElement);
11781
+ }
11331
11782
  }
11783
+ const x = rect.left + scroll.scrollLeft - offsets.x;
11784
+ const y = rect.top + scroll.scrollTop - offsets.y;
11785
+ return {
11786
+ x,
11787
+ y,
11788
+ width: rect.width,
11789
+ height: rect.height
11790
+ };
11791
+ }
11332
11792
 
11333
- const {
11334
- ancestorScroll: _ancestorScroll = true,
11335
- ancestorResize: _ancestorResize = true,
11336
- elementResize = true,
11337
- animationFrame = false
11338
- } = options;
11339
- const ancestorScroll = _ancestorScroll && !animationFrame;
11340
- const ancestorResize = _ancestorResize && !animationFrame;
11341
- const ancestors = ancestorScroll || ancestorResize ? [...(isElement(reference) ? getOverflowAncestors(reference) : []), ...getOverflowAncestors(floating)] : [];
11342
- ancestors.forEach(ancestor => {
11343
- ancestorScroll && ancestor.addEventListener('scroll', update, {
11344
- passive: true
11345
- });
11346
- ancestorResize && ancestor.addEventListener('resize', update);
11347
- });
11348
- let observer = null;
11793
+ function isStaticPositioned(element) {
11794
+ return getComputedStyle$2(element).position === 'static';
11795
+ }
11349
11796
 
11350
- if (elementResize) {
11351
- let initialUpdate = true;
11352
- observer = new ResizeObserver(() => {
11353
- if (!initialUpdate) {
11354
- update();
11355
- }
11797
+ function getTrueOffsetParent$1(element, polyfill) {
11798
+ if (!isHTMLElement$1(element) || getComputedStyle$2(element).position === 'fixed') {
11799
+ return null;
11800
+ }
11801
+ if (polyfill) {
11802
+ return polyfill(element);
11803
+ }
11804
+ return element.offsetParent;
11805
+ }
11356
11806
 
11357
- initialUpdate = false;
11358
- });
11359
- isElement(reference) && !animationFrame && observer.observe(reference);
11360
- observer.observe(floating);
11807
+ // Gets the closest ancestor positioned element. Handles some edge cases,
11808
+ // such as table ancestors and cross browser bugs.
11809
+ function getOffsetParent$1(element, polyfill) {
11810
+ const win = getWindow$1(element);
11811
+ if (isTopLayer(element)) {
11812
+ return win;
11361
11813
  }
11814
+ if (!isHTMLElement$1(element)) {
11815
+ let svgOffsetParent = getParentNode$1(element);
11816
+ while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
11817
+ if (isElement$1(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
11818
+ return svgOffsetParent;
11819
+ }
11820
+ svgOffsetParent = getParentNode$1(svgOffsetParent);
11821
+ }
11822
+ return win;
11823
+ }
11824
+ let offsetParent = getTrueOffsetParent$1(element, polyfill);
11825
+ while (offsetParent && isTableElement$1(offsetParent) && isStaticPositioned(offsetParent)) {
11826
+ offsetParent = getTrueOffsetParent$1(offsetParent, polyfill);
11827
+ }
11828
+ if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock$1(offsetParent)) {
11829
+ return win;
11830
+ }
11831
+ return offsetParent || getContainingBlock$1(element) || win;
11832
+ }
11362
11833
 
11363
- let frameId;
11364
- let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
11834
+ const getElementRects = async function (data) {
11835
+ const getOffsetParentFn = this.getOffsetParent || getOffsetParent$1;
11836
+ const getDimensionsFn = this.getDimensions;
11837
+ const floatingDimensions = await getDimensionsFn(data.floating);
11838
+ return {
11839
+ reference: getRectRelativeToOffsetParent$1(data.reference, await getOffsetParentFn(data.floating), data.strategy),
11840
+ floating: {
11841
+ x: 0,
11842
+ y: 0,
11843
+ width: floatingDimensions.width,
11844
+ height: floatingDimensions.height
11845
+ }
11846
+ };
11847
+ };
11365
11848
 
11366
- if (animationFrame) {
11367
- frameLoop();
11368
- }
11849
+ function isRTL$1(element) {
11850
+ return getComputedStyle$2(element).direction === 'rtl';
11851
+ }
11369
11852
 
11370
- function frameLoop() {
11371
- const nextRefRect = getBoundingClientRect(reference);
11853
+ const platform$1 = {
11854
+ convertOffsetParentRelativeRectToViewportRelativeRect: convertOffsetParentRelativeRectToViewportRelativeRect$1,
11855
+ getDocumentElement: getDocumentElement$1,
11856
+ getClippingRect: getClippingRect$1,
11857
+ getOffsetParent: getOffsetParent$1,
11858
+ getElementRects,
11859
+ getClientRects,
11860
+ getDimensions: getDimensions$1,
11861
+ getScale,
11862
+ isElement: isElement$1,
11863
+ isRTL: isRTL$1
11864
+ };
11372
11865
 
11373
- if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
11374
- update();
11375
- }
11866
+ /**
11867
+ * Modifies the placement by translating the floating element along the
11868
+ * specified axes.
11869
+ * A number (shorthand for `mainAxis` or distance), or an axes configuration
11870
+ * object may be passed.
11871
+ * @see https://floating-ui.com/docs/offset
11872
+ */
11873
+ offset$1;
11376
11874
 
11377
- prevRefRect = nextRefRect;
11378
- frameId = requestAnimationFrame(frameLoop);
11379
- }
11875
+ /**
11876
+ * Optimizes the visibility of the floating element by choosing the placement
11877
+ * that has the most space available automatically, without needing to specify a
11878
+ * preferred placement. Alternative to `flip`.
11879
+ * @see https://floating-ui.com/docs/autoPlacement
11880
+ */
11881
+ autoPlacement;
11380
11882
 
11381
- update();
11382
- return () => {
11383
- var _observer;
11883
+ /**
11884
+ * Optimizes the visibility of the floating element by shifting it in order to
11885
+ * keep it in view when it will overflow the clipping boundary.
11886
+ * @see https://floating-ui.com/docs/shift
11887
+ */
11888
+ shift$1;
11384
11889
 
11385
- ancestors.forEach(ancestor => {
11386
- ancestorScroll && ancestor.removeEventListener('scroll', update);
11387
- ancestorResize && ancestor.removeEventListener('resize', update);
11388
- });
11389
- (_observer = observer) == null ? void 0 : _observer.disconnect();
11390
- observer = null;
11890
+ /**
11891
+ * Optimizes the visibility of the floating element by flipping the `placement`
11892
+ * in order to keep it in view when the preferred placement(s) will overflow the
11893
+ * clipping boundary. Alternative to `autoPlacement`.
11894
+ * @see https://floating-ui.com/docs/flip
11895
+ */
11896
+ flip$1;
11391
11897
 
11392
- if (animationFrame) {
11393
- cancelAnimationFrame(frameId);
11394
- }
11395
- };
11396
- }
11898
+ /**
11899
+ * Provides data that allows you to change the size of the floating element —
11900
+ * for instance, prevent it from overflowing the clipping boundary or match the
11901
+ * width of the reference element.
11902
+ * @see https://floating-ui.com/docs/size
11903
+ */
11904
+ size;
11397
11905
 
11398
11906
  /**
11399
- * Computes the `x` and `y` coordinates that will place the floating element
11400
- * next to a reference element when it is given a certain CSS positioning
11401
- * strategy.
11907
+ * Provides data to hide the floating element in applicable situations, such as
11908
+ * when it is not in the same clipping context as the reference element.
11909
+ * @see https://floating-ui.com/docs/hide
11402
11910
  */
11911
+ hide;
11403
11912
 
11404
- const computePosition = (reference, floating, options) => computePosition$1(reference, floating, {
11405
- platform,
11406
- ...options
11407
- });
11913
+ /**
11914
+ * Provides data to position an inner element of the floating element so that it
11915
+ * appears centered to the reference element.
11916
+ * @see https://floating-ui.com/docs/arrow
11917
+ */
11918
+ const arrow$1 = arrow$2;
11919
+
11920
+ /**
11921
+ * Provides improved positioning for inline reference elements that can span
11922
+ * over multiple lines, such as hyperlinks or range selections.
11923
+ * @see https://floating-ui.com/docs/inline
11924
+ */
11925
+ inline;
11926
+
11927
+ /**
11928
+ * Built-in `limiter` that will stop `shift()` at a certain point.
11929
+ */
11930
+ limitShift;
11931
+
11932
+ /**
11933
+ * Computes the `x` and `y` coordinates that will place the floating element
11934
+ * next to a given reference element.
11935
+ */
11936
+ const computePosition$2 = (reference, floating, options) => {
11937
+ // This caches the expensive `getClippingElementAncestors` function so that
11938
+ // multiple lifecycle resets re-use the same result. It only lives for a
11939
+ // single call. If other functions become expensive, we can add them as well.
11940
+ const cache = new Map();
11941
+ const mergedOptions = {
11942
+ platform: platform$1,
11943
+ ...options
11944
+ };
11945
+ const platformWithCache = {
11946
+ ...mergedOptions.platform,
11947
+ _c: cache
11948
+ };
11949
+ return computePosition$3(reference, floating, {
11950
+ ...mergedOptions,
11951
+ platform: platformWithCache
11952
+ });
11953
+ };
11408
11954
 
11409
11955
  const useFloatingProps = buildProps({});
11410
11956
  const unrefReference = (elRef) => {
@@ -11445,7 +11991,7 @@
11445
11991
  const contentEl = unrefElement(contentRef);
11446
11992
  if (!referenceEl || !contentEl)
11447
11993
  return;
11448
- const data = await computePosition(referenceEl, contentEl, {
11994
+ const data = await computePosition$2(referenceEl, contentEl, {
11449
11995
  placement: vue.unref(placement),
11450
11996
  strategy: vue.unref(strategy),
11451
11997
  middleware: vue.unref(middleware)
@@ -11480,7 +12026,7 @@
11480
12026
  const arrowEl = vue.unref(arrowRef);
11481
12027
  if (!arrowEl)
11482
12028
  return {};
11483
- return arrow({
12029
+ return arrow$1({
11484
12030
  element: arrowEl,
11485
12031
  padding
11486
12032
  }).fn(args);
@@ -11848,6 +12394,9 @@
11848
12394
  card: {
11849
12395
  type: definePropType(Object)
11850
12396
  },
12397
+ dialog: {
12398
+ type: definePropType(Object)
12399
+ },
11851
12400
  link: {
11852
12401
  type: definePropType(Object)
11853
12402
  },
@@ -11885,7 +12434,7 @@
11885
12434
 
11886
12435
  const ElConfigProvider = withInstall(ConfigProvider);
11887
12436
 
11888
- const version$1 = "0.0.20250808";
12437
+ const version$1 = "0.0.20250810";
11889
12438
 
11890
12439
  const makeInstaller = (components = []) => {
11891
12440
  const install = (app, options) => {
@@ -14101,10 +14650,10 @@
14101
14650
  return { contextStyle, paddingSize, borderSize, boxSizing };
14102
14651
  }
14103
14652
  function calcTextareaHeight(targetElement, minRows = 1, maxRows) {
14104
- var _a;
14653
+ var _a, _b;
14105
14654
  if (!hiddenTextarea) {
14106
14655
  hiddenTextarea = document.createElement("textarea");
14107
- document.body.appendChild(hiddenTextarea);
14656
+ ((_a = targetElement.parentNode) != null ? _a : document.body).appendChild(hiddenTextarea);
14108
14657
  }
14109
14658
  const { paddingSize, borderSize, boxSizing, contextStyle } = calculateNodeStyling(targetElement);
14110
14659
  contextStyle.forEach(([key, value]) => hiddenTextarea == null ? void 0 : hiddenTextarea.style.setProperty(key, value));
@@ -14135,7 +14684,7 @@
14135
14684
  height = Math.min(maxHeight, height);
14136
14685
  }
14137
14686
  result.height = `${height}px`;
14138
- (_a = hiddenTextarea.parentNode) == null ? void 0 : _a.removeChild(hiddenTextarea);
14687
+ (_b = hiddenTextarea.parentNode) == null ? void 0 : _b.removeChild(hiddenTextarea);
14139
14688
  hiddenTextarea = void 0;
14140
14689
  return result;
14141
14690
  }
@@ -15399,7 +15948,7 @@
15399
15948
  vue.watch(triggerRef, (el, prevEl) => {
15400
15949
  virtualTriggerAriaStopWatch == null ? void 0 : virtualTriggerAriaStopWatch();
15401
15950
  virtualTriggerAriaStopWatch = void 0;
15402
- if (isElement$1(el)) {
15951
+ if (isElement$2(el)) {
15403
15952
  TRIGGER_ELE_EVENTS.forEach((eventName) => {
15404
15953
  var _a;
15405
15954
  const handler = props[eventName];
@@ -15421,7 +15970,7 @@
15421
15970
  }, { immediate: true });
15422
15971
  }
15423
15972
  }
15424
- if (isElement$1(prevEl) && isFocusable(prevEl)) {
15973
+ if (isElement$2(prevEl) && isFocusable(prevEl)) {
15425
15974
  [
15426
15975
  "aria-controls",
15427
15976
  "aria-describedby",
@@ -15436,7 +15985,7 @@
15436
15985
  vue.onBeforeUnmount(() => {
15437
15986
  virtualTriggerAriaStopWatch == null ? void 0 : virtualTriggerAriaStopWatch();
15438
15987
  virtualTriggerAriaStopWatch = void 0;
15439
- if (triggerRef.value && isElement$1(triggerRef.value)) {
15988
+ if (triggerRef.value && isElement$2(triggerRef.value)) {
15440
15989
  const el = triggerRef.value;
15441
15990
  TRIGGER_ELE_EVENTS.forEach((eventName) => {
15442
15991
  const handler = props[eventName];
@@ -15531,7 +16080,7 @@
15531
16080
  if (element && element.focus) {
15532
16081
  const prevFocusedElement = document.activeElement;
15533
16082
  let cleanup = false;
15534
- if (isElement$1(element) && !isFocusable(element) && !element.getAttribute("tabindex")) {
16083
+ if (isElement$2(element) && !isFocusable(element) && !element.getAttribute("tabindex")) {
15535
16084
  element.setAttribute("tabindex", "-1");
15536
16085
  cleanup = true;
15537
16086
  }
@@ -15540,7 +16089,7 @@
15540
16089
  if (element !== prevFocusedElement && isSelectable(element) && shouldSelect) {
15541
16090
  element.select();
15542
16091
  }
15543
- if (isElement$1(element) && cleanup) {
16092
+ if (isElement$2(element) && cleanup) {
15544
16093
  element.removeAttribute("tabindex");
15545
16094
  }
15546
16095
  }
@@ -16226,14 +16775,14 @@
16226
16775
  triggerTargetAriaStopWatch = void 0;
16227
16776
  const el = vue.unref(triggerTargetEl || contentRef.value);
16228
16777
  const prevEl = vue.unref(prevTriggerTargetEl || contentRef.value);
16229
- if (isElement$1(el)) {
16778
+ if (isElement$2(el)) {
16230
16779
  triggerTargetAriaStopWatch = vue.watch([role, () => props.ariaLabel, ariaModal, () => props.id], (watches) => {
16231
16780
  ["role", "aria-label", "aria-modal", "id"].forEach((key, idx) => {
16232
16781
  isNil(watches[idx]) ? el.removeAttribute(key) : el.setAttribute(key, watches[idx]);
16233
16782
  });
16234
16783
  }, { immediate: true });
16235
16784
  }
16236
- if (prevEl !== el && isElement$1(prevEl)) {
16785
+ if (prevEl !== el && isElement$2(prevEl)) {
16237
16786
  ["role", "aria-label", "aria-modal", "id"].forEach((key) => {
16238
16787
  prevEl.removeAttribute(key);
16239
16788
  });
@@ -18338,6 +18887,10 @@
18338
18887
  this.roundA = Math.round(100 * this.a) / 100;
18339
18888
  return this;
18340
18889
  };
18890
+ TinyColor2.prototype.isMonochrome = function() {
18891
+ var s = this.toHsl().s;
18892
+ return s === 0;
18893
+ };
18341
18894
  TinyColor2.prototype.toHsv = function() {
18342
18895
  var hsv = rgbToHsv(this.r, this.g, this.b);
18343
18896
  return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this.a };
@@ -18384,6 +18937,12 @@
18384
18937
  }
18385
18938
  return "#" + this.toHex8(allow4Char);
18386
18939
  };
18940
+ TinyColor2.prototype.toHexShortString = function(allowShortChar) {
18941
+ if (allowShortChar === void 0) {
18942
+ allowShortChar = false;
18943
+ }
18944
+ return this.a === 1 ? this.toHexString(allowShortChar) : this.toHex8String(allowShortChar);
18945
+ };
18387
18946
  TinyColor2.prototype.toRgb = function() {
18388
18947
  return {
18389
18948
  r: Math.round(this.r),
@@ -18609,10 +19168,12 @@
18609
19168
  TinyColor2.prototype.onBackground = function(background) {
18610
19169
  var fg = this.toRgb();
18611
19170
  var bg = new TinyColor2(background).toRgb();
19171
+ var alpha = fg.a + bg.a * (1 - fg.a);
18612
19172
  return new TinyColor2({
18613
- r: bg.r + (fg.r - bg.r) * fg.a,
18614
- g: bg.g + (fg.g - bg.g) * fg.a,
18615
- b: bg.b + (fg.b - bg.b) * fg.a
19173
+ r: (fg.r * fg.a + bg.r * bg.a * (1 - fg.a)) / alpha,
19174
+ g: (fg.g * fg.a + bg.g * bg.a * (1 - fg.a)) / alpha,
19175
+ b: (fg.b * fg.a + bg.b * bg.a * (1 - fg.a)) / alpha,
19176
+ a: alpha
18616
19177
  });
18617
19178
  };
18618
19179
  TinyColor2.prototype.triad = function() {
@@ -20313,7 +20874,7 @@
20313
20874
  let excludes = [];
20314
20875
  if (isArray$1(binding.arg)) {
20315
20876
  excludes = binding.arg;
20316
- } else if (isElement$1(binding.arg)) {
20877
+ } else if (isElement$2(binding.arg)) {
20317
20878
  excludes.push(binding.arg);
20318
20879
  }
20319
20880
  return function(mouseup, mousedown) {
@@ -23871,7 +24432,7 @@
23871
24432
  }
23872
24433
  return nodes;
23873
24434
  };
23874
- class Node$2 {
24435
+ class Node$3 {
23875
24436
  constructor(data, config, parent, root = false) {
23876
24437
  this.data = data;
23877
24438
  this.config = config;
@@ -23891,7 +24452,7 @@
23891
24452
  this.pathValues = pathNodes.map((node) => node.value);
23892
24453
  this.pathLabels = pathNodes.map((node) => node.label);
23893
24454
  this.childrenData = childrenData;
23894
- this.children = (childrenData || []).map((child) => new Node$2(child, config, this));
24455
+ this.children = (childrenData || []).map((child) => new Node$3(child, config, this));
23895
24456
  this.loaded = !config.lazy || this.isLeaf || !isEmpty(childrenData);
23896
24457
  this.text = "";
23897
24458
  }
@@ -23912,7 +24473,7 @@
23912
24473
  }
23913
24474
  appendChild(childData) {
23914
24475
  const { childrenData, children } = this;
23915
- const node = new Node$2(childData, this.config, this);
24476
+ const node = new Node$3(childData, this.config, this);
23916
24477
  if (isArray$1(childrenData)) {
23917
24478
  childrenData.push(childData);
23918
24479
  } else {
@@ -23976,7 +24537,7 @@
23976
24537
  }
23977
24538
  }
23978
24539
  }
23979
- var Node$3 = Node$2;
24540
+ var Node$4 = Node$3;
23980
24541
 
23981
24542
  const flatNodes = (nodes, leafOnly) => {
23982
24543
  return nodes.reduce((res, node) => {
@@ -23992,7 +24553,7 @@
23992
24553
  class Store {
23993
24554
  constructor(data, config) {
23994
24555
  this.config = config;
23995
- const nodes = (data || []).map((nodeData) => new Node$3(nodeData, this.config));
24556
+ const nodes = (data || []).map((nodeData) => new Node$4(nodeData, this.config));
23996
24557
  this.nodes = nodes;
23997
24558
  this.allNodes = flatNodes(nodes, false);
23998
24559
  this.leafNodes = flatNodes(nodes, true);
@@ -24004,7 +24565,7 @@
24004
24565
  return leafOnly ? this.leafNodes : this.allNodes;
24005
24566
  }
24006
24567
  appendNode(nodeData, parentNode) {
24007
- const node = parentNode ? parentNode.appendChild(nodeData) : new Node$3(nodeData, this.config);
24568
+ const node = parentNode ? parentNode.appendChild(nodeData) : new Node$4(nodeData, this.config);
24008
24569
  if (!parentNode)
24009
24570
  this.nodes.push(node);
24010
24571
  this.appendAllNodesAndLeafNodes(node);
@@ -24166,7 +24727,7 @@
24166
24727
  };
24167
24728
  const lazyLoad = (node, cb) => {
24168
24729
  const cfg = config.value;
24169
- node = node || new Node$3({}, cfg, void 0, true);
24730
+ node = node || new Node$4({}, cfg, void 0, true);
24170
24731
  node.loading = true;
24171
24732
  const resolve = (dataList) => {
24172
24733
  const _node = node;
@@ -31152,12 +31713,21 @@
31152
31713
 
31153
31714
  const dialogContentProps = buildProps({
31154
31715
  center: Boolean,
31155
- alignCenter: Boolean,
31716
+ alignCenter: {
31717
+ type: Boolean,
31718
+ default: void 0
31719
+ },
31156
31720
  closeIcon: {
31157
31721
  type: iconPropType
31158
31722
  },
31159
- draggable: Boolean,
31160
- overflow: Boolean,
31723
+ draggable: {
31724
+ type: Boolean,
31725
+ default: void 0
31726
+ },
31727
+ overflow: {
31728
+ type: Boolean,
31729
+ default: void 0
31730
+ },
31161
31731
  fullscreen: Boolean,
31162
31732
  headerClass: String,
31163
31733
  bodyClass: String,
@@ -31193,13 +31763,13 @@
31193
31763
  const dialogKls = vue.computed(() => [
31194
31764
  ns.b(),
31195
31765
  ns.is("fullscreen", props.fullscreen),
31196
- ns.is("draggable", props.draggable),
31197
- ns.is("align-center", props.alignCenter),
31766
+ ns.is("draggable", !!props.draggable),
31767
+ ns.is("align-center", !!props.alignCenter),
31198
31768
  { [ns.m("center")]: props.center }
31199
31769
  ]);
31200
31770
  const composedDialogRef = composeRefs(focusTrapRef, dialogRef);
31201
- const draggable = vue.computed(() => props.draggable);
31202
- const overflow = vue.computed(() => props.overflow);
31771
+ const draggable = vue.computed(() => !!props.draggable);
31772
+ const overflow = vue.computed(() => !!props.overflow);
31203
31773
  const { resetPosition, updatePosition } = useDraggable(dialogRef, headerRef, draggable, overflow);
31204
31774
  expose({
31205
31775
  resetPosition,
@@ -31316,7 +31886,7 @@
31316
31886
  },
31317
31887
  transition: {
31318
31888
  type: definePropType([String, Object]),
31319
- default: DEFAULT_DIALOG_TRANSITION
31889
+ default: void 0
31320
31890
  }
31321
31891
  });
31322
31892
  const dialogEmits = {
@@ -31328,6 +31898,7 @@
31328
31898
  openAutoFocus: () => true,
31329
31899
  closeAutoFocus: () => true
31330
31900
  };
31901
+ const dialogContextKey = Symbol("dialogContextKey");
31331
31902
 
31332
31903
  const useDialog = (props, targetRef) => {
31333
31904
  var _a;
@@ -31343,7 +31914,15 @@
31343
31914
  const zIndex = vue.ref((_a = props.zIndex) != null ? _a : nextZIndex());
31344
31915
  let openTimer = void 0;
31345
31916
  let closeTimer = void 0;
31346
- const namespace = useGlobalConfig("namespace", defaultNamespace);
31917
+ const config = useGlobalConfig();
31918
+ const namespace = vue.computed(() => {
31919
+ var _a2, _b;
31920
+ return (_b = (_a2 = config.value) == null ? void 0 : _a2.namespace) != null ? _b : defaultNamespace;
31921
+ });
31922
+ const globalConfig = vue.computed(() => {
31923
+ var _a2;
31924
+ return (_a2 = config.value) == null ? void 0 : _a2.dialog;
31925
+ });
31347
31926
  const style = vue.computed(() => {
31348
31927
  const style2 = {};
31349
31928
  const varPrefix = `--${namespace.value}-dialog`;
@@ -31357,21 +31936,35 @@
31357
31936
  }
31358
31937
  return style2;
31359
31938
  });
31939
+ const _draggable = vue.computed(() => {
31940
+ var _a2, _b, _c;
31941
+ return ((_c = (_b = props.draggable) != null ? _b : (_a2 = globalConfig.value) == null ? void 0 : _a2.draggable) != null ? _c : false) && !props.fullscreen;
31942
+ });
31943
+ const _alignCenter = vue.computed(() => {
31944
+ var _a2, _b, _c;
31945
+ return (_c = (_b = props.alignCenter) != null ? _b : (_a2 = globalConfig.value) == null ? void 0 : _a2.alignCenter) != null ? _c : false;
31946
+ });
31947
+ const _overflow = vue.computed(() => {
31948
+ var _a2, _b, _c;
31949
+ return (_c = (_b = props.overflow) != null ? _b : (_a2 = globalConfig.value) == null ? void 0 : _a2.overflow) != null ? _c : false;
31950
+ });
31360
31951
  const overlayDialogStyle = vue.computed(() => {
31361
- if (props.alignCenter) {
31952
+ if (_alignCenter.value) {
31362
31953
  return { display: "flex" };
31363
31954
  }
31364
31955
  return {};
31365
31956
  });
31366
31957
  const transitionConfig = vue.computed(() => {
31958
+ var _a2, _b, _c;
31959
+ const transition = (_c = (_b = props.transition) != null ? _b : (_a2 = globalConfig.value) == null ? void 0 : _a2.transition) != null ? _c : DEFAULT_DIALOG_TRANSITION;
31367
31960
  const baseConfig = {
31368
- name: props.transition,
31961
+ name: transition,
31369
31962
  onAfterEnter: afterEnter,
31370
31963
  onBeforeLeave: beforeLeave,
31371
31964
  onAfterLeave: afterLeave
31372
31965
  };
31373
- if (isObject$1(props.transition)) {
31374
- const config = { ...props.transition };
31966
+ if (isObject$1(transition)) {
31967
+ const config2 = { ...transition };
31375
31968
  const _mergeHook = (userHook, defaultHook) => {
31376
31969
  return (el) => {
31377
31970
  if (isArray$1(userHook)) {
@@ -31385,13 +31978,13 @@
31385
31978
  defaultHook();
31386
31979
  };
31387
31980
  };
31388
- config.onAfterEnter = _mergeHook(config.onAfterEnter, afterEnter);
31389
- config.onBeforeLeave = _mergeHook(config.onBeforeLeave, beforeLeave);
31390
- config.onAfterLeave = _mergeHook(config.onAfterLeave, afterLeave);
31391
- if (!config.name) {
31392
- config.name = DEFAULT_DIALOG_TRANSITION;
31981
+ config2.onAfterEnter = _mergeHook(config2.onAfterEnter, afterEnter);
31982
+ config2.onBeforeLeave = _mergeHook(config2.onBeforeLeave, beforeLeave);
31983
+ config2.onAfterLeave = _mergeHook(config2.onAfterLeave, afterLeave);
31984
+ if (!config2.name) {
31985
+ config2.name = DEFAULT_DIALOG_TRANSITION;
31393
31986
  }
31394
- return config;
31987
+ return config2;
31395
31988
  }
31396
31989
  return baseConfig;
31397
31990
  });
@@ -31534,7 +32127,10 @@
31534
32127
  rendered,
31535
32128
  visible,
31536
32129
  zIndex,
31537
- transitionConfig
32130
+ transitionConfig,
32131
+ _draggable,
32132
+ _alignCenter,
32133
+ _overflow
31538
32134
  };
31539
32135
  };
31540
32136
 
@@ -31569,6 +32165,9 @@
31569
32165
  rendered,
31570
32166
  transitionConfig,
31571
32167
  zIndex,
32168
+ _draggable,
32169
+ _alignCenter,
32170
+ _overflow,
31572
32171
  handleClose,
31573
32172
  onModalClick,
31574
32173
  onOpenAutoFocus,
@@ -31585,7 +32184,6 @@
31585
32184
  style
31586
32185
  });
31587
32186
  const overlayEvent = useSameTarget(onModalClick);
31588
- const draggable = vue.computed(() => props.draggable && !props.fullscreen);
31589
32187
  const penetrable = vue.computed(() => props.modalPenetrable && !props.modal && !props.fullscreen);
31590
32188
  const resetPosition = () => {
31591
32189
  var _a;
@@ -31646,10 +32244,10 @@
31646
32244
  ref: dialogContentRef
31647
32245
  }, _ctx.$attrs, {
31648
32246
  center: _ctx.center,
31649
- "align-center": _ctx.alignCenter,
32247
+ "align-center": vue.unref(_alignCenter),
31650
32248
  "close-icon": _ctx.closeIcon,
31651
- draggable: vue.unref(draggable),
31652
- overflow: _ctx.overflow,
32249
+ draggable: vue.unref(_draggable),
32250
+ overflow: vue.unref(_overflow),
31653
32251
  fullscreen: _ctx.fullscreen,
31654
32252
  "header-class": _ctx.headerClass,
31655
32253
  "body-class": _ctx.bodyClass,
@@ -33811,7 +34409,7 @@
33811
34409
  return;
33812
34410
  await vue.nextTick();
33813
34411
  const { scrollContainer } = props;
33814
- if (isElement$1(scrollContainer)) {
34412
+ if (isElement$2(scrollContainer)) {
33815
34413
  _scrollContainer.value = scrollContainer;
33816
34414
  } else if (isString$1(scrollContainer) && scrollContainer !== "") {
33817
34415
  _scrollContainer.value = (_a = document.querySelector(scrollContainer)) != null ? _a : void 0;
@@ -41085,7 +41683,7 @@
41085
41683
  });
41086
41684
  var FixedSizeGrid$1 = FixedSizeGrid;
41087
41685
 
41088
- const { max, min, floor } = Math;
41686
+ const { max: max$2, min: min$2, floor } = Math;
41089
41687
  const ACCESS_SIZER_KEY_MAP = {
41090
41688
  column: "columnWidth",
41091
41689
  row: "rowHeight"
@@ -41130,7 +41728,7 @@
41130
41728
  high = mid - 1;
41131
41729
  }
41132
41730
  }
41133
- return max(0, low - 1);
41731
+ return max$2(0, low - 1);
41134
41732
  };
41135
41733
  const es = (props, gridCache, idx, offset, type) => {
41136
41734
  const total = type === "column" ? props.totalColumn : props.totalRow;
@@ -41139,7 +41737,7 @@
41139
41737
  idx += exponent;
41140
41738
  exponent *= 2;
41141
41739
  }
41142
- return bs(props, gridCache, floor(idx / 2), min(idx, total - 1), offset, type);
41740
+ return bs(props, gridCache, floor(idx / 2), min$2(idx, total - 1), offset, type);
41143
41741
  };
41144
41742
  const findItem = (props, gridCache, offset, type) => {
41145
41743
  const [cache, lastVisitedIndex] = [
@@ -41150,7 +41748,7 @@
41150
41748
  if (lastVisitedItemOffset >= offset) {
41151
41749
  return bs(props, gridCache, 0, lastVisitedIndex, offset, type);
41152
41750
  }
41153
- return es(props, gridCache, max(0, lastVisitedIndex), offset, type);
41751
+ return es(props, gridCache, max$2(0, lastVisitedIndex), offset, type);
41154
41752
  };
41155
41753
  const getEstimatedTotalHeight = ({ totalRow }, { estimatedRowHeight, lastVisitedRowIndex, row }) => {
41156
41754
  let sizeOfVisitedRows = 0;
@@ -41189,8 +41787,8 @@
41189
41787
  ];
41190
41788
  const item = getItemFromCache(props, index, cache, type);
41191
41789
  const estimatedSize = estimatedSizeAssociates(props, cache);
41192
- const maxOffset = max(0, min(estimatedSize - size, item.offset));
41193
- const minOffset = max(0, item.offset - size + scrollBarWidth + item.size);
41790
+ const maxOffset = max$2(0, min$2(estimatedSize - size, item.offset));
41791
+ const minOffset = max$2(0, item.offset - size + scrollBarWidth + item.size);
41194
41792
  if (alignment === SMART_ALIGNMENT) {
41195
41793
  if (scrollOffset >= minOffset - size && scrollOffset <= maxOffset + size) {
41196
41794
  alignment = AUTO_ALIGNMENT;
@@ -47142,7 +47740,7 @@
47142
47740
  if (column.children && column.children.length > 0)
47143
47741
  return;
47144
47742
  const el = event.target;
47145
- if (!isElement$1(el)) {
47743
+ if (!isElement$2(el)) {
47146
47744
  return;
47147
47745
  }
47148
47746
  const target = el == null ? void 0 : el.closest("th");
@@ -53267,6 +53865,1297 @@
53267
53865
  });
53268
53866
  var TooltipV2Arrow = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["__file", "arrow.vue"]]);
53269
53867
 
53868
+ function getSide(placement) {
53869
+ return placement.split('-')[0];
53870
+ }
53871
+
53872
+ function getAlignment(placement) {
53873
+ return placement.split('-')[1];
53874
+ }
53875
+
53876
+ function getMainAxisFromPlacement(placement) {
53877
+ return ['top', 'bottom'].includes(getSide(placement)) ? 'x' : 'y';
53878
+ }
53879
+
53880
+ function getLengthFromAxis(axis) {
53881
+ return axis === 'y' ? 'height' : 'width';
53882
+ }
53883
+
53884
+ function computeCoordsFromPlacement(_ref, placement, rtl) {
53885
+ let {
53886
+ reference,
53887
+ floating
53888
+ } = _ref;
53889
+ const commonX = reference.x + reference.width / 2 - floating.width / 2;
53890
+ const commonY = reference.y + reference.height / 2 - floating.height / 2;
53891
+ const mainAxis = getMainAxisFromPlacement(placement);
53892
+ const length = getLengthFromAxis(mainAxis);
53893
+ const commonAlign = reference[length] / 2 - floating[length] / 2;
53894
+ const side = getSide(placement);
53895
+ const isVertical = mainAxis === 'x';
53896
+ let coords;
53897
+
53898
+ switch (side) {
53899
+ case 'top':
53900
+ coords = {
53901
+ x: commonX,
53902
+ y: reference.y - floating.height
53903
+ };
53904
+ break;
53905
+
53906
+ case 'bottom':
53907
+ coords = {
53908
+ x: commonX,
53909
+ y: reference.y + reference.height
53910
+ };
53911
+ break;
53912
+
53913
+ case 'right':
53914
+ coords = {
53915
+ x: reference.x + reference.width,
53916
+ y: commonY
53917
+ };
53918
+ break;
53919
+
53920
+ case 'left':
53921
+ coords = {
53922
+ x: reference.x - floating.width,
53923
+ y: commonY
53924
+ };
53925
+ break;
53926
+
53927
+ default:
53928
+ coords = {
53929
+ x: reference.x,
53930
+ y: reference.y
53931
+ };
53932
+ }
53933
+
53934
+ switch (getAlignment(placement)) {
53935
+ case 'start':
53936
+ coords[mainAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
53937
+ break;
53938
+
53939
+ case 'end':
53940
+ coords[mainAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
53941
+ break;
53942
+ }
53943
+
53944
+ return coords;
53945
+ }
53946
+
53947
+ /**
53948
+ * Computes the `x` and `y` coordinates that will place the floating element
53949
+ * next to a reference element when it is given a certain positioning strategy.
53950
+ *
53951
+ * This export does not have any `platform` interface logic. You will need to
53952
+ * write one for the platform you are using Floating UI with.
53953
+ */
53954
+
53955
+ const computePosition$1 = async (reference, floating, config) => {
53956
+ const {
53957
+ placement = 'bottom',
53958
+ strategy = 'absolute',
53959
+ middleware = [],
53960
+ platform
53961
+ } = config;
53962
+ const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
53963
+
53964
+ let rects = await platform.getElementRects({
53965
+ reference,
53966
+ floating,
53967
+ strategy
53968
+ });
53969
+ let {
53970
+ x,
53971
+ y
53972
+ } = computeCoordsFromPlacement(rects, placement, rtl);
53973
+ let statefulPlacement = placement;
53974
+ let middlewareData = {};
53975
+ let resetCount = 0;
53976
+
53977
+ for (let i = 0; i < middleware.length; i++) {
53978
+ const {
53979
+ name,
53980
+ fn
53981
+ } = middleware[i];
53982
+ const {
53983
+ x: nextX,
53984
+ y: nextY,
53985
+ data,
53986
+ reset
53987
+ } = await fn({
53988
+ x,
53989
+ y,
53990
+ initialPlacement: placement,
53991
+ placement: statefulPlacement,
53992
+ strategy,
53993
+ middlewareData,
53994
+ rects,
53995
+ platform,
53996
+ elements: {
53997
+ reference,
53998
+ floating
53999
+ }
54000
+ });
54001
+ x = nextX != null ? nextX : x;
54002
+ y = nextY != null ? nextY : y;
54003
+ middlewareData = { ...middlewareData,
54004
+ [name]: { ...middlewareData[name],
54005
+ ...data
54006
+ }
54007
+ };
54008
+
54009
+ if (reset && resetCount <= 50) {
54010
+ resetCount++;
54011
+
54012
+ if (typeof reset === 'object') {
54013
+ if (reset.placement) {
54014
+ statefulPlacement = reset.placement;
54015
+ }
54016
+
54017
+ if (reset.rects) {
54018
+ rects = reset.rects === true ? await platform.getElementRects({
54019
+ reference,
54020
+ floating,
54021
+ strategy
54022
+ }) : reset.rects;
54023
+ }
54024
+
54025
+ ({
54026
+ x,
54027
+ y
54028
+ } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
54029
+ }
54030
+
54031
+ i = -1;
54032
+ continue;
54033
+ }
54034
+ }
54035
+
54036
+ return {
54037
+ x,
54038
+ y,
54039
+ placement: statefulPlacement,
54040
+ strategy,
54041
+ middlewareData
54042
+ };
54043
+ };
54044
+
54045
+ function expandPaddingObject(padding) {
54046
+ return {
54047
+ top: 0,
54048
+ right: 0,
54049
+ bottom: 0,
54050
+ left: 0,
54051
+ ...padding
54052
+ };
54053
+ }
54054
+
54055
+ function getSideObjectFromPadding(padding) {
54056
+ return typeof padding !== 'number' ? expandPaddingObject(padding) : {
54057
+ top: padding,
54058
+ right: padding,
54059
+ bottom: padding,
54060
+ left: padding
54061
+ };
54062
+ }
54063
+
54064
+ function rectToClientRect(rect) {
54065
+ return { ...rect,
54066
+ top: rect.y,
54067
+ left: rect.x,
54068
+ right: rect.x + rect.width,
54069
+ bottom: rect.y + rect.height
54070
+ };
54071
+ }
54072
+
54073
+ /**
54074
+ * Resolves with an object of overflow side offsets that determine how much the
54075
+ * element is overflowing a given clipping boundary.
54076
+ * - positive = overflowing the boundary by that number of pixels
54077
+ * - negative = how many pixels left before it will overflow
54078
+ * - 0 = lies flush with the boundary
54079
+ * @see https://floating-ui.com/docs/detectOverflow
54080
+ */
54081
+ async function detectOverflow(middlewareArguments, options) {
54082
+ var _await$platform$isEle;
54083
+
54084
+ if (options === void 0) {
54085
+ options = {};
54086
+ }
54087
+
54088
+ const {
54089
+ x,
54090
+ y,
54091
+ platform,
54092
+ rects,
54093
+ elements,
54094
+ strategy
54095
+ } = middlewareArguments;
54096
+ const {
54097
+ boundary = 'clippingAncestors',
54098
+ rootBoundary = 'viewport',
54099
+ elementContext = 'floating',
54100
+ altBoundary = false,
54101
+ padding = 0
54102
+ } = options;
54103
+ const paddingObject = getSideObjectFromPadding(padding);
54104
+ const altContext = elementContext === 'floating' ? 'reference' : 'floating';
54105
+ const element = elements[altBoundary ? altContext : elementContext];
54106
+ const clippingClientRect = rectToClientRect(await platform.getClippingRect({
54107
+ element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
54108
+ boundary,
54109
+ rootBoundary,
54110
+ strategy
54111
+ }));
54112
+ const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
54113
+ rect: elementContext === 'floating' ? { ...rects.floating,
54114
+ x,
54115
+ y
54116
+ } : rects.reference,
54117
+ offsetParent: await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)),
54118
+ strategy
54119
+ }) : rects[elementContext]);
54120
+ return {
54121
+ top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
54122
+ bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
54123
+ left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
54124
+ right: elementClientRect.right - clippingClientRect.right + paddingObject.right
54125
+ };
54126
+ }
54127
+
54128
+ const min$1 = Math.min;
54129
+ const max$1 = Math.max;
54130
+
54131
+ function within(min$1$1, value, max$1$1) {
54132
+ return max$1(min$1$1, min$1(value, max$1$1));
54133
+ }
54134
+
54135
+ /**
54136
+ * Positions an inner element of the floating element such that it is centered
54137
+ * to the reference element.
54138
+ * @see https://floating-ui.com/docs/arrow
54139
+ */
54140
+ const arrow = options => ({
54141
+ name: 'arrow',
54142
+ options,
54143
+
54144
+ async fn(middlewareArguments) {
54145
+ // Since `element` is required, we don't Partial<> the type
54146
+ const {
54147
+ element,
54148
+ padding = 0
54149
+ } = options != null ? options : {};
54150
+ const {
54151
+ x,
54152
+ y,
54153
+ placement,
54154
+ rects,
54155
+ platform
54156
+ } = middlewareArguments;
54157
+
54158
+ if (element == null) {
54159
+
54160
+ return {};
54161
+ }
54162
+
54163
+ const paddingObject = getSideObjectFromPadding(padding);
54164
+ const coords = {
54165
+ x,
54166
+ y
54167
+ };
54168
+ const axis = getMainAxisFromPlacement(placement);
54169
+ const alignment = getAlignment(placement);
54170
+ const length = getLengthFromAxis(axis);
54171
+ const arrowDimensions = await platform.getDimensions(element);
54172
+ const minProp = axis === 'y' ? 'top' : 'left';
54173
+ const maxProp = axis === 'y' ? 'bottom' : 'right';
54174
+ const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
54175
+ const startDiff = coords[axis] - rects.reference[axis];
54176
+ const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
54177
+ let clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
54178
+
54179
+ if (clientSize === 0) {
54180
+ clientSize = rects.floating[length];
54181
+ }
54182
+
54183
+ const centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the floating element if the center
54184
+ // point is outside the floating element's bounds
54185
+
54186
+ const min = paddingObject[minProp];
54187
+ const max = clientSize - arrowDimensions[length] - paddingObject[maxProp];
54188
+ const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
54189
+ const offset = within(min, center, max); // Make sure that arrow points at the reference
54190
+
54191
+ const alignmentPadding = alignment === 'start' ? paddingObject[minProp] : paddingObject[maxProp];
54192
+ const shouldAddOffset = alignmentPadding > 0 && center !== offset && rects.reference[length] <= rects.floating[length];
54193
+ const alignmentOffset = shouldAddOffset ? center < min ? min - center : max - center : 0;
54194
+ return {
54195
+ [axis]: coords[axis] - alignmentOffset,
54196
+ data: {
54197
+ [axis]: offset,
54198
+ centerOffset: center - offset
54199
+ }
54200
+ };
54201
+ }
54202
+
54203
+ });
54204
+
54205
+ const hash$1 = {
54206
+ left: 'right',
54207
+ right: 'left',
54208
+ bottom: 'top',
54209
+ top: 'bottom'
54210
+ };
54211
+ function getOppositePlacement(placement) {
54212
+ return placement.replace(/left|right|bottom|top/g, matched => hash$1[matched]);
54213
+ }
54214
+
54215
+ function getAlignmentSides(placement, rects, rtl) {
54216
+ if (rtl === void 0) {
54217
+ rtl = false;
54218
+ }
54219
+
54220
+ const alignment = getAlignment(placement);
54221
+ const mainAxis = getMainAxisFromPlacement(placement);
54222
+ const length = getLengthFromAxis(mainAxis);
54223
+ let mainAlignmentSide = mainAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
54224
+
54225
+ if (rects.reference[length] > rects.floating[length]) {
54226
+ mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
54227
+ }
54228
+
54229
+ return {
54230
+ main: mainAlignmentSide,
54231
+ cross: getOppositePlacement(mainAlignmentSide)
54232
+ };
54233
+ }
54234
+
54235
+ const hash = {
54236
+ start: 'end',
54237
+ end: 'start'
54238
+ };
54239
+ function getOppositeAlignmentPlacement(placement) {
54240
+ return placement.replace(/start|end/g, matched => hash[matched]);
54241
+ }
54242
+
54243
+ function getExpandedPlacements(placement) {
54244
+ const oppositePlacement = getOppositePlacement(placement);
54245
+ return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
54246
+ }
54247
+
54248
+ /**
54249
+ * Changes the placement of the floating element to one that will fit if the
54250
+ * initially specified `placement` does not.
54251
+ * @see https://floating-ui.com/docs/flip
54252
+ */
54253
+ const flip = function (options) {
54254
+ if (options === void 0) {
54255
+ options = {};
54256
+ }
54257
+
54258
+ return {
54259
+ name: 'flip',
54260
+ options,
54261
+
54262
+ async fn(middlewareArguments) {
54263
+ var _middlewareData$flip;
54264
+
54265
+ const {
54266
+ placement,
54267
+ middlewareData,
54268
+ rects,
54269
+ initialPlacement,
54270
+ platform,
54271
+ elements
54272
+ } = middlewareArguments;
54273
+ const {
54274
+ mainAxis: checkMainAxis = true,
54275
+ crossAxis: checkCrossAxis = true,
54276
+ fallbackPlacements: specifiedFallbackPlacements,
54277
+ fallbackStrategy = 'bestFit',
54278
+ flipAlignment = true,
54279
+ ...detectOverflowOptions
54280
+ } = options;
54281
+ const side = getSide(placement);
54282
+ const isBasePlacement = side === initialPlacement;
54283
+ const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
54284
+ const placements = [initialPlacement, ...fallbackPlacements];
54285
+ const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);
54286
+ const overflows = [];
54287
+ let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
54288
+
54289
+ if (checkMainAxis) {
54290
+ overflows.push(overflow[side]);
54291
+ }
54292
+
54293
+ if (checkCrossAxis) {
54294
+ const {
54295
+ main,
54296
+ cross
54297
+ } = getAlignmentSides(placement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
54298
+ overflows.push(overflow[main], overflow[cross]);
54299
+ }
54300
+
54301
+ overflowsData = [...overflowsData, {
54302
+ placement,
54303
+ overflows
54304
+ }]; // One or more sides is overflowing
54305
+
54306
+ if (!overflows.every(side => side <= 0)) {
54307
+ var _middlewareData$flip$, _middlewareData$flip2;
54308
+
54309
+ const nextIndex = ((_middlewareData$flip$ = (_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) != null ? _middlewareData$flip$ : 0) + 1;
54310
+ const nextPlacement = placements[nextIndex];
54311
+
54312
+ if (nextPlacement) {
54313
+ // Try next placement and re-run the lifecycle
54314
+ return {
54315
+ data: {
54316
+ index: nextIndex,
54317
+ overflows: overflowsData
54318
+ },
54319
+ reset: {
54320
+ placement: nextPlacement
54321
+ }
54322
+ };
54323
+ }
54324
+
54325
+ let resetPlacement = 'bottom';
54326
+
54327
+ switch (fallbackStrategy) {
54328
+ case 'bestFit':
54329
+ {
54330
+ var _overflowsData$map$so;
54331
+
54332
+ const placement = (_overflowsData$map$so = overflowsData.map(d => [d, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0].placement;
54333
+
54334
+ if (placement) {
54335
+ resetPlacement = placement;
54336
+ }
54337
+
54338
+ break;
54339
+ }
54340
+
54341
+ case 'initialPlacement':
54342
+ resetPlacement = initialPlacement;
54343
+ break;
54344
+ }
54345
+
54346
+ if (placement !== resetPlacement) {
54347
+ return {
54348
+ reset: {
54349
+ placement: resetPlacement
54350
+ }
54351
+ };
54352
+ }
54353
+ }
54354
+
54355
+ return {};
54356
+ }
54357
+
54358
+ };
54359
+ };
54360
+
54361
+ async function convertValueToCoords(middlewareArguments, value) {
54362
+ const {
54363
+ placement,
54364
+ platform,
54365
+ elements
54366
+ } = middlewareArguments;
54367
+ const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
54368
+ const side = getSide(placement);
54369
+ const alignment = getAlignment(placement);
54370
+ const isVertical = getMainAxisFromPlacement(placement) === 'x';
54371
+ const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
54372
+ const crossAxisMulti = rtl && isVertical ? -1 : 1;
54373
+ const rawValue = typeof value === 'function' ? value(middlewareArguments) : value; // eslint-disable-next-line prefer-const
54374
+
54375
+ let {
54376
+ mainAxis,
54377
+ crossAxis,
54378
+ alignmentAxis
54379
+ } = typeof rawValue === 'number' ? {
54380
+ mainAxis: rawValue,
54381
+ crossAxis: 0,
54382
+ alignmentAxis: null
54383
+ } : {
54384
+ mainAxis: 0,
54385
+ crossAxis: 0,
54386
+ alignmentAxis: null,
54387
+ ...rawValue
54388
+ };
54389
+
54390
+ if (alignment && typeof alignmentAxis === 'number') {
54391
+ crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
54392
+ }
54393
+
54394
+ return isVertical ? {
54395
+ x: crossAxis * crossAxisMulti,
54396
+ y: mainAxis * mainAxisMulti
54397
+ } : {
54398
+ x: mainAxis * mainAxisMulti,
54399
+ y: crossAxis * crossAxisMulti
54400
+ };
54401
+ }
54402
+ /**
54403
+ * Displaces the floating element from its reference element.
54404
+ * @see https://floating-ui.com/docs/offset
54405
+ */
54406
+
54407
+ const offset = function (value) {
54408
+ if (value === void 0) {
54409
+ value = 0;
54410
+ }
54411
+
54412
+ return {
54413
+ name: 'offset',
54414
+ options: value,
54415
+
54416
+ async fn(middlewareArguments) {
54417
+ const {
54418
+ x,
54419
+ y
54420
+ } = middlewareArguments;
54421
+ const diffCoords = await convertValueToCoords(middlewareArguments, value);
54422
+ return {
54423
+ x: x + diffCoords.x,
54424
+ y: y + diffCoords.y,
54425
+ data: diffCoords
54426
+ };
54427
+ }
54428
+
54429
+ };
54430
+ };
54431
+
54432
+ function getCrossAxis(axis) {
54433
+ return axis === 'x' ? 'y' : 'x';
54434
+ }
54435
+
54436
+ /**
54437
+ * Shifts the floating element in order to keep it in view when it will overflow
54438
+ * a clipping boundary.
54439
+ * @see https://floating-ui.com/docs/shift
54440
+ */
54441
+ const shift = function (options) {
54442
+ if (options === void 0) {
54443
+ options = {};
54444
+ }
54445
+
54446
+ return {
54447
+ name: 'shift',
54448
+ options,
54449
+
54450
+ async fn(middlewareArguments) {
54451
+ const {
54452
+ x,
54453
+ y,
54454
+ placement
54455
+ } = middlewareArguments;
54456
+ const {
54457
+ mainAxis: checkMainAxis = true,
54458
+ crossAxis: checkCrossAxis = false,
54459
+ limiter = {
54460
+ fn: _ref => {
54461
+ let {
54462
+ x,
54463
+ y
54464
+ } = _ref;
54465
+ return {
54466
+ x,
54467
+ y
54468
+ };
54469
+ }
54470
+ },
54471
+ ...detectOverflowOptions
54472
+ } = options;
54473
+ const coords = {
54474
+ x,
54475
+ y
54476
+ };
54477
+ const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);
54478
+ const mainAxis = getMainAxisFromPlacement(getSide(placement));
54479
+ const crossAxis = getCrossAxis(mainAxis);
54480
+ let mainAxisCoord = coords[mainAxis];
54481
+ let crossAxisCoord = coords[crossAxis];
54482
+
54483
+ if (checkMainAxis) {
54484
+ const minSide = mainAxis === 'y' ? 'top' : 'left';
54485
+ const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
54486
+ const min = mainAxisCoord + overflow[minSide];
54487
+ const max = mainAxisCoord - overflow[maxSide];
54488
+ mainAxisCoord = within(min, mainAxisCoord, max);
54489
+ }
54490
+
54491
+ if (checkCrossAxis) {
54492
+ const minSide = crossAxis === 'y' ? 'top' : 'left';
54493
+ const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
54494
+ const min = crossAxisCoord + overflow[minSide];
54495
+ const max = crossAxisCoord - overflow[maxSide];
54496
+ crossAxisCoord = within(min, crossAxisCoord, max);
54497
+ }
54498
+
54499
+ const limitedCoords = limiter.fn({ ...middlewareArguments,
54500
+ [mainAxis]: mainAxisCoord,
54501
+ [crossAxis]: crossAxisCoord
54502
+ });
54503
+ return { ...limitedCoords,
54504
+ data: {
54505
+ x: limitedCoords.x - x,
54506
+ y: limitedCoords.y - y
54507
+ }
54508
+ };
54509
+ }
54510
+
54511
+ };
54512
+ };
54513
+
54514
+ function isWindow(value) {
54515
+ return value && value.document && value.location && value.alert && value.setInterval;
54516
+ }
54517
+ function getWindow(node) {
54518
+ if (node == null) {
54519
+ return window;
54520
+ }
54521
+
54522
+ if (!isWindow(node)) {
54523
+ const ownerDocument = node.ownerDocument;
54524
+ return ownerDocument ? ownerDocument.defaultView || window : window;
54525
+ }
54526
+
54527
+ return node;
54528
+ }
54529
+
54530
+ function getComputedStyle$1(element) {
54531
+ return getWindow(element).getComputedStyle(element);
54532
+ }
54533
+
54534
+ function getNodeName(node) {
54535
+ return isWindow(node) ? '' : node ? (node.nodeName || '').toLowerCase() : '';
54536
+ }
54537
+
54538
+ function getUAString() {
54539
+ const uaData = navigator.userAgentData;
54540
+
54541
+ if (uaData != null && uaData.brands) {
54542
+ return uaData.brands.map(item => item.brand + "/" + item.version).join(' ');
54543
+ }
54544
+
54545
+ return navigator.userAgent;
54546
+ }
54547
+
54548
+ function isHTMLElement(value) {
54549
+ return value instanceof getWindow(value).HTMLElement;
54550
+ }
54551
+ function isElement(value) {
54552
+ return value instanceof getWindow(value).Element;
54553
+ }
54554
+ function isNode(value) {
54555
+ return value instanceof getWindow(value).Node;
54556
+ }
54557
+ function isShadowRoot(node) {
54558
+ // Browsers without `ShadowRoot` support
54559
+ if (typeof ShadowRoot === 'undefined') {
54560
+ return false;
54561
+ }
54562
+
54563
+ const OwnElement = getWindow(node).ShadowRoot;
54564
+ return node instanceof OwnElement || node instanceof ShadowRoot;
54565
+ }
54566
+ function isOverflowElement(element) {
54567
+ // Firefox wants us to check `-x` and `-y` variations as well
54568
+ const {
54569
+ overflow,
54570
+ overflowX,
54571
+ overflowY
54572
+ } = getComputedStyle$1(element);
54573
+ return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
54574
+ }
54575
+ function isTableElement(element) {
54576
+ return ['table', 'td', 'th'].includes(getNodeName(element));
54577
+ }
54578
+ function isContainingBlock(element) {
54579
+ // TODO: Try and use feature detection here instead
54580
+ const isFirefox = /firefox/i.test(getUAString());
54581
+ const css = getComputedStyle$1(element); // This is non-exhaustive but covers the most common CSS properties that
54582
+ // create a containing block.
54583
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
54584
+
54585
+ return css.transform !== 'none' || css.perspective !== 'none' || // @ts-ignore (TS 4.1 compat)
54586
+ css.contain === 'paint' || ['transform', 'perspective'].includes(css.willChange) || isFirefox && css.willChange === 'filter' || isFirefox && (css.filter ? css.filter !== 'none' : false);
54587
+ }
54588
+ function isLayoutViewport() {
54589
+ // Not Safari
54590
+ return !/^((?!chrome|android).)*safari/i.test(getUAString()); // Feature detection for this fails in various ways
54591
+ // • Always-visible scrollbar or not
54592
+ // • Width of <html>, etc.
54593
+ // const vV = win.visualViewport;
54594
+ // return vV ? Math.abs(win.innerWidth / vV.scale - vV.width) < 0.5 : true;
54595
+ }
54596
+
54597
+ const min = Math.min;
54598
+ const max = Math.max;
54599
+ const round = Math.round;
54600
+
54601
+ function getBoundingClientRect(element, includeScale, isFixedStrategy) {
54602
+ var _win$visualViewport$o, _win$visualViewport, _win$visualViewport$o2, _win$visualViewport2;
54603
+
54604
+ if (includeScale === void 0) {
54605
+ includeScale = false;
54606
+ }
54607
+
54608
+ if (isFixedStrategy === void 0) {
54609
+ isFixedStrategy = false;
54610
+ }
54611
+
54612
+ const clientRect = element.getBoundingClientRect();
54613
+ let scaleX = 1;
54614
+ let scaleY = 1;
54615
+
54616
+ if (includeScale && isHTMLElement(element)) {
54617
+ scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
54618
+ scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
54619
+ }
54620
+
54621
+ const win = isElement(element) ? getWindow(element) : window;
54622
+ const addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
54623
+ const x = (clientRect.left + (addVisualOffsets ? (_win$visualViewport$o = (_win$visualViewport = win.visualViewport) == null ? void 0 : _win$visualViewport.offsetLeft) != null ? _win$visualViewport$o : 0 : 0)) / scaleX;
54624
+ const y = (clientRect.top + (addVisualOffsets ? (_win$visualViewport$o2 = (_win$visualViewport2 = win.visualViewport) == null ? void 0 : _win$visualViewport2.offsetTop) != null ? _win$visualViewport$o2 : 0 : 0)) / scaleY;
54625
+ const width = clientRect.width / scaleX;
54626
+ const height = clientRect.height / scaleY;
54627
+ return {
54628
+ width,
54629
+ height,
54630
+ top: y,
54631
+ right: x + width,
54632
+ bottom: y + height,
54633
+ left: x,
54634
+ x,
54635
+ y
54636
+ };
54637
+ }
54638
+
54639
+ function getDocumentElement(node) {
54640
+ return ((isNode(node) ? node.ownerDocument : node.document) || window.document).documentElement;
54641
+ }
54642
+
54643
+ function getNodeScroll(element) {
54644
+ if (isElement(element)) {
54645
+ return {
54646
+ scrollLeft: element.scrollLeft,
54647
+ scrollTop: element.scrollTop
54648
+ };
54649
+ }
54650
+
54651
+ return {
54652
+ scrollLeft: element.pageXOffset,
54653
+ scrollTop: element.pageYOffset
54654
+ };
54655
+ }
54656
+
54657
+ function getWindowScrollBarX(element) {
54658
+ // If <html> has a CSS width greater than the viewport, then this will be
54659
+ // incorrect for RTL.
54660
+ return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
54661
+ }
54662
+
54663
+ function isScaled(element) {
54664
+ const rect = getBoundingClientRect(element);
54665
+ return round(rect.width) !== element.offsetWidth || round(rect.height) !== element.offsetHeight;
54666
+ }
54667
+
54668
+ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
54669
+ const isOffsetParentAnElement = isHTMLElement(offsetParent);
54670
+ const documentElement = getDocumentElement(offsetParent);
54671
+ const rect = getBoundingClientRect(element, // @ts-ignore - checked above (TS 4.1 compat)
54672
+ isOffsetParentAnElement && isScaled(offsetParent), strategy === 'fixed');
54673
+ let scroll = {
54674
+ scrollLeft: 0,
54675
+ scrollTop: 0
54676
+ };
54677
+ const offsets = {
54678
+ x: 0,
54679
+ y: 0
54680
+ };
54681
+
54682
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
54683
+ if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
54684
+ scroll = getNodeScroll(offsetParent);
54685
+ }
54686
+
54687
+ if (isHTMLElement(offsetParent)) {
54688
+ const offsetRect = getBoundingClientRect(offsetParent, true);
54689
+ offsets.x = offsetRect.x + offsetParent.clientLeft;
54690
+ offsets.y = offsetRect.y + offsetParent.clientTop;
54691
+ } else if (documentElement) {
54692
+ offsets.x = getWindowScrollBarX(documentElement);
54693
+ }
54694
+ }
54695
+
54696
+ return {
54697
+ x: rect.left + scroll.scrollLeft - offsets.x,
54698
+ y: rect.top + scroll.scrollTop - offsets.y,
54699
+ width: rect.width,
54700
+ height: rect.height
54701
+ };
54702
+ }
54703
+
54704
+ function getParentNode(node) {
54705
+ if (getNodeName(node) === 'html') {
54706
+ return node;
54707
+ }
54708
+
54709
+ return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
54710
+ // @ts-ignore
54711
+ node.assignedSlot || // step into the shadow DOM of the parent of a slotted node
54712
+ node.parentNode || ( // DOM Element detected
54713
+ isShadowRoot(node) ? node.host : null) || // ShadowRoot detected
54714
+ getDocumentElement(node) // fallback
54715
+
54716
+ );
54717
+ }
54718
+
54719
+ function getTrueOffsetParent(element) {
54720
+ if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {
54721
+ return null;
54722
+ }
54723
+
54724
+ return composedOffsetParent(element);
54725
+ }
54726
+ /**
54727
+ * Polyfills the old offsetParent behavior from before the spec was changed:
54728
+ * https://github.com/w3c/csswg-drafts/issues/159
54729
+ */
54730
+
54731
+
54732
+ function composedOffsetParent(element) {
54733
+ let {
54734
+ offsetParent
54735
+ } = element;
54736
+ let ancestor = element;
54737
+ let foundInsideSlot = false;
54738
+
54739
+ while (ancestor && ancestor !== offsetParent) {
54740
+ const {
54741
+ assignedSlot
54742
+ } = ancestor;
54743
+
54744
+ if (assignedSlot) {
54745
+ let newOffsetParent = assignedSlot.offsetParent;
54746
+
54747
+ if (getComputedStyle$1(assignedSlot).display === 'contents') {
54748
+ const hadStyleAttribute = assignedSlot.hasAttribute('style');
54749
+ const oldDisplay = assignedSlot.style.display;
54750
+ assignedSlot.style.display = getComputedStyle$1(ancestor).display;
54751
+ newOffsetParent = assignedSlot.offsetParent;
54752
+ assignedSlot.style.display = oldDisplay;
54753
+
54754
+ if (!hadStyleAttribute) {
54755
+ assignedSlot.removeAttribute('style');
54756
+ }
54757
+ }
54758
+
54759
+ ancestor = assignedSlot;
54760
+
54761
+ if (offsetParent !== newOffsetParent) {
54762
+ offsetParent = newOffsetParent;
54763
+ foundInsideSlot = true;
54764
+ }
54765
+ } else if (isShadowRoot(ancestor) && ancestor.host && foundInsideSlot) {
54766
+ break;
54767
+ }
54768
+
54769
+ ancestor = isShadowRoot(ancestor) && ancestor.host || ancestor.parentNode;
54770
+ }
54771
+
54772
+ return offsetParent;
54773
+ }
54774
+
54775
+ function getContainingBlock(element) {
54776
+ let currentNode = getParentNode(element);
54777
+
54778
+ if (isShadowRoot(currentNode)) {
54779
+ currentNode = currentNode.host;
54780
+ }
54781
+
54782
+ while (isHTMLElement(currentNode) && !['html', 'body'].includes(getNodeName(currentNode))) {
54783
+ if (isContainingBlock(currentNode)) {
54784
+ return currentNode;
54785
+ } else {
54786
+ const parent = currentNode.parentNode;
54787
+ currentNode = isShadowRoot(parent) ? parent.host : parent;
54788
+ }
54789
+ }
54790
+
54791
+ return null;
54792
+ } // Gets the closest ancestor positioned element. Handles some edge cases,
54793
+ // such as table ancestors and cross browser bugs.
54794
+
54795
+
54796
+ function getOffsetParent(element) {
54797
+ const window = getWindow(element);
54798
+ let offsetParent = getTrueOffsetParent(element);
54799
+
54800
+ while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === 'static') {
54801
+ offsetParent = getTrueOffsetParent(offsetParent);
54802
+ }
54803
+
54804
+ if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle$1(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {
54805
+ return window;
54806
+ }
54807
+
54808
+ return offsetParent || getContainingBlock(element) || window;
54809
+ }
54810
+
54811
+ function getDimensions(element) {
54812
+ if (isHTMLElement(element)) {
54813
+ return {
54814
+ width: element.offsetWidth,
54815
+ height: element.offsetHeight
54816
+ };
54817
+ }
54818
+
54819
+ const rect = getBoundingClientRect(element);
54820
+ return {
54821
+ width: rect.width,
54822
+ height: rect.height
54823
+ };
54824
+ }
54825
+
54826
+ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
54827
+ let {
54828
+ rect,
54829
+ offsetParent,
54830
+ strategy
54831
+ } = _ref;
54832
+ const isOffsetParentAnElement = isHTMLElement(offsetParent);
54833
+ const documentElement = getDocumentElement(offsetParent);
54834
+
54835
+ if (offsetParent === documentElement) {
54836
+ return rect;
54837
+ }
54838
+
54839
+ let scroll = {
54840
+ scrollLeft: 0,
54841
+ scrollTop: 0
54842
+ };
54843
+ const offsets = {
54844
+ x: 0,
54845
+ y: 0
54846
+ };
54847
+
54848
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
54849
+ if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
54850
+ scroll = getNodeScroll(offsetParent);
54851
+ }
54852
+
54853
+ if (isHTMLElement(offsetParent)) {
54854
+ const offsetRect = getBoundingClientRect(offsetParent, true);
54855
+ offsets.x = offsetRect.x + offsetParent.clientLeft;
54856
+ offsets.y = offsetRect.y + offsetParent.clientTop;
54857
+ } // This doesn't appear to be need to be negated.
54858
+ // else if (documentElement) {
54859
+ // offsets.x = getWindowScrollBarX(documentElement);
54860
+ // }
54861
+
54862
+ }
54863
+
54864
+ return { ...rect,
54865
+ x: rect.x - scroll.scrollLeft + offsets.x,
54866
+ y: rect.y - scroll.scrollTop + offsets.y
54867
+ };
54868
+ }
54869
+
54870
+ function getViewportRect(element, strategy) {
54871
+ const win = getWindow(element);
54872
+ const html = getDocumentElement(element);
54873
+ const visualViewport = win.visualViewport;
54874
+ let width = html.clientWidth;
54875
+ let height = html.clientHeight;
54876
+ let x = 0;
54877
+ let y = 0;
54878
+
54879
+ if (visualViewport) {
54880
+ width = visualViewport.width;
54881
+ height = visualViewport.height;
54882
+ const layoutViewport = isLayoutViewport();
54883
+
54884
+ if (layoutViewport || !layoutViewport && strategy === 'fixed') {
54885
+ x = visualViewport.offsetLeft;
54886
+ y = visualViewport.offsetTop;
54887
+ }
54888
+ }
54889
+
54890
+ return {
54891
+ width,
54892
+ height,
54893
+ x,
54894
+ y
54895
+ };
54896
+ }
54897
+
54898
+ // of the `<html>` and `<body>` rect bounds if horizontally scrollable
54899
+
54900
+ function getDocumentRect(element) {
54901
+ var _element$ownerDocumen;
54902
+
54903
+ const html = getDocumentElement(element);
54904
+ const scroll = getNodeScroll(element);
54905
+ const body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
54906
+ const width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
54907
+ const height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
54908
+ let x = -scroll.scrollLeft + getWindowScrollBarX(element);
54909
+ const y = -scroll.scrollTop;
54910
+
54911
+ if (getComputedStyle$1(body || html).direction === 'rtl') {
54912
+ x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
54913
+ }
54914
+
54915
+ return {
54916
+ width,
54917
+ height,
54918
+ x,
54919
+ y
54920
+ };
54921
+ }
54922
+
54923
+ function getNearestOverflowAncestor(node) {
54924
+ const parentNode = getParentNode(node);
54925
+
54926
+ if (['html', 'body', '#document'].includes(getNodeName(parentNode))) {
54927
+ // @ts-ignore assume body is always available
54928
+ return node.ownerDocument.body;
54929
+ }
54930
+
54931
+ if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
54932
+ return parentNode;
54933
+ }
54934
+
54935
+ return getNearestOverflowAncestor(parentNode);
54936
+ }
54937
+
54938
+ function getOverflowAncestors(node, list) {
54939
+ var _node$ownerDocument;
54940
+
54941
+ if (list === void 0) {
54942
+ list = [];
54943
+ }
54944
+
54945
+ const scrollableAncestor = getNearestOverflowAncestor(node);
54946
+ const isBody = scrollableAncestor === ((_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.body);
54947
+ const win = getWindow(scrollableAncestor);
54948
+ const target = isBody ? [win].concat(win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : []) : scrollableAncestor;
54949
+ const updatedList = list.concat(target);
54950
+ return isBody ? updatedList : // @ts-ignore: isBody tells us target will be an HTMLElement here
54951
+ updatedList.concat(getOverflowAncestors(target));
54952
+ }
54953
+
54954
+ function contains(parent, child) {
54955
+ const rootNode = child.getRootNode == null ? void 0 : child.getRootNode(); // First, attempt with faster native method
54956
+
54957
+ if (parent.contains(child)) {
54958
+ return true;
54959
+ } // then fallback to custom implementation with Shadow DOM support
54960
+ else if (rootNode && isShadowRoot(rootNode)) {
54961
+ let next = child;
54962
+
54963
+ do {
54964
+ // use `===` replace node.isSameNode()
54965
+ if (next && parent === next) {
54966
+ return true;
54967
+ } // @ts-ignore: need a better way to handle this...
54968
+
54969
+
54970
+ next = next.parentNode || next.host;
54971
+ } while (next);
54972
+ }
54973
+
54974
+ return false;
54975
+ }
54976
+
54977
+ function getInnerBoundingClientRect(element, strategy) {
54978
+ const clientRect = getBoundingClientRect(element, false, strategy === 'fixed');
54979
+ const top = clientRect.top + element.clientTop;
54980
+ const left = clientRect.left + element.clientLeft;
54981
+ return {
54982
+ top,
54983
+ left,
54984
+ x: left,
54985
+ y: top,
54986
+ right: left + element.clientWidth,
54987
+ bottom: top + element.clientHeight,
54988
+ width: element.clientWidth,
54989
+ height: element.clientHeight
54990
+ };
54991
+ }
54992
+
54993
+ function getClientRectFromClippingAncestor(element, clippingParent, strategy) {
54994
+ if (clippingParent === 'viewport') {
54995
+ return rectToClientRect(getViewportRect(element, strategy));
54996
+ }
54997
+
54998
+ if (isElement(clippingParent)) {
54999
+ return getInnerBoundingClientRect(clippingParent, strategy);
55000
+ }
55001
+
55002
+ return rectToClientRect(getDocumentRect(getDocumentElement(element)));
55003
+ } // A "clipping ancestor" is an overflowable container with the characteristic of
55004
+ // clipping (or hiding) overflowing elements with a position different from
55005
+ // `initial`
55006
+
55007
+
55008
+ function getClippingAncestors(element) {
55009
+ const clippingAncestors = getOverflowAncestors(element);
55010
+ const canEscapeClipping = ['absolute', 'fixed'].includes(getComputedStyle$1(element).position);
55011
+ const clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
55012
+
55013
+ if (!isElement(clipperElement)) {
55014
+ return [];
55015
+ } // @ts-ignore isElement check ensures we return Array<Element>
55016
+
55017
+
55018
+ return clippingAncestors.filter(clippingAncestors => isElement(clippingAncestors) && contains(clippingAncestors, clipperElement) && getNodeName(clippingAncestors) !== 'body');
55019
+ } // Gets the maximum area that the element is visible in due to any number of
55020
+ // clipping ancestors
55021
+
55022
+
55023
+ function getClippingRect(_ref) {
55024
+ let {
55025
+ element,
55026
+ boundary,
55027
+ rootBoundary,
55028
+ strategy
55029
+ } = _ref;
55030
+ const mainClippingAncestors = boundary === 'clippingAncestors' ? getClippingAncestors(element) : [].concat(boundary);
55031
+ const clippingAncestors = [...mainClippingAncestors, rootBoundary];
55032
+ const firstClippingAncestor = clippingAncestors[0];
55033
+ const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
55034
+ const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
55035
+ accRect.top = max(rect.top, accRect.top);
55036
+ accRect.right = min(rect.right, accRect.right);
55037
+ accRect.bottom = min(rect.bottom, accRect.bottom);
55038
+ accRect.left = max(rect.left, accRect.left);
55039
+ return accRect;
55040
+ }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
55041
+ return {
55042
+ width: clippingRect.right - clippingRect.left,
55043
+ height: clippingRect.bottom - clippingRect.top,
55044
+ x: clippingRect.left,
55045
+ y: clippingRect.top
55046
+ };
55047
+ }
55048
+
55049
+ const platform = {
55050
+ getClippingRect,
55051
+ convertOffsetParentRelativeRectToViewportRelativeRect,
55052
+ isElement,
55053
+ getDimensions,
55054
+ getOffsetParent,
55055
+ getDocumentElement,
55056
+ getElementRects: _ref => {
55057
+ let {
55058
+ reference,
55059
+ floating,
55060
+ strategy
55061
+ } = _ref;
55062
+ return {
55063
+ reference: getRectRelativeToOffsetParent(reference, getOffsetParent(floating), strategy),
55064
+ floating: { ...getDimensions(floating),
55065
+ x: 0,
55066
+ y: 0
55067
+ }
55068
+ };
55069
+ },
55070
+ getClientRects: element => Array.from(element.getClientRects()),
55071
+ isRTL: element => getComputedStyle$1(element).direction === 'rtl'
55072
+ };
55073
+
55074
+ /**
55075
+ * Automatically updates the position of the floating element when necessary.
55076
+ * @see https://floating-ui.com/docs/autoUpdate
55077
+ */
55078
+ function autoUpdate(reference, floating, update, options) {
55079
+ if (options === void 0) {
55080
+ options = {};
55081
+ }
55082
+
55083
+ const {
55084
+ ancestorScroll: _ancestorScroll = true,
55085
+ ancestorResize: _ancestorResize = true,
55086
+ elementResize = true,
55087
+ animationFrame = false
55088
+ } = options;
55089
+ const ancestorScroll = _ancestorScroll && !animationFrame;
55090
+ const ancestorResize = _ancestorResize && !animationFrame;
55091
+ const ancestors = ancestorScroll || ancestorResize ? [...(isElement(reference) ? getOverflowAncestors(reference) : []), ...getOverflowAncestors(floating)] : [];
55092
+ ancestors.forEach(ancestor => {
55093
+ ancestorScroll && ancestor.addEventListener('scroll', update, {
55094
+ passive: true
55095
+ });
55096
+ ancestorResize && ancestor.addEventListener('resize', update);
55097
+ });
55098
+ let observer = null;
55099
+
55100
+ if (elementResize) {
55101
+ let initialUpdate = true;
55102
+ observer = new ResizeObserver(() => {
55103
+ if (!initialUpdate) {
55104
+ update();
55105
+ }
55106
+
55107
+ initialUpdate = false;
55108
+ });
55109
+ isElement(reference) && !animationFrame && observer.observe(reference);
55110
+ observer.observe(floating);
55111
+ }
55112
+
55113
+ let frameId;
55114
+ let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
55115
+
55116
+ if (animationFrame) {
55117
+ frameLoop();
55118
+ }
55119
+
55120
+ function frameLoop() {
55121
+ const nextRefRect = getBoundingClientRect(reference);
55122
+
55123
+ if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
55124
+ update();
55125
+ }
55126
+
55127
+ prevRefRect = nextRefRect;
55128
+ frameId = requestAnimationFrame(frameLoop);
55129
+ }
55130
+
55131
+ update();
55132
+ return () => {
55133
+ var _observer;
55134
+
55135
+ ancestors.forEach(ancestor => {
55136
+ ancestorScroll && ancestor.removeEventListener('scroll', update);
55137
+ ancestorResize && ancestor.removeEventListener('resize', update);
55138
+ });
55139
+ (_observer = observer) == null ? void 0 : _observer.disconnect();
55140
+ observer = null;
55141
+
55142
+ if (animationFrame) {
55143
+ cancelAnimationFrame(frameId);
55144
+ }
55145
+ };
55146
+ }
55147
+
55148
+ /**
55149
+ * Computes the `x` and `y` coordinates that will place the floating element
55150
+ * next to a reference element when it is given a certain CSS positioning
55151
+ * strategy.
55152
+ */
55153
+
55154
+ const computePosition = (reference, floating, options) => computePosition$1(reference, floating, {
55155
+ platform,
55156
+ ...options
55157
+ });
55158
+
53270
55159
  const visualHiddenProps = buildProps({
53271
55160
  style: {
53272
55161
  type: definePropType([String, Object, Array]),
@@ -54199,7 +56088,7 @@
54199
56088
  });
54200
56089
  };
54201
56090
  let nodeIdSeed = 0;
54202
- class Node {
56091
+ class Node$1 {
54203
56092
  constructor(options) {
54204
56093
  this.isLeafByUser = void 0;
54205
56094
  this.isLeaf = void 0;
@@ -54330,7 +56219,7 @@
54330
56219
  insertChild(child, index, batch) {
54331
56220
  if (!child)
54332
56221
  throw new Error("InsertChild error: child is required.");
54333
- if (!(child instanceof Node)) {
56222
+ if (!(child instanceof Node$1)) {
54334
56223
  if (!batch) {
54335
56224
  const children = this.getChildren(true);
54336
56225
  if (!(children == null ? void 0 : children.includes(child.data))) {
@@ -54345,8 +56234,8 @@
54345
56234
  parent: this,
54346
56235
  store: this.store
54347
56236
  });
54348
- child = vue.reactive(new Node(child));
54349
- if (child instanceof Node) {
56237
+ child = vue.reactive(new Node$1(child));
56238
+ if (child instanceof Node$1) {
54350
56239
  child.initialize();
54351
56240
  }
54352
56241
  }
@@ -54580,7 +56469,7 @@
54580
56469
  reInitChecked(this);
54581
56470
  }
54582
56471
  }
54583
- var Node$1 = Node;
56472
+ var Node$2 = Node$1;
54584
56473
 
54585
56474
  class TreeStore {
54586
56475
  constructor(options) {
@@ -54599,7 +56488,7 @@
54599
56488
  this.nodesMap = {};
54600
56489
  }
54601
56490
  initialize() {
54602
- this.root = new Node$1({
56491
+ this.root = new Node$2({
54603
56492
  data: this.data,
54604
56493
  store: this
54605
56494
  });
@@ -54657,7 +56546,7 @@
54657
56546
  }
54658
56547
  }
54659
56548
  getNode(data) {
54660
- if (data instanceof Node$1)
56549
+ if (data instanceof Node$2)
54661
56550
  return data;
54662
56551
  const key = isObject$1(data) ? getNodeKey(this.key, data) : data;
54663
56552
  return this.nodesMap[key] || null;
@@ -55135,7 +57024,7 @@
55135
57024
  },
55136
57025
  props: {
55137
57026
  node: {
55138
- type: Node$1,
57027
+ type: Node$2,
55139
57028
  default: () => ({})
55140
57029
  },
55141
57030
  props: {
@@ -61780,7 +63669,7 @@
61780
63669
  normalized.appendTo = document.body;
61781
63670
  } else if (isString$1(normalized.appendTo)) {
61782
63671
  let appendTo = document.querySelector(normalized.appendTo);
61783
- if (!isElement$1(appendTo)) {
63672
+ if (!isElement$2(appendTo)) {
61784
63673
  appendTo = document.body;
61785
63674
  }
61786
63675
  normalized.appendTo = appendTo;
@@ -62367,10 +64256,10 @@
62367
64256
  if (isString$1(props.appendTo)) {
62368
64257
  appendTo = document.querySelector(props.appendTo);
62369
64258
  }
62370
- if (isElement$1(props.appendTo)) {
64259
+ if (isElement$2(props.appendTo)) {
62371
64260
  appendTo = props.appendTo;
62372
64261
  }
62373
- if (!isElement$1(appendTo)) {
64262
+ if (!isElement$2(appendTo)) {
62374
64263
  appendTo = document.body;
62375
64264
  }
62376
64265
  }
@@ -62738,12 +64627,12 @@
62738
64627
  }
62739
64628
  };
62740
64629
  let appendTo = document.body;
62741
- if (isElement$1(options.appendTo)) {
64630
+ if (isElement$2(options.appendTo)) {
62742
64631
  appendTo = options.appendTo;
62743
64632
  } else if (isString$1(options.appendTo)) {
62744
64633
  appendTo = document.querySelector(options.appendTo);
62745
64634
  }
62746
- if (!isElement$1(appendTo)) {
64635
+ if (!isElement$2(appendTo)) {
62747
64636
  appendTo = document.body;
62748
64637
  }
62749
64638
  const container = document.createElement("div");
@@ -63091,6 +64980,7 @@
63091
64980
  exports.defaultProps = defaultProps;
63092
64981
  exports.descriptionItemProps = descriptionItemProps;
63093
64982
  exports.descriptionProps = descriptionProps;
64983
+ exports.dialogContextKey = dialogContextKey;
63094
64984
  exports.dialogEmits = dialogEmits;
63095
64985
  exports.dialogInjectionKey = dialogInjectionKey;
63096
64986
  exports.dialogProps = dialogProps;