@deepnoid/ui 0.0.112 → 0.1.0

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 (426) hide show
  1. package/.eslintrc.cjs +4 -0
  2. package/.turbo/turbo-build.log +365 -0
  3. package/babel.config.js +8 -0
  4. package/dist/NanumSquare_acB-VMSVRKSM.ttf +0 -0
  5. package/dist/NanumSquare_acEB-HRZ3QLG2.ttf +0 -0
  6. package/dist/NanumSquare_acL-FSAAP5CK.ttf +0 -0
  7. package/dist/NanumSquare_acR-RZCHPXSJ.ttf +0 -0
  8. package/dist/{chunk-LCI6RPWE.mjs → chunk-24NQEB73.mjs} +7 -5
  9. package/dist/{chunk-RZZWHI6O.mjs → chunk-2HSK6XGZ.mjs} +8 -3
  10. package/dist/{chunk-TSMVRGDO.mjs → chunk-3AMZ55Y6.mjs} +14 -8
  11. package/dist/{chunk-VWD26TIQ.mjs → chunk-5IQKKLZY.mjs} +4 -4
  12. package/dist/{chunk-EYY4CRRR.mjs → chunk-5S4XGPBB.mjs} +15 -17
  13. package/dist/chunk-6PNKRBUT.mjs +34 -0
  14. package/dist/{chunk-IZ6II3QA.mjs → chunk-AC6TWLRT.mjs} +1 -13
  15. package/dist/{chunk-OJ2OEI5B.mjs → chunk-BKE6QF6W.mjs} +7 -0
  16. package/dist/{chunk-BCN5F2MN.mjs → chunk-CATOSBI7.mjs} +2 -2
  17. package/dist/{chunk-PXUBPWKU.mjs → chunk-FYJZ7Q5L.mjs} +4 -4
  18. package/dist/chunk-IE2BRM7Z.mjs +600 -0
  19. package/dist/chunk-KCYJYS66.mjs +198 -0
  20. package/dist/chunk-LXHUO6VM.mjs +46 -0
  21. package/dist/chunk-MW6Y3FSE.mjs +211 -0
  22. package/dist/{chunk-IOCRFIQF.mjs → chunk-P2TMIZRH.mjs} +131 -30
  23. package/dist/{chunk-KRI5IALM.mjs → chunk-P5WT7WJO.mjs} +6 -3
  24. package/dist/{chunk-PO3ADNA5.mjs → chunk-PFYYYUJW.mjs} +1 -1
  25. package/dist/chunk-PKVQXVCS.mjs +170 -0
  26. package/dist/{chunk-NGQ3MK2J.mjs → chunk-Q5WACGVP.mjs} +1 -1
  27. package/dist/{chunk-FDKT4IBP.mjs → chunk-QJHZJRSQ.mjs} +4 -4
  28. package/dist/{chunk-7HHFRKJU.mjs → chunk-QNA2GDTN.mjs} +2 -2
  29. package/dist/{chunk-YRMFIXXC.mjs → chunk-RQ76IOYC.mjs} +29 -6
  30. package/dist/chunk-RRL6KBU4.mjs +145 -0
  31. package/dist/chunk-SE5TU755.mjs +1 -0
  32. package/dist/{chunk-ZNEEYSIK.mjs → chunk-SK2A72R2.mjs} +10 -4
  33. package/dist/{chunk-PRLGHYFO.mjs → chunk-UAMIPCUD.mjs} +7 -7
  34. package/dist/{chunk-JN7EGKJL.mjs → chunk-VBFXKJTI.mjs} +11 -5
  35. package/dist/chunk-VWMXZUR2.mjs +82 -0
  36. package/dist/chunk-WQBOPCH6.mjs +29 -0
  37. package/dist/chunk-WSIADHVC.mjs +126 -0
  38. package/dist/chunk-X2MQCISM.mjs +413 -0
  39. package/dist/chunk-XAA5KY6A.mjs +63 -0
  40. package/dist/chunk-XTGRSVYO.mjs +221 -0
  41. package/dist/{chunk-QGZEHOKA.mjs → chunk-YGOEKSNZ.mjs} +5 -2
  42. package/dist/chunk-Z74QNVPG.mjs +127 -0
  43. package/dist/{chunk-KCBBBRSF.mjs → chunk-ZMOAFSYE.mjs} +1 -1
  44. package/dist/components/avatar/avatar.d.mts +80 -0
  45. package/dist/components/avatar/avatar.d.ts +80 -0
  46. package/dist/components/{accordion/accordionItem.js → avatar/avatar.js} +463 -213
  47. package/dist/components/avatar/avatar.mjs +10 -0
  48. package/dist/components/avatar/index.d.mts +4 -0
  49. package/dist/components/avatar/index.d.ts +4 -0
  50. package/dist/components/{accordion → avatar}/index.js +845 -676
  51. package/dist/components/avatar/index.mjs +11 -0
  52. package/dist/components/backdrop/backdrop.d.mts +11 -0
  53. package/dist/components/backdrop/backdrop.d.ts +11 -0
  54. package/dist/components/backdrop/backdrop.js +354 -0
  55. package/dist/components/backdrop/backdrop.mjs +9 -0
  56. package/dist/components/backdrop/index.d.mts +2 -0
  57. package/dist/components/backdrop/index.d.ts +2 -0
  58. package/dist/components/backdrop/index.js +360 -0
  59. package/dist/components/backdrop/index.mjs +10 -0
  60. package/dist/components/breadcrumb/breadcrumb.d.mts +96 -0
  61. package/dist/components/breadcrumb/breadcrumb.d.ts +96 -0
  62. package/dist/components/breadcrumb/breadcrumb.js +4076 -0
  63. package/dist/components/breadcrumb/breadcrumb.mjs +12 -0
  64. package/dist/components/breadcrumb/index.d.mts +7 -0
  65. package/dist/components/breadcrumb/index.d.ts +7 -0
  66. package/dist/components/breadcrumb/index.js +4082 -0
  67. package/dist/components/breadcrumb/index.mjs +13 -0
  68. package/dist/components/button/button-group.d.mts +5 -4
  69. package/dist/components/button/button-group.d.ts +5 -4
  70. package/dist/components/button/button-group.js +287 -9
  71. package/dist/components/button/button-group.mjs +3 -3
  72. package/dist/components/button/button.d.mts +27 -180
  73. package/dist/components/button/button.d.ts +27 -180
  74. package/dist/components/button/button.js +609 -426
  75. package/dist/components/button/button.mjs +8 -5
  76. package/dist/components/button/index.d.mts +0 -1
  77. package/dist/components/button/index.d.ts +0 -1
  78. package/dist/components/button/index.js +614 -431
  79. package/dist/components/button/index.mjs +9 -6
  80. package/dist/components/checkbox/checkbox.d.mts +50 -206
  81. package/dist/components/checkbox/checkbox.d.ts +50 -206
  82. package/dist/components/checkbox/checkbox.js +473 -127
  83. package/dist/components/checkbox/checkbox.mjs +4 -3
  84. package/dist/components/checkbox/index.d.mts +0 -1
  85. package/dist/components/checkbox/index.d.ts +0 -1
  86. package/dist/components/checkbox/index.js +473 -127
  87. package/dist/components/checkbox/index.mjs +4 -3
  88. package/dist/components/chip/chip.d.mts +119 -0
  89. package/dist/components/chip/chip.d.ts +119 -0
  90. package/dist/components/chip/chip.js +4209 -0
  91. package/dist/components/chip/chip.mjs +13 -0
  92. package/dist/components/chip/index.d.mts +7 -0
  93. package/dist/components/chip/index.d.ts +7 -0
  94. package/dist/components/chip/index.js +4215 -0
  95. package/dist/components/chip/index.mjs +14 -0
  96. package/dist/components/dateTimePicker/calendar.d.mts +3 -53
  97. package/dist/components/dateTimePicker/calendar.d.ts +3 -53
  98. package/dist/components/dateTimePicker/calendar.js +424 -43
  99. package/dist/components/dateTimePicker/calendar.mjs +5 -5
  100. package/dist/components/dateTimePicker/dateTimePicker.d.mts +23 -180
  101. package/dist/components/dateTimePicker/dateTimePicker.d.ts +23 -180
  102. package/dist/components/dateTimePicker/dateTimePicker.js +683 -151
  103. package/dist/components/dateTimePicker/dateTimePicker.mjs +11 -10
  104. package/dist/components/dateTimePicker/index.d.mts +0 -1
  105. package/dist/components/dateTimePicker/index.d.ts +0 -1
  106. package/dist/components/dateTimePicker/index.js +683 -151
  107. package/dist/components/dateTimePicker/index.mjs +11 -10
  108. package/dist/components/dateTimePicker/timePicker.js +4227 -130
  109. package/dist/components/dateTimePicker/timePicker.mjs +9 -5
  110. package/dist/components/dateTimePicker/useDateTimePicker.d.mts +4 -4
  111. package/dist/components/dateTimePicker/useDateTimePicker.d.ts +4 -4
  112. package/dist/components/dateTimePicker/useDateTimePicker.mjs +1 -1
  113. package/dist/components/dateTimePicker/util.mjs +1 -1
  114. package/dist/components/icon/Icon.d.mts +30 -5
  115. package/dist/components/icon/Icon.d.ts +30 -5
  116. package/dist/components/icon/Icon.js +137 -34
  117. package/dist/components/icon/Icon.mjs +3 -3
  118. package/dist/components/icon/index.d.mts +1 -0
  119. package/dist/components/icon/index.d.ts +1 -0
  120. package/dist/components/icon/index.js +137 -34
  121. package/dist/components/icon/index.mjs +3 -3
  122. package/dist/components/icon/template.d.mts +7 -1
  123. package/dist/components/icon/template.d.ts +7 -1
  124. package/dist/components/icon/template.js +131 -30
  125. package/dist/components/icon/template.mjs +2 -2
  126. package/dist/components/input/index.d.mts +0 -1
  127. package/dist/components/input/index.d.ts +0 -1
  128. package/dist/components/input/index.js +430 -43
  129. package/dist/components/input/index.mjs +5 -5
  130. package/dist/components/input/input.d.mts +23 -180
  131. package/dist/components/input/input.d.ts +23 -180
  132. package/dist/components/input/input.js +430 -43
  133. package/dist/components/input/input.mjs +5 -5
  134. package/dist/components/list/index.d.mts +5 -2
  135. package/dist/components/list/index.d.ts +5 -2
  136. package/dist/components/list/index.js +4170 -73
  137. package/dist/components/list/index.mjs +8 -4
  138. package/dist/components/list/list.d.mts +17 -67
  139. package/dist/components/list/list.d.ts +17 -67
  140. package/dist/components/list/list.js +299 -23
  141. package/dist/components/list/list.mjs +3 -3
  142. package/dist/components/list/listItem.d.mts +108 -113
  143. package/dist/components/list/listItem.d.ts +108 -113
  144. package/dist/components/list/listItem.js +4168 -61
  145. package/dist/components/list/listItem.mjs +7 -3
  146. package/dist/components/modal/index.d.mts +0 -1
  147. package/dist/components/modal/index.d.ts +0 -1
  148. package/dist/components/modal/index.js +639 -454
  149. package/dist/components/modal/index.mjs +10 -7
  150. package/dist/components/modal/modal.d.mts +3 -76
  151. package/dist/components/modal/modal.d.ts +3 -76
  152. package/dist/components/modal/modal.js +639 -454
  153. package/dist/components/modal/modal.mjs +10 -7
  154. package/dist/components/pagination/index.js +455 -45
  155. package/dist/components/pagination/index.mjs +6 -6
  156. package/dist/components/pagination/pagination.d.mts +21 -27
  157. package/dist/components/pagination/pagination.d.ts +21 -27
  158. package/dist/components/pagination/pagination.js +455 -45
  159. package/dist/components/pagination/pagination.mjs +6 -6
  160. package/dist/components/pagination/usePagination.mjs +1 -1
  161. package/dist/components/radio/index.d.mts +0 -1
  162. package/dist/components/radio/index.d.ts +0 -1
  163. package/dist/components/radio/index.js +433 -111
  164. package/dist/components/radio/index.mjs +4 -3
  165. package/dist/components/radio/radio.d.mts +113 -183
  166. package/dist/components/radio/radio.d.ts +113 -183
  167. package/dist/components/radio/radio.js +433 -111
  168. package/dist/components/radio/radio.mjs +4 -3
  169. package/dist/components/ripple/index.d.mts +4 -0
  170. package/dist/components/ripple/index.d.ts +4 -0
  171. package/dist/components/ripple/index.js +98 -0
  172. package/dist/components/ripple/index.mjs +13 -0
  173. package/dist/components/ripple/ripple.d.mts +21 -0
  174. package/dist/components/ripple/ripple.d.ts +21 -0
  175. package/dist/components/ripple/ripple.js +65 -0
  176. package/dist/components/ripple/ripple.mjs +8 -0
  177. package/dist/components/ripple/useRipple.d.mts +17 -0
  178. package/dist/components/ripple/useRipple.d.ts +17 -0
  179. package/dist/components/ripple/useRipple.js +57 -0
  180. package/dist/components/ripple/useRipple.mjs +10 -0
  181. package/dist/components/select/index.d.mts +0 -1
  182. package/dist/components/select/index.d.ts +0 -1
  183. package/dist/components/select/index.js +446 -44
  184. package/dist/components/select/index.mjs +6 -6
  185. package/dist/components/select/option.d.mts +2 -3
  186. package/dist/components/select/option.d.ts +2 -3
  187. package/dist/components/select/option.js +440 -44
  188. package/dist/components/select/option.mjs +5 -5
  189. package/dist/components/select/select.d.mts +19 -180
  190. package/dist/components/select/select.d.ts +19 -180
  191. package/dist/components/select/select.js +446 -44
  192. package/dist/components/select/select.mjs +6 -6
  193. package/dist/components/select/useSelect.d.mts +3 -4
  194. package/dist/components/select/useSelect.d.ts +3 -4
  195. package/dist/components/select/useSelect.mjs +1 -1
  196. package/dist/components/switch/index.d.mts +1 -2
  197. package/dist/components/switch/index.d.ts +1 -2
  198. package/dist/components/switch/index.js +54 -77
  199. package/dist/components/switch/index.mjs +2 -2
  200. package/dist/components/switch/switch.d.mts +56 -190
  201. package/dist/components/switch/switch.d.ts +56 -190
  202. package/dist/components/switch/switch.js +55 -83
  203. package/dist/components/switch/switch.mjs +4 -6
  204. package/dist/components/table/index.d.mts +0 -1
  205. package/dist/components/table/index.d.ts +0 -1
  206. package/dist/components/table/index.js +563 -161
  207. package/dist/components/table/index.mjs +9 -9
  208. package/dist/components/table/table-body.d.mts +4 -5
  209. package/dist/components/table/table-body.d.ts +4 -5
  210. package/dist/components/table/table-body.js +560 -161
  211. package/dist/components/table/table-body.mjs +7 -7
  212. package/dist/components/table/table-head.d.mts +2 -3
  213. package/dist/components/table/table-head.d.ts +2 -3
  214. package/dist/components/table/table-head.js +433 -127
  215. package/dist/components/table/table-head.mjs +4 -4
  216. package/dist/components/table/table.d.mts +14 -354
  217. package/dist/components/table/table.d.ts +14 -354
  218. package/dist/components/table/table.js +563 -161
  219. package/dist/components/table/table.mjs +9 -9
  220. package/dist/components/tabs/index.d.mts +0 -1
  221. package/dist/components/tabs/index.d.ts +0 -1
  222. package/dist/components/tabs/index.js +300 -9
  223. package/dist/components/tabs/index.mjs +3 -3
  224. package/dist/components/tabs/tabs.d.mts +12 -99
  225. package/dist/components/tabs/tabs.d.ts +12 -99
  226. package/dist/components/tabs/tabs.js +300 -9
  227. package/dist/components/tabs/tabs.mjs +3 -3
  228. package/dist/components/textarea/index.d.mts +0 -1
  229. package/dist/components/textarea/index.d.ts +0 -1
  230. package/dist/components/textarea/index.js +7 -0
  231. package/dist/components/textarea/index.mjs +2 -2
  232. package/dist/components/textarea/textarea.d.mts +19 -271
  233. package/dist/components/textarea/textarea.d.ts +19 -271
  234. package/dist/components/textarea/textarea.js +7 -0
  235. package/dist/components/textarea/textarea.mjs +2 -2
  236. package/dist/components/toast/index.d.mts +1 -1
  237. package/dist/components/toast/index.d.ts +1 -1
  238. package/dist/components/toast/index.js +435 -44
  239. package/dist/components/toast/index.mjs +6 -6
  240. package/dist/components/toast/toast-utils.mjs +1 -1
  241. package/dist/components/toast/toast.d.mts +4 -87
  242. package/dist/components/toast/toast.d.ts +4 -87
  243. package/dist/components/toast/toast.js +434 -43
  244. package/dist/components/toast/toast.mjs +5 -5
  245. package/dist/components/toast/use-toast.d.mts +1 -0
  246. package/dist/components/toast/use-toast.d.ts +1 -0
  247. package/dist/components/toast/use-toast.js +435 -44
  248. package/dist/components/toast/use-toast.mjs +6 -6
  249. package/dist/components/tooltip/index.d.mts +1 -2
  250. package/dist/components/tooltip/index.d.ts +1 -2
  251. package/dist/components/tooltip/index.js +421 -54
  252. package/dist/components/tooltip/index.mjs +5 -5
  253. package/dist/components/tooltip/tooltip-utils.d.mts +1 -1
  254. package/dist/components/tooltip/tooltip-utils.d.ts +1 -1
  255. package/dist/components/tooltip/tooltip-utils.js +67 -0
  256. package/dist/components/tooltip/tooltip-utils.mjs +6 -2
  257. package/dist/components/tooltip/tooltip.d.mts +37 -85
  258. package/dist/components/tooltip/tooltip.d.ts +37 -85
  259. package/dist/components/tooltip/tooltip.js +421 -54
  260. package/dist/components/tooltip/tooltip.mjs +5 -5
  261. package/dist/components/tooltip/useTooltip.d.mts +1 -1
  262. package/dist/components/tooltip/useTooltip.d.ts +1 -1
  263. package/dist/components/tooltip/useTooltip.mjs +3 -3
  264. package/dist/fonts/NanumSquare_acB.js +4 -0
  265. package/dist/fonts/NanumSquare_acB.mjs +8 -0
  266. package/dist/fonts/NanumSquare_acB.ttf +0 -0
  267. package/dist/fonts/NanumSquare_acEB.js +4 -0
  268. package/dist/fonts/NanumSquare_acEB.mjs +8 -0
  269. package/dist/fonts/NanumSquare_acEB.ttf +0 -0
  270. package/dist/fonts/NanumSquare_acL.js +4 -0
  271. package/dist/fonts/NanumSquare_acL.mjs +8 -0
  272. package/dist/fonts/NanumSquare_acL.ttf +0 -0
  273. package/dist/fonts/NanumSquare_acR.js +4 -0
  274. package/dist/fonts/NanumSquare_acR.mjs +8 -0
  275. package/dist/fonts/NanumSquare_acR.ttf +0 -0
  276. package/dist/fonts/font.css +36 -0
  277. package/dist/index.d.mts +6 -8
  278. package/dist/index.d.ts +6 -8
  279. package/dist/index.js +2287 -2577
  280. package/dist/index.mjs +62 -787
  281. package/dist/tooltip-utils-DO3LQaVM.d.mts +52 -0
  282. package/dist/tooltip-utils-DO3LQaVM.d.ts +52 -0
  283. package/dist/utils/clsx.mjs +1 -1
  284. package/dist/utils/props.mjs +1 -1
  285. package/dist/utils/tailwind-variants.d.mts +1 -21
  286. package/dist/utils/tailwind-variants.d.ts +1 -21
  287. package/dist/utils/tailwind-variants.js +297 -9
  288. package/dist/utils/tailwind-variants.mjs +2 -2
  289. package/dist/utils/types.d.mts +5 -4
  290. package/dist/utils/types.d.ts +5 -4
  291. package/package.json +34 -37
  292. package/postcss.config.js +6 -0
  293. package/tailwind.config.ts +7 -0
  294. package/tsup.config.ts +8 -0
  295. package/dist/chunk-2ALY3PH5.mjs +0 -66
  296. package/dist/chunk-A3RWT3JJ.mjs +0 -197
  297. package/dist/chunk-ANYPMQH4.mjs +0 -200
  298. package/dist/chunk-FNPWLOGV.mjs +0 -12875
  299. package/dist/chunk-H7BLXC5M.mjs +0 -5965
  300. package/dist/chunk-J725QONZ.mjs +0 -24
  301. package/dist/chunk-L6BQA6GI.mjs +0 -160
  302. package/dist/chunk-N2JULHST.mjs +0 -141
  303. package/dist/chunk-ODMRJXLJ.mjs +0 -61
  304. package/dist/chunk-QWFOYO3D.mjs +0 -173
  305. package/dist/chunk-S3O52LLG.mjs +0 -151
  306. package/dist/chunk-S4DTK5GI.mjs +0 -4036
  307. package/dist/chunk-SWR7E3NU.mjs +0 -78
  308. package/dist/chunk-U74WK5VI.mjs +0 -123
  309. package/dist/chunk-UR64ZUAU.mjs +0 -671
  310. package/dist/chunk-V77MALL4.mjs +0 -112
  311. package/dist/components/accordion/accordion.d.mts +0 -154
  312. package/dist/components/accordion/accordion.d.ts +0 -154
  313. package/dist/components/accordion/accordion.js +0 -142
  314. package/dist/components/accordion/accordion.mjs +0 -10
  315. package/dist/components/accordion/accordion.test.js +0 -13015
  316. package/dist/components/accordion/accordion.test.mjs +0 -25
  317. package/dist/components/accordion/accordionItem.d.mts +0 -282
  318. package/dist/components/accordion/accordionItem.d.ts +0 -282
  319. package/dist/components/accordion/accordionItem.mjs +0 -13
  320. package/dist/components/accordion/index.d.mts +0 -6
  321. package/dist/components/accordion/index.d.ts +0 -6
  322. package/dist/components/accordion/index.mjs +0 -18
  323. package/dist/components/button/button-group.test.js +0 -21247
  324. package/dist/components/button/button-group.test.mjs +0 -57
  325. package/dist/components/button/button.test.js +0 -23148
  326. package/dist/components/button/button.test.mjs +0 -52
  327. package/dist/components/card/card.d.mts +0 -124
  328. package/dist/components/card/card.d.ts +0 -124
  329. package/dist/components/card/card.js +0 -103
  330. package/dist/components/card/card.mjs +0 -9
  331. package/dist/components/card/card.test.js +0 -12986
  332. package/dist/components/card/card.test.mjs +0 -24
  333. package/dist/components/card/index.d.mts +0 -5
  334. package/dist/components/card/index.d.ts +0 -5
  335. package/dist/components/card/index.js +0 -109
  336. package/dist/components/card/index.mjs +0 -10
  337. package/dist/components/checkbox/checkbox.test.js +0 -17237
  338. package/dist/components/checkbox/checkbox.test.mjs +0 -100
  339. package/dist/components/input/input.test.d.mts +0 -2
  340. package/dist/components/input/input.test.d.ts +0 -2
  341. package/dist/components/input/input.test.js +0 -22782
  342. package/dist/components/input/input.test.mjs +0 -99
  343. package/dist/components/list/list.test.d.mts +0 -2
  344. package/dist/components/list/list.test.d.ts +0 -2
  345. package/dist/components/list/list.test.js +0 -12995
  346. package/dist/components/list/list.test.mjs +0 -25
  347. package/dist/components/modal/modal.test.d.mts +0 -2
  348. package/dist/components/modal/modal.test.d.ts +0 -2
  349. package/dist/components/modal/modal.test.js +0 -17376
  350. package/dist/components/modal/modal.test.mjs +0 -39
  351. package/dist/components/pagination/pagination.test.d.mts +0 -2
  352. package/dist/components/pagination/pagination.test.d.ts +0 -2
  353. package/dist/components/pagination/pagination.test.js +0 -17051
  354. package/dist/components/pagination/pagination.test.mjs +0 -38
  355. package/dist/components/progress/index.d.mts +0 -5
  356. package/dist/components/progress/index.d.ts +0 -5
  357. package/dist/components/progress/index.js +0 -184
  358. package/dist/components/progress/index.mjs +0 -10
  359. package/dist/components/progress/progress.d.mts +0 -281
  360. package/dist/components/progress/progress.d.ts +0 -281
  361. package/dist/components/progress/progress.js +0 -178
  362. package/dist/components/progress/progress.mjs +0 -9
  363. package/dist/components/progress/progress.test.d.mts +0 -2
  364. package/dist/components/progress/progress.test.d.ts +0 -2
  365. package/dist/components/progress/progress.test.js +0 -13087
  366. package/dist/components/progress/progress.test.mjs +0 -50
  367. package/dist/components/radio/radio.test.d.mts +0 -2
  368. package/dist/components/radio/radio.test.d.ts +0 -2
  369. package/dist/components/radio/radio.test.js +0 -13147
  370. package/dist/components/radio/radio.test.mjs +0 -63
  371. package/dist/components/select/select.test.d.mts +0 -2
  372. package/dist/components/select/select.test.d.ts +0 -2
  373. package/dist/components/select/select.test.js +0 -20928
  374. package/dist/components/select/select.test.mjs +0 -71
  375. package/dist/components/slider/index.d.mts +0 -5
  376. package/dist/components/slider/index.d.ts +0 -5
  377. package/dist/components/slider/index.js +0 -239
  378. package/dist/components/slider/index.mjs +0 -10
  379. package/dist/components/slider/slider.d.mts +0 -359
  380. package/dist/components/slider/slider.d.ts +0 -359
  381. package/dist/components/slider/slider.js +0 -238
  382. package/dist/components/slider/slider.mjs +0 -11
  383. package/dist/components/slider/slider.test.d.mts +0 -2
  384. package/dist/components/slider/slider.test.d.ts +0 -2
  385. package/dist/components/slider/slider.test.js +0 -13122
  386. package/dist/components/slider/slider.test.mjs +0 -30
  387. package/dist/components/switch/switch.test.d.mts +0 -2
  388. package/dist/components/switch/switch.test.d.ts +0 -2
  389. package/dist/components/switch/switch.test.js +0 -13098
  390. package/dist/components/switch/switch.test.mjs +0 -52
  391. package/dist/components/table/table.test.d.mts +0 -2
  392. package/dist/components/table/table.test.d.ts +0 -2
  393. package/dist/components/table/table.test.js +0 -17256
  394. package/dist/components/table/table.test.mjs +0 -42
  395. package/dist/components/tabs/tabs.test.d.mts +0 -2
  396. package/dist/components/tabs/tabs.test.d.ts +0 -2
  397. package/dist/components/tabs/tabs.test.js +0 -17223
  398. package/dist/components/tabs/tabs.test.mjs +0 -70
  399. package/dist/components/textarea/textarea.test.d.mts +0 -2
  400. package/dist/components/textarea/textarea.test.d.ts +0 -2
  401. package/dist/components/textarea/textarea.test.js +0 -19117
  402. package/dist/components/textarea/textarea.test.mjs +0 -66
  403. package/dist/components/toast/toast.test.d.mts +0 -2
  404. package/dist/components/toast/toast.test.d.ts +0 -2
  405. package/dist/components/toast/toast.test.js +0 -16620
  406. package/dist/components/toast/toast.test.mjs +0 -28
  407. package/dist/components/tooltip/tooltip.test.d.mts +0 -2
  408. package/dist/components/tooltip/tooltip.test.d.ts +0 -2
  409. package/dist/components/tooltip/tooltip.test.js +0 -17381
  410. package/dist/components/tooltip/tooltip.test.mjs +0 -39
  411. package/dist/tooltip-utils-DR0UEfBN.d.mts +0 -31
  412. package/dist/tooltip-utils-DR0UEfBN.d.ts +0 -31
  413. /package/dist/{chunk-7VOQKIIK.mjs → chunk-6WSACUIB.mjs} +0 -0
  414. /package/dist/{chunk-HAOK24MK.mjs → chunk-7DLOYKVC.mjs} +0 -0
  415. /package/dist/{chunk-MV2WCFK7.mjs → chunk-KYIODWXL.mjs} +0 -0
  416. /package/dist/{chunk-NMSDSEBD.mjs → chunk-MGEWSREV.mjs} +0 -0
  417. /package/dist/{components/accordion/accordion.test.d.mts → fonts/NanumSquare_acB.d.mts} +0 -0
  418. /package/dist/{components/accordion/accordion.test.d.ts → fonts/NanumSquare_acB.d.ts} +0 -0
  419. /package/dist/{components/button/button-group.test.d.mts → fonts/NanumSquare_acEB.d.mts} +0 -0
  420. /package/dist/{components/button/button-group.test.d.ts → fonts/NanumSquare_acEB.d.ts} +0 -0
  421. /package/dist/{components/button/button.test.d.mts → fonts/NanumSquare_acL.d.mts} +0 -0
  422. /package/dist/{components/button/button.test.d.ts → fonts/NanumSquare_acL.d.ts} +0 -0
  423. /package/dist/{components/card/card.test.d.mts → fonts/NanumSquare_acR.d.mts} +0 -0
  424. /package/dist/{components/card/card.test.d.ts → fonts/NanumSquare_acR.d.ts} +0 -0
  425. /package/dist/{components/checkbox/checkbox.test.d.mts → fonts/font.d.mts} +0 -0
  426. /package/dist/{components/checkbox/checkbox.test.d.ts → fonts/font.d.ts} +0 -0
