@povio/ui 3.4.0-rc.44 → 3.4.0-rc.45

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 (234) hide show
  1. package/dist/{Accordion-DonRhvvW.d.ts → Accordion-UtY7wEp-.d.ts} +2 -1
  2. package/dist/{ActionModal-CKS0t-n3.d.ts → ActionModal-CzM2hcr0.d.ts} +1 -1
  3. package/dist/{Autocomplete-CLcRRdiL.d.ts → Autocomplete-B9GmXJF4.d.ts} +3 -2
  4. package/dist/{Breadcrumbs-C46_H95J.d.ts → Breadcrumbs-BLBMJpe1.d.ts} +3 -2
  5. package/dist/{Button-D0M9lMOR.d.ts → Button-DZZporg_.d.ts} +3 -3
  6. package/dist/{Checkbox-DC_1l0o7.d.ts → Checkbox-JJwUwUxc.d.ts} +1 -1
  7. package/dist/{CheckboxGroup-DnWeRs5l.d.ts → CheckboxGroup-Cw-SKIqN.d.ts} +2 -2
  8. package/dist/{DatePicker-KFZRDJfS.d.ts → DatePicker-DAd7ncHf.d.ts} +3 -3
  9. package/dist/{DatePickerInput-B7yVoI9Y.d.ts → DatePickerInput-CusTFCKQ.d.ts} +3 -3
  10. package/dist/{DateRangePicker-DcZ1l894.d.ts → DateRangePicker-CMbIzR3m.d.ts} +4 -4
  11. package/dist/{DateTimePicker-DWlstLhf.d.ts → DateTimePicker-Dc6_5X1V.d.ts} +4 -4
  12. package/dist/{FileUpload-Czof_aOb.d.ts → FileUpload-B7gn4UwN.d.ts} +1 -1
  13. package/dist/{FileUploadContainer--YlhZO19.d.ts → FileUploadContainer-C4PRM8Io.d.ts} +1 -1
  14. package/dist/{Form-Cnm0yRXZ.d.ts → Form-CQRpe7ZJ.d.ts} +1 -1
  15. package/dist/{FormField-Iy2O8A4g.d.ts → FormField-BuKYUy28.d.ts} +1 -1
  16. package/dist/{IconButton-CUpL6CsP.d.ts → IconButton-Drlnq7ik.d.ts} +2 -2
  17. package/dist/{InlineIconButton-AQ8SViM3.d.ts → InlineIconButton-C7_CmWFj.d.ts} +3 -3
  18. package/dist/{InputContent-jcMfOzpN.d.ts → InputContent-DguS6x2Q.d.ts} +2 -2
  19. package/dist/{InputUpload-D-C-886F.d.ts → InputUpload-BZqamXus.d.ts} +2 -2
  20. package/dist/{Inputs-Cm1abCeb.d.ts → Inputs-NL0LZbhc.d.ts} +1 -1
  21. package/dist/{Link-CKi4C00S.d.ts → Link-D85-7S3h.d.ts} +1 -1
  22. package/dist/{Menu-BHpiqpJ9.d.ts → Menu-DzTYbIHz.d.ts} +2 -2
  23. package/dist/{MenuItem-DLKC94Qs.d.ts → MenuItem-DVFyNRhi.d.ts} +1 -1
  24. package/dist/{Modal-BfN_MfR-.d.ts → Modal-4GP9tQLf.d.ts} +1 -1
  25. package/dist/{NumberInput-BIRmzsPb.d.ts → NumberInput-DjuZmkzv.d.ts} +3 -3
  26. package/dist/{NumberRangeInput-1ic7kLIS.d.ts → NumberRangeInput-DKVN5j9j.d.ts} +2 -2
  27. package/dist/{Pagination-uuqyFAu_.d.ts → Pagination-fLbLp_Ro.d.ts} +1 -1
  28. package/dist/{PaginationList-CmZBILfU.d.ts → PaginationList-DKYcaO7E.d.ts} +1 -1
  29. package/dist/{PasswordInput-DNUEWDEM.d.ts → PasswordInput-TIBbZOFu.d.ts} +1 -1
  30. package/dist/{Pill-vCBJdOTY.d.ts → Pill-BuC3w3xn.d.ts} +1 -1
  31. package/dist/{PillButton-CEF431l4.d.ts → PillButton-JjV_kJ6L.d.ts} +1 -1
  32. package/dist/{QuerySelect-vWifN5XC.d.ts → QuerySelect--pihqb-N.d.ts} +4 -3
  33. package/dist/{RadioGroup-Dd7xBSCW.d.ts → RadioGroup-Bp77H9AM.d.ts} +2 -2
  34. package/dist/{ResponsivePopover-BmURECUv.d.ts → ResponsivePopover-C76oaVmY.d.ts} +1 -1
  35. package/dist/{Segment-BZdZb436.d.ts → Segment-AtakFKus.d.ts} +3 -2
  36. package/dist/{Select-Bm2C6tHz.d.ts → Select-ChzbiDjh.d.ts} +3 -2
  37. package/dist/{SelectBase-DD8_4B-r.d.ts → SelectBase-DKJuFnvX.d.ts} +3 -3
  38. package/dist/{Slider-C6UeThGK.d.ts → Slider-BmoZiiSt.d.ts} +2 -2
  39. package/dist/{SplitButton-CR4psHKW.d.ts → SplitButton-BEYV4IPB.d.ts} +3 -3
  40. package/dist/{Tag-DUvBTljf.d.ts → Tag-BfmQ9BIV.d.ts} +1 -1
  41. package/dist/{TextArea-B8Yvkkxr.d.ts → TextArea-CbZ9kNwo.d.ts} +2 -2
  42. package/dist/{TextButton-cigitfeH.d.ts → TextButton-BZxhaNnh.d.ts} +3 -3
  43. package/dist/{TextEditor-DILzgUAj.d.ts → TextEditor-KzRofqtx.d.ts} +1 -1
  44. package/dist/{TextInput-Df0Pkuk-.d.ts → TextInput-ChVYCxjg.d.ts} +3 -3
  45. package/dist/{TimePicker-BcAaXiku.d.ts → TimePicker-CMhURRER.d.ts} +2 -2
  46. package/dist/{Toggle-Ca_t66zh.d.ts → Toggle-pQ0-MbwL.d.ts} +1 -1
  47. package/dist/{ToggleButton-3lINwoaV.d.ts → ToggleButton-DRTGhnjR.d.ts} +2 -2
  48. package/dist/{Tooltip-D1oFPqFF.d.ts → Tooltip-BxixKjWm.d.ts} +1 -1
  49. package/dist/{autocomplete-CIDaulwN.d.ts → autocomplete-BY74KiVw.d.ts} +4 -3
  50. package/dist/button-COs7mrbm.d.ts +1 -0
  51. package/dist/{checkbox-4smu5B-h.d.ts → checkbox-DLczwKKs.d.ts} +1 -1
  52. package/dist/{checkbox-group-C55R3YH5.d.ts → checkbox-group-DT7hMwsc.d.ts} +1 -1
  53. package/dist/components/accordion.d.ts +1 -1
  54. package/dist/components/action-modal.d.ts +1 -1
  55. package/dist/components/autocomplete/react-aria.js +1 -1
  56. package/dist/components/autocomplete.d.ts +1 -1
  57. package/dist/components/breadcrumb/react-aria.js +1 -1
  58. package/dist/components/breadcrumbs/react-aria.js +1 -1
  59. package/dist/components/breadcrumbs.d.ts +1 -1
  60. package/dist/components/button.d.ts +1 -1
  61. package/dist/components/cell/react-aria.js +1 -1
  62. package/dist/components/checkbox-group.d.ts +1 -1
  63. package/dist/components/checkbox.d.ts +1 -1
  64. package/dist/components/collection/react-aria.js +1 -1
  65. package/dist/components/color-swatch-picker/react-aria.js +1 -1
  66. package/dist/components/color-swatch-picker-item/react-aria.js +1 -1
  67. package/dist/components/column/react-aria.js +1 -1
  68. package/dist/components/column-resizer/react-aria.js +1 -1
  69. package/dist/components/combo-box/react-aria.js +1 -1
  70. package/dist/components/date-picker.d.ts +1 -1
  71. package/dist/components/date-range-picker.d.ts +1 -1
  72. package/dist/components/date-time-picker.d.ts +1 -1
  73. package/dist/components/file-upload-container.d.ts +2 -2
  74. package/dist/components/file-upload.d.ts +2 -2
  75. package/dist/components/focusable/react-aria.js +1 -1
  76. package/dist/components/form-field.d.ts +1 -1
  77. package/dist/components/grid-list/react-aria.js +1 -1
  78. package/dist/components/grid-list-header/react-aria.js +1 -1
  79. package/dist/components/grid-list-item/react-aria.js +1 -1
  80. package/dist/components/grid-list-load-more-item/react-aria.js +1 -1
  81. package/dist/components/grid-list-section/react-aria.js +1 -1
  82. package/dist/components/header/react-aria.js +1 -1
  83. package/dist/components/i18n-provider/react-aria.js +1 -1
  84. package/dist/components/icon-button.d.ts +1 -1
  85. package/dist/components/inline-icon-button.d.ts +1 -1
  86. package/dist/components/input-upload.d.ts +1 -1
  87. package/dist/components/link.d.ts +1 -1
  88. package/dist/components/list-box/react-aria.js +1 -1
  89. package/dist/components/list-box-item/react-aria.js +1 -1
  90. package/dist/components/list-box-load-more-item/react-aria.js +1 -1
  91. package/dist/components/list-box-section/react-aria.js +1 -1
  92. package/dist/components/menu/react-aria.js +1 -1
  93. package/dist/components/menu-item/react-aria.js +1 -1
  94. package/dist/components/menu-section/react-aria.js +1 -1
  95. package/dist/components/menu.d.ts +2 -2
  96. package/dist/components/modal.d.ts +1 -1
  97. package/dist/components/number-input.d.ts +1 -1
  98. package/dist/components/number-range-input.d.ts +1 -1
  99. package/dist/components/pagination-list.d.ts +1 -1
  100. package/dist/components/pagination.d.ts +1 -1
  101. package/dist/components/password-input.d.ts +1 -1
  102. package/dist/components/pill-button.d.ts +1 -1
  103. package/dist/components/pill.d.ts +1 -1
  104. package/dist/components/pressable/react-aria.js +1 -1
  105. package/dist/components/query-autocomplete.d.ts +2 -2
  106. package/dist/components/query-select.d.ts +1 -1
  107. package/dist/components/radio-group.d.ts +1 -1
  108. package/dist/components/resizable-table-container/react-aria.js +1 -1
  109. package/dist/components/responsive-popover.d.ts +1 -1
  110. package/dist/components/router-provider/react-aria.js +1 -1
  111. package/dist/components/row/react-aria.js +1 -1
  112. package/dist/components/section/react-aria.js +1 -1
  113. package/dist/components/segment.d.ts +2 -2
  114. package/dist/components/select/react-aria.js +1 -1
  115. package/dist/components/select.d.ts +2 -2
  116. package/dist/components/separator/react-aria.js +1 -1
  117. package/dist/components/slider.d.ts +1 -1
  118. package/dist/components/split-button.d.ts +1 -1
  119. package/dist/components/ssr-provider/react-aria.js +1 -1
  120. package/dist/components/submenu-trigger/react-aria.js +1 -1
  121. package/dist/components/tab/react-aria.js +1 -1
  122. package/dist/components/tab-list/react-aria.js +1 -1
  123. package/dist/components/tab-panels/react-aria.js +1 -1
  124. package/dist/components/table/react-aria.js +1 -1
  125. package/dist/components/table-body/react-aria.js +1 -1
  126. package/dist/components/table-header/react-aria.js +1 -1
  127. package/dist/components/table-load-more-item/react-aria.js +1 -1
  128. package/dist/components/tabs/react-aria.js +1 -1
  129. package/dist/components/tag/react-aria.js +1 -1
  130. package/dist/components/tag-group/react-aria.js +1 -1
  131. package/dist/components/tag-list/react-aria.js +1 -1
  132. package/dist/components/tag.d.ts +1 -1
  133. package/dist/components/text-area.d.ts +1 -1
  134. package/dist/components/text-button.d.ts +1 -1
  135. package/dist/components/text-input.d.ts +1 -1
  136. package/dist/components/time-picker.d.ts +1 -1
  137. package/dist/components/toast/react-aria.js +1 -1
  138. package/dist/components/toast-content/react-aria.js +1 -1
  139. package/dist/components/toast-list/react-aria.js +1 -1
  140. package/dist/components/toast-region/react-aria.js +1 -1
  141. package/dist/components/toggle-button.d.ts +1 -1
  142. package/dist/components/toggle.d.ts +1 -1
  143. package/dist/components/toolbar/react-aria.js +1 -1
  144. package/dist/components/tooltip.d.ts +1 -1
  145. package/dist/components/tree/react-aria.js +1 -1
  146. package/dist/components/tree-item/react-aria.js +1 -1
  147. package/dist/components/tree-item-content/react-aria.js +1 -1
  148. package/dist/components/tree-load-more-item/react-aria.js +1 -1
  149. package/dist/components/virtualizer/react-aria.js +1 -1
  150. package/dist/components/visually-hidden/react-aria.js +1 -1
  151. package/dist/config/confirmation.d.ts +1 -1
  152. package/dist/config/link-context.d.ts +2 -2
  153. package/dist/config/ui-config.d.ts +1 -1
  154. package/dist/{confirmation.context-D_kJeU8m.d.ts → confirmation.context-CuufQTQR.d.ts} +1 -1
  155. package/dist/{date-picker-D2W1Bor7.d.ts → date-picker-CuNJV9nJ.d.ts} +1 -1
  156. package/dist/{date-range-picker-Cm0OPO-n.d.ts → date-range-picker-CJOhtloN.d.ts} +1 -1
  157. package/dist/{date-time-picker-QcvD8deo.d.ts → date-time-picker-MIDzdeQN.d.ts} +1 -1
  158. package/dist/{dynamicInputs-DhCSXGpC.d.ts → dynamicInputs-2kB0x8BT.d.ts} +70 -70
  159. package/dist/{file-upload-Ba6NwH0N.d.ts → file-upload-C0kwtd3Z.d.ts} +2 -2
  160. package/dist/{fileUpload.types-ZUblxJUi.d.ts → fileUpload.types-DFg9wCbc.d.ts} +3 -3
  161. package/dist/{index-DCUSluLL.d.ts → index-CXUySbXH.d.ts} +110 -1
  162. package/dist/index.d.ts +66 -66
  163. package/dist/{input-upload-BxRgcRt4.d.ts → input-upload-CFcsHAOE.d.ts} +1 -1
  164. package/dist/{link.context-C1RcdC0i.d.ts → link.context-BUxUXeo6.d.ts} +1 -1
  165. package/dist/{number-input-BoUfnoR2.d.ts → number-input-DhLfHuVP.d.ts} +1 -1
  166. package/dist/{number-range-input-BkHzkO1m.d.ts → number-range-input-CLsMdwqJ.d.ts} +1 -1
  167. package/dist/{password-input-BPAjcIly.d.ts → password-input--nSBPzos.d.ts} +1 -1
  168. package/dist/{query-autocomplete-Dh1Yeu4p.d.ts → query-autocomplete-vHRKodn0.d.ts} +2 -2
  169. package/dist/{query-select-7lNZcE_x.d.ts → query-select-CvoVhXu1.d.ts} +4 -3
  170. package/dist/{queryAutocomplete.types-D7SmWVq-.d.ts → queryAutocomplete.types-Cn4fe0OX.d.ts} +3 -3
  171. package/dist/{radio-group-DmilCTsI.d.ts → radio-group-rmH66jpI.d.ts} +1 -1
  172. package/dist/rhf/autocomplete.d.ts +2 -2
  173. package/dist/rhf/checkbox-group.d.ts +2 -2
  174. package/dist/rhf/checkbox.d.ts +2 -2
  175. package/dist/rhf/date-picker.d.ts +2 -2
  176. package/dist/rhf/date-range-picker.d.ts +2 -2
  177. package/dist/rhf/date-time-picker.d.ts +2 -2
  178. package/dist/rhf/file-upload.d.ts +2 -2
  179. package/dist/rhf/input-upload.d.ts +2 -2
  180. package/dist/rhf/inputs.d.ts +1 -1
  181. package/dist/rhf/number-input.d.ts +2 -2
  182. package/dist/rhf/number-range-input.d.ts +2 -2
  183. package/dist/rhf/password-input.d.ts +2 -2
  184. package/dist/rhf/query-autocomplete.d.ts +1 -1
  185. package/dist/rhf/query-select.d.ts +1 -1
  186. package/dist/rhf/radio-group.d.ts +2 -2
  187. package/dist/rhf/segment.d.ts +2 -2
  188. package/dist/rhf/select.d.ts +2 -2
  189. package/dist/rhf/slider.d.ts +2 -2
  190. package/dist/rhf/text-area.d.ts +2 -2
  191. package/dist/rhf/text-editor.d.ts +2 -2
  192. package/dist/rhf/text-input.d.ts +2 -2
  193. package/dist/rhf/time-picker.d.ts +2 -2
  194. package/dist/rhf/toggle.d.ts +2 -2
  195. package/dist/rhf.d.ts +66 -66
  196. package/dist/{segment-BOELlo1K.d.ts → segment-e0jd1JbP.d.ts} +3 -2
  197. package/dist/{segment.types-BYTmg69p.d.ts → segment.types-DUstTZeA.d.ts} +2 -1
  198. package/dist/{select-CD3fNAgK.d.ts → select-Bvt1d_ly.d.ts} +4 -3
  199. package/dist/{slider-tx1tub5d.d.ts → slider-CRnAZyb_.d.ts} +1 -1
  200. package/dist/tanstack/autocomplete.d.ts +1 -1
  201. package/dist/tanstack/checkbox-group.d.ts +1 -1
  202. package/dist/tanstack/checkbox.d.ts +1 -1
  203. package/dist/tanstack/date-picker.d.ts +1 -1
  204. package/dist/tanstack/date-range-picker.d.ts +1 -1
  205. package/dist/tanstack/date-time-picker.d.ts +1 -1
  206. package/dist/tanstack/file-upload.d.ts +2 -2
  207. package/dist/tanstack/form.d.ts +1 -1
  208. package/dist/tanstack/input-upload.d.ts +1 -1
  209. package/dist/tanstack/inputs.d.ts +2 -2
  210. package/dist/tanstack/number-input.d.ts +1 -1
  211. package/dist/tanstack/number-range-input.d.ts +1 -1
  212. package/dist/tanstack/password-input.d.ts +1 -1
  213. package/dist/tanstack/query-select.d.ts +1 -1
  214. package/dist/tanstack/radio-group.d.ts +1 -1
  215. package/dist/tanstack/segment.d.ts +2 -2
  216. package/dist/tanstack/select.d.ts +1 -1
  217. package/dist/tanstack/slider.d.ts +1 -1
  218. package/dist/tanstack/text-area.d.ts +1 -1
  219. package/dist/tanstack/text-editor.d.ts +1 -1
  220. package/dist/tanstack/text-input.d.ts +1 -1
  221. package/dist/tanstack/time-picker.d.ts +1 -1
  222. package/dist/tanstack/toggle.d.ts +1 -1
  223. package/dist/tanstack.d.ts +50 -50
  224. package/dist/{text-area-kb2PxyJb.d.ts → text-area-KsaEQpPz.d.ts} +1 -1
  225. package/dist/{text-editor-CDECpKqj.d.ts → text-editor-CYU0teJy.d.ts} +1 -1
  226. package/dist/text-editor.d.ts +1 -1
  227. package/dist/{text-input-VqRJ0y7Y.d.ts → text-input-dZeNDTtP.d.ts} +1 -1
  228. package/dist/{time-picker-CZLL-OEe.d.ts → time-picker-CcHlAJUk.d.ts} +1 -1
  229. package/dist/{toggle-DK5CDOtt.d.ts → toggle-BGOUUhAG.d.ts} +1 -1
  230. package/dist/{types-ZbFfCz06.d.ts → types-CaqW-yY5.d.ts} +20 -27
  231. package/dist/types-Dugk_Mie.d.ts +581 -0
  232. package/package.json +23 -1
  233. package/dist/button-BQmy1LZS.d.ts +0 -1
  234. package/dist/types-BT18i837.d.ts +0 -69
