@povio/ui 3.4.0-rc.32 → 3.4.0-rc.34

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 (119) hide show
  1. package/dist/{BottomSheet-Bf5YauUF.js → BottomSheet-CVIgVXNP.js} +2 -2
  2. package/dist/{Breadcrumbs-D8ngBc93.js → Breadcrumbs-BypydWR6.js} +2 -2
  3. package/dist/{Calendar-D2IPtih0.js → Calendar-CJscjq0V.js} +4 -4
  4. package/dist/{DatePicker-C5inJMib.js → DatePicker-DIad7xyY.js} +4 -4
  5. package/dist/{DatePickerInput-CtkeReVQ.js → DatePickerInput-g8VFnlw8.js} +1 -1
  6. package/dist/{DateRangePicker-BcYoPnDA.js → DateRangePicker-0vELBNcS.js} +3 -3
  7. package/dist/{DateTimePicker-CocJ2QGc.js → DateTimePicker-ChVdA0tD.js} +4 -4
  8. package/dist/{Dialog-CYPAuk4r.js → Dialog-B5J6LRRw.js} +2 -71
  9. package/dist/{Form-U_gaYtIz.d.ts → Form-C91OtvWn.d.ts} +1 -1
  10. package/dist/{InputItem-msRZqamc.js → InputItem-DRjyA0oH.js} +5 -5
  11. package/dist/{Inputs-D0nApWoP.d.ts → Inputs-CalpKD9s.d.ts} +1 -1
  12. package/dist/{Inputs-COn_OHA2.js → Inputs-Cmt2mxFU.js} +1 -1
  13. package/dist/{ListBox-CJbpH_Kh.js → ListBox-CIgWt1tg.js} +1 -1
  14. package/dist/{Menu-CXlFN-mb.js → Menu-BxbxSqMx.js} +2 -2
  15. package/dist/{MenuDesktop-CuQBZODp.js → MenuDesktop-Dv25P83N.js} +1 -1
  16. package/dist/{Modal-BbiLj4ai.js → Modal-CEJ2QkF0.js} +1 -1
  17. package/dist/{Modal-Cerq7LEf.js → Modal-r0ucQNPK.js} +2 -2
  18. package/dist/{Select-CO2ppqqL.js → Select-B7vfRfll.js} +1 -1
  19. package/dist/{TextEditor-CDv7Tf57.js → TextEditor-DScsU-U2.js} +3 -3
  20. package/dist/{TimePicker-BmTVdF1E.js → TimePicker-DC_MYdqe.js} +2 -2
  21. package/dist/components/action-modal.js +1 -1
  22. package/dist/components/autocomplete.js +1 -1
  23. package/dist/components/bottom-sheet.js +2 -2
  24. package/dist/components/breadcrumb/react-aria.js +1 -11
  25. package/dist/components/breadcrumbs/react-aria.js +1 -11
  26. package/dist/components/breadcrumbs.js +1 -1
  27. package/dist/components/cell/react-aria.js +1 -11
  28. package/dist/components/collection/react-aria.js +1 -11
  29. package/dist/components/color-swatch-picker/react-aria.js +1 -11
  30. package/dist/components/color-swatch-picker-item/react-aria.js +1 -11
  31. package/dist/components/column/react-aria.js +1 -11
  32. package/dist/components/column-resizer/react-aria.js +1 -11
  33. package/dist/components/combo-box/react-aria.js +1 -11
  34. package/dist/components/date-picker.js +1 -1
  35. package/dist/components/date-range-picker.js +1 -1
  36. package/dist/components/date-time-picker.js +1 -1
  37. package/dist/components/drawer.js +2 -2
  38. package/dist/components/grid-list/react-aria.js +1 -11
  39. package/dist/components/grid-list-header/react-aria.js +1 -11
  40. package/dist/components/grid-list-item/react-aria.js +1 -11
  41. package/dist/components/grid-list-load-more-item/react-aria.js +1 -11
  42. package/dist/components/grid-list-section/react-aria.js +1 -11
  43. package/dist/components/header/react-aria.js +1 -11
  44. package/dist/components/list-box/react-aria.js +1 -11
  45. package/dist/components/list-box-item/react-aria.js +1 -11
  46. package/dist/components/list-box-load-more-item/react-aria.js +1 -11
  47. package/dist/components/list-box-section/react-aria.js +1 -11
  48. package/dist/components/menu/react-aria.js +1 -11
  49. package/dist/components/menu-item/react-aria.js +1 -11
  50. package/dist/components/menu-section/react-aria.js +1 -11
  51. package/dist/components/menu.js +2 -2
  52. package/dist/components/modal.js +1 -1
  53. package/dist/components/query-autocomplete.d.ts +1 -1
  54. package/dist/components/query-autocomplete.js +3 -3
  55. package/dist/components/query-select.js +1 -1
  56. package/dist/components/resizable-table-container/react-aria.js +1 -11
  57. package/dist/components/responsive-popover.js +1 -1
  58. package/dist/components/row/react-aria.js +1 -11
  59. package/dist/components/section/react-aria.js +1 -11
  60. package/dist/components/select/react-aria.js +1 -11
  61. package/dist/components/select.js +1 -1
  62. package/dist/components/separator/react-aria.js +1 -11
  63. package/dist/components/split-button.js +1 -1
  64. package/dist/components/submenu-trigger/react-aria.js +1 -11
  65. package/dist/components/tab/react-aria.js +1 -11
  66. package/dist/components/tab-list/react-aria.js +1 -11
  67. package/dist/components/tab-panels/react-aria.js +1 -11
  68. package/dist/components/table/react-aria.js +1 -11
  69. package/dist/components/table-body/react-aria.js +1 -11
  70. package/dist/components/table-header/react-aria.js +1 -11
  71. package/dist/components/table-load-more-item/react-aria.js +1 -11
  72. package/dist/components/tabs/react-aria.js +1 -11
  73. package/dist/components/tag/react-aria.js +1 -11
  74. package/dist/components/tag-group/react-aria.js +1 -11
  75. package/dist/components/tag-list/react-aria.js +1 -11
  76. package/dist/components/time-picker.js +1 -1
  77. package/dist/components/tree/react-aria.js +1 -11
  78. package/dist/components/tree-item/react-aria.js +1 -11
  79. package/dist/components/tree-item-content/react-aria.js +1 -11
  80. package/dist/components/tree-load-more-item/react-aria.js +1 -11
  81. package/dist/{datePickerValue.utils-u6REHox2.js → datePickerValue.utils-n2HQDle8.js} +1 -1
  82. package/dist/{dynamicInputs-ByTvSdJe.d.ts → dynamicInputs-BasxVhHP.d.ts} +2 -2
  83. package/dist/index.d.ts +2 -2
  84. package/dist/index.js +10 -10
  85. package/dist/{logger-BPhG2izn.js → logger-DpUn65wp.js} +23 -1
  86. package/dist/{query-autocomplete-CHtcx_ND.d.ts → query-autocomplete-E-PMmf1d.d.ts} +1 -1
  87. package/dist/{queryAutocomplete.types-DaTDttX5.d.ts → queryAutocomplete.types-BOH9QnRq.d.ts} +1 -0
  88. package/dist/rhf/date-picker.js +1 -1
  89. package/dist/rhf/date-range-picker.js +1 -1
  90. package/dist/rhf/date-time-picker.js +1 -1
  91. package/dist/rhf/inputs.d.ts +1 -1
  92. package/dist/rhf/query-autocomplete.d.ts +1 -1
  93. package/dist/rhf/select.js +1 -1
  94. package/dist/rhf/text-editor.js +1 -1
  95. package/dist/rhf/time-picker.js +1 -1
  96. package/dist/rhf.d.ts +2 -2
  97. package/dist/rhf.js +10 -10
  98. package/dist/{staticDateTimeSegments-qJUUAL8d.js → staticDateTimeSegments-B5Uuat4L.js} +2 -2
  99. package/dist/{staticSelect.utils-CRyAMXOL.js → staticSelect.utils-BqH-4vxg.js} +3 -3
  100. package/dist/tanstack/date-picker.js +1 -1
  101. package/dist/tanstack/date-range-picker.js +1 -1
  102. package/dist/tanstack/date-time-picker.js +1 -1
  103. package/dist/tanstack/form.d.ts +1 -1
  104. package/dist/tanstack/form.js +1 -1
  105. package/dist/tanstack/inputs.d.ts +2 -2
  106. package/dist/tanstack/inputs.js +1 -1
  107. package/dist/tanstack/select.js +1 -1
  108. package/dist/tanstack/table.js +1 -1
  109. package/dist/tanstack/text-editor.js +1 -1
  110. package/dist/tanstack/time-picker.js +1 -1
  111. package/dist/tanstack.d.ts +3 -3
  112. package/dist/tanstack.js +17 -17
  113. package/dist/text-editor.js +1 -1
  114. package/dist/{useFilter-Cz_G94ya.js → useFilter-BsjdRENO.js} +1 -1
  115. package/dist/{useFormAutosave-Cj75UzUP.js → useFormAutosave-C_SlCky9.js} +1 -1
  116. package/dist/{useTableColumnConfig-CXjUy_VP.js → useTableColumnConfig-BTsMxT8X.js} +2 -2
  117. package/dist/utils/logger.js +1 -1
  118. package/package.json +1 -1
  119. package/dist/rolldown-runtime-DUp30N8C.js +0 -28