@@ -1,4036 +0,0 @@
1
- "use client";
2
- import {
3
- getConfig
4
- } from "./chunk-FNPWLOGV.mjs";
5
- import {
6
- __export
7
- } from "./chunk-IZ6II3QA.mjs";
8
-
9
- // ../../node_modules/@testing-library/user-event/dist/esm/utils/misc/isElementType.js
10
- function isElementType(element, tag, props) {
11
- if (element.namespaceURI && element.namespaceURI !== "http://www.w3.org/1999/xhtml") {
12
- return false;
13
- }
14
- tag = Array.isArray(tag) ? tag : [
15
- tag
16
- ];
17
- if (!tag.includes(element.tagName.toLowerCase())) {
18
- return false;
19
- }
20
- if (props) {
21
- return Object.entries(props).every(([k, v]) => element[k] === v);
22
- }
23
- return true;
24
- }
25
-
26
- // ../../node_modules/@testing-library/user-event/dist/esm/utils/click/isClickableInput.js
27
- var clickableInputTypes;
28
- (function(clickableInputTypes2) {
29
- clickableInputTypes2["button"] = "button";
30
- clickableInputTypes2["color"] = "color";
31
- clickableInputTypes2["file"] = "file";
32
- clickableInputTypes2["image"] = "image";
33
- clickableInputTypes2["reset"] = "reset";
34
- clickableInputTypes2["submit"] = "submit";
35
- clickableInputTypes2["checkbox"] = "checkbox";
36
- clickableInputTypes2["radio"] = "radio";
37
- })(clickableInputTypes || (clickableInputTypes = {}));
38
- function isClickableInput(element) {
39
- return isElementType(element, "button") || isElementType(element, "input") && element.type in clickableInputTypes;
40
- }
41
-
42
- // ../../node_modules/@testing-library/user-event/dist/esm/utils/misc/getWindow.js
43
- function getWindow(node) {
44
- var _node_ownerDocument;
45
- if (isDocument(node) && node.defaultView) {
46
- return node.defaultView;
47
- } else if ((_node_ownerDocument = node.ownerDocument) === null || _node_ownerDocument === void 0 ? void 0 : _node_ownerDocument.defaultView) {
48
- return node.ownerDocument.defaultView;
49
- }
50
- throw new Error(`Could not determine window of node. Node was ${describe(node)}`);
51
- }
52
- function isDocument(node) {
53
- return node.nodeType === 9;
54
- }
55
- function describe(val) {
56
- return typeof val === "function" ? `function ${val.name}` : val === null ? "null" : String(val);
57
- }
58
-
59
- // ../../node_modules/@testing-library/user-event/dist/esm/utils/dataTransfer/Blob.js
60
- function readBlobText(blob, FileReader) {
61
- return new Promise((res, rej) => {
62
- const fr = new FileReader();
63
- fr.onerror = rej;
64
- fr.onabort = rej;
65
- fr.onload = () => {
66
- res(String(fr.result));
67
- };
68
- fr.readAsText(blob);
69
- });
70
- }
71
-
72
- // ../../node_modules/@testing-library/user-event/dist/esm/utils/dataTransfer/FileList.js
73
- function createFileList(window, files) {
74
- const list = {
75
- ...files,
76
- length: files.length,
77
- item: (index) => list[index],
78
- [Symbol.iterator]: function* nextFile() {
79
- for (let i = 0; i < list.length; i++) {
80
- yield list[i];
81
- }
82
- }
83
- };
84
- list.constructor = window.FileList;
85
- if (window.FileList) {
86
- Object.setPrototypeOf(list, window.FileList.prototype);
87
- }
88
- Object.freeze(list);
89
- return list;
90
- }
91
-
92
- // ../../node_modules/@testing-library/user-event/dist/esm/utils/dataTransfer/DataTransfer.js
93
- function _define_property(obj, key, value) {
94
- if (key in obj) {
95
- Object.defineProperty(obj, key, {
96
- value,
97
- enumerable: true,
98
- configurable: true,
99
- writable: true
100
- });
101
- } else {
102
- obj[key] = value;
103
- }
104
- return obj;
105
- }
106
- var DataTransferItemStub = class {
107
- getAsFile() {
108
- return this.file;
109
- }
110
- getAsString(callback) {
111
- if (typeof this.data === "string") {
112
- callback(this.data);
113
- }
114
- }
115
- /* istanbul ignore next */
116
- webkitGetAsEntry() {
117
- throw new Error("not implemented");
118
- }
119
- constructor(dataOrFile, type3) {
120
- _define_property(this, "kind", void 0);
121
- _define_property(this, "type", void 0);
122
- _define_property(this, "file", null);
123
- _define_property(this, "data", void 0);
124
- if (typeof dataOrFile === "string") {
125
- this.kind = "string";
126
- this.type = String(type3);
127
- this.data = dataOrFile;
128
- } else {
129
- this.kind = "file";
130
- this.type = dataOrFile.type;
131
- this.file = dataOrFile;
132
- }
133
- }
134
- };
135
- var DataTransferItemListStub = class extends Array {
136
- add(...args) {
137
- const item = new DataTransferItemStub(args[0], args[1]);
138
- this.push(item);
139
- return item;
140
- }
141
- clear() {
142
- this.splice(0, this.length);
143
- }
144
- remove(index) {
145
- this.splice(index, 1);
146
- }
147
- };
148
- function getTypeMatcher(type3, exact) {
149
- const [group, sub] = type3.split("/");
150
- const isGroup = !sub || sub === "*";
151
- return (item) => {
152
- return exact ? item.type === (isGroup ? group : type3) : isGroup ? item.type.startsWith(`${group}/`) : item.type === group;
153
- };
154
- }
155
- function createDataTransferStub(window) {
156
- return new class DataTransferStub {
157
- getData(format) {
158
- var _this_items_find;
159
- const match = (_this_items_find = this.items.find(getTypeMatcher(format, true))) !== null && _this_items_find !== void 0 ? _this_items_find : this.items.find(getTypeMatcher(format, false));
160
- let text = "";
161
- match === null || match === void 0 ? void 0 : match.getAsString((t) => {
162
- text = t;
163
- });
164
- return text;
165
- }
166
- setData(format, data) {
167
- const matchIndex = this.items.findIndex(getTypeMatcher(format, true));
168
- const item = new DataTransferItemStub(data, format);
169
- if (matchIndex >= 0) {
170
- this.items.splice(matchIndex, 1, item);
171
- } else {
172
- this.items.push(item);
173
- }
174
- }
175
- clearData(format) {
176
- if (format) {
177
- const matchIndex = this.items.findIndex(getTypeMatcher(format, true));
178
- if (matchIndex >= 0) {
179
- this.items.remove(matchIndex);
180
- }
181
- } else {
182
- this.items.clear();
183
- }
184
- }
185
- get types() {
186
- const t = [];
187
- if (this.files.length) {
188
- t.push("Files");
189
- }
190
- this.items.forEach((i) => t.push(i.type));
191
- Object.freeze(t);
192
- return t;
193
- }
194
- /* istanbul ignore next */
195
- setDragImage() {
196
- }
197
- constructor() {
198
- _define_property(this, "dropEffect", "none");
199
- _define_property(this, "effectAllowed", "uninitialized");
200
- _define_property(this, "items", new DataTransferItemListStub());
201
- _define_property(this, "files", createFileList(window, []));
202
- }
203
- }();
204
- }
205
- function createDataTransfer(window, files = []) {
206
- const dt = typeof window.DataTransfer === "undefined" ? createDataTransferStub(window) : (
207
- /* istanbul ignore next */
208
- new window.DataTransfer()
209
- );
210
- Object.defineProperty(dt, "files", {
211
- get: () => createFileList(window, files)
212
- });
213
- return dt;
214
- }
215
- function getBlobFromDataTransferItem(window, item) {
216
- if (item.kind === "file") {
217
- return item.getAsFile();
218
- }
219
- let data = "";
220
- item.getAsString((s) => {
221
- data = s;
222
- });
223
- return new window.Blob([
224
- data
225
- ], {
226
- type: item.type
227
- });
228
- }
229
-
230
- // ../../node_modules/@testing-library/user-event/dist/esm/utils/dataTransfer/Clipboard.js
231
- function _define_property2(obj, key, value) {
232
- if (key in obj) {
233
- Object.defineProperty(obj, key, {
234
- value,
235
- enumerable: true,
236
- configurable: true,
237
- writable: true
238
- });
239
- } else {
240
- obj[key] = value;
241
- }
242
- return obj;
243
- }
244
- function createClipboardItem(window, ...blobs) {
245
- const dataMap = Object.fromEntries(blobs.map((b) => [
246
- typeof b === "string" ? "text/plain" : b.type,
247
- Promise.resolve(b)
248
- ]));
249
- if (typeof window.ClipboardItem !== "undefined") {
250
- return new window.ClipboardItem(dataMap);
251
- }
252
- return new class ClipboardItem {
253
- get types() {
254
- return Array.from(Object.keys(this.data));
255
- }
256
- async getType(type3) {
257
- const value = await this.data[type3];
258
- if (!value) {
259
- throw new Error(`${type3} is not one of the available MIME types on this item.`);
260
- }
261
- return value instanceof window.Blob ? value : new window.Blob([
262
- value
263
- ], {
264
- type: type3
265
- });
266
- }
267
- constructor(d) {
268
- _define_property2(this, "data", void 0);
269
- this.data = d;
270
- }
271
- }(dataMap);
272
- }
273
- var ClipboardStubControl = Symbol("Manage ClipboardSub");
274
- function createClipboardStub(window, control) {
275
- return Object.assign(new class Clipboard extends window.EventTarget {
276
- async read() {
277
- return Array.from(this.items);
278
- }
279
- async readText() {
280
- let text = "";
281
- for (const item of this.items) {
282
- const type3 = item.types.includes("text/plain") ? "text/plain" : item.types.find((t) => t.startsWith("text/"));
283
- if (type3) {
284
- text += await item.getType(type3).then((b) => readBlobText(b, window.FileReader));
285
- }
286
- }
287
- return text;
288
- }
289
- async write(data) {
290
- this.items = data;
291
- }
292
- async writeText(text) {
293
- this.items = [
294
- createClipboardItem(window, text)
295
- ];
296
- }
297
- constructor(...args) {
298
- super(...args);
299
- _define_property2(this, "items", []);
300
- }
301
- }(), {
302
- [ClipboardStubControl]: control
303
- });
304
- }
305
- function isClipboardStub(clipboard) {
306
- return !!(clipboard === null || clipboard === void 0 ? void 0 : clipboard[ClipboardStubControl]);
307
- }
308
- function attachClipboardStubToView(window) {
309
- if (isClipboardStub(window.navigator.clipboard)) {
310
- return window.navigator.clipboard[ClipboardStubControl];
311
- }
312
- const realClipboard = Object.getOwnPropertyDescriptor(window.navigator, "clipboard");
313
- let stub;
314
- const control = {
315
- resetClipboardStub: () => {
316
- stub = createClipboardStub(window, control);
317
- },
318
- detachClipboardStub: () => {
319
- if (realClipboard) {
320
- Object.defineProperty(window.navigator, "clipboard", realClipboard);
321
- } else {
322
- Object.defineProperty(window.navigator, "clipboard", {
323
- value: void 0,
324
- configurable: true
325
- });
326
- }
327
- }
328
- };
329
- stub = createClipboardStub(window, control);
330
- Object.defineProperty(window.navigator, "clipboard", {
331
- get: () => stub,
332
- configurable: true
333
- });
334
- return stub[ClipboardStubControl];
335
- }
336
- function resetClipboardStubOnView(window) {
337
- if (isClipboardStub(window.navigator.clipboard)) {
338
- window.navigator.clipboard[ClipboardStubControl].resetClipboardStub();
339
- }
340
- }
341
- function detachClipboardStubFromView(window) {
342
- if (isClipboardStub(window.navigator.clipboard)) {
343
- window.navigator.clipboard[ClipboardStubControl].detachClipboardStub();
344
- }
345
- }
346
- async function readDataTransferFromClipboard(document) {
347
- const window = document.defaultView;
348
- const clipboard = window === null || window === void 0 ? void 0 : window.navigator.clipboard;
349
- const items = clipboard && await clipboard.read();
350
- if (!items) {
351
- throw new Error("The Clipboard API is unavailable.");
352
- }
353
- const dt = createDataTransfer(window);
354
- for (const item of items) {
355
- for (const type3 of item.types) {
356
- dt.setData(type3, await item.getType(type3).then((b) => readBlobText(b, window.FileReader)));
357
- }
358
- }
359
- return dt;
360
- }
361
- async function writeDataTransferToClipboard(document, clipboardData) {
362
- const window = getWindow(document);
363
- const clipboard = window.navigator.clipboard;
364
- const items = [];
365
- for (let i = 0; i < clipboardData.items.length; i++) {
366
- const dtItem = clipboardData.items[i];
367
- const blob = getBlobFromDataTransferItem(window, dtItem);
368
- items.push(createClipboardItem(window, blob));
369
- }
370
- const written = clipboard && await clipboard.write(items).then(
371
- () => true,
372
- // Can happen with other implementations that e.g. require permissions
373
- /* istanbul ignore next */
374
- () => false
375
- );
376
- if (!written) {
377
- throw new Error("The Clipboard API is unavailable.");
378
- }
379
- }
380
- var g = globalThis;
381
- if (typeof g.afterEach === "function") {
382
- g.afterEach(() => resetClipboardStubOnView(globalThis.window));
383
- }
384
- if (typeof g.afterAll === "function") {
385
- g.afterAll(() => detachClipboardStubFromView(globalThis.window));
386
- }
387
-
388
- // ../../node_modules/@testing-library/user-event/dist/esm/utils/edit/isContentEditable.js
389
- function isContentEditable(element) {
390
- return element.hasAttribute("contenteditable") && (element.getAttribute("contenteditable") == "true" || element.getAttribute("contenteditable") == "");
391
- }
392
- function getContentEditable(node) {
393
- const element = getElement(node);
394
- return element && (element.closest('[contenteditable=""]') || element.closest('[contenteditable="true"]'));
395
- }
396
- function getElement(node) {
397
- return node.nodeType === 1 ? node : node.parentElement;
398
- }
399
-
400
- // ../../node_modules/@testing-library/user-event/dist/esm/utils/edit/isEditable.js
401
- function isEditable(element) {
402
- return isEditableInputOrTextArea(element) && !element.readOnly || isContentEditable(element);
403
- }
404
- var editableInputTypes;
405
- (function(editableInputTypes2) {
406
- editableInputTypes2["text"] = "text";
407
- editableInputTypes2["date"] = "date";
408
- editableInputTypes2["datetime-local"] = "datetime-local";
409
- editableInputTypes2["email"] = "email";
410
- editableInputTypes2["month"] = "month";
411
- editableInputTypes2["number"] = "number";
412
- editableInputTypes2["password"] = "password";
413
- editableInputTypes2["search"] = "search";
414
- editableInputTypes2["tel"] = "tel";
415
- editableInputTypes2["time"] = "time";
416
- editableInputTypes2["url"] = "url";
417
- editableInputTypes2["week"] = "week";
418
- })(editableInputTypes || (editableInputTypes = {}));
419
- function isEditableInputOrTextArea(element) {
420
- return isElementType(element, "textarea") || isElementType(element, "input") && element.type in editableInputTypes;
421
- }
422
-
423
- // ../../node_modules/@testing-library/user-event/dist/esm/utils/edit/maxLength.js
424
- var maxLengthSupportedTypes;
425
- (function(maxLengthSupportedTypes2) {
426
- maxLengthSupportedTypes2["email"] = "email";
427
- maxLengthSupportedTypes2["password"] = "password";
428
- maxLengthSupportedTypes2["search"] = "search";
429
- maxLengthSupportedTypes2["telephone"] = "telephone";
430
- maxLengthSupportedTypes2["text"] = "text";
431
- maxLengthSupportedTypes2["url"] = "url";
432
- })(maxLengthSupportedTypes || (maxLengthSupportedTypes = {}));
433
- function getMaxLength(element) {
434
- var _element_getAttribute;
435
- const attr = (_element_getAttribute = element.getAttribute("maxlength")) !== null && _element_getAttribute !== void 0 ? _element_getAttribute : "";
436
- return /^\d+$/.test(attr) && Number(attr) >= 0 ? Number(attr) : void 0;
437
- }
438
- function supportsMaxLength(element) {
439
- return isElementType(element, "textarea") || isElementType(element, "input") && element.type in maxLengthSupportedTypes;
440
- }
441
-
442
- // ../../node_modules/@testing-library/user-event/dist/esm/utils/focus/selector.js
443
- var FOCUSABLE_SELECTOR = [
444
- "input:not([type=hidden]):not([disabled])",
445
- "button:not([disabled])",
446
- "select:not([disabled])",
447
- "textarea:not([disabled])",
448
- '[contenteditable=""]',
449
- '[contenteditable="true"]',
450
- "a[href]",
451
- "[tabindex]:not([disabled])"
452
- ].join(", ");
453
-
454
- // ../../node_modules/@testing-library/user-event/dist/esm/utils/focus/isFocusable.js
455
- function isFocusable(element) {
456
- return element.matches(FOCUSABLE_SELECTOR);
457
- }
458
-
459
- // ../../node_modules/@testing-library/user-event/dist/esm/utils/keyDef/readNextDescriptor.js
460
- var bracketDict;
461
- (function(bracketDict2) {
462
- bracketDict2["{"] = "}";
463
- bracketDict2["["] = "]";
464
- })(bracketDict || (bracketDict = {}));
465
- function readNextDescriptor(text, context) {
466
- let pos = 0;
467
- const startBracket = text[pos] in bracketDict ? text[pos] : "";
468
- pos += startBracket.length;
469
- const isEscapedChar = new RegExp(`^\\${startBracket}{2}`).test(text);
470
- const type3 = isEscapedChar ? "" : startBracket;
471
- return {
472
- type: type3,
473
- ...type3 === "" ? readPrintableChar(text, pos, context) : readTag(text, pos, type3, context)
474
- };
475
- }
476
- function readPrintableChar(text, pos, context) {
477
- const descriptor = text[pos];
478
- assertDescriptor(descriptor, text, pos, context);
479
- pos += descriptor.length;
480
- return {
481
- consumedLength: pos,
482
- descriptor,
483
- releasePrevious: false,
484
- releaseSelf: true,
485
- repeat: 1
486
- };
487
- }
488
- function readTag(text, pos, startBracket, context) {
489
- var _text_slice_match, _text_slice_match1;
490
- const releasePreviousModifier = text[pos] === "/" ? "/" : "";
491
- pos += releasePreviousModifier.length;
492
- const escapedDescriptor = startBracket === "{" && text[pos] === "\\";
493
- pos += Number(escapedDescriptor);
494
- const descriptor = escapedDescriptor ? text[pos] : (_text_slice_match = text.slice(pos).match(startBracket === "{" ? /^\w+|^[^}>/]/ : /^\w+/)) === null || _text_slice_match === void 0 ? void 0 : _text_slice_match[0];
495
- assertDescriptor(descriptor, text, pos, context);
496
- pos += descriptor.length;
497
- var _text_slice_match_;
498
- const repeatModifier = (_text_slice_match_ = (_text_slice_match1 = text.slice(pos).match(/^>\d+/)) === null || _text_slice_match1 === void 0 ? void 0 : _text_slice_match1[0]) !== null && _text_slice_match_ !== void 0 ? _text_slice_match_ : "";
499
- pos += repeatModifier.length;
500
- const releaseSelfModifier = text[pos] === "/" || !repeatModifier && text[pos] === ">" ? text[pos] : "";
501
- pos += releaseSelfModifier.length;
502
- const expectedEndBracket = bracketDict[startBracket];
503
- const endBracket = text[pos] === expectedEndBracket ? expectedEndBracket : "";
504
- if (!endBracket) {
505
- throw new Error(getErrorMessage([
506
- !repeatModifier && "repeat modifier",
507
- !releaseSelfModifier && "release modifier",
508
- `"${expectedEndBracket}"`
509
- ].filter(Boolean).join(" or "), text[pos], text, context));
510
- }
511
- pos += endBracket.length;
512
- return {
513
- consumedLength: pos,
514
- descriptor,
515
- releasePrevious: !!releasePreviousModifier,
516
- repeat: repeatModifier ? Math.max(Number(repeatModifier.substr(1)), 1) : 1,
517
- releaseSelf: hasReleaseSelf(releaseSelfModifier, repeatModifier)
518
- };
519
- }
520
- function assertDescriptor(descriptor, text, pos, context) {
521
- if (!descriptor) {
522
- throw new Error(getErrorMessage("key descriptor", text[pos], text, context));
523
- }
524
- }
525
- function hasReleaseSelf(releaseSelfModifier, repeatModifier) {
526
- if (releaseSelfModifier) {
527
- return releaseSelfModifier === "/";
528
- }
529
- if (repeatModifier) {
530
- return false;
531
- }
532
- }
533
- function getErrorMessage(expected, found, text, context) {
534
- return `Expected ${expected} but found "${found !== null && found !== void 0 ? found : ""}" in "${text}"
535
- See ${context === "pointer" ? `https://testing-library.com/docs/user-event/pointer#pressing-a-button-or-touching-the-screen` : `https://testing-library.com/docs/user-event/keyboard`}
536
- for more information about how userEvent parses your input.`;
537
- }
538
-
539
- // ../../node_modules/@testing-library/user-event/dist/esm/utils/misc/cloneEvent.js
540
- function cloneEvent(event) {
541
- return new event.constructor(event.type, event);
542
- }
543
-
544
- // ../../node_modules/@testing-library/user-event/dist/esm/utils/misc/level.js
545
- var ApiLevel;
546
- (function(ApiLevel2) {
547
- ApiLevel2[ApiLevel2["Trigger"] = 2] = "Trigger";
548
- ApiLevel2[ApiLevel2["Call"] = 1] = "Call";
549
- })(ApiLevel || (ApiLevel = {}));
550
- function setLevelRef(instance, level) {
551
- instance.levelRefs[level] = {};
552
- }
553
- function getLevelRef(instance, level) {
554
- return instance.levelRefs[level];
555
- }
556
-
557
- // ../../node_modules/@testing-library/user-event/dist/esm/options.js
558
- var PointerEventsCheckLevel;
559
- (function(PointerEventsCheckLevel2) {
560
- PointerEventsCheckLevel2[PointerEventsCheckLevel2["EachTrigger"] = 4] = "EachTrigger";
561
- PointerEventsCheckLevel2[PointerEventsCheckLevel2["EachApiCall"] = 2] = "EachApiCall";
562
- PointerEventsCheckLevel2[PointerEventsCheckLevel2["EachTarget"] = 1] = "EachTarget";
563
- PointerEventsCheckLevel2[PointerEventsCheckLevel2["Never"] = 0] = "Never";
564
- })(PointerEventsCheckLevel || (PointerEventsCheckLevel = {}));
565
-
566
- // ../../node_modules/@testing-library/user-event/dist/esm/utils/misc/isDisabled.js
567
- function isDisabled(element) {
568
- for (let el = element; el; el = el.parentElement) {
569
- if (isElementType(el, [
570
- "button",
571
- "input",
572
- "select",
573
- "textarea",
574
- "optgroup",
575
- "option"
576
- ])) {
577
- if (el.hasAttribute("disabled")) {
578
- return true;
579
- }
580
- } else if (isElementType(el, "fieldset")) {
581
- var _el_querySelector;
582
- if (el.hasAttribute("disabled") && !((_el_querySelector = el.querySelector(":scope > legend")) === null || _el_querySelector === void 0 ? void 0 : _el_querySelector.contains(element))) {
583
- return true;
584
- }
585
- } else if (el.tagName.includes("-")) {
586
- if (el.constructor.formAssociated && el.hasAttribute("disabled")) {
587
- return true;
588
- }
589
- }
590
- }
591
- return false;
592
- }
593
-
594
- // ../../node_modules/@testing-library/user-event/dist/esm/utils/focus/getActiveElement.js
595
- function getActiveElement(document) {
596
- const activeElement = document.activeElement;
597
- if (activeElement === null || activeElement === void 0 ? void 0 : activeElement.shadowRoot) {
598
- return getActiveElement(activeElement.shadowRoot);
599
- } else {
600
- if (isDisabled(activeElement)) {
601
- return document.ownerDocument ? (
602
- /* istanbul ignore next */
603
- document.ownerDocument.body
604
- ) : document.body;
605
- }
606
- return activeElement;
607
- }
608
- }
609
- function getActiveElementOrBody(document) {
610
- var _getActiveElement;
611
- return (_getActiveElement = getActiveElement(document)) !== null && _getActiveElement !== void 0 ? _getActiveElement : (
612
- /* istanbul ignore next */
613
- document.body
614
- );
615
- }
616
-
617
- // ../../node_modules/@testing-library/user-event/dist/esm/utils/misc/findClosest.js
618
- function findClosest(element, callback) {
619
- let el = element;
620
- do {
621
- if (callback(el)) {
622
- return el;
623
- }
624
- el = el.parentElement;
625
- } while (el && el !== element.ownerDocument.body);
626
- return void 0;
627
- }
628
-
629
- // ../../node_modules/@testing-library/user-event/dist/esm/utils/focus/selection.js
630
- function hasOwnSelection(node) {
631
- return isElement(node) && isEditableInputOrTextArea(node);
632
- }
633
- function hasNoSelection(node) {
634
- return isElement(node) && isClickableInput(node);
635
- }
636
- function isElement(node) {
637
- return node.nodeType === 1;
638
- }
639
-
640
- // ../../node_modules/@testing-library/user-event/dist/esm/event/selection/updateSelectionOnFocus.js
641
- function updateSelectionOnFocus(element) {
642
- const selection = element.ownerDocument.getSelection();
643
- if (!(selection === null || selection === void 0 ? void 0 : selection.focusNode)) {
644
- return;
645
- }
646
- if (hasOwnSelection(element)) {
647
- const contenteditable = getContentEditable(selection.focusNode);
648
- if (contenteditable) {
649
- if (!selection.isCollapsed) {
650
- var _contenteditable_firstChild;
651
- const focusNode = ((_contenteditable_firstChild = contenteditable.firstChild) === null || _contenteditable_firstChild === void 0 ? void 0 : _contenteditable_firstChild.nodeType) === 3 ? contenteditable.firstChild : contenteditable;
652
- selection.setBaseAndExtent(focusNode, 0, focusNode, 0);
653
- }
654
- } else {
655
- selection.setBaseAndExtent(element, 0, element, 0);
656
- }
657
- }
658
- }
659
-
660
- // ../../node_modules/@testing-library/user-event/dist/esm/event/wrapEvent.js
661
- function wrapEvent(cb, _element) {
662
- return getConfig().eventWrapper(cb);
663
- }
664
-
665
- // ../../node_modules/@testing-library/user-event/dist/esm/event/focus.js
666
- function focusElement(element) {
667
- const target = findClosest(element, isFocusable);
668
- const activeElement = getActiveElement(element.ownerDocument);
669
- if ((target !== null && target !== void 0 ? target : element.ownerDocument.body) === activeElement) {
670
- return;
671
- } else if (target) {
672
- wrapEvent(() => target.focus());
673
- } else {
674
- wrapEvent(() => activeElement === null || activeElement === void 0 ? void 0 : activeElement.blur());
675
- }
676
- updateSelectionOnFocus(target !== null && target !== void 0 ? target : element.ownerDocument.body);
677
- }
678
- function blurElement(element) {
679
- if (!isFocusable(element)) return;
680
- const wasActive = getActiveElement(element.ownerDocument) === element;
681
- if (!wasActive) return;
682
- wrapEvent(() => element.blur());
683
- }
684
-
685
- // ../../node_modules/@testing-library/user-event/dist/esm/event/behavior/registry.js
686
- var behavior = {};
687
-
688
- // ../../node_modules/@testing-library/user-event/dist/esm/event/behavior/click.js
689
- behavior.click = (event, target, instance) => {
690
- const context = target.closest("button,input,label,select,textarea");
691
- const control = context && isElementType(context, "label") && context.control;
692
- if (control) {
693
- return () => {
694
- if (isFocusable(control)) {
695
- focusElement(control);
696
- }
697
- instance.dispatchEvent(control, cloneEvent(event));
698
- };
699
- } else if (isElementType(target, "input", {
700
- type: "file"
701
- })) {
702
- return () => {
703
- blurElement(target);
704
- target.dispatchEvent(new (getWindow(target)).Event("fileDialog"));
705
- focusElement(target);
706
- };
707
- }
708
- };
709
-
710
- // ../../node_modules/@testing-library/user-event/dist/esm/document/UI.js
711
- var UIValue = Symbol("Displayed value in UI");
712
- var UISelection = Symbol("Displayed selection in UI");
713
- var InitialValue = Symbol("Initial value to compare on blur");
714
- function isUIValue(value) {
715
- return typeof value === "object" && UIValue in value;
716
- }
717
- function isUISelectionStart(start) {
718
- return !!start && typeof start === "object" && UISelection in start;
719
- }
720
- function setUIValue(element, value) {
721
- if (element[InitialValue] === void 0) {
722
- element[InitialValue] = element.value;
723
- }
724
- element[UIValue] = value;
725
- element.value = Object.assign(new String(value), {
726
- [UIValue]: true
727
- });
728
- }
729
- function getUIValue(element) {
730
- return element[UIValue] === void 0 ? element.value : String(element[UIValue]);
731
- }
732
- function setUIValueClean(element) {
733
- element[UIValue] = void 0;
734
- }
735
- function clearInitialValue(element) {
736
- element[InitialValue] = void 0;
737
- }
738
- function getInitialValue(element) {
739
- return element[InitialValue];
740
- }
741
- function setUISelectionRaw(element, selection) {
742
- element[UISelection] = selection;
743
- }
744
- function setUISelection(element, { focusOffset: focusOffsetParam, anchorOffset: anchorOffsetParam = focusOffsetParam }, mode = "replace") {
745
- const valueLength = getUIValue(element).length;
746
- const sanitizeOffset = (o) => Math.max(0, Math.min(valueLength, o));
747
- const anchorOffset = mode === "replace" || element[UISelection] === void 0 ? sanitizeOffset(anchorOffsetParam) : element[UISelection].anchorOffset;
748
- const focusOffset = sanitizeOffset(focusOffsetParam);
749
- const startOffset = Math.min(anchorOffset, focusOffset);
750
- const endOffset = Math.max(anchorOffset, focusOffset);
751
- element[UISelection] = {
752
- anchorOffset,
753
- focusOffset
754
- };
755
- if (element.selectionStart === startOffset && element.selectionEnd === endOffset) {
756
- return;
757
- }
758
- const startObj = Object.assign(new Number(startOffset), {
759
- [UISelection]: true
760
- });
761
- try {
762
- element.setSelectionRange(startObj, endOffset);
763
- } catch {
764
- }
765
- }
766
- function getUISelection(element) {
767
- var _element_selectionStart, _element_selectionEnd, _element_UISelection;
768
- const sel = (_element_UISelection = element[UISelection]) !== null && _element_UISelection !== void 0 ? _element_UISelection : {
769
- anchorOffset: (_element_selectionStart = element.selectionStart) !== null && _element_selectionStart !== void 0 ? _element_selectionStart : 0,
770
- focusOffset: (_element_selectionEnd = element.selectionEnd) !== null && _element_selectionEnd !== void 0 ? _element_selectionEnd : 0
771
- };
772
- return {
773
- ...sel,
774
- startOffset: Math.min(sel.anchorOffset, sel.focusOffset),
775
- endOffset: Math.max(sel.anchorOffset, sel.focusOffset)
776
- };
777
- }
778
- function hasUISelection(element) {
779
- return !!element[UISelection];
780
- }
781
- function setUISelectionClean(element) {
782
- element[UISelection] = void 0;
783
- }
784
-
785
- // ../../node_modules/@testing-library/user-event/dist/esm/utils/edit/timeValue.js
786
- var parseInt = globalThis.parseInt;
787
- function buildTimeValue(value) {
788
- const onlyDigitsValue = value.replace(/\D/g, "");
789
- if (onlyDigitsValue.length < 2) {
790
- return value;
791
- }
792
- const firstDigit = parseInt(onlyDigitsValue[0], 10);
793
- const secondDigit = parseInt(onlyDigitsValue[1], 10);
794
- if (firstDigit >= 3 || firstDigit === 2 && secondDigit >= 4) {
795
- let index;
796
- if (firstDigit >= 3) {
797
- index = 1;
798
- } else {
799
- index = 2;
800
- }
801
- return build(onlyDigitsValue, index);
802
- }
803
- if (value.length === 2) {
804
- return value;
805
- }
806
- return build(onlyDigitsValue, 2);
807
- }
808
- function build(onlyDigitsValue, index) {
809
- const hours = onlyDigitsValue.slice(0, index);
810
- const validHours = Math.min(parseInt(hours, 10), 23);
811
- const minuteCharacters = onlyDigitsValue.slice(index);
812
- const parsedMinutes = parseInt(minuteCharacters, 10);
813
- const validMinutes = Math.min(parsedMinutes, 59);
814
- return `${validHours.toString().padStart(2, "0")}:${validMinutes.toString().padStart(2, "0")}`;
815
- }
816
- function isValidDateOrTimeValue(element, value) {
817
- const clone = element.cloneNode();
818
- clone.value = value;
819
- return clone.value === value;
820
- }
821
-
822
- // ../../node_modules/@testing-library/user-event/dist/esm/utils/focus/cursor.js
823
- function getNextCursorPosition(node, offset, direction, inputType) {
824
- if (isTextNode(node) && offset + direction >= 0 && offset + direction <= node.nodeValue.length) {
825
- return {
826
- node,
827
- offset: offset + direction
828
- };
829
- }
830
- const nextNode = getNextCharacterContentNode(node, offset, direction);
831
- if (nextNode) {
832
- if (isTextNode(nextNode)) {
833
- return {
834
- node: nextNode,
835
- offset: direction > 0 ? Math.min(1, nextNode.nodeValue.length) : Math.max(nextNode.nodeValue.length - 1, 0)
836
- };
837
- } else if (isElementType(nextNode, "br")) {
838
- const nextPlusOne = getNextCharacterContentNode(nextNode, void 0, direction);
839
- if (!nextPlusOne) {
840
- if (direction < 0 && inputType === "deleteContentBackward") {
841
- return {
842
- node: nextNode.parentNode,
843
- offset: getOffset(nextNode)
844
- };
845
- }
846
- return void 0;
847
- } else if (isTextNode(nextPlusOne)) {
848
- return {
849
- node: nextPlusOne,
850
- offset: direction > 0 ? 0 : nextPlusOne.nodeValue.length
851
- };
852
- } else if (direction < 0 && isElementType(nextPlusOne, "br")) {
853
- return {
854
- node: nextNode.parentNode,
855
- offset: getOffset(nextNode)
856
- };
857
- } else {
858
- return {
859
- node: nextPlusOne.parentNode,
860
- offset: getOffset(nextPlusOne) + (direction > 0 ? 0 : 1)
861
- };
862
- }
863
- } else {
864
- return {
865
- node: nextNode.parentNode,
866
- offset: getOffset(nextNode) + (direction > 0 ? 1 : 0)
867
- };
868
- }
869
- }
870
- }
871
- function getNextCharacterContentNode(node, offset, direction) {
872
- const nextOffset = Number(offset) + (direction < 0 ? -1 : 0);
873
- if (offset !== void 0 && isElement2(node) && nextOffset >= 0 && nextOffset < node.children.length) {
874
- node = node.children[nextOffset];
875
- }
876
- return walkNodes(node, direction === 1 ? "next" : "previous", isTreatedAsCharacterContent);
877
- }
878
- function isTreatedAsCharacterContent(node) {
879
- if (isTextNode(node)) {
880
- return true;
881
- }
882
- if (isElement2(node)) {
883
- if (isElementType(node, [
884
- "input",
885
- "textarea"
886
- ])) {
887
- return node.type !== "hidden";
888
- } else if (isElementType(node, "br")) {
889
- return true;
890
- }
891
- }
892
- return false;
893
- }
894
- function getOffset(node) {
895
- let i = 0;
896
- while (node.previousSibling) {
897
- i++;
898
- node = node.previousSibling;
899
- }
900
- return i;
901
- }
902
- function isElement2(node) {
903
- return node.nodeType === 1;
904
- }
905
- function isTextNode(node) {
906
- return node.nodeType === 3;
907
- }
908
- function walkNodes(node, direction, callback) {
909
- for (; ; ) {
910
- var _node_ownerDocument;
911
- const sibling = node[`${direction}Sibling`];
912
- if (sibling) {
913
- node = getDescendant(sibling, direction === "next" ? "first" : "last");
914
- if (callback(node)) {
915
- return node;
916
- }
917
- } else if (node.parentNode && (!isElement2(node.parentNode) || !isContentEditable(node.parentNode) && node.parentNode !== ((_node_ownerDocument = node.ownerDocument) === null || _node_ownerDocument === void 0 ? void 0 : _node_ownerDocument.body))) {
918
- node = node.parentNode;
919
- } else {
920
- break;
921
- }
922
- }
923
- }
924
- function getDescendant(node, direction) {
925
- while (node.hasChildNodes()) {
926
- node = node[`${direction}Child`];
927
- }
928
- return node;
929
- }
930
-
931
- // ../../node_modules/@testing-library/user-event/dist/esm/document/trackValue.js
932
- var TrackChanges = Symbol("Track programmatic changes for React workaround");
933
- function isReact17Element(element) {
934
- return Object.getOwnPropertyNames(element).some((k) => k.startsWith("__react")) && getWindow(element).REACT_VERSION === 17;
935
- }
936
- function startTrackValue(element) {
937
- if (!isReact17Element(element)) {
938
- return;
939
- }
940
- element[TrackChanges] = {
941
- previousValue: String(element.value),
942
- tracked: []
943
- };
944
- }
945
- function trackOrSetValue(element, v) {
946
- var _element_TrackChanges_tracked, _element_TrackChanges;
947
- (_element_TrackChanges = element[TrackChanges]) === null || _element_TrackChanges === void 0 ? void 0 : (_element_TrackChanges_tracked = _element_TrackChanges.tracked) === null || _element_TrackChanges_tracked === void 0 ? void 0 : _element_TrackChanges_tracked.push(v);
948
- if (!element[TrackChanges]) {
949
- setUIValueClean(element);
950
- setUISelection(element, {
951
- focusOffset: v.length
952
- });
953
- }
954
- }
955
- function commitValueAfterInput(element, cursorOffset) {
956
- var _changes_tracked;
957
- const changes = element[TrackChanges];
958
- element[TrackChanges] = void 0;
959
- if (!(changes === null || changes === void 0 ? void 0 : (_changes_tracked = changes.tracked) === null || _changes_tracked === void 0 ? void 0 : _changes_tracked.length)) {
960
- return;
961
- }
962
- const isJustReactStateUpdate = changes.tracked.length === 2 && changes.tracked[0] === changes.previousValue && changes.tracked[1] === element.value;
963
- if (!isJustReactStateUpdate) {
964
- setUIValueClean(element);
965
- }
966
- if (hasUISelection(element)) {
967
- setUISelection(element, {
968
- focusOffset: isJustReactStateUpdate ? cursorOffset : element.value.length
969
- });
970
- }
971
- }
972
-
973
- // ../../node_modules/@testing-library/user-event/dist/esm/event/selection/getTargetTypeAndSelection.js
974
- function getTargetTypeAndSelection(node) {
975
- const element = getElement2(node);
976
- if (element && hasOwnSelection(element)) {
977
- return {
978
- type: "input",
979
- selection: getUISelection(element)
980
- };
981
- }
982
- const selection = element === null || element === void 0 ? void 0 : element.ownerDocument.getSelection();
983
- const isCE = getContentEditable(node) && (selection === null || selection === void 0 ? void 0 : selection.anchorNode) && getContentEditable(selection.anchorNode);
984
- return {
985
- type: isCE ? "contenteditable" : "default",
986
- selection
987
- };
988
- }
989
- function getElement2(node) {
990
- return node.nodeType === 1 ? node : node.parentElement;
991
- }
992
-
993
- // ../../node_modules/@testing-library/user-event/dist/esm/event/selection/getInputRange.js
994
- function getInputRange(focusNode) {
995
- const typeAndSelection = getTargetTypeAndSelection(focusNode);
996
- if (typeAndSelection.type === "input") {
997
- return typeAndSelection.selection;
998
- } else if (typeAndSelection.type === "contenteditable") {
999
- var _typeAndSelection_selection;
1000
- return (_typeAndSelection_selection = typeAndSelection.selection) === null || _typeAndSelection_selection === void 0 ? void 0 : _typeAndSelection_selection.getRangeAt(0);
1001
- }
1002
- }
1003
-
1004
- // ../../node_modules/@testing-library/user-event/dist/esm/event/selection/setSelection.js
1005
- function setSelection({ focusNode, focusOffset, anchorNode = focusNode, anchorOffset = focusOffset }) {
1006
- var _anchorNode_ownerDocument_getSelection, _anchorNode_ownerDocument;
1007
- const typeAndSelection = getTargetTypeAndSelection(focusNode);
1008
- if (typeAndSelection.type === "input") {
1009
- return setUISelection(focusNode, {
1010
- anchorOffset,
1011
- focusOffset
1012
- });
1013
- }
1014
- (_anchorNode_ownerDocument = anchorNode.ownerDocument) === null || _anchorNode_ownerDocument === void 0 ? void 0 : (_anchorNode_ownerDocument_getSelection = _anchorNode_ownerDocument.getSelection()) === null || _anchorNode_ownerDocument_getSelection === void 0 ? void 0 : _anchorNode_ownerDocument_getSelection.setBaseAndExtent(anchorNode, anchorOffset, focusNode, focusOffset);
1015
- }
1016
-
1017
- // ../../node_modules/@testing-library/user-event/dist/esm/event/input.js
1018
- function isDateOrTime(element) {
1019
- return isElementType(element, "input") && [
1020
- "date",
1021
- "time"
1022
- ].includes(element.type);
1023
- }
1024
- function input(instance, element, data, inputType = "insertText") {
1025
- const inputRange = getInputRange(element);
1026
- if (!inputRange) {
1027
- return;
1028
- }
1029
- if (!isDateOrTime(element)) {
1030
- const unprevented = instance.dispatchUIEvent(element, "beforeinput", {
1031
- inputType,
1032
- data
1033
- });
1034
- if (!unprevented) {
1035
- return;
1036
- }
1037
- }
1038
- if ("startContainer" in inputRange) {
1039
- editContenteditable(instance, element, inputRange, data, inputType);
1040
- } else {
1041
- editInputElement(instance, element, inputRange, data, inputType);
1042
- }
1043
- }
1044
- function editContenteditable(instance, element, inputRange, data, inputType) {
1045
- let del = false;
1046
- if (!inputRange.collapsed) {
1047
- del = true;
1048
- inputRange.deleteContents();
1049
- } else if ([
1050
- "deleteContentBackward",
1051
- "deleteContentForward"
1052
- ].includes(inputType)) {
1053
- const nextPosition = getNextCursorPosition(inputRange.startContainer, inputRange.startOffset, inputType === "deleteContentBackward" ? -1 : 1, inputType);
1054
- if (nextPosition) {
1055
- del = true;
1056
- const delRange = inputRange.cloneRange();
1057
- if (delRange.comparePoint(nextPosition.node, nextPosition.offset) < 0) {
1058
- delRange.setStart(nextPosition.node, nextPosition.offset);
1059
- } else {
1060
- delRange.setEnd(nextPosition.node, nextPosition.offset);
1061
- }
1062
- delRange.deleteContents();
1063
- }
1064
- }
1065
- if (data) {
1066
- if (inputRange.endContainer.nodeType === 3) {
1067
- const offset = inputRange.endOffset;
1068
- inputRange.endContainer.insertData(offset, data);
1069
- inputRange.setStart(inputRange.endContainer, offset + data.length);
1070
- inputRange.setEnd(inputRange.endContainer, offset + data.length);
1071
- } else {
1072
- const text = element.ownerDocument.createTextNode(data);
1073
- inputRange.insertNode(text);
1074
- inputRange.setStart(text, data.length);
1075
- inputRange.setEnd(text, data.length);
1076
- }
1077
- }
1078
- if (del || data) {
1079
- instance.dispatchUIEvent(element, "input", {
1080
- inputType
1081
- });
1082
- }
1083
- }
1084
- function editInputElement(instance, element, inputRange, data, inputType) {
1085
- let dataToInsert = data;
1086
- if (supportsMaxLength(element)) {
1087
- const maxLength = getMaxLength(element);
1088
- if (maxLength !== void 0 && data.length > 0) {
1089
- const spaceUntilMaxLength = maxLength - element.value.length;
1090
- if (spaceUntilMaxLength > 0) {
1091
- dataToInsert = data.substring(0, spaceUntilMaxLength);
1092
- } else {
1093
- return;
1094
- }
1095
- }
1096
- }
1097
- const { newValue, newOffset, oldValue } = calculateNewValue(dataToInsert, element, inputRange, inputType);
1098
- if (newValue === oldValue && newOffset === inputRange.startOffset && newOffset === inputRange.endOffset) {
1099
- return;
1100
- }
1101
- if (isElementType(element, "input", {
1102
- type: "number"
1103
- }) && !isValidNumberInput(newValue)) {
1104
- return;
1105
- }
1106
- setUIValue(element, newValue);
1107
- setSelection({
1108
- focusNode: element,
1109
- anchorOffset: newOffset,
1110
- focusOffset: newOffset
1111
- });
1112
- if (isDateOrTime(element)) {
1113
- if (isValidDateOrTimeValue(element, newValue)) {
1114
- commitInput(instance, element, newOffset, {});
1115
- instance.dispatchUIEvent(element, "change");
1116
- clearInitialValue(element);
1117
- }
1118
- } else {
1119
- commitInput(instance, element, newOffset, {
1120
- data,
1121
- inputType
1122
- });
1123
- }
1124
- }
1125
- function calculateNewValue(inputData, node, { startOffset, endOffset }, inputType) {
1126
- const value = getUIValue(node);
1127
- const prologEnd = Math.max(0, startOffset === endOffset && inputType === "deleteContentBackward" ? startOffset - 1 : startOffset);
1128
- const prolog = value.substring(0, prologEnd);
1129
- const epilogStart = Math.min(value.length, startOffset === endOffset && inputType === "deleteContentForward" ? startOffset + 1 : endOffset);
1130
- const epilog = value.substring(epilogStart, value.length);
1131
- let newValue = `${prolog}${inputData}${epilog}`;
1132
- let newOffset = prologEnd + inputData.length;
1133
- if (isElementType(node, "input", {
1134
- type: "time"
1135
- })) {
1136
- const builtValue = buildTimeValue(newValue);
1137
- if (builtValue !== "" && isValidDateOrTimeValue(node, builtValue)) {
1138
- newValue = builtValue;
1139
- newOffset = builtValue.length;
1140
- }
1141
- }
1142
- return {
1143
- oldValue: value,
1144
- newValue,
1145
- newOffset
1146
- };
1147
- }
1148
- function commitInput(instance, element, newOffset, inputInit) {
1149
- instance.dispatchUIEvent(element, "input", inputInit);
1150
- commitValueAfterInput(element, newOffset);
1151
- }
1152
- function isValidNumberInput(value) {
1153
- var _value_match, _value_match1;
1154
- const valueParts = value.split("e", 2);
1155
- return !(/[^\d.\-e]/.test(value) || Number((_value_match = value.match(/-/g)) === null || _value_match === void 0 ? void 0 : _value_match.length) > 2 || Number((_value_match1 = value.match(/\./g)) === null || _value_match1 === void 0 ? void 0 : _value_match1.length) > 1 || valueParts[1] && !/^-?\d*$/.test(valueParts[1]));
1156
- }
1157
-
1158
- // ../../node_modules/@testing-library/user-event/dist/esm/event/behavior/cut.js
1159
- behavior.cut = (event, target, instance) => {
1160
- return () => {
1161
- if (isEditable(target)) {
1162
- input(instance, target, "", "deleteByCut");
1163
- }
1164
- };
1165
- };
1166
-
1167
- // ../../node_modules/@testing-library/user-event/dist/esm/document/getValueOrTextContent.js
1168
- function getValueOrTextContent(element) {
1169
- if (!element) {
1170
- return null;
1171
- }
1172
- if (isContentEditable(element)) {
1173
- return element.textContent;
1174
- }
1175
- return getUIValue(element);
1176
- }
1177
-
1178
- // ../../node_modules/@testing-library/user-event/dist/esm/utils/misc/isVisible.js
1179
- function isVisible(element) {
1180
- const window = getWindow(element);
1181
- for (let el = element; el === null || el === void 0 ? void 0 : el.ownerDocument; el = el.parentElement) {
1182
- const { display, visibility } = window.getComputedStyle(el);
1183
- if (display === "none") {
1184
- return false;
1185
- }
1186
- if (visibility === "hidden") {
1187
- return false;
1188
- }
1189
- }
1190
- return true;
1191
- }
1192
-
1193
- // ../../node_modules/@testing-library/user-event/dist/esm/utils/focus/getTabDestination.js
1194
- function getTabDestination(activeElement, shift) {
1195
- const document = activeElement.ownerDocument;
1196
- const focusableElements = document.querySelectorAll(FOCUSABLE_SELECTOR);
1197
- const enabledElements = Array.from(focusableElements).filter((el) => el === activeElement || !(Number(el.getAttribute("tabindex")) < 0 || isDisabled(el)));
1198
- if (Number(activeElement.getAttribute("tabindex")) >= 0) {
1199
- enabledElements.sort((a, b) => {
1200
- const i = Number(a.getAttribute("tabindex"));
1201
- const j = Number(b.getAttribute("tabindex"));
1202
- if (i === j) {
1203
- return 0;
1204
- } else if (i === 0) {
1205
- return 1;
1206
- } else if (j === 0) {
1207
- return -1;
1208
- }
1209
- return i - j;
1210
- });
1211
- }
1212
- const checkedRadio = {};
1213
- let prunedElements = [
1214
- document.body
1215
- ];
1216
- const activeRadioGroup = isElementType(activeElement, "input", {
1217
- type: "radio"
1218
- }) ? activeElement.name : void 0;
1219
- enabledElements.forEach((currentElement) => {
1220
- const el = currentElement;
1221
- if (isElementType(el, "input", {
1222
- type: "radio"
1223
- }) && el.name) {
1224
- if (el === activeElement) {
1225
- prunedElements.push(el);
1226
- return;
1227
- } else if (el.name === activeRadioGroup) {
1228
- return;
1229
- }
1230
- if (el.checked) {
1231
- prunedElements = prunedElements.filter((e) => !isElementType(e, "input", {
1232
- type: "radio",
1233
- name: el.name
1234
- }));
1235
- prunedElements.push(el);
1236
- checkedRadio[el.name] = el;
1237
- return;
1238
- }
1239
- if (typeof checkedRadio[el.name] !== "undefined") {
1240
- return;
1241
- }
1242
- }
1243
- prunedElements.push(el);
1244
- });
1245
- for (let index = prunedElements.findIndex((el) => el === activeElement); ; ) {
1246
- index += shift ? -1 : 1;
1247
- if (index === prunedElements.length) {
1248
- index = 0;
1249
- } else if (index === -1) {
1250
- index = prunedElements.length - 1;
1251
- }
1252
- if (prunedElements[index] === activeElement || prunedElements[index] === document.body || isVisible(prunedElements[index])) {
1253
- return prunedElements[index];
1254
- }
1255
- }
1256
- }
1257
-
1258
- // ../../node_modules/@testing-library/user-event/dist/esm/event/selection/moveSelection.js
1259
- function moveSelection(node, direction) {
1260
- if (hasOwnSelection(node)) {
1261
- const selection = getUISelection(node);
1262
- setSelection({
1263
- focusNode: node,
1264
- focusOffset: selection.startOffset === selection.endOffset ? selection.focusOffset + direction : direction < 0 ? selection.startOffset : selection.endOffset
1265
- });
1266
- } else {
1267
- const selection = node.ownerDocument.getSelection();
1268
- if (!(selection === null || selection === void 0 ? void 0 : selection.focusNode)) {
1269
- return;
1270
- }
1271
- if (selection.isCollapsed) {
1272
- const nextPosition = getNextCursorPosition(selection.focusNode, selection.focusOffset, direction);
1273
- if (nextPosition) {
1274
- setSelection({
1275
- focusNode: nextPosition.node,
1276
- focusOffset: nextPosition.offset
1277
- });
1278
- }
1279
- } else {
1280
- selection[direction < 0 ? "collapseToStart" : "collapseToEnd"]();
1281
- }
1282
- }
1283
- }
1284
-
1285
- // ../../node_modules/@testing-library/user-event/dist/esm/event/selection/selectAll.js
1286
- function selectAll(target) {
1287
- if (hasOwnSelection(target)) {
1288
- return setSelection({
1289
- focusNode: target,
1290
- anchorOffset: 0,
1291
- focusOffset: getUIValue(target).length
1292
- });
1293
- }
1294
- var _getContentEditable;
1295
- const focusNode = (_getContentEditable = getContentEditable(target)) !== null && _getContentEditable !== void 0 ? _getContentEditable : target.ownerDocument.body;
1296
- setSelection({
1297
- focusNode,
1298
- anchorOffset: 0,
1299
- focusOffset: focusNode.childNodes.length
1300
- });
1301
- }
1302
- function isAllSelected(target) {
1303
- if (hasOwnSelection(target)) {
1304
- return getUISelection(target).startOffset === 0 && getUISelection(target).endOffset === getUIValue(target).length;
1305
- }
1306
- var _getContentEditable;
1307
- const focusNode = (_getContentEditable = getContentEditable(target)) !== null && _getContentEditable !== void 0 ? _getContentEditable : target.ownerDocument.body;
1308
- const selection = target.ownerDocument.getSelection();
1309
- return (selection === null || selection === void 0 ? void 0 : selection.anchorNode) === focusNode && selection.focusNode === focusNode && selection.anchorOffset === 0 && selection.focusOffset === focusNode.childNodes.length;
1310
- }
1311
-
1312
- // ../../node_modules/@testing-library/user-event/dist/esm/event/selection/setSelectionRange.js
1313
- function setSelectionRange(element, anchorOffset, focusOffset) {
1314
- var _element_firstChild;
1315
- if (hasOwnSelection(element)) {
1316
- return setSelection({
1317
- focusNode: element,
1318
- anchorOffset,
1319
- focusOffset
1320
- });
1321
- }
1322
- if (isContentEditable(element) && ((_element_firstChild = element.firstChild) === null || _element_firstChild === void 0 ? void 0 : _element_firstChild.nodeType) === 3) {
1323
- return setSelection({
1324
- focusNode: element.firstChild,
1325
- anchorOffset,
1326
- focusOffset
1327
- });
1328
- }
1329
- throw new Error("Not implemented. The result of this interaction is unreliable.");
1330
- }
1331
-
1332
- // ../../node_modules/@testing-library/user-event/dist/esm/event/radio.js
1333
- function walkRadio(instance, el, direction) {
1334
- const window = getWindow(el);
1335
- const group = Array.from(el.ownerDocument.querySelectorAll(el.name ? `input[type="radio"][name="${window.CSS.escape(el.name)}"]` : `input[type="radio"][name=""], input[type="radio"]:not([name])`));
1336
- for (let i = group.findIndex((e) => e === el) + direction; ; i += direction) {
1337
- if (!group[i]) {
1338
- i = direction > 0 ? 0 : group.length - 1;
1339
- }
1340
- if (group[i] === el) {
1341
- return;
1342
- }
1343
- if (isDisabled(group[i])) {
1344
- continue;
1345
- }
1346
- focusElement(group[i]);
1347
- instance.dispatchUIEvent(group[i], "click");
1348
- }
1349
- }
1350
-
1351
- // ../../node_modules/@testing-library/user-event/dist/esm/event/behavior/keydown.js
1352
- behavior.keydown = (event, target, instance) => {
1353
- var _keydownBehavior_event_key;
1354
- var _keydownBehavior_event_key1;
1355
- return (_keydownBehavior_event_key1 = (_keydownBehavior_event_key = keydownBehavior[event.key]) === null || _keydownBehavior_event_key === void 0 ? void 0 : _keydownBehavior_event_key.call(keydownBehavior, event, target, instance)) !== null && _keydownBehavior_event_key1 !== void 0 ? _keydownBehavior_event_key1 : combinationBehavior(event, target, instance);
1356
- };
1357
- var keydownBehavior = {
1358
- ArrowDown: (event, target, instance) => {
1359
- if (isElementType(target, "input", {
1360
- type: "radio"
1361
- })) {
1362
- return () => walkRadio(instance, target, -1);
1363
- }
1364
- },
1365
- ArrowLeft: (event, target, instance) => {
1366
- if (isElementType(target, "input", {
1367
- type: "radio"
1368
- })) {
1369
- return () => walkRadio(instance, target, -1);
1370
- }
1371
- return () => moveSelection(target, -1);
1372
- },
1373
- ArrowRight: (event, target, instance) => {
1374
- if (isElementType(target, "input", {
1375
- type: "radio"
1376
- })) {
1377
- return () => walkRadio(instance, target, 1);
1378
- }
1379
- return () => moveSelection(target, 1);
1380
- },
1381
- ArrowUp: (event, target, instance) => {
1382
- if (isElementType(target, "input", {
1383
- type: "radio"
1384
- })) {
1385
- return () => walkRadio(instance, target, 1);
1386
- }
1387
- },
1388
- Backspace: (event, target, instance) => {
1389
- if (isEditable(target)) {
1390
- return () => {
1391
- input(instance, target, "", "deleteContentBackward");
1392
- };
1393
- }
1394
- },
1395
- Delete: (event, target, instance) => {
1396
- if (isEditable(target)) {
1397
- return () => {
1398
- input(instance, target, "", "deleteContentForward");
1399
- };
1400
- }
1401
- },
1402
- End: (event, target) => {
1403
- if (isElementType(target, [
1404
- "input",
1405
- "textarea"
1406
- ]) || isContentEditable(target)) {
1407
- return () => {
1408
- var _getValueOrTextContent;
1409
- var _getValueOrTextContent_length;
1410
- const newPos = (_getValueOrTextContent_length = (_getValueOrTextContent = getValueOrTextContent(target)) === null || _getValueOrTextContent === void 0 ? void 0 : _getValueOrTextContent.length) !== null && _getValueOrTextContent_length !== void 0 ? _getValueOrTextContent_length : (
1411
- /* istanbul ignore next */
1412
- 0
1413
- );
1414
- setSelectionRange(target, newPos, newPos);
1415
- };
1416
- }
1417
- },
1418
- Home: (event, target) => {
1419
- if (isElementType(target, [
1420
- "input",
1421
- "textarea"
1422
- ]) || isContentEditable(target)) {
1423
- return () => {
1424
- setSelectionRange(target, 0, 0);
1425
- };
1426
- }
1427
- },
1428
- PageDown: (event, target) => {
1429
- if (isElementType(target, [
1430
- "input"
1431
- ])) {
1432
- return () => {
1433
- const newPos = getUIValue(target).length;
1434
- setSelectionRange(target, newPos, newPos);
1435
- };
1436
- }
1437
- },
1438
- PageUp: (event, target) => {
1439
- if (isElementType(target, [
1440
- "input"
1441
- ])) {
1442
- return () => {
1443
- setSelectionRange(target, 0, 0);
1444
- };
1445
- }
1446
- },
1447
- Tab: (event, target, instance) => {
1448
- return () => {
1449
- const dest = getTabDestination(target, instance.system.keyboard.modifiers.Shift);
1450
- focusElement(dest);
1451
- if (hasOwnSelection(dest)) {
1452
- setUISelection(dest, {
1453
- anchorOffset: 0,
1454
- focusOffset: dest.value.length
1455
- });
1456
- }
1457
- };
1458
- }
1459
- };
1460
- var combinationBehavior = (event, target, instance) => {
1461
- if (event.code === "KeyA" && instance.system.keyboard.modifiers.Control) {
1462
- return () => selectAll(target);
1463
- }
1464
- };
1465
-
1466
- // ../../node_modules/@testing-library/user-event/dist/esm/event/behavior/keypress.js
1467
- behavior.keypress = (event, target, instance) => {
1468
- if (event.key === "Enter") {
1469
- if (isElementType(target, "button") || isElementType(target, "input") && ClickInputOnEnter.includes(target.type) || isElementType(target, "a") && Boolean(target.href)) {
1470
- return () => {
1471
- instance.dispatchUIEvent(target, "click");
1472
- };
1473
- } else if (isElementType(target, "input")) {
1474
- const form = target.form;
1475
- const submit = form === null || form === void 0 ? void 0 : form.querySelector('input[type="submit"], button:not([type]), button[type="submit"]');
1476
- if (submit) {
1477
- return () => instance.dispatchUIEvent(submit, "click");
1478
- } else if (form && SubmitSingleInputOnEnter.includes(target.type) && form.querySelectorAll("input").length === 1) {
1479
- return () => instance.dispatchUIEvent(form, "submit");
1480
- } else {
1481
- return;
1482
- }
1483
- }
1484
- }
1485
- if (isEditable(target)) {
1486
- const inputType = event.key === "Enter" ? isContentEditable(target) && !instance.system.keyboard.modifiers.Shift ? "insertParagraph" : "insertLineBreak" : "insertText";
1487
- const inputData = event.key === "Enter" ? "\n" : event.key;
1488
- return () => input(instance, target, inputData, inputType);
1489
- }
1490
- };
1491
- var ClickInputOnEnter = [
1492
- "button",
1493
- "color",
1494
- "file",
1495
- "image",
1496
- "reset",
1497
- "submit"
1498
- ];
1499
- var SubmitSingleInputOnEnter = [
1500
- "email",
1501
- "month",
1502
- "password",
1503
- "search",
1504
- "tel",
1505
- "text",
1506
- "url",
1507
- "week"
1508
- ];
1509
-
1510
- // ../../node_modules/@testing-library/user-event/dist/esm/event/behavior/keyup.js
1511
- behavior.keyup = (event, target, instance) => {
1512
- var _keyupBehavior_event_key;
1513
- return (_keyupBehavior_event_key = keyupBehavior[event.key]) === null || _keyupBehavior_event_key === void 0 ? void 0 : _keyupBehavior_event_key.call(keyupBehavior, event, target, instance);
1514
- };
1515
- var keyupBehavior = {
1516
- " ": (event, target, instance) => {
1517
- if (isClickableInput(target)) {
1518
- return () => instance.dispatchUIEvent(target, "click");
1519
- }
1520
- }
1521
- };
1522
-
1523
- // ../../node_modules/@testing-library/user-event/dist/esm/event/behavior/paste.js
1524
- behavior.paste = (event, target, instance) => {
1525
- if (isEditable(target)) {
1526
- return () => {
1527
- var _event_clipboardData;
1528
- const insertData = (_event_clipboardData = event.clipboardData) === null || _event_clipboardData === void 0 ? void 0 : _event_clipboardData.getData("text");
1529
- if (insertData) {
1530
- input(instance, target, insertData, "insertFromPaste");
1531
- }
1532
- };
1533
- }
1534
- };
1535
-
1536
- // ../../node_modules/@testing-library/user-event/dist/esm/event/eventMap.js
1537
- var eventMap = {
1538
- auxclick: {
1539
- EventType: "PointerEvent",
1540
- defaultInit: {
1541
- bubbles: true,
1542
- cancelable: true,
1543
- composed: true
1544
- }
1545
- },
1546
- beforeinput: {
1547
- EventType: "InputEvent",
1548
- defaultInit: {
1549
- bubbles: true,
1550
- cancelable: true,
1551
- composed: true
1552
- }
1553
- },
1554
- click: {
1555
- EventType: "PointerEvent",
1556
- defaultInit: {
1557
- bubbles: true,
1558
- cancelable: true,
1559
- composed: true
1560
- }
1561
- },
1562
- contextmenu: {
1563
- EventType: "PointerEvent",
1564
- defaultInit: {
1565
- bubbles: true,
1566
- cancelable: true,
1567
- composed: true
1568
- }
1569
- },
1570
- copy: {
1571
- EventType: "ClipboardEvent",
1572
- defaultInit: {
1573
- bubbles: true,
1574
- cancelable: true,
1575
- composed: true
1576
- }
1577
- },
1578
- change: {
1579
- EventType: "Event",
1580
- defaultInit: {
1581
- bubbles: true,
1582
- cancelable: false
1583
- }
1584
- },
1585
- cut: {
1586
- EventType: "ClipboardEvent",
1587
- defaultInit: {
1588
- bubbles: true,
1589
- cancelable: true,
1590
- composed: true
1591
- }
1592
- },
1593
- dblclick: {
1594
- EventType: "MouseEvent",
1595
- defaultInit: {
1596
- bubbles: true,
1597
- cancelable: true,
1598
- composed: true
1599
- }
1600
- },
1601
- keydown: {
1602
- EventType: "KeyboardEvent",
1603
- defaultInit: {
1604
- bubbles: true,
1605
- cancelable: true,
1606
- composed: true
1607
- }
1608
- },
1609
- keypress: {
1610
- EventType: "KeyboardEvent",
1611
- defaultInit: {
1612
- bubbles: true,
1613
- cancelable: true,
1614
- composed: true
1615
- }
1616
- },
1617
- keyup: {
1618
- EventType: "KeyboardEvent",
1619
- defaultInit: {
1620
- bubbles: true,
1621
- cancelable: true,
1622
- composed: true
1623
- }
1624
- },
1625
- paste: {
1626
- EventType: "ClipboardEvent",
1627
- defaultInit: {
1628
- bubbles: true,
1629
- cancelable: true,
1630
- composed: true
1631
- }
1632
- },
1633
- input: {
1634
- EventType: "InputEvent",
1635
- defaultInit: {
1636
- bubbles: true,
1637
- cancelable: false,
1638
- composed: true
1639
- }
1640
- },
1641
- mousedown: {
1642
- EventType: "MouseEvent",
1643
- defaultInit: {
1644
- bubbles: true,
1645
- cancelable: true,
1646
- composed: true
1647
- }
1648
- },
1649
- mouseenter: {
1650
- EventType: "MouseEvent",
1651
- defaultInit: {
1652
- bubbles: false,
1653
- cancelable: false,
1654
- composed: true
1655
- }
1656
- },
1657
- mouseleave: {
1658
- EventType: "MouseEvent",
1659
- defaultInit: {
1660
- bubbles: false,
1661
- cancelable: false,
1662
- composed: true
1663
- }
1664
- },
1665
- mousemove: {
1666
- EventType: "MouseEvent",
1667
- defaultInit: {
1668
- bubbles: true,
1669
- cancelable: true,
1670
- composed: true
1671
- }
1672
- },
1673
- mouseout: {
1674
- EventType: "MouseEvent",
1675
- defaultInit: {
1676
- bubbles: true,
1677
- cancelable: true,
1678
- composed: true
1679
- }
1680
- },
1681
- mouseover: {
1682
- EventType: "MouseEvent",
1683
- defaultInit: {
1684
- bubbles: true,
1685
- cancelable: true,
1686
- composed: true
1687
- }
1688
- },
1689
- mouseup: {
1690
- EventType: "MouseEvent",
1691
- defaultInit: {
1692
- bubbles: true,
1693
- cancelable: true,
1694
- composed: true
1695
- }
1696
- },
1697
- pointerover: {
1698
- EventType: "PointerEvent",
1699
- defaultInit: {
1700
- bubbles: true,
1701
- cancelable: true,
1702
- composed: true
1703
- }
1704
- },
1705
- pointerenter: {
1706
- EventType: "PointerEvent",
1707
- defaultInit: {
1708
- bubbles: false,
1709
- cancelable: false
1710
- }
1711
- },
1712
- pointerdown: {
1713
- EventType: "PointerEvent",
1714
- defaultInit: {
1715
- bubbles: true,
1716
- cancelable: true,
1717
- composed: true
1718
- }
1719
- },
1720
- pointermove: {
1721
- EventType: "PointerEvent",
1722
- defaultInit: {
1723
- bubbles: true,
1724
- cancelable: true,
1725
- composed: true
1726
- }
1727
- },
1728
- pointerup: {
1729
- EventType: "PointerEvent",
1730
- defaultInit: {
1731
- bubbles: true,
1732
- cancelable: true,
1733
- composed: true
1734
- }
1735
- },
1736
- pointercancel: {
1737
- EventType: "PointerEvent",
1738
- defaultInit: {
1739
- bubbles: true,
1740
- cancelable: false,
1741
- composed: true
1742
- }
1743
- },
1744
- pointerout: {
1745
- EventType: "PointerEvent",
1746
- defaultInit: {
1747
- bubbles: true,
1748
- cancelable: true,
1749
- composed: true
1750
- }
1751
- },
1752
- pointerleave: {
1753
- EventType: "PointerEvent",
1754
- defaultInit: {
1755
- bubbles: false,
1756
- cancelable: false
1757
- }
1758
- },
1759
- submit: {
1760
- EventType: "Event",
1761
- defaultInit: {
1762
- bubbles: true,
1763
- cancelable: true
1764
- }
1765
- }
1766
- };
1767
- function getEventClass(type3) {
1768
- return eventMap[type3].EventType;
1769
- }
1770
- var mouseEvents = [
1771
- "MouseEvent",
1772
- "PointerEvent"
1773
- ];
1774
- function isMouseEvent(type3) {
1775
- return mouseEvents.includes(getEventClass(type3));
1776
- }
1777
- function isKeyboardEvent(type3) {
1778
- return getEventClass(type3) === "KeyboardEvent";
1779
- }
1780
-
1781
- // ../../node_modules/@testing-library/user-event/dist/esm/event/createEvent.js
1782
- var eventInitializer = {
1783
- ClipboardEvent: [
1784
- initClipboardEvent
1785
- ],
1786
- Event: [],
1787
- InputEvent: [
1788
- initUIEvent,
1789
- initInputEvent
1790
- ],
1791
- MouseEvent: [
1792
- initUIEvent,
1793
- initUIEventModififiers,
1794
- initMouseEvent
1795
- ],
1796
- PointerEvent: [
1797
- initUIEvent,
1798
- initUIEventModififiers,
1799
- initMouseEvent,
1800
- initPointerEvent
1801
- ],
1802
- KeyboardEvent: [
1803
- initUIEvent,
1804
- initUIEventModififiers,
1805
- initKeyboardEvent
1806
- ]
1807
- };
1808
- function createEvent(type3, target, init) {
1809
- const window = getWindow(target);
1810
- const { EventType, defaultInit } = eventMap[type3];
1811
- const event = new (getEventConstructors(window))[EventType](type3, defaultInit);
1812
- eventInitializer[EventType].forEach((f) => f(event, init !== null && init !== void 0 ? init : {}));
1813
- return event;
1814
- }
1815
- function getEventConstructors(window) {
1816
- var _window_Event;
1817
- const Event = (_window_Event = window.Event) !== null && _window_Event !== void 0 ? _window_Event : class Event {
1818
- };
1819
- var _window_AnimationEvent;
1820
- const AnimationEvent = (_window_AnimationEvent = window.AnimationEvent) !== null && _window_AnimationEvent !== void 0 ? _window_AnimationEvent : class AnimationEvent extends Event {
1821
- };
1822
- var _window_ClipboardEvent;
1823
- const ClipboardEvent = (_window_ClipboardEvent = window.ClipboardEvent) !== null && _window_ClipboardEvent !== void 0 ? _window_ClipboardEvent : class ClipboardEvent extends Event {
1824
- };
1825
- var _window_PopStateEvent;
1826
- const PopStateEvent = (_window_PopStateEvent = window.PopStateEvent) !== null && _window_PopStateEvent !== void 0 ? _window_PopStateEvent : class PopStateEvent extends Event {
1827
- };
1828
- var _window_ProgressEvent;
1829
- const ProgressEvent = (_window_ProgressEvent = window.ProgressEvent) !== null && _window_ProgressEvent !== void 0 ? _window_ProgressEvent : class ProgressEvent extends Event {
1830
- };
1831
- var _window_TransitionEvent;
1832
- const TransitionEvent = (_window_TransitionEvent = window.TransitionEvent) !== null && _window_TransitionEvent !== void 0 ? _window_TransitionEvent : class TransitionEvent extends Event {
1833
- };
1834
- var _window_UIEvent;
1835
- const UIEvent = (_window_UIEvent = window.UIEvent) !== null && _window_UIEvent !== void 0 ? _window_UIEvent : class UIEvent extends Event {
1836
- };
1837
- var _window_CompositionEvent;
1838
- const CompositionEvent = (_window_CompositionEvent = window.CompositionEvent) !== null && _window_CompositionEvent !== void 0 ? _window_CompositionEvent : class CompositionEvent extends UIEvent {
1839
- };
1840
- var _window_FocusEvent;
1841
- const FocusEvent = (_window_FocusEvent = window.FocusEvent) !== null && _window_FocusEvent !== void 0 ? _window_FocusEvent : class FocusEvent extends UIEvent {
1842
- };
1843
- var _window_InputEvent;
1844
- const InputEvent = (_window_InputEvent = window.InputEvent) !== null && _window_InputEvent !== void 0 ? _window_InputEvent : class InputEvent extends UIEvent {
1845
- };
1846
- var _window_KeyboardEvent;
1847
- const KeyboardEvent = (_window_KeyboardEvent = window.KeyboardEvent) !== null && _window_KeyboardEvent !== void 0 ? _window_KeyboardEvent : class KeyboardEvent extends UIEvent {
1848
- };
1849
- var _window_MouseEvent;
1850
- const MouseEvent = (_window_MouseEvent = window.MouseEvent) !== null && _window_MouseEvent !== void 0 ? _window_MouseEvent : class MouseEvent extends UIEvent {
1851
- };
1852
- var _window_DragEvent;
1853
- const DragEvent = (_window_DragEvent = window.DragEvent) !== null && _window_DragEvent !== void 0 ? _window_DragEvent : class DragEvent extends MouseEvent {
1854
- };
1855
- var _window_PointerEvent;
1856
- const PointerEvent = (_window_PointerEvent = window.PointerEvent) !== null && _window_PointerEvent !== void 0 ? _window_PointerEvent : class PointerEvent extends MouseEvent {
1857
- };
1858
- var _window_TouchEvent;
1859
- const TouchEvent = (_window_TouchEvent = window.TouchEvent) !== null && _window_TouchEvent !== void 0 ? _window_TouchEvent : class TouchEvent extends UIEvent {
1860
- };
1861
- return {
1862
- Event,
1863
- AnimationEvent,
1864
- ClipboardEvent,
1865
- PopStateEvent,
1866
- ProgressEvent,
1867
- TransitionEvent,
1868
- UIEvent,
1869
- CompositionEvent,
1870
- FocusEvent,
1871
- InputEvent,
1872
- KeyboardEvent,
1873
- MouseEvent,
1874
- DragEvent,
1875
- PointerEvent,
1876
- TouchEvent
1877
- };
1878
- }
1879
- function assignProps(obj, props) {
1880
- for (const [key, value] of Object.entries(props)) {
1881
- Object.defineProperty(obj, key, {
1882
- get: () => value !== null && value !== void 0 ? value : null
1883
- });
1884
- }
1885
- }
1886
- function sanitizeNumber(n) {
1887
- return Number(n !== null && n !== void 0 ? n : 0);
1888
- }
1889
- function initClipboardEvent(event, { clipboardData }) {
1890
- assignProps(event, {
1891
- clipboardData
1892
- });
1893
- }
1894
- function initInputEvent(event, { data, inputType, isComposing }) {
1895
- assignProps(event, {
1896
- data,
1897
- isComposing: Boolean(isComposing),
1898
- inputType: String(inputType)
1899
- });
1900
- }
1901
- function initUIEvent(event, { view, detail }) {
1902
- assignProps(event, {
1903
- view,
1904
- detail: sanitizeNumber(detail !== null && detail !== void 0 ? detail : 0)
1905
- });
1906
- }
1907
- function initUIEventModififiers(event, { altKey, ctrlKey, metaKey, shiftKey, modifierAltGraph, modifierCapsLock, modifierFn, modifierFnLock, modifierNumLock, modifierScrollLock, modifierSymbol, modifierSymbolLock }) {
1908
- assignProps(event, {
1909
- altKey: Boolean(altKey),
1910
- ctrlKey: Boolean(ctrlKey),
1911
- metaKey: Boolean(metaKey),
1912
- shiftKey: Boolean(shiftKey),
1913
- getModifierState(k) {
1914
- return Boolean({
1915
- Alt: altKey,
1916
- AltGraph: modifierAltGraph,
1917
- CapsLock: modifierCapsLock,
1918
- Control: ctrlKey,
1919
- Fn: modifierFn,
1920
- FnLock: modifierFnLock,
1921
- Meta: metaKey,
1922
- NumLock: modifierNumLock,
1923
- ScrollLock: modifierScrollLock,
1924
- Shift: shiftKey,
1925
- Symbol: modifierSymbol,
1926
- SymbolLock: modifierSymbolLock
1927
- }[k]);
1928
- }
1929
- });
1930
- }
1931
- function initKeyboardEvent(event, { key, code, location, repeat, isComposing, charCode }) {
1932
- assignProps(event, {
1933
- key: String(key),
1934
- code: String(code),
1935
- location: sanitizeNumber(location),
1936
- repeat: Boolean(repeat),
1937
- isComposing: Boolean(isComposing),
1938
- charCode
1939
- });
1940
- }
1941
- function initMouseEvent(event, { x, y, screenX, screenY, clientX = x, clientY = y, button, buttons, relatedTarget }) {
1942
- assignProps(event, {
1943
- screenX: sanitizeNumber(screenX),
1944
- screenY: sanitizeNumber(screenY),
1945
- clientX: sanitizeNumber(clientX),
1946
- x: sanitizeNumber(clientX),
1947
- clientY: sanitizeNumber(clientY),
1948
- y: sanitizeNumber(clientY),
1949
- button: sanitizeNumber(button),
1950
- buttons: sanitizeNumber(buttons),
1951
- relatedTarget
1952
- });
1953
- }
1954
- function initPointerEvent(event, { pointerId, width, height, pressure, tangentialPressure, tiltX, tiltY, twist, pointerType, isPrimary }) {
1955
- assignProps(event, {
1956
- pointerId: sanitizeNumber(pointerId),
1957
- width: sanitizeNumber(width),
1958
- height: sanitizeNumber(height),
1959
- pressure: sanitizeNumber(pressure),
1960
- tangentialPressure: sanitizeNumber(tangentialPressure),
1961
- tiltX: sanitizeNumber(tiltX),
1962
- tiltY: sanitizeNumber(tiltY),
1963
- twist: sanitizeNumber(twist),
1964
- pointerType: String(pointerType),
1965
- isPrimary: Boolean(isPrimary)
1966
- });
1967
- }
1968
-
1969
- // ../../node_modules/@testing-library/user-event/dist/esm/event/dispatchEvent.js
1970
- function dispatchUIEvent(target, type3, init, preventDefault = false) {
1971
- if (isMouseEvent(type3) || isKeyboardEvent(type3)) {
1972
- init = {
1973
- ...init,
1974
- ...this.system.getUIEventModifiers()
1975
- };
1976
- }
1977
- const event = createEvent(type3, target, init);
1978
- return dispatchEvent.call(this, target, event, preventDefault);
1979
- }
1980
- function dispatchEvent(target, event, preventDefault = false) {
1981
- var _behavior_type;
1982
- const type3 = event.type;
1983
- const behaviorImplementation = preventDefault ? () => {
1984
- } : (_behavior_type = behavior[type3]) === null || _behavior_type === void 0 ? void 0 : _behavior_type.call(behavior, event, target, this);
1985
- if (behaviorImplementation) {
1986
- event.preventDefault();
1987
- let defaultPrevented = false;
1988
- Object.defineProperty(event, "defaultPrevented", {
1989
- get: () => defaultPrevented
1990
- });
1991
- Object.defineProperty(event, "preventDefault", {
1992
- value: () => {
1993
- defaultPrevented = event.cancelable;
1994
- }
1995
- });
1996
- wrapEvent(() => target.dispatchEvent(event));
1997
- if (!defaultPrevented) {
1998
- behaviorImplementation();
1999
- }
2000
- return !defaultPrevented;
2001
- }
2002
- return wrapEvent(() => target.dispatchEvent(event));
2003
- }
2004
- function dispatchDOMEvent(target, type3, init) {
2005
- const event = createEvent(type3, target, init);
2006
- wrapEvent(() => target.dispatchEvent(event));
2007
- }
2008
-
2009
- // ../../node_modules/@testing-library/user-event/dist/esm/document/interceptor.js
2010
- var Interceptor = Symbol("Interceptor for programmatical calls");
2011
- function prepareInterceptor(element, propName, interceptorImpl) {
2012
- const prototypeDescriptor = Object.getOwnPropertyDescriptor(element.constructor.prototype, propName);
2013
- const objectDescriptor = Object.getOwnPropertyDescriptor(element, propName);
2014
- const target = (prototypeDescriptor === null || prototypeDescriptor === void 0 ? void 0 : prototypeDescriptor.set) ? "set" : "value";
2015
- if (typeof (prototypeDescriptor === null || prototypeDescriptor === void 0 ? void 0 : prototypeDescriptor[target]) !== "function" || prototypeDescriptor[target][Interceptor]) {
2016
- throw new Error(`Element ${element.tagName} does not implement "${String(propName)}".`);
2017
- }
2018
- function intercept(...args) {
2019
- const { applyNative = false, realArgs, then } = interceptorImpl.call(this, ...args);
2020
- const realFunc = (!applyNative && objectDescriptor || prototypeDescriptor)[target];
2021
- if (target === "set") {
2022
- realFunc.call(this, realArgs);
2023
- } else {
2024
- realFunc.call(this, ...realArgs);
2025
- }
2026
- then === null || then === void 0 ? void 0 : then();
2027
- }
2028
- intercept[Interceptor] = Interceptor;
2029
- Object.defineProperty(element, propName, {
2030
- ...objectDescriptor !== null && objectDescriptor !== void 0 ? objectDescriptor : prototypeDescriptor,
2031
- [target]: intercept
2032
- });
2033
- }
2034
- function prepareValueInterceptor(element) {
2035
- prepareInterceptor(element, "value", function interceptorImpl(v) {
2036
- const isUI = isUIValue(v);
2037
- if (isUI) {
2038
- startTrackValue(this);
2039
- }
2040
- return {
2041
- applyNative: !!isUI,
2042
- realArgs: sanitizeValue(this, v),
2043
- then: isUI ? void 0 : () => trackOrSetValue(this, String(v))
2044
- };
2045
- });
2046
- }
2047
- function sanitizeValue(element, v) {
2048
- if (isElementType(element, "input", {
2049
- type: "number"
2050
- }) && String(v) !== "" && !Number.isNaN(Number(v))) {
2051
- return String(Number(v));
2052
- }
2053
- return String(v);
2054
- }
2055
- function prepareSelectionInterceptor(element) {
2056
- prepareInterceptor(element, "setSelectionRange", function interceptorImpl(start, ...others) {
2057
- const isUI = isUISelectionStart(start);
2058
- return {
2059
- applyNative: !!isUI,
2060
- realArgs: [
2061
- Number(start),
2062
- ...others
2063
- ],
2064
- then: () => isUI ? void 0 : setUISelectionClean(element)
2065
- };
2066
- });
2067
- prepareInterceptor(element, "selectionStart", function interceptorImpl(v) {
2068
- return {
2069
- realArgs: v,
2070
- then: () => setUISelectionClean(element)
2071
- };
2072
- });
2073
- prepareInterceptor(element, "selectionEnd", function interceptorImpl(v) {
2074
- return {
2075
- realArgs: v,
2076
- then: () => setUISelectionClean(element)
2077
- };
2078
- });
2079
- prepareInterceptor(element, "select", function interceptorImpl() {
2080
- return {
2081
- realArgs: [],
2082
- then: () => setUISelectionRaw(element, {
2083
- anchorOffset: 0,
2084
- focusOffset: getUIValue(element).length
2085
- })
2086
- };
2087
- });
2088
- }
2089
- function prepareRangeTextInterceptor(element) {
2090
- prepareInterceptor(element, "setRangeText", function interceptorImpl(...realArgs) {
2091
- return {
2092
- realArgs,
2093
- then: () => {
2094
- setUIValueClean(element);
2095
- setUISelectionClean(element);
2096
- }
2097
- };
2098
- });
2099
- }
2100
-
2101
- // ../../node_modules/@testing-library/user-event/dist/esm/document/prepareDocument.js
2102
- var isPrepared = Symbol("Node prepared with document state workarounds");
2103
- function prepareDocument(document) {
2104
- if (document[isPrepared]) {
2105
- return;
2106
- }
2107
- document.addEventListener("focus", (e) => {
2108
- const el = e.target;
2109
- prepareElement(el);
2110
- }, {
2111
- capture: true,
2112
- passive: true
2113
- });
2114
- if (document.activeElement) {
2115
- prepareElement(document.activeElement);
2116
- }
2117
- document.addEventListener("blur", (e) => {
2118
- const el = e.target;
2119
- const initialValue = getInitialValue(el);
2120
- if (initialValue !== void 0) {
2121
- if (el.value !== initialValue) {
2122
- dispatchDOMEvent(el, "change");
2123
- }
2124
- clearInitialValue(el);
2125
- }
2126
- }, {
2127
- capture: true,
2128
- passive: true
2129
- });
2130
- document[isPrepared] = isPrepared;
2131
- }
2132
- function prepareElement(el) {
2133
- if (el[isPrepared]) {
2134
- return;
2135
- }
2136
- if (isElementType(el, [
2137
- "input",
2138
- "textarea"
2139
- ])) {
2140
- prepareValueInterceptor(el);
2141
- prepareSelectionInterceptor(el);
2142
- prepareRangeTextInterceptor(el);
2143
- }
2144
- el[isPrepared] = isPrepared;
2145
- }
2146
-
2147
- // ../../node_modules/@testing-library/user-event/dist/esm/utils/misc/getDocumentFromNode.js
2148
- function getDocumentFromNode(el) {
2149
- return isDocument2(el) ? el : el.ownerDocument;
2150
- }
2151
- function isDocument2(node) {
2152
- return node.nodeType === 9;
2153
- }
2154
-
2155
- // ../../node_modules/@testing-library/user-event/dist/esm/utils/misc/wait.js
2156
- function wait(config) {
2157
- const delay = config.delay;
2158
- if (typeof delay !== "number") {
2159
- return;
2160
- }
2161
- return Promise.all([
2162
- new Promise((resolve) => globalThis.setTimeout(() => resolve(), delay)),
2163
- config.advanceTimers(delay)
2164
- ]);
2165
- }
2166
-
2167
- // ../../node_modules/@testing-library/user-event/dist/esm/system/keyboard.js
2168
- function _define_property3(obj, key, value) {
2169
- if (key in obj) {
2170
- Object.defineProperty(obj, key, {
2171
- value,
2172
- enumerable: true,
2173
- configurable: true,
2174
- writable: true
2175
- });
2176
- } else {
2177
- obj[key] = value;
2178
- }
2179
- return obj;
2180
- }
2181
- var DOM_KEY_LOCATION;
2182
- (function(DOM_KEY_LOCATION2) {
2183
- DOM_KEY_LOCATION2[DOM_KEY_LOCATION2["STANDARD"] = 0] = "STANDARD";
2184
- DOM_KEY_LOCATION2[DOM_KEY_LOCATION2["LEFT"] = 1] = "LEFT";
2185
- DOM_KEY_LOCATION2[DOM_KEY_LOCATION2["RIGHT"] = 2] = "RIGHT";
2186
- DOM_KEY_LOCATION2[DOM_KEY_LOCATION2["NUMPAD"] = 3] = "NUMPAD";
2187
- })(DOM_KEY_LOCATION || (DOM_KEY_LOCATION = {}));
2188
- var modifierKeys = [
2189
- "Alt",
2190
- "AltGraph",
2191
- "Control",
2192
- "Fn",
2193
- "Meta",
2194
- "Shift",
2195
- "Symbol"
2196
- ];
2197
- function isModifierKey(key) {
2198
- return modifierKeys.includes(key);
2199
- }
2200
- var modifierLocks = [
2201
- "CapsLock",
2202
- "FnLock",
2203
- "NumLock",
2204
- "ScrollLock",
2205
- "SymbolLock"
2206
- ];
2207
- function isModifierLock(key) {
2208
- return modifierLocks.includes(key);
2209
- }
2210
- var KeyboardHost = class {
2211
- isKeyPressed(keyDef) {
2212
- return !!this.pressed[String(keyDef.code)];
2213
- }
2214
- getPressedKeys() {
2215
- return Object.values(this.pressed).map((p) => p.keyDef);
2216
- }
2217
- /** Press a key */
2218
- async keydown(instance, keyDef) {
2219
- var _this_pressed, _code, _this_pressed_code;
2220
- const key = String(keyDef.key);
2221
- const code = String(keyDef.code);
2222
- const target = getActiveElementOrBody(instance.config.document);
2223
- this.setKeydownTarget(target);
2224
- var _;
2225
- (_ = (_this_pressed = this.pressed)[_code = code]) !== null && _ !== void 0 ? _ : _this_pressed[_code] = {
2226
- keyDef,
2227
- unpreventedDefault: false
2228
- };
2229
- if (isModifierKey(key)) {
2230
- this.modifiers[key] = true;
2231
- }
2232
- const unprevented = instance.dispatchUIEvent(target, "keydown", {
2233
- key,
2234
- code
2235
- });
2236
- if (isModifierLock(key) && !this.modifiers[key]) {
2237
- this.modifiers[key] = true;
2238
- this.modifierLockStart[key] = true;
2239
- }
2240
- (_this_pressed_code = this.pressed[code]).unpreventedDefault || (_this_pressed_code.unpreventedDefault = unprevented);
2241
- if (unprevented && this.hasKeyPress(key)) {
2242
- instance.dispatchUIEvent(getActiveElementOrBody(instance.config.document), "keypress", {
2243
- key,
2244
- code,
2245
- charCode: keyDef.key === "Enter" ? 13 : String(keyDef.key).charCodeAt(0)
2246
- });
2247
- }
2248
- }
2249
- /** Release a key */
2250
- async keyup(instance, keyDef) {
2251
- const key = String(keyDef.key);
2252
- const code = String(keyDef.code);
2253
- const unprevented = this.pressed[code].unpreventedDefault;
2254
- delete this.pressed[code];
2255
- if (isModifierKey(key) && !Object.values(this.pressed).find((p) => p.keyDef.key === key)) {
2256
- this.modifiers[key] = false;
2257
- }
2258
- instance.dispatchUIEvent(getActiveElementOrBody(instance.config.document), "keyup", {
2259
- key,
2260
- code
2261
- }, !unprevented);
2262
- if (isModifierLock(key) && this.modifiers[key]) {
2263
- if (this.modifierLockStart[key]) {
2264
- this.modifierLockStart[key] = false;
2265
- } else {
2266
- this.modifiers[key] = false;
2267
- }
2268
- }
2269
- }
2270
- setKeydownTarget(target) {
2271
- if (target !== this.lastKeydownTarget) {
2272
- this.carryChar = "";
2273
- }
2274
- this.lastKeydownTarget = target;
2275
- }
2276
- hasKeyPress(key) {
2277
- return (key.length === 1 || key === "Enter") && !this.modifiers.Control && !this.modifiers.Alt;
2278
- }
2279
- constructor(system) {
2280
- _define_property3(this, "system", void 0);
2281
- _define_property3(this, "modifiers", {
2282
- Alt: false,
2283
- AltGraph: false,
2284
- CapsLock: false,
2285
- Control: false,
2286
- Fn: false,
2287
- FnLock: false,
2288
- Meta: false,
2289
- NumLock: false,
2290
- ScrollLock: false,
2291
- Shift: false,
2292
- Symbol: false,
2293
- SymbolLock: false
2294
- });
2295
- _define_property3(this, "pressed", {});
2296
- _define_property3(this, "carryChar", "");
2297
- _define_property3(this, "lastKeydownTarget", void 0);
2298
- _define_property3(this, "modifierLockStart", {});
2299
- this.system = system;
2300
- }
2301
- };
2302
-
2303
- // ../../node_modules/@testing-library/user-event/dist/esm/keyboard/keyMap.js
2304
- var defaultKeyMap = [
2305
- // alphanumeric keys
2306
- ..."0123456789".split("").map((c) => ({
2307
- code: `Digit${c}`,
2308
- key: c
2309
- })),
2310
- ...")!@#$%^&*(".split("").map((c, i) => ({
2311
- code: `Digit${i}`,
2312
- key: c,
2313
- shiftKey: true
2314
- })),
2315
- ..."abcdefghijklmnopqrstuvwxyz".split("").map((c) => ({
2316
- code: `Key${c.toUpperCase()}`,
2317
- key: c
2318
- })),
2319
- ..."ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("").map((c) => ({
2320
- code: `Key${c}`,
2321
- key: c,
2322
- shiftKey: true
2323
- })),
2324
- // alphanumeric block - functional
2325
- {
2326
- code: "Space",
2327
- key: " "
2328
- },
2329
- {
2330
- code: "AltLeft",
2331
- key: "Alt",
2332
- location: DOM_KEY_LOCATION.LEFT
2333
- },
2334
- {
2335
- code: "AltRight",
2336
- key: "Alt",
2337
- location: DOM_KEY_LOCATION.RIGHT
2338
- },
2339
- {
2340
- code: "ShiftLeft",
2341
- key: "Shift",
2342
- location: DOM_KEY_LOCATION.LEFT
2343
- },
2344
- {
2345
- code: "ShiftRight",
2346
- key: "Shift",
2347
- location: DOM_KEY_LOCATION.RIGHT
2348
- },
2349
- {
2350
- code: "ControlLeft",
2351
- key: "Control",
2352
- location: DOM_KEY_LOCATION.LEFT
2353
- },
2354
- {
2355
- code: "ControlRight",
2356
- key: "Control",
2357
- location: DOM_KEY_LOCATION.RIGHT
2358
- },
2359
- {
2360
- code: "MetaLeft",
2361
- key: "Meta",
2362
- location: DOM_KEY_LOCATION.LEFT
2363
- },
2364
- {
2365
- code: "MetaRight",
2366
- key: "Meta",
2367
- location: DOM_KEY_LOCATION.RIGHT
2368
- },
2369
- {
2370
- code: "OSLeft",
2371
- key: "OS",
2372
- location: DOM_KEY_LOCATION.LEFT
2373
- },
2374
- {
2375
- code: "OSRight",
2376
- key: "OS",
2377
- location: DOM_KEY_LOCATION.RIGHT
2378
- },
2379
- {
2380
- code: "Tab",
2381
- key: "Tab"
2382
- },
2383
- {
2384
- code: "CapsLock",
2385
- key: "CapsLock"
2386
- },
2387
- {
2388
- code: "Backspace",
2389
- key: "Backspace"
2390
- },
2391
- {
2392
- code: "Enter",
2393
- key: "Enter"
2394
- },
2395
- // function
2396
- {
2397
- code: "Escape",
2398
- key: "Escape"
2399
- },
2400
- // arrows
2401
- {
2402
- code: "ArrowUp",
2403
- key: "ArrowUp"
2404
- },
2405
- {
2406
- code: "ArrowDown",
2407
- key: "ArrowDown"
2408
- },
2409
- {
2410
- code: "ArrowLeft",
2411
- key: "ArrowLeft"
2412
- },
2413
- {
2414
- code: "ArrowRight",
2415
- key: "ArrowRight"
2416
- },
2417
- // control pad
2418
- {
2419
- code: "Home",
2420
- key: "Home"
2421
- },
2422
- {
2423
- code: "End",
2424
- key: "End"
2425
- },
2426
- {
2427
- code: "Delete",
2428
- key: "Delete"
2429
- },
2430
- {
2431
- code: "PageUp",
2432
- key: "PageUp"
2433
- },
2434
- {
2435
- code: "PageDown",
2436
- key: "PageDown"
2437
- },
2438
- // Special keys that are not part of a default US-layout but included for specific behavior
2439
- {
2440
- code: "Fn",
2441
- key: "Fn"
2442
- },
2443
- {
2444
- code: "Symbol",
2445
- key: "Symbol"
2446
- },
2447
- {
2448
- code: "AltRight",
2449
- key: "AltGraph"
2450
- }
2451
- ];
2452
-
2453
- // ../../node_modules/@testing-library/user-event/dist/esm/pointer/keyMap.js
2454
- var defaultKeyMap2 = [
2455
- {
2456
- name: "MouseLeft",
2457
- pointerType: "mouse",
2458
- button: "primary"
2459
- },
2460
- {
2461
- name: "MouseRight",
2462
- pointerType: "mouse",
2463
- button: "secondary"
2464
- },
2465
- {
2466
- name: "MouseMiddle",
2467
- pointerType: "mouse",
2468
- button: "auxiliary"
2469
- },
2470
- {
2471
- name: "TouchA",
2472
- pointerType: "touch"
2473
- },
2474
- {
2475
- name: "TouchB",
2476
- pointerType: "touch"
2477
- },
2478
- {
2479
- name: "TouchC",
2480
- pointerType: "touch"
2481
- }
2482
- ];
2483
-
2484
- // ../../node_modules/@testing-library/user-event/dist/esm/system/pointer/buttons.js
2485
- function _define_property4(obj, key, value) {
2486
- if (key in obj) {
2487
- Object.defineProperty(obj, key, {
2488
- value,
2489
- enumerable: true,
2490
- configurable: true,
2491
- writable: true
2492
- });
2493
- } else {
2494
- obj[key] = value;
2495
- }
2496
- return obj;
2497
- }
2498
- var Buttons = class {
2499
- getButtons() {
2500
- let v = 0;
2501
- for (const button of Object.keys(this.pressed)) {
2502
- v |= 2 ** Number(button);
2503
- }
2504
- return v;
2505
- }
2506
- down(keyDef) {
2507
- const button = getMouseButtonId(keyDef.button);
2508
- if (button in this.pressed) {
2509
- this.pressed[button].push(keyDef);
2510
- return void 0;
2511
- }
2512
- this.pressed[button] = [
2513
- keyDef
2514
- ];
2515
- return button;
2516
- }
2517
- up(keyDef) {
2518
- const button = getMouseButtonId(keyDef.button);
2519
- if (button in this.pressed) {
2520
- this.pressed[button] = this.pressed[button].filter((k) => k.name !== keyDef.name);
2521
- if (this.pressed[button].length === 0) {
2522
- delete this.pressed[button];
2523
- return button;
2524
- }
2525
- }
2526
- return void 0;
2527
- }
2528
- constructor() {
2529
- _define_property4(this, "pressed", {});
2530
- }
2531
- };
2532
- var MouseButton = {
2533
- primary: 0,
2534
- secondary: 1,
2535
- auxiliary: 2,
2536
- back: 3,
2537
- X1: 3,
2538
- forward: 4,
2539
- X2: 4
2540
- };
2541
- function getMouseButtonId(button = 0) {
2542
- if (button in MouseButton) {
2543
- return MouseButton[button];
2544
- }
2545
- return Number(button);
2546
- }
2547
- var MouseButtonFlip = {
2548
- 1: 2,
2549
- 2: 1
2550
- };
2551
- function getMouseEventButton(button) {
2552
- button = getMouseButtonId(button);
2553
- if (button in MouseButtonFlip) {
2554
- return MouseButtonFlip[button];
2555
- }
2556
- return button;
2557
- }
2558
-
2559
- // ../../node_modules/@testing-library/user-event/dist/esm/system/pointer/device.js
2560
- function _define_property5(obj, key, value) {
2561
- if (key in obj) {
2562
- Object.defineProperty(obj, key, {
2563
- value,
2564
- enumerable: true,
2565
- configurable: true,
2566
- writable: true
2567
- });
2568
- } else {
2569
- obj[key] = value;
2570
- }
2571
- return obj;
2572
- }
2573
- var Device = class {
2574
- get countPressed() {
2575
- return this.pressedKeys.size;
2576
- }
2577
- isPressed(keyDef) {
2578
- return this.pressedKeys.has(keyDef.name);
2579
- }
2580
- addPressed(keyDef) {
2581
- return this.pressedKeys.add(keyDef.name);
2582
- }
2583
- removePressed(keyDef) {
2584
- return this.pressedKeys.delete(keyDef.name);
2585
- }
2586
- constructor() {
2587
- _define_property5(this, "pressedKeys", /* @__PURE__ */ new Set());
2588
- }
2589
- };
2590
-
2591
- // ../../node_modules/@testing-library/user-event/dist/esm/utils/misc/getTreeDiff.js
2592
- function getTreeDiff(a, b) {
2593
- const treeA = [];
2594
- for (let el = a; el; el = el.parentElement) {
2595
- treeA.push(el);
2596
- }
2597
- const treeB = [];
2598
- for (let el = b; el; el = el.parentElement) {
2599
- treeB.push(el);
2600
- }
2601
- let i = 0;
2602
- for (; ; i++) {
2603
- if (i >= treeA.length || i >= treeB.length || treeA[treeA.length - 1 - i] !== treeB[treeB.length - 1 - i]) {
2604
- break;
2605
- }
2606
- }
2607
- return [
2608
- treeA.slice(0, treeA.length - i),
2609
- treeB.slice(0, treeB.length - i),
2610
- treeB.slice(treeB.length - i)
2611
- ];
2612
- }
2613
-
2614
- // ../../node_modules/@testing-library/user-event/dist/esm/event/selection/resolveCaretPosition.js
2615
- function resolveCaretPosition({ target, node, offset }) {
2616
- if (hasOwnSelection(target)) {
2617
- return {
2618
- node: target,
2619
- offset: offset !== null && offset !== void 0 ? offset : getUIValue(target).length
2620
- };
2621
- } else if (node) {
2622
- return {
2623
- node,
2624
- offset: offset !== null && offset !== void 0 ? offset : node.nodeType === 3 ? node.nodeValue.length : node.childNodes.length
2625
- };
2626
- }
2627
- return findNodeAtTextOffset(target, offset);
2628
- }
2629
- function findNodeAtTextOffset(node, offset, isRoot = true) {
2630
- let i = offset === void 0 ? node.childNodes.length - 1 : 0;
2631
- const step = offset === void 0 ? -1 : 1;
2632
- while (offset === void 0 ? i >= (isRoot ? Math.max(node.childNodes.length - 1, 0) : 0) : i <= node.childNodes.length) {
2633
- if (offset && i === node.childNodes.length) {
2634
- throw new Error("The given offset is out of bounds.");
2635
- }
2636
- const c = node.childNodes.item(i);
2637
- const text = String(c.textContent);
2638
- if (text.length) {
2639
- if (offset !== void 0 && text.length < offset) {
2640
- offset -= text.length;
2641
- } else if (c.nodeType === 1) {
2642
- return findNodeAtTextOffset(c, offset, false);
2643
- } else {
2644
- if (c.nodeType === 3) {
2645
- return {
2646
- node: c,
2647
- offset: offset !== null && offset !== void 0 ? offset : c.nodeValue.length
2648
- };
2649
- }
2650
- }
2651
- }
2652
- i += step;
2653
- }
2654
- return {
2655
- node,
2656
- offset: node.childNodes.length
2657
- };
2658
- }
2659
-
2660
- // ../../node_modules/@testing-library/user-event/dist/esm/event/selection/setSelectionPerMouse.js
2661
- function setSelectionPerMouseDown({ document, target, clickCount, node, offset }) {
2662
- if (hasNoSelection(target)) {
2663
- return;
2664
- }
2665
- const targetHasOwnSelection = hasOwnSelection(target);
2666
- const text = String(targetHasOwnSelection ? getUIValue(target) : target.textContent);
2667
- const [start, end] = node ? (
2668
- // which elements might be considered in the same line of text.
2669
- // TODO: support expanding initial range on multiple clicks if node is given
2670
- [
2671
- offset,
2672
- offset
2673
- ]
2674
- ) : getTextRange(text, offset, clickCount);
2675
- if (targetHasOwnSelection) {
2676
- setUISelection(target, {
2677
- anchorOffset: start !== null && start !== void 0 ? start : text.length,
2678
- focusOffset: end !== null && end !== void 0 ? end : text.length
2679
- });
2680
- return {
2681
- node: target,
2682
- start: start !== null && start !== void 0 ? start : 0,
2683
- end: end !== null && end !== void 0 ? end : text.length
2684
- };
2685
- } else {
2686
- const { node: startNode, offset: startOffset } = resolveCaretPosition({
2687
- target,
2688
- node,
2689
- offset: start
2690
- });
2691
- const { node: endNode, offset: endOffset } = resolveCaretPosition({
2692
- target,
2693
- node,
2694
- offset: end
2695
- });
2696
- const range = target.ownerDocument.createRange();
2697
- try {
2698
- range.setStart(startNode, startOffset);
2699
- range.setEnd(endNode, endOffset);
2700
- } catch (e) {
2701
- throw new Error("The given offset is out of bounds.");
2702
- }
2703
- const selection = document.getSelection();
2704
- selection === null || selection === void 0 ? void 0 : selection.removeAllRanges();
2705
- selection === null || selection === void 0 ? void 0 : selection.addRange(range.cloneRange());
2706
- return range;
2707
- }
2708
- }
2709
- function getTextRange(text, pos, clickCount) {
2710
- if (clickCount % 3 === 1 || text.length === 0) {
2711
- return [
2712
- pos,
2713
- pos
2714
- ];
2715
- }
2716
- const textPos = pos !== null && pos !== void 0 ? pos : text.length;
2717
- if (clickCount % 3 === 2) {
2718
- return [
2719
- textPos - text.substr(0, pos).match(/(\w+|\s+|\W)?$/)[0].length,
2720
- pos === void 0 ? pos : pos + text.substr(pos).match(/^(\w+|\s+|\W)?/)[0].length
2721
- ];
2722
- }
2723
- return [
2724
- textPos - text.substr(0, pos).match(/[^\r\n]*$/)[0].length,
2725
- pos === void 0 ? pos : pos + text.substr(pos).match(/^[^\r\n]*/)[0].length
2726
- ];
2727
- }
2728
-
2729
- // ../../node_modules/@testing-library/user-event/dist/esm/event/selection/modifySelectionPerMouse.js
2730
- function modifySelectionPerMouseMove(selectionRange, { document, target, node, offset }) {
2731
- const selectionFocus = resolveCaretPosition({
2732
- target,
2733
- node,
2734
- offset
2735
- });
2736
- if ("node" in selectionRange) {
2737
- if (selectionFocus.node === selectionRange.node) {
2738
- const anchorOffset = selectionFocus.offset < selectionRange.start ? selectionRange.end : selectionRange.start;
2739
- const focusOffset = selectionFocus.offset > selectionRange.end || selectionFocus.offset < selectionRange.start ? selectionFocus.offset : selectionRange.end;
2740
- setUISelection(selectionRange.node, {
2741
- anchorOffset,
2742
- focusOffset
2743
- });
2744
- }
2745
- } else {
2746
- const range = selectionRange.cloneRange();
2747
- const cmp = range.comparePoint(selectionFocus.node, selectionFocus.offset);
2748
- if (cmp < 0) {
2749
- range.setStart(selectionFocus.node, selectionFocus.offset);
2750
- } else if (cmp > 0) {
2751
- range.setEnd(selectionFocus.node, selectionFocus.offset);
2752
- }
2753
- const selection = document.getSelection();
2754
- selection === null || selection === void 0 ? void 0 : selection.removeAllRanges();
2755
- selection === null || selection === void 0 ? void 0 : selection.addRange(range.cloneRange());
2756
- }
2757
- }
2758
-
2759
- // ../../node_modules/@testing-library/user-event/dist/esm/system/pointer/shared.js
2760
- function isDifferentPointerPosition(positionA, positionB) {
2761
- var _positionA_coords, _positionB_coords, _positionA_coords1, _positionB_coords1, _positionA_caret, _positionB_caret, _positionA_caret1, _positionB_caret1;
2762
- return positionA.target !== positionB.target || ((_positionA_coords = positionA.coords) === null || _positionA_coords === void 0 ? void 0 : _positionA_coords.x) !== ((_positionB_coords = positionB.coords) === null || _positionB_coords === void 0 ? void 0 : _positionB_coords.y) || ((_positionA_coords1 = positionA.coords) === null || _positionA_coords1 === void 0 ? void 0 : _positionA_coords1.y) !== ((_positionB_coords1 = positionB.coords) === null || _positionB_coords1 === void 0 ? void 0 : _positionB_coords1.y) || ((_positionA_caret = positionA.caret) === null || _positionA_caret === void 0 ? void 0 : _positionA_caret.node) !== ((_positionB_caret = positionB.caret) === null || _positionB_caret === void 0 ? void 0 : _positionB_caret.node) || ((_positionA_caret1 = positionA.caret) === null || _positionA_caret1 === void 0 ? void 0 : _positionA_caret1.offset) !== ((_positionB_caret1 = positionB.caret) === null || _positionB_caret1 === void 0 ? void 0 : _positionB_caret1.offset);
2763
- }
2764
-
2765
- // ../../node_modules/@testing-library/user-event/dist/esm/system/pointer/mouse.js
2766
- function _define_property6(obj, key, value) {
2767
- if (key in obj) {
2768
- Object.defineProperty(obj, key, {
2769
- value,
2770
- enumerable: true,
2771
- configurable: true,
2772
- writable: true
2773
- });
2774
- } else {
2775
- obj[key] = value;
2776
- }
2777
- return obj;
2778
- }
2779
- var Mouse = class {
2780
- move(instance, position) {
2781
- const prevPosition = this.position;
2782
- const prevTarget = this.getTarget(instance);
2783
- this.position = position;
2784
- if (!isDifferentPointerPosition(prevPosition, position)) {
2785
- return;
2786
- }
2787
- const nextTarget = this.getTarget(instance);
2788
- const init = this.getEventInit("mousemove");
2789
- const [leave, enter] = getTreeDiff(prevTarget, nextTarget);
2790
- return {
2791
- leave: () => {
2792
- if (prevTarget !== nextTarget) {
2793
- instance.dispatchUIEvent(prevTarget, "mouseout", init);
2794
- leave.forEach((el) => instance.dispatchUIEvent(el, "mouseleave", init));
2795
- }
2796
- },
2797
- enter: () => {
2798
- if (prevTarget !== nextTarget) {
2799
- instance.dispatchUIEvent(nextTarget, "mouseover", init);
2800
- enter.forEach((el) => instance.dispatchUIEvent(el, "mouseenter", init));
2801
- }
2802
- },
2803
- move: () => {
2804
- instance.dispatchUIEvent(nextTarget, "mousemove", init);
2805
- this.modifySelecting(instance);
2806
- }
2807
- };
2808
- }
2809
- down(instance, keyDef, pointer3) {
2810
- const button = this.buttons.down(keyDef);
2811
- if (button === void 0) {
2812
- return;
2813
- }
2814
- const target = this.getTarget(instance);
2815
- this.buttonDownTarget[button] = target;
2816
- const disabled = isDisabled(target);
2817
- const init = this.getEventInit("mousedown", keyDef.button);
2818
- if (disabled || instance.dispatchUIEvent(target, "mousedown", init)) {
2819
- this.startSelecting(instance, init.detail);
2820
- focusElement(target);
2821
- }
2822
- if (!disabled && getMouseEventButton(keyDef.button) === 2) {
2823
- instance.dispatchUIEvent(target, "contextmenu", this.getEventInit("contextmenu", keyDef.button, pointer3));
2824
- }
2825
- }
2826
- up(instance, keyDef, pointer3) {
2827
- const button = this.buttons.up(keyDef);
2828
- if (button === void 0) {
2829
- return;
2830
- }
2831
- const target = this.getTarget(instance);
2832
- if (!isDisabled(target)) {
2833
- instance.dispatchUIEvent(target, "mouseup", this.getEventInit("mouseup", keyDef.button));
2834
- this.endSelecting();
2835
- const clickTarget = getTreeDiff(this.buttonDownTarget[button], target)[2][0];
2836
- if (clickTarget) {
2837
- const init = this.getEventInit("click", keyDef.button, pointer3);
2838
- if (init.detail) {
2839
- instance.dispatchUIEvent(clickTarget, init.button === 0 ? "click" : "auxclick", init);
2840
- if (init.button === 0 && init.detail === 2) {
2841
- instance.dispatchUIEvent(clickTarget, "dblclick", {
2842
- ...this.getEventInit("dblclick", keyDef.button),
2843
- detail: init.detail
2844
- });
2845
- }
2846
- }
2847
- }
2848
- }
2849
- }
2850
- resetClickCount() {
2851
- this.clickCount.reset();
2852
- }
2853
- getEventInit(type3, button, pointer3) {
2854
- const init = {
2855
- ...this.position.coords
2856
- };
2857
- if (pointer3) {
2858
- init.pointerId = pointer3.pointerId;
2859
- init.pointerType = pointer3.pointerType;
2860
- init.isPrimary = pointer3.isPrimary;
2861
- }
2862
- init.button = getMouseEventButton(button);
2863
- init.buttons = this.buttons.getButtons();
2864
- if (type3 === "mousedown") {
2865
- init.detail = this.clickCount.getOnDown(init.button);
2866
- } else if (type3 === "mouseup") {
2867
- init.detail = this.clickCount.getOnUp(init.button);
2868
- } else if (type3 === "click" || type3 === "auxclick") {
2869
- init.detail = this.clickCount.incOnClick(init.button);
2870
- }
2871
- return init;
2872
- }
2873
- getTarget(instance) {
2874
- var _this_position_target;
2875
- return (_this_position_target = this.position.target) !== null && _this_position_target !== void 0 ? _this_position_target : instance.config.document.body;
2876
- }
2877
- startSelecting(instance, clickCount) {
2878
- var _this_position_caret, _this_position_caret1;
2879
- this.selecting = setSelectionPerMouseDown({
2880
- document: instance.config.document,
2881
- target: this.getTarget(instance),
2882
- node: (_this_position_caret = this.position.caret) === null || _this_position_caret === void 0 ? void 0 : _this_position_caret.node,
2883
- offset: (_this_position_caret1 = this.position.caret) === null || _this_position_caret1 === void 0 ? void 0 : _this_position_caret1.offset,
2884
- clickCount
2885
- });
2886
- }
2887
- modifySelecting(instance) {
2888
- var _this_position_caret, _this_position_caret1;
2889
- if (!this.selecting) {
2890
- return;
2891
- }
2892
- modifySelectionPerMouseMove(this.selecting, {
2893
- document: instance.config.document,
2894
- target: this.getTarget(instance),
2895
- node: (_this_position_caret = this.position.caret) === null || _this_position_caret === void 0 ? void 0 : _this_position_caret.node,
2896
- offset: (_this_position_caret1 = this.position.caret) === null || _this_position_caret1 === void 0 ? void 0 : _this_position_caret1.offset
2897
- });
2898
- }
2899
- endSelecting() {
2900
- this.selecting = void 0;
2901
- }
2902
- constructor() {
2903
- _define_property6(this, "position", {});
2904
- _define_property6(this, "buttons", new Buttons());
2905
- _define_property6(this, "selecting", void 0);
2906
- _define_property6(this, "buttonDownTarget", {});
2907
- _define_property6(this, "clickCount", new class {
2908
- incOnClick(button) {
2909
- const current = this.down[button] === void 0 ? void 0 : Number(this.down[button]) + 1;
2910
- this.count = this.count[button] === void 0 ? {} : {
2911
- [button]: Number(this.count[button]) + 1
2912
- };
2913
- return current;
2914
- }
2915
- getOnDown(button) {
2916
- var _this_count_button;
2917
- this.down = {
2918
- [button]: (_this_count_button = this.count[button]) !== null && _this_count_button !== void 0 ? _this_count_button : 0
2919
- };
2920
- var _this_count_button1;
2921
- this.count = {
2922
- [button]: (_this_count_button1 = this.count[button]) !== null && _this_count_button1 !== void 0 ? _this_count_button1 : 0
2923
- };
2924
- return Number(this.count[button]) + 1;
2925
- }
2926
- getOnUp(button) {
2927
- return this.down[button] === void 0 ? void 0 : Number(this.down[button]) + 1;
2928
- }
2929
- reset() {
2930
- this.count = {};
2931
- }
2932
- constructor() {
2933
- _define_property6(this, "down", {});
2934
- _define_property6(this, "count", {});
2935
- }
2936
- }());
2937
- }
2938
- };
2939
-
2940
- // ../../node_modules/@testing-library/user-event/dist/esm/utils/pointer/cssPointerEvents.js
2941
- function hasPointerEvents(instance, element) {
2942
- var _checkPointerEvents;
2943
- return ((_checkPointerEvents = checkPointerEvents(instance, element)) === null || _checkPointerEvents === void 0 ? void 0 : _checkPointerEvents.pointerEvents) !== "none";
2944
- }
2945
- function closestPointerEventsDeclaration(element) {
2946
- const window = getWindow(element);
2947
- for (let el = element, tree = []; el === null || el === void 0 ? void 0 : el.ownerDocument; el = el.parentElement) {
2948
- tree.push(el);
2949
- const pointerEvents = window.getComputedStyle(el).pointerEvents;
2950
- if (pointerEvents && ![
2951
- "inherit",
2952
- "unset"
2953
- ].includes(pointerEvents)) {
2954
- return {
2955
- pointerEvents,
2956
- tree
2957
- };
2958
- }
2959
- }
2960
- return void 0;
2961
- }
2962
- var PointerEventsCheck = Symbol("Last check for pointer-events");
2963
- function checkPointerEvents(instance, element) {
2964
- const lastCheck = element[PointerEventsCheck];
2965
- const needsCheck = instance.config.pointerEventsCheck !== PointerEventsCheckLevel.Never && (!lastCheck || hasBitFlag(instance.config.pointerEventsCheck, PointerEventsCheckLevel.EachApiCall) && lastCheck[ApiLevel.Call] !== getLevelRef(instance, ApiLevel.Call) || hasBitFlag(instance.config.pointerEventsCheck, PointerEventsCheckLevel.EachTrigger) && lastCheck[ApiLevel.Trigger] !== getLevelRef(instance, ApiLevel.Trigger));
2966
- if (!needsCheck) {
2967
- return lastCheck === null || lastCheck === void 0 ? void 0 : lastCheck.result;
2968
- }
2969
- const declaration = closestPointerEventsDeclaration(element);
2970
- element[PointerEventsCheck] = {
2971
- [ApiLevel.Call]: getLevelRef(instance, ApiLevel.Call),
2972
- [ApiLevel.Trigger]: getLevelRef(instance, ApiLevel.Trigger),
2973
- result: declaration
2974
- };
2975
- return declaration;
2976
- }
2977
- function assertPointerEvents(instance, element) {
2978
- const declaration = checkPointerEvents(instance, element);
2979
- if ((declaration === null || declaration === void 0 ? void 0 : declaration.pointerEvents) === "none") {
2980
- throw new Error([
2981
- `Unable to perform pointer interaction as the element ${declaration.tree.length > 1 ? "inherits" : "has"} \`pointer-events: none\`:`,
2982
- "",
2983
- printTree(declaration.tree)
2984
- ].join("\n"));
2985
- }
2986
- }
2987
- function printTree(tree) {
2988
- return tree.reverse().map((el, i) => [
2989
- "".padEnd(i),
2990
- el.tagName,
2991
- el.id && `#${el.id}`,
2992
- el.hasAttribute("data-testid") && `(testId=${el.getAttribute("data-testid")})`,
2993
- getLabelDescr(el),
2994
- tree.length > 1 && i === 0 && " <-- This element declared `pointer-events: none`",
2995
- tree.length > 1 && i === tree.length - 1 && " <-- Asserted pointer events here"
2996
- ].filter(Boolean).join("")).join("\n");
2997
- }
2998
- function getLabelDescr(element) {
2999
- var _element_labels;
3000
- let label;
3001
- if (element.hasAttribute("aria-label")) {
3002
- label = element.getAttribute("aria-label");
3003
- } else if (element.hasAttribute("aria-labelledby")) {
3004
- var _element_ownerDocument_getElementById_textContent, _element_ownerDocument_getElementById;
3005
- label = (_element_ownerDocument_getElementById = element.ownerDocument.getElementById(element.getAttribute("aria-labelledby"))) === null || _element_ownerDocument_getElementById === void 0 ? void 0 : (_element_ownerDocument_getElementById_textContent = _element_ownerDocument_getElementById.textContent) === null || _element_ownerDocument_getElementById_textContent === void 0 ? void 0 : _element_ownerDocument_getElementById_textContent.trim();
3006
- } else if (isElementType(element, [
3007
- "button",
3008
- "input",
3009
- "meter",
3010
- "output",
3011
- "progress",
3012
- "select",
3013
- "textarea"
3014
- ]) && ((_element_labels = element.labels) === null || _element_labels === void 0 ? void 0 : _element_labels.length)) {
3015
- label = Array.from(element.labels).map((el) => {
3016
- var _el_textContent;
3017
- return (_el_textContent = el.textContent) === null || _el_textContent === void 0 ? void 0 : _el_textContent.trim();
3018
- }).join("|");
3019
- } else if (isElementType(element, "button")) {
3020
- var _element_textContent;
3021
- label = (_element_textContent = element.textContent) === null || _element_textContent === void 0 ? void 0 : _element_textContent.trim();
3022
- }
3023
- label = label === null || label === void 0 ? void 0 : label.replace(/\n/g, " ");
3024
- if (Number(label === null || label === void 0 ? void 0 : label.length) > 30) {
3025
- label = `${label === null || label === void 0 ? void 0 : label.substring(0, 29)}\u2026`;
3026
- }
3027
- return label ? `(label=${label})` : "";
3028
- }
3029
- function hasBitFlag(conf, flag) {
3030
- return (conf & flag) > 0;
3031
- }
3032
-
3033
- // ../../node_modules/@testing-library/user-event/dist/esm/system/pointer/pointer.js
3034
- function _define_property7(obj, key, value) {
3035
- if (key in obj) {
3036
- Object.defineProperty(obj, key, {
3037
- value,
3038
- enumerable: true,
3039
- configurable: true,
3040
- writable: true
3041
- });
3042
- } else {
3043
- obj[key] = value;
3044
- }
3045
- return obj;
3046
- }
3047
- var Pointer = class {
3048
- init(instance, position) {
3049
- this.position = position;
3050
- const target = this.getTarget(instance);
3051
- const [, enter] = getTreeDiff(null, target);
3052
- const init = this.getEventInit();
3053
- assertPointerEvents(instance, target);
3054
- instance.dispatchUIEvent(target, "pointerover", init);
3055
- enter.forEach((el) => instance.dispatchUIEvent(el, "pointerenter", init));
3056
- return this;
3057
- }
3058
- move(instance, position) {
3059
- const prevPosition = this.position;
3060
- const prevTarget = this.getTarget(instance);
3061
- this.position = position;
3062
- if (!isDifferentPointerPosition(prevPosition, position)) {
3063
- return;
3064
- }
3065
- const nextTarget = this.getTarget(instance);
3066
- const init = this.getEventInit();
3067
- const [leave, enter] = getTreeDiff(prevTarget, nextTarget);
3068
- return {
3069
- leave: () => {
3070
- if (hasPointerEvents(instance, prevTarget)) {
3071
- if (prevTarget !== nextTarget) {
3072
- instance.dispatchUIEvent(prevTarget, "pointerout", init);
3073
- leave.forEach((el) => instance.dispatchUIEvent(el, "pointerleave", init));
3074
- }
3075
- }
3076
- },
3077
- enter: () => {
3078
- assertPointerEvents(instance, nextTarget);
3079
- if (prevTarget !== nextTarget) {
3080
- instance.dispatchUIEvent(nextTarget, "pointerover", init);
3081
- enter.forEach((el) => instance.dispatchUIEvent(el, "pointerenter", init));
3082
- }
3083
- },
3084
- move: () => {
3085
- instance.dispatchUIEvent(nextTarget, "pointermove", init);
3086
- }
3087
- };
3088
- }
3089
- down(instance, _keyDef) {
3090
- if (this.isDown) {
3091
- return;
3092
- }
3093
- const target = this.getTarget(instance);
3094
- assertPointerEvents(instance, target);
3095
- this.isDown = true;
3096
- this.isPrevented = !instance.dispatchUIEvent(target, "pointerdown", this.getEventInit());
3097
- }
3098
- up(instance, _keyDef) {
3099
- if (!this.isDown) {
3100
- return;
3101
- }
3102
- const target = this.getTarget(instance);
3103
- assertPointerEvents(instance, target);
3104
- this.isDown = false;
3105
- instance.dispatchUIEvent(target, "pointerup", this.getEventInit());
3106
- }
3107
- release(instance) {
3108
- const target = this.getTarget(instance);
3109
- const [leave] = getTreeDiff(target, null);
3110
- const init = this.getEventInit();
3111
- if (hasPointerEvents(instance, target)) {
3112
- instance.dispatchUIEvent(target, "pointerout", init);
3113
- leave.forEach((el) => instance.dispatchUIEvent(el, "pointerleave", init));
3114
- }
3115
- this.isCancelled = true;
3116
- }
3117
- getTarget(instance) {
3118
- var _this_position_target;
3119
- return (_this_position_target = this.position.target) !== null && _this_position_target !== void 0 ? _this_position_target : instance.config.document.body;
3120
- }
3121
- getEventInit() {
3122
- return {
3123
- ...this.position.coords,
3124
- pointerId: this.pointerId,
3125
- pointerType: this.pointerType,
3126
- isPrimary: this.isPrimary
3127
- };
3128
- }
3129
- constructor({ pointerId, pointerType, isPrimary }) {
3130
- _define_property7(this, "pointerId", void 0);
3131
- _define_property7(this, "pointerType", void 0);
3132
- _define_property7(this, "isPrimary", void 0);
3133
- _define_property7(this, "isMultitouch", false);
3134
- _define_property7(this, "isCancelled", false);
3135
- _define_property7(this, "isDown", false);
3136
- _define_property7(this, "isPrevented", false);
3137
- _define_property7(this, "position", {});
3138
- this.pointerId = pointerId;
3139
- this.pointerType = pointerType;
3140
- this.isPrimary = isPrimary;
3141
- this.isMultitouch = !isPrimary;
3142
- }
3143
- };
3144
-
3145
- // ../../node_modules/@testing-library/user-event/dist/esm/system/pointer/index.js
3146
- function _define_property8(obj, key, value) {
3147
- if (key in obj) {
3148
- Object.defineProperty(obj, key, {
3149
- value,
3150
- enumerable: true,
3151
- configurable: true,
3152
- writable: true
3153
- });
3154
- } else {
3155
- obj[key] = value;
3156
- }
3157
- return obj;
3158
- }
3159
- var PointerHost = class {
3160
- isKeyPressed(keyDef) {
3161
- return this.devices.get(keyDef.pointerType).isPressed(keyDef);
3162
- }
3163
- async press(instance, keyDef, position) {
3164
- const pointerName = this.getPointerName(keyDef);
3165
- const pointer3 = keyDef.pointerType === "touch" ? this.pointers.new(pointerName, keyDef).init(instance, position) : this.pointers.get(pointerName);
3166
- pointer3.position = position;
3167
- if (pointer3.pointerType !== "touch") {
3168
- this.mouse.position = position;
3169
- }
3170
- this.devices.get(keyDef.pointerType).addPressed(keyDef);
3171
- this.buttons.down(keyDef);
3172
- pointer3.down(instance, keyDef);
3173
- if (pointer3.pointerType !== "touch" && !pointer3.isPrevented) {
3174
- this.mouse.down(instance, keyDef, pointer3);
3175
- }
3176
- }
3177
- async move(instance, pointerName, position) {
3178
- const pointer3 = this.pointers.get(pointerName);
3179
- const pointermove = pointer3.move(instance, position);
3180
- const mousemove = pointer3.pointerType === "touch" || pointer3.isPrevented && pointer3.isDown ? void 0 : this.mouse.move(instance, position);
3181
- pointermove === null || pointermove === void 0 ? void 0 : pointermove.leave();
3182
- mousemove === null || mousemove === void 0 ? void 0 : mousemove.leave();
3183
- pointermove === null || pointermove === void 0 ? void 0 : pointermove.enter();
3184
- mousemove === null || mousemove === void 0 ? void 0 : mousemove.enter();
3185
- pointermove === null || pointermove === void 0 ? void 0 : pointermove.move();
3186
- mousemove === null || mousemove === void 0 ? void 0 : mousemove.move();
3187
- }
3188
- async release(instance, keyDef, position) {
3189
- const device = this.devices.get(keyDef.pointerType);
3190
- device.removePressed(keyDef);
3191
- this.buttons.up(keyDef);
3192
- const pointer3 = this.pointers.get(this.getPointerName(keyDef));
3193
- pointer3.position = position;
3194
- if (pointer3.pointerType !== "touch") {
3195
- this.mouse.position = position;
3196
- }
3197
- if (device.countPressed === 0) {
3198
- pointer3.up(instance, keyDef);
3199
- }
3200
- if (pointer3.pointerType === "touch") {
3201
- pointer3.release(instance);
3202
- }
3203
- if (!pointer3.isPrevented) {
3204
- if (pointer3.pointerType === "touch" && !pointer3.isMultitouch) {
3205
- const mousemove = this.mouse.move(instance, pointer3.position);
3206
- mousemove === null || mousemove === void 0 ? void 0 : mousemove.leave();
3207
- mousemove === null || mousemove === void 0 ? void 0 : mousemove.enter();
3208
- mousemove === null || mousemove === void 0 ? void 0 : mousemove.move();
3209
- this.mouse.down(instance, keyDef, pointer3);
3210
- }
3211
- if (!pointer3.isMultitouch) {
3212
- const mousemove = this.mouse.move(instance, pointer3.position);
3213
- mousemove === null || mousemove === void 0 ? void 0 : mousemove.leave();
3214
- mousemove === null || mousemove === void 0 ? void 0 : mousemove.enter();
3215
- mousemove === null || mousemove === void 0 ? void 0 : mousemove.move();
3216
- this.mouse.up(instance, keyDef, pointer3);
3217
- }
3218
- }
3219
- }
3220
- getPointerName(keyDef) {
3221
- return keyDef.pointerType === "touch" ? keyDef.name : keyDef.pointerType;
3222
- }
3223
- getPreviousPosition(pointerName) {
3224
- return this.pointers.has(pointerName) ? this.pointers.get(pointerName).position : void 0;
3225
- }
3226
- resetClickCount() {
3227
- this.mouse.resetClickCount();
3228
- }
3229
- getMouseTarget(instance) {
3230
- var _this_mouse_position_target;
3231
- return (_this_mouse_position_target = this.mouse.position.target) !== null && _this_mouse_position_target !== void 0 ? _this_mouse_position_target : instance.config.document.body;
3232
- }
3233
- setMousePosition(position) {
3234
- this.mouse.position = position;
3235
- this.pointers.get("mouse").position = position;
3236
- }
3237
- constructor(system) {
3238
- _define_property8(this, "system", void 0);
3239
- _define_property8(this, "mouse", void 0);
3240
- _define_property8(this, "buttons", void 0);
3241
- _define_property8(this, "devices", new class {
3242
- get(k) {
3243
- var _this_registry, _k;
3244
- var _;
3245
- (_ = (_this_registry = this.registry)[_k = k]) !== null && _ !== void 0 ? _ : _this_registry[_k] = new Device();
3246
- return this.registry[k];
3247
- }
3248
- constructor() {
3249
- _define_property8(this, "registry", {});
3250
- }
3251
- }());
3252
- _define_property8(this, "pointers", new class {
3253
- new(pointerName, keyDef) {
3254
- const isPrimary = keyDef.pointerType !== "touch" || !Object.values(this.registry).some((p) => p.pointerType === "touch" && !p.isCancelled);
3255
- if (!isPrimary) {
3256
- Object.values(this.registry).forEach((p) => {
3257
- if (p.pointerType === keyDef.pointerType && !p.isCancelled) {
3258
- p.isMultitouch = true;
3259
- }
3260
- });
3261
- }
3262
- this.registry[pointerName] = new Pointer({
3263
- pointerId: this.nextId++,
3264
- pointerType: keyDef.pointerType,
3265
- isPrimary
3266
- });
3267
- return this.registry[pointerName];
3268
- }
3269
- get(pointerName) {
3270
- if (!this.has(pointerName)) {
3271
- throw new Error(`Trying to access pointer "${pointerName}" which does not exist.`);
3272
- }
3273
- return this.registry[pointerName];
3274
- }
3275
- has(pointerName) {
3276
- return pointerName in this.registry;
3277
- }
3278
- constructor() {
3279
- _define_property8(this, "registry", {
3280
- mouse: new Pointer({
3281
- pointerId: 1,
3282
- pointerType: "mouse",
3283
- isPrimary: true
3284
- })
3285
- });
3286
- _define_property8(this, "nextId", 2);
3287
- }
3288
- }());
3289
- this.system = system;
3290
- this.buttons = new Buttons();
3291
- this.mouse = new Mouse();
3292
- }
3293
- };
3294
-
3295
- // ../../node_modules/@testing-library/user-event/dist/esm/system/index.js
3296
- function _define_property9(obj, key, value) {
3297
- if (key in obj) {
3298
- Object.defineProperty(obj, key, {
3299
- value,
3300
- enumerable: true,
3301
- configurable: true,
3302
- writable: true
3303
- });
3304
- } else {
3305
- obj[key] = value;
3306
- }
3307
- return obj;
3308
- }
3309
- var System = class {
3310
- getUIEventModifiers() {
3311
- return {
3312
- altKey: this.keyboard.modifiers.Alt,
3313
- ctrlKey: this.keyboard.modifiers.Control,
3314
- metaKey: this.keyboard.modifiers.Meta,
3315
- shiftKey: this.keyboard.modifiers.Shift,
3316
- modifierAltGraph: this.keyboard.modifiers.AltGraph,
3317
- modifierCapsLock: this.keyboard.modifiers.CapsLock,
3318
- modifierFn: this.keyboard.modifiers.Fn,
3319
- modifierFnLock: this.keyboard.modifiers.FnLock,
3320
- modifierNumLock: this.keyboard.modifiers.NumLock,
3321
- modifierScrollLock: this.keyboard.modifiers.ScrollLock,
3322
- modifierSymbol: this.keyboard.modifiers.Symbol,
3323
- modifierSymbolLock: this.keyboard.modifiers.SymbolLock
3324
- };
3325
- }
3326
- constructor() {
3327
- _define_property9(this, "keyboard", new KeyboardHost(this));
3328
- _define_property9(this, "pointer", new PointerHost(this));
3329
- }
3330
- };
3331
-
3332
- // ../../node_modules/@testing-library/user-event/dist/esm/convenience/click.js
3333
- async function click(element) {
3334
- const pointerIn = [];
3335
- if (!this.config.skipHover) {
3336
- pointerIn.push({
3337
- target: element
3338
- });
3339
- }
3340
- pointerIn.push({
3341
- keys: "[MouseLeft]",
3342
- target: element
3343
- });
3344
- return this.pointer(pointerIn);
3345
- }
3346
- async function dblClick(element) {
3347
- return this.pointer([
3348
- {
3349
- target: element
3350
- },
3351
- "[MouseLeft][MouseLeft]"
3352
- ]);
3353
- }
3354
- async function tripleClick(element) {
3355
- return this.pointer([
3356
- {
3357
- target: element
3358
- },
3359
- "[MouseLeft][MouseLeft][MouseLeft]"
3360
- ]);
3361
- }
3362
-
3363
- // ../../node_modules/@testing-library/user-event/dist/esm/convenience/hover.js
3364
- async function hover(element) {
3365
- return this.pointer({
3366
- target: element
3367
- });
3368
- }
3369
- async function unhover(element) {
3370
- assertPointerEvents(this, this.system.pointer.getMouseTarget(this));
3371
- return this.pointer({
3372
- target: element.ownerDocument.body
3373
- });
3374
- }
3375
-
3376
- // ../../node_modules/@testing-library/user-event/dist/esm/convenience/tab.js
3377
- async function tab({ shift } = {}) {
3378
- return this.keyboard(shift === true ? "{Shift>}{Tab}{/Shift}" : shift === false ? "[/ShiftLeft][/ShiftRight]{Tab}" : "{Tab}");
3379
- }
3380
-
3381
- // ../../node_modules/@testing-library/user-event/dist/esm/keyboard/parseKeyDef.js
3382
- function parseKeyDef(keyboardMap, text) {
3383
- const defs = [];
3384
- do {
3385
- const { type: type3, descriptor, consumedLength, releasePrevious, releaseSelf = true, repeat } = readNextDescriptor(text, "keyboard");
3386
- var _keyboardMap_find;
3387
- const keyDef = (_keyboardMap_find = keyboardMap.find((def) => {
3388
- if (type3 === "[") {
3389
- var _def_code;
3390
- return ((_def_code = def.code) === null || _def_code === void 0 ? void 0 : _def_code.toLowerCase()) === descriptor.toLowerCase();
3391
- } else if (type3 === "{") {
3392
- var _def_key;
3393
- return ((_def_key = def.key) === null || _def_key === void 0 ? void 0 : _def_key.toLowerCase()) === descriptor.toLowerCase();
3394
- }
3395
- return def.key === descriptor;
3396
- })) !== null && _keyboardMap_find !== void 0 ? _keyboardMap_find : {
3397
- key: "Unknown",
3398
- code: "Unknown",
3399
- [type3 === "[" ? "code" : "key"]: descriptor
3400
- };
3401
- defs.push({
3402
- keyDef,
3403
- releasePrevious,
3404
- releaseSelf,
3405
- repeat
3406
- });
3407
- text = text.slice(consumedLength);
3408
- } while (text);
3409
- return defs;
3410
- }
3411
-
3412
- // ../../node_modules/@testing-library/user-event/dist/esm/keyboard/index.js
3413
- async function keyboard(text) {
3414
- const actions = parseKeyDef(this.config.keyboardMap, text);
3415
- for (let i = 0; i < actions.length; i++) {
3416
- await wait(this.config);
3417
- await keyboardAction(this, actions[i]);
3418
- }
3419
- }
3420
- async function keyboardAction(instance, { keyDef, releasePrevious, releaseSelf, repeat }) {
3421
- const { system } = instance;
3422
- if (system.keyboard.isKeyPressed(keyDef)) {
3423
- await system.keyboard.keyup(instance, keyDef);
3424
- }
3425
- if (!releasePrevious) {
3426
- for (let i = 1; i <= repeat; i++) {
3427
- await system.keyboard.keydown(instance, keyDef);
3428
- if (i < repeat) {
3429
- await wait(instance.config);
3430
- }
3431
- }
3432
- if (releaseSelf) {
3433
- await system.keyboard.keyup(instance, keyDef);
3434
- }
3435
- }
3436
- }
3437
- async function releaseAllKeys(instance) {
3438
- for (const k of instance.system.keyboard.getPressedKeys()) {
3439
- await instance.system.keyboard.keyup(instance, k);
3440
- }
3441
- }
3442
-
3443
- // ../../node_modules/@testing-library/user-event/dist/esm/document/copySelection.js
3444
- function copySelection(target) {
3445
- const data = hasOwnSelection(target) ? {
3446
- "text/plain": readSelectedValueFromInput(target)
3447
- } : {
3448
- "text/plain": String(target.ownerDocument.getSelection())
3449
- };
3450
- const dt = createDataTransfer(getWindow(target));
3451
- for (const type3 in data) {
3452
- if (data[type3]) {
3453
- dt.setData(type3, data[type3]);
3454
- }
3455
- }
3456
- return dt;
3457
- }
3458
- function readSelectedValueFromInput(target) {
3459
- const sel = getUISelection(target);
3460
- const val = getUIValue(target);
3461
- return val.substring(sel.startOffset, sel.endOffset);
3462
- }
3463
-
3464
- // ../../node_modules/@testing-library/user-event/dist/esm/clipboard/copy.js
3465
- async function copy() {
3466
- const doc = this.config.document;
3467
- var _doc_activeElement;
3468
- const target = (_doc_activeElement = doc.activeElement) !== null && _doc_activeElement !== void 0 ? _doc_activeElement : (
3469
- /* istanbul ignore next */
3470
- doc.body
3471
- );
3472
- const clipboardData = copySelection(target);
3473
- if (clipboardData.items.length === 0) {
3474
- return;
3475
- }
3476
- if (this.dispatchUIEvent(target, "copy", {
3477
- clipboardData
3478
- }) && this.config.writeToClipboard) {
3479
- await writeDataTransferToClipboard(doc, clipboardData);
3480
- }
3481
- return clipboardData;
3482
- }
3483
-
3484
- // ../../node_modules/@testing-library/user-event/dist/esm/clipboard/cut.js
3485
- async function cut() {
3486
- const doc = this.config.document;
3487
- var _doc_activeElement;
3488
- const target = (_doc_activeElement = doc.activeElement) !== null && _doc_activeElement !== void 0 ? _doc_activeElement : (
3489
- /* istanbul ignore next */
3490
- doc.body
3491
- );
3492
- const clipboardData = copySelection(target);
3493
- if (clipboardData.items.length === 0) {
3494
- return;
3495
- }
3496
- if (this.dispatchUIEvent(target, "cut", {
3497
- clipboardData
3498
- }) && this.config.writeToClipboard) {
3499
- await writeDataTransferToClipboard(target.ownerDocument, clipboardData);
3500
- }
3501
- return clipboardData;
3502
- }
3503
-
3504
- // ../../node_modules/@testing-library/user-event/dist/esm/clipboard/paste.js
3505
- async function paste(clipboardData) {
3506
- const doc = this.config.document;
3507
- var _doc_activeElement;
3508
- const target = (_doc_activeElement = doc.activeElement) !== null && _doc_activeElement !== void 0 ? _doc_activeElement : (
3509
- /* istanbul ignore next */
3510
- doc.body
3511
- );
3512
- var _ref;
3513
- const dataTransfer = (_ref = typeof clipboardData === "string" ? getClipboardDataFromString(doc, clipboardData) : clipboardData) !== null && _ref !== void 0 ? _ref : await readDataTransferFromClipboard(doc).catch(() => {
3514
- throw new Error("`userEvent.paste()` without `clipboardData` requires the `ClipboardAPI` to be available.");
3515
- });
3516
- this.dispatchUIEvent(target, "paste", {
3517
- clipboardData: dataTransfer
3518
- });
3519
- }
3520
- function getClipboardDataFromString(doc, text) {
3521
- const dt = createDataTransfer(getWindow(doc));
3522
- dt.setData("text", text);
3523
- return dt;
3524
- }
3525
-
3526
- // ../../node_modules/@testing-library/user-event/dist/esm/pointer/parseKeyDef.js
3527
- function parseKeyDef2(pointerMap, keys) {
3528
- const defs = [];
3529
- do {
3530
- const { descriptor, consumedLength, releasePrevious, releaseSelf = true } = readNextDescriptor(keys, "pointer");
3531
- const keyDef = pointerMap.find((p) => p.name === descriptor);
3532
- if (keyDef) {
3533
- defs.push({
3534
- keyDef,
3535
- releasePrevious,
3536
- releaseSelf
3537
- });
3538
- }
3539
- keys = keys.slice(consumedLength);
3540
- } while (keys);
3541
- return defs;
3542
- }
3543
-
3544
- // ../../node_modules/@testing-library/user-event/dist/esm/pointer/index.js
3545
- async function pointer(input2) {
3546
- const { pointerMap } = this.config;
3547
- const actions = [];
3548
- (Array.isArray(input2) ? input2 : [
3549
- input2
3550
- ]).forEach((actionInput) => {
3551
- if (typeof actionInput === "string") {
3552
- actions.push(...parseKeyDef2(pointerMap, actionInput));
3553
- } else if ("keys" in actionInput) {
3554
- actions.push(...parseKeyDef2(pointerMap, actionInput.keys).map((i) => ({
3555
- ...actionInput,
3556
- ...i
3557
- })));
3558
- } else {
3559
- actions.push(actionInput);
3560
- }
3561
- });
3562
- for (let i = 0; i < actions.length; i++) {
3563
- await wait(this.config);
3564
- await pointerAction(this, actions[i]);
3565
- }
3566
- this.system.pointer.resetClickCount();
3567
- }
3568
- async function pointerAction(instance, action) {
3569
- var _previousPosition_caret, _previousPosition_caret1;
3570
- const pointerName = "pointerName" in action && action.pointerName ? action.pointerName : "keyDef" in action ? instance.system.pointer.getPointerName(action.keyDef) : "mouse";
3571
- const previousPosition = instance.system.pointer.getPreviousPosition(pointerName);
3572
- var _action_target, _action_coords, _action_node, _action_offset;
3573
- const position = {
3574
- target: (_action_target = action.target) !== null && _action_target !== void 0 ? _action_target : getPrevTarget(instance, previousPosition),
3575
- coords: (_action_coords = action.coords) !== null && _action_coords !== void 0 ? _action_coords : previousPosition === null || previousPosition === void 0 ? void 0 : previousPosition.coords,
3576
- caret: {
3577
- node: (_action_node = action.node) !== null && _action_node !== void 0 ? _action_node : hasCaretPosition(action) ? void 0 : previousPosition === null || previousPosition === void 0 ? void 0 : (_previousPosition_caret = previousPosition.caret) === null || _previousPosition_caret === void 0 ? void 0 : _previousPosition_caret.node,
3578
- offset: (_action_offset = action.offset) !== null && _action_offset !== void 0 ? _action_offset : hasCaretPosition(action) ? void 0 : previousPosition === null || previousPosition === void 0 ? void 0 : (_previousPosition_caret1 = previousPosition.caret) === null || _previousPosition_caret1 === void 0 ? void 0 : _previousPosition_caret1.offset
3579
- }
3580
- };
3581
- if ("keyDef" in action) {
3582
- if (instance.system.pointer.isKeyPressed(action.keyDef)) {
3583
- setLevelRef(instance, ApiLevel.Trigger);
3584
- await instance.system.pointer.release(instance, action.keyDef, position);
3585
- }
3586
- if (!action.releasePrevious) {
3587
- setLevelRef(instance, ApiLevel.Trigger);
3588
- await instance.system.pointer.press(instance, action.keyDef, position);
3589
- if (action.releaseSelf) {
3590
- setLevelRef(instance, ApiLevel.Trigger);
3591
- await instance.system.pointer.release(instance, action.keyDef, position);
3592
- }
3593
- }
3594
- } else {
3595
- setLevelRef(instance, ApiLevel.Trigger);
3596
- await instance.system.pointer.move(instance, pointerName, position);
3597
- }
3598
- }
3599
- function hasCaretPosition(action) {
3600
- var _action_target, _ref;
3601
- return !!((_ref = (_action_target = action.target) !== null && _action_target !== void 0 ? _action_target : action.node) !== null && _ref !== void 0 ? _ref : action.offset !== void 0);
3602
- }
3603
- function getPrevTarget(instance, position) {
3604
- if (!position) {
3605
- throw new Error("This pointer has no previous position. Provide a target property!");
3606
- }
3607
- var _position_target;
3608
- return (_position_target = position.target) !== null && _position_target !== void 0 ? _position_target : instance.config.document.body;
3609
- }
3610
-
3611
- // ../../node_modules/@testing-library/user-event/dist/esm/utility/clear.js
3612
- async function clear(element) {
3613
- if (!isEditable(element) || isDisabled(element)) {
3614
- throw new Error("clear()` is only supported on editable elements.");
3615
- }
3616
- focusElement(element);
3617
- if (element.ownerDocument.activeElement !== element) {
3618
- throw new Error("The element to be cleared could not be focused.");
3619
- }
3620
- selectAll(element);
3621
- if (!isAllSelected(element)) {
3622
- throw new Error("The element content to be cleared could not be selected.");
3623
- }
3624
- input(this, element, "", "deleteContentBackward");
3625
- }
3626
-
3627
- // ../../node_modules/@testing-library/user-event/dist/esm/utility/selectOptions.js
3628
- async function selectOptions(select, values) {
3629
- return selectOptionsBase.call(this, true, select, values);
3630
- }
3631
- async function deselectOptions(select, values) {
3632
- return selectOptionsBase.call(this, false, select, values);
3633
- }
3634
- async function selectOptionsBase(newValue, select, values) {
3635
- if (!newValue && !select.multiple) {
3636
- throw getConfig().getElementError(`Unable to deselect an option in a non-multiple select. Use selectOptions to change the selection instead.`, select);
3637
- }
3638
- const valArray = Array.isArray(values) ? values : [
3639
- values
3640
- ];
3641
- const allOptions = Array.from(select.querySelectorAll('option, [role="option"]'));
3642
- const selectedOptions = valArray.map((val) => {
3643
- if (typeof val !== "string" && allOptions.includes(val)) {
3644
- return val;
3645
- } else {
3646
- const matchingOption = allOptions.find((o) => o.value === val || o.innerHTML === val);
3647
- if (matchingOption) {
3648
- return matchingOption;
3649
- } else {
3650
- throw getConfig().getElementError(`Value "${String(val)}" not found in options`, select);
3651
- }
3652
- }
3653
- }).filter((option) => !isDisabled(option));
3654
- if (isDisabled(select) || !selectedOptions.length) return;
3655
- const selectOption = (option) => {
3656
- option.selected = newValue;
3657
- this.dispatchUIEvent(select, "input", {
3658
- bubbles: true,
3659
- cancelable: false,
3660
- composed: true
3661
- });
3662
- this.dispatchUIEvent(select, "change");
3663
- };
3664
- if (isElementType(select, "select")) {
3665
- if (select.multiple) {
3666
- for (const option of selectedOptions) {
3667
- const withPointerEvents = this.config.pointerEventsCheck === 0 ? true : hasPointerEvents(this, option);
3668
- if (withPointerEvents) {
3669
- this.dispatchUIEvent(option, "pointerover");
3670
- this.dispatchUIEvent(select, "pointerenter");
3671
- this.dispatchUIEvent(option, "mouseover");
3672
- this.dispatchUIEvent(select, "mouseenter");
3673
- this.dispatchUIEvent(option, "pointermove");
3674
- this.dispatchUIEvent(option, "mousemove");
3675
- this.dispatchUIEvent(option, "pointerdown");
3676
- this.dispatchUIEvent(option, "mousedown");
3677
- }
3678
- focusElement(select);
3679
- if (withPointerEvents) {
3680
- this.dispatchUIEvent(option, "pointerup");
3681
- this.dispatchUIEvent(option, "mouseup");
3682
- }
3683
- selectOption(option);
3684
- if (withPointerEvents) {
3685
- this.dispatchUIEvent(option, "click");
3686
- }
3687
- await wait(this.config);
3688
- }
3689
- } else if (selectedOptions.length === 1) {
3690
- const withPointerEvents = this.config.pointerEventsCheck === 0 ? true : hasPointerEvents(this, select);
3691
- if (withPointerEvents) {
3692
- await this.click(select);
3693
- } else {
3694
- focusElement(select);
3695
- }
3696
- selectOption(selectedOptions[0]);
3697
- if (withPointerEvents) {
3698
- this.dispatchUIEvent(select, "pointerover");
3699
- this.dispatchUIEvent(select, "pointerenter");
3700
- this.dispatchUIEvent(select, "mouseover");
3701
- this.dispatchUIEvent(select, "mouseenter");
3702
- this.dispatchUIEvent(select, "pointerup");
3703
- this.dispatchUIEvent(select, "mouseup");
3704
- this.dispatchUIEvent(select, "click");
3705
- }
3706
- await wait(this.config);
3707
- } else {
3708
- throw getConfig().getElementError(`Cannot select multiple options on a non-multiple select`, select);
3709
- }
3710
- } else if (select.getAttribute("role") === "listbox") {
3711
- for (const option of selectedOptions) {
3712
- await this.click(option);
3713
- await this.unhover(option);
3714
- }
3715
- } else {
3716
- throw getConfig().getElementError(`Cannot select options on elements that are neither select nor listbox elements`, select);
3717
- }
3718
- }
3719
-
3720
- // ../../node_modules/@testing-library/user-event/dist/esm/utility/type.js
3721
- async function type(element, text, { skipClick = this.config.skipClick, skipAutoClose = this.config.skipAutoClose, initialSelectionStart, initialSelectionEnd } = {}) {
3722
- if (element.disabled) return;
3723
- if (!skipClick) {
3724
- await this.click(element);
3725
- }
3726
- if (initialSelectionStart !== void 0) {
3727
- setSelectionRange(element, initialSelectionStart, initialSelectionEnd !== null && initialSelectionEnd !== void 0 ? initialSelectionEnd : initialSelectionStart);
3728
- }
3729
- await this.keyboard(text);
3730
- if (!skipAutoClose) {
3731
- await releaseAllKeys(this);
3732
- }
3733
- }
3734
-
3735
- // ../../node_modules/@testing-library/user-event/dist/esm/utils/edit/setFiles.js
3736
- var fakeFiles = Symbol("files and value properties are mocked");
3737
- function restoreProperty(obj, prop, descriptor) {
3738
- if (descriptor) {
3739
- Object.defineProperty(obj, prop, descriptor);
3740
- } else {
3741
- delete obj[prop];
3742
- }
3743
- }
3744
- function setFiles(el, files) {
3745
- var _el_fakeFiles;
3746
- (_el_fakeFiles = el[fakeFiles]) === null || _el_fakeFiles === void 0 ? void 0 : _el_fakeFiles.restore();
3747
- const typeDescr = Object.getOwnPropertyDescriptor(el, "type");
3748
- const valueDescr = Object.getOwnPropertyDescriptor(el, "value");
3749
- const filesDescr = Object.getOwnPropertyDescriptor(el, "files");
3750
- function restore() {
3751
- restoreProperty(el, "type", typeDescr);
3752
- restoreProperty(el, "value", valueDescr);
3753
- restoreProperty(el, "files", filesDescr);
3754
- }
3755
- el[fakeFiles] = {
3756
- restore
3757
- };
3758
- Object.defineProperties(el, {
3759
- files: {
3760
- configurable: true,
3761
- get: () => files
3762
- },
3763
- value: {
3764
- configurable: true,
3765
- get: () => files.length ? `C:\\fakepath\\${files[0].name}` : "",
3766
- set(v) {
3767
- if (v === "") {
3768
- restore();
3769
- } else {
3770
- var _valueDescr_set;
3771
- valueDescr === null || valueDescr === void 0 ? void 0 : (_valueDescr_set = valueDescr.set) === null || _valueDescr_set === void 0 ? void 0 : _valueDescr_set.call(el, v);
3772
- }
3773
- }
3774
- },
3775
- type: {
3776
- configurable: true,
3777
- get: () => "file",
3778
- set(v) {
3779
- if (v !== "file") {
3780
- restore();
3781
- el.type = v;
3782
- }
3783
- }
3784
- }
3785
- });
3786
- }
3787
-
3788
- // ../../node_modules/@testing-library/user-event/dist/esm/utility/upload.js
3789
- async function upload(element, fileOrFiles) {
3790
- const input2 = isElementType(element, "label") ? element.control : element;
3791
- if (!input2 || !isElementType(input2, "input", {
3792
- type: "file"
3793
- })) {
3794
- throw new TypeError(`The ${input2 === element ? "given" : "associated"} ${input2 === null || input2 === void 0 ? void 0 : input2.tagName} element does not accept file uploads`);
3795
- }
3796
- if (isDisabled(element)) return;
3797
- const files = (Array.isArray(fileOrFiles) ? fileOrFiles : [
3798
- fileOrFiles
3799
- ]).filter((file) => !this.config.applyAccept || isAcceptableFile(file, input2.accept)).slice(0, input2.multiple ? void 0 : 1);
3800
- const fileDialog = () => {
3801
- var _input_files;
3802
- if (files.length === ((_input_files = input2.files) === null || _input_files === void 0 ? void 0 : _input_files.length) && files.every((f, i) => {
3803
- var _input_files2;
3804
- return f === ((_input_files2 = input2.files) === null || _input_files2 === void 0 ? void 0 : _input_files2.item(i));
3805
- })) {
3806
- return;
3807
- }
3808
- setFiles(input2, createFileList(getWindow(element), files));
3809
- this.dispatchUIEvent(input2, "input");
3810
- this.dispatchUIEvent(input2, "change");
3811
- };
3812
- input2.addEventListener("fileDialog", fileDialog);
3813
- await this.click(element);
3814
- input2.removeEventListener("fileDialog", fileDialog);
3815
- }
3816
- function isAcceptableFile(file, accept) {
3817
- if (!accept) {
3818
- return true;
3819
- }
3820
- const wildcards = [
3821
- "audio/*",
3822
- "image/*",
3823
- "video/*"
3824
- ];
3825
- return accept.split(",").some((acceptToken) => {
3826
- if (acceptToken.startsWith(".")) {
3827
- return file.name.endsWith(acceptToken);
3828
- } else if (wildcards.includes(acceptToken)) {
3829
- return file.type.startsWith(acceptToken.substr(0, acceptToken.length - 1));
3830
- }
3831
- return file.type === acceptToken;
3832
- });
3833
- }
3834
-
3835
- // ../../node_modules/@testing-library/user-event/dist/esm/setup/api.js
3836
- var userEventApi = {
3837
- click,
3838
- dblClick,
3839
- tripleClick,
3840
- hover,
3841
- unhover,
3842
- tab,
3843
- keyboard,
3844
- copy,
3845
- cut,
3846
- paste,
3847
- pointer,
3848
- clear,
3849
- deselectOptions,
3850
- selectOptions,
3851
- type,
3852
- upload
3853
- };
3854
-
3855
- // ../../node_modules/@testing-library/user-event/dist/esm/setup/wrapAsync.js
3856
- function wrapAsync(implementation) {
3857
- return getConfig().asyncWrapper(implementation);
3858
- }
3859
-
3860
- // ../../node_modules/@testing-library/user-event/dist/esm/setup/setup.js
3861
- var defaultOptionsDirect = {
3862
- applyAccept: true,
3863
- autoModify: true,
3864
- delay: 0,
3865
- document: globalThis.document,
3866
- keyboardMap: defaultKeyMap,
3867
- pointerMap: defaultKeyMap2,
3868
- pointerEventsCheck: PointerEventsCheckLevel.EachApiCall,
3869
- skipAutoClose: false,
3870
- skipClick: false,
3871
- skipHover: false,
3872
- writeToClipboard: false,
3873
- advanceTimers: () => Promise.resolve()
3874
- };
3875
- var defaultOptionsSetup = {
3876
- ...defaultOptionsDirect,
3877
- writeToClipboard: true
3878
- };
3879
- function createConfig(options = {}, defaults = defaultOptionsSetup, node) {
3880
- const document = getDocument(options, node, defaults);
3881
- return {
3882
- ...defaults,
3883
- ...options,
3884
- document
3885
- };
3886
- }
3887
- function setupMain(options = {}) {
3888
- const config = createConfig(options);
3889
- prepareDocument(config.document);
3890
- var _config_document_defaultView;
3891
- const view = (_config_document_defaultView = config.document.defaultView) !== null && _config_document_defaultView !== void 0 ? _config_document_defaultView : (
3892
- /* istanbul ignore next */
3893
- globalThis.window
3894
- );
3895
- attachClipboardStubToView(view);
3896
- return createInstance(config).api;
3897
- }
3898
- function setupDirect({ keyboardState, pointerState, ...options } = {}, node) {
3899
- const config = createConfig(options, defaultOptionsDirect, node);
3900
- prepareDocument(config.document);
3901
- var _ref;
3902
- const system = (_ref = pointerState !== null && pointerState !== void 0 ? pointerState : keyboardState) !== null && _ref !== void 0 ? _ref : new System();
3903
- return {
3904
- api: createInstance(config, system).api,
3905
- system
3906
- };
3907
- }
3908
- function setupSub(options) {
3909
- return createInstance({
3910
- ...this.config,
3911
- ...options
3912
- }, this.system).api;
3913
- }
3914
- function wrapAndBindImpl(instance, impl) {
3915
- function method(...args) {
3916
- setLevelRef(instance, ApiLevel.Call);
3917
- return wrapAsync(() => impl.apply(instance, args).then(async (ret) => {
3918
- await wait(instance.config);
3919
- return ret;
3920
- }));
3921
- }
3922
- Object.defineProperty(method, "name", {
3923
- get: () => impl.name
3924
- });
3925
- return method;
3926
- }
3927
- function createInstance(config, system = new System()) {
3928
- const instance = {};
3929
- Object.assign(instance, {
3930
- config,
3931
- dispatchEvent: dispatchEvent.bind(instance),
3932
- dispatchUIEvent: dispatchUIEvent.bind(instance),
3933
- system,
3934
- levelRefs: {},
3935
- ...userEventApi
3936
- });
3937
- return {
3938
- instance,
3939
- api: {
3940
- ...Object.fromEntries(Object.entries(userEventApi).map(([name, api]) => [
3941
- name,
3942
- wrapAndBindImpl(instance, api)
3943
- ])),
3944
- setup: setupSub.bind(instance)
3945
- }
3946
- };
3947
- }
3948
- function getDocument(options, node, defaults) {
3949
- var _options_document, _ref;
3950
- return (_ref = (_options_document = options.document) !== null && _options_document !== void 0 ? _options_document : node && getDocumentFromNode(node)) !== null && _ref !== void 0 ? _ref : defaults.document;
3951
- }
3952
-
3953
- // ../../node_modules/@testing-library/user-event/dist/esm/setup/directApi.js
3954
- var directApi_exports = {};
3955
- __export(directApi_exports, {
3956
- clear: () => clear2,
3957
- click: () => click2,
3958
- copy: () => copy2,
3959
- cut: () => cut2,
3960
- dblClick: () => dblClick2,
3961
- deselectOptions: () => deselectOptions2,
3962
- hover: () => hover2,
3963
- keyboard: () => keyboard2,
3964
- paste: () => paste2,
3965
- pointer: () => pointer2,
3966
- selectOptions: () => selectOptions2,
3967
- tab: () => tab2,
3968
- tripleClick: () => tripleClick2,
3969
- type: () => type2,
3970
- unhover: () => unhover2,
3971
- upload: () => upload2
3972
- });
3973
- function clear2(element) {
3974
- return setupDirect().api.clear(element);
3975
- }
3976
- function click2(element, options = {}) {
3977
- return setupDirect(options, element).api.click(element);
3978
- }
3979
- function copy2(options = {}) {
3980
- return setupDirect(options).api.copy();
3981
- }
3982
- function cut2(options = {}) {
3983
- return setupDirect(options).api.cut();
3984
- }
3985
- function dblClick2(element, options = {}) {
3986
- return setupDirect(options).api.dblClick(element);
3987
- }
3988
- function deselectOptions2(select, values, options = {}) {
3989
- return setupDirect(options).api.deselectOptions(select, values);
3990
- }
3991
- function hover2(element, options = {}) {
3992
- return setupDirect(options).api.hover(element);
3993
- }
3994
- async function keyboard2(text, options = {}) {
3995
- const { api, system } = setupDirect(options);
3996
- return api.keyboard(text).then(() => system);
3997
- }
3998
- async function pointer2(input2, options = {}) {
3999
- const { api, system } = setupDirect(options);
4000
- return api.pointer(input2).then(() => system);
4001
- }
4002
- function paste2(clipboardData, options) {
4003
- return setupDirect(options).api.paste(clipboardData);
4004
- }
4005
- function selectOptions2(select, values, options = {}) {
4006
- return setupDirect(options).api.selectOptions(select, values);
4007
- }
4008
- function tripleClick2(element, options = {}) {
4009
- return setupDirect(options).api.tripleClick(element);
4010
- }
4011
- function type2(element, text, options = {}) {
4012
- return setupDirect(options, element).api.type(element, text, options);
4013
- }
4014
- function unhover2(element, options = {}) {
4015
- const { api, system } = setupDirect(options);
4016
- system.pointer.setMousePosition({
4017
- target: element
4018
- });
4019
- return api.unhover(element);
4020
- }
4021
- function upload2(element, fileOrFiles, options = {}) {
4022
- return setupDirect(options).api.upload(element, fileOrFiles);
4023
- }
4024
- function tab2(options = {}) {
4025
- return setupDirect().api.tab(options);
4026
- }
4027
-
4028
- // ../../node_modules/@testing-library/user-event/dist/esm/setup/index.js
4029
- var userEvent = {
4030
- ...directApi_exports,
4031
- setup: setupMain
4032
- };
4033
-
4034
- export {
4035
- userEvent
4036
- };