@eshal-bot/chat-widget 0.1.122 → 0.1.123

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.
@@ -48445,6 +48445,299 @@
48445
48445
  }
48446
48446
  };
48447
48447
 
48448
+ /**
48449
+ * @license lucide-react v0.575.0 - ISC
48450
+ *
48451
+ * This source code is licensed under the ISC license.
48452
+ * See the LICENSE file in the root directory of this source tree.
48453
+ */
48454
+
48455
+ const mergeClasses = (...classes) => classes.filter((className, index, array) => {
48456
+ return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
48457
+ }).join(" ").trim();
48458
+
48459
+ /**
48460
+ * @license lucide-react v0.575.0 - ISC
48461
+ *
48462
+ * This source code is licensed under the ISC license.
48463
+ * See the LICENSE file in the root directory of this source tree.
48464
+ */
48465
+
48466
+ const toKebabCase = string => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
48467
+
48468
+ /**
48469
+ * @license lucide-react v0.575.0 - ISC
48470
+ *
48471
+ * This source code is licensed under the ISC license.
48472
+ * See the LICENSE file in the root directory of this source tree.
48473
+ */
48474
+
48475
+ const toCamelCase = string => string.replace(/^([A-Z])|[\s-_]+(\w)/g, (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase());
48476
+
48477
+ /**
48478
+ * @license lucide-react v0.575.0 - ISC
48479
+ *
48480
+ * This source code is licensed under the ISC license.
48481
+ * See the LICENSE file in the root directory of this source tree.
48482
+ */
48483
+
48484
+ const toPascalCase = string => {
48485
+ const camelCase = toCamelCase(string);
48486
+ return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
48487
+ };
48488
+
48489
+ /**
48490
+ * @license lucide-react v0.575.0 - ISC
48491
+ *
48492
+ * This source code is licensed under the ISC license.
48493
+ * See the LICENSE file in the root directory of this source tree.
48494
+ */
48495
+
48496
+ var defaultAttributes = {
48497
+ xmlns: "http://www.w3.org/2000/svg",
48498
+ width: 24,
48499
+ height: 24,
48500
+ viewBox: "0 0 24 24",
48501
+ fill: "none",
48502
+ stroke: "currentColor",
48503
+ strokeWidth: 2,
48504
+ strokeLinecap: "round",
48505
+ strokeLinejoin: "round"
48506
+ };
48507
+
48508
+ /**
48509
+ * @license lucide-react v0.575.0 - ISC
48510
+ *
48511
+ * This source code is licensed under the ISC license.
48512
+ * See the LICENSE file in the root directory of this source tree.
48513
+ */
48514
+
48515
+ const hasA11yProp = props => {
48516
+ for (const prop in props) {
48517
+ if (prop.startsWith("aria-") || prop === "role" || prop === "title") {
48518
+ return true;
48519
+ }
48520
+ }
48521
+ return false;
48522
+ };
48523
+
48524
+ /**
48525
+ * @license lucide-react v0.575.0 - ISC
48526
+ *
48527
+ * This source code is licensed under the ISC license.
48528
+ * See the LICENSE file in the root directory of this source tree.
48529
+ */
48530
+
48531
+ const Icon = React.forwardRef(({
48532
+ color = "currentColor",
48533
+ size = 24,
48534
+ strokeWidth = 2,
48535
+ absoluteStrokeWidth,
48536
+ className = "",
48537
+ children,
48538
+ iconNode,
48539
+ ...rest
48540
+ }, ref) => React.createElement("svg", {
48541
+ ref,
48542
+ ...defaultAttributes,
48543
+ width: size,
48544
+ height: size,
48545
+ stroke: color,
48546
+ strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
48547
+ className: mergeClasses("lucide", className),
48548
+ ...(!children && !hasA11yProp(rest) && {
48549
+ "aria-hidden": "true"
48550
+ }),
48551
+ ...rest
48552
+ }, [...iconNode.map(([tag, attrs]) => React.createElement(tag, attrs)), ...(Array.isArray(children) ? children : [children])]));
48553
+
48554
+ /**
48555
+ * @license lucide-react v0.575.0 - ISC
48556
+ *
48557
+ * This source code is licensed under the ISC license.
48558
+ * See the LICENSE file in the root directory of this source tree.
48559
+ */
48560
+
48561
+ const createLucideIcon = (iconName, iconNode) => {
48562
+ const Component = React.forwardRef(({
48563
+ className,
48564
+ ...props
48565
+ }, ref) => React.createElement(Icon, {
48566
+ ref,
48567
+ iconNode,
48568
+ className: mergeClasses(`lucide-${toKebabCase(toPascalCase(iconName))}`, `lucide-${iconName}`, className),
48569
+ ...props
48570
+ }));
48571
+ Component.displayName = toPascalCase(iconName);
48572
+ return Component;
48573
+ };
48574
+
48575
+ /**
48576
+ * @license lucide-react v0.575.0 - ISC
48577
+ *
48578
+ * This source code is licensed under the ISC license.
48579
+ * See the LICENSE file in the root directory of this source tree.
48580
+ */
48581
+
48582
+ const __iconNode$7 = [["path", {
48583
+ d: "M8 2v4",
48584
+ key: "1cmpym"
48585
+ }], ["path", {
48586
+ d: "M16 2v4",
48587
+ key: "4m81vk"
48588
+ }], ["rect", {
48589
+ width: "18",
48590
+ height: "18",
48591
+ x: "3",
48592
+ y: "4",
48593
+ rx: "2",
48594
+ key: "1hopcy"
48595
+ }], ["path", {
48596
+ d: "M3 10h18",
48597
+ key: "8toen8"
48598
+ }], ["path", {
48599
+ d: "m9 16 2 2 4-4",
48600
+ key: "19s6y9"
48601
+ }]];
48602
+ const CalendarCheck = createLucideIcon("calendar-check", __iconNode$7);
48603
+
48604
+ /**
48605
+ * @license lucide-react v0.575.0 - ISC
48606
+ *
48607
+ * This source code is licensed under the ISC license.
48608
+ * See the LICENSE file in the root directory of this source tree.
48609
+ */
48610
+
48611
+ const __iconNode$6 = [["circle", {
48612
+ cx: "12",
48613
+ cy: "12",
48614
+ r: "10",
48615
+ key: "1mglay"
48616
+ }], ["path", {
48617
+ d: "m9 12 2 2 4-4",
48618
+ key: "dzmm74"
48619
+ }]];
48620
+ const CircleCheck = createLucideIcon("circle-check", __iconNode$6);
48621
+
48622
+ /**
48623
+ * @license lucide-react v0.575.0 - ISC
48624
+ *
48625
+ * This source code is licensed under the ISC license.
48626
+ * See the LICENSE file in the root directory of this source tree.
48627
+ */
48628
+
48629
+ const __iconNode$5 = [["path", {
48630
+ d: "M12 15V3",
48631
+ key: "m9g1x1"
48632
+ }], ["path", {
48633
+ d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",
48634
+ key: "ih7n3h"
48635
+ }], ["path", {
48636
+ d: "m7 10 5 5 5-5",
48637
+ key: "brsn70"
48638
+ }]];
48639
+ const Download = createLucideIcon("download", __iconNode$5);
48640
+
48641
+ /**
48642
+ * @license lucide-react v0.575.0 - ISC
48643
+ *
48644
+ * This source code is licensed under the ISC license.
48645
+ * See the LICENSE file in the root directory of this source tree.
48646
+ */
48647
+
48648
+ const __iconNode$4 = [["path", {
48649
+ d: "M15 3h6v6",
48650
+ key: "1q9fwt"
48651
+ }], ["path", {
48652
+ d: "M10 14 21 3",
48653
+ key: "gplh6r"
48654
+ }], ["path", {
48655
+ d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",
48656
+ key: "a6xqqp"
48657
+ }]];
48658
+ const ExternalLink = createLucideIcon("external-link", __iconNode$4);
48659
+
48660
+ /**
48661
+ * @license lucide-react v0.575.0 - ISC
48662
+ *
48663
+ * This source code is licensed under the ISC license.
48664
+ * See the LICENSE file in the root directory of this source tree.
48665
+ */
48666
+
48667
+ const __iconNode$3 = [["path", {
48668
+ d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
48669
+ key: "1oefj6"
48670
+ }], ["path", {
48671
+ d: "M14 2v5a1 1 0 0 0 1 1h5",
48672
+ key: "wfsgrz"
48673
+ }], ["path", {
48674
+ d: "M10 9H8",
48675
+ key: "b1mrlr"
48676
+ }], ["path", {
48677
+ d: "M16 13H8",
48678
+ key: "t4e002"
48679
+ }], ["path", {
48680
+ d: "M16 17H8",
48681
+ key: "z1uh3a"
48682
+ }]];
48683
+ const FileText = createLucideIcon("file-text", __iconNode$3);
48684
+
48685
+ /**
48686
+ * @license lucide-react v0.575.0 - ISC
48687
+ *
48688
+ * This source code is licensed under the ISC license.
48689
+ * See the LICENSE file in the root directory of this source tree.
48690
+ */
48691
+
48692
+ const __iconNode$2 = [["circle", {
48693
+ cx: "12",
48694
+ cy: "12",
48695
+ r: "10",
48696
+ key: "1mglay"
48697
+ }], ["path", {
48698
+ d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",
48699
+ key: "13o1zl"
48700
+ }], ["path", {
48701
+ d: "M2 12h20",
48702
+ key: "9i4pu4"
48703
+ }]];
48704
+ const Globe = createLucideIcon("globe", __iconNode$2);
48705
+
48706
+ /**
48707
+ * @license lucide-react v0.575.0 - ISC
48708
+ *
48709
+ * This source code is licensed under the ISC license.
48710
+ * See the LICENSE file in the root directory of this source tree.
48711
+ */
48712
+
48713
+ const __iconNode$1 = [["path", {
48714
+ d: "M21 12a9 9 0 1 1-6.219-8.56",
48715
+ key: "13zald"
48716
+ }]];
48717
+ const LoaderCircle = createLucideIcon("loader-circle", __iconNode$1);
48718
+
48719
+ /**
48720
+ * @license lucide-react v0.575.0 - ISC
48721
+ *
48722
+ * This source code is licensed under the ISC license.
48723
+ * See the LICENSE file in the root directory of this source tree.
48724
+ */
48725
+
48726
+ const __iconNode = [["path", {
48727
+ d: "M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z",
48728
+ key: "qn84l0"
48729
+ }], ["path", {
48730
+ d: "M13 5v2",
48731
+ key: "dyzc3o"
48732
+ }], ["path", {
48733
+ d: "M13 17v2",
48734
+ key: "1ont0d"
48735
+ }], ["path", {
48736
+ d: "M13 11v2",
48737
+ key: "1wjjxi"
48738
+ }]];
48739
+ const Ticket = createLucideIcon("ticket", __iconNode);
48740
+
48448
48741
  function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
48449
48742
 
48450
48743
  /**
@@ -87749,6 +88042,29 @@
87749
88042
  * `props.data` must be an array of `{ label, value }` objects.
87750
88043
  * Set `donut={true}` for a donut chart (innerRadius > 0).
87751
88044
  */
88045
+ /**
88046
+ * Where a pie slice's value label goes (EV-3006).
88047
+ *
88048
+ * Mirrors `sliceLabelPlacement` in
88049
+ * packages/frontend/src/components/charts/eshal-chart/chartShared.tsx - the
88050
+ * two pie renderers must agree, or the same chart reads differently in the
88051
+ * installed widget than in Testing Lab. Duplicated rather than imported
88052
+ * because the widget bundle is deliberately standalone (every byte ships on
88053
+ * every page of the customer's site); keep the two in step.
88054
+ *
88055
+ * 'inside' - wide enough to hold the number within the arc.
88056
+ * 'outside' - too narrow; drawn beyond the arc with a leader line, so a
88057
+ * small slice still shows its value instead of rendering bare.
88058
+ * 'none' - zero or non-finite; nothing worth labelling.
88059
+ */
88060
+ const PIE_LABEL_MIN_SHARE = 0.08;
88061
+ function sliceLabelPlacement(value, percent) {
88062
+ if (!Number.isFinite(value) || value === 0) return 'none';
88063
+ // Unknown share (recharts omits `percent` on some passes): assume there is
88064
+ // room rather than dropping a real value.
88065
+ if (!Number.isFinite(percent)) return 'inside';
88066
+ return percent < PIE_LABEL_MIN_SHARE ? 'outside' : 'inside';
88067
+ }
87752
88068
  function PieChartRenderer(_ref3) {
87753
88069
  let {
87754
88070
  props,
@@ -87768,6 +88084,76 @@
87768
88084
  name: d.label,
87769
88085
  value: d.value
87770
88086
  }));
