lizaui 12.0.20 → 12.0.21

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 (153) hide show
  1. package/dist/button-group/index.es.js +2 -2
  2. package/dist/button-v2/index.cjs.js +1 -1
  3. package/dist/button-v2/index.es.js +3 -3
  4. package/dist/chunks/{Button-DdtCMsXJ.js → Button-Bumy9bze.js} +6 -55
  5. package/dist/chunks/Button-Bumy9bze.js.map +1 -0
  6. package/dist/chunks/{Button-B-wLEikV.js → Button-CFYOfByw.js} +9 -58
  7. package/dist/chunks/Button-CFYOfByw.js.map +1 -0
  8. package/dist/chunks/{FocusScope-Txa6B8J4.js → FocusScope-4TdD5fCA.js} +2 -2
  9. package/dist/chunks/{FocusScope-Txa6B8J4.js.map → FocusScope-4TdD5fCA.js.map} +1 -1
  10. package/dist/chunks/{FocusScope-BVEv8CgQ.js → FocusScope-jSNMAXzg.js} +3 -3
  11. package/dist/chunks/{FocusScope-BVEv8CgQ.js.map → FocusScope-jSNMAXzg.js.map} +1 -1
  12. package/dist/chunks/Hidden-BY45Dc0j.js +54 -0
  13. package/dist/chunks/Hidden-BY45Dc0j.js.map +1 -0
  14. package/dist/chunks/Hidden-C55DpjMP.js +55 -0
  15. package/dist/chunks/Hidden-C55DpjMP.js.map +1 -0
  16. package/dist/chunks/{I18nProvider-Dfr8Km7j.js → I18nProvider-Coj9x7B8.js} +2 -2
  17. package/dist/chunks/{I18nProvider-Dfr8Km7j.js.map → I18nProvider-Coj9x7B8.js.map} +1 -1
  18. package/dist/chunks/{ProgressBar-D0THM7Dn.js → ProgressBar-542C1mif.js} +5 -5
  19. package/dist/chunks/{ProgressBar-D0THM7Dn.js.map → ProgressBar-542C1mif.js.map} +1 -1
  20. package/dist/chunks/{ProgressBar-BPfa9vzz.js → ProgressBar-BiKRsJ8m.js} +3 -3
  21. package/dist/chunks/{ProgressBar-BPfa9vzz.js.map → ProgressBar-BiKRsJ8m.js.map} +1 -1
  22. package/dist/chunks/SharedElementTransition-BSCoaphV.js +106 -0
  23. package/dist/chunks/{SharedElementTransition-D87oSBzB.js.map → SharedElementTransition-BSCoaphV.js.map} +1 -1
  24. package/dist/chunks/SharedElementTransition-CJVe1D_I.js +107 -0
  25. package/dist/chunks/{SharedElementTransition-BxczX23g.js.map → SharedElementTransition-CJVe1D_I.js.map} +1 -1
  26. package/dist/chunks/{VisuallyHidden-CiBoSB1U.js → VisuallyHidden-CTe1-RoI.js} +3 -39
  27. package/dist/chunks/VisuallyHidden-CTe1-RoI.js.map +1 -0
  28. package/dist/chunks/VisuallyHidden-DPJuOMsW.js +50 -0
  29. package/dist/chunks/VisuallyHidden-DPJuOMsW.js.map +1 -0
  30. package/dist/chunks/{button-group-CGyXDmwt.js → button-group-DJ5IdBp6.js} +2 -2
  31. package/dist/chunks/{button-group-CGyXDmwt.js.map → button-group-DJ5IdBp6.js.map} +1 -1
  32. package/dist/chunks/{compose-Ch-3fhek.js → compose-DOOi0Yan.js} +2 -2
  33. package/dist/chunks/{compose-Ch-3fhek.js.map → compose-DOOi0Yan.js.map} +1 -1
  34. package/dist/chunks/{focusSafely-Cxp4n3zg.js → focusSafely-CKxVSn6H.js} +39 -1
  35. package/dist/chunks/{focusSafely-Cxp4n3zg.js.map → focusSafely-CKxVSn6H.js.map} +1 -1
  36. package/dist/chunks/{focusSafely--u_yGz_7.js → focusSafely-DfEgLKh6.js} +46 -8
  37. package/dist/chunks/{focusSafely--u_yGz_7.js.map → focusSafely-DfEgLKh6.js.map} +1 -1
  38. package/dist/chunks/{number-DigQ78uS.js → number-CYgYWykt.js} +2 -2
  39. package/dist/chunks/{number-DigQ78uS.js.map → number-CYgYWykt.js.map} +1 -1
  40. package/dist/chunks/{radio-group-4o00BMkw.js → radio-group-BwXvYzSm.js} +14 -13
  41. package/dist/chunks/{radio-group-4o00BMkw.js.map → radio-group-BwXvYzSm.js.map} +1 -1
  42. package/dist/chunks/{radio-group-voOEmmYI.js → radio-group-hO2beGF6.js} +12 -11
  43. package/dist/chunks/{radio-group-voOEmmYI.js.map → radio-group-hO2beGF6.js.map} +1 -1
  44. package/dist/chunks/useControlledState-DE_m1RML.js +39 -0
  45. package/dist/chunks/useControlledState-DE_m1RML.js.map +1 -0
  46. package/dist/chunks/useControlledState-DZA25XHU.js +40 -0
  47. package/dist/chunks/useControlledState-DZA25XHU.js.map +1 -0
  48. package/dist/chunks/{useFormReset-BL4MH85g.js → useFormReset-BYRGk5vb.js} +2 -2
  49. package/dist/chunks/{useFormReset-BL4MH85g.js.map → useFormReset-BYRGk5vb.js.map} +1 -1
  50. package/dist/chunks/{useFormReset-YYNrlE-8.js → useFormReset-Bgv2ktIE.js} +2 -2
  51. package/dist/chunks/{useFormReset-YYNrlE-8.js.map → useFormReset-Bgv2ktIE.js.map} +1 -1
  52. package/dist/chunks/useHasTabbableChild-CSJ0P5QT.js +2577 -0
  53. package/dist/chunks/useHasTabbableChild-CSJ0P5QT.js.map +1 -0
  54. package/dist/chunks/useHasTabbableChild-kl2T5gEX.js +2576 -0
  55. package/dist/chunks/useHasTabbableChild-kl2T5gEX.js.map +1 -0
  56. package/dist/chunks/{useHover-_Q7y99al.js → useHover-BHCSbkLb.js} +3 -3
  57. package/dist/chunks/{useHover-_Q7y99al.js.map → useHover-BHCSbkLb.js.map} +1 -1
  58. package/dist/chunks/{useHover-COOv7KTv.js → useHover-D9f9xyxz.js} +2 -2
  59. package/dist/chunks/{useHover-COOv7KTv.js.map → useHover-D9f9xyxz.js.map} +1 -1
  60. package/dist/chunks/{useLabel-DjFU7E9u.js → useLabel-CzhH-Tov.js} +3 -22
  61. package/dist/chunks/useLabel-CzhH-Tov.js.map +1 -0
  62. package/dist/chunks/{useLabel-DgF69V6e.js → useLabel-YLbDMN-c.js} +4 -23
  63. package/dist/chunks/useLabel-YLbDMN-c.js.map +1 -0
  64. package/dist/chunks/useLabels-BiXnWBSL.js +23 -0
  65. package/dist/chunks/useLabels-BiXnWBSL.js.map +1 -0
  66. package/dist/chunks/useLabels-Bl0mJafM.js +24 -0
  67. package/dist/chunks/useLabels-Bl0mJafM.js.map +1 -0
  68. package/dist/chunks/{useMove-KCXqjWm-.js → useMove-DeuS9PRx.js} +3 -3
  69. package/dist/chunks/{useMove-KCXqjWm-.js.map → useMove-DeuS9PRx.js.map} +1 -1
  70. package/dist/chunks/{useMove-D5nRSeRO.js → useMove-Xpbmb6OD.js} +3 -3
  71. package/dist/chunks/{useMove-D5nRSeRO.js.map → useMove-Xpbmb6OD.js.map} +1 -1
  72. package/dist/chunks/{usePress-BnXPCNhr.js → usePress-Arf10jW0.js} +4 -4
  73. package/dist/chunks/{usePress-BnXPCNhr.js.map → usePress-Arf10jW0.js.map} +1 -1
  74. package/dist/chunks/{usePress-4yjnfhQ_.js → usePress-B1yQk_p8.js} +3 -3
  75. package/dist/chunks/{usePress-4yjnfhQ_.js.map → usePress-B1yQk_p8.js.map} +1 -1
  76. package/dist/chunks/{useProgressBar-DJZIQMyS.js → useProgressBar-BsO-Q5JP.js} +2 -2
  77. package/dist/chunks/{useProgressBar-DJZIQMyS.js.map → useProgressBar-BsO-Q5JP.js.map} +1 -1
  78. package/dist/chunks/{useProgressBar-D2OaXApL.js → useProgressBar-d2k0k8r0.js} +4 -4
  79. package/dist/chunks/{useProgressBar-D2OaXApL.js.map → useProgressBar-d2k0k8r0.js.map} +1 -1
  80. package/dist/chunks/{useSlot-CEcR5EcL.js → useSlot-CFaaZeQE.js} +4 -4
  81. package/dist/chunks/{useSlot-CEcR5EcL.js.map → useSlot-CFaaZeQE.js.map} +1 -1
  82. package/dist/chunks/{useSlot-YqT3Ml-j.js → useSlot-TNtJf1z8.js} +3 -3
  83. package/dist/chunks/{useSlot-YqT3Ml-j.js.map → useSlot-TNtJf1z8.js.map} +1 -1
  84. package/dist/chunks/{utils-B3shU_E6.js → utils-BCEhcDlv.js} +6 -6
  85. package/dist/chunks/{utils-B3shU_E6.js.map → utils-BCEhcDlv.js.map} +1 -1
  86. package/dist/components/icons/icons.d.ts +20 -0
  87. package/dist/components/icons/icons.d.ts.map +1 -0
  88. package/dist/components/tabs/index.d.ts +26 -0
  89. package/dist/components/tabs/index.d.ts.map +1 -0
  90. package/dist/components/tabs/tabs.d.ts +40 -0
  91. package/dist/components/tabs/tabs.d.ts.map +1 -0
  92. package/dist/components/tabs/tabs.styles.d.ts +87 -0
  93. package/dist/components/tabs/tabs.styles.d.ts.map +1 -0
  94. package/dist/data-table/index.cjs.js +293 -2810
  95. package/dist/data-table/index.cjs.js.map +1 -1
  96. package/dist/data-table/index.es.js +207 -2724
  97. package/dist/data-table/index.es.js.map +1 -1
  98. package/dist/index.cjs.js +2 -2
  99. package/dist/index.es.js +3 -3
  100. package/dist/lib/utils/assertion.d.ts +10 -0
  101. package/dist/lib/utils/assertion.d.ts.map +1 -0
  102. package/dist/lib/utils/class-name.d.ts +8 -0
  103. package/dist/lib/utils/class-name.d.ts.map +1 -0
  104. package/dist/lib/utils/cn.d.ts +23 -0
  105. package/dist/lib/utils/cn.d.ts.map +1 -0
  106. package/dist/lib/utils/collection-prop-injection.d.ts +32 -0
  107. package/dist/lib/utils/collection-prop-injection.d.ts.map +1 -0
  108. package/dist/lib/utils/compose.d.ts +8 -0
  109. package/dist/lib/utils/compose.d.ts.map +1 -0
  110. package/dist/lib/utils/dom.d.ts +22 -0
  111. package/dist/lib/utils/dom.d.ts.map +1 -0
  112. package/dist/lib/utils/field-slots-gate.d.ts +10 -0
  113. package/dist/lib/utils/field-slots-gate.d.ts.map +1 -0
  114. package/dist/lib/utils/logger.d.ts +24 -0
  115. package/dist/lib/utils/logger.d.ts.map +1 -0
  116. package/dist/lib/utils/normalize.d.ts +6 -0
  117. package/dist/lib/utils/normalize.d.ts.map +1 -0
  118. package/dist/lib/utils/use-has-text-slot.d.ts +14 -0
  119. package/dist/lib/utils/use-has-text-slot.d.ts.map +1 -0
  120. package/dist/lizaui.css +458 -0
  121. package/dist/meter/index.cjs.js +2 -2
  122. package/dist/meter/index.es.js +4 -4
  123. package/dist/progress-bar/index.cjs.js +1 -1
  124. package/dist/progress-bar/index.es.js +2 -2
  125. package/dist/radio/index.cjs.js +1 -1
  126. package/dist/radio/index.es.js +2 -2
  127. package/dist/radio-group/index.cjs.js +1 -1
  128. package/dist/radio-group/index.es.js +2 -2
  129. package/dist/slider/index.cjs.js +8 -7
  130. package/dist/slider/index.cjs.js.map +1 -1
  131. package/dist/slider/index.es.js +10 -9
  132. package/dist/slider/index.es.js.map +1 -1
  133. package/dist/tabs/index.cjs.js +1400 -0
  134. package/dist/tabs/index.cjs.js.map +1 -0
  135. package/dist/tabs/index.es.js +1400 -0
  136. package/dist/tabs/index.es.js.map +1 -0
  137. package/dist/tabs.d.ts +2 -0
  138. package/dist/toggle-switch/index.cjs.js +8 -7
  139. package/dist/toggle-switch/index.cjs.js.map +1 -1
  140. package/dist/toggle-switch/index.es.js +8 -7
  141. package/dist/toggle-switch/index.es.js.map +1 -1
  142. package/dist/toolbar/index.cjs.js +2 -2
  143. package/dist/toolbar/index.es.js +4 -4
  144. package/package.json +6 -1
  145. package/dist/chunks/Button-B-wLEikV.js.map +0 -1
  146. package/dist/chunks/Button-DdtCMsXJ.js.map +0 -1
  147. package/dist/chunks/SharedElementTransition-BxczX23g.js +0 -12
  148. package/dist/chunks/SharedElementTransition-D87oSBzB.js +0 -13
  149. package/dist/chunks/VisuallyHidden-CiBoSB1U.js.map +0 -1
  150. package/dist/chunks/VisuallyHidden-paROiuP0.js +0 -86
  151. package/dist/chunks/VisuallyHidden-paROiuP0.js.map +0 -1
  152. package/dist/chunks/useLabel-DgF69V6e.js.map +0 -1
  153. package/dist/chunks/useLabel-DjFU7E9u.js.map +0 -1
@@ -1,229 +1,25 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { c } from "react/compiler-runtime";
3
3
  import { t as tableVariants } from "../chunks/data-table-CtvkKzD_.js";
4
- import React__default, { useEffect, useMemo, createContext, cloneElement, forwardRef, useContext, useCallback, useState, useRef, isValidElement, version } from "react";
5
- import { h as $c7eafbbe1ea5834e$export$535bd6ca7f90a273, f as $c4867b2f328c2698$export$e5c5a5f917a5871c, g as $390e54f620492c70$export$f680877a34711e37, d as $bbaa08b3cd72f041$export$9d1611c77c2fe928, i as $a4e76a5424781910$export$e08e3b67e392101e, j as $03e8ab2d84d7657a$export$4338b53315abf666, b as $7230ffa83bc0c2cf$export$4d86445c2cf5e3, l as $7230ffa83bc0c2cf$export$2881499e37b75b9a, c as $7230ffa83bc0c2cf$export$df3a06d6289f983e, o as $7230ffa83bc0c2cf$export$c62b8e45d58ddad9, $ as $7230ffa83bc0c2cf$export$29f1550f4b0d4415, e as $7230ffa83bc0c2cf$export$c245e6201fed2f75 } from "../chunks/utils-B3shU_E6.js";
6
- import { a as $d7f64c32b702fe2c$export$8dc98ba7eadeaa56, b as $a46cf152bb926da5$export$a9b970dcc4ae71a9, c as $7705c033048f6da7$export$24d547caef80ccd1 } from "../chunks/Button-B-wLEikV.js";
7
- import { $ as $792f28e438b9ad5f$export$758399f318e6385a } from "../chunks/SharedElementTransition-D87oSBzB.js";
8
- import { $ as $6f0c29017aeec335$export$d68d59712b04d9d1, a as $6f0c29017aeec335$export$408d25a4e12db025, b as $6f0c29017aeec335$export$8258a0665a675899, c as $6f0c29017aeec335$export$b1918e978f1ee46f } from "../chunks/BaseCollection-CdxYWaH6.js";
9
- import { a as $fe16bffc7a557bf0$export$7f54fc3180508a52, j as $d1116acdf220c2da$export$f9762fab77588ecb, i as $8296dad1a4c5e0dc$export$8f71654801c2f7cd, $ as $48a7d519b337145d$export$4eaf04e54aa8eed6, e as $d1116acdf220c2da$export$4c014de7c8940b4c, f as $0c4a58759813079a$export$4e328f61c538687f, g as $e969f22b6713ca4a$export$ae780daf29e6d456 } from "../chunks/useHover-_Q7y99al.js";
10
- import ReactDOM__default, { createPortal, flushSync } from "react-dom";
4
+ import React__default, { useMemo, createContext, useRef, useEffect, useCallback, forwardRef, useContext, useState } from "react";
5
+ import { g as $c4867b2f328c2698$export$e5c5a5f917a5871c, h as $390e54f620492c70$export$f680877a34711e37, d as $bbaa08b3cd72f041$export$9d1611c77c2fe928, j as $a4e76a5424781910$export$e08e3b67e392101e, f as $03e8ab2d84d7657a$export$4338b53315abf666, b as $7230ffa83bc0c2cf$export$4d86445c2cf5e3, l as $7230ffa83bc0c2cf$export$2881499e37b75b9a, c as $7230ffa83bc0c2cf$export$df3a06d6289f983e, o as $7230ffa83bc0c2cf$export$c62b8e45d58ddad9, $ as $7230ffa83bc0c2cf$export$29f1550f4b0d4415, e as $7230ffa83bc0c2cf$export$c245e6201fed2f75 } from "../chunks/utils-BCEhcDlv.js";
6
+ import { a as $a46cf152bb926da5$export$a9b970dcc4ae71a9, b as $7705c033048f6da7$export$24d547caef80ccd1 } from "../chunks/Button-CFYOfByw.js";
7
+ import { o as $901761b40e390936$export$2bb74740c4e19def, p as $22bbea12c2567021$export$c3d8340acf92597f, q as $121970af65029459$export$f8aeda7b10753fa1, r as $cd5ea4b915021f1d$export$fbdeaa6a76694f71, s as $cd5ea4b915021f1d$export$7475b2c64539e4cf, $ as $60f19cefd567a3e4$export$253fe78d46329472, t as $cd5ea4b915021f1d$export$1005530eda016c13, b as $4a07ac835f260f78$export$6c8a5aaad13c9852, a as $d03379b88399b8c5$export$6cd28814d92fa9c9, u as $cd5ea4b915021f1d$export$5f3398f8733f90e2, e as $d667c2af82d35a98$export$d6daf82dcd84e87c, d as $bf14c9739fda2eb3$export$eac1895992b9f3d6, c as $f6ba6936bfd098a0$export$ecf600387e221c37, v as $51a3e22a5186a962$export$c826860796309d1b, g as $42ceafc619f9c3ba$export$18af5c7a9e9b3664, k as $263ab7fc0f95ccdb$export$4feb769f8ddf26c5, l as $263ab7fc0f95ccdb$export$a164736487e3f0ae, j as $b24d1bc31a0f941d$export$a9d04c5684123369, w as $42ceafc619f9c3ba$export$e953bb1cd0f19726, h as $91fe5e721c7f36c1$export$c9549807523555e0, i as $42ceafc619f9c3ba$export$fb8073518f34e6ec, x as $a80bd3e9349588e7$export$727c8fc270210f13, f as $42ceafc619f9c3ba$export$bf788dd355e3a401 } from "../chunks/useHasTabbableChild-CSJ0P5QT.js";
8
+ import { $ as $792f28e438b9ad5f$export$758399f318e6385a } from "../chunks/SharedElementTransition-CJVe1D_I.js";
9
+ import { b as $6f0c29017aeec335$export$8258a0665a675899, $ as $6f0c29017aeec335$export$d68d59712b04d9d1, a as $6f0c29017aeec335$export$408d25a4e12db025, c as $6f0c29017aeec335$export$b1918e978f1ee46f } from "../chunks/BaseCollection-CdxYWaH6.js";
11
10
  import { $ as $8e9d2fae0ecb9001$export$457c3d6518dd4c6f } from "../chunks/filterDOMProps-DqJGvnmf.js";
12
- import { a as $535772f9d2c1f38d$export$2d6ec8fc375ceafa, b as $535772f9d2c1f38d$export$20e40289641fbbb6 } from "../chunks/FocusScope-BVEv8CgQ.js";
13
- import { f as $d447af545b77c9f1$export$b204af158042fbac, g as $23f2114a1b82827e$export$cd4e5573fbe2b576, t as $2add3ce32c6007eb$export$9ac100e40613ea10, A as $d447af545b77c9f1$export$f531f92e2a15358f, w as $2add3ce32c6007eb$export$78551043582a6a98, h as $2add3ce32c6007eb$export$a11b0059900ceec8, a as $23f2114a1b82827e$export$e58f029f0fbfdb29, e as $3b8b240c1bf84ab9$export$4c063cf1350e6fed, v as $2add3ce32c6007eb$export$fedb369cb70207f1, B as $2add3ce32c6007eb$export$e1865c3bedcd822b, c as $23f2114a1b82827e$export$4282f70798064fe0, C as $caaf0dd3060ed57c$export$9a302a45f65d0572, j as $f192c2f16961cbe0$export$80f3e147d781571c, D as $23f2114a1b82827e$export$b4f377a2b6254582, d as $3b8b240c1bf84ab9$export$bebd5a1431fec25d, q as $1969ac565cfec8d0$export$de79e2c695e052f3, k as $8f5a2122b0992be3$export$630ff653c5ada6a9, $ as $d447af545b77c9f1$export$f21a1ffae260145a, s as $caaf0dd3060ed57c$export$95185d699e05d4d7, E as $8f5a2122b0992be3$export$98e20ec92f614cfe, y as $8f5a2122b0992be3$export$b9b3dfddab17db27, F as $caaf0dd3060ed57c$export$bdc77b0c0a3a85d6 } from "../chunks/focusSafely--u_yGz_7.js";
11
+ import { a as $535772f9d2c1f38d$export$2d6ec8fc375ceafa, b as $535772f9d2c1f38d$export$20e40289641fbbb6 } from "../chunks/FocusScope-jSNMAXzg.js";
12
+ import { a as $fe16bffc7a557bf0$export$7f54fc3180508a52, e as $d1116acdf220c2da$export$4c014de7c8940b4c, i as $8296dad1a4c5e0dc$export$8f71654801c2f7cd, f as $0c4a58759813079a$export$4e328f61c538687f, g as $e969f22b6713ca4a$export$ae780daf29e6d456 } from "../chunks/useHover-BHCSbkLb.js";
14
13
  import { $ as $4064df0d6f9620e1$export$c9058316764c140e } from "../chunks/mergeRefs-t6d4XvXq.js";
