@seed-ship/mcp-ui-solid 6.3.1 → 6.5.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 (58) hide show
  1. package/CHANGELOG.md +156 -0
  2. package/dist/components/GraphRenderer.cjs +30 -24
  3. package/dist/components/GraphRenderer.cjs.map +1 -1
  4. package/dist/components/GraphRenderer.d.ts.map +1 -1
  5. package/dist/components/GraphRenderer.js +30 -24
  6. package/dist/components/GraphRenderer.js.map +1 -1
  7. package/dist/components/PortalDropdownMenu.cjs +82 -0
  8. package/dist/components/PortalDropdownMenu.cjs.map +1 -0
  9. package/dist/components/PortalDropdownMenu.d.ts +56 -0
  10. package/dist/components/PortalDropdownMenu.d.ts.map +1 -0
  11. package/dist/components/PortalDropdownMenu.js +82 -0
  12. package/dist/components/PortalDropdownMenu.js.map +1 -0
  13. package/dist/components/UIResourceRenderer.cjs +297 -263
  14. package/dist/components/UIResourceRenderer.cjs.map +1 -1
  15. package/dist/components/UIResourceRenderer.d.ts +20 -0
  16. package/dist/components/UIResourceRenderer.d.ts.map +1 -1
  17. package/dist/components/UIResourceRenderer.js +299 -265
  18. package/dist/components/UIResourceRenderer.js.map +1 -1
  19. package/dist/components/index.d.ts +2 -0
  20. package/dist/components/index.d.ts.map +1 -1
  21. package/dist/components.cjs +2 -0
  22. package/dist/components.cjs.map +1 -1
  23. package/dist/components.d.cts +2 -0
  24. package/dist/components.d.ts +2 -0
  25. package/dist/components.js +2 -0
  26. package/dist/components.js.map +1 -1
  27. package/dist/index.cjs +6 -0
  28. package/dist/index.cjs.map +1 -1
  29. package/dist/index.d.cts +5 -0
  30. package/dist/index.d.ts +5 -0
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +6 -0
  33. package/dist/index.js.map +1 -1
  34. package/dist/utils/duplicate-mount-registry.cjs +27 -0
  35. package/dist/utils/duplicate-mount-registry.cjs.map +1 -0
  36. package/dist/utils/duplicate-mount-registry.d.ts +84 -0
  37. package/dist/utils/duplicate-mount-registry.d.ts.map +1 -0
  38. package/dist/utils/duplicate-mount-registry.js +27 -0
  39. package/dist/utils/duplicate-mount-registry.js.map +1 -0
  40. package/dist/utils/stable-key.cjs +41 -0
  41. package/dist/utils/stable-key.cjs.map +1 -0
  42. package/dist/utils/stable-key.d.ts +33 -0
  43. package/dist/utils/stable-key.d.ts.map +1 -0
  44. package/dist/utils/stable-key.js +41 -0
  45. package/dist/utils/stable-key.js.map +1 -0
  46. package/package.json +1 -1
  47. package/src/components/GraphRenderer.tsx +29 -20
  48. package/src/components/PortalDropdownMenu.test.tsx +113 -0
  49. package/src/components/PortalDropdownMenu.tsx +130 -0
  50. package/src/components/UIResourceRenderer.identity.test.tsx +161 -0
  51. package/src/components/UIResourceRenderer.tsx +85 -15
  52. package/src/components/index.ts +4 -0
  53. package/src/index.ts +10 -0
  54. package/src/utils/duplicate-mount-registry.test.ts +82 -0
  55. package/src/utils/duplicate-mount-registry.ts +113 -0
  56. package/src/utils/stable-key.test.ts +96 -0
  57. package/src/utils/stable-key.ts +91 -0
  58. package/tsconfig.tsbuildinfo +1 -1
@@ -1,9 +1,12 @@
1
- import { delegateEvents, createComponent, getNextElement, template, getNextMarker, insert, effect, style, className, setProperty, setAttribute, runHydrationEvents, memo, isServer, use, addEventListener, classList, setStyleProperty } from "solid-js/web";
1
+ import { delegateEvents, createComponent, getNextElement, template, getNextMarker, spread, mergeProps, insert, effect, style, setAttribute, runHydrationEvents, setProperty, className, memo, isServer, use, addEventListener, classList, setStyleProperty } from "solid-js/web";
2
2
  import purify from "../node_modules/.pnpm/dompurify@3.4.1/node_modules/dompurify/dist/purify.es.js";
3
- import { createMemo, For, Show, onMount, onCleanup, createSignal, createEffect } from "solid-js";
3
+ import { createMemo, onMount, onCleanup, For, Show, createSignal, createEffect } from "solid-js";
4
4
  import { validateComponent, getIframeSandbox, DEFAULT_RESOURCE_LIMITS } from "../services/validation.js";
5
5
  import { GenerativeUIErrorBoundary } from "./GenerativeUIErrorBoundary.js";
6
6
  import { markRenderStart, markRenderEnd, PERF_PREFIX } from "../utils/perf.js";
7
+ import { isDebugEnabled } from "../utils/logger.js";
8
+ import { getUiResourceStableKey } from "../utils/stable-key.js";
9
+ import { _registerMount, _unregisterMount, getDuplicateMountReporter } from "../utils/duplicate-mount-registry.js";
7
10
  import { useTelemetry } from "../context/MCPUITelemetryContext.js";
8
11
  import { GridRenderer } from "./GridRenderer.js";
9
12
  import { FooterRenderer } from "./FooterRenderer.js";
@@ -19,10 +22,11 @@ import { CodeBlockRenderer } from "./CodeBlockRenderer.js";
19
22
  import { MapRenderer } from "./MapRenderer.js";
20
23
  import { GraphRenderer } from "./GraphRenderer.js";
21
24
  import { useExpanded, ExpandableWrapper } from "./ExpandableWrapper.js";
25
+ import { PortalDropdownMenu } from "./PortalDropdownMenu.js";
22
26
  import { RenderProvider } from "./RenderContext.js";
23
27
  import { useAction } from "../hooks/useAction.js";
24
28
  import { marked as k } from "../node_modules/.pnpm/marked@16.4.2/node_modules/marked/lib/marked.esm.js";
