@kitn.ai/ui 0.25.1 → 0.26.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.
- package/README.md +5 -7
- package/dist/components/attachment-types.d.ts +46 -1
- package/dist/components/attachments.d.ts +31 -0
- package/dist/components/audio-visualizer/fit-scale.d.ts +50 -0
- package/dist/components/audio-visualizer/index.d.ts +15 -1
- package/dist/components/audio-visualizer/variant-bar.d.ts +24 -1
- package/dist/components/chat-thread.d.ts +3 -41
- package/dist/components/code-block.d.ts +22 -0
- package/dist/components/conversation-item.d.ts +54 -1
- package/dist/components/conversation-list.d.ts +65 -0
- package/dist/components/form.d.ts +42 -0
- package/dist/components/message.d.ts +7 -0
- package/dist/components/toast.d.ts +2 -1
- package/dist/components/voice-input.d.ts +8 -0
- package/dist/components/voice-output.d.ts +12 -1
- package/dist/components/workspace-shell.d.ts +87 -0
- package/dist/{create-tween-B5Y4Im8G.js → create-tween-BFT6c-Y8.js} +1 -1
- package/dist/{create-tween-4z1XYLkR.js → create-tween-CJNlzoaO.js} +1 -1
- package/dist/{create-tween-CUzOlaMS.js → create-tween-CQED4T0g.js} +1 -1
- package/dist/custom-elements.json +2931 -2572
- package/dist/diagnostics/hook.d.ts +81 -0
- package/dist/diagnostics/index.d.ts +7 -0
- package/dist/diagnostics/report-request.d.ts +61 -0
- package/dist/diagnostics.d.ts +5 -0
- package/dist/diagnostics.js +209 -0
- package/dist/elements/agent-card.js +1 -1
- package/dist/elements/artifact.js +1 -1
- package/dist/elements/attachments.js +1 -1
- package/dist/elements/audio-visualizer.js +1 -1
- package/dist/elements/autoloader.js +1 -1
- package/dist/elements/avatar.js +1 -1
- package/dist/elements/badge.js +1 -1
- package/dist/elements/button.js +1 -1
- package/dist/elements/card.js +1 -1
- package/dist/elements/cards.js +1 -1
- package/dist/elements/chain-of-thought.js +1 -1
- package/dist/elements/chat-scope-picker.js +1 -1
- package/dist/elements/chat-workspace.js +1 -1
- package/dist/elements/chat.js +1 -1
- package/dist/elements/checkpoint.js +1 -1
- package/dist/elements/choice.js +1 -1
- package/dist/elements/chunks/{Icon-b5A8hlHs.js → Icon--Y8vsFal.js} +1 -1
- package/dist/elements/chunks/action-icons-D9u3OzYW.js +1 -0
- package/dist/elements/chunks/arrow-left-CVh1TeN7.js +1 -0
- package/dist/elements/chunks/{artifact-BSuPYFHY.js → artifact-BkYcfIlZ.js} +1 -1
- package/dist/elements/chunks/attachments-DwfNlubq.js +1 -0
- package/dist/elements/chunks/audio-visualizer-D7lB6mvR.js +1 -0
- package/dist/elements/chunks/{badge-TIMiJFKc.js → badge-Q0-Cmwzz.js} +1 -1
- package/dist/elements/chunks/{button-B9okqG73.js → button-flUbeufF.js} +1 -1
- package/dist/elements/chunks/{card-renderer-CSoTL_e1.js → card-renderer-3Dyl-FpN.js} +1 -1
- package/dist/elements/chunks/check-B5kBPKeo.js +1 -0
- package/dist/elements/chunks/chevron-down-DZ1GS39h.js +1 -0
- package/dist/elements/chunks/chevron-right-CvP7OUd2.js +1 -0
- package/dist/elements/chunks/{choice-card-CGMc3kek.js → choice-card-D4QUIOWZ.js} +1 -1
- package/dist/elements/chunks/circle-CDf9g6MQ.js +1 -0
- package/dist/elements/chunks/circle-check-CA47Nqbz.js +1 -0
- package/dist/elements/chunks/{circle-x-mhH7pOK2.js → circle-x-CJ_HVbC8.js} +1 -1
- package/dist/elements/chunks/code-block-BdLiTitd.js +1 -0
- package/dist/elements/chunks/collapsible-BzbXpPzr.js +1 -0
- package/dist/elements/chunks/{composer-CZZmtYOT.js → composer-Byve-n8K.js} +2 -2
- package/dist/elements/chunks/{confirm-card-BWjf2-xo.js → confirm-card-B0flE3MN.js} +1 -1
- package/dist/elements/chunks/context-VLIL3sJ-.js +1 -0
- package/dist/elements/chunks/controllable-DTwTIlwp.js +1 -0
- package/dist/elements/chunks/conversation-item-BDztezOG.js +1 -0
- package/dist/elements/chunks/copy-Nf-kqxXH.js +1 -0
- package/dist/elements/chunks/{create-tween-CUrM6D_o.js → create-tween-c4Z8TDYz.js} +2 -2
- package/dist/elements/chunks/default-input-C2iLFq0b.js +1 -0
- package/dist/elements/chunks/define-wjHR1MkU.js +1 -0
- package/dist/elements/chunks/disclosure-CcNbyLy0.js +1 -0
- package/dist/elements/chunks/{download-DnCyWFJE.js → download-C4V7tBdb.js} +1 -1
- package/dist/elements/chunks/dropdown-BgWTthUx.js +1 -0
- package/dist/elements/chunks/{ellipsis-CVxqfsDZ.js → ellipsis-7gU33mL2.js} +1 -1
- package/dist/elements/chunks/embed-D3KewsIJ.js +1 -0
- package/dist/elements/chunks/{external-link-DG2sRdQL.js → external-link-CSOEsNlx.js} +1 -1
- package/dist/elements/chunks/{file-text-D0J9F6M7.js → file-text-D1G8khle.js} +1 -1
- package/dist/elements/chunks/{file-tree-yGWNK0Js.js → file-tree-zvB2i7P9.js} +1 -1
- package/dist/elements/chunks/{folder-NV1pi_ud.js → folder-WW2LGLid.js} +1 -1
- package/dist/elements/chunks/form-CQirdC4W.js +1 -0
- package/dist/elements/chunks/hover-card-CJJkfHTK.js +1 -0
- package/dist/elements/chunks/icon-Cfgmf4fa.js +1 -0
- package/dist/elements/chunks/{info-C8r5Q6cc.js → info-DX3YMOt6.js} +1 -1
- package/dist/elements/chunks/input-BtW9U6Sq.js +1 -0
- package/dist/elements/chunks/{kbd-OGJDUT-O.js → kbd-LGXwuT_V.js} +1 -1
- package/dist/elements/chunks/{link-BdsfLB7b.js → link-2My69BqT.js} +1 -1
- package/dist/elements/chunks/{link-preview-Cf5KOP-i.js → link-preview-OQ9IEq0f.js} +1 -1
- package/dist/elements/chunks/{loader-B5QzK_8_.js → loader-iOxc_Tu-.js} +1 -1
- package/dist/elements/chunks/{markdown-DbozyYqa.js → markdown-DgBFaGAz.js} +1 -1
- package/dist/elements/chunks/{message-DtXKPqiR.js → message-VMZohrXx.js} +1 -1
- package/dist/elements/chunks/message-circle-CpXMM-_n.js +1 -0
- package/dist/elements/chunks/message-square-DxcWtETQ.js +1 -0
- package/dist/elements/chunks/message-tZmV2A3p.js +1 -0
- package/dist/elements/chunks/{minimize-2-SegJ_oku.js → minimize-2-DPIUKTrT.js} +1 -1
- package/dist/elements/chunks/{model-switcher-D7JrFFHp.js → model-switcher-DsT8tFB0.js} +1 -1
- package/dist/elements/chunks/{overlay-CV7z2YuX.js → overlay-DuiwdXjm.js} +1 -1
- package/dist/elements/chunks/{paperclip-Bg0ITU3b.js → paperclip-CRZVp4z_.js} +1 -1
- package/dist/elements/chunks/{progress-bar-D1_rzt6N.js → progress-bar-DNy66e_E.js} +1 -1
- package/dist/elements/chunks/{prompt-suggestion-D5Sm8xF1.js → prompt-suggestion-Bn64Nl7L.js} +1 -1
- package/dist/elements/chunks/reasoning-Emn9N4-T.js +1 -0
- package/dist/elements/chunks/{resizable-Dpzjlvp4.js → resizable-D181b4fM.js} +1 -1
- package/dist/elements/chunks/{rotate-cw-DzVDJOA1.js → rotate-cw-CPWe37D9.js} +1 -1
- package/dist/elements/chunks/{scroll-area-93A1bbeG.js → scroll-area-ClZkZxIk.js} +1 -1
- package/dist/elements/chunks/scroll-button-DPE-t3x_.js +1 -0
- package/dist/elements/chunks/{separator-DH2r_ZSZ.js → separator-CeJHQqLW.js} +1 -1
- package/dist/elements/chunks/{settings-BFMOd6yB.js → settings-CqaHgJF9.js} +1 -1
- package/dist/elements/chunks/{settings-group-B3VZKIcz.js → settings-group-CjqjLCOn.js} +1 -1
- package/dist/elements/chunks/share-CyfnNEqp.js +1 -0
- package/dist/elements/chunks/{skeleton-N8BuWYmf.js → skeleton-D8akBnKS.js} +1 -1
- package/dist/elements/chunks/slots-DaNjX0rc.js +1 -0
- package/dist/elements/chunks/{source-w9V0NnBn.js → source-UWCvmVak.js} +1 -1
- package/dist/elements/chunks/{star-DHvACxtm.js → star-DoHFAikQ.js} +1 -1
- package/dist/elements/chunks/store-Cjq0qwYN.js +1 -0
- package/dist/elements/chunks/{tasks-card-lPxoodlA.js → tasks-card-CmZ5xh6v.js} +1 -1
- package/dist/elements/chunks/{text-shimmer-BY_rI3s5.js → text-shimmer-DYn09zrz.js} +1 -1
- package/dist/elements/chunks/textarea-skiGHURM.js +1 -0
- package/dist/elements/chunks/{thumbs-up-DQe0hvkZ.js → thumbs-up-DX2Ijk3H.js} +1 -1
- package/dist/elements/chunks/{toast-store-VUZZBhzH.js → toast-store-CFnQpThX.js} +1 -1
- package/dist/elements/chunks/{tool-C1YtxwPu.js → tool-DKQ2D1DP.js} +1 -1
- package/dist/elements/chunks/{tooltip-BqwnFWhn.js → tooltip-B0G99y8w.js} +1 -1
- package/dist/elements/chunks/{triangle-alert-B6or7F5u.js → triangle-alert-F9cyUEyy.js} +1 -1
- package/dist/elements/chunks/{use-card-resolution-DJg32jGH.js → use-card-resolution-DoA2f_EU.js} +1 -1
- package/dist/elements/chunks/{variant-aurora-QXTZPyST.js → variant-aurora-qt6Zct8M.js} +2 -2
- package/dist/elements/chunks/variant-custom-tJp22_BQ.js +1 -0
- package/dist/{variant-wave-BwzrHD1s.js → elements/chunks/variant-wave-CaQ5ti39.js} +2 -2
- package/dist/elements/chunks/x-B6UnOiLw.js +1 -0
- package/dist/elements/coachmark.js +1 -1
- package/dist/elements/code-block.js +1 -1
- package/dist/elements/command.js +1 -1
- package/dist/elements/compare.js +1 -1
- package/dist/elements/composer.js +1 -1
- package/dist/elements/confirm-card.js +1 -1
- package/dist/elements/context-meter.js +1 -1
- package/dist/elements/conversation-item.d.ts +1 -0
- package/dist/elements/conversation-item.js +1 -0
- package/dist/elements/conversation-list.js +1 -1
- package/dist/elements/default-input.d.ts +3 -3
- package/dist/elements/define.d.ts +27 -0
- package/dist/elements/diagnostic-events.d.ts +74 -0
- package/dist/elements/dialog.js +1 -1
- package/dist/elements/dock.d.ts +1 -0
- package/dist/elements/dock.js +149 -0
- package/dist/elements/dropdown.d.ts +1 -0
- package/dist/elements/dropdown.js +1 -0
- package/dist/elements/editable-label.js +1 -1
- package/dist/elements/element-diagnostics.d.ts +81 -0
- package/dist/elements/embed.js +1 -1
- package/dist/elements/empty.js +1 -1
- package/dist/elements/feedback-bar.js +1 -1
- package/dist/elements/file-tree.js +1 -1
- package/dist/elements/file-upload.js +1 -1
- package/dist/elements/form.js +1 -1
- package/dist/elements/hover-card.js +1 -1
- package/dist/elements/icon.js +1 -1
- package/dist/elements/image.js +1 -1
- package/dist/elements/input.js +1 -1
- package/dist/elements/kbd.js +1 -1
- package/dist/elements/link-preview.js +1 -1
- package/dist/elements/loader.js +1 -1
- package/dist/elements/markdown.js +1 -1
- package/dist/elements/menu.js +1 -1
- package/dist/elements/message-skills.js +1 -1
- package/dist/elements/message.js +1 -1
- package/dist/elements/model-switcher.js +1 -1
- package/dist/elements/nav.js +1 -1
- package/dist/elements/notice.js +1 -1
- package/dist/elements/pane-group.js +1 -1
- package/dist/elements/pane.js +1 -1
- package/dist/elements/popover.js +1 -1
- package/dist/elements/progress-bar.js +1 -1
- package/dist/elements/prompt-dock.js +1 -1
- package/dist/elements/prompt-input.js +1 -1
- package/dist/elements/prompt-suggestions.js +1 -1
- package/dist/elements/reasoning.js +1 -1
- package/dist/elements/register.d.ts +2 -0
- package/dist/elements/remote.js +1 -1
- package/dist/elements/resizable.js +1 -1
- package/dist/elements/response-stream.js +3 -3
- package/dist/elements/screen.js +1 -1
- package/dist/elements/scroll-area.js +1 -1
- package/dist/elements/scroll-button.js +1 -1
- package/dist/elements/search.js +1 -1
- package/dist/elements/segmented.js +1 -1
- package/dist/elements/separator.js +1 -1
- package/dist/elements/setting-item.js +1 -1
- package/dist/elements/settings-group.js +1 -1
- package/dist/elements/skeleton.js +1 -1
- package/dist/elements/slots.d.ts +35 -3
- package/dist/elements/source.js +1 -1
- package/dist/elements/status.js +1 -1
- package/dist/elements/switch.js +1 -1
- package/dist/elements/tabs.js +1 -1
- package/dist/elements/tasks.js +1 -1
- package/dist/elements/text-shimmer.js +1 -1
- package/dist/elements/thinking-bar.js +1 -1
- package/dist/elements/thread.js +1 -1
- package/dist/elements/toast.js +1 -1
- package/dist/elements/tool.js +1 -1
- package/dist/elements/tooltip.js +1 -1
- package/dist/elements/voice-input.js +1 -1
- package/dist/elements/voice-output.js +1 -1
- package/dist/elements.d.ts +232 -148
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5456 -4931
- package/dist/index.server.js +4142 -3669
- package/dist/kai-provider.es.js +40 -40
- package/dist/kai.es.js +1 -1
- package/dist/llms/llms-full.txt +184 -69
- package/dist/llms/llms.txt +3 -3
- package/dist/mcp.es.js +2669 -546
- package/dist/primitives/use-resize-observer.d.ts +23 -0
- package/dist/primitives/use-speech-recognition.d.ts +8 -0
- package/dist/primitives/use-text-stream.d.ts +5 -0
- package/dist/react/index.d.ts +115 -266
- package/dist/react.js +247 -221
- package/dist/register-impl-DpE7icIb.js +293 -0
- package/dist/schemas/index.d.ts +1 -1
- package/dist/schemas/tool-defs.d.ts +35 -0
- package/dist/schemas.js +403 -310
- package/dist/{solid-BMuDmFo_.js → solid-BtdqNZI7.js} +8435 -7394
- package/dist/{solid-CGYNdLRR.js → solid-CnavwBye.js} +5987 -5035
- package/dist/solid.d.ts +5 -0
- package/dist/solid.js +210 -203
- package/dist/solid.server.js +210 -203
- package/dist/state/index.d.ts +4 -0
- package/dist/state/persistence.d.ts +51 -0
- package/dist/state/stream.d.ts +50 -0
- package/dist/state/threads.d.ts +71 -0
- package/dist/state.js +269 -169
- package/dist/types.d.ts +4 -2
- package/dist/ui/dock.d.ts +109 -0
- package/dist/ui/hover-card.d.ts +44 -0
- package/dist/{variant-aurora-DwSOfraQ.js → variant-aurora-B8II3-I1.js} +27 -27
- package/dist/{variant-aurora-wKvAQ5wp.js → variant-aurora-CMNWOSJR.js} +28 -28
- package/dist/{variant-aurora-XEkPT0_z.js → variant-aurora-CcuDMWwQ.js} +2 -2
- package/dist/{variant-custom-eFIg2XWQ.js → variant-custom-BdvYC7af.js} +40 -40
- package/dist/{variant-custom-BhS9wIpU.js → variant-custom-C714mqKl.js} +65 -65
- package/dist/variant-custom-L16JLLZy.js +1 -0
- package/dist/{elements/chunks/variant-wave-DDCwhLas.js → variant-wave-2S4La2Ka.js} +2 -2
- package/dist/{variant-wave-CbVsmgwT.js → variant-wave-D7ruiA1W.js} +25 -25
- package/dist/{variant-wave-CUWGx9Bn.js → variant-wave-ecwykeyL.js} +21 -21
- package/dist/wire/chunk.d.ts +47 -0
- package/dist/wire/diagnostics.d.ts +575 -0
- package/dist/wire/encode-probe.d.ts +70 -0
- package/dist/wire/encode.d.ts +24 -0
- package/dist/wire/index.d.ts +2 -0
- package/dist/wire/sse.d.ts +10 -2
- package/dist/wire.js +917 -480
- package/frameworks/react/index.tsx +132 -93
- package/llms-full.txt +184 -69
- package/llms.txt +3 -3
- package/package.json +27 -7
- package/src/agent-tooling/archetypes.ts +41 -9
- package/src/agent-tooling/catalog/README.md +676 -0
- package/src/agent-tooling/catalog/catalog-types.ts +231 -0
- package/src/agent-tooling/catalog/fabrications.ts +96 -0
- package/src/agent-tooling/catalog/invariants.ts +284 -0
- package/src/agent-tooling/catalog/labs-titles.ts +114 -0
- package/src/agent-tooling/catalog/scenarios.ts +87 -0
- package/src/agent-tooling/catalog/surfaces.ts +275 -0
- package/src/agent-tooling/integrations/anthropic.ts +7 -1
- package/src/agent-tooling/integrations/cloudflare.ts +43 -2
- package/src/agent-tooling/integrations/langgraph.ts +7 -1
- package/src/agent-tooling/integrations/mastra.ts +7 -1
- package/src/agent-tooling/integrations/mock.ts +92 -17
- package/src/agent-tooling/integrations/ollama.ts +7 -1
- package/src/agent-tooling/integrations/openai.ts +7 -1
- package/src/agent-tooling/integrations/openrouter.ts +7 -1
- package/src/agent-tooling/integrations/pi.ts +56 -1
- package/src/agent-tooling/integrations/vercel-ai-sdk.ts +7 -1
- package/src/agent-tooling/mcp/css-raw.d.ts +12 -0
- package/src/agent-tooling/mcp/manifest.ts +100 -1
- package/src/agent-tooling/mcp/server.ts +61 -5
- package/src/agent-tooling/mcp/tools/reference.ts +440 -4
- package/src/agent-tooling/mcp/tools/scaffold.ts +1834 -307
- package/src/agent-tooling/mcp/tools/theme.ts +146 -30
- package/src/agent-tooling/mcp/validate-args.ts +141 -0
- package/src/agent-tooling/registry.ts +19 -7
- package/src/agent-tooling/route-emit.ts +26 -2
- package/src/components/attachment-types.ts +47 -1
- package/src/components/attachments.tsx +169 -22
- package/src/components/audio-visualizer/fit-scale.ts +112 -0
- package/src/components/audio-visualizer/index.tsx +80 -3
- package/src/components/audio-visualizer/variant-aurora.tsx +10 -4
- package/src/components/audio-visualizer/variant-bar.tsx +38 -6
- package/src/components/audio-visualizer/variant-custom.tsx +8 -2
- package/src/components/audio-visualizer/variant-grid.tsx +16 -11
- package/src/components/audio-visualizer/variant-radial.tsx +15 -10
- package/src/components/audio-visualizer/variant-wave.tsx +7 -2
- package/src/components/chat-container.tsx +4 -1
- package/src/components/chat-thread.tsx +36 -7
- package/src/components/code-block.tsx +79 -3
- package/src/components/composer.tsx +8 -1
- package/src/components/conversation-item.tsx +114 -4
- package/src/components/conversation-list.tsx +212 -12
- package/src/components/embed.tsx +4 -0
- package/src/components/form.tsx +41 -14
- package/src/components/message.tsx +75 -5
- package/src/components/response-stream.tsx +13 -7
- package/src/components/screen.tsx +5 -0
- package/src/components/scroll-button.tsx +7 -0
- package/src/components/toast.tsx +11 -5
- package/src/components/voice-input.tsx +35 -3
- package/src/components/voice-output.tsx +46 -6
- package/src/components/workspace-shell.tsx +285 -0
- package/src/diagnostics/hook.ts +352 -0
- package/src/diagnostics/index.ts +82 -0
- package/src/diagnostics/report-request.ts +296 -0
- package/src/elements/attachments.tsx +6 -7
- package/src/elements/audio-visualizer.tsx +48 -4
- package/src/elements/chat-workspace.tsx +159 -287
- package/src/elements/chat.tsx +12 -9
- package/src/elements/code-block.tsx +19 -1
- package/src/elements/command.tsx +4 -1
- package/src/elements/compiled.css +1 -1
- package/src/elements/conversation-item.tsx +80 -0
- package/src/elements/conversation-list.tsx +60 -11
- package/src/elements/default-input.tsx +5 -5
- package/src/elements/define.tsx +168 -8
- package/src/elements/diagnostic-events.ts +114 -0
- package/src/elements/dialog.tsx +47 -0
- package/src/elements/disclosure.ts +34 -12
- package/src/elements/dock.tsx +204 -0
- package/src/elements/dropdown.tsx +123 -0
- package/src/elements/element-diagnostics.ts +392 -0
- package/src/elements/element-manifest.json +12 -0
- package/src/elements/element-meta.json +672 -439
- package/src/elements/element-nonscalar.json +170 -0
- package/src/elements/element-types.d.ts +232 -148
- package/src/elements/menu.tsx +13 -0
- package/src/elements/prompt-dock.tsx +2 -1
- package/src/elements/prompt-input.tsx +8 -8
- package/src/elements/register-impl.ts +46 -0
- package/src/elements/register.ts +28 -0
- package/src/elements/resizable.tsx +52 -25
- package/src/elements/scroll-button.tsx +5 -0
- package/src/elements/slots.ts +107 -12
- package/src/elements/styles.css +30 -6
- package/src/elements/thinking-bar.tsx +16 -7
- package/src/elements/toast.tsx +3 -0
- package/src/elements/tool.tsx +26 -5
- package/src/elements/voice-input.tsx +11 -2
- package/src/elements/voice-output.tsx +16 -3
- package/src/index.ts +2 -0
- package/src/primitives/use-resize-observer.ts +33 -0
- package/src/primitives/use-speech-recognition.ts +12 -1
- package/src/primitives/use-stick-to-bottom.ts +34 -2
- package/src/primitives/use-text-stream.ts +33 -2
- package/src/remote/provider-runtime.ts +6 -3
- package/src/schemas/index.ts +1 -0
- package/src/schemas/tool-defs.ts +297 -6
- package/src/solid.ts +5 -0
- package/src/state/index.ts +12 -0
- package/src/state/persistence.ts +180 -0
- package/src/state/stream.ts +71 -4
- package/src/state/threads.ts +142 -0
- package/src/types.ts +4 -2
- package/src/ui/dialog.tsx +6 -0
- package/src/ui/dock.tsx +445 -0
- package/src/ui/dropdown.tsx +67 -23
- package/src/ui/hover-card.tsx +156 -6
- package/src/ui/input.tsx +29 -10
- package/src/ui/resizable.tsx +11 -0
- package/src/wire/chunk.ts +47 -0
- package/src/wire/consume.ts +185 -26
- package/src/wire/diagnostics.ts +727 -0
- package/src/wire/encode-probe.ts +214 -0
- package/src/wire/encode.ts +267 -14
- package/src/wire/formats/anthropic.ts +8 -1
- package/src/wire/formats/openai.ts +5 -0
- package/src/wire/index.ts +22 -0
- package/src/wire/read.ts +250 -6
- package/src/wire/sse.ts +16 -3
- package/dist/elements/chunks/action-icons-DW9muWrY.js +0 -1
- package/dist/elements/chunks/arrow-left-iJVnQmxA.js +0 -1
- package/dist/elements/chunks/attachments-CL6TaqIb.js +0 -1
- package/dist/elements/chunks/audio-visualizer-BuUqQmaO.js +0 -1
- package/dist/elements/chunks/chat-thread-DxoKaStk.js +0 -1
- package/dist/elements/chunks/check-MdLzbxrm.js +0 -1
- package/dist/elements/chunks/chevron-down-MK7IzDqe.js +0 -1
- package/dist/elements/chunks/chevron-right-C5jXhmtV.js +0 -1
- package/dist/elements/chunks/circle-BG7VkPep.js +0 -1
- package/dist/elements/chunks/circle-check-GqvO2UBs.js +0 -1
- package/dist/elements/chunks/code-block-ClhQO9RW.js +0 -1
- package/dist/elements/chunks/collapsible-DBcBkFPh.js +0 -1
- package/dist/elements/chunks/context-hKjNqiyQ.js +0 -1
- package/dist/elements/chunks/conversation-list-CsGJjSKG.js +0 -1
- package/dist/elements/chunks/default-input-B1Mem5wu.js +0 -1
- package/dist/elements/chunks/define-B_tXMYRm.js +0 -1
- package/dist/elements/chunks/disclosure-DAoYOKew.js +0 -1
- package/dist/elements/chunks/dropdown-CmNna5lT.js +0 -1
- package/dist/elements/chunks/embed-CjAD2jSi.js +0 -1
- package/dist/elements/chunks/form-Cp8Y00Wn.js +0 -1
- package/dist/elements/chunks/hover-card-6KtXpLwT.js +0 -1
- package/dist/elements/chunks/icon-97R8SR2p.js +0 -1
- package/dist/elements/chunks/input-DrseEjhp.js +0 -1
- package/dist/elements/chunks/message-CE4k-qaj.js +0 -1
- package/dist/elements/chunks/message-square-C9ovmtOo.js +0 -1
- package/dist/elements/chunks/reasoning-BrxQfpfI.js +0 -1
- package/dist/elements/chunks/scroll-button-CrTo7wm4.js +0 -1
- package/dist/elements/chunks/share-DgNbkJKY.js +0 -1
- package/dist/elements/chunks/slots-CIw9RlAe.js +0 -1
- package/dist/elements/chunks/store-HIPGhNz9.js +0 -1
- package/dist/elements/chunks/textarea-DPfuhswM.js +0 -1
- package/dist/elements/chunks/variant-custom-D5ZlmziF.js +0 -1
- package/dist/elements/chunks/video-Bb86fVYI.js +0 -1
- package/dist/elements/chunks/x-BOhjBeOd.js +0 -1
- package/dist/primitives/card-validate-generator.testlib.d.ts +0 -20
- package/dist/register-impl-DGmGzrEM.js +0 -145
- package/dist/variant-custom-MkTNTycd.js +0 -1
- package/src/primitives/card-validate-generator.testlib.ts +0 -38
package/dist/kai-provider.es.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
const
|
|
1
|
+
const H = "kitn-card";
|
|
2
2
|
function J(t, e) {
|
|
3
3
|
return function(i) {
|
|
4
|
-
return { protocol:
|
|
4
|
+
return { protocol: H, version: t, nonce: e, message: i };
|
|
5
5
|
};
|
|
6
6
|
}
|
|
7
7
|
function q(t, e) {
|
|
8
8
|
if (typeof t != "object" || t === null) return !1;
|
|
9
9
|
const r = t, i = r.message;
|
|
10
|
-
return r.protocol ===
|
|
10
|
+
return r.protocol === H && typeof r.version == "string" && typeof r.nonce == "string" && typeof i == "object" && i !== null && i.dir === e;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function U(t, e) {
|
|
13
13
|
return typeof t == "string" && t.length > 0 && t === e;
|
|
14
14
|
}
|
|
15
15
|
const K = /* @__PURE__ */ new Set(["protocol", "version", "dir", "kind", "mode", "locale", "edge", "code", "acceptedVersion", "supportedVersions", "cardId", "type", "id", "height", "target"]), P = /* @__PURE__ */ new Set(["authToken", "nonce"]);
|
|
@@ -42,9 +42,9 @@ function L(t) {
|
|
|
42
42
|
const W = 1;
|
|
43
43
|
function Y(t, e) {
|
|
44
44
|
let r = -1;
|
|
45
|
-
const i = new ResizeObserver((
|
|
46
|
-
var u;
|
|
47
|
-
const o = ((
|
|
45
|
+
const i = new ResizeObserver(() => {
|
|
46
|
+
var c, u;
|
|
47
|
+
const d = t.ownerDocument, o = ((c = d == null ? void 0 : d.body) == null ? void 0 : c.scrollHeight) ?? ((u = d == null ? void 0 : d.documentElement) == null ? void 0 : u.scrollHeight) ?? t.getBoundingClientRect().height;
|
|
48
48
|
(r < 0 || Math.abs(o - r) > W) && (r = o, e(o));
|
|
49
49
|
});
|
|
50
50
|
return i.observe(t), () => i.disconnect();
|
|
@@ -69,20 +69,20 @@ function G(t, e) {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
function j(t, e, r, i) {
|
|
72
|
-
const d = r || "(root)", o = (
|
|
73
|
-
i.push({ path: l, keyword:
|
|
72
|
+
const d = r || "(root)", o = (c, u, l = d) => {
|
|
73
|
+
i.push({ path: l, keyword: c, message: `${l}: ${u}` });
|
|
74
74
|
};
|
|
75
75
|
if (t.type && !G(e, t.type)) {
|
|
76
76
|
o("type", `expected ${t.type}, got ${N(e)}`);
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
79
|
-
if ("const" in t && JSON.stringify(e) !== JSON.stringify(t.const) && o("const", `must equal const ${JSON.stringify(t.const)}`), t.enum && !t.enum.some((
|
|
80
|
-
const
|
|
81
|
-
for (const
|
|
82
|
-
(!(
|
|
79
|
+
if ("const" in t && JSON.stringify(e) !== JSON.stringify(t.const) && o("const", `must equal const ${JSON.stringify(t.const)}`), t.enum && !t.enum.some((c) => JSON.stringify(c) === JSON.stringify(e)) && o("enum", `must be one of ${JSON.stringify(t.enum)}`), typeof e == "number" && (t.minimum !== void 0 && e < t.minimum && o("minimum", `< minimum ${t.minimum}`), t.maximum !== void 0 && e > t.maximum && o("maximum", `> maximum ${t.maximum}`), t.exclusiveMinimum !== void 0 && e <= t.exclusiveMinimum && o("exclusiveMinimum", "<= exclusiveMinimum"), t.exclusiveMaximum !== void 0 && e >= t.exclusiveMaximum && o("exclusiveMaximum", ">= exclusiveMaximum")), typeof e == "string" && (t.minLength !== void 0 && e.length < t.minLength && o("minLength", `shorter than minLength ${t.minLength}`), t.maxLength !== void 0 && e.length > t.maxLength && o("maxLength", `longer than maxLength ${t.maxLength}`), t.pattern !== void 0 && !new RegExp(t.pattern).test(e) && o("pattern", "does not match pattern")), Array.isArray(e) && (t.minItems !== void 0 && e.length < t.minItems && o("minItems", `fewer than minItems ${t.minItems}`), t.maxItems !== void 0 && e.length > t.maxItems && o("maxItems", `more than maxItems ${t.maxItems}`), t.uniqueItems && new Set(e.map((u) => JSON.stringify(u))).size !== e.length && o("uniqueItems", "items not unique"), t.items && e.forEach((c, u) => j(t.items, c, `${d}[${u}]`, i))), N(e) === "object") {
|
|
80
|
+
const c = e;
|
|
81
|
+
for (const u of t.required ?? [])
|
|
82
|
+
(!(u in c) || c[u] === void 0) && o("required", "required", `${d}.${u}`);
|
|
83
83
|
if (t.properties)
|
|
84
|
-
for (const [
|
|
85
|
-
|
|
84
|
+
for (const [u, l] of Object.entries(t.properties))
|
|
85
|
+
u in c && c[u] !== void 0 && j(l, c[u], `${d}.${u}`, i);
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
function Q(t, e) {
|
|
@@ -95,18 +95,18 @@ function Z() {
|
|
|
95
95
|
}
|
|
96
96
|
function v(t) {
|
|
97
97
|
const { root: e, renderers: r } = t, i = t.supportedVersions ?? X, d = new Map(r.map((n) => [n.type, n]));
|
|
98
|
-
let o = null,
|
|
99
|
-
const
|
|
100
|
-
function
|
|
98
|
+
let o = null, c = null, u = null, l = null, b = null, h = !1, k = null, p = null, x = null, g = null, m = null, w = null;
|
|
99
|
+
const E = (n) => JSON.stringify((n == null ? void 0 : n.theme) ?? null);
|
|
100
|
+
function a(n) {
|
|
101
101
|
try {
|
|
102
102
|
console.warn("[kai-remote]", A(n));
|
|
103
103
|
} catch {
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
function O(n) {
|
|
107
|
-
if (!(!
|
|
107
|
+
if (!(!b || !c))
|
|
108
108
|
try {
|
|
109
|
-
parent.postMessage(
|
|
109
|
+
parent.postMessage(b(n), c);
|
|
110
110
|
} catch {
|
|
111
111
|
}
|
|
112
112
|
}
|
|
@@ -124,15 +124,15 @@ function v(t) {
|
|
|
124
124
|
}
|
|
125
125
|
g = null, p = null, x = null, w = null;
|
|
126
126
|
}
|
|
127
|
-
function
|
|
128
|
-
|
|
127
|
+
function C() {
|
|
128
|
+
m == null || m(), m = null, m = Y(e, (n) => {
|
|
129
129
|
p && $.emit({ kind: "resize", cardId: p, height: n });
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
132
|
function I(n, s) {
|
|
133
133
|
S(), e.replaceChildren();
|
|
134
134
|
const f = document.createElement("div");
|
|
135
|
-
f.setAttribute("role", "alert"), f.textContent = `Unsupported card: ${n.type}`, e.appendChild(f), p = n.id,
|
|
135
|
+
f.setAttribute("role", "alert"), f.textContent = `Unsupported card: ${n.type}`, e.appendChild(f), p = n.id, C(), $.emit({ kind: "error", cardId: n.id, message: s });
|
|
136
136
|
}
|
|
137
137
|
function M(n) {
|
|
138
138
|
if (L(n.data)) {
|
|
@@ -154,15 +154,15 @@ function v(t) {
|
|
|
154
154
|
S(), e.replaceChildren();
|
|
155
155
|
try {
|
|
156
156
|
g = s.mount(e, n, $) ?? (() => {
|
|
157
|
-
}), p = n.id, x = n, w =
|
|
157
|
+
}), p = n.id, x = n, w = E(k);
|
|
158
158
|
} catch {
|
|
159
159
|
g = null, p = n.id, O({ dir: "up", kind: "fault", code: "render-failed", message: "card failed to render" });
|
|
160
160
|
return;
|
|
161
161
|
}
|
|
162
|
-
|
|
162
|
+
C();
|
|
163
163
|
}
|
|
164
164
|
function R(n) {
|
|
165
|
-
if (
|
|
165
|
+
if (h) return;
|
|
166
166
|
const s = n.data;
|
|
167
167
|
if (o === null) {
|
|
168
168
|
if (!q(s, "down") || s.message.kind !== "hello" || n.source !== window.parent) return;
|
|
@@ -175,30 +175,30 @@ function v(t) {
|
|
|
175
175
|
);
|
|
176
176
|
} catch {
|
|
177
177
|
}
|
|
178
|
-
|
|
178
|
+
h = !0;
|
|
179
179
|
return;
|
|
180
180
|
}
|
|
181
|
-
o = n.source,
|
|
181
|
+
o = n.source, c = _, u = T, l = y, b = J(l, u), O({ dir: "up", kind: "ready", acceptedVersion: l, capabilities: { types: r.map((F) => F.type) } });
|
|
182
182
|
return;
|
|
183
183
|
}
|
|
184
184
|
if (n.source !== o) {
|
|
185
|
-
|
|
185
|
+
a(s);
|
|
186
186
|
return;
|
|
187
187
|
}
|
|
188
|
-
if (!
|
|
189
|
-
|
|
188
|
+
if (!U(n.origin, c)) {
|
|
189
|
+
a(s);
|
|
190
190
|
return;
|
|
191
191
|
}
|
|
192
192
|
if (!q(s, "down")) {
|
|
193
|
-
|
|
193
|
+
a(s);
|
|
194
194
|
return;
|
|
195
195
|
}
|
|
196
|
-
if (s.nonce !==
|
|
197
|
-
|
|
196
|
+
if (s.nonce !== u) {
|
|
197
|
+
a(s);
|
|
198
198
|
return;
|
|
199
199
|
}
|
|
200
200
|
if (s.version !== l) {
|
|
201
|
-
|
|
201
|
+
a(s);
|
|
202
202
|
return;
|
|
203
203
|
}
|
|
204
204
|
try {
|
|
@@ -208,7 +208,7 @@ function v(t) {
|
|
|
208
208
|
return;
|
|
209
209
|
case "context": {
|
|
210
210
|
const y = f.context;
|
|
211
|
-
k = y, x &&
|
|
211
|
+
k = y, x && E(y) !== w && M(x);
|
|
212
212
|
return;
|
|
213
213
|
}
|
|
214
214
|
case "render":
|
|
@@ -218,22 +218,22 @@ function v(t) {
|
|
|
218
218
|
V();
|
|
219
219
|
return;
|
|
220
220
|
default:
|
|
221
|
-
|
|
221
|
+
a(s);
|
|
222
222
|
return;
|
|
223
223
|
}
|
|
224
224
|
} catch {
|
|
225
|
-
|
|
225
|
+
a(s);
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
function V() {
|
|
229
|
-
S(),
|
|
229
|
+
S(), m && (m(), m = null), e.replaceChildren();
|
|
230
230
|
}
|
|
231
231
|
return {
|
|
232
232
|
start() {
|
|
233
233
|
window.addEventListener("message", R);
|
|
234
234
|
},
|
|
235
235
|
stop() {
|
|
236
|
-
|
|
236
|
+
h = !0, window.removeEventListener("message", R), V();
|
|
237
237
|
}
|
|
238
238
|
};
|
|
239
239
|
}
|
package/dist/kai.es.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const Sn={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")},On={"github-dark-dimmed":()=>import("./github-dark-dimmed-DUshB20C.js"),"github-light":()=>import("./github-light-JYsPkUQd.js")},xn={js:"javascript",ts:"typescript",jsx:"tsx",sh:"bash",shell:"bash"},Nt="github-dark-dimmed";let Ot=!0,xt={...Sn},At={...On},kt={...xn},jt=null;const zt=new Set,Ft=new Set;function An(){return jt||(jt=(async()=>{const[{createHighlighterCore:t},{createJavaScriptRegexEngine:n}]=await Promise.all([import("./core-C8fzo39E.js"),import("./engine-javascript-C1x7zo1_.js")]);return t({themes:[],langs:[],engine:n()})})()),jt}function Lt(t){return kt[t]??t}async function kn(t,n){const e=Lt(n);if(zt.has(e))return!0;const r=xt[e];return r?(await t.loadLanguage(r()),zt.add(e),!0):!1}async function Rt(t,n){if(Ft.has(n))return!0;const e=At[n];return e?(await t.loadTheme(e()),Ft.add(n),!0):!1}function jn(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function lt(t){return`<pre><code>${jn(t)}</code></pre>`}async function Pn(t,n,e){if(!Ot||!t)return lt(t);try{const r=await An();if(!await kn(r,n))return lt(t);const o=await Rt(r,e)?e:await Rt(r,Nt)?Nt:null;return o?r.codeToHtml(t,{lang:Lt(n),theme:o}):lt(t)}catch{return lt(t)}}function _n(t){t.enabled!==void 0&&(Ot=t.enabled),t.languages&&(xt={...xt,...t.languages}),t.themes&&(At={...At,...t.themes}),t.aliases&&(kt={...kt,...t.aliases})}function qn(){return Ot}function Cn(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 p={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return Kt(this.context.count)},getNextContextId(){return Kt(this.context.count++)}};function Kt(t){const n=String(t),e=n.length-1;return p.context.id+(e?String.fromCharCode(96+e):"")+n}function Pt(t){p.context=t}function Vn(){return{...p.context,id:p.getNextContextId(),count:0}}const Oe=!1,En=(t,n)=>t===n,E=Symbol("solid-proxy"),Jt=typeof Proxy=="function",X=Symbol("solid-track"),xe=Symbol("solid-dev-component"),at={equals:En};let Y=null,Ut=en;const P=1,Z=2,Wt={owned:null,cleanups:null,context:null,owner:null},_t={};var f=null;let c=null,J=null,U=null,g=null,b=null,O=null,ft=0;function F(t,n){const e=g,r=f,o=t.length===0,s=n===void 0?r:n,i=o?Wt:{owned:null,cleanups:null,context:s?s.context:null,owner:s},u=o?t:()=>t(()=>m(()=>z(i)));f=i,g=null;try{return k(u,!0)}finally{g=e,f=r}}function M(t,n){n=n?Object.assign({},at,n):at;const e={value:t,observers:null,observerSlots:null,comparator:n.equals||void 0},r=o=>(typeof o=="function"&&(c&&c.running&&c.sources.has(e)?o=o(e.tValue):o=o(e.value)),tn(e,o));return[Zt.bind(e),r]}function Bt(t,n,e){const r=et(t,n,!0,P);J&&c&&c.running?b.push(r):W(r)}function Gt(t,n,e){const r=et(t,n,!1,P);J&&c&&c.running?b.push(r):W(r)}function Qt(t,n,e){Ut=Kn;const r=et(t,n,!1,P),o=nt&&Ct(nt);o&&(r.suspense=o),(!e||!e.render)&&(r.user=!0),O?O.push(r):W(r)}function A(t,n,e){e=e?Object.assign({},at,e):at;const r=et(t,n,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=e.equals||void 0,J&&c&&c.running?(r.tState=P,b.push(r)):W(r),Zt.bind(r)}function Mn(t){return t&&typeof t=="object"&&"then"in t}function $n(t,n,e){let r,o,s;typeof n=="function"?(r=t,o=n,s=e||{}):(r=!0,o=t,s=n||{});let i=null,u=_t,l=null,d=!1,h=!1,a="initialValue"in s,w=typeof r=="function"&&A(r);const S=new Set,[_,D]=(s.storage||M)(s.initialValue),[N,K]=M(void 0),[q,C]=M(void 0,{equals:!1}),[V,T]=M(a?"ready":"unresolved");p.context&&(l=p.getNextContextId(),s.ssrLoadFrom==="initial"?u=s.initialValue:p.load&&p.has(l)&&(u=p.load(l)));function H(y,v,$,x){return i===y&&(i=null,x!==void 0&&(a=!0),(y===u||v===u)&&s.onHydrated&&queueMicrotask(()=>s.onHydrated(x,{value:v})),u=_t,c&&y&&d?(c.promises.delete(y),d=!1,k(()=>{c.running=!0,Tt(v,$)},!1)):Tt(v,$)),v}function Tt(y,v){k(()=>{v===void 0&&D(()=>y),T(v!==void 0?"errored":a?"ready":"unresolved"),K(v);for(const $ of S.keys())$.decrement();S.clear()},!1)}function mt(){const y=nt&&Ct(nt),v=_(),$=N();if($!==void 0&&!i)throw $;return g&&!g.user&&y&&Bt(()=>{q(),i&&(y.resolved&&c&&d?c.promises.add(i):S.has(y)||(y.increment(),S.add(y)))}),v}function St(y=!0){if(y!==!1&&h)return;h=!1;const v=w?w():r;if(d=c&&c.running,v==null||v===!1){H(i,m(_));return}c&&i&&c.promises.delete(i);let $;const x=u!==_t?u:m(()=>{try{return o(v,{value:_(),refetching:y})}catch(Q){$=Q}});if($!==void 0){H(i,void 0,ht($),v);return}else if(!Mn(x))return H(i,x,void 0,v),x;return i=x,"v"in x?(x.s===1?H(i,x.v,void 0,v):H(i,void 0,ht(x.v),v),x):(h=!0,queueMicrotask(()=>h=!1),k(()=>{T(a?"refreshing":"pending"),C()},!1),x.then(Q=>H(x,Q,void 0,v),Q=>H(x,void 0,ht(Q),v)))}Object.defineProperties(mt,{state:{get:()=>V()},error:{get:()=>N()},loading:{get(){const y=V();return y==="pending"||y==="refreshing"}},latest:{get(){if(!a)return mt();const y=N();if(y&&!i)throw y;return _()}}});let Ht=f;return w?Bt(()=>(Ht=f,St(!1))):St(!1),[mt,{refetch:y=>Xt(Ht,()=>St(y)),mutate:D}]}function Dn(t){return k(t,!1)}function m(t){if(!U&&g===null)return t();const n=g;g=null;try{return U?U.untrack(t):t()}finally{g=n}}function In(t,n,e){const r=Array.isArray(t);let o,s=e&&e.defer;return i=>{let u;if(r){u=Array(t.length);for(let d=0;d<t.length;d++)u[d]=t[d]()}else u=t();if(s)return s=!1,i;const l=m(()=>n(u,o,i));return o=u,l}}function Tn(t){Qt(()=>m(t))}function tt(t){return f===null||(f.cleanups===null?f.cleanups=[t]:f.cleanups.push(t)),t}function Hn(t,n){Y||(Y=Symbol("error")),f=et(void 0,void 0,!0),f.context={...f.context,[Y]:[n]},c&&c.running&&c.sources.add(f);try{return t()}catch(e){ot(e)}finally{f=f.owner}}function qt(){return g}function Nn(){return f}function Xt(t,n){const e=f,r=g;f=t,g=null;try{return k(n,!0)}catch(o){ot(o)}finally{f=e,g=r}}function zn(t){if(c&&c.running)return t(),c.done;const n=g,e=f;return Promise.resolve().then(()=>{g=n,f=e;let r;return(J||nt)&&(r=c||(c={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),k(t,!1),g=f=null,r?r.done:void 0})}const[Ae,Yt]=M(!1);function Fn(t,n){const e=Symbol("context");return{id:e,Provider:Jn(e),defaultValue:t}}function Ct(t){let n;return f&&f.context&&(n=f.context[t.id])!==void 0?n:t.defaultValue}function Vt(t){const n=A(t),e=A(()=>Et(n()));return e.toArray=()=>{const r=e();return Array.isArray(r)?r:r!=null?[r]:[]},e}let nt;function Zt(){const t=c&&c.running;if(this.sources&&(t?this.tState:this.state))if((t?this.tState:this.state)===P)W(this);else{const n=b;b=null,k(()=>dt(this),!1),b=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&&c.sources.has(this)?this.tValue:this.value}function tn(t,n,e){let r=c&&c.running&&c.sources.has(t)?t.tValue:t.value;if(!t.comparator||!t.comparator(r,n)){if(c){const o=c.running;(o||!e&&c.sources.has(t))&&(c.sources.add(t),t.tValue=n),o||(t.value=n)}else t.value=n;t.observers&&t.observers.length&&k(()=>{for(let o=0;o<t.observers.length;o+=1){const s=t.observers[o],i=c&&c.running;i&&c.disposed.has(s)||((i?!s.tState:!s.state)&&(s.pure?b.push(s):O.push(s),s.observers&&rn(s)),i?s.tState=P:s.state=P)}if(b.length>1e6)throw b=[],new Error},!1)}return n}function W(t){if(!t.fn)return;z(t);const n=ft;nn(t,c&&c.running&&c.sources.has(t)?t.tValue:t.value,n),c&&!c.running&&c.sources.has(t)&&queueMicrotask(()=>{k(()=>{c&&(c.running=!0),g=f=t,nn(t,t.tValue,n),g=f=null},!1)})}function nn(t,n,e){let r;const o=f,s=g;g=f=t;try{r=t.fn(n)}catch(i){return t.pure&&(c&&c.running?(t.tState=P,t.tOwned&&t.tOwned.forEach(z),t.tOwned=void 0):(t.state=P,t.owned&&t.owned.forEach(z),t.owned=null)),t.updatedAt=e+1,ot(i)}finally{g=s,f=o}(!t.updatedAt||t.updatedAt<=e)&&(t.updatedAt!=null&&"observers"in t?tn(t,r,!0):c&&c.running&&t.pure?(c.sources.has(t)||(t.value=r),c.sources.add(t),t.tValue=r):t.value=r,t.updatedAt=e)}function et(t,n,e,r=P,o){const s={fn:t,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:n,owner:f,context:f?f.context:null,pure:e};if(c&&c.running&&(s.state=0,s.tState=r),f===null||f!==Wt&&(c&&c.running&&f.pure?f.tOwned?f.tOwned.push(s):f.tOwned=[s]:f.owned?f.owned.push(s):f.owned=[s]),U&&s.fn){const i=s.fn,[u,l]=M(void 0,{equals:!1}),d=U.factory(i,l);tt(()=>d.dispose());let h;const a=()=>zn(l).then(()=>{h&&(h.dispose(),h=void 0)});s.fn=w=>(u(),c&&c.running?(h||(h=U.factory(i,a)),h.track(w)):d.track(w))}return s}function rt(t){const n=c&&c.running;if((n?t.tState:t.state)===0)return;if((n?t.tState:t.state)===Z)return dt(t);if(t.suspense&&m(t.suspense.inFallback))return t.suspense.effects.push(t);const e=[t];for(;(t=t.owner)&&(!t.updatedAt||t.updatedAt<ft);){if(n&&c.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,s=e[r+1];for(;(o=o.owner)&&o!==s;)if(c.disposed.has(o))return}if((n?t.tState:t.state)===P)W(t);else if((n?t.tState:t.state)===Z){const o=b;b=null,k(()=>dt(t,e[0]),!1),b=o}}}function k(t,n){if(b)return t();let e=!1;n||(b=[]),O?e=!0:O=[],ft++;try{const r=t();return Ln(e),r}catch(r){e||(O=null),b=null,ot(r)}}function Ln(t){if(b&&(J&&c&&c.running?Rn(b):en(b),b=null),t)return;let n;if(c){if(!c.promises.size&&!c.queue.size){const r=c.sources,o=c.disposed;O.push.apply(O,c.effects),n=c.resolve;for(const s of O)"tState"in s&&(s.state=s.tState),delete s.tState;c=null,k(()=>{for(const s of o)z(s);for(const s of r){if(s.value=s.tValue,s.owned)for(let i=0,u=s.owned.length;i<u;i++)z(s.owned[i]);s.tOwned&&(s.owned=s.tOwned),delete s.tValue,delete s.tOwned,s.tState=0}Yt(!1)},!1)}else if(c.running){c.running=!1,c.effects.push.apply(c.effects,O),O=null,Yt(!0);return}}const e=O;O=null,e.length&&k(()=>Ut(e),!1),n&&n()}function en(t){for(let n=0;n<t.length;n++)rt(t[n])}function Rn(t){for(let n=0;n<t.length;n++){const e=t[n],r=c.queue;r.has(e)||(r.add(e),J(()=>{r.delete(e),k(()=>{c.running=!0,rt(e)},!1),c&&(c.running=!1)}))}}function Kn(t){let n,e=0;for(n=0;n<t.length;n++){const r=t[n];r.user?t[e++]=r:rt(r)}if(p.context){if(p.count){p.effects||(p.effects=[]),p.effects.push(...t.slice(0,e));return}Pt()}for(p.effects&&(p.done||!p.count)&&(t=[...p.effects,...t],e+=p.effects.length,delete p.effects),n=0;n<e;n++)rt(t[n])}function dt(t,n){const e=c&&c.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 s=e?o.tState:o.state;s===P?o!==n&&(!o.updatedAt||o.updatedAt<ft)&&rt(o):s===Z&&dt(o,n)}}}function rn(t){const n=c&&c.running;for(let e=0;e<t.observers.length;e+=1){const r=t.observers[e];(n?!r.tState:!r.state)&&(n?r.tState=Z:r.state=Z,r.pure?b.push(r):O.push(r),r.observers&&rn(r))}}function z(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 s=o.pop(),i=e.observerSlots.pop();r<o.length&&(s.sourceSlots[i]=r,o[r]=s,e.observerSlots[r]=i)}}if(t.tOwned){for(n=t.tOwned.length-1;n>=0;n--)z(t.tOwned[n]);delete t.tOwned}if(c&&c.running&&t.pure)on(t,!0);else if(t.owned){for(n=t.owned.length-1;n>=0;n--)z(t.owned[n]);t.owned=null}if(t.cleanups){for(n=t.cleanups.length-1;n>=0;n--)t.cleanups[n]();t.cleanups=null}c&&c.running?t.tState=0:t.state=0}function on(t,n){if(n||(t.tState=0,c.disposed.add(t)),t.owned)for(let e=0;e<t.owned.length;e++)on(t.owned[e])}function ht(t){return t instanceof Error?t:new Error(typeof t=="string"?t:"Unknown error",{cause:t})}function sn(t,n,e){try{for(const r of n)r(t)}catch(r){ot(r,e&&e.owner||null)}}function ot(t,n=f){const e=Y&&n&&n.context&&n.context[Y],r=ht(t);if(!e)throw r;O?O.push({fn(){sn(r,e,n)},state:P}):sn(r,e,n)}function Et(t){if(typeof t=="function"&&!t.length)return Et(t());if(Array.isArray(t)){const n=[];for(let e=0;e<t.length;e++){const r=Et(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 Jn(t,n){return function(e){let r;return Gt(()=>r=m(()=>(f.context={...f.context,[t]:e.value},Vt(()=>e.children))),void 0),r}}const Mt=Symbol("fallback");function gt(t){for(let n=0;n<t.length;n++)t[n]()}function Un(t,n,e={}){let r=[],o=[],s=[],i=0,u=n.length>1?[]:null;return tt(()=>gt(s)),()=>{let l=t()||[],d=l.length,h,a;return l[X],m(()=>{let S,_,D,N,K,q,C,V,T;if(d===0)i!==0&&(gt(s),s=[],r=[],o=[],i=0,u&&(u=[])),e.fallback&&(r=[Mt],o[0]=F(H=>(s[0]=H,e.fallback())),i=1);else if(i===0){for(o=new Array(d),a=0;a<d;a++)r[a]=l[a],o[a]=F(w);i=d}else{for(D=new Array(d),N=new Array(d),u&&(K=new Array(d)),q=0,C=Math.min(i,d);q<C&&r[q]===l[q];q++);for(C=i-1,V=d-1;C>=q&&V>=q&&r[C]===l[V];C--,V--)D[V]=o[C],N[V]=s[C],u&&(K[V]=u[C]);for(S=new Map,_=new Array(V+1),a=V;a>=q;a--)T=l[a],h=S.get(T),_[a]=h===void 0?-1:h,S.set(T,a);for(h=q;h<=C;h++)T=r[h],a=S.get(T),a!==void 0&&a!==-1?(D[a]=o[h],N[a]=s[h],u&&(K[a]=u[h]),a=_[a],S.set(T,a)):s[h]();for(a=q;a<d;a++)a in D?(o[a]=D[a],s[a]=N[a],u&&(u[a]=K[a],u[a](a))):o[a]=F(w);o=o.slice(0,i=d),r=l.slice(0)}return o});function w(S){if(s[a]=S,u){const[_,D]=M(a);return u[a]=D,n(l[a],_)}return n(l[a])}}}function Wn(t,n,e={}){let r=[],o=[],s=[],i=[],u=0,l;return tt(()=>gt(s)),()=>{const d=t()||[],h=d.length;return d[X],m(()=>{if(h===0)return u!==0&&(gt(s),s=[],r=[],o=[],u=0,i=[]),e.fallback&&(r=[Mt],o[0]=F(w=>(s[0]=w,e.fallback())),u=1),o;for(r[0]===Mt&&(s[0](),s=[],r=[],o=[],u=0),l=0;l<h;l++)l<r.length&&r[l]!==d[l]?i[l](()=>d[l]):l>=r.length&&(o[l]=F(a));for(;l<r.length;l++)s[l]();return u=i.length=s.length=h,r=d.slice(0),o=o.slice(0,u)});function a(w){s[l]=w;const[S,_]=M(d[l]);return i[l]=_,n(S,l)}}}let un=!1;function Bn(){un=!0}function Gn(t,n){if(un&&p.context){const e=p.context;Pt(Vn());const r=m(()=>t(n||{}));return Pt(e),r}return m(()=>t(n||{}))}function pt(){return!0}const $t={get(t,n,e){return n===E?e:t.get(n)},has(t,n){return n===E?!0:t.has(n)},set:pt,deleteProperty:pt,getOwnPropertyDescriptor(t,n){return{configurable:!0,enumerable:!0,get(){return t.get(n)},set:pt,deleteProperty:pt}},ownKeys(t){return t.keys()}};function Dt(t){return(t=typeof t=="function"?t():t)?t:{}}function Qn(){for(let t=0,n=this.length;t<n;++t){const e=this[t]();if(e!==void 0)return e}}function Xn(...t){let n=!1;for(let i=0;i<t.length;i++){const u=t[i];n=n||!!u&&E in u,t[i]=typeof u=="function"?(n=!0,A(u)):u}if(Jt&&n)return new Proxy({get(i){for(let u=t.length-1;u>=0;u--){const l=Dt(t[u])[i];if(l!==void 0)return l}},has(i){for(let u=t.length-1;u>=0;u--)if(i in Dt(t[u]))return!0;return!1},keys(){const i=[];for(let u=0;u<t.length;u++)i.push(...Object.keys(Dt(t[u])));return[...new Set(i)]}},$t);const e={},r=Object.create(null);for(let i=t.length-1;i>=0;i--){const u=t[i];if(!u)continue;const l=Object.getOwnPropertyNames(u);for(let d=l.length-1;d>=0;d--){const h=l[d];if(h==="__proto__"||h==="constructor")continue;const a=Object.getOwnPropertyDescriptor(u,h);if(!r[h])r[h]=a.get?{enumerable:!0,configurable:!0,get:Qn.bind(e[h]=[a.get.bind(u)])}:a.value!==void 0?a:void 0;else{const w=e[h];w&&(a.get?w.push(a.get.bind(u)):a.value!==void 0&&w.push(()=>a.value))}}}const o={},s=Object.keys(r);for(let i=s.length-1;i>=0;i--){const u=s[i],l=r[u];l&&l.get?Object.defineProperty(o,u,l):o[u]=l?l.value:void 0}return o}function Yn(t,...n){const e=n.length;if(Jt&&E in t){const o=e>1?n.flat():n[0],s=n.map(i=>new Proxy({get(u){return i.includes(u)?t[u]:void 0},has(u){return i.includes(u)&&u in t},keys(){return i.filter(u=>u in t)}},$t));return s.push(new Proxy({get(i){return o.includes(i)?void 0:t[i]},has(i){return o.includes(i)?!1:i in t},keys(){return Object.keys(t).filter(i=>!o.includes(i))}},$t)),s}const r=[];for(let o=0;o<=e;o++)r[o]={};for(const o of Object.getOwnPropertyNames(t)){let s=e;for(let u=0;u<n.length;u++)if(n[u].includes(o)){s=u;break}const i=Object.getOwnPropertyDescriptor(t,o);!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable?r[s][o]=i.value:Object.defineProperty(r[s],o,i)}return r}let Zn=0;function te(){return p.context?p.getNextContextId():`cl-${Zn++}`}const cn=t=>`Stale read from <${t}>.`;function ne(t){const n="fallback"in t&&{fallback:()=>t.fallback};return A(Un(()=>t.each,t.children,n||void 0))}function ee(t){const n="fallback"in t&&{fallback:()=>t.fallback};return A(Wn(()=>t.each,t.children,n||void 0))}function re(t){const n=t.keyed,e=A(()=>t.when,void 0,void 0),r=n?e:A(e,void 0,{equals:(o,s)=>!o==!s});return A(()=>{const o=r();if(o){const s=t.children;return typeof s=="function"&&s.length>0?m(()=>s(n?o:()=>{if(!m(r))throw cn("Show");return e()})):s}return t.fallback},void 0,void 0)}function oe(t){const n=Vt(()=>t.children),e=A(()=>{const r=n(),o=Array.isArray(r)?r:[r];let s=()=>{};for(let i=0;i<o.length;i++){const u=i,l=o[i],d=s,h=A(()=>d()?void 0:l.when,void 0,void 0),a=l.keyed?h:A(h,void 0,{equals:(w,S)=>!w==!S});s=()=>d()||(a()?[u,h,l]:void 0)}return s});return A(()=>{const r=e()();if(!r)return t.fallback;const[o,s,i]=r,u=i.children;return typeof u=="function"&&u.length>0?m(()=>u(i.keyed?s():()=>{var l;if(((l=m(e)())==null?void 0:l[0])!==o)throw cn("Match");return s()})):u},void 0,void 0)}function se(t){return t}let yt;function ie(t){let n;p.context&&p.load&&(n=p.load(p.getContextId()));const[e,r]=M(n,void 0);return yt||(yt=new Set),yt.add(r),tt(()=>yt.delete(r)),A(()=>{let o;if(o=e()){const s=t.fallback;return typeof s=="function"&&s.length?m(()=>s(o,()=>r())):s}return Hn(()=>t.children,r)},void 0,void 0)}const vt=Symbol("store-raw"),L=Symbol("store-node"),I=Symbol("store-has"),ln=Symbol("store-self");function an(t){let n=t[E];if(!n&&(Object.defineProperty(t,E,{value:n=new Proxy(t,le)}),!Array.isArray(t))){const e=Object.keys(t),r=Object.getOwnPropertyDescriptors(t),o=Object.getPrototypeOf(t),s=o!==null&&t!==null&&typeof t=="object"&&!Array.isArray(t)&&o!==Object.prototype;if(s){const i=Object.getOwnPropertyDescriptors(o);e.push(...Object.keys(i)),Object.assign(r,i)}for(let i=0,u=e.length;i<u;i++){const l=e[i];s&&l==="constructor"||r[l].get&&Object.defineProperty(t,l,{configurable:!0,enumerable:r[l].enumerable,get:r[l].get.bind(n)})}}return n}function B(t){let n;return t!=null&&typeof t=="object"&&(t[E]||!(n=Object.getPrototypeOf(t))||n===Object.prototype||Array.isArray(t))}function R(t,n=new Set){let e,r,o,s;if(e=t!=null&&t[vt])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 i=0,u=t.length;i<u;i++)o=t[i],(r=R(o,n))!==o&&(t[i]=r)}else{Object.isFrozen(t)?t=Object.assign({},t):n.add(t);const i=Object.keys(t),u=Object.getOwnPropertyDescriptors(t);for(let l=0,d=i.length;l<d;l++)s=i[l],!u[s].get&&(o=t[s],(r=R(o,n))!==o&&(t[s]=r))}return t}function bt(t,n){let e=t[n];return e||Object.defineProperty(t,n,{value:e=Object.create(null)}),e}function st(t,n,e){if(t[n])return t[n];const[r,o]=M(e,{equals:!1,internal:!0});return r.$=o,t[n]=r}function ue(t,n){const e=Reflect.getOwnPropertyDescriptor(t,n);return!e||e.get||!e.configurable||n===E||n===L||(delete e.value,delete e.writable,e.get=()=>t[E][n]),e}function fn(t){qt()&&st(bt(t,L),ln)()}function ce(t){return fn(t),Reflect.ownKeys(t)}const le={get(t,n,e){if(n===vt)return t;if(n===E)return e;if(n===X)return fn(t),e;const r=bt(t,L),o=r[n];let s=o?o():t[n];if(n===L||n===I||n==="__proto__")return s;if(!o){const i=Object.getOwnPropertyDescriptor(t,n);qt()&&(typeof s!="function"||t.hasOwnProperty(n))&&!(i&&i.get)&&(s=st(r,n,s)())}return B(s)?an(s):s},has(t,n){return n===vt||n===E||n===X||n===L||n===I||n==="__proto__"?!0:(qt()&&st(bt(t,I),n)(),n in t)},set(){return!0},deleteProperty(){return!0},ownKeys:ce,getOwnPropertyDescriptor:ue};function G(t,n,e,r=!1){if(n==="__proto__"||!r&&t[n]===e)return;const o=t[n],s=t.length;e===void 0?(delete t[n],t[I]&&t[I][n]&&o!==void 0&&t[I][n].$()):(t[n]=e,t[I]&&t[I][n]&&o===void 0&&t[I][n].$());let i=bt(t,L),u;if((u=st(i,n,o))&&u.$(()=>e),Array.isArray(t)&&t.length!==s){for(let l=t.length;l<s;l++)(u=i[l])&&u.$();(u=st(i,"length",s))&&u.$(t.length)}(u=i[ln])&&u.$()}function dn(t,n){const e=Object.keys(n);for(let r=0;r<e.length;r+=1){const o=e[r];hn(o)||G(t,o,n[o])}}function hn(t){return t==="__proto__"||t==="constructor"||t==="prototype"}function ae(t,n){if(typeof n=="function"&&(n=n(t)),n=R(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 dn(t,n)}function it(t,n,e=[]){let r,o=t;if(n.length>1){r=n.shift();const i=typeof r,u=Array.isArray(t);if(i==="string"&&(r==="__proto__"||n.length>1&&hn(r)))return;if(Array.isArray(r)){for(let l=0;l<r.length;l++)it(t,[r[l]].concat(n),e);return}else if(u&&i==="function"){for(let l=0;l<t.length;l++)r(t[l],l)&&it(t,[l].concat(n),e);return}else if(u&&i==="object"){const{from:l=0,to:d=t.length-1,by:h=1}=r;for(let a=l;a<=d;a+=h)it(t,[a].concat(n),e);return}else if(n.length>1){it(t[r],n,[r].concat(e));return}o=t[r],e=[r].concat(e)}let s=n[0];typeof s=="function"&&(s=s(o,e),s===o)||r===void 0&&s==null||(s=R(s),r===void 0||B(o)&&B(s)&&!Array.isArray(s)?dn(o,s):G(t,r,s))}function gn(...[t,n]){const e=R(t||{}),r=Array.isArray(e),o=an(e);function s(...i){Dn(()=>{r&&i.length===1?ae(e,i[0]):it(e,i)})}return[o,s]}const ke=Symbol("store-root"),wt=new WeakMap,pn={get(t,n){if(n===vt)return t;const e=t[n];if(n===E||n===X||n===L||n===I||n==="__proto__")return e;let r;return B(e)?wt.get(e)||(wt.set(e,r=new Proxy(e,pn)),r):e},set(t,n,e){return G(t,n,R(e)),!0},deleteProperty(t,n){return G(t,n,void 0,!0),!0}};function yn(t){return n=>{if(B(n)){let e;(e=wt.get(n))||wt.set(n,e=new Proxy(n,pn)),t(e)}return n}}let j={};function vn(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 fe(t){j={...j,...t},!(typeof document>"u")&&document.querySelectorAll("kai-toast-region").forEach(n=>vn(n))}const de=5e3,he=7e3,{toasts:It,setToasts:ut,mounted:je,setMounted:ge}=F(()=>{const[t,n]=gn([]),[e,r]=M(!1);return{toasts:t,setToasts:n,mounted:e,setMounted:r}});let bn=0;function pe(){return bn+=1,`toast-${bn}`}function ye(t){const n=t.duration??de;return n===0?0:t.action?Math.max(n,he):n}const wn=new Map;function ve(t=null){if(typeof document>"u")return;const n=wn.get(t);if(n&&n.isConnected)return n;const e=document.createElement("kai-toast-region");return document.body.appendChild(e),e.toasts=It,t&&(e.target=t),vn(e),wn.set(t,e),ge(!0),e}function be(t){const n=It.findIndex(e=>e.id===t.id);n>=0?ut(n,t):ut(yn(e=>{e.push(t)}))}function mn(t){ut(n=>n.filter(e=>e.id!==t))}function we(t){return{id:t,dismiss:()=>mn(t),update:n=>{const e=It.findIndex(r=>r.id===t);e>=0&&ut(e,r=>({...r,...n}))}}}function ct(t,n,e){ve(n?.target??null);const r=n?.id??pe(),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 be(o),we(r)}const me=Object.assign((t,n)=>ct(t,n,"neutral"),{success:(t,n)=>ct(t,n,"success"),warning:(t,n)=>ct(t,n,"warning"),error:(t,n)=>ct(t,n,"error"),info:(t,n)=>ct(t,n,"info"),dismiss:mn,clear:()=>ut([])}),Se=typeof window<"u"&&typeof customElements<"u"?import("./register-impl-DGmGzrEM.js").then(t=>t.r):Promise.resolve();export{ye as A,ie as E,ne as F,ee as I,se as M,re as S,F as a,Gt as b,A as c,Cn as classifyTool,_n as configureCodeHighlighting,fe as configureToasts,Qt as d,Bn as e,Se as elementsReady,M as f,Nn as g,Yn as h,Fn as i,qn as isCodeHighlightingEnabled,Gn as j,Ct as k,te as l,Xn as m,Tn as n,tt as o,In as p,$n as q,Xt as r,p as s,Pn as t,me as toast,m as u,oe as v,gn as w,yn as x,R as y,Vt as z};
|
|
1
|
+
const qn={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")},En={"github-dark-dimmed":()=>import("./github-dark-dimmed-DUshB20C.js"),"github-light":()=>import("./github-light-JYsPkUQd.js")},Vn={js:"javascript",ts:"typescript",jsx:"tsx",sh:"bash",shell:"bash"},Lt="github-dark-dimmed";let xt=!0,Ot={...qn},St={...En},At={...Vn},jt=null;const Kt=new Set,Ut=new Set;function zn(){return jt||(jt=(async()=>{const[{createHighlighterCore:t},{createJavaScriptRegexEngine:n}]=await Promise.all([import("./core-C8fzo39E.js"),import("./engine-javascript-C1x7zo1_.js")]);return t({themes:[],langs:[],engine:n()})})()),jt}function Jt(t){return At[t]??t}async function $n(t,n){const e=Jt(n);if(Kt.has(e))return!0;const r=Ot[e];return r?(await t.loadLanguage(r()),Kt.add(e),!0):!1}async function Bt(t,n){if(Ut.has(n))return!0;const e=St[n];return e?(await t.loadTheme(e()),Ut.add(n),!0):!1}function Dn(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function ut(t){return`<pre><code>${Dn(t)}</code></pre>`}async function In(t,n,e){if(!xt||!t)return ut(t);try{const r=await zn();if(!await $n(r,n))return ut(t);const o=await Bt(r,e)?e:await Bt(r,Lt)?Lt:null;return o?r.codeToHtml(t,{lang:Jt(n),theme:o}):ut(t)}catch{return ut(t)}}function Mn(t){t.enabled!==void 0&&(xt=t.enabled),t.languages&&(Ot={...Ot,...t.languages}),t.themes&&(St={...St,...t.themes}),t.aliases&&(At={...At,...t.aliases})}function Tn(){return xt}function Fn(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 Pt=Symbol.for("kai.wire.diagnostics.v1");function _t(){return globalThis[Pt]}function Gt(){const t=globalThis;return t[Pt]??(t[Pt]={subs:[],seq:0,payload:!1})}function Nn(t){const n=Gt().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 Ct(){const t=_t();return t!==void 0&&t.subs.length>0}function Hn(t){!t&&_t()===void 0||(Gt().payload=t)}function Wt(t){const n=_t();if(n)for(const e of[...n.subs])try{e(t)}catch{}}const Rn={"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","kindIcons","messages","models","suggestions","triggers","value"],"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-group":["tabs"],"kai-prompt-input":["attachments","kindIcons","suggestions","triggers","value"],"kai-remote":["envelope","policy"],"kai-resizable":["maximizedIndex"],"kai-response-stream":["text"],"kai-scope-picker":["availableAuthors","availableTags"],"kai-segmented":["options"],"kai-skills":["skills"],"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"]},Ln={"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-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-agent-card":"agent-card","kai-dialog":"dialog","kai-dock":"dock","kai-input":"input","kai-search":"search","kai-kbd":"kbd","kai-editable-label":"editable-label"},Zt=Rn;function Kn(t){return t.replace(/\.?([A-Z]+)/g,(n,e)=>"-"+e.toLowerCase()).replace("_","-").replace(/^-/,"")}function Un(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 qt(t,n,e,r){const o={type:"element.violation",t:Date.now(),kind:t,tag:n,prop:e,...r};Wt(o)}const Qt=Symbol.for("kai.element.diagnostics.installed.v1");function Jn(t){const n=Zt[t];return n!==void 0&&n.length>0}function Bn(t,n){const e=Zt[t];if(!e||e.length===0)return;const r=n;if(r[Qt])return;r[Qt]=!0;const o=n,i=new Map;for(const c of e)i.set(Kn(c),c);const s=o.attributeChangedCallback;o.attributeChangedCallback=function(c,d,f){if(f!==null&&Ct())try{const l=i.get(c);if(l!==void 0){const k=Un(f);k!==void 0&&qt("array-prop-as-attribute",t,l,{valuePreview:k})}}catch{}s?.call(this,c,d,f)};const a=o.connectedCallback;o.connectedCallback=function(){var c;a?.call(this);try{(c=this.addPropertyChangedCallback)==null||c.call(this,(d,f,l)=>{if(Ct())try{if(!Array.isArray(f))return;if(f===l){qt("same-array-reference",t,d,{length:f.length});return}if(!Array.isArray(l)||f.length===0||l.length!==f.length)return;for(let k=0;k<f.length;k++)if(f[k]!==l[k])return;qt("mutated-in-place",t,d,{length:f.length})}catch{}})}catch{}}}const Xt=Object.keys(Ln);function Gn(){if(typeof customElements>"u"||!Ct())return;const t=[],n=[];for(const r of Xt)(customElements.get(r)?t:n).push(r);const e={type:"element.registry",t:Date.now(),defined:t,notDefined:n,total:Xt.length};return Wt(e),e}const h={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return Yt(this.context.count)},getNextContextId(){return Yt(this.context.count++)}};function Yt(t){const n=String(t),e=n.length-1;return h.context.id+(e?String.fromCharCode(96+e):"")+n}function Et(t){h.context=t}function Wn(){return{...h.context,id:h.getNextContextId(),count:0}}const Ne=!1,Zn=(t,n)=>t===n,V=Symbol("solid-proxy"),tn=typeof Proxy=="function",Q=Symbol("solid-track"),He=Symbol("solid-dev-component"),lt={equals:Zn};let X=null,nn=dn;const P=1,Y=2,en={owned:null,cleanups:null,context:null,owner:null},Vt={};var p=null;let u=null,U=null,J=null,g=null,b=null,x=null,ft=0;function H(t,n){const e=g,r=p,o=t.length===0,i=n===void 0?r:n,s=o?en:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?t:()=>t(()=>m(()=>N(s)));p=s,g=null;try{return A(a,!0)}finally{g=e,p=r}}function z(t,n){n=n?Object.assign({},lt,n):lt;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)),ln(e,o));return[un.bind(e),r]}function rn(t,n,e){const r=et(t,n,!0,P);U&&u&&u.running?b.push(r):B(r)}function on(t,n,e){const r=et(t,n,!1,P);U&&u&&u.running?b.push(r):B(r)}function sn(t,n,e){nn=ce;const r=et(t,n,!1,P),o=nt&&$t(nt);o&&(r.suspense=o),(!e||!e.render)&&(r.user=!0),x?x.push(r):B(r)}function S(t,n,e){e=e?Object.assign({},lt,e):lt;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,b.push(r)):B(r),un.bind(r)}function Qn(t){return t&&typeof t=="object"&&"then"in t}function Xn(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=Vt,c=null,d=!1,f=!1,l="initialValue"in i,k=typeof r=="function"&&S(r);const w=new Set,[_,D]=(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(v,y,$,O){return s===v&&(s=null,O!==void 0&&(l=!0),(v===a||y===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(O,{value:y})),a=Vt,u&&v&&d?(u.promises.delete(v),d=!1,A(()=>{u.running=!0,Ht(y,$)},!1)):Ht(y,$)),y}function Ht(v,y){A(()=>{y===void 0&&D(()=>v),M(y!==void 0?"errored":l?"ready":"unresolved"),K(y);for(const $ of w.keys())$.decrement();w.clear()},!1)}function mt(){const v=nt&&$t(nt),y=_(),$=F();if($!==void 0&&!s)throw $;return g&&!g.user&&v&&rn(()=>{C(),s&&(v.resolved&&u&&d?u.promises.add(s):w.has(v)||(v.increment(),w.add(v)))}),y}function wt(v=!0){if(v!==!1&&f)return;f=!1;const y=k?k():r;if(d=u&&u.running,y==null||y===!1){T(s,m(_));return}u&&s&&u.promises.delete(s);let $;const O=a!==Vt?a:m(()=>{try{return o(y,{value:_(),refetching:v})}catch(Z){$=Z}});if($!==void 0){T(s,void 0,pt($),y);return}else if(!Qn(O))return T(s,O,void 0,y),O;return s=O,"v"in O?(O.s===1?T(s,O.v,void 0,y):T(s,void 0,pt(O.v),y),O):(f=!0,queueMicrotask(()=>f=!1),A(()=>{M(l?"refreshing":"pending"),q()},!1),O.then(Z=>T(O,Z,void 0,y),Z=>T(O,void 0,pt(Z),y)))}Object.defineProperties(mt,{state:{get:()=>E()},error:{get:()=>F()},loading:{get(){const v=E();return v==="pending"||v==="refreshing"}},latest:{get(){if(!l)return mt();const v=F();if(v&&!s)throw v;return _()}}});let Rt=p;return k?rn(()=>(Rt=p,wt(!1))):wt(!1),[mt,{refetch:v=>an(Rt,()=>wt(v)),mutate:D}]}function Yn(t){return A(t,!1)}function m(t){if(!J&&g===null)return t();const n=g;g=null;try{return J?J.untrack(t):t()}finally{g=n}}function te(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 d=0;d<t.length;d++)a[d]=t[d]()}else a=t();if(i)return i=!1,s;const c=m(()=>n(a,o,s));return o=a,c}}function ne(t){sn(()=>m(t))}function tt(t){return p===null||(p.cleanups===null?p.cleanups=[t]:p.cleanups.push(t)),t}function ee(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 zt(){return g}function re(){return p}function an(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 oe(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[Re,cn]=z(!1);function ie(t,n){const e=Symbol("context");return{id:e,Provider:ue(e),defaultValue:t}}function $t(t){let n;return p&&p.context&&(n=p.context[t.id])!==void 0?n:t.defaultValue}function Dt(t){const n=S(t),e=S(()=>It(n()));return e.toArray=()=>{const r=e();return Array.isArray(r)?r:r!=null?[r]:[]},e}let nt;function un(){const t=u&&u.running;if(this.sources&&(t?this.tState:this.state))if((t?this.tState:this.state)===P)B(this);else{const n=b;b=null,A(()=>dt(this),!1),b=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 ln(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?b.push(i):x.push(i),i.observers&&pn(i)),s?i.tState=P:i.state=P)}if(b.length>1e6)throw b=[],new Error},!1)}return n}function B(t){if(!t.fn)return;N(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(N),t.tOwned=void 0):(t.state=P,t.owned&&t.owned.forEach(N),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?ln(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!==en&&(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}),d=J.factory(s,c);tt(()=>d.dispose());let f;const l=()=>oe(c).then(()=>{f&&(f.dispose(),f=void 0)});i.fn=k=>(a(),u&&u.running?(f||(f=J.factory(s,l)),f.track(k)):d.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 dt(t);if(t.suspense&&m(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)B(t);else if((n?t.tState:t.state)===Y){const o=b;b=null,A(()=>dt(t,e[0]),!1),b=o}}}function A(t,n){if(b)return t();let e=!1;n||(b=[]),x?e=!0:x=[],ft++;try{const r=t();return se(e),r}catch(r){e||(x=null),b=null,ot(r)}}function se(t){if(b&&(U&&u&&u.running?ae(b):dn(b),b=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)N(i);for(const i of r){if(i.value=i.tValue,i.owned)for(let s=0,a=i.owned.length;s<a;s++)N(i.owned[s]);i.tOwned&&(i.owned=i.tOwned),delete i.tValue,delete i.tOwned,i.tState=0}cn(!1)},!1)}else if(u.running){u.running=!1,u.effects.push.apply(u.effects,x),x=null,cn(!0);return}}const e=x;x=null,e.length&&A(()=>nn(e),!1),n&&n()}function dn(t){for(let n=0;n<t.length;n++)rt(t[n])}function ae(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 ce(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}Et()}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 dt(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&&dt(o,n)}}}function pn(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?b.push(r):x.push(r),r.observers&&pn(r))}}function N(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--)N(t.tOwned[n]);delete t.tOwned}if(u&&u.running&&t.pure)gn(t,!0);else if(t.owned){for(n=t.owned.length-1;n>=0;n--)N(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 gn(t,n){if(n||(t.tState=0,u.disposed.add(t)),t.owned)for(let e=0;e<t.owned.length;e++)gn(t.owned[e])}function pt(t){return t instanceof Error?t:new Error(typeof t=="string"?t:"Unknown error",{cause:t})}function hn(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=pt(t);if(!e)throw r;x?x.push({fn(){hn(r,e,n)},state:P}):hn(r,e,n)}function It(t){if(typeof t=="function"&&!t.length)return It(t());if(Array.isArray(t)){const n=[];for(let e=0;e<t.length;e++){const r=It(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 ue(t,n){return function(e){let r;return on(()=>r=m(()=>(p.context={...p.context,[t]:e.value},Dt(()=>e.children))),void 0),r}}const Mt=Symbol("fallback");function gt(t){for(let n=0;n<t.length;n++)t[n]()}function le(t,n,e={}){let r=[],o=[],i=[],s=0,a=n.length>1?[]:null;return tt(()=>gt(i)),()=>{let c=t()||[],d=c.length,f,l;return c[Q],m(()=>{let w,_,D,F,K,C,q,E,M;if(d===0)s!==0&&(gt(i),i=[],r=[],o=[],s=0,a&&(a=[])),e.fallback&&(r=[Mt],o[0]=H(T=>(i[0]=T,e.fallback())),s=1);else if(s===0){for(o=new Array(d),l=0;l<d;l++)r[l]=c[l],o[l]=H(k);s=d}else{for(D=new Array(d),F=new Array(d),a&&(K=new Array(d)),C=0,q=Math.min(s,d);C<q&&r[C]===c[C];C++);for(q=s-1,E=d-1;q>=C&&E>=C&&r[q]===c[E];q--,E--)D[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],f=w.get(M),_[l]=f===void 0?-1:f,w.set(M,l);for(f=C;f<=q;f++)M=r[f],l=w.get(M),l!==void 0&&l!==-1?(D[l]=o[f],F[l]=i[f],a&&(K[l]=a[f]),l=_[l],w.set(M,l)):i[f]();for(l=C;l<d;l++)l in D?(o[l]=D[l],i[l]=F[l],a&&(a[l]=K[l],a[l](l))):o[l]=H(k);o=o.slice(0,s=d),r=c.slice(0)}return o});function k(w){if(i[l]=w,a){const[_,D]=z(l);return a[l]=D,n(c[l],_)}return n(c[l])}}}function fe(t,n,e={}){let r=[],o=[],i=[],s=[],a=0,c;return tt(()=>gt(i)),()=>{const d=t()||[],f=d.length;return d[Q],m(()=>{if(f===0)return a!==0&&(gt(i),i=[],r=[],o=[],a=0,s=[]),e.fallback&&(r=[Mt],o[0]=H(k=>(i[0]=k,e.fallback())),a=1),o;for(r[0]===Mt&&(i[0](),i=[],r=[],o=[],a=0),c=0;c<f;c++)c<r.length&&r[c]!==d[c]?s[c](()=>d[c]):c>=r.length&&(o[c]=H(l));for(;c<r.length;c++)i[c]();return a=s.length=i.length=f,r=d.slice(0),o=o.slice(0,a)});function l(k){i[c]=k;const[w,_]=z(d[c]);return s[c]=_,n(w,c)}}}let kn=!1;function de(){kn=!0}function pe(t,n){if(kn&&h.context){const e=h.context;Et(Wn());const r=m(()=>t(n||{}));return Et(e),r}return m(()=>t(n||{}))}function ht(){return!0}const Tt={get(t,n,e){return n===V?e:t.get(n)},has(t,n){return n===V?!0:t.has(n)},set:ht,deleteProperty:ht,getOwnPropertyDescriptor(t,n){return{configurable:!0,enumerable:!0,get(){return t.get(n)},set:ht,deleteProperty:ht}},ownKeys(t){return t.keys()}};function Ft(t){return(t=typeof t=="function"?t():t)?t:{}}function ge(){for(let t=0,n=this.length;t<n;++t){const e=this[t]();if(e!==void 0)return e}}function he(...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,S(a)):a}if(tn&&n)return new Proxy({get(s){for(let a=t.length-1;a>=0;a--){const c=Ft(t[a])[s];if(c!==void 0)return c}},has(s){for(let a=t.length-1;a>=0;a--)if(s in Ft(t[a]))return!0;return!1},keys(){const s=[];for(let a=0;a<t.length;a++)s.push(...Object.keys(Ft(t[a])));return[...new Set(s)]}},Tt);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 d=c.length-1;d>=0;d--){const f=c[d];if(f==="__proto__"||f==="constructor")continue;const l=Object.getOwnPropertyDescriptor(a,f);if(!r[f])r[f]=l.get?{enumerable:!0,configurable:!0,get:ge.bind(e[f]=[l.get.bind(a)])}:l.value!==void 0?l:void 0;else{const k=e[f];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 ke(t,...n){const e=n.length;if(tn&&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)}},Tt));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))}},Tt)),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 vn=t=>`Stale read from <${t}>.`;function be(t){const n="fallback"in t&&{fallback:()=>t.fallback};return S(le(()=>t.each,t.children,n||void 0))}function me(t){const n="fallback"in t&&{fallback:()=>t.fallback};return S(fe(()=>t.each,t.children,n||void 0))}function we(t){const n=t.keyed,e=S(()=>t.when,void 0,void 0),r=n?e:S(e,void 0,{equals:(o,i)=>!o==!i});return S(()=>{const o=r();if(o){const i=t.children;return typeof i=="function"&&i.length>0?m(()=>i(n?o:()=>{if(!m(r))throw vn("Show");return e()})):i}return t.fallback},void 0,void 0)}function xe(t){const n=Dt(()=>t.children),e=S(()=>{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],d=i,f=S(()=>d()?void 0:c.when,void 0,void 0),l=c.keyed?f:S(f,void 0,{equals:(k,w)=>!k==!w});i=()=>d()||(l()?[a,f,c]:void 0)}return i});return S(()=>{const r=e()();if(!r)return t.fallback;const[o,i,s]=r,a=s.children;return typeof a=="function"&&a.length>0?m(()=>a(s.keyed?i():()=>{var c;if(((c=m(e)())==null?void 0:c[0])!==o)throw vn("Match");return i()})):a},void 0,void 0)}function Oe(t){return t}let kt;function Se(t){let n;h.context&&h.load&&(n=h.load(h.getContextId()));const[e,r]=z(n,void 0);return kt||(kt=new Set),kt.add(r),tt(()=>kt.delete(r)),S(()=>{let o;if(o=e()){const i=t.fallback;return typeof i=="function"&&i.length?m(()=>i(o,()=>r())):i}return ee(()=>t.children,r)},void 0,void 0)}const vt=Symbol("store-raw"),R=Symbol("store-node"),I=Symbol("store-has"),yn=Symbol("store-self");function bn(t){let n=t[V];if(!n&&(Object.defineProperty(t,V,{value:n=new Proxy(t,Pe)}),!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 G(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[vt])return e;if(!G(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,d=s.length;c<d;c++)i=s[c],!a[i].get&&(o=t[i],(r=L(o,n))!==o&&(t[i]=r))}return t}function yt(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 Ae(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 mn(t){zt()&&it(yt(t,R),yn)()}function je(t){return mn(t),Reflect.ownKeys(t)}const Pe={get(t,n,e){if(n===vt)return t;if(n===V)return e;if(n===Q)return mn(t),e;const r=yt(t,R),o=r[n];let i=o?o():t[n];if(n===R||n===I||n==="__proto__")return i;if(!o){const s=Object.getOwnPropertyDescriptor(t,n);zt()&&(typeof i!="function"||t.hasOwnProperty(n))&&!(s&&s.get)&&(i=it(r,n,i)())}return G(i)?bn(i):i},has(t,n){return n===vt||n===V||n===Q||n===R||n===I||n==="__proto__"?!0:(zt()&&it(yt(t,I),n)(),n in t)},set(){return!0},deleteProperty(){return!0},ownKeys:je,getOwnPropertyDescriptor:Ae};function W(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[I]&&t[I][n]&&o!==void 0&&t[I][n].$()):(t[n]=e,t[I]&&t[I][n]&&o===void 0&&t[I][n].$());let s=yt(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[yn])&&a.$()}function wn(t,n){const e=Object.keys(n);for(let r=0;r<e.length;r+=1){const o=e[r];xn(o)||W(t,o,n[o])}}function xn(t){return t==="__proto__"||t==="constructor"||t==="prototype"}function _e(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&&W(t,e,o)}W(t,"length",r)}else wn(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&&xn(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:d=t.length-1,by:f=1}=r;for(let l=c;l<=d;l+=f)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||G(o)&&G(i)&&!Array.isArray(i)?wn(o,i):W(t,r,i))}function On(...[t,n]){const e=L(t||{}),r=Array.isArray(e),o=bn(e);function i(...s){Yn(()=>{r&&s.length===1?_e(e,s[0]):st(e,s)})}return[o,i]}const Le=Symbol("store-root"),bt=new WeakMap,Sn={get(t,n){if(n===vt)return t;const e=t[n];if(n===V||n===Q||n===R||n===I||n==="__proto__")return e;let r;return G(e)?bt.get(e)||(bt.set(e,r=new Proxy(e,Sn)),r):e},set(t,n,e){return W(t,n,L(e)),!0},deleteProperty(t,n){return W(t,n,void 0,!0),!0}};function An(t){return n=>{if(G(n)){let e;(e=bt.get(n))||bt.set(n,e=new Proxy(n,Sn)),t(e)}return n}}let j={};function jn(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 Ce(t){j={...j,...t},!(typeof document>"u")&&document.querySelectorAll("kai-toast-region").forEach(n=>jn(n))}const qe=5e3,Ee=7e3,{toasts:Nt,setToasts:at,mounted:Ke,setMounted:Ve}=H(()=>{const[t,n]=On([]),[e,r]=z(!1);return{toasts:t,setToasts:n,mounted:e,setMounted:r}});let Pn=0;function ze(){return Pn+=1,`toast-${Pn}`}function $e(t){const n=t.duration??qe;return n===0?0:t.action?Math.max(n,Ee):n}const _n=new Map;function De(t=null){if(typeof document>"u")return;const n=_n.get(t);if(n&&n.isConnected)return n;const e=document.createElement("kai-toast-region");return document.body.appendChild(e),e.toasts=Nt,t&&(e.target=t),jn(e),_n.set(t,e),Ve(!0),e}function Ie(t){const n=Nt.findIndex(e=>e.id===t.id);n>=0?at(n,t):at(An(e=>{e.push(t)}))}function Cn(t){at(n=>n.filter(e=>e.id!==t))}function Me(t){return{id:t,dismiss:()=>Cn(t),update:n=>{const e=Nt.findIndex(r=>r.id===t);e>=0&&at(e,r=>({...r,...n}))}}}function ct(t,n,e){De(n?.target??null);const r=n?.id??ze(),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 Ie(o),Me(r)}const Te=Object.assign((t,n)=>ct(t,n,"neutral"),{success:(t,n)=>ct(t,n,"success"),warning:(t,n)=>ct(t,n,"warning"),error:(t,n)=>ct(t,n,"error"),info:(t,n)=>ct(t,n,"info"),dismiss:Cn,clear:()=>at([])}),Fe=typeof window<"u"&&typeof customElements<"u"?import("./register-impl-DpE7icIb.js").then(t=>t.r):Promise.resolve();export{On as A,An as B,L as C,Dt as D,Se as E,be as F,$e as G,me as I,Oe as M,we as S,Hn as a,H as b,S as c,Fn as classifyTool,Mn as configureCodeHighlighting,Ce as configureToasts,on as d,h as e,Fe as elementsReady,Gn as emitElementRegistry,de as f,re as g,sn as h,z as i,Tn as isCodeHighlightingEnabled,ke as j,ie as k,pe as l,$t as m,Jn as n,tt as o,Bn as p,he as q,an as r,Nn as s,ye as t,Te as toast,m as u,ne as v,te as w,Xn as x,In as y,xe as z};
|