15
- import { $ as $3e6197669829fe11$export$40bfa8c7b0832715, b as $ea3928288112382f$export$a966af930f325cab } from "../chunks/VisuallyHidden-paROiuP0.js";
16
- import { $ as $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7 } from "../chunks/I18nProvider-Dfr8Km7j.js";
17
- import { a as $7096878c21af5e66$export$a929f3f93e2cc67e, $ as $d27d541f9569d26d$export$45712eceda6fad21 } from "../chunks/usePress-BnXPCNhr.js";
18
- import { b as $e8ac3c3f5d4bae7f$export$d6875122194c7b44 } from "../chunks/useLabel-DgF69V6e.js";
19
- import { $ as $1dfdc54e7eb53ba0$export$36da96379f79f245 } from "../chunks/useMove-D5nRSeRO.js";
14
+ import ReactDOM__default from "react-dom";
15
+ import { $ as $3e6197669829fe11$export$40bfa8c7b0832715 } from "../chunks/useControlledState-DZA25XHU.js";
16
+ import { $ as $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7 } from "../chunks/I18nProvider-Coj9x7B8.js";
17
+ import { G as $8f5a2122b0992be3$export$98e20ec92f614cfe, c as $23f2114a1b82827e$export$4282f70798064fe0, a as $23f2114a1b82827e$export$e58f029f0fbfdb29, g as $23f2114a1b82827e$export$cd4e5573fbe2b576, f as $d447af545b77c9f1$export$b204af158042fbac, F as $23f2114a1b82827e$export$b4f377a2b6254582, j as $f192c2f16961cbe0$export$80f3e147d781571c, y as $8f5a2122b0992be3$export$b9b3dfddab17db27, h as $2add3ce32c6007eb$export$a11b0059900ceec8, H as $caaf0dd3060ed57c$export$bdc77b0c0a3a85d6 } from "../chunks/focusSafely-DfEgLKh6.js";
18
+ import { $ as $d27d541f9569d26d$export$45712eceda6fad21 } from "../chunks/usePress-Arf10jW0.js";
19
+ import { $ as $e8ac3c3f5d4bae7f$export$d6875122194c7b44 } from "../chunks/useLabels-Bl0mJafM.js";
20
+ import { $ as $1dfdc54e7eb53ba0$export$36da96379f79f245 } from "../chunks/useMove-Xpbmb6OD.js";
21
+ import { a as $ea3928288112382f$export$a966af930f325cab } from "../chunks/VisuallyHidden-DPJuOMsW.js";
20
22
  import { cx } from "tailwind-variants";
21
- const $8b2399d051d06d4c$export$447a38995de2c711 = "react-aria-clear-focus";
22
- const $8b2399d051d06d4c$export$831c820ad60f9d12 = "react-aria-focus";
23
- function $b72f3f7b3b5f42c6$export$76e4e37e5339496d(to) {
24
- let from = $b72f3f7b3b5f42c6$export$759df0d867455a91($d447af545b77c9f1$export$b204af158042fbac(to));
25
- if (from !== to) {
26
- if (from) $b72f3f7b3b5f42c6$export$6c5dc7e81d2cc29a(from, to);
27
- if (to) $b72f3f7b3b5f42c6$export$2b35b76d2e30e129(to, from);
28
- }
29
- }
30
- function $b72f3f7b3b5f42c6$export$6c5dc7e81d2cc29a(from, to) {
31
- from.dispatchEvent(new FocusEvent("blur", {
32
- relatedTarget: to
33
- }));
34
- from.dispatchEvent(new FocusEvent("focusout", {
35
- bubbles: true,
36
- relatedTarget: to
37
- }));
38
- }
39
- function $b72f3f7b3b5f42c6$export$2b35b76d2e30e129(to, from) {
40
- to.dispatchEvent(new FocusEvent("focus", {
41
- relatedTarget: from
42
- }));
43
- to.dispatchEvent(new FocusEvent("focusin", {
44
- bubbles: true,
45
- relatedTarget: from
46
- }));
47
- }
48
- function $b72f3f7b3b5f42c6$export$759df0d867455a91(document2) {
49
- let activeElement = $23f2114a1b82827e$export$cd4e5573fbe2b576(document2);
50
- let activeDescendant = activeElement?.getAttribute("aria-activedescendant");
51
- if (activeDescendant) return document2.getElementById(activeDescendant) || activeElement;
52
- return activeElement;
53
- }
54
- const $bb39c0fc1c19b34c$var$KEYBOARD_HEIGHT = 100;
55
- const $bb39c0fc1c19b34c$var$KEYBOARD_TIMEOUT = 600;
56
- const $bb39c0fc1c19b34c$var$state = {
57
- isOpen: false,
58
- screenWidth: 0,
59
- screenHeight: 0,
60
- screenAngle: 0,
61
- screenTimeout: 0,
62
- startTimeStamp: 0,
63
- endTimeStamp: 0,
64
- resizeTimeStamp: 0,
65
- resizeTimeout: 0
66
- };
67
- const $bb39c0fc1c19b34c$var$nonTextInputTypes = /* @__PURE__ */ new Set([
68
- "checkbox",
69
- "radio",
70
- "range",
71
- "color",
72
- "file",
73
- "image",
74
- "button",
75
- "submit",
76
- "reset"
77
- ]);
78
- if (process.env.NODE_ENV === "test" && typeof window !== "undefined" && !Reflect.has(window, "visualViewport")) {
79
- const visualViewport = Object.assign(new EventTarget(), {
80
- offsetTop: 0,
81
- offsetLeft: 0,
82
- pageTop: 0,
83
- pageLeft: 0,
84
- scale: 1
85
- });
86
- Reflect.defineProperty(visualViewport, "width", {
87
- get: () => window.innerWidth,
88
- configurable: true
89
- });
90
- Reflect.defineProperty(visualViewport, "height", {
91
- get: () => window.innerHeight,
92
- configurable: true
93
- });
94
- Reflect.defineProperty(window, "visualViewport", {
95
- value: visualViewport,
96
- configurable: true,
97
- writable: true
98
- });
99
- }
100
- if (process.env.NODE_ENV === "test" && typeof window !== "undefined" && !Reflect.has(window.screen, "orientation")) {
101
- const orientation = Object.assign(new EventTarget(), {
102
- type: "landscape-primary"
103
- });
104
- Reflect.defineProperty(window.screen, "orientation", {
105
- value: orientation,
106
- configurable: true,
107
- writable: true
108
- });
109
- Reflect.defineProperty(window.screen.orientation, "angle", {
110
- get: () => window.orientation ?? 0,
111
- configurable: true
112
- });
113
- }
114
- function $bb39c0fc1c19b34c$var$getTouchScreen() {
115
- let screenWidth = Number(window.visualViewport?.width ?? window.innerWidth);
116
- let screenHeight = Number(window.visualViewport?.height ?? window.innerHeight);
117
- let visualScale = Number(window.visualViewport?.scale ?? 1);
118
- return {
119
- width: screenWidth * visualScale,
120
- height: screenHeight * visualScale,
121
- angle: window.screen.orientation.angle
122
- };
123
- }
124
- function $bb39c0fc1c19b34c$var$onResizeStart(e) {
125
- if ($bb39c0fc1c19b34c$var$state.resizeTimeStamp <= e.timeStamp + 50) {
126
- $bb39c0fc1c19b34c$var$state.resizeTimeStamp = e.timeStamp + 150;
127
- window.clearTimeout($bb39c0fc1c19b34c$var$state.resizeTimeout);
128
- $bb39c0fc1c19b34c$var$state.resizeTimeout = window.setTimeout($bb39c0fc1c19b34c$var$onResizeEnd, 150);
129
- }
130
- }
131
- function $bb39c0fc1c19b34c$var$onResizeEnd() {
132
- let viewportMeta = $7096878c21af5e66$export$a929f3f93e2cc67e("viewport");
133
- if ($2add3ce32c6007eb$export$a11b0059900ceec8() && viewportMeta?.includes("overlays-content")) return;
134
- let time = performance.now();
135
- let screen = $bb39c0fc1c19b34c$var$getTouchScreen();
136
- let elapsed = time - $bb39c0fc1c19b34c$var$state.startTimeStamp;
137
- let delta = $bb39c0fc1c19b34c$var$state.screenHeight - screen.height;
138
- let rotation = $bb39c0fc1c19b34c$var$state.screenAngle - screen.angle;
139
- if (Math.abs(rotation) % 180 && $bb39c0fc1c19b34c$var$state.screenWidth - screen.height < $bb39c0fc1c19b34c$var$KEYBOARD_HEIGHT) {
140
- $bb39c0fc1c19b34c$var$state.screenWidth = screen.width;
141
- $bb39c0fc1c19b34c$var$state.screenHeight = screen.height;
142
- $bb39c0fc1c19b34c$var$state.screenAngle = screen.angle;
143
- delta = 0;
144
- }
145
- if (elapsed > $bb39c0fc1c19b34c$var$KEYBOARD_TIMEOUT) {
146
- window.clearTimeout($bb39c0fc1c19b34c$var$state.screenTimeout);
147
- $bb39c0fc1c19b34c$var$state.screenTimeout = window.setTimeout(() => {
148
- let activeElement = document.hasFocus() ? $23f2114a1b82827e$export$cd4e5573fbe2b576() : null;
149
- let willKeyboardOpen = $bb39c0fc1c19b34c$export$c57958e35f31ed73(activeElement);
150
- let screen2 = $bb39c0fc1c19b34c$var$getTouchScreen();
151
- if (Math.abs($bb39c0fc1c19b34c$var$state.screenAngle - screen2.angle) % 180) return;
152
- if ($bb39c0fc1c19b34c$var$state.isOpen && willKeyboardOpen) return;
153
- $bb39c0fc1c19b34c$var$state.screenWidth = screen2.width;
154
- $bb39c0fc1c19b34c$var$state.screenHeight = screen2.height;
155
- $bb39c0fc1c19b34c$var$state.screenAngle = screen2.angle;
156
- $bb39c0fc1c19b34c$var$state.isOpen = false;
157
- }, $bb39c0fc1c19b34c$var$KEYBOARD_TIMEOUT);
158
- }
159
- if (elapsed <= $bb39c0fc1c19b34c$var$KEYBOARD_TIMEOUT && delta >= $bb39c0fc1c19b34c$var$KEYBOARD_HEIGHT) $bb39c0fc1c19b34c$var$state.endTimeStamp = time;
160
- $bb39c0fc1c19b34c$var$state.isOpen = delta >= $bb39c0fc1c19b34c$var$KEYBOARD_HEIGHT;
161
- }
162
- function $bb39c0fc1c19b34c$var$onOrientationChange() {
163
- let screen = $bb39c0fc1c19b34c$var$getTouchScreen();
164
- let rotation = $bb39c0fc1c19b34c$var$state.screenAngle - screen.angle;
165
- if (Math.abs(rotation) % 180 && !$bb39c0fc1c19b34c$var$state.isOpen) {
166
- let width = $bb39c0fc1c19b34c$var$state.screenWidth;
167
- let height = $bb39c0fc1c19b34c$var$state.screenHeight;
168
- $bb39c0fc1c19b34c$var$state.screenWidth = height;
169
- $bb39c0fc1c19b34c$var$state.screenHeight = width;
170
- }
171
- if (!$bb39c0fc1c19b34c$var$state.isOpen) $bb39c0fc1c19b34c$var$state.screenAngle = screen.angle;
172
- }
173
- function $bb39c0fc1c19b34c$var$onFocus(e) {
174
- let target = $23f2114a1b82827e$export$e58f029f0fbfdb29(e);
175
- let willKeyboardOpen = $bb39c0fc1c19b34c$export$c57958e35f31ed73(target);
176
- let time = performance.now();
177
- let screen = $bb39c0fc1c19b34c$var$getTouchScreen();
178
- let delta = $bb39c0fc1c19b34c$var$state.screenHeight - screen.height;
179
- if (delta < $bb39c0fc1c19b34c$var$KEYBOARD_HEIGHT && willKeyboardOpen) {
180
- $bb39c0fc1c19b34c$var$state.screenWidth = screen.width;
181
- $bb39c0fc1c19b34c$var$state.screenHeight = screen.height;
182
- $bb39c0fc1c19b34c$var$state.screenAngle = screen.angle;
183
- $bb39c0fc1c19b34c$var$state.startTimeStamp = time;
184
- }
185
- if (willKeyboardOpen) window.clearTimeout($bb39c0fc1c19b34c$var$state.screenTimeout);
186
- if (delta >= $bb39c0fc1c19b34c$var$KEYBOARD_HEIGHT && willKeyboardOpen) $bb39c0fc1c19b34c$var$state.endTimeStamp = time;
187
- }
188
- function $bb39c0fc1c19b34c$var$setupGlobalEvents() {
189
- let screen = $bb39c0fc1c19b34c$var$getTouchScreen();
190
- $d447af545b77c9f1$export$f531f92e2a15358f(window.visualViewport, "resize", $2add3ce32c6007eb$export$78551043582a6a98() ? $bb39c0fc1c19b34c$var$onResizeEnd : $bb39c0fc1c19b34c$var$onResizeStart);
191
- $d447af545b77c9f1$export$f531f92e2a15358f(window.screen.orientation, "change", $bb39c0fc1c19b34c$var$onOrientationChange);
192
- $d447af545b77c9f1$export$f531f92e2a15358f(window, "focus", $bb39c0fc1c19b34c$var$onFocus, {
193
- capture: true,
194
- passive: true
195
- });
196
- $bb39c0fc1c19b34c$var$state.screenWidth = screen.width;
197
- $bb39c0fc1c19b34c$var$state.screenHeight = screen.height;
198
- $bb39c0fc1c19b34c$var$state.screenAngle = screen.angle;
199
- }
200
- if (typeof document !== "undefined") {
201
- if (document.readyState !== "loading") $bb39c0fc1c19b34c$var$setupGlobalEvents();
202
- else $d447af545b77c9f1$export$f531f92e2a15358f(document, "DOMContentLoaded", $bb39c0fc1c19b34c$var$setupGlobalEvents);
203
- }
204
- function $bb39c0fc1c19b34c$export$c57958e35f31ed73(target) {
205
- if (!(target instanceof Element) || !$3b8b240c1bf84ab9$export$4c063cf1350e6fed(target)) return false;
206
- let isTextArea = target instanceof HTMLTextAreaElement;
207
- let isEditable = target instanceof HTMLElement && target.isContentEditable;
208
- let isTextInput = target instanceof HTMLInputElement && !$bb39c0fc1c19b34c$var$nonTextInputTypes.has(target.type);
209
- return isTextArea || isEditable || isTextInput;
210
- }
211
- function $bb39c0fc1c19b34c$export$16792effe837dba3(event) {
212
- return $2add3ce32c6007eb$export$9ac100e40613ea10() ? event.metaKey : event.ctrlKey;
213
- }
214
- function $600b3cf69ae46262$export$90fc3a17d93f704c(ref, event, listener, options) {
215
- let handleEvent = $fe16bffc7a557bf0$export$7f54fc3180508a52(listener);
216
- let isDisabled = listener == null;
217
- useEffect(() => {
218
- if (isDisabled || ref.current == null) return;
219
- return $d447af545b77c9f1$export$f531f92e2a15358f(ref.current, event, handleEvent, options);
220
- }, [
221
- ref,
222
- event,
223
- options,
224
- isDisabled
225
- ]);
226
- }
227
23
  const $a747a10fe70a57da$var$localeSymbol = /* @__PURE__ */ Symbol.for("react-aria.i18n.locale");
228
24
  const $a747a10fe70a57da$var$stringsSymbol = /* @__PURE__ */ Symbol.for("react-aria.i18n.strings");
229
25
  let $a747a10fe70a57da$var$cachedGlobalStrings = void 0;
@@ -347,733 +143,6 @@ function $cf2482eff2eeeec2$export$f12b703ca79dfbb1(strings, packageName) {
347
143
  }
348
144
  const $4b38b5b75ecc6208$export$b0d3ecf7112093a7 = /* @__PURE__ */ createContext(null);
349
145
  const $4b38b5b75ecc6208$export$698f465ec27e93df = /* @__PURE__ */ createContext(null);
