@kitn.ai/ui 0.26.0 → 0.28.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 (488) hide show
  1. package/README.md +25 -6
  2. package/bin/mcp.js +16 -3
  3. package/bin/route.js +23 -0
  4. package/bin/route.test.js +58 -0
  5. package/dist/{elements/chunks/Icon--Y8vsFal.js → Icon-DObhsRtm.js} +1 -1
  6. package/dist/action-icons-CcgNN2oT.js +1 -0
  7. package/dist/arrow-down-CjRU3JgV.js +1 -0
  8. package/dist/arrow-left-Bnpb1UEW.js +1 -0
  9. package/dist/artifact-Bwt7OgcR.js +1 -0
  10. package/dist/assets/dev-5XzXYR21.js +91 -0
  11. package/dist/attachments-Qr4kg-2b.js +1 -0
  12. package/dist/{elements/chunks/audio-visualizer-D7lB6mvR.js → audio-visualizer-DToYdfSc.js} +1 -1
  13. package/dist/badge-CdEu_jn2.js +1 -0
  14. package/dist/bash-InADTalH.js +1 -6
  15. package/dist/bell-DQAAOpDz.js +1 -0
  16. package/dist/{elements/chunks/button-flUbeufF.js → button-DkuOnGLy.js} +1 -1
  17. package/dist/card-renderer-Jx70m6_l.js +1 -0
  18. package/dist/card-routing-0YidER_3.js +1 -0
  19. package/dist/check-njkVdZu2.js +1 -0
  20. package/dist/checkbox-D7iRB3nL.js +1 -0
  21. package/dist/checkbox-group-B2_rpoPM.js +1 -0
  22. package/dist/chevron-down-B72s6PXR.js +1 -0
  23. package/dist/chevron-right-BatuHzUm.js +1 -0
  24. package/dist/choice-card-m0BYqqOK.js +1 -0
  25. package/dist/circle-check-B62pODB3.js +1 -0
  26. package/dist/circle-x-BPG0iPst.js +1 -0
  27. package/dist/circle-zx0ByzY9.js +1 -0
  28. package/dist/{elements/chunks/cn-CU7UAWzk.js → cn-DN5AWfiS.js} +1 -1
  29. package/dist/code-block-ClMLKb7C.js +1 -0
  30. package/dist/{elements/chunks/collapsible-BzbXpPzr.js → collapsible-B4DlWicL.js} +1 -1
  31. package/dist/components/attachment-types.d.ts +7 -0
  32. package/dist/components/audio-visualizer/fit-scale.d.ts +1 -1
  33. package/dist/components/card-renderer.d.ts +13 -0
  34. package/dist/components/card.d.ts +4 -0
  35. package/dist/components/chat-thread.d.ts +135 -2
  36. package/dist/components/conversation-item.d.ts +35 -7
  37. package/dist/components/conversation-list.d.ts +17 -5
  38. package/dist/components/conversation-panel.d.ts +29 -0
  39. package/dist/components/form-widgets.d.ts +67 -2
  40. package/dist/components/form.d.ts +48 -1
  41. package/dist/components/home-panel.d.ts +34 -0
  42. package/dist/components/message.d.ts +25 -3
  43. package/dist/components/reasoning.d.ts +6 -0
  44. package/dist/components/scroll-button.d.ts +11 -0
  45. package/dist/components/thread.d.ts +5 -0
  46. package/dist/components/tool-types.d.ts +9 -0
  47. package/dist/components/widget-tab-bar.d.ts +16 -0
  48. package/dist/composer-sQ0HcvyG.js +106 -0
  49. package/dist/confirm-card-rQWDQsnC.js +1 -0
  50. package/dist/construct-cli.es.js +1337 -0
  51. package/dist/{elements/chunks/context-VLIL3sJ-.js → context-0kg4ZX1J.js} +1 -1
  52. package/dist/controllable-CnGpMF6r.js +1 -0
  53. package/dist/conversation-item-BxwQLaFJ.js +1 -0
  54. package/dist/conversation-list-BCfGN1JU.js +1 -0
  55. package/dist/copy-n9u9rqpi.js +1 -0
  56. package/dist/core-AYMC6_lb.js +12 -5874
  57. package/dist/{create-tween-BFT6c-Y8.js → create-tween-C-q-JCM-.js} +1 -1
  58. package/dist/{create-tween-CJNlzoaO.js → create-tween-CRrJXxBd.js} +1 -1
  59. package/dist/{create-tween-CQED4T0g.js → create-tween-DZ3RRDHD.js} +1 -1
  60. package/dist/{elements/chunks/create-tween-c4Z8TDYz.js → create-tween-uPkArjIG.js} +2 -2
  61. package/dist/css-M7EaDHN_.js +1 -6
  62. package/dist/custom-elements.json +1433 -202
  63. package/dist/default-input-CaMrJkgH.js +1 -0
  64. package/dist/define-By-uL588.js +1 -0
  65. package/dist/define.d.ts +4 -0
  66. package/dist/define.js +510 -0
  67. package/dist/define.server.d.ts +5 -0
  68. package/dist/define.server.js +506 -0
  69. package/dist/{elements/chunks/disclosure-CcNbyLy0.js → disclosure-WUImBbDv.js} +1 -1
  70. package/dist/{elements/chunks/dropdown-BgWTthUx.js → dropdown-wZVeJOMd.js} +1 -1
  71. package/dist/elements/agent-card.js +1 -1
  72. package/dist/elements/artifact.js +1 -1
  73. package/dist/elements/attachments.js +1 -1
  74. package/dist/elements/audio-visualizer.js +1 -1
  75. package/dist/elements/autoloader.js +1 -1
  76. package/dist/elements/avatar.js +1 -1
  77. package/dist/elements/badge.js +1 -1
  78. package/dist/elements/button.js +1 -1
  79. package/dist/elements/card.js +1 -1
  80. package/dist/elements/cards.js +1 -1
  81. package/dist/elements/chain-of-thought.js +1 -1
  82. package/dist/elements/chat-scope-picker.js +1 -1
  83. package/dist/elements/chat-workspace.js +1 -1
  84. package/dist/elements/chat.js +1 -1
  85. package/dist/elements/checkbox-group.d.ts +1 -0
  86. package/dist/elements/checkbox-group.js +1 -0
  87. package/dist/elements/checkbox.d.ts +1 -0
  88. package/dist/elements/checkbox.js +1 -0
  89. package/dist/elements/checkpoint.js +1 -1
  90. package/dist/elements/choice.js +1 -1
  91. package/dist/elements/coachmark.js +1 -1
  92. package/dist/elements/code-block.js +1 -1
  93. package/dist/elements/command.js +1 -1
  94. package/dist/elements/compare.js +1 -1
  95. package/dist/elements/composer.js +1 -1
  96. package/dist/elements/confirm-card.js +1 -1
  97. package/dist/elements/context-meter.js +1 -1
  98. package/dist/elements/conversation-item.js +1 -1
  99. package/dist/elements/conversation-list.js +1 -1
  100. package/dist/elements/define-entry.d.ts +12 -0
  101. package/dist/elements/dialog.js +1 -1
  102. package/dist/elements/dock.js +102 -8
  103. package/dist/elements/dropdown.js +1 -1
  104. package/dist/elements/editable-label.js +1 -1
  105. package/dist/elements/element-data-types.d.ts +37 -0
  106. package/dist/elements/embed.js +1 -1
  107. package/dist/elements/empty.js +1 -1
  108. package/dist/elements/feedback-bar.js +1 -1
  109. package/dist/elements/file-tree.js +1 -1
  110. package/dist/elements/file-upload.js +1 -1
  111. package/dist/elements/form.js +1 -1
  112. package/dist/elements/hover-card.js +1 -1
  113. package/dist/elements/icon.js +1 -1
  114. package/dist/elements/image.js +1 -1
  115. package/dist/elements/input.js +1 -1
  116. package/dist/elements/kbd.js +1 -1
  117. package/dist/elements/link-preview.js +1 -1
  118. package/dist/elements/loader.js +1 -1
  119. package/dist/elements/markdown.js +1 -1
  120. package/dist/elements/menu.js +1 -1
  121. package/dist/elements/message-skills.js +1 -1
  122. package/dist/elements/message.js +1 -1
  123. package/dist/elements/model-switcher.js +1 -1
  124. package/dist/elements/nav.js +1 -1
  125. package/dist/elements/notice.js +1 -1
  126. package/dist/elements/pane-grid.d.ts +1 -0
  127. package/dist/elements/pane-grid.js +1 -0
  128. package/dist/elements/pane-group.js +1 -1
  129. package/dist/elements/pane.js +1 -1
  130. package/dist/elements/popover.js +1 -1
  131. package/dist/elements/progress-bar.js +1 -1
  132. package/dist/elements/prompt-dock.js +1 -1
  133. package/dist/elements/prompt-input.js +1 -1
  134. package/dist/elements/prompt-suggestions.js +1 -1
  135. package/dist/elements/radio-group.d.ts +1 -0
  136. package/dist/elements/radio-group.js +1 -0
  137. package/dist/elements/reasoning.js +1 -1
  138. package/dist/elements/remote.js +1 -1
  139. package/dist/elements/resizable.js +1 -1
  140. package/dist/elements/response-stream.js +2 -2
  141. package/dist/elements/screen.js +1 -1
  142. package/dist/elements/scroll-area.js +1 -1
  143. package/dist/elements/scroll-button.js +1 -1
  144. package/dist/elements/search.js +1 -1
  145. package/dist/elements/segmented.js +1 -1
  146. package/dist/elements/select.d.ts +1 -0
  147. package/dist/elements/select.js +1 -0
  148. package/dist/elements/separator.js +1 -1
  149. package/dist/elements/setting-item.js +1 -1
  150. package/dist/elements/settings-group.js +1 -1
  151. package/dist/elements/skeleton.js +1 -1
  152. package/dist/elements/slider.d.ts +1 -0
  153. package/dist/elements/slider.js +1 -0
  154. package/dist/elements/slots.d.ts +1 -1
  155. package/dist/elements/source.js +1 -1
  156. package/dist/elements/status.js +1 -1
  157. package/dist/elements/switch.js +1 -1
  158. package/dist/elements/tabs.js +1 -1
  159. package/dist/elements/tasks.js +1 -1
  160. package/dist/elements/text-shimmer.js +1 -1
  161. package/dist/elements/thinking-bar.js +1 -1
  162. package/dist/elements/thread.js +1 -1
  163. package/dist/elements/toast.js +1 -1
  164. package/dist/elements/tool.js +1 -1
  165. package/dist/elements/tooltip.js +1 -1
  166. package/dist/elements/voice-input.js +1 -1
  167. package/dist/elements/voice-output.js +1 -1
  168. package/dist/elements.d.ts +380 -26
  169. package/dist/{elements/chunks/ellipsis-7gU33mL2.js → ellipsis-CbOpJnU3.js} +1 -1
  170. package/dist/embed-CrfjkbUG.js +1 -0
  171. package/dist/engine-javascript-vq0WuIJl.js +14 -2516
  172. package/dist/{elements/chunks/external-link-CSOEsNlx.js → external-link-ByXAwBBQ.js} +1 -1
  173. package/dist/file-text-DMib2qwt.js +1 -0
  174. package/dist/{elements/chunks/file-tree-zvB2i7P9.js → file-tree-CJqM2aP7.js} +1 -1
  175. package/dist/folder-_BAb929C.js +1 -0
  176. package/dist/form-DSZgZQZk.js +1 -0
  177. package/dist/github-dark-dimmed-DUshB20C.js +1 -4
  178. package/dist/github-light-JYsPkUQd.js +1 -4
  179. package/dist/hover-card-BQbul9eq.js +1 -0
  180. package/dist/html-CPZ3oZQ7.js +1 -10
  181. package/dist/icon-CdcfRhYI.js +1 -0
  182. package/dist/{elements/chunks/index-BCRhi84a.js → index-xu_pdcPi.js} +1 -1
  183. package/dist/index.d.ts +4 -2
  184. package/dist/index.js +7474 -5857
  185. package/dist/index.server.js +5965 -4762
  186. package/dist/info-DsFjGuI_.js +1 -0
  187. package/dist/input-DKbmkMos.js +1 -0
  188. package/dist/javascript-C25yR2R2.js +1 -6
  189. package/dist/json-DxJze_jm.js +1 -6
  190. package/dist/kai.es.js +1 -1
  191. package/dist/kbd-PvdGhX4s.js +1 -0
  192. package/dist/{elements/chunks/link-preview-OQ9IEq0f.js → link-preview-DbM1866N.js} +1 -1
  193. package/dist/link-zF8PzWfF.js +1 -0
  194. package/dist/loader-BM4CEz4G.js +1 -0
  195. package/dist/{elements/chunks/markdown-DgBFaGAz.js → markdown-LMvmAyBk.js} +7 -7
  196. package/dist/mcp.es.js +1361 -81
  197. package/dist/message-BSsgvHvf.js +1 -0
  198. package/dist/message-BYZECyek.js +1 -0
  199. package/dist/message-circle-DruwObfX.js +1 -0
  200. package/dist/message-square-BG6q6mlm.js +1 -0
  201. package/dist/{elements/chunks/minimize-2-DPIUKTrT.js → minimize-2-BQRoBV1V.js} +1 -1
  202. package/dist/{elements/chunks/model-switcher-DsT8tFB0.js → model-switcher-CMpCOYcB.js} +1 -1
  203. package/dist/{elements/chunks/overlay-DuiwdXjm.js → overlay-Cb-MkyDa.js} +1 -1
  204. package/dist/panel-right-i8warFxT.js +1 -0
  205. package/dist/paperclip-ByY3UVO6.js +1 -0
  206. package/dist/play-BvKKq3fX.js +1 -0
  207. package/dist/primitives/card-data-types.d.ts +49 -0
  208. package/dist/primitives/card-routing.d.ts +1 -33
  209. package/dist/primitives/card-validate.d.ts +2 -2
  210. package/dist/primitives/chat-config.d.ts +29 -2
  211. package/dist/primitives/conversation-store.d.ts +54 -0
  212. package/dist/primitives/field-mask.d.ts +96 -0
  213. package/dist/primitives/field-semantics.d.ts +36 -0
  214. package/dist/primitives/input-mask.d.ts +46 -0
  215. package/dist/primitives/url-scheme-policy.d.ts +34 -0
  216. package/dist/primitives/use-resize-observer.d.ts +2 -2
  217. package/dist/progress-bar-jVAHvMUf.js +1 -0
  218. package/dist/prompt-suggestion-CD-qtNgC.js +1 -0
  219. package/dist/radio-BsoBMhkF.js +1 -0
  220. package/dist/react/index.d.ts +586 -19
  221. package/dist/react.js +223 -187
  222. package/dist/reasoning-4kBPtlTx.js +1 -0
  223. package/dist/register-impl-B1hLkrI8.js +424 -0
  224. package/dist/{elements/chunks/resizable-D181b4fM.js → resizable-uPmY9VY-.js} +1 -1
  225. package/dist/rotate-ccw-B2xn93py.js +1 -0
  226. package/dist/rotate-cw-CMVLoCyH.js +1 -0
  227. package/dist/schemas/form.schema.json +21 -1
  228. package/dist/schemas/tool-defs.d.ts +11 -1
  229. package/dist/schemas.js +81 -81
  230. package/dist/scroll-area-BqLUo8ZZ.js +1 -0
  231. package/dist/scroll-button-DslXiJyL.js +1 -0
  232. package/dist/select-2cLRtPGT.js +1 -0
  233. package/dist/{elements/chunks/separator-CeJHQqLW.js → separator-BWQtNJcM.js} +1 -1
  234. package/dist/{elements/chunks/settings-CqaHgJF9.js → settings-BBR63jLg.js} +1 -1
  235. package/dist/{elements/chunks/settings-group-CjqjLCOn.js → settings-group-B2ciy-Iw.js} +1 -1
  236. package/dist/{elements/chunks/skeleton-D8akBnKS.js → skeleton-CkHI-HgC.js} +1 -1
  237. package/dist/slider-DDR9U-i0.js +1 -0
  238. package/dist/{solid-BtdqNZI7.js → solid-BzCFdL25.js} +9771 -7594
  239. package/dist/{solid-CnavwBye.js → solid-DruVOXnf.js} +7893 -6183
  240. package/dist/solid.d.ts +16 -2
  241. package/dist/solid.js +256 -243
  242. package/dist/solid.server.js +256 -243
  243. package/dist/source-GEnFF528.js +1 -0
  244. package/dist/star-CilHq8GP.js +1 -0
  245. package/dist/state/index.d.ts +1 -1
  246. package/dist/state/mock.d.ts +32 -2
  247. package/dist/state.js +133 -108
  248. package/dist/store-Ciyk6eZG.js +1 -0
  249. package/dist/svelte--5p79yCD.js +1 -15
  250. package/dist/switch-KkeQIbuH.js +1 -0
  251. package/dist/tasks-card-BrN4bggJ.js +1 -0
  252. package/dist/text-shimmer-Dcj1MHuq.js +1 -0
  253. package/dist/textarea-Dpvbngbg.js +1 -0
  254. package/dist/theme.tokens.css +110 -13
  255. package/dist/{elements/chunks/thumbs-up-DX2Ijk3H.js → thumbs-up-CsT9Wzb9.js} +1 -1
  256. package/dist/toast-store-tgK6MuMv.js +1 -0
  257. package/dist/{elements/chunks/tool-DKQ2D1DP.js → tool-DzUjIBT8.js} +1 -1
  258. package/dist/{elements/chunks/tooltip-B0G99y8w.js → tooltip-Bkkg_4t0.js} +1 -1
  259. package/dist/trash-2-jBKxjGGQ.js +1 -0
  260. package/dist/{elements/chunks/triangle-alert-F9cyUEyy.js → triangle-alert-DlQ68ppf.js} +1 -1
  261. package/dist/tsx-B8rCNbgL.js +1 -6
  262. package/dist/types.d.ts +48 -3
  263. package/dist/typescript-RycA9KXf.js +1 -6
  264. package/dist/ui/checkbox-group.d.ts +83 -0
  265. package/dist/ui/checkbox.d.ts +40 -0
  266. package/dist/ui/dock.d.ts +51 -0
  267. package/dist/ui/icon.d.ts +3 -0
  268. package/dist/ui/input.d.ts +48 -2
  269. package/dist/ui/radio.d.ts +85 -0
  270. package/dist/ui/select.d.ts +71 -0
  271. package/dist/ui/slider.d.ts +65 -0
  272. package/dist/ui/switch.d.ts +9 -2
  273. package/dist/upload-TcAHXv9W.js +1 -0
  274. package/dist/url-scheme-policy-DR5DgvkM.js +1 -0
  275. package/dist/use-card-resolution-DaZqAdWf.js +1 -0
  276. package/dist/{elements/chunks/variant-aurora-qt6Zct8M.js → variant-aurora-BhLuYxJR.js} +1 -1
  277. package/dist/{variant-aurora-B8II3-I1.js → variant-aurora-CNmfHhcx.js} +2 -2
  278. package/dist/{variant-aurora-CMNWOSJR.js → variant-aurora-D6GsdTPA.js} +2 -2
  279. package/dist/{variant-aurora-CcuDMWwQ.js → variant-aurora-DbW_OWL2.js} +1 -1
  280. package/dist/{elements/chunks/variant-custom-tJp22_BQ.js → variant-custom-BRvaNHSi.js} +1 -1
  281. package/dist/{variant-custom-L16JLLZy.js → variant-custom-BvYHR62b.js} +1 -1
  282. package/dist/{variant-custom-BdvYC7af.js → variant-custom-DMTrEO5w.js} +2 -2
  283. package/dist/{variant-custom-C714mqKl.js → variant-custom-DV2x254s.js} +2 -2
  284. package/dist/{variant-wave-ecwykeyL.js → variant-wave-BNMGrDfj.js} +2 -2
  285. package/dist/{variant-wave-2S4La2Ka.js → variant-wave-BpDd8t3Z.js} +1 -1
  286. package/dist/{variant-wave-D7ruiA1W.js → variant-wave-CyBueXj9.js} +2 -2
  287. package/dist/{elements/chunks/variant-wave-CaQ5ti39.js → variant-wave-sp-qwsdI.js} +1 -1
  288. package/dist/vue-BmIZj4XD.js +1 -33
  289. package/dist/x-Z5UntkIJ.js +1 -0
  290. package/frameworks/react/index.tsx +210 -22
  291. package/llms-full.txt +1184 -22
  292. package/llms.txt +6 -3
  293. package/package.json +17 -4
  294. package/src/agent-tooling/README.md +192 -0
  295. package/src/agent-tooling/catalog/invariants.ts +3 -3
  296. package/src/agent-tooling/catalog/surfaces.ts +72 -0
  297. package/src/agent-tooling/construct/cli-entry.ts +8 -0
  298. package/src/agent-tooling/construct/cli.ts +147 -0
  299. package/src/agent-tooling/construct/codegen.ts +1635 -0
  300. package/src/agent-tooling/construct/construct.v1.schema.json +319 -0
  301. package/src/agent-tooling/construct/dev.ts +148 -0
  302. package/src/agent-tooling/construct/fixtures/demo-widget.construct.json +7 -0
  303. package/src/agent-tooling/construct/fixtures/ops-console.construct.json +44 -0
  304. package/src/agent-tooling/construct/fixtures/owner-widget.construct.json +32 -0
  305. package/src/agent-tooling/construct/schema.ts +452 -0
  306. package/src/agent-tooling/mcp/server.ts +2 -1
  307. package/src/agent-tooling/mcp/tools/construct.ts +130 -0
  308. package/src/agent-tooling/mcp/tools/debug.ts +126 -4
  309. package/src/agent-tooling/mcp/tools/reference.ts +104 -3
  310. package/src/agent-tooling/recipes/composed-thread.ts +714 -0
  311. package/src/agent-tooling/recipes/index.ts +22 -0
  312. package/src/agent-tooling/recipes/types.ts +32 -0
  313. package/src/agent-tooling/registry.ts +5 -0
  314. package/src/components/attachment-types.ts +7 -0
  315. package/src/components/audio-visualizer/fit-scale.ts +1 -1
  316. package/src/components/card-renderer.tsx +39 -8
  317. package/src/components/card.tsx +10 -2
  318. package/src/components/chat-scope-picker.tsx +2 -2
  319. package/src/components/chat-thread.tsx +602 -43
  320. package/src/components/choice-card.tsx +102 -37
  321. package/src/components/coachmark.tsx +1 -1
  322. package/src/components/code-block.tsx +2 -2
  323. package/src/components/composer.tsx +89 -15
  324. package/src/components/confirm-card.tsx +20 -4
  325. package/src/components/conversation-item.tsx +56 -9
  326. package/src/components/conversation-list.tsx +25 -10
  327. package/src/components/conversation-panel.tsx +118 -0
  328. package/src/components/empty.tsx +14 -3
  329. package/src/components/file-tree.tsx +5 -1
  330. package/src/components/form-widgets.tsx +257 -195
  331. package/src/components/form.tsx +297 -9
  332. package/src/components/home-panel.tsx +159 -0
  333. package/src/components/loader.tsx +12 -5
  334. package/src/components/message-skills.tsx +1 -1
  335. package/src/components/message.tsx +71 -11
  336. package/src/components/prompt-input.tsx +7 -1
  337. package/src/components/prompt-suggestion.tsx +4 -1
  338. package/src/components/reasoning.tsx +30 -3
  339. package/src/components/response-compare.tsx +2 -2
  340. package/src/components/scroll-button.tsx +56 -4
  341. package/src/components/source.tsx +6 -1
  342. package/src/components/tasks-card.tsx +58 -16
  343. package/src/components/thread.tsx +10 -1
  344. package/src/components/toast.tsx +1 -1
  345. package/src/components/tool-types.ts +9 -0
  346. package/src/components/widget-tab-bar.tsx +73 -0
  347. package/src/elements/attachments.tsx +3 -1
  348. package/src/elements/chat-workspace.tsx +1 -1
  349. package/src/elements/chat.tsx +115 -5
  350. package/src/elements/checkbox-group.tsx +164 -0
  351. package/src/elements/checkbox.tsx +134 -0
  352. package/src/elements/compiled.css +1 -1
  353. package/src/elements/composer.tsx +12 -1
  354. package/src/elements/conversation-item.tsx +62 -22
  355. package/src/elements/conversation-list.tsx +2 -2
  356. package/src/elements/define-entry.ts +12 -0
  357. package/src/elements/dock.tsx +11 -0
  358. package/src/elements/element-data-types.ts +40 -0
  359. package/src/elements/element-manifest.json +24 -0
  360. package/src/elements/element-meta.json +767 -34
  361. package/src/elements/element-nonscalar.json +17 -0
  362. package/src/elements/element-types.d.ts +380 -26
  363. package/src/elements/feedback-bar.tsx +5 -0
  364. package/src/elements/icon-names.json +29 -0
  365. package/src/elements/input.tsx +312 -23
  366. package/src/elements/message.tsx +2 -0
  367. package/src/elements/pane-grid.tsx +111 -0
  368. package/src/elements/prompt-input.tsx +8 -2
  369. package/src/elements/radio-group.tsx +129 -0
  370. package/src/elements/register-impl.ts +6 -0
  371. package/src/elements/scroll-button.tsx +54 -6
  372. package/src/elements/select.tsx +165 -0
  373. package/src/elements/slider.tsx +171 -0
  374. package/src/elements/slots.ts +1 -1
  375. package/src/elements/styles.css +89 -3
  376. package/src/elements/thread.tsx +2 -0
  377. package/src/elements/toast.tsx +14 -1
  378. package/src/index.ts +5 -2
  379. package/src/primitives/card-data-types.ts +49 -0
  380. package/src/primitives/card-host.tsx +4 -2
  381. package/src/primitives/card-routing.ts +7 -56
  382. package/src/primitives/card-schemas/form.schema.json +21 -1
  383. package/src/primitives/card-validate.ts +10 -2
  384. package/src/primitives/chat-config.tsx +33 -6
  385. package/src/primitives/conversation-store.ts +248 -0
  386. package/src/primitives/field-mask.ts +256 -0
  387. package/src/primitives/field-semantics.ts +115 -0
  388. package/src/primitives/input-mask.ts +853 -0
  389. package/src/primitives/toast-store.ts +66 -4
  390. package/src/primitives/url-scheme-policy.ts +70 -0
  391. package/src/primitives/use-resize-observer.ts +2 -2
  392. package/src/schemas/tool-defs.ts +12 -2
  393. package/src/solid.ts +20 -2
  394. package/src/state/index.ts +1 -1
  395. package/src/state/mock.ts +92 -6
  396. package/src/types.ts +45 -3
  397. package/src/ui/agent-card.tsx +2 -2
  398. package/src/ui/avatar.tsx +1 -1
  399. package/src/ui/checkbox-group.tsx +153 -0
  400. package/src/ui/checkbox.tsx +63 -0
  401. package/src/ui/dock.tsx +192 -7
  402. package/src/ui/icon.tsx +53 -0
  403. package/src/ui/input.tsx +249 -9
  404. package/src/ui/kbd.tsx +1 -1
  405. package/src/ui/nav.tsx +1 -1
  406. package/src/ui/pane-group.tsx +2 -2
  407. package/src/ui/radio.tsx +150 -0
  408. package/src/ui/select.tsx +168 -0
  409. package/src/ui/slider.tsx +178 -0
  410. package/src/ui/switch.tsx +49 -18
  411. package/src/utils/cn.ts +11 -5
  412. package/theme.css +112 -13
  413. package/dist/elements/chunks/action-icons-D9u3OzYW.js +0 -1
  414. package/dist/elements/chunks/arrow-left-CVh1TeN7.js +0 -1
  415. package/dist/elements/chunks/artifact-BkYcfIlZ.js +0 -1
  416. package/dist/elements/chunks/attachments-DwfNlubq.js +0 -1
  417. package/dist/elements/chunks/badge-Q0-Cmwzz.js +0 -1
  418. package/dist/elements/chunks/bash-InADTalH.js +0 -1
  419. package/dist/elements/chunks/card-renderer-3Dyl-FpN.js +0 -1
  420. package/dist/elements/chunks/card-routing-BK09BdmL.js +0 -1
  421. package/dist/elements/chunks/check-B5kBPKeo.js +0 -1
  422. package/dist/elements/chunks/chevron-down-DZ1GS39h.js +0 -1
  423. package/dist/elements/chunks/chevron-right-CvP7OUd2.js +0 -1
  424. package/dist/elements/chunks/choice-card-D4QUIOWZ.js +0 -1
  425. package/dist/elements/chunks/circle-CDf9g6MQ.js +0 -1
  426. package/dist/elements/chunks/circle-check-CA47Nqbz.js +0 -1
  427. package/dist/elements/chunks/circle-x-CJ_HVbC8.js +0 -1
  428. package/dist/elements/chunks/code-block-BdLiTitd.js +0 -1
  429. package/dist/elements/chunks/composer-Byve-n8K.js +0 -69
  430. package/dist/elements/chunks/confirm-card-B0flE3MN.js +0 -1
  431. package/dist/elements/chunks/controllable-DTwTIlwp.js +0 -1
  432. package/dist/elements/chunks/conversation-item-BDztezOG.js +0 -1
  433. package/dist/elements/chunks/copy-Nf-kqxXH.js +0 -1
  434. package/dist/elements/chunks/core-AYMC6_lb.js +0 -12
  435. package/dist/elements/chunks/css-M7EaDHN_.js +0 -1
  436. package/dist/elements/chunks/default-input-C2iLFq0b.js +0 -1
  437. package/dist/elements/chunks/define-wjHR1MkU.js +0 -1
  438. package/dist/elements/chunks/download-C4V7tBdb.js +0 -1
  439. package/dist/elements/chunks/embed-D3KewsIJ.js +0 -1
  440. package/dist/elements/chunks/engine-javascript-vq0WuIJl.js +0 -141
  441. package/dist/elements/chunks/file-text-D1G8khle.js +0 -1
  442. package/dist/elements/chunks/folder-WW2LGLid.js +0 -1
  443. package/dist/elements/chunks/form-CQirdC4W.js +0 -1
  444. package/dist/elements/chunks/github-dark-dimmed-DUshB20C.js +0 -1
  445. package/dist/elements/chunks/github-light-JYsPkUQd.js +0 -1
  446. package/dist/elements/chunks/hover-card-CJJkfHTK.js +0 -1
  447. package/dist/elements/chunks/html-CPZ3oZQ7.js +0 -1
  448. package/dist/elements/chunks/icon-Cfgmf4fa.js +0 -1
  449. package/dist/elements/chunks/info-DX3YMOt6.js +0 -1
  450. package/dist/elements/chunks/input-BtW9U6Sq.js +0 -1
  451. package/dist/elements/chunks/javascript-C25yR2R2.js +0 -1
  452. package/dist/elements/chunks/json-DxJze_jm.js +0 -1
  453. package/dist/elements/chunks/kbd-LGXwuT_V.js +0 -1
  454. package/dist/elements/chunks/link-2My69BqT.js +0 -1
  455. package/dist/elements/chunks/loader-iOxc_Tu-.js +0 -1
  456. package/dist/elements/chunks/message-VMZohrXx.js +0 -1
  457. package/dist/elements/chunks/message-circle-CpXMM-_n.js +0 -1
  458. package/dist/elements/chunks/message-square-DxcWtETQ.js +0 -1
  459. package/dist/elements/chunks/message-tZmV2A3p.js +0 -1
  460. package/dist/elements/chunks/paperclip-CRZVp4z_.js +0 -1
  461. package/dist/elements/chunks/progress-bar-DNy66e_E.js +0 -1
  462. package/dist/elements/chunks/prompt-suggestion-Bn64Nl7L.js +0 -1
  463. package/dist/elements/chunks/reasoning-Emn9N4-T.js +0 -1
  464. package/dist/elements/chunks/rotate-cw-CPWe37D9.js +0 -1
  465. package/dist/elements/chunks/scroll-area-ClZkZxIk.js +0 -1
  466. package/dist/elements/chunks/scroll-button-DPE-t3x_.js +0 -1
  467. package/dist/elements/chunks/share-CyfnNEqp.js +0 -1
  468. package/dist/elements/chunks/source-UWCvmVak.js +0 -1
  469. package/dist/elements/chunks/star-DoHFAikQ.js +0 -1
  470. package/dist/elements/chunks/store-Cjq0qwYN.js +0 -1
  471. package/dist/elements/chunks/svelte--5p79yCD.js +0 -1
  472. package/dist/elements/chunks/tasks-card-CmZ5xh6v.js +0 -1
  473. package/dist/elements/chunks/text-shimmer-DYn09zrz.js +0 -1
  474. package/dist/elements/chunks/textarea-skiGHURM.js +0 -1
  475. package/dist/elements/chunks/toast-store-CFnQpThX.js +0 -1
  476. package/dist/elements/chunks/tsx-B8rCNbgL.js +0 -1
  477. package/dist/elements/chunks/typescript-RycA9KXf.js +0 -1
  478. package/dist/elements/chunks/use-card-resolution-DoA2f_EU.js +0 -1
  479. package/dist/elements/chunks/vue-BmIZj4XD.js +0 -1
  480. package/dist/elements/chunks/x-B6UnOiLw.js +0 -1
  481. package/dist/llms/llms-full.txt +0 -2949
  482. package/dist/llms/llms.txt +0 -156
  483. package/dist/register-impl-DpE7icIb.js +0 -293
  484. package/dist/ui/stat.d.ts +0 -16
  485. package/src/ui/stat.tsx +0 -41
  486. /package/dist/{elements/chunks/card-tags-D8lZ-C_U.js → card-tags-D8lZ-C_U.js} +0 -0
  487. /package/dist/{elements/chunks/link-preview-DNILK391.js → link-preview-DNILK391.js} +0 -0
  488. /package/dist/{elements/chunks/slots-DaNjX0rc.js → slots-DaNjX0rc.js} +0 -0
