@quixomatic/rpf 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/assets/dev-host/boot.js +7 -223
  3. package/assets/dev-host/boot.js.LEGAL.txt +0 -22
  4. package/assets/dev-host/chunks/{accordion-O6VUPQ32.js → accordion-7MNNAFNO.js} +2 -2
  5. package/assets/dev-host/chunks/{alert-PRAGKG5L.js → alert-GIZIVENB.js} +2 -2
  6. package/assets/dev-host/chunks/{alert-dialog-SCBXM23J.js → alert-dialog-7NG5WNXK.js} +2 -2
  7. package/assets/dev-host/chunks/{avatar-WXPKQ3Z5.js → avatar-BCPZUJGX.js} +2 -2
  8. package/assets/dev-host/chunks/{breadcrumb-IJQJQ5JV.js → breadcrumb-T2XOHRDG.js} +2 -2
  9. package/assets/dev-host/chunks/button-TGT2523L.js +2 -0
  10. package/assets/dev-host/chunks/calendar-TOTKKMY2.js +2 -0
  11. package/assets/dev-host/chunks/{card-EY3LK2GB.js → card-LOSZVZYW.js} +2 -2
  12. package/assets/dev-host/chunks/{chart-2PHC6UIE.js → chart-43TBOZGK.js} +2 -2
  13. package/assets/dev-host/chunks/{chart-blocks-PZPCWCNT.js → chart-blocks-HLNNWNB5.js} +2 -2
  14. package/assets/dev-host/chunks/{chart-frame-MNUFXAPU.js → chart-frame-FNM5OPZU.js} +2 -2
  15. package/assets/dev-host/chunks/{chat-TTESCYES.js → chat-QVZ4BUWR.js} +2 -2
  16. package/assets/dev-host/chunks/{checkbox-Y2UGSRR4.js → checkbox-AFUTB4DV.js} +2 -2
  17. package/assets/dev-host/chunks/{chunk-UWANBOC6.js → chunk-2FVHAZMZ.js} +2 -2
  18. package/assets/dev-host/chunks/{chunk-CWDPAB6V.js → chunk-34RXMJIM.js} +2 -2
  19. package/assets/dev-host/chunks/chunk-354OFHNU.js +219 -0
  20. package/assets/dev-host/chunks/chunk-354OFHNU.js.LEGAL.txt +23 -0
  21. package/assets/dev-host/chunks/{chunk-CCXMDKVL.js → chunk-3LMPMW3Q.js} +2 -2
  22. package/assets/dev-host/chunks/{chunk-3H6F4X7R.js → chunk-4XESWRTW.js} +2 -2
  23. package/assets/dev-host/chunks/{chunk-PYWKHILP.js → chunk-7FCGD4LS.js} +2 -2
  24. package/assets/dev-host/chunks/{chunk-AVSRGCSF.js → chunk-7JQIKRBV.js} +2 -2
  25. package/assets/dev-host/chunks/{chunk-PHK25MY7.js → chunk-DU3VFETH.js} +2 -2
  26. package/assets/dev-host/chunks/{chunk-2IZ44WWI.js → chunk-E5JYU6CR.js} +2 -2
  27. package/assets/dev-host/chunks/{chunk-BB4IX5QA.js → chunk-FBZMZ5S2.js} +2 -2
  28. package/assets/dev-host/chunks/{chunk-GWDGPUGM.js → chunk-GSJT5YWB.js} +2 -2
  29. package/assets/dev-host/chunks/{chunk-OXJ6LWKI.js → chunk-HCQR5YME.js} +3 -3
  30. package/assets/dev-host/chunks/{chunk-APP2HKWR.js → chunk-HGBRF6KW.js} +2 -2
  31. package/assets/dev-host/chunks/{chunk-6ARM5VDH.js → chunk-HVTUE7NV.js} +2 -2
  32. package/assets/dev-host/chunks/{chunk-M7A47ZSM.js → chunk-IY3GAGI7.js} +2 -2
  33. package/assets/dev-host/chunks/{chunk-MGLBTOXD.js → chunk-KY2HARU6.js} +2 -2
  34. package/assets/dev-host/chunks/{chunk-EDEL6XSO.js → chunk-ND526XXU.js} +2 -2
  35. package/assets/dev-host/chunks/{chunk-UXUS6DNI.js → chunk-NMFZMT4R.js} +2 -2
  36. package/assets/dev-host/chunks/{chunk-XE5RQ73V.js → chunk-NPJXSRRT.js} +2 -2
  37. package/assets/dev-host/chunks/{chunk-FJRWQRLM.js → chunk-OUCK2LIZ.js} +2 -2
  38. package/assets/dev-host/chunks/{chunk-Z76KXEPD.js → chunk-OXLXEX2R.js} +2 -2
  39. package/assets/dev-host/chunks/{chunk-BH6FGVDP.js → chunk-PB5RYDO5.js} +2 -2
  40. package/assets/dev-host/chunks/{chunk-TQPXDAVH.js → chunk-QJVIEN5R.js} +2 -2
  41. package/assets/dev-host/chunks/{chunk-57M36GYM.js → chunk-QZ3NJHFR.js} +2 -2
  42. package/assets/dev-host/chunks/{chunk-FZPMZMFU.js → chunk-SC7J7HFI.js} +2 -2
  43. package/assets/dev-host/chunks/{chunk-X34AFUS2.js → chunk-SKBWMIS5.js} +2 -2
  44. package/assets/dev-host/chunks/{chunk-LTVKSGLG.js → chunk-UCEBXCOI.js} +2 -2
  45. package/assets/dev-host/chunks/{chunk-T7JFBQSG.js → chunk-UNKI7HPL.js} +2 -2
  46. package/assets/dev-host/chunks/{chunk-F5MKIWPQ.js → chunk-UPZXXDXM.js} +2 -2
  47. package/assets/dev-host/chunks/{chunk-ML6HCGK5.js → chunk-XBWE3IIB.js} +2 -2
  48. package/assets/dev-host/chunks/{chunk-NJX7QY3Z.js → chunk-YFI7GTF6.js} +2 -2
  49. package/assets/dev-host/chunks/{chunk-NI6ZJ6DH.js → chunk-YJM2Y722.js} +2 -2
  50. package/assets/dev-host/chunks/{chunk-WLBNJ4K3.js → chunk-ZNWVTDCV.js} +2 -2
  51. package/assets/dev-host/chunks/{chunk-UUJ5X322.js → chunk-ZTMZ7LJW.js} +2 -2
  52. package/assets/dev-host/chunks/{chunk-OW6AVFQA.js → chunk-ZZ2RYU7S.js} +2 -2
  53. package/assets/dev-host/chunks/{code-block-H2ETQV3M.js → code-block-IKYEIWY2.js} +2 -2
  54. package/assets/dev-host/chunks/code-editor-KDRLM33B.js +2 -0
  55. package/assets/dev-host/chunks/{collapsible-4ZOFMWLB.js → collapsible-WK7PDWEV.js} +2 -2
  56. package/assets/dev-host/chunks/{color-picker-RRCCLR54.js → color-picker-VPSOGTDM.js} +2 -2
  57. package/assets/dev-host/chunks/{combobox-U4455OMJ.js → combobox-GYLAHYVX.js} +2 -2
  58. package/assets/dev-host/chunks/{contrast-badge-KDF65X7J.js → contrast-badge-QZW62DMF.js} +2 -2
  59. package/assets/dev-host/chunks/{date-range-picker-WJYHAHRM.js → date-range-picker-6Q2JGR43.js} +2 -2
  60. package/assets/dev-host/chunks/{dialog-I6AGHWB3.js → dialog-HDQAIAFZ.js} +2 -2
  61. package/assets/dev-host/chunks/{dropdown-menu-LSOMXDWG.js → dropdown-menu-E7K3YNXS.js} +2 -2
  62. package/assets/dev-host/chunks/{empty-NLQODUSK.js → empty-JCVCSM3V.js} +2 -2
  63. package/assets/dev-host/chunks/{font-picker-3TLYYZJH.js → font-picker-7FBJCSTQ.js} +2 -2
  64. package/assets/dev-host/chunks/{frame-HA7UIYZF.js → frame-LZ2IUISE.js} +2 -2
  65. package/assets/dev-host/chunks/{heading-7M24WKK6.js → heading-GX36VR3U.js} +2 -2
  66. package/assets/dev-host/chunks/{hover-card-HSHOQPOI.js → hover-card-ONEUZ7TU.js} +2 -2
  67. package/assets/dev-host/chunks/{image-R7XGYKVH.js → image-E3BYZ2HA.js} +2 -2
  68. package/assets/dev-host/chunks/{input-YECXNM53.js → input-G7S4OLSN.js} +2 -2
  69. package/assets/dev-host/chunks/{input-group-GFKXSZM7.js → input-group-54JRMLWQ.js} +2 -2
  70. package/assets/dev-host/chunks/{kbd-V25ZMVCM.js → kbd-TKMXF542.js} +2 -2
  71. package/assets/dev-host/chunks/label-YIVRPKQJ.js +2 -0
  72. package/assets/dev-host/chunks/{label-value-6Z6ATP55.js → label-value-V7QDIDAP.js} +2 -2
  73. package/assets/dev-host/chunks/{logo-AAMBHX2W.js → logo-DBA4NHQE.js} +2 -2
  74. package/assets/dev-host/chunks/{number-field-6TCQAVTR.js → number-field-FPC3YXDC.js} +2 -2
  75. package/assets/dev-host/chunks/{pill-7L57ZNRJ.js → pill-4WVEOBR4.js} +2 -2
  76. package/assets/dev-host/chunks/{popover-3P6YNKH3.js → popover-GQD2U5SP.js} +2 -2
  77. package/assets/dev-host/chunks/{progress-RBCJRVM7.js → progress-TITSWD2A.js} +2 -2
  78. package/assets/dev-host/chunks/{radio-group-NJWXZCX3.js → radio-group-YA3OUIPB.js} +2 -2
  79. package/assets/dev-host/chunks/{resizable-XF4P6OKR.js → resizable-XQKUCHIS.js} +2 -2
  80. package/assets/dev-host/chunks/rich-text-2RYBPVRF.js +2 -0
  81. package/assets/dev-host/chunks/{rich-text-editor-T6KWD4P3.js → rich-text-editor-IX7RIMLI.js} +2 -2
  82. package/assets/dev-host/chunks/{scroll-row-LMI7JCFR.js → scroll-row-MZZQZYLM.js} +2 -2
  83. package/assets/dev-host/chunks/{select-F3MZWTTS.js → select-5U37ZHLQ.js} +2 -2
  84. package/assets/dev-host/chunks/separator-JATMMEKS.js +2 -0
  85. package/assets/dev-host/chunks/{sheet-EXRT4MFB.js → sheet-KTVNRYAO.js} +2 -2
  86. package/assets/dev-host/chunks/{side-panel-IBHLEANN.js → side-panel-2UVNFRIF.js} +2 -2
  87. package/assets/dev-host/chunks/{sidebar-VKQMQMF2.js → sidebar-GR4A2LDD.js} +2 -2
  88. package/assets/dev-host/chunks/{skeleton-KIRVQ4EO.js → skeleton-XE2TGBGQ.js} +2 -2
  89. package/assets/dev-host/chunks/{slider-XKYDL5MR.js → slider-BGGGQLSH.js} +2 -2
  90. package/assets/dev-host/chunks/{split-button-WP6LALDS.js → split-button-KLVGWHNN.js} +2 -2
  91. package/assets/dev-host/chunks/{stepper-KR6PXZHW.js → stepper-AY3NGEDC.js} +2 -2
  92. package/assets/dev-host/chunks/{switch-P6NJELJJ.js → switch-A2VSCLHA.js} +2 -2
  93. package/assets/dev-host/chunks/{tabs-PFPRJNVZ.js → tabs-2IO6EIED.js} +2 -2
  94. package/assets/dev-host/chunks/textarea-YQH2OPGH.js +2 -0
  95. package/assets/dev-host/chunks/{toggle-group-PS7JN2JM.js → toggle-group-3SDBWJ2G.js} +2 -2
  96. package/assets/dev-host/chunks/{tooltip-S4RBC3O4.js → tooltip-4QJ2SWCS.js} +2 -2
  97. package/assets/dev-host/chunks/{tree-NQF6ZJLH.js → tree-CFIKTPFC.js} +2 -2
  98. package/assets/dev-host/kit-candidates.json +1 -1
  99. package/assets/dev-host/kit-manifest.json +1 -1
  100. package/assets/dev-host/stage.js +54 -0
  101. package/assets/forge-app/app/assets/{_forge-shiki-langs-BtmKnsX8.js → _forge-shiki-langs-nxHsAEiY.js} +1 -1
  102. package/assets/forge-app/app/assets/{appendItems-D8y87kIw.js → appendItems-CLsiMCGq.js} +1 -1
  103. package/assets/forge-app/app/assets/{core-pm_tYnN8.js → core-DEkUYqk0.js} +1 -1
  104. package/assets/forge-app/app/assets/{diff-view-KCzB8C4U.js → diff-view-ctlXj2p5.js} +1 -1
  105. package/assets/forge-app/app/assets/{file-panel-BKKQ3JJL.js → file-panel-BnUdO2N6.js} +1 -1
  106. package/assets/forge-app/app/assets/{highlights-dvwIMyOh.js → highlights-CEbVTJAm.js} +1 -1
  107. package/assets/forge-app/app/assets/index-DYFQser1.js +291 -0
  108. package/assets/forge-app/app/assets/index-Ddi87x2p.css +1 -0
  109. package/assets/forge-app/app/assets/{loader-DUZOP7q_.js → loader-V5V4Ad0d.js} +1 -1
  110. package/assets/forge-app/app/assets/{shiki-BghTRNDM.js → shiki-B5GY8Ub_.js} +2 -2
  111. package/assets/forge-app/app/assets/{stream-tokenizer-BzA0VElt.js → stream-tokenizer-CZZoarTM.js} +1 -1
  112. package/assets/forge-app/app/assets/{terminal-view-BdvNEDWd.js → terminal-view-BR9EXBM5.js} +1 -1
  113. package/assets/forge-app/app/assets/{themes-D3CUotbU.js → themes-BMbfM7BC.js} +2 -2
  114. package/assets/forge-app/app/assets/{useNextRenderData-BaDffqa5.js → useNextRenderData-ICppXFTX.js} +1 -1
  115. package/assets/forge-app/app/index.html +2 -2
  116. package/assets/forge-app/server.mjs +722 -158
  117. package/dist/cli.mjs +1906 -718
  118. package/package.json +1 -1
  119. package/assets/dev-host/chunks/button-4JMBKYN4.js +0 -2
  120. package/assets/dev-host/chunks/calendar-XXLCAUPG.js +0 -2
  121. package/assets/dev-host/chunks/code-editor-2JYERJLS.js +0 -2
  122. package/assets/dev-host/chunks/label-LJT4V2CT.js +0 -2
  123. package/assets/dev-host/chunks/rich-text-7OMYZ564.js +0 -2
  124. package/assets/dev-host/chunks/separator-JRJYKM4Z.js +0 -2
  125. package/assets/dev-host/chunks/textarea-2JXA5XWS.js +0 -2
  126. package/assets/forge-app/app/assets/index-BwYJlfwT.css +0 -1
  127. package/assets/forge-app/app/assets/index-DgB2FK2g.js +0 -291
  128. /package/assets/dev-host/chunks/{chunk-OXJ6LWKI.js.LEGAL.txt → chunk-HCQR5YME.js.LEGAL.txt} +0 -0
