@cloudflare/kumo 2.13.2 → 2.15.0

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 (472) hide show
  1. package/CHANGELOG.md +76 -0
  2. package/README.md +2 -2
  3. package/ai/component-registry.json +792 -64
  4. package/ai/component-registry.md +1666 -224
  5. package/ai/schemas.ts +110 -3
  6. package/dist/.build-complete +1 -1
  7. package/dist/ai/schemas.d.ts +360 -69
  8. package/dist/ai/schemas.js +216 -23
  9. package/dist/blocks-source/delete-resource/delete-resource.test.tsx +21 -0
  10. package/dist/blocks-source/delete-resource/delete-resource.tsx +14 -8
  11. package/dist/catalog.d.ts +11 -11
  12. package/dist/chunks/{index.parts-ef9111sjk9e3al87.js → AccordionPanelDataAttributes-mmrmkky28u1010l5.js} +189 -120
  13. package/dist/chunks/{AlertDialogTrigger-k3f8nevrda6awa4s.js → AlertDialogTrigger-l1r1gbxcky1xq889.js} +5 -5
  14. package/dist/chunks/AlertDialogTriggerDataAttributes-go49qon601catpgn.js +56 -0
  15. package/dist/chunks/{AutocompleteItem-ksckpihly1c23f3j.js → AutocompleteItem-36ysm5nwbsd0snr6.js} +17 -29
  16. package/dist/chunks/AutocompleteItemDataAttributes-n5rigpf0s9ylnwi3.js +232 -0
  17. package/dist/chunks/AutocompleteSeparator-bnqeqh7i983d92gx.js +12 -0
  18. package/dist/chunks/{index.parts-i4iu310eo65d7lfc.js → AvatarImageDataAttributes-jw70u384c83lhqfp.js} +111 -35
  19. package/dist/chunks/{Button-oczevl8g75m85ew9.js → ButtonDataAttributes-nceand1fi7lvnmkb.js} +12 -4
  20. package/dist/chunks/{CSPContext-guqghj8kxoukvlky.js → CSPContext-iv67i0qqhihg8mur.js} +1 -7
  21. package/dist/chunks/{CSPProvider-f3it239kgztzgryk.js → CSPProvider-finau3a8hnc9o2td.js} +2 -2
  22. package/dist/chunks/{CheckboxGroup-g5xn5gnq8ocqyoum.js → CheckboxGroup-581mfftu99wvjb3a.js} +58 -45
  23. package/dist/chunks/{CheckboxGroupContext-f9wox07n2u5moq4h.js → CheckboxGroupContext-jf1bt3znvqlhrql6.js} +3 -5
  24. package/dist/chunks/CheckboxGroupDataAttributes-nskqcxts64symbvf.js +10 -0
  25. package/dist/chunks/{CheckboxRoot-o5bfpje6e4p6pdgm.js → CheckboxIndicator-i13dmhacfgqo328c.js} +187 -134
  26. package/dist/chunks/CheckboxIndicatorDataAttributes-3p29ju7nkczz1l2y.js +85 -0
  27. package/dist/chunks/{CollapsiblePanel-e80n35tnsb2cskt9.js → CollapsiblePanel-md5suzmtnsyz1kab.js} +39 -38
  28. package/dist/chunks/CollapsibleRootDataAttributes-bynmgxmt4jikaoha.js +36 -0
  29. package/dist/chunks/{ComboboxClear-glm805v81uaaf3su.js → ComboboxClear-ioejwvtnmqanph88.js} +91 -99
  30. package/dist/chunks/ComboboxClearDataAttributes-lo0enstdmrqpywsy.js +402 -0
  31. package/dist/chunks/{ComboboxEmpty-hwv2kjxnf9un635e.js → ComboboxEmpty-gkt1y5b81a4983v7.js} +770 -702
  32. package/dist/chunks/ComboboxItemIndicatorDataAttributes-iku7l9ig0ve09an4.js +259 -0
  33. package/dist/chunks/{ComboboxPopup-fx7xex6g75t9u0gm.js → ComboboxPopup-n8cbgys9st446j1i.js} +57 -57
  34. package/dist/chunks/{CompositeItem-l7zee38lq5m224d5.js → CompositeItem-kepwg8jtvgap06o6.js} +4 -7
  35. package/dist/chunks/CompositeList-gwuaf6d14s4da0j0.js +182 -0
  36. package/dist/chunks/{CompositeListContext-oetjj2x8li8678as.js → CompositeListContext-bejvmlu39hsfjzgu.js} +2 -5
  37. package/dist/chunks/{CompositeRoot-l6ot8jo0umdics5m.js → CompositeRoot-dnlkb27uw4g5aocf.js} +61 -63
  38. package/dist/chunks/{CompositeRootContext-ofhzmevv7hadjhyy.js → CompositeRootContext-obm54j7y6s86qwhq.js} +1 -1
  39. package/dist/chunks/{index.parts-bv57na43ve93uz3x.js → ContextMenuTriggerDataAttributes-xwozccynxv6pk5s0.js} +82 -37
  40. package/dist/chunks/DialogBackdropDataAttributes-jwqxd6jla03xh8ke.js +28 -0
  41. package/dist/chunks/DialogCloseDataAttributes-12m7gwh3i6fd7d05.js +76 -0
  42. package/dist/chunks/{DialogPopup-mp89aob2nown2akq.js → DialogPopup-n6w7b389e7bs0472.js} +31 -72
  43. package/dist/chunks/DialogRoot-hkkqj7vcjpkx8qk8.js +16 -0
  44. package/dist/chunks/{DialogTrigger-cmok07cf3ks0kzug.js → DialogTrigger-kpugfkbfswqrus4u.js} +23 -20
  45. package/dist/chunks/DialogTriggerDataAttributes-bp9bu13cvwuddh5b.js +18 -0
  46. package/dist/chunks/DialogViewportDataAttributes-mma9emv1edsc1vuy.js +78 -0
  47. package/dist/chunks/{DirectionContext-jc1g0w645603sd6p.js → DirectionContext-kpby968j030psajn.js} +1 -4
  48. package/dist/chunks/{DirectionProvider-ihtfgxd5qpm6oth1.js → DirectionProvider-cg0pwzgdyg6r73r6.js} +2 -2
  49. package/dist/chunks/DrawerViewport-mzqpwvqtylnad8ib.js +1532 -0
  50. package/dist/chunks/DrawerViewportDataAttributes-dd9593zm9fl9vcsm.js +1072 -0
  51. package/dist/chunks/FieldControl-hjj2tcqruozadgdi.js +122 -0
  52. package/dist/chunks/{FieldDescription-ju607ea6gwgzga8p.js → FieldDescription-orix2gepowrp5ni4.js} +13 -12
  53. package/dist/chunks/{FieldItemContext-j85dc0ihramj5ezs.js → FieldItemContext-ohsf45im6xhpay40.js} +1 -1
  54. package/dist/chunks/FieldItemDataAttributes-m52srx69pispz49i.js +283 -0
  55. package/dist/chunks/FieldLabel-fjc7tdis7rcbq8o4.js +353 -0
  56. package/dist/chunks/{FieldsetLegend-j5piwq1giyhrr8s4.js → FieldsetLegend-gl9z9eezr0xg9zr7.js} +7 -14
  57. package/dist/chunks/FieldsetLegendDataAttributes-fn20251jxjqkpkxm.js +17 -0
  58. package/dist/chunks/{FieldsetRootContext-b633e9uzilttuyfi.js → FieldsetRootContext-fphwizvcm55ydg94.js} +1 -1
  59. package/dist/chunks/{FloatingPortalLite-mlt7ztrvhzepwi5y.js → FloatingPortalLite-j7dsy7gokbxdoe1i.js} +3 -3
  60. package/dist/chunks/{popupStateMapping-hdv48wmkzb2mqful.js → FloatingRootStore-men6ufp3a2b296fh.js} +215 -243
  61. package/dist/chunks/{FloatingTree-oosjswl1s9q4obvg.js → FloatingTree-kiyzavvaum442o1s.js} +6 -6
  62. package/dist/chunks/Form-oz425k7r4abea8o4.js +113 -0
  63. package/dist/chunks/{FormContext-xz0b4h7ue30fkkn1.js → FormContext-jv19engyccpf6xcl.js} +4 -3
  64. package/dist/chunks/{Input-ovqfhsmpfcrg5czm.js → Input-ozudotydd679ly63.js} +2 -2
  65. package/dist/chunks/InputDataAttributes-oy8t6q5y5t8ik02j.js +42 -0
  66. package/dist/chunks/ItemIndicator-cvf8cw5fv5l3cd8j.js +37 -0
  67. package/dist/chunks/{LabelableContext-hetas2e4y0kywfas.js → LabelableContext-dz4wz3lu3lgqusu7.js} +50 -46
  68. package/dist/chunks/ListboxSeparator-skazx18vzzj7i9zp.js +21 -0
  69. package/dist/chunks/MenuClearDataAttributes-fo0pekd36n56mdxu.js +1645 -0
  70. package/dist/chunks/{MenuSubmenuTrigger-fzubf5xr7ohsgsi7.js → MenuSubmenuTrigger-hm5xbgik6aq95x35.js} +917 -473
  71. package/dist/chunks/MenuSubmenuTriggerDataAttributes-gdfxdjymgmnaxdds.js +372 -0
  72. package/dist/chunks/{MenuTrigger-ntugq34yppc8ouwe.js → MenuTrigger-dlfvicsaggss0o9m.js} +45 -46
  73. package/dist/chunks/{Menubar-d57cyjuztbge4dvv.js → Menubar-ja5int05ihjj0ra4.js} +29 -30
  74. package/dist/chunks/{MenubarContext-ei2r6vu6lmsspozo.js → MenubarContext-ooz0h08i55c8oip5.js} +1 -1
  75. package/dist/chunks/{MeterLabel-c40b0q8r81cftkjj.js → MeterLabel-cykbkvqys5263z05.js} +15 -18
  76. package/dist/chunks/{index.parts-fl4zaorc97ed3keb.js → NavigationMenuIconDataAttributes-l82pkpm61d0meqxf.js} +470 -278
  77. package/dist/chunks/NullStore-my62xo2vfcfkerri.js +110 -0
  78. package/dist/chunks/{index.parts-7z8hqx6zl9yajzvs.js → NumberFieldScrubAreaCursorDataAttributes-k2lsbk35svshnwf5.js} +592 -528
  79. package/dist/chunks/{index.parts-bmzuqorz0tmneh7t.js → OTPFieldInputDataAttributes-gvgtu2gg85kgjzwr.js} +189 -70
  80. package/dist/chunks/{PopoverClose-e91n3nkw16qnyese.js → PopoverViewport-peh28i8q4hqfjy97.js} +271 -224
  81. package/dist/chunks/PopoverViewportDataAttributes-gplhq9d7ffp9q8u3.js +329 -0
  82. package/dist/chunks/PrehydrationScript-hs2je3mndbxuts7w.js +78 -0
  83. package/dist/chunks/{index.parts-nd3mitrhxf806lsa.js → PreviewCardViewportDataAttributes-bgfwmyshey7fx6nr.js} +369 -147
  84. package/dist/chunks/ProgressLabelDataAttributes-j8mutcz11ei0ohvj.js +287 -0
  85. package/dist/chunks/{RadioGroup-lsix4haqxfigpuv8.js → RadioGroup-kioqngmmuo7a1lfa.js} +49 -51
  86. package/dist/chunks/{RadioGroupContext-ft0nndmzqynjz8a2.js → RadioGroupContext-dr6uihsj7oky0eol.js} +1 -1
  87. package/dist/chunks/RadioGroupDataAttributes-dpdr6xe4ve204qwb.js +10 -0
  88. package/dist/chunks/{RadioIndicator-mwkahpwyqfc6yk1i.js → RadioIndicator-bhxqih8wzv7hyrec.js} +108 -105
  89. package/dist/chunks/RadioIndicatorDataAttributes-n5yupp5psifu0d4f.js +80 -0
  90. package/dist/chunks/{ScrollAreaThumb-kmhan411yxfo0362.js → ScrollAreaThumb-hxig41yn4lrurd3o.js} +373 -389
  91. package/dist/chunks/ScrollAreaThumbDataAttributes-gup5wfxvqye6jj27.js +137 -0
  92. package/dist/chunks/SelectScrollUpArrowDataAttributes-fce5i1afjkb0necr.js +473 -0
  93. package/dist/chunks/{SelectGroupLabel-m4h5hrft9043nsd1.js → SelectSeparator-nnak70azojox8b2b.js} +593 -561
  94. package/dist/chunks/{Separator-b8wf5rea6m1cei8k.js → Separator-fhwve0tfny3tht3a.js} +2 -2
  95. package/dist/chunks/SeparatorDataAttributes-ch6e63bas7zflw00.js +11 -0
  96. package/dist/chunks/{index.parts-hxjt52jbictdzgad.js → SliderIndicator-h1o3qbrvr8x0t4t2.js} +341 -399
  97. package/dist/chunks/SliderIndicatorDataAttributes-ff2f1cjealif5nvo.js +240 -0
  98. package/dist/chunks/{SwitchRoot-e3hnyh3mf8qd30hj.js → SwitchRoot-m4t2tq5zn5wibyxk.js} +96 -89
  99. package/dist/chunks/SwitchThumbDataAttributes-f95ld864on9y6ptk.js +90 -0
  100. package/dist/chunks/{TabsList-c0inft3sf8gi2o4v.js → TabsList-n5n93rxr4sy704u8.js} +225 -178
  101. package/dist/chunks/TabsListDataAttributes-e03a7kbubuf02z1l.js +183 -0
  102. package/dist/chunks/ToastArrowDataAttributes-jbnvz3kp6a35slgj.js +136 -0
  103. package/dist/chunks/{Toggle-c8p9m3puz8l4mav7.js → ToggleDataAttributes-jl9ojyvwgrvefke6.js} +28 -14
  104. package/dist/chunks/{ToggleGroupContext-cdk2zo6ciddpockn.js → ToggleGroupContext-hg8zbkgqpscqhz83.js} +3 -5
  105. package/dist/chunks/{ToggleGroup-xz9zrh7t1htn6ht4.js → ToggleGroupDataAttributes-n1dwona1alvabstl.js} +35 -39
  106. package/dist/chunks/{ToolbarGroupContext-nriz3632ymugfj6h.js → ToolbarGroupContext-eawva8xkxb4osbxb.js} +3 -5
  107. package/dist/chunks/{ToolbarInput-er5t9irqvuwcjrir.js → ToolbarInput-kyxl1be0p3cyuayp.js} +28 -33
  108. package/dist/chunks/ToolbarInputDataAttributes-n4a18a4km735du04.js +150 -0
  109. package/dist/chunks/{ToolbarRootContext-lvi96r1vvs93rhde.js → ToolbarRootContext-difqbj720teyt8lu.js} +1 -1
  110. package/dist/chunks/{TooltipPopup-l2zrbjavf1cqclfx.js → TooltipPopup-furysmeyb68uycbz.js} +132 -161
  111. package/dist/chunks/{TooltipProvider-eyhgia63aq2x4frl.js → TooltipProvider-hyans0ens4axh1y8.js} +14 -17
  112. package/dist/chunks/TooltipViewportDataAttributes-gkwbezdq40ssuevg.js +312 -0
  113. package/dist/chunks/adaptiveOriginMiddleware-m9tqzw58wya9sdds.js +51 -0
  114. package/dist/chunks/{addEventListener-lhqvk2ahlzjsanyg.js → addEventListener-ku3x23446prmd1kz.js} +1 -1
  115. package/dist/chunks/areArraysEqual-nnpg93s9g7aqcaoh.js +15 -0
  116. package/dist/chunks/{autocomplete-dn6g4rc8bktdl4an.js → autocomplete-kgp17p6oz4pczxt9.js} +10 -10
  117. package/dist/chunks/{badge-xw5ydgdjx2o5qxbl.js → badge-kyz53p7p0ng393bs.js} +4 -2
  118. package/dist/chunks/{banner-n1ekcvrwashsgv93.js → banner-cpla8vqjxaulggyd.js} +3 -3
  119. package/dist/chunks/{breadcrumbs-ffwe8tzqzmpyikq5.js → breadcrumbs-oyuqwb09l08uhok2.js} +9 -17
  120. package/dist/chunks/button-group-biv43ksvaipc3p5n.js +59 -0
  121. package/dist/chunks/{button-h36q7tklakhd38nx.js → button-oxy32x5w9x9az80g.js} +25 -6
  122. package/dist/chunks/{chart-qmls2klknm1pd6hs.js → chart-foxl6xbubuoshfcs.js} +945 -54
  123. package/dist/chunks/{checkbox-jachq6akfh72x12r.js → checkbox-o9627970y7c9ciqy.js} +90 -37
  124. package/dist/chunks/clamp-rcpupxvhqrn8uuyf.js +7 -0
  125. package/dist/chunks/{clipboard-text-ms46uaujvkjmjnng.js → clipboard-text-bhy88tgvk1o6wmyl.js} +6 -6
  126. package/dist/chunks/{cloudflare-logo-boafurcbm5ttoo4o.js → cloudflare-logo-d8mid9xr190h78cu.js} +3 -3
  127. package/dist/chunks/{code-eu8kzwqnlhoyin24.js → code-nj2nu6qzxhz6qnkk.js} +1 -1
  128. package/dist/chunks/{collapsible-jyajpe40jcca357s.js → collapsible-ic6813hc4yv5s5hv.js} +2 -2
  129. package/dist/chunks/{combobox-hxarufzb1z61xnbv.js → combobox-hwrq8etkr7p2id0x.js} +13 -12
  130. package/dist/chunks/{command-palette-iomiziccabzh4ogg.js → command-palette-el4x943vpmid0po0.js} +9 -9
  131. package/dist/chunks/{composite-o65hjzwwzb4kvl4w.js → composite-c11t1ok72s3cggjc.js} +9 -21
  132. package/dist/chunks/{constants-j09lrtg73n4vlx5x.js → constants-l10cgj6pyqg27jod.js} +1 -1
  133. package/dist/chunks/{core-kjfqbvgicl9i3abf.js → core-n0de50o00ej2ecfe.js} +69 -55
  134. package/dist/chunks/createBaseUIEventDetails-nvee6bghv2reeqdb.js +50 -0
  135. package/dist/chunks/{ComboboxChipRemove-ksyozjezihhstmbu.js → createItems-n07tfwx89cdoar18.js} +125 -104
  136. package/dist/chunks/{createToastManager-kv89sv0xhhsvmq54.js → createToastManager-cxjmn4jx3ejh85fs.js} +353 -361
  137. package/dist/chunks/{css-d3t41yfupsmz7l1a.js → css-j501gxq1am2gnikh.js} +1 -1
  138. package/dist/chunks/{date-picker-fwe3vllwco4u1utz.js → date-picker-oee5ehsrepnlmltj.js} +58 -51
  139. package/dist/chunks/{date-range-picker-iymdx410i1hpvxai.js → date-range-picker-hpx3cdu9ve01jx6d.js} +16 -15
  140. package/dist/chunks/{dialog-o0164pgcyc74lvp9.js → dialog-lgrwmsumwpftp2u8.js} +14 -11
  141. package/dist/chunks/{dropdown-d5qrzj1w1a96w2we.js → dropdown-o875yxeqod7qp871.js} +134 -31
  142. package/dist/chunks/empty-ft85jcbs7fd5t3tn.js +96 -0
  143. package/dist/chunks/{engine-io35xsj9fgfxtihg.js → engine-hzmefiqm63hu0c7i.js} +2 -2
  144. package/dist/chunks/{engine-javascript-d795u677f1802oaf.js → engine-javascript-e9xj8hhz9xfqhpnu.js} +200 -185
  145. package/dist/chunks/{engine-oniguruma-xjlw46ay321yj1av.js → engine-oniguruma-ias56ildu01gf939.js} +8 -7
  146. package/dist/chunks/error-lbnic2b20qr3mukp.js +6 -0
  147. package/dist/chunks/{field-kgz7w7yixmtpg010.js → field-jzzlgre0jmrr38o2.js} +4 -4
  148. package/dist/chunks/{flow-fmfb3ri8cxo7w9ci.js → flow-imvwzp5p2f8y2dxm.js} +83 -63
  149. package/dist/chunks/formatNumber-b4kjdsebslm2b3t0.js +21 -0
  150. package/dist/chunks/{getCssDimensions-mi941fe1jvztqm6b.js → getCssDimensions-gckwdrp86f73cv51.js} +2 -2
  151. package/dist/chunks/getElementTransform-cz3jyftv0x5io95f.js +38 -0
  152. package/dist/chunks/getFiniteAnimations-jwd833ybtz81j5f0.js +13 -0
  153. package/dist/chunks/getHighlightReason-fhc53kq6qakcct9s.js +15 -0
  154. package/dist/chunks/{getPseudoElementBounds-jg72lmrlwgbqhmjh.js → getPseudoElementBounds-csuw8kwsoeyxd5tv.js} +13 -4
  155. package/dist/chunks/{github-light-kb466scjoy42qxpu.js → github-light-hir7yctc38258pwt.js} +1 -1
  156. package/dist/chunks/{graphql-gtqr4wytdf0qjybo.js → graphql-n9vlzkvcp2j19p7a.js} +1 -1
  157. package/dist/chunks/{grid-fjlo3wlpkwgw56y9.js → grid-nwiczrab3r4w0zr2.js} +1 -1
  158. package/dist/chunks/{html-ijyj3f9k0foag15c.js → html-nimj6ljkkifnc9ni.js} +2 -2
  159. package/dist/chunks/{index.parts-lz9cnngidxppvhz7.js → index.parts-db9pzsm9rrs9tp0t.js} +27 -40
  160. package/dist/chunks/{index.parts-i5twygaksh86erb7.js → index.parts-ggacwr0yakuemead.js} +7 -6
  161. package/dist/chunks/{index.parts-kt0w73ciea6adi2i.js → index.parts-pcg3pmf3yyro841t.js} +2 -2
  162. package/dist/chunks/{inertValue-f9pgp32jxnm88df3.js → inertValue-n09gkjvwwa1kddov.js} +2 -2
  163. package/dist/chunks/inline-copy-text-57r67slswfqvgbaf.js +104 -0
  164. package/dist/chunks/{input-group-kshukialqry0fmra.js → input-group-n08mcd8b36wbylro.js} +11 -8
  165. package/dist/chunks/{input-ikfimmpl5sngvh9s.js → input-il37wjigy2xtgdo2.js} +12 -11
  166. package/dist/chunks/{input-pehjmr1q131tz38w.js → input-ksy1w6j1m6olz6ck.js} +3 -3
  167. package/dist/chunks/{isElementDisabled-ffsy1y4adxocmexb.js → isElementDisabled-dyqutxpzdfppbohx.js} +1 -1
  168. package/dist/chunks/itemEquality-ki3x4tzdhjlqjey6.js +56 -0
  169. package/dist/chunks/{label-ie2gpde0nco1avi7.js → label-hugrtzreeqk5mtqu.js} +10 -6
  170. package/dist/chunks/{layer-card-dnikj7emx8qeaspz.js → layer-card-mar4dya5kl1vvie6.js} +6 -4
  171. package/dist/chunks/layer-dialog-dwrrgv1wasrerow4.js +406 -0
  172. package/dist/chunks/{link-gp4swsrd3vfnvori.js → link-h84bkh8eem39p529.js} +4 -4
  173. package/dist/chunks/{loader-j2v6fab8iucuxz1z.js → loader-kv5nk8j8tsuesxqo.js} +2 -6
  174. package/dist/chunks/locale-provider-e3310bgo4lnffqkd.js +41 -0
  175. package/dist/chunks/{menubar-ljbsj2ulayebjyza.js → menubar-m5pqhx7lu5z7mkks.js} +14 -13
  176. package/dist/chunks/{mergeCleanups-pexn3wul6a4zn873.js → mergeCleanups-nw73c6jfwl5tyhw4.js} +1 -1
  177. package/dist/chunks/{meter-fl03ece4glrrzizj.js → meter-poh8jpe0qtq6mvee.js} +2 -2
  178. package/dist/chunks/{pagination-i3jewbdolgru0xnr.js → pagination-h24on80p2z5ugqdb.js} +3 -3
  179. package/dist/chunks/{popover-jal8z9sv176703lf.js → popover-nqrt3ykqv6sic8pz.js} +71 -17
  180. package/dist/chunks/popupHandle-dk3ixgc8flr7v971.js +177 -0
  181. package/dist/chunks/popupStoreUtils-czfnxn051xakask5.js +868 -0
  182. package/dist/chunks/{portal-provider-gznk6snyqj6egd6d.js → portal-provider-eveknxf26oudn7pp.js} +4 -0
  183. package/dist/chunks/radio-d3pkrvsldfbdefav.js +203 -0
  184. package/dist/chunks/reason-parts-hssx64rmlxyn6gw5.js +40 -0
  185. package/dist/chunks/{resolveAriaLabelledBy-h9qwvo10ftlj6t9k.js → resolveAriaLabelledBy-knaucrjrjwnk7tvs.js} +1 -1
  186. package/dist/chunks/{resolveValueLabel-bq3nrzord518kp9q.js → resolveValueLabel-ntacnb58mhka5gg0.js} +11 -30
  187. package/dist/chunks/{safePolygon-szbj0u31i6mpt36d.js → safePolygon-ep4133qogeu5vjf3.js} +51 -49
  188. package/dist/chunks/{safeReact-bavzz23j5tex60z2.js → safeReact-ek77ilng4ekk7mgz.js} +2 -2
  189. package/dist/chunks/scrollable-k784b35i80aolmvg.js +29 -0
  190. package/dist/chunks/{select-ndqpqpmqtmn497rq.js → select-ey03k4630uckf1rk.js} +10 -11
  191. package/dist/chunks/{sensitive-input-jtbp3mvdynz9wewu.js → sensitive-input-lfrrtyg9n5ulq3tb.js} +23 -28
  192. package/dist/chunks/{serializeValue-ci3kihruew64i36f.js → serializeValue-d1otz2i7h5tygrwf.js} +1 -1
  193. package/dist/chunks/{sidebar-icky50wdc2b1biw8.js → sidebar-gluq5b5oacrdk4m4.js} +120 -40
  194. package/dist/chunks/{skeleton-line-hlk5vauzo7xsalbo.js → skeleton-line-gjf1fecmyy82aejz.js} +9 -6
  195. package/dist/chunks/slider-juwif2d8xa5n0429.js +87 -0
  196. package/dist/chunks/{sql-do9h6435gka97c4c.js → sql-hqp2eekl7qhmxe92.js} +1 -1
  197. package/dist/chunks/{stringifyLocale-cl8et9xf6zon4qbs.js → stringifyLocale-gbxouqj7ol627jxh.js} +1 -1
  198. package/dist/chunks/{styles-dbhgpd8fm76fdfo3.js → styles-eb8bvypmayf578jf.js} +2 -2
  199. package/dist/chunks/{surface-ef2kr5pn7r1y3ipk.js → surface-ginwpan1pz61l6k2.js} +2 -2
  200. package/dist/chunks/{switch-oghrd7f6i5jqar59.js → switch-mqf1ulvle4nd6d2t.js} +4 -4
  201. package/dist/chunks/{table-miggde3uqhhrd5at.js → table-nysse5tiwf47gg4k.js} +2 -2
  202. package/dist/chunks/{table-of-contents-cvduqgssxdcbpagh.js → table-of-contents-gkjv9ck8etbz64ej.js} +5 -2
  203. package/dist/chunks/{tabs-mr2dsloqfe0io4a5.js → tabs-mmkz7q5rofnmogwt.js} +3 -3
  204. package/dist/chunks/tag-input-b10gfxoob9vcizpm.js +140 -0
  205. package/dist/chunks/{text-jzp4mdlr222iuzxt.js → text-me99rjbjkaff98gp.js} +4 -4
  206. package/dist/chunks/{toast-g435fvt74w5orxqo.js → toast-b4t9rt9y1sumcmy2.js} +8 -7
  207. package/dist/chunks/{toolbar-e0b61hr6ys6dmwhv.js → toolbar-hov6sa3ui366f447.js} +7 -6
  208. package/dist/chunks/{tooltip-jq15p5jzgfrhslpo.js → tooltip-lguwh8bjhxwnjfus.js} +4 -4
  209. package/dist/chunks/use-copy-feedback-gl55ghst0csvpv4j.js +55 -0
  210. package/dist/chunks/{useAnchoredPopupScrollLock-lbrqp1zm5z821z20.js → useAnchoredPopupScrollLock-msm8tzkewysnunut.js} +4 -4
  211. package/dist/chunks/{useAnimationFrame-ssgc72hyq6sg3yit.js → useAnimationFrame-k9lqdj9quln3sd85.js} +5 -4
  212. package/dist/chunks/{useAriaLabelledBy-bvw56m1d7czf0w3f.js → useAriaLabelledBy-j3j9jqlr9ukyk08s.js} +7 -9
  213. package/dist/chunks/{useBaseUiId-gqkl5ep5pn6hd0rw.js → useBaseUiId-nk4k7nj9h1cy76ny.js} +2 -2
  214. package/dist/chunks/{useButton-cpo6u2idqcnou6vy.js → useButton-lklvdzuhvj22bx07.js} +58 -21
  215. package/dist/chunks/{useClick-fvwb39qgead2jyft.js → useClick-pcbkcc7r620v1smu.js} +13 -12
  216. package/dist/chunks/{useCollapsiblePanel-bw63vwvq9a3sj73q.js → useCollapsiblePanel-lrfsgx21ds36cwlp.js} +116 -80
  217. package/dist/chunks/{useCompositeItem-esr3n4pmlssiuxuy.js → useCompositeItem-2juex3zh9gyrs8e9.js} +4 -4
  218. package/dist/chunks/useCompositeListItem-ekwo2j2rjkggg7xj.js +54 -0
  219. package/dist/chunks/{useControlled-nlx0kk1ksgk0auvi.js → useControlled-i3srnkxy598s0au9.js} +4 -4
  220. package/dist/chunks/useFieldValidation-oe16jiigp971yrzr.js +224 -0
  221. package/dist/chunks/{useFloatingRootContext-o6mk8fvodtbbm2v1.js → useFloatingRootContext-k676b6m7f80bdapd.js} +7 -7
  222. package/dist/chunks/{useFocus-gdfx28bn90keg8cf.js → useFocus-mn7a9t9v6fnlb4mf.js} +17 -15
  223. package/dist/chunks/useId-82z8yqlmc1hy1c5t.js +50 -0
  224. package/dist/chunks/useInitialLiveRegionTextMutation-nl2hus7zx1h7ggno.js +86 -0
  225. package/dist/chunks/{useLabel-nh9hf8h7o6oquqn5.js → useLabel-me6zzfvkypo458pi.js} +23 -12
  226. package/dist/chunks/useLabelableId-bjeh6q3pgrqjb7er.js +56 -0
  227. package/dist/chunks/{useListNavigation-jnxpvegv3ak857b1.js → useListNavigation-hpddbd0cc9pvt461.js} +62 -68
  228. package/dist/chunks/{useOnMount-j4wobeq47l3u9olo.js → useOnMount-gxggz1m0n869s6r0.js} +3 -3
  229. package/dist/chunks/{useOpenChangeComplete-dpkex2e23s1evpol.js → useOpenChangeComplete-edtabjwqmechsyv6.js} +51 -39
  230. package/dist/chunks/usePopupHandleStore-gawjmfjf1xdgiph3.js +27 -0
  231. package/dist/chunks/{usePopupViewport-hu0kn0ziyf1vqzrs.js → usePopupViewport-l6w01iohvzloghy8.js} +99 -75
  232. package/dist/chunks/{usePositioner-fz9uswhkhg22lo42.js → usePositioner-mzvgnazldqvy44z2.js} +160 -182
  233. package/dist/chunks/usePressAndHold-k9ynk78pgf677kpx.js +179 -0
  234. package/dist/chunks/{usePreviousValue-le0grv8f43vmunn1.js → usePreviousValue-o6swt5tb7xhpdu4e.js} +2 -2
  235. package/dist/chunks/{useRegisterFieldControl-m1rxsuvtpau2341n.js → useRegisterFieldControl-m1stc9l9y4cndf0k.js} +16 -10
  236. package/dist/chunks/{useRegisteredLabelId-dh83mybmzy75waje.js → useRegisteredLabelId-b7u9ygya03448zzn.js} +4 -4
  237. package/dist/chunks/{useRender-gtnbrp1ityffi4xf.js → useRender-h9ktka9xt4obdv6y.js} +2 -2
  238. package/dist/chunks/useRenderDialogRoot-bsqrqpc1ddau7xg4.js +312 -0
  239. package/dist/chunks/{useRenderElement-m8kc7jyuczp71mq8.js → useRenderElement-nkklxbq1rp7h2kw0.js} +59 -56
  240. package/dist/chunks/{useScrollLock-mpns3u42eks8hhex.js → useScrollLock-le7ajwlt7oh6fzxi.js} +108 -85
  241. package/dist/chunks/useSetFieldFocused-fbvj7gcv67dqfkp0.js +35 -0
  242. package/dist/chunks/{useStableCallback-ninxmksdjvwl6ejj.js → useStableCallback-le5qgj6p9l04729n.js} +3 -3
  243. package/dist/chunks/{useSwipeDismiss-bpbyw2ihsw3fw6y9.js → useSwipeDismiss-e8tfxzlp05p86mgb.js} +96 -217
  244. package/dist/chunks/{useTimeout-oqptmu2xmyv5ccic.js → useTimeout-f0ayn2l2l9aop4l8.js} +3 -3
  245. package/dist/chunks/{useTransitionStatus-ig4waxl2kervpyw4.js → useTransitionStatus-disysoblzgk34w14.js} +15 -7
  246. package/dist/chunks/{useTriggerFocusGuards-j8nano0pqu9dscrz.js → useTriggerFocusGuards-dyd3hb1m8en8ct50.js} +12 -21
  247. package/dist/chunks/useTriggerSwitchTransition-hk5j36hd5dq2ok6w.js +62 -0
  248. package/dist/chunks/{useTypeahead-onenwjyhgw955ygx.js → useTypeahead-kfdsw1ksl5bgvvzl.js} +20 -23
  249. package/dist/chunks/{useValueAsRef-lrn42zari17368c9.js → useValueAsRef-dv0tmfr1xlpzdlru.js} +3 -3
  250. package/dist/chunks/{useValueChanged-kthmz4wk7ywnjwtx.js → useValueChanged-fjssa2v6d4w8y332.js} +5 -8
  251. package/dist/chunks/{utils-0i7gujfv3f3e9dqh.js → utils-o44zfmzz9z7uyj1v.js} +0 -1
  252. package/dist/chunks/{valueToPercent-henpkkj3juy3ukeu.js → valueToPercent-djk2mqnihth2uvf6.js} +1 -1
  253. package/dist/chunks/{vendor-floating-ui-dsysdmve7iazaaes.js → vendor-floating-ui-fqblx3wa0r71mjoo.js} +87 -187
  254. package/dist/chunks/vendor-styling-gs32v7xt5znc8kg0.js +1167 -0
  255. package/dist/chunks/{vendor-utils-luqsvbyuig727bnr.js → vendor-utils-io8z5lsfxq8m2dcc.js} +191 -43
  256. package/dist/chunks/vesper-g839e590k3dxnwh3.js +5 -0
  257. package/dist/chunks/{visuallyHidden-n14xllazfozg55ox.js → visuallyHidden-kzzs9hbe93is3rci.js} +2 -1
  258. package/dist/chunks/{wasm-nfbosyhilcq70atf.js → wasm-cpasy0o9lsjrm39j.js} +1 -1
  259. package/dist/code/server.d.ts +9 -10
  260. package/dist/code/server.js +8 -7
  261. package/dist/code.d.ts +8 -8
  262. package/dist/code.js +23 -26
  263. package/dist/components/autocomplete.d.ts +1 -1
  264. package/dist/components/autocomplete.js +1 -1
  265. package/dist/components/badge.js +1 -1
  266. package/dist/components/banner.js +1 -1
  267. package/dist/components/breadcrumbs.js +1 -1
  268. package/dist/components/button-group.d.ts +2 -0
  269. package/dist/components/button-group.js +3 -0
  270. package/dist/components/button.js +1 -1
  271. package/dist/components/chart.d.ts +2 -2
  272. package/dist/components/chart.js +2 -2
  273. package/dist/components/checkbox.d.ts +1 -1
  274. package/dist/components/checkbox.js +1 -1
  275. package/dist/components/clipboard-text.js +1 -1
  276. package/dist/components/cloudflare-logo.js +1 -1
  277. package/dist/components/code.js +1 -1
  278. package/dist/components/collapsible.js +1 -1
  279. package/dist/components/combobox.d.ts +1 -1
  280. package/dist/components/combobox.js +1 -1
  281. package/dist/components/command-palette.d.ts +1 -1
  282. package/dist/components/command-palette.js +1 -1
  283. package/dist/components/date-picker.d.ts +1 -1
  284. package/dist/components/date-picker.js +1 -1
  285. package/dist/components/date-range-picker.js +1 -1
  286. package/dist/components/dialog.d.ts +1 -1
  287. package/dist/components/dialog.js +1 -1
  288. package/dist/components/dropdown.d.ts +1 -1
  289. package/dist/components/dropdown.js +1 -1
  290. package/dist/components/empty.js +1 -1
  291. package/dist/components/field.js +1 -1
  292. package/dist/components/flow.js +1 -1
  293. package/dist/components/grid.js +1 -1
  294. package/dist/components/inline-copy-text.d.ts +2 -0
  295. package/dist/components/inline-copy-text.js +3 -0
  296. package/dist/components/input-group.d.ts +1 -1
  297. package/dist/components/input-group.js +1 -1
  298. package/dist/components/input.d.ts +1 -1
  299. package/dist/components/input.js +3 -3
  300. package/dist/components/label.d.ts +1 -1
  301. package/dist/components/label.js +1 -1
  302. package/dist/components/layer-card.js +1 -1
  303. package/dist/components/layer-dialog.d.ts +2 -0
  304. package/dist/components/layer-dialog.js +3 -0
  305. package/dist/components/link.d.ts +8 -9
  306. package/dist/components/link.js +1 -1
  307. package/dist/components/loader.js +2 -2
  308. package/dist/components/menubar.js +1 -1
  309. package/dist/components/meter.js +1 -1
  310. package/dist/components/pagination.js +1 -1
  311. package/dist/components/popover.d.ts +1 -1
  312. package/dist/components/popover.js +1 -1
  313. package/dist/components/radio.d.ts +1 -1
  314. package/dist/components/radio.js +1 -1
  315. package/dist/components/select.d.ts +1 -1
  316. package/dist/components/select.js +1 -1
  317. package/dist/components/sensitive-input.d.ts +1 -1
  318. package/dist/components/sensitive-input.js +1 -1
  319. package/dist/components/sidebar.d.ts +1 -1
  320. package/dist/components/sidebar.js +1 -1
  321. package/dist/components/slider.d.ts +2 -0
  322. package/dist/components/slider.js +3 -0
  323. package/dist/components/surface.js +1 -1
  324. package/dist/components/switch.d.ts +1 -1
  325. package/dist/components/switch.js +1 -1
  326. package/dist/components/table-of-contents.d.ts +1 -1
  327. package/dist/components/table-of-contents.js +1 -1
  328. package/dist/components/table.d.ts +1 -1
  329. package/dist/components/table.js +1 -1
  330. package/dist/components/tabs.d.ts +1 -1
  331. package/dist/components/tabs.js +1 -1
  332. package/dist/components/tag-input.d.ts +2 -0
  333. package/dist/components/tag-input.js +3 -0
  334. package/dist/components/text.d.ts +1 -1
  335. package/dist/components/text.js +1 -1
  336. package/dist/components/toast.d.ts +1 -1
  337. package/dist/components/toast.js +2 -2
  338. package/dist/components/toolbar.d.ts +1 -1
  339. package/dist/components/toolbar.js +1 -1
  340. package/dist/components/tooltip.d.ts +1 -1
  341. package/dist/components/tooltip.js +1 -1
  342. package/dist/{index-BXsHCLB82.d.ts → index--RbAKeBL.d.ts} +1 -1
  343. package/dist/index-5bJAnzUo.d.ts +156 -0
  344. package/dist/{index-BoPqM1Ia2.d.ts → index-AUC5xRcO.d.ts} +65 -8
  345. package/dist/{index-CeBzVJP8.d.ts → index-BK1tZgmP.d.ts} +1 -1
  346. package/dist/{index-CGbkysYW2.d.ts → index-BMe3cpLB.d.ts} +5 -4
  347. package/dist/{index-Di3sC6UF.d.ts → index-BW1HVU7T.d.ts} +34 -6
  348. package/dist/index-BWe6haHU.d.ts +64 -0
  349. package/dist/{index-BcRyiNd72.d.ts → index-BvNXYn7u.d.ts} +8 -1
  350. package/dist/index-C7RoG_CH.d.ts +57 -0
  351. package/dist/{index-D-y1ktn-.d.ts → index-CE09bLNb.d.ts} +5 -1
  352. package/dist/{index-DBlw3E9m.d.ts → index-CNJRbVxG.d.ts} +1 -1
  353. package/dist/{index-bAud6rG22.d.ts → index-CU_lnxg7.d.ts} +13 -4
  354. package/dist/index-CiwC1j1N.d.ts +37 -0
  355. package/dist/{index-Bw3M24Mi.d.ts → index-CrQi3QCY.d.ts} +2 -1
  356. package/dist/{index-Vj9ZzRh0.d.ts → index-DNsSKNUe.d.ts} +4 -1
  357. package/dist/{index-D97n4Bpf2.d.ts → index-DWZia2ui.d.ts} +1 -1
  358. package/dist/{index-J1qdw9mL.d.ts → index-DjSGDESy.d.ts} +36 -2
  359. package/dist/{index-_Sl5wohy2.d.ts → index-RP_rt8vB.d.ts} +1 -1
  360. package/dist/{index-Cp0aQngm.d.ts → index-T1sSoiWG.d.ts} +3 -1
  361. package/dist/{index-BlEUcijd.d.ts → index-fsZE0vPs.d.ts} +81 -1
  362. package/dist/index-jNWPjJl9.d.ts +75 -0
  363. package/dist/index.d.ts +36 -30
  364. package/dist/index.js +69 -59
  365. package/dist/{input-group-DpGSsAZy.d.ts → input-group-B3M_WRqm.d.ts} +1 -1
  366. package/dist/locale-provider-CAjVN3_0.d.ts +32 -0
  367. package/dist/{portal-provider-4AHCxYE6.d.ts → portal-provider-BAqPpq_a.d.ts} +4 -0
  368. package/dist/primitives/accordion.js +2 -2
  369. package/dist/primitives/alert-dialog.js +7 -2
  370. package/dist/primitives/autocomplete.js +5 -2
  371. package/dist/primitives/avatar.js +2 -2
  372. package/dist/primitives/button.js +2 -2
  373. package/dist/primitives/checkbox-group.js +3 -2
  374. package/dist/primitives/checkbox.js +3 -2
  375. package/dist/primitives/collapsible.js +4 -2
  376. package/dist/primitives/combobox.js +5 -2
  377. package/dist/primitives/context-menu.js +5 -2
  378. package/dist/primitives/csp-provider.js +1 -1
  379. package/dist/primitives/dialog.js +8 -2
  380. package/dist/primitives/direction-provider.js +2 -2
  381. package/dist/primitives/drawer.js +5 -2
  382. package/dist/primitives/field.js +3 -2
  383. package/dist/primitives/fieldset.js +2 -2
  384. package/dist/primitives/form.js +1 -1
  385. package/dist/primitives/input.js +3 -2
  386. package/dist/primitives/menu.js +5 -2
  387. package/dist/primitives/menubar.js +2 -2
  388. package/dist/primitives/meter.js +1 -1
  389. package/dist/primitives/navigation-menu.js +2 -2
  390. package/dist/primitives/number-field.js +2 -2
  391. package/dist/primitives/otp-field.js +3 -2
  392. package/dist/primitives/popover.js +2 -2
  393. package/dist/primitives/preview-card.js +2 -2
  394. package/dist/primitives/progress.js +2 -2
  395. package/dist/primitives/radio-group.js +3 -2
  396. package/dist/primitives/radio.js +3 -2
  397. package/dist/primitives/scroll-area.js +3 -2
  398. package/dist/primitives/select.js +4 -2
  399. package/dist/primitives/separator.js +3 -2
  400. package/dist/primitives/slider.js +3 -2
  401. package/dist/primitives/switch.js +3 -2
  402. package/dist/primitives/tabs.js +3 -2
  403. package/dist/primitives/toast.js +4 -2
  404. package/dist/primitives/toggle-group.js +2 -2
  405. package/dist/primitives/toggle.js +2 -2
  406. package/dist/primitives/toolbar.js +2 -2
  407. package/dist/primitives/tooltip.js +3 -2
  408. package/dist/primitives.d.ts +2 -2
  409. package/dist/primitives.js +70 -42
  410. package/dist/scripts/theme-generator/config.d.ts +4 -5
  411. package/dist/scripts/theme-generator/types.d.ts +12 -13
  412. package/dist/styles/kumo-standalone.css +1 -1
  413. package/dist/{index-Dzzi1o7w2.d.ts → text-B4l7S5Z0.d.ts} +60 -1
  414. package/dist/{tooltip-BuCo6Ki4.d.ts → tooltip-D_vhi1PN.d.ts} +1 -1
  415. package/dist/{types-C402rKiz.d.ts → types-C6in2C8V.d.ts} +6 -3
  416. package/dist/utils.d.ts +3 -3
  417. package/dist/utils.js +5 -4
  418. package/package.json +27 -6
  419. package/scripts/component-registry/discovery.ts +4 -0
  420. package/scripts/component-registry/metadata.ts +75 -0
  421. package/scripts/generate-globe-land-mask.mjs +80 -0
  422. package/dist/chunks/CheckboxIndicator-igofmpn0wcfdqooa.js +0 -49
  423. package/dist/chunks/CompositeList-tx08unuok7wsl2d9.js +0 -129
  424. package/dist/chunks/DialogHandle-b3froel96o9fwjmm.js +0 -139
  425. package/dist/chunks/DialogRoot-fp7d16uxogvye294.js +0 -15
  426. package/dist/chunks/FieldControl-oz007qbkl6ejp7di.js +0 -104
  427. package/dist/chunks/FieldLabel-f6vwzm8nefzxwlh8.js +0 -558
  428. package/dist/chunks/Form-is7d5c1kbk1wn39s.js +0 -102
  429. package/dist/chunks/MenuBackdrop-dlntmavtopj7wv0l.js +0 -78
  430. package/dist/chunks/areArraysEqual-nlbeaqlzf4274zr3.js +0 -7
  431. package/dist/chunks/clamp-kvu4wtr1dw6b3pnd.js +0 -7
  432. package/dist/chunks/createBaseUIEventDetails-ddivuhl74gni72qn.js +0 -86
  433. package/dist/chunks/empty-ox60d384lkwbj5n4.js +0 -89
  434. package/dist/chunks/error-mm98alb8acdy93vq.js +0 -15
  435. package/dist/chunks/formatNumber-hjijm58g645q6a0n.js +0 -26
  436. package/dist/chunks/getEmptyRootContext-ekvv3rp5w16ewoqx.js +0 -18
  437. package/dist/chunks/index.parts-c5yto0l67i7ok5fd.js +0 -206
  438. package/dist/chunks/index.parts-cpviii2nt413tb8k.js +0 -30
  439. package/dist/chunks/index.parts-gj1k50tf9fcs7nru.js +0 -81
  440. package/dist/chunks/index.parts-gslyp9n88qdh38n1.js +0 -10
  441. package/dist/chunks/index.parts-hve0zir3biaolih0.js +0 -128
  442. package/dist/chunks/index.parts-i4lbjqdnhsnjtny6.js +0 -88
  443. package/dist/chunks/index.parts-ieuelcd4z5e0mcb7.js +0 -73
  444. package/dist/chunks/index.parts-j2ecf25zajyd5ia3.js +0 -11
  445. package/dist/chunks/index.parts-jmb5ztstw4xlfyp9.js +0 -46
  446. package/dist/chunks/index.parts-jv5kiaeixrjah9js.js +0 -119
  447. package/dist/chunks/index.parts-k7ezm98skegahepw.js +0 -2464
  448. package/dist/chunks/index.parts-komdbdvf823cm5jw.js +0 -41
  449. package/dist/chunks/index.parts-lhpuh6pw7rjcddnl.js +0 -156
  450. package/dist/chunks/index.parts-mr7tgwe4pgfozkt5.js +0 -245
  451. package/dist/chunks/index.parts-nc6jzjq91z2nye75.js +0 -11
  452. package/dist/chunks/index.parts-nzwjx603vcq1kryz.js +0 -127
  453. package/dist/chunks/index2.parts-kiwz8e3k8utvm4zb.js +0 -67
  454. package/dist/chunks/index2.parts-mv7x6w0p2splvf6b.js +0 -10
  455. package/dist/chunks/popupStoreUtils-jrxqkz5jmlijlr91.js +0 -367
  456. package/dist/chunks/radio-gvy6ekh5hu9awlru.js +0 -173
  457. package/dist/chunks/store-9b2cp7rx1dvq90fp.js +0 -88
  458. package/dist/chunks/useCompositeListItem-0exfww37ospqz69b.js +0 -75
  459. package/dist/chunks/useDismiss-kbtx2o3ruyh3jwgn.js +0 -353
  460. package/dist/chunks/useFilteredItems-ns32d3hpp626kt73.js +0 -183
  461. package/dist/chunks/useForcedRerendering-el1fbg3ib5yo0v7k.js +0 -14
  462. package/dist/chunks/useId-l9soitgw3e4jk5ie.js +0 -32
  463. package/dist/chunks/useIsHydrating-b6whcsimonagru6u.js +0 -22
  464. package/dist/chunks/useLabelableId-b1kwq9st3rjrtakn.js +0 -60
  465. package/dist/chunks/useRenderDialogRoot-hhowqeoreyr6uuc7.js +0 -262
  466. package/dist/chunks/vendor-styling-da1xibnxfkjmtglr.js +0 -3631
  467. package/dist/chunks/vesper-ho3j3gt6ilwfuc1g.js +0 -5
  468. package/dist/cn-DCSItmT-.d.ts +0 -5
  469. /package/dist/{index-AMEc1MEg2.d.ts → index-AMEc1MEg.d.ts} +0 -0
  470. /package/dist/{index-D2Gvly0i2.d.ts → index-D2Gvly0i.d.ts} +0 -0
  471. /package/dist/{index-DIV3riUd2.d.ts → index-DIV3riUd.d.ts} +0 -0
  472. /package/dist/{index-FCkuxSvs2.d.ts → index-FCkuxSvs.d.ts} +0 -0
