@bazza-ui/react 0.1.0-canary.14 → 0.1.0-canary.15

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 (52) hide show
  1. package/dist/{ListboxStore-DCGGpiBg.d.cts → ListboxStore-B8oTpM57.d.cts} +1 -1
  2. package/dist/{ListboxStore-DZ73dOaC.d.ts → ListboxStore-CV5vPUUc.d.ts} +1 -1
  3. package/dist/chunk-BEWVWSAW.cjs +2 -0
  4. package/dist/{chunk-Z2RGBRJP.cjs.map → chunk-BEWVWSAW.cjs.map} +1 -1
  5. package/dist/chunk-EDZTZHQ4.js +2 -0
  6. package/dist/chunk-EDZTZHQ4.js.map +1 -0
  7. package/dist/combobox/index.cjs +1 -1
  8. package/dist/combobox/index.d.cts +8 -8
  9. package/dist/combobox/index.d.ts +8 -8
  10. package/dist/combobox/index.js +1 -1
  11. package/dist/command-menu/index.cjs +1 -1
  12. package/dist/command-menu/index.d.cts +8 -8
  13. package/dist/command-menu/index.d.ts +8 -8
  14. package/dist/command-menu/index.js +1 -1
  15. package/dist/context-menu/index.cjs +1 -1
  16. package/dist/context-menu/index.d.cts +13 -13
  17. package/dist/context-menu/index.d.ts +13 -13
  18. package/dist/context-menu/index.js +1 -1
  19. package/dist/dropdown-menu/index.cjs +1 -1
  20. package/dist/dropdown-menu/index.cjs.map +1 -1
  21. package/dist/dropdown-menu/index.d.cts +13 -13
  22. package/dist/dropdown-menu/index.d.ts +13 -13
  23. package/dist/dropdown-menu/index.js +1 -1
  24. package/dist/dropdown-menu/index.js.map +1 -1
  25. package/dist/{events-D6K5-_aP.d.ts → events-BTHQ2OoH.d.ts} +17 -1
  26. package/dist/{events-DuKEM5sQ.d.cts → events-DVcrtGe3.d.cts} +17 -1
  27. package/dist/internal/listbox/index.d.cts +4 -4
  28. package/dist/internal/listbox/index.d.ts +4 -4
  29. package/dist/internal/popup-menu/index.cjs +1 -1
  30. package/dist/internal/popup-menu/index.d.cts +9 -9
  31. package/dist/internal/popup-menu/index.d.ts +9 -9
  32. package/dist/internal/popup-menu/index.js +1 -1
  33. package/dist/loaders/index.d.cts +1 -1
  34. package/dist/loaders/index.d.ts +1 -1
  35. package/dist/{resolve-C5shwZ1S.d.cts → resolve-B-j0eW24.d.cts} +1 -1
  36. package/dist/{resolve-DA6nHdAi.d.ts → resolve-B1F-a3P1.d.ts} +1 -1
  37. package/dist/{scroll-arrow-rsrV6nun.d.cts → scroll-arrow-BBoKckL_.d.cts} +2 -2
  38. package/dist/{scroll-arrow-CxHg9cFW.d.ts → scroll-arrow-fl3B5sVO.d.ts} +2 -2
  39. package/dist/select/index.cjs +1 -1
  40. package/dist/select/index.d.cts +8 -8
  41. package/dist/select/index.d.ts +8 -8
  42. package/dist/select/index.js +1 -1
  43. package/dist/{separator-DaXKN0QW.d.ts → separator-Dn15rte3.d.ts} +2 -2
  44. package/dist/{separator-DzfgGPjS.d.cts → separator-NjsBVzek.d.cts} +2 -2
  45. package/dist/{surface-context-BMizU8oI.d.ts → surface-context-CGLDpMej.d.ts} +1 -1
  46. package/dist/{surface-context-r2eYfQth.d.cts → surface-context-CN4Lb_6F.d.cts} +1 -1
  47. package/dist/{type-guards-BO8iCz9M.d.cts → type-guards-BHHzjRvZ.d.cts} +3 -3
  48. package/dist/{type-guards-BOg6-eFO.d.ts → type-guards-C0e_GpeY.d.ts} +3 -3
  49. package/package.json +1 -1
  50. package/dist/chunk-NNGWBSWK.js +0 -2
  51. package/dist/chunk-NNGWBSWK.js.map +0 -1
  52. package/dist/chunk-Z2RGBRJP.cjs +0 -2
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunk5T5B5SPRcjs = require('../chunk-5T5B5SPR.cjs');var _chunkZ2RGBRJPcjs = require('../chunk-Z2RGBRJP.cjs');var _chunkXMZZ62VJcjs = require('../chunk-XMZZ62VJ.cjs');var _chunkM4G6J7DPcjs = require('../chunk-M4G6J7DP.cjs');var zo={};_chunkM4G6J7DPcjs.a.call(void 0, zo,{Arrow:()=>_chunkZ2RGBRJPcjs.s,Backdrop:()=>_chunkZ2RGBRJPcjs.t,Clear:()=>Me,Empty:()=>_chunkZ2RGBRJPcjs.V,Group:()=>_chunkZ2RGBRJPcjs.ra,GroupLabel:()=>_chunkZ2RGBRJPcjs.X,Icon:()=>_chunkZ2RGBRJPcjs.U,Input:()=>we,InputWrapper:()=>ke,Item:()=>Te,ItemIndicator:()=>He,ItemLabel:()=>Oe,List:()=>_chunkZ2RGBRJPcjs.ca,Popup:()=>_chunkZ2RGBRJPcjs.K,Portal:()=>_chunkZ2RGBRJPcjs.L,Positioner:()=>De,Root:()=>Ae,ScrollDownArrow:()=>_chunkZ2RGBRJPcjs.fa,ScrollUpArrow:()=>_chunkZ2RGBRJPcjs.ea,Separator:()=>_chunkZ2RGBRJPcjs.ua,Surface:()=>Fe,useComboboxPositionerContext:()=>Ee});var _userender = require('@base-ui/react/use-render');var _react = require('react'); var _ = _interopRequireWildcard(_react); var xe = _interopRequireWildcard(_react); var ne = _interopRequireWildcard(_react); var Ce = _interopRequireWildcard(_react); var se = _interopRequireWildcard(_react); var T = _interopRequireWildcard(_react); var re = _interopRequireWildcard(_react); var E = _interopRequireWildcard(_react); var le = _interopRequireWildcard(_react); var Ie = _interopRequireWildcard(_react); var Y = _interopRequireWildcard(_react); var U = _interopRequireWildcard(_react); var h = _interopRequireWildcard(_react); var Z = _interopRequireWildcard(_react);var ko={slot:"bazzaui-combobox-clear"};var Me=_.forwardRef(function(e,o){let{keepMounted:i=!1,disabled:u,render:s,className:p,style:c,onClick:a,onPointerDown:t,...P}=e,m=_chunkZ2RGBRJPcjs.w.call(void 0, ),b=_nullishCoalesce(u, () => (m.disabled)),I=m.multiple?m.values.length>0:m.value!=="",d=_.useCallback(R=>{_optionalChain([a, 'optionalCall', _2 => _2(R)]),!R.defaultPrevented&&(m.multiple?m.onValuesChange([]):m.onValueChange(""),m.onInputValueChange(""))},[a,m]),g=_.useCallback(R=>{R.preventDefault(),_optionalChain([t, 'optionalCall', _3 => _3(R)])},[t]),l=_.useMemo(()=>({hasValue:I,disabled:b}),[I,b]),S=_userender.useRender.call(void 0, {render:s,ref:o,state:l,props:{...P,[ko.slot]:"",type:"button",tabIndex:-1,"aria-label":"Clear selection",disabled:b||!I,className:p,style:c,onClick:d,onPointerDown:g},enabled:i||I,defaultTagName:"button"});return!i&&!I?null:S});var fe=xe.createContext(null);function Ee(){return xe.useContext(fe)}var Le=Ce.createContext(!1);function To(){return Ce.useContext(Le)}var Q={slot:"bazzaui-combobox-input",open:"data-open",closed:"data-closed",disabled:"data-disabled",placeholder:"data-placeholder"};function Ho(x){let{comboboxContext:e,open:o}=x,i=e.multiple?e.values.length>0:!_chunkZ2RGBRJPcjs.R.call(void 0, e.value),u=se.useCallback(c=>{let a=_chunkZ2RGBRJPcjs.T.call(void 0, c,e.itemToStringValue),t=e.itemTextRegistry.get(a);if(t!==void 0)return t;let P=_chunk5T5B5SPRcjs.f.call(void 0, e.items,a);if(typeof P=="string")return P;let m=_chunkZ2RGBRJPcjs.S.call(void 0, c,e.itemToStringLabel);if(m&&m!==a)return m},[e.itemTextRegistry,e.items,e.itemToStringLabel,e.itemToStringValue]),s=se.useMemo(()=>{if(!i)return"";if(e.multiple){let t=e.values.map(P=>{let m=u(P);return m!==void 0?m:_chunkZ2RGBRJPcjs.S.call(void 0, P,e.itemToStringLabel)||_chunkZ2RGBRJPcjs.T.call(void 0, P,e.itemToStringValue)}).filter(Boolean);return t.length<=2?t.join(", "):`${t.length} selected`}let c=e.value;if(c==null)return"";let a=u(c);return a!==void 0?a:_chunkZ2RGBRJPcjs.S.call(void 0, c,e.itemToStringLabel)||_chunkZ2RGBRJPcjs.T.call(void 0, c,e.itemToStringValue)},[i,e.multiple,e.value,e.values,e.itemToStringLabel,e.itemToStringValue,u]),p=se.useMemo(()=>o?e.inputValue:s,[o,s,e.inputValue]);return{hasValue:i,displayValue:p,selectedLabel:s,getValueText:u}}function Oo(x){let{comboboxContext:e,store:o,focusOwnerStore:i,open:u,disabled:s,cursorBehavior:p,hasValue:c,getValueText:a,onFocus:t,onBlur:P,onClick:m,onKeyDown:b}=x,I=T.useRef(!1),d=T.useRef(!1),g=T.useRef(!1),l=T.useRef(null),S=T.useRef(null),R=T.useRef(null);T.useEffect(()=>{if(!u)return;let n=f=>{let r=e.inputRef.current,v=e.inputWrapperRef.current,y=document.getElementById(e.listId),O=f.target,W=_optionalChain([r, 'optionalAccess', _4 => _4.contains, 'call', _5 => _5(O)]),z=_optionalChain([v, 'optionalAccess', _6 => _6.contains, 'call', _7 => _7(O)]),ee=_optionalChain([y, 'optionalAccess', _8 => _8.contains, 'call', _9 => _9(O)]);!W&&!z&&!ee&&(R.current=f)};return document.addEventListener("pointerdown",n,!0),()=>{document.removeEventListener("pointerdown",n,!0),R.current=null}},[u,e.inputRef,e.inputWrapperRef,e.listId]),T.useLayoutEffect(()=>{let n=e.inputRef.current;if(n&&u&&S.current){let{start:f,end:r}=S.current,v=n.selectionStart,y=n.value.length;v===y&&f!==y&&n.setSelectionRange(f,r),S.current=null}});let L=T.useRef(u);T.useLayoutEffect(()=>{if(u&&!L.current){if(I.current){I.current=!1,L.current=u;return}if(g.current){g.current=!1,d.current=!1,l.current=null,L.current=u;return}if(d.current&&p==="none"){let f=e.inputRef.current,r=l.current;f&&r!==null&&requestAnimationFrame(()=>{let v=f.value.length,y=Math.min(r,v);f.setSelectionRange(y,y)}),d.current=!1,l.current=null,L.current=u;return}c&&e.multiple&&e.onInputValueChange("");let n=e.inputRef.current;if(n){let f=n.value.length;p==="select-all"&&f>0?requestAnimationFrame(()=>{n.setSelectionRange(0,n.value.length)}):p==="end"&&f>0&&requestAnimationFrame(()=>{n.setSelectionRange(n.value.length,n.value.length)})}}L.current=u},[u,e,c,p]);let w=T.useCallback(n=>{let f=n.target,r=f.value,v=f.selectionStart,y=f.selectionEnd;v!==null&&y!==null&&(S.current={start:v,end:y}),e.onInputValueChange(r),e.setFilterActive(),o.setSearch(r),o.state.open||(I.current=!0,e.openCombobox())},[e,o]),k=T.useCallback(n=>{if(_optionalChain([t, 'optionalCall', _10 => _10(n)]),n.defaultPrevented)return;let f=o.state.open;if(f&&(g.current=!0),e.openOnFocus&&!s&&!f){if(c&&!e.multiple){let r=_nullishCoalesce(a(e.value), () => (_chunkZ2RGBRJPcjs.S.call(void 0, e.value,e.itemToStringLabel)));e.onInputValueChange(r)}e.openCombobox()}},[t,e,s,o,c,a]),V=T.useCallback(n=>{_optionalChain([P, 'optionalCall', _11 => _11(n)]),!n.defaultPrevented&&requestAnimationFrame(()=>{let f=document.activeElement,v=_optionalChain([document, 'access', _12 => _12.getElementById, 'call', _13 => _13(e.listId), 'optionalAccess', _14 => _14.contains, 'call', _15 => _15(f)]),y=f===e.inputRef.current;if(!v&&!y){g.current=!1;let O=R.current,W=O?_chunkXMZZ62VJcjs.a.outsidePress:_chunkXMZZ62VJcjs.a.focusOut;R.current=null,e.closeCombobox(W,_nullishCoalesce(O, () => (void 0)))}})},[P,e]),A=T.useCallback(n=>{if(_optionalChain([m, 'optionalCall', _16 => _16(n)]),n.defaultPrevented)return;let f=o.state.open;if(!s&&!f){let r=n.target;if(p==="none"){let v=r.selectionStart;l.current=v,d.current=!0}if(c&&!e.multiple){let v=_nullishCoalesce(a(e.value), () => (_chunkZ2RGBRJPcjs.S.call(void 0, e.value,e.itemToStringLabel)));e.onInputValueChange(v)}e.openCombobox()}else f&&(g.current=!0)},[m,e,s,o,p,c,a]),K=T.useCallback(n=>{if(_optionalChain([b, 'optionalCall', _17 => _17(n)]),!n.defaultPrevented){if(u&&n.key==="Escape"){n.preventDefault(),e.closeCombobox(_chunkXMZZ62VJcjs.a.escapeKey);return}if(!u&&(n.key==="ArrowDown"||n.key==="ArrowUp"||n.key==="Enter")){if(n.preventDefault(),c&&!e.multiple){let f=_nullishCoalesce(a(e.value), () => (_chunkZ2RGBRJPcjs.S.call(void 0, e.value,e.itemToStringLabel)));e.onInputValueChange(f)}e.openCombobox();return}}},[u,e,b,c,a]),{handleKeyDown:j}=_chunkZ2RGBRJPcjs.Q.call(void 0, {store:o,surfaceId:"combobox-input",focusOwnerStore:i,depth:0,submenuContext:null,subpageContext:null,enabled:u,enableTypeToSearch:!1,onKeyDown:K,closeAll:e.closeCombobox,skipFocusOwnerCheck:!0});return{handleChange:w,handleFocus:k,handleBlur:V,handleClick:A,handleKeyDown:j,selectionRef:S}}var we=ne.forwardRef(function(e,o){let{placeholder:i,disabled:u,cursorBehavior:s="none",render:p,className:c,style:a,onFocus:t,onBlur:P,onClick:m,onKeyDown:b,...I}=e,d=_chunkZ2RGBRJPcjs.w.call(void 0, ),g=_chunkZ2RGBRJPcjs.d.call(void 0, ),l=_chunkZ2RGBRJPcjs.a.call(void 0, ),S=To(),R=(_nullishCoalesce(u, () => (d.disabled)))||g.disabled,L=_chunk5T5B5SPRcjs.f.call(void 0, d.items,""),w=_nullishCoalesce(_nullishCoalesce(i, () => ((typeof L=="string"?L:void 0))), () => (d.placeholder)),k=g.store.useState("open"),{hasValue:V,displayValue:A,getValueText:K}=Ho({comboboxContext:d,open:k}),{handleChange:j,handleFocus:n,handleBlur:f,handleClick:r,handleKeyDown:v}=Oo({comboboxContext:d,store:g.store,focusOwnerStore:l,open:k,disabled:R,cursorBehavior:s,hasValue:V,getValueText:K,onFocus:t,onBlur:P,onClick:m,onKeyDown:b}),y={[Q.slot]:""};k?y[Q.open]="":y[Q.closed]="",R&&(y[Q.disabled]=""),V||(y[Q.placeholder]=""),d.layout==="input-embedded"&&(y["data-input-embedded"]="");let O=ne.useCallback(M=>{d.setInputElement(M),typeof o=="function"?o(M):o&&(o.current=M)},[o,d]),W=ne.useMemo(()=>({open:k,disabled:R,placeholder:!V}),[k,R,V]),z=d.layout==="input-embedded"&&!S?{position:"relative",zIndex:1}:void 0;return _userender.useRender.call(void 0, {render:p,ref:O,state:W,props:{...I,...y,type:"text",role:"combobox","aria-autocomplete":"list","aria-expanded":k,"aria-controls":d.listId,"aria-haspopup":"listbox",autoComplete:"off",autoCorrect:"off",spellCheck:!1,disabled:R,placeholder:V?void 0:w,className:c,style:{...z,...a},value:A,onChange:j,onFocus:n,onBlur:f,onClick:r,onKeyDown:v},defaultTagName:"input"})});var ge={slot:"bazzaui-combobox-input-wrapper",open:"data-open"};var _jsxruntime = require('react/jsx-runtime');var Rt={open:x=>x?{[ge.open]:""}:null},ke= exports.ComboboxInputWrapper =re.forwardRef(function(e,o){let{render:i,className:u,style:s,children:p,...c}=e,{store:a}=_chunkZ2RGBRJPcjs.d.call(void 0, ),t=_chunkZ2RGBRJPcjs.w.call(void 0, ),P=a.useState("open"),m=re.useMemo(()=>({open:P}),[P]),b=t.layout==="input-embedded"?{position:"relative",zIndex:1}:{position:"relative"},I=re.useCallback(g=>{t.setInputWrapperElement(g),typeof o=="function"?o(g):o&&(o.current=g)},[o,t]),d=_userender.useRender.call(void 0, {render:i,ref:I,state:m,stateAttributesMapping:Rt,props:{...c,[ge.slot]:"",className:u,style:{...b,...s},children:p},defaultTagName:"div"});return _jsxruntime.jsx.call(void 0, Le.Provider,{value:!0,children:d})});var q={slot:"bazzaui-combobox-item",highlighted:"data-highlighted",disabled:"data-disabled",selected:"data-selected",first:"data-first",last:"data-last",firstInGroup:"data-first-in-group",lastInGroup:"data-last-in-group"};var he=le.createContext(null);function ue(){let x=le.useContext(he);if(!x)throw new Error("ComboboxItem child components must be used within a Combobox.Item");return x}function yt(){return le.useContext(he)}var Vt={highlighted:x=>x?{[q.highlighted]:""}:null,disabled:x=>x?{[q.disabled]:""}:null,selected:x=>x?{[q.selected]:""}:null,first:x=>x?{[q.first]:""}:null,last:x=>x?{[q.last]:""}:null,firstInGroup:x=>x?{[q.firstInGroup]:""}:null,lastInGroup:x=>x?{[q.lastInGroup]:""}:null};function Mt(x,e){let{value:o,textValue:i,keywords:u,disabled:s=!1,onSelect:p,forceMount:c=!1,render:a,className:t,style:P,onClick:m,onPointerDown:b,onPointerMove:I,children:d,...g}=x,l=_chunkZ2RGBRJPcjs.w.call(void 0, ),S=E.useMemo(()=>_chunkZ2RGBRJPcjs.T.call(void 0, o,l.itemToStringValue),[o,l.itemToStringValue]),R=E.useId(),L=o===null?`combobox-clear-${R}`:void 0,w=E.useMemo(()=>_chunk5T5B5SPRcjs.e.call(void 0, l.items,S),[l.items,S]),k=_optionalChain([w, 'optionalAccess', _18 => _18.label]),V=E.useMemo(()=>_chunkZ2RGBRJPcjs.S.call(void 0, o,l.itemToStringLabel),[o,l.itemToStringLabel]),A=E.useMemo(()=>{if(i!==void 0)return i;if(typeof k=="string")return k;if(V&&V!==S)return V},[i,k,V,S]),K=E.useMemo(()=>_chunk5T5B5SPRcjs.g.call(void 0, u,[typeof k=="string"?k:V&&V!==S?V:void 0,..._nullishCoalesce(_optionalChain([w, 'optionalAccess', _19 => _19.keywords]), () => ([]))]),[u,k,V,S,w]),j=E.useRef(A),n=l.multiple?_chunk5T5B5SPRcjs.c.call(void 0, l.values,o,l.isItemEqualToValue):l.value!==""&&_chunk5T5B5SPRcjs.b.call(void 0, l.value,o,l.isItemEqualToValue),f=l.closeOnSelect,r=_chunkZ2RGBRJPcjs.P.call(void 0, {id:L,value:S,keywords:K,disabled:s,forceMount:c,closeOnClick:f,children:d});E.useEffect(()=>{let M=()=>{if(!s){if(l.multiple)if(o==null)l.onValuesChange([]);else{let me=n?_chunk5T5B5SPRcjs.d.call(void 0, l.values,o,l.isItemEqualToValue):[...l.values,o];l.onValuesChange(me)}else l.onValueChange(o);_optionalChain([p, 'optionalCall', _20 => _20()])}};return r.registerSelect(M)},[s,l,o,n,p,r]),E.useEffect(()=>{let M=j.current;if(M)return l.registerItemText(S,M)},[S,l]),E.useEffect(()=>{!A&&typeof d=="string"&&(j.current=d,l.registerItemText(S,d))},[d,A,S,l]);let v=E.useMemo(()=>({highlighted:r.isHighlighted,disabled:s,selected:n,first:r.positional.first,last:r.positional.last,firstInGroup:r.positional.firstInGroup,lastInGroup:r.positional.lastInGroup}),[r.isHighlighted,s,n,r.positional]),y=E.useMemo(()=>({id:r.id,value:o,textValue:A,highlighted:r.isHighlighted,disabled:s,selected:n}),[r.id,o,A,r.isHighlighted,s,n]),O=E.useCallback(M=>{_optionalChain([m, 'optionalCall', _21 => _21(M)]),M.defaultPrevented||r.handlers.onClick(M)},[m,r.handlers]),W=E.useCallback(M=>{r.handlers.onPointerDown(M),_optionalChain([b, 'optionalCall', _22 => _22(M)])},[r.handlers,b]),z=E.useCallback(M=>{_optionalChain([I, 'optionalCall', _23 => _23(M)]),M.defaultPrevented||r.handlers.onPointerMove(M)},[I,r.handlers]),ee=_userender.useRender.call(void 0, {render:a,ref:[r.ref,r.rowRef,e],state:v,stateAttributesMapping:Vt,props:{...g,[q.slot]:"",id:r.id,role:"option",tabIndex:-1,"aria-selected":n,"aria-disabled":s||void 0,className:t,style:P,onClick:O,onPointerMove:z,onPointerDown:W,children:d},enabled:r.isVisible,defaultTagName:"div"});return r.isVisible?_jsxruntime.jsx.call(void 0, he.Provider,{value:y,children:ee}):null}var Te=E.forwardRef(Mt);var Pe={slot:"bazzaui-combobox-item-indicator",selected:"data-selected"};var wt={selected:x=>x?{[Pe.selected]:""}:null},He= exports.ComboboxItemIndicator =Ie.forwardRef(function(e,o){let{keepMounted:i=!1,render:u,className:s,style:p,...c}=e,a=ue(),t=Ie.useMemo(()=>({selected:a.selected}),[a.selected]),P=_userender.useRender.call(void 0, {render:u,ref:o,state:t,stateAttributesMapping:wt,props:{...c,[Pe.slot]:"","aria-hidden":!0,className:s,style:p},enabled:i||a.selected,defaultTagName:"span"});return!i&&!a.selected?null:P});var Do={slot:"bazzaui-combobox-item-label"};var Oe=Y.forwardRef(function(e,o){let{render:i,className:u,style:s,children:p,...c}=e,a=_chunkZ2RGBRJPcjs.w.call(void 0, ),t=ue(),P=_chunkZ2RGBRJPcjs.T.call(void 0, t.value,a.itemToStringValue),m=Y.useMemo(()=>{if(p!==void 0)return p;let I=_chunk5T5B5SPRcjs.f.call(void 0, a.items,P);return I!==void 0?I:t.textValue!==void 0?t.textValue:P},[p,a.items,P,t.textValue]),b=Y.useMemo(()=>({value:P,selected:t.selected,highlighted:t.highlighted,disabled:t.disabled}),[P,t.selected,t.highlighted,t.disabled]);return Y.useEffect(()=>{if(typeof m=="string")return a.registerItemText(P,m)},[m,a,P]),_userender.useRender.call(void 0, {render:i,ref:o,state:b,props:{...c,[Do.slot]:"",className:u,style:s,children:m},defaultTagName:"span"})});var _popover = require('@base-ui/react/popover');var Re={slot:"bazzaui-combobox-positioner"};function Tt(x,e,o,i){let u=o+i*2;if(x==="top"){let c=-(e+i),a=e+i;return{width:u,marginBottom:c,paddingTop:i,paddingLeft:i,paddingRight:i,paddingBottom:a}}let s=-(e+i),p=e+i;return{width:u,marginTop:s,paddingTop:p,paddingLeft:i,paddingRight:i,paddingBottom:i}}var De=U.forwardRef(function(e,o){let{layout:i,popupPadding:u=8,side:s="bottom",align:p,sideOffset:c=4,anchor:a,className:t,style:P,children:m,...b}=e,I=_chunkZ2RGBRJPcjs.w.call(void 0, ),d=_nullishCoalesce(i, () => (I.layout)),g=d==="input-embedded",l=_nullishCoalesce(a, () => (I.inputWrapperRef.current))?I.inputWrapperRef:I.inputRef,S=g?0:c,R=g?"center":_nullishCoalesce(p, () => ("start")),{inputHeight:L,inputWidth:w}=I,k=w+u*2,V={...P,...g?{zIndex:0}:{}};if(g)return _jsxruntime.jsx.call(void 0, _popover.Popover.Positioner,{ref:o,side:s,align:R,sideOffset:S,anchor:l,className:t,style:V,"data-input-embedded":"",[Re.slot]:"",...b,render:(n,f)=>{let r=f.side,v={layout:d,side:r,align:f.align,inputHeight:I.inputHeight},y={"--combobox-input-height":`${L}px`,"--combobox-input-width":`${w}px`,"--combobox-popup-padding":`${u}px`,"--combobox-popup-width":`${k}px`},O=Tt(r,L,w,u),W=U.Children.map(m,z=>U.isValidElement(z)?U.cloneElement(z,{style:{...O,...z.props.style},"data-side":r}):z);return _jsxruntime.jsx.call(void 0, fe.Provider,{value:v,children:_jsxruntime.jsx.call(void 0, "div",{...n,style:{...n.style,...y},"data-side":r,children:W})})}});let A={layout:d,side:s,align:R,inputHeight:I.inputHeight},K={"--combobox-input-height":`${L}px`,"--combobox-input-width":`${w}px`},j={...V,...K};return _jsxruntime.jsx.call(void 0, fe.Provider,{value:A,children:_jsxruntime.jsx.call(void 0, _popover.Popover.Positioner,{ref:o,side:s,align:R,sideOffset:S,anchor:l,className:t,style:j,[Re.slot]:"",...b,children:m})})});function Ae(x){let{open:e,onOpenChange:o,actionsRef:i,defaultOpen:u=!1,value:s,defaultValue:p,onValueChange:c,multiple:a=!1,values:t,defaultValues:P,onValuesChange:m,isItemEqualToValue:b=_chunk5T5B5SPRcjs.a,itemToStringLabel:I,itemToStringValue:d,inputValue:g,defaultInputValue:l="",onInputValueChange:S,name:R,form:L,required:w,disabled:k=!1,placeholder:V="Search...",items:A,modal:K=!1,closeOnSelect:j,openOnFocus:n=!0,virtualized:f=!1,virtualItems:r,onHighlightChange:v,layout:y="floating",onOpenChangeComplete:O,debug:W,children:z,...ee}=x,M=h.useCallback((C,H,G,be)=>_optionalChain([v, 'optionalCall', _24 => _24(C,G,be)]),[v]),me=h.useId(),ce=h.useRef(null),Se=h.useRef(null),[ze,Be]=h.useState(0),[We,je]=h.useState(0),Ge=h.useCallback(C=>{if(ce.current=C,C&&!Se.current){let H=C.getBoundingClientRect();Be(H.height),je(H.width)}},[]),Ne=h.useCallback(C=>{if(Se.current=C,C){let H=C.getBoundingClientRect();Be(H.height),je(H.width)}},[]),{store:B,focusOwnerStore:$o,openChainStore:Jo,registerSurface:Xo,closeAll:_o,virtualization:Qo,handleOpenChange:qe,disabled:$,setDisabled:Ke,menuTreeResolver:Yo}=_chunkZ2RGBRJPcjs.q.call(void 0, {onOpenChange:o,defaultOpen:u,virtualized:f,items:r,onHighlightChange:M,disabled:k}),ye=h.useRef(null);h.useImperativeHandle(i,()=>({close:()=>{_optionalChain([ye, 'access', _25 => _25.current, 'optionalAccess', _26 => _26.close, 'call', _27 => _27()])},unmount:()=>{_optionalChain([ye, 'access', _28 => _28.current, 'optionalAccess', _29 => _29.unmount, 'call', _30 => _30()])},setDisabled:Ke}),[Ke]),B.useControlledProp("openProp",e);let Zo=B.useState("open"),Ue=h.useCallback((C,H,G)=>{$&&H!==_chunkXMZZ62VJcjs.a.imperativeAction||!C&&ce.current&&document.activeElement===ce.current||qe(C,H,G)},[qe,$]),et=h.useCallback(C=>{!C&&B.context.clearSearchOnClose==="after-exit"&&(B.clearSearch(),B.setInputActive(!1)),C||B.clearHighlight(),_optionalChain([O, 'optionalCall', _31 => _31(C)])},[B,O]),ot=h.useCallback((C,H)=>{Ue(C,H.reason,H.event)},[Ue]),[tt,nt]=h.useState(p!==void 0?p:null),J=s!==void 0?s:tt,$e=h.useCallback(C=>{s===void 0&&nt(C),_optionalChain([c, 'optionalCall', _32 => _32(C)])},[s,c]),[rt,at]=h.useState(_nullishCoalesce(P, () => ([]))),ae=t!==void 0?t:rt,Je=h.useCallback(C=>{t===void 0&&at(C),_optionalChain([m, 'optionalCall', _33 => _33(C)])},[t,m]),[ve,st]=h.useState(l),Xe=g!==void 0?g:ve,_e=h.useCallback(C=>{g===void 0&&st(C),_optionalChain([S, 'optionalCall', _34 => _34(C)])},[g,S]),Qe=h.useRef(new Map),Ye=h.useCallback((C,H)=>(Qe.current.set(C,H),()=>{}),[]),Ze=_nullishCoalesce(j, () => (!a)),Ve=h.useRef({type:"active"}),[,lt]=h.useState({type:"active"}),X=h.useCallback(C=>{Ve.current=C,lt(C)},[]),eo=Ve.current,oo=h.useCallback(()=>{X({type:"active"})},[X]),to=h.useCallback(()=>{$||(!a&&J!=null?X({type:"showAll"}):X({type:"active"}),B.setOpen(!0))},[$,B,a,J,X]),no=h.useCallback((C,H)=>{let G=Ve.current,be=G.type==="active"?ve:G.type==="showAll"?"":G.search;X({type:"frozen",search:be}),B.setOpen(!1,C,H)},[B,X,ve]),ut=h.useMemo(()=>({multiple:a,value:J,values:ae,onValueChange:$e,onValuesChange:Je,isItemEqualToValue:b,itemToStringLabel:I,itemToStringValue:d,inputValue:Xe,onInputValueChange:_e,name:R,form:L,required:w,disabled:$,placeholder:V,items:A,itemTextRegistry:Qe.current,registerItemText:Ye,listId:me,inputRef:ce,setInputElement:Ge,inputWrapperRef:Se,setInputWrapperElement:Ne,closeOnSelect:Ze,openOnFocus:n,openCombobox:to,closeCombobox:no,filterMode:eo,setFilterActive:oo,inputHeight:ze,inputWidth:We,layout:y}),[a,J,ae,$e,Je,b,I,d,Xe,_e,R,L,w,$,V,A,Ye,me,Ge,Ne,Ze,n,to,no,eo,oo,ze,We,y]),it=h.useMemo(()=>R?a?ae.length>0?ae.map((C,H)=>{let G=_chunkZ2RGBRJPcjs.T.call(void 0, C,d);return _jsxruntime.jsx.call(void 0, "input",{type:"hidden",name:R,value:G,form:L,required:w&&H===0},G)}):_jsxruntime.jsx.call(void 0, "input",{type:"hidden",name:R,value:"",form:L,required:w}):_jsxruntime.jsx.call(void 0, "input",{type:"hidden",name:R,value:J!=null?_chunkZ2RGBRJPcjs.T.call(void 0, J,d):"",form:L,required:w}):null,[R,L,w,a,J,ae,d]);return _jsxruntime.jsx.call(void 0, _chunkZ2RGBRJPcjs.v.Provider,{value:ut,children:_jsxruntime.jsxs.call(void 0, _chunkZ2RGBRJPcjs.O,{menuTreeResolver:Yo,store:B,focusOwnerStore:$o,openChainStore:Jo,disabled:$,depth:0,closeAll:_o,registerSurface:Xo,virtualization:Qo,menuType:"dropdown",componentName:"combobox",debug:W,children:[it,_jsxruntime.jsx.call(void 0, _popover.Popover.Root,{...ee,open:Zo,onOpenChange:ot,onOpenChangeComplete:et,modal:K,actionsRef:i?ye:void 0,children:z})]})})}var Fo={slot:"bazzaui-combobox-surface"};var Fe=Z.forwardRef(function(e,o){let{autoHighlightFirst:i,clearSearchOnClose:u=!0,search:s,onSearchChange:p,onPointerMove:c,...a}=e,t=_chunkZ2RGBRJPcjs.w.call(void 0, ),P=Z.useCallback(g=>{_optionalChain([c, 'optionalCall', _35 => _35(g)]);let l=t.inputRef.current;l&&document.activeElement!==l&&l.focus()},[c,t.inputRef]),m=Z.useMemo(()=>{let g=_nullishCoalesce(i, () => (!0));if(g==="selected"){let l=t.multiple?t.values[0]:t.value;return l!=null?_chunkZ2RGBRJPcjs.T.call(void 0, l,t.itemToStringValue):!0}return g},[i,t.multiple,t.value,t.values,t.itemToStringValue]),{filterMode:b}=t,I=_nullishCoalesce(s, () => ((b.type==="active"?t.inputValue:b.type==="showAll"?"":b.search))),d=Z.useCallback(g=>{t.onInputValueChange(g),_optionalChain([p, 'optionalCall', _36 => _36(g)])},[t,p]);return _jsxruntime.jsx.call(void 0, _chunkZ2RGBRJPcjs.ga,{ref:o,autoHighlightFirst:m,clearSearchOnClose:u,search:I,onSearchChange:d,onPointerMove:P,skipAutoFocus:!0,[Fo.slot]:"",...a})});var Bo=(p=>(p.slot="bazzaui-combobox-arrow",p.open="data-open",p.closed="data-closed",p.side="data-side",p.align="data-align",p.uncentered="data-uncentered",p))(Bo||{});var Wo=(s=>(s.slot="bazzaui-combobox-backdrop",s.open="data-open",s.closed="data-closed",s.startingStyle="data-starting-style",s.endingStyle="data-ending-style",s))(Wo||{});var jo=(e=>(e.slot="bazzaui-combobox-empty",e))(jo||{});var Go=(e=>(e.slot="bazzaui-combobox-group",e))(Go||{});var No=(e=>(e.slot="bazzaui-combobox-group-label",e))(No||{});var At={slot:"bazzaui-combobox-icon",open:"data-popup-open"};var qo=(o=>(o.slot="bazzaui-combobox-list",o.list="data-popup-menu-list",o))(qo||{});var Ko=(b=>(b.slot="bazzaui-combobox-popup",b.open="data-open",b.closed="data-closed",b.side="data-side",b.align="data-align",b.startingStyle="data-starting-style",b.endingStyle="data-ending-style",b.instant="data-instant",b.focused="data-focused",b.hasOpenSubmenu="data-has-open-submenu",b.submenu="data-submenu",b.navigating="data-navigating",b))(Ko||{});var Ft={slotUp:"bazzaui-combobox-scroll-up-arrow",slotDown:"bazzaui-combobox-scroll-down-arrow",direction:"data-direction",side:"data-side"};var Uo=(e=>(e.slot="bazzaui-combobox-separator",e))(Uo||{});exports.Combobox = zo; exports.ComboboxArrowDataAttributes = Bo; exports.ComboboxBackdropDataAttributes = Wo; exports.ComboboxClear = Me; exports.ComboboxEmptyDataAttributes = jo; exports.ComboboxGroupDataAttributes = Go; exports.ComboboxGroupLabelDataAttributes = No; exports.ComboboxIconDataAttributes = At; exports.ComboboxInput = we; exports.ComboboxInputDataAttributes = Q; exports.ComboboxInputWrapper = ke; exports.ComboboxInputWrapperDataAttributes = ge; exports.ComboboxItem = Te; exports.ComboboxItemDataAttributes = q; exports.ComboboxItemIndicator = He; exports.ComboboxItemIndicatorDataAttributes = Pe; exports.ComboboxItemLabel = Oe; exports.ComboboxListCssVars = _chunkZ2RGBRJPcjs.ba; exports.ComboboxListDataAttributes = qo; exports.ComboboxPopupDataAttributes = Ko; exports.ComboboxPositioner = De; exports.ComboboxPositionerCssVars = _chunkZ2RGBRJPcjs.M; exports.ComboboxPositionerDataAttributes = Re; exports.ComboboxRoot = Ae; exports.ComboboxScrollArrowDataAttributes = Ft; exports.ComboboxSeparatorDataAttributes = Uo; exports.ComboboxStore = _chunkXMZZ62VJcjs.y; exports.ComboboxSurface = Fe; exports.commandScore = _chunkXMZZ62VJcjs.w; exports.defaultFilter = _chunkXMZZ62VJcjs.x; exports.useComboboxContext = _chunkZ2RGBRJPcjs.w; exports.useComboboxItemContext = ue; exports.useComboboxPositionerContext = Ee; exports.useMaybeComboboxContext = _chunkZ2RGBRJPcjs.x; exports.useMaybeComboboxItemContext = yt; exports.useMaybeSurfaceContext = _chunkXMZZ62VJcjs.q; exports.useSurfaceContext = _chunkXMZZ62VJcjs.p;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunk5T5B5SPRcjs = require('../chunk-5T5B5SPR.cjs');var _chunkBEWVWSAWcjs = require('../chunk-BEWVWSAW.cjs');var _chunkXMZZ62VJcjs = require('../chunk-XMZZ62VJ.cjs');var _chunkM4G6J7DPcjs = require('../chunk-M4G6J7DP.cjs');var zo={};_chunkM4G6J7DPcjs.a.call(void 0, zo,{Arrow:()=>_chunkBEWVWSAWcjs.s,Backdrop:()=>_chunkBEWVWSAWcjs.t,Clear:()=>Me,Empty:()=>_chunkBEWVWSAWcjs.V,Group:()=>_chunkBEWVWSAWcjs.ra,GroupLabel:()=>_chunkBEWVWSAWcjs.X,Icon:()=>_chunkBEWVWSAWcjs.U,Input:()=>we,InputWrapper:()=>ke,Item:()=>Te,ItemIndicator:()=>He,ItemLabel:()=>Oe,List:()=>_chunkBEWVWSAWcjs.ca,Popup:()=>_chunkBEWVWSAWcjs.K,Portal:()=>_chunkBEWVWSAWcjs.L,Positioner:()=>De,Root:()=>Ae,ScrollDownArrow:()=>_chunkBEWVWSAWcjs.fa,ScrollUpArrow:()=>_chunkBEWVWSAWcjs.ea,Separator:()=>_chunkBEWVWSAWcjs.ua,Surface:()=>Fe,useComboboxPositionerContext:()=>Ee});var _userender = require('@base-ui/react/use-render');var _react = require('react'); var _ = _interopRequireWildcard(_react); var xe = _interopRequireWildcard(_react); var ne = _interopRequireWildcard(_react); var Ce = _interopRequireWildcard(_react); var se = _interopRequireWildcard(_react); var T = _interopRequireWildcard(_react); var re = _interopRequireWildcard(_react); var E = _interopRequireWildcard(_react); var le = _interopRequireWildcard(_react); var Ie = _interopRequireWildcard(_react); var Y = _interopRequireWildcard(_react); var U = _interopRequireWildcard(_react); var h = _interopRequireWildcard(_react); var Z = _interopRequireWildcard(_react);var ko={slot:"bazzaui-combobox-clear"};var Me=_.forwardRef(function(e,o){let{keepMounted:i=!1,disabled:u,render:s,className:p,style:c,onClick:a,onPointerDown:t,...P}=e,m=_chunkBEWVWSAWcjs.w.call(void 0, ),b=_nullishCoalesce(u, () => (m.disabled)),I=m.multiple?m.values.length>0:m.value!=="",d=_.useCallback(R=>{_optionalChain([a, 'optionalCall', _2 => _2(R)]),!R.defaultPrevented&&(m.multiple?m.onValuesChange([]):m.onValueChange(""),m.onInputValueChange(""))},[a,m]),g=_.useCallback(R=>{R.preventDefault(),_optionalChain([t, 'optionalCall', _3 => _3(R)])},[t]),l=_.useMemo(()=>({hasValue:I,disabled:b}),[I,b]),S=_userender.useRender.call(void 0, {render:s,ref:o,state:l,props:{...P,[ko.slot]:"",type:"button",tabIndex:-1,"aria-label":"Clear selection",disabled:b||!I,className:p,style:c,onClick:d,onPointerDown:g},enabled:i||I,defaultTagName:"button"});return!i&&!I?null:S});var fe=xe.createContext(null);function Ee(){return xe.useContext(fe)}var Le=Ce.createContext(!1);function To(){return Ce.useContext(Le)}var Q={slot:"bazzaui-combobox-input",open:"data-open",closed:"data-closed",disabled:"data-disabled",placeholder:"data-placeholder"};function Ho(x){let{comboboxContext:e,open:o}=x,i=e.multiple?e.values.length>0:!_chunkBEWVWSAWcjs.R.call(void 0, e.value),u=se.useCallback(c=>{let a=_chunkBEWVWSAWcjs.T.call(void 0, c,e.itemToStringValue),t=e.itemTextRegistry.get(a);if(t!==void 0)return t;let P=_chunk5T5B5SPRcjs.f.call(void 0, e.items,a);if(typeof P=="string")return P;let m=_chunkBEWVWSAWcjs.S.call(void 0, c,e.itemToStringLabel);if(m&&m!==a)return m},[e.itemTextRegistry,e.items,e.itemToStringLabel,e.itemToStringValue]),s=se.useMemo(()=>{if(!i)return"";if(e.multiple){let t=e.values.map(P=>{let m=u(P);return m!==void 0?m:_chunkBEWVWSAWcjs.S.call(void 0, P,e.itemToStringLabel)||_chunkBEWVWSAWcjs.T.call(void 0, P,e.itemToStringValue)}).filter(Boolean);return t.length<=2?t.join(", "):`${t.length} selected`}let c=e.value;if(c==null)return"";let a=u(c);return a!==void 0?a:_chunkBEWVWSAWcjs.S.call(void 0, c,e.itemToStringLabel)||_chunkBEWVWSAWcjs.T.call(void 0, c,e.itemToStringValue)},[i,e.multiple,e.value,e.values,e.itemToStringLabel,e.itemToStringValue,u]),p=se.useMemo(()=>o?e.inputValue:s,[o,s,e.inputValue]);return{hasValue:i,displayValue:p,selectedLabel:s,getValueText:u}}function Oo(x){let{comboboxContext:e,store:o,focusOwnerStore:i,open:u,disabled:s,cursorBehavior:p,hasValue:c,getValueText:a,onFocus:t,onBlur:P,onClick:m,onKeyDown:b}=x,I=T.useRef(!1),d=T.useRef(!1),g=T.useRef(!1),l=T.useRef(null),S=T.useRef(null),R=T.useRef(null);T.useEffect(()=>{if(!u)return;let n=f=>{let r=e.inputRef.current,v=e.inputWrapperRef.current,y=document.getElementById(e.listId),O=f.target,W=_optionalChain([r, 'optionalAccess', _4 => _4.contains, 'call', _5 => _5(O)]),z=_optionalChain([v, 'optionalAccess', _6 => _6.contains, 'call', _7 => _7(O)]),ee=_optionalChain([y, 'optionalAccess', _8 => _8.contains, 'call', _9 => _9(O)]);!W&&!z&&!ee&&(R.current=f)};return document.addEventListener("pointerdown",n,!0),()=>{document.removeEventListener("pointerdown",n,!0),R.current=null}},[u,e.inputRef,e.inputWrapperRef,e.listId]),T.useLayoutEffect(()=>{let n=e.inputRef.current;if(n&&u&&S.current){let{start:f,end:r}=S.current,v=n.selectionStart,y=n.value.length;v===y&&f!==y&&n.setSelectionRange(f,r),S.current=null}});let L=T.useRef(u);T.useLayoutEffect(()=>{if(u&&!L.current){if(I.current){I.current=!1,L.current=u;return}if(g.current){g.current=!1,d.current=!1,l.current=null,L.current=u;return}if(d.current&&p==="none"){let f=e.inputRef.current,r=l.current;f&&r!==null&&requestAnimationFrame(()=>{let v=f.value.length,y=Math.min(r,v);f.setSelectionRange(y,y)}),d.current=!1,l.current=null,L.current=u;return}c&&e.multiple&&e.onInputValueChange("");let n=e.inputRef.current;if(n){let f=n.value.length;p==="select-all"&&f>0?requestAnimationFrame(()=>{n.setSelectionRange(0,n.value.length)}):p==="end"&&f>0&&requestAnimationFrame(()=>{n.setSelectionRange(n.value.length,n.value.length)})}}L.current=u},[u,e,c,p]);let w=T.useCallback(n=>{let f=n.target,r=f.value,v=f.selectionStart,y=f.selectionEnd;v!==null&&y!==null&&(S.current={start:v,end:y}),e.onInputValueChange(r),e.setFilterActive(),o.setSearch(r),o.state.open||(I.current=!0,e.openCombobox())},[e,o]),k=T.useCallback(n=>{if(_optionalChain([t, 'optionalCall', _10 => _10(n)]),n.defaultPrevented)return;let f=o.state.open;if(f&&(g.current=!0),e.openOnFocus&&!s&&!f){if(c&&!e.multiple){let r=_nullishCoalesce(a(e.value), () => (_chunkBEWVWSAWcjs.S.call(void 0, e.value,e.itemToStringLabel)));e.onInputValueChange(r)}e.openCombobox()}},[t,e,s,o,c,a]),V=T.useCallback(n=>{_optionalChain([P, 'optionalCall', _11 => _11(n)]),!n.defaultPrevented&&requestAnimationFrame(()=>{let f=document.activeElement,v=_optionalChain([document, 'access', _12 => _12.getElementById, 'call', _13 => _13(e.listId), 'optionalAccess', _14 => _14.contains, 'call', _15 => _15(f)]),y=f===e.inputRef.current;if(!v&&!y){g.current=!1;let O=R.current,W=O?_chunkXMZZ62VJcjs.a.outsidePress:_chunkXMZZ62VJcjs.a.focusOut;R.current=null,e.closeCombobox(W,_nullishCoalesce(O, () => (void 0)))}})},[P,e]),A=T.useCallback(n=>{if(_optionalChain([m, 'optionalCall', _16 => _16(n)]),n.defaultPrevented)return;let f=o.state.open;if(!s&&!f){let r=n.target;if(p==="none"){let v=r.selectionStart;l.current=v,d.current=!0}if(c&&!e.multiple){let v=_nullishCoalesce(a(e.value), () => (_chunkBEWVWSAWcjs.S.call(void 0, e.value,e.itemToStringLabel)));e.onInputValueChange(v)}e.openCombobox()}else f&&(g.current=!0)},[m,e,s,o,p,c,a]),K=T.useCallback(n=>{if(_optionalChain([b, 'optionalCall', _17 => _17(n)]),!n.defaultPrevented){if(u&&n.key==="Escape"){n.preventDefault(),e.closeCombobox(_chunkXMZZ62VJcjs.a.escapeKey);return}if(!u&&(n.key==="ArrowDown"||n.key==="ArrowUp"||n.key==="Enter")){if(n.preventDefault(),c&&!e.multiple){let f=_nullishCoalesce(a(e.value), () => (_chunkBEWVWSAWcjs.S.call(void 0, e.value,e.itemToStringLabel)));e.onInputValueChange(f)}e.openCombobox();return}}},[u,e,b,c,a]),{handleKeyDown:j}=_chunkBEWVWSAWcjs.Q.call(void 0, {store:o,surfaceId:"combobox-input",focusOwnerStore:i,depth:0,submenuContext:null,subpageContext:null,enabled:u,enableTypeToSearch:!1,onKeyDown:K,closeAll:e.closeCombobox,skipFocusOwnerCheck:!0});return{handleChange:w,handleFocus:k,handleBlur:V,handleClick:A,handleKeyDown:j,selectionRef:S}}var we=ne.forwardRef(function(e,o){let{placeholder:i,disabled:u,cursorBehavior:s="none",render:p,className:c,style:a,onFocus:t,onBlur:P,onClick:m,onKeyDown:b,...I}=e,d=_chunkBEWVWSAWcjs.w.call(void 0, ),g=_chunkBEWVWSAWcjs.d.call(void 0, ),l=_chunkBEWVWSAWcjs.a.call(void 0, ),S=To(),R=(_nullishCoalesce(u, () => (d.disabled)))||g.disabled,L=_chunk5T5B5SPRcjs.f.call(void 0, d.items,""),w=_nullishCoalesce(_nullishCoalesce(i, () => ((typeof L=="string"?L:void 0))), () => (d.placeholder)),k=g.store.useState("open"),{hasValue:V,displayValue:A,getValueText:K}=Ho({comboboxContext:d,open:k}),{handleChange:j,handleFocus:n,handleBlur:f,handleClick:r,handleKeyDown:v}=Oo({comboboxContext:d,store:g.store,focusOwnerStore:l,open:k,disabled:R,cursorBehavior:s,hasValue:V,getValueText:K,onFocus:t,onBlur:P,onClick:m,onKeyDown:b}),y={[Q.slot]:""};k?y[Q.open]="":y[Q.closed]="",R&&(y[Q.disabled]=""),V||(y[Q.placeholder]=""),d.layout==="input-embedded"&&(y["data-input-embedded"]="");let O=ne.useCallback(M=>{d.setInputElement(M),typeof o=="function"?o(M):o&&(o.current=M)},[o,d]),W=ne.useMemo(()=>({open:k,disabled:R,placeholder:!V}),[k,R,V]),z=d.layout==="input-embedded"&&!S?{position:"relative",zIndex:1}:void 0;return _userender.useRender.call(void 0, {render:p,ref:O,state:W,props:{...I,...y,type:"text",role:"combobox","aria-autocomplete":"list","aria-expanded":k,"aria-controls":d.listId,"aria-haspopup":"listbox",autoComplete:"off",autoCorrect:"off",spellCheck:!1,disabled:R,placeholder:V?void 0:w,className:c,style:{...z,...a},value:A,onChange:j,onFocus:n,onBlur:f,onClick:r,onKeyDown:v},defaultTagName:"input"})});var ge={slot:"bazzaui-combobox-input-wrapper",open:"data-open"};var _jsxruntime = require('react/jsx-runtime');var Rt={open:x=>x?{[ge.open]:""}:null},ke= exports.ComboboxInputWrapper =re.forwardRef(function(e,o){let{render:i,className:u,style:s,children:p,...c}=e,{store:a}=_chunkBEWVWSAWcjs.d.call(void 0, ),t=_chunkBEWVWSAWcjs.w.call(void 0, ),P=a.useState("open"),m=re.useMemo(()=>({open:P}),[P]),b=t.layout==="input-embedded"?{position:"relative",zIndex:1}:{position:"relative"},I=re.useCallback(g=>{t.setInputWrapperElement(g),typeof o=="function"?o(g):o&&(o.current=g)},[o,t]),d=_userender.useRender.call(void 0, {render:i,ref:I,state:m,stateAttributesMapping:Rt,props:{...c,[ge.slot]:"",className:u,style:{...b,...s},children:p},defaultTagName:"div"});return _jsxruntime.jsx.call(void 0, Le.Provider,{value:!0,children:d})});var q={slot:"bazzaui-combobox-item",highlighted:"data-highlighted",disabled:"data-disabled",selected:"data-selected",first:"data-first",last:"data-last",firstInGroup:"data-first-in-group",lastInGroup:"data-last-in-group"};var he=le.createContext(null);function ue(){let x=le.useContext(he);if(!x)throw new Error("ComboboxItem child components must be used within a Combobox.Item");return x}function yt(){return le.useContext(he)}var Vt={highlighted:x=>x?{[q.highlighted]:""}:null,disabled:x=>x?{[q.disabled]:""}:null,selected:x=>x?{[q.selected]:""}:null,first:x=>x?{[q.first]:""}:null,last:x=>x?{[q.last]:""}:null,firstInGroup:x=>x?{[q.firstInGroup]:""}:null,lastInGroup:x=>x?{[q.lastInGroup]:""}:null};function Mt(x,e){let{value:o,textValue:i,keywords:u,disabled:s=!1,onSelect:p,forceMount:c=!1,render:a,className:t,style:P,onClick:m,onPointerDown:b,onPointerMove:I,children:d,...g}=x,l=_chunkBEWVWSAWcjs.w.call(void 0, ),S=E.useMemo(()=>_chunkBEWVWSAWcjs.T.call(void 0, o,l.itemToStringValue),[o,l.itemToStringValue]),R=E.useId(),L=o===null?`combobox-clear-${R}`:void 0,w=E.useMemo(()=>_chunk5T5B5SPRcjs.e.call(void 0, l.items,S),[l.items,S]),k=_optionalChain([w, 'optionalAccess', _18 => _18.label]),V=E.useMemo(()=>_chunkBEWVWSAWcjs.S.call(void 0, o,l.itemToStringLabel),[o,l.itemToStringLabel]),A=E.useMemo(()=>{if(i!==void 0)return i;if(typeof k=="string")return k;if(V&&V!==S)return V},[i,k,V,S]),K=E.useMemo(()=>_chunk5T5B5SPRcjs.g.call(void 0, u,[typeof k=="string"?k:V&&V!==S?V:void 0,..._nullishCoalesce(_optionalChain([w, 'optionalAccess', _19 => _19.keywords]), () => ([]))]),[u,k,V,S,w]),j=E.useRef(A),n=l.multiple?_chunk5T5B5SPRcjs.c.call(void 0, l.values,o,l.isItemEqualToValue):l.value!==""&&_chunk5T5B5SPRcjs.b.call(void 0, l.value,o,l.isItemEqualToValue),f=l.closeOnSelect,r=_chunkBEWVWSAWcjs.P.call(void 0, {id:L,value:S,keywords:K,disabled:s,forceMount:c,closeOnClick:f,children:d});E.useEffect(()=>{let M=()=>{if(!s){if(l.multiple)if(o==null)l.onValuesChange([]);else{let me=n?_chunk5T5B5SPRcjs.d.call(void 0, l.values,o,l.isItemEqualToValue):[...l.values,o];l.onValuesChange(me)}else l.onValueChange(o);_optionalChain([p, 'optionalCall', _20 => _20()])}};return r.registerSelect(M)},[s,l,o,n,p,r]),E.useEffect(()=>{let M=j.current;if(M)return l.registerItemText(S,M)},[S,l]),E.useEffect(()=>{!A&&typeof d=="string"&&(j.current=d,l.registerItemText(S,d))},[d,A,S,l]);let v=E.useMemo(()=>({highlighted:r.isHighlighted,disabled:s,selected:n,first:r.positional.first,last:r.positional.last,firstInGroup:r.positional.firstInGroup,lastInGroup:r.positional.lastInGroup}),[r.isHighlighted,s,n,r.positional]),y=E.useMemo(()=>({id:r.id,value:o,textValue:A,highlighted:r.isHighlighted,disabled:s,selected:n}),[r.id,o,A,r.isHighlighted,s,n]),O=E.useCallback(M=>{_optionalChain([m, 'optionalCall', _21 => _21(M)]),M.defaultPrevented||r.handlers.onClick(M)},[m,r.handlers]),W=E.useCallback(M=>{r.handlers.onPointerDown(M),_optionalChain([b, 'optionalCall', _22 => _22(M)])},[r.handlers,b]),z=E.useCallback(M=>{_optionalChain([I, 'optionalCall', _23 => _23(M)]),M.defaultPrevented||r.handlers.onPointerMove(M)},[I,r.handlers]),ee=_userender.useRender.call(void 0, {render:a,ref:[r.ref,r.rowRef,e],state:v,stateAttributesMapping:Vt,props:{...g,[q.slot]:"",id:r.id,role:"option",tabIndex:-1,"aria-selected":n,"aria-disabled":s||void 0,className:t,style:P,onClick:O,onPointerMove:z,onPointerDown:W,children:d},enabled:r.isVisible,defaultTagName:"div"});return r.isVisible?_jsxruntime.jsx.call(void 0, he.Provider,{value:y,children:ee}):null}var Te=E.forwardRef(Mt);var Pe={slot:"bazzaui-combobox-item-indicator",selected:"data-selected"};var wt={selected:x=>x?{[Pe.selected]:""}:null},He= exports.ComboboxItemIndicator =Ie.forwardRef(function(e,o){let{keepMounted:i=!1,render:u,className:s,style:p,...c}=e,a=ue(),t=Ie.useMemo(()=>({selected:a.selected}),[a.selected]),P=_userender.useRender.call(void 0, {render:u,ref:o,state:t,stateAttributesMapping:wt,props:{...c,[Pe.slot]:"","aria-hidden":!0,className:s,style:p},enabled:i||a.selected,defaultTagName:"span"});return!i&&!a.selected?null:P});var Do={slot:"bazzaui-combobox-item-label"};var Oe=Y.forwardRef(function(e,o){let{render:i,className:u,style:s,children:p,...c}=e,a=_chunkBEWVWSAWcjs.w.call(void 0, ),t=ue(),P=_chunkBEWVWSAWcjs.T.call(void 0, t.value,a.itemToStringValue),m=Y.useMemo(()=>{if(p!==void 0)return p;let I=_chunk5T5B5SPRcjs.f.call(void 0, a.items,P);return I!==void 0?I:t.textValue!==void 0?t.textValue:P},[p,a.items,P,t.textValue]),b=Y.useMemo(()=>({value:P,selected:t.selected,highlighted:t.highlighted,disabled:t.disabled}),[P,t.selected,t.highlighted,t.disabled]);return Y.useEffect(()=>{if(typeof m=="string")return a.registerItemText(P,m)},[m,a,P]),_userender.useRender.call(void 0, {render:i,ref:o,state:b,props:{...c,[Do.slot]:"",className:u,style:s,children:m},defaultTagName:"span"})});var _popover = require('@base-ui/react/popover');var Re={slot:"bazzaui-combobox-positioner"};function Tt(x,e,o,i){let u=o+i*2;if(x==="top"){let c=-(e+i),a=e+i;return{width:u,marginBottom:c,paddingTop:i,paddingLeft:i,paddingRight:i,paddingBottom:a}}let s=-(e+i),p=e+i;return{width:u,marginTop:s,paddingTop:p,paddingLeft:i,paddingRight:i,paddingBottom:i}}var De=U.forwardRef(function(e,o){let{layout:i,popupPadding:u=8,side:s="bottom",align:p,sideOffset:c=4,anchor:a,className:t,style:P,children:m,...b}=e,I=_chunkBEWVWSAWcjs.w.call(void 0, ),d=_nullishCoalesce(i, () => (I.layout)),g=d==="input-embedded",l=_nullishCoalesce(a, () => (I.inputWrapperRef.current))?I.inputWrapperRef:I.inputRef,S=g?0:c,R=g?"center":_nullishCoalesce(p, () => ("start")),{inputHeight:L,inputWidth:w}=I,k=w+u*2,V={...P,...g?{zIndex:0}:{}};if(g)return _jsxruntime.jsx.call(void 0, _popover.Popover.Positioner,{ref:o,side:s,align:R,sideOffset:S,anchor:l,className:t,style:V,"data-input-embedded":"",[Re.slot]:"",...b,render:(n,f)=>{let r=f.side,v={layout:d,side:r,align:f.align,inputHeight:I.inputHeight},y={"--combobox-input-height":`${L}px`,"--combobox-input-width":`${w}px`,"--combobox-popup-padding":`${u}px`,"--combobox-popup-width":`${k}px`},O=Tt(r,L,w,u),W=U.Children.map(m,z=>U.isValidElement(z)?U.cloneElement(z,{style:{...O,...z.props.style},"data-side":r}):z);return _jsxruntime.jsx.call(void 0, fe.Provider,{value:v,children:_jsxruntime.jsx.call(void 0, "div",{...n,style:{...n.style,...y},"data-side":r,children:W})})}});let A={layout:d,side:s,align:R,inputHeight:I.inputHeight},K={"--combobox-input-height":`${L}px`,"--combobox-input-width":`${w}px`},j={...V,...K};return _jsxruntime.jsx.call(void 0, fe.Provider,{value:A,children:_jsxruntime.jsx.call(void 0, _popover.Popover.Positioner,{ref:o,side:s,align:R,sideOffset:S,anchor:l,className:t,style:j,[Re.slot]:"",...b,children:m})})});function Ae(x){let{open:e,onOpenChange:o,actionsRef:i,defaultOpen:u=!1,value:s,defaultValue:p,onValueChange:c,multiple:a=!1,values:t,defaultValues:P,onValuesChange:m,isItemEqualToValue:b=_chunk5T5B5SPRcjs.a,itemToStringLabel:I,itemToStringValue:d,inputValue:g,defaultInputValue:l="",onInputValueChange:S,name:R,form:L,required:w,disabled:k=!1,placeholder:V="Search...",items:A,modal:K=!1,closeOnSelect:j,openOnFocus:n=!0,virtualized:f=!1,virtualItems:r,onHighlightChange:v,layout:y="floating",onOpenChangeComplete:O,debug:W,children:z,...ee}=x,M=h.useCallback((C,H,G,be)=>_optionalChain([v, 'optionalCall', _24 => _24(C,G,be)]),[v]),me=h.useId(),ce=h.useRef(null),Se=h.useRef(null),[ze,Be]=h.useState(0),[We,je]=h.useState(0),Ge=h.useCallback(C=>{if(ce.current=C,C&&!Se.current){let H=C.getBoundingClientRect();Be(H.height),je(H.width)}},[]),Ne=h.useCallback(C=>{if(Se.current=C,C){let H=C.getBoundingClientRect();Be(H.height),je(H.width)}},[]),{store:B,focusOwnerStore:$o,openChainStore:Jo,registerSurface:Xo,closeAll:_o,virtualization:Qo,handleOpenChange:qe,disabled:$,setDisabled:Ke,menuTreeResolver:Yo}=_chunkBEWVWSAWcjs.q.call(void 0, {onOpenChange:o,defaultOpen:u,virtualized:f,items:r,onHighlightChange:M,disabled:k}),ye=h.useRef(null);h.useImperativeHandle(i,()=>({close:()=>{_optionalChain([ye, 'access', _25 => _25.current, 'optionalAccess', _26 => _26.close, 'call', _27 => _27()])},unmount:()=>{_optionalChain([ye, 'access', _28 => _28.current, 'optionalAccess', _29 => _29.unmount, 'call', _30 => _30()])},setDisabled:Ke}),[Ke]),B.useControlledProp("openProp",e);let Zo=B.useState("open"),Ue=h.useCallback((C,H,G)=>{$&&H!==_chunkXMZZ62VJcjs.a.imperativeAction||!C&&ce.current&&document.activeElement===ce.current||qe(C,H,G)},[qe,$]),et=h.useCallback(C=>{!C&&B.context.clearSearchOnClose==="after-exit"&&(B.clearSearch(),B.setInputActive(!1)),C||B.clearHighlight(),_optionalChain([O, 'optionalCall', _31 => _31(C)])},[B,O]),ot=h.useCallback((C,H)=>{Ue(C,H.reason,H.event)},[Ue]),[tt,nt]=h.useState(p!==void 0?p:null),J=s!==void 0?s:tt,$e=h.useCallback(C=>{s===void 0&&nt(C),_optionalChain([c, 'optionalCall', _32 => _32(C)])},[s,c]),[rt,at]=h.useState(_nullishCoalesce(P, () => ([]))),ae=t!==void 0?t:rt,Je=h.useCallback(C=>{t===void 0&&at(C),_optionalChain([m, 'optionalCall', _33 => _33(C)])},[t,m]),[ve,st]=h.useState(l),Xe=g!==void 0?g:ve,_e=h.useCallback(C=>{g===void 0&&st(C),_optionalChain([S, 'optionalCall', _34 => _34(C)])},[g,S]),Qe=h.useRef(new Map),Ye=h.useCallback((C,H)=>(Qe.current.set(C,H),()=>{}),[]),Ze=_nullishCoalesce(j, () => (!a)),Ve=h.useRef({type:"active"}),[,lt]=h.useState({type:"active"}),X=h.useCallback(C=>{Ve.current=C,lt(C)},[]),eo=Ve.current,oo=h.useCallback(()=>{X({type:"active"})},[X]),to=h.useCallback(()=>{$||(!a&&J!=null?X({type:"showAll"}):X({type:"active"}),B.setOpen(!0))},[$,B,a,J,X]),no=h.useCallback((C,H)=>{let G=Ve.current,be=G.type==="active"?ve:G.type==="showAll"?"":G.search;X({type:"frozen",search:be}),B.setOpen(!1,C,H)},[B,X,ve]),ut=h.useMemo(()=>({multiple:a,value:J,values:ae,onValueChange:$e,onValuesChange:Je,isItemEqualToValue:b,itemToStringLabel:I,itemToStringValue:d,inputValue:Xe,onInputValueChange:_e,name:R,form:L,required:w,disabled:$,placeholder:V,items:A,itemTextRegistry:Qe.current,registerItemText:Ye,listId:me,inputRef:ce,setInputElement:Ge,inputWrapperRef:Se,setInputWrapperElement:Ne,closeOnSelect:Ze,openOnFocus:n,openCombobox:to,closeCombobox:no,filterMode:eo,setFilterActive:oo,inputHeight:ze,inputWidth:We,layout:y}),[a,J,ae,$e,Je,b,I,d,Xe,_e,R,L,w,$,V,A,Ye,me,Ge,Ne,Ze,n,to,no,eo,oo,ze,We,y]),it=h.useMemo(()=>R?a?ae.length>0?ae.map((C,H)=>{let G=_chunkBEWVWSAWcjs.T.call(void 0, C,d);return _jsxruntime.jsx.call(void 0, "input",{type:"hidden",name:R,value:G,form:L,required:w&&H===0},G)}):_jsxruntime.jsx.call(void 0, "input",{type:"hidden",name:R,value:"",form:L,required:w}):_jsxruntime.jsx.call(void 0, "input",{type:"hidden",name:R,value:J!=null?_chunkBEWVWSAWcjs.T.call(void 0, J,d):"",form:L,required:w}):null,[R,L,w,a,J,ae,d]);return _jsxruntime.jsx.call(void 0, _chunkBEWVWSAWcjs.v.Provider,{value:ut,children:_jsxruntime.jsxs.call(void 0, _chunkBEWVWSAWcjs.O,{menuTreeResolver:Yo,store:B,focusOwnerStore:$o,openChainStore:Jo,disabled:$,depth:0,closeAll:_o,registerSurface:Xo,virtualization:Qo,menuType:"dropdown",componentName:"combobox",debug:W,children:[it,_jsxruntime.jsx.call(void 0, _popover.Popover.Root,{...ee,open:Zo,onOpenChange:ot,onOpenChangeComplete:et,modal:K,actionsRef:i?ye:void 0,children:z})]})})}var Fo={slot:"bazzaui-combobox-surface"};var Fe=Z.forwardRef(function(e,o){let{autoHighlightFirst:i,clearSearchOnClose:u=!0,search:s,onSearchChange:p,onPointerMove:c,...a}=e,t=_chunkBEWVWSAWcjs.w.call(void 0, ),P=Z.useCallback(g=>{_optionalChain([c, 'optionalCall', _35 => _35(g)]);let l=t.inputRef.current;l&&document.activeElement!==l&&l.focus()},[c,t.inputRef]),m=Z.useMemo(()=>{let g=_nullishCoalesce(i, () => (!0));if(g==="selected"){let l=t.multiple?t.values[0]:t.value;return l!=null?_chunkBEWVWSAWcjs.T.call(void 0, l,t.itemToStringValue):!0}return g},[i,t.multiple,t.value,t.values,t.itemToStringValue]),{filterMode:b}=t,I=_nullishCoalesce(s, () => ((b.type==="active"?t.inputValue:b.type==="showAll"?"":b.search))),d=Z.useCallback(g=>{t.onInputValueChange(g),_optionalChain([p, 'optionalCall', _36 => _36(g)])},[t,p]);return _jsxruntime.jsx.call(void 0, _chunkBEWVWSAWcjs.ga,{ref:o,autoHighlightFirst:m,clearSearchOnClose:u,search:I,onSearchChange:d,onPointerMove:P,skipAutoFocus:!0,[Fo.slot]:"",...a})});var Bo=(p=>(p.slot="bazzaui-combobox-arrow",p.open="data-open",p.closed="data-closed",p.side="data-side",p.align="data-align",p.uncentered="data-uncentered",p))(Bo||{});var Wo=(s=>(s.slot="bazzaui-combobox-backdrop",s.open="data-open",s.closed="data-closed",s.startingStyle="data-starting-style",s.endingStyle="data-ending-style",s))(Wo||{});var jo=(e=>(e.slot="bazzaui-combobox-empty",e))(jo||{});var Go=(e=>(e.slot="bazzaui-combobox-group",e))(Go||{});var No=(e=>(e.slot="bazzaui-combobox-group-label",e))(No||{});var At={slot:"bazzaui-combobox-icon",open:"data-popup-open"};var qo=(o=>(o.slot="bazzaui-combobox-list",o.list="data-popup-menu-list",o))(qo||{});var Ko=(b=>(b.slot="bazzaui-combobox-popup",b.open="data-open",b.closed="data-closed",b.side="data-side",b.align="data-align",b.startingStyle="data-starting-style",b.endingStyle="data-ending-style",b.instant="data-instant",b.focused="data-focused",b.hasOpenSubmenu="data-has-open-submenu",b.submenu="data-submenu",b.navigating="data-navigating",b))(Ko||{});var Ft={slotUp:"bazzaui-combobox-scroll-up-arrow",slotDown:"bazzaui-combobox-scroll-down-arrow",direction:"data-direction",side:"data-side"};var Uo=(e=>(e.slot="bazzaui-combobox-separator",e))(Uo||{});exports.Combobox = zo; exports.ComboboxArrowDataAttributes = Bo; exports.ComboboxBackdropDataAttributes = Wo; exports.ComboboxClear = Me; exports.ComboboxEmptyDataAttributes = jo; exports.ComboboxGroupDataAttributes = Go; exports.ComboboxGroupLabelDataAttributes = No; exports.ComboboxIconDataAttributes = At; exports.ComboboxInput = we; exports.ComboboxInputDataAttributes = Q; exports.ComboboxInputWrapper = ke; exports.ComboboxInputWrapperDataAttributes = ge; exports.ComboboxItem = Te; exports.ComboboxItemDataAttributes = q; exports.ComboboxItemIndicator = He; exports.ComboboxItemIndicatorDataAttributes = Pe; exports.ComboboxItemLabel = Oe; exports.ComboboxListCssVars = _chunkBEWVWSAWcjs.ba; exports.ComboboxListDataAttributes = qo; exports.ComboboxPopupDataAttributes = Ko; exports.ComboboxPositioner = De; exports.ComboboxPositionerCssVars = _chunkBEWVWSAWcjs.M; exports.ComboboxPositionerDataAttributes = Re; exports.ComboboxRoot = Ae; exports.ComboboxScrollArrowDataAttributes = Ft; exports.ComboboxSeparatorDataAttributes = Uo; exports.ComboboxStore = _chunkXMZZ62VJcjs.y; exports.ComboboxSurface = Fe; exports.commandScore = _chunkXMZZ62VJcjs.w; exports.defaultFilter = _chunkXMZZ62VJcjs.x; exports.useComboboxContext = _chunkBEWVWSAWcjs.w; exports.useComboboxItemContext = ue; exports.useComboboxPositionerContext = Ee; exports.useMaybeComboboxContext = _chunkBEWVWSAWcjs.x; exports.useMaybeComboboxItemContext = yt; exports.useMaybeSurfaceContext = _chunkXMZZ62VJcjs.q; exports.useSurfaceContext = _chunkXMZZ62VJcjs.p;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,15 +1,15 @@
1
- import { V as VirtualItem } from '../ListboxStore-DCGGpiBg.cjs';
2
- export { F as ComboboxFilterFn, I as ComboboxItemRegistration, b as ComboboxStore, L as ComboboxStoreContext, a as ComboboxStoreState } from '../ListboxStore-DCGGpiBg.cjs';
3
- import { P as PopupMenuDebugOptions, a as PopupMenuRootActions, b as PopupMenuArrow, c as PopupMenuBackdrop, d as PopupMenuPopup, e as PopupMenuPortal, f as PopupMenuScrollDownArrow, g as PopupMenuScrollUpArrow } from '../scroll-arrow-rsrV6nun.cjs';
4
- export { h as ComboboxArrowProps, i as ComboboxBackdropProps, p as ComboboxListCssVars, j as ComboboxPopupProps, k as ComboboxPortalProps, q as ComboboxPositionerCssVars, l as ComboboxScrollArrowProps, m as ComboboxScrollArrowState, n as ComboboxScrollDownArrowProps, o as ComboboxScrollUpArrowProps } from '../scroll-arrow-rsrV6nun.cjs';
5
- import { f as PopupMenuSurface, t as PopupMenuSurfaceProps, P as PopupMenuEmpty, a as PopupMenuGroup, b as PopupMenuGroupLabel, c as PopupMenuIcon, d as PopupMenuList, e as PopupMenuSeparator } from '../separator-DzfgGPjS.cjs';
6
- export { g as ComboboxEmptyProps, h as ComboboxEmptyState, i as ComboboxGroupLabelProps, j as ComboboxGroupLabelState, k as ComboboxGroupProps, l as ComboboxGroupState, m as ComboboxIconProps, n as ComboboxIconState, o as ComboboxListChildrenState, p as ComboboxListProps, q as ComboboxListState, r as ComboboxSeparatorProps, s as ComboboxSeparatorState, u as ComboboxSurfaceState } from '../separator-DzfgGPjS.cjs';
1
+ import { V as VirtualItem } from '../ListboxStore-B8oTpM57.cjs';
2
+ export { F as ComboboxFilterFn, I as ComboboxItemRegistration, b as ComboboxStore, L as ComboboxStoreContext, a as ComboboxStoreState } from '../ListboxStore-B8oTpM57.cjs';
3
+ import { P as PopupMenuDebugOptions, a as PopupMenuRootActions, b as PopupMenuArrow, c as PopupMenuBackdrop, d as PopupMenuPopup, e as PopupMenuPortal, f as PopupMenuScrollDownArrow, g as PopupMenuScrollUpArrow } from '../scroll-arrow-BBoKckL_.cjs';
4
+ export { h as ComboboxArrowProps, i as ComboboxBackdropProps, p as ComboboxListCssVars, j as ComboboxPopupProps, k as ComboboxPortalProps, q as ComboboxPositionerCssVars, l as ComboboxScrollArrowProps, m as ComboboxScrollArrowState, n as ComboboxScrollDownArrowProps, o as ComboboxScrollUpArrowProps } from '../scroll-arrow-BBoKckL_.cjs';
5
+ import { f as PopupMenuSurface, t as PopupMenuSurfaceProps, P as PopupMenuEmpty, a as PopupMenuGroup, b as PopupMenuGroupLabel, c as PopupMenuIcon, d as PopupMenuList, e as PopupMenuSeparator } from '../separator-NjsBVzek.cjs';
6
+ export { g as ComboboxEmptyProps, h as ComboboxEmptyState, i as ComboboxGroupLabelProps, j as ComboboxGroupLabelState, k as ComboboxGroupProps, l as ComboboxGroupState, m as ComboboxIconProps, n as ComboboxIconState, o as ComboboxListChildrenState, p as ComboboxListProps, q as ComboboxListState, r as ComboboxSeparatorProps, s as ComboboxSeparatorState, u as ComboboxSurfaceState } from '../separator-NjsBVzek.cjs';
7
7
  import * as React from 'react';