350
- class $96ead35620b8fd36$export$410b0c854570d131 {
351
- constructor(ownerDocument) {
352
- this._firstChild = null;
353
- this._lastChild = null;
354
- this._previousSibling = null;
355
- this._nextSibling = null;
356
- this._parentNode = null;
357
- this._minInvalidChildIndex = null;
358
- this.ownerDocument = ownerDocument;
359
- }
360
- *[Symbol.iterator]() {
361
- let node = this.firstChild;
362
- while (node) {
363
- yield node;
364
- node = node.nextSibling;
365
- }
366
- }
367
- get firstChild() {
368
- return this._firstChild;
369
- }
370
- set firstChild(firstChild) {
371
- this._firstChild = firstChild;
372
- this.ownerDocument.markDirty(this);
373
- }
374
- get lastChild() {
375
- return this._lastChild;
376
- }
377
- set lastChild(lastChild) {
378
- this._lastChild = lastChild;
379
- this.ownerDocument.markDirty(this);
380
- }
381
- get previousSibling() {
382
- return this._previousSibling;
383
- }
384
- set previousSibling(previousSibling) {
385
- this._previousSibling = previousSibling;
386
- this.ownerDocument.markDirty(this);
387
- }
388
- get nextSibling() {
389
- return this._nextSibling;
390
- }
391
- set nextSibling(nextSibling) {
392
- this._nextSibling = nextSibling;
393
- this.ownerDocument.markDirty(this);
394
- }
395
- get parentNode() {
396
- return this._parentNode;
397
- }
398
- set parentNode(parentNode) {
399
- this._parentNode = parentNode;
400
- this.ownerDocument.markDirty(this);
401
- }
402
- get isConnected() {
403
- return this.parentNode?.isConnected || false;
404
- }
405
- invalidateChildIndices(child) {
406
- if (this._minInvalidChildIndex == null || !this._minInvalidChildIndex.isConnected || child.index < this._minInvalidChildIndex.index) {
407
- this._minInvalidChildIndex = child;
408
- this.ownerDocument.markDirty(this);
409
- }
410
- }
411
- updateChildIndices() {
412
- let node = this._minInvalidChildIndex;
413
- while (node) {
414
- node.index = node.previousSibling ? node.previousSibling.index + 1 : 0;
415
- node = node.nextSibling;
416
- }
417
- this._minInvalidChildIndex = null;
418
- }
419
- appendChild(child) {
420
- if (child.parentNode) child.parentNode.removeChild(child);
421
- if (this.firstChild == null) this.firstChild = child;
422
- if (this.lastChild) {
423
- this.lastChild.nextSibling = child;
424
- child.index = this.lastChild.index + 1;
425
- child.previousSibling = this.lastChild;
426
- } else {
427
- child.previousSibling = null;
428
- child.index = 0;
429
- }
430
- child.parentNode = this;
431
- child.nextSibling = null;
432
- this.lastChild = child;
433
- this.ownerDocument.markDirty(this);
434
- if (this.isConnected) this.ownerDocument.queueUpdate();
435
- }
436
- insertBefore(newNode, referenceNode) {
437
- if (referenceNode == null) return this.appendChild(newNode);
438
- if (newNode.parentNode) newNode.parentNode.removeChild(newNode);
439
- newNode.nextSibling = referenceNode;
440
- newNode.previousSibling = referenceNode.previousSibling;
441
- newNode.index = referenceNode.index - 1;
442
- if (this.firstChild === referenceNode) this.firstChild = newNode;
443
- else if (referenceNode.previousSibling) referenceNode.previousSibling.nextSibling = newNode;
444
- referenceNode.previousSibling = newNode;
445
- newNode.parentNode = referenceNode.parentNode;
446
- this.invalidateChildIndices(newNode);
447
- if (this.isConnected) this.ownerDocument.queueUpdate();
448
- }
449
- removeChild(child) {
450
- if (child.parentNode !== this) return;
451
- if (this._minInvalidChildIndex === child) this._minInvalidChildIndex = null;
452
- if (child.nextSibling) {
453
- this.invalidateChildIndices(child.nextSibling);
454
- child.nextSibling.previousSibling = child.previousSibling;
455
- }
456
- if (child.previousSibling) child.previousSibling.nextSibling = child.nextSibling;
457
- if (this.firstChild === child) this.firstChild = child.nextSibling;
458
- if (this.lastChild === child) this.lastChild = child.previousSibling;
459
- child.parentNode = null;
460
- child.nextSibling = null;
461
- child.previousSibling = null;
462
- child.index = 0;
463
- this.ownerDocument.markDirty(child);
464
- if (this.isConnected) this.ownerDocument.queueUpdate();
465
- }
466
- addEventListener() {
467
- }
468
- removeEventListener() {
469
- }
470
- get previousVisibleSibling() {
471
- let node = this.previousSibling;
472
- while (node && node.isHidden) node = node.previousSibling;
473
- return node;
474
- }
475
- get nextVisibleSibling() {
476
- let node = this.nextSibling;
477
- while (node && node.isHidden) node = node.nextSibling;
478
- return node;
479
- }
480
- get firstVisibleChild() {
481
- let node = this.firstChild;
482
- while (node && node.isHidden) node = node.nextSibling;
483
- return node;
484
- }
485
- get lastVisibleChild() {
486
- let node = this.lastChild;
487
- while (node && node.isHidden) node = node.previousSibling;
488
- return node;
489
- }
490
- }
491
- class $96ead35620b8fd36$export$dc064fe9e59310fd extends $96ead35620b8fd36$export$410b0c854570d131 {
492
- constructor(type, ownerDocument) {
493
- super(ownerDocument), this.nodeType = 8, this.isMutated = true, this._index = 0, this.isHidden = false;
494
- this.node = null;
495
- }
496
- get index() {
497
- return this._index;
498
- }
499
- set index(index) {
500
- this._index = index;
501
- this.ownerDocument.markDirty(this);
502
- }
503
- get level() {
504
- if (this.parentNode instanceof $96ead35620b8fd36$export$dc064fe9e59310fd) return this.parentNode.level + (this.parentNode.node?.type === "item" ? 1 : 0);
505
- return 0;
506
- }
507
- /**
508
- * Lazily gets a mutable instance of a Node. If the node has already
509
- * been cloned during this update cycle, it just returns the existing one.
510
- */
511
- getMutableNode() {
512
- if (this.node == null) return null;
513
- if (!this.isMutated) {
514
- this.node = this.node.clone();
515
- this.isMutated = true;
516
- }
517
- this.ownerDocument.markDirty(this);
518
- return this.node;
519
- }
520
- updateNode() {
521
- let nextSibling = this.nextVisibleSibling;
522
- let node = this.getMutableNode();
523
- if (node == null) return;
524
- node.index = this.index;
525
- node.level = this.level;
526
- node.parentKey = this.parentNode instanceof $96ead35620b8fd36$export$dc064fe9e59310fd ? this.parentNode.node?.key ?? null : null;
527
- node.prevKey = this.previousVisibleSibling?.node?.key ?? null;
528
- node.nextKey = nextSibling?.node?.key ?? null;
529
- node.hasChildNodes = !!this.firstChild;
530
- node.firstChildKey = this.firstVisibleChild?.node?.key ?? null;
531
- node.lastChildKey = this.lastVisibleChild?.node?.key ?? null;
532
- if ((node.colSpan != null || node.colIndex != null) && nextSibling) {
533
- let nextColIndex = (node.colIndex ?? node.index) + (node.colSpan ?? 1);
534
- if (nextSibling.node != null && nextColIndex !== nextSibling.node.colIndex) {
535
- let siblingNode = nextSibling.getMutableNode();
536
- siblingNode.colIndex = nextColIndex;
537
- }
538
- }
539
- }
540
- setProps(obj, ref, CollectionNodeClass, rendered, render) {
541
- let node;
542
- let { value: value1, textValue, id, ...props } = obj;
543
- if (this.node == null) {
544
- node = new CollectionNodeClass(id ?? `react-aria-${++this.ownerDocument.nodeId}`);
545
- this.node = node;
546
- } else node = this.getMutableNode();
547
- props.ref = ref;
548
- node.props = props;
549
- node.rendered = rendered;
550
- node.render = render;
551
- node.value = value1;
552
- if (obj["aria-label"]) node["aria-label"] = obj["aria-label"];
553
- node.textValue = textValue || (typeof props.children === "string" ? props.children : "") || obj["aria-label"] || "";
554
- if (id != null && id !== node.key) throw new Error("Cannot change the id of an item");
555
- if (props.colSpan != null) node.colSpan = props.colSpan;
556
- if (this.isConnected) this.ownerDocument.queueUpdate();
557
- }
558
- get style() {
559
- let element = this;
560
- return {
561
- get display() {
562
- return element.isHidden ? "none" : "";
563
- },
564
- set display(value) {
565
- let isHidden = value === "none";
566
- if (element.isHidden !== isHidden) {
567
- if (element.parentNode?.firstVisibleChild === element || element.parentNode?.lastVisibleChild === element) element.ownerDocument.markDirty(element.parentNode);
568
- let prev = element.previousVisibleSibling;
569
- let next = element.nextVisibleSibling;
570
- if (prev) element.ownerDocument.markDirty(prev);
571
- if (next) element.ownerDocument.markDirty(next);
572
- element.isHidden = isHidden;
573
- element.ownerDocument.markDirty(element);
574
- }
575
- }
576
- };
577
- }
578
- hasAttribute() {
579
- }
580
- setAttribute() {
581
- }
582
- setAttributeNS() {
583
- }
584
- removeAttribute() {
585
- }
586
- }
587
- class $96ead35620b8fd36$export$b34a105447964f9f extends $96ead35620b8fd36$export$410b0c854570d131 {
588
- constructor(collection) {
589
- super(null), this.nodeType = 11, this.ownerDocument = this, this.dirtyNodes = /* @__PURE__ */ new Set(), this.isSSR = false, this.nodeId = 0, this.nodesByProps = /* @__PURE__ */ new WeakMap(), this.keyOwners = /* @__PURE__ */ new Map(), this.nextCollection = null, this.subscriptions = /* @__PURE__ */ new Set(), this.queuedRender = false, this.inSubscription = false;
590
- this.collection = collection;
591
- this.nextCollection = collection;
592
- }
593
- get isConnected() {
594
- return true;
595
- }
596
- createElement(type) {
597
- return new $96ead35620b8fd36$export$dc064fe9e59310fd(type, this);
598
- }
599
- getMutableCollection() {
600
- if (!this.nextCollection) this.nextCollection = this.collection.clone();
601
- return this.nextCollection;
602
- }
603
- markDirty(node) {
604
- this.dirtyNodes.add(node);
605
- }
606
- addNode(element) {
607
- if (element.isHidden || element.node == null) return;
608
- if (process.env.NODE_ENV !== "production") {
609
- let key = element.node.key;
610
- let owner = this.keyOwners.get(key);
611
- if (owner && owner !== element) throw new Error(`Duplicate key "${String(key)}" found in collection. Every item in a collection must have a unique key.`);
612
- this.keyOwners.set(key, element);
613
- }
614
- let collection = this.getMutableCollection();
615
- if (!collection.getItem(element.node.key)) for (let child of element) this.addNode(child);
616
- collection.addNode(element.node);
617
- }
618
- removeNode(node) {
619
- for (let child of node) this.removeNode(child);
620
- if (node.node) {
621
- let collection = this.getMutableCollection();
622
- collection.removeNode(node.node.key);
623
- if (process.env.NODE_ENV !== "production" && this.keyOwners.get(node.node.key) === node) this.keyOwners.delete(node.node.key);
624
- }
625
- }
626
- /** Finalizes the collection update, updating all nodes and freezing the collection. */
627
- getCollection() {
628
- if (this.inSubscription) return this.collection;
629
- this.queuedRender = false;
630
- this.updateCollection();
631
- return this.collection;
632
- }
633
- updateCollection() {
634
- for (let element of this.dirtyNodes) if (element instanceof $96ead35620b8fd36$export$dc064fe9e59310fd && (!element.isConnected || element.isHidden)) this.removeNode(element);
635
- else element.updateChildIndices();
636
- for (let element of this.dirtyNodes) if (element instanceof $96ead35620b8fd36$export$dc064fe9e59310fd) {
637
- if (element.isConnected && !element.isHidden) {
638
- element.updateNode();
639
- this.addNode(element);
640
- }
641
- if (element.node) this.dirtyNodes.delete(element);
642
- element.isMutated = false;
643
- } else this.dirtyNodes.delete(element);
644
- if (this.nextCollection) {
645
- this.nextCollection.commit(this.firstVisibleChild?.node?.key ?? null, this.lastVisibleChild?.node?.key ?? null, this.isSSR);
646
- if (!this.isSSR) {
647
- this.collection = this.nextCollection;
648
- this.nextCollection = null;
649
- }
650
- }
651
- }
652
- queueUpdate() {
653
- if (this.dirtyNodes.size === 0 || this.queuedRender) return;
654
- this.queuedRender = true;
655
- this.inSubscription = true;
656
- if (!this.isSSR) this.collection = this.collection.clone();
657
- for (let fn of this.subscriptions) fn();
658
- this.inSubscription = false;
659
- }
660
- subscribe(fn) {
661
- this.subscriptions.add(fn);
662
- if (this.queuedRender) fn();
663
- return () => this.subscriptions.delete(fn);
664
- }
665
- resetAfterSSR() {
666
- if (this.isSSR) {
667
- this.isSSR = false;
668
- this.firstChild = null;
669
- this.lastChild = null;
670
- this.nodeId = 0;
671
- this.keyOwners.clear();
672
- }
673
- }
674
- }
675
- function $a80bd3e9349588e7$export$727c8fc270210f13(props) {
676
- let { children, items, idScope, addIdAndValue, dependencies = [] } = props;
677
- let childrenString = useMemo(() => process.env.NODE_ENV !== "production" && typeof children === "function" ? children.toString() : void 0, [
678
- children
679
- ]);
680
- let cache = useMemo(() => /* @__PURE__ */ new WeakMap(), [
681
- ...dependencies,
682
- childrenString
683
- ]);
684
- return useMemo(() => {
685
- if (items && typeof children === "function") {
686
- let res = [];
687
- for (let item of items) {
688
- let cacheKey = $a80bd3e9349588e7$var$isWeakKey(item) ? item : null;
689
- let rendered = cacheKey ? cache.get(cacheKey) : null;
690
- if (!rendered) {
691
- rendered = children(item);
692
- let id = rendered.props.id ?? item?.key ?? item?.id;
693
- if (idScope != null && rendered.props.id == null && id != null) id = idScope + ":" + id;
694
- let key = id ?? res.length;
695
- rendered = cloneElement(rendered, addIdAndValue ? {
696
- key,
697
- id,
698
- value: item
699
- } : {
700
- key
701
- });
702
- if (cacheKey) cache.set(cacheKey, rendered);
703
- }
704
- res.push(rendered);
705
- }
706
- return res;
707
- } else if (typeof children !== "function") return children;
708
- }, [
709
- children,
710
- items,
711
- cache,
712
- idScope,
713
- addIdAndValue
714
- ]);
715
- }
716
- function $a80bd3e9349588e7$var$isWeakKey(value) {
717
- switch (typeof value) {
718
- case "object":
719
- return value != null;
720
- case "function":
721
- case "symbol":
722
- return true;
723
- default:
724
- return false;
725
- }
726
- }
727
- var shim = { exports: {} };
728
- var useSyncExternalStoreShim_production = {};
729
- var hasRequiredUseSyncExternalStoreShim_production;
730
- function requireUseSyncExternalStoreShim_production() {
731
- if (hasRequiredUseSyncExternalStoreShim_production) return useSyncExternalStoreShim_production;
732
- hasRequiredUseSyncExternalStoreShim_production = 1;
733
- var React = React__default;
734
- function is(x, y) {
735
- return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
736
- }
737
- var objectIs = "function" === typeof Object.is ? Object.is : is, useState2 = React.useState, useEffect2 = React.useEffect, useLayoutEffect = React.useLayoutEffect, useDebugValue = React.useDebugValue;
738
- function useSyncExternalStore$2(subscribe, getSnapshot) {
739
- var value = getSnapshot(), _useState = useState2({ inst: { value, getSnapshot } }), inst = _useState[0].inst, forceUpdate = _useState[1];
740
- useLayoutEffect(
741
- function() {
742
- inst.value = value;
743
- inst.getSnapshot = getSnapshot;
744
- checkIfSnapshotChanged(inst) && forceUpdate({ inst });
745
- },
746
- [subscribe, value, getSnapshot]
747
- );
748
- useEffect2(
749
- function() {
750
- checkIfSnapshotChanged(inst) && forceUpdate({ inst });
751
- return subscribe(function() {
752
- checkIfSnapshotChanged(inst) && forceUpdate({ inst });
753
- });
754
- },
755
- [subscribe]
756
- );
757
- useDebugValue(value);
758
- return value;
759
- }
760
- function checkIfSnapshotChanged(inst) {
761
- var latestGetSnapshot = inst.getSnapshot;
762
- inst = inst.value;
763
- try {
764
- var nextValue = latestGetSnapshot();
765
- return !objectIs(inst, nextValue);
766
- } catch (error) {
767
- return true;
768
- }
769
- }
770
- function useSyncExternalStore$1(subscribe, getSnapshot) {
771
- return getSnapshot();
772
- }
773
- var shim2 = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
774
- useSyncExternalStoreShim_production.useSyncExternalStore = void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim2;
775
- return useSyncExternalStoreShim_production;
776
- }
777
- var useSyncExternalStoreShim_development = {};
778
- var hasRequiredUseSyncExternalStoreShim_development;
779
- function requireUseSyncExternalStoreShim_development() {
780
- if (hasRequiredUseSyncExternalStoreShim_development) return useSyncExternalStoreShim_development;
781
- hasRequiredUseSyncExternalStoreShim_development = 1;
782
- "production" !== process.env.NODE_ENV && (function() {
783
- function is(x, y) {
784
- return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
785
- }
786
- function useSyncExternalStore$2(subscribe, getSnapshot) {
787
- didWarnOld18Alpha || void 0 === React.startTransition || (didWarnOld18Alpha = true, void 0);
788
- var value = getSnapshot();
789
- if (!didWarnUncachedGetSnapshot) {
790
- var cachedValue = getSnapshot();
791
- objectIs(value, cachedValue) || (void 0, didWarnUncachedGetSnapshot = true);
792
- }
793
- cachedValue = useState2({
794
- inst: { value, getSnapshot }
795
- });
796
- var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
797
- useLayoutEffect(
798
- function() {
799
- inst.value = value;
800
- inst.getSnapshot = getSnapshot;
801
- checkIfSnapshotChanged(inst) && forceUpdate({ inst });
802
- },
803
- [subscribe, value, getSnapshot]
804
- );
805
- useEffect2(
806
- function() {
807
- checkIfSnapshotChanged(inst) && forceUpdate({ inst });
808
- return subscribe(function() {
809
- checkIfSnapshotChanged(inst) && forceUpdate({ inst });
810
- });
811
- },
812
- [subscribe]
813
- );
814
- useDebugValue(value);
815
- return value;
816
- }
817
- function checkIfSnapshotChanged(inst) {
818
- var latestGetSnapshot = inst.getSnapshot;
819
- inst = inst.value;
820
- try {
821
- var nextValue = latestGetSnapshot();
822
- return !objectIs(inst, nextValue);
823
- } catch (error) {
824
- return true;
825
- }
826
- }
827
- function useSyncExternalStore$1(subscribe, getSnapshot) {
828
- return getSnapshot();
829
- }
830
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
831
- var React = React__default, objectIs = "function" === typeof Object.is ? Object.is : is, useState2 = React.useState, useEffect2 = React.useEffect, useLayoutEffect = React.useLayoutEffect, useDebugValue = React.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim2 = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
832
- useSyncExternalStoreShim_development.useSyncExternalStore = void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim2;
833
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
834
- })();
835
- return useSyncExternalStoreShim_development;
836
- }
837
- var hasRequiredShim;
838
- function requireShim() {
839
- if (hasRequiredShim) return shim.exports;
840
- hasRequiredShim = 1;
841
- if (process.env.NODE_ENV === "production") {
842
- shim.exports = requireUseSyncExternalStoreShim_production();
843
- } else {
844
- shim.exports = requireUseSyncExternalStoreShim_development();
845
- }
846
- return shim.exports;
847
- }
848
- var shimExports = requireShim();
849
- const $42ceafc619f9c3ba$var$ShallowRenderContext = /* @__PURE__ */ createContext(false);
850
- const $42ceafc619f9c3ba$var$CollectionDocumentContext = /* @__PURE__ */ createContext(null);
851
- function $42ceafc619f9c3ba$export$bf788dd355e3a401(props) {
852
- let doc = useContext($42ceafc619f9c3ba$var$CollectionDocumentContext);
853
- if (doc)
854
- return props.content;
855
- let { collection, document: document2 } = $42ceafc619f9c3ba$var$useCollectionDocument(props.createCollection);
856
- return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement($d7f64c32b702fe2c$export$8dc98ba7eadeaa56, null, /* @__PURE__ */ React__default.createElement($42ceafc619f9c3ba$var$CollectionDocumentContext.Provider, {
857
- value: document2
858
- }, props.content)), /* @__PURE__ */ React__default.createElement($42ceafc619f9c3ba$var$CollectionInner, {
859
- render: props.children,
860
- collection
861
- }));
862
- }
863
- function $42ceafc619f9c3ba$var$CollectionInner({ collection, render }) {
864
- return render(collection);
865
- }
866
- function $42ceafc619f9c3ba$var$useSyncExternalStoreFallback(subscribe, getSnapshot, getServerSnapshot) {
867
- let isSSR = $c7eafbbe1ea5834e$export$535bd6ca7f90a273();
868
- let isSSRRef = useRef(isSSR);
869
- isSSRRef.current = isSSR;
870
- let getSnapshotWrapper = useCallback(() => {
871
- return isSSRRef.current ? getServerSnapshot() : getSnapshot();
872
- }, [
873
- getSnapshot,
874
- getServerSnapshot
875
- ]);
876
- return shimExports.useSyncExternalStore(subscribe, getSnapshotWrapper);
877
- }
878
- const $42ceafc619f9c3ba$var$useSyncExternalStore = typeof React__default["useSyncExternalStore"] === "function" ? React__default["useSyncExternalStore"] : $42ceafc619f9c3ba$var$useSyncExternalStoreFallback;
879
- function $42ceafc619f9c3ba$var$useCollectionDocument(createCollection) {
880
- let [document2] = useState(() => new $96ead35620b8fd36$export$b34a105447964f9f(createCollection?.() || new $6f0c29017aeec335$export$408d25a4e12db025()));
881
- let subscribe = useCallback((fn) => document2.subscribe(fn), [
882
- document2
883
- ]);
884
- let getSnapshot = useCallback(() => {
885
- let collection2 = document2.getCollection();
886
- if (document2.isSSR)
887
- document2.resetAfterSSR();
888
- return collection2;
889
- }, [
890
- document2
891
- ]);
892
- let getServerSnapshot = useCallback(() => {
893
- document2.isSSR = true;
894
- return document2.getCollection();
895
- }, [
896
- document2
897
- ]);
898
- let collection = $42ceafc619f9c3ba$var$useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
899
- return {
900
- collection,
901
- document: document2
902
- };
903
- }
904
- const $42ceafc619f9c3ba$var$SSRContext = /* @__PURE__ */ createContext(null);
905
- function $42ceafc619f9c3ba$var$createCollectionNodeClass(type) {
906
- var _a;
907
- let NodeClass = (_a = class extends $6f0c29017aeec335$export$d68d59712b04d9d1 {
908
- }, _a.type = type, _a);
909
- return NodeClass;
910
- }
911
- function $42ceafc619f9c3ba$var$useSSRCollectionNode(CollectionNodeClass, props, ref, rendered, children, render) {
912
- if (typeof CollectionNodeClass === "string")
913
- CollectionNodeClass = $42ceafc619f9c3ba$var$createCollectionNodeClass(CollectionNodeClass);
914
- let itemRef = useCallback((element) => {
915
- element?.setProps(props, ref, CollectionNodeClass, rendered, render);
916
- }, [
917
- props,
918
- ref,
919
- rendered,
920
- render,
921
- CollectionNodeClass
922
- ]);
923
- let parentNode = useContext($42ceafc619f9c3ba$var$SSRContext);
924
- if (parentNode) {
925
- let element = parentNode.ownerDocument.nodesByProps.get(props);
926
- if (!element) {
927
- element = parentNode.ownerDocument.createElement(CollectionNodeClass.type);
928
- element.setProps(props, ref, CollectionNodeClass, rendered, render);
929
- parentNode.appendChild(element);
930
- parentNode.ownerDocument.updateCollection();
931
- parentNode.ownerDocument.nodesByProps.set(props, element);
932
- }
933
- return children ? /* @__PURE__ */ React__default.createElement($42ceafc619f9c3ba$var$SSRContext.Provider, {
934
- value: element
935
- }, children) : null;
936
- }
937
- return /* @__PURE__ */ React__default.createElement(CollectionNodeClass.type, {
938
- ref: itemRef
939
- }, children);
940
- }
941
- function $42ceafc619f9c3ba$export$18af5c7a9e9b3664(CollectionNodeClass, render) {
942
- let Component = ({ node }) => render(node.props, node.props.ref, node);
943
- let Result = forwardRef((props, ref) => {
944
- let focusableProps = useContext($d1116acdf220c2da$export$f9762fab77588ecb);
945
- let isShallow = useContext($42ceafc619f9c3ba$var$ShallowRenderContext);
946
- if (!isShallow) {
947
- if (render.length >= 3) throw new Error(render.name + " cannot be rendered outside a collection.");
948
- return render(props, ref);
949
- }
950
- return $42ceafc619f9c3ba$var$useSSRCollectionNode(CollectionNodeClass, props, ref, "children" in props ? props.children : null, null, (node) => (
951
- // Forward FocusableContext to real DOM tree so tooltips work.
952
- /* @__PURE__ */ React__default.createElement($d1116acdf220c2da$export$f9762fab77588ecb.Provider, {
953
- value: focusableProps
954
- }, /* @__PURE__ */ React__default.createElement(Component, {
955
- node
956
- }))
957
- ));
958
- });
959
- Result.displayName = render.name;
960
- return Result;
961
- }
962
- function $42ceafc619f9c3ba$export$e953bb1cd0f19726(CollectionNodeClass, render, useChildren = $42ceafc619f9c3ba$var$useCollectionChildren) {
963
- let Component = ({ node }) => render(node.props, node.props.ref, node);
964
- let Result = forwardRef((props, ref) => {
965
- let children = useChildren(props);
966
- return $42ceafc619f9c3ba$var$useSSRCollectionNode(CollectionNodeClass, props, ref, null, children, (node) => /* @__PURE__ */ React__default.createElement(Component, {
967
- node
968
- })) ?? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null);
969
- });
970
- Result.displayName = render.name;
971
- return Result;
972
- }
973
- function $42ceafc619f9c3ba$var$useCollectionChildren(options) {
974
- return $a80bd3e9349588e7$export$727c8fc270210f13({
975
- ...options,
976
- addIdAndValue: true
977
- });
978
- }
979
- const $42ceafc619f9c3ba$var$CollectionContext = /* @__PURE__ */ createContext(null);
980
- function $42ceafc619f9c3ba$export$fb8073518f34e6ec(props) {
981
- let ctx = useContext($42ceafc619f9c3ba$var$CollectionContext);
982
- let dependencies = (ctx?.dependencies || []).concat(props.dependencies);
983
- let idScope = props.idScope ?? ctx?.idScope;
984
- let children = $42ceafc619f9c3ba$var$useCollectionChildren({
985
- ...props,
986
- idScope,
987
- dependencies
988
- });
989
- let doc = useContext($42ceafc619f9c3ba$var$CollectionDocumentContext);
990
- if (doc) children = /* @__PURE__ */ React__default.createElement($42ceafc619f9c3ba$var$CollectionRoot, null, children);
991
- ctx = useMemo(
992
- () => ({
993
- dependencies: (
994
- // oxlint-disable-next-line react-hooks/exhaustive-deps
995
- dependencies
996
- ),
997
- idScope
998
- }),
999
- // eslint-disable-next-line react-hooks/exhaustive-deps
1000
- // oxlint-disable-next-line react/react-compiler, react-hooks/exhaustive-deps
1001
- [
1002
- idScope,
1003
- ...dependencies
1004
- ]
1005
- );
1006
- return /* @__PURE__ */ React__default.createElement($42ceafc619f9c3ba$var$CollectionContext.Provider, {
1007
- value: ctx
1008
- }, children);
1009
- }
1010
- function $42ceafc619f9c3ba$var$CollectionRoot({ children }) {
1011
- let doc = useContext($42ceafc619f9c3ba$var$CollectionDocumentContext);
1012
- let wrappedChildren = useMemo(() => /* @__PURE__ */ React__default.createElement($42ceafc619f9c3ba$var$CollectionDocumentContext.Provider, {
1013
- value: null
1014
- }, /* @__PURE__ */ React__default.createElement($42ceafc619f9c3ba$var$ShallowRenderContext.Provider, {
1015
- value: true
1016
- }, children)), [
1017
- children
1018
- ]);
1019
- return $c7eafbbe1ea5834e$export$535bd6ca7f90a273() ? /* @__PURE__ */ React__default.createElement($42ceafc619f9c3ba$var$SSRContext.Provider, {
1020
- value: doc
1021
- }, wrappedChildren) : /* @__PURE__ */ createPortal(wrappedChildren, doc);
1022
- }
1023
- const $263ab7fc0f95ccdb$export$a164736487e3f0ae = {
1024
- CollectionRoot({ collection, renderDropIndicator }) {
1025
- return $263ab7fc0f95ccdb$var$useCollectionRender(collection, null, renderDropIndicator);
1026
- },
1027
- CollectionBranch({ collection, parent, renderDropIndicator }) {
1028
- return $263ab7fc0f95ccdb$var$useCollectionRender(collection, parent, renderDropIndicator);
1029
- }
1030
- };
1031
- function $263ab7fc0f95ccdb$var$useCollectionRender(collection, parent, renderDropIndicator) {
1032
- return $a80bd3e9349588e7$export$727c8fc270210f13({
1033
- items: parent ? collection.getChildren(parent.key) : collection,
1034
- dependencies: [
1035
- renderDropIndicator
1036
- ],
1037
- children(node) {
1038
- if (node.type === "content") return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null);
1039
- let rendered = node.render(node);
1040
- if (!renderDropIndicator || node.type !== "item") return rendered;
1041
- return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, renderDropIndicator({
1042
- type: "item",
1043
- key: node.key,
1044
- dropPosition: "before"
1045
- }), rendered, $263ab7fc0f95ccdb$export$2dbbd341daed716d(collection, node, renderDropIndicator));
1046
- }
1047
- });
1048
- }
1049
- function $263ab7fc0f95ccdb$export$2dbbd341daed716d(collection, node, renderDropIndicator) {
1050
- let key = node.key;
1051
- let keyAfter = collection.getKeyAfter(key);
1052
- let nextItemInFlattenedCollection = keyAfter != null ? collection.getItem(keyAfter) : null;
1053
- while (nextItemInFlattenedCollection != null && nextItemInFlattenedCollection.type !== "item") {
1054
- keyAfter = collection.getKeyAfter(nextItemInFlattenedCollection.key);
1055
- nextItemInFlattenedCollection = keyAfter != null ? collection.getItem(keyAfter) : null;
1056
- }
1057
- let nextItemInSameLevel = node.nextKey != null ? collection.getItem(node.nextKey) : null;
1058
- while (nextItemInSameLevel != null && nextItemInSameLevel.type !== "item") nextItemInSameLevel = nextItemInSameLevel.nextKey != null ? collection.getItem(nextItemInSameLevel.nextKey) : null;
1059
- let afterIndicators = [];
1060
- if (nextItemInSameLevel == null) {
1061
- let current = node;
1062
- while (current?.type === "item" && (!nextItemInFlattenedCollection || current.parentKey !== nextItemInFlattenedCollection.parentKey && nextItemInFlattenedCollection.level < current.level)) {
1063
- let indicator = renderDropIndicator({
1064
- type: "item",
1065
- key: current.key,
1066
- dropPosition: "after"
1067
- });
1068
- if (/* @__PURE__ */ isValidElement(indicator)) afterIndicators.push(/* @__PURE__ */ cloneElement(indicator, {
1069
- key: `${current.key}-after`
1070
- }));
1071
- current = current.parentKey != null ? collection.getItem(current.parentKey) : null;
1072
- }
1073
- }
1074
- return afterIndicators;
1075
- }
1076
- const $263ab7fc0f95ccdb$export$4feb769f8ddf26c5 = /* @__PURE__ */ createContext($263ab7fc0f95ccdb$export$a164736487e3f0ae);
1077
146
  function $3c71b1595a147f24$export$496315a1608d9602(cb, dependencies) {
1078
147
  const isInitialMount = useRef(true);
1079
148
  const lastDeps = useRef(null);
@@ -1091,174 +160,12 @@ function $3c71b1595a147f24$export$496315a1608d9602(cb, dependencies) {
1091
160
  lastDeps.current = dependencies;
1092
161
  }, dependencies);