25
- var _tmpl$ = /* @__PURE__ */ template(`<svg class="w-3 h-3 text-gray-500 dark:text-gray-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z">`), _tmpl$2 = /* @__PURE__ */ template(`<button>`), _tmpl$3 = /* @__PURE__ */ template(`<svg class="w-3 h-3 text-green-500"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M5 13l4 4L19 7">`), _tmpl$4 = /* @__PURE__ */ template(`<div class="p-4 bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700"><p class="text-red-500 dark:text-red-400 text-sm">Invalid chart data: missing data.datasets`), _tmpl$5 = /* @__PURE__ */ template(`<div class="absolute inset-0 flex items-center justify-center"><div class="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600">`), _tmpl$6 = /* @__PURE__ */ template(`<div class="absolute inset-0 flex items-center justify-center p-4"><div class=text-center><p class="text-red-600 dark:text-red-400 text-sm font-medium">Chart Error</p><p class="text-gray-600 dark:text-gray-400 text-xs mt-1">`), _tmpl$7 = /* @__PURE__ */ template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3">`), _tmpl$8 = /* @__PURE__ */ template(`<div class="w-full h-full p-4"><!$><!/><div class="w-full h-full"role=img><img class="w-full h-auto max-h-[300px] object-contain">`), _tmpl$9 = /* @__PURE__ */ template(`<div class="relative w-full h-full min-h-[300px] bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden"><!$><!/><!$><!/><!$><!/>`), _tmpl$0 = /* @__PURE__ */ template(`<tbody class="bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700">`), _tmpl$1 = /* @__PURE__ */ template(`<tr>`), _tmpl$10 = /* @__PURE__ */ template(`<td class="px-6 py-4 text-sm text-gray-700 dark:text-gray-200 whitespace-normal break-words leading-relaxed first:pl-6 last:pr-6"><div>`), _tmpl$11 = /* @__PURE__ */ template(`<tbody class="bg-white dark:bg-gray-800 relative">`), _tmpl$12 = /* @__PURE__ */ template(`<button class="w-full text-left px-3 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300">Copy TSV`), _tmpl$13 = /* @__PURE__ */ template(`<button class="w-full text-left px-3 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300">Download CSV`), _tmpl$14 = /* @__PURE__ */ template(`<button class="w-full text-left px-3 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300">Download JSON`), _tmpl$15 = /* @__PURE__ */ template(`<div class="absolute right-0 mt-1 w-36 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-lg shadow-lg py-1 text-sm"><!$><!/><!$><!/><!$><!/>`), _tmpl$16 = /* @__PURE__ */ template(`<div class="absolute right-10 top-2 z-10"><button class="opacity-60 hover:opacity-100 px-2 py-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 transition-all shadow-sm"title="Export table"aria-label="Export table"><svg class="w-3 h-3 text-gray-500 dark:text-gray-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg></button><!$><!/>`), _tmpl$17 = /* @__PURE__ */ template(`<span class="ml-2 text-xs font-normal text-gray-400">(virtualized: <!$><!/> rows)`), _tmpl$18 = /* @__PURE__ */ template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3 flex-shrink-0"><!$><!/><!$><!/>`), _tmpl$19 = /* @__PURE__ */ template(`<button type=button class="absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 text-sm"aria-label="Clear search">&times;`), _tmpl$20 = /* @__PURE__ */ template(`<div class="relative mb-3"><span class="absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none text-sm">🔍</span><input type=text class="w-full max-w-xs min-w-[200px] pl-8 pr-8 py-1.5 text-sm border border-gray-200 dark:border-gray-600 rounded-md bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-400 focus:border-blue-400 focus:ring-1 focus:ring-blue-400 outline-none"><!$><!/>`), _tmpl$21 = /* @__PURE__ */ template(`<p class="text-xs text-gray-500 dark:text-gray-400 mb-2"><!$><!/> result<!$><!/> on <!$><!/>`), _tmpl$22 = /* @__PURE__ */ template(`<div class="mt-3 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400"><span>Showing <!$><!/> - <!$><!/> of <!$><!/>`), _tmpl$23 = /* @__PURE__ */ template(`<select class="ml-2 px-1 py-0.5 text-xs border border-gray-200 dark:border-gray-600 rounded bg-white dark:bg-gray-700 text-gray-700 dark:text-gray-300">`), _tmpl$24 = /* @__PURE__ */ template(`<span class=text-gray-400>/ page`), _tmpl$25 = /* @__PURE__ */ template(`<div class="mt-3 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400"><span><!$><!/>&ndash;<!$><!/> / <!$><!/></span><div class="flex items-center gap-2"><button class="px-2 py-1 rounded hover:bg-gray-100 dark:hover:bg-gray-700 disabled:opacity-40 disabled:cursor-not-allowed transition-colors">&#x25C0;</button><span><!$><!/> / <!$><!/></span><button class="px-2 py-1 rounded hover:bg-gray-100 dark:hover:bg-gray-700 disabled:opacity-40 disabled:cursor-not-allowed transition-colors">&#x25B6;</button><!$><!/>`), _tmpl$26 = /* @__PURE__ */ template(`<div><!$><!/><div><!$><!/><!$><!/><div role=region tabindex=0><table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700 border-separate border-spacing-0"><thead class="bg-gray-100 dark:bg-gray-900 sticky top-0 z-10"><tr></tr></thead><!$><!/></table></div><!$><!/><!$><!/>`), _tmpl$27 = /* @__PURE__ */ template(`<th scope=col class="px-6 py-3 text-left text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider border-b border-gray-200 dark:border-gray-700 first:pl-6 last:pr-6 bg-gray-100 dark:bg-gray-900 cursor-pointer select-none hover:bg-gray-200 dark:hover:bg-gray-800 transition-colors"><span class="inline-flex items-center gap-1"><!$><!/><span class="text-[10px] leading-none">`), _tmpl$28 = /* @__PURE__ */ template(`<option>`), _tmpl$29 = /* @__PURE__ */ template(`<span class="ml-2 text-sm font-medium text-gray-500 dark:text-gray-400">`), _tmpl$30 = /* @__PURE__ */ template(`<div class="mt-3 flex items-center"><span><!$><!/> <!$><!/>%`), _tmpl$31 = /* @__PURE__ */ template(`<p class="mt-2 text-xs text-gray-500 dark:text-gray-400">`), _tmpl$32 = /* @__PURE__ */ template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-4 group"><!$><!/><div class="flex flex-col h-full justify-between"><div><p class="text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide"></p><div class="mt-2 flex items-baseline"><p class="text-2xl font-semibold text-gray-900 dark:text-white"></p><!$><!/></div></div><!$><!/><!$><!/>`), _tmpl$33 = /* @__PURE__ */ template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-4 group"><!$><!/><div>`), _tmpl$34 = /* @__PURE__ */ template(`<div class="w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col"><div class="flex-1 flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-900 min-h-[200px]"><a target=_blank rel="noopener noreferrer"class=cursor-zoom-in><img class="max-w-full max-h-[400px] object-contain rounded shadow-sm hover:opacity-90 transition-opacity"loading=lazy></a></div><div class="p-3 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"><p class="text-sm text-gray-600 dark:text-gray-400 text-center italic">`, true, false, false), _tmpl$35 = /* @__PURE__ */ template(`<div class="px-4 py-2 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900"><h3 class="text-sm font-semibold text-gray-900 dark:text-white">`), _tmpl$36 = /* @__PURE__ */ template(`<div class="w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col"><!$><!/><iframe class="w-full border-0 flex-1"loading=lazy>`, true, false, false), _tmpl$37 = /* @__PURE__ */ template(`<figcaption class="p-3 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"><p class="text-sm text-gray-600 dark:text-gray-400 text-center">`), _tmpl$38 = /* @__PURE__ */ template(`<figure><div class="flex-1 flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-900 min-h-[200px]"><a target=_blank rel="noopener noreferrer"class="cursor-zoom-in focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 rounded"><img class="max-w-full max-h-[500px] object-contain rounded shadow-sm hover:opacity-95 transition-opacity"loading=lazy></a></div><!$><!/>`, true, false, false), _tmpl$39 = /* @__PURE__ */ template(`<p class="text-xs text-gray-500 dark:text-gray-400 truncate">`), _tmpl$40 = /* @__PURE__ */ template(`<a target=_blank rel="noopener noreferrer"><div class="p-2 bg-blue-50 dark:bg-blue-900/30 rounded-full text-blue-600 dark:text-blue-400 group-hover:bg-blue-100 dark:group-hover:bg-blue-900/50 shrink-0 transition-colors"aria-hidden=true><svg xmlns=http://www.w3.org/2000/svg class="w-5 h-5"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg></div><div class="flex-1 min-w-0"><h4 class="text-sm font-medium text-gray-900 dark:text-white truncate group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors"></h4><!$><!/></div><svg xmlns=http://www.w3.org/2000/svg class="w-4 h-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300 shrink-0 transition-colors"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1=10 y1=14 x2=21 y2=3>`), _tmpl$41 = /* @__PURE__ */ template(`<div class="inline-flex items-center gap-1.5 px-2 py-1 rounded-md bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 text-xs text-yellow-800 dark:text-yellow-200"role=alert aria-label="Component validation warning"><svg xmlns=http://www.w3.org/2000/svg class="w-3.5 h-3.5"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path><line x1=12 y1=9 x2=12 y2=13></line><line x1=12 y1=17 x2=12.01 y2=17></line></svg><span>Invalid <!$><!/>`), _tmpl$42 = /* @__PURE__ */ template(`<div class="w-full h-full bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4"><p class="text-sm font-medium text-red-900 dark:text-red-100">Validation Error</p><p class="text-xs text-red-700 dark:text-red-300 mt-1">`), _tmpl$43 = /* @__PURE__ */ template(`<span aria-hidden=true>`), _tmpl$44 = /* @__PURE__ */ template(`<a rel="noopener noreferrer"><!$><!/><!$><!/>`), _tmpl$45 = /* @__PURE__ */ template(`<span class="animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full"aria-hidden=true>`), _tmpl$46 = /* @__PURE__ */ template(`<button><!$><!/><!$><!/><!$><!/>`), _tmpl$47 = /* @__PURE__ */ template(`<p class="text-xs text-red-600 dark:text-red-400 mt-1">Type: <!$><!/>`), _tmpl$48 = /* @__PURE__ */ template(`<div class=mt-3><p class="text-xs font-medium text-red-700 dark:text-red-300">Suggestions:</p><ul class="mt-1 text-xs text-red-600 dark:text-red-400 list-disc list-inside">`), _tmpl$49 = /* @__PURE__ */ template(`<p class="text-xs text-red-500 dark:text-red-500 mt-2">`), _tmpl$50 = /* @__PURE__ */ template(`<div class="relative w-full bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4 group"><!$><!/><div class="flex items-start gap-3"><div class="p-2 bg-red-100 dark:bg-red-900/40 rounded-full shrink-0"><svg class="w-5 h-5 text-red-600 dark:text-red-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"></path></svg></div><div class="flex-1 min-w-0"><h4 class="text-sm font-semibold text-red-800 dark:text-red-200">Tool Error: <!$><!/></h4><p class="text-sm text-red-700 dark:text-red-300 mt-1"></p><!$><!/><!$><!/><!$><!/>`), _tmpl$51 = /* @__PURE__ */ template(`<li>`), _tmpl$52 = /* @__PURE__ */ template(`<div class="px-4 py-2 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900"><h3 class="text-sm font-semibold text-gray-900 dark:text-white capitalize">`), _tmpl$53 = /* @__PURE__ */ template(`<div class="w-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden"><!$><!/><div class="p-4 prose prose-sm dark:prose-invert max-w-none">`), _tmpl$54 = /* @__PURE__ */ template(`<div><div class="grid gap-4"></div><!$><!/>`), _tmpl$55 = /* @__PURE__ */ template(`<div>`);
29
+ var _tmpl$ = /* @__PURE__ */ template(`<svg class="w-3 h-3 text-gray-500 dark:text-gray-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z">`), _tmpl$2 = /* @__PURE__ */ template(`<button>`), _tmpl$3 = /* @__PURE__ */ template(`<svg class="w-3 h-3 text-green-500"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M5 13l4 4L19 7">`), _tmpl$4 = /* @__PURE__ */ template(`<div class="p-4 bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700"><p class="text-red-500 dark:text-red-400 text-sm">Invalid chart data: missing data.datasets`), _tmpl$5 = /* @__PURE__ */ template(`<div class="absolute inset-0 flex items-center justify-center"><div class="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600">`), _tmpl$6 = /* @__PURE__ */ template(`<div class="absolute inset-0 flex items-center justify-center p-4"><div class=text-center><p class="text-red-600 dark:text-red-400 text-sm font-medium">Chart Error</p><p class="text-gray-600 dark:text-gray-400 text-xs mt-1">`), _tmpl$7 = /* @__PURE__ */ template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3">`), _tmpl$8 = /* @__PURE__ */ template(`<div class="w-full h-full p-4"><!$><!/><div class="w-full h-full"role=img><img class="w-full h-auto max-h-[300px] object-contain">`), _tmpl$9 = /* @__PURE__ */ template(`<div class="relative w-full h-full min-h-[300px] bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden"><!$><!/><!$><!/><!$><!/>`), _tmpl$0 = /* @__PURE__ */ template(`<tbody class="bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700">`), _tmpl$1 = /* @__PURE__ */ template(`<tr>`), _tmpl$10 = /* @__PURE__ */ template(`<td class="px-6 py-4 text-sm text-gray-700 dark:text-gray-200 whitespace-normal break-words leading-relaxed first:pl-6 last:pr-6"><div>`), _tmpl$11 = /* @__PURE__ */ template(`<tbody class="bg-white dark:bg-gray-800 relative">`), _tmpl$12 = /* @__PURE__ */ template(`<button class="w-full text-left px-3 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300">Copy TSV`), _tmpl$13 = /* @__PURE__ */ template(`<button class="w-full text-left px-3 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300">Download CSV`), _tmpl$14 = /* @__PURE__ */ template(`<button class="w-full text-left px-3 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300">Download JSON`), _tmpl$15 = /* @__PURE__ */ template(`<div class="absolute right-10 top-2 z-10"><button class="opacity-60 hover:opacity-100 px-2 py-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 transition-all shadow-sm"title="Export table"aria-label="Export table"aria-haspopup=menu><svg class="w-3 h-3 text-gray-500 dark:text-gray-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg></button><!$><!/>`), _tmpl$16 = /* @__PURE__ */ template(`<span class="ml-2 text-xs font-normal text-gray-400">(virtualized: <!$><!/> rows)`), _tmpl$17 = /* @__PURE__ */ template(`<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-3 flex-shrink-0"><!$><!/><!$><!/>`), _tmpl$18 = /* @__PURE__ */ template(`<button type=button class="absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 text-sm"aria-label="Clear search">&times;`), _tmpl$19 = /* @__PURE__ */ template(`<div class="relative mb-3"><span class="absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none text-sm">🔍</span><input type=text class="w-full max-w-xs min-w-[200px] pl-8 pr-8 py-1.5 text-sm border border-gray-200 dark:border-gray-600 rounded-md bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-400 focus:border-blue-400 focus:ring-1 focus:ring-blue-400 outline-none"><!$><!/>`), _tmpl$20 = /* @__PURE__ */ template(`<p class="text-xs text-gray-500 dark:text-gray-400 mb-2"><!$><!/> result<!$><!/> on <!$><!/>`), _tmpl$21 = /* @__PURE__ */ template(`<div class="mt-3 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400"><span>Showing <!$><!/> - <!$><!/> of <!$><!/>`), _tmpl$22 = /* @__PURE__ */ template(`<select class="ml-2 px-1 py-0.5 text-xs border border-gray-200 dark:border-gray-600 rounded bg-white dark:bg-gray-700 text-gray-700 dark:text-gray-300">`), _tmpl$23 = /* @__PURE__ */ template(`<span class=text-gray-400>/ page`), _tmpl$24 = /* @__PURE__ */ template(`<div class="mt-3 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400"><span><!$><!/>&ndash;<!$><!/> / <!$><!/></span><div class="flex items-center gap-2"><button class="px-2 py-1 rounded hover:bg-gray-100 dark:hover:bg-gray-700 disabled:opacity-40 disabled:cursor-not-allowed transition-colors">&#x25C0;</button><span><!$><!/> / <!$><!/></span><button class="px-2 py-1 rounded hover:bg-gray-100 dark:hover:bg-gray-700 disabled:opacity-40 disabled:cursor-not-allowed transition-colors">&#x25B6;</button><!$><!/>`), _tmpl$25 = /* @__PURE__ */ template(`<div><!$><!/><div><!$><!/><!$><!/><div role=region tabindex=0><table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700 border-separate border-spacing-0"><thead class="bg-gray-100 dark:bg-gray-900 sticky top-0 z-10"><tr></tr></thead><!$><!/></table></div><!$><!/><!$><!/>`), _tmpl$26 = /* @__PURE__ */ template(`<th scope=col class="px-6 py-3 text-left text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider border-b border-gray-200 dark:border-gray-700 first:pl-6 last:pr-6 bg-gray-100 dark:bg-gray-900 cursor-pointer select-none hover:bg-gray-200 dark:hover:bg-gray-800 transition-colors"><span class="inline-flex items-center gap-1"><!$><!/><span class="text-[10px] leading-none">`), _tmpl$27 = /* @__PURE__ */ template(`<option>`), _tmpl$28 = /* @__PURE__ */ template(`<span class="ml-2 text-sm font-medium text-gray-500 dark:text-gray-400">`), _tmpl$29 = /* @__PURE__ */ template(`<div class="mt-3 flex items-center"><span><!$><!/> <!$><!/>%`), _tmpl$30 = /* @__PURE__ */ template(`<p class="mt-2 text-xs text-gray-500 dark:text-gray-400">`), _tmpl$31 = /* @__PURE__ */ template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-4 group"><!$><!/><div class="flex flex-col h-full justify-between"><div><p class="text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide"></p><div class="mt-2 flex items-baseline"><p class="text-2xl font-semibold text-gray-900 dark:text-white"></p><!$><!/></div></div><!$><!/><!$><!/>`), _tmpl$32 = /* @__PURE__ */ template(`<div class="relative w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-4 group"><!$><!/><div>`), _tmpl$33 = /* @__PURE__ */ template(`<div class="w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col"><div class="flex-1 flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-900 min-h-[200px]"><a target=_blank rel="noopener noreferrer"class=cursor-zoom-in><img class="max-w-full max-h-[400px] object-contain rounded shadow-sm hover:opacity-90 transition-opacity"loading=lazy></a></div><div class="p-3 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"><p class="text-sm text-gray-600 dark:text-gray-400 text-center italic">`, true, false, false), _tmpl$34 = /* @__PURE__ */ template(`<div class="px-4 py-2 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900"><h3 class="text-sm font-semibold text-gray-900 dark:text-white">`), _tmpl$35 = /* @__PURE__ */ template(`<div class="w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col"><!$><!/><iframe class="w-full border-0 flex-1"loading=lazy>`, true, false, false), _tmpl$36 = /* @__PURE__ */ template(`<figcaption class="p-3 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"><p class="text-sm text-gray-600 dark:text-gray-400 text-center">`), _tmpl$37 = /* @__PURE__ */ template(`<figure><div class="flex-1 flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-900 min-h-[200px]"><a target=_blank rel="noopener noreferrer"class="cursor-zoom-in focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 rounded"><img class="max-w-full max-h-[500px] object-contain rounded shadow-sm hover:opacity-95 transition-opacity"loading=lazy></a></div><!$><!/>`, true, false, false), _tmpl$38 = /* @__PURE__ */ template(`<p class="text-xs text-gray-500 dark:text-gray-400 truncate">`), _tmpl$39 = /* @__PURE__ */ template(`<a target=_blank rel="noopener noreferrer"><div class="p-2 bg-blue-50 dark:bg-blue-900/30 rounded-full text-blue-600 dark:text-blue-400 group-hover:bg-blue-100 dark:group-hover:bg-blue-900/50 shrink-0 transition-colors"aria-hidden=true><svg xmlns=http://www.w3.org/2000/svg class="w-5 h-5"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg></div><div class="flex-1 min-w-0"><h4 class="text-sm font-medium text-gray-900 dark:text-white truncate group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors"></h4><!$><!/></div><svg xmlns=http://www.w3.org/2000/svg class="w-4 h-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300 shrink-0 transition-colors"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1=10 y1=14 x2=21 y2=3>`), _tmpl$40 = /* @__PURE__ */ template(`<div class="inline-flex items-center gap-1.5 px-2 py-1 rounded-md bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 text-xs text-yellow-800 dark:text-yellow-200"role=alert aria-label="Component validation warning"><svg xmlns=http://www.w3.org/2000/svg class="w-3.5 h-3.5"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path><line x1=12 y1=9 x2=12 y2=13></line><line x1=12 y1=17 x2=12.01 y2=17></line></svg><span>Invalid <!$><!/>`), _tmpl$41 = /* @__PURE__ */ template(`<div class="w-full h-full bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4"><p class="text-sm font-medium text-red-900 dark:text-red-100">Validation Error</p><p class="text-xs text-red-700 dark:text-red-300 mt-1">`), _tmpl$42 = /* @__PURE__ */ template(`<span aria-hidden=true>`), _tmpl$43 = /* @__PURE__ */ template(`<a rel="noopener noreferrer"><!$><!/><!$><!/>`), _tmpl$44 = /* @__PURE__ */ template(`<span class="animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full"aria-hidden=true>`), _tmpl$45 = /* @__PURE__ */ template(`<button><!$><!/><!$><!/><!$><!/>`), _tmpl$46 = /* @__PURE__ */ template(`<p class="text-xs text-red-600 dark:text-red-400 mt-1">Type: <!$><!/>`), _tmpl$47 = /* @__PURE__ */ template(`<div class=mt-3><p class="text-xs font-medium text-red-700 dark:text-red-300">Suggestions:</p><ul class="mt-1 text-xs text-red-600 dark:text-red-400 list-disc list-inside">`), _tmpl$48 = /* @__PURE__ */ template(`<p class="text-xs text-red-500 dark:text-red-500 mt-2">`), _tmpl$49 = /* @__PURE__ */ template(`<div class="relative w-full bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4 group"><!$><!/><div class="flex items-start gap-3"><div class="p-2 bg-red-100 dark:bg-red-900/40 rounded-full shrink-0"><svg class="w-5 h-5 text-red-600 dark:text-red-400"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"></path></svg></div><div class="flex-1 min-w-0"><h4 class="text-sm font-semibold text-red-800 dark:text-red-200">Tool Error: <!$><!/></h4><p class="text-sm text-red-700 dark:text-red-300 mt-1"></p><!$><!/><!$><!/><!$><!/>`), _tmpl$50 = /* @__PURE__ */ template(`<li>`), _tmpl$51 = /* @__PURE__ */ template(`<div class="px-4 py-2 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900"><h3 class="text-sm font-semibold text-gray-900 dark:text-white capitalize">`), _tmpl$52 = /* @__PURE__ */ template(`<div class="w-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden"><!$><!/><div class="p-4 prose prose-sm dark:prose-invert max-w-none">`), _tmpl$53 = /* @__PURE__ */ template(`<div><div class="grid gap-4"></div><!$><!/>`), _tmpl$54 = /* @__PURE__ */ template(`<div>`);
26
30
  function CopyButton(props) {
27
31
  const [copied, setCopied] = createSignal(false);
28
32
  const handleCopy = async () => {
@@ -521,6 +525,7 @@ ${dataRows}`;
521
525
  const exportFormats = typeof exportable === "object" && (exportable == null ? void 0 : exportable.formats) ? exportable.formats : ["csv", "json"];
522
526
  const exportFilename = typeof exportable === "object" && (exportable == null ? void 0 : exportable.filename) || `table-${Math.random().toString(36).slice(2, 9)}`;
523
527
  const [showExportMenu, setShowExportMenu] = createSignal(false);
528
+ let exportTriggerRef;
524
529
  const handleExport = (format) => {
525
530
  setShowExportMenu(false);
526
531
  switch (format) {
@@ -615,7 +620,7 @@ ${dataRows}`;
615
620
  return props.toolbarVariant;
616
621
  },
617
622
  get children() {
618
- var _el$29 = getNextElement(_tmpl$26), _el$120 = _el$29.firstChild, [_el$121, _co$28] = getNextMarker(_el$120.nextSibling), _el$44 = _el$121.nextSibling, _el$112 = _el$44.firstChild, [_el$113, _co$24] = getNextMarker(_el$112.nextSibling), _el$114 = _el$113.nextSibling, [_el$115, _co$25] = getNextMarker(_el$114.nextSibling), _el$70 = _el$115.nextSibling, _el$71 = _el$70.firstChild, _el$72 = _el$71.firstChild, _el$73 = _el$72.firstChild, _el$74 = _el$72.nextSibling, [_el$75, _co$14] = getNextMarker(_el$74.nextSibling), _el$116 = _el$70.nextSibling, [_el$117, _co$26] = getNextMarker(_el$116.nextSibling), _el$118 = _el$117.nextSibling, [_el$119, _co$27] = getNextMarker(_el$118.nextSibling);
623
+ var _el$29 = getNextElement(_tmpl$25), _el$113 = _el$29.firstChild, [_el$114, _co$25] = getNextMarker(_el$113.nextSibling), _el$37 = _el$114.nextSibling, _el$105 = _el$37.firstChild, [_el$106, _co$21] = getNextMarker(_el$105.nextSibling), _el$107 = _el$106.nextSibling, [_el$108, _co$22] = getNextMarker(_el$107.nextSibling), _el$63 = _el$108.nextSibling, _el$64 = _el$63.firstChild, _el$65 = _el$64.firstChild, _el$66 = _el$65.firstChild, _el$67 = _el$65.nextSibling, [_el$68, _co$11] = getNextMarker(_el$67.nextSibling), _el$109 = _el$63.nextSibling, [_el$110, _co$23] = getNextMarker(_el$109.nextSibling), _el$111 = _el$110.nextSibling, [_el$112, _co$24] = getNextMarker(_el$111.nextSibling);
619
624
  insert(_el$29, createComponent(Show, {
620
625
  when: exportable,
621
626
  get fallback() {
@@ -626,131 +631,133 @@ ${dataRows}`;
626
631
  });
627
632
  },
628
633
  get children() {
629
- var _el$30 = getNextElement(_tmpl$16), _el$31 = _el$30.firstChild, _el$42 = _el$31.nextSibling, [_el$43, _co$8] = getNextMarker(_el$42.nextSibling);
634
+ var _el$30 = getNextElement(_tmpl$15), _el$31 = _el$30.firstChild, _el$35 = _el$31.nextSibling, [_el$36, _co$5] = getNextMarker(_el$35.nextSibling);
630
635
  _el$31.$$click = () => setShowExportMenu(!showExportMenu());
631
- insert(_el$30, createComponent(Show, {
632
- get when() {
636
+ var _ref$ = exportTriggerRef;
637
+ typeof _ref$ === "function" ? use(_ref$, _el$31) : exportTriggerRef = _el$31;
638
+ insert(_el$30, createComponent(PortalDropdownMenu, {
639
+ get open() {
633
640
  return showExportMenu();
634
641
  },
642
+ onClose: () => setShowExportMenu(false),
643
+ trigger: exportTriggerRef,
644
+ width: 144,
635
645
  get children() {
636
- var _el$32 = getNextElement(_tmpl$15), _el$36 = _el$32.firstChild, [_el$37, _co$5] = getNextMarker(_el$36.nextSibling), _el$38 = _el$37.nextSibling, [_el$39, _co$6] = getNextMarker(_el$38.nextSibling), _el$40 = _el$39.nextSibling, [_el$41, _co$7] = getNextMarker(_el$40.nextSibling);
637
- insert(_el$32, createComponent(Show, {
646
+ return [createComponent(Show, {
638
647
  get when() {
639
648
  return exportFormats.includes("tsv");
640
649
  },
641
650
  get children() {
642
- var _el$33 = getNextElement(_tmpl$12);
643
- _el$33.$$click = () => handleExport("tsv");
651
+ var _el$32 = getNextElement(_tmpl$12);
652
+ _el$32.$$click = () => handleExport("tsv");
644
653
  runHydrationEvents();
645
- return _el$33;
654
+ return _el$32;
646
655
  }
647
- }), _el$37, _co$5);
648
- insert(_el$32, createComponent(Show, {
656
+ }), createComponent(Show, {
649
657
  get when() {
650
658
  return exportFormats.includes("csv");
651
659
  },
652
660
  get children() {
653
- var _el$34 = getNextElement(_tmpl$13);
654
- _el$34.$$click = () => handleExport("csv");
661
+ var _el$33 = getNextElement(_tmpl$13);
662
+ _el$33.$$click = () => handleExport("csv");
655
663
  runHydrationEvents();
656
- return _el$34;
664
+ return _el$33;
657
665
  }
658
- }), _el$39, _co$6);
659
- insert(_el$32, createComponent(Show, {
666
+ }), createComponent(Show, {
660
667
  get when() {
661
668
  return exportFormats.includes("json");
662
669
  },
663
670
  get children() {
664
- var _el$35 = getNextElement(_tmpl$14);
665
- _el$35.$$click = () => handleExport("json");
671
+ var _el$34 = getNextElement(_tmpl$14);
672
+ _el$34.$$click = () => handleExport("json");
666
673
  runHydrationEvents();
667
- return _el$35;
674
+ return _el$34;
668
675
  }
669
- }), _el$41, _co$7);
670
- return _el$32;
676
+ })];
671
677
  }
672
- }), _el$43, _co$8);
678
+ }), _el$36, _co$5);
679
+ effect(() => setAttribute(_el$31, "aria-expanded", showExportMenu()));
673
680
  runHydrationEvents();
674
681
  return _el$30;
675
682
  }
676
- }), _el$121, _co$28);
677
- insert(_el$44, createComponent(Show, {
683
+ }), _el$114, _co$25);
684
+ insert(_el$37, createComponent(Show, {
678
685
  get when() {
679
686
  return tableParams.title;
680
687
  },
681
688
  get children() {
682
- var _el$45 = getNextElement(_tmpl$18), _el$51 = _el$45.firstChild, [_el$52, _co$0] = getNextMarker(_el$51.nextSibling), _el$53 = _el$52.nextSibling, [_el$54, _co$1] = getNextMarker(_el$53.nextSibling);
683
- setAttribute(_el$45, "id", `${tableId}-title`);
684
- insert(_el$45, () => tableParams.title, _el$52, _co$0);
685
- insert(_el$45, createComponent(Show, {
689
+ var _el$38 = getNextElement(_tmpl$17), _el$44 = _el$38.firstChild, [_el$45, _co$7] = getNextMarker(_el$44.nextSibling), _el$46 = _el$45.nextSibling, [_el$47, _co$8] = getNextMarker(_el$46.nextSibling);
690
+ setAttribute(_el$38, "id", `${tableId}-title`);
691
+ insert(_el$38, () => tableParams.title, _el$45, _co$7);
692
+ insert(_el$38, createComponent(Show, {
686
693
  get when() {
687
694
  return isVirtualizing();
688
695
  },
689
696
  get children() {
690
- var _el$46 = getNextElement(_tmpl$17), _el$47 = _el$46.firstChild, _el$49 = _el$47.nextSibling, [_el$50, _co$9] = getNextMarker(_el$49.nextSibling);
691
- _el$50.nextSibling;
692
- insert(_el$46, () => {
697
+ var _el$39 = getNextElement(_tmpl$16), _el$40 = _el$39.firstChild, _el$42 = _el$40.nextSibling, [_el$43, _co$6] = getNextMarker(_el$42.nextSibling);
698
+ _el$43.nextSibling;
699
+ insert(_el$39, () => {
693
700
  var _a;
694
701
  return (_a = tableParams.rows) == null ? void 0 : _a.length;
695
- }, _el$50, _co$9);
696
- return _el$46;
702
+ }, _el$43, _co$6);
703
+ return _el$39;
697
704
  }
698
- }), _el$54, _co$1);
699
- return _el$45;
705
+ }), _el$47, _co$8);
706
+ return _el$38;
700
707
  }
701
- }), _el$113, _co$24);
702
- insert(_el$44, createComponent(Show, {
708
+ }), _el$106, _co$21);
709
+ insert(_el$37, createComponent(Show, {
703
710
  get when() {
704
711
  return isSearchable();
705
712
  },
706
713
  get children() {
707
714
  return [(() => {
708
- var _el$55 = getNextElement(_tmpl$20), _el$56 = _el$55.firstChild, _el$57 = _el$56.nextSibling, _el$59 = _el$57.nextSibling, [_el$60, _co$10] = getNextMarker(_el$59.nextSibling);
709
- _el$57.$$input = (e) => handleSearch(e.currentTarget.value);
710
- insert(_el$55, createComponent(Show, {
715
+ var _el$48 = getNextElement(_tmpl$19), _el$49 = _el$48.firstChild, _el$50 = _el$49.nextSibling, _el$52 = _el$50.nextSibling, [_el$53, _co$9] = getNextMarker(_el$52.nextSibling);
716
+ _el$50.$$input = (e) => handleSearch(e.currentTarget.value);
717
+ insert(_el$48, createComponent(Show, {
711
718
  get when() {
712
719
  return searchQuery();
713
720
  },
714
721
  get children() {
715
- var _el$58 = getNextElement(_tmpl$19);
716
- _el$58.$$click = () => {
722
+ var _el$51 = getNextElement(_tmpl$18);
723
+ _el$51.$$click = () => {
717
724
  handleSearch("");
718
725
  setSearchQuery("");
719
726
  setDebouncedQuery("");
720
727
  };
721
728
  runHydrationEvents();
722
- return _el$58;
729
+ return _el$51;
723
730
  }
724
- }), _el$60, _co$10);
725
- effect(() => setAttribute(_el$57, "placeholder", searchPlaceholder()));
726
- effect(() => setProperty(_el$57, "value", searchQuery()));
731
+ }), _el$53, _co$9);
732
+ effect(() => setAttribute(_el$50, "placeholder", searchPlaceholder()));
733
+ effect(() => setProperty(_el$50, "value", searchQuery()));
727
734
  runHydrationEvents();
728
- return _el$55;
735
+ return _el$48;
729
736
  })(), createComponent(Show, {
730
737
  get when() {
731
738
  return memo(() => !!debouncedQuery())() && filteredRows().length !== sortedRows().length;
732
739
  },
733
740
  get children() {
734
- var _el$61 = getNextElement(_tmpl$21), _el$64 = _el$61.firstChild, [_el$65, _co$11] = getNextMarker(_el$64.nextSibling), _el$62 = _el$65.nextSibling, _el$66 = _el$62.nextSibling, [_el$67, _co$12] = getNextMarker(_el$66.nextSibling), _el$63 = _el$67.nextSibling, _el$68 = _el$63.nextSibling, [_el$69, _co$13] = getNextMarker(_el$68.nextSibling);
735
- insert(_el$61, () => filteredRows().length, _el$65, _co$11);
736
- insert(_el$61, () => filteredRows().length !== 1 ? "s" : "", _el$67, _co$12);
737
- insert(_el$61, () => sortedRows().length, _el$69, _co$13);
738
- return _el$61;
741
+ var _el$54 = getNextElement(_tmpl$20), _el$57 = _el$54.firstChild, [_el$58, _co$0] = getNextMarker(_el$57.nextSibling), _el$55 = _el$58.nextSibling, _el$59 = _el$55.nextSibling, [_el$60, _co$1] = getNextMarker(_el$59.nextSibling), _el$56 = _el$60.nextSibling, _el$61 = _el$56.nextSibling, [_el$62, _co$10] = getNextMarker(_el$61.nextSibling);
742
+ insert(_el$54, () => filteredRows().length, _el$58, _co$0);
743
+ insert(_el$54, () => filteredRows().length !== 1 ? "s" : "", _el$60, _co$1);
744
+ insert(_el$54, () => sortedRows().length, _el$62, _co$10);
745
+ return _el$54;
739
746
  }
740
747
  })];
741
748
  }
742
- }), _el$115, _co$25);
743
- var _ref$ = scrollContainerRef;
744
- typeof _ref$ === "function" ? use(_ref$, _el$70) : scrollContainerRef = _el$70;
745
- insert(_el$73, createComponent(For, {
749
+ }), _el$108, _co$22);
750
+ var _ref$2 = scrollContainerRef;
751
+ typeof _ref$2 === "function" ? use(_ref$2, _el$63) : scrollContainerRef = _el$63;
752
+ insert(_el$66, createComponent(For, {
746
753
  get each() {
747
754
  return tableParams.columns;
748
755
  },
749
756
  children: (column) => (() => {
750
- var _el$122 = getNextElement(_tmpl$27), _el$123 = _el$122.firstChild, _el$125 = _el$123.firstChild, [_el$126, _co$29] = getNextMarker(_el$125.nextSibling), _el$124 = _el$126.nextSibling;
751
- addEventListener(_el$122, "click", () => handleSort(column.key));
752
- insert(_el$123, () => column.label, _el$126, _co$29);
753
- insert(_el$124, () => sortIndicator(column.key));
757
+ var _el$115 = getNextElement(_tmpl$26), _el$116 = _el$115.firstChild, _el$118 = _el$116.firstChild, [_el$119, _co$26] = getNextMarker(_el$118.nextSibling), _el$117 = _el$119.nextSibling;
758
+ addEventListener(_el$115, "click", () => handleSort(column.key));
759
+ insert(_el$116, () => column.label, _el$119, _co$26);
760
+ insert(_el$117, () => sortIndicator(column.key));
754
761
  effect((_p$) => {
755
762
  var _v$14 = column.width ? {
756
763
  width: column.width
@@ -758,19 +765,19 @@ ${dataRows}`;
758
765
  "opacity-30": sortKey() !== column.key,
759
766
  "opacity-100 text-blue-600 dark:text-blue-400": sortKey() === column.key
760
767
  };
761
- _p$.e = style(_el$122, _v$14, _p$.e);
762
- _v$15 !== _p$.t && setAttribute(_el$122, "title", _p$.t = _v$15);
763
- _p$.a = classList(_el$124, _v$16, _p$.a);
768
+ _p$.e = style(_el$115, _v$14, _p$.e);
769
+ _v$15 !== _p$.t && setAttribute(_el$115, "title", _p$.t = _v$15);
770
+ _p$.a = classList(_el$117, _v$16, _p$.a);
764
771
  return _p$;
765
772
  }, {
766
773
  e: void 0,
767
774
  t: void 0,
768
775
  a: void 0
769
776
  });
770
- return _el$122;
777
+ return _el$115;
771
778
  })()
772
779
  }));