8
8
  import { C as ComponentProps } from '../types-DT4FOOa2.cjs';
9
9
  import { PopoverPositionerProps, Popover, PopoverRootProps } from '@base-ui/react/popover';
10
10
  import { I as ItemEqualityComparer, a as Items } from '../items-B6HeFO_8.cjs';
11
- import { C as ChangeEventDetails, t as triggerPress, e as escapeKey, o as outsidePress, f as focusOut, i as itemPress, aV as inputChange, aW as inputClear, l as listNavigation, g as imperativeAction, n as none, G as GenericEventDetails, p as pointer, k as keyboard } from '../events-DuKEM5sQ.cjs';
12
- export { S as SurfaceContextValue, u as useMaybeSurfaceContext, a as useSurfaceContext } from '../surface-context-r2eYfQth.cjs';
11
+ import { C as ChangeEventDetails, t as triggerPress, e as escapeKey, o as outsidePress, f as focusOut, i as itemPress, aW as inputChange, aX as inputClear, l as listNavigation, g as imperativeAction, n as none, G as GenericEventDetails, p as pointer, k as keyboard } from '../events-DVcrtGe3.cjs';
12
+ export { S as SurfaceContextValue, u as useMaybeSurfaceContext, a as useSurfaceContext } from '../surface-context-CN4Lb_6F.cjs';
13
13
  export { c as commandScore, d as defaultFilter } from '../command-score-CTJ9NV6n.cjs';