88087
+
88088
+ // EV-3006: this renderer previously drew NO value labels at all - the slice
88089
+ // values existed only in the legend and the hover tooltip, and a pie whose
88090
+ // slices carry no numbers reads as broken (and a tooltip is unreachable on
88091
+ // touch). Labels now render on every non-zero slice: inside when the slice
88092
+ // is wide enough, outside on a leader line when it isn't. Same rule and
88093
+ // same threshold as Testing Lab's pie, so the two surfaces agree.
88094
+ const RADIAN = Math.PI / 180;
88095
+ const pieLabel = entry => {
88096
+ const v = Number(entry && entry.value);
88097
+ const placement = sliceLabelPlacement(v, Number(entry && entry.percent));
88098
+ if (placement === 'none') return null;
88099
+ const rIn = Number(entry.innerRadius) || 0;
88100
+ const rOut = Number(entry.outerRadius) || 0;
88101
+ const cx = Number(entry.cx);
88102
+ const cy = Number(entry.cy);
88103
+ const a = -Number(entry.midAngle) * RADIAN;
88104
+ const cos = Math.cos(a);
88105
+ const sin = Math.sin(a);
88106
+ const text = currency ? formatCurrencyFull(v) : Number(v).toLocaleString();
88107
+ if (placement === 'inside') {
88108
+ const r = rIn + (rOut - rIn) * (donut ? 0.78 : 0.6);
88109
+ return /*#__PURE__*/jsxRuntimeExports.jsx("text", {
88110
+ x: cx + r * cos,
88111
+ y: cy + r * sin,
88112
+ fill: "#ffffff",
88113
+ textAnchor: "middle",
88114
+ dominantBaseline: "central",
88115
+ style: {
88116
+ fontSize: 11,
88117
+ fontWeight: 600,
88118
+ pointerEvents: 'none'
88119
+ },
88120
+ children: text
88121
+ });
88122
+ }
88123
+
88124
+ // Narrow slice: place the number just outside the arc, tinted with the
88125
+ // slice's own colour so the pairing is unambiguous when several narrow
88126
+ // slices sit together. The elbow stays short so the label can't escape
88127
+ // the chart box at the collapsed widget width.
88128
+ const sliceColor = typeof entry.fill === 'string' && entry.fill ? entry.fill : isDark ? '#9ca3af' : '#64748b';
88129
+ const elbowR = rOut + 8;
88130
+ const ex = cx + elbowR * cos;
88131
+ const ey = cy + elbowR * sin;
88132
+ const toRight = cos >= 0;
88133
+ const tx = ex + (toRight ? 6 : -6);
88134
+ return /*#__PURE__*/jsxRuntimeExports.jsxs("g", {
88135
+ style: {
88136
+ pointerEvents: 'none'
88137
+ },
88138
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx("polyline", {
88139
+ points: "".concat(cx + rOut * cos, ",").concat(cy + rOut * sin, " ").concat(ex, ",").concat(ey, " ").concat(tx, ",").concat(ey),
88140
+ stroke: sliceColor,
88141
+ strokeWidth: 1,
88142
+ fill: "none"
88143
+ }), /*#__PURE__*/jsxRuntimeExports.jsx("text", {
88144
+ x: tx + (toRight ? 2 : -2),
88145
+ y: ey,
88146
+ fill: sliceColor,
88147
+ textAnchor: toRight ? 'start' : 'end',
88148
+ dominantBaseline: "central",
88149
+ style: {
88150
+ fontSize: 10,
88151
+ fontWeight: 600
88152
+ },
88153
+ children: text
88154
+ })]
88155
+ });
88156
+ };
87771
88157
  return /*#__PURE__*/jsxRuntimeExports.jsxs("div", {
87772
88158
  style: {
87773
88159
  borderRadius: 8,
@@ -87799,10 +88185,19 @@
87799
88185
  dataKey: "value",
87800
88186
  nameKey: "name",
87801
88187
  cx: "50%",
87802
- cy: "50%",
87803
- outerRadius: 85,
87804
- innerRadius: donut ? 48 : 0,
88188
+ cy: "50%"
88189
+ // EV-3006: pulled in from 85 to leave room for the outside
88190
+ // labels on narrow slices. Without the headroom the leader line
88191
+ // and number render past the chart box and get clipped, which is
88192
+ // the same failure the frontend pie hit with recharts' built-in
88193
+ // outside labels.
88194
+ ,
88195
+ outerRadius: 72,
88196
+ innerRadius: donut ? 40 : 0,
87805
88197
  paddingAngle: 2,
88198
+ labelLine: false,
88199
+ label: pieLabel,
88200
+ isAnimationActive: false,
87806
88201
  children: chartData.map((_, i) => /*#__PURE__*/jsxRuntimeExports.jsx(Cell, {
87807
88202
  fill: PIE_COLORS[i % PIE_COLORS.length]
87808
88203
  }, i))
@@ -88102,9 +88497,12 @@
88102
88497
  spec: spec,
88103
88498
  isDark: isDark
88104
88499
  });
88500
+ // EV-2654: `onButtonClick` threaded through so a card's non-link `actions`
88501
+ // are live buttons, not dead chrome.
88105
88502
  if (t === 'card') return /*#__PURE__*/jsxRuntimeExports.jsx(Card, {
88106
88503
  spec: spec,
88107
- isDark: isDark
88504
+ isDark: isDark,
88505
+ onButtonClick: onButtonClick
88108
88506
  });
88109
88507
  if (t === 'button-group') return /*#__PURE__*/jsxRuntimeExports.jsx(ButtonGroup, {
88110
88508
  spec: spec,
@@ -88387,30 +88785,235 @@
88387
88785
  children: spec.title
88388
88786
  }), spec.body && /*#__PURE__*/jsxRuntimeExports.jsx("div", {
88389
88787
  style: {
88390
- fontSize: 12
88788
+ fontSize: 12,
88789
+ lineHeight: 1.6,
88790
+ whiteSpace: 'pre-wrap',
88791
+ wordBreak: 'break-word'
88391
88792
  },
88392
88793
  children: String(spec.body)
88393
88794
  })]
