@unchainedshop/admin-ui 4.9.0 → 4.9.2

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 (461) hide show
  1. package/dist/{chunk-WPLOTFGW.js → chunk-2HTCKO4E.js} +12 -3
  2. package/dist/{chunk-PJLYVMUM.js → chunk-4MXPTVDL.js} +2 -2
  3. package/dist/{chunk-I64TXIE7.js → chunk-ATZJXTRA.js} +1 -1
  4. package/dist/{chunk-QHR23GVH.js → chunk-CUYIP5XG.js} +1 -1
  5. package/dist/{chunk-5WPFHQZN.js → chunk-E6HDJYA6.js} +3 -3
  6. package/dist/{chunk-FDHXLNZQ.js → chunk-EAVP6XZQ.js} +1 -1
  7. package/dist/{chunk-E77YIMGR.js → chunk-ED2FP42R.js} +1 -1
  8. package/dist/{chunk-HJKRGBDG.js → chunk-GWMLIF3C.js} +1 -1
  9. package/dist/{chunk-3L6EZQ6P.js → chunk-NFJE5EJG.js} +1 -1
  10. package/dist/{chunk-BMDNY67T.js → chunk-PGJTFYBT.js} +1385 -932
  11. package/dist/{chunk-ICJH36K4.js → chunk-YUXHILXY.js} +1 -1
  12. package/dist/form.js +797 -286
  13. package/dist/hooks.js +3 -3
  14. package/dist/modal.js +5 -5
  15. package/dist/modules/accounts.js +1 -1
  16. package/dist/modules/assortment.js +1 -1
  17. package/dist/modules/country.js +1 -1
  18. package/dist/modules/currency.js +1 -1
  19. package/dist/modules/delivery-provider.js +1 -1
  20. package/dist/modules/enrollment.js +1 -1
  21. package/dist/modules/event.js +1 -1
  22. package/dist/modules/filter.js +1 -1
  23. package/dist/modules/language.js +1 -1
  24. package/dist/modules/order.js +1 -1
  25. package/dist/modules/payment-providers.js +1 -1
  26. package/dist/modules/product-review.js +1 -1
  27. package/dist/modules/product.js +5 -5
  28. package/dist/modules/quotation.js +1 -1
  29. package/dist/modules/token.js +1 -1
  30. package/dist/modules/warehousing-providers.js +1 -1
  31. package/dist/modules/work.js +1 -1
  32. package/dist/plugins.js +1 -1
  33. package/dist/providers.js +5 -5
  34. package/dist/shims/admin-ui-plugins.js +1 -1
  35. package/dist/shims/apollo-client-react.js +1 -1
  36. package/dist/shims/apollo-client.js +1 -1
  37. package/dist/shims/next-head.js +1 -1
  38. package/dist/shims/next-image.js +1 -1
  39. package/dist/shims/next-link.js +1 -1
  40. package/dist/shims/next-router.js +1 -1
  41. package/dist/shims/react-dom-client.js +1 -1
  42. package/dist/shims/react-dom.js +1 -1
  43. package/dist/shims/react-hook-form.js +1 -1
  44. package/dist/shims/react-intl.js +1 -1
  45. package/dist/shims/react-jsx-runtime.js +1 -1
  46. package/dist/shims/react-toastify.js +1 -1
  47. package/dist/shims/react.js +1 -1
  48. package/dist/theme.js +1 -1
  49. package/dist/ui.js +3884 -3401
  50. package/out/403/index.html +3 -3
  51. package/out/404/index.html +3 -3
  52. package/out/404.html +3 -3
  53. package/out/423/index.html +3 -3
  54. package/out/500/index.html +3 -3
  55. package/out/_next/static/TwsufYu8Ldt9ZNxtvzshp/_buildManifest.js +258 -0
  56. package/out/_next/static/chunks/0-66i4h-noxvn.js +7 -0
  57. package/out/_next/static/chunks/0-wbl3cr3959x.js +1 -0
  58. package/out/_next/static/chunks/01bmb-z2nror5.js +63 -0
  59. package/out/_next/static/chunks/01ehk69jm7o3h.js +1 -0
  60. package/out/_next/static/chunks/01v4zuf_1s632.js +24 -0
  61. package/out/_next/static/chunks/02bw09719wk6m.js +59 -0
  62. package/out/_next/static/chunks/04u9l5z90u8zc.js +108 -0
  63. package/out/_next/static/chunks/{439tz_ubj8h-g.js → 05kae8xt4d-mt.js} +9 -9
  64. package/out/_next/static/chunks/060-0-y0yq4tn.js +4 -0
  65. package/out/_next/static/chunks/06umepciqel5y.js +15 -0
  66. package/out/_next/static/chunks/{2rmgaa88-4bpb.js → 07oa-1j75vunn.js} +4 -4
  67. package/out/_next/static/chunks/{0zzoylv2rl1xu.js → 07qh9c3qklj41.js} +1 -1
  68. package/out/_next/static/chunks/08aonh4sng6e2.js +7 -0
  69. package/out/_next/static/chunks/08u8uu0r0k0o9.js +9 -0
  70. package/out/_next/static/chunks/096x-m7s73l-c.js +1 -0
  71. package/out/_next/static/chunks/0ab6zl-u7ml1p.js +5 -0
  72. package/out/_next/static/chunks/{40l5d7o95aw37.js → 0bvh9mjjgn_w3.js} +1 -1
  73. package/out/_next/static/chunks/0crno_6ew111i.js +8 -0
  74. package/out/_next/static/chunks/0czpir4zjwmos.js +1 -0
  75. package/out/_next/static/chunks/0fogiqvh9bznp.js +2 -0
  76. package/out/_next/static/chunks/0g1uyaoneybnf.js +41 -0
  77. package/out/_next/static/chunks/0h373kx_wlwzy.js +1 -0
  78. package/out/_next/static/chunks/{2hoi6cb1lromr.js → 0hq9p72y7ki0h.js} +1 -1
  79. package/out/_next/static/chunks/0hqvf-b6yry5-.js +12 -0
  80. package/out/_next/static/chunks/0ikig1vazlo5p.js +1 -0
  81. package/out/_next/static/chunks/0jol393fjamwq.js +277 -0
  82. package/out/_next/static/chunks/0jr0_6oupairk.js +13 -0
  83. package/out/_next/static/chunks/0l0hzoqd-va5-.js +1 -0
  84. package/out/_next/static/chunks/0m006z-rbif-h.js +5 -0
  85. package/out/_next/static/chunks/0nsa2b75vwe9r.js +43 -0
  86. package/out/_next/static/chunks/0oeas4d1fnzbb.js +36 -0
  87. package/out/_next/static/chunks/0q7n10ncl7jak.js +119 -0
  88. package/out/_next/static/chunks/0qyx2854lfah9.js +152 -0
  89. package/out/_next/static/chunks/0rjrvdq5w-984.js +78 -0
  90. package/out/_next/static/chunks/0tavmhzr7m3u9.js +5 -0
  91. package/out/_next/static/chunks/0tp8_k14lgo7i.js +12 -0
  92. package/out/_next/static/chunks/{1tkvi0wb-x3v8.js → 0u290yfuv_u2_.js} +2 -2
  93. package/out/_next/static/chunks/0u_zr87ce7iu-.js +1 -0
  94. package/out/_next/static/chunks/0v2v5x8dtpfh6.js +7 -0
  95. package/out/_next/static/chunks/0var4u7x1jrna.js +1 -0
  96. package/out/_next/static/chunks/0vik72soxnie0.js +32 -0
  97. package/out/_next/static/chunks/0xry2ss7g-gk_.js +33 -0
  98. package/out/_next/static/chunks/0xywzizg7ntfd.js +44 -0
  99. package/out/_next/static/chunks/0y3lr_rwmezii.js +1 -0
  100. package/out/_next/static/chunks/0zvpipo0q47xl.js +15 -0
  101. package/out/_next/static/chunks/1-jp7as2d7zp6.js +44 -0
  102. package/out/_next/static/chunks/10jrq6wew06i6.js +23 -0
  103. package/out/_next/static/chunks/1164-c5abnfyy.js +5 -0
  104. package/out/_next/static/chunks/{3qzrrjb48t2w3.js → 119d8cbr8mij2.js} +5 -5
  105. package/out/_next/static/chunks/122a0xxhrak7b.js +1 -0
  106. package/out/_next/static/chunks/129-110-fx4g2.js +277 -0
  107. package/out/_next/static/chunks/12hh2h53sa5vl.js +33 -0
  108. package/out/_next/static/chunks/14qvgxj89rj3h.js +16 -0
  109. package/out/_next/static/chunks/179acu8_sgizp.js +4 -0
  110. package/out/_next/static/chunks/1a120nyn1xssj.js +46 -0
  111. package/out/_next/static/chunks/1ata93ftwo5e5.js +1 -0
  112. package/out/_next/static/chunks/1ca5de-nq28g5.js +5 -0
  113. package/out/_next/static/chunks/1cm161_p0htmv.js +6 -0
  114. package/out/_next/static/chunks/1cp5rjbtbj7im.js +7 -0
  115. package/out/_next/static/chunks/1d-xju_35oiky.js +7 -0
  116. package/out/_next/static/chunks/1d2l6vs2y96io.js +5 -0
  117. package/out/_next/static/chunks/1dedrypk-h8qr.js +1 -0
  118. package/out/_next/static/chunks/1dl-ild2tc5fi.js +10 -0
  119. package/out/_next/static/chunks/1eh2ap8tgodgp.js +224 -0
  120. package/out/_next/static/chunks/1eq7kau-2figm.js +81 -0
  121. package/out/_next/static/chunks/1h9sc720aq7zm.js +5 -0
  122. package/out/_next/static/chunks/1i-6ya37cs5-w.js +116 -0
  123. package/out/_next/static/chunks/1igwz8p4ycvw8.js +68 -0
  124. package/out/_next/static/chunks/1kti-rwl34_4h.js +194 -0
  125. package/out/_next/static/chunks/{2ho4591ngh3y2.js → 1l_4m35yky3vy.js} +6 -6
  126. package/out/_next/static/chunks/1n3dc-2mpab65.js +39 -0
  127. package/out/_next/static/chunks/1nmwo96drt-k-.js +18 -0
  128. package/out/_next/static/chunks/1o2f_mtcw23zu.js +7 -0
  129. package/out/_next/static/chunks/1p6gh68l05_ak.js +1 -0
  130. package/out/_next/static/chunks/1sf71q2hkno8s.js +43 -0
  131. package/out/_next/static/chunks/{1gqd9vrno0rq4.js → 1u0hy0trwf8uk.js} +2 -2
  132. package/out/_next/static/chunks/1w22i299136_d.js +5 -0
  133. package/out/_next/static/chunks/1w69w7bav5fw7.js +5 -0
  134. package/out/_next/static/chunks/1xjtni6_z8nxp.js +15 -0
  135. package/out/_next/static/chunks/1y-db7_k0jgmb.js +1 -0
  136. package/out/_next/static/chunks/1y7wv_pb43doo.js +31 -0
  137. package/out/_next/static/chunks/1y84xua0xgwrn.js +39 -0
  138. package/out/_next/static/chunks/1yqexzm6_8pjh.js +71 -0
  139. package/out/_next/static/chunks/1zsrg53se30e4.js +7 -0
  140. package/out/_next/static/chunks/2-e86kt6vo58k.js +24 -0
  141. package/out/_next/static/chunks/2-lj_k3ewua_k.js +71 -0
  142. package/out/_next/static/chunks/2-omz_z29hp_j.js +1 -0
  143. package/out/_next/static/chunks/21hoklicpietg.js +41 -0
  144. package/out/_next/static/chunks/22kqizuxl67c-.js +108 -0
  145. package/out/_next/static/chunks/22odam86c8kps.js +1 -0
  146. package/out/_next/static/chunks/23wfelj92rx3n.js +1 -0
  147. package/out/_next/static/chunks/259obwu0l4d7_.js +8 -0
  148. package/out/_next/static/chunks/{22-o32hlte36e.js → 25k-q1asg1of_.js} +6 -6
  149. package/out/_next/static/chunks/28cyd6sk-kr-8.js +8 -0
  150. package/out/_next/static/chunks/{3vgurvjr6hkyv.js → 29j-tq9ymqima.js} +1 -1
  151. package/out/_next/static/chunks/29lz37yh8ev4g.js +267 -0
  152. package/out/_next/static/chunks/29qzk6rf1oo1g.js +8 -0
  153. package/out/_next/static/chunks/2_0nlvri-u3yb.js +5 -0
  154. package/out/_next/static/chunks/2_ebmmbmnfung.js +5 -0
  155. package/out/_next/static/chunks/2_nlmvpwjvbuc.js +1 -0
  156. package/out/_next/static/chunks/2abvgs_fkmp8g.js +12 -0
  157. package/out/_next/static/chunks/2ad3aff-kd860.js +16 -0
  158. package/out/_next/static/chunks/2asfqwl1f6ptd.js +71 -0
  159. package/out/_next/static/chunks/2bo7flfdpsojx.js +1 -0
  160. package/out/_next/static/chunks/2c3pj-ifdt9sv.js +8 -0
  161. package/out/_next/static/chunks/2cdf8zir46fgf.js +6 -0
  162. package/out/_next/static/chunks/{1_55km6vm5mc0.js → 2dem0g4wrt39t.js} +5 -5
  163. package/out/_next/static/chunks/{153ec1_-yt3jb.js → 2dg0lloufpbdb.js} +5 -5
  164. package/out/_next/static/chunks/2e-u5srw2p0n6.js +23 -0
  165. package/out/_next/static/chunks/2fxjo2s_nsjsa.js +5 -0
  166. package/out/_next/static/chunks/2gfl5yx5-dzk7.js +5 -0
  167. package/out/_next/static/chunks/2gqvhjmjfypz9.js +6 -0
  168. package/out/_next/static/chunks/2hqwx9e8xxk58.js +1 -0
  169. package/out/_next/static/chunks/2hthxhwh84ls1.css +1 -0
  170. package/out/_next/static/chunks/2jro0zgoal0kz.js +39 -0
  171. package/out/_next/static/chunks/2khmu80rhpzi0.js +7 -0
  172. package/out/_next/static/chunks/2luj-95aqr25b.js +1 -0
  173. package/out/_next/static/chunks/2mohqnh8393k0.js +935 -0
  174. package/out/_next/static/chunks/{11ehf3t7qzbua.js → 2ozm0eim2f3sc.js} +1 -1
  175. package/out/_next/static/chunks/2pass0agqwhhu.js +30 -0
  176. package/out/_next/static/chunks/2q16yoj85f5--.js +217 -0
  177. package/out/_next/static/chunks/2qgzju2ps7tn2.js +5 -0
  178. package/out/_next/static/chunks/2qmtn9qs15pe6.js +23 -0
  179. package/out/_next/static/chunks/2starzmj1ng6d.js +13 -0
  180. package/out/_next/static/chunks/2tltorbhbyodj.js +1 -0
  181. package/out/_next/static/chunks/2u8vf0tm3oweg.js +145 -0
  182. package/out/_next/static/chunks/2xq9wvqdb609r.js +1 -0
  183. package/out/_next/static/chunks/2ye-zd_107wh_.js +6 -0
  184. package/out/_next/static/chunks/2yttr5mp9mh23.js +171 -0
  185. package/out/_next/static/chunks/2z6e-_lzi04v4.js +149 -0
  186. package/out/_next/static/chunks/2z_zbj33aeywz.js +5 -0
  187. package/out/_next/static/chunks/2zq9_3p7cg3wb.js +9 -0
  188. package/out/_next/static/chunks/2zuoqtb2013in.js +7 -0
  189. package/out/_next/static/chunks/302pe6kwodzps.js +31 -0
  190. package/out/_next/static/chunks/30c42kdwlkc30.js +7 -0
  191. package/out/_next/static/chunks/30jqt_vus0ht9.js +1 -0
  192. package/out/_next/static/chunks/30lj8m3h07k4v.js +1 -0
  193. package/out/_next/static/chunks/3328j3xx0enu_.js +1 -0
  194. package/out/_next/static/chunks/339grcmrh2be_.js +1 -0
  195. package/out/_next/static/chunks/33pzdslirf1vx.js +6 -0
  196. package/out/_next/static/chunks/33s24dpx0eo63.js +2 -0
  197. package/out/_next/static/chunks/33w88h3hbfzbk.js +1 -0
  198. package/out/_next/static/chunks/35wqmtcm47y_w.js +39 -0
  199. package/out/_next/static/chunks/36o0xcj8l-mau.js +9 -0
  200. package/out/_next/static/chunks/37lm6c8w-c7bs.js +5 -0
  201. package/out/_next/static/chunks/37y01hdz8sxhr.js +1 -0
  202. package/out/_next/static/chunks/38op2tjm2a38-.js +10 -0
  203. package/out/_next/static/chunks/398z-133dgtem.js +14 -0
  204. package/out/_next/static/chunks/39_3a5rlqmxjd.js +5 -0
  205. package/out/_next/static/chunks/3admj5_pwyksw.js +1 -0
  206. package/out/_next/static/chunks/3c7j6t3by9tj7.js +155 -0
  207. package/out/_next/static/chunks/3cyj5euwvlu1t.js +1 -0
  208. package/out/_next/static/chunks/3d8yko5j3oni7.js +100 -0
  209. package/out/_next/static/chunks/3de9en65e-2qx.js +1 -0
  210. package/out/_next/static/chunks/3f_aw3x3h5zrb.js +54 -0
  211. package/out/_next/static/chunks/3fdcfxfy7_ijd.js +5 -0
  212. package/out/_next/static/chunks/3g-zjnc7_4583.js +1 -0
  213. package/out/_next/static/chunks/3h22kt6ngwxji.js +12 -0
  214. package/out/_next/static/chunks/3id1esivwnwn0.js +5 -0
  215. package/out/_next/static/chunks/{3fqonijzsxy8u.js → 3jy48b2yol0pg.js} +1 -1
  216. package/out/_next/static/chunks/3k_w16w3eoy6p.js +7 -0
  217. package/out/_next/static/chunks/3ks-dq47wvmwf.js +5 -0
  218. package/out/_next/static/chunks/3lch4_9c5hsbw.js +5 -0
  219. package/out/_next/static/chunks/3lirqns-0nf0z.js +5 -0
  220. package/out/_next/static/chunks/{1hviha1jcz_og.js → 3o83hyi0qcw6f.js} +1 -1
  221. package/out/_next/static/chunks/3ot810y4c4j5w.js +7 -0
  222. package/out/_next/static/chunks/3q2g8_47dz6k3.js +95 -0
  223. package/out/_next/static/chunks/{0q2e8h8498pvo.js → 3qqhr2o1soxh_.js} +1 -1
  224. package/out/_next/static/chunks/3s0alhaimym6o.js +61 -0
  225. package/out/_next/static/chunks/3sull2f3eleju.js +6 -0
  226. package/out/_next/static/chunks/3tzv_v3fezh8p.js +1 -0
  227. package/out/_next/static/chunks/3uekb_s0jaboj.js +1 -0
  228. package/out/_next/static/chunks/3xtawjchyn0qb.js +1 -0
  229. package/out/_next/static/chunks/3xze13c1irm_5.js +1 -0
  230. package/out/_next/static/chunks/3z14p5htgyrv9.js +7 -0
  231. package/out/_next/static/chunks/40vdr7s_c0h75.js +8 -0
  232. package/out/_next/static/chunks/41184_al87--k.js +46 -0
  233. package/out/_next/static/chunks/42iy04ceb32i1.js +5 -0
  234. package/out/_next/static/chunks/438vgwwahfwwj.js +54 -0
  235. package/out/_next/static/chunks/44l-287ai2bc0.js +12 -0
  236. package/out/_next/static/chunks/44p9j-nopxm66.js +1 -0
  237. package/out/_next/static/chunks/{turbopack-2c3mg3r-05n1w.js → turbopack-077hmtqrhcoji.js} +1 -1
  238. package/out/_offline/index.html +3 -3
  239. package/out/account/forgot-password/index.html +3 -3
  240. package/out/account/index.html +3 -3
  241. package/out/assortments/AssortmentDetailPage/index.html +3 -3
  242. package/out/assortments/index.html +3 -3
  243. package/out/assortments/new/index.html +3 -3
  244. package/out/copilot/index.html +3 -3
  245. package/out/country/CountryDetailPage/index.html +3 -3
  246. package/out/country/index.html +3 -3
  247. package/out/country/new/index.html +3 -3
  248. package/out/currency/CurrencyDetailPage/index.html +3 -3
  249. package/out/currency/index.html +3 -3
  250. package/out/currency/new/index.html +3 -3
  251. package/out/delivery-provider/DeliveryProviderDetailPage/index.html +3 -3
  252. package/out/delivery-provider/index.html +3 -3
  253. package/out/delivery-provider/new/index.html +3 -3
  254. package/out/enrollments/EnrollmentDetailPage/index.html +3 -3
  255. package/out/enrollments/index.html +3 -3
  256. package/out/events/EventDetailPage/index.html +3 -3
  257. package/out/events/index.html +3 -3
  258. package/out/exports/index.html +3 -3
  259. package/out/external/index.html +3 -3
  260. package/out/filters/FilterDetailPage/index.html +3 -3
  261. package/out/filters/index.html +3 -3
  262. package/out/filters/new/index.html +3 -3
  263. package/out/index.html +3 -3
  264. package/out/install/index.html +3 -3
  265. package/out/language/LanguageDetailPage/index.html +3 -3
  266. package/out/language/index.html +3 -3
  267. package/out/language/new/index.html +3 -3
  268. package/out/log-in/index.html +3 -3
  269. package/out/orders/OrderDetailPage/index.html +3 -3
  270. package/out/orders/index.html +3 -3
  271. package/out/payment-provider/PaymentProviderDetailPage/index.html +3 -3
  272. package/out/payment-provider/index.html +3 -3
  273. package/out/payment-provider/new/index.html +3 -3
  274. package/out/products/ProductDetailPage/index.html +3 -3
  275. package/out/products/index.html +3 -3
  276. package/out/products/new/index.html +3 -3
  277. package/out/quotations/QuotationDetailPage/index.html +3 -3
  278. package/out/quotations/index.html +3 -3
  279. package/out/reset-password/index.html +3 -3
  280. package/out/sign-up/index.html +3 -3
  281. package/out/styleguide/index.html +3 -3
  282. package/out/tokens/TokenDetailPage/index.html +3 -3
  283. package/out/tokens/index.html +3 -3
  284. package/out/users/UserDetailPage/index.html +3 -3
  285. package/out/users/index.html +3 -3
  286. package/out/users/new/index.html +3 -3
  287. package/out/verify-email/index.html +3 -3
  288. package/out/warehousing-provider/WarehousingProviderDetailPage/index.html +3 -3
  289. package/out/warehousing-provider/index.html +3 -3
  290. package/out/warehousing-provider/new/index.html +3 -3
  291. package/out/works/WorkDetailPage/index.html +3 -3
  292. package/out/works/WorkQueueListView/index.html +3 -3
  293. package/out/works/index.html +3 -3
  294. package/out/works/management/index.html +3 -3
  295. package/package.json +26 -26
  296. package/out/_next/static/chunks/0-_s79k4_7ei_.js +0 -5
  297. package/out/_next/static/chunks/00aks9rqke2x0.js +0 -7
  298. package/out/_next/static/chunks/00az81dk4vdda.js +0 -54
  299. package/out/_next/static/chunks/01e4gd649r2tq.js +0 -7
  300. package/out/_next/static/chunks/01j2wi94k90x0.js +0 -5
  301. package/out/_next/static/chunks/043i-g05cyvrd.js +0 -1
  302. package/out/_next/static/chunks/04kyktzbxprj0.js +0 -61
  303. package/out/_next/static/chunks/05p330iybjojg.js +0 -44
  304. package/out/_next/static/chunks/05qk8ozexvlxp.js +0 -5
  305. package/out/_next/static/chunks/06i50j458a7g5.js +0 -12
  306. package/out/_next/static/chunks/08o61gwabp3h1.js +0 -33
  307. package/out/_next/static/chunks/0_bvgo8ev4gs7.js +0 -7
  308. package/out/_next/static/chunks/0b05sca2hdcys.js +0 -30
  309. package/out/_next/static/chunks/0bc8hmxlcg6h5.js +0 -18
  310. package/out/_next/static/chunks/0c3kwkqr9evm4.js +0 -5
  311. package/out/_next/static/chunks/0c4jv8pwvpxei.js +0 -1
  312. package/out/_next/static/chunks/0c7ljn9lo_0oh.js +0 -5
  313. package/out/_next/static/chunks/0djb38xrt32ao.js +0 -12
  314. package/out/_next/static/chunks/0drw_p7p-jjq1.js +0 -5
  315. package/out/_next/static/chunks/0ewr86ctcw7fx.js +0 -1
  316. package/out/_next/static/chunks/0hz0qu27uks3z.js +0 -8
  317. package/out/_next/static/chunks/0jham55cr3rhy.js +0 -81
  318. package/out/_next/static/chunks/0lr7o7tyjmrmf.js +0 -8
  319. package/out/_next/static/chunks/0mx8opz23nwlb.js +0 -5
  320. package/out/_next/static/chunks/0o0e82-3pc7ur.js +0 -78
  321. package/out/_next/static/chunks/0ohk7l49gjm62.js +0 -5
  322. package/out/_next/static/chunks/0p31l6a9hynnt.js +0 -6
  323. package/out/_next/static/chunks/0qa-zbgmv-k3p.js +0 -9
  324. package/out/_next/static/chunks/0rzjz052fwjjc.js +0 -12
  325. package/out/_next/static/chunks/0skst735jufgh.js +0 -71
  326. package/out/_next/static/chunks/0t28q5fb2jp-6.js +0 -8
  327. package/out/_next/static/chunks/0tmamaq8exyij.js +0 -1
  328. package/out/_next/static/chunks/0ydy3ky15gx62.js +0 -1
  329. package/out/_next/static/chunks/0zh311lu9jf2x.js +0 -5
  330. package/out/_next/static/chunks/0zpyyygbqx3pf.js +0 -152
  331. package/out/_next/static/chunks/10m_etq9t2pkv.js +0 -7
  332. package/out/_next/static/chunks/16le3cqxj12u6.js +0 -5
  333. package/out/_next/static/chunks/16zxfacsu_jbq.js +0 -1
  334. package/out/_next/static/chunks/170d-jbu8ilzu.js +0 -100
  335. package/out/_next/static/chunks/17fibl49qtd6c.js +0 -8
  336. package/out/_next/static/chunks/182l1mlbf0glb.js +0 -1
  337. package/out/_next/static/chunks/18xyj4i_i5lyn.js +0 -6
  338. package/out/_next/static/chunks/1a9-pdm78ri7r.js +0 -1
  339. package/out/_next/static/chunks/1aej6iqnlr74p.js +0 -1
  340. package/out/_next/static/chunks/1asbed4hne69c.js +0 -7
  341. package/out/_next/static/chunks/1c60nzy_x4kez.js +0 -277
  342. package/out/_next/static/chunks/1c77vl6xdqfd4.js +0 -15
  343. package/out/_next/static/chunks/1da89agg-nacc.js +0 -224
  344. package/out/_next/static/chunks/1epju6xepfqtq.js +0 -2
  345. package/out/_next/static/chunks/1fbsyczyh9hwh.js +0 -1
  346. package/out/_next/static/chunks/1hih2cxmgqcd3.js +0 -10
  347. package/out/_next/static/chunks/1il9vuoxtb2_n.js +0 -43
  348. package/out/_next/static/chunks/1jaatdt0mlypl.js +0 -16
  349. package/out/_next/static/chunks/1l4g6_of_bbr8.js +0 -5
  350. package/out/_next/static/chunks/1lezxecnoaxnn.js +0 -32
  351. package/out/_next/static/chunks/1m27au_nmk8_k.js +0 -71
  352. package/out/_next/static/chunks/1m4fwgl1mj4d-.js +0 -46
  353. package/out/_next/static/chunks/1ma82ip9shpkc.js +0 -24
  354. package/out/_next/static/chunks/1nbh1zkzirnuw.js +0 -1
  355. package/out/_next/static/chunks/1nohf8_cc6gmw.js +0 -9
  356. package/out/_next/static/chunks/1os6pvhjeb16o.js +0 -1
  357. package/out/_next/static/chunks/1r0w-hk6d2kqw.js +0 -15
  358. package/out/_next/static/chunks/1rsexg6dg82f0.js +0 -7
  359. package/out/_next/static/chunks/1u79pcgqjgjpq.js +0 -1
  360. package/out/_next/static/chunks/1uqiaqtv_0v2x.js +0 -5
  361. package/out/_next/static/chunks/1x8o-luxdxxk7.js +0 -1
  362. package/out/_next/static/chunks/1yjb7gogaf8po.js +0 -31
  363. package/out/_next/static/chunks/1zyhzessv0wtg.js +0 -1
  364. package/out/_next/static/chunks/2-pl31kdikt3k.js +0 -5
  365. package/out/_next/static/chunks/20c4_1i5r3kkz.js +0 -1
  366. package/out/_next/static/chunks/20zdaln201w8j.js +0 -277
  367. package/out/_next/static/chunks/21l46nbaop06z.js +0 -39
  368. package/out/_next/static/chunks/231j2_p-ha14w.js +0 -7
  369. package/out/_next/static/chunks/23s2f7_-ol94s.js +0 -8
  370. package/out/_next/static/chunks/25frktmrq-xu0.js +0 -1
  371. package/out/_next/static/chunks/26_mx-ritu68j.js +0 -24
  372. package/out/_next/static/chunks/26ckmxeluyknq.js +0 -1
  373. package/out/_next/static/chunks/26r0y7ldf3iqs.js +0 -6
  374. package/out/_next/static/chunks/27fzoozwycagi.js +0 -6
  375. package/out/_next/static/chunks/27jmq7a-vh0b4.js +0 -7
  376. package/out/_next/static/chunks/283567a82x9qi.js +0 -149
  377. package/out/_next/static/chunks/29he8uukp5s4u.js +0 -31
  378. package/out/_next/static/chunks/2adglo0sf0jcg.js +0 -905
  379. package/out/_next/static/chunks/2ajr0rk0_yax6.js +0 -1
  380. package/out/_next/static/chunks/2b4ewxxz6f462.js +0 -7
  381. package/out/_next/static/chunks/2bh2dv7j9m8c8.css +0 -1
  382. package/out/_next/static/chunks/2bi8v13lm76lr.js +0 -95
  383. package/out/_next/static/chunks/2burvpf9877y_.js +0 -44
  384. package/out/_next/static/chunks/2cclew3l28rc4.js +0 -14
  385. package/out/_next/static/chunks/2cj703xtrf5i6.js +0 -46
  386. package/out/_next/static/chunks/2ec7xatyld40t.js +0 -7
  387. package/out/_next/static/chunks/2iy0jr00qhq-q.js +0 -5
  388. package/out/_next/static/chunks/2m0rrts8gwqwp.js +0 -1
  389. package/out/_next/static/chunks/2m_u12ggzosat.js +0 -5
  390. package/out/_next/static/chunks/2mdns56l5antm.js +0 -5
  391. package/out/_next/static/chunks/2mrbytgs3uetd.js +0 -4
  392. package/out/_next/static/chunks/2olb298bph2yc.js +0 -13
  393. package/out/_next/static/chunks/2p9gwjxeui1zd.js +0 -71
  394. package/out/_next/static/chunks/2pfhy9qy_cijn.js +0 -5
  395. package/out/_next/static/chunks/2q5k4rozyr2wt.js +0 -4
  396. package/out/_next/static/chunks/2qx8nnki_qv5v.js +0 -171
  397. package/out/_next/static/chunks/2r_rj84l3cy7r.js +0 -119
  398. package/out/_next/static/chunks/2swxmzb-xk_bo.js +0 -108
  399. package/out/_next/static/chunks/2t0biwx5e_4w_.js +0 -1
  400. package/out/_next/static/chunks/2ts3v72jkbcdr.js +0 -7
  401. package/out/_next/static/chunks/2vfexvltv2avy.js +0 -5
  402. package/out/_next/static/chunks/2wkg65dtx56je.js +0 -155
  403. package/out/_next/static/chunks/2xixk0t9e9mnw.js +0 -1
  404. package/out/_next/static/chunks/2xz7hnr9ikqzq.js +0 -7
  405. package/out/_next/static/chunks/2y1lq1efnvcdt.js +0 -23
  406. package/out/_next/static/chunks/2ziasg8l_c9n7.js +0 -5
  407. package/out/_next/static/chunks/3-wsablhqgzoa.js +0 -1
  408. package/out/_next/static/chunks/30ppb2wc-m4ph.js +0 -1
  409. package/out/_next/static/chunks/336k08jwyc5i-.js +0 -1
  410. package/out/_next/static/chunks/33_-2ne9ecvay.js +0 -1
  411. package/out/_next/static/chunks/33d061qpkafqm.js +0 -39
  412. package/out/_next/static/chunks/33fyy6d5mo55_.js +0 -8
  413. package/out/_next/static/chunks/33kh18frqc3b1.js +0 -5
  414. package/out/_next/static/chunks/33qeilxkl3ckn.js +0 -116
  415. package/out/_next/static/chunks/33tewe5d_lfl-.js +0 -13
  416. package/out/_next/static/chunks/33v05ol-ire9s.js +0 -10
  417. package/out/_next/static/chunks/348l8p7-vo4l5.js +0 -63
  418. package/out/_next/static/chunks/35hu5vin0swdf.js +0 -41
  419. package/out/_next/static/chunks/37a6yquh875rn.js +0 -39
  420. package/out/_next/static/chunks/3_2i9du5-ffrp.js +0 -59
  421. package/out/_next/static/chunks/3_84h3z_tewmg.js +0 -145
  422. package/out/_next/static/chunks/3bo7uiy-wh63m.js +0 -108
  423. package/out/_next/static/chunks/3c-an5ft_3emc.js +0 -1
  424. package/out/_next/static/chunks/3d_222ci0_30_.js +0 -41
  425. package/out/_next/static/chunks/3dldch03dfaed.js +0 -1
  426. package/out/_next/static/chunks/3eedy49gsvv_t.js +0 -1
  427. package/out/_next/static/chunks/3fayuejnrsd90.js +0 -15
  428. package/out/_next/static/chunks/3g1ale0hytu9q.js +0 -12
  429. package/out/_next/static/chunks/3i9q2-4e0mix5.js +0 -12
  430. package/out/_next/static/chunks/3k3gvr7-e3g_s.js +0 -5
  431. package/out/_next/static/chunks/3kwoyyxi_-q7m.js +0 -1
  432. package/out/_next/static/chunks/3le1bywe19_u9.js +0 -1
  433. package/out/_next/static/chunks/3lku4-9kpf-mj.js +0 -267
  434. package/out/_next/static/chunks/3lz5h1tw50wr_.js +0 -54
  435. package/out/_next/static/chunks/3m4smrmdqi2-3.js +0 -5
  436. package/out/_next/static/chunks/3oq-khgfpo0nx.js +0 -39
  437. package/out/_next/static/chunks/3ps25ocfalcap.js +0 -43
  438. package/out/_next/static/chunks/3r0i-7zjuz9i1.js +0 -6
  439. package/out/_next/static/chunks/3rgn5xwtr51ul.js +0 -7
  440. package/out/_next/static/chunks/3ridg_u19b6ih.js +0 -8
  441. package/out/_next/static/chunks/3skzk-w2ytvku.js +0 -5
  442. package/out/_next/static/chunks/3srw10h0hcztd.js +0 -68
  443. package/out/_next/static/chunks/3tgrftdet8sna.js +0 -15
  444. package/out/_next/static/chunks/3uax_eq1kjjta.js +0 -1
  445. package/out/_next/static/chunks/3uj94afpsi6cs.js +0 -1
  446. package/out/_next/static/chunks/3viepyovs19ub.js +0 -23
  447. package/out/_next/static/chunks/3vnzp3n_wd3j_.js +0 -1
  448. package/out/_next/static/chunks/3w8h5lxnd0z4z.js +0 -1
  449. package/out/_next/static/chunks/3wh4xa9dnw-55.js +0 -194
  450. package/out/_next/static/chunks/3wzvscqui-9ml.js +0 -23
  451. package/out/_next/static/chunks/3y8h3g1tqukrv.js +0 -36
  452. package/out/_next/static/chunks/3zcilnj6p9-t5.js +0 -1
  453. package/out/_next/static/chunks/3zmmdm68s05-t.js +0 -217
  454. package/out/_next/static/chunks/3zw4-oie-f7_0.js +0 -2
  455. package/out/_next/static/chunks/417kn9hki8k81.js +0 -33
  456. package/out/_next/static/chunks/42mofxcd0l7qi.js +0 -1
  457. package/out/_next/static/chunks/43hfssep7ry-z.js +0 -5
  458. package/out/_next/static/chunks/45bcpjurhxb-j.js +0 -1
  459. package/out/_next/static/nrNmgRi1nHylx_8lvjG2D/_buildManifest.js +0 -258
  460. /package/out/_next/static/{nrNmgRi1nHylx_8lvjG2D → TwsufYu8Ldt9ZNxtvzshp}/_clientMiddlewareManifest.js +0 -0
  461. /package/out/_next/static/{nrNmgRi1nHylx_8lvjG2D → TwsufYu8Ldt9ZNxtvzshp}/_ssgManifest.js +0 -0
