@almadar/ui 2.53.0 → 2.55.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22120,7 +22120,8 @@ var CodeBlock = React125__namespace.default.memo(
22120
22120
  foldable: foldableProp,
22121
22121
  className,
22122
22122
  editable = false,
22123
- onChange
22123
+ onChange,
22124
+ errorLines
22124
22125
  }) => {
22125
22126
  const code = typeof rawCode === "string" ? rawCode : String(rawCode ?? "");
22126
22127
  const isOrb = language === "orb";
@@ -22152,6 +22153,28 @@ var CodeBlock = React125__namespace.default.memo(
22152
22153
  ov.scrollLeft = ta.scrollLeft;
22153
22154
  }
22154
22155
  }, []);
22156
+ const errorLineProps = React125.useMemo(() => {
22157
+ if (!errorLines || errorLines.size === 0) {
22158
+ return LINE_PROPS_FN;
22159
+ }
22160
+ return (lineNumber) => {
22161
+ const severity = errorLines.get(lineNumber);
22162
+ if (!severity) {
22163
+ return { "data-line": String(lineNumber - 1) };
22164
+ }
22165
+ return {
22166
+ "data-line": String(lineNumber - 1),
22167
+ style: {
22168
+ display: "block",
22169
+ backgroundColor: severity === "error" ? "rgba(248, 113, 113, 0.18)" : "rgba(251, 191, 36, 0.18)",
22170
+ // amber-400 @ 18%
22171
+ borderLeft: `3px solid ${severity === "error" ? "#ef4444" : "#f59e0b"}`,
22172
+ paddingLeft: "0.5rem",
22173
+ marginLeft: "-0.5rem"
22174
+ }
22175
+ };
22176
+ };
22177
+ }, [errorLines]);
22155
22178
  const isFoldable = foldableProp ?? (language === "orb" || language === "json");
22156
22179
  const [collapsed, setCollapsed] = React125.useState(() => /* @__PURE__ */ new Set());
22157
22180
  const foldRegions = React125.useMemo(
@@ -22312,24 +22335,40 @@ var CodeBlock = React125__namespace.default.memo(
22312
22335
  }
22313
22336
  ),