@@ -1 +1 @@
1
- import e,{createContext as t,forwardRef as n,useCallback as r,useContext as i,useMemo as a,useRef as o,useState as s,useSyncExternalStore as c}from"react";import{filterDOMProps as l,mergeProps as u,mergeRefs as d,useLayoutEffect as f,useObjectRef as p}from"@react-aria/utils";import"@react-aria/interactions";import"react-dom";import{mergeProps as m,useFocusRing as h}from"react-aria";import{useTabListState as g}from"react-stately";const _=Symbol(`default`);function v({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function y(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:o,defaultStyle:s,values:c,render:l}=e;return a(()=>{let e,a,u;return e=typeof t==`function`?t({...c,defaultClassName:i}):t,a=typeof n==`function`?n({...c,defaultStyle:s||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:o}):r??o,{className:e??i,style:a||s?{...s,...a}:void 0,children:u??o,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,i,o,s,c,l])}function b(e,t){let n=i(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||_;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:`A slot prop is required.`;throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function x(e,t,n){let{ref:r,...i}=b(n,e.slot)||{},o=p(a(()=>d(t,r),[t,r])),s=u(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(s.style=typeof i.style==`function`||typeof e.style==`function`?t=>{let n=typeof i.style==`function`?i.style(t):i.style,r={...t.defaultStyle,...n},a=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...a}}:{...i.style,...e.style}),[s,o]}function S(t,n,r){let{render:i,...s}=n,c=o(null),l=a(()=>d(r,c),[r,c]);f(()=>{},[t,i]);let u={...s,ref:l};return i?i(u,void 0):e.createElement(t,u)}const C={},w=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let r=C[t];return r||(r=n(S.bind(null,t)),C[t]=r),r}});String(Math.round(Math.random()*1e10));const T=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement,e.useId;function E(){return!1}function D(){return!0}function O(e){return()=>{}}function k(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore(O,E,D):i(T)}var A=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},j=class extends A{filter(e,t,n){let[r,i]=L(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},M=class extends A{};M.type=`header`;var N=class extends A{};N.type=`loader`;var P=class extends j{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};P.type=`item`;var F=class extends j{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};F.type=`section`;var I=class{get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}*[Symbol.iterator](){let e=this.firstKey==null?void 0:this.keyMap.get(this.firstKey);for(;e;)yield e,e=e.nextKey==null?void 0:this.keyMap.get(e.nextKey)}getChildren(e){let t=this.keyMap;return{*[Symbol.iterator](){let n=t.get(e),r=n?.firstChildKey==null?null:t.get(n.firstChildKey);for(;r;)yield r,r=r.nextKey==null?void 0:t.get(r.nextKey)}}}getKeyBefore(e){let t=this.keyMap.get(e);if(!t)return null;if(t.prevKey!=null){for(t=this.keyMap.get(t.prevKey);t&&t.type!==`item`&&t.lastChildKey!=null;)t=this.keyMap.get(t.lastChildKey);return t?.key??null}return t.parentKey}getKeyAfter(e){let t=this.keyMap.get(e);if(!t)return null;if(t.type!==`item`&&t.firstChildKey!=null)return t.firstChildKey;for(;t;){if(t.nextKey!=null)return t.nextKey;if(t.parentKey!=null)t=this.keyMap.get(t.parentKey);else return null}return null}getFirstKey(){return this.firstKey}getLastKey(){let e=this.lastKey==null?null:this.keyMap.get(this.lastKey);for(;e?.lastChildKey!=null;)e=this.keyMap.get(e.lastChildKey);return e?.key??null}getItem(e){return this.keyMap.get(e)??null}at(){throw Error(`Not implemented`)}clone(){let e=this.constructor,t=new e;return t.keyMap=new Map(this.keyMap),t.firstKey=this.firstKey,t.lastKey=this.lastKey,t.itemCount=this.itemCount,t}addNode(e){if(this.frozen)throw Error(`Cannot add a node to a frozen collection`);e.type===`item`&&this.keyMap.get(e.key)==null&&this.itemCount++,this.keyMap.set(e.key,e)}addDescendants(e,t){this.addNode(e);let n=t.getChildren(e.key);for(let e of n)this.addDescendants(e,t)}removeNode(e){if(this.frozen)throw Error(`Cannot remove a node to a frozen collection`);let t=this.keyMap.get(e);t!=null&&t.type===`item`&&this.itemCount--,this.keyMap.delete(e)}commit(e,t,n=!1){if(this.frozen)throw Error(`Cannot commit a frozen collection`);this.firstKey=e,this.lastKey=t,this.frozen=!n}filter(e){let t=new this.constructor,[n,r]=L(this,t,this.firstKey,e);return t?.commit(n,r),t}constructor(){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.frozen=!1,this.itemCount=0}};function L(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}var R=class{*[Symbol.iterator](){let e=this.firstChild;for(;e;)yield e,e=e.nextSibling}get firstChild(){return this._firstChild}set firstChild(e){this._firstChild=e,this.ownerDocument.markDirty(this)}get lastChild(){return this._lastChild}set lastChild(e){this._lastChild=e,this.ownerDocument.markDirty(this)}get previousSibling(){return this._previousSibling}set previousSibling(e){this._previousSibling=e,this.ownerDocument.markDirty(this)}get nextSibling(){return this._nextSibling}set nextSibling(e){this._nextSibling=e,this.ownerDocument.markDirty(this)}get parentNode(){return this._parentNode}set parentNode(e){this._parentNode=e,this.ownerDocument.markDirty(this)}get isConnected(){return this.parentNode?.isConnected||!1}invalidateChildIndices(e){(this._minInvalidChildIndex==null||!this._minInvalidChildIndex.isConnected||e.index<this._minInvalidChildIndex.index)&&(this._minInvalidChildIndex=e,this.ownerDocument.markDirty(this))}updateChildIndices(){let e=this._minInvalidChildIndex;for(;e;)e.index=e.previousSibling?e.previousSibling.index+1:0,e=e.nextSibling;this._minInvalidChildIndex=null}appendChild(e){e.parentNode&&e.parentNode.removeChild(e),this.firstChild??=e,this.lastChild?(this.lastChild.nextSibling=e,e.index=this.lastChild.index+1,e.previousSibling=this.lastChild):(e.previousSibling=null,e.index=0),e.parentNode=this,e.nextSibling=null,this.lastChild=e,this.ownerDocument.markDirty(this),this.isConnected&&this.ownerDocument.queueUpdate()}insertBefore(e,t){if(t==null)return this.appendChild(e);e.parentNode&&e.parentNode.removeChild(e),e.nextSibling=t,e.previousSibling=t.previousSibling,e.index=t.index-1,this.firstChild===t?this.firstChild=e:t.previousSibling&&(t.previousSibling.nextSibling=e),t.previousSibling=e,e.parentNode=t.parentNode,this.invalidateChildIndices(e),this.isConnected&&this.ownerDocument.queueUpdate()}removeChild(e){e.parentNode===this&&(this._minInvalidChildIndex===e&&(this._minInvalidChildIndex=null),e.nextSibling&&(this.invalidateChildIndices(e.nextSibling),e.nextSibling.previousSibling=e.previousSibling),e.previousSibling&&(e.previousSibling.nextSibling=e.nextSibling),this.firstChild===e&&(this.firstChild=e.nextSibling),this.lastChild===e&&(this.lastChild=e.previousSibling),e.parentNode=null,e.nextSibling=null,e.previousSibling=null,e.index=0,this.ownerDocument.markDirty(e),this.isConnected&&this.ownerDocument.queueUpdate())}addEventListener(){}removeEventListener(){}get previousVisibleSibling(){let e=this.previousSibling;for(;e&&e.isHidden;)e=e.previousSibling;return e}get nextVisibleSibling(){let e=this.nextSibling;for(;e&&e.isHidden;)e=e.nextSibling;return e}get firstVisibleChild(){let e=this.firstChild;for(;e&&e.isHidden;)e=e.nextSibling;return e}get lastVisibleChild(){let e=this.lastChild;for(;e&&e.isHidden;)e=e.previousSibling;return e}constructor(e){this._firstChild=null,this._lastChild=null,this._previousSibling=null,this._nextSibling=null,this._parentNode=null,this._minInvalidChildIndex=null,this.ownerDocument=e}},z=class e extends R{get index(){return this._index}set index(e){this._index=e,this.ownerDocument.markDirty(this)}get level(){return this.parentNode instanceof e?this.parentNode.level+ +(this.node?.type===`item`):0}getMutableNode(){return this.node==null?null:(this.isMutated||=(this.node=this.node.clone(),!0),this.ownerDocument.markDirty(this),this.node)}updateNode(){let t=this.nextVisibleSibling,n=this.getMutableNode();if(n!=null&&(n.index=this.index,n.level=this.level,n.parentKey=this.parentNode instanceof e?this.parentNode.node?.key??null:null,n.prevKey=this.previousVisibleSibling?.node?.key??null,n.nextKey=t?.node?.key??null,n.hasChildNodes=!!this.firstChild,n.firstChildKey=this.firstVisibleChild?.node?.key??null,n.lastChildKey=this.lastVisibleChild?.node?.key??null,(n.colSpan!=null||n.colIndex!=null)&&t)){let e=(n.colIndex??n.index)+(n.colSpan??1);if(t.node!=null&&e!==t.node.colIndex){let n=t.getMutableNode();n.colIndex=e}}}setProps(e,t,n,r,i){let a,{value:o,textValue:s,id:c,...l}=e;if(this.node==null?(a=new n(c??`react-aria-${++this.ownerDocument.nodeId}`),this.node=a):a=this.getMutableNode(),l.ref=t,a.props=l,a.rendered=r,a.render=i,a.value=o,e[`aria-label`]&&(a[`aria-label`]=e[`aria-label`]),a.textValue=s||(typeof l.children==`string`?l.children:``)||e[`aria-label`]||``,c!=null&&c!==a.key)throw Error(`Cannot change the id of an item`);l.colSpan!=null&&(a.colSpan=l.colSpan),this.isConnected&&this.ownerDocument.queueUpdate()}get style(){let e=this;return{get display(){return e.isHidden?`none`:``},set display(t){let n=t===`none`;if(e.isHidden!==n){(e.parentNode?.firstVisibleChild===e||e.parentNode?.lastVisibleChild===e)&&e.ownerDocument.markDirty(e.parentNode);let t=e.previousVisibleSibling,r=e.nextVisibleSibling;t&&e.ownerDocument.markDirty(t),r&&e.ownerDocument.markDirty(r),e.isHidden=n,e.ownerDocument.markDirty(e)}}}}hasAttribute(){}setAttribute(){}setAttributeNS(){}removeAttribute(){}constructor(e,t){super(t),this.nodeType=8,this.isMutated=!0,this._index=0,this.isHidden=!1,this.node=null}},B=class extends R{get isConnected(){return!0}createElement(e){return new z(e,this)}getMutableCollection(){return this.nextCollection||=this.collection.clone(),this.nextCollection}markDirty(e){this.dirtyNodes.add(e)}addNode(e){if(e.isHidden||e.node==null)return;let t=this.getMutableCollection();if(!t.getItem(e.node.key))for(let t of e)this.addNode(t);t.addNode(e.node)}removeNode(e){for(let t of e)this.removeNode(t);e.node&&this.getMutableCollection().removeNode(e.node.key)}getCollection(){return this.inSubscription?this.collection.clone():(this.queuedRender=!1,this.updateCollection(),this.collection)}updateCollection(){for(let e of this.dirtyNodes)e instanceof z&&(!e.isConnected||e.isHidden)?this.removeNode(e):e.updateChildIndices();for(let e of this.dirtyNodes)e instanceof z?(e.isConnected&&!e.isHidden&&(e.updateNode(),this.addNode(e)),e.node&&this.dirtyNodes.delete(e),e.isMutated=!1):this.dirtyNodes.delete(e);this.nextCollection&&(this.nextCollection.commit(this.firstVisibleChild?.node?.key??null,this.lastVisibleChild?.node?.key??null,this.isSSR),this.isSSR||(this.collection=this.nextCollection,this.nextCollection=null))}queueUpdate(){if(!(this.dirtyNodes.size===0||this.queuedRender)){this.queuedRender=!0,this.inSubscription=!0;for(let e of this.subscriptions)e();this.inSubscription=!1}}subscribe(e){return this.subscriptions.add(e),()=>this.subscriptions.delete(e)}resetAfterSSR(){this.isSSR&&(this.isSSR=!1,this.firstChild=null,this.lastChild=null,this.nodeId=0)}constructor(e){super(null),this.nodeType=11,this.ownerDocument=this,this.dirtyNodes=new Set,this.isSSR=!1,this.nodeId=0,this.nodesByProps=new WeakMap,this.nextCollection=null,this.subscriptions=new Set,this.queuedRender=!1,this.inSubscription=!1,this.collection=e,this.nextCollection=e}};if(typeof HTMLTemplateElement<`u`){let e=Object.getOwnPropertyDescriptor(Node.prototype,`firstChild`).get;Object.defineProperty(HTMLTemplateElement.prototype,"firstChild",{configurable:!0,enumerable:!0,get:function(){return this.dataset.reactAriaHidden?this.content.firstChild:e.call(this)}})}const V=t(!1);function H(t){if(i(V))return e.createElement(e.Fragment,null,t.children);let n=e.createElement(V.Provider,{value:!0},t.children);return e.createElement(`template`,{"data-react-aria-hidden":!0},n)}const U=t(null);function W(t){if(i(U))return t.content;let{collection:n,document:r}=J(t.createCollection);return e.createElement(e.Fragment,null,e.createElement(H,null,e.createElement(U.Provider,{value:r},t.content)),e.createElement(G,{render:t.children,collection:n}))}function G({collection:e,render:t}){return t(e)}function K(e,t,n){let i=k(),a=o(i);a.current=i;let s=r(()=>a.current?n():t(),[t,n]);return c(e,s)}const q=typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore:K;function J(e){let[t]=s(()=>new B(e?.()||new I)),n=r(e=>t.subscribe(e),[t]),i=r(()=>{let e=t.getCollection();return t.isSSR&&t.resetAfterSSR(),e},[t]),a=r(()=>(t.isSSR=!0,t.getCollection()),[t]);return{collection:q(n,i,a),document:t}}const Y=t(null),X=t(null),Z=n(function(t,n){[t,n]=x(t,n,Y);let{children:r,orientation:i=`horizontal`}=t;return r=a(()=>typeof r==`function`?r({orientation:i,defaultChildren:null}):r,[r,i]),e.createElement(W,{content:r},r=>e.createElement(Q,{props:t,collection:r,tabsRef:n}))});function Q({props:t,tabsRef:n,collection:r}){let{orientation:i=`horizontal`}=t,o=g({...t,collection:r,children:void 0}),{focusProps:s,isFocused:c,isFocusVisible:u}=h({within:!0}),d=a(()=>({orientation:i,isFocusWithin:c,isFocusVisible:u}),[i,c,u]),f=y({...t,defaultClassName:`react-aria-Tabs`,values:d}),p=l(t,{global:!0});return e.createElement(w.div,{...m(p,f,s),ref:n,slot:t.slot||void 0,"data-focused":c||void 0,"data-orientation":i,"data-focus-visible":u||void 0,"data-disabled":o.isDisabled||void 0},e.createElement(v,{values:[[Y,t],[X,o]]},f.children))}var $=class extends A{};$.type=`item`;export{Z as Tabs};
1
+ import e,{createContext as t,forwardRef as n,useCallback as r,useContext as i,useMemo as a,useRef as o,useState as s,useSyncExternalStore as c}from"react";import{filterDOMProps as l,mergeProps as u,mergeRefs as d,useLayoutEffect as f,useObjectRef as p}from"@react-aria/utils";import"@react-aria/interactions";import"react-dom";import{mergeProps as m,useFocusRing as h}from"react-aria";import{useTabListState as g}from"react-stately";const _=Symbol(`default`);function v({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function y(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:o,defaultStyle:s,values:c,render:l}=e;return a(()=>{let e,a,u;return e=typeof t==`function`?t({...c,defaultClassName:i}):t,a=typeof n==`function`?n({...c,defaultStyle:s||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:o}):r??o,{className:e??i,style:a||s?{...s,...a}:void 0,children:u??o,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,i,o,s,c,l])}function b(e,t){let n=i(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||_;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:`A slot prop is required.`;throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function x(e,t,n){let{ref:r,...i}=b(n,e.slot)||{},o=p(a(()=>d(t,r),[t,r])),s=u(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(s.style=typeof i.style==`function`||typeof e.style==`function`?t=>{let n=typeof i.style==`function`?i.style(t):i.style,r={...t.defaultStyle,...n},a=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...a}}:{...i.style,...e.style}),[s,o]}function S(t,n,r){let{render:i,...s}=n,c=o(null),l=a(()=>d(r,c),[r,c]);f(()=>{},[t,i]);let u={...s,ref:l};return i?i(u,void 0):e.createElement(t,u)}const C={},w=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let r=C[t];return r||(r=n(S.bind(null,t)),C[t]=r),r}});var T=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},E=class extends T{filter(e,t,n){let[r,i]=M(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},D=class extends T{};D.type=`header`;var O=class extends T{};O.type=`loader`;var k=class extends E{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};k.type=`item`;var A=class extends E{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};A.type=`section`;var j=class{get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}*[Symbol.iterator](){let e=this.firstKey==null?void 0:this.keyMap.get(this.firstKey);for(;e;)yield e,e=e.nextKey==null?void 0:this.keyMap.get(e.nextKey)}getChildren(e){let t=this.keyMap;return{*[Symbol.iterator](){let n=t.get(e),r=n?.firstChildKey==null?null:t.get(n.firstChildKey);for(;r;)yield r,r=r.nextKey==null?void 0:t.get(r.nextKey)}}}getKeyBefore(e){let t=this.keyMap.get(e);if(!t)return null;if(t.prevKey!=null){for(t=this.keyMap.get(t.prevKey);t&&t.type!==`item`&&t.lastChildKey!=null;)t=this.keyMap.get(t.lastChildKey);return t?.key??null}return t.parentKey}getKeyAfter(e){let t=this.keyMap.get(e);if(!t)return null;if(t.type!==`item`&&t.firstChildKey!=null)return t.firstChildKey;for(;t;){if(t.nextKey!=null)return t.nextKey;if(t.parentKey!=null)t=this.keyMap.get(t.parentKey);else return null}return null}getFirstKey(){return this.firstKey}getLastKey(){let e=this.lastKey==null?null:this.keyMap.get(this.lastKey);for(;e?.lastChildKey!=null;)e=this.keyMap.get(e.lastChildKey);return e?.key??null}getItem(e){return this.keyMap.get(e)??null}at(){throw Error(`Not implemented`)}clone(){let e=this.constructor,t=new e;return t.keyMap=new Map(this.keyMap),t.firstKey=this.firstKey,t.lastKey=this.lastKey,t.itemCount=this.itemCount,t}addNode(e){if(this.frozen)throw Error(`Cannot add a node to a frozen collection`);e.type===`item`&&this.keyMap.get(e.key)==null&&this.itemCount++,this.keyMap.set(e.key,e)}addDescendants(e,t){this.addNode(e);let n=t.getChildren(e.key);for(let e of n)this.addDescendants(e,t)}removeNode(e){if(this.frozen)throw Error(`Cannot remove a node to a frozen collection`);let t=this.keyMap.get(e);t!=null&&t.type===`item`&&this.itemCount--,this.keyMap.delete(e)}commit(e,t,n=!1){if(this.frozen)throw Error(`Cannot commit a frozen collection`);this.firstKey=e,this.lastKey=t,this.frozen=!n}filter(e){let t=new this.constructor,[n,r]=M(this,t,this.firstKey,e);return t?.commit(n,r),t}constructor(){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.frozen=!1,this.itemCount=0}};function M(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}var N=class{*[Symbol.iterator](){let e=this.firstChild;for(;e;)yield e,e=e.nextSibling}get firstChild(){return this._firstChild}set firstChild(e){this._firstChild=e,this.ownerDocument.markDirty(this)}get lastChild(){return this._lastChild}set lastChild(e){this._lastChild=e,this.ownerDocument.markDirty(this)}get previousSibling(){return this._previousSibling}set previousSibling(e){this._previousSibling=e,this.ownerDocument.markDirty(this)}get nextSibling(){return this._nextSibling}set nextSibling(e){this._nextSibling=e,this.ownerDocument.markDirty(this)}get parentNode(){return this._parentNode}set parentNode(e){this._parentNode=e,this.ownerDocument.markDirty(this)}get isConnected(){return this.parentNode?.isConnected||!1}invalidateChildIndices(e){(this._minInvalidChildIndex==null||!this._minInvalidChildIndex.isConnected||e.index<this._minInvalidChildIndex.index)&&(this._minInvalidChildIndex=e,this.ownerDocument.markDirty(this))}updateChildIndices(){let e=this._minInvalidChildIndex;for(;e;)e.index=e.previousSibling?e.previousSibling.index+1:0,e=e.nextSibling;this._minInvalidChildIndex=null}appendChild(e){e.parentNode&&e.parentNode.removeChild(e),this.firstChild??=e,this.lastChild?(this.lastChild.nextSibling=e,e.index=this.lastChild.index+1,e.previousSibling=this.lastChild):(e.previousSibling=null,e.index=0),e.parentNode=this,e.nextSibling=null,this.lastChild=e,this.ownerDocument.markDirty(this),this.isConnected&&this.ownerDocument.queueUpdate()}insertBefore(e,t){if(t==null)return this.appendChild(e);e.parentNode&&e.parentNode.removeChild(e),e.nextSibling=t,e.previousSibling=t.previousSibling,e.index=t.index-1,this.firstChild===t?this.firstChild=e:t.previousSibling&&(t.previousSibling.nextSibling=e),t.previousSibling=e,e.parentNode=t.parentNode,this.invalidateChildIndices(e),this.isConnected&&this.ownerDocument.queueUpdate()}removeChild(e){e.parentNode===this&&(this._minInvalidChildIndex===e&&(this._minInvalidChildIndex=null),e.nextSibling&&(this.invalidateChildIndices(e.nextSibling),e.nextSibling.previousSibling=e.previousSibling),e.previousSibling&&(e.previousSibling.nextSibling=e.nextSibling),this.firstChild===e&&(this.firstChild=e.nextSibling),this.lastChild===e&&(this.lastChild=e.previousSibling),e.parentNode=null,e.nextSibling=null,e.previousSibling=null,e.index=0,this.ownerDocument.markDirty(e),this.isConnected&&this.ownerDocument.queueUpdate())}addEventListener(){}removeEventListener(){}get previousVisibleSibling(){let e=this.previousSibling;for(;e&&e.isHidden;)e=e.previousSibling;return e}get nextVisibleSibling(){let e=this.nextSibling;for(;e&&e.isHidden;)e=e.nextSibling;return e}get firstVisibleChild(){let e=this.firstChild;for(;e&&e.isHidden;)e=e.nextSibling;return e}get lastVisibleChild(){let e=this.lastChild;for(;e&&e.isHidden;)e=e.previousSibling;return e}constructor(e){this._firstChild=null,this._lastChild=null,this._previousSibling=null,this._nextSibling=null,this._parentNode=null,this._minInvalidChildIndex=null,this.ownerDocument=e}},P=class e extends N{get index(){return this._index}set index(e){this._index=e,this.ownerDocument.markDirty(this)}get level(){return this.parentNode instanceof e?this.parentNode.level+ +(this.node?.type===`item`):0}getMutableNode(){return this.node==null?null:(this.isMutated||=(this.node=this.node.clone(),!0),this.ownerDocument.markDirty(this),this.node)}updateNode(){let t=this.nextVisibleSibling,n=this.getMutableNode();if(n!=null&&(n.index=this.index,n.level=this.level,n.parentKey=this.parentNode instanceof e?this.parentNode.node?.key??null:null,n.prevKey=this.previousVisibleSibling?.node?.key??null,n.nextKey=t?.node?.key??null,n.hasChildNodes=!!this.firstChild,n.firstChildKey=this.firstVisibleChild?.node?.key??null,n.lastChildKey=this.lastVisibleChild?.node?.key??null,(n.colSpan!=null||n.colIndex!=null)&&t)){let e=(n.colIndex??n.index)+(n.colSpan??1);if(t.node!=null&&e!==t.node.colIndex){let n=t.getMutableNode();n.colIndex=e}}}setProps(e,t,n,r,i){let a,{value:o,textValue:s,id:c,...l}=e;if(this.node==null?(a=new n(c??`react-aria-${++this.ownerDocument.nodeId}`),this.node=a):a=this.getMutableNode(),l.ref=t,a.props=l,a.rendered=r,a.render=i,a.value=o,e[`aria-label`]&&(a[`aria-label`]=e[`aria-label`]),a.textValue=s||(typeof l.children==`string`?l.children:``)||e[`aria-label`]||``,c!=null&&c!==a.key)throw Error(`Cannot change the id of an item`);l.colSpan!=null&&(a.colSpan=l.colSpan),this.isConnected&&this.ownerDocument.queueUpdate()}get style(){let e=this;return{get display(){return e.isHidden?`none`:``},set display(t){let n=t===`none`;if(e.isHidden!==n){(e.parentNode?.firstVisibleChild===e||e.parentNode?.lastVisibleChild===e)&&e.ownerDocument.markDirty(e.parentNode);let t=e.previousVisibleSibling,r=e.nextVisibleSibling;t&&e.ownerDocument.markDirty(t),r&&e.ownerDocument.markDirty(r),e.isHidden=n,e.ownerDocument.markDirty(e)}}}}hasAttribute(){}setAttribute(){}setAttributeNS(){}removeAttribute(){}constructor(e,t){super(t),this.nodeType=8,this.isMutated=!0,this._index=0,this.isHidden=!1,this.node=null}},F=class extends N{get isConnected(){return!0}createElement(e){return new P(e,this)}getMutableCollection(){return this.nextCollection||=this.collection.clone(),this.nextCollection}markDirty(e){this.dirtyNodes.add(e)}addNode(e){if(e.isHidden||e.node==null)return;let t=this.getMutableCollection();if(!t.getItem(e.node.key))for(let t of e)this.addNode(t);t.addNode(e.node)}removeNode(e){for(let t of e)this.removeNode(t);e.node&&this.getMutableCollection().removeNode(e.node.key)}getCollection(){return this.inSubscription?this.collection.clone():(this.queuedRender=!1,this.updateCollection(),this.collection)}updateCollection(){for(let e of this.dirtyNodes)e instanceof P&&(!e.isConnected||e.isHidden)?this.removeNode(e):e.updateChildIndices();for(let e of this.dirtyNodes)e instanceof P?(e.isConnected&&!e.isHidden&&(e.updateNode(),this.addNode(e)),e.node&&this.dirtyNodes.delete(e),e.isMutated=!1):this.dirtyNodes.delete(e);this.nextCollection&&(this.nextCollection.commit(this.firstVisibleChild?.node?.key??null,this.lastVisibleChild?.node?.key??null,this.isSSR),this.isSSR||(this.collection=this.nextCollection,this.nextCollection=null))}queueUpdate(){if(!(this.dirtyNodes.size===0||this.queuedRender)){this.queuedRender=!0,this.inSubscription=!0;for(let e of this.subscriptions)e();this.inSubscription=!1}}subscribe(e){return this.subscriptions.add(e),()=>this.subscriptions.delete(e)}resetAfterSSR(){this.isSSR&&(this.isSSR=!1,this.firstChild=null,this.lastChild=null,this.nodeId=0)}constructor(e){super(null),this.nodeType=11,this.ownerDocument=this,this.dirtyNodes=new Set,this.isSSR=!1,this.nodeId=0,this.nodesByProps=new WeakMap,this.nextCollection=null,this.subscriptions=new Set,this.queuedRender=!1,this.inSubscription=!1,this.collection=e,this.nextCollection=e}};if(typeof HTMLTemplateElement<`u`){let e=Object.getOwnPropertyDescriptor(Node.prototype,`firstChild`).get;Object.defineProperty(HTMLTemplateElement.prototype,"firstChild",{configurable:!0,enumerable:!0,get:function(){return this.dataset.reactAriaHidden?this.content.firstChild:e.call(this)}})}const I=t(!1);function L(t){if(i(I))return e.createElement(e.Fragment,null,t.children);let n=e.createElement(I.Provider,{value:!0},t.children);return e.createElement(`template`,{"data-react-aria-hidden":!0},n)}String(Math.round(Math.random()*1e10));const R=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement,e.useId;function z(){return!1}function B(){return!0}function V(e){return()=>{}}function H(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore(V,z,B):i(R)}const U=t(null);function W(t){if(i(U))return t.content;let{collection:n,document:r}=J(t.createCollection);return e.createElement(e.Fragment,null,e.createElement(L,null,e.createElement(U.Provider,{value:r},t.content)),e.createElement(G,{render:t.children,collection:n}))}function G({collection:e,render:t}){return t(e)}function K(e,t,n){let i=H(),a=o(i);a.current=i;let s=r(()=>a.current?n():t(),[t,n]);return c(e,s)}const q=typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore:K;function J(e){let[t]=s(()=>new F(e?.()||new j)),n=r(e=>t.subscribe(e),[t]),i=r(()=>{let e=t.getCollection();return t.isSSR&&t.resetAfterSSR(),e},[t]),a=r(()=>(t.isSSR=!0,t.getCollection()),[t]);return{collection:q(n,i,a),document:t}}const Y=t(null),X=t(null),Z=n(function(t,n){[t,n]=x(t,n,Y);let{children:r,orientation:i=`horizontal`}=t;return r=a(()=>typeof r==`function`?r({orientation:i,defaultChildren:null}):r,[r,i]),e.createElement(W,{content:r},r=>e.createElement(Q,{props:t,collection:r,tabsRef:n}))});function Q({props:t,tabsRef:n,collection:r}){let{orientation:i=`horizontal`}=t,o=g({...t,collection:r,children:void 0}),{focusProps:s,isFocused:c,isFocusVisible:u}=h({within:!0}),d=a(()=>({orientation:i,isFocusWithin:c,isFocusVisible:u}),[i,c,u]),f=y({...t,defaultClassName:`react-aria-Tabs`,values:d}),p=l(t,{global:!0});return e.createElement(w.div,{...m(p,f,s),ref:n,slot:t.slot||void 0,"data-focused":c||void 0,"data-orientation":i,"data-focus-visible":u||void 0,"data-disabled":o.isDisabled||void 0},e.createElement(v,{values:[[Y,t],[X,o]]},f.children))}var $=class extends T{};$.type=`item`;export{Z as Tabs};
@@ -1 +1 @@
1
- import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useCallback as a,useContext as o,useEffect as s,useMemo as c,useRef as l}from"react";import{filterDOMProps as u,inertValue as d,mergeProps as f,mergeRefs as p,useLayoutEffect as m,useLoadMoreSentinel as h,useObjectRef as g}from"@react-aria/utils";import{FocusableContext as _}from"@react-aria/interactions";import"react-dom";import{mergeProps as v,useFocusRing as y,useHover as b,useTag as x}from"react-aria";import"react-stately";function S({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function C(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:s,render:l}=e;return c(()=>{let e,c,u;return e=typeof t==`function`?t({...s,defaultClassName:i}):t,c=typeof n==`function`?n({...s,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...s,defaultChildren:a}):r??a,{className:e??i,style:c||o?{...o,...c}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,s):void 0}},[t,n,r,i,a,o,s,l])}function w(t,n,r){let{render:i,...a}=n,o=l(null),s=c(()=>p(r,o),[r,o]);m(()=>{},[t,i]);let u={...a,ref:s};return i?i(u,void 0):e.createElement(t,u)}const T={},E=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=T[t];return n||(n=r(w.bind(null,t)),T[t]=n),n}});String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;var D=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},O=class extends D{filter(e,t,n){let[r,i]=N(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},k=class extends D{};k.type=`header`;var A=class extends D{};A.type=`loader`;var j=class extends O{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};j.type=`item`;var M=class extends O{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};M.type=`section`;function N(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}function P(e){let{children:n,items:r,idScope:i,addIdAndValue:a,dependencies:o=[]}=e,s=c(()=>new WeakMap,o);return c(()=>{if(r&&typeof n==`function`){let e=[];for(let o of r){let r=s.get(o);if(!r){r=n(o);let e=r.props.id??o.key??o.id;if(e==null)throw Error(`Could not determine key for item`);i!=null&&(e=i+`:`+e),r=t(r,a?{key:e,id:e,value:o}:{key:e}),s.set(o,r)}e.push(r)}return e}if(typeof n!=`function`)return n},[n,r,s,i,a])}const F=n(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const I=n(null);function L(e){var t;return t=class extends D{},t.type=e,t}function R(t,n,r,i,s,c){typeof t==`string`&&(t=L(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(I);if(u){let a=u.ownerDocument.nodesByProps.get(n);return a||(a=u.ownerDocument.createElement(t.type),a.setProps(n,r,t,i,c),u.appendChild(a),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,a)),s?e.createElement(I.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function z(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(_);if(!o(F)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return R(t,r,a,`children`in r?r.children:null,null,t=>e.createElement(_.Provider,{value:s},e.createElement(i,{node:t})))});return a.displayName=n.name,a}const B={CollectionRoot({collection:e,renderDropIndicator:t}){return V(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return V(e,t,n)}};function V(t,n,r){return P({items:n?t.getChildren(n.key):t,dependencies:[r],children(n){let i=n.render(n);return!r||n.type!==`item`?i:e.createElement(e.Fragment,null,r({type:`item`,key:n.key,dropPosition:`before`}),i,H(t,n,r))}})}function H(e,n,r){let a=n.key,o=e.getKeyAfter(a),s=o==null?null:e.getItem(o);for(;s!=null&&s.type!==`item`;)o=e.getKeyAfter(s.key),s=o==null?null:e.getItem(o);let c=n.nextKey==null?null:e.getItem(n.nextKey);for(;c!=null&&c.type!==`item`;)c=c.nextKey==null?null:e.getItem(c.nextKey);let l=[];if(c==null){let a=n;for(;a?.type===`item`&&(!s||a.parentKey!==s.parentKey&&s.level<a.level);){let n=r({type:`item`,key:a.key,dropPosition:`after`});i(n)&&l.push(t(n,{key:`${a.key}-after`})),a=a.parentKey==null?null:e.getItem(a.parentKey)}}return l}const U=n(B),W=n({}),G=n({isSelected:!1}),K=n(null);z(A,function(t,n,r){let i=o(K),{isLoading:a,onLoadMore:s,scrollOffset:f,...p}=t,m=l(null),g=c(()=>({onLoadMore:s,collection:i?.collection,sentinelRef:m,scrollOffset:f}),[s,f,i?.collection]);h(g,m);let _=C({...p,id:void 0,children:r.rendered,defaultClassName:`react-aria-ListBoxLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:d(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:m,style:{position:`absolute`,height:1,width:1}})),a&&_.children&&e.createElement(E.div,{...v(u(t,{global:!0}),{tabIndex:-1}),..._,role:`option`,ref:n},_.children))});const q=z(j,(t,n,r)=>{let i=o(K),a=g(n),{focusProps:c,isFocusVisible:l}=y({within:!1}),{rowProps:d,gridCellProps:p,removeButtonProps:m,...h}=x({item:r},i,a),{hoverProps:_,isHovered:v}=b({isDisabled:!h.allowsSelection,onHoverStart:r.props.onHoverStart,onHoverChange:r.props.onHoverChange,onHoverEnd:r.props.onHoverEnd}),w=C({...t,id:void 0,children:r.rendered,defaultClassName:`react-aria-Tag`,values:{...h,isFocusVisible:l,isHovered:v,selectionMode:i.selectionManager.selectionMode,selectionBehavior:i.selectionManager.selectionBehavior}});s(()=>{r.textValue},[r.textValue]);let T=u(t,{global:!0});return delete T.id,delete T.onClick,e.createElement(E.div,{ref:a,...f(T,w,d,c,_),"data-selected":h.isSelected||void 0,"data-disabled":h.isDisabled||void 0,"data-hovered":v||void 0,"data-focused":h.isFocused||void 0,"data-focus-visible":l||void 0,"data-pressed":h.isPressed||void 0,"data-allows-removing":h.allowsRemoving||void 0,"data-selection-mode":i.selectionManager.selectionMode===`none`?void 0:i.selectionManager.selectionMode},e.createElement(`div`,{...p,style:{display:`contents`}},e.createElement(S,{values:[[W,{slots:{remove:m}}],[U,B],[G,{isSelected:h.isSelected}]]},w.children)))});export{q as Tag};
1
+ import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useCallback as a,useContext as o,useEffect as s,useMemo as c,useRef as l}from"react";import{filterDOMProps as u,inertValue as d,mergeProps as f,mergeRefs as p,useLayoutEffect as m,useLoadMoreSentinel as h,useObjectRef as g}from"@react-aria/utils";import{FocusableContext as _}from"@react-aria/interactions";import"react-dom";import{mergeProps as v,useFocusRing as y,useHover as b,useTag as x}from"react-aria";import"react-stately";function S({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function C(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:s,render:l}=e;return c(()=>{let e,c,u;return e=typeof t==`function`?t({...s,defaultClassName:i}):t,c=typeof n==`function`?n({...s,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...s,defaultChildren:a}):r??a,{className:e??i,style:c||o?{...o,...c}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,s):void 0}},[t,n,r,i,a,o,s,l])}function w(t,n,r){let{render:i,...a}=n,o=l(null),s=c(()=>p(r,o),[r,o]);m(()=>{},[t,i]);let u={...a,ref:s};return i?i(u,void 0):e.createElement(t,u)}const T={},E=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=T[t];return n||(n=r(w.bind(null,t)),T[t]=n),n}});var D=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},O=class extends D{filter(e,t,n){let[r,i]=N(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},k=class extends D{};k.type=`header`;var A=class extends D{};A.type=`loader`;var j=class extends O{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};j.type=`item`;var M=class extends O{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};M.type=`section`;function N(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}function P(e){let{children:n,items:r,idScope:i,addIdAndValue:a,dependencies:o=[]}=e,s=c(()=>new WeakMap,o);return c(()=>{if(r&&typeof n==`function`){let e=[];for(let o of r){let r=s.get(o);if(!r){r=n(o);let e=r.props.id??o.key??o.id;if(e==null)throw Error(`Could not determine key for item`);i!=null&&(e=i+`:`+e),r=t(r,a?{key:e,id:e,value:o}:{key:e}),s.set(o,r)}e.push(r)}return e}if(typeof n!=`function`)return n},[n,r,s,i,a])}String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;const F=n(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const I=n(null);function L(e){var t;return t=class extends D{},t.type=e,t}function R(t,n,r,i,s,c){typeof t==`string`&&(t=L(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(I);if(u){let a=u.ownerDocument.nodesByProps.get(n);return a||(a=u.ownerDocument.createElement(t.type),a.setProps(n,r,t,i,c),u.appendChild(a),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,a)),s?e.createElement(I.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function z(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(_);if(!o(F)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return R(t,r,a,`children`in r?r.children:null,null,t=>e.createElement(_.Provider,{value:s},e.createElement(i,{node:t})))});return a.displayName=n.name,a}const B={CollectionRoot({collection:e,renderDropIndicator:t}){return V(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return V(e,t,n)}};function V(t,n,r){return P({items:n?t.getChildren(n.key):t,dependencies:[r],children(n){let i=n.render(n);return!r||n.type!==`item`?i:e.createElement(e.Fragment,null,r({type:`item`,key:n.key,dropPosition:`before`}),i,H(t,n,r))}})}function H(e,n,r){let a=n.key,o=e.getKeyAfter(a),s=o==null?null:e.getItem(o);for(;s!=null&&s.type!==`item`;)o=e.getKeyAfter(s.key),s=o==null?null:e.getItem(o);let c=n.nextKey==null?null:e.getItem(n.nextKey);for(;c!=null&&c.type!==`item`;)c=c.nextKey==null?null:e.getItem(c.nextKey);let l=[];if(c==null){let a=n;for(;a?.type===`item`&&(!s||a.parentKey!==s.parentKey&&s.level<a.level);){let n=r({type:`item`,key:a.key,dropPosition:`after`});i(n)&&l.push(t(n,{key:`${a.key}-after`})),a=a.parentKey==null?null:e.getItem(a.parentKey)}}return l}const U=n(B),W=n({}),G=n({isSelected:!1}),K=n(null);z(A,function(t,n,r){let i=o(K),{isLoading:a,onLoadMore:s,scrollOffset:f,...p}=t,m=l(null),g=c(()=>({onLoadMore:s,collection:i?.collection,sentinelRef:m,scrollOffset:f}),[s,f,i?.collection]);h(g,m);let _=C({...p,id:void 0,children:r.rendered,defaultClassName:`react-aria-ListBoxLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:d(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:m,style:{position:`absolute`,height:1,width:1}})),a&&_.children&&e.createElement(E.div,{...v(u(t,{global:!0}),{tabIndex:-1}),..._,role:`option`,ref:n},_.children))});const q=z(j,(t,n,r)=>{let i=o(K),a=g(n),{focusProps:c,isFocusVisible:l}=y({within:!1}),{rowProps:d,gridCellProps:p,removeButtonProps:m,...h}=x({item:r},i,a),{hoverProps:_,isHovered:v}=b({isDisabled:!h.allowsSelection,onHoverStart:r.props.onHoverStart,onHoverChange:r.props.onHoverChange,onHoverEnd:r.props.onHoverEnd}),w=C({...t,id:void 0,children:r.rendered,defaultClassName:`react-aria-Tag`,values:{...h,isFocusVisible:l,isHovered:v,selectionMode:i.selectionManager.selectionMode,selectionBehavior:i.selectionManager.selectionBehavior}});s(()=>{r.textValue},[r.textValue]);let T=u(t,{global:!0});return delete T.id,delete T.onClick,e.createElement(E.div,{ref:a,...f(T,w,d,c,_),"data-selected":h.isSelected||void 0,"data-disabled":h.isDisabled||void 0,"data-hovered":v||void 0,"data-focused":h.isFocused||void 0,"data-focus-visible":l||void 0,"data-pressed":h.isPressed||void 0,"data-allows-removing":h.allowsRemoving||void 0,"data-selection-mode":i.selectionManager.selectionMode===`none`?void 0:i.selectionManager.selectionMode},e.createElement(`div`,{...p,style:{display:`contents`}},e.createElement(S,{values:[[W,{slots:{remove:m}}],[U,B],[G,{isSelected:h.isSelected}]]},w.children)))});export{q as Tag};
@@ -1 +1 @@
1
- import e,{createContext as t,forwardRef as n,useCallback as r,useContext as i,useMemo as a,useRef as o,useState as s,useSyncExternalStore as c}from"react";import{filterDOMProps as l,inertValue as u,mergeProps as d,mergeRefs as f,useLayoutEffect as p,useLoadMoreSentinel as m,useObjectRef as h}from"@react-aria/utils";import{FocusableContext as g}from"@react-aria/interactions";import"react-dom";import{mergeProps as _,useTagGroup as v}from"react-aria";import{UNSTABLE_useFilteredListState as y,useListState as ee}from"react-stately";t(null),t(null),t(null),t(null),t(null),t({});const b=t(null);t(null);const x=Symbol(`default`);function S({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function C(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:o,defaultStyle:s,values:c,render:l}=e;return a(()=>{let e,a,u;return e=typeof t==`function`?t({...c,defaultClassName:i}):t,a=typeof n==`function`?n({...c,defaultStyle:s||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:o}):r??o,{className:e??i,style:a||s?{...s,...a}:void 0,children:u??o,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,i,o,s,c,l])}function w(e,t){let n=i(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||x;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:`A slot prop is required.`;throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function T(e,t,n){let{ref:r,...i}=w(n,e.slot)||{},o=h(a(()=>f(t,r),[t,r])),s=d(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(s.style=typeof i.style==`function`||typeof e.style==`function`?t=>{let n=typeof i.style==`function`?i.style(t):i.style,r={...t.defaultStyle,...n},a=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...a}}:{...i.style,...e.style}),[s,o]}function te(e=!0){let[t,n]=s(e),i=o(!1),a=r(e=>{i.current=!0,n(!!e)},[]);return p(()=>{i.current||n(!1)},[]),[a,t]}function E(t,n,r){let{render:i,...s}=n,c=o(null),l=a(()=>f(r,c),[r,c]);p(()=>{},[t,i]);let u={...s,ref:l};return i?i(u,void 0):e.createElement(t,u)}const D={},O=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let r=D[t];return r||(r=n(E.bind(null,t)),D[t]=r),r}});String(Math.round(Math.random()*1e10));const k=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement,e.useId;function A(){return!1}function j(){return!0}function M(e){return()=>{}}function N(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore(M,A,j):i(k)}var P=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},F=class extends P{filter(e,t,n){let[r,i]=V(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},I=class extends P{};I.type=`header`;var L=class extends P{};L.type=`loader`;var R=class extends F{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};R.type=`item`;var z=class extends F{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};z.type=`section`;var B=class{get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}*[Symbol.iterator](){let e=this.firstKey==null?void 0:this.keyMap.get(this.firstKey);for(;e;)yield e,e=e.nextKey==null?void 0:this.keyMap.get(e.nextKey)}getChildren(e){let t=this.keyMap;return{*[Symbol.iterator](){let n=t.get(e),r=n?.firstChildKey==null?null:t.get(n.firstChildKey);for(;r;)yield r,r=r.nextKey==null?void 0:t.get(r.nextKey)}}}getKeyBefore(e){let t=this.keyMap.get(e);if(!t)return null;if(t.prevKey!=null){for(t=this.keyMap.get(t.prevKey);t&&t.type!==`item`&&t.lastChildKey!=null;)t=this.keyMap.get(t.lastChildKey);return t?.key??null}return t.parentKey}getKeyAfter(e){let t=this.keyMap.get(e);if(!t)return null;if(t.type!==`item`&&t.firstChildKey!=null)return t.firstChildKey;for(;t;){if(t.nextKey!=null)return t.nextKey;if(t.parentKey!=null)t=this.keyMap.get(t.parentKey);else return null}return null}getFirstKey(){return this.firstKey}getLastKey(){let e=this.lastKey==null?null:this.keyMap.get(this.lastKey);for(;e?.lastChildKey!=null;)e=this.keyMap.get(e.lastChildKey);return e?.key??null}getItem(e){return this.keyMap.get(e)??null}at(){throw Error(`Not implemented`)}clone(){let e=this.constructor,t=new e;return t.keyMap=new Map(this.keyMap),t.firstKey=this.firstKey,t.lastKey=this.lastKey,t.itemCount=this.itemCount,t}addNode(e){if(this.frozen)throw Error(`Cannot add a node to a frozen collection`);e.type===`item`&&this.keyMap.get(e.key)==null&&this.itemCount++,this.keyMap.set(e.key,e)}addDescendants(e,t){this.addNode(e);let n=t.getChildren(e.key);for(let e of n)this.addDescendants(e,t)}removeNode(e){if(this.frozen)throw Error(`Cannot remove a node to a frozen collection`);let t=this.keyMap.get(e);t!=null&&t.type===`item`&&this.itemCount--,this.keyMap.delete(e)}commit(e,t,n=!1){if(this.frozen)throw Error(`Cannot commit a frozen collection`);this.firstKey=e,this.lastKey=t,this.frozen=!n}filter(e){let t=new this.constructor,[n,r]=V(this,t,this.firstKey,e);return t?.commit(n,r),t}constructor(){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.frozen=!1,this.itemCount=0}};function V(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}var H=class{*[Symbol.iterator](){let e=this.firstChild;for(;e;)yield e,e=e.nextSibling}get firstChild(){return this._firstChild}set firstChild(e){this._firstChild=e,this.ownerDocument.markDirty(this)}get lastChild(){return this._lastChild}set lastChild(e){this._lastChild=e,this.ownerDocument.markDirty(this)}get previousSibling(){return this._previousSibling}set previousSibling(e){this._previousSibling=e,this.ownerDocument.markDirty(this)}get nextSibling(){return this._nextSibling}set nextSibling(e){this._nextSibling=e,this.ownerDocument.markDirty(this)}get parentNode(){return this._parentNode}set parentNode(e){this._parentNode=e,this.ownerDocument.markDirty(this)}get isConnected(){return this.parentNode?.isConnected||!1}invalidateChildIndices(e){(this._minInvalidChildIndex==null||!this._minInvalidChildIndex.isConnected||e.index<this._minInvalidChildIndex.index)&&(this._minInvalidChildIndex=e,this.ownerDocument.markDirty(this))}updateChildIndices(){let e=this._minInvalidChildIndex;for(;e;)e.index=e.previousSibling?e.previousSibling.index+1:0,e=e.nextSibling;this._minInvalidChildIndex=null}appendChild(e){e.parentNode&&e.parentNode.removeChild(e),this.firstChild??=e,this.lastChild?(this.lastChild.nextSibling=e,e.index=this.lastChild.index+1,e.previousSibling=this.lastChild):(e.previousSibling=null,e.index=0),e.parentNode=this,e.nextSibling=null,this.lastChild=e,this.ownerDocument.markDirty(this),this.isConnected&&this.ownerDocument.queueUpdate()}insertBefore(e,t){if(t==null)return this.appendChild(e);e.parentNode&&e.parentNode.removeChild(e),e.nextSibling=t,e.previousSibling=t.previousSibling,e.index=t.index-1,this.firstChild===t?this.firstChild=e:t.previousSibling&&(t.previousSibling.nextSibling=e),t.previousSibling=e,e.parentNode=t.parentNode,this.invalidateChildIndices(e),this.isConnected&&this.ownerDocument.queueUpdate()}removeChild(e){e.parentNode===this&&(this._minInvalidChildIndex===e&&(this._minInvalidChildIndex=null),e.nextSibling&&(this.invalidateChildIndices(e.nextSibling),e.nextSibling.previousSibling=e.previousSibling),e.previousSibling&&(e.previousSibling.nextSibling=e.nextSibling),this.firstChild===e&&(this.firstChild=e.nextSibling),this.lastChild===e&&(this.lastChild=e.previousSibling),e.parentNode=null,e.nextSibling=null,e.previousSibling=null,e.index=0,this.ownerDocument.markDirty(e),this.isConnected&&this.ownerDocument.queueUpdate())}addEventListener(){}removeEventListener(){}get previousVisibleSibling(){let e=this.previousSibling;for(;e&&e.isHidden;)e=e.previousSibling;return e}get nextVisibleSibling(){let e=this.nextSibling;for(;e&&e.isHidden;)e=e.nextSibling;return e}get firstVisibleChild(){let e=this.firstChild;for(;e&&e.isHidden;)e=e.nextSibling;return e}get lastVisibleChild(){let e=this.lastChild;for(;e&&e.isHidden;)e=e.previousSibling;return e}constructor(e){this._firstChild=null,this._lastChild=null,this._previousSibling=null,this._nextSibling=null,this._parentNode=null,this._minInvalidChildIndex=null,this.ownerDocument=e}},U=class e extends H{get index(){return this._index}set index(e){this._index=e,this.ownerDocument.markDirty(this)}get level(){return this.parentNode instanceof e?this.parentNode.level+ +(this.node?.type===`item`):0}getMutableNode(){return this.node==null?null:(this.isMutated||=(this.node=this.node.clone(),!0),this.ownerDocument.markDirty(this),this.node)}updateNode(){let t=this.nextVisibleSibling,n=this.getMutableNode();if(n!=null&&(n.index=this.index,n.level=this.level,n.parentKey=this.parentNode instanceof e?this.parentNode.node?.key??null:null,n.prevKey=this.previousVisibleSibling?.node?.key??null,n.nextKey=t?.node?.key??null,n.hasChildNodes=!!this.firstChild,n.firstChildKey=this.firstVisibleChild?.node?.key??null,n.lastChildKey=this.lastVisibleChild?.node?.key??null,(n.colSpan!=null||n.colIndex!=null)&&t)){let e=(n.colIndex??n.index)+(n.colSpan??1);if(t.node!=null&&e!==t.node.colIndex){let n=t.getMutableNode();n.colIndex=e}}}setProps(e,t,n,r,i){let a,{value:o,textValue:s,id:c,...l}=e;if(this.node==null?(a=new n(c??`react-aria-${++this.ownerDocument.nodeId}`),this.node=a):a=this.getMutableNode(),l.ref=t,a.props=l,a.rendered=r,a.render=i,a.value=o,e[`aria-label`]&&(a[`aria-label`]=e[`aria-label`]),a.textValue=s||(typeof l.children==`string`?l.children:``)||e[`aria-label`]||``,c!=null&&c!==a.key)throw Error(`Cannot change the id of an item`);l.colSpan!=null&&(a.colSpan=l.colSpan),this.isConnected&&this.ownerDocument.queueUpdate()}get style(){let e=this;return{get display(){return e.isHidden?`none`:``},set display(t){let n=t===`none`;if(e.isHidden!==n){(e.parentNode?.firstVisibleChild===e||e.parentNode?.lastVisibleChild===e)&&e.ownerDocument.markDirty(e.parentNode);let t=e.previousVisibleSibling,r=e.nextVisibleSibling;t&&e.ownerDocument.markDirty(t),r&&e.ownerDocument.markDirty(r),e.isHidden=n,e.ownerDocument.markDirty(e)}}}}hasAttribute(){}setAttribute(){}setAttributeNS(){}removeAttribute(){}constructor(e,t){super(t),this.nodeType=8,this.isMutated=!0,this._index=0,this.isHidden=!1,this.node=null}},W=class extends H{get isConnected(){return!0}createElement(e){return new U(e,this)}getMutableCollection(){return this.nextCollection||=this.collection.clone(),this.nextCollection}markDirty(e){this.dirtyNodes.add(e)}addNode(e){if(e.isHidden||e.node==null)return;let t=this.getMutableCollection();if(!t.getItem(e.node.key))for(let t of e)this.addNode(t);t.addNode(e.node)}removeNode(e){for(let t of e)this.removeNode(t);e.node&&this.getMutableCollection().removeNode(e.node.key)}getCollection(){return this.inSubscription?this.collection.clone():(this.queuedRender=!1,this.updateCollection(),this.collection)}updateCollection(){for(let e of this.dirtyNodes)e instanceof U&&(!e.isConnected||e.isHidden)?this.removeNode(e):e.updateChildIndices();for(let e of this.dirtyNodes)e instanceof U?(e.isConnected&&!e.isHidden&&(e.updateNode(),this.addNode(e)),e.node&&this.dirtyNodes.delete(e),e.isMutated=!1):this.dirtyNodes.delete(e);this.nextCollection&&(this.nextCollection.commit(this.firstVisibleChild?.node?.key??null,this.lastVisibleChild?.node?.key??null,this.isSSR),this.isSSR||(this.collection=this.nextCollection,this.nextCollection=null))}queueUpdate(){if(!(this.dirtyNodes.size===0||this.queuedRender)){this.queuedRender=!0,this.inSubscription=!0;for(let e of this.subscriptions)e();this.inSubscription=!1}}subscribe(e){return this.subscriptions.add(e),()=>this.subscriptions.delete(e)}resetAfterSSR(){this.isSSR&&(this.isSSR=!1,this.firstChild=null,this.lastChild=null,this.nodeId=0)}constructor(e){super(null),this.nodeType=11,this.ownerDocument=this,this.dirtyNodes=new Set,this.isSSR=!1,this.nodeId=0,this.nodesByProps=new WeakMap,this.nextCollection=null,this.subscriptions=new Set,this.queuedRender=!1,this.inSubscription=!1,this.collection=e,this.nextCollection=e}};if(typeof HTMLTemplateElement<`u`){let e=Object.getOwnPropertyDescriptor(Node.prototype,`firstChild`).get;Object.defineProperty(HTMLTemplateElement.prototype,"firstChild",{configurable:!0,enumerable:!0,get:function(){return this.dataset.reactAriaHidden?this.content.firstChild:e.call(this)}})}const G=t(!1);function K(t){if(i(G))return e.createElement(e.Fragment,null,t.children);let n=e.createElement(G.Provider,{value:!0},t.children);return e.createElement(`template`,{"data-react-aria-hidden":!0},n)}const q=t(!1),J=t(null);function Y(t){if(i(J))return t.content;let{collection:n,document:r}=re(t.createCollection);return e.createElement(e.Fragment,null,e.createElement(K,null,e.createElement(J.Provider,{value:r},t.content)),e.createElement(X,{render:t.children,collection:n}))}function X({collection:e,render:t}){return t(e)}function Z(e,t,n){let i=N(),a=o(i);a.current=i;let s=r(()=>a.current?n():t(),[t,n]);return c(e,s)}const ne=typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore:Z;function re(e){let[t]=s(()=>new W(e?.()||new B)),n=r(e=>t.subscribe(e),[t]),i=r(()=>{let e=t.getCollection();return t.isSSR&&t.resetAfterSSR(),e},[t]),a=r(()=>(t.isSSR=!0,t.getCollection()),[t]);return{collection:ne(n,i,a),document:t}}const Q=t(null);function ie(e){var t;return t=class extends P{},t.type=e,t}function ae(t,n,a,o,s,c){typeof t==`string`&&(t=ie(t));let l=r(e=>{e?.setProps(n,a,t,o,c)},[n,a,o,c,t]),u=i(Q);if(u){let r=u.ownerDocument.nodesByProps.get(n);return r||(r=u.ownerDocument.createElement(t.type),r.setProps(n,a,t,o,c),u.appendChild(r),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,r)),s?e.createElement(Q.Provider,{value:r},s):null}return e.createElement(t.type,{ref:l},s)}function oe(t,r){let a=({node:e})=>r(e.props,e.props.ref,e),o=n((n,o)=>{let s=i(g);if(!i(q)){if(r.length>=3)throw Error(r.name+` cannot be rendered outside a collection.`);return r(n,o)}return ae(t,n,o,`children`in n?n.children:null,null,t=>e.createElement(g.Provider,{value:s},e.createElement(a,{node:t})))});return o.displayName=r.name,o}const se=t({}),ce=t({}),$=t(null);oe(L,function(t,n,r){let s=i($),{isLoading:c,onLoadMore:d,scrollOffset:f,...p}=t,h=o(null),g=a(()=>({onLoadMore:d,collection:s?.collection,sentinelRef:h,scrollOffset:f}),[d,f,s?.collection]);m(g,h);let v=C({...p,id:void 0,children:r.rendered,defaultClassName:`react-aria-ListBoxLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:u(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:h,style:{position:`absolute`,height:1,width:1}})),c&&v.children&&e.createElement(O.div,{..._(l(t,{global:!0}),{tabIndex:-1}),...v,role:`option`,ref:n},v.children))});const le=t(null),ue=t(null),de=n(function(t,n){return[t,n]=T(t,n,le),e.createElement($.Provider,{value:null},e.createElement(Y,{content:t.children},r=>e.createElement(fe,{props:t,forwardedRef:n,collection:r})))});function fe({props:t,forwardedRef:n,collection:r}){let i=o(null),{id:a,...s}=t;[s,i]=T(s,i,b);let{filter:c,shouldUseVirtualFocus:u,...d}=s,[f,p]=te(!t[`aria-label`]&&!t[`aria-labelledby`]),m=ee({...d,children:void 0,collection:r}),h=y(m,c),g=l(s,{global:!0}),_=Object.fromEntries(Object.entries(g).map(([e,t])=>[e,e===`id`?t:void 0])),{gridProps:x,labelProps:C,descriptionProps:w,errorMessageProps:E}=v({...d,..._,label:p},h,i);return e.createElement(O.div,{render:t.render,...g,id:a,ref:n,slot:t.slot||void 0,className:t.className??`react-aria-TagGroup`,style:t.style},e.createElement(S,{values:[[se,{...C,elementType:`span`,ref:f}],[ue,{...x,ref:i}],[$,h],[ce,{slots:{description:w,errorMessage:E}}]]},t.children))}export{de as TagGroup};
1
+ import e,{createContext as t,forwardRef as n,useCallback as r,useContext as i,useMemo as a,useRef as o,useState as s,useSyncExternalStore as c}from"react";import{filterDOMProps as l,inertValue as u,mergeProps as d,mergeRefs as f,useLayoutEffect as p,useLoadMoreSentinel as m,useObjectRef as h}from"@react-aria/utils";import{FocusableContext as g}from"@react-aria/interactions";import"react-dom";import{mergeProps as _,useTagGroup as v}from"react-aria";import{UNSTABLE_useFilteredListState as y,useListState as ee}from"react-stately";t(null),t(null),t(null),t(null),t(null),t({});const b=t(null);t(null);const x=Symbol(`default`);function S({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function C(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:o,defaultStyle:s,values:c,render:l}=e;return a(()=>{let e,a,u;return e=typeof t==`function`?t({...c,defaultClassName:i}):t,a=typeof n==`function`?n({...c,defaultStyle:s||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:o}):r??o,{className:e??i,style:a||s?{...s,...a}:void 0,children:u??o,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,i,o,s,c,l])}function w(e,t){let n=i(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||x;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:`A slot prop is required.`;throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function T(e,t,n){let{ref:r,...i}=w(n,e.slot)||{},o=h(a(()=>f(t,r),[t,r])),s=d(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(s.style=typeof i.style==`function`||typeof e.style==`function`?t=>{let n=typeof i.style==`function`?i.style(t):i.style,r={...t.defaultStyle,...n},a=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...a}}:{...i.style,...e.style}),[s,o]}function E(e=!0){let[t,n]=s(e),i=o(!1),a=r(e=>{i.current=!0,n(!!e)},[]);return p(()=>{i.current||n(!1)},[]),[a,t]}function D(t,n,r){let{render:i,...s}=n,c=o(null),l=a(()=>f(r,c),[r,c]);p(()=>{},[t,i]);let u={...s,ref:l};return i?i(u,void 0):e.createElement(t,u)}const O={},k=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let r=O[t];return r||(r=n(D.bind(null,t)),O[t]=r),r}});var A=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},j=class extends A{filter(e,t,n){let[r,i]=I(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},M=class extends A{};M.type=`header`;var N=class extends A{};N.type=`loader`;var P=class extends j{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};P.type=`item`;var te=class extends j{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};te.type=`section`;var F=class{get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}*[Symbol.iterator](){let e=this.firstKey==null?void 0:this.keyMap.get(this.firstKey);for(;e;)yield e,e=e.nextKey==null?void 0:this.keyMap.get(e.nextKey)}getChildren(e){let t=this.keyMap;return{*[Symbol.iterator](){let n=t.get(e),r=n?.firstChildKey==null?null:t.get(n.firstChildKey);for(;r;)yield r,r=r.nextKey==null?void 0:t.get(r.nextKey)}}}getKeyBefore(e){let t=this.keyMap.get(e);if(!t)return null;if(t.prevKey!=null){for(t=this.keyMap.get(t.prevKey);t&&t.type!==`item`&&t.lastChildKey!=null;)t=this.keyMap.get(t.lastChildKey);return t?.key??null}return t.parentKey}getKeyAfter(e){let t=this.keyMap.get(e);if(!t)return null;if(t.type!==`item`&&t.firstChildKey!=null)return t.firstChildKey;for(;t;){if(t.nextKey!=null)return t.nextKey;if(t.parentKey!=null)t=this.keyMap.get(t.parentKey);else return null}return null}getFirstKey(){return this.firstKey}getLastKey(){let e=this.lastKey==null?null:this.keyMap.get(this.lastKey);for(;e?.lastChildKey!=null;)e=this.keyMap.get(e.lastChildKey);return e?.key??null}getItem(e){return this.keyMap.get(e)??null}at(){throw Error(`Not implemented`)}clone(){let e=this.constructor,t=new e;return t.keyMap=new Map(this.keyMap),t.firstKey=this.firstKey,t.lastKey=this.lastKey,t.itemCount=this.itemCount,t}addNode(e){if(this.frozen)throw Error(`Cannot add a node to a frozen collection`);e.type===`item`&&this.keyMap.get(e.key)==null&&this.itemCount++,this.keyMap.set(e.key,e)}addDescendants(e,t){this.addNode(e);let n=t.getChildren(e.key);for(let e of n)this.addDescendants(e,t)}removeNode(e){if(this.frozen)throw Error(`Cannot remove a node to a frozen collection`);let t=this.keyMap.get(e);t!=null&&t.type===`item`&&this.itemCount--,this.keyMap.delete(e)}commit(e,t,n=!1){if(this.frozen)throw Error(`Cannot commit a frozen collection`);this.firstKey=e,this.lastKey=t,this.frozen=!n}filter(e){let t=new this.constructor,[n,r]=I(this,t,this.firstKey,e);return t?.commit(n,r),t}constructor(){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.frozen=!1,this.itemCount=0}};function I(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}var L=class{*[Symbol.iterator](){let e=this.firstChild;for(;e;)yield e,e=e.nextSibling}get firstChild(){return this._firstChild}set firstChild(e){this._firstChild=e,this.ownerDocument.markDirty(this)}get lastChild(){return this._lastChild}set lastChild(e){this._lastChild=e,this.ownerDocument.markDirty(this)}get previousSibling(){return this._previousSibling}set previousSibling(e){this._previousSibling=e,this.ownerDocument.markDirty(this)}get nextSibling(){return this._nextSibling}set nextSibling(e){this._nextSibling=e,this.ownerDocument.markDirty(this)}get parentNode(){return this._parentNode}set parentNode(e){this._parentNode=e,this.ownerDocument.markDirty(this)}get isConnected(){return this.parentNode?.isConnected||!1}invalidateChildIndices(e){(this._minInvalidChildIndex==null||!this._minInvalidChildIndex.isConnected||e.index<this._minInvalidChildIndex.index)&&(this._minInvalidChildIndex=e,this.ownerDocument.markDirty(this))}updateChildIndices(){let e=this._minInvalidChildIndex;for(;e;)e.index=e.previousSibling?e.previousSibling.index+1:0,e=e.nextSibling;this._minInvalidChildIndex=null}appendChild(e){e.parentNode&&e.parentNode.removeChild(e),this.firstChild??=e,this.lastChild?(this.lastChild.nextSibling=e,e.index=this.lastChild.index+1,e.previousSibling=this.lastChild):(e.previousSibling=null,e.index=0),e.parentNode=this,e.nextSibling=null,this.lastChild=e,this.ownerDocument.markDirty(this),this.isConnected&&this.ownerDocument.queueUpdate()}insertBefore(e,t){if(t==null)return this.appendChild(e);e.parentNode&&e.parentNode.removeChild(e),e.nextSibling=t,e.previousSibling=t.previousSibling,e.index=t.index-1,this.firstChild===t?this.firstChild=e:t.previousSibling&&(t.previousSibling.nextSibling=e),t.previousSibling=e,e.parentNode=t.parentNode,this.invalidateChildIndices(e),this.isConnected&&this.ownerDocument.queueUpdate()}removeChild(e){e.parentNode===this&&(this._minInvalidChildIndex===e&&(this._minInvalidChildIndex=null),e.nextSibling&&(this.invalidateChildIndices(e.nextSibling),e.nextSibling.previousSibling=e.previousSibling),e.previousSibling&&(e.previousSibling.nextSibling=e.nextSibling),this.firstChild===e&&(this.firstChild=e.nextSibling),this.lastChild===e&&(this.lastChild=e.previousSibling),e.parentNode=null,e.nextSibling=null,e.previousSibling=null,e.index=0,this.ownerDocument.markDirty(e),this.isConnected&&this.ownerDocument.queueUpdate())}addEventListener(){}removeEventListener(){}get previousVisibleSibling(){let e=this.previousSibling;for(;e&&e.isHidden;)e=e.previousSibling;return e}get nextVisibleSibling(){let e=this.nextSibling;for(;e&&e.isHidden;)e=e.nextSibling;return e}get firstVisibleChild(){let e=this.firstChild;for(;e&&e.isHidden;)e=e.nextSibling;return e}get lastVisibleChild(){let e=this.lastChild;for(;e&&e.isHidden;)e=e.previousSibling;return e}constructor(e){this._firstChild=null,this._lastChild=null,this._previousSibling=null,this._nextSibling=null,this._parentNode=null,this._minInvalidChildIndex=null,this.ownerDocument=e}},R=class e extends L{get index(){return this._index}set index(e){this._index=e,this.ownerDocument.markDirty(this)}get level(){return this.parentNode instanceof e?this.parentNode.level+ +(this.node?.type===`item`):0}getMutableNode(){return this.node==null?null:(this.isMutated||=(this.node=this.node.clone(),!0),this.ownerDocument.markDirty(this),this.node)}updateNode(){let t=this.nextVisibleSibling,n=this.getMutableNode();if(n!=null&&(n.index=this.index,n.level=this.level,n.parentKey=this.parentNode instanceof e?this.parentNode.node?.key??null:null,n.prevKey=this.previousVisibleSibling?.node?.key??null,n.nextKey=t?.node?.key??null,n.hasChildNodes=!!this.firstChild,n.firstChildKey=this.firstVisibleChild?.node?.key??null,n.lastChildKey=this.lastVisibleChild?.node?.key??null,(n.colSpan!=null||n.colIndex!=null)&&t)){let e=(n.colIndex??n.index)+(n.colSpan??1);if(t.node!=null&&e!==t.node.colIndex){let n=t.getMutableNode();n.colIndex=e}}}setProps(e,t,n,r,i){let a,{value:o,textValue:s,id:c,...l}=e;if(this.node==null?(a=new n(c??`react-aria-${++this.ownerDocument.nodeId}`),this.node=a):a=this.getMutableNode(),l.ref=t,a.props=l,a.rendered=r,a.render=i,a.value=o,e[`aria-label`]&&(a[`aria-label`]=e[`aria-label`]),a.textValue=s||(typeof l.children==`string`?l.children:``)||e[`aria-label`]||``,c!=null&&c!==a.key)throw Error(`Cannot change the id of an item`);l.colSpan!=null&&(a.colSpan=l.colSpan),this.isConnected&&this.ownerDocument.queueUpdate()}get style(){let e=this;return{get display(){return e.isHidden?`none`:``},set display(t){let n=t===`none`;if(e.isHidden!==n){(e.parentNode?.firstVisibleChild===e||e.parentNode?.lastVisibleChild===e)&&e.ownerDocument.markDirty(e.parentNode);let t=e.previousVisibleSibling,r=e.nextVisibleSibling;t&&e.ownerDocument.markDirty(t),r&&e.ownerDocument.markDirty(r),e.isHidden=n,e.ownerDocument.markDirty(e)}}}}hasAttribute(){}setAttribute(){}setAttributeNS(){}removeAttribute(){}constructor(e,t){super(t),this.nodeType=8,this.isMutated=!0,this._index=0,this.isHidden=!1,this.node=null}},z=class extends L{get isConnected(){return!0}createElement(e){return new R(e,this)}getMutableCollection(){return this.nextCollection||=this.collection.clone(),this.nextCollection}markDirty(e){this.dirtyNodes.add(e)}addNode(e){if(e.isHidden||e.node==null)return;let t=this.getMutableCollection();if(!t.getItem(e.node.key))for(let t of e)this.addNode(t);t.addNode(e.node)}removeNode(e){for(let t of e)this.removeNode(t);e.node&&this.getMutableCollection().removeNode(e.node.key)}getCollection(){return this.inSubscription?this.collection.clone():(this.queuedRender=!1,this.updateCollection(),this.collection)}updateCollection(){for(let e of this.dirtyNodes)e instanceof R&&(!e.isConnected||e.isHidden)?this.removeNode(e):e.updateChildIndices();for(let e of this.dirtyNodes)e instanceof R?(e.isConnected&&!e.isHidden&&(e.updateNode(),this.addNode(e)),e.node&&this.dirtyNodes.delete(e),e.isMutated=!1):this.dirtyNodes.delete(e);this.nextCollection&&(this.nextCollection.commit(this.firstVisibleChild?.node?.key??null,this.lastVisibleChild?.node?.key??null,this.isSSR),this.isSSR||(this.collection=this.nextCollection,this.nextCollection=null))}queueUpdate(){if(!(this.dirtyNodes.size===0||this.queuedRender)){this.queuedRender=!0,this.inSubscription=!0;for(let e of this.subscriptions)e();this.inSubscription=!1}}subscribe(e){return this.subscriptions.add(e),()=>this.subscriptions.delete(e)}resetAfterSSR(){this.isSSR&&(this.isSSR=!1,this.firstChild=null,this.lastChild=null,this.nodeId=0)}constructor(e){super(null),this.nodeType=11,this.ownerDocument=this,this.dirtyNodes=new Set,this.isSSR=!1,this.nodeId=0,this.nodesByProps=new WeakMap,this.nextCollection=null,this.subscriptions=new Set,this.queuedRender=!1,this.inSubscription=!1,this.collection=e,this.nextCollection=e}};if(typeof HTMLTemplateElement<`u`){let e=Object.getOwnPropertyDescriptor(Node.prototype,`firstChild`).get;Object.defineProperty(HTMLTemplateElement.prototype,"firstChild",{configurable:!0,enumerable:!0,get:function(){return this.dataset.reactAriaHidden?this.content.firstChild:e.call(this)}})}const B=t(!1);function V(t){if(i(B))return e.createElement(e.Fragment,null,t.children);let n=e.createElement(B.Provider,{value:!0},t.children);return e.createElement(`template`,{"data-react-aria-hidden":!0},n)}String(Math.round(Math.random()*1e10));const H=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement,e.useId;function U(){return!1}function W(){return!0}function G(e){return()=>{}}function K(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore(G,U,W):i(H)}const q=t(!1),J=t(null);function Y(t){if(i(J))return t.content;let{collection:n,document:r}=re(t.createCollection);return e.createElement(e.Fragment,null,e.createElement(V,null,e.createElement(J.Provider,{value:r},t.content)),e.createElement(X,{render:t.children,collection:n}))}function X({collection:e,render:t}){return t(e)}function Z(e,t,n){let i=K(),a=o(i);a.current=i;let s=r(()=>a.current?n():t(),[t,n]);return c(e,s)}const ne=typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore:Z;function re(e){let[t]=s(()=>new z(e?.()||new F)),n=r(e=>t.subscribe(e),[t]),i=r(()=>{let e=t.getCollection();return t.isSSR&&t.resetAfterSSR(),e},[t]),a=r(()=>(t.isSSR=!0,t.getCollection()),[t]);return{collection:ne(n,i,a),document:t}}const Q=t(null);function ie(e){var t;return t=class extends A{},t.type=e,t}function ae(t,n,a,o,s,c){typeof t==`string`&&(t=ie(t));let l=r(e=>{e?.setProps(n,a,t,o,c)},[n,a,o,c,t]),u=i(Q);if(u){let r=u.ownerDocument.nodesByProps.get(n);return r||(r=u.ownerDocument.createElement(t.type),r.setProps(n,a,t,o,c),u.appendChild(r),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,r)),s?e.createElement(Q.Provider,{value:r},s):null}return e.createElement(t.type,{ref:l},s)}function oe(t,r){let a=({node:e})=>r(e.props,e.props.ref,e),o=n((n,o)=>{let s=i(g);if(!i(q)){if(r.length>=3)throw Error(r.name+` cannot be rendered outside a collection.`);return r(n,o)}return ae(t,n,o,`children`in n?n.children:null,null,t=>e.createElement(g.Provider,{value:s},e.createElement(a,{node:t})))});return o.displayName=r.name,o}const se=t({}),ce=t({}),$=t(null);oe(N,function(t,n,r){let s=i($),{isLoading:c,onLoadMore:d,scrollOffset:f,...p}=t,h=o(null),g=a(()=>({onLoadMore:d,collection:s?.collection,sentinelRef:h,scrollOffset:f}),[d,f,s?.collection]);m(g,h);let v=C({...p,id:void 0,children:r.rendered,defaultClassName:`react-aria-ListBoxLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:u(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:h,style:{position:`absolute`,height:1,width:1}})),c&&v.children&&e.createElement(k.div,{..._(l(t,{global:!0}),{tabIndex:-1}),...v,role:`option`,ref:n},v.children))});const le=t(null),ue=t(null),de=n(function(t,n){return[t,n]=T(t,n,le),e.createElement($.Provider,{value:null},e.createElement(Y,{content:t.children},r=>e.createElement(fe,{props:t,forwardedRef:n,collection:r})))});function fe({props:t,forwardedRef:n,collection:r}){let i=o(null),{id:a,...s}=t;[s,i]=T(s,i,b);let{filter:c,shouldUseVirtualFocus:u,...d}=s,[f,p]=E(!t[`aria-label`]&&!t[`aria-labelledby`]),m=ee({...d,children:void 0,collection:r}),h=y(m,c),g=l(s,{global:!0}),_=Object.fromEntries(Object.entries(g).map(([e,t])=>[e,e===`id`?t:void 0])),{gridProps:x,labelProps:C,descriptionProps:w,errorMessageProps:D}=v({...d,..._,label:p},h,i);return e.createElement(k.div,{render:t.render,...g,id:a,ref:n,slot:t.slot||void 0,className:t.className??`react-aria-TagGroup`,style:t.style},e.createElement(S,{values:[[se,{...C,elementType:`span`,ref:f}],[ue,{...x,ref:i}],[$,h],[ce,{slots:{description:w,errorMessage:D}}]]},t.children))}export{de as TagGroup};
@@ -1 +1 @@
1
- import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useCallback as a,useContext as o,useMemo as s,useRef as c}from"react";import{filterDOMProps as l,inertValue as u,mergeProps as d,mergeRefs as f,useLayoutEffect as p,useLoadMoreSentinel as m,useObjectRef as h}from"@react-aria/utils";import{FocusableContext as g}from"@react-aria/interactions";import{createPortal as _}from"react-dom";import{mergeProps as v,useFocusRing as y}from"react-aria";import"react-stately";const b=Symbol(`default`);function x(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:c,render:l}=e;return s(()=>{let e,s,u;return e=typeof t==`function`?t({...c,defaultClassName:i}):t,s=typeof n==`function`?n({...c,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:a}):r??a,{className:e??i,style:s||o?{...o,...s}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,i,a,o,c,l])}function S(e,t){let n=o(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||b;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:`A slot prop is required.`;throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function C(e,t,n){let{ref:r,...i}=S(n,e.slot)||{},a=h(s(()=>f(t,r),[t,r])),o=d(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(o.style=typeof i.style==`function`||typeof e.style==`function`?t=>{let n=typeof i.style==`function`?i.style(t):i.style,r={...t.defaultStyle,...n},a=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...a}}:{...i.style,...e.style}),[o,a]}function w(t,n,r){let{render:i,...a}=n,o=c(null),l=s(()=>f(r,o),[r,o]);p(()=>{},[t,i]);let u={...a,ref:l};return i?i(u,void 0):e.createElement(t,u)}const T={},E=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=T[t];return n||(n=r(w.bind(null,t)),T[t]=n),n}});String(Math.round(Math.random()*1e10));const D=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement,e.useId;function O(){return!1}function k(){return!0}function A(e){return()=>{}}function ee(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore(A,O,k):o(D)}var j=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},M=class extends j{filter(e,t,n){let[r,i]=L(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},N=class extends j{};N.type=`header`;var P=class extends j{};P.type=`loader`;var F=class extends M{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};F.type=`item`;var I=class extends M{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};I.type=`section`;function L(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}function R(e){let{children:n,items:r,idScope:i,addIdAndValue:a,dependencies:o=[]}=e,c=s(()=>new WeakMap,o);return s(()=>{if(r&&typeof n==`function`){let e=[];for(let o of r){let r=c.get(o);if(!r){r=n(o);let e=r.props.id??o.key??o.id;if(e==null)throw Error(`Could not determine key for item`);i!=null&&(e=i+`:`+e),r=t(r,a?{key:e,id:e,value:o}:{key:e}),c.set(o,r)}e.push(r)}return e}if(typeof n!=`function`)return n},[n,r,c,i,a])}const z=n(!1),B=n(null);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const V=n(null);function H(e){var t;return t=class extends j{},t.type=e,t}function U(t,n,r,i,s,c){typeof t==`string`&&(t=H(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(V);if(u){let a=u.ownerDocument.nodesByProps.get(n);return a||(a=u.ownerDocument.createElement(t.type),a.setProps(n,r,t,i,c),u.appendChild(a),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,a)),s?e.createElement(V.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function W(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(g);if(!o(z)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return U(t,r,a,`children`in r?r.children:null,null,t=>e.createElement(g.Provider,{value:s},e.createElement(i,{node:t})))});return a.displayName=n.name,a}function G(e){return R({...e,addIdAndValue:!0})}const K=n(null);function q(t){let n=o(K),r=(n?.dependencies||[]).concat(t.dependencies),i=t.idScope??n?.idScope,a=G({...t,idScope:i,dependencies:r});return o(B)&&(a=e.createElement(J,null,a)),n=s(()=>({dependencies:r,idScope:i}),[i,...r]),e.createElement(K.Provider,{value:n},a)}function J({children:t}){let n=o(B),r=s(()=>e.createElement(B.Provider,{value:null},e.createElement(z.Provider,{value:!0},t)),[t]);return ee()?e.createElement(V.Provider,{value:n},r):_(r,n)}const Y={CollectionRoot({collection:e,renderDropIndicator:t}){return X(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return X(e,t,n)}};function X(t,n,r){return R({items:n?t.getChildren(n.key):t,dependencies:[r],children(n){let i=n.render(n);return!r||n.type!==`item`?i:e.createElement(e.Fragment,null,r({type:`item`,key:n.key,dropPosition:`before`}),i,Z(t,n,r))}})}function Z(e,n,r){let a=n.key,o=e.getKeyAfter(a),s=o==null?null:e.getItem(o);for(;s!=null&&s.type!==`item`;)o=e.getKeyAfter(s.key),s=o==null?null:e.getItem(o);let c=n.nextKey==null?null:e.getItem(n.nextKey);for(;c!=null&&c.type!==`item`;)c=c.nextKey==null?null:e.getItem(c.nextKey);let l=[];if(c==null){let a=n;for(;a?.type===`item`&&(!s||a.parentKey!==s.parentKey&&s.level<a.level);){let n=r({type:`item`,key:a.key,dropPosition:`after`});i(n)&&l.push(t(n,{key:`${a.key}-after`})),a=a.parentKey==null?null:e.getItem(a.parentKey)}}return l}const Q=n(Y);function te(e){return s(()=>e==null?null:new Set([e]),[e])}const ne=n(null);function re(t){let n=c({});return e.createElement(ne.Provider,{value:n},t.children)}const $=n(null);W(P,function(t,n,r){let i=o($),{isLoading:a,onLoadMore:d,scrollOffset:f,...p}=t,h=c(null),g=s(()=>({onLoadMore:d,collection:i?.collection,sentinelRef:h,scrollOffset:f}),[d,f,i?.collection]);m(g,h);let _=x({...p,id:void 0,children:r.rendered,defaultClassName:`react-aria-ListBoxLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:u(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:h,style:{position:`absolute`,height:1,width:1}})),a&&_.children&&e.createElement(E.div,{...v(l(t,{global:!0}),{tabIndex:-1}),..._,role:`option`,ref:n},_.children))});const ie=n(null),ae=r(function(t,n){return o($)?e.createElement(oe,{props:t,forwardedRef:n}):e.createElement(q,t)});function oe({props:t,forwardedRef:n}){let r=o($),{CollectionRoot:i}=o(Q),[a,s]=C({},n,ie),{focusProps:c,isFocused:u,isFocusVisible:f}=y(),p={isEmpty:r.collection.size===0,isFocused:u,isFocusVisible:f,state:r},m=x({...t,children:void 0,defaultClassName:`react-aria-TagList`,values:p}),h=te(r.selectionManager.focusedKey),g=l(t,{global:!0});return e.createElement(E.div,{...d(g,m,a,c),ref:s,"data-empty":r.collection.size===0||void 0,"data-focused":u||void 0,"data-focus-visible":f||void 0},e.createElement(re,null,r.collection.size===0&&t.renderEmptyState?t.renderEmptyState(p):e.createElement(i,{collection:r.collection,persistedKeys:h})))}export{ae as TagList};
1
+ import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useCallback as a,useContext as o,useMemo as s,useRef as c}from"react";import{filterDOMProps as l,inertValue as u,mergeProps as d,mergeRefs as f,useLayoutEffect as p,useLoadMoreSentinel as m,useObjectRef as h}from"@react-aria/utils";import{FocusableContext as g}from"@react-aria/interactions";import{createPortal as _}from"react-dom";import{mergeProps as v,useFocusRing as y}from"react-aria";import"react-stately";const b=Symbol(`default`);function x(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:c,render:l}=e;return s(()=>{let e,s,u;return e=typeof t==`function`?t({...c,defaultClassName:i}):t,s=typeof n==`function`?n({...c,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:a}):r??a,{className:e??i,style:s||o?{...o,...s}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,i,a,o,c,l])}function S(e,t){let n=o(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||b;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:`A slot prop is required.`;throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function C(e,t,n){let{ref:r,...i}=S(n,e.slot)||{},a=h(s(()=>f(t,r),[t,r])),o=d(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(o.style=typeof i.style==`function`||typeof e.style==`function`?t=>{let n=typeof i.style==`function`?i.style(t):i.style,r={...t.defaultStyle,...n},a=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...a}}:{...i.style,...e.style}),[o,a]}function w(t,n,r){let{render:i,...a}=n,o=c(null),l=s(()=>f(r,o),[r,o]);p(()=>{},[t,i]);let u={...a,ref:l};return i?i(u,void 0):e.createElement(t,u)}const T={},E=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=T[t];return n||(n=r(w.bind(null,t)),T[t]=n),n}});var D=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},O=class extends D{filter(e,t,n){let[r,i]=M(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},k=class extends D{};k.type=`header`;var A=class extends D{};A.type=`loader`;var j=class extends O{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};j.type=`item`;var ee=class extends O{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};ee.type=`section`;function M(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}function N(e){let{children:n,items:r,idScope:i,addIdAndValue:a,dependencies:o=[]}=e,c=s(()=>new WeakMap,o);return s(()=>{if(r&&typeof n==`function`){let e=[];for(let o of r){let r=c.get(o);if(!r){r=n(o);let e=r.props.id??o.key??o.id;if(e==null)throw Error(`Could not determine key for item`);i!=null&&(e=i+`:`+e),r=t(r,a?{key:e,id:e,value:o}:{key:e}),c.set(o,r)}e.push(r)}return e}if(typeof n!=`function`)return n},[n,r,c,i,a])}String(Math.round(Math.random()*1e10));const P=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement,e.useId;function F(){return!1}function I(){return!0}function L(e){return()=>{}}function R(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore(L,F,I):o(P)}const z=n(!1),B=n(null);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const V=n(null);function H(e){var t;return t=class extends D{},t.type=e,t}function U(t,n,r,i,s,c){typeof t==`string`&&(t=H(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(V);if(u){let a=u.ownerDocument.nodesByProps.get(n);return a||(a=u.ownerDocument.createElement(t.type),a.setProps(n,r,t,i,c),u.appendChild(a),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,a)),s?e.createElement(V.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function W(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(g);if(!o(z)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return U(t,r,a,`children`in r?r.children:null,null,t=>e.createElement(g.Provider,{value:s},e.createElement(i,{node:t})))});return a.displayName=n.name,a}function G(e){return N({...e,addIdAndValue:!0})}const K=n(null);function q(t){let n=o(K),r=(n?.dependencies||[]).concat(t.dependencies),i=t.idScope??n?.idScope,a=G({...t,idScope:i,dependencies:r});return o(B)&&(a=e.createElement(J,null,a)),n=s(()=>({dependencies:r,idScope:i}),[i,...r]),e.createElement(K.Provider,{value:n},a)}function J({children:t}){let n=o(B),r=s(()=>e.createElement(B.Provider,{value:null},e.createElement(z.Provider,{value:!0},t)),[t]);return R()?e.createElement(V.Provider,{value:n},r):_(r,n)}const Y={CollectionRoot({collection:e,renderDropIndicator:t}){return X(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return X(e,t,n)}};function X(t,n,r){return N({items:n?t.getChildren(n.key):t,dependencies:[r],children(n){let i=n.render(n);return!r||n.type!==`item`?i:e.createElement(e.Fragment,null,r({type:`item`,key:n.key,dropPosition:`before`}),i,Z(t,n,r))}})}function Z(e,n,r){let a=n.key,o=e.getKeyAfter(a),s=o==null?null:e.getItem(o);for(;s!=null&&s.type!==`item`;)o=e.getKeyAfter(s.key),s=o==null?null:e.getItem(o);let c=n.nextKey==null?null:e.getItem(n.nextKey);for(;c!=null&&c.type!==`item`;)c=c.nextKey==null?null:e.getItem(c.nextKey);let l=[];if(c==null){let a=n;for(;a?.type===`item`&&(!s||a.parentKey!==s.parentKey&&s.level<a.level);){let n=r({type:`item`,key:a.key,dropPosition:`after`});i(n)&&l.push(t(n,{key:`${a.key}-after`})),a=a.parentKey==null?null:e.getItem(a.parentKey)}}return l}const Q=n(Y);function te(e){return s(()=>e==null?null:new Set([e]),[e])}const ne=n(null);function re(t){let n=c({});return e.createElement(ne.Provider,{value:n},t.children)}const $=n(null);W(A,function(t,n,r){let i=o($),{isLoading:a,onLoadMore:d,scrollOffset:f,...p}=t,h=c(null),g=s(()=>({onLoadMore:d,collection:i?.collection,sentinelRef:h,scrollOffset:f}),[d,f,i?.collection]);m(g,h);let _=x({...p,id:void 0,children:r.rendered,defaultClassName:`react-aria-ListBoxLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:u(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:h,style:{position:`absolute`,height:1,width:1}})),a&&_.children&&e.createElement(E.div,{...v(l(t,{global:!0}),{tabIndex:-1}),..._,role:`option`,ref:n},_.children))});const ie=n(null),ae=r(function(t,n){return o($)?e.createElement(oe,{props:t,forwardedRef:n}):e.createElement(q,t)});function oe({props:t,forwardedRef:n}){let r=o($),{CollectionRoot:i}=o(Q),[a,s]=C({},n,ie),{focusProps:c,isFocused:u,isFocusVisible:f}=y(),p={isEmpty:r.collection.size===0,isFocused:u,isFocusVisible:f,state:r},m=x({...t,children:void 0,defaultClassName:`react-aria-TagList`,values:p}),h=te(r.selectionManager.focusedKey),g=l(t,{global:!0});return e.createElement(E.div,{...d(g,m,a,c),ref:s,"data-empty":r.collection.size===0||void 0,"data-focused":u||void 0,"data-focus-visible":f||void 0},e.createElement(re,null,r.collection.size===0&&t.renderEmptyState?t.renderEmptyState(p):e.createElement(i,{collection:r.collection,persistedKeys:h})))}export{ae as TagList};
@@ -1,2 +1,2 @@
1
- import { n as TagProps, t as Tag } from "../Tag-DUvBTljf.js";
1
+ import { n as TagProps, t as Tag } from "../Tag-BfmQ9BIV.js";
2
2
  export { Tag, TagProps };
@@ -1,2 +1,2 @@
1
- import { n as TextArea, r as TextAreaProps, t as ControlledTextAreaProps } from "../TextArea-B8Yvkkxr.js";
1
+ import { n as TextArea, r as TextAreaProps, t as ControlledTextAreaProps } from "../TextArea-CbZ9kNwo.js";
2
2
  export { ControlledTextAreaProps, TextArea, TextAreaProps };
@@ -1,2 +1,2 @@
1
- import { n as TextButtonProps, t as TextButton } from "../TextButton-cigitfeH.js";
1
+ import { n as TextButtonProps, t as TextButton } from "../TextButton-BZxhaNnh.js";
2
2
  export { TextButton, TextButtonProps };
@@ -1,2 +1,2 @@
1
- import { i as TextInputProps, n as TextInput, r as TextInputComponent, t as ControlledTextInputProps } from "../TextInput-Df0Pkuk-.js";
1
+ import { i as TextInputProps, n as TextInput, r as TextInputComponent, t as ControlledTextInputProps } from "../TextInput-ChVYCxjg.js";
2
2
  export { ControlledTextInputProps, TextInput, TextInputComponent, TextInputProps };
@@ -1,2 +1,2 @@
1
- import { n as TimePicker, r as TimePickerProps, t as ControlledTimePickerProps } from "../TimePicker-BcAaXiku.js";
1
+ import { n as TimePicker, r as TimePickerProps, t as ControlledTimePickerProps } from "../TimePicker-CMhURRER.js";
2
2
  export { type ControlledTimePickerProps, TimePicker, type TimePickerProps };
@@ -1 +1 @@
1
- import e,{createContext as t,forwardRef as n,useContext as r,useMemo as i,useRef as a}from"react";import{filterDOMProps as o,mergeRefs as s,useLayoutEffect as c,useObjectRef as l}from"@react-aria/utils";import"react-dom";import{mergeProps as u,useFocusRing as d,useToast as f}from"react-aria";import"react-stately";const p=Symbol(`default`);function m({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function h(e){let{className:t,style:n,children:r,defaultClassName:a,defaultChildren:o,defaultStyle:s,values:c,render:l}=e;return i(()=>{let e,i,u;return e=typeof t==`function`?t({...c,defaultClassName:a}):t,i=typeof n==`function`?n({...c,defaultStyle:s||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:o}):r??o,{className:e??a,style:i||s?{...s,...i}:void 0,children:u??o,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,a,o,s,c,l])}function g(t,n,r){let{render:o,...l}=n,u=a(null),d=i(()=>s(r,u),[r,u]);c(()=>{},[t,o]);let f={...l,ref:d};return o?o(f,void 0):e.createElement(t,f)}const _={},v=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let r=_[t];return r||(r=n(g.bind(null,t)),_[t]=r),r}}),y=t({}),b=t({}),x=t(null),S=n(function(t,n){let i=r(x),a=l(n),{toastProps:s,contentProps:c,titleProps:g,descriptionProps:_,closeButtonProps:S}=f(t,i,a),{focusProps:w,isFocused:T,isFocusVisible:E}=d(),D=h({...t,defaultClassName:`react-aria-Toast`,values:{toast:t.toast,isFocused:T,isFocusVisible:E}}),O=o(t,{global:!0});return e.createElement(v.div,{...u(O,D,s,w),ref:a,"data-focused":T||void 0,"data-focus-visible":E||void 0},e.createElement(m,{values:[[C,c],[b,{slots:{[p]:{},title:g,description:_}}],[y,{slots:{[p]:{},close:S}}]]},D.children))}),C=t({});export{S as UNSTABLE_Toast};
1
+ import e,{createContext as t,forwardRef as n,useContext as r,useMemo as i,useRef as a}from"react";import{filterDOMProps as o,mergeRefs as s,useLayoutEffect as c,useObjectRef as l}from"@react-aria/utils";import"@react-aria/overlays";import"react-dom";import{mergeProps as u,useFocusRing as d,useToast as f}from"react-aria";import"react-stately";const p=Symbol(`default`);function m({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function h(e){let{className:t,style:n,children:r,defaultClassName:a,defaultChildren:o,defaultStyle:s,values:c,render:l}=e;return i(()=>{let e,i,u;return e=typeof t==`function`?t({...c,defaultClassName:a}):t,i=typeof n==`function`?n({...c,defaultStyle:s||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:o}):r??o,{className:e??a,style:i||s?{...s,...i}:void 0,children:u??o,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,a,o,s,c,l])}function g(t,n,r){let{render:o,...l}=n,u=a(null),d=i(()=>s(r,u),[r,u]);c(()=>{},[t,o]);let f={...l,ref:d};return o?o(f,void 0):e.createElement(t,f)}const _={},v=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let r=_[t];return r||(r=n(g.bind(null,t)),_[t]=r),r}}),y=t({}),b=t({}),x=t(null),S=n(function(t,n){let i=r(x),a=l(n),{toastProps:s,contentProps:c,titleProps:g,descriptionProps:_,closeButtonProps:S}=f(t,i,a),{focusProps:w,isFocused:T,isFocusVisible:E}=d(),D=h({...t,defaultClassName:`react-aria-Toast`,values:{toast:t.toast,isFocused:T,isFocusVisible:E}}),O=o(t,{global:!0});return e.createElement(v.div,{...u(O,D,s,w),ref:a,"data-focused":T||void 0,"data-focus-visible":E||void 0},e.createElement(m,{values:[[C,c],[b,{slots:{[p]:{},title:g,description:_}}],[y,{slots:{[p]:{},close:S}}]]},D.children))}),C=t({});export{S as UNSTABLE_Toast};
@@ -1 +1 @@
1
- import e,{createContext as t,forwardRef as n,useContext as r,useMemo as i,useRef as a}from"react";import{mergeProps as o,mergeRefs as s,useLayoutEffect as c,useObjectRef as l}from"@react-aria/utils";import"react-dom";import"react-aria";import"react-stately";const u=Symbol(`default`);function d(e,t){let n=r(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||u;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:`A slot prop is required.`;throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function f(e,t,n){let{ref:r,...a}=d(n,e.slot)||{},c=l(i(()=>s(t,r),[t,r])),u=o(a,e);return`style`in a&&a.style&&`style`in e&&e.style&&(u.style=typeof a.style==`function`||typeof e.style==`function`?t=>{let n=typeof a.style==`function`?a.style(t):a.style,r={...t.defaultStyle,...n},i=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...i}}:{...a.style,...e.style}),[u,c]}function p(t,n,r){let{render:o,...l}=n,u=a(null),d=i(()=>s(r,u),[r,u]);c(()=>{},[t,o]);let f={...l,ref:d};return o?o(f,void 0):e.createElement(t,f)}const m={},h=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let r=m[t];return r||(r=n(p.bind(null,t)),m[t]=r),r}}),g=t({}),_=n(function(t,n){return[t,n]=f(t,n,g),e.createElement(h.div,{render:t.render,className:`react-aria-ToastContent`,...t,ref:n},t.children)});export{_ as UNSTABLE_ToastContent};
1
+ import e,{createContext as t,forwardRef as n,useContext as r,useMemo as i,useRef as a}from"react";import{mergeProps as o,mergeRefs as s,useLayoutEffect as c,useObjectRef as l}from"@react-aria/utils";import"@react-aria/overlays";import"react-dom";import"react-aria";import"react-stately";const u=Symbol(`default`);function d(e,t){let n=r(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||u;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:`A slot prop is required.`;throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function f(e,t,n){let{ref:r,...a}=d(n,e.slot)||{},c=l(i(()=>s(t,r),[t,r])),u=o(a,e);return`style`in a&&a.style&&`style`in e&&e.style&&(u.style=typeof a.style==`function`||typeof e.style==`function`?t=>{let n=typeof a.style==`function`?a.style(t):a.style,r={...t.defaultStyle,...n},i=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...i}}:{...a.style,...e.style}),[u,c]}function p(t,n,r){let{render:o,...l}=n,u=a(null),d=i(()=>s(r,u),[r,u]);c(()=>{},[t,o]);let f={...l,ref:d};return o?o(f,void 0):e.createElement(t,f)}const m={},h=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let r=m[t];return r||(r=n(p.bind(null,t)),m[t]=r),r}}),g=t({}),_=n(function(t,n){return[t,n]=f(t,n,g),e.createElement(h.div,{render:t.render,className:`react-aria-ToastContent`,...t,ref:n},t.children)});export{_ as UNSTABLE_ToastContent};
@@ -1 +1 @@
1
- import e,{createContext as t,forwardRef as n,useContext as r,useMemo as i,useRef as a}from"react";import{mergeRefs as o,useLayoutEffect as s}from"@react-aria/utils";import"react-dom";import{useHover as c}from"react-aria";import"react-stately";function l(e){let{className:t,style:n,children:r,defaultClassName:a,defaultChildren:o,defaultStyle:s,values:c,render:l}=e;return i(()=>{let e,i,u;return e=typeof t==`function`?t({...c,defaultClassName:a}):t,i=typeof n==`function`?n({...c,defaultStyle:s||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:o}):r??o,{className:e??a,style:i||s?{...s,...i}:void 0,children:u??o,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,a,o,s,c,l])}function u(t,n,r){let{render:c,...l}=n,u=a(null),d=i(()=>o(r,u),[r,u]);s(()=>{},[t,c]);let f={...l,ref:d};return c?c(f,void 0):e.createElement(t,f)}const d={},f=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let r=d[t];return r||(r=n(u.bind(null,t)),d[t]=r),r}}),p=t(null),m=n(function(t,n){let i=r(p),{hoverProps:a,isHovered:o}=c({}),s=l({...t,children:void 0,defaultClassName:`react-aria-ToastList`,values:{visibleToasts:i.visibleToasts,isFocused:!1,isFocusVisible:!1,isHovered:o}});return e.createElement(f.ol,{...a,...s,ref:n},i.visibleToasts.map(n=>e.createElement(`li`,{key:n.key,style:{display:`contents`}},t.children({toast:n}))))});export{m as UNSTABLE_ToastList};
1
+ import e,{createContext as t,forwardRef as n,useContext as r,useMemo as i,useRef as a}from"react";import{mergeRefs as o,useLayoutEffect as s}from"@react-aria/utils";import"@react-aria/overlays";import"react-dom";import{useHover as c}from"react-aria";import"react-stately";function l(e){let{className:t,style:n,children:r,defaultClassName:a,defaultChildren:o,defaultStyle:s,values:c,render:l}=e;return i(()=>{let e,i,u;return e=typeof t==`function`?t({...c,defaultClassName:a}):t,i=typeof n==`function`?n({...c,defaultStyle:s||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:o}):r??o,{className:e??a,style:i||s?{...s,...i}:void 0,children:u??o,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,a,o,s,c,l])}function u(t,n,r){let{render:c,...l}=n,u=a(null),d=i(()=>o(r,u),[r,u]);s(()=>{},[t,c]);let f={...l,ref:d};return c?c(f,void 0):e.createElement(t,f)}const d={},f=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let r=d[t];return r||(r=n(u.bind(null,t)),d[t]=r),r}}),p=t(null),m=n(function(t,n){let i=r(p),{hoverProps:a,isHovered:o}=c({}),s=l({...t,children:void 0,defaultClassName:`react-aria-ToastList`,values:{visibleToasts:i.visibleToasts,isFocused:!1,isFocusVisible:!1,isHovered:o}});return e.createElement(f.ol,{...a,...s,ref:n},i.visibleToasts.map(n=>e.createElement(`li`,{key:n.key,style:{display:`contents`}},t.children({toast:n}))))});export{m as UNSTABLE_ToastList};
@@ -1 +1 @@
1
- import e,{createContext as t,forwardRef as n,useContext as r,useMemo as i,useRef as a}from"react";import{filterDOMProps as o,mergeRefs as s,useLayoutEffect as c,useObjectRef as l}from"@react-aria/utils";import{createPortal as u}from"react-dom";import{mergeProps as d,useFocusRing as f,useHover as p,useLocale as m,useToastRegion as h}from"react-aria";import{useToastQueue as g}from"react-stately";function _(e){let{className:t,style:n,children:r,defaultClassName:a,defaultChildren:o,defaultStyle:s,values:c,render:l}=e;return i(()=>{let e,i,u;return e=typeof t==`function`?t({...c,defaultClassName:a}):t,i=typeof n==`function`?n({...c,defaultStyle:s||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:o}):r??o,{className:e??a,style:i||s?{...s,...i}:void 0,children:u??o,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,a,o,s,c,l])}function v(t,n,r){let{render:o,...l}=n,u=a(null),d=i(()=>s(r,u),[r,u]);c(()=>{},[t,o]);let f={...l,ref:d};return o?o(f,void 0):e.createElement(t,f)}const y={},b=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let r=y[t];return r||(r=n(v.bind(null,t)),y[t]=r),r}}),x=t({});function S(){return r(x)??{}}String(Math.round(Math.random()*1e10));const C=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement,e.useId;function w(){return!1}function T(){return!0}function E(e){return()=>{}}function D(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore(E,w,T):r(C)}const O=t(null),k=n(function(t,n){let r=D(),i=g(t.queue),a=l(n),{regionProps:s}=h(t,i,a),{focusProps:c,isFocused:v,isFocusVisible:y}=f(),{hoverProps:x,isHovered:C}=p({}),w=_({...t,children:void 0,defaultClassName:`react-aria-ToastRegion`,values:{visibleToasts:i.visibleToasts,isHovered:C,isFocused:v,isFocusVisible:y}}),{direction:T}=m(),E,{getContainer:k}=S();r||(E=document.body,k&&(E=k()));let j=o(t,{global:!0}),M=e.createElement(O.Provider,{value:i},e.createElement(b.div,{...d(j,w,s,c,x),dir:T,ref:a,"data-hovered":C||void 0,"data-focused":v||void 0,"data-focus-visible":y||void 0},typeof t.children==`function`?e.createElement(A,{...t,render:void 0,className:void 0,style:{display:`contents`}},t.children):t.children));return i.visibleToasts.length>0&&E?u(M,E):null}),A=n(function(t,n){let i=r(O),{hoverProps:a,isHovered:o}=p({}),s=_({...t,children:void 0,defaultClassName:`react-aria-ToastList`,values:{visibleToasts:i.visibleToasts,isFocused:!1,isFocusVisible:!1,isHovered:o}});return e.createElement(b.ol,{...a,...s,ref:n},i.visibleToasts.map(n=>e.createElement(`li`,{key:n.key,style:{display:`contents`}},t.children({toast:n}))))});export{k as UNSTABLE_ToastRegion};
1
+ import e,{createContext as t,forwardRef as n,useContext as r,useMemo as i,useRef as a}from"react";import{filterDOMProps as o,mergeRefs as s,useLayoutEffect as c,useObjectRef as l}from"@react-aria/utils";import{useUNSAFE_PortalContext as u}from"@react-aria/overlays";import{createPortal as d}from"react-dom";import{mergeProps as f,useFocusRing as p,useHover as m,useLocale as h,useToastRegion as g}from"react-aria";import{useToastQueue as _}from"react-stately";function v(e){let{className:t,style:n,children:r,defaultClassName:a,defaultChildren:o,defaultStyle:s,values:c,render:l}=e;return i(()=>{let e,i,u;return e=typeof t==`function`?t({...c,defaultClassName:a}):t,i=typeof n==`function`?n({...c,defaultStyle:s||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:o}):r??o,{className:e??a,style:i||s?{...s,...i}:void 0,children:u??o,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,a,o,s,c,l])}function y(t,n,r){let{render:o,...l}=n,u=a(null),d=i(()=>s(r,u),[r,u]);c(()=>{},[t,o]);let f={...l,ref:d};return o?o(f,void 0):e.createElement(t,f)}const b={},x=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let r=b[t];return r||(r=n(y.bind(null,t)),b[t]=r),r}});String(Math.round(Math.random()*1e10));const S=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement,e.useId;function C(){return!1}function w(){return!0}function T(e){return()=>{}}function E(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore(T,C,w):r(S)}const D=t(null),O=n(function(t,n){let r=E(),i=_(t.queue),a=l(n),{regionProps:s}=g(t,i,a),{focusProps:c,isFocused:y,isFocusVisible:b}=p(),{hoverProps:S,isHovered:C}=m({}),w=v({...t,children:void 0,defaultClassName:`react-aria-ToastRegion`,values:{visibleToasts:i.visibleToasts,isHovered:C,isFocused:y,isFocusVisible:b}}),{direction:T}=h(),O,{getContainer:A}=u();r||(O=document.body,A&&(O=A()));let j=o(t,{global:!0}),M=e.createElement(D.Provider,{value:i},e.createElement(x.div,{...f(j,w,s,c,S),dir:T,ref:a,"data-hovered":C||void 0,"data-focused":y||void 0,"data-focus-visible":b||void 0},typeof t.children==`function`?e.createElement(k,{...t,render:void 0,className:void 0,style:{display:`contents`}},t.children):t.children));return i.visibleToasts.length>0&&O?d(M,O):null}),k=n(function(t,n){let i=r(D),{hoverProps:a,isHovered:o}=m({}),s=v({...t,children:void 0,defaultClassName:`react-aria-ToastList`,values:{visibleToasts:i.visibleToasts,isFocused:!1,isFocusVisible:!1,isHovered:o}});return e.createElement(x.ol,{...a,...s,ref:n},i.visibleToasts.map(n=>e.createElement(`li`,{key:n.key,style:{display:`contents`}},t.children({toast:n}))))});export{O as UNSTABLE_ToastRegion};
@@ -1,2 +1,2 @@
1
- import { n as ToggleButtonProps, t as ToggleButton } from "../ToggleButton-3lINwoaV.js";
1
+ import { n as ToggleButtonProps, t as ToggleButton } from "../ToggleButton-DRTGhnjR.js";
2
2
  export { ToggleButton, ToggleButtonProps };