14
14
  import '@base-ui/utils/store';
15
15
 
@@ -1,15 +1,15 @@
1
- import { V as VirtualItem } from '../ListboxStore-DZ73dOaC.js';
2
- export { F as ComboboxFilterFn, I as ComboboxItemRegistration, b as ComboboxStore, L as ComboboxStoreContext, a as ComboboxStoreState } from '../ListboxStore-DZ73dOaC.js';
3
- import { P as PopupMenuDebugOptions, a as PopupMenuRootActions, b as PopupMenuArrow, c as PopupMenuBackdrop, d as PopupMenuPopup, e as PopupMenuPortal, f as PopupMenuScrollDownArrow, g as PopupMenuScrollUpArrow } from '../scroll-arrow-CxHg9cFW.js';
4
- export { h as ComboboxArrowProps, i as ComboboxBackdropProps, p as ComboboxListCssVars, j as ComboboxPopupProps, k as ComboboxPortalProps, q as ComboboxPositionerCssVars, l as ComboboxScrollArrowProps, m as ComboboxScrollArrowState, n as ComboboxScrollDownArrowProps, o as ComboboxScrollUpArrowProps } from '../scroll-arrow-CxHg9cFW.js';
5
- import { f as PopupMenuSurface, t as PopupMenuSurfaceProps, P as PopupMenuEmpty, a as PopupMenuGroup, b as PopupMenuGroupLabel, c as PopupMenuIcon, d as PopupMenuList, e as PopupMenuSeparator } from '../separator-DaXKN0QW.js';
6
- export { g as ComboboxEmptyProps, h as ComboboxEmptyState, i as ComboboxGroupLabelProps, j as ComboboxGroupLabelState, k as ComboboxGroupProps, l as ComboboxGroupState, m as ComboboxIconProps, n as ComboboxIconState, o as ComboboxListChildrenState, p as ComboboxListProps, q as ComboboxListState, r as ComboboxSeparatorProps, s as ComboboxSeparatorState, u as ComboboxSurfaceState } from '../separator-DaXKN0QW.js';
1
+ import { V as VirtualItem } from '../ListboxStore-CV5vPUUc.js';
2
+ export { F as ComboboxFilterFn, I as ComboboxItemRegistration, b as ComboboxStore, L as ComboboxStoreContext, a as ComboboxStoreState } from '../ListboxStore-CV5vPUUc.js';
3
+ import { P as PopupMenuDebugOptions, a as PopupMenuRootActions, b as PopupMenuArrow, c as PopupMenuBackdrop, d as PopupMenuPopup, e as PopupMenuPortal, f as PopupMenuScrollDownArrow, g as PopupMenuScrollUpArrow } from '../scroll-arrow-fl3B5sVO.js';
4
+ export { h as ComboboxArrowProps, i as ComboboxBackdropProps, p as ComboboxListCssVars, j as ComboboxPopupProps, k as ComboboxPortalProps, q as ComboboxPositionerCssVars, l as ComboboxScrollArrowProps, m as ComboboxScrollArrowState, n as ComboboxScrollDownArrowProps, o as ComboboxScrollUpArrowProps } from '../scroll-arrow-fl3B5sVO.js';
5
+ import { f as PopupMenuSurface, t as PopupMenuSurfaceProps, P as PopupMenuEmpty, a as PopupMenuGroup, b as PopupMenuGroupLabel, c as PopupMenuIcon, d as PopupMenuList, e as PopupMenuSeparator } from '../separator-Dn15rte3.js';
6
+ export { g as ComboboxEmptyProps, h as ComboboxEmptyState, i as ComboboxGroupLabelProps, j as ComboboxGroupLabelState, k as ComboboxGroupProps, l as ComboboxGroupState, m as ComboboxIconProps, n as ComboboxIconState, o as ComboboxListChildrenState, p as ComboboxListProps, q as ComboboxListState, r as ComboboxSeparatorProps, s as ComboboxSeparatorState, u as ComboboxSurfaceState } from '../separator-Dn15rte3.js';
7
7
  import * as React from 'react';
8
8
  import { C as ComponentProps } from '../types-DT4FOOa2.js';
9
9
  import { PopoverPositionerProps, Popover, PopoverRootProps } from '@base-ui/react/popover';
10
10
  import { I as ItemEqualityComparer, a as Items } from '../items-B6HeFO_8.js';
11
- import { C as ChangeEventDetails, t as triggerPress, e as escapeKey, o as outsidePress, f as focusOut, i as itemPress, aV as inputChange, aW as inputClear, l as listNavigation, g as imperativeAction, n as none, G as GenericEventDetails, p as pointer, k as keyboard } from '../events-D6K5-_aP.js';
12
- export { S as SurfaceContextValue, u as useMaybeSurfaceContext, a as useSurfaceContext } from '../surface-context-BMizU8oI.js';
11
+ import { C as ChangeEventDetails, t as triggerPress, e as escapeKey, o as outsidePress, f as focusOut, i as itemPress, aW as inputChange, aX as inputClear, l as listNavigation, g as imperativeAction, n as none, G as GenericEventDetails, p as pointer, k as keyboard } from '../events-BTHQ2OoH.js';
12
+ export { S as SurfaceContextValue, u as useMaybeSurfaceContext, a as useSurfaceContext } from '../surface-context-CGLDpMej.js';
13
13
  export { c as commandScore, d as defaultFilter } from '../command-score-CTJ9NV6n.js';
14
14
  import '@base-ui/utils/store';
15
15
 