@@ -1,11 +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,useState as l}from"react";import{filterDOMProps as u,inertValue as d,mergeRefs as f,useLayoutEffect as p,useLoadMoreSentinel as m}from"@react-aria/utils";import{FocusableContext as h}from"@react-aria/interactions";import"react-dom";import{mergeProps as g,useListBoxSection as _}from"react-aria";import"react-stately";var v=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),y=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});function b(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 x(e=!0){let[t,n]=l(e),r=c(!1),i=a(e=>{r.current=!0,n(!!e)},[]);return p(()=>{r.current||n(!1)},[]),[i,t]}function S(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 C={},w=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=C[t];return n||(n=r(S.bind(null,t)),C[t]=n),n}});String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;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]=j(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`;function j(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 M(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])}
2
- /**
3
- * @license React
4
- * use-sync-external-store-shim.production.js
5
- *
6
- * Copyright (c) Meta Platforms, Inc. and affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */
11
- var N=v((e=>{var t=y(`react`);function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore}));v(((e,t)=>{t.exports=N()}))();const P=n(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const F=n(null);function I(e){var t;return t=class extends T{},t.type=e,t}function L(t,n,r,i,s,c){typeof t==`string`&&(t=I(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(F);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(F.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function R(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(h);if(!o(P)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return L(t,r,a,`children`in r?r.children:null,null,t=>e.createElement(h.Provider,{value:s},e.createElement(i,{node:t})))});return a.displayName=n.name,a}function z(t,n,i=B){let a=({node:e})=>n(e.props,e.props.ref,e),o=r((n,r)=>L(t,n,r,null,i(n),t=>e.createElement(a,{node:t}))??e.createElement(e.Fragment,null));return o.displayName=n.name,o}function B(e){return M({...e,addIdAndValue:!0})}const V={CollectionRoot({collection:e,renderDropIndicator:t}){return H(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return H(e,t,n)}};function H(t,n,r){return M({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,U(t,n,r))}})}function U(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 W=n(V),G=n({}),K=n(null),q=r(function(t,n){let{render:r}=o(K);return e.createElement(e.Fragment,null,r(t,n))});function J(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(q,{target:t})},[n?.target,i,r]);return t?.useDropIndicator?o:void 0}const Y=n({}),X=n(null);function Z(t,n,r,i=`react-aria-ListBoxSection`){let a=o(X),{dragAndDropHooks:s,dropState:c}=o(G),{CollectionBranch:l}=o(W),[d,f]=x(),{headingProps:p,groupProps:m}=_({heading:f,"aria-label":t[`aria-label`]??void 0}),h=b({...t,id:void 0,children:void 0,defaultClassName:i,values:void 0}),v=u(t,{global:!0});return delete v.id,e.createElement(w.section,{...g(v,h,m),ref:n},e.createElement(Y.Provider,{value:{...p,ref:d}},e.createElement(l,{collection:a.collection,parent:r,renderDropIndicator:J(s,c)})))}const Q=z(A,Z);R(O,function(t,n,r){let i=o(X),{isLoading:a,onLoadMore:l,scrollOffset:f,...p}=t,h=c(null),_=s(()=>({onLoadMore:l,collection:i?.collection,sentinelRef:h,scrollOffset:f}),[l,f,i?.collection]);m(_,h);let v=b({...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:h,style:{position:`absolute`,height:1,width:1}})),a&&v.children&&e.createElement(w.div,{...g(u(t,{global:!0}),{tabIndex:-1}),...v,role:`option`,ref:n},v.children))});export{Q as ListBoxSection};
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,useState as l}from"react";import{filterDOMProps as u,inertValue as d,mergeRefs as f,useLayoutEffect as p,useLoadMoreSentinel as m}from"@react-aria/utils";import{FocusableContext as h}from"@react-aria/interactions";import"react-dom";import{mergeProps as g,useListBoxSection as _}from"react-aria";import"react-stately";function v(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 y(e=!0){let[t,n]=l(e),r=c(!1),i=a(e=>{r.current=!0,n(!!e)},[]);return p(()=>{r.current||n(!1)},[]),[i,t]}function b(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 x={},S=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=x[t];return n||(n=r(b.bind(null,t)),x[t]=n),n}});String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;var C=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}},w=class extends C{filter(e,t,n){let[r,i]=k(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},T=class extends C{};T.type=`header`;var E=class extends C{};E.type=`loader`;var D=class extends w{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};D.type=`item`;var O=class extends w{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}};O.type=`section`;function k(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 A(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 j=n(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const M=n(null);function N(e){var t;return t=class extends C{},t.type=e,t}function P(t,n,r,i,s,c){typeof t==`string`&&(t=N(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(M);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(M.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function F(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(h);if(!o(j)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return P(t,r,a,`children`in r?r.children:null,null,t=>e.createElement(h.Provider,{value:s},e.createElement(i,{node:t})))});return a.displayName=n.name,a}function I(t,n,i=L){let a=({node:e})=>n(e.props,e.props.ref,e),o=r((n,r)=>P(t,n,r,null,i(n),t=>e.createElement(a,{node:t}))??e.createElement(e.Fragment,null));return o.displayName=n.name,o}function L(e){return A({...e,addIdAndValue:!0})}const R={CollectionRoot({collection:e,renderDropIndicator:t}){return z(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return z(e,t,n)}};function z(t,n,r){return A({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,B(t,n,r))}})}function B(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 V=n(R),H=n({}),U=n(null),W=r(function(t,n){let{render:r}=o(U);return e.createElement(e.Fragment,null,r(t,n))});function G(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(W,{target:t})},[n?.target,i,r]);return t?.useDropIndicator?o:void 0}const K=n({}),q=n(null);function J(t,n,r,i=`react-aria-ListBoxSection`){let a=o(q),{dragAndDropHooks:s,dropState:c}=o(H),{CollectionBranch:l}=o(V),[d,f]=y(),{headingProps:p,groupProps:m}=_({heading:f,"aria-label":t[`aria-label`]??void 0}),h=v({...t,id:void 0,children:void 0,defaultClassName:i,values:void 0}),b=u(t,{global:!0});return delete b.id,e.createElement(S.section,{...g(b,h,m),ref:n},e.createElement(K.Provider,{value:{...p,ref:d}},e.createElement(l,{collection:a.collection,parent:r,renderDropIndicator:G(s,c)})))}const Y=I(O,J);F(E,function(t,n,r){let i=o(q),{isLoading:a,onLoadMore:l,scrollOffset:f,...p}=t,h=c(null),_=s(()=>({onLoadMore:l,collection:i?.collection,sentinelRef:h,scrollOffset:f}),[l,f,i?.collection]);m(_,h);let y=v({...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:h,style:{position:`absolute`,height:1,width:1}})),a&&y.children&&e.createElement(S.div,{...g(u(t,{global:!0}),{tabIndex:-1}),...y,role:`option`,ref:n},y.children))});export{Y as ListBoxSection};
@@ -1,11 +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}from"react";import{filterDOMProps as f,mergeProps as p,mergeRefs as m,useLayoutEffect as h,useObjectRef as g}from"@react-aria/utils";import"@react-aria/interactions";import{createPortal as _}from"react-dom";import{FocusScope as v,mergeProps as y,useMenu as b,useMenuSection as ee}from"react-aria";import{useMenuTriggerState as te,useTreeState as ne}from"react-stately";var x=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),re=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});n(null),n(null),n(null),n(null),n(null),n({});const S=n(null),C=n(null),ie=Symbol(`default`);function w({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function T(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 E(e,t){let n=o(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||ie;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 D(e,t,n){let{ref:r,...i}=E(n,e.slot)||{},a=g(c(()=>m(t,r),[t,r])),o=p(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 ae(e=!0){let[t,n]=d(e),r=u(!1),i=a(e=>{r.current=!0,n(!!e)},[]);return h(()=>{r.current||n(!1)},[]),[i,t]}function oe(t,n,r){let{render:i,...a}=n,o=u(null),s=c(()=>m(r,o),[r,o]);h(()=>{},[t,i]);let l={...a,ref:s};return i?i(l,void 0):e.createElement(t,l)}const O={},k=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=O[t];return n||(n=r(oe.bind(null,t)),O[t]=n),n}});String(Math.round(Math.random()*1e10));const se=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement,e.useId;function ce(){return!1}function le(){return!0}function ue(e){return()=>{}}function A(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore(ue,ce,le):o(se)}function de(e,t){return typeof t.getChildren==`function`?t.getChildren(e.key):e.childNodes}function fe(e){return pe(e,0)}function pe(e,t){if(t<0)return;let n=0;for(let r of e){if(n===t)return r;n++}}function j(e,t,n){if(t.parentKey===n.parentKey)return t.index-n.index;let r=[...M(e,t),t],i=[...M(e,n),n],a=r.slice(0,i.length).findIndex((e,t)=>e!==i[t]);return a===-1?r.findIndex(e=>e===n)>=0?1:(i.findIndex(e=>e===t),-1):(t=r[a],n=i[a],t.index-n.index)}function M(e,t){let n=[],r=t;for(;r?.parentKey!=null;)r=e.getItem(r.parentKey),r&&n.unshift(r);return n}const me=typeof document<`u`?e.useInsertionEffect??e.useLayoutEffect:()=>{};function he(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;me(()=>{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 N=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}},P=class extends N{filter(e,t,n){let[r,i]=z(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},F=class extends N{};F.type=`header`;var I=class extends N{};I.type=`loader`;var L=class extends P{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};L.type=`item`;var R=class extends P{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}};R.type=`section`;var ge=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}},_e=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 H(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 U=n(!1);function ve(t){if(o(U))return e.createElement(e.Fragment,null,t.children);let n=e.createElement(U.Provider,{value:!0},t.children);return e.createElement(`template`,{"data-react-aria-hidden":!0},n)}
2
- /**
3
- * @license React
4
- * use-sync-external-store-shim.production.js
5
- *
6
- * Copyright (c) Meta Platforms, Inc. and affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */
11
- var ye=x((e=>{var t=re(`react`);function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),be=x(((e,t)=>{t.exports=ye()}))();const xe=n(!1),W=n(null);function Se(t){if(o(W))return t.content;let{collection:n,document:r}=Ee(t.createCollection);return e.createElement(e.Fragment,null,e.createElement(ve,null,e.createElement(W.Provider,{value:r},t.content)),e.createElement(Ce,{render:t.children,collection:n}))}function Ce({collection:e,render:t}){return t(e)}function we(e,t,n){let r=A(),i=u(r);i.current=r;let o=a(()=>i.current?n():t(),[t,n]);return(0,be.useSyncExternalStore)(e,o)}const Te=typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore:we;function Ee(e){let[t]=d(()=>new _e(e?.()||new ge)),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:Te(n,r,i),document:t}}const De=n(null);function Oe(e){return H({...e,addIdAndValue:!0})}const G=n(null);function ke(t){let n=o(G),r=(n?.dependencies||[]).concat(t.dependencies),i=t.idScope??n?.idScope,a=Oe({...t,idScope:i,dependencies:r});return o(W)&&(a=e.createElement(Ae,null,a)),n=c(()=>({dependencies:r,idScope:i}),[i,...r]),e.createElement(G.Provider,{value:n},a)}function Ae({children:t}){let n=o(W),r=c(()=>e.createElement(W.Provider,{value:null},e.createElement(xe.Provider,{value:!0},t)),[t]);return A()?e.createElement(De.Provider,{value:n},r):_(r,n)}const je=n(null),Me={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 H({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,Ne(t,n,r))}})}function Ne(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(Me);function Pe(e){return c(()=>e==null?null:new Set([e]),[e])}const Fe=n({}),Ie=n(null);function Le(t){let n=u({});return e.createElement(Ie.Provider,{value:n},t.children)}const Re=n({});var ze=class extends N{filter(e,t){let n=t.getItem(this.prevKey);if(n&&n.type!==`separator`){let n=this.clone();return t.addDescendants(n,e),n}return null}};ze.type=`separator`;var J=class e extends Set{constructor(t,n,r){super(t),t instanceof e?(this.anchorKey=n??t.anchorKey,this.currentKey=r??t.currentKey):(this.anchorKey=n??null,this.currentKey=r??null)}};function Be(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Ve(e){let{selectionMode:t=`none`,disallowEmptySelection:n=!1,allowDuplicateSelectionEvents:r,selectionBehavior:i=`toggle`,disabledBehavior:a=`all`}=e,o=u(!1),[,l]=d(!1),f=u(null),p=u(null),[,m]=d(null),[h,g]=he(c(()=>Y(e.selectedKeys),[e.selectedKeys]),c(()=>Y(e.defaultSelectedKeys,new J),[e.defaultSelectedKeys]),e.onSelectionChange),_=c(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),[v,y]=d(i);i===`replace`&&v===`toggle`&&typeof h==`object`&&h.size===0&&y(`replace`);let b=u(i);return s(()=>{i!==b.current&&(y(i),b.current=i)},[i]),{selectionMode:t,disallowEmptySelection:n,selectionBehavior:v,setSelectionBehavior:y,get isFocused(){return o.current},setFocused(e){o.current=e,l(e)},get focusedKey(){return f.current},get childFocusStrategy(){return p.current},setFocusedKey(e,t=`first`){f.current=e,p.current=t,m(e)},selectedKeys:h,setSelectedKeys(e){(r||!Be(e,h))&&g(e)},disabledKeys:_,disabledBehavior:a}}function Y(e,t){return e?e===`all`?`all`:new J(e):t}var He=class e{get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}get isFocused(){return this.state.isFocused}setFocused(e){this.state.setFocused(e)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(e,t){(e==null||this.collection.getItem(e))&&this.state.setFocusedKey(e,t)}get selectedKeys(){return this.state.selectedKeys===`all`?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(e){if(this.state.selectionMode===`none`)return!1;let t=this.getKey(e);return t==null?!1:this.state.selectedKeys===`all`?this.canSelectItem(t):this.state.selectedKeys.has(t)}get isEmpty(){return this.state.selectedKeys!==`all`&&this.state.selectedKeys.size===0}get isSelectAll(){if(this.isEmpty)return!1;if(this.state.selectedKeys===`all`)return!0;if(this._isSelectAll!=null)return this._isSelectAll;let e=this.getSelectAllKeys(),t=this.state.selectedKeys;return this._isSelectAll=e.every(e=>t.has(e)),this._isSelectAll}get firstSelectedKey(){let e=null;for(let t of this.state.selectedKeys){let n=this.collection.getItem(t);(!e||n&&j(this.collection,n,e)<0)&&(e=n)}return e?.key??null}get lastSelectedKey(){let e=null;for(let t of this.state.selectedKeys){let n=this.collection.getItem(t);(!e||n&&j(this.collection,n,e)>0)&&(e=n)}return e?.key??null}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(e){if(this.selectionMode===`none`)return;if(this.selectionMode===`single`){this.replaceSelection(e);return}let t=this.getKey(e);if(t==null)return;let n;if(this.state.selectedKeys===`all`)n=new J([t],t,t);else{let e=this.state.selectedKeys,r=e.anchorKey??t;n=new J(e,r,t);for(let i of this.getKeyRange(r,e.currentKey??t))n.delete(i);for(let e of this.getKeyRange(t,r))this.canSelectItem(e)&&n.add(e)}this.state.setSelectedKeys(n)}getKeyRange(e,t){let n=this.collection.getItem(e),r=this.collection.getItem(t);return n&&r?j(this.collection,n,r)<=0?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){if(this.layoutDelegate?.getKeyRange)return this.layoutDelegate.getKeyRange(e,t);let n=[],r=e;for(;r!=null;){let e=this.collection.getItem(r);if(e&&(e.type===`item`||e.type===`cell`&&this.allowsCellSelection)&&n.push(r),r===t)return n;r=this.collection.getKeyAfter(r)}return[]}getKey(e){let t=this.collection.getItem(e);if(!t||t.type===`cell`&&this.allowsCellSelection)return e;for(;t&&t.type!==`item`&&t.parentKey!=null;)t=this.collection.getItem(t.parentKey);return!t||t.type!==`item`?null:t.key}toggleSelection(e){if(this.selectionMode===`none`)return;if(this.selectionMode===`single`&&!this.isSelected(e)){this.replaceSelection(e);return}let t=this.getKey(e);if(t==null)return;let n=new J(this.state.selectedKeys===`all`?this.getSelectAllKeys():this.state.selectedKeys);n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),!(this.disallowEmptySelection&&n.size===0)&&this.state.setSelectedKeys(n)}replaceSelection(e){if(this.selectionMode===`none`)return;let t=this.getKey(e);if(t==null)return;let n=this.canSelectItem(t)?new J([t],t,t):new J;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode===`none`)return;let t=new J;for(let n of e){let e=this.getKey(n);if(e!=null&&(t.add(e),this.selectionMode===`single`))break}this.state.setSelectedKeys(t)}getSelectAllKeys(){let e=[],t=n=>{for(;n!=null;){if(this.canSelectItem(n)){let r=this.collection.getItem(n);r?.type===`item`&&e.push(n),r?.hasChildNodes&&(this.allowsCellSelection||r.type!==`item`)&&t(fe(de(r,this.collection))?.key??null)}n=this.collection.getKeyAfter(n)}};return t(this.collection.getFirstKey()),e}selectAll(){!this.isSelectAll&&this.selectionMode===`multiple`&&this.state.setSelectedKeys(`all`)}clearSelection(){!this.disallowEmptySelection&&(this.state.selectedKeys===`all`||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new J)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(e,t){this.selectionMode!==`none`&&(this.selectionMode===`single`?this.isSelected(e)&&!this.disallowEmptySelection?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior===`toggle`||t&&(t.pointerType===`touch`||t.pointerType===`virtual`)?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys)return!0;let t=this.selectedKeys;if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;for(let n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){if(this.state.selectionMode===`none`||this.state.disabledKeys.has(e))return!1;let t=this.collection.getItem(e);return!(!t||t!=null&&t.props?.isDisabled||t.type===`cell`&&!this.allowsCellSelection)}isDisabled(e){var t;return this.state.disabledBehavior===`all`&&(this.state.disabledKeys.has(e)||!!((t=this.collection.getItem(e))!=null&&t.props?.isDisabled))}isLink(e){var t;return!!((t=this.collection.getItem(e))!=null&&t.props?.href)}getItemProps(e){return this.collection.getItem(e)?.props}withCollection(t){return new e(t,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0})}constructor(e,t,n){this.collection=e,this.state=t,this.allowsCellSelection=n?.allowsCellSelection??!1,this._isSelectAll=null,this.layoutDelegate=n?.layoutDelegate||null}};const Ue=n(null),X=n(null),Z=n(null),Q=n(null),We=n(null);var Ge=class extends N{filter(e,t,n){let r=e.getItem(this.firstChildKey);if(r&&n(r.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};Ge.type=`submenutrigger`;const Ke=r(function(t,n){return[t,n]=D(t,n,Ue),e.createElement(Se,{content:e.createElement(ke,t)},r=>e.createElement(qe,{props:t,collection:r,menuRef:n}))});function qe({props:t,collection:n,menuRef:r}){[t,r]=D(t,r,S);let{filter:i,...a}=t,s=c(()=>i?n.filter(i):n,[n,i]),l=ne({...t,collection:s,children:void 0}),u=o(Z),{isVirtualized:d,CollectionRoot:p}=o(q),{menuProps:m}=b({...t,isVirtualized:d,onClose:t.onClose||u?.close},l,r),h=T({...t,children:void 0,defaultClassName:`react-aria-Menu`,values:{isEmpty:l.collection.size===0}}),g=null;l.collection.size===0&&t.renderEmptyState&&(g=e.createElement(`div`,{role:`menuitem`,style:{display:`contents`}},t.renderEmptyState()));let _=f(t,{global:!0});return e.createElement(v,null,e.createElement(k.div,{...y(_,h,m),ref:r,slot:t.slot||void 0,"data-empty":l.collection.size===0||void 0,onScroll:t.onScroll},e.createElement(w,{values:[[X,l],[Re,{elementType:`div`}],[je,{name:`MenuSection`,render:Ye}],[We,{parentMenuRef:r,shouldUseVirtualFocus:a?.shouldUseVirtualFocus}],[$,{shouldCloseOnSelect:t.shouldCloseOnSelect}],[S,null],[C,null],[Q,l.selectionManager],[Z,u??te({})]]},e.createElement(Le,null,e.createElement(p,{collection:l.collection,persistedKeys:Pe(l.selectionManager.focusedKey),scrollRef:r}))),g))}var Je=class extends He{get focusedKey(){return this.parent.focusedKey}get isFocused(){return this.parent.isFocused}setFocusedKey(e,t){return this.parent.setFocusedKey(e,t)}setFocused(e){this.parent.setFocused(e)}get childFocusStrategy(){return this.parent.childFocusStrategy}constructor(e,t){super(e.collection,t),this.parent=e}};function Ye(t,n,r,i=`react-aria-MenuSection`){let a=o(X),{CollectionBranch:s}=o(q),[c,l]=ae(),{headingProps:u,groupProps:d}=ee({heading:l,"aria-label":r.props[`aria-label`]??void 0}),p=T({...t,id:void 0,children:void 0,defaultClassName:i,className:r.props?.className,style:r.props?.style,values:void 0}),m=o(Q),h=Ve(t),g=t.selectionMode==null?m:new Je(m,h),_=E($)?.shouldCloseOnSelect,v=f(t,{global:!0});return delete v.id,e.createElement(k.section,{...y(v,p,d),ref:n},e.createElement(w,{values:[[Fe,{...u,ref:c}],[Q,g],[$,{shouldCloseOnSelect:t.shouldCloseOnSelect??_}]]},e.createElement(s,{collection:a.collection,parent:r})))}const $=n(null);export{Ke as Menu};
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,mergeProps as m,mergeRefs as h,useLayoutEffect as g,useObjectRef as _}from"@react-aria/utils";import"@react-aria/interactions";import{createPortal as v}from"react-dom";import{FocusScope as y,mergeProps as b,useMenu as ee,useMenuSection as te}from"react-aria";import{useMenuTriggerState as ne,useTreeState as re}from"react-stately";n(null),n(null),n(null),n(null),n(null),n({});const x=n(null),ie=n(null),ae=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: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(e,t){let n=o(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||ae;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)||{},a=_(c(()=>h(t,r),[t,r])),o=m(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 oe(e=!0){let[t,n]=d(e),r=u(!1),i=a(e=>{r.current=!0,n(!!e)},[]);return g(()=>{r.current||n(!1)},[]),[i,t]}function se(t,n,r){let{render:i,...a}=n,o=u(null),s=c(()=>h(r,o),[r,o]);g(()=>{},[t,i]);let l={...a,ref:s};return i?i(l,void 0):e.createElement(t,l)}const E={},D=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=E[t];return n||(n=r(se.bind(null,t)),E[t]=n),n}});String(Math.round(Math.random()*1e10));const ce=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement,e.useId;function le(){return!1}function ue(){return!0}function de(e){return()=>{}}function O(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore(de,le,ue):o(ce)}function fe(e,t){return typeof t.getChildren==`function`?t.getChildren(e.key):e.childNodes}function pe(e){return me(e,0)}function me(e,t){if(t<0)return;let n=0;for(let r of e){if(n===t)return r;n++}}function k(e,t,n){if(t.parentKey===n.parentKey)return t.index-n.index;let r=[...A(e,t),t],i=[...A(e,n),n],a=r.slice(0,i.length).findIndex((e,t)=>e!==i[t]);return a===-1?r.findIndex(e=>e===n)>=0?1:(i.findIndex(e=>e===t),-1):(t=r[a],n=i[a],t.index-n.index)}function A(e,t){let n=[],r=t;for(;r?.parentKey!=null;)r=e.getItem(r.parentKey),r&&n.unshift(r);return n}const he=typeof document<`u`?e.useInsertionEffect??e.useLayoutEffect:()=>{};function ge(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;he(()=>{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 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]=R(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`;var L=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]=R(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 R(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 z=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}},B=class e extends z{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}},_e=class extends z{get isConnected(){return!0}createElement(e){return new B(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 B&&(!e.isConnected||e.isHidden)?this.removeNode(e):e.updateChildIndices();for(let e of this.dirtyNodes)e instanceof B?(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 V(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 H=n(!1);function ve(t){if(o(H))return e.createElement(e.Fragment,null,t.children);let n=e.createElement(H.Provider,{value:!0},t.children);return e.createElement(`template`,{"data-react-aria-hidden":!0},n)}const ye=n(!1),U=n(null);function be(t){if(o(U))return t.content;let{collection:n,document:r}=we(t.createCollection);return e.createElement(e.Fragment,null,e.createElement(ve,null,e.createElement(U.Provider,{value:r},t.content)),e.createElement(xe,{render:t.children,collection:n}))}function xe({collection:e,render:t}){return t(e)}function Se(e,t,n){let r=O(),i=u(r);i.current=r;let o=a(()=>i.current?n():t(),[t,n]);return f(e,o)}const Ce=typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore:Se;function we(e){let[t]=d(()=>new _e(e?.()||new L)),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:Ce(n,r,i),document:t}}const W=n(null);function Te(e){return V({...e,addIdAndValue:!0})}const G=n(null);function Ee(t){let n=o(G),r=(n?.dependencies||[]).concat(t.dependencies),i=t.idScope??n?.idScope,a=Te({...t,idScope:i,dependencies:r});return o(U)&&(a=e.createElement(De,null,a)),n=c(()=>({dependencies:r,idScope:i}),[i,...r]),e.createElement(G.Provider,{value:n},a)}function De({children:t}){let n=o(U),r=c(()=>e.createElement(U.Provider,{value:null},e.createElement(ye.Provider,{value:!0},t)),[t]);return O()?e.createElement(W.Provider,{value:n},r):v(r,n)}const Oe=n(null),ke={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 V({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,Ae(t,n,r))}})}function Ae(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(ke);function je(e){return c(()=>e==null?null:new Set([e]),[e])}const Me=n({}),Ne=n(null);function Pe(t){let n=u({});return e.createElement(Ne.Provider,{value:n},t.children)}const Fe=n({});var Ie=class extends j{filter(e,t){let n=t.getItem(this.prevKey);if(n&&n.type!==`separator`){let n=this.clone();return t.addDescendants(n,e),n}return null}};Ie.type=`separator`;var J=class e extends Set{constructor(t,n,r){super(t),t instanceof e?(this.anchorKey=n??t.anchorKey,this.currentKey=r??t.currentKey):(this.anchorKey=n??null,this.currentKey=r??null)}};function Le(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Re(e){let{selectionMode:t=`none`,disallowEmptySelection:n=!1,allowDuplicateSelectionEvents:r,selectionBehavior:i=`toggle`,disabledBehavior:a=`all`}=e,o=u(!1),[,l]=d(!1),f=u(null),p=u(null),[,m]=d(null),[h,g]=ge(c(()=>Y(e.selectedKeys),[e.selectedKeys]),c(()=>Y(e.defaultSelectedKeys,new J),[e.defaultSelectedKeys]),e.onSelectionChange),_=c(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),[v,y]=d(i);i===`replace`&&v===`toggle`&&typeof h==`object`&&h.size===0&&y(`replace`);let b=u(i);return s(()=>{i!==b.current&&(y(i),b.current=i)},[i]),{selectionMode:t,disallowEmptySelection:n,selectionBehavior:v,setSelectionBehavior:y,get isFocused(){return o.current},setFocused(e){o.current=e,l(e)},get focusedKey(){return f.current},get childFocusStrategy(){return p.current},setFocusedKey(e,t=`first`){f.current=e,p.current=t,m(e)},selectedKeys:h,setSelectedKeys(e){(r||!Le(e,h))&&g(e)},disabledKeys:_,disabledBehavior:a}}function Y(e,t){return e?e===`all`?`all`:new J(e):t}var ze=class e{get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}get isFocused(){return this.state.isFocused}setFocused(e){this.state.setFocused(e)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(e,t){(e==null||this.collection.getItem(e))&&this.state.setFocusedKey(e,t)}get selectedKeys(){return this.state.selectedKeys===`all`?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(e){if(this.state.selectionMode===`none`)return!1;let t=this.getKey(e);return t==null?!1:this.state.selectedKeys===`all`?this.canSelectItem(t):this.state.selectedKeys.has(t)}get isEmpty(){return this.state.selectedKeys!==`all`&&this.state.selectedKeys.size===0}get isSelectAll(){if(this.isEmpty)return!1;if(this.state.selectedKeys===`all`)return!0;if(this._isSelectAll!=null)return this._isSelectAll;let e=this.getSelectAllKeys(),t=this.state.selectedKeys;return this._isSelectAll=e.every(e=>t.has(e)),this._isSelectAll}get firstSelectedKey(){let e=null;for(let t of this.state.selectedKeys){let n=this.collection.getItem(t);(!e||n&&k(this.collection,n,e)<0)&&(e=n)}return e?.key??null}get lastSelectedKey(){let e=null;for(let t of this.state.selectedKeys){let n=this.collection.getItem(t);(!e||n&&k(this.collection,n,e)>0)&&(e=n)}return e?.key??null}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(e){if(this.selectionMode===`none`)return;if(this.selectionMode===`single`){this.replaceSelection(e);return}let t=this.getKey(e);if(t==null)return;let n;if(this.state.selectedKeys===`all`)n=new J([t],t,t);else{let e=this.state.selectedKeys,r=e.anchorKey??t;n=new J(e,r,t);for(let i of this.getKeyRange(r,e.currentKey??t))n.delete(i);for(let e of this.getKeyRange(t,r))this.canSelectItem(e)&&n.add(e)}this.state.setSelectedKeys(n)}getKeyRange(e,t){let n=this.collection.getItem(e),r=this.collection.getItem(t);return n&&r?k(this.collection,n,r)<=0?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){if(this.layoutDelegate?.getKeyRange)return this.layoutDelegate.getKeyRange(e,t);let n=[],r=e;for(;r!=null;){let e=this.collection.getItem(r);if(e&&(e.type===`item`||e.type===`cell`&&this.allowsCellSelection)&&n.push(r),r===t)return n;r=this.collection.getKeyAfter(r)}return[]}getKey(e){let t=this.collection.getItem(e);if(!t||t.type===`cell`&&this.allowsCellSelection)return e;for(;t&&t.type!==`item`&&t.parentKey!=null;)t=this.collection.getItem(t.parentKey);return!t||t.type!==`item`?null:t.key}toggleSelection(e){if(this.selectionMode===`none`)return;if(this.selectionMode===`single`&&!this.isSelected(e)){this.replaceSelection(e);return}let t=this.getKey(e);if(t==null)return;let n=new J(this.state.selectedKeys===`all`?this.getSelectAllKeys():this.state.selectedKeys);n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),!(this.disallowEmptySelection&&n.size===0)&&this.state.setSelectedKeys(n)}replaceSelection(e){if(this.selectionMode===`none`)return;let t=this.getKey(e);if(t==null)return;let n=this.canSelectItem(t)?new J([t],t,t):new J;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode===`none`)return;let t=new J;for(let n of e){let e=this.getKey(n);if(e!=null&&(t.add(e),this.selectionMode===`single`))break}this.state.setSelectedKeys(t)}getSelectAllKeys(){let e=[],t=n=>{for(;n!=null;){if(this.canSelectItem(n)){let r=this.collection.getItem(n);r?.type===`item`&&e.push(n),r?.hasChildNodes&&(this.allowsCellSelection||r.type!==`item`)&&t(pe(fe(r,this.collection))?.key??null)}n=this.collection.getKeyAfter(n)}};return t(this.collection.getFirstKey()),e}selectAll(){!this.isSelectAll&&this.selectionMode===`multiple`&&this.state.setSelectedKeys(`all`)}clearSelection(){!this.disallowEmptySelection&&(this.state.selectedKeys===`all`||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new J)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(e,t){this.selectionMode!==`none`&&(this.selectionMode===`single`?this.isSelected(e)&&!this.disallowEmptySelection?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior===`toggle`||t&&(t.pointerType===`touch`||t.pointerType===`virtual`)?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys)return!0;let t=this.selectedKeys;if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;for(let n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){if(this.state.selectionMode===`none`||this.state.disabledKeys.has(e))return!1;let t=this.collection.getItem(e);return!(!t||t!=null&&t.props?.isDisabled||t.type===`cell`&&!this.allowsCellSelection)}isDisabled(e){var t;return this.state.disabledBehavior===`all`&&(this.state.disabledKeys.has(e)||!!((t=this.collection.getItem(e))!=null&&t.props?.isDisabled))}isLink(e){var t;return!!((t=this.collection.getItem(e))!=null&&t.props?.href)}getItemProps(e){return this.collection.getItem(e)?.props}withCollection(t){return new e(t,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0})}constructor(e,t,n){this.collection=e,this.state=t,this.allowsCellSelection=n?.allowsCellSelection??!1,this._isSelectAll=null,this.layoutDelegate=n?.layoutDelegate||null}};const Be=n(null),X=n(null),Z=n(null),Q=n(null),Ve=n(null);var He=class extends j{filter(e,t,n){let r=e.getItem(this.firstChildKey);if(r&&n(r.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};He.type=`submenutrigger`;const Ue=r(function(t,n){return[t,n]=T(t,n,Be),e.createElement(be,{content:e.createElement(Ee,t)},r=>e.createElement(We,{props:t,collection:r,menuRef:n}))});function We({props:t,collection:n,menuRef:r}){[t,r]=T(t,r,x);let{filter:i,...a}=t,s=c(()=>i?n.filter(i):n,[n,i]),l=re({...t,collection:s,children:void 0}),u=o(Z),{isVirtualized:d,CollectionRoot:f}=o(q),{menuProps:m}=ee({...t,isVirtualized:d,onClose:t.onClose||u?.close},l,r),h=C({...t,children:void 0,defaultClassName:`react-aria-Menu`,values:{isEmpty:l.collection.size===0}}),g=null;l.collection.size===0&&t.renderEmptyState&&(g=e.createElement(`div`,{role:`menuitem`,style:{display:`contents`}},t.renderEmptyState()));let _=p(t,{global:!0});return e.createElement(y,null,e.createElement(D.div,{...b(_,h,m),ref:r,slot:t.slot||void 0,"data-empty":l.collection.size===0||void 0,onScroll:t.onScroll},e.createElement(S,{values:[[X,l],[Fe,{elementType:`div`}],[Oe,{name:`MenuSection`,render:Ke}],[Ve,{parentMenuRef:r,shouldUseVirtualFocus:a?.shouldUseVirtualFocus}],[$,{shouldCloseOnSelect:t.shouldCloseOnSelect}],[x,null],[ie,null],[Q,l.selectionManager],[Z,u??ne({})]]},e.createElement(Pe,null,e.createElement(f,{collection:l.collection,persistedKeys:je(l.selectionManager.focusedKey),scrollRef:r}))),g))}var Ge=class extends ze{get focusedKey(){return this.parent.focusedKey}get isFocused(){return this.parent.isFocused}setFocusedKey(e,t){return this.parent.setFocusedKey(e,t)}setFocused(e){this.parent.setFocused(e)}get childFocusStrategy(){return this.parent.childFocusStrategy}constructor(e,t){super(e.collection,t),this.parent=e}};function Ke(t,n,r,i=`react-aria-MenuSection`){let a=o(X),{CollectionBranch:s}=o(q),[c,l]=oe(),{headingProps:u,groupProps:d}=te({heading:l,"aria-label":r.props[`aria-label`]??void 0}),f=C({...t,id:void 0,children:void 0,defaultClassName:i,className:r.props?.className,style:r.props?.style,values:void 0}),m=o(Q),h=Re(t),g=t.selectionMode==null?m:new Ge(m,h),_=w($)?.shouldCloseOnSelect,v=p(t,{global:!0});return delete v.id,e.createElement(D.section,{...b(v,f,d),ref:n},e.createElement(S,{values:[[Me,{...u,ref:c}],[Q,g],[$,{shouldCloseOnSelect:t.shouldCloseOnSelect??_}]]},e.createElement(s,{collection:a.collection,parent:r})))}const $=n(null);export{Ue as Menu};
@@ -1,11 +1 @@
1
- import e,{createContext as t,forwardRef as n,useCallback as r,useContext as i,useMemo as a,useRef as o}from"react";import{filterDOMProps as s,mergeProps as c,mergeRefs as l,useLayoutEffect as u,useObjectRef as d}from"@react-aria/utils";import{FocusableContext as f}from"@react-aria/interactions";import"react-dom";import{mergeProps as p,useHover as m,useMenuItem as h}from"react-aria";import"react-stately";var g=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),_=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});const v=Symbol(`default`);function y({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function b(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 x(e,t){let n=i(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||v;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 S(e,t,n){let{ref:r,...i}=x(n,e.slot)||{},o=d(a(()=>l(t,r),[t,r])),s=c(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 C(t,n,r){let{render:i,...s}=n,c=o(null),d=a(()=>l(r,c),[r,c]);u(()=>{},[t,i]);let f={...s,ref:d};return i?i(f,void 0):e.createElement(t,f)}const w={},T=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let r=w[t];return r||(r=n(C.bind(null,t)),w[t]=r),r}});String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;var E=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}},D=class extends E{filter(e,t,n){let[r,i]=M(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},O=class extends E{};O.type=`header`;var k=class extends E{};k.type=`loader`;var A=class extends D{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};A.type=`item`;var j=class extends D{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}};j.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]}
2
- /**
3
- * @license React
4
- * use-sync-external-store-shim.production.js
5
- *
6
- * Copyright (c) Meta Platforms, Inc. and affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */
11
- var N=g((e=>{var t=_(`react`);function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore}));g(((e,t)=>{t.exports=N()}))();const P=t(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const F=t(null);function I(e){var t;return t=class extends E{},t.type=e,t}function L(t,n,a,o,s,c){typeof t==`string`&&(t=I(t));let l=r(e=>{e?.setProps(n,a,t,o,c)},[n,a,o,c,t]),u=i(F);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(F.Provider,{value:r},s):null}return e.createElement(t.type,{ref:l},s)}function R(t,r){let a=({node:e})=>r(e.props,e.props.ref,e),o=n((n,o)=>{let s=i(f);if(!i(P)){if(r.length>=3)throw Error(r.name+` cannot be rendered outside a collection.`);return r(n,o)}return L(t,n,o,`children`in n?n.children:null,null,t=>e.createElement(f.Provider,{value:s},e.createElement(a,{node:t})))});return o.displayName=r.name,o}const z=t({}),B=t({isSelected:!1}),V=t({}),H=t(null),U=t(null);var W=class extends E{filter(e,t,n){let r=e.getItem(this.firstChildKey);if(r&&n(r.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};W.type=`submenutrigger`;const G=t(null),K=R(A,function(t,n,r){[t,n]=S(t,n,G);let a=x(G)?.id,o=i(H),c=d(n),l=i(U),{menuItemProps:u,labelProps:f,descriptionProps:g,keyboardShortcutProps:_,...C}=h({...t,id:a,key:r.key,selectionManager:l},o,c),{hoverProps:w,isHovered:E}=m({isDisabled:C.isDisabled}),D=b({...t,id:void 0,children:r.rendered,defaultClassName:`react-aria-MenuItem`,values:{...C,isHovered:E,isFocusVisible:C.isFocusVisible,selectionMode:l.selectionMode,selectionBehavior:l.selectionBehavior,hasSubmenu:!!t[`aria-haspopup`],isOpen:t[`aria-expanded`]===`true`}}),O=t.href?T.a:T.div,k=s(t,{global:!0});return delete k.id,delete k.onClick,e.createElement(O,{...p(k,D,u,w),ref:c,"data-disabled":C.isDisabled||void 0,"data-hovered":E||void 0,"data-focused":C.isFocused||void 0,"data-focus-visible":C.isFocusVisible||void 0,"data-pressed":C.isPressed||void 0,"data-selected":C.isSelected||void 0,"data-selection-mode":l.selectionMode===`none`?void 0:l.selectionMode,"data-has-submenu":!!t[`aria-haspopup`]||void 0,"data-open":t[`aria-expanded`]===`true`||void 0},e.createElement(y,{values:[[z,{slots:{[v]:f,label:f,description:g}}],[V,_],[B,{isSelected:C.isSelected}]]},D.children))});export{K as MenuItem};
1
+ import e,{createContext as t,forwardRef as n,useCallback as r,useContext as i,useMemo as a,useRef as o}from"react";import{filterDOMProps as s,mergeProps as c,mergeRefs as l,useLayoutEffect as u,useObjectRef as d}from"@react-aria/utils";import{FocusableContext as f}from"@react-aria/interactions";import"react-dom";import{mergeProps as p,useHover as m,useMenuItem as h}from"react-aria";import"react-stately";const g=Symbol(`default`);function _({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function v(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 y(e,t){let n=i(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||g;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 b(e,t,n){let{ref:r,...i}=y(n,e.slot)||{},o=d(a(()=>l(t,r),[t,r])),s=c(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 x(t,n,r){let{render:i,...s}=n,c=o(null),d=a(()=>l(r,c),[r,c]);u(()=>{},[t,i]);let f={...s,ref:d};return i?i(f,void 0):e.createElement(t,f)}const S={},C=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let r=S[t];return r||(r=n(x.bind(null,t)),S[t]=r),r}});String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;var w=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}},T=class extends w{filter(e,t,n){let[r,i]=A(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},E=class extends w{};E.type=`header`;var D=class extends w{};D.type=`loader`;var O=class extends T{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};O.type=`item`;var k=class extends T{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}};k.type=`section`;function A(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]}const j=t(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const M=t(null);function N(e){var t;return t=class extends w{},t.type=e,t}function P(t,n,a,o,s,c){typeof t==`string`&&(t=N(t));let l=r(e=>{e?.setProps(n,a,t,o,c)},[n,a,o,c,t]),u=i(M);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(M.Provider,{value:r},s):null}return e.createElement(t.type,{ref:l},s)}function F(t,r){let a=({node:e})=>r(e.props,e.props.ref,e),o=n((n,o)=>{let s=i(f);if(!i(j)){if(r.length>=3)throw Error(r.name+` cannot be rendered outside a collection.`);return r(n,o)}return P(t,n,o,`children`in n?n.children:null,null,t=>e.createElement(f.Provider,{value:s},e.createElement(a,{node:t})))});return o.displayName=r.name,o}const I=t({}),L=t({isSelected:!1}),R=t({}),z=t(null),B=t(null);var V=class extends w{filter(e,t,n){let r=e.getItem(this.firstChildKey);if(r&&n(r.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};V.type=`submenutrigger`;const H=t(null),U=F(O,function(t,n,r){[t,n]=b(t,n,H);let a=y(H)?.id,o=i(z),c=d(n),l=i(B),{menuItemProps:u,labelProps:f,descriptionProps:x,keyboardShortcutProps:S,...w}=h({...t,id:a,key:r.key,selectionManager:l},o,c),{hoverProps:T,isHovered:E}=m({isDisabled:w.isDisabled}),D=v({...t,id:void 0,children:r.rendered,defaultClassName:`react-aria-MenuItem`,values:{...w,isHovered:E,isFocusVisible:w.isFocusVisible,selectionMode:l.selectionMode,selectionBehavior:l.selectionBehavior,hasSubmenu:!!t[`aria-haspopup`],isOpen:t[`aria-expanded`]===`true`}}),O=t.href?C.a:C.div,k=s(t,{global:!0});return delete k.id,delete k.onClick,e.createElement(O,{...p(k,D,u,T),ref:c,"data-disabled":w.isDisabled||void 0,"data-hovered":E||void 0,"data-focused":w.isFocused||void 0,"data-focus-visible":w.isFocusVisible||void 0,"data-pressed":w.isPressed||void 0,"data-selected":w.isSelected||void 0,"data-selection-mode":l.selectionMode===`none`?void 0:l.selectionMode,"data-has-submenu":!!t[`aria-haspopup`]||void 0,"data-open":t[`aria-expanded`]===`true`||void 0},e.createElement(_,{values:[[I,{slots:{[g]:f,label:f,description:x}}],[R,S],[L,{isSelected:w.isSelected}]]},D.children))});export{U as MenuItem};
@@ -1,11 +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}from"react";import{filterDOMProps as f,mergeRefs as p,useLayoutEffect as m}from"@react-aria/utils";import"@react-aria/interactions";import"react-dom";import{mergeProps as h,useMenuSection as g}from"react-aria";import"react-stately";var _=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),v=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});const y=Symbol(`default`);function b({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function x(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 ee(e,t){let n=o(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||y;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 S(e=!0){let[t,n]=d(e),r=u(!1),i=a(e=>{r.current=!0,n(!!e)},[]);return m(()=>{r.current||n(!1)},[]),[i,t]}function C(t,n,r){let{render:i,...a}=n,o=u(null),s=c(()=>p(r,o),[r,o]);m(()=>{},[t,i]);let l={...a,ref:s};return i?i(l,void 0):e.createElement(t,l)}const w={},te=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=w[t];return n||(n=r(C.bind(null,t)),w[t]=n),n}});String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;function T(e,t){return typeof t.getChildren==`function`?t.getChildren(e.key):e.childNodes}function E(e){return D(e,0)}function D(e,t){if(t<0)return;let n=0;for(let r of e){if(n===t)return r;n++}}function O(e,t,n){if(t.parentKey===n.parentKey)return t.index-n.index;let r=[...k(e,t),t],i=[...k(e,n),n],a=r.slice(0,i.length).findIndex((e,t)=>e!==i[t]);return a===-1?r.findIndex(e=>e===n)>=0?1:(i.findIndex(e=>e===t),-1):(t=r[a],n=i[a],t.index-n.index)}function k(e,t){let n=[],r=t;for(;r?.parentKey!=null;)r=e.getItem(r.parentKey),r&&n.unshift(r);return n}const ne=typeof document<`u`?e.useInsertionEffect??e.useLayoutEffect:()=>{};function re(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;ne(()=>{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 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])}
2
- /**
3
- * @license React
4
- * use-sync-external-store-shim.production.js
5
- *
6
- * Copyright (c) Meta Platforms, Inc. and affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */
11
- var R=_((e=>{var t=v(`react`);function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore}));_(((e,t)=>{t.exports=R()}))(),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,i=U){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 U(e){return L({...e,addIdAndValue:!0})}const W={CollectionRoot({collection:e,renderDropIndicator:t}){return G(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return G(e,t,n)}};function G(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,K(t,n,r))}})}function K(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(W),J=n({});var Y=class e extends Set{constructor(t,n,r){super(t),t instanceof e?(this.anchorKey=n??t.anchorKey,this.currentKey=r??t.currentKey):(this.anchorKey=n??null,this.currentKey=r??null)}};function ie(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function ae(e){let{selectionMode:t=`none`,disallowEmptySelection:n=!1,allowDuplicateSelectionEvents:r,selectionBehavior:i=`toggle`,disabledBehavior:a=`all`}=e,o=u(!1),[,l]=d(!1),f=u(null),p=u(null),[,m]=d(null),[h,g]=re(c(()=>X(e.selectedKeys),[e.selectedKeys]),c(()=>X(e.defaultSelectedKeys,new Y),[e.defaultSelectedKeys]),e.onSelectionChange),_=c(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),[v,y]=d(i);i===`replace`&&v===`toggle`&&typeof h==`object`&&h.size===0&&y(`replace`);let b=u(i);return s(()=>{i!==b.current&&(y(i),b.current=i)},[i]),{selectionMode:t,disallowEmptySelection:n,selectionBehavior:v,setSelectionBehavior:y,get isFocused(){return o.current},setFocused(e){o.current=e,l(e)},get focusedKey(){return f.current},get childFocusStrategy(){return p.current},setFocusedKey(e,t=`first`){f.current=e,p.current=t,m(e)},selectedKeys:h,setSelectedKeys(e){(r||!ie(e,h))&&g(e)},disabledKeys:_,disabledBehavior:a}}function X(e,t){return e?e===`all`?`all`:new Y(e):t}var oe=class e{get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}get isFocused(){return this.state.isFocused}setFocused(e){this.state.setFocused(e)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(e,t){(e==null||this.collection.getItem(e))&&this.state.setFocusedKey(e,t)}get selectedKeys(){return this.state.selectedKeys===`all`?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(e){if(this.state.selectionMode===`none`)return!1;let t=this.getKey(e);return t==null?!1:this.state.selectedKeys===`all`?this.canSelectItem(t):this.state.selectedKeys.has(t)}get isEmpty(){return this.state.selectedKeys!==`all`&&this.state.selectedKeys.size===0}get isSelectAll(){if(this.isEmpty)return!1;if(this.state.selectedKeys===`all`)return!0;if(this._isSelectAll!=null)return this._isSelectAll;let e=this.getSelectAllKeys(),t=this.state.selectedKeys;return this._isSelectAll=e.every(e=>t.has(e)),this._isSelectAll}get firstSelectedKey(){let e=null;for(let t of this.state.selectedKeys){let n=this.collection.getItem(t);(!e||n&&O(this.collection,n,e)<0)&&(e=n)}return e?.key??null}get lastSelectedKey(){let e=null;for(let t of this.state.selectedKeys){let n=this.collection.getItem(t);(!e||n&&O(this.collection,n,e)>0)&&(e=n)}return e?.key??null}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(e){if(this.selectionMode===`none`)return;if(this.selectionMode===`single`){this.replaceSelection(e);return}let t=this.getKey(e);if(t==null)return;let n;if(this.state.selectedKeys===`all`)n=new Y([t],t,t);else{let e=this.state.selectedKeys,r=e.anchorKey??t;n=new Y(e,r,t);for(let i of this.getKeyRange(r,e.currentKey??t))n.delete(i);for(let e of this.getKeyRange(t,r))this.canSelectItem(e)&&n.add(e)}this.state.setSelectedKeys(n)}getKeyRange(e,t){let n=this.collection.getItem(e),r=this.collection.getItem(t);return n&&r?O(this.collection,n,r)<=0?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){if(this.layoutDelegate?.getKeyRange)return this.layoutDelegate.getKeyRange(e,t);let n=[],r=e;for(;r!=null;){let e=this.collection.getItem(r);if(e&&(e.type===`item`||e.type===`cell`&&this.allowsCellSelection)&&n.push(r),r===t)return n;r=this.collection.getKeyAfter(r)}return[]}getKey(e){let t=this.collection.getItem(e);if(!t||t.type===`cell`&&this.allowsCellSelection)return e;for(;t&&t.type!==`item`&&t.parentKey!=null;)t=this.collection.getItem(t.parentKey);return!t||t.type!==`item`?null:t.key}toggleSelection(e){if(this.selectionMode===`none`)return;if(this.selectionMode===`single`&&!this.isSelected(e)){this.replaceSelection(e);return}let t=this.getKey(e);if(t==null)return;let n=new Y(this.state.selectedKeys===`all`?this.getSelectAllKeys():this.state.selectedKeys);n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),!(this.disallowEmptySelection&&n.size===0)&&this.state.setSelectedKeys(n)}replaceSelection(e){if(this.selectionMode===`none`)return;let t=this.getKey(e);if(t==null)return;let n=this.canSelectItem(t)?new Y([t],t,t):new Y;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode===`none`)return;let t=new Y;for(let n of e){let e=this.getKey(n);if(e!=null&&(t.add(e),this.selectionMode===`single`))break}this.state.setSelectedKeys(t)}getSelectAllKeys(){let e=[],t=n=>{for(;n!=null;){if(this.canSelectItem(n)){let r=this.collection.getItem(n);r?.type===`item`&&e.push(n),r?.hasChildNodes&&(this.allowsCellSelection||r.type!==`item`)&&t(E(T(r,this.collection))?.key??null)}n=this.collection.getKeyAfter(n)}};return t(this.collection.getFirstKey()),e}selectAll(){!this.isSelectAll&&this.selectionMode===`multiple`&&this.state.setSelectedKeys(`all`)}clearSelection(){!this.disallowEmptySelection&&(this.state.selectedKeys===`all`||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new Y)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(e,t){this.selectionMode!==`none`&&(this.selectionMode===`single`?this.isSelected(e)&&!this.disallowEmptySelection?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior===`toggle`||t&&(t.pointerType===`touch`||t.pointerType===`virtual`)?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys)return!0;let t=this.selectedKeys;if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;for(let n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){if(this.state.selectionMode===`none`||this.state.disabledKeys.has(e))return!1;let t=this.collection.getItem(e);return!(!t||t!=null&&t.props?.isDisabled||t.type===`cell`&&!this.allowsCellSelection)}isDisabled(e){var t;return this.state.disabledBehavior===`all`&&(this.state.disabledKeys.has(e)||!!((t=this.collection.getItem(e))!=null&&t.props?.isDisabled))}isLink(e){var t;return!!((t=this.collection.getItem(e))!=null&&t.props?.href)}getItemProps(e){return this.collection.getItem(e)?.props}withCollection(t){return new e(t,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0})}constructor(e,t,n){this.collection=e,this.state=t,this.allowsCellSelection=n?.allowsCellSelection??!1,this._isSelectAll=null,this.layoutDelegate=n?.layoutDelegate||null}};const se=n(null),Z=n(null);var ce=class extends A{filter(e,t,n){let r=e.getItem(this.firstChildKey);if(r&&n(r.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};ce.type=`submenutrigger`;var le=class extends oe{get focusedKey(){return this.parent.focusedKey}get isFocused(){return this.parent.isFocused}setFocusedKey(e,t){return this.parent.setFocusedKey(e,t)}setFocused(e){this.parent.setFocused(e)}get childFocusStrategy(){return this.parent.childFocusStrategy}constructor(e,t){super(e.collection,t),this.parent=e}};function ue(t,n,r,i=`react-aria-MenuSection`){let a=o(se),{CollectionBranch:s}=o(q),[c,l]=S(),{headingProps:u,groupProps:d}=g({heading:l,"aria-label":r.props[`aria-label`]??void 0}),p=x({...t,id:void 0,children:void 0,defaultClassName:i,className:r.props?.className,style:r.props?.style,values:void 0}),m=o(Z),_=ae(t),v=t.selectionMode==null?m:new le(m,_),y=ee($)?.shouldCloseOnSelect,C=f(t,{global:!0});return delete C.id,e.createElement(te.section,{...h(C,p,d),ref:n},e.createElement(b,{values:[[J,{...u,ref:c}],[Z,v],[$,{shouldCloseOnSelect:t.shouldCloseOnSelect??y}]]},e.createElement(s,{collection:a.collection,parent:r})))}const Q=H(F,ue),$=n(null);export{Q as MenuSection};
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}from"react";import{filterDOMProps as f,mergeRefs as p,useLayoutEffect as m}from"@react-aria/utils";import"@react-aria/interactions";import"react-dom";import{mergeProps as h,useMenuSection as g}from"react-aria";import"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: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 b(e,t){let n=o(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=!0){let[t,n]=d(e),r=u(!1),i=a(e=>{r.current=!0,n(!!e)},[]);return m(()=>{r.current||n(!1)},[]),[i,t]}function S(t,n,r){let{render:i,...a}=n,o=u(null),s=c(()=>p(r,o),[r,o]);m(()=>{},[t,i]);let l={...a,ref:s};return i?i(l,void 0):e.createElement(t,l)}const C={},w=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=C[t];return n||(n=r(S.bind(null,t)),C[t]=n),n}});String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;function T(e,t){return typeof t.getChildren==`function`?t.getChildren(e.key):e.childNodes}function E(e){return D(e,0)}function D(e,t){if(t<0)return;let n=0;for(let r of e){if(n===t)return r;n++}}function O(e,t,n){if(t.parentKey===n.parentKey)return t.index-n.index;let r=[...k(e,t),t],i=[...k(e,n),n],a=r.slice(0,i.length).findIndex((e,t)=>e!==i[t]);return a===-1?r.findIndex(e=>e===n)>=0?1:(i.findIndex(e=>e===t),-1):(t=r[a],n=i[a],t.index-n.index)}function k(e,t){let n=[],r=t;for(;r?.parentKey!=null;)r=e.getItem(r.parentKey),r&&n.unshift(r);return n}const A=typeof document<`u`?e.useInsertionEffect??e.useLayoutEffect:()=>{};function ee(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;A(()=>{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 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]=I(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 te=class extends M{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};te.type=`item`;var F=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}};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])}typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const R=n(null);function z(e){var t;return t=class extends j{},t.type=e,t}function B(t,n,r,i,s,c){typeof t==`string`&&(t=z(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(R);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(R.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function V(t,n,i=H){let a=({node:e})=>n(e.props,e.props.ref,e),o=r((n,r)=>B(t,n,r,null,i(n),t=>e.createElement(a,{node:t}))??e.createElement(e.Fragment,null));return o.displayName=n.name,o}function H(e){return L({...e,addIdAndValue:!0})}const U={CollectionRoot({collection:e,renderDropIndicator:t}){return W(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return W(e,t,n)}};function W(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,G(t,n,r))}})}function G(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 K=n(U),q=n({});var J=class e extends Set{constructor(t,n,r){super(t),t instanceof e?(this.anchorKey=n??t.anchorKey,this.currentKey=r??t.currentKey):(this.anchorKey=n??null,this.currentKey=r??null)}};function Y(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function X(e){let{selectionMode:t=`none`,disallowEmptySelection:n=!1,allowDuplicateSelectionEvents:r,selectionBehavior:i=`toggle`,disabledBehavior:a=`all`}=e,o=u(!1),[,l]=d(!1),f=u(null),p=u(null),[,m]=d(null),[h,g]=ee(c(()=>Z(e.selectedKeys),[e.selectedKeys]),c(()=>Z(e.defaultSelectedKeys,new J),[e.defaultSelectedKeys]),e.onSelectionChange),_=c(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),[v,y]=d(i);i===`replace`&&v===`toggle`&&typeof h==`object`&&h.size===0&&y(`replace`);let b=u(i);return s(()=>{i!==b.current&&(y(i),b.current=i)},[i]),{selectionMode:t,disallowEmptySelection:n,selectionBehavior:v,setSelectionBehavior:y,get isFocused(){return o.current},setFocused(e){o.current=e,l(e)},get focusedKey(){return f.current},get childFocusStrategy(){return p.current},setFocusedKey(e,t=`first`){f.current=e,p.current=t,m(e)},selectedKeys:h,setSelectedKeys(e){(r||!Y(e,h))&&g(e)},disabledKeys:_,disabledBehavior:a}}function Z(e,t){return e?e===`all`?`all`:new J(e):t}var ne=class e{get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}get isFocused(){return this.state.isFocused}setFocused(e){this.state.setFocused(e)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(e,t){(e==null||this.collection.getItem(e))&&this.state.setFocusedKey(e,t)}get selectedKeys(){return this.state.selectedKeys===`all`?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(e){if(this.state.selectionMode===`none`)return!1;let t=this.getKey(e);return t==null?!1:this.state.selectedKeys===`all`?this.canSelectItem(t):this.state.selectedKeys.has(t)}get isEmpty(){return this.state.selectedKeys!==`all`&&this.state.selectedKeys.size===0}get isSelectAll(){if(this.isEmpty)return!1;if(this.state.selectedKeys===`all`)return!0;if(this._isSelectAll!=null)return this._isSelectAll;let e=this.getSelectAllKeys(),t=this.state.selectedKeys;return this._isSelectAll=e.every(e=>t.has(e)),this._isSelectAll}get firstSelectedKey(){let e=null;for(let t of this.state.selectedKeys){let n=this.collection.getItem(t);(!e||n&&O(this.collection,n,e)<0)&&(e=n)}return e?.key??null}get lastSelectedKey(){let e=null;for(let t of this.state.selectedKeys){let n=this.collection.getItem(t);(!e||n&&O(this.collection,n,e)>0)&&(e=n)}return e?.key??null}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(e){if(this.selectionMode===`none`)return;if(this.selectionMode===`single`){this.replaceSelection(e);return}let t=this.getKey(e);if(t==null)return;let n;if(this.state.selectedKeys===`all`)n=new J([t],t,t);else{let e=this.state.selectedKeys,r=e.anchorKey??t;n=new J(e,r,t);for(let i of this.getKeyRange(r,e.currentKey??t))n.delete(i);for(let e of this.getKeyRange(t,r))this.canSelectItem(e)&&n.add(e)}this.state.setSelectedKeys(n)}getKeyRange(e,t){let n=this.collection.getItem(e),r=this.collection.getItem(t);return n&&r?O(this.collection,n,r)<=0?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){if(this.layoutDelegate?.getKeyRange)return this.layoutDelegate.getKeyRange(e,t);let n=[],r=e;for(;r!=null;){let e=this.collection.getItem(r);if(e&&(e.type===`item`||e.type===`cell`&&this.allowsCellSelection)&&n.push(r),r===t)return n;r=this.collection.getKeyAfter(r)}return[]}getKey(e){let t=this.collection.getItem(e);if(!t||t.type===`cell`&&this.allowsCellSelection)return e;for(;t&&t.type!==`item`&&t.parentKey!=null;)t=this.collection.getItem(t.parentKey);return!t||t.type!==`item`?null:t.key}toggleSelection(e){if(this.selectionMode===`none`)return;if(this.selectionMode===`single`&&!this.isSelected(e)){this.replaceSelection(e);return}let t=this.getKey(e);if(t==null)return;let n=new J(this.state.selectedKeys===`all`?this.getSelectAllKeys():this.state.selectedKeys);n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),!(this.disallowEmptySelection&&n.size===0)&&this.state.setSelectedKeys(n)}replaceSelection(e){if(this.selectionMode===`none`)return;let t=this.getKey(e);if(t==null)return;let n=this.canSelectItem(t)?new J([t],t,t):new J;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode===`none`)return;let t=new J;for(let n of e){let e=this.getKey(n);if(e!=null&&(t.add(e),this.selectionMode===`single`))break}this.state.setSelectedKeys(t)}getSelectAllKeys(){let e=[],t=n=>{for(;n!=null;){if(this.canSelectItem(n)){let r=this.collection.getItem(n);r?.type===`item`&&e.push(n),r?.hasChildNodes&&(this.allowsCellSelection||r.type!==`item`)&&t(E(T(r,this.collection))?.key??null)}n=this.collection.getKeyAfter(n)}};return t(this.collection.getFirstKey()),e}selectAll(){!this.isSelectAll&&this.selectionMode===`multiple`&&this.state.setSelectedKeys(`all`)}clearSelection(){!this.disallowEmptySelection&&(this.state.selectedKeys===`all`||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new J)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(e,t){this.selectionMode!==`none`&&(this.selectionMode===`single`?this.isSelected(e)&&!this.disallowEmptySelection?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior===`toggle`||t&&(t.pointerType===`touch`||t.pointerType===`virtual`)?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys)return!0;let t=this.selectedKeys;if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;for(let n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){if(this.state.selectionMode===`none`||this.state.disabledKeys.has(e))return!1;let t=this.collection.getItem(e);return!(!t||t!=null&&t.props?.isDisabled||t.type===`cell`&&!this.allowsCellSelection)}isDisabled(e){var t;return this.state.disabledBehavior===`all`&&(this.state.disabledKeys.has(e)||!!((t=this.collection.getItem(e))!=null&&t.props?.isDisabled))}isLink(e){var t;return!!((t=this.collection.getItem(e))!=null&&t.props?.href)}getItemProps(e){return this.collection.getItem(e)?.props}withCollection(t){return new e(t,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0})}constructor(e,t,n){this.collection=e,this.state=t,this.allowsCellSelection=n?.allowsCellSelection??!1,this._isSelectAll=null,this.layoutDelegate=n?.layoutDelegate||null}};const re=n(null),Q=n(null);var ie=class extends j{filter(e,t,n){let r=e.getItem(this.firstChildKey);if(r&&n(r.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};ie.type=`submenutrigger`;var ae=class extends ne{get focusedKey(){return this.parent.focusedKey}get isFocused(){return this.parent.isFocused}setFocusedKey(e,t){return this.parent.setFocusedKey(e,t)}setFocused(e){this.parent.setFocused(e)}get childFocusStrategy(){return this.parent.childFocusStrategy}constructor(e,t){super(e.collection,t),this.parent=e}};function oe(t,n,r,i=`react-aria-MenuSection`){let a=o(re),{CollectionBranch:s}=o(K),[c,l]=x(),{headingProps:u,groupProps:d}=g({heading:l,"aria-label":r.props[`aria-label`]??void 0}),p=y({...t,id:void 0,children:void 0,defaultClassName:i,className:r.props?.className,style:r.props?.style,values:void 0}),m=o(Q),_=X(t),S=t.selectionMode==null?m:new ae(m,_),C=b($)?.shouldCloseOnSelect,T=f(t,{global:!0});return delete T.id,e.createElement(w.section,{...h(T,p,d),ref:n},e.createElement(v,{values:[[q,{...u,ref:c}],[Q,S],[$,{shouldCloseOnSelect:t.shouldCloseOnSelect??C}]]},e.createElement(s,{collection:a.collection,parent:r})))}const se=V(F,oe),$=n(null);export{se as MenuSection};
@@ -1,3 +1,3 @@
1
- import { t as Menu } from "../Menu-CXlFN-mb.js";
2
- import { r as MenuItem } from "../MenuDesktop-CuQBZODp.js";
1
+ import { t as Menu } from "../Menu-BxbxSqMx.js";
2
+ import { r as MenuItem } from "../MenuDesktop-Dv25P83N.js";
3
3
  export { Menu, MenuItem };
@@ -1,2 +1,2 @@
1
- import { t as Modal } from "../Modal-Cerq7LEf.js";
1
+ import { t as Modal } from "../Modal-r0ucQNPK.js";
2
2
  export { Modal };
@@ -1,6 +1,6 @@
1
1
  import { n as FieldValues } from "../form.binding-DWlFTecs.js";
2
2
  import { s as SelectItem } from "../SelectBase-aSvWd7Cx.js";
3
- import { n as QueryFn, t as QueryAutocompleteProps } from "../queryAutocomplete.types-DaTDttX5.js";
3
+ import { n as QueryFn, t as QueryAutocompleteProps } from "../queryAutocomplete.types-BOH9QnRq.js";
4
4
  //#region src/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts
5
5
  declare const QueryAutocompleteComponent: <TFieldValues extends FieldValues, TSelectItem extends SelectItem<any>, TQueryFn extends QueryFn>(props: QueryAutocompleteProps<TFieldValues, TSelectItem, TQueryFn>) => import("react/jsx-runtime").JSX.Element;
6
6
  declare const QueryAutocomplete: typeof QueryAutocompleteComponent;
@@ -6,7 +6,7 @@ import { n as getQueryItems, r as getSelectionIdsToResolve, t as useQueryAutocom
6
6
  import { memo, useCallback, useMemo, useState } from "react";
7
7
  import { jsx } from "react/jsx-runtime";
8
8
  //#region src/components/inputs/Selection/Autocomplete/QueryAutocomplete.tsx
9
- const LoadedQueryAutocompleteContent = ({ query, queryParams, queryOptions, queryMap, resolveSelectedItemsWithIds, isQueryEnabledInitially = false, leadingContent, ...props }) => {
9
+ const LoadedQueryAutocompleteContent = ({ query, queryParams, queryOptions, queryMap, resolveSelectedItemsWithIds, isQueryEnabledInitially = false, preloadQuery: _preloadQuery, leadingContent, ...props }) => {
10
10
  "use no memo";
11
11
  const ui = UIConfig.useConfig();
12
12
  const [search, setSearch] = useState("");
@@ -59,7 +59,7 @@ const LoadedQueryAutocompleteContent = ({ query, queryParams, queryOptions, quer
59
59
  });
60
60
  };
61
61
  const QueryAutocompleteContent = (props) => {
62
- const [isQueryMounted, setIsQueryMounted] = useState(false);
62
+ const [isQueryMounted, setIsQueryMounted] = useState(props.preloadQuery ?? false);
63
63
  const value = "value" in props ? props.value : void 0;
64
64
  if (!getSelectionIdsToResolve({
65
65
  initialSelection: props.initialSelection,
@@ -69,7 +69,7 @@ const QueryAutocompleteContent = (props) => {
69
69
  ...props,
70
70
  isQueryEnabledInitially: isQueryMounted
71
71
  });
72
- const { query: _, queryParams: _queryParams, queryOptions: _queryOptions, queryMap: _queryMap, resolveSelectedItemsWithIds: _resolveSelectedItemsWithIds, isInitialQueryDisabled: _isInitialQueryDisabled, ...autocompleteProps } = props;
72
+ const { query: _, queryParams: _queryParams, queryOptions: _queryOptions, queryMap: _queryMap, resolveSelectedItemsWithIds: _resolveSelectedItemsWithIds, isInitialQueryDisabled: _isInitialQueryDisabled, preloadQuery: _preloadQuery, ...autocompleteProps } = props;
73
73
  const mountQuery = () => setIsQueryMounted(true);
74
74
  return /* @__PURE__ */ jsx(Autocomplete, {
75
75
  ...autocompleteProps,
@@ -1,7 +1,7 @@
1
1
  import { t as UIConfig } from "../uiConfig.context-B_wBkrQZ.js";
2
2
  import { f as $5dc95899b306f630$export$c9058316764c140e } from "../utils-D-KKbY-n.js";
3
3
  import { t as FieldController } from "../form.binding-DyZ4fH8l.js";
4
- import { t as Select } from "../Select-CO2ppqqL.js";
4
+ import { t as Select } from "../Select-B7vfRfll.js";
5
5
  import { n as getQueryItems, r as getSelectionIdsToResolve, t as useQueryAutocomplete } from "../useQueryAutocomplete-CraXvRm_.js";
6
6
  import { memo, useCallback, useMemo, useState } from "react";
7
7
  import { jsx } from "react/jsx-runtime";
@@ -1,11 +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,useState as l}from"react";import{filterDOMProps as u,inertValue as d,isScrollable as f,mergeRefs as p,useLayoutEffect as m,useLoadMoreSentinel as h,useObjectRef as g,useResizeObserver as _}from"@react-aria/utils";import{FocusableContext as v}from"@react-aria/interactions";import"react-dom";import{mergeProps as y}from"react-aria";import{useTableColumnResizeState as b}from"react-stately";var x=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),S=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});function C(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 w(t,n,r){let{render:i,...a}=n,o=c(null),l=s(()=>p(r,o),[r,o]);m(()=>{},[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)),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]=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])}
2
- /**
3
- * @license React
4
- * use-sync-external-store-shim.production.js
5
- *
6
- * Copyright (c) Meta Platforms, Inc. and affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */
11
- var P=x((e=>{var t=S(`react`);function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore}));x(((e,t)=>{t.exports=P()}))();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(v);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(v.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 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,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(null),G=r(function(t,n){let r=g(n),i=c(null),a=c(null),[o,d]=l(0);m(()=>{let e=i.current;for(;e&&e!==r.current&&!f(e);)e=e.parentElement;a.current=e},[r]),_({ref:a,box:`border-box`,onResize(){d(a.current?.clientWidth??0)}}),m(()=>{d(a.current?.clientWidth??0)},[]);let p=s(()=>({tableRef:i,scrollRef:a,tableWidth:o,useTableColumnResizeState:b,onResizeStart:t.onResizeStart,onResize:t.onResize,onResizeEnd:t.onResizeEnd}),[i,o,t.onResizeStart,t.onResize,t.onResizeEnd]);return e.createElement(E.div,{render:t.render,...u(t,{global:!0}),ref:r,className:t.className||`react-aria-ResizableTableContainer`,style:t.style,onScroll:t.onScroll},e.createElement(W.Provider,{value:p},t.children))}),K=n(null);var q=class extends D{};q.type=`tableheader`;var J=class extends D{};J.type=`column`;var Y=class extends O{};Y.type=`tablebody`;var X=class extends D{filter(e,t,n){let r=e.getChildren(this.key);for(let i of r)if(n(i.textValue,i)){let n=this.clone();return t.addDescendants(n,e),n}return null}};X.type=`item`;let Z=r(function(t,n){let{isVirtualized:r}=o(U);return r?e.createElement(E.div,{...t,ref:n}):e.createElement(E.tr,{...t,ref:n})});var Q=class extends D{};Q.type=`cell`;let $=r(function(t,n){let{isVirtualized:r}=o(U);return r?e.createElement(E.div,{...t,ref:n}):e.createElement(E.td,{...t,ref:n})});z(A,function(t,n,r){let i=o(K),{isVirtualized:a}=o(U),{isLoading:l,onLoadMore:f,scrollOffset:p,...m}=t,g=i.collection.columns.length,_=c(null),v=s(()=>({onLoadMore:f,collection:i?.collection,sentinelRef:_,scrollOffset:p}),[f,p,i?.collection]);h(v,_);let b=C({...m,id:void 0,children:r.rendered,defaultClassName:`react-aria-TableLoadingIndicator`,values:void 0}),x={},S={},w={};return a?(S[`aria-colspan`]=g,w={display:`contents`}):S.colSpan=g,e.createElement(e.Fragment,null,e.createElement(Z,{style:{height:0},inert:d(!0)},e.createElement($,{style:{padding:0,border:0}},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:_,style:{position:`relative`,height:1,width:1}}))),l&&b.children&&e.createElement(Z,{...y(u(t,{global:!0}),x),...b,role:`row`,ref:n},e.createElement($,{role:`rowheader`,...S,style:w},b.children)))});export{G as ResizableTableContainer};
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,useState as l}from"react";import{filterDOMProps as u,inertValue as d,isScrollable as f,mergeRefs as p,useLayoutEffect as m,useLoadMoreSentinel as h,useObjectRef as g,useResizeObserver as _}from"@react-aria/utils";import{FocusableContext as v}from"@react-aria/interactions";import"react-dom";import{mergeProps as y}from"react-aria";import{useTableColumnResizeState as b}from"react-stately";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(t,n,r){let{render:i,...a}=n,o=c(null),l=s(()=>p(r,o),[r,o]);m(()=>{},[t,i]);let u={...a,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 n=C[t];return n||(n=r(S.bind(null,t)),C[t]=n),n}});String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;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]=j(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`;function j(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 M(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 N=n(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const P=n(null);function F(e){var t;return t=class extends T{},t.type=e,t}function I(t,n,r,i,s,c){typeof t==`string`&&(t=F(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(P);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(P.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function L(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(v);if(!o(N)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return I(t,r,a,`children`in r?r.children:null,null,t=>e.createElement(v.Provider,{value:s},e.createElement(i,{node:t})))});return a.displayName=n.name,a}const R={CollectionRoot({collection:e,renderDropIndicator:t}){return z(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return z(e,t,n)}};function z(t,n,r){return M({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,B(t,n,r))}})}function B(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 V=n(R),H=n(null),U=r(function(t,n){let r=g(n),i=c(null),a=c(null),[o,d]=l(0);m(()=>{let e=i.current;for(;e&&e!==r.current&&!f(e);)e=e.parentElement;a.current=e},[r]),_({ref:a,box:`border-box`,onResize(){d(a.current?.clientWidth??0)}}),m(()=>{d(a.current?.clientWidth??0)},[]);let p=s(()=>({tableRef:i,scrollRef:a,tableWidth:o,useTableColumnResizeState:b,onResizeStart:t.onResizeStart,onResize:t.onResize,onResizeEnd:t.onResizeEnd}),[i,o,t.onResizeStart,t.onResize,t.onResizeEnd]);return e.createElement(w.div,{render:t.render,...u(t,{global:!0}),ref:r,className:t.className||`react-aria-ResizableTableContainer`,style:t.style,onScroll:t.onScroll},e.createElement(H.Provider,{value:p},t.children))}),W=n(null);var G=class extends T{};G.type=`tableheader`;var K=class extends T{};K.type=`column`;var q=class extends E{};q.type=`tablebody`;var J=class extends T{filter(e,t,n){let r=e.getChildren(this.key);for(let i of r)if(n(i.textValue,i)){let n=this.clone();return t.addDescendants(n,e),n}return null}};J.type=`item`;let Y=r(function(t,n){let{isVirtualized:r}=o(V);return r?e.createElement(w.div,{...t,ref:n}):e.createElement(w.tr,{...t,ref:n})});var X=class extends T{};X.type=`cell`;let Z=r(function(t,n){let{isVirtualized:r}=o(V);return r?e.createElement(w.div,{...t,ref:n}):e.createElement(w.td,{...t,ref:n})});L(O,function(t,n,r){let i=o(W),{isVirtualized:a}=o(V),{isLoading:l,onLoadMore:f,scrollOffset:p,...m}=t,g=i.collection.columns.length,_=c(null),v=s(()=>({onLoadMore:f,collection:i?.collection,sentinelRef:_,scrollOffset:p}),[f,p,i?.collection]);h(v,_);let b=x({...m,id:void 0,children:r.rendered,defaultClassName:`react-aria-TableLoadingIndicator`,values:void 0}),S={},C={},w={};return a?(C[`aria-colspan`]=g,w={display:`contents`}):C.colSpan=g,e.createElement(e.Fragment,null,e.createElement(Y,{style:{height:0},inert:d(!0)},e.createElement(Z,{style:{padding:0,border:0}},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:_,style:{position:`relative`,height:1,width:1}}))),l&&b.children&&e.createElement(Y,{...y(u(t,{global:!0}),S),...b,role:`row`,ref:n},e.createElement(Z,{role:`rowheader`,...C,style:w},b.children)))});export{U as ResizableTableContainer};
@@ -1,5 +1,5 @@
1
1
  import { t as clsx } from "../clsx-CnD0nOiA.js";
2
- import { c as $07b14b47974efb58$export$5b6b19405a83ff9d, n as $de32f1b87079253c$export$3ddf2d174ce01153, t as $de32f1b87079253c$export$2e1e1122cf0cba88 } from "../Dialog-CYPAuk4r.js";
2
+ import { c as $07b14b47974efb58$export$5b6b19405a83ff9d, n as $de32f1b87079253c$export$3ddf2d174ce01153, t as $de32f1b87079253c$export$2e1e1122cf0cba88 } from "../Dialog-B5J6LRRw.js";
3
3
  import { t as UIOverrides } from "../uiOverrides.context-Bfm2n-n8.js";
4
4
  import { BottomSheet } from "./bottom-sheet.js";
5
5
  import { t as useBreakpoint } from "../useBreakpoint-YuMYUdpG.js";
@@ -1,11 +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{createPortal as _}from"react-dom";import{mergeProps as v,useFocusRing as y,useHover as b,useTableRow as x,useTableSelectionCheckbox as S,useVisuallyHidden as C}from"react-aria";import"react-stately";var w=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),T=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});const ee=n(null);n(null),n(null),n(null),n(null),n({}),n(null),n(null);const E=Symbol(`default`);function te({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 ne(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(ne.bind(null,t)),O[t]=n),n}});String(Math.round(Math.random()*1e10));const A=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement,e.useId;function j(){return!1}function M(){return!0}function N(e){return()=>{}}function P(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore(N,j,M):o(A)}var F=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}},I=class extends F{filter(e,t,n){let[r,i]=B(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},L=class extends F{};L.type=`header`;var R=class extends F{};R.type=`loader`;var re=class extends I{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};re.type=`item`;var z=class extends I{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`;function B(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 V(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])}
2
- /**
3
- * @license React
4
- * use-sync-external-store-shim.production.js
5
- *
6
- * Copyright (c) Meta Platforms, Inc. and affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */
11
- var ie=w((e=>{var t=T(`react`);function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore}));w(((e,t)=>{t.exports=ie()}))();const H=n(!1),U=n(null);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const W=n(null);function ae(e){var t;return t=class extends F{},t.type=e,t}function G(t,n,r,i,s,c){typeof t==`string`&&(t=ae(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(W);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(W.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function oe(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(g);if(!o(H)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return G(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 se(t,n,i=K){let a=({node:e})=>n(e.props,e.props.ref,e),o=r((n,r)=>G(t,n,r,null,i(n),t=>e.createElement(a,{node:t}))??e.createElement(e.Fragment,null));return o.displayName=n.name,o}function K(e){return V({...e,addIdAndValue:!0})}const q=n(null);function ce(t){let n=o(q),r=(n?.dependencies||[]).concat(t.dependencies),i=t.idScope??n?.idScope,a=K({...t,idScope:i,dependencies:r});return o(U)&&(a=e.createElement(le,null,a)),n=c(()=>({dependencies:r,idScope:i}),[i,...r]),e.createElement(q.Provider,{value:n},a)}function le({children:t}){let n=o(U),r=c(()=>e.createElement(U.Provider,{value:null},e.createElement(H.Provider,{value:!0},t)),[t]);return P()?e.createElement(W.Provider,{value:n},r):_(r,n)}const ue={CollectionRoot({collection:e,renderDropIndicator:t}){return J(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return J(e,t,n)}};function J(t,n,r){return V({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 Y=n(ue),fe=n({}),pe=n({}),me=n({isSelected:!1}),X=n(null);var he=class extends F{};he.type=`tableheader`;var ge=class extends F{};ge.type=`column`;var _e=class extends I{};_e.type=`tablebody`;var Z=class extends F{filter(e,t,n){let r=e.getChildren(this.key);for(let i of r)if(n(i.textValue,i)){let n=this.clone();return t.addDescendants(n,e),n}return null}};Z.type=`item`;let Q=r(function(t,n){let{isVirtualized:r}=o(Y);return r?e.createElement(k.div,{...t,ref:n}):e.createElement(k.tr,{...t,ref:n})});const ve=se(Z,(t,n,r)=>{let i=h(n),a=o(X),{dragAndDropHooks:c,dragState:d,dropState:f}=o(pe),{isVirtualized:p,CollectionBranch:m}=o(Y),{rowProps:g,..._}=x({node:r,shouldSelectOnPressUp:!!d,isVirtualized:p},a,i),{isFocused:w,isFocusVisible:T,focusProps:ne}=y(),{isFocusVisible:O,focusProps:k}=y({within:!0}),{hoverProps:A,isHovered:j}=b({isDisabled:!_.allowsSelection&&!_.hasAction,onHoverStart:t.onHoverStart,onHoverChange:t.onHoverChange,onHoverEnd:t.onHoverEnd}),{checkboxProps:M}=S({key:r.key},a),N;d&&c&&(N=c.useDraggableItem({key:r.key,hasDragButton:!0},d));let P,F=l(null),{visuallyHiddenProps:I}=C();f&&c&&(P=c.useDropIndicator({target:{type:`item`,key:r.key,dropPosition:`on`}},f,F));let L=l(null);s(()=>{d&&L.current},[]);let R=d&&d.isDragging(r.key),{children:re,...z}=t,B=D({...z,id:void 0,defaultClassName:`react-aria-Row`,values:{..._,isHovered:j,isFocused:w,isFocusVisible:T,selectionMode:a.selectionManager.selectionMode,selectionBehavior:a.selectionManager.selectionBehavior,isDragging:R,isDropTarget:P?.isDropTarget,isFocusVisibleWithin:O,id:r.key}}),V=u(t,{global:!0});return delete V.id,delete V.onClick,e.createElement(e.Fragment,null,P&&!P.isHidden&&e.createElement(Q,{role:`row`,style:{height:0}},e.createElement($,{role:`gridcell`,colSpan:a.collection.columnCount,style:{padding:0}},e.createElement(`div`,{role:`button`,...I,...P.dropIndicatorProps,ref:F}))),e.createElement(Q,{...v(V,B,g,ne,A,N?.dragProps,k),ref:i,"data-disabled":_.isDisabled||void 0,"data-selected":_.isSelected||void 0,"data-hovered":j||void 0,"data-focused":_.isFocused||void 0,"data-focus-visible":T||void 0,"data-pressed":_.isPressed||void 0,"data-dragging":R||void 0,"data-drop-target":P?.isDropTarget||void 0,"data-selection-mode":a.selectionManager.selectionMode===`none`?void 0:a.selectionManager.selectionMode,"data-focus-visible-within":O||void 0},e.createElement(te,{values:[[ee,{slots:{[E]:{},selection:M}}],[fe,{slots:{[E]:{},drag:{...N?.dragButtonProps,ref:L,style:{pointerEvents:`none`}}}}],[me,{isSelected:_.isSelected}]]},e.createElement(m,{collection:a.collection,parent:r}))))},t=>{if(t.id==null&&typeof t.children==`function`)throw Error(`No id detected for the Row element. The Row element requires a id to be provided to it when the cells are rendered dynamically.`);let n=[t.value].concat(t.dependencies);return e.createElement(ce,{dependencies:n,items:t.columns,idScope:t.id},t.children)});var ye=class extends F{};ye.type=`cell`;let $=r(function(t,n){let{isVirtualized:r}=o(Y);return r?e.createElement(k.div,{...t,ref:n}):e.createElement(k.td,{...t,ref:n})});oe(R,function(t,n,r){let i=o(X),{isVirtualized:a}=o(Y),{isLoading:s,onLoadMore:f,scrollOffset:p,...h}=t,g=i.collection.columns.length,_=l(null),y=c(()=>({onLoadMore:f,collection:i?.collection,sentinelRef:_,scrollOffset:p}),[f,p,i?.collection]);m(y,_);let b=D({...h,id:void 0,children:r.rendered,defaultClassName:`react-aria-TableLoadingIndicator`,values:void 0}),x={},S={},C={};return a?(S[`aria-colspan`]=g,C={display:`contents`}):S.colSpan=g,e.createElement(e.Fragment,null,e.createElement(Q,{style:{height:0},inert:d(!0)},e.createElement($,{style:{padding:0,border:0}},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:_,style:{position:`relative`,height:1,width:1}}))),s&&b.children&&e.createElement(Q,{...v(u(t,{global:!0}),x),...b,role:`row`,ref:n},e.createElement($,{role:`rowheader`,...S,style:C},b.children)))});export{ve as Row};
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{createPortal as _}from"react-dom";import{mergeProps as v,useFocusRing as y,useHover as b,useTableRow as x,useTableSelectionCheckbox as S,useVisuallyHidden as C}from"react-aria";import"react-stately";const ee=n(null);n(null),n(null),n(null),n(null),n({}),n(null),n(null);const w=Symbol(`default`);function te({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function T(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 E(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 D={},O=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=D[t];return n||(n=r(E.bind(null,t)),D[t]=n),n}});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):o(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]=ne(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`;function ne(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 B(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 V=n(!1),H=n(null);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const U=n(null);function re(e){var t;return t=class extends P{},t.type=e,t}function W(t,n,r,i,s,c){typeof t==`string`&&(t=re(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(U);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(U.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function ie(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(g);if(!o(V)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return W(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 ae(t,n,i=G){let a=({node:e})=>n(e.props,e.props.ref,e),o=r((n,r)=>W(t,n,r,null,i(n),t=>e.createElement(a,{node:t}))??e.createElement(e.Fragment,null));return o.displayName=n.name,o}function G(e){return B({...e,addIdAndValue:!0})}const K=n(null);function oe(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(H)&&(a=e.createElement(se,null,a)),n=c(()=>({dependencies:r,idScope:i}),[i,...r]),e.createElement(K.Provider,{value:n},a)}function se({children:t}){let n=o(H),r=c(()=>e.createElement(H.Provider,{value:null},e.createElement(V.Provider,{value:!0},t)),[t]);return N()?e.createElement(U.Provider,{value:n},r):_(r,n)}const ce={CollectionRoot({collection:e,renderDropIndicator:t}){return q(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return q(e,t,n)}};function q(t,n,r){return B({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,le(t,n,r))}})}function le(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(ce),ue=n({}),de=n({}),Y=n({isSelected:!1}),X=n(null);var fe=class extends P{};fe.type=`tableheader`;var pe=class extends P{};pe.type=`column`;var me=class extends F{};me.type=`tablebody`;var Z=class extends P{filter(e,t,n){let r=e.getChildren(this.key);for(let i of r)if(n(i.textValue,i)){let n=this.clone();return t.addDescendants(n,e),n}return null}};Z.type=`item`;let Q=r(function(t,n){let{isVirtualized:r}=o(J);return r?e.createElement(O.div,{...t,ref:n}):e.createElement(O.tr,{...t,ref:n})});const he=ae(Z,(t,n,r)=>{let i=h(n),a=o(X),{dragAndDropHooks:c,dragState:d,dropState:f}=o(de),{isVirtualized:p,CollectionBranch:m}=o(J),{rowProps:g,..._}=x({node:r,shouldSelectOnPressUp:!!d,isVirtualized:p},a,i),{isFocused:E,isFocusVisible:D,focusProps:O}=y(),{isFocusVisible:k,focusProps:A}=y({within:!0}),{hoverProps:j,isHovered:M}=b({isDisabled:!_.allowsSelection&&!_.hasAction,onHoverStart:t.onHoverStart,onHoverChange:t.onHoverChange,onHoverEnd:t.onHoverEnd}),{checkboxProps:N}=S({key:r.key},a),P;d&&c&&(P=c.useDraggableItem({key:r.key,hasDragButton:!0},d));let F,I=l(null),{visuallyHiddenProps:L}=C();f&&c&&(F=c.useDropIndicator({target:{type:`item`,key:r.key,dropPosition:`on`}},f,I));let R=l(null);s(()=>{d&&R.current},[]);let z=d&&d.isDragging(r.key),{children:ne,...B}=t,V=T({...B,id:void 0,defaultClassName:`react-aria-Row`,values:{..._,isHovered:M,isFocused:E,isFocusVisible:D,selectionMode:a.selectionManager.selectionMode,selectionBehavior:a.selectionManager.selectionBehavior,isDragging:z,isDropTarget:F?.isDropTarget,isFocusVisibleWithin:k,id:r.key}}),H=u(t,{global:!0});return delete H.id,delete H.onClick,e.createElement(e.Fragment,null,F&&!F.isHidden&&e.createElement(Q,{role:`row`,style:{height:0}},e.createElement($,{role:`gridcell`,colSpan:a.collection.columnCount,style:{padding:0}},e.createElement(`div`,{role:`button`,...L,...F.dropIndicatorProps,ref:I}))),e.createElement(Q,{...v(H,V,g,O,j,P?.dragProps,A),ref:i,"data-disabled":_.isDisabled||void 0,"data-selected":_.isSelected||void 0,"data-hovered":M||void 0,"data-focused":_.isFocused||void 0,"data-focus-visible":D||void 0,"data-pressed":_.isPressed||void 0,"data-dragging":z||void 0,"data-drop-target":F?.isDropTarget||void 0,"data-selection-mode":a.selectionManager.selectionMode===`none`?void 0:a.selectionManager.selectionMode,"data-focus-visible-within":k||void 0},e.createElement(te,{values:[[ee,{slots:{[w]:{},selection:N}}],[ue,{slots:{[w]:{},drag:{...P?.dragButtonProps,ref:R,style:{pointerEvents:`none`}}}}],[Y,{isSelected:_.isSelected}]]},e.createElement(m,{collection:a.collection,parent:r}))))},t=>{if(t.id==null&&typeof t.children==`function`)throw Error(`No id detected for the Row element. The Row element requires a id to be provided to it when the cells are rendered dynamically.`);let n=[t.value].concat(t.dependencies);return e.createElement(oe,{dependencies:n,items:t.columns,idScope:t.id},t.children)});var ge=class extends P{};ge.type=`cell`;let $=r(function(t,n){let{isVirtualized:r}=o(J);return r?e.createElement(O.div,{...t,ref:n}):e.createElement(O.td,{...t,ref:n})});ie(L,function(t,n,r){let i=o(X),{isVirtualized:a}=o(J),{isLoading:s,onLoadMore:f,scrollOffset:p,...h}=t,g=i.collection.columns.length,_=l(null),y=c(()=>({onLoadMore:f,collection:i?.collection,sentinelRef:_,scrollOffset:p}),[f,p,i?.collection]);m(y,_);let b=T({...h,id:void 0,children:r.rendered,defaultClassName:`react-aria-TableLoadingIndicator`,values:void 0}),x={},S={},C={};return a?(S[`aria-colspan`]=g,C={display:`contents`}):S.colSpan=g,e.createElement(e.Fragment,null,e.createElement(Q,{style:{height:0},inert:d(!0)},e.createElement($,{style:{padding:0,border:0}},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:_,style:{position:`relative`,height:1,width:1}}))),s&&b.children&&e.createElement(Q,{...v(u(t,{global:!0}),x),...b,role:`row`,ref:n},e.createElement($,{role:`rowheader`,...S,style:C},b.children)))});export{he as Row};
@@ -1,11 +1 @@
1
- import e,{cloneElement as t,createContext as n,forwardRef as r,useCallback as i,useContext as a,useMemo as o}from"react";import"@react-aria/interactions";import"react-dom";var s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),c=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;var l=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}},u=class extends l{filter(e,t,n){let[r,i]=h(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},d=class extends l{};d.type=`header`;var f=class extends l{};f.type=`loader`;var p=class extends u{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 m=class extends u{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 h(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 g(e){let{children:n,items:r,idScope:i,addIdAndValue:a,dependencies:s=[]}=e,c=o(()=>new WeakMap,s);return o(()=>{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])}
2
- /**
3
- * @license React
4
- * use-sync-external-store-shim.production.js
5
- *
6
- * Copyright (c) Meta Platforms, Inc. and affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */
11
- var _=s((e=>{var t=c(`react`);function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function l(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,l=r[1];return o(function(){c.value=n,c.getSnapshot=t,u(c)&&l({inst:c})},[e,n,t]),a(function(){return u(c)&&l({inst:c}),e(function(){u(c)&&l({inst:c})})},[e]),s(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore}));s(((e,t)=>{t.exports=_()}))(),typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const v=n(null);function y(e){var t;return t=class extends l{},t.type=e,t}function b(t,n,r,o,s,c){typeof t==`string`&&(t=y(t));let l=i(e=>{e?.setProps(n,r,t,o,c)},[n,r,o,c,t]),u=a(v);if(u){let i=u.ownerDocument.nodesByProps.get(n);return i||(i=u.ownerDocument.createElement(t.type),i.setProps(n,r,t,o,c),u.appendChild(i),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,i)),s?e.createElement(v.Provider,{value:i},s):null}return e.createElement(t.type,{ref:l},s)}function x(t,n,i=S){let a=({node:e})=>n(e.props,e.props.ref,e),o=r((n,r)=>b(t,n,r,null,i(n),t=>e.createElement(a,{node:t}))??e.createElement(e.Fragment,null));return o.displayName=n.name,o}function S(e){return g({...e,addIdAndValue:!0})}const C=n(null),w=x(`section`,(e,t,n)=>{let{name:r,render:i}=a(C);return i(e,t,n,`react-aria-Section`)});export{w as Section};
1
+ import e,{cloneElement as t,createContext as n,forwardRef as r,useCallback as i,useContext as a,useMemo as o}from"react";import"@react-aria/interactions";import"react-dom";String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;var s=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}},c=class extends s{filter(e,t,n){let[r,i]=p(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},l=class extends s{};l.type=`header`;var u=class extends s{};u.type=`loader`;var d=class extends c{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};d.type=`item`;var f=class extends c{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 p(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 m(e){let{children:n,items:r,idScope:i,addIdAndValue:a,dependencies:s=[]}=e,c=o(()=>new WeakMap,s);return o(()=>{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])}typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const h=n(null);function g(e){var t;return t=class extends s{},t.type=e,t}function _(t,n,r,o,s,c){typeof t==`string`&&(t=g(t));let l=i(e=>{e?.setProps(n,r,t,o,c)},[n,r,o,c,t]),u=a(h);if(u){let i=u.ownerDocument.nodesByProps.get(n);return i||(i=u.ownerDocument.createElement(t.type),i.setProps(n,r,t,o,c),u.appendChild(i),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,i)),s?e.createElement(h.Provider,{value:i},s):null}return e.createElement(t.type,{ref:l},s)}function v(t,n,i=y){let a=({node:e})=>n(e.props,e.props.ref,e),o=r((n,r)=>_(t,n,r,null,i(n),t=>e.createElement(a,{node:t}))??e.createElement(e.Fragment,null));return o.displayName=n.name,o}function y(e){return m({...e,addIdAndValue:!0})}const b=n(null),x=v(`section`,(e,t,n)=>{let{name:r,render:i}=a(b);return i(e,t,n,`react-aria-Section`)});export{x as Section};