@@ -1,2 +1,2 @@
1
- import { n as Toggle, r as ToggleProps, t as ControlledToggleProps } from "../Toggle-Ca_t66zh.js";
1
+ import { n as Toggle, r as ToggleProps, t as ControlledToggleProps } from "../Toggle-pQ0-MbwL.js";
2
2
  export { ControlledToggleProps, Toggle, ToggleProps };
@@ -1 +1 @@
1
- import e,{createContext as t,forwardRef as n,useContext as r,useMemo as i,useRef as a,useState as o}from"react";import{filterDOMProps as s,mergeProps as c,mergeRefs as l,nodeContains as u,useLayoutEffect as d,useObjectRef as f}from"@react-aria/utils";import{useLocale as p}from"@react-aria/i18n";import{createFocusManager as m}from"@react-aria/focus";const h=Symbol(`default`);function g(e){let{className:t,style:n,children:r,defaultClassName:a,defaultChildren:o,defaultStyle:s,values:c,render:l}=e;return i(()=>{let e,i,u;return e=typeof t==`function`?t({...c,defaultClassName:a}):t,i=typeof n==`function`?n({...c,defaultStyle:s||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:o}):r??o,{className:e??a,style:i||s?{...s,...i}:void 0,children:u??o,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,a,o,s,c,l])}function _(e,t){let n=r(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||h;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:`A slot prop is required.`;throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function v(e,t,n){let{ref:r,...a}=_(n,e.slot)||{},o=f(i(()=>l(t,r),[t,r])),s=c(a,e);return`style`in a&&a.style&&`style`in e&&e.style&&(s.style=typeof a.style==`function`||typeof e.style==`function`?t=>{let n=typeof a.style==`function`?a.style(t):a.style,r={...t.defaultStyle,...n},i=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...i}}:{...a.style,...e.style}),[s,o]}function y(t,n,r){let{render:o,...s}=n,c=a(null),u=i(()=>l(r,c),[r,c]);d(()=>{},[t,o]);let f={...s,ref:u};return o?o(f,void 0):e.createElement(t,f)}const b={},x=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let r=b[t];return r||(r=n(y.bind(null,t)),b[t]=r),r}});function S(e,t){let{"aria-label":n,"aria-labelledby":r,orientation:i=`horizontal`}=e,[c,l]=o(!1);d(()=>{l(!!(t.current&&t.current.parentElement?.closest(`[role="toolbar"]`)))});let{direction:f}=p(),h=f===`rtl`&&i===`horizontal`,g=m(t),_=e=>{if(u(e.currentTarget,e.target)){if(i===`horizontal`&&e.key===`ArrowRight`||i===`vertical`&&e.key===`ArrowDown`)h?g.focusPrevious():g.focusNext();else if(i===`horizontal`&&e.key===`ArrowLeft`||i===`vertical`&&e.key===`ArrowUp`)h?g.focusNext():g.focusPrevious();else if(e.key===`Tab`){e.stopPropagation(),v.current=document.activeElement,e.shiftKey?g.focusFirst():g.focusLast();return}else return;e.stopPropagation(),e.preventDefault()}},v=a(null),y=e=>{!u(e.currentTarget,e.relatedTarget)&&!v.current&&(v.current=e.target)},b=e=>{if(v.current&&!u(e.currentTarget,e.relatedTarget)&&u(t.current,e.target)){var n;(n=v.current)==null||n.focus(),v.current=null}};return{toolbarProps:{...s(e,{labelable:!0}),role:c?`group`:`toolbar`,"aria-orientation":i,"aria-label":n,"aria-labelledby":n==null?r:void 0,onKeyDownCapture:c?void 0:_,onFocusCapture:c?void 0:b,onBlurCapture:c?void 0:y}}}const C=t({}),w=n(function(t,n){[t,n]=v(t,n,C);let{toolbarProps:r}=S(t,n),i=g({...t,values:{orientation:t.orientation||`horizontal`},defaultClassName:`react-aria-Toolbar`}),a=s(t,{global:!0});return delete a.id,e.createElement(x.div,{...c(a,i,r),ref:n,slot:t.slot||void 0,"data-orientation":t.orientation||`horizontal`},i.children)});export{w as Toolbar};
1
+ import e,{createContext as t,forwardRef as n,useContext as r,useMemo as i,useRef as a,useState as o}from"react";import{filterDOMProps as s,mergeProps as c,mergeRefs as l,nodeContains as u,useLayoutEffect as d,useObjectRef as f}from"@react-aria/utils";import{createFocusManager as p}from"@react-aria/focus";import{useLocale as m}from"@react-aria/i18n";const h=Symbol(`default`);function g(e){let{className:t,style:n,children:r,defaultClassName:a,defaultChildren:o,defaultStyle:s,values:c,render:l}=e;return i(()=>{let e,i,u;return e=typeof t==`function`?t({...c,defaultClassName:a}):t,i=typeof n==`function`?n({...c,defaultStyle:s||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:o}):r??o,{className:e??a,style:i||s?{...s,...i}:void 0,children:u??o,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,a,o,s,c,l])}function _(e,t){let n=r(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||h;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:`A slot prop is required.`;throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function v(e,t,n){let{ref:r,...a}=_(n,e.slot)||{},o=f(i(()=>l(t,r),[t,r])),s=c(a,e);return`style`in a&&a.style&&`style`in e&&e.style&&(s.style=typeof a.style==`function`||typeof e.style==`function`?t=>{let n=typeof a.style==`function`?a.style(t):a.style,r={...t.defaultStyle,...n},i=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...i}}:{...a.style,...e.style}),[s,o]}function y(t,n,r){let{render:o,...s}=n,c=a(null),u=i(()=>l(r,c),[r,c]);d(()=>{},[t,o]);let f={...s,ref:u};return o?o(f,void 0):e.createElement(t,f)}const b={},x=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let r=b[t];return r||(r=n(y.bind(null,t)),b[t]=r),r}});function S(e,t){let{"aria-label":n,"aria-labelledby":r,orientation:i=`horizontal`}=e,[c,l]=o(!1);d(()=>{l(!!(t.current&&t.current.parentElement?.closest(`[role="toolbar"]`)))});let{direction:f}=m(),h=f===`rtl`&&i===`horizontal`,g=p(t),_=e=>{if(u(e.currentTarget,e.target)){if(i===`horizontal`&&e.key===`ArrowRight`||i===`vertical`&&e.key===`ArrowDown`)h?g.focusPrevious():g.focusNext();else if(i===`horizontal`&&e.key===`ArrowLeft`||i===`vertical`&&e.key===`ArrowUp`)h?g.focusNext():g.focusPrevious();else if(e.key===`Tab`){e.stopPropagation(),v.current=document.activeElement,e.shiftKey?g.focusFirst():g.focusLast();return}else return;e.stopPropagation(),e.preventDefault()}},v=a(null),y=e=>{!u(e.currentTarget,e.relatedTarget)&&!v.current&&(v.current=e.target)},b=e=>{if(v.current&&!u(e.currentTarget,e.relatedTarget)&&u(t.current,e.target)){var n;(n=v.current)==null||n.focus(),v.current=null}};return{toolbarProps:{...s(e,{labelable:!0}),role:c?`group`:`toolbar`,"aria-orientation":i,"aria-label":n,"aria-labelledby":n==null?r:void 0,onKeyDownCapture:c?void 0:_,onFocusCapture:c?void 0:b,onBlurCapture:c?void 0:y}}}const C=t({}),w=n(function(t,n){[t,n]=v(t,n,C);let{toolbarProps:r}=S(t,n),i=g({...t,values:{orientation:t.orientation||`horizontal`},defaultClassName:`react-aria-Toolbar`}),a=s(t,{global:!0});return delete a.id,e.createElement(x.div,{...c(a,i,r),ref:n,slot:t.slot||void 0,"data-orientation":t.orientation||`horizontal`},i.children)});export{w as Toolbar};
@@ -1,2 +1,2 @@
1
- import { n as TooltipProps, t as Tooltip } from "../Tooltip-D1oFPqFF.js";
1
+ import { n as TooltipProps, t as Tooltip } from "../Tooltip-BxixKjWm.js";
2
2
  export { Tooltip, TooltipProps };
