@kitn.ai/ui 0.28.0 → 0.30.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 (615) hide show
  1. package/README.md +11 -7
  2. package/dist/{Icon-DObhsRtm.js → Icon-BzBET3E-.js} +1 -1
  3. package/dist/{action-icons-CcgNN2oT.js → action-icons-DaW2pU6m.js} +1 -1
  4. package/dist/agent-tooling/construct/public.d.ts +15 -0
  5. package/dist/agent-tooling/construct/schema.d.ts +111 -0
  6. package/dist/arrow-down-D783iMJj.js +1 -0
  7. package/dist/arrow-left-0VLM5kyg.js +1 -0
  8. package/dist/artifact-DGjzHYUT.js +1 -0
  9. package/dist/{attachments-Qr4kg-2b.js → attachments-YvXHlg88.js} +1 -1
  10. package/dist/{audio-visualizer-DToYdfSc.js → audio-visualizer-9lz5IHsL.js} +1 -1
  11. package/dist/{badge-CdEu_jn2.js → badge-Dh_vp8A5.js} +1 -1
  12. package/dist/{bell-DQAAOpDz.js → bell-CT7_WUwS.js} +1 -1
  13. package/dist/{button-DkuOnGLy.js → button-C_3te6fm.js} +1 -1
  14. package/dist/{card-renderer-Jx70m6_l.js → card-renderer-DZVaGH2e.js} +1 -1
  15. package/dist/check-CiEOVnEN.js +1 -0
  16. package/dist/{checkbox-D7iRB3nL.js → checkbox-Bu2T2e0U.js} +1 -1
  17. package/dist/{checkbox-group-B2_rpoPM.js → checkbox-group-BiryEXPQ.js} +1 -1
  18. package/dist/chevron-down-CSobuZRG.js +1 -0
  19. package/dist/chevron-right-DR9ZAP-2.js +1 -0
  20. package/dist/{choice-card-m0BYqqOK.js → choice-card-CM6IjkmL.js} +1 -1
  21. package/dist/circle-BC66EYF7.js +1 -0
  22. package/dist/circle-check-BqmahW0O.js +1 -0
  23. package/dist/{circle-x-BPG0iPst.js → circle-x-Bk-dA5Wf.js} +1 -1
  24. package/dist/{code-block-ClMLKb7C.js → code-block-B26t-Q7q.js} +1 -1
  25. package/dist/{collapsible-B4DlWicL.js → collapsible-Bhc636Cf.js} +1 -1
  26. package/dist/components/builder-composer-triggers.d.ts +62 -0
  27. package/dist/components/builder-layout.d.ts +54 -0
  28. package/dist/components/builder-message-actions.d.ts +72 -0
  29. package/dist/components/builder-panel.d.ts +189 -0
  30. package/dist/components/builder-preview.d.ts +11 -0
  31. package/dist/components/builder-shell-controls.d.ts +69 -0
  32. package/dist/components/builder-skeleton.d.ts +58 -0
  33. package/dist/components/builder-start.d.ts +75 -0
  34. package/dist/components/builder-workspace-variants.d.ts +23 -0
  35. package/dist/components/captions.d.ts +66 -0
  36. package/dist/{composer-sQ0HcvyG.js → composer-DMI85B6j.js} +1 -1
  37. package/dist/{confirm-card-rQWDQsnC.js → confirm-card-B0YIAwXp.js} +1 -1
  38. package/dist/construct-cli.es.js +3 -3
  39. package/dist/construct.d.ts +5 -0
  40. package/dist/construct.js +327 -0
  41. package/dist/{context-0kg4ZX1J.js → context-DWgfhqWp.js} +1 -1
  42. package/dist/controllable-BagRpyHv.js +1 -0
  43. package/dist/{conversation-item-BxwQLaFJ.js → conversation-item-BsOsVGmT.js} +1 -1
  44. package/dist/{conversation-list-BCfGN1JU.js → conversation-list-aX3Vtc7L.js} +1 -1
  45. package/dist/{copy-n9u9rqpi.js → copy-BmEwsNhJ.js} +1 -1
  46. package/dist/core-C8fzo39E.js +1 -12
  47. package/dist/{create-tween-uPkArjIG.js → create-tween-CNOAU3Fx.js} +1 -1
  48. package/dist/{create-tween-C-q-JCM-.js → create-tween-WfqiENls.js} +1 -1
  49. package/dist/{create-tween-CRrJXxBd.js → create-tween-wlFtW9Kh.js} +1 -1
  50. package/dist/{create-tween-DZ3RRDHD.js → create-tween-zt79ba32.js} +1 -1
  51. package/dist/{default-input-CaMrJkgH.js → default-input-DMV5Eaze.js} +1 -1
  52. package/dist/define-CI0y3eE4.js +1 -0
  53. package/dist/define.js +40 -40
  54. package/dist/define.server.js +45 -45
  55. package/dist/{disclosure-WUImBbDv.js → disclosure-NnACBxsC.js} +1 -1
  56. package/dist/{dropdown-wZVeJOMd.js → dropdown-DT7G0RGR.js} +1 -1
  57. package/dist/elements/agent-card.js +1 -1
  58. package/dist/elements/artifact.js +1 -1
  59. package/dist/elements/attachments.js +1 -1
  60. package/dist/elements/audio-visualizer.js +1 -1
  61. package/dist/elements/avatar.js +1 -1
  62. package/dist/elements/badge.js +1 -1
  63. package/dist/elements/button.js +1 -1
  64. package/dist/elements/card.js +1 -1
  65. package/dist/elements/cards.js +1 -1
  66. package/dist/elements/chain-of-thought.js +1 -1
  67. package/dist/elements/chat-scope-picker.js +1 -1
  68. package/dist/elements/chat-workspace.js +1 -1
  69. package/dist/elements/chat.js +1 -1
  70. package/dist/elements/checkbox-group.js +1 -1
  71. package/dist/elements/checkbox.js +1 -1
  72. package/dist/elements/checkpoint.js +1 -1
  73. package/dist/elements/choice.js +1 -1
  74. package/dist/elements/coachmark.js +1 -1
  75. package/dist/elements/code-block.js +1 -1
  76. package/dist/elements/command.js +1 -1
  77. package/dist/elements/compare.js +1 -1
  78. package/dist/elements/composer.js +1 -1
  79. package/dist/elements/confirm-card.js +1 -1
  80. package/dist/elements/context-meter.js +1 -1
  81. package/dist/elements/conversation-item.js +1 -1
  82. package/dist/elements/conversation-list.js +1 -1
  83. package/dist/elements/dialog.js +1 -1
  84. package/dist/elements/dock.js +1 -1
  85. package/dist/elements/dropdown.js +1 -1
  86. package/dist/elements/editable-label.js +1 -1
  87. package/dist/elements/embed.js +1 -1
  88. package/dist/elements/empty.js +1 -1
  89. package/dist/elements/feedback-bar.js +1 -1
  90. package/dist/elements/file-tree.js +1 -1
  91. package/dist/elements/file-upload.js +1 -1
  92. package/dist/elements/form.js +1 -1
  93. package/dist/elements/hover-card.js +1 -1
  94. package/dist/elements/icon.js +1 -1
  95. package/dist/elements/image.js +1 -1
  96. package/dist/elements/input.js +1 -1
  97. package/dist/elements/kbd.js +1 -1
  98. package/dist/elements/link-preview.js +1 -1
  99. package/dist/elements/loader.js +1 -1
  100. package/dist/elements/markdown.js +1 -1
  101. package/dist/elements/menu.js +1 -1
  102. package/dist/elements/message-skills.js +1 -1
  103. package/dist/elements/message.js +1 -1
  104. package/dist/elements/model-switcher.js +1 -1
  105. package/dist/elements/nav.js +1 -1
  106. package/dist/elements/notice.js +1 -1
  107. package/dist/elements/pane-grid.js +1 -1
  108. package/dist/elements/pane-group.js +1 -1
  109. package/dist/elements/pane.js +1 -1
  110. package/dist/elements/popover.js +1 -1
  111. package/dist/elements/progress-bar.js +1 -1
  112. package/dist/elements/prompt-dock.js +1 -1
  113. package/dist/elements/prompt-input.js +1 -1
  114. package/dist/elements/prompt-suggestions.js +1 -1
  115. package/dist/elements/radio-group.js +1 -1
  116. package/dist/elements/reasoning.js +1 -1
  117. package/dist/elements/remote.js +1 -1
  118. package/dist/elements/resizable.js +1 -1
  119. package/dist/elements/response-stream.js +1 -1
  120. package/dist/elements/screen.js +1 -1
  121. package/dist/elements/scroll-area.js +1 -1
  122. package/dist/elements/scroll-button.js +1 -1
  123. package/dist/elements/search.js +1 -1
  124. package/dist/elements/segmented.js +1 -1
  125. package/dist/elements/select.js +1 -1
  126. package/dist/elements/separator.js +1 -1
  127. package/dist/elements/setting-item.js +1 -1
  128. package/dist/elements/settings-group.js +1 -1
  129. package/dist/elements/skeleton.js +1 -1
  130. package/dist/elements/slider.js +1 -1
  131. package/dist/elements/source.js +1 -1
  132. package/dist/elements/status.js +1 -1
  133. package/dist/elements/switch.js +1 -1
  134. package/dist/elements/tabs.js +1 -1
  135. package/dist/elements/tasks.js +1 -1
  136. package/dist/elements/text-shimmer.js +1 -1
  137. package/dist/elements/thinking-bar.js +1 -1
  138. package/dist/elements/thread.js +1 -1
  139. package/dist/elements/toast.js +1 -1
  140. package/dist/elements/tool.js +1 -1
  141. package/dist/elements/tooltip.js +1 -1
  142. package/dist/elements/voice-input.js +1 -1
  143. package/dist/elements/voice-output.js +1 -1
  144. package/dist/{ellipsis-CbOpJnU3.js → ellipsis-6pJ7SxYT.js} +1 -1
  145. package/dist/{embed-CrfjkbUG.js → embed-BMje-nxj.js} +1 -1
  146. package/dist/engine-javascript-C1x7zo1_.js +1 -141
  147. package/dist/{external-link-ByXAwBBQ.js → external-link-Beh9DKeR.js} +1 -1
  148. package/dist/{file-text-DMib2qwt.js → file-text-D1GPfZ8Q.js} +1 -1
  149. package/dist/{file-tree-CJqM2aP7.js → file-tree-Dwj2lqg-.js} +1 -1
  150. package/dist/{folder-_BAb929C.js → folder-b6D8x1DY.js} +1 -1
  151. package/dist/{form-DSZgZQZk.js → form-DWgdxDXu.js} +1 -1
  152. package/dist/{hover-card-BQbul9eq.js → hover-card-CWRkqm40.js} +1 -1
  153. package/dist/{icon-CdcfRhYI.js → icon-CL0jdhsf.js} +1 -1
  154. package/dist/index.js +1741 -1725
  155. package/dist/index.server.js +1582 -1566
  156. package/dist/{info-DsFjGuI_.js → info-0cOUherQ.js} +1 -1
  157. package/dist/{input-DKbmkMos.js → input-BH6Ru91Q.js} +1 -1
  158. package/dist/kai.es.js +1 -1
  159. package/dist/{kbd-PvdGhX4s.js → kbd-DRAnVtNX.js} +1 -1
  160. package/dist/{link-zF8PzWfF.js → link-Dlr0vssB.js} +1 -1
  161. package/dist/{link-preview-DbM1866N.js → link-preview-DODgRyV9.js} +1 -1
  162. package/dist/loader-KvJB6NrT.js +1 -0
  163. package/dist/{markdown-LMvmAyBk.js → markdown-DX9tuJVj.js} +1 -1
  164. package/dist/mcp.es.js +9 -5
  165. package/dist/{message-BYZECyek.js → message-BqQ7Ot5q.js} +1 -1
  166. package/dist/{message-BSsgvHvf.js → message-DkaGfBd8.js} +1 -1
  167. package/dist/message-circle-BPpp5QKv.js +1 -0
  168. package/dist/message-square-BLbsd9BJ.js +1 -0
  169. package/dist/{minimize-2-BQRoBV1V.js → minimize-2-CyOHJwcN.js} +1 -1
  170. package/dist/{model-switcher-CMpCOYcB.js → model-switcher-0hrKDiK2.js} +1 -1
  171. package/dist/{overlay-Cb-MkyDa.js → overlay-DBMFXie6.js} +1 -1
  172. package/dist/{panel-right-i8warFxT.js → panel-right-t8SWJL6e.js} +1 -1
  173. package/dist/{paperclip-ByY3UVO6.js → paperclip-CdzuOjbU.js} +1 -1
  174. package/dist/play-BXy1u7rW.js +1 -0
  175. package/dist/primitives/use-auto-resize.d.ts +11 -0
  176. package/dist/{progress-bar-jVAHvMUf.js → progress-bar-CiBtxMWT.js} +1 -1
  177. package/dist/{prompt-suggestion-CD-qtNgC.js → prompt-suggestion-I_DHP21i.js} +1 -1
  178. package/dist/{radio-BsoBMhkF.js → radio-C_p3n39l.js} +1 -1
  179. package/dist/{reasoning-4kBPtlTx.js → reasoning-BDwy_tIe.js} +1 -1
  180. package/dist/register-impl-DvEnhIxx.js +424 -0
  181. package/dist/{resizable-uPmY9VY-.js → resizable-SYC-fStM.js} +1 -1
  182. package/dist/{rotate-ccw-B2xn93py.js → rotate-ccw-B1nwmwuY.js} +1 -1
  183. package/dist/{rotate-cw-CMVLoCyH.js → rotate-cw-CLAnBcm1.js} +1 -1
  184. package/dist/{scroll-area-BqLUo8ZZ.js → scroll-area-zRyXoLhI.js} +1 -1
  185. package/dist/{scroll-button-DslXiJyL.js → scroll-button-jzrbYCG9.js} +1 -1
  186. package/dist/{select-2cLRtPGT.js → select-DM-0nEe0.js} +1 -1
  187. package/dist/{separator-BWQtNJcM.js → separator-BToOOoOt.js} +1 -1
  188. package/dist/{settings-BBR63jLg.js → settings-PaGo_S4U.js} +1 -1
  189. package/dist/{settings-group-B2ciy-Iw.js → settings-group-BFXGIfXq.js} +1 -1
  190. package/dist/{skeleton-CkHI-HgC.js → skeleton-DYpmFnnm.js} +1 -1
  191. package/dist/{slider-DDR9U-i0.js → slider-ebutAmkQ.js} +1 -1
  192. package/dist/{solid-DruVOXnf.js → solid-15v_3WVL.js} +3563 -3412
  193. package/dist/{solid-BzCFdL25.js → solid-5P-otgdi.js} +4502 -4296
  194. package/dist/solid.d.ts +6 -0
  195. package/dist/solid.js +259 -254
  196. package/dist/solid.server.js +259 -254
  197. package/dist/{source-GEnFF528.js → source-c1gpRl9h.js} +1 -1
  198. package/dist/{star-CilHq8GP.js → star-pcV_3LqF.js} +1 -1
  199. package/dist/{store-Ciyk6eZG.js → store-CSgbFFCg.js} +1 -1
  200. package/dist/{switch-KkeQIbuH.js → switch-Bh2OdLV2.js} +1 -1
  201. package/dist/{tasks-card-BrN4bggJ.js → tasks-card-CbqQAn2S.js} +1 -1
  202. package/dist/text-shimmer-BSzgEnDH.js +1 -0
  203. package/dist/textarea-DrYNt_0z.js +1 -0
  204. package/dist/theme.tokens.css +22 -21
  205. package/dist/{thumbs-up-CsT9Wzb9.js → thumbs-up-BL3-NenK.js} +1 -1
  206. package/dist/{toast-store-tgK6MuMv.js → toast-store-DkOlYczt.js} +1 -1
  207. package/dist/{tool-DzUjIBT8.js → tool-CeIWUVUe.js} +1 -1
  208. package/dist/{tooltip-Bkkg_4t0.js → tooltip-GA-nmg06.js} +1 -1
  209. package/dist/{trash-2-jBKxjGGQ.js → trash-2-CT66QWlm.js} +1 -1
  210. package/dist/{triangle-alert-DlQ68ppf.js → triangle-alert-CeHLWxhD.js} +1 -1
  211. package/dist/ui/color-field.d.ts +48 -0
  212. package/dist/ui/textarea.d.ts +4 -0
  213. package/dist/ui/toggle-chip.d.ts +40 -0
  214. package/dist/{upload-TcAHXv9W.js → upload-9Csb0F0J.js} +1 -1
  215. package/dist/{use-card-resolution-DaZqAdWf.js → use-card-resolution-Zg0a08Z-.js} +1 -1
  216. package/dist/{variant-aurora-DbW_OWL2.js → variant-aurora-4VBQHIKV.js} +1 -1
  217. package/dist/{variant-aurora-CNmfHhcx.js → variant-aurora-DBeCAQNk.js} +2 -2
  218. package/dist/{variant-aurora-D6GsdTPA.js → variant-aurora-FzHVXHby.js} +2 -2
  219. package/dist/{variant-aurora-BhLuYxJR.js → variant-aurora-LE3fqxgw.js} +1 -1
  220. package/dist/{variant-custom-BvYHR62b.js → variant-custom-AFRGcOBS.js} +1 -1
  221. package/dist/{variant-custom-DV2x254s.js → variant-custom-BQkNuPpE.js} +2 -2
  222. package/dist/{variant-custom-BRvaNHSi.js → variant-custom-DI5R0rln.js} +1 -1
  223. package/dist/{variant-custom-DMTrEO5w.js → variant-custom-WWnrrRHS.js} +2 -2
  224. package/dist/{variant-wave-CyBueXj9.js → variant-wave-DUCbH5oI.js} +2 -2
  225. package/dist/{variant-wave-BNMGrDfj.js → variant-wave-DuQV7DhQ.js} +2 -2
  226. package/dist/{variant-wave-BpDd8t3Z.js → variant-wave-nSI2sfII.js} +1 -1
  227. package/dist/{variant-wave-sp-qwsdI.js → variant-wave-wTP5v_jU.js} +1 -1
  228. package/dist/x-eiO9V6J6.js +1 -0
  229. package/{src/elements/styles.css → kit-base.css} +27 -44
  230. package/package.json +32 -17
  231. package/solid.css +33 -0
  232. package/theme.css +39 -23
  233. package/bin/route.test.js +0 -58
  234. package/dist/arrow-down-CjRU3JgV.js +0 -1
  235. package/dist/arrow-left-Bnpb1UEW.js +0 -1
  236. package/dist/artifact-Bwt7OgcR.js +0 -1
  237. package/dist/check-njkVdZu2.js +0 -1
  238. package/dist/chevron-down-B72s6PXR.js +0 -1
  239. package/dist/chevron-right-BatuHzUm.js +0 -1
  240. package/dist/circle-check-B62pODB3.js +0 -1
  241. package/dist/circle-zx0ByzY9.js +0 -1
  242. package/dist/controllable-CnGpMF6r.js +0 -1
  243. package/dist/define-By-uL588.js +0 -1
  244. package/dist/loader-BM4CEz4G.js +0 -1
  245. package/dist/message-circle-DruwObfX.js +0 -1
  246. package/dist/message-square-BG6q6mlm.js +0 -1
  247. package/dist/play-BvKKq3fX.js +0 -1
  248. package/dist/register-impl-B1hLkrI8.js +0 -424
  249. package/dist/text-shimmer-Dcj1MHuq.js +0 -1
  250. package/dist/textarea-Dpvbngbg.js +0 -1
  251. package/dist/x-Z5UntkIJ.js +0 -1
  252. package/src/agent-tooling/README.md +0 -192
  253. package/src/agent-tooling/archetypes.ts +0 -205
  254. package/src/agent-tooling/catalog/README.md +0 -676
  255. package/src/agent-tooling/catalog/catalog-types.ts +0 -231
  256. package/src/agent-tooling/catalog/fabrications.ts +0 -96
  257. package/src/agent-tooling/catalog/invariants.ts +0 -284
  258. package/src/agent-tooling/catalog/labs-titles.ts +0 -114
  259. package/src/agent-tooling/catalog/scenarios.ts +0 -87
  260. package/src/agent-tooling/catalog/surfaces.ts +0 -347
  261. package/src/agent-tooling/construct/cli-entry.ts +0 -8
  262. package/src/agent-tooling/construct/cli.ts +0 -147
  263. package/src/agent-tooling/construct/codegen.ts +0 -1635
  264. package/src/agent-tooling/construct/construct.v1.schema.json +0 -319
  265. package/src/agent-tooling/construct/dev.ts +0 -148
  266. package/src/agent-tooling/construct/fixtures/demo-widget.construct.json +0 -7
  267. package/src/agent-tooling/construct/fixtures/ops-console.construct.json +0 -44
  268. package/src/agent-tooling/construct/fixtures/owner-widget.construct.json +0 -32
  269. package/src/agent-tooling/construct/schema.ts +0 -452
  270. package/src/agent-tooling/integrations/anthropic.ts +0 -442
  271. package/src/agent-tooling/integrations/cloudflare.ts +0 -218
  272. package/src/agent-tooling/integrations/langgraph.ts +0 -133
  273. package/src/agent-tooling/integrations/mastra.ts +0 -182
  274. package/src/agent-tooling/integrations/mock.ts +0 -148
  275. package/src/agent-tooling/integrations/ollama.ts +0 -97
  276. package/src/agent-tooling/integrations/openai.ts +0 -95
  277. package/src/agent-tooling/integrations/openrouter.ts +0 -82
  278. package/src/agent-tooling/integrations/pi.ts +0 -176
  279. package/src/agent-tooling/integrations/pydantic-ai.ts +0 -108
  280. package/src/agent-tooling/integrations/vercel-ai-sdk.ts +0 -398
  281. package/src/agent-tooling/mcp/css-raw.d.ts +0 -12
  282. package/src/agent-tooling/mcp/manifest.ts +0 -422
  283. package/src/agent-tooling/mcp/server.ts +0 -116
  284. package/src/agent-tooling/mcp/stdio.ts +0 -18
  285. package/src/agent-tooling/mcp/tools/construct.ts +0 -130
  286. package/src/agent-tooling/mcp/tools/debug.ts +0 -621
  287. package/src/agent-tooling/mcp/tools/reference.ts +0 -980
  288. package/src/agent-tooling/mcp/tools/scaffold.ts +0 -6708
  289. package/src/agent-tooling/mcp/tools/theme.ts +0 -456
  290. package/src/agent-tooling/mcp/tools/types.ts +0 -14
  291. package/src/agent-tooling/mcp/validate-args.ts +0 -141
  292. package/src/agent-tooling/recipes/composed-thread.ts +0 -714
  293. package/src/agent-tooling/recipes/index.ts +0 -22
  294. package/src/agent-tooling/recipes/types.ts +0 -32
  295. package/src/agent-tooling/registry.ts +0 -132
  296. package/src/agent-tooling/route-emit.ts +0 -305
  297. package/src/agent-tooling/types.ts +0 -390
  298. package/src/components/artifact-card.tsx +0 -120
  299. package/src/components/artifact.tsx +0 -914
  300. package/src/components/attachment-types.ts +0 -66
  301. package/src/components/attachments.tsx +0 -536
  302. package/src/components/audio-visualizer/audio-visualizer.voice-fixture.ts +0 -257
  303. package/src/components/audio-visualizer/aurora.glsl.ts +0 -330
  304. package/src/components/audio-visualizer/fit-scale.ts +0 -112
  305. package/src/components/audio-visualizer/index.tsx +0 -528
  306. package/src/components/audio-visualizer/labs/lab-choreography.ts +0 -187
  307. package/src/components/audio-visualizer/labs/lab-shaders.ts +0 -363
  308. package/src/components/audio-visualizer/labs/lab-visualizer.tsx +0 -102
  309. package/src/components/audio-visualizer/shader-canvas.tsx +0 -876
  310. package/src/components/audio-visualizer/sizes.ts +0 -54
  311. package/src/components/audio-visualizer/variant-aurora.tsx +0 -305
  312. package/src/components/audio-visualizer/variant-bar.tsx +0 -175
  313. package/src/components/audio-visualizer/variant-custom.tsx +0 -344
  314. package/src/components/audio-visualizer/variant-grid.tsx +0 -175
  315. package/src/components/audio-visualizer/variant-radial.tsx +0 -163
  316. package/src/components/audio-visualizer/variant-wave.tsx +0 -130
  317. package/src/components/audio-visualizer/wave.glsl.ts +0 -130
  318. package/src/components/card-fallback.tsx +0 -60
  319. package/src/components/card-renderer.tsx +0 -220
  320. package/src/components/card.tsx +0 -212
  321. package/src/components/chain-of-thought.tsx +0 -348
  322. package/src/components/chat-container.tsx +0 -89
  323. package/src/components/chat-scope-picker.tsx +0 -57
  324. package/src/components/chat-thread.tsx +0 -1014
  325. package/src/components/checkpoint.tsx +0 -88
  326. package/src/components/choice-card.tsx +0 -743
  327. package/src/components/coachmark.tsx +0 -249
  328. package/src/components/code-block.tsx +0 -181
  329. package/src/components/composer-dom.ts +0 -159
  330. package/src/components/composer-highlight.ts +0 -242
  331. package/src/components/composer-history.ts +0 -82
  332. package/src/components/composer.tsx +0 -1075
  333. package/src/components/confirm-card.tsx +0 -402
  334. package/src/components/context.tsx +0 -377
  335. package/src/components/conversation-item.tsx +0 -241
  336. package/src/components/conversation-list.tsx +0 -429
  337. package/src/components/conversation-panel.tsx +0 -118
  338. package/src/components/dismissed-stub.tsx +0 -80
  339. package/src/components/embed.tsx +0 -200
  340. package/src/components/empty.tsx +0 -177
  341. package/src/components/feedback-bar.tsx +0 -166
  342. package/src/components/file-tree.tsx +0 -530
  343. package/src/components/file-upload.tsx +0 -167
  344. package/src/components/form-widgets.tsx +0 -525
  345. package/src/components/form.tsx +0 -1296
  346. package/src/components/home-panel.tsx +0 -159
  347. package/src/components/image.tsx +0 -65
  348. package/src/components/link-preview.tsx +0 -195
  349. package/src/components/loader.tsx +0 -367
  350. package/src/components/markdown.tsx +0 -162
  351. package/src/components/message-skills.tsx +0 -40
  352. package/src/components/message.tsx +0 -765
  353. package/src/components/model-switcher.tsx +0 -132
  354. package/src/components/prompt-input.tsx +0 -188
  355. package/src/components/prompt-suggestion.tsx +0 -150
  356. package/src/components/reasoning.tsx +0 -293
  357. package/src/components/response-compare-types.ts +0 -152
  358. package/src/components/response-compare.tsx +0 -455
  359. package/src/components/response-stream.tsx +0 -109
  360. package/src/components/screen.tsx +0 -181
  361. package/src/components/scroll-button.tsx +0 -93
  362. package/src/components/source.tsx +0 -192
  363. package/src/components/tasks-card.tsx +0 -801
  364. package/src/components/text-shimmer.tsx +0 -37
  365. package/src/components/thinking-bar.tsx +0 -50
  366. package/src/components/thread.tsx +0 -228
  367. package/src/components/toast.tsx +0 -503
  368. package/src/components/tool-classify.ts +0 -26
  369. package/src/components/tool-types.ts +0 -49
  370. package/src/components/tool.tsx +0 -190
  371. package/src/components/use-card-resolution.ts +0 -44
  372. package/src/components/voice-input.tsx +0 -222
  373. package/src/components/voice-output.tsx +0 -242
  374. package/src/components/widget-tab-bar.tsx +0 -73
  375. package/src/components/workspace-shell.tsx +0 -285
  376. package/src/diagnostics/hook.ts +0 -352
  377. package/src/diagnostics/index.ts +0 -82
  378. package/src/diagnostics/report-request.ts +0 -296
  379. package/src/elements/agent-card.tsx +0 -67
  380. package/src/elements/artifact.tsx +0 -194
  381. package/src/elements/attachments.tsx +0 -140
  382. package/src/elements/audio-visualizer.tsx +0 -227
  383. package/src/elements/autoloader.ts +0 -89
  384. package/src/elements/avatar.tsx +0 -33
  385. package/src/elements/badge.tsx +0 -32
  386. package/src/elements/button.tsx +0 -149
  387. package/src/elements/card.tsx +0 -133
  388. package/src/elements/cards.tsx +0 -266
  389. package/src/elements/chain-of-thought.tsx +0 -141
  390. package/src/elements/chat-scope-picker.tsx +0 -65
  391. package/src/elements/chat-types.ts +0 -102
  392. package/src/elements/chat-workspace.tsx +0 -188
  393. package/src/elements/chat.tsx +0 -304
  394. package/src/elements/checkbox-group.tsx +0 -164
  395. package/src/elements/checkbox.tsx +0 -134
  396. package/src/elements/checkpoint.tsx +0 -47
  397. package/src/elements/choice.tsx +0 -100
  398. package/src/elements/coachmark.tsx +0 -90
  399. package/src/elements/code-block.tsx +0 -60
  400. package/src/elements/command.tsx +0 -197
  401. package/src/elements/compare.tsx +0 -111
  402. package/src/elements/compiled.css +0 -2
  403. package/src/elements/composer.tsx +0 -162
  404. package/src/elements/confirm-card.tsx +0 -76
  405. package/src/elements/context-meter.tsx +0 -107
  406. package/src/elements/conversation-item.tsx +0 -120
  407. package/src/elements/conversation-list.tsx +0 -203
  408. package/src/elements/css.ts +0 -5
  409. package/src/elements/default-input.tsx +0 -392
  410. package/src/elements/define-entry.ts +0 -12
  411. package/src/elements/define.tsx +0 -563
  412. package/src/elements/diagnostic-events.ts +0 -114
  413. package/src/elements/dialog.tsx +0 -145
  414. package/src/elements/disclosure.ts +0 -95
  415. package/src/elements/dock.tsx +0 -215
  416. package/src/elements/dropdown.tsx +0 -123
  417. package/src/elements/editable-label.tsx +0 -140
  418. package/src/elements/element-data-types.ts +0 -152
  419. package/src/elements/element-diagnostics.ts +0 -392
  420. package/src/elements/element-manifest.json +0 -354
  421. package/src/elements/element-nonscalar.json +0 -187
  422. package/src/elements/element-types.d.ts +0 -4353
  423. package/src/elements/embed.tsx +0 -35
  424. package/src/elements/empty.tsx +0 -29
  425. package/src/elements/feedback-bar.tsx +0 -66
  426. package/src/elements/file-tree.tsx +0 -62
  427. package/src/elements/file-upload.tsx +0 -44
  428. package/src/elements/form.tsx +0 -94
  429. package/src/elements/hover-card.tsx +0 -80
  430. package/src/elements/icon.tsx +0 -41
  431. package/src/elements/image.tsx +0 -32
  432. package/src/elements/input.tsx +0 -492
  433. package/src/elements/kbd.tsx +0 -45
  434. package/src/elements/link-preview.tsx +0 -34
  435. package/src/elements/loader.tsx +0 -25
  436. package/src/elements/markdown.tsx +0 -38
  437. package/src/elements/menu.tsx +0 -241
  438. package/src/elements/message-skills.tsx +0 -83
  439. package/src/elements/message.tsx +0 -361
  440. package/src/elements/model-switcher.tsx +0 -121
  441. package/src/elements/nav.tsx +0 -87
  442. package/src/elements/notice.tsx +0 -53
  443. package/src/elements/pane-grid.tsx +0 -111
  444. package/src/elements/pane-group.tsx +0 -119
  445. package/src/elements/pane.tsx +0 -129
  446. package/src/elements/popover.tsx +0 -81
  447. package/src/elements/progress-bar.tsx +0 -39
  448. package/src/elements/prompt-dock.tsx +0 -82
  449. package/src/elements/prompt-input.tsx +0 -240
  450. package/src/elements/prompt-suggestions.tsx +0 -113
  451. package/src/elements/radio-group.tsx +0 -129
  452. package/src/elements/reasoning.tsx +0 -71
  453. package/src/elements/register-impl.ts +0 -148
  454. package/src/elements/register.ts +0 -76
  455. package/src/elements/remote.tsx +0 -225
  456. package/src/elements/resizable.globals.d.ts +0 -36
  457. package/src/elements/resizable.tsx +0 -704
  458. package/src/elements/response-stream.tsx +0 -40
  459. package/src/elements/screen.tsx +0 -90
  460. package/src/elements/scroll-area.tsx +0 -33
  461. package/src/elements/scroll-button.tsx +0 -179
  462. package/src/elements/search.tsx +0 -185
  463. package/src/elements/segmented.tsx +0 -129
  464. package/src/elements/select.tsx +0 -165
  465. package/src/elements/separator.tsx +0 -36
  466. package/src/elements/setting-item.tsx +0 -50
  467. package/src/elements/settings-group.tsx +0 -37
  468. package/src/elements/skeleton.tsx +0 -45
  469. package/src/elements/slider.tsx +0 -171
  470. package/src/elements/slot-text.ts +0 -73
  471. package/src/elements/slots.ts +0 -787
  472. package/src/elements/source.tsx +0 -126
  473. package/src/elements/status.tsx +0 -42
  474. package/src/elements/switch.tsx +0 -118
  475. package/src/elements/tabs.tsx +0 -95
  476. package/src/elements/tasks.tsx +0 -103
  477. package/src/elements/text-shimmer.tsx +0 -28
  478. package/src/elements/thinking-bar.tsx +0 -43
  479. package/src/elements/thread.tsx +0 -139
  480. package/src/elements/toast.tsx +0 -106
  481. package/src/elements/tool.tsx +0 -78
  482. package/src/elements/tooltip.tsx +0 -85
  483. package/src/elements/validate-messages.ts +0 -76
  484. package/src/elements/voice-input.tsx +0 -100
  485. package/src/elements/voice-output.tsx +0 -82
  486. package/src/index.ts +0 -430
  487. package/src/primitives/audio-bands.ts +0 -174
  488. package/src/primitives/card-component-types.ts +0 -63
  489. package/src/primitives/card-contract.ts +0 -80
  490. package/src/primitives/card-data-types.ts +0 -361
  491. package/src/primitives/card-host.tsx +0 -37
  492. package/src/primitives/card-recovery.ts +0 -160
  493. package/src/primitives/card-registry.tsx +0 -78
  494. package/src/primitives/card-resolution.ts +0 -36
  495. package/src/primitives/card-routing.ts +0 -85
  496. package/src/primitives/card-schemas/artifact.schema.json +0 -92
  497. package/src/primitives/card-schemas/card-envelope.schema.json +0 -14
  498. package/src/primitives/card-schemas/card-event.schema.json +0 -12
  499. package/src/primitives/card-schemas/choice.schema.json +0 -75
  500. package/src/primitives/card-schemas/confirm.schema.json +0 -65
  501. package/src/primitives/card-schemas/embed.schema.json +0 -63
  502. package/src/primitives/card-schemas/form.result.schema.json +0 -7
  503. package/src/primitives/card-schemas/form.schema.json +0 -53
  504. package/src/primitives/card-schemas/link.schema.json +0 -54
  505. package/src/primitives/card-schemas/tasks.result.schema.json +0 -16
  506. package/src/primitives/card-schemas/tasks.schema.json +0 -83
  507. package/src/primitives/card-tags.ts +0 -61
  508. package/src/primitives/card-validate-cards.ts +0 -255
  509. package/src/primitives/card-validate-schemas.ts +0 -58
  510. package/src/primitives/card-validate.ts +0 -131
  511. package/src/primitives/chat-config.tsx +0 -103
  512. package/src/primitives/composer-model.ts +0 -49
  513. package/src/primitives/composer-triggers.ts +0 -35
  514. package/src/primitives/controllable.ts +0 -21
  515. package/src/primitives/conversation-store.ts +0 -248
  516. package/src/primitives/create-kai-chat.ts +0 -66
  517. package/src/primitives/create-tween.ts +0 -266
  518. package/src/primitives/embed-providers.ts +0 -254
  519. package/src/primitives/field-mask.ts +0 -256
  520. package/src/primitives/field-semantics.ts +0 -115
  521. package/src/primitives/highlighter.ts +0 -157
  522. package/src/primitives/input-mask.ts +0 -853
  523. package/src/primitives/link-preview.ts +0 -87
  524. package/src/primitives/message-feedback.ts +0 -124
  525. package/src/primitives/pdf-preview.ts +0 -121
  526. package/src/primitives/toast-store.ts +0 -338
  527. package/src/primitives/url-scheme-policy.ts +0 -70
  528. package/src/primitives/use-audio-analysis.ts +0 -340
  529. package/src/primitives/use-auto-resize.ts +0 -31
  530. package/src/primitives/use-resize-observer.ts +0 -45
  531. package/src/primitives/use-sequencer.ts +0 -72
  532. package/src/primitives/use-speech-recognition.ts +0 -146
  533. package/src/primitives/use-stick-to-bottom.ts +0 -75
  534. package/src/primitives/use-text-stream.ts +0 -143
  535. package/src/primitives/use-voice-recorder.ts +0 -62
  536. package/src/primitives/visualizer-sequences.ts +0 -350
  537. package/src/remote/host-embed.ts +0 -345
  538. package/src/remote/index.ts +0 -2
  539. package/src/remote/origin.ts +0 -30
  540. package/src/remote/provider-runtime.ts +0 -262
  541. package/src/remote/provider.ts +0 -2
  542. package/src/remote/validate.ts +0 -22
  543. package/src/remote/version.ts +0 -12
  544. package/src/remote/wire.ts +0 -48
  545. package/src/schemas/from-tool-call.ts +0 -151
  546. package/src/schemas/index.ts +0 -341
  547. package/src/schemas/provider-subsets.ts +0 -538
  548. package/src/schemas/registry.ts +0 -355
  549. package/src/schemas/tool-defs.ts +0 -793
  550. package/src/solid.ts +0 -173
  551. package/src/state/index.ts +0 -44
  552. package/src/state/messages.ts +0 -53
  553. package/src/state/mock.ts +0 -297
  554. package/src/state/parts.ts +0 -295
  555. package/src/state/persistence.ts +0 -180
  556. package/src/state/stream.ts +0 -246
  557. package/src/state/suggestions.ts +0 -9
  558. package/src/state/threads.ts +0 -142
  559. package/src/test-utils/fake-clock.ts +0 -88
  560. package/src/types.ts +0 -95
  561. package/src/ui/action-icons.ts +0 -53
  562. package/src/ui/agent-card.tsx +0 -218
  563. package/src/ui/avatar.tsx +0 -23
  564. package/src/ui/badge.tsx +0 -21
  565. package/src/ui/button.tsx +0 -49
  566. package/src/ui/card.tsx +0 -245
  567. package/src/ui/checkbox-group.tsx +0 -153
  568. package/src/ui/checkbox.tsx +0 -63
  569. package/src/ui/collapsible.tsx +0 -163
  570. package/src/ui/command.tsx +0 -103
  571. package/src/ui/dialog.tsx +0 -223
  572. package/src/ui/dock.tsx +0 -630
  573. package/src/ui/dropdown.tsx +0 -636
  574. package/src/ui/editable-label.tsx +0 -112
  575. package/src/ui/hover-card.tsx +0 -345
  576. package/src/ui/icon.tsx +0 -167
  577. package/src/ui/input.tsx +0 -391
  578. package/src/ui/kbd.tsx +0 -118
  579. package/src/ui/nav.tsx +0 -282
  580. package/src/ui/notice.tsx +0 -84
  581. package/src/ui/overlay.tsx +0 -277
  582. package/src/ui/pane-grid.tsx +0 -117
  583. package/src/ui/pane-group.tsx +0 -291
  584. package/src/ui/pane.tsx +0 -193
  585. package/src/ui/popover.tsx +0 -106
  586. package/src/ui/progress-bar.tsx +0 -83
  587. package/src/ui/prompt-dock.tsx +0 -145
  588. package/src/ui/radio.tsx +0 -150
  589. package/src/ui/resizable.tsx +0 -693
  590. package/src/ui/scroll-area.tsx +0 -26
  591. package/src/ui/segmented.tsx +0 -109
  592. package/src/ui/select.tsx +0 -168
  593. package/src/ui/separator.tsx +0 -10
  594. package/src/ui/settings-group.tsx +0 -67
  595. package/src/ui/skeleton.tsx +0 -73
  596. package/src/ui/slider.tsx +0 -178
  597. package/src/ui/status.tsx +0 -48
  598. package/src/ui/switch.tsx +0 -119
  599. package/src/ui/tabs.tsx +0 -168
  600. package/src/ui/textarea.tsx +0 -21
  601. package/src/ui/tooltip.tsx +0 -118
  602. package/src/utils/cn.ts +0 -30
  603. package/src/wire/chunk.ts +0 -248
  604. package/src/wire/consume.ts +0 -599
  605. package/src/wire/diagnostics.ts +0 -727
  606. package/src/wire/encode-probe.ts +0 -214
  607. package/src/wire/encode.ts +0 -947
  608. package/src/wire/files.ts +0 -342
  609. package/src/wire/formats/anthropic.ts +0 -274
  610. package/src/wire/formats/openai.ts +0 -228
  611. package/src/wire/index.ts +0 -95
  612. package/src/wire/media-types.ts +0 -344
  613. package/src/wire/read.ts +0 -396
  614. package/src/wire/sink-helpers.ts +0 -50
  615. package/src/wire/sse.ts +0 -153