1093
162
  }
1094
- function $901761b40e390936$export$2bb74740c4e19def(node, checkForOverflow) {
1095
- if (!node) return false;
1096
- let style = window.getComputedStyle(node);
1097
- let root = document.scrollingElement || document.documentElement;
1098
- let isScrollable = /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY);
1099
- if (node === root && style.overflow !== "hidden") isScrollable = true;
1100
- if (isScrollable && checkForOverflow) isScrollable = node.scrollHeight !== node.clientHeight || node.scrollWidth !== node.clientWidth;
1101
- return isScrollable;
1102
- }
1103
163
  function $3578607fe3d4b096$export$cfa2225e87938781(node, checkForOverflow) {
1104
164
  let scrollableNode = node;
1105
165
  if ($901761b40e390936$export$2bb74740c4e19def(scrollableNode, checkForOverflow)) scrollableNode = scrollableNode.parentElement;
1106
166
  while (scrollableNode && !$901761b40e390936$export$2bb74740c4e19def(scrollableNode, checkForOverflow)) scrollableNode = scrollableNode.parentElement;
1107
167
  return scrollableNode || document.scrollingElement || document.documentElement;
1108
168
  }
1109
- function $76d97191f0f90600$export$94ed1c92c7beeb22(node, checkForOverflow) {
1110
- let parentElements = [];
1111
- let root = document.scrollingElement || document.documentElement;
1112
- while (node) {
1113
- if ($901761b40e390936$export$2bb74740c4e19def(node, checkForOverflow)) parentElements.push(node);
1114
- if (node === root) break;
1115
- node = node.parentElement;
1116
- }
1117
- return parentElements;
1118
- }
1119
- function $51a3e22a5186a962$export$53a0910f038337bd(scrollView, element, opts = {}) {
1120
- if (scrollView === element) return;
1121
- let target = element.getBoundingClientRect();
1122
- $51a3e22a5186a962$export$f064fd83a2c6e9ca(scrollView, element, target, opts);
1123
- }
1124
- function $51a3e22a5186a962$export$f064fd83a2c6e9ca(scrollView, element, target, opts = {}) {
1125
- let { block = "nearest", inline = "nearest" } = opts;
1126
- let y = scrollView.scrollTop;
1127
- let x = scrollView.scrollLeft;
1128
- let view = scrollView.getBoundingClientRect();
1129
- let itemStyle = window.getComputedStyle(element);
1130
- let viewStyle = window.getComputedStyle(scrollView);
1131
- let root = document.scrollingElement || document.documentElement;
1132
- let isRoot = scrollView === root;
1133
- let viewTop = scrollView === root ? 0 : view.top;
1134
- let viewBottom = scrollView === root ? scrollView.clientHeight : view.bottom;
1135
- let viewLeft = scrollView === root ? 0 : view.left;
1136
- let viewRight = scrollView === root ? scrollView.clientWidth : view.right;
1137
- let scrollMarginTop = parseFloat(itemStyle.scrollMarginTop) || 0;
1138
- let scrollMarginBottom = parseFloat(itemStyle.scrollMarginBottom) || 0;
1139
- let scrollMarginLeft = parseFloat(itemStyle.scrollMarginLeft) || 0;
1140
- let scrollMarginRight = parseFloat(itemStyle.scrollMarginRight) || 0;
1141
- let scrollPaddingTop = parseFloat(viewStyle.scrollPaddingTop) || 0;
1142
- let scrollPaddingBottom = parseFloat(viewStyle.scrollPaddingBottom) || 0;
1143
- let scrollPaddingLeft = parseFloat(viewStyle.scrollPaddingLeft) || 0;
1144
- let scrollPaddingRight = parseFloat(viewStyle.scrollPaddingRight) || 0;
1145
- let borderTopWidth = parseFloat(viewStyle.borderTopWidth) || 0;
1146
- let borderBottomWidth = parseFloat(viewStyle.borderBottomWidth) || 0;
1147
- let borderLeftWidth = parseFloat(viewStyle.borderLeftWidth) || 0;
1148
- let borderRightWidth = parseFloat(viewStyle.borderRightWidth) || 0;
1149
- let scrollAreaTop = target.top - scrollMarginTop;
1150
- let scrollAreaBottom = target.bottom + scrollMarginBottom;
1151
- let scrollAreaLeft = target.left - scrollMarginLeft;
1152
- let scrollAreaRight = target.right + scrollMarginRight;
1153
- let scrollBarOffsetX = scrollView === root ? 0 : borderLeftWidth + borderRightWidth;
1154
- let scrollBarOffsetY = scrollView === root ? 0 : borderTopWidth + borderBottomWidth;
1155
- let scrollBarWidth = scrollView === root ? 0 : scrollView.offsetWidth - scrollView.clientWidth - scrollBarOffsetX;
1156
- let scrollBarHeight = scrollView === root ? 0 : scrollView.offsetHeight - scrollView.clientHeight - scrollBarOffsetY;
1157
- let scrollPortTop = viewTop + (isRoot ? 0 : borderTopWidth) + scrollPaddingTop;
1158
- let scrollPortBottom = viewBottom - (isRoot ? 0 : borderBottomWidth) - scrollPaddingBottom - scrollBarHeight;
1159
- let scrollPortLeft = viewLeft + (isRoot ? 0 : borderLeftWidth) + scrollPaddingLeft;
1160
- let scrollPortRight = viewRight - (isRoot ? 0 : borderRightWidth) - scrollPaddingRight;
1161
- if ($2add3ce32c6007eb$export$fedb369cb70207f1() && $2add3ce32c6007eb$export$78551043582a6a98() || viewStyle.direction === "ltr") scrollPortRight -= scrollBarWidth;
1162
- else if (viewStyle.direction === "rtl") scrollPortLeft += scrollBarWidth;
1163
- let shouldScrollBlock = scrollAreaTop < scrollPortTop || scrollAreaBottom > scrollPortBottom;
1164
- let shouldScrollInline = scrollAreaLeft < scrollPortLeft || scrollAreaRight > scrollPortRight;
1165
- if (shouldScrollBlock && block === "start") y += scrollAreaTop - scrollPortTop;
1166
- else if (shouldScrollBlock && block === "center") y += (scrollAreaTop + scrollAreaBottom) / 2 - (scrollPortTop + scrollPortBottom) / 2;
1167
- else if (shouldScrollBlock && block === "end") y += scrollAreaBottom - scrollPortBottom;
1168
- else if (shouldScrollBlock && block === "nearest") {
1169
- let start = scrollAreaTop - scrollPortTop;
1170
- let end = scrollAreaBottom - scrollPortBottom;
1171
- y += Math.abs(start) <= Math.abs(end) ? start : end;
1172
- }
1173
- if (shouldScrollInline && inline === "start") x += scrollAreaLeft - scrollPortLeft;
1174
- else if (shouldScrollInline && inline === "center") x += (scrollAreaLeft + scrollAreaRight) / 2 - (scrollPortLeft + scrollPortRight) / 2;
1175
- else if (shouldScrollInline && inline === "end") x += scrollAreaRight - scrollPortRight;
1176
- else if (shouldScrollInline && inline === "nearest") {
1177
- let start = scrollAreaLeft - scrollPortLeft;
1178
- let end = scrollAreaRight - scrollPortRight;
1179
- x += Math.abs(start) <= Math.abs(end) ? start : end;
1180
- }
1181
- if (process.env.NODE_ENV === "test") {
1182
- scrollView.scrollLeft = x;
1183
- scrollView.scrollTop = y;
1184
- return;
1185
- }
1186
- scrollView.scrollTo({
1187
- left: x,
1188
- top: y
1189
- });
1190
- }
1191
- function $51a3e22a5186a962$export$c826860796309d1b(targetElement, opts = {}) {
1192
- let { containingElement } = opts;
1193
- if (targetElement && targetElement.isConnected) {
1194
- let root = document.scrollingElement || document.documentElement;
1195
- let isScrollPrevented = window.getComputedStyle(root).overflow === "hidden";
1196
- if (!isScrollPrevented) {
1197
- let { left: originalLeft, top: originalTop } = targetElement.getBoundingClientRect();
1198
- targetElement?.scrollIntoView?.({
1199
- block: "nearest"
1200
- });
1201
- let { left: newLeft, top: newTop } = targetElement.getBoundingClientRect();
1202
- if (Math.abs(originalLeft - newLeft) > 1 || Math.abs(originalTop - newTop) > 1) {
1203
- containingElement?.scrollIntoView?.({
1204
- block: "center",
1205
- inline: "center"
1206
- });
1207
- targetElement.scrollIntoView?.({
1208
- block: "nearest"
1209
- });
1210
- }
1211
- } else {
1212
- let { left: originalLeft, top: originalTop } = targetElement.getBoundingClientRect();
1213
- let scrollParents = $76d97191f0f90600$export$94ed1c92c7beeb22(targetElement, true);
1214
- for (let scrollParent of scrollParents) $51a3e22a5186a962$export$53a0910f038337bd(scrollParent, targetElement);
1215
- let { left: newLeft, top: newTop } = targetElement.getBoundingClientRect();
1216
- if (Math.abs(originalLeft - newLeft) > 1 || Math.abs(originalTop - newTop) > 1) {
1217
- scrollParents = containingElement ? $76d97191f0f90600$export$94ed1c92c7beeb22(containingElement, true) : [];
1218
- for (let scrollParent of scrollParents) $51a3e22a5186a962$export$53a0910f038337bd(scrollParent, containingElement, {
1219
- block: "center",
1220
- inline: "center"
1221
- });
1222
- for (let scrollParent of $76d97191f0f90600$export$94ed1c92c7beeb22(targetElement, true)) $51a3e22a5186a962$export$53a0910f038337bd(scrollParent, targetElement);
1223
- }
1224
- }
1225
- }
1226
- }
1227
- let $121970af65029459$var$descriptionId = 0;
1228
- const $121970af65029459$var$descriptionNodes = /* @__PURE__ */ new Map();
1229
- function $121970af65029459$export$f8aeda7b10753fa1(description) {
1230
- let [id, setId] = useState();
1231
- $c4867b2f328c2698$export$e5c5a5f917a5871c(() => {
1232
- if (!description) return;
1233
- let desc = $121970af65029459$var$descriptionNodes.get(description);
1234
- if (!desc) {
1235
- let id2 = `react-aria-description-${$121970af65029459$var$descriptionId++}`;
1236
- setId(id2);
1237
- let node = document.createElement("div");
1238
- node.id = id2;
1239
- node.style.display = "none";
1240
- node.textContent = description;
1241
- document.body.appendChild(node);
1242
- desc = {
1243
- refCount: 0,
1244
- element: node
1245
- };
1246
- $121970af65029459$var$descriptionNodes.set(description, desc);
1247
- } else setId(desc.element.id);
1248
- desc.refCount++;
1249
- return () => {
1250
- if (desc && --desc.refCount === 0) {
1251
- desc.element.remove();
1252
- $121970af65029459$var$descriptionNodes.delete(description);
1253
- }
1254
- };
1255
- }, [
1256
- description
1257
- ]);
1258
- return {
1259
- "aria-describedby": description ? id : void 0
1260
- };
1261
- }
1262
169
  const $ed8ccb2e23e76301$export$b085522c77523c51 = /* @__PURE__ */ createContext(null);
1263
170
  const $ed8ccb2e23e76301$export$c32003b803b6c22e = /* @__PURE__ */ createContext(null);
1264
171
  var $8700ca6f74b7a3bb$exports = {};
@@ -1596,484 +503,22 @@ function $f9554a667e4f0374$export$d1e8e3fbb7461f6(selectionManager, dragAndDropH
1596
503
  dropTargetKey
1597
504
  ]);
1598
505
  }