package/dist/form.js CHANGED
@@ -1,15 +1,15 @@
1
- import { TextField_default } from './chunk-BMDNY67T.js';
2
- export { FormErrors_default as FormErrors, MarkdownTextAreaField_default as MarkdownTextAreaField, TextField_default as TextField } from './chunk-BMDNY67T.js';
3
- import { Z, l, b, u2, V, Ae, j, L, S as S$1, c as c$1, s, N, $0c4a58759813079a$export$4e328f61c538687f, $e969f22b6713ca4a$export$ae780daf29e6d456, w, e, u as u$1, Fe, ye, Re, Te, w2, u4, s2, g2, u3 as u3$1, p as p$1, c2 as c2$1, f, a as a$1, JSONView_default } from './chunk-PJLYVMUM.js';
4
- import { HelpText_default, FieldWrapper_default, clsx_default, Badge_default, ChevronUpDownIcon_default, CheckIcon_default } from './chunk-HJKRGBDG.js';
5
- export { FieldWrapper_default as FieldWrapper, Form_default as Form, SubmitButton_default as SubmitButton, TagInputField_default as TagInputField } from './chunk-HJKRGBDG.js';
1
+ import { TextField_default } from './chunk-PGJTFYBT.js';
2
+ export { FormErrors_default as FormErrors, MarkdownTextAreaField_default as MarkdownTextAreaField, TextField_default as TextField } from './chunk-PGJTFYBT.js';
3
+ import { Z, l, b, u2, V, Ae, j, L, S as S$1, c as c$1, s, N, $0c4a58759813079a$export$4e328f61c538687f, $e969f22b6713ca4a$export$ae780daf29e6d456, w, e, u as u$1, Fe, ye, Re, Te, w2, u4, s2, g2, u3 as u3$1, p as p$1, c2 as c2$1, f, a as a$1, JSONView_default } from './chunk-4MXPTVDL.js';
4
+ import { HelpText_default, FieldWrapper_default, clsx_default, Badge_default, ChevronUpDownIcon_default, CheckIcon_default } from './chunk-GWMLIF3C.js';
5
+ export { FieldWrapper_default as FieldWrapper, Form_default as Form, SubmitButton_default as SubmitButton, TagInputField_default as TagInputField } from './chunk-GWMLIF3C.js';
6
6
  import './chunk-ZUOVKRKC.js';