@@ -1 +1 @@
1
- import{I as o}from"./Icon-DObhsRtm.js";import{c as r,q as e}from"./define-By-uL588.js";var c=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],i=a=>r(o,e(a,{name:"Info",iconNode:c})),m=i;export{m as i};
1
+ import{I as o}from"./Icon-BzBET3E-.js";import{c as r,q as e}from"./define-CI0y3eE4.js";var c=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],i=a=>r(o,e(a,{name:"Info",iconNode:c})),m=i;export{m as i};
@@ -1 +1 @@
1
- import{s as Te,w as je,j as Ne,z as Ae,h as He,i as E,c as K,d as ge,S as q,a as pe,b as me,t as H,u as Ue,p as Je,q as Oe}from"./define-By-uL588.js";import{c as G}from"./cn-DN5AWfiS.js";class ve extends Error{}const be=64,We=/[0-9]/u,Ke=/[\p{L}\p{N}]/u;function Q(t){return t==="#"||t==="@"||t==="*"}function ae(t,n){return t==="#"?We.test(n):Ke.test(n)}function Z(t,n){if(t.length>be)throw new ve(`format is ${t.length} characters; the maximum is ${be}`);if(n!==void 0&&n.length!==t.length)throw new ve(`guide is ${n.length} characters but format is ${t.length}; they must align position for position`);const i=[];let o="";for(let u=0;u<t.length;u+=1){const h=t[u];Q(h)?(i.push(u),o+=" "):o+=h}return{format:t,guide:n??o,fillIndexes:i,capacity:i.length}}function qe(t,n){return n==="upper"?t.toUpperCase():n==="lower"?t.toLowerCase():t}function V(t,n,i="preserve"){let o="",u=0,h=0;for(;h<t.format.length&&u<n.length;){const y=t.format[h];if(!Q(y)){n[u].toLowerCase()===y.toLowerCase()&&(u+=1),h+=1;continue}const I=qe(n[u],i);ae(y,I)&&(o+=I,h+=1),u+=1}return o}function L(t,n){if(n.length===0)return"";let i="",o="",u=0;for(let h=0;h<t.format.length;h+=1)if(!Q(t.format[h]))o+=t.format[h];else if(u<n.length)i+=o+n[u],o="",u+=1;else return i;return i+o}function we(t,n){let i="",o=0;for(let u=0;u<t.format.length;u+=1)Q(t.format[u])&&o<n.length?(i+=n[o],o+=1):i+=t.guide[u]??"";return i}function le(t,n){let i="";for(const o of t.fillIndexes){const u=n[o];if(u===void 0||!ae(t.format[o],u))break;i+=u}return i}function Qe(t,n,i){const o=Math.max(0,Math.min(i,n.length));let u=0;for(const h of t.fillIndexes){if(h>=o)break;const y=n[h];if(y===void 0||!ae(t.format[h],y))break;u+=1}return u}function ee(t,n,i){if(t.capacity===0)return Math.min(t.format.length,n.length);const o=Math.max(0,Math.min(i,t.capacity));if(o===0)return Math.min(t.fillIndexes[0],n.length);let u=t.fillIndexes[o-1]+1;for(;u<t.format.length&&!Q(t.format[u]);)u+=1;return Math.min(u,n.length)}const Xe=["tel","ssn","credit-card","custom"],Ye={spellcheck:!1,autocorrect:"off",autocapitalize:"off",canonical:"as-typed"};function ye(t){switch(t){case"tel":return{inputmode:"tel",autocomplete:"tel",spellcheck:!1,autocorrect:"off",autocapitalize:"off",defaultFormat:"###-###-####",canonical:"digits"};case"ssn":return{inputmode:"numeric",autocomplete:"off",spellcheck:!1,autocorrect:"off",autocapitalize:"off",defaultFormat:"###-##-####",canonical:"digits"};case"credit-card":return{inputmode:"numeric",autocomplete:"cc-number",spellcheck:!1,autocorrect:"off",autocapitalize:"off",defaultFormat:"#### #### #### ####",canonical:"digits"};case"custom":return{spellcheck:!1,autocorrect:"off",autocapitalize:"off",canonical:"formatted"};default:return console.warn(`fieldSemantics: unrecognized semantic type ${JSON.stringify(t)}; falling back to unmasked text`),Ye}}function ie(t,n,i){const o=le(t,n);return o.length===0?"":i==="custom"?L(t,o):o}const _e=200,Ge="\u2022",Ze=new Set(["insertText","insertFromPaste","insertFromPasteAsQuotation","insertFromDrop","insertReplacementText","insertFromYank","insertTranspose"]),et=new Set(["deleteContent","deleteContentBackward","deleteContentForward","deleteWordBackward","deleteWordForward","deleteSoftLineBackward","deleteSoftLineForward","deleteHardLineBackward","deleteHardLineForward","deleteByDrag"]),tt=new Set(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"]);function nt(t,n){let i={...n},o=Z(i.format,i.guide),u=i.guide!==void 0,h=i.caseMode??"preserve",y=i.semantic??"custom",I=i.obscure??!1,f="",P=o,m="";const $=[],T=[];let M=!1,S=!1,v=!1,b=!1,z=null;const U=e=>u?we(o,e):L(o,e),j=e=>Math.min(Qe(o,f,e),m.length);function N(){const e=t.selectionStart??f.length,a=t.selectionEnd??f.length;return[j(e),j(Math.max(e,a))]}function X(e,a){v=!0;try{t.setSelectionRange(e,a)}catch{}finally{v=!1}}function A(e,a){var r;(r=i.onReject)==null||r.call(i,{reason:e,data:a})}function J(e,a,r){var c;r.undo!=="none"&&((r.undo==="break"||!M)&&($.push({formatted:f,pattern:P,selStart:t.selectionStart??f.length,selEnd:t.selectionEnd??f.length}),$.length>_e&&$.shift()),M=r.undo==="run",T.length=0),f=e,P=o,m=r.raw,t.value=e;const d=Math.max(0,Math.min(a,e.length)),g=Math.max(d,Math.min(r.selectionEnd??a,e.length));X(d,g),r.notify!==!1&&((c=i.onInput)==null||c.call(i,{canonical:se(),formatted:f}))}function F(e,a,r){const c=U(e);J(c,ee(o,c,a),{...r,raw:e})}function te(e){try{return Z(o.format+"@".repeat(e))}catch{return null}}function C(e,a,r,c){const d=o.capacity-(m.length-(a-e));if(r.length>0&&d<=0)return A("full",r),!1;const g=m.slice(0,e),w=L(o,g),B=V(o,w+r,h),re=B.slice(g.length),he=m.slice(a),oe=V(o,L(o,B)+he,h);if(r.length>0&&re.length===0)return A("wrong-class",r),!1;if(oe===m)return!1;F(oe,g.length+re.length,{undo:c==="insert"?"run":"break",notify:!0});const Be=oe.length<B.length+he.length,Pe=B.length===o.capacity&&re.length<r.length&&ne(w,r,B.length);return(Be||Pe)&&A("over-capacity",r),!0}function ne(e,a,r){const c=te(a.length);return c===null?!1:V(c,e+a,h).length>r}function O(){const e=t.value,a=Math.min(e.length,f.length);let r=0;for(;r<a&&e[r]===f[r];)r+=1;let c=0;for(;c<a-r&&e[e.length-1-c]===f[f.length-1-c];)c+=1;const d=e.slice(r,e.length-c),g=j(r),w=Math.max(g,j(f.length-c));C(g,w,d,"bulk"),t.value!==f&&J(f,ee(o,f,m.length),{undo:"none",raw:m,notify:!1})}function Y(){return{formatted:f,pattern:P,selStart:t.selectionStart??f.length,selEnd:t.selectionEnd??f.length}}function l(e){if(M=!1,e.pattern===o){J(e.formatted,e.selStart,{undo:"none",selectionEnd:e.selEnd,raw:le(o,e.formatted),notify:!0});return}const a=le(e.pattern,e.formatted),r=V(o,L(e.pattern,a),h);F(r,r.length,{undo:"none",notify:!0})}function s(){const e=$.pop();e!==void 0&&(T.push(Y()),l(e))}function p(){const e=T.pop();e!==void 0&&($.push(Y()),l(e))}function D(e){const a=e.split("");for(let r=0;r<o.fillIndexes.length&&r<m.length;r+=1){const c=o.fillIndexes[r];o.format[c]==="*"&&c<a.length&&(a[c]=Ge)}return a.join("")}function x(){const e=t.selectionStart??0,a=t.selectionEnd??0;switch(k()){case"blocked":return"";case"formatted":return f.slice(e,a);case"obscured":return D(f).slice(e,a);default:{const[r,c]=N();return r===0&&c===m.length?ie(o,L(o,m),y):m.slice(r,c)}}}function k(){return i.copyPolicy??(I?"obscured":"canonical")}function R(e){var a;if(b||S)return;const r=e;if(!r.cancelable)return;const c=r.inputType;if(Ze.has(c)){r.preventDefault();const d=r.data??((a=r.dataTransfer)==null?void 0:a.getData("text/plain"))??"",[g,w]=N();C(g,w,d,c==="insertText"?"insert":"bulk");return}if(et.has(c)){r.preventDefault();let[d,g]=N();if(d===g){if((t.selectionStart??0)!==(t.selectionEnd??0))return;const w=c.endsWith("Backward");if(/^delete(Word|SoftLine|HardLine)/.test(c))w?d=0:g=m.length;else if(w){if(d===0)return;d-=1}else{if(g>=m.length)return;g+=1}}C(d,g,"","bulk");return}if(c==="historyUndo"){r.preventDefault(),s();return}c==="historyRedo"&&(r.preventDefault(),p())}function _(){b||S||t.value!==f&&O()}function Ee(){b||(S=!0)}function Ie(){if(b)return;S=!1;const e=z;if(z=null,e!==null){e();return}t.value!==f&&O()}function ue(e){if(S){z=e;return}e()}function Le(e){if(b||S)return;const a=e,r=a.ctrlKey||a.metaKey,c=a.key.toLowerCase();if(r&&c==="z"){a.preventDefault(),a.shiftKey?p():s();return}if(r&&c==="y"){a.preventDefault(),p();return}tt.has(a.key)&&(M=!1)}function ze(){M=!1}function Fe(){M=!1}function Ve(){return[ee(o,f,0),ee(o,f,m.length)]}function $e(){return t.getRootNode().activeElement===t}function W(){if(b||S||v||!$e())return;const e=t.selectionStart,a=t.selectionEnd;if(e===null||a===null)return;const[r,c]=Ve();let d=e,g=a;e===a?d=g=Math.max(r,Math.min(e,c)):(g=Math.min(a,c),d=Math.min(Math.max(e,r),g)),!(d===e&&g===a)&&X(d,g)}function Ce(e){var a;if(b)return;const r=e;r.preventDefault(),(a=r.clipboardData)==null||a.setData("text/plain",x())}function Re(e){var a;if(b)return;const r=e;r.preventDefault(),(a=r.clipboardData)==null||a.setData("text/plain",x());const[c,d]=N();c!==d&&(M=!1,C(c,d,"","bulk"))}function se(){return ie(o,L(o,m),y)}const fe=[["beforeinput",R],["input",_],["compositionstart",Ee],["compositionend",Ie],["keydown",Le],["mousedown",ze],["keyup",W],["mouseup",W],["focus",W],["blur",Fe],["copy",Ce],["cut",Re]],de=t.ownerDocument;for(const[e,a]of fe)t.addEventListener(e,a);de.addEventListener("selectionchange",W);{const e=V(o,i.initialValue??t.value,h);F(e,e.length,{undo:"none",notify:!1})}return{setValue(e){ue(()=>{const a=V(o,e,h);F(a,a.length,{undo:"break",notify:!1})})},getRawValue:()=>m,getCanonicalValue:se,getFormattedValue:()=>f,setObscure(e){I=e},update(e){const a=L(o,m),r=m,c=f,d={...i,...e},g=Z(d.format,d.guide);i=d,o=g,u=d.guide!==void 0,h=d.caseMode??"preserve",y=d.semantic??"custom",I=d.obscure??!1,M=!1,T.length=0,ue(()=>{const w=V(o,a,h),B=U(w)!==c;w.length<r.length&&A("format-change-clipped",a),F(w,w.length,{undo:"none",notify:B})})},detach(){if(!b){b=!0,z=null;for(const[e,a]of fe)t.removeEventListener(e,a);de.removeEventListener("selectionchange",W)}}}}var rt=H("<input>"),ot=H('<label part=label class="text-sm font-medium text-foreground">'),xe=H('<span class="flex shrink-0 items-center text-muted-foreground">'),at=H("<div part=field>"),lt=H("<p part=hint>"),it=H('<div class="flex w-full flex-col gap-1.5">');const ce="default",ke="w-full rounded-md border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50 disabled:pointer-events-none",ct="flex w-full items-center gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm focus-within:outline-none focus-within:ring-2 focus-within:ring-ring",ut="min-w-0 flex-1 bg-transparent text-sm text-foreground placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed",Me="px-2.5 py-1",Se="border-destructive dark:border-red-400/70",De=Se,st="[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none [&::-webkit-search-cancel-button]:hidden";function ft(t){const[n,i]=Te(t,["class","label","hint","error","size","invalid","leading","trailing","onValueInput","onValueChange","onBlur","id","disabled","format","guide","semantic","caseMode","copyPolicy","onMaskReject"]),o=n.id??je(),u=`${o}-hint`,h=()=>!!n.invalid||!!n.error,y=()=>!!n.error||!!n.hint,I=()=>n.leading!=null||n.trailing!=null,f=()=>n.semantic===void 0?void 0:ye(n.semantic),P=new Set,m=(l,s)=>{P.has(l)||(P.add(l),console.warn(s))},$=l=>l.length<=32?l:`${l.slice(0,32)}\u2026 (${l.length} chars)`,T=()=>{var l;const s=n.format;if(s===void 0||s==="")return;if(s!==ce)return s;const p=(l=f())==null?void 0:l.defaultFormat;return p===void 0&&m(`default:${String(n.semantic)}`,`Input: format=${ce} resolves the default format of a semantic type, and semantic=${JSON.stringify(n.semantic)} has none. Rendering unmasked.`),p};let M,S,v,b;const z=()=>{v?.detach(),v=void 0,b=void 0},U=(l,s,p)=>{const D=s instanceof Error?s.message:String(s);m(`format:${l}`,`Input: format ${JSON.stringify($(l))} did not compile (${D}); `+(p?"the field keeps its previous format.":"rendering unmasked."))};Ne(()=>{const l=T(),s={guide:n.guide,semantic:n.semantic,caseMode:n.caseMode,copyPolicy:n.copyPolicy},p=I()?S:M;Ae(()=>{if(l===void 0||p===void 0){z();return}if(v!==void 0&&b===p){try{v.update({format:l,...s})}catch(x){U(l,x,!0)}return}const D=v?.getFormattedValue()??p.value;z();try{v=nt(p,{...s,format:l,initialValue:D,onInput:({canonical:x})=>{var k;return(k=n.onValueInput)==null?void 0:k.call(n,x)},onReject:x=>{var k;return(k=n.onMaskReject)==null?void 0:k.call(n,x)}}),b=p}catch(x){U(l,x,!1)}})}),He(z);const j=()=>{var l;return i.inputmode??((l=f())==null?void 0:l.inputmode)},N=()=>{var l;return i.autocomplete??((l=f())==null?void 0:l.autocomplete)},X=()=>{const l=i.spellcheck;if(l!==void 0)return l===!0||l==="true"?"true":"false";const s=f();if(s!==void 0)return s.spellcheck?"true":"false"},A=()=>{var l;return i.autocorrect??((l=f())==null?void 0:l.autocorrect)},J=()=>{var l;return i.autocapitalize??((l=f())==null?void 0:l.autocapitalize)},F=(l,s,p)=>(()=>{var D=rt(),x=p;return typeof x=="function"?Ue(x,D):p=D,Je(D,Oe(i,{id:o,part:s,get disabled(){return n.disabled},get"aria-invalid"(){return h()?"true":void 0},get"aria-describedby"(){return y()?u:void 0},get inputmode(){return j()},get autocomplete(){return N()},get spellcheck(){return X()},get autocorrect(){return A()},get autocapitalize(){return J()},get class(){return G(st,l())},onInput:k=>{var R;v===void 0&&((R=n.onValueInput)==null||R.call(n,k.currentTarget.value))},onBlur:k=>{var R;const _=n.onBlur;typeof _=="function"&&_(k),(R=n.onValueChange)==null||R.call(n,v?.getCanonicalValue()??k.currentTarget.value)}}),!1,!1),D})(),te=()=>G(ke,n.size==="sm"&&Me,h()&&De,n.class);let C;const ne=()=>C??(C=F(te,"field input",l=>M=l));let O;const Y=()=>O??(O=F(()=>ut,"input",l=>S=l));return(()=>{var l=it();return E(l,K(q,{get when(){return n.label},get children(){var s=ot();return ge(s,"for",o),E(s,()=>n.label),s}}),null),E(l,K(q,{get when(){return I()},get fallback(){return ne()},get children(){var s=at();return E(s,K(q,{get when(){return n.leading},get children(){var p=xe();return E(p,()=>n.leading),p}}),null),E(s,Y,null),E(s,K(q,{get when(){return n.trailing},get children(){var p=xe();return E(p,()=>n.trailing),p}}),null),pe(()=>me(s,G(ct,n.size==="sm"&&Me,h()&&De,n.disabled&&"opacity-50 pointer-events-none",n.class))),s}}),null),E(l,K(q,{get when(){return y()},get children(){var s=lt();return ge(s,"id",u),E(s,()=>n.error??n.hint),pe(()=>me(s,G("text-xs",n.error?"text-destructive":"text-muted-foreground"))),s}}),null),l})()}export{ce as D,ke as F,ft as I,Xe as a,L as b,Z as c,we as d,Se as e,ye as f,ie as g,V as n};
1
+ import{s as Te,w as je,j as Ne,z as Ae,h as He,i as E,c as K,d as ge,S as q,a as pe,b as me,t as H,u as Ue,p as Je,q as Oe}from"./define-CI0y3eE4.js";import{c as G}from"./cn-DN5AWfiS.js";class ve extends Error{}const be=64,We=/[0-9]/u,Ke=/[\p{L}\p{N}]/u;function Q(t){return t==="#"||t==="@"||t==="*"}function ae(t,n){return t==="#"?We.test(n):Ke.test(n)}function Z(t,n){if(t.length>be)throw new ve(`format is ${t.length} characters; the maximum is ${be}`);if(n!==void 0&&n.length!==t.length)throw new ve(`guide is ${n.length} characters but format is ${t.length}; they must align position for position`);const i=[];let o="";for(let u=0;u<t.length;u+=1){const h=t[u];Q(h)?(i.push(u),o+=" "):o+=h}return{format:t,guide:n??o,fillIndexes:i,capacity:i.length}}function qe(t,n){return n==="upper"?t.toUpperCase():n==="lower"?t.toLowerCase():t}function V(t,n,i="preserve"){let o="",u=0,h=0;for(;h<t.format.length&&u<n.length;){const y=t.format[h];if(!Q(y)){n[u].toLowerCase()===y.toLowerCase()&&(u+=1),h+=1;continue}const I=qe(n[u],i);ae(y,I)&&(o+=I,h+=1),u+=1}return o}function L(t,n){if(n.length===0)return"";let i="",o="",u=0;for(let h=0;h<t.format.length;h+=1)if(!Q(t.format[h]))o+=t.format[h];else if(u<n.length)i+=o+n[u],o="",u+=1;else return i;return i+o}function we(t,n){let i="",o=0;for(let u=0;u<t.format.length;u+=1)Q(t.format[u])&&o<n.length?(i+=n[o],o+=1):i+=t.guide[u]??"";return i}function le(t,n){let i="";for(const o of t.fillIndexes){const u=n[o];if(u===void 0||!ae(t.format[o],u))break;i+=u}return i}function Qe(t,n,i){const o=Math.max(0,Math.min(i,n.length));let u=0;for(const h of t.fillIndexes){if(h>=o)break;const y=n[h];if(y===void 0||!ae(t.format[h],y))break;u+=1}return u}function ee(t,n,i){if(t.capacity===0)return Math.min(t.format.length,n.length);const o=Math.max(0,Math.min(i,t.capacity));if(o===0)return Math.min(t.fillIndexes[0],n.length);let u=t.fillIndexes[o-1]+1;for(;u<t.format.length&&!Q(t.format[u]);)u+=1;return Math.min(u,n.length)}const Xe=["tel","ssn","credit-card","custom"],Ye={spellcheck:!1,autocorrect:"off",autocapitalize:"off",canonical:"as-typed"};function ye(t){switch(t){case"tel":return{inputmode:"tel",autocomplete:"tel",spellcheck:!1,autocorrect:"off",autocapitalize:"off",defaultFormat:"###-###-####",canonical:"digits"};case"ssn":return{inputmode:"numeric",autocomplete:"off",spellcheck:!1,autocorrect:"off",autocapitalize:"off",defaultFormat:"###-##-####",canonical:"digits"};case"credit-card":return{inputmode:"numeric",autocomplete:"cc-number",spellcheck:!1,autocorrect:"off",autocapitalize:"off",defaultFormat:"#### #### #### ####",canonical:"digits"};case"custom":return{spellcheck:!1,autocorrect:"off",autocapitalize:"off",canonical:"formatted"};default:return console.warn(`fieldSemantics: unrecognized semantic type ${JSON.stringify(t)}; falling back to unmasked text`),Ye}}function ie(t,n,i){const o=le(t,n);return o.length===0?"":i==="custom"?L(t,o):o}const _e=200,Ge="\u2022",Ze=new Set(["insertText","insertFromPaste","insertFromPasteAsQuotation","insertFromDrop","insertReplacementText","insertFromYank","insertTranspose"]),et=new Set(["deleteContent","deleteContentBackward","deleteContentForward","deleteWordBackward","deleteWordForward","deleteSoftLineBackward","deleteSoftLineForward","deleteHardLineBackward","deleteHardLineForward","deleteByDrag"]),tt=new Set(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"]);function nt(t,n){let i={...n},o=Z(i.format,i.guide),u=i.guide!==void 0,h=i.caseMode??"preserve",y=i.semantic??"custom",I=i.obscure??!1,f="",P=o,m="";const $=[],T=[];let M=!1,S=!1,v=!1,b=!1,z=null;const U=e=>u?we(o,e):L(o,e),j=e=>Math.min(Qe(o,f,e),m.length);function N(){const e=t.selectionStart??f.length,a=t.selectionEnd??f.length;return[j(e),j(Math.max(e,a))]}function X(e,a){v=!0;try{t.setSelectionRange(e,a)}catch{}finally{v=!1}}function A(e,a){var r;(r=i.onReject)==null||r.call(i,{reason:e,data:a})}function J(e,a,r){var c;r.undo!=="none"&&((r.undo==="break"||!M)&&($.push({formatted:f,pattern:P,selStart:t.selectionStart??f.length,selEnd:t.selectionEnd??f.length}),$.length>_e&&$.shift()),M=r.undo==="run",T.length=0),f=e,P=o,m=r.raw,t.value=e;const d=Math.max(0,Math.min(a,e.length)),g=Math.max(d,Math.min(r.selectionEnd??a,e.length));X(d,g),r.notify!==!1&&((c=i.onInput)==null||c.call(i,{canonical:se(),formatted:f}))}function F(e,a,r){const c=U(e);J(c,ee(o,c,a),{...r,raw:e})}function te(e){try{return Z(o.format+"@".repeat(e))}catch{return null}}function C(e,a,r,c){const d=o.capacity-(m.length-(a-e));if(r.length>0&&d<=0)return A("full",r),!1;const g=m.slice(0,e),w=L(o,g),B=V(o,w+r,h),re=B.slice(g.length),he=m.slice(a),oe=V(o,L(o,B)+he,h);if(r.length>0&&re.length===0)return A("wrong-class",r),!1;if(oe===m)return!1;F(oe,g.length+re.length,{undo:c==="insert"?"run":"break",notify:!0});const Be=oe.length<B.length+he.length,Pe=B.length===o.capacity&&re.length<r.length&&ne(w,r,B.length);return(Be||Pe)&&A("over-capacity",r),!0}function ne(e,a,r){const c=te(a.length);return c===null?!1:V(c,e+a,h).length>r}function O(){const e=t.value,a=Math.min(e.length,f.length);let r=0;for(;r<a&&e[r]===f[r];)r+=1;let c=0;for(;c<a-r&&e[e.length-1-c]===f[f.length-1-c];)c+=1;const d=e.slice(r,e.length-c),g=j(r),w=Math.max(g,j(f.length-c));C(g,w,d,"bulk"),t.value!==f&&J(f,ee(o,f,m.length),{undo:"none",raw:m,notify:!1})}function Y(){return{formatted:f,pattern:P,selStart:t.selectionStart??f.length,selEnd:t.selectionEnd??f.length}}function l(e){if(M=!1,e.pattern===o){J(e.formatted,e.selStart,{undo:"none",selectionEnd:e.selEnd,raw:le(o,e.formatted),notify:!0});return}const a=le(e.pattern,e.formatted),r=V(o,L(e.pattern,a),h);F(r,r.length,{undo:"none",notify:!0})}function s(){const e=$.pop();e!==void 0&&(T.push(Y()),l(e))}function p(){const e=T.pop();e!==void 0&&($.push(Y()),l(e))}function D(e){const a=e.split("");for(let r=0;r<o.fillIndexes.length&&r<m.length;r+=1){const c=o.fillIndexes[r];o.format[c]==="*"&&c<a.length&&(a[c]=Ge)}return a.join("")}function x(){const e=t.selectionStart??0,a=t.selectionEnd??0;switch(k()){case"blocked":return"";case"formatted":return f.slice(e,a);case"obscured":return D(f).slice(e,a);default:{const[r,c]=N();return r===0&&c===m.length?ie(o,L(o,m),y):m.slice(r,c)}}}function k(){return i.copyPolicy??(I?"obscured":"canonical")}function R(e){var a;if(b||S)return;const r=e;if(!r.cancelable)return;const c=r.inputType;if(Ze.has(c)){r.preventDefault();const d=r.data??((a=r.dataTransfer)==null?void 0:a.getData("text/plain"))??"",[g,w]=N();C(g,w,d,c==="insertText"?"insert":"bulk");return}if(et.has(c)){r.preventDefault();let[d,g]=N();if(d===g){if((t.selectionStart??0)!==(t.selectionEnd??0))return;const w=c.endsWith("Backward");if(/^delete(Word|SoftLine|HardLine)/.test(c))w?d=0:g=m.length;else if(w){if(d===0)return;d-=1}else{if(g>=m.length)return;g+=1}}C(d,g,"","bulk");return}if(c==="historyUndo"){r.preventDefault(),s();return}c==="historyRedo"&&(r.preventDefault(),p())}function _(){b||S||t.value!==f&&O()}function Ee(){b||(S=!0)}function Ie(){if(b)return;S=!1;const e=z;if(z=null,e!==null){e();return}t.value!==f&&O()}function ue(e){if(S){z=e;return}e()}function Le(e){if(b||S)return;const a=e,r=a.ctrlKey||a.metaKey,c=a.key.toLowerCase();if(r&&c==="z"){a.preventDefault(),a.shiftKey?p():s();return}if(r&&c==="y"){a.preventDefault(),p();return}tt.has(a.key)&&(M=!1)}function ze(){M=!1}function Fe(){M=!1}function Ve(){return[ee(o,f,0),ee(o,f,m.length)]}function $e(){return t.getRootNode().activeElement===t}function W(){if(b||S||v||!$e())return;const e=t.selectionStart,a=t.selectionEnd;if(e===null||a===null)return;const[r,c]=Ve();let d=e,g=a;e===a?d=g=Math.max(r,Math.min(e,c)):(g=Math.min(a,c),d=Math.min(Math.max(e,r),g)),!(d===e&&g===a)&&X(d,g)}function Ce(e){var a;if(b)return;const r=e;r.preventDefault(),(a=r.clipboardData)==null||a.setData("text/plain",x())}function Re(e){var a;if(b)return;const r=e;r.preventDefault(),(a=r.clipboardData)==null||a.setData("text/plain",x());const[c,d]=N();c!==d&&(M=!1,C(c,d,"","bulk"))}function se(){return ie(o,L(o,m),y)}const fe=[["beforeinput",R],["input",_],["compositionstart",Ee],["compositionend",Ie],["keydown",Le],["mousedown",ze],["keyup",W],["mouseup",W],["focus",W],["blur",Fe],["copy",Ce],["cut",Re]],de=t.ownerDocument;for(const[e,a]of fe)t.addEventListener(e,a);de.addEventListener("selectionchange",W);{const e=V(o,i.initialValue??t.value,h);F(e,e.length,{undo:"none",notify:!1})}return{setValue(e){ue(()=>{const a=V(o,e,h);F(a,a.length,{undo:"break",notify:!1})})},getRawValue:()=>m,getCanonicalValue:se,getFormattedValue:()=>f,setObscure(e){I=e},update(e){const a=L(o,m),r=m,c=f,d={...i,...e},g=Z(d.format,d.guide);i=d,o=g,u=d.guide!==void 0,h=d.caseMode??"preserve",y=d.semantic??"custom",I=d.obscure??!1,M=!1,T.length=0,ue(()=>{const w=V(o,a,h),B=U(w)!==c;w.length<r.length&&A("format-change-clipped",a),F(w,w.length,{undo:"none",notify:B})})},detach(){if(!b){b=!0,z=null;for(const[e,a]of fe)t.removeEventListener(e,a);de.removeEventListener("selectionchange",W)}}}}var rt=H("<input>"),ot=H('<label part=label class="text-sm font-medium text-foreground">'),xe=H('<span class="flex shrink-0 items-center text-muted-foreground">'),at=H("<div part=field>"),lt=H("<p part=hint>"),it=H('<div class="flex w-full flex-col gap-1.5">');const ce="default",ke="w-full rounded-md border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50 disabled:pointer-events-none",ct="flex w-full items-center gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm focus-within:outline-none focus-within:ring-2 focus-within:ring-ring",ut="min-w-0 flex-1 bg-transparent text-sm text-foreground placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed",Me="px-2.5 py-1",Se="border-destructive dark:border-red-400/70",De=Se,st="[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none [&::-webkit-search-cancel-button]:hidden";function ft(t){const[n,i]=Te(t,["class","label","hint","error","size","invalid","leading","trailing","onValueInput","onValueChange","onBlur","id","disabled","format","guide","semantic","caseMode","copyPolicy","onMaskReject"]),o=n.id??je(),u=`${o}-hint`,h=()=>!!n.invalid||!!n.error,y=()=>!!n.error||!!n.hint,I=()=>n.leading!=null||n.trailing!=null,f=()=>n.semantic===void 0?void 0:ye(n.semantic),P=new Set,m=(l,s)=>{P.has(l)||(P.add(l),console.warn(s))},$=l=>l.length<=32?l:`${l.slice(0,32)}\u2026 (${l.length} chars)`,T=()=>{var l;const s=n.format;if(s===void 0||s==="")return;if(s!==ce)return s;const p=(l=f())==null?void 0:l.defaultFormat;return p===void 0&&m(`default:${String(n.semantic)}`,`Input: format=${ce} resolves the default format of a semantic type, and semantic=${JSON.stringify(n.semantic)} has none. Rendering unmasked.`),p};let M,S,v,b;const z=()=>{v?.detach(),v=void 0,b=void 0},U=(l,s,p)=>{const D=s instanceof Error?s.message:String(s);m(`format:${l}`,`Input: format ${JSON.stringify($(l))} did not compile (${D}); `+(p?"the field keeps its previous format.":"rendering unmasked."))};Ne(()=>{const l=T(),s={guide:n.guide,semantic:n.semantic,caseMode:n.caseMode,copyPolicy:n.copyPolicy},p=I()?S:M;Ae(()=>{if(l===void 0||p===void 0){z();return}if(v!==void 0&&b===p){try{v.update({format:l,...s})}catch(x){U(l,x,!0)}return}const D=v?.getFormattedValue()??p.value;z();try{v=nt(p,{...s,format:l,initialValue:D,onInput:({canonical:x})=>{var k;return(k=n.onValueInput)==null?void 0:k.call(n,x)},onReject:x=>{var k;return(k=n.onMaskReject)==null?void 0:k.call(n,x)}}),b=p}catch(x){U(l,x,!1)}})}),He(z);const j=()=>{var l;return i.inputmode??((l=f())==null?void 0:l.inputmode)},N=()=>{var l;return i.autocomplete??((l=f())==null?void 0:l.autocomplete)},X=()=>{const l=i.spellcheck;if(l!==void 0)return l===!0||l==="true"?"true":"false";const s=f();if(s!==void 0)return s.spellcheck?"true":"false"},A=()=>{var l;return i.autocorrect??((l=f())==null?void 0:l.autocorrect)},J=()=>{var l;return i.autocapitalize??((l=f())==null?void 0:l.autocapitalize)},F=(l,s,p)=>(()=>{var D=rt(),x=p;return typeof x=="function"?Ue(x,D):p=D,Je(D,Oe(i,{id:o,part:s,get disabled(){return n.disabled},get"aria-invalid"(){return h()?"true":void 0},get"aria-describedby"(){return y()?u:void 0},get inputmode(){return j()},get autocomplete(){return N()},get spellcheck(){return X()},get autocorrect(){return A()},get autocapitalize(){return J()},get class(){return G(st,l())},onInput:k=>{var R;v===void 0&&((R=n.onValueInput)==null||R.call(n,k.currentTarget.value))},onBlur:k=>{var R;const _=n.onBlur;typeof _=="function"&&_(k),(R=n.onValueChange)==null||R.call(n,v?.getCanonicalValue()??k.currentTarget.value)}}),!1,!1),D})(),te=()=>G(ke,n.size==="sm"&&Me,h()&&De,n.class);let C;const ne=()=>C??(C=F(te,"field input",l=>M=l));let O;const Y=()=>O??(O=F(()=>ut,"input",l=>S=l));return(()=>{var l=it();return E(l,K(q,{get when(){return n.label},get children(){var s=ot();return ge(s,"for",o),E(s,()=>n.label),s}}),null),E(l,K(q,{get when(){return I()},get fallback(){return ne()},get children(){var s=at();return E(s,K(q,{get when(){return n.leading},get children(){var p=xe();return E(p,()=>n.leading),p}}),null),E(s,Y,null),E(s,K(q,{get when(){return n.trailing},get children(){var p=xe();return E(p,()=>n.trailing),p}}),null),pe(()=>me(s,G(ct,n.size==="sm"&&Me,h()&&De,n.disabled&&"opacity-50 pointer-events-none",n.class))),s}}),null),E(l,K(q,{get when(){return y()},get children(){var s=lt();return ge(s,"id",u),E(s,()=>n.error??n.hint),pe(()=>me(s,G("text-xs",n.error?"text-destructive":"text-muted-foreground"))),s}}),null),l})()}export{ce as D,ke as F,ft as I,Xe as a,L as b,Z as c,we as d,Se as e,ye as f,ie as g,V as n};
package/dist/kai.es.js CHANGED
@@ -1 +1 @@
1
- const Vn={bash:()=>import("./bash-InADTalH.js"),javascript:()=>import("./javascript-C25yR2R2.js"),typescript:()=>import("./typescript-RycA9KXf.js"),tsx:()=>import("./tsx-B8rCNbgL.js"),html:()=>import("./html-CPZ3oZQ7.js"),css:()=>import("./css-M7EaDHN_.js"),json:()=>import("./json-DxJze_jm.js"),vue:()=>import("./vue-BmIZj4XD.js"),svelte:()=>import("./svelte--5p79yCD.js")},zn={"github-dark-dimmed":()=>import("./github-dark-dimmed-DUshB20C.js"),"github-light":()=>import("./github-light-JYsPkUQd.js")},$n={js:"javascript",ts:"typescript",jsx:"tsx",sh:"bash",shell:"bash"},Ut="github-dark-dimmed";let Ot=!0,At={...Vn},jt={...zn},Pt={...$n},_t=null;const Jt=new Set,Wt=new Set;function In(){return _t||(_t=(async()=>{const[{createHighlighterCore:t},{createJavaScriptRegexEngine:n}]=await Promise.all([import("./core-C8fzo39E.js"),import("./engine-javascript-C1x7zo1_.js")]);return t({themes:[],langs:[],engine:n()})})()),_t}function Bt(t){return Pt[t]??t}async function Dn(t,n){const e=Bt(n);if(Jt.has(e))return!0;const r=At[e];return r?(await t.loadLanguage(r()),Jt.add(e),!0):!1}async function Gt(t,n){if(Wt.has(n))return!0;const e=jt[n];return e?(await t.loadTheme(e()),Wt.add(n),!0):!1}function Mn(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function lt(t){return`<pre><code>${Mn(t)}</code></pre>`}async function Tn(t,n,e){if(!Ot||!t)return lt(t);try{const r=await In();if(!await Dn(r,n))return lt(t);const o=await Gt(r,e)?e:await Gt(r,Ut)?Ut:null;return o?r.codeToHtml(t,{lang:Bt(n),theme:o}):lt(t)}catch{return lt(t)}}function Fn(t){t.enabled!==void 0&&(Ot=t.enabled),t.languages&&(At={...At,...t.languages}),t.themes&&(jt={...jt,...t.themes}),t.aliases&&(Pt={...Pt,...t.aliases})}function Hn(){return Ot}function Nn(t){const n=t.toLowerCase();return n?n.includes("bash")||n.includes("command")||n.includes("shell")||n.includes("terminal")||n.includes("exec")?"command":n.includes("edit")||n.includes("write")||n.includes("patch")||n.includes("replace")||n.includes("delete")?"file-change":n.includes("search")||n.includes("grep")||n.includes("glob")||n.includes("find")?"search":n.includes("fetch")||n.includes("http")||n.includes("browse")||n.includes("crawl")?"fetch":n.includes("mcp")?"mcp":n.includes("image")||n.includes("screenshot")||n.includes("vision")?"image":"generic":"generic"}const Ct=Symbol.for("kai.wire.diagnostics.v1");function qt(){return globalThis[Ct]}function Zt(){const t=globalThis;return t[Ct]??(t[Ct]={subs:[],seq:0,payload:!1})}function Rn(t){const n=Zt().subs;n.push(t);let e=!0;return()=>{if(!e)return;e=!1;const r=n.indexOf(t);r!==-1&&n.splice(r,1)}}function Et(){const t=qt();return t!==void 0&&t.subs.length>0}function Ln(t){!t&&qt()===void 0||(Zt().payload=t)}function Qt(t){const n=qt();if(n)for(const e of[...n.subs])try{e(t)}catch{}}const Kn={"kai-agent-card":["status"],"kai-artifact":["files"],"kai-attachments":["items"],"kai-audio-visualizer":["audioElement","bands","shader","stream"],"kai-cards":["cards","policy","schemas","types"],"kai-chain-of-thought":["defaultValue","steps","value"],"kai-chat":["cardSchemas","cardTypes","context","home","kindIcons","messages","models","store","suggestions","triggers","value"],"kai-checkbox-group":["options"],"kai-choice":["data","resolution"],"kai-command":["items"],"kai-compare":["data","selection"],"kai-composer":["highlights","kindIcons","triggers","value"],"kai-confirm":["data","resolution"],"kai-context":["context"],"kai-conversations":["conversations","groups"],"kai-embed":["data"],"kai-feedback-bar":["categories"],"kai-file-tree":["defaultExpanded","files"],"kai-form":["data","defaultValues","resolution","values"],"kai-image":["bytes"],"kai-link-preview":["data"],"kai-menu":["items"],"kai-message":["cardSchemas","cardTypes","message"],"kai-model-switcher":["models"],"kai-nav":["defaultCollapsed","items"],"kai-pane":["status"],"kai-pane-grid":["maximizedIndex"],"kai-pane-group":["tabs"],"kai-prompt-input":["attachments","kindIcons","suggestions","triggers","value"],"kai-radio-group":["options"],"kai-remote":["envelope","policy"],"kai-resizable":["maximizedIndex"],"kai-response-stream":["text"],"kai-scope-picker":["availableAuthors","availableTags"],"kai-segmented":["options"],"kai-select":["options"],"kai-skills":["skills"],"kai-slider":["valueLabel"],"kai-sources":["sources"],"kai-suggestions":["suggestions"],"kai-tabs":["items"],"kai-tasks":["data","defaultValue","resolution","value"],"kai-thread":["cardSchemas","cardTypes","messages"],"kai-toast-region":["target","toasts"],"kai-tool":["tool"],"kai-voice-input":["transcribe"],"kai-voice-output":["synthesize"]},Un={"kai-conversations":"conversation-list","kai-conversation-item":"conversation-item","kai-prompt-input":"prompt-input","kai-chat":"chat","kai-workspace":"chat-workspace","kai-thread":"thread","kai-thinking-bar":"thinking-bar","kai-model-switcher":"model-switcher","kai-attachments":"attachments","kai-message":"message","kai-markdown":"markdown","kai-code-block":"code-block","kai-reasoning":"reasoning","kai-tool":"tool","kai-context":"context-meter","kai-feedback-bar":"feedback-bar","kai-scope-picker":"chat-scope-picker","kai-suggestions":"prompt-suggestions","kai-file-upload":"file-upload","kai-voice-input":"voice-input","kai-audio-visualizer":"audio-visualizer","kai-loader":"loader","kai-text-shimmer":"text-shimmer","kai-image":"image","kai-checkpoint":"checkpoint","kai-skills":"message-skills","kai-source":"source","kai-sources":"source","kai-response-stream":"response-stream","kai-empty":"empty","kai-status":"status","kai-nav":"nav","kai-progress-bar":"progress-bar","kai-coachmark":"coachmark","kai-tabs":"tabs","kai-voice-output":"voice-output","kai-screen":"screen","kai-chain-of-thought":"chain-of-thought","kai-resizable":"resizable","kai-resizable-item":"resizable","kai-file-tree":"file-tree","kai-artifact":"artifact","kai-scroll-button":"scroll-button","kai-popover":"popover","kai-switch":"switch","kai-checkbox":"checkbox","kai-checkbox-group":"checkbox-group","kai-radio-group":"radio-group","kai-slider":"slider","kai-select":"select","kai-button":"button","kai-avatar":"avatar","kai-badge":"badge","kai-tooltip":"tooltip","kai-notice":"notice","kai-icon":"icon","kai-separator":"separator","kai-scroll-area":"scroll-area","kai-hover-card":"hover-card","kai-skeleton":"skeleton","kai-toast-region":"toast","kai-card":"card","kai-form":"form","kai-link-preview":"link-preview","kai-embed":"embed","kai-confirm":"confirm-card","kai-tasks":"tasks","kai-choice":"choice","kai-cards":"cards","kai-compare":"compare","kai-composer":"composer","kai-menu":"menu","kai-dropdown":"dropdown","kai-command":"command","kai-prompt-dock":"prompt-dock","kai-segmented":"segmented","kai-settings-group":"settings-group","kai-setting-item":"setting-item","kai-pane":"pane","kai-pane-group":"pane-group","kai-pane-grid":"pane-grid","kai-agent-card":"agent-card","kai-dialog":"dialog","kai-dock":"dock","kai-input":"input","kai-search":"search","kai-kbd":"kbd","kai-editable-label":"editable-label"},Xt=Kn;function Jn(t){return t.replace(/\.?([A-Z]+)/g,(n,e)=>"-"+e.toLowerCase()).replace("_","-").replace(/^-/,"")}function Wn(t){if(t==="")return"empty-attribute";if(t==="[object Object]")return"[object Object]";if(t.includes(",")){const n=t.split(",");if(n.every(e=>e==="[object Object]"))return`[object Object] x ${n.length}`}try{const n=JSON.parse(t);return n!==null&&typeof n=="object"?void 0:n===null?"json:null":`json:${typeof n}`}catch{return`string(len=${t.length})`}}function Vt(t,n,e,r){const o={type:"element.violation",t:Date.now(),kind:t,tag:n,prop:e,...r};Qt(o)}const Yt=Symbol.for("kai.element.diagnostics.installed.v1");function Bn(t){const n=Xt[t];return n!==void 0&&n.length>0}function Gn(t,n){const e=Xt[t];if(!e||e.length===0)return;const r=n;if(r[Yt])return;r[Yt]=!0;const o=n,i=new Map;for(const c of e)i.set(Jn(c),c);const s=o.attributeChangedCallback;o.attributeChangedCallback=function(c,f,d){if(d!==null&&Et())try{const l=i.get(c);if(l!==void 0){const k=Wn(d);k!==void 0&&Vt("array-prop-as-attribute",t,l,{valuePreview:k})}}catch{}s?.call(this,c,f,d)};const a=o.connectedCallback;o.connectedCallback=function(){var c;a?.call(this);try{(c=this.addPropertyChangedCallback)==null||c.call(this,(f,d,l)=>{if(Et())try{if(!Array.isArray(d))return;if(d===l){Vt("same-array-reference",t,f,{length:d.length});return}if(!Array.isArray(l)||d.length===0||l.length!==d.length)return;for(let k=0;k<d.length;k++)if(d[k]!==l[k])return;Vt("mutated-in-place",t,f,{length:d.length})}catch{}})}catch{}}}const tn=Object.keys(Un);function Zn(){if(typeof customElements>"u"||!Et())return;const t=[],n=[];for(const r of tn)(customElements.get(r)?t:n).push(r);const e={type:"element.registry",t:Date.now(),defined:t,notDefined:n,total:tn.length};return Qt(e),e}const h={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return nn(this.context.count)},getNextContextId(){return nn(this.context.count++)}};function nn(t){const n=String(t),e=n.length-1;return h.context.id+(e?String.fromCharCode(96+e):"")+n}function zt(t){h.context=t}function Qn(){return{...h.context,id:h.getNextContextId(),count:0}}const Re=!1,Xn=(t,n)=>t===n,V=Symbol("solid-proxy"),en=typeof Proxy=="function",Q=Symbol("solid-track"),Le=Symbol("solid-dev-component"),dt={equals:Xn};let X=null,rn=pn;const P=1,Y=2,on={owned:null,cleanups:null,context:null,owner:null},$t={};var p=null;let u=null,U=null,J=null,g=null,v=null,x=null,ft=0;function N(t,n){const e=g,r=p,o=t.length===0,i=n===void 0?r:n,s=o?on:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?t:()=>t(()=>y(()=>H(s)));p=s,g=null;try{return A(a,!0)}finally{g=e,p=r}}function z(t,n){n=n?Object.assign({},dt,n):dt;const e={value:t,observers:null,observerSlots:null,comparator:n.equals||void 0},r=o=>(typeof o=="function"&&(u&&u.running&&u.sources.has(e)?o=o(e.tValue):o=o(e.value)),dn(e,o));return[ln.bind(e),r]}function It(t,n,e){const r=et(t,n,!0,P);U&&u&&u.running?v.push(r):W(r)}function sn(t,n,e){const r=et(t,n,!1,P);U&&u&&u.running?v.push(r):W(r)}function an(t,n,e){rn=le;const r=et(t,n,!1,P),o=nt&&Mt(nt);o&&(r.suspense=o),(!e||!e.render)&&(r.user=!0),x?x.push(r):W(r)}function O(t,n,e){e=e?Object.assign({},dt,e):dt;const r=et(t,n,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=e.equals||void 0,U&&u&&u.running?(r.tState=P,v.push(r)):W(r),ln.bind(r)}function Yn(t){return t&&typeof t=="object"&&"then"in t}function te(t,n,e){let r,o,i;typeof n=="function"?(r=t,o=n,i=e||{}):(r=!0,o=t,i=n||{});let s=null,a=$t,c=null,f=!1,d=!1,l="initialValue"in i,k=typeof r=="function"&&O(r);const w=new Set,[_,I]=(i.storage||z)(i.initialValue),[F,K]=z(void 0),[C,q]=z(void 0,{equals:!1}),[E,M]=z(l?"ready":"unresolved");h.context&&(c=h.getNextContextId(),i.ssrLoadFrom==="initial"?a=i.initialValue:h.load&&h.has(c)&&(a=h.load(c)));function T(m,b,$,S){return s===m&&(s=null,S!==void 0&&(l=!0),(m===a||b===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(S,{value:b})),a=$t,u&&m&&f?(u.promises.delete(m),f=!1,A(()=>{u.running=!0,Lt(b,$)},!1)):Lt(b,$)),b}function Lt(m,b){A(()=>{b===void 0&&I(()=>m),M(b!==void 0?"errored":l?"ready":"unresolved"),K(b);for(const $ of w.keys())$.decrement();w.clear()},!1)}function xt(){const m=nt&&Mt(nt),b=_(),$=F();if($!==void 0&&!s)throw $;return g&&!g.user&&m&&It(()=>{C(),s&&(m.resolved&&u&&f?u.promises.add(s):w.has(m)||(m.increment(),w.add(m)))}),b}function St(m=!0){if(m!==!1&&d)return;d=!1;const b=k?k():r;if(f=u&&u.running,b==null||b===!1){T(s,y(_));return}u&&s&&u.promises.delete(s);let $;const S=a!==$t?a:y(()=>{try{return o(b,{value:_(),refetching:m})}catch(Z){$=Z}});if($!==void 0){T(s,void 0,gt($),b);return}else if(!Yn(S))return T(s,S,void 0,b),S;return s=S,"v"in S?(S.s===1?T(s,S.v,void 0,b):T(s,void 0,gt(S.v),b),S):(d=!0,queueMicrotask(()=>d=!1),A(()=>{M(l?"refreshing":"pending"),q()},!1),S.then(Z=>T(S,Z,void 0,b),Z=>T(S,void 0,gt(Z),b)))}Object.defineProperties(xt,{state:{get:()=>E()},error:{get:()=>F()},loading:{get(){const m=E();return m==="pending"||m==="refreshing"}},latest:{get(){if(!l)return xt();const m=F();if(m&&!s)throw m;return _()}}});let Kt=p;return k?It(()=>(Kt=p,St(!1))):St(!1),[xt,{refetch:m=>cn(Kt,()=>St(m)),mutate:I}]}function ne(t){return A(t,!1)}function y(t){if(!J&&g===null)return t();const n=g;g=null;try{return J?J.untrack(t):t()}finally{g=n}}function ee(t,n,e){const r=Array.isArray(t);let o,i=e&&e.defer;return s=>{let a;if(r){a=Array(t.length);for(let f=0;f<t.length;f++)a[f]=t[f]()}else a=t();if(i)return i=!1,s;const c=y(()=>n(a,o,s));return o=a,c}}function re(t){an(()=>y(t))}function tt(t){return p===null||(p.cleanups===null?p.cleanups=[t]:p.cleanups.push(t)),t}function oe(t,n){X||(X=Symbol("error")),p=et(void 0,void 0,!0),p.context={...p.context,[X]:[n]},u&&u.running&&u.sources.add(p);try{return t()}catch(e){ot(e)}finally{p=p.owner}}function Dt(){return g}function ie(){return p}function cn(t,n){const e=p,r=g;p=t,g=null;try{return A(n,!0)}catch(o){ot(o)}finally{p=e,g=r}}function se(t){if(u&&u.running)return t(),u.done;const n=g,e=p;return Promise.resolve().then(()=>{g=n,p=e;let r;return(U||nt)&&(r=u||(u={sources:new Set,effects:[],promises:new Set,disposed:new Set,queue:new Set,running:!0}),r.done||(r.done=new Promise(o=>r.resolve=o)),r.running=!0),A(t,!1),g=p=null,r?r.done:void 0})}const[Ke,un]=z(!1);function ae(t,n){const e=Symbol("context");return{id:e,Provider:de(e),defaultValue:t}}function Mt(t){let n;return p&&p.context&&(n=p.context[t.id])!==void 0?n:t.defaultValue}function Tt(t){const n=O(t),e=O(()=>Ft(n()));return e.toArray=()=>{const r=e();return Array.isArray(r)?r:r!=null?[r]:[]},e}let nt;function ln(){const t=u&&u.running;if(this.sources&&(t?this.tState:this.state))if((t?this.tState:this.state)===P)W(this);else{const n=v;v=null,A(()=>pt(this),!1),v=n}if(g){const n=this.observers;if(!n||n[n.length-1]!==g){const e=n?n.length:0;g.sources?(g.sources.push(this),g.sourceSlots.push(e)):(g.sources=[this],g.sourceSlots=[e]),n?(n.push(g),this.observerSlots.push(g.sources.length-1)):(this.observers=[g],this.observerSlots=[g.sources.length-1])}}return t&&u.sources.has(this)?this.tValue:this.value}function dn(t,n,e){let r=u&&u.running&&u.sources.has(t)?t.tValue:t.value;if(!t.comparator||!t.comparator(r,n)){if(u){const o=u.running;(o||!e&&u.sources.has(t))&&(u.sources.add(t),t.tValue=n),o||(t.value=n)}else t.value=n;t.observers&&t.observers.length&&A(()=>{for(let o=0;o<t.observers.length;o+=1){const i=t.observers[o],s=u&&u.running;s&&u.disposed.has(i)||((s?!i.tState:!i.state)&&(i.pure?v.push(i):x.push(i),i.observers&&gn(i)),s?i.tState=P:i.state=P)}if(v.length>1e6)throw v=[],new Error},!1)}return n}function W(t){if(!t.fn)return;H(t);const n=ft;fn(t,u&&u.running&&u.sources.has(t)?t.tValue:t.value,n),u&&!u.running&&u.sources.has(t)&&queueMicrotask(()=>{A(()=>{u&&(u.running=!0),g=p=t,fn(t,t.tValue,n),g=p=null},!1)})}function fn(t,n,e){let r;const o=p,i=g;g=p=t;try{r=t.fn(n)}catch(s){return t.pure&&(u&&u.running?(t.tState=P,t.tOwned&&t.tOwned.forEach(H),t.tOwned=void 0):(t.state=P,t.owned&&t.owned.forEach(H),t.owned=null)),t.updatedAt=e+1,ot(s)}finally{g=i,p=o}(!t.updatedAt||t.updatedAt<=e)&&(t.updatedAt!=null&&"observers"in t?dn(t,r,!0):u&&u.running&&t.pure?(u.sources.has(t)||(t.value=r),u.sources.add(t),t.tValue=r):t.value=r,t.updatedAt=e)}function et(t,n,e,r=P,o){const i={fn:t,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:n,owner:p,context:p?p.context:null,pure:e};if(u&&u.running&&(i.state=0,i.tState=r),p===null||p!==on&&(u&&u.running&&p.pure?p.tOwned?p.tOwned.push(i):p.tOwned=[i]:p.owned?p.owned.push(i):p.owned=[i]),J&&i.fn){const s=i.fn,[a,c]=z(void 0,{equals:!1}),f=J.factory(s,c);tt(()=>f.dispose());let d;const l=()=>se(c).then(()=>{d&&(d.dispose(),d=void 0)});i.fn=k=>(a(),u&&u.running?(d||(d=J.factory(s,l)),d.track(k)):f.track(k))}return i}function rt(t){const n=u&&u.running;if((n?t.tState:t.state)===0)return;if((n?t.tState:t.state)===Y)return pt(t);if(t.suspense&&y(t.suspense.inFallback))return t.suspense.effects.push(t);const e=[t];for(;(t=t.owner)&&(!t.updatedAt||t.updatedAt<ft);){if(n&&u.disposed.has(t))return;(n?t.tState:t.state)&&e.push(t)}for(let r=e.length-1;r>=0;r--){if(t=e[r],n){let o=t,i=e[r+1];for(;(o=o.owner)&&o!==i;)if(u.disposed.has(o))return}if((n?t.tState:t.state)===P)W(t);else if((n?t.tState:t.state)===Y){const o=v;v=null,A(()=>pt(t,e[0]),!1),v=o}}}function A(t,n){if(v)return t();let e=!1;n||(v=[]),x?e=!0:x=[],ft++;try{const r=t();return ce(e),r}catch(r){e||(x=null),v=null,ot(r)}}function ce(t){if(v&&(U&&u&&u.running?ue(v):pn(v),v=null),t)return;let n;if(u){if(!u.promises.size&&!u.queue.size){const r=u.sources,o=u.disposed;x.push.apply(x,u.effects),n=u.resolve;for(const i of x)"tState"in i&&(i.state=i.tState),delete i.tState;u=null,A(()=>{for(const i of o)H(i);for(const i of r){if(i.value=i.tValue,i.owned)for(let s=0,a=i.owned.length;s<a;s++)H(i.owned[s]);i.tOwned&&(i.owned=i.tOwned),delete i.tValue,delete i.tOwned,i.tState=0}un(!1)},!1)}else if(u.running){u.running=!1,u.effects.push.apply(u.effects,x),x=null,un(!0);return}}const e=x;x=null,e.length&&A(()=>rn(e),!1),n&&n()}function pn(t){for(let n=0;n<t.length;n++)rt(t[n])}function ue(t){for(let n=0;n<t.length;n++){const e=t[n],r=u.queue;r.has(e)||(r.add(e),U(()=>{r.delete(e),A(()=>{u.running=!0,rt(e)},!1),u&&(u.running=!1)}))}}function le(t){let n,e=0;for(n=0;n<t.length;n++){const r=t[n];r.user?t[e++]=r:rt(r)}if(h.context){if(h.count){h.effects||(h.effects=[]),h.effects.push(...t.slice(0,e));return}zt()}for(h.effects&&(h.done||!h.count)&&(t=[...h.effects,...t],e+=h.effects.length,delete h.effects),n=0;n<e;n++)rt(t[n])}function pt(t,n){const e=u&&u.running;e?t.tState=0:t.state=0;for(let r=0;r<t.sources.length;r+=1){const o=t.sources[r];if(o.sources){const i=e?o.tState:o.state;i===P?o!==n&&(!o.updatedAt||o.updatedAt<ft)&&rt(o):i===Y&&pt(o,n)}}}function gn(t){const n=u&&u.running;for(let e=0;e<t.observers.length;e+=1){const r=t.observers[e];(n?!r.tState:!r.state)&&(n?r.tState=Y:r.state=Y,r.pure?v.push(r):x.push(r),r.observers&&gn(r))}}function H(t){let n;if(t.sources)for(;t.sources.length;){const e=t.sources.pop(),r=t.sourceSlots.pop(),o=e.observers;if(o&&o.length){const i=o.pop(),s=e.observerSlots.pop();r<o.length&&(i.sourceSlots[s]=r,o[r]=i,e.observerSlots[r]=s)}}if(t.tOwned){for(n=t.tOwned.length-1;n>=0;n--)H(t.tOwned[n]);delete t.tOwned}if(u&&u.running&&t.pure)hn(t,!0);else if(t.owned){for(n=t.owned.length-1;n>=0;n--)H(t.owned[n]);t.owned=null}if(t.cleanups){for(n=t.cleanups.length-1;n>=0;n--)t.cleanups[n]();t.cleanups=null}u&&u.running?t.tState=0:t.state=0}function hn(t,n){if(n||(t.tState=0,u.disposed.add(t)),t.owned)for(let e=0;e<t.owned.length;e++)hn(t.owned[e])}function gt(t){return t instanceof Error?t:new Error(typeof t=="string"?t:"Unknown error",{cause:t})}function kn(t,n,e){try{for(const r of n)r(t)}catch(r){ot(r,e&&e.owner||null)}}function ot(t,n=p){const e=X&&n&&n.context&&n.context[X],r=gt(t);if(!e)throw r;x?x.push({fn(){kn(r,e,n)},state:P}):kn(r,e,n)}function Ft(t){if(typeof t=="function"&&!t.length)return Ft(t());if(Array.isArray(t)){const n=[];for(let e=0;e<t.length;e++){const r=Ft(t[e]);if(Array.isArray(r))if(r.length<32768)n.push.apply(n,r);else for(let o=0;o<r.length;o++)n.push(r[o]);else n.push(r)}return n}return t}function de(t,n){return function(e){let r;return sn(()=>r=y(()=>(p.context={...p.context,[t]:e.value},Tt(()=>e.children))),void 0),r}}const Ht=Symbol("fallback");function ht(t){for(let n=0;n<t.length;n++)t[n]()}function fe(t,n,e={}){let r=[],o=[],i=[],s=0,a=n.length>1?[]:null;return tt(()=>ht(i)),()=>{let c=t()||[],f=c.length,d,l;return c[Q],y(()=>{let w,_,I,F,K,C,q,E,M;if(f===0)s!==0&&(ht(i),i=[],r=[],o=[],s=0,a&&(a=[])),e.fallback&&(r=[Ht],o[0]=N(T=>(i[0]=T,e.fallback())),s=1);else if(s===0){for(o=new Array(f),l=0;l<f;l++)r[l]=c[l],o[l]=N(k);s=f}else{for(I=new Array(f),F=new Array(f),a&&(K=new Array(f)),C=0,q=Math.min(s,f);C<q&&r[C]===c[C];C++);for(q=s-1,E=f-1;q>=C&&E>=C&&r[q]===c[E];q--,E--)I[E]=o[q],F[E]=i[q],a&&(K[E]=a[q]);for(w=new Map,_=new Array(E+1),l=E;l>=C;l--)M=c[l],d=w.get(M),_[l]=d===void 0?-1:d,w.set(M,l);for(d=C;d<=q;d++)M=r[d],l=w.get(M),l!==void 0&&l!==-1?(I[l]=o[d],F[l]=i[d],a&&(K[l]=a[d]),l=_[l],w.set(M,l)):i[d]();for(l=C;l<f;l++)l in I?(o[l]=I[l],i[l]=F[l],a&&(a[l]=K[l],a[l](l))):o[l]=N(k);o=o.slice(0,s=f),r=c.slice(0)}return o});function k(w){if(i[l]=w,a){const[_,I]=z(l);return a[l]=I,n(c[l],_)}return n(c[l])}}}function pe(t,n,e={}){let r=[],o=[],i=[],s=[],a=0,c;return tt(()=>ht(i)),()=>{const f=t()||[],d=f.length;return f[Q],y(()=>{if(d===0)return a!==0&&(ht(i),i=[],r=[],o=[],a=0,s=[]),e.fallback&&(r=[Ht],o[0]=N(k=>(i[0]=k,e.fallback())),a=1),o;for(r[0]===Ht&&(i[0](),i=[],r=[],o=[],a=0),c=0;c<d;c++)c<r.length&&r[c]!==f[c]?s[c](()=>f[c]):c>=r.length&&(o[c]=N(l));for(;c<r.length;c++)i[c]();return a=s.length=i.length=d,r=f.slice(0),o=o.slice(0,a)});function l(k){i[c]=k;const[w,_]=z(f[c]);return s[c]=_,n(w,c)}}}let mn=!1;function ge(){mn=!0}function he(t,n){if(mn&&h.context){const e=h.context;zt(Qn());const r=y(()=>t(n||{}));return zt(e),r}return y(()=>t(n||{}))}function kt(){return!0}const Nt={get(t,n,e){return n===V?e:t.get(n)},has(t,n){return n===V?!0:t.has(n)},set:kt,deleteProperty:kt,getOwnPropertyDescriptor(t,n){return{configurable:!0,enumerable:!0,get(){return t.get(n)},set:kt,deleteProperty:kt}},ownKeys(t){return t.keys()}};function Rt(t){return(t=typeof t=="function"?t():t)?t:{}}function ke(){for(let t=0,n=this.length;t<n;++t){const e=this[t]();if(e!==void 0)return e}}function me(...t){let n=!1;for(let s=0;s<t.length;s++){const a=t[s];n=n||!!a&&V in a,t[s]=typeof a=="function"?(n=!0,O(a)):a}if(en&&n)return new Proxy({get(s){for(let a=t.length-1;a>=0;a--){const c=Rt(t[a])[s];if(c!==void 0)return c}},has(s){for(let a=t.length-1;a>=0;a--)if(s in Rt(t[a]))return!0;return!1},keys(){const s=[];for(let a=0;a<t.length;a++)s.push(...Object.keys(Rt(t[a])));return[...new Set(s)]}},Nt);const e={},r=Object.create(null);for(let s=t.length-1;s>=0;s--){const a=t[s];if(!a)continue;const c=Object.getOwnPropertyNames(a);for(let f=c.length-1;f>=0;f--){const d=c[f];if(d==="__proto__"||d==="constructor")continue;const l=Object.getOwnPropertyDescriptor(a,d);if(!r[d])r[d]=l.get?{enumerable:!0,configurable:!0,get:ke.bind(e[d]=[l.get.bind(a)])}:l.value!==void 0?l:void 0;else{const k=e[d];k&&(l.get?k.push(l.get.bind(a)):l.value!==void 0&&k.push(()=>l.value))}}}const o={},i=Object.keys(r);for(let s=i.length-1;s>=0;s--){const a=i[s],c=r[a];c&&c.get?Object.defineProperty(o,a,c):o[a]=c?c.value:void 0}return o}function be(t,...n){const e=n.length;if(en&&V in t){const o=e>1?n.flat():n[0],i=n.map(s=>new Proxy({get(a){return s.includes(a)?t[a]:void 0},has(a){return s.includes(a)&&a in t},keys(){return s.filter(a=>a in t)}},Nt));return i.push(new Proxy({get(s){return o.includes(s)?void 0:t[s]},has(s){return o.includes(s)?!1:s in t},keys(){return Object.keys(t).filter(s=>!o.includes(s))}},Nt)),i}const r=[];for(let o=0;o<=e;o++)r[o]={};for(const o of Object.getOwnPropertyNames(t)){let i=e;for(let a=0;a<n.length;a++)if(n[a].includes(o)){i=a;break}const s=Object.getOwnPropertyDescriptor(t,o);!s.get&&!s.set&&s.enumerable&&s.writable&&s.configurable?r[i][o]=s.value:Object.defineProperty(r[i],o,s)}return r}let ve=0;function ye(){return h.context?h.getNextContextId():`cl-${ve++}`}const bn=t=>`Stale read from <${t}>.`;function we(t){const n="fallback"in t&&{fallback:()=>t.fallback};return O(fe(()=>t.each,t.children,n||void 0))}function xe(t){const n="fallback"in t&&{fallback:()=>t.fallback};return O(pe(()=>t.each,t.children,n||void 0))}function Se(t){const n=t.keyed,e=O(()=>t.when,void 0,void 0),r=n?e:O(e,void 0,{equals:(o,i)=>!o==!i});return O(()=>{const o=r();if(o){const i=t.children;return typeof i=="function"&&i.length>0?y(()=>i(n?o:()=>{if(!y(r))throw bn("Show");return e()})):i}return t.fallback},void 0,void 0)}function Oe(t){const n=Tt(()=>t.children),e=O(()=>{const r=n(),o=Array.isArray(r)?r:[r];let i=()=>{};for(let s=0;s<o.length;s++){const a=s,c=o[s],f=i,d=O(()=>f()?void 0:c.when,void 0,void 0),l=c.keyed?d:O(d,void 0,{equals:(k,w)=>!k==!w});i=()=>f()||(l()?[a,d,c]:void 0)}return i});return O(()=>{const r=e()();if(!r)return t.fallback;const[o,i,s]=r,a=s.children;return typeof a=="function"&&a.length>0?y(()=>a(s.keyed?i():()=>{var c;if(((c=y(e)())==null?void 0:c[0])!==o)throw bn("Match");return i()})):a},void 0,void 0)}function Ae(t){return t}let mt;function je(t){let n;h.context&&h.load&&(n=h.load(h.getContextId()));const[e,r]=z(n,void 0);return mt||(mt=new Set),mt.add(r),tt(()=>mt.delete(r)),O(()=>{let o;if(o=e()){const i=t.fallback;return typeof i=="function"&&i.length?y(()=>i(o,()=>r())):i}return oe(()=>t.children,r)},void 0,void 0)}const bt=Symbol("store-raw"),R=Symbol("store-node"),D=Symbol("store-has"),vn=Symbol("store-self");function yn(t){let n=t[V];if(!n&&(Object.defineProperty(t,V,{value:n=new Proxy(t,Ce)}),!Array.isArray(t))){const e=Object.keys(t),r=Object.getOwnPropertyDescriptors(t),o=Object.getPrototypeOf(t),i=o!==null&&t!==null&&typeof t=="object"&&!Array.isArray(t)&&o!==Object.prototype;if(i){const s=Object.getOwnPropertyDescriptors(o);e.push(...Object.keys(s)),Object.assign(r,s)}for(let s=0,a=e.length;s<a;s++){const c=e[s];i&&c==="constructor"||r[c].get&&Object.defineProperty(t,c,{configurable:!0,enumerable:r[c].enumerable,get:r[c].get.bind(n)})}}return n}function B(t){let n;return t!=null&&typeof t=="object"&&(t[V]||!(n=Object.getPrototypeOf(t))||n===Object.prototype||Array.isArray(t))}function L(t,n=new Set){let e,r,o,i;if(e=t!=null&&t[bt])return e;if(!B(t)||n.has(t))return t;if(Array.isArray(t)){Object.isFrozen(t)?t=t.slice(0):n.add(t);for(let s=0,a=t.length;s<a;s++)o=t[s],(r=L(o,n))!==o&&(t[s]=r)}else{Object.isFrozen(t)?t=Object.assign({},t):n.add(t);const s=Object.keys(t),a=Object.getOwnPropertyDescriptors(t);for(let c=0,f=s.length;c<f;c++)i=s[c],!a[i].get&&(o=t[i],(r=L(o,n))!==o&&(t[i]=r))}return t}function vt(t,n){let e=t[n];return e||Object.defineProperty(t,n,{value:e=Object.create(null)}),e}function it(t,n,e){if(t[n])return t[n];const[r,o]=z(e,{equals:!1,internal:!0});return r.$=o,t[n]=r}function Pe(t,n){const e=Reflect.getOwnPropertyDescriptor(t,n);return!e||e.get||!e.configurable||n===V||n===R||(delete e.value,delete e.writable,e.get=()=>t[V][n]),e}function wn(t){Dt()&&it(vt(t,R),vn)()}function _e(t){return wn(t),Reflect.ownKeys(t)}const Ce={get(t,n,e){if(n===bt)return t;if(n===V)return e;if(n===Q)return wn(t),e;const r=vt(t,R),o=r[n];let i=o?o():t[n];if(n===R||n===D||n==="__proto__")return i;if(!o){const s=Object.getOwnPropertyDescriptor(t,n);Dt()&&(typeof i!="function"||t.hasOwnProperty(n))&&!(s&&s.get)&&(i=it(r,n,i)())}return B(i)?yn(i):i},has(t,n){return n===bt||n===V||n===Q||n===R||n===D||n==="__proto__"?!0:(Dt()&&it(vt(t,D),n)(),n in t)},set(){return!0},deleteProperty(){return!0},ownKeys:_e,getOwnPropertyDescriptor:Pe};function G(t,n,e,r=!1){if(n==="__proto__"||!r&&t[n]===e)return;const o=t[n],i=t.length;e===void 0?(delete t[n],t[D]&&t[D][n]&&o!==void 0&&t[D][n].$()):(t[n]=e,t[D]&&t[D][n]&&o===void 0&&t[D][n].$());let s=vt(t,R),a;if((a=it(s,n,o))&&a.$(()=>e),Array.isArray(t)&&t.length!==i){for(let c=t.length;c<i;c++)(a=s[c])&&a.$();(a=it(s,"length",i))&&a.$(t.length)}(a=s[vn])&&a.$()}function xn(t,n){const e=Object.keys(n);for(let r=0;r<e.length;r+=1){const o=e[r];Sn(o)||G(t,o,n[o])}}function Sn(t){return t==="__proto__"||t==="constructor"||t==="prototype"}function qe(t,n){if(typeof n=="function"&&(n=n(t)),n=L(n),Array.isArray(n)){if(t===n)return;let e=0,r=n.length;for(;e<r;e++){const o=n[e];t[e]!==o&&G(t,e,o)}G(t,"length",r)}else xn(t,n)}function st(t,n,e=[]){let r,o=t;if(n.length>1){r=n.shift();const s=typeof r,a=Array.isArray(t);if(s==="string"&&(r==="__proto__"||n.length>1&&Sn(r)))return;if(Array.isArray(r)){for(let c=0;c<r.length;c++)st(t,[r[c]].concat(n),e);return}else if(a&&s==="function"){for(let c=0;c<t.length;c++)r(t[c],c)&&st(t,[c].concat(n),e);return}else if(a&&s==="object"){const{from:c=0,to:f=t.length-1,by:d=1}=r;for(let l=c;l<=f;l+=d)st(t,[l].concat(n),e);return}else if(n.length>1){st(t[r],n,[r].concat(e));return}o=t[r],e=[r].concat(e)}let i=n[0];typeof i=="function"&&(i=i(o,e),i===o)||r===void 0&&i==null||(i=L(i),r===void 0||B(o)&&B(i)&&!Array.isArray(i)?xn(o,i):G(t,r,i))}function On(...[t,n]){const e=L(t||{}),r=Array.isArray(e),o=yn(e);function i(...s){ne(()=>{r&&s.length===1?qe(e,s[0]):st(e,s)})}return[o,i]}const Ue=Symbol("store-root"),yt=new WeakMap,An={get(t,n){if(n===bt)return t;const e=t[n];if(n===V||n===Q||n===R||n===D||n==="__proto__")return e;let r;return B(e)?yt.get(e)||(yt.set(e,r=new Proxy(e,An)),r):e},set(t,n,e){return G(t,n,L(e)),!0},deleteProperty(t,n){return G(t,n,void 0,!0),!0}};function jn(t){return n=>{if(B(n)){let e;(e=yt.get(n))||yt.set(n,e=new Proxy(n,An)),t(e)}return n}}let j={};function Pn(t){j.stack&&t.setAttribute("stack",j.stack),j.position&&t.setAttribute("position",j.position),j.max!==void 0&&t.setAttribute("max",String(j.max)),j.appearance&&t.setAttribute("appearance",j.appearance),j.inverse!==void 0&&(j.inverse?t.setAttribute("inverse",""):t.removeAttribute("inverse"))}function Ee(t){j={...j,...t},!(typeof document>"u")&&document.querySelectorAll("kai-toast-region").forEach(n=>Pn(n))}const Ve=5e3,ze=7e3,{toasts:wt,setToasts:at,mounted:Je,setMounted:_n}=N(()=>{const[t,n]=On([]),[e,r]=z(!1);return{toasts:t,setToasts:n,mounted:e,setMounted:r}});let Cn=0;function $e(){return Cn+=1,`toast-${Cn}`}function Ie(t){const n=t.duration??Ve;return n===0?0:t.action?Math.max(n,ze):n}const ct=new Map;let qn=!1;function De(t){return t.target??null}function Me(t=null){if(typeof document>"u")return;const n=ct.get(t);if(n&&n.isConnected)return n;n&&ct.delete(t);const e=new Set(ct.values()),r=Array.from(document.querySelectorAll("kai-toast-region")).filter(s=>s.isConnected&&!e.has(s)&&De(s)===t);r.length>1&&!qn&&(qn=!0,console.warn(`[kitn] toast(): ${r.length} candidate <kai-toast-region> elements are in the document; adopting the first in document order. Keep one region per target so the imperative toast() API has an unambiguous home.`));const o=r[0];if(o)return o.toasts=wt,ct.set(t,o),_n(!0),o;const i=document.createElement("kai-toast-region");return document.body.appendChild(i),i.toasts=wt,t&&(i.target=t),Pn(i),ct.set(t,i),_n(!0),i}function Te(t){const n=wt.findIndex(e=>e.id===t.id);n>=0?at(n,t):at(jn(e=>{e.push(t)}))}function En(t){at(n=>n.filter(e=>e.id!==t))}function Fe(t){return{id:t,dismiss:()=>En(t),update:n=>{const e=wt.findIndex(r=>r.id===t);e>=0&&at(e,r=>({...r,...n}))}}}function ut(t,n,e){Me(n?.target??null);const r=n?.id??$e(),o={id:r,message:t,variant:n?.variant??e,appearance:n?.appearance??j.appearance??"pill",inverse:n?.inverse??j.inverse??!1,description:n?.description,action:n?.action,duration:n?.duration,dismissible:n?.dismissible,target:n?.target};return Te(o),Fe(r)}const He=Object.assign((t,n)=>ut(t,n,"neutral"),{success:(t,n)=>ut(t,n,"success"),warning:(t,n)=>ut(t,n,"warning"),error:(t,n)=>ut(t,n,"error"),info:(t,n)=>ut(t,n,"info"),dismiss:En,clear:()=>at([])}),Ne=typeof window<"u"&&typeof customElements<"u"?import("./register-impl-B1hLkrI8.js").then(t=>t.r):Promise.resolve();export{On as A,jn as B,L as C,It as D,je as E,we as F,Tt as G,Ie as H,xe as I,Ae as M,Se as S,Ln as a,N as b,O as c,Nn as classifyTool,Fn as configureCodeHighlighting,Ee as configureToasts,sn as d,h as e,Ne as elementsReady,Zn as emitElementRegistry,ge as f,ie as g,an as h,z as i,Hn as isCodeHighlightingEnabled,be as j,ae as k,he as l,Mt as m,Bn as n,tt as o,Gn as p,me as q,cn as r,Rn as s,ye as t,He as toast,y as u,re as v,ee as w,te as x,Tn as y,Oe as z};
1
+ const Vn={bash:()=>import("./bash-InADTalH.js"),javascript:()=>import("./javascript-C25yR2R2.js"),typescript:()=>import("./typescript-RycA9KXf.js"),tsx:()=>import("./tsx-B8rCNbgL.js"),html:()=>import("./html-CPZ3oZQ7.js"),css:()=>import("./css-M7EaDHN_.js"),json:()=>import("./json-DxJze_jm.js"),vue:()=>import("./vue-BmIZj4XD.js"),svelte:()=>import("./svelte--5p79yCD.js")},zn={"github-dark-dimmed":()=>import("./github-dark-dimmed-DUshB20C.js"),"github-light":()=>import("./github-light-JYsPkUQd.js")},$n={js:"javascript",ts:"typescript",jsx:"tsx",sh:"bash",shell:"bash"},Ut="github-dark-dimmed";let Ot=!0,At={...Vn},jt={...zn},Pt={...$n},_t=null;const Jt=new Set,Wt=new Set;function In(){return _t||(_t=(async()=>{const[{createHighlighterCore:t},{createJavaScriptRegexEngine:n}]=await Promise.all([import("./core-C8fzo39E.js"),import("./engine-javascript-C1x7zo1_.js")]);return t({themes:[],langs:[],engine:n()})})()),_t}function Bt(t){return Pt[t]??t}async function Dn(t,n){const e=Bt(n);if(Jt.has(e))return!0;const r=At[e];return r?(await t.loadLanguage(r()),Jt.add(e),!0):!1}async function Gt(t,n){if(Wt.has(n))return!0;const e=jt[n];return e?(await t.loadTheme(e()),Wt.add(n),!0):!1}function Mn(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function lt(t){return`<pre><code>${Mn(t)}</code></pre>`}async function Tn(t,n,e){if(!Ot||!t)return lt(t);try{const r=await In();if(!await Dn(r,n))return lt(t);const o=await Gt(r,e)?e:await Gt(r,Ut)?Ut:null;return o?r.codeToHtml(t,{lang:Bt(n),theme:o}):lt(t)}catch{return lt(t)}}function Fn(t){t.enabled!==void 0&&(Ot=t.enabled),t.languages&&(At={...At,...t.languages}),t.themes&&(jt={...jt,...t.themes}),t.aliases&&(Pt={...Pt,...t.aliases})}function Hn(){return Ot}function Nn(t){const n=t.toLowerCase();return n?n.includes("bash")||n.includes("command")||n.includes("shell")||n.includes("terminal")||n.includes("exec")?"command":n.includes("edit")||n.includes("write")||n.includes("patch")||n.includes("replace")||n.includes("delete")?"file-change":n.includes("search")||n.includes("grep")||n.includes("glob")||n.includes("find")?"search":n.includes("fetch")||n.includes("http")||n.includes("browse")||n.includes("crawl")?"fetch":n.includes("mcp")?"mcp":n.includes("image")||n.includes("screenshot")||n.includes("vision")?"image":"generic":"generic"}const Ct=Symbol.for("kai.wire.diagnostics.v1");function qt(){return globalThis[Ct]}function Zt(){const t=globalThis;return t[Ct]??(t[Ct]={subs:[],seq:0,payload:!1})}function Rn(t){const n=Zt().subs;n.push(t);let e=!0;return()=>{if(!e)return;e=!1;const r=n.indexOf(t);r!==-1&&n.splice(r,1)}}function Et(){const t=qt();return t!==void 0&&t.subs.length>0}function Ln(t){!t&&qt()===void 0||(Zt().payload=t)}function Qt(t){const n=qt();if(n)for(const e of[...n.subs])try{e(t)}catch{}}const Kn={"kai-agent-card":["status"],"kai-artifact":["files"],"kai-attachments":["items"],"kai-audio-visualizer":["audioElement","bands","shader","stream"],"kai-cards":["cards","policy","schemas","types"],"kai-chain-of-thought":["defaultValue","steps","value"],"kai-chat":["cardSchemas","cardTypes","context","home","kindIcons","messages","models","store","suggestions","triggers","value"],"kai-checkbox-group":["options"],"kai-choice":["data","resolution"],"kai-command":["items"],"kai-compare":["data","selection"],"kai-composer":["highlights","kindIcons","triggers","value"],"kai-confirm":["data","resolution"],"kai-context":["context"],"kai-conversations":["conversations","groups"],"kai-embed":["data"],"kai-feedback-bar":["categories"],"kai-file-tree":["defaultExpanded","files"],"kai-form":["data","defaultValues","resolution","values"],"kai-image":["bytes"],"kai-link-preview":["data"],"kai-menu":["items"],"kai-message":["cardSchemas","cardTypes","message"],"kai-model-switcher":["models"],"kai-nav":["defaultCollapsed","items"],"kai-pane":["status"],"kai-pane-grid":["maximizedIndex"],"kai-pane-group":["tabs"],"kai-prompt-input":["attachments","kindIcons","suggestions","triggers","value"],"kai-radio-group":["options"],"kai-remote":["envelope","policy"],"kai-resizable":["maximizedIndex"],"kai-response-stream":["text"],"kai-scope-picker":["availableAuthors","availableTags"],"kai-segmented":["options"],"kai-select":["options"],"kai-skills":["skills"],"kai-slider":["valueLabel"],"kai-sources":["sources"],"kai-suggestions":["suggestions"],"kai-tabs":["items"],"kai-tasks":["data","defaultValue","resolution","value"],"kai-thread":["cardSchemas","cardTypes","messages"],"kai-toast-region":["target","toasts"],"kai-tool":["tool"],"kai-voice-input":["transcribe"],"kai-voice-output":["synthesize"]},Un={"kai-conversations":"conversation-list","kai-conversation-item":"conversation-item","kai-prompt-input":"prompt-input","kai-chat":"chat","kai-workspace":"chat-workspace","kai-thread":"thread","kai-thinking-bar":"thinking-bar","kai-model-switcher":"model-switcher","kai-attachments":"attachments","kai-message":"message","kai-markdown":"markdown","kai-code-block":"code-block","kai-reasoning":"reasoning","kai-tool":"tool","kai-context":"context-meter","kai-feedback-bar":"feedback-bar","kai-scope-picker":"chat-scope-picker","kai-suggestions":"prompt-suggestions","kai-file-upload":"file-upload","kai-voice-input":"voice-input","kai-audio-visualizer":"audio-visualizer","kai-loader":"loader","kai-text-shimmer":"text-shimmer","kai-image":"image","kai-checkpoint":"checkpoint","kai-skills":"message-skills","kai-source":"source","kai-sources":"source","kai-response-stream":"response-stream","kai-empty":"empty","kai-status":"status","kai-nav":"nav","kai-progress-bar":"progress-bar","kai-coachmark":"coachmark","kai-tabs":"tabs","kai-voice-output":"voice-output","kai-screen":"screen","kai-chain-of-thought":"chain-of-thought","kai-resizable":"resizable","kai-resizable-item":"resizable","kai-file-tree":"file-tree","kai-artifact":"artifact","kai-scroll-button":"scroll-button","kai-popover":"popover","kai-switch":"switch","kai-checkbox":"checkbox","kai-checkbox-group":"checkbox-group","kai-radio-group":"radio-group","kai-slider":"slider","kai-select":"select","kai-button":"button","kai-avatar":"avatar","kai-badge":"badge","kai-tooltip":"tooltip","kai-notice":"notice","kai-icon":"icon","kai-separator":"separator","kai-scroll-area":"scroll-area","kai-hover-card":"hover-card","kai-skeleton":"skeleton","kai-toast-region":"toast","kai-card":"card","kai-form":"form","kai-link-preview":"link-preview","kai-embed":"embed","kai-confirm":"confirm-card","kai-tasks":"tasks","kai-choice":"choice","kai-cards":"cards","kai-compare":"compare","kai-composer":"composer","kai-menu":"menu","kai-dropdown":"dropdown","kai-command":"command","kai-prompt-dock":"prompt-dock","kai-segmented":"segmented","kai-settings-group":"settings-group","kai-setting-item":"setting-item","kai-pane":"pane","kai-pane-group":"pane-group","kai-pane-grid":"pane-grid","kai-agent-card":"agent-card","kai-dialog":"dialog","kai-dock":"dock","kai-input":"input","kai-search":"search","kai-kbd":"kbd","kai-editable-label":"editable-label"},Xt=Kn;function Jn(t){return t.replace(/\.?([A-Z]+)/g,(n,e)=>"-"+e.toLowerCase()).replace("_","-").replace(/^-/,"")}function Wn(t){if(t==="")return"empty-attribute";if(t==="[object Object]")return"[object Object]";if(t.includes(",")){const n=t.split(",");if(n.every(e=>e==="[object Object]"))return`[object Object] x ${n.length}`}try{const n=JSON.parse(t);return n!==null&&typeof n=="object"?void 0:n===null?"json:null":`json:${typeof n}`}catch{return`string(len=${t.length})`}}function Vt(t,n,e,r){const o={type:"element.violation",t:Date.now(),kind:t,tag:n,prop:e,...r};Qt(o)}const Yt=Symbol.for("kai.element.diagnostics.installed.v1");function Bn(t){const n=Xt[t];return n!==void 0&&n.length>0}function Gn(t,n){const e=Xt[t];if(!e||e.length===0)return;const r=n;if(r[Yt])return;r[Yt]=!0;const o=n,i=new Map;for(const c of e)i.set(Jn(c),c);const s=o.attributeChangedCallback;o.attributeChangedCallback=function(c,f,d){if(d!==null&&Et())try{const l=i.get(c);if(l!==void 0){const k=Wn(d);k!==void 0&&Vt("array-prop-as-attribute",t,l,{valuePreview:k})}}catch{}s?.call(this,c,f,d)};const a=o.connectedCallback;o.connectedCallback=function(){var c;a?.call(this);try{(c=this.addPropertyChangedCallback)==null||c.call(this,(f,d,l)=>{if(Et())try{if(!Array.isArray(d))return;if(d===l){Vt("same-array-reference",t,f,{length:d.length});return}if(!Array.isArray(l)||d.length===0||l.length!==d.length)return;for(let k=0;k<d.length;k++)if(d[k]!==l[k])return;Vt("mutated-in-place",t,f,{length:d.length})}catch{}})}catch{}}}const tn=Object.keys(Un);function Zn(){if(typeof customElements>"u"||!Et())return;const t=[],n=[];for(const r of tn)(customElements.get(r)?t:n).push(r);const e={type:"element.registry",t:Date.now(),defined:t,notDefined:n,total:tn.length};return Qt(e),e}const h={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return nn(this.context.count)},getNextContextId(){return nn(this.context.count++)}};function nn(t){const n=String(t),e=n.length-1;return h.context.id+(e?String.fromCharCode(96+e):"")+n}function zt(t){h.context=t}function Qn(){return{...h.context,id:h.getNextContextId(),count:0}}const Re=!1,Xn=(t,n)=>t===n,V=Symbol("solid-proxy"),en=typeof Proxy=="function",Q=Symbol("solid-track"),Le=Symbol("solid-dev-component"),dt={equals:Xn};let X=null,rn=pn;const P=1,Y=2,on={owned:null,cleanups:null,context:null,owner:null},$t={};var p=null;let u=null,U=null,J=null,g=null,v=null,x=null,ft=0;function N(t,n){const e=g,r=p,o=t.length===0,i=n===void 0?r:n,s=o?on:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?t:()=>t(()=>y(()=>H(s)));p=s,g=null;try{return A(a,!0)}finally{g=e,p=r}}function z(t,n){n=n?Object.assign({},dt,n):dt;const e={value:t,observers:null,observerSlots:null,comparator:n.equals||void 0},r=o=>(typeof o=="function"&&(u&&u.running&&u.sources.has(e)?o=o(e.tValue):o=o(e.value)),dn(e,o));return[ln.bind(e),r]}function It(t,n,e){const r=et(t,n,!0,P);U&&u&&u.running?v.push(r):W(r)}function sn(t,n,e){const r=et(t,n,!1,P);U&&u&&u.running?v.push(r):W(r)}function an(t,n,e){rn=le;const r=et(t,n,!1,P),o=nt&&Mt(nt);o&&(r.suspense=o),(!e||!e.render)&&(r.user=!0),x?x.push(r):W(r)}function O(t,n,e){e=e?Object.assign({},dt,e):dt;const r=et(t,n,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=e.equals||void 0,U&&u&&u.running?(r.tState=P,v.push(r)):W(r),ln.bind(r)}function Yn(t){return t&&typeof t=="object"&&"then"in t}function te(t,n,e){let r,o,i;typeof n=="function"?(r=t,o=n,i=e||{}):(r=!0,o=t,i=n||{});let s=null,a=$t,c=null,f=!1,d=!1,l="initialValue"in i,k=typeof r=="function"&&O(r);const w=new Set,[_,I]=(i.storage||z)(i.initialValue),[F,K]=z(void 0),[C,q]=z(void 0,{equals:!1}),[E,M]=z(l?"ready":"unresolved");h.context&&(c=h.getNextContextId(),i.ssrLoadFrom==="initial"?a=i.initialValue:h.load&&h.has(c)&&(a=h.load(c)));function T(m,b,$,S){return s===m&&(s=null,S!==void 0&&(l=!0),(m===a||b===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(S,{value:b})),a=$t,u&&m&&f?(u.promises.delete(m),f=!1,A(()=>{u.running=!0,Lt(b,$)},!1)):Lt(b,$)),b}function Lt(m,b){A(()=>{b===void 0&&I(()=>m),M(b!==void 0?"errored":l?"ready":"unresolved"),K(b);for(const $ of w.keys())$.decrement();w.clear()},!1)}function xt(){const m=nt&&Mt(nt),b=_(),$=F();if($!==void 0&&!s)throw $;return g&&!g.user&&m&&It(()=>{C(),s&&(m.resolved&&u&&f?u.promises.add(s):w.has(m)||(m.increment(),w.add(m)))}),b}function St(m=!0){if(m!==!1&&d)return;d=!1;const b=k?k():r;if(f=u&&u.running,b==null||b===!1){T(s,y(_));return}u&&s&&u.promises.delete(s);let $;const S=a!==$t?a:y(()=>{try{return o(b,{value:_(),refetching:m})}catch(Z){$=Z}});if($!==void 0){T(s,void 0,gt($),b);return}else if(!Yn(S))return T(s,S,void 0,b),S;return s=S,"v"in S?(S.s===1?T(s,S.v,void 0,b):T(s,void 0,gt(S.v),b),S):(d=!0,queueMicrotask(()=>d=!1),A(()=>{M(l?"refreshing":"pending"),q()},!1),S.then(Z=>T(S,Z,void 0,b),Z=>T(S,void 0,gt(Z),b)))}Object.defineProperties(xt,{state:{get:()=>E()},error:{get:()=>F()},loading:{get(){const m=E();return m==="pending"||m==="refreshing"}},latest:{get(){if(!l)return xt();const m=F();if(m&&!s)throw m;return _()}}});let Kt=p;return k?It(()=>(Kt=p,St(!1))):St(!1),[xt,{refetch:m=>cn(Kt,()=>St(m)),mutate:I}]}function ne(t){return A(t,!1)}function y(t){if(!J&&g===null)return t();const n=g;g=null;try{return J?J.untrack(t):t()}finally{g=n}}function ee(t,n,e){const r=Array.isArray(t);let o,i=e&&e.defer;return s=>{let a;if(r){a=Array(t.length);for(let f=0;f<t.length;f++)a[f]=t[f]()}else a=t();if(i)return i=!1,s;const c=y(()=>n(a,o,s));return o=a,c}}function re(t){an(()=>y(t))}function tt(t){return p===null||(p.cleanups===null?p.cleanups=[t]:p.cleanups.push(t)),t}function oe(t,n){X||(X=Symbol("error")),p=et(void 0,void 0,!0),p.context={...p.context,[X]:[n]},u&&u.running&&u.sources.add(p);try{return t()}catch(e){ot(e)}finally{p=p.owner}}function Dt(){return g}function ie(){return p}function cn(t,n){const e=p,r=g;p=t,g=null;try{return A(n,!0)}catch(o){ot(o)}finally{p=e,g=r}}function se(t){if(u&&u.running)return t(),u.done;const n=g,e=p;return Promise.resolve().then(()=>{g=n,p=e;let r;return(U||nt)&&(r=u||(u={sources:new Set,effects:[],promises:new Set,disposed:new Set,queue:new Set,running:!0}),r.done||(r.done=new Promise(o=>r.resolve=o)),r.running=!0),A(t,!1),g=p=null,r?r.done:void 0})}const[Ke,un]=z(!1);function ae(t,n){const e=Symbol("context");return{id:e,Provider:de(e),defaultValue:t}}function Mt(t){let n;return p&&p.context&&(n=p.context[t.id])!==void 0?n:t.defaultValue}function Tt(t){const n=O(t),e=O(()=>Ft(n()));return e.toArray=()=>{const r=e();return Array.isArray(r)?r:r!=null?[r]:[]},e}let nt;function ln(){const t=u&&u.running;if(this.sources&&(t?this.tState:this.state))if((t?this.tState:this.state)===P)W(this);else{const n=v;v=null,A(()=>pt(this),!1),v=n}if(g){const n=this.observers;if(!n||n[n.length-1]!==g){const e=n?n.length:0;g.sources?(g.sources.push(this),g.sourceSlots.push(e)):(g.sources=[this],g.sourceSlots=[e]),n?(n.push(g),this.observerSlots.push(g.sources.length-1)):(this.observers=[g],this.observerSlots=[g.sources.length-1])}}return t&&u.sources.has(this)?this.tValue:this.value}function dn(t,n,e){let r=u&&u.running&&u.sources.has(t)?t.tValue:t.value;if(!t.comparator||!t.comparator(r,n)){if(u){const o=u.running;(o||!e&&u.sources.has(t))&&(u.sources.add(t),t.tValue=n),o||(t.value=n)}else t.value=n;t.observers&&t.observers.length&&A(()=>{for(let o=0;o<t.observers.length;o+=1){const i=t.observers[o],s=u&&u.running;s&&u.disposed.has(i)||((s?!i.tState:!i.state)&&(i.pure?v.push(i):x.push(i),i.observers&&gn(i)),s?i.tState=P:i.state=P)}if(v.length>1e6)throw v=[],new Error},!1)}return n}function W(t){if(!t.fn)return;H(t);const n=ft;fn(t,u&&u.running&&u.sources.has(t)?t.tValue:t.value,n),u&&!u.running&&u.sources.has(t)&&queueMicrotask(()=>{A(()=>{u&&(u.running=!0),g=p=t,fn(t,t.tValue,n),g=p=null},!1)})}function fn(t,n,e){let r;const o=p,i=g;g=p=t;try{r=t.fn(n)}catch(s){return t.pure&&(u&&u.running?(t.tState=P,t.tOwned&&t.tOwned.forEach(H),t.tOwned=void 0):(t.state=P,t.owned&&t.owned.forEach(H),t.owned=null)),t.updatedAt=e+1,ot(s)}finally{g=i,p=o}(!t.updatedAt||t.updatedAt<=e)&&(t.updatedAt!=null&&"observers"in t?dn(t,r,!0):u&&u.running&&t.pure?(u.sources.has(t)||(t.value=r),u.sources.add(t),t.tValue=r):t.value=r,t.updatedAt=e)}function et(t,n,e,r=P,o){const i={fn:t,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:n,owner:p,context:p?p.context:null,pure:e};if(u&&u.running&&(i.state=0,i.tState=r),p===null||p!==on&&(u&&u.running&&p.pure?p.tOwned?p.tOwned.push(i):p.tOwned=[i]:p.owned?p.owned.push(i):p.owned=[i]),J&&i.fn){const s=i.fn,[a,c]=z(void 0,{equals:!1}),f=J.factory(s,c);tt(()=>f.dispose());let d;const l=()=>se(c).then(()=>{d&&(d.dispose(),d=void 0)});i.fn=k=>(a(),u&&u.running?(d||(d=J.factory(s,l)),d.track(k)):f.track(k))}return i}function rt(t){const n=u&&u.running;if((n?t.tState:t.state)===0)return;if((n?t.tState:t.state)===Y)return pt(t);if(t.suspense&&y(t.suspense.inFallback))return t.suspense.effects.push(t);const e=[t];for(;(t=t.owner)&&(!t.updatedAt||t.updatedAt<ft);){if(n&&u.disposed.has(t))return;(n?t.tState:t.state)&&e.push(t)}for(let r=e.length-1;r>=0;r--){if(t=e[r],n){let o=t,i=e[r+1];for(;(o=o.owner)&&o!==i;)if(u.disposed.has(o))return}if((n?t.tState:t.state)===P)W(t);else if((n?t.tState:t.state)===Y){const o=v;v=null,A(()=>pt(t,e[0]),!1),v=o}}}function A(t,n){if(v)return t();let e=!1;n||(v=[]),x?e=!0:x=[],ft++;try{const r=t();return ce(e),r}catch(r){e||(x=null),v=null,ot(r)}}function ce(t){if(v&&(U&&u&&u.running?ue(v):pn(v),v=null),t)return;let n;if(u){if(!u.promises.size&&!u.queue.size){const r=u.sources,o=u.disposed;x.push.apply(x,u.effects),n=u.resolve;for(const i of x)"tState"in i&&(i.state=i.tState),delete i.tState;u=null,A(()=>{for(const i of o)H(i);for(const i of r){if(i.value=i.tValue,i.owned)for(let s=0,a=i.owned.length;s<a;s++)H(i.owned[s]);i.tOwned&&(i.owned=i.tOwned),delete i.tValue,delete i.tOwned,i.tState=0}un(!1)},!1)}else if(u.running){u.running=!1,u.effects.push.apply(u.effects,x),x=null,un(!0);return}}const e=x;x=null,e.length&&A(()=>rn(e),!1),n&&n()}function pn(t){for(let n=0;n<t.length;n++)rt(t[n])}function ue(t){for(let n=0;n<t.length;n++){const e=t[n],r=u.queue;r.has(e)||(r.add(e),U(()=>{r.delete(e),A(()=>{u.running=!0,rt(e)},!1),u&&(u.running=!1)}))}}function le(t){let n,e=0;for(n=0;n<t.length;n++){const r=t[n];r.user?t[e++]=r:rt(r)}if(h.context){if(h.count){h.effects||(h.effects=[]),h.effects.push(...t.slice(0,e));return}zt()}for(h.effects&&(h.done||!h.count)&&(t=[...h.effects,...t],e+=h.effects.length,delete h.effects),n=0;n<e;n++)rt(t[n])}function pt(t,n){const e=u&&u.running;e?t.tState=0:t.state=0;for(let r=0;r<t.sources.length;r+=1){const o=t.sources[r];if(o.sources){const i=e?o.tState:o.state;i===P?o!==n&&(!o.updatedAt||o.updatedAt<ft)&&rt(o):i===Y&&pt(o,n)}}}function gn(t){const n=u&&u.running;for(let e=0;e<t.observers.length;e+=1){const r=t.observers[e];(n?!r.tState:!r.state)&&(n?r.tState=Y:r.state=Y,r.pure?v.push(r):x.push(r),r.observers&&gn(r))}}function H(t){let n;if(t.sources)for(;t.sources.length;){const e=t.sources.pop(),r=t.sourceSlots.pop(),o=e.observers;if(o&&o.length){const i=o.pop(),s=e.observerSlots.pop();r<o.length&&(i.sourceSlots[s]=r,o[r]=i,e.observerSlots[r]=s)}}if(t.tOwned){for(n=t.tOwned.length-1;n>=0;n--)H(t.tOwned[n]);delete t.tOwned}if(u&&u.running&&t.pure)hn(t,!0);else if(t.owned){for(n=t.owned.length-1;n>=0;n--)H(t.owned[n]);t.owned=null}if(t.cleanups){for(n=t.cleanups.length-1;n>=0;n--)t.cleanups[n]();t.cleanups=null}u&&u.running?t.tState=0:t.state=0}function hn(t,n){if(n||(t.tState=0,u.disposed.add(t)),t.owned)for(let e=0;e<t.owned.length;e++)hn(t.owned[e])}function gt(t){return t instanceof Error?t:new Error(typeof t=="string"?t:"Unknown error",{cause:t})}function kn(t,n,e){try{for(const r of n)r(t)}catch(r){ot(r,e&&e.owner||null)}}function ot(t,n=p){const e=X&&n&&n.context&&n.context[X],r=gt(t);if(!e)throw r;x?x.push({fn(){kn(r,e,n)},state:P}):kn(r,e,n)}function Ft(t){if(typeof t=="function"&&!t.length)return Ft(t());if(Array.isArray(t)){const n=[];for(let e=0;e<t.length;e++){const r=Ft(t[e]);if(Array.isArray(r))if(r.length<32768)n.push.apply(n,r);else for(let o=0;o<r.length;o++)n.push(r[o]);else n.push(r)}return n}return t}function de(t,n){return function(e){let r;return sn(()=>r=y(()=>(p.context={...p.context,[t]:e.value},Tt(()=>e.children))),void 0),r}}const Ht=Symbol("fallback");function ht(t){for(let n=0;n<t.length;n++)t[n]()}function fe(t,n,e={}){let r=[],o=[],i=[],s=0,a=n.length>1?[]:null;return tt(()=>ht(i)),()=>{let c=t()||[],f=c.length,d,l;return c[Q],y(()=>{let w,_,I,F,K,C,q,E,M;if(f===0)s!==0&&(ht(i),i=[],r=[],o=[],s=0,a&&(a=[])),e.fallback&&(r=[Ht],o[0]=N(T=>(i[0]=T,e.fallback())),s=1);else if(s===0){for(o=new Array(f),l=0;l<f;l++)r[l]=c[l],o[l]=N(k);s=f}else{for(I=new Array(f),F=new Array(f),a&&(K=new Array(f)),C=0,q=Math.min(s,f);C<q&&r[C]===c[C];C++);for(q=s-1,E=f-1;q>=C&&E>=C&&r[q]===c[E];q--,E--)I[E]=o[q],F[E]=i[q],a&&(K[E]=a[q]);for(w=new Map,_=new Array(E+1),l=E;l>=C;l--)M=c[l],d=w.get(M),_[l]=d===void 0?-1:d,w.set(M,l);for(d=C;d<=q;d++)M=r[d],l=w.get(M),l!==void 0&&l!==-1?(I[l]=o[d],F[l]=i[d],a&&(K[l]=a[d]),l=_[l],w.set(M,l)):i[d]();for(l=C;l<f;l++)l in I?(o[l]=I[l],i[l]=F[l],a&&(a[l]=K[l],a[l](l))):o[l]=N(k);o=o.slice(0,s=f),r=c.slice(0)}return o});function k(w){if(i[l]=w,a){const[_,I]=z(l);return a[l]=I,n(c[l],_)}return n(c[l])}}}function pe(t,n,e={}){let r=[],o=[],i=[],s=[],a=0,c;return tt(()=>ht(i)),()=>{const f=t()||[],d=f.length;return f[Q],y(()=>{if(d===0)return a!==0&&(ht(i),i=[],r=[],o=[],a=0,s=[]),e.fallback&&(r=[Ht],o[0]=N(k=>(i[0]=k,e.fallback())),a=1),o;for(r[0]===Ht&&(i[0](),i=[],r=[],o=[],a=0),c=0;c<d;c++)c<r.length&&r[c]!==f[c]?s[c](()=>f[c]):c>=r.length&&(o[c]=N(l));for(;c<r.length;c++)i[c]();return a=s.length=i.length=d,r=f.slice(0),o=o.slice(0,a)});function l(k){i[c]=k;const[w,_]=z(f[c]);return s[c]=_,n(w,c)}}}let mn=!1;function ge(){mn=!0}function he(t,n){if(mn&&h.context){const e=h.context;zt(Qn());const r=y(()=>t(n||{}));return zt(e),r}return y(()=>t(n||{}))}function kt(){return!0}const Nt={get(t,n,e){return n===V?e:t.get(n)},has(t,n){return n===V?!0:t.has(n)},set:kt,deleteProperty:kt,getOwnPropertyDescriptor(t,n){return{configurable:!0,enumerable:!0,get(){return t.get(n)},set:kt,deleteProperty:kt}},ownKeys(t){return t.keys()}};function Rt(t){return(t=typeof t=="function"?t():t)?t:{}}function ke(){for(let t=0,n=this.length;t<n;++t){const e=this[t]();if(e!==void 0)return e}}function me(...t){let n=!1;for(let s=0;s<t.length;s++){const a=t[s];n=n||!!a&&V in a,t[s]=typeof a=="function"?(n=!0,O(a)):a}if(en&&n)return new Proxy({get(s){for(let a=t.length-1;a>=0;a--){const c=Rt(t[a])[s];if(c!==void 0)return c}},has(s){for(let a=t.length-1;a>=0;a--)if(s in Rt(t[a]))return!0;return!1},keys(){const s=[];for(let a=0;a<t.length;a++)s.push(...Object.keys(Rt(t[a])));return[...new Set(s)]}},Nt);const e={},r=Object.create(null);for(let s=t.length-1;s>=0;s--){const a=t[s];if(!a)continue;const c=Object.getOwnPropertyNames(a);for(let f=c.length-1;f>=0;f--){const d=c[f];if(d==="__proto__"||d==="constructor")continue;const l=Object.getOwnPropertyDescriptor(a,d);if(!r[d])r[d]=l.get?{enumerable:!0,configurable:!0,get:ke.bind(e[d]=[l.get.bind(a)])}:l.value!==void 0?l:void 0;else{const k=e[d];k&&(l.get?k.push(l.get.bind(a)):l.value!==void 0&&k.push(()=>l.value))}}}const o={},i=Object.keys(r);for(let s=i.length-1;s>=0;s--){const a=i[s],c=r[a];c&&c.get?Object.defineProperty(o,a,c):o[a]=c?c.value:void 0}return o}function be(t,...n){const e=n.length;if(en&&V in t){const o=e>1?n.flat():n[0],i=n.map(s=>new Proxy({get(a){return s.includes(a)?t[a]:void 0},has(a){return s.includes(a)&&a in t},keys(){return s.filter(a=>a in t)}},Nt));return i.push(new Proxy({get(s){return o.includes(s)?void 0:t[s]},has(s){return o.includes(s)?!1:s in t},keys(){return Object.keys(t).filter(s=>!o.includes(s))}},Nt)),i}const r=[];for(let o=0;o<=e;o++)r[o]={};for(const o of Object.getOwnPropertyNames(t)){let i=e;for(let a=0;a<n.length;a++)if(n[a].includes(o)){i=a;break}const s=Object.getOwnPropertyDescriptor(t,o);!s.get&&!s.set&&s.enumerable&&s.writable&&s.configurable?r[i][o]=s.value:Object.defineProperty(r[i],o,s)}return r}let ve=0;function ye(){return h.context?h.getNextContextId():`cl-${ve++}`}const bn=t=>`Stale read from <${t}>.`;function we(t){const n="fallback"in t&&{fallback:()=>t.fallback};return O(fe(()=>t.each,t.children,n||void 0))}function xe(t){const n="fallback"in t&&{fallback:()=>t.fallback};return O(pe(()=>t.each,t.children,n||void 0))}function Se(t){const n=t.keyed,e=O(()=>t.when,void 0,void 0),r=n?e:O(e,void 0,{equals:(o,i)=>!o==!i});return O(()=>{const o=r();if(o){const i=t.children;return typeof i=="function"&&i.length>0?y(()=>i(n?o:()=>{if(!y(r))throw bn("Show");return e()})):i}return t.fallback},void 0,void 0)}function Oe(t){const n=Tt(()=>t.children),e=O(()=>{const r=n(),o=Array.isArray(r)?r:[r];let i=()=>{};for(let s=0;s<o.length;s++){const a=s,c=o[s],f=i,d=O(()=>f()?void 0:c.when,void 0,void 0),l=c.keyed?d:O(d,void 0,{equals:(k,w)=>!k==!w});i=()=>f()||(l()?[a,d,c]:void 0)}return i});return O(()=>{const r=e()();if(!r)return t.fallback;const[o,i,s]=r,a=s.children;return typeof a=="function"&&a.length>0?y(()=>a(s.keyed?i():()=>{var c;if(((c=y(e)())==null?void 0:c[0])!==o)throw bn("Match");return i()})):a},void 0,void 0)}function Ae(t){return t}let mt;function je(t){let n;h.context&&h.load&&(n=h.load(h.getContextId()));const[e,r]=z(n,void 0);return mt||(mt=new Set),mt.add(r),tt(()=>mt.delete(r)),O(()=>{let o;if(o=e()){const i=t.fallback;return typeof i=="function"&&i.length?y(()=>i(o,()=>r())):i}return oe(()=>t.children,r)},void 0,void 0)}const bt=Symbol("store-raw"),R=Symbol("store-node"),D=Symbol("store-has"),vn=Symbol("store-self");function yn(t){let n=t[V];if(!n&&(Object.defineProperty(t,V,{value:n=new Proxy(t,Ce)}),!Array.isArray(t))){const e=Object.keys(t),r=Object.getOwnPropertyDescriptors(t),o=Object.getPrototypeOf(t),i=o!==null&&t!==null&&typeof t=="object"&&!Array.isArray(t)&&o!==Object.prototype;if(i){const s=Object.getOwnPropertyDescriptors(o);e.push(...Object.keys(s)),Object.assign(r,s)}for(let s=0,a=e.length;s<a;s++){const c=e[s];i&&c==="constructor"||r[c].get&&Object.defineProperty(t,c,{configurable:!0,enumerable:r[c].enumerable,get:r[c].get.bind(n)})}}return n}function B(t){let n;return t!=null&&typeof t=="object"&&(t[V]||!(n=Object.getPrototypeOf(t))||n===Object.prototype||Array.isArray(t))}function L(t,n=new Set){let e,r,o,i;if(e=t!=null&&t[bt])return e;if(!B(t)||n.has(t))return t;if(Array.isArray(t)){Object.isFrozen(t)?t=t.slice(0):n.add(t);for(let s=0,a=t.length;s<a;s++)o=t[s],(r=L(o,n))!==o&&(t[s]=r)}else{Object.isFrozen(t)?t=Object.assign({},t):n.add(t);const s=Object.keys(t),a=Object.getOwnPropertyDescriptors(t);for(let c=0,f=s.length;c<f;c++)i=s[c],!a[i].get&&(o=t[i],(r=L(o,n))!==o&&(t[i]=r))}return t}function vt(t,n){let e=t[n];return e||Object.defineProperty(t,n,{value:e=Object.create(null)}),e}function it(t,n,e){if(t[n])return t[n];const[r,o]=z(e,{equals:!1,internal:!0});return r.$=o,t[n]=r}function Pe(t,n){const e=Reflect.getOwnPropertyDescriptor(t,n);return!e||e.get||!e.configurable||n===V||n===R||(delete e.value,delete e.writable,e.get=()=>t[V][n]),e}function wn(t){Dt()&&it(vt(t,R),vn)()}function _e(t){return wn(t),Reflect.ownKeys(t)}const Ce={get(t,n,e){if(n===bt)return t;if(n===V)return e;if(n===Q)return wn(t),e;const r=vt(t,R),o=r[n];let i=o?o():t[n];if(n===R||n===D||n==="__proto__")return i;if(!o){const s=Object.getOwnPropertyDescriptor(t,n);Dt()&&(typeof i!="function"||t.hasOwnProperty(n))&&!(s&&s.get)&&(i=it(r,n,i)())}return B(i)?yn(i):i},has(t,n){return n===bt||n===V||n===Q||n===R||n===D||n==="__proto__"?!0:(Dt()&&it(vt(t,D),n)(),n in t)},set(){return!0},deleteProperty(){return!0},ownKeys:_e,getOwnPropertyDescriptor:Pe};function G(t,n,e,r=!1){if(n==="__proto__"||!r&&t[n]===e)return;const o=t[n],i=t.length;e===void 0?(delete t[n],t[D]&&t[D][n]&&o!==void 0&&t[D][n].$()):(t[n]=e,t[D]&&t[D][n]&&o===void 0&&t[D][n].$());let s=vt(t,R),a;if((a=it(s,n,o))&&a.$(()=>e),Array.isArray(t)&&t.length!==i){for(let c=t.length;c<i;c++)(a=s[c])&&a.$();(a=it(s,"length",i))&&a.$(t.length)}(a=s[vn])&&a.$()}function xn(t,n){const e=Object.keys(n);for(let r=0;r<e.length;r+=1){const o=e[r];Sn(o)||G(t,o,n[o])}}function Sn(t){return t==="__proto__"||t==="constructor"||t==="prototype"}function qe(t,n){if(typeof n=="function"&&(n=n(t)),n=L(n),Array.isArray(n)){if(t===n)return;let e=0,r=n.length;for(;e<r;e++){const o=n[e];t[e]!==o&&G(t,e,o)}G(t,"length",r)}else xn(t,n)}function st(t,n,e=[]){let r,o=t;if(n.length>1){r=n.shift();const s=typeof r,a=Array.isArray(t);if(s==="string"&&(r==="__proto__"||n.length>1&&Sn(r)))return;if(Array.isArray(r)){for(let c=0;c<r.length;c++)st(t,[r[c]].concat(n),e);return}else if(a&&s==="function"){for(let c=0;c<t.length;c++)r(t[c],c)&&st(t,[c].concat(n),e);return}else if(a&&s==="object"){const{from:c=0,to:f=t.length-1,by:d=1}=r;for(let l=c;l<=f;l+=d)st(t,[l].concat(n),e);return}else if(n.length>1){st(t[r],n,[r].concat(e));return}o=t[r],e=[r].concat(e)}let i=n[0];typeof i=="function"&&(i=i(o,e),i===o)||r===void 0&&i==null||(i=L(i),r===void 0||B(o)&&B(i)&&!Array.isArray(i)?xn(o,i):G(t,r,i))}function On(...[t,n]){const e=L(t||{}),r=Array.isArray(e),o=yn(e);function i(...s){ne(()=>{r&&s.length===1?qe(e,s[0]):st(e,s)})}return[o,i]}const Ue=Symbol("store-root"),yt=new WeakMap,An={get(t,n){if(n===bt)return t;const e=t[n];if(n===V||n===Q||n===R||n===D||n==="__proto__")return e;let r;return B(e)?yt.get(e)||(yt.set(e,r=new Proxy(e,An)),r):e},set(t,n,e){return G(t,n,L(e)),!0},deleteProperty(t,n){return G(t,n,void 0,!0),!0}};function jn(t){return n=>{if(B(n)){let e;(e=yt.get(n))||yt.set(n,e=new Proxy(n,An)),t(e)}return n}}let j={};function Pn(t){j.stack&&t.setAttribute("stack",j.stack),j.position&&t.setAttribute("position",j.position),j.max!==void 0&&t.setAttribute("max",String(j.max)),j.appearance&&t.setAttribute("appearance",j.appearance),j.inverse!==void 0&&(j.inverse?t.setAttribute("inverse",""):t.removeAttribute("inverse"))}function Ee(t){j={...j,...t},!(typeof document>"u")&&document.querySelectorAll("kai-toast-region").forEach(n=>Pn(n))}const Ve=5e3,ze=7e3,{toasts:wt,setToasts:at,mounted:Je,setMounted:_n}=N(()=>{const[t,n]=On([]),[e,r]=z(!1);return{toasts:t,setToasts:n,mounted:e,setMounted:r}});let Cn=0;function $e(){return Cn+=1,`toast-${Cn}`}function Ie(t){const n=t.duration??Ve;return n===0?0:t.action?Math.max(n,ze):n}const ct=new Map;let qn=!1;function De(t){return t.target??null}function Me(t=null){if(typeof document>"u")return;const n=ct.get(t);if(n&&n.isConnected)return n;n&&ct.delete(t);const e=new Set(ct.values()),r=Array.from(document.querySelectorAll("kai-toast-region")).filter(s=>s.isConnected&&!e.has(s)&&De(s)===t);r.length>1&&!qn&&(qn=!0,console.warn(`[kitn] toast(): ${r.length} candidate <kai-toast-region> elements are in the document; adopting the first in document order. Keep one region per target so the imperative toast() API has an unambiguous home.`));const o=r[0];if(o)return o.toasts=wt,ct.set(t,o),_n(!0),o;const i=document.createElement("kai-toast-region");return document.body.appendChild(i),i.toasts=wt,t&&(i.target=t),Pn(i),ct.set(t,i),_n(!0),i}function Te(t){const n=wt.findIndex(e=>e.id===t.id);n>=0?at(n,t):at(jn(e=>{e.push(t)}))}function En(t){at(n=>n.filter(e=>e.id!==t))}function Fe(t){return{id:t,dismiss:()=>En(t),update:n=>{const e=wt.findIndex(r=>r.id===t);e>=0&&at(e,r=>({...r,...n}))}}}function ut(t,n,e){Me(n?.target??null);const r=n?.id??$e(),o={id:r,message:t,variant:n?.variant??e,appearance:n?.appearance??j.appearance??"pill",inverse:n?.inverse??j.inverse??!1,description:n?.description,action:n?.action,duration:n?.duration,dismissible:n?.dismissible,target:n?.target};return Te(o),Fe(r)}const He=Object.assign((t,n)=>ut(t,n,"neutral"),{success:(t,n)=>ut(t,n,"success"),warning:(t,n)=>ut(t,n,"warning"),error:(t,n)=>ut(t,n,"error"),info:(t,n)=>ut(t,n,"info"),dismiss:En,clear:()=>at([])}),Ne=typeof window<"u"&&typeof customElements<"u"?import("./register-impl-DvEnhIxx.js").then(t=>t.r):Promise.resolve();export{On as A,jn as B,L as C,It as D,je as E,we as F,Tt as G,Ie as H,xe as I,Ae as M,Se as S,Ln as a,N as b,O as c,Nn as classifyTool,Fn as configureCodeHighlighting,Ee as configureToasts,sn as d,h as e,Ne as elementsReady,Zn as emitElementRegistry,ge as f,ie as g,an as h,z as i,Hn as isCodeHighlightingEnabled,be as j,ae as k,he as l,Mt as m,Bn as n,tt as o,Gn as p,me as q,cn as r,Rn as s,ye as t,He as toast,y as u,re as v,ee as w,te as x,Tn as y,Oe as z};
@@ -1 +1 @@
1
- import{s as f,p as h,q as g,i as o,c as s,F as w,S as u,a as x,b,t as c}from"./define-By-uL588.js";import{c as i}from"./cn-DN5AWfiS.js";var v=c("<kbd>"),k=c("<span part=separator aria-hidden=true class=text-muted-foreground>"),y=c("<span part=key>");function C(){var r;if(typeof navigator>"u")return!1;const e=navigator,t=((r=e.userAgentData)==null?void 0:r.platform)??e.platform??"";return/mac/i.test(t)}function z(r){return r==="mac"?"mac":r==="other"?"other":C()?"mac":"other"}function S(r,e){const t=r.trim();switch(t.toLowerCase()){case"mod":return e?"\u2318":"Ctrl";case"cmd":case"command":case"meta":return"\u2318";case"ctrl":case"control":return"Ctrl";case"shift":return"\u21E7";case"alt":case"opt":case"option":return"\u2325";case"arrowup":return"\u2191";case"arrowdown":return"\u2193";case"arrowleft":return"\u2190";case"arrowright":return"\u2192";case"enter":case"return":return"\u23CE";case"esc":case"escape":return"Esc";case"space":return"Space";default:return t.toUpperCase()}}const j={sm:"h-5 min-w-5 px-1 text-caption",md:"h-6 min-w-6 px-1.5 text-xs"};function q(r){const[e,t]=f(r,["keys","platform","size","class","children"]),l=()=>z(e.platform??"other")==="mac",m=()=>(e.keys??"").split("+").map(a=>a.trim()).filter(Boolean);return(()=>{var a=v();return h(a,g(t,{get class(){return i("inline-flex items-center gap-0.5 align-middle font-sans",e.class)}}),!1,!0),o(a,s(u,{get when(){return e.keys!=null},get fallback(){return e.children},get children(){return s(w,{get each(){return m()},children:(d,p)=>[s(u,{get when(){return p()>0},get children(){return k()}}),(()=>{var n=y();return o(n,()=>S(d,l())),x(()=>b(n,i("inline-flex items-center justify-center rounded border border-border bg-muted font-medium leading-none tabular-nums text-muted-foreground",j[e.size??"md"]))),n})()]})}})),a})()}export{q as K};
1
+ import{s as f,p as h,q as g,i as o,c as s,F as w,S as u,a as x,b,t as c}from"./define-CI0y3eE4.js";import{c as i}from"./cn-DN5AWfiS.js";var v=c("<kbd>"),k=c("<span part=separator aria-hidden=true class=text-muted-foreground>"),y=c("<span part=key>");function C(){var r;if(typeof navigator>"u")return!1;const e=navigator,t=((r=e.userAgentData)==null?void 0:r.platform)??e.platform??"";return/mac/i.test(t)}function z(r){return r==="mac"?"mac":r==="other"?"other":C()?"mac":"other"}function S(r,e){const t=r.trim();switch(t.toLowerCase()){case"mod":return e?"\u2318":"Ctrl";case"cmd":case"command":case"meta":return"\u2318";case"ctrl":case"control":return"Ctrl";case"shift":return"\u21E7";case"alt":case"opt":case"option":return"\u2325";case"arrowup":return"\u2191";case"arrowdown":return"\u2193";case"arrowleft":return"\u2190";case"arrowright":return"\u2192";case"enter":case"return":return"\u23CE";case"esc":case"escape":return"Esc";case"space":return"Space";default:return t.toUpperCase()}}const j={sm:"h-5 min-w-5 px-1 text-caption",md:"h-6 min-w-6 px-1.5 text-xs"};function q(r){const[e,t]=f(r,["keys","platform","size","class","children"]),l=()=>z(e.platform??"other")==="mac",m=()=>(e.keys??"").split("+").map(a=>a.trim()).filter(Boolean);return(()=>{var a=v();return h(a,g(t,{get class(){return i("inline-flex items-center gap-0.5 align-middle font-sans",e.class)}}),!1,!0),o(a,s(u,{get when(){return e.keys!=null},get fallback(){return e.children},get children(){return s(w,{get each(){return m()},children:(d,p)=>[s(u,{get when(){return p()>0},get children(){return k()}}),(()=>{var n=y();return o(n,()=>S(d,l())),x(()=>b(n,i("inline-flex items-center justify-center rounded border border-border bg-muted font-medium leading-none tabular-nums text-muted-foreground",j[e.size??"md"]))),n})()]})}})),a})()}export{q as K};
@@ -1 +1 @@
1
- import{I as o}from"./Icon-DObhsRtm.js";import{c as e,q as r}from"./define-By-uL588.js";var l=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],p=a=>e(o,r(a,{name:"Link",iconNode:l})),t=p;export{t as l};
1
+ import{I as o}from"./Icon-BzBET3E-.js";import{c as e,q as r}from"./define-CI0y3eE4.js";var l=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],p=a=>e(o,r(a,{name:"Link",iconNode:l})),t=p;export{t as l};
@@ -1 +1 @@
1
- import{s as F,g as w,k as u,o as G,j as C,x as S,c as a,i as n,S as g,a as h,d as p,b as j,t as o,e as H}from"./define-By-uL588.js";import{c as z}from"./cn-DN5AWfiS.js";import{S as b}from"./skeleton-CkHI-HgC.js";import{d as J,i as K}from"./link-preview-DNILK391.js";import{l as D}from"./link-zF8PzWfF.js";var M=o('<div class="space-y-2 p-3">'),P=o('<img role=img class="aspect-[16/9] w-full object-cover">'),Q=o('<img alt class="h-3.5 w-3.5 shrink-0 rounded-sm">'),R=o('<div class="line-clamp-3 text-xs text-muted-foreground">'),T=o('<div class="space-y-1 p-3"><div class="flex items-center gap-1.5 text-xs text-muted-foreground"><span class=truncate></span></div><div class="line-clamp-2 text-sm font-semibold text-foreground">'),U=o('<a rel="noopener noreferrer">'),V=o('<div role=img aria-label="Invalid link"><span class=truncate>Invalid link');function W(v){return!!(v.title||v.description||v.image)}function X(v){const[i]=F(v,["cardId","data","onEmit","class"]),k=r=>{var e;return(e=i.onEmit)==null?void 0:e.call(i,r)},[L,_]=w(),[I,Y]=w(!1),[A,y]=w(!1),c=()=>i.data.url,f=u(()=>K(c())),s=u(()=>({...i.data,...L()}));G(()=>k({kind:"ready",cardId:i.cardId})),C(S(f,r=>{r||k({kind:"error",cardId:i.cardId,message:`Invalid link url: ${c()}`})})),C(S(()=>[i.data,f()],([r,e])=>{y(!1),!e||W(r)}));const x=u(()=>s().domain??J(c())??c()),N=u(()=>s().siteName??x()),$=u(()=>s().title??x()),O=u(()=>!!s().image&&!A()),E=()=>{f()&&k({kind:"open",cardId:i.cardId,url:c(),target:"tab"})},q=r=>{r.preventDefault(),E()},B=r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),E())};return a(g,{get when(){return f()},get fallback(){return(()=>{var r=V(),e=r.firstChild;return n(r,a(D,{size:16,"aria-hidden":"true"}),e),h(()=>j(r,z("flex items-center gap-2 rounded-xl border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive dark:border-red-400/50 dark:bg-destructive/20 dark:text-red-400",i.class))),r})()},get children(){var r=U();return r.$$keydown=B,r.$$click=q,n(r,a(g,{get when(){return I()},get children(){return[a(b,{class:"aspect-[16/9] w-full rounded-none"}),(()=>{var e=M();return n(e,a(b,{class:"h-3 w-1/3"}),null),n(e,a(b,{class:"h-4 w-2/3"}),null),n(e,a(b,{class:"h-3 w-full"}),null),e})()]}}),null),n(r,a(g,{get when(){return!I()},get children(){return[a(g,{get when(){return O()},get children(){var e=P();return e.addEventListener("error",()=>y(!0)),h(t=>{var d=s().image,l=s().imageAlt??"";return d!==t.e&&p(e,"src",t.e=d),l!==t.t&&p(e,"alt",t.t=l),t},{e:void 0,t:void 0}),e}}),(()=>{var e=T(),t=e.firstChild,d=t.firstChild,l=t.nextSibling;return n(t,a(g,{get when(){return s().favicon},get fallback(){return a(D,{size:12,class:"shrink-0 opacity-70","aria-hidden":"true"})},get children(){var m=Q();return h(()=>p(m,"src",s().favicon)),m}}),d),n(d,N),n(l,$),n(e,a(g,{get when(){return s().description},get children(){var m=R();return n(m,()=>s().description),m}}),null),e})()]}}),null),h(e=>{var t=c(),d=`Open ${$()} on ${x()}`,l=z("group block overflow-hidden rounded-xl border border-border bg-card text-card-foreground no-underline outline-none transition-shadow","cursor-pointer hover:shadow-md focus-visible:ring-2 focus-visible:ring-ring",i.class);return t!==e.e&&p(r,"href",e.e=t),d!==e.t&&p(r,"aria-label",e.t=d),l!==e.a&&j(r,e.a=l),e},{e:void 0,t:void 0,a:void 0}),r}})}H(["click","keydown"]);export{X as L};
1
+ import{s as F,g as w,k as u,o as G,j as C,x as S,c as a,i as n,S as g,a as h,d as p,b as j,t as o,e as H}from"./define-CI0y3eE4.js";import{c as z}from"./cn-DN5AWfiS.js";import{S as b}from"./skeleton-DYpmFnnm.js";import{d as J,i as K}from"./link-preview-DNILK391.js";import{l as D}from"./link-Dlr0vssB.js";var M=o('<div class="space-y-2 p-3">'),P=o('<img role=img class="aspect-[16/9] w-full object-cover">'),Q=o('<img alt class="h-3.5 w-3.5 shrink-0 rounded-sm">'),R=o('<div class="line-clamp-3 text-xs text-muted-foreground">'),T=o('<div class="space-y-1 p-3"><div class="flex items-center gap-1.5 text-xs text-muted-foreground"><span class=truncate></span></div><div class="line-clamp-2 text-sm font-semibold text-foreground">'),U=o('<a rel="noopener noreferrer">'),V=o('<div role=img aria-label="Invalid link"><span class=truncate>Invalid link');function W(v){return!!(v.title||v.description||v.image)}function X(v){const[i]=F(v,["cardId","data","onEmit","class"]),k=r=>{var e;return(e=i.onEmit)==null?void 0:e.call(i,r)},[L,_]=w(),[I,Y]=w(!1),[A,y]=w(!1),c=()=>i.data.url,f=u(()=>K(c())),s=u(()=>({...i.data,...L()}));G(()=>k({kind:"ready",cardId:i.cardId})),C(S(f,r=>{r||k({kind:"error",cardId:i.cardId,message:`Invalid link url: ${c()}`})})),C(S(()=>[i.data,f()],([r,e])=>{y(!1),!e||W(r)}));const x=u(()=>s().domain??J(c())??c()),N=u(()=>s().siteName??x()),$=u(()=>s().title??x()),O=u(()=>!!s().image&&!A()),E=()=>{f()&&k({kind:"open",cardId:i.cardId,url:c(),target:"tab"})},q=r=>{r.preventDefault(),E()},B=r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),E())};return a(g,{get when(){return f()},get fallback(){return(()=>{var r=V(),e=r.firstChild;return n(r,a(D,{size:16,"aria-hidden":"true"}),e),h(()=>j(r,z("flex items-center gap-2 rounded-xl border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive dark:border-red-400/50 dark:bg-destructive/20 dark:text-red-400",i.class))),r})()},get children(){var r=U();return r.$$keydown=B,r.$$click=q,n(r,a(g,{get when(){return I()},get children(){return[a(b,{class:"aspect-[16/9] w-full rounded-none"}),(()=>{var e=M();return n(e,a(b,{class:"h-3 w-1/3"}),null),n(e,a(b,{class:"h-4 w-2/3"}),null),n(e,a(b,{class:"h-3 w-full"}),null),e})()]}}),null),n(r,a(g,{get when(){return!I()},get children(){return[a(g,{get when(){return O()},get children(){var e=P();return e.addEventListener("error",()=>y(!0)),h(t=>{var d=s().image,l=s().imageAlt??"";return d!==t.e&&p(e,"src",t.e=d),l!==t.t&&p(e,"alt",t.t=l),t},{e:void 0,t:void 0}),e}}),(()=>{var e=T(),t=e.firstChild,d=t.firstChild,l=t.nextSibling;return n(t,a(g,{get when(){return s().favicon},get fallback(){return a(D,{size:12,class:"shrink-0 opacity-70","aria-hidden":"true"})},get children(){var m=Q();return h(()=>p(m,"src",s().favicon)),m}}),d),n(d,N),n(l,$),n(e,a(g,{get when(){return s().description},get children(){var m=R();return n(m,()=>s().description),m}}),null),e})()]}}),null),h(e=>{var t=c(),d=`Open ${$()} on ${x()}`,l=z("group block overflow-hidden rounded-xl border border-border bg-card text-card-foreground no-underline outline-none transition-shadow","cursor-pointer hover:shadow-md focus-visible:ring-2 focus-visible:ring-ring",i.class);return t!==e.e&&p(r,"href",e.e=t),d!==e.t&&p(r,"aria-label",e.t=d),l!==e.a&&j(r,e.a=l),e},{e:void 0,t:void 0,a:void 0}),r}})}H(["click","keydown"]);export{X as L};
@@ -0,0 +1 @@
1
+ import{c as n,M as c,r as $,a as m,b as d,i as v,l as x,F as b,t as z}from"./define-CI0y3eE4.js";import{c as o}from"./cn-DN5AWfiS.js";var _=z("<div><span class=sr-only>Loading"),C=z('<div><div class="absolute h-full w-full"></div><span class=sr-only>Loading'),L=z('<div class="bg-primary absolute animate-[kai-spinner-fade_1.2s_linear_infinite] rounded-full"style=top:0;left:50%;opacity:0>'),T=z('<div><div class="border-primary absolute inset-0 animate-[kai-thin-pulse_1.5s_ease-in-out_infinite] rounded-full border-2"></div><span class=sr-only>Loading'),w=z("<div>"),A=z("<div><span>></span><div></div><span class=sr-only>Loading"),F=z('<div><span></span><span class=inline-flex><span class="text-foreground animate-[kai-loading-dots_1.4s_infinite_0.2s]">.</span><span class="text-foreground animate-[kai-loading-dots_1.4s_infinite_0.4s]">.</span><span class="text-foreground animate-[kai-loading-dots_1.4s_infinite_0.6s]">.');function k(t){const e=()=>t.size??"md",a={sm:"size-4",md:"size-5",lg:"size-6"};return(()=>{var r=_();return m(()=>d(r,o("border-primary animate-spin rounded-full border-2 border-t-transparent",a[e()],t.class))),r})()}function M(t){const e=()=>t.size??"md",a={sm:"size-4",md:"size-5",lg:"size-6"},r={sm:{height:"6px",width:"1.5px"},md:{height:"8px",width:"2px"},lg:{height:"10px",width:"2.5px"}};return(()=>{var i=C(),l=i.firstChild;return v(l,n(b,{get each(){return Array.from({length:12},(g,s)=>s)},children:g=>(()=>{var s=L();return x(s,"transform",`rotate(${g*30}deg)`),x(s,"animation-delay",`${g*.1}s`),m(u=>{var h=e()==="sm"?"-0.75px":e()==="lg"?"-1.25px":"-1px",p=`${e()==="sm"?"0.75px":e()==="lg"?"1.25px":"1px"} ${e()==="sm"?"10px":e()==="lg"?"14px":"12px"}`,f=r[e()].height,y=r[e()].width;return h!==u.e&&x(s,"margin-left",u.e=h),p!==u.t&&x(s,"transform-origin",u.t=p),f!==u.a&&x(s,"height",u.a=f),y!==u.o&&x(s,"width",u.o=y),u},{e:void 0,t:void 0,a:void 0,o:void 0}),s})()})),m(()=>d(i,o("relative",a[e()],t.class))),i})()}function S(t){const e=()=>t.size??"md",a={sm:"size-4",md:"size-5",lg:"size-6"};return(()=>{var r=T();return m(()=>d(r,o("relative",a[e()],t.class))),r})()}function j(t){const e=()=>t.size??"md",a={sm:"size-1",md:"size-2",lg:"size-3"};return(()=>{var r=_();return m(()=>d(r,o("bg-primary animate-[kai-pulse-dot_1.2s_ease-in-out_infinite] rounded-full",a[e()],t.class))),r})()}function q(t){const e=()=>t.size??"md",a={sm:"h-1.5 w-1.5",md:"h-2 w-2",lg:"h-2.5 w-2.5"},r={sm:"h-4",md:"h-5",lg:"h-6"};return(()=>{var i=_(),l=i.firstChild;return v(i,n(b,{each:[0,1,2],children:g=>(()=>{var s=w();return x(s,"animation-delay",`${g*160}ms`),m(()=>d(s,o("bg-primary animate-[kai-bounce-dots_1.4s_ease-in-out_infinite] rounded-full",a[e()]))),s})()}),l),m(()=>d(i,o("flex items-center space-x-1",r[e()],t.class))),i})()}function B(t){const e=()=>t.size??"md",a={sm:"h-1 w-1",md:"h-1.5 w-1.5",lg:"h-2 w-2"},r={sm:"h-4",md:"h-5",lg:"h-6"};return(()=>{var i=_(),l=i.firstChild;return v(i,n(b,{each:[0,1,2],children:g=>(()=>{var s=w();return x(s,"animation-delay",`${g*250}ms`),m(()=>d(s,o("bg-primary animate-[kai-typing_1s_infinite] rounded-full",a[e()]))),s})()}),l),m(()=>d(i,o("flex items-center space-x-1",r[e()],t.class))),i})()}function D(t){const e=()=>t.size??"md",a={sm:"w-0.5",md:"w-0.5",lg:"w-1"},r={sm:"h-4",md:"h-5",lg:"h-6"},i={sm:["6px","9px","12px","9px","6px"],md:["8px","12px","16px","12px","8px"],lg:["10px","15px","20px","15px","10px"]};return(()=>{var l=_(),g=l.firstChild;return v(l,n(b,{each:[0,1,2,3,4],children:s=>(()=>{var u=w();return x(u,"animation-delay",`${s*100}ms`),m(h=>{var p=o("bg-primary animate-[kai-wave_1s_ease-in-out_infinite] rounded-full",a[e()]),f=i[e()][s];return p!==h.e&&d(u,h.e=p),f!==h.t&&x(u,"height",h.t=f),h},{e:void 0,t:void 0}),u})()}),g),m(()=>d(l,o("flex items-center gap-0.5",r[e()],t.class))),l})()}function E(t){const e=()=>t.size??"md",a={sm:"w-1",md:"w-1.5",lg:"w-2"},r={sm:"h-4 gap-1",md:"h-5 gap-1.5",lg:"h-6 gap-2"};return(()=>{var i=_(),l=i.firstChild;return v(i,n(b,{each:[0,1,2],children:g=>(()=>{var s=w();return x(s,"animation-delay",`${g*.2}s`),m(()=>d(s,o("bg-primary h-full animate-[kai-wave-bars_1.2s_ease-in-out_infinite]",a[e()]))),s})()}),l),m(()=>d(i,o("flex",r[e()],t.class))),i})()}function G(t){const e=()=>t.size??"md",a={sm:"h-3 w-1.5",md:"h-4 w-2",lg:"h-5 w-2.5"},r={sm:"text-xs",md:"text-sm",lg:"text-base"},i={sm:"h-4",md:"h-5",lg:"h-6"};return(()=>{var l=A(),g=l.firstChild,s=g.nextSibling;return m(u=>{var h=o("flex items-center space-x-1",i[e()],t.class),p=o("text-foreground font-mono",r[e()]),f=o("bg-primary animate-[kai-blink_1s_step-end_infinite]",a[e()]);return h!==u.e&&d(l,u.e=h),p!==u.t&&d(g,u.t=p),f!==u.a&&d(s,u.a=f),u},{e:void 0,t:void 0,a:void 0}),l})()}function J(t){const e=()=>t.size??"md",a={sm:"text-xs",md:"text-sm",lg:"text-base"};return(()=>{var r=w();return v(r,()=>t.text??"Thinking"),m(()=>d(r,o("animate-[kai-text-blink_2s_ease-in-out_infinite] font-medium",a[e()],t.class))),r})()}function N(t){const e=()=>t.size??"md",a={sm:"text-xs",md:"text-sm",lg:"text-base"};return(()=>{var r=w();return v(r,()=>t.text??"Thinking"),m(()=>d(r,o("bg-[linear-gradient(to_right,var(--color-muted-foreground)_40%,var(--color-foreground)_60%,var(--color-muted-foreground)_80%)]","bg-size-[200%_auto] bg-clip-text font-medium text-transparent","animate-[kai-shimmer_4s_infinite_linear]",a[e()],t.class))),r})()}function P(t){const e=()=>t.size??"md",a={sm:"text-xs",md:"text-sm",lg:"text-base"};return(()=>{var r=F(),i=r.firstChild;return v(i,()=>t.text??"Thinking"),m(l=>{var g=o("inline-flex items-center",t.class),s=o("text-foreground font-medium",a[e()]);return g!==l.e&&d(r,l.e=g),s!==l.t&&d(i,l.t=s),l},{e:void 0,t:void 0}),r})()}function R(t){return n($,{get fallback(){return n(k,{get size(){return t.size},get class(){return t.class}})},get children(){return[n(c,{get when(){return t.variant==="circular"},get children(){return n(k,{get size(){return t.size},get class(){return t.class}})}}),n(c,{get when(){return t.variant==="classic"},get children(){return n(M,{get size(){return t.size},get class(){return t.class}})}}),n(c,{get when(){return t.variant==="pulse"},get children(){return n(S,{get size(){return t.size},get class(){return t.class}})}}),n(c,{get when(){return t.variant==="pulse-dot"},get children(){return n(j,{get size(){return t.size},get class(){return t.class}})}}),n(c,{get when(){return t.variant==="dots"},get children(){return n(q,{get size(){return t.size},get class(){return t.class}})}}),n(c,{get when(){return t.variant==="typing"},get children(){return n(B,{get size(){return t.size},get class(){return t.class}})}}),n(c,{get when(){return t.variant==="wave"},get children(){return n(D,{get size(){return t.size},get class(){return t.class}})}}),n(c,{get when(){return t.variant==="bars"},get children(){return n(E,{get size(){return t.size},get class(){return t.class}})}}),n(c,{get when(){return t.variant==="terminal"},get children(){return n(G,{get size(){return t.size},get class(){return t.class}})}}),n(c,{get when(){return t.variant==="text-blink"},get children(){return n(J,{get text(){return t.text},get size(){return t.size},get class(){return t.class}})}}),n(c,{get when(){return t.variant==="text-shimmer"},get children(){return n(N,{get text(){return t.text},get size(){return t.size},get class(){return t.class}})}}),n(c,{get when(){return t.variant==="loading-dots"},get children(){return n(P,{get text(){return t.text},get size(){return t.size},get class(){return t.class}})}})]}})}export{R as L};
@@ -1,4 +1,4 @@
1
- var Le=Object.defineProperty,Ie=(n,e,t)=>e in n?Le(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,f=(n,e,t)=>Ie(n,typeof e!="symbol"?e+"":e,t);import{s as Ce,A as Ee,k as ie,i as qe,c as z,r as Be,M as ae,F as Ze,a as oe,Q as De,d as Qe,b as Me,t as je}from"./define-By-uL588.js";import{c as He}from"./cn-DN5AWfiS.js";import{C as Oe,a as Ne}from"./code-block-ClMLKb7C.js";import{i as ce}from"./url-scheme-policy-DR5DgvkM.js";function W(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var v=W();function he(n){v=n}var A={exec:()=>null};function _(n){let e=[];return t=>{let s=Math.max(0,Math.min(3,t-1)),r=e[s];return r||(r=n(s),e[s]=r),r}}function k(n,e=""){let t=typeof n=="string"?n:n.source,s={replace:(r,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(w.caret,"$1"),t=t.replace(r,a),s},getRegex:()=>new RegExp(t,e)};return s}var Ge=((n="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+n)}catch{return!1}})(),w={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:_(n=>new RegExp(`^ {0,${n}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:_(n=>new RegExp(`^ {0,${n}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:_(n=>new RegExp(`^ {0,${n}}(?:\`\`\`|~~~)`)),headingBeginRegex:_(n=>new RegExp(`^ {0,${n}}#`)),htmlBeginRegex:_(n=>new RegExp(`^ {0,${n}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:_(n=>new RegExp(`^ {0,${n}}>`))},Xe=/^(?:[ \t]*(?:\n|$))+/,Fe=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,We=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,C=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Ue=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,U=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,pe=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ue=k(pe).replace(/bull/g,U).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Je=k(pe).replace(/bull/g,U).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),J=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Ke=/^[^\n]+/,K=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ve=k(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",K).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ye=k(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,U).getRegex(),D="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",V=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,et=k("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",V).replace("tag",D).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ge=k(J).replace("hr",C).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",D).getRegex(),tt=k(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ge).getRegex(),Y={blockquote:tt,code:Fe,def:Ve,fences:We,heading:Ue,hr:C,html:et,lheading:ue,list:Ye,newline:Xe,paragraph:ge,table:A,text:Ke},ke=k("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",C).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",D).getRegex(),nt={...Y,lheading:Je,table:ke,paragraph:k(J).replace("hr",C).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ke).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",D).getRegex()},rt={...Y,html:k(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",V).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:A,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:k(J).replace("hr",C).replace("heading",` *#{1,6} *[^
1
+ var Le=Object.defineProperty,Ie=(n,e,t)=>e in n?Le(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,f=(n,e,t)=>Ie(n,typeof e!="symbol"?e+"":e,t);import{s as Ce,A as Ee,k as ie,i as qe,c as z,r as Be,M as ae,F as Ze,a as oe,Q as De,d as Qe,b as Me,t as je}from"./define-CI0y3eE4.js";import{c as He}from"./cn-DN5AWfiS.js";import{C as Oe,a as Ne}from"./code-block-B26t-Q7q.js";import{i as ce}from"./url-scheme-policy-DR5DgvkM.js";function W(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var v=W();function he(n){v=n}var A={exec:()=>null};function _(n){let e=[];return t=>{let s=Math.max(0,Math.min(3,t-1)),r=e[s];return r||(r=n(s),e[s]=r),r}}function k(n,e=""){let t=typeof n=="string"?n:n.source,s={replace:(r,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(w.caret,"$1"),t=t.replace(r,a),s},getRegex:()=>new RegExp(t,e)};return s}var Ge=((n="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+n)}catch{return!1}})(),w={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:_(n=>new RegExp(`^ {0,${n}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:_(n=>new RegExp(`^ {0,${n}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:_(n=>new RegExp(`^ {0,${n}}(?:\`\`\`|~~~)`)),headingBeginRegex:_(n=>new RegExp(`^ {0,${n}}#`)),htmlBeginRegex:_(n=>new RegExp(`^ {0,${n}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:_(n=>new RegExp(`^ {0,${n}}>`))},Xe=/^(?:[ \t]*(?:\n|$))+/,Fe=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,We=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,C=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Ue=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,U=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,pe=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ue=k(pe).replace(/bull/g,U).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Je=k(pe).replace(/bull/g,U).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),J=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Ke=/^[^\n]+/,K=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ve=k(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",K).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ye=k(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,U).getRegex(),D="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",V=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,et=k("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",V).replace("tag",D).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ge=k(J).replace("hr",C).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",D).getRegex(),tt=k(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ge).getRegex(),Y={blockquote:tt,code:Fe,def:Ve,fences:We,heading:Ue,hr:C,html:et,lheading:ue,list:Ye,newline:Xe,paragraph:ge,table:A,text:Ke},ke=k("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",C).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",D).getRegex(),nt={...Y,lheading:Je,table:ke,paragraph:k(J).replace("hr",C).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ke).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",D).getRegex()},rt={...Y,html:k(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",V).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:A,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:k(J).replace("hr",C).replace("heading",` *#{1,6} *[^
2
2
  ]`).replace("lheading",ue).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},st=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,lt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,de=/^( {2,}|\\)\n(?!\s*$)/,it=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,L=/[\p{P}\p{S}]/u,Q=/[\s\p{P}\p{S}]/u,ee=/[^\s\p{P}\p{S}]/u,at=k(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Q).getRegex(),fe=/(?!~)[\p{P}\p{S}]/u,ot=/(?!~)[\s\p{P}\p{S}]/u,ct=/(?:[^\s\p{P}\p{S}]|~)/u,ht=k(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Ge?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),xe=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,pt=k(xe,"u").replace(/punct/g,L).getRegex(),ut=k(xe,"u").replace(/punct/g,fe).getRegex(),be="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",gt=k(be,"gu").replace(/notPunctSpace/g,ee).replace(/punctSpace/g,Q).replace(/punct/g,L).getRegex(),kt=k(be,"gu").replace(/notPunctSpace/g,ct).replace(/punctSpace/g,ot).replace(/punct/g,fe).getRegex(),dt=k("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ee).replace(/punctSpace/g,Q).replace(/punct/g,L).getRegex(),ft=k(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,L).getRegex(),xt="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",bt=k(xt,"gu").replace(/notPunctSpace/g,ee).replace(/punctSpace/g,Q).replace(/punct/g,L).getRegex(),wt=k(/\\(punct)/,"gu").replace(/punct/g,L).getRegex(),mt=k(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),yt=k(V).replace("(?:-->|$)","-->").getRegex(),$t=k("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",yt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),M=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,St=k(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",M).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),we=k(/^!?\[(label)\]\[(ref)\]/).replace("label",M).replace("ref",K).getRegex(),me=k(/^!?\[(ref)\](?:\[\])?/).replace("ref",K).getRegex(),Rt=k("reflink|nolink(?!\\()","g").replace("reflink",we).replace("nolink",me).getRegex(),ye=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,te={_backpedal:A,anyPunctuation:wt,autolink:mt,blockSkip:ht,br:de,code:lt,del:A,delLDelim:A,delRDelim:A,emStrongLDelim:pt,emStrongRDelimAst:gt,emStrongRDelimUnd:dt,escape:st,link:St,nolink:me,punctuation:at,reflink:we,reflinkSearch:Rt,tag:$t,text:it,url:A},Tt={...te,link:k(/^!?\[(label)\]\((.*?)\)/).replace("label",M).getRegex(),reflink:k(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",M).getRegex()},ne={...te,emStrongRDelimAst:kt,emStrongLDelim:ut,delLDelim:ft,delRDelim:bt,url:k(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",ye).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:k(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",ye).getRegex()},zt={...ne,br:k(de).replace("{2,}","*").getRegex(),text:k(ne.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},j={normal:Y,gfm:nt,pedantic:rt},E={normal:te,gfm:ne,breaks:zt,pedantic:Tt},vt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},$e=n=>vt[n];function S(n,e){if(e){if(w.escapeTest.test(n))return n.replace(w.escapeReplace,$e)}else if(w.escapeTestNoEncode.test(n))return n.replace(w.escapeReplaceNoEncode,$e);return n}function Se(n){try{n=encodeURI(n).replace(w.percentDecode,"%")}catch{return null}return n}function Re(n,e){var t;let s=n.replace(w.findPipe,(a,o,l)=>{let h=!1,c=o;for(;--c>=0&&l[c]==="\\";)h=!h;return h?"|":" |"}),r=s.split(w.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!((t=r.at(-1))!=null&&t.trim())&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(w.slashPipe,"|");return r}function R(n,e,t){let s=n.length;if(s===0)return"";let r=0;for(;r<s&&n.charAt(s-r-1)===e;)r++;return n.slice(0,s-r)}function Te(n){let e=n.split(`
3
3
  `),t=e.length-1;for(;t>=0&&w.blankLine.test(e[t]);)t--;return e.length-t<=2?n:e.slice(0,t+1).join(`
4
4
  `)}function At(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let s=0;s<n.length;s++)if(n[s]==="\\")s++;else if(n[s]===e[0])t++;else if(n[s]===e[1]&&(t--,t<0))return s;return t>0?-2:-1}function Pt(n,e=0){let t=e,s="";for(let r of n)if(r===" "){let i=4-t%4;s+=" ".repeat(i),t+=i}else s+=r,t++;return s}function ze(n,e,t,s,r){let i=e.href,a=e.title||null,o=n[1].replace(r.other.outputLinkReplace,"$1");s.state.inLink=!0;let l={type:n[0].charAt(0)==="!"?"image":"link",raw:t,href:i,title:a,text:o,tokens:s.inlineTokens(o)};return s.state.inLink=!1,l}function _t(n,e,t){let s=n.match(t.other.indentCodeCompensation);if(s===null)return e;let r=s[1];return e.split(`
package/dist/mcp.es.js CHANGED
@@ -7794,14 +7794,18 @@ function renderSolid(components, ctx) {
7794
7794
  `//`,
7795
7795
  `// SETUP, once. These components are Tailwind-v4 SOURCE (not shadow-encapsulated),`,
7796
7796
  `// so their class names have to reach YOUR stylesheet:`,
7797
- `// npm i -D tailwindcss @tailwindcss/vite vite-plugin-solid`,
7797
+ `// npm i -D tailwindcss @tailwindcss/vite vite-plugin-solid tw-animate-css @tailwindcss/typography`,
7798
7798
  `// vite.config.ts -> plugins: [solid(), tailwindcss()]`,
7799
7799
  `// src/styles.css -> @import "tailwindcss";`,
7800
- `// @import "@kitn.ai/ui/theme.css"; /* --color-* tokens */`,
7800
+ `// @import "@kitn.ai/ui/solid.css"; /* tokens + base rules + plugins */`,
7801
7801
  `// @source "../node_modules/@kitn.ai/ui"; /* scan the kit for classes */`,
7802
7802
  `// The @source line is NOT optional: without it Tailwind scans only src/, strips`,
7803
7803
  `// every kit utility class as unused, and the whole UI renders unstyled.`,
7804
- `// (theme.css here, not theme.tokens.css: this app compiles Tailwind itself.)`,
7804
+ `// solid.css, not theme.css: theme.css is the tokens only. solid.css imports it and`,
7805
+ `// adds what the kai-* elements carry in their shadow roots and this app has to`,
7806
+ `// compile itself: the form-control and focus-ring rules, tw-animate-css (every`,
7807
+ `// overlay animation) and the typography plugin (prose-sm/prose-lg). The two`,
7808
+ `// plugins are optional peers of the kit, hence the extra installs above.`,
7805
7809
  `import { For, Index, Match, Show, Switch, ${block ? "createEffect, " : ""}createMemo, createSignal${block ? ", onCleanup" : ""} } from 'solid-js';`,
7806
7810
  // '@kitn.ai/ui/solid', NOT the root '@kitn.ai/ui', and the difference is
7807
7811
  // invisible to every compiler on this repo's critical path: src/solid.ts is
@@ -8997,7 +9001,7 @@ const scaffold = {
8997
9001
  );
8998
9002
  }
8999
9003
  };
9000
- const themeCss = "/* @kitn.ai/ui design system — import after `@import \"tailwindcss\"`.\n Defines ONLY namespaced (--color-*) tokens, component keyframes, animation\n utilities, and the .chat-markdown styles. Contains NO global base/reset rules,\n so importing it restyles nothing on its own — a host opts in via the kit's\n components + classes. Rebrand by overriding the --color-* values (optionally\n scoped to a subtree).\n NOTE: This file is Tailwind-v4 source (requires tailwindcss as a peer). For\n bundler-based apps that don't use Tailwind, import @kitn.ai/ui/theme.tokens.css\n instead — it is plain compiled CSS with no toolchain requirements. */\n\n@custom-variant dark (&:is(.dark *));\n\n@theme {\n --color-background: var(--kai-color-background, hsl(0 0% 100%));\n --color-foreground: var(--kai-color-foreground, hsl(240 10% 3.9%));\n --color-card: var(--kai-color-card, hsl(0 0% 100%));\n --color-card-foreground: var(--kai-color-card-foreground, hsl(240 10% 3.9%));\n --color-popover: var(--kai-color-popover, hsl(0 0% 100%));\n --color-popover-foreground: var(--kai-color-popover-foreground, hsl(240 10% 3.9%));\n --color-primary: var(--kai-color-primary, hsl(240 5.9% 10%));\n --color-primary-foreground: var(--kai-color-primary-foreground, hsl(0 0% 98%));\n --color-secondary: var(--kai-color-secondary, hsl(240 4.8% 95.9%));\n --color-secondary-foreground: var(--kai-color-secondary-foreground, hsl(240 5.9% 10%));\n --color-muted: var(--kai-color-muted, hsl(240 4.8% 95.9%));\n --color-muted-foreground: var(--kai-color-muted-foreground, hsl(240 3.8% 43%));\n /* Subtle SURFACE — an opaque \"muted panel\" for things that sit OVER content\n (the prompt input, message bubbles, artifact/card headers, chips). CALCULATED\n from existing tokens — `--color-muted` blended 40% onto `--color-background`\n — so it tracks the theme (incl. dark) automatically and needs no hand-picked\n value. SOLID (no alpha), so nothing behind it bleeds through. This replaces\n ad-hoc `bg-muted/40` surfaces. Retint via the --kai-color-surface knob (or a\n bare value); --color-surface-strong is the stronger step (hover/raised) and\n --color-surface-sunken is recessed BELOW the base surface (wells, or a banner\n that sits behind a card). Sunken is theme-specific: \"darker than the card\"\n means a LOWER muted% in dark but a HIGHER one in light, so the two scopes\n can't share a number — see the .dark block. */\n --color-surface: var(--kai-color-surface, color-mix(in srgb, var(--color-muted) 40%, var(--color-background)));\n --color-surface-strong: var(--kai-color-surface-strong, color-mix(in srgb, var(--color-muted) 60%, var(--color-background)));\n --color-surface-sunken: var(--kai-color-surface-sunken, color-mix(in srgb, var(--color-muted) 85%, var(--color-background)));\n --color-accent: var(--kai-color-accent, hsl(240 4.8% 95.9%));\n --color-accent-foreground: var(--kai-color-accent-foreground, hsl(240 5.9% 10%));\n --color-destructive: var(--kai-color-destructive, hsl(0 72% 45%));\n --color-destructive-foreground: var(--kai-color-destructive-foreground, hsl(0 0% 98%));\n /* Semantic status colors - solid fills with a legible foreground, matched to\n the kit's tool-green / -amber / -blue hues so they read on-brand. Use\n bg-success / bg-warning / bg-info with the matching -foreground for badges,\n banners, and buttons; or text-success / -warning / -info on a soft tint\n (below). destructive (above) is the danger/error member of the same family.\n Light uses darker hues so the color carries a light foreground AND stays\n legible as text on a pale tint; dark (see .dark) flips to brighter hues over\n a near-black foreground. Override via --kai-color-success / -warning / -info\n (+ -foreground). */\n --color-success: var(--kai-color-success, hsl(142 71% 30%));\n --color-success-foreground: var(--kai-color-success-foreground, hsl(0 0% 98%));\n --color-warning: var(--kai-color-warning, hsl(38 92% 30%));\n --color-warning-foreground: var(--kai-color-warning-foreground, hsl(0 0% 98%));\n --color-info: var(--kai-color-info, hsl(217 91% 42%));\n --color-info-foreground: var(--kai-color-info-foreground, hsl(0 0% 98%));\n /* Soft tinted status surfaces - OPAQUE, theme-tracking fills derived as ~14% of\n the status hue blended onto the background. Use these for subtle callouts /\n banners instead of an eyeballed bg-success/10; pair with text-success /\n -warning / -info / -destructive. Derived, so declared in BOTH light and dark\n (a color-mix resolves where it's declared - see the surface tokens above). A\n bare bg- utility for a color-mix token is added at the bottom (see bg-surface). */\n --color-success-soft: var(--kai-color-success-soft, color-mix(in oklab, var(--color-success) 14%, var(--color-background)));\n --color-warning-soft: var(--kai-color-warning-soft, color-mix(in oklab, var(--color-warning) 14%, var(--color-background)));\n --color-info-soft: var(--kai-color-info-soft, color-mix(in oklab, var(--color-info) 14%, var(--color-background)));\n --color-destructive-soft: var(--kai-color-destructive-soft, color-mix(in oklab, var(--color-destructive) 14%, var(--color-background)));\n /* Interaction-state backgrounds - opaque, theme-tracking fills for row/control\n states so consumers stop eyeballing /10 opacities. --color-hover is a subtle\n neutral (a little --color-muted on the background); --color-selected is a\n faint --color-primary tint so a selected row tracks the brand. Use bg-hover /\n bg-selected. Derived, so declared in BOTH light and dark; bare bg- utilities\n added at the bottom. */\n --color-hover: var(--kai-color-hover, color-mix(in oklab, var(--color-muted) 60%, var(--color-background)));\n --color-selected: var(--kai-color-selected, color-mix(in oklab, var(--color-primary) 8%, var(--color-background)));\n /* UNREAD indicator — a dedicated token (owner ruling, 2026-08-26), not a\n reuse of --color-destructive: unread is notification semantics, not\n error, so a consumer re-theming \"danger\" red must not also move every\n unread dot. Used identically by all three places an unread conversation\n surfaces: the list-row trailing dot (ConversationPanel), the header\n toggle's badge (ChatThread), and Dock's own closed-launcher badge.\n A vivid \"messenger red\" (Tailwind red-500 territory, the Intercom/iOS\n badge convention) rather than the darker --color-destructive hue: the\n first pass at this token picked a color that read as legible-on-paper\n but visually flat/dark next to the launcher's near-black ring. This one\n value is used in BOTH light and dark (no .dark override below) because\n it independently clears 3:1 (WCAG 1.4.11, non-text) against every real\n surface an unread dot sits on in EITHER mode: light row/card background\n (white) 3.78:1, light Dock-launcher ring (--color-primary, near-black)\n 4.68:1, dark row/card background (near-black) 4.73–4.35:1, dark\n Dock-launcher ring (--color-primary, near-white) 3.62:1. (Measured via\n the WCAG relative-luminance formula against this file's own light/dark\n --color-background/-card/-primary values — see\n .superpowers/sdd/2026-08-26-conversations/rework-report.md Round 4 for\n the worked numbers.) Override via --kai-color-unread; a construct author\n can also set it per-widget through `theme.unreadColor` (construct\n vocabulary — see agent-tooling/construct/schema.ts). */\n --color-unread: var(--kai-color-unread, hsl(0 84% 60%));\n /* MARKED text — the fill behind a keyword the app has flagged (the composer's\n `highlights` rules, decorated through the CSS Custom Highlight API). This is\n `<mark>`, not a selection and not a status: a warm yellow, the convention\n every browser already ships for <mark> and every reader already reads as\n \"someone marked this\". Deliberately NOT derived from --color-primary — that\n token is a NEUTRAL near-black in light and near-white in dark, so any tint of\n it is grey, which is why the highlight used to be invisible. Also not blue\n (the browser's own ::selection is blue — a highlight must not read as a\n selection), not red (error) and not the skill/agent pill hues (blue/violet).\n OPAQUE, so it composites predictably over whichever field it lands on.\n Override via --kai-color-highlight. Light: near-black text over it is 15.6:1;\n dark: near-white text over it is 6.7:1 — both well clear of WCAG AA. */\n --color-highlight: var(--kai-color-highlight, hsl(45 96% 78%));\n /* SELECTED text — the kit's own ::selection fill, applied inside every kai-*\n shadow root (see src/elements/styles.css for the scoping rationale). The kit\n owns this because leaving it to the UA meant the browser's blue outranked the\n kit's own deliberate emphasis: a marked keyword was LESS prominent than an\n incidental drag-select. Stays in the cool/blue family the UA trained everyone\n to read as \"selected\", so it can never be confused with the warm --color-highlight\n mark above; OPAQUE, so a selection over a mark composites cleanly (selection\n paints on top of a custom highlight) instead of muddying into a third colour.\n The FOREGROUND is set too, and that is not cosmetic: without it the selected\n glyph keeps its own colour, and the kit's coloured text — muted text (3.8:1),\n the skill/agent pill hues (3.6:1 / 4.0:1), inline code (4.7:1) — lands at or\n under WCAG AA on this fill. Forcing the foreground token makes the guarantee\n hold for every glyph regardless of what colour it had. Light 13.99:1,\n dark 8.87:1. Override via --kai-color-selection(-foreground). */\n --color-selection: var(--kai-color-selection, hsl(213 94% 87%));\n --color-selection-foreground: var(--kai-color-selection-foreground, hsl(240 10% 3.9%));\n --color-border: var(--kai-color-border, hsl(240 5.9% 90%));\n /* CONTROL boundary — the visible edge of an interactive form control (text\n input, textarea, select, the radio/checkbox ring). WCAG 2.1 SC 1.4.11\n Non-text Contrast requires >=3:1 against the adjacent surface for exactly\n this: a control whose boundary you cannot see is not perceivable. That is\n why this is NOT --color-border: a divider or a card outline is decorative\n and may sit below 3:1, a control's edge may not. Do NOT use border-input\n for list wrappers or panel outlines — use border-border there.\n Contrast is the requirement; a thicker border does not satisfy 1.4.11. */\n --color-input: var(--kai-color-input, hsl(240 5% 53%));\n /* Focus ring — a deliberate blue (not a neutral) so keyboard focus is always\n obvious and on-brand in both modes. Light uses a strong blue; dark uses a\n brighter one for contrast on dark surfaces. Both clear WCAG 2.1 non-text\n contrast (≥3:1) against the kit's backgrounds. Override via --kai-color-ring. */\n --color-ring: var(--kai-color-ring, hsl(217 91% 53%));\n /* Custom scrollbars — thin, rounded, subtle; thumb strengthens on hover. A\n consistent cross-platform look (the kit styles its OWN scroll regions inside\n the shadow root; the track stays transparent so nothing is forced where no\n scrollbar is needed). Override via --kai-color-scrollbar-thumb(-hover). */\n --color-scrollbar-thumb: var(--kai-color-scrollbar-thumb, hsl(240 5% 80%));\n --color-scrollbar-thumb-hover: var(--kai-color-scrollbar-thumb-hover, hsl(240 4% 64%));\n --color-sidebar: var(--kai-color-sidebar, hsl(0 0% 100%));\n\n /* Inline `code` accent. Blue text on a translucent blue chip. */\n --color-code-foreground: var(--kai-color-code-foreground, hsl(224.3 76.3% 48%));\n\n /* Tool/status chip hues. Each chip is hue text over a 15% translucent fill of\n the SAME hue (set in tool.tsx). The bare hue is too light to reach WCAG AA\n (4.5:1) on the faint fill in LIGHT mode, so the light values are darkened;\n dark mode keeps brighter hues for AA on the dark fill. Override via\n --kai-color-tool-* to retheme. */\n --color-tool-blue: var(--kai-color-tool-blue, hsl(217 91% 38%));\n --color-tool-amber: var(--kai-color-tool-amber, hsl(38 92% 28%));\n --color-tool-green: var(--kai-color-tool-green, hsl(142 71% 26%));\n --color-tool-red: var(--kai-color-tool-red, hsl(0 72% 42%));\n\n --radius: var(--kai-radius, 0.6rem);\n --radius-sm: calc(var(--radius) - 4px);\n --radius-md: calc(var(--radius) - 2px);\n --radius-lg: var(--radius);\n --radius-xl: calc(var(--radius) + 4px);\n\n /* Typography scale — ONE scale for the whole kit. Each semantic name\n (text-micro / text-caption / text-meta / text-compact / text-body /\n text-title / text-lg)\n resolves through a namespaced --kai-text-* token, so overriding that token\n on :root restyles the kit globally — it pierces the Shadow DOM via the\n var() fallback, exactly like the --kai-color-* tokens. The bare --text-*\n names stay internal so a host's own --text-* can't collide.\n\n Tailwind's OWN scale is re-pointed at the same tokens: in Tailwind v4 the\n `text-xs` / `text-sm` / `text-base` / `text-lg` utilities are generated FROM\n --text-xs/sm/base/lg in this very @theme block, so aliasing them makes\n text-xs ≡ text-meta, text-sm ≡ text-body, text-base ≡ text-title and\n text-lg ≡ text-lg. That matters because the vast majority of the kit's call\n sites spell the Tailwind name; without the alias the --kai-text-* knobs\n reached ~12% of them and the \"globally\" promise in the theming guide was\n false. Defaults are byte-identical to stock Tailwind, so nothing moves\n until a consumer actually sets a --kai-text-* token — including in a\n consumer's own Tailwind build that imports this file, which is the point:\n one scale everywhere, kit and app moving together.\n\n Line-heights are UNITLESS RATIOS (Tailwind's own), never fixed rem. A fixed\n leading does not scale: --kai-text-body: 1.25rem under the old 1.45rem\n leading gave 20px text on 23.2px leading — near solid-set — which made the\n themable token unsafe to actually theme.\n (Message/markdown reading size also scales with the `proseSize` prop; these\n tokens cover the fixed chrome & controls.) */\n --text-micro: var(--kai-text-micro, 0.625rem); --text-micro--line-height: calc(0.875 / 0.625); /* 10px — badges, pills, uppercase eyebrows */\n --text-caption: var(--kai-text-caption, 0.6875rem); --text-caption--line-height: calc(1 / 0.6875); /* 11px — micro labels, sub-counts, xs code */\n --text-meta: var(--kai-text-meta, 0.75rem); --text-meta--line-height: calc(1 / 0.75); /* 12px — controls, toggles, switchers, captions */\n --text-xs: var(--kai-text-meta, 0.75rem); --text-xs--line-height: calc(1 / 0.75); /* ≡ text-meta */\n --text-compact: var(--kai-text-compact, 0.8125rem); --text-compact--line-height: calc(1.21875 / 0.8125); /* 13px — dense chrome & code: a notch below body */\n --text-body: var(--kai-text-body, 0.875rem); --text-body--line-height: calc(1.25 / 0.875); /* 14px — primary reading text */\n --text-sm: var(--kai-text-body, 0.875rem); --text-sm--line-height: calc(1.25 / 0.875); /* ≡ text-body */\n --text-title: var(--kai-text-title, 1rem); --text-title--line-height: calc(1.5 / 1); /* 16px — emphasis / headers */\n --text-base: var(--kai-text-title, 1rem); --text-base--line-height: calc(1.5 / 1); /* ≡ text-title */\n --text-lg: var(--kai-text-lg, 1.125rem); --text-lg--line-height: calc(1.75 / 1.125); /* 18px — section headings, lg prose */\n\n @keyframes typing { 0%,100% { transform: translateY(0); opacity: .5 } 50% { transform: translateY(-2px); opacity: 1 } }\n @keyframes loading-dots { 0%,100% { opacity: 0 } 50% { opacity: 1 } }\n @keyframes wave { 0%,100% { transform: scaleY(1) } 50% { transform: scaleY(.6) } }\n @keyframes blink { 0%,100% { opacity: 1 } 50% { opacity: 0 } }\n @keyframes text-blink { 0%,100% { color: var(--color-primary) } 50% { color: var(--color-muted-foreground) } }\n @keyframes bounce-dots { 0%,100% { transform: scale(.8); opacity: .5 } 50% { transform: scale(1.2); opacity: 1 } }\n @keyframes thin-pulse { 0%,100% { transform: scale(.95); opacity: .8 } 50% { transform: scale(1.05); opacity: .4 } }\n @keyframes pulse-dot { 0%,100% { transform: scale(1); opacity: .8 } 50% { transform: scale(1.5); opacity: 1 } }\n @keyframes shimmer-text { 0% { background-position: 150% center } 100% { background-position: -150% center } }\n @keyframes wave-bars { 0%,100% { transform: scaleY(1); opacity: .5 } 50% { transform: scaleY(.6); opacity: 1 } }\n @keyframes shimmer { 0% { background-position: 200% 50% } 100% { background-position: -200% 50% } }\n @keyframes spinner-fade { 0% { opacity: 0 } 100% { opacity: 1 } }\n @keyframes collapsible-down { from { height: 0; opacity: 0 } to { height: var(--kb-collapsible-content-height); opacity: 1 } }\n @keyframes collapsible-up { from { height: var(--kb-collapsible-content-height); opacity: 1 } to { height: 0; opacity: 0 } }\n}\n\n.dark {\n --color-background: var(--kai-color-background, hsl(50 2% 9%));\n --color-foreground: var(--kai-color-foreground, hsl(0 0% 98%));\n --color-card: var(--kai-color-card, hsl(45 4% 12%));\n --color-card-foreground: var(--kai-color-card-foreground, hsl(0 0% 98%));\n --color-popover: var(--kai-color-popover, hsl(45 4% 12%));\n --color-popover-foreground: var(--kai-color-popover-foreground, hsl(0 0% 98%));\n --color-primary: var(--kai-color-primary, hsl(0 0% 98%));\n --color-primary-foreground: var(--kai-color-primary-foreground, hsl(45 4% 11%));\n --color-secondary: var(--kai-color-secondary, hsl(45 4% 17%));\n --color-secondary-foreground: var(--kai-color-secondary-foreground, hsl(0 0% 98%));\n --color-muted: var(--kai-color-muted, hsl(45 4% 17%));\n --color-muted-foreground: var(--kai-color-muted-foreground, hsl(45 4% 64%));\n /* Re-declared in the dark scope so the color-mix recomputes with the DARK\n muted/background (a derived token is computed where it's declared, not where\n it's used — see the light --color-surface for the full note). */\n --color-surface: var(--kai-color-surface, color-mix(in srgb, var(--color-muted) 40%, var(--color-background)));\n --color-surface-strong: var(--kai-color-surface-strong, color-mix(in srgb, var(--color-muted) 60%, var(--color-background)));\n /* Sunken: in dark a LOWER muted% is darker (blends toward the dark background). */\n --color-surface-sunken: var(--kai-color-surface-sunken, color-mix(in srgb, var(--color-muted) 18%, var(--color-background)));\n --color-accent: var(--kai-color-accent, hsl(45 4% 17%));\n --color-accent-foreground: var(--kai-color-accent-foreground, hsl(0 0% 98%));\n --color-destructive: var(--kai-color-destructive, hsl(0 62.8% 30.6%));\n --color-destructive-foreground: var(--kai-color-destructive-foreground, hsl(0 0% 98%));\n /* Semantic status colors - dark mode flips to the brighter tool-* dark hues\n (matching the chip values) carried over a near-black foreground, so the color\n both reads as text on a dark soft tint AND backs a legible foreground. See\n the light @theme note. */\n --color-success: var(--kai-color-success, hsl(142 71% 45%));\n --color-success-foreground: var(--kai-color-success-foreground, hsl(45 4% 11%));\n --color-warning: var(--kai-color-warning, hsl(38 92% 50%));\n --color-warning-foreground: var(--kai-color-warning-foreground, hsl(45 4% 11%));\n --color-info: var(--kai-color-info, hsl(217 91% 70%));\n --color-info-foreground: var(--kai-color-info-foreground, hsl(45 4% 11%));\n /* Soft status surfaces + interaction states - re-declared so each color-mix\n recomputes with the DARK hues/background (a derived token resolves where it's\n declared; see the light block for the full note). */\n --color-success-soft: var(--kai-color-success-soft, color-mix(in oklab, var(--color-success) 14%, var(--color-background)));\n --color-warning-soft: var(--kai-color-warning-soft, color-mix(in oklab, var(--color-warning) 14%, var(--color-background)));\n --color-info-soft: var(--kai-color-info-soft, color-mix(in oklab, var(--color-info) 14%, var(--color-background)));\n --color-destructive-soft: var(--kai-color-destructive-soft, color-mix(in oklab, var(--color-destructive) 14%, var(--color-background)));\n --color-hover: var(--kai-color-hover, color-mix(in oklab, var(--color-muted) 60%, var(--color-background)));\n --color-selected: var(--kai-color-selected, color-mix(in oklab, var(--color-primary) 8%, var(--color-background)));\n /* Unread indicator — dark. Same value as light (see the light block for the\n full contrast note): one vivid red independently clears 3:1 against both\n modes' real surfaces, so there is nothing to flip here. Still redeclared\n for override symmetry with every other semantic color in this file. */\n --color-unread: var(--kai-color-unread, hsl(0 84% 60%));\n /* Marked text — dark. A deep warm amber rather than the light yellow: a pale\n highlighter on a near-black field would blow out and force the text to flip\n colour. See the light block for the full note. */\n --color-highlight: var(--kai-color-highlight, hsl(40 75% 26%));\n /* Selected text — dark. A deep blue rather than the light one, for the same\n reason the mark darkens. See the light block for the full note. */\n --color-selection: var(--kai-color-selection, hsl(217 60% 32%));\n --color-selection-foreground: var(--kai-color-selection-foreground, hsl(0 0% 98%));\n --color-border: var(--kai-color-border, hsl(45 4% 17%));\n /* Control boundary — see the light block. Lifted to clear 3:1 (SC 1.4.11)\n against the dark background and card surfaces. */\n --color-input: var(--kai-color-input, hsl(45 4% 48%));\n --color-ring: var(--kai-color-ring, hsl(217 91% 68%));\n --color-scrollbar-thumb: var(--kai-color-scrollbar-thumb, hsl(45 3% 30%));\n --color-scrollbar-thumb-hover: var(--kai-color-scrollbar-thumb-hover, hsl(45 3% 42%));\n --color-sidebar: var(--kai-color-sidebar, hsl(50 2% 7%));\n --color-code-foreground: var(--kai-color-code-foreground, hsl(213 94% 78%));\n\n /* Tool/status chip hues — dark mode. Brighter hues reach AA on the dark fill. */\n --color-tool-blue: var(--kai-color-tool-blue, hsl(217 91% 70%));\n --color-tool-amber: var(--kai-color-tool-amber, hsl(38 92% 50%));\n --color-tool-green: var(--kai-color-tool-green, hsl(142 71% 45%));\n --color-tool-red: var(--kai-color-tool-red, hsl(0 84% 70%));\n}\n\n/* Self-contained markdown styling — replaces the typography plugin's `prose`.\n Keyed on --color-* tokens so it themes with the rest of the kit. */\n.chat-markdown { color: var(--color-foreground); line-height: 1.6; }\n.chat-markdown > div:first-child > :first-child { margin-top: 0; }\n.chat-markdown > div:last-child > :last-child { margin-bottom: 0; }\n.chat-markdown p { margin: 0 0 0.75em; }\n.chat-markdown p:last-child { margin-bottom: 0; }\n.chat-markdown h1, .chat-markdown h2, .chat-markdown h3, .chat-markdown h4 {\n margin: 1.2em 0 0.5em; font-weight: 600; line-height: 1.3; color: var(--color-foreground);\n}\n.chat-markdown h1 { font-size: 1.4em; } .chat-markdown h2 { font-size: 1.25em; }\n.chat-markdown h3 { font-size: 1.1em; } .chat-markdown h4 { font-size: 1em; }\n.chat-markdown ul, .chat-markdown ol { margin: 0 0 0.75em; padding-left: 1.4em; }\n.chat-markdown li { margin: 0.2em 0; }\n.chat-markdown ul { list-style: disc; } .chat-markdown ol { list-style: decimal; }\n.chat-markdown a { color: var(--color-primary); text-decoration: underline; text-underline-offset: 2px; }\n.chat-markdown strong { font-weight: 600; color: var(--color-foreground); }\n.chat-markdown em { font-style: italic; }\n.chat-markdown blockquote {\n margin: 0 0 0.75em; padding-left: 0.9em; border-left: 2px solid var(--color-border);\n color: var(--color-muted-foreground);\n}\n.chat-markdown hr { margin: 1em 0; border: 0; border-top: 1px solid var(--color-border); }\n.chat-markdown code:not(pre code) {\n background: color-mix(in oklab, var(--color-code-foreground) 15%, transparent);\n color: var(--color-code-foreground);\n border-radius: 4px; padding: 0.1em 0.35em; font-size: 0.875em;\n font-family: var(--kai-font-code, ui-monospace, \"SF Mono\", Menlo, monospace);\n}\n.chat-markdown table { width: 100%; border-collapse: collapse; margin: 0 0 0.75em; font-size: 0.9em; }\n.chat-markdown th, .chat-markdown td { border: 1px solid var(--color-border); padding: 0.4em 0.6em; text-align: left; }\n.chat-markdown th { font-weight: 600; background: color-mix(in oklab, var(--color-muted-foreground) 8%, transparent); }\n\n/* Themeable elevation. The kit is mostly flat (borders), but a few surfaces lift\n off the page — popovers, dropdowns, hover cards, cards. The shadow COLOR is a\n token (--kai-shadow-color, default near-black); set it transparent for a fully\n flat look, or tint it to match a theme. Defined here (not as a Tailwind shadow\n utility) so the color stays overridable and works in both the web-component and\n SolidJS layers. */\n.kai-elevation {\n box-shadow:\n 0 4px 12px -2px color-mix(in oklab, var(--kai-shadow-color, oklch(0 0 0)) 14%, transparent),\n 0 2px 6px -2px color-mix(in oklab, var(--kai-shadow-color, oklch(0 0 0)) 10%, transparent);\n}\n.kai-elevation-sm {\n box-shadow: 0 1px 2px 0 color-mix(in oklab, var(--kai-shadow-color, oklch(0 0 0)) 8%, transparent);\n}\n\n/* Cross-platform thin scrollbar utility (Firefox + WebKit). Used by ScrollArea\n and any scroll region in the SolidJS-component build (web components also get\n this globally inside their shadow root — see src/elements/styles.css). */\n.scrollbar-thin {\n scrollbar-width: thin;\n scrollbar-color: var(--color-scrollbar-thumb) transparent;\n}\n.scrollbar-thin::-webkit-scrollbar { width: 8px; height: 8px; }\n.scrollbar-thin::-webkit-scrollbar-track { background: transparent; }\n.scrollbar-thin::-webkit-scrollbar-thumb {\n background-color: var(--color-scrollbar-thumb);\n border-radius: 9999px;\n border: 2px solid transparent;\n background-clip: padding-box;\n}\n.scrollbar-thin::-webkit-scrollbar-thumb:hover { background-color: var(--color-scrollbar-thumb-hover); }\n.scrollbar-thin::-webkit-scrollbar-corner { background: transparent; }\n\n/* Surface utilities — `bg-surface` / `bg-surface-strong` paint the opaque,\n theme-derived surface tokens (see --color-surface above). Defined explicitly\n because a color-mix-valued @theme token does NOT emit a bare `bg-` utility on\n its own (only opacity variants). Use these for panels that sit OVER content\n instead of `bg-muted/NN`. */\n@utility bg-surface {\n background-color: var(--color-surface);\n}\n@utility bg-surface-strong {\n background-color: var(--color-surface-strong);\n}\n@utility bg-surface-sunken {\n background-color: var(--color-surface-sunken);\n}\n\n/* Soft-status + interaction-state utilities. Same reason as bg-surface above: a\n color-mix-valued @theme token does NOT emit a bare `bg-` utility on its own, so\n bg-success-soft / bg-warning-soft / bg-info-soft / bg-destructive-soft and\n bg-hover / bg-selected are declared here. (The SOLID tokens - success / warning\n / info + their -foreground - are plain hsl values, so bg-success / text-success\n etc. ARE auto-generated by @theme and need no explicit utility.) */\n@utility bg-success-soft {\n background-color: var(--color-success-soft);\n}\n@utility bg-warning-soft {\n background-color: var(--color-warning-soft);\n}\n@utility bg-info-soft {\n background-color: var(--color-info-soft);\n}\n@utility bg-destructive-soft {\n background-color: var(--color-destructive-soft);\n}\n@utility bg-hover {\n background-color: var(--color-hover);\n}\n@utility bg-selected {\n background-color: var(--color-selected);\n}\n";
9004
+ const themeCss = "/* @kitn.ai/ui design system — import after `@import \"tailwindcss\"`.\n Defines the shadcn-style (--color-*) tokens, component keyframes, animation\n utilities, and the .chat-markdown styles. Contains NO global base/reset rules,\n so importing it restyles nothing on its own — a host opts in via the kit's\n components + classes. Rebrand by overriding the --color-* values (optionally\n scoped to a subtree).\n NOTE: This file is Tailwind-v4 source (requires tailwindcss as a peer). For\n bundler-based apps that don't use Tailwind, import @kitn.ai/ui/theme.tokens.css\n instead — it is plain compiled CSS with no toolchain requirements.\n\n THIS FILE IS MERGED INTO THE CONSUMER'S TAILWIND BUILD when they @import it,\n so everything at global scope here lands in THEIR namespace. What it changes\n for them (documented in apps/docs/.../guides/theming.mdx, keep the two in sync):\n - `@custom-variant dark` below switches their `dark:` utilities from\n prefers-color-scheme to the `.dark` class.\n - the `--color-*` names merge into their @theme (last import wins).\n - `--radius-sm/md/lg/xl` re-point Tailwind's stock radius scale at --radius.\n - `--text-xs/sm/base/lg` are aliased onto the kit's type scale (defaults\n equal stock Tailwind, so nothing moves until a --kai-text-* token is set).\n Everything else global carries a `kai-` prefix so it cannot clash by name:\n every @keyframes is `kai-<name>`, the scrollbar utility is `.kai-scrollbar-thin`.\n The one unprefixed global class is `.chat-markdown` (public; renaming it is a\n breaking change). tests/elements/theme-globals.test.ts pins the prefix rule\n and that every animation reference in src/ resolves to a keyframe here. */\n\n@custom-variant dark (&:is(.dark *));\n\n@theme {\n --color-background: var(--kai-color-background, hsl(0 0% 100%));\n --color-foreground: var(--kai-color-foreground, hsl(240 10% 3.9%));\n --color-card: var(--kai-color-card, hsl(0 0% 100%));\n --color-card-foreground: var(--kai-color-card-foreground, hsl(240 10% 3.9%));\n --color-popover: var(--kai-color-popover, hsl(0 0% 100%));\n --color-popover-foreground: var(--kai-color-popover-foreground, hsl(240 10% 3.9%));\n --color-primary: var(--kai-color-primary, hsl(240 5.9% 10%));\n --color-primary-foreground: var(--kai-color-primary-foreground, hsl(0 0% 98%));\n --color-secondary: var(--kai-color-secondary, hsl(240 4.8% 95.9%));\n --color-secondary-foreground: var(--kai-color-secondary-foreground, hsl(240 5.9% 10%));\n --color-muted: var(--kai-color-muted, hsl(240 4.8% 95.9%));\n --color-muted-foreground: var(--kai-color-muted-foreground, hsl(240 3.8% 43%));\n /* Subtle SURFACE — an opaque \"muted panel\" for things that sit OVER content\n (the prompt input, message bubbles, artifact/card headers, chips). CALCULATED\n from existing tokens — `--color-muted` blended 40% onto `--color-background`\n — so it tracks the theme (incl. dark) automatically and needs no hand-picked\n value. SOLID (no alpha), so nothing behind it bleeds through. This replaces\n ad-hoc `bg-muted/40` surfaces. Retint via the --kai-color-surface knob (or a\n bare value); --color-surface-strong is the stronger step (hover/raised) and\n --color-surface-sunken is recessed BELOW the base surface (wells, or a banner\n that sits behind a card). Sunken is theme-specific: \"darker than the card\"\n means a LOWER muted% in dark but a HIGHER one in light, so the two scopes\n can't share a number — see the .dark block. */\n --color-surface: var(--kai-color-surface, color-mix(in srgb, var(--color-muted) 40%, var(--color-background)));\n --color-surface-strong: var(--kai-color-surface-strong, color-mix(in srgb, var(--color-muted) 60%, var(--color-background)));\n --color-surface-sunken: var(--kai-color-surface-sunken, color-mix(in srgb, var(--color-muted) 85%, var(--color-background)));\n --color-accent: var(--kai-color-accent, hsl(240 4.8% 95.9%));\n --color-accent-foreground: var(--kai-color-accent-foreground, hsl(240 5.9% 10%));\n --color-destructive: var(--kai-color-destructive, hsl(0 72% 45%));\n --color-destructive-foreground: var(--kai-color-destructive-foreground, hsl(0 0% 98%));\n /* Semantic status colors - solid fills with a legible foreground, matched to\n the kit's tool-green / -amber / -blue hues so they read on-brand. Use\n bg-success / bg-warning / bg-info with the matching -foreground for badges,\n banners, and buttons; or text-success / -warning / -info on a soft tint\n (below). destructive (above) is the danger/error member of the same family.\n Light uses darker hues so the color carries a light foreground AND stays\n legible as text on a pale tint; dark (see .dark) flips to brighter hues over\n a near-black foreground. Override via --kai-color-success / -warning / -info\n (+ -foreground). */\n --color-success: var(--kai-color-success, hsl(142 71% 30%));\n --color-success-foreground: var(--kai-color-success-foreground, hsl(0 0% 98%));\n --color-warning: var(--kai-color-warning, hsl(38 92% 30%));\n --color-warning-foreground: var(--kai-color-warning-foreground, hsl(0 0% 98%));\n --color-info: var(--kai-color-info, hsl(217 91% 42%));\n --color-info-foreground: var(--kai-color-info-foreground, hsl(0 0% 98%));\n /* Soft tinted status surfaces - OPAQUE, theme-tracking fills derived as ~14% of\n the status hue blended onto the background. Use these for subtle callouts /\n banners instead of an eyeballed bg-success/10; pair with text-success /\n -warning / -info / -destructive. Derived, so declared in BOTH light and dark\n (a color-mix resolves where it's declared - see the surface tokens above). A\n bare bg- utility for a color-mix token is added at the bottom (see bg-surface). */\n --color-success-soft: var(--kai-color-success-soft, color-mix(in oklab, var(--color-success) 14%, var(--color-background)));\n --color-warning-soft: var(--kai-color-warning-soft, color-mix(in oklab, var(--color-warning) 14%, var(--color-background)));\n --color-info-soft: var(--kai-color-info-soft, color-mix(in oklab, var(--color-info) 14%, var(--color-background)));\n --color-destructive-soft: var(--kai-color-destructive-soft, color-mix(in oklab, var(--color-destructive) 14%, var(--color-background)));\n /* Interaction-state backgrounds - opaque, theme-tracking fills for row/control\n states so consumers stop eyeballing /10 opacities. --color-hover is a subtle\n neutral (a little --color-muted on the background); --color-selected is a\n faint --color-primary tint so a selected row tracks the brand. Use bg-hover /\n bg-selected. Derived, so declared in BOTH light and dark; bare bg- utilities\n added at the bottom. */\n --color-hover: var(--kai-color-hover, color-mix(in oklab, var(--color-muted) 60%, var(--color-background)));\n --color-selected: var(--kai-color-selected, color-mix(in oklab, var(--color-primary) 8%, var(--color-background)));\n /* UNREAD indicator — a dedicated token (owner ruling, 2026-08-26), not a\n reuse of --color-destructive: unread is notification semantics, not\n error, so a consumer re-theming \"danger\" red must not also move every\n unread dot. Used identically by all three places an unread conversation\n surfaces: the list-row trailing dot (ConversationPanel), the header\n toggle's badge (ChatThread), and Dock's own closed-launcher badge.\n A vivid \"messenger red\" (Tailwind red-500 territory, the Intercom/iOS\n badge convention) rather than the darker --color-destructive hue: the\n first pass at this token picked a color that read as legible-on-paper\n but visually flat/dark next to the launcher's near-black ring. This one\n value is used in BOTH light and dark (no .dark override below) because\n it independently clears 3:1 (WCAG 1.4.11, non-text) against every real\n surface an unread dot sits on in EITHER mode: light row/card background\n (white) 3.78:1, light Dock-launcher ring (--color-primary, near-black)\n 4.68:1, dark row/card background (near-black) 4.73–4.35:1, dark\n Dock-launcher ring (--color-primary, near-white) 3.62:1. (Measured via\n the WCAG relative-luminance formula against this file's own light/dark\n --color-background/-card/-primary values — see\n .superpowers/sdd/2026-08-26-conversations/rework-report.md Round 4 for\n the worked numbers.) Override via --kai-color-unread; a construct author\n can also set it per-widget through `theme.unreadColor` (construct\n vocabulary — see agent-tooling/construct/schema.ts). */\n --color-unread: var(--kai-color-unread, hsl(0 84% 60%));\n /* MARKED text — the fill behind a keyword the app has flagged (the composer's\n `highlights` rules, decorated through the CSS Custom Highlight API). This is\n `<mark>`, not a selection and not a status: a warm yellow, the convention\n every browser already ships for <mark> and every reader already reads as\n \"someone marked this\". Deliberately NOT derived from --color-primary — that\n token is a NEUTRAL near-black in light and near-white in dark, so any tint of\n it is grey, which is why the highlight used to be invisible. Also not blue\n (the browser's own ::selection is blue — a highlight must not read as a\n selection), not red (error) and not the skill/agent pill hues (blue/violet).\n OPAQUE, so it composites predictably over whichever field it lands on.\n Override via --kai-color-highlight. Light: near-black text over it is 15.6:1;\n dark: near-white text over it is 6.7:1 — both well clear of WCAG AA. */\n --color-highlight: var(--kai-color-highlight, hsl(45 96% 78%));\n /* SELECTED text — the kit's own ::selection fill, applied inside every kai-*\n shadow root (see src/elements/styles.css for the scoping rationale). The kit\n owns this because leaving it to the UA meant the browser's blue outranked the\n kit's own deliberate emphasis: a marked keyword was LESS prominent than an\n incidental drag-select. Stays in the cool/blue family the UA trained everyone\n to read as \"selected\", so it can never be confused with the warm --color-highlight\n mark above; OPAQUE, so a selection over a mark composites cleanly (selection\n paints on top of a custom highlight) instead of muddying into a third colour.\n The FOREGROUND is set too, and that is not cosmetic: without it the selected\n glyph keeps its own colour, and the kit's coloured text — muted text (3.8:1),\n the skill/agent pill hues (3.6:1 / 4.0:1), inline code (4.7:1) — lands at or\n under WCAG AA on this fill. Forcing the foreground token makes the guarantee\n hold for every glyph regardless of what colour it had. Light 13.99:1,\n dark 8.87:1. Override via --kai-color-selection(-foreground). */\n --color-selection: var(--kai-color-selection, hsl(213 94% 87%));\n --color-selection-foreground: var(--kai-color-selection-foreground, hsl(240 10% 3.9%));\n --color-border: var(--kai-color-border, hsl(240 5.9% 90%));\n /* CONTROL boundary — the visible edge of an interactive form control (text\n input, textarea, select, the radio/checkbox ring). WCAG 2.1 SC 1.4.11\n Non-text Contrast requires >=3:1 against the adjacent surface for exactly\n this: a control whose boundary you cannot see is not perceivable. That is\n why this is NOT --color-border: a divider or a card outline is decorative\n and may sit below 3:1, a control's edge may not. Do NOT use border-input\n for list wrappers or panel outlines — use border-border there.\n Contrast is the requirement; a thicker border does not satisfy 1.4.11. */\n --color-input: var(--kai-color-input, hsl(240 5% 53%));\n /* Focus ring — a deliberate blue (not a neutral) so keyboard focus is always\n obvious and on-brand in both modes. Light uses a strong blue; dark uses a\n brighter one for contrast on dark surfaces. Both clear WCAG 2.1 non-text\n contrast (≥3:1) against the kit's backgrounds. Override via --kai-color-ring. */\n --color-ring: var(--kai-color-ring, hsl(217 91% 53%));\n /* Custom scrollbars — thin, rounded, subtle; thumb strengthens on hover. A\n consistent cross-platform look (the kit styles its OWN scroll regions inside\n the shadow root; the track stays transparent so nothing is forced where no\n scrollbar is needed). Override via --kai-color-scrollbar-thumb(-hover). */\n --color-scrollbar-thumb: var(--kai-color-scrollbar-thumb, hsl(240 5% 80%));\n --color-scrollbar-thumb-hover: var(--kai-color-scrollbar-thumb-hover, hsl(240 4% 64%));\n --color-sidebar: var(--kai-color-sidebar, hsl(0 0% 100%));\n\n /* Inline `code` accent. Blue text on a translucent blue chip. */\n --color-code-foreground: var(--kai-color-code-foreground, hsl(224.3 76.3% 48%));\n\n /* Tool/status chip hues. Each chip is hue text over a 15% translucent fill of\n the SAME hue (set in tool.tsx). The bare hue is too light to reach WCAG AA\n (4.5:1) on the faint fill in LIGHT mode, so the light values are darkened;\n dark mode keeps brighter hues for AA on the dark fill. Override via\n --kai-color-tool-* to retheme. */\n --color-tool-blue: var(--kai-color-tool-blue, hsl(217 91% 38%));\n --color-tool-amber: var(--kai-color-tool-amber, hsl(38 92% 28%));\n --color-tool-green: var(--kai-color-tool-green, hsl(142 71% 26%));\n --color-tool-red: var(--kai-color-tool-red, hsl(0 72% 42%));\n\n --radius: var(--kai-radius, 0.6rem);\n --radius-sm: calc(var(--radius) - 4px);\n --radius-md: calc(var(--radius) - 2px);\n --radius-lg: var(--radius);\n --radius-xl: calc(var(--radius) + 4px);\n\n /* Typography scale — ONE scale for the whole kit. Each semantic name\n (text-micro / text-caption / text-meta / text-compact / text-body /\n text-title / text-lg)\n resolves through a namespaced --kai-text-* token, so overriding that token\n on :root restyles the kit globally — it pierces the Shadow DOM via the\n var() fallback, exactly like the --kai-color-* tokens. The bare --text-*\n names stay internal so a host's own --text-* can't collide.\n\n Tailwind's OWN scale is re-pointed at the same tokens: in Tailwind v4 the\n `text-xs` / `text-sm` / `text-base` / `text-lg` utilities are generated FROM\n --text-xs/sm/base/lg in this very @theme block, so aliasing them makes\n text-xs ≡ text-meta, text-sm ≡ text-body, text-base ≡ text-title and\n text-lg ≡ text-lg. That matters because the vast majority of the kit's call\n sites spell the Tailwind name; without the alias the --kai-text-* knobs\n reached ~12% of them and the \"globally\" promise in the theming guide was\n false. Defaults are byte-identical to stock Tailwind, so nothing moves\n until a consumer actually sets a --kai-text-* token — including in a\n consumer's own Tailwind build that imports this file, which is the point:\n one scale everywhere, kit and app moving together.\n\n Line-heights are UNITLESS RATIOS (Tailwind's own), never fixed rem. A fixed\n leading does not scale: --kai-text-body: 1.25rem under the old 1.45rem\n leading gave 20px text on 23.2px leading — near solid-set — which made the\n themable token unsafe to actually theme.\n (Message/markdown reading size also scales with the `proseSize` prop; these\n tokens cover the fixed chrome & controls.) */\n --text-micro: var(--kai-text-micro, 0.625rem); --text-micro--line-height: calc(0.875 / 0.625); /* 10px — badges, pills, uppercase eyebrows */\n --text-caption: var(--kai-text-caption, 0.6875rem); --text-caption--line-height: calc(1 / 0.6875); /* 11px — micro labels, sub-counts, xs code */\n --text-meta: var(--kai-text-meta, 0.75rem); --text-meta--line-height: calc(1 / 0.75); /* 12px — controls, toggles, switchers, captions */\n --text-xs: var(--kai-text-meta, 0.75rem); --text-xs--line-height: calc(1 / 0.75); /* ≡ text-meta */\n --text-compact: var(--kai-text-compact, 0.8125rem); --text-compact--line-height: calc(1.21875 / 0.8125); /* 13px — dense chrome & code: a notch below body */\n --text-body: var(--kai-text-body, 0.875rem); --text-body--line-height: calc(1.25 / 0.875); /* 14px — primary reading text */\n --text-sm: var(--kai-text-body, 0.875rem); --text-sm--line-height: calc(1.25 / 0.875); /* ≡ text-body */\n --text-title: var(--kai-text-title, 1rem); --text-title--line-height: calc(1.5 / 1); /* 16px — emphasis / headers */\n --text-base: var(--kai-text-title, 1rem); --text-base--line-height: calc(1.5 / 1); /* ≡ text-title */\n --text-lg: var(--kai-text-lg, 1.125rem); --text-lg--line-height: calc(1.75 / 1.125); /* 18px — section headings, lg prose */\n\n @keyframes kai-typing { 0%,100% { transform: translateY(0); opacity: .5 } 50% { transform: translateY(-2px); opacity: 1 } }\n @keyframes kai-loading-dots { 0%,100% { opacity: 0 } 50% { opacity: 1 } }\n @keyframes kai-wave { 0%,100% { transform: scaleY(1) } 50% { transform: scaleY(.6) } }\n @keyframes kai-blink { 0%,100% { opacity: 1 } 50% { opacity: 0 } }\n @keyframes kai-text-blink { 0%,100% { color: var(--color-primary) } 50% { color: var(--color-muted-foreground) } }\n @keyframes kai-bounce-dots { 0%,100% { transform: scale(.8); opacity: .5 } 50% { transform: scale(1.2); opacity: 1 } }\n @keyframes kai-thin-pulse { 0%,100% { transform: scale(.95); opacity: .8 } 50% { transform: scale(1.05); opacity: .4 } }\n @keyframes kai-pulse-dot { 0%,100% { transform: scale(1); opacity: .8 } 50% { transform: scale(1.5); opacity: 1 } }\n @keyframes kai-shimmer-text { 0% { background-position: 150% center } 100% { background-position: -150% center } }\n @keyframes kai-wave-bars { 0%,100% { transform: scaleY(1); opacity: .5 } 50% { transform: scaleY(.6); opacity: 1 } }\n @keyframes kai-shimmer { 0% { background-position: 200% 50% } 100% { background-position: -200% 50% } }\n @keyframes kai-spinner-fade { 0% { opacity: 0 } 100% { opacity: 1 } }\n}\n\n.dark {\n --color-background: var(--kai-color-background, hsl(50 2% 9%));\n --color-foreground: var(--kai-color-foreground, hsl(0 0% 98%));\n --color-card: var(--kai-color-card, hsl(45 4% 12%));\n --color-card-foreground: var(--kai-color-card-foreground, hsl(0 0% 98%));\n --color-popover: var(--kai-color-popover, hsl(45 4% 12%));\n --color-popover-foreground: var(--kai-color-popover-foreground, hsl(0 0% 98%));\n --color-primary: var(--kai-color-primary, hsl(0 0% 98%));\n --color-primary-foreground: var(--kai-color-primary-foreground, hsl(45 4% 11%));\n --color-secondary: var(--kai-color-secondary, hsl(45 4% 17%));\n --color-secondary-foreground: var(--kai-color-secondary-foreground, hsl(0 0% 98%));\n --color-muted: var(--kai-color-muted, hsl(45 4% 17%));\n --color-muted-foreground: var(--kai-color-muted-foreground, hsl(45 4% 64%));\n /* Re-declared in the dark scope so the color-mix recomputes with the DARK\n muted/background (a derived token is computed where it's declared, not where\n it's used — see the light --color-surface for the full note). */\n --color-surface: var(--kai-color-surface, color-mix(in srgb, var(--color-muted) 40%, var(--color-background)));\n --color-surface-strong: var(--kai-color-surface-strong, color-mix(in srgb, var(--color-muted) 60%, var(--color-background)));\n /* Sunken: in dark a LOWER muted% is darker (blends toward the dark background). */\n --color-surface-sunken: var(--kai-color-surface-sunken, color-mix(in srgb, var(--color-muted) 18%, var(--color-background)));\n --color-accent: var(--kai-color-accent, hsl(45 4% 17%));\n --color-accent-foreground: var(--kai-color-accent-foreground, hsl(0 0% 98%));\n --color-destructive: var(--kai-color-destructive, hsl(0 62.8% 30.6%));\n --color-destructive-foreground: var(--kai-color-destructive-foreground, hsl(0 0% 98%));\n /* Semantic status colors - dark mode flips to the brighter tool-* dark hues\n (matching the chip values) carried over a near-black foreground, so the color\n both reads as text on a dark soft tint AND backs a legible foreground. See\n the light @theme note. */\n --color-success: var(--kai-color-success, hsl(142 71% 45%));\n --color-success-foreground: var(--kai-color-success-foreground, hsl(45 4% 11%));\n --color-warning: var(--kai-color-warning, hsl(38 92% 50%));\n --color-warning-foreground: var(--kai-color-warning-foreground, hsl(45 4% 11%));\n --color-info: var(--kai-color-info, hsl(217 91% 70%));\n --color-info-foreground: var(--kai-color-info-foreground, hsl(45 4% 11%));\n /* Soft status surfaces + interaction states - re-declared so each color-mix\n recomputes with the DARK hues/background (a derived token resolves where it's\n declared; see the light block for the full note). */\n --color-success-soft: var(--kai-color-success-soft, color-mix(in oklab, var(--color-success) 14%, var(--color-background)));\n --color-warning-soft: var(--kai-color-warning-soft, color-mix(in oklab, var(--color-warning) 14%, var(--color-background)));\n --color-info-soft: var(--kai-color-info-soft, color-mix(in oklab, var(--color-info) 14%, var(--color-background)));\n --color-destructive-soft: var(--kai-color-destructive-soft, color-mix(in oklab, var(--color-destructive) 14%, var(--color-background)));\n --color-hover: var(--kai-color-hover, color-mix(in oklab, var(--color-muted) 60%, var(--color-background)));\n --color-selected: var(--kai-color-selected, color-mix(in oklab, var(--color-primary) 8%, var(--color-background)));\n /* Unread indicator — dark. Same value as light (see the light block for the\n full contrast note): one vivid red independently clears 3:1 against both\n modes' real surfaces, so there is nothing to flip here. Still redeclared\n for override symmetry with every other semantic color in this file. */\n --color-unread: var(--kai-color-unread, hsl(0 84% 60%));\n /* Marked text — dark. A deep warm amber rather than the light yellow: a pale\n highlighter on a near-black field would blow out and force the text to flip\n colour. See the light block for the full note. */\n --color-highlight: var(--kai-color-highlight, hsl(40 75% 26%));\n /* Selected text — dark. A deep blue rather than the light one, for the same\n reason the mark darkens. See the light block for the full note. */\n --color-selection: var(--kai-color-selection, hsl(217 60% 32%));\n --color-selection-foreground: var(--kai-color-selection-foreground, hsl(0 0% 98%));\n --color-border: var(--kai-color-border, hsl(45 4% 17%));\n /* Control boundary — see the light block. Lifted to clear 3:1 (SC 1.4.11)\n against the dark background and card surfaces. */\n --color-input: var(--kai-color-input, hsl(45 4% 48%));\n --color-ring: var(--kai-color-ring, hsl(217 91% 68%));\n --color-scrollbar-thumb: var(--kai-color-scrollbar-thumb, hsl(45 3% 30%));\n --color-scrollbar-thumb-hover: var(--kai-color-scrollbar-thumb-hover, hsl(45 3% 42%));\n --color-sidebar: var(--kai-color-sidebar, hsl(50 2% 7%));\n --color-code-foreground: var(--kai-color-code-foreground, hsl(213 94% 78%));\n\n /* Tool/status chip hues — dark mode. Brighter hues reach AA on the dark fill. */\n --color-tool-blue: var(--kai-color-tool-blue, hsl(217 91% 70%));\n --color-tool-amber: var(--kai-color-tool-amber, hsl(38 92% 50%));\n --color-tool-green: var(--kai-color-tool-green, hsl(142 71% 45%));\n --color-tool-red: var(--kai-color-tool-red, hsl(0 84% 70%));\n}\n\n/* Self-contained markdown styling — replaces the typography plugin's `prose`.\n Keyed on --color-* tokens so it themes with the rest of the kit. */\n.chat-markdown { color: var(--color-foreground); line-height: 1.6; }\n.chat-markdown > div:first-child > :first-child { margin-top: 0; }\n.chat-markdown > div:last-child > :last-child { margin-bottom: 0; }\n.chat-markdown p { margin: 0 0 0.75em; }\n.chat-markdown p:last-child { margin-bottom: 0; }\n.chat-markdown h1, .chat-markdown h2, .chat-markdown h3, .chat-markdown h4 {\n margin: 1.2em 0 0.5em; font-weight: 600; line-height: 1.3; color: var(--color-foreground);\n}\n.chat-markdown h1 { font-size: 1.4em; } .chat-markdown h2 { font-size: 1.25em; }\n.chat-markdown h3 { font-size: 1.1em; } .chat-markdown h4 { font-size: 1em; }\n.chat-markdown ul, .chat-markdown ol { margin: 0 0 0.75em; padding-left: 1.4em; }\n.chat-markdown li { margin: 0.2em 0; }\n.chat-markdown ul { list-style: disc; } .chat-markdown ol { list-style: decimal; }\n.chat-markdown a { color: var(--color-primary); text-decoration: underline; text-underline-offset: 2px; }\n.chat-markdown strong { font-weight: 600; color: var(--color-foreground); }\n.chat-markdown em { font-style: italic; }\n.chat-markdown blockquote {\n margin: 0 0 0.75em; padding-left: 0.9em; border-left: 2px solid var(--color-border);\n color: var(--color-muted-foreground);\n}\n.chat-markdown hr { margin: 1em 0; border: 0; border-top: 1px solid var(--color-border); }\n.chat-markdown code:not(pre code) {\n background: color-mix(in oklab, var(--color-code-foreground) 15%, transparent);\n color: var(--color-code-foreground);\n border-radius: 4px; padding: 0.1em 0.35em; font-size: 0.875em;\n font-family: var(--kai-font-code, ui-monospace, \"SF Mono\", Menlo, monospace);\n}\n.chat-markdown table { width: 100%; border-collapse: collapse; margin: 0 0 0.75em; font-size: 0.9em; }\n.chat-markdown th, .chat-markdown td { border: 1px solid var(--color-border); padding: 0.4em 0.6em; text-align: left; }\n.chat-markdown th { font-weight: 600; background: color-mix(in oklab, var(--color-muted-foreground) 8%, transparent); }\n\n/* Themeable elevation. The kit is mostly flat (borders), but a few surfaces lift\n off the page — popovers, dropdowns, hover cards, cards. The shadow COLOR is a\n token (--kai-shadow-color, default near-black); set it transparent for a fully\n flat look, or tint it to match a theme. Defined here (not as a Tailwind shadow\n utility) so the color stays overridable and works in both the web-component and\n SolidJS layers. */\n.kai-elevation {\n box-shadow:\n 0 4px 12px -2px color-mix(in oklab, var(--kai-shadow-color, oklch(0 0 0)) 14%, transparent),\n 0 2px 6px -2px color-mix(in oklab, var(--kai-shadow-color, oklch(0 0 0)) 10%, transparent);\n}\n.kai-elevation-sm {\n box-shadow: 0 1px 2px 0 color-mix(in oklab, var(--kai-shadow-color, oklch(0 0 0)) 8%, transparent);\n}\n\n/* Cross-platform thin scrollbar utility (Firefox + WebKit). Used by ScrollArea\n and any scroll region in the SolidJS-component build (web components also get\n this globally inside their shadow root — see src/elements/styles.css).\n `kai-` prefixed because this file is merged into a consumer's Tailwind build\n and `.scrollbar-thin` is a name they may well own (no consumer-facing doc ever\n named the old unprefixed class, so no alias is kept). */\n.kai-scrollbar-thin {\n scrollbar-width: thin;\n scrollbar-color: var(--color-scrollbar-thumb) transparent;\n}\n.kai-scrollbar-thin::-webkit-scrollbar { width: 8px; height: 8px; }\n.kai-scrollbar-thin::-webkit-scrollbar-track { background: transparent; }\n.kai-scrollbar-thin::-webkit-scrollbar-thumb {\n background-color: var(--color-scrollbar-thumb);\n border-radius: 9999px;\n border: 2px solid transparent;\n background-clip: padding-box;\n}\n.kai-scrollbar-thin::-webkit-scrollbar-thumb:hover { background-color: var(--color-scrollbar-thumb-hover); }\n.kai-scrollbar-thin::-webkit-scrollbar-corner { background: transparent; }\n\n/* Surface utilities — `bg-surface` / `bg-surface-strong` paint the opaque,\n theme-derived surface tokens (see --color-surface above). Defined explicitly\n because a color-mix-valued @theme token does NOT emit a bare `bg-` utility on\n its own (only opacity variants). Use these for panels that sit OVER content\n instead of `bg-muted/NN`. */\n@utility bg-surface {\n background-color: var(--color-surface);\n}\n@utility bg-surface-strong {\n background-color: var(--color-surface-strong);\n}\n@utility bg-surface-sunken {\n background-color: var(--color-surface-sunken);\n}\n\n/* Soft-status + interaction-state utilities. Same reason as bg-surface above: a\n color-mix-valued @theme token does NOT emit a bare `bg-` utility on its own, so\n bg-success-soft / bg-warning-soft / bg-info-soft / bg-destructive-soft and\n bg-hover / bg-selected are declared here. (The SOLID tokens - success / warning\n / info + their -foreground - are plain hsl values, so bg-success / text-success\n etc. ARE auto-generated by @theme and need no explicit utility.) */\n@utility bg-success-soft {\n background-color: var(--color-success-soft);\n}\n@utility bg-warning-soft {\n background-color: var(--color-warning-soft);\n}\n@utility bg-info-soft {\n background-color: var(--color-info-soft);\n}\n@utility bg-destructive-soft {\n background-color: var(--color-destructive-soft);\n}\n@utility bg-hover {\n background-color: var(--color-hover);\n}\n@utility bg-selected {\n background-color: var(--color-selected);\n}\n";
9001
9005
  function declaredKaiTokens(css) {
9002
9006
  const names = /* @__PURE__ */ new Set();
9003
9007
  for (const m of css.matchAll(/var\(\s*(--kai-[a-zA-Z0-9-]+)\s*[,)]/g)) names.add(m[1]);
@@ -9331,7 +9335,7 @@ const RULES = [
9331
9335
  t
9332
9336
  ),
9333
9337
  title: "tsc errors inside node_modules/@kitn.ai/ui/src (SolidJS source compiled under React)",
9334
- cause: "The package currently ships TypeScript/TSX source, and a type entry value-re-exports from it, so the consumer's `tsc` resolves and compiles the library's SolidJS internals (`src/ui/*.tsx`) under the app's React JSX config — `Show`/`Portal`/`Dynamic` aren't React components, causing TS2786 / \"cannot be used as a JSX component\" errors. `vite`/esbuild build fine (they strip types); only `tsc` breaks. `skipLibCheck` does not help (these are `.tsx` source, not `.d.ts`).",
9338
+ cause: "On versions <=0.27.x, the package shipped TypeScript/TSX source, and a type entry value-re-exports from it, so the consumer's `tsc` resolves and compiles the library's SolidJS internals (`src/ui/*.tsx`) under the app's React JSX config — `Show`/`Portal`/`Dynamic` aren't React components, causing TS2786 / \"cannot be used as a JSX component\" errors. `vite`/esbuild build fine (they strip types); only `tsc` breaks. `skipLibCheck` does not help (these are `.tsx` source, not `.d.ts`). Fixed for newer releases: the package no longer ships that source tree (`files` in package.json narrowed to `dist/` plus two reachable JSON exports) — if you're still hitting this, check your installed version first (`npm ls @kitn.ai/ui`) and upgrade before reaching for the workaround below.",
9335
9339
  fix: 'Redirect the type resolution for that subpath in your tsconfig (Vite ignores tsconfig `paths`, so runtime is unaffected):\n\n```jsonc\n// tsconfig (app)\n"baseUrl": ".",\n"paths": { "@kitn.ai/ui/elements": ["./src/stubs/kitn-elements.d.ts"] }\n```\n\n```ts\n// src/stubs/kitn-elements.d.ts\nexport {}\n```\n\n(This is a known packaging gap being tracked upstream.)'
9336
9340
  },
9337
9341
  {