@almadar/ui 5.33.1 → 5.34.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.
@@ -1,12 +1,12 @@
1
1
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
- import * as React74 from 'react';
3
- import React74__default, { useContext, useMemo, useRef, useEffect, useCallback, useState, useLayoutEffect, Suspense, lazy, createContext, useId, useSyncExternalStore } from 'react';
2
+ import * as React77 from 'react';
3
+ import React77__default, { useContext, useMemo, useRef, useEffect, useCallback, useState, Suspense, lazy, createContext, useLayoutEffect, useId, useSyncExternalStore } from 'react';
4
4
  import { clsx } from 'clsx';
5
5
  import { twMerge } from 'tailwind-merge';
6
6
  import { EventBusContext, useTraitScope, TraitScopeProvider } from '@almadar/ui/providers';
7
7
  import { createLogger, isLogLevelEnabled } from '@almadar/logger';
8
8
  import * as LucideIcons2 from 'lucide-react';
9
- import { Loader2, X, Code, FileText, WrapText, Check, Copy, HelpCircle, List, Printer, ChevronRight, ChevronLeft, CheckCircle, XCircle, Wrench, RotateCcw, Send, Lightbulb, PauseCircle, Link2, Search, ChevronUp, ChevronDown, MoreHorizontal, Bug, Package, Calendar, Pencil, Eye, Image as Image$1, Upload, ZoomIn, ArrowRight, Pause, Play, SkipForward, TrendingUp, TrendingDown, Minus, AlertCircle, Circle, Clock, CheckCircle2, Terminal, Type, Heading1, Heading2, Heading3, ListOrdered, Quote, GitBranch, Plus, Trash, ArrowLeft, Menu as Menu$1, AlertTriangle, Trash2, Eraser, ZoomOut, Download, Tag, User, DollarSign, Zap, Sword, Move, Heart, Shield } from 'lucide-react';
9
+ import { Loader2, X, List, Printer, ChevronRight, ChevronLeft, CheckCircle, XCircle, Wrench, RotateCcw, Send, Play, Terminal, Search, ChevronUp, ChevronDown, MoreHorizontal, Bug, Package, Calendar, Pencil, Eye, Image as Image$1, Upload, ZoomIn, ArrowRight, Pause, SkipForward, TrendingUp, TrendingDown, Minus, AlertCircle, Circle, Clock, CheckCircle2, Code, FileText, WrapText, Check, Copy, HelpCircle, Type, Heading1, Heading2, Heading3, ListOrdered, Quote, GitBranch, Plus, Trash, ArrowLeft, Menu as Menu$1, AlertTriangle, Trash2, Eraser, ZoomOut, Download, Lightbulb, PauseCircle, Link2, Tag, User, DollarSign, Zap, Sword, Move, Heart, Shield } from 'lucide-react';
10
10
  import * as PhosphorIcons from '@phosphor-icons/react';
11
11
  import * as TablerIcons from '@tabler/icons-react';
12
12
  import * as FaIcons from 'react-icons/fa';