773
- insert(_el$71, createComponent(Show, {
780
+ insert(_el$64, createComponent(Show, {
774
781
  get when() {
775
782
  return isVirtualizing();
776
783
  },
@@ -780,69 +787,69 @@ ${dataRows}`;
780
787
  get children() {
781
788
  return createComponent(VirtualizedTableBody, {});
782
789
  }
783
- }), _el$75, _co$14);
784
- insert(_el$44, createComponent(Show, {
790
+ }), _el$68, _co$11);
791
+ insert(_el$37, createComponent(Show, {
785
792
  get when() {
786
793
  return tableParams.pagination;
787
794
  },
788
795
  get children() {
789
- var _el$76 = getNextElement(_tmpl$22), _el$77 = _el$76.firstChild, _el$78 = _el$77.firstChild, _el$83 = _el$78.nextSibling, [_el$84, _co$15] = getNextMarker(_el$83.nextSibling), _el$79 = _el$84.nextSibling, _el$85 = _el$79.nextSibling, [_el$86, _co$16] = getNextMarker(_el$85.nextSibling), _el$81 = _el$86.nextSibling, _el$87 = _el$81.nextSibling, [_el$88, _co$17] = getNextMarker(_el$87.nextSibling);
790
- insert(_el$77, () => tableParams.pagination.currentPage * tableParams.pagination.pageSize + 1, _el$84, _co$15);
791
- insert(_el$77, () => Math.min((tableParams.pagination.currentPage + 1) * tableParams.pagination.pageSize, tableParams.pagination.totalRows), _el$86, _co$16);
792
- insert(_el$77, () => tableParams.pagination.totalRows, _el$88, _co$17);
793
- return _el$76;
796
+ var _el$69 = getNextElement(_tmpl$21), _el$70 = _el$69.firstChild, _el$71 = _el$70.firstChild, _el$76 = _el$71.nextSibling, [_el$77, _co$12] = getNextMarker(_el$76.nextSibling), _el$72 = _el$77.nextSibling, _el$78 = _el$72.nextSibling, [_el$79, _co$13] = getNextMarker(_el$78.nextSibling), _el$74 = _el$79.nextSibling, _el$80 = _el$74.nextSibling, [_el$81, _co$14] = getNextMarker(_el$80.nextSibling);
797
+ insert(_el$70, () => tableParams.pagination.currentPage * tableParams.pagination.pageSize + 1, _el$77, _co$12);
798
+ insert(_el$70, () => Math.min((tableParams.pagination.currentPage + 1) * tableParams.pagination.pageSize, tableParams.pagination.totalRows), _el$79, _co$13);
799
+ insert(_el$70, () => tableParams.pagination.totalRows, _el$81, _co$14);
800
+ return _el$69;
794
801
  }
795
- }), _el$117, _co$26);
796
- insert(_el$44, createComponent(Show, {
802
+ }), _el$110, _co$23);
803
+ insert(_el$37, createComponent(Show, {
797
804
  get when() {
798
805
  return needsClientPagination();
799
806
  },
800
807
  get children() {
801
- var _el$89 = getNextElement(_tmpl$25), _el$90 = _el$89.firstChild, _el$93 = _el$90.firstChild, [_el$94, _co$18] = getNextMarker(_el$93.nextSibling), _el$91 = _el$94.nextSibling, _el$95 = _el$91.nextSibling, [_el$96, _co$19] = getNextMarker(_el$95.nextSibling), _el$92 = _el$96.nextSibling, _el$97 = _el$92.nextSibling, [_el$98, _co$20] = getNextMarker(_el$97.nextSibling), _el$99 = _el$90.nextSibling, _el$100 = _el$99.firstChild, _el$101 = _el$100.nextSibling, _el$103 = _el$101.firstChild, [_el$104, _co$21] = getNextMarker(_el$103.nextSibling), _el$102 = _el$104.nextSibling, _el$105 = _el$102.nextSibling, [_el$106, _co$22] = getNextMarker(_el$105.nextSibling), _el$107 = _el$101.nextSibling, _el$110 = _el$107.nextSibling, [_el$111, _co$23] = getNextMarker(_el$110.nextSibling);
802
- insert(_el$90, clientRangeStart, _el$94, _co$18);
803
- insert(_el$90, clientRangeEnd, _el$96, _co$19);
804
- insert(_el$90, () => filteredRows().length.toLocaleString("fr-FR"), _el$98, _co$20);
805
- _el$100.$$click = () => setClientPage((p) => p - 1);
806
- insert(_el$101, () => clientPage() + 1, _el$104, _co$21);
807
- insert(_el$101, clientTotalPages, _el$106, _co$22);
808
- _el$107.$$click = () => setClientPage((p) => p + 1);
809
- insert(_el$99, createComponent(Show, {
808
+ var _el$82 = getNextElement(_tmpl$24), _el$83 = _el$82.firstChild, _el$86 = _el$83.firstChild, [_el$87, _co$15] = getNextMarker(_el$86.nextSibling), _el$84 = _el$87.nextSibling, _el$88 = _el$84.nextSibling, [_el$89, _co$16] = getNextMarker(_el$88.nextSibling), _el$85 = _el$89.nextSibling, _el$90 = _el$85.nextSibling, [_el$91, _co$17] = getNextMarker(_el$90.nextSibling), _el$92 = _el$83.nextSibling, _el$93 = _el$92.firstChild, _el$94 = _el$93.nextSibling, _el$96 = _el$94.firstChild, [_el$97, _co$18] = getNextMarker(_el$96.nextSibling), _el$95 = _el$97.nextSibling, _el$98 = _el$95.nextSibling, [_el$99, _co$19] = getNextMarker(_el$98.nextSibling), _el$100 = _el$94.nextSibling, _el$103 = _el$100.nextSibling, [_el$104, _co$20] = getNextMarker(_el$103.nextSibling);
809
+ insert(_el$83, clientRangeStart, _el$87, _co$15);
810
+ insert(_el$83, clientRangeEnd, _el$89, _co$16);
811
+ insert(_el$83, () => filteredRows().length.toLocaleString("fr-FR"), _el$91, _co$17);
812
+ _el$93.$$click = () => setClientPage((p) => p - 1);
813
+ insert(_el$94, () => clientPage() + 1, _el$97, _co$18);
814
+ insert(_el$94, clientTotalPages, _el$99, _co$19);
815
+ _el$100.$$click = () => setClientPage((p) => p + 1);
816
+ insert(_el$92, createComponent(Show, {
810
817
  get when() {
811
818
  return memo(() => !!isExpanded())() && filteredRows().length > 10;
812
819
  },
813
820
  get children() {
814
821
  return [(() => {
815
- var _el$108 = getNextElement(_tmpl$23);
816
- _el$108.addEventListener("change", (e) => handlePageSizeChange(Number(e.currentTarget.value)));
817
- insert(_el$108, createComponent(For, {
822
+ var _el$101 = getNextElement(_tmpl$22);
823
+ _el$101.addEventListener("change", (e) => handlePageSizeChange(Number(e.currentTarget.value)));
824
+ insert(_el$101, createComponent(For, {
818
825
  get each() {
819
826
  return pageSizeOptions();
820
827
  },
821
828
  children: (opt) => (() => {
822
- var _el$127 = getNextElement(_tmpl$28);
823
- insert(_el$127, () => opt.label);
824
- effect(() => setProperty(_el$127, "value", opt.value));
825
- return _el$127;
829
+ var _el$120 = getNextElement(_tmpl$27);
830
+ insert(_el$120, () => opt.label);
831
+ effect(() => setProperty(_el$120, "value", opt.value));
832
+ return _el$120;
826
833
  })()
827
834
  }));
828
- effect(() => setProperty(_el$108, "value", clientPageSize()));
829
- return _el$108;
830
- })(), getNextElement(_tmpl$24)];
835
+ effect(() => setProperty(_el$101, "value", clientPageSize()));
836
+ return _el$101;
837
+ })(), getNextElement(_tmpl$23)];
831
838
  }
832
- }), _el$111, _co$23);
839
+ }), _el$104, _co$20);
833
840
  effect((_p$) => {
834
841
  var _v$8 = clientPage() === 0, _v$9 = clientPage() >= clientTotalPages() - 1;
835
- _v$8 !== _p$.e && setProperty(_el$100, "disabled", _p$.e = _v$8);
836
- _v$9 !== _p$.t && setProperty(_el$107, "disabled", _p$.t = _v$9);
842
+ _v$8 !== _p$.e && setProperty(_el$93, "disabled", _p$.e = _v$8);
843
+ _v$9 !== _p$.t && setProperty(_el$100, "disabled", _p$.t = _v$9);
837
844
  return _p$;
838
845
  }, {
839
846
  e: void 0,
840
847
  t: void 0
841
848
  });
842
849
  runHydrationEvents();
843
- return _el$89;
850
+ return _el$82;
844
851
  }
845
- }), _el$119, _co$27);
852
+ }), _el$112, _co$24);
846
853
  effect((_p$) => {
847
854
  var _v$0 = `relative w-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden group ${isExpanded() ? "flex-1 min-h-0 flex flex-col" : "h-full"}`, _v$1 = `p-4 ${isExpanded() ? "flex-1 min-h-0 flex flex-col" : ""}`, _v$10 = `overflow-x-auto ${isExpanded() ? "flex-1 min-h-0" : ""}`, _v$11 = (
848
855
  // v6.1.0 — when expanded, the scroll container fills the
@@ -875,11 +882,11 @@ ${dataRows}`;
875
882
  })()
876
883
  ), _v$12 = tableParams.title || "Data table", _v$13 = tableParams.title ? `${tableId}-title` : void 0;
877
884
  _v$0 !== _p$.e && className(_el$29, _p$.e = _v$0);
878
- _v$1 !== _p$.t && className(_el$44, _p$.t = _v$1);
879
- _v$10 !== _p$.a && className(_el$70, _p$.a = _v$10);
880
- _p$.o = style(_el$70, _v$11, _p$.o);
881
- _v$12 !== _p$.i && setAttribute(_el$70, "aria-label", _p$.i = _v$12);
882
- _v$13 !== _p$.n && setAttribute(_el$71, "aria-labelledby", _p$.n = _v$13);
885
+ _v$1 !== _p$.t && className(_el$37, _p$.t = _v$1);
886
+ _v$10 !== _p$.a && className(_el$63, _p$.a = _v$10);
887
+ _p$.o = style(_el$63, _v$11, _p$.o);
888
+ _v$12 !== _p$.i && setAttribute(_el$63, "aria-label", _p$.i = _v$12);
889
+ _v$13 !== _p$.n && setAttribute(_el$64, "aria-labelledby", _p$.n = _v$13);
883
890
  return _p$;
884
891
  }, {
885
892
  e: void 0,
@@ -902,51 +909,51 @@ function MetricRenderer(props) {
902
909
  return `${title}: ${value}${unit ? " " + unit : ""}`;
903
910
  };
904
911
  return (() => {
905
- var _el$128 = getNextElement(_tmpl$32), _el$150 = _el$128.firstChild, [_el$151, _co$35] = getNextMarker(_el$150.nextSibling), _el$129 = _el$151.nextSibling, _el$130 = _el$129.firstChild, _el$131 = _el$130.firstChild, _el$132 = _el$131.nextSibling, _el$133 = _el$132.firstChild, _el$135 = _el$133.nextSibling, [_el$136, _co$30] = getNextMarker(_el$135.nextSibling), _el$146 = _el$130.nextSibling, [_el$147, _co$33] = getNextMarker(_el$146.nextSibling), _el$148 = _el$147.nextSibling, [_el$149, _co$34] = getNextMarker(_el$148.nextSibling);
906
- insert(_el$128, createComponent(CopyButton, {
912
+ var _el$121 = getNextElement(_tmpl$31), _el$143 = _el$121.firstChild, [_el$144, _co$32] = getNextMarker(_el$143.nextSibling), _el$122 = _el$144.nextSibling, _el$123 = _el$122.firstChild, _el$124 = _el$123.firstChild, _el$125 = _el$124.nextSibling, _el$126 = _el$125.firstChild, _el$128 = _el$126.nextSibling, [_el$129, _co$27] = getNextMarker(_el$128.nextSibling), _el$139 = _el$123.nextSibling, [_el$140, _co$30] = getNextMarker(_el$139.nextSibling), _el$141 = _el$140.nextSibling, [_el$142, _co$31] = getNextMarker(_el$141.nextSibling);
913
+ insert(_el$121, createComponent(CopyButton, {
907
914
  getText: getMetricText,
908
915
  title: "Copy metric",
909
916
  position: "top-right"
910
- }), _el$151, _co$35);
911
- insert(_el$131, () => metricParams.title);
912
- insert(_el$133, () => metricParams.value);
913
- insert(_el$132, createComponent(Show, {
917
+ }), _el$144, _co$32);
918
+ insert(_el$124, () => metricParams.title);
919
+ insert(_el$126, () => metricParams.value);
920
+ insert(_el$125, createComponent(Show, {
914
921
  get when() {
915
922
  return metricParams.unit;
916
923
  },
917
924
  get children() {
918
- var _el$134 = getNextElement(_tmpl$29);
919
- insert(_el$134, () => metricParams.unit);
920
- return _el$134;
925
+ var _el$127 = getNextElement(_tmpl$28);
926
+ insert(_el$127, () => metricParams.unit);
927
+ return _el$127;
921
928
  }
922
- }), _el$136, _co$30);
923
- insert(_el$129, createComponent(Show, {
929
+ }), _el$129, _co$27);
930
+ insert(_el$122, createComponent(Show, {
924
931
  get when() {
925
932
  return metricParams.trend;
926
933
  },
927
934
  get children() {
928
- var _el$137 = getNextElement(_tmpl$30), _el$138 = _el$137.firstChild, _el$141 = _el$138.firstChild, [_el$142, _co$31] = getNextMarker(_el$141.nextSibling), _el$139 = _el$142.nextSibling, _el$143 = _el$139.nextSibling, [_el$144, _co$32] = getNextMarker(_el$143.nextSibling);
929
- _el$144.nextSibling;
930
- insert(_el$138, (() => {
935
+ var _el$130 = getNextElement(_tmpl$29), _el$131 = _el$130.firstChild, _el$134 = _el$131.firstChild, [_el$135, _co$28] = getNextMarker(_el$134.nextSibling), _el$132 = _el$135.nextSibling, _el$136 = _el$132.nextSibling, [_el$137, _co$29] = getNextMarker(_el$136.nextSibling);
936
+ _el$137.nextSibling;
937
+ insert(_el$131, (() => {
931
938
  var _c$ = memo(() => metricParams.trend.direction === "up");
932
939
  return () => _c$() ? "�" : metricParams.trend.direction === "down" ? "�" : "�";
933
- })(), _el$142, _co$31);
934
- insert(_el$138, () => Math.abs(metricParams.trend.value), _el$144, _co$32);
935
- effect(() => className(_el$138, `text-sm font-medium ${metricParams.trend.direction === "up" ? "text-green-600 dark:text-green-400" : metricParams.trend.direction === "down" ? "text-red-600 dark:text-red-400" : "text-gray-600 dark:text-gray-400"}`));
936
- return _el$137;
940
+ })(), _el$135, _co$28);
941
+ insert(_el$131, () => Math.abs(metricParams.trend.value), _el$137, _co$29);
942
+ effect(() => className(_el$131, `text-sm font-medium ${metricParams.trend.direction === "up" ? "text-green-600 dark:text-green-400" : metricParams.trend.direction === "down" ? "text-red-600 dark:text-red-400" : "text-gray-600 dark:text-gray-400"}`));
943
+ return _el$130;
937
944
  }
938
- }), _el$147, _co$33);
939
- insert(_el$129, createComponent(Show, {
945
+ }), _el$140, _co$30);
946
+ insert(_el$122, createComponent(Show, {
940
947
  get when() {
941
948
  return metricParams.subtitle;
942
949
  },
943
950
  get children() {
944
- var _el$145 = getNextElement(_tmpl$31);
945
- insert(_el$145, () => metricParams.subtitle);
946
- return _el$145;
951
+ var _el$138 = getNextElement(_tmpl$30);
952
+ insert(_el$138, () => metricParams.subtitle);
953
+ return _el$138;
947
954
  }
948
- }), _el$149, _co$34);
949
- return _el$128;
955
+ }), _el$142, _co$31);
956
+ return _el$121;
950
957
  })();
951
958
  }
952
959
  function extractImageFromMarkdown(content) {
@@ -987,62 +994,62 @@ function TextRenderer(props) {
987
994
  },
988
995
  get fallback() {
989
996
  return (() => {
990
- var _el$152 = getNextElement(_tmpl$33), _el$154 = _el$152.firstChild, [_el$155, _co$36] = getNextMarker(_el$154.nextSibling), _el$153 = _el$155.nextSibling;
991
- insert(_el$152, createComponent(CopyButton, {
997
+ var _el$145 = getNextElement(_tmpl$32), _el$147 = _el$145.firstChild, [_el$148, _co$33] = getNextMarker(_el$147.nextSibling), _el$146 = _el$148.nextSibling;
998
+ insert(_el$145, createComponent(CopyButton, {
992
999
  getText: getTextContent,
993
1000
  title: "Copy text",
994
1001
  position: "top-right"
995
- }), _el$155, _co$36);
1002
+ }), _el$148, _co$33);
996
1003
  effect((_p$) => {
997
1004
  var _v$17 = `prose prose-sm dark:prose-invert max-w-none ${textParams.className || ""}`, _v$18 = htmlContent();
998
- _v$17 !== _p$.e && className(_el$153, _p$.e = _v$17);
999
- _v$18 !== _p$.t && setProperty(_el$153, "innerHTML", _p$.t = _v$18);
1005
+ _v$17 !== _p$.e && className(_el$146, _p$.e = _v$17);
1006
+ _v$18 !== _p$.t && setProperty(_el$146, "innerHTML", _p$.t = _v$18);
1000
1007
  return _p$;
1001
1008
  }, {
1002
1009
  e: void 0,
1003
1010
  t: void 0
1004
1011
  });
1005
- return _el$152;
1012
+ return _el$145;
1006
1013
  })();
1007
1014
  },
1008
1015
  children: (data) => (() => {
1009
- var _el$156 = getNextElement(_tmpl$34), _el$157 = _el$156.firstChild, _el$158 = _el$157.firstChild, _el$159 = _el$158.firstChild, _el$160 = _el$157.nextSibling, _el$161 = _el$160.firstChild;
1010
- insert(_el$161, () => data().credit);
1016
+ var _el$149 = getNextElement(_tmpl$33), _el$150 = _el$149.firstChild, _el$151 = _el$150.firstChild, _el$152 = _el$151.firstChild, _el$153 = _el$150.nextSibling, _el$154 = _el$153.firstChild;
1017
+ insert(_el$154, () => data().credit);
1011
1018
  effect((_p$) => {
1012
1019
  var _v$19 = data().linkUrl, _v$20 = data().imageUrl, _v$21 = data().alt;
1013
- _v$19 !== _p$.e && setAttribute(_el$158, "href", _p$.e = _v$19);
1014
- _v$20 !== _p$.t && setAttribute(_el$159, "src", _p$.t = _v$20);
1015
- _v$21 !== _p$.a && setAttribute(_el$159, "alt", _p$.a = _v$21);
1020
+ _v$19 !== _p$.e && setAttribute(_el$151, "href", _p$.e = _v$19);
1021
+ _v$20 !== _p$.t && setAttribute(_el$152, "src", _p$.t = _v$20);
1022
+ _v$21 !== _p$.a && setAttribute(_el$152, "alt", _p$.a = _v$21);
1016
1023
  return _p$;
1017
1024
  }, {
1018
1025
  e: void 0,
1019
1026
  t: void 0,
1020
1027
  a: void 0
1021
1028
  });
1022
- return _el$156;
1029
+ return _el$149;
1023
1030
  })()
1024
1031
  });
1025
1032
  }