7
- import { useField_default, validateMaxLength, validateDate, validateEmail } from './chunk-I64TXIE7.js';
7
+ import { useField_default, validateMaxLength, validateDate, validateEmail } from './chunk-ATZJXTRA.js';
8
8
  import './chunk-HERLM47Z.js';
9
- import { m, n as n$1, E } from './chunk-FDHXLNZQ.js';
10
- import { A, Y, r, a, o2, u, S, n, x, k3 as k3$1, n2, K, c, i3, y, n3, o4, V as V$1, p, d, w as w$1, u2 as u2$1, u3, N as N$1, p2, f2, y2, x2, le, s as s$1, o, n4, c2, l2, l as l$1, T, k2, G } from './chunk-QHR23GVH.js';
9
+ import { m, n as n$1, E } from './chunk-EAVP6XZQ.js';
10
+ import { A, Y, r, a, o2, u, S, n, x, k3 as k3$1, n2, K, c, i3, y, n3, o4, V as V$1, p, d, w as w$1, u2 as u2$1, u3, N as N$1, p2, f2, y2, x2, le, s as s$1, o, n4, c2, l2, l as l$1, T, k2, G } from './chunk-CUYIP5XG.js';
11
11
  import './chunk-J23QSWDL.js';
12
- import './chunk-WPLOTFGW.js';
12
+ import './chunk-2HTCKO4E.js';
13
13
  import { jsxs, jsx, Fragment as Fragment$1 } from 'react/jsx-runtime';
14
14
  import * as L2 from 'react';
15
15
  import L2__default, { createContext, useRef, useCallback, useMemo, Fragment, useState, useContext, useEffect } from 'react';
@@ -556,7 +556,86 @@ var debounce = (targetWindow, fn, ms) => {
556
556
  );
557
557
  };
558
558
 