@@ -1,2 +1,2 @@
1
- import{a as vo,b as Vo,c as Mo,d as Eo,e as Lo,f as te,g as wo}from"../chunk-KO3DXT3Y.js";import{K as io,L as po,M as Ct,O as mo,P as co,Q as bo,R as xo,S as N,T as F,U as fo,V as Co,X as go,a as ro,ba as gt,ca as ho,d as de,ea as Po,fa as Io,ga as Ro,q as ao,ra as So,s as so,t as lo,ua as yo,v as uo,w as D,x as ft}from"../chunk-NNGWBSWK.js";import{a as oe,p as mt,q as ct,w as bt,x as dt,y as xt}from"../chunk-A4Z5BY7H.js";import{a as pt}from"../chunk-4C666HHU.js";var zo={};pt(zo,{Arrow:()=>so,Backdrop:()=>lo,Clear:()=>Me,Empty:()=>Co,Group:()=>So,GroupLabel:()=>go,Icon:()=>fo,Input:()=>we,InputWrapper:()=>ke,Item:()=>Te,ItemIndicator:()=>He,ItemLabel:()=>Oe,List:()=>ho,Popup:()=>io,Portal:()=>po,Positioner:()=>De,Root:()=>Ae,ScrollDownArrow:()=>Io,ScrollUpArrow:()=>Po,Separator:()=>yo,Surface:()=>Fe,useComboboxPositionerContext:()=>Ee});import{useRender as ht}from"@base-ui/react/use-render";import*as _ from"react";var ko={slot:"bazzaui-combobox-clear"};var Me=_.forwardRef(function(e,o){let{keepMounted:i=!1,disabled:u,render:s,className:p,style:c,onClick:a,onPointerDown:t,...P}=e,m=D(),b=u??m.disabled,I=m.multiple?m.values.length>0:m.value!=="",d=_.useCallback(R=>{a?.(R),!R.defaultPrevented&&(m.multiple?m.onValuesChange([]):m.onValueChange(""),m.onInputValueChange(""))},[a,m]),g=_.useCallback(R=>{R.preventDefault(),t?.(R)},[t]),l=_.useMemo(()=>({hasValue:I,disabled:b}),[I,b]),S=ht({render:s,ref:o,state:l,props:{...P,[ko.slot]:"",type:"button",tabIndex:-1,"aria-label":"Clear selection",disabled:b||!I,className:p,style:c,onClick:d,onPointerDown:g},enabled:i||I,defaultTagName:"button"});return!i&&!I?null:S});import*as xe from"react";var fe=xe.createContext(null);function Ee(){return xe.useContext(fe)}import{useRender as Pt}from"@base-ui/react/use-render";import*as ne from"react";import*as Ce from"react";var Le=Ce.createContext(!1);function To(){return Ce.useContext(Le)}var Q={slot:"bazzaui-combobox-input",open:"data-open",closed:"data-closed",disabled:"data-disabled",placeholder:"data-placeholder"};import*as se from"react";function Ho(x){let{comboboxContext:e,open:o}=x,i=e.multiple?e.values.length>0:!xo(e.value),u=se.useCallback(c=>{let a=F(c,e.itemToStringValue),t=e.itemTextRegistry.get(a);if(t!==void 0)return t;let P=te(e.items,a);if(typeof P=="string")return P;let m=N(c,e.itemToStringLabel);if(m&&m!==a)return m},[e.itemTextRegistry,e.items,e.itemToStringLabel,e.itemToStringValue]),s=se.useMemo(()=>{if(!i)return"";if(e.multiple){let t=e.values.map(P=>{let m=u(P);return m!==void 0?m:N(P,e.itemToStringLabel)||F(P,e.itemToStringValue)}).filter(Boolean);return t.length<=2?t.join(", "):`${t.length} selected`}let c=e.value;if(c==null)return"";let a=u(c);return a!==void 0?a:N(c,e.itemToStringLabel)||F(c,e.itemToStringValue)},[i,e.multiple,e.value,e.values,e.itemToStringLabel,e.itemToStringValue,u]),p=se.useMemo(()=>o?e.inputValue:s,[o,s,e.inputValue]);return{hasValue:i,displayValue:p,selectedLabel:s,getValueText:u}}import*as T from"react";function Oo(x){let{comboboxContext:e,store:o,focusOwnerStore:i,open:u,disabled:s,cursorBehavior:p,hasValue:c,getValueText:a,onFocus:t,onBlur:P,onClick:m,onKeyDown:b}=x,I=T.useRef(!1),d=T.useRef(!1),g=T.useRef(!1),l=T.useRef(null),S=T.useRef(null),R=T.useRef(null);T.useEffect(()=>{if(!u)return;let n=f=>{let r=e.inputRef.current,v=e.inputWrapperRef.current,y=document.getElementById(e.listId),O=f.target,W=r?.contains(O),z=v?.contains(O),ee=y?.contains(O);!W&&!z&&!ee&&(R.current=f)};return document.addEventListener("pointerdown",n,!0),()=>{document.removeEventListener("pointerdown",n,!0),R.current=null}},[u,e.inputRef,e.inputWrapperRef,e.listId]),T.useLayoutEffect(()=>{let n=e.inputRef.current;if(n&&u&&S.current){let{start:f,end:r}=S.current,v=n.selectionStart,y=n.value.length;v===y&&f!==y&&n.setSelectionRange(f,r),S.current=null}});let L=T.useRef(u);T.useLayoutEffect(()=>{if(u&&!L.current){if(I.current){I.current=!1,L.current=u;return}if(g.current){g.current=!1,d.current=!1,l.current=null,L.current=u;return}if(d.current&&p==="none"){let f=e.inputRef.current,r=l.current;f&&r!==null&&requestAnimationFrame(()=>{let v=f.value.length,y=Math.min(r,v);f.setSelectionRange(y,y)}),d.current=!1,l.current=null,L.current=u;return}c&&e.multiple&&e.onInputValueChange("");let n=e.inputRef.current;if(n){let f=n.value.length;p==="select-all"&&f>0?requestAnimationFrame(()=>{n.setSelectionRange(0,n.value.length)}):p==="end"&&f>0&&requestAnimationFrame(()=>{n.setSelectionRange(n.value.length,n.value.length)})}}L.current=u},[u,e,c,p]);let w=T.useCallback(n=>{let f=n.target,r=f.value,v=f.selectionStart,y=f.selectionEnd;v!==null&&y!==null&&(S.current={start:v,end:y}),e.onInputValueChange(r),e.setFilterActive(),o.setSearch(r),o.state.open||(I.current=!0,e.openCombobox())},[e,o]),k=T.useCallback(n=>{if(t?.(n),n.defaultPrevented)return;let f=o.state.open;if(f&&(g.current=!0),e.openOnFocus&&!s&&!f){if(c&&!e.multiple){let r=a(e.value)??N(e.value,e.itemToStringLabel);e.onInputValueChange(r)}e.openCombobox()}},[t,e,s,o,c,a]),V=T.useCallback(n=>{P?.(n),!n.defaultPrevented&&requestAnimationFrame(()=>{let f=document.activeElement,v=document.getElementById(e.listId)?.contains(f),y=f===e.inputRef.current;if(!v&&!y){g.current=!1;let O=R.current,W=O?oe.outsidePress:oe.focusOut;R.current=null,e.closeCombobox(W,O??void 0)}})},[P,e]),A=T.useCallback(n=>{if(m?.(n),n.defaultPrevented)return;let f=o.state.open;if(!s&&!f){let r=n.target;if(p==="none"){let v=r.selectionStart;l.current=v,d.current=!0}if(c&&!e.multiple){let v=a(e.value)??N(e.value,e.itemToStringLabel);e.onInputValueChange(v)}e.openCombobox()}else f&&(g.current=!0)},[m,e,s,o,p,c,a]),K=T.useCallback(n=>{if(b?.(n),!n.defaultPrevented){if(u&&n.key==="Escape"){n.preventDefault(),e.closeCombobox(oe.escapeKey);return}if(!u&&(n.key==="ArrowDown"||n.key==="ArrowUp"||n.key==="Enter")){if(n.preventDefault(),c&&!e.multiple){let f=a(e.value)??N(e.value,e.itemToStringLabel);e.onInputValueChange(f)}e.openCombobox();return}}},[u,e,b,c,a]),{handleKeyDown:j}=bo({store:o,surfaceId:"combobox-input",focusOwnerStore:i,depth:0,submenuContext:null,subpageContext:null,enabled:u,enableTypeToSearch:!1,onKeyDown:K,closeAll:e.closeCombobox,skipFocusOwnerCheck:!0});return{handleChange:w,handleFocus:k,handleBlur:V,handleClick:A,handleKeyDown:j,selectionRef:S}}var we=ne.forwardRef(function(e,o){let{placeholder:i,disabled:u,cursorBehavior:s="none",render:p,className:c,style:a,onFocus:t,onBlur:P,onClick:m,onKeyDown:b,...I}=e,d=D(),g=de(),l=ro(),S=To(),R=(u??d.disabled)||g.disabled,L=te(d.items,""),w=i??(typeof L=="string"?L:void 0)??d.placeholder,k=g.store.useState("open"),{hasValue:V,displayValue:A,getValueText:K}=Ho({comboboxContext:d,open:k}),{handleChange:j,handleFocus:n,handleBlur:f,handleClick:r,handleKeyDown:v}=Oo({comboboxContext:d,store:g.store,focusOwnerStore:l,open:k,disabled:R,cursorBehavior:s,hasValue:V,getValueText:K,onFocus:t,onBlur:P,onClick:m,onKeyDown:b}),y={[Q.slot]:""};k?y[Q.open]="":y[Q.closed]="",R&&(y[Q.disabled]=""),V||(y[Q.placeholder]=""),d.layout==="input-embedded"&&(y["data-input-embedded"]="");let O=ne.useCallback(M=>{d.setInputElement(M),typeof o=="function"?o(M):o&&(o.current=M)},[o,d]),W=ne.useMemo(()=>({open:k,disabled:R,placeholder:!V}),[k,R,V]),z=d.layout==="input-embedded"&&!S?{position:"relative",zIndex:1}:void 0;return Pt({render:p,ref:O,state:W,props:{...I,...y,type:"text",role:"combobox","aria-autocomplete":"list","aria-expanded":k,"aria-controls":d.listId,"aria-haspopup":"listbox",autoComplete:"off",autoCorrect:"off",spellCheck:!1,disabled:R,placeholder:V?void 0:w,className:c,style:{...z,...a},value:A,onChange:j,onFocus:n,onBlur:f,onClick:r,onKeyDown:v},defaultTagName:"input"})});import{useRender as It}from"@base-ui/react/use-render";import*as re from"react";var ge={slot:"bazzaui-combobox-input-wrapper",open:"data-open"};import{jsx as St}from"react/jsx-runtime";var Rt={open:x=>x?{[ge.open]:""}:null},ke=re.forwardRef(function(e,o){let{render:i,className:u,style:s,children:p,...c}=e,{store:a}=de(),t=D(),P=a.useState("open"),m=re.useMemo(()=>({open:P}),[P]),b=t.layout==="input-embedded"?{position:"relative",zIndex:1}:{position:"relative"},I=re.useCallback(g=>{t.setInputWrapperElement(g),typeof o=="function"?o(g):o&&(o.current=g)},[o,t]),d=It({render:i,ref:I,state:m,stateAttributesMapping:Rt,props:{...c,[ge.slot]:"",className:u,style:{...b,...s},children:p},defaultTagName:"div"});return St(Le.Provider,{value:!0,children:d})});import{useRender as vt}from"@base-ui/react/use-render";import*as E from"react";var q={slot:"bazzaui-combobox-item",highlighted:"data-highlighted",disabled:"data-disabled",selected:"data-selected",first:"data-first",last:"data-last",firstInGroup:"data-first-in-group",lastInGroup:"data-last-in-group"};import*as le from"react";var he=le.createContext(null);function ue(){let x=le.useContext(he);if(!x)throw new Error("ComboboxItem child components must be used within a Combobox.Item");return x}function yt(){return le.useContext(he)}import{jsx as Et}from"react/jsx-runtime";var Vt={highlighted:x=>x?{[q.highlighted]:""}:null,disabled:x=>x?{[q.disabled]:""}:null,selected:x=>x?{[q.selected]:""}:null,first:x=>x?{[q.first]:""}:null,last:x=>x?{[q.last]:""}:null,firstInGroup:x=>x?{[q.firstInGroup]:""}:null,lastInGroup:x=>x?{[q.lastInGroup]:""}:null};function Mt(x,e){let{value:o,textValue:i,keywords:u,disabled:s=!1,onSelect:p,forceMount:c=!1,render:a,className:t,style:P,onClick:m,onPointerDown:b,onPointerMove:I,children:d,...g}=x,l=D(),S=E.useMemo(()=>F(o,l.itemToStringValue),[o,l.itemToStringValue]),R=E.useId(),L=o===null?`combobox-clear-${R}`:void 0,w=E.useMemo(()=>Lo(l.items,S),[l.items,S]),k=w?.label,V=E.useMemo(()=>N(o,l.itemToStringLabel),[o,l.itemToStringLabel]),A=E.useMemo(()=>{if(i!==void 0)return i;if(typeof k=="string")return k;if(V&&V!==S)return V},[i,k,V,S]),K=E.useMemo(()=>wo(u,[typeof k=="string"?k:V&&V!==S?V:void 0,...w?.keywords??[]]),[u,k,V,S,w]),j=E.useRef(A),n=l.multiple?Mo(l.values,o,l.isItemEqualToValue):l.value!==""&&Vo(l.value,o,l.isItemEqualToValue),f=l.closeOnSelect,r=co({id:L,value:S,keywords:K,disabled:s,forceMount:c,closeOnClick:f,children:d});E.useEffect(()=>{let M=()=>{if(!s){if(l.multiple)if(o==null)l.onValuesChange([]);else{let me=n?Eo(l.values,o,l.isItemEqualToValue):[...l.values,o];l.onValuesChange(me)}else l.onValueChange(o);p?.()}};return r.registerSelect(M)},[s,l,o,n,p,r]),E.useEffect(()=>{let M=j.current;if(M)return l.registerItemText(S,M)},[S,l]),E.useEffect(()=>{!A&&typeof d=="string"&&(j.current=d,l.registerItemText(S,d))},[d,A,S,l]);let v=E.useMemo(()=>({highlighted:r.isHighlighted,disabled:s,selected:n,first:r.positional.first,last:r.positional.last,firstInGroup:r.positional.firstInGroup,lastInGroup:r.positional.lastInGroup}),[r.isHighlighted,s,n,r.positional]),y=E.useMemo(()=>({id:r.id,value:o,textValue:A,highlighted:r.isHighlighted,disabled:s,selected:n}),[r.id,o,A,r.isHighlighted,s,n]),O=E.useCallback(M=>{m?.(M),M.defaultPrevented||r.handlers.onClick(M)},[m,r.handlers]),W=E.useCallback(M=>{r.handlers.onPointerDown(M),b?.(M)},[r.handlers,b]),z=E.useCallback(M=>{I?.(M),M.defaultPrevented||r.handlers.onPointerMove(M)},[I,r.handlers]),ee=vt({render:a,ref:[r.ref,r.rowRef,e],state:v,stateAttributesMapping:Vt,props:{...g,[q.slot]:"",id:r.id,role:"option",tabIndex:-1,"aria-selected":n,"aria-disabled":s||void 0,className:t,style:P,onClick:O,onPointerMove:z,onPointerDown:W,children:d},enabled:r.isVisible,defaultTagName:"div"});return r.isVisible?Et(he.Provider,{value:y,children:ee}):null}var Te=E.forwardRef(Mt);import{useRender as Lt}from"@base-ui/react/use-render";import*as Ie from"react";var Pe={slot:"bazzaui-combobox-item-indicator",selected:"data-selected"};var wt={selected:x=>x?{[Pe.selected]:""}:null},He=Ie.forwardRef(function(e,o){let{keepMounted:i=!1,render:u,className:s,style:p,...c}=e,a=ue(),t=Ie.useMemo(()=>({selected:a.selected}),[a.selected]),P=Lt({render:u,ref:o,state:t,stateAttributesMapping:wt,props:{...c,[Pe.slot]:"","aria-hidden":!0,className:s,style:p},enabled:i||a.selected,defaultTagName:"span"});return!i&&!a.selected?null:P});import{useRender as kt}from"@base-ui/react/use-render";import*as Y from"react";var Do={slot:"bazzaui-combobox-item-label"};var Oe=Y.forwardRef(function(e,o){let{render:i,className:u,style:s,children:p,...c}=e,a=D(),t=ue(),P=F(t.value,a.itemToStringValue),m=Y.useMemo(()=>{if(p!==void 0)return p;let I=te(a.items,P);return I!==void 0?I:t.textValue!==void 0?t.textValue:P},[p,a.items,P,t.textValue]),b=Y.useMemo(()=>({value:P,selected:t.selected,highlighted:t.highlighted,disabled:t.disabled}),[P,t.selected,t.highlighted,t.disabled]);return Y.useEffect(()=>{if(typeof m=="string")return a.registerItemText(P,m)},[m,a,P]),kt({render:i,ref:o,state:b,props:{...c,[Do.slot]:"",className:u,style:s,children:m},defaultTagName:"span"})});import{Popover as Ao}from"@base-ui/react/popover";import*as U from"react";var Re={slot:"bazzaui-combobox-positioner"};import{jsx as ie}from"react/jsx-runtime";function Tt(x,e,o,i){let u=o+i*2;if(x==="top"){let c=-(e+i),a=e+i;return{width:u,marginBottom:c,paddingTop:i,paddingLeft:i,paddingRight:i,paddingBottom:a}}let s=-(e+i),p=e+i;return{width:u,marginTop:s,paddingTop:p,paddingLeft:i,paddingRight:i,paddingBottom:i}}var De=U.forwardRef(function(e,o){let{layout:i,popupPadding:u=8,side:s="bottom",align:p,sideOffset:c=4,anchor:a,className:t,style:P,children:m,...b}=e,I=D(),d=i??I.layout,g=d==="input-embedded",l=a??I.inputWrapperRef.current?I.inputWrapperRef:I.inputRef,S=g?0:c,R=g?"center":p??"start",{inputHeight:L,inputWidth:w}=I,k=w+u*2,V={...P,...g?{zIndex:0}:{}};if(g)return ie(Ao.Positioner,{ref:o,side:s,align:R,sideOffset:S,anchor:l,className:t,style:V,"data-input-embedded":"",[Re.slot]:"",...b,render:(n,f)=>{let r=f.side,v={layout:d,side:r,align:f.align,inputHeight:I.inputHeight},y={"--combobox-input-height":`${L}px`,"--combobox-input-width":`${w}px`,"--combobox-popup-padding":`${u}px`,"--combobox-popup-width":`${k}px`},O=Tt(r,L,w,u),W=U.Children.map(m,z=>U.isValidElement(z)?U.cloneElement(z,{style:{...O,...z.props.style},"data-side":r}):z);return ie(fe.Provider,{value:v,children:ie("div",{...n,style:{...n.style,...y},"data-side":r,children:W})})}});let A={layout:d,side:s,align:R,inputHeight:I.inputHeight},K={"--combobox-input-height":`${L}px`,"--combobox-input-width":`${w}px`},j={...V,...K};return ie(fe.Provider,{value:A,children:ie(Ao.Positioner,{ref:o,side:s,align:R,sideOffset:S,anchor:l,className:t,style:j,[Re.slot]:"",...b,children:m})})});import{Popover as Ht}from"@base-ui/react/popover";import*as h from"react";import{jsx as pe,jsxs as Ot}from"react/jsx-runtime";function Ae(x){let{open:e,onOpenChange:o,actionsRef:i,defaultOpen:u=!1,value:s,defaultValue:p,onValueChange:c,multiple:a=!1,values:t,defaultValues:P,onValuesChange:m,isItemEqualToValue:b=vo,itemToStringLabel:I,itemToStringValue:d,inputValue:g,defaultInputValue:l="",onInputValueChange:S,name:R,form:L,required:w,disabled:k=!1,placeholder:V="Search...",items:A,modal:K=!1,closeOnSelect:j,openOnFocus:n=!0,virtualized:f=!1,virtualItems:r,onHighlightChange:v,layout:y="floating",onOpenChangeComplete:O,debug:W,children:z,...ee}=x,M=h.useCallback((C,H,G,be)=>v?.(C,G,be),[v]),me=h.useId(),ce=h.useRef(null),Se=h.useRef(null),[ze,Be]=h.useState(0),[We,je]=h.useState(0),Ge=h.useCallback(C=>{if(ce.current=C,C&&!Se.current){let H=C.getBoundingClientRect();Be(H.height),je(H.width)}},[]),Ne=h.useCallback(C=>{if(Se.current=C,C){let H=C.getBoundingClientRect();Be(H.height),je(H.width)}},[]),{store:B,focusOwnerStore:$o,openChainStore:Jo,registerSurface:Xo,closeAll:_o,virtualization:Qo,handleOpenChange:qe,disabled:$,setDisabled:Ke,menuTreeResolver:Yo}=ao({onOpenChange:o,defaultOpen:u,virtualized:f,items:r,onHighlightChange:M,disabled:k}),ye=h.useRef(null);h.useImperativeHandle(i,()=>({close:()=>{ye.current?.close()},unmount:()=>{ye.current?.unmount()},setDisabled:Ke}),[Ke]),B.useControlledProp("openProp",e);let Zo=B.useState("open"),Ue=h.useCallback((C,H,G)=>{$&&H!==oe.imperativeAction||!C&&ce.current&&document.activeElement===ce.current||qe(C,H,G)},[qe,$]),et=h.useCallback(C=>{!C&&B.context.clearSearchOnClose==="after-exit"&&(B.clearSearch(),B.setInputActive(!1)),C||B.clearHighlight(),O?.(C)},[B,O]),ot=h.useCallback((C,H)=>{Ue(C,H.reason,H.event)},[Ue]),[tt,nt]=h.useState(p!==void 0?p:null),J=s!==void 0?s:tt,$e=h.useCallback(C=>{s===void 0&&nt(C),c?.(C)},[s,c]),[rt,at]=h.useState(P??[]),ae=t!==void 0?t:rt,Je=h.useCallback(C=>{t===void 0&&at(C),m?.(C)},[t,m]),[ve,st]=h.useState(l),Xe=g!==void 0?g:ve,_e=h.useCallback(C=>{g===void 0&&st(C),S?.(C)},[g,S]),Qe=h.useRef(new Map),Ye=h.useCallback((C,H)=>(Qe.current.set(C,H),()=>{}),[]),Ze=j??!a,Ve=h.useRef({type:"active"}),[,lt]=h.useState({type:"active"}),X=h.useCallback(C=>{Ve.current=C,lt(C)},[]),eo=Ve.current,oo=h.useCallback(()=>{X({type:"active"})},[X]),to=h.useCallback(()=>{$||(!a&&J!=null?X({type:"showAll"}):X({type:"active"}),B.setOpen(!0))},[$,B,a,J,X]),no=h.useCallback((C,H)=>{let G=Ve.current,be=G.type==="active"?ve:G.type==="showAll"?"":G.search;X({type:"frozen",search:be}),B.setOpen(!1,C,H)},[B,X,ve]),ut=h.useMemo(()=>({multiple:a,value:J,values:ae,onValueChange:$e,onValuesChange:Je,isItemEqualToValue:b,itemToStringLabel:I,itemToStringValue:d,inputValue:Xe,onInputValueChange:_e,name:R,form:L,required:w,disabled:$,placeholder:V,items:A,itemTextRegistry:Qe.current,registerItemText:Ye,listId:me,inputRef:ce,setInputElement:Ge,inputWrapperRef:Se,setInputWrapperElement:Ne,closeOnSelect:Ze,openOnFocus:n,openCombobox:to,closeCombobox:no,filterMode:eo,setFilterActive:oo,inputHeight:ze,inputWidth:We,layout:y}),[a,J,ae,$e,Je,b,I,d,Xe,_e,R,L,w,$,V,A,Ye,me,Ge,Ne,Ze,n,to,no,eo,oo,ze,We,y]),it=h.useMemo(()=>R?a?ae.length>0?ae.map((C,H)=>{let G=F(C,d);return pe("input",{type:"hidden",name:R,value:G,form:L,required:w&&H===0},G)}):pe("input",{type:"hidden",name:R,value:"",form:L,required:w}):pe("input",{type:"hidden",name:R,value:J!=null?F(J,d):"",form:L,required:w}):null,[R,L,w,a,J,ae,d]);return pe(uo.Provider,{value:ut,children:Ot(mo,{menuTreeResolver:Yo,store:B,focusOwnerStore:$o,openChainStore:Jo,disabled:$,depth:0,closeAll:_o,registerSurface:Xo,virtualization:Qo,menuType:"dropdown",componentName:"combobox",debug:W,children:[it,pe(Ht.Root,{...ee,open:Zo,onOpenChange:ot,onOpenChangeComplete:et,modal:K,actionsRef:i?ye:void 0,children:z})]})})}import*as Z from"react";var Fo={slot:"bazzaui-combobox-surface"};import{jsx as Dt}from"react/jsx-runtime";var Fe=Z.forwardRef(function(e,o){let{autoHighlightFirst:i,clearSearchOnClose:u=!0,search:s,onSearchChange:p,onPointerMove:c,...a}=e,t=D(),P=Z.useCallback(g=>{c?.(g);let l=t.inputRef.current;l&&document.activeElement!==l&&l.focus()},[c,t.inputRef]),m=Z.useMemo(()=>{let g=i??!0;if(g==="selected"){let l=t.multiple?t.values[0]:t.value;return l!=null?F(l,t.itemToStringValue):!0}return g},[i,t.multiple,t.value,t.values,t.itemToStringValue]),{filterMode:b}=t,I=s??(b.type==="active"?t.inputValue:b.type==="showAll"?"":b.search),d=Z.useCallback(g=>{t.onInputValueChange(g),p?.(g)},[t,p]);return Dt(Ro,{ref:o,autoHighlightFirst:m,clearSearchOnClose:u,search:I,onSearchChange:d,onPointerMove:P,skipAutoFocus:!0,[Fo.slot]:"",...a})});var Bo=(p=>(p.slot="bazzaui-combobox-arrow",p.open="data-open",p.closed="data-closed",p.side="data-side",p.align="data-align",p.uncentered="data-uncentered",p))(Bo||{});var Wo=(s=>(s.slot="bazzaui-combobox-backdrop",s.open="data-open",s.closed="data-closed",s.startingStyle="data-starting-style",s.endingStyle="data-ending-style",s))(Wo||{});var jo=(e=>(e.slot="bazzaui-combobox-empty",e))(jo||{});var Go=(e=>(e.slot="bazzaui-combobox-group",e))(Go||{});var No=(e=>(e.slot="bazzaui-combobox-group-label",e))(No||{});var At={slot:"bazzaui-combobox-icon",open:"data-popup-open"};var qo=(o=>(o.slot="bazzaui-combobox-list",o.list="data-popup-menu-list",o))(qo||{});var Ko=(b=>(b.slot="bazzaui-combobox-popup",b.open="data-open",b.closed="data-closed",b.side="data-side",b.align="data-align",b.startingStyle="data-starting-style",b.endingStyle="data-ending-style",b.instant="data-instant",b.focused="data-focused",b.hasOpenSubmenu="data-has-open-submenu",b.submenu="data-submenu",b.navigating="data-navigating",b))(Ko||{});var Ft={slotUp:"bazzaui-combobox-scroll-up-arrow",slotDown:"bazzaui-combobox-scroll-down-arrow",direction:"data-direction",side:"data-side"};var Uo=(e=>(e.slot="bazzaui-combobox-separator",e))(Uo||{});export{zo as Combobox,Bo as ComboboxArrowDataAttributes,Wo as ComboboxBackdropDataAttributes,Me as ComboboxClear,jo as ComboboxEmptyDataAttributes,Go as ComboboxGroupDataAttributes,No as ComboboxGroupLabelDataAttributes,At as ComboboxIconDataAttributes,we as ComboboxInput,Q as ComboboxInputDataAttributes,ke as ComboboxInputWrapper,ge as ComboboxInputWrapperDataAttributes,Te as ComboboxItem,q as ComboboxItemDataAttributes,He as ComboboxItemIndicator,Pe as ComboboxItemIndicatorDataAttributes,Oe as ComboboxItemLabel,gt as ComboboxListCssVars,qo as ComboboxListDataAttributes,Ko as ComboboxPopupDataAttributes,De as ComboboxPositioner,Ct as ComboboxPositionerCssVars,Re as ComboboxPositionerDataAttributes,Ae as ComboboxRoot,Ft as ComboboxScrollArrowDataAttributes,Uo as ComboboxSeparatorDataAttributes,xt as ComboboxStore,Fe as ComboboxSurface,bt as commandScore,dt as defaultFilter,D as useComboboxContext,ue as useComboboxItemContext,Ee as useComboboxPositionerContext,ft as useMaybeComboboxContext,yt as useMaybeComboboxItemContext,ct as useMaybeSurfaceContext,mt as useSurfaceContext};
1
+ import{a as vo,b as Vo,c as Mo,d as Eo,e as Lo,f as te,g as wo}from"../chunk-KO3DXT3Y.js";import{K as io,L as po,M as Ct,O as mo,P as co,Q as bo,R as xo,S as N,T as F,U as fo,V as Co,X as go,a as ro,ba as gt,ca as ho,d as de,ea as Po,fa as Io,ga as Ro,q as ao,ra as So,s as so,t as lo,ua as yo,v as uo,w as D,x as ft}from"../chunk-EDZTZHQ4.js";import{a as oe,p as mt,q as ct,w as bt,x as dt,y as xt}from"../chunk-A4Z5BY7H.js";import{a as pt}from"../chunk-4C666HHU.js";var zo={};pt(zo,{Arrow:()=>so,Backdrop:()=>lo,Clear:()=>Me,Empty:()=>Co,Group:()=>So,GroupLabel:()=>go,Icon:()=>fo,Input:()=>we,InputWrapper:()=>ke,Item:()=>Te,ItemIndicator:()=>He,ItemLabel:()=>Oe,List:()=>ho,Popup:()=>io,Portal:()=>po,Positioner:()=>De,Root:()=>Ae,ScrollDownArrow:()=>Io,ScrollUpArrow:()=>Po,Separator:()=>yo,Surface:()=>Fe,useComboboxPositionerContext:()=>Ee});import{useRender as ht}from"@base-ui/react/use-render";import*as _ from"react";var ko={slot:"bazzaui-combobox-clear"};var Me=_.forwardRef(function(e,o){let{keepMounted:i=!1,disabled:u,render:s,className:p,style:c,onClick:a,onPointerDown:t,...P}=e,m=D(),b=u??m.disabled,I=m.multiple?m.values.length>0:m.value!=="",d=_.useCallback(R=>{a?.(R),!R.defaultPrevented&&(m.multiple?m.onValuesChange([]):m.onValueChange(""),m.onInputValueChange(""))},[a,m]),g=_.useCallback(R=>{R.preventDefault(),t?.(R)},[t]),l=_.useMemo(()=>({hasValue:I,disabled:b}),[I,b]),S=ht({render:s,ref:o,state:l,props:{...P,[ko.slot]:"",type:"button",tabIndex:-1,"aria-label":"Clear selection",disabled:b||!I,className:p,style:c,onClick:d,onPointerDown:g},enabled:i||I,defaultTagName:"button"});return!i&&!I?null:S});import*as xe from"react";var fe=xe.createContext(null);function Ee(){return xe.useContext(fe)}import{useRender as Pt}from"@base-ui/react/use-render";import*as ne from"react";import*as Ce from"react";var Le=Ce.createContext(!1);function To(){return Ce.useContext(Le)}var Q={slot:"bazzaui-combobox-input",open:"data-open",closed:"data-closed",disabled:"data-disabled",placeholder:"data-placeholder"};import*as se from"react";function Ho(x){let{comboboxContext:e,open:o}=x,i=e.multiple?e.values.length>0:!xo(e.value),u=se.useCallback(c=>{let a=F(c,e.itemToStringValue),t=e.itemTextRegistry.get(a);if(t!==void 0)return t;let P=te(e.items,a);if(typeof P=="string")return P;let m=N(c,e.itemToStringLabel);if(m&&m!==a)return m},[e.itemTextRegistry,e.items,e.itemToStringLabel,e.itemToStringValue]),s=se.useMemo(()=>{if(!i)return"";if(e.multiple){let t=e.values.map(P=>{let m=u(P);return m!==void 0?m:N(P,e.itemToStringLabel)||F(P,e.itemToStringValue)}).filter(Boolean);return t.length<=2?t.join(", "):`${t.length} selected`}let c=e.value;if(c==null)return"";let a=u(c);return a!==void 0?a:N(c,e.itemToStringLabel)||F(c,e.itemToStringValue)},[i,e.multiple,e.value,e.values,e.itemToStringLabel,e.itemToStringValue,u]),p=se.useMemo(()=>o?e.inputValue:s,[o,s,e.inputValue]);return{hasValue:i,displayValue:p,selectedLabel:s,getValueText:u}}import*as T from"react";function Oo(x){let{comboboxContext:e,store:o,focusOwnerStore:i,open:u,disabled:s,cursorBehavior:p,hasValue:c,getValueText:a,onFocus:t,onBlur:P,onClick:m,onKeyDown:b}=x,I=T.useRef(!1),d=T.useRef(!1),g=T.useRef(!1),l=T.useRef(null),S=T.useRef(null),R=T.useRef(null);T.useEffect(()=>{if(!u)return;let n=f=>{let r=e.inputRef.current,v=e.inputWrapperRef.current,y=document.getElementById(e.listId),O=f.target,W=r?.contains(O),z=v?.contains(O),ee=y?.contains(O);!W&&!z&&!ee&&(R.current=f)};return document.addEventListener("pointerdown",n,!0),()=>{document.removeEventListener("pointerdown",n,!0),R.current=null}},[u,e.inputRef,e.inputWrapperRef,e.listId]),T.useLayoutEffect(()=>{let n=e.inputRef.current;if(n&&u&&S.current){let{start:f,end:r}=S.current,v=n.selectionStart,y=n.value.length;v===y&&f!==y&&n.setSelectionRange(f,r),S.current=null}});let L=T.useRef(u);T.useLayoutEffect(()=>{if(u&&!L.current){if(I.current){I.current=!1,L.current=u;return}if(g.current){g.current=!1,d.current=!1,l.current=null,L.current=u;return}if(d.current&&p==="none"){let f=e.inputRef.current,r=l.current;f&&r!==null&&requestAnimationFrame(()=>{let v=f.value.length,y=Math.min(r,v);f.setSelectionRange(y,y)}),d.current=!1,l.current=null,L.current=u;return}c&&e.multiple&&e.onInputValueChange("");let n=e.inputRef.current;if(n){let f=n.value.length;p==="select-all"&&f>0?requestAnimationFrame(()=>{n.setSelectionRange(0,n.value.length)}):p==="end"&&f>0&&requestAnimationFrame(()=>{n.setSelectionRange(n.value.length,n.value.length)})}}L.current=u},[u,e,c,p]);let w=T.useCallback(n=>{let f=n.target,r=f.value,v=f.selectionStart,y=f.selectionEnd;v!==null&&y!==null&&(S.current={start:v,end:y}),e.onInputValueChange(r),e.setFilterActive(),o.setSearch(r),o.state.open||(I.current=!0,e.openCombobox())},[e,o]),k=T.useCallback(n=>{if(t?.(n),n.defaultPrevented)return;let f=o.state.open;if(f&&(g.current=!0),e.openOnFocus&&!s&&!f){if(c&&!e.multiple){let r=a(e.value)??N(e.value,e.itemToStringLabel);e.onInputValueChange(r)}e.openCombobox()}},[t,e,s,o,c,a]),V=T.useCallback(n=>{P?.(n),!n.defaultPrevented&&requestAnimationFrame(()=>{let f=document.activeElement,v=document.getElementById(e.listId)?.contains(f),y=f===e.inputRef.current;if(!v&&!y){g.current=!1;let O=R.current,W=O?oe.outsidePress:oe.focusOut;R.current=null,e.closeCombobox(W,O??void 0)}})},[P,e]),A=T.useCallback(n=>{if(m?.(n),n.defaultPrevented)return;let f=o.state.open;if(!s&&!f){let r=n.target;if(p==="none"){let v=r.selectionStart;l.current=v,d.current=!0}if(c&&!e.multiple){let v=a(e.value)??N(e.value,e.itemToStringLabel);e.onInputValueChange(v)}e.openCombobox()}else f&&(g.current=!0)},[m,e,s,o,p,c,a]),K=T.useCallback(n=>{if(b?.(n),!n.defaultPrevented){if(u&&n.key==="Escape"){n.preventDefault(),e.closeCombobox(oe.escapeKey);return}if(!u&&(n.key==="ArrowDown"||n.key==="ArrowUp"||n.key==="Enter")){if(n.preventDefault(),c&&!e.multiple){let f=a(e.value)??N(e.value,e.itemToStringLabel);e.onInputValueChange(f)}e.openCombobox();return}}},[u,e,b,c,a]),{handleKeyDown:j}=bo({store:o,surfaceId:"combobox-input",focusOwnerStore:i,depth:0,submenuContext:null,subpageContext:null,enabled:u,enableTypeToSearch:!1,onKeyDown:K,closeAll:e.closeCombobox,skipFocusOwnerCheck:!0});return{handleChange:w,handleFocus:k,handleBlur:V,handleClick:A,handleKeyDown:j,selectionRef:S}}var we=ne.forwardRef(function(e,o){let{placeholder:i,disabled:u,cursorBehavior:s="none",render:p,className:c,style:a,onFocus:t,onBlur:P,onClick:m,onKeyDown:b,...I}=e,d=D(),g=de(),l=ro(),S=To(),R=(u??d.disabled)||g.disabled,L=te(d.items,""),w=i??(typeof L=="string"?L:void 0)??d.placeholder,k=g.store.useState("open"),{hasValue:V,displayValue:A,getValueText:K}=Ho({comboboxContext:d,open:k}),{handleChange:j,handleFocus:n,handleBlur:f,handleClick:r,handleKeyDown:v}=Oo({comboboxContext:d,store:g.store,focusOwnerStore:l,open:k,disabled:R,cursorBehavior:s,hasValue:V,getValueText:K,onFocus:t,onBlur:P,onClick:m,onKeyDown:b}),y={[Q.slot]:""};k?y[Q.open]="":y[Q.closed]="",R&&(y[Q.disabled]=""),V||(y[Q.placeholder]=""),d.layout==="input-embedded"&&(y["data-input-embedded"]="");let O=ne.useCallback(M=>{d.setInputElement(M),typeof o=="function"?o(M):o&&(o.current=M)},[o,d]),W=ne.useMemo(()=>({open:k,disabled:R,placeholder:!V}),[k,R,V]),z=d.layout==="input-embedded"&&!S?{position:"relative",zIndex:1}:void 0;return Pt({render:p,ref:O,state:W,props:{...I,...y,type:"text",role:"combobox","aria-autocomplete":"list","aria-expanded":k,"aria-controls":d.listId,"aria-haspopup":"listbox",autoComplete:"off",autoCorrect:"off",spellCheck:!1,disabled:R,placeholder:V?void 0:w,className:c,style:{...z,...a},value:A,onChange:j,onFocus:n,onBlur:f,onClick:r,onKeyDown:v},defaultTagName:"input"})});import{useRender as It}from"@base-ui/react/use-render";import*as re from"react";var ge={slot:"bazzaui-combobox-input-wrapper",open:"data-open"};import{jsx as St}from"react/jsx-runtime";var Rt={open:x=>x?{[ge.open]:""}:null},ke=re.forwardRef(function(e,o){let{render:i,className:u,style:s,children:p,...c}=e,{store:a}=de(),t=D(),P=a.useState("open"),m=re.useMemo(()=>({open:P}),[P]),b=t.layout==="input-embedded"?{position:"relative",zIndex:1}:{position:"relative"},I=re.useCallback(g=>{t.setInputWrapperElement(g),typeof o=="function"?o(g):o&&(o.current=g)},[o,t]),d=It({render:i,ref:I,state:m,stateAttributesMapping:Rt,props:{...c,[ge.slot]:"",className:u,style:{...b,...s},children:p},defaultTagName:"div"});return St(Le.Provider,{value:!0,children:d})});import{useRender as vt}from"@base-ui/react/use-render";import*as E from"react";var q={slot:"bazzaui-combobox-item",highlighted:"data-highlighted",disabled:"data-disabled",selected:"data-selected",first:"data-first",last:"data-last",firstInGroup:"data-first-in-group",lastInGroup:"data-last-in-group"};import*as le from"react";var he=le.createContext(null);function ue(){let x=le.useContext(he);if(!x)throw new Error("ComboboxItem child components must be used within a Combobox.Item");return x}function yt(){return le.useContext(he)}import{jsx as Et}from"react/jsx-runtime";var Vt={highlighted:x=>x?{[q.highlighted]:""}:null,disabled:x=>x?{[q.disabled]:""}:null,selected:x=>x?{[q.selected]:""}:null,first:x=>x?{[q.first]:""}:null,last:x=>x?{[q.last]:""}:null,firstInGroup:x=>x?{[q.firstInGroup]:""}:null,lastInGroup:x=>x?{[q.lastInGroup]:""}:null};function Mt(x,e){let{value:o,textValue:i,keywords:u,disabled:s=!1,onSelect:p,forceMount:c=!1,render:a,className:t,style:P,onClick:m,onPointerDown:b,onPointerMove:I,children:d,...g}=x,l=D(),S=E.useMemo(()=>F(o,l.itemToStringValue),[o,l.itemToStringValue]),R=E.useId(),L=o===null?`combobox-clear-${R}`:void 0,w=E.useMemo(()=>Lo(l.items,S),[l.items,S]),k=w?.label,V=E.useMemo(()=>N(o,l.itemToStringLabel),[o,l.itemToStringLabel]),A=E.useMemo(()=>{if(i!==void 0)return i;if(typeof k=="string")return k;if(V&&V!==S)return V},[i,k,V,S]),K=E.useMemo(()=>wo(u,[typeof k=="string"?k:V&&V!==S?V:void 0,...w?.keywords??[]]),[u,k,V,S,w]),j=E.useRef(A),n=l.multiple?Mo(l.values,o,l.isItemEqualToValue):l.value!==""&&Vo(l.value,o,l.isItemEqualToValue),f=l.closeOnSelect,r=co({id:L,value:S,keywords:K,disabled:s,forceMount:c,closeOnClick:f,children:d});E.useEffect(()=>{let M=()=>{if(!s){if(l.multiple)if(o==null)l.onValuesChange([]);else{let me=n?Eo(l.values,o,l.isItemEqualToValue):[...l.values,o];l.onValuesChange(me)}else l.onValueChange(o);p?.()}};return r.registerSelect(M)},[s,l,o,n,p,r]),E.useEffect(()=>{let M=j.current;if(M)return l.registerItemText(S,M)},[S,l]),E.useEffect(()=>{!A&&typeof d=="string"&&(j.current=d,l.registerItemText(S,d))},[d,A,S,l]);let v=E.useMemo(()=>({highlighted:r.isHighlighted,disabled:s,selected:n,first:r.positional.first,last:r.positional.last,firstInGroup:r.positional.firstInGroup,lastInGroup:r.positional.lastInGroup}),[r.isHighlighted,s,n,r.positional]),y=E.useMemo(()=>({id:r.id,value:o,textValue:A,highlighted:r.isHighlighted,disabled:s,selected:n}),[r.id,o,A,r.isHighlighted,s,n]),O=E.useCallback(M=>{m?.(M),M.defaultPrevented||r.handlers.onClick(M)},[m,r.handlers]),W=E.useCallback(M=>{r.handlers.onPointerDown(M),b?.(M)},[r.handlers,b]),z=E.useCallback(M=>{I?.(M),M.defaultPrevented||r.handlers.onPointerMove(M)},[I,r.handlers]),ee=vt({render:a,ref:[r.ref,r.rowRef,e],state:v,stateAttributesMapping:Vt,props:{...g,[q.slot]:"",id:r.id,role:"option",tabIndex:-1,"aria-selected":n,"aria-disabled":s||void 0,className:t,style:P,onClick:O,onPointerMove:z,onPointerDown:W,children:d},enabled:r.isVisible,defaultTagName:"div"});return r.isVisible?Et(he.Provider,{value:y,children:ee}):null}var Te=E.forwardRef(Mt);import{useRender as Lt}from"@base-ui/react/use-render";import*as Ie from"react";var Pe={slot:"bazzaui-combobox-item-indicator",selected:"data-selected"};var wt={selected:x=>x?{[Pe.selected]:""}:null},He=Ie.forwardRef(function(e,o){let{keepMounted:i=!1,render:u,className:s,style:p,...c}=e,a=ue(),t=Ie.useMemo(()=>({selected:a.selected}),[a.selected]),P=Lt({render:u,ref:o,state:t,stateAttributesMapping:wt,props:{...c,[Pe.slot]:"","aria-hidden":!0,className:s,style:p},enabled:i||a.selected,defaultTagName:"span"});return!i&&!a.selected?null:P});import{useRender as kt}from"@base-ui/react/use-render";import*as Y from"react";var Do={slot:"bazzaui-combobox-item-label"};var Oe=Y.forwardRef(function(e,o){let{render:i,className:u,style:s,children:p,...c}=e,a=D(),t=ue(),P=F(t.value,a.itemToStringValue),m=Y.useMemo(()=>{if(p!==void 0)return p;let I=te(a.items,P);return I!==void 0?I:t.textValue!==void 0?t.textValue:P},[p,a.items,P,t.textValue]),b=Y.useMemo(()=>({value:P,selected:t.selected,highlighted:t.highlighted,disabled:t.disabled}),[P,t.selected,t.highlighted,t.disabled]);return Y.useEffect(()=>{if(typeof m=="string")return a.registerItemText(P,m)},[m,a,P]),kt({render:i,ref:o,state:b,props:{...c,[Do.slot]:"",className:u,style:s,children:m},defaultTagName:"span"})});import{Popover as Ao}from"@base-ui/react/popover";import*as U from"react";var Re={slot:"bazzaui-combobox-positioner"};import{jsx as ie}from"react/jsx-runtime";function Tt(x,e,o,i){let u=o+i*2;if(x==="top"){let c=-(e+i),a=e+i;return{width:u,marginBottom:c,paddingTop:i,paddingLeft:i,paddingRight:i,paddingBottom:a}}let s=-(e+i),p=e+i;return{width:u,marginTop:s,paddingTop:p,paddingLeft:i,paddingRight:i,paddingBottom:i}}var De=U.forwardRef(function(e,o){let{layout:i,popupPadding:u=8,side:s="bottom",align:p,sideOffset:c=4,anchor:a,className:t,style:P,children:m,...b}=e,I=D(),d=i??I.layout,g=d==="input-embedded",l=a??I.inputWrapperRef.current?I.inputWrapperRef:I.inputRef,S=g?0:c,R=g?"center":p??"start",{inputHeight:L,inputWidth:w}=I,k=w+u*2,V={...P,...g?{zIndex:0}:{}};if(g)return ie(Ao.Positioner,{ref:o,side:s,align:R,sideOffset:S,anchor:l,className:t,style:V,"data-input-embedded":"",[Re.slot]:"",...b,render:(n,f)=>{let r=f.side,v={layout:d,side:r,align:f.align,inputHeight:I.inputHeight},y={"--combobox-input-height":`${L}px`,"--combobox-input-width":`${w}px`,"--combobox-popup-padding":`${u}px`,"--combobox-popup-width":`${k}px`},O=Tt(r,L,w,u),W=U.Children.map(m,z=>U.isValidElement(z)?U.cloneElement(z,{style:{...O,...z.props.style},"data-side":r}):z);return ie(fe.Provider,{value:v,children:ie("div",{...n,style:{...n.style,...y},"data-side":r,children:W})})}});let A={layout:d,side:s,align:R,inputHeight:I.inputHeight},K={"--combobox-input-height":`${L}px`,"--combobox-input-width":`${w}px`},j={...V,...K};return ie(fe.Provider,{value:A,children:ie(Ao.Positioner,{ref:o,side:s,align:R,sideOffset:S,anchor:l,className:t,style:j,[Re.slot]:"",...b,children:m})})});import{Popover as Ht}from"@base-ui/react/popover";import*as h from"react";import{jsx as pe,jsxs as Ot}from"react/jsx-runtime";function Ae(x){let{open:e,onOpenChange:o,actionsRef:i,defaultOpen:u=!1,value:s,defaultValue:p,onValueChange:c,multiple:a=!1,values:t,defaultValues:P,onValuesChange:m,isItemEqualToValue:b=vo,itemToStringLabel:I,itemToStringValue:d,inputValue:g,defaultInputValue:l="",onInputValueChange:S,name:R,form:L,required:w,disabled:k=!1,placeholder:V="Search...",items:A,modal:K=!1,closeOnSelect:j,openOnFocus:n=!0,virtualized:f=!1,virtualItems:r,onHighlightChange:v,layout:y="floating",onOpenChangeComplete:O,debug:W,children:z,...ee}=x,M=h.useCallback((C,H,G,be)=>v?.(C,G,be),[v]),me=h.useId(),ce=h.useRef(null),Se=h.useRef(null),[ze,Be]=h.useState(0),[We,je]=h.useState(0),Ge=h.useCallback(C=>{if(ce.current=C,C&&!Se.current){let H=C.getBoundingClientRect();Be(H.height),je(H.width)}},[]),Ne=h.useCallback(C=>{if(Se.current=C,C){let H=C.getBoundingClientRect();Be(H.height),je(H.width)}},[]),{store:B,focusOwnerStore:$o,openChainStore:Jo,registerSurface:Xo,closeAll:_o,virtualization:Qo,handleOpenChange:qe,disabled:$,setDisabled:Ke,menuTreeResolver:Yo}=ao({onOpenChange:o,defaultOpen:u,virtualized:f,items:r,onHighlightChange:M,disabled:k}),ye=h.useRef(null);h.useImperativeHandle(i,()=>({close:()=>{ye.current?.close()},unmount:()=>{ye.current?.unmount()},setDisabled:Ke}),[Ke]),B.useControlledProp("openProp",e);let Zo=B.useState("open"),Ue=h.useCallback((C,H,G)=>{$&&H!==oe.imperativeAction||!C&&ce.current&&document.activeElement===ce.current||qe(C,H,G)},[qe,$]),et=h.useCallback(C=>{!C&&B.context.clearSearchOnClose==="after-exit"&&(B.clearSearch(),B.setInputActive(!1)),C||B.clearHighlight(),O?.(C)},[B,O]),ot=h.useCallback((C,H)=>{Ue(C,H.reason,H.event)},[Ue]),[tt,nt]=h.useState(p!==void 0?p:null),J=s!==void 0?s:tt,$e=h.useCallback(C=>{s===void 0&&nt(C),c?.(C)},[s,c]),[rt,at]=h.useState(P??[]),ae=t!==void 0?t:rt,Je=h.useCallback(C=>{t===void 0&&at(C),m?.(C)},[t,m]),[ve,st]=h.useState(l),Xe=g!==void 0?g:ve,_e=h.useCallback(C=>{g===void 0&&st(C),S?.(C)},[g,S]),Qe=h.useRef(new Map),Ye=h.useCallback((C,H)=>(Qe.current.set(C,H),()=>{}),[]),Ze=j??!a,Ve=h.useRef({type:"active"}),[,lt]=h.useState({type:"active"}),X=h.useCallback(C=>{Ve.current=C,lt(C)},[]),eo=Ve.current,oo=h.useCallback(()=>{X({type:"active"})},[X]),to=h.useCallback(()=>{$||(!a&&J!=null?X({type:"showAll"}):X({type:"active"}),B.setOpen(!0))},[$,B,a,J,X]),no=h.useCallback((C,H)=>{let G=Ve.current,be=G.type==="active"?ve:G.type==="showAll"?"":G.search;X({type:"frozen",search:be}),B.setOpen(!1,C,H)},[B,X,ve]),ut=h.useMemo(()=>({multiple:a,value:J,values:ae,onValueChange:$e,onValuesChange:Je,isItemEqualToValue:b,itemToStringLabel:I,itemToStringValue:d,inputValue:Xe,onInputValueChange:_e,name:R,form:L,required:w,disabled:$,placeholder:V,items:A,itemTextRegistry:Qe.current,registerItemText:Ye,listId:me,inputRef:ce,setInputElement:Ge,inputWrapperRef:Se,setInputWrapperElement:Ne,closeOnSelect:Ze,openOnFocus:n,openCombobox:to,closeCombobox:no,filterMode:eo,setFilterActive:oo,inputHeight:ze,inputWidth:We,layout:y}),[a,J,ae,$e,Je,b,I,d,Xe,_e,R,L,w,$,V,A,Ye,me,Ge,Ne,Ze,n,to,no,eo,oo,ze,We,y]),it=h.useMemo(()=>R?a?ae.length>0?ae.map((C,H)=>{let G=F(C,d);return pe("input",{type:"hidden",name:R,value:G,form:L,required:w&&H===0},G)}):pe("input",{type:"hidden",name:R,value:"",form:L,required:w}):pe("input",{type:"hidden",name:R,value:J!=null?F(J,d):"",form:L,required:w}):null,[R,L,w,a,J,ae,d]);return pe(uo.Provider,{value:ut,children:Ot(mo,{menuTreeResolver:Yo,store:B,focusOwnerStore:$o,openChainStore:Jo,disabled:$,depth:0,closeAll:_o,registerSurface:Xo,virtualization:Qo,menuType:"dropdown",componentName:"combobox",debug:W,children:[it,pe(Ht.Root,{...ee,open:Zo,onOpenChange:ot,onOpenChangeComplete:et,modal:K,actionsRef:i?ye:void 0,children:z})]})})}import*as Z from"react";var Fo={slot:"bazzaui-combobox-surface"};import{jsx as Dt}from"react/jsx-runtime";var Fe=Z.forwardRef(function(e,o){let{autoHighlightFirst:i,clearSearchOnClose:u=!0,search:s,onSearchChange:p,onPointerMove:c,...a}=e,t=D(),P=Z.useCallback(g=>{c?.(g);let l=t.inputRef.current;l&&document.activeElement!==l&&l.focus()},[c,t.inputRef]),m=Z.useMemo(()=>{let g=i??!0;if(g==="selected"){let l=t.multiple?t.values[0]:t.value;return l!=null?F(l,t.itemToStringValue):!0}return g},[i,t.multiple,t.value,t.values,t.itemToStringValue]),{filterMode:b}=t,I=s??(b.type==="active"?t.inputValue:b.type==="showAll"?"":b.search),d=Z.useCallback(g=>{t.onInputValueChange(g),p?.(g)},[t,p]);return Dt(Ro,{ref:o,autoHighlightFirst:m,clearSearchOnClose:u,search:I,onSearchChange:d,onPointerMove:P,skipAutoFocus:!0,[Fo.slot]:"",...a})});var Bo=(p=>(p.slot="bazzaui-combobox-arrow",p.open="data-open",p.closed="data-closed",p.side="data-side",p.align="data-align",p.uncentered="data-uncentered",p))(Bo||{});var Wo=(s=>(s.slot="bazzaui-combobox-backdrop",s.open="data-open",s.closed="data-closed",s.startingStyle="data-starting-style",s.endingStyle="data-ending-style",s))(Wo||{});var jo=(e=>(e.slot="bazzaui-combobox-empty",e))(jo||{});var Go=(e=>(e.slot="bazzaui-combobox-group",e))(Go||{});var No=(e=>(e.slot="bazzaui-combobox-group-label",e))(No||{});var At={slot:"bazzaui-combobox-icon",open:"data-popup-open"};var qo=(o=>(o.slot="bazzaui-combobox-list",o.list="data-popup-menu-list",o))(qo||{});var Ko=(b=>(b.slot="bazzaui-combobox-popup",b.open="data-open",b.closed="data-closed",b.side="data-side",b.align="data-align",b.startingStyle="data-starting-style",b.endingStyle="data-ending-style",b.instant="data-instant",b.focused="data-focused",b.hasOpenSubmenu="data-has-open-submenu",b.submenu="data-submenu",b.navigating="data-navigating",b))(Ko||{});var Ft={slotUp:"bazzaui-combobox-scroll-up-arrow",slotDown:"bazzaui-combobox-scroll-down-arrow",direction:"data-direction",side:"data-side"};var Uo=(e=>(e.slot="bazzaui-combobox-separator",e))(Uo||{});export{zo as Combobox,Bo as ComboboxArrowDataAttributes,Wo as ComboboxBackdropDataAttributes,Me as ComboboxClear,jo as ComboboxEmptyDataAttributes,Go as ComboboxGroupDataAttributes,No as ComboboxGroupLabelDataAttributes,At as ComboboxIconDataAttributes,we as ComboboxInput,Q as ComboboxInputDataAttributes,ke as ComboboxInputWrapper,ge as ComboboxInputWrapperDataAttributes,Te as ComboboxItem,q as ComboboxItemDataAttributes,He as ComboboxItemIndicator,Pe as ComboboxItemIndicatorDataAttributes,Oe as ComboboxItemLabel,gt as ComboboxListCssVars,qo as ComboboxListDataAttributes,Ko as ComboboxPopupDataAttributes,De as ComboboxPositioner,Ct as ComboboxPositionerCssVars,Re as ComboboxPositionerDataAttributes,Ae as ComboboxRoot,Ft as ComboboxScrollArrowDataAttributes,Uo as ComboboxSeparatorDataAttributes,xt as ComboboxStore,Fe as ComboboxSurface,bt as commandScore,dt as defaultFilter,D as useComboboxContext,ue as useComboboxItemContext,Ee as useComboboxPositionerContext,ft as useMaybeComboboxContext,yt as useMaybeComboboxItemContext,ct as useMaybeSurfaceContext,mt as useSurfaceContext};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkJFEVUUPCcjs = require('../chunk-JFEVUUPC.cjs');var _chunkZ2RGBRJPcjs = require('../chunk-Z2RGBRJP.cjs');var _chunkXMZZ62VJcjs = require('../chunk-XMZZ62VJ.cjs');var _chunkM4G6J7DPcjs = require('../chunk-M4G6J7DP.cjs');var ge={};_chunkM4G6J7DPcjs.a.call(void 0, ge,{Backdrop:()=>se,CheckboxItem:()=>_chunkZ2RGBRJPcjs.ha,CheckboxItemIndicator:()=>_chunkZ2RGBRJPcjs.ia,Empty:()=>_chunkZ2RGBRJPcjs.V,FocusZone:()=>_chunkZ2RGBRJPcjs.pa,Footer:()=>_chunkZ2RGBRJPcjs.qa,Group:()=>_chunkZ2RGBRJPcjs.ra,GroupLabel:()=>_chunkZ2RGBRJPcjs.X,Header:()=>_chunkZ2RGBRJPcjs.ta,Icon:()=>_chunkZ2RGBRJPcjs.U,Input:()=>de,Item:()=>_chunkZ2RGBRJPcjs.ja,LinkItem:()=>_chunkZ2RGBRJPcjs.ka,List:()=>_chunkZ2RGBRJPcjs.ca,Loading:()=>_chunkZ2RGBRJPcjs.da,Popup:()=>ie,Portal:()=>ce,Root:()=>Me,Separator:()=>_chunkZ2RGBRJPcjs.ua,Shortcut:()=>_chunkZ2RGBRJPcjs.va,Subpage:()=>Ce,SubpageBack:()=>_chunkZ2RGBRJPcjs.Da,SubpageBackItem:()=>_chunkZ2RGBRJPcjs.Ea,SubpageTrigger:()=>_chunkZ2RGBRJPcjs.Fa,Surface:()=>_chunkZ2RGBRJPcjs.ga,Trigger:()=>fe});var _dialog = require('@base-ui/react/dialog');var _react = require('react'); var y = _interopRequireWildcard(_react); var me = _interopRequireWildcard(_react); var s = _interopRequireWildcard(_react); var v = _interopRequireWildcard(_react); var d = _interopRequireWildcard(_react); var Se = _interopRequireWildcard(_react);var _jsxruntime = require('react/jsx-runtime');var se=y.forwardRef(function(o,a){let{onPointerDown:p,...r}=o,t=_chunkZ2RGBRJPcjs.e.call(void 0, ),u=y.useCallback(m=>{_optionalChain([p, 'optionalCall', _2 => _2(m)]),!m.defaultPrevented&&t&&!t.disabled&&t.closeAll(_chunkXMZZ62VJcjs.a.outsidePress,m.nativeEvent)},[p,t]);return _jsxruntime.jsx.call(void 0, _dialog.Dialog.Backdrop,{ref:a,...r,onPointerDown:u,"data-command-menu-backdrop":""})});var de=me.forwardRef(function(o,a){let{backspaceGoesBack:p=!0,...r}=o;return _jsxruntime.jsx.call(void 0, _chunkZ2RGBRJPcjs.W,{ref:a,backspaceGoesBack:p,...r})});var ie=s.forwardRef(function(o,a){let{children:p,className:r,render:t,...u}=o,m=s.useId(),M=_chunkZ2RGBRJPcjs.d.call(void 0, ),{subpageStackContextValue:C,isSubpageNavigating:S,hasOpenSubpage:n,subpageId:i}=_chunkZ2RGBRJPcjs.r.call(void 0, {surfaceId:m,store:M.store}),[g,k]=s.useState(null),[b,f]=s.useState(null),c=s.useCallback(P=>({...P,hasOpenSubpage:n,subpageId:i}),[n,i]),h=s.useMemo(()=>typeof r=="function"?P=>r(c(P)):r,[r,c]),D=s.useMemo(()=>typeof t=="function"?(P,l)=>t(P,c(l)):t,[t,c]),L=s.useMemo(()=>({dataSurfaceContext:g,setDataSurfaceContext:k,resolvedNodes:b,setResolvedNodes:f}),[g,b]);return _jsxruntime.jsx.call(void 0, _chunkZ2RGBRJPcjs.f.Provider,{value:m,children:_jsxruntime.jsx.call(void 0, _chunkZ2RGBRJPcjs.k.Provider,{value:C,children:_jsxruntime.jsx.call(void 0, _chunkZ2RGBRJPcjs.z.Provider,{value:L,children:_jsxruntime.jsxs.call(void 0, _dialog.Dialog.Popup,{ref:a,className:h,render:D,"data-command-menu-popup":"","data-navigating":S?"":void 0,"data-has-open-subpage":n?"":void 0,...u,children:[p,_jsxruntime.jsx.call(void 0, _chunkZ2RGBRJPcjs.J,{})]})})})})});var ce=_dialog.Dialog.Portal;function Qe(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||e instanceof HTMLElement&&e.isContentEditable}function qe(e){let o=e.key.toLowerCase();return o===" "?"space":o}function We(e,o){let a=_chunkJFEVUUPCcjs.d.call(void 0, ),p=o.meta||a&&o.mod,r=o.ctrl||!a&&o.mod;return e.metaKey===p&&e.ctrlKey===r&&e.altKey===o.alt&&e.shiftKey===o.shift}function _e(e,o){return o.key===qe(e)&&We(e,o)}function Pe(e,o,a){let p=d.useMemo(()=>_chunkJFEVUUPCcjs.a.call(void 0, e),[e]),[r]=p.chords,t=p.chords.length===1&&r!==void 0?r:null,u=p.chords.length>1,m=_optionalChain([a, 'optionalAccess', _3 => _3.enabled])!==!1,M=d.useRef(o),C=d.useRef(a);M.current=o,C.current=a,d.useEffect(()=>{u&&process.env.NODE_ENV!=="production"&&console.warn(`useHotkey only supports single-chord keybindings. Received "${e}", but sequences are not supported by useHotkey.`)},[u,e]),d.useEffect(()=>{if(!m||t===null||u||t.key===null)return;let S=n=>{let i=C.current;n.repeat||!_optionalChain([i, 'optionalAccess', _4 => _4.allowInInput])&&Qe(n.target)||_e(n,t)&&(_optionalChain([i, 'optionalAccess', _5 => _5.preventDefault])!==!1&&n.preventDefault(),M.current(n))};return document.addEventListener("keydown",S),()=>{document.removeEventListener("keydown",S)}},[t,m,u])}function Me(e){let{children:o,open:a,defaultOpen:p=!1,onOpenChange:r,onOpenChangeComplete:t,hotkey:u,modal:m=!0,disabled:M,getResolvedId:C,idScope:S="surface"}=e,{store:n,focusOwnerStore:i,openChainStore:g,registerSurface:k,closeAll:b,handleOpenChange:f,disabled:c,menuTreeResolver:h}=_chunkZ2RGBRJPcjs.q.call(void 0, {onOpenChange:r,defaultOpen:p,disabled:M,closeOnOutsidePress:"pointerdown",getResolvedId:C,idScope:S});n.useControlledProp("openProp",a);let D=n.useState("open");Pe(_nullishCoalesce(u, () => ("")),()=>f(!n.state.open,_chunkXMZZ62VJcjs.a.imperativeAction),{enabled:!!u&&!c,allowInInput:!0});let L=v.useCallback((l,N)=>{f(l,N.reason,N.event)},[f]),P=v.useCallback(l=>{!l&&n.context.clearSearchOnClose==="after-exit"&&(n.clearSearch(),n.setInputActive(!1)),l||(n.clearHighlight(),_optionalChain([n, 'access', _6 => _6.context, 'access', _7 => _7.onCloseComplete, 'optionalCall', _8 => _8()]),_optionalChain([n, 'access', _9 => _9.context, 'access', _10 => _10.onPopupCloseComplete, 'optionalCall', _11 => _11()])),_optionalChain([t, 'optionalCall', _12 => _12(l)])},[n,t]);return _jsxruntime.jsx.call(void 0, _chunkZ2RGBRJPcjs.O,{menuTreeResolver:h,store:n,focusOwnerStore:i,openChainStore:g,disabled:c,depth:0,closeAll:b,explicitTabBehavior:!0,tabWithoutZones:"inert",registerSurface:k,menuType:"dropdown",closeOnOutsidePress:"pointerdown",componentName:"command-menu",children:_jsxruntime.jsx.call(void 0, _dialog.Dialog.Root,{open:D,onOpenChange:L,onOpenChangeComplete:P,modal:m,children:o})})}function Ce(e){let{closeRootOnEsc:o=!0,children:a,...p}=e;return _jsxruntime.jsx.call(void 0, _chunkZ2RGBRJPcjs.Ca,{closeRootOnEsc:o,...p,children:a})}var fe=Se.forwardRef(function(o,a){let{disabled:p,...r}=o,t=_chunkZ2RGBRJPcjs.e.call(void 0, ),u=p||_optionalChain([t, 'optionalAccess', _13 => _13.disabled])||!1;return _jsxruntime.jsx.call(void 0, _dialog.Dialog.Trigger,{ref:a,...r,disabled:u,"data-command-menu-trigger":""})});exports.CommandMenu = ge; exports.CommandMenuRadioGroupValue = _chunkZ2RGBRJPcjs.ma; exports.DataListContext = _chunkZ2RGBRJPcjs.C; exports.DataSurfaceContext = _chunkZ2RGBRJPcjs.y; exports.defaultGetResolvedId = _chunkZ2RGBRJPcjs.p; exports.defineRadioGroup = _chunkZ2RGBRJPcjs.Y; exports.isDisplayGroupNode = _chunkZ2RGBRJPcjs.Z; exports.isDisplayRadioGroupNode = _chunkZ2RGBRJPcjs._; exports.isDisplayRowNode = _chunkZ2RGBRJPcjs.aa; exports.isDisplaySeparatorNode = _chunkZ2RGBRJPcjs.$; exports.isPopupMenuNode = _chunkZ2RGBRJPcjs.o; exports.useAsyncMenuCoordinator = _chunkZ2RGBRJPcjs.F; exports.useDataList = _chunkZ2RGBRJPcjs.D; exports.useDataSurfaceContext = _chunkZ2RGBRJPcjs.A; exports.useMaybeAsyncMenuCoordinator = _chunkZ2RGBRJPcjs.G; exports.useMaybeDataList = _chunkZ2RGBRJPcjs.E; exports.useMaybeDataSurfaceContext = _chunkZ2RGBRJPcjs.B; exports.useMaybeSurfaceContext = _chunkXMZZ62VJcjs.q; exports.useSurfaceContext = _chunkXMZZ62VJcjs.p;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkJFEVUUPCcjs = require('../chunk-JFEVUUPC.cjs');var _chunkBEWVWSAWcjs = require('../chunk-BEWVWSAW.cjs');var _chunkXMZZ62VJcjs = require('../chunk-XMZZ62VJ.cjs');var _chunkM4G6J7DPcjs = require('../chunk-M4G6J7DP.cjs');var ge={};_chunkM4G6J7DPcjs.a.call(void 0, ge,{Backdrop:()=>se,CheckboxItem:()=>_chunkBEWVWSAWcjs.ha,CheckboxItemIndicator:()=>_chunkBEWVWSAWcjs.ia,Empty:()=>_chunkBEWVWSAWcjs.V,FocusZone:()=>_chunkBEWVWSAWcjs.pa,Footer:()=>_chunkBEWVWSAWcjs.qa,Group:()=>_chunkBEWVWSAWcjs.ra,GroupLabel:()=>_chunkBEWVWSAWcjs.X,Header:()=>_chunkBEWVWSAWcjs.ta,Icon:()=>_chunkBEWVWSAWcjs.U,Input:()=>de,Item:()=>_chunkBEWVWSAWcjs.ja,LinkItem:()=>_chunkBEWVWSAWcjs.ka,List:()=>_chunkBEWVWSAWcjs.ca,Loading:()=>_chunkBEWVWSAWcjs.da,Popup:()=>ie,Portal:()=>ce,Root:()=>Me,Separator:()=>_chunkBEWVWSAWcjs.ua,Shortcut:()=>_chunkBEWVWSAWcjs.va,Subpage:()=>Ce,SubpageBack:()=>_chunkBEWVWSAWcjs.Da,SubpageBackItem:()=>_chunkBEWVWSAWcjs.Ea,SubpageTrigger:()=>_chunkBEWVWSAWcjs.Fa,Surface:()=>_chunkBEWVWSAWcjs.ga,Trigger:()=>fe});var _dialog = require('@base-ui/react/dialog');var _react = require('react'); var y = _interopRequireWildcard(_react); var me = _interopRequireWildcard(_react); var s = _interopRequireWildcard(_react); var v = _interopRequireWildcard(_react); var d = _interopRequireWildcard(_react); var Se = _interopRequireWildcard(_react);var _jsxruntime = require('react/jsx-runtime');var se=y.forwardRef(function(o,a){let{onPointerDown:p,...r}=o,t=_chunkBEWVWSAWcjs.e.call(void 0, ),u=y.useCallback(m=>{_optionalChain([p, 'optionalCall', _2 => _2(m)]),!m.defaultPrevented&&t&&!t.disabled&&t.closeAll(_chunkXMZZ62VJcjs.a.outsidePress,m.nativeEvent)},[p,t]);return _jsxruntime.jsx.call(void 0, _dialog.Dialog.Backdrop,{ref:a,...r,onPointerDown:u,"data-command-menu-backdrop":""})});var de=me.forwardRef(function(o,a){let{backspaceGoesBack:p=!0,...r}=o;return _jsxruntime.jsx.call(void 0, _chunkBEWVWSAWcjs.W,{ref:a,backspaceGoesBack:p,...r})});var ie=s.forwardRef(function(o,a){let{children:p,className:r,render:t,...u}=o,m=s.useId(),M=_chunkBEWVWSAWcjs.d.call(void 0, ),{subpageStackContextValue:C,isSubpageNavigating:S,hasOpenSubpage:n,subpageId:i}=_chunkBEWVWSAWcjs.r.call(void 0, {surfaceId:m,store:M.store}),[g,k]=s.useState(null),[b,f]=s.useState(null),c=s.useCallback(P=>({...P,hasOpenSubpage:n,subpageId:i}),[n,i]),h=s.useMemo(()=>typeof r=="function"?P=>r(c(P)):r,[r,c]),D=s.useMemo(()=>typeof t=="function"?(P,l)=>t(P,c(l)):t,[t,c]),L=s.useMemo(()=>({dataSurfaceContext:g,setDataSurfaceContext:k,resolvedNodes:b,setResolvedNodes:f}),[g,b]);return _jsxruntime.jsx.call(void 0, _chunkBEWVWSAWcjs.f.Provider,{value:m,children:_jsxruntime.jsx.call(void 0, _chunkBEWVWSAWcjs.k.Provider,{value:C,children:_jsxruntime.jsx.call(void 0, _chunkBEWVWSAWcjs.z.Provider,{value:L,children:_jsxruntime.jsxs.call(void 0, _dialog.Dialog.Popup,{ref:a,className:h,render:D,"data-command-menu-popup":"","data-navigating":S?"":void 0,"data-has-open-subpage":n?"":void 0,...u,children:[p,_jsxruntime.jsx.call(void 0, _chunkBEWVWSAWcjs.J,{})]})})})})});var ce=_dialog.Dialog.Portal;function Qe(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||e instanceof HTMLElement&&e.isContentEditable}function qe(e){let o=e.key.toLowerCase();return o===" "?"space":o}function We(e,o){let a=_chunkJFEVUUPCcjs.d.call(void 0, ),p=o.meta||a&&o.mod,r=o.ctrl||!a&&o.mod;return e.metaKey===p&&e.ctrlKey===r&&e.altKey===o.alt&&e.shiftKey===o.shift}function _e(e,o){return o.key===qe(e)&&We(e,o)}function Pe(e,o,a){let p=d.useMemo(()=>_chunkJFEVUUPCcjs.a.call(void 0, e),[e]),[r]=p.chords,t=p.chords.length===1&&r!==void 0?r:null,u=p.chords.length>1,m=_optionalChain([a, 'optionalAccess', _3 => _3.enabled])!==!1,M=d.useRef(o),C=d.useRef(a);M.current=o,C.current=a,d.useEffect(()=>{u&&process.env.NODE_ENV!=="production"&&console.warn(`useHotkey only supports single-chord keybindings. Received "${e}", but sequences are not supported by useHotkey.`)},[u,e]),d.useEffect(()=>{if(!m||t===null||u||t.key===null)return;let S=n=>{let i=C.current;n.repeat||!_optionalChain([i, 'optionalAccess', _4 => _4.allowInInput])&&Qe(n.target)||_e(n,t)&&(_optionalChain([i, 'optionalAccess', _5 => _5.preventDefault])!==!1&&n.preventDefault(),M.current(n))};return document.addEventListener("keydown",S),()=>{document.removeEventListener("keydown",S)}},[t,m,u])}function Me(e){let{children:o,open:a,defaultOpen:p=!1,onOpenChange:r,onOpenChangeComplete:t,hotkey:u,modal:m=!0,disabled:M,getResolvedId:C,idScope:S="surface"}=e,{store:n,focusOwnerStore:i,openChainStore:g,registerSurface:k,closeAll:b,handleOpenChange:f,disabled:c,menuTreeResolver:h}=_chunkBEWVWSAWcjs.q.call(void 0, {onOpenChange:r,defaultOpen:p,disabled:M,closeOnOutsidePress:"pointerdown",getResolvedId:C,idScope:S});n.useControlledProp("openProp",a);let D=n.useState("open");Pe(_nullishCoalesce(u, () => ("")),()=>f(!n.state.open,_chunkXMZZ62VJcjs.a.imperativeAction),{enabled:!!u&&!c,allowInInput:!0});let L=v.useCallback((l,N)=>{f(l,N.reason,N.event)},[f]),P=v.useCallback(l=>{!l&&n.context.clearSearchOnClose==="after-exit"&&(n.clearSearch(),n.setInputActive(!1)),l||(n.clearHighlight(),_optionalChain([n, 'access', _6 => _6.context, 'access', _7 => _7.onCloseComplete, 'optionalCall', _8 => _8()]),_optionalChain([n, 'access', _9 => _9.context, 'access', _10 => _10.onPopupCloseComplete, 'optionalCall', _11 => _11()])),_optionalChain([t, 'optionalCall', _12 => _12(l)])},[n,t]);return _jsxruntime.jsx.call(void 0, _chunkBEWVWSAWcjs.O,{menuTreeResolver:h,store:n,focusOwnerStore:i,openChainStore:g,disabled:c,depth:0,closeAll:b,explicitTabBehavior:!0,tabWithoutZones:"inert",registerSurface:k,menuType:"dropdown",closeOnOutsidePress:"pointerdown",componentName:"command-menu",children:_jsxruntime.jsx.call(void 0, _dialog.Dialog.Root,{open:D,onOpenChange:L,onOpenChangeComplete:P,modal:m,children:o})})}function Ce(e){let{closeRootOnEsc:o=!0,children:a,...p}=e;return _jsxruntime.jsx.call(void 0, _chunkBEWVWSAWcjs.Ca,{closeRootOnEsc:o,...p,children:a})}var fe=Se.forwardRef(function(o,a){let{disabled:p,...r}=o,t=_chunkBEWVWSAWcjs.e.call(void 0, ),u=p||_optionalChain([t, 'optionalAccess', _13 => _13.disabled])||!1;return _jsxruntime.jsx.call(void 0, _dialog.Dialog.Trigger,{ref:a,...r,disabled:u,"data-command-menu-trigger":""})});exports.CommandMenu = ge; exports.CommandMenuRadioGroupValue = _chunkBEWVWSAWcjs.ma; exports.DataListContext = _chunkBEWVWSAWcjs.C; exports.DataSurfaceContext = _chunkBEWVWSAWcjs.y; exports.defaultGetResolvedId = _chunkBEWVWSAWcjs.p; exports.defineRadioGroup = _chunkBEWVWSAWcjs.Y; exports.isDisplayGroupNode = _chunkBEWVWSAWcjs.Z; exports.isDisplayRadioGroupNode = _chunkBEWVWSAWcjs._; exports.isDisplayRowNode = _chunkBEWVWSAWcjs.aa; exports.isDisplaySeparatorNode = _chunkBEWVWSAWcjs.$; exports.isPopupMenuNode = _chunkBEWVWSAWcjs.o; exports.useAsyncMenuCoordinator = _chunkBEWVWSAWcjs.F; exports.useDataList = _chunkBEWVWSAWcjs.D; exports.useDataSurfaceContext = _chunkBEWVWSAWcjs.A; exports.useMaybeAsyncMenuCoordinator = _chunkBEWVWSAWcjs.G; exports.useMaybeDataList = _chunkBEWVWSAWcjs.E; exports.useMaybeDataSurfaceContext = _chunkBEWVWSAWcjs.B; exports.useMaybeSurfaceContext = _chunkXMZZ62VJcjs.q; exports.useSurfaceContext = _chunkXMZZ62VJcjs.p;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,19 +1,19 @@
1
- import { h as GetResolvedIdFn, j as PopupMenuIdScope, m as PopupMenuCheckboxItem, q as PopupMenuItem, r as PopupMenuLinkItem, u as PopupMenuNode, N as NodeDef, y as PopupMenuSubpageTrigger } from '../events-DuKEM5sQ.cjs';
2
- export { R as AsyncLoaderConfig, S as AsyncLoaderFetchStatus, T as AsyncLoaderLoadingPhase, U as AsyncLoaderResult, V as AsyncLoaderSource, W as AsyncLoaderStatus, X as AsyncNodesConfig, Y as AsyncRenderState, Z as AsyncResultBehavior, _ as AsyncState, $ as BreadcrumbNode, a0 as CheckboxItemDef, a1 as CheckboxItemRenderParams, a2 as CheckboxItemRenderProps, z as CommandMenuCheckboxItemProps, A as CommandMenuCheckboxItemState, B as CommandMenuItemProps, D as CommandMenuItemState, E as CommandMenuLinkItemProps, F as CommandMenuLinkItemState, O as CommandMenuSubpageTriggerProps, Q as CommandMenuSubpageTriggerState, a3 as DataListChildrenState, a4 as DeepSearchConfig, a5 as DisplayGroupNode, a6 as DisplayNode, a7 as DisplayRadioGroupNode, a8 as DisplayRowNode, a9 as DisplaySeparatorNode, aa as DisplaySubpageNode, ab as GroupBehavior, ac as GroupDef, ae as GroupRenderContext, af as GroupRenderParams, ag as IncludeInDeepSearch, ah as InitialQueryBehavior, ai as ItemDef, aj as ItemRenderParams, ak as ItemRenderProps, al as LinkItemDef, am as LinkItemRenderParams, an as LinkItemRenderProps, ao as LoaderComponentProps, ap as QueryAsyncNodesConfig, aq as QueryLoaderConfig, ar as RadioGroupBehavior, as as RadioGroupDef, au as RadioGroupRenderParams, av as RadioGroupRenderProps, aw as RadioItemDef, ax as RadioItemRenderParams, ay as RadioItemRenderProps, az as RowRenderContext, aA as ScoredNode, aB as SeparatorDef, aC as SeparatorRenderParams, aD as StaticAsyncNodesConfig, aE as StaticLoaderConfig, aF as SubmenuDef, aG as SubmenuRenderParams, aH as SubmenuRenderProps, aI as SubpageContentRenderParams, aJ as SubpageDef, aK as SubpageTriggerRenderParams, aL as SubpageTriggerRenderProps, aP as UnresolvedMenuNode, aQ as defineRadioGroup, aR as isDisplayGroupNode, aS as isDisplayRadioGroupNode, aT as isDisplayRowNode, aU as isDisplaySeparatorNode } from '../events-DuKEM5sQ.cjs';
3
- export { S as SurfaceContextValue, u as useMaybeSurfaceContext, a as useSurfaceContext } from '../surface-context-r2eYfQth.cjs';
4
- import { P as PopupMenuEmpty, a as PopupMenuGroup, b as PopupMenuGroupLabel, c as PopupMenuIcon, d as PopupMenuList, e as PopupMenuSeparator, f as PopupMenuSurface } from '../separator-DzfgGPjS.cjs';
5
- export { g as CommandMenuEmptyProps, h as CommandMenuEmptyState, i as CommandMenuGroupLabelProps, j as CommandMenuGroupLabelState, k as CommandMenuGroupProps, l as CommandMenuGroupState, m as CommandMenuIconProps, n as CommandMenuIconState, o as CommandMenuListChildrenState, p as CommandMenuListProps, q as CommandMenuListState, r as CommandMenuSeparatorProps, s as CommandMenuSeparatorState, t as CommandMenuSurfaceProps, u as CommandMenuSurfaceState } from '../separator-DzfgGPjS.cjs';
1
+ import { h as GetResolvedIdFn, j as PopupMenuIdScope, m as PopupMenuCheckboxItem, q as PopupMenuItem, r as PopupMenuLinkItem, u as PopupMenuNode, N as NodeDef, y as PopupMenuSubpageTrigger } from '../events-DVcrtGe3.cjs';
2
+ export { R as AsyncLoaderConfig, S as AsyncLoaderFetchStatus, T as AsyncLoaderLoadingPhase, U as AsyncLoaderResult, V as AsyncLoaderSource, W as AsyncLoaderStatus, X as AsyncNodesConfig, Y as AsyncRenderState, Z as AsyncResultBehavior, _ as AsyncState, $ as BreadcrumbNode, a0 as CheckboxItemDef, a1 as CheckboxItemRenderParams, a2 as CheckboxItemRenderProps, z as CommandMenuCheckboxItemProps, A as CommandMenuCheckboxItemState, B as CommandMenuItemProps, D as CommandMenuItemState, E as CommandMenuLinkItemProps, F as CommandMenuLinkItemState, O as CommandMenuSubpageTriggerProps, Q as CommandMenuSubpageTriggerState, a3 as DataListChildrenState, a4 as DeepSearchConfig, a5 as DisabledBranchBehavior, a6 as DisplayGroupNode, a7 as DisplayNode, a8 as DisplayRadioGroupNode, a9 as DisplayRowNode, aa as DisplaySeparatorNode, ab as DisplaySubpageNode, ac as GroupBehavior, ad as GroupDef, af as GroupRenderContext, ag as GroupRenderParams, ah as IncludeInDeepSearch, ai as InitialQueryBehavior, aj as ItemDef, ak as ItemRenderParams, al as ItemRenderProps, am as LinkItemDef, an as LinkItemRenderParams, ao as LinkItemRenderProps, ap as LoaderComponentProps, aq as QueryAsyncNodesConfig, ar as QueryLoaderConfig, as as RadioGroupBehavior, at as RadioGroupDef, av as RadioGroupRenderParams, aw as RadioGroupRenderProps, ax as RadioItemDef, ay as RadioItemRenderParams, az as RadioItemRenderProps, aA as RowRenderContext, aB as ScoredNode, aC as SeparatorDef, aD as SeparatorRenderParams, aE as StaticAsyncNodesConfig, aF as StaticLoaderConfig, aG as SubmenuDef, aH as SubmenuRenderParams, aI as SubmenuRenderProps, aJ as SubpageContentRenderParams, aK as SubpageDef, aL as SubpageTriggerRenderParams, aM as SubpageTriggerRenderProps, aQ as UnresolvedMenuNode, aR as defineRadioGroup, aS as isDisplayGroupNode, aT as isDisplayRadioGroupNode, aU as isDisplayRowNode, aV as isDisplaySeparatorNode } from '../events-DVcrtGe3.cjs';
3
+ export { S as SurfaceContextValue, u as useMaybeSurfaceContext, a as useSurfaceContext } from '../surface-context-CN4Lb_6F.cjs';
4
+ import { P as PopupMenuEmpty, a as PopupMenuGroup, b as PopupMenuGroupLabel, c as PopupMenuIcon, d as PopupMenuList, e as PopupMenuSeparator, f as PopupMenuSurface } from '../separator-NjsBVzek.cjs';
5
+ export { g as CommandMenuEmptyProps, h as CommandMenuEmptyState, i as CommandMenuGroupLabelProps, j as CommandMenuGroupLabelState, k as CommandMenuGroupProps, l as CommandMenuGroupState, m as CommandMenuIconProps, n as CommandMenuIconState, o as CommandMenuListChildrenState, p as CommandMenuListProps, q as CommandMenuListState, r as CommandMenuSeparatorProps, s as CommandMenuSeparatorState, t as CommandMenuSurfaceProps, u as CommandMenuSurfaceState } from '../separator-NjsBVzek.cjs';
6
6
  import { P as PopupMenuLoading } from '../loading-C6WZGUc3.cjs';