@@ -1 +1 @@
1
- import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useCallback as a,useContext as o,useEffect as s,useMemo as c,useReducer as l,useRef as u,useState as d,useSyncExternalStore as f}from"react";import{filterDOMProps as p,inertValue as m,mergeProps as h,mergeRefs as g,useLayoutEffect as _,useLoadMoreSentinel as v,useObjectRef as y}from"@react-aria/utils";import{FocusableContext as b}from"@react-aria/interactions";import{createPortal as x}from"react-dom";import{FocusScope as S,ListKeyboardDelegate as C,mergeProps as w,useCollator as T,useFocusRing as ee,useLocale as te,useTree as ne,useTreeItem as E,useVisuallyHidden as D}from"react-aria";import{useTreeState as re}from"react-stately";const O=Symbol(`default`);function ie({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function k(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:s,render:l}=e;return c(()=>{let e,c,u;return e=typeof t==`function`?t({...s,defaultClassName:i}):t,c=typeof n==`function`?n({...s,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...s,defaultChildren:a}):r??a,{className:e??i,style:c||o?{...o,...c}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,s):void 0}},[t,n,r,i,a,o,s,l])}function ae(e,t){let n=o(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||O;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:`A slot prop is required.`;throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function A(e,t,n){let{ref:r,...i}=ae(n,e.slot)||{},a=y(c(()=>g(t,r),[t,r])),o=h(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(o.style=typeof i.style==`function`||typeof e.style==`function`?t=>{let n=typeof i.style==`function`?i.style(t):i.style,r={...t.defaultStyle,...n},a=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...a}}:{...i.style,...e.style}),[o,a]}function j(t,n,r){let{render:i,...a}=n,o=u(null),s=c(()=>g(r,o),[r,o]);_(()=>{},[t,i]);let l={...a,ref:s};return i?i(l,void 0):e.createElement(t,l)}const M={},N=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=M[t];return n||(n=r(j.bind(null,t)),M[t]=n),n}});String(Math.round(Math.random()*1e10));const P=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement,e.useId;function F(){return!1}function I(){return!0}function L(e){return()=>{}}function R(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore(L,F,I):o(P)}const z=typeof document<`u`?e.useInsertionEffect??e.useLayoutEffect:()=>{};function oe(e,t,n){let[r,i]=d(e||t),o=u(r),c=u(e!==void 0),f=e!==void 0;s(()=>{c.current,c.current=f},[f]);let p=f?e:r;z(()=>{o.current=p});let[,m]=l(()=>({}),{});return[p,a((e,...t)=>{let r=typeof e==`function`?e(o.current):e;Object.is(o.current,r)||(o.current=r,i(r),m(),n?.(r,...t))},[n])]}var B=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},V=class extends B{filter(e,t,n){let[r,i]=q(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},H=class extends B{};H.type=`header`;var U=class extends B{};U.type=`loader`;var W=class extends V{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};W.type=`item`;var G=class extends V{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};G.type=`section`;var K=class{get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}*[Symbol.iterator](){let e=this.firstKey==null?void 0:this.keyMap.get(this.firstKey);for(;e;)yield e,e=e.nextKey==null?void 0:this.keyMap.get(e.nextKey)}getChildren(e){let t=this.keyMap;return{*[Symbol.iterator](){let n=t.get(e),r=n?.firstChildKey==null?null:t.get(n.firstChildKey);for(;r;)yield r,r=r.nextKey==null?void 0:t.get(r.nextKey)}}}getKeyBefore(e){let t=this.keyMap.get(e);if(!t)return null;if(t.prevKey!=null){for(t=this.keyMap.get(t.prevKey);t&&t.type!==`item`&&t.lastChildKey!=null;)t=this.keyMap.get(t.lastChildKey);return t?.key??null}return t.parentKey}getKeyAfter(e){let t=this.keyMap.get(e);if(!t)return null;if(t.type!==`item`&&t.firstChildKey!=null)return t.firstChildKey;for(;t;){if(t.nextKey!=null)return t.nextKey;if(t.parentKey!=null)t=this.keyMap.get(t.parentKey);else return null}return null}getFirstKey(){return this.firstKey}getLastKey(){let e=this.lastKey==null?null:this.keyMap.get(this.lastKey);for(;e?.lastChildKey!=null;)e=this.keyMap.get(e.lastChildKey);return e?.key??null}getItem(e){return this.keyMap.get(e)??null}at(){throw Error(`Not implemented`)}clone(){let e=this.constructor,t=new e;return t.keyMap=new Map(this.keyMap),t.firstKey=this.firstKey,t.lastKey=this.lastKey,t.itemCount=this.itemCount,t}addNode(e){if(this.frozen)throw Error(`Cannot add a node to a frozen collection`);e.type===`item`&&this.keyMap.get(e.key)==null&&this.itemCount++,this.keyMap.set(e.key,e)}addDescendants(e,t){this.addNode(e);let n=t.getChildren(e.key);for(let e of n)this.addDescendants(e,t)}removeNode(e){if(this.frozen)throw Error(`Cannot remove a node to a frozen collection`);let t=this.keyMap.get(e);t!=null&&t.type===`item`&&this.itemCount--,this.keyMap.delete(e)}commit(e,t,n=!1){if(this.frozen)throw Error(`Cannot commit a frozen collection`);this.firstKey=e,this.lastKey=t,this.frozen=!n}filter(e){let t=new this.constructor,[n,r]=q(this,t,this.firstKey,e);return t?.commit(n,r),t}constructor(){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.frozen=!1,this.itemCount=0}};function q(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}var J=class{*[Symbol.iterator](){let e=this.firstChild;for(;e;)yield e,e=e.nextSibling}get firstChild(){return this._firstChild}set firstChild(e){this._firstChild=e,this.ownerDocument.markDirty(this)}get lastChild(){return this._lastChild}set lastChild(e){this._lastChild=e,this.ownerDocument.markDirty(this)}get previousSibling(){return this._previousSibling}set previousSibling(e){this._previousSibling=e,this.ownerDocument.markDirty(this)}get nextSibling(){return this._nextSibling}set nextSibling(e){this._nextSibling=e,this.ownerDocument.markDirty(this)}get parentNode(){return this._parentNode}set parentNode(e){this._parentNode=e,this.ownerDocument.markDirty(this)}get isConnected(){return this.parentNode?.isConnected||!1}invalidateChildIndices(e){(this._minInvalidChildIndex==null||!this._minInvalidChildIndex.isConnected||e.index<this._minInvalidChildIndex.index)&&(this._minInvalidChildIndex=e,this.ownerDocument.markDirty(this))}updateChildIndices(){let e=this._minInvalidChildIndex;for(;e;)e.index=e.previousSibling?e.previousSibling.index+1:0,e=e.nextSibling;this._minInvalidChildIndex=null}appendChild(e){e.parentNode&&e.parentNode.removeChild(e),this.firstChild??=e,this.lastChild?(this.lastChild.nextSibling=e,e.index=this.lastChild.index+1,e.previousSibling=this.lastChild):(e.previousSibling=null,e.index=0),e.parentNode=this,e.nextSibling=null,this.lastChild=e,this.ownerDocument.markDirty(this),this.isConnected&&this.ownerDocument.queueUpdate()}insertBefore(e,t){if(t==null)return this.appendChild(e);e.parentNode&&e.parentNode.removeChild(e),e.nextSibling=t,e.previousSibling=t.previousSibling,e.index=t.index-1,this.firstChild===t?this.firstChild=e:t.previousSibling&&(t.previousSibling.nextSibling=e),t.previousSibling=e,e.parentNode=t.parentNode,this.invalidateChildIndices(e),this.isConnected&&this.ownerDocument.queueUpdate()}removeChild(e){e.parentNode===this&&(this._minInvalidChildIndex===e&&(this._minInvalidChildIndex=null),e.nextSibling&&(this.invalidateChildIndices(e.nextSibling),e.nextSibling.previousSibling=e.previousSibling),e.previousSibling&&(e.previousSibling.nextSibling=e.nextSibling),this.firstChild===e&&(this.firstChild=e.nextSibling),this.lastChild===e&&(this.lastChild=e.previousSibling),e.parentNode=null,e.nextSibling=null,e.previousSibling=null,e.index=0,this.ownerDocument.markDirty(e),this.isConnected&&this.ownerDocument.queueUpdate())}addEventListener(){}removeEventListener(){}get previousVisibleSibling(){let e=this.previousSibling;for(;e&&e.isHidden;)e=e.previousSibling;return e}get nextVisibleSibling(){let e=this.nextSibling;for(;e&&e.isHidden;)e=e.nextSibling;return e}get firstVisibleChild(){let e=this.firstChild;for(;e&&e.isHidden;)e=e.nextSibling;return e}get lastVisibleChild(){let e=this.lastChild;for(;e&&e.isHidden;)e=e.previousSibling;return e}constructor(e){this._firstChild=null,this._lastChild=null,this._previousSibling=null,this._nextSibling=null,this._parentNode=null,this._minInvalidChildIndex=null,this.ownerDocument=e}},Y=class e extends J{get index(){return this._index}set index(e){this._index=e,this.ownerDocument.markDirty(this)}get level(){return this.parentNode instanceof e?this.parentNode.level+ +(this.node?.type===`item`):0}getMutableNode(){return this.node==null?null:(this.isMutated||=(this.node=this.node.clone(),!0),this.ownerDocument.markDirty(this),this.node)}updateNode(){let t=this.nextVisibleSibling,n=this.getMutableNode();if(n!=null&&(n.index=this.index,n.level=this.level,n.parentKey=this.parentNode instanceof e?this.parentNode.node?.key??null:null,n.prevKey=this.previousVisibleSibling?.node?.key??null,n.nextKey=t?.node?.key??null,n.hasChildNodes=!!this.firstChild,n.firstChildKey=this.firstVisibleChild?.node?.key??null,n.lastChildKey=this.lastVisibleChild?.node?.key??null,(n.colSpan!=null||n.colIndex!=null)&&t)){let e=(n.colIndex??n.index)+(n.colSpan??1);if(t.node!=null&&e!==t.node.colIndex){let n=t.getMutableNode();n.colIndex=e}}}setProps(e,t,n,r,i){let a,{value:o,textValue:s,id:c,...l}=e;if(this.node==null?(a=new n(c??`react-aria-${++this.ownerDocument.nodeId}`),this.node=a):a=this.getMutableNode(),l.ref=t,a.props=l,a.rendered=r,a.render=i,a.value=o,e[`aria-label`]&&(a[`aria-label`]=e[`aria-label`]),a.textValue=s||(typeof l.children==`string`?l.children:``)||e[`aria-label`]||``,c!=null&&c!==a.key)throw Error(`Cannot change the id of an item`);l.colSpan!=null&&(a.colSpan=l.colSpan),this.isConnected&&this.ownerDocument.queueUpdate()}get style(){let e=this;return{get display(){return e.isHidden?`none`:``},set display(t){let n=t===`none`;if(e.isHidden!==n){(e.parentNode?.firstVisibleChild===e||e.parentNode?.lastVisibleChild===e)&&e.ownerDocument.markDirty(e.parentNode);let t=e.previousVisibleSibling,r=e.nextVisibleSibling;t&&e.ownerDocument.markDirty(t),r&&e.ownerDocument.markDirty(r),e.isHidden=n,e.ownerDocument.markDirty(e)}}}}hasAttribute(){}setAttribute(){}setAttributeNS(){}removeAttribute(){}constructor(e,t){super(t),this.nodeType=8,this.isMutated=!0,this._index=0,this.isHidden=!1,this.node=null}},X=class extends J{get isConnected(){return!0}createElement(e){return new Y(e,this)}getMutableCollection(){return this.nextCollection||=this.collection.clone(),this.nextCollection}markDirty(e){this.dirtyNodes.add(e)}addNode(e){if(e.isHidden||e.node==null)return;let t=this.getMutableCollection();if(!t.getItem(e.node.key))for(let t of e)this.addNode(t);t.addNode(e.node)}removeNode(e){for(let t of e)this.removeNode(t);e.node&&this.getMutableCollection().removeNode(e.node.key)}getCollection(){return this.inSubscription?this.collection.clone():(this.queuedRender=!1,this.updateCollection(),this.collection)}updateCollection(){for(let e of this.dirtyNodes)e instanceof Y&&(!e.isConnected||e.isHidden)?this.removeNode(e):e.updateChildIndices();for(let e of this.dirtyNodes)e instanceof Y?(e.isConnected&&!e.isHidden&&(e.updateNode(),this.addNode(e)),e.node&&this.dirtyNodes.delete(e),e.isMutated=!1):this.dirtyNodes.delete(e);this.nextCollection&&(this.nextCollection.commit(this.firstVisibleChild?.node?.key??null,this.lastVisibleChild?.node?.key??null,this.isSSR),this.isSSR||(this.collection=this.nextCollection,this.nextCollection=null))}queueUpdate(){if(!(this.dirtyNodes.size===0||this.queuedRender)){this.queuedRender=!0,this.inSubscription=!0;for(let e of this.subscriptions)e();this.inSubscription=!1}}subscribe(e){return this.subscriptions.add(e),()=>this.subscriptions.delete(e)}resetAfterSSR(){this.isSSR&&(this.isSSR=!1,this.firstChild=null,this.lastChild=null,this.nodeId=0)}constructor(e){super(null),this.nodeType=11,this.ownerDocument=this,this.dirtyNodes=new Set,this.isSSR=!1,this.nodeId=0,this.nodesByProps=new WeakMap,this.nextCollection=null,this.subscriptions=new Set,this.queuedRender=!1,this.inSubscription=!1,this.collection=e,this.nextCollection=e}};function se(e){let{children:n,items:r,idScope:i,addIdAndValue:a,dependencies:o=[]}=e,s=c(()=>new WeakMap,o);return c(()=>{if(r&&typeof n==`function`){let e=[];for(let o of r){let r=s.get(o);if(!r){r=n(o);let e=r.props.id??o.key??o.id;if(e==null)throw Error(`Could not determine key for item`);i!=null&&(e=i+`:`+e),r=t(r,a?{key:e,id:e,value:o}:{key:e}),s.set(o,r)}e.push(r)}return e}if(typeof n!=`function`)return n},[n,r,s,i,a])}if(typeof HTMLTemplateElement<`u`){let e=Object.getOwnPropertyDescriptor(Node.prototype,`firstChild`).get;Object.defineProperty(HTMLTemplateElement.prototype,"firstChild",{configurable:!0,enumerable:!0,get:function(){return this.dataset.reactAriaHidden?this.content.firstChild:e.call(this)}})}const ce=n(!1);function le(t){if(o(ce))return e.createElement(e.Fragment,null,t.children);let n=e.createElement(ce.Provider,{value:!0},t.children);return e.createElement(`template`,{"data-react-aria-hidden":!0},n)}const ue=n(!1),Z=n(null);function de(t){if(o(Z))return t.content;let{collection:n,document:r}=he(t.createCollection);return e.createElement(e.Fragment,null,e.createElement(le,null,e.createElement(Z.Provider,{value:r},t.content)),e.createElement(fe,{render:t.children,collection:n}))}function fe({collection:e,render:t}){return t(e)}function pe(e,t,n){let r=R(),i=u(r);i.current=r;let o=a(()=>i.current?n():t(),[t,n]);return f(e,o)}const me=typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore:pe;function he(e){let[t]=d(()=>new X(e?.()||new K)),n=a(e=>t.subscribe(e),[t]),r=a(()=>{let e=t.getCollection();return t.isSSR&&t.resetAfterSSR(),e},[t]),i=a(()=>(t.isSSR=!0,t.getCollection()),[t]);return{collection:me(n,r,i),document:t}}const Q=n(null);function ge(e){var t;return t=class extends B{},t.type=e,t}function _e(t,n,r,i,s,c){typeof t==`string`&&(t=ge(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(Q);if(u){let a=u.ownerDocument.nodesByProps.get(n);return a||(a=u.ownerDocument.createElement(t.type),a.setProps(n,r,t,i,c),u.appendChild(a),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,a)),s?e.createElement(Q.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function ve(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(b);if(!o(ue)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return _e(t,r,a,`children`in r?r.children:null,null,t=>e.createElement(b.Provider,{value:s},e.createElement(i,{node:t})))});return a.displayName=n.name,a}function ye(e){return se({...e,addIdAndValue:!0})}const be=n(null);function xe(t){let n=o(be),r=(n?.dependencies||[]).concat(t.dependencies),i=t.idScope??n?.idScope,a=ye({...t,idScope:i,dependencies:r});return o(Z)&&(a=e.createElement(Se,null,a)),n=c(()=>({dependencies:r,idScope:i}),[i,...r]),e.createElement(be.Provider,{value:n},a)}function Se({children:t}){let n=o(Z),r=c(()=>e.createElement(Z.Provider,{value:null},e.createElement(ue.Provider,{value:!0},t)),[t]);return R()?e.createElement(Q.Provider,{value:n},r):x(r,n)}const Ce={CollectionRoot({collection:e,renderDropIndicator:t}){return we(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return we(e,t,n)}};function we(t,n,r){return se({items:n?t.getChildren(n.key):t,dependencies:[r],children(n){let i=n.render(n);return!r||n.type!==`item`?i:e.createElement(e.Fragment,null,r({type:`item`,key:n.key,dropPosition:`before`}),i,Te(t,n,r))}})}function Te(e,n,r){let a=n.key,o=e.getKeyAfter(a),s=o==null?null:e.getItem(o);for(;s!=null&&s.type!==`item`;)o=e.getKeyAfter(s.key),s=o==null?null:e.getItem(o);let c=n.nextKey==null?null:e.getItem(n.nextKey);for(;c!=null&&c.type!==`item`;)c=c.nextKey==null?null:e.getItem(c.nextKey);let l=[];if(c==null){let a=n;for(;a?.type===`item`&&(!s||a.parentKey!==s.parentKey&&s.level<a.level);){let n=r({type:`item`,key:a.key,dropPosition:`after`});i(n)&&l.push(t(n,{key:`${a.key}-after`})),a=a.parentKey==null?null:e.getItem(a.parentKey)}}return l}const Ee=n(Ce),$=n({}),De=n(null),Oe=r(function(t,n){let{render:r}=o(De);return e.createElement(e.Fragment,null,r(t,n))});function ke(t,n){let r=t?.renderDropIndicator,i=t?.isVirtualDragging?.call(t),o=a(t=>{if(i||n?.isDropTarget(t))return r?r(t):e.createElement(Oe,{target:t})},[n?.target,i,r]);return t?.useDropIndicator?o:void 0}function Ae(e,t,n){let r=e.focusedKey,i=null;if(t!=null&&t.isVirtualDragging?.call(t)&&n?.target?.type===`item`&&(i=n.target.key,n.target.dropPosition===`after`)){let e=n.collection.getKeyAfter(i),t=null;if(e!=null){let r=n.collection.getItem(i)?.level??0;for(;e;){let i=n.collection.getItem(e);if(!i)break;if(i.type!==`item`){e=n.collection.getKeyAfter(e);continue}if((i.level??0)<=r)break;t=e,e=n.collection.getKeyAfter(e)}}i=e??t??i}return c(()=>new Set([r,i].filter(e=>e!=null)),[r,i])}const je=n(null);function Me(t){let n=u({});return e.createElement(je.Provider,{value:n},t.children)}var Ne=class{setup(e,t,n){this.delegate=e,this.state=t,this.direction=n}getDropTargetFromPoint(e,t,n){let r=this.delegate.getDropTargetFromPoint(e,t,n);return!r||r.type===`root`?r:this.resolveDropTarget(r,e,t,n)}resolveDropTarget(e,t,n,r){let i=this.pointerTracking,a=n-i.lastY,o=t-i.lastX,s=i.yDirection,c=i.xDirection;if(Math.abs(a)>5&&(s=a>0?`down`:`up`,i.yDirection=s,i.lastY=n),Math.abs(o)>10&&(c=o>0?`right`:`left`,i.xDirection=c,i.lastX=t),e.dropPosition===`before`){let t=this.state.collection.getKeyBefore(e.key);if(t!=null){let n={type:`item`,key:t,dropPosition:`after`};r(n)&&(e=n)}}let l=this.getPotentialTargets(e,r);if(l.length===0)return{type:`root`};let u;return l.length>1?u=this.selectTarget(l,e,t,n,s,c):(u=l[0],i.boundaryContext=null),u}getPotentialTargets(e,t){if(e.dropPosition===`on`)return[e];let n=e,r=this.state.collection,i=r.getItem(n.key);for(;i&&i?.type!==`item`&&i.nextKey!=null;)n.key=i.nextKey,i=r.getItem(i.nextKey);let a=[n];if(i&&i.hasChildNodes&&this.state.expandedKeys.has(i.key)&&r.getChildren&&n.dropPosition===`after`){let e=null;for(let t of r.getChildren(i.key))if(t.type===`item`){e=t;break}if(e){let n={type:`item`,key:e.key,dropPosition:`before`};return t(n)?[n]:[]}}if(i?.nextKey!=null)return[e];let o=i?.parentKey,s=[];for(;o;){let e=r.getItem(o),n=e?.nextKey?r.getItem(e.nextKey):null;if(!n||n.parentKey!==o){let e={type:`item`,key:o,dropPosition:`after`};if(t(e)&&s.push(e),n)break}o=e?.parentKey}if(s.length>0&&a.push(...s),a.length===1){let e=r.getKeyAfter(n.key),a=e?r.getItem(e):null;if(e!=null&&a&&i&&a.level!=null&&i.level!=null&&a.level>i.level){let n={type:`item`,key:e,dropPosition:`before`};if(t(n))return[n]}}return a.filter(t)}selectTarget(e,t,n,r,i,a){if(e.length<2)return e[0];let o=this.pointerTracking,s=this.state.collection.getItem(t.key)?.parentKey;if(!s)return e[0];(!o.boundaryContext||o.boundaryContext.parentKey!==s)&&(o.boundaryContext={parentKey:s,preferredTargetIndex:o.yDirection===`up`?e.length-1:0,lastSwitchY:r,lastSwitchX:n});let c=o.boundaryContext,l=Math.abs(n-c.lastSwitchX);if(Math.abs(r-c.lastSwitchY)>5&&i){let t=c.preferredTargetIndex||0;i===`down`&&t===0?c.preferredTargetIndex=e.length-1:i===`up`&&t===e.length-1&&(c.preferredTargetIndex=0),o.xDirection=null}if(l>10&&a){let t=c.preferredTargetIndex||0;a===`left`?this.direction===`ltr`?t<e.length-1&&(c.preferredTargetIndex=t+1,c.lastSwitchX=n):t>0&&(c.preferredTargetIndex=t-1,c.lastSwitchX=n):a===`right`&&(this.direction===`ltr`?t>0&&(c.preferredTargetIndex=t-1,c.lastSwitchX=n):t<e.length-1&&(c.preferredTargetIndex=t+1,c.lastSwitchX=n)),o.yDirection=null}return e[Math.max(0,Math.min(c.preferredTargetIndex||0,e.length-1))]}constructor(){this.delegate=null,this.state=null,this.direction=`ltr`,this.pointerTracking={lastY:0,lastX:0,yDirection:null,xDirection:null,boundaryContext:null}}},Pe=class{*[Symbol.iterator](){yield*this.flattenedRows}get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}getItem(e){return this.keyMap.get(e)||null}at(e){return this.flattenedRows[e]}getFirstKey(){return this.flattenedRows[0]?.key}getLastKey(){return this.flattenedRows[this.flattenedRows.length-1]?.key}getKeyAfter(e){let t=this.flattenedRows.findIndex(t=>t.key===e);return this.flattenedRows[t+1]?.key}getKeyBefore(e){let t=this.flattenedRows.findIndex(t=>t.key===e);return this.flattenedRows[t-1]?.key}getChildren(e){let t=this.keyMap;return{*[Symbol.iterator](){let n=t.get(e),r=n?.firstChildKey==null?null:t.get(n.firstChildKey);for(;r;)yield r,r=r.nextKey==null?void 0:t.get(r.nextKey)}}}getTextValue(e){let t=this.getItem(e);return t?t.textValue:``}constructor(e){this.keyMap=new Map,this.itemCount=0;let{collection:t,expandedKeys:n}=e,{flattenedRows:r,keyMap:i,itemCount:a}=Ue(t,{expandedKeys:n});this.flattenedRows=r,this.keyMap=i,this.itemCount=a}};const Fe=n(null),Ie=n(null),Le=r(function(t,n){return[t,n]=A(t,n,Fe),e.createElement(de,{content:e.createElement(xe,t)},r=>e.createElement(ze,{props:t,collection:r,treeRef:n}))}),Re={expand:{ltr:`ArrowRight`,rtl:`ArrowLeft`},collapse:{ltr:`ArrowLeft`,rtl:`ArrowRight`}};function ze({props:t,collection:n,treeRef:r}){let{dragAndDropHooks:i}=t,{direction:a}=te(),l=T({usage:`search`,sensitivity:`base`}),f=!!i?.useDraggableCollectionState,m=!!i?.useDroppableCollectionState,h=u(f),g=u(m);s(()=>{h.current!==f&&console.warn(`Drag hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.`),g.current!==m&&console.warn(`Drop hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.`)},[f,m]);let{selectionMode:_=`none`,expandedKeys:v,defaultExpandedKeys:y,onExpandedChange:b,disabledBehavior:x=`all`}=t,{CollectionRoot:E,isVirtualized:D,layoutDelegate:O,dropTargetDelegate:ae}=o(Ee),[A,j]=oe(v?He(v):void 0,y?He(y):new Set,b),M=c(()=>new Pe({collection:n,expandedKeys:A}),[n,A]),P=re({...t,selectionMode:_,expandedKeys:A,onExpandedChange:j,collection:M,children:void 0,disabledBehavior:x}),{gridProps:F}=ne({...t,isVirtualized:D,layoutDelegate:O},P,r),I,L,R,z=!1,B=null,V=u(null);if(f&&i){I=i.useDraggableCollectionState({collection:P.collection,selectionManager:P.selectionManager,preview:i.renderDragPreview?V:void 0}),i.useDraggableCollection({},I,r);let t=i.DragPreview;B=i.renderDragPreview?e.createElement(t,{ref:V},i.renderDragPreview):null}let[H]=d(()=>new Ne);if(m&&i){L=i.useDroppableCollectionState({collection:P.collection,selectionManager:P.selectionManager});let e=i.dropTargetDelegate||ae||new i.ListDropTargetDelegate(P.collection,r,{direction:a});H.setup(e,P,a);let t=new C({collection:P.collection,collator:l,ref:r,disabledKeys:P.selectionManager.disabledKeys,disabledBehavior:P.selectionManager.disabledBehavior,direction:a,layoutDelegate:O});R=i.useDroppableCollection({keyboardDelegate:t,dropTargetDelegate:H,onDropActivate:e=>{if(e.target.type===`item`){let t=e.target.key,n=P.collection.getItem(t),r=A!==`all`&&A.has(t);n&&n.hasChildNodes&&(!r||i!=null&&i.isVirtualDragging?.call(i))&&P.toggleKey(t)}},onKeyDown:e=>{let t=L?.target;if(t&&t.type===`item`&&t.dropPosition===`on`){let n=P.collection.getItem(t.key);(e.key===Re.expand[a]&&n?.hasChildNodes&&!P.expandedKeys.has(t.key)||e.key===Re.collapse[a]&&n?.hasChildNodes&&P.expandedKeys.has(t.key))&&P.toggleKey(t.key)}}},L,r);let n=L.getDropOperation;L.getDropOperation=e=>{let{target:t,isInternal:r}=e,i=I?.draggingKeys??new Set;if(r&&t.type===`item`&&i.size>0){if(i.has(t.key)&&t.dropPosition===`on`)return`cancel`;let e=t.key;for(;e!=null;){let t=P.collection.getItem(e)?.parentKey;if(t!=null&&i.has(t))return`cancel`;e=t??null}}return n(e)},z=L.isDropTarget({type:`root`})}let U=!!(f&&!I?.isDisabled),{focusProps:W,isFocused:G,isFocusVisible:K}=ee(),q={isEmpty:P.collection.size===0,isFocused:G,isFocusVisible:K,isDropTarget:z,selectionMode:P.selectionManager.selectionMode,allowsDragging:!!U,state:P},J=k({...t,children:void 0,defaultClassName:`react-aria-Tree`,values:q}),Y=null;if(P.collection.size===0&&t.renderEmptyState){let{isEmpty:n,...r}=q,i=t.renderEmptyState({...r});Y=e.createElement(`div`,{role:`row`,style:{display:`contents`},"aria-level":1},e.createElement(`div`,{role:`gridcell`,style:{display:`contents`}},i))}let X=p(t,{global:!0});return e.createElement(e.Fragment,null,e.createElement(S,null,e.createElement(N.div,{...w(X,J,F,W,R?.collectionProps),ref:r,slot:t.slot||void 0,"data-empty":P.collection.size===0||void 0,"data-focused":G||void 0,"data-drop-target":z||void 0,"data-focus-visible":K||void 0,"data-selection-mode":P.selectionManager.selectionMode===`none`?void 0:P.selectionManager.selectionMode,"data-allows-dragging":!!U||void 0},e.createElement(ie,{values:[[Ie,P],[$,{dragAndDropHooks:i,dragState:I,dropState:L}],[De,{render:We}]]},m&&e.createElement(qe,null),e.createElement(Me,null,e.createElement(E,{collection:P.collection,persistedKeys:Ae(P.selectionManager,i,L),scrollRef:r,renderDropIndicator:ke(i,L)}))),Y)),B)}var Be=class extends B{};Be.type=`content`;var Ve=class extends B{};Ve.type=`item`,ve(U,function(t,n,r){let{isVirtualized:i}=o(Ee),a=o(Ie),{isLoading:s,onLoadMore:l,scrollOffset:d,...f}=t,h=u(null),g=c(()=>({onLoadMore:l,collection:a?.collection,sentinelRef:h,scrollOffset:d}),[l,d,a?.collection]);v(g,h),n=y(n);let{rowProps:_,gridCellProps:b}=E({node:r},a,n),x=_[`aria-level`]||1,S={role:`row`,"aria-level":_[`aria-level`]},C=k({...f,id:void 0,children:r.rendered,defaultClassName:`react-aria-TreeLoader`,values:{level:x}}),T={};return i&&(T={display:`contents`}),e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:m(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:h,style:{position:`absolute`,height:1,width:1}})),s&&C.children&&e.createElement(N.div,{ref:n,...w(p(t),S),...C,"data-level":x},e.createElement(`div`,{...b,style:T},C.children)))});function He(e){return e?e===`all`?`all`:new Set(e):new Set}function Ue(e,t){let{expandedKeys:n=new Set}=t,r=new Map,i=[],a=0,o=new Map,s=t=>{if(t.type===`item`||t.type===`loader`){let s=t?.parentKey,c={...t};s==null?r.set(t.key,t):([...e.getChildren(s)][0].type!==`item`&&(c.index=t?.index==null?0:t?.index-1),t.type===`loader`&&(c.level=t.level+1),r.set(c.key,c));let l=r.get(t.key)||t;(l.level===0||l.parentKey!=null&&n.has(l.parentKey)&&o.get(l.parentKey))&&(l.type===`item`&&a++,i.push(l),o.set(l.key,!0))}else t.type!==null&&r.set(t.key,t);for(let n of e.getChildren(t.key))s(n)};for(let t of e)s(t);return{flattenedRows:i,keyMap:r,itemCount:a}}function We(t,n){n=y(n);let{dragAndDropHooks:r,dropState:i}=o($),a=u(null),{dropIndicatorProps:s,isHidden:c,isDropTarget:l}=r.useDropIndicator(t,i,a);if(c)return null;let d=i&&t.target.type===`item`?(i.collection.getItem(t.target.key)?.level||0)+1:1;return e.createElement(Ke,{...t,dropIndicatorProps:s,isDropTarget:l,ref:n,buttonRef:a,level:d})}function Ge(t,n){let{dropIndicatorProps:r,isDropTarget:i,buttonRef:a,level:o,...s}=t,{visuallyHiddenProps:c}=D(),l=k({...s,defaultClassName:`react-aria-DropIndicator`,defaultStyle:{position:`relative`,"--tree-item-level":o},values:{isDropTarget:i}});return e.createElement(N.div,{...l,role:`row`,"aria-level":o,ref:n,"data-drop-target":i||void 0},e.createElement(`div`,{role:`gridcell`},e.createElement(`div`,{...c,role:`button`,...r,ref:a}),l.children))}const Ke=r(Ge);function qe(){let{dragAndDropHooks:t,dropState:n}=o($),r=u(null),{dropIndicatorProps:i}=t.useDropIndicator({target:{type:`root`}},n,r),a=n.isDropTarget({type:`root`}),{visuallyHiddenProps:s}=D();return!a&&i[`aria-hidden`]?null:e.createElement(`div`,{role:`row`,"aria-hidden":i[`aria-hidden`],style:{position:`absolute`}},e.createElement(`div`,{role:`gridcell`},e.createElement(`div`,{role:`button`,...s,...i,ref:r})))}export{Le as Tree};
1
+ import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useCallback as a,useContext as o,useEffect as s,useMemo as c,useReducer as l,useRef as u,useState as d,useSyncExternalStore as f}from"react";import{filterDOMProps as p,inertValue as m,mergeProps as h,mergeRefs as g,useLayoutEffect as _,useLoadMoreSentinel as v,useObjectRef as y}from"@react-aria/utils";import{FocusableContext as b}from"@react-aria/interactions";import{createPortal as x}from"react-dom";import{FocusScope as ee,ListKeyboardDelegate as S,mergeProps as C,useCollator as w,useFocusRing as te,useLocale as ne,useTree as re,useTreeItem as ie,useVisuallyHidden as T}from"react-aria";import{useTreeState as ae}from"react-stately";const E=Symbol(`default`);function oe({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function D(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:s,render:l}=e;return c(()=>{let e,c,u;return e=typeof t==`function`?t({...s,defaultClassName:i}):t,c=typeof n==`function`?n({...s,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...s,defaultChildren:a}):r??a,{className:e??i,style:c||o?{...o,...c}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,s):void 0}},[t,n,r,i,a,o,s,l])}function se(e,t){let n=o(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||E;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:`A slot prop is required.`;throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function O(e,t,n){let{ref:r,...i}=se(n,e.slot)||{},a=y(c(()=>g(t,r),[t,r])),o=h(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(o.style=typeof i.style==`function`||typeof e.style==`function`?t=>{let n=typeof i.style==`function`?i.style(t):i.style,r={...t.defaultStyle,...n},a=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...a}}:{...i.style,...e.style}),[o,a]}function ce(t,n,r){let{render:i,...a}=n,o=u(null),s=c(()=>g(r,o),[r,o]);_(()=>{},[t,i]);let l={...a,ref:s};return i?i(l,void 0):e.createElement(t,l)}const k={},A=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=k[t];return n||(n=r(ce.bind(null,t)),k[t]=n),n}}),j=typeof document<`u`?e.useInsertionEffect??e.useLayoutEffect:()=>{};function le(e,t,n){let[r,i]=d(e||t),o=u(r),c=u(e!==void 0),f=e!==void 0;s(()=>{c.current,c.current=f},[f]);let p=f?e:r;j(()=>{o.current=p});let[,m]=l(()=>({}),{});return[p,a((e,...t)=>{let r=typeof e==`function`?e(o.current):e;Object.is(o.current,r)||(o.current=r,i(r),m(),n?.(r,...t))},[n])]}var M=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},N=class extends M{filter(e,t,n){let[r,i]=z(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},P=class extends M{};P.type=`header`;var F=class extends M{};F.type=`loader`;var I=class extends N{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};I.type=`item`;var L=class extends N{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};L.type=`section`;var R=class{get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}*[Symbol.iterator](){let e=this.firstKey==null?void 0:this.keyMap.get(this.firstKey);for(;e;)yield e,e=e.nextKey==null?void 0:this.keyMap.get(e.nextKey)}getChildren(e){let t=this.keyMap;return{*[Symbol.iterator](){let n=t.get(e),r=n?.firstChildKey==null?null:t.get(n.firstChildKey);for(;r;)yield r,r=r.nextKey==null?void 0:t.get(r.nextKey)}}}getKeyBefore(e){let t=this.keyMap.get(e);if(!t)return null;if(t.prevKey!=null){for(t=this.keyMap.get(t.prevKey);t&&t.type!==`item`&&t.lastChildKey!=null;)t=this.keyMap.get(t.lastChildKey);return t?.key??null}return t.parentKey}getKeyAfter(e){let t=this.keyMap.get(e);if(!t)return null;if(t.type!==`item`&&t.firstChildKey!=null)return t.firstChildKey;for(;t;){if(t.nextKey!=null)return t.nextKey;if(t.parentKey!=null)t=this.keyMap.get(t.parentKey);else return null}return null}getFirstKey(){return this.firstKey}getLastKey(){let e=this.lastKey==null?null:this.keyMap.get(this.lastKey);for(;e?.lastChildKey!=null;)e=this.keyMap.get(e.lastChildKey);return e?.key??null}getItem(e){return this.keyMap.get(e)??null}at(){throw Error(`Not implemented`)}clone(){let e=this.constructor,t=new e;return t.keyMap=new Map(this.keyMap),t.firstKey=this.firstKey,t.lastKey=this.lastKey,t.itemCount=this.itemCount,t}addNode(e){if(this.frozen)throw Error(`Cannot add a node to a frozen collection`);e.type===`item`&&this.keyMap.get(e.key)==null&&this.itemCount++,this.keyMap.set(e.key,e)}addDescendants(e,t){this.addNode(e);let n=t.getChildren(e.key);for(let e of n)this.addDescendants(e,t)}removeNode(e){if(this.frozen)throw Error(`Cannot remove a node to a frozen collection`);let t=this.keyMap.get(e);t!=null&&t.type===`item`&&this.itemCount--,this.keyMap.delete(e)}commit(e,t,n=!1){if(this.frozen)throw Error(`Cannot commit a frozen collection`);this.firstKey=e,this.lastKey=t,this.frozen=!n}filter(e){let t=new this.constructor,[n,r]=z(this,t,this.firstKey,e);return t?.commit(n,r),t}constructor(){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.frozen=!1,this.itemCount=0}};function z(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}var B=class{*[Symbol.iterator](){let e=this.firstChild;for(;e;)yield e,e=e.nextSibling}get firstChild(){return this._firstChild}set firstChild(e){this._firstChild=e,this.ownerDocument.markDirty(this)}get lastChild(){return this._lastChild}set lastChild(e){this._lastChild=e,this.ownerDocument.markDirty(this)}get previousSibling(){return this._previousSibling}set previousSibling(e){this._previousSibling=e,this.ownerDocument.markDirty(this)}get nextSibling(){return this._nextSibling}set nextSibling(e){this._nextSibling=e,this.ownerDocument.markDirty(this)}get parentNode(){return this._parentNode}set parentNode(e){this._parentNode=e,this.ownerDocument.markDirty(this)}get isConnected(){return this.parentNode?.isConnected||!1}invalidateChildIndices(e){(this._minInvalidChildIndex==null||!this._minInvalidChildIndex.isConnected||e.index<this._minInvalidChildIndex.index)&&(this._minInvalidChildIndex=e,this.ownerDocument.markDirty(this))}updateChildIndices(){let e=this._minInvalidChildIndex;for(;e;)e.index=e.previousSibling?e.previousSibling.index+1:0,e=e.nextSibling;this._minInvalidChildIndex=null}appendChild(e){e.parentNode&&e.parentNode.removeChild(e),this.firstChild??=e,this.lastChild?(this.lastChild.nextSibling=e,e.index=this.lastChild.index+1,e.previousSibling=this.lastChild):(e.previousSibling=null,e.index=0),e.parentNode=this,e.nextSibling=null,this.lastChild=e,this.ownerDocument.markDirty(this),this.isConnected&&this.ownerDocument.queueUpdate()}insertBefore(e,t){if(t==null)return this.appendChild(e);e.parentNode&&e.parentNode.removeChild(e),e.nextSibling=t,e.previousSibling=t.previousSibling,e.index=t.index-1,this.firstChild===t?this.firstChild=e:t.previousSibling&&(t.previousSibling.nextSibling=e),t.previousSibling=e,e.parentNode=t.parentNode,this.invalidateChildIndices(e),this.isConnected&&this.ownerDocument.queueUpdate()}removeChild(e){e.parentNode===this&&(this._minInvalidChildIndex===e&&(this._minInvalidChildIndex=null),e.nextSibling&&(this.invalidateChildIndices(e.nextSibling),e.nextSibling.previousSibling=e.previousSibling),e.previousSibling&&(e.previousSibling.nextSibling=e.nextSibling),this.firstChild===e&&(this.firstChild=e.nextSibling),this.lastChild===e&&(this.lastChild=e.previousSibling),e.parentNode=null,e.nextSibling=null,e.previousSibling=null,e.index=0,this.ownerDocument.markDirty(e),this.isConnected&&this.ownerDocument.queueUpdate())}addEventListener(){}removeEventListener(){}get previousVisibleSibling(){let e=this.previousSibling;for(;e&&e.isHidden;)e=e.previousSibling;return e}get nextVisibleSibling(){let e=this.nextSibling;for(;e&&e.isHidden;)e=e.nextSibling;return e}get firstVisibleChild(){let e=this.firstChild;for(;e&&e.isHidden;)e=e.nextSibling;return e}get lastVisibleChild(){let e=this.lastChild;for(;e&&e.isHidden;)e=e.previousSibling;return e}constructor(e){this._firstChild=null,this._lastChild=null,this._previousSibling=null,this._nextSibling=null,this._parentNode=null,this._minInvalidChildIndex=null,this.ownerDocument=e}},V=class e extends B{get index(){return this._index}set index(e){this._index=e,this.ownerDocument.markDirty(this)}get level(){return this.parentNode instanceof e?this.parentNode.level+ +(this.node?.type===`item`):0}getMutableNode(){return this.node==null?null:(this.isMutated||=(this.node=this.node.clone(),!0),this.ownerDocument.markDirty(this),this.node)}updateNode(){let t=this.nextVisibleSibling,n=this.getMutableNode();if(n!=null&&(n.index=this.index,n.level=this.level,n.parentKey=this.parentNode instanceof e?this.parentNode.node?.key??null:null,n.prevKey=this.previousVisibleSibling?.node?.key??null,n.nextKey=t?.node?.key??null,n.hasChildNodes=!!this.firstChild,n.firstChildKey=this.firstVisibleChild?.node?.key??null,n.lastChildKey=this.lastVisibleChild?.node?.key??null,(n.colSpan!=null||n.colIndex!=null)&&t)){let e=(n.colIndex??n.index)+(n.colSpan??1);if(t.node!=null&&e!==t.node.colIndex){let n=t.getMutableNode();n.colIndex=e}}}setProps(e,t,n,r,i){let a,{value:o,textValue:s,id:c,...l}=e;if(this.node==null?(a=new n(c??`react-aria-${++this.ownerDocument.nodeId}`),this.node=a):a=this.getMutableNode(),l.ref=t,a.props=l,a.rendered=r,a.render=i,a.value=o,e[`aria-label`]&&(a[`aria-label`]=e[`aria-label`]),a.textValue=s||(typeof l.children==`string`?l.children:``)||e[`aria-label`]||``,c!=null&&c!==a.key)throw Error(`Cannot change the id of an item`);l.colSpan!=null&&(a.colSpan=l.colSpan),this.isConnected&&this.ownerDocument.queueUpdate()}get style(){let e=this;return{get display(){return e.isHidden?`none`:``},set display(t){let n=t===`none`;if(e.isHidden!==n){(e.parentNode?.firstVisibleChild===e||e.parentNode?.lastVisibleChild===e)&&e.ownerDocument.markDirty(e.parentNode);let t=e.previousVisibleSibling,r=e.nextVisibleSibling;t&&e.ownerDocument.markDirty(t),r&&e.ownerDocument.markDirty(r),e.isHidden=n,e.ownerDocument.markDirty(e)}}}}hasAttribute(){}setAttribute(){}setAttributeNS(){}removeAttribute(){}constructor(e,t){super(t),this.nodeType=8,this.isMutated=!0,this._index=0,this.isHidden=!1,this.node=null}},H=class extends B{get isConnected(){return!0}createElement(e){return new V(e,this)}getMutableCollection(){return this.nextCollection||=this.collection.clone(),this.nextCollection}markDirty(e){this.dirtyNodes.add(e)}addNode(e){if(e.isHidden||e.node==null)return;let t=this.getMutableCollection();if(!t.getItem(e.node.key))for(let t of e)this.addNode(t);t.addNode(e.node)}removeNode(e){for(let t of e)this.removeNode(t);e.node&&this.getMutableCollection().removeNode(e.node.key)}getCollection(){return this.inSubscription?this.collection.clone():(this.queuedRender=!1,this.updateCollection(),this.collection)}updateCollection(){for(let e of this.dirtyNodes)e instanceof V&&(!e.isConnected||e.isHidden)?this.removeNode(e):e.updateChildIndices();for(let e of this.dirtyNodes)e instanceof V?(e.isConnected&&!e.isHidden&&(e.updateNode(),this.addNode(e)),e.node&&this.dirtyNodes.delete(e),e.isMutated=!1):this.dirtyNodes.delete(e);this.nextCollection&&(this.nextCollection.commit(this.firstVisibleChild?.node?.key??null,this.lastVisibleChild?.node?.key??null,this.isSSR),this.isSSR||(this.collection=this.nextCollection,this.nextCollection=null))}queueUpdate(){if(!(this.dirtyNodes.size===0||this.queuedRender)){this.queuedRender=!0,this.inSubscription=!0;for(let e of this.subscriptions)e();this.inSubscription=!1}}subscribe(e){return this.subscriptions.add(e),()=>this.subscriptions.delete(e)}resetAfterSSR(){this.isSSR&&(this.isSSR=!1,this.firstChild=null,this.lastChild=null,this.nodeId=0)}constructor(e){super(null),this.nodeType=11,this.ownerDocument=this,this.dirtyNodes=new Set,this.isSSR=!1,this.nodeId=0,this.nodesByProps=new WeakMap,this.nextCollection=null,this.subscriptions=new Set,this.queuedRender=!1,this.inSubscription=!1,this.collection=e,this.nextCollection=e}};function U(e){let{children:n,items:r,idScope:i,addIdAndValue:a,dependencies:o=[]}=e,s=c(()=>new WeakMap,o);return c(()=>{if(r&&typeof n==`function`){let e=[];for(let o of r){let r=s.get(o);if(!r){r=n(o);let e=r.props.id??o.key??o.id;if(e==null)throw Error(`Could not determine key for item`);i!=null&&(e=i+`:`+e),r=t(r,a?{key:e,id:e,value:o}:{key:e}),s.set(o,r)}e.push(r)}return e}if(typeof n!=`function`)return n},[n,r,s,i,a])}if(typeof HTMLTemplateElement<`u`){let e=Object.getOwnPropertyDescriptor(Node.prototype,`firstChild`).get;Object.defineProperty(HTMLTemplateElement.prototype,"firstChild",{configurable:!0,enumerable:!0,get:function(){return this.dataset.reactAriaHidden?this.content.firstChild:e.call(this)}})}const W=n(!1);function G(t){if(o(W))return e.createElement(e.Fragment,null,t.children);let n=e.createElement(W.Provider,{value:!0},t.children);return e.createElement(`template`,{"data-react-aria-hidden":!0},n)}String(Math.round(Math.random()*1e10));const K=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement,e.useId;function q(){return!1}function ue(){return!0}function de(e){return()=>{}}function J(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore(de,q,ue):o(K)}const fe=n(!1),Y=n(null);function pe(t){if(o(Y))return t.content;let{collection:n,document:r}=_e(t.createCollection);return e.createElement(e.Fragment,null,e.createElement(G,null,e.createElement(Y.Provider,{value:r},t.content)),e.createElement(me,{render:t.children,collection:n}))}function me({collection:e,render:t}){return t(e)}function he(e,t,n){let r=J(),i=u(r);i.current=r;let o=a(()=>i.current?n():t(),[t,n]);return f(e,o)}const ge=typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore:he;function _e(e){let[t]=d(()=>new H(e?.()||new R)),n=a(e=>t.subscribe(e),[t]),r=a(()=>{let e=t.getCollection();return t.isSSR&&t.resetAfterSSR(),e},[t]),i=a(()=>(t.isSSR=!0,t.getCollection()),[t]);return{collection:ge(n,r,i),document:t}}const X=n(null);function ve(e){var t;return t=class extends M{},t.type=e,t}function ye(t,n,r,i,s,c){typeof t==`string`&&(t=ve(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(X);if(u){let a=u.ownerDocument.nodesByProps.get(n);return a||(a=u.ownerDocument.createElement(t.type),a.setProps(n,r,t,i,c),u.appendChild(a),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,a)),s?e.createElement(X.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function be(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(b);if(!o(fe)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return ye(t,r,a,`children`in r?r.children:null,null,t=>e.createElement(b.Provider,{value:s},e.createElement(i,{node:t})))});return a.displayName=n.name,a}function xe(e){return U({...e,addIdAndValue:!0})}const Se=n(null);function Ce(t){let n=o(Se),r=(n?.dependencies||[]).concat(t.dependencies),i=t.idScope??n?.idScope,a=xe({...t,idScope:i,dependencies:r});return o(Y)&&(a=e.createElement(we,null,a)),n=c(()=>({dependencies:r,idScope:i}),[i,...r]),e.createElement(Se.Provider,{value:n},a)}function we({children:t}){let n=o(Y),r=c(()=>e.createElement(Y.Provider,{value:null},e.createElement(fe.Provider,{value:!0},t)),[t]);return J()?e.createElement(X.Provider,{value:n},r):x(r,n)}const Te={CollectionRoot({collection:e,renderDropIndicator:t}){return Ee(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return Ee(e,t,n)}};function Ee(t,n,r){return U({items:n?t.getChildren(n.key):t,dependencies:[r],children(n){let i=n.render(n);return!r||n.type!==`item`?i:e.createElement(e.Fragment,null,r({type:`item`,key:n.key,dropPosition:`before`}),i,De(t,n,r))}})}function De(e,n,r){let a=n.key,o=e.getKeyAfter(a),s=o==null?null:e.getItem(o);for(;s!=null&&s.type!==`item`;)o=e.getKeyAfter(s.key),s=o==null?null:e.getItem(o);let c=n.nextKey==null?null:e.getItem(n.nextKey);for(;c!=null&&c.type!==`item`;)c=c.nextKey==null?null:e.getItem(c.nextKey);let l=[];if(c==null){let a=n;for(;a?.type===`item`&&(!s||a.parentKey!==s.parentKey&&s.level<a.level);){let n=r({type:`item`,key:a.key,dropPosition:`after`});i(n)&&l.push(t(n,{key:`${a.key}-after`})),a=a.parentKey==null?null:e.getItem(a.parentKey)}}return l}const Oe=n(Te),Z=n({}),ke=n(null),Ae=r(function(t,n){let{render:r}=o(ke);return e.createElement(e.Fragment,null,r(t,n))});function je(t,n){let r=t?.renderDropIndicator,i=t?.isVirtualDragging?.call(t),o=a(t=>{if(i||n?.isDropTarget(t))return r?r(t):e.createElement(Ae,{target:t})},[n?.target,i,r]);return t?.useDropIndicator?o:void 0}function Me(e,t,n){let r=e.focusedKey,i=null;if(t!=null&&t.isVirtualDragging?.call(t)&&n?.target?.type===`item`&&(i=n.target.key,n.target.dropPosition===`after`)){let e=n.collection.getKeyAfter(i),t=null;if(e!=null){let r=n.collection.getItem(i)?.level??0;for(;e;){let i=n.collection.getItem(e);if(!i)break;if(i.type!==`item`){e=n.collection.getKeyAfter(e);continue}if((i.level??0)<=r)break;t=e,e=n.collection.getKeyAfter(e)}}i=e??t??i}return c(()=>new Set([r,i].filter(e=>e!=null)),[r,i])}const Ne=n(null);function Pe(t){let n=u({});return e.createElement(Ne.Provider,{value:n},t.children)}var Fe=class{setup(e,t,n){this.delegate=e,this.state=t,this.direction=n}getDropTargetFromPoint(e,t,n){let r=this.delegate.getDropTargetFromPoint(e,t,n);return!r||r.type===`root`?r:this.resolveDropTarget(r,e,t,n)}resolveDropTarget(e,t,n,r){let i=this.pointerTracking,a=n-i.lastY,o=t-i.lastX,s=i.yDirection,c=i.xDirection;if(Math.abs(a)>5&&(s=a>0?`down`:`up`,i.yDirection=s,i.lastY=n),Math.abs(o)>10&&(c=o>0?`right`:`left`,i.xDirection=c,i.lastX=t),e.dropPosition===`before`){let t=this.state.collection.getKeyBefore(e.key);if(t!=null){let n={type:`item`,key:t,dropPosition:`after`};r(n)&&(e=n)}}let l=this.getPotentialTargets(e,r);if(l.length===0)return{type:`root`};let u;return l.length>1?u=this.selectTarget(l,e,t,n,s,c):(u=l[0],i.boundaryContext=null),u}getPotentialTargets(e,t){if(e.dropPosition===`on`)return[e];let n=e,r=this.state.collection,i=r.getItem(n.key);for(;i&&i?.type!==`item`&&i.nextKey!=null;)n.key=i.nextKey,i=r.getItem(i.nextKey);let a=[n];if(i&&i.hasChildNodes&&this.state.expandedKeys.has(i.key)&&r.getChildren&&n.dropPosition===`after`){let e=null;for(let t of r.getChildren(i.key))if(t.type===`item`){e=t;break}if(e){let n={type:`item`,key:e.key,dropPosition:`before`};return t(n)?[n]:[]}}if(i?.nextKey!=null)return[e];let o=i?.parentKey,s=[];for(;o;){let e=r.getItem(o),n=e?.nextKey?r.getItem(e.nextKey):null;if(!n||n.parentKey!==o){let e={type:`item`,key:o,dropPosition:`after`};if(t(e)&&s.push(e),n)break}o=e?.parentKey}if(s.length>0&&a.push(...s),a.length===1){let e=r.getKeyAfter(n.key),a=e?r.getItem(e):null;if(e!=null&&a&&i&&a.level!=null&&i.level!=null&&a.level>i.level){let n={type:`item`,key:e,dropPosition:`before`};if(t(n))return[n]}}return a.filter(t)}selectTarget(e,t,n,r,i,a){if(e.length<2)return e[0];let o=this.pointerTracking,s=this.state.collection.getItem(t.key)?.parentKey;if(!s)return e[0];(!o.boundaryContext||o.boundaryContext.parentKey!==s)&&(o.boundaryContext={parentKey:s,preferredTargetIndex:o.yDirection===`up`?e.length-1:0,lastSwitchY:r,lastSwitchX:n});let c=o.boundaryContext,l=Math.abs(n-c.lastSwitchX);if(Math.abs(r-c.lastSwitchY)>5&&i){let t=c.preferredTargetIndex||0;i===`down`&&t===0?c.preferredTargetIndex=e.length-1:i===`up`&&t===e.length-1&&(c.preferredTargetIndex=0),o.xDirection=null}if(l>10&&a){let t=c.preferredTargetIndex||0;a===`left`?this.direction===`ltr`?t<e.length-1&&(c.preferredTargetIndex=t+1,c.lastSwitchX=n):t>0&&(c.preferredTargetIndex=t-1,c.lastSwitchX=n):a===`right`&&(this.direction===`ltr`?t>0&&(c.preferredTargetIndex=t-1,c.lastSwitchX=n):t<e.length-1&&(c.preferredTargetIndex=t+1,c.lastSwitchX=n)),o.yDirection=null}return e[Math.max(0,Math.min(c.preferredTargetIndex||0,e.length-1))]}constructor(){this.delegate=null,this.state=null,this.direction=`ltr`,this.pointerTracking={lastY:0,lastX:0,yDirection:null,xDirection:null,boundaryContext:null}}},Ie=class{*[Symbol.iterator](){yield*this.flattenedRows}get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}getItem(e){return this.keyMap.get(e)||null}at(e){return this.flattenedRows[e]}getFirstKey(){return this.flattenedRows[0]?.key}getLastKey(){return this.flattenedRows[this.flattenedRows.length-1]?.key}getKeyAfter(e){let t=this.flattenedRows.findIndex(t=>t.key===e);return this.flattenedRows[t+1]?.key}getKeyBefore(e){let t=this.flattenedRows.findIndex(t=>t.key===e);return this.flattenedRows[t-1]?.key}getChildren(e){let t=this.keyMap;return{*[Symbol.iterator](){let n=t.get(e),r=n?.firstChildKey==null?null:t.get(n.firstChildKey);for(;r;)yield r,r=r.nextKey==null?void 0:t.get(r.nextKey)}}}getTextValue(e){let t=this.getItem(e);return t?t.textValue:``}constructor(e){this.keyMap=new Map,this.itemCount=0;let{collection:t,expandedKeys:n}=e,{flattenedRows:r,keyMap:i,itemCount:a}=Ue(t,{expandedKeys:n});this.flattenedRows=r,this.keyMap=i,this.itemCount=a}};const Le=n(null),Re=n(null),ze=r(function(t,n){return[t,n]=O(t,n,Le),e.createElement(pe,{content:e.createElement(Ce,t)},r=>e.createElement(Be,{props:t,collection:r,treeRef:n}))}),Q={expand:{ltr:`ArrowRight`,rtl:`ArrowLeft`},collapse:{ltr:`ArrowLeft`,rtl:`ArrowRight`}};function Be({props:t,collection:n,treeRef:r}){let{dragAndDropHooks:i}=t,{direction:a}=ne(),l=w({usage:`search`,sensitivity:`base`}),f=!!i?.useDraggableCollectionState,m=!!i?.useDroppableCollectionState,h=u(f),g=u(m);s(()=>{h.current!==f&&console.warn(`Drag hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.`),g.current!==m&&console.warn(`Drop hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.`)},[f,m]);let{selectionMode:_=`none`,expandedKeys:v,defaultExpandedKeys:y,onExpandedChange:b,disabledBehavior:x=`all`}=t,{CollectionRoot:ie,isVirtualized:T,layoutDelegate:E,dropTargetDelegate:se}=o(Oe),[O,ce]=le(v?$(v):void 0,y?$(y):new Set,b),k=c(()=>new Ie({collection:n,expandedKeys:O}),[n,O]),j=ae({...t,selectionMode:_,expandedKeys:O,onExpandedChange:ce,collection:k,children:void 0,disabledBehavior:x}),{gridProps:M}=re({...t,isVirtualized:T,layoutDelegate:E},j,r),N,P,F,I=!1,L=null,R=u(null);if(f&&i){N=i.useDraggableCollectionState({collection:j.collection,selectionManager:j.selectionManager,preview:i.renderDragPreview?R:void 0}),i.useDraggableCollection({},N,r);let t=i.DragPreview;L=i.renderDragPreview?e.createElement(t,{ref:R},i.renderDragPreview):null}let[z]=d(()=>new Fe);if(m&&i){P=i.useDroppableCollectionState({collection:j.collection,selectionManager:j.selectionManager});let e=i.dropTargetDelegate||se||new i.ListDropTargetDelegate(j.collection,r,{direction:a});z.setup(e,j,a);let t=new S({collection:j.collection,collator:l,ref:r,disabledKeys:j.selectionManager.disabledKeys,disabledBehavior:j.selectionManager.disabledBehavior,direction:a,layoutDelegate:E});F=i.useDroppableCollection({keyboardDelegate:t,dropTargetDelegate:z,onDropActivate:e=>{if(e.target.type===`item`){let t=e.target.key,n=j.collection.getItem(t),r=O!==`all`&&O.has(t);n&&n.hasChildNodes&&(!r||i!=null&&i.isVirtualDragging?.call(i))&&j.toggleKey(t)}},onKeyDown:e=>{let t=P?.target;if(t&&t.type===`item`&&t.dropPosition===`on`){let n=j.collection.getItem(t.key);(e.key===Q.expand[a]&&n?.hasChildNodes&&!j.expandedKeys.has(t.key)||e.key===Q.collapse[a]&&n?.hasChildNodes&&j.expandedKeys.has(t.key))&&j.toggleKey(t.key)}}},P,r);let n=P.getDropOperation;P.getDropOperation=e=>{let{target:t,isInternal:r}=e,i=N?.draggingKeys??new Set;if(r&&t.type===`item`&&i.size>0){if(i.has(t.key)&&t.dropPosition===`on`)return`cancel`;let e=t.key;for(;e!=null;){let t=j.collection.getItem(e)?.parentKey;if(t!=null&&i.has(t))return`cancel`;e=t??null}}return n(e)},I=P.isDropTarget({type:`root`})}let B=!!(f&&!N?.isDisabled),{focusProps:V,isFocused:H,isFocusVisible:U}=te(),W={isEmpty:j.collection.size===0,isFocused:H,isFocusVisible:U,isDropTarget:I,selectionMode:j.selectionManager.selectionMode,allowsDragging:!!B,state:j},G=D({...t,children:void 0,defaultClassName:`react-aria-Tree`,values:W}),K=null;if(j.collection.size===0&&t.renderEmptyState){let{isEmpty:n,...r}=W,i=t.renderEmptyState({...r});K=e.createElement(`div`,{role:`row`,style:{display:`contents`},"aria-level":1},e.createElement(`div`,{role:`gridcell`,style:{display:`contents`}},i))}let q=p(t,{global:!0});return e.createElement(e.Fragment,null,e.createElement(ee,null,e.createElement(A.div,{...C(q,G,M,V,F?.collectionProps),ref:r,slot:t.slot||void 0,"data-empty":j.collection.size===0||void 0,"data-focused":H||void 0,"data-drop-target":I||void 0,"data-focus-visible":U||void 0,"data-selection-mode":j.selectionManager.selectionMode===`none`?void 0:j.selectionManager.selectionMode,"data-allows-dragging":!!B||void 0},e.createElement(oe,{values:[[Re,j],[Z,{dragAndDropHooks:i,dragState:N,dropState:P}],[ke,{render:We}]]},m&&e.createElement(qe,null),e.createElement(Pe,null,e.createElement(ie,{collection:j.collection,persistedKeys:Me(j.selectionManager,i,P),scrollRef:r,renderDropIndicator:je(i,P)}))),K)),L)}var Ve=class extends M{};Ve.type=`content`;var He=class extends M{};He.type=`item`,be(F,function(t,n,r){let{isVirtualized:i}=o(Oe),a=o(Re),{isLoading:s,onLoadMore:l,scrollOffset:d,...f}=t,h=u(null),g=c(()=>({onLoadMore:l,collection:a?.collection,sentinelRef:h,scrollOffset:d}),[l,d,a?.collection]);v(g,h),n=y(n);let{rowProps:_,gridCellProps:b}=ie({node:r},a,n),x=_[`aria-level`]||1,ee={role:`row`,"aria-level":_[`aria-level`]},S=D({...f,id:void 0,children:r.rendered,defaultClassName:`react-aria-TreeLoader`,values:{level:x}}),w={};return i&&(w={display:`contents`}),e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:m(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:h,style:{position:`absolute`,height:1,width:1}})),s&&S.children&&e.createElement(A.div,{ref:n,...C(p(t),ee),...S,"data-level":x},e.createElement(`div`,{...b,style:w},S.children)))});function $(e){return e?e===`all`?`all`:new Set(e):new Set}function Ue(e,t){let{expandedKeys:n=new Set}=t,r=new Map,i=[],a=0,o=new Map,s=t=>{if(t.type===`item`||t.type===`loader`){let s=t?.parentKey,c={...t};s==null?r.set(t.key,t):([...e.getChildren(s)][0].type!==`item`&&(c.index=t?.index==null?0:t?.index-1),t.type===`loader`&&(c.level=t.level+1),r.set(c.key,c));let l=r.get(t.key)||t;(l.level===0||l.parentKey!=null&&n.has(l.parentKey)&&o.get(l.parentKey))&&(l.type===`item`&&a++,i.push(l),o.set(l.key,!0))}else t.type!==null&&r.set(t.key,t);for(let n of e.getChildren(t.key))s(n)};for(let t of e)s(t);return{flattenedRows:i,keyMap:r,itemCount:a}}function We(t,n){n=y(n);let{dragAndDropHooks:r,dropState:i}=o(Z),a=u(null),{dropIndicatorProps:s,isHidden:c,isDropTarget:l}=r.useDropIndicator(t,i,a);if(c)return null;let d=i&&t.target.type===`item`?(i.collection.getItem(t.target.key)?.level||0)+1:1;return e.createElement(Ke,{...t,dropIndicatorProps:s,isDropTarget:l,ref:n,buttonRef:a,level:d})}function Ge(t,n){let{dropIndicatorProps:r,isDropTarget:i,buttonRef:a,level:o,...s}=t,{visuallyHiddenProps:c}=T(),l=D({...s,defaultClassName:`react-aria-DropIndicator`,defaultStyle:{position:`relative`,"--tree-item-level":o},values:{isDropTarget:i}});return e.createElement(A.div,{...l,role:`row`,"aria-level":o,ref:n,"data-drop-target":i||void 0},e.createElement(`div`,{role:`gridcell`},e.createElement(`div`,{...c,role:`button`,...r,ref:a}),l.children))}const Ke=r(Ge);function qe(){let{dragAndDropHooks:t,dropState:n}=o(Z),r=u(null),{dropIndicatorProps:i}=t.useDropIndicator({target:{type:`root`}},n,r),a=n.isDropTarget({type:`root`}),{visuallyHiddenProps:s}=T();return!a&&i[`aria-hidden`]?null:e.createElement(`div`,{role:`row`,"aria-hidden":i[`aria-hidden`],style:{position:`absolute`}},e.createElement(`div`,{role:`gridcell`},e.createElement(`div`,{role:`button`,...s,...i,ref:r})))}export{ze as Tree};
@@ -1 +1 @@
1
- import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useCallback as a,useContext as o,useEffect as s,useMemo as c,useRef as l}from"react";import{filterDOMProps as u,inertValue as d,mergeRefs as f,useLayoutEffect as p,useLoadMoreSentinel as m,useObjectRef as h}from"@react-aria/utils";import{FocusableContext as g}from"@react-aria/interactions";import"react-dom";import{mergeProps as _,useFocusRing as v,useGridListSelectionCheckbox as ee,useHover as y,useId as b,useTreeItem as x,useVisuallyHidden as S}from"react-aria";import"react-stately";const C=n(null);n(null),n(null),n(null),n(null),n({}),n(null),n(null);const w=Symbol(`default`);function T({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function E(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:s,render:l}=e;return c(()=>{let e,c,u;return e=typeof t==`function`?t({...s,defaultClassName:i}):t,c=typeof n==`function`?n({...s,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...s,defaultChildren:a}):r??a,{className:e??i,style:c||o?{...o,...c}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,s):void 0}},[t,n,r,i,a,o,s,l])}function D(t,n,r){let{render:i,...a}=n,o=l(null),s=c(()=>f(r,o),[r,o]);p(()=>{},[t,i]);let u={...a,ref:s};return i?i(u,void 0):e.createElement(t,u)}const O={},k=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=O[t];return n||(n=r(D.bind(null,t)),O[t]=n),n}});String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;var A=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},j=class extends A{filter(e,t,n){let[r,i]=I(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},M=class extends A{};M.type=`header`;var N=class extends A{};N.type=`loader`;var P=class extends j{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};P.type=`item`;var F=class extends j{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};F.type=`section`;function I(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}function L(e){let{children:n,items:r,idScope:i,addIdAndValue:a,dependencies:o=[]}=e,s=c(()=>new WeakMap,o);return c(()=>{if(r&&typeof n==`function`){let e=[];for(let o of r){let r=s.get(o);if(!r){r=n(o);let e=r.props.id??o.key??o.id;if(e==null)throw Error(`Could not determine key for item`);i!=null&&(e=i+`:`+e),r=t(r,a?{key:e,id:e,value:o}:{key:e}),s.set(o,r)}e.push(r)}return e}if(typeof n!=`function`)return n},[n,r,s,i,a])}const R=n(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const z=n(null);function B(e){var t;return t=class extends A{},t.type=e,t}function V(t,n,r,i,s,c){typeof t==`string`&&(t=B(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(z);if(u){let a=u.ownerDocument.nodesByProps.get(n);return a||(a=u.ownerDocument.createElement(t.type),a.setProps(n,r,t,i,c),u.appendChild(a),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,a)),s?e.createElement(z.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function H(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(g);if(!o(R)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return V(t,r,a,`children`in r?r.children:null,null,t=>e.createElement(g.Provider,{value:s},e.createElement(i,{node:t})))});return a.displayName=n.name,a}function U(t,n,i=W){let a=({node:e})=>n(e.props,e.props.ref,e),o=r((n,r)=>V(t,n,r,null,i(n),t=>e.createElement(a,{node:t}))??e.createElement(e.Fragment,null));return o.displayName=n.name,o}function W(e){return L({...e,addIdAndValue:!0})}const G={CollectionRoot({collection:e,renderDropIndicator:t}){return K(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return K(e,t,n)}};function K(t,n,r){return L({items:n?t.getChildren(n.key):t,dependencies:[r],children(n){let i=n.render(n);return!r||n.type!==`item`?i:e.createElement(e.Fragment,null,r({type:`item`,key:n.key,dropPosition:`before`}),i,q(t,n,r))}})}function q(e,n,r){let a=n.key,o=e.getKeyAfter(a),s=o==null?null:e.getItem(o);for(;s!=null&&s.type!==`item`;)o=e.getKeyAfter(s.key),s=o==null?null:e.getItem(o);let c=n.nextKey==null?null:e.getItem(n.nextKey);for(;c!=null&&c.type!==`item`;)c=c.nextKey==null?null:e.getItem(c.nextKey);let l=[];if(c==null){let a=n;for(;a?.type===`item`&&(!s||a.parentKey!==s.parentKey&&s.level<a.level);){let n=r({type:`item`,key:a.key,dropPosition:`after`});i(n)&&l.push(t(n,{key:`${a.key}-after`})),a=a.parentKey==null?null:e.getItem(a.parentKey)}}return l}const J=n(G),te=n({}),ne=n({}),re=n({isSelected:!1}),Y=n(null);var X=class extends A{};X.type=`content`;const ie=n(null);var Z=class extends A{};Z.type=`item`;const Q=U(Z,(t,n,r)=>{let i=o(Y);n=h(n);let{dragAndDropHooks:a,dragState:c,dropState:d}=o(ne),{rowProps:f,gridCellProps:p,expandButtonProps:m,descriptionProps:g,...D}=x({node:r,shouldSelectOnPressUp:!!c},i,n),O=f[`aria-expanded`]===!0,A=t.hasChildItems||[...i.collection.getChildren(r.key)].length>1,j=f[`aria-level`]||1,{hoverProps:M,isHovered:N}=y({isDisabled:!D.allowsSelection&&!D.hasAction,onHoverStart:t.onHoverStart,onHoverChange:t.onHoverChange,onHoverEnd:t.onHoverEnd}),{isFocusVisible:P,focusProps:F}=v(),{isFocusVisible:I,focusProps:R}=v({within:!0}),{checkboxProps:z}=ee({key:r.key},i),B=null;c&&a&&(B=a.useDraggableItem({key:r.key,hasDragButton:!0},c));let V=null,H=l(null),U=l(null),W=l(null),{visuallyHiddenProps:G}=S();d&&a&&(V=a.useDropIndicator({target:{type:`item`,key:r.key,dropPosition:`on`},activateButtonRef:W},d,U));let K=c&&c.isDragging(r.key),q=V?.isDropTarget,J=i.selectionManager.selectionMode,X=i.selectionManager.selectionBehavior,Z=e.useMemo(()=>({...D,isHovered:N,isFocusVisible:P,isExpanded:O,hasChildItems:A,level:j,selectionMode:J,selectionBehavior:X,isFocusVisibleWithin:I,state:i,id:r.key,allowsDragging:!!c,isDragging:K,isDropTarget:q}),[D,N,P,O,A,j,I,i,r.key,c,K,q,X,J]),Q=E({...t,id:void 0,children:r.rendered,defaultClassName:`react-aria-TreeItem`,defaultStyle:{"--tree-item-level":j},values:Z});s(()=>{r.textValue},[r.textValue]),s(()=>{A&&H.current},[]);let ae=l(null);s(()=>{c&&ae.current},[]);let oe=L({items:i.collection.getChildren(r.key),children:t=>{switch(t.type){case`content`:return t.render(t);case`loader`:case`item`:return e.createElement(e.Fragment,null);default:throw Error(`Unsupported element type in TreeRow: `+t.type)}}}),se=b(),$=u(t,{global:!0});return delete $.id,delete $.onClick,e.createElement(e.Fragment,null,V&&!V.isHidden&&e.createElement(`div`,{role:`row`,"aria-level":f[`aria-level`],"aria-expanded":f[`aria-expanded`],"aria-label":V.dropIndicatorProps[`aria-label`]},e.createElement(`div`,{role:`gridcell`,"aria-colindex":1,style:{display:`contents`}},e.createElement(`div`,{role:`button`,...G,...V.dropIndicatorProps,ref:U}),f[`aria-expanded`]==null?null:e.createElement(`div`,{role:`button`,...G,id:se,"aria-label":m[`aria-label`],"aria-labelledby":`${se} ${f.id}`,tabIndex:-1,ref:W}))),e.createElement(k.div,{..._($,f,F,M,R,B?.dragProps),...Q,ref:n,"data-expanded":A&&O||void 0,"data-has-child-items":A||void 0,"data-level":j,"data-selected":D.isSelected||void 0,"data-disabled":D.isDisabled||void 0,"data-hovered":N||void 0,"data-focused":D.isFocused||void 0,"data-focus-visible":P||void 0,"data-pressed":D.isPressed||void 0,"data-selection-mode":i.selectionManager.selectionMode===`none`?void 0:i.selectionManager.selectionMode,"data-allows-dragging":!!c||void 0,"data-dragging":K||void 0,"data-drop-target":q||void 0},e.createElement(`div`,{...p,style:{display:`contents`}},e.createElement(T,{values:[[C,{slots:{selection:z}}],[te,{slots:{[w]:{},chevron:{...m,ref:H},drag:{...B?.dragButtonProps,ref:ae,style:{pointerEvents:`none`}}}}],[ie,{...Z}],[re,{isSelected:D.isSelected}]]},oe))))});H(N,function(t,n,r){let{isVirtualized:i}=o(J),a=o(Y),{isLoading:s,onLoadMore:f,scrollOffset:p,...g}=t,v=l(null),ee=c(()=>({onLoadMore:f,collection:a?.collection,sentinelRef:v,scrollOffset:p}),[f,p,a?.collection]);m(ee,v),n=h(n);let{rowProps:y,gridCellProps:b}=x({node:r},a,n),S=y[`aria-level`]||1,C={role:`row`,"aria-level":y[`aria-level`]},w=E({...g,id:void 0,children:r.rendered,defaultClassName:`react-aria-TreeLoader`,values:{level:S}}),T={};return i&&(T={display:`contents`}),e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:d(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:v,style:{position:`absolute`,height:1,width:1}})),s&&w.children&&e.createElement(k.div,{ref:n,..._(u(t),C),...w,"data-level":S},e.createElement(`div`,{...b,style:T},w.children)))});export{Q as TreeItem};
1
+ import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useCallback as a,useContext as o,useEffect as s,useMemo as c,useRef as l}from"react";import{filterDOMProps as u,inertValue as d,mergeRefs as f,useLayoutEffect as p,useLoadMoreSentinel as m,useObjectRef as h}from"@react-aria/utils";import{FocusableContext as g}from"@react-aria/interactions";import"react-dom";import{mergeProps as _,useFocusRing as v,useGridListSelectionCheckbox as ee,useHover as y,useId as b,useTreeItem as x,useVisuallyHidden as S}from"react-aria";import"react-stately";const C=n(null);n(null),n(null),n(null),n(null),n({}),n(null),n(null);const w=Symbol(`default`);function T({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function E(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:s,render:l}=e;return c(()=>{let e,c,u;return e=typeof t==`function`?t({...s,defaultClassName:i}):t,c=typeof n==`function`?n({...s,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...s,defaultChildren:a}):r??a,{className:e??i,style:c||o?{...o,...c}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,s):void 0}},[t,n,r,i,a,o,s,l])}function D(t,n,r){let{render:i,...a}=n,o=l(null),s=c(()=>f(r,o),[r,o]);p(()=>{},[t,i]);let u={...a,ref:s};return i?i(u,void 0):e.createElement(t,u)}const O={},k=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=O[t];return n||(n=r(D.bind(null,t)),O[t]=n),n}});var A=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},j=class extends A{filter(e,t,n){let[r,i]=I(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},M=class extends A{};M.type=`header`;var N=class extends A{};N.type=`loader`;var P=class extends j{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};P.type=`item`;var F=class extends j{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};F.type=`section`;function I(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}function L(e){let{children:n,items:r,idScope:i,addIdAndValue:a,dependencies:o=[]}=e,s=c(()=>new WeakMap,o);return c(()=>{if(r&&typeof n==`function`){let e=[];for(let o of r){let r=s.get(o);if(!r){r=n(o);let e=r.props.id??o.key??o.id;if(e==null)throw Error(`Could not determine key for item`);i!=null&&(e=i+`:`+e),r=t(r,a?{key:e,id:e,value:o}:{key:e}),s.set(o,r)}e.push(r)}return e}if(typeof n!=`function`)return n},[n,r,s,i,a])}String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;const R=n(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const z=n(null);function B(e){var t;return t=class extends A{},t.type=e,t}function V(t,n,r,i,s,c){typeof t==`string`&&(t=B(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(z);if(u){let a=u.ownerDocument.nodesByProps.get(n);return a||(a=u.ownerDocument.createElement(t.type),a.setProps(n,r,t,i,c),u.appendChild(a),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,a)),s?e.createElement(z.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function H(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(g);if(!o(R)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return V(t,r,a,`children`in r?r.children:null,null,t=>e.createElement(g.Provider,{value:s},e.createElement(i,{node:t})))});return a.displayName=n.name,a}function U(t,n,i=W){let a=({node:e})=>n(e.props,e.props.ref,e),o=r((n,r)=>V(t,n,r,null,i(n),t=>e.createElement(a,{node:t}))??e.createElement(e.Fragment,null));return o.displayName=n.name,o}function W(e){return L({...e,addIdAndValue:!0})}const G={CollectionRoot({collection:e,renderDropIndicator:t}){return K(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return K(e,t,n)}};function K(t,n,r){return L({items:n?t.getChildren(n.key):t,dependencies:[r],children(n){let i=n.render(n);return!r||n.type!==`item`?i:e.createElement(e.Fragment,null,r({type:`item`,key:n.key,dropPosition:`before`}),i,q(t,n,r))}})}function q(e,n,r){let a=n.key,o=e.getKeyAfter(a),s=o==null?null:e.getItem(o);for(;s!=null&&s.type!==`item`;)o=e.getKeyAfter(s.key),s=o==null?null:e.getItem(o);let c=n.nextKey==null?null:e.getItem(n.nextKey);for(;c!=null&&c.type!==`item`;)c=c.nextKey==null?null:e.getItem(c.nextKey);let l=[];if(c==null){let a=n;for(;a?.type===`item`&&(!s||a.parentKey!==s.parentKey&&s.level<a.level);){let n=r({type:`item`,key:a.key,dropPosition:`after`});i(n)&&l.push(t(n,{key:`${a.key}-after`})),a=a.parentKey==null?null:e.getItem(a.parentKey)}}return l}const J=n(G),te=n({}),ne=n({}),re=n({isSelected:!1}),Y=n(null);var X=class extends A{};X.type=`content`;const ie=n(null);var Z=class extends A{};Z.type=`item`;const Q=U(Z,(t,n,r)=>{let i=o(Y);n=h(n);let{dragAndDropHooks:a,dragState:c,dropState:d}=o(ne),{rowProps:f,gridCellProps:p,expandButtonProps:m,descriptionProps:g,...D}=x({node:r,shouldSelectOnPressUp:!!c},i,n),O=f[`aria-expanded`]===!0,A=t.hasChildItems||[...i.collection.getChildren(r.key)].length>1,j=f[`aria-level`]||1,{hoverProps:M,isHovered:N}=y({isDisabled:!D.allowsSelection&&!D.hasAction,onHoverStart:t.onHoverStart,onHoverChange:t.onHoverChange,onHoverEnd:t.onHoverEnd}),{isFocusVisible:P,focusProps:F}=v(),{isFocusVisible:I,focusProps:R}=v({within:!0}),{checkboxProps:z}=ee({key:r.key},i),B=null;c&&a&&(B=a.useDraggableItem({key:r.key,hasDragButton:!0},c));let V=null,H=l(null),U=l(null),W=l(null),{visuallyHiddenProps:G}=S();d&&a&&(V=a.useDropIndicator({target:{type:`item`,key:r.key,dropPosition:`on`},activateButtonRef:W},d,U));let K=c&&c.isDragging(r.key),q=V?.isDropTarget,J=i.selectionManager.selectionMode,X=i.selectionManager.selectionBehavior,Z=e.useMemo(()=>({...D,isHovered:N,isFocusVisible:P,isExpanded:O,hasChildItems:A,level:j,selectionMode:J,selectionBehavior:X,isFocusVisibleWithin:I,state:i,id:r.key,allowsDragging:!!c,isDragging:K,isDropTarget:q}),[D,N,P,O,A,j,I,i,r.key,c,K,q,X,J]),Q=E({...t,id:void 0,children:r.rendered,defaultClassName:`react-aria-TreeItem`,defaultStyle:{"--tree-item-level":j},values:Z});s(()=>{r.textValue},[r.textValue]),s(()=>{A&&H.current},[]);let ae=l(null);s(()=>{c&&ae.current},[]);let oe=L({items:i.collection.getChildren(r.key),children:t=>{switch(t.type){case`content`:return t.render(t);case`loader`:case`item`:return e.createElement(e.Fragment,null);default:throw Error(`Unsupported element type in TreeRow: `+t.type)}}}),se=b(),$=u(t,{global:!0});return delete $.id,delete $.onClick,e.createElement(e.Fragment,null,V&&!V.isHidden&&e.createElement(`div`,{role:`row`,"aria-level":f[`aria-level`],"aria-expanded":f[`aria-expanded`],"aria-label":V.dropIndicatorProps[`aria-label`]},e.createElement(`div`,{role:`gridcell`,"aria-colindex":1,style:{display:`contents`}},e.createElement(`div`,{role:`button`,...G,...V.dropIndicatorProps,ref:U}),f[`aria-expanded`]==null?null:e.createElement(`div`,{role:`button`,...G,id:se,"aria-label":m[`aria-label`],"aria-labelledby":`${se} ${f.id}`,tabIndex:-1,ref:W}))),e.createElement(k.div,{..._($,f,F,M,R,B?.dragProps),...Q,ref:n,"data-expanded":A&&O||void 0,"data-has-child-items":A||void 0,"data-level":j,"data-selected":D.isSelected||void 0,"data-disabled":D.isDisabled||void 0,"data-hovered":N||void 0,"data-focused":D.isFocused||void 0,"data-focus-visible":P||void 0,"data-pressed":D.isPressed||void 0,"data-selection-mode":i.selectionManager.selectionMode===`none`?void 0:i.selectionManager.selectionMode,"data-allows-dragging":!!c||void 0,"data-dragging":K||void 0,"data-drop-target":q||void 0},e.createElement(`div`,{...p,style:{display:`contents`}},e.createElement(T,{values:[[C,{slots:{selection:z}}],[te,{slots:{[w]:{},chevron:{...m,ref:H},drag:{...B?.dragButtonProps,ref:ae,style:{pointerEvents:`none`}}}}],[ie,{...Z}],[re,{isSelected:D.isSelected}]]},oe))))});H(N,function(t,n,r){let{isVirtualized:i}=o(J),a=o(Y),{isLoading:s,onLoadMore:f,scrollOffset:p,...g}=t,v=l(null),ee=c(()=>({onLoadMore:f,collection:a?.collection,sentinelRef:v,scrollOffset:p}),[f,p,a?.collection]);m(ee,v),n=h(n);let{rowProps:y,gridCellProps:b}=x({node:r},a,n),S=y[`aria-level`]||1,C={role:`row`,"aria-level":y[`aria-level`]},w=E({...g,id:void 0,children:r.rendered,defaultClassName:`react-aria-TreeLoader`,values:{level:S}}),T={};return i&&(T={display:`contents`}),e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:d(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:v,style:{position:`absolute`,height:1,width:1}})),s&&w.children&&e.createElement(k.div,{ref:n,..._(u(t),C),...w,"data-level":S},e.createElement(`div`,{...b,style:T},w.children)))});export{Q as TreeItem};