@@ -1,2 +1,2 @@
1
- import{a as Vs,b as ws,c as Cn,e as Os}from"./chunk-3H6F4X7R.js";import{a as at,b as xn,c as Io}from"./chunk-KAZVAX35.js";import{a as ds,b as yo,c as et,d as gs,e as hs,f as Mt,g as So,h as Is,i as Rs,j as Ps,k as Ns}from"./chunk-WRHZYADJ.js";import{b as ys,c as Ss}from"./chunk-4E74H7FZ.js";import{a as Es}from"./chunk-AZWODE64.js";import{b as fs,c as Ro,d as bs,e as xs,f as De,g as Cs,i as vo,j as Eo,k as vs,l as Po}from"./chunk-GQYRJYJV.js";import{a as ls,b as us,c as Ot,d as cs,e as lt,f as Dt,g as ms,h as ps}from"./chunk-5ZMYWE5S.js";import{a as as}from"./chunk-FROPNHO5.js";import{a as rs,g as ss,h as is}from"./chunk-TQPXDAVH.js";import{a as wt}from"./chunk-33RMFA4P.js";import{b as co,c as bo}from"./chunk-WLBNJ4K3.js";import{a as uo}from"./chunk-T4Y5HG5P.js";import{b as es,e as ts}from"./chunk-IAEAQCYR.js";import{$ as Qr,F as jr,I as Ur,Ma as os,P as qr,Q as ho,S as zr,U as Kr,V as Wr,ka as Yr,ma as $r,va as Xr,wa as Jr}from"./chunk-OXJ6LWKI.js";import{a as Zr}from"./chunk-B4MRCKT4.js";import{E as Gr,a as he,z as Hr}from"./chunk-QFN6XL4O.js";import{a as Co,b as Lr,c as Ie,d as fn,e as Ze,l as bn,m as _r,n as Fr,o as Vt,v as kr}from"./chunk-7OCTAHT6.js";import{a as Br,b as go}from"./chunk-URJZKT45.js";import{a as bt}from"./chunk-E75HEEMN.js";import{b as Mr}from"./chunk-R5KQ2GRA.js";import{a as A,b as Pr,c as R}from"./chunk-FTWKUXER.js";import{c as fo}from"./chunk-AAL6V4Y3.js";import{b as ns}from"./chunk-CWDPAB6V.js";import{d as je}from"./chunk-CLVPTZ4G.js";import{a as lo}from"./chunk-5EK7QOB6.js";import{e as mn,f as pn,o as Vr,r as wr,t as Or}from"./chunk-LYT7LQS3.js";import{n as Ar,o as Tr,pb as dn}from"./chunk-IQ2XSDFU.js";import{b as Dr}from"./chunk-XIXCIQKJ.js";import{a as Nr,d as xo}from"./chunk-EGZKG2B2.js";import{d as Nt}from"./chunk-MQ67DRDE.js";import{a as yr}from"./chunk-UH726PMV.js";import{a as Q}from"./chunk-SFI7YWVR.js";import{a as Sr,b as ue}from"./chunk-NZ73KS2Y.js";import{a as le}from"./chunk-CT4EH2K2.js";import{b as cn,d as Je,e as ft,f as Kt,g as mo,j as po,l as M}from"./chunk-JIAVZ3V7.js";import{a as Se}from"./chunk-SVQCDOZ3.js";import{a as D}from"./chunk-IJQ26FTX.js";import{b as na,c as x}from"./chunk-KVMUXFPB.js";var Ni=x(D());var E=x(D(),1);function Ds(e,t,o,s,p,f,m,i,c,n=2){let l=Gr(o.current,{event:e,orientation:s,loopFocus:p,rtl:f,cols:n,disabledIndices:m,minIndex:i,maxIndex:c,prevIndex:t>c?i:t,stopEvent:!0});return Hr(o.current,l)?void 0:l}var Me=x(D(),1),No=Me.createContext(void 0);No.displayName="ComboboxRootContext";var Vo=Me.createContext(void 0);Vo.displayName="ComboboxFloatingContext";var wo=Me.createContext(void 0);wo.displayName="ComboboxDerivedItemsContext";var Oo=Me.createContext(!1);Oo.displayName="ComboboxHasItemsContext";var Do=Me.createContext("");Do.displayName="ComboboxInputValueContext";function P(){let e=Me.useContext(No);if(!e)throw new Error("Base UI: ComboboxRootContext is missing. Combobox parts must be placed within <Combobox.Root>.");return e}function ut(){let e=Me.useContext(Vo);if(!e)throw new Error("Base UI: ComboboxFloatingContext is missing. Combobox parts must be placed within <Combobox.Root>.");return e}function Ae(){let e=Me.useContext(wo);if(!e)throw new Error("Base UI: ComboboxItemsContext is missing. Combobox parts must be placed within <Combobox.Root>.");return e}function At(){return Me.useContext(Do)}function Ms(){return Me.useContext(Oo)}var As={id:e=>e.id,labelId:e=>e.labelId,items:e=>e.items,selectedValue:e=>e.selectedValue,hasSelectionChips:e=>{let t=e.selectedValue;return Array.isArray(t)&&t.length>0},hasSelectedValue:e=>{let{selectedValue:t,selectionMode:o}=e;return t==null?!1:o==="multiple"&&Array.isArray(t)?t.length>0:!0},hasNullItemLabel:(e,t)=>t?cs(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMounted:e=>e.forceMounted,inline:e=>e.inline,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let o=e.isItemEqualToValue,s=e.selectedValue;return Array.isArray(s)?s.some(p=>et(t,p,o)):et(t,s,o)},transitionStatus:e=>e.transitionStatus,popupProps:e=>e.popupProps,listProps:e=>e.listProps,inputProps:e=>e.inputProps,triggerProps:e=>e.triggerProps,itemRoot:e=>e.itemRoot,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupId:e=>e.popupId,triggerElement:e=>e.triggerElement,inputElement:e=>e.inputElement,inputGroupElement:e=>e.inputGroupElement,popupSide:e=>e.popupSide,openMethod:e=>e.openMethod,inputInsidePopup:e=>e.inputInsidePopup,inputOwnsFormValue:e=>e.inputOwnsFormValue,selectionMode:e=>e.selectionMode,name:e=>e.name,form:e=>e.form,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,grid:e=>e.grid,virtualized:e=>e.virtualized,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,modal:e=>e.modal,autoHighlight:e=>e.autoHighlight};function Mo(e){return e==null?void 0:`${e}-popup`}function Ao(e,t){return(o,s)=>o==null?!1:e.contains(o,s,t)}function Ts(e,t,o){return(s,p)=>{if(s==null)return!1;if(!p)return!0;let f=t?.selected??t,m=o!=null?lt(o,f):"";return m&&e.contains(m,p)&&m.length===p.length?!0:e.contains(s,p,t)}}var To=x(D(),1);var Ls=xn;function _s(e={}){let{multiple:t=!1,value:o,...s}=e,p=xn(s),f=To.useCallback((m,i,c)=>t?Ao(p,c)(m,i):Ts(p,c,o)(m,i),[p,o,t]);return To.useMemo(()=>({...p,contains:f}),[f,p])}function Fs(e,t=!1){let{overflowY:o}=Vr(e);return o!=="auto"&&o!=="scroll"?!1:t?e.clientHeight>0:e.scrollHeight>e.clientHeight}var gn=Symbol("none"),Lo={value:gn,index:-1};function Wt(e,t,o){let s=e.get(t);if(s!==void 0||o===yo)return s;for(let[p,f]of e)if(et(p,t,o))return f}var Ue=x(le(),1);function ks(e){let{id:t,onOpenChangeComplete:o,defaultSelectedValue:s=null,selectedValue:p,onSelectedValueChange:f,defaultInputValue:m,inputValue:i,open:c,defaultOpen:n=!1,selectionMode:l,onItemHighlighted:C,name:F,form:T,disabled:N=!1,readOnly:g=!1,required:I=!1,inputRef:V,grid:u=!1,items:d,filteredItems:v,filter:Y,filterQuery:L,openOnInputClick:_=!0,autoHighlight:U=!1,keepHighlight:q=!1,highlightItemOnHover:k=!0,loopFocus:K=!0,itemToStringLabel:W,itemToStringValue:w,isItemEqualToValue:S=yo,virtualized:ke=!1,inline:$=!1,fillInputOnItemPress:Be=!0,modal:ie=!1,limit:pe=-1,autoComplete:ce="list",formAutoComplete:ze,locale:Re,submitOnItemClick:Ke=!1}=e,{clearErrors:j}=vs(),{setDirty:re,validityData:xt,setFilled:We,name:Ct,disabled:gt,setTouched:mt,setFocused:nt,validationMode:rt,validation:Te}=De(),Bt=wt(),Pe=Eo({id:t}),Qe=Ls({locale:Re}),H=Array.isArray(d)?null:d;if(H&&typeof H.label!="function")throw new Error("Base UI: the `items` prop received an object that is not a collection, so its items cannot be read. Pass an array of items, an array of groups with items, or the result of `createItems()`. See https://base-ui.com/react/components/combobox#createitems");let Z=H?H.data:d,Ve=H?.value,st=Ve?void 0:Z,b=E.useMemo(()=>{if(!v||!Ve)return;let r=Ot(v),a=r.map(Ve),y;return{values:a,findItem(G,ee){if(!y){y=new Map;for(let ae=0;ae<a.length;ae+=1)y.has(a[ae])||y.set(a[ae],r[ae])}return Wt(y,G,ee)}}},[v,Ve]),O=E.useMemo(()=>H?r=>H.label(r,S,a=>{let y=b?.findItem(a,S);return y!=null?H.itemLabel(y):lt(a,W)}):W,[H,W,b,S]),fe=E.useMemo(()=>H?Object.assign(r=>H.itemLabel(r),{selected:r=>lt(r,O)}):W,[H,O,W]);function be(r){return lt(r,O)}let[Ye,oe]=E.useState(!1),[ne,Le]=E.useState(null),ht=E.useRef(ne),_e=E.useRef([]),It=E.useRef([]),Rt=E.useRef(null),ve=E.useRef(null),Vi=E.useRef(null),wi=E.useRef(null),Wn=E.useRef(null),Qn=E.useRef(!1),Yn=E.useRef(null),$n=E.useRef(null),an=E.useRef(null),Ht=E.useRef(Lo),we=E.useRef(null),$e=E.useRef([]),Xn=E.useRef(null),Ee=gt||N,it=Ct??F,ye=l==="multiple",He=l==="single",Gt=i!==void 0||m!==void 0,xe=Z!==void 0,jt=v!==void 0,Ce;U==="always"?Ce="always":Ce=U?"input-change":!1;let[z,Oi]=uo({controlled:p,default:ye?s??ft:s,name:"Combobox",state:"selectedValue"}),ln=E.useMemo(()=>Y===null?()=>!0:Y!==void 0?Y:Ao(Qe,fe),[Y,Qe,fe]),Jn=cn(()=>Gt?m??"":He?be(z):"").current,[me,Di]=uo({controlled:i,default:Jn,name:"Combobox",state:"inputValue"}),[X,Mi]=uo({controlled:c,default:n,name:"Combobox",state:"open"}),Zn=us(Z),Oe=!X&&ne!==null?ne:String(me).trim(),pt=He?be(z):"",er=He&&!Ye&&Oe!==""&&pt.length===Oe.length&&Qe.contains(pt,Oe),vt=er?"":L??Oe,tr=xe&&jt&&er&&(!H||H.hasValue(z,S)),Zt=E.useMemo(()=>Z?Ot(Z):ft,[Z]),Ut=E.useMemo(()=>{if(v&&!tr)return v;if(!Z)return ft;if(Zn){let a=Z,y=[],G=0;for(let ee of a){if(pe>-1&&G>=pe)break;let ae=pe>-1?pe-G:1/0,J=vt===""?ee.items.slice(0,ae):[];if(vt!=="")for(let se of ee.items){if(J.length>=ae)break;ln(se,vt,fe)&&J.push(se)}if(J.length>0){let se={...ee,items:J};y.push(se),G+=J.length}}return y}if(vt==="")return pe>-1?Zt.slice(0,pe):Zt;let r=[];for(let a of Zt){if(pe>-1&&r.length>=pe)break;ln(a,vt,fe)&&r.push(a)}return r},[v,tr,Z,Zn,vt,pe,ln,fe,Zt]),ge=E.useMemo(()=>{if(b&&Ut===v)return b.values;let r=Ot(Ut);return Ve?r.map(a=>Ve(a)):r},[Ut,v,b,Ve]),h=cn(()=>{let r=null;return $&&X&&xe&&l!=="none"&&(r=So(ge,z,S,ye)),new Yr({id:Pe,labelId:void 0,selectedValue:z,open:X,items:st,selectionMode:l,name:it,form:T,disabled:Ee,readOnly:g,required:I,grid:u,virtualized:ke,openOnInputClick:_,itemToStringLabel:O,isItemEqualToValue:S,modal:ie,autoHighlight:Ce,submitOnItemClick:Ke,hasInputValue:Gt,mounted:!1,forceMounted:!1,transitionStatus:"idle",inline:$,activeIndex:null,selectedIndex:r,popupProps:{},listProps:{},inputProps:{},triggerProps:{},itemRoot:{props:Kt,id:Pe,selectionMode:l,disabled:Ee,readOnly:g,isItemEqualToValue:S},positionerElement:null,listElement:null,popupId:void 0,triggerElement:null,inputElement:null,inputGroupElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,inputOwnsFormValue:l==="none"},{onOpenChangeComplete:Je,setOpen:Je,setInputValue:Je,setSelectedValue:Je,setIndices:Je,handleSelection:Je,forceMount:Je,requestSubmit:Je,listRef:_e,labelsRef:It,popupRef:Rt,emptyRef:Wn,inputRef:ve,startDismissRef:Vi,endDismissRef:wi,chipsContainerRef:Yn,clearRef:$n,valuesRef:$e,pointerDownItemRef:Xn,selectionEventRef:an},As)}).current,Et=l==="none"?me:z,Ai=E.useMemo(()=>l==="none"?Et:Array.isArray(z)?z.map(r=>Dt(r,w)):Dt(z,w),[Et,w,l,z]),Ti=Q(C),Li=Q(o),or=h.useState("activeIndex"),_i=h.useState("selectedIndex"),eo=h.useState("positionerElement"),nr=h.useState("listElement"),qt=h.useState("triggerElement"),to=h.useState("inputElement"),Fi=h.useState("inputGroupElement"),de=h.useState("inline"),Fe=h.useState("inputInsidePopup"),ki=h.useState("inputOwnsFormValue"),rr=He&&!Fe&&me===pt,Bi=Mr(qt),{openMethod:Hi,triggerProps:sr}=ts(X),Gi=Q(()=>Ai);Cs(Fe?Bi:ve,Pe,Et,Gi,!Ee,F);let ir=Q(()=>{Z?It.current=ge.map(be):h.set("forceMounted",!0)}),yt=Q((r,a,y,G)=>{if(a===-1){if(Ht.current===Lo)return;Ht.current=Lo}else Ht.current={value:r,index:a};Ti(r,Pr(y,G,{index:a}))}),Xe=Q(r=>{let a={};r.activeIndex!==void 0&&(a.activeIndex=r.activeIndex),r.selectedIndex!==void 0&&(a.selectedIndex=r.selectedIndex),h.update(a);let y=r.activeIndex;if(y===void 0)return;let G=r.type||R.none;y===null?yt(void 0,-1,G,r.event):yt($e.current[y],y,G,r.event)}),Ge=Q((r,a)=>{if(e.onInputValueChange?.(r,a),!a.isCanceled){if(Qn.current=a.reason===R.inputClear,a.reason===R.inputChange){X&&ne!==null&&Le(null);let y=a.event,G=y.inputType;if(y.type==="compositionend"||G!=null&&G!==""&&G!=="insertReplacementText"){let ae=r.trim()!=="";ae&&oe(!0),we.current={hasQuery:ae};let J=h.state.listElement;if(!h.state.virtualized&&J){let se=Rt.current;for(let Ne of wr(J.firstElementChild??J)){if(!pn(Ne)||(se?!Ie(se,Ne):Ne.getAttribute("role")==="dialog"))break;if(Fs(Ne)){Ne.scrollTop=0;break}}}ae&&Ce&&h.state.activeIndex==null&&(X||de)&&h.set("activeIndex",0)}}else a.reason===R.inputClear&&r===""&&h.state.inputInsidePopup&&(we.current={hasQuery:!1,selection:!0});Di(r)}}),ar=Q(r=>{let a=!r&&Fe&&!de&&me!==""&&(String(me).trim()===ne||me===pt);!r&&(a||me===""||rr)&&oe(!1),Le(null),a&&Ge("",A(R.inputClear))}),[ji,lr]=E.useState(!1),dt=Q((r,a)=>{if(X===r)return;a.reason===R.escapeKey&&xe&&ge.length===0&&!Wn.current&&a.allowPropagation();let y=a,G=Qr(y);if(e.onOpenChange?.(r,y),we.current?.hasQuery&&a.reason===R.inputChange===a.isCanceled&&(we.current=null),!a.isCanceled&&(r&&ne!==null&&ar(a.reason===R.inputChange),!r&&Ye&&(He?(de||Le(Oe),Oe===""&&oe(!1)):ye&&(de||Le(Oe),Fe&&Xe({activeIndex:null}),(!Fe||de)&&Ge("",A(R.inputClear,a.event,void 0,{isItemPress:a.reason===R.itemPress})))),r||lr(G()),Mi(r),!r&&Fe&&(a.reason===R.focusOut||a.reason===R.outsidePress)&&(mt(!0),nt(!1),rt==="onBlur"))){let ee=l==="none"?me:z;Te.commit(ee)}}),oo=Q((r,a)=>{if(f?.(r,a),a.isCanceled)return;Oi(r),(l==="none"&&Rt.current&&Be||He&&!h.state.inputInsidePopup)&&Ge(be(r),A(a.reason,a.event))}),Ui=Q((r,a)=>{let y=Ze(r),G=an.current??r;an.current=null;let ee=A(R.itemPress,G),ae=fn(y,"a")?.getAttribute("href");if(ae){ae.startsWith("#")&&dt(!1,ee);return}if(ye){let J=Array.isArray(z)?z:[],se=hs(J,a,S),Ne=se?Rs(J,a,S):[...J,a];if(oo(Ne,ee),ee.isCanceled||!(ve.current?ve.current.value.trim()!=="":!1))return;if(h.state.inputInsidePopup){Ge("",A(R.inputClear,ee.event,void 0,{isItemPress:!0}));let Pt=we.current;Pt&&!se&&(Pt.toggledValue=a)}else dt(!1,ee)}else{if(oo(a,ee),ee.isCanceled)return;dt(!1,ee)}}),qi=Q(()=>{let r=Te.inputRef.current?.form??h.state.inputElement?.form;r&&typeof r.requestSubmit=="function"&&r.requestSubmit()}),zi=Q(()=>{if(Li?.(!1),oe(!1),Le(null),Xe(l==="none"?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),ye&&ve.current&&ve.current.value!==""&&!Qn.current&&Ge("",A(R.inputClear)),He)if(h.state.inputInsidePopup)ve.current&&ve.current.value!==""&&Ge("",A(R.inputClear));else{let r=be(z);if(ve.current&&ve.current.value!==r){let a=r===""?R.inputClear:R.none;Ge(r,A(a))}}}),no=E.useMemo(()=>de&&eo?{current:fn(eo,'[role="dialog"]')}:Rt,[de,eo]),{mounted:Ki,transitionStatus:ur,forceUnmount:cr}=Kr({open:X,ref:no,preventUnmountOnClose:ji,setPreventUnmountOnClose:lr,onUnmount:zi});E.useImperativeHandle(e.actionsRef,()=>({unmount:cr,close:()=>dt(!1,A(R.imperativeAction))}),[cr,dt]),ue(function(){let a=ht.current!==null&&ne===null;if(ht.current=ne,X&&(!a||!xe)||(X||(Xn.current=null),l==="none"))return;let y=xe?ge:$e.current;Xe({selectedIndex:So(y,z,S,ye)})},[X,ne,z,l,ye,xe,ge,S,Xe]),ue(()=>{Z&&($e.current=ge,_e.current.length=ge.length)},[Z,ge]),ue(()=>{!X&&we.current?.hasQuery&&(we.current=null)},[X]),ue(()=>{if(!X&&de&&no.current){we.current=null;return}let r=xe||jt?ge:$e.current,a=we.current;if(a){let J=X||de||h.state.positionerElement?.hidden===!1;if(a.hasQuery){let se=ve.current;!Ce||String(me).trim()===""||de&&Ce!=="always"&&(!se||Lr(se.ownerDocument)!==se)?we.current=null:J&&(r[0]!==void 0||!xe&&!jt)&&(h.set("activeIndex",0),we.current=null)}else if(String(me).trim()===""&&(we.current=null,J)){let se=a.selection;Ce==="always"&&!se&&h.state.selectionMode==="none"&&h.set("activeIndex",0),queueMicrotask(()=>{if(!h.state.open&&(!h.state.inline||no.current)||ve.current&&ve.current.value.trim()!=="")return;let Ne=h.state.selectedValue,zt=h.state.selectionMode==="multiple";if(zt&&Array.isArray(Ne)?Ne.length>0:h.state.selectionMode!=="none"&&Ne!=null){let vr=xe||jt?ge:$e.current,Er=Mt(vr,a.toggledValue,h.state.isItemEqualToValue);h.set("activeIndex",Er!==-1?Er:So(vr,Ne,h.state.isItemEqualToValue,zt))}else se?h.set("activeIndex",null):Ce==="always"&&h.set("activeIndex",0)})}}if(!X&&!de)return;let y=h.state.activeIndex;if(y==null){if(Ce==="always"&&r.length>0){h.set("activeIndex",0);return}yt(void 0,-1,R.none);return}if(y>=r.length){yt(void 0,-1,R.none),h.set("activeIndex",null);return}let G=r[y],ee=Ht.current.value,ae=ee!==gn&&et(G,ee,h.state.isItemEqualToValue);(Ht.current.index!==y||!ae)&&yt(G,y,R.none)},[or,Ce,yt,jt,xe,ge,de,X,no,h,me]),ue(()=>{if(l==="none"){We(String(me)!=="");return}We(ye?Array.isArray(z)&&z.length>0:z!=null)},[We,l,me,z,ye]),E.useEffect(()=>{xe&&Ce&&ge.length===0&&Xe({activeIndex:null})},[xe,Ce,ge.length,Xe]);function Wi(){X&&Oe!==""&&Oe!==String(Jn)&&!rr&&oe(!0)}function Qi(){X&&ne!==null&&ar(!1)}let mr=!1;function pr(){!mr&&me!==pt&&(mr=!0,Ge(pt,A(R.none)))}function Yi(){l!=="none"&&(j(it),re(gs(z,xt.initialValue,S)),Te.change(z),He&&!Gt&&!Fe&&pr())}function dr(){He&&!Gt&&!Fe&&!Ye&&pr()}function $i(){l==="none"&&(j(it),re(me!==xt.initialValue),Te.change(me))}bt(Oe,Wi),bt(X,Qi),bt(z,Yi),bt(pt,dr),bt(Z,dr),bt(me,$i);let ro=$r({open:de?!0:X,onOpenChange:dt,elements:{reference:Fe?qt:to,floating:eo}}),fr=u?"grid":"listbox",so=X||de,br=so?"true":"false",io=E.useMemo(()=>{let r=to?.tagName==="INPUT",a=to==null||r,y=a||so,G=a?{autoComplete:"off",spellCheck:"false",autoCorrect:"off",autoCapitalize:"none"}:{};return y&&(G.role="combobox",G["aria-expanded"]=br,G["aria-haspopup"]=fr,G["aria-controls"]=so?nr?.id:void 0,G["aria-autocomplete"]=g?"none":ce),{reference:G,floating:{role:"presentation"}}},[to,so,br,fr,nr?.id,ce,g]),xr=ho(ro,{enabled:!Ee&&_,event:"mousedown-only",toggle:!1,touchOpenDelay:Fe?0:100,reason:R.inputPress}),ao=zr(ro,{enabled:!Ee&&!de,outsidePressEvent:{mouse:"sloppy",touch:"intentional"},bubbles:de?!0:void 0,outsidePress(r){let a=Ze(r);return!Ie(qt,a)&&!Ie($n.current,a)&&!Ie(Yn.current,a)&&!Ie(Fi,a)}}),St=Xr(ro,{enabled:!Ee,id:Pe,listRef:_e,activeIndex:or,selectedIndex:_i,virtual:!0,loopFocus:K,allowEscape:K&&!Ce,focusItemOnOpen:Ye||l==="none"&&!Ce?!1:"auto",focusItemOnHover:k,resetOnPointerLeave:!q,orientation:u?"horizontal":void 0,rtl:Bt==="rtl",disabledIndices:ft,grid:u?Ds:void 0,onNavigate(r,a){!a&&!X&&!(de&&r===null)||ur==="ending"||Xe({activeIndex:r,type:at(a),event:a?.nativeEvent})}}),Cr=E.useMemo(()=>po(St.reference,{onKeyDown(r){u&&h.state.activeIndex==null&&(r.key==="ArrowLeft"||r.key==="ArrowRight")&&r.preventBaseUIHandler()}},ao.reference,xr.reference,io.reference),[St.reference,ao.reference,xr.reference,io.reference,u,h]),gr=E.useMemo(()=>po(Wr,ao.floating),[ao.floating]),hr=E.useMemo(()=>po(St.floating,io.floating),[St.floating,io.floating]),Ir=E.useMemo(()=>{let r=St.item;return{props:r?{...r,onFocus:void 0}:Kt,id:Pe,selectionMode:l,disabled:Ee,readOnly:g,isItemEqualToValue:S}},[St.item,Pe,l,Ee,g,S]);h.useContextCallback("setOpen",dt),h.useContextCallback("setInputValue",Ge),h.useContextCallback("setSelectedValue",oo),h.useContextCallback("setIndices",Xe),h.useContextCallback("handleSelection",Ui),h.useContextCallback("forceMount",ir),h.useContextCallback("requestSubmit",qi),h.useContextCallback("onOpenChangeComplete",o),ds(()=>{h.update({inline:$,popupProps:gr,listProps:hr,inputProps:Cr,triggerProps:sr,itemRoot:Ir})});let Rr={id:Pe,selectedValue:z,open:X,mounted:Ki,transitionStatus:ur,items:st,inline:$,popupProps:gr,listProps:hr,inputProps:Cr,triggerProps:sr,itemRoot:Ir,openMethod:Hi,selectionMode:l,name:it,form:T,disabled:Ee,readOnly:g,required:I,grid:u,virtualized:ke,openOnInputClick:_,itemToStringLabel:O,modal:ie,autoHighlight:Ce,isItemEqualToValue:S,submitOnItemClick:Ke,hasInputValue:Gt};ue(()=>{h.update({...Rr,inputOwnsFormValue:l==="none"&&($||!h.state.inputInsidePopup)})},[h,...Object.values(Rr)]);let Xi=mo(V,Te.inputRef),Ji=E.useMemo(()=>({query:Oe,hasItems:xe,filteredItems:Ut,flatFilteredValues:ge}),[Oe,xe,Ut,ge]),Zi=E.useMemo(()=>Array.isArray(Et)?"":Dt(Et,w),[Et,w]),ea=ye&&Array.isArray(z)&&z.length>0,un=ye||l==="none"&&ki?void 0:it,ta=E.useMemo(()=>!ye||!Array.isArray(z)||!it?null:z.map(r=>{let a=Dt(r,w);return(0,Ue.jsx)("input",{type:"hidden",form:T,name:it,value:a,disabled:Ee},a)}),[ye,z,T,it,w,Ee]),oa=(0,Ue.jsxs)(E.Fragment,{children:[e.children,(0,Ue.jsx)("input",{...Te.getValidationProps(Ee,{onFocus(){if(Fe){qt?.focus();return}(ve.current||qt)?.focus()},onChange(r){if(r.nativeEvent.defaultPrevented||Ee||g)return;let a=r.currentTarget.value,y=a.toLowerCase(),G=A(R.none,r.nativeEvent),ee=()=>$e.current.findIndex(J=>Dt(J,w).toLowerCase()===y||be(J).toLowerCase()===y);function ae(){if(ye)return;if(l==="none"){Ge(a,G);return}let J=ee();J===-1&&(J=$e.current.findIndex((Ne,zt)=>{let Pt=It.current[zt];return Pt!=null&&Pt.toLowerCase()===y}));let se=J===-1?void 0:$e.current[J];se!=null&&oo?.(se,G)}He&&(ir(),Z&&ee()===-1&&h.set("forceMounted",!0)),queueMicrotask(ae)}}),id:Pe&&un==null?`${Pe}-hidden-input`:void 0,form:T,name:un,autoComplete:ze,disabled:Ee,required:I&&!ea,readOnly:g,value:Zi,ref:Xi,style:un?go:Br,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),ta]});return(0,Ue.jsx)(No.Provider,{value:h,children:(0,Ue.jsx)(Vo.Provider,{value:ro,children:(0,Ue.jsx)(Oo.Provider,{value:xe,children:(0,Ue.jsx)(wo.Provider,{value:Ji,children:(0,Ue.jsx)(Do.Provider,{value:me,children:oa})})})})})}var Qt=x(D(),1);var fl=bn.popupOpen,bl=bn.pressed;var Bs="data-popup-side";var Hs="data-list-empty";var Tt={...Fr,...Ro,popupSide:e=>e?{[Bs]:e}:null,listEmpty:e=>e?{[Hs]:""}:null};function Lt(e){let t=e.useState("mounted"),o=e.useState("popupSide"),s=e.useState("positionerElement");return t&&s?o:null}function qe(){return Ae().filteredItems.length===0}function _o(e){return e==="rtl"?["ArrowRight","ArrowLeft"]:["ArrowLeft","ArrowRight"]}function js(e,t){let o=e>=t-1?t-2:e;return o>=0?o:void 0}function Fo(e,t,o){let s=e.context.listRef.current[t];s&&(e.context.selectionEventRef.current=o,s.click(),e.context.selectionEventRef.current=null)}var hn=Qt.forwardRef(function(t,o){let{render:s,className:p,nativeButton:f=!0,disabled:m=!1,id:i,style:c,...n}=t,{state:l,disabled:C,setTouched:F,validationMode:T,validation:N}=De(),{labelId:g}=vo(),I=P(),V=I.useState("selectionMode"),u=I.useState("disabled"),d=I.useState("readOnly"),v=I.useState("required"),Y=I.useState("positionerElement"),L=I.useState("listElement"),_=I.useState("popupId"),U=I.useState("triggerProps"),q=I.useState("inputInsidePopup"),k=I.useState("id"),K=I.useState("labelId"),W=I.useState("open"),w=I.useState("selectedValue"),S=I.useState("activeIndex"),ke=I.useState("selectedIndex"),$=I.useState("hasSelectedValue"),Be=ut(),ie=At(),pe=Dr(),ce=C||u||m,ze=qe(),Re=Lt(I),Ke=Qt.useRef(null),j=Po(ce,Ke);Eo({id:q?i:void 0});let re=q?i??k:i,xt=Ss(g,K),We;W&&q?We=_??Mo(k):W&&(We=L?.id);let Ct=Qt.useRef("");function gt(H){Ct.current=H.pointerType}let{reference:mt}=Jr(Be,{enabled:!W&&!d&&!u&&V==="single",listRef:I.context.labelsRef,activeIndex:S,selectedIndex:ke,onMatch(H){let Z=I.context.valuesRef.current[H];Z!==void 0&&I.context.setSelectedValue(Z,A(R.none))}}),{reference:nt}=ho(Be,{enabled:!u,event:"mousedown"}),{buttonRef:rt,getButtonProps:Te}=je({native:f,disabled:ce}),Bt={...l,readOnly:d,open:W,disabled:ce,popupSide:Re,listEmpty:ze,placeholder:V==="none"?!1:!$},Pe=Q(H=>{I.set("triggerElement",H)});return M("button",t,{ref:[o,rt,Ke,Pe],state:Bt,props:[U,nt,mt,{id:re,tabIndex:q?0:-1,role:q?"combobox":void 0,"aria-expanded":W,"aria-haspopup":q?"dialog":"listbox","aria-controls":We,"aria-required":q&&v||void 0,"aria-readonly":q&&d||void 0,"aria-labelledby":xt,onPointerDown:gt,onPointerEnter:gt,onFocus(){j(!0),!ce&&pe.start(0,I.context.forceMount)},onBlur(H){if(!Ie(Y,H.relatedTarget)&&(F(!0),j(!1),T==="onBlur")){let Z=V==="none"?ie:w;N.commit(Z)}},onMouseDown(H){if(ce||(q||Be.set("domReferenceElement",H.currentTarget),I.context.forceMount(),Ct.current!=="touch"&&(I.context.inputRef.current?.focus(),q||H.preventDefault()),W))return;let Z=Or(H.currentTarget);function Ve(st){let b=I.state.triggerElement;if(!b)return;let O=Ze(st),fe=I.state.positionerElement,be=I.state.listElement;Ie(b,O)||Ie(fe,O)||Ie(be,O)||ls(st,b)||I.context.setOpen(!1,A(R.cancelOpen,st))}q&&Z.addEventListener("mouseup",Ve,{once:!0})},onKeyDown(H){(H.key==="ArrowDown"||H.key==="ArrowUp")&&(he(H),I.context.setOpen(!0,A(R.listNavigation,H.nativeEvent)),I.context.inputRef.current?.focus())}},N.getValidationProps(ce,n),Te],stateAttributesMapping:Tt})});hn.displayName="ComboboxTrigger";var tt=x(D(),1);var ko=x(D(),1),Bo=ko.createContext(void 0);Bo.displayName="ComboboxChipsContext";function Ho(){return ko.useContext(Bo)}var Go=x(D(),1),jo=Go.createContext(void 0);jo.displayName="ComboboxPositionerContext";function ct(e){let t=Go.useContext(jo);if(t===void 0&&!e)throw new Error("Base UI: <Combobox.Popup> and <Combobox.Arrow> must be used within the <Combobox.Positioner> component");return t}var Us=x(D(),1);var qs=x(le(),1),Yt=Us.forwardRef(function(t,o){let s=P(),{buttonRef:p,getButtonProps:f}=je({native:!1}),m=mo(o,p);function i(n){s.context.setOpen(!1,A(R.closePress,n.nativeEvent,n.currentTarget))}let c=f({onClick:i});return(0,qs.jsx)("span",{ref:m,...c,"aria-label":"Dismiss",tabIndex:void 0,style:go})});Yt.displayName="ComboboxInternalDismissButton";var $t=x(le(),1),In=tt.forwardRef(function(t,o){let{render:s,className:p,disabled:f=!1,id:m,style:i,...c}=t,{state:n,disabled:l,setTouched:C,validationMode:F,validation:T}=De(),{labelId:N}=vo(),g=Ho(),V=!!ct(!0),u=P(),d=At(),v=wt(),Y=u.useState("required"),L=u.useState("disabled"),_=u.useState("readOnly"),U=u.useState("name"),q=u.useState("form"),k=u.useState("selectionMode"),K=u.useState("autoHighlight"),W=u.useState("inputProps"),w=u.useState("triggerProps"),S=u.useState("open"),ke=u.useState("mounted"),$=u.useState("selectedValue"),Be=u.useState("id"),ie=u.useState("inline"),pe=u.useState("modal"),ce=!!K,ze=Lt(u),Re=l||L||f,Ke=qe(),j=Po(Re,u.context.inputRef),re=V||ie,xt=!re||pe,We=fo(m??(re?void 0:Be)),Ct=V?fs:n,[gt,mt]=tt.useState(null),nt=tt.useRef(!1),rt=tt.useRef(null);ue(()=>{S||(rt.current=null)},[S]);let Te=k==="none"&&!V,Bt=Q(b=>{let O=V||u.state.inline;O&&!u.state.hasInputValue&&u.context.setInputValue("",A(R.none)),u.update({inputElement:b,inputInsidePopup:O,inputOwnsFormValue:Te})}),Pe=V?c:T.getValidationProps(Re,c);function Qe(b){u.context.setIndices({activeIndex:null,selectedIndex:null,type:at(b),event:b})}let H={...Ct,open:S,disabled:Re,readOnly:_,popupSide:ze,listEmpty:Ke};function Z(b){if(!g)return;let O,fe=g.chipsRef.current.length,[be]=_o(v);return b.key===be&&(b.currentTarget.selectionStart??0)===0&&$.length>0&&(b.preventDefault(),O=fe>0?fe-1:void 0),O}let Ve=M("input",t,{state:H,ref:[o,u.context.inputRef,Bt],props:[W,w,{value:gt??d,"aria-readonly":_||void 0,"aria-required":Y||void 0,"aria-labelledby":N,disabled:Re,readOnly:_,required:k==="none"?Y:void 0,form:q,...Te&&U&&{name:U},id:We,onFocus(){if(j(!0),!ie)return;let b=rt.current;rt.current=null,!(b==null||!Object.hasOwn(u.context.valuesRef.current,b))&&u.context.setIndices({activeIndex:b})},onBlur(){C(!0),j(!1);let b=u.state.activeIndex;if(ie&&b!==null&&K!=="always"&&(rt.current=b,u.context.setIndices({activeIndex:null})),F==="onBlur"){let O=k==="none"?d:$;T.commit(O)}},onCompositionStart(b){Co.os.android||(nt.current=!0,mt(b.currentTarget.value))},onCompositionEnd(b){nt.current=!1;let O=b.currentTarget.value;mt(null),u.context.setInputValue(O,A(R.inputChange,b.nativeEvent))},onChange(b){let O=b.nativeEvent,fe=O.inputType,be=!fe||fe==="insertReplacementText",Ye=nt.current||!be;function oe(_e){_||Re||!_e||!Ye||(u.context.setOpen(!0,A(R.inputChange,O)),ce||Qe(O))}if(nt.current){let _e=b.currentTarget.value;mt(_e),_e===""&&!u.state.openOnInputClick&&!u.state.inputInsidePopup&&u.context.setOpen(!1,A(R.inputClear,O));let It=_e.trim(),Rt=ce&&It!=="";oe(It),S&&u.state.activeIndex!==null&&!Rt&&Qe(O);return}let ne=A(R.inputChange,O);if(u.context.setInputValue(b.currentTarget.value,ne),ne.isCanceled)return;let Le=b.currentTarget.value==="",ht=A(R.inputClear,O);Le&&!u.state.inputInsidePopup&&(k==="single"&&u.context.setSelectedValue(null,ht),u.state.openOnInputClick||u.context.setOpen(!1,ht)),oe(b.currentTarget.value.trim()),S&&u.state.activeIndex!==null&&!ce&&Qe(O)},onKeyDown(b){if(b.ctrlKey||b.shiftKey||b.altKey||b.metaKey)return;if(Re||_){_&&b.key==="Enter"&&S&&u.state.activeIndex!==null&&he(b);return}let O=b.currentTarget,fe=O.scrollWidth-O.clientWidth,be=v==="rtl";if(b.key==="Home"){he(b);let oe=Co.engine.gecko&&be?O.value.length:0;O.setSelectionRange(oe,oe),O.scrollLeft=0;return}if(b.key==="End"){he(b);let oe=Co.engine.gecko&&be?0:O.value.length;O.setSelectionRange(oe,oe),O.scrollLeft=be?-fe:fe;return}if(!ke&&b.key==="Escape"){let oe=k==="multiple"&&Array.isArray($)?$.length===0:$===null,ne=A(R.escapeKey,b.nativeEvent),Le=k==="multiple"?[]:null;u.context.setInputValue("",ne),u.context.setSelectedValue(Le,ne),!oe&&!u.state.inline&&!ne.isPropagationAllowed&&b.stopPropagation();return}if(g&&b.key==="Backspace"&&O.value===""&&Array.isArray($)&&$.length>0){let oe=g.chipsRef.current.length,ne=oe>0?oe-1:$.length-1,Le=$.filter((ht,_e)=>_e!==ne);Qe(b.nativeEvent),u.context.setSelectedValue(Le,A(R.none,b.nativeEvent));return}let Ye=Z(b);if(Ye!==void 0&&g?.chipsRef.current[Ye]?.focus(),b.which!==229&&b.key==="Enter"&&S){let oe=u.state.activeIndex,ne=b.nativeEvent;if(oe===null){if(ie)return;u.context.setOpen(!1,A(R.none,ne));return}he(b),Fo(u,oe,ne)}}},Pe],stateAttributesMapping:Tt}),st=V?(0,$t.jsx)(xs.Provider,{value:bs,children:Ve}):Ve;return(0,$t.jsxs)(tt.Fragment,{children:[S&&xt&&(0,$t.jsx)(Yt,{ref:u.context.startDismissRef}),st]})});In.displayName="ComboboxInput";var zs=x(D(),1);function Uo(e,t,o,s){if(e.baseUIHandlerPrevented)return;let p=Ze(e.nativeEvent),f=mn(p)?p:null;f!==e.currentTarget&&(s?.(f)||kr(f))||(e.preventDefault(),!o&&(t.context.inputRef.current?.focus(),t.state.openOnInputClick&&t.context.setOpen(!0,A(R.inputPress,e.nativeEvent))))}var Rn=zs.forwardRef(function(t,o){let{render:s,className:p,style:f,...m}=t,{state:i}=De(),c=P(),n=c.useState("open"),l=c.useState("disabled"),C=c.useState("readOnly"),F=c.useState("hasSelectedValue"),T=c.useState("selectionMode"),N=Lt(c),g=l,I=qe(),u={...i,open:n,disabled:g,readOnly:C,popupSide:N,listEmpty:I,placeholder:T==="none"?!1:!F},d=Q(v=>{c.set("inputGroupElement",v)});return M("div",t,{ref:[o,d],props:[{role:"group",onMouseDown(v){Uo(v,c,g,Y=>Ie(c.context.chipsContainerRef.current,Y))}},m],state:u,stateAttributesMapping:Tt})});Rn.displayName="ComboboxInputGroup";var Ks=x(D(),1);var vn=Ks.forwardRef(function(t,o){let{render:s,className:p,style:f,...m}=t;return M("span",t,{ref:o,props:[{"aria-hidden":!0,children:"\u25BC"},m]})});vn.displayName="ComboboxIcon";var Ws=x(D(),1);var ra={...Nt,..._r},En=Ws.forwardRef(function(t,o){let{render:s,className:p,disabled:f=!1,nativeButton:m=!0,keepMounted:i=!1,style:c,...n}=t,{disabled:l}=De(),C=P(),F=C.useState("selectionMode"),T=C.useState("disabled"),N=C.useState("readOnly"),g=C.useState("open"),I=C.useState("selectedValue"),V=C.useState("hasSelectionChips"),u=At(),d=!1;F==="none"?d=u!=="":F==="single"?d=I!=null:d=V;let v=l||T||f,{buttonRef:Y,getButtonProps:L}=je({native:m,disabled:v}),{mounted:_,transitionStatus:U,setMounted:q}=Nr(d),k={disabled:v,visible:d,open:g,transitionStatus:U};xo({open:d,ref:C.context.clearRef,onComplete(){d||q(!1)}});let K=M("button",t,{state:k,ref:[o,Y,C.context.clearRef],props:[{tabIndex:-1,children:"x",onMouseDown(w){w.preventDefault()},onClick(w){if(v||N)return;let S=at(w);C.context.setInputValue("",A(R.clearPress,w.nativeEvent)),F!=="none"?(C.context.setSelectedValue(Array.isArray(I)?[]:null,A(R.clearPress,w.nativeEvent)),C.context.setIndices({activeIndex:null,selectedIndex:null,type:S,event:w.nativeEvent})):C.context.setIndices({activeIndex:null,type:S,event:w.nativeEvent}),C.context.inputRef.current?.focus()}},n,L],stateAttributesMapping:ra});return i||_?K:null});En.displayName="ComboboxClear";var zo=x(D(),1);var Xs=x(D(),1);var _t=x(D(),1),Qs=x(le(),1),yn=_t.createContext(null);yn.displayName="GroupCollectionContext";function Ys(){return _t.useContext(yn)}function $s(e){let{children:t,items:o}=e,s=_t.useMemo(()=>({items:o}),[o]);return(0,Qs.jsx)(yn.Provider,{value:s,children:t})}var Js=x(le(),1);function qo(e){let{children:t}=e,{filteredItems:o}=Ae(),s=Ys(),p=s?s.items:o;return(0,Js.jsx)(Xs.Fragment,{children:p.map(t)})}var Sn=x(le(),1),Pn=zo.forwardRef(function(t,o){var s;let{render:p,className:f,style:m,children:i,...c}=t,n=P(),l=ut(),C=!!ct(!0),{filteredItems:F,hasItems:T}=Ae(),N=n.useState("selectionMode"),g=n.useState("grid"),I=n.useState("readOnly"),V=n.useState("listProps"),u=n.useState("virtualized"),d=n.useState("forceMounted"),v=N==="multiple",Y=F.length===0,L=Q(w=>{n.set("positionerElement",w)}),_=Q(w=>{n.set("listElement",w)}),U=zo.useMemo(()=>typeof i=="function"?s||(s=(0,Sn.jsx)(qo,{children:i})):i,[i]),q={empty:Y},k=l.useState("floatingId"),K=M("div",t,{state:q,ref:[o,_,C?null:L],props:[V,{children:U,tabIndex:-1,id:k,role:g?"grid":"listbox","aria-multiselectable":v?"true":void 0,"aria-readonly":!g&&I?!0:void 0,onKeyDown(w){if(!(n.state.disabled||n.state.readOnly)&&w.key==="Enter"){let S=n.state.activeIndex;if(S==null)return;he(w),Fo(n,S,w.nativeEvent)}}},c]});if(u)return K;let W=T&&!d?void 0:n.context.labelsRef;return(0,Sn.jsx)(co,{elementsRef:n.context.listRef,labelsRef:W,children:K})});Pn.displayName="ComboboxList";var Zs=x(D(),1);var Nn=Zs.forwardRef(function(t,o){let{render:s,className:p,style:f,children:m,...i}=t,c=Io();return M("div",t,{ref:[o,c],props:[{children:m,role:"status","aria-live":"polite","aria-atomic":!0},i]})});Nn.displayName="ComboboxStatus";var ti=x(D(),1);var Ko=x(D(),1),Wo=Ko.createContext(void 0);Wo.displayName="ComboboxPortalContext";function ei(){let e=Ko.useContext(Wo);if(e===void 0)throw new Error("Base UI: <Combobox.Portal> is missing.");return e}var Vn=x(le(),1),wn=ti.forwardRef(function(t,o){let{keepMounted:s=!1,...p}=t,f=P(),m=f.useState("mounted"),i=f.useState("forceMounted");return m||s||i?(0,Vn.jsx)(Wo.Provider,{value:s,children:(0,Vn.jsx)(Ur,{ref:o,...p})}):null});wn.displayName="ComboboxPortal";var oi=x(D(),1);var sa={...Vt,...Nt},On=oi.forwardRef(function(t,o){let{render:s,className:p,style:f,...m}=t,i=P(),c=i.useState("open"),n=i.useState("mounted"),l=i.useState("transitionStatus");return M("div",t,{state:{open:c,transitionStatus:l},ref:o,stateAttributesMapping:sa,props:[{role:"presentation",hidden:!n,style:{userSelect:"none",WebkitUserSelect:"none"}},m]})});On.displayName="ComboboxBackdrop";var ni=x(D(),1);var Qo=x(le(),1),Dn=ni.forwardRef(function(t,o){let{render:s,className:p,anchor:f,positionMethod:m,side:i,align:c,sideOffset:n,alignOffset:l,collisionBoundary:C="clipping-ancestors",collisionPadding:F,arrowPadding:T,sticky:N,disableAnchorTracking:g=!1,collisionAvoidance:I=jr,style:V,...u}=t,d=P(),v=ut(),Y=ei(),L=d.useState("modal"),_=d.useState("open"),U=d.useState("mounted"),q=d.useState("openMethod"),k=d.useState("positionerElement"),K=d.useState("triggerElement"),W=d.useState("inputElement"),w=d.useState("inputGroupElement"),S=d.useState("inputInsidePopup"),ke=d.useState("transitionStatus"),$=qe(),ie=ss({anchor:f??(S?K:w??W),floatingRootContext:v,positionMethod:m,mounted:U,side:i,sideOffset:n,align:c,alignOffset:l,arrowPadding:T,collisionBoundary:C,collisionPadding:F,sticky:N,disableAnchorTracking:g,keepMounted:Y,collisionAvoidance:I,lazyFlip:!0});as(_&&L,q==="touch",k,K);let pe={open:_,side:ie.side,align:ie.align,anchorHidden:ie.anchorHidden,empty:$};ue(()=>{d.set("popupSide",ie.side)},[d,ie.side]);let ce=Q(Re=>{d.set("positionerElement",Re)}),ze=is(t,pe,{styles:ie.positionerStyles,transitionStatus:ke,props:u,refs:[o,ce],hidden:!U,inert:!_});return(0,Qo.jsxs)(jo.Provider,{value:ie,children:[U&&L&&(0,Qo.jsx)(es,{inert:Zr(!_),cutout:w??W??K}),ze]})});Dn.displayName="ComboboxPositioner";var Yo=x(D(),1);var Xt=x(le(),1),ia={...Vt,...Nt},Mn=Yo.forwardRef(function(t,o){let{render:s,className:p,style:f,initialFocus:m,finalFocus:i,...c}=t,n=P(),l=ct(),C=ut(),F=n.useState("mounted"),T=n.useState("open"),N=n.useState("openMethod"),g=n.useState("popupProps"),I=n.useState("transitionStatus"),V=n.useState("inputInsidePopup"),u=n.useState("inputElement"),d=n.useState("modal"),v=n.useState("id"),Y=qe(),L=c.id??(V?Mo(v):void 0);ue(()=>(n.set("popupId",n.context.popupRef.current?.id||L),()=>{n.set("popupId",void 0)}),[n,L]),xo({open:T,ref:n.context.popupRef,onComplete(){T&&n.context.onOpenChangeComplete(!0)}});let _={open:T,side:l.side,align:l.align,anchorHidden:l.anchorHidden,transitionStatus:I,empty:Y},U=M("div",t,{state:_,ref:[o,n.context.popupRef],props:[g,{id:L,role:V?"dialog":"presentation",onFocus(w){let S=Ze(w.nativeEvent);N!=="touch"&&(Ie(n.state.listElement,S)||S===w.currentTarget)&&n.context.inputRef.current?.focus()}},rs(I),c],stateAttributesMapping:ia}),k=m===void 0?V?w=>w==="touch"?n.context.popupRef.current:u:!1:m,K;i!=null?K=i:K=V?void 0:!1;let W=!V||d;return(0,Xt.jsx)(qr,{context:C,disabled:!F,modal:W,openInteractionType:N,initialFocus:k,returnFocus:K,getInsideElements:()=>[n.context.startDismissRef.current,n.context.endDismissRef.current],children:(0,Xt.jsxs)(Yo.Fragment,{children:[U,W&&(0,Xt.jsx)(Yt,{ref:n.context.endDismissRef})]})})});Mn.displayName="ComboboxPopup";var ri=x(D(),1);var An=ri.forwardRef(function(t,o){let{render:s,className:p,style:f,...m}=t,i=P(),{arrowRef:c,side:n,align:l,arrowUncentered:C,arrowStyles:F}=ct(),N={open:i.useState("open"),side:n,align:l,uncentered:C};return M("div",t,{ref:[c,o],stateAttributesMapping:Vt,state:N,props:{style:F,"aria-hidden":!0,...m}})});An.displayName="ComboboxArrow";var Ft=x(D(),1);var $o=x(D(),1),Xo=$o.createContext(void 0);Xo.displayName="ComboboxGroupContext";function si(){let e=$o.useContext(Xo);if(e===void 0)throw new Error("Base UI: ComboboxGroupContext is missing. ComboboxGroup parts must be placed within <Combobox.Group>.");return e}var Tn=x(le(),1),Ln=Ft.forwardRef(function(t,o){let{render:s,className:p,style:f,items:m,...i}=t,n=P().useState("grid"),[l,C]=Ft.useState(),F=Ft.useMemo(()=>({labelId:l,setLabelId:C,items:m}),[l,C,m]),T=M("div",t,{ref:o,props:[{role:n?"rowgroup":"group","aria-labelledby":l},i]}),N=(0,Tn.jsx)(Xo.Provider,{value:F,children:T});return m?(0,Tn.jsx)($s,{items:m,children:N}):N});Ln.displayName="ComboboxGroup";var ii=x(D(),1);var _n=ii.forwardRef(function(t,o){let{render:s,className:p,style:f,id:m,...i}=t,{setLabelId:c}=si(),n=fo(m);return ue(()=>(c(n),()=>{c(C=>C===n?void 0:C)}),[n,c]),M("div",t,{ref:o,props:[{id:n,"aria-hidden":!0},i]})});_n.displayName="ComboboxGroupLabel";var ot=x(D(),1),ui=x(yr(),1);var Jo=x(D(),1),Zo=Jo.createContext(void 0);Zo.displayName="ComboboxItemContext";function ai(){let e=Jo.useContext(Zo);if(!e)throw new Error("Base UI: ComboboxItemContext is missing. ComboboxItem parts must be placed within <Combobox.Item>.");return e}var en=x(D(),1),tn=en.createContext(!1);tn.displayName="ComboboxRowContext";function li(){return en.useContext(tn)}var Jt=x(le(),1);function ci(e){let{componentProps:t,forwardedRef:o,virtualized:s,indexFromFilter:p}=e,{render:f,className:m,style:i,value:c=null,index:n,disabled:l=!1,nativeButton:C=!1,...F}=t,T=ot.useRef(null),N=bo({guess:!0,index:n,textRef:T}),g=P(),I=li(),V=Ms(),{props:u,id:d,selectionMode:v,disabled:Y,readOnly:L,isItemEqualToValue:_}=g.useState("itemRoot"),U=Y||l,q=v!=="none",k=n??p??N.index,K=k!==-1,W=g.useState("isActive",k),w=g.useState("isSelected",c),S=ot.useRef(null),ke=d!=null&&K?`${d}-${k}`:void 0,$=w&&q;ue(()=>{if(!(K&&(s||n!=null)))return;let re=g.context.listRef.current;return re[k]=S.current,()=>{delete re[k]}},[K,s,k,n,g]),ue(()=>{if(!K||V)return;let j=g.context.valuesRef.current;return j[k]=c,()=>{delete j[k]}},[K,V,k,c,g]),ue(()=>{if(!K||V)return;let j=g.state.selectedValue,re=g.state.selectedIndex;g.state.selectionMode==="multiple"&&Array.isArray(j)?re=Is(k,c,g.context.valuesRef.current,j,_,re):et(c,j,_)&&(re=k),g.set("selectedIndex",re)},[K,V,g,k,c,_]);let{getButtonProps:Be,buttonRef:ie}=je({disabled:U,focusableWhenDisabled:!0,native:C,composite:!0}),pe={disabled:U,selected:$,highlighted:W};function ce(j){function re(){g.context.handleSelection(j,c)}g.state.submitOnItemClick?(ui.flushSync(re),g.context.requestSubmit()):re()}let ze={id:ke,role:I?"gridcell":"option","aria-selected":q?$:void 0,tabIndex:void 0,onPointerDownCapture(j){j.isPrimary&&(g.context.pointerDownItemRef.current=j.currentTarget),j.preventDefault()},onMouseDown(j){j.preventDefault()},onClick(j){U||L||ce(j.nativeEvent)},onMouseUp(j){let re=g.context.pointerDownItemRef.current===j.currentTarget;g.context.pointerDownItemRef.current=null,!(U||L||j.button!==0||re||!W)&&ce(j.nativeEvent)}},Re=M("div",t,{ref:[ie,o,N.ref,S],state:pe,props:[u,ze,F,Be]}),Ke=ot.useMemo(()=>({selected:$,textRef:T}),[$,T]);return(0,Jt.jsx)(Zo.Provider,{value:Ke,children:Re})}function aa(e){let{componentProps:t,forwardedRef:o}=e,p=P().useState("isItemEqualToValue"),{flatFilteredValues:f}=Ae(),m=t.value??null,i=Mt(f,m,p);return(0,Jt.jsx)(ci,{componentProps:t,forwardedRef:o,virtualized:!0,indexFromFilter:i})}var Fn=ot.memo(ot.forwardRef(function(t,o){let p=P().useState("virtualized");return p&&t.index==null?(0,Jt.jsx)(aa,{componentProps:t,forwardedRef:o}):(0,Jt.jsx)(ci,{componentProps:t,forwardedRef:o,virtualized:p,indexFromFilter:void 0})}));Fn.displayName="ComboboxItem";var mi=x(D(),1);var pi=x(le(),1),kn=mi.forwardRef(function(t,o){let{render:s,className:p,style:f,...m}=t,i=M("div",t,{ref:o,props:[{role:"row"},m]});return(0,pi.jsx)(tn.Provider,{value:!0,children:i})});kn.displayName="ComboboxRow";var di=x(D(),1);var Bn=di.forwardRef(function(t,o){let{render:s,className:p,style:f,children:m,...i}=t,{filteredItems:c}=Ae(),n=P(),l=Io(),C=c.length===0?m:null;return M("div",t,{ref:[o,n.context.emptyRef,l],props:[{children:C,role:"status","aria-live":"polite","aria-atomic":!0},i]})});Bn.displayName="ComboboxEmpty";function fi(){return Ae().filteredItems}var te={};na(te,{Arrow:()=>An,Backdrop:()=>On,Chip:()=>zn,ChipRemove:()=>Kn,Chips:()=>Un,Clear:()=>En,Collection:()=>qo,Empty:()=>Bn,Group:()=>Ln,GroupLabel:()=>_n,Icon:()=>vn,Input:()=>In,InputGroup:()=>Rn,Item:()=>Fn,ItemIndicator:()=>Gn,Label:()=>Hn,List:()=>Pn,Popup:()=>Mn,Portal:()=>wn,Positioner:()=>Dn,Root:()=>xi,Row:()=>kn,Separator:()=>Si,Status:()=>Nn,Trigger:()=>hn,Value:()=>hi,createItems:()=>Pi,useFilter:()=>_s,useFilteredItems:()=>fi});var Pm=x(D(),1);var bi=x(le(),1);function xi(e){let{multiple:t=!1,defaultValue:o,value:s,onValueChange:p,autoComplete:f,...m}=e;return(0,bi.jsx)(ks,{...m,selectionMode:t?"multiple":"single",selectedValue:s,defaultSelectedValue:o,onSelectedValueChange:p,formAutoComplete:f})}var on=x(D(),1);var Hn=on.forwardRef(function(t,o){let{render:s,className:p,style:f,...m}=t,i=m;delete i.id;let c=De(),n=P(),l=n.useState("inputInsidePopup"),C=n.useState("triggerElement"),F=n.useState("inputElement"),T=n.useState("id"),N=ys(T),g=C?.id??(l?T:void 0);on.useEffect(()=>{if(!F||l)return;let V=Sr.captureOwnerStack?.()||"";lo(`<Combobox.Label> labels <Combobox.Trigger> only. When <Combobox.Input> is the form control, use a native <label> or <Field.Label> instead.${V}`)},[F,l]);let I=Es({id:N,fallbackControlId:g,setLabelId(V){let u=typeof V=="function"?V(n.state.labelId):V;n.set("labelId",u)}});return M("div",t,{ref:o,state:c.state,props:[I,m],stateAttributesMapping:Ro})});Hn.displayName="ComboboxLabel";var Ci=x(D(),1);var gi=x(le(),1);function hi(e){let{children:t,placeholder:o}=e,s=P(),p=s.useState("itemToStringLabel"),f=s.useState("selectedValue"),m=s.useState("items"),i=s.useState("selectionMode")==="multiple",c=s.useState("hasSelectedValue"),n=!c&&o!=null&&t==null,l=s.useState("hasNullItemLabel",n),C=null;return typeof t=="function"?C=t(f):t!=null?C=t:!c&&o!=null&&!l?C=o:i&&Array.isArray(f)?C=ps(f,m,p):C=ms(f,m,p),(0,gi.jsx)(Ci.Fragment,{children:C})}var Ii=x(D(),1);var Ri=x(le(),1),Gn=Ii.forwardRef(function(t,o){let{selected:s}=ai();return t.keepMounted||s?(0,Ri.jsx)(Ps,{...t,selected:s,ref:o}):null});Gn.displayName="ComboboxItemIndicator";var kt=x(D(),1);var jn=x(le(),1),Un=kt.forwardRef(function(t,o){let{render:s,className:p,style:f,...m}=t,i=P(),c=i.useState("hasSelectionChips"),n=kt.useRef([]),l=M("div",t,{ref:[o,i.context.chipsContainerRef],props:[c?{role:"toolbar"}:Kt,{onMouseDown(F){Uo(F,i,i.state.disabled)}},m]}),C=kt.useMemo(()=>({chipsRef:n}),[]);return(0,jn.jsx)(Bo.Provider,{value:C,children:(0,jn.jsx)(co,{elementsRef:n,children:l})})});Un.displayName="ComboboxChips";var sn=x(D(),1),qn=x(yr(),1);var nn=x(D(),1),rn=nn.createContext(void 0);rn.displayName="ComboboxChipContext";function vi(){let e=nn.useContext(rn);if(!e)throw new Error("Base UI: ComboboxChipContext is missing. ComboboxChip parts must be placed within <Combobox.Chip>.");return e}var Ei=x(le(),1),zn=sn.forwardRef(function(t,o){let{render:s,className:p,style:f,...m}=t,i=P(),{chipsRef:c}=Ho(),n=wt(),l=i.useState("disabled"),C=i.useState("readOnly"),F=i.useState("selectedValue"),{ref:T,index:N}=bo();function g(d){let v=N,[Y,L]=_o(n);return d.key===Y?(d.preventDefault(),N>0?v=N-1:v=void 0):d.key===L?(d.preventDefault(),N<c.current.length-1?v=N+1:v=void 0):d.key==="Backspace"||d.key==="Delete"?(v=js(N,F.length),he(d),qn.flushSync(()=>{i.context.setIndices({activeIndex:null,selectedIndex:null,type:R.keyboard,event:d.nativeEvent}),i.context.setSelectedValue(F.filter((_,U)=>U!==N),A(R.none,d.nativeEvent))})):d.key==="Enter"||d.key===" "?(he(d),v=void 0):d.key==="ArrowDown"||d.key==="ArrowUp"?(he(d),qn.flushSync(()=>{i.context.setOpen(!0,A(R.listNavigation,d.nativeEvent))}),v=void 0):d.key.length===1&&!d.ctrlKey&&!d.metaKey&&!d.altKey&&(v=void 0),v}let V=M("div",t,{ref:[o,T],state:{disabled:l},props:[{tabIndex:-1,"aria-disabled":l||void 0,"aria-readonly":C||void 0,onKeyDown(d){if(l||C)return;let v=g(d);v===void 0?i.context.inputRef.current?.focus():c.current[v]?.focus()}},m]}),u=sn.useMemo(()=>({index:N}),[N]);return(0,Ei.jsx)(rn.Provider,{value:u,children:V})});zn.displayName="ComboboxChip";var yi=x(D(),1);var Kn=yi.forwardRef(function(t,o){let{render:s,className:p,disabled:f=!1,nativeButton:m=!0,style:i,...c}=t,n=P(),{index:l}=vi(),C=n.useState("disabled"),F=n.useState("readOnly"),T=n.useState("selectedValue"),N=n.useState("isItemEqualToValue"),g=C||f,{buttonRef:I,getButtonProps:V}=je({native:m,disabled:g||F,focusableWhenDisabled:!0}),u={disabled:g};function d(L,_){let U=n.state.activeIndex;if(U==null)return;let q=Mt(n.context.valuesRef.current,L,N);q!==-1&&U===q&&n.context.setIndices({activeIndex:null,type:at(_),event:_})}function v(L){let _=A(R.chipRemovePress,L.nativeEvent),U=T[l];return d(U,L.nativeEvent),n.context.setSelectedValue(T.filter((q,k)=>k!==l),_),n.context.inputRef.current?.focus(),_}return M("button",t,{ref:[o,I],state:u,props:[{tabIndex:-1,onMouseDown(L){L.preventDefault()},onClick(L){v(L).isPropagationAllowed||L.stopPropagation()},onKeyDown(L){(L.key==="Enter"||L.key===" ")&&(v(L).isPropagationAllowed||he(L))}},c,V]})});Kn.displayName="ComboboxChipRemove";var Si=Ns;function Pi(e,t){let{getValue:o,getLabel:s}=t,p=null;function f(){if(p===null){let i=new Map,c=e?Ot(e):ft;for(let n of c){if(n==null)continue;let l=o(n);i.has(l)?lo(`Two items passed to createItems() derived the value ${String(l)}, so selection and label resolution cannot tell them apart: the first item wins the label and every item carrying the value renders as selected. Return a unique value from \`getValue\`.`):i.set(l,n)}p=i}return p}function m(i){return i==null?i:o(i)}return{data:e,value:m,hasValue(i,c){return Wt(f(),i,c)!==void 0},itemLabel:s,label(i,c,n){let l=Wt(f(),i,c);return l!==void 0?s(l):lt(i,n)}}}var B=x(le()),hd=te.Root;function Id({...e}){return(0,B.jsx)(te.Value,{"data-slot":"combobox-value",...e})}function la({className:e,children:t,...o}){return(0,B.jsxs)(te.Trigger,{"data-slot":"combobox-trigger",className:Se("[&_svg:not([class*='size-'])]:size-4",e),...o,children:[t,(0,B.jsx)(Tr,{className:"pointer-events-none size-4 text-muted-foreground"})]})}function ua({className:e,...t}){return(0,B.jsx)(te.Clear,{"data-slot":"combobox-clear",render:(0,B.jsx)(Cn,{variant:"ghost",size:"icon-xs"}),className:Se(e),...t,children:(0,B.jsx)(dn,{className:"pointer-events-none"})})}function Rd({className:e,children:t,disabled:o=!1,showTrigger:s=!0,showClear:p=!1,...f}){return(0,B.jsxs)(Vs,{className:Se("w-auto",e),children:[(0,B.jsx)(te.Input,{render:(0,B.jsx)(Os,{disabled:o}),...f}),(0,B.jsxs)(ws,{align:"inline-end",children:[s&&(0,B.jsx)(Cn,{size:"icon-xs",variant:"ghost",render:(0,B.jsx)(la,{}),"data-slot":"input-group-button",className:"group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent",disabled:o}),p&&(0,B.jsx)(ua,{disabled:o})]}),t]})}function vd({className:e,side:t="bottom",sideOffset:o=6,align:s="start",alignOffset:p=0,anchor:f,...m}){return(0,B.jsx)(te.Portal,{container:os(),children:(0,B.jsx)(te.Positioner,{side:t,sideOffset:o,align:s,alignOffset:p,anchor:f,className:"isolate z-50",children:(0,B.jsx)(te.Popup,{"data-slot":"combobox-content","data-chips":!!f,className:Se("group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...m})})})}function Ed({className:e,...t}){return(0,B.jsx)(te.List,{"data-slot":"combobox-list",className:Se("no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0",e),...t})}function yd({className:e,children:t,...o}){return(0,B.jsxs)(te.Item,{"data-slot":"combobox-item",className:Se("relative flex w-full cursor-default items-center gap-2 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...o,children:[t,(0,B.jsx)(te.ItemIndicator,{render:(0,B.jsx)("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center"}),children:(0,B.jsx)(Ar,{className:"pointer-events-none"})})]})}function Sd({className:e,...t}){return(0,B.jsx)(te.Group,{"data-slot":"combobox-group",className:Se(e),...t})}function Pd({className:e,...t}){return(0,B.jsx)(te.GroupLabel,{"data-slot":"combobox-label",className:Se("px-2 py-1.5 text-xs text-muted-foreground",e),...t})}function Nd({...e}){return(0,B.jsx)(te.Collection,{"data-slot":"combobox-collection",...e})}function Vd({className:e,...t}){return(0,B.jsx)(te.Empty,{"data-slot":"combobox-empty",className:Se("hidden w-full justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex",e),...t})}function wd({className:e,...t}){return(0,B.jsx)(te.Separator,{"data-slot":"combobox-separator",className:Se("-mx-1 my-1 h-px bg-border",e),...t})}function Od({className:e,...t}){return(0,B.jsx)(te.Chips,{"data-slot":"combobox-chips",className:Se("flex min-h-8 flex-wrap items-center gap-1 rounded-lg border border-input bg-transparent bg-clip-padding px-2.5 py-1 text-sm transition-colors focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1 dark:bg-input/30 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40",e),...t})}function Dd({className:e,children:t,showRemove:o=!0,...s}){return(0,B.jsxs)(te.Chip,{"data-slot":"combobox-chip",className:Se("flex h-[calc(--spacing(5.25))] w-fit items-center justify-center gap-1 rounded-sm bg-muted px-1.5 text-xs font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pr-0",e),...s,children:[t,o&&(0,B.jsx)(te.ChipRemove,{render:(0,B.jsx)(ns,{variant:"ghost",size:"icon-xs"}),className:"-ml-1 opacity-50 hover:opacity-100","data-slot":"combobox-chip-remove",children:(0,B.jsx)(dn,{className:"pointer-events-none"})})]})}function Md({className:e,...t}){return(0,B.jsx)(te.Input,{"data-slot":"combobox-chip-input",className:Se("min-w-16 flex-1 outline-none",e),...t})}function Ad(){return Ni.useRef(null)}export{hd as a,Id as b,la as c,Rd as d,vd as e,Ed as f,yd as g,Sd as h,Pd as i,Nd as j,Vd as k,wd as l,Od as m,Dd as n,Md as o,Ad as p};
2
- //# sourceMappingURL=chunk-T7JFBQSG.js.map
1
+ import{a as Vs,b as ws,c as Cn,e as Os}from"./chunk-4XESWRTW.js";import{a as ds,b as yo,c as et,d as gs,e as hs,f as Mt,g as So,h as Is,i as Rs,j as Ps,k as Ns}from"./chunk-WRHZYADJ.js";import{b as ys,c as Ss}from"./chunk-4E74H7FZ.js";import{a as Es}from"./chunk-AZWODE64.js";import{b as fs,c as Ro,d as bs,e as xs,f as De,g as Cs,i as vo,j as Eo,k as vs,l as Po}from"./chunk-GQYRJYJV.js";import{a as at,b as xn,c as Io}from"./chunk-KAZVAX35.js";import{a as ls,b as us,c as Ot,d as cs,e as lt,f as Dt,g as ms,h as ps}from"./chunk-5ZMYWE5S.js";import{a as as}from"./chunk-FROPNHO5.js";import{a as rs,g as ss,h as is}from"./chunk-QJVIEN5R.js";import{a as wt}from"./chunk-33RMFA4P.js";import{b as co,c as bo}from"./chunk-ZNWVTDCV.js";import{a as uo}from"./chunk-T4Y5HG5P.js";import{b as es,e as ts}from"./chunk-IAEAQCYR.js";import{$ as Qr,F as jr,I as Ur,Ma as os,P as qr,Q as ho,S as zr,U as Kr,V as Wr,ka as Yr,ma as $r,va as Xr,wa as Jr}from"./chunk-HCQR5YME.js";import{a as Zr}from"./chunk-B4MRCKT4.js";import{E as Gr,a as he,z as Hr}from"./chunk-QFN6XL4O.js";import{a as Co,b as Lr,c as Ie,d as fn,e as Ze,l as bn,m as _r,n as Fr,o as Vt,v as kr}from"./chunk-7OCTAHT6.js";import{a as Br,b as go}from"./chunk-URJZKT45.js";import{a as bt}from"./chunk-E75HEEMN.js";import{b as Mr}from"./chunk-R5KQ2GRA.js";import{a as A,b as Pr,c as R}from"./chunk-FTWKUXER.js";import{c as fo}from"./chunk-AAL6V4Y3.js";import{b as ns}from"./chunk-34RXMJIM.js";import{d as je}from"./chunk-CLVPTZ4G.js";import{a as lo}from"./chunk-5EK7QOB6.js";import{e as mn,f as pn,o as Vr,r as wr,t as Or}from"./chunk-LYT7LQS3.js";import{n as Ar,o as Tr,pb as dn}from"./chunk-IQ2XSDFU.js";import{b as Dr}from"./chunk-XIXCIQKJ.js";import{a as Nr,d as xo}from"./chunk-EGZKG2B2.js";import{d as Nt}from"./chunk-MQ67DRDE.js";import{a as yr}from"./chunk-UH726PMV.js";import{a as Q}from"./chunk-SFI7YWVR.js";import{a as Sr,b as ue}from"./chunk-NZ73KS2Y.js";import{b as cn,d as Je,e as ft,f as Kt,g as mo,j as po,l as M}from"./chunk-JIAVZ3V7.js";import{a as Se}from"./chunk-SVQCDOZ3.js";import{a as le}from"./chunk-CT4EH2K2.js";import{a as D}from"./chunk-IJQ26FTX.js";import{b as na,c as x}from"./chunk-KVMUXFPB.js";var Ni=x(D());var E=x(D(),1);function Ds(e,t,o,s,p,f,m,i,c,n=2){let l=Gr(o.current,{event:e,orientation:s,loopFocus:p,rtl:f,cols:n,disabledIndices:m,minIndex:i,maxIndex:c,prevIndex:t>c?i:t,stopEvent:!0});return Hr(o.current,l)?void 0:l}var Me=x(D(),1),No=Me.createContext(void 0);No.displayName="ComboboxRootContext";var Vo=Me.createContext(void 0);Vo.displayName="ComboboxFloatingContext";var wo=Me.createContext(void 0);wo.displayName="ComboboxDerivedItemsContext";var Oo=Me.createContext(!1);Oo.displayName="ComboboxHasItemsContext";var Do=Me.createContext("");Do.displayName="ComboboxInputValueContext";function P(){let e=Me.useContext(No);if(!e)throw new Error("Base UI: ComboboxRootContext is missing. Combobox parts must be placed within <Combobox.Root>.");return e}function ut(){let e=Me.useContext(Vo);if(!e)throw new Error("Base UI: ComboboxFloatingContext is missing. Combobox parts must be placed within <Combobox.Root>.");return e}function Ae(){let e=Me.useContext(wo);if(!e)throw new Error("Base UI: ComboboxItemsContext is missing. Combobox parts must be placed within <Combobox.Root>.");return e}function At(){return Me.useContext(Do)}function Ms(){return Me.useContext(Oo)}var As={id:e=>e.id,labelId:e=>e.labelId,items:e=>e.items,selectedValue:e=>e.selectedValue,hasSelectionChips:e=>{let t=e.selectedValue;return Array.isArray(t)&&t.length>0},hasSelectedValue:e=>{let{selectedValue:t,selectionMode:o}=e;return t==null?!1:o==="multiple"&&Array.isArray(t)?t.length>0:!0},hasNullItemLabel:(e,t)=>t?cs(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMounted:e=>e.forceMounted,inline:e=>e.inline,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let o=e.isItemEqualToValue,s=e.selectedValue;return Array.isArray(s)?s.some(p=>et(t,p,o)):et(t,s,o)},transitionStatus:e=>e.transitionStatus,popupProps:e=>e.popupProps,listProps:e=>e.listProps,inputProps:e=>e.inputProps,triggerProps:e=>e.triggerProps,itemRoot:e=>e.itemRoot,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupId:e=>e.popupId,triggerElement:e=>e.triggerElement,inputElement:e=>e.inputElement,inputGroupElement:e=>e.inputGroupElement,popupSide:e=>e.popupSide,openMethod:e=>e.openMethod,inputInsidePopup:e=>e.inputInsidePopup,inputOwnsFormValue:e=>e.inputOwnsFormValue,selectionMode:e=>e.selectionMode,name:e=>e.name,form:e=>e.form,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,grid:e=>e.grid,virtualized:e=>e.virtualized,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,modal:e=>e.modal,autoHighlight:e=>e.autoHighlight};function Mo(e){return e==null?void 0:`${e}-popup`}function Ao(e,t){return(o,s)=>o==null?!1:e.contains(o,s,t)}function Ts(e,t,o){return(s,p)=>{if(s==null)return!1;if(!p)return!0;let f=t?.selected??t,m=o!=null?lt(o,f):"";return m&&e.contains(m,p)&&m.length===p.length?!0:e.contains(s,p,t)}}var To=x(D(),1);var Ls=xn;function _s(e={}){let{multiple:t=!1,value:o,...s}=e,p=xn(s),f=To.useCallback((m,i,c)=>t?Ao(p,c)(m,i):Ts(p,c,o)(m,i),[p,o,t]);return To.useMemo(()=>({...p,contains:f}),[f,p])}function Fs(e,t=!1){let{overflowY:o}=Vr(e);return o!=="auto"&&o!=="scroll"?!1:t?e.clientHeight>0:e.scrollHeight>e.clientHeight}var gn=Symbol("none"),Lo={value:gn,index:-1};function Wt(e,t,o){let s=e.get(t);if(s!==void 0||o===yo)return s;for(let[p,f]of e)if(et(p,t,o))return f}var Ue=x(le(),1);function ks(e){let{id:t,onOpenChangeComplete:o,defaultSelectedValue:s=null,selectedValue:p,onSelectedValueChange:f,defaultInputValue:m,inputValue:i,open:c,defaultOpen:n=!1,selectionMode:l,onItemHighlighted:C,name:F,form:T,disabled:N=!1,readOnly:g=!1,required:I=!1,inputRef:V,grid:u=!1,items:d,filteredItems:v,filter:Y,filterQuery:L,openOnInputClick:_=!0,autoHighlight:U=!1,keepHighlight:q=!1,highlightItemOnHover:k=!0,loopFocus:K=!0,itemToStringLabel:W,itemToStringValue:w,isItemEqualToValue:S=yo,virtualized:ke=!1,inline:$=!1,fillInputOnItemPress:Be=!0,modal:ie=!1,limit:pe=-1,autoComplete:ce="list",formAutoComplete:ze,locale:Re,submitOnItemClick:Ke=!1}=e,{clearErrors:j}=vs(),{setDirty:re,validityData:xt,setFilled:We,name:Ct,disabled:gt,setTouched:mt,setFocused:nt,validationMode:rt,validation:Te}=De(),Bt=wt(),Pe=Eo({id:t}),Qe=Ls({locale:Re}),H=Array.isArray(d)?null:d;if(H&&typeof H.label!="function")throw new Error("Base UI: the `items` prop received an object that is not a collection, so its items cannot be read. Pass an array of items, an array of groups with items, or the result of `createItems()`. See https://base-ui.com/react/components/combobox#createitems");let Z=H?H.data:d,Ve=H?.value,st=Ve?void 0:Z,b=E.useMemo(()=>{if(!v||!Ve)return;let r=Ot(v),a=r.map(Ve),y;return{values:a,findItem(G,ee){if(!y){y=new Map;for(let ae=0;ae<a.length;ae+=1)y.has(a[ae])||y.set(a[ae],r[ae])}return Wt(y,G,ee)}}},[v,Ve]),O=E.useMemo(()=>H?r=>H.label(r,S,a=>{let y=b?.findItem(a,S);return y!=null?H.itemLabel(y):lt(a,W)}):W,[H,W,b,S]),fe=E.useMemo(()=>H?Object.assign(r=>H.itemLabel(r),{selected:r=>lt(r,O)}):W,[H,O,W]);function be(r){return lt(r,O)}let[Ye,oe]=E.useState(!1),[ne,Le]=E.useState(null),ht=E.useRef(ne),_e=E.useRef([]),It=E.useRef([]),Rt=E.useRef(null),ve=E.useRef(null),Vi=E.useRef(null),wi=E.useRef(null),Wn=E.useRef(null),Qn=E.useRef(!1),Yn=E.useRef(null),$n=E.useRef(null),an=E.useRef(null),Ht=E.useRef(Lo),we=E.useRef(null),$e=E.useRef([]),Xn=E.useRef(null),Ee=gt||N,it=Ct??F,ye=l==="multiple",He=l==="single",Gt=i!==void 0||m!==void 0,xe=Z!==void 0,jt=v!==void 0,Ce;U==="always"?Ce="always":Ce=U?"input-change":!1;let[z,Oi]=uo({controlled:p,default:ye?s??ft:s,name:"Combobox",state:"selectedValue"}),ln=E.useMemo(()=>Y===null?()=>!0:Y!==void 0?Y:Ao(Qe,fe),[Y,Qe,fe]),Jn=cn(()=>Gt?m??"":He?be(z):"").current,[me,Di]=uo({controlled:i,default:Jn,name:"Combobox",state:"inputValue"}),[X,Mi]=uo({controlled:c,default:n,name:"Combobox",state:"open"}),Zn=us(Z),Oe=!X&&ne!==null?ne:String(me).trim(),pt=He?be(z):"",er=He&&!Ye&&Oe!==""&&pt.length===Oe.length&&Qe.contains(pt,Oe),vt=er?"":L??Oe,tr=xe&&jt&&er&&(!H||H.hasValue(z,S)),Zt=E.useMemo(()=>Z?Ot(Z):ft,[Z]),Ut=E.useMemo(()=>{if(v&&!tr)return v;if(!Z)return ft;if(Zn){let a=Z,y=[],G=0;for(let ee of a){if(pe>-1&&G>=pe)break;let ae=pe>-1?pe-G:1/0,J=vt===""?ee.items.slice(0,ae):[];if(vt!=="")for(let se of ee.items){if(J.length>=ae)break;ln(se,vt,fe)&&J.push(se)}if(J.length>0){let se={...ee,items:J};y.push(se),G+=J.length}}return y}if(vt==="")return pe>-1?Zt.slice(0,pe):Zt;let r=[];for(let a of Zt){if(pe>-1&&r.length>=pe)break;ln(a,vt,fe)&&r.push(a)}return r},[v,tr,Z,Zn,vt,pe,ln,fe,Zt]),ge=E.useMemo(()=>{if(b&&Ut===v)return b.values;let r=Ot(Ut);return Ve?r.map(a=>Ve(a)):r},[Ut,v,b,Ve]),h=cn(()=>{let r=null;return $&&X&&xe&&l!=="none"&&(r=So(ge,z,S,ye)),new Yr({id:Pe,labelId:void 0,selectedValue:z,open:X,items:st,selectionMode:l,name:it,form:T,disabled:Ee,readOnly:g,required:I,grid:u,virtualized:ke,openOnInputClick:_,itemToStringLabel:O,isItemEqualToValue:S,modal:ie,autoHighlight:Ce,submitOnItemClick:Ke,hasInputValue:Gt,mounted:!1,forceMounted:!1,transitionStatus:"idle",inline:$,activeIndex:null,selectedIndex:r,popupProps:{},listProps:{},inputProps:{},triggerProps:{},itemRoot:{props:Kt,id:Pe,selectionMode:l,disabled:Ee,readOnly:g,isItemEqualToValue:S},positionerElement:null,listElement:null,popupId:void 0,triggerElement:null,inputElement:null,inputGroupElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,inputOwnsFormValue:l==="none"},{onOpenChangeComplete:Je,setOpen:Je,setInputValue:Je,setSelectedValue:Je,setIndices:Je,handleSelection:Je,forceMount:Je,requestSubmit:Je,listRef:_e,labelsRef:It,popupRef:Rt,emptyRef:Wn,inputRef:ve,startDismissRef:Vi,endDismissRef:wi,chipsContainerRef:Yn,clearRef:$n,valuesRef:$e,pointerDownItemRef:Xn,selectionEventRef:an},As)}).current,Et=l==="none"?me:z,Ai=E.useMemo(()=>l==="none"?Et:Array.isArray(z)?z.map(r=>Dt(r,w)):Dt(z,w),[Et,w,l,z]),Ti=Q(C),Li=Q(o),or=h.useState("activeIndex"),_i=h.useState("selectedIndex"),eo=h.useState("positionerElement"),nr=h.useState("listElement"),qt=h.useState("triggerElement"),to=h.useState("inputElement"),Fi=h.useState("inputGroupElement"),de=h.useState("inline"),Fe=h.useState("inputInsidePopup"),ki=h.useState("inputOwnsFormValue"),rr=He&&!Fe&&me===pt,Bi=Mr(qt),{openMethod:Hi,triggerProps:sr}=ts(X),Gi=Q(()=>Ai);Cs(Fe?Bi:ve,Pe,Et,Gi,!Ee,F);let ir=Q(()=>{Z?It.current=ge.map(be):h.set("forceMounted",!0)}),yt=Q((r,a,y,G)=>{if(a===-1){if(Ht.current===Lo)return;Ht.current=Lo}else Ht.current={value:r,index:a};Ti(r,Pr(y,G,{index:a}))}),Xe=Q(r=>{let a={};r.activeIndex!==void 0&&(a.activeIndex=r.activeIndex),r.selectedIndex!==void 0&&(a.selectedIndex=r.selectedIndex),h.update(a);let y=r.activeIndex;if(y===void 0)return;let G=r.type||R.none;y===null?yt(void 0,-1,G,r.event):yt($e.current[y],y,G,r.event)}),Ge=Q((r,a)=>{if(e.onInputValueChange?.(r,a),!a.isCanceled){if(Qn.current=a.reason===R.inputClear,a.reason===R.inputChange){X&&ne!==null&&Le(null);let y=a.event,G=y.inputType;if(y.type==="compositionend"||G!=null&&G!==""&&G!=="insertReplacementText"){let ae=r.trim()!=="";ae&&oe(!0),we.current={hasQuery:ae};let J=h.state.listElement;if(!h.state.virtualized&&J){let se=Rt.current;for(let Ne of wr(J.firstElementChild??J)){if(!pn(Ne)||(se?!Ie(se,Ne):Ne.getAttribute("role")==="dialog"))break;if(Fs(Ne)){Ne.scrollTop=0;break}}}ae&&Ce&&h.state.activeIndex==null&&(X||de)&&h.set("activeIndex",0)}}else a.reason===R.inputClear&&r===""&&h.state.inputInsidePopup&&(we.current={hasQuery:!1,selection:!0});Di(r)}}),ar=Q(r=>{let a=!r&&Fe&&!de&&me!==""&&(String(me).trim()===ne||me===pt);!r&&(a||me===""||rr)&&oe(!1),Le(null),a&&Ge("",A(R.inputClear))}),[ji,lr]=E.useState(!1),dt=Q((r,a)=>{if(X===r)return;a.reason===R.escapeKey&&xe&&ge.length===0&&!Wn.current&&a.allowPropagation();let y=a,G=Qr(y);if(e.onOpenChange?.(r,y),we.current?.hasQuery&&a.reason===R.inputChange===a.isCanceled&&(we.current=null),!a.isCanceled&&(r&&ne!==null&&ar(a.reason===R.inputChange),!r&&Ye&&(He?(de||Le(Oe),Oe===""&&oe(!1)):ye&&(de||Le(Oe),Fe&&Xe({activeIndex:null}),(!Fe||de)&&Ge("",A(R.inputClear,a.event,void 0,{isItemPress:a.reason===R.itemPress})))),r||lr(G()),Mi(r),!r&&Fe&&(a.reason===R.focusOut||a.reason===R.outsidePress)&&(mt(!0),nt(!1),rt==="onBlur"))){let ee=l==="none"?me:z;Te.commit(ee)}}),oo=Q((r,a)=>{if(f?.(r,a),a.isCanceled)return;Oi(r),(l==="none"&&Rt.current&&Be||He&&!h.state.inputInsidePopup)&&Ge(be(r),A(a.reason,a.event))}),Ui=Q((r,a)=>{let y=Ze(r),G=an.current??r;an.current=null;let ee=A(R.itemPress,G),ae=fn(y,"a")?.getAttribute("href");if(ae){ae.startsWith("#")&&dt(!1,ee);return}if(ye){let J=Array.isArray(z)?z:[],se=hs(J,a,S),Ne=se?Rs(J,a,S):[...J,a];if(oo(Ne,ee),ee.isCanceled||!(ve.current?ve.current.value.trim()!=="":!1))return;if(h.state.inputInsidePopup){Ge("",A(R.inputClear,ee.event,void 0,{isItemPress:!0}));let Pt=we.current;Pt&&!se&&(Pt.toggledValue=a)}else dt(!1,ee)}else{if(oo(a,ee),ee.isCanceled)return;dt(!1,ee)}}),qi=Q(()=>{let r=Te.inputRef.current?.form??h.state.inputElement?.form;r&&typeof r.requestSubmit=="function"&&r.requestSubmit()}),zi=Q(()=>{if(Li?.(!1),oe(!1),Le(null),Xe(l==="none"?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),ye&&ve.current&&ve.current.value!==""&&!Qn.current&&Ge("",A(R.inputClear)),He)if(h.state.inputInsidePopup)ve.current&&ve.current.value!==""&&Ge("",A(R.inputClear));else{let r=be(z);if(ve.current&&ve.current.value!==r){let a=r===""?R.inputClear:R.none;Ge(r,A(a))}}}),no=E.useMemo(()=>de&&eo?{current:fn(eo,'[role="dialog"]')}:Rt,[de,eo]),{mounted:Ki,transitionStatus:ur,forceUnmount:cr}=Kr({open:X,ref:no,preventUnmountOnClose:ji,setPreventUnmountOnClose:lr,onUnmount:zi});E.useImperativeHandle(e.actionsRef,()=>({unmount:cr,close:()=>dt(!1,A(R.imperativeAction))}),[cr,dt]),ue(function(){let a=ht.current!==null&&ne===null;if(ht.current=ne,X&&(!a||!xe)||(X||(Xn.current=null),l==="none"))return;let y=xe?ge:$e.current;Xe({selectedIndex:So(y,z,S,ye)})},[X,ne,z,l,ye,xe,ge,S,Xe]),ue(()=>{Z&&($e.current=ge,_e.current.length=ge.length)},[Z,ge]),ue(()=>{!X&&we.current?.hasQuery&&(we.current=null)},[X]),ue(()=>{if(!X&&de&&no.current){we.current=null;return}let r=xe||jt?ge:$e.current,a=we.current;if(a){let J=X||de||h.state.positionerElement?.hidden===!1;if(a.hasQuery){let se=ve.current;!Ce||String(me).trim()===""||de&&Ce!=="always"&&(!se||Lr(se.ownerDocument)!==se)?we.current=null:J&&(r[0]!==void 0||!xe&&!jt)&&(h.set("activeIndex",0),we.current=null)}else if(String(me).trim()===""&&(we.current=null,J)){let se=a.selection;Ce==="always"&&!se&&h.state.selectionMode==="none"&&h.set("activeIndex",0),queueMicrotask(()=>{if(!h.state.open&&(!h.state.inline||no.current)||ve.current&&ve.current.value.trim()!=="")return;let Ne=h.state.selectedValue,zt=h.state.selectionMode==="multiple";if(zt&&Array.isArray(Ne)?Ne.length>0:h.state.selectionMode!=="none"&&Ne!=null){let vr=xe||jt?ge:$e.current,Er=Mt(vr,a.toggledValue,h.state.isItemEqualToValue);h.set("activeIndex",Er!==-1?Er:So(vr,Ne,h.state.isItemEqualToValue,zt))}else se?h.set("activeIndex",null):Ce==="always"&&h.set("activeIndex",0)})}}if(!X&&!de)return;let y=h.state.activeIndex;if(y==null){if(Ce==="always"&&r.length>0){h.set("activeIndex",0);return}yt(void 0,-1,R.none);return}if(y>=r.length){yt(void 0,-1,R.none),h.set("activeIndex",null);return}let G=r[y],ee=Ht.current.value,ae=ee!==gn&&et(G,ee,h.state.isItemEqualToValue);(Ht.current.index!==y||!ae)&&yt(G,y,R.none)},[or,Ce,yt,jt,xe,ge,de,X,no,h,me]),ue(()=>{if(l==="none"){We(String(me)!=="");return}We(ye?Array.isArray(z)&&z.length>0:z!=null)},[We,l,me,z,ye]),E.useEffect(()=>{xe&&Ce&&ge.length===0&&Xe({activeIndex:null})},[xe,Ce,ge.length,Xe]);function Wi(){X&&Oe!==""&&Oe!==String(Jn)&&!rr&&oe(!0)}function Qi(){X&&ne!==null&&ar(!1)}let mr=!1;function pr(){!mr&&me!==pt&&(mr=!0,Ge(pt,A(R.none)))}function Yi(){l!=="none"&&(j(it),re(gs(z,xt.initialValue,S)),Te.change(z),He&&!Gt&&!Fe&&pr())}function dr(){He&&!Gt&&!Fe&&!Ye&&pr()}function $i(){l==="none"&&(j(it),re(me!==xt.initialValue),Te.change(me))}bt(Oe,Wi),bt(X,Qi),bt(z,Yi),bt(pt,dr),bt(Z,dr),bt(me,$i);let ro=$r({open:de?!0:X,onOpenChange:dt,elements:{reference:Fe?qt:to,floating:eo}}),fr=u?"grid":"listbox",so=X||de,br=so?"true":"false",io=E.useMemo(()=>{let r=to?.tagName==="INPUT",a=to==null||r,y=a||so,G=a?{autoComplete:"off",spellCheck:"false",autoCorrect:"off",autoCapitalize:"none"}:{};return y&&(G.role="combobox",G["aria-expanded"]=br,G["aria-haspopup"]=fr,G["aria-controls"]=so?nr?.id:void 0,G["aria-autocomplete"]=g?"none":ce),{reference:G,floating:{role:"presentation"}}},[to,so,br,fr,nr?.id,ce,g]),xr=ho(ro,{enabled:!Ee&&_,event:"mousedown-only",toggle:!1,touchOpenDelay:Fe?0:100,reason:R.inputPress}),ao=zr(ro,{enabled:!Ee&&!de,outsidePressEvent:{mouse:"sloppy",touch:"intentional"},bubbles:de?!0:void 0,outsidePress(r){let a=Ze(r);return!Ie(qt,a)&&!Ie($n.current,a)&&!Ie(Yn.current,a)&&!Ie(Fi,a)}}),St=Xr(ro,{enabled:!Ee,id:Pe,listRef:_e,activeIndex:or,selectedIndex:_i,virtual:!0,loopFocus:K,allowEscape:K&&!Ce,focusItemOnOpen:Ye||l==="none"&&!Ce?!1:"auto",focusItemOnHover:k,resetOnPointerLeave:!q,orientation:u?"horizontal":void 0,rtl:Bt==="rtl",disabledIndices:ft,grid:u?Ds:void 0,onNavigate(r,a){!a&&!X&&!(de&&r===null)||ur==="ending"||Xe({activeIndex:r,type:at(a),event:a?.nativeEvent})}}),Cr=E.useMemo(()=>po(St.reference,{onKeyDown(r){u&&h.state.activeIndex==null&&(r.key==="ArrowLeft"||r.key==="ArrowRight")&&r.preventBaseUIHandler()}},ao.reference,xr.reference,io.reference),[St.reference,ao.reference,xr.reference,io.reference,u,h]),gr=E.useMemo(()=>po(Wr,ao.floating),[ao.floating]),hr=E.useMemo(()=>po(St.floating,io.floating),[St.floating,io.floating]),Ir=E.useMemo(()=>{let r=St.item;return{props:r?{...r,onFocus:void 0}:Kt,id:Pe,selectionMode:l,disabled:Ee,readOnly:g,isItemEqualToValue:S}},[St.item,Pe,l,Ee,g,S]);h.useContextCallback("setOpen",dt),h.useContextCallback("setInputValue",Ge),h.useContextCallback("setSelectedValue",oo),h.useContextCallback("setIndices",Xe),h.useContextCallback("handleSelection",Ui),h.useContextCallback("forceMount",ir),h.useContextCallback("requestSubmit",qi),h.useContextCallback("onOpenChangeComplete",o),ds(()=>{h.update({inline:$,popupProps:gr,listProps:hr,inputProps:Cr,triggerProps:sr,itemRoot:Ir})});let Rr={id:Pe,selectedValue:z,open:X,mounted:Ki,transitionStatus:ur,items:st,inline:$,popupProps:gr,listProps:hr,inputProps:Cr,triggerProps:sr,itemRoot:Ir,openMethod:Hi,selectionMode:l,name:it,form:T,disabled:Ee,readOnly:g,required:I,grid:u,virtualized:ke,openOnInputClick:_,itemToStringLabel:O,modal:ie,autoHighlight:Ce,isItemEqualToValue:S,submitOnItemClick:Ke,hasInputValue:Gt};ue(()=>{h.update({...Rr,inputOwnsFormValue:l==="none"&&($||!h.state.inputInsidePopup)})},[h,...Object.values(Rr)]);let Xi=mo(V,Te.inputRef),Ji=E.useMemo(()=>({query:Oe,hasItems:xe,filteredItems:Ut,flatFilteredValues:ge}),[Oe,xe,Ut,ge]),Zi=E.useMemo(()=>Array.isArray(Et)?"":Dt(Et,w),[Et,w]),ea=ye&&Array.isArray(z)&&z.length>0,un=ye||l==="none"&&ki?void 0:it,ta=E.useMemo(()=>!ye||!Array.isArray(z)||!it?null:z.map(r=>{let a=Dt(r,w);return(0,Ue.jsx)("input",{type:"hidden",form:T,name:it,value:a,disabled:Ee},a)}),[ye,z,T,it,w,Ee]),oa=(0,Ue.jsxs)(E.Fragment,{children:[e.children,(0,Ue.jsx)("input",{...Te.getValidationProps(Ee,{onFocus(){if(Fe){qt?.focus();return}(ve.current||qt)?.focus()},onChange(r){if(r.nativeEvent.defaultPrevented||Ee||g)return;let a=r.currentTarget.value,y=a.toLowerCase(),G=A(R.none,r.nativeEvent),ee=()=>$e.current.findIndex(J=>Dt(J,w).toLowerCase()===y||be(J).toLowerCase()===y);function ae(){if(ye)return;if(l==="none"){Ge(a,G);return}let J=ee();J===-1&&(J=$e.current.findIndex((Ne,zt)=>{let Pt=It.current[zt];return Pt!=null&&Pt.toLowerCase()===y}));let se=J===-1?void 0:$e.current[J];se!=null&&oo?.(se,G)}He&&(ir(),Z&&ee()===-1&&h.set("forceMounted",!0)),queueMicrotask(ae)}}),id:Pe&&un==null?`${Pe}-hidden-input`:void 0,form:T,name:un,autoComplete:ze,disabled:Ee,required:I&&!ea,readOnly:g,value:Zi,ref:Xi,style:un?go:Br,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),ta]});return(0,Ue.jsx)(No.Provider,{value:h,children:(0,Ue.jsx)(Vo.Provider,{value:ro,children:(0,Ue.jsx)(Oo.Provider,{value:xe,children:(0,Ue.jsx)(wo.Provider,{value:Ji,children:(0,Ue.jsx)(Do.Provider,{value:me,children:oa})})})})})}var Qt=x(D(),1);var fl=bn.popupOpen,bl=bn.pressed;var Bs="data-popup-side";var Hs="data-list-empty";var Tt={...Fr,...Ro,popupSide:e=>e?{[Bs]:e}:null,listEmpty:e=>e?{[Hs]:""}:null};function Lt(e){let t=e.useState("mounted"),o=e.useState("popupSide"),s=e.useState("positionerElement");return t&&s?o:null}function qe(){return Ae().filteredItems.length===0}function _o(e){return e==="rtl"?["ArrowRight","ArrowLeft"]:["ArrowLeft","ArrowRight"]}function js(e,t){let o=e>=t-1?t-2:e;return o>=0?o:void 0}function Fo(e,t,o){let s=e.context.listRef.current[t];s&&(e.context.selectionEventRef.current=o,s.click(),e.context.selectionEventRef.current=null)}var hn=Qt.forwardRef(function(t,o){let{render:s,className:p,nativeButton:f=!0,disabled:m=!1,id:i,style:c,...n}=t,{state:l,disabled:C,setTouched:F,validationMode:T,validation:N}=De(),{labelId:g}=vo(),I=P(),V=I.useState("selectionMode"),u=I.useState("disabled"),d=I.useState("readOnly"),v=I.useState("required"),Y=I.useState("positionerElement"),L=I.useState("listElement"),_=I.useState("popupId"),U=I.useState("triggerProps"),q=I.useState("inputInsidePopup"),k=I.useState("id"),K=I.useState("labelId"),W=I.useState("open"),w=I.useState("selectedValue"),S=I.useState("activeIndex"),ke=I.useState("selectedIndex"),$=I.useState("hasSelectedValue"),Be=ut(),ie=At(),pe=Dr(),ce=C||u||m,ze=qe(),Re=Lt(I),Ke=Qt.useRef(null),j=Po(ce,Ke);Eo({id:q?i:void 0});let re=q?i??k:i,xt=Ss(g,K),We;W&&q?We=_??Mo(k):W&&(We=L?.id);let Ct=Qt.useRef("");function gt(H){Ct.current=H.pointerType}let{reference:mt}=Jr(Be,{enabled:!W&&!d&&!u&&V==="single",listRef:I.context.labelsRef,activeIndex:S,selectedIndex:ke,onMatch(H){let Z=I.context.valuesRef.current[H];Z!==void 0&&I.context.setSelectedValue(Z,A(R.none))}}),{reference:nt}=ho(Be,{enabled:!u,event:"mousedown"}),{buttonRef:rt,getButtonProps:Te}=je({native:f,disabled:ce}),Bt={...l,readOnly:d,open:W,disabled:ce,popupSide:Re,listEmpty:ze,placeholder:V==="none"?!1:!$},Pe=Q(H=>{I.set("triggerElement",H)});return M("button",t,{ref:[o,rt,Ke,Pe],state:Bt,props:[U,nt,mt,{id:re,tabIndex:q?0:-1,role:q?"combobox":void 0,"aria-expanded":W,"aria-haspopup":q?"dialog":"listbox","aria-controls":We,"aria-required":q&&v||void 0,"aria-readonly":q&&d||void 0,"aria-labelledby":xt,onPointerDown:gt,onPointerEnter:gt,onFocus(){j(!0),!ce&&pe.start(0,I.context.forceMount)},onBlur(H){if(!Ie(Y,H.relatedTarget)&&(F(!0),j(!1),T==="onBlur")){let Z=V==="none"?ie:w;N.commit(Z)}},onMouseDown(H){if(ce||(q||Be.set("domReferenceElement",H.currentTarget),I.context.forceMount(),Ct.current!=="touch"&&(I.context.inputRef.current?.focus(),q||H.preventDefault()),W))return;let Z=Or(H.currentTarget);function Ve(st){let b=I.state.triggerElement;if(!b)return;let O=Ze(st),fe=I.state.positionerElement,be=I.state.listElement;Ie(b,O)||Ie(fe,O)||Ie(be,O)||ls(st,b)||I.context.setOpen(!1,A(R.cancelOpen,st))}q&&Z.addEventListener("mouseup",Ve,{once:!0})},onKeyDown(H){(H.key==="ArrowDown"||H.key==="ArrowUp")&&(he(H),I.context.setOpen(!0,A(R.listNavigation,H.nativeEvent)),I.context.inputRef.current?.focus())}},N.getValidationProps(ce,n),Te],stateAttributesMapping:Tt})});hn.displayName="ComboboxTrigger";var tt=x(D(),1);var ko=x(D(),1),Bo=ko.createContext(void 0);Bo.displayName="ComboboxChipsContext";function Ho(){return ko.useContext(Bo)}var Go=x(D(),1),jo=Go.createContext(void 0);jo.displayName="ComboboxPositionerContext";function ct(e){let t=Go.useContext(jo);if(t===void 0&&!e)throw new Error("Base UI: <Combobox.Popup> and <Combobox.Arrow> must be used within the <Combobox.Positioner> component");return t}var Us=x(D(),1);var qs=x(le(),1),Yt=Us.forwardRef(function(t,o){let s=P(),{buttonRef:p,getButtonProps:f}=je({native:!1}),m=mo(o,p);function i(n){s.context.setOpen(!1,A(R.closePress,n.nativeEvent,n.currentTarget))}let c=f({onClick:i});return(0,qs.jsx)("span",{ref:m,...c,"aria-label":"Dismiss",tabIndex:void 0,style:go})});Yt.displayName="ComboboxInternalDismissButton";var $t=x(le(),1),In=tt.forwardRef(function(t,o){let{render:s,className:p,disabled:f=!1,id:m,style:i,...c}=t,{state:n,disabled:l,setTouched:C,validationMode:F,validation:T}=De(),{labelId:N}=vo(),g=Ho(),V=!!ct(!0),u=P(),d=At(),v=wt(),Y=u.useState("required"),L=u.useState("disabled"),_=u.useState("readOnly"),U=u.useState("name"),q=u.useState("form"),k=u.useState("selectionMode"),K=u.useState("autoHighlight"),W=u.useState("inputProps"),w=u.useState("triggerProps"),S=u.useState("open"),ke=u.useState("mounted"),$=u.useState("selectedValue"),Be=u.useState("id"),ie=u.useState("inline"),pe=u.useState("modal"),ce=!!K,ze=Lt(u),Re=l||L||f,Ke=qe(),j=Po(Re,u.context.inputRef),re=V||ie,xt=!re||pe,We=fo(m??(re?void 0:Be)),Ct=V?fs:n,[gt,mt]=tt.useState(null),nt=tt.useRef(!1),rt=tt.useRef(null);ue(()=>{S||(rt.current=null)},[S]);let Te=k==="none"&&!V,Bt=Q(b=>{let O=V||u.state.inline;O&&!u.state.hasInputValue&&u.context.setInputValue("",A(R.none)),u.update({inputElement:b,inputInsidePopup:O,inputOwnsFormValue:Te})}),Pe=V?c:T.getValidationProps(Re,c);function Qe(b){u.context.setIndices({activeIndex:null,selectedIndex:null,type:at(b),event:b})}let H={...Ct,open:S,disabled:Re,readOnly:_,popupSide:ze,listEmpty:Ke};function Z(b){if(!g)return;let O,fe=g.chipsRef.current.length,[be]=_o(v);return b.key===be&&(b.currentTarget.selectionStart??0)===0&&$.length>0&&(b.preventDefault(),O=fe>0?fe-1:void 0),O}let Ve=M("input",t,{state:H,ref:[o,u.context.inputRef,Bt],props:[W,w,{value:gt??d,"aria-readonly":_||void 0,"aria-required":Y||void 0,"aria-labelledby":N,disabled:Re,readOnly:_,required:k==="none"?Y:void 0,form:q,...Te&&U&&{name:U},id:We,onFocus(){if(j(!0),!ie)return;let b=rt.current;rt.current=null,!(b==null||!Object.hasOwn(u.context.valuesRef.current,b))&&u.context.setIndices({activeIndex:b})},onBlur(){C(!0),j(!1);let b=u.state.activeIndex;if(ie&&b!==null&&K!=="always"&&(rt.current=b,u.context.setIndices({activeIndex:null})),F==="onBlur"){let O=k==="none"?d:$;T.commit(O)}},onCompositionStart(b){Co.os.android||(nt.current=!0,mt(b.currentTarget.value))},onCompositionEnd(b){nt.current=!1;let O=b.currentTarget.value;mt(null),u.context.setInputValue(O,A(R.inputChange,b.nativeEvent))},onChange(b){let O=b.nativeEvent,fe=O.inputType,be=!fe||fe==="insertReplacementText",Ye=nt.current||!be;function oe(_e){_||Re||!_e||!Ye||(u.context.setOpen(!0,A(R.inputChange,O)),ce||Qe(O))}if(nt.current){let _e=b.currentTarget.value;mt(_e),_e===""&&!u.state.openOnInputClick&&!u.state.inputInsidePopup&&u.context.setOpen(!1,A(R.inputClear,O));let It=_e.trim(),Rt=ce&&It!=="";oe(It),S&&u.state.activeIndex!==null&&!Rt&&Qe(O);return}let ne=A(R.inputChange,O);if(u.context.setInputValue(b.currentTarget.value,ne),ne.isCanceled)return;let Le=b.currentTarget.value==="",ht=A(R.inputClear,O);Le&&!u.state.inputInsidePopup&&(k==="single"&&u.context.setSelectedValue(null,ht),u.state.openOnInputClick||u.context.setOpen(!1,ht)),oe(b.currentTarget.value.trim()),S&&u.state.activeIndex!==null&&!ce&&Qe(O)},onKeyDown(b){if(b.ctrlKey||b.shiftKey||b.altKey||b.metaKey)return;if(Re||_){_&&b.key==="Enter"&&S&&u.state.activeIndex!==null&&he(b);return}let O=b.currentTarget,fe=O.scrollWidth-O.clientWidth,be=v==="rtl";if(b.key==="Home"){he(b);let oe=Co.engine.gecko&&be?O.value.length:0;O.setSelectionRange(oe,oe),O.scrollLeft=0;return}if(b.key==="End"){he(b);let oe=Co.engine.gecko&&be?0:O.value.length;O.setSelectionRange(oe,oe),O.scrollLeft=be?-fe:fe;return}if(!ke&&b.key==="Escape"){let oe=k==="multiple"&&Array.isArray($)?$.length===0:$===null,ne=A(R.escapeKey,b.nativeEvent),Le=k==="multiple"?[]:null;u.context.setInputValue("",ne),u.context.setSelectedValue(Le,ne),!oe&&!u.state.inline&&!ne.isPropagationAllowed&&b.stopPropagation();return}if(g&&b.key==="Backspace"&&O.value===""&&Array.isArray($)&&$.length>0){let oe=g.chipsRef.current.length,ne=oe>0?oe-1:$.length-1,Le=$.filter((ht,_e)=>_e!==ne);Qe(b.nativeEvent),u.context.setSelectedValue(Le,A(R.none,b.nativeEvent));return}let Ye=Z(b);if(Ye!==void 0&&g?.chipsRef.current[Ye]?.focus(),b.which!==229&&b.key==="Enter"&&S){let oe=u.state.activeIndex,ne=b.nativeEvent;if(oe===null){if(ie)return;u.context.setOpen(!1,A(R.none,ne));return}he(b),Fo(u,oe,ne)}}},Pe],stateAttributesMapping:Tt}),st=V?(0,$t.jsx)(xs.Provider,{value:bs,children:Ve}):Ve;return(0,$t.jsxs)(tt.Fragment,{children:[S&&xt&&(0,$t.jsx)(Yt,{ref:u.context.startDismissRef}),st]})});In.displayName="ComboboxInput";var zs=x(D(),1);function Uo(e,t,o,s){if(e.baseUIHandlerPrevented)return;let p=Ze(e.nativeEvent),f=mn(p)?p:null;f!==e.currentTarget&&(s?.(f)||kr(f))||(e.preventDefault(),!o&&(t.context.inputRef.current?.focus(),t.state.openOnInputClick&&t.context.setOpen(!0,A(R.inputPress,e.nativeEvent))))}var Rn=zs.forwardRef(function(t,o){let{render:s,className:p,style:f,...m}=t,{state:i}=De(),c=P(),n=c.useState("open"),l=c.useState("disabled"),C=c.useState("readOnly"),F=c.useState("hasSelectedValue"),T=c.useState("selectionMode"),N=Lt(c),g=l,I=qe(),u={...i,open:n,disabled:g,readOnly:C,popupSide:N,listEmpty:I,placeholder:T==="none"?!1:!F},d=Q(v=>{c.set("inputGroupElement",v)});return M("div",t,{ref:[o,d],props:[{role:"group",onMouseDown(v){Uo(v,c,g,Y=>Ie(c.context.chipsContainerRef.current,Y))}},m],state:u,stateAttributesMapping:Tt})});Rn.displayName="ComboboxInputGroup";var Ks=x(D(),1);var vn=Ks.forwardRef(function(t,o){let{render:s,className:p,style:f,...m}=t;return M("span",t,{ref:o,props:[{"aria-hidden":!0,children:"\u25BC"},m]})});vn.displayName="ComboboxIcon";var Ws=x(D(),1);var ra={...Nt,..._r},En=Ws.forwardRef(function(t,o){let{render:s,className:p,disabled:f=!1,nativeButton:m=!0,keepMounted:i=!1,style:c,...n}=t,{disabled:l}=De(),C=P(),F=C.useState("selectionMode"),T=C.useState("disabled"),N=C.useState("readOnly"),g=C.useState("open"),I=C.useState("selectedValue"),V=C.useState("hasSelectionChips"),u=At(),d=!1;F==="none"?d=u!=="":F==="single"?d=I!=null:d=V;let v=l||T||f,{buttonRef:Y,getButtonProps:L}=je({native:m,disabled:v}),{mounted:_,transitionStatus:U,setMounted:q}=Nr(d),k={disabled:v,visible:d,open:g,transitionStatus:U};xo({open:d,ref:C.context.clearRef,onComplete(){d||q(!1)}});let K=M("button",t,{state:k,ref:[o,Y,C.context.clearRef],props:[{tabIndex:-1,children:"x",onMouseDown(w){w.preventDefault()},onClick(w){if(v||N)return;let S=at(w);C.context.setInputValue("",A(R.clearPress,w.nativeEvent)),F!=="none"?(C.context.setSelectedValue(Array.isArray(I)?[]:null,A(R.clearPress,w.nativeEvent)),C.context.setIndices({activeIndex:null,selectedIndex:null,type:S,event:w.nativeEvent})):C.context.setIndices({activeIndex:null,type:S,event:w.nativeEvent}),C.context.inputRef.current?.focus()}},n,L],stateAttributesMapping:ra});return i||_?K:null});En.displayName="ComboboxClear";var zo=x(D(),1);var Xs=x(D(),1);var _t=x(D(),1),Qs=x(le(),1),yn=_t.createContext(null);yn.displayName="GroupCollectionContext";function Ys(){return _t.useContext(yn)}function $s(e){let{children:t,items:o}=e,s=_t.useMemo(()=>({items:o}),[o]);return(0,Qs.jsx)(yn.Provider,{value:s,children:t})}var Js=x(le(),1);function qo(e){let{children:t}=e,{filteredItems:o}=Ae(),s=Ys(),p=s?s.items:o;return(0,Js.jsx)(Xs.Fragment,{children:p.map(t)})}var Sn=x(le(),1),Pn=zo.forwardRef(function(t,o){var s;let{render:p,className:f,style:m,children:i,...c}=t,n=P(),l=ut(),C=!!ct(!0),{filteredItems:F,hasItems:T}=Ae(),N=n.useState("selectionMode"),g=n.useState("grid"),I=n.useState("readOnly"),V=n.useState("listProps"),u=n.useState("virtualized"),d=n.useState("forceMounted"),v=N==="multiple",Y=F.length===0,L=Q(w=>{n.set("positionerElement",w)}),_=Q(w=>{n.set("listElement",w)}),U=zo.useMemo(()=>typeof i=="function"?s||(s=(0,Sn.jsx)(qo,{children:i})):i,[i]),q={empty:Y},k=l.useState("floatingId"),K=M("div",t,{state:q,ref:[o,_,C?null:L],props:[V,{children:U,tabIndex:-1,id:k,role:g?"grid":"listbox","aria-multiselectable":v?"true":void 0,"aria-readonly":!g&&I?!0:void 0,onKeyDown(w){if(!(n.state.disabled||n.state.readOnly)&&w.key==="Enter"){let S=n.state.activeIndex;if(S==null)return;he(w),Fo(n,S,w.nativeEvent)}}},c]});if(u)return K;let W=T&&!d?void 0:n.context.labelsRef;return(0,Sn.jsx)(co,{elementsRef:n.context.listRef,labelsRef:W,children:K})});Pn.displayName="ComboboxList";var Zs=x(D(),1);var Nn=Zs.forwardRef(function(t,o){let{render:s,className:p,style:f,children:m,...i}=t,c=Io();return M("div",t,{ref:[o,c],props:[{children:m,role:"status","aria-live":"polite","aria-atomic":!0},i]})});Nn.displayName="ComboboxStatus";var ti=x(D(),1);var Ko=x(D(),1),Wo=Ko.createContext(void 0);Wo.displayName="ComboboxPortalContext";function ei(){let e=Ko.useContext(Wo);if(e===void 0)throw new Error("Base UI: <Combobox.Portal> is missing.");return e}var Vn=x(le(),1),wn=ti.forwardRef(function(t,o){let{keepMounted:s=!1,...p}=t,f=P(),m=f.useState("mounted"),i=f.useState("forceMounted");return m||s||i?(0,Vn.jsx)(Wo.Provider,{value:s,children:(0,Vn.jsx)(Ur,{ref:o,...p})}):null});wn.displayName="ComboboxPortal";var oi=x(D(),1);var sa={...Vt,...Nt},On=oi.forwardRef(function(t,o){let{render:s,className:p,style:f,...m}=t,i=P(),c=i.useState("open"),n=i.useState("mounted"),l=i.useState("transitionStatus");return M("div",t,{state:{open:c,transitionStatus:l},ref:o,stateAttributesMapping:sa,props:[{role:"presentation",hidden:!n,style:{userSelect:"none",WebkitUserSelect:"none"}},m]})});On.displayName="ComboboxBackdrop";var ni=x(D(),1);var Qo=x(le(),1),Dn=ni.forwardRef(function(t,o){let{render:s,className:p,anchor:f,positionMethod:m,side:i,align:c,sideOffset:n,alignOffset:l,collisionBoundary:C="clipping-ancestors",collisionPadding:F,arrowPadding:T,sticky:N,disableAnchorTracking:g=!1,collisionAvoidance:I=jr,style:V,...u}=t,d=P(),v=ut(),Y=ei(),L=d.useState("modal"),_=d.useState("open"),U=d.useState("mounted"),q=d.useState("openMethod"),k=d.useState("positionerElement"),K=d.useState("triggerElement"),W=d.useState("inputElement"),w=d.useState("inputGroupElement"),S=d.useState("inputInsidePopup"),ke=d.useState("transitionStatus"),$=qe(),ie=ss({anchor:f??(S?K:w??W),floatingRootContext:v,positionMethod:m,mounted:U,side:i,sideOffset:n,align:c,alignOffset:l,arrowPadding:T,collisionBoundary:C,collisionPadding:F,sticky:N,disableAnchorTracking:g,keepMounted:Y,collisionAvoidance:I,lazyFlip:!0});as(_&&L,q==="touch",k,K);let pe={open:_,side:ie.side,align:ie.align,anchorHidden:ie.anchorHidden,empty:$};ue(()=>{d.set("popupSide",ie.side)},[d,ie.side]);let ce=Q(Re=>{d.set("positionerElement",Re)}),ze=is(t,pe,{styles:ie.positionerStyles,transitionStatus:ke,props:u,refs:[o,ce],hidden:!U,inert:!_});return(0,Qo.jsxs)(jo.Provider,{value:ie,children:[U&&L&&(0,Qo.jsx)(es,{inert:Zr(!_),cutout:w??W??K}),ze]})});Dn.displayName="ComboboxPositioner";var Yo=x(D(),1);var Xt=x(le(),1),ia={...Vt,...Nt},Mn=Yo.forwardRef(function(t,o){let{render:s,className:p,style:f,initialFocus:m,finalFocus:i,...c}=t,n=P(),l=ct(),C=ut(),F=n.useState("mounted"),T=n.useState("open"),N=n.useState("openMethod"),g=n.useState("popupProps"),I=n.useState("transitionStatus"),V=n.useState("inputInsidePopup"),u=n.useState("inputElement"),d=n.useState("modal"),v=n.useState("id"),Y=qe(),L=c.id??(V?Mo(v):void 0);ue(()=>(n.set("popupId",n.context.popupRef.current?.id||L),()=>{n.set("popupId",void 0)}),[n,L]),xo({open:T,ref:n.context.popupRef,onComplete(){T&&n.context.onOpenChangeComplete(!0)}});let _={open:T,side:l.side,align:l.align,anchorHidden:l.anchorHidden,transitionStatus:I,empty:Y},U=M("div",t,{state:_,ref:[o,n.context.popupRef],props:[g,{id:L,role:V?"dialog":"presentation",onFocus(w){let S=Ze(w.nativeEvent);N!=="touch"&&(Ie(n.state.listElement,S)||S===w.currentTarget)&&n.context.inputRef.current?.focus()}},rs(I),c],stateAttributesMapping:ia}),k=m===void 0?V?w=>w==="touch"?n.context.popupRef.current:u:!1:m,K;i!=null?K=i:K=V?void 0:!1;let W=!V||d;return(0,Xt.jsx)(qr,{context:C,disabled:!F,modal:W,openInteractionType:N,initialFocus:k,returnFocus:K,getInsideElements:()=>[n.context.startDismissRef.current,n.context.endDismissRef.current],children:(0,Xt.jsxs)(Yo.Fragment,{children:[U,W&&(0,Xt.jsx)(Yt,{ref:n.context.endDismissRef})]})})});Mn.displayName="ComboboxPopup";var ri=x(D(),1);var An=ri.forwardRef(function(t,o){let{render:s,className:p,style:f,...m}=t,i=P(),{arrowRef:c,side:n,align:l,arrowUncentered:C,arrowStyles:F}=ct(),N={open:i.useState("open"),side:n,align:l,uncentered:C};return M("div",t,{ref:[c,o],stateAttributesMapping:Vt,state:N,props:{style:F,"aria-hidden":!0,...m}})});An.displayName="ComboboxArrow";var Ft=x(D(),1);var $o=x(D(),1),Xo=$o.createContext(void 0);Xo.displayName="ComboboxGroupContext";function si(){let e=$o.useContext(Xo);if(e===void 0)throw new Error("Base UI: ComboboxGroupContext is missing. ComboboxGroup parts must be placed within <Combobox.Group>.");return e}var Tn=x(le(),1),Ln=Ft.forwardRef(function(t,o){let{render:s,className:p,style:f,items:m,...i}=t,n=P().useState("grid"),[l,C]=Ft.useState(),F=Ft.useMemo(()=>({labelId:l,setLabelId:C,items:m}),[l,C,m]),T=M("div",t,{ref:o,props:[{role:n?"rowgroup":"group","aria-labelledby":l},i]}),N=(0,Tn.jsx)(Xo.Provider,{value:F,children:T});return m?(0,Tn.jsx)($s,{items:m,children:N}):N});Ln.displayName="ComboboxGroup";var ii=x(D(),1);var _n=ii.forwardRef(function(t,o){let{render:s,className:p,style:f,id:m,...i}=t,{setLabelId:c}=si(),n=fo(m);return ue(()=>(c(n),()=>{c(C=>C===n?void 0:C)}),[n,c]),M("div",t,{ref:o,props:[{id:n,"aria-hidden":!0},i]})});_n.displayName="ComboboxGroupLabel";var ot=x(D(),1),ui=x(yr(),1);var Jo=x(D(),1),Zo=Jo.createContext(void 0);Zo.displayName="ComboboxItemContext";function ai(){let e=Jo.useContext(Zo);if(!e)throw new Error("Base UI: ComboboxItemContext is missing. ComboboxItem parts must be placed within <Combobox.Item>.");return e}var en=x(D(),1),tn=en.createContext(!1);tn.displayName="ComboboxRowContext";function li(){return en.useContext(tn)}var Jt=x(le(),1);function ci(e){let{componentProps:t,forwardedRef:o,virtualized:s,indexFromFilter:p}=e,{render:f,className:m,style:i,value:c=null,index:n,disabled:l=!1,nativeButton:C=!1,...F}=t,T=ot.useRef(null),N=bo({guess:!0,index:n,textRef:T}),g=P(),I=li(),V=Ms(),{props:u,id:d,selectionMode:v,disabled:Y,readOnly:L,isItemEqualToValue:_}=g.useState("itemRoot"),U=Y||l,q=v!=="none",k=n??p??N.index,K=k!==-1,W=g.useState("isActive",k),w=g.useState("isSelected",c),S=ot.useRef(null),ke=d!=null&&K?`${d}-${k}`:void 0,$=w&&q;ue(()=>{if(!(K&&(s||n!=null)))return;let re=g.context.listRef.current;return re[k]=S.current,()=>{delete re[k]}},[K,s,k,n,g]),ue(()=>{if(!K||V)return;let j=g.context.valuesRef.current;return j[k]=c,()=>{delete j[k]}},[K,V,k,c,g]),ue(()=>{if(!K||V)return;let j=g.state.selectedValue,re=g.state.selectedIndex;g.state.selectionMode==="multiple"&&Array.isArray(j)?re=Is(k,c,g.context.valuesRef.current,j,_,re):et(c,j,_)&&(re=k),g.set("selectedIndex",re)},[K,V,g,k,c,_]);let{getButtonProps:Be,buttonRef:ie}=je({disabled:U,focusableWhenDisabled:!0,native:C,composite:!0}),pe={disabled:U,selected:$,highlighted:W};function ce(j){function re(){g.context.handleSelection(j,c)}g.state.submitOnItemClick?(ui.flushSync(re),g.context.requestSubmit()):re()}let ze={id:ke,role:I?"gridcell":"option","aria-selected":q?$:void 0,tabIndex:void 0,onPointerDownCapture(j){j.isPrimary&&(g.context.pointerDownItemRef.current=j.currentTarget),j.preventDefault()},onMouseDown(j){j.preventDefault()},onClick(j){U||L||ce(j.nativeEvent)},onMouseUp(j){let re=g.context.pointerDownItemRef.current===j.currentTarget;g.context.pointerDownItemRef.current=null,!(U||L||j.button!==0||re||!W)&&ce(j.nativeEvent)}},Re=M("div",t,{ref:[ie,o,N.ref,S],state:pe,props:[u,ze,F,Be]}),Ke=ot.useMemo(()=>({selected:$,textRef:T}),[$,T]);return(0,Jt.jsx)(Zo.Provider,{value:Ke,children:Re})}function aa(e){let{componentProps:t,forwardedRef:o}=e,p=P().useState("isItemEqualToValue"),{flatFilteredValues:f}=Ae(),m=t.value??null,i=Mt(f,m,p);return(0,Jt.jsx)(ci,{componentProps:t,forwardedRef:o,virtualized:!0,indexFromFilter:i})}var Fn=ot.memo(ot.forwardRef(function(t,o){let p=P().useState("virtualized");return p&&t.index==null?(0,Jt.jsx)(aa,{componentProps:t,forwardedRef:o}):(0,Jt.jsx)(ci,{componentProps:t,forwardedRef:o,virtualized:p,indexFromFilter:void 0})}));Fn.displayName="ComboboxItem";var mi=x(D(),1);var pi=x(le(),1),kn=mi.forwardRef(function(t,o){let{render:s,className:p,style:f,...m}=t,i=M("div",t,{ref:o,props:[{role:"row"},m]});return(0,pi.jsx)(tn.Provider,{value:!0,children:i})});kn.displayName="ComboboxRow";var di=x(D(),1);var Bn=di.forwardRef(function(t,o){let{render:s,className:p,style:f,children:m,...i}=t,{filteredItems:c}=Ae(),n=P(),l=Io(),C=c.length===0?m:null;return M("div",t,{ref:[o,n.context.emptyRef,l],props:[{children:C,role:"status","aria-live":"polite","aria-atomic":!0},i]})});Bn.displayName="ComboboxEmpty";function fi(){return Ae().filteredItems}var te={};na(te,{Arrow:()=>An,Backdrop:()=>On,Chip:()=>zn,ChipRemove:()=>Kn,Chips:()=>Un,Clear:()=>En,Collection:()=>qo,Empty:()=>Bn,Group:()=>Ln,GroupLabel:()=>_n,Icon:()=>vn,Input:()=>In,InputGroup:()=>Rn,Item:()=>Fn,ItemIndicator:()=>Gn,Label:()=>Hn,List:()=>Pn,Popup:()=>Mn,Portal:()=>wn,Positioner:()=>Dn,Root:()=>xi,Row:()=>kn,Separator:()=>Si,Status:()=>Nn,Trigger:()=>hn,Value:()=>hi,createItems:()=>Pi,useFilter:()=>_s,useFilteredItems:()=>fi});var Pm=x(D(),1);var bi=x(le(),1);function xi(e){let{multiple:t=!1,defaultValue:o,value:s,onValueChange:p,autoComplete:f,...m}=e;return(0,bi.jsx)(ks,{...m,selectionMode:t?"multiple":"single",selectedValue:s,defaultSelectedValue:o,onSelectedValueChange:p,formAutoComplete:f})}var on=x(D(),1);var Hn=on.forwardRef(function(t,o){let{render:s,className:p,style:f,...m}=t,i=m;delete i.id;let c=De(),n=P(),l=n.useState("inputInsidePopup"),C=n.useState("triggerElement"),F=n.useState("inputElement"),T=n.useState("id"),N=ys(T),g=C?.id??(l?T:void 0);on.useEffect(()=>{if(!F||l)return;let V=Sr.captureOwnerStack?.()||"";lo(`<Combobox.Label> labels <Combobox.Trigger> only. When <Combobox.Input> is the form control, use a native <label> or <Field.Label> instead.${V}`)},[F,l]);let I=Es({id:N,fallbackControlId:g,setLabelId(V){let u=typeof V=="function"?V(n.state.labelId):V;n.set("labelId",u)}});return M("div",t,{ref:o,state:c.state,props:[I,m],stateAttributesMapping:Ro})});Hn.displayName="ComboboxLabel";var Ci=x(D(),1);var gi=x(le(),1);function hi(e){let{children:t,placeholder:o}=e,s=P(),p=s.useState("itemToStringLabel"),f=s.useState("selectedValue"),m=s.useState("items"),i=s.useState("selectionMode")==="multiple",c=s.useState("hasSelectedValue"),n=!c&&o!=null&&t==null,l=s.useState("hasNullItemLabel",n),C=null;return typeof t=="function"?C=t(f):t!=null?C=t:!c&&o!=null&&!l?C=o:i&&Array.isArray(f)?C=ps(f,m,p):C=ms(f,m,p),(0,gi.jsx)(Ci.Fragment,{children:C})}var Ii=x(D(),1);var Ri=x(le(),1),Gn=Ii.forwardRef(function(t,o){let{selected:s}=ai();return t.keepMounted||s?(0,Ri.jsx)(Ps,{...t,selected:s,ref:o}):null});Gn.displayName="ComboboxItemIndicator";var kt=x(D(),1);var jn=x(le(),1),Un=kt.forwardRef(function(t,o){let{render:s,className:p,style:f,...m}=t,i=P(),c=i.useState("hasSelectionChips"),n=kt.useRef([]),l=M("div",t,{ref:[o,i.context.chipsContainerRef],props:[c?{role:"toolbar"}:Kt,{onMouseDown(F){Uo(F,i,i.state.disabled)}},m]}),C=kt.useMemo(()=>({chipsRef:n}),[]);return(0,jn.jsx)(Bo.Provider,{value:C,children:(0,jn.jsx)(co,{elementsRef:n,children:l})})});Un.displayName="ComboboxChips";var sn=x(D(),1),qn=x(yr(),1);var nn=x(D(),1),rn=nn.createContext(void 0);rn.displayName="ComboboxChipContext";function vi(){let e=nn.useContext(rn);if(!e)throw new Error("Base UI: ComboboxChipContext is missing. ComboboxChip parts must be placed within <Combobox.Chip>.");return e}var Ei=x(le(),1),zn=sn.forwardRef(function(t,o){let{render:s,className:p,style:f,...m}=t,i=P(),{chipsRef:c}=Ho(),n=wt(),l=i.useState("disabled"),C=i.useState("readOnly"),F=i.useState("selectedValue"),{ref:T,index:N}=bo();function g(d){let v=N,[Y,L]=_o(n);return d.key===Y?(d.preventDefault(),N>0?v=N-1:v=void 0):d.key===L?(d.preventDefault(),N<c.current.length-1?v=N+1:v=void 0):d.key==="Backspace"||d.key==="Delete"?(v=js(N,F.length),he(d),qn.flushSync(()=>{i.context.setIndices({activeIndex:null,selectedIndex:null,type:R.keyboard,event:d.nativeEvent}),i.context.setSelectedValue(F.filter((_,U)=>U!==N),A(R.none,d.nativeEvent))})):d.key==="Enter"||d.key===" "?(he(d),v=void 0):d.key==="ArrowDown"||d.key==="ArrowUp"?(he(d),qn.flushSync(()=>{i.context.setOpen(!0,A(R.listNavigation,d.nativeEvent))}),v=void 0):d.key.length===1&&!d.ctrlKey&&!d.metaKey&&!d.altKey&&(v=void 0),v}let V=M("div",t,{ref:[o,T],state:{disabled:l},props:[{tabIndex:-1,"aria-disabled":l||void 0,"aria-readonly":C||void 0,onKeyDown(d){if(l||C)return;let v=g(d);v===void 0?i.context.inputRef.current?.focus():c.current[v]?.focus()}},m]}),u=sn.useMemo(()=>({index:N}),[N]);return(0,Ei.jsx)(rn.Provider,{value:u,children:V})});zn.displayName="ComboboxChip";var yi=x(D(),1);var Kn=yi.forwardRef(function(t,o){let{render:s,className:p,disabled:f=!1,nativeButton:m=!0,style:i,...c}=t,n=P(),{index:l}=vi(),C=n.useState("disabled"),F=n.useState("readOnly"),T=n.useState("selectedValue"),N=n.useState("isItemEqualToValue"),g=C||f,{buttonRef:I,getButtonProps:V}=je({native:m,disabled:g||F,focusableWhenDisabled:!0}),u={disabled:g};function d(L,_){let U=n.state.activeIndex;if(U==null)return;let q=Mt(n.context.valuesRef.current,L,N);q!==-1&&U===q&&n.context.setIndices({activeIndex:null,type:at(_),event:_})}function v(L){let _=A(R.chipRemovePress,L.nativeEvent),U=T[l];return d(U,L.nativeEvent),n.context.setSelectedValue(T.filter((q,k)=>k!==l),_),n.context.inputRef.current?.focus(),_}return M("button",t,{ref:[o,I],state:u,props:[{tabIndex:-1,onMouseDown(L){L.preventDefault()},onClick(L){v(L).isPropagationAllowed||L.stopPropagation()},onKeyDown(L){(L.key==="Enter"||L.key===" ")&&(v(L).isPropagationAllowed||he(L))}},c,V]})});Kn.displayName="ComboboxChipRemove";var Si=Ns;function Pi(e,t){let{getValue:o,getLabel:s}=t,p=null;function f(){if(p===null){let i=new Map,c=e?Ot(e):ft;for(let n of c){if(n==null)continue;let l=o(n);i.has(l)?lo(`Two items passed to createItems() derived the value ${String(l)}, so selection and label resolution cannot tell them apart: the first item wins the label and every item carrying the value renders as selected. Return a unique value from \`getValue\`.`):i.set(l,n)}p=i}return p}function m(i){return i==null?i:o(i)}return{data:e,value:m,hasValue(i,c){return Wt(f(),i,c)!==void 0},itemLabel:s,label(i,c,n){let l=Wt(f(),i,c);return l!==void 0?s(l):lt(i,n)}}}var B=x(le()),hd=te.Root;function Id({...e}){return(0,B.jsx)(te.Value,{"data-slot":"combobox-value",...e})}function la({className:e,children:t,...o}){return(0,B.jsxs)(te.Trigger,{"data-slot":"combobox-trigger",className:Se("[&_svg:not([class*='size-'])]:size-4",e),...o,children:[t,(0,B.jsx)(Tr,{className:"pointer-events-none size-4 text-muted-foreground"})]})}function ua({className:e,...t}){return(0,B.jsx)(te.Clear,{"data-slot":"combobox-clear",render:(0,B.jsx)(Cn,{variant:"ghost",size:"icon-xs"}),className:Se(e),...t,children:(0,B.jsx)(dn,{className:"pointer-events-none"})})}function Rd({className:e,children:t,disabled:o=!1,showTrigger:s=!0,showClear:p=!1,...f}){return(0,B.jsxs)(Vs,{className:Se("w-auto",e),children:[(0,B.jsx)(te.Input,{render:(0,B.jsx)(Os,{disabled:o}),...f}),(0,B.jsxs)(ws,{align:"inline-end",children:[s&&(0,B.jsx)(Cn,{size:"icon-xs",variant:"ghost",render:(0,B.jsx)(la,{}),"data-slot":"input-group-button",className:"group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent",disabled:o}),p&&(0,B.jsx)(ua,{disabled:o})]}),t]})}function vd({className:e,side:t="bottom",sideOffset:o=6,align:s="start",alignOffset:p=0,anchor:f,...m}){return(0,B.jsx)(te.Portal,{container:os(),children:(0,B.jsx)(te.Positioner,{side:t,sideOffset:o,align:s,alignOffset:p,anchor:f,className:"isolate z-50",children:(0,B.jsx)(te.Popup,{"data-slot":"combobox-content","data-chips":!!f,className:Se("group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...m})})})}function Ed({className:e,...t}){return(0,B.jsx)(te.List,{"data-slot":"combobox-list",className:Se("no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0",e),...t})}function yd({className:e,children:t,...o}){return(0,B.jsxs)(te.Item,{"data-slot":"combobox-item",className:Se("relative flex w-full cursor-default items-center gap-2 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...o,children:[t,(0,B.jsx)(te.ItemIndicator,{render:(0,B.jsx)("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center"}),children:(0,B.jsx)(Ar,{className:"pointer-events-none"})})]})}function Sd({className:e,...t}){return(0,B.jsx)(te.Group,{"data-slot":"combobox-group",className:Se(e),...t})}function Pd({className:e,...t}){return(0,B.jsx)(te.GroupLabel,{"data-slot":"combobox-label",className:Se("px-2 py-1.5 text-xs text-muted-foreground",e),...t})}function Nd({...e}){return(0,B.jsx)(te.Collection,{"data-slot":"combobox-collection",...e})}function Vd({className:e,...t}){return(0,B.jsx)(te.Empty,{"data-slot":"combobox-empty",className:Se("hidden w-full justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex",e),...t})}function wd({className:e,...t}){return(0,B.jsx)(te.Separator,{"data-slot":"combobox-separator",className:Se("-mx-1 my-1 h-px bg-border",e),...t})}function Od({className:e,...t}){return(0,B.jsx)(te.Chips,{"data-slot":"combobox-chips",className:Se("flex min-h-8 flex-wrap items-center gap-1 rounded-lg border border-input bg-transparent bg-clip-padding px-2.5 py-1 text-sm transition-colors focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1 dark:bg-input/30 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40",e),...t})}function Dd({className:e,children:t,showRemove:o=!0,...s}){return(0,B.jsxs)(te.Chip,{"data-slot":"combobox-chip",className:Se("flex h-[calc(--spacing(5.25))] w-fit items-center justify-center gap-1 rounded-sm bg-muted px-1.5 text-xs font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pr-0",e),...s,children:[t,o&&(0,B.jsx)(te.ChipRemove,{render:(0,B.jsx)(ns,{variant:"ghost",size:"icon-xs"}),className:"-ml-1 opacity-50 hover:opacity-100","data-slot":"combobox-chip-remove",children:(0,B.jsx)(dn,{className:"pointer-events-none"})})]})}function Md({className:e,...t}){return(0,B.jsx)(te.Input,{"data-slot":"combobox-chip-input",className:Se("min-w-16 flex-1 outline-none",e),...t})}function Ad(){return Ni.useRef(null)}export{hd as a,Id as b,la as c,Rd as d,vd as e,Ed as f,yd as g,Sd as h,Pd as i,Nd as j,Vd as k,wd as l,Od as m,Dd as n,Md as o,Ad as p};
2
+ //# sourceMappingURL=chunk-UNKI7HPL.js.map
@@ -1,2 +1,2 @@
1
- import{a as k}from"./chunk-WT34MBTN.js";import{a as at}from"./chunk-TIJLEKZ2.js";import{b as H,c as nt,d as rt,e as it,f as st}from"./chunk-TQPXDAVH.js";import{a as W}from"./chunk-33RMFA4P.js";import{a as ot}from"./chunk-B4MRCKT4.js";import{n as et}from"./chunk-QFN6XL4O.js";import{b as tt,t as F}from"./chunk-LYT7LQS3.js";import{c as $}from"./chunk-EGZKG2B2.js";import{b as L}from"./chunk-2L7NK6SJ.js";import{a as Pt}from"./chunk-UH726PMV.js";import{a as x}from"./chunk-SFI7YWVR.js";import{b as y}from"./chunk-NZ73KS2Y.js";import{a as vt}from"./chunk-CT4EH2K2.js";import{d as Q,f as Z}from"./chunk-JIAVZ3V7.js";import{a as G}from"./chunk-IJQ26FTX.js";import{c as T}from"./chunk-KVMUXFPB.js";var s=T(G(),1),dt=T(Pt(),1);var I=T(G(),1);var E="--popup-width",M="--popup-height";function pt(e){let{popupElement:t,positionerElement:o,content:n,mounted:i,onMeasureLayout:r,onMeasureLayoutComplete:C,side:l,direction:c}=e,d=$(t,!0),P=L(),a=I.useRef(null),p=x(r),m=x(C),h=I.useMemo(()=>Rt(l,c),[l,c]);y(()=>{if(!i){a.current=null;return}if(!t||!o)return;let f=ct(t,h);B(t,"auto");let S=j(t,"position","static"),b=j(t,"transform","none"),D=j(t,"scale","1"),g=ct(o,{[nt]:"max-content",[rt]:"max-content"});function v(){S(),b(),g(),D()}if(p?.(),a.current===null){N(o,"max-content");let w=k(t);return a.current=w,N(o,w),v(),m?.(null,w),f}N(o,"max-content");let O=a.current,R=k(t);a.current=R,B(t,O),v(),m?.(O,R),N(o,R);let V=new AbortController;return P.request(()=>{B(t,R),d(()=>{t.style.setProperty(E,"auto"),t.style.setProperty(M,"auto")},V.signal)}),()=>{V.abort(),P.cancel(),f()}},[n,t,o,d,P,i,p,m,h])}function Rt(e,t){let o=e==="top",n=e==="left"||e===(t==="rtl"?"inline-end":"inline-start");return!o&&!n?Z:{position:"absolute",[o?"bottom":"top"]:"0",[n?"right":"left"]:"0"}}function j(e,t,o){let n=e.style.getPropertyValue(t);return e.style.setProperty(t,o),()=>{e.style.setProperty(t,n)}}function ct(e,t){let o=[];for(let[n,i]of Object.entries(t))o.push(j(e,n,i));return o.length?()=>{o.forEach(n=>n())}:Q}function B(e,t){let o=t==="auto"?"auto":`${t.width}px`,n=t==="auto"?"auto":`${t.height}px`;e.style.setProperty(E,o),e.style.setProperty(M,n)}function N(e,t){let o=t==="max-content"?"max-content":`${t.width}px`,n=t==="max-content"?"max-content":`${t.height}px`;e.style.setProperty(it,o),e.style.setProperty(st,n)}var lt={name:"adaptiveOrigin",async fn(e){let{x:t,y:o,rects:{floating:n},elements:{floating:i},platform:r,strategy:C,placement:l}=e,c=tt(i),d=c.getComputedStyle(i);if(!(d.transitionDuration!=="0s"&&d.transitionDuration!==""))return{x:t,y:o,data:H};let a=await r.getOffsetParent?.(i),p={width:0,height:0};if(C==="fixed"&&c?.visualViewport)p={width:c.visualViewport.width,height:c.visualViewport.height};else if(a===c){let D=F(i);p={width:D.documentElement.clientWidth,height:D.documentElement.clientHeight}}else await r.isElement?.(a)&&(p=await r.getDimensions(a));let m=et(l),h=t,f=o;m==="left"&&(h=p.width-(t+n.width)),m==="top"&&(f=p.height-(o+n.height));let S=m==="left"?"right":H.sideX,b=m==="top"?"bottom":H.sideY;return{x:h,y:f,data:{sideX:S,sideY:b}}}};var mt="data-activation-direction";var A=T(vt(),1),Zt={activationDirection:e=>e?{[mt]:e}:null};function te(e){let{store:t,side:o,children:n}=e,i=W(),r=t.useState("activeTriggerElement"),C=t.useState("activeTriggerId"),l=t.useState("open"),c=t.useState("payload"),d=t.useState("mounted"),P=t.useState("popupElement"),a=t.useState("positionerElement"),p=at(l?r:null),m=Dt(C,c),h=s.useRef(null),[f,S]=s.useState(null),[b,D]=s.useState(null),g=s.useRef(null),v=s.useRef(null),O=$(g,!0),R=L(),V=s.useRef(null),[w,X]=s.useState(null),[q,K]=s.useState(!1);y(()=>(t.set("adaptiveOrigin",lt),()=>{t.set("adaptiveOrigin",void 0)}),[t]);let ht=x(()=>{g.current?.style.setProperty("animation","none"),g.current?.style.setProperty("transition","none"),v.current?.style.setProperty("display","none")}),gt=x(u=>{g.current?.style.removeProperty("animation"),g.current?.style.removeProperty("transition"),v.current?.style.removeProperty("display"),u&&X(u)}),U=x(()=>{V.current?.abort();let u=new AbortController;V.current=u,O(()=>{S(null),X(null),h.current=null},u.signal)}),Y=s.useRef(null);y(()=>{(!l||!d)&&(Y.current=null)},[l,d]),y(()=>{if(l&&r&&p&&r!==p&&Y.current!==r&&h.current){S(h.current),K(!0);let u=St(p,r);D(u),Y.current=r}},[l,r,p]),y(()=>{f!=null&&(V.current?.abort(),K(!0),R.request(()=>{dt.flushSync(()=>{K(!1)}),U()}))},[m,f,U,R]),y(()=>{let u=g.current;if(!u)return;let J=F(u).createElement("div");for(let Ct of Array.from(u.childNodes))J.appendChild(Ct.cloneNode(!0));h.current=J});let z=f!=null,_;z?_=(0,A.jsxs)(s.Fragment,{children:[(0,A.jsx)("div",{"data-previous":!0,inert:ot(!0),ref:v,style:{...w?{[E]:`${w.width}px`,[M]:`${w.height}px`}:null,position:"absolute"},"data-ending-style":q?void 0:""},"previous"),(0,A.jsx)("div",{"data-current":!0,ref:g,"data-starting-style":q?"":void 0,children:n},m)]}):_=(0,A.jsx)("div",{"data-current":!0,ref:g,children:n},m),y(()=>{let u=v.current;!u||!f||u.replaceChildren(...Array.from(f.childNodes))},[f]),pt({popupElement:P,positionerElement:a,mounted:d,content:c,onMeasureLayout:ht,onMeasureLayoutComplete:gt,side:o,direction:i});let yt={activationDirection:xt(b),transitioning:z};return{children:_,state:yt}}function xt(e){if(e)return`${ft(e.horizontal,5,"right","left")} ${ft(e.vertical,5,"down","up")}`}function ft(e,t,o,n){return e>t?o:e<-t?n:""}function St(e,t){let o=e.getBoundingClientRect(),n=t.getBoundingClientRect(),i={x:o.left+o.width/2,y:o.top+o.height/2},r={x:n.left+n.width/2,y:n.top+n.height/2};return{horizontal:r.x-i.x,vertical:r.y-i.y}}function Dt(e,t){let[o,n]=s.useState(0),i=s.useRef(e),r=s.useRef(t),C=s.useRef(!1);return y(()=>{let l=i.current,c=r.current,d=e!==l,P=t!==c;d?(n(a=>a+1),C.current=!P):C.current&&P&&(n(a=>a+1),C.current=!1),i.current=e,r.current=t},[e,t]),`${e??"current"}-${o}`}export{Zt as a,te as b};
2
- //# sourceMappingURL=chunk-F5MKIWPQ.js.map
1
+ import{a as k}from"./chunk-WT34MBTN.js";import{a as at}from"./chunk-TIJLEKZ2.js";import{b as H,c as nt,d as rt,e as it,f as st}from"./chunk-QJVIEN5R.js";import{a as W}from"./chunk-33RMFA4P.js";import{a as ot}from"./chunk-B4MRCKT4.js";import{n as et}from"./chunk-QFN6XL4O.js";import{b as tt,t as F}from"./chunk-LYT7LQS3.js";import{c as $}from"./chunk-EGZKG2B2.js";import{b as L}from"./chunk-2L7NK6SJ.js";import{a as Pt}from"./chunk-UH726PMV.js";import{a as x}from"./chunk-SFI7YWVR.js";import{b as y}from"./chunk-NZ73KS2Y.js";import{d as Q,f as Z}from"./chunk-JIAVZ3V7.js";import{a as vt}from"./chunk-CT4EH2K2.js";import{a as G}from"./chunk-IJQ26FTX.js";import{c as T}from"./chunk-KVMUXFPB.js";var s=T(G(),1),dt=T(Pt(),1);var I=T(G(),1);var E="--popup-width",M="--popup-height";function pt(e){let{popupElement:t,positionerElement:o,content:n,mounted:i,onMeasureLayout:r,onMeasureLayoutComplete:C,side:l,direction:c}=e,d=$(t,!0),P=L(),a=I.useRef(null),p=x(r),m=x(C),h=I.useMemo(()=>Rt(l,c),[l,c]);y(()=>{if(!i){a.current=null;return}if(!t||!o)return;let f=ct(t,h);B(t,"auto");let S=j(t,"position","static"),b=j(t,"transform","none"),D=j(t,"scale","1"),g=ct(o,{[nt]:"max-content",[rt]:"max-content"});function v(){S(),b(),g(),D()}if(p?.(),a.current===null){N(o,"max-content");let w=k(t);return a.current=w,N(o,w),v(),m?.(null,w),f}N(o,"max-content");let O=a.current,R=k(t);a.current=R,B(t,O),v(),m?.(O,R),N(o,R);let V=new AbortController;return P.request(()=>{B(t,R),d(()=>{t.style.setProperty(E,"auto"),t.style.setProperty(M,"auto")},V.signal)}),()=>{V.abort(),P.cancel(),f()}},[n,t,o,d,P,i,p,m,h])}function Rt(e,t){let o=e==="top",n=e==="left"||e===(t==="rtl"?"inline-end":"inline-start");return!o&&!n?Z:{position:"absolute",[o?"bottom":"top"]:"0",[n?"right":"left"]:"0"}}function j(e,t,o){let n=e.style.getPropertyValue(t);return e.style.setProperty(t,o),()=>{e.style.setProperty(t,n)}}function ct(e,t){let o=[];for(let[n,i]of Object.entries(t))o.push(j(e,n,i));return o.length?()=>{o.forEach(n=>n())}:Q}function B(e,t){let o=t==="auto"?"auto":`${t.width}px`,n=t==="auto"?"auto":`${t.height}px`;e.style.setProperty(E,o),e.style.setProperty(M,n)}function N(e,t){let o=t==="max-content"?"max-content":`${t.width}px`,n=t==="max-content"?"max-content":`${t.height}px`;e.style.setProperty(it,o),e.style.setProperty(st,n)}var lt={name:"adaptiveOrigin",async fn(e){let{x:t,y:o,rects:{floating:n},elements:{floating:i},platform:r,strategy:C,placement:l}=e,c=tt(i),d=c.getComputedStyle(i);if(!(d.transitionDuration!=="0s"&&d.transitionDuration!==""))return{x:t,y:o,data:H};let a=await r.getOffsetParent?.(i),p={width:0,height:0};if(C==="fixed"&&c?.visualViewport)p={width:c.visualViewport.width,height:c.visualViewport.height};else if(a===c){let D=F(i);p={width:D.documentElement.clientWidth,height:D.documentElement.clientHeight}}else await r.isElement?.(a)&&(p=await r.getDimensions(a));let m=et(l),h=t,f=o;m==="left"&&(h=p.width-(t+n.width)),m==="top"&&(f=p.height-(o+n.height));let S=m==="left"?"right":H.sideX,b=m==="top"?"bottom":H.sideY;return{x:h,y:f,data:{sideX:S,sideY:b}}}};var mt="data-activation-direction";var A=T(vt(),1),Zt={activationDirection:e=>e?{[mt]:e}:null};function te(e){let{store:t,side:o,children:n}=e,i=W(),r=t.useState("activeTriggerElement"),C=t.useState("activeTriggerId"),l=t.useState("open"),c=t.useState("payload"),d=t.useState("mounted"),P=t.useState("popupElement"),a=t.useState("positionerElement"),p=at(l?r:null),m=Dt(C,c),h=s.useRef(null),[f,S]=s.useState(null),[b,D]=s.useState(null),g=s.useRef(null),v=s.useRef(null),O=$(g,!0),R=L(),V=s.useRef(null),[w,X]=s.useState(null),[q,K]=s.useState(!1);y(()=>(t.set("adaptiveOrigin",lt),()=>{t.set("adaptiveOrigin",void 0)}),[t]);let ht=x(()=>{g.current?.style.setProperty("animation","none"),g.current?.style.setProperty("transition","none"),v.current?.style.setProperty("display","none")}),gt=x(u=>{g.current?.style.removeProperty("animation"),g.current?.style.removeProperty("transition"),v.current?.style.removeProperty("display"),u&&X(u)}),U=x(()=>{V.current?.abort();let u=new AbortController;V.current=u,O(()=>{S(null),X(null),h.current=null},u.signal)}),Y=s.useRef(null);y(()=>{(!l||!d)&&(Y.current=null)},[l,d]),y(()=>{if(l&&r&&p&&r!==p&&Y.current!==r&&h.current){S(h.current),K(!0);let u=St(p,r);D(u),Y.current=r}},[l,r,p]),y(()=>{f!=null&&(V.current?.abort(),K(!0),R.request(()=>{dt.flushSync(()=>{K(!1)}),U()}))},[m,f,U,R]),y(()=>{let u=g.current;if(!u)return;let J=F(u).createElement("div");for(let Ct of Array.from(u.childNodes))J.appendChild(Ct.cloneNode(!0));h.current=J});let z=f!=null,_;z?_=(0,A.jsxs)(s.Fragment,{children:[(0,A.jsx)("div",{"data-previous":!0,inert:ot(!0),ref:v,style:{...w?{[E]:`${w.width}px`,[M]:`${w.height}px`}:null,position:"absolute"},"data-ending-style":q?void 0:""},"previous"),(0,A.jsx)("div",{"data-current":!0,ref:g,"data-starting-style":q?"":void 0,children:n},m)]}):_=(0,A.jsx)("div",{"data-current":!0,ref:g,children:n},m),y(()=>{let u=v.current;!u||!f||u.replaceChildren(...Array.from(f.childNodes))},[f]),pt({popupElement:P,positionerElement:a,mounted:d,content:c,onMeasureLayout:ht,onMeasureLayoutComplete:gt,side:o,direction:i});let yt={activationDirection:xt(b),transitioning:z};return{children:_,state:yt}}function xt(e){if(e)return`${ft(e.horizontal,5,"right","left")} ${ft(e.vertical,5,"down","up")}`}function ft(e,t,o,n){return e>t?o:e<-t?n:""}function St(e,t){let o=e.getBoundingClientRect(),n=t.getBoundingClientRect(),i={x:o.left+o.width/2,y:o.top+o.height/2},r={x:n.left+n.width/2,y:n.top+n.height/2};return{horizontal:r.x-i.x,vertical:r.y-i.y}}function Dt(e,t){let[o,n]=s.useState(0),i=s.useRef(e),r=s.useRef(t),C=s.useRef(!1);return y(()=>{let l=i.current,c=r.current,d=e!==l,P=t!==c;d?(n(a=>a+1),C.current=!P):C.current&&P&&(n(a=>a+1),C.current=!1),i.current=e,r.current=t},[e,t]),`${e??"current"}-${o}`}export{Zt as a,te as b};
2
+ //# sourceMappingURL=chunk-UPZXXDXM.js.map
@@ -1,2 +1,2 @@
1
- import{B as R,C as h}from"./chunk-OXJ6LWKI.js";import{a as m,c as d}from"./chunk-FTWKUXER.js";import{c as T}from"./chunk-EGZKG2B2.js";import{a as b}from"./chunk-UH726PMV.js";import{b as f}from"./chunk-NZ73KS2Y.js";import{a as F}from"./chunk-IJQ26FTX.js";import{c as g}from"./chunk-KVMUXFPB.js";var l=g(F(),1);function A(o){let{store:e,domReference:i,positionerElement:u,open:s}=o,n=l.useRef(null),t=l.useRef(null),c=T(u);f(()=>{s||(t.current?.abort(),t.current=null,e.state.instantType==="trigger-change"&&e.set("instantType",void 0))},[s,e]),f(()=>{let r=i,p=n.current;if(r&&(n.current=r),!p||!r||r===p||!e.select("open"))return;e.set("instantType",void 0);let a=new AbortController;return t.current=a,c(()=>{e.select("open")&&e.set("instantType","trigger-change")},a.signal),()=>{a.abort()}},[i,c,e])}var E=g(b(),1);function x(o,e){function i(n,t,c){let r=n.currentTarget;E.flushSync(()=>{o.setOpen(!1,m(d.focusOut,n.nativeEvent,r))}),R(r.isConnected?r:e.current,t,c)?.focus()}function u(n){i(n,-1,o.select("positionerElement"))}function s(n){let t=o.select("positionerElement");t&&h(n,t)?o.context.beforeContentFocusGuardRef.current?.focus():i(n,1,t)}return{handlePreFocusGuardFocus:u,handleFocusTargetFocus:s}}export{A as a,x as b};
2
- //# sourceMappingURL=chunk-ML6HCGK5.js.map
1
+ import{B as R,C as h}from"./chunk-HCQR5YME.js";import{a as m,c as d}from"./chunk-FTWKUXER.js";import{c as T}from"./chunk-EGZKG2B2.js";import{a as b}from"./chunk-UH726PMV.js";import{b as f}from"./chunk-NZ73KS2Y.js";import{a as F}from"./chunk-IJQ26FTX.js";import{c as g}from"./chunk-KVMUXFPB.js";var l=g(F(),1);function A(o){let{store:e,domReference:i,positionerElement:u,open:s}=o,n=l.useRef(null),t=l.useRef(null),c=T(u);f(()=>{s||(t.current?.abort(),t.current=null,e.state.instantType==="trigger-change"&&e.set("instantType",void 0))},[s,e]),f(()=>{let r=i,p=n.current;if(r&&(n.current=r),!p||!r||r===p||!e.select("open"))return;e.set("instantType",void 0);let a=new AbortController;return t.current=a,c(()=>{e.select("open")&&e.set("instantType","trigger-change")},a.signal),()=>{a.abort()}},[i,c,e])}var E=g(b(),1);function x(o,e){function i(n,t,c){let r=n.currentTarget;E.flushSync(()=>{o.setOpen(!1,m(d.focusOut,n.nativeEvent,r))}),R(r.isConnected?r:e.current,t,c)?.focus()}function u(n){i(n,-1,o.select("positionerElement"))}function s(n){let t=o.select("positionerElement");t&&h(n,t)?o.context.beforeContentFocusGuardRef.current?.focus():i(n,1,t)}return{handlePreFocusGuardFocus:u,handleFocusTargetFocus:s}}export{A as a,x as b};
2
+ //# sourceMappingURL=chunk-XBWE3IIB.js.map
@@ -1,2 +1,2 @@
1
- import{a as r}from"./chunk-CT4EH2K2.js";import{a as e}from"./chunk-SVQCDOZ3.js";import{a as n}from"./chunk-IJQ26FTX.js";import{c as i}from"./chunk-KVMUXFPB.js";var o=i(n());var a=i(r());function s({className:t,...d}){return(0,a.jsx)("textarea",{"data-slot":"textarea",className:e("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",t),...d})}export{s as a};
2
- //# sourceMappingURL=chunk-NJX7QY3Z.js.map
1
+ import{a as e}from"./chunk-SVQCDOZ3.js";import{a as r}from"./chunk-CT4EH2K2.js";import{a as n}from"./chunk-IJQ26FTX.js";import{c as i}from"./chunk-KVMUXFPB.js";var o=i(n());var a=i(r());function s({className:t,...d}){return(0,a.jsx)("textarea",{"data-slot":"textarea",className:e("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",t),...d})}export{s as a};
2
+ //# sourceMappingURL=chunk-YFI7GTF6.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"./chunk-CT4EH2K2.js";import{a as t}from"./chunk-SVQCDOZ3.js";import{a as r}from"./chunk-IJQ26FTX.js";import{c as e}from"./chunk-KVMUXFPB.js";var d=e(r());var o=e(a());function s({className:l,...n}){return(0,o.jsx)("label",{"data-slot":"label",className:t("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",l),...n})}export{s as a};
2
- //# sourceMappingURL=chunk-NI6ZJ6DH.js.map
1
+ import{a as t}from"./chunk-SVQCDOZ3.js";import{a}from"./chunk-CT4EH2K2.js";import{a as r}from"./chunk-IJQ26FTX.js";import{c as e}from"./chunk-KVMUXFPB.js";var d=e(r());var o=e(a());function s({className:l,...n}){return(0,o.jsx)("label",{"data-slot":"label",className:t("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",l),...n})}export{s as a};
2
+ //# sourceMappingURL=chunk-YJM2Y722.js.map
@@ -1,2 +1,2 @@
1
- import{a as h}from"./chunk-SFI7YWVR.js";import{b as L}from"./chunk-NZ73KS2Y.js";import{a as z}from"./chunk-CT4EH2K2.js";import{b as _}from"./chunk-JIAVZ3V7.js";import{a as P}from"./chunk-IJQ26FTX.js";import{c as N}from"./chunk-KVMUXFPB.js";var R=N(P(),1);var y=N(P(),1),D=y.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});D.displayName="CompositeListContext";function T(){return y.useContext(D)}var j=N(z(),1);function Z(c){let{children:r,elementsRef:e,labelsRef:s,onMapChange:p}=c,n=h(p),[,u]=R.useState(0),a=_(F).current,x=_(B).current,M=R.useRef(0),f=R.useRef(!0),v=R.useRef(null),E=R.useRef(null),O=h(()=>{f.current||(f.current=!0,u(t=>t+1))}),C=h((t,d)=>{x.set(t,d),O()}),S=h(t=>{x.delete(t),O()}),l=h(t=>{let d=new Map;return e.current.length=0,s&&(s.current.length=0),t.forEach(o=>{d.set(o.element,{...o.registration.metadata??{},index:o.index}),e.current[o.index]=o.element,s&&(s.current[o.index]=o.registration.label!==void 0?o.registration.label:o.registration.textRef?.current?.textContent??o.element.textContent)}),M.current=e.current.length,d});function I(t){if(E.current?.disconnect(),E.current=null,typeof MutationObserver!="function"||t.length<2)return;let d=new MutationObserver(i=>{if(!H(i))return;let g=null;for(let m of t)if(m.isConnected){if(g&&A(g,m)>0){d.disconnect(),O();return}g=m}});E.current=d;let o=new Set;for(let i=1;i<t.length;i+=1){let g=q(t[i-1],t[i]);g&&o.add(g)}o.forEach(i=>d.observe(i,{childList:!0}))}let U=h(()=>{let[t,d]=G(x),o=l(t),i=v.current,g=!i||i.length!==t.length||t.some((m,W)=>{let w=i[W];return m.index!==w.index||m.element!==w.element||m.registration.index!==w.registration.index||m.registration.metadata!==w.registration.metadata});I(d),v.current=t,f.current=!1,g&&(a.forEach(m=>m(o)),n(o))});L(()=>(!f.current&&v.current&&l(v.current),()=>{e.current=[],s&&(s.current=[])}),[e,s,l]),L(()=>{f.current&&U()}),L(()=>()=>{E.current?.disconnect(),f.current=!0},[]);let k=h(t=>(a.add(t),()=>{a.delete(t)})),V=R.useMemo(()=>({register:C,unregister:S,subscribeMapChange:k,nextIndexRef:M}),[C,S,k,M]);return(0,j.jsx)(D.Provider,{value:V,children:r})}function B(){return new Map}function F(){return new Set}function G(c){let r=new Set,e=[],s=[];c.forEach((n,u)=>{if(!u.isConnected)return;let a=n.index,x={index:a??-1,element:u,registration:n};a===null?s.push(x):a>=0&&(r.add(a),e.push(x))});let p=0;return s.sort((n,u)=>A(n.element,u.element)),s.forEach(n=>{for(;r.has(p);)p+=1;n.index=p,e.push(n),p+=1}),r.size>0&&e.sort((n,u)=>n.index-u.index),[e,s.map(n=>n.element)]}function q(c,r){let e=c.parentElement;for(;e&&!e.contains(r);)e=e.parentElement;return e}function H(c){for(let r of c)for(let e=0;e<r.removedNodes.length;e+=1)if(r.removedNodes[e].isConnected)return!0;return!1}function A(c,r){return c.nextElementSibling===r?-1:r.nextElementSibling===c?1:c.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var b=N(P(),1);function ne(c={}){let{guess:r,label:e,metadata:s,textRef:p,index:n}=c,{register:u,unregister:a,subscribeMapChange:x,nextIndexRef:M}=T(),f=b.useRef(-1),[v,E]=b.useState(n==null&&r?()=>{if(f.current===-1){let l=M.current;M.current+=1,f.current=l}return f.current}:-1),O=n??v,C=b.useRef(null),S=b.useCallback(l=>{let I=C.current;I&&a(I),C.current=l,l&&u(l,{metadata:s??null,index:n??null,label:e,textRef:p})},[n,u,a,s,e,p]);return L(()=>{if(n==null)return x(l=>{let I=C.current?l.get(C.current)?.index:null;I!=null&&E(I)})},[n,x]),{ref:S,index:O}}export{T as a,Z as b,ne as c};
2
- //# sourceMappingURL=chunk-WLBNJ4K3.js.map
1
+ import{a as h}from"./chunk-SFI7YWVR.js";import{b as L}from"./chunk-NZ73KS2Y.js";import{b as _}from"./chunk-JIAVZ3V7.js";import{a as z}from"./chunk-CT4EH2K2.js";import{a as P}from"./chunk-IJQ26FTX.js";import{c as N}from"./chunk-KVMUXFPB.js";var R=N(P(),1);var y=N(P(),1),D=y.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});D.displayName="CompositeListContext";function T(){return y.useContext(D)}var j=N(z(),1);function Z(c){let{children:r,elementsRef:e,labelsRef:s,onMapChange:p}=c,n=h(p),[,u]=R.useState(0),a=_(F).current,x=_(B).current,M=R.useRef(0),f=R.useRef(!0),v=R.useRef(null),E=R.useRef(null),O=h(()=>{f.current||(f.current=!0,u(t=>t+1))}),C=h((t,d)=>{x.set(t,d),O()}),S=h(t=>{x.delete(t),O()}),l=h(t=>{let d=new Map;return e.current.length=0,s&&(s.current.length=0),t.forEach(o=>{d.set(o.element,{...o.registration.metadata??{},index:o.index}),e.current[o.index]=o.element,s&&(s.current[o.index]=o.registration.label!==void 0?o.registration.label:o.registration.textRef?.current?.textContent??o.element.textContent)}),M.current=e.current.length,d});function I(t){if(E.current?.disconnect(),E.current=null,typeof MutationObserver!="function"||t.length<2)return;let d=new MutationObserver(i=>{if(!H(i))return;let g=null;for(let m of t)if(m.isConnected){if(g&&A(g,m)>0){d.disconnect(),O();return}g=m}});E.current=d;let o=new Set;for(let i=1;i<t.length;i+=1){let g=q(t[i-1],t[i]);g&&o.add(g)}o.forEach(i=>d.observe(i,{childList:!0}))}let U=h(()=>{let[t,d]=G(x),o=l(t),i=v.current,g=!i||i.length!==t.length||t.some((m,W)=>{let w=i[W];return m.index!==w.index||m.element!==w.element||m.registration.index!==w.registration.index||m.registration.metadata!==w.registration.metadata});I(d),v.current=t,f.current=!1,g&&(a.forEach(m=>m(o)),n(o))});L(()=>(!f.current&&v.current&&l(v.current),()=>{e.current=[],s&&(s.current=[])}),[e,s,l]),L(()=>{f.current&&U()}),L(()=>()=>{E.current?.disconnect(),f.current=!0},[]);let k=h(t=>(a.add(t),()=>{a.delete(t)})),V=R.useMemo(()=>({register:C,unregister:S,subscribeMapChange:k,nextIndexRef:M}),[C,S,k,M]);return(0,j.jsx)(D.Provider,{value:V,children:r})}function B(){return new Map}function F(){return new Set}function G(c){let r=new Set,e=[],s=[];c.forEach((n,u)=>{if(!u.isConnected)return;let a=n.index,x={index:a??-1,element:u,registration:n};a===null?s.push(x):a>=0&&(r.add(a),e.push(x))});let p=0;return s.sort((n,u)=>A(n.element,u.element)),s.forEach(n=>{for(;r.has(p);)p+=1;n.index=p,e.push(n),p+=1}),r.size>0&&e.sort((n,u)=>n.index-u.index),[e,s.map(n=>n.element)]}function q(c,r){let e=c.parentElement;for(;e&&!e.contains(r);)e=e.parentElement;return e}function H(c){for(let r of c)for(let e=0;e<r.removedNodes.length;e+=1)if(r.removedNodes[e].isConnected)return!0;return!1}function A(c,r){return c.nextElementSibling===r?-1:r.nextElementSibling===c?1:c.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var b=N(P(),1);function ne(c={}){let{guess:r,label:e,metadata:s,textRef:p,index:n}=c,{register:u,unregister:a,subscribeMapChange:x,nextIndexRef:M}=T(),f=b.useRef(-1),[v,E]=b.useState(n==null&&r?()=>{if(f.current===-1){let l=M.current;M.current+=1,f.current=l}return f.current}:-1),O=n??v,C=b.useRef(null),S=b.useCallback(l=>{let I=C.current;I&&a(I),C.current=l,l&&u(l,{metadata:s??null,index:n??null,label:e,textRef:p})},[n,u,a,s,e,p]);return L(()=>{if(n==null)return x(l=>{let I=C.current?l.get(C.current)?.index:null;I!=null&&E(I)})},[n,x]),{ref:S,index:O}}export{T as a,Z as b,ne as c};
2
+ //# sourceMappingURL=chunk-ZNWVTDCV.js.map
@@ -1,2 +1,2 @@
1
- import{a as me,b as be,c as ye,d as Ie,e as we}from"./chunk-Z76KXEPD.js";import{i as Te}from"./chunk-H6TI5TWN.js";import{a as oe,b as Me,d as _e}from"./chunk-IAEAQCYR.js";import{E as pe,I as le,P as ue,Q as ce,S as de,V as fe,W as ge,X as De,Y as Re,_ as Se,ba as he,ca as Ce,da as Ee,ea as Pe,fa as xe,ga as Q,ia as Oe,ka as Ne}from"./chunk-OXJ6LWKI.js";import{a as ve}from"./chunk-B4MRCKT4.js";import{c as ne,e as re,k,m as se,o as ie,p as ae}from"./chunk-7OCTAHT6.js";import{a as w,c as T}from"./chunk-FTWKUXER.js";import{c as I}from"./chunk-AAL6V4Y3.js";import{d as U}from"./chunk-CLVPTZ4G.js";import{d as te}from"./chunk-EGZKG2B2.js";import{d as ee}from"./chunk-MQ67DRDE.js";import{b as J}from"./chunk-NZ73KS2Y.js";import{a as q}from"./chunk-CT4EH2K2.js";import{l as h}from"./chunk-JIAVZ3V7.js";import{a as C}from"./chunk-IJQ26FTX.js";import{c as D}from"./chunk-KVMUXFPB.js";var Be=D(C(),1);var j=D(C(),1),H=j.createContext(void 0);H.displayName="DialogRootContext";function c(e){let t=j.useContext(H);if(!e&&t===void 0)throw new Error("Base UI: DialogRootContext is missing. Dialog parts must be placed within <Dialog.Root>.");return t}var Xe=Be.forwardRef(function(t,n){let{render:i,className:d,style:m,forceRender:r=!1,...l}=t,a=c(),o=a.useState("open"),f=a.useState("nested"),g=a.useState("mounted"),R=a.useState("transitionStatus");return h("div",t,{state:{open:o,transitionStatus:R},ref:[a.context.backdropRef,n],stateAttributesMapping:ae,props:[{role:"presentation",hidden:!g,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:r||!f})});Xe.displayName="DialogBackdrop";var ke=D(C(),1);var Ze=ke.forwardRef(function(t,n){let{render:i,className:d,style:m,disabled:r=!1,nativeButton:l=!0,...a}=t,o=c(),f=o.useState("open"),{getButtonProps:g,buttonRef:R}=U({disabled:r,native:l}),E={disabled:r};function p(s){f&&o.setOpen(!1,w(T.closePress,s.nativeEvent))}return h("button",t,{state:E,ref:[n,R],props:[{onClick:p},a,g]})});Ze.displayName="DialogClose";var Ve=D(C(),1);var $e=Ve.forwardRef(function(t,n){let{render:i,className:d,style:m,id:r,...l}=t,a=c(),o=I(r);return a.useSyncedValueWithCleanup("descriptionElementId",o),h("p",t,{ref:n,props:[{id:o},l]})});$e.displayName="DialogDescription";var Ae="--nested-dialogs";var xt=k.open,Ot=k.closed,Nt=k.startingStyle,bt=k.endingStyle;var Fe="data-nested-dialog-open";var Ue=D(C(),1);var W=D(C(),1),K=W.createContext(void 0);K.displayName="DialogPortalContext";function L(){let e=W.useContext(K);if(e===void 0)throw new Error("Base UI: <Dialog.Portal> is missing.");return e}var z={...ie,...ee,nestedDialogOpen(e){return e?{[Fe]:""}:null}};var je=D(q(),1),ot=Ue.forwardRef(function(t,n){let{render:i,className:d,style:m,finalFocus:r,initialFocus:l,...a}=t,o=c(),f=o.useState("descriptionElementId"),g=o.useState("disablePointerDismissal"),R=o.useState("floatingRootContext"),E=o.useState("popupProps"),p=o.useState("modal"),s=o.useState("mounted"),S=o.useState("nested"),x=o.useState("nestedOpenDialogCount"),P=o.useState("open"),N=o.useState("openMethod"),b=o.useState("titleElementId"),u=o.useState("transitionStatus"),O=o.useState("role"),v=R.useState("floatingId");L(),te({open:P,ref:o.context.popupRef,onComplete(){P&&o.context.onOpenChangeComplete?.(!0)}});let M=l===void 0?ge(o.context.popupRef):l,y=x>0,_=o.useStateSetter("popupElement"),B=h("div",t,{state:{open:P,nested:S,transitionStatus:u,nestedDialogOpen:y},props:[E,{id:v,"aria-labelledby":b,"aria-describedby":f,role:O,...fe,hidden:!s,onKeyDown($){Te.has($.key)&&$.stopPropagation()},style:{[Ae]:x}},a],ref:[n,o.context.popupRef,_],stateAttributesMapping:z});return(0,je.jsx)(ue,{context:R,openInteractionType:N,disabled:!s,closeOnFocusOut:!g,initialFocus:M,returnFocus:r,modal:p!==!1,restoreFocus:"popup",children:B})});ot.displayName="DialogPopup";var He=D(C(),1);var V=D(q(),1),nt=He.forwardRef(function(t,n){let{keepMounted:i=!1,...d}=t,m=c(),r=m.useState("mounted"),l=m.useState("modal"),a=m.useState("open");return r||i?(0,V.jsx)(K.Provider,{value:i,children:(0,V.jsxs)(le,{ref:n,...d,children:[r&&l===!0&&(0,V.jsx)(Me,{ref:m.context.internalBackdropRef,inert:ve(!a)}),t.children]})}):null});nt.displayName="DialogPortal";var We=D(C(),1);var rt=We.forwardRef(function(t,n){let{render:i,className:d,style:m,id:r,...l}=t,a=c(),o=I(r);return a.useSyncedValueWithCleanup("titleElementId",o),h("h2",t,{ref:n,props:[{id:o},l]})});rt.displayName="DialogTitle";var Ke=D(C(),1);var st=Oe(function(t,n){let{render:i,className:d,style:m,disabled:r=!1,nativeButton:l=!0,id:a,payload:o,handle:f,...g}=t,R=c(!0),p=Ie(f)??R;if(!p)throw new Error("Base UI: <Dialog.Trigger> must be used within <Dialog.Root> or provided with a handle.");let s=I(a),S=p.useState("floatingRootContext"),x=p.useState("isOpenedByTrigger",s),P=p.useState("triggerPopupId",s),N=Ke.useRef(null),{registerTrigger:b,isMountedByThisTrigger:u}=he(s,N,p,{payload:o}),{getButtonProps:O,buttonRef:v}=U({disabled:r,native:l}),M=ce(S),y=_e(()=>p.select("open"),B=>{p.set("openMethod",B)}),_={disabled:r,open:x},F=p.useState("triggerProps",u);return h("button",t,{state:_,ref:[v,n,b,N],props:[M.reference,F,y,{[pe]:"",id:s,"aria-haspopup":"dialog","aria-expanded":x,"aria-controls":P},g,O],stateAttributesMapping:se})});st.displayName="DialogTrigger";var Le=D(C(),1);var it=Le.forwardRef(function(t,n){let{render:i,className:d,style:m,children:r,...l}=t,a=L(),o=c(),f=o.useState("open"),g=o.useState("nested"),R=o.useState("transitionStatus"),E=o.useState("nestedOpenDialogCount"),p=o.useState("mounted"),s=o.useStateSetter("viewportElement"),S=E>0;return h("div",t,{enabled:a||p,state:{open:f,nested:g,transitionStatus:R,nestedDialogOpen:S},ref:[n,s],stateAttributesMapping:z,props:[{role:"presentation",hidden:!p,style:{pointerEvents:f?void 0:"none"},children:r},l]})});it.displayName="DialogViewport";var G=D(C(),1);var ze={...ye,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},Y=class extends Ne{constructor(t,n,i){let d=new Q,m=Ye(t,d,n,i);super(m,qe(d),ze)}setOpen=(t,n)=>{n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),!n.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(t,n),this.update(Se(this.state,t,n.trigger)))}};function Ge(){let e=new Q;return new we(Object.freeze(Ye(void 0,e)),Object.freeze(qe(e)),ze)}function Ye(e,t,n,i=!1){return{...be(t,n,i),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}function qe(e){return{popupRef:G.createRef(),backdropRef:G.createRef(),internalBackdropRef:G.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}var X=class extends me{constructor(){super(Ge(),"Dialog",!1)}open(t){this.openByTrigger(t)}openWithPayload(t){let n=this.attachedStore;if(n===null){console.warn("Base UI: DialogHandle.openWithPayload() was called while no root using this handle is mounted. The call and its payload were ignored; mount a root with this handle before opening it imperatively.");return}n.set("payload",t),n.setOpen(!0,w(T.imperativeAction))}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}};function Eo(){return new X}var Qe=D(C(),1);var Z=D(C(),1);function Je({store:e,parentContext:t,isDrawer:n}){let i=e.useState("open"),d=e.useState("mounted"),m=e.useState("disablePointerDismissal"),r=e.useState("modal"),l=e.useState("popupElement"),a=e.useState("floatingRootContext"),[o,f]=Z.useState(0),[g,R]=Z.useState(0),E=o===0,p=de(a,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:r==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(s){if(!e.context.outsidePressEnabledRef.current||"button"in s&&s.button!==0)return!1;if("touches"in s){if(s.type==="touchend"){if(s.changedTouches.length!==1||s.touches.length!==0)return!1}else if(s.touches.length!==1)return!1}let S=re(s);if(E&&!m){if(r){let x=e.context.internalBackdropRef.current,P=e.context.backdropRef.current;return x||P?x===S||P===S||ne(S,l)&&!S?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:E});return oe(i&&r===!0,l),e.useContextCallback("onNestedDialogOpen",(s,S)=>{!e.select("open")&&!e.select("mounted")||(f(s),R(S))}),J(()=>{!i&&!d&&(f(0),R(0))},[i,d]),J(()=>(t?.onNestedDialogOpen&&i&&t.onNestedDialogOpen(o+1,g+(n?1:0)),()=>{t?.onNestedDialogOpen&&i&&t.onNestedDialogOpen(0,0)}),[n,i,o,g,t]),Pe(e,{activeTriggerProps:p.reference,inactiveTriggerProps:p.trigger,popupProps:p.floating,nestedOpenDialogCount:o,nestedOpenDrawerCount:g}),null}var A=D(q(),1);function ko(e,t){let{children:n,open:i,defaultOpen:d=!1,onOpenChange:m,onOpenChangeComplete:r,disablePointerDismissal:l=!1,modal:a=!0,actionsRef:o,handle:f,triggerId:g,defaultTriggerId:R=null}=t,E=e==="drawer",p=e==="alert-dialog",s=p?!0:a,S=p||l,x=p?"alertdialog":"dialog",P=c(!0),N=P!=null,b={modal:s,disablePointerDismissal:S,nested:N,role:x},u=De((F,B)=>new Y({open:d,openProp:i,activeTriggerId:R,triggerIdProp:g,...b},F,B),!0);u.useControlledProp("openProp",i),u.useControlledProp("triggerIdProp",g),u.useSyncedValues(b),u.useContextCallback("onOpenChange",m),u.useContextCallback("onOpenChangeComplete",r);let O=u.useState("open"),v=u.useState("mounted"),M=u.useState("payload");xe(u,O),Ce(u);let{forceUnmount:y}=Ee(O,u);Qe.useImperativeHandle(o,()=>({unmount:y,close:()=>u.setOpen(!1,w(T.imperativeAction))}),[y,u]);let _=O||v||f!=null;return(0,A.jsxs)(H.Provider,{value:u,children:[f&&(0,A.jsx)(Re,{handle:f,store:u}),_&&(0,A.jsx)(Je,{store:u,parentContext:P?.context,isDrawer:E}),typeof n=="function"?n({payload:M}):n]})}export{ko as a,Xe as b,Ze as c,$e as d,ot as e,nt as f,rt as g,st as h,it as i,X as j,Eo as k};
2
- //# sourceMappingURL=chunk-UUJ5X322.js.map
1
+ import{a as me,b as be,c as ye,d as Ie,e as we}from"./chunk-OXLXEX2R.js";import{i as Te}from"./chunk-H6TI5TWN.js";import{a as oe,b as Me,d as _e}from"./chunk-IAEAQCYR.js";import{E as pe,I as le,P as ue,Q as ce,S as de,V as fe,W as ge,X as De,Y as Re,_ as Se,ba as he,ca as Ce,da as Ee,ea as Pe,fa as xe,ga as Q,ia as Oe,ka as Ne}from"./chunk-HCQR5YME.js";import{a as ve}from"./chunk-B4MRCKT4.js";import{c as ne,e as re,k,m as se,o as ie,p as ae}from"./chunk-7OCTAHT6.js";import{a as w,c as T}from"./chunk-FTWKUXER.js";import{c as I}from"./chunk-AAL6V4Y3.js";import{d as U}from"./chunk-CLVPTZ4G.js";import{d as te}from"./chunk-EGZKG2B2.js";import{d as ee}from"./chunk-MQ67DRDE.js";import{b as J}from"./chunk-NZ73KS2Y.js";import{l as h}from"./chunk-JIAVZ3V7.js";import{a as q}from"./chunk-CT4EH2K2.js";import{a as C}from"./chunk-IJQ26FTX.js";import{c as D}from"./chunk-KVMUXFPB.js";var Be=D(C(),1);var j=D(C(),1),H=j.createContext(void 0);H.displayName="DialogRootContext";function c(e){let t=j.useContext(H);if(!e&&t===void 0)throw new Error("Base UI: DialogRootContext is missing. Dialog parts must be placed within <Dialog.Root>.");return t}var Xe=Be.forwardRef(function(t,n){let{render:i,className:d,style:m,forceRender:r=!1,...l}=t,a=c(),o=a.useState("open"),f=a.useState("nested"),g=a.useState("mounted"),R=a.useState("transitionStatus");return h("div",t,{state:{open:o,transitionStatus:R},ref:[a.context.backdropRef,n],stateAttributesMapping:ae,props:[{role:"presentation",hidden:!g,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:r||!f})});Xe.displayName="DialogBackdrop";var ke=D(C(),1);var Ze=ke.forwardRef(function(t,n){let{render:i,className:d,style:m,disabled:r=!1,nativeButton:l=!0,...a}=t,o=c(),f=o.useState("open"),{getButtonProps:g,buttonRef:R}=U({disabled:r,native:l}),E={disabled:r};function p(s){f&&o.setOpen(!1,w(T.closePress,s.nativeEvent))}return h("button",t,{state:E,ref:[n,R],props:[{onClick:p},a,g]})});Ze.displayName="DialogClose";var Ve=D(C(),1);var $e=Ve.forwardRef(function(t,n){let{render:i,className:d,style:m,id:r,...l}=t,a=c(),o=I(r);return a.useSyncedValueWithCleanup("descriptionElementId",o),h("p",t,{ref:n,props:[{id:o},l]})});$e.displayName="DialogDescription";var Ae="--nested-dialogs";var xt=k.open,Ot=k.closed,Nt=k.startingStyle,bt=k.endingStyle;var Fe="data-nested-dialog-open";var Ue=D(C(),1);var W=D(C(),1),K=W.createContext(void 0);K.displayName="DialogPortalContext";function L(){let e=W.useContext(K);if(e===void 0)throw new Error("Base UI: <Dialog.Portal> is missing.");return e}var z={...ie,...ee,nestedDialogOpen(e){return e?{[Fe]:""}:null}};var je=D(q(),1),ot=Ue.forwardRef(function(t,n){let{render:i,className:d,style:m,finalFocus:r,initialFocus:l,...a}=t,o=c(),f=o.useState("descriptionElementId"),g=o.useState("disablePointerDismissal"),R=o.useState("floatingRootContext"),E=o.useState("popupProps"),p=o.useState("modal"),s=o.useState("mounted"),S=o.useState("nested"),x=o.useState("nestedOpenDialogCount"),P=o.useState("open"),N=o.useState("openMethod"),b=o.useState("titleElementId"),u=o.useState("transitionStatus"),O=o.useState("role"),v=R.useState("floatingId");L(),te({open:P,ref:o.context.popupRef,onComplete(){P&&o.context.onOpenChangeComplete?.(!0)}});let M=l===void 0?ge(o.context.popupRef):l,y=x>0,_=o.useStateSetter("popupElement"),B=h("div",t,{state:{open:P,nested:S,transitionStatus:u,nestedDialogOpen:y},props:[E,{id:v,"aria-labelledby":b,"aria-describedby":f,role:O,...fe,hidden:!s,onKeyDown($){Te.has($.key)&&$.stopPropagation()},style:{[Ae]:x}},a],ref:[n,o.context.popupRef,_],stateAttributesMapping:z});return(0,je.jsx)(ue,{context:R,openInteractionType:N,disabled:!s,closeOnFocusOut:!g,initialFocus:M,returnFocus:r,modal:p!==!1,restoreFocus:"popup",children:B})});ot.displayName="DialogPopup";var He=D(C(),1);var V=D(q(),1),nt=He.forwardRef(function(t,n){let{keepMounted:i=!1,...d}=t,m=c(),r=m.useState("mounted"),l=m.useState("modal"),a=m.useState("open");return r||i?(0,V.jsx)(K.Provider,{value:i,children:(0,V.jsxs)(le,{ref:n,...d,children:[r&&l===!0&&(0,V.jsx)(Me,{ref:m.context.internalBackdropRef,inert:ve(!a)}),t.children]})}):null});nt.displayName="DialogPortal";var We=D(C(),1);var rt=We.forwardRef(function(t,n){let{render:i,className:d,style:m,id:r,...l}=t,a=c(),o=I(r);return a.useSyncedValueWithCleanup("titleElementId",o),h("h2",t,{ref:n,props:[{id:o},l]})});rt.displayName="DialogTitle";var Ke=D(C(),1);var st=Oe(function(t,n){let{render:i,className:d,style:m,disabled:r=!1,nativeButton:l=!0,id:a,payload:o,handle:f,...g}=t,R=c(!0),p=Ie(f)??R;if(!p)throw new Error("Base UI: <Dialog.Trigger> must be used within <Dialog.Root> or provided with a handle.");let s=I(a),S=p.useState("floatingRootContext"),x=p.useState("isOpenedByTrigger",s),P=p.useState("triggerPopupId",s),N=Ke.useRef(null),{registerTrigger:b,isMountedByThisTrigger:u}=he(s,N,p,{payload:o}),{getButtonProps:O,buttonRef:v}=U({disabled:r,native:l}),M=ce(S),y=_e(()=>p.select("open"),B=>{p.set("openMethod",B)}),_={disabled:r,open:x},F=p.useState("triggerProps",u);return h("button",t,{state:_,ref:[v,n,b,N],props:[M.reference,F,y,{[pe]:"",id:s,"aria-haspopup":"dialog","aria-expanded":x,"aria-controls":P},g,O],stateAttributesMapping:se})});st.displayName="DialogTrigger";var Le=D(C(),1);var it=Le.forwardRef(function(t,n){let{render:i,className:d,style:m,children:r,...l}=t,a=L(),o=c(),f=o.useState("open"),g=o.useState("nested"),R=o.useState("transitionStatus"),E=o.useState("nestedOpenDialogCount"),p=o.useState("mounted"),s=o.useStateSetter("viewportElement"),S=E>0;return h("div",t,{enabled:a||p,state:{open:f,nested:g,transitionStatus:R,nestedDialogOpen:S},ref:[n,s],stateAttributesMapping:z,props:[{role:"presentation",hidden:!p,style:{pointerEvents:f?void 0:"none"},children:r},l]})});it.displayName="DialogViewport";var G=D(C(),1);var ze={...ye,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},Y=class extends Ne{constructor(t,n,i){let d=new Q,m=Ye(t,d,n,i);super(m,qe(d),ze)}setOpen=(t,n)=>{n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),!n.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(t,n),this.update(Se(this.state,t,n.trigger)))}};function Ge(){let e=new Q;return new we(Object.freeze(Ye(void 0,e)),Object.freeze(qe(e)),ze)}function Ye(e,t,n,i=!1){return{...be(t,n,i),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}function qe(e){return{popupRef:G.createRef(),backdropRef:G.createRef(),internalBackdropRef:G.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}var X=class extends me{constructor(){super(Ge(),"Dialog",!1)}open(t){this.openByTrigger(t)}openWithPayload(t){let n=this.attachedStore;if(n===null){console.warn("Base UI: DialogHandle.openWithPayload() was called while no root using this handle is mounted. The call and its payload were ignored; mount a root with this handle before opening it imperatively.");return}n.set("payload",t),n.setOpen(!0,w(T.imperativeAction))}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}};function Eo(){return new X}var Qe=D(C(),1);var Z=D(C(),1);function Je({store:e,parentContext:t,isDrawer:n}){let i=e.useState("open"),d=e.useState("mounted"),m=e.useState("disablePointerDismissal"),r=e.useState("modal"),l=e.useState("popupElement"),a=e.useState("floatingRootContext"),[o,f]=Z.useState(0),[g,R]=Z.useState(0),E=o===0,p=de(a,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:r==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(s){if(!e.context.outsidePressEnabledRef.current||"button"in s&&s.button!==0)return!1;if("touches"in s){if(s.type==="touchend"){if(s.changedTouches.length!==1||s.touches.length!==0)return!1}else if(s.touches.length!==1)return!1}let S=re(s);if(E&&!m){if(r){let x=e.context.internalBackdropRef.current,P=e.context.backdropRef.current;return x||P?x===S||P===S||ne(S,l)&&!S?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:E});return oe(i&&r===!0,l),e.useContextCallback("onNestedDialogOpen",(s,S)=>{!e.select("open")&&!e.select("mounted")||(f(s),R(S))}),J(()=>{!i&&!d&&(f(0),R(0))},[i,d]),J(()=>(t?.onNestedDialogOpen&&i&&t.onNestedDialogOpen(o+1,g+(n?1:0)),()=>{t?.onNestedDialogOpen&&i&&t.onNestedDialogOpen(0,0)}),[n,i,o,g,t]),Pe(e,{activeTriggerProps:p.reference,inactiveTriggerProps:p.trigger,popupProps:p.floating,nestedOpenDialogCount:o,nestedOpenDrawerCount:g}),null}var A=D(q(),1);function ko(e,t){let{children:n,open:i,defaultOpen:d=!1,onOpenChange:m,onOpenChangeComplete:r,disablePointerDismissal:l=!1,modal:a=!0,actionsRef:o,handle:f,triggerId:g,defaultTriggerId:R=null}=t,E=e==="drawer",p=e==="alert-dialog",s=p?!0:a,S=p||l,x=p?"alertdialog":"dialog",P=c(!0),N=P!=null,b={modal:s,disablePointerDismissal:S,nested:N,role:x},u=De((F,B)=>new Y({open:d,openProp:i,activeTriggerId:R,triggerIdProp:g,...b},F,B),!0);u.useControlledProp("openProp",i),u.useControlledProp("triggerIdProp",g),u.useSyncedValues(b),u.useContextCallback("onOpenChange",m),u.useContextCallback("onOpenChangeComplete",r);let O=u.useState("open"),v=u.useState("mounted"),M=u.useState("payload");xe(u,O),Ce(u);let{forceUnmount:y}=Ee(O,u);Qe.useImperativeHandle(o,()=>({unmount:y,close:()=>u.setOpen(!1,w(T.imperativeAction))}),[y,u]);let _=O||v||f!=null;return(0,A.jsxs)(H.Provider,{value:u,children:[f&&(0,A.jsx)(Re,{handle:f,store:u}),_&&(0,A.jsx)(Je,{store:u,parentContext:P?.context,isDrawer:E}),typeof n=="function"?n({payload:M}):n]})}export{ko as a,Xe as b,Ze as c,$e as d,ot as e,nt as f,rt as g,st as h,it as i,X as j,Eo as k};
2
+ //# sourceMappingURL=chunk-ZTMZ7LJW.js.map
@@ -1,2 +1,2 @@
1
- import{H as n}from"./chunk-OXJ6LWKI.js";import{a as p}from"./chunk-UH726PMV.js";import{a as u}from"./chunk-CT4EH2K2.js";import{a as d}from"./chunk-IJQ26FTX.js";import{c as r}from"./chunk-KVMUXFPB.js";var e=r(d(),1),i=r(p(),1);var l=r(u(),1),N=e.forwardRef(function(o,s){let{children:c,container:m,className:g,render:F,style:P,...f}=o,{node:t,subtree:a}=n({container:m,ref:s,componentProps:o,elementProps:f});return!a&&!t?null:(0,l.jsxs)(e.Fragment,{children:[a,t&&i.createPortal(c,t)]})});N.displayName="FloatingPortalLite";export{N as a};
2
- //# sourceMappingURL=chunk-OW6AVFQA.js.map
1
+ import{H as n}from"./chunk-HCQR5YME.js";import{a as p}from"./chunk-UH726PMV.js";import{a as u}from"./chunk-CT4EH2K2.js";import{a as d}from"./chunk-IJQ26FTX.js";import{c as r}from"./chunk-KVMUXFPB.js";var e=r(d(),1),i=r(p(),1);var l=r(u(),1),N=e.forwardRef(function(o,s){let{children:c,container:m,className:g,render:F,style:P,...f}=o,{node:t,subtree:a}=n({container:m,ref:s,componentProps:o,elementProps:f});return!a&&!t?null:(0,l.jsxs)(e.Fragment,{children:[a,t&&i.createPortal(c,t)]})});N.displayName="FloatingPortalLite";export{N as a};
2
+ //# sourceMappingURL=chunk-ZZ2RYU7S.js.map
@@ -1,2 +1,2 @@
1
- import{e as w}from"./chunk-EDEL6XSO.js";import{b as s}from"./chunk-CWDPAB6V.js";import"./chunk-CLVPTZ4G.js";import"./chunk-5EK7QOB6.js";import"./chunk-LYT7LQS3.js";import{D as b,H as x,n as m}from"./chunk-IQ2XSDFU.js";import"./chunk-SFI7YWVR.js";import"./chunk-NZ73KS2Y.js";import{a as p}from"./chunk-CT4EH2K2.js";import"./chunk-JIAVZ3V7.js";import"./chunk-7TG23VIV.js";import{a as f}from"./chunk-SVQCDOZ3.js";import{a as j}from"./chunk-IJQ26FTX.js";import{c as l}from"./chunk-KVMUXFPB.js";var n=l(j());var e=l(p()),B={css:"text/css",json:"application/json",javascript:"text/javascript",typescript:"text/plain",html:"text/html",xml:"application/xml"};function E(){let[a,o]=n.useState(!1),c=n.useRef(0);n.useEffect(()=>()=>window.clearTimeout(c.current),[]);let r=n.useCallback(i=>{let t=()=>{o(!0),window.clearTimeout(c.current),c.current=window.setTimeout(()=>o(!1),1500)};return navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(i).then(t):Promise.reject(new Error("Clipboard unavailable"))},[]);return{copied:a,copy:r}}function L(a,o,c){let r=new Blob([a],{type:(B[c]||"text/plain")+";charset=utf-8"}),i=URL.createObjectURL(r),t=document.createElement("a");t.href=i,t.download=o||"code.txt",document.body.appendChild(t),t.click(),t.remove(),setTimeout(()=>URL.revokeObjectURL(i),1e3)}function z({code:a="",language:o="text",title:c,filename:r,showCopy:i=!0,showDownload:t,lineNumbers:v=!0,minLines:C=3,maxHeight:h="24rem",actions:y,className:R,...g}){let{copied:u,copy:k}=E(),d=c||r,T=t===void 0?!!r:t;return(0,e.jsxs)("div",{"data-slot":"code-block",className:f("flex min-w-0 flex-col overflow-hidden rounded-md border border-border bg-card",R),...g,children:[(0,e.jsxs)("div",{className:"flex min-h-9 items-center gap-2 border-b border-border bg-muted/40 px-3 py-1",children:[(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:d||o}),y,i?(0,e.jsx)(s,{variant:"ghost",size:"icon-xs","aria-label":u?"Copied":"Copy code",onClick:()=>k(a).catch(()=>{}),children:u?(0,e.jsx)(m,{}):(0,e.jsx)(b,{})}):null,T?(0,e.jsx)(s,{variant:"ghost",size:"icon-xs","aria-label":`Download ${r||"code"}`,onClick:()=>L(a,r,o),children:(0,e.jsx)(x,{})}):null]}),(0,e.jsx)(w,{value:a,language:o,readOnly:!0,lineNumbers:v,minLines:C,maxHeight:h,"aria-label":d?`${d} (read only)`:"Code (read only)",className:"rounded-none border-0 shadow-none dark:bg-transparent"})]})}export{z as CodeBlock,L as downloadText,E as useCopy};
2
- //# sourceMappingURL=code-block-H2ETQV3M.js.map
1
+ import{e as w}from"./chunk-ND526XXU.js";import{b as s}from"./chunk-34RXMJIM.js";import"./chunk-CLVPTZ4G.js";import"./chunk-5EK7QOB6.js";import"./chunk-LYT7LQS3.js";import{D as b,H as x,n as m}from"./chunk-IQ2XSDFU.js";import"./chunk-SFI7YWVR.js";import"./chunk-NZ73KS2Y.js";import"./chunk-JIAVZ3V7.js";import"./chunk-7TG23VIV.js";import{a as f}from"./chunk-SVQCDOZ3.js";import{a as p}from"./chunk-CT4EH2K2.js";import{a as j}from"./chunk-IJQ26FTX.js";import{c as l}from"./chunk-KVMUXFPB.js";var n=l(j());var e=l(p()),B={css:"text/css",json:"application/json",javascript:"text/javascript",typescript:"text/plain",html:"text/html",xml:"application/xml"};function E(){let[a,o]=n.useState(!1),c=n.useRef(0);n.useEffect(()=>()=>window.clearTimeout(c.current),[]);let r=n.useCallback(i=>{let t=()=>{o(!0),window.clearTimeout(c.current),c.current=window.setTimeout(()=>o(!1),1500)};return navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(i).then(t):Promise.reject(new Error("Clipboard unavailable"))},[]);return{copied:a,copy:r}}function L(a,o,c){let r=new Blob([a],{type:(B[c]||"text/plain")+";charset=utf-8"}),i=URL.createObjectURL(r),t=document.createElement("a");t.href=i,t.download=o||"code.txt",document.body.appendChild(t),t.click(),t.remove(),setTimeout(()=>URL.revokeObjectURL(i),1e3)}function z({code:a="",language:o="text",title:c,filename:r,showCopy:i=!0,showDownload:t,lineNumbers:v=!0,minLines:C=3,maxHeight:h="24rem",actions:y,className:R,...g}){let{copied:u,copy:k}=E(),d=c||r,T=t===void 0?!!r:t;return(0,e.jsxs)("div",{"data-slot":"code-block",className:f("flex min-w-0 flex-col overflow-hidden rounded-md border border-border bg-card",R),...g,children:[(0,e.jsxs)("div",{className:"flex min-h-9 items-center gap-2 border-b border-border bg-muted/40 px-3 py-1",children:[(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:d||o}),y,i?(0,e.jsx)(s,{variant:"ghost",size:"icon-xs","aria-label":u?"Copied":"Copy code",onClick:()=>k(a).catch(()=>{}),children:u?(0,e.jsx)(m,{}):(0,e.jsx)(b,{})}):null,T?(0,e.jsx)(s,{variant:"ghost",size:"icon-xs","aria-label":`Download ${r||"code"}`,onClick:()=>L(a,r,o),children:(0,e.jsx)(x,{})}):null]}),(0,e.jsx)(w,{value:a,language:o,readOnly:!0,lineNumbers:v,minLines:C,maxHeight:h,"aria-label":d?`${d} (read only)`:"Code (read only)",className:"rounded-none border-0 shadow-none dark:bg-transparent"})]})}export{z as CodeBlock,L as downloadText,E as useCopy};
2
+ //# sourceMappingURL=code-block-IKYEIWY2.js.map
@@ -0,0 +1,2 @@
1
+ import{a,b,c,d,e}from"./chunk-ND526XXU.js";import"./chunk-SVQCDOZ3.js";import"./chunk-CT4EH2K2.js";import"./chunk-IJQ26FTX.js";import"./chunk-KVMUXFPB.js";export{e as CodeEditor,c as codeLanguageForType,b as isCodeEngineLoaded,a as loadCodeEngine,d as useCodeEditor};
2
+ //# sourceMappingURL=code-editor-KDRLM33B.js.map
@@ -1,2 +1,2 @@
1
- import{a as W,b as $,c as S,d as j,e as L,f as z}from"./chunk-KNOE7TZW.js";import"./chunk-T4Y5HG5P.js";import"./chunk-CJ5CECQT.js";import"./chunk-R5KQ2GRA.js";import"./chunk-FTWKUXER.js";import"./chunk-AAL6V4Y3.js";import{d as q}from"./chunk-CLVPTZ4G.js";import"./chunk-5EK7QOB6.js";import"./chunk-LYT7LQS3.js";import"./chunk-XIXCIQKJ.js";import"./chunk-EGZKG2B2.js";import"./chunk-2L7NK6SJ.js";import"./chunk-DR47HKIK.js";import{d as M}from"./chunk-MQ67DRDE.js";import"./chunk-UH726PMV.js";import{a as U}from"./chunk-SFI7YWVR.js";import{b as I}from"./chunk-NZ73KS2Y.js";import{a as O}from"./chunk-CT4EH2K2.js";import{c as B,i as H,l as p}from"./chunk-JIAVZ3V7.js";import{a as G}from"./chunk-SVQCDOZ3.js";import{a as x}from"./chunk-IJQ26FTX.js";import{b as de,c as r}from"./chunk-KVMUXFPB.js";var $e=r(x());var d={};de(d,{Panel:()=>w,Root:()=>T,Trigger:()=>A});var b=r(x(),1);var N={...L,...M};var J=r(O(),1),T=b.forwardRef(function(t,u){let{render:E,className:l,defaultOpen:a=!1,disabled:g=!1,onOpenChange:m,open:C,style:h,...R}=t,n=U(m),e=W({open:C,defaultOpen:a,onOpenChange:n,disabled:g}),s=b.useMemo(()=>({open:e.open,disabled:e.disabled,transitionStatus:e.transitionStatus}),[e.open,e.disabled,e.transitionStatus]),c=b.useMemo(()=>({...e,onOpenChange:n,state:s}),[e,n,s]),i=p("div",t,{state:s,ref:u,props:R,stateAttributesMapping:N});return(0,J.jsx)($.Provider,{value:c,children:i})});T.displayName="CollapsibleRoot";var K=r(x(),1);var ue={...j,...M},A=K.forwardRef(function(t,u){let{panelId:E,open:l,handleTrigger:a,state:g,disabled:m}=S(),{className:C,disabled:h=m,render:R,nativeButton:n=!0,style:e,...s}=t,{getButtonProps:c,buttonRef:i}=q({disabled:h,native:n});return p("button",t,{state:g,ref:[u,i],props:[{"aria-controls":l?E:void 0,"aria-expanded":l,onClick:a},s,c],stateAttributesMapping:ue})});A.displayName="CollapsibleTrigger";var v=r(x(),1);var Q="--collapsible-panel-height",X="--collapsible-panel-width";var w=v.forwardRef(function(t,u){let{className:E,hiddenUntilFound:l,keepMounted:a,render:g,id:m,style:C,...h}=t;v.useEffect(()=>{l&&a===!1&&B("The `keepMounted={false}` prop on `Collapsible.Panel` is ignored when `hiddenUntilFound` is enabled, since the panel must remain mounted while closed.")},[l,a]);let{defaultPanelId:R,mounted:n,onOpenChange:e,open:s,setMounted:c,setPanelIdState:i,setOpen:V,state:Z,transitionStatus:ee}=S(),te=l??!1,oe=a??!1,P=m||void 0,le=P??R;I(()=>(i(f=>P??(f===null?void 0:f)),()=>{i(f=>f===P?null:f)}),[P,i]);let{height:D,props:ae,ref:ne,shouldPreventOpenAnimation:se,shouldRender:ie,transitionStatus:re,width:k}=z({externalRef:u,hiddenUntilFound:te,id:le,keepMounted:oe,mounted:n,onOpenChange:e,open:s,setMounted:c,setOpen:V,transitionStatus:ee}),_={...Z,transitionStatus:re},F=H(C,_),pe=p("div",{...t,style:void 0},{state:_,ref:ne,props:[ae,{style:{[Q]:D===void 0?"auto":`${D}px`,[X]:k===void 0?"auto":`${k}px`}},h,F?{style:F}:void 0,se?{style:{animationName:"none"}}:void 0],stateAttributesMapping:N});return ie?pe:null});w.displayName="CollapsiblePanel";var y=r(O());function qe({...o}){return(0,y.jsx)(d.Root,{"data-slot":"collapsible",...o})}function ze({...o}){return(0,y.jsx)(d.Trigger,{"data-slot":"collapsible-trigger",...o})}function Ge({className:o,...t}){return(0,y.jsx)(d.Panel,{"data-slot":"collapsible-content",className:G("h-(--collapsible-panel-height) overflow-hidden transition-[height] duration-200 ease-out data-ending-style:h-0 data-starting-style:h-0",o),...t})}export{qe as Collapsible,Ge as CollapsibleContent,Ge as CollapsiblePanel,ze as CollapsibleTrigger};
2
- //# sourceMappingURL=collapsible-4ZOFMWLB.js.map
1
+ import{a as W,b as $,c as S,d as j,e as L,f as z}from"./chunk-KNOE7TZW.js";import"./chunk-T4Y5HG5P.js";import"./chunk-CJ5CECQT.js";import"./chunk-R5KQ2GRA.js";import"./chunk-FTWKUXER.js";import"./chunk-AAL6V4Y3.js";import{d as q}from"./chunk-CLVPTZ4G.js";import"./chunk-5EK7QOB6.js";import"./chunk-LYT7LQS3.js";import"./chunk-XIXCIQKJ.js";import"./chunk-EGZKG2B2.js";import"./chunk-2L7NK6SJ.js";import"./chunk-DR47HKIK.js";import{d as M}from"./chunk-MQ67DRDE.js";import"./chunk-UH726PMV.js";import{a as U}from"./chunk-SFI7YWVR.js";import{b as I}from"./chunk-NZ73KS2Y.js";import{c as B,i as H,l as p}from"./chunk-JIAVZ3V7.js";import{a as G}from"./chunk-SVQCDOZ3.js";import{a as O}from"./chunk-CT4EH2K2.js";import{a as x}from"./chunk-IJQ26FTX.js";import{b as de,c as r}from"./chunk-KVMUXFPB.js";var $e=r(x());var d={};de(d,{Panel:()=>w,Root:()=>T,Trigger:()=>A});var b=r(x(),1);var N={...L,...M};var J=r(O(),1),T=b.forwardRef(function(t,u){let{render:E,className:l,defaultOpen:a=!1,disabled:g=!1,onOpenChange:m,open:C,style:h,...R}=t,n=U(m),e=W({open:C,defaultOpen:a,onOpenChange:n,disabled:g}),s=b.useMemo(()=>({open:e.open,disabled:e.disabled,transitionStatus:e.transitionStatus}),[e.open,e.disabled,e.transitionStatus]),c=b.useMemo(()=>({...e,onOpenChange:n,state:s}),[e,n,s]),i=p("div",t,{state:s,ref:u,props:R,stateAttributesMapping:N});return(0,J.jsx)($.Provider,{value:c,children:i})});T.displayName="CollapsibleRoot";var K=r(x(),1);var ue={...j,...M},A=K.forwardRef(function(t,u){let{panelId:E,open:l,handleTrigger:a,state:g,disabled:m}=S(),{className:C,disabled:h=m,render:R,nativeButton:n=!0,style:e,...s}=t,{getButtonProps:c,buttonRef:i}=q({disabled:h,native:n});return p("button",t,{state:g,ref:[u,i],props:[{"aria-controls":l?E:void 0,"aria-expanded":l,onClick:a},s,c],stateAttributesMapping:ue})});A.displayName="CollapsibleTrigger";var v=r(x(),1);var Q="--collapsible-panel-height",X="--collapsible-panel-width";var w=v.forwardRef(function(t,u){let{className:E,hiddenUntilFound:l,keepMounted:a,render:g,id:m,style:C,...h}=t;v.useEffect(()=>{l&&a===!1&&B("The `keepMounted={false}` prop on `Collapsible.Panel` is ignored when `hiddenUntilFound` is enabled, since the panel must remain mounted while closed.")},[l,a]);let{defaultPanelId:R,mounted:n,onOpenChange:e,open:s,setMounted:c,setPanelIdState:i,setOpen:V,state:Z,transitionStatus:ee}=S(),te=l??!1,oe=a??!1,P=m||void 0,le=P??R;I(()=>(i(f=>P??(f===null?void 0:f)),()=>{i(f=>f===P?null:f)}),[P,i]);let{height:D,props:ae,ref:ne,shouldPreventOpenAnimation:se,shouldRender:ie,transitionStatus:re,width:k}=z({externalRef:u,hiddenUntilFound:te,id:le,keepMounted:oe,mounted:n,onOpenChange:e,open:s,setMounted:c,setOpen:V,transitionStatus:ee}),_={...Z,transitionStatus:re},F=H(C,_),pe=p("div",{...t,style:void 0},{state:_,ref:ne,props:[ae,{style:{[Q]:D===void 0?"auto":`${D}px`,[X]:k===void 0?"auto":`${k}px`}},h,F?{style:F}:void 0,se?{style:{animationName:"none"}}:void 0],stateAttributesMapping:N});return ie?pe:null});w.displayName="CollapsiblePanel";var y=r(O());function qe({...o}){return(0,y.jsx)(d.Root,{"data-slot":"collapsible",...o})}function ze({...o}){return(0,y.jsx)(d.Trigger,{"data-slot":"collapsible-trigger",...o})}function Ge({className:o,...t}){return(0,y.jsx)(d.Panel,{"data-slot":"collapsible-content",className:G("h-(--collapsible-panel-height) overflow-hidden transition-[height] duration-200 ease-out data-ending-style:h-0 data-starting-style:h-0",o),...t})}export{qe as Collapsible,Ge as CollapsibleContent,Ge as CollapsiblePanel,ze as CollapsibleTrigger};
2
+ //# sourceMappingURL=collapsible-WK7PDWEV.js.map