7
7
  export { a as CommandMenuLoadingProps, b as CommandMenuLoadingState } from '../loading-C6WZGUc3.cjs';
8
- import { A as PopupMenuSubpageProps, P as PopupMenuCheckboxItemIndicator, a as PopupMenuFocusZone, b as PopupMenuFooter, c as PopupMenuHeader, e as PopupMenuShortcut, g as PopupMenuSubpageBack, h as PopupMenuSubpageBackItem } from '../resolve-C5shwZ1S.cjs';
9
- export { B as AsyncMenuCoordinatorValue, l as CommandMenuCheckboxItemIndicatorProps, m as CommandMenuCheckboxItemIndicatorState, n as CommandMenuFocusZoneProps, o as CommandMenuFocusZoneState, p as CommandMenuFooterProps, q as CommandMenuFooterState, r as CommandMenuHeaderProps, s as CommandMenuHeaderState, d as CommandMenuRadioGroupValue, C as CommandMenuRadioGroupValueProps, t as CommandMenuShortcutProps, v as CommandMenuShortcutState, w as CommandMenuSubpageBackItemProps, x as CommandMenuSubpageBackItemState, y as CommandMenuSubpageBackProps, z as CommandMenuSubpageBackState, E as DataListContext, F as DataSurfaceContext, D as DataSurfaceContextValue, R as RenderNodeFn, G as defaultGetResolvedId, H as isPopupMenuNode, u as useAsyncMenuCoordinator, i as useDataList, I as useDataSurfaceContext, j as useMaybeAsyncMenuCoordinator, k as useMaybeDataList, J as useMaybeDataSurfaceContext } from '../resolve-C5shwZ1S.cjs';
8
+ import { A as PopupMenuSubpageProps, P as PopupMenuCheckboxItemIndicator, a as PopupMenuFocusZone, b as PopupMenuFooter, c as PopupMenuHeader, e as PopupMenuShortcut, g as PopupMenuSubpageBack, h as PopupMenuSubpageBackItem } from '../resolve-B-j0eW24.cjs';
9
+ export { B as AsyncMenuCoordinatorValue, l as CommandMenuCheckboxItemIndicatorProps, m as CommandMenuCheckboxItemIndicatorState, n as CommandMenuFocusZoneProps, o as CommandMenuFocusZoneState, p as CommandMenuFooterProps, q as CommandMenuFooterState, r as CommandMenuHeaderProps, s as CommandMenuHeaderState, d as CommandMenuRadioGroupValue, C as CommandMenuRadioGroupValueProps, t as CommandMenuShortcutProps, v as CommandMenuShortcutState, w as CommandMenuSubpageBackItemProps, x as CommandMenuSubpageBackItemState, y as CommandMenuSubpageBackProps, z as CommandMenuSubpageBackState, E as DataListContext, F as DataSurfaceContext, D as DataSurfaceContextValue, R as RenderNodeFn, G as defaultGetResolvedId, H as isPopupMenuNode, u as useAsyncMenuCoordinator, i as useDataList, I as useDataSurfaceContext, j as useMaybeAsyncMenuCoordinator, k as useMaybeDataList, J as useMaybeDataSurfaceContext } from '../resolve-B-j0eW24.cjs';
10
10
  import * as _base_ui_react_dialog from '@base-ui/react/dialog';