559
- // ../node_modules/@tanstack/virtual-core/dist/esm/index.js
559
+ // ../node_modules/@tanstack/virtual-core/dist/esm/scroll-classifier.js
560
+ function classifyScrollEvent({
561
+ offset,
562
+ isScrolling,
563
+ elementMax,
564
+ holdOffset,
565
+ scrollOffset,
566
+ pendingWrite,
567
+ clampedMaxAtWrite
568
+ }) {
569
+ var _a;
570
+ if (isScrolling && pendingWrite === null && offset === scrollOffset) {
571
+ return "spurious";
572
+ }
573
+ if (pendingWrite !== null && Math.abs(offset - pendingWrite.target) < 1.5) {
574
+ return "readBack";
575
+ }
576
+ if (pendingWrite !== null && !pendingWrite.smooth && elementMax !== null && pendingWrite.target > elementMax + holdOffset + 0.5 && Math.abs(offset - (elementMax + holdOffset)) < 1.5) {
577
+ return "clampedReadBack";
578
+ }
579
+ if (pendingWrite !== null && !pendingWrite.smooth && ((_a = pendingWrite.lowMaxes) == null ? void 0 : _a.some((max) => Math.abs(offset - max) < 1.5))) {
580
+ return "clampedReadBack";
581
+ }
582
+ if (clampedMaxAtWrite !== null && Math.abs(offset - clampedMaxAtWrite) < 1.5) {
583
+ return "clampedEcho";
584
+ }
585
+ return "external";
586
+ }
587
+ var isAnimating = (phase) => phase === "smooth" || phase === "smoothFinishing";
588
+ function externalRetiresCommand({
589
+ kind,
590
+ offset,
591
+ command,
592
+ target
593
+ }) {
594
+ return kind !== "spurious" && kind !== "readBack" && // Our own write, clamped (`clampedReadBack`, #1310): the command is not
595
+ // retired by it, and reconcile retargets below the new max.
596
+ kind !== "clampedReadBack" && (command == null ? void 0 : command.index) != null && // Nothing has been written for a command waiting for the tail; these
597
+ // are the fling's events.
598
+ command.phase !== "queued" && // A non-smooth write lands at once, so any other scroll event is the
599
+ // user's, even before reconcile saw the target reached (the target may
600
+ // keep moving, or iOS ignored the write under a finger). A write the
601
+ // browser clamped because the sizer hasn't grown yet reads back at the
602
+ // max, which is also where the fresh target clamps, so the check below
603
+ // keeps it reconciling (#1294). While a smooth scroll's animation may
604
+ // still report, its events look like a user's, so it yields only once it
605
+ // has landed.
606
+ !isAnimating(command.phase) && !approxEqual(offset, command.lastTargetOffset) && !approxEqual(offset, target()) && // A compensation write's clamped echo (#1258) keeps the command. The
607
+ // order is deliberate, not tidiness: this clause stays after `target()`
608
+ // (and `clampedReadBack` before it) because `target()` can rebuild the
609
+ // measurements, so it must run for exactly the events it always did.
610
+ kind !== "clampedEcho";
611
+ }
612
+ var FLING_WINDOW_MS = 40;
613
+ function flingSpedUp(samples) {
614
+ const last = samples[samples.length - 1];
615
+ if (last === void 0) return false;
616
+ let j3 = samples.length - 2;
617
+ while (j3 >= 0 && last.t - samples[j3].t < FLING_WINDOW_MS) j3--;
618
+ if (j3 < 0) return false;
619
+ const mid = samples[j3];
620
+ let k4 = j3 - 1;
621
+ while (k4 >= 0 && mid.t - samples[k4].t < FLING_WINDOW_MS) k4--;
622
+ if (k4 < 0) return false;
623
+ const first = samples[k4];
624
+ const recent = (last.offset - mid.offset) / (last.t - mid.t);
625
+ const before = (mid.offset - first.offset) / (mid.t - first.t);
626
+ return recent * before >= 0 && Math.abs(recent) >= 2 * Math.abs(before) && Math.abs(recent) - Math.abs(before) >= 0.8;
627
+ }
628
+ function flingCaught(samples) {
629
+ const last = samples[samples.length - 1];
630
+ if (last === void 0) return false;
631
+ let j3 = samples.length - 2;
632
+ while (j3 >= 0 && last.t - samples[j3].t < FLING_WINDOW_MS) j3--;
633
+ if (j3 < 0) return false;
634
+ const from = samples[j3];
635
+ return Math.abs(last.offset - from.offset) / (last.t - from.t) >= 0.05;
636
+ }
637
+
638
+ // ../node_modules/@tanstack/virtual-core/dist/esm/ios-gesture.js
560
639
  var _isIOSResult;