22314
22337
  editable ? (
22315
- /* GAP-77: editable mode = transparent Textarea on top + Prism-highlighted
22316
- overlay underneath. The textarea is uncontrolled (defaultValue + key)
22317
- to avoid cursor jumps; the overlay reads `editableValue` which is
22318
- mirrored from the textarea via onChange. Both elements share IDENTICAL
22319
- font / line-height / padding so the highlighted text aligns with the
22320
- textarea's invisible glyphs.
22338
+ /* GAP-77 / GAP-82 / GAP-83: editable mode = transparent textarea on
22339
+ top of a Prism-highlighted SyntaxHighlighter overlay.
22321
22340
 
22322
- Scroll sync: the overlay has `pointer-events: none` and the textarea
22323
- scrolls; `handleEditableScroll` keeps the overlay's scroll matched. */
22341
+ Layout: BOTH children are `position: absolute, inset: 0` so neither
22342
+ contributes to flow. The parent Box has `height: 100%` so it fills
22343
+ whatever container the consumer provides (the consumer is
22344
+ responsible for giving the parent a real height — usually via flex
22345
+ column with `minHeight: 0`).
22346
+
22347
+ Stacking: the overlay is FIRST in DOM order so it paints first
22348
+ (behind), the textarea is SECOND so it paints second (on top). No
22349
+ explicit z-index — DOM order alone determines stacking inside the
22350
+ parent's stacking context. The textarea has `color: transparent`
22351
+ plus `WebkitTextFillColor: transparent` (Safari) so its glyphs
22352
+ never paint, but the caret stays visible via `caretColor`.
22353
+
22354
+ Scroll sync: textarea scrolls naturally; `handleEditableScroll`
22355
+ mirrors its scrollTop/scrollLeft onto the overlay div so the
22356
+ highlighted spans stay aligned with the textarea content.
22357
+
22358
+ Error highlights (GAP-80): `errorLines` prop accepts a Map of
22359
+ 1-based line numbers → severity. The overlay's SyntaxHighlighter
22360
+ uses `wrapLines` + `lineProps` to paint a colored background on
22361
+ those lines. */
22324
22362
  /* @__PURE__ */ jsxRuntime.jsxs(
22325
22363
  Box,
22326
22364
  {
22327
22365
  style: {
22328
22366
  position: "relative",
22329
- backgroundColor: "#1e1e1e",
22330
- borderRadius: hasHeader ? "0 0 0.5rem 0.5rem" : "0.5rem",
22367
+ height: "100%",
22331
22368
  minHeight: "160px",
22332
22369
  maxHeight,
22370
+ backgroundColor: "#1e1e1e",
22371
+ borderRadius: hasHeader ? "0 0 0.5rem 0.5rem" : "0.5rem",
22333
22372
  overflow: "hidden"
22334
22373
  },
22335
22374
  children: [
@@ -22340,10 +22379,12 @@ var CodeBlock = React125__namespace.default.memo(
22340
22379
  "aria-hidden": true,
22341
22380
  style: {
22342
22381
  position: "absolute",
22343
- inset: 0,
22382
+ top: 0,
22383
+ left: 0,
22384
+ width: "100%",
22385
+ height: "100%",
22344
22386
  overflow: "hidden",
22345
- pointerEvents: "none",
22346
- maxHeight
22387
+ pointerEvents: "none"
22347
22388
  },
22348
22389
  children: /* @__PURE__ */ jsxRuntime.jsx(
22349
22390
  SyntaxHighlighter__default.default,
@@ -22351,6 +22392,8 @@ var CodeBlock = React125__namespace.default.memo(
22351
22392
  PreTag: "div",
22352
22393
  language,
22353
22394
  style: activeStyle,
22395
+ wrapLines: errorLines && errorLines.size > 0,
22396
+ lineProps: errorLineProps,
22354
22397
  customStyle: {
22355
22398
  backgroundColor: "transparent",
22356
22399
  borderRadius: 0,
@@ -22358,7 +22401,6 @@ var CodeBlock = React125__namespace.default.memo(
22358
22401
  margin: 0,
22359
22402
  whiteSpace: "pre",
22360
22403
  minWidth: "100%",
22361
- minHeight: "160px",
22362
22404
  fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Monaco, "Cascadia Mono", "Courier New", monospace',
22363
22405
  fontSize: "13px",
22364
22406
  lineHeight: "1.5"
@@ -22387,23 +22429,23 @@ var CodeBlock = React125__namespace.default.memo(
22387
22429
  onScroll: handleEditableScroll,
22388
22430
  spellCheck: false,
22389
22431
  style: {
22390
- position: "relative",
22391
- zIndex: 1,
22392
- fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Monaco, "Cascadia Mono", "Courier New", monospace',
22393
- fontSize: "13px",
22394
- lineHeight: "1.5",
22395
- backgroundColor: "transparent",
22396
- color: "transparent",
22397
- caretColor: "#e6e6e6",
22398
- borderRadius: hasHeader ? "0 0 0.5rem 0.5rem" : "0.5rem",
22399
- border: "none",
22400
- padding: "1rem",
22401
- resize: "none",
22402
- minHeight: "160px",
22403
- maxHeight,
22432
+ position: "absolute",
22433
+ top: 0,
22434
+ left: 0,
22404
22435
  width: "100%",
22405
22436
  height: "100%",
22437
+ padding: "1rem",
22438
+ margin: 0,
22439
+ border: "none",
22406
22440
  outline: "none",
22441
+ resize: "none",
22442
+ backgroundColor: "transparent",
22443
+ color: "transparent",
22444
+ caretColor: "#e6e6e6",
22445
+ WebkitTextFillColor: "transparent",
22446
+ fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Monaco, "Cascadia Mono", "Courier New", monospace',
22447
+ fontSize: "13px",
22448
+ lineHeight: "1.5",
22407
22449
  whiteSpace: "pre",
22408
22450
  overflowWrap: "normal",
22409
22451
  overflow: "auto"
@@ -22434,7 +22476,7 @@ var CodeBlock = React125__namespace.default.memo(
22434
22476
  )
22435
22477
  ] });
22436
22478
  },
22437
- (prev, next) => prev.language === next.language && prev.code === next.code && prev.showCopyButton === next.showCopyButton && prev.maxHeight === next.maxHeight && prev.foldable === next.foldable && prev.editable === next.editable && prev.onChange === next.onChange
22479
+ (prev, next) => prev.language === next.language && prev.code === next.code && prev.showCopyButton === next.showCopyButton && prev.maxHeight === next.maxHeight && prev.foldable === next.foldable && prev.editable === next.editable && prev.onChange === next.onChange && prev.errorLines === next.errorLines
22438
22480
  );
22439
22481
  CodeBlock.displayName = "CodeBlock";
22440
22482
 
@@ -49233,545 +49275,103 @@ AvlCosmicZoom.displayName = "AvlCosmicZoom";
49233
49275
 
49234
49276
  // components/organisms/avl/AvlOrbitalsCosmicZoom.tsx
49235
49277
  init_avl_schema_parser();
49236
- init_Box();
49237
- init_Typography();
49238
- var UNIT_DISPLAY_W = 240;
49239
- var UNIT_DISPLAY_H = 160;
49240
- function layoutOrbitals(count, containerW, containerH) {
49241
- if (count === 0) return [];
49242
- if (count === 1) return [{ cx: containerW / 2, cy: containerH / 2 }];
49243
- const cols = Math.min(count, Math.ceil(Math.sqrt(count)));
49244
- const rows = Math.ceil(count / cols);
49245
- const cellW = containerW / (cols + 0.3);
49246
- const cellH = containerH / (rows + 0.3);
49247
- const originX = (containerW - cols * cellW) / 2 + cellW / 2;
49248
- const originY = (containerH - rows * cellH) / 2 + cellH / 2;
49249
- return Array.from({ length: count }, (_, i) => ({
49250
- cx: originX + i % cols * cellW,
49251
- cy: originY + Math.floor(i / cols) * cellH
49252
- }));
49253
- }
49254
- var avlOczWireId = 0;
49255
- var EventWireOverlay = ({
49256
- orbitalViews,
49257
- crossLinks,
49258
- color,
49259
- animated,
49260
- containerW,
49261
- containerH
49278
+ init_avl_zoom_state();
49279
+ init_types();
49280
+ var SWIM_GUTTER2 = 120;
49281
+ var CENTER_W2 = 360;
49282
+ var AvlTraitScene = ({
49283
+ data,
49284
+ color = "var(--color-primary)",
49285
+ onTransitionClick
49262
49286
  }) => {
49263
- const ids = React125__namespace.default.useMemo(() => {
49264
- avlOczWireId += 1;
49265
- return { arrow: `avl-ocz-wire-${avlOczWireId}-arrow` };
49266
- }, []);
49267
- const posMap = React125.useMemo(() => {
49268
- const m = /* @__PURE__ */ new Map();
49269
- for (const ov of orbitalViews) m.set(ov.name, { cx: ov.cx, cy: ov.cy });
49270
- return m;
49271
- }, [orbitalViews]);
49272
- const wiresByPair = React125.useMemo(() => {
49273
- const map = /* @__PURE__ */ new Map();
49274
- for (const link of crossLinks) {
49275
- const key = `${link.emitterOrbital}__${link.listenerOrbital}`;
49276
- const arr = map.get(key) ?? [];
49277
- arr.push(link);
49278
- map.set(key, arr);
49279
- }
49280
- return map;
49281
- }, [crossLinks]);
49282
- const orbitalR = UNIT_DISPLAY_W * 0.38;
49283
- return /* @__PURE__ */ jsxRuntime.jsxs(
49284
- "svg",
49285
- {
49286
- style: {
49287
- position: "absolute",
49288
- inset: 0,
49289
- width: "100%",
49290
- height: "100%",
49291
- pointerEvents: "none",
49292
- overflow: "visible"
49293
- },
49294
- viewBox: `0 0 ${containerW} ${containerH}`,
49295
- preserveAspectRatio: "xMidYMid meet",
49296
- children: [
49297
- /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx(
49298
- "marker",
49299
- {
49300
- id: ids.arrow,
49301
- markerWidth: "8",
49302
- markerHeight: "6",
49303
- refX: "7",
49304
- refY: "3",
49305
- orient: "auto",
49306
- markerUnits: "strokeWidth",
49307
- children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M0,0 L8,3 L0,6 Z", fill: color, opacity: 0.6 })
49308
- }
49309
- ) }),
49310
- animated && /* @__PURE__ */ jsxRuntime.jsx("style", { children: `
49311
- @keyframes avl-ocz-flow {
49312
- from { stroke-dashoffset: 20; }
49313
- to { stroke-dashoffset: 0; }
49314
- }
49315
- ` }),
49316
- Array.from(wiresByPair.entries()).map(
49317
- ([pairKey, links]) => links.map((link, wireIdx) => {
49318
- const fromPos = posMap.get(link.emitterOrbital);
49319
- const toPos = posMap.get(link.listenerOrbital);
49320
- if (!fromPos || !toPos) return null;
49321
- const dx = toPos.cx - fromPos.cx;
49322
- const dy = toPos.cy - fromPos.cy;
49323
- const dist = Math.sqrt(dx * dx + dy * dy) || 1;
49324
- const nx = dx / dist;
49325
- const ny = dy / dist;
49326
- const x1 = fromPos.cx + nx * orbitalR;
49327
- const y1 = fromPos.cy + ny * orbitalR;
49328
- const x2 = toPos.cx - nx * (orbitalR + 6);
49329
- const y2 = toPos.cy - ny * (orbitalR + 6);
49330
- const offset = 25 + wireIdx * 18;
49331
- const { cpx, cpy } = curveControlPoint(x1, y1, x2, y2, offset);
49332
- const pathD = `M${x1},${y1} Q${cpx},${cpy} ${x2},${y2}`;
49333
- const t = 0.5;
49334
- const lx = (1 - t) * (1 - t) * x1 + 2 * (1 - t) * t * cpx + t * t * x2;
49335
- const ly = (1 - t) * (1 - t) * y1 + 2 * (1 - t) * t * cpy + t * t * y2;
49336
- const labelW = link.eventName.length * 5.5 + 12;
49337
- return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
49338
- /* @__PURE__ */ jsxRuntime.jsx(
49339
- "path",
49340
- {
49341
- d: pathD,
49342
- fill: "none",
49343
- stroke: color,
49344
- strokeWidth: 1.2,
49345
- strokeDasharray: animated ? "6 4" : "4 3",
49346
- markerEnd: `url(#${ids.arrow})`,
49347
- opacity: 0.5,
49348
- style: animated ? { animation: "avl-ocz-flow 1.5s linear infinite" } : void 0
49349
- }
49350
- ),
49351
- /* @__PURE__ */ jsxRuntime.jsx(
49352
- "rect",
49353
- {
49354
- x: lx - labelW / 2,
49355
- y: ly - 8,
49356
- width: labelW,
49357
- height: 14,
49358
- rx: 3,
49359
- fill: "var(--color-background, #fff)",
49360
- stroke: color,
49361
- strokeWidth: 0.5,
49362
- opacity: 0.9
49363
- }
49364
- ),
49365
- /* @__PURE__ */ jsxRuntime.jsx(
49366
- "text",
49367
- {
49368
- x: lx,
49369
- y: ly + 3,
49370
- textAnchor: "middle",
49371
- fill: color,
49372
- fontSize: 7,
49373
- fontWeight: 600,
49374
- fontFamily: "monospace",
49375
- opacity: 0.8,
49376
- children: link.eventName
49377
- }
49378
- )
49379
- ] }, `${pairKey}-${wireIdx}`);
49380
- })
49381
- )
49382
- ]
49383
- }
49384
- );
49385
- };
49386
- var InfoPanel = ({ view, crossLinks, color }) => {
49387
- const emitsOut = crossLinks.filter((l) => l.emitterOrbital === view.name);
49388
- const listensIn = crossLinks.filter((l) => l.listenerOrbital === view.name);
49389
- return /* @__PURE__ */ jsxRuntime.jsxs(
49390
- Box,
49391
- {
49392
- position: "absolute",
49393
- rounded: "lg",
49394
- paddingX: "md",
49395
- paddingY: "sm",
49396
- bg: "overlay",
49397
- style: {
49398
- left: view.cx - 120,
49399
- top: view.cy + UNIT_DISPLAY_H / 2 + 4,
49400
- width: 240,
49401
- border: `1px solid ${color}`,
49402
- zIndex: 20,
49403
- pointerEvents: "none"
49404
- },
49405
- children: [
49406
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { weight: "semibold", style: { marginBottom: 4, color }, children: view.name }),
49407
- /* @__PURE__ */ jsxRuntime.jsxs(Text, { variant: "small", style: { opacity: 0.7, color }, children: [
49408
- "Entity: ",
49409
- view.entityName,
49410
- " (",
49411
- view.fieldCount,
49412
- " fields, ",
49413
- view.persistence,
49414
- ")"
49415
- ] }),
49416
- /* @__PURE__ */ jsxRuntime.jsxs(Text, { variant: "small", style: { opacity: 0.7, color }, children: [
49417
- "Traits: ",
49418
- view.traits.map((t) => t.name).join(", ") || "none"
49419
- ] }),
49420
- view.pages.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(Text, { variant: "small", style: { opacity: 0.7, color }, children: [
49421
- "Pages: ",
49422
- view.pages.map((p2) => p2.name).join(", ")
49423
- ] }),
49424
- emitsOut.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(Text, { variant: "small", style: { opacity: 0.7, color }, children: [
49425
- "Emits \u2192 ",
49426
- emitsOut.map((l) => `${l.eventName} \u2192 ${l.listenerOrbital}`).join(", ")
49427
- ] }),
49428
- listensIn.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(Text, { variant: "small", style: { opacity: 0.7, color }, children: [
49429
- "Listens \u2190 ",
49430
- listensIn.map((l) => `${l.eventName} \u2190 ${l.emitterOrbital}`).join(", ")
49431
- ] })
49432
- ]
49433
- }
49434
- );
49435
- };
49436
- var AvlOrbitalsCosmicZoom = ({
49437
- schema: schemaProp,
49438
- className,
49439
- color = "var(--color-primary, #4A90D9)",
49440
- animated = true,
49441
- width = "100%",
49442
- height = 450,
49443
- highlightedOrbital,
49444
- onOrbitalSelect,
49445
- minZoom = 0.4,
49446
- maxZoom = 3
49447
- }) => {
49448
- const parsedSchema = React125.useMemo(() => {
49449
- if (typeof schemaProp === "string") return JSON.parse(schemaProp);
49450
- return schemaProp;
49451
- }, [schemaProp]);
49452
- const { orbitals, crossLinks } = React125.useMemo(
49453
- () => parseApplicationLevel(parsedSchema),
49454
- [parsedSchema]
49455
- );
49456
- const containerW = typeof width === "number" ? width : 800;
49457
- const containerH = typeof height === "number" ? height : 450;
49458
- const positions = React125.useMemo(
49459
- () => layoutOrbitals(orbitals.length, containerW, containerH),
49460
- [orbitals.length, containerW, containerH]
49461
- );
49462
- const orbitalViews = React125.useMemo(
49463
- () => orbitals.map((o, i) => ({
49464
- name: o.name,
49465
- entityName: o.entityName,
49466
- fieldCount: o.fieldCount,
49467
- persistence: o.persistence || "persistent",
49468
- traits: o.traitNames.map((n) => ({ name: n })),
49469
- pages: o.pageNames.map((n) => ({ name: n })),
49470
- cx: positions[i]?.cx ?? 0,
49471
- cy: positions[i]?.cy ?? 0
49472
- })),
49473
- [orbitals, positions]
49474
- );
49475
- const [selected, setSelected] = React125.useState(null);
49476
- const handleSelect = React125.useCallback(
49477
- (name) => {
49478
- setSelected((prev) => prev === name ? null : name);
49479
- onOrbitalSelect?.(name);
49480
- },
49481
- [onOrbitalSelect]
49482
- );
49483
- const selectedView = orbitalViews.find((o) => o.name === selected);
49484
- const [zoom, setZoom] = React125.useState(1);
49485
- const [pan, setPan] = React125.useState({ x: 0, y: 0 });
49486
- const dragStateRef = React125.useRef(null);
49487
- const transformWrapperRef = React125.useRef(null);
49488
- const clampZoom = React125.useCallback(
49489
- (z) => Math.max(minZoom, Math.min(maxZoom, z)),
49490
- [minZoom, maxZoom]
49491
- );
49492
- const handlePointerDown = React125.useCallback((e) => {
49493
- if (e.target.closest("[data-orbital-tile]")) return;
49494
- dragStateRef.current = {
49495
- startX: e.clientX,
49496
- startY: e.clientY,
49497
- panX: pan.x,
49498
- panY: pan.y
49499
- };
49500
- e.target.setPointerCapture(e.pointerId);
49501
- }, [pan]);
49502
- const handlePointerMove = React125.useCallback((e) => {
49503
- const drag = dragStateRef.current;
49504
- if (!drag) return;
49505
- setPan({
49506
- x: drag.panX + (e.clientX - drag.startX),
49507
- y: drag.panY + (e.clientY - drag.startY)
49508
- });
49509
- }, []);
49510
- const handlePointerUp = React125.useCallback((e) => {
49511
- if (!dragStateRef.current) return;
49512
- dragStateRef.current = null;
49513
- try {
49514
- e.target.releasePointerCapture(e.pointerId);
49515
- } catch {
49516
- }
49517
- }, []);
49518
- const panRef = React125.useRef(pan);
49519
- const zoomRef = React125.useRef(zoom);
49520
- React125.useEffect(() => {
49521
- panRef.current = pan;
49522
- }, [pan]);
49523
- React125.useEffect(() => {
49524
- zoomRef.current = zoom;
49525
- }, [zoom]);
49526
- React125.useEffect(() => {
49527
- const wrapper = transformWrapperRef.current;
49528
- if (!wrapper) return;
49529
- const wheelListener = (e) => {
49530
- e.preventDefault();
49531
- const rect = wrapper.getBoundingClientRect();
49532
- const cursorX = e.clientX - rect.left;
49533
- const cursorY = e.clientY - rect.top;
49534
- const currentZoom = zoomRef.current;
49535
- const currentPan = panRef.current;
49536
- const worldX = (cursorX - currentPan.x) / currentZoom;
49537
- const worldY = (cursorY - currentPan.y) / currentZoom;
49538
- const delta = e.deltaY > 0 ? -0.1 : 0.1;
49539
- const nextZoom = clampZoom(currentZoom * (1 + delta));
49540
- const nextPanX = cursorX - worldX * nextZoom;
49541
- const nextPanY = cursorY - worldY * nextZoom;
49542
- setZoom(nextZoom);
49543
- setPan({ x: nextPanX, y: nextPanY });
49544
- };
49545
- wrapper.addEventListener("wheel", wheelListener, { passive: false });
49546
- return () => wrapper.removeEventListener("wheel", wheelListener);
49547
- }, [clampZoom]);
49548
- const zoomIn = React125.useCallback(() => setZoom((z) => clampZoom(z * 1.2)), [clampZoom]);
49549
- const zoomOut = React125.useCallback(() => setZoom((z) => clampZoom(z / 1.2)), [clampZoom]);
49550
- const resetZoom = React125.useCallback(() => {
49551
- setZoom(1);
49552
- setPan({ x: 0, y: 0 });
49553
- }, []);
49554
- return /* @__PURE__ */ jsxRuntime.jsxs(
49555
- Box,
49556
- {
49557
- className,
49558
- position: "relative",
49559
- overflow: "visible",
49560
- style: { width, height: containerH },
49561
- children: [
49562
- /* @__PURE__ */ jsxRuntime.jsx(
49563
- "div",
49564
- {
49565
- ref: transformWrapperRef,
49566
- onPointerDown: handlePointerDown,
49567
- onPointerMove: handlePointerMove,
49568
- onPointerUp: handlePointerUp,
49569
- onPointerCancel: handlePointerUp,
49570
- style: {
49571
- position: "absolute",
49572
- inset: 0,
49573
- overflow: "hidden",
49574
- cursor: dragStateRef.current ? "grabbing" : "grab",
49575
- touchAction: "none"
49576
- },
49577
- children: /* @__PURE__ */ jsxRuntime.jsxs(
49578
- "div",
49579
- {
49580
- style: {
49581
- position: "absolute",
49582
- inset: 0,
49583
- transform: `translate(${pan.x}px, ${pan.y}px) scale(${zoom})`,
49584
- transformOrigin: "0 0"
49585
- },
49586
- children: [
49587
- /* @__PURE__ */ jsxRuntime.jsx(
49588
- EventWireOverlay,
49589
- {
49590
- orbitalViews,
49591
- crossLinks,
49592
- color,
49593
- animated,
49594
- containerW,
49595
- containerH
49596
- }
49597
- ),
49598
- orbitalViews.map((view) => {
49599
- const isHighlighted = view.name === highlightedOrbital;
49600
- return /* @__PURE__ */ jsxRuntime.jsx(
49601
- Box,
49602
- {
49603
- role: "button",
49604
- tabIndex: 0,
49605
- "data-orbital-tile": "true",
49606
- onClick: () => handleSelect(view.name),
49607
- onKeyDown: (e) => {
49608
- if (e.key === "Enter" || e.key === " ") handleSelect(view.name);
49609
- },
49610
- "aria-label": `Orbital: ${view.name}${isHighlighted ? " (highlighted)" : ""}`,
49611
- position: "absolute",
49612
- style: {
49613
- left: view.cx - UNIT_DISPLAY_W / 2,
49614
- top: view.cy - UNIT_DISPLAY_H / 2,
49615
- width: UNIT_DISPLAY_W,
49616
- height: UNIT_DISPLAY_H,
49617
- cursor: "pointer",
49618
- transition: "transform 0.2s ease, filter 0.2s ease, box-shadow 0.3s ease",
49619
- transform: selected === view.name ? "scale(1.05)" : "scale(1)",
49620
- filter: selected && selected !== view.name ? "opacity(0.5)" : "none",
49621
- // GAP-52: persistent highlight ring (independent from user selection)
49622
- boxShadow: isHighlighted ? `0 0 0 3px ${color}, 0 0 24px 4px ${color}` : "none",
49623
- borderRadius: isHighlighted ? "12px" : void 0,
49624
- zIndex: isHighlighted ? 11 : selected === view.name ? 10 : 1
49625
- },
49626
- children: /* @__PURE__ */ jsxRuntime.jsx(
49627
- AvlOrbitalUnit,
49628
- {
49629
- entityName: view.entityName,
49630
- fields: view.fieldCount,
49631
- persistence: view.persistence,
49632
- traits: view.traits,
49633
- pages: view.pages,
49634
- color,
49635
- animated: animated && (selected === view.name || isHighlighted)
49636
- }
49637
- )
49638
- },
49639
- view.name
49640
- );
49641
- }),
49642
- selectedView && /* @__PURE__ */ jsxRuntime.jsx(
49643
- InfoPanel,
49644
- {
49645
- view: selectedView,
49646
- crossLinks,
49647
- color
49648
- }
49649
- )
49650
- ]
49651
- }
49652
- )
49653
- }
49654
- ),
49655
- /* @__PURE__ */ jsxRuntime.jsxs(
49656
- Box,
49657
- {
49658
- position: "absolute",
49659
- style: {
49660
- top: 12,
49661
- right: 12,
49662
- display: "flex",
49663
- flexDirection: "column",
49664
- gap: 4,
49665
- zIndex: 30
49666
- },
49667
- children: [
49668
- /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "secondary", size: "sm", onClick: zoomIn, title: "Zoom in", action: "COSMIC_ZOOM_IN", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "plus", size: "sm" }) }),
49669
- /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "secondary", size: "sm", onClick: zoomOut, title: "Zoom out", action: "COSMIC_ZOOM_OUT", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "minus", size: "sm" }) }),
49670
- /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "secondary", size: "sm", onClick: resetZoom, title: "Reset", action: "COSMIC_ZOOM_RESET", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "maximize", size: "sm" }) })
49671
- ]
49672
- }
49673
- )
49674
- ]
49675
- }
49676
- );
49677
- };
49678
- AvlOrbitalsCosmicZoom.displayName = "AvlOrbitalsCosmicZoom";
49679
- init_types();
49680
- var SWIM_GUTTER2 = 120;
49681
- var CENTER_W2 = 360;
49682
- var AvlTraitScene = ({
49683
- data,
49684
- color = "var(--color-primary)",
49685
- onTransitionClick
49686
- }) => {
49687
- const [layout, setLayout] = React125.useState(null);
49688
- const dataKey = React125.useMemo(() => JSON.stringify(data), [data]);
49689
- React125.useEffect(() => {
49690
- computeTraitLayout(data).then(setLayout).catch(console.error);
49691
- }, [dataKey]);
49692
- if (!layout) {
49693
- return /* @__PURE__ */ jsxRuntime.jsx("g", { children: /* @__PURE__ */ jsxRuntime.jsx("text", { x: 300, y: 200, textAnchor: "middle", fill: color, fontSize: 12, opacity: 0.5, children: "Computing layout..." }) });
49694
- }
49695
- const hasExternal = data.listenedEvents.length > 0 || data.emittedEvents.length > 0;
49696
- const machineOffsetX = hasExternal ? 0 : 30;
49697
- const padding = 20;
49698
- const availW = CENTER_W2 - padding * 2;
49699
- const availH = 300;
49700
- const scale = Math.min(1, availW / layout.width, availH / layout.height);
49701
- const scaledW = layout.width * scale;
49702
- const scaledH = layout.height * scale;
49703
- const offsetX = padding + (availW - scaledW) / 2;
49704
- const offsetY = 50 + (availH - scaledH) / 2;
49705
- const machineHeight = scaledH + 100;
49706
- const renderMachine = /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
49707
- /* @__PURE__ */ jsxRuntime.jsx("text", { x: CENTER_W2 / 2, y: 20, textAnchor: "middle", fill: color, fontSize: 20, fontWeight: "700", fontFamily: "inherit", children: data.name }),
49708
- /* @__PURE__ */ jsxRuntime.jsxs("text", { x: CENTER_W2 / 2, y: 38, textAnchor: "middle", fill: color, fontSize: 11, opacity: 0.5, fontFamily: "inherit", children: [
49709
- "linked to ",
49710
- data.linkedEntity
49711
- ] }),
49712
- /* @__PURE__ */ jsxRuntime.jsxs("defs", { children: [
49713
- /* @__PURE__ */ jsxRuntime.jsx("marker", { id: "traitArrowV2", viewBox: "0 0 10 10", refX: "9", refY: "5", markerWidth: "6", markerHeight: "6", orient: "auto-start-reverse", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M 0 0 L 10 5 L 0 10 z", fill: exports.CONNECTION_COLORS.forward.color, opacity: 0.7 }) }),
49714
- /* @__PURE__ */ jsxRuntime.jsx("marker", { id: "traitArrowBack", viewBox: "0 0 10 10", refX: "9", refY: "5", markerWidth: "6", markerHeight: "6", orient: "auto-start-reverse", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M 0 0 L 10 5 L 0 10 z", fill: exports.CONNECTION_COLORS.backward.color, opacity: 0.5 }) })
49715
- ] }),
49716
- /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${offsetX},${offsetY}) scale(${scale})`, children: [
49717
- layout.edges.map((edge) => {
49718
- const conn = edge.isSelf ? exports.CONNECTION_COLORS.selfLoop : edge.isBackward ? exports.CONNECTION_COLORS.backward : exports.CONNECTION_COLORS.forward;
49719
- const marker = edge.isBackward || edge.isSelf ? "url(#traitArrowBack)" : "url(#traitArrowV2)";
49720
- return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
49721
- /* @__PURE__ */ jsxRuntime.jsx(
49722
- "path",
49723
- {
49724
- d: edgePath(edge.points),
49725
- fill: "none",
49726
- stroke: conn.color,
49727
- strokeWidth: conn.width,
49728
- strokeDasharray: conn.dash === "none" ? void 0 : conn.dash,
49729
- opacity: 0.5,
49730
- markerEnd: marker
49731
- }
49732
- ),
49733
- /* @__PURE__ */ jsxRuntime.jsx(
49734
- AvlTransitionLane,
49735
- {
49736
- x: edge.labelX,
49737
- y: edge.labelY,
49738
- event: edge.event,
49739
- guard: edge.guardExpr,
49740
- effects: edge.effects.map((e) => ({ type: e.type })),
49741
- width: edge.labelW,
49742
- isBackward: edge.isBackward,
49743
- isSelfLoop: edge.isSelf,
49744
- color,
49745
- onTransitionClick: onTransitionClick ? () => onTransitionClick(edge.index, {
49746
- x: edge.labelX + offsetX + (hasExternal ? SWIM_GUTTER2 : machineOffsetX),
49747
- y: edge.labelY + offsetY
49748
- }) : void 0
49749
- }
49750
- )
49751
- ] }, edge.id);
49752
- }),
49753
- layout.nodes.map((node) => /* @__PURE__ */ jsxRuntime.jsx("g", { children: /* @__PURE__ */ jsxRuntime.jsx(
49754
- AvlState,
49755
- {
49756
- x: node.x,
49757
- y: node.y,
49758
- width: node.width,
49759
- height: node.height,
49760
- name: node.id,
49761
- isInitial: node.isInitial,
49762
- isTerminal: node.isTerminal,
49763
- role: node.role,
49764
- transitionCount: node.transitionCount,
49765
- color
49766
- }
49767
- ) }, node.id))
49768
- ] })
49769
- ] });
49770
- if (!hasExternal) {
49771
- return /* @__PURE__ */ jsxRuntime.jsx("g", { transform: `translate(${machineOffsetX}, 0)`, children: renderMachine });
49772
- }
49773
- return /* @__PURE__ */ jsxRuntime.jsx(
49774
- AvlSwimLane,
49287
+ const [layout, setLayout] = React125.useState(null);
49288
+ const dataKey = React125.useMemo(() => JSON.stringify(data), [data]);
49289
+ React125.useEffect(() => {
49290
+ computeTraitLayout(data).then(setLayout).catch(console.error);
49291
+ }, [dataKey]);
49292
+ if (!layout) {
49293
+ return /* @__PURE__ */ jsxRuntime.jsx("g", { children: /* @__PURE__ */ jsxRuntime.jsx("text", { x: 300, y: 200, textAnchor: "middle", fill: color, fontSize: 12, opacity: 0.5, children: "Computing layout..." }) });
49294
+ }
49295
+ const hasExternal = data.listenedEvents.length > 0 || data.emittedEvents.length > 0;
49296
+ const machineOffsetX = hasExternal ? 0 : 30;
49297
+ const padding = 20;
49298
+ const availW = CENTER_W2 - padding * 2;
49299
+ const availH = 300;
49300
+ const scale = Math.min(1, availW / layout.width, availH / layout.height);
49301
+ const scaledW = layout.width * scale;
49302
+ const scaledH = layout.height * scale;
49303
+ const offsetX = padding + (availW - scaledW) / 2;
49304
+ const offsetY = 50 + (availH - scaledH) / 2;
49305
+ const machineHeight = scaledH + 100;
49306
+ const renderMachine = /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
49307
+ /* @__PURE__ */ jsxRuntime.jsx("text", { x: CENTER_W2 / 2, y: 20, textAnchor: "middle", fill: color, fontSize: 20, fontWeight: "700", fontFamily: "inherit", children: data.name }),
49308
+ /* @__PURE__ */ jsxRuntime.jsxs("text", { x: CENTER_W2 / 2, y: 38, textAnchor: "middle", fill: color, fontSize: 11, opacity: 0.5, fontFamily: "inherit", children: [
49309
+ "linked to ",
49310
+ data.linkedEntity
49311
+ ] }),
49312
+ /* @__PURE__ */ jsxRuntime.jsxs("defs", { children: [
49313
+ /* @__PURE__ */ jsxRuntime.jsx("marker", { id: "traitArrowV2", viewBox: "0 0 10 10", refX: "9", refY: "5", markerWidth: "6", markerHeight: "6", orient: "auto-start-reverse", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M 0 0 L 10 5 L 0 10 z", fill: exports.CONNECTION_COLORS.forward.color, opacity: 0.7 }) }),
49314
+ /* @__PURE__ */ jsxRuntime.jsx("marker", { id: "traitArrowBack", viewBox: "0 0 10 10", refX: "9", refY: "5", markerWidth: "6", markerHeight: "6", orient: "auto-start-reverse", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M 0 0 L 10 5 L 0 10 z", fill: exports.CONNECTION_COLORS.backward.color, opacity: 0.5 }) })
49315
+ ] }),
49316
+ /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${offsetX},${offsetY}) scale(${scale})`, children: [
49317
+ layout.edges.map((edge) => {
49318
+ const conn = edge.isSelf ? exports.CONNECTION_COLORS.selfLoop : edge.isBackward ? exports.CONNECTION_COLORS.backward : exports.CONNECTION_COLORS.forward;
49319
+ const marker = edge.isBackward || edge.isSelf ? "url(#traitArrowBack)" : "url(#traitArrowV2)";
49320
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
49321
+ /* @__PURE__ */ jsxRuntime.jsx(
49322
+ "path",
49323
+ {
49324
+ d: edgePath(edge.points),
49325
+ fill: "none",
49326
+ stroke: conn.color,
49327
+ strokeWidth: conn.width,
49328
+ strokeDasharray: conn.dash === "none" ? void 0 : conn.dash,
49329
+ opacity: 0.5,
49330
+ markerEnd: marker
49331
+ }
49332
+ ),
49333
+ /* @__PURE__ */ jsxRuntime.jsx(
49334
+ AvlTransitionLane,
49335
+ {
49336
+ x: edge.labelX,
49337
+ y: edge.labelY,
49338
+ event: edge.event,
49339
+ guard: edge.guardExpr,
49340
+ effects: edge.effects.map((e) => ({ type: e.type })),
49341
+ width: edge.labelW,
49342
+ isBackward: edge.isBackward,
49343
+ isSelfLoop: edge.isSelf,
49344
+ color,
49345
+ onTransitionClick: onTransitionClick ? () => onTransitionClick(edge.index, {
49346
+ x: edge.labelX + offsetX + (hasExternal ? SWIM_GUTTER2 : machineOffsetX),
49347
+ y: edge.labelY + offsetY
49348
+ }) : void 0
49349
+ }
49350
+ )
49351
+ ] }, edge.id);
49352
+ }),
49353
+ layout.nodes.map((node) => /* @__PURE__ */ jsxRuntime.jsx("g", { children: /* @__PURE__ */ jsxRuntime.jsx(
49354
+ AvlState,
49355
+ {
49356
+ x: node.x,
49357
+ y: node.y,
49358
+ width: node.width,
49359
+ height: node.height,
49360
+ name: node.id,
49361
+ isInitial: node.isInitial,
49362
+ isTerminal: node.isTerminal,
49363
+ role: node.role,
49364
+ transitionCount: node.transitionCount,
49365
+ color
49366
+ }
49367
+ ) }, node.id))
49368
+ ] })
49369
+ ] });
49370
+ if (!hasExternal) {
49371
+ return /* @__PURE__ */ jsxRuntime.jsx("g", { transform: `translate(${machineOffsetX}, 0)`, children: renderMachine });
49372
+ }
49373
+ return /* @__PURE__ */ jsxRuntime.jsx(
49374
+ AvlSwimLane,
49775
49375
  {
49776
49376
  listenedEvents: data.listenedEvents,
49777
49377
  emittedEvents: data.emittedEvents,
@@ -49966,63 +49566,670 @@ var AvlTransitionScene = ({
49966
49566
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
49967
49567
  /* @__PURE__ */ jsxRuntime.jsx("text", { x: SECTION_LEFT, y: secY + 12, fill: color, fontSize: 10, fontWeight: 600, opacity: 0.4, fontFamily: "inherit", children: "GUARD" }),
49968
49568
  /* @__PURE__ */ jsxRuntime.jsx(
49969
- "polygon",
49569
+ "polygon",
49570
+ {
49571
+ points: `${CONTENT_LEFT + 6},${secY + 22} ${CONTENT_LEFT + 2},${secY + 26} ${CONTENT_LEFT + 6},${secY + 30} ${CONTENT_LEFT + 10},${secY + 26}`,
49572
+ fill: "none",
49573
+ stroke: color,
49574
+ strokeWidth: 1,
49575
+ opacity: 0.5
49576
+ }
49577
+ ),
49578
+ /* @__PURE__ */ jsxRuntime.jsx("text", { x: CONTENT_LEFT + 18, y: secY + 29, fill: color, fontSize: 12, fontWeight: 400, opacity: 0.6, fontFamily: "inherit", children: data.guard.label })
49579
+ ] });
49580
+ })(),
49581
+ hasEffects && (() => {
49582
+ const secY = cardY + headerH + sectionGap + triggerH + guardH;
49583
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
49584
+ /* @__PURE__ */ jsxRuntime.jsx("text", { x: SECTION_LEFT, y: secY + 12, fill: color, fontSize: 10, fontWeight: 600, opacity: 0.4, fontFamily: "inherit", children: "EFFECTS" }),
49585
+ effects.map((eff, i) => {
49586
+ const rowY = secY + 22 + i * effectRowH;
49587
+ const effectType = mapEffectType(eff.type);
49588
+ const argsText = eff.args.length > 0 ? eff.args.join(" \xB7 ") : "";
49589
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
49590
+ /* @__PURE__ */ jsxRuntime.jsx(
49591
+ AvlEffect,
49592
+ {
49593
+ x: CONTENT_LEFT + 10,
49594
+ y: rowY + 6,
49595
+ effectType,
49596
+ size: 10,
49597
+ showBackground: true
49598
+ }
49599
+ ),
49600
+ /* @__PURE__ */ jsxRuntime.jsx("text", { x: CONTENT_LEFT + 28, y: rowY + 10, fill: color, fontSize: 12, fontWeight: 500, opacity: 0.8, fontFamily: "inherit", children: eff.type }),
49601
+ argsText && /* @__PURE__ */ jsxRuntime.jsx("text", { x: CONTENT_LEFT + 28 + eff.type.length * 7 + 8, y: rowY + 10, fill: color, fontSize: 10, fontWeight: 400, opacity: 0.5, fontFamily: "monospace", children: argsText })
49602
+ ] }, `eff-${i}`);
49603
+ })
49604
+ ] });
49605
+ })(),
49606
+ hasSlots && (() => {
49607
+ const secY = cardY + headerH + sectionGap + triggerH + guardH + effectsH;
49608
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
49609
+ /* @__PURE__ */ jsxRuntime.jsx("text", { x: SECTION_LEFT, y: secY + 12, fill: color, fontSize: 10, fontWeight: 600, opacity: 0.4, fontFamily: "inherit", children: "SLOTS" }),
49610
+ data.slotTargets.map((slot, i) => {
49611
+ const rowY = secY + 22 + i * 22;
49612
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
49613
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: CONTENT_LEFT, y: rowY - 4, width: CARD_W - 56, height: 18, rx: 4, fill: color, fillOpacity: 0.04 }),
49614
+ /* @__PURE__ */ jsxRuntime.jsxs("text", { x: CONTENT_LEFT + 8, y: rowY + 8, fill: color, fontSize: 11, fontFamily: "inherit", children: [
49615
+ slot.name,
49616
+ ": ",
49617
+ slot.pattern
49618
+ ] })
49619
+ ] }, `slot-${i}`);
49620
+ })
49621
+ ] });
49622
+ })()
49623
+ ] });
49624
+ };
49625
+ AvlTransitionScene.displayName = "AvlTransitionScene";
49626
+
49627
+ // components/organisms/avl/AvlOrbitalsCosmicZoom.tsx
49628
+ init_Box();
49629
+ init_Stack();
49630
+ init_Typography();
49631
+ var UNIT_DISPLAY_W = 240;
49632
+ var UNIT_DISPLAY_H = 160;
49633
+ function layoutOrbitals(count, containerW, containerH) {
49634
+ if (count === 0) return [];
49635
+ if (count === 1) return [{ cx: containerW / 2, cy: containerH / 2 }];
49636
+ const cols = Math.min(count, Math.ceil(Math.sqrt(count)));
49637
+ const rows = Math.ceil(count / cols);
49638
+ const cellW = containerW / (cols + 0.3);
49639
+ const cellH = containerH / (rows + 0.3);
49640
+ const originX = (containerW - cols * cellW) / 2 + cellW / 2;
49641
+ const originY = (containerH - rows * cellH) / 2 + cellH / 2;
49642
+ return Array.from({ length: count }, (_, i) => ({
49643
+ cx: originX + i % cols * cellW,
49644
+ cy: originY + Math.floor(i / cols) * cellH
49645
+ }));
49646
+ }
49647
+ var avlOczWireId = 0;
49648
+ var EventWireOverlay = ({
49649
+ orbitalViews,
49650
+ crossLinks,
49651
+ color,
49652
+ animated,
49653
+ containerW,
49654
+ containerH
49655
+ }) => {
49656
+ const ids = React125__namespace.default.useMemo(() => {
49657
+ avlOczWireId += 1;
49658
+ return { arrow: `avl-ocz-wire-${avlOczWireId}-arrow` };
49659
+ }, []);
49660
+ const posMap = React125.useMemo(() => {
49661
+ const m = /* @__PURE__ */ new Map();
49662
+ for (const ov of orbitalViews) m.set(ov.name, { cx: ov.cx, cy: ov.cy });
49663
+ return m;
49664
+ }, [orbitalViews]);
49665
+ const wiresByPair = React125.useMemo(() => {
49666
+ const map = /* @__PURE__ */ new Map();
49667
+ for (const link of crossLinks) {
49668
+ const key = `${link.emitterOrbital}__${link.listenerOrbital}`;
49669
+ const arr = map.get(key) ?? [];
49670
+ arr.push(link);
49671
+ map.set(key, arr);
49672
+ }
49673
+ return map;
49674
+ }, [crossLinks]);
49675
+ const orbitalR = UNIT_DISPLAY_W * 0.38;
49676
+ return /* @__PURE__ */ jsxRuntime.jsxs(
49677
+ "svg",
49678
+ {
49679
+ style: {
49680
+ position: "absolute",
49681
+ inset: 0,
49682
+ width: "100%",
49683
+ height: "100%",
49684
+ pointerEvents: "none",
49685
+ overflow: "visible"
49686
+ },
49687
+ viewBox: `0 0 ${containerW} ${containerH}`,
49688
+ preserveAspectRatio: "xMidYMid meet",
49689
+ children: [
49690
+ /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx(
49691
+ "marker",
49692
+ {
49693
+ id: ids.arrow,
49694
+ markerWidth: "8",
49695
+ markerHeight: "6",
49696
+ refX: "7",
49697
+ refY: "3",
49698
+ orient: "auto",
49699
+ markerUnits: "strokeWidth",
49700
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M0,0 L8,3 L0,6 Z", fill: color, opacity: 0.6 })
49701
+ }
49702
+ ) }),
49703
+ animated && /* @__PURE__ */ jsxRuntime.jsx("style", { children: `
49704
+ @keyframes avl-ocz-flow {
49705
+ from { stroke-dashoffset: 20; }
49706
+ to { stroke-dashoffset: 0; }
49707
+ }
49708
+ ` }),
49709
+ Array.from(wiresByPair.entries()).map(
49710
+ ([pairKey, links]) => links.map((link, wireIdx) => {
49711
+ const fromPos = posMap.get(link.emitterOrbital);
49712
+ const toPos = posMap.get(link.listenerOrbital);
49713
+ if (!fromPos || !toPos) return null;
49714
+ const dx = toPos.cx - fromPos.cx;
49715
+ const dy = toPos.cy - fromPos.cy;
49716
+ const dist = Math.sqrt(dx * dx + dy * dy) || 1;
49717
+ const nx = dx / dist;
49718
+ const ny = dy / dist;
49719
+ const x1 = fromPos.cx + nx * orbitalR;
49720
+ const y1 = fromPos.cy + ny * orbitalR;
49721
+ const x2 = toPos.cx - nx * (orbitalR + 6);
49722
+ const y2 = toPos.cy - ny * (orbitalR + 6);
49723
+ const offset = 25 + wireIdx * 18;
49724
+ const { cpx, cpy } = curveControlPoint(x1, y1, x2, y2, offset);
49725
+ const pathD = `M${x1},${y1} Q${cpx},${cpy} ${x2},${y2}`;
49726
+ const t = 0.5;
49727
+ const lx = (1 - t) * (1 - t) * x1 + 2 * (1 - t) * t * cpx + t * t * x2;
49728
+ const ly = (1 - t) * (1 - t) * y1 + 2 * (1 - t) * t * cpy + t * t * y2;
49729
+ const labelW = link.eventName.length * 5.5 + 12;
49730
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
49731
+ /* @__PURE__ */ jsxRuntime.jsx(
49732
+ "path",
49733
+ {
49734
+ d: pathD,
49735
+ fill: "none",
49736
+ stroke: color,
49737
+ strokeWidth: 1.2,
49738
+ strokeDasharray: animated ? "6 4" : "4 3",
49739
+ markerEnd: `url(#${ids.arrow})`,
49740
+ opacity: 0.5,
49741
+ style: animated ? { animation: "avl-ocz-flow 1.5s linear infinite" } : void 0
49742
+ }
49743
+ ),
49744
+ /* @__PURE__ */ jsxRuntime.jsx(
49745
+ "rect",
49746
+ {
49747
+ x: lx - labelW / 2,
49748
+ y: ly - 8,
49749
+ width: labelW,
49750
+ height: 14,
49751
+ rx: 3,
49752
+ fill: "var(--color-background, #fff)",
49753
+ stroke: color,
49754
+ strokeWidth: 0.5,
49755
+ opacity: 0.9
49756
+ }
49757
+ ),
49758
+ /* @__PURE__ */ jsxRuntime.jsx(
49759
+ "text",
49760
+ {
49761
+ x: lx,
49762
+ y: ly + 3,
49763
+ textAnchor: "middle",
49764
+ fill: color,
49765
+ fontSize: 7,
49766
+ fontWeight: 600,
49767
+ fontFamily: "monospace",
49768
+ opacity: 0.8,
49769
+ children: link.eventName
49770
+ }
49771
+ )
49772
+ ] }, `${pairKey}-${wireIdx}`);
49773
+ })
49774
+ )
49775
+ ]
49776
+ }
49777
+ );
49778
+ };
49779
+ var AvlOrbitalsCosmicZoom = ({
49780
+ schema: schemaProp,
49781
+ className,
49782
+ color = "var(--color-primary, #4A90D9)",
49783
+ animated = true,
49784
+ width = "100%",
49785
+ height = 450,
49786
+ highlightedOrbital,
49787
+ onOrbitalSelect,
49788
+ minZoom = 0.4,
49789
+ maxZoom = 3
49790
+ }) => {
49791
+ const parsedSchema = React125.useMemo(() => {
49792
+ if (typeof schemaProp === "string") return JSON.parse(schemaProp);
49793
+ return schemaProp;
49794
+ }, [schemaProp]);
49795
+ const { orbitals, crossLinks } = React125.useMemo(
49796
+ () => parseApplicationLevel(parsedSchema),
49797
+ [parsedSchema]
49798
+ );
49799
+ const containerW = typeof width === "number" ? width : 800;
49800
+ const containerH = typeof height === "number" ? height : 450;
49801
+ const positions = React125.useMemo(
49802
+ () => layoutOrbitals(orbitals.length, containerW, containerH),
49803
+ [orbitals.length, containerW, containerH]
49804
+ );
49805
+ const orbitalViews = React125.useMemo(
49806
+ () => orbitals.map((o, i) => ({
49807
+ name: o.name,
49808
+ entityName: o.entityName,
49809
+ fieldCount: o.fieldCount,
49810
+ persistence: o.persistence || "persistent",
49811
+ traits: o.traitNames.map((n) => ({ name: n })),
49812
+ pages: o.pageNames.map((n) => ({ name: n })),
49813
+ cx: positions[i]?.cx ?? 0,
49814
+ cy: positions[i]?.cy ?? 0
49815
+ })),
49816
+ [orbitals, positions]
49817
+ );
49818
+ const [state, dispatch] = React125.useReducer(zoomReducer, initialZoomState);
49819
+ const drilledForHighlightRef = React125.useRef(false);
49820
+ React125.useEffect(() => {
49821
+ if (!highlightedOrbital) return;
49822
+ if (drilledForHighlightRef.current) return;
49823
+ drilledForHighlightRef.current = true;
49824
+ dispatch({ type: "ZOOM_INTO_ORBITAL", orbital: highlightedOrbital, targetPosition: { x: 0, y: 0 } });
49825
+ Promise.resolve().then(() => dispatch({ type: "ANIMATION_COMPLETE" }));
49826
+ }, [highlightedOrbital]);
49827
+ const breadcrumbs = React125.useMemo(() => getBreadcrumbs(state), [state]);
49828
+ const handleSelect = React125.useCallback(
49829
+ (name) => {
49830
+ dispatch({ type: "ZOOM_INTO_ORBITAL", orbital: name, targetPosition: { x: 0, y: 0 } });
49831
+ Promise.resolve().then(() => dispatch({ type: "ANIMATION_COMPLETE" }));
49832
+ onOrbitalSelect?.(name);
49833
+ },
49834
+ [onOrbitalSelect]
49835
+ );
49836
+ const handleTraitSelect = React125.useCallback((traitName) => {
49837
+ dispatch({ type: "ZOOM_INTO_TRAIT", trait: traitName, targetPosition: { x: 0, y: 0 } });
49838
+ Promise.resolve().then(() => dispatch({ type: "ANIMATION_COMPLETE" }));
49839
+ }, []);
49840
+ const handleTransitionSelect = React125.useCallback((transitionIndex) => {
49841
+ dispatch({ type: "ZOOM_INTO_TRANSITION", transitionIndex, targetPosition: { x: 0, y: 0 } });
49842
+ Promise.resolve().then(() => dispatch({ type: "ANIMATION_COMPLETE" }));
49843
+ }, []);
49844
+ const handleZoomOut = React125.useCallback(() => {
49845
+ dispatch({ type: "ZOOM_OUT" });
49846
+ Promise.resolve().then(() => dispatch({ type: "ANIMATION_COMPLETE" }));
49847
+ }, []);
49848
+ const handleBreadcrumbClick = React125.useCallback((targetLevel) => {
49849
+ const order = ["application", "orbital", "trait", "transition"];
49850
+ const currentIdx = order.indexOf(state.level);
49851
+ const targetIdx = order.indexOf(targetLevel);
49852
+ const steps = currentIdx - targetIdx;
49853
+ for (let i = 0; i < steps; i++) {
49854
+ dispatch({ type: "ZOOM_OUT" });
49855
+ }
49856
+ Promise.resolve().then(() => dispatch({ type: "ANIMATION_COMPLETE" }));
49857
+ }, [state.level]);
49858
+ React125.useEffect(() => {
49859
+ if (state.level === "application") return;
49860
+ const onKey = (e) => {
49861
+ if (e.key === "Escape") handleZoomOut();
49862
+ };
49863
+ window.addEventListener("keydown", onKey);
49864
+ return () => window.removeEventListener("keydown", onKey);
49865
+ }, [handleZoomOut, state.level]);
49866
+ const orbitalLevelData = React125.useMemo(() => {
49867
+ if (!state.selectedOrbital) return null;
49868
+ return parseOrbitalLevel(parsedSchema, state.selectedOrbital);
49869
+ }, [parsedSchema, state.selectedOrbital]);
49870
+ const traitLevelData = React125.useMemo(() => {
49871
+ if (!state.selectedOrbital || !state.selectedTrait) return null;
49872
+ return parseTraitLevel(parsedSchema, state.selectedOrbital, state.selectedTrait);
49873
+ }, [parsedSchema, state.selectedOrbital, state.selectedTrait]);
49874
+ const transitionLevelData = React125.useMemo(() => {
49875
+ if (!state.selectedOrbital || !state.selectedTrait || state.selectedTransition === null) return null;
49876
+ return parseTransitionLevel(
49877
+ parsedSchema,
49878
+ state.selectedOrbital,
49879
+ state.selectedTrait,
49880
+ state.selectedTransition
49881
+ );
49882
+ }, [parsedSchema, state.selectedOrbital, state.selectedTrait, state.selectedTransition]);
49883
+ const [zoom, setZoom] = React125.useState(1);
49884
+ const [pan, setPan] = React125.useState({ x: 0, y: 0 });
49885
+ const dragStateRef = React125.useRef(null);
49886
+ const transformWrapperRef = React125.useRef(null);
49887
+ const clampZoom = React125.useCallback(
49888
+ (z) => Math.max(minZoom, Math.min(maxZoom, z)),
49889
+ [minZoom, maxZoom]
49890
+ );
49891
+ const handlePointerDown = React125.useCallback((e) => {
49892
+ if (e.target.closest("[data-orbital-tile]")) return;
49893
+ dragStateRef.current = {
49894
+ startX: e.clientX,
49895
+ startY: e.clientY,
49896
+ panX: pan.x,
49897
+ panY: pan.y
49898
+ };
49899
+ e.target.setPointerCapture(e.pointerId);
49900
+ }, [pan]);
49901
+ const handlePointerMove = React125.useCallback((e) => {
49902
+ const drag = dragStateRef.current;
49903
+ if (!drag) return;
49904
+ setPan({
49905
+ x: drag.panX + (e.clientX - drag.startX),
49906
+ y: drag.panY + (e.clientY - drag.startY)
49907
+ });
49908
+ }, []);
49909
+ const handlePointerUp = React125.useCallback((e) => {
49910
+ if (!dragStateRef.current) return;
49911
+ dragStateRef.current = null;
49912
+ try {
49913
+ e.target.releasePointerCapture(e.pointerId);
49914
+ } catch {
49915
+ }
49916
+ }, []);
49917
+ const panRef = React125.useRef(pan);
49918
+ const zoomRef = React125.useRef(zoom);
49919
+ React125.useEffect(() => {
49920
+ panRef.current = pan;
49921
+ }, [pan]);
49922
+ React125.useEffect(() => {
49923
+ zoomRef.current = zoom;
49924
+ }, [zoom]);
49925
+ React125.useEffect(() => {
49926
+ const wrapper = transformWrapperRef.current;
49927
+ if (!wrapper) return;
49928
+ const wheelListener = (e) => {
49929
+ e.preventDefault();
49930
+ const rect = wrapper.getBoundingClientRect();
49931
+ const cursorX = e.clientX - rect.left;
49932
+ const cursorY = e.clientY - rect.top;
49933
+ const currentZoom = zoomRef.current;
49934
+ const currentPan = panRef.current;
49935
+ const worldX = (cursorX - currentPan.x) / currentZoom;
49936
+ const worldY = (cursorY - currentPan.y) / currentZoom;
49937
+ const delta = e.deltaY > 0 ? -0.1 : 0.1;
49938
+ const nextZoom = clampZoom(currentZoom * (1 + delta));
49939
+ const nextPanX = cursorX - worldX * nextZoom;
49940
+ const nextPanY = cursorY - worldY * nextZoom;
49941
+ setZoom(nextZoom);
49942
+ setPan({ x: nextPanX, y: nextPanY });
49943
+ };
49944
+ wrapper.addEventListener("wheel", wheelListener, { passive: false });
49945
+ return () => wrapper.removeEventListener("wheel", wheelListener);
49946
+ }, [clampZoom]);
49947
+ const zoomIn = React125.useCallback(() => setZoom((z) => clampZoom(z * 1.2)), [clampZoom]);
49948
+ const zoomOut = React125.useCallback(() => setZoom((z) => clampZoom(z / 1.2)), [clampZoom]);
49949
+ const resetZoom = React125.useCallback(() => {
49950
+ setZoom(1);
49951
+ setPan({ x: 0, y: 0 });
49952
+ }, []);
49953
+ return /* @__PURE__ */ jsxRuntime.jsxs(
49954
+ Box,
49955
+ {
49956
+ className,
49957
+ position: "relative",
49958
+ overflow: "visible",
49959
+ style: { width, height: containerH },
49960
+ children: [
49961
+ /* @__PURE__ */ jsxRuntime.jsx(
49962
+ Box,
49970
49963
  {
49971
- points: `${CONTENT_LEFT + 6},${secY + 22} ${CONTENT_LEFT + 2},${secY + 26} ${CONTENT_LEFT + 6},${secY + 30} ${CONTENT_LEFT + 10},${secY + 26}`,
49972
- fill: "none",
49973
- stroke: color,
49974
- strokeWidth: 1,
49975
- opacity: 0.5
49964
+ position: "absolute",
49965
+ style: {
49966
+ top: 12,
49967
+ left: 12,
49968
+ zIndex: 30,
49969
+ background: "var(--color-card, rgba(255,255,255,0.92))",
49970
+ padding: "4px 12px",
49971
+ borderRadius: 6,
49972
+ border: `1px solid ${color}`
49973
+ },
49974
+ children: /* @__PURE__ */ jsxRuntime.jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxRuntime.jsxs(React125__namespace.default.Fragment, { children: [
49975
+ i > 0 && /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", style: { opacity: 0.5, color }, children: "/" }),
49976
+ i < breadcrumbs.length - 1 ? /* @__PURE__ */ jsxRuntime.jsx(
49977
+ Box,
49978
+ {
49979
+ as: "span",
49980
+ onClick: () => handleBreadcrumbClick(crumb.level),
49981
+ style: { cursor: "pointer" },
49982
+ children: /* @__PURE__ */ jsxRuntime.jsx(
49983
+ Typography,
49984
+ {
49985
+ variant: "small",
49986
+ style: { color, textDecoration: "underline" },
49987
+ children: crumb.label
49988
+ }
49989
+ )
49990
+ }
49991
+ ) : /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", weight: "bold", style: { color }, children: crumb.label })
49992
+ ] }, crumb.level)) })
49976
49993
  }
49977
49994
  ),
49978
- /* @__PURE__ */ jsxRuntime.jsx("text", { x: CONTENT_LEFT + 18, y: secY + 29, fill: color, fontSize: 12, fontWeight: 400, opacity: 0.6, fontFamily: "inherit", children: data.guard.label })
49979
- ] });
49980
- })(),
49981
- hasEffects && (() => {
49982
- const secY = cardY + headerH + sectionGap + triggerH + guardH;
49983
- return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
49984
- /* @__PURE__ */ jsxRuntime.jsx("text", { x: SECTION_LEFT, y: secY + 12, fill: color, fontSize: 10, fontWeight: 600, opacity: 0.4, fontFamily: "inherit", children: "EFFECTS" }),
49985
- effects.map((eff, i) => {
49986
- const rowY = secY + 22 + i * effectRowH;
49987
- const effectType = mapEffectType(eff.type);
49988
- const argsText = eff.args.length > 0 ? eff.args.join(" \xB7 ") : "";
49989
- return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
49990
- /* @__PURE__ */ jsxRuntime.jsx(
49991
- AvlEffect,
49995
+ state.level !== "application" && /* @__PURE__ */ jsxRuntime.jsx(
49996
+ Box,
49997
+ {
49998
+ position: "absolute",
49999
+ style: {
50000
+ bottom: 12,
50001
+ right: 12,
50002
+ zIndex: 30,
50003
+ background: "var(--color-card, rgba(255,255,255,0.85))",
50004
+ padding: "2px 8px",
50005
+ borderRadius: 4,
50006
+ opacity: 0.8
50007
+ },
50008
+ children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", style: { color }, children: "Press Esc to zoom out" })
50009
+ }
50010
+ ),
50011
+ state.level === "application" && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
50012
+ /* @__PURE__ */ jsxRuntime.jsx(
50013
+ "div",
50014
+ {
50015
+ ref: transformWrapperRef,
50016
+ onPointerDown: handlePointerDown,
50017
+ onPointerMove: handlePointerMove,
50018
+ onPointerUp: handlePointerUp,
50019
+ onPointerCancel: handlePointerUp,
50020
+ style: {
50021
+ position: "absolute",
50022
+ inset: 0,
50023
+ overflow: "hidden",
50024
+ cursor: dragStateRef.current ? "grabbing" : "grab",
50025
+ touchAction: "none"
50026
+ },
50027
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
50028
+ "div",
50029
+ {
50030
+ style: {
50031
+ position: "absolute",
50032
+ inset: 0,
50033
+ transform: `translate(${pan.x}px, ${pan.y}px) scale(${zoom})`,
50034
+ transformOrigin: "0 0"
50035
+ },
50036
+ children: [
50037
+ /* @__PURE__ */ jsxRuntime.jsx(
50038
+ EventWireOverlay,
50039
+ {
50040
+ orbitalViews,
50041
+ crossLinks,
50042
+ color,
50043
+ animated,
50044
+ containerW,
50045
+ containerH
50046
+ }
50047
+ ),
50048
+ orbitalViews.map((view) => {
50049
+ const isHighlighted = view.name === highlightedOrbital;
50050
+ return /* @__PURE__ */ jsxRuntime.jsx(
50051
+ Box,
50052
+ {
50053
+ role: "button",
50054
+ tabIndex: 0,
50055
+ "data-orbital-tile": "true",
50056
+ onClick: () => handleSelect(view.name),
50057
+ onKeyDown: (e) => {
50058
+ if (e.key === "Enter" || e.key === " ") handleSelect(view.name);
50059
+ },
50060
+ "aria-label": `Orbital: ${view.name}${isHighlighted ? " (highlighted)" : ""}`,
50061
+ position: "absolute",
50062
+ style: {
50063
+ left: view.cx - UNIT_DISPLAY_W / 2,
50064
+ top: view.cy - UNIT_DISPLAY_H / 2,
50065
+ width: UNIT_DISPLAY_W,
50066
+ height: UNIT_DISPLAY_H,
50067
+ cursor: "pointer",
50068
+ transition: "transform 0.2s ease, filter 0.2s ease, box-shadow 0.3s ease",
50069
+ // GAP-52: persistent highlight ring (independent from user selection)
50070
+ boxShadow: isHighlighted ? `0 0 0 3px ${color}, 0 0 24px 4px ${color}` : "none",
50071
+ borderRadius: isHighlighted ? "12px" : void 0,
50072
+ zIndex: isHighlighted ? 11 : 1
50073
+ },
50074
+ children: /* @__PURE__ */ jsxRuntime.jsx(
50075
+ AvlOrbitalUnit,
50076
+ {
50077
+ entityName: view.entityName,
50078
+ fields: view.fieldCount,
50079
+ persistence: view.persistence,
50080
+ traits: view.traits,
50081
+ pages: view.pages,
50082
+ color,
50083
+ animated: animated && isHighlighted
50084
+ }
50085
+ )
50086
+ },
50087
+ view.name
50088
+ );
50089
+ })
50090
+ ]
50091
+ }
50092
+ )
50093
+ }
50094
+ ),
50095
+ /* @__PURE__ */ jsxRuntime.jsxs(
50096
+ Box,
50097
+ {
50098
+ position: "absolute",
50099
+ style: {
50100
+ top: 12,
50101
+ right: 12,
50102
+ display: "flex",
50103
+ flexDirection: "column",
50104
+ gap: 4,
50105
+ zIndex: 30
50106
+ },
50107
+ children: [
50108
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "secondary", size: "sm", onClick: zoomIn, title: "Zoom in", action: "COSMIC_ZOOM_IN", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "plus", size: "sm" }) }),
50109
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "secondary", size: "sm", onClick: zoomOut, title: "Zoom out", action: "COSMIC_ZOOM_OUT", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "minus", size: "sm" }) }),
50110
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "secondary", size: "sm", onClick: resetZoom, title: "Reset", action: "COSMIC_ZOOM_RESET", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "maximize", size: "sm" }) })
50111
+ ]
50112
+ }
50113
+ )
50114
+ ] }),
50115
+ state.level === "orbital" && orbitalLevelData && /* @__PURE__ */ jsxRuntime.jsxs(
50116
+ Box,
50117
+ {
50118
+ position: "absolute",
50119
+ style: {
50120
+ inset: 0,
50121
+ paddingTop: 56,
50122
+ paddingBottom: 24,
50123
+ paddingLeft: 24,
50124
+ paddingRight: 24,
50125
+ display: "flex",
50126
+ alignItems: "stretch",
50127
+ justifyContent: "center",
50128
+ gap: 24
50129
+ },
50130
+ children: [
50131
+ /* @__PURE__ */ jsxRuntime.jsx(Box, { style: { flex: 1, maxWidth: 720, display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ jsxRuntime.jsx(
50132
+ AvlOrbitalUnit,
50133
+ {
50134
+ entityName: orbitalLevelData.entity.name,
50135
+ fields: orbitalLevelData.entity.fields.length,
50136
+ persistence: orbitalLevelData.entity.persistence || "persistent",
50137
+ traits: orbitalLevelData.traits.map((t) => ({ name: t.name })),
50138
+ pages: orbitalLevelData.pages.map((p2) => ({ name: p2.name })),
50139
+ color,
50140
+ animated
50141
+ }
50142
+ ) }),
50143
+ /* @__PURE__ */ jsxRuntime.jsxs(
50144
+ Box,
50145
+ {
50146
+ style: {
50147
+ width: 220,
50148
+ padding: 12,
50149
+ display: "flex",
50150
+ flexDirection: "column",
50151
+ gap: 8,
50152
+ borderLeft: `1px solid ${color}`,
50153
+ opacity: 0.95
50154
+ },
50155
+ children: [
50156
+ /* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "small", weight: "semibold", style: { color, marginBottom: 4 }, children: [
50157
+ "Traits (",
50158
+ orbitalLevelData.traits.length,
50159
+ ")"
50160
+ ] }),
50161
+ orbitalLevelData.traits.length === 0 && /* @__PURE__ */ jsxRuntime.jsx(Text, { variant: "small", style: { opacity: 0.6, color }, children: "No traits" }),
50162
+ orbitalLevelData.traits.map((trait) => /* @__PURE__ */ jsxRuntime.jsx(
50163
+ Button,
50164
+ {
50165
+ variant: "ghost",
50166
+ size: "sm",
50167
+ onClick: () => handleTraitSelect(trait.name),
50168
+ action: "COSMIC_DRILL_TRAIT",
50169
+ children: trait.name
50170
+ },
50171
+ trait.name
50172
+ )),
50173
+ orbitalLevelData.pages.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
50174
+ /* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "small", weight: "semibold", style: { color, marginTop: 12 }, children: [
50175
+ "Pages (",
50176
+ orbitalLevelData.pages.length,
50177
+ ")"
50178
+ ] }),
50179
+ orbitalLevelData.pages.map((page) => /* @__PURE__ */ jsxRuntime.jsx(Text, { variant: "small", style: { opacity: 0.7, color }, children: page.name }, page.name))
50180
+ ] })
50181
+ ]
50182
+ }
50183
+ )
50184
+ ]
50185
+ }
50186
+ ),
50187
+ state.level === "trait" && traitLevelData && /* @__PURE__ */ jsxRuntime.jsx(
50188
+ Box,
50189
+ {
50190
+ position: "absolute",
50191
+ style: {
50192
+ inset: 0,
50193
+ paddingTop: 56,
50194
+ paddingBottom: 24,
50195
+ paddingLeft: 24,
50196
+ paddingRight: 24
50197
+ },
50198
+ children: /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 600 400", style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsxRuntime.jsx(
50199
+ AvlTraitScene,
49992
50200
  {
49993
- x: CONTENT_LEFT + 10,
49994
- y: rowY + 6,
49995
- effectType,
49996
- size: 10,
49997
- showBackground: true
50201
+ data: traitLevelData,
50202
+ color,
50203
+ onTransitionClick: (idx) => handleTransitionSelect(idx)
49998
50204
  }
49999
- ),
50000
- /* @__PURE__ */ jsxRuntime.jsx("text", { x: CONTENT_LEFT + 28, y: rowY + 10, fill: color, fontSize: 12, fontWeight: 500, opacity: 0.8, fontFamily: "inherit", children: eff.type }),
50001
- argsText && /* @__PURE__ */ jsxRuntime.jsx("text", { x: CONTENT_LEFT + 28 + eff.type.length * 7 + 8, y: rowY + 10, fill: color, fontSize: 10, fontWeight: 400, opacity: 0.5, fontFamily: "monospace", children: argsText })
50002
- ] }, `eff-${i}`);
50003
- })
50004
- ] });
50005
- })(),
50006
- hasSlots && (() => {
50007
- const secY = cardY + headerH + sectionGap + triggerH + guardH + effectsH;
50008
- return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
50009
- /* @__PURE__ */ jsxRuntime.jsx("text", { x: SECTION_LEFT, y: secY + 12, fill: color, fontSize: 10, fontWeight: 600, opacity: 0.4, fontFamily: "inherit", children: "SLOTS" }),
50010
- data.slotTargets.map((slot, i) => {
50011
- const rowY = secY + 22 + i * 22;
50012
- return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
50013
- /* @__PURE__ */ jsxRuntime.jsx("rect", { x: CONTENT_LEFT, y: rowY - 4, width: CARD_W - 56, height: 18, rx: 4, fill: color, fillOpacity: 0.04 }),
50014
- /* @__PURE__ */ jsxRuntime.jsxs("text", { x: CONTENT_LEFT + 8, y: rowY + 8, fill: color, fontSize: 11, fontFamily: "inherit", children: [
50015
- slot.name,
50016
- ": ",
50017
- slot.pattern
50018
- ] })
50019
- ] }, `slot-${i}`);
50020
- })
50021
- ] });
50022
- })()
50023
- ] });
50205
+ ) })
50206
+ }
50207
+ ),
50208
+ state.level === "transition" && transitionLevelData && /* @__PURE__ */ jsxRuntime.jsx(
50209
+ Box,
50210
+ {
50211
+ position: "absolute",
50212
+ style: {
50213
+ inset: 0,
50214
+ paddingTop: 56,
50215
+ paddingBottom: 24,
50216
+ paddingLeft: 24,
50217
+ paddingRight: 24
50218
+ },
50219
+ children: /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 600 400", style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsxRuntime.jsx(
50220
+ AvlTransitionScene,
50221
+ {
50222
+ data: transitionLevelData,
50223
+ color
50224
+ }
50225
+ ) })
50226
+ }
50227
+ )
50228
+ ]
50229
+ }
50230
+ );
50024
50231
  };
50025
- AvlTransitionScene.displayName = "AvlTransitionScene";
50232
+ AvlOrbitalsCosmicZoom.displayName = "AvlOrbitalsCosmicZoom";
50026
50233
  var AvlClickTarget = ({
50027
50234
  x,
50028
50235
  y,