@@ -230,7 +230,7 @@ var init_SvgFlow = __esm({
230
230
  width = 100,
231
231
  height = 100
232
232
  }) => {
233
- const markerId = React74__default.useMemo(() => {
233
+ const markerId = React77__default.useMemo(() => {
234
234
  flowIdCounter += 1;
235
235
  return `almadar-flow-arrow-${flowIdCounter}`;
236
236
  }, []);
@@ -823,7 +823,7 @@ var init_SvgRing = __esm({
823
823
  width = 100,
824
824
  height = 100
825
825
  }) => {
826
- const gradientId = React74__default.useMemo(() => {
826
+ const gradientId = React77__default.useMemo(() => {
827
827
  ringIdCounter += 1;
828
828
  return `almadar-ring-glow-${ringIdCounter}`;
829
829
  }, []);
@@ -1931,7 +1931,7 @@ var init_Icon = __esm({
1931
1931
  const directIcon = typeof icon === "string" ? void 0 : icon;
1932
1932
  const effectiveName = typeof icon === "string" ? icon : name;
1933
1933
  const family = useIconFamily();
1934
- const RenderedComponent = React74__default.useMemo(() => {
1934
+ const RenderedComponent = React77__default.useMemo(() => {
1935
1935
  if (directIcon) return null;
1936
1936
  return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
1937
1937
  }, [directIcon, effectiveName, family]);
@@ -1990,7 +1990,7 @@ function resolveIconProp(value, sizeClass) {
1990
1990
  const IconComp = value;
1991
1991
  return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
1992
1992
  }
1993
- if (React74__default.isValidElement(value)) {
1993
+ if (React77__default.isValidElement(value)) {
1994
1994
  return value;
1995
1995
  }
1996
1996
  if (typeof value === "object" && value !== null && "render" in value) {
@@ -2066,7 +2066,7 @@ var init_Button = __esm({
2066
2066
  md: "h-icon-default w-icon-default",
2067
2067
  lg: "h-icon-default w-icon-default"
2068
2068
  };
2069
- Button = React74__default.forwardRef(
2069
+ Button = React77__default.forwardRef(
2070
2070
  ({
2071
2071
  className,
2072
2072
  variant = "primary",
@@ -2133,7 +2133,7 @@ var init_Input = __esm({
2133
2133
  init_cn();
2134
2134
  init_Icon();
2135
2135
  init_useEventBus();
2136
- Input = React74__default.forwardRef(
2136
+ Input = React77__default.forwardRef(
2137
2137
  ({
2138
2138
  className,
2139
2139
  inputType,
@@ -2293,7 +2293,7 @@ var Label;
2293
2293
  var init_Label = __esm({
2294
2294
  "components/core/atoms/Label.tsx"() {
2295
2295
  init_cn();
2296
- Label = React74__default.forwardRef(
2296
+ Label = React77__default.forwardRef(
2297
2297
  ({ className, required, children, ...props }, ref) => {
2298
2298
  return /* @__PURE__ */ jsxs(
2299
2299
  "label",
@@ -2320,7 +2320,7 @@ var init_Textarea = __esm({
2320
2320
  "components/core/atoms/Textarea.tsx"() {
2321
2321
  init_cn();
2322
2322
  init_useEventBus();
2323
- Textarea = React74__default.forwardRef(
2323
+ Textarea = React77__default.forwardRef(
2324
2324
  ({ className, error, onChange, ...props }, ref) => {
2325
2325
  const eventBus = useEventBus();
2326
2326
  const handleChange = (e) => {
@@ -2559,7 +2559,7 @@ var init_Select = __esm({
2559
2559
  init_cn();
2560
2560
  init_Icon();
2561
2561
  init_useEventBus();
2562
- Select = React74__default.forwardRef(
2562
+ Select = React77__default.forwardRef(
2563
2563
  (props, _ref) => {
2564
2564
  const { multiple, searchable, clearable } = props;
2565
2565
  if (multiple || searchable || clearable) {
@@ -2576,7 +2576,7 @@ var init_Checkbox = __esm({
2576
2576
  "components/core/atoms/Checkbox.tsx"() {
2577
2577
  init_cn();
2578
2578
  init_useEventBus();
2579
- Checkbox = React74__default.forwardRef(
2579
+ Checkbox = React77__default.forwardRef(
2580
2580
  ({ className, label, id, onChange, ...props }, ref) => {
2581
2581
  const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
2582
2582
  const eventBus = useEventBus();
@@ -2630,7 +2630,7 @@ var init_Spinner = __esm({
2630
2630
  md: "h-6 w-6",
2631
2631
  lg: "h-8 w-8"
2632
2632
  };
2633
- Spinner = React74__default.forwardRef(
2633
+ Spinner = React77__default.forwardRef(
2634
2634
  ({ className, size = "md", overlay, ...props }, ref) => {
2635
2635
  if (overlay) {
2636
2636
  return /* @__PURE__ */ jsx(
@@ -2720,7 +2720,7 @@ var init_Card = __esm({
2720
2720
  chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
2721
2721
  "tile-image-first": "p-0 overflow-hidden"
2722
2722
  };
2723
- Card = React74__default.forwardRef(
2723
+ Card = React77__default.forwardRef(
2724
2724
  ({
2725
2725
  className,
2726
2726
  variant = "bordered",
@@ -2768,9 +2768,9 @@ var init_Card = __esm({
2768
2768
  }
2769
2769
  );
2770
2770
  Card.displayName = "Card";
2771
- CardHeader = React74__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
2771
+ CardHeader = React77__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
2772
2772
  CardHeader.displayName = "CardHeader";
2773
- CardTitle = React74__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2773
+ CardTitle = React77__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2774
2774
  "h3",
2775
2775
  {
2776
2776
  ref,
@@ -2783,11 +2783,11 @@ var init_Card = __esm({
2783
2783
  }
2784
2784
  ));
2785
2785
  CardTitle.displayName = "CardTitle";
2786
- CardContent = React74__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
2786
+ CardContent = React77__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
2787
2787
  CardContent.displayName = "CardContent";
2788
2788
  CardBody = CardContent;
2789
2789
  CardBody.displayName = "CardBody";
2790
- CardFooter = React74__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2790
+ CardFooter = React77__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2791
2791
  "div",
2792
2792
  {
2793
2793
  ref,
@@ -2840,7 +2840,7 @@ var init_Badge = __esm({
2840
2840
  md: "px-2.5 py-1 text-sm",
2841
2841
  lg: "px-3 py-1.5 text-base"
2842
2842
  };
2843
- Badge = React74__default.forwardRef(
2843
+ Badge = React77__default.forwardRef(
2844
2844
  ({ className, variant = "default", size = "sm", amount, label, icon, children, onRemove, removeLabel, ...props }, ref) => {
2845
2845
  const iconSizes3 = {
2846
2846
  sm: "h-icon-default w-icon-default",
@@ -2933,7 +2933,7 @@ var init_FilterPill = __esm({
2933
2933
  md: "w-3.5 h-3.5",
2934
2934
  lg: "w-4 h-4"
2935
2935
  };
2936
- FilterPill = React74__default.forwardRef(
2936
+ FilterPill = React77__default.forwardRef(
2937
2937
  ({
2938
2938
  className,
2939
2939
  variant = "default",
@@ -3062,8 +3062,8 @@ var init_Avatar = __esm({
3062
3062
  actionPayload
3063
3063
  }) => {
3064
3064
  const eventBus = useEventBus();
3065
- const [imgFailed, setImgFailed] = React74__default.useState(false);
3066
- React74__default.useEffect(() => {
3065
+ const [imgFailed, setImgFailed] = React77__default.useState(false);
3066
+ React77__default.useEffect(() => {
3067
3067
  setImgFailed(false);
3068
3068
  }, [src]);
3069
3069
  const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
@@ -3267,7 +3267,7 @@ var init_Box = __esm({
3267
3267
  fixed: "fixed",
3268
3268
  sticky: "sticky"
3269
3269
  };
3270
- Box = React74__default.forwardRef(
3270
+ Box = React77__default.forwardRef(
3271
3271
  ({
3272
3272
  padding,
3273
3273
  paddingX,
@@ -3317,7 +3317,7 @@ var init_Box = __esm({
3317
3317
  onMouseLeave?.(e);
3318
3318
  }, [hoverEvent, eventBus, onMouseLeave]);
3319
3319
  const isClickable = action || onClick;
3320
- return React74__default.createElement(
3320
+ return React77__default.createElement(
3321
3321
  Component,
3322
3322
  {
3323
3323
  ref,
@@ -3642,7 +3642,7 @@ var init_Radio = __esm({
3642
3642
  md: "w-2.5 h-2.5",
3643
3643
  lg: "w-3 h-3"
3644
3644
  };
3645
- Radio = React74__default.forwardRef(
3645
+ Radio = React77__default.forwardRef(
3646
3646
  ({
3647
3647
  label,
3648
3648
  helperText,
@@ -3659,12 +3659,12 @@ var init_Radio = __esm({
3659
3659
  onChange,
3660
3660
  ...props
3661
3661
  }, ref) => {
3662
- const reactId = React74__default.useId();
3662
+ const reactId = React77__default.useId();
3663
3663
  const baseId = id || `radio-${reactId}`;
3664
3664
  const hasError = !!error;
3665
3665
  const eventBus = useEventBus();
3666
- const [selected, setSelected] = React74__default.useState(value);
3667
- React74__default.useEffect(() => {
3666
+ const [selected, setSelected] = React77__default.useState(value);
3667
+ React77__default.useEffect(() => {
3668
3668
  if (value !== void 0) setSelected(value);
3669
3669
  }, [value]);
3670
3670
  const pick = (next, e) => {
@@ -3846,7 +3846,7 @@ var init_Switch = __esm({
3846
3846
  "components/core/atoms/Switch.tsx"() {
3847
3847
  "use client";
3848
3848
  init_cn();
3849
- Switch = React74.forwardRef(
3849
+ Switch = React77.forwardRef(
3850
3850
  ({
3851
3851
  checked,
3852
3852
  defaultChecked = false,
@@ -3857,10 +3857,10 @@ var init_Switch = __esm({
3857
3857
  name,
3858
3858
  className
3859
3859
  }, ref) => {
3860
- const [isChecked, setIsChecked] = React74.useState(
3860
+ const [isChecked, setIsChecked] = React77.useState(
3861
3861
  checked !== void 0 ? checked : defaultChecked
3862
3862
  );
3863
- React74.useEffect(() => {
3863
+ React77.useEffect(() => {
3864
3864
  if (checked !== void 0) {
3865
3865
  setIsChecked(checked);
3866
3866
  }
@@ -4689,7 +4689,7 @@ var Dialog;
4689
4689
  var init_Dialog = __esm({
4690
4690
  "components/core/atoms/Dialog.tsx"() {
4691
4691
  init_cn();
4692
- Dialog = React74__default.forwardRef(
4692
+ Dialog = React77__default.forwardRef(
4693
4693
  ({
4694
4694
  role = "dialog",
4695
4695
  "aria-modal": ariaModal = true,
@@ -4715,7 +4715,7 @@ var Aside;
4715
4715
  var init_Aside = __esm({
4716
4716
  "components/core/atoms/Aside.tsx"() {
4717
4717
  init_cn();
4718
- Aside = React74__default.forwardRef(
4718
+ Aside = React77__default.forwardRef(
4719
4719
  ({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
4720
4720
  );
4721
4721
  Aside.displayName = "Aside";
@@ -4793,8 +4793,8 @@ var init_LawReferenceTooltip = __esm({
4793
4793
  className
4794
4794
  }) => {
4795
4795
  const { t } = useTranslate();
4796
- const [isVisible, setIsVisible] = React74__default.useState(false);
4797
- const timeoutRef = React74__default.useRef(null);
4796
+ const [isVisible, setIsVisible] = React77__default.useState(false);
4797
+ const timeoutRef = React77__default.useRef(null);
4798
4798
  const handleMouseEnter = () => {
4799
4799
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
4800
4800
  timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
@@ -4803,7 +4803,7 @@ var init_LawReferenceTooltip = __esm({
4803
4803
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
4804
4804
  setIsVisible(false);
4805
4805
  };
4806
- React74__default.useEffect(() => {
4806
+ React77__default.useEffect(() => {
4807
4807
  return () => {
4808
4808
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
4809
4809
  };
@@ -5013,7 +5013,7 @@ var init_StatusDot = __esm({
5013
5013
  md: "w-2.5 h-2.5",
5014
5014
  lg: "w-3 h-3"
5015
5015
  };
5016
- StatusDot = React74__default.forwardRef(
5016
+ StatusDot = React77__default.forwardRef(
5017
5017
  ({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
5018
5018
  return /* @__PURE__ */ jsx(
5019
5019
  "span",
@@ -5067,7 +5067,7 @@ var init_TrendIndicator = __esm({
5067
5067
  down: "trending-down",
5068
5068
  flat: "arrow-right"
5069
5069
  };
5070
- TrendIndicator = React74__default.forwardRef(
5070
+ TrendIndicator = React77__default.forwardRef(
5071
5071
  ({
5072
5072
  className,
5073
5073
  value,
@@ -5134,7 +5134,7 @@ var init_RangeSlider = __esm({
5134
5134
  md: "w-4 h-4",
5135
5135
  lg: "w-5 h-5"
5136
5136
  };
5137
- RangeSlider = React74__default.forwardRef(
5137
+ RangeSlider = React77__default.forwardRef(
5138
5138
  ({
5139
5139
  className,
5140
5140
  min = 0,
@@ -5730,7 +5730,7 @@ var init_ContentSection = __esm({
5730
5730
  md: "py-16",
5731
5731
  lg: "py-24"
5732
5732
  };
5733
- ContentSection = React74__default.forwardRef(
5733
+ ContentSection = React77__default.forwardRef(
5734
5734
  ({ children, background = "default", padding = "lg", id, className }, ref) => {
5735
5735
  return /* @__PURE__ */ jsx(
5736
5736
  Box,
@@ -6264,7 +6264,7 @@ var init_AnimatedReveal = __esm({
6264
6264
  "scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
6265
6265
  "none": {}
6266
6266
  };
6267
- AnimatedReveal = React74__default.forwardRef(
6267
+ AnimatedReveal = React77__default.forwardRef(
6268
6268
  ({
6269
6269
  trigger = "scroll",
6270
6270
  animation = "fade-up",
@@ -6424,7 +6424,7 @@ var init_AnimatedGraphic = __esm({
6424
6424
  "components/marketing/atoms/AnimatedGraphic.tsx"() {
6425
6425
  "use client";
6426
6426
  init_cn();
6427
- AnimatedGraphic = React74__default.forwardRef(
6427
+ AnimatedGraphic = React77__default.forwardRef(
6428
6428
  ({
6429
6429
  src,
6430
6430
  svgContent,
@@ -6447,7 +6447,7 @@ var init_AnimatedGraphic = __esm({
6447
6447
  const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
6448
6448
  const resolvedSvg = svgContent ?? fetchedSvg;
6449
6449
  const prevAnimateRef = useRef(animate);
6450
- const setRef = React74__default.useCallback(
6450
+ const setRef = React77__default.useCallback(
6451
6451
  (node) => {
6452
6452
  containerRef.current = node;
6453
6453
  if (typeof ref === "function") ref(node);
@@ -7129,7 +7129,7 @@ var init_ErrorBoundary = __esm({
7129
7129
  }
7130
7130
  );
7131
7131
  };
7132
- ErrorBoundary = class extends React74__default.Component {
7132
+ ErrorBoundary = class extends React77__default.Component {
7133
7133
  constructor(props) {
7134
7134
  super(props);
7135
7135
  __publicField(this, "reset", () => {
@@ -8236,9 +8236,9 @@ function ControlButton({
8236
8236
  className
8237
8237
  }) {
8238
8238
  const eventBus = useEventBus();
8239
- const [isPressed, setIsPressed] = React74.useState(false);
8239
+ const [isPressed, setIsPressed] = React77.useState(false);
8240
8240
  const actualPressed = pressed ?? isPressed;
8241
- const handlePointerDown = React74.useCallback(
8241
+ const handlePointerDown = React77.useCallback(
8242
8242
  (e) => {
8243
8243
  e.preventDefault();
8244
8244
  if (disabled) return;
@@ -8248,7 +8248,7 @@ function ControlButton({
8248
8248
  },
8249
8249
  [disabled, pressEvent, eventBus, onPress]
8250
8250
  );
8251
- const handlePointerUp = React74.useCallback(
8251
+ const handlePointerUp = React77.useCallback(
8252
8252
  (e) => {
8253
8253
  e.preventDefault();
8254
8254
  if (disabled) return;
@@ -8258,7 +8258,7 @@ function ControlButton({
8258
8258
  },
8259
8259
  [disabled, releaseEvent, eventBus, onRelease]
8260
8260
  );
8261
- const handlePointerLeave = React74.useCallback(
8261
+ const handlePointerLeave = React77.useCallback(
8262
8262
  (e) => {
8263
8263
  if (isPressed) {
8264
8264
  setIsPressed(false);
@@ -8338,8 +8338,8 @@ function ActionButtons({
8338
8338
  disabled
8339
8339
  }) {
8340
8340
  const eventBus = useEventBus();
8341
- const [activeButtons, setActiveButtons] = React74.useState(/* @__PURE__ */ new Set());
8342
- const handlePress = React74.useCallback(
8341
+ const [activeButtons, setActiveButtons] = React77.useState(/* @__PURE__ */ new Set());
8342
+ const handlePress = React77.useCallback(
8343
8343
  (id) => {
8344
8344
  setActiveButtons((prev) => new Set(prev).add(id));
8345
8345
  if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
@@ -8347,7 +8347,7 @@ function ActionButtons({
8347
8347
  },
8348
8348
  [actionEvent, eventBus, onAction]
8349
8349
  );
8350
- const handleRelease = React74.useCallback(
8350
+ const handleRelease = React77.useCallback(
8351
8351
  (id) => {
8352
8352
  setActiveButtons((prev) => {
8353
8353
  const next = new Set(prev);
@@ -8543,6 +8543,85 @@ var init_ActionPalette = __esm({
8543
8543
  ActionPalette.displayName = "ActionPalette";
8544
8544
  }
8545
8545
  });
8546
+ var ActivationBlock;
8547
+ var init_ActivationBlock = __esm({
8548
+ "components/core/molecules/ActivationBlock.tsx"() {
8549
+ "use client";
8550
+ init_useEventBus();
8551
+ init_cn();
8552
+ ActivationBlock = ({
8553
+ question,
8554
+ savedResponse,
8555
+ saveEvent = "SAVE_ACTIVATION",
8556
+ className
8557
+ }) => {
8558
+ const [response, setResponse] = useState(savedResponse ?? "");
8559
+ const [isExpanded, setIsExpanded] = useState(!savedResponse);
8560
+ const { emit } = useEventBus();
8561
+ const handleSubmit = () => {
8562
+ emit(`UI:${saveEvent}`, { response });
8563
+ setIsExpanded(false);
8564
+ };
8565
+ return /* @__PURE__ */ jsx(
8566
+ "div",
8567
+ {
8568
+ className: cn(
8569
+ "bg-indigo-50 dark:bg-indigo-900/20 border-2 border-indigo-200 dark:border-indigo-800 rounded-lg p-5 mb-6",
8570
+ className
8571
+ ),
8572
+ children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
8573
+ /* @__PURE__ */ jsx(Lightbulb, { className: "text-indigo-600 dark:text-indigo-400 flex-shrink-0 mt-1", size: 24 }),
8574
+ /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
8575
+ /* @__PURE__ */ jsx("h4", { className: "font-semibold text-indigo-900 dark:text-indigo-100 mb-2", children: "Before You Begin..." }),
8576
+ /* @__PURE__ */ jsx("p", { className: "text-gray-700 dark:text-gray-300 mb-3 text-sm md:text-base", children: question }),
8577
+ isExpanded ? /* @__PURE__ */ jsxs(Fragment, { children: [
8578
+ /* @__PURE__ */ jsx(
8579
+ "textarea",
8580
+ {
8581
+ className: "w-full p-3 border border-indigo-300 dark:border-indigo-700 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:ring-2 focus:ring-indigo-500 focus:border-transparent text-sm",
8582
+ placeholder: "Jot down your thoughts...",
8583
+ value: response,
8584
+ onChange: (e) => setResponse(e.target.value),
8585
+ rows: 3
8586
+ }
8587
+ ),
8588
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-2 mt-3", children: [
8589
+ /* @__PURE__ */ jsx(
8590
+ "button",
8591
+ {
8592
+ onClick: handleSubmit,
8593
+ className: "px-4 py-2 bg-indigo-600 text-white rounded-md hover:bg-indigo-700 text-sm font-medium transition-colors",
8594
+ children: "Continue to Lesson \u2192"
8595
+ }
8596
+ ),
8597
+ /* @__PURE__ */ jsx(
8598
+ "button",
8599
+ {
8600
+ onClick: () => {
8601
+ emit(`UI:${saveEvent}`, { response: "" });
8602
+ setIsExpanded(false);
8603
+ },
8604
+ className: "px-4 py-2 text-indigo-600 dark:text-indigo-400 hover:underline text-sm",
8605
+ children: "Skip for now"
8606
+ }
8607
+ )
8608
+ ] })
8609
+ ] }) : /* @__PURE__ */ jsx(
8610
+ "button",
8611
+ {
8612
+ onClick: () => setIsExpanded(true),
8613
+ className: "text-sm text-indigo-600 dark:text-indigo-400 hover:underline font-medium",
8614
+ children: "\u2713 Answered \xB7 Edit response"
8615
+ }
8616
+ )
8617
+ ] })
8618
+ ] })
8619
+ }
8620
+ );
8621
+ };
8622
+ ActivationBlock.displayName = "ActivationBlock";
8623
+ }
8624
+ });
8546
8625
  var variantBorderClasses, variantIconColors, iconMap2, Alert;
8547
8626
  var init_Alert = __esm({
8548
8627
  "components/core/molecules/Alert.tsx"() {
@@ -11467,102 +11546,6 @@ var init_BehaviorView = __esm({
11467
11546
  BehaviorView.displayName = "BehaviorView";
11468
11547
  }
11469
11548
  });
11470
- var MIN_DIAGRAM_WIDTH, ScaledDiagram;
11471
- var init_ScaledDiagram = __esm({
11472
- "components/core/molecules/ScaledDiagram.tsx"() {
11473
- init_Box();
11474
- init_cn();
11475
- MIN_DIAGRAM_WIDTH = 200;
11476
- ScaledDiagram = ({
11477
- children,
11478
- className
11479
- }) => {
11480
- const { t: _t } = useTranslate();
11481
- const wrapperRef = useRef(null);
11482
- const contentRef = useRef(null);
11483
- const [layout, setLayout] = useState(null);
11484
- const measure = useCallback(() => {
11485
- const wrapper = wrapperRef.current;
11486
- const content = contentRef.current;
11487
- if (!wrapper || !content) return;
11488
- const containerW = wrapper.clientWidth;
11489
- if (containerW <= 0) return;
11490
- let diagramW = 0;
11491
- let diagramH = 0;
11492
- const children2 = content.children;
11493
- for (let i = 0; i < children2.length; i++) {
11494
- const child = children2[i];
11495
- const w = child.style?.width;
11496
- const h = child.style?.height;
11497
- if (w && /^\d+/.test(w) && h && /^\d+/.test(h)) {
11498
- diagramW = parseFloat(w);
11499
- diagramH = parseFloat(h);
11500
- break;
11501
- }
11502
- if (child.offsetWidth > MIN_DIAGRAM_WIDTH) {
11503
- diagramW = child.offsetWidth;
11504
- diagramH = child.offsetHeight;
11505
- break;
11506
- }
11507
- }
11508
- if (diagramW < MIN_DIAGRAM_WIDTH || diagramH <= 0) {
11509
- setLayout(null);
11510
- return;
11511
- }
11512
- const s = Math.min(1, containerW / diagramW);
11513
- setLayout({ scale: s, height: diagramH * s });
11514
- }, []);
11515
- useEffect(() => {
11516
- const content = contentRef.current;
11517
- if (!content) return;
11518
- let raf1 = requestAnimationFrame(() => {
11519
- requestAnimationFrame(() => measure());
11520
- });
11521
- const mo = new MutationObserver(() => {
11522
- requestAnimationFrame(() => measure());
11523
- });
11524
- mo.observe(content, { childList: true, subtree: true, attributes: true });
11525
- return () => {
11526
- cancelAnimationFrame(raf1);
11527
- mo.disconnect();
11528
- };
11529
- }, [measure, children]);
11530
- useEffect(() => {
11531
- const wrapper = wrapperRef.current;
11532
- if (!wrapper) return;
11533
- const ro = new ResizeObserver(() => measure());
11534
- ro.observe(wrapper);
11535
- return () => ro.disconnect();
11536
- }, [measure]);
11537
- const hasLayout = layout !== null;
11538
- return /* @__PURE__ */ jsx(
11539
- Box,
11540
- {
11541
- ref: wrapperRef,
11542
- className: cn("w-full", className),
11543
- style: {
11544
- // Only clip overflow once we have a valid measurement
11545
- overflow: hasLayout ? "hidden" : void 0,
11546
- height: hasLayout ? layout.height : void 0
11547
- },
11548
- children: /* @__PURE__ */ jsx(
11549
- Box,
11550
- {
11551
- ref: contentRef,
11552
- style: {
11553
- width: "max-content",
11554
- transformOrigin: "top left",
11555
- transform: hasLayout && layout.scale < 1 ? `scale(${layout.scale})` : void 0
11556
- },
11557
- children
11558
- }
11559
- )
11560
- }
11561
- );
11562
- };
11563
- ScaledDiagram.displayName = "ScaledDiagram";
11564
- }
11565
- });
11566
11549
 
11567
11550
  // node_modules/katex/dist/katex.min.css
11568
11551
  var init_katex_min = __esm({
@@ -12002,7 +11985,7 @@ var init_CodeBlock = __esm({
12002
11985
  };
12003
11986
  LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
12004
11987
  HIDDEN_LINE_NUMBERS = { display: "none" };
12005
- CodeBlock = React74__default.memo(
11988
+ CodeBlock = React77__default.memo(
12006
11989
  ({
12007
11990
  code: rawCode,
12008
11991
  language = "text",
@@ -12589,7 +12572,7 @@ var init_MarkdownContent = __esm({
12589
12572
  init_Box();
12590
12573
  init_CodeBlock();
12591
12574
  init_cn();
12592
- MarkdownContent = React74__default.memo(
12575
+ MarkdownContent = React77__default.memo(
12593
12576
  ({ content, direction = "ltr", className }) => {
12594
12577
  const { t: _t } = useTranslate();
12595
12578
  const safeContent = typeof content === "string" ? content : String(content ?? "");
@@ -12754,6 +12737,227 @@ var init_MarkdownContent = __esm({
12754
12737
  MarkdownContent.displayName = "MarkdownContent";
12755
12738
  }
12756
12739
  });
12740
+
12741
+ // components/core/molecules/lessonSegmentUtils.ts
12742
+ function parseMarkdownWithCodeBlocks(content) {
12743
+ const segments = [];
12744
+ const codeBlockRegex = /```([\w-]+)?(?:\s+(run))?\n([\s\S]*?)```/g;
12745
+ let lastIndex = 0;
12746
+ let match;
12747
+ while ((match = codeBlockRegex.exec(content)) !== null) {
12748
+ const before = content.slice(lastIndex, match.index);
12749
+ if (before.trim()) {
12750
+ segments.push({ type: "markdown", content: before });
12751
+ }
12752
+ const rawLanguage = match[1] ?? "text";
12753
+ const runModifier = !!match[2];
12754
+ const suffixRunnable = rawLanguage.endsWith("-runnable");
12755
+ const runnable = runModifier || suffixRunnable;
12756
+ const baseLanguage = suffixRunnable ? rawLanguage.slice(0, -"-runnable".length) || "text" : rawLanguage;
12757
+ segments.push({ type: "code", language: baseLanguage, content: match[3].trim(), runnable });
12758
+ lastIndex = codeBlockRegex.lastIndex;
12759
+ }
12760
+ const remaining = content.slice(lastIndex);
12761
+ if (remaining.trim()) {
12762
+ segments.push({ type: "markdown", content: remaining });
12763
+ }
12764
+ return segments;
12765
+ }
12766
+ var init_lessonSegmentUtils = __esm({
12767
+ "components/core/molecules/lessonSegmentUtils.ts"() {
12768
+ }
12769
+ });
12770
+ var BLOOM_CONFIG, BloomQuizBlock;
12771
+ var init_BloomQuizBlock = __esm({
12772
+ "components/core/molecules/BloomQuizBlock.tsx"() {
12773
+ "use client";
12774
+ init_MarkdownContent();
12775
+ init_CodeBlock();
12776
+ init_lessonSegmentUtils();
12777
+ init_useEventBus();
12778
+ init_cn();
12779
+ BLOOM_CONFIG = {
12780
+ remember: { color: "bg-gray-500", bgColor: "bg-gray-50 dark:bg-gray-900/30", label: "Remember" },
12781
+ understand: { color: "bg-blue-500", bgColor: "bg-blue-50 dark:bg-blue-900/30", label: "Understand" },
12782
+ apply: { color: "bg-green-500", bgColor: "bg-green-50 dark:bg-green-900/30", label: "Apply" },
12783
+ analyze: { color: "bg-yellow-500", bgColor: "bg-yellow-50 dark:bg-yellow-900/30", label: "Analyze" },
12784
+ evaluate: { color: "bg-orange-500", bgColor: "bg-orange-50 dark:bg-orange-900/30", label: "Evaluate" },
12785
+ create: { color: "bg-purple-500", bgColor: "bg-purple-50 dark:bg-purple-900/30", label: "Create" }
12786
+ };
12787
+ BloomQuizBlock = ({
12788
+ level,
12789
+ question,
12790
+ answer,
12791
+ index,
12792
+ isAnswered,
12793
+ answerEvent = "ANSWER_BLOOM",
12794
+ className
12795
+ }) => {
12796
+ const [revealed, setRevealed] = useState(false);
12797
+ const config = BLOOM_CONFIG[level];
12798
+ const { emit } = useEventBus();
12799
+ const questionSegments = useMemo(() => parseMarkdownWithCodeBlocks(question), [question]);
12800
+ const answerSegments = useMemo(() => parseMarkdownWithCodeBlocks(answer), [answer]);
12801
+ const handleReveal = () => {
12802
+ if (!revealed) {
12803
+ emit(`UI:${answerEvent}`, { index: index ?? 0, level });
12804
+ }
12805
+ setRevealed(!revealed);
12806
+ };
12807
+ return /* @__PURE__ */ jsxs(
12808
+ "div",
12809
+ {
12810
+ className: cn(
12811
+ "rounded-lg border border-indigo-100 dark:border-indigo-800 p-4 my-4 transition-all",
12812
+ config.bgColor,
12813
+ className
12814
+ ),
12815
+ children: [
12816
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-3", children: [
12817
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [
12818
+ index !== void 0 && /* @__PURE__ */ jsxs("span", { className: "text-gray-500 dark:text-gray-400 font-medium text-sm", children: [
12819
+ "Question ",
12820
+ index + 1
12821
+ ] }),
12822
+ /* @__PURE__ */ jsx("span", { className: cn(config.color, "text-white text-xs px-2 py-1 rounded-full font-medium"), children: config.label })
12823
+ ] }),
12824
+ isAnswered && /* @__PURE__ */ jsx(CheckCircle, { className: "text-green-600 dark:text-green-400 flex-shrink-0", size: 20 })
12825
+ ] }),
12826
+ /* @__PURE__ */ jsx("div", { className: "font-semibold text-indigo-900 dark:text-indigo-200 mb-3 space-y-2", children: questionSegments.map(
12827
+ (segment, idx) => segment.type === "markdown" ? /* @__PURE__ */ jsx(MarkdownContent, { content: segment.content }, `q-md-${idx}`) : /* @__PURE__ */ jsx(
12828
+ CodeBlock,
12829
+ {
12830
+ language: segment.language ?? "text",
12831
+ code: segment.content
12832
+ },
12833
+ `q-code-${idx}`
12834
+ )
12835
+ ) }),
12836
+ /* @__PURE__ */ jsx(
12837
+ "button",
12838
+ {
12839
+ type: "button",
12840
+ className: "inline-flex items-center rounded-md bg-indigo-600 dark:bg-indigo-500 px-3 py-1.5 text-sm font-medium text-white hover:bg-indigo-700 dark:hover:bg-indigo-600 transition-colors",
12841
+ onClick: handleReveal,
12842
+ children: revealed ? "Hide Answer" : "Reveal Answer"
12843
+ }
12844
+ ),
12845
+ revealed && /* @__PURE__ */ jsxs("div", { className: "rounded-lg bg-white/80 dark:bg-gray-800/80 p-3 text-sm text-slate-800 dark:text-gray-200 shadow-sm border border-indigo-100 dark:border-indigo-800 mt-3 space-y-2", children: [
12846
+ /* @__PURE__ */ jsx("div", { className: "text-xs text-gray-600 dark:text-gray-400 mb-1 font-medium uppercase tracking-wide", children: "Answer:" }),
12847
+ answerSegments.map(
12848
+ (segment, idx) => segment.type === "markdown" ? /* @__PURE__ */ jsx(MarkdownContent, { content: segment.content }, `a-md-${idx}`) : /* @__PURE__ */ jsx(
12849
+ CodeBlock,
12850
+ {
12851
+ language: segment.language ?? "text",
12852
+ code: segment.content
12853
+ },
12854
+ `a-code-${idx}`
12855
+ )
12856
+ )
12857
+ ] })
12858
+ ]
12859
+ }
12860
+ );
12861
+ };
12862
+ BloomQuizBlock.displayName = "BloomQuizBlock";
12863
+ }
12864
+ });
12865
+ var MIN_DIAGRAM_WIDTH, ScaledDiagram;
12866
+ var init_ScaledDiagram = __esm({
12867
+ "components/core/molecules/ScaledDiagram.tsx"() {
12868
+ init_Box();
12869
+ init_cn();
12870
+ MIN_DIAGRAM_WIDTH = 200;
12871
+ ScaledDiagram = ({
12872
+ children,
12873
+ className
12874
+ }) => {
12875
+ const { t: _t } = useTranslate();
12876
+ const wrapperRef = useRef(null);
12877
+ const contentRef = useRef(null);
12878
+ const [layout, setLayout] = useState(null);
12879
+ const measure = useCallback(() => {
12880
+ const wrapper = wrapperRef.current;
12881
+ const content = contentRef.current;
12882
+ if (!wrapper || !content) return;
12883
+ const containerW = wrapper.clientWidth;
12884
+ if (containerW <= 0) return;
12885
+ let diagramW = 0;
12886
+ let diagramH = 0;
12887
+ const children2 = content.children;
12888
+ for (let i = 0; i < children2.length; i++) {
12889
+ const child = children2[i];
12890
+ const w = child.style?.width;
12891
+ const h = child.style?.height;
12892
+ if (w && /^\d+/.test(w) && h && /^\d+/.test(h)) {
12893
+ diagramW = parseFloat(w);
12894
+ diagramH = parseFloat(h);
12895
+ break;
12896
+ }
12897
+ if (child.offsetWidth > MIN_DIAGRAM_WIDTH) {
12898
+ diagramW = child.offsetWidth;
12899
+ diagramH = child.offsetHeight;
12900
+ break;
12901
+ }
12902
+ }
12903
+ if (diagramW < MIN_DIAGRAM_WIDTH || diagramH <= 0) {
12904
+ setLayout(null);
12905
+ return;
12906
+ }
12907
+ const s = Math.min(1, containerW / diagramW);
12908
+ setLayout({ scale: s, height: diagramH * s });
12909
+ }, []);
12910
+ useEffect(() => {
12911
+ const content = contentRef.current;
12912
+ if (!content) return;
12913
+ let raf1 = requestAnimationFrame(() => {
12914
+ requestAnimationFrame(() => measure());
12915
+ });
12916
+ const mo = new MutationObserver(() => {
12917
+ requestAnimationFrame(() => measure());
12918
+ });
12919
+ mo.observe(content, { childList: true, subtree: true, attributes: true });
12920
+ return () => {
12921
+ cancelAnimationFrame(raf1);
12922
+ mo.disconnect();
12923
+ };
12924
+ }, [measure, children]);
12925
+ useEffect(() => {
12926
+ const wrapper = wrapperRef.current;
12927
+ if (!wrapper) return;
12928
+ const ro = new ResizeObserver(() => measure());
12929
+ ro.observe(wrapper);
12930
+ return () => ro.disconnect();
12931
+ }, [measure]);
12932
+ const hasLayout = layout !== null;
12933
+ return /* @__PURE__ */ jsx(
12934
+ Box,
12935
+ {
12936
+ ref: wrapperRef,
12937
+ className: cn("w-full", className),
12938
+ style: {
12939
+ // Only clip overflow once we have a valid measurement
12940
+ overflow: hasLayout ? "hidden" : void 0,
12941
+ height: hasLayout ? layout.height : void 0
12942
+ },
12943
+ children: /* @__PURE__ */ jsx(
12944
+ Box,
12945
+ {
12946
+ ref: contentRef,
12947
+ style: {
12948
+ width: "max-content",
12949
+ transformOrigin: "top left",
12950
+ transform: hasLayout && layout.scale < 1 ? `scale(${layout.scale})` : void 0
12951
+ },
12952
+ children
12953
+ }
12954
+ )
12955
+ }
12956
+ );
12957
+ };
12958
+ ScaledDiagram.displayName = "ScaledDiagram";
12959
+ }
12960
+ });
12757
12961
  function useLongPress(onLongPress, options = {}) {
12758
12962
  const { duration = 500, moveThreshold = 10 } = options;
12759
12963
  const timerRef = useRef(null);
@@ -13685,7 +13889,7 @@ var init_StateMachineView = __esm({
13685
13889
  style: { top: title ? 30 : 0 },
13686
13890
  children: [
13687
13891
  entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
13688
- states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React74__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
13892
+ states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React77__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
13689
13893
  StateNode,
13690
13894
  {
13691
13895
  state,
@@ -14400,7 +14604,7 @@ function tryParseOrbitalSchema(code) {
14400
14604
  }
14401
14605
  return null;
14402
14606
  }
14403
- function parseMarkdownWithCodeBlocks(content) {
14607
+ function parseMarkdownWithCodeBlocks2(content) {
14404
14608
  if (!content) return [];
14405
14609
  const segments = [];
14406
14610
  const codeBlockRegex = /```(\w+)?\n([\s\S]*?)```/g;
@@ -14439,7 +14643,7 @@ function parseContentSegments(content) {
14439
14643
  while ((match = tagRegex.exec(content)) !== null) {
14440
14644
  const before = content.slice(lastIndex, match.index);
14441
14645
  if (before.trim()) {
14442
- segments.push(...parseMarkdownWithCodeBlocks(before));
14646
+ segments.push(...parseMarkdownWithCodeBlocks2(before));
14443
14647
  }
14444
14648
  segments.push({
14445
14649
  type: "quiz",
@@ -14450,7 +14654,7 @@ function parseContentSegments(content) {
14450
14654
  }
14451
14655
  const remaining = content.slice(lastIndex);
14452
14656
  if (remaining.trim()) {
14453
- segments.push(...parseMarkdownWithCodeBlocks(remaining));
14657
+ segments.push(...parseMarkdownWithCodeBlocks2(remaining));
14454
14658
  }
14455
14659
  return segments;
14456
14660
  }
@@ -19520,6 +19724,169 @@ var init_ClassifierBoard = __esm({
19520
19724
  ClassifierBoard.displayName = "ClassifierBoard";
19521
19725
  }
19522
19726
  });
19727
+ var CodeRunnerPanel;
19728
+ var init_CodeRunnerPanel = __esm({
19729
+ "components/core/organisms/CodeRunnerPanel.tsx"() {
19730
+ "use client";
19731
+ init_Box();
19732
+ init_Button();
19733
+ init_Badge();
19734
+ init_Typography();
19735
+ init_Stack();
19736
+ init_CodeBlock();
19737
+ init_useEventBus();
19738
+ init_cn();
19739
+ CodeRunnerPanel = ({
19740
+ code: initialCode,
19741
+ language,
19742
+ runnable = true,
19743
+ onRun,
19744
+ runEvent = "RUN_CODE",
19745
+ className
19746
+ }) => {
19747
+ const eventBus = useEventBus();
19748
+ const { t } = useTranslate();
19749
+ const [code, setCode] = useState(initialCode);
19750
+ const [output, setOutput] = useState(null);
19751
+ const [error, setError] = useState(null);
19752
+ const [isRunning, setIsRunning] = useState(false);
19753
+ const handleRun = useCallback(async () => {
19754
+ if (!onRun) return;
19755
+ setIsRunning(true);
19756
+ setError(null);
19757
+ setOutput(null);
19758
+ try {
19759
+ const result = await onRun(code);
19760
+ setOutput(result);
19761
+ eventBus.emit(`UI:${runEvent}`, { language, exitCode: result.exitCode });
19762
+ } catch (err) {
19763
+ const message = err instanceof Error ? err.message : t("common.error");
19764
+ setError(message);
19765
+ eventBus.emit(`UI:${runEvent}`, { language, exitCode: 1, error: message });
19766
+ } finally {
19767
+ setIsRunning(false);
19768
+ }
19769
+ }, [code, language, onRun, runEvent, eventBus, t]);
19770
+ const handleReset = useCallback(() => {
19771
+ setCode(initialCode);
19772
+ setOutput(null);
19773
+ setError(null);
19774
+ }, [initialCode]);
19775
+ if (!runnable || !onRun) {
19776
+ return /* @__PURE__ */ jsx(Box, { className, children: /* @__PURE__ */ jsx(CodeBlock, { language, code }) });
19777
+ }
19778
+ const hasOutput = output !== null || error !== null;
19779
+ return /* @__PURE__ */ jsxs(Box, { className: cn("space-y-3", className), children: [
19780
+ /* @__PURE__ */ jsx(
19781
+ CodeBlock,
19782
+ {
19783
+ language,
19784
+ code,
19785
+ editable: true,
19786
+ onChange: setCode,
19787
+ showLanguageBadge: true,
19788
+ showCopyButton: true
19789
+ }
19790
+ ),
19791
+ /* @__PURE__ */ jsxs(HStack, { gap: "sm", justify: "between", children: [
19792
+ /* @__PURE__ */ jsxs(HStack, { gap: "sm", children: [
19793
+ /* @__PURE__ */ jsx(
19794
+ Button,
19795
+ {
19796
+ variant: "primary",
19797
+ size: "sm",
19798
+ onClick: handleRun,
19799
+ disabled: isRunning,
19800
+ className: "min-w-[5rem]",
19801
+ children: isRunning ? /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-2", children: [
19802
+ /* @__PURE__ */ jsx(RotateCcw, { size: 16, className: "animate-spin" }),
19803
+ t("common.loading")
19804
+ ] }) : /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-2", children: [
19805
+ /* @__PURE__ */ jsx(Play, { size: 16 }),
19806
+ "Run"
19807
+ ] })
19808
+ }
19809
+ ),
19810
+ /* @__PURE__ */ jsx(
19811
+ Button,
19812
+ {
19813
+ variant: "secondary",
19814
+ size: "sm",
19815
+ onClick: handleReset,
19816
+ disabled: isRunning,
19817
+ children: /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-2", children: [
19818
+ /* @__PURE__ */ jsx(RotateCcw, { size: 16 }),
19819
+ "Reset"
19820
+ ] })
19821
+ }
19822
+ )
19823
+ ] }),
19824
+ output && /* @__PURE__ */ jsxs(
19825
+ Badge,
19826
+ {
19827
+ variant: output.exitCode === 0 ? "success" : "danger",
19828
+ size: "sm",
19829
+ children: [
19830
+ "Exit ",
19831
+ output.exitCode
19832
+ ]
19833
+ }
19834
+ )
19835
+ ] }),
19836
+ hasOutput && /* @__PURE__ */ jsxs(Box, { className: "rounded-lg border border-gray-700 bg-[#0d0d0d] overflow-hidden", children: [
19837
+ /* @__PURE__ */ jsxs(
19838
+ HStack,
19839
+ {
19840
+ gap: "sm",
19841
+ align: "center",
19842
+ className: "px-3 py-2 bg-gray-800 border-b border-gray-700",
19843
+ children: [
19844
+ /* @__PURE__ */ jsx(Terminal, { size: 16, className: "text-gray-400" }),
19845
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-300 font-medium", children: "Output" })
19846
+ ]
19847
+ }
19848
+ ),
19849
+ /* @__PURE__ */ jsx(VStack, { gap: "none", className: "p-3 font-mono text-sm", children: error ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-red-400 whitespace-pre-wrap", children: error }) : /* @__PURE__ */ jsxs(Fragment, { children: [
19850
+ output?.stdout ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-200 whitespace-pre-wrap", children: output.stdout }) : null,
19851
+ output?.stderr ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-red-400 whitespace-pre-wrap", children: output.stderr }) : null,
19852
+ !output?.stdout && !output?.stderr ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-500 italic", children: "No output" }) : null,
19853
+ output && output.testResults.length > 0 && /* @__PURE__ */ jsx(Box, { className: "mt-3 pt-3 border-t border-gray-700 space-y-2", children: output.testResults.map((test, index) => /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "start", className: "text-xs", children: [
19854
+ test.passed ? /* @__PURE__ */ jsx(CheckCircle, { size: 14, className: "text-green-400 mt-0.5" }) : /* @__PURE__ */ jsx(XCircle, { size: 14, className: "text-red-400 mt-0.5" }),
19855
+ /* @__PURE__ */ jsxs(VStack, { gap: "xs", className: "flex-1", children: [
19856
+ /* @__PURE__ */ jsxs(
19857
+ Typography,
19858
+ {
19859
+ variant: "small",
19860
+ className: test.passed ? "text-green-400" : "text-red-400",
19861
+ children: [
19862
+ "Test ",
19863
+ index + 1,
19864
+ ": ",
19865
+ test.passed ? "passed" : "failed"
19866
+ ]
19867
+ }
19868
+ ),
19869
+ /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-gray-400", children: [
19870
+ "Input: ",
19871
+ test.input
19872
+ ] }),
19873
+ /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-gray-400", children: [
19874
+ "Expected: ",
19875
+ test.expectedOutput
19876
+ ] }),
19877
+ /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-gray-400", children: [
19878
+ "Actual: ",
19879
+ test.actualOutput
19880
+ ] })
19881
+ ] })
19882
+ ] }, index)) })
19883
+ ] }) })
19884
+ ] })
19885
+ ] });
19886
+ };
19887
+ CodeRunnerPanel.displayName = "CodeRunnerPanel";
19888
+ }
19889
+ });
19523
19890
  function CombatLog({
19524
19891
  events: events2,
19525
19892
  maxVisible = 50,
@@ -19827,6 +20194,31 @@ var init_ConfirmDialog = __esm({
19827
20194
  ConfirmDialog.displayName = "ConfirmDialog";
19828
20195
  }
19829
20196
  });
20197
+ var ConnectionBlock;
20198
+ var init_ConnectionBlock = __esm({
20199
+ "components/core/molecules/ConnectionBlock.tsx"() {
20200
+ "use client";
20201
+ init_MarkdownContent();
20202
+ init_cn();
20203
+ ConnectionBlock = ({ content, className }) => /* @__PURE__ */ jsx(
20204
+ "div",
20205
+ {
20206
+ className: cn(
20207
+ "bg-emerald-50 dark:bg-emerald-900/20 border-l-4 border-emerald-500 rounded-r-lg p-5 mb-6",
20208
+ className
20209
+ ),
20210
+ children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
20211
+ /* @__PURE__ */ jsx(Link2, { className: "text-emerald-600 dark:text-emerald-400 flex-shrink-0 mt-1", size: 20 }),
20212
+ /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
20213
+ /* @__PURE__ */ jsx("h4", { className: "font-semibold text-emerald-900 dark:text-emerald-100 mb-2", children: "Building On What You Know" }),
20214
+ /* @__PURE__ */ jsx("div", { className: "prose dark:prose-invert prose-sm max-w-none text-gray-700 dark:text-gray-300", children: /* @__PURE__ */ jsx(MarkdownContent, { content }) })
20215
+ ] })
20216
+ ] })
20217
+ }
20218
+ );
20219
+ ConnectionBlock.displayName = "ConnectionBlock";
20220
+ }
20221
+ });
19830
20222
  function CounterMinimal({
19831
20223
  entity,
19832
20224
  size = "md",
@@ -20127,7 +20519,7 @@ function CraftingRecipe({
20127
20519
  className
20128
20520
  }) {
20129
20521
  const eventBus = useEventBus();
20130
- const handleCraft = React74.useCallback(() => {
20522
+ const handleCraft = React77.useCallback(() => {
20131
20523
  onCraft?.();
20132
20524
  if (craftEvent) {
20133
20525
  eventBus.emit(craftEvent, { output: output.label });
@@ -20144,7 +20536,7 @@ function CraftingRecipe({
20144
20536
  children: [
20145
20537
  /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
20146
20538
  const hasSufficient = ingredient.available >= ingredient.required;
20147
- return /* @__PURE__ */ jsxs(React74.Fragment, { children: [
20539
+ return /* @__PURE__ */ jsxs(React77.Fragment, { children: [
20148
20540
  /* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
20149
20541
  ItemSlot,
20150
20542
  {
@@ -20207,8 +20599,8 @@ function DPad({
20207
20599
  }) {
20208
20600
  const eventBus = useEventBus();
20209
20601
  const sizes = sizeMap6[size];
20210
- const [activeDirections, setActiveDirections] = React74.useState(/* @__PURE__ */ new Set());
20211
- const handlePress = React74.useCallback(
20602
+ const [activeDirections, setActiveDirections] = React77.useState(/* @__PURE__ */ new Set());
20603
+ const handlePress = React77.useCallback(
20212
20604
  (direction) => {
20213
20605
  setActiveDirections((prev) => new Set(prev).add(direction));
20214
20606
  if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
@@ -20216,7 +20608,7 @@ function DPad({
20216
20608
  },
20217
20609
  [directionEvent, eventBus, onDirection]
20218
20610
  );
20219
- const handleRelease = React74.useCallback(
20611
+ const handleRelease = React77.useCallback(
20220
20612
  (direction) => {
20221
20613
  setActiveDirections((prev) => {
20222
20614
  const next = new Set(prev);
@@ -21072,8 +21464,8 @@ var init_Menu = __esm({
21072
21464
  "bottom-end": "bottom-start"
21073
21465
  };
21074
21466
  const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
21075
- const triggerChild = React74__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
21076
- const triggerElement = React74__default.cloneElement(
21467
+ const triggerChild = React77__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
21468
+ const triggerElement = React77__default.cloneElement(
21077
21469
  triggerChild,
21078
21470
  {
21079
21471
  ref: triggerRef,
@@ -21207,14 +21599,14 @@ function useDataDnd(args) {
21207
21599
  const isZone = Boolean(dragGroup || accepts || sortable);
21208
21600
  const enabled = isZone || Boolean(dndRoot);
21209
21601
  const eventBus = useEventBus();
21210
- const parentRoot = React74__default.useContext(RootCtx);
21602
+ const parentRoot = React77__default.useContext(RootCtx);
21211
21603
  const isRoot = enabled && parentRoot === null;
21212
- const zoneId = React74__default.useId();
21604
+ const zoneId = React77__default.useId();
21213
21605
  const ownGroup = dragGroup ?? accepts ?? zoneId;
21214
- const [optimisticOrders, setOptimisticOrders] = React74__default.useState(() => /* @__PURE__ */ new Map());
21215
- const optimisticOrdersRef = React74__default.useRef(optimisticOrders);
21606
+ const [optimisticOrders, setOptimisticOrders] = React77__default.useState(() => /* @__PURE__ */ new Map());
21607
+ const optimisticOrdersRef = React77__default.useRef(optimisticOrders);
21216
21608
  optimisticOrdersRef.current = optimisticOrders;
21217
- const clearOptimisticOrder = React74__default.useCallback((group) => {
21609
+ const clearOptimisticOrder = React77__default.useCallback((group) => {
21218
21610
  setOptimisticOrders((prev) => {
21219
21611
  if (!prev.has(group)) return prev;
21220
21612
  const next = new Map(prev);
@@ -21239,7 +21631,7 @@ function useDataDnd(args) {
21239
21631
  const raw = it[dndItemIdField];
21240
21632
  return String(raw ?? `__idx_${idx}`);
21241
21633
  }).join("|");
21242
- const itemIds = React74__default.useMemo(
21634
+ const itemIds = React77__default.useMemo(
21243
21635
  () => orderedItems.map((it, idx) => {
21244
21636
  const raw = it[dndItemIdField];
21245
21637
  return raw ?? `__idx_${idx}`;
@@ -21247,7 +21639,7 @@ function useDataDnd(args) {
21247
21639
  [itemIdsSignature]
21248
21640
  );
21249
21641
  const itemsContentSig = items.map((it, idx) => String(it[dndItemIdField] ?? `__${idx}`)).join("|");
21250
- React74__default.useEffect(() => {
21642
+ React77__default.useEffect(() => {
21251
21643
  const root = isRoot ? null : parentRoot;
21252
21644
  if (root) {
21253
21645
  root.clearOptimisticOrder(ownGroup);
@@ -21255,20 +21647,20 @@ function useDataDnd(args) {
21255
21647
  clearOptimisticOrder(ownGroup);
21256
21648
  }
21257
21649
  }, [itemsContentSig, ownGroup]);
21258
- const zonesRef = React74__default.useRef(/* @__PURE__ */ new Map());
21259
- const registerZone = React74__default.useCallback((zoneId2, meta2) => {
21650
+ const zonesRef = React77__default.useRef(/* @__PURE__ */ new Map());
21651
+ const registerZone = React77__default.useCallback((zoneId2, meta2) => {
21260
21652
  zonesRef.current.set(zoneId2, meta2);
21261
21653
  }, []);
21262
- const unregisterZone = React74__default.useCallback((zoneId2) => {
21654
+ const unregisterZone = React77__default.useCallback((zoneId2) => {
21263
21655
  zonesRef.current.delete(zoneId2);
21264
21656
  }, []);
21265
- const [activeDrag, setActiveDrag] = React74__default.useState(null);
21266
- const [overZoneGroup, setOverZoneGroup] = React74__default.useState(null);
21267
- const meta = React74__default.useMemo(
21657
+ const [activeDrag, setActiveDrag] = React77__default.useState(null);
21658
+ const [overZoneGroup, setOverZoneGroup] = React77__default.useState(null);
21659
+ const meta = React77__default.useMemo(
21268
21660
  () => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
21269
21661
  [ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
21270
21662
  );
21271
- React74__default.useEffect(() => {
21663
+ React77__default.useEffect(() => {
21272
21664
  const target = isRoot ? null : parentRoot;
21273
21665
  if (!target) {
21274
21666
  zonesRef.current.set(zoneId, meta);
@@ -21287,7 +21679,7 @@ function useDataDnd(args) {
21287
21679
  }, [parentRoot, isRoot, zoneId, meta]);
21288
21680
  const sensors = useAlmadarDndSensors(true);
21289
21681
  const collisionDetection = almadarDndCollisionDetection;
21290
- const findZoneByItem = React74__default.useCallback(
21682
+ const findZoneByItem = React77__default.useCallback(
21291
21683
  (id) => {
21292
21684
  for (const z of zonesRef.current.values()) {
21293
21685
  if (z.itemIds.includes(id)) return z;
@@ -21296,7 +21688,7 @@ function useDataDnd(args) {
21296
21688
  },
21297
21689
  []
21298
21690
  );
21299
- React74__default.useCallback(
21691
+ React77__default.useCallback(
21300
21692
  (group) => {
21301
21693
  for (const z of zonesRef.current.values()) {
21302
21694
  if (z.group === group) return z;
@@ -21305,7 +21697,7 @@ function useDataDnd(args) {
21305
21697
  },
21306
21698
  []
21307
21699
  );
21308
- const handleDragEnd = React74__default.useCallback(
21700
+ const handleDragEnd = React77__default.useCallback(
21309
21701
  (event) => {
21310
21702
  const { active, over } = event;
21311
21703
  const activeIdStr = String(active.id);
@@ -21396,8 +21788,8 @@ function useDataDnd(args) {
21396
21788
  },
21397
21789
  [eventBus]
21398
21790
  );
21399
- const sortableData = React74__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
21400
- const SortableItem = React74__default.useCallback(
21791
+ const sortableData = React77__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
21792
+ const SortableItem = React77__default.useCallback(
21401
21793
  ({ id, children }) => {
21402
21794
  const {
21403
21795
  attributes,
@@ -21437,7 +21829,7 @@ function useDataDnd(args) {
21437
21829
  id: droppableId,
21438
21830
  data: sortableData
21439
21831
  });
21440
- const ctx = React74__default.useContext(RootCtx);
21832
+ const ctx = React77__default.useContext(RootCtx);
21441
21833
  const activeDrag2 = ctx?.activeDrag ?? null;
21442
21834
  const overZoneGroup2 = ctx?.overZoneGroup ?? null;
21443
21835
  const isThisZoneOver = overZoneGroup2 === ownGroup;
@@ -21452,7 +21844,7 @@ function useDataDnd(args) {
21452
21844
  showForeignPlaceholder,
21453
21845
  ctxAvailable: ctx != null
21454
21846
  });
21455
- React74__default.useEffect(() => {
21847
+ React77__default.useEffect(() => {
21456
21848
  dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
21457
21849
  }, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
21458
21850
  return /* @__PURE__ */ jsx(
@@ -21466,11 +21858,11 @@ function useDataDnd(args) {
21466
21858
  }
21467
21859
  );
21468
21860
  };
21469
- const rootContextValue = React74__default.useMemo(
21861
+ const rootContextValue = React77__default.useMemo(
21470
21862
  () => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
21471
21863
  [registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
21472
21864
  );
21473
- const handleDragStart = React74__default.useCallback((event) => {
21865
+ const handleDragStart = React77__default.useCallback((event) => {
21474
21866
  const sourceZone = findZoneByItem(event.active.id);
21475
21867
  const rect = event.active.rect.current.initial;
21476
21868
  const height = rect?.height && rect.height > 0 ? rect.height : 64;
@@ -21489,7 +21881,7 @@ function useDataDnd(args) {
21489
21881
  isRoot
21490
21882
  });
21491
21883
  }, [findZoneByItem, isRoot, zoneId]);
21492
- const handleDragOver = React74__default.useCallback((event) => {
21884
+ const handleDragOver = React77__default.useCallback((event) => {
21493
21885
  const { active, over } = event;
21494
21886
  const overData = over?.data?.current;
21495
21887
  const overGroup = overData?.dndGroup ?? null;
@@ -21559,7 +21951,7 @@ function useDataDnd(args) {
21559
21951
  return next;
21560
21952
  });
21561
21953
  }, []);
21562
- const handleDragCancel = React74__default.useCallback((event) => {
21954
+ const handleDragCancel = React77__default.useCallback((event) => {
21563
21955
  setActiveDrag(null);
21564
21956
  setOverZoneGroup(null);
21565
21957
  dndLog.warn("dragCancel", {
@@ -21567,12 +21959,12 @@ function useDataDnd(args) {
21567
21959
  reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
21568
21960
  });
21569
21961
  }, []);
21570
- const handleDragEndWithCleanup = React74__default.useCallback((event) => {
21962
+ const handleDragEndWithCleanup = React77__default.useCallback((event) => {
21571
21963
  handleDragEnd(event);
21572
21964
  setActiveDrag(null);
21573
21965
  setOverZoneGroup(null);
21574
21966
  }, [handleDragEnd]);
21575
- const wrapContainer = React74__default.useCallback(
21967
+ const wrapContainer = React77__default.useCallback(
21576
21968
  (children) => {
21577
21969
  if (!enabled) return children;
21578
21970
  const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
@@ -21626,7 +22018,7 @@ var init_useDataDnd = __esm({
21626
22018
  init_useAlmadarDndCollision();
21627
22019
  init_Box();
21628
22020
  dndLog = createLogger("almadar:ui:dnd");
21629
- RootCtx = React74__default.createContext(null);
22021
+ RootCtx = React77__default.createContext(null);
21630
22022
  }
21631
22023
  });
21632
22024
  function renderIconInput(icon, props) {
@@ -22152,7 +22544,7 @@ function DataList({
22152
22544
  }) {
22153
22545
  const eventBus = useEventBus();
22154
22546
  const { t } = useTranslate();
22155
- const [visibleCount, setVisibleCount] = React74__default.useState(pageSize || Infinity);
22547
+ const [visibleCount, setVisibleCount] = React77__default.useState(pageSize || Infinity);
22156
22548
  const fieldDefs = fields ?? columns ?? [];
22157
22549
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
22158
22550
  const dnd = useDataDnd({
@@ -22171,7 +22563,7 @@ function DataList({
22171
22563
  const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
22172
22564
  const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
22173
22565
  const hasRenderProp = typeof children === "function";
22174
- React74__default.useEffect(() => {
22566
+ React77__default.useEffect(() => {
22175
22567
  const renderItemTypeOf = typeof schemaRenderItem;
22176
22568
  const childrenTypeOf = typeof children;
22177
22569
  if (data.length > 0 && !hasRenderProp) {
@@ -22276,7 +22668,7 @@ function DataList({
22276
22668
  const items2 = data.map((item) => item);
22277
22669
  const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
22278
22670
  const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
22279
- return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React74__default.Fragment, { children: [
22671
+ return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React77__default.Fragment, { children: [
22280
22672
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
22281
22673
  group.items.map((itemData, index) => {
22282
22674
  const id = itemData.id || `${gi}-${index}`;
@@ -22417,7 +22809,7 @@ function DataList({
22417
22809
  className
22418
22810
  ),
22419
22811
  children: [
22420
- groups.map((group, gi) => /* @__PURE__ */ jsxs(React74__default.Fragment, { children: [
22812
+ groups.map((group, gi) => /* @__PURE__ */ jsxs(React77__default.Fragment, { children: [
22421
22813
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
22422
22814
  group.items.map(
22423
22815
  (itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
@@ -22524,8 +22916,8 @@ function ScalarControl({
22524
22916
  }
22525
22917
  const numeric = typeof value === "number";
22526
22918
  const initial = value === null ? "" : String(value);
22527
- const [draft, setDraft] = React74__default.useState(initial);
22528
- React74__default.useEffect(() => setDraft(initial), [initial]);
22919
+ const [draft, setDraft] = React77__default.useState(initial);
22920
+ React77__default.useEffect(() => setDraft(initial), [initial]);
22529
22921
  const commit = () => {
22530
22922
  if (numeric) {
22531
22923
  const n = draft.trim() === "" ? 0 : Number(draft);
@@ -22593,8 +22985,8 @@ function Row({
22593
22985
  onRemove,
22594
22986
  readonly
22595
22987
  }) {
22596
- const [keyDraft, setKeyDraft] = React74__default.useState(rowKey);
22597
- React74__default.useEffect(() => setKeyDraft(rowKey), [rowKey]);
22988
+ const [keyDraft, setKeyDraft] = React77__default.useState(rowKey);
22989
+ React77__default.useEffect(() => setKeyDraft(rowKey), [rowKey]);
22598
22990
  const container = isObj(value) || isArr(value);
22599
22991
  return /* @__PURE__ */ jsxs(VStack, { gap: "none", className: "group w-max min-w-full", children: [
22600
22992
  /* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", className: "py-0.5 w-max", children: [
@@ -22637,7 +23029,7 @@ function ContainerNode({
22637
23029
  depth,
22638
23030
  readonly
22639
23031
  }) {
22640
- const [open, setOpen] = React74__default.useState(depth < 2);
23032
+ const [open, setOpen] = React77__default.useState(depth < 2);
22641
23033
  const array = isArr(value);
22642
23034
  const entries = array ? value.map((v, i) => [String(i), v]) : Object.entries(value);
22643
23035
  const setObjValue = (key, next) => {
@@ -22779,7 +23171,7 @@ var init_FormSection = __esm({
22779
23171
  columns = 1,
22780
23172
  className
22781
23173
  }) => {
22782
- const [collapsed, setCollapsed] = React74__default.useState(defaultCollapsed);
23174
+ const [collapsed, setCollapsed] = React77__default.useState(defaultCollapsed);
22783
23175
  const { t } = useTranslate();
22784
23176
  const eventBus = useEventBus();
22785
23177
  const gridClass = {
@@ -22787,7 +23179,7 @@ var init_FormSection = __esm({
22787
23179
  2: "grid-cols-1 md:grid-cols-2",
22788
23180
  3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
22789
23181
  }[columns];
22790
- React74__default.useCallback(() => {
23182
+ React77__default.useCallback(() => {
22791
23183
  if (collapsible) {
22792
23184
  setCollapsed((prev) => !prev);
22793
23185
  eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
@@ -23191,8 +23583,8 @@ function TextLikeControl({
23191
23583
  onCommit
23192
23584
  }) {
23193
23585
  const initial = value === void 0 || value === null ? "" : String(value);
23194
- const [draft, setDraft] = React74__default.useState(initial);
23195
- React74__default.useEffect(() => setDraft(initial), [initial]);
23586
+ const [draft, setDraft] = React77__default.useState(initial);
23587
+ React77__default.useEffect(() => setDraft(initial), [initial]);
23196
23588
  const commit = () => {
23197
23589
  if (numeric) {
23198
23590
  const n = draft.trim() === "" ? 0 : Number(draft);
@@ -23358,14 +23750,14 @@ var init_NodeSlotEditor = __esm({
23358
23750
  isObj2 = (v) => v !== null && v !== void 0 && typeof v === "object" && !Array.isArray(v);
23359
23751
  NodeSlotEditor = ({ value, onChange, className }) => {
23360
23752
  const { type, props, wasArray } = normalize(value);
23361
- const patterns = React74__default.useMemo(() => {
23753
+ const patterns = React77__default.useMemo(() => {
23362
23754
  try {
23363
23755
  return [...getKnownPatterns()].sort();
23364
23756
  } catch {
23365
23757
  return [];
23366
23758
  }
23367
23759
  }, []);
23368
- const options = React74__default.useMemo(
23760
+ const options = React77__default.useMemo(
23369
23761
  () => [{ value: "", label: "\u2014 none \u2014" }, ...patterns.map((p2) => ({ value: p2, label: p2 }))],
23370
23762
  [patterns]
23371
23763
  );
@@ -23377,7 +23769,7 @@ var init_NodeSlotEditor = __esm({
23377
23769
  const pattern = { type: nextType, ...nextProps };
23378
23770
  onChange(wasArray || value === void 0 ? [pattern] : pattern);
23379
23771
  };
23380
- const schemaEntries = React74__default.useMemo(() => {
23772
+ const schemaEntries = React77__default.useMemo(() => {
23381
23773
  if (!type) return [];
23382
23774
  const def = getPatternDefinition(type);
23383
23775
  if (!def?.propsSchema) return [];
@@ -24271,7 +24663,7 @@ var init_Grid = __esm({
24271
24663
  as: Component = "div"
24272
24664
  }) => {
24273
24665
  const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
24274
- return React74__default.createElement(
24666
+ return React77__default.createElement(
24275
24667
  Component,
24276
24668
  {
24277
24669
  className: cn(
@@ -24459,8 +24851,8 @@ var init_Popover = __esm({
24459
24851
  onMouseEnter: handleOpen,
24460
24852
  onMouseLeave: handleClose
24461
24853
  };
24462
- const childElement = React74__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
24463
- const triggerElement = React74__default.cloneElement(
24854
+ const childElement = React77__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
24855
+ const triggerElement = React77__default.cloneElement(
24464
24856
  childElement,
24465
24857
  {
24466
24858
  ref: triggerRef,
@@ -25300,8 +25692,8 @@ var init_Tooltip = __esm({
25300
25692
  if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
25301
25693
  };
25302
25694
  }, []);
25303
- const triggerElement = React74__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
25304
- const trigger = React74__default.cloneElement(triggerElement, {
25695
+ const triggerElement = React77__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
25696
+ const trigger = React77__default.cloneElement(triggerElement, {
25305
25697
  ref: triggerRef,
25306
25698
  onMouseEnter: handleMouseEnter,
25307
25699
  onMouseLeave: handleMouseLeave,
@@ -25387,7 +25779,7 @@ var init_WizardProgress = __esm({
25387
25779
  children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
25388
25780
  const isActive = index === currentStep;
25389
25781
  const isCompleted = index < currentStep;
25390
- return /* @__PURE__ */ jsxs(React74__default.Fragment, { children: [
25782
+ return /* @__PURE__ */ jsxs(React77__default.Fragment, { children: [
25391
25783
  /* @__PURE__ */ jsx(
25392
25784
  "button",
25393
25785
  {
@@ -26431,9 +26823,9 @@ function ScoreDisplay({
26431
26823
  ...rest
26432
26824
  }) {
26433
26825
  const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof rest.score === "number" && !Number.isNaN(rest.score) ? rest.score : 0;
26434
- const [displayValue, setDisplayValue] = React74.useState(resolvedValue);
26435
- const [isAnimating, setIsAnimating] = React74.useState(false);
26436
- React74.useEffect(() => {
26826
+ const [displayValue, setDisplayValue] = React77.useState(resolvedValue);
26827
+ const [isAnimating, setIsAnimating] = React77.useState(false);
26828
+ React77.useEffect(() => {
26437
26829
  if (!animated || displayValue === resolvedValue) {
26438
26830
  setDisplayValue(resolvedValue);
26439
26831
  return;
@@ -26581,7 +26973,7 @@ function InventoryGrid({
26581
26973
  const eventBus = useEventBus();
26582
26974
  const slotCount = totalSlots ?? items.length;
26583
26975
  const emptySlotCount = Math.max(0, slotCount - items.length);
26584
- const handleSelect = React74.useCallback(
26976
+ const handleSelect = React77.useCallback(
26585
26977
  (id) => {
26586
26978
  onSelect?.(id);
26587
26979
  if (selectEvent) {
@@ -26868,31 +27260,31 @@ function GameCanvas2D({
26868
27260
  assetBaseUrl = "https://almadar-kflow-assets.web.app/shared/",
26869
27261
  className
26870
27262
  }) {
26871
- const canvasRef = React74.useRef(null);
26872
- const rafRef = React74.useRef(0);
26873
- const frameRef = React74.useRef(0);
26874
- const lastTimeRef = React74.useRef(0);
26875
- const imageCache = React74.useRef(/* @__PURE__ */ new Map());
27263
+ const canvasRef = React77.useRef(null);
27264
+ const rafRef = React77.useRef(0);
27265
+ const frameRef = React77.useRef(0);
27266
+ const lastTimeRef = React77.useRef(0);
27267
+ const imageCache = React77.useRef(/* @__PURE__ */ new Map());
26876
27268
  const emit = useEmitEvent();
26877
- const onDrawRef = React74.useRef(onDraw);
27269
+ const onDrawRef = React77.useRef(onDraw);
26878
27270
  onDrawRef.current = onDraw;
26879
- const onTickRef = React74.useRef(onTick);
27271
+ const onTickRef = React77.useRef(onTick);
26880
27272
  onTickRef.current = onTick;
26881
- const tickEventRef = React74.useRef(tickEvent);
27273
+ const tickEventRef = React77.useRef(tickEvent);
26882
27274
  tickEventRef.current = tickEvent;
26883
- const drawEventRef = React74.useRef(drawEvent);
27275
+ const drawEventRef = React77.useRef(drawEvent);
26884
27276
  drawEventRef.current = drawEvent;
26885
- const emitRef = React74.useRef(emit);
27277
+ const emitRef = React77.useRef(emit);
26886
27278
  emitRef.current = emit;
26887
- const assetBaseUrlRef = React74.useRef(assetBaseUrl);
27279
+ const assetBaseUrlRef = React77.useRef(assetBaseUrl);
26888
27280
  assetBaseUrlRef.current = assetBaseUrl;
26889
- const backgroundImageRef = React74.useRef(backgroundImage);
27281
+ const backgroundImageRef = React77.useRef(backgroundImage);
26890
27282
  backgroundImageRef.current = backgroundImage;
26891
- const widthRef = React74.useRef(width);
27283
+ const widthRef = React77.useRef(width);
26892
27284
  widthRef.current = width;
26893
- const heightRef = React74.useRef(height);
27285
+ const heightRef = React77.useRef(height);
26894
27286
  heightRef.current = height;
26895
- const loadImage = React74.useCallback((url) => {
27287
+ const loadImage = React77.useCallback((url) => {
26896
27288
  const fullUrl = url.startsWith("http") ? url : `${assetBaseUrlRef.current}${url}`;
26897
27289
  const cached = imageCache.current.get(fullUrl);
26898
27290
  if (cached?.complete && cached.naturalWidth > 0) return cached;
@@ -26904,7 +27296,7 @@ function GameCanvas2D({
26904
27296
  }
26905
27297
  return null;
26906
27298
  }, []);
26907
- React74.useEffect(() => {
27299
+ React77.useEffect(() => {
26908
27300
  const canvas = canvasRef.current;
26909
27301
  if (!canvas) return;
26910
27302
  const ctx = canvas.getContext("2d");
@@ -27262,7 +27654,7 @@ function TurnPanel({
27262
27654
  className
27263
27655
  }) {
27264
27656
  const eventBus = useEventBus();
27265
- const handleAction = React74.useCallback(
27657
+ const handleAction = React77.useCallback(
27266
27658
  (event) => {
27267
27659
  if (event) {
27268
27660
  eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
@@ -27408,7 +27800,7 @@ function UnitCommandBar({
27408
27800
  className
27409
27801
  }) {
27410
27802
  const eventBus = useEventBus();
27411
- const handleCommand = React74.useCallback(
27803
+ const handleCommand = React77.useCallback(
27412
27804
  (event) => {
27413
27805
  if (event) {
27414
27806
  eventBus.emit(event, { unitId: selectedUnitId });
@@ -27893,7 +28285,7 @@ function GameMenu({
27893
28285
  } catch {
27894
28286
  }
27895
28287
  const eventBus = eventBusProp || eventBusFromHook;
27896
- const handleOptionClick = React74.useCallback(
28288
+ const handleOptionClick = React77.useCallback(
27897
28289
  (option) => {
27898
28290
  if (option.event && eventBus) {
27899
28291
  eventBus.emit(`UI:${option.event}`, { option });
@@ -28007,7 +28399,7 @@ function GameOverScreen({
28007
28399
  } catch {
28008
28400
  }
28009
28401
  const eventBus = eventBusProp || eventBusFromHook;
28010
- const handleActionClick = React74.useCallback(
28402
+ const handleActionClick = React77.useCallback(
28011
28403
  (action) => {
28012
28404
  if (action.event && eventBus) {
28013
28405
  eventBus.emit(`UI:${action.event}`, { action });
@@ -28771,7 +29163,7 @@ var init_MapView = __esm({
28771
29163
  shadowSize: [41, 41]
28772
29164
  });
28773
29165
  L.Marker.prototype.options.icon = defaultIcon;
28774
- const { useEffect: useEffect72, useRef: useRef69, useCallback: useCallback115, useState: useState105 } = React74__default;
29166
+ const { useEffect: useEffect72, useRef: useRef69, useCallback: useCallback115, useState: useState105 } = React77__default;
28775
29167
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
28776
29168
  const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
28777
29169
  function MapUpdater({ centerLat, centerLng, zoom }) {
@@ -29677,8 +30069,8 @@ function TableView({
29677
30069
  }) {
29678
30070
  const eventBus = useEventBus();
29679
30071
  const { t } = useTranslate();
29680
- const [visibleCount, setVisibleCount] = React74__default.useState(pageSize > 0 ? pageSize : Infinity);
29681
- const [localSelected, setLocalSelected] = React74__default.useState(/* @__PURE__ */ new Set());
30072
+ const [visibleCount, setVisibleCount] = React77__default.useState(pageSize > 0 ? pageSize : Infinity);
30073
+ const [localSelected, setLocalSelected] = React77__default.useState(/* @__PURE__ */ new Set());
29682
30074
  const colDefs = columns ?? fields ?? [];
29683
30075
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
29684
30076
  const dnd = useDataDnd({
@@ -29873,12 +30265,12 @@ function TableView({
29873
30265
  ]
29874
30266
  }
29875
30267
  );
29876
- return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React74__default.Fragment, { children: rowInner }, id);
30268
+ return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React77__default.Fragment, { children: rowInner }, id);
29877
30269
  };
29878
30270
  const items = data.map((row) => row);
29879
30271
  const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
29880
30272
  let runningIndex = 0;
29881
- const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React74__default.Fragment, { children: [
30273
+ const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React77__default.Fragment, { children: [
29882
30274
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
29883
30275
  group.items.map((row) => renderRow(row, runningIndex++))
29884
30276
  ] }, gi)) });
@@ -31235,7 +31627,7 @@ var init_StepFlow = __esm({
31235
31627
  className
31236
31628
  }) => {
31237
31629
  if (orientation === "vertical") {
31238
- return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React74__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
31630
+ return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React77__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
31239
31631
  /* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
31240
31632
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
31241
31633
  showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
@@ -31246,7 +31638,7 @@ var init_StepFlow = __esm({
31246
31638
  ] })
31247
31639
  ] }) }, index)) });
31248
31640
  }
31249
- return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(React74__default.Fragment, { children: [
31641
+ return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(React77__default.Fragment, { children: [
31250
31642
  /* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
31251
31643
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
31252
31644
  /* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
@@ -32231,7 +32623,7 @@ var init_LikertScale = __esm({
32231
32623
  md: "text-base",
32232
32624
  lg: "text-lg"
32233
32625
  };
32234
- LikertScale = React74__default.forwardRef(
32626
+ LikertScale = React77__default.forwardRef(
32235
32627
  ({
32236
32628
  question,
32237
32629
  options = DEFAULT_LIKERT_OPTIONS,
@@ -32243,7 +32635,7 @@ var init_LikertScale = __esm({
32243
32635
  variant = "radios",
32244
32636
  className
32245
32637
  }, ref) => {
32246
- const groupId = React74__default.useId();
32638
+ const groupId = React77__default.useId();
32247
32639
  const eventBus = useEventBus();
32248
32640
  const handleSelect = useCallback(
32249
32641
  (next) => {
@@ -34525,7 +34917,7 @@ var init_DocBreadcrumb = __esm({
34525
34917
  "aria-label": t("aria.breadcrumb"),
34526
34918
  children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
34527
34919
  const isLast = idx === items.length - 1;
34528
- return /* @__PURE__ */ jsxs(React74__default.Fragment, { children: [
34920
+ return /* @__PURE__ */ jsxs(React77__default.Fragment, { children: [
34529
34921
  idx > 0 && /* @__PURE__ */ jsx(
34530
34922
  Icon,
34531
34923
  {
@@ -35394,7 +35786,7 @@ var init_MiniStateMachine = __esm({
35394
35786
  const x = 2 + i * (NODE_W + GAP2 + ARROW_W + GAP2);
35395
35787
  const tc = transitionCounts[s.name] ?? 0;
35396
35788
  const role = getStateRole(s.name, s.isInitial, s.isTerminal, tc, maxTC);
35397
- return /* @__PURE__ */ jsxs(React74__default.Fragment, { children: [
35789
+ return /* @__PURE__ */ jsxs(React77__default.Fragment, { children: [
35398
35790
  /* @__PURE__ */ jsx(
35399
35791
  AvlState,
35400
35792
  {
@@ -35598,7 +35990,7 @@ var init_PageHeader = __esm({
35598
35990
  info: "bg-info/10 text-info"
35599
35991
  };
35600
35992
  return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
35601
- breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx(Box, { as: "nav", className: "mb-4", children: /* @__PURE__ */ jsx(Box, { as: "ol", className: "flex items-center gap-2 text-sm", children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxs(React74__default.Fragment, { children: [
35993
+ breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx(Box, { as: "nav", className: "mb-4", children: /* @__PURE__ */ jsx(Box, { as: "ol", className: "flex items-center gap-2 text-sm", children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxs(React77__default.Fragment, { children: [
35602
35994
  idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
35603
35995
  crumb.href ? /* @__PURE__ */ jsx(
35604
35996
  "a",
@@ -36327,7 +36719,7 @@ var init_WizardContainer = __esm({
36327
36719
  const isCompleted = index < currentStep;
36328
36720
  const stepKey = step.id ?? step.tabId ?? `step-${index}`;
36329
36721
  const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
36330
- return /* @__PURE__ */ jsxs(React74__default.Fragment, { children: [
36722
+ return /* @__PURE__ */ jsxs(React77__default.Fragment, { children: [
36331
36723
  /* @__PURE__ */ jsx(
36332
36724
  Button,
36333
36725
  {
@@ -37529,85 +37921,6 @@ var init_GraphCanvas = __esm({
37529
37921
  GraphCanvas.displayName = "GraphCanvas";
37530
37922
  }
37531
37923
  });
37532
- var ActivationBlock;
37533
- var init_ActivationBlock = __esm({
37534
- "components/core/molecules/ActivationBlock.tsx"() {
37535
- "use client";
37536
- init_useEventBus();
37537
- init_cn();
37538
- ActivationBlock = ({
37539
- question,
37540
- savedResponse,
37541
- saveEvent = "SAVE_ACTIVATION",
37542
- className
37543
- }) => {
37544
- const [response, setResponse] = useState(savedResponse ?? "");
37545
- const [isExpanded, setIsExpanded] = useState(!savedResponse);
37546
- const { emit } = useEventBus();
37547
- const handleSubmit = () => {
37548
- emit(`UI:${saveEvent}`, { response });
37549
- setIsExpanded(false);
37550
- };
37551
- return /* @__PURE__ */ jsx(
37552
- "div",
37553
- {
37554
- className: cn(
37555
- "bg-indigo-50 dark:bg-indigo-900/20 border-2 border-indigo-200 dark:border-indigo-800 rounded-lg p-5 mb-6",
37556
- className
37557
- ),
37558
- children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
37559
- /* @__PURE__ */ jsx(Lightbulb, { className: "text-indigo-600 dark:text-indigo-400 flex-shrink-0 mt-1", size: 24 }),
37560
- /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
37561
- /* @__PURE__ */ jsx("h4", { className: "font-semibold text-indigo-900 dark:text-indigo-100 mb-2", children: "Before You Begin..." }),
37562
- /* @__PURE__ */ jsx("p", { className: "text-gray-700 dark:text-gray-300 mb-3 text-sm md:text-base", children: question }),
37563
- isExpanded ? /* @__PURE__ */ jsxs(Fragment, { children: [
37564
- /* @__PURE__ */ jsx(
37565
- "textarea",
37566
- {
37567
- className: "w-full p-3 border border-indigo-300 dark:border-indigo-700 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:ring-2 focus:ring-indigo-500 focus:border-transparent text-sm",
37568
- placeholder: "Jot down your thoughts...",
37569
- value: response,
37570
- onChange: (e) => setResponse(e.target.value),
37571
- rows: 3
37572
- }
37573
- ),
37574
- /* @__PURE__ */ jsxs("div", { className: "flex gap-2 mt-3", children: [
37575
- /* @__PURE__ */ jsx(
37576
- "button",
37577
- {
37578
- onClick: handleSubmit,
37579
- className: "px-4 py-2 bg-indigo-600 text-white rounded-md hover:bg-indigo-700 text-sm font-medium transition-colors",
37580
- children: "Continue to Lesson \u2192"
37581
- }
37582
- ),
37583
- /* @__PURE__ */ jsx(
37584
- "button",
37585
- {
37586
- onClick: () => {
37587
- emit(`UI:${saveEvent}`, { response: "" });
37588
- setIsExpanded(false);
37589
- },
37590
- className: "px-4 py-2 text-indigo-600 dark:text-indigo-400 hover:underline text-sm",
37591
- children: "Skip for now"
37592
- }
37593
- )
37594
- ] })
37595
- ] }) : /* @__PURE__ */ jsx(
37596
- "button",
37597
- {
37598
- onClick: () => setIsExpanded(true),
37599
- className: "text-sm text-indigo-600 dark:text-indigo-400 hover:underline font-medium",
37600
- children: "\u2713 Answered \xB7 Edit response"
37601
- }
37602
- )
37603
- ] })
37604
- ] })
37605
- }
37606
- );
37607
- };
37608
- ActivationBlock.displayName = "ActivationBlock";
37609
- }
37610
- });
37611
37924
  var ReflectionBlock;
37612
37925
  var init_ReflectionBlock = __esm({
37613
37926
  "components/core/molecules/ReflectionBlock.tsx"() {
@@ -37675,156 +37988,6 @@ var init_ReflectionBlock = __esm({
37675
37988
  ReflectionBlock.displayName = "ReflectionBlock";
37676
37989
  }
37677
37990
  });
37678
- var ConnectionBlock;
37679
- var init_ConnectionBlock = __esm({
37680
- "components/core/molecules/ConnectionBlock.tsx"() {
37681
- "use client";
37682
- init_MarkdownContent();
37683
- init_cn();
37684
- ConnectionBlock = ({ content, className }) => /* @__PURE__ */ jsx(
37685
- "div",
37686
- {
37687
- className: cn(
37688
- "bg-emerald-50 dark:bg-emerald-900/20 border-l-4 border-emerald-500 rounded-r-lg p-5 mb-6",
37689
- className
37690
- ),
37691
- children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
37692
- /* @__PURE__ */ jsx(Link2, { className: "text-emerald-600 dark:text-emerald-400 flex-shrink-0 mt-1", size: 20 }),
37693
- /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
37694
- /* @__PURE__ */ jsx("h4", { className: "font-semibold text-emerald-900 dark:text-emerald-100 mb-2", children: "Building On What You Know" }),
37695
- /* @__PURE__ */ jsx("div", { className: "prose dark:prose-invert prose-sm max-w-none text-gray-700 dark:text-gray-300", children: /* @__PURE__ */ jsx(MarkdownContent, { content }) })
37696
- ] })
37697
- ] })
37698
- }
37699
- );
37700
- ConnectionBlock.displayName = "ConnectionBlock";
37701
- }
37702
- });
37703
-
37704
- // components/core/molecules/lessonSegmentUtils.ts
37705
- function parseMarkdownWithCodeBlocks2(content) {
37706
- const segments = [];
37707
- const codeBlockRegex = /```([\w-]+)?(?:\s+(run))?\n([\s\S]*?)```/g;
37708
- let lastIndex = 0;
37709
- let match;
37710
- while ((match = codeBlockRegex.exec(content)) !== null) {
37711
- const before = content.slice(lastIndex, match.index);
37712
- if (before.trim()) {
37713
- segments.push({ type: "markdown", content: before });
37714
- }
37715
- const rawLanguage = match[1] ?? "text";
37716
- const runModifier = !!match[2];
37717
- const suffixRunnable = rawLanguage.endsWith("-runnable");
37718
- const runnable = runModifier || suffixRunnable;
37719
- const baseLanguage = suffixRunnable ? rawLanguage.slice(0, -"-runnable".length) || "text" : rawLanguage;
37720
- segments.push({ type: "code", language: baseLanguage, content: match[3].trim(), runnable });
37721
- lastIndex = codeBlockRegex.lastIndex;
37722
- }
37723
- const remaining = content.slice(lastIndex);
37724
- if (remaining.trim()) {
37725
- segments.push({ type: "markdown", content: remaining });
37726
- }
37727
- return segments;
37728
- }
37729
- var init_lessonSegmentUtils = __esm({
37730
- "components/core/molecules/lessonSegmentUtils.ts"() {
37731
- }
37732
- });
37733
- var BLOOM_CONFIG, BloomQuizBlock;
37734
- var init_BloomQuizBlock = __esm({
37735
- "components/core/molecules/BloomQuizBlock.tsx"() {
37736
- "use client";
37737
- init_MarkdownContent();
37738
- init_CodeBlock();
37739
- init_lessonSegmentUtils();
37740
- init_useEventBus();
37741
- init_cn();
37742
- BLOOM_CONFIG = {
37743
- remember: { color: "bg-gray-500", bgColor: "bg-gray-50 dark:bg-gray-900/30", label: "Remember" },
37744
- understand: { color: "bg-blue-500", bgColor: "bg-blue-50 dark:bg-blue-900/30", label: "Understand" },
37745
- apply: { color: "bg-green-500", bgColor: "bg-green-50 dark:bg-green-900/30", label: "Apply" },
37746
- analyze: { color: "bg-yellow-500", bgColor: "bg-yellow-50 dark:bg-yellow-900/30", label: "Analyze" },
37747
- evaluate: { color: "bg-orange-500", bgColor: "bg-orange-50 dark:bg-orange-900/30", label: "Evaluate" },
37748
- create: { color: "bg-purple-500", bgColor: "bg-purple-50 dark:bg-purple-900/30", label: "Create" }
37749
- };
37750
- BloomQuizBlock = ({
37751
- level,
37752
- question,
37753
- answer,
37754
- index,
37755
- isAnswered,
37756
- answerEvent = "ANSWER_BLOOM",
37757
- className
37758
- }) => {
37759
- const [revealed, setRevealed] = useState(false);
37760
- const config = BLOOM_CONFIG[level];
37761
- const { emit } = useEventBus();
37762
- const questionSegments = useMemo(() => parseMarkdownWithCodeBlocks2(question), [question]);
37763
- const answerSegments = useMemo(() => parseMarkdownWithCodeBlocks2(answer), [answer]);
37764
- const handleReveal = () => {
37765
- if (!revealed) {
37766
- emit(`UI:${answerEvent}`, { index: index ?? 0, level });
37767
- }
37768
- setRevealed(!revealed);
37769
- };
37770
- return /* @__PURE__ */ jsxs(
37771
- "div",
37772
- {
37773
- className: cn(
37774
- "rounded-lg border border-indigo-100 dark:border-indigo-800 p-4 my-4 transition-all",
37775
- config.bgColor,
37776
- className
37777
- ),
37778
- children: [
37779
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-3", children: [
37780
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [
37781
- index !== void 0 && /* @__PURE__ */ jsxs("span", { className: "text-gray-500 dark:text-gray-400 font-medium text-sm", children: [
37782
- "Question ",
37783
- index + 1
37784
- ] }),
37785
- /* @__PURE__ */ jsx("span", { className: cn(config.color, "text-white text-xs px-2 py-1 rounded-full font-medium"), children: config.label })
37786
- ] }),
37787
- isAnswered && /* @__PURE__ */ jsx(CheckCircle, { className: "text-green-600 dark:text-green-400 flex-shrink-0", size: 20 })
37788
- ] }),
37789
- /* @__PURE__ */ jsx("div", { className: "font-semibold text-indigo-900 dark:text-indigo-200 mb-3 space-y-2", children: questionSegments.map(
37790
- (segment, idx) => segment.type === "markdown" ? /* @__PURE__ */ jsx(MarkdownContent, { content: segment.content }, `q-md-${idx}`) : /* @__PURE__ */ jsx(
37791
- CodeBlock,
37792
- {
37793
- language: segment.language ?? "text",
37794
- code: segment.content
37795
- },
37796
- `q-code-${idx}`
37797
- )
37798
- ) }),
37799
- /* @__PURE__ */ jsx(
37800
- "button",
37801
- {
37802
- type: "button",
37803
- className: "inline-flex items-center rounded-md bg-indigo-600 dark:bg-indigo-500 px-3 py-1.5 text-sm font-medium text-white hover:bg-indigo-700 dark:hover:bg-indigo-600 transition-colors",
37804
- onClick: handleReveal,
37805
- children: revealed ? "Hide Answer" : "Reveal Answer"
37806
- }
37807
- ),
37808
- revealed && /* @__PURE__ */ jsxs("div", { className: "rounded-lg bg-white/80 dark:bg-gray-800/80 p-3 text-sm text-slate-800 dark:text-gray-200 shadow-sm border border-indigo-100 dark:border-indigo-800 mt-3 space-y-2", children: [
37809
- /* @__PURE__ */ jsx("div", { className: "text-xs text-gray-600 dark:text-gray-400 mb-1 font-medium uppercase tracking-wide", children: "Answer:" }),
37810
- answerSegments.map(
37811
- (segment, idx) => segment.type === "markdown" ? /* @__PURE__ */ jsx(MarkdownContent, { content: segment.content }, `a-md-${idx}`) : /* @__PURE__ */ jsx(
37812
- CodeBlock,
37813
- {
37814
- language: segment.language ?? "text",
37815
- code: segment.content
37816
- },
37817
- `a-code-${idx}`
37818
- )
37819
- )
37820
- ] })
37821
- ]
37822
- }
37823
- );
37824
- };
37825
- BloomQuizBlock.displayName = "BloomQuizBlock";
37826
- }
37827
- });
37828
37991
 
37829
37992
  // components/core/molecules/parseLessonSegments.ts
37830
37993
  function extractTagContent(content, tagName) {
@@ -37866,7 +38029,7 @@ function parseLessonSegments(lesson) {
37866
38029
  while ((match = tagRegex.exec(content)) !== null) {
37867
38030
  const before = content.slice(lastIndex, match.index);
37868
38031
  if (before.trim()) {
37869
- segments.push(...parseMarkdownWithCodeBlocks2(before));
38032
+ segments.push(...parseMarkdownWithCodeBlocks(before));
37870
38033
  }
37871
38034
  const g = match.groups ?? {};
37872
38035
  if (g.reflect || g.reflectUnclosed) {
@@ -37899,7 +38062,7 @@ function parseLessonSegments(lesson) {
37899
38062
  lastIndex = tagRegex.lastIndex;
37900
38063
  }
37901
38064
  const remaining = content.slice(lastIndex);
37902
- if (remaining.trim()) segments.push(...parseMarkdownWithCodeBlocks2(remaining));
38065
+ if (remaining.trim()) segments.push(...parseMarkdownWithCodeBlocks(remaining));
37903
38066
  return segments;
37904
38067
  }
37905
38068
  var init_parseLessonSegments = __esm({
@@ -39157,7 +39320,7 @@ var init_DialogueBubble = __esm({
39157
39320
  }
39158
39321
  });
39159
39322
  function extractTitle(children) {
39160
- if (!React74__default.isValidElement(children)) return void 0;
39323
+ if (!React77__default.isValidElement(children)) return void 0;
39161
39324
  const props = children.props;
39162
39325
  if (typeof props.title === "string") {
39163
39326
  return props.title;
@@ -39270,7 +39433,7 @@ function LinearView({
39270
39433
  /* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
39271
39434
  const isDone = i < currentIdx;
39272
39435
  const isCurrent = i === currentIdx;
39273
- return /* @__PURE__ */ jsxs(React74__default.Fragment, { children: [
39436
+ return /* @__PURE__ */ jsxs(React77__default.Fragment, { children: [
39274
39437
  i > 0 && /* @__PURE__ */ jsx(
39275
39438
  Typography,
39276
39439
  {
@@ -40228,12 +40391,12 @@ var init_Form = __esm({
40228
40391
  const isSchemaEntity = isOrbitalEntitySchema(entity);
40229
40392
  const resolvedEntity = isSchemaEntity ? entity : void 0;
40230
40393
  const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
40231
- const normalizedInitialData = React74__default.useMemo(() => {
40394
+ const normalizedInitialData = React77__default.useMemo(() => {
40232
40395
  const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
40233
40396
  const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
40234
40397
  return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
40235
40398
  }, [entity, initialData]);
40236
- const entityDerivedFields = React74__default.useMemo(() => {
40399
+ const entityDerivedFields = React77__default.useMemo(() => {
40237
40400
  if (fields && fields.length > 0) return void 0;
40238
40401
  if (!resolvedEntity) return void 0;
40239
40402
  return resolvedEntity.fields.map(
@@ -40253,16 +40416,16 @@ var init_Form = __esm({
40253
40416
  const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
40254
40417
  const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
40255
40418
  const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
40256
- const [formData, setFormData] = React74__default.useState(
40419
+ const [formData, setFormData] = React77__default.useState(
40257
40420
  normalizedInitialData
40258
40421
  );
40259
- const [collapsedSections, setCollapsedSections] = React74__default.useState(
40422
+ const [collapsedSections, setCollapsedSections] = React77__default.useState(
40260
40423
  /* @__PURE__ */ new Set()
40261
40424
  );
40262
- const [submitError, setSubmitError] = React74__default.useState(null);
40263
- const formRef = React74__default.useRef(null);
40425
+ const [submitError, setSubmitError] = React77__default.useState(null);
40426
+ const formRef = React77__default.useRef(null);
40264
40427
  const formMode = props.mode;
40265
- const mountedRef = React74__default.useRef(false);
40428
+ const mountedRef = React77__default.useRef(false);
40266
40429
  if (!mountedRef.current) {
40267
40430
  mountedRef.current = true;
40268
40431
  debug("forms", "mount", {
@@ -40275,7 +40438,7 @@ var init_Form = __esm({
40275
40438
  });
40276
40439
  }
40277
40440
  const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
40278
- const evalContext = React74__default.useMemo(
40441
+ const evalContext = React77__default.useMemo(
40279
40442
  () => ({
40280
40443
  formValues: formData,
40281
40444
  globalVariables: externalContext?.globalVariables ?? {},
@@ -40284,7 +40447,7 @@ var init_Form = __esm({
40284
40447
  }),
40285
40448
  [formData, externalContext]
40286
40449
  );
40287
- React74__default.useEffect(() => {
40450
+ React77__default.useEffect(() => {
40288
40451
  debug("forms", "initialData-sync", {
40289
40452
  mode: formMode,
40290
40453
  normalizedInitialData,
@@ -40295,7 +40458,7 @@ var init_Form = __esm({
40295
40458
  setFormData(normalizedInitialData);
40296
40459
  }
40297
40460
  }, [normalizedInitialData]);
40298
- const processCalculations = React74__default.useCallback(
40461
+ const processCalculations = React77__default.useCallback(
40299
40462
  (changedFieldId, newFormData) => {
40300
40463
  if (!hiddenCalculations.length) return;
40301
40464
  const context = {
@@ -40320,7 +40483,7 @@ var init_Form = __esm({
40320
40483
  },
40321
40484
  [hiddenCalculations, externalContext, eventBus]
40322
40485
  );
40323
- const checkViolations = React74__default.useCallback(
40486
+ const checkViolations = React77__default.useCallback(
40324
40487
  (changedFieldId, newFormData) => {
40325
40488
  if (!violationTriggers.length) return;
40326
40489
  const context = {
@@ -40358,7 +40521,7 @@ var init_Form = __esm({
40358
40521
  processCalculations(name, newFormData);
40359
40522
  checkViolations(name, newFormData);
40360
40523
  };
40361
- const isFieldVisible = React74__default.useCallback(
40524
+ const isFieldVisible = React77__default.useCallback(
40362
40525
  (fieldName) => {
40363
40526
  const condition = conditionalFields[fieldName];
40364
40527
  if (!condition) return true;
@@ -40366,7 +40529,7 @@ var init_Form = __esm({
40366
40529
  },
40367
40530
  [conditionalFields, evalContext]
40368
40531
  );
40369
- const isSectionVisible = React74__default.useCallback(
40532
+ const isSectionVisible = React77__default.useCallback(
40370
40533
  (section) => {
40371
40534
  if (!section.condition) return true;
40372
40535
  return Boolean(evaluateFormExpression(section.condition, evalContext));
@@ -40442,7 +40605,7 @@ var init_Form = __esm({
40442
40605
  eventBus.emit(`UI:${onCancel}`);
40443
40606
  }
40444
40607
  };
40445
- const renderField = React74__default.useCallback(
40608
+ const renderField = React77__default.useCallback(
40446
40609
  (field) => {
40447
40610
  const fieldName = field.name || field.field;
40448
40611
  if (!fieldName) return null;
@@ -40463,7 +40626,7 @@ var init_Form = __esm({
40463
40626
  [formData, isFieldVisible, relationsData, relationsLoading, isLoading]
40464
40627
  );
40465
40628
  const effectiveFields = entityDerivedFields ?? fields;
40466
- const normalizedFields = React74__default.useMemo(() => {
40629
+ const normalizedFields = React77__default.useMemo(() => {
40467
40630
  if (!effectiveFields || effectiveFields.length === 0) return [];
40468
40631
  return effectiveFields.map((field) => {
40469
40632
  if (typeof field === "string") {
@@ -40486,7 +40649,7 @@ var init_Form = __esm({
40486
40649
  return field;
40487
40650
  });
40488
40651
  }, [effectiveFields, resolvedEntity]);
40489
- const schemaFields = React74__default.useMemo(() => {
40652
+ const schemaFields = React77__default.useMemo(() => {
40490
40653
  if (normalizedFields.length === 0) return null;
40491
40654
  if (isDebugEnabled()) {
40492
40655
  debugGroup(`Form: ${entityName || "unknown"}`);
@@ -40496,7 +40659,7 @@ var init_Form = __esm({
40496
40659
  }
40497
40660
  return normalizedFields.map(renderField).filter(Boolean);
40498
40661
  }, [normalizedFields, renderField, entityName, conditionalFields]);
40499
- const sectionElements = React74__default.useMemo(() => {
40662
+ const sectionElements = React77__default.useMemo(() => {
40500
40663
  if (!sections || sections.length === 0) return null;
40501
40664
  return sections.map((section) => {
40502
40665
  if (!isSectionVisible(section)) {
@@ -41778,7 +41941,7 @@ var init_List = __esm({
41778
41941
  if (entity && typeof entity === "object" && "id" in entity) return [entity];
41779
41942
  return [];
41780
41943
  }, [entity]);
41781
- const getItemActions = React74__default.useCallback(
41944
+ const getItemActions = React77__default.useCallback(
41782
41945
  (item) => {
41783
41946
  if (!itemActions) return [];
41784
41947
  if (typeof itemActions === "function") {
@@ -42254,7 +42417,7 @@ var init_MediaGallery = __esm({
42254
42417
  [selectable, selectedItems, selectionEvent, eventBus]
42255
42418
  );
42256
42419
  const entityData = Array.isArray(entity) ? entity : [];
42257
- const items = React74__default.useMemo(() => {
42420
+ const items = React77__default.useMemo(() => {
42258
42421
  if (propItems) return propItems;
42259
42422
  if (entityData.length === 0) return [];
42260
42423
  return entityData.map((record, idx) => ({
@@ -42424,9 +42587,9 @@ function MiniMap({
42424
42587
  viewportRect,
42425
42588
  className
42426
42589
  }) {
42427
- const canvasRef = React74.useRef(null);
42428
- const frameRef = React74.useRef(0);
42429
- React74.useEffect(() => {
42590
+ const canvasRef = React77.useRef(null);
42591
+ const frameRef = React77.useRef(0);
42592
+ React77.useEffect(() => {
42430
42593
  const canvas = canvasRef.current;
42431
42594
  if (!canvas) return;
42432
42595
  const ctx = canvas.getContext("2d");
@@ -42508,7 +42671,7 @@ var init_MiniMap = __esm({
42508
42671
  }
42509
42672
  });
42510
42673
  function extractTitle2(children) {
42511
- if (!React74__default.isValidElement(children)) return void 0;
42674
+ if (!React77__default.isValidElement(children)) return void 0;
42512
42675
  const props = children.props;
42513
42676
  if (typeof props.title === "string") {
42514
42677
  return props.title;
@@ -42974,7 +43137,7 @@ var init_debugRegistry = __esm({
42974
43137
  }
42975
43138
  });
42976
43139
  function useDebugData() {
42977
- const [data, setData] = React74.useState(() => ({
43140
+ const [data, setData] = React77.useState(() => ({
42978
43141
  traits: [],
42979
43142
  ticks: [],
42980
43143
  guards: [],
@@ -42988,7 +43151,7 @@ function useDebugData() {
42988
43151
  },
42989
43152
  lastUpdate: Date.now()
42990
43153
  }));
42991
- React74.useEffect(() => {
43154
+ React77.useEffect(() => {
42992
43155
  const updateData = () => {
42993
43156
  setData({
42994
43157
  traits: getAllTraits(),
@@ -43097,12 +43260,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
43097
43260
  return positions;
43098
43261
  }
43099
43262
  function WalkMinimap() {
43100
- const [walkStep, setWalkStep] = React74.useState(null);
43101
- const [traits2, setTraits] = React74.useState([]);
43102
- const [coveredEdges, setCoveredEdges] = React74.useState([]);
43103
- const [completedTraits, setCompletedTraits] = React74.useState(/* @__PURE__ */ new Set());
43104
- const prevTraitRef = React74.useRef(null);
43105
- React74.useEffect(() => {
43263
+ const [walkStep, setWalkStep] = React77.useState(null);
43264
+ const [traits2, setTraits] = React77.useState([]);
43265
+ const [coveredEdges, setCoveredEdges] = React77.useState([]);
43266
+ const [completedTraits, setCompletedTraits] = React77.useState(/* @__PURE__ */ new Set());
43267
+ const prevTraitRef = React77.useRef(null);
43268
+ React77.useEffect(() => {
43106
43269
  const interval = setInterval(() => {
43107
43270
  const w = window;
43108
43271
  const step = w.__orbitalWalkStep;
@@ -43538,15 +43701,15 @@ var init_EntitiesTab = __esm({
43538
43701
  });
43539
43702
  function EventFlowTab({ events: events2 }) {
43540
43703
  const { t } = useTranslate();
43541
- const [filter, setFilter] = React74.useState("all");
43542
- const containerRef = React74.useRef(null);
43543
- const [autoScroll, setAutoScroll] = React74.useState(true);
43544
- React74.useEffect(() => {
43704
+ const [filter, setFilter] = React77.useState("all");
43705
+ const containerRef = React77.useRef(null);
43706
+ const [autoScroll, setAutoScroll] = React77.useState(true);
43707
+ React77.useEffect(() => {
43545
43708
  if (autoScroll && containerRef.current) {
43546
43709
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
43547
43710
  }
43548
43711
  }, [events2.length, autoScroll]);
43549
- const filteredEvents = React74.useMemo(() => {
43712
+ const filteredEvents = React77.useMemo(() => {
43550
43713
  if (filter === "all") return events2;
43551
43714
  return events2.filter((e) => e.type === filter);
43552
43715
  }, [events2, filter]);
@@ -43662,7 +43825,7 @@ var init_EventFlowTab = __esm({
43662
43825
  });
43663
43826
  function GuardsPanel({ guards }) {
43664
43827
  const { t } = useTranslate();
43665
- const [filter, setFilter] = React74.useState("all");
43828
+ const [filter, setFilter] = React77.useState("all");
43666
43829
  if (guards.length === 0) {
43667
43830
  return /* @__PURE__ */ jsx(
43668
43831
  EmptyState,
@@ -43675,7 +43838,7 @@ function GuardsPanel({ guards }) {
43675
43838
  }
43676
43839
  const passedCount = guards.filter((g) => g.result).length;
43677
43840
  const failedCount = guards.length - passedCount;
43678
- const filteredGuards = React74.useMemo(() => {
43841
+ const filteredGuards = React77.useMemo(() => {
43679
43842
  if (filter === "all") return guards;
43680
43843
  if (filter === "passed") return guards.filter((g) => g.result);
43681
43844
  return guards.filter((g) => !g.result);
@@ -43838,10 +44001,10 @@ function EffectBadge({ effect }) {
43838
44001
  }
43839
44002
  function TransitionTimeline({ transitions }) {
43840
44003
  const { t } = useTranslate();
43841
- const containerRef = React74.useRef(null);
43842
- const [autoScroll, setAutoScroll] = React74.useState(true);
43843
- const [expandedId, setExpandedId] = React74.useState(null);
43844
- React74.useEffect(() => {
44004
+ const containerRef = React77.useRef(null);
44005
+ const [autoScroll, setAutoScroll] = React77.useState(true);
44006
+ const [expandedId, setExpandedId] = React77.useState(null);
44007
+ React77.useEffect(() => {
43845
44008
  if (autoScroll && containerRef.current) {
43846
44009
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
43847
44010
  }
@@ -44121,9 +44284,9 @@ function getAllEvents(traits2) {
44121
44284
  function EventDispatcherTab({ traits: traits2, schema }) {
44122
44285
  const eventBus = useEventBus();
44123
44286
  const { t } = useTranslate();
44124
- const [log9, setLog] = React74.useState([]);
44125
- const prevStatesRef = React74.useRef(/* @__PURE__ */ new Map());
44126
- React74.useEffect(() => {
44287
+ const [log9, setLog] = React77.useState([]);
44288
+ const prevStatesRef = React77.useRef(/* @__PURE__ */ new Map());
44289
+ React77.useEffect(() => {
44127
44290
  for (const trait of traits2) {
44128
44291
  const prev = prevStatesRef.current.get(trait.id);
44129
44292
  if (prev && prev !== trait.currentState) {
@@ -44292,10 +44455,10 @@ function VerifyModePanel({
44292
44455
  localCount
44293
44456
  }) {
44294
44457
  const { t } = useTranslate();
44295
- const [expanded, setExpanded] = React74.useState(true);
44296
- const scrollRef = React74.useRef(null);
44297
- const prevCountRef = React74.useRef(0);
44298
- React74.useEffect(() => {
44458
+ const [expanded, setExpanded] = React77.useState(true);
44459
+ const scrollRef = React77.useRef(null);
44460
+ const prevCountRef = React77.useRef(0);
44461
+ React77.useEffect(() => {
44299
44462
  if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
44300
44463
  scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
44301
44464
  }
@@ -44352,10 +44515,10 @@ function RuntimeDebugger({
44352
44515
  schema
44353
44516
  }) {
44354
44517
  const { t } = useTranslate();
44355
- const [isCollapsed, setIsCollapsed] = React74.useState(mode === "verify" ? true : defaultCollapsed);
44356
- const [isVisible, setIsVisible] = React74.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
44518
+ const [isCollapsed, setIsCollapsed] = React77.useState(mode === "verify" ? true : defaultCollapsed);
44519
+ const [isVisible, setIsVisible] = React77.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
44357
44520
  const debugData = useDebugData();
44358
- React74.useEffect(() => {
44521
+ React77.useEffect(() => {
44359
44522
  if (mode === "inline") return;
44360
44523
  return onDebugToggle((enabled) => {
44361
44524
  setIsVisible(enabled);
@@ -44364,7 +44527,7 @@ function RuntimeDebugger({
44364
44527
  }
44365
44528
  });
44366
44529
  }, [mode]);
44367
- React74.useEffect(() => {
44530
+ React77.useEffect(() => {
44368
44531
  if (mode === "inline") return;
44369
44532
  const handleKeyDown = (e) => {
44370
44533
  if (e.key === "`" && isVisible) {
@@ -44584,6 +44747,117 @@ var init_RuntimeDebugger2 = __esm({
44584
44747
  RuntimeDebugger.displayName = "RuntimeDebugger";
44585
44748
  }
44586
44749
  });
44750
+ var SegmentRenderer;
44751
+ var init_SegmentRenderer = __esm({
44752
+ "components/core/organisms/SegmentRenderer.tsx"() {
44753
+ "use client";
44754
+ init_MarkdownContent();
44755
+ init_CodeBlock();
44756
+ init_QuizBlock();
44757
+ init_ActivationBlock();
44758
+ init_ConnectionBlock();
44759
+ init_ReflectionBlock();
44760
+ init_BloomQuizBlock();
44761
+ init_CodeRunnerPanel();
44762
+ init_cn();
44763
+ SegmentRenderer = ({
44764
+ segments,
44765
+ className,
44766
+ containerClassName,
44767
+ userProgress,
44768
+ onRunCodeSimulation,
44769
+ onRenderVisualization
44770
+ }) => {
44771
+ if (segments.length === 0) return null;
44772
+ let reflectIndex = 0;
44773
+ let bloomIndex = 0;
44774
+ return /* @__PURE__ */ jsx(
44775
+ "div",
44776
+ {
44777
+ className: cn(
44778
+ "border border-gray-200 dark:border-gray-700 rounded-lg p-2 md:p-4 overflow-x-auto space-y-6",
44779
+ containerClassName,
44780
+ className
44781
+ ),
44782
+ children: segments.map((segment, index) => {
44783
+ if (segment.type === "markdown") {
44784
+ return /* @__PURE__ */ jsx(MarkdownContent, { content: segment.content }, `md-${index}`);
44785
+ }
44786
+ if (segment.type === "code") {
44787
+ if (segment.runnable && onRunCodeSimulation) {
44788
+ return /* @__PURE__ */ jsx(
44789
+ CodeRunnerPanel,
44790
+ {
44791
+ language: segment.language,
44792
+ code: segment.content,
44793
+ runnable: true,
44794
+ onRun: (code) => onRunCodeSimulation(code, segment.language)
44795
+ },
44796
+ `code-${index}`
44797
+ );
44798
+ }
44799
+ return /* @__PURE__ */ jsx(
44800
+ CodeBlock,
44801
+ {
44802
+ language: segment.language ?? "text",
44803
+ code: segment.content
44804
+ },
44805
+ `code-${index}`
44806
+ );
44807
+ }
44808
+ if (segment.type === "quiz") {
44809
+ return /* @__PURE__ */ jsx(QuizBlock, { question: segment.question, answer: segment.answer }, `quiz-${index}`);
44810
+ }
44811
+ if (segment.type === "activate") {
44812
+ return /* @__PURE__ */ jsx(
44813
+ ActivationBlock,
44814
+ {
44815
+ question: segment.question,
44816
+ savedResponse: userProgress?.activationResponse
44817
+ },
44818
+ `activate-${index}`
44819
+ );
44820
+ }
44821
+ if (segment.type === "connect") {
44822
+ return /* @__PURE__ */ jsx(ConnectionBlock, { content: segment.content }, `connect-${index}`);
44823
+ }
44824
+ if (segment.type === "reflect") {
44825
+ const ri = reflectIndex++;
44826
+ return /* @__PURE__ */ jsx(
44827
+ ReflectionBlock,
44828
+ {
44829
+ prompt: segment.prompt,
44830
+ index: ri,
44831
+ savedNote: userProgress?.reflectionNotes?.[ri]
44832
+ },
44833
+ `reflect-${index}`
44834
+ );
44835
+ }
44836
+ if (segment.type === "bloom") {
44837
+ const bi = bloomIndex++;
44838
+ return /* @__PURE__ */ jsx(
44839
+ BloomQuizBlock,
44840
+ {
44841
+ level: segment.level,
44842
+ question: segment.question,
44843
+ answer: segment.answer,
44844
+ index: bi,
44845
+ isAnswered: userProgress?.bloomAnswered?.[bi]
44846
+ },
44847
+ `bloom-${index}`
44848
+ );
44849
+ }
44850
+ if (segment.type === "visualization") {
44851
+ return onRenderVisualization ? onRenderVisualization(segment.visualizationType, segment.description, index) ?? null : null;
44852
+ }
44853
+ return null;
44854
+ })
44855
+ }
44856
+ );
44857
+ };
44858
+ SegmentRenderer.displayName = "SegmentRenderer";
44859
+ }
44860
+ });
44587
44861
  function TraitSlot({
44588
44862
  slotNumber,
44589
44863
  equippedItem,
@@ -44813,7 +45087,7 @@ function SequenceBar({
44813
45087
  onSlotRemove(index);
44814
45088
  }, [onSlotRemove, playing]);
44815
45089
  const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
44816
- return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React74__default.Fragment, { children: [
45090
+ return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React77__default.Fragment, { children: [
44817
45091
  i > 0 && /* @__PURE__ */ jsx(
44818
45092
  Typography,
44819
45093
  {
@@ -45903,7 +46177,7 @@ var init_StatCard = __esm({
45903
46177
  const labelToUse = propLabel ?? propTitle;
45904
46178
  const eventBus = useEventBus();
45905
46179
  const { t } = useTranslate();
45906
- const handleActionClick = React74__default.useCallback(() => {
46180
+ const handleActionClick = React77__default.useCallback(() => {
45907
46181
  if (action?.event) {
45908
46182
  eventBus.emit(`UI:${action.event}`, {});
45909
46183
  }
@@ -45914,7 +46188,7 @@ var init_StatCard = __esm({
45914
46188
  const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
45915
46189
  const isLoading = externalLoading ?? false;
45916
46190
  const error = externalError;
45917
- const computeMetricValue = React74__default.useCallback(
46191
+ const computeMetricValue = React77__default.useCallback(
45918
46192
  (metric, items) => {
45919
46193
  if (metric.value !== void 0) {
45920
46194
  return metric.value;
@@ -45953,7 +46227,7 @@ var init_StatCard = __esm({
45953
46227
  },
45954
46228
  []
45955
46229
  );
45956
- const schemaStats = React74__default.useMemo(() => {
46230
+ const schemaStats = React77__default.useMemo(() => {
45957
46231
  if (!metrics || metrics.length === 0) return null;
45958
46232
  return metrics.map((metric) => ({
45959
46233
  label: metric.label,
@@ -45961,7 +46235,7 @@ var init_StatCard = __esm({
45961
46235
  format: metric.format
45962
46236
  }));
45963
46237
  }, [metrics, data, computeMetricValue]);
45964
- const calculatedTrend = React74__default.useMemo(() => {
46238
+ const calculatedTrend = React77__default.useMemo(() => {
45965
46239
  if (manualTrend !== void 0) return manualTrend;
45966
46240
  if (previousValue === void 0 || currentValue2 === void 0)
45967
46241
  return void 0;
@@ -46998,7 +47272,7 @@ var init_Timeline = __esm({
46998
47272
  }) => {
46999
47273
  const { t } = useTranslate();
47000
47274
  const entityData = Array.isArray(entity) ? entity : [];
47001
- const items = React74__default.useMemo(() => {
47275
+ const items = React77__default.useMemo(() => {
47002
47276
  if (propItems) return propItems;
47003
47277
  if (entityData.length === 0) return [];
47004
47278
  return entityData.map((record, idx) => {
@@ -47155,7 +47429,7 @@ var init_TimerDisplay = __esm({
47155
47429
  }
47156
47430
  });
47157
47431
  function extractToastProps(children) {
47158
- if (!React74__default.isValidElement(children)) {
47432
+ if (!React77__default.isValidElement(children)) {
47159
47433
  if (typeof children === "string") {
47160
47434
  return { message: children };
47161
47435
  }
@@ -47193,7 +47467,7 @@ var init_ToastSlot = __esm({
47193
47467
  eventBus.emit("UI:CLOSE");
47194
47468
  };
47195
47469
  if (!isVisible) return null;
47196
- const isCustomContent = React74__default.isValidElement(children) && !message;
47470
+ const isCustomContent = React77__default.isValidElement(children) && !message;
47197
47471
  return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
47198
47472
  Toast,
47199
47473
  {
@@ -47737,8 +48011,8 @@ function XPBar({
47737
48011
  }) {
47738
48012
  const sizes = sizeMap18[size];
47739
48013
  const percentage = max > 0 ? Math.max(0, Math.min(100, current / max * 100)) : 0;
47740
- const [fillWidth, setFillWidth] = React74.useState(animated ? 0 : percentage);
47741
- React74.useEffect(() => {
48014
+ const [fillWidth, setFillWidth] = React77.useState(animated ? 0 : percentage);
48015
+ React77.useEffect(() => {
47742
48016
  if (!animated) {
47743
48017
  setFillWidth(percentage);
47744
48018
  return;
@@ -47811,7 +48085,7 @@ var init_XPBar = __esm({
47811
48085
  }
47812
48086
  });
47813
48087
  function lazyThree(name, loader) {
47814
- const Lazy = React74__default.lazy(
48088
+ const Lazy = React77__default.lazy(
47815
48089
  () => loader().then((m) => {
47816
48090
  const Resolved = m[name];
47817
48091
  if (!Resolved) {
@@ -47823,13 +48097,13 @@ function lazyThree(name, loader) {
47823
48097
  })
47824
48098
  );
47825
48099
  function ThreeWrapper(props) {
47826
- return React74__default.createElement(
48100
+ return React77__default.createElement(
47827
48101
  ThreeBoundary,
47828
48102
  { name },
47829
- React74__default.createElement(
47830
- React74__default.Suspense,
48103
+ React77__default.createElement(
48104
+ React77__default.Suspense,
47831
48105
  { fallback: null },
47832
- React74__default.createElement(Lazy, props)
48106
+ React77__default.createElement(Lazy, props)
47833
48107
  )
47834
48108
  );
47835
48109
  }
@@ -47845,6 +48119,7 @@ var init_component_registry_generated = __esm({
47845
48119
  init_ActionButtons();
47846
48120
  init_ActionPalette();
47847
48121
  init_ActionTile();
48122
+ init_ActivationBlock();
47848
48123
  init_ComponentPatterns();
47849
48124
  init_AnimatedCounter2();
47850
48125
  init_AnimatedGraphic();
@@ -47857,6 +48132,7 @@ var init_component_registry_generated = __esm({
47857
48132
  init_BattleBoard();
47858
48133
  init_BattleTemplate();
47859
48134
  init_BehaviorView();
48135
+ init_BloomQuizBlock();
47860
48136
  init_BookChapterView();
47861
48137
  init_BookCoverPage();
47862
48138
  init_BookNavBar();
@@ -47884,12 +48160,14 @@ var init_component_registry_generated = __esm({
47884
48160
  init_ChoiceButton();
47885
48161
  init_ClassifierBoard();
47886
48162
  init_CodeBlock();
48163
+ init_CodeRunnerPanel();
47887
48164
  init_CombatLog();
47888
48165
  init_ComboCounter();
47889
48166
  init_CommunityLinks();
47890
48167
  init_ConditionalWrapper();
47891
48168
  init_ConfettiEffect();
47892
48169
  init_ConfirmDialog();
48170
+ init_ConnectionBlock();
47893
48171
  init_Container();
47894
48172
  init_ContentRenderer();
47895
48173
  init_ContentSection();
@@ -48017,6 +48295,7 @@ var init_component_registry_generated = __esm({
48017
48295
  init_QuizBlock();
48018
48296
  init_Radio();
48019
48297
  init_RangeSlider();
48298
+ init_ReflectionBlock();
48020
48299
  init_RelationSelect();
48021
48300
  init_RepeatableFormSection();
48022
48301
  init_ReplyTree();
@@ -48031,6 +48310,7 @@ var init_component_registry_generated = __esm({
48031
48310
  init_SearchInput();
48032
48311
  init_Section();
48033
48312
  init_SectionHeader();
48313
+ init_SegmentRenderer();
48034
48314
  init_Select();
48035
48315
  init_SequenceBar();
48036
48316
  init_SequencerBoard();
@@ -48122,7 +48402,7 @@ var init_component_registry_generated = __esm({
48122
48402
  init_WorldMapBoard();
48123
48403
  init_WorldMapTemplate();
48124
48404
  init_XPBar();
48125
- ThreeBoundary = class extends React74__default.Component {
48405
+ ThreeBoundary = class extends React77__default.Component {
48126
48406
  constructor() {
48127
48407
  super(...arguments);
48128
48408
  __publicField(this, "state", { failed: false });
@@ -48132,7 +48412,7 @@ var init_component_registry_generated = __esm({
48132
48412
  }
48133
48413
  render() {
48134
48414
  if (this.state.failed) {
48135
- return React74__default.createElement(
48415
+ return React77__default.createElement(
48136
48416
  "div",
48137
48417
  {
48138
48418
  "data-testid": "three-unavailable",
@@ -48156,6 +48436,7 @@ var init_component_registry_generated = __esm({
48156
48436
  "ActionButtons": ActionButtons,
48157
48437
  "ActionPalette": ActionPalette,
48158
48438
  "ActionTile": ActionTile,
48439
+ "ActivationBlock": ActivationBlock,
48159
48440
  "Alert": AlertPattern,
48160
48441
  "AlertPattern": AlertPattern,
48161
48442
  "AnimatedCounter": AnimatedCounter2,
@@ -48169,6 +48450,7 @@ var init_component_registry_generated = __esm({
48169
48450
  "BattleBoard": BattleBoard,
48170
48451
  "BattleTemplate": BattleTemplate,
48171
48452
  "BehaviorView": BehaviorView,
48453
+ "BloomQuizBlock": BloomQuizBlock,
48172
48454
  "BookChapterView": BookChapterView,
48173
48455
  "BookCoverPage": BookCoverPage,
48174
48456
  "BookNavBar": BookNavBar,
@@ -48199,12 +48481,14 @@ var init_component_registry_generated = __esm({
48199
48481
  "ChoiceButton": ChoiceButton,
48200
48482
  "ClassifierBoard": ClassifierBoard,
48201
48483
  "CodeBlock": CodeBlock,
48484
+ "CodeRunnerPanel": CodeRunnerPanel,
48202
48485
  "CombatLog": CombatLog,
48203
48486
  "ComboCounter": ComboCounter,
48204
48487
  "CommunityLinks": CommunityLinks,
48205
48488
  "ConditionalWrapper": ConditionalWrapper,
48206
48489
  "ConfettiEffect": ConfettiEffect,
48207
48490
  "ConfirmDialog": ConfirmDialog,
48491
+ "ConnectionBlock": ConnectionBlock,
48208
48492
  "Container": Container,
48209
48493
  "ContentRenderer": ContentRenderer,
48210
48494
  "ContentSection": ContentSection,
@@ -48341,6 +48625,7 @@ var init_component_registry_generated = __esm({
48341
48625
  "QuizBlock": QuizBlock,
48342
48626
  "Radio": Radio,
48343
48627
  "RangeSlider": RangeSlider,
48628
+ "ReflectionBlock": ReflectionBlock,
48344
48629
  "RelationSelect": RelationSelect,
48345
48630
  "RepeatableFormSection": RepeatableFormSection,
48346
48631
  "ReplyTree": ReplyTree,
@@ -48355,6 +48640,7 @@ var init_component_registry_generated = __esm({
48355
48640
  "SearchInput": SearchInput,
48356
48641
  "Section": Section,
48357
48642
  "SectionHeader": SectionHeader,
48643
+ "SegmentRenderer": SegmentRenderer,
48358
48644
  "Select": Select,
48359
48645
  "SequenceBar": SequenceBar,
48360
48646
  "SequencerBoard": SequencerBoard,
@@ -48468,7 +48754,7 @@ function SuspenseConfigProvider({
48468
48754
  config,
48469
48755
  children
48470
48756
  }) {
48471
- return React74__default.createElement(
48757
+ return React77__default.createElement(
48472
48758
  SuspenseConfigContext.Provider,
48473
48759
  { value: config },
48474
48760
  children
@@ -48958,7 +49244,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
48958
49244
  const key = `${parentId}-${index}-trait:${traitName}`;
48959
49245
  return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
48960
49246
  }
48961
- return /* @__PURE__ */ jsx(React74__default.Fragment, { children: child }, `${parentId}-${index}`);
49247
+ return /* @__PURE__ */ jsx(React77__default.Fragment, { children: child }, `${parentId}-${index}`);
48962
49248
  }
48963
49249
  if (!child || typeof child !== "object") return null;
48964
49250
  const childId = `${parentId}-${index}`;
@@ -48998,14 +49284,14 @@ function isPatternConfig(value) {
48998
49284
  if (value === null || value === void 0) return false;
48999
49285
  if (typeof value !== "object") return false;
49000
49286
  if (Array.isArray(value)) return false;
49001
- if (React74__default.isValidElement(value)) return false;
49287
+ if (React77__default.isValidElement(value)) return false;
49002
49288
  if (value instanceof Date) return false;
49003
49289
  if (typeof value === "function") return false;
49004
49290
  const record = value;
49005
49291
  return "type" in record && typeof record.type === "string";
49006
49292
  }
49007
49293
  function isPlainConfigObject(value) {
49008
- if (React74__default.isValidElement(value)) return false;
49294
+ if (React77__default.isValidElement(value)) return false;
49009
49295
  if (value instanceof Date) return false;
49010
49296
  const proto = Object.getPrototypeOf(value);
49011
49297
  return proto === Object.prototype || proto === null;
@@ -50426,271 +50712,8 @@ init_StepFlowOrganism();
50426
50712
  init_ShowcaseOrganism();
50427
50713
  init_TeamOrganism();
50428
50714
  init_CaseStudyOrganism();
50429
-
50430
- // components/core/organisms/CodeRunnerPanel.tsx
50431
- init_Box();
50432
- init_Button();
50433
- init_Badge();
50434
- init_Typography();
50435
- init_Stack();
50436
- init_CodeBlock();
50437
- init_useEventBus();
50438
- init_cn();
50439
- var CodeRunnerPanel = ({
50440
- code: initialCode,
50441
- language,
50442
- runnable = true,
50443
- onRun,
50444
- runEvent = "RUN_CODE",
50445
- className
50446
- }) => {
50447
- const eventBus = useEventBus();
50448
- const { t } = useTranslate();
50449
- const [code, setCode] = useState(initialCode);
50450
- const [output, setOutput] = useState(null);
50451
- const [error, setError] = useState(null);
50452
- const [isRunning, setIsRunning] = useState(false);
50453
- const handleRun = useCallback(async () => {
50454
- if (!onRun) return;
50455
- setIsRunning(true);
50456
- setError(null);
50457
- setOutput(null);
50458
- try {
50459
- const result = await onRun(code);
50460
- setOutput(result);
50461
- eventBus.emit(`UI:${runEvent}`, { language, exitCode: result.exitCode });
50462
- } catch (err) {
50463
- const message = err instanceof Error ? err.message : t("common.error");
50464
- setError(message);
50465
- eventBus.emit(`UI:${runEvent}`, { language, exitCode: 1, error: message });
50466
- } finally {
50467
- setIsRunning(false);
50468
- }
50469
- }, [code, language, onRun, runEvent, eventBus, t]);
50470
- const handleReset = useCallback(() => {
50471
- setCode(initialCode);
50472
- setOutput(null);
50473
- setError(null);
50474
- }, [initialCode]);
50475
- if (!runnable || !onRun) {
50476
- return /* @__PURE__ */ jsx(Box, { className, children: /* @__PURE__ */ jsx(CodeBlock, { language, code }) });
50477
- }
50478
- const hasOutput = output !== null || error !== null;
50479
- return /* @__PURE__ */ jsxs(Box, { className: cn("space-y-3", className), children: [
50480
- /* @__PURE__ */ jsx(
50481
- CodeBlock,
50482
- {
50483
- language,
50484
- code,
50485
- editable: true,
50486
- onChange: setCode,
50487
- showLanguageBadge: true,
50488
- showCopyButton: true
50489
- }
50490
- ),
50491
- /* @__PURE__ */ jsxs(HStack, { gap: "sm", justify: "between", children: [
50492
- /* @__PURE__ */ jsxs(HStack, { gap: "sm", children: [
50493
- /* @__PURE__ */ jsx(
50494
- Button,
50495
- {
50496
- variant: "primary",
50497
- size: "sm",
50498
- onClick: handleRun,
50499
- disabled: isRunning,
50500
- className: "min-w-[5rem]",
50501
- children: isRunning ? /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-2", children: [
50502
- /* @__PURE__ */ jsx(RotateCcw, { size: 16, className: "animate-spin" }),
50503
- t("common.loading")
50504
- ] }) : /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-2", children: [
50505
- /* @__PURE__ */ jsx(Play, { size: 16 }),
50506
- "Run"
50507
- ] })
50508
- }
50509
- ),
50510
- /* @__PURE__ */ jsx(
50511
- Button,
50512
- {
50513
- variant: "secondary",
50514
- size: "sm",
50515
- onClick: handleReset,
50516
- disabled: isRunning,
50517
- children: /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-2", children: [
50518
- /* @__PURE__ */ jsx(RotateCcw, { size: 16 }),
50519
- "Reset"
50520
- ] })
50521
- }
50522
- )
50523
- ] }),
50524
- output && /* @__PURE__ */ jsxs(
50525
- Badge,
50526
- {
50527
- variant: output.exitCode === 0 ? "success" : "danger",
50528
- size: "sm",
50529
- children: [
50530
- "Exit ",
50531
- output.exitCode
50532
- ]
50533
- }
50534
- )
50535
- ] }),
50536
- hasOutput && /* @__PURE__ */ jsxs(Box, { className: "rounded-lg border border-gray-700 bg-[#0d0d0d] overflow-hidden", children: [
50537
- /* @__PURE__ */ jsxs(
50538
- HStack,
50539
- {
50540
- gap: "sm",
50541
- align: "center",
50542
- className: "px-3 py-2 bg-gray-800 border-b border-gray-700",
50543
- children: [
50544
- /* @__PURE__ */ jsx(Terminal, { size: 16, className: "text-gray-400" }),
50545
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-300 font-medium", children: "Output" })
50546
- ]
50547
- }
50548
- ),
50549
- /* @__PURE__ */ jsx(VStack, { gap: "none", className: "p-3 font-mono text-sm", children: error ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-red-400 whitespace-pre-wrap", children: error }) : /* @__PURE__ */ jsxs(Fragment, { children: [
50550
- output?.stdout ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-200 whitespace-pre-wrap", children: output.stdout }) : null,
50551
- output?.stderr ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-red-400 whitespace-pre-wrap", children: output.stderr }) : null,
50552
- !output?.stdout && !output?.stderr ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-500 italic", children: "No output" }) : null,
50553
- output && output.testResults.length > 0 && /* @__PURE__ */ jsx(Box, { className: "mt-3 pt-3 border-t border-gray-700 space-y-2", children: output.testResults.map((test, index) => /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "start", className: "text-xs", children: [
50554
- test.passed ? /* @__PURE__ */ jsx(CheckCircle, { size: 14, className: "text-green-400 mt-0.5" }) : /* @__PURE__ */ jsx(XCircle, { size: 14, className: "text-red-400 mt-0.5" }),
50555
- /* @__PURE__ */ jsxs(VStack, { gap: "xs", className: "flex-1", children: [
50556
- /* @__PURE__ */ jsxs(
50557
- Typography,
50558
- {
50559
- variant: "small",
50560
- className: test.passed ? "text-green-400" : "text-red-400",
50561
- children: [
50562
- "Test ",
50563
- index + 1,
50564
- ": ",
50565
- test.passed ? "passed" : "failed"
50566
- ]
50567
- }
50568
- ),
50569
- /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-gray-400", children: [
50570
- "Input: ",
50571
- test.input
50572
- ] }),
50573
- /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-gray-400", children: [
50574
- "Expected: ",
50575
- test.expectedOutput
50576
- ] }),
50577
- /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-gray-400", children: [
50578
- "Actual: ",
50579
- test.actualOutput
50580
- ] })
50581
- ] })
50582
- ] }, index)) })
50583
- ] }) })
50584
- ] })
50585
- ] });
50586
- };
50587
- CodeRunnerPanel.displayName = "CodeRunnerPanel";
50588
-
50589
- // components/core/organisms/SegmentRenderer.tsx
50590
- init_MarkdownContent();
50591
- init_CodeBlock();
50592
- init_QuizBlock();
50593
- init_ActivationBlock();
50594
- init_ConnectionBlock();
50595
- init_ReflectionBlock();
50596
- init_BloomQuizBlock();
50597
- init_cn();
50598
- var SegmentRenderer = ({
50599
- segments,
50600
- className,
50601
- containerClassName,
50602
- userProgress,
50603
- onRunCodeSimulation,
50604
- onRenderVisualization
50605
- }) => {
50606
- if (segments.length === 0) return null;
50607
- let reflectIndex = 0;
50608
- let bloomIndex = 0;
50609
- return /* @__PURE__ */ jsx(
50610
- "div",
50611
- {
50612
- className: cn(
50613
- "border border-gray-200 dark:border-gray-700 rounded-lg p-2 md:p-4 overflow-x-auto space-y-6",
50614
- containerClassName,
50615
- className
50616
- ),
50617
- children: segments.map((segment, index) => {
50618
- if (segment.type === "markdown") {
50619
- return /* @__PURE__ */ jsx(MarkdownContent, { content: segment.content }, `md-${index}`);
50620
- }
50621
- if (segment.type === "code") {
50622
- if (segment.runnable && onRunCodeSimulation) {
50623
- return /* @__PURE__ */ jsx(
50624
- CodeRunnerPanel,
50625
- {
50626
- language: segment.language,
50627
- code: segment.content,
50628
- runnable: true,
50629
- onRun: (code) => onRunCodeSimulation(code, segment.language)
50630
- },
50631
- `code-${index}`
50632
- );
50633
- }
50634
- return /* @__PURE__ */ jsx(
50635
- CodeBlock,
50636
- {
50637
- language: segment.language ?? "text",
50638
- code: segment.content
50639
- },
50640
- `code-${index}`
50641
- );
50642
- }
50643
- if (segment.type === "quiz") {
50644
- return /* @__PURE__ */ jsx(QuizBlock, { question: segment.question, answer: segment.answer }, `quiz-${index}`);
50645
- }
50646
- if (segment.type === "activate") {
50647
- return /* @__PURE__ */ jsx(
50648
- ActivationBlock,
50649
- {
50650
- question: segment.question,
50651
- savedResponse: userProgress?.activationResponse
50652
- },
50653
- `activate-${index}`
50654
- );
50655
- }
50656
- if (segment.type === "connect") {
50657
- return /* @__PURE__ */ jsx(ConnectionBlock, { content: segment.content }, `connect-${index}`);
50658
- }
50659
- if (segment.type === "reflect") {
50660
- const ri = reflectIndex++;
50661
- return /* @__PURE__ */ jsx(
50662
- ReflectionBlock,
50663
- {
50664
- prompt: segment.prompt,
50665
- index: ri,
50666
- savedNote: userProgress?.reflectionNotes?.[ri]
50667
- },
50668
- `reflect-${index}`
50669
- );
50670
- }
50671
- if (segment.type === "bloom") {
50672
- const bi = bloomIndex++;
50673
- return /* @__PURE__ */ jsx(
50674
- BloomQuizBlock,
50675
- {
50676
- level: segment.level,
50677
- question: segment.question,
50678
- answer: segment.answer,
50679
- index: bi,
50680
- isAnswered: userProgress?.bloomAnswered?.[bi]
50681
- },
50682
- `bloom-${index}`
50683
- );
50684
- }
50685
- if (segment.type === "visualization") {
50686
- return onRenderVisualization ? onRenderVisualization(segment.visualizationType, segment.description, index) ?? null : null;
50687
- }
50688
- return null;
50689
- })
50690
- }
50691
- );
50692
- };
50693
- SegmentRenderer.displayName = "SegmentRenderer";
50715
+ init_CodeRunnerPanel();
50716
+ init_SegmentRenderer();
50694
50717
 
50695
50718
  // components/core/templates/index.ts
50696
50719
  init_DashboardLayout();
@@ -50710,4 +50733,4 @@ init_AboutPageTemplate();
50710
50733
  // components/index.ts
50711
50734
  init_cn();
50712
50735
 
50713
- export { ALL_PRESETS, AR_BOOK_FIELDS, AboutPageTemplate, Accordion, ActionButton, ActionButtons, Card2 as ActionCard, ActionPalette, ActionTile, ActivationBlock, Alert, AnimatedCounter, AnimatedGraphic, AnimatedReveal, ArticleSection, Aside, AssetPicker, AuthLayout, Avatar, Badge, BattleBoard, BattleTemplate, BehaviorView, BloomQuizBlock, BookChapterView, BookCoverPage, BookNavBar, BookTableOfContents, BookViewer, Box, BranchingLogicBuilder, Breadcrumb, BuilderBoard, Button, ButtonGroup, CTABanner, CalendarGrid, CanvasEffect, Card, CardBody, CardContent, CardFooter, CardGrid, CardHeader, CardTitle, Carousel, CaseStudyCard, CaseStudyOrganism, CastleBoard, CastleTemplate, Center, Chart, ChartLegend, Checkbox, ChoiceButton, ClassifierBoard, Coachmark, CodeBlock, CodeRunnerPanel, CollapsibleSection, CombatLog, ComboCounter, CommunityLinks, ConditionalWrapper, ConfettiEffect, ConfirmDialog, ConnectionBlock, Container, ContentRenderer, ContentSection, ControlButton, CounterTemplate, CraftingRecipe, DEFAULT_LIKERT_OPTIONS, DEFAULT_MATRIX_COLUMNS, DIAMOND_TOP_Y, DPad, DamageNumber, DashboardGrid, DashboardLayout, DataGrid, DataList, DataTable, DateRangePicker, DateRangeSelector, DayCell, DebuggerBoard, DetailPanel, Dialog, DialogueBox, DialogueBubble, Divider, DocBreadcrumb, DocPagination, DocSearch, DocSidebar, DocTOC, DocumentViewer, StateMachineView as DomStateMachineVisualizer, Drawer, DrawerSlot, EdgeDecoration, EditorCheckbox, EditorSelect, EditorSlider, EditorTextInput, EditorToolbar, EmptyState, EnemyPlate, EntityDisplayEvents, ErrorBoundary, ErrorState, EventHandlerBoard, EventLog, FEATURE_COLORS, FEATURE_TYPES, FLOOR_HEIGHT, FeatureCard, FeatureDetailPageTemplate, FeatureGrid, FeatureGridOrganism, FileTree, FilterGroup, FilterPill, Flex, FlipCard, FlipContainer, FloatingActionButton, Form, FormActions, FormField, FormLayout, FormSection, FormSectionHeader, GameAudioContext, GameAudioProvider, GameAudioToggle, GameCanvas2D, GameHud, GameMenu, GameOverScreen, GameShell, GameTemplate, GenericAppTemplate, GeometricPattern, GradientDivider, GraphCanvas, GraphView, Grid, GridPicker, HStack, Header, HealthBar, HealthPanel, HeroOrganism, HeroSection, IDENTITY_BOOK_FIELDS, Icon, IconPicker, InfiniteScrollSentinel, Input, InputGroup, InstallBox, InventoryGrid, InventoryPanel, IsometricCanvas, ItemSlot, JazariStateMachine, JsonTreeEditor, Label, LandingPageTemplate, LawReferenceTooltip, Lightbox, LikertScale, LineChart2 as LineChart, List3 as List, LoadingState, MapView, MarkdownContent, MarketingFooter, MarketingStatCard, MasterDetail, MasterDetailLayout, MatrixQuestion, MediaGallery, Menu, Meter, MiniMap, Modal, ModalSlot, ModuleCard, Navigation, NegotiatorBoard, NodeSlotEditor, NotifyListener, NumberStepper, ObjectRulePanel, OnboardingSpotlight, OptionConstraintGroup, StateMachineView as OrbitalStateMachineView, OrbitalVisualization, Overlay, PageHeader, Pagination, PatternTile, PhysicsManager, PlatformerCanvas, Popover, PositionedCanvas, PowerupSlots, PricingCard, PricingGrid, PricingOrganism, PricingPageTemplate, ProgressBar, ProgressDots, PropertyInspector, PullQuote, PullToRefresh, QrScanner, QuestTracker, QuizBlock, Radio, RangeSlider, ReflectionBlock, RelationSelect, RepeatableFormSection, ReplyTree, ResourceBar, ResourceCounter, RichBlockEditor, RuleEditor, RuntimeDebugger, SHEET_COLUMNS, SPRITE_SHEET_LAYOUT, ScaledDiagram, ScoreBoard, ScoreDisplay, SearchInput, Section, SectionHeader, SegmentRenderer, Select, SequenceBar, SequencerBoard, ServiceCatalog, ShowcaseCard, ShowcaseOrganism, SidePanel, Sidebar, SignaturePad, SimpleGrid, SimulationCanvas, SimulationControls, SimulationGraph, SimulatorBoard, Skeleton, SlotContentRenderer, SocialProof, SortableList, Spacer, Sparkline, Spinner, Split, SplitPane, SplitSection, Sprite, Stack, StarRating, StatBadge, StatCard, StatDisplay, StateArchitectBoard, StateIndicator, StateJsonView, StateMachineView, StateNode2 as StateNode, StatsGrid, StatsOrganism, StatusBar, StatusDot, StatusEffect, StepFlow, StepFlowOrganism, SvgBranch, SvgConnection, SvgFlow, SvgGrid, SvgLobe, SvgMesh, SvgMorph, SvgNode, SvgPulse, SvgRing, SvgShield, SvgStack, SwipeableRow, Switch, TERRAIN_COLORS, TILE_HEIGHT, TILE_WIDTH, TabbedContainer, TableView, Tabs, TagCloud, TagInput, TeamCard, TeamOrganism, TerrainPalette, TextHighlight, Textarea, ThemeSelector, ThemeToggle, TimeSlotCell, Timeline, TimerDisplay, Toast, ToastSlot, Tooltip, TraitFrame, TraitSlot, TraitStateViewer, TransitionArrow, TrendIndicator, TurnIndicator, TurnPanel, TypewriterText, Typography, UISlotComponent, UISlotRenderer, UncontrolledBattleBoard, UnitCommandBar, UploadDropZone, VStack, VariablePanel, VersionDiff, ViolationAlert, VoteStack, WaypointMarker, WizardContainer, WizardNavigation, WizardProgress, WorldMapBoard, WorldMapTemplate, XPBar, applyTemporaryEffect, calculateAttackTargets, calculateDamage, calculateValidMoves, cn, combatAnimations, combatClasses, combatEffects, createInitialGameState, createUnitAnimationState, drawSprite, generateCombatMessage, getCurrentFrame, getTileDimensions, inferDirection, isoToScreen, mapBookData, parseLessonSegments, parseMarkdownWithCodeBlocks2 as parseMarkdownWithCodeBlocks, pendulum, projectileMotion, resolveFieldMap, resolveFrame, resolveSheetDirection, screenToIso, springOscillator, tickAnimationState, toCodeLanguage, transitionAnimation, useAnchorRect, useBattleState, useCamera, useGameAudio, useGameAudioContext, useImageCache, usePhysics2D, useSpriteAnimations };
50736
+ export { ALL_PRESETS, AR_BOOK_FIELDS, AboutPageTemplate, Accordion, ActionButton, ActionButtons, Card2 as ActionCard, ActionPalette, ActionTile, ActivationBlock, Alert, AnimatedCounter, AnimatedGraphic, AnimatedReveal, ArticleSection, Aside, AssetPicker, AuthLayout, Avatar, Badge, BattleBoard, BattleTemplate, BehaviorView, BloomQuizBlock, BookChapterView, BookCoverPage, BookNavBar, BookTableOfContents, BookViewer, Box, BranchingLogicBuilder, Breadcrumb, BuilderBoard, Button, ButtonGroup, CTABanner, CalendarGrid, CanvasEffect, Card, CardBody, CardContent, CardFooter, CardGrid, CardHeader, CardTitle, Carousel, CaseStudyCard, CaseStudyOrganism, CastleBoard, CastleTemplate, Center, Chart, ChartLegend, Checkbox, ChoiceButton, ClassifierBoard, Coachmark, CodeBlock, CodeRunnerPanel, CollapsibleSection, CombatLog, ComboCounter, CommunityLinks, ConditionalWrapper, ConfettiEffect, ConfirmDialog, ConnectionBlock, Container, ContentRenderer, ContentSection, ControlButton, CounterTemplate, CraftingRecipe, DEFAULT_LIKERT_OPTIONS, DEFAULT_MATRIX_COLUMNS, DIAMOND_TOP_Y, DPad, DamageNumber, DashboardGrid, DashboardLayout, DataGrid, DataList, DataTable, DateRangePicker, DateRangeSelector, DayCell, DebuggerBoard, DetailPanel, Dialog, DialogueBox, DialogueBubble, Divider, DocBreadcrumb, DocPagination, DocSearch, DocSidebar, DocTOC, DocumentViewer, StateMachineView as DomStateMachineVisualizer, Drawer, DrawerSlot, EdgeDecoration, EditorCheckbox, EditorSelect, EditorSlider, EditorTextInput, EditorToolbar, EmptyState, EnemyPlate, EntityDisplayEvents, ErrorBoundary, ErrorState, EventHandlerBoard, EventLog, FEATURE_COLORS, FEATURE_TYPES, FLOOR_HEIGHT, FeatureCard, FeatureDetailPageTemplate, FeatureGrid, FeatureGridOrganism, FileTree, FilterGroup, FilterPill, Flex, FlipCard, FlipContainer, FloatingActionButton, Form, FormActions, FormField, FormLayout, FormSection, FormSectionHeader, GameAudioContext, GameAudioProvider, GameAudioToggle, GameCanvas2D, GameHud, GameMenu, GameOverScreen, GameShell, GameTemplate, GenericAppTemplate, GeometricPattern, GradientDivider, GraphCanvas, GraphView, Grid, GridPicker, HStack, Header, HealthBar, HealthPanel, HeroOrganism, HeroSection, IDENTITY_BOOK_FIELDS, Icon, IconPicker, InfiniteScrollSentinel, Input, InputGroup, InstallBox, InventoryGrid, InventoryPanel, IsometricCanvas, ItemSlot, JazariStateMachine, JsonTreeEditor, Label, LandingPageTemplate, LawReferenceTooltip, Lightbox, LikertScale, LineChart2 as LineChart, List3 as List, LoadingState, MapView, MarkdownContent, MarketingFooter, MarketingStatCard, MasterDetail, MasterDetailLayout, MatrixQuestion, MediaGallery, Menu, Meter, MiniMap, Modal, ModalSlot, ModuleCard, Navigation, NegotiatorBoard, NodeSlotEditor, NotifyListener, NumberStepper, ObjectRulePanel, OnboardingSpotlight, OptionConstraintGroup, StateMachineView as OrbitalStateMachineView, OrbitalVisualization, Overlay, PageHeader, Pagination, PatternTile, PhysicsManager, PlatformerCanvas, Popover, PositionedCanvas, PowerupSlots, PricingCard, PricingGrid, PricingOrganism, PricingPageTemplate, ProgressBar, ProgressDots, PropertyInspector, PullQuote, PullToRefresh, QrScanner, QuestTracker, QuizBlock, Radio, RangeSlider, ReflectionBlock, RelationSelect, RepeatableFormSection, ReplyTree, ResourceBar, ResourceCounter, RichBlockEditor, RuleEditor, RuntimeDebugger, SHEET_COLUMNS, SPRITE_SHEET_LAYOUT, ScaledDiagram, ScoreBoard, ScoreDisplay, SearchInput, Section, SectionHeader, SegmentRenderer, Select, SequenceBar, SequencerBoard, ServiceCatalog, ShowcaseCard, ShowcaseOrganism, SidePanel, Sidebar, SignaturePad, SimpleGrid, SimulationCanvas, SimulationControls, SimulationGraph, SimulatorBoard, Skeleton, SlotContentRenderer, SocialProof, SortableList, Spacer, Sparkline, Spinner, Split, SplitPane, SplitSection, Sprite, Stack, StarRating, StatBadge, StatCard, StatDisplay, StateArchitectBoard, StateIndicator, StateJsonView, StateMachineView, StateNode2 as StateNode, StatsGrid, StatsOrganism, StatusBar, StatusDot, StatusEffect, StepFlow, StepFlowOrganism, SvgBranch, SvgConnection, SvgFlow, SvgGrid, SvgLobe, SvgMesh, SvgMorph, SvgNode, SvgPulse, SvgRing, SvgShield, SvgStack, SwipeableRow, Switch, TERRAIN_COLORS, TILE_HEIGHT, TILE_WIDTH, TabbedContainer, TableView, Tabs, TagCloud, TagInput, TeamCard, TeamOrganism, TerrainPalette, TextHighlight, Textarea, ThemeSelector, ThemeToggle, TimeSlotCell, Timeline, TimerDisplay, Toast, ToastSlot, Tooltip, TraitFrame, TraitSlot, TraitStateViewer, TransitionArrow, TrendIndicator, TurnIndicator, TurnPanel, TypewriterText, Typography, UISlotComponent, UISlotRenderer, UncontrolledBattleBoard, UnitCommandBar, UploadDropZone, VStack, VariablePanel, VersionDiff, ViolationAlert, VoteStack, WaypointMarker, WizardContainer, WizardNavigation, WizardProgress, WorldMapBoard, WorldMapTemplate, XPBar, applyTemporaryEffect, calculateAttackTargets, calculateDamage, calculateValidMoves, cn, combatAnimations, combatClasses, combatEffects, createInitialGameState, createUnitAnimationState, drawSprite, generateCombatMessage, getCurrentFrame, getTileDimensions, inferDirection, isoToScreen, mapBookData, parseLessonSegments, parseMarkdownWithCodeBlocks, pendulum, projectileMotion, resolveFieldMap, resolveFrame, resolveSheetDirection, screenToIso, springOscillator, tickAnimationState, toCodeLanguage, transitionAnimation, useAnchorRect, useBattleState, useCamera, useGameAudio, useGameAudioContext, useImageCache, usePhysics2D, useSpriteAnimations };