561
640
  var isIOSWebKit = () => {
562
641
  if (_isIOSResult !== void 0) return _isIOSResult;
@@ -565,14 +644,144 @@ var isIOSWebKit = () => {
565
644
  const mtp = navigator.maxTouchPoints;
566
645
  return _isIOSResult = navigator.platform === "MacIntel" && mtp !== void 0 && mtp > 0;
567
646
  };
647
+ var _iosMomentumOverridesWritesResult;
648
+ var iosMomentumOverridesWrites = () => {
649
+ if (_iosMomentumOverridesWritesResult !== void 0) {
650
+ return _iosMomentumOverridesWritesResult;
651
+ }
652
+ return _iosMomentumOverridesWritesResult = isIOSWebKit() && typeof CSS !== "undefined" && typeof CSS.supports === "function" && CSS.supports("overflow-anchor: auto");
653
+ };
654
+ var momentumOverridesWrites = () => !isIOSWebKit() || iosMomentumOverridesWrites();
655
+ var touchListenerOptions = {
656
+ capture: true,
657
+ passive: true
658
+ };
659
+ var IosGesture = class {
660
+ constructor(host) {
661
+ this.host = host;
662
+ this._touch = null;
663
+ this.inMotion = () => this._touch !== null && this._touch.phase !== "lateFling";
664
+ this.dragging = () => {
665
+ var _a;
666
+ return ((_a = this._touch) == null ? void 0 : _a.phase) === "down" && this._touch.moved;
667
+ };
668
+ this.tail = () => {
669
+ var _a;
670
+ return ((_a = this._touch) == null ? void 0 : _a.phase) === "tail" ? this._touch.moved ? "fling" : "tap" : null;
671
+ };
672
+ this.onScroll = ({
673
+ isScrolling,
674
+ ownReadBack,
675
+ moved,
676
+ external
677
+ }) => {
678
+ var _a, _b, _c;
679
+ if (isScrolling && ((_a = this._touch) == null ? void 0 : _a.phase) === "tail") {
680
+ this._openTail(this._touch.moved || !ownReadBack, false);
681
+ } else if (((_b = this._touch) == null ? void 0 : _b.phase) === "lateFling") {
682
+ if (this.host.now() > this._touch.until) {
683
+ this._touch = null;
684
+ } else if (external && isScrolling && moved) {
685
+ this._openTail(true, false);
686
+ }
687
+ }
688
+ if (!ownReadBack && isScrolling && moved && ((_c = this._touch) == null ? void 0 : _c.phase) === "down") {
689
+ this._touch.moved = true;
690
+ return true;
691
+ }
692
+ return false;
693
+ };
694
+ this.touchStart = () => {
695
+ this.end();
696
+ this._touch = { phase: "down", moved: false };
697
+ };
698
+ this.touchEnd = () => {
699
+ var _a;
700
+ const moved = ((_a = this._touch) == null ? void 0 : _a.phase) === "down" && this._touch.moved;
701
+ this.end();
702
+ this._openTail(moved, moved);
703
+ };
704
+ this.end = () => {
705
+ var _a;
706
+ const win = this.host.getWindow();
707
+ if (((_a = this._touch) == null ? void 0 : _a.phase) === "tail" && win != null) {
708
+ win.clearTimeout(this._touch.timerId);
709
+ }
710
+ this._touch = null;
711
+ };
712
+ this.listen = (target) => {
713
+ const onTouchStart = () => this.touchStart();
714
+ const onTouchEnd = () => this.touchEnd();
715
+ target.addEventListener("touchstart", onTouchStart, touchListenerOptions);
716
+ target.addEventListener("touchend", onTouchEnd, touchListenerOptions);
717
+ target.addEventListener("touchcancel", onTouchEnd, touchListenerOptions);
718
+ return () => {
719
+ target.removeEventListener(
720
+ "touchstart",
721
+ onTouchStart,
722
+ touchListenerOptions
723
+ );
724
+ target.removeEventListener("touchend", onTouchEnd, touchListenerOptions);
725
+ target.removeEventListener(
726
+ "touchcancel",
727
+ onTouchEnd,
728
+ touchListenerOptions
729
+ );
730
+ this.end();
731
+ };
732
+ };
733
+ this._openTail = (moved, awaitingFling) => {
734
+ const win = this.host.getWindow();
735
+ if (win == null) return;
736
+ this.end();
737
+ const tail = {
738
+ phase: "tail",
739
+ moved,
740
+ awaitingFling,
741
+ // Only fires while this tail is current: `end` clears it otherwise.
742
+ timerId: win.setTimeout(() => {
743
+ if (this.host.tailStillMoving()) {
744
+ this._openTail(tail.moved, tail.awaitingFling);
745
+ return;
746
+ }
747
+ this._touch = tail.awaitingFling ? { phase: "lateFling", until: this.host.now() + 1e3 } : null;
748
+ this.host.onTailClosed();
749
+ }, 150)
750
+ };
751
+ this._touch = tail;
752
+ };
753
+ }
754
+ get touch() {
755
+ return this._touch;
756
+ }
757
+ };
758
+
759
+ // ../node_modules/@tanstack/virtual-core/dist/esm/index.js
568
760
  var getRect = (element) => {
569
- const { offsetWidth, offsetHeight } = element;
570
- return { width: offsetWidth, height: offsetHeight };
761
+ const { clientWidth, clientHeight } = element;
762
+ return { width: clientWidth, height: clientHeight };
763
+ };
764
+ var createFrameQueue = (targetWindow) => {
765
+ const ids = /* @__PURE__ */ new Set();
766
+ return {
767
+ schedule: (fn) => {
768
+ const id = targetWindow.requestAnimationFrame(() => {
769
+ ids.delete(id);
770
+ fn();
771
+ });
772
+ ids.add(id);
773
+ },
774
+ cancel: () => {
775
+ ids.forEach((id) => targetWindow.cancelAnimationFrame(id));
776
+ ids.clear();
777
+ }
778
+ };
571
779
  };
572
780
  var defaultKeyExtractor = (index) => index;
573
781
  var defaultRangeExtractor = (range) => {
574
- const start = Math.max(range.startIndex - range.overscan, 0);
575
- const end = Math.min(range.endIndex + range.overscan, range.count - 1);
782
+ const overscan = range.overscan * Math.max(range.lanes ?? 1, 1);
783
+ const start = Math.max(range.startIndex - overscan, 0);
784
+ const end = Math.min(range.endIndex + overscan, range.count - 1);
576
785
  const len = end - start + 1;
577
786
  const arr = new Array(len);
578
787
  for (let i2 = 0; i2 < len; i2++) {
@@ -598,23 +807,17 @@ var observeElementRect = (instance, cb) => {
598
807
  return () => {
599
808
  };
600
809
  }
601
- const observer = new targetWindow.ResizeObserver((entries) => {
810
+ const frames = createFrameQueue(targetWindow);
811
+ const observer = new targetWindow.ResizeObserver(() => {
602
812
  const run = () => {
603
- const entry = entries[0];
604
- if (entry == null ? void 0 : entry.borderBoxSize) {
605
- const box = entry.borderBoxSize[0];
606
- if (box) {
607
- handler({ width: box.inlineSize, height: box.blockSize });
608
- return;
609
- }
610
- }
611
813
  handler(getRect(element));
612
814
  };
613
- instance.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(run) : run();
815
+ instance.options.useAnimationFrameWithResizeObserver ? frames.schedule(run) : run();
614
816
  });
615
- observer.observe(element, { box: "border-box" });
817
+ observer.observe(element, { box: "content-box" });
616
818
  return () => {
617
819
  observer.unobserve(element);
820
+ frames.cancel();
618
821
  };
619
822
  };
620
823
  var addEventListenerOptions = {
@@ -689,13 +892,18 @@ var scrollWithAdjustments = (offset, {
689
892
  adjustments = 0,
690
893
  behavior
691
894
  }, instance) => {
692
- var _a, _b;
693
- (_b = (_a = instance.scrollElement) == null ? void 0 : _a.scrollTo) == null ? void 0 : _b.call(_a, {
694
- [instance.options.horizontal ? "left" : "top"]: offset + adjustments,
895
+ var _a;
896
+ const { scrollElement, options } = instance;
897
+ const adjustedOffset = offset + adjustments;
898
+ const isRtlElement = options.horizontal && options.isRtl && scrollElement !== null && "ownerDocument" in scrollElement;
899
+ (_a = scrollElement == null ? void 0 : scrollElement.scrollTo) == null ? void 0 : _a.call(scrollElement, {
900
+ [options.horizontal ? "left" : "top"]: isRtlElement ? -adjustedOffset : adjustedOffset,
695
901
  behavior
696
902
  });
697
903
  };
698
904
  var elementScroll = scrollWithAdjustments;
905
+ var initialScrollPhase = (behavior, atTarget) => behavior === "smooth" ? atTarget ? "smoothLanded" : "smooth" : "instant";
906
+ var isSmoothScroll = (state) => (state == null ? void 0 : state.phase) === "smooth" || (state == null ? void 0 : state.phase) === "smoothLanded";
699
907
  function isAppendWithTrim(prevCount, nextCount, getPreviousKey, getNextKey) {
700
908
  if (nextCount === 0) return false;
701
909
  const firstKey = getNextKey(0);
@@ -737,67 +945,144 @@ var Virtualizer = class {
737
945
  this.scrollRect = null;
738
946
  this.scrollOffset = null;
739
947
  this.scrollDirection = null;
740
- this.scrollAdjustments = 0;
741
- this._iosDeferredAdjustment = 0;
742
- this._iosTouching = false;
743
- this._iosJustTouchEnded = false;
744
- this._iosTouchEndTimerId = null;
745
- this._intendedScrollOffset = null;
948
+ this._holdOffset = 0;
949
+ this._reportedOverscroll = false;
950
+ this._iosGesture = new IosGesture({
951
+ getWindow: () => this.targetWindow,
952
+ now: () => this.now(),
953
+ // The end of a fling can move less than a pixel per scroll event, so
954
+ // events can stop for 150ms while the fling is still running (seen on
955
+ // an iPhone, 27.0.1). A command waiting for it would then be written
956
+ // into the fling and overridden. The element having moved since the
957
+ // last event means it has not ended: wait again. Not while our own
958
+ // write has yet to report: that moved it.
959
+ tailStillMoving: () => {
960
+ const state = this.scrollState;
961
+ if ((state == null ? void 0 : state.phase) !== "queued" || this.pendingWrite !== null) {
962
+ return false;
963
+ }
964
+ const now = this._readElementOffset();
965
+ if (now === null || this._lastElementOffset === null || Math.abs(now - this._lastElementOffset) < 1) {
966
+ return false;
967
+ }
968
+ this._lastElementOffset = now;
969
+ state.samples = [...state.samples ?? [], { t: this.now(), offset: now }];
970
+ return true;
971
+ },
972
+ onTailClosed: () => {
973
+ const state = this.scrollState;
974
+ if ((state == null ? void 0 : state.phase) === "queued" && flingCaught(state.samples ?? [])) {
975
+ this.scrollState = null;
976
+ }
977
+ this._flushHoldIfReady(true);
978
+ this._writeAwaitingCommand();
979
+ this._retryClampedAdjustment();
980
+ }
981
+ });
982
+ this._lastElementOffset = null;
983
+ this.pendingWrite = null;
746
984
  this._clampedAdjustment = null;
747
985
  this.elementsCache = /* @__PURE__ */ new Map();
986
+ this._resizeBatch = null;
748
987
  this.now = () => {
749
988
  var _a, _b, _c;
750
989
  return ((_c = (_b = (_a = this.targetWindow) == null ? void 0 : _a.performance) == null ? void 0 : _b.now) == null ? void 0 : _c.call(_b)) ?? Date.now();
751
990
  };
752
991
  this.observer = /* @__PURE__ */ (() => {
753
992
  let _ro = null;
993
+ let _frames = null;
994
+ let delivering = false;
995
+ let observeQueued = false;
996
+ const pendingObservations = /* @__PURE__ */ new Set();
754
997
  const get = () => {
755
998
  if (_ro) {
756
999
  return _ro;
757
1000
  }
758
- if (!this.targetWindow || !this.targetWindow.ResizeObserver) {
1001
+ const targetWindow = this.targetWindow;
1002
+ if (!targetWindow || !targetWindow.ResizeObserver) {
759
1003
  return null;
760
1004
  }
761
- return _ro = new this.targetWindow.ResizeObserver((entries) => {
762
- entries.forEach((entry) => {
763
- const run = () => {
764
- const node = entry.target;
765
- const index = this.indexFromElement(node);
766
- if (!node.isConnected) {
767
- this.observer.unobserve(node);
768
- for (const [cacheKey, cachedNode] of this.elementsCache) {
769
- if (cachedNode === node) {
770
- this.elementsCache.delete(cacheKey);
771
- break;
772
- }
773
- }
774
- return;
1005
+ const frames = _frames = createFrameQueue(targetWindow);
1006
+ return _ro = new targetWindow.ResizeObserver((entries) => {
1007
+ const run = () => {
1008
+ const batch = { sync: false };
1009
+ this._resizeBatch = batch;
1010
+ try {
1011
+ entries.forEach(measureEntry);
1012
+ } finally {
1013
+ this._resizeBatch = null;
1014
+ if (batch.notify) {
1015
+ this.notify(batch.sync);
1016
+ this._noteClampMax();
1017
+ this._flushHoldIfReady(true);
1018
+ this._retryClampedAdjustment();
1019
+ this.measureElement(null);
775
1020
  }
776
- if (!this.isIndexInRange(index)) return;
777
- if (this.shouldMeasureDuringScroll(index)) {
778
- this.resizeItem(
779
- index,
780
- this.options.measureElement(node, entry, this)
781
- );
782
- }
783
- };
784
- this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(run) : run();
785
- });
1021
+ }
1022
+ };
1023
+ if (this.options.useAnimationFrameWithResizeObserver) {
1024
+ frames.schedule(run);
1025
+ } else {
1026
+ delivering = true;
1027
+ try {
1028
+ run();
1029
+ } finally {
1030
+ delivering = false;
1031
+ }
1032
+ }
786
1033
  });
787
1034
  };
1035
+ const measureEntry = (entry) => {
1036
+ const node = entry.target;
1037
+ const index = this.indexFromElement(node);
1038
+ if (!node.isConnected) {
1039
+ this.observer.unobserve(node);
1040
+ for (const [cacheKey, cachedNode] of this.elementsCache) {
1041
+ if (cachedNode === node) {
1042
+ this.elementsCache.delete(cacheKey);
1043
+ break;
1044
+ }
1045
+ }
1046
+ return;
1047
+ }
1048
+ if (!this.isIndexInRange(index)) return;
1049
+ if (this.shouldMeasureDuringScroll(index)) {
1050
+ this.resizeItem(index, this.options.measureElement(node, entry, this));
1051
+ }
1052
+ };
788
1053
  return {
789
1054
  disconnect: () => {
790
1055
  var _a;
791
1056
  (_a = get()) == null ? void 0 : _a.disconnect();
1057
+ _frames == null ? void 0 : _frames.cancel();
1058
+ pendingObservations.clear();
1059
+ observeQueued = false;
792
1060
  _ro = null;
1061
+ _frames = null;
793
1062
  },
794
1063
  observe: (target) => {
795
- var _a;
796
- return (_a = get()) == null ? void 0 : _a.observe(target, { box: "border-box" });
1064
+ const observer = get();
1065
+ if (!observer) return;
1066
+ if (!delivering) {
1067
+ observer.observe(target, { box: "border-box" });
1068
+ return;
1069
+ }
1070
+ pendingObservations.add(target);
1071
+ if (!observeQueued) {
1072
+ observeQueued = true;
1073
+ _frames == null ? void 0 : _frames.schedule(() => {
1074
+ observeQueued = false;
1075
+ pendingObservations.forEach((node) => {
1076
+ if (node.isConnected) _ro == null ? void 0 : _ro.observe(node, { box: "border-box" });
1077
+ });
1078
+ pendingObservations.clear();
1079
+ });
1080
+ }
797
1081
  },
798
1082
  unobserve: (target) => {
799
1083
  var _a;
800
- return (_a = get()) == null ? void 0 : _a.unobserve(target);
1084
+ pendingObservations.delete(target);
1085
+ (_a = get()) == null ? void 0 : _a.unobserve(target);
801
1086
  }
802
1087
  };
803
1088
  })();
@@ -877,9 +1162,8 @@ var Virtualizer = class {
877
1162
  this.pendingMin = 0;
878
1163
  this.itemSizeCacheVersion++;
879
1164
  }
880
- let anchorResolved = false;
881
- let anchorDelta = 0;
882
- if (anchor && this.scrollOffset !== null) {
1165
+ let anchorDelta = null;
1166
+ if (anchor && this.scrollOffset !== null && !this._awaitingCommandReadBack()) {
883
1167
  const [anchorKey, anchorOffset] = anchor;
884
1168
  const newMeasurements = this.getMeasurements();
885
1169
  const { count, getItemKey } = this.options;
@@ -894,18 +1178,19 @@ var Virtualizer = class {
894
1178
  if (!followOnAppend && newOffset !== this.scrollOffset) {
895
1179
  anchorDelta = newOffset - this.scrollOffset;
896
1180
  this.scrollOffset = newOffset;
897
- anchorResolved = true;
898
1181
  }
899
1182
  }
900
1183
  }
901
1184
  }
902
- if (anchorResolved || followOnAppend) {
903
- this.pendingScrollAnchor = [
904
- anchorResolved ? anchor[0] : null,
905
- anchorResolved ? anchor[1] : 0,
906
- followOnAppend,
907
- anchorDelta
908
- ];
1185
+ if (followOnAppend) {
1186
+ this.pendingScrollAnchor = { kind: "follow", behavior: followOnAppend };
1187
+ } else if (anchorDelta !== null) {
1188
+ if (this._canWriteScroll()) {
1189
+ this.pendingScrollAnchor = { kind: "anchor", delta: anchorDelta };
1190
+ } else {
1191
+ this._holdOffset += anchorDelta;
1192
+ this._followOffsetTarget(anchorDelta);
1193
+ }
909
1194
  }
910
1195
  };
911
1196
  this.notify = (sync) => {
@@ -935,6 +1220,7 @@ var Virtualizer = class {
935
1220
  }
936
1221
  );
937
1222
  this.cleanup = () => {
1223
+ var _a;
938
1224
  this.unsubs.filter(Boolean).forEach((d2) => d2());
939
1225
  this.unsubs = [];
940
1226
  this.observer.disconnect();
@@ -943,12 +1229,14 @@ var Virtualizer = class {
943
1229
  this.rafId = null;
944
1230
  }
945
1231
  this.scrollState = null;
1232
+ (_a = this._momentumStop) == null ? void 0 : _a.restore();
1233
+ this._momentumStop = null;
946
1234
  this.isScrolling = false;
947
1235
  this.scrollDirection = null;
948
- this._iosDeferredAdjustment = 0;
949
- this._iosTouching = false;
950
- this._iosJustTouchEnded = false;
1236
+ this._holdOffset = 0;
1237
+ this._reportedOverscroll = false;
951
1238
  this._clampedAdjustment = null;
1239
+ this.pendingWrite = null;
952
1240
  this.scrollElement = null;
953
1241
  this.targetWindow = null;
954
1242
  };
@@ -958,7 +1246,7 @@ var Virtualizer = class {
958
1246
  };
959
1247
  };
960
1248
  this._willUpdate = () => {
961
- var _a, _b;
1249
+ var _a;
962
1250
  const scrollElement = this.options.enabled ? this.options.getScrollElement() : null;
963
1251
  if (this.scrollElement !== scrollElement) {
964
1252
  this.cleanup();
@@ -983,22 +1271,71 @@ var Virtualizer = class {
983
1271
  );
984
1272
  this.unsubs.push(
985
1273
  this.options.observeElementOffset(this, (offset, isScrolling) => {
986
- if (isScrolling && this._intendedScrollOffset === null && offset === this.scrollOffset) {
987
- return;
988
- }
989
- if (this._intendedScrollOffset !== null && Math.abs(offset - this._intendedScrollOffset) < 1.5) {
990
- offset = this._intendedScrollOffset;
1274
+ var _a2, _b, _c, _d;
1275
+ const elementMax = isScrolling ? this._elementMaxScrollOffset() : null;
1276
+ const wasOverscrolled = this._reportedOverscroll;
1277
+ this._reportedOverscroll = offset < 0 || elementMax !== null && offset > elementMax + 1;
1278
+ const elementOffset = offset;
1279
+ this._lastElementOffset = elementOffset;
1280
+ offset = this._toLayoutOffset(offset);
1281
+ const kind = this._classifyScrollEvent(
1282
+ offset,
1283
+ isScrolling,
1284
+ elementMax
1285
+ );
1286
+ if (kind === "spurious") return;
1287
+ if (kind === "readBack") {
1288
+ offset = this.pendingWrite.target;
1289
+ } else if (kind === "clampedReadBack" && ((_a2 = this.scrollState) == null ? void 0 : _a2.index) != null && // Not `elementMax`: an adapter can report the read-back at rest.
1290
+ offset < this.getMaxScrollOffset() - 1.5) {
1291
+ this.scrollState.lastTargetOffset = offset;
1292
+ } else if (externalRetiresCommand({
1293
+ kind,
1294
+ offset,
1295
+ command: this.scrollState,
1296
+ target: () => this.getScrollStateTarget(this.scrollState)
1297
+ })) {
1298
+ this.scrollState = null;
991
1299
  }
992
- this._intendedScrollOffset = null;
1300
+ this.pendingWrite = null;
993
1301
  if (this._clampedAdjustment !== null && Math.abs(offset - this._clampedAdjustment.maxAtWrite) >= 1.5) {
994
1302
  this._clampedAdjustment = null;
995
1303
  }
996
- this.scrollAdjustments = 0;
997
1304
  const prevOffset = this.getScrollOffset();
1305
+ const prevDirection = this.scrollDirection;
998
1306
  this.scrollDirection = isScrolling ? prevOffset === offset ? this.scrollDirection : prevOffset < offset ? "forward" : "backward" : null;
999
1307
  this.scrollOffset = offset;
1000
1308
  this.isScrolling = isScrolling;
1001
- this._flushIosDeferredIfReady();
1309
+ const queued = this.scrollState;
1310
+ if ((queued == null ? void 0 : queued.phase) === "queued" && kind === "external" && isScrolling) {
1311
+ if (wasOverscrolled || this._reportedOverscroll) {
1312
+ queued.samples = [];
1313
+ } else {
1314
+ const t = this.now();
1315
+ queued.samples = [
1316
+ ...(queued.samples ?? []).filter(
1317
+ (sample) => t - sample.t <= 200
1318
+ ),
1319
+ { t, offset: elementOffset }
1320
+ ];
1321
+ if (prevDirection !== null && this.scrollDirection !== prevDirection || flingSpedUp(queued.samples)) {
1322
+ this.scrollState = null;
1323
+ }
1324
+ }
1325
+ }
1326
+ if (this._iosGesture.onScroll({
1327
+ isScrolling,
1328
+ ownReadBack: kind === "readBack",
1329
+ moved: offset !== prevOffset,
1330
+ // Neither our write's read-back nor a frame of our smooth
1331
+ // animation: the user or a fling moved it.
1332
+ external: kind === "external" && ((_b = this.scrollState) == null ? void 0 : _b.phase) !== "smooth" && ((_c = this.scrollState) == null ? void 0 : _c.phase) !== "smoothFinishing"
1333
+ }) && // The user scrolls: a command still waiting for the tail is
1334
+ // theirs to override, like a written one would be.
1335
+ ((_d = this.scrollState) == null ? void 0 : _d.phase) === "queued") {
1336
+ this.scrollState = null;
1337
+ }
1338
+ this._flushHoldIfReady(true);
1002
1339
  if (this.scrollState) {
1003
1340
  this.scheduleScrollReconcile();
1004
1341
  }
@@ -1006,109 +1343,101 @@ var Virtualizer = class {
1006
1343
  })
1007
1344
  );
1008
1345
  if ("addEventListener" in this.scrollElement) {
1009
- const scrollEl = this.scrollElement;
1010
- const onTouchStart = () => {
1011
- this._iosTouching = true;
1012
- this._iosJustTouchEnded = false;
1013
- if (this._iosTouchEndTimerId !== null && this.targetWindow != null) {
1014
- this.targetWindow.clearTimeout(this._iosTouchEndTimerId);
1015
- this._iosTouchEndTimerId = null;
1016
- }
1017
- };
1018
- const onTouchEnd = () => {
1019
- this._iosTouching = false;
1020
- if (!isIOSWebKit() || this.targetWindow == null) {
1021
- return;
1022
- }
1023
- this._iosJustTouchEnded = true;
1024
- this._iosTouchEndTimerId = this.targetWindow.setTimeout(() => {
1025
- this._iosJustTouchEnded = false;
1026
- this._iosTouchEndTimerId = null;
1027
- this._flushIosDeferredIfReady();
1028
- }, 150);
1029
- };
1030
- scrollEl.addEventListener(
1031
- "touchstart",
1032
- onTouchStart,
1033
- addEventListenerOptions
1346
+ this.unsubs.push(
1347
+ this._iosGesture.listen(this.scrollElement)
1034
1348
  );
1035
- scrollEl.addEventListener(
1036
- "touchend",
1037
- onTouchEnd,
1038
- addEventListenerOptions
1039
- );
1040
- this.unsubs.push(() => {
1041
- scrollEl.removeEventListener("touchstart", onTouchStart);
1042
- scrollEl.removeEventListener("touchend", onTouchEnd);
1043
- if (this._iosTouchEndTimerId !== null && this.targetWindow != null) {
1044
- this.targetWindow.clearTimeout(this._iosTouchEndTimerId);
1045
- this._iosTouchEndTimerId = null;
1046
- }
1047
- });
1048
1349
  }
1049
- this._scrollToOffset(this.getScrollOffset(), {
1050
- adjustments: void 0,
1051
- behavior: void 0
1052
- });
1350
+ this._scrollToOffset(this.getScrollOffset());
1053
1351
  }
1352
+ this._noteClampMax();
1054
1353
  const anchor = this.pendingScrollAnchor;
1055
1354
  this.pendingScrollAnchor = null;
1056
1355
  if (anchor && this.scrollElement && this.options.enabled) {
1057
- const [key, _offset, followOnAppend, anchorDelta] = anchor;
1058
- if (key !== null && !followOnAppend) {
1059
- if (isIOSWebKit() && (this.isScrolling || this._iosTouching || this._iosJustTouchEnded)) {
1060
- if (anchorDelta !== 0) {
1061
- this._iosDeferredAdjustment += anchorDelta;
1062
- }
1063
- } else if (((_b = this.scrollState) == null ? void 0 : _b.behavior) === "smooth" && !approxEqual(
1064
- this.getScrollOffset() - anchorDelta,
1356
+ if (anchor.kind === "anchor") {
1357
+ if (!this._canWriteScroll()) {
1358
+ this._holdOffset += anchor.delta;
1359
+ this._followOffsetTarget(anchor.delta);
1360
+ this.notify(false);
1361
+ } else if (isSmoothScroll(this.scrollState) && !approxEqual(
1362
+ this.getScrollOffset() - anchor.delta,
1065
1363
  this.scrollState.lastTargetOffset
1066
1364
  )) ;
1067
1365
  else {
1068
- this._scrollToOffset(this.getScrollOffset(), {
1069
- adjustments: void 0,
1070
- behavior: void 0
1071
- });
1366
+ this._followOffsetTarget(anchor.delta);
1367
+ this._scrollToOffset(this.getScrollOffset());
1072
1368
  }
1073
- }
1074
- if (followOnAppend) {
1075
- this.scrollToEnd({ behavior: followOnAppend });
1369
+ } else {
1370
+ this.scrollToEnd({ behavior: anchor.behavior });
1076
1371
  }
1077
1372
  }
1373
+ this._flushHoldIfReady(false);
1078
1374
  this._retryClampedAdjustment();
1079
1375
  };
1376
+ this._classifyScrollEvent = (offset, isScrolling, elementMax) => {
1377
+ var _a;
1378
+ return classifyScrollEvent({
1379
+ offset,
1380
+ isScrolling,
1381
+ elementMax,
1382
+ holdOffset: this._holdOffset,
1383
+ scrollOffset: this.scrollOffset,
1384
+ pendingWrite: this.pendingWrite,
1385
+ clampedMaxAtWrite: ((_a = this._clampedAdjustment) == null ? void 0 : _a.maxAtWrite) ?? null
1386
+ });
1387
+ };
1080
1388
  this._retryClampedAdjustment = () => {
1081
- if (this._clampedAdjustment === null || !this.scrollElement || !this.options.enabled) {
1389
+ if (this._clampedAdjustment === null || !this.scrollElement || !this.options.enabled || !this._canWriteScroll()) {
1082
1390
  return;
1083
1391
  }
1084
1392
  const { target, maxAtWrite } = this._clampedAdjustment;
1085
1393
  const max = this.getMaxScrollOffset();
1086
1394
  if (max > maxAtWrite + 0.5) {
1087
1395
  this._clampedAdjustment = target > max + 0.5 ? { target, maxAtWrite: max } : null;
1088
- this._scrollToOffset(target, {
1089
- adjustments: void 0,
1090
- behavior: void 0
1091
- });
1396
+ this._scrollToOffset(target);
1092
1397
  }
1093
1398
  };
1094
- this._flushIosDeferredIfReady = () => {
1095
- if (this._iosDeferredAdjustment === 0) return;
1096
- if (this.isScrolling) return;
1097
- if (this._iosTouching) return;
1098
- if (this._iosJustTouchEnded) return;
1099
- const cur = this.getScrollOffset();
1100
- const max = this.getMaxScrollOffset();
1101
- if (cur < 0 || cur > max) return;
1102
- if (this._iosDeferredAdjustment < 0 && cur >= max - 1) {
1103
- this._iosDeferredAdjustment = 0;
1104
- return;
1399
+ this._writeAwaitingCommand = () => {
1400
+ const state = this.scrollState;
1401
+ if (state === null || state.phase !== "queued") return;
1402
+ const { behavior } = state;
1403
+ this.getMeasurements();
1404
+ const offset = this.getScrollStateTarget(state);
1405
+ state.lastTargetOffset = offset;
1406
+ this._clampedAdjustment = null;
1407
+ state.phase = initialScrollPhase(
1408
+ behavior,
1409
+ state.index != null && approxEqual(offset, this.getScrollOffset())
1410
+ );
1411
+ this._scrollToOffset(offset, { behavior });
1412
+ this.scheduleScrollReconcile();
1413
+ };
1414
+ this._readElementOffset = () => {
1415
+ const el = this.scrollElement;
1416
+ if (el == null) return null;
1417
+ const { horizontal, isRtl } = this.options;
1418
+ if (typeof el.scrollTop === "number") {
1419
+ return horizontal ? el.scrollLeft * (isRtl && -1 || 1) : el.scrollTop;
1105
1420
  }
1106
- const delta = this._iosDeferredAdjustment;
1107
- this._iosDeferredAdjustment = 0;
1108
- this._scrollToOffset(cur, {
1109
- adjustments: this.scrollAdjustments += delta,
1110
- behavior: void 0
1111
- });
1421
+ if (typeof el.scrollY === "number") {
1422
+ return horizontal ? el.scrollX : el.scrollY;
1423
+ }
1424
+ return null;
1425
+ };
1426
+ this._canWriteScroll = () => !(isIOSWebKit() && this._iosGesture.inMotion()) && !this._reportedOverscroll;
1427
+ this._flushHoldIfReady = (sync) => {
1428
+ var _a;
1429
+ if (this._holdOffset === 0) return;
1430
+ if (!this.scrollElement || !this.options.enabled) return;
1431
+ if (!this._canWriteScroll()) return;
1432
+ if (((_a = this.scrollState) == null ? void 0 : _a.phase) === "smooth") return;
1433
+ this._holdOffset = 0;
1434
+ if (this.scrollOffset !== null && this.scrollOffset < 0) {
1435
+ this.scrollOffset = 0;
1436
+ }
1437
+ this.notify(sync);
1438
+ const target = this.getCommandWrittenOffset() ?? this.getScrollOffset();
1439
+ this._clampedAdjustment = this._clampedBy(target);
1440
+ this._scrollToOffset(target);
1112
1441
  };
1113
1442
  this.rafId = null;
1114
1443
  this.getSize = () => {
@@ -1316,17 +1645,21 @@ var Virtualizer = class {
1316
1645
  this.getMeasurements(),
1317
1646
  this.getSize(),
1318
1647
  this.getScrollOffset(),
1319
- this.options.lanes
1648
+ this.options.lanes,
1649
+ // scrollOffset is measured in the scroll element and the layout total
1650
+ // from the list start, so the list ends scrollMargin further down.
1651
+ this._getLayoutTotalSize() + this.options.scrollMargin
1320
1652
  ],
1321
- (measurements, outerSize, scrollOffset, lanes) => {
1653
+ (measurements, outerSize, scrollOffset, lanes, listEnd) => {
1322
1654
  if (measurements.length === 0 || outerSize === 0) {
1323
1655
  this.range = null;
1324
1656
  return null;
1325
1657
  }
1658
+ const maxScrollOffset = Math.max(listEnd - outerSize, 0);
1326
1659
  this.range = calculateRangeImpl(
1327
1660
  measurements,
1328
1661
  outerSize,
1329
- scrollOffset,
1662
+ Math.min(scrollOffset, maxScrollOffset),
1330
1663
  lanes,
1331
1664
  // Pass the typed array so binary search + forward-walk can read
1332
1665
  // start/end directly from Float64Array, skipping the Proxy traps.
@@ -1354,15 +1687,17 @@ var Virtualizer = class {
1354
1687
  this.options.overscan,
1355
1688
  this.options.count,
1356
1689
  startIndex,
1357
- endIndex
1690
+ endIndex,
1691
+ this.options.lanes
1358
1692
  ];
1359
1693
  },
1360
- (rangeExtractor, overscan, count, startIndex, endIndex) => {
1694
+ (rangeExtractor, overscan, count, startIndex, endIndex, lanes) => {
1361
1695
  return startIndex === null || endIndex === null ? [] : rangeExtractor({
1362
1696
  startIndex,
1363
1697
  endIndex,
1364
1698
  overscan,
1365
- count
1699
+ count,
1700
+ lanes
1366
1701
  });
1367
1702
  },
1368
1703
  {
@@ -1383,7 +1718,7 @@ var Virtualizer = class {
1383
1718
  };
1384
1719
  this.shouldMeasureDuringScroll = (index) => {
1385
1720
  var _a;
1386
- if (!this.scrollState || this.scrollState.behavior !== "smooth") {
1721
+ if (!isSmoothScroll(this.scrollState)) {
1387
1722
  return true;
1388
1723
  }
1389
1724
  const scrollIndex = this.scrollState.index ?? ((_a = this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)) == null ? void 0 : _a.index);
@@ -1422,17 +1757,18 @@ var Virtualizer = class {
1422
1757
  this.observer.observe(node);
1423
1758
  this.elementsCache.set(key, node);
1424
1759
  }
1425
- if ((!this.isScrolling || this.scrollState) && this.shouldMeasureDuringScroll(index)) {
1760
+ if (node.isConnected && (!this.isScrolling || this.scrollState) && this.shouldMeasureDuringScroll(index)) {
1426
1761
  this.resizeItem(index, this.options.measureElement(node, void 0, this));
1427
1762
  }
1428
1763
  };
1429
1764
  this.resizeItem = (index, size) => {
1430
1765
  var _a, _b, _c;
1431
1766
  if (!this.isIndexInRange(index)) return;
1767
+ if ((_a = this._resizeBatch) == null ? void 0 : _a.sync) this.getMeasurements();
1432
1768
  let cachedSize;
1433
1769
  let itemStart;
1434
1770
  let key;
1435
- const flat = (_a = this._singleLaneMeasurements) == null ? void 0 : _a.flat;
1771
+ const flat = (_b = this._singleLaneMeasurements) == null ? void 0 : _b.flat;
1436
1772
  if (this.options.lanes === 1 && flat != null) {
1437
1773
  key = this.options.getItemKey(index);
1438
1774
  itemStart = flat[index * 2];
@@ -1447,15 +1783,15 @@ var Virtualizer = class {
1447
1783
  const itemSize = this.itemSizeCache.get(key) ?? cachedSize;
1448
1784
  const delta = size - itemSize;
1449
1785
  if (delta !== 0) {
1450
- const wasAtEnd = this.options.anchorTo === "end" && ((_b = this.scrollState) == null ? void 0 : _b.behavior) !== "smooth" && this.getVirtualDistanceFromEnd() <= this.options.scrollEndThreshold;
1451
- const prevTotalSize = wasAtEnd ? this.getTotalSize() : 0;
1452
- const scrollOffsetWithAdj = this.getScrollOffset() + this.scrollAdjustments;
1786
+ const wasAtEnd = this.options.anchorTo === "end" && !isSmoothScroll(this.scrollState) && this.getVirtualDistanceFromEnd() <= this.options.scrollEndThreshold;
1787
+ const prevTotalSize = wasAtEnd ? this._getLayoutTotalSize() : 0;
1788
+ const scrollOffset = this.getScrollOffset();
1453
1789
  const isFirstMeasure = !this.itemSizeCache.has(key);
1454
1790
  const defaultShouldAdjust = isFirstMeasure ? (
1455
1791
  // First measurement: compensate any item whose top sits above the
1456
1792
  // fold — the estimate→actual delta must be corrected regardless of
1457
1793
  // scroll direction, since the whole estimated block was above it.
1458
- itemStart < scrollOffsetWithAdj
1794
+ itemStart < scrollOffset
1459
1795
  ) : (
1460
1796
  // Re-measurement: only compensate an item that is ENTIRELY above the
1461
1797
  // fold. An item that merely *spans* the fold (top above, bottom
@@ -1464,9 +1800,9 @@ var Virtualizer = class {
1464
1800
  // delta would drag the viewport downward on every growth (#1218).
1465
1801
  // Also skip during backward scroll to avoid the "items jump while
1466
1802
  // scrolling up" cascade.
1467
- itemStart + itemSize <= scrollOffsetWithAdj && this.scrollDirection !== "backward"
1803
+ itemStart + itemSize <= scrollOffset && this.scrollDirection !== "backward"
1468
1804
  );
1469
- const shouldAdjustScroll = ((_c = this.scrollState) == null ? void 0 : _c.behavior) !== "smooth" && (this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(
1805
+ const shouldAdjustScroll = !isSmoothScroll(this.scrollState) && (this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(
1470
1806
  // The callback expects a VirtualItem; build one lazily only
1471
1807
  // when the consumer actually supplied a custom predicate.
1472
1808
  this.measurementsCache[index] ?? {
@@ -1486,25 +1822,40 @@ var Virtualizer = class {
1486
1822
  this.itemSizeCache.set(key, size);
1487
1823
  this.itemSizeCacheVersion++;
1488
1824
  let adjustedSync = false;
1489
- if (wasAtEnd) {
1490
- adjustedSync = this.applyScrollAdjustment(
1491
- this.getTotalSize() - prevTotalSize
1492
- );
1493
- } else if (shouldAdjustScroll) {
1494
- adjustedSync = this.applyScrollAdjustment(delta);
1825
+ if (!this._awaitingCommandReadBack()) {
1826
+ if (wasAtEnd) {
1827
+ adjustedSync = this.applyScrollAdjustment(
1828
+ this._getLayoutTotalSize() - prevTotalSize
1829
+ );
1830
+ } else if (shouldAdjustScroll) {
1831
+ adjustedSync = this.applyScrollAdjustment(delta);
1832
+ }
1833
+ }
1834
+ if (this._resizeBatch) {
1835
+ this._resizeBatch.notify = true;
1836
+ (_c = this._resizeBatch).sync || (_c.sync = adjustedSync);
1837
+ return;
1495
1838
  }
1496
1839
  this.notify(adjustedSync);
1840
+ this._noteClampMax();
1841
+ this._flushHoldIfReady(true);
1497
1842
  this._retryClampedAdjustment();
1498
1843
  }
1499
1844
  };
1500
1845
  this.getVirtualItems = memo(
1501
- () => [this.getVirtualIndexes(), this.getMeasurements()],
1502
- (indexes, measurements) => {
1846
+ () => [this.getVirtualIndexes(), this.getMeasurements(), this._holdOffset],
1847
+ (indexes, measurements, hold) => {
1503
1848
  const virtualItems = [];
1504
1849
  for (let k4 = 0, len = indexes.length; k4 < len; k4++) {
1505
1850
  const i2 = indexes[k4];
1506
1851
  const measurement = measurements[i2];
1507
- virtualItems.push(measurement);
1852
+ virtualItems.push(
1853
+ hold === 0 ? measurement : {
1854
+ ...measurement,
1855
+ start: measurement.start - hold,
1856
+ end: measurement.end - hold
1857
+ }
1858
+ );
1508
1859
  }
1509
1860
  return virtualItems;
1510
1861
  },
@@ -1529,18 +1880,89 @@ var Virtualizer = class {
1529
1880
  );
1530
1881
  return notUndefined(measurements[idx]);
1531
1882
  };
1532
- this.getMaxScrollOffset = () => {
1533
- if (!this.scrollElement) return 0;
1534
- if ("scrollHeight" in this.scrollElement) {
1535
- return this.options.horizontal ? this.scrollElement.scrollWidth - this.scrollElement.clientWidth : this.scrollElement.scrollHeight - this.scrollElement.clientHeight;
1536
- } else {
1537
- const doc = this.scrollElement.document.documentElement;
1538
- return this.options.horizontal ? doc.scrollWidth - this.scrollElement.innerWidth : doc.scrollHeight - this.scrollElement.innerHeight;
1883
+ this._noteClampMax = () => {
1884
+ if (!this._awaitingCommandReadBack()) return;
1885
+ const elementMax = this._elementMaxScrollOffset();
1886
+ if (elementMax === null) return;
1887
+ const write = this.pendingWrite;
1888
+ const max = Math.max(elementMax, 0) + this._holdOffset;
1889
+ if (max >= write.target) return;
1890
+ const lowMaxes = write.lowMaxes ?? (write.lowMaxes = []);
1891
+ if (lowMaxes[lowMaxes.length - 1] !== max) lowMaxes.push(max);
1892
+ };
1893
+ this.getMaxScrollOffset = () => (this._elementMaxScrollOffset() ?? 0) + this._holdOffset;
1894
+ this._toLayoutOffset = (elementOffset) => {
1895
+ var _a;
1896
+ let offset = elementOffset + this._holdOffset;
1897
+ if (((_a = this.pendingScrollAnchor) == null ? void 0 : _a.kind) === "anchor") {
1898
+ offset += this.pendingScrollAnchor.delta;
1899
+ }
1900
+ return offset;
1901
+ };
1902
+ this._elementMaxScrollOffset = () => {
1903
+ const el = this.scrollElement;
1904
+ if (el === null) return null;
1905
+ if ("scrollHeight" in el) {
1906
+ return this.options.horizontal ? el.scrollWidth - el.clientWidth : el.scrollHeight - el.clientHeight;
1539
1907
  }
1908
+ if ("document" in el) {
1909
+ const doc = el.document.documentElement;
1910
+ return this.options.horizontal ? doc.scrollWidth - el.innerWidth : doc.scrollHeight - el.innerHeight;
1911
+ }
1912
+ return null;
1913
+ };
1914
+ this._momentumStop = null;
1915
+ this._stopMomentum = (done) => {
1916
+ const el = this.scrollElement;
1917
+ const win = this.targetWindow;
1918
+ if (el === null || win === null) return;
1919
+ const scroller = "document" in el ? el.document.scrollingElement : el;
1920
+ if (!(scroller == null ? void 0 : scroller.style)) return;
1921
+ if (this._momentumStop) {
1922
+ this._momentumStop.done = done;
1923
+ return;
1924
+ }
1925
+ const { style } = scroller;
1926
+ const property = this.options.horizontal ? "overflow-x" : "overflow-y";
1927
+ const value = style.getPropertyValue(property);
1928
+ const priority = style.getPropertyPriority(property);
1929
+ const crossSize = () => this.options.horizontal ? scroller.clientHeight : scroller.clientWidth;
1930
+ const crossSizeBefore = crossSize();
1931
+ style.setProperty(property, "hidden", "important");
1932
+ if (crossSize() !== crossSizeBefore) {
1933
+ style.setProperty(property, value, priority);
1934
+ return;
1935
+ }
1936
+ const stop = {
1937
+ // False when the app replaced the hidden value: the fling may not
1938
+ // have stopped.
1939
+ restore: () => {
1940
+ if (style.getPropertyValue(property) !== "hidden" || style.getPropertyPriority(property) !== "important") {
1941
+ return false;
1942
+ }
1943
+ style.setProperty(property, value, priority);
1944
+ return true;
1945
+ },
1946
+ done
1947
+ };
1948
+ this._momentumStop = stop;
1949
+ win.requestAnimationFrame(
1950
+ () => win.requestAnimationFrame(() => {
1951
+ if (this._momentumStop !== stop) return;
1952
+ this._momentumStop = null;
1953
+ if (stop.restore()) stop.done();
1954
+ })
1955
+ );
1956
+ };
1957
+ this._clampedBy = (target) => {
1958
+ const elementMax = this._elementMaxScrollOffset();
1959
+ if (elementMax === null) return null;
1960
+ const maxAtWrite = elementMax + this._holdOffset;
1961
+ return target > maxAtWrite + 0.5 ? { target, maxAtWrite } : null;
1540
1962
  };
1541
1963
  this.getVirtualDistanceFromEnd = () => {
1542
1964
  return Math.max(
1543
- this.getTotalSize() - this.getSize() - this.getScrollOffset(),
1965
+ this._getLayoutTotalSize() + this.options.scrollMargin - this.getSize() - this.getScrollOffset(),
1544
1966
  0
1545
1967
  );
1546
1968
  };
@@ -1569,7 +1991,7 @@ var Virtualizer = class {
1569
1991
  index = Math.max(0, Math.min(index, this.options.count - 1));
1570
1992
  const size = this.getSize();
1571
1993
  const scrollOffset = this.getScrollOffset();
1572
- const item = this.measurementsCache[index];
1994
+ const item = this.getMeasurements()[index];
1573
1995
  if (!item) return;
1574
1996
  if (align === "auto") {
1575
1997
  if (item.end >= scrollOffset + size - this.options.scrollPaddingEnd) {
@@ -1581,7 +2003,9 @@ var Virtualizer = class {
1581
2003
  }
1582
2004
  }
1583
2005
  if (align === "end" && index === this.options.count - 1) {
1584
- return [this.getMaxScrollOffset(), align];
2006
+ const maxOffset = this.getMaxScrollOffset();
2007
+ const toOffset2 = maxOffset - this.options.paddingEnd + this.options.scrollPaddingEnd;
2008
+ return [Math.max(Math.min(toOffset2, maxOffset), 0), align];
1585
2009
  }
1586
2010
  const toOffset = align === "end" ? item.end + this.options.scrollPaddingEnd : item.start - this.options.scrollPaddingStart;
1587
2011
  return [
@@ -1590,70 +2014,58 @@ var Virtualizer = class {
1590
2014
  ];
1591
2015
  };
1592
2016
  this.scrollToOffset = (toOffset, { align = "start", behavior = "auto" } = {}) => {
1593
- this._iosDeferredAdjustment = 0;
1594
- const offset = this.getOffsetForAlignment(toOffset, align);
1595
- const now = this.now();
1596
- this.scrollState = {
1597
- index: null,
1598
- align,
2017
+ this._startScroll(
2018
+ { index: null, align },
2019
+ this.getOffsetForAlignment(toOffset, align),
1599
2020
  behavior,
1600
- startedAt: now,
1601
- lastTargetOffset: offset,
1602
- stableFrames: 0
1603
- };
1604
- this._scrollToOffset(offset, { adjustments: void 0, behavior });
1605
- this.scheduleScrollReconcile();
2021
+ "absolute"
2022
+ );
1606
2023
  };
1607
2024
  this.scrollToIndex = (index, {
1608
2025
  align: initialAlign = "auto",
1609
2026
  behavior = "auto"
1610
2027
  } = {}) => {
1611
- this._iosDeferredAdjustment = 0;
1612
2028
  index = Math.max(0, Math.min(index, this.options.count - 1));
1613
2029
  const offsetInfo = this.getOffsetForIndex(index, initialAlign);
1614
- if (!offsetInfo) {
1615
- return;
1616
- }
2030
+ if (!offsetInfo) return;
1617
2031
  const [offset, align] = offsetInfo;
1618
- const now = this.now();
1619
- this.scrollState = {
1620
- index,
1621
- align,
1622
- behavior,
1623
- startedAt: now,
1624
- lastTargetOffset: offset,
1625
- stableFrames: 0
1626
- };
1627
- this._scrollToOffset(offset, { adjustments: void 0, behavior });
1628
- this.scheduleScrollReconcile();
2032
+ this._startScroll({ index, align }, offset, behavior, "absolute");
1629
2033
  };
1630
2034
  this.scrollBy = (delta, { behavior = "auto" } = {}) => {
1631
- const offset = this.getScrollOffset() + delta;
1632
- const now = this.now();
1633
- this.scrollState = {
1634
- index: null,
1635
- align: "start",
2035
+ const offset = this.getOffsetForAlignment(
2036
+ (this.getCommandWrittenOffset() ?? this.getScrollOffset()) + delta,
2037
+ "start"
2038
+ );
2039
+ this._startScroll(
2040
+ { index: null, align: "start" },
2041
+ offset,
1636
2042
  behavior,
1637
- startedAt: now,
1638
- lastTargetOffset: offset,
1639
- stableFrames: 0
1640
- };
1641
- this._scrollToOffset(offset, { adjustments: void 0, behavior });
1642
- this.scheduleScrollReconcile();
2043
+ "relative"
2044
+ );
1643
2045
  };
1644
2046
  this.scrollToEnd = ({ behavior = "auto" } = {}) => {
1645
2047
  if (this.options.count > 0) {
1646
- this.scrollToIndex(this.options.count - 1, {
1647
- align: "end",
1648
- behavior
1649
- });
2048
+ this._startScroll(
2049
+ { index: this.options.count - 1, align: "end", toEnd: true },
2050
+ Math.max(this.getMaxScrollOffset(), 0),
2051
+ behavior,
2052
+ "absolute"
2053
+ );
1650
2054
  return;
1651
2055
  }
1652
2056
  this.scrollToOffset(Math.max(this.getTotalSize() - this.getSize(), 0), {
1653
2057
  behavior
1654
2058
  });
1655
2059
  };
1656
- this.getTotalSize = () => {
2060
+ this.cancelScroll = () => {
2061
+ if (this.rafId != null && this.targetWindow) {
2062
+ this.targetWindow.cancelAnimationFrame(this.rafId);
2063
+ this.rafId = null;
2064
+ }
2065
+ this.scrollState = null;
2066
+ };
2067
+ this.getTotalSize = () => Math.max(this._getLayoutTotalSize() - this._holdOffset, 0);
2068
+ this._getLayoutTotalSize = () => {
1657
2069
  var _a, _b;
1658
2070
  const measurements = this.getMeasurements();
1659
2071
  let end;
@@ -1705,9 +2117,28 @@ var Virtualizer = class {
1705
2117
  this._scrollToOffset = (offset, {
1706
2118
  adjustments,
1707
2119
  behavior
1708
- }) => {
1709
- this._intendedScrollOffset = offset + (adjustments ?? 0);
1710
- this.options.scrollToFn(offset, { behavior, adjustments }, this);
2120
+ } = {}) => {
2121
+ const write = {
2122
+ target: offset + (adjustments ?? 0),
2123
+ smooth: behavior === "smooth"
2124
+ };
2125
+ this.pendingWrite = write;
2126
+ this.options.scrollToFn(
2127
+ offset - this._holdOffset,
2128
+ { behavior, adjustments },
2129
+ this
2130
+ );
2131
+ return write;
2132
+ };
2133
+ this.getCommandWrittenOffset = () => this.scrollState !== null && this.pendingWrite !== null && !this.pendingWrite.smooth ? this.pendingWrite.target : null;
2134
+ this._awaitingCommandReadBack = () => {
2135
+ const writtenOffset = this.getCommandWrittenOffset();
2136
+ return !(isIOSWebKit() && this._iosGesture.dragging()) && writtenOffset !== null && !approxEqual(writtenOffset, this.getScrollOffset());
2137
+ };
2138
+ this._followOffsetTarget = (delta) => {
2139
+ if (this.scrollState !== null && this.scrollState.index == null) {
2140
+ this.scrollState.lastTargetOffset += delta;
2141
+ }
1711
2142
  };
1712
2143
  this.measure = () => {
1713
2144
  this.pendingMin = null;
@@ -1718,6 +2149,14 @@ var Virtualizer = class {
1718
2149
  };
1719
2150
  this.setOptions(opts);
1720
2151
  }
2152
+ /**
2153
+ * @deprecated Always 0: a scroll correction is folded into `scrollOffset`
2154
+ * at once, so there is never an outstanding adjustment to add to it. Read
2155
+ * `scrollOffset` alone.
2156
+ */
2157
+ get scrollAdjustments() {
2158
+ return 0;
2159
+ }
1721
2160
  // Returns `true` when it performed a synchronous `scrollTop` write this
1722
2161
  // tick, `false` when the delta was zero or the write was deferred (iOS).
1723
2162
  // `resizeItem` uses that to decide whether the follow-up `notify` must be
@@ -1727,22 +2166,21 @@ var Virtualizer = class {
1727
2166
  if (this.options.debug) {
1728
2167
  console.info("correction", delta);
1729
2168
  }
1730
- if (isIOSWebKit() && (this.isScrolling || this._iosTouching || this._iosJustTouchEnded)) {
1731
- this._iosDeferredAdjustment += delta;
1732
- return false;
2169
+ this._followOffsetTarget(delta);
2170
+ if (!this._canWriteScroll()) {
2171
+ this._holdOffset += delta;
2172
+ if (this.scrollOffset !== null) this.scrollOffset += delta;
2173
+ return true;
1733
2174
  } else {
1734
- const target = this.getScrollOffset() + this.scrollAdjustments + delta;
1735
- const el = this.scrollElement;
1736
- const maxAtWrite = el !== null && ("scrollHeight" in el || "document" in el) ? this.getMaxScrollOffset() : null;
1737
- this._clampedAdjustment = maxAtWrite !== null && target > maxAtWrite + 0.5 ? { target, maxAtWrite } : null;
1738
- this._scrollToOffset(this.getScrollOffset(), {
1739
- adjustments: this.scrollAdjustments += delta,
2175
+ const offset = this.getScrollOffset();
2176
+ this._clampedAdjustment = this._clampedBy(offset + delta);
2177
+ const write = this._scrollToOffset(offset, {
2178
+ adjustments: delta,
1740
2179
  behavior
1741
2180
  });
1742
2181
  if (this.scrollOffset !== null) {
1743
- this.scrollOffset += this.scrollAdjustments;
2182
+ if (this.pendingWrite === write) this.scrollOffset += delta;
1744
2183
  if (this.scrollOffset < 0) this.scrollOffset = 0;
1745
- this.scrollAdjustments = 0;
1746
2184
  }
1747
2185
  return true;
1748
2186
  }
@@ -1758,6 +2196,10 @@ var Virtualizer = class {
1758
2196
  this.reconcileScroll();
1759
2197
  });
1760
2198
  }
2199
+ getScrollStateTarget(state) {
2200
+ const offsetInfo = state.toEnd ? [Math.max(this.getMaxScrollOffset(), 0)] : state.index != null ? this.getOffsetForIndex(state.index, state.align) : void 0;
2201
+ return offsetInfo ? offsetInfo[0] : state.lastTargetOffset;
2202
+ }
1761
2203
  reconcileScroll() {
1762
2204
  if (!this.scrollState) return;
1763
2205
  const el = this.scrollElement;
@@ -1767,18 +2209,24 @@ var Virtualizer = class {
1767
2209
  this.scrollState = null;
1768
2210
  return;
1769
2211
  }
1770
- const offsetInfo = this.scrollState.index != null ? this.getOffsetForIndex(this.scrollState.index, this.scrollState.align) : void 0;
1771
- const targetOffset = offsetInfo ? offsetInfo[0] : this.scrollState.lastTargetOffset;
1772
- const STABLE_FRAMES = 1;
2212
+ if (this.scrollState.phase === "queued") {
2213
+ this.scheduleScrollReconcile();
2214
+ return;
2215
+ }
2216
+ this.getMeasurements();
2217
+ const targetOffset = this.getScrollStateTarget(this.scrollState);
2218
+ const STABLE_FRAMES = this.scrollState.index == null ? 1 : this.options.useAnimationFrameWithResizeObserver ? 3 : 2;
1773
2219
  const targetChanged = targetOffset !== this.scrollState.lastTargetOffset;
1774
2220
  if (!targetChanged && approxEqual(targetOffset, this.getScrollOffset())) {
2221
+ if (this.scrollState.phase === "smooth") {
2222
+ this.scrollState.phase = "smoothLanded";
2223
+ } else if (this.scrollState.phase === "smoothFinishing") {
2224
+ this.scrollState.phase = "instant";
2225
+ }
1775
2226
  this.scrollState.stableFrames++;
1776
2227
  if (this.scrollState.stableFrames >= STABLE_FRAMES) {
1777
2228
  if (this.getScrollOffset() !== targetOffset) {
1778
- this._scrollToOffset(targetOffset, {
1779
- adjustments: void 0,
1780
- behavior: "auto"
1781
- });
2229
+ this._scrollToOffset(targetOffset, { behavior: "auto" });
1782
2230
  }
1783
2231
  this.scrollState = null;
1784
2232
  return;
@@ -1788,19 +2236,81 @@ var Virtualizer = class {
1788
2236
  if (targetChanged) {
1789
2237
  const viewport = this.getSize() || 600;
1790
2238
  const distance = Math.abs(targetOffset - this.getScrollOffset());
1791
- const keepSmooth = this.scrollState.behavior === "smooth" && distance > viewport;
2239
+ const keepSmooth = isSmoothScroll(this.scrollState) && distance > viewport;
1792
2240
  this.scrollState.lastTargetOffset = targetOffset;
1793
- if (!keepSmooth) {
1794
- this.scrollState.behavior = "auto";
2241
+ if (keepSmooth) {
2242
+ this.scrollState.phase = "smooth";
2243
+ } else if (this.scrollState.phase === "smooth") {
2244
+ this.scrollState.phase = "smoothFinishing";
2245
+ } else if (this.scrollState.phase === "smoothLanded") {
2246
+ this.scrollState.phase = "instant";
1795
2247
  }
1796
2248
  this._scrollToOffset(targetOffset, {
1797
- adjustments: void 0,
1798
2249
  behavior: keepSmooth ? "smooth" : "auto"
1799
2250
  });
1800
2251
  }
1801
2252
  }
1802
2253
  this.scheduleScrollReconcile();
1803
2254
  }
2255
+ // Every scroll command starts here: it becomes the in-flight command,
2256
+ // writes its first target and leaves reconcile to retarget and retire it.
2257
+ //
2258
+ // Targets are layout offsets. A held correction is not dropped by a
2259
+ // command: the write lands the element `_holdOffset` short of the target,
2260
+ // under the rows exposed shifted by the same amount, and the flush moves
2261
+ // both together once a write is possible.
2262
+ //
2263
+ // An index or end target that is already at its offset starts a smooth
2264
+ // scroll as landed; an offset target never does, so its first scroll
2265
+ // event is read as the user's (see the scroll handler in `_willUpdate`).
2266
+ _startScroll(target, offset, behavior, kind) {
2267
+ this.pendingScrollAnchor = null;
2268
+ this._clampedAdjustment = null;
2269
+ const tail = this._iosGesture.tail();
2270
+ if (kind === "absolute" && tail !== null) {
2271
+ if (tail === "fling" && momentumOverridesWrites()) {
2272
+ this._stopMomentum(() => {
2273
+ const state = this.scrollState;
2274
+ if ((state == null ? void 0 : state.phase) !== "queued" || // A finger came down: it owns the scroll until it lifts.
2275
+ this._iosGesture.tail() !== "fling" || // In a bounce WebKit can drop the write (#1287): the tail
2276
+ // decides, as without the stop. (Not `flingCaught`: our stop
2277
+ // also ends the fling at speed, so a slow frame would read as
2278
+ // a catch and the tail would drop the command.)
2279
+ this._reportedOverscroll) {
2280
+ return;
2281
+ }
2282
+ this._iosGesture.end();
2283
+ this._flushHoldIfReady(true);
2284
+ this._writeAwaitingCommand();
2285
+ });
2286
+ this.scrollState = {
2287
+ ...target,
2288
+ startedAt: this.now(),
2289
+ lastTargetOffset: offset,
2290
+ stableFrames: 0,
2291
+ phase: "queued",
2292
+ behavior,
2293
+ samples: []
2294
+ };
2295
+ this.scheduleScrollReconcile();
2296
+ return;
2297
+ }
2298
+ this._iosGesture.end();
2299
+ }
2300
+ this.scrollState = {
2301
+ ...target,
2302
+ startedAt: this.now(),
2303
+ lastTargetOffset: offset,
2304
+ stableFrames: 0,
2305
+ behavior,
2306
+ phase: initialScrollPhase(
2307
+ behavior,
2308
+ target.index != null && approxEqual(offset, this.getScrollOffset())
2309
+ )
2310
+ };
2311
+ this._scrollToOffset(offset, { behavior });
2312
+ this.scheduleScrollReconcile();
2313
+ }
1804
2314
  };
1805
2315
  var findNearestBinarySearch = (low, high, getCurrentValue, value) => {
1806
2316
  while (low <= high) {
@@ -1912,26 +2422,25 @@ function useVirtualizerBase({
1912
2422
  state.container.style[sizeAxis] = `${totalSize}px`;
1913
2423
  }
1914
2424
  };
2425
+ const applyItemPosition = (instance2, item, el) => {
2426
+ const state = directRef.current;
2427
+ const horizontal = !!instance2.options.horizontal;
2428
+ const next = item.start - instance2.options.scrollMargin;
2429
+ if (state.lastPositions.get(el) === next) return;
2430
+ state.lastPositions.set(el, next);
2431
+ if (state.mode === "transform") {
2432
+ el.style.transform = horizontal ? `translate3d(${next}px, 0, 0)` : `translate3d(0, ${next}px, 0)`;
2433
+ } else {
2434
+ el.style[horizontal ? "left" : "top"] = `${next}px`;
2435
+ }
2436
+ };
1915
2437
  const applyDirectStyles = (instance2) => {
1916
2438
  const state = directRef.current;
1917
2439
  if (!state.enabled || !state.container) return;
1918
2440
  applyContainerSize(instance2);
1919
- const horizontal = !!instance2.options.horizontal;
1920
- const useTransform = state.mode === "transform";
1921
- const posAxis = horizontal ? "left" : "top";
1922
- const scrollMargin = instance2.options.scrollMargin;
1923
- const items = instance2.getVirtualItems();
1924
- for (const item of items) {
1925
- const next = item.start - scrollMargin;
2441
+ for (const item of instance2.getVirtualItems()) {
1926
2442
  const el = instance2.elementsCache.get(item.key);
1927
- if (!el) continue;
1928
- if (state.lastPositions.get(el) === next) continue;
1929
- state.lastPositions.set(el, next);
1930
- if (useTransform) {
1931
- el.style.transform = horizontal ? `translate3d(${next}px, 0, 0)` : `translate3d(0, ${next}px, 0)`;
1932
- } else {
1933
- el.style[posAxis] = `${next}px`;
1934
- }
2443
+ if (el) applyItemPosition(instance2, item, el);
1935
2444
  }
1936
2445
  };
1937
2446
  const resolvedOptions = {
@@ -1973,17 +2482,19 @@ function useVirtualizerBase({
1973
2482
  } finally {
1974
2483
  measuringFromRef.current = false;
1975
2484
  }
2485
+ const state = directRef.current;
2486
+ if (node !== null && state.enabled && state.container) {
2487
+ const item = v3.measurementsCache[v3.indexFromElement(node)];
2488
+ if (item) applyItemPosition(v3, item, node);
2489
+ }
1976
2490
  };
1977
2491
  return Object.assign(v3, {
1978
2492
  containerRef: (node) => {
1979
2493
  const state = directRef.current;
1980
2494
  state.container = node;
1981
2495
  state.lastSize = null;
1982
- if (node && state.enabled) {
1983
- const total = v3.getTotalSize();
1984
- state.lastSize = total;
1985
- const axis = v3.options.horizontal ? "width" : "height";
1986
- node.style[axis] = `${total}px`;
2496
+ if (node !== null) {
2497
+ applyDirectStyles(v3);
1987
2498
  }
1988
2499
  }
1989
2500
  });