@@ -0,0 +1,1532 @@
1
+ "use client";
2
+ import { t as __exportAll } from "./rolldown-runtime-hi7ti5xiuxsegr96.js";
3
+ import { c as NOOP, i as mergeProps, n as useRenderElement, s as EMPTY_OBJECT } from "./useRenderElement-nkklxbq1rp7h2kw0.js";
4
+ import { c as BASE_UI_SWIPE_IGNORE_ATTRIBUTE, l as BASE_UI_SWIPE_IGNORE_SELECTOR } from "./FloatingRootStore-men6ufp3a2b296fh.js";
5
+ import { n as useIsoLayoutEffect, t as SafeReact } from "./safeReact-ek77ilng4ekk7mgz.js";
6
+ import { $ as getTarget, A as popupTransitionStateMapping, L as closed$1, Q as contains, R as endingStyle$1, U as endingStyle$2, V as startingStyle$1, X as activeElement, Z as closest, st as android, v as ownerDocument, z as open$1 } from "./vendor-utils-io8z5lsfxq8m2dcc.js";
7
+ import { T as isElement, w as getWindow } from "./vendor-floating-ui-fqblx3wa0r71mjoo.js";
8
+ import { t as createChangeEventDetails } from "./createBaseUIEventDetails-nvee6bghv2reeqdb.js";
9
+ import { A as swipe, a as closeWatcher } from "./reason-parts-hssx64rmlxyn6gw5.js";
10
+ import { t as addEventListener } from "./addEventListener-ku3x23446prmd1kz.js";
11
+ import { t as useStableCallback } from "./useStableCallback-le5qgj6p9l04729n.js";
12
+ import { n as useAnimationFrame } from "./useAnimationFrame-k9lqdj9quln3sd85.js";
13
+ import { t as FOCUSABLE_POPUP_PROPS } from "./popupStoreUtils-czfnxn051xakask5.js";
14
+ import { o as FloatingFocusManager } from "./useScrollLock-le7ajwlt7oh6fzxi.js";
15
+ import { t as useOpenChangeComplete } from "./useOpenChangeComplete-edtabjwqmechsyv6.js";
16
+ import { t as error } from "./error-lbnic2b20qr3mukp.js";
17
+ import { t as useControlled } from "./useControlled-i3srnkxy598s0au9.js";
18
+ import { t as clamp } from "./clamp-rcpupxvhqrn8uuyf.js";
19
+ import { n as findScrollableTouchTarget } from "./scrollable-k784b35i80aolmvg.js";
20
+ import { n as useSwipeDismiss, r as getElementAtPoint, t as getDisplacement } from "./useSwipeDismiss-e8tfxzlp05p86mgb.js";
21
+ import { a as COMPOSITE_KEYS } from "./composite-c11t1ok72s3cggjc.js";
22
+ import { o as useDialogPortalContext, r as DialogPortal, s as useDialogRootContext, t as useRenderDialogRoot } from "./useRenderDialogRoot-bsqrqpc1ddau7xg4.js";
23
+ import { i as DialogClose, n as DialogTitle, r as DialogDescription, t as DialogTrigger } from "./DialogTrigger-kpugfkbfswqrus4u.js";
24
+ import { n as nestedDialogOpen, r as DialogViewport } from "./DialogViewportDataAttributes-mma9emv1edsc1vuy.js";
25
+ import * as React$1 from "react";
26
+ import { jsx, jsxs } from "react/jsx-runtime";
27
+ import * as ReactDOM from "react-dom";
28
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/drawer/popup/DrawerPopupCssVars.mjs
29
+ var DrawerPopupCssVars_exports = /* @__PURE__ */ __exportAll({
30
+ frontmostHeight: () => frontmostHeight,
31
+ height: () => height,
32
+ nestedDrawers: () => nestedDrawers,
33
+ snapPointOffset: () => snapPointOffset,
34
+ swipeMovementX: () => swipeMovementX,
35
+ swipeMovementY: () => swipeMovementY,
36
+ swipeStrength: () => swipeStrength
37
+ });
38
+ /**
39
+ * The number of nested drawers that are currently open.
40
+ * @type {number}
41
+ */
42
+ const nestedDrawers = "--nested-drawers";
43
+ /**
44
+ * The height of the drawer popup.
45
+ * @type {CSS length}
46
+ */
47
+ const height = "--drawer-height";
48
+ /**
49
+ * The height of the frontmost open drawer in the current nested drawer stack.
50
+ * @type {CSS length}
51
+ */
52
+ const frontmostHeight = "--drawer-frontmost-height";
53
+ /**
54
+ * The swipe movement on the X axis.
55
+ * @type {CSS length}
56
+ */
57
+ const swipeMovementX = "--drawer-swipe-movement-x";
58
+ /**
59
+ * The swipe movement on the Y axis.
60
+ * @type {CSS length}
61
+ */
62
+ const swipeMovementY = "--drawer-swipe-movement-y";
63
+ /**
64
+ * The snap point offset used for translating the drawer.
65
+ * @type {CSS length}
66
+ */
67
+ const snapPointOffset = "--drawer-snap-point-offset";
68
+ /**
69
+ * A scalar (0.1-1) used to scale the swipe release transition duration in CSS.
70
+ * @type {number}
71
+ */
72
+ const swipeStrength = "--drawer-swipe-strength";
73
+ //#endregion
74
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/drawer/backdrop/DrawerBackdropCssVars.mjs
75
+ var DrawerBackdropCssVars_exports = /* @__PURE__ */ __exportAll({ swipeProgress: () => swipeProgress });
76
+ /**
77
+ * The swipe progress of the drawer gesture.
78
+ * @type {number}
79
+ */
80
+ const swipeProgress = "--drawer-swipe-progress";
81
+ //#endregion
82
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/drawer/backdrop/DrawerBackdrop.mjs
83
+ /**
84
+ * An overlay displayed beneath the popup.
85
+ * Renders a `<div>` element.
86
+ *
87
+ * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)
88
+ */
89
+ const DrawerBackdrop = /*#__PURE__*/ React$1.forwardRef(function DrawerBackdrop(componentProps, forwardedRef) {
90
+ const { render, className, style, forceRender = false, ...elementProps } = componentProps;
91
+ const store = useDialogRootContext();
92
+ const open = store.useState("open");
93
+ const nested = store.useState("nested");
94
+ const mounted = store.useState("mounted");
95
+ const state = {
96
+ open,
97
+ transitionStatus: store.useState("transitionStatus")
98
+ };
99
+ return useRenderElement("div", componentProps, {
100
+ state,
101
+ ref: [store.context.backdropRef, forwardedRef],
102
+ stateAttributesMapping: popupTransitionStateMapping,
103
+ props: [{
104
+ role: "presentation",
105
+ hidden: !mounted,
106
+ style: {
107
+ pointerEvents: !open ? "none" : void 0,
108
+ userSelect: "none",
109
+ WebkitUserSelect: "none",
110
+ [swipeProgress]: "0",
111
+ [swipeStrength]: "1"
112
+ }
113
+ }, elementProps],
114
+ enabled: forceRender || !nested
115
+ });
116
+ });
117
+ DrawerBackdrop.displayName = "DrawerBackdrop";
118
+ //#endregion
119
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/drawer/close/DrawerClose.mjs
120
+ /**
121
+ * A button that closes the drawer.
122
+ * Renders a `<button>` element.
123
+ *
124
+ * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)
125
+ */
126
+ const DrawerClose = DialogClose;
127
+ //#endregion
128
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/drawer/content/drawerContentAttribute.mjs
129
+ const DRAWER_CONTENT_ATTRIBUTE = "data-drawer-content";
130
+ //#endregion
131
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/drawer/content/DrawerContent.mjs
132
+ /**
133
+ * A container for the drawer contents.
134
+ * Renders a `<div>` element.
135
+ *
136
+ * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)
137
+ */
138
+ const DrawerContent = /*#__PURE__*/ React$1.forwardRef(function DrawerContent(componentProps, forwardedRef) {
139
+ const { render, className, style, ...elementProps } = componentProps;
140
+ useDialogRootContext();
141
+ return useRenderElement("div", componentProps, {
142
+ ref: forwardedRef,
143
+ props: [{ [DRAWER_CONTENT_ATTRIBUTE]: "" }, elementProps]
144
+ });
145
+ });
146
+ DrawerContent.displayName = "DrawerContent";
147
+ //#endregion
148
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/drawer/description/DrawerDescription.mjs
149
+ /**
150
+ * A paragraph with additional information about the drawer.
151
+ * Renders a `<p>` element.
152
+ *
153
+ * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)
154
+ */
155
+ const DrawerDescription = DialogDescription;
156
+ //#endregion
157
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/drawer/provider/DrawerProviderContext.mjs
158
+ const DrawerProviderContext = /*#__PURE__*/ React$1.createContext(void 0);
159
+ DrawerProviderContext.displayName = "DrawerProviderContext";
160
+ function useDrawerProviderContext() {
161
+ return React$1.useContext(DrawerProviderContext);
162
+ }
163
+ //#endregion
164
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/drawer/popup/DrawerPopupDataAttributes.mjs
165
+ var DrawerPopupDataAttributes_exports = /* @__PURE__ */ __exportAll({
166
+ closed: () => closed,
167
+ endingStyle: () => endingStyle,
168
+ expanded: () => expanded,
169
+ nestedDrawerOpen: () => nestedDrawerOpen,
170
+ nestedDrawerSwiping: () => nestedDrawerSwiping,
171
+ open: () => open,
172
+ startingStyle: () => startingStyle,
173
+ swipeDirection: () => swipeDirection,
174
+ swipeDismiss: () => swipeDismiss,
175
+ swiping: () => swiping
176
+ });
177
+ /**
178
+ * Present when the drawer is open.
179
+ */
180
+ const open = open$1;
181
+ /**
182
+ * Present when the drawer is closed.
183
+ */
184
+ const closed = closed$1;
185
+ /**
186
+ * Present when the drawer begins animating in.
187
+ */
188
+ const startingStyle = startingStyle$1;
189
+ /**
190
+ * Present when the drawer is animating out.
191
+ */
192
+ const endingStyle = endingStyle$1;
193
+ /**
194
+ * Present when the drawer is at the expanded (full-height) snap point.
195
+ */
196
+ const expanded = "data-expanded";
197
+ /**
198
+ * Present when a nested drawer is open.
199
+ */
200
+ const nestedDrawerOpen = "data-nested-drawer-open";
201
+ /**
202
+ * Present when a nested drawer is being swiped.
203
+ */
204
+ const nestedDrawerSwiping = "data-nested-drawer-swiping";
205
+ /**
206
+ * Present when the drawer is dismissed by swiping.
207
+ */
208
+ const swipeDismiss = "data-swipe-dismiss";
209
+ /**
210
+ * Indicates the swipe direction.
211
+ * @type {'up' | 'down' | 'left' | 'right'}
212
+ */
213
+ const swipeDirection = "data-swipe-direction";
214
+ /**
215
+ * Present when the drawer is being swiped.
216
+ */
217
+ const swiping = "data-swiping";
218
+ //#endregion
219
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/drawer/root/DrawerRootContext.mjs
220
+ const DrawerRootContext = /*#__PURE__*/ React$1.createContext(void 0);
221
+ DrawerRootContext.displayName = "DrawerRootContext";
222
+ function useDrawerRootContext(optional) {
223
+ const drawerRootContext = React$1.useContext(DrawerRootContext);
224
+ if (optional !== true && drawerRootContext === void 0) throw new Error("Base UI: DrawerRootContext is missing. Drawer parts must be placed within <Drawer.Root>.");
225
+ return drawerRootContext;
226
+ }
227
+ //#endregion
228
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/drawer/root/useDrawerSnapPoints.mjs
229
+ /**
230
+ * Resolves the vertical swipe movement for a snap point, applying square-root damping once the drag
231
+ * overshoots the fully-open edge (`nextOffset < 0`) so the popup resists travelling past it.
232
+ */
233
+ function getSnapPointSwipeMovement(baseOffset, movementValue) {
234
+ const nextOffset = baseOffset + movementValue;
235
+ if (nextOffset >= 0) return movementValue;
236
+ return -Math.sqrt(-nextOffset) - baseOffset;
237
+ }
238
+ function resolveSnapPointValue(snapPoint, viewportHeight, rootFontSize) {
239
+ if (!Number.isFinite(viewportHeight) || viewportHeight <= 0) return null;
240
+ if (typeof snapPoint === "number") {
241
+ if (!Number.isFinite(snapPoint)) return null;
242
+ if (snapPoint <= 1) return clamp(snapPoint, 0, 1) * viewportHeight;
243
+ return snapPoint;
244
+ }
245
+ const trimmed = snapPoint.trim();
246
+ if (trimmed.endsWith("px")) {
247
+ const value = Number.parseFloat(trimmed);
248
+ return Number.isFinite(value) ? value : null;
249
+ }
250
+ if (trimmed.endsWith("rem")) {
251
+ const value = Number.parseFloat(trimmed);
252
+ return Number.isFinite(value) ? value * rootFontSize : null;
253
+ }
254
+ return null;
255
+ }
256
+ /**
257
+ * Returns the index of the value closest to `target`, or `-1` if `values` is empty.
258
+ */
259
+ function closestSnapPointIndex(values, target) {
260
+ let closestIndex = -1;
261
+ let closestDistance = Infinity;
262
+ for (let index = 0; index < values.length; index += 1) {
263
+ const distance = Math.abs(values[index] - target);
264
+ if (distance < closestDistance) {
265
+ closestDistance = distance;
266
+ closestIndex = index;
267
+ }
268
+ }
269
+ return closestIndex;
270
+ }
271
+ function useDrawerSnapPoints() {
272
+ const store = useDialogRootContext();
273
+ const { snapPoints, activeSnapPoint, setActiveSnapPoint, popupHeight } = useDrawerRootContext();
274
+ const viewportElement = store.useState("viewportElement");
275
+ const [viewportHeight, setViewportHeight] = React$1.useState(0);
276
+ const [rootFontSize, setRootFontSize] = React$1.useState(16);
277
+ const measureViewportHeight = useStableCallback(() => {
278
+ const html = ownerDocument(viewportElement).documentElement;
279
+ setViewportHeight(viewportElement ? viewportElement.offsetHeight : html.clientHeight);
280
+ const fontSize = parseFloat(getComputedStyle(html).fontSize);
281
+ if (Number.isFinite(fontSize)) setRootFontSize(fontSize);
282
+ });
283
+ useIsoLayoutEffect(() => {
284
+ measureViewportHeight();
285
+ if (!viewportElement || typeof ResizeObserver !== "function") return;
286
+ const resizeObserver = new ResizeObserver(measureViewportHeight);
287
+ resizeObserver.observe(viewportElement);
288
+ return () => {
289
+ resizeObserver.disconnect();
290
+ };
291
+ }, [measureViewportHeight, viewportElement]);
292
+ const resolvedSnapPoints = React$1.useMemo(() => {
293
+ if (!snapPoints || snapPoints.length === 0 || viewportHeight <= 0 || popupHeight <= 0) return [];
294
+ const maxHeight = Math.min(popupHeight, viewportHeight);
295
+ const resolved = snapPoints.map((value) => {
296
+ const resolvedHeight = resolveSnapPointValue(value, viewportHeight, rootFontSize);
297
+ if (resolvedHeight === null) return null;
298
+ const clampedHeight = clamp(resolvedHeight, 0, maxHeight);
299
+ return {
300
+ value,
301
+ height: clampedHeight,
302
+ offset: Math.max(0, popupHeight - clampedHeight)
303
+ };
304
+ }).filter((point) => Boolean(point));
305
+ if (resolved.length <= 1) return resolved;
306
+ const deduped = [];
307
+ const seenHeights = [];
308
+ for (let index = resolved.length - 1; index >= 0; index -= 1) {
309
+ const point = resolved[index];
310
+ if (seenHeights.some((height) => Math.abs(height - point.height) <= 1)) continue;
311
+ seenHeights.push(point.height);
312
+ deduped.push(point);
313
+ }
314
+ deduped.reverse();
315
+ return deduped;
316
+ }, [
317
+ popupHeight,
318
+ rootFontSize,
319
+ snapPoints,
320
+ viewportHeight
321
+ ]);
322
+ return {
323
+ snapPoints,
324
+ activeSnapPoint,
325
+ setActiveSnapPoint,
326
+ popupHeight,
327
+ viewportHeight,
328
+ resolvedSnapPoints,
329
+ activeSnapPointOffset: React$1.useMemo(() => {
330
+ if (activeSnapPoint === null) return;
331
+ const exactMatch = resolvedSnapPoints.find((point) => Object.is(point.value, activeSnapPoint));
332
+ if (exactMatch) return exactMatch;
333
+ const maxHeight = Math.min(popupHeight, viewportHeight);
334
+ const resolvedHeight = resolveSnapPointValue(activeSnapPoint, viewportHeight, rootFontSize);
335
+ if (resolvedHeight === null) return;
336
+ const clampedHeight = clamp(resolvedHeight, 0, maxHeight);
337
+ return resolvedSnapPoints[closestSnapPointIndex(resolvedSnapPoints.map((point) => point.height), clampedHeight)];
338
+ }, [
339
+ activeSnapPoint,
340
+ popupHeight,
341
+ resolvedSnapPoints,
342
+ rootFontSize,
343
+ viewportHeight
344
+ ])?.offset ?? null
345
+ };
346
+ }
347
+ //#endregion
348
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/drawer/viewport/DrawerViewportContext.mjs
349
+ const DrawerViewportContext = /*#__PURE__*/ React$1.createContext(null);
350
+ DrawerViewportContext.displayName = "DrawerViewportContext";
351
+ function useDrawerViewportContext() {
352
+ return React$1.useContext(DrawerViewportContext);
353
+ }
354
+ //#endregion
355
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/drawer/popup/DrawerPopup.mjs
356
+ let drawerSwipeVarsRegistered = false;
357
+ /**
358
+ * Removes inheritance of high-frequency drawer swipe CSS variables, which
359
+ * reduces style recalculation cost in complex drawers with deep subtrees.
360
+ * See https://motion.dev/blog/web-animation-performance-tier-list
361
+ * under the "Improving CSS variable performance" section.
362
+ */
363
+ function removeCSSVariableInheritance() {
364
+ if (drawerSwipeVarsRegistered) return;
365
+ if (typeof CSS !== "undefined" && "registerProperty" in CSS) {
366
+ [
367
+ swipeMovementX,
368
+ swipeMovementY,
369
+ snapPointOffset
370
+ ].forEach((name) => {
371
+ try {
372
+ CSS.registerProperty({
373
+ name,
374
+ syntax: "<length>",
375
+ inherits: false,
376
+ initialValue: "0px"
377
+ });
378
+ } catch {}
379
+ });
380
+ [{
381
+ name: swipeProgress,
382
+ initialValue: "0"
383
+ }, {
384
+ name: swipeStrength,
385
+ initialValue: "1"
386
+ }].forEach(({ name, initialValue }) => {
387
+ try {
388
+ CSS.registerProperty({
389
+ name,
390
+ syntax: "<number>",
391
+ inherits: false,
392
+ initialValue
393
+ });
394
+ } catch {}
395
+ });
396
+ }
397
+ drawerSwipeVarsRegistered = true;
398
+ }
399
+ const stateAttributesMapping = {
400
+ ...popupTransitionStateMapping,
401
+ expanded(value) {
402
+ return value ? { [expanded]: "" } : null;
403
+ },
404
+ nestedDrawerOpen(value) {
405
+ return value ? { [nestedDrawerOpen]: "" } : null;
406
+ },
407
+ nestedDrawerSwiping(value) {
408
+ return value ? { [nestedDrawerSwiping]: "" } : null;
409
+ },
410
+ swipeDirection(value) {
411
+ return { [swipeDirection]: value };
412
+ },
413
+ swiping(value) {
414
+ return value ? { [swiping]: "" } : null;
415
+ }
416
+ };
417
+ /**
418
+ * A container for the drawer contents.
419
+ * Renders a `<div>` element.
420
+ *
421
+ * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)
422
+ */
423
+ const DrawerPopup = /*#__PURE__*/ React$1.forwardRef(function DrawerPopup(componentProps, forwardedRef) {
424
+ const { render, className, style, finalFocus, initialFocus, ...elementProps } = componentProps;
425
+ const store = useDialogRootContext();
426
+ const popupRef = store.context.popupRef;
427
+ const { swipeDirection, frontmostHeight: frontmostHeight$1, hasNestedDrawer, nestedSwiping, nestedSwipeProgressStore, onPopupHeightChange, notifyParentFrontmostHeight, notifyParentHasNestedDrawer } = useDrawerRootContext();
428
+ const descriptionElementId = store.useState("descriptionElementId");
429
+ const disablePointerDismissal = store.useState("disablePointerDismissal");
430
+ const floatingRootContext = store.useState("floatingRootContext");
431
+ const rootPopupProps = store.useState("popupProps");
432
+ const modal = store.useState("modal");
433
+ const mounted = store.useState("mounted");
434
+ const nested = store.useState("nested");
435
+ const nestedOpenDrawerCount = store.useState("nestedOpenDrawerCount");
436
+ const transitionStatus = store.useState("transitionStatus");
437
+ const open = store.useState("open");
438
+ const openMethod = store.useState("openMethod");
439
+ const titleElementId = store.useState("titleElementId");
440
+ const role = store.useState("role");
441
+ const floatingId = floatingRootContext.useState("floatingId");
442
+ const popupId = elementProps.id ?? floatingId;
443
+ const swipe = useDrawerViewportContext();
444
+ useDialogPortalContext();
445
+ const { snapPoints, activeSnapPoint, activeSnapPointOffset } = useDrawerSnapPoints();
446
+ const nestedDrawerOpen = nestedOpenDrawerCount > 0;
447
+ const swiping = swipe?.swiping ?? false;
448
+ const swipeStrength$1 = swipe?.swipeStrength ?? null;
449
+ const [popupHeight, setPopupHeight] = React$1.useState(0);
450
+ const popupHeightRef = React$1.useRef(0);
451
+ React$1.useEffect(() => {
452
+ if (swipe) return;
453
+ const ownerStackMessage = SafeReact.captureOwnerStack?.() || "";
454
+ error(`<Drawer.Popup> expected to be rendered within <Drawer.Viewport>. Omitting the viewport disables drawer swipe handling and touch scroll locking. Wrap <Drawer.Popup> in <Drawer.Viewport>.${ownerStackMessage}`);
455
+ }, [swipe]);
456
+ const measureHeight = useStableCallback(() => {
457
+ const popupElement = popupRef.current;
458
+ if (!popupElement) return;
459
+ const offsetHeight = popupElement.offsetHeight;
460
+ if (popupHeightRef.current > 0 && frontmostHeight$1 > popupHeightRef.current && offsetHeight > popupHeightRef.current) return;
461
+ if (popupHeightRef.current > 0 && hasNestedDrawer) {
462
+ const oldHeight = popupHeightRef.current;
463
+ setPopupHeight(oldHeight);
464
+ onPopupHeightChange(oldHeight);
465
+ return;
466
+ }
467
+ const nextHeight = offsetHeight;
468
+ if (nextHeight === popupHeightRef.current) return;
469
+ popupHeightRef.current = nextHeight;
470
+ setPopupHeight(nextHeight);
471
+ onPopupHeightChange(nextHeight);
472
+ });
473
+ useIsoLayoutEffect(() => {
474
+ if (!mounted) {
475
+ popupHeightRef.current = 0;
476
+ setPopupHeight(0);
477
+ onPopupHeightChange(0);
478
+ return;
479
+ }
480
+ const popupElement = popupRef.current;
481
+ if (!popupElement) return;
482
+ removeCSSVariableInheritance();
483
+ measureHeight();
484
+ if (typeof ResizeObserver !== "function") return;
485
+ const resizeObserver = new ResizeObserver(measureHeight);
486
+ resizeObserver.observe(popupElement);
487
+ return () => {
488
+ resizeObserver.disconnect();
489
+ };
490
+ }, [
491
+ measureHeight,
492
+ mounted,
493
+ nestedDrawerOpen,
494
+ onPopupHeightChange,
495
+ popupRef
496
+ ]);
497
+ useIsoLayoutEffect(() => {
498
+ const syncNestedSwipeProgress = () => {
499
+ const popupElement = popupRef.current;
500
+ if (!popupElement) return;
501
+ const progress = nestedSwipeProgressStore.getSnapshot();
502
+ if (progress > 0) popupElement.style.setProperty(swipeProgress, `${progress}`);
503
+ else popupElement.style.setProperty(swipeProgress, "0");
504
+ };
505
+ syncNestedSwipeProgress();
506
+ const unsubscribe = nestedSwipeProgressStore.subscribe(syncNestedSwipeProgress);
507
+ const popupElement = popupRef.current;
508
+ return () => {
509
+ unsubscribe();
510
+ if (popupElement) popupElement.style.setProperty(swipeProgress, "0");
511
+ };
512
+ }, [nestedSwipeProgressStore, popupRef]);
513
+ useIsoLayoutEffect(() => {
514
+ if (!open) return;
515
+ notifyParentFrontmostHeight?.(frontmostHeight$1);
516
+ return () => {
517
+ notifyParentFrontmostHeight?.(0);
518
+ };
519
+ }, [
520
+ frontmostHeight$1,
521
+ open,
522
+ notifyParentFrontmostHeight
523
+ ]);
524
+ useIsoLayoutEffect(() => {
525
+ if (!notifyParentHasNestedDrawer) return;
526
+ notifyParentHasNestedDrawer(open || transitionStatus === "ending");
527
+ return () => {
528
+ notifyParentHasNestedDrawer(false);
529
+ };
530
+ }, [
531
+ notifyParentHasNestedDrawer,
532
+ open,
533
+ transitionStatus
534
+ ]);
535
+ useOpenChangeComplete({
536
+ open,
537
+ ref: popupRef,
538
+ onComplete() {
539
+ if (open) store.context.onOpenChangeComplete?.(true);
540
+ }
541
+ });
542
+ const resolvedInitialFocus = initialFocus === void 0 ? popupRef : initialFocus;
543
+ const setPopupElement = store.useStateSetter("popupElement");
544
+ const state = {
545
+ open,
546
+ nested,
547
+ transitionStatus,
548
+ expanded: activeSnapPoint === 1,
549
+ nestedDrawerOpen,
550
+ nestedDrawerSwiping: nestedSwiping,
551
+ swipeDirection,
552
+ swiping
553
+ };
554
+ let popupHeightCssVarValue;
555
+ if (popupHeight && !(!hasNestedDrawer && transitionStatus !== "ending")) popupHeightCssVarValue = `${popupHeight}px`;
556
+ const shouldApplySnapPoints = snapPoints && snapPoints.length > 0 && (swipeDirection === "down" || swipeDirection === "up");
557
+ let snapPointOffsetValue = null;
558
+ if (shouldApplySnapPoints && activeSnapPointOffset !== null) snapPointOffsetValue = swipeDirection === "up" ? -activeSnapPointOffset : activeSnapPointOffset;
559
+ let dragStyles = swipe ? swipe.getDragStyles() : EMPTY_OBJECT;
560
+ if (shouldApplySnapPoints && swipeDirection === "down") {
561
+ const baseOffset = activeSnapPointOffset ?? 0;
562
+ const movementValue = Number.parseFloat(String(dragStyles[swipeMovementY]));
563
+ if (swiping && Number.isFinite(movementValue)) dragStyles = {
564
+ ...dragStyles,
565
+ transform: void 0,
566
+ [swipeMovementY]: `${getSnapPointSwipeMovement(baseOffset, movementValue)}px`
567
+ };
568
+ else dragStyles = {
569
+ ...dragStyles,
570
+ transform: void 0
571
+ };
572
+ }
573
+ const element = useRenderElement("div", componentProps, {
574
+ state,
575
+ props: [
576
+ rootPopupProps,
577
+ {
578
+ id: popupId,
579
+ "aria-labelledby": titleElementId,
580
+ "aria-describedby": descriptionElementId,
581
+ role,
582
+ ...FOCUSABLE_POPUP_PROPS,
583
+ hidden: !mounted,
584
+ onKeyDown(event) {
585
+ if (COMPOSITE_KEYS.has(event.key)) event.stopPropagation();
586
+ },
587
+ style: {
588
+ ...dragStyles,
589
+ [swipeProgress]: "0",
590
+ [nestedDrawers]: nestedOpenDrawerCount,
591
+ [height]: popupHeightCssVarValue,
592
+ [snapPointOffset]: typeof snapPointOffsetValue === "number" ? `${snapPointOffsetValue}px` : "0px",
593
+ [frontmostHeight]: frontmostHeight$1 ? `${frontmostHeight$1}px` : void 0,
594
+ [swipeStrength]: typeof swipeStrength$1 === "number" && Number.isFinite(swipeStrength$1) && swipeStrength$1 > 0 ? `${swipeStrength$1}` : "1"
595
+ }
596
+ },
597
+ elementProps
598
+ ],
599
+ ref: [
600
+ forwardedRef,
601
+ popupRef,
602
+ setPopupElement
603
+ ],
604
+ stateAttributesMapping
605
+ });
606
+ return /*#__PURE__*/ jsx(FloatingFocusManager, {
607
+ context: floatingRootContext,
608
+ openInteractionType: openMethod,
609
+ disabled: !mounted,
610
+ closeOnFocusOut: !disablePointerDismissal,
611
+ initialFocus: resolvedInitialFocus,
612
+ returnFocus: finalFocus,
613
+ modal: modal !== false,
614
+ restoreFocus: "popup",
615
+ children: element
616
+ });
617
+ });
618
+ DrawerPopup.displayName = "DrawerPopup";
619
+ //#endregion
620
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/drawer/portal/DrawerPortal.mjs
621
+ /**
622
+ * A portal element that moves the popup to a different part of the DOM.
623
+ * By default, the portal element is appended to `<body>`.
624
+ * Renders a `<div>` element.
625
+ *
626
+ * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)
627
+ */
628
+ const DrawerPortal = DialogPortal;
629
+ //#endregion
630
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/drawer/root/DrawerRoot.mjs
631
+ var _DrawerProviderReport;
632
+ var _DrawerProviderReport2;
633
+ /**
634
+ * Groups all parts of the drawer.
635
+ * Doesn't render its own HTML element.
636
+ *
637
+ * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)
638
+ */
639
+ function DrawerRoot(props) {
640
+ const { children, open: openProp, defaultOpen = false, onOpenChange, onOpenChangeComplete, disablePointerDismissal = false, modal = true, actionsRef, handle, triggerId: triggerIdProp, defaultTriggerId: defaultTriggerIdProp = null, swipeDirection = "down", snapToSequentialPoints = false, snapPoints, snapPoint: snapPointProp, defaultSnapPoint, onSnapPointChange } = props;
641
+ const parentDrawerRootContext = useDrawerRootContext(true);
642
+ const notifyParentSwipeProgressChange = parentDrawerRootContext?.onNestedSwipeProgressChange;
643
+ const notifyParentFrontmostHeight = parentDrawerRootContext?.onNestedFrontmostHeightChange;
644
+ const notifyParentSwipingChange = parentDrawerRootContext?.onNestedSwipingChange;
645
+ const notifyParentHasNestedDrawer = parentDrawerRootContext?.onNestedDrawerPresenceChange;
646
+ const [popupHeight, setPopupHeight] = React$1.useState(0);
647
+ const [frontmostHeight, setFrontmostHeight] = React$1.useState(0);
648
+ const [hasNestedDrawer, setHasNestedDrawer] = React$1.useState(false);
649
+ const [nestedSwiping, setNestedSwiping] = React$1.useState(false);
650
+ const [nestedSwipeProgressStore] = React$1.useState(createNestedSwipeProgressStore);
651
+ const resolvedDefaultSnapPoint = defaultSnapPoint !== void 0 ? defaultSnapPoint : snapPoints?.[0] ?? null;
652
+ const isSnapPointControlled = snapPointProp !== void 0;
653
+ const [activeSnapPoint, setActiveSnapPointUnwrapped] = useControlled({
654
+ controlled: snapPointProp,
655
+ default: resolvedDefaultSnapPoint,
656
+ name: "Drawer",
657
+ state: "snapPoint"
658
+ });
659
+ const isNestedDrawerOpenRef = React$1.useRef(false);
660
+ const swipeAreaActiveRef = React$1.useRef(false);
661
+ const setActiveSnapPoint = useStableCallback((nextSnapPoint, eventDetails) => {
662
+ const resolvedEventDetails = eventDetails ?? createChangeEventDetails("none");
663
+ onSnapPointChange?.(nextSnapPoint, resolvedEventDetails);
664
+ if (resolvedEventDetails.isCanceled) return;
665
+ setActiveSnapPointUnwrapped(nextSnapPoint);
666
+ });
667
+ const resolvedActiveSnapPoint = React$1.useMemo(() => {
668
+ if (isSnapPointControlled) return activeSnapPoint;
669
+ if (!snapPoints || snapPoints.length === 0) return activeSnapPoint;
670
+ if (activeSnapPoint === null || !snapPoints.some((snapPoint) => Object.is(snapPoint, activeSnapPoint))) return resolvedDefaultSnapPoint;
671
+ return activeSnapPoint;
672
+ }, [
673
+ activeSnapPoint,
674
+ isSnapPointControlled,
675
+ resolvedDefaultSnapPoint,
676
+ snapPoints
677
+ ]);
678
+ const onPopupHeightChange = useStableCallback((height) => {
679
+ setPopupHeight(height);
680
+ if (!isNestedDrawerOpenRef.current && height > 0) setFrontmostHeight(height);
681
+ });
682
+ const onNestedFrontmostHeightChange = useStableCallback((height) => {
683
+ if (height > 0) {
684
+ isNestedDrawerOpenRef.current = true;
685
+ setFrontmostHeight(height);
686
+ return;
687
+ }
688
+ isNestedDrawerOpenRef.current = false;
689
+ if (popupHeight > 0) setFrontmostHeight(popupHeight);
690
+ });
691
+ const onNestedDrawerPresenceChange = useStableCallback((present) => {
692
+ setHasNestedDrawer(present);
693
+ });
694
+ const onNestedSwipeProgressChange = useStableCallback((progress) => {
695
+ nestedSwipeProgressStore.set(progress);
696
+ notifyParentSwipeProgressChange?.(progress);
697
+ });
698
+ const onNestedSwipingChange = useStableCallback((swiping) => {
699
+ setNestedSwiping(swiping);
700
+ notifyParentSwipingChange?.(swiping);
701
+ });
702
+ const handleOpenChange = useStableCallback((nextOpen, eventDetails) => {
703
+ onOpenChange?.(nextOpen, eventDetails);
704
+ if (eventDetails.isCanceled) return;
705
+ if (!nextOpen && snapPoints && snapPoints.length > 0) setActiveSnapPoint(resolvedDefaultSnapPoint, createChangeEventDetails(eventDetails.reason, eventDetails.event, eventDetails.trigger));
706
+ });
707
+ const contextValue = React$1.useMemo(() => ({
708
+ swipeDirection,
709
+ swipeAreaActiveRef,
710
+ snapToSequentialPoints,
711
+ snapPoints,
712
+ activeSnapPoint: resolvedActiveSnapPoint,
713
+ setActiveSnapPoint,
714
+ frontmostHeight,
715
+ popupHeight,
716
+ hasNestedDrawer,
717
+ nestedSwiping,
718
+ nestedSwipeProgressStore,
719
+ onNestedDrawerPresenceChange,
720
+ onPopupHeightChange,
721
+ onNestedFrontmostHeightChange,
722
+ onNestedSwipingChange,
723
+ onNestedSwipeProgressChange,
724
+ notifyParentFrontmostHeight,
725
+ notifyParentSwipingChange,
726
+ notifyParentSwipeProgressChange,
727
+ notifyParentHasNestedDrawer
728
+ }), [
729
+ resolvedActiveSnapPoint,
730
+ frontmostHeight,
731
+ hasNestedDrawer,
732
+ nestedSwiping,
733
+ nestedSwipeProgressStore,
734
+ notifyParentHasNestedDrawer,
735
+ notifyParentSwipeProgressChange,
736
+ notifyParentSwipingChange,
737
+ notifyParentFrontmostHeight,
738
+ onNestedDrawerPresenceChange,
739
+ onNestedFrontmostHeightChange,
740
+ onNestedSwipeProgressChange,
741
+ onNestedSwipingChange,
742
+ onPopupHeightChange,
743
+ popupHeight,
744
+ setActiveSnapPoint,
745
+ snapPoints,
746
+ snapToSequentialPoints,
747
+ swipeAreaActiveRef,
748
+ swipeDirection
749
+ ]);
750
+ const resolvedChildren = typeof children === "function" ? (payload) => /*#__PURE__*/ jsxs(React$1.Fragment, { children: [_DrawerProviderReport || (_DrawerProviderReport = /*#__PURE__*/ jsx(DrawerProviderReporter, {})), children(payload)] }) : /*#__PURE__*/ jsxs(React$1.Fragment, { children: [_DrawerProviderReport2 || (_DrawerProviderReport2 = /*#__PURE__*/ jsx(DrawerProviderReporter, {})), children] });
751
+ const dialog = useRenderDialogRoot("drawer", {
752
+ open: openProp,
753
+ defaultOpen,
754
+ onOpenChange: handleOpenChange,
755
+ onOpenChangeComplete,
756
+ disablePointerDismissal,
757
+ modal,
758
+ actionsRef,
759
+ handle,
760
+ triggerId: triggerIdProp,
761
+ defaultTriggerId: defaultTriggerIdProp,
762
+ children: resolvedChildren
763
+ });
764
+ return /*#__PURE__*/ jsx(DrawerRootContext.Provider, {
765
+ value: contextValue,
766
+ children: dialog
767
+ });
768
+ }
769
+ function createNestedSwipeProgressStore() {
770
+ let progress = 0;
771
+ const listeners = /* @__PURE__ */ new Set();
772
+ return {
773
+ getSnapshot: () => progress,
774
+ set(nextProgress) {
775
+ const resolved = Number.isFinite(nextProgress) ? nextProgress : 0;
776
+ if (resolved === progress) return;
777
+ progress = resolved;
778
+ listeners.forEach((listener) => {
779
+ listener();
780
+ });
781
+ },
782
+ subscribe(listener) {
783
+ listeners.add(listener);
784
+ return () => {
785
+ listeners.delete(listener);
786
+ };
787
+ }
788
+ };
789
+ }
790
+ function DrawerProviderReporter() {
791
+ const providerContext = useDrawerProviderContext();
792
+ const store = useDialogRootContext(false);
793
+ const setDrawerOpen = providerContext?.setDrawerOpen;
794
+ const removeDrawer = providerContext?.removeDrawer;
795
+ const open = store.useState("open");
796
+ const nestedOpenDialogCount = store.useState("nestedOpenDialogCount");
797
+ const popupElement = store.useState("popupElement");
798
+ const isTopmost = nestedOpenDialogCount === 0;
799
+ useIsoLayoutEffect(() => {
800
+ if (!removeDrawer) return;
801
+ return () => {
802
+ removeDrawer(store);
803
+ };
804
+ }, [removeDrawer, store]);
805
+ useIsoLayoutEffect(() => {
806
+ setDrawerOpen?.(store, open);
807
+ }, [
808
+ open,
809
+ setDrawerOpen,
810
+ store
811
+ ]);
812
+ React$1.useEffect(() => {
813
+ if (!open || !isTopmost || !android) return;
814
+ const CloseWatcherCtor = getWindow(popupElement).CloseWatcher;
815
+ if (!CloseWatcherCtor) return;
816
+ function handleCancel(event) {
817
+ if (!store.select("open")) return;
818
+ const eventDetails = createChangeEventDetails(closeWatcher, event);
819
+ if (!event.cancelable) eventDetails.cancel = NOOP;
820
+ store.setOpen(false, eventDetails);
821
+ if (eventDetails.isCanceled) event.preventDefault();
822
+ }
823
+ const closeWatcher$1 = new CloseWatcherCtor();
824
+ const unsubscribe = addEventListener(closeWatcher$1, "cancel", handleCancel);
825
+ return () => {
826
+ unsubscribe();
827
+ closeWatcher$1.destroy();
828
+ };
829
+ }, [
830
+ store,
831
+ isTopmost,
832
+ open,
833
+ popupElement
834
+ ]);
835
+ return null;
836
+ }
837
+ //#endregion
838
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/drawer/title/DrawerTitle.mjs
839
+ /**
840
+ * A heading that labels the drawer.
841
+ * Renders an `<h2>` element.
842
+ *
843
+ * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)
844
+ */
845
+ const DrawerTitle = DialogTitle;
846
+ //#endregion
847
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/drawer/trigger/DrawerTrigger.mjs
848
+ /**
849
+ * A button that opens the drawer.
850
+ * Renders a `<button>` element.
851
+ *
852
+ * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)
853
+ */
854
+ const DrawerTrigger = DialogTrigger;
855
+ //#endregion
856
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/drawer/virtual-keyboard-provider/DrawerVirtualKeyboardContext.mjs
857
+ const DrawerVirtualKeyboardContext = /*#__PURE__*/ React$1.createContext(void 0);
858
+ DrawerVirtualKeyboardContext.displayName = "DrawerVirtualKeyboardContext";
859
+ function useDrawerVirtualKeyboardContext() {
860
+ return React$1.useContext(DrawerVirtualKeyboardContext);
861
+ }
862
+ //#endregion
863
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/drawer/viewport/DrawerViewport.mjs
864
+ const MIN_SWIPE_THRESHOLD = 10;
865
+ const FAST_SWIPE_VELOCITY = .5;
866
+ const SNAP_VELOCITY_THRESHOLD = .5;
867
+ const SNAP_VELOCITY_MULTIPLIER = 300;
868
+ const MAX_SNAP_VELOCITY = 4;
869
+ const MIN_SWIPE_RELEASE_VELOCITY = .2;
870
+ const MAX_SWIPE_RELEASE_VELOCITY = 4;
871
+ const MIN_SWIPE_RELEASE_DURATION_MS = 80;
872
+ const MAX_SWIPE_RELEASE_DURATION_MS = 360;
873
+ const MIN_SWIPE_RELEASE_SCALAR = .1;
874
+ const AXIS_LOCK_SLOP = 6;
875
+ const AXIS_LOCK_BIAS = 2;
876
+ const DRAWER_CONTENT_SELECTOR = `[${DRAWER_CONTENT_ATTRIBUTE}]`;
877
+ const AXIS_SWIPE_IGNORE_SELECTORS = {
878
+ horizontal: `[${BASE_UI_SWIPE_IGNORE_ATTRIBUTE}="x"]`,
879
+ vertical: `[${BASE_UI_SWIPE_IGNORE_ATTRIBUTE}="y"]`
880
+ };
881
+ /**
882
+ * A positioning container for the drawer popup that can be made scrollable.
883
+ * Renders a `<div>` element.
884
+ *
885
+ * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)
886
+ */
887
+ const DrawerViewport = /*#__PURE__*/ React$1.forwardRef(function DrawerViewport(props, forwardedRef) {
888
+ const { render, className, style, children, ...elementProps } = props;
889
+ const store = useDialogRootContext();
890
+ const popupRef = store.context.popupRef;
891
+ const backdropRef = store.context.backdropRef;
892
+ const { swipeDirection, notifyParentSwipingChange, notifyParentSwipeProgressChange, frontmostHeight, snapToSequentialPoints, swipeAreaActiveRef } = useDrawerRootContext();
893
+ const providerContext = useDrawerProviderContext();
894
+ const { snapPoints, resolvedSnapPoints, activeSnapPoint, activeSnapPointOffset, setActiveSnapPoint, popupHeight } = useDrawerSnapPoints();
895
+ const open = store.useState("open");
896
+ const mounted = store.useState("mounted");
897
+ const nested = store.useState("nested");
898
+ const nestedOpenDrawerCount = store.useState("nestedOpenDrawerCount");
899
+ const viewportElement = store.useState("viewportElement");
900
+ const popupElementState = store.useState("popupElement");
901
+ const visualStateStore = providerContext?.visualStateStore;
902
+ const nestedDrawerOpen = nestedOpenDrawerCount > 0;
903
+ const scrollAxis = swipeDirection === "left" || swipeDirection === "right" ? "horizontal" : "vertical";
904
+ const isVerticalScrollAxis = scrollAxis === "vertical";
905
+ const crossScrollAxis = isVerticalScrollAxis ? "horizontal" : "vertical";
906
+ const [swipeRelease, setSwipeRelease] = React$1.useState(null);
907
+ const pendingSwipeCloseSnapPointRef = React$1.useRef(void 0);
908
+ const resetSwipeRef = React$1.useRef(null);
909
+ const controlledDismissFrame = useAnimationFrame();
910
+ const swipingRef = React$1.useRef(false);
911
+ const nestedSwipeActiveRef = React$1.useRef(false);
912
+ const lastPointerTypeRef = React$1.useRef("");
913
+ const ignoreNextTouchStartFromPenRef = React$1.useRef(false);
914
+ const ignoreTouchSwipeRef = React$1.useRef(false);
915
+ const touchScrollStateRef = React$1.useRef(null);
916
+ const virtualKeyboard = useDrawerVirtualKeyboardContext();
917
+ const snapPointRange = React$1.useMemo(() => {
918
+ if (!snapPoints || snapPoints.length < 2 || resolvedSnapPoints.length < 2 || swipeDirection !== "down" && swipeDirection !== "up") return null;
919
+ const offsets = resolvedSnapPoints.map((point) => point.offset).sort((a, b) => a - b);
920
+ const minOffset = offsets[0];
921
+ return {
922
+ minOffset,
923
+ range: offsets[1] - minOffset
924
+ };
925
+ }, [
926
+ resolvedSnapPoints,
927
+ snapPoints,
928
+ swipeDirection
929
+ ]);
930
+ const snapPointProgress = React$1.useMemo(() => {
931
+ if (!snapPointRange || activeSnapPointOffset === null) return null;
932
+ return clamp((activeSnapPointOffset - snapPointRange.minOffset) / snapPointRange.range, 0, 1);
933
+ }, [activeSnapPointOffset, snapPointRange]);
934
+ const swipeDirections = React$1.useMemo(() => {
935
+ if (snapPoints && snapPoints.length > 0 && (swipeDirection === "down" || swipeDirection === "up")) return swipeDirection === "down" ? ["down", "up"] : ["up", "down"];
936
+ return [swipeDirection];
937
+ }, [snapPoints, swipeDirection]);
938
+ const setSwipeDismissed = useStableCallback((dismissed) => {
939
+ popupRef.current?.toggleAttribute(swipeDismiss, dismissed);
940
+ backdropRef.current?.toggleAttribute(swipeDismiss, dismissed);
941
+ });
942
+ const clearSwipeRelease = useStableCallback(() => {
943
+ setSwipeDismissed(false);
944
+ popupRef.current?.removeAttribute(endingStyle$2);
945
+ setSwipeRelease(null);
946
+ });
947
+ const finishNestedSwipe = useStableCallback(() => {
948
+ if (!nestedSwipeActiveRef.current) return;
949
+ nestedSwipeActiveRef.current = false;
950
+ notifyParentSwipingChange?.(false);
951
+ });
952
+ const applySwipeProgress = useStableCallback((resolvedProgress, shouldTrackProgress, notifyParent) => {
953
+ const isActive = open && !nested && shouldTrackProgress;
954
+ const swipeProgress$1 = isActive ? resolvedProgress : 0;
955
+ const nestedSwipeProgress = open && shouldTrackProgress ? resolvedProgress : 0;
956
+ if (notifyParent && notifyParentSwipeProgressChange) {
957
+ notifyParentSwipeProgressChange(nestedSwipeProgress);
958
+ if (nestedSwipeProgress <= 0) finishNestedSwipe();
959
+ }
960
+ visualStateStore?.set({
961
+ swipeProgress: swipeProgress$1,
962
+ frontmostHeight: swipeProgress$1 > 0 ? frontmostHeight : 0
963
+ });
964
+ const backdropElement = backdropRef.current;
965
+ if (!backdropElement) return;
966
+ const showProgress = isActive && swipeProgress$1 > 0;
967
+ backdropElement.style.setProperty(swipeProgress, showProgress ? `${swipeProgress$1}` : "0");
968
+ if (showProgress && frontmostHeight > 0) backdropElement.style.setProperty(height, `${frontmostHeight}px`);
969
+ else backdropElement.style.removeProperty(height);
970
+ });
971
+ function resolveSwipeRelease(popupElement, direction, deltaX, deltaY, velocityX, velocityY, releaseVelocityX, releaseVelocityY) {
972
+ const size = getBaseSwipeSize(popupElement, direction);
973
+ if (size <= 0) return null;
974
+ const translationAlongDirection = ((direction === "down" || direction === "up") && snapPoints && snapPoints.length > 0 ? activeSnapPointOffset ?? 0 : 0) + getDisplacement(direction, deltaX, deltaY);
975
+ const remainingDistance = Math.max(0, size - translationAlongDirection);
976
+ if (remainingDistance <= 0) return null;
977
+ const releaseVelocity = getDisplacement(direction, releaseVelocityX, releaseVelocityY);
978
+ const directionalVelocity = Math.abs(releaseVelocity) > 0 ? releaseVelocity : getDisplacement(direction, velocityX, velocityY);
979
+ if (directionalVelocity <= MIN_SWIPE_RELEASE_VELOCITY) return null;
980
+ const clampedVelocity = clamp(directionalVelocity, MIN_SWIPE_RELEASE_VELOCITY, MAX_SWIPE_RELEASE_VELOCITY);
981
+ const normalizedDuration = (clamp(remainingDistance / clampedVelocity, MIN_SWIPE_RELEASE_DURATION_MS, MAX_SWIPE_RELEASE_DURATION_MS) - MIN_SWIPE_RELEASE_DURATION_MS) / 280;
982
+ return MIN_SWIPE_RELEASE_SCALAR + normalizedDuration * .9;
983
+ }
984
+ function updateNestedSwipeActive(details) {
985
+ if (nestedSwipeActiveRef.current || !details) return;
986
+ const direction = details.direction ?? swipeDirection;
987
+ const delta = getDisplacement(direction, details.deltaX, details.deltaY);
988
+ if (Math.abs(delta) < MIN_SWIPE_THRESHOLD) return;
989
+ nestedSwipeActiveRef.current = true;
990
+ notifyParentSwipingChange?.(true);
991
+ }
992
+ const swipe$1 = useSwipeDismiss({
993
+ enabled: mounted && !nestedDrawerOpen,
994
+ directions: swipeDirections,
995
+ elementRef: store.context.popupRef,
996
+ ignoreSelectorWhenTouch: false,
997
+ ignoreScrollableAncestors: true,
998
+ movementCssVars: {
999
+ x: swipeMovementX,
1000
+ y: swipeMovementY
1001
+ },
1002
+ onSwipeStart(event) {
1003
+ if ("touches" in event || event.pointerType === "touch") return;
1004
+ const popupElement = popupRef.current;
1005
+ const selection = ownerDocument(popupElement).getSelection?.();
1006
+ if (!selection || selection.isCollapsed) return;
1007
+ const anchorElement = isElement(selection.anchorNode) ? selection.anchorNode : selection.anchorNode?.parentElement;
1008
+ const focusElement = isElement(selection.focusNode) ? selection.focusNode : selection.focusNode?.parentElement;
1009
+ if (!contains(popupElement, anchorElement) && !contains(popupElement, focusElement)) return;
1010
+ selection.removeAllRanges();
1011
+ },
1012
+ onSwipingChange(swiping) {
1013
+ swipingRef.current = swiping;
1014
+ setBackdropSwipingAttribute(store.context.backdropRef.current, swiping);
1015
+ if (!swiping && !notifyParentSwipeProgressChange) finishNestedSwipe();
1016
+ },
1017
+ swipeThreshold({ element, direction }) {
1018
+ return getBaseSwipeThreshold(element, direction);
1019
+ },
1020
+ canStart(position, details) {
1021
+ const popupElement = store.context.popupRef.current;
1022
+ if (!popupElement) return false;
1023
+ const nativeEvent = details.nativeEvent;
1024
+ const touchLike = "touches" in nativeEvent || nativeEvent.pointerType === "touch";
1025
+ const touchState = touchLike ? touchScrollStateRef.current : null;
1026
+ const doc = popupElement.ownerDocument;
1027
+ const elementAtPoint = getElementAtPoint(popupElement.getRootNode(), position.x, position.y);
1028
+ if (!touchState?.startedInPopup && !contains(popupElement, elementAtPoint)) return false;
1029
+ if (touchLike && shouldIgnoreSwipeForTextSelection(doc, popupElement)) return false;
1030
+ if (touchState?.hasCrossAxisGestureTarget && !touchState.drawerAxisAttributed && touchState.allowSwipe !== true) return false;
1031
+ return true;
1032
+ },
1033
+ onProgress(progress, details) {
1034
+ const swiping = swipingRef.current;
1035
+ if (swiping) updateNestedSwipeActive(details);
1036
+ const hasSnapPoints = Boolean(snapPoints && snapPoints.length > 0);
1037
+ if (swiping && swipeDirection === "down" && hasSnapPoints && details) {
1038
+ const popupElement = store.context.popupRef.current;
1039
+ if (popupElement) {
1040
+ popupElement.style.removeProperty("transform");
1041
+ popupElement.style.setProperty(swipeMovementY, `${getSnapPointSwipeMovement(activeSnapPointOffset ?? 0, details.deltaY)}px`);
1042
+ }
1043
+ }
1044
+ let resolvedProgress = progress;
1045
+ if (snapPointRange && popupHeight > 0) {
1046
+ const baseOffset = activeSnapPointOffset ?? snapPointRange.minOffset;
1047
+ const offsetToProgress = (nextOffset) => clamp((nextOffset - snapPointRange.minOffset) / snapPointRange.range, 0, 1);
1048
+ if (swiping && details && Number.isFinite(details.deltaY)) resolvedProgress = offsetToProgress(clamp(baseOffset + details.deltaY, 0, popupHeight));
1049
+ else if (snapPointProgress !== null) resolvedProgress = snapPointProgress;
1050
+ }
1051
+ if (!swiping) {
1052
+ notifyParentSwipeProgressChange?.(0);
1053
+ finishNestedSwipe();
1054
+ }
1055
+ applySwipeProgress(resolvedProgress, true, swiping);
1056
+ },
1057
+ onRelease({ event, deltaX, deltaY, direction, velocityX, velocityY, releaseVelocityX, releaseVelocityY }) {
1058
+ const popupElement = store.context.popupRef.current;
1059
+ if (!popupElement) {
1060
+ clearSwipeRelease();
1061
+ return;
1062
+ }
1063
+ const releasePopupElement = popupElement;
1064
+ function startSwipeRelease(resolvedDirection) {
1065
+ finishNestedSwipe();
1066
+ setSwipeDismissed(true);
1067
+ releasePopupElement.style.removeProperty("transition");
1068
+ releasePopupElement.setAttribute(endingStyle$2, "");
1069
+ ReactDOM.flushSync(() => {
1070
+ setSwipeRelease(resolveSwipeRelease(releasePopupElement, resolvedDirection, deltaX, deltaY, velocityX, velocityY, releaseVelocityX, releaseVelocityY));
1071
+ });
1072
+ }
1073
+ if (!snapPoints || snapPoints.length === 0) {
1074
+ if (!direction) {
1075
+ clearSwipeRelease();
1076
+ return;
1077
+ }
1078
+ const directionalDelta = getDisplacement(direction, deltaX, deltaY);
1079
+ if (directionalDelta <= 0) {
1080
+ clearSwipeRelease();
1081
+ return false;
1082
+ }
1083
+ if (getDisplacement(direction, velocityX, velocityY) >= FAST_SWIPE_VELOCITY) {
1084
+ startSwipeRelease(direction);
1085
+ return true;
1086
+ }
1087
+ const shouldClose = directionalDelta > getBaseSwipeThreshold(releasePopupElement, direction);
1088
+ if (shouldClose) startSwipeRelease(direction);
1089
+ else clearSwipeRelease();
1090
+ return shouldClose;
1091
+ }
1092
+ if (swipeDirection !== "down" && swipeDirection !== "up") {
1093
+ clearSwipeRelease();
1094
+ return;
1095
+ }
1096
+ if (!popupHeight) {
1097
+ clearSwipeRelease();
1098
+ return false;
1099
+ }
1100
+ if (resolvedSnapPoints.length === 0) {
1101
+ clearSwipeRelease();
1102
+ return;
1103
+ }
1104
+ const dragDelta = swipeDirection === "down" ? deltaY : -deltaY;
1105
+ const dragDirection = Math.sign(dragDelta);
1106
+ const releaseDirectionalVelocity = swipeDirection === "down" ? releaseVelocityY : -releaseVelocityY;
1107
+ const fallbackDirectionalVelocity = swipeDirection === "down" ? velocityY : -velocityY;
1108
+ let resolvedDirectionalVelocity = releaseDirectionalVelocity;
1109
+ if (dragDirection !== 0 && Math.abs(dragDelta) >= MIN_SWIPE_THRESHOLD) {
1110
+ const velocityDirection = Math.sign(resolvedDirectionalVelocity);
1111
+ if (velocityDirection !== 0 && velocityDirection !== dragDirection) resolvedDirectionalVelocity = fallbackDirectionalVelocity;
1112
+ }
1113
+ const currentOffset = activeSnapPointOffset ?? 0;
1114
+ const dragTargetOffset = clamp(currentOffset + dragDelta, 0, popupHeight);
1115
+ const velocityOffset = Math.abs(resolvedDirectionalVelocity) >= SNAP_VELOCITY_THRESHOLD ? clamp(resolvedDirectionalVelocity, -4, MAX_SNAP_VELOCITY) * SNAP_VELOCITY_MULTIPLIER : 0;
1116
+ const targetOffset = snapToSequentialPoints ? dragTargetOffset : clamp(dragTargetOffset + velocityOffset, 0, popupHeight);
1117
+ const snapPointEventDetails = createChangeEventDetails(swipe, event);
1118
+ const settleInPlace = () => {
1119
+ applySwipeProgress(0, true, true);
1120
+ clearSwipeRelease();
1121
+ return false;
1122
+ };
1123
+ const settleOnSnapPoint = (snapPoint) => {
1124
+ setActiveSnapPoint(snapPoint.value, snapPointEventDetails);
1125
+ return settleInPlace();
1126
+ };
1127
+ const closeFromSnapPoints = (fallbackSnapPoint) => {
1128
+ if (!direction) return settleOnSnapPoint(fallbackSnapPoint);
1129
+ setActiveSnapPoint(null, snapPointEventDetails);
1130
+ if (snapPointEventDetails.isCanceled) return settleInPlace();
1131
+ pendingSwipeCloseSnapPointRef.current = activeSnapPoint;
1132
+ startSwipeRelease(swipeDirection);
1133
+ return true;
1134
+ };
1135
+ if (snapToSequentialPoints) {
1136
+ const orderedSnapPoints = [...resolvedSnapPoints].sort((first, second) => first.offset - second.offset);
1137
+ const orderedOffsets = orderedSnapPoints.map((point) => point.offset);
1138
+ const currentIndex = closestSnapPointIndex(orderedOffsets, currentOffset);
1139
+ let targetSnapPoint = orderedSnapPoints[closestSnapPointIndex(orderedOffsets, targetOffset)];
1140
+ const velocityDirection = Math.sign(resolvedDirectionalVelocity);
1141
+ const shouldAdvance = dragDirection !== 0 && velocityDirection !== 0 && velocityDirection === dragDirection && Math.abs(resolvedDirectionalVelocity) >= SNAP_VELOCITY_THRESHOLD;
1142
+ let effectiveTargetOffset = targetOffset;
1143
+ if (shouldAdvance) {
1144
+ const adjacentIndex = clamp(currentIndex + dragDirection, 0, orderedSnapPoints.length - 1);
1145
+ if (adjacentIndex !== currentIndex) {
1146
+ const adjacentPoint = orderedSnapPoints[adjacentIndex];
1147
+ if (dragDirection > 0 ? targetOffset < adjacentPoint.offset : targetOffset > adjacentPoint.offset) {
1148
+ targetSnapPoint = adjacentPoint;
1149
+ effectiveTargetOffset = adjacentPoint.offset;
1150
+ }
1151
+ } else if (dragDirection > 0) return closeFromSnapPoints(targetSnapPoint);
1152
+ }
1153
+ if (Math.abs(effectiveTargetOffset - popupHeight) < Math.abs(effectiveTargetOffset - targetSnapPoint.offset)) return closeFromSnapPoints(targetSnapPoint);
1154
+ return settleOnSnapPoint(targetSnapPoint);
1155
+ }
1156
+ const closestSnapPoint = resolvedSnapPoints[closestSnapPointIndex(resolvedSnapPoints.map((point) => point.offset), targetOffset)];
1157
+ if (resolvedDirectionalVelocity >= FAST_SWIPE_VELOCITY && dragDelta > 0) return closeFromSnapPoints(closestSnapPoint);
1158
+ if (Math.abs(targetOffset - popupHeight) < Math.abs(targetOffset - closestSnapPoint.offset)) return closeFromSnapPoints(closestSnapPoint);
1159
+ return settleOnSnapPoint(closestSnapPoint);
1160
+ },
1161
+ onDismiss(event) {
1162
+ visualStateStore?.set({
1163
+ swipeProgress: 0,
1164
+ frontmostHeight: 0
1165
+ });
1166
+ const backdropElement = store.context.backdropRef.current;
1167
+ if (backdropElement) {
1168
+ backdropElement.style.setProperty(swipeProgress, "0");
1169
+ backdropElement.style.removeProperty(height);
1170
+ }
1171
+ const dismissEventDetails = createChangeEventDetails(swipe, event);
1172
+ store.setOpen(false, dismissEventDetails);
1173
+ if (dismissEventDetails.isCanceled) {
1174
+ const pendingSnapPoint = pendingSwipeCloseSnapPointRef.current;
1175
+ if (pendingSnapPoint !== void 0) setActiveSnapPoint(pendingSnapPoint, createChangeEventDetails(swipe, event));
1176
+ pendingSwipeCloseSnapPointRef.current = void 0;
1177
+ resetSwipeRef.current?.();
1178
+ clearSwipeRelease();
1179
+ return;
1180
+ }
1181
+ if (store.select("open")) {
1182
+ const savedEvent = event;
1183
+ controlledDismissFrame.request(() => {
1184
+ if (store.select("open")) {
1185
+ const pendingSnapPoint = pendingSwipeCloseSnapPointRef.current;
1186
+ if (pendingSnapPoint !== void 0) setActiveSnapPoint(pendingSnapPoint, createChangeEventDetails(swipe, savedEvent));
1187
+ pendingSwipeCloseSnapPointRef.current = void 0;
1188
+ clearSwipeRelease();
1189
+ resetSwipeRef.current?.();
1190
+ } else pendingSwipeCloseSnapPointRef.current = void 0;
1191
+ });
1192
+ return;
1193
+ }
1194
+ pendingSwipeCloseSnapPointRef.current = void 0;
1195
+ setSwipeDismissed(true);
1196
+ }
1197
+ });
1198
+ const swipePointerProps = swipe$1.getPointerProps();
1199
+ const swipeTouchProps = swipe$1.getTouchProps();
1200
+ const { moveNative: moveSwipeNative, reset: resetSwipe } = swipe$1;
1201
+ resetSwipeRef.current = resetSwipe;
1202
+ React$1.useEffect(() => {
1203
+ const rootElement = viewportElement ?? popupElementState;
1204
+ if (!rootElement || !open || !mounted) return;
1205
+ const resolvedRootElement = rootElement;
1206
+ const doc = ownerDocument(resolvedRootElement);
1207
+ function processTouchMove(event, touchState, touch) {
1208
+ const drawerAxisDelta = isVerticalScrollAxis ? touch.clientY - touchState.lastY : touch.clientX - touchState.lastX;
1209
+ if (event.touches.length === 2) return;
1210
+ if (shouldIgnoreSwipeForTextSelection(doc, resolvedRootElement) || nestedDrawerOpen) return;
1211
+ if (shouldYieldTouchMove(touchState, event, touch, isVerticalScrollAxis)) return;
1212
+ const scrollTarget = touchState.scrollTarget;
1213
+ if (!scrollTarget || scrollTarget === doc.documentElement || scrollTarget === doc.body) {
1214
+ if (event.cancelable) event.preventDefault();
1215
+ event.stopPropagation();
1216
+ moveSwipeNative(event, resolvedRootElement);
1217
+ return;
1218
+ }
1219
+ if (!hasScrollableContentOnAxis(scrollTarget, scrollAxis)) {
1220
+ if (event.cancelable) event.preventDefault();
1221
+ event.stopPropagation();
1222
+ return;
1223
+ }
1224
+ if (drawerAxisDelta !== 0) {
1225
+ const canSwipeFromScrollEdge = canSwipeFromScrollEdgeOnMove(scrollTarget, scrollAxis, swipeDirection, drawerAxisDelta);
1226
+ if (!touchState.allowSwipe) {
1227
+ if (event.cancelable && canSwipeFromScrollEdge) {
1228
+ touchState.allowSwipe = true;
1229
+ event.preventDefault();
1230
+ } else touchState.allowSwipe = false;
1231
+ } else if (event.cancelable) event.preventDefault();
1232
+ }
1233
+ if (touchState.allowSwipe === true) {
1234
+ event.stopPropagation();
1235
+ moveSwipeNative(event, resolvedRootElement);
1236
+ }
1237
+ }
1238
+ function handleNativeTouchMove(event) {
1239
+ virtualKeyboard?.onTouchMove(event);
1240
+ if (ignoreTouchSwipeRef.current) return;
1241
+ const touchState = touchScrollStateRef.current;
1242
+ const touch = event.touches[0];
1243
+ if (!touch || !touchState) return;
1244
+ processTouchMove(event, touchState, touch);
1245
+ updateTouchScrollPosition(touchState, touch);
1246
+ }
1247
+ return addEventListener(doc, "touchmove", handleNativeTouchMove, {
1248
+ passive: false,
1249
+ capture: true
1250
+ });
1251
+ }, [
1252
+ mounted,
1253
+ nestedDrawerOpen,
1254
+ open,
1255
+ popupElementState,
1256
+ isVerticalScrollAxis,
1257
+ scrollAxis,
1258
+ swipeDirection,
1259
+ moveSwipeNative,
1260
+ viewportElement,
1261
+ virtualKeyboard
1262
+ ]);
1263
+ useIsoLayoutEffect(() => {
1264
+ if (!snapPointRange || swipe$1.swiping) return;
1265
+ applySwipeProgress(!open || nested ? 0 : snapPointProgress ?? 0, true, false);
1266
+ }, [
1267
+ applySwipeProgress,
1268
+ frontmostHeight,
1269
+ nested,
1270
+ notifyParentSwipeProgressChange,
1271
+ open,
1272
+ snapPointProgress,
1273
+ snapPointRange,
1274
+ swipe$1.swiping,
1275
+ store,
1276
+ visualStateStore
1277
+ ]);
1278
+ useIsoLayoutEffect(() => {
1279
+ if (!notifyParentSwipeProgressChange) return;
1280
+ if (!open) notifyParentSwipeProgressChange(0);
1281
+ return () => {
1282
+ notifyParentSwipeProgressChange(0);
1283
+ };
1284
+ }, [notifyParentSwipeProgressChange, open]);
1285
+ useIsoLayoutEffect(() => {
1286
+ if (open) {
1287
+ if (!swipeAreaActiveRef.current) resetSwipe();
1288
+ clearSwipeRelease();
1289
+ }
1290
+ }, [
1291
+ clearSwipeRelease,
1292
+ open,
1293
+ resetSwipe,
1294
+ swipeAreaActiveRef
1295
+ ]);
1296
+ useIsoLayoutEffect(() => {
1297
+ const backdropElement = backdropRef.current;
1298
+ return () => {
1299
+ visualStateStore?.set({
1300
+ swipeProgress: 0,
1301
+ frontmostHeight: 0
1302
+ });
1303
+ setBackdropSwipingAttribute(backdropElement, false);
1304
+ const currentBackdrop = backdropRef.current;
1305
+ if (currentBackdrop !== backdropElement) setBackdropSwipingAttribute(currentBackdrop, false);
1306
+ finishNestedSwipe();
1307
+ };
1308
+ }, [
1309
+ backdropRef,
1310
+ finishNestedSwipe,
1311
+ visualStateStore
1312
+ ]);
1313
+ const swipeProviderValue = React$1.useMemo(() => ({
1314
+ swiping: swipe$1.swiping,
1315
+ getDragStyles: swipe$1.getDragStyles,
1316
+ swipeStrength: swipeRelease ?? null,
1317
+ setSwipeDismissed
1318
+ }), [
1319
+ setSwipeDismissed,
1320
+ swipe$1.getDragStyles,
1321
+ swipe$1.swiping,
1322
+ swipeRelease
1323
+ ]);
1324
+ function resetTouchSwipeState(ignoreSwipe) {
1325
+ ignoreTouchSwipeRef.current = ignoreSwipe;
1326
+ touchScrollStateRef.current = null;
1327
+ }
1328
+ function resetTouchTrackingState() {
1329
+ resetTouchSwipeState(false);
1330
+ lastPointerTypeRef.current = "";
1331
+ ignoreNextTouchStartFromPenRef.current = false;
1332
+ }
1333
+ function handlePointerEnd(event) {
1334
+ lastPointerTypeRef.current = "";
1335
+ return event.pointerType !== "touch";
1336
+ }
1337
+ return /*#__PURE__*/ jsx(DialogViewport, {
1338
+ ref: forwardedRef,
1339
+ className,
1340
+ style,
1341
+ render,
1342
+ ...mergeProps(elementProps, {
1343
+ onPointerDown(event) {
1344
+ lastPointerTypeRef.current = event.pointerType;
1345
+ ignoreNextTouchStartFromPenRef.current = event.pointerType === "pen";
1346
+ if (!open || !mounted || nestedDrawerOpen) return;
1347
+ const elementAtPoint = getElementAtPoint(event.currentTarget.getRootNode(), event.clientX, event.clientY);
1348
+ if (isSwipeIgnoredTarget(elementAtPoint) || isDrawerContentTarget(elementAtPoint)) return;
1349
+ if (event.pointerType === "touch") return;
1350
+ swipePointerProps.onPointerDown?.(event);
1351
+ },
1352
+ onPointerMove(event) {
1353
+ if (event.pointerType === "touch") return;
1354
+ swipePointerProps.onPointerMove?.(event);
1355
+ },
1356
+ onPointerUp(event) {
1357
+ if (handlePointerEnd(event)) swipePointerProps.onPointerUp?.(event);
1358
+ },
1359
+ onPointerCancel(event) {
1360
+ if (handlePointerEnd(event)) swipePointerProps.onPointerCancel?.(event);
1361
+ },
1362
+ onTouchStart(event) {
1363
+ if (lastPointerTypeRef.current === "pen" && ignoreNextTouchStartFromPenRef.current) {
1364
+ ignoreNextTouchStartFromPenRef.current = false;
1365
+ resetTouchSwipeState(false);
1366
+ return;
1367
+ }
1368
+ if (!open || !mounted || nestedDrawerOpen) {
1369
+ resetTouchSwipeState(false);
1370
+ return;
1371
+ }
1372
+ const touch = event.touches[0];
1373
+ if (!touch) return;
1374
+ if (isReactTouchEventOnRangeInput(event)) {
1375
+ resetTouchSwipeState(false);
1376
+ return;
1377
+ }
1378
+ const rootElement = event.currentTarget;
1379
+ const elementAtPoint = getElementAtPoint(rootElement.getRootNode(), touch.clientX, touch.clientY);
1380
+ const eventTarget = getTarget(event.nativeEvent);
1381
+ const target = isElement(eventTarget) ? eventTarget : rootElement;
1382
+ if (!contains(rootElement, target)) {
1383
+ resetTouchSwipeState(true);
1384
+ return;
1385
+ }
1386
+ virtualKeyboard?.onTouchStart(event);
1387
+ if (closest(elementAtPoint, `${BASE_UI_SWIPE_IGNORE_SELECTOR}:not(${AXIS_SWIPE_IGNORE_SELECTORS[crossScrollAxis]})`)) {
1388
+ resetTouchSwipeState(true);
1389
+ return;
1390
+ }
1391
+ ignoreTouchSwipeRef.current = false;
1392
+ const scrollTarget = findScrollableTouchTarget(target, rootElement, scrollAxis);
1393
+ const hasCrossAxisGestureTarget = findScrollableTouchTarget(target, rootElement, crossScrollAxis) != null || closest(elementAtPoint, AXIS_SWIPE_IGNORE_SELECTORS[crossScrollAxis]) != null;
1394
+ let allowSwipe = null;
1395
+ if (scrollTarget) allowSwipe = isAtSwipeStartEdge(scrollTarget, scrollAxis, swipeDirection) ? null : false;
1396
+ touchScrollStateRef.current = {
1397
+ startX: touch.clientX,
1398
+ startY: touch.clientY,
1399
+ lastX: touch.clientX,
1400
+ lastY: touch.clientY,
1401
+ startedInPopup: contains(popupRef.current, elementAtPoint),
1402
+ scrollTarget,
1403
+ hasCrossAxisGestureTarget,
1404
+ allowSwipe,
1405
+ preserveNativeCrossAxisScroll: false,
1406
+ drawerAxisAttributed: false
1407
+ };
1408
+ swipeTouchProps.onTouchStart?.(event);
1409
+ },
1410
+ onTouchEnd(event) {
1411
+ virtualKeyboard?.onTouchEnd(event);
1412
+ resetTouchTrackingState();
1413
+ swipeTouchProps.onTouchEnd?.(event);
1414
+ },
1415
+ onTouchCancel(event) {
1416
+ virtualKeyboard?.onTouchCancel();
1417
+ resetTouchTrackingState();
1418
+ swipeTouchProps.onTouchCancel?.(event);
1419
+ },
1420
+ [nestedDialogOpen]: void 0
1421
+ }),
1422
+ children: /*#__PURE__*/ jsx(DrawerViewportContext.Provider, {
1423
+ value: swipeProviderValue,
1424
+ children
1425
+ })
1426
+ });
1427
+ });
1428
+ DrawerViewport.displayName = "DrawerViewport";
1429
+ function setBackdropSwipingAttribute(backdropElement, swiping$1) {
1430
+ backdropElement?.toggleAttribute(swiping, swiping$1);
1431
+ }
1432
+ function isSwipeIgnoredTarget(target) {
1433
+ return Boolean(closest(target, BASE_UI_SWIPE_IGNORE_SELECTOR));
1434
+ }
1435
+ function isDrawerContentTarget(target) {
1436
+ return Boolean(closest(target, DRAWER_CONTENT_SELECTOR));
1437
+ }
1438
+ function getBaseSwipeSize(element, direction) {
1439
+ return direction === "left" || direction === "right" ? element.offsetWidth : element.offsetHeight;
1440
+ }
1441
+ function getBaseSwipeThreshold(element, direction) {
1442
+ return Math.max(getBaseSwipeSize(element, direction) * .5, MIN_SWIPE_THRESHOLD);
1443
+ }
1444
+ function isRangeInput(target, win) {
1445
+ return target instanceof win.HTMLInputElement && target.type === "range";
1446
+ }
1447
+ function isTextSelectionControl(target) {
1448
+ return target.tagName === "INPUT" || target.tagName === "TEXTAREA";
1449
+ }
1450
+ function hasExpandedSelectionWithinTarget(selection, target) {
1451
+ const anchorElement = isElement(selection.anchorNode) ? selection.anchorNode : selection.anchorNode?.parentElement;
1452
+ const focusElement = isElement(selection.focusNode) ? selection.focusNode : selection.focusNode?.parentElement;
1453
+ return selection.containsNode(target, true) || contains(target, anchorElement) || contains(target, focusElement);
1454
+ }
1455
+ function shouldIgnoreSwipeForTextSelection(doc, rootElement) {
1456
+ const activeEl = activeElement(doc);
1457
+ if (activeEl && contains(rootElement, activeEl) && isTextSelectionControl(activeEl)) {
1458
+ const { selectionStart, selectionEnd } = activeEl;
1459
+ if (selectionStart != null && selectionEnd != null && selectionStart < selectionEnd) return true;
1460
+ }
1461
+ const selection = doc.getSelection?.();
1462
+ if (!selection || selection.isCollapsed) return false;
1463
+ return hasExpandedSelectionWithinTarget(selection, rootElement);
1464
+ }
1465
+ function isEventOnRangeInput(event, win) {
1466
+ return event.composedPath().some((pathTarget) => isRangeInput(pathTarget, win));
1467
+ }
1468
+ function isReactTouchEventOnRangeInput(event) {
1469
+ return isEventOnRangeInput(event.nativeEvent, getWindow(event.currentTarget));
1470
+ }
1471
+ function updateTouchScrollPosition(touchState, touch) {
1472
+ touchState.lastX = touch.clientX;
1473
+ touchState.lastY = touch.clientY;
1474
+ }
1475
+ /**
1476
+ * Arbitrates a touchmove between the drawer swipe and a cross-axis gesture: a native scroll, or an
1477
+ * element marked with the cross-axis `data-base-ui-swipe-ignore` value.
1478
+ * Returns `true` when the move must be left alone — either because the cross axis already won the
1479
+ * gesture, or because neither axis has passed the slop yet and the gesture cannot be attributed.
1480
+ */
1481
+ function shouldYieldTouchMove(touchState, event, touch, isVerticalScrollAxis) {
1482
+ if (touchState.preserveNativeCrossAxisScroll) return true;
1483
+ if (touchState.drawerAxisAttributed || touchState.allowSwipe === true || !touchState.hasCrossAxisGestureTarget) return false;
1484
+ if (!event.cancelable) {
1485
+ touchState.preserveNativeCrossAxisScroll = true;
1486
+ return true;
1487
+ }
1488
+ const drawerAxisGestureDelta = isVerticalScrollAxis ? touch.clientY - touchState.startY : touch.clientX - touchState.startX;
1489
+ const crossAxisGestureDelta = isVerticalScrollAxis ? touch.clientX - touchState.startX : touch.clientY - touchState.startY;
1490
+ const absDrawerAxisGestureDelta = Math.abs(drawerAxisGestureDelta);
1491
+ const absCrossAxisGestureDelta = Math.abs(crossAxisGestureDelta);
1492
+ if (absCrossAxisGestureDelta >= AXIS_LOCK_SLOP && absCrossAxisGestureDelta > absDrawerAxisGestureDelta + AXIS_LOCK_BIAS) {
1493
+ touchState.preserveNativeCrossAxisScroll = true;
1494
+ return true;
1495
+ }
1496
+ if (absDrawerAxisGestureDelta >= AXIS_LOCK_SLOP) {
1497
+ touchState.drawerAxisAttributed = true;
1498
+ return false;
1499
+ }
1500
+ return true;
1501
+ }
1502
+ function hasScrollableContentOnAxis(scrollTarget, axis) {
1503
+ return getScrollMetrics(scrollTarget, axis).max > 0;
1504
+ }
1505
+ function getScrollMetrics(scrollTarget, axis) {
1506
+ if (axis === "vertical") {
1507
+ const max = Math.max(0, scrollTarget.scrollHeight - scrollTarget.clientHeight);
1508
+ return {
1509
+ offset: scrollTarget.scrollTop,
1510
+ max
1511
+ };
1512
+ }
1513
+ const max = Math.max(0, scrollTarget.scrollWidth - scrollTarget.clientWidth);
1514
+ return {
1515
+ offset: scrollTarget.scrollLeft,
1516
+ max
1517
+ };
1518
+ }
1519
+ function isAtSwipeStartEdge(scrollTarget, axis, direction) {
1520
+ const dismissFromStartEdge = shouldDismissFromStartEdge(direction, axis);
1521
+ const { offset, max } = getScrollMetrics(scrollTarget, axis);
1522
+ return dismissFromStartEdge ? offset <= 0 : offset >= max;
1523
+ }
1524
+ function canSwipeFromScrollEdgeOnMove(scrollTarget, axis, direction, delta) {
1525
+ if (!(shouldDismissFromStartEdge(direction, axis) ? delta > 0 : delta < 0)) return false;
1526
+ return isAtSwipeStartEdge(scrollTarget, axis, direction);
1527
+ }
1528
+ function shouldDismissFromStartEdge(direction, axis) {
1529
+ return axis === "vertical" ? direction === "down" : direction === "right";
1530
+ }
1531
+ //#endregion
1532
+ export { swipeMovementY as S, DrawerBackdropCssVars_exports as _, DrawerRoot as a, height as b, useDrawerRootContext as c, DrawerProviderContext as d, useDrawerProviderContext as f, DrawerBackdrop as g, DrawerClose as h, DrawerTitle as i, DrawerPopupDataAttributes_exports as l, DrawerContent as m, DrawerVirtualKeyboardContext as n, DrawerPortal as o, DrawerDescription as p, DrawerTrigger as r, DrawerPopup as s, DrawerViewport as t, swiping as u, swipeProgress as v, swipeMovementX as x, DrawerPopupCssVars_exports as y };