11
11
  import { Dialog } from '@base-ui/react/dialog';
12
12
  import * as React from 'react';
13
13
  import { a as PopupMenuInputProps, b as PopupMenuInputState } from '../input-C95v6jB0.cjs';
14
14
  import { a as ComponentRenderFn } from '../types-DT4FOOa2.cjs';
15
15
  import * as react_jsx_runtime from 'react/jsx-runtime';
16
- import '../ListboxStore-DCGGpiBg.cjs';
16
+ import '../ListboxStore-B8oTpM57.cjs';
17
17
  import '@base-ui/utils/store';
18
18
 
19
19
  interface CommandMenuBackdropProps extends Dialog.Backdrop.Props {
@@ -1,19 +1,19 @@
1
- import { h as GetResolvedIdFn, j as PopupMenuIdScope, m as PopupMenuCheckboxItem, q as PopupMenuItem, r as PopupMenuLinkItem, u as PopupMenuNode, N as NodeDef, y as PopupMenuSubpageTrigger } from '../events-D6K5-_aP.js';
2
- export { R as AsyncLoaderConfig, S as AsyncLoaderFetchStatus, T as AsyncLoaderLoadingPhase, U as AsyncLoaderResult, V as AsyncLoaderSource, W as AsyncLoaderStatus, X as AsyncNodesConfig, Y as AsyncRenderState, Z as AsyncResultBehavior, _ as AsyncState, $ as BreadcrumbNode, a0 as CheckboxItemDef, a1 as CheckboxItemRenderParams, a2 as CheckboxItemRenderProps, z as CommandMenuCheckboxItemProps, A as CommandMenuCheckboxItemState, B as CommandMenuItemProps, D as CommandMenuItemState, E as CommandMenuLinkItemProps, F as CommandMenuLinkItemState, O as CommandMenuSubpageTriggerProps, Q as CommandMenuSubpageTriggerState, a3 as DataListChildrenState, a4 as DeepSearchConfig, a5 as DisplayGroupNode, a6 as DisplayNode, a7 as DisplayRadioGroupNode, a8 as DisplayRowNode, a9 as DisplaySeparatorNode, aa as DisplaySubpageNode, ab as GroupBehavior, ac as GroupDef, ae as GroupRenderContext, af as GroupRenderParams, ag as IncludeInDeepSearch, ah as InitialQueryBehavior, ai as ItemDef, aj as ItemRenderParams, ak as ItemRenderProps, al as LinkItemDef, am as LinkItemRenderParams, an as LinkItemRenderProps, ao as LoaderComponentProps, ap as QueryAsyncNodesConfig, aq as QueryLoaderConfig, ar as RadioGroupBehavior, as as RadioGroupDef, au as RadioGroupRenderParams, av as RadioGroupRenderProps, aw as RadioItemDef, ax as RadioItemRenderParams, ay as RadioItemRenderProps, az as RowRenderContext, aA as ScoredNode, aB as SeparatorDef, aC as SeparatorRenderParams, aD as StaticAsyncNodesConfig, aE as StaticLoaderConfig, aF as SubmenuDef, aG as SubmenuRenderParams, aH as SubmenuRenderProps, aI as SubpageContentRenderParams, aJ as SubpageDef, aK as SubpageTriggerRenderParams, aL as SubpageTriggerRenderProps, aP as UnresolvedMenuNode, aQ as defineRadioGroup, aR as isDisplayGroupNode, aS as isDisplayRadioGroupNode, aT as isDisplayRowNode, aU as isDisplaySeparatorNode } from '../events-D6K5-_aP.js';
3
- export { S as SurfaceContextValue, u as useMaybeSurfaceContext, a as useSurfaceContext } from '../surface-context-BMizU8oI.js';
4
- import { P as PopupMenuEmpty, a as PopupMenuGroup, b as PopupMenuGroupLabel, c as PopupMenuIcon, d as PopupMenuList, e as PopupMenuSeparator, f as PopupMenuSurface } from '../separator-DaXKN0QW.js';
5
- export { g as CommandMenuEmptyProps, h as CommandMenuEmptyState, i as CommandMenuGroupLabelProps, j as CommandMenuGroupLabelState, k as CommandMenuGroupProps, l as CommandMenuGroupState, m as CommandMenuIconProps, n as CommandMenuIconState, o as CommandMenuListChildrenState, p as CommandMenuListProps, q as CommandMenuListState, r as CommandMenuSeparatorProps, s as CommandMenuSeparatorState, t as CommandMenuSurfaceProps, u as CommandMenuSurfaceState } from '../separator-DaXKN0QW.js';
1
+ import { h as GetResolvedIdFn, j as PopupMenuIdScope, m as PopupMenuCheckboxItem, q as PopupMenuItem, r as PopupMenuLinkItem, u as PopupMenuNode, N as NodeDef, y as PopupMenuSubpageTrigger } from '../events-BTHQ2OoH.js';
2
+ export { R as AsyncLoaderConfig, S as AsyncLoaderFetchStatus, T as AsyncLoaderLoadingPhase, U as AsyncLoaderResult, V as AsyncLoaderSource, W as AsyncLoaderStatus, X as AsyncNodesConfig, Y as AsyncRenderState, Z as AsyncResultBehavior, _ as AsyncState, $ as BreadcrumbNode, a0 as CheckboxItemDef, a1 as CheckboxItemRenderParams, a2 as CheckboxItemRenderProps, z as CommandMenuCheckboxItemProps, A as CommandMenuCheckboxItemState, B as CommandMenuItemProps, D as CommandMenuItemState, E as CommandMenuLinkItemProps, F as CommandMenuLinkItemState, O as CommandMenuSubpageTriggerProps, Q as CommandMenuSubpageTriggerState, a3 as DataListChildrenState, a4 as DeepSearchConfig, a5 as DisabledBranchBehavior, a6 as DisplayGroupNode, a7 as DisplayNode, a8 as DisplayRadioGroupNode, a9 as DisplayRowNode, aa as DisplaySeparatorNode, ab as DisplaySubpageNode, ac as GroupBehavior, ad as GroupDef, af as GroupRenderContext, ag as GroupRenderParams, ah as IncludeInDeepSearch, ai as InitialQueryBehavior, aj as ItemDef, ak as ItemRenderParams, al as ItemRenderProps, am as LinkItemDef, an as LinkItemRenderParams, ao as LinkItemRenderProps, ap as LoaderComponentProps, aq as QueryAsyncNodesConfig, ar as QueryLoaderConfig, as as RadioGroupBehavior, at as RadioGroupDef, av as RadioGroupRenderParams, aw as RadioGroupRenderProps, ax as RadioItemDef, ay as RadioItemRenderParams, az as RadioItemRenderProps, aA as RowRenderContext, aB as ScoredNode, aC as SeparatorDef, aD as SeparatorRenderParams, aE as StaticAsyncNodesConfig, aF as StaticLoaderConfig, aG as SubmenuDef, aH as SubmenuRenderParams, aI as SubmenuRenderProps, aJ as SubpageContentRenderParams, aK as SubpageDef, aL as SubpageTriggerRenderParams, aM as SubpageTriggerRenderProps, aQ as UnresolvedMenuNode, aR as defineRadioGroup, aS as isDisplayGroupNode, aT as isDisplayRadioGroupNode, aU as isDisplayRowNode, aV as isDisplaySeparatorNode } from '../events-BTHQ2OoH.js';
3
+ export { S as SurfaceContextValue, u as useMaybeSurfaceContext, a as useSurfaceContext } from '../surface-context-CGLDpMej.js';
4
+ import { P as PopupMenuEmpty, a as PopupMenuGroup, b as PopupMenuGroupLabel, c as PopupMenuIcon, d as PopupMenuList, e as PopupMenuSeparator, f as PopupMenuSurface } from '../separator-Dn15rte3.js';
5
+ export { g as CommandMenuEmptyProps, h as CommandMenuEmptyState, i as CommandMenuGroupLabelProps, j as CommandMenuGroupLabelState, k as CommandMenuGroupProps, l as CommandMenuGroupState, m as CommandMenuIconProps, n as CommandMenuIconState, o as CommandMenuListChildrenState, p as CommandMenuListProps, q as CommandMenuListState, r as CommandMenuSeparatorProps, s as CommandMenuSeparatorState, t as CommandMenuSurfaceProps, u as CommandMenuSurfaceState } from '../separator-Dn15rte3.js';
6
6
  import { P as PopupMenuLoading } from '../loading-CC4n55sR.js';
7
7
  export { a as CommandMenuLoadingProps, b as CommandMenuLoadingState } from '../loading-CC4n55sR.js';
8
- import { A as PopupMenuSubpageProps, P as PopupMenuCheckboxItemIndicator, a as PopupMenuFocusZone, b as PopupMenuFooter, c as PopupMenuHeader, e as PopupMenuShortcut, g as PopupMenuSubpageBack, h as PopupMenuSubpageBackItem } from '../resolve-DA6nHdAi.js';
9
- export { B as AsyncMenuCoordinatorValue, l as CommandMenuCheckboxItemIndicatorProps, m as CommandMenuCheckboxItemIndicatorState, n as CommandMenuFocusZoneProps, o as CommandMenuFocusZoneState, p as CommandMenuFooterProps, q as CommandMenuFooterState, r as CommandMenuHeaderProps, s as CommandMenuHeaderState, d as CommandMenuRadioGroupValue, C as CommandMenuRadioGroupValueProps, t as CommandMenuShortcutProps, v as CommandMenuShortcutState, w as CommandMenuSubpageBackItemProps, x as CommandMenuSubpageBackItemState, y as CommandMenuSubpageBackProps, z as CommandMenuSubpageBackState, E as DataListContext, F as DataSurfaceContext, D as DataSurfaceContextValue, R as RenderNodeFn, G as defaultGetResolvedId, H as isPopupMenuNode, u as useAsyncMenuCoordinator, i as useDataList, I as useDataSurfaceContext, j as useMaybeAsyncMenuCoordinator, k as useMaybeDataList, J as useMaybeDataSurfaceContext } from '../resolve-DA6nHdAi.js';
8
+ import { A as PopupMenuSubpageProps, P as PopupMenuCheckboxItemIndicator, a as PopupMenuFocusZone, b as PopupMenuFooter, c as PopupMenuHeader, e as PopupMenuShortcut, g as PopupMenuSubpageBack, h as PopupMenuSubpageBackItem } from '../resolve-B1F-a3P1.js';
9
+ export { B as AsyncMenuCoordinatorValue, l as CommandMenuCheckboxItemIndicatorProps, m as CommandMenuCheckboxItemIndicatorState, n as CommandMenuFocusZoneProps, o as CommandMenuFocusZoneState, p as CommandMenuFooterProps, q as CommandMenuFooterState, r as CommandMenuHeaderProps, s as CommandMenuHeaderState, d as CommandMenuRadioGroupValue, C as CommandMenuRadioGroupValueProps, t as CommandMenuShortcutProps, v as CommandMenuShortcutState, w as CommandMenuSubpageBackItemProps, x as CommandMenuSubpageBackItemState, y as CommandMenuSubpageBackProps, z as CommandMenuSubpageBackState, E as DataListContext, F as DataSurfaceContext, D as DataSurfaceContextValue, R as RenderNodeFn, G as defaultGetResolvedId, H as isPopupMenuNode, u as useAsyncMenuCoordinator, i as useDataList, I as useDataSurfaceContext, j as useMaybeAsyncMenuCoordinator, k as useMaybeDataList, J as useMaybeDataSurfaceContext } from '../resolve-B1F-a3P1.js';
10
10
  import * as _base_ui_react_dialog from '@base-ui/react/dialog';
11
11
  import { Dialog } from '@base-ui/react/dialog';
12
12
  import * as React from 'react';
13
13
  import { a as PopupMenuInputProps, b as PopupMenuInputState } from '../input-CYweYB_i.js';
14
14
  import { a as ComponentRenderFn } from '../types-DT4FOOa2.js';
15
15
  import * as react_jsx_runtime from 'react/jsx-runtime';
16
- import '../ListboxStore-DZ73dOaC.js';
16
+ import '../ListboxStore-CV5vPUUc.js';
17
17
  import '@base-ui/utils/store';
18
18
 
19
19
  interface CommandMenuBackdropProps extends Dialog.Backdrop.Props {
@@ -1,2 +1,2 @@
1
- import{a as re,d as ue}from"../chunk-LXXK4S4Q.js";import{$ as Ae,A as he,B as De,C as Le,Ca as ne,D as ve,Da as te,E as Ne,Ea as ae,F as Te,Fa as pe,G as Ee,J as H,O as w,U as F,V as K,W as V,X as Z,Y as Be,Z as Ge,_ as Oe,aa as He,ca as j,d as T,da as U,e as x,f as E,ga as Q,ha as q,ia as W,ja as _,k as B,ka as $,ma as we,o as ye,p as Ie,pa as z,q as G,qa as J,r as O,ra as X,ta as Y,ua as ee,va as oe,y as ke,z as A}from"../chunk-NNGWBSWK.js";import{a as R,p as xe,q as Re}from"../chunk-A4Z5BY7H.js";import{a as be}from"../chunk-4C666HHU.js";var ge={};be(ge,{Backdrop:()=>se,CheckboxItem:()=>q,CheckboxItemIndicator:()=>W,Empty:()=>K,FocusZone:()=>z,Footer:()=>J,Group:()=>X,GroupLabel:()=>Z,Header:()=>Y,Icon:()=>F,Input:()=>de,Item:()=>_,LinkItem:()=>$,List:()=>j,Loading:()=>U,Popup:()=>ie,Portal:()=>ce,Root:()=>Me,Separator:()=>ee,Shortcut:()=>oe,Subpage:()=>Ce,SubpageBack:()=>te,SubpageBackItem:()=>ae,SubpageTrigger:()=>pe,Surface:()=>Q,Trigger:()=>fe});import{Dialog as Fe}from"@base-ui/react/dialog";import*as y from"react";import{jsx as Ke}from"react/jsx-runtime";var se=y.forwardRef(function(o,a){let{onPointerDown:p,...r}=o,t=x(),u=y.useCallback(m=>{p?.(m),!m.defaultPrevented&&t&&!t.disabled&&t.closeAll(R.outsidePress,m.nativeEvent)},[p,t]);return Ke(Fe.Backdrop,{ref:a,...r,onPointerDown:u,"data-command-menu-backdrop":""})});import*as me from"react";import{jsx as Ve}from"react/jsx-runtime";var de=me.forwardRef(function(o,a){let{backspaceGoesBack:p=!0,...r}=o;return Ve(V,{ref:a,backspaceGoesBack:p,...r})});import{Dialog as Ze}from"@base-ui/react/dialog";import*as s from"react";import{jsx as I,jsxs as je}from"react/jsx-runtime";var ie=s.forwardRef(function(o,a){let{children:p,className:r,render:t,...u}=o,m=s.useId(),M=T(),{subpageStackContextValue:C,isSubpageNavigating:S,hasOpenSubpage:n,subpageId:i}=O({surfaceId:m,store:M.store}),[g,k]=s.useState(null),[b,f]=s.useState(null),c=s.useCallback(P=>({...P,hasOpenSubpage:n,subpageId:i}),[n,i]),h=s.useMemo(()=>typeof r=="function"?P=>r(c(P)):r,[r,c]),D=s.useMemo(()=>typeof t=="function"?(P,l)=>t(P,c(l)):t,[t,c]),L=s.useMemo(()=>({dataSurfaceContext:g,setDataSurfaceContext:k,resolvedNodes:b,setResolvedNodes:f}),[g,b]);return I(E.Provider,{value:m,children:I(B.Provider,{value:C,children:I(A.Provider,{value:L,children:je(Ze.Popup,{ref:a,className:h,render:D,"data-command-menu-popup":"","data-navigating":S?"":void 0,"data-has-open-subpage":n?"":void 0,...u,children:[p,I(H,{})]})})})})});import{Dialog as Ue}from"@base-ui/react/dialog";var ce=Ue.Portal;import{Dialog as $e}from"@base-ui/react/dialog";import*as v from"react";import*as d from"react";function Qe(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||e instanceof HTMLElement&&e.isContentEditable}function qe(e){let o=e.key.toLowerCase();return o===" "?"space":o}function We(e,o){let a=ue(),p=o.meta||a&&o.mod,r=o.ctrl||!a&&o.mod;return e.metaKey===p&&e.ctrlKey===r&&e.altKey===o.alt&&e.shiftKey===o.shift}function _e(e,o){return o.key===qe(e)&&We(e,o)}function Pe(e,o,a){let p=d.useMemo(()=>re(e),[e]),[r]=p.chords,t=p.chords.length===1&&r!==void 0?r:null,u=p.chords.length>1,m=a?.enabled!==!1,M=d.useRef(o),C=d.useRef(a);M.current=o,C.current=a,d.useEffect(()=>{u&&process.env.NODE_ENV!=="production"&&console.warn(`useHotkey only supports single-chord keybindings. Received "${e}", but sequences are not supported by useHotkey.`)},[u,e]),d.useEffect(()=>{if(!m||t===null||u||t.key===null)return;let S=n=>{let i=C.current;n.repeat||!i?.allowInInput&&Qe(n.target)||_e(n,t)&&(i?.preventDefault!==!1&&n.preventDefault(),M.current(n))};return document.addEventListener("keydown",S),()=>{document.removeEventListener("keydown",S)}},[t,m,u])}import{jsx as le}from"react/jsx-runtime";function Me(e){let{children:o,open:a,defaultOpen:p=!1,onOpenChange:r,onOpenChangeComplete:t,hotkey:u,modal:m=!0,disabled:M,getResolvedId:C,idScope:S="surface"}=e,{store:n,focusOwnerStore:i,openChainStore:g,registerSurface:k,closeAll:b,handleOpenChange:f,disabled:c,menuTreeResolver:h}=G({onOpenChange:r,defaultOpen:p,disabled:M,closeOnOutsidePress:"pointerdown",getResolvedId:C,idScope:S});n.useControlledProp("openProp",a);let D=n.useState("open");Pe(u??"",()=>f(!n.state.open,R.imperativeAction),{enabled:!!u&&!c,allowInInput:!0});let L=v.useCallback((l,N)=>{f(l,N.reason,N.event)},[f]),P=v.useCallback(l=>{!l&&n.context.clearSearchOnClose==="after-exit"&&(n.clearSearch(),n.setInputActive(!1)),l||(n.clearHighlight(),n.context.onCloseComplete?.(),n.context.onPopupCloseComplete?.()),t?.(l)},[n,t]);return le(w,{menuTreeResolver:h,store:n,focusOwnerStore:i,openChainStore:g,disabled:c,depth:0,closeAll:b,explicitTabBehavior:!0,tabWithoutZones:"inert",registerSurface:k,menuType:"dropdown",closeOnOutsidePress:"pointerdown",componentName:"command-menu",children:le($e.Root,{open:D,onOpenChange:L,onOpenChangeComplete:P,modal:m,children:o})})}import{jsx as ze}from"react/jsx-runtime";function Ce(e){let{closeRootOnEsc:o=!0,children:a,...p}=e;return ze(ne,{closeRootOnEsc:o,...p,children:a})}import{Dialog as Je}from"@base-ui/react/dialog";import*as Se from"react";import{jsx as Xe}from"react/jsx-runtime";var fe=Se.forwardRef(function(o,a){let{disabled:p,...r}=o,t=x(),u=p||t?.disabled||!1;return Xe(Je.Trigger,{ref:a,...r,disabled:u,"data-command-menu-trigger":""})});export{ge as CommandMenu,we as CommandMenuRadioGroupValue,Le as DataListContext,ke as DataSurfaceContext,Ie as defaultGetResolvedId,Be as defineRadioGroup,Ge as isDisplayGroupNode,Oe as isDisplayRadioGroupNode,He as isDisplayRowNode,Ae as isDisplaySeparatorNode,ye as isPopupMenuNode,Te as useAsyncMenuCoordinator,ve as useDataList,he as useDataSurfaceContext,Ee as useMaybeAsyncMenuCoordinator,Ne as useMaybeDataList,De as useMaybeDataSurfaceContext,Re as useMaybeSurfaceContext,xe as useSurfaceContext};
1
+ import{a as re,d as ue}from"../chunk-LXXK4S4Q.js";import{$ as Ae,A as he,B as De,C as Le,Ca as ne,D as ve,Da as te,E as Ne,Ea as ae,F as Te,Fa as pe,G as Be,J as H,O as w,U as F,V as K,W as V,X as Z,Y as Ee,Z as Ge,_ as Oe,aa as He,ca as j,d as T,da as U,e as x,f as B,ga as Q,ha as q,ia as W,ja as _,k as E,ka as $,ma as we,o as ye,p as Ie,pa as z,q as G,qa as J,r as O,ra as X,ta as Y,ua as ee,va as oe,y as ke,z as A}from"../chunk-EDZTZHQ4.js";import{a as R,p as xe,q as Re}from"../chunk-A4Z5BY7H.js";import{a as be}from"../chunk-4C666HHU.js";var ge={};be(ge,{Backdrop:()=>se,CheckboxItem:()=>q,CheckboxItemIndicator:()=>W,Empty:()=>K,FocusZone:()=>z,Footer:()=>J,Group:()=>X,GroupLabel:()=>Z,Header:()=>Y,Icon:()=>F,Input:()=>de,Item:()=>_,LinkItem:()=>$,List:()=>j,Loading:()=>U,Popup:()=>ie,Portal:()=>ce,Root:()=>Me,Separator:()=>ee,Shortcut:()=>oe,Subpage:()=>Ce,SubpageBack:()=>te,SubpageBackItem:()=>ae,SubpageTrigger:()=>pe,Surface:()=>Q,Trigger:()=>fe});import{Dialog as Fe}from"@base-ui/react/dialog";import*as y from"react";import{jsx as Ke}from"react/jsx-runtime";var se=y.forwardRef(function(o,a){let{onPointerDown:p,...r}=o,t=x(),u=y.useCallback(m=>{p?.(m),!m.defaultPrevented&&t&&!t.disabled&&t.closeAll(R.outsidePress,m.nativeEvent)},[p,t]);return Ke(Fe.Backdrop,{ref:a,...r,onPointerDown:u,"data-command-menu-backdrop":""})});import*as me from"react";import{jsx as Ve}from"react/jsx-runtime";var de=me.forwardRef(function(o,a){let{backspaceGoesBack:p=!0,...r}=o;return Ve(V,{ref:a,backspaceGoesBack:p,...r})});import{Dialog as Ze}from"@base-ui/react/dialog";import*as s from"react";import{jsx as I,jsxs as je}from"react/jsx-runtime";var ie=s.forwardRef(function(o,a){let{children:p,className:r,render:t,...u}=o,m=s.useId(),M=T(),{subpageStackContextValue:C,isSubpageNavigating:S,hasOpenSubpage:n,subpageId:i}=O({surfaceId:m,store:M.store}),[g,k]=s.useState(null),[b,f]=s.useState(null),c=s.useCallback(P=>({...P,hasOpenSubpage:n,subpageId:i}),[n,i]),h=s.useMemo(()=>typeof r=="function"?P=>r(c(P)):r,[r,c]),D=s.useMemo(()=>typeof t=="function"?(P,l)=>t(P,c(l)):t,[t,c]),L=s.useMemo(()=>({dataSurfaceContext:g,setDataSurfaceContext:k,resolvedNodes:b,setResolvedNodes:f}),[g,b]);return I(B.Provider,{value:m,children:I(E.Provider,{value:C,children:I(A.Provider,{value:L,children:je(Ze.Popup,{ref:a,className:h,render:D,"data-command-menu-popup":"","data-navigating":S?"":void 0,"data-has-open-subpage":n?"":void 0,...u,children:[p,I(H,{})]})})})})});import{Dialog as Ue}from"@base-ui/react/dialog";var ce=Ue.Portal;import{Dialog as $e}from"@base-ui/react/dialog";import*as v from"react";import*as d from"react";function Qe(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||e instanceof HTMLElement&&e.isContentEditable}function qe(e){let o=e.key.toLowerCase();return o===" "?"space":o}function We(e,o){let a=ue(),p=o.meta||a&&o.mod,r=o.ctrl||!a&&o.mod;return e.metaKey===p&&e.ctrlKey===r&&e.altKey===o.alt&&e.shiftKey===o.shift}function _e(e,o){return o.key===qe(e)&&We(e,o)}function Pe(e,o,a){let p=d.useMemo(()=>re(e),[e]),[r]=p.chords,t=p.chords.length===1&&r!==void 0?r:null,u=p.chords.length>1,m=a?.enabled!==!1,M=d.useRef(o),C=d.useRef(a);M.current=o,C.current=a,d.useEffect(()=>{u&&process.env.NODE_ENV!=="production"&&console.warn(`useHotkey only supports single-chord keybindings. Received "${e}", but sequences are not supported by useHotkey.`)},[u,e]),d.useEffect(()=>{if(!m||t===null||u||t.key===null)return;let S=n=>{let i=C.current;n.repeat||!i?.allowInInput&&Qe(n.target)||_e(n,t)&&(i?.preventDefault!==!1&&n.preventDefault(),M.current(n))};return document.addEventListener("keydown",S),()=>{document.removeEventListener("keydown",S)}},[t,m,u])}import{jsx as le}from"react/jsx-runtime";function Me(e){let{children:o,open:a,defaultOpen:p=!1,onOpenChange:r,onOpenChangeComplete:t,hotkey:u,modal:m=!0,disabled:M,getResolvedId:C,idScope:S="surface"}=e,{store:n,focusOwnerStore:i,openChainStore:g,registerSurface:k,closeAll:b,handleOpenChange:f,disabled:c,menuTreeResolver:h}=G({onOpenChange:r,defaultOpen:p,disabled:M,closeOnOutsidePress:"pointerdown",getResolvedId:C,idScope:S});n.useControlledProp("openProp",a);let D=n.useState("open");Pe(u??"",()=>f(!n.state.open,R.imperativeAction),{enabled:!!u&&!c,allowInInput:!0});let L=v.useCallback((l,N)=>{f(l,N.reason,N.event)},[f]),P=v.useCallback(l=>{!l&&n.context.clearSearchOnClose==="after-exit"&&(n.clearSearch(),n.setInputActive(!1)),l||(n.clearHighlight(),n.context.onCloseComplete?.(),n.context.onPopupCloseComplete?.()),t?.(l)},[n,t]);return le(w,{menuTreeResolver:h,store:n,focusOwnerStore:i,openChainStore:g,disabled:c,depth:0,closeAll:b,explicitTabBehavior:!0,tabWithoutZones:"inert",registerSurface:k,menuType:"dropdown",closeOnOutsidePress:"pointerdown",componentName:"command-menu",children:le($e.Root,{open:D,onOpenChange:L,onOpenChangeComplete:P,modal:m,children:o})})}import{jsx as ze}from"react/jsx-runtime";function Ce(e){let{closeRootOnEsc:o=!0,children:a,...p}=e;return ze(ne,{closeRootOnEsc:o,...p,children:a})}import{Dialog as Je}from"@base-ui/react/dialog";import*as Se from"react";import{jsx as Xe}from"react/jsx-runtime";var fe=Se.forwardRef(function(o,a){let{disabled:p,...r}=o,t=x(),u=p||t?.disabled||!1;return Xe(Je.Trigger,{ref:a,...r,disabled:u,"data-command-menu-trigger":""})});export{ge as CommandMenu,we as CommandMenuRadioGroupValue,Le as DataListContext,ke as DataSurfaceContext,Ie as defaultGetResolvedId,Ee as defineRadioGroup,Ge as isDisplayGroupNode,Oe as isDisplayRadioGroupNode,He as isDisplayRowNode,Ae as isDisplaySeparatorNode,ye as isPopupMenuNode,Te as useAsyncMenuCoordinator,ve as useDataList,he as useDataSurfaceContext,Be as useMaybeAsyncMenuCoordinator,Ne as useMaybeDataList,De as useMaybeDataSurfaceContext,Re as useMaybeSurfaceContext,xe as useSurfaceContext};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkZ2RGBRJPcjs = require('../chunk-Z2RGBRJP.cjs');var _chunkXMZZ62VJcjs = require('../chunk-XMZZ62VJ.cjs');var _chunkM4G6J7DPcjs = require('../chunk-M4G6J7DP.cjs');var He={};_chunkM4G6J7DPcjs.a.call(void 0, He,{Arrow:()=>_chunkZ2RGBRJPcjs.s,Backdrop:()=>_chunkZ2RGBRJPcjs.t,CheckboxItem:()=>_chunkZ2RGBRJPcjs.ha,CheckboxItemIndicator:()=>_chunkZ2RGBRJPcjs.ia,Empty:()=>_chunkZ2RGBRJPcjs.V,FocusZone:()=>_chunkZ2RGBRJPcjs.pa,Footer:()=>_chunkZ2RGBRJPcjs.qa,Group:()=>_chunkZ2RGBRJPcjs.ra,GroupLabel:()=>_chunkZ2RGBRJPcjs.X,GroupValue:()=>_chunkZ2RGBRJPcjs.sa,Header:()=>_chunkZ2RGBRJPcjs.ta,Icon:()=>_chunkZ2RGBRJPcjs.U,Input:()=>_chunkZ2RGBRJPcjs.W,Item:()=>_chunkZ2RGBRJPcjs.ja,LinkItem:()=>_chunkZ2RGBRJPcjs.ka,List:()=>_chunkZ2RGBRJPcjs.ca,Popup:()=>_chunkZ2RGBRJPcjs.K,Portal:()=>_chunkZ2RGBRJPcjs.L,Positioner:()=>_chunkZ2RGBRJPcjs.N,RadioGroup:()=>_chunkZ2RGBRJPcjs.la,RadioGroupValue:()=>_chunkZ2RGBRJPcjs.ma,RadioItem:()=>_chunkZ2RGBRJPcjs.na,RadioItemIndicator:()=>_chunkZ2RGBRJPcjs.oa,Root:()=>Ee,ScrollDownArrow:()=>_chunkZ2RGBRJPcjs.fa,ScrollUpArrow:()=>_chunkZ2RGBRJPcjs.ea,Separator:()=>_chunkZ2RGBRJPcjs.ua,Shortcut:()=>_chunkZ2RGBRJPcjs.va,Submenu:()=>_chunkZ2RGBRJPcjs.za,SubmenuTrigger:()=>_chunkZ2RGBRJPcjs.Ba,SubmenuTriggerIndicator:()=>_chunkZ2RGBRJPcjs.Aa,Subpage:()=>_chunkZ2RGBRJPcjs.Ca,SubpageBack:()=>_chunkZ2RGBRJPcjs.Da,SubpageBackItem:()=>_chunkZ2RGBRJPcjs.Ea,SubpageTrigger:()=>_chunkZ2RGBRJPcjs.Fa,Surface:()=>_chunkZ2RGBRJPcjs.ga,Tree:()=>_chunkZ2RGBRJPcjs.wa,TreeConnector:()=>_chunkZ2RGBRJPcjs.xa,TreeItem:()=>_chunkZ2RGBRJPcjs.ya,Trigger:()=>Ve,useAsyncMenuCoordinator:()=>_chunkZ2RGBRJPcjs.F,useDataList:()=>_chunkZ2RGBRJPcjs.D,useMaybeAsyncMenuCoordinator:()=>_chunkZ2RGBRJPcjs.G,useMaybeDataList:()=>_chunkZ2RGBRJPcjs.E});var _popover = require('@base-ui/react/popover');var _react = require('react'); var u = _interopRequireWildcard(_react); var a = _interopRequireWildcard(_react);var _jsxruntime = require('react/jsx-runtime');var we=u.createContext(null);function Oe(){let d=u.useContext(we);if(!d)throw new Error("ContextMenu components must be used within a ContextMenu.Root");return d}function Le(d,i,p=!1){let o=p?10:0;return{getBoundingClientRect(){return DOMRect.fromRect({width:o,height:o,x:d,y:i})}}}function Ee(d){let{open:i,onOpenChange:p,defaultOpen:o=!1,virtualized:m=!1,items:n,onHighlightChange:e,disabled:P=!1,modal:v=!0,closeOnOutsidePress:b="pointerdown",onOpenChangeComplete:f,actionsRef:R,getResolvedId:r,idScope:E="surface",debug:C,children:h}=d,{store:l,focusOwnerStore:z,openChainStore:M,registerSurface:G,closeAll:I,virtualization:S,handleOpenChange:s,disabled:c,setDisabled:L,menuTreeResolver:V}=_chunkZ2RGBRJPcjs.q.call(void 0, {onOpenChange:p,defaultOpen:o,virtualized:m,items:n,onHighlightChange:e,closeOnOutsidePress:b,disabled:P,getResolvedId:r,idScope:E}),k=u.useRef(null);u.useImperativeHandle(R,()=>({close:()=>{_optionalChain([k, 'access', _2 => _2.current, 'optionalAccess', _3 => _3.close, 'call', _4 => _4()])},unmount:()=>{_optionalChain([k, 'access', _5 => _5.current, 'optionalAccess', _6 => _6.unmount, 'call', _7 => _7()])},setDisabled:L}),[L]),l.useControlledProp("openProp",i);let y=l.useState("open"),[H,F]=u.useState(()=>Le(0,0)),t=u.useCallback((g,O,so=!1)=>{F(Le(g,O,so))},[]),x=u.useCallback(()=>{c||l.setOpen(!0)},[l,c]),T=u.useCallback(()=>{s(!1)},[s]),w=u.useCallback(g=>{!g&&l.context.clearSearchOnClose==="after-exit"&&(l.clearSearch(),l.setInputActive(!1)),g||(l.clearHighlight(),_optionalChain([l, 'access', _8 => _8.context, 'access', _9 => _9.onCloseComplete, 'optionalCall', _10 => _10()]),_optionalChain([l, 'access', _11 => _11.context, 'access', _12 => _12.onPopupCloseComplete, 'optionalCall', _13 => _13()])),_optionalChain([f, 'optionalCall', _14 => _14(g)])},[l,f]),_=u.useCallback((g,O)=>{s(g,O.reason,O.event)},[s]),ro=u.useMemo(()=>({setAnchorPosition:t,openMenu:x,closeMenu:T,disabled:c,open:y}),[t,x,T,c,y]);return _jsxruntime.jsx.call(void 0, we.Provider,{value:ro,children:_jsxruntime.jsx.call(void 0, _chunkZ2RGBRJPcjs.O,{menuTreeResolver:V,store:l,focusOwnerStore:z,openChainStore:M,disabled:c,depth:0,closeAll:I,explicitTabBehavior:!0,registerSurface:G,virtualization:S,virtualAnchor:H,menuType:"context",closeOnOutsidePress:b,componentName:"context-menu",debug:C,children:_jsxruntime.jsx.call(void 0, _popover.Popover.Root,{open:y,onOpenChange:_,onOpenChangeComplete:w,modal:v,actionsRef:R?k:void 0,children:h})})})}var _userender = require('@base-ui/react/use-render');var X=(m=>(m.slot="bazzaui-context-menu-trigger",m.popupOpen="data-popup-open",m.pressed="data-pressed",m.disabled="data-disabled",m))(X||{});var Zo=500,Yo=10,Xo={open:d=>d?{"data-popup-open":""}:null,pressed:d=>d?{"data-pressed":""}:null,disabled:d=>d?{"data-disabled":""}:null},Ve=a.forwardRef(function(i,p){let{disabled:o=!1,render:m,className:n,style:e,onContextMenu:P,onTouchStart:v,onTouchMove:b,onTouchEnd:f,onTouchCancel:R,children:r,...E}=i,{setAnchorPosition:C,openMenu:h,disabled:l,open:z}=Oe(),M=o||l,[G,I]=a.useState(!1),S=a.useRef(null),s=a.useRef(null),c=a.useCallback(()=>{S.current&&(clearTimeout(S.current),S.current=null),I(!1)},[]);a.useEffect(()=>()=>{c()},[c]);let L=a.useCallback(t=>{_optionalChain([P, 'optionalCall', _15 => _15(t)]),!t.defaultPrevented&&(M||(t.preventDefault(),C(t.clientX,t.clientY,!1),h()))},[P,M,C,h]),V=a.useCallback(t=>{if(_optionalChain([v, 'optionalCall', _16 => _16(t)]),t.defaultPrevented||M)return;let x=t.touches[0];x&&(s.current={x:x.clientX,y:x.clientY},I(!0),S.current=setTimeout(()=>{s.current&&(C(s.current.x,s.current.y,!0),h(),I(!1),s.current=null)},Zo))},[v,M,C,h]),k=a.useCallback(t=>{if(_optionalChain([b, 'optionalCall', _17 => _17(t)]),!s.current)return;let x=t.touches[0];if(!x)return;let T=x.clientX-s.current.x,w=x.clientY-s.current.y;Math.sqrt(T*T+w*w)>Yo&&(c(),s.current=null)},[b,c]),y=a.useCallback(t=>{_optionalChain([f, 'optionalCall', _18 => _18(t)]),c(),s.current=null},[f,c]),H=a.useCallback(t=>{_optionalChain([R, 'optionalCall', _19 => _19(t)]),c(),s.current=null},[R,c]),F=a.useMemo(()=>({open:z,pressed:G,disabled:M}),[z,G,M]);return _userender.useRender.call(void 0, {render:m,ref:p,state:F,stateAttributesMapping:Xo,props:{...E,"bazzaui-context-menu-trigger":"",onContextMenu:L,onTouchStart:V,onTouchMove:k,onTouchEnd:y,onTouchCancel:H,className:n,style:{WebkitTouchCallout:"none",WebkitUserSelect:"none",userSelect:"none",...e},children:r},defaultTagName:"div"})});var Fe=(e=>(e.slot="bazzaui-context-menu-arrow",e.open="data-open",e.closed="data-closed",e.side="data-side",e.align="data-align",e.uncentered="data-uncentered",e))(Fe||{});var Ne=(n=>(n.slot="bazzaui-context-menu-backdrop",n.open="data-open",n.closed="data-closed",n.startingStyle="data-starting-style",n.endingStyle="data-ending-style",n))(Ne||{});var Be=(n=>(n.slot="bazzaui-context-menu-checkbox-item",n.checked="data-checked",n.unchecked="data-unchecked",n.highlighted="data-highlighted",n.disabled="data-disabled",n))(Be||{}),je= exports.ContextMenuCheckboxItemIndicatorDataAttributes =(o=>(o.slot="bazzaui-context-menu-checkbox-item-indicator",o.checked="data-checked",o.unchecked="data-unchecked",o))(je||{});var Ue=(i=>(i.slot="bazzaui-context-menu-empty",i))(Ue||{});var Ze=(i=>(i.slot="bazzaui-context-menu-group",i))(Ze||{});var Ye=(i=>(i.slot="bazzaui-context-menu-group-label",i))(Ye||{});var _o={slot:"bazzaui-context-menu-icon",open:"data-popup-open"};var Xe=(o=>(o.slot="bazzaui-context-menu-input",o.open="data-open",o.closed="data-closed",o))(Xe||{});var _e=(o=>(o.slot="bazzaui-context-menu-item",o.highlighted="data-highlighted",o.disabled="data-disabled",o))(_e||{});var We=(P=>(P.slot="bazzaui-context-menu-link-item",P.highlighted="data-highlighted",P.disabled="data-disabled",P.first="data-first",P.last="data-last",P.firstInGroup="data-first-in-group",P.lastInGroup="data-last-in-group",P))(We||{});var qe=(p=>(p.slot="bazzaui-context-menu-list",p.list="data-popup-menu-list",p))(qe||{});var Qe=(r=>(r.slot="bazzaui-context-menu-popup",r.open="data-open",r.closed="data-closed",r.side="data-side",r.align="data-align",r.startingStyle="data-starting-style",r.endingStyle="data-ending-style",r.instant="data-instant",r.focused="data-focused",r.hasOpenSubmenu="data-has-open-submenu",r.submenu="data-submenu",r.navigating="data-navigating",r))(Qe||{});var Je=(e=>(e.slot="bazzaui-context-menu-positioner",e.open="data-open",e.closed="data-closed",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e))(Je||{});var Ke=(p=>(p.slot="bazzaui-context-menu-radio-group",p.disabled="data-disabled",p))(Ke||{});var $e=(n=>(n.slot="bazzaui-context-menu-radio-item",n.checked="data-checked",n.unchecked="data-unchecked",n.highlighted="data-highlighted",n.disabled="data-disabled",n))($e||{}),De= exports.ContextMenuRadioItemIndicatorDataAttributes =(o=>(o.slot="bazzaui-context-menu-radio-item-indicator",o.checked="data-checked",o.unchecked="data-unchecked",o))(De||{});var Wo={slotUp:"bazzaui-context-menu-scroll-up-arrow",slotDown:"bazzaui-context-menu-scroll-down-arrow",direction:"data-direction",side:"data-side"};var Ae=(i=>(i.slot="bazzaui-context-menu-separator",i))(Ae||{});var eo=(p=>(p.slot="bazzaui-context-menu-shortcut",p.highlighted="data-highlighted",p))(eo||{});var oo=(e=>(e.slot="bazzaui-context-menu-submenu-trigger",e.submenuTrigger="data-submenu-trigger",e.popupOpen="data-popup-open",e.popupFocused="data-popup-focused",e.highlighted="data-highlighted",e.disabled="data-disabled",e))(oo||{}),no= exports.ContextMenuSubmenuTriggerIndicatorDataAttributes =(p=>(p.slot="bazzaui-context-menu-submenu-trigger-indicator",p.popupOpen="data-popup-open",p))(no||{});var to=(o=>(o.slot="bazzaui-context-menu-subpage-back",o.canGoBack="data-can-go-back",o.disabled="data-disabled",o))(to||{});var uo=(m=>(m.slot="bazzaui-context-menu-subpage-back-item",m.subpageBackItem="data-subpage-back-item",m.highlighted="data-highlighted",m.disabled="data-disabled",m))(uo||{});var ao=(e=>(e.slot="bazzaui-context-menu-subpage-trigger",e.subpageTrigger="data-subpage-trigger",e.popupOpen="data-popup-open",e.popupFocused="data-popup-focused",e.highlighted="data-highlighted",e.disabled="data-disabled",e))(ao||{});var po=(i=>(i.slot="bazzaui-context-menu-surface",i))(po||{});exports.ContextMenu = He; exports.ContextMenuArrowDataAttributes = Fe; exports.ContextMenuBackdropDataAttributes = Ne; exports.ContextMenuCheckboxItemDataAttributes = Be; exports.ContextMenuCheckboxItemIndicatorDataAttributes = je; exports.ContextMenuEmptyDataAttributes = Ue; exports.ContextMenuGroupDataAttributes = Ze; exports.ContextMenuGroupLabelDataAttributes = Ye; exports.ContextMenuIconDataAttributes = _o; exports.ContextMenuInputDataAttributes = Xe; exports.ContextMenuItemDataAttributes = _e; exports.ContextMenuLinkItemDataAttributes = We; exports.ContextMenuListCssVars = _chunkZ2RGBRJPcjs.ba; exports.ContextMenuListDataAttributes = qe; exports.ContextMenuPopupDataAttributes = Qe; exports.ContextMenuPositionerCssVars = _chunkZ2RGBRJPcjs.M; exports.ContextMenuPositionerDataAttributes = Je; exports.ContextMenuRadioGroupDataAttributes = Ke; exports.ContextMenuRadioGroupValue = _chunkZ2RGBRJPcjs.ma; exports.ContextMenuRadioItemDataAttributes = $e; exports.ContextMenuRadioItemIndicatorDataAttributes = De; exports.ContextMenuScrollArrowDataAttributes = Wo; exports.ContextMenuSeparatorDataAttributes = Ae; exports.ContextMenuShortcutDataAttributes = eo; exports.ContextMenuStore = _chunkXMZZ62VJcjs.y; exports.ContextMenuSubmenuTriggerDataAttributes = oo; exports.ContextMenuSubmenuTriggerIndicatorDataAttributes = no; exports.ContextMenuSubpageBackDataAttributes = to; exports.ContextMenuSubpageBackItemDataAttributes = uo; exports.ContextMenuSubpageTriggerDataAttributes = ao; exports.ContextMenuSurfaceDataAttributes = po; exports.ContextMenuTriggerDataAttributes = X; exports.DataListContext = _chunkZ2RGBRJPcjs.C; exports.DataSurfaceContext = _chunkZ2RGBRJPcjs.y; exports.commandScore = _chunkXMZZ62VJcjs.w; exports.defaultFilter = _chunkXMZZ62VJcjs.x; exports.defaultGetResolvedId = _chunkZ2RGBRJPcjs.p; exports.defineRadioGroup = _chunkZ2RGBRJPcjs.Y; exports.isDisplayGroupNode = _chunkZ2RGBRJPcjs.Z; exports.isDisplayRadioGroupNode = _chunkZ2RGBRJPcjs._; exports.isDisplayRowNode = _chunkZ2RGBRJPcjs.aa; exports.isPopupMenuNode = _chunkZ2RGBRJPcjs.o; exports.isTreeItemDef = _chunkZ2RGBRJPcjs.I; exports.useAsyncMenuCoordinator = _chunkZ2RGBRJPcjs.F; exports.useDataList = _chunkZ2RGBRJPcjs.D; exports.useDataSurfaceContext = _chunkZ2RGBRJPcjs.A; exports.useItem = _chunkZ2RGBRJPcjs.P; exports.useItemContext = _chunkXMZZ62VJcjs.g; exports.useMaybeAsyncMenuCoordinator = _chunkZ2RGBRJPcjs.G; exports.useMaybeDataList = _chunkZ2RGBRJPcjs.E; exports.useMaybeDataSurfaceContext = _chunkZ2RGBRJPcjs.B; exports.useMaybeItemContext = _chunkXMZZ62VJcjs.h; exports.useMaybeRootContext = _chunkZ2RGBRJPcjs.e; exports.useMaybeSubmenuContext = _chunkZ2RGBRJPcjs.h; exports.useMaybeSubpageContext = _chunkZ2RGBRJPcjs.j; exports.useMaybeSubpageStack = _chunkZ2RGBRJPcjs.m; exports.useMaybeSurfaceContext = _chunkXMZZ62VJcjs.q; exports.useRootContext = _chunkZ2RGBRJPcjs.d; exports.useSubmenuContext = _chunkZ2RGBRJPcjs.g; exports.useSubpageContext = _chunkZ2RGBRJPcjs.i; exports.useSubpageStack = _chunkZ2RGBRJPcjs.l; exports.useSurfaceContext = _chunkXMZZ62VJcjs.p;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkBEWVWSAWcjs = require('../chunk-BEWVWSAW.cjs');var _chunkXMZZ62VJcjs = require('../chunk-XMZZ62VJ.cjs');var _chunkM4G6J7DPcjs = require('../chunk-M4G6J7DP.cjs');var He={};_chunkM4G6J7DPcjs.a.call(void 0, He,{Arrow:()=>_chunkBEWVWSAWcjs.s,Backdrop:()=>_chunkBEWVWSAWcjs.t,CheckboxItem:()=>_chunkBEWVWSAWcjs.ha,CheckboxItemIndicator:()=>_chunkBEWVWSAWcjs.ia,Empty:()=>_chunkBEWVWSAWcjs.V,FocusZone:()=>_chunkBEWVWSAWcjs.pa,Footer:()=>_chunkBEWVWSAWcjs.qa,Group:()=>_chunkBEWVWSAWcjs.ra,GroupLabel:()=>_chunkBEWVWSAWcjs.X,GroupValue:()=>_chunkBEWVWSAWcjs.sa,Header:()=>_chunkBEWVWSAWcjs.ta,Icon:()=>_chunkBEWVWSAWcjs.U,Input:()=>_chunkBEWVWSAWcjs.W,Item:()=>_chunkBEWVWSAWcjs.ja,LinkItem:()=>_chunkBEWVWSAWcjs.ka,List:()=>_chunkBEWVWSAWcjs.ca,Popup:()=>_chunkBEWVWSAWcjs.K,Portal:()=>_chunkBEWVWSAWcjs.L,Positioner:()=>_chunkBEWVWSAWcjs.N,RadioGroup:()=>_chunkBEWVWSAWcjs.la,RadioGroupValue:()=>_chunkBEWVWSAWcjs.ma,RadioItem:()=>_chunkBEWVWSAWcjs.na,RadioItemIndicator:()=>_chunkBEWVWSAWcjs.oa,Root:()=>Ee,ScrollDownArrow:()=>_chunkBEWVWSAWcjs.fa,ScrollUpArrow:()=>_chunkBEWVWSAWcjs.ea,Separator:()=>_chunkBEWVWSAWcjs.ua,Shortcut:()=>_chunkBEWVWSAWcjs.va,Submenu:()=>_chunkBEWVWSAWcjs.za,SubmenuTrigger:()=>_chunkBEWVWSAWcjs.Ba,SubmenuTriggerIndicator:()=>_chunkBEWVWSAWcjs.Aa,Subpage:()=>_chunkBEWVWSAWcjs.Ca,SubpageBack:()=>_chunkBEWVWSAWcjs.Da,SubpageBackItem:()=>_chunkBEWVWSAWcjs.Ea,SubpageTrigger:()=>_chunkBEWVWSAWcjs.Fa,Surface:()=>_chunkBEWVWSAWcjs.ga,Tree:()=>_chunkBEWVWSAWcjs.wa,TreeConnector:()=>_chunkBEWVWSAWcjs.xa,TreeItem:()=>_chunkBEWVWSAWcjs.ya,Trigger:()=>Ve,useAsyncMenuCoordinator:()=>_chunkBEWVWSAWcjs.F,useDataList:()=>_chunkBEWVWSAWcjs.D,useMaybeAsyncMenuCoordinator:()=>_chunkBEWVWSAWcjs.G,useMaybeDataList:()=>_chunkBEWVWSAWcjs.E});var _popover = require('@base-ui/react/popover');var _react = require('react'); var u = _interopRequireWildcard(_react); var a = _interopRequireWildcard(_react);var _jsxruntime = require('react/jsx-runtime');var we=u.createContext(null);function Oe(){let d=u.useContext(we);if(!d)throw new Error("ContextMenu components must be used within a ContextMenu.Root");return d}function Le(d,i,p=!1){let o=p?10:0;return{getBoundingClientRect(){return DOMRect.fromRect({width:o,height:o,x:d,y:i})}}}function Ee(d){let{open:i,onOpenChange:p,defaultOpen:o=!1,virtualized:m=!1,items:n,onHighlightChange:e,disabled:P=!1,modal:v=!0,closeOnOutsidePress:b="pointerdown",onOpenChangeComplete:f,actionsRef:R,getResolvedId:r,idScope:E="surface",debug:h,children:C}=d,{store:l,focusOwnerStore:z,openChainStore:M,registerSurface:G,closeAll:I,virtualization:S,handleOpenChange:s,disabled:c,setDisabled:L,menuTreeResolver:V}=_chunkBEWVWSAWcjs.q.call(void 0, {onOpenChange:p,defaultOpen:o,virtualized:m,items:n,onHighlightChange:e,closeOnOutsidePress:b,disabled:P,getResolvedId:r,idScope:E}),k=u.useRef(null);u.useImperativeHandle(R,()=>({close:()=>{_optionalChain([k, 'access', _2 => _2.current, 'optionalAccess', _3 => _3.close, 'call', _4 => _4()])},unmount:()=>{_optionalChain([k, 'access', _5 => _5.current, 'optionalAccess', _6 => _6.unmount, 'call', _7 => _7()])},setDisabled:L}),[L]),l.useControlledProp("openProp",i);let y=l.useState("open"),[H,F]=u.useState(()=>Le(0,0)),t=u.useCallback((g,O,so=!1)=>{F(Le(g,O,so))},[]),x=u.useCallback(()=>{c||l.setOpen(!0)},[l,c]),T=u.useCallback(()=>{s(!1)},[s]),w=u.useCallback(g=>{!g&&l.context.clearSearchOnClose==="after-exit"&&(l.clearSearch(),l.setInputActive(!1)),g||(l.clearHighlight(),_optionalChain([l, 'access', _8 => _8.context, 'access', _9 => _9.onCloseComplete, 'optionalCall', _10 => _10()]),_optionalChain([l, 'access', _11 => _11.context, 'access', _12 => _12.onPopupCloseComplete, 'optionalCall', _13 => _13()])),_optionalChain([f, 'optionalCall', _14 => _14(g)])},[l,f]),_=u.useCallback((g,O)=>{s(g,O.reason,O.event)},[s]),ro=u.useMemo(()=>({setAnchorPosition:t,openMenu:x,closeMenu:T,disabled:c,open:y}),[t,x,T,c,y]);return _jsxruntime.jsx.call(void 0, we.Provider,{value:ro,children:_jsxruntime.jsx.call(void 0, _chunkBEWVWSAWcjs.O,{menuTreeResolver:V,store:l,focusOwnerStore:z,openChainStore:M,disabled:c,depth:0,closeAll:I,explicitTabBehavior:!0,registerSurface:G,virtualization:S,virtualAnchor:H,menuType:"context",closeOnOutsidePress:b,componentName:"context-menu",debug:h,children:_jsxruntime.jsx.call(void 0, _popover.Popover.Root,{open:y,onOpenChange:_,onOpenChangeComplete:w,modal:v,actionsRef:R?k:void 0,children:C})})})}var _userender = require('@base-ui/react/use-render');var X=(m=>(m.slot="bazzaui-context-menu-trigger",m.popupOpen="data-popup-open",m.pressed="data-pressed",m.disabled="data-disabled",m))(X||{});var Zo=500,Yo=10,Xo={open:d=>d?{"data-popup-open":""}:null,pressed:d=>d?{"data-pressed":""}:null,disabled:d=>d?{"data-disabled":""}:null},Ve=a.forwardRef(function(i,p){let{disabled:o=!1,render:m,className:n,style:e,onContextMenu:P,onTouchStart:v,onTouchMove:b,onTouchEnd:f,onTouchCancel:R,children:r,...E}=i,{setAnchorPosition:h,openMenu:C,disabled:l,open:z}=Oe(),M=o||l,[G,I]=a.useState(!1),S=a.useRef(null),s=a.useRef(null),c=a.useCallback(()=>{S.current&&(clearTimeout(S.current),S.current=null),I(!1)},[]);a.useEffect(()=>()=>{c()},[c]);let L=a.useCallback(t=>{_optionalChain([P, 'optionalCall', _15 => _15(t)]),!t.defaultPrevented&&(M||(t.preventDefault(),h(t.clientX,t.clientY,!1),C()))},[P,M,h,C]),V=a.useCallback(t=>{if(_optionalChain([v, 'optionalCall', _16 => _16(t)]),t.defaultPrevented||M)return;let x=t.touches[0];x&&(s.current={x:x.clientX,y:x.clientY},I(!0),S.current=setTimeout(()=>{s.current&&(h(s.current.x,s.current.y,!0),C(),I(!1),s.current=null)},Zo))},[v,M,h,C]),k=a.useCallback(t=>{if(_optionalChain([b, 'optionalCall', _17 => _17(t)]),!s.current)return;let x=t.touches[0];if(!x)return;let T=x.clientX-s.current.x,w=x.clientY-s.current.y;Math.sqrt(T*T+w*w)>Yo&&(c(),s.current=null)},[b,c]),y=a.useCallback(t=>{_optionalChain([f, 'optionalCall', _18 => _18(t)]),c(),s.current=null},[f,c]),H=a.useCallback(t=>{_optionalChain([R, 'optionalCall', _19 => _19(t)]),c(),s.current=null},[R,c]),F=a.useMemo(()=>({open:z,pressed:G,disabled:M}),[z,G,M]);return _userender.useRender.call(void 0, {render:m,ref:p,state:F,stateAttributesMapping:Xo,props:{...E,"bazzaui-context-menu-trigger":"",onContextMenu:L,onTouchStart:V,onTouchMove:k,onTouchEnd:y,onTouchCancel:H,className:n,style:{WebkitTouchCallout:"none",WebkitUserSelect:"none",userSelect:"none",...e},children:r},defaultTagName:"div"})});var Fe=(e=>(e.slot="bazzaui-context-menu-arrow",e.open="data-open",e.closed="data-closed",e.side="data-side",e.align="data-align",e.uncentered="data-uncentered",e))(Fe||{});var Be=(n=>(n.slot="bazzaui-context-menu-backdrop",n.open="data-open",n.closed="data-closed",n.startingStyle="data-starting-style",n.endingStyle="data-ending-style",n))(Be||{});var Ne=(n=>(n.slot="bazzaui-context-menu-checkbox-item",n.checked="data-checked",n.unchecked="data-unchecked",n.highlighted="data-highlighted",n.disabled="data-disabled",n))(Ne||{}),je= exports.ContextMenuCheckboxItemIndicatorDataAttributes =(o=>(o.slot="bazzaui-context-menu-checkbox-item-indicator",o.checked="data-checked",o.unchecked="data-unchecked",o))(je||{});var Ue=(i=>(i.slot="bazzaui-context-menu-empty",i))(Ue||{});var Ze=(i=>(i.slot="bazzaui-context-menu-group",i))(Ze||{});var Ye=(i=>(i.slot="bazzaui-context-menu-group-label",i))(Ye||{});var _o={slot:"bazzaui-context-menu-icon",open:"data-popup-open"};var Xe=(o=>(o.slot="bazzaui-context-menu-input",o.open="data-open",o.closed="data-closed",o))(Xe||{});var _e=(o=>(o.slot="bazzaui-context-menu-item",o.highlighted="data-highlighted",o.disabled="data-disabled",o))(_e||{});var We=(P=>(P.slot="bazzaui-context-menu-link-item",P.highlighted="data-highlighted",P.disabled="data-disabled",P.first="data-first",P.last="data-last",P.firstInGroup="data-first-in-group",P.lastInGroup="data-last-in-group",P))(We||{});var qe=(p=>(p.slot="bazzaui-context-menu-list",p.list="data-popup-menu-list",p))(qe||{});var Qe=(r=>(r.slot="bazzaui-context-menu-popup",r.open="data-open",r.closed="data-closed",r.side="data-side",r.align="data-align",r.startingStyle="data-starting-style",r.endingStyle="data-ending-style",r.instant="data-instant",r.focused="data-focused",r.hasOpenSubmenu="data-has-open-submenu",r.submenu="data-submenu",r.navigating="data-navigating",r))(Qe||{});var Je=(e=>(e.slot="bazzaui-context-menu-positioner",e.open="data-open",e.closed="data-closed",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e))(Je||{});var Ke=(p=>(p.slot="bazzaui-context-menu-radio-group",p.disabled="data-disabled",p))(Ke||{});var $e=(n=>(n.slot="bazzaui-context-menu-radio-item",n.checked="data-checked",n.unchecked="data-unchecked",n.highlighted="data-highlighted",n.disabled="data-disabled",n))($e||{}),De= exports.ContextMenuRadioItemIndicatorDataAttributes =(o=>(o.slot="bazzaui-context-menu-radio-item-indicator",o.checked="data-checked",o.unchecked="data-unchecked",o))(De||{});var Wo={slotUp:"bazzaui-context-menu-scroll-up-arrow",slotDown:"bazzaui-context-menu-scroll-down-arrow",direction:"data-direction",side:"data-side"};var Ae=(i=>(i.slot="bazzaui-context-menu-separator",i))(Ae||{});var eo=(p=>(p.slot="bazzaui-context-menu-shortcut",p.highlighted="data-highlighted",p))(eo||{});var oo=(e=>(e.slot="bazzaui-context-menu-submenu-trigger",e.submenuTrigger="data-submenu-trigger",e.popupOpen="data-popup-open",e.popupFocused="data-popup-focused",e.highlighted="data-highlighted",e.disabled="data-disabled",e))(oo||{}),no= exports.ContextMenuSubmenuTriggerIndicatorDataAttributes =(p=>(p.slot="bazzaui-context-menu-submenu-trigger-indicator",p.popupOpen="data-popup-open",p))(no||{});var to=(o=>(o.slot="bazzaui-context-menu-subpage-back",o.canGoBack="data-can-go-back",o.disabled="data-disabled",o))(to||{});var uo=(m=>(m.slot="bazzaui-context-menu-subpage-back-item",m.subpageBackItem="data-subpage-back-item",m.highlighted="data-highlighted",m.disabled="data-disabled",m))(uo||{});var ao=(e=>(e.slot="bazzaui-context-menu-subpage-trigger",e.subpageTrigger="data-subpage-trigger",e.popupOpen="data-popup-open",e.popupFocused="data-popup-focused",e.highlighted="data-highlighted",e.disabled="data-disabled",e))(ao||{});var po=(i=>(i.slot="bazzaui-context-menu-surface",i))(po||{});exports.ContextMenu = He; exports.ContextMenuArrowDataAttributes = Fe; exports.ContextMenuBackdropDataAttributes = Be; exports.ContextMenuCheckboxItemDataAttributes = Ne; exports.ContextMenuCheckboxItemIndicatorDataAttributes = je; exports.ContextMenuEmptyDataAttributes = Ue; exports.ContextMenuGroupDataAttributes = Ze; exports.ContextMenuGroupLabelDataAttributes = Ye; exports.ContextMenuIconDataAttributes = _o; exports.ContextMenuInputDataAttributes = Xe; exports.ContextMenuItemDataAttributes = _e; exports.ContextMenuLinkItemDataAttributes = We; exports.ContextMenuListCssVars = _chunkBEWVWSAWcjs.ba; exports.ContextMenuListDataAttributes = qe; exports.ContextMenuPopupDataAttributes = Qe; exports.ContextMenuPositionerCssVars = _chunkBEWVWSAWcjs.M; exports.ContextMenuPositionerDataAttributes = Je; exports.ContextMenuRadioGroupDataAttributes = Ke; exports.ContextMenuRadioGroupValue = _chunkBEWVWSAWcjs.ma; exports.ContextMenuRadioItemDataAttributes = $e; exports.ContextMenuRadioItemIndicatorDataAttributes = De; exports.ContextMenuScrollArrowDataAttributes = Wo; exports.ContextMenuSeparatorDataAttributes = Ae; exports.ContextMenuShortcutDataAttributes = eo; exports.ContextMenuStore = _chunkXMZZ62VJcjs.y; exports.ContextMenuSubmenuTriggerDataAttributes = oo; exports.ContextMenuSubmenuTriggerIndicatorDataAttributes = no; exports.ContextMenuSubpageBackDataAttributes = to; exports.ContextMenuSubpageBackItemDataAttributes = uo; exports.ContextMenuSubpageTriggerDataAttributes = ao; exports.ContextMenuSurfaceDataAttributes = po; exports.ContextMenuTriggerDataAttributes = X; exports.DataListContext = _chunkBEWVWSAWcjs.C; exports.DataSurfaceContext = _chunkBEWVWSAWcjs.y; exports.commandScore = _chunkXMZZ62VJcjs.w; exports.defaultFilter = _chunkXMZZ62VJcjs.x; exports.defaultGetResolvedId = _chunkBEWVWSAWcjs.p; exports.defineRadioGroup = _chunkBEWVWSAWcjs.Y; exports.isDisplayGroupNode = _chunkBEWVWSAWcjs.Z; exports.isDisplayRadioGroupNode = _chunkBEWVWSAWcjs._; exports.isDisplayRowNode = _chunkBEWVWSAWcjs.aa; exports.isPopupMenuNode = _chunkBEWVWSAWcjs.o; exports.isTreeItemDef = _chunkBEWVWSAWcjs.I; exports.useAsyncMenuCoordinator = _chunkBEWVWSAWcjs.F; exports.useDataList = _chunkBEWVWSAWcjs.D; exports.useDataSurfaceContext = _chunkBEWVWSAWcjs.A; exports.useItem = _chunkBEWVWSAWcjs.P; exports.useItemContext = _chunkXMZZ62VJcjs.g; exports.useMaybeAsyncMenuCoordinator = _chunkBEWVWSAWcjs.G; exports.useMaybeDataList = _chunkBEWVWSAWcjs.E; exports.useMaybeDataSurfaceContext = _chunkBEWVWSAWcjs.B; exports.useMaybeItemContext = _chunkXMZZ62VJcjs.h; exports.useMaybeRootContext = _chunkBEWVWSAWcjs.e; exports.useMaybeSubmenuContext = _chunkBEWVWSAWcjs.h; exports.useMaybeSubpageContext = _chunkBEWVWSAWcjs.j; exports.useMaybeSubpageStack = _chunkBEWVWSAWcjs.m; exports.useMaybeSurfaceContext = _chunkXMZZ62VJcjs.q; exports.useRootContext = _chunkBEWVWSAWcjs.d; exports.useSubmenuContext = _chunkBEWVWSAWcjs.g; exports.useSubpageContext = _chunkBEWVWSAWcjs.i; exports.useSubpageStack = _chunkBEWVWSAWcjs.l; exports.useSurfaceContext = _chunkXMZZ62VJcjs.p;
2
2
  //# sourceMappingURL=index.cjs.map