1599
- const $91fe5e721c7f36c1$export$c9549807523555e0 = /* @__PURE__ */ createContext({
1600
- isSelected: false
1601
- });
1602
- function $22bbea12c2567021$export$d3e3bd3e26688c04(e) {
1603
- return $2add3ce32c6007eb$export$e1865c3bedcd822b() ? e.altKey : e.ctrlKey;
1604
- }
1605
- function $22bbea12c2567021$export$c3d8340acf92597f(collectionRef, key) {
1606
- let selector = `[data-key="${CSS.escape(String(key))}"]`;
1607
- let collection = collectionRef.current?.dataset.collection;
1608
- if (collection) selector = `[data-collection="${CSS.escape(collection)}"]${selector}`;
1609
- return collectionRef.current?.querySelector(selector);
1610
- }
1611
- const $22bbea12c2567021$var$collectionMap = /* @__PURE__ */ new WeakMap();
1612
- function $22bbea12c2567021$export$881eb0d9f3605d9d(collection) {
1613
- let id = $390e54f620492c70$export$f680877a34711e37();
1614
- $22bbea12c2567021$var$collectionMap.set(collection, id);
1615
- return id;
1616
- }
1617
- function $22bbea12c2567021$export$6aeb1680a0ae8741(collection) {
1618
- return $22bbea12c2567021$var$collectionMap.get(collection);
1619
- }
1620
- const $f5a4a9a3486154da$var$TYPEAHEAD_DEBOUNCE_WAIT_MS = 1e3;
1621
- function $f5a4a9a3486154da$export$e32c88dfddc6e1d8(options) {
1622
- let { keyboardDelegate, selectionManager, onTypeSelect } = options;
1623
- let state = useRef({
1624
- search: "",
1625
- timeout: void 0
1626
- });
1627
- let onKeyDownCapture = (e) => {
1628
- if (state.current.search.length > 0 && e.key === " ") {
1629
- e.preventDefault();
1630
- if (!("continuePropagation" in e) || "continuePropagation" in e && !e.isPropagationStopped()) e.stopPropagation();
1631
- state.current.search += " ";
1632
- if (keyboardDelegate.getKeyForSearch != null) {
1633
- let key = keyboardDelegate.getKeyForSearch(state.current.search, selectionManager.focusedKey);
1634
- if (key == null) key = keyboardDelegate.getKeyForSearch(state.current.search);
1635
- if (key != null) {
1636
- selectionManager.setFocusedKey(key);
1637
- if (onTypeSelect) onTypeSelect(key);
1638
- }
1639
- }
1640
- clearTimeout(state.current.timeout);
1641
- state.current.timeout = setTimeout(() => {
1642
- state.current.search = "";
1643
- }, $f5a4a9a3486154da$var$TYPEAHEAD_DEBOUNCE_WAIT_MS);
1644
- }
1645
- };
1646
- let onKeyDown = (e) => {
1647
- let character = $f5a4a9a3486154da$var$getStringForKey(e.key);
1648
- if (!character || e.ctrlKey || e.metaKey || e.altKey || !$23f2114a1b82827e$export$4282f70798064fe0(e.currentTarget, $23f2114a1b82827e$export$e58f029f0fbfdb29(e)) || state.current.search.length === 0 && character === " ") return;
1649
- state.current.search += character;
1650
- if (keyboardDelegate.getKeyForSearch != null) {
1651
- let key = keyboardDelegate.getKeyForSearch(state.current.search, selectionManager.focusedKey);
1652
- if (key == null) key = keyboardDelegate.getKeyForSearch(state.current.search);
1653
- if (key != null) {
1654
- selectionManager.setFocusedKey(key);
1655
- if (onTypeSelect) onTypeSelect(key);
1656
- e.preventDefault();
1657
- if (!("continuePropagation" in e)) e.stopPropagation();
1658
- } else {
1659
- state.current.search = "";
1660
- clearTimeout(state.current.timeout);
1661
- state.current.timeout = void 0;
1662
- return;
1663
- }
1664
- }
1665
- clearTimeout(state.current.timeout);
1666
- state.current.timeout = setTimeout(() => {
1667
- state.current.search = "";
1668
- }, $f5a4a9a3486154da$var$TYPEAHEAD_DEBOUNCE_WAIT_MS);
1669
- };
1670
- useEffect(() => {
1671
- let timeout = state.current.timeout;
1672
- return () => {
1673
- clearTimeout(timeout);
1674
- };
1675
- }, [
1676
- state
1677
- ]);
1678
- return {
1679
- typeSelectProps: {
1680
- // Using a capturing listener to catch the keydown event before
1681
- // other hooks in order to handle the Spacebar event.
1682
- onKeyDownCapture: keyboardDelegate.getKeyForSearch ? onKeyDownCapture : void 0,
1683
- onKeyDown: keyboardDelegate.getKeyForSearch ? onKeyDown : void 0
1684
- }
1685
- };
1686
- }
1687
- function $f5a4a9a3486154da$var$getStringForKey(key) {
1688
- if (key.length === 1 || !/^[A-Z]/i.test(key)) return key;
1689
- return "";
1690
- }
1691
- function $a475cdc2445827b5$export$72ef708ab07251f1(effect, dependencies) {
1692
- const isInitialMount = useRef(true);
1693
- const lastDeps = useRef(null);
1694
- $c4867b2f328c2698$export$e5c5a5f917a5871c(() => {
1695
- isInitialMount.current = true;
1696
- return () => {
1697
- isInitialMount.current = false;
1698
- };
1699
- }, []);
1700
- $c4867b2f328c2698$export$e5c5a5f917a5871c(() => {
1701
- if (isInitialMount.current) isInitialMount.current = false;
1702
- else if (!lastDeps.current || dependencies.some((dep, i) => !Object.is(dep, lastDeps[i]))) effect();
1703
- lastDeps.current = dependencies;
1704
- }, dependencies);
1705
- }
1706
- function $d667c2af82d35a98$export$d6daf82dcd84e87c(options) {
1707
- let { selectionManager: manager, keyboardDelegate: delegate, ref, autoFocus = false, shouldFocusWrap = false, disallowEmptySelection = false, disallowSelectAll = false, escapeKeyBehavior = "clearSelection", selectOnFocus = manager.selectionBehavior === "replace", disallowTypeAhead = false, shouldUseVirtualFocus, allowsTabNavigation = false, scrollRef = ref, linkBehavior = "action", UNSTABLE_focusOnEntry } = options;
1708
- let { direction } = $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7();
1709
- let router = $caaf0dd3060ed57c$export$9a302a45f65d0572();
1710
- const navigateToKey = (e, key, childFocus) => {
1711
- if (key != null) {
1712
- if (manager.isLink(key) && linkBehavior === "selection" && selectOnFocus && !$22bbea12c2567021$export$d3e3bd3e26688c04(e)) {
1713
- flushSync(() => {
1714
- manager.setFocusedKey(key, childFocus);
1715
- });
1716
- let item = $22bbea12c2567021$export$c3d8340acf92597f(ref, key);
1717
- let itemProps = manager.getItemProps(key);
1718
- if (item) {
1719
- router.open(item, e, itemProps.href, itemProps.routerOptions);
1720
- return;
1721
- }
1722
- return false;
1723
- }
1724
- manager.setFocusedKey(key, childFocus);
1725
- if (manager.isLink(key) && linkBehavior === "override") return false;
1726
- if (e.shiftKey && manager.selectionMode === "multiple") {
1727
- manager.extendSelection(key);
1728
- return;
1729
- } else if (selectOnFocus && !$22bbea12c2567021$export$d3e3bd3e26688c04(e)) {
1730
- manager.replaceSelection(key);
1731
- return;
1732
- }
1733
- }
1734
- return false;
1735
- };
1736
- let arrowDown = (e) => {
1737
- if (delegate.getKeyBelow) {
1738
- let nextKey = manager.focusedKey != null ? delegate.getKeyBelow?.(manager.focusedKey) : delegate.getFirstKey?.();
1739
- if (nextKey == null && shouldFocusWrap) nextKey = delegate.getFirstKey?.(manager.focusedKey);
1740
- if (nextKey != null) {
1741
- navigateToKey(e, nextKey);
1742
- return;
1743
- }
1744
- }
1745
- return false;
1746
- };
1747
- let arrowUp = (e) => {
1748
- if (delegate.getKeyAbove) {
1749
- let nextKey = manager.focusedKey != null ? delegate.getKeyAbove?.(manager.focusedKey) : delegate.getLastKey?.();
1750
- if (nextKey == null && shouldFocusWrap) nextKey = delegate.getLastKey?.(manager.focusedKey);
1751
- if (nextKey != null) {
1752
- navigateToKey(e, nextKey);
1753
- return;
1754
- }
1755
- }
1756
- return false;
1757
- };
1758
- let home = (e) => {
1759
- if (delegate.getFirstKey) {
1760
- if (manager.focusedKey === null && e.shiftKey) return false;
1761
- let firstKey2 = delegate.getFirstKey(manager.focusedKey, $bb39c0fc1c19b34c$export$16792effe837dba3(e));
1762
- manager.setFocusedKey(firstKey2);
1763
- if (firstKey2 != null) {
1764
- if ($bb39c0fc1c19b34c$export$16792effe837dba3(e) && e.shiftKey && manager.selectionMode === "multiple") {
1765
- manager.extendSelection(firstKey2);
1766
- return;
1767
- } else if (selectOnFocus) {
1768
- manager.replaceSelection(firstKey2);
1769
- return;
1770
- }
1771
- }
1772
- }
1773
- return false;
1774
- };
1775
- let arrowLeft = (e) => {
1776
- if (delegate.getKeyLeftOf) {
1777
- let nextKey = manager.focusedKey != null ? delegate.getKeyLeftOf?.(manager.focusedKey) : delegate.getFirstKey?.();
1778
- if (nextKey == null && shouldFocusWrap) nextKey = direction === "rtl" ? delegate.getFirstKey?.(manager.focusedKey) : delegate.getLastKey?.(manager.focusedKey);
1779
- if (nextKey != null) {
1780
- navigateToKey(e, nextKey, direction === "rtl" ? "first" : "last");
1781
- return;
1782
- }
1783
- }
1784
- return false;
1785
- };
1786
- let arrowRight = (e) => {
1787
- if (delegate.getKeyRightOf) {
1788
- let nextKey = manager.focusedKey != null ? delegate.getKeyRightOf?.(manager.focusedKey) : delegate.getFirstKey?.();
1789
- if (nextKey == null && shouldFocusWrap) nextKey = direction === "rtl" ? delegate.getLastKey?.(manager.focusedKey) : delegate.getFirstKey?.(manager.focusedKey);
1790
- if (nextKey != null) {
1791
- navigateToKey(e, nextKey, direction === "rtl" ? "last" : "first");
1792
- return;
1793
- }
1794
- }
1795
- return false;
1796
- };
1797
- let end = (e) => {
1798
- if (delegate.getLastKey) {
1799
- if (manager.focusedKey === null && e.shiftKey) return false;
1800
- let lastKey = delegate.getLastKey(manager.focusedKey, $bb39c0fc1c19b34c$export$16792effe837dba3(e));
1801
- manager.setFocusedKey(lastKey);
1802
- if (lastKey != null) {
1803
- if ($bb39c0fc1c19b34c$export$16792effe837dba3(e) && e.shiftKey && manager.selectionMode === "multiple") {
1804
- manager.extendSelection(lastKey);
1805
- return;
1806
- } else if (selectOnFocus) {
1807
- manager.replaceSelection(lastKey);
1808
- return;
1809
- }
1810
- }
1811
- }
1812
- return false;
1813
- };
1814
- let pageDown = (e) => {
1815
- if (delegate.getKeyPageBelow && manager.focusedKey != null) {
1816
- let nextKey = delegate.getKeyPageBelow(manager.focusedKey);
1817
- if (nextKey != null) return navigateToKey(e, nextKey);
1818
- }
1819
- return false;
1820
- };
1821
- let pageUp = (e) => {
1822
- if (delegate.getKeyPageAbove && manager.focusedKey != null) {
1823
- let nextKey = delegate.getKeyPageAbove(manager.focusedKey);
1824
- if (nextKey != null) return navigateToKey(e, nextKey);
1825
- }
1826
- return false;
1827
- };
1828
- let aHandler = () => {
1829
- if (manager.selectionMode === "multiple" && disallowSelectAll !== true) {
1830
- manager.selectAll();
1831
- return;
1832
- }
1833
- return false;
1834
- };
1835
- let escape = () => {
1836
- if (escapeKeyBehavior === "clearSelection" && !disallowEmptySelection && manager.selectedKeys.size !== 0) {
1837
- manager.clearSelection();
1838
- return;
1839
- }
1840
- return false;
1841
- };
1842
- let tab = () => {
1843
- if (!allowsTabNavigation && ref.current) {
1844
- let walker = $535772f9d2c1f38d$export$2d6ec8fc375ceafa(ref.current, {
1845
- tabbable: true
1846
- });
1847
- let next = void 0;
1848
- let last;
1849
- do {
1850
- last = walker.lastChild();
1851
- if (last) next = last;
1852
- } while (last);
1853
- let activeElement = $23f2114a1b82827e$export$cd4e5573fbe2b576();
1854
- if (next && (!$23f2114a1b82827e$export$b4f377a2b6254582(next) || activeElement && !$3b8b240c1bf84ab9$export$bebd5a1431fec25d(activeElement))) $1969ac565cfec8d0$export$de79e2c695e052f3(next);
1855
- }
1856
- return {
1857
- shouldContinuePropagation: true,
1858
- shouldPreventDefault: false
1859
- };
1860
- };
1861
- let shiftTab = () => {
1862
- if (!allowsTabNavigation && ref.current) ref.current.focus();
1863
- return {
1864
- shouldContinuePropagation: true,
1865
- shouldPreventDefault: false
1866
- };
1867
- };
1868
- let withShiftSel = (key, callback) => {
1869
- return {
1870
- [$2add3ce32c6007eb$export$9ac100e40613ea10() ? key + "+Shift+Alt" : key + "+Shift+Control"]: callback,
1871
- [key + "+Shift"]: callback,
1872
- [$2add3ce32c6007eb$export$9ac100e40613ea10() ? key + "+Alt" : key + "+Control"]: callback,
1873
- [key]: callback
1874
- };
1875
- };
1876
- let { keyboardProps: repeatKeyboardProps } = $8296dad1a4c5e0dc$export$8f71654801c2f7cd({
1877
- shortcuts: {
1878
- ...withShiftSel("ArrowDown", arrowDown),
1879
- ...withShiftSel("ArrowUp", arrowUp),
1880
- ...withShiftSel("ArrowLeft", arrowLeft),
1881
- ...withShiftSel("ArrowRight", arrowRight),
1882
- ...withShiftSel("PageDown", pageDown),
1883
- ...withShiftSel("PageUp", pageUp)
1884
- },
1885
- allowRepeats: true
1886
- });
1887
- let { keyboardProps } = $8296dad1a4c5e0dc$export$8f71654801c2f7cd({
1888
- shortcuts: {
1889
- ...withShiftSel("Home", home),
1890
- ...withShiftSel("End", end),
1891
- "Mod+A": aHandler,
1892
- Escape: escape,
1893
- Tab: tab,
1894
- "Tab+Shift": shiftTab
1895
- }
1896
- });
1897
- let scrollPos = useRef({
1898
- top: 0,
1899
- left: 0
1900
- });
1901
- $600b3cf69ae46262$export$90fc3a17d93f704c(scrollRef, "scroll", () => {
1902
- scrollPos.current = {
1903
- top: scrollRef.current?.scrollTop ?? 0,
1904
- left: scrollRef.current?.scrollLeft ?? 0
1905
- };
1906
- });
1907
- let onFocus = (e) => {
1908
- if (manager.isFocused) {
1909
- if (!$23f2114a1b82827e$export$4282f70798064fe0(e.currentTarget, $23f2114a1b82827e$export$e58f029f0fbfdb29(e))) manager.setFocused(false);
1910
- return;
1911
- }
1912
- if (!$23f2114a1b82827e$export$4282f70798064fe0(e.currentTarget, $23f2114a1b82827e$export$e58f029f0fbfdb29(e))) return;
1913
- let modality = $8f5a2122b0992be3$export$630ff653c5ada6a9();
1914
- manager.setFocused(true);
1915
- let navigateToKey2 = (key) => {
1916
- if (key != null) {
1917
- manager.setFocusedKey(key);
1918
- if (selectOnFocus && !manager.isSelected(key)) manager.replaceSelection(key);
1919
- }
1920
- };
1921
- if (UNSTABLE_focusOnEntry && (modality === "keyboard" || modality === "virtual"))
1922
- navigateToKey2(UNSTABLE_focusOnEntry === "first" ? delegate.getFirstKey?.() : delegate.getLastKey?.());
1923
- else if (manager.focusedKey == null) {
1924
- let relatedTarget = e.relatedTarget;
1925
- if (relatedTarget && e.currentTarget.compareDocumentPosition(relatedTarget) & Node.DOCUMENT_POSITION_FOLLOWING) navigateToKey2(manager.lastSelectedKey ?? delegate.getLastKey?.());
1926
- else navigateToKey2(manager.firstSelectedKey ?? delegate.getFirstKey?.());
1927
- } else if (scrollRef.current) {
1928
- scrollRef.current.scrollTop = scrollPos.current.top;
1929
- scrollRef.current.scrollLeft = scrollPos.current.left;
1930
- }
1931
- if (manager.focusedKey != null && scrollRef.current) {
1932
- let element = $22bbea12c2567021$export$c3d8340acf92597f(ref, manager.focusedKey);
1933
- if (element instanceof HTMLElement) {
1934
- if (!$23f2114a1b82827e$export$b4f377a2b6254582(element) && !shouldUseVirtualFocus) $1969ac565cfec8d0$export$de79e2c695e052f3(element);
1935
- if (modality === "keyboard" || UNSTABLE_focusOnEntry && modality === "virtual") $51a3e22a5186a962$export$c826860796309d1b(element, {
1936
- containingElement: ref.current
1937
- });
1938
- }
1939
- }
1940
- };
1941
- let onBlur = (e) => {
1942
- if (!$23f2114a1b82827e$export$4282f70798064fe0(e.currentTarget, e.relatedTarget)) manager.setFocused(false);
1943
- };
1944
- let shouldVirtualFocusFirst = useRef(false);
1945
- $600b3cf69ae46262$export$90fc3a17d93f704c(ref, $8b2399d051d06d4c$export$831c820ad60f9d12, !shouldUseVirtualFocus ? void 0 : (e) => {
1946
- let { detail } = e;
1947
- e.stopPropagation();
1948
- manager.setFocused(true);
1949
- if (detail?.focusStrategy === "first") shouldVirtualFocusFirst.current = true;
1950
- });
1951
- let firstKey = delegate.getFirstKey?.() ?? null;
1952
- $a475cdc2445827b5$export$72ef708ab07251f1(() => {
1953
- if (shouldVirtualFocusFirst.current) {
1954
- if (firstKey == null) {
1955
- let previousActiveElement = $23f2114a1b82827e$export$cd4e5573fbe2b576();
1956
- $b72f3f7b3b5f42c6$export$76e4e37e5339496d(ref.current);
1957
- $b72f3f7b3b5f42c6$export$2b35b76d2e30e129(previousActiveElement, null);
1958
- if (manager.collection.size > 0) shouldVirtualFocusFirst.current = false;
1959
- } else {
1960
- manager.setFocusedKey(firstKey);
1961
- shouldVirtualFocusFirst.current = false;
1962
- }
1963
- }
1964
- }, [
1965
- firstKey,
1966
- manager.collection.size
1967
- ]);
1968
- $a475cdc2445827b5$export$72ef708ab07251f1(() => {
1969
- if (manager.collection.size > 0) shouldVirtualFocusFirst.current = false;
1970
- }, [
1971
- manager.focusedKey
1972
- ]);
1973
- $600b3cf69ae46262$export$90fc3a17d93f704c(ref, $8b2399d051d06d4c$export$447a38995de2c711, !shouldUseVirtualFocus ? void 0 : (e) => {
1974
- e.stopPropagation();
1975
- manager.setFocused(false);
1976
- if (e.detail?.clearFocusKey) manager.setFocusedKey(null);
1977
- });
1978
- const autoFocusRef = useRef(autoFocus);
1979
- const didAutoFocusRef = useRef(false);
1980
- useEffect(() => {
1981
- if (autoFocusRef.current) {
1982
- let focusedKey = null;
1983
- if (autoFocus === "first") focusedKey = delegate.getFirstKey?.() ?? null;
1984
- if (autoFocus === "last") focusedKey = delegate.getLastKey?.() ?? null;
1985
- let selectedKeys = manager.selectedKeys;
1986
- if (selectedKeys.size) {
1987
- for (let key of selectedKeys) if (manager.canSelectItem(key)) {
1988
- focusedKey = key;
1989
- break;
1990
- }
1991
- }
1992
- manager.setFocused(true);
1993
- manager.setFocusedKey(focusedKey);
1994
- if (focusedKey != null && selectOnFocus && !selectedKeys.size && manager.canSelectItem(focusedKey)) manager.replaceSelection(focusedKey);
1995
- if (focusedKey == null && !shouldUseVirtualFocus && ref.current) $f192c2f16961cbe0$export$80f3e147d781571c(ref.current);
1996
- if (manager.collection.size > 0) {
1997
- autoFocusRef.current = false;
1998
- didAutoFocusRef.current = true;
1999
- }
2000
- }
2001
- });
2002
- let lastFocusedKey = useRef(manager.focusedKey);
2003
- let raf = useRef(null);
2004
- useEffect(() => {
2005
- if (manager.isFocused && manager.focusedKey != null && (manager.focusedKey !== lastFocusedKey.current || didAutoFocusRef.current) && scrollRef.current && ref.current) {
2006
- let modality = $8f5a2122b0992be3$export$630ff653c5ada6a9();
2007
- let element = $22bbea12c2567021$export$c3d8340acf92597f(ref, manager.focusedKey);
2008
- if (!(element instanceof HTMLElement))
2009
- return;
2010
- if (modality === "keyboard" || didAutoFocusRef.current) {
2011
- if (raf.current) cancelAnimationFrame(raf.current);
2012
- raf.current = requestAnimationFrame(() => {
2013
- if (scrollRef.current) {
2014
- $51a3e22a5186a962$export$53a0910f038337bd(scrollRef.current, element);
2015
- if (modality !== "virtual") $51a3e22a5186a962$export$c826860796309d1b(element, {
2016
- containingElement: ref.current
2017
- });
2018
- }
2019
- });
2020
- }
2021
- }
2022
- if (!shouldUseVirtualFocus && manager.isFocused && manager.focusedKey == null && lastFocusedKey.current != null && ref.current) $f192c2f16961cbe0$export$80f3e147d781571c(ref.current);
2023
- lastFocusedKey.current = manager.focusedKey;
2024
- didAutoFocusRef.current = false;
2025
- });
2026
- useEffect(() => {
2027
- return () => {
2028
- if (raf.current) cancelAnimationFrame(raf.current);
2029
- };
2030
- }, []);
2031
- $600b3cf69ae46262$export$90fc3a17d93f704c(ref, "react-aria-focus-scope-restore", (e) => {
2032
- e.preventDefault();
2033
- manager.setFocused(true);
2034
- });
2035
- let handlers = {
2036
- ...$bbaa08b3cd72f041$export$9d1611c77c2fe928(keyboardProps, repeatKeyboardProps),
2037
- onFocus,
2038
- onBlur,
2039
- onMouseDown(e) {
2040
- if (scrollRef.current === $23f2114a1b82827e$export$e58f029f0fbfdb29(e))
2041
- e.preventDefault();
2042
- }
2043
- };
2044
- let { typeSelectProps } = $f5a4a9a3486154da$export$e32c88dfddc6e1d8({
2045
- keyboardDelegate: delegate,
2046
- selectionManager: manager
2047
- });
2048
- if (!disallowTypeAhead)
2049
- handlers = $bbaa08b3cd72f041$export$9d1611c77c2fe928(typeSelectProps, handlers);
2050
- let tabIndex = void 0;
2051
- if (!shouldUseVirtualFocus) tabIndex = manager.focusedKey == null ? 0 : -1;
2052
- let collectionId = $22bbea12c2567021$export$881eb0d9f3605d9d(manager.collection);
2053
- return {
2054
- // oxlint-disable-next-line react/react-compiler
2055
- collectionProps: $bbaa08b3cd72f041$export$9d1611c77c2fe928(handlers, {
2056
- tabIndex,
2057
- "data-collection": collectionId
2058
- })
2059
- };
2060
- }
2061
- class $a83747cc3f035330$export$8f5ed9ff9f511381 {
2062
- constructor(ref) {
2063
- this.ref = ref;
2064
- }
2065
- getItemRect(key) {
2066
- let container = this.ref.current;
2067
- if (!container) return null;
2068
- let item = key != null ? $22bbea12c2567021$export$c3d8340acf92597f(this.ref, key) : null;
2069
- if (!item) return null;
2070
- let containerRect = container.getBoundingClientRect();
2071
- let itemRect = item.getBoundingClientRect();
2072
- return {
2073
- x: itemRect.left - containerRect.left - container.clientLeft + container.scrollLeft,
2074
- y: itemRect.top - containerRect.top - container.clientTop + container.scrollTop,
2075
- width: itemRect.width,
2076
- height: itemRect.height
506
+ class $a83747cc3f035330$export$8f5ed9ff9f511381 {
507
+ constructor(ref) {
508
+ this.ref = ref;
509
+ }
510
+ getItemRect(key) {
511
+ let container = this.ref.current;
512
+ if (!container) return null;
513
+ let item = key != null ? $22bbea12c2567021$export$c3d8340acf92597f(this.ref, key) : null;
514
+ if (!item) return null;
515
+ let containerRect = container.getBoundingClientRect();
516
+ let itemRect = item.getBoundingClientRect();
517
+ return {
518
+ x: itemRect.left - containerRect.left - container.clientLeft + container.scrollLeft,
519
+ y: itemRect.top - containerRect.top - container.clientTop + container.scrollTop,
520
+ width: itemRect.width,
521
+ height: itemRect.height
2077
522
  };
2078
523
  }
2079
524
  getContentSize() {
@@ -2086,1144 +531,213 @@ class $a83747cc3f035330$export$8f5ed9ff9f511381 {
2086
531
  getVisibleRect() {
2087
532
  let container = this.ref.current;
2088
533
  return {
2089
- x: container?.scrollLeft ?? 0,
2090
- y: container?.scrollTop ?? 0,
2091
- width: container?.clientWidth ?? 0,
2092
- height: container?.clientHeight ?? 0
2093
- };
2094
- }
2095
- }
2096
- class $ae8f8d98b2b18f2f$export$a05409b8bb224a5a {
2097
- constructor(...args) {
2098
- if (args.length === 1) {
2099
- let opts = args[0];
2100
- this.collection = opts.collection;
2101
- this.ref = opts.ref;
2102
- this.collator = opts.collator;
2103
- this.disabledKeys = opts.disabledKeys || /* @__PURE__ */ new Set();
2104
- this.disabledBehavior = opts.disabledBehavior || "all";
2105
- this.orientation = opts.orientation || "vertical";
2106
- this.direction = opts.direction;
2107
- this.layout = opts.layout || "stack";
2108
- this.layoutDelegate = opts.layoutDelegate || new $a83747cc3f035330$export$8f5ed9ff9f511381(opts.ref);
2109
- } else {
2110
- this.collection = args[0];
2111
- this.disabledKeys = args[1];
2112
- this.ref = args[2];
2113
- this.collator = args[3];
2114
- this.layout = "stack";
2115
- this.orientation = "vertical";
2116
- this.disabledBehavior = "all";
2117
- this.layoutDelegate = new $a83747cc3f035330$export$8f5ed9ff9f511381(this.ref);
2118
- }
2119
- if (this.layout === "stack" && this.orientation === "vertical") {
2120
- this.getKeyLeftOf = void 0;
2121
- this.getKeyRightOf = void 0;
2122
- }
2123
- }
2124
- isDisabled(item) {
2125
- return this.disabledBehavior === "all" && (item.props?.isDisabled || this.disabledKeys.has(item.key)) && item.props?.disabledBehavior !== "selection";
2126
- }
2127
- findNextNonDisabled(key, getNext, includeDisabled = false) {
2128
- let nextKey = key;
2129
- while (nextKey != null) {
2130
- let item = this.collection.getItem(nextKey);
2131
- if (item?.type === "item" && (includeDisabled || !this.isDisabled(item))) return nextKey;
2132
- nextKey = getNext(nextKey);
2133
- }
2134
- return null;
2135
- }
2136
- getNextKey(key, options) {
2137
- let nextKey = key;
2138
- nextKey = this.collection.getKeyAfter(nextKey);
2139
- return this.findNextNonDisabled(nextKey, (key2) => this.collection.getKeyAfter(key2), options?.includeDisabled);
2140
- }
2141
- getPreviousKey(key, options) {
2142
- let nextKey = key;
2143
- nextKey = this.collection.getKeyBefore(nextKey);
2144
- return this.findNextNonDisabled(nextKey, (key2) => this.collection.getKeyBefore(key2), options?.includeDisabled);
2145
- }
2146
- findKey(key, nextKey, shouldSkip) {
2147
- let tempKey = key;
2148
- let itemRect = this.layoutDelegate.getItemRect(tempKey);
2149
- if (!itemRect || tempKey == null) return null;
2150
- let prevRect = itemRect;
2151
- do {
2152
- tempKey = nextKey(tempKey);
2153
- if (tempKey == null) break;
2154
- itemRect = this.layoutDelegate.getItemRect(tempKey);
2155
- } while (itemRect && shouldSkip(prevRect, itemRect) && tempKey != null);
2156
- return tempKey;
2157
- }
2158
- isSameRow(prevRect, itemRect) {
2159
- return prevRect.y === itemRect.y || prevRect.x !== itemRect.x;
2160
- }
2161
- isSameColumn(prevRect, itemRect) {
2162
- return prevRect.x === itemRect.x || prevRect.y !== itemRect.y;
2163
- }
2164
- // checks to see if the next/prev key is spatially above/below the current key. If not, that means we are in
2165
- // a reversed column layout and need to adjust appropriately
2166
- // TODO: still need to see how this works with virtualizer once there is handling for the reverse layout
2167
- // this felt like a simpler approach then changing getKeyAbove/Below to be purely spatial calculations
2168
- isReversed(key) {
2169
- let nextKey = this.getNextKey(key);
2170
- let currentEl = $22bbea12c2567021$export$c3d8340acf92597f(this.ref, key);
2171
- if (nextKey != null) {
2172
- let nextEl = $22bbea12c2567021$export$c3d8340acf92597f(this.ref, nextKey);
2173
- if (!currentEl || !nextEl) return false;
2174
- return currentEl.getBoundingClientRect().top > nextEl.getBoundingClientRect().top;
2175
- }
2176
- let prevKey = this.getPreviousKey(key);
2177
- if (prevKey != null) {
2178
- let prevEl = $22bbea12c2567021$export$c3d8340acf92597f(this.ref, prevKey);
2179
- if (!currentEl || !prevEl) return false;
2180
- return prevEl.getBoundingClientRect().top > currentEl.getBoundingClientRect().top;
2181
- }
2182
- return false;
2183
- }
2184
- getKeyBelow(key, options) {
2185
- if (this.layout === "grid" && this.orientation === "vertical") return this.findKey(key, (key2) => this.getNextKey(key2, options), this.isSameRow);
2186
- else if (this.orientation === "vertical") return this.isReversed(key) ? this.getPreviousKey(key, options) : this.getNextKey(key, options);
2187
- else return this.getNextKey(key, options);
2188
- }
2189
- getKeyAbove(key, options) {
2190
- if (this.layout === "grid" && this.orientation === "vertical") return this.findKey(key, (key2) => this.getPreviousKey(key2, options), this.isSameRow);
2191
- else if (this.orientation === "vertical") return this.isReversed(key) ? this.getNextKey(key, options) : this.getPreviousKey(key, options);
2192
- else return this.getPreviousKey(key, options);
2193
- }
2194
- getNextColumn(key, right, options) {
2195
- return right ? this.getPreviousKey(key, options) : this.getNextKey(key, options);
2196
- }
2197
- getKeyRightOf(key, options) {
2198
- let layoutDelegateMethod = this.direction === "ltr" ? "getKeyRightOf" : "getKeyLeftOf";
2199
- if (this.layoutDelegate[layoutDelegateMethod]) {
2200
- key = this.layoutDelegate[layoutDelegateMethod](key);
2201
- return this.findNextNonDisabled(key, (key2) => this.layoutDelegate[layoutDelegateMethod](key2), options?.includeDisabled);
2202
- }
2203
- if (this.layout === "grid") {
2204
- if (this.orientation === "vertical") return this.getNextColumn(key, this.direction === "rtl", options);
2205
- else return this.findKey(key, (key2) => this.getNextColumn(key2, this.direction === "rtl", options), this.isSameColumn);
2206
- } else if (this.orientation === "horizontal") return this.getNextColumn(key, this.direction === "rtl", options);
2207
- return null;
2208
- }
2209
- getKeyLeftOf(key, options) {
2210
- let layoutDelegateMethod = this.direction === "ltr" ? "getKeyLeftOf" : "getKeyRightOf";
2211
- if (this.layoutDelegate[layoutDelegateMethod]) {
2212
- key = this.layoutDelegate[layoutDelegateMethod](key);
2213
- return this.findNextNonDisabled(key, (key2) => this.layoutDelegate[layoutDelegateMethod](key2), options?.includeDisabled);
2214
- }
2215
- if (this.layout === "grid") {
2216
- if (this.orientation === "vertical") return this.getNextColumn(key, this.direction === "ltr", options);
2217
- else return this.findKey(key, (key2) => this.getNextColumn(key2, this.direction === "ltr", options), this.isSameColumn);
2218
- } else if (this.orientation === "horizontal") return this.getNextColumn(key, this.direction === "ltr", options);
2219
- return null;
2220
- }
2221
- getFirstKey() {
2222
- let key = this.collection.getFirstKey();
2223
- return this.findNextNonDisabled(key, (key2) => this.collection.getKeyAfter(key2));
2224
- }
2225
- getLastKey() {
2226
- let key = this.collection.getLastKey();
2227
- return this.findNextNonDisabled(key, (key2) => this.collection.getKeyBefore(key2));
2228
- }
2229
- getKeyPageAbove(key) {
2230
- let menu = this.ref.current;
2231
- let itemRect = this.layoutDelegate.getItemRect(key);
2232
- if (!itemRect) return null;
2233
- let reversed = this.isReversed(key);
2234
- if (menu && !$901761b40e390936$export$2bb74740c4e19def(menu)) return this.getFirstKey();
2235
- let nextKey = key;
2236
- if (this.orientation === "horizontal") {
2237
- let pageX = Math.max(0, itemRect.x + itemRect.width - this.layoutDelegate.getVisibleRect().width);
2238
- while (itemRect && itemRect.x > pageX && nextKey != null) {
2239
- nextKey = this.getKeyAbove(nextKey);
2240
- itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);
2241
- }
2242
- } else {
2243
- let visibleRect = this.layoutDelegate.getVisibleRect();
2244
- let pageY = reversed ? itemRect.y - visibleRect.height : Math.max(0, itemRect.y + itemRect.height - visibleRect.height);
2245
- while (itemRect && itemRect.y > pageY && nextKey != null) {
2246
- nextKey = this.getKeyAbove(nextKey);
2247
- itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);
2248
- }
2249
- }
2250
- return nextKey ?? (reversed ? this.getLastKey() : this.getFirstKey());
2251
- }
2252
- getKeyPageBelow(key) {
2253
- let menu = this.ref.current;
2254
- let itemRect = this.layoutDelegate.getItemRect(key);
2255
- if (!itemRect) return null;
2256
- let reversed = this.isReversed(key);
2257
- if (menu && !$901761b40e390936$export$2bb74740c4e19def(menu)) return this.getLastKey();
2258
- let nextKey = key;
2259
- if (this.orientation === "horizontal") {
2260
- let pageX = Math.min(this.layoutDelegate.getContentSize().width, itemRect.x - itemRect.width + this.layoutDelegate.getVisibleRect().width);
2261
- while (itemRect && itemRect.x < pageX && nextKey != null) {
2262
- nextKey = this.getKeyBelow(nextKey);
2263
- itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);
2264
- }
2265
- } else {
2266
- let pageY = Math.min(this.layoutDelegate.getContentSize().height, itemRect.y - itemRect.height + this.layoutDelegate.getVisibleRect().height);
2267
- while (itemRect && itemRect.y < pageY && nextKey != null) {
2268
- nextKey = this.getKeyBelow(nextKey);
2269
- itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);
2270
- }
2271
- }
2272
- return nextKey ?? (reversed ? this.getFirstKey() : this.getLastKey());
2273
- }
2274
- getKeyForSearch(search, fromKey) {
2275
- if (!this.collator) return null;
2276
- let collection = this.collection;
2277
- let key = fromKey || this.getFirstKey();
2278
- while (key != null) {
2279
- let item = collection.getItem(key);
2280
- if (!item) return null;
2281
- let substring = item.textValue.slice(0, search.length);
2282
- if (item.textValue && this.collator.compare(substring, search) === 0) return key;
2283
- key = this.getNextKey(key);
2284
- }
2285
- return null;
2286
- }
2287
- }
2288
- let $673d46fce3e5717d$var$cache = /* @__PURE__ */ new Map();
2289
- function $673d46fce3e5717d$export$a16aca283550c30d(options) {
2290
- let { locale } = $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7();
2291
- let cacheKey = locale + (options ? Object.entries(options).sort((a, b) => a[0] < b[0] ? -1 : 1).join() : "");
2292
- if ($673d46fce3e5717d$var$cache.has(cacheKey)) return $673d46fce3e5717d$var$cache.get(cacheKey);
2293
- let formatter = new Intl.Collator(locale, options);
2294
- $673d46fce3e5717d$var$cache.set(cacheKey, formatter);
2295
- return formatter;
2296
- }
2297
- const $7b01448eaad0fe7c$var$DEFAULT_THRESHOLD = 500;
2298
- function $7b01448eaad0fe7c$export$c24ed0104d07eab9(props) {
2299
- let { isDisabled, pointerType, onLongPressStart, onLongPressEnd, onLongPress, threshold = $7b01448eaad0fe7c$var$DEFAULT_THRESHOLD, accessibilityDescription } = props;
2300
- const timeRef = useRef(void 0);
2301
- let { addGlobalListener, removeAllGlobalListeners } = $48a7d519b337145d$export$4eaf04e54aa8eed6();
2302
- let isAcceptedPointerType = (e) => pointerType ? e.pointerType === pointerType : e.pointerType === "mouse" || e.pointerType === "touch";
2303
- let { pressProps } = $d27d541f9569d26d$export$45712eceda6fad21({
2304
- isDisabled,
2305
- onPressStart(e) {
2306
- e.continuePropagation();
2307
- if (isAcceptedPointerType(e)) {
2308
- if (onLongPressStart) onLongPressStart({
2309
- ...e,
2310
- type: "longpressstart"
2311
- });
2312
- timeRef.current = setTimeout(() => {
2313
- e.target.dispatchEvent(new PointerEvent("pointercancel", {
2314
- bubbles: true
2315
- }));
2316
- addGlobalListener(e.target, "click", (e2) => e2.preventDefault(), {
2317
- once: true
2318
- });
2319
- if ($d447af545b77c9f1$export$b204af158042fbac(e.target).activeElement !== e.target) $1969ac565cfec8d0$export$de79e2c695e052f3(e.target);
2320
- if (onLongPress) onLongPress({
2321
- ...e,
2322
- type: "longpress"
2323
- });
2324
- timeRef.current = void 0;
2325
- }, threshold);
2326
- if (e.pointerType === "touch") addGlobalListener(e.target, "contextmenu", (e2) => e2.preventDefault(), {
2327
- once: true
2328
- });
2329
- let ownerWindow = $d447af545b77c9f1$export$f21a1ffae260145a(e.target);
2330
- addGlobalListener(ownerWindow, "pointerup", () => {
2331
- setTimeout(() => {
2332
- removeAllGlobalListeners();
2333
- }, 100);
2334
- }, {
2335
- once: true
2336
- });
2337
- }
2338
- },
2339
- onPressEnd(e) {
2340
- if (timeRef.current) clearTimeout(timeRef.current);
2341
- if (onLongPressEnd && isAcceptedPointerType(e)) onLongPressEnd({
2342
- ...e,
2343
- type: "longpressend"
2344
- });
2345
- }
2346
- });
2347
- let descriptionProps = $121970af65029459$export$f8aeda7b10753fa1(onLongPress && !isDisabled ? accessibilityDescription : void 0);
2348
- return {
2349
- longPressProps: $bbaa08b3cd72f041$export$9d1611c77c2fe928(pressProps, descriptionProps)
2350
- };
2351
- }
2352
- function $f6ba6936bfd098a0$export$ecf600387e221c37(options) {
2353
- let { id, selectionManager: manager, key, ref, shouldSelectOnPressUp, shouldUseVirtualFocus, focus, isDisabled, onAction, allowsDifferentPressOrigin, linkBehavior = "action" } = options;
2354
- let router = $caaf0dd3060ed57c$export$9a302a45f65d0572();
2355
- id = $390e54f620492c70$export$f680877a34711e37(id);
2356
- let onSelect = (e) => {
2357
- if (e.pointerType === "keyboard" && $22bbea12c2567021$export$d3e3bd3e26688c04(e)) manager.toggleSelection(key);
2358
- else {
2359
- if (manager.selectionMode === "none") return;
2360
- if (manager.isLink(key)) {
2361
- if (linkBehavior === "selection" && ref.current) {
2362
- let itemProps2 = manager.getItemProps(key);
2363
- router.open(ref.current, e, itemProps2.href, itemProps2.routerOptions);
2364
- manager.setSelectedKeys(manager.selectedKeys);
2365
- return;
2366
- } else if (linkBehavior === "override" || linkBehavior === "none") return;
2367
- }
2368
- if (manager.selectionMode === "single") {
2369
- if (manager.isSelected(key) && !manager.disallowEmptySelection) manager.toggleSelection(key);
2370
- else manager.replaceSelection(key);
2371
- } else if (e && e.shiftKey) manager.extendSelection(key);
2372
- else if (manager.selectionBehavior === "toggle" || e && ($bb39c0fc1c19b34c$export$16792effe837dba3(e) || e.pointerType === "touch" || e.pointerType === "virtual"))
2373
- manager.toggleSelection(key);
2374
- else manager.replaceSelection(key);
2375
- }
2376
- };
2377
- useEffect(() => {
2378
- let isFocused = key === manager.focusedKey;
2379
- if (isFocused && manager.isFocused) {
2380
- if (!shouldUseVirtualFocus) {
2381
- if (focus) focus();
2382
- else if ($23f2114a1b82827e$export$cd4e5573fbe2b576() !== ref.current && ref.current) $f192c2f16961cbe0$export$80f3e147d781571c(ref.current);
2383
- } else $b72f3f7b3b5f42c6$export$76e4e37e5339496d(ref.current);
2384
- }
2385
- }, [
2386
- ref,
2387
- key,
2388
- manager.focusedKey,
2389
- manager.childFocusStrategy,
2390
- manager.isFocused,
2391
- shouldUseVirtualFocus
2392
- ]);
2393
- isDisabled = isDisabled || manager.isDisabled(key);
2394
- let itemProps = {};
2395
- if (!shouldUseVirtualFocus && !isDisabled) itemProps = {
2396
- tabIndex: key === manager.focusedKey ? 0 : -1,
2397
- onFocus(e) {
2398
- if ($23f2114a1b82827e$export$e58f029f0fbfdb29(e) === ref.current) manager.setFocusedKey(key);
2399
- }
2400
- };
2401
- else if (isDisabled) itemProps.onMouseDown = (e) => {
2402
- e.preventDefault();
2403
- };
2404
- useEffect(() => {
2405
- if (isDisabled && manager.focusedKey === key) manager.setFocusedKey(null);
2406
- }, [
2407
- manager,
2408
- isDisabled,
2409
- key
2410
- ]);
2411
- let isLinkOverride = manager.isLink(key) && linkBehavior === "override";
2412
- let isActionOverride = onAction && options["UNSTABLE_itemBehavior"] === "action";
2413
- let hasLinkAction = manager.isLink(key) && linkBehavior !== "selection" && linkBehavior !== "none";
2414
- let allowsSelection = !isDisabled && manager.canSelectItem(key) && !isLinkOverride && !isActionOverride;
2415
- let allowsActions = (onAction || hasLinkAction) && !isDisabled;
2416
- let hasPrimaryAction = allowsActions && (manager.selectionBehavior === "replace" ? !allowsSelection : !allowsSelection || manager.isEmpty);
2417
- let hasSecondaryAction = allowsActions && allowsSelection && manager.selectionBehavior === "replace";
2418
- let hasAction = hasPrimaryAction || hasSecondaryAction;
2419
- let modality = useRef(null);
2420
- let longPressEnabled = hasAction && allowsSelection;
2421
- let longPressEnabledOnPressStart = useRef(false);
2422
- let hadPrimaryActionOnPressStart = useRef(false);
2423
- let collectionItemProps = manager.getItemProps(key);
2424
- let performAction = (e) => {
2425
- if (onAction) {
2426
- onAction();
2427
- ref.current?.dispatchEvent(new CustomEvent("react-aria-item-action", {
2428
- bubbles: true
2429
- }));
2430
- }
2431
- if (hasLinkAction && ref.current) router.open(ref.current, e, collectionItemProps.href, collectionItemProps.routerOptions);
2432
- };
2433
- let itemPressProps = {
2434
- ref
2435
- };
2436
- if (shouldSelectOnPressUp) {
2437
- itemPressProps.onPressStart = (e) => {
2438
- modality.current = e.pointerType;
2439
- longPressEnabledOnPressStart.current = longPressEnabled;
2440
- if (e.pointerType === "keyboard" && (!hasAction || $f6ba6936bfd098a0$var$isSelectionKey(e.key))) onSelect(e);
2441
- };
2442
- if (!allowsDifferentPressOrigin)
2443
- itemPressProps.onPress = (e) => {
2444
- if (hasPrimaryAction || hasSecondaryAction && e.pointerType !== "mouse") {
2445
- if (e.pointerType === "keyboard" && !$f6ba6936bfd098a0$var$isActionKey(e.key)) return;
2446
- performAction(e);
2447
- } else if (e.pointerType !== "keyboard" && allowsSelection) onSelect(e);
2448
- };
2449
- else {
2450
- itemPressProps.onPressUp = hasPrimaryAction ? void 0 : (e) => {
2451
- if (e.pointerType === "mouse" && allowsSelection) onSelect(e);
2452
- };
2453
- itemPressProps.onPress = hasPrimaryAction ? performAction : (e) => {
2454
- if (e.pointerType !== "keyboard" && e.pointerType !== "mouse" && allowsSelection) onSelect(e);
2455
- };
2456
- }
2457
- } else {
2458
- itemPressProps.onPressStart = (e) => {
2459
- modality.current = e.pointerType;
2460
- longPressEnabledOnPressStart.current = longPressEnabled;
2461
- hadPrimaryActionOnPressStart.current = hasPrimaryAction;
2462
- if (allowsSelection && (e.pointerType === "mouse" && !hasPrimaryAction || e.pointerType === "keyboard" && (!allowsActions || $f6ba6936bfd098a0$var$isSelectionKey(e.key)))) onSelect(e);
2463
- };
2464
- itemPressProps.onPress = (e) => {
2465
- if (e.pointerType === "touch" || e.pointerType === "pen" || e.pointerType === "virtual" || e.pointerType === "keyboard" && hasAction && $f6ba6936bfd098a0$var$isActionKey(e.key) || e.pointerType === "mouse" && hadPrimaryActionOnPressStart.current) {
2466
- if (hasAction) performAction(e);
2467
- else if (allowsSelection) onSelect(e);
2468
- }
2469
- };
2470
- }
2471
- let collectionId = $22bbea12c2567021$export$6aeb1680a0ae8741(manager.collection);
2472
- itemProps["data-collection"] = collectionId;
2473
- itemProps["data-key"] = key;
2474
- itemPressProps.preventFocusOnPress = shouldUseVirtualFocus;
2475
- if (shouldUseVirtualFocus)
2476
- itemPressProps = $bbaa08b3cd72f041$export$9d1611c77c2fe928(itemPressProps, {
2477
- onPressStart(e) {
2478
- if (e.pointerType !== "touch") {
2479
- manager.setFocused(true);
2480
- manager.setFocusedKey(key);
2481
- }
2482
- },
2483
- onPress(e) {
2484
- if (e.pointerType === "touch") {
2485
- manager.setFocused(true);
2486
- manager.setFocusedKey(key);
2487
- }
2488
- }
2489
- });
2490
- if (collectionItemProps) {
2491
- for (let key2 of [
2492
- "onPressStart",
2493
- "onPressEnd",
2494
- "onPressChange",
2495
- "onPress",
2496
- "onPressUp",
2497
- "onClick"
2498
- ]) if (collectionItemProps[key2])
2499
- itemPressProps[key2] = $a4e76a5424781910$export$e08e3b67e392101e(itemPressProps[key2], collectionItemProps[key2]);
2500
- }
2501
- let { pressProps, isPressed } = $d27d541f9569d26d$export$45712eceda6fad21(itemPressProps);
2502
- let onDoubleClick = hasSecondaryAction ? (e) => {
2503
- if (modality.current === "mouse") {
2504
- e.stopPropagation();
2505
- e.preventDefault();
2506
- performAction(e);
2507
- }
2508
- } : void 0;
2509
- let { longPressProps } = $7b01448eaad0fe7c$export$c24ed0104d07eab9({
2510
- isDisabled: !longPressEnabled,
2511
- onLongPress(e) {
2512
- if (e.pointerType === "touch") {
2513
- onSelect(e);
2514
- manager.setSelectionBehavior("toggle");
2515
- }
2516
- }
2517
- });
2518
- let onDragStartCapture = (e) => {
2519
- if (modality.current === "touch" && longPressEnabledOnPressStart.current) e.preventDefault();
2520
- };
2521
- let onClick = linkBehavior !== "none" && manager.isLink(key) ? (e) => {
2522
- if (!$caaf0dd3060ed57c$export$95185d699e05d4d7.isOpening) e.preventDefault();
2523
- } : void 0;
2524
- let mergedItemProps = $bbaa08b3cd72f041$export$9d1611c77c2fe928(
2525
- // oxlint-disable-next-line react/react-compiler
2526
- itemProps,
2527
- allowsSelection || hasPrimaryAction || shouldUseVirtualFocus && !isDisabled ? pressProps : {},
2528
- longPressEnabled ? longPressProps : {},
2529
- // oxlint-disable-next-line react/react-compiler
2530
- {
2531
- onDoubleClick,
2532
- onDragStartCapture,
2533
- onClick,
2534
- id
2535
- },
2536
- // Prevent DOM focus from moving on mouse down when using virtual focus
2537
- shouldUseVirtualFocus ? {
2538
- onMouseDown: (e) => e.preventDefault()
2539
- } : void 0
2540
- );
2541
- let isChildInteraction = (target) => {
2542
- let el = target;
2543
- while (el && el !== ref.current) {
2544
- let elCollection = el.getAttribute("data-collection");
2545
- if (elCollection != null) return elCollection !== collectionId;
2546
- el = el.parentElement;
2547
- }
2548
- return $3b8b240c1bf84ab9$export$bebd5a1431fec25d(target);
2549
- };
2550
- let baseOnPointerDown = mergedItemProps.onPointerDown;
2551
- mergedItemProps.onPointerDown = (e) => {
2552
- let target = $23f2114a1b82827e$export$e58f029f0fbfdb29(e);
2553
- if (target && target !== ref.current && isChildInteraction(target)) {
2554
- e.stopPropagation();
2555
- return;
2556
- }
2557
- baseOnPointerDown?.(e);
2558
- };
2559
- let baseOnMouseDown = mergedItemProps.onMouseDown;
2560
- mergedItemProps.onMouseDown = (e) => {
2561
- let target = $23f2114a1b82827e$export$e58f029f0fbfdb29(e);
2562
- if (target && target !== ref.current && isChildInteraction(target)) {
2563
- e.stopPropagation();
2564
- return;
2565
- }
2566
- baseOnMouseDown?.(e);
2567
- };
2568
- return {
2569
- itemProps: mergedItemProps,
2570
- isPressed,
2571
- isSelected: manager.isSelected(key),
2572
- isFocused: manager.isFocused && manager.focusedKey === key,
2573
- isDisabled,
2574
- allowsSelection,
2575
- hasAction
2576
- };
2577
- }
2578
- function $f6ba6936bfd098a0$var$isActionKey(key) {
2579
- return key === "Enter";
2580
- }
2581
- function $f6ba6936bfd098a0$var$isSelectionKey(key) {
2582
- return key === " ";
2583
- }
2584
- function $cd5ea4b915021f1d$export$1005530eda016c13(node, collection) {
2585
- if (typeof collection.getChildren === "function") return collection.getChildren(node.key);
2586
- return node.childNodes;
2587
- }
2588
- function $cd5ea4b915021f1d$export$fbdeaa6a76694f71(iterable) {
2589
- return $cd5ea4b915021f1d$export$5f3398f8733f90e2(iterable, 0);
2590
- }
2591
- function $cd5ea4b915021f1d$export$5f3398f8733f90e2(iterable, index) {
2592
- if (index < 0) return void 0;
2593
- let i = 0;
2594
- for (let item of iterable) {
2595
- if (i === index) return item;
2596
- i++;
2597
- }
2598
- }
2599
- function $cd5ea4b915021f1d$export$7475b2c64539e4cf(iterable) {
2600
- let lastItem = void 0;
2601
- for (let value of iterable) lastItem = value;
2602
- return lastItem;
2603
- }
2604
- function $cd5ea4b915021f1d$export$8c434b3a7a4dad6(collection, a, b) {
2605
- if (a.parentKey === b.parentKey) return a.index - b.index;
2606
- let aAncestors = [
2607
- ...$cd5ea4b915021f1d$var$getAncestors(collection, a),
2608
- a
2609
- ];
2610
- let bAncestors = [
2611
- ...$cd5ea4b915021f1d$var$getAncestors(collection, b),
2612
- b
2613
- ];
2614
- let firstNonMatchingAncestor = aAncestors.slice(0, bAncestors.length).findIndex((a2, i) => a2 !== bAncestors[i]);
2615
- if (firstNonMatchingAncestor !== -1) {
2616
- a = aAncestors[firstNonMatchingAncestor];
2617
- b = bAncestors[firstNonMatchingAncestor];
2618
- return a.index - b.index;
2619
- }
2620
- if (aAncestors.findIndex((node) => node === b) >= 0) return 1;
2621
- else if (bAncestors.findIndex((node) => node === a) >= 0) return -1;
2622
- return -1;
2623
- }
2624
- function $cd5ea4b915021f1d$var$getAncestors(collection, node) {
2625
- let parents = [];
2626
- let currNode = node;
2627
- while (currNode?.parentKey != null) {
2628
- currNode = collection.getItem(currNode.parentKey);
2629
- if (currNode) parents.unshift(currNode);
2630
- }
2631
- return parents;
2632
- }
2633
- function $b24d1bc31a0f941d$export$a9d04c5684123369(value) {
2634
- const pieces = version.split(".");
2635
- const major = parseInt(pieces[0], 10);
2636
- if (major >= 19) return value;
2637
- return value ? "true" : void 0;
2638
- }
2639
- class $8b2540e09867b15e$export$52baac22726c72bf extends Set {
2640
- constructor(keys, anchorKey, currentKey) {
2641
- super(keys);
2642
- if (keys instanceof $8b2540e09867b15e$export$52baac22726c72bf) {
2643
- this.anchorKey = anchorKey ?? keys.anchorKey;
2644
- this.currentKey = currentKey ?? keys.currentKey;
2645
- } else {
2646
- this.anchorKey = anchorKey ?? null;
2647
- this.currentKey = currentKey ?? null;
2648
- }
2649
- }
2650
- }
2651
- function $60f19cefd567a3e4$var$equalSets(setA, setB) {
2652
- if (setA.size !== setB.size) return false;
2653
- for (let item of setA) {
2654
- if (!setB.has(item)) return false;
2655
- }
2656
- return true;
2657
- }
2658
- function $60f19cefd567a3e4$export$253fe78d46329472(props) {
2659
- let { selectionMode = "none", disallowEmptySelection = false, allowDuplicateSelectionEvents, selectionBehavior: selectionBehaviorProp = "toggle", disabledBehavior = "all" } = props;
2660
- let isFocusedRef = useRef(false);
2661
- let [, setFocused] = useState(false);
2662
- let focusedKeyRef = useRef(null);
2663
- let childFocusStrategyRef = useRef(null);
2664
- let [, setFocusedKey] = useState(null);
2665
- let selectedKeysProp = useMemo(() => $60f19cefd567a3e4$var$convertSelection(props.selectedKeys), [
2666
- props.selectedKeys
2667
- ]);
2668
- let defaultSelectedKeys = useMemo(() => $60f19cefd567a3e4$var$convertSelection(props.defaultSelectedKeys, new $8b2540e09867b15e$export$52baac22726c72bf()), [
2669
- props.defaultSelectedKeys
2670
- ]);
2671
- let [selectedKeys, setSelectedKeys] = $3e6197669829fe11$export$40bfa8c7b0832715(selectedKeysProp, defaultSelectedKeys, props.onSelectionChange);
2672
- let disabledKeysProp = useMemo(() => props.disabledKeys ? new Set(props.disabledKeys) : /* @__PURE__ */ new Set(), [
2673
- props.disabledKeys
2674
- ]);
2675
- let [selectionBehavior, setSelectionBehavior] = useState(selectionBehaviorProp);
2676
- if (selectionBehaviorProp === "replace" && selectionBehavior === "toggle" && typeof selectedKeys === "object" && selectedKeys.size === 0) setSelectionBehavior("replace");
2677
- let lastSelectionBehavior = useRef(selectionBehaviorProp);
2678
- useEffect(() => {
2679
- if (selectionBehaviorProp !== lastSelectionBehavior.current) {
2680
- setSelectionBehavior(selectionBehaviorProp);
2681
- lastSelectionBehavior.current = selectionBehaviorProp;
2682
- }
2683
- }, [
2684
- selectionBehaviorProp
2685
- ]);
2686
- return {
2687
- selectionMode,
2688
- disallowEmptySelection,
2689
- selectionBehavior,
2690
- setSelectionBehavior,
2691
- get isFocused() {
2692
- return isFocusedRef.current;
2693
- },
2694
- setFocused(f) {
2695
- isFocusedRef.current = f;
2696
- setFocused(f);
2697
- },
2698
- get focusedKey() {
2699
- return focusedKeyRef.current;
2700
- },
2701
- get childFocusStrategy() {
2702
- return childFocusStrategyRef.current;
2703
- },
2704
- setFocusedKey(k, childFocusStrategy = "first") {
2705
- focusedKeyRef.current = k;
2706
- childFocusStrategyRef.current = childFocusStrategy;
2707
- setFocusedKey(k);
2708
- },
2709
- selectedKeys,
2710
- setSelectedKeys(keys) {
2711
- if (allowDuplicateSelectionEvents || !$60f19cefd567a3e4$var$equalSets(keys, selectedKeys)) setSelectedKeys(keys);
2712
- },
2713
- disabledKeys: disabledKeysProp,
2714
- disabledBehavior
2715
- };
2716
- }
2717
- function $60f19cefd567a3e4$var$convertSelection(selection, defaultValue) {
2718
- if (!selection) return defaultValue;
2719
- return selection === "all" ? "all" : new $8b2540e09867b15e$export$52baac22726c72bf(selection);
2720
- }
2721
- class $4a07ac835f260f78$export$6c8a5aaad13c9852 {
2722
- constructor(collection, state, options) {
2723
- this.collection = collection;
2724
- this.state = state;
2725
- this.allowsCellSelection = options?.allowsCellSelection ?? false;
2726
- this._isSelectAll = null;
2727
- this.layoutDelegate = options?.layoutDelegate || null;
2728
- this.fullCollection = options?.fullCollection || null;
2729
- }
2730
- /**
2731
- * The type of selection that is allowed in the collection.
2732
- */
2733
- get selectionMode() {
2734
- return this.state.selectionMode;
2735
- }
2736
- /**
2737
- * Whether the collection allows empty selection.
2738
- */
2739
- get disallowEmptySelection() {
2740
- return this.state.disallowEmptySelection;
2741
- }
2742
- /**
2743
- * The selection behavior for the collection.
2744
- */
2745
- get selectionBehavior() {
2746
- return this.state.selectionBehavior;
2747
- }
2748
- /**
2749
- * Sets the selection behavior for the collection.
2750
- */
2751
- setSelectionBehavior(selectionBehavior) {
2752
- this.state.setSelectionBehavior(selectionBehavior);
2753
- }
2754
- /**
2755
- * Whether the collection is currently focused.
2756
- */
2757
- get isFocused() {
2758
- return this.state.isFocused;
2759
- }
2760
- /**
2761
- * Sets whether the collection is focused.
2762
- */
2763
- setFocused(isFocused) {
2764
- this.state.setFocused(isFocused);
2765
- }
2766
- /**
2767
- * The current focused key in the collection.
2768
- */
2769
- get focusedKey() {
2770
- return this.state.focusedKey;
2771
- }
2772
- /** Whether the first or last child of the focused key should receive focus. */
2773
- get childFocusStrategy() {
2774
- return this.state.childFocusStrategy;
2775
- }
2776
- /**
2777
- * Sets the focused key.
2778
- */
2779
- setFocusedKey(key, childFocusStrategy) {
2780
- if (key == null || this.collection.getItem(key)) this.state.setFocusedKey(key, childFocusStrategy);
2781
- }
2782
- /**
2783
- * The currently selected keys in the collection.
2784
- */
2785
- get selectedKeys() {
2786
- return this.state.selectedKeys === "all" ? new Set(this.getSelectAllKeys()) : this.state.selectedKeys;
2787
- }
2788
- /**
2789
- * The raw selection value for the collection.
2790
- * Either 'all' for select all, or a set of keys.
2791
- */
2792
- get rawSelection() {
2793
- return this.state.selectedKeys;
2794
- }
2795
- /**
2796
- * Returns whether a key is selected.
2797
- */
2798
- isSelected(key) {
2799
- if (this.state.selectionMode === "none") return false;
2800
- let mappedKey = this.getKey(key);
2801
- if (mappedKey == null) return false;
2802
- return this.state.selectedKeys === "all" ? this.canSelectItem(mappedKey) : this.state.selectedKeys.has(mappedKey);
2803
- }
2804
- /**
2805
- * Whether the selection is empty.
2806
- */
2807
- get isEmpty() {
2808
- return this.state.selectedKeys !== "all" && this.state.selectedKeys.size === 0;
2809
- }
2810
- /**
2811
- * Whether all items in the collection are selected.
2812
- */
2813
- get isSelectAll() {
2814
- if (this.isEmpty) return false;
2815
- if (this.state.selectedKeys === "all") return true;
2816
- if (this._isSelectAll != null) return this._isSelectAll;
2817
- let allKeys = this.getSelectAllKeys();
2818
- let selectedKeys = this.state.selectedKeys;
2819
- this._isSelectAll = allKeys.every((k) => selectedKeys.has(k));
2820
- return this._isSelectAll;
2821
- }
2822
- get firstSelectedKey() {
2823
- let first = null;
2824
- for (let key of this.state.selectedKeys) {
2825
- let item = this.collection.getItem(key);
2826
- if (!first || item && $cd5ea4b915021f1d$export$8c434b3a7a4dad6(this.collection, item, first) < 0) first = item;
2827
- }
2828
- return first?.key ?? null;
2829
- }
2830
- get lastSelectedKey() {
2831
- let last = null;
2832
- for (let key of this.state.selectedKeys) {
2833
- let item = this.collection.getItem(key);
2834
- if (!last || item && $cd5ea4b915021f1d$export$8c434b3a7a4dad6(this.collection, item, last) > 0) last = item;
2835
- }
2836
- return last?.key ?? null;
2837
- }
2838
- get disabledKeys() {
2839
- return this.state.disabledKeys;
2840
- }
2841
- get disabledBehavior() {
2842
- return this.state.disabledBehavior;
534
+ x: container?.scrollLeft ?? 0,
535
+ y: container?.scrollTop ?? 0,
536
+ width: container?.clientWidth ?? 0,
537
+ height: container?.clientHeight ?? 0
538
+ };
2843
539
  }
2844
- /**
2845
- * Extends the selection to the given key.
2846
- */
2847
- extendSelection(toKey) {
2848
- if (this.selectionMode === "none") return;
2849
- if (this.selectionMode === "single") {
2850
- this.replaceSelection(toKey);
2851
- return;
2852
- }
2853
- let mappedToKey = this.getKey(toKey);
2854
- if (mappedToKey == null) return;
2855
- let selection;
2856
- if (this.state.selectedKeys === "all") selection = new $8b2540e09867b15e$export$52baac22726c72bf([
2857
- mappedToKey
2858
- ], mappedToKey, mappedToKey);
2859
- else {
2860
- let selectedKeys = this.state.selectedKeys;
2861
- let anchorKey = selectedKeys.anchorKey ?? mappedToKey;
2862
- selection = new $8b2540e09867b15e$export$52baac22726c72bf(selectedKeys, anchorKey, mappedToKey);
2863
- for (let key of this.getKeyRange(anchorKey, selectedKeys.currentKey ?? mappedToKey)) selection.delete(key);
2864
- for (let key of this.getKeyRange(mappedToKey, anchorKey)) if (this.canSelectItem(key)) selection.add(key);
2865
- }
2866
- this.state.setSelectedKeys(selection);
2867
- }
2868
- getKeyRange(from, to) {
2869
- let fromItem = this.collection.getItem(from);
2870
- let toItem = this.collection.getItem(to);
2871
- if (fromItem && toItem) {
2872
- if ($cd5ea4b915021f1d$export$8c434b3a7a4dad6(this.collection, fromItem, toItem) <= 0) return this.getKeyRangeInternal(from, to);
2873
- return this.getKeyRangeInternal(to, from);
540
+ }
541
+ class $ae8f8d98b2b18f2f$export$a05409b8bb224a5a {
542
+ constructor(...args) {
543
+ if (args.length === 1) {
544
+ let opts = args[0];
545
+ this.collection = opts.collection;
546
+ this.ref = opts.ref;
547
+ this.collator = opts.collator;
548
+ this.disabledKeys = opts.disabledKeys || /* @__PURE__ */ new Set();
549
+ this.disabledBehavior = opts.disabledBehavior || "all";
550
+ this.orientation = opts.orientation || "vertical";
551
+ this.direction = opts.direction;
552
+ this.layout = opts.layout || "stack";
553
+ this.layoutDelegate = opts.layoutDelegate || new $a83747cc3f035330$export$8f5ed9ff9f511381(opts.ref);
554
+ } else {
555
+ this.collection = args[0];
556
+ this.disabledKeys = args[1];
557
+ this.ref = args[2];
558
+ this.collator = args[3];
559
+ this.layout = "stack";
560
+ this.orientation = "vertical";
561
+ this.disabledBehavior = "all";
562
+ this.layoutDelegate = new $a83747cc3f035330$export$8f5ed9ff9f511381(this.ref);
2874
563
  }
2875
- return [];
2876
- }
2877
- getKeyRangeInternal(from, to) {
2878
- if (this.layoutDelegate?.getKeyRange) return this.layoutDelegate.getKeyRange(from, to);
2879
- let keys = [];
2880
- let key = from;
2881
- while (key != null) {
2882
- let item = this.collection.getItem(key);
2883
- if (item && (item.type === "item" || item.type === "cell" && this.allowsCellSelection)) keys.push(key);
2884
- if (key === to) return keys;
2885
- key = this.collection.getKeyAfter(key);
564
+ if (this.layout === "stack" && this.orientation === "vertical") {
565
+ this.getKeyLeftOf = void 0;
566
+ this.getKeyRightOf = void 0;
2886
567
  }
2887
- return [];
2888
568
  }
2889
- getKey(key) {
2890
- let item = this.collection.getItem(key);
2891
- if (!item)
2892
- return key;
2893
- if (item.type === "cell" && this.allowsCellSelection) return key;
2894
- while (item && item.type !== "item" && item.parentKey != null) item = this.collection.getItem(item.parentKey);
2895
- if (!item || item.type !== "item") return null;
2896
- return item.key;
569
+ isDisabled(item) {
570
+ return this.disabledBehavior === "all" && (item.props?.isDisabled || this.disabledKeys.has(item.key)) && item.props?.disabledBehavior !== "selection";
2897
571
  }
2898
- /**
2899
- * Toggles whether the given key is selected.
2900
- */
2901
- toggleSelection(key) {
2902
- if (this.selectionMode === "none") return;
2903
- if (this.selectionMode === "single" && !this.isSelected(key)) {
2904
- this.replaceSelection(key);
2905
- return;
2906
- }
2907
- let mappedKey = this.getKey(key);
2908
- if (mappedKey == null) return;
2909
- let keys = new $8b2540e09867b15e$export$52baac22726c72bf(this.state.selectedKeys === "all" ? this.getSelectAllKeys() : this.state.selectedKeys);
2910
- if (keys.has(mappedKey)) keys.delete(mappedKey);
2911
- else if (this.canSelectItem(mappedKey)) {
2912
- keys.add(mappedKey);
2913
- keys.anchorKey = mappedKey;
2914
- keys.currentKey = mappedKey;
572
+ findNextNonDisabled(key, getNext, includeDisabled = false) {
573
+ let nextKey = key;
574
+ while (nextKey != null) {
575
+ let item = this.collection.getItem(nextKey);
576
+ if (item?.type === "item" && (includeDisabled || !this.isDisabled(item))) return nextKey;
577
+ nextKey = getNext(nextKey);
2915
578
  }
2916
- if (this.disallowEmptySelection && keys.size === 0) return;
2917
- this.state.setSelectedKeys(keys);
579
+ return null;
2918
580
  }
2919
- /**
2920
- * Replaces the selection with only the given key.
2921
- */
2922
- replaceSelection(key) {
2923
- if (this.selectionMode === "none") return;
2924
- let mappedKey = this.getKey(key);
2925
- if (mappedKey == null) return;
2926
- let selection = this.canSelectItem(mappedKey) ? new $8b2540e09867b15e$export$52baac22726c72bf([
2927
- mappedKey
2928
- ], mappedKey, mappedKey) : new $8b2540e09867b15e$export$52baac22726c72bf();
2929
- this.state.setSelectedKeys(selection);
581
+ getNextKey(key, options) {
582
+ let nextKey = key;
583
+ nextKey = this.collection.getKeyAfter(nextKey);
584
+ return this.findNextNonDisabled(nextKey, (key2) => this.collection.getKeyAfter(key2), options?.includeDisabled);
2930
585
  }
2931
- /**
2932
- * Replaces the selection with the given keys.
2933
- */
2934
- setSelectedKeys(keys) {
2935
- if (this.selectionMode === "none") return;
2936
- let selection = new $8b2540e09867b15e$export$52baac22726c72bf();
2937
- for (let key of keys) {
2938
- let mappedKey = this.getKey(key);
2939
- if (mappedKey != null) {
2940
- selection.add(mappedKey);
2941
- if (this.selectionMode === "single") break;
2942
- }
2943
- }
2944
- this.state.setSelectedKeys(selection);
2945
- }
2946
- getSelectAllKeys() {
2947
- let collection = this.fullCollection ?? this.collection;
2948
- let keys = [];
2949
- let addKeys = (key) => {
2950
- while (key != null) {
2951
- if (this.canSelectItemIn(key, collection)) {
2952
- let item = collection.getItem(key);
2953
- if (item?.type === "item") keys.push(key);
2954
- if (item?.hasChildNodes && (this.allowsCellSelection || item.type !== "item")) addKeys($cd5ea4b915021f1d$export$fbdeaa6a76694f71($cd5ea4b915021f1d$export$1005530eda016c13(item, collection))?.key ?? null);
2955
- }
2956
- key = collection.getKeyAfter(key);
2957
- }
2958
- };
2959
- addKeys(collection.getFirstKey());
2960
- return keys;
586
+ getPreviousKey(key, options) {
587
+ let nextKey = key;
588
+ nextKey = this.collection.getKeyBefore(nextKey);
589
+ return this.findNextNonDisabled(nextKey, (key2) => this.collection.getKeyBefore(key2), options?.includeDisabled);
2961
590
  }
2962
- /**
2963
- * Selects all items in the collection.
2964
- */
2965
- selectAll() {
2966
- if (!this.isSelectAll && this.selectionMode === "multiple") this.state.setSelectedKeys("all");
591
+ findKey(key, nextKey, shouldSkip) {
592
+ let tempKey = key;
593
+ let itemRect = this.layoutDelegate.getItemRect(tempKey);
594
+ if (!itemRect || tempKey == null) return null;
595
+ let prevRect = itemRect;
596
+ do {
597
+ tempKey = nextKey(tempKey);
598
+ if (tempKey == null) break;
599
+ itemRect = this.layoutDelegate.getItemRect(tempKey);
600
+ } while (itemRect && shouldSkip(prevRect, itemRect) && tempKey != null);
601
+ return tempKey;
2967
602
  }
2968
- /**
2969
- * Removes all keys from the selection.
2970
- */
2971
- clearSelection() {
2972
- if (!this.disallowEmptySelection && (this.state.selectedKeys === "all" || this.state.selectedKeys.size > 0)) this.state.setSelectedKeys(new $8b2540e09867b15e$export$52baac22726c72bf());
603
+ isSameRow(prevRect, itemRect) {
604
+ return prevRect.y === itemRect.y || prevRect.x !== itemRect.x;
2973
605
  }
2974
- /**
2975
- * Toggles between select all and an empty selection.
2976
- */
2977
- toggleSelectAll() {
2978
- if (this.isSelectAll) this.clearSelection();
2979
- else this.selectAll();
2980
- }
2981
- select(key, e) {
2982
- if (this.selectionMode === "none") return;
2983
- if (this.selectionMode === "single") {
2984
- if (this.isSelected(key) && !this.disallowEmptySelection) this.toggleSelection(key);
2985
- else this.replaceSelection(key);
2986
- } else if (this.selectionBehavior === "toggle" || e && (e.pointerType === "touch" || e.pointerType === "virtual"))
2987
- this.toggleSelection(key);
2988
- else this.replaceSelection(key);
606
+ isSameColumn(prevRect, itemRect) {
607
+ return prevRect.x === itemRect.x || prevRect.y !== itemRect.y;
2989
608
  }
2990
- /**
2991
- * Returns whether the current selection is equal to the given selection.
2992
- */
2993
- isSelectionEqual(selection) {
2994
- if (selection === this.state.selectedKeys) return true;
2995
- let selectedKeys = this.selectedKeys;
2996
- if (selection.size !== selectedKeys.size) return false;
2997
- for (let key of selection) {
2998
- if (!selectedKeys.has(key)) return false;
609
+ // checks to see if the next/prev key is spatially above/below the current key. If not, that means we are in
610
+ // a reversed column layout and need to adjust appropriately
611
+ // TODO: still need to see how this works with virtualizer once there is handling for the reverse layout
612
+ // this felt like a simpler approach then changing getKeyAbove/Below to be purely spatial calculations
613
+ isReversed(key) {
614
+ let nextKey = this.getNextKey(key);
615
+ let currentEl = $22bbea12c2567021$export$c3d8340acf92597f(this.ref, key);
616
+ if (nextKey != null) {
617
+ let nextEl = $22bbea12c2567021$export$c3d8340acf92597f(this.ref, nextKey);
618
+ if (!currentEl || !nextEl) return false;
619
+ return currentEl.getBoundingClientRect().top > nextEl.getBoundingClientRect().top;
2999
620
  }
3000
- for (let key of selectedKeys) {
3001
- if (!selection.has(key)) return false;
621
+ let prevKey = this.getPreviousKey(key);
622
+ if (prevKey != null) {
623
+ let prevEl = $22bbea12c2567021$export$c3d8340acf92597f(this.ref, prevKey);
624
+ if (!currentEl || !prevEl) return false;
625
+ return prevEl.getBoundingClientRect().top > currentEl.getBoundingClientRect().top;
3002
626
  }
3003
- return true;
627
+ return false;
3004
628
  }
3005
- canSelectItem(key) {
3006
- return this.canSelectItemIn(key, this.collection);
629
+ getKeyBelow(key, options) {
630
+ if (this.layout === "grid" && this.orientation === "vertical") return this.findKey(key, (key2) => this.getNextKey(key2, options), this.isSameRow);
631
+ else if (this.orientation === "vertical") return this.isReversed(key) ? this.getPreviousKey(key, options) : this.getNextKey(key, options);
632
+ else return this.getNextKey(key, options);
633
+ }
634
+ getKeyAbove(key, options) {
635
+ if (this.layout === "grid" && this.orientation === "vertical") return this.findKey(key, (key2) => this.getPreviousKey(key2, options), this.isSameRow);
636
+ else if (this.orientation === "vertical") return this.isReversed(key) ? this.getNextKey(key, options) : this.getPreviousKey(key, options);
637
+ else return this.getPreviousKey(key, options);
3007
638
  }
3008
- canSelectItemIn(key, collection) {
3009
- if (this.state.selectionMode === "none" || this.state.disabledKeys.has(key)) return false;
3010
- let item = collection.getItem(key);
3011
- if (!item || item?.props?.isDisabled || item.type === "cell" && !this.allowsCellSelection) return false;
3012
- return true;
639
+ getNextColumn(key, right, options) {
640
+ return right ? this.getPreviousKey(key, options) : this.getNextKey(key, options);
3013
641
  }
3014
- isDisabled(key) {
3015
- let item = this.collection.getItem(key);
3016
- return this.state.disabledBehavior === "all" && (this.state.disabledKeys.has(key) || !!item?.props?.isDisabled) && item?.props?.disabledBehavior !== "selection";
642
+ getKeyRightOf(key, options) {
643
+ let layoutDelegateMethod = this.direction === "ltr" ? "getKeyRightOf" : "getKeyLeftOf";
644
+ if (this.layoutDelegate[layoutDelegateMethod]) {
645
+ key = this.layoutDelegate[layoutDelegateMethod](key);
646
+ return this.findNextNonDisabled(key, (key2) => this.layoutDelegate[layoutDelegateMethod](key2), options?.includeDisabled);
647
+ }
648
+ if (this.layout === "grid") {
649
+ if (this.orientation === "vertical") return this.getNextColumn(key, this.direction === "rtl", options);
650
+ else return this.findKey(key, (key2) => this.getNextColumn(key2, this.direction === "rtl", options), this.isSameColumn);
651
+ } else if (this.orientation === "horizontal") return this.getNextColumn(key, this.direction === "rtl", options);
652
+ return null;
3017
653
  }
3018
- isLink(key) {
3019
- return !!this.collection.getItem(key)?.props?.href;
654
+ getKeyLeftOf(key, options) {
655
+ let layoutDelegateMethod = this.direction === "ltr" ? "getKeyLeftOf" : "getKeyRightOf";
656
+ if (this.layoutDelegate[layoutDelegateMethod]) {
657
+ key = this.layoutDelegate[layoutDelegateMethod](key);
658
+ return this.findNextNonDisabled(key, (key2) => this.layoutDelegate[layoutDelegateMethod](key2), options?.includeDisabled);
659
+ }
660
+ if (this.layout === "grid") {
661
+ if (this.orientation === "vertical") return this.getNextColumn(key, this.direction === "ltr", options);
662
+ else return this.findKey(key, (key2) => this.getNextColumn(key2, this.direction === "ltr", options), this.isSameColumn);
663
+ } else if (this.orientation === "horizontal") return this.getNextColumn(key, this.direction === "ltr", options);
664
+ return null;
3020
665
  }
3021
- getItemProps(key) {
3022
- return this.collection.getItem(key)?.props;
666
+ getFirstKey() {
667
+ let key = this.collection.getFirstKey();
668
+ return this.findNextNonDisabled(key, (key2) => this.collection.getKeyAfter(key2));
3023
669
  }
3024
- withCollection(collection) {
3025
- return new $4a07ac835f260f78$export$6c8a5aaad13c9852(collection, this.state, {
3026
- allowsCellSelection: this.allowsCellSelection,
3027
- layoutDelegate: this.layoutDelegate || void 0,
3028
- fullCollection: this.fullCollection ?? this.collection
3029
- });
670
+ getLastKey() {
671
+ let key = this.collection.getLastKey();
672
+ return this.findNextNonDisabled(key, (key2) => this.collection.getKeyBefore(key2));
3030
673
  }
3031
- }
3032
- class $bda7a7e55e1ff206$export$bf788dd355e3a401 {
3033
- build(props, context) {
3034
- this.context = context;
3035
- return $bda7a7e55e1ff206$var$iterable(() => this.iterateCollection(props));
3036
- }
3037
- *iterateCollection(props) {
3038
- let { children, items } = props;
3039
- if (React__default.isValidElement(children) && children.type === React__default.Fragment) yield* this.iterateCollection({
3040
- children: children.props.children,
3041
- items
3042
- });
3043
- else if (typeof children === "function") {
3044
- if (!items) throw new Error("props.children was a function but props.items is missing");
3045
- let index = 0;
3046
- for (let item of items) {
3047
- yield* this.getFullNode({
3048
- value: item,
3049
- index
3050
- }, {
3051
- renderer: children
3052
- });
3053
- index++;
674
+ getKeyPageAbove(key) {
675
+ let menu = this.ref.current;
676
+ let itemRect = this.layoutDelegate.getItemRect(key);
677
+ if (!itemRect) return null;
678
+ let reversed = this.isReversed(key);
679
+ if (menu && !$901761b40e390936$export$2bb74740c4e19def(menu)) return this.getFirstKey();
680
+ let nextKey = key;
681
+ if (this.orientation === "horizontal") {
682
+ let pageX = Math.max(0, itemRect.x + itemRect.width - this.layoutDelegate.getVisibleRect().width);
683
+ while (itemRect && itemRect.x > pageX && nextKey != null) {
684
+ nextKey = this.getKeyAbove(nextKey);
685
+ itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);
3054
686
  }
3055
687
  } else {
3056
- let items2 = [];
3057
- React__default.Children.forEach(children, (child) => {
3058
- if (child) items2.push(child);
3059
- });
3060
- let index = 0;
3061
- for (let item of items2) {
3062
- let nodes = this.getFullNode({
3063
- element: item,
3064
- index
3065
- }, {});
3066
- for (let node of nodes) {
3067
- index++;
3068
- yield node;
3069
- }
688
+ let visibleRect = this.layoutDelegate.getVisibleRect();
689
+ let pageY = reversed ? itemRect.y - visibleRect.height : Math.max(0, itemRect.y + itemRect.height - visibleRect.height);
690
+ while (itemRect && itemRect.y > pageY && nextKey != null) {
691
+ nextKey = this.getKeyAbove(nextKey);
692
+ itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);
3070
693
  }
3071
694
  }
695
+ return nextKey ?? (reversed ? this.getLastKey() : this.getFirstKey());
3072
696
  }
3073
- getKey(item, partialNode, state, parentKey) {
3074
- if (item.key != null) return item.key;
3075
- if (partialNode.type === "cell" && partialNode.key != null) return `${parentKey}${partialNode.key}`;
3076
- let v = partialNode.value;
3077
- if (v != null) {
3078
- let key = v.key ?? v.id;
3079
- if (key == null) throw new Error("No key found for item");
3080
- return key;
3081
- }
3082
- return parentKey ? `${parentKey}.${partialNode.index}` : `$.${partialNode.index}`;
3083
- }
3084
- getChildState(state, partialNode) {
3085
- return {
3086
- renderer: partialNode.renderer || state.renderer
3087
- };
3088
- }
3089
- *getFullNode(partialNode, state, parentKey, parentNode) {
3090
- if (React__default.isValidElement(partialNode.element) && partialNode.element.type === React__default.Fragment) {
3091
- let children = [];
3092
- React__default.Children.forEach(partialNode.element.props.children, (child) => {
3093
- children.push(child);
3094
- });
3095
- let index = partialNode.index ?? 0;
3096
- for (const child of children) yield* this.getFullNode({
3097
- element: child,
3098
- index: index++
3099
- }, state, parentKey, parentNode);
3100
- return;
3101
- }
3102
- let element = partialNode.element;
3103
- if (!element && partialNode.value && state && state.renderer) {
3104
- let cached = this.cache.get(partialNode.value);
3105
- if (cached && (!cached.shouldInvalidate || !cached.shouldInvalidate(this.context))) {
3106
- cached.index = partialNode.index;
3107
- cached.parentKey = parentNode ? parentNode.key : null;
3108
- yield cached;
3109
- return;
3110
- }
3111
- element = state.renderer(partialNode.value);
3112
- }
3113
- if (React__default.isValidElement(element)) {
3114
- let type = element.type;
3115
- if (typeof type !== "function" && typeof type.getCollectionNode !== "function") {
3116
- let name = element.type;
3117
- throw new Error(`Unknown element <${name}> in collection.`);
697
+ getKeyPageBelow(key) {
698
+ let menu = this.ref.current;
699
+ let itemRect = this.layoutDelegate.getItemRect(key);
700
+ if (!itemRect) return null;
701
+ let reversed = this.isReversed(key);
702
+ if (menu && !$901761b40e390936$export$2bb74740c4e19def(menu)) return this.getLastKey();
703
+ let nextKey = key;
704
+ if (this.orientation === "horizontal") {
705
+ let pageX = Math.min(this.layoutDelegate.getContentSize().width, itemRect.x - itemRect.width + this.layoutDelegate.getVisibleRect().width);
706
+ while (itemRect && itemRect.x < pageX && nextKey != null) {
707
+ nextKey = this.getKeyBelow(nextKey);
708
+ itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);
3118
709
  }
3119
- let childNodes = type.getCollectionNode(element.props, this.context);
3120
- let index = partialNode.index ?? 0;
3121
- let result = childNodes.next();
3122
- while (!result.done && result.value) {
3123
- let childNode = result.value;
3124
- partialNode.index = index;
3125
- let nodeKey = childNode.key ?? null;
3126
- if (nodeKey == null) nodeKey = childNode.element ? null : this.getKey(element, partialNode, state, parentKey);
3127
- let nodes = this.getFullNode({
3128
- ...childNode,
3129
- key: nodeKey,
3130
- index,
3131
- wrapper: $bda7a7e55e1ff206$var$compose(partialNode.wrapper, childNode.wrapper)
3132
- }, this.getChildState(state, childNode), parentKey ? `${parentKey}${element.key}` : element.key, parentNode);
3133
- let children = [
3134
- ...nodes
3135
- ];
3136
- for (let node2 of children) {
3137
- node2.value = childNode.value ?? partialNode.value ?? null;
3138
- if (node2.value) this.cache.set(node2.value, node2);
3139
- if (partialNode.type && node2.type !== partialNode.type) throw new Error(`Unsupported type <${$bda7a7e55e1ff206$var$capitalize(node2.type)}> in <${$bda7a7e55e1ff206$var$capitalize(parentNode?.type ?? "unknown parent type")}>. Only <${$bda7a7e55e1ff206$var$capitalize(partialNode.type)}> is supported.`);
3140
- index++;
3141
- yield node2;
3142
- }
3143
- result = childNodes.next(children);
710
+ } else {
711
+ let pageY = Math.min(this.layoutDelegate.getContentSize().height, itemRect.y - itemRect.height + this.layoutDelegate.getVisibleRect().height);
712
+ while (itemRect && itemRect.y < pageY && nextKey != null) {
713
+ nextKey = this.getKeyBelow(nextKey);
714
+ itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);
3144
715
  }
3145
- return;
3146
716
  }
3147
- if (partialNode.key == null || partialNode.type == null) return;
3148
- let builder = this;
3149
- let node = {
3150
- type: partialNode.type,
3151
- props: partialNode.props,
3152
- key: partialNode.key,
3153
- parentKey: parentNode ? parentNode.key : null,
3154
- value: partialNode.value ?? null,
3155
- level: (parentNode?.level ?? 0) + (parentNode?.type === "item" ? 1 : 0),
3156
- index: partialNode.index,
3157
- rendered: partialNode.rendered,
3158
- textValue: partialNode.textValue ?? "",
3159
- "aria-label": partialNode["aria-label"],
3160
- wrapper: partialNode.wrapper,
3161
- shouldInvalidate: partialNode.shouldInvalidate,
3162
- hasChildNodes: partialNode.hasChildNodes || false,
3163
- childNodes: $bda7a7e55e1ff206$var$iterable(function* () {
3164
- if (!partialNode.hasChildNodes || !partialNode.childNodes) return;
3165
- let index = 0;
3166
- for (let child of partialNode.childNodes()) {
3167
- if (child.key != null)
3168
- child.key = `${node.key}${child.key}`;
3169
- let nodes = builder.getFullNode({
3170
- ...child,
3171
- index
3172
- }, builder.getChildState(state, child), node.key, node);
3173
- for (let node2 of nodes) {
3174
- index++;
3175
- yield node2;
3176
- }
3177
- }
3178
- })
3179
- };
3180
- yield node;
3181
- }
3182
- constructor() {
3183
- this.cache = /* @__PURE__ */ new WeakMap();
717
+ return nextKey ?? (reversed ? this.getFirstKey() : this.getLastKey());
3184
718
  }
3185
- }
3186
- function $bda7a7e55e1ff206$var$iterable(iterator) {
3187
- let cache = [];
3188
- let iterable = null;
3189
- return {
3190
- *[Symbol.iterator]() {
3191
- for (let item of cache) yield item;
3192
- if (!iterable) iterable = iterator();
3193
- for (let item of iterable) {
3194
- cache.push(item);
3195
- yield item;
3196
- }
719
+ getKeyForSearch(search, fromKey) {
720
+ if (!this.collator) return null;
721
+ let collection = this.collection;
722
+ let key = fromKey || this.getFirstKey();
723
+ while (key != null) {
724
+ let item = collection.getItem(key);
725
+ if (!item) return null;
726
+ let substring = item.textValue.slice(0, search.length);
727
+ if (item.textValue && this.collator.compare(substring, search) === 0) return key;
728
+ key = this.getNextKey(key);
3197
729
  }
3198
- };
3199
- }
3200
- function $bda7a7e55e1ff206$var$compose(outer, inner) {
3201
- if (outer && inner) return (element) => outer(inner(element));
3202
- if (outer) return outer;
3203
- if (inner) return inner;
3204
- }
3205
- function $bda7a7e55e1ff206$var$capitalize(str) {
3206
- return str[0].toUpperCase() + str.slice(1);
730
+ return null;
731
+ }
3207
732
  }
3208
- function $d03379b88399b8c5$export$6cd28814d92fa9c9(props, factory, context) {
3209
- let builder = useMemo(() => new $bda7a7e55e1ff206$export$bf788dd355e3a401(), []);
3210
- let { children, items, collection } = props;
3211
- let result = useMemo(() => {
3212
- if (collection) return collection;
3213
- let nodes = builder.build({
3214
- children,
3215
- items
3216
- }, context);
3217
- return factory(nodes);
3218
- }, [
3219
- builder,
3220
- children,
3221
- items,
3222
- collection,
3223
- context,
3224
- factory
3225
- ]);
3226
- return result;
733
+ let $673d46fce3e5717d$var$cache = /* @__PURE__ */ new Map();
734
+ function $673d46fce3e5717d$export$a16aca283550c30d(options) {
735
+ let { locale } = $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7();
736
+ let cacheKey = locale + (options ? Object.entries(options).sort((a, b) => a[0] < b[0] ? -1 : 1).join() : "");
737
+ if ($673d46fce3e5717d$var$cache.has(cacheKey)) return $673d46fce3e5717d$var$cache.get(cacheKey);
738
+ let formatter = new Intl.Collator(locale, options);
739
+ $673d46fce3e5717d$var$cache.set(cacheKey, formatter);
740
+ return formatter;
3227
741
  }
3228
742
  function $0407362eaf54473e$export$ccaea96c28e8b9e7(props, ref) {
3229
743
  let { collection, onLoadMore, scrollOffset = 1, direction = "end" } = props;
@@ -3838,37 +1352,6 @@ function $2b2556a8276954c1$var$diffSelection(a, b) {
3838
1352
  for (let key of a.keys()) if (!b.has(key)) res.add(key);
3839
1353
  return res;
3840
1354
  }
3841
- function $bf14c9739fda2eb3$export$eac1895992b9f3d6(ref, options) {
3842
- let isDisabled = options?.isDisabled;
3843
- let [hasTabbableChild, setHasTabbableChild] = useState(false);
3844
- $c4867b2f328c2698$export$e5c5a5f917a5871c(() => {
3845
- if (ref?.current && !isDisabled) {
3846
- let update = () => {
3847
- if (ref.current) {
3848
- let walker = $535772f9d2c1f38d$export$2d6ec8fc375ceafa(ref.current, {
3849
- tabbable: true
3850
- });
3851
- setHasTabbableChild(!!walker.nextNode());
3852
- }
3853
- };
3854
- update();
3855
- let observer = new MutationObserver(update);
3856
- observer.observe(ref.current, {
3857
- subtree: true,
3858
- childList: true,
3859
- attributes: true,
3860
- attributeFilter: [
3861
- "tabIndex",
3862
- "disabled"
3863
- ]
3864
- });
3865
- return () => {
3866
- observer.disconnect();
3867
- };
3868
- }
3869
- });
3870
- return isDisabled ? false : hasTabbableChild;
3871
- }
3872
1355
  function $parcel$interopDefault$7(a) {
3873
1356
  return a && a.__esModule ? a.default : a;
3874
1357
  }