@walkeros/explorer 4.7.2 → 4.8.0-next-1791496487198

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.
@@ -0,0 +1,2857 @@
1
+ "use client"
2
+
3
+ // src/design/components/cx.ts
4
+ function cx(...names) {
5
+ return names.filter((name) => Boolean(name)).join(" ");
6
+ }
7
+
8
+ // src/design/components/atoms/Button.tsx
9
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
10
+ function classes({
11
+ variant = "primary",
12
+ block = false,
13
+ className
14
+ }) {
15
+ return cx(
16
+ "elb-btn",
17
+ `elb-btn--${variant}`,
18
+ block && "elb-btn--block",
19
+ className
20
+ );
21
+ }
22
+ function LinkButton({
23
+ children,
24
+ variant,
25
+ arrow,
26
+ block,
27
+ className,
28
+ linkComponent: Link,
29
+ ...anchor
30
+ }) {
31
+ const props = {
32
+ ...anchor,
33
+ className: classes({ variant, block, className })
34
+ };
35
+ const content = /* @__PURE__ */ jsxs(Fragment, { children: [
36
+ children,
37
+ arrow && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: " \u2192" })
38
+ ] });
39
+ return Link ? /* @__PURE__ */ jsx(Link, { ...props, children: content }) : /* @__PURE__ */ jsx("a", { ...props, children: content });
40
+ }
41
+ function ButtonElement({
42
+ children,
43
+ variant,
44
+ arrow,
45
+ block,
46
+ className,
47
+ type = "button",
48
+ ...rest
49
+ }) {
50
+ return /* @__PURE__ */ jsxs(
51
+ "button",
52
+ {
53
+ ...rest,
54
+ type,
55
+ className: classes({ variant, block, className }),
56
+ children: [
57
+ children,
58
+ arrow && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: " \u2192" })
59
+ ]
60
+ }
61
+ );
62
+ }
63
+ function Button(props) {
64
+ return props.href === void 0 ? /* @__PURE__ */ jsx(ButtonElement, { ...props }) : /* @__PURE__ */ jsx(LinkButton, { ...props });
65
+ }
66
+
67
+ // src/design/components/atoms/InlineCode.tsx
68
+ import { jsx as jsx2 } from "react/jsx-runtime";
69
+ function InlineCode({ children, className, ...rest }) {
70
+ return /* @__PURE__ */ jsx2("code", { ...rest, className: cx("elb-code-inline", className), children });
71
+ }
72
+
73
+ // src/design/components/atoms/EventLegend.tsx
74
+ import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
75
+ var PARTS = [
76
+ ["entity", "var(--event-entity)"],
77
+ ["action", "var(--event-action)"],
78
+ ["property", "var(--event-property)"],
79
+ ["context", "var(--event-context)"],
80
+ ["globals", "var(--event-globals)"]
81
+ ];
82
+ function EventLegend({ parts, className, ...rest }) {
83
+ return /* @__PURE__ */ jsx3("div", { ...rest, className: cx("elb-legend", className), "data-theme": "dark", children: PARTS.filter(([part]) => !parts || parts.includes(part)).map(
84
+ ([part, color]) => /* @__PURE__ */ jsxs2("span", { className: "elb-legend__item", children: [
85
+ /* @__PURE__ */ jsx3(
86
+ "i",
87
+ {
88
+ className: "elb-legend__swatch",
89
+ style: { background: color },
90
+ "aria-hidden": "true"
91
+ }
92
+ ),
93
+ part
94
+ ] }, part)
95
+ ) });
96
+ }
97
+
98
+ // src/design/components/atoms/Icon.tsx
99
+ import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
100
+ var GLYPHS = {
101
+ check: {
102
+ viewBox: "0 0 16 16",
103
+ strokes: /* @__PURE__ */ jsx4(
104
+ "path",
105
+ {
106
+ d: "M3 8.5l3 3 7-7",
107
+ fill: "none",
108
+ stroke: "currentColor",
109
+ strokeWidth: 2,
110
+ strokeLinecap: "round",
111
+ strokeLinejoin: "round"
112
+ }
113
+ )
114
+ },
115
+ copy: {
116
+ viewBox: "0 0 24 24",
117
+ strokes: /* @__PURE__ */ jsxs3(Fragment2, { children: [
118
+ /* @__PURE__ */ jsx4(
119
+ "rect",
120
+ {
121
+ x: 9,
122
+ y: 9,
123
+ width: 12,
124
+ height: 12,
125
+ rx: 2,
126
+ fill: "none",
127
+ stroke: "currentColor",
128
+ strokeWidth: 2
129
+ }
130
+ ),
131
+ /* @__PURE__ */ jsx4(
132
+ "path",
133
+ {
134
+ d: "M5 15V5a2 2 0 0 1 2-2h10",
135
+ fill: "none",
136
+ stroke: "currentColor",
137
+ strokeWidth: 2
138
+ }
139
+ )
140
+ ] })
141
+ },
142
+ lock: {
143
+ viewBox: "0 0 24 24",
144
+ strokes: /* @__PURE__ */ jsxs3(
145
+ "g",
146
+ {
147
+ fill: "none",
148
+ stroke: "currentColor",
149
+ strokeWidth: 2,
150
+ strokeLinecap: "round",
151
+ strokeLinejoin: "round",
152
+ children: [
153
+ /* @__PURE__ */ jsx4("rect", { x: 5, y: 11, width: 14, height: 10, rx: 2 }),
154
+ /* @__PURE__ */ jsx4("path", { d: "M8 11V7a4 4 0 0 1 8 0v4" })
155
+ ]
156
+ }
157
+ )
158
+ },
159
+ reload: {
160
+ viewBox: "0 0 24 24",
161
+ strokes: /* @__PURE__ */ jsxs3(
162
+ "g",
163
+ {
164
+ fill: "none",
165
+ stroke: "currentColor",
166
+ strokeWidth: 2,
167
+ strokeLinecap: "round",
168
+ strokeLinejoin: "round",
169
+ children: [
170
+ /* @__PURE__ */ jsx4("path", { d: "M21 4v6h-6" }),
171
+ /* @__PURE__ */ jsx4("path", { d: "M20.5 15a9 9 0 1 1-2.1-9.4L21 10" })
172
+ ]
173
+ }
174
+ )
175
+ },
176
+ bookmark: {
177
+ viewBox: "0 0 24 24",
178
+ strokes: /* @__PURE__ */ jsx4(
179
+ "path",
180
+ {
181
+ d: "M6 3h12v18l-6-4-6 4z",
182
+ fill: "none",
183
+ stroke: "currentColor",
184
+ strokeWidth: 2,
185
+ strokeLinejoin: "round"
186
+ }
187
+ )
188
+ },
189
+ warning: {
190
+ viewBox: "0 0 24 24",
191
+ strokes: /* @__PURE__ */ jsxs3(
192
+ "g",
193
+ {
194
+ fill: "none",
195
+ stroke: "currentColor",
196
+ strokeWidth: 2,
197
+ strokeLinecap: "round",
198
+ strokeLinejoin: "round",
199
+ children: [
200
+ /* @__PURE__ */ jsx4("path", { d: "M10.3 3.9 2.4 18a2 2 0 0 0 1.7 3h15.8a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z" }),
201
+ /* @__PURE__ */ jsx4("path", { d: "M12 9v4" }),
202
+ /* @__PURE__ */ jsx4("path", { d: "M12 17h.01" })
203
+ ]
204
+ }
205
+ )
206
+ }
207
+ };
208
+ function Icon({ name, size = 16, className, ...rest }) {
209
+ const { viewBox, strokes } = GLYPHS[name];
210
+ return /* @__PURE__ */ jsx4(
211
+ "svg",
212
+ {
213
+ "aria-hidden": true,
214
+ focusable: false,
215
+ ...rest,
216
+ width: size,
217
+ height: size,
218
+ className: cx("elb-icon", `elb-icon--${name}`, className),
219
+ viewBox,
220
+ children: strokes
221
+ }
222
+ );
223
+ }
224
+
225
+ // src/design/components/atoms/Eyebrow.tsx
226
+ import { jsx as jsx5 } from "react/jsx-runtime";
227
+ function Eyebrow({
228
+ children,
229
+ variant = "eyebrow",
230
+ tone = "link",
231
+ className,
232
+ ...rest
233
+ }) {
234
+ return /* @__PURE__ */ jsx5(
235
+ "p",
236
+ {
237
+ ...rest,
238
+ className: cx(
239
+ "elb-eyebrow",
240
+ variant === "label" && "elb-eyebrow--label",
241
+ tone === "muted" && "elb-eyebrow--muted",
242
+ className
243
+ ),
244
+ children
245
+ }
246
+ );
247
+ }
248
+
249
+ // src/design/components/atoms/Stat.tsx
250
+ import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
251
+ function Stat({ value, children, className, ...rest }) {
252
+ return /* @__PURE__ */ jsxs4("div", { ...rest, className: cx("elb-stat", className), children: [
253
+ /* @__PURE__ */ jsx6("span", { className: "elb-stat__value", children: value }),
254
+ /* @__PURE__ */ jsx6("p", { className: "elb-stat__label", children })
255
+ ] });
256
+ }
257
+
258
+ // src/design/components/atoms/Text.tsx
259
+ import { jsx as jsx7 } from "react/jsx-runtime";
260
+ function Text({
261
+ children,
262
+ size = "body",
263
+ tone = "muted",
264
+ className,
265
+ ...rest
266
+ }) {
267
+ return /* @__PURE__ */ jsx7(
268
+ "p",
269
+ {
270
+ ...rest,
271
+ className: cx(
272
+ "elb-text",
273
+ size === "lg" && "elb-text--lg",
274
+ tone === "fg" && "elb-text--fg",
275
+ className
276
+ ),
277
+ children
278
+ }
279
+ );
280
+ }
281
+
282
+ // src/design/components/atoms/TextLink.tsx
283
+ import { Fragment as Fragment3, jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
284
+ function TextLink({
285
+ href,
286
+ children,
287
+ tone = "link",
288
+ arrow = false,
289
+ linkComponent: Link,
290
+ className,
291
+ ...rest
292
+ }) {
293
+ const props = {
294
+ ...rest,
295
+ href,
296
+ className: cx(
297
+ "elb-text-link",
298
+ tone === "muted" && "elb-text-link--muted",
299
+ className
300
+ )
301
+ };
302
+ const content = /* @__PURE__ */ jsxs5(Fragment3, { children: [
303
+ children,
304
+ arrow && /* @__PURE__ */ jsx8("span", { "aria-hidden": "true", children: " \u2192" })
305
+ ] });
306
+ return Link ? /* @__PURE__ */ jsx8(Link, { ...props, children: content }) : /* @__PURE__ */ jsx8("a", { ...props, children: content });
307
+ }
308
+
309
+ // src/design/components/atoms/Card.tsx
310
+ import { jsx as jsx9 } from "react/jsx-runtime";
311
+ function Card({
312
+ children,
313
+ padding = "md",
314
+ radius = "lg",
315
+ hover = false,
316
+ highlight = false,
317
+ glow = false,
318
+ className,
319
+ ...rest
320
+ }) {
321
+ return /* @__PURE__ */ jsx9(
322
+ "div",
323
+ {
324
+ ...rest,
325
+ className: cx(
326
+ "elb-card",
327
+ `elb-card--pad-${padding}`,
328
+ radius === "xl" && "elb-card--radius-xl",
329
+ hover && "elb-card--hover",
330
+ highlight && "elb-card--highlight",
331
+ glow && "elb-card--glow",
332
+ className
333
+ ),
334
+ children
335
+ }
336
+ );
337
+ }
338
+
339
+ // src/design/components/atoms/InstallCommand.tsx
340
+ import {
341
+ useEffect,
342
+ useId,
343
+ useRef,
344
+ useState
345
+ } from "react";
346
+ import { Fragment as Fragment4, jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
347
+ var CONFIRM_MS = 1400;
348
+ async function copyText(text) {
349
+ try {
350
+ await navigator.clipboard.writeText(text);
351
+ return true;
352
+ } catch {
353
+ return false;
354
+ }
355
+ }
356
+ function InstallCommand({
357
+ command = "npm i -g @walkeros/cli",
358
+ className,
359
+ "aria-describedby": describedBy,
360
+ ...rest
361
+ }) {
362
+ const hintId = useId();
363
+ const [state, setState] = useState("idle");
364
+ const mounted = useRef(true);
365
+ const timer = useRef(void 0);
366
+ useEffect(() => {
367
+ mounted.current = true;
368
+ return () => {
369
+ mounted.current = false;
370
+ clearTimeout(timer.current);
371
+ };
372
+ }, []);
373
+ const copy = async () => {
374
+ const copied = await copyText(command);
375
+ if (!mounted.current) return;
376
+ clearTimeout(timer.current);
377
+ setState(copied ? "done" : "failed");
378
+ if (copied) timer.current = setTimeout(() => setState("idle"), CONFIRM_MS);
379
+ };
380
+ return /* @__PURE__ */ jsxs6(Fragment4, { children: [
381
+ /* @__PURE__ */ jsxs6(
382
+ "button",
383
+ {
384
+ ...rest,
385
+ "aria-describedby": describedBy ? `${hintId} ${describedBy}` : hintId,
386
+ type: "button",
387
+ className: cx("elb-cmd", className),
388
+ onClick: () => {
389
+ void copy();
390
+ },
391
+ children: [
392
+ /* @__PURE__ */ jsxs6("span", { children: [
393
+ /* @__PURE__ */ jsxs6("span", { className: "elb-cmd__prompt", "aria-hidden": "true", children: [
394
+ "$",
395
+ " "
396
+ ] }),
397
+ command
398
+ ] }),
399
+ /* @__PURE__ */ jsx10(
400
+ "span",
401
+ {
402
+ className: cx(
403
+ "elb-cmd__icon",
404
+ state === "done" && "elb-cmd__icon--done"
405
+ ),
406
+ children: /* @__PURE__ */ jsx10(Icon, { name: state === "done" ? "check" : "copy" })
407
+ }
408
+ )
409
+ ]
410
+ }
411
+ ),
412
+ /* @__PURE__ */ jsx10("span", { id: hintId, hidden: true, children: "Copy install command" }),
413
+ /* @__PURE__ */ jsx10("span", { className: "elb-cmd__status", role: "status", children: state === "done" ? "Copied" : state === "failed" ? "Copy failed" : "" })
414
+ ] });
415
+ }
416
+
417
+ // src/design/components/atoms/PhotoPlaceholder.tsx
418
+ import { jsx as jsx11 } from "react/jsx-runtime";
419
+ function PhotoPlaceholder({
420
+ label = "photo",
421
+ tone = "theme",
422
+ className,
423
+ ...rest
424
+ }) {
425
+ const named = rest.role !== void 0 || rest["aria-label"] !== void 0 || rest["aria-labelledby"] !== void 0;
426
+ return /* @__PURE__ */ jsx11(
427
+ "div",
428
+ {
429
+ "aria-hidden": named ? void 0 : true,
430
+ ...rest,
431
+ className: cx("elb-photo", tone === "viz" && "elb-photo--viz", className),
432
+ ...tone === "viz" ? { "data-theme": "dark" } : {},
433
+ children: label
434
+ }
435
+ );
436
+ }
437
+
438
+ // src/design/components/molecules/CheckList.tsx
439
+ import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
440
+ function CheckList({
441
+ items,
442
+ layout = "inline",
443
+ align = "start",
444
+ className,
445
+ ...rest
446
+ }) {
447
+ const stack = layout === "stack";
448
+ return /* @__PURE__ */ jsx12(
449
+ "ul",
450
+ {
451
+ ...rest,
452
+ className: cx(
453
+ "elb-checklist",
454
+ stack && "elb-checklist--stack",
455
+ align === "center" && "elb-checklist--center",
456
+ className
457
+ ),
458
+ children: items.map((item, index) => /* @__PURE__ */ jsxs7("li", { className: "elb-checklist__item", children: [
459
+ /* @__PURE__ */ jsx12(Icon, { name: "check", size: stack ? 14 : 16 }),
460
+ item
461
+ ] }, index))
462
+ }
463
+ );
464
+ }
465
+
466
+ // src/design/components/molecules/SectionHeading.tsx
467
+ import { Fragment as Fragment5, jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
468
+ function SectionHeading({
469
+ title,
470
+ eyebrow,
471
+ lead,
472
+ level = 2,
473
+ size = "lg",
474
+ highlight,
475
+ align = "start",
476
+ className,
477
+ ...rest
478
+ }) {
479
+ const hero = level === 1;
480
+ return /* @__PURE__ */ jsxs8(
481
+ "div",
482
+ {
483
+ ...rest,
484
+ className: cx(
485
+ "elb-sh",
486
+ (hero || align === "center") && "elb-sh--center",
487
+ className
488
+ ),
489
+ children: [
490
+ eyebrow !== void 0 && /* @__PURE__ */ jsx13(Eyebrow, { children: eyebrow }),
491
+ hero ? /* @__PURE__ */ jsxs8("h1", { className: "elb-sh__title elb-sh__title--display", children: [
492
+ title,
493
+ highlight !== void 0 && /* @__PURE__ */ jsxs8(Fragment5, { children: [
494
+ " ",
495
+ /* @__PURE__ */ jsx13("span", { className: "elb-sh__highlight", children: highlight })
496
+ ] })
497
+ ] }) : /* @__PURE__ */ jsx13("h2", { className: cx("elb-sh__title", `elb-sh__title--${size}`), children: title }),
498
+ lead !== void 0 && /* @__PURE__ */ jsx13("p", { className: cx("elb-sh__lead", hero && "elb-sh__lead--hero"), children: lead })
499
+ ]
500
+ }
501
+ );
502
+ }
503
+
504
+ // src/design/components/molecules/ProblemCard.tsx
505
+ import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
506
+ function ProblemCard({
507
+ number,
508
+ title,
509
+ children,
510
+ className,
511
+ ...rest
512
+ }) {
513
+ return /* @__PURE__ */ jsxs9(
514
+ Card,
515
+ {
516
+ ...rest,
517
+ padding: "sm",
518
+ hover: true,
519
+ className: cx("elb-problem-card", className),
520
+ children: [
521
+ /* @__PURE__ */ jsxs9("h3", { className: "elb-problem-card__title", children: [
522
+ /* @__PURE__ */ jsx14("span", { className: "elb-problem-card__number", children: number }),
523
+ title
524
+ ] }),
525
+ /* @__PURE__ */ jsx14("p", { className: "elb-problem-card__text", children })
526
+ ]
527
+ }
528
+ );
529
+ }
530
+
531
+ // src/design/components/molecules/FeatureItem.tsx
532
+ import { jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
533
+ function FeatureItem({
534
+ title,
535
+ children,
536
+ href,
537
+ linkLabel = "Docs",
538
+ linkComponent,
539
+ linkAttributes,
540
+ className,
541
+ ...rest
542
+ }) {
543
+ return /* @__PURE__ */ jsxs10("div", { ...rest, className: cx("elb-feature", className), children: [
544
+ /* @__PURE__ */ jsx15(Icon, { name: "check", size: 20 }),
545
+ /* @__PURE__ */ jsxs10("div", { children: [
546
+ /* @__PURE__ */ jsx15("h3", { className: "elb-feature__title", children: title }),
547
+ /* @__PURE__ */ jsx15("p", { className: "elb-feature__text", children }),
548
+ href !== void 0 && /* @__PURE__ */ jsx15(
549
+ TextLink,
550
+ {
551
+ ...linkAttributes,
552
+ href,
553
+ arrow: true,
554
+ linkComponent,
555
+ className: "elb-feature__link",
556
+ children: linkLabel
557
+ }
558
+ )
559
+ ] })
560
+ ] });
561
+ }
562
+
563
+ // src/design/components/molecules/FaqItem.tsx
564
+ import {
565
+ Fragment as Fragment6
566
+ } from "react";
567
+ import { jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
568
+ function FaqItem({
569
+ question,
570
+ children,
571
+ className,
572
+ ...rest
573
+ }) {
574
+ const parts = Array.isArray(children) ? children : [children];
575
+ return /* @__PURE__ */ jsxs11("details", { ...rest, className: cx("elb-faq", className), children: [
576
+ /* @__PURE__ */ jsx16("summary", { className: "elb-faq__question", children: question }),
577
+ /* @__PURE__ */ jsx16("div", { className: "elb-faq__answer", children: parts.map(
578
+ (part, index) => typeof part === "string" ? /* @__PURE__ */ jsx16("p", { children: part }, index) : /* @__PURE__ */ jsx16(Fragment6, { children: part }, index)
579
+ ) })
580
+ ] });
581
+ }
582
+
583
+ // src/design/components/molecules/PlanCard.tsx
584
+ import { jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
585
+ function PlanCard({
586
+ label,
587
+ title,
588
+ children,
589
+ features,
590
+ cta,
591
+ highlight = false,
592
+ linkComponent,
593
+ className,
594
+ ...rest
595
+ }) {
596
+ return /* @__PURE__ */ jsxs12(
597
+ Card,
598
+ {
599
+ ...rest,
600
+ padding: "md",
601
+ highlight,
602
+ className: cx("elb-plan", className),
603
+ children: [
604
+ /* @__PURE__ */ jsx17(Eyebrow, { variant: "label", tone: highlight ? "link" : "muted", children: label }),
605
+ /* @__PURE__ */ jsx17("h3", { className: "elb-plan__title", children: title }),
606
+ /* @__PURE__ */ jsx17("p", { className: "elb-plan__text", children }),
607
+ features && /* @__PURE__ */ jsx17(CheckList, { items: features, layout: "stack" }),
608
+ cta && /* @__PURE__ */ jsx17(
609
+ Button,
610
+ {
611
+ ...cta.attributes,
612
+ href: cta.href,
613
+ variant: highlight ? "primary" : "secondary",
614
+ block: true,
615
+ linkComponent,
616
+ children: cta.label
617
+ }
618
+ )
619
+ ]
620
+ }
621
+ );
622
+ }
623
+
624
+ // src/design/components/molecules/CaseCard.tsx
625
+ import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
626
+ function CaseCard({
627
+ label,
628
+ title,
629
+ children,
630
+ stats,
631
+ className,
632
+ ...rest
633
+ }) {
634
+ return /* @__PURE__ */ jsxs13(Card, { ...rest, padding: "md", className: cx("elb-case-card", className), children: [
635
+ /* @__PURE__ */ jsx18(Eyebrow, { variant: "label", children: label }),
636
+ /* @__PURE__ */ jsx18("h3", { className: "elb-case-card__title", children: title }),
637
+ /* @__PURE__ */ jsx18("p", { className: "elb-case-card__text", children }),
638
+ /* @__PURE__ */ jsx18("div", { className: "elb-case-card__stats", children: stats.map((stat, index) => /* @__PURE__ */ jsx18(Stat, { value: stat.value, children: stat.label }, index)) })
639
+ ] });
640
+ }
641
+
642
+ // src/design/components/molecules/HighlightCard.tsx
643
+ import { jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
644
+ function HighlightCard({
645
+ label,
646
+ title,
647
+ children,
648
+ cta,
649
+ linkComponent,
650
+ className,
651
+ ...rest
652
+ }) {
653
+ return /* @__PURE__ */ jsxs14(
654
+ Card,
655
+ {
656
+ ...rest,
657
+ padding: "lg",
658
+ radius: "xl",
659
+ hover: true,
660
+ glow: true,
661
+ className: cx("elb-highlight-card", className),
662
+ children: [
663
+ /* @__PURE__ */ jsx19(Eyebrow, { variant: "label", children: label }),
664
+ /* @__PURE__ */ jsx19("h3", { className: "elb-highlight-card__title", children: title }),
665
+ /* @__PURE__ */ jsx19("p", { className: "elb-highlight-card__text", children }),
666
+ cta && /* @__PURE__ */ jsx19(
667
+ Button,
668
+ {
669
+ ...cta.attributes,
670
+ href: cta.href,
671
+ variant: "secondary",
672
+ arrow: true,
673
+ linkComponent,
674
+ className: "elb-highlight-card__cta",
675
+ children: cta.label
676
+ }
677
+ )
678
+ ]
679
+ }
680
+ );
681
+ }
682
+
683
+ // src/design/components/molecules/BrowserFrame.tsx
684
+ import { jsx as jsx20, jsxs as jsxs15 } from "react/jsx-runtime";
685
+ function BrowserFrame({
686
+ url,
687
+ bookmarks,
688
+ onNavigate,
689
+ onReload,
690
+ actions,
691
+ children,
692
+ className,
693
+ ...rest
694
+ }) {
695
+ return /* @__PURE__ */ jsxs15("div", { ...rest, className: cx("elb-browser", className), children: [
696
+ /* @__PURE__ */ jsxs15("div", { className: "elb-browser__bar", children: [
697
+ /* @__PURE__ */ jsxs15("span", { className: "elb-browser__dots", "aria-hidden": "true", children: [
698
+ /* @__PURE__ */ jsx20("span", {}),
699
+ /* @__PURE__ */ jsx20("span", {}),
700
+ /* @__PURE__ */ jsx20("span", {})
701
+ ] }),
702
+ /* @__PURE__ */ jsxs15("div", { className: "elb-browser__address", title: url, children: [
703
+ /* @__PURE__ */ jsx20(Icon, { name: "lock", size: 14 }),
704
+ /* @__PURE__ */ jsx20("span", { className: "elb-browser__url", children: url })
705
+ ] }),
706
+ onReload && /* @__PURE__ */ jsx20(
707
+ "button",
708
+ {
709
+ type: "button",
710
+ className: "elb-browser__reload",
711
+ "aria-label": "Reload",
712
+ onClick: onReload,
713
+ children: /* @__PURE__ */ jsx20(Icon, { name: "reload", size: 16 })
714
+ }
715
+ ),
716
+ actions && /* @__PURE__ */ jsx20("div", { className: "elb-browser__actions", children: actions })
717
+ ] }),
718
+ bookmarks && bookmarks.length > 0 && /* @__PURE__ */ jsx20("nav", { className: "elb-browser__bookmarks", "aria-label": "Bookmarks", children: bookmarks.map((bookmark) => {
719
+ const current = bookmark.url === url;
720
+ return /* @__PURE__ */ jsxs15(
721
+ "button",
722
+ {
723
+ type: "button",
724
+ className: cx(
725
+ "elb-browser__bookmark",
726
+ current && "elb-browser__bookmark--active"
727
+ ),
728
+ "aria-current": current ? "page" : void 0,
729
+ disabled: !onNavigate,
730
+ onClick: () => onNavigate?.(bookmark.url),
731
+ children: [
732
+ /* @__PURE__ */ jsx20(Icon, { name: "bookmark", size: 14 }),
733
+ /* @__PURE__ */ jsx20("span", { children: bookmark.label })
734
+ ]
735
+ },
736
+ bookmark.url
737
+ );
738
+ }) }),
739
+ /* @__PURE__ */ jsx20("div", { className: "elb-browser__viewport", children })
740
+ ] });
741
+ }
742
+
743
+ // src/design/components/molecules/QuickstartSteps.tsx
744
+ import { jsx as jsx21, jsxs as jsxs16 } from "react/jsx-runtime";
745
+ var ARROWS = [
746
+ {
747
+ kind: "wave",
748
+ paths: [
749
+ "M4 26 C 18 6, 34 6, 40 20 S 58 34, 70 16",
750
+ "M62 20 L70 16 L69.5 25"
751
+ ]
752
+ },
753
+ {
754
+ kind: "loop",
755
+ paths: [
756
+ "M4 28 C 20 30, 26 8, 38 10 C 50 12, 44 28, 36 24 C 28 20, 44 6, 72 14",
757
+ "M65.7 7.6 L72 14 L63.3 16.2"
758
+ ]
759
+ }
760
+ ];
761
+ function Arrow({ kind, paths }) {
762
+ return /* @__PURE__ */ jsx21(
763
+ "li",
764
+ {
765
+ className: cx("elb-quickstart__arrow", `elb-quickstart__arrow--${kind}`),
766
+ "aria-hidden": "true",
767
+ children: /* @__PURE__ */ jsx21(
768
+ "svg",
769
+ {
770
+ width: "76",
771
+ height: "40",
772
+ viewBox: "0 0 76 40",
773
+ fill: "none",
774
+ stroke: "currentColor",
775
+ strokeWidth: "2.2",
776
+ strokeLinecap: "round",
777
+ strokeLinejoin: "round",
778
+ children: paths.map((d) => /* @__PURE__ */ jsx21("path", { d }, d))
779
+ }
780
+ )
781
+ }
782
+ );
783
+ }
784
+ function QuickstartSteps({
785
+ steps,
786
+ children,
787
+ className,
788
+ ...rest
789
+ }) {
790
+ return /* @__PURE__ */ jsxs16("div", { ...rest, className: cx("elb-quickstart", className), children: [
791
+ /* @__PURE__ */ jsx21("ol", { className: "elb-quickstart__steps", children: steps.flatMap((step, index) => {
792
+ const item = /* @__PURE__ */ jsxs16("li", { className: "elb-quickstart__step", children: [
793
+ /* @__PURE__ */ jsxs16("div", { className: "elb-quickstart__head", children: [
794
+ /* @__PURE__ */ jsx21("span", { className: "elb-quickstart__num", "aria-hidden": "true", children: index + 1 }),
795
+ /* @__PURE__ */ jsx21("h3", { className: "elb-quickstart__title", children: step.title })
796
+ ] }),
797
+ /* @__PURE__ */ jsx21("p", { className: "elb-quickstart__copy", children: step.text })
798
+ ] }, step.title);
799
+ return index < steps.length - 1 ? [
800
+ item,
801
+ /* @__PURE__ */ jsx21(
802
+ Arrow,
803
+ {
804
+ ...ARROWS[index % ARROWS.length]
805
+ },
806
+ `arrow-${index}`
807
+ )
808
+ ] : [item];
809
+ }) }),
810
+ children
811
+ ] });
812
+ }
813
+
814
+ // src/design/components/layout/Section.tsx
815
+ import { jsx as jsx22 } from "react/jsx-runtime";
816
+ function Section({
817
+ children,
818
+ tone = "default",
819
+ className,
820
+ ...rest
821
+ }) {
822
+ return /* @__PURE__ */ jsx22(
823
+ "section",
824
+ {
825
+ ...rest,
826
+ className: cx(
827
+ "elb-section",
828
+ tone === "alt" && "elb-section--alt",
829
+ className
830
+ ),
831
+ children: /* @__PURE__ */ jsx22("div", { className: "elb-section__inner", children })
832
+ }
833
+ );
834
+ }
835
+
836
+ // src/design/components/layout/CardGrid.tsx
837
+ import { jsx as jsx23 } from "react/jsx-runtime";
838
+ function CardGrid({
839
+ children,
840
+ min,
841
+ gap = "cards",
842
+ className,
843
+ ...rest
844
+ }) {
845
+ return /* @__PURE__ */ jsx23(
846
+ "div",
847
+ {
848
+ ...rest,
849
+ className: cx(
850
+ "elb-card-grid",
851
+ `elb-card-grid--min-${min}`,
852
+ gap === "features" && "elb-card-grid--features",
853
+ className
854
+ ),
855
+ children
856
+ }
857
+ );
858
+ }
859
+
860
+ // src/design/components/layout/Split.tsx
861
+ import { jsx as jsx24, jsxs as jsxs17 } from "react/jsx-runtime";
862
+ function Split({
863
+ start,
864
+ end,
865
+ variant = "even",
866
+ className,
867
+ ...rest
868
+ }) {
869
+ return /* @__PURE__ */ jsxs17(
870
+ "div",
871
+ {
872
+ ...rest,
873
+ className: cx(
874
+ "elb-split",
875
+ variant === "aside" && "elb-split--aside",
876
+ className
877
+ ),
878
+ children: [
879
+ /* @__PURE__ */ jsx24("div", { className: "elb-split__start", children: start }),
880
+ /* @__PURE__ */ jsx24("div", { className: "elb-split__end", children: end })
881
+ ]
882
+ }
883
+ );
884
+ }
885
+
886
+ // src/design/components/layout/Cluster.tsx
887
+ import { jsx as jsx25 } from "react/jsx-runtime";
888
+ function Cluster({
889
+ children,
890
+ gap = "actions",
891
+ align = "start",
892
+ separated = false,
893
+ className,
894
+ ...rest
895
+ }) {
896
+ return /* @__PURE__ */ jsx25(
897
+ "div",
898
+ {
899
+ ...rest,
900
+ className: cx(
901
+ "elb-cluster",
902
+ gap === "links" && "elb-cluster--links",
903
+ align === "center" && "elb-cluster--center",
904
+ separated && "elb-cluster--separated",
905
+ className
906
+ ),
907
+ children
908
+ }
909
+ );
910
+ }
911
+
912
+ // src/design/components/layout/Hero.tsx
913
+ import { jsx as jsx26, jsxs as jsxs18 } from "react/jsx-runtime";
914
+ function Hero({
915
+ eyebrow,
916
+ title,
917
+ highlight,
918
+ lead,
919
+ actions,
920
+ proof,
921
+ children,
922
+ className,
923
+ ...rest
924
+ }) {
925
+ return /* @__PURE__ */ jsx26("section", { ...rest, className: cx("elb-hero", className), children: /* @__PURE__ */ jsxs18("div", { className: "elb-hero__inner", children: [
926
+ /* @__PURE__ */ jsx26(
927
+ SectionHeading,
928
+ {
929
+ level: 1,
930
+ eyebrow,
931
+ title,
932
+ highlight,
933
+ lead
934
+ }
935
+ ),
936
+ /* @__PURE__ */ jsx26("div", { className: "elb-hero__actions", children: actions }),
937
+ proof !== void 0 && /* @__PURE__ */ jsx26("div", { className: "elb-hero__proof", children: proof }),
938
+ children !== void 0 && /* @__PURE__ */ jsx26("div", { className: "elb-hero__demo", children })
939
+ ] }) });
940
+ }
941
+
942
+ // src/design/components/viz/DestinationMappingViz.tsx
943
+ import { useState as useState2 } from "react";
944
+
945
+ // src/design/components/viz/data/destination-mapping.ts
946
+ var GENERATED_ID = "\u2026";
947
+ var MAPPING_CAPTION = "50+ destination packages ship with the project. Removing GA4 or adding a new pixel is a block in this file, not a re-instrumentation project across every page.";
948
+ var GA4_MEASUREMENT_ID = "G-XXXXXXXXXX";
949
+ var MAPPING_EVENTS = [
950
+ {
951
+ entity: "product",
952
+ action: "view",
953
+ data: { id: "ers", price: 420, currency: "EUR" },
954
+ destinations: [
955
+ {
956
+ id: "ga4",
957
+ label: "GA4",
958
+ rule: {
959
+ name: "view_item",
960
+ data: {
961
+ map: {
962
+ currency: "data.currency",
963
+ value: "data.price",
964
+ items: { loop: ["this", { map: { item_id: "data.id" } }] }
965
+ }
966
+ }
967
+ },
968
+ calls: [
969
+ [
970
+ "gtag",
971
+ "event",
972
+ "view_item",
973
+ {
974
+ currency: "EUR",
975
+ value: 420,
976
+ items: [{ item_id: "ers" }],
977
+ send_to: GA4_MEASUREMENT_ID
978
+ }
979
+ ]
980
+ ]
981
+ },
982
+ {
983
+ id: "meta",
984
+ label: "Meta Pixel",
985
+ rule: {
986
+ name: "ViewContent",
987
+ data: {
988
+ map: {
989
+ value: "data.price",
990
+ currency: "data.currency",
991
+ contents: {
992
+ set: [
993
+ {
994
+ map: {
995
+ id: "data.id",
996
+ quantity: { key: "data.quantity", value: 1 }
997
+ }
998
+ }
999
+ ]
1000
+ },
1001
+ content_type: { value: "product" }
1002
+ }
1003
+ }
1004
+ },
1005
+ calls: [
1006
+ [
1007
+ "fbq",
1008
+ "track",
1009
+ "ViewContent",
1010
+ {
1011
+ value: 420,
1012
+ currency: "EUR",
1013
+ contents: [{ id: "ers", quantity: 1 }],
1014
+ content_type: "product"
1015
+ },
1016
+ { eventID: GENERATED_ID }
1017
+ ]
1018
+ ]
1019
+ },
1020
+ {
1021
+ id: "tiktok",
1022
+ label: "TikTok Pixel",
1023
+ rule: {
1024
+ name: "ViewContent",
1025
+ data: {
1026
+ map: {
1027
+ content_id: "data.id",
1028
+ content_type: { value: "product" },
1029
+ value: "data.price",
1030
+ currency: "data.currency"
1031
+ }
1032
+ }
1033
+ },
1034
+ calls: [
1035
+ [
1036
+ "ttq.track",
1037
+ "ViewContent",
1038
+ {
1039
+ content_id: "ers",
1040
+ content_type: "product",
1041
+ value: 420,
1042
+ currency: "EUR"
1043
+ },
1044
+ { event_id: GENERATED_ID }
1045
+ ]
1046
+ ]
1047
+ },
1048
+ {
1049
+ id: "amplitude",
1050
+ label: "Amplitude",
1051
+ rule: {
1052
+ name: "Product Viewed",
1053
+ data: {
1054
+ map: {
1055
+ product_id: "data.id",
1056
+ price: "data.price",
1057
+ currency: "data.currency"
1058
+ }
1059
+ }
1060
+ },
1061
+ calls: [
1062
+ [
1063
+ "amplitude.track",
1064
+ "Product Viewed",
1065
+ { product_id: "ers", price: 420, currency: "EUR" }
1066
+ ]
1067
+ ]
1068
+ }
1069
+ ]
1070
+ },
1071
+ {
1072
+ entity: "lead",
1073
+ action: "submit",
1074
+ data: { type: "demo", value: 2500, currency: "EUR" },
1075
+ destinations: [
1076
+ {
1077
+ id: "ga4",
1078
+ label: "GA4",
1079
+ rule: {
1080
+ name: "generate_lead",
1081
+ data: { map: { value: "data.value", currency: "data.currency" } }
1082
+ },
1083
+ calls: [
1084
+ [
1085
+ "gtag",
1086
+ "event",
1087
+ "generate_lead",
1088
+ { value: 2500, currency: "EUR", send_to: GA4_MEASUREMENT_ID }
1089
+ ]
1090
+ ]
1091
+ },
1092
+ {
1093
+ id: "meta",
1094
+ label: "Meta Pixel",
1095
+ rule: {
1096
+ name: "Lead",
1097
+ data: { map: { value: "data.value", currency: "data.currency" } }
1098
+ },
1099
+ calls: [
1100
+ [
1101
+ "fbq",
1102
+ "track",
1103
+ "Lead",
1104
+ { value: 2500, currency: "EUR" },
1105
+ { eventID: GENERATED_ID }
1106
+ ]
1107
+ ]
1108
+ },
1109
+ {
1110
+ id: "tiktok",
1111
+ label: "TikTok Pixel",
1112
+ rule: {
1113
+ name: "Contact",
1114
+ data: { map: { value: "data.value", currency: "data.currency" } }
1115
+ },
1116
+ calls: [
1117
+ [
1118
+ "ttq.track",
1119
+ "Contact",
1120
+ { value: 2500, currency: "EUR" },
1121
+ { event_id: GENERATED_ID }
1122
+ ]
1123
+ ]
1124
+ },
1125
+ {
1126
+ id: "amplitude",
1127
+ label: "Amplitude",
1128
+ rule: {
1129
+ name: "Lead Submitted",
1130
+ data: {
1131
+ map: {
1132
+ lead_type: "data.type",
1133
+ value: "data.value",
1134
+ currency: "data.currency"
1135
+ }
1136
+ }
1137
+ },
1138
+ calls: [
1139
+ [
1140
+ "amplitude.track",
1141
+ "Lead Submitted",
1142
+ { lead_type: "demo", value: 2500, currency: "EUR" }
1143
+ ]
1144
+ ]
1145
+ }
1146
+ ]
1147
+ },
1148
+ {
1149
+ entity: "order",
1150
+ action: "complete",
1151
+ data: { id: "0rd3r1d", value: 462, currency: "EUR" },
1152
+ nested: [
1153
+ { entity: "product", data: { id: "ers", price: 420, quantity: 1 } }
1154
+ ],
1155
+ destinations: [
1156
+ {
1157
+ id: "ga4",
1158
+ label: "GA4",
1159
+ rule: {
1160
+ name: "purchase",
1161
+ data: {
1162
+ map: {
1163
+ transaction_id: "data.id",
1164
+ value: "data.value",
1165
+ currency: "data.currency",
1166
+ items: {
1167
+ loop: [
1168
+ "nested",
1169
+ {
1170
+ map: {
1171
+ item_id: "data.id",
1172
+ price: "data.price",
1173
+ quantity: "data.quantity"
1174
+ }
1175
+ }
1176
+ ]
1177
+ }
1178
+ }
1179
+ }
1180
+ },
1181
+ calls: [
1182
+ [
1183
+ "gtag",
1184
+ "event",
1185
+ "purchase",
1186
+ {
1187
+ transaction_id: "0rd3r1d",
1188
+ value: 462,
1189
+ currency: "EUR",
1190
+ items: [{ item_id: "ers", price: 420, quantity: 1 }],
1191
+ send_to: GA4_MEASUREMENT_ID
1192
+ }
1193
+ ]
1194
+ ]
1195
+ },
1196
+ {
1197
+ id: "meta",
1198
+ label: "Meta Pixel",
1199
+ rule: {
1200
+ name: "Purchase",
1201
+ data: {
1202
+ map: {
1203
+ value: "data.value",
1204
+ currency: "data.currency",
1205
+ contents: {
1206
+ loop: [
1207
+ "nested",
1208
+ { map: { id: "data.id", quantity: "data.quantity" } }
1209
+ ]
1210
+ },
1211
+ content_type: { value: "product" }
1212
+ }
1213
+ }
1214
+ },
1215
+ calls: [
1216
+ [
1217
+ "fbq",
1218
+ "track",
1219
+ "Purchase",
1220
+ {
1221
+ value: 462,
1222
+ currency: "EUR",
1223
+ contents: [{ id: "ers", quantity: 1 }],
1224
+ content_type: "product"
1225
+ },
1226
+ { eventID: GENERATED_ID }
1227
+ ]
1228
+ ]
1229
+ },
1230
+ {
1231
+ id: "tiktok",
1232
+ label: "TikTok Pixel",
1233
+ rule: {
1234
+ name: "CompletePayment",
1235
+ data: {
1236
+ map: {
1237
+ order_id: "data.id",
1238
+ value: "data.value",
1239
+ currency: "data.currency",
1240
+ contents: {
1241
+ loop: [
1242
+ "nested",
1243
+ {
1244
+ map: {
1245
+ content_id: "data.id",
1246
+ quantity: "data.quantity",
1247
+ price: "data.price"
1248
+ }
1249
+ }
1250
+ ]
1251
+ },
1252
+ content_type: { value: "product" }
1253
+ }
1254
+ }
1255
+ },
1256
+ calls: [
1257
+ [
1258
+ "ttq.track",
1259
+ "CompletePayment",
1260
+ {
1261
+ order_id: "0rd3r1d",
1262
+ value: 462,
1263
+ currency: "EUR",
1264
+ contents: [{ content_id: "ers", quantity: 1, price: 420 }],
1265
+ content_type: "product"
1266
+ },
1267
+ { event_id: GENERATED_ID }
1268
+ ]
1269
+ ]
1270
+ },
1271
+ {
1272
+ id: "amplitude",
1273
+ label: "Amplitude",
1274
+ rule: {
1275
+ silent: true,
1276
+ settings: {
1277
+ revenue: {
1278
+ loop: [
1279
+ "nested",
1280
+ {
1281
+ map: {
1282
+ productId: "data.id",
1283
+ price: "data.price",
1284
+ quantity: "data.quantity",
1285
+ revenueType: { value: "purchase" },
1286
+ currency: { value: "EUR" }
1287
+ }
1288
+ }
1289
+ ]
1290
+ }
1291
+ }
1292
+ },
1293
+ calls: [
1294
+ [
1295
+ "amplitude.revenue",
1296
+ {
1297
+ productId: "ers",
1298
+ price: 420,
1299
+ quantity: 1,
1300
+ revenueType: "purchase",
1301
+ currency: "EUR"
1302
+ }
1303
+ ]
1304
+ ]
1305
+ }
1306
+ ]
1307
+ }
1308
+ ];
1309
+
1310
+ // src/design/components/viz/parts/CodeTokens.tsx
1311
+ import { Fragment as Fragment7, jsx as jsx27, jsxs as jsxs19 } from "react/jsx-runtime";
1312
+ function CodeTokens({
1313
+ tokens,
1314
+ active = false
1315
+ }) {
1316
+ return /* @__PURE__ */ jsx27(Fragment7, { children: tokens.map((token, index) => /* @__PURE__ */ jsx27(
1317
+ "span",
1318
+ {
1319
+ className: cx(
1320
+ "elb-viz-tok",
1321
+ `elb-viz-tok--${token.kind}`,
1322
+ active && token.mark && `elb-viz-tok--mark-${token.mark}`
1323
+ ),
1324
+ children: token.t
1325
+ },
1326
+ index
1327
+ )) });
1328
+ }
1329
+ function CodeLine({ number, bar, className, children }) {
1330
+ return /* @__PURE__ */ jsxs19("div", { className: cx("elb-viz-line", className), children: [
1331
+ /* @__PURE__ */ jsx27(
1332
+ "span",
1333
+ {
1334
+ className: cx("elb-viz-line__bar", bar && `elb-viz-line__bar--${bar}`),
1335
+ "aria-hidden": "true"
1336
+ }
1337
+ ),
1338
+ number !== void 0 && /* @__PURE__ */ jsx27("span", { className: "elb-viz-line__number", children: number }),
1339
+ /* @__PURE__ */ jsx27("span", { className: "elb-viz-line__code", children })
1340
+ ] });
1341
+ }
1342
+
1343
+ // src/design/components/viz/parts/tokens.ts
1344
+ function tok(t, kind, mark) {
1345
+ return mark ? { t, kind, mark } : { t, kind };
1346
+ }
1347
+ function typedLength(tokens) {
1348
+ return tokens.reduce((length, token) => length + token.t.length, 0);
1349
+ }
1350
+ function truncate(tokens, n) {
1351
+ const out = [];
1352
+ let left = n;
1353
+ for (const token of tokens) {
1354
+ if (left <= 0) break;
1355
+ const t = token.t.slice(0, left);
1356
+ out.push({ ...token, t });
1357
+ left -= t.length;
1358
+ }
1359
+ return out;
1360
+ }
1361
+
1362
+ // src/design/components/viz/parts/format.ts
1363
+ var ELIDED = "{\u2026}";
1364
+ function isRecord(value) {
1365
+ return typeof value === "object" && value !== null && !Array.isArray(value);
1366
+ }
1367
+ function literal(value) {
1368
+ if (typeof value === "string")
1369
+ return `'${value.replace(/\\/g, "\\\\").replace(/'/g, "\\'")}'`;
1370
+ if (typeof value !== "object" || value === null) return String(value);
1371
+ if (Array.isArray(value)) return `[${value.map(literal).join(", ")}]`;
1372
+ const entries = Object.entries(value);
1373
+ return entries.length === 0 ? "{}" : `{ ${entries.map(([key, item]) => `${key}: ${literal(item)}`).join(", ")} }`;
1374
+ }
1375
+ function formatRule(entity, action, rule) {
1376
+ const fields = [];
1377
+ if (rule.name !== void 0) fields.push(`"name": "${rule.name}"`);
1378
+ if (rule.silent) fields.push('"silent": true');
1379
+ if (rule.data !== void 0) fields.push(`"data": ${ELIDED}`);
1380
+ if (rule.settings !== void 0) {
1381
+ const settings = Object.keys(rule.settings).map(
1382
+ (key) => `"${key}": ${ELIDED}`
1383
+ );
1384
+ fields.push(`"settings": { ${settings.join(", ")} }`);
1385
+ }
1386
+ return `"${entity}": { "${action}": { ${fields.join(", ")} } }`;
1387
+ }
1388
+ function formatCall(record) {
1389
+ const [fn, ...args] = record;
1390
+ const at = args.findIndex(isRecord);
1391
+ const params = args[at];
1392
+ if (at < 0 || params === void 0 || !isRecord(params))
1393
+ return [`${fn}(${args.map(literal).join(", ")})`];
1394
+ const fields = Object.entries(params);
1395
+ if (fn === "amplitude.revenue") {
1396
+ if (fields.length === 0) return ["amplitude.revenue(new Revenue())"];
1397
+ return [
1398
+ "amplitude.revenue(new Revenue()",
1399
+ ...fields.map(
1400
+ ([key, value], index) => ` .set${key.charAt(0).toUpperCase()}${key.slice(1)}(${literal(value)})${index === fields.length - 1 ? ")" : ""}`
1401
+ )
1402
+ ];
1403
+ }
1404
+ const before = args.slice(0, at).map(literal);
1405
+ const after = args.slice(at + 1).map(literal);
1406
+ return [
1407
+ `${fn}(${[...before, "{"].join(", ")}`,
1408
+ ...fields.map(([key, value]) => ` ${key}: ${literal(value)},`),
1409
+ `}${after.map((arg) => `, ${arg}`).join("")})`
1410
+ ];
1411
+ }
1412
+ function formatElb(event) {
1413
+ const name = literal(`${event.entity} ${event.action}`);
1414
+ const data = literal(event.data);
1415
+ if (!event.nested?.length) return `elb(${name}, ${data})`;
1416
+ const nested = event.nested.map(
1417
+ (entity) => `{ entity: ${literal(entity.entity)}, \u2026 }`
1418
+ );
1419
+ return `elb({ name: ${name}, data: ${data}, nested: [${nested.join(", ")}] })`;
1420
+ }
1421
+ var TOKEN = /"[^"]*"|'[^']*'|\d+(?:\.\d+)?|[A-Za-z_]\w*|\s+|./g;
1422
+ var CALLS = /^(?:gtag|fbq|elb|ttq|track|amplitude|revenue|Revenue|set[A-Z]\w*)$/;
1423
+ function tokenizeCode(line, highlight) {
1424
+ const tokens = [];
1425
+ for (const match of line.matchAll(TOKEN)) {
1426
+ const t = match[0];
1427
+ const isKey = /^\s*:/.test(line.slice((match.index ?? 0) + t.length));
1428
+ if (t.startsWith('"') || t.startsWith("'")) {
1429
+ const marked = highlight !== void 0 && t.slice(1, -1) === highlight;
1430
+ tokens.push(
1431
+ tok(t, isKey ? "key" : "value", marked ? "entity" : void 0)
1432
+ );
1433
+ } else if (/^\d/.test(t) || t === "true" || t === "false") {
1434
+ tokens.push(tok(t, "num"));
1435
+ } else if (CALLS.test(t)) {
1436
+ tokens.push(tok(t, "fn"));
1437
+ } else if (/^[A-Za-z_]/.test(t)) {
1438
+ tokens.push(tok(t, isKey ? "key" : "text"));
1439
+ } else if (/^\s+$/.test(t)) {
1440
+ tokens.push(tok(t, "text"));
1441
+ } else {
1442
+ tokens.push(tok(t, "punct"));
1443
+ }
1444
+ }
1445
+ return tokens;
1446
+ }
1447
+
1448
+ // src/design/components/viz/parts/VizFrame.tsx
1449
+ import { jsx as jsx28 } from "react/jsx-runtime";
1450
+ function VizFrame({
1451
+ variant,
1452
+ children,
1453
+ className,
1454
+ ...rest
1455
+ }) {
1456
+ return /* @__PURE__ */ jsx28(
1457
+ "div",
1458
+ {
1459
+ ...rest,
1460
+ "data-theme": "dark",
1461
+ className: cx("elb-viz", `elb-viz--${variant}`, className),
1462
+ children: /* @__PURE__ */ jsx28("div", { className: "elb-viz__body", children })
1463
+ }
1464
+ );
1465
+ }
1466
+
1467
+ // src/design/components/viz/DestinationMappingViz.tsx
1468
+ import { jsx as jsx29, jsxs as jsxs20 } from "react/jsx-runtime";
1469
+ function DestinationMappingViz({
1470
+ initialEvent = 0,
1471
+ caption = MAPPING_CAPTION,
1472
+ ...rest
1473
+ }) {
1474
+ const [index, setIndex] = useState2(initialEvent);
1475
+ const event = MAPPING_EVENTS[index];
1476
+ const name = `${event.entity} ${event.action}`;
1477
+ return /* @__PURE__ */ jsx29(VizFrame, { ...rest, variant: "mapping", children: /* @__PURE__ */ jsxs20("div", { className: "elb-viz-mapping", children: [
1478
+ /* @__PURE__ */ jsxs20("div", { className: "elb-viz-mapping__pick", children: [
1479
+ /* @__PURE__ */ jsx29("div", { className: "elb-viz-mapping__label", children: "Pick an event" }),
1480
+ /* @__PURE__ */ jsx29("div", { className: "elb-viz-mapping__chips", children: MAPPING_EVENTS.map((item, position) => /* @__PURE__ */ jsxs20(
1481
+ "button",
1482
+ {
1483
+ type: "button",
1484
+ "aria-label": `${item.entity} ${item.action}`,
1485
+ "aria-pressed": position === index,
1486
+ className: cx(
1487
+ "elb-viz-mapping__chip",
1488
+ position === index && "elb-viz-mapping__chip--active"
1489
+ ),
1490
+ onClick: () => setIndex(position),
1491
+ children: [
1492
+ /* @__PURE__ */ jsx29("span", { className: "elb-viz-mapping__chip-entity", children: item.entity }),
1493
+ /* @__PURE__ */ jsx29("span", { className: "elb-viz-mapping__chip-action", children: item.action })
1494
+ ]
1495
+ },
1496
+ `${item.entity} ${item.action}`
1497
+ )) })
1498
+ ] }),
1499
+ /* @__PURE__ */ jsx29("div", { className: "elb-viz-mapping__event", children: /* @__PURE__ */ jsx29(CodeTokens, { tokens: tokenizeCode(formatElb(event), name), active: true }) }),
1500
+ /* @__PURE__ */ jsxs20("div", { className: "elb-viz-mapping__body", children: [
1501
+ /* @__PURE__ */ jsx29("div", { className: "elb-viz-mapping__comment", children: "// same event, four destinations, zero app code touched" }),
1502
+ /* @__PURE__ */ jsx29("div", { className: "elb-viz-mapping__cards", children: event.destinations.map((destination) => /* @__PURE__ */ jsxs20("div", { className: "elb-viz-mapping__card", children: [
1503
+ /* @__PURE__ */ jsx29("span", { className: "elb-viz-mapping__name", children: destination.label }),
1504
+ /* @__PURE__ */ jsxs20("div", { className: "elb-viz-mapping__row", children: [
1505
+ /* @__PURE__ */ jsx29("span", { className: "elb-viz-mapping__tag", children: "mapping" }),
1506
+ /* @__PURE__ */ jsx29("span", { className: "elb-viz-mapping__rule", children: /* @__PURE__ */ jsx29(
1507
+ CodeTokens,
1508
+ {
1509
+ tokens: tokenizeCode(
1510
+ formatRule(
1511
+ event.entity,
1512
+ event.action,
1513
+ destination.rule
1514
+ ),
1515
+ destination.rule.name
1516
+ ),
1517
+ active: true
1518
+ }
1519
+ ) })
1520
+ ] }),
1521
+ /* @__PURE__ */ jsxs20("div", { className: "elb-viz-mapping__row elb-viz-mapping__row--sends", children: [
1522
+ /* @__PURE__ */ jsx29("span", { className: "elb-viz-mapping__tag", children: "sends" }),
1523
+ /* @__PURE__ */ jsx29("div", { className: "elb-viz-mapping__calls", children: destination.calls.flatMap((call) => formatCall(call)).map((line, position) => /* @__PURE__ */ jsx29("div", { className: "elb-viz-mapping__line", children: /* @__PURE__ */ jsx29(
1524
+ CodeTokens,
1525
+ {
1526
+ tokens: tokenizeCode(line, destination.rule.name),
1527
+ active: true
1528
+ }
1529
+ ) }, position)) })
1530
+ ] })
1531
+ ] }, destination.id)) })
1532
+ ] }),
1533
+ caption !== "" && /* @__PURE__ */ jsx29("p", { className: "elb-viz-mapping__caption", children: caption })
1534
+ ] }) });
1535
+ }
1536
+
1537
+ // src/design/components/viz/HeroTaggingViz.tsx
1538
+ import { useEffect as useEffect3, useRef as useRef2, useState as useState4 } from "react";
1539
+
1540
+ // src/design/components/viz/parts/timeline.ts
1541
+ function clamp(x) {
1542
+ return Math.max(0, Math.min(1, x));
1543
+ }
1544
+ function ease(x) {
1545
+ return x < 0.5 ? 4 * x * x * x : 1 - Math.pow(-2 * x + 2, 3) / 2;
1546
+ }
1547
+
1548
+ // src/design/components/viz/data/hero.ts
1549
+ var HERO_ARTICLES = [
1550
+ { kicker: "Tech", title: "Return of the Bug", thumb: "bug" },
1551
+ { kicker: "Tech", title: "The quiet return of RSS", thumb: "tech" },
1552
+ { kicker: "Food", title: "Why sourdough came back", thumb: "food" }
1553
+ ];
1554
+ var HERO_START = 9e3;
1555
+ var HERO_LOOP = 11500;
1556
+ var CUE = {
1557
+ slideInStart: 0,
1558
+ slideInEnd: 500,
1559
+ entityStart: 900,
1560
+ entityEnd: 1500,
1561
+ impressionStart: 1800,
1562
+ impressionEnd: 2600,
1563
+ categoryStart: 2900,
1564
+ categoryEnd: 3600,
1565
+ titleStart: 3900,
1566
+ titleEnd: 4700,
1567
+ actionStart: 5e3,
1568
+ actionEnd: 5800,
1569
+ impressionEvent: 6200,
1570
+ moveStart: 6900,
1571
+ moveEnd: 7700,
1572
+ click: 7850,
1573
+ openEvent: 8e3,
1574
+ fadeOut: 10600,
1575
+ slideOutStart: 10800,
1576
+ slideOutEnd: 11400
1577
+ };
1578
+ var MAX_ROWS = 24;
1579
+ var PAST = 1e4;
1580
+ var ENTITY = [
1581
+ tok("data-elb", "attr"),
1582
+ tok("=", "punct"),
1583
+ tok('"article"', "str")
1584
+ ];
1585
+ var IMPRESSION = [
1586
+ tok("data-elbaction", "attr"),
1587
+ tok("=", "punct"),
1588
+ tok('"impression"', "str")
1589
+ ];
1590
+ var CATEGORY = [
1591
+ tok(" ", "punct"),
1592
+ tok("data-elb-article", "attr"),
1593
+ tok("=", "punct"),
1594
+ tok('"category:#innerText"', "str")
1595
+ ];
1596
+ var TITLE = [
1597
+ tok(" ", "punct"),
1598
+ tok("data-elb-article", "attr"),
1599
+ tok("=", "punct"),
1600
+ tok('"title:#innerText"', "str")
1601
+ ];
1602
+ var ACTION = [
1603
+ tok(" ", "punct"),
1604
+ tok("data-elbaction", "attr"),
1605
+ tok("=", "punct"),
1606
+ tok('"click:open"', "str")
1607
+ ];
1608
+ var TYPING = [
1609
+ [CUE.entityStart, CUE.entityEnd],
1610
+ [CUE.impressionStart, CUE.impressionEnd],
1611
+ [CUE.categoryStart, CUE.categoryEnd],
1612
+ [CUE.titleStart, CUE.titleEnd],
1613
+ [CUE.actionStart, CUE.actionEnd]
1614
+ ];
1615
+ function articleAt(loop) {
1616
+ return HERO_ARTICLES[loop % HERO_ARTICLES.length];
1617
+ }
1618
+ function caretSlot(ph) {
1619
+ if (ph >= CUE.entityStart - 400 && ph < CUE.impressionStart - 300)
1620
+ return "entity";
1621
+ if (ph >= CUE.impressionStart - 300 && ph < CUE.categoryStart - 100)
1622
+ return "impression";
1623
+ if (ph >= CUE.categoryStart - 100 && ph < CUE.titleStart - 100)
1624
+ return "category";
1625
+ if (ph >= CUE.titleStart - 100 && ph < CUE.actionStart - 100) return "title";
1626
+ if (ph >= CUE.actionStart - 100 && ph < CUE.moveStart) return "action";
1627
+ return null;
1628
+ }
1629
+ function typed(tokens, start, end, ph) {
1630
+ return truncate(
1631
+ tokens,
1632
+ Math.round(clamp((ph - start) / (end - start)) * typedLength(tokens))
1633
+ );
1634
+ }
1635
+ function heroLines(article, ph) {
1636
+ const slot = caretSlot(ph);
1637
+ const indent = tok(" ", "punct");
1638
+ const entity = typed(ENTITY, CUE.entityStart, CUE.entityEnd, ph);
1639
+ const impression = typed(
1640
+ IMPRESSION,
1641
+ CUE.impressionStart,
1642
+ CUE.impressionEnd,
1643
+ ph
1644
+ );
1645
+ const category = typed(CATEGORY, CUE.categoryStart, CUE.categoryEnd, ph);
1646
+ const title = typed(TITLE, CUE.titleStart, CUE.titleEnd, ph);
1647
+ const action = typed(ACTION, CUE.actionStart, CUE.actionEnd, ph);
1648
+ const lines = [
1649
+ {
1650
+ id: "open",
1651
+ tokens: [
1652
+ tok("<article", "tag"),
1653
+ tok(" ", "punct"),
1654
+ tok("class", "attr"),
1655
+ tok("=", "punct"),
1656
+ tok('"teaser"', "str")
1657
+ ],
1658
+ on: false,
1659
+ caret: null
1660
+ },
1661
+ ph >= CUE.entityStart - 400 ? {
1662
+ id: "entity",
1663
+ tokens: [indent, ...entity],
1664
+ on: true,
1665
+ caret: slot === "entity" ? 1 + entity.length : null
1666
+ } : null,
1667
+ ph >= CUE.impressionStart - 300 ? {
1668
+ id: "impression",
1669
+ tokens: [indent, ...impression],
1670
+ on: true,
1671
+ caret: slot === "impression" ? 1 + impression.length : null
1672
+ } : null,
1673
+ { id: "close", tokens: [tok(">", "tag")], on: false, caret: null },
1674
+ {
1675
+ id: "image",
1676
+ tokens: [
1677
+ indent,
1678
+ tok("<img", "tag"),
1679
+ tok(" ", "punct"),
1680
+ tok("src", "attr"),
1681
+ tok("=", "punct"),
1682
+ tok(`"/img/${article.thumb}.jpg"`, "str"),
1683
+ tok(" ", "punct"),
1684
+ tok("alt", "attr"),
1685
+ tok("=", "punct"),
1686
+ tok('""', "str"),
1687
+ tok(" />", "tag")
1688
+ ],
1689
+ on: false,
1690
+ caret: null
1691
+ },
1692
+ {
1693
+ id: "category",
1694
+ tokens: [
1695
+ indent,
1696
+ tok("<span", "tag"),
1697
+ tok(" ", "punct"),
1698
+ tok("class", "attr"),
1699
+ tok("=", "punct"),
1700
+ tok('"kicker"', "str"),
1701
+ ...category,
1702
+ tok(">", "tag"),
1703
+ tok(article.kicker, "text"),
1704
+ tok("</span>", "tag")
1705
+ ],
1706
+ on: ph >= CUE.categoryStart - 100,
1707
+ caret: slot === "category" ? 6 + category.length : null
1708
+ },
1709
+ {
1710
+ id: "title",
1711
+ tokens: [
1712
+ indent,
1713
+ tok("<h3", "tag"),
1714
+ ...title,
1715
+ tok(">", "tag"),
1716
+ tok(article.title, "text"),
1717
+ tok("</h3>", "tag")
1718
+ ],
1719
+ on: ph >= CUE.titleStart - 100,
1720
+ caret: slot === "title" ? 2 + title.length : null
1721
+ },
1722
+ {
1723
+ id: "action",
1724
+ tokens: [
1725
+ indent,
1726
+ tok("<a", "tag"),
1727
+ ...action,
1728
+ tok(">", "tag"),
1729
+ tok("Open \u2192", "text"),
1730
+ tok("</a>", "tag")
1731
+ ],
1732
+ on: ph >= CUE.actionStart - 100,
1733
+ caret: slot === "action" ? 2 + action.length : null
1734
+ },
1735
+ { id: "end", tokens: [tok("</article>", "tag")], on: false, caret: null }
1736
+ ];
1737
+ return lines.filter((line) => line !== null).map((line, index) => ({ ...line, n: index + 1 }));
1738
+ }
1739
+ function heroEvents(article) {
1740
+ const data = { category: article.kicker, title: article.title };
1741
+ return [
1742
+ { name: "article impression", data },
1743
+ { name: "article open", data }
1744
+ ];
1745
+ }
1746
+ function heroRows(loop, ph) {
1747
+ const rows = [];
1748
+ for (let j = loop; j >= 0 && rows.length < MAX_ROWS; j--) {
1749
+ const [impression, open] = heroEvents(articleAt(j));
1750
+ const current = j === loop;
1751
+ if (!current || ph >= CUE.openEvent)
1752
+ rows.push({
1753
+ ...open,
1754
+ key: `${j}-open`,
1755
+ age: current ? ph - CUE.openEvent : PAST
1756
+ });
1757
+ if (!current || ph >= CUE.impressionEvent)
1758
+ rows.push({
1759
+ ...impression,
1760
+ key: `${j}-impression`,
1761
+ age: current ? ph - CUE.impressionEvent : PAST
1762
+ });
1763
+ }
1764
+ return rows.slice(0, MAX_ROWS);
1765
+ }
1766
+ function heroFrame(t) {
1767
+ const loop = Math.floor(t / HERO_LOOP);
1768
+ const ph = t - loop * HERO_LOOP;
1769
+ const article = articleAt(loop);
1770
+ const slideIn = ease(
1771
+ clamp((ph - CUE.slideInStart) / (CUE.slideInEnd - CUE.slideInStart))
1772
+ );
1773
+ const slideOut = ease(
1774
+ clamp((ph - CUE.slideOutStart) / (CUE.slideOutEnd - CUE.slideOutStart))
1775
+ );
1776
+ const move = ease(
1777
+ clamp((ph - CUE.moveStart) / (CUE.moveEnd - CUE.moveStart))
1778
+ );
1779
+ const ripple = clamp((ph - CUE.click) / 550);
1780
+ const cursorShown = ph >= CUE.moveStart - 200 && ph < CUE.fadeOut + 200;
1781
+ const fadingOut = ph > CUE.fadeOut ? 1 - clamp((ph - CUE.fadeOut) / 200) : 1;
1782
+ return {
1783
+ article,
1784
+ lines: heroLines(article, ph),
1785
+ fade: ph < 250 ? ph / 250 : ph > CUE.fadeOut ? 1 - clamp((ph - CUE.fadeOut) / (HERO_LOOP - CUE.fadeOut - 150)) : 1,
1786
+ caretOn: TYPING.some(([start, end]) => ph >= start && ph <= end) || ph % 900 < 500,
1787
+ card: {
1788
+ opacity: clamp(ph / 250) * (1 - slideOut),
1789
+ offset: ph >= CUE.slideOutStart ? -slideOut * 190 : (1 - slideIn) * 190,
1790
+ entity: ph >= CUE.entityEnd,
1791
+ impression: ph >= CUE.impressionEnd,
1792
+ category: ph >= CUE.categoryEnd,
1793
+ title: ph >= CUE.titleEnd,
1794
+ action: ph >= CUE.actionEnd
1795
+ },
1796
+ cursor: {
1797
+ x: 22 + (1 - move) * 190,
1798
+ y: 11 - (1 - move) * 80,
1799
+ opacity: cursorShown ? clamp((ph - (CUE.moveStart - 200)) / 200) * fadingOut : 0,
1800
+ ring: 1 + ripple * 1.8,
1801
+ ringOpacity: ph >= CUE.click ? (1 - ripple) * 0.9 : 0,
1802
+ pressed: ph >= CUE.click && ph < CUE.click + 180
1803
+ },
1804
+ rows: heroRows(loop, ph)
1805
+ };
1806
+ }
1807
+
1808
+ // src/design/components/viz/parts/EventsTable.tsx
1809
+ import { Fragment as Fragment8 } from "react";
1810
+
1811
+ // src/design/components/viz/parts/style.ts
1812
+ function vizStyle(vars) {
1813
+ const style = {};
1814
+ return Object.assign(style, vars);
1815
+ }
1816
+
1817
+ // src/design/components/viz/parts/EventsTable.tsx
1818
+ import { jsx as jsx30, jsxs as jsxs21 } from "react/jsx-runtime";
1819
+ var SKELETON_ROWS = 6;
1820
+ function EventsTable({ rows }) {
1821
+ const skeletons = Math.max(0, SKELETON_ROWS - rows.length);
1822
+ return /* @__PURE__ */ jsxs21("div", { className: "elb-viz-table", children: [
1823
+ /* @__PURE__ */ jsxs21("div", { className: "elb-viz-table__head", children: [
1824
+ /* @__PURE__ */ jsxs21("span", { className: "elb-viz-table__query", children: [
1825
+ /* @__PURE__ */ jsx30("span", { className: "elb-viz-table__keyword", children: "SELECT" }),
1826
+ " *",
1827
+ " ",
1828
+ /* @__PURE__ */ jsx30("span", { className: "elb-viz-table__keyword", children: "FROM" }),
1829
+ " ",
1830
+ /* @__PURE__ */ jsx30("span", { className: "elb-viz-table__source", children: "walkerOS.events" })
1831
+ ] }),
1832
+ /* @__PURE__ */ jsxs21("span", { className: "elb-viz-table__live", children: [
1833
+ /* @__PURE__ */ jsx30("span", { className: "elb-viz-table__dot", "aria-hidden": "true" }),
1834
+ "live"
1835
+ ] })
1836
+ ] }),
1837
+ /* @__PURE__ */ jsx30("div", { className: "elb-viz-table__body", children: /* @__PURE__ */ jsx30("div", { className: "elb-viz-table__scroll", children: /* @__PURE__ */ jsxs21("div", { className: "elb-viz-table__rows", children: [
1838
+ /* @__PURE__ */ jsxs21("div", { className: "elb-viz-table__row elb-viz-table__row--header", children: [
1839
+ /* @__PURE__ */ jsx30("span", { className: "elb-viz-table__cell elb-viz-table__cell--n", children: "Row" }),
1840
+ /* @__PURE__ */ jsxs21("span", { className: "elb-viz-table__cell", children: [
1841
+ "name",
1842
+ /* @__PURE__ */ jsx30("span", { className: "elb-viz-table__type", children: "STRING" })
1843
+ ] }),
1844
+ /* @__PURE__ */ jsxs21("span", { className: "elb-viz-table__cell", children: [
1845
+ "data",
1846
+ /* @__PURE__ */ jsx30("span", { className: "elb-viz-table__type", children: "JSON" })
1847
+ ] })
1848
+ ] }),
1849
+ rows.map((row, index) => /* @__PURE__ */ jsxs21(
1850
+ "div",
1851
+ {
1852
+ className: "elb-viz-table__row elb-viz-table__row--event",
1853
+ style: vizStyle({
1854
+ "--elb-viz-row-tint": 14 * (1 - clamp(row.age / 1600)),
1855
+ "--elb-viz-row-opacity": clamp(row.age / 300),
1856
+ "--elb-viz-row-shift": (1 - ease(clamp(row.age / 500))) * -80
1857
+ }),
1858
+ children: [
1859
+ /* @__PURE__ */ jsx30("span", { className: "elb-viz-table__cell elb-viz-table__cell--n", children: index + 1 }),
1860
+ /* @__PURE__ */ jsx30("span", { className: "elb-viz-table__cell", children: row.name }),
1861
+ /* @__PURE__ */ jsxs21("span", { className: "elb-viz-table__cell elb-viz-table__json", children: [
1862
+ "{",
1863
+ Object.entries(row.data).map(([key, value], position) => /* @__PURE__ */ jsxs21(Fragment8, { children: [
1864
+ position === 0 ? '"' : ',"',
1865
+ /* @__PURE__ */ jsx30("span", { className: "elb-viz-table__json-key", children: key }),
1866
+ '":"',
1867
+ /* @__PURE__ */ jsx30("span", { className: "elb-viz-table__json-value", children: value }),
1868
+ '"'
1869
+ ] }, key)),
1870
+ "}"
1871
+ ] })
1872
+ ]
1873
+ },
1874
+ row.key
1875
+ )),
1876
+ Array.from({ length: skeletons }, (_, index) => /* @__PURE__ */ jsxs21(
1877
+ "div",
1878
+ {
1879
+ className: "elb-viz-table__row elb-viz-table__row--skeleton",
1880
+ "aria-hidden": "true",
1881
+ children: [
1882
+ /* @__PURE__ */ jsx30("span", { className: "elb-viz-table__cell elb-viz-table__cell--n", children: rows.length + index + 1 }),
1883
+ /* @__PURE__ */ jsx30("span", { className: "elb-viz-table__cell", children: /* @__PURE__ */ jsx30("span", { className: "elb-viz-table__bar" }) }),
1884
+ /* @__PURE__ */ jsx30("span", { className: "elb-viz-table__cell", children: /* @__PURE__ */ jsx30("span", { className: "elb-viz-table__bar" }) })
1885
+ ]
1886
+ },
1887
+ `skeleton-${index}`
1888
+ ))
1889
+ ] }) }) })
1890
+ ] });
1891
+ }
1892
+
1893
+ // src/design/components/viz/parts/hooks.ts
1894
+ import { useEffect as useEffect2, useState as useState3 } from "react";
1895
+ var REDUCED_MOTION = "(prefers-reduced-motion: reduce)";
1896
+ function useInView(ref, threshold) {
1897
+ const [inView, setInView] = useState3(false);
1898
+ useEffect2(() => {
1899
+ const element = ref.current;
1900
+ if (!element || typeof IntersectionObserver === "undefined") {
1901
+ setInView(true);
1902
+ return void 0;
1903
+ }
1904
+ const observer = new IntersectionObserver(
1905
+ (entries) => {
1906
+ const entry = entries[entries.length - 1];
1907
+ if (entry)
1908
+ setInView(
1909
+ entry.isIntersecting && entry.intersectionRatio >= threshold
1910
+ );
1911
+ },
1912
+ { threshold }
1913
+ );
1914
+ observer.observe(element);
1915
+ return () => observer.disconnect();
1916
+ }, [ref, threshold]);
1917
+ return inView;
1918
+ }
1919
+ function useReducedMotion() {
1920
+ const [reduced, setReduced] = useState3(false);
1921
+ useEffect2(() => {
1922
+ if (typeof window.matchMedia !== "function") return void 0;
1923
+ const media = window.matchMedia(REDUCED_MOTION);
1924
+ const update = () => setReduced(media.matches);
1925
+ update();
1926
+ media.addEventListener("change", update);
1927
+ return () => media.removeEventListener("change", update);
1928
+ }, []);
1929
+ return reduced;
1930
+ }
1931
+
1932
+ // src/design/components/viz/parts/Pill.tsx
1933
+ import { jsx as jsx31 } from "react/jsx-runtime";
1934
+ function Pill({
1935
+ part,
1936
+ variant = "solid",
1937
+ className,
1938
+ children
1939
+ }) {
1940
+ return /* @__PURE__ */ jsx31(
1941
+ "span",
1942
+ {
1943
+ className: cx(
1944
+ "elb-viz-pill",
1945
+ `elb-viz-pill--${part}`,
1946
+ variant === "outline" && "elb-viz-pill--outline",
1947
+ className
1948
+ ),
1949
+ children
1950
+ }
1951
+ );
1952
+ }
1953
+
1954
+ // src/design/components/viz/parts/Thumb.tsx
1955
+ import { Fragment as Fragment9, jsx as jsx32, jsxs as jsxs22 } from "react/jsx-runtime";
1956
+ var BUG_LINES = [
1957
+ "M36 46 L28 42",
1958
+ "M35 54 L27 56",
1959
+ "M38 61 L31 66",
1960
+ "M76 46 L84 42",
1961
+ "M77 54 L85 56",
1962
+ "M74 61 L81 66",
1963
+ "M51 25 Q47 17 42 16",
1964
+ "M61 25 Q65 17 70 16"
1965
+ ];
1966
+ var BUG_SPOTS = [
1967
+ [47, 44, 3.4],
1968
+ [65, 44, 3.4],
1969
+ [45, 56, 2.8],
1970
+ [67, 56, 2.8]
1971
+ ];
1972
+ function Bug() {
1973
+ return /* @__PURE__ */ jsxs22(Fragment9, { children: [
1974
+ /* @__PURE__ */ jsx32("rect", { className: "elb-viz-thumb__ground", width: 112, height: 86 }),
1975
+ /* @__PURE__ */ jsx32(
1976
+ "ellipse",
1977
+ {
1978
+ className: "elb-viz-thumb__shadow",
1979
+ cx: 56,
1980
+ cy: 66,
1981
+ rx: 30,
1982
+ ry: 6
1983
+ }
1984
+ ),
1985
+ /* @__PURE__ */ jsx32(
1986
+ "g",
1987
+ {
1988
+ className: "elb-viz-thumb__legs",
1989
+ strokeWidth: 2.4,
1990
+ strokeLinecap: "round",
1991
+ children: BUG_LINES.map((d) => /* @__PURE__ */ jsx32("path", { d }, d))
1992
+ }
1993
+ ),
1994
+ /* @__PURE__ */ jsx32("circle", { className: "elb-viz-thumb__ink", cx: 42, cy: 16, r: 2 }),
1995
+ /* @__PURE__ */ jsx32("circle", { className: "elb-viz-thumb__ink", cx: 70, cy: 16, r: 2 }),
1996
+ /* @__PURE__ */ jsx32(
1997
+ "ellipse",
1998
+ {
1999
+ className: "elb-viz-thumb__ink",
2000
+ cx: 56,
2001
+ cy: 30,
2002
+ rx: 10,
2003
+ ry: 7.5
2004
+ }
2005
+ ),
2006
+ /* @__PURE__ */ jsx32("circle", { className: "elb-viz-thumb__eye", cx: 52, cy: 29, r: 1.6 }),
2007
+ /* @__PURE__ */ jsx32("circle", { className: "elb-viz-thumb__eye", cx: 60, cy: 29, r: 1.6 }),
2008
+ /* @__PURE__ */ jsx32(
2009
+ "ellipse",
2010
+ {
2011
+ className: "elb-viz-thumb__shell",
2012
+ cx: 56,
2013
+ cy: 50,
2014
+ rx: 21,
2015
+ ry: 18
2016
+ }
2017
+ ),
2018
+ /* @__PURE__ */ jsx32("path", { className: "elb-viz-thumb__seam", d: "M56 33 L56 68", strokeWidth: 2 }),
2019
+ BUG_SPOTS.map(([x, y, r]) => /* @__PURE__ */ jsx32(
2020
+ "circle",
2021
+ {
2022
+ className: "elb-viz-thumb__ink",
2023
+ cx: x,
2024
+ cy: y,
2025
+ r
2026
+ },
2027
+ `${x}-${y}`
2028
+ )),
2029
+ /* @__PURE__ */ jsx32(
2030
+ "path",
2031
+ {
2032
+ className: "elb-viz-thumb__shine",
2033
+ d: "M44 38 Q48 35 52 36",
2034
+ strokeWidth: 2,
2035
+ strokeLinecap: "round"
2036
+ }
2037
+ )
2038
+ ] });
2039
+ }
2040
+ function Tech() {
2041
+ return /* @__PURE__ */ jsxs22(Fragment9, { children: [
2042
+ /* @__PURE__ */ jsx32("rect", { className: "elb-viz-thumb__ground", width: 112, height: 86 }),
2043
+ /* @__PURE__ */ jsx32(
2044
+ "rect",
2045
+ {
2046
+ className: "elb-viz-thumb__badge",
2047
+ x: 38,
2048
+ y: 25,
2049
+ width: 36,
2050
+ height: 36,
2051
+ rx: 8
2052
+ }
2053
+ ),
2054
+ /* @__PURE__ */ jsx32("circle", { className: "elb-viz-thumb__dot", cx: 47, cy: 52, r: 3.2 }),
2055
+ /* @__PURE__ */ jsx32(
2056
+ "path",
2057
+ {
2058
+ className: "elb-viz-thumb__wave",
2059
+ d: "M45 42 A10 10 0 0 1 57 54",
2060
+ strokeWidth: 3.5,
2061
+ strokeLinecap: "round"
2062
+ }
2063
+ ),
2064
+ /* @__PURE__ */ jsx32(
2065
+ "path",
2066
+ {
2067
+ className: "elb-viz-thumb__wave",
2068
+ d: "M45 34.5 A17.5 17.5 0 0 1 64.5 54",
2069
+ strokeWidth: 3.5,
2070
+ strokeLinecap: "round"
2071
+ }
2072
+ )
2073
+ ] });
2074
+ }
2075
+ function Food() {
2076
+ return /* @__PURE__ */ jsxs22(Fragment9, { children: [
2077
+ /* @__PURE__ */ jsx32("rect", { className: "elb-viz-thumb__ground", width: 112, height: 86 }),
2078
+ /* @__PURE__ */ jsx32(
2079
+ "ellipse",
2080
+ {
2081
+ className: "elb-viz-thumb__plate",
2082
+ cx: 56,
2083
+ cy: 62,
2084
+ rx: 44,
2085
+ ry: 10
2086
+ }
2087
+ ),
2088
+ /* @__PURE__ */ jsx32(
2089
+ "ellipse",
2090
+ {
2091
+ className: "elb-viz-thumb__loaf",
2092
+ cx: 56,
2093
+ cy: 50,
2094
+ rx: 31,
2095
+ ry: 19
2096
+ }
2097
+ ),
2098
+ /* @__PURE__ */ jsx32(
2099
+ "ellipse",
2100
+ {
2101
+ className: "elb-viz-thumb__crust",
2102
+ cx: 56,
2103
+ cy: 45,
2104
+ rx: 25,
2105
+ ry: 13
2106
+ }
2107
+ ),
2108
+ /* @__PURE__ */ jsx32(
2109
+ "path",
2110
+ {
2111
+ className: "elb-viz-thumb__score",
2112
+ d: "M40 44 Q56 35 72 44",
2113
+ strokeWidth: 2.2,
2114
+ strokeLinecap: "round"
2115
+ }
2116
+ ),
2117
+ /* @__PURE__ */ jsx32(
2118
+ "path",
2119
+ {
2120
+ className: "elb-viz-thumb__score",
2121
+ d: "M44 51 Q56 45 68 51",
2122
+ strokeWidth: 2.2,
2123
+ strokeLinecap: "round"
2124
+ }
2125
+ )
2126
+ ] });
2127
+ }
2128
+ function Thumb({ kind }) {
2129
+ return /* @__PURE__ */ jsx32(
2130
+ "svg",
2131
+ {
2132
+ className: cx("elb-viz-thumb", `elb-viz-thumb--${kind}`),
2133
+ viewBox: "0 0 112 86",
2134
+ preserveAspectRatio: "xMidYMid slice",
2135
+ "aria-hidden": "true",
2136
+ focusable: "false",
2137
+ children: kind === "bug" ? /* @__PURE__ */ jsx32(Bug, {}) : kind === "tech" ? /* @__PURE__ */ jsx32(Tech, {}) : /* @__PURE__ */ jsx32(Food, {})
2138
+ }
2139
+ );
2140
+ }
2141
+
2142
+ // src/design/components/viz/HeroTaggingViz.tsx
2143
+ import { Fragment as Fragment10, jsx as jsx33, jsxs as jsxs23 } from "react/jsx-runtime";
2144
+ var MAX_STEP = 64;
2145
+ function HeroTaggingViz({
2146
+ playing = true,
2147
+ speed = 1,
2148
+ startAt = HERO_START,
2149
+ ...rest
2150
+ }) {
2151
+ const paneRef = useRef2(null);
2152
+ const inView = useInView(paneRef, 0);
2153
+ const reduced = useReducedMotion();
2154
+ const [time, setTime] = useState4(startAt);
2155
+ const animate = playing && inView && !reduced;
2156
+ useEffect3(() => {
2157
+ if (!animate) return void 0;
2158
+ let frame = 0;
2159
+ let last = performance.now();
2160
+ const step = (now) => {
2161
+ const elapsed = Math.min(MAX_STEP, now - last);
2162
+ last = now;
2163
+ setTime((value) => value + elapsed * speed);
2164
+ frame = requestAnimationFrame(step);
2165
+ };
2166
+ frame = requestAnimationFrame(step);
2167
+ return () => cancelAnimationFrame(frame);
2168
+ }, [animate, speed]);
2169
+ const { article, lines, fade: fade2, caretOn, card, cursor, rows } = heroFrame(time);
2170
+ return /* @__PURE__ */ jsx33(VizFrame, { ...rest, variant: "hero", children: /* @__PURE__ */ jsxs23("div", { className: "elb-viz-hero", children: [
2171
+ /* @__PURE__ */ jsxs23("div", { ref: paneRef, className: "elb-viz-hero__pane", children: [
2172
+ /* @__PURE__ */ jsxs23("div", { className: "elb-viz-hero__bar", children: [
2173
+ /* @__PURE__ */ jsxs23("span", { className: "elb-viz-hero__dots", "aria-hidden": "true", children: [
2174
+ /* @__PURE__ */ jsx33("span", {}),
2175
+ /* @__PURE__ */ jsx33("span", {}),
2176
+ /* @__PURE__ */ jsx33("span", {})
2177
+ ] }),
2178
+ /* @__PURE__ */ jsx33("span", { className: "elb-viz-hero__file", children: "ArticleTeaser.html" })
2179
+ ] }),
2180
+ /* @__PURE__ */ jsx33(
2181
+ "div",
2182
+ {
2183
+ className: "elb-viz-hero__code",
2184
+ style: vizStyle({ "--elb-viz-fade": fade2 }),
2185
+ children: lines.map((line) => /* @__PURE__ */ jsx33(
2186
+ CodeLine,
2187
+ {
2188
+ number: line.n,
2189
+ bar: line.on ? "entity" : void 0,
2190
+ className: cx(
2191
+ "elb-viz-hero__line",
2192
+ line.on && "elb-viz-hero__line--on"
2193
+ ),
2194
+ children: line.caret === null ? /* @__PURE__ */ jsx33(CodeTokens, { tokens: line.tokens }) : /* @__PURE__ */ jsxs23(Fragment10, { children: [
2195
+ /* @__PURE__ */ jsx33(CodeTokens, { tokens: line.tokens.slice(0, line.caret) }),
2196
+ /* @__PURE__ */ jsx33(
2197
+ "span",
2198
+ {
2199
+ className: "elb-viz-caret",
2200
+ style: vizStyle({ "--elb-viz-caret": caretOn ? 1 : 0 })
2201
+ }
2202
+ ),
2203
+ /* @__PURE__ */ jsx33(CodeTokens, { tokens: line.tokens.slice(line.caret) })
2204
+ ] })
2205
+ },
2206
+ line.id
2207
+ ))
2208
+ }
2209
+ ),
2210
+ /* @__PURE__ */ jsx33("div", { className: "elb-viz-hero__stage", children: /* @__PURE__ */ jsxs23(
2211
+ "div",
2212
+ {
2213
+ className: cx(
2214
+ "elb-viz-hero__card",
2215
+ card.entity && "elb-viz-hero__card--tagged"
2216
+ ),
2217
+ style: vizStyle({
2218
+ "--elb-viz-card-opacity": card.opacity,
2219
+ "--elb-viz-card-offset": card.offset
2220
+ }),
2221
+ children: [
2222
+ /* @__PURE__ */ jsxs23("div", { className: "elb-viz-hero__pills", children: [
2223
+ card.entity && /* @__PURE__ */ jsx33(Pill, { part: "entity", children: "article" }),
2224
+ card.impression && /* @__PURE__ */ jsx33(Pill, { part: "action", children: "impression" })
2225
+ ] }),
2226
+ /* @__PURE__ */ jsx33("div", { className: "elb-viz-hero__thumb", children: /* @__PURE__ */ jsx33(Thumb, { kind: article.thumb }) }),
2227
+ /* @__PURE__ */ jsxs23("div", { className: "elb-viz-hero__text", children: [
2228
+ /* @__PURE__ */ jsx33(
2229
+ "span",
2230
+ {
2231
+ className: cx(
2232
+ "elb-viz-hero__kicker",
2233
+ card.category && "elb-viz-hero__kicker--on"
2234
+ ),
2235
+ children: article.kicker
2236
+ }
2237
+ ),
2238
+ /* @__PURE__ */ jsx33("span", { className: "elb-viz-hero__title", children: /* @__PURE__ */ jsx33(
2239
+ "span",
2240
+ {
2241
+ className: cx(
2242
+ "elb-viz-hero__mark",
2243
+ card.title && "elb-viz-hero__mark--on"
2244
+ ),
2245
+ children: article.title
2246
+ }
2247
+ ) }),
2248
+ /* @__PURE__ */ jsx33("div", { className: "elb-viz-hero__foot", children: /* @__PURE__ */ jsxs23(
2249
+ "span",
2250
+ {
2251
+ className: cx(
2252
+ "elb-viz-hero__link",
2253
+ card.action && "elb-viz-hero__link--on"
2254
+ ),
2255
+ children: [
2256
+ "Open \u2192",
2257
+ /* @__PURE__ */ jsxs23(
2258
+ "span",
2259
+ {
2260
+ className: "elb-viz-hero__cursor",
2261
+ "aria-hidden": "true",
2262
+ style: vizStyle({
2263
+ "--elb-viz-cursor-x": cursor.x,
2264
+ "--elb-viz-cursor-y": cursor.y,
2265
+ "--elb-viz-cursor-opacity": cursor.opacity,
2266
+ "--elb-viz-ring-scale": cursor.ring,
2267
+ "--elb-viz-ring-opacity": cursor.ringOpacity,
2268
+ "--elb-viz-press": cursor.pressed ? 0.8 : 1
2269
+ }),
2270
+ children: [
2271
+ /* @__PURE__ */ jsx33("span", { className: "elb-viz-hero__ring" }),
2272
+ /* @__PURE__ */ jsx33("span", { className: "elb-viz-hero__pointer" })
2273
+ ]
2274
+ }
2275
+ )
2276
+ ]
2277
+ }
2278
+ ) })
2279
+ ] })
2280
+ ]
2281
+ }
2282
+ ) })
2283
+ ] }),
2284
+ /* @__PURE__ */ jsx33(EventsTable, { rows })
2285
+ ] }) });
2286
+ }
2287
+
2288
+ // src/design/components/viz/ArticleTeaserTracking.tsx
2289
+ import { useEffect as useEffect4, useRef as useRef3, useState as useState5 } from "react";
2290
+
2291
+ // src/design/components/viz/data/article-teaser.ts
2292
+ var TEASER_ENTITY = "article";
2293
+ var TEASER_ACTION = "click:open";
2294
+ var TEASER_PAGE_IDS = ["home", "article"];
2295
+ var TEASER_PAGES = {
2296
+ home: {
2297
+ template: "HomePage.tsx",
2298
+ organism: "HomeFeed",
2299
+ pagetype: "homepage",
2300
+ list: "homefeed",
2301
+ items: "stories",
2302
+ step: 3,
2303
+ listEffect: "homefeed",
2304
+ globalsEffect: "homepage",
2305
+ header: "<HomeFeed /> \xB7 homepage",
2306
+ articles: [
2307
+ { kicker: "Tech", title: "Return of the Bug" },
2308
+ { kicker: "Tech", title: "The quiet return of RSS" },
2309
+ { kicker: "Food", title: "Why sourdough came back" }
2310
+ ]
2311
+ },
2312
+ article: {
2313
+ template: "ArticlePage.tsx",
2314
+ organism: "RelatedStories",
2315
+ pagetype: "article",
2316
+ list: "related",
2317
+ items: "related",
2318
+ step: 4,
2319
+ listEffect: "related",
2320
+ globalsEffect: "articlepage",
2321
+ header: "<RelatedStories /> \xB7 article page",
2322
+ heading: "Related stories",
2323
+ articles: [
2324
+ { kicker: "Tech", title: "The quiet return of RSS" },
2325
+ { kicker: "Science", title: "A year on the ice shelf" },
2326
+ { kicker: "Culture", title: "Small venues, big nights" }
2327
+ ]
2328
+ }
2329
+ };
2330
+ var TEASER_STEPS = [
2331
+ { step: 1, label: "Atom" },
2332
+ { step: 2, label: "Molecule" },
2333
+ { step: 3, label: TEASER_PAGES.home.organism },
2334
+ { step: 4, label: TEASER_PAGES.article.organism },
2335
+ { step: 5, label: "Pages" }
2336
+ ];
2337
+ var TEASER_CAPTIONS = {
2338
+ 1: `Link carries the ${TEASER_ACTION} action wherever it is rendered.`,
2339
+ 2: `ArticleTeaser makes each card an ${TEASER_ENTITY} entity and reads category and title from its elements.`,
2340
+ 3: `${TEASER_PAGES.home.organism} wraps three teasers and adds list:${TEASER_PAGES.home.list} context to their events.`,
2341
+ 4: `${TEASER_PAGES.article.organism} reuses the same ArticleTeaser and adds list:${TEASER_PAGES.article.list} context.`,
2342
+ 5: "Each page template sets pagetype as a global, which is added to every event on that page."
2343
+ };
2344
+ var file = (step, name, level) => ({
2345
+ kind: "file",
2346
+ step,
2347
+ name,
2348
+ level
2349
+ });
2350
+ var code = (step, tokens, effect, part) => ({ kind: "code", step, tokens, effect, part });
2351
+ var PROPERTY = `data-elb-${TEASER_ENTITY}`;
2352
+ function buildItems() {
2353
+ const items = [
2354
+ file(1, "Link.tsx", "atom"),
2355
+ code(1, [
2356
+ tok("export const", "kw"),
2357
+ tok(" Link ", "text"),
2358
+ tok("= ({ href, children }) => (", "punct")
2359
+ ]),
2360
+ code(
2361
+ 1,
2362
+ [
2363
+ tok(" ", "punct"),
2364
+ tok("<a", "tag"),
2365
+ tok(" ", "punct"),
2366
+ tok("href", "attr"),
2367
+ tok("={href} ", "punct"),
2368
+ tok("data-elbaction", "attr", "action"),
2369
+ tok("=", "punct"),
2370
+ tok(`"${TEASER_ACTION}"`, "str", "action"),
2371
+ tok(">", "tag")
2372
+ ],
2373
+ "action",
2374
+ "action"
2375
+ ),
2376
+ code(1, [tok(" ", "punct"), tok("{children}", "punct")]),
2377
+ code(1, [tok(" ", "punct"), tok("</a>", "tag")]),
2378
+ code(1, [tok(");", "punct")]),
2379
+ file(2, "ArticleTeaser.tsx", "molecule"),
2380
+ code(2, [
2381
+ tok("export const", "kw"),
2382
+ tok(" ArticleTeaser ", "text"),
2383
+ tok("= ({", "punct")
2384
+ ]),
2385
+ code(2, [tok(" title, category, image, url, position,", "punct")]),
2386
+ code(2, [tok("}) => (", "punct")]),
2387
+ code(
2388
+ 2,
2389
+ [
2390
+ tok(" ", "punct"),
2391
+ tok("<article", "tag"),
2392
+ tok(" ", "punct"),
2393
+ tok("data-elb", "attr", "entity"),
2394
+ tok("=", "punct"),
2395
+ tok(`"${TEASER_ENTITY}"`, "str", "entity")
2396
+ ],
2397
+ "entity",
2398
+ "entity"
2399
+ ),
2400
+ code(
2401
+ 2,
2402
+ [
2403
+ tok(" ", "punct"),
2404
+ tok(PROPERTY, "attr", "property"),
2405
+ tok("={`", "punct"),
2406
+ tok("position:${position}", "str", "property"),
2407
+ tok("`}", "punct"),
2408
+ tok(">", "tag")
2409
+ ],
2410
+ "position",
2411
+ "property"
2412
+ ),
2413
+ code(
2414
+ 2,
2415
+ [
2416
+ tok(" ", "punct"),
2417
+ tok("<img", "tag"),
2418
+ tok(" ", "punct"),
2419
+ tok("src", "attr"),
2420
+ tok("={image} ", "punct"),
2421
+ tok("/>", "tag")
2422
+ ],
2423
+ "image"
2424
+ ),
2425
+ code(
2426
+ 2,
2427
+ [
2428
+ tok(" ", "punct"),
2429
+ tok("<span", "tag"),
2430
+ tok(" ", "punct"),
2431
+ tok(PROPERTY, "attr", "property"),
2432
+ tok("=", "punct"),
2433
+ tok('"category:#innerText"', "str", "property"),
2434
+ tok(">", "tag"),
2435
+ tok("{category}", "punct"),
2436
+ tok("</span>", "tag")
2437
+ ],
2438
+ "category",
2439
+ "property"
2440
+ ),
2441
+ code(
2442
+ 2,
2443
+ [
2444
+ tok(" ", "punct"),
2445
+ tok("<h3", "tag"),
2446
+ tok(" ", "punct"),
2447
+ tok(PROPERTY, "attr", "property"),
2448
+ tok("=", "punct"),
2449
+ tok('"title:#innerText"', "str", "property"),
2450
+ tok(">", "tag"),
2451
+ tok("{title}", "punct"),
2452
+ tok("</h3>", "tag")
2453
+ ],
2454
+ "title",
2455
+ "property"
2456
+ ),
2457
+ code(2, [
2458
+ tok(" ", "punct"),
2459
+ tok("<Link", "tag"),
2460
+ tok(" ", "punct"),
2461
+ tok("href", "attr"),
2462
+ tok("={url}", "punct"),
2463
+ tok(">", "tag"),
2464
+ tok("Open \u2192", "text"),
2465
+ tok("</Link>", "tag")
2466
+ ]),
2467
+ code(2, [tok(" ", "punct"), tok("</article>", "tag")]),
2468
+ code(2, [tok(");", "punct")])
2469
+ ];
2470
+ for (const id of TEASER_PAGE_IDS) {
2471
+ const page = TEASER_PAGES[id];
2472
+ items.push(
2473
+ file(page.step, `${page.organism}.tsx`, "organism"),
2474
+ code(
2475
+ page.step,
2476
+ [
2477
+ tok("<section", "tag"),
2478
+ tok(" ", "punct"),
2479
+ tok("data-elbcontext", "attr", "context"),
2480
+ tok("=", "punct"),
2481
+ tok(`"list:${page.list}"`, "str", "context"),
2482
+ tok(">", "tag")
2483
+ ],
2484
+ page.listEffect,
2485
+ "context"
2486
+ ),
2487
+ code(page.step, [
2488
+ tok(` {${page.items}.map((s, i) => `, "punct"),
2489
+ tok("<ArticleTeaser", "tag"),
2490
+ tok(" {...s} ", "punct"),
2491
+ tok("position", "attr"),
2492
+ tok("={i + 1} ", "punct"),
2493
+ tok("/>", "tag"),
2494
+ tok(")}", "punct")
2495
+ ]),
2496
+ code(page.step, [tok("</section>", "tag")])
2497
+ );
2498
+ }
2499
+ for (const id of TEASER_PAGE_IDS) {
2500
+ const page = TEASER_PAGES[id];
2501
+ items.push(
2502
+ file(5, page.template, "template"),
2503
+ code(
2504
+ 5,
2505
+ [
2506
+ tok("<main", "tag"),
2507
+ tok(" ", "punct"),
2508
+ tok("data-elbglobals", "attr", "globals"),
2509
+ tok("=", "punct"),
2510
+ tok(`"pagetype:${page.pagetype}"`, "str", "globals"),
2511
+ tok(">", "tag")
2512
+ ],
2513
+ page.globalsEffect,
2514
+ "globals"
2515
+ ),
2516
+ code(5, [tok(" ", "punct"), tok(`<${page.organism} />`, "tag")]),
2517
+ code(5, [tok("</main>", "tag")])
2518
+ );
2519
+ }
2520
+ return items;
2521
+ }
2522
+ var TEASER_ITEMS = buildItems();
2523
+ function hasEffect(item) {
2524
+ return item.kind === "code" && item.effect !== void 0;
2525
+ }
2526
+ function teaserStepStart(step) {
2527
+ return TEASER_ITEMS.findIndex((item) => item.step === step);
2528
+ }
2529
+ function teaserStepEnd(step) {
2530
+ let end = teaserStepStart(step);
2531
+ while (end < TEASER_ITEMS.length && TEASER_ITEMS[end].step === step) end += 1;
2532
+ return end;
2533
+ }
2534
+ function teaserAdvance(n) {
2535
+ if (n >= TEASER_ITEMS.length) return null;
2536
+ const item = TEASER_ITEMS[n];
2537
+ if (item.kind === "file" && (n === 0 || TEASER_ITEMS[n - 1].step !== item.step))
2538
+ return { next: n + 1, delay: 1300 };
2539
+ let next = n;
2540
+ while (next < TEASER_ITEMS.length && TEASER_ITEMS[next].step === item.step && !hasEffect(TEASER_ITEMS[next]))
2541
+ next += 1;
2542
+ if (next < TEASER_ITEMS.length && TEASER_ITEMS[next].step === item.step)
2543
+ next += 1;
2544
+ if (next >= TEASER_ITEMS.length) return { next, delay: null };
2545
+ return {
2546
+ next,
2547
+ delay: 1700 + (TEASER_ITEMS[next].step !== item.step ? 1600 : 0)
2548
+ };
2549
+ }
2550
+
2551
+ // src/design/components/viz/ArticleTeaserTracking.tsx
2552
+ import { jsx as jsx34, jsxs as jsxs24 } from "react/jsx-runtime";
2553
+ var FIRST_DELAY = 800;
2554
+ var JUMP_DELAY = 250;
2555
+ var SCROLL_DELAY = 400;
2556
+ function fade(on) {
2557
+ return cx("elb-viz-teaser__fade", on && "elb-viz-teaser__fade--on");
2558
+ }
2559
+ function TeaserCard({
2560
+ article,
2561
+ position,
2562
+ seen,
2563
+ ahead
2564
+ }) {
2565
+ return /* @__PURE__ */ jsxs24(
2566
+ "div",
2567
+ {
2568
+ className: cx(
2569
+ "elb-viz-teaser__card",
2570
+ seen.has("entity") && "elb-viz-teaser__card--entity",
2571
+ ahead && "elb-viz-teaser__card--ahead"
2572
+ ),
2573
+ children: [
2574
+ /* @__PURE__ */ jsxs24("span", { className: "elb-viz-teaser__pills", children: [
2575
+ /* @__PURE__ */ jsx34(Pill, { part: "entity", className: fade(seen.has("entity")), children: TEASER_ENTITY }),
2576
+ /* @__PURE__ */ jsx34(
2577
+ Pill,
2578
+ {
2579
+ part: "property",
2580
+ variant: "outline",
2581
+ className: fade(seen.has("position")),
2582
+ children: position
2583
+ }
2584
+ )
2585
+ ] }),
2586
+ /* @__PURE__ */ jsx34(
2587
+ PhotoPlaceholder,
2588
+ {
2589
+ tone: "viz",
2590
+ className: cx("elb-viz-teaser__photo", fade(seen.has("image")))
2591
+ }
2592
+ ),
2593
+ /* @__PURE__ */ jsx34(
2594
+ "span",
2595
+ {
2596
+ className: cx(
2597
+ "elb-viz-teaser__kicker",
2598
+ fade(seen.has("category")),
2599
+ seen.has("category") && "elb-viz-teaser__kicker--on"
2600
+ ),
2601
+ children: article.kicker
2602
+ }
2603
+ ),
2604
+ /* @__PURE__ */ jsx34(
2605
+ "span",
2606
+ {
2607
+ className: cx(
2608
+ "elb-viz-teaser__title",
2609
+ fade(seen.has("title")),
2610
+ seen.has("title") && "elb-viz-teaser__title--on"
2611
+ ),
2612
+ children: article.title
2613
+ }
2614
+ ),
2615
+ /* @__PURE__ */ jsx34(
2616
+ "span",
2617
+ {
2618
+ className: cx(
2619
+ "elb-viz-teaser__link",
2620
+ fade(seen.has("action")),
2621
+ seen.has("action") && "elb-viz-teaser__link--on"
2622
+ ),
2623
+ children: "Open \u2192"
2624
+ }
2625
+ )
2626
+ ]
2627
+ }
2628
+ );
2629
+ }
2630
+ function TeaserGroup({
2631
+ page,
2632
+ seen,
2633
+ current,
2634
+ lead
2635
+ }) {
2636
+ const globalsOn = seen.has(page.globalsEffect);
2637
+ const listOn = seen.has(page.listEffect);
2638
+ const reached = page.step <= current;
2639
+ return /* @__PURE__ */ jsxs24(
2640
+ "div",
2641
+ {
2642
+ className: cx(
2643
+ "elb-viz-teaser__page",
2644
+ globalsOn && "elb-viz-teaser__page--on",
2645
+ !reached && !lead && "elb-viz-teaser__page--ahead"
2646
+ ),
2647
+ children: [
2648
+ /* @__PURE__ */ jsx34("span", { className: "elb-viz-teaser__page-pill", children: /* @__PURE__ */ jsx34(
2649
+ Pill,
2650
+ {
2651
+ part: "globals",
2652
+ className: fade(globalsOn),
2653
+ children: `pagetype:${page.pagetype}`
2654
+ }
2655
+ ) }),
2656
+ /* @__PURE__ */ jsxs24(
2657
+ "div",
2658
+ {
2659
+ className: cx(
2660
+ "elb-viz-teaser__list",
2661
+ listOn && "elb-viz-teaser__list--on"
2662
+ ),
2663
+ children: [
2664
+ /* @__PURE__ */ jsxs24("div", { className: cx("elb-viz-teaser__list-head", fade(listOn)), children: [
2665
+ /* @__PURE__ */ jsxs24("span", { className: "elb-viz-teaser__list-label", children: [
2666
+ /* @__PURE__ */ jsx34("span", { className: "elb-viz-teaser__list-name", children: page.header }),
2667
+ page.heading !== void 0 && /* @__PURE__ */ jsx34("span", { className: "elb-viz-teaser__list-heading", children: page.heading })
2668
+ ] }),
2669
+ /* @__PURE__ */ jsx34(Pill, { part: "context", children: `list:${page.list}` })
2670
+ ] }),
2671
+ /* @__PURE__ */ jsx34("div", { className: "elb-viz-teaser__cards", children: page.articles.map((article, index) => /* @__PURE__ */ jsx34(
2672
+ TeaserCard,
2673
+ {
2674
+ article,
2675
+ position: index + 1,
2676
+ seen,
2677
+ ahead: !reached && !(lead && index === 0)
2678
+ },
2679
+ article.title
2680
+ )) })
2681
+ ]
2682
+ }
2683
+ )
2684
+ ]
2685
+ }
2686
+ );
2687
+ }
2688
+ function ArticleTeaserTracking({
2689
+ autoplay = true,
2690
+ speed = 1,
2691
+ initialStep,
2692
+ ...rest
2693
+ }) {
2694
+ const codeRef = useRef3(null);
2695
+ const inView = useInView(codeRef, 0.35);
2696
+ const reduced = useReducedMotion();
2697
+ const [shown, setShown] = useState5(
2698
+ () => initialStep ? teaserStepEnd(initialStep) : 0
2699
+ );
2700
+ const [delay, setDelay] = useState5(FIRST_DELAY);
2701
+ const [pinned, setPinned] = useState5(null);
2702
+ const playing = autoplay && inView && !reduced;
2703
+ const end = pinned === null ? TEASER_ITEMS.length : teaserStepEnd(pinned);
2704
+ useEffect4(() => {
2705
+ if (reduced) setShown(TEASER_ITEMS.length);
2706
+ }, [reduced]);
2707
+ useEffect4(() => {
2708
+ if (!playing || delay === null) return void 0;
2709
+ const timer = setTimeout(() => {
2710
+ const advance = teaserAdvance(shown);
2711
+ if (!advance) {
2712
+ setDelay(null);
2713
+ return;
2714
+ }
2715
+ setShown(advance.next);
2716
+ setDelay(advance.next < end ? advance.delay : null);
2717
+ }, delay / speed);
2718
+ return () => clearTimeout(timer);
2719
+ }, [playing, delay, shown, speed, end]);
2720
+ useEffect4(() => {
2721
+ const pane = codeRef.current;
2722
+ if (!pane || shown === 0 || typeof pane.scrollTo !== "function")
2723
+ return void 0;
2724
+ const timer = setTimeout(() => {
2725
+ const line = pane.querySelector(`[data-line="${shown - 1}"]`);
2726
+ const top = line instanceof HTMLElement ? line.offsetTop - pane.clientHeight / 2 : 0;
2727
+ pane.scrollTo({
2728
+ top: Math.max(0, top),
2729
+ behavior: reduced ? "auto" : "smooth"
2730
+ });
2731
+ }, SCROLL_DELAY);
2732
+ return () => clearTimeout(timer);
2733
+ }, [shown, reduced]);
2734
+ const jump = (step) => {
2735
+ setPinned(step);
2736
+ if (autoplay && !reduced) {
2737
+ setShown(teaserStepStart(step));
2738
+ setDelay(JUMP_DELAY);
2739
+ } else {
2740
+ setShown(teaserStepEnd(step));
2741
+ }
2742
+ };
2743
+ const count = Math.min(shown, TEASER_ITEMS.length);
2744
+ const visibleStep = count > 0 ? TEASER_ITEMS[count - 1].step : 0;
2745
+ const current = visibleStep === 0 ? 1 : visibleStep;
2746
+ const seen = /* @__PURE__ */ new Set();
2747
+ for (const item of TEASER_ITEMS.slice(0, count))
2748
+ if (item.kind === "code" && item.effect) seen.add(item.effect);
2749
+ let lineNumber = 0;
2750
+ let separated = false;
2751
+ const lines = TEASER_ITEMS.map((item, index) => {
2752
+ const visible = item.step <= visibleStep;
2753
+ const lineClass = cx(
2754
+ "elb-viz-teaser__line",
2755
+ visible && "elb-viz-teaser__line--visible",
2756
+ visible && item.step < current && "elb-viz-teaser__line--dim",
2757
+ item.kind === "file" && "elb-viz-teaser__line--file"
2758
+ );
2759
+ if (item.kind === "file") {
2760
+ lineNumber = 0;
2761
+ const fileClass = cx(
2762
+ "elb-viz-teaser__file",
2763
+ separated && "elb-viz-teaser__file--separated"
2764
+ );
2765
+ separated = true;
2766
+ return /* @__PURE__ */ jsx34("div", { "data-line": index, className: lineClass, children: /* @__PURE__ */ jsxs24("div", { className: fileClass, children: [
2767
+ /* @__PURE__ */ jsx34("span", { className: "elb-viz-teaser__file-name", children: item.name }),
2768
+ /* @__PURE__ */ jsx34("span", { className: "elb-viz-teaser__file-level", children: item.level })
2769
+ ] }) }, index);
2770
+ }
2771
+ lineNumber += 1;
2772
+ const reached = index < count;
2773
+ const isCurrent = index === count - 1 && item.effect !== void 0;
2774
+ return /* @__PURE__ */ jsx34("div", { "data-line": index, className: lineClass, children: /* @__PURE__ */ jsx34(
2775
+ CodeLine,
2776
+ {
2777
+ number: lineNumber,
2778
+ bar: reached ? item.part : void 0,
2779
+ className: cx(
2780
+ "elb-viz-teaser__code",
2781
+ isCurrent && `elb-viz-teaser__code--current-${item.part ?? "plain"}`
2782
+ ),
2783
+ children: /* @__PURE__ */ jsx34(CodeTokens, { tokens: item.tokens, active: reached })
2784
+ }
2785
+ ) }, index);
2786
+ });
2787
+ return /* @__PURE__ */ jsx34(VizFrame, { ...rest, variant: "teaser", children: /* @__PURE__ */ jsxs24("div", { className: "elb-viz-teaser", children: [
2788
+ /* @__PURE__ */ jsxs24("div", { className: "elb-viz-teaser__header", children: [
2789
+ /* @__PURE__ */ jsx34("div", { className: "elb-viz-teaser__steps", children: TEASER_STEPS.map(({ step, label }) => /* @__PURE__ */ jsxs24(
2790
+ "button",
2791
+ {
2792
+ type: "button",
2793
+ "aria-label": `Step ${step}: ${label}`,
2794
+ "aria-pressed": step === current,
2795
+ className: cx(
2796
+ "elb-viz-teaser__step",
2797
+ step === current && "elb-viz-teaser__step--active",
2798
+ step < current && "elb-viz-teaser__step--done"
2799
+ ),
2800
+ onClick: () => jump(step),
2801
+ children: [
2802
+ /* @__PURE__ */ jsx34("span", { className: "elb-viz-teaser__step-number", children: step }),
2803
+ /* @__PURE__ */ jsx34("span", { children: label })
2804
+ ]
2805
+ },
2806
+ step
2807
+ )) }),
2808
+ /* @__PURE__ */ jsx34("div", { className: "elb-viz-teaser__legend", children: /* @__PURE__ */ jsx34(EventLegend, {}) })
2809
+ ] }),
2810
+ /* @__PURE__ */ jsx34("p", { className: "elb-viz-teaser__caption", children: TEASER_CAPTIONS[current] }),
2811
+ /* @__PURE__ */ jsxs24("div", { className: "elb-viz-teaser__body", children: [
2812
+ /* @__PURE__ */ jsx34("div", { className: "elb-viz-teaser__pane", children: /* @__PURE__ */ jsx34("div", { ref: codeRef, className: "elb-viz-teaser__scroll", children: lines }) }),
2813
+ /* @__PURE__ */ jsx34("div", { className: "elb-viz-teaser__pages", children: TEASER_PAGE_IDS.map((id, index) => /* @__PURE__ */ jsx34(
2814
+ TeaserGroup,
2815
+ {
2816
+ page: TEASER_PAGES[id],
2817
+ seen,
2818
+ current,
2819
+ lead: index === 0
2820
+ },
2821
+ id
2822
+ )) })
2823
+ ] })
2824
+ ] }) });
2825
+ }
2826
+ export {
2827
+ ArticleTeaserTracking,
2828
+ BrowserFrame,
2829
+ Button,
2830
+ Card,
2831
+ CardGrid,
2832
+ CaseCard,
2833
+ CheckList,
2834
+ Cluster,
2835
+ DestinationMappingViz,
2836
+ EventLegend,
2837
+ Eyebrow,
2838
+ FaqItem,
2839
+ FeatureItem,
2840
+ Hero,
2841
+ HeroTaggingViz,
2842
+ HighlightCard,
2843
+ Icon,
2844
+ InlineCode,
2845
+ InstallCommand,
2846
+ PhotoPlaceholder,
2847
+ PlanCard,
2848
+ ProblemCard,
2849
+ QuickstartSteps,
2850
+ Section,
2851
+ SectionHeading,
2852
+ Split,
2853
+ Stat,
2854
+ Text,
2855
+ TextLink
2856
+ };
2857
+ //# sourceMappingURL=index.mjs.map