@@ -0,0 +1 @@
1
+ import{g as k,h as x,f as K,c as g,j as N,D as P,A as Q,o as H,C as V,S as w,m as T,i as X,a as Y,b as Z,v as $,t as A}from"./define-By-uL588.js";import{r as ee,M as te}from"./slots-DaNjX0rc.js";import{a as z,M as re,b as ae}from"./message-BYZECyek.js";import{t as B}from"./toast-store-tgK6MuMv.js";import{B as O}from"./card-renderer-Jx70m6_l.js";import{m as ne,B as oe}from"./card-tags-D8lZ-C_U.js";function se(e){return e.filter(a=>a.type==="text").map(a=>a.text).join("")}const ie=2e3;function R(e){const[a,c]=k({}),[o,i]=k(new Set),v=e.copiedDuration??ie,n=new Map;x(()=>{n.forEach(r=>clearTimeout(r)),n.clear()});const u=r=>r.feedback??a()[r.id],h=r=>o().has(r),f=r=>{i(d=>{const l=new Set(d);return l.add(r),l});const s=n.get(r);s&&clearTimeout(s),n.set(r,setTimeout(()=>{n.delete(r),i(d=>{if(!d.has(r))return d;const l=new Set(d);return l.delete(r),l})},v))},b=(r,s)=>{c(d=>{const l={...d};return s===void 0?delete l[r]:l[r]=s,l})};return{resolveFeedback:u,isCopied:h,handleAction:(r,s)=>{var d,l,p;if(s==="copy"){try{(d=navigator.clipboard)==null||d.writeText(se(r.parts))}catch{}f(r.id),B("Copied to clipboard",{target:(l=e.target)==null?void 0:l.call(e)}),e.emit({messageId:r.id,action:s});return}if(s==="like"||s==="dislike"){u(r)===s?(b(r.id,void 0),e.emit({messageId:r.id,action:s,state:"off"})):(b(r.id,s),B("Thanks for your feedback",{target:(p=e.target)==null?void 0:p.call(e)}),e.emit({messageId:r.id,action:s,state:"on"}));return}e.emit({messageId:r.id,action:s})}}}function S(e){return!!e&&typeof e=="object"&&Array.isArray(e.parts)}const le="each entry needs a 'parts' array (e.g. parts: [{ type: 'text', text: 'Hi' }]). The 'content' string field was removed in 0.20.0.",ce=[];function de(e){const a=new WeakSet;let c=!1,o=!1;return i=>{if(!Array.isArray(i))return i!=null&&!o&&(o=!0,console.error(`<${e}>: 'messages' must be an array. Ignoring it.`)),ce;if(i.every(S))return i;let v=0,n=0;for(const u of i)if(!S(u)){if(v++,u!==null&&typeof u=="object"){if(a.has(u))continue;a.add(u)}else{if(c)continue;c=!0}n++}return n>0&&console.error(`<${e}>: skipped ${v} of ${i.length} messages: ${le}`),i.filter(S)}}var ue=A("<slot name=before-body>"),ge=A("<slot name=after-body>"),ve=A("<div part=avatar class=shrink-0><slot name=avatar>"),me=A("<div>");function _(e,a="auto"){const c=ne(e),o={};for(const i of Object.keys(c)){const v=c[i];o[i]=v===oe[i]&&O[i]?O[i]:n=>g(fe,{tag:v,get envelope(){return n.envelope},theme:a})}return o}function fe(e){let a;return N(()=>{a&&(a.data=e.envelope.data,a.cardId=e.envelope.id,e.envelope.title!=null&&(a.heading=e.envelope.title),a.resolution=e.envelope.resolution,a.setAttribute("theme",e.theme),a.setAttribute("data-card-id",e.envelope.id))}),g(P,{get component(){return e.tag},ref(c){var o=a;typeof o=="function"?o(c):a=c}})}function D(e){const a=e.getAttribute("role");a!==null&&(e.removeAttribute("role"),e.role=a)}K("kai-message",{message:void 0,role:"assistant",markdown:void 0,proseSize:"sm",codeTheme:"github-dark-dimmed",codeHighlight:!0,actionsReveal:"always",avatarSrc:void 0,avatarFallback:void 0,avatar:void 0,cardTypes:void 0,cardSchemas:void 0},(e,{dispatch:a,flag:c,element:o,expose:i})=>{const v=Q();D(o);const n=()=>e.message??{id:"message",role:e.role??"assistant",parts:[]};let u;const h=()=>{const t=n();return S(t)?!0:(t!==u&&(u=t,console.error("<kai-message>: 'message' must have a 'parts' array. The 'content' string field was removed in 0.20.0.")),!1)},f=R({emit:t=>a("kai-message-action",t)});i({copy:()=>{h()&&f.handleAction(n(),"copy")}});const[b,r]=k([]),[s,d]=k({});H(()=>{const t=()=>{const J=[...o.querySelectorAll("kai-action")];r(J.map(m=>{var j;return{id:m.id||m.getAttribute("action")||"",label:((j=m.textContent)==null?void 0:j.trim())||m.getAttribute("label")||m.id||"",icon:m.getAttribute("icon")??void 0,tooltip:m.getAttribute("tooltip")??void 0}})),d(ee(o,te))};t();const y=new MutationObserver(t);y.observe(o,{childList:!0,attributes:!0,subtree:!0}),x(()=>y.disconnect())}),H(()=>{const t=new MutationObserver(()=>D(o));t.observe(o,{attributes:!0,attributeFilter:["role"]}),x(()=>t.disconnect())});const l=()=>n().role==="user",p=()=>n().avatar??(e.avatarSrc||e.avatarFallback?{src:e.avatarSrc,fallback:e.avatarFallback}:void 0),E=()=>e.avatar==="none",F=()=>!!s().avatar,q=()=>!E()&&(F()||!!p()),M=()=>e.actionsReveal==="hover"?"hover":"always",L=()=>o.hasAttribute("markdown")||e.markdown===!0||e.markdown===!1,U=()=>L()?c("markdown"):!l(),W=()=>[...n().actions??[],...b()],C=()=>g(re,{get parts(){return n().parts},get cardTypes(){return _(e.cardTypes,e.theme)},get cardSchemas(){return e.cardSchemas},cardHostElement:o,get isUser(){return l()},get markdown(){return U()},get actions(){return W()},get actionsReveal(){return M()},get activeFeedback(){return f.resolveFeedback(n())},get copied(){return f.isCopied(n().id)},onAction:t=>f.handleAction(n(),t),get beforeBody(){return T(()=>!!s()["before-body"])()?(()=>{var t=ue();return t._$owner=$(),t})():void 0},get afterBody(){return T(()=>!!s()["after-body"])()?(()=>{var t=ge();return t._$owner=$(),t})():void 0}}),I=()=>M()==="hover"?"group ":"",G=()=>g(w,{get when(){return F()},get fallback(){return g(w,{get when(){return p()},children:t=>g(ae,{get src(){return t().src??""},get alt(){return t().alt??""},get fallback(){return t().fallback}})})},get children(){var t=ve(),y=t.firstChild;return y._$owner=$(),t}});return g(w,{get when(){return h()},get children(){return g(V,{get proseSize(){return e.proseSize},get codeTheme(){return e.codeTheme},get codeHighlight(){return c("codeHighlight")},get portalMount(){return v.portalMount()},get children(){return g(w,{get when(){return q()},get fallback(){return g(z,{get role(){return n().role},get class(){return`${I()}${l()?"flex-col items-end":"flex-col items-start"}`},get children(){return C()}})},get children(){return g(z,{get role(){return n().role},get class(){return I()},get children(){return[T(()=>G()),(()=>{var t=me();return X(t,C),Y(()=>Z(t,`flex min-w-0 flex-1 flex-col ${l()?"items-end":"items-start"}`)),t})()]}})}})}})}})});export{_ as a,de as b,R as c};
@@ -0,0 +1 @@
1
+ import{s as S,p as A,q as B,m as w,i as g,k as D,c as r,S as c,r as F,M as o,F as z,a as x,d as k,I as E,b as j,t as u,A as H,Q as q,e as L}from"./define-By-uL588.js";import{T as N}from"./tooltip-Bkkg_4t0.js";import{c as h}from"./cn-DN5AWfiS.js";import{M as P}from"./markdown-LMvmAyBk.js";import{B as Q}from"./button-DkuOnGLy.js";import{B as _,a as C}from"./action-icons-CcgNN2oT.js";import{R as $,a as G,b as J}from"./reasoning-4kBPtlTx.js";import{L as K}from"./loader-BM4CEz4G.js";import{T as V}from"./tool-DzUjIBT8.js";import{A as W,a as X,b as Y,c as Z,d as ee,e as re,f as te,g as O,h as ne}from"./attachments-Qr4kg-2b.js";import{S as ae,a as ie,b as le,c as se}from"./source-GEnFF528.js";import{a as ce}from"./card-renderer-Jx70m6_l.js";import{c as oe}from"./check-njkVdZu2.js";var ue=u("<div part=row>"),de=u('<img class="h-full w-full object-cover">'),ge=u("<div part=avatar>"),he=u('<div class="flex h-full w-full items-center justify-center bg-muted text-xs font-medium text-muted-foreground">'),R=u("<div>"),me=u('<span class="px-1 text-xs">'),fe=u('<span><span class="min-w-0 overflow-hidden">'),pe=u('<img class="block max-h-64 max-w-xs rounded object-contain">'),ve=u('<div class="text-body font-medium">'),be=u('<div class="text-muted-foreground text-caption">');const ke={user:"User message",assistant:"Assistant message",system:"System message"};function we(e){const[t,n]=S(e,["children","class","role"]);return(()=>{var a=ue();return A(a,B({get class(){return h("flex items-start gap-3",t.class)},get"data-role"(){return t.role},get role(){return t.role?"article":void 0},get"aria-label"(){return w(()=>!!t.role)()?ke[t.role]:void 0}},n),!1,!0),g(a,()=>t.children),a})()}function xe(e){return(()=>{var t=ge();return g(t,r(c,{get when(){return e.src},get fallback(){return r(c,{get when(){return e.fallback},get children(){var n=he();return g(n,()=>e.fallback),n}})},get children(){var n=de();return x(a=>{var i=e.src,l=e.alt??"";return i!==a.e&&k(n,"src",a.e=i),l!==a.t&&k(n,"alt",a.t=l),a},{e:void 0,t:void 0}),n}})),x(()=>j(t,h("h-8 w-8 shrink-0 overflow-hidden rounded-full",e.class))),t})()}function ye(e){const[t,n]=S(e,["children","markdown","class","part"]),a=H(),i=()=>h("min-w-0 rounded-lg p-2 text-foreground bg-secondary max-w-none break-words whitespace-normal",q(a.proseSize()),t.class);return r(c,{get when(){return t.markdown},get fallback(){return(()=>{var l=R();return A(l,B({get part(){return t.part},get class(){return i()}},n),!1,!0),g(l,()=>t.children),l})()},get children(){return r(P,{get part(){return t.part},get content(){return t.children},get class(){return i()}})}})}function Se(e){const[t,n]=S(e,["children","class"]);return(()=>{var a=R();return A(a,B({get class(){return h("flex items-center gap-0.5 mt-0.5",t.class)}},n),!1,!0),g(a,()=>t.children),a})()}function Ae(e){return typeof e=="string"?{id:e,label:_[e],Icon:C(e)}:{id:e.id,label:e.label,Icon:C(e.icon)}}function Be(e){return e==="like"||e==="dislike"?e:void 0}function Fe(e){return r(Se,{part:"actions",get class(){return h("mt-1 flex gap-0",e.reveal==="hover"&&"opacity-0 transition-opacity group-hover:opacity-100",e.class)},get children(){return r(z,{get each(){return e.actions},children:t=>{const n=Ae(t),a=()=>typeof t!="string"&&t.tooltip?t.tooltip:n.label,i=Be(t),l=()=>i!==void 0&&e.activeFeedback===i,d=n.id==="copy",m=()=>d&&e.copied===!0,s=()=>r(Q,{variant:"ghost",size:"icon-sm",get class(){return h("rounded-full",l()&&"text-primary")},get"data-action"(){return n.id},get"aria-label"(){return w(()=>!!m())()?"Copied":n.label},get"aria-pressed"(){return i!==void 0?l():void 0},onClick:()=>e.onAction(n.id),get children(){return r(c,{get when(){return m()},get fallback(){return r(c,{get when(){return n.Icon},get fallback(){return(()=>{var f=me();return g(f,()=>n.label),f})()},children:f=>{const p=f();return r(p,{get class(){return h("size-3.5",l()&&"fill-current")}})}})},get children(){return r(oe,{class:"size-3.5 text-emerald-400"})}})}}),v=()=>r(c,{get when(){return n.Icon},get fallback(){return s()},get children(){return r(N,{get content(){return a()},get children(){return s()}})}});return r(c,{when:i!==void 0,get fallback(){return v()},get children(){return(()=>{const f=()=>e.activeFeedback===void 0||e.activeFeedback===i;return(()=>{var p=fe(),U=p.firstChild;return g(U,v),x(b=>{var M=f()?void 0:"",T=h("grid transition-[grid-template-columns,opacity] duration-300 ease-out",f()?"grid-cols-[1fr] opacity-100":"grid-cols-[0fr] opacity-0");return M!==b.e&&k(p,"data-feedback-collapsed",b.e=M),T!==b.t&&j(p,b.t=T),b},{e:void 0,t:void 0}),p})()})()}})}})}})}function ze(e){const t=[];for(const n of e){if(n.type==="file"){const a=t[t.length-1];if(a?.kind==="files"){t[t.length-1]={kind:"files",parts:[...a.parts,n]};continue}t.push({kind:"files",parts:[n]});continue}if(n.type==="source"){const a=t[t.length-1];if(a?.kind==="sources"){t[t.length-1]={kind:"sources",parts:[...a.parts,n]};continue}t.push({kind:"sources",parts:[n]});continue}t.push({kind:"single",part:n})}return t}function Ie(e){if(e.index!==void 0)return e.index;if(!e.url)return e.title||"Source"}function Me(e){return e.title||e.url||"Source"}function I(e,t){return e.kind===t?e:!1}function y(e,t){return e.type===t?e:!1}function Te(e){const t=D(()=>ze(e.parts));return[r(c,{get when(){return e.beforeBody},get children(){return e.beforeBody}}),r(E,{get each(){return t()},children:n=>r(F,{fallback:null,get children(){return[r(o,{get when(){return I(n(),"files")},children:a=>r(W,{variant:"grid",get class(){return e.isUser?"mb-2 ml-auto":"mb-2"},get children(){return r(z,{get each(){return a().parts},children:i=>r(X,{get data(){return i.attachment},get children(){return r(Y,{get children(){return[r(Z,{class:"block size-full",get children(){return[r(ee,{}),r(re,{})]}}),r(te,{get children(){return r(c,{get when(){return w(()=>ne(i.attachment)==="image"&&i.attachment.type==="file")()&&i.attachment.url},get fallback(){return[(()=>{var l=ve();return g(l,()=>O(i.attachment)),l})(),r(c,{get when(){return i.attachment.mediaType},get children(){var l=be();return g(l,()=>i.attachment.mediaType),l}})]},get children(){var l=pe();return x(d=>{var m=O(i.attachment),s=i.attachment.url;return m!==d.e&&k(l,"alt",d.e=m),s!==d.t&&k(l,"src",d.t=s),d},{e:void 0,t:void 0}),l}})}})]}})}})})}})}),r(o,{get when(){return I(n(),"sources")},children:a=>r(ae,{part:"citations",get class(){return e.isUser?"justify-end":void 0},get children(){return r(z,{get each(){return a().parts},children:i=>r(ie,{get href(){return i.source.url},get children(){return[r(le,{get label(){return Ie(i.source)}}),r(se,{get title(){return Me(i.source)},get description(){return i.source.snippet??""}})]}})})}})}),r(o,{get when(){return I(n(),"single")},children:a=>{const i=()=>a().part,l=()=>y(i(),"reasoning"),d=()=>{const s=l();return s!==!1&&s.text===""},m=()=>{const s=l();return s!==!1&&s.text!==""&&s};return r(F,{fallback:null,get children(){return[r(o,{get when(){return y(i(),"text")},children:s=>r(ye,{part:"bubble content",get markdown(){return e.markdown},get class(){return e.isUser?"bg-muted max-w-[85%] rounded-2xl px-4 py-2":"bg-transparent p-0"},get children(){return s().text}})}),r(o,{get when(){return d()},children:null}),r(o,{get when(){return m()},children:s=>{const v=()=>e.reasoningMode??"full";return r(F,{fallback:null,get children(){return[r(o,{get when(){return v()==="full"},get children(){return r($,{class:"mb-2 w-full",get isStreaming(){return e.isStreaming},get defaultOpen(){return e.reasoningDefaultOpen},get openOnStream(){return e.reasoningDefaultOpen},get children(){return[r(G,{get children(){return s().label??"Reasoning"}}),r(J,{markdown:!0,get children(){return s().text}})]}})}}),r(o,{get when(){return w(()=>v()==="compact")()&&e.isStreaming},get children(){return r(K,{variant:"text-shimmer",get text(){return s().label??"Reasoning"},class:"mb-2"})}})]}})}}),r(o,{get when(){return y(i(),"tool")},children:s=>r(V,{get toolPart(){return s().tool},class:"mb-2 w-full"})}),r(o,{get when(){return y(i(),"card")},children:s=>r(ce,{get envelope(){return s().envelope},get types(){return e.cardTypes},get schemas(){return e.cardSchemas},get hostElement(){return e.cardHostElement}})})]}})}})]}})}),r(c,{get when(){var n;return(((n=e.actions)==null?void 0:n.length)??0)>0},get children(){return r(Fe,{get actions(){return e.actions},get reveal(){return e.actionsReveal==="hover"?"hover":"always"},get activeFeedback(){return e.activeFeedback},get copied(){return e.copied},onAction:n=>{var a;return(a=e.onAction)==null?void 0:a.call(e,n)}})}}),r(c,{get when(){return e.afterBody},get children(){return e.afterBody}})]}L(["click"]);export{Te as M,we as a,xe as b};
@@ -0,0 +1 @@
1
+ import{I as o}from"./Icon-DObhsRtm.js";import{c as r,q as s}from"./define-By-uL588.js";var e=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],m=a=>r(o,s(a,{name:"MessageCircle",iconNode:e})),i=m;export{i as m};
@@ -0,0 +1 @@
1
+ import{I as e}from"./Icon-DObhsRtm.js";import{c as o,q as r}from"./define-By-uL588.js";var m=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]],s=a=>o(e,r(a,{name:"MessageSquare",iconNode:m})),i=s;export{i as m};
@@ -1 +1 @@
1
- import{I as i}from"./Icon--Y8vsFal.js";import{c as n,m as y}from"./define-wjHR1MkU.js";var o=[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]],a=e=>n(i,y(e,{name:"Maximize2",iconNode:o})),l=a,m=[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]],p=e=>n(i,y(e,{name:"Minimize2",iconNode:m})),x=p;export{l as a,x as m};
1
+ import{I as i}from"./Icon-DObhsRtm.js";import{c as n,q as y}from"./define-By-uL588.js";var o=[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]],a=e=>n(i,y(e,{name:"Maximize2",iconNode:o})),l=a,m=[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]],p=e=>n(i,y(e,{name:"Minimize2",iconNode:m})),x=p;export{l as a,x as m};
@@ -1 +1 @@
1
- import{s as y,c as n,m as k,j as O,F as h,g as R,i as s,S as p,a as f,d as x,b as j,t as u,e as B}from"./define-wjHR1MkU.js";import{c as v}from"./cn-CU7UAWzk.js";import{c as S,D as z,a as D,d as F}from"./dropdown-BgWTthUx.js";import{B as $}from"./button-flUbeufF.js";var A=u('<svg width=12 height=12 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><polyline points="6 9 12 15 18 9">'),E=u('<span class="text-caption text-muted-foreground">'),G=u('<div class="flex flex-col"><span>'),J=u("<div class=pl-2>"),P=u('<div><button type=button class="flex w-full items-center justify-between rounded-md px-2 py-1.5 text-body outline-none transition-colors hover:bg-muted focus:bg-muted">');const C=o=>(()=>{var e=A();return f(()=>x(e,"class",o.class)),e})();function b(o){const e=()=>o.model.description??o.model.provider,c=()=>o.model.id===o.currentModelId;return n(F,{get checked(){return c()},onSelect:()=>{o.onModelChange(o.model.id),o.onClose()},get children(){var d=G(),a=d.firstChild;return s(a,()=>o.model.name),s(d,n(p,{get when(){return e()},get children(){var i=E();return s(i,e),i}}),null),f(()=>j(a,v("text-body",c()&&"font-medium text-foreground"))),d}})}function _(o){const[e]=y(o,["models","currentModelId","onModelChange","class","defaultOpen","disabled","controllerRef"]),c=()=>e.models.find(r=>r.id===e.currentModelId);let d;const a=()=>d?.setOpen(!1),i=()=>e.models.filter(r=>!r.group),w=()=>{const r=[],t=new Map;for(const l of e.models)l.group&&(t.has(l.group)||(t.set(l.group,[]),r.push(l.group)),t.get(l.group).push(l));return r.map(l=>({name:l,models:t.get(l)}))};return n(p,{get when(){return e.models.length>1},get children(){return n(S,{get defaultOpen(){return e.defaultOpen},get disabled(){return e.disabled},controllerRef:r=>{var t;d=r,(t=e.controllerRef)==null||t.call(e,r)},get children(){return[n(z,{as:r=>n($,k({variant:"ghost",size:"sm",get class(){return v("gap-1 text-meta text-muted-foreground",e.class)}},r,{get children(){return[O(()=>{var t;return((t=c())==null?void 0:t.name)??e.currentModelId}),n(C,{})]}}))}),n(D,{get children(){return[n(h,{get each(){return i()},children:r=>n(b,{model:r,get currentModelId(){return e.currentModelId},get onModelChange(){return e.onModelChange},onClose:a})}),n(h,{get each(){return w()},children:r=>{const[t,l]=R(!1);return(()=>{var m=P(),g=m.firstChild;return g.$$click=()=>l(!t()),s(g,()=>r.name,null),s(g,n(C,{get class(){return v("transition-transform",t()&&"rotate-180")}}),null),s(m,n(p,{get when(){return t()},get children(){var M=J();return s(M,n(h,{get each(){return r.models},children:I=>n(b,{model:I,get currentModelId(){return e.currentModelId},get onModelChange(){return e.onModelChange},onClose:a})})),M}}),null),f(()=>x(g,"aria-expanded",t())),m})()}})]}})]}})}})}B(["click"]);export{_ as M};
1
+ import{s as y,c as n,q as k,m as O,F as h,g as R,i as s,S as p,a as f,d as x,b as B,t as u,e as S}from"./define-By-uL588.js";import{c as v}from"./cn-DN5AWfiS.js";import{c as j,D as q,a as z,d as D}from"./dropdown-wZVeJOMd.js";import{B as F}from"./button-DkuOnGLy.js";var $=u('<svg width=12 height=12 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><polyline points="6 9 12 15 18 9">'),A=u('<span class="text-caption text-muted-foreground">'),E=u('<div class="flex flex-col"><span>'),J=u("<div class=pl-2>"),P=u('<div><button type=button class="flex w-full items-center justify-between rounded-md px-2 py-1.5 text-body outline-none transition-colors hover:bg-muted focus:bg-muted">');const C=o=>(()=>{var e=$();return f(()=>x(e,"class",o.class)),e})();function b(o){const e=()=>o.model.description??o.model.provider,c=()=>o.model.id===o.currentModelId;return n(D,{get checked(){return c()},onSelect:()=>{o.onModelChange(o.model.id),o.onClose()},get children(){var d=E(),a=d.firstChild;return s(a,()=>o.model.name),s(d,n(p,{get when(){return e()},get children(){var i=A();return s(i,e),i}}),null),f(()=>B(a,v("text-body",c()&&"font-medium text-foreground"))),d}})}function _(o){const[e]=y(o,["models","currentModelId","onModelChange","class","defaultOpen","disabled","controllerRef"]),c=()=>e.models.find(r=>r.id===e.currentModelId);let d;const a=()=>d?.setOpen(!1),i=()=>e.models.filter(r=>!r.group),w=()=>{const r=[],t=new Map;for(const l of e.models)l.group&&(t.has(l.group)||(t.set(l.group,[]),r.push(l.group)),t.get(l.group).push(l));return r.map(l=>({name:l,models:t.get(l)}))};return n(p,{get when(){return e.models.length>1},get children(){return n(j,{get defaultOpen(){return e.defaultOpen},get disabled(){return e.disabled},controllerRef:r=>{var t;d=r,(t=e.controllerRef)==null||t.call(e,r)},get children(){return[n(q,{as:r=>n(F,k({variant:"ghost",size:"sm",get class(){return v("gap-1 text-meta text-muted-foreground",e.class)}},r,{get children(){return[O(()=>{var t;return((t=c())==null?void 0:t.name)??e.currentModelId}),n(C,{})]}}))}),n(z,{get children(){return[n(h,{get each(){return i()},children:r=>n(b,{model:r,get currentModelId(){return e.currentModelId},get onModelChange(){return e.onModelChange},onClose:a})}),n(h,{get each(){return w()},children:r=>{const[t,l]=R(!1);return(()=>{var m=P(),g=m.firstChild;return g.$$click=()=>l(!t()),s(g,()=>r.name,null),s(g,n(C,{get class(){return v("transition-transform",t()&&"rotate-180")}}),null),s(m,n(p,{get when(){return t()},get children(){var M=J();return s(M,n(h,{get each(){return r.models},children:I=>n(b,{model:I,get currentModelId(){return e.currentModelId},get onModelChange(){return e.onModelChange},onClose:a})})),M}}),null),f(()=>x(g,"aria-expanded",t())),m})()}})]}})]}})}})}S(["click"]);export{_ as M};
@@ -1 +1 @@
1
- import{s as qt,c as Xt,m as _t,D as jt,g as tt,k as ut,h as dt}from"./define-wjHR1MkU.js";const Yt=["top","right","bottom","left"],_=Math.min,$=Math.max,ot=Math.round,it=Math.floor,A=t=>({x:t,y:t}),Jt={left:"right",right:"left",bottom:"top",top:"bottom"};function mt(t,e,n){return $(t,_(e,n))}function j(t,e){return typeof t=="function"?t(e):t}function I(t){return t.split("-")[0]}function et(t){return t.split("-")[1]}function Et(t){return t==="x"?"y":"x"}function ht(t){return t==="y"?"height":"width"}function M(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function pt(t){return Et(M(t))}function Gt(t,e,n){n===void 0&&(n=!1);const o=et(t),i=pt(t),c=ht(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[c]>e.floating[c]&&(r=rt(r)),[r,rt(r)]}function Kt(t){const e=rt(t);return[gt(t),e,gt(e)]}function gt(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Lt=["left","right"],Ot=["right","left"],Ut=["top","bottom"],Qt=["bottom","top"];function Zt(t,e,n){switch(t){case"top":case"bottom":return n?e?Ot:Lt:e?Lt:Ot;case"left":case"right":return e?Ut:Qt;default:return[]}}function te(t,e,n,o){const i=et(t);let c=Zt(I(t),n==="start",o);return i&&(c=c.map(r=>r+"-"+i),e&&(c=c.concat(c.map(gt)))),c}function rt(t){const e=I(t);return Jt[e]+t.slice(e.length)}function ee(t){return{top:0,right:0,bottom:0,left:0,...t}}function Tt(t){return typeof t!="number"?ee(t):{top:t,right:t,bottom:t,left:t}}function ct(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function Dt(t,e,n){let{reference:o,floating:i}=t;const c=M(e),r=pt(e),s=ht(r),a=I(e),l=c==="y",u=o.x+o.width/2-i.width/2,d=o.y+o.height/2-i.height/2,m=o[s]/2-i[s]/2;let f;switch(a){case"top":f={x:u,y:o.y-i.height};break;case"bottom":f={x:u,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:d};break;case"left":f={x:o.x-i.width,y:d};break;default:f={x:o.x,y:o.y}}switch(et(e)){case"start":f[r]-=m*(n&&l?-1:1);break;case"end":f[r]+=m*(n&&l?-1:1);break}return f}async function ne(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:c,rects:r,elements:s,strategy:a}=t,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:m=!1,padding:f=0}=j(e,t),h=Tt(f),p=s[m?d==="floating"?"reference":"floating":d],y=ct(await c.getClippingRect({element:(n=await(c.isElement==null?void 0:c.isElement(p)))==null||n?p:p.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(s.floating)),boundary:l,rootBoundary:u,strategy:a})),g=d==="floating"?{x:o,y:i,width:r.floating.width,height:r.floating.height}:r.reference,w=await(c.getOffsetParent==null?void 0:c.getOffsetParent(s.floating)),x=await(c.isElement==null?void 0:c.isElement(w))?await(c.getScale==null?void 0:c.getScale(w))||{x:1,y:1}:{x:1,y:1},v=ct(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:g,offsetParent:w,strategy:a}):g);return{top:(y.top-v.top+h.top)/x.y,bottom:(v.bottom-y.bottom+h.bottom)/x.y,left:(y.left-v.left+h.left)/x.x,right:(v.right-y.right+h.right)/x.x}}const oe=50,ie=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:c=[],platform:r}=n,s=r.detectOverflow?r:{...r,detectOverflow:ne},a=await(r.isRTL==null?void 0:r.isRTL(e));let l=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:d}=Dt(l,o,a),m=o,f=0;const h={};for(let p=0;p<c.length;p++){const y=c[p];if(!y)continue;const{name:g,fn:w}=y,{x,y:v,data:E,reset:b}=await w({x:u,y:d,initialPlacement:o,placement:m,strategy:i,middlewareData:h,rects:l,platform:s,elements:{reference:t,floating:e}});u=x??u,d=v??d,h[g]={...h[g],...E},b&&f<oe&&(f++,typeof b=="object"&&(b.placement&&(m=b.placement),b.rects&&(l=b.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:i}):b.rects),{x:u,y:d}=Dt(l,m,a)),p=-1)}return{x:u,y:d,placement:m,strategy:i,middlewareData:h}},re=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:c,platform:r,elements:s,middlewareData:a}=e,{element:l,padding:u=0}=j(t,e)||{};if(l==null)return{};const d=Tt(u),m={x:n,y:o},f=pt(i),h=ht(f),p=await r.getDimensions(l),y=f==="y",g=y?"top":"left",w=y?"bottom":"right",x=y?"clientHeight":"clientWidth",v=c.reference[h]+c.reference[f]-m[f]-c.floating[h],E=m[f]-c.reference[f],b=await(r.getOffsetParent==null?void 0:r.getOffsetParent(l));let B=b?b[x]:0;(!B||!await(r.isElement==null?void 0:r.isElement(b)))&&(B=s.floating[x]||c.floating[h]);const U=v/2-E/2,N=B/2-p[h]/2-1,S=_(d[g],N),Q=_(d[w],N),V=S,Z=B-p[h]-Q,R=B/2-p[h]/2+U,z=mt(V,R,Z),k=!a.arrow&&et(i)!=null&&R!==z&&c.reference[h]/2-(R<V?S:Q)-p[h]/2<0,L=k?R<V?R-V:R-Z:0;return{[f]:m[f]+L,data:{[f]:z,centerOffset:R-z-L,...k&&{alignmentOffset:L}},reset:k}}}),ce=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:c,rects:r,initialPlacement:s,platform:a,elements:l}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:p=!0,...y}=j(t,e);if((n=c.arrow)!=null&&n.alignmentOffset)return{};const g=I(i),w=M(s),x=I(s)===s,v=await(a.isRTL==null?void 0:a.isRTL(l.floating)),E=m||(x||!p?[rt(s)]:Kt(s)),b=h!=="none";!m&&b&&E.push(...te(s,p,h,v));const B=[s,...E],U=await a.detectOverflow(e,y),N=[];let S=((o=c.flip)==null?void 0:o.overflows)||[];if(u&&N.push(U[g]),d){const R=Gt(i,r,v);N.push(U[R[0]],U[R[1]])}if(S=[...S,{placement:i,overflows:N}],!N.every(R=>R<=0)){var Q,V;const R=(((Q=c.flip)==null?void 0:Q.index)||0)+1,z=B[R];if(z&&(!(d==="alignment"&&w!==M(z))||S.every(L=>M(L.placement)===w?L.overflows[0]>0:!0)))return{data:{index:R,overflows:S},reset:{placement:z}};let k=(V=S.filter(L=>L.overflows[0]<=0).sort((L,P)=>L.overflows[1]-P.overflows[1])[0])==null?void 0:V.placement;if(!k)switch(f){case"bestFit":{var Z;const L=(Z=S.filter(P=>{if(b){const H=M(P.placement);return H===w||H==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(H=>H>0).reduce((H,It)=>H+It,0)]).sort((P,H)=>P[1]-H[1])[0])==null?void 0:Z[0];L&&(k=L);break}case"initialPlacement":k=s;break}if(i!==k)return{reset:{placement:k}}}return{}}}};function At(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Ct(t){return Yt.some(e=>t[e]>=0)}const se=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:o}=e,{strategy:i="referenceHidden",...c}=j(t,e);switch(i){case"referenceHidden":{const r=await o.detectOverflow(e,{...c,elementContext:"reference"}),s=At(r,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Ct(s)}}}case"escaped":{const r=await o.detectOverflow(e,{...c,altBoundary:!0}),s=At(r,n.floating);return{data:{escapedOffsets:s,escaped:Ct(s)}}}default:return{}}}}},le=new Set(["left","top"]);async function ae(t,e){const{placement:n,platform:o,elements:i}=t,c=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=I(n),s=et(n),a=M(n)==="y",l=le.has(r)?-1:1,u=c&&a?-1:1,d=j(e,t);let{mainAxis:m,crossAxis:f,alignmentAxis:h}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof h=="number"&&(f=s==="end"?h*-1:h),a?{x:f*u,y:m*l}:{x:m*l,y:f*u}}const fe=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:c,placement:r,middlewareData:s}=e,a=await ae(e,t);return r===((n=s.offset)==null?void 0:n.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:i+a.x,y:c+a.y,data:{...a,placement:r}}}}},ue=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i,platform:c}=e,{mainAxis:r=!0,crossAxis:s=!1,limiter:a={fn:g=>{let{x:w,y:x}=g;return{x:w,y:x}}},...l}=j(t,e),u={x:n,y:o},d=await c.detectOverflow(e,l),m=M(I(i)),f=Et(m);let h=u[f],p=u[m];if(r){const g=f==="y"?"top":"left",w=f==="y"?"bottom":"right",x=h+d[g],v=h-d[w];h=mt(x,h,v)}if(s){const g=m==="y"?"top":"left",w=m==="y"?"bottom":"right",x=p+d[g],v=p-d[w];p=mt(x,p,v)}const y=a.fn({...e,[f]:h,[m]:p});return{...y,data:{x:y.x-n,y:y.y-o,enabled:{[f]:r,[m]:s}}}}}};function st(){return typeof window<"u"}function Y(t){return St(t)?(t.nodeName||"").toLowerCase():"#document"}function O(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function C(t){var e;return(e=(St(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function St(t){return st()?t instanceof Node||t instanceof O(t).Node:!1}function T(t){return st()?t instanceof Element||t instanceof O(t).Element:!1}function F(t){return st()?t instanceof HTMLElement||t instanceof O(t).HTMLElement:!1}function kt(t){return!st()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof O(t).ShadowRoot}function nt(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=D(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&i!=="inline"&&i!=="contents"}function de(t){return/^(table|td|th)$/.test(Y(t))}function lt(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const me=/transform|translate|scale|rotate|perspective|filter/,he=/paint|layout|strict|content/,q=t=>!!t&&t!=="none";let yt;function wt(t){const e=T(t)?D(t):t;return q(e.transform)||q(e.translate)||q(e.scale)||q(e.rotate)||q(e.perspective)||!xt()&&(q(e.backdropFilter)||q(e.filter))||me.test(e.willChange||"")||he.test(e.contain||"")}function pe(t){let e=W(t);for(;F(e)&&!J(e);){if(wt(e))return e;if(lt(e))return null;e=W(e)}return null}function xt(){return yt==null&&(yt=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),yt}function J(t){return/^(html|body|#document)$/.test(Y(t))}function D(t){return O(t).getComputedStyle(t)}function at(t){return T(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function W(t){if(Y(t)==="html")return t;const e=t.assignedSlot||t.parentNode||kt(t)&&t.host||C(t);return kt(e)?e.host:e}function Ft(t){const e=W(t);return J(e)?t.ownerDocument?t.ownerDocument.body:t.body:F(e)&&nt(e)?e:Ft(e)}function G(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Ft(t),c=i===((o=t.ownerDocument)==null?void 0:o.body),r=O(i);if(c){const s=vt(r);return e.concat(r,r.visualViewport||[],nt(i)?i:[],s&&n?G(s):[])}else return e.concat(i,G(i,[],n))}function vt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Pt(t){const e=D(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=F(t),c=i?t.offsetWidth:n,r=i?t.offsetHeight:o,s=ot(n)!==c||ot(o)!==r;return s&&(n=c,o=r),{width:n,height:o,$:s}}function bt(t){return T(t)?t:t.contextElement}function K(t){const e=bt(t);if(!F(e))return A(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:c}=Pt(e);let r=(c?ot(n.width):n.width)/o,s=(c?ot(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!s||!Number.isFinite(s))&&(s=1),{x:r,y:s}}const ge=A(0);function Ht(t){const e=O(t);return!xt()||!e.visualViewport?ge:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ye(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==O(t)?!1:e}function X(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),c=bt(t);let r=A(1);e&&(o?T(o)&&(r=K(o)):r=K(t));const s=ye(c,n,o)?Ht(c):A(0);let a=(i.left+s.x)/r.x,l=(i.top+s.y)/r.y,u=i.width/r.x,d=i.height/r.y;if(c){const m=O(c),f=o&&T(o)?O(o):o;let h=m,p=vt(h);for(;p&&o&&f!==h;){const y=K(p),g=p.getBoundingClientRect(),w=D(p),x=g.left+(p.clientLeft+parseFloat(w.paddingLeft))*y.x,v=g.top+(p.clientTop+parseFloat(w.paddingTop))*y.y;a*=y.x,l*=y.y,u*=y.x,d*=y.y,a+=x,l+=v,h=O(p),p=vt(h)}}return ct({width:u,height:d,x:a,y:l})}function ft(t,e){const n=at(t).scrollLeft;return e?e.left+n:X(C(t)).left+n}function Mt(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-ft(t,n),i=n.top+e.scrollTop;return{x:o,y:i}}function we(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const c=i==="fixed",r=C(o),s=e?lt(e.floating):!1;if(o===r||s&&c)return n;let a={scrollLeft:0,scrollTop:0},l=A(1);const u=A(0),d=F(o);if((d||!d&&!c)&&((Y(o)!=="body"||nt(r))&&(a=at(o)),d)){const f=X(o);l=K(o),u.x=f.x+o.clientLeft,u.y=f.y+o.clientTop}const m=r&&!d&&!c?Mt(r,a):A(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-a.scrollLeft*l.x+u.x+m.x,y:n.y*l.y-a.scrollTop*l.y+u.y+m.y}}function xe(t){return Array.from(t.getClientRects())}function ve(t){const e=C(t),n=at(t),o=t.ownerDocument.body,i=$(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),c=$(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+ft(t);const s=-n.scrollTop;return D(o).direction==="rtl"&&(r+=$(e.clientWidth,o.clientWidth)-i),{width:i,height:c,x:r,y:s}}const Wt=25;function be(t,e){const n=O(t),o=C(t),i=n.visualViewport;let c=o.clientWidth,r=o.clientHeight,s=0,a=0;if(i){c=i.width,r=i.height;const u=xt();(!u||u&&e==="fixed")&&(s=i.offsetLeft,a=i.offsetTop)}const l=ft(o);if(l<=0){const u=o.ownerDocument,d=u.body,m=getComputedStyle(d),f=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,h=Math.abs(o.clientWidth-d.clientWidth-f);h<=Wt&&(c-=h)}else l<=Wt&&(c+=l);return{width:c,height:r,x:s,y:a}}function Re(t,e){const n=X(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,c=F(t)?K(t):A(1),r=t.clientWidth*c.x,s=t.clientHeight*c.y,a=i*c.x,l=o*c.y;return{width:r,height:s,x:a,y:l}}function Bt(t,e,n){let o;if(e==="viewport")o=be(t,n);else if(e==="document")o=ve(C(t));else if(T(e))o=Re(e,n);else{const i=Ht(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return ct(o)}function Nt(t,e){const n=W(t);return n===e||!T(n)||J(n)?!1:D(n).position==="fixed"||Nt(n,e)}function Ee(t,e){const n=e.get(t);if(n)return n;let o=G(t,[],!1).filter(s=>T(s)&&Y(s)!=="body"),i=null;const c=D(t).position==="fixed";let r=c?W(t):t;for(;T(r)&&!J(r);){const s=D(r),a=wt(r);!a&&s.position==="fixed"&&(i=null),(c?!a&&!i:!a&&s.position==="static"&&i&&(i.position==="absolute"||i.position==="fixed")||nt(r)&&!a&&Nt(t,r))?o=o.filter(l=>l!==r):i=s,r=W(r)}return e.set(t,o),o}function Le(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const c=[...n==="clippingAncestors"?lt(e)?[]:Ee(e,this._c):[].concat(n),o],r=Bt(e,c[0],i);let s=r.top,a=r.right,l=r.bottom,u=r.left;for(let d=1;d<c.length;d++){const m=Bt(e,c[d],i);s=$(m.top,s),a=_(m.right,a),l=_(m.bottom,l),u=$(m.left,u)}return{width:a-u,height:l-s,x:u,y:s}}function Oe(t){const{width:e,height:n}=Pt(t);return{width:e,height:n}}function Te(t,e,n){const o=F(e),i=C(e),c=n==="fixed",r=X(t,!0,c,e);let s={scrollLeft:0,scrollTop:0};const a=A(0);function l(){a.x=ft(i)}if(o||!o&&!c)if((Y(e)!=="body"||nt(i))&&(s=at(e)),o){const f=X(e,!0,c,e);a.x=f.x+e.clientLeft,a.y=f.y+e.clientTop}else i&&l();c&&!o&&i&&l();const u=i&&!o&&!c?Mt(i,s):A(0),d=r.left+s.scrollLeft-a.x-u.x,m=r.top+s.scrollTop-a.y-u.y;return{x:d,y:m,width:r.width,height:r.height}}function Rt(t){return D(t).position==="static"}function Vt(t,e){if(!F(t)||D(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return C(t)===n&&(n=n.ownerDocument.body),n}function zt(t,e){const n=O(t);if(lt(t))return n;if(!F(t)){let i=W(t);for(;i&&!J(i);){if(T(i)&&!Rt(i))return i;i=W(i)}return n}let o=Vt(t,e);for(;o&&de(o)&&Rt(o);)o=Vt(o,e);return o&&J(o)&&Rt(o)&&!wt(o)?n:o||pe(t)||n}const De=async function(t){const e=this.getOffsetParent||zt,n=this.getDimensions,o=await n(t.floating);return{reference:Te(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Ae(t){return D(t).direction==="rtl"}const Ce={convertOffsetParentRelativeRectToViewportRelativeRect:we,getDocumentElement:C,getClippingRect:Le,getOffsetParent:zt,getElementRects:De,getClientRects:xe,getDimensions:Oe,getScale:K,isElement:T,isRTL:Ae};function $t(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Se(t,e){let n=null,o;const i=C(t);function c(){var s;clearTimeout(o),(s=n)==null||s.disconnect(),n=null}function r(s,a){s===void 0&&(s=!1),a===void 0&&(a=1),c();const l=t.getBoundingClientRect(),{left:u,top:d,width:m,height:f}=l;if(s||e(),!m||!f)return;const h=it(d),p=it(i.clientWidth-(u+m)),y=it(i.clientHeight-(d+f)),g=it(u),w={rootMargin:-h+"px "+-p+"px "+-y+"px "+-g+"px",threshold:$(0,_(1,a))||1};let x=!0;function v(E){const b=E[0].intersectionRatio;if(b!==a){if(!x)return r();b?r(!1,b):o=setTimeout(()=>{r(!1,1e-7)},1e3)}b===1&&!$t(l,t.getBoundingClientRect())&&r(),x=!1}try{n=new IntersectionObserver(v,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(v,w)}n.observe(t)}return r(!0),c}function ke(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:c=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:a=!1}=o,l=bt(t),u=i||c?[...l?G(l):[],...e?G(e):[]]:[];u.forEach(g=>{i&&g.addEventListener("scroll",n,{passive:!0}),c&&g.addEventListener("resize",n)});const d=l&&s?Se(l,n):null;let m=-1,f=null;r&&(f=new ResizeObserver(g=>{let[w]=g;w&&w.target===l&&f&&e&&(f.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var x;(x=f)==null||x.observe(e)})),n()}),l&&!a&&f.observe(l),e&&f.observe(e));let h,p=a?X(t):null;a&&y();function y(){const g=X(t);p&&!$t(p,g)&&n(),p=g,h=requestAnimationFrame(y)}return n(),()=>{var g;u.forEach(w=>{i&&w.removeEventListener("scroll",n),c&&w.removeEventListener("resize",n)}),d?.(),(g=f)==null||g.disconnect(),f=null,a&&cancelAnimationFrame(h)}}const Fe=fe,Pe=ue,He=ce,Me=se,We=re,Be=(t,e,n)=>{const o=new Map,i={platform:Ce,...n},c={...i.platform,_c:o};return ie(t,e,{...i,platform:c})};function Ne(t){const[e,n]=tt(t()),[o,i]=tt(t()?"open":"closed");let c,r=0;const s=a=>{c=a};return ut(a=>{const l=t();if(l)r++,n(!0),i("open");else if(a){i("closed");const u=c,d=u&&(()=>{const h=getComputedStyle(u);return h.animationName!=="none"&&parseFloat(h.animationDuration||"0")>0})();if(!u||!d){const h=++r;return queueMicrotask(()=>{h===r&&n(!1)}),l}const m=u,f=h=>{h.target===m&&(m.removeEventListener("animationend",f),n(!1))};m.addEventListener("animationend",f),dt(()=>m.removeEventListener("animationend",f))}return l}),{present:e,state:o,setRef:s}}function Ve(t){const[e,n]=qt(t,["as"]);return typeof e.as=="function"?e.as(n):Xt(jt,_t({get component(){return e.as??"span"}},n))}function ze(t){let e=t;for(;e;){if(e instanceof Element&&e.closest("[inert]"))return!0;const n=e.getRootNode();e=n instanceof ShadowRoot?n.host:null}return!1}function $e(t,e){if(typeof MutationObserver!="function")return()=>{};let n=!1;const o=()=>t.isConnected&&!ze(t);let i=o();const c=()=>{if(!n){if(o()){i=!0;return}i&&(n=!0,r.disconnect(),e())}},r=new MutationObserver(c),s=new Set;typeof document<"u"&&s.add(document);const a=t.getRootNode();a&&s.add(a);for(const l of s)try{r.observe(l,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["inert"]})}catch{}return()=>r.disconnect()}function Ie(t,e,n={}){const[o,i]=tt({x:0,y:0,placement:n.placement??"bottom"}),[c,r]=tt({}),[s,a]=tt(!1);return ut(()=>{const l=t(),u=e();if(!l||!u)return;const d=()=>{var p;const y=[Fe(n.gutter??8),He(),Pe({padding:8})],g=(p=n.arrowEl)==null?void 0:p.call(n);g&&y.push(We({element:g})),y.push(Me()),Be(l,u,{placement:n.placement??"bottom",strategy:"fixed",middleware:y}).then(({x:w,y:x,placement:v,middlewareData:E})=>{var b;i({x:w,y:x,placement:v}),E.arrow&&r({x:E.arrow.x,y:E.arrow.y}),a(!!((b=E.hide)!=null&&b.referenceHidden))})},m=ke(l,u,d);let f;if(typeof ResizeObserver=="function"&&l instanceof Element){f=new ResizeObserver(d),f.observe(l);for(const p of G(l))p instanceof Element&&f.observe(p)}const h=n.onDisconnect?$e(l,n.onDisconnect):void 0;dt(()=>{m(),f?.disconnect(),h?.()})}),{pos:o,arrowPos:c,hidden:s}}function qe(t){ut(()=>{if(!t.enabled())return;const e=i=>{i.key==="Escape"&&t.onDismiss("escape")},n=i=>{const c=i.target;t.refs().some(r=>r&&r.contains(c))||t.onDismiss("outside")},o=document;o.addEventListener("keydown",e),o.addEventListener("pointerdown",n,!0),dt(()=>{o.removeEventListener("keydown",e),o.removeEventListener("pointerdown",n,!0)})})}export{Ve as A,qe as a,Ne as c,Ie as u};
1
+ import{s as It,c as jt,q as Xt,D as _t,g as tt,j as ut,h as dt}from"./define-By-uL588.js";const Yt=["top","right","bottom","left"],X=Math.min,$=Math.max,ot=Math.round,it=Math.floor,A=t=>({x:t,y:t}),Jt={left:"right",right:"left",bottom:"top",top:"bottom"};function mt(t,e,n){return $(t,X(e,n))}function _(t,e){return typeof t=="function"?t(e):t}function q(t){return t.split("-")[0]}function et(t){return t.split("-")[1]}function Et(t){return t==="x"?"y":"x"}function ht(t){return t==="y"?"height":"width"}function M(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function pt(t){return Et(M(t))}function Gt(t,e,n){n===void 0&&(n=!1);const o=et(t),i=pt(t),c=ht(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[c]>e.floating[c]&&(r=rt(r)),[r,rt(r)]}function Kt(t){const e=rt(t);return[gt(t),e,gt(e)]}function gt(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Lt=["left","right"],Ot=["right","left"],Ut=["top","bottom"],Qt=["bottom","top"];function Zt(t,e,n){switch(t){case"top":case"bottom":return n?e?Ot:Lt:e?Lt:Ot;case"left":case"right":return e?Ut:Qt;default:return[]}}function te(t,e,n,o){const i=et(t);let c=Zt(q(t),n==="start",o);return i&&(c=c.map(r=>r+"-"+i),e&&(c=c.concat(c.map(gt)))),c}function rt(t){const e=q(t);return Jt[e]+t.slice(e.length)}function ee(t){return{top:0,right:0,bottom:0,left:0,...t}}function Tt(t){return typeof t!="number"?ee(t):{top:t,right:t,bottom:t,left:t}}function ct(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function Dt(t,e,n){let{reference:o,floating:i}=t;const c=M(e),r=pt(e),s=ht(r),a=q(e),l=c==="y",u=o.x+o.width/2-i.width/2,d=o.y+o.height/2-i.height/2,m=o[s]/2-i[s]/2;let f;switch(a){case"top":f={x:u,y:o.y-i.height};break;case"bottom":f={x:u,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:d};break;case"left":f={x:o.x-i.width,y:d};break;default:f={x:o.x,y:o.y}}switch(et(e)){case"start":f[r]-=m*(n&&l?-1:1);break;case"end":f[r]+=m*(n&&l?-1:1);break}return f}async function ne(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:c,rects:r,elements:s,strategy:a}=t,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:m=!1,padding:f=0}=_(e,t),h=Tt(f),p=s[m?d==="floating"?"reference":"floating":d],y=ct(await c.getClippingRect({element:(n=await(c.isElement==null?void 0:c.isElement(p)))==null||n?p:p.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(s.floating)),boundary:l,rootBoundary:u,strategy:a})),g=d==="floating"?{x:o,y:i,width:r.floating.width,height:r.floating.height}:r.reference,w=await(c.getOffsetParent==null?void 0:c.getOffsetParent(s.floating)),x=await(c.isElement==null?void 0:c.isElement(w))?await(c.getScale==null?void 0:c.getScale(w))||{x:1,y:1}:{x:1,y:1},v=ct(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:g,offsetParent:w,strategy:a}):g);return{top:(y.top-v.top+h.top)/x.y,bottom:(v.bottom-y.bottom+h.bottom)/x.y,left:(y.left-v.left+h.left)/x.x,right:(v.right-y.right+h.right)/x.x}}const oe=50,ie=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:c=[],platform:r}=n,s=r.detectOverflow?r:{...r,detectOverflow:ne},a=await(r.isRTL==null?void 0:r.isRTL(e));let l=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:d}=Dt(l,o,a),m=o,f=0;const h={};for(let p=0;p<c.length;p++){const y=c[p];if(!y)continue;const{name:g,fn:w}=y,{x,y:v,data:E,reset:b}=await w({x:u,y:d,initialPlacement:o,placement:m,strategy:i,middlewareData:h,rects:l,platform:s,elements:{reference:t,floating:e}});u=x??u,d=v??d,h[g]={...h[g],...E},b&&f<oe&&(f++,typeof b=="object"&&(b.placement&&(m=b.placement),b.rects&&(l=b.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:i}):b.rects),{x:u,y:d}=Dt(l,m,a)),p=-1)}return{x:u,y:d,placement:m,strategy:i,middlewareData:h}},re=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:c,platform:r,elements:s,middlewareData:a}=e,{element:l,padding:u=0}=_(t,e)||{};if(l==null)return{};const d=Tt(u),m={x:n,y:o},f=pt(i),h=ht(f),p=await r.getDimensions(l),y=f==="y",g=y?"top":"left",w=y?"bottom":"right",x=y?"clientHeight":"clientWidth",v=c.reference[h]+c.reference[f]-m[f]-c.floating[h],E=m[f]-c.reference[f],b=await(r.getOffsetParent==null?void 0:r.getOffsetParent(l));let B=b?b[x]:0;(!B||!await(r.isElement==null?void 0:r.isElement(b)))&&(B=s.floating[x]||c.floating[h]);const U=v/2-E/2,N=B/2-p[h]/2-1,S=X(d[g],N),Q=X(d[w],N),V=S,Z=B-p[h]-Q,R=B/2-p[h]/2+U,z=mt(V,R,Z),k=!a.arrow&&et(i)!=null&&R!==z&&c.reference[h]/2-(R<V?S:Q)-p[h]/2<0,L=k?R<V?R-V:R-Z:0;return{[f]:m[f]+L,data:{[f]:z,centerOffset:R-z-L,...k&&{alignmentOffset:L}},reset:k}}}),ce=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:c,rects:r,initialPlacement:s,platform:a,elements:l}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:p=!0,...y}=_(t,e);if((n=c.arrow)!=null&&n.alignmentOffset)return{};const g=q(i),w=M(s),x=q(s)===s,v=await(a.isRTL==null?void 0:a.isRTL(l.floating)),E=m||(x||!p?[rt(s)]:Kt(s)),b=h!=="none";!m&&b&&E.push(...te(s,p,h,v));const B=[s,...E],U=await a.detectOverflow(e,y),N=[];let S=((o=c.flip)==null?void 0:o.overflows)||[];if(u&&N.push(U[g]),d){const R=Gt(i,r,v);N.push(U[R[0]],U[R[1]])}if(S=[...S,{placement:i,overflows:N}],!N.every(R=>R<=0)){var Q,V;const R=(((Q=c.flip)==null?void 0:Q.index)||0)+1,z=B[R];if(z&&(!(d==="alignment"&&w!==M(z))||S.every(L=>M(L.placement)===w?L.overflows[0]>0:!0)))return{data:{index:R,overflows:S},reset:{placement:z}};let k=(V=S.filter(L=>L.overflows[0]<=0).sort((L,P)=>L.overflows[1]-P.overflows[1])[0])==null?void 0:V.placement;if(!k)switch(f){case"bestFit":{var Z;const L=(Z=S.filter(P=>{if(b){const H=M(P.placement);return H===w||H==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(H=>H>0).reduce((H,qt)=>H+qt,0)]).sort((P,H)=>P[1]-H[1])[0])==null?void 0:Z[0];L&&(k=L);break}case"initialPlacement":k=s;break}if(i!==k)return{reset:{placement:k}}}return{}}}};function At(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Ct(t){return Yt.some(e=>t[e]>=0)}const se=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:o}=e,{strategy:i="referenceHidden",...c}=_(t,e);switch(i){case"referenceHidden":{const r=await o.detectOverflow(e,{...c,elementContext:"reference"}),s=At(r,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Ct(s)}}}case"escaped":{const r=await o.detectOverflow(e,{...c,altBoundary:!0}),s=At(r,n.floating);return{data:{escapedOffsets:s,escaped:Ct(s)}}}default:return{}}}}},le=new Set(["left","top"]);async function ae(t,e){const{placement:n,platform:o,elements:i}=t,c=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=q(n),s=et(n),a=M(n)==="y",l=le.has(r)?-1:1,u=c&&a?-1:1,d=_(e,t);let{mainAxis:m,crossAxis:f,alignmentAxis:h}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof h=="number"&&(f=s==="end"?h*-1:h),a?{x:f*u,y:m*l}:{x:m*l,y:f*u}}const fe=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:c,placement:r,middlewareData:s}=e,a=await ae(e,t);return r===((n=s.offset)==null?void 0:n.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:i+a.x,y:c+a.y,data:{...a,placement:r}}}}},ue=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i,platform:c}=e,{mainAxis:r=!0,crossAxis:s=!1,limiter:a={fn:g=>{let{x:w,y:x}=g;return{x:w,y:x}}},...l}=_(t,e),u={x:n,y:o},d=await c.detectOverflow(e,l),m=M(q(i)),f=Et(m);let h=u[f],p=u[m];if(r){const g=f==="y"?"top":"left",w=f==="y"?"bottom":"right",x=h+d[g],v=h-d[w];h=mt(x,h,v)}if(s){const g=m==="y"?"top":"left",w=m==="y"?"bottom":"right",x=p+d[g],v=p-d[w];p=mt(x,p,v)}const y=a.fn({...e,[f]:h,[m]:p});return{...y,data:{x:y.x-n,y:y.y-o,enabled:{[f]:r,[m]:s}}}}}};function st(){return typeof window<"u"}function Y(t){return St(t)?(t.nodeName||"").toLowerCase():"#document"}function O(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function C(t){var e;return(e=(St(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function St(t){return st()?t instanceof Node||t instanceof O(t).Node:!1}function T(t){return st()?t instanceof Element||t instanceof O(t).Element:!1}function F(t){return st()?t instanceof HTMLElement||t instanceof O(t).HTMLElement:!1}function kt(t){return!st()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof O(t).ShadowRoot}function nt(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=D(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&i!=="inline"&&i!=="contents"}function de(t){return/^(table|td|th)$/.test(Y(t))}function lt(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const me=/transform|translate|scale|rotate|perspective|filter/,he=/paint|layout|strict|content/,I=t=>!!t&&t!=="none";let yt;function wt(t){const e=T(t)?D(t):t;return I(e.transform)||I(e.translate)||I(e.scale)||I(e.rotate)||I(e.perspective)||!xt()&&(I(e.backdropFilter)||I(e.filter))||me.test(e.willChange||"")||he.test(e.contain||"")}function pe(t){let e=W(t);for(;F(e)&&!J(e);){if(wt(e))return e;if(lt(e))return null;e=W(e)}return null}function xt(){return yt==null&&(yt=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),yt}function J(t){return/^(html|body|#document)$/.test(Y(t))}function D(t){return O(t).getComputedStyle(t)}function at(t){return T(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function W(t){if(Y(t)==="html")return t;const e=t.assignedSlot||t.parentNode||kt(t)&&t.host||C(t);return kt(e)?e.host:e}function Ft(t){const e=W(t);return J(e)?t.ownerDocument?t.ownerDocument.body:t.body:F(e)&&nt(e)?e:Ft(e)}function G(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Ft(t),c=i===((o=t.ownerDocument)==null?void 0:o.body),r=O(i);if(c){const s=vt(r);return e.concat(r,r.visualViewport||[],nt(i)?i:[],s&&n?G(s):[])}else return e.concat(i,G(i,[],n))}function vt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Pt(t){const e=D(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=F(t),c=i?t.offsetWidth:n,r=i?t.offsetHeight:o,s=ot(n)!==c||ot(o)!==r;return s&&(n=c,o=r),{width:n,height:o,$:s}}function bt(t){return T(t)?t:t.contextElement}function K(t){const e=bt(t);if(!F(e))return A(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:c}=Pt(e);let r=(c?ot(n.width):n.width)/o,s=(c?ot(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!s||!Number.isFinite(s))&&(s=1),{x:r,y:s}}const ge=A(0);function Ht(t){const e=O(t);return!xt()||!e.visualViewport?ge:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ye(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==O(t)?!1:e}function j(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),c=bt(t);let r=A(1);e&&(o?T(o)&&(r=K(o)):r=K(t));const s=ye(c,n,o)?Ht(c):A(0);let a=(i.left+s.x)/r.x,l=(i.top+s.y)/r.y,u=i.width/r.x,d=i.height/r.y;if(c){const m=O(c),f=o&&T(o)?O(o):o;let h=m,p=vt(h);for(;p&&o&&f!==h;){const y=K(p),g=p.getBoundingClientRect(),w=D(p),x=g.left+(p.clientLeft+parseFloat(w.paddingLeft))*y.x,v=g.top+(p.clientTop+parseFloat(w.paddingTop))*y.y;a*=y.x,l*=y.y,u*=y.x,d*=y.y,a+=x,l+=v,h=O(p),p=vt(h)}}return ct({width:u,height:d,x:a,y:l})}function ft(t,e){const n=at(t).scrollLeft;return e?e.left+n:j(C(t)).left+n}function Mt(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-ft(t,n),i=n.top+e.scrollTop;return{x:o,y:i}}function we(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const c=i==="fixed",r=C(o),s=e?lt(e.floating):!1;if(o===r||s&&c)return n;let a={scrollLeft:0,scrollTop:0},l=A(1);const u=A(0),d=F(o);if((d||!d&&!c)&&((Y(o)!=="body"||nt(r))&&(a=at(o)),d)){const f=j(o);l=K(o),u.x=f.x+o.clientLeft,u.y=f.y+o.clientTop}const m=r&&!d&&!c?Mt(r,a):A(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-a.scrollLeft*l.x+u.x+m.x,y:n.y*l.y-a.scrollTop*l.y+u.y+m.y}}function xe(t){return Array.from(t.getClientRects())}function ve(t){const e=C(t),n=at(t),o=t.ownerDocument.body,i=$(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),c=$(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+ft(t);const s=-n.scrollTop;return D(o).direction==="rtl"&&(r+=$(e.clientWidth,o.clientWidth)-i),{width:i,height:c,x:r,y:s}}const Wt=25;function be(t,e){const n=O(t),o=C(t),i=n.visualViewport;let c=o.clientWidth,r=o.clientHeight,s=0,a=0;if(i){c=i.width,r=i.height;const u=xt();(!u||u&&e==="fixed")&&(s=i.offsetLeft,a=i.offsetTop)}const l=ft(o);if(l<=0){const u=o.ownerDocument,d=u.body,m=getComputedStyle(d),f=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,h=Math.abs(o.clientWidth-d.clientWidth-f);h<=Wt&&(c-=h)}else l<=Wt&&(c+=l);return{width:c,height:r,x:s,y:a}}function Re(t,e){const n=j(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,c=F(t)?K(t):A(1),r=t.clientWidth*c.x,s=t.clientHeight*c.y,a=i*c.x,l=o*c.y;return{width:r,height:s,x:a,y:l}}function Bt(t,e,n){let o;if(e==="viewport")o=be(t,n);else if(e==="document")o=ve(C(t));else if(T(e))o=Re(e,n);else{const i=Ht(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return ct(o)}function Nt(t,e){const n=W(t);return n===e||!T(n)||J(n)?!1:D(n).position==="fixed"||Nt(n,e)}function Ee(t,e){const n=e.get(t);if(n)return n;let o=G(t,[],!1).filter(s=>T(s)&&Y(s)!=="body"),i=null;const c=D(t).position==="fixed";let r=c?W(t):t;for(;T(r)&&!J(r);){const s=D(r),a=wt(r);!a&&s.position==="fixed"&&(i=null),(c?!a&&!i:!a&&s.position==="static"&&i&&(i.position==="absolute"||i.position==="fixed")||nt(r)&&!a&&Nt(t,r))?o=o.filter(l=>l!==r):i=s,r=W(r)}return e.set(t,o),o}function Le(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const c=[...n==="clippingAncestors"?lt(e)?[]:Ee(e,this._c):[].concat(n),o],r=Bt(e,c[0],i);let s=r.top,a=r.right,l=r.bottom,u=r.left;for(let d=1;d<c.length;d++){const m=Bt(e,c[d],i);s=$(m.top,s),a=X(m.right,a),l=X(m.bottom,l),u=$(m.left,u)}return{width:a-u,height:l-s,x:u,y:s}}function Oe(t){const{width:e,height:n}=Pt(t);return{width:e,height:n}}function Te(t,e,n){const o=F(e),i=C(e),c=n==="fixed",r=j(t,!0,c,e);let s={scrollLeft:0,scrollTop:0};const a=A(0);function l(){a.x=ft(i)}if(o||!o&&!c)if((Y(e)!=="body"||nt(i))&&(s=at(e)),o){const f=j(e,!0,c,e);a.x=f.x+e.clientLeft,a.y=f.y+e.clientTop}else i&&l();c&&!o&&i&&l();const u=i&&!o&&!c?Mt(i,s):A(0),d=r.left+s.scrollLeft-a.x-u.x,m=r.top+s.scrollTop-a.y-u.y;return{x:d,y:m,width:r.width,height:r.height}}function Rt(t){return D(t).position==="static"}function Vt(t,e){if(!F(t)||D(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return C(t)===n&&(n=n.ownerDocument.body),n}function zt(t,e){const n=O(t);if(lt(t))return n;if(!F(t)){let i=W(t);for(;i&&!J(i);){if(T(i)&&!Rt(i))return i;i=W(i)}return n}let o=Vt(t,e);for(;o&&de(o)&&Rt(o);)o=Vt(o,e);return o&&J(o)&&Rt(o)&&!wt(o)?n:o||pe(t)||n}const De=async function(t){const e=this.getOffsetParent||zt,n=this.getDimensions,o=await n(t.floating);return{reference:Te(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Ae(t){return D(t).direction==="rtl"}const Ce={convertOffsetParentRelativeRectToViewportRelativeRect:we,getDocumentElement:C,getClippingRect:Le,getOffsetParent:zt,getElementRects:De,getClientRects:xe,getDimensions:Oe,getScale:K,isElement:T,isRTL:Ae};function $t(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Se(t,e){let n=null,o;const i=C(t);function c(){var s;clearTimeout(o),(s=n)==null||s.disconnect(),n=null}function r(s,a){s===void 0&&(s=!1),a===void 0&&(a=1),c();const l=t.getBoundingClientRect(),{left:u,top:d,width:m,height:f}=l;if(s||e(),!m||!f)return;const h=it(d),p=it(i.clientWidth-(u+m)),y=it(i.clientHeight-(d+f)),g=it(u),w={rootMargin:-h+"px "+-p+"px "+-y+"px "+-g+"px",threshold:$(0,X(1,a))||1};let x=!0;function v(E){const b=E[0].intersectionRatio;if(b!==a){if(!x)return r();b?r(!1,b):o=setTimeout(()=>{r(!1,1e-7)},1e3)}b===1&&!$t(l,t.getBoundingClientRect())&&r(),x=!1}try{n=new IntersectionObserver(v,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(v,w)}n.observe(t)}return r(!0),c}function ke(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:c=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:a=!1}=o,l=bt(t),u=i||c?[...l?G(l):[],...e?G(e):[]]:[];u.forEach(g=>{i&&g.addEventListener("scroll",n,{passive:!0}),c&&g.addEventListener("resize",n)});const d=l&&s?Se(l,n):null;let m=-1,f=null;r&&(f=new ResizeObserver(g=>{let[w]=g;w&&w.target===l&&f&&e&&(f.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var x;(x=f)==null||x.observe(e)})),n()}),l&&!a&&f.observe(l),e&&f.observe(e));let h,p=a?j(t):null;a&&y();function y(){const g=j(t);p&&!$t(p,g)&&n(),p=g,h=requestAnimationFrame(y)}return n(),()=>{var g;u.forEach(w=>{i&&w.removeEventListener("scroll",n),c&&w.removeEventListener("resize",n)}),d?.(),(g=f)==null||g.disconnect(),f=null,a&&cancelAnimationFrame(h)}}const Fe=fe,Pe=ue,He=ce,Me=se,We=re,Be=(t,e,n)=>{const o=new Map,i={platform:Ce,...n},c={...i.platform,_c:o};return ie(t,e,{...i,platform:c})};function Ne(t){const[e,n]=tt(t()),[o,i]=tt(t()?"open":"closed");let c,r=0;const s=a=>{c=a};return ut(a=>{const l=t();if(l)r++,n(!0),i("open");else if(a){i("closed");const u=c,d=u&&(()=>{const h=getComputedStyle(u);return h.animationName!=="none"&&parseFloat(h.animationDuration||"0")>0})();if(!u||!d){const h=++r;return queueMicrotask(()=>{h===r&&n(!1)}),l}const m=u,f=h=>{h.target===m&&(m.removeEventListener("animationend",f),n(!1))};m.addEventListener("animationend",f),dt(()=>m.removeEventListener("animationend",f))}return l}),{present:e,state:o,setRef:s}}function Ve(t){const[e,n]=It(t,["as"]);return typeof e.as=="function"?e.as(n):jt(_t,Xt({get component(){return e.as??"span"}},n))}function ze(t){let e=t;for(;e;){if(e instanceof Element&&e.closest("[inert]"))return!0;const n=e.getRootNode();e=n instanceof ShadowRoot?n.host:null}return!1}function $e(t,e){if(typeof MutationObserver!="function")return()=>{};let n=!1;const o=()=>t.isConnected&&!ze(t);let i=o();const c=()=>{if(!n){if(o()){i=!0;return}i&&(n=!0,r.disconnect(),e())}},r=new MutationObserver(c),s=new Set;typeof document<"u"&&s.add(document);const a=t.getRootNode();a&&s.add(a);for(const l of s)try{r.observe(l,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["inert"]})}catch{}return()=>r.disconnect()}function qe(t,e,n={}){const[o,i]=tt({x:0,y:0,placement:n.placement??"bottom"}),[c,r]=tt({}),[s,a]=tt(!1);return ut(()=>{const l=t(),u=e();if(!l||!u)return;const d=()=>{var p;const y=[Fe(n.gutter??8),He(),Pe({padding:8})],g=(p=n.arrowEl)==null?void 0:p.call(n);g&&y.push(We({element:g})),y.push(Me()),Be(l,u,{placement:n.placement??"bottom",strategy:"fixed",middleware:y}).then(({x:w,y:x,placement:v,middlewareData:E})=>{var b;i({x:w,y:x,placement:v}),E.arrow&&r({x:E.arrow.x,y:E.arrow.y}),a(!!((b=E.hide)!=null&&b.referenceHidden))})},m=ke(l,u,d);let f;if(typeof ResizeObserver=="function"&&l instanceof Element){f=new ResizeObserver(d),f.observe(l);for(const p of G(l))p instanceof Element&&f.observe(p)}const h=n.onDisconnect?$e(l,n.onDisconnect):void 0;dt(()=>{m(),f?.disconnect(),h?.()})}),{pos:o,arrowPos:c,hidden:s}}function Ie(t){ut(()=>{if(!t.enabled())return;const e=i=>{i.key==="Escape"&&t.onDismiss("escape")},n=i=>{const c=i.target;t.refs().some(r=>r&&r.contains(c))||t.onDismiss("outside")},o=document;o.addEventListener("keydown",e),o.addEventListener("pointerdown",n,!0),dt(()=>{o.removeEventListener("keydown",e),o.removeEventListener("pointerdown",n,!0)})})}export{Ve as A,Ie as a,Ne as c,qe as u};
@@ -0,0 +1 @@
1
+ import{I as t}from"./Icon-DObhsRtm.js";import{c as r,q as e}from"./define-By-uL588.js";var i=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],o=a=>r(t,e(a,{name:"PanelRight",iconNode:i})),h=o;export{h as p};
@@ -0,0 +1 @@
1
+ import{I as e}from"./Icon-DObhsRtm.js";import{c,q as r}from"./define-By-uL588.js";var m=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],o=a=>c(e,r(a,{name:"Globe",iconNode:m})),i=o,p=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],y=a=>c(e,r(a,{name:"Image",iconNode:p})),t=y,l=[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]],d=a=>c(e,r(a,{name:"Paperclip",iconNode:l})),h=d;export{i as g,t as i,h as p};
@@ -0,0 +1 @@
1
+ import{I as a}from"./Icon-DObhsRtm.js";import{c as p,q as r}from"./define-By-uL588.js";var e=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],m=o=>p(a,r(o,{name:"Play",iconNode:e})),s=m;export{s as p};
@@ -97,6 +97,55 @@ export type FormField = {
97
97
  'x-kai-widget'?: 'textarea' | 'slider' | 'rating' | 'radio' | 'select' | 'checkbox' | 'password' | 'switch';
98
98
  'x-kai-placeholder'?: string;
99
99
  'x-kai-step'?: number;
100
+ /**
101
+ * Display format for a string field. `tel` / `ssn` / `credit-card`
102
+ * apply that type's standard mask and submit digits only; `custom` masks with
103
+ * `x-kai-mask` and submits the formatted value.
104
+ *
105
+ * NOT the JSON Schema `format` keyword, and deliberately not an extension of it:
106
+ * `format` has a registered vocabulary with assertion semantics, `widgetFor()`
107
+ * already switches on it to pick a widget, and `toJsonSchema()` turns it into a
108
+ * validation pattern. This is a UI hint, so it lives in the `x-kai-*` namespace
109
+ * with the other UI hints — and it selects FORMATTING, never a widget.
110
+ *
111
+ * Typed as the semantic-type union for a consumer authoring a form definition by
112
+ * hand. A value arriving from a MODEL is untrusted and may be anything at all;
113
+ * `resolveFieldMask()` degrades an unrecognised one to an unmasked text field with
114
+ * a console warning rather than trusting this declaration.
115
+ *
116
+ * SPELLED OUT HERE RATHER THAN IMPORTED, and that is not laziness. `FieldSemanticType`
117
+ * is declared in `./field-semantics`, which carries the semantics TABLE and its
118
+ * `console.warn` — and this file's whole reason for existing is that a Node/no-DOM
119
+ * backend can name a card payload with `lib: ["ESNext"]` and `types: []`, where
120
+ * `console` does not exist (measured: TS2584, by
121
+ * `tests/schemas/card-data-types-node-safe.test.ts`, which is what caught the import).
122
+ * A type import still has to RESOLVE, so importing the union would drag the engine into
123
+ * the server-safe entry's graph.
124
+ *
125
+ * AN APP CANNOT PIN THIS ON THE MODEL TODAY.
126
+ * `cardTools({ require })` narrows a projected tool schema by dot-path, but there is
127
+ * no path that reaches a form FIELD: a form card's payload is itself a JSON Schema, so
128
+ * `form.schema.json` describes `properties` as a map of field definitions rather than
129
+ * as a node per field, and `require: { form: [{ path: 'properties.ticketId' }] }` is a
130
+ * TypeError naming a path that does not resolve. "Force the model to mask the ticket
131
+ * field" is therefore not expressible; the enum above is what makes it LIKELY, and an
132
+ * app that needs a guarantee validates the arriving envelope itself.
133
+ *
134
+ * It is therefore a REGISTERED COPY of `FIELD_SEMANTIC_TYPES`: the two are pinned
135
+ * mutually assignable at compile time in
136
+ * `tests/components/form-field-formats.test.tsx`, so adding a fifth token to the enum
137
+ * without adding it here fails `nx typecheck ui` rather than shipping a form card that
138
+ * cannot name it.
139
+ */
140
+ 'x-kai-format'?: 'tel' | 'ssn' | 'credit-card' | 'custom';
141
+ /** The mask pattern, read only when `x-kai-format` is `custom`: `#` a digit, `@` an
142
+ * alphanumeric, `*` an obscurable alphanumeric, everything else a literal
143
+ * (`CHG-####`). Capped at the mask engine's own limit; a longer one is refused. */
144
+ 'x-kai-mask'?: string;
145
+ /** Placeholder text for the mask's unfilled positions, aligned character for
146
+ * character with the pattern (`mm/dd/yyyy`). Derived from the pattern when absent;
147
+ * a misaligned one is dropped, loudly, and the mask survives. */
148
+ 'x-kai-mask-guide'?: string;
100
149
  };
101
150
  /** The form definition = CardEnvelope.data for type:'form'. */
102
151
  export type FormDefinition = {
@@ -1,43 +1,11 @@
1
1
  import { CardEvent, CardPolicy } from './card-contract.js';
2
+ export { isSafeUrl, isScriptUrl } from './url-scheme-policy.js';
2
3
  /** The single contract event name. */
3
4
  export declare const CARD_EVENT_NAME = "kai-card";
4
5
  /** Dispatch a CardEvent as the bubbling, composed `kai-card` event a host listener
5
6
  * routes. NB: this is deliberately different from defineWebComponent's built-in
6
7
  * non-bubbling dispatch. */
7
8
  export declare function emitCardEvent(element: HTMLElement, event: CardEvent): void;
8
- /** True when `url` is safe to put in an href / hand to `window.open`.
9
- *
10
- * Exported so the MARKDOWN renderer and the ARTIFACT viewer reuse this exact
11
- * guard rather than growing a second scheme list that can drift from this one.
12
- *
13
- * Resolving against a base is deliberate and is what makes it correct for
14
- * markdown: a relative or fragment link (`/docs`, `#section`, `./rel`) is
15
- * ordinary markdown, and resolving it inherits the base's `http:` so it
16
- * passes, while `javascript:`/`data:`/`vbscript:` keep their own protocol and
17
- * fail. It is correct for the artifact viewer for the same reason: a file with
18
- * no `src` to resolve against yields a bare relative path (`docs/report.pdf`),
19
- * which is a legitimate artifact address. Contrast `isRenderableLink` in
20
- * `primitives/link-preview.ts`, which takes NO base and so demands an absolute
21
- * http(s) URL: that is the right guard for a model-supplied citation -- a
22
- * reference to a page on the public web -- this one for markdown body links and
23
- * artifact file addresses. */
24
- export declare function isSafeUrl(url: string): boolean;
25
- /** True when navigating to `url` would EXECUTE it as script in the initiating
26
- * document's origin.
27
- *
28
- * Strictly narrower than `!isSafeUrl(url)`, and not a competing policy: it
29
- * answers a different question, for the one sink where the allowlist is the
30
- * wrong tool. An `<iframe src>` legitimately takes `data:` and `blob:` (a
31
- * `data:` blob artifact is a documented `<kai-artifact>` use -- it is what
32
- * `displayUrl` exists for) and both get an OPAQUE origin in every modern
33
- * browser, so neither can reach the host page. `javascript:`/`vbscript:` are
34
- * the schemes that run in the EMBEDDER's origin, and they are the whole risk:
35
- * the default sandbox (no `allow-same-origin`) already makes the browser refuse
36
- * them, but a consumer who sets `allow-same-origin` turns a model-supplied
37
- * `src` into host-origin script execution. The artifact viewer used to suggest
38
- * that setting for "an artifact you trust"; it no longer does, and this guard
39
- * is what protects the consumers who took the old advice. */
40
- export declare function isScriptUrl(url: string): boolean;
41
9
  /** Apply the contract's policy to one event. The ONE place routing lives. */
42
10
  export declare function routeCardEvent(policy: CardPolicy | undefined, event: CardEvent): void;
43
11
  /** Attach a host-level `kai-card` listener that routes every bubbling card event
@@ -1,8 +1,8 @@
1
1
  export interface JsonSchema {
2
2
  type?: 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object' | 'null';
3
3
  const?: unknown;
4
- enum?: unknown[];
5
- required?: string[];
4
+ enum?: readonly unknown[];
5
+ required?: readonly string[];
6
6
  properties?: Record<string, JsonSchema>;
7
7
  items?: JsonSchema;
8
8
  minimum?: number;
@@ -25,7 +25,34 @@ export interface ChatConfigProps {
25
25
  export declare function ChatConfig(props: ChatConfigProps): JSX.Element;
26
26
  /** Read the current chat config. Returns defaults if no provider is present. */
27
27
  export declare function useChatConfig(): ChatConfigValue;
28
- /** Maps prose size to Tailwind prose class */
28
+ /**
29
+ * Maps prose size to the Tailwind Typography *size modifier* for consumers who
30
+ * render their own `prose` block.
31
+ *
32
+ * The `prose-*` names are deliberately NOT re-pointed at the --kai-text-* scale.
33
+ * They are not font sizes: each is a plugin-generated bundle of proportional
34
+ * margins, list indents, heading ratios and line-heights for every nested
35
+ * element, keyed to hardcoded rems, and they only do anything alongside `prose`
36
+ * itself. There is no `prose-body` to alias them to, and collapsing them to a
37
+ * bare font-size would throw away the vertical rhythm that is their whole job.
38
+ * The kit's own markdown does not go through them at all — it renders through
39
+ * `.chat-markdown` (theme.css), which is em-relative and therefore already
40
+ * scales off whatever `textClass` sets.
41
+ *
42
+ * The one raw font-size here (`xs`) DOES join the semantic scale, so it stays in
43
+ * step with `textClass('xs')`.
44
+ */
29
45
  export declare function proseClass(size: ProseSize): string;
30
- /** Maps prose size to a text class for non-prose elements (sidebar, input) */
46
+ /**
47
+ * Maps prose size to a text class for message content, markdown, and non-prose
48
+ * chrome (sidebar, input).
49
+ *
50
+ * These are the kit's SEMANTIC type-scale utilities, not Tailwind's raw scale:
51
+ * each resolves through a namespaced --kai-text-* token in theme.css, so a
52
+ * consumer setting `--kai-text-body` moves the reading text. The public
53
+ * `proseSize` strings ('xs' | 'sm' | 'base' | 'lg') are unchanged — this is an
54
+ * internal re-point only. Sizes are byte-identical to the Tailwind classes they
55
+ * replace (text-meta ≡ text-xs, text-body ≡ text-sm, text-title ≡ text-base),
56
+ * so nothing moves until a token is actually overridden.
57
+ */
31
58
  export declare function textClass(size: ProseSize): string;
@@ -0,0 +1,54 @@
1
+ import { ConversationSummary } from '../types.js';
2
+ import { ChatMessage } from '../elements/chat-types.js';
3
+ export interface ConversationStore {
4
+ list(): Promise<ConversationSummary[]>;
5
+ load(id: string): Promise<ChatMessage[]>;
6
+ save(id: string, messages: ChatMessage[]): Promise<void>;
7
+ /** OPTIONAL — unread indicators (owner round, 2026-08-26). Persist
8
+ * `ConversationSummary.lastReadAt` (that field's own doc has the exact
9
+ * shape) for `id`, called by `ChatThread` whenever that conversation
10
+ * counts as "seen": it's the active conversation, the chat view (not the
11
+ * list) is showing, and the host is open — on the select/restore
12
+ * transition into that state AND on every new message arriving while it
13
+ * holds (see `ChatThread`'s `hostOpen` prop doc for the third leg, which
14
+ * `ChatThread` cannot know on its own).
15
+ *
16
+ * This is the concept's OPT-IN switch, not a nice-to-have: omit it and no
17
+ * summary this store returns ever gets a `lastReadAt`, so every unread
18
+ * computation reads "not unread" (that field's absent-means-not-unread
19
+ * default) for every conversation, always. That is a DELIBERATE decide-
20
+ * loudly default, not a gap — a store that never implements `markRead`
21
+ * is read as never supporting the concept at all, and the UI goes quiet
22
+ * about it rather than guessing "probably unread" from a comparison it
23
+ * has no real signal for. `localStorageStore` implements it below.
24
+ * `fetchStore` deliberately does NOT (see its own doc) — it passes
25
+ * through whatever `lastReadAt` the backend's own summaries carry, same
26
+ * as every other field on `ConversationSummary`, rather than assuming a
27
+ * mark-read endpoint the recast contract never defined. */
28
+ markRead?(id: string): Promise<void>;
29
+ }
30
+ export declare const LEGACY_THREAD_MIGRATED_TITLE = "Conversation 1";
31
+ /** Newest-first ordering over `updatedAt`; rows with a missing or unparsable
32
+ * timestamp sort last (stable, so ties keep declaration order). The ONE
33
+ * recency rule — the list panel, ChatThread's restore pick, and the home
34
+ * screen's recent card all sort with this (issue #335). */
35
+ export declare function byRecency(a: Pick<ConversationSummary, 'updatedAt'>, b: Pick<ConversationSummary, 'updatedAt'>): number;
36
+ export declare function localStorageStore(name: string, userId?: string): ConversationStore;
37
+ /** The recast of codegen.ts's emitHistorySetup endpoint behavior: the
38
+ * consumer's own conversation routes. GET {url} -> ConversationSummary[];
39
+ * GET {url}/:id -> ChatMessage[]; PUT {url}/:id with { messages } -> stored.
40
+ * x-kai-user-id carries userId on every request, matching the header
41
+ * codegen.ts already emits for the endpoint provider and the endpoint
42
+ * history persistence mode. Decide loudly: no request here catches its own
43
+ * rejection — a caller (ChatThread's lifecycle, Task 2) decides how to
44
+ * degrade, exactly as the spec's degradation section requires.
45
+ *
46
+ * No `markRead` (unread indicators, 2026-08-26): the recast contract above
47
+ * has no mark-read endpoint, and inventing a fourth request shape here
48
+ * would be this adapter deciding a backend behavior rather than passing one
49
+ * through. `list()`/`load()` already forward whatever `lastReadAt` the
50
+ * backend's own summaries carry, same as any other `ConversationSummary`
51
+ * field — a consumer who wants writes needs their own store (or their own
52
+ * endpoint plus a thin wrapper), same as any other capability this recast
53
+ * doesn't cover. */
54
+ export declare function fetchStore(url: string, userId?: string): ConversationStore;
@@ -0,0 +1,96 @@
1
+ /** How `normalizeToRaw` folds accepted characters. */
2
+ export type CaseMode = 'preserve' | 'upper' | 'lower';
3
+ /** Why an edit was refused. Rejection decides LOUDLY: the stateful layer
4
+ * surfaces this on a callback and, on the element facade, as `kai-input-rejected`. */
5
+ export type RejectReason = 'full' | 'wrong-class' | 'over-capacity';
6
+ /** A compiled `format` + aligned display guide. Fill positions are `#` `@` `*`;
7
+ * every other index is a literal. */
8
+ export interface MaskPattern {
9
+ readonly format: string;
10
+ readonly guide: string;
11
+ readonly fillIndexes: readonly number[];
12
+ readonly capacity: number;
13
+ }
14
+ /** Thrown by `compileMask` only. Every other function in this module is total: it clamps
15
+ * or discards rather than throwing, because it runs on every keystroke. */
16
+ export declare class MaskError extends Error {
17
+ }
18
+ /** Compile a format string, with an optional aligned display guide.
19
+ *
20
+ * Without a guide, one is derived: literals keep their own character and every fill
21
+ * position becomes a space, which is the alignment the display layer needs and is exactly
22
+ * the `V- ` a consumer would have written by hand for `V-***`. */
23
+ export declare function compileMask(format: string, guide?: string): MaskPattern;
24
+ /** True when `ch` may occupy raw position `rawIndex`.
25
+ *
26
+ * `ch` must be exactly one UTF-16 code unit. Astral code points (a lone surrogate half
27
+ * cannot satisfy `\p{L}`) are outside this engine's model: one fill position holds one
28
+ * code unit, which is what keeps `format`, `guide`, the formatted text and the caret
29
+ * offsets a DOM input reports all in the same units. The target field family -- phone,
30
+ * SSN, ticket numbers, names, postal codes -- is BMP. */
31
+ export declare function acceptsAt(p: MaskPattern, rawIndex: number, ch: string): boolean;
32
+ /** Raw (fill-position-only) characters extracted from arbitrary input, with
33
+ * positional literal consumption and case folding: literals are matched leniently.
34
+ *
35
+ * LITERALS ARE MATCHED WHERE THEY SIT -- this is the fix for a real defect, and both halves
36
+ * of it are watched failing in the test file. A strip-then-fill normalizer (drop every
37
+ * non-alphanumeric, then fill positions in order) turns a pasted `V-123` under `V-***` into
38
+ * raw `V12`, rendered `V-V12`: the literal `V` is alphanumeric, survives the strip, is eaten
39
+ * by the first fill position, and the `3` falls off the end -- silently. Consuming only a
40
+ * leading literal RUN fixes that one case and leaves the same shape alive one level deeper:
41
+ * under `*-V-*`, `A-V-B` puts the interior literal `V` into the second fill position and
42
+ * drops the `B`. So the walk below advances over the FORMAT, not over a stripped string,
43
+ * and every literal -- leading, interior or trailing -- gets its chance to claim the input
44
+ * character sitting in front of it.
45
+ *
46
+ * The two branches, and why lenience is safe here:
47
+ * - At a LITERAL, an input character equal to it (case-insensitively) is consumed as that
48
+ * literal. A character that is not equal means the input simply omitted the literal, so
49
+ * the format advances and the input does not -- which is what lets `chg4821`, `v123` and
50
+ * a bare `AB` all normalize correctly.
51
+ * - At a FILL, an input character of the right class is taken (folded per `caseMode`) and
52
+ * both advance. One of the wrong class is discarded and the position WAITS for the next
53
+ * one -- that is what absorbs separators, spaces and the browser's autofill formatting
54
+ * (`chg 4821`, `CHG-4821`, `chg4821` all give the same raw).
55
+ *
56
+ * Every iteration either consumes an input character or advances the format, so it
57
+ * terminates. Input past the last fill position is clipped -- the caller compares lengths
58
+ * to report `over-capacity`. */
59
+ export declare function normalizeToRaw(p: MaskPattern, input: string, caseMode?: CaseMode): string;
60
+ /** Raw formatted for DATA purposes -- the canonical value a `custom` mask submits:
61
+ * formatted, with trailing placeholders trimmed. Literals are re-inserted at their positions
62
+ * and the string is cut at the first UNFILLED position, because that placeholder and
63
+ * everything after it is not yet content.
64
+ *
65
+ * A trailing literal run is NOT a placeholder, so a raw at capacity carries it: `##-END`
66
+ * with raw `12` is `12-END`, the same way the literals of `CHG-4821` are part of the ticket
67
+ * id rather than presentation. Cutting at `raw.length` instead would silently drop a fixed
68
+ * suffix from the submitted datum.
69
+ *
70
+ * Empty raw is `''`, never the bare skeleton (`V-`): an empty field submits `''`, never
71
+ * the bare mask template. `formatForDisplay` is the other call site. */
72
+ export declare function formatRaw(p: MaskPattern, raw: string): string;
73
+ /** Raw formatted for DISPLAY purposes: every unfilled position shows its guide character,
74
+ * so the text is always `format.length` long and stays aligned. Empty raw shows the guide
75
+ * in full (`mm/dd/yyyy`, `V- `). */
76
+ export declare function formatForDisplay(p: MaskPattern, raw: string): string;
77
+ /** Raw read back out of formatted text BY POSITION, which is what makes an alphanumeric
78
+ * literal safe: the `V` of `V-123` sits at a literal index and is never read as content.
79
+ * Stops at the first unfilled position, so a display string's guide characters -- which do
80
+ * not satisfy their position's class -- are not mistaken for input. */
81
+ export declare function rawFromFormatted(p: MaskPattern, formatted: string): string;
82
+ /** Caret position in `formatted` -> caret position in raw: the number of FILLED fill
83
+ * positions strictly before `pos`. */
84
+ export declare function formattedToRawIndex(p: MaskPattern, formatted: string, pos: number): number;
85
+ /** Caret position in raw -> caret position in `formatted`.
86
+ *
87
+ * Raw 0 maps to the FIRST fill index, so the caret never lands inside a leading literal
88
+ * prefix. Otherwise it lands just after the last consumed fill position and is then pulled
89
+ * forward over any literal run that follows, so it rests where the next character will go
90
+ * rather than in front of a separator -- finally clamped to the text that actually exists.
91
+ *
92
+ * The pull-forward is why this is a left inverse of `formattedToRawIndex` on every caret
93
+ * position EXCEPT the one immediately before a literal run: that position and the one after
94
+ * it map to the same raw index by definition, and only one of the two can come back. The
95
+ * post-literal one is canonical: the caret never rests inside a literal run. */
96
+ export declare function rawToFormattedIndex(p: MaskPattern, formatted: string, rawPos: number): number;
@@ -0,0 +1,36 @@
1
+ import { MaskPattern } from './field-mask.js';
2
+ export declare const FIELD_SEMANTIC_TYPES: readonly ["tel", "ssn", "credit-card", "custom"];
3
+ export type FieldSemanticType = (typeof FIELD_SEMANTIC_TYPES)[number];
4
+ /** The tier-1 attribute bag for one semantic type. */
5
+ export interface FieldSemantics {
6
+ readonly inputmode?: 'tel' | 'numeric';
7
+ readonly autocomplete?: string;
8
+ readonly spellcheck: false;
9
+ readonly autocorrect: 'off';
10
+ readonly autocapitalize: 'off';
11
+ /** The default tier-2 mask for this type, resolved only when the consumer opts in
12
+ * (`mask="default"` / the form card's `x-kai-format`) -- NOT applied automatically
13
+ * by a bare semantic type (decision 1). */
14
+ readonly defaultFormat?: string;
15
+ /** What the field submits: digit-only types strip separators, `custom`
16
+ * keeps its formatted/literal value, `as-typed` is the unmasked fallback. */
17
+ readonly canonical: 'digits' | 'formatted' | 'as-typed';
18
+ }
19
+ /** Resolve the tier-1 attribute bag for a semantic type.
20
+ *
21
+ * Passing anything outside `FIELD_SEMANTIC_TYPES` is a TypeScript error at a typed call
22
+ * site; a value crossing an untyped boundary (JSON Schema, model output) that turns out
23
+ * not to be one of the four falls back to plain unmasked-text behavior at runtime, loudly
24
+ * -- `console.warn`, never a silent guess. */
25
+ export declare function fieldSemantics(type: FieldSemanticType): FieldSemantics;
26
+ /** The canonical (submitted) value for a field, given its compiled mask, the current
27
+ * FORMATTED text (`input.value`), and its semantic type.
28
+ *
29
+ * Reads the raw value back out of `formatted` by position first -- an empty field is
30
+ * always `''`, never the bare guide. From there the two canonical shapes are read, not
31
+ * re-derived, per Task 1's handoff: `tel`/`ssn`/`credit-card` want the raw digits
32
+ * directly (their formats carry no letters, so raw IS the digit string); `custom` wants
33
+ * `formatRaw`, because a literal-terminated custom format (`##-END`) only carries its
34
+ * trailing literal once every fill position is full, and `formatRaw` is what tracks that
35
+ * -- `rawFromFormatted` gives raw characters only, with no literal reinsertion. */
36
+ export declare function canonicalize(p: MaskPattern, formatted: string, type: FieldSemanticType): string;
@@ -0,0 +1,46 @@
1
+ import { CaseMode, RejectReason } from './field-mask.js';
2
+ import { FieldSemanticType } from './field-semantics.js';
3
+ /** What a copy or cut puts on the clipboard. A stated policy the consumer selects, NOT a
4
+ * consequence of `obscure`: copying bullets is not a security control -- the
5
+ * value is in the page -- and whether a card number may be copied at all is an app-layer
6
+ * decision (CLAUDE.md: the kit decides HOW, the app decides WHETHER). */
7
+ export type CopyPolicy = 'formatted' | 'canonical' | 'obscured' | 'blocked';
8
+ /** Why an edit or a re-configuration refused, or partly refused, the content it was given.
9
+ *
10
+ * A superset of `field-mask.ts`'s `RejectReason`, widened HERE rather than there because
11
+ * the extra member is not an engine verdict: the engine's three describe one edit failing
12
+ * against one pattern, while `format-change-clipped` describes the PATTERN moving out from
13
+ * under a value that was already accepted. Widening keeps every consumer that narrows on
14
+ * the engine's three compiling unchanged. */
15
+ export type InputMaskRejectReason = RejectReason | 'format-change-clipped';
16
+ export interface InputMaskOptions {
17
+ format: string;
18
+ guide?: string;
19
+ semantic?: FieldSemanticType;
20
+ caseMode?: CaseMode;
21
+ copyPolicy?: CopyPolicy;
22
+ /** Tier 3. Wired -- it selects the default copy policy -- but does NOT yet transform the
23
+ * display; that lands with the obscured rendering in tier 3 (task 10). */
24
+ obscure?: boolean;
25
+ initialValue?: string;
26
+ onInput?: (detail: {
27
+ canonical: string;
28
+ formatted: string;
29
+ }) => void;
30
+ onReject?: (detail: {
31
+ reason: InputMaskRejectReason;
32
+ data: string;
33
+ }) => void;
34
+ }
35
+ export interface InputMask {
36
+ /** Accepts the canonical form or the formatted form; both normalize to the same value. */
37
+ setValue(value: string): void;
38
+ getRawValue(): string;
39
+ getCanonicalValue(): string;
40
+ getFormattedValue(): string;
41
+ setObscure(on: boolean): void;
42
+ /** Re-compiles and preserves the value, re-fitted to the new pattern. */
43
+ update(next: Partial<InputMaskOptions>): void;
44
+ detach(): void;
45
+ }
46
+ export declare function createInputMask(el: HTMLInputElement, options: InputMaskOptions): InputMask;