1026
1033
  function IframeRenderer(props) {
1027
1034
  const params = props.component.params;
1028
1035
  return (() => {
1029
- var _el$162 = getNextElement(_tmpl$36), _el$166 = _el$162.firstChild, [_el$167, _co$37] = getNextMarker(_el$166.nextSibling), _el$165 = _el$167.nextSibling;
1030
- insert(_el$162, createComponent(Show, {
1036
+ var _el$155 = getNextElement(_tmpl$35), _el$159 = _el$155.firstChild, [_el$160, _co$34] = getNextMarker(_el$159.nextSibling), _el$158 = _el$160.nextSibling;
1037
+ insert(_el$155, createComponent(Show, {
1031
1038
  get when() {
1032
1039
  return params.title;
1033
1040
  },
1034
1041
  get children() {
1035
- var _el$163 = getNextElement(_tmpl$35), _el$164 = _el$163.firstChild;
1036
- insert(_el$164, () => params.title);
1037
- return _el$163;
1042
+ var _el$156 = getNextElement(_tmpl$34), _el$157 = _el$156.firstChild;
1043
+ insert(_el$157, () => params.title);
1044
+ return _el$156;
1038
1045
  }
1039
- }), _el$167, _co$37);
1046
+ }), _el$160, _co$34);
1040
1047
  effect((_p$) => {
1041
1048
  var _v$22 = params.url, _v$23 = params.title || "Embedded content", _v$24 = `height: ${params.height || "400px"}; min-height: 300px;`, _v$25 = getIframeSandbox(params.url);
1042
- _v$22 !== _p$.e && setAttribute(_el$165, "src", _p$.e = _v$22);
1043
- _v$23 !== _p$.t && setAttribute(_el$165, "title", _p$.t = _v$23);
1044
- _p$.a = style(_el$165, _v$24, _p$.a);
1045
- _v$25 !== _p$.o && setAttribute(_el$165, "sandbox", _p$.o = _v$25);
1049
+ _v$22 !== _p$.e && setAttribute(_el$158, "src", _p$.e = _v$22);
1050
+ _v$23 !== _p$.t && setAttribute(_el$158, "title", _p$.t = _v$23);
1051
+ _p$.a = style(_el$158, _v$24, _p$.a);
1052
+ _v$25 !== _p$.o && setAttribute(_el$158, "sandbox", _p$.o = _v$25);
1046
1053
  return _p$;
1047
1054
  }, {
1048
1055
  e: void 0,
@@ -1050,30 +1057,30 @@ function IframeRenderer(props) {
1050
1057
  a: void 0,
1051
1058
  o: void 0
1052
1059
  });
1053
- return _el$162;
1060
+ return _el$155;
1054
1061
  })();
1055
1062
  }
1056
1063
  function ImageRenderer(props) {
1057
1064
  const params = props.component.params;
1058
1065
  return (() => {
1059
- var _el$168 = getNextElement(_tmpl$38), _el$169 = _el$168.firstChild, _el$170 = _el$169.firstChild, _el$171 = _el$170.firstChild, _el$174 = _el$169.nextSibling, [_el$175, _co$38] = getNextMarker(_el$174.nextSibling);
1060
- insert(_el$168, createComponent(Show, {
1066
+ var _el$161 = getNextElement(_tmpl$37), _el$162 = _el$161.firstChild, _el$163 = _el$162.firstChild, _el$164 = _el$163.firstChild, _el$167 = _el$162.nextSibling, [_el$168, _co$35] = getNextMarker(_el$167.nextSibling);
1067
+ insert(_el$161, createComponent(Show, {
1061
1068
  get when() {
1062
1069
  return params.caption;
1063
1070
  },
1064
1071
  get children() {
1065
- var _el$172 = getNextElement(_tmpl$37), _el$173 = _el$172.firstChild;
1066
- insert(_el$173, () => params.caption);
1067
- return _el$172;
1072
+ var _el$165 = getNextElement(_tmpl$36), _el$166 = _el$165.firstChild;
1073
+ insert(_el$166, () => params.caption);
1074
+ return _el$165;
1068
1075
  }
1069
- }), _el$175, _co$38);
1076
+ }), _el$168, _co$35);
1070
1077
  effect((_p$) => {
1071
1078
  var _v$26 = `w-full h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col ${params.className || ""}`, _v$27 = params.url, _v$28 = `View full size: ${params.alt || "image"}`, _v$29 = params.url, _v$30 = params.alt || "Image";
1072
- _v$26 !== _p$.e && className(_el$168, _p$.e = _v$26);
1073
- _v$27 !== _p$.t && setAttribute(_el$170, "href", _p$.t = _v$27);
1074
- _v$28 !== _p$.a && setAttribute(_el$170, "aria-label", _p$.a = _v$28);
1075
- _v$29 !== _p$.o && setAttribute(_el$171, "src", _p$.o = _v$29);
1076
- _v$30 !== _p$.i && setAttribute(_el$171, "alt", _p$.i = _v$30);
1079
+ _v$26 !== _p$.e && className(_el$161, _p$.e = _v$26);
1080
+ _v$27 !== _p$.t && setAttribute(_el$163, "href", _p$.t = _v$27);
1081
+ _v$28 !== _p$.a && setAttribute(_el$163, "aria-label", _p$.a = _v$28);
1082
+ _v$29 !== _p$.o && setAttribute(_el$164, "src", _p$.o = _v$29);
1083
+ _v$30 !== _p$.i && setAttribute(_el$164, "alt", _p$.i = _v$30);
1077
1084
  return _p$;
1078
1085
  }, {
1079
1086
  e: void 0,
@@ -1082,30 +1089,30 @@ function ImageRenderer(props) {
1082
1089
  o: void 0,
1083
1090
  i: void 0
1084
1091
  });
1085
- return _el$168;
1092
+ return _el$161;
1086
1093
  })();
1087
1094
  }
1088
1095
  function LinkRenderer(props) {
1089
1096
  const params = props.component.params;
1090
1097
  return (() => {
1091
- var _el$176 = getNextElement(_tmpl$40), _el$177 = _el$176.firstChild, _el$178 = _el$177.nextSibling, _el$179 = _el$178.firstChild, _el$181 = _el$179.nextSibling, [_el$182, _co$39] = getNextMarker(_el$181.nextSibling);
1092
- _el$176.$$click = (e) => e.stopPropagation();
1093
- insert(_el$179, () => params.label || params.url);
1094
- insert(_el$178, createComponent(Show, {
1098
+ var _el$169 = getNextElement(_tmpl$39), _el$170 = _el$169.firstChild, _el$171 = _el$170.nextSibling, _el$172 = _el$171.firstChild, _el$174 = _el$172.nextSibling, [_el$175, _co$36] = getNextMarker(_el$174.nextSibling);
1099
+ _el$169.$$click = (e) => e.stopPropagation();
1100
+ insert(_el$172, () => params.label || params.url);
1101
+ insert(_el$171, createComponent(Show, {
1095
1102
  get when() {
1096
1103
  return params.description;
1097
1104
  },
1098
1105
  get children() {
1099
- var _el$180 = getNextElement(_tmpl$39);
1100
- insert(_el$180, () => params.description);
1101
- return _el$180;
1106
+ var _el$173 = getNextElement(_tmpl$38);
1107
+ insert(_el$173, () => params.description);
1108
+ return _el$173;
1102
1109
  }
1103
- }), _el$182, _co$39);
1110
+ }), _el$175, _co$36);
1104
1111
  effect((_p$) => {
1105
1112
  var _v$31 = params.url, _v$32 = `${params.label || "Link"}: ${params.description || params.url} (opens in new tab)`, _v$33 = `flex items-center gap-3 p-4 bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors group h-full focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 ${params.className || ""}`;
1106
- _v$31 !== _p$.e && setAttribute(_el$176, "href", _p$.e = _v$31);
1107
- _v$32 !== _p$.t && setAttribute(_el$176, "aria-label", _p$.t = _v$32);
1108
- _v$33 !== _p$.a && className(_el$176, _p$.a = _v$33);
1113
+ _v$31 !== _p$.e && setAttribute(_el$169, "href", _p$.e = _v$31);
1114
+ _v$32 !== _p$.t && setAttribute(_el$169, "aria-label", _p$.t = _v$32);
1115
+ _v$33 !== _p$.a && className(_el$169, _p$.a = _v$33);
1109
1116
  return _p$;
1110
1117
  }, {
1111
1118
  e: void 0,
@@ -1113,7 +1120,7 @@ function LinkRenderer(props) {
1113
1120
  a: void 0
1114
1121
  });
1115
1122
  runHydrationEvents();
1116
- return _el$176;
1123
+ return _el$169;
1117
1124
  })();
1118
1125
  }
1119
1126
  function ComponentRenderer(props) {
@@ -1180,16 +1187,16 @@ function ComponentRenderer(props) {
1180
1187
  }
1181
1188
  if (mode === "inline-warn") {
1182
1189
  return (() => {
1183
- var _el$183 = getNextElement(_tmpl$41), _el$184 = _el$183.firstChild, _el$185 = _el$184.nextSibling, _el$186 = _el$185.firstChild, _el$187 = _el$186.nextSibling, [_el$188, _co$40] = getNextMarker(_el$187.nextSibling);
1184
- setAttribute(_el$183, "title", firstError);
1185
- insert(_el$185, () => props.component.type, _el$188, _co$40);
1186
- return _el$183;
1190
+ var _el$176 = getNextElement(_tmpl$40), _el$177 = _el$176.firstChild, _el$178 = _el$177.nextSibling, _el$179 = _el$178.firstChild, _el$180 = _el$179.nextSibling, [_el$181, _co$37] = getNextMarker(_el$180.nextSibling);
1191
+ setAttribute(_el$176, "title", firstError);
1192
+ insert(_el$178, () => props.component.type, _el$181, _co$37);
1193
+ return _el$176;
1187
1194
  })();
1188
1195
  }
1189
1196
  return (() => {
1190
- var _el$189 = getNextElement(_tmpl$42), _el$190 = _el$189.firstChild, _el$191 = _el$190.nextSibling;
1191
- insert(_el$191, firstError);
1192
- return _el$189;
1197
+ var _el$182 = getNextElement(_tmpl$41), _el$183 = _el$182.firstChild, _el$184 = _el$183.nextSibling;
1198
+ insert(_el$184, firstError);
1199
+ return _el$182;
1193
1200
  })();
1194
1201
  }
1195
1202
  return createComponent(GenerativeUIErrorBoundary, {
@@ -1483,27 +1490,27 @@ function ActionRenderer(props) {
1483
1490
  const isDisabled = () => params.disabled || params.action === "tool-call" && isExecuting();
1484
1491
  if (params.type === "link" || params.action === "link") {
1485
1492
  return (() => {
1486
- var _el$192 = getNextElement(_tmpl$44), _el$194 = _el$192.firstChild, [_el$195, _co$41] = getNextMarker(_el$194.nextSibling), _el$196 = _el$195.nextSibling, [_el$197, _co$42] = getNextMarker(_el$196.nextSibling);
1487
- _el$192.$$click = handleClick;
1488
- insert(_el$192, createComponent(Show, {
1493
+ var _el$185 = getNextElement(_tmpl$43), _el$187 = _el$185.firstChild, [_el$188, _co$38] = getNextMarker(_el$187.nextSibling), _el$189 = _el$188.nextSibling, [_el$190, _co$39] = getNextMarker(_el$189.nextSibling);
1494
+ _el$185.$$click = handleClick;
1495
+ insert(_el$185, createComponent(Show, {
1489
1496
  get when() {
1490
1497
  return params.icon;
1491
1498
  },
1492
1499
  get children() {
1493
- var _el$193 = getNextElement(_tmpl$43);
1494
- insert(_el$193, () => params.icon);
1495
- return _el$193;
1500
+ var _el$186 = getNextElement(_tmpl$42);
1501
+ insert(_el$186, () => params.icon);
1502
+ return _el$186;
1496
1503
  }
1497
- }), _el$195, _co$41);
1498
- insert(_el$192, () => params.label, _el$197, _co$42);
1504
+ }), _el$188, _co$38);
1505
+ insert(_el$185, () => params.label, _el$190, _co$39);
1499
1506
  effect((_p$) => {
1500
1507
  var _v$34 = params.url || "#", _v$35 = params.url ? "_blank" : void 0, _v$36 = params.ariaLabel || params.label, _v$37 = `inline-flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500
1501
1508
  ${params.variant === "primary" ? "bg-blue-600 text-white hover:bg-blue-700" : params.variant === "outline" ? "border border-gray-300 text-gray-700 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-800" : "text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300"}
1502
1509
  ${params.className || ""}`;
1503
- _v$34 !== _p$.e && setAttribute(_el$192, "href", _p$.e = _v$34);
1504
- _v$35 !== _p$.t && setAttribute(_el$192, "target", _p$.t = _v$35);
1505
- _v$36 !== _p$.a && setAttribute(_el$192, "aria-label", _p$.a = _v$36);
1506
- _v$37 !== _p$.o && className(_el$192, _p$.o = _v$37);
1510
+ _v$34 !== _p$.e && setAttribute(_el$185, "href", _p$.e = _v$34);
1511
+ _v$35 !== _p$.t && setAttribute(_el$185, "target", _p$.t = _v$35);
1512
+ _v$36 !== _p$.a && setAttribute(_el$185, "aria-label", _p$.a = _v$36);
1513
+ _v$37 !== _p$.o && className(_el$185, _p$.o = _v$37);
1507
1514
  return _p$;
1508
1515
  }, {
1509
1516
  e: void 0,
@@ -1512,42 +1519,42 @@ function ActionRenderer(props) {
1512
1519
  o: void 0
1513
1520
  });
1514
1521
  runHydrationEvents();
1515
- return _el$192;
1522
+ return _el$185;
1516
1523
  })();
1517
1524
  }
1518
1525
  return (() => {
1519
- var _el$198 = getNextElement(_tmpl$46), _el$201 = _el$198.firstChild, [_el$202, _co$43] = getNextMarker(_el$201.nextSibling), _el$203 = _el$202.nextSibling, [_el$204, _co$44] = getNextMarker(_el$203.nextSibling), _el$205 = _el$204.nextSibling, [_el$206, _co$45] = getNextMarker(_el$205.nextSibling);
1520
- _el$198.$$click = handleClick;
1521
- insert(_el$198, createComponent(Show, {
1526
+ var _el$191 = getNextElement(_tmpl$45), _el$194 = _el$191.firstChild, [_el$195, _co$40] = getNextMarker(_el$194.nextSibling), _el$196 = _el$195.nextSibling, [_el$197, _co$41] = getNextMarker(_el$196.nextSibling), _el$198 = _el$197.nextSibling, [_el$199, _co$42] = getNextMarker(_el$198.nextSibling);
1527
+ _el$191.$$click = handleClick;
1528
+ insert(_el$191, createComponent(Show, {
1522
1529
  get when() {
1523
1530
  return memo(() => !!isExecuting())() && params.action === "tool-call";
1524
1531
  },
1525
1532
  get children() {
1526
- return getNextElement(_tmpl$45);
1533
+ return getNextElement(_tmpl$44);
1527
1534
  }
1528
- }), _el$202, _co$43);
1529
- insert(_el$198, createComponent(Show, {
1535
+ }), _el$195, _co$40);
1536
+ insert(_el$191, createComponent(Show, {
1530
1537
  get when() {
1531
1538
  return memo(() => !!params.icon)() && !(isExecuting() && params.action === "tool-call");
1532
1539
  },
1533
1540
  get children() {
1534
- var _el$200 = getNextElement(_tmpl$43);
1535
- insert(_el$200, () => params.icon);
1536
- return _el$200;
1541
+ var _el$193 = getNextElement(_tmpl$42);
1542
+ insert(_el$193, () => params.icon);
1543
+ return _el$193;
1537
1544
  }
1538
- }), _el$204, _co$44);
1539
- insert(_el$198, () => params.label, _el$206, _co$45);
1545
+ }), _el$197, _co$41);
1546
+ insert(_el$191, () => params.label, _el$199, _co$42);
1540
1547
  effect((_p$) => {
1541
1548
  var _v$38 = params.action === "submit" ? "submit" : "button", _v$39 = isDisabled(), _v$40 = isExecuting() && params.action === "tool-call", _v$41 = params.ariaLabel || params.label, _v$42 = `inline-flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500
1542
1549
  ${params.variant === "primary" ? "bg-blue-600 text-white hover:bg-blue-700 shadow-sm" : params.variant === "secondary" ? "bg-gray-100 text-gray-900 hover:bg-gray-200 dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600" : params.variant === "outline" ? "border border-gray-300 text-gray-700 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-800" : params.variant === "danger" ? "bg-red-600 text-white hover:bg-red-700" : "bg-transparent text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-800"}
1543
1550
  ${isDisabled() ? "opacity-50 cursor-not-allowed" : ""}
1544
1551
  ${params.size === "sm" ? "px-3 py-1.5 text-xs" : params.size === "lg" ? "px-6 py-3 text-base" : ""}
1545
1552
  ${params.className || ""}`;
1546
- _v$38 !== _p$.e && setAttribute(_el$198, "type", _p$.e = _v$38);
1547
- _v$39 !== _p$.t && setProperty(_el$198, "disabled", _p$.t = _v$39);
1548
- _v$40 !== _p$.a && setAttribute(_el$198, "aria-busy", _p$.a = _v$40);
1549
- _v$41 !== _p$.o && setAttribute(_el$198, "aria-label", _p$.o = _v$41);
1550
- _v$42 !== _p$.i && className(_el$198, _p$.i = _v$42);
1553
+ _v$38 !== _p$.e && setAttribute(_el$191, "type", _p$.e = _v$38);
1554
+ _v$39 !== _p$.t && setProperty(_el$191, "disabled", _p$.t = _v$39);
1555
+ _v$40 !== _p$.a && setAttribute(_el$191, "aria-busy", _p$.a = _v$40);
1556
+ _v$41 !== _p$.o && setAttribute(_el$191, "aria-label", _p$.o = _v$41);
1557
+ _v$42 !== _p$.i && className(_el$191, _p$.i = _v$42);
1551
1558
  return _p$;
1552
1559
  }, {
1553
1560
  e: void 0,
@@ -1557,7 +1564,7 @@ function ActionRenderer(props) {
1557
1564
  i: void 0
1558
1565
  });
1559
1566
  runHydrationEvents();
1560
- return _el$198;
1567
+ return _el$191;
1561
1568
  })();
1562
1569
  }
1563
1570
  function ErrorCardRenderer(props) {
@@ -1565,55 +1572,55 @@ function ErrorCardRenderer(props) {
1565
1572
  return `Error in ${props.error.tool || "unknown tool"}: ${props.error.message || "Unknown error"}`;
1566
1573
  };
1567
1574
  return (() => {
1568
- var _el$207 = getNextElement(_tmpl$50), _el$230 = _el$207.firstChild, [_el$231, _co$51] = getNextMarker(_el$230.nextSibling), _el$208 = _el$231.nextSibling, _el$209 = _el$208.firstChild, _el$210 = _el$209.nextSibling, _el$211 = _el$210.firstChild, _el$212 = _el$211.firstChild, _el$213 = _el$212.nextSibling, [_el$214, _co$46] = getNextMarker(_el$213.nextSibling), _el$215 = _el$211.nextSibling, _el$224 = _el$215.nextSibling, [_el$225, _co$48] = getNextMarker(_el$224.nextSibling), _el$226 = _el$225.nextSibling, [_el$227, _co$49] = getNextMarker(_el$226.nextSibling), _el$228 = _el$227.nextSibling, [_el$229, _co$50] = getNextMarker(_el$228.nextSibling);
1569
- insert(_el$207, createComponent(CopyButton, {
1575
+ var _el$200 = getNextElement(_tmpl$49), _el$223 = _el$200.firstChild, [_el$224, _co$48] = getNextMarker(_el$223.nextSibling), _el$201 = _el$224.nextSibling, _el$202 = _el$201.firstChild, _el$203 = _el$202.nextSibling, _el$204 = _el$203.firstChild, _el$205 = _el$204.firstChild, _el$206 = _el$205.nextSibling, [_el$207, _co$43] = getNextMarker(_el$206.nextSibling), _el$208 = _el$204.nextSibling, _el$217 = _el$208.nextSibling, [_el$218, _co$45] = getNextMarker(_el$217.nextSibling), _el$219 = _el$218.nextSibling, [_el$220, _co$46] = getNextMarker(_el$219.nextSibling), _el$221 = _el$220.nextSibling, [_el$222, _co$47] = getNextMarker(_el$221.nextSibling);
1576
+ insert(_el$200, createComponent(CopyButton, {
1570
1577
  getText: getErrorText,
1571
1578
  title: "Copy error details",
1572
1579
  position: "top-right"
1573
- }), _el$231, _co$51);
1574
- insert(_el$211, () => props.error.tool || "Unknown", _el$214, _co$46);
1575
- insert(_el$215, () => props.error.message || "An error occurred during tool execution");
1576
- insert(_el$210, createComponent(Show, {
1580
+ }), _el$224, _co$48);
1581
+ insert(_el$204, () => props.error.tool || "Unknown", _el$207, _co$43);
1582
+ insert(_el$208, () => props.error.message || "An error occurred during tool execution");
1583
+ insert(_el$203, createComponent(Show, {
1577
1584
  get when() {
1578
1585
  return props.error.type;
1579
1586
  },
1580
1587
  get children() {
1581
- var _el$216 = getNextElement(_tmpl$47), _el$217 = _el$216.firstChild, _el$218 = _el$217.nextSibling, [_el$219, _co$47] = getNextMarker(_el$218.nextSibling);
1582
- insert(_el$216, () => props.error.type, _el$219, _co$47);
1583
- return _el$216;
1588
+ var _el$209 = getNextElement(_tmpl$46), _el$210 = _el$209.firstChild, _el$211 = _el$210.nextSibling, [_el$212, _co$44] = getNextMarker(_el$211.nextSibling);
1589
+ insert(_el$209, () => props.error.type, _el$212, _co$44);
1590
+ return _el$209;
1584
1591
  }
1585
- }), _el$225, _co$48);
1586
- insert(_el$210, createComponent(Show, {
1592
+ }), _el$218, _co$45);
1593
+ insert(_el$203, createComponent(Show, {
1587
1594
  get when() {
1588
1595
  var _a;
1589
1596
  return (_a = props.error.suggestions) == null ? void 0 : _a.length;
1590
1597
  },
1591
1598
  get children() {
1592
- var _el$220 = getNextElement(_tmpl$48), _el$221 = _el$220.firstChild, _el$222 = _el$221.nextSibling;
1593
- insert(_el$222, createComponent(For, {
1599
+ var _el$213 = getNextElement(_tmpl$47), _el$214 = _el$213.firstChild, _el$215 = _el$214.nextSibling;
1600
+ insert(_el$215, createComponent(For, {
1594
1601
  get each() {
1595
1602
  return props.error.suggestions;
1596
1603
  },
1597
1604
  children: (suggestion) => (() => {
1598
- var _el$232 = getNextElement(_tmpl$51);
1599
- insert(_el$232, suggestion);
1600
- return _el$232;
1605
+ var _el$225 = getNextElement(_tmpl$50);
1606
+ insert(_el$225, suggestion);
1607
+ return _el$225;
1601
1608
  })()
1602
1609
  }));
1603
- return _el$220;
1610
+ return _el$213;
1604
1611
  }
1605
- }), _el$227, _co$49);
1606
- insert(_el$210, createComponent(Show, {
1612
+ }), _el$220, _co$46);
1613
+ insert(_el$203, createComponent(Show, {
1607
1614
  get when() {
1608
1615
  return props.error.timestamp;
1609
1616
  },
1610
1617
  get children() {
1611
- var _el$223 = getNextElement(_tmpl$49);
1612
- insert(_el$223, () => new Date(props.error.timestamp).toLocaleString());
1613
- return _el$223;
1618
+ var _el$216 = getNextElement(_tmpl$48);
1619
+ insert(_el$216, () => new Date(props.error.timestamp).toLocaleString());
1620
+ return _el$216;
1614
1621
  }
1615
- }), _el$229, _co$50);
1616
- return _el$207;
1622
+ }), _el$222, _co$47);
1623
+ return _el$200;
1617
1624
  })();
1618
1625
  }
1619
1626
  function isErrorResponse(content) {
@@ -1636,20 +1643,20 @@ function UIResourceHtmlRenderer(props) {
1636
1643
  return ((_a = props.resource.metadata) == null ? void 0 : _a.title) || ((_b = props.resource.uri) == null ? void 0 : _b.replace("ui://deposium/", "")) || "Resource";
1637
1644
  };
1638
1645
  return (() => {
1639
- var _el$233 = getNextElement(_tmpl$53), _el$237 = _el$233.firstChild, [_el$238, _co$52] = getNextMarker(_el$237.nextSibling), _el$236 = _el$238.nextSibling;
1640
- insert(_el$233, createComponent(Show, {
1646
+ var _el$226 = getNextElement(_tmpl$52), _el$230 = _el$226.firstChild, [_el$231, _co$49] = getNextMarker(_el$230.nextSibling), _el$229 = _el$231.nextSibling;
1647
+ insert(_el$226, createComponent(Show, {
1641
1648
  get when() {
1642
1649
  var _a;
1643
1650
  return ((_a = props.resource.metadata) == null ? void 0 : _a.title) || props.resource.uri;
1644
1651
  },
1645
1652
  get children() {
1646
- var _el$234 = getNextElement(_tmpl$52), _el$235 = _el$234.firstChild;
1647
- insert(_el$235, resourceTitle);
1648
- return _el$234;
1653
+ var _el$227 = getNextElement(_tmpl$51), _el$228 = _el$227.firstChild;
1654
+ insert(_el$228, resourceTitle);
1655
+ return _el$227;
1649
1656
  }
1650
- }), _el$238, _co$52);
1651
- effect(() => setProperty(_el$236, "innerHTML", htmlContent()));
1652
- return _el$233;
1657
+ }), _el$231, _co$49);
1658
+ effect(() => setProperty(_el$229, "innerHTML", htmlContent()));
1659
+ return _el$226;
1653
1660
  })();
1654
1661
  }
1655
1662
  const UIResourceRenderer = (props) => {
@@ -1722,6 +1729,23 @@ const UIResourceRenderer = (props) => {
1722
1729
  };
1723
1730
  });
1724
1731
  const layoutData = layout();
1732
+ const isLayoutContent = !("type" in props.content) || props.content.type === "composite";
1733
+ const outerKey = createMemo(() => getUiResourceStableKey(props.content));
1734
+ onMount(() => {
1735
+ var _a, _b;
1736
+ const key = outerKey();
1737
+ const info = _registerMount(key);
1738
+ if (info.count > 1) {
1739
+ (_a = props.onMountDuplicate) == null ? void 0 : _a.call(props, info);
1740
+ (_b = getDuplicateMountReporter()) == null ? void 0 : _b(info);
1741
+ if (isDebugEnabled() || props.debugDuplicateMounts) {
1742
+ console.warn("[mcp-ui] duplicate UIResourceRenderer mount", info);
1743
+ }
1744
+ }
1745
+ });
1746
+ onCleanup(() => {
1747
+ _unregisterMount(outerKey());
1748
+ });
1725
1749
  const renderComponent = (component, onError) => createComponent(ComponentRenderer, {
1726
1750
  component,
1727
1751
  onError,
@@ -1735,14 +1759,23 @@ const UIResourceRenderer = (props) => {
1735
1759
  return createComponent(RenderProvider, {
1736
1760
  renderComponent,
1737
1761
  get children() {
1738
- var _el$239 = getNextElement(_tmpl$54), _el$240 = _el$239.firstChild, _el$241 = _el$240.nextSibling, [_el$242, _co$53] = getNextMarker(_el$241.nextSibling);
1739
- insert(_el$240, createComponent(For, {
1762
+ var _el$232 = getNextElement(_tmpl$53), _el$233 = _el$232.firstChild, _el$234 = _el$233.nextSibling, [_el$235, _co$50] = getNextMarker(_el$234.nextSibling);
1763
+ spread(_el$232, mergeProps({
1764
+ get ["class"]() {
1765
+ return `w-full ${props.class || ""}`;
1766
+ }
1767
+ }, () => isLayoutContent ? {
1768
+ "data-mcp-ui-layout-id": outerKey()
1769
+ } : {
1770
+ "data-mcp-ui-component-id": outerKey()
1771
+ }), false, true);
1772
+ insert(_el$233, createComponent(For, {
1740
1773
  get each() {
1741
1774
  return layoutData.components;
1742
1775
  },
1743
1776
  children: (component) => (() => {
1744
- var _el$243 = getNextElement(_tmpl$55);
1745
- insert(_el$243, createComponent(ComponentRenderer, {
1777
+ var _el$236 = getNextElement(_tmpl$54);
1778
+ insert(_el$236, createComponent(ComponentRenderer, {
1746
1779
  component,
1747
1780
  get onError() {
1748
1781
  return props.onError;
@@ -1754,11 +1787,19 @@ const UIResourceRenderer = (props) => {
1754
1787
  return props.toolbarVariant;
1755
1788
  }
1756
1789
  }));
1757
- effect((_$p) => style(_el$243, getGridStyleString(component), _$p));
1758
- return _el$243;
1790
+ effect((_p$) => {
1791
+ var _v$43 = getGridStyleString(component), _v$44 = getUiResourceStableKey(component);
1792
+ _p$.e = style(_el$236, _v$43, _p$.e);
1793
+ _v$44 !== _p$.t && setAttribute(_el$236, "data-mcp-ui-component-id", _p$.t = _v$44);
1794
+ return _p$;
1795
+ }, {
1796
+ e: void 0,
1797
+ t: void 0
1798
+ });
1799
+ return _el$236;
1759
1800
  })()
1760
1801
  }));
1761
- insert(_el$239, createComponent(Show, {
1802
+ insert(_el$232, createComponent(Show, {
1762
1803
  get when() {
1763
1804
  return shouldShowAutoFooter();
1764
1805
  },
@@ -1769,17 +1810,10 @@ const UIResourceRenderer = (props) => {
1769
1810
  }
1770
1811
  });
1771
1812
  }
1772
- }), _el$242, _co$53);
1773
- effect((_p$) => {
1774
- var _v$43 = `w-full ${props.class || ""}`, _v$44 = gridContainerStyle();
1775
- _v$43 !== _p$.e && className(_el$239, _p$.e = _v$43);
1776
- _p$.t = style(_el$240, _v$44, _p$.t);
1777
- return _p$;
1778
- }, {
1779
- e: void 0,
1780
- t: void 0
1781
- });
1782
- return _el$239;
1813
+ }), _el$235, _co$50);
1814
+ effect((_$p) => style(_el$233, gridContainerStyle(), _$p));
1815
+ runHydrationEvents();
1816
+ return _el$232;
1783
1817
  }
1784
1818
  });
1785
1819
  };