@btst/stack 1.3.1 → 1.4.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 (229) hide show
  1. package/README.md +85 -37
  2. package/dist/node_modules/.pnpm/{@radix-ui_react-alert-dialog@1.1.15_@types_react-dom@19.2.2_@types_react@19.2.2__@types_ec789942cd38340bd7362c09e7d34384 → @radix-ui_react-alert-dialog@1.1.15_@types_react-dom@19.2.3_@types_react@19.2.6__@types_4f58c757aa677e233cf96d60fda2f1da}/node_modules/@radix-ui/react-alert-dialog/dist/index.cjs +2 -2
  3. package/dist/node_modules/.pnpm/{@radix-ui_react-alert-dialog@1.1.15_@types_react-dom@19.2.2_@types_react@19.2.2__@types_ec789942cd38340bd7362c09e7d34384 → @radix-ui_react-alert-dialog@1.1.15_@types_react-dom@19.2.3_@types_react@19.2.6__@types_4f58c757aa677e233cf96d60fda2f1da}/node_modules/@radix-ui/react-alert-dialog/dist/index.mjs +2 -2
  4. package/dist/node_modules/.pnpm/{@radix-ui_react-arrow@1.1.7_@types_react-dom@19.2.2_@types_react@19.2.2__@types_react@1_9e04309f365863673e44407648bb0cb6 → @radix-ui_react-arrow@1.1.7_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@1_35df44f6d87656c1401686c91d770dbb}/node_modules/@radix-ui/react-arrow/dist/index.cjs +1 -1
  5. package/dist/node_modules/.pnpm/{@radix-ui_react-arrow@1.1.7_@types_react-dom@19.2.2_@types_react@19.2.2__@types_react@1_9e04309f365863673e44407648bb0cb6 → @radix-ui_react-arrow@1.1.7_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@1_35df44f6d87656c1401686c91d770dbb}/node_modules/@radix-ui/react-arrow/dist/index.mjs +1 -1
  6. package/dist/node_modules/.pnpm/{@radix-ui_react-collection@1.1.7_@types_react-dom@19.2.2_@types_react@19.2.2__@types_re_6d7c277722b3619c9ee7e64e9a822c45 → @radix-ui_react-collection@1.1.7_@types_react-dom@19.2.3_@types_react@19.2.6__@types_re_59aa5e150e70a3e7bfb1567148b021b5}/node_modules/@radix-ui/react-collection/dist/index.cjs +2 -2
  7. package/dist/node_modules/.pnpm/{@radix-ui_react-collection@1.1.7_@types_react-dom@19.2.2_@types_react@19.2.2__@types_re_6d7c277722b3619c9ee7e64e9a822c45 → @radix-ui_react-collection@1.1.7_@types_react-dom@19.2.3_@types_react@19.2.6__@types_re_59aa5e150e70a3e7bfb1567148b021b5}/node_modules/@radix-ui/react-collection/dist/index.mjs +2 -2
  8. package/dist/node_modules/.pnpm/{@radix-ui_react-dismissable-layer@1.1.11_@types_react-dom@19.2.2_@types_react@19.2.2__@_ca5522e5d45d4722cb9eb5ce53defa61 → @radix-ui_react-dismissable-layer@1.1.11_@types_react-dom@19.2.3_@types_react@19.2.6__@_9ee1db7daf927866cf505b31d40047ad}/node_modules/@radix-ui/react-dismissable-layer/dist/index.cjs +4 -4
  9. package/dist/node_modules/.pnpm/{@radix-ui_react-dismissable-layer@1.1.11_@types_react-dom@19.2.2_@types_react@19.2.2__@_ca5522e5d45d4722cb9eb5ce53defa61 → @radix-ui_react-dismissable-layer@1.1.11_@types_react-dom@19.2.3_@types_react@19.2.6__@_9ee1db7daf927866cf505b31d40047ad}/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs +4 -4
  10. package/dist/node_modules/.pnpm/@radix-ui_react-dropdown-menu@2.1.16_@types_react-dom@19.2.3_@types_react@19.2.6__@type_a50051c7210b6fbd5be09388bda08578/node_modules/@radix-ui/react-dropdown-menu/dist/index.cjs +282 -0
  11. package/dist/node_modules/.pnpm/@radix-ui_react-dropdown-menu@2.1.16_@types_react-dom@19.2.3_@types_react@19.2.6__@type_a50051c7210b6fbd5be09388bda08578/node_modules/@radix-ui/react-dropdown-menu/dist/index.mjs +247 -0
  12. package/dist/node_modules/.pnpm/{@radix-ui_react-focus-scope@1.1.7_@types_react-dom@19.2.2_@types_react@19.2.2__@types_r_93de389b3f622f9f764acc8e59ec80c0 → @radix-ui_react-focus-scope@1.1.7_@types_react-dom@19.2.3_@types_react@19.2.6__@types_r_0a31b7f987af9482d13505312e1a1be9}/node_modules/@radix-ui/react-focus-scope/dist/index.cjs +3 -3
  13. package/dist/node_modules/.pnpm/{@radix-ui_react-focus-scope@1.1.7_@types_react-dom@19.2.2_@types_react@19.2.2__@types_r_93de389b3f622f9f764acc8e59ec80c0 → @radix-ui_react-focus-scope@1.1.7_@types_react-dom@19.2.3_@types_react@19.2.6__@types_r_0a31b7f987af9482d13505312e1a1be9}/node_modules/@radix-ui/react-focus-scope/dist/index.mjs +3 -3
  14. package/dist/node_modules/.pnpm/{@radix-ui_react-id@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-id@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-id/dist/index.cjs +1 -1
  15. package/dist/node_modules/.pnpm/{@radix-ui_react-id@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-id@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-id/dist/index.mjs +1 -1
  16. package/dist/node_modules/.pnpm/@radix-ui_react-menu@2.1.16_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@1_82ed1fcd848b6984d9291a784d477cf4/node_modules/@radix-ui/react-menu/dist/index.cjs +845 -0
  17. package/dist/node_modules/.pnpm/@radix-ui_react-menu@2.1.16_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@1_82ed1fcd848b6984d9291a784d477cf4/node_modules/@radix-ui/react-menu/dist/index.mjs +799 -0
  18. package/dist/node_modules/.pnpm/{@radix-ui_react-popper@1.2.8_@types_react-dom@19.2.2_@types_react@19.2.2__@types_react@_d6285b8269ea5d6b59b300f5be279a0c → @radix-ui_react-popper@1.2.8_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@_7ac2caae1e39f9ba93d5015614525161}/node_modules/@radix-ui/react-popper/dist/index.cjs +7 -7
  19. package/dist/node_modules/.pnpm/{@radix-ui_react-popper@1.2.8_@types_react-dom@19.2.2_@types_react@19.2.2__@types_react@_d6285b8269ea5d6b59b300f5be279a0c → @radix-ui_react-popper@1.2.8_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@_7ac2caae1e39f9ba93d5015614525161}/node_modules/@radix-ui/react-popper/dist/index.mjs +7 -7
  20. package/dist/node_modules/.pnpm/{@radix-ui_react-portal@1.1.9_@types_react-dom@19.2.2_@types_react@19.2.2__@types_react@_478b3d5dd4afab1a3dcce7ed1748cb95 → @radix-ui_react-portal@1.1.9_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@_1bb4e0f97f86496802d28a2e74e2a8b9}/node_modules/@radix-ui/react-portal/dist/index.cjs +2 -2
  21. package/dist/node_modules/.pnpm/{@radix-ui_react-portal@1.1.9_@types_react-dom@19.2.2_@types_react@19.2.2__@types_react@_478b3d5dd4afab1a3dcce7ed1748cb95 → @radix-ui_react-portal@1.1.9_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@_1bb4e0f97f86496802d28a2e74e2a8b9}/node_modules/@radix-ui/react-portal/dist/index.mjs +2 -2
  22. package/dist/node_modules/.pnpm/@radix-ui_react-presence@1.1.5_@types_react-dom@19.2.3_@types_react@19.2.6__@types_reac_90f8e5c12233caef3399d5fd66452a13/node_modules/@radix-ui/react-presence/dist/index.cjs +147 -0
  23. package/dist/node_modules/.pnpm/@radix-ui_react-presence@1.1.5_@types_react-dom@19.2.3_@types_react@19.2.6__@types_reac_90f8e5c12233caef3399d5fd66452a13/node_modules/@radix-ui/react-presence/dist/index.mjs +131 -0
  24. package/dist/node_modules/.pnpm/@radix-ui_react-roving-focus@1.1.11_@types_react-dom@19.2.3_@types_react@19.2.6__@types_fe1151d1f393bbc1072b24a86dff3a23/node_modules/@radix-ui/react-roving-focus/dist/index.cjs +244 -0
  25. package/dist/node_modules/.pnpm/@radix-ui_react-roving-focus@1.1.11_@types_react-dom@19.2.3_@types_react@19.2.6__@types_fe1151d1f393bbc1072b24a86dff3a23/node_modules/@radix-ui/react-roving-focus/dist/index.mjs +224 -0
  26. package/dist/node_modules/.pnpm/@radix-ui_react-scroll-area@1.2.10_@types_react-dom@19.2.3_@types_react@19.2.6__@types__e3f7735e9b444a10b3bbfd9fe97d44d0/node_modules/@radix-ui/react-scroll-area/dist/index.cjs +742 -0
  27. package/dist/node_modules/.pnpm/@radix-ui_react-scroll-area@1.2.10_@types_react-dom@19.2.3_@types_react@19.2.6__@types__e3f7735e9b444a10b3bbfd9fe97d44d0/node_modules/@radix-ui/react-scroll-area/dist/index.mjs +719 -0
  28. package/dist/node_modules/.pnpm/{@radix-ui_react-select@2.2.6_@types_react-dom@19.2.2_@types_react@19.2.2__@types_react@_802c3d414c85063bee785fcc98a39c07 → @radix-ui_react-select@2.2.6_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@_38dc681bb1f2bcfeb5249d8ca2bc01f5}/node_modules/@radix-ui/react-select/dist/index.cjs +17 -17
  29. package/dist/node_modules/.pnpm/{@radix-ui_react-select@2.2.6_@types_react-dom@19.2.2_@types_react@19.2.2__@types_react@_802c3d414c85063bee785fcc98a39c07 → @radix-ui_react-select@2.2.6_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@_38dc681bb1f2bcfeb5249d8ca2bc01f5}/node_modules/@radix-ui/react-select/dist/index.mjs +17 -17
  30. package/dist/node_modules/.pnpm/{@radix-ui_react-use-controllable-state@1.2.2_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-controllable-state@1.2.2_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-controllable-state/dist/index.cjs +1 -1
  31. package/dist/node_modules/.pnpm/{@radix-ui_react-use-controllable-state@1.2.2_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-controllable-state@1.2.2_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs +1 -1
  32. package/dist/node_modules/.pnpm/{@radix-ui_react-use-escape-keydown@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-escape-keydown@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-escape-keydown/dist/index.cjs +1 -1
  33. package/dist/node_modules/.pnpm/{@radix-ui_react-use-escape-keydown@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-escape-keydown@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs +1 -1
  34. package/dist/node_modules/.pnpm/{@radix-ui_react-use-size@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-size@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-size/dist/index.cjs +1 -1
  35. package/dist/node_modules/.pnpm/{@radix-ui_react-use-size@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-size@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-size/dist/index.mjs +1 -1
  36. package/dist/node_modules/.pnpm/{@radix-ui_react-visually-hidden@1.2.3_@types_react-dom@19.2.2_@types_react@19.2.2__@typ_a84e98a44624c31e835a98d4b8b0c30d → @radix-ui_react-visually-hidden@1.2.3_@types_react-dom@19.2.3_@types_react@19.2.6__@typ_f453379bbd5a4932ec515167f81be42a}/node_modules/@radix-ui/react-visually-hidden/dist/index.cjs +1 -1
  37. package/dist/node_modules/.pnpm/{@radix-ui_react-visually-hidden@1.2.3_@types_react-dom@19.2.2_@types_react@19.2.2__@typ_a84e98a44624c31e835a98d4b8b0c30d → @radix-ui_react-visually-hidden@1.2.3_@types_react-dom@19.2.3_@types_react@19.2.6__@typ_f453379bbd5a4932ec515167f81be42a}/node_modules/@radix-ui/react-visually-hidden/dist/index.mjs +1 -1
  38. package/dist/node_modules/.pnpm/{react-remove-scroll-bar@2.3.8_@types_react@19.2.2_react@19.2.0 → react-remove-scroll-bar@2.3.8_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll-bar/dist/es2015/component.cjs +1 -1
  39. package/dist/node_modules/.pnpm/{react-remove-scroll-bar@2.3.8_@types_react@19.2.2_react@19.2.0 → react-remove-scroll-bar@2.3.8_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll-bar/dist/es2015/component.mjs +1 -1
  40. package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/SideEffect.cjs +2 -2
  41. package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/SideEffect.mjs +2 -2
  42. package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/UI.cjs +2 -2
  43. package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/UI.mjs +2 -2
  44. package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/medium.cjs +1 -1
  45. package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/medium.mjs +1 -1
  46. package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/sidecar.cjs +9 -0
  47. package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/sidecar.mjs +1 -1
  48. package/dist/packages/better-stack/src/plugins/ai-chat/api/plugin.cjs +610 -0
  49. package/dist/packages/better-stack/src/plugins/ai-chat/api/plugin.mjs +608 -0
  50. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-input.cjs +221 -0
  51. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-input.mjs +219 -0
  52. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-interface.cjs +315 -0
  53. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-interface.mjs +313 -0
  54. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-layout.cjs +122 -0
  55. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-layout.mjs +120 -0
  56. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-message.cjs +397 -0
  57. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-message.mjs +391 -0
  58. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-sidebar.cjs +227 -0
  59. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-sidebar.mjs +225 -0
  60. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/loading/chat-page-skeleton.cjs +31 -0
  61. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/loading/chat-page-skeleton.mjs +29 -0
  62. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/loading/index.cjs +11 -0
  63. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/loading/index.mjs +8 -0
  64. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/pages/404-page.cjs +18 -0
  65. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/pages/404-page.mjs +16 -0
  66. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/pages/chat-page.cjs +39 -0
  67. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/pages/chat-page.internal.cjs +22 -0
  68. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/pages/chat-page.internal.mjs +20 -0
  69. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/pages/chat-page.mjs +37 -0
  70. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/shared/default-error.cjs +18 -0
  71. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/shared/default-error.mjs +16 -0
  72. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/shared/error-placeholder.cjs +26 -0
  73. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/shared/error-placeholder.mjs +24 -0
  74. package/dist/packages/better-stack/src/plugins/ai-chat/client/hooks/chat-hooks.cjs +199 -0
  75. package/dist/packages/better-stack/src/plugins/ai-chat/client/hooks/chat-hooks.mjs +191 -0
  76. package/dist/packages/better-stack/src/plugins/ai-chat/client/localization/index.cjs +63 -0
  77. package/dist/packages/better-stack/src/plugins/ai-chat/client/localization/index.mjs +61 -0
  78. package/dist/packages/better-stack/src/plugins/ai-chat/client/overrides.cjs +14 -0
  79. package/dist/packages/better-stack/src/plugins/ai-chat/client/overrides.mjs +11 -0
  80. package/dist/packages/better-stack/src/plugins/ai-chat/client/plugin.cjs +241 -0
  81. package/dist/packages/better-stack/src/plugins/ai-chat/client/plugin.mjs +239 -0
  82. package/dist/packages/better-stack/src/plugins/ai-chat/db.cjs +65 -0
  83. package/dist/packages/better-stack/src/plugins/ai-chat/db.mjs +63 -0
  84. package/dist/packages/better-stack/src/plugins/ai-chat/schemas.cjs +42 -0
  85. package/dist/packages/better-stack/src/plugins/ai-chat/schemas.mjs +38 -0
  86. package/dist/packages/better-stack/src/plugins/blog/client/components/shared/markdown-content.cjs +12 -309
  87. package/dist/packages/better-stack/src/plugins/blog/client/components/shared/markdown-content.mjs +13 -303
  88. package/dist/packages/better-stack/src/plugins/blog/client/components/shared/page-wrapper.cjs +2 -2
  89. package/dist/packages/better-stack/src/plugins/blog/client/components/shared/page-wrapper.mjs +2 -2
  90. package/dist/packages/ui/src/components/alert-dialog.cjs +1 -1
  91. package/dist/packages/ui/src/components/alert-dialog.mjs +1 -1
  92. package/dist/packages/{better-stack/src/plugins/blog/client/components/shared/better-blog-attribution.cjs → ui/src/components/better-stack-attribution.cjs} +3 -3
  93. package/dist/packages/{better-stack/src/plugins/blog/client/components/shared/better-blog-attribution.mjs → ui/src/components/better-stack-attribution.mjs} +3 -3
  94. package/dist/packages/ui/src/components/dialog.cjs +14 -0
  95. package/dist/packages/ui/src/components/dialog.mjs +14 -1
  96. package/dist/packages/ui/src/components/dropdown-menu.cjs +67 -0
  97. package/dist/packages/ui/src/components/dropdown-menu.mjs +62 -0
  98. package/dist/packages/ui/src/components/markdown-content.cjs +306 -0
  99. package/dist/packages/ui/src/components/markdown-content.mjs +297 -0
  100. package/dist/packages/ui/src/components/scroll-area.cjs +63 -0
  101. package/dist/packages/ui/src/components/scroll-area.mjs +60 -0
  102. package/dist/packages/ui/src/components/select.cjs +1 -1
  103. package/dist/packages/ui/src/components/select.mjs +1 -1
  104. package/dist/packages/ui/src/components/sheet.cjs +87 -0
  105. package/dist/packages/ui/src/components/sheet.mjs +69 -0
  106. package/dist/plugins/ai-chat/api/index.cjs +9 -0
  107. package/dist/plugins/ai-chat/api/index.d.cts +9 -0
  108. package/dist/plugins/ai-chat/api/index.d.mts +9 -0
  109. package/dist/plugins/ai-chat/api/index.d.ts +9 -0
  110. package/dist/plugins/ai-chat/api/index.mjs +2 -0
  111. package/dist/plugins/ai-chat/client/components/index.cjs +27 -0
  112. package/dist/plugins/ai-chat/client/components/index.d.cts +30 -0
  113. package/dist/plugins/ai-chat/client/components/index.d.mts +30 -0
  114. package/dist/plugins/ai-chat/client/components/index.d.ts +30 -0
  115. package/dist/plugins/ai-chat/client/components/index.mjs +11 -0
  116. package/dist/plugins/ai-chat/client/hooks/index.cjs +13 -0
  117. package/dist/plugins/ai-chat/client/hooks/index.d.cts +98 -0
  118. package/dist/plugins/ai-chat/client/hooks/index.d.mts +98 -0
  119. package/dist/plugins/ai-chat/client/hooks/index.d.ts +98 -0
  120. package/dist/plugins/ai-chat/client/hooks/index.mjs +1 -0
  121. package/dist/plugins/ai-chat/client/index.cjs +19 -0
  122. package/dist/plugins/ai-chat/client/index.d.cts +327 -0
  123. package/dist/plugins/ai-chat/client/index.d.mts +327 -0
  124. package/dist/plugins/ai-chat/client/index.d.ts +327 -0
  125. package/dist/plugins/ai-chat/client/index.mjs +7 -0
  126. package/dist/plugins/ai-chat/client.css +6 -0
  127. package/dist/plugins/ai-chat/query-keys.cjs +60 -0
  128. package/dist/plugins/ai-chat/query-keys.d.cts +478 -0
  129. package/dist/plugins/ai-chat/query-keys.d.mts +478 -0
  130. package/dist/plugins/ai-chat/query-keys.d.ts +478 -0
  131. package/dist/plugins/ai-chat/query-keys.mjs +58 -0
  132. package/dist/plugins/ai-chat/style.css +19 -0
  133. package/dist/plugins/blog/api/index.d.cts +1 -1
  134. package/dist/plugins/blog/api/index.d.mts +1 -1
  135. package/dist/plugins/blog/api/index.d.ts +1 -1
  136. package/dist/plugins/blog/client/components/shared/markdown-content-styles.css +85 -62
  137. package/dist/plugins/blog/client/hooks/index.d.cts +4 -4
  138. package/dist/plugins/blog/client/hooks/index.d.mts +4 -4
  139. package/dist/plugins/blog/client/hooks/index.d.ts +4 -4
  140. package/dist/plugins/blog/client/index.d.cts +1 -1
  141. package/dist/plugins/blog/client/index.d.mts +1 -1
  142. package/dist/plugins/blog/client/index.d.ts +1 -1
  143. package/dist/plugins/blog/query-keys.d.cts +7 -7
  144. package/dist/plugins/blog/query-keys.d.mts +7 -7
  145. package/dist/plugins/blog/query-keys.d.ts +7 -7
  146. package/dist/shared/stack.Be1QIHEn.d.cts +23 -0
  147. package/dist/shared/stack.Be1QIHEn.d.mts +23 -0
  148. package/dist/shared/stack.Be1QIHEn.d.ts +23 -0
  149. package/dist/shared/stack.DorMi9CZ.d.cts +80 -0
  150. package/dist/shared/stack.DorMi9CZ.d.mts +80 -0
  151. package/dist/shared/stack.DorMi9CZ.d.ts +80 -0
  152. package/package.json +59 -1
  153. package/src/plugins/ai-chat/api/index.ts +2 -0
  154. package/src/plugins/ai-chat/api/plugin.ts +1083 -0
  155. package/src/plugins/ai-chat/client/components/chat-input.tsx +295 -0
  156. package/src/plugins/ai-chat/client/components/chat-interface.tsx +455 -0
  157. package/src/plugins/ai-chat/client/components/chat-layout.tsx +160 -0
  158. package/src/plugins/ai-chat/client/components/chat-message.tsx +505 -0
  159. package/src/plugins/ai-chat/client/components/chat-sidebar.tsx +296 -0
  160. package/src/plugins/ai-chat/client/components/index.ts +16 -0
  161. package/src/plugins/ai-chat/client/components/loading/chat-page-skeleton.tsx +57 -0
  162. package/src/plugins/ai-chat/client/components/loading/index.tsx +11 -0
  163. package/src/plugins/ai-chat/client/components/pages/404-page.tsx +27 -0
  164. package/src/plugins/ai-chat/client/components/pages/chat-page.internal.tsx +31 -0
  165. package/src/plugins/ai-chat/client/components/pages/chat-page.tsx +46 -0
  166. package/src/plugins/ai-chat/client/components/shared/default-error.tsx +28 -0
  167. package/src/plugins/ai-chat/client/components/shared/error-placeholder.tsx +22 -0
  168. package/src/plugins/ai-chat/client/hooks/chat-hooks.tsx +349 -0
  169. package/src/plugins/ai-chat/client/hooks/index.tsx +1 -0
  170. package/src/plugins/ai-chat/client/index.ts +14 -0
  171. package/src/plugins/ai-chat/client/localization/index.ts +156 -0
  172. package/src/plugins/ai-chat/client/overrides.ts +170 -0
  173. package/src/plugins/ai-chat/client/plugin.tsx +449 -0
  174. package/src/plugins/ai-chat/client.css +6 -0
  175. package/src/plugins/ai-chat/db.ts +65 -0
  176. package/src/plugins/ai-chat/query-keys.ts +87 -0
  177. package/src/plugins/ai-chat/schemas.ts +40 -0
  178. package/src/plugins/ai-chat/style.css +19 -0
  179. package/src/plugins/ai-chat/types.ts +29 -0
  180. package/src/plugins/blog/client/components/shared/markdown-content-styles.css +85 -62
  181. package/src/plugins/blog/client/components/shared/markdown-content.tsx +19 -427
  182. package/src/plugins/blog/client/components/shared/page-wrapper.tsx +2 -2
  183. package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/sidecar.cjs +0 -9
  184. package/src/plugins/blog/client/components/shared/better-blog-attribution.tsx +0 -19
  185. package/dist/node_modules/.pnpm/{@radix-ui_react-compose-refs@1.1.2_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-compose-refs@1.1.2_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-compose-refs/dist/index.cjs +0 -0
  186. package/dist/node_modules/.pnpm/{@radix-ui_react-compose-refs@1.1.2_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-compose-refs@1.1.2_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-compose-refs/dist/index.mjs +0 -0
  187. package/dist/node_modules/.pnpm/{@radix-ui_react-context@1.1.2_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-context@1.1.2_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-context/dist/index.cjs +0 -0
  188. package/dist/node_modules/.pnpm/{@radix-ui_react-context@1.1.2_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-context@1.1.2_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-context/dist/index.mjs +0 -0
  189. package/dist/node_modules/.pnpm/{@radix-ui_react-direction@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-direction@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-direction/dist/index.cjs +0 -0
  190. package/dist/node_modules/.pnpm/{@radix-ui_react-direction@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-direction@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-direction/dist/index.mjs +0 -0
  191. package/dist/node_modules/.pnpm/{@radix-ui_react-focus-guards@1.1.3_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-focus-guards@1.1.3_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-focus-guards/dist/index.cjs +0 -0
  192. package/dist/node_modules/.pnpm/{@radix-ui_react-focus-guards@1.1.3_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-focus-guards@1.1.3_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-focus-guards/dist/index.mjs +0 -0
  193. package/dist/node_modules/.pnpm/{@radix-ui_react-primitive@2.1.3_@types_react-dom@19.2.2_@types_react@19.2.2__@types_rea_bdc15f10281778271ffcbe8dd3cd491e → @radix-ui_react-primitive@2.1.3_@types_react-dom@19.2.3_@types_react@19.2.6__@types_rea_a92a69cb1cb39305138539e4fa72f596}/node_modules/@radix-ui/react-primitive/dist/index.cjs +0 -0
  194. package/dist/node_modules/.pnpm/{@radix-ui_react-primitive@2.1.3_@types_react-dom@19.2.2_@types_react@19.2.2__@types_rea_bdc15f10281778271ffcbe8dd3cd491e → @radix-ui_react-primitive@2.1.3_@types_react-dom@19.2.3_@types_react@19.2.6__@types_rea_a92a69cb1cb39305138539e4fa72f596}/node_modules/@radix-ui/react-primitive/dist/index.mjs +0 -0
  195. package/dist/node_modules/.pnpm/{@radix-ui_react-use-callback-ref@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-callback-ref@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs +0 -0
  196. package/dist/node_modules/.pnpm/{@radix-ui_react-use-callback-ref@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-callback-ref@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs +0 -0
  197. package/dist/node_modules/.pnpm/{@radix-ui_react-use-layout-effect@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-layout-effect@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-layout-effect/dist/index.cjs +0 -0
  198. package/dist/node_modules/.pnpm/{@radix-ui_react-use-layout-effect@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-layout-effect@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs +0 -0
  199. package/dist/node_modules/.pnpm/{@radix-ui_react-use-previous@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-previous@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-previous/dist/index.cjs +0 -0
  200. package/dist/node_modules/.pnpm/{@radix-ui_react-use-previous@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-previous@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-previous/dist/index.mjs +0 -0
  201. package/dist/node_modules/.pnpm/{react-remove-scroll-bar@2.3.8_@types_react@19.2.2_react@19.2.0 → react-remove-scroll-bar@2.3.8_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll-bar/dist/es2015/constants.cjs +0 -0
  202. package/dist/node_modules/.pnpm/{react-remove-scroll-bar@2.3.8_@types_react@19.2.2_react@19.2.0 → react-remove-scroll-bar@2.3.8_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll-bar/dist/es2015/constants.mjs +0 -0
  203. package/dist/node_modules/.pnpm/{react-remove-scroll-bar@2.3.8_@types_react@19.2.2_react@19.2.0 → react-remove-scroll-bar@2.3.8_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll-bar/dist/es2015/utils.cjs +0 -0
  204. package/dist/node_modules/.pnpm/{react-remove-scroll-bar@2.3.8_@types_react@19.2.2_react@19.2.0 → react-remove-scroll-bar@2.3.8_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll-bar/dist/es2015/utils.mjs +0 -0
  205. package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/Combination.cjs +0 -0
  206. package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/Combination.mjs +0 -0
  207. package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.cjs +0 -0
  208. package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.mjs +0 -0
  209. package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/handleScroll.cjs +0 -0
  210. package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/handleScroll.mjs +0 -0
  211. package/dist/node_modules/.pnpm/{react-style-singleton@2.2.3_@types_react@19.2.2_react@19.2.0 → react-style-singleton@2.2.3_@types_react@19.2.6_react@19.2.0}/node_modules/react-style-singleton/dist/es2015/component.cjs +0 -0
  212. package/dist/node_modules/.pnpm/{react-style-singleton@2.2.3_@types_react@19.2.2_react@19.2.0 → react-style-singleton@2.2.3_@types_react@19.2.6_react@19.2.0}/node_modules/react-style-singleton/dist/es2015/component.mjs +0 -0
  213. package/dist/node_modules/.pnpm/{react-style-singleton@2.2.3_@types_react@19.2.2_react@19.2.0 → react-style-singleton@2.2.3_@types_react@19.2.6_react@19.2.0}/node_modules/react-style-singleton/dist/es2015/hook.cjs +0 -0
  214. package/dist/node_modules/.pnpm/{react-style-singleton@2.2.3_@types_react@19.2.2_react@19.2.0 → react-style-singleton@2.2.3_@types_react@19.2.6_react@19.2.0}/node_modules/react-style-singleton/dist/es2015/hook.mjs +0 -0
  215. package/dist/node_modules/.pnpm/{react-style-singleton@2.2.3_@types_react@19.2.2_react@19.2.0 → react-style-singleton@2.2.3_@types_react@19.2.6_react@19.2.0}/node_modules/react-style-singleton/dist/es2015/singleton.cjs +0 -0
  216. package/dist/node_modules/.pnpm/{react-style-singleton@2.2.3_@types_react@19.2.2_react@19.2.0 → react-style-singleton@2.2.3_@types_react@19.2.6_react@19.2.0}/node_modules/react-style-singleton/dist/es2015/singleton.mjs +0 -0
  217. package/dist/node_modules/.pnpm/{use-callback-ref@1.3.3_@types_react@19.2.2_react@19.2.0 → use-callback-ref@1.3.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-callback-ref/dist/es2015/assignRef.cjs +0 -0
  218. package/dist/node_modules/.pnpm/{use-callback-ref@1.3.3_@types_react@19.2.2_react@19.2.0 → use-callback-ref@1.3.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-callback-ref/dist/es2015/assignRef.mjs +0 -0
  219. package/dist/node_modules/.pnpm/{use-callback-ref@1.3.3_@types_react@19.2.2_react@19.2.0 → use-callback-ref@1.3.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-callback-ref/dist/es2015/useMergeRef.cjs +0 -0
  220. package/dist/node_modules/.pnpm/{use-callback-ref@1.3.3_@types_react@19.2.2_react@19.2.0 → use-callback-ref@1.3.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-callback-ref/dist/es2015/useMergeRef.mjs +0 -0
  221. package/dist/node_modules/.pnpm/{use-callback-ref@1.3.3_@types_react@19.2.2_react@19.2.0 → use-callback-ref@1.3.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-callback-ref/dist/es2015/useRef.cjs +0 -0
  222. package/dist/node_modules/.pnpm/{use-callback-ref@1.3.3_@types_react@19.2.2_react@19.2.0 → use-callback-ref@1.3.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-callback-ref/dist/es2015/useRef.mjs +0 -0
  223. package/dist/node_modules/.pnpm/{use-sidecar@1.1.3_@types_react@19.2.2_react@19.2.0 → use-sidecar@1.1.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-sidecar/dist/es2015/exports.cjs +0 -0
  224. package/dist/node_modules/.pnpm/{use-sidecar@1.1.3_@types_react@19.2.2_react@19.2.0 → use-sidecar@1.1.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-sidecar/dist/es2015/exports.mjs +0 -0
  225. package/dist/node_modules/.pnpm/{use-sidecar@1.1.3_@types_react@19.2.2_react@19.2.0 → use-sidecar@1.1.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-sidecar/dist/es2015/medium.cjs +0 -0
  226. package/dist/node_modules/.pnpm/{use-sidecar@1.1.3_@types_react@19.2.2_react@19.2.0 → use-sidecar@1.1.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-sidecar/dist/es2015/medium.mjs +0 -0
  227. package/dist/shared/{stack.CbuN2zVV.d.ts → stack.CcI4sYJP.d.cts} +3 -3
  228. package/dist/shared/{stack.CbuN2zVV.d.cts → stack.CcI4sYJP.d.mts} +3 -3
  229. package/dist/shared/{stack.CbuN2zVV.d.mts → stack.CcI4sYJP.d.ts} +3 -3
@@ -0,0 +1,845 @@
1
+ "use client";
2
+ 'use strict';
3
+
4
+ const React = require('react');
5
+ const index$9 = require('../../../../../@radix-ui_primitive@1.1.3/node_modules/@radix-ui/primitive/dist/index.cjs');
6
+ const index$1 = require('../../../../../@radix-ui_react-collection@1.1.7_@types_react-dom@19.2.3_@types_react@19.2.6__@types_re_59aa5e150e70a3e7bfb1567148b021b5/node_modules/@radix-ui/react-collection/dist/index.cjs');
7
+ const index$8 = require('../../../../../@radix-ui_react-compose-refs@1.1.2_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-compose-refs/dist/index.cjs');
8
+ const index = require('../../../../../@radix-ui_react-context@1.1.2_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-context/dist/index.cjs');
9
+ const index$5 = require('../../../../../@radix-ui_react-direction@1.1.1_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-direction/dist/index.cjs');
10
+ const index$e = require('../../../../../@radix-ui_react-dismissable-layer@1.1.11_@types_react-dom@19.2.3_@types_react@19.2.6__@_9ee1db7daf927866cf505b31d40047ad/node_modules/@radix-ui/react-dismissable-layer/dist/index.cjs');
11
+ const index$c = require('../../../../../@radix-ui_react-focus-guards@1.1.3_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-focus-guards/dist/index.cjs');
12
+ const index$d = require('../../../../../@radix-ui_react-focus-scope@1.1.7_@types_react-dom@19.2.3_@types_react@19.2.6__@types_r_0a31b7f987af9482d13505312e1a1be9/node_modules/@radix-ui/react-focus-scope/dist/index.cjs');
13
+ const index$2 = require('../../../../../@radix-ui_react-popper@1.2.8_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@_7ac2caae1e39f9ba93d5015614525161/node_modules/@radix-ui/react-popper/dist/index.cjs');
14
+ const index$7 = require('../../../../../@radix-ui_react-portal@1.1.9_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@_1bb4e0f97f86496802d28a2e74e2a8b9/node_modules/@radix-ui/react-portal/dist/index.cjs');
15
+ const index$6 = require('../../../../../@radix-ui_react-presence@1.1.5_@types_react-dom@19.2.3_@types_react@19.2.6__@types_reac_90f8e5c12233caef3399d5fd66452a13/node_modules/@radix-ui/react-presence/dist/index.cjs');
16
+ const index$b = require('../../../../../@radix-ui_react-primitive@2.1.3_@types_react-dom@19.2.3_@types_react@19.2.6__@types_rea_a92a69cb1cb39305138539e4fa72f596/node_modules/@radix-ui/react-primitive/dist/index.cjs');
17
+ const index$3 = require('../../../../../@radix-ui_react-roving-focus@1.1.11_@types_react-dom@19.2.3_@types_react@19.2.6__@types_fe1151d1f393bbc1072b24a86dff3a23/node_modules/@radix-ui/react-roving-focus/dist/index.cjs');
18
+ const reactSlot = require('@radix-ui/react-slot');
19
+ const index$4 = require('../../../../../@radix-ui_react-use-callback-ref@1.1.1_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs');
20
+ const index$a = require('../../../../../aria-hidden@1.2.6/node_modules/aria-hidden/dist/es2015/index.cjs');
21
+ const Combination = require('../../../../../react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/Combination.cjs');
22
+ const jsxRuntime = require('react/jsx-runtime');
23
+
24
+ function _interopNamespaceCompat(e) {
25
+ if (e && typeof e === 'object' && 'default' in e) return e;
26
+ const n = Object.create(null);
27
+ if (e) {
28
+ for (const k in e) {
29
+ n[k] = e[k];
30
+ }
31
+ }
32
+ n.default = e;
33
+ return n;
34
+ }
35
+
36
+ const React__namespace = /*#__PURE__*/_interopNamespaceCompat(React);
37
+
38
+ var SELECTION_KEYS = ["Enter", " "];
39
+ var FIRST_KEYS = ["ArrowDown", "PageUp", "Home"];
40
+ var LAST_KEYS = ["ArrowUp", "PageDown", "End"];
41
+ var FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS];
42
+ var SUB_OPEN_KEYS = {
43
+ ltr: [...SELECTION_KEYS, "ArrowRight"],
44
+ rtl: [...SELECTION_KEYS, "ArrowLeft"]
45
+ };
46
+ var SUB_CLOSE_KEYS = {
47
+ ltr: ["ArrowLeft"],
48
+ rtl: ["ArrowRight"]
49
+ };
50
+ var MENU_NAME = "Menu";
51
+ var [Collection, useCollection, createCollectionScope] = index$1.createCollection(MENU_NAME);
52
+ var [createMenuContext, createMenuScope] = index.createContextScope(MENU_NAME, [
53
+ createCollectionScope,
54
+ index$2.createPopperScope,
55
+ index$3.createRovingFocusGroupScope
56
+ ]);
57
+ var usePopperScope = index$2.createPopperScope();
58
+ var useRovingFocusGroupScope = index$3.createRovingFocusGroupScope();
59
+ var [MenuProvider, useMenuContext] = createMenuContext(MENU_NAME);
60
+ var [MenuRootProvider, useMenuRootContext] = createMenuContext(MENU_NAME);
61
+ var Menu = (props) => {
62
+ const { __scopeMenu, open = false, children, dir, onOpenChange, modal = true } = props;
63
+ const popperScope = usePopperScope(__scopeMenu);
64
+ const [content, setContent] = React__namespace.useState(null);
65
+ const isUsingKeyboardRef = React__namespace.useRef(false);
66
+ const handleOpenChange = index$4.useCallbackRef(onOpenChange);
67
+ const direction = index$5.useDirection(dir);
68
+ React__namespace.useEffect(() => {
69
+ const handleKeyDown = () => {
70
+ isUsingKeyboardRef.current = true;
71
+ document.addEventListener("pointerdown", handlePointer, { capture: true, once: true });
72
+ document.addEventListener("pointermove", handlePointer, { capture: true, once: true });
73
+ };
74
+ const handlePointer = () => isUsingKeyboardRef.current = false;
75
+ document.addEventListener("keydown", handleKeyDown, { capture: true });
76
+ return () => {
77
+ document.removeEventListener("keydown", handleKeyDown, { capture: true });
78
+ document.removeEventListener("pointerdown", handlePointer, { capture: true });
79
+ document.removeEventListener("pointermove", handlePointer, { capture: true });
80
+ };
81
+ }, []);
82
+ return /* @__PURE__ */ jsxRuntime.jsx(index$2.Root, { ...popperScope, children: /* @__PURE__ */ jsxRuntime.jsx(
83
+ MenuProvider,
84
+ {
85
+ scope: __scopeMenu,
86
+ open,
87
+ onOpenChange: handleOpenChange,
88
+ content,
89
+ onContentChange: setContent,
90
+ children: /* @__PURE__ */ jsxRuntime.jsx(
91
+ MenuRootProvider,
92
+ {
93
+ scope: __scopeMenu,
94
+ onClose: React__namespace.useCallback(() => handleOpenChange(false), [handleOpenChange]),
95
+ isUsingKeyboardRef,
96
+ dir: direction,
97
+ modal,
98
+ children
99
+ }
100
+ )
101
+ }
102
+ ) });
103
+ };
104
+ Menu.displayName = MENU_NAME;
105
+ var ANCHOR_NAME = "MenuAnchor";
106
+ var MenuAnchor = React__namespace.forwardRef(
107
+ (props, forwardedRef) => {
108
+ const { __scopeMenu, ...anchorProps } = props;
109
+ const popperScope = usePopperScope(__scopeMenu);
110
+ return /* @__PURE__ */ jsxRuntime.jsx(index$2.Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });
111
+ }
112
+ );
113
+ MenuAnchor.displayName = ANCHOR_NAME;
114
+ var PORTAL_NAME = "MenuPortal";
115
+ var [PortalProvider, usePortalContext] = createMenuContext(PORTAL_NAME, {
116
+ forceMount: void 0
117
+ });
118
+ var MenuPortal = (props) => {
119
+ const { __scopeMenu, forceMount, children, container } = props;
120
+ const context = useMenuContext(PORTAL_NAME, __scopeMenu);
121
+ return /* @__PURE__ */ jsxRuntime.jsx(PortalProvider, { scope: __scopeMenu, forceMount, children: /* @__PURE__ */ jsxRuntime.jsx(index$6.Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsxRuntime.jsx(index$7.Portal, { asChild: true, container, children }) }) });
122
+ };
123
+ MenuPortal.displayName = PORTAL_NAME;
124
+ var CONTENT_NAME = "MenuContent";
125
+ var [MenuContentProvider, useMenuContentContext] = createMenuContext(CONTENT_NAME);
126
+ var MenuContent = React__namespace.forwardRef(
127
+ (props, forwardedRef) => {
128
+ const portalContext = usePortalContext(CONTENT_NAME, props.__scopeMenu);
129
+ const { forceMount = portalContext.forceMount, ...contentProps } = props;
130
+ const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);
131
+ const rootContext = useMenuRootContext(CONTENT_NAME, props.__scopeMenu);
132
+ return /* @__PURE__ */ jsxRuntime.jsx(Collection.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsxRuntime.jsx(index$6.Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsxRuntime.jsx(Collection.Slot, { scope: props.__scopeMenu, children: rootContext.modal ? /* @__PURE__ */ jsxRuntime.jsx(MenuRootContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsxRuntime.jsx(MenuRootContentNonModal, { ...contentProps, ref: forwardedRef }) }) }) });
133
+ }
134
+ );
135
+ var MenuRootContentModal = React__namespace.forwardRef(
136
+ (props, forwardedRef) => {
137
+ const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);
138
+ const ref = React__namespace.useRef(null);
139
+ const composedRefs = index$8.useComposedRefs(forwardedRef, ref);
140
+ React__namespace.useEffect(() => {
141
+ const content = ref.current;
142
+ if (content) return index$a.hideOthers(content);
143
+ }, []);
144
+ return /* @__PURE__ */ jsxRuntime.jsx(
145
+ MenuContentImpl,
146
+ {
147
+ ...props,
148
+ ref: composedRefs,
149
+ trapFocus: context.open,
150
+ disableOutsidePointerEvents: context.open,
151
+ disableOutsideScroll: true,
152
+ onFocusOutside: index$9.composeEventHandlers(
153
+ props.onFocusOutside,
154
+ (event) => event.preventDefault(),
155
+ { checkForDefaultPrevented: false }
156
+ ),
157
+ onDismiss: () => context.onOpenChange(false)
158
+ }
159
+ );
160
+ }
161
+ );
162
+ var MenuRootContentNonModal = React__namespace.forwardRef((props, forwardedRef) => {
163
+ const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);
164
+ return /* @__PURE__ */ jsxRuntime.jsx(
165
+ MenuContentImpl,
166
+ {
167
+ ...props,
168
+ ref: forwardedRef,
169
+ trapFocus: false,
170
+ disableOutsidePointerEvents: false,
171
+ disableOutsideScroll: false,
172
+ onDismiss: () => context.onOpenChange(false)
173
+ }
174
+ );
175
+ });
176
+ var Slot = reactSlot.createSlot("MenuContent.ScrollLock");
177
+ var MenuContentImpl = React__namespace.forwardRef(
178
+ (props, forwardedRef) => {
179
+ const {
180
+ __scopeMenu,
181
+ loop = false,
182
+ trapFocus,
183
+ onOpenAutoFocus,
184
+ onCloseAutoFocus,
185
+ disableOutsidePointerEvents,
186
+ onEntryFocus,
187
+ onEscapeKeyDown,
188
+ onPointerDownOutside,
189
+ onFocusOutside,
190
+ onInteractOutside,
191
+ onDismiss,
192
+ disableOutsideScroll,
193
+ ...contentProps
194
+ } = props;
195
+ const context = useMenuContext(CONTENT_NAME, __scopeMenu);
196
+ const rootContext = useMenuRootContext(CONTENT_NAME, __scopeMenu);
197
+ const popperScope = usePopperScope(__scopeMenu);
198
+ const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);
199
+ const getItems = useCollection(__scopeMenu);
200
+ const [currentItemId, setCurrentItemId] = React__namespace.useState(null);
201
+ const contentRef = React__namespace.useRef(null);
202
+ const composedRefs = index$8.useComposedRefs(forwardedRef, contentRef, context.onContentChange);
203
+ const timerRef = React__namespace.useRef(0);
204
+ const searchRef = React__namespace.useRef("");
205
+ const pointerGraceTimerRef = React__namespace.useRef(0);
206
+ const pointerGraceIntentRef = React__namespace.useRef(null);
207
+ const pointerDirRef = React__namespace.useRef("right");
208
+ const lastPointerXRef = React__namespace.useRef(0);
209
+ const ScrollLockWrapper = disableOutsideScroll ? Combination : React__namespace.Fragment;
210
+ const scrollLockWrapperProps = disableOutsideScroll ? { as: Slot, allowPinchZoom: true } : void 0;
211
+ const handleTypeaheadSearch = (key) => {
212
+ const search = searchRef.current + key;
213
+ const items = getItems().filter((item) => !item.disabled);
214
+ const currentItem = document.activeElement;
215
+ const currentMatch = items.find((item) => item.ref.current === currentItem)?.textValue;
216
+ const values = items.map((item) => item.textValue);
217
+ const nextMatch = getNextMatch(values, search, currentMatch);
218
+ const newItem = items.find((item) => item.textValue === nextMatch)?.ref.current;
219
+ (function updateSearch(value) {
220
+ searchRef.current = value;
221
+ window.clearTimeout(timerRef.current);
222
+ if (value !== "") timerRef.current = window.setTimeout(() => updateSearch(""), 1e3);
223
+ })(search);
224
+ if (newItem) {
225
+ setTimeout(() => newItem.focus());
226
+ }
227
+ };
228
+ React__namespace.useEffect(() => {
229
+ return () => window.clearTimeout(timerRef.current);
230
+ }, []);
231
+ index$c.useFocusGuards();
232
+ const isPointerMovingToSubmenu = React__namespace.useCallback((event) => {
233
+ const isMovingTowards = pointerDirRef.current === pointerGraceIntentRef.current?.side;
234
+ return isMovingTowards && isPointerInGraceArea(event, pointerGraceIntentRef.current?.area);
235
+ }, []);
236
+ return /* @__PURE__ */ jsxRuntime.jsx(
237
+ MenuContentProvider,
238
+ {
239
+ scope: __scopeMenu,
240
+ searchRef,
241
+ onItemEnter: React__namespace.useCallback(
242
+ (event) => {
243
+ if (isPointerMovingToSubmenu(event)) event.preventDefault();
244
+ },
245
+ [isPointerMovingToSubmenu]
246
+ ),
247
+ onItemLeave: React__namespace.useCallback(
248
+ (event) => {
249
+ if (isPointerMovingToSubmenu(event)) return;
250
+ contentRef.current?.focus();
251
+ setCurrentItemId(null);
252
+ },
253
+ [isPointerMovingToSubmenu]
254
+ ),
255
+ onTriggerLeave: React__namespace.useCallback(
256
+ (event) => {
257
+ if (isPointerMovingToSubmenu(event)) event.preventDefault();
258
+ },
259
+ [isPointerMovingToSubmenu]
260
+ ),
261
+ pointerGraceTimerRef,
262
+ onPointerGraceIntentChange: React__namespace.useCallback((intent) => {
263
+ pointerGraceIntentRef.current = intent;
264
+ }, []),
265
+ children: /* @__PURE__ */ jsxRuntime.jsx(ScrollLockWrapper, { ...scrollLockWrapperProps, children: /* @__PURE__ */ jsxRuntime.jsx(
266
+ index$d.FocusScope,
267
+ {
268
+ asChild: true,
269
+ trapped: trapFocus,
270
+ onMountAutoFocus: index$9.composeEventHandlers(onOpenAutoFocus, (event) => {
271
+ event.preventDefault();
272
+ contentRef.current?.focus({ preventScroll: true });
273
+ }),
274
+ onUnmountAutoFocus: onCloseAutoFocus,
275
+ children: /* @__PURE__ */ jsxRuntime.jsx(
276
+ index$e.DismissableLayer,
277
+ {
278
+ asChild: true,
279
+ disableOutsidePointerEvents,
280
+ onEscapeKeyDown,
281
+ onPointerDownOutside,
282
+ onFocusOutside,
283
+ onInteractOutside,
284
+ onDismiss,
285
+ children: /* @__PURE__ */ jsxRuntime.jsx(
286
+ index$3.Root,
287
+ {
288
+ asChild: true,
289
+ ...rovingFocusGroupScope,
290
+ dir: rootContext.dir,
291
+ orientation: "vertical",
292
+ loop,
293
+ currentTabStopId: currentItemId,
294
+ onCurrentTabStopIdChange: setCurrentItemId,
295
+ onEntryFocus: index$9.composeEventHandlers(onEntryFocus, (event) => {
296
+ if (!rootContext.isUsingKeyboardRef.current) event.preventDefault();
297
+ }),
298
+ preventScrollOnEntryFocus: true,
299
+ children: /* @__PURE__ */ jsxRuntime.jsx(
300
+ index$2.Content,
301
+ {
302
+ role: "menu",
303
+ "aria-orientation": "vertical",
304
+ "data-state": getOpenState(context.open),
305
+ "data-radix-menu-content": "",
306
+ dir: rootContext.dir,
307
+ ...popperScope,
308
+ ...contentProps,
309
+ ref: composedRefs,
310
+ style: { outline: "none", ...contentProps.style },
311
+ onKeyDown: index$9.composeEventHandlers(contentProps.onKeyDown, (event) => {
312
+ const target = event.target;
313
+ const isKeyDownInside = target.closest("[data-radix-menu-content]") === event.currentTarget;
314
+ const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;
315
+ const isCharacterKey = event.key.length === 1;
316
+ if (isKeyDownInside) {
317
+ if (event.key === "Tab") event.preventDefault();
318
+ if (!isModifierKey && isCharacterKey) handleTypeaheadSearch(event.key);
319
+ }
320
+ const content = contentRef.current;
321
+ if (event.target !== content) return;
322
+ if (!FIRST_LAST_KEYS.includes(event.key)) return;
323
+ event.preventDefault();
324
+ const items = getItems().filter((item) => !item.disabled);
325
+ const candidateNodes = items.map((item) => item.ref.current);
326
+ if (LAST_KEYS.includes(event.key)) candidateNodes.reverse();
327
+ focusFirst(candidateNodes);
328
+ }),
329
+ onBlur: index$9.composeEventHandlers(props.onBlur, (event) => {
330
+ if (!event.currentTarget.contains(event.target)) {
331
+ window.clearTimeout(timerRef.current);
332
+ searchRef.current = "";
333
+ }
334
+ }),
335
+ onPointerMove: index$9.composeEventHandlers(
336
+ props.onPointerMove,
337
+ whenMouse((event) => {
338
+ const target = event.target;
339
+ const pointerXHasChanged = lastPointerXRef.current !== event.clientX;
340
+ if (event.currentTarget.contains(target) && pointerXHasChanged) {
341
+ const newDir = event.clientX > lastPointerXRef.current ? "right" : "left";
342
+ pointerDirRef.current = newDir;
343
+ lastPointerXRef.current = event.clientX;
344
+ }
345
+ })
346
+ )
347
+ }
348
+ )
349
+ }
350
+ )
351
+ }
352
+ )
353
+ }
354
+ ) })
355
+ }
356
+ );
357
+ }
358
+ );
359
+ MenuContent.displayName = CONTENT_NAME;
360
+ var GROUP_NAME = "MenuGroup";
361
+ var MenuGroup = React__namespace.forwardRef(
362
+ (props, forwardedRef) => {
363
+ const { __scopeMenu, ...groupProps } = props;
364
+ return /* @__PURE__ */ jsxRuntime.jsx(index$b.Primitive.div, { role: "group", ...groupProps, ref: forwardedRef });
365
+ }
366
+ );
367
+ MenuGroup.displayName = GROUP_NAME;
368
+ var LABEL_NAME = "MenuLabel";
369
+ var MenuLabel = React__namespace.forwardRef(
370
+ (props, forwardedRef) => {
371
+ const { __scopeMenu, ...labelProps } = props;
372
+ return /* @__PURE__ */ jsxRuntime.jsx(index$b.Primitive.div, { ...labelProps, ref: forwardedRef });
373
+ }
374
+ );
375
+ MenuLabel.displayName = LABEL_NAME;
376
+ var ITEM_NAME = "MenuItem";
377
+ var ITEM_SELECT = "menu.itemSelect";
378
+ var MenuItem = React__namespace.forwardRef(
379
+ (props, forwardedRef) => {
380
+ const { disabled = false, onSelect, ...itemProps } = props;
381
+ const ref = React__namespace.useRef(null);
382
+ const rootContext = useMenuRootContext(ITEM_NAME, props.__scopeMenu);
383
+ const contentContext = useMenuContentContext(ITEM_NAME, props.__scopeMenu);
384
+ const composedRefs = index$8.useComposedRefs(forwardedRef, ref);
385
+ const isPointerDownRef = React__namespace.useRef(false);
386
+ const handleSelect = () => {
387
+ const menuItem = ref.current;
388
+ if (!disabled && menuItem) {
389
+ const itemSelectEvent = new CustomEvent(ITEM_SELECT, { bubbles: true, cancelable: true });
390
+ menuItem.addEventListener(ITEM_SELECT, (event) => onSelect?.(event), { once: true });
391
+ index$b.dispatchDiscreteCustomEvent(menuItem, itemSelectEvent);
392
+ if (itemSelectEvent.defaultPrevented) {
393
+ isPointerDownRef.current = false;
394
+ } else {
395
+ rootContext.onClose();
396
+ }
397
+ }
398
+ };
399
+ return /* @__PURE__ */ jsxRuntime.jsx(
400
+ MenuItemImpl,
401
+ {
402
+ ...itemProps,
403
+ ref: composedRefs,
404
+ disabled,
405
+ onClick: index$9.composeEventHandlers(props.onClick, handleSelect),
406
+ onPointerDown: (event) => {
407
+ props.onPointerDown?.(event);
408
+ isPointerDownRef.current = true;
409
+ },
410
+ onPointerUp: index$9.composeEventHandlers(props.onPointerUp, (event) => {
411
+ if (!isPointerDownRef.current) event.currentTarget?.click();
412
+ }),
413
+ onKeyDown: index$9.composeEventHandlers(props.onKeyDown, (event) => {
414
+ const isTypingAhead = contentContext.searchRef.current !== "";
415
+ if (disabled || isTypingAhead && event.key === " ") return;
416
+ if (SELECTION_KEYS.includes(event.key)) {
417
+ event.currentTarget.click();
418
+ event.preventDefault();
419
+ }
420
+ })
421
+ }
422
+ );
423
+ }
424
+ );
425
+ MenuItem.displayName = ITEM_NAME;
426
+ var MenuItemImpl = React__namespace.forwardRef(
427
+ (props, forwardedRef) => {
428
+ const { __scopeMenu, disabled = false, textValue, ...itemProps } = props;
429
+ const contentContext = useMenuContentContext(ITEM_NAME, __scopeMenu);
430
+ const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);
431
+ const ref = React__namespace.useRef(null);
432
+ const composedRefs = index$8.useComposedRefs(forwardedRef, ref);
433
+ const [isFocused, setIsFocused] = React__namespace.useState(false);
434
+ const [textContent, setTextContent] = React__namespace.useState("");
435
+ React__namespace.useEffect(() => {
436
+ const menuItem = ref.current;
437
+ if (menuItem) {
438
+ setTextContent((menuItem.textContent ?? "").trim());
439
+ }
440
+ }, [itemProps.children]);
441
+ return /* @__PURE__ */ jsxRuntime.jsx(
442
+ Collection.ItemSlot,
443
+ {
444
+ scope: __scopeMenu,
445
+ disabled,
446
+ textValue: textValue ?? textContent,
447
+ children: /* @__PURE__ */ jsxRuntime.jsx(index$3.Item, { asChild: true, ...rovingFocusGroupScope, focusable: !disabled, children: /* @__PURE__ */ jsxRuntime.jsx(
448
+ index$b.Primitive.div,
449
+ {
450
+ role: "menuitem",
451
+ "data-highlighted": isFocused ? "" : void 0,
452
+ "aria-disabled": disabled || void 0,
453
+ "data-disabled": disabled ? "" : void 0,
454
+ ...itemProps,
455
+ ref: composedRefs,
456
+ onPointerMove: index$9.composeEventHandlers(
457
+ props.onPointerMove,
458
+ whenMouse((event) => {
459
+ if (disabled) {
460
+ contentContext.onItemLeave(event);
461
+ } else {
462
+ contentContext.onItemEnter(event);
463
+ if (!event.defaultPrevented) {
464
+ const item = event.currentTarget;
465
+ item.focus({ preventScroll: true });
466
+ }
467
+ }
468
+ })
469
+ ),
470
+ onPointerLeave: index$9.composeEventHandlers(
471
+ props.onPointerLeave,
472
+ whenMouse((event) => contentContext.onItemLeave(event))
473
+ ),
474
+ onFocus: index$9.composeEventHandlers(props.onFocus, () => setIsFocused(true)),
475
+ onBlur: index$9.composeEventHandlers(props.onBlur, () => setIsFocused(false))
476
+ }
477
+ ) })
478
+ }
479
+ );
480
+ }
481
+ );
482
+ var CHECKBOX_ITEM_NAME = "MenuCheckboxItem";
483
+ var MenuCheckboxItem = React__namespace.forwardRef(
484
+ (props, forwardedRef) => {
485
+ const { checked = false, onCheckedChange, ...checkboxItemProps } = props;
486
+ return /* @__PURE__ */ jsxRuntime.jsx(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsxRuntime.jsx(
487
+ MenuItem,
488
+ {
489
+ role: "menuitemcheckbox",
490
+ "aria-checked": isIndeterminate(checked) ? "mixed" : checked,
491
+ ...checkboxItemProps,
492
+ ref: forwardedRef,
493
+ "data-state": getCheckedState(checked),
494
+ onSelect: index$9.composeEventHandlers(
495
+ checkboxItemProps.onSelect,
496
+ () => onCheckedChange?.(isIndeterminate(checked) ? true : !checked),
497
+ { checkForDefaultPrevented: false }
498
+ )
499
+ }
500
+ ) });
501
+ }
502
+ );
503
+ MenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;
504
+ var RADIO_GROUP_NAME = "MenuRadioGroup";
505
+ var [RadioGroupProvider, useRadioGroupContext] = createMenuContext(
506
+ RADIO_GROUP_NAME,
507
+ { value: void 0, onValueChange: () => {
508
+ } }
509
+ );
510
+ var MenuRadioGroup = React__namespace.forwardRef(
511
+ (props, forwardedRef) => {
512
+ const { value, onValueChange, ...groupProps } = props;
513
+ const handleValueChange = index$4.useCallbackRef(onValueChange);
514
+ return /* @__PURE__ */ jsxRuntime.jsx(RadioGroupProvider, { scope: props.__scopeMenu, value, onValueChange: handleValueChange, children: /* @__PURE__ */ jsxRuntime.jsx(MenuGroup, { ...groupProps, ref: forwardedRef }) });
515
+ }
516
+ );
517
+ MenuRadioGroup.displayName = RADIO_GROUP_NAME;
518
+ var RADIO_ITEM_NAME = "MenuRadioItem";
519
+ var MenuRadioItem = React__namespace.forwardRef(
520
+ (props, forwardedRef) => {
521
+ const { value, ...radioItemProps } = props;
522
+ const context = useRadioGroupContext(RADIO_ITEM_NAME, props.__scopeMenu);
523
+ const checked = value === context.value;
524
+ return /* @__PURE__ */ jsxRuntime.jsx(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsxRuntime.jsx(
525
+ MenuItem,
526
+ {
527
+ role: "menuitemradio",
528
+ "aria-checked": checked,
529
+ ...radioItemProps,
530
+ ref: forwardedRef,
531
+ "data-state": getCheckedState(checked),
532
+ onSelect: index$9.composeEventHandlers(
533
+ radioItemProps.onSelect,
534
+ () => context.onValueChange?.(value),
535
+ { checkForDefaultPrevented: false }
536
+ )
537
+ }
538
+ ) });
539
+ }
540
+ );
541
+ MenuRadioItem.displayName = RADIO_ITEM_NAME;
542
+ var ITEM_INDICATOR_NAME = "MenuItemIndicator";
543
+ var [ItemIndicatorProvider, useItemIndicatorContext] = createMenuContext(
544
+ ITEM_INDICATOR_NAME,
545
+ { checked: false }
546
+ );
547
+ var MenuItemIndicator = React__namespace.forwardRef(
548
+ (props, forwardedRef) => {
549
+ const { __scopeMenu, forceMount, ...itemIndicatorProps } = props;
550
+ const indicatorContext = useItemIndicatorContext(ITEM_INDICATOR_NAME, __scopeMenu);
551
+ return /* @__PURE__ */ jsxRuntime.jsx(
552
+ index$6.Presence,
553
+ {
554
+ present: forceMount || isIndeterminate(indicatorContext.checked) || indicatorContext.checked === true,
555
+ children: /* @__PURE__ */ jsxRuntime.jsx(
556
+ index$b.Primitive.span,
557
+ {
558
+ ...itemIndicatorProps,
559
+ ref: forwardedRef,
560
+ "data-state": getCheckedState(indicatorContext.checked)
561
+ }
562
+ )
563
+ }
564
+ );
565
+ }
566
+ );
567
+ MenuItemIndicator.displayName = ITEM_INDICATOR_NAME;
568
+ var SEPARATOR_NAME = "MenuSeparator";
569
+ var MenuSeparator = React__namespace.forwardRef(
570
+ (props, forwardedRef) => {
571
+ const { __scopeMenu, ...separatorProps } = props;
572
+ return /* @__PURE__ */ jsxRuntime.jsx(
573
+ index$b.Primitive.div,
574
+ {
575
+ role: "separator",
576
+ "aria-orientation": "horizontal",
577
+ ...separatorProps,
578
+ ref: forwardedRef
579
+ }
580
+ );
581
+ }
582
+ );
583
+ MenuSeparator.displayName = SEPARATOR_NAME;
584
+ var ARROW_NAME = "MenuArrow";
585
+ var MenuArrow = React__namespace.forwardRef(
586
+ (props, forwardedRef) => {
587
+ const { __scopeMenu, ...arrowProps } = props;
588
+ const popperScope = usePopperScope(__scopeMenu);
589
+ return /* @__PURE__ */ jsxRuntime.jsx(index$2.Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });
590
+ }
591
+ );
592
+ MenuArrow.displayName = ARROW_NAME;
593
+ var SUB_NAME = "MenuSub";
594
+ var [MenuSubProvider, useMenuSubContext] = createMenuContext(SUB_NAME);
595
+ var SUB_TRIGGER_NAME = "MenuSubTrigger";
596
+ var MenuSubTrigger = React__namespace.forwardRef(
597
+ (props, forwardedRef) => {
598
+ const context = useMenuContext(SUB_TRIGGER_NAME, props.__scopeMenu);
599
+ const rootContext = useMenuRootContext(SUB_TRIGGER_NAME, props.__scopeMenu);
600
+ const subContext = useMenuSubContext(SUB_TRIGGER_NAME, props.__scopeMenu);
601
+ const contentContext = useMenuContentContext(SUB_TRIGGER_NAME, props.__scopeMenu);
602
+ const openTimerRef = React__namespace.useRef(null);
603
+ const { pointerGraceTimerRef, onPointerGraceIntentChange } = contentContext;
604
+ const scope = { __scopeMenu: props.__scopeMenu };
605
+ const clearOpenTimer = React__namespace.useCallback(() => {
606
+ if (openTimerRef.current) window.clearTimeout(openTimerRef.current);
607
+ openTimerRef.current = null;
608
+ }, []);
609
+ React__namespace.useEffect(() => clearOpenTimer, [clearOpenTimer]);
610
+ React__namespace.useEffect(() => {
611
+ const pointerGraceTimer = pointerGraceTimerRef.current;
612
+ return () => {
613
+ window.clearTimeout(pointerGraceTimer);
614
+ onPointerGraceIntentChange(null);
615
+ };
616
+ }, [pointerGraceTimerRef, onPointerGraceIntentChange]);
617
+ return /* @__PURE__ */ jsxRuntime.jsx(MenuAnchor, { asChild: true, ...scope, children: /* @__PURE__ */ jsxRuntime.jsx(
618
+ MenuItemImpl,
619
+ {
620
+ id: subContext.triggerId,
621
+ "aria-haspopup": "menu",
622
+ "aria-expanded": context.open,
623
+ "aria-controls": subContext.contentId,
624
+ "data-state": getOpenState(context.open),
625
+ ...props,
626
+ ref: index$8.composeRefs(forwardedRef, subContext.onTriggerChange),
627
+ onClick: (event) => {
628
+ props.onClick?.(event);
629
+ if (props.disabled || event.defaultPrevented) return;
630
+ event.currentTarget.focus();
631
+ if (!context.open) context.onOpenChange(true);
632
+ },
633
+ onPointerMove: index$9.composeEventHandlers(
634
+ props.onPointerMove,
635
+ whenMouse((event) => {
636
+ contentContext.onItemEnter(event);
637
+ if (event.defaultPrevented) return;
638
+ if (!props.disabled && !context.open && !openTimerRef.current) {
639
+ contentContext.onPointerGraceIntentChange(null);
640
+ openTimerRef.current = window.setTimeout(() => {
641
+ context.onOpenChange(true);
642
+ clearOpenTimer();
643
+ }, 100);
644
+ }
645
+ })
646
+ ),
647
+ onPointerLeave: index$9.composeEventHandlers(
648
+ props.onPointerLeave,
649
+ whenMouse((event) => {
650
+ clearOpenTimer();
651
+ const contentRect = context.content?.getBoundingClientRect();
652
+ if (contentRect) {
653
+ const side = context.content?.dataset.side;
654
+ const rightSide = side === "right";
655
+ const bleed = rightSide ? -5 : 5;
656
+ const contentNearEdge = contentRect[rightSide ? "left" : "right"];
657
+ const contentFarEdge = contentRect[rightSide ? "right" : "left"];
658
+ contentContext.onPointerGraceIntentChange({
659
+ area: [
660
+ // Apply a bleed on clientX to ensure that our exit point is
661
+ // consistently within polygon bounds
662
+ { x: event.clientX + bleed, y: event.clientY },
663
+ { x: contentNearEdge, y: contentRect.top },
664
+ { x: contentFarEdge, y: contentRect.top },
665
+ { x: contentFarEdge, y: contentRect.bottom },
666
+ { x: contentNearEdge, y: contentRect.bottom }
667
+ ],
668
+ side
669
+ });
670
+ window.clearTimeout(pointerGraceTimerRef.current);
671
+ pointerGraceTimerRef.current = window.setTimeout(
672
+ () => contentContext.onPointerGraceIntentChange(null),
673
+ 300
674
+ );
675
+ } else {
676
+ contentContext.onTriggerLeave(event);
677
+ if (event.defaultPrevented) return;
678
+ contentContext.onPointerGraceIntentChange(null);
679
+ }
680
+ })
681
+ ),
682
+ onKeyDown: index$9.composeEventHandlers(props.onKeyDown, (event) => {
683
+ const isTypingAhead = contentContext.searchRef.current !== "";
684
+ if (props.disabled || isTypingAhead && event.key === " ") return;
685
+ if (SUB_OPEN_KEYS[rootContext.dir].includes(event.key)) {
686
+ context.onOpenChange(true);
687
+ context.content?.focus();
688
+ event.preventDefault();
689
+ }
690
+ })
691
+ }
692
+ ) });
693
+ }
694
+ );
695
+ MenuSubTrigger.displayName = SUB_TRIGGER_NAME;
696
+ var SUB_CONTENT_NAME = "MenuSubContent";
697
+ var MenuSubContent = React__namespace.forwardRef(
698
+ (props, forwardedRef) => {
699
+ const portalContext = usePortalContext(CONTENT_NAME, props.__scopeMenu);
700
+ const { forceMount = portalContext.forceMount, ...subContentProps } = props;
701
+ const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);
702
+ const rootContext = useMenuRootContext(CONTENT_NAME, props.__scopeMenu);
703
+ const subContext = useMenuSubContext(SUB_CONTENT_NAME, props.__scopeMenu);
704
+ const ref = React__namespace.useRef(null);
705
+ const composedRefs = index$8.useComposedRefs(forwardedRef, ref);
706
+ return /* @__PURE__ */ jsxRuntime.jsx(Collection.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsxRuntime.jsx(index$6.Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsxRuntime.jsx(Collection.Slot, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsxRuntime.jsx(
707
+ MenuContentImpl,
708
+ {
709
+ id: subContext.contentId,
710
+ "aria-labelledby": subContext.triggerId,
711
+ ...subContentProps,
712
+ ref: composedRefs,
713
+ align: "start",
714
+ side: rootContext.dir === "rtl" ? "left" : "right",
715
+ disableOutsidePointerEvents: false,
716
+ disableOutsideScroll: false,
717
+ trapFocus: false,
718
+ onOpenAutoFocus: (event) => {
719
+ if (rootContext.isUsingKeyboardRef.current) ref.current?.focus();
720
+ event.preventDefault();
721
+ },
722
+ onCloseAutoFocus: (event) => event.preventDefault(),
723
+ onFocusOutside: index$9.composeEventHandlers(props.onFocusOutside, (event) => {
724
+ if (event.target !== subContext.trigger) context.onOpenChange(false);
725
+ }),
726
+ onEscapeKeyDown: index$9.composeEventHandlers(props.onEscapeKeyDown, (event) => {
727
+ rootContext.onClose();
728
+ event.preventDefault();
729
+ }),
730
+ onKeyDown: index$9.composeEventHandlers(props.onKeyDown, (event) => {
731
+ const isKeyDownInside = event.currentTarget.contains(event.target);
732
+ const isCloseKey = SUB_CLOSE_KEYS[rootContext.dir].includes(event.key);
733
+ if (isKeyDownInside && isCloseKey) {
734
+ context.onOpenChange(false);
735
+ subContext.trigger?.focus();
736
+ event.preventDefault();
737
+ }
738
+ })
739
+ }
740
+ ) }) }) });
741
+ }
742
+ );
743
+ MenuSubContent.displayName = SUB_CONTENT_NAME;
744
+ function getOpenState(open) {
745
+ return open ? "open" : "closed";
746
+ }
747
+ function isIndeterminate(checked) {
748
+ return checked === "indeterminate";
749
+ }
750
+ function getCheckedState(checked) {
751
+ return isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
752
+ }
753
+ function focusFirst(candidates) {
754
+ const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
755
+ for (const candidate of candidates) {
756
+ if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;
757
+ candidate.focus();
758
+ if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
759
+ }
760
+ }
761
+ function wrapArray(array, startIndex) {
762
+ return array.map((_, index) => array[(startIndex + index) % array.length]);
763
+ }
764
+ function getNextMatch(values, search, currentMatch) {
765
+ const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]);
766
+ const normalizedSearch = isRepeated ? search[0] : search;
767
+ const currentMatchIndex = currentMatch ? values.indexOf(currentMatch) : -1;
768
+ let wrappedValues = wrapArray(values, Math.max(currentMatchIndex, 0));
769
+ const excludeCurrentMatch = normalizedSearch.length === 1;
770
+ if (excludeCurrentMatch) wrappedValues = wrappedValues.filter((v) => v !== currentMatch);
771
+ const nextMatch = wrappedValues.find(
772
+ (value) => value.toLowerCase().startsWith(normalizedSearch.toLowerCase())
773
+ );
774
+ return nextMatch !== currentMatch ? nextMatch : void 0;
775
+ }
776
+ function isPointInPolygon(point, polygon) {
777
+ const { x, y } = point;
778
+ let inside = false;
779
+ for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {
780
+ const ii = polygon[i];
781
+ const jj = polygon[j];
782
+ const xi = ii.x;
783
+ const yi = ii.y;
784
+ const xj = jj.x;
785
+ const yj = jj.y;
786
+ const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;
787
+ if (intersect) inside = !inside;
788
+ }
789
+ return inside;
790
+ }
791
+ function isPointerInGraceArea(event, area) {
792
+ if (!area) return false;
793
+ const cursorPos = { x: event.clientX, y: event.clientY };
794
+ return isPointInPolygon(cursorPos, area);
795
+ }
796
+ function whenMouse(handler) {
797
+ return (event) => event.pointerType === "mouse" ? handler(event) : void 0;
798
+ }
799
+ var Root3 = Menu;
800
+ var Anchor2 = MenuAnchor;
801
+ var Portal = MenuPortal;
802
+ var Content2 = MenuContent;
803
+ var Group = MenuGroup;
804
+ var Label = MenuLabel;
805
+ var Item2 = MenuItem;
806
+ var CheckboxItem = MenuCheckboxItem;
807
+ var RadioGroup = MenuRadioGroup;
808
+ var RadioItem = MenuRadioItem;
809
+ var ItemIndicator = MenuItemIndicator;
810
+ var Separator = MenuSeparator;
811
+ var Arrow2 = MenuArrow;
812
+ var SubTrigger = MenuSubTrigger;
813
+ var SubContent = MenuSubContent;
814
+
815
+ exports.Anchor = Anchor2;
816
+ exports.Arrow = Arrow2;
817
+ exports.CheckboxItem = CheckboxItem;
818
+ exports.Content = Content2;
819
+ exports.Group = Group;
820
+ exports.Item = Item2;
821
+ exports.ItemIndicator = ItemIndicator;
822
+ exports.Label = Label;
823
+ exports.Menu = Menu;
824
+ exports.MenuAnchor = MenuAnchor;
825
+ exports.MenuArrow = MenuArrow;
826
+ exports.MenuCheckboxItem = MenuCheckboxItem;
827
+ exports.MenuContent = MenuContent;
828
+ exports.MenuGroup = MenuGroup;
829
+ exports.MenuItem = MenuItem;
830
+ exports.MenuItemIndicator = MenuItemIndicator;
831
+ exports.MenuLabel = MenuLabel;
832
+ exports.MenuPortal = MenuPortal;
833
+ exports.MenuRadioGroup = MenuRadioGroup;
834
+ exports.MenuRadioItem = MenuRadioItem;
835
+ exports.MenuSeparator = MenuSeparator;
836
+ exports.MenuSubContent = MenuSubContent;
837
+ exports.MenuSubTrigger = MenuSubTrigger;
838
+ exports.Portal = Portal;
839
+ exports.RadioGroup = RadioGroup;
840
+ exports.RadioItem = RadioItem;
841
+ exports.Root = Root3;
842
+ exports.Separator = Separator;
843
+ exports.SubContent = SubContent;
844
+ exports.SubTrigger = SubTrigger;
845
+ exports.createMenuScope = createMenuScope;