88394
88795
  });
88395
88796
  }
88797
+
88798
+ // ── Card (EV-2654) ──────────────────────────────────────────────────────
88799
+ // Full parity with packages/frontend/src/components/charts/A2uiBlock.tsx's
88800
+ // Card. This used to render ONLY `title` + `body`, silently dropping
88801
+ // `icon`, `status`, `fields`, `actions`, `image` and `details`. The backend
88802
+ // emits the SAME spec to both surfaces (see
88803
+ // services/agent-builder/backend/app/services/a2ui_synth.py
88804
+ // `_calendar_card`), and an appointment card carries no `body` at all - its
88805
+ // content lives in `fields` - so the widget showed a card containing nothing
88806
+ // but the words "Appointment booked" while the inbox showed the full
88807
+ // Title / Date & Time / Duration / Attendees / Location rows plus the
88808
+ // "View Event" action. Every key the inbox reads is handled here now, so the
88809
+ // two renderers can't drift apart on this block type again.
88810
+
88811
+ // Status pill tones. Same --status-*/--status-*-bg values as
88812
+ // packages/frontend/src/app/globals.css (and the Alert palette above),
88813
+ // inlined as literals because this file styles via JS objects.
88814
+ const _STATUS_PILL = isDark => ({
88815
+ success: {
88816
+ bg: isDark ? 'hsl(152 36% 14%)' : 'hsl(152 81% 96%)',
88817
+ fg: isDark ? 'hsl(158 64% 52%)' : 'hsl(160 84% 39%)'
88818
+ },
88819
+ warn: {
88820
+ bg: isDark ? 'hsl(36 33% 14%)' : 'hsl(34 100% 95%)',
88821
+ fg: isDark ? 'hsl(38 92% 60%)' : 'hsl(35 100% 50%)'
88822
+ },
88823
+ error: {
88824
+ bg: isDark ? 'hsl(356 33% 16%)' : 'hsl(356 100% 97%)',
88825
+ fg: isDark ? 'hsl(350 89% 65%)' : 'hsl(350 89% 60%)'
88826
+ },
88827
+ info: {
88828
+ bg: isDark ? 'hsl(204 33% 14%)' : 'hsl(204 100% 97%)',
88829
+ fg: isDark ? 'hsl(199 89% 58%)' : 'hsl(199 89% 48%)'
88830
+ }
88831
+ });
88832
+
88833
+ // Mirrors the inbox's _CARD_ICON map.
88834
+ const _CARD_ICON = {
88835
+ calendar: CalendarCheck,
88836
+ ticket: Ticket,
88837
+ check: CircleCheck
88838
+ };
88396
88839
  function Card(_ref11) {
88397
88840
  let {
88398
88841
  spec,
88399
- isDark
88842
+ isDark,
88843
+ onButtonClick
88400
88844
  } = _ref11;
88845
+ const fields = Array.isArray(spec.fields) ? spec.fields : [];
88846
+ const actions = Array.isArray(spec.actions) ? spec.actions : [];
88847
+ const status = spec.status;
88848
+ const Icon = spec.icon ? _CARD_ICON[spec.icon] : null;
88849
+ // Product cards carry a short `body` summary + optional full `details`
88850
+ // (EV-1954). The toggle only appears when `details` adds real content.
88851
+ const [showFull, setShowFull] = React.useState(false);
88852
+ const summary = String(spec.body || '').trim();
88853
+ const full = String(spec.details || '').trim();
88854
+ const hasMore = summary.length > 0 && full.length > summary.length + 2;
88855
+ const imageUrl = safeUrl(spec.image);
88856
+ const pill = status && status.label ? _STATUS_PILL(isDark)[status.variant || 'success'] : null;
88401
88857
  return /*#__PURE__*/jsxRuntimeExports.jsxs("div", {
88402
- style: card(isDark),
88403
- children: [spec.title && /*#__PURE__*/jsxRuntimeExports.jsx("div", {
88858
+ style: _objectSpread2(_objectSpread2({}, card(isDark)), {}, {
88859
+ minWidth: 0,
88860
+ overflow: 'hidden'
88861
+ }),
88862
+ children: [imageUrl && /*#__PURE__*/jsxRuntimeExports.jsx("img", {
88863
+ src: imageUrl,
88864
+ alt: spec.title || '',
88865
+ referrerPolicy: "no-referrer",
88866
+ onError: e => {
88867
+ e.currentTarget.style.display = 'none';
88868
+ },
88404
88869
  style: {
88405
- fontWeight: 600,
88406
- marginBottom: 6
88870
+ display: 'block',
88871
+ margin: '-12px -12px 12px',
88872
+ width: 'calc(100% + 24px)',
88873
+ height: 140,
88874
+ objectFit: 'contain',
88875
+ background: isDark ? 'rgba(31,41,55,0.4)' : '#f9fafb'
88876
+ }
88877
+ }), (spec.title || pill) && /*#__PURE__*/jsxRuntimeExports.jsxs("div", {
88878
+ style: {
88879
+ display: 'flex',
88880
+ alignItems: 'center',
88881
+ justifyContent: 'space-between',
88882
+ gap: 8,
88883
+ marginBottom: 8
88407
88884
  },
88408
- children: spec.title
88409
- }), spec.body && /*#__PURE__*/jsxRuntimeExports.jsx("div", {
88885
+ children: [/*#__PURE__*/jsxRuntimeExports.jsxs("div", {
88886
+ style: {
88887
+ display: 'flex',
88888
+ alignItems: 'center',
88889
+ gap: 6,
88890
+ minWidth: 0
88891
+ },
88892
+ children: [Icon && /*#__PURE__*/jsxRuntimeExports.jsx(Icon, {
88893
+ size: 14,
88894
+ style: {
88895
+ flexShrink: 0,
88896
+ color: isDark ? '#60a5fa' : BRAND_BLUE
88897
+ }
88898
+ }), spec.title && /*#__PURE__*/jsxRuntimeExports.jsx("div", {
88899
+ style: {
88900
+ fontWeight: 600,
88901
+ minWidth: 0,
88902
+ overflow: 'hidden',
88903
+ textOverflow: 'ellipsis',
88904
+ whiteSpace: 'nowrap'
88905
+ },
88906
+ children: spec.title
88907
+ })]
88908
+ }), pill && /*#__PURE__*/jsxRuntimeExports.jsx("span", {
88909
+ style: {
88910
+ flexShrink: 0,
88911
+ borderRadius: 999,
88912
+ padding: '1px 8px',
88913
+ fontSize: 10,
88914
+ fontWeight: 500,
88915
+ background: pill.bg,
88916
+ color: pill.fg
88917
+ },
88918
+ children: status.label
88919
+ })]
88920
+ }), (summary || full) && /*#__PURE__*/jsxRuntimeExports.jsxs("div", {
88921
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx("div", {
88922
+ style: {
88923
+ fontSize: 12,
88924
+ lineHeight: 1.6,
88925
+ whiteSpace: 'pre-wrap',
88926
+ wordBreak: 'break-word'
88927
+ },
88928
+ children: showFull ? full || summary : summary || full
88929
+ }), hasMore && /*#__PURE__*/jsxRuntimeExports.jsx("button", {
88930
+ type: "button",
88931
+ onClick: () => setShowFull(v => !v),
88932
+ style: {
88933
+ marginTop: 4,
88934
+ padding: 0,
88935
+ border: 'none',
88936
+ background: 'none',
88937
+ fontSize: 11,
88938
+ fontWeight: 500,
88939
+ color: isDark ? '#60a5fa' : BRAND_BLUE,
88940
+ cursor: 'pointer'
88941
+ },
88942
+ children: showFull ? 'Show less' : 'Show more'
88943
+ })]
88944
+ }), fields.length > 0 && /*#__PURE__*/jsxRuntimeExports.jsx("div", {
88410
88945
  style: {
88411
- fontSize: 12
88946
+ display: 'grid',
88947
+ gridTemplateColumns: 'auto 1fr',
88948
+ columnGap: 12,
88949
+ rowGap: 6,
88950
+ marginTop: summary || full ? 12 : 0
88412
88951
  },
88413
- children: String(spec.body)
88952
+ children: fields.map((f, i) => /*#__PURE__*/jsxRuntimeExports.jsxs(React.Fragment, {
88953
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx("div", {
88954
+ style: {
88955
+ fontSize: 11,
88956
+ fontWeight: 500,
88957
+ color: isDark ? '#9ca3af' : '#6b7280',
88958
+ whiteSpace: 'nowrap'
88959
+ },
88960
+ children: f.label
88961
+ }), /*#__PURE__*/jsxRuntimeExports.jsx("div", {
88962
+ style: {
88963
+ fontSize: 12,
88964
+ minWidth: 0,
88965
+ wordBreak: 'break-word'
88966
+ },
88967
+ children: f.value
88968
+ })]
88969
+ }, i))
88970
+ }), actions.length > 0 && /*#__PURE__*/jsxRuntimeExports.jsx("div", {
88971
+ style: {
88972
+ display: 'flex',
88973
+ flexWrap: 'wrap',
88974
+ gap: 8,
88975
+ marginTop: 12
88976
+ },
88977
+ children: actions.map((a, i) => {
88978
+ const primary = a.variant !== 'secondary';
88979
+ const base = {
88980
+ display: 'inline-flex',
88981
+ alignItems: 'center',
88982
+ padding: '6px 12px',
88983
+ borderRadius: 6,
88984
+ fontSize: 11,
88985
+ fontWeight: 500,
88986
+ textDecoration: 'none',
88987
+ border: '1px solid ' + (primary ? BRAND_BLUE : isDark ? '#4b5563' : '#d1d5db'),
88988
+ background: primary ? BRAND_BLUE : isDark ? '#1f2937' : '#ffffff',
88989
+ color: primary ? '#ffffff' : isDark ? '#e5e7eb' : '#374151'
88990
+ };
88991
+ const url = safeUrl(a.url);
88992
+ if (url) {
88993
+ return /*#__PURE__*/jsxRuntimeExports.jsx("a", {
88994
+ href: url,
88995
+ target: "_blank",
88996
+ rel: "noopener noreferrer",
88997
+ style: base,
88998
+ children: a.label
88999
+ }, i);
89000
+ }
89001
+ const value = a.value || a.label;
89002
+ return /*#__PURE__*/jsxRuntimeExports.jsx("button", {
89003
+ type: "button",
89004
+ onClick: onButtonClick ? () => {
89005
+ var _a$label;
89006
+ return onButtonClick(String(value !== null && value !== void 0 ? value : ''), String((_a$label = a.label) !== null && _a$label !== void 0 ? _a$label : ''));
89007
+ } : undefined,
89008
+ disabled: !onButtonClick,
89009
+ title: !onButtonClick ? 'Action (no handler wired)' : undefined,
89010
+ style: _objectSpread2(_objectSpread2({}, base), {}, {
89011
+ cursor: onButtonClick ? 'pointer' : 'default',
89012
+ opacity: onButtonClick ? 1 : 0.5
89013
+ }),
89014
+ children: a.label
89015
+ }, i);
89016
+ })
88414
89017
  })]
88415
89018
  });
88416
89019
  }
@@ -88528,7 +89131,10 @@
88528
89131
  }), spec.body && /*#__PURE__*/jsxRuntimeExports.jsx("div", {
88529
89132
  style: {
88530
89133
  fontSize: 12,
88531
- marginBottom: 8
89134
+ lineHeight: 1.6,
89135
+ marginBottom: 8,
89136
+ whiteSpace: 'pre-wrap',
89137
+ wordBreak: 'break-word'
88532
89138
  },
88533
89139
  children: String(spec.body)
88534
89140
  }), /*#__PURE__*/jsxRuntimeExports.jsx(ButtonGroup, {
@@ -90588,230 +91194,6 @@
90588
91194
  };
90589
91195
  }
90590
91196
 
90591
- /**
90592
- * @license lucide-react v0.575.0 - ISC
90593
- *
90594
- * This source code is licensed under the ISC license.
90595
- * See the LICENSE file in the root directory of this source tree.
90596
- */
90597
-
90598
- const mergeClasses = (...classes) => classes.filter((className, index, array) => {
90599
- return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
90600
- }).join(" ").trim();
90601
-
90602
- /**
90603
- * @license lucide-react v0.575.0 - ISC
90604
- *
90605
- * This source code is licensed under the ISC license.
90606
- * See the LICENSE file in the root directory of this source tree.
90607
- */
90608
-
90609
- const toKebabCase = string => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
90610
-
90611
- /**
90612
- * @license lucide-react v0.575.0 - ISC
90613
- *
90614
- * This source code is licensed under the ISC license.
90615
- * See the LICENSE file in the root directory of this source tree.
90616
- */
90617
-
90618
- const toCamelCase = string => string.replace(/^([A-Z])|[\s-_]+(\w)/g, (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase());
90619
-
90620
- /**
90621
- * @license lucide-react v0.575.0 - ISC
90622
- *
90623
- * This source code is licensed under the ISC license.
90624
- * See the LICENSE file in the root directory of this source tree.
90625
- */
90626
-
90627
- const toPascalCase = string => {
90628
- const camelCase = toCamelCase(string);
90629
- return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
90630
- };
90631
-
90632
- /**
90633
- * @license lucide-react v0.575.0 - ISC
90634
- *
90635
- * This source code is licensed under the ISC license.
90636
- * See the LICENSE file in the root directory of this source tree.
90637
- */
90638
-
90639
- var defaultAttributes = {
90640
- xmlns: "http://www.w3.org/2000/svg",
90641
- width: 24,
90642
- height: 24,
90643
- viewBox: "0 0 24 24",
90644
- fill: "none",
90645
- stroke: "currentColor",
90646
- strokeWidth: 2,
90647
- strokeLinecap: "round",
90648
- strokeLinejoin: "round"
90649
- };
90650
-
90651
- /**
90652
- * @license lucide-react v0.575.0 - ISC
90653
- *
90654
- * This source code is licensed under the ISC license.
90655
- * See the LICENSE file in the root directory of this source tree.
90656
- */
90657
-
90658
- const hasA11yProp = props => {
90659
- for (const prop in props) {
90660
- if (prop.startsWith("aria-") || prop === "role" || prop === "title") {
90661
- return true;
90662
- }
90663
- }
90664
- return false;
90665
- };
90666
-
90667
- /**
90668
- * @license lucide-react v0.575.0 - ISC
90669
- *
90670
- * This source code is licensed under the ISC license.
90671
- * See the LICENSE file in the root directory of this source tree.
90672
- */
90673
-
90674
- const Icon = React.forwardRef(({
90675
- color = "currentColor",
90676
- size = 24,
90677
- strokeWidth = 2,
90678
- absoluteStrokeWidth,
90679
- className = "",
90680
- children,
90681
- iconNode,
90682
- ...rest
90683
- }, ref) => React.createElement("svg", {
90684
- ref,
90685
- ...defaultAttributes,
90686
- width: size,
90687
- height: size,
90688
- stroke: color,
90689
- strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
90690
- className: mergeClasses("lucide", className),
90691
- ...(!children && !hasA11yProp(rest) && {
90692
- "aria-hidden": "true"
90693
- }),
90694
- ...rest
90695
- }, [...iconNode.map(([tag, attrs]) => React.createElement(tag, attrs)), ...(Array.isArray(children) ? children : [children])]));
90696
-
90697
- /**
90698
- * @license lucide-react v0.575.0 - ISC
90699
- *
90700
- * This source code is licensed under the ISC license.
90701
- * See the LICENSE file in the root directory of this source tree.
90702
- */
90703
-
90704
- const createLucideIcon = (iconName, iconNode) => {
90705
- const Component = React.forwardRef(({
90706
- className,
90707
- ...props
90708
- }, ref) => React.createElement(Icon, {
90709
- ref,
90710
- iconNode,
90711
- className: mergeClasses(`lucide-${toKebabCase(toPascalCase(iconName))}`, `lucide-${iconName}`, className),
90712
- ...props
90713
- }));
90714
- Component.displayName = toPascalCase(iconName);
90715
- return Component;
90716
- };
90717
-
90718
- /**
90719
- * @license lucide-react v0.575.0 - ISC
90720
- *
90721
- * This source code is licensed under the ISC license.
90722
- * See the LICENSE file in the root directory of this source tree.
90723
- */
90724
-
90725
- const __iconNode$4 = [["path", {
90726
- d: "M12 15V3",
90727
- key: "m9g1x1"
90728
- }], ["path", {
90729
- d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",
90730
- key: "ih7n3h"
90731
- }], ["path", {
90732
- d: "m7 10 5 5 5-5",
90733
- key: "brsn70"
90734
- }]];
90735
- const Download = createLucideIcon("download", __iconNode$4);
90736
-
90737
- /**
90738
- * @license lucide-react v0.575.0 - ISC
90739
- *
90740
- * This source code is licensed under the ISC license.
90741
- * See the LICENSE file in the root directory of this source tree.
90742
- */
90743
-
90744
- const __iconNode$3 = [["path", {
90745
- d: "M15 3h6v6",
90746
- key: "1q9fwt"
90747
- }], ["path", {
90748
- d: "M10 14 21 3",
90749
- key: "gplh6r"
90750
- }], ["path", {
90751
- d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",
90752
- key: "a6xqqp"
90753
- }]];
90754
- const ExternalLink = createLucideIcon("external-link", __iconNode$3);
90755
-
90756
- /**
90757
- * @license lucide-react v0.575.0 - ISC
90758
- *
90759
- * This source code is licensed under the ISC license.
90760
- * See the LICENSE file in the root directory of this source tree.
90761
- */
90762
-
90763
- const __iconNode$2 = [["path", {
90764
- d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
90765
- key: "1oefj6"
90766
- }], ["path", {
90767
- d: "M14 2v5a1 1 0 0 0 1 1h5",
90768
- key: "wfsgrz"
90769
- }], ["path", {
90770
- d: "M10 9H8",
90771
- key: "b1mrlr"
90772
- }], ["path", {
90773
- d: "M16 13H8",
90774
- key: "t4e002"
90775
- }], ["path", {
90776
- d: "M16 17H8",
90777
- key: "z1uh3a"
90778
- }]];
90779
- const FileText = createLucideIcon("file-text", __iconNode$2);
90780
-
90781
- /**
90782
- * @license lucide-react v0.575.0 - ISC
90783
- *
90784
- * This source code is licensed under the ISC license.
90785
- * See the LICENSE file in the root directory of this source tree.
90786
- */
90787
-
90788
- const __iconNode$1 = [["circle", {
90789
- cx: "12",
90790
- cy: "12",
90791
- r: "10",
90792
- key: "1mglay"
90793
- }], ["path", {
90794
- d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",
90795
- key: "13o1zl"
90796
- }], ["path", {
90797
- d: "M2 12h20",
90798
- key: "9i4pu4"
90799
- }]];
90800
- const Globe = createLucideIcon("globe", __iconNode$1);
90801
-
90802
- /**
90803
- * @license lucide-react v0.575.0 - ISC
90804
- *
90805
- * This source code is licensed under the ISC license.
90806
- * See the LICENSE file in the root directory of this source tree.
90807
- */
90808
-
90809
- const __iconNode = [["path", {
90810
- d: "M21 12a9 9 0 1 1-6.219-8.56",
90811
- key: "13zald"
90812
- }]];
90813
- const LoaderCircle = createLucideIcon("loader-circle", __iconNode);
90814
-
90815
91197
  const WidgetCitationContext = /*#__PURE__*/React.createContext(null);
90816
91198
  function decodeName(name) {
90817
91199
  if (!name) return "";