@almadar/ui 4.51.16 → 4.52.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.
package/dist/avl/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import { OrbitControls as OrbitControls$1, Grid as Grid$1, Stars, Sparkles, Html, RoundedBox } from '@react-three/drei';
3
- import * as React93 from 'react';
4
- import React93__default, { createContext, useState, useMemo, useRef, useEffect, useContext, useCallback, Suspense, useLayoutEffect, Profiler, useReducer, lazy, useId, forwardRef, useImperativeHandle, Component } from 'react';
3
+ import * as React96 from 'react';
4
+ import React96__default, { createContext, useState, useMemo, useRef, useEffect, useContext, useCallback, Suspense, useLayoutEffect, Profiler, useReducer, lazy, useId, forwardRef, useImperativeHandle, Component } from 'react';
5
5
  import { createLogger, isLogLevelEnabled } from '@almadar/logger';
6
6
  import ELK from 'elkjs/lib/elk.bundled.js';
7
7
  import { MarkerType, Handle, Position, getBezierPath, EdgeLabelRenderer, BaseEdge, ReactFlowProvider, useNodesState, useEdgesState, useReactFlow, ReactFlow, Controls, Background, BackgroundVariant } from '@xyflow/react';
@@ -3726,7 +3726,7 @@ var init_Box = __esm({
3726
3726
  fixed: "fixed",
3727
3727
  sticky: "sticky"
3728
3728
  };
3729
- Box = React93__default.forwardRef(
3729
+ Box = React96__default.forwardRef(
3730
3730
  ({
3731
3731
  padding,
3732
3732
  paddingX,
@@ -3776,38 +3776,26 @@ var init_Box = __esm({
3776
3776
  onMouseLeave?.(e);
3777
3777
  }, [hoverEvent, eventBus, onMouseLeave]);
3778
3778
  const isClickable = action || onClick;
3779
- const Comp = Component2;
3780
- return /* @__PURE__ */ jsx(
3781
- Comp,
3779
+ return React96__default.createElement(
3780
+ Component2,
3782
3781
  {
3783
3782
  ref,
3784
3783
  className: cn(
3785
- // Padding
3786
3784
  padding && paddingStyles[padding],
3787
3785
  paddingX && paddingXStyles[paddingX],
3788
3786
  paddingY && paddingYStyles[paddingY],
3789
- // Margin
3790
3787
  margin && marginStyles[margin],
3791
3788
  marginX && marginXStyles[marginX],
3792
3789
  marginY && marginYStyles[marginY],
3793
- // Background
3794
3790
  bgStyles[bg],
3795
- // Border - uses theme variables
3796
3791
  border && "border-[length:var(--border-width)] border-border",
3797
- // Rounded
3798
3792
  roundedStyles[rounded],
3799
- // Shadow
3800
3793
  shadowStyles[shadow],
3801
- // Display
3802
3794
  display && displayStyles[display],
3803
- // Dimensions
3804
3795
  fullWidth && "w-full",
3805
3796
  fullHeight && "h-full",
3806
- // Overflow
3807
3797
  overflow && overflowStyles2[overflow],
3808
- // Position
3809
3798
  position && positionStyles[position],
3810
- // Cursor for clickable
3811
3799
  isClickable && "cursor-pointer",
3812
3800
  className
3813
3801
  ),
@@ -3815,9 +3803,9 @@ var init_Box = __esm({
3815
3803
  onMouseEnter: hoverEvent || onMouseEnter ? handleMouseEnter : void 0,
3816
3804
  onMouseLeave: hoverEvent || onMouseLeave ? handleMouseLeave : void 0,
3817
3805
  style: maxWidth ? { maxWidth, ...rest.style } : rest.style,
3818
- ...rest,
3819
- children
3820
- }
3806
+ ...rest
3807
+ },
3808
+ children
3821
3809
  );
3822
3810
  }
3823
3811
  );
@@ -4739,7 +4727,7 @@ var init_MiniStateMachine = __esm({
4739
4727
  const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
4740
4728
  const tc = transitionCounts[s.name] ?? 0;
4741
4729
  const role = getStateRole(s.name, s.isInitial, s.isTerminal, tc, maxTC);
4742
- return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
4730
+ return /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
4743
4731
  /* @__PURE__ */ jsx(
4744
4732
  AvlState,
4745
4733
  {
@@ -5761,6 +5749,179 @@ var init_Icon = __esm({
5761
5749
  Icon.displayName = "Icon";
5762
5750
  }
5763
5751
  });
5752
+ function resolveIconProp(value, sizeClass) {
5753
+ if (!value) return null;
5754
+ if (typeof value === "string") {
5755
+ const Resolved = resolveIcon(value);
5756
+ return Resolved ? /* @__PURE__ */ jsx(Resolved, { className: sizeClass }) : null;
5757
+ }
5758
+ if (typeof value === "function") {
5759
+ const IconComp = value;
5760
+ return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
5761
+ }
5762
+ if (React96__default.isValidElement(value)) {
5763
+ return value;
5764
+ }
5765
+ if (typeof value === "object" && value !== null && "render" in value) {
5766
+ const IconComp = value;
5767
+ return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
5768
+ }
5769
+ return value;
5770
+ }
5771
+ var variantStyles2, sizeStyles2, iconSizeStyles, Button;
5772
+ var init_Button = __esm({
5773
+ "components/atoms/Button.tsx"() {
5774
+ "use client";
5775
+ init_cn();
5776
+ init_useEventBus();
5777
+ init_Icon();
5778
+ variantStyles2 = {
5779
+ primary: [
5780
+ "bg-primary text-primary-foreground",
5781
+ "border-none",
5782
+ "shadow-sm",
5783
+ "hover:bg-primary-hover hover:shadow-lg",
5784
+ "active:scale-[var(--active-scale)] active:shadow-sm"
5785
+ ].join(" "),
5786
+ secondary: [
5787
+ "bg-transparent text-accent",
5788
+ "border border-accent",
5789
+ "hover:bg-accent hover:text-white hover:border-accent",
5790
+ "active:scale-[var(--active-scale)]"
5791
+ ].join(" "),
5792
+ ghost: [
5793
+ "bg-transparent text-muted-foreground",
5794
+ "border border-transparent",
5795
+ "hover:text-primary-foreground hover:bg-primary hover:border-primary",
5796
+ "active:scale-[var(--active-scale)]"
5797
+ ].join(" "),
5798
+ danger: [
5799
+ "bg-surface text-error",
5800
+ "border-[length:var(--border-width)] border-error",
5801
+ "shadow-sm",
5802
+ "hover:bg-error hover:text-error-foreground hover:shadow-lg",
5803
+ "active:scale-[var(--active-scale)] active:shadow-sm"
5804
+ ].join(" "),
5805
+ success: [
5806
+ "bg-surface text-success",
5807
+ "border-[length:var(--border-width)] border-success",
5808
+ "shadow-sm",
5809
+ "hover:bg-success hover:text-success-foreground hover:shadow-lg",
5810
+ "active:scale-[var(--active-scale)] active:shadow-sm"
5811
+ ].join(" "),
5812
+ warning: [
5813
+ "bg-surface text-warning",
5814
+ "border-[length:var(--border-width)] border-warning",
5815
+ "shadow-sm",
5816
+ "hover:bg-warning hover:text-warning-foreground hover:shadow-lg",
5817
+ "active:scale-[var(--active-scale)] active:shadow-sm"
5818
+ ].join(" "),
5819
+ // "default" is an alias for secondary
5820
+ default: [
5821
+ "bg-secondary text-secondary-foreground",
5822
+ "border-[length:var(--border-width-thin)] border-border",
5823
+ "hover:bg-secondary-hover",
5824
+ "active:scale-[var(--active-scale)]"
5825
+ ].join(" ")
5826
+ };
5827
+ variantStyles2.destructive = variantStyles2.danger;
5828
+ sizeStyles2 = {
5829
+ sm: "px-3 py-1.5 text-sm",
5830
+ md: "px-4 py-2 text-sm",
5831
+ lg: "px-6 py-3 text-base"
5832
+ };
5833
+ iconSizeStyles = {
5834
+ sm: "h-3.5 w-3.5",
5835
+ md: "h-4 w-4",
5836
+ lg: "h-5 w-5"
5837
+ };
5838
+ Button = React96__default.forwardRef(
5839
+ ({
5840
+ className,
5841
+ variant = "primary",
5842
+ size = "md",
5843
+ isLoading = false,
5844
+ disabled,
5845
+ leftIcon,
5846
+ rightIcon,
5847
+ icon: iconProp,
5848
+ iconRight: iconRightProp,
5849
+ action,
5850
+ actionPayload,
5851
+ label,
5852
+ children,
5853
+ onClick,
5854
+ ...props
5855
+ }, ref) => {
5856
+ const eventBus = useEventBus();
5857
+ const leftIconValue = leftIcon || iconProp;
5858
+ const rightIconValue = rightIcon || iconRightProp;
5859
+ const resolvedLeftIcon = resolveIconProp(leftIconValue, iconSizeStyles[size]);
5860
+ const resolvedRightIcon = resolveIconProp(rightIconValue, iconSizeStyles[size]);
5861
+ const handleClick = (e) => {
5862
+ if (action) {
5863
+ eventBus.emit(`UI:${action}`, actionPayload ?? {});
5864
+ }
5865
+ onClick?.(e);
5866
+ };
5867
+ return /* @__PURE__ */ jsxs(
5868
+ "button",
5869
+ {
5870
+ ref,
5871
+ disabled: disabled || isLoading,
5872
+ className: cn(
5873
+ "inline-flex items-center justify-center gap-2",
5874
+ "font-[var(--font-weight-medium)]",
5875
+ "rounded-sm",
5876
+ "cursor-pointer",
5877
+ "transition-all duration-[var(--transition-normal)]",
5878
+ "focus:outline-none focus:ring-[length:var(--focus-ring-width)] focus:ring-ring focus:ring-offset-[length:var(--focus-ring-offset)]",
5879
+ "disabled:opacity-50 disabled:cursor-not-allowed",
5880
+ variantStyles2[variant],
5881
+ sizeStyles2[size],
5882
+ className
5883
+ ),
5884
+ onClick: handleClick,
5885
+ ...props,
5886
+ "data-testid": props["data-testid"] ?? (action ? `action-${action}` : void 0),
5887
+ children: [
5888
+ isLoading ? /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }) : resolvedLeftIcon && /* @__PURE__ */ jsx("span", { className: "flex-shrink-0", children: resolvedLeftIcon }),
5889
+ children || label,
5890
+ resolvedRightIcon && !isLoading && /* @__PURE__ */ jsx("span", { className: "flex-shrink-0", children: resolvedRightIcon })
5891
+ ]
5892
+ }
5893
+ );
5894
+ }
5895
+ );
5896
+ Button.displayName = "Button";
5897
+ }
5898
+ });
5899
+ var Dialog;
5900
+ var init_Dialog = __esm({
5901
+ "components/atoms/Dialog.tsx"() {
5902
+ init_cn();
5903
+ Dialog = React96__default.forwardRef(
5904
+ ({
5905
+ role = "dialog",
5906
+ "aria-modal": ariaModal = true,
5907
+ className,
5908
+ children,
5909
+ ...rest
5910
+ }, ref) => /* @__PURE__ */ jsx(
5911
+ "dialog",
5912
+ {
5913
+ ref,
5914
+ role,
5915
+ "aria-modal": ariaModal,
5916
+ className: cn(className),
5917
+ ...rest,
5918
+ children
5919
+ }
5920
+ )
5921
+ );
5922
+ Dialog.displayName = "Dialog";
5923
+ }
5924
+ });
5764
5925
  var Overlay;
5765
5926
  var init_Overlay = __esm({
5766
5927
  "components/atoms/Overlay.tsx"() {
@@ -5802,8 +5963,9 @@ var sizeClasses2, minWidths, Modal;
5802
5963
  var init_Modal = __esm({
5803
5964
  "components/molecules/Modal.tsx"() {
5804
5965
  "use client";
5805
- init_Icon();
5806
5966
  init_Box();
5967
+ init_Button();
5968
+ init_Dialog();
5807
5969
  init_Typography();
5808
5970
  init_Overlay();
5809
5971
  init_cn();
@@ -5896,7 +6058,7 @@ var init_Modal = __esm({
5896
6058
  }
5897
6059
  ),
5898
6060
  /* @__PURE__ */ jsx(
5899
- "div",
6061
+ Box,
5900
6062
  {
5901
6063
  className: cn(
5902
6064
  "fixed inset-0 z-50 pointer-events-none",
@@ -5905,17 +6067,17 @@ var init_Modal = __esm({
5905
6067
  ),
5906
6068
  style: { paddingTop: "10vh" },
5907
6069
  children: /* @__PURE__ */ jsxs(
5908
- Box,
6070
+ Dialog,
5909
6071
  {
5910
6072
  ref: modalRef,
5911
- bg: "surface",
5912
- border: true,
5913
- shadow: "lg",
5914
- rounded: "md",
6073
+ open: true,
5915
6074
  className: cn(
5916
- "pointer-events-auto w-full flex flex-col",
6075
+ // Reset browser-default dialog chrome — we own styling.
6076
+ "m-0 p-0 border-0 bg-transparent",
6077
+ // Pre-existing dialog frame
6078
+ "pointer-events-auto w-full flex flex-col bg-surface border shadow-lg rounded-md",
5917
6079
  sizeClasses2[size],
5918
- "max-sm:max-w-full max-sm:rounded-b-none max-sm:rounded-t-2xl",
6080
+ "max-sm:max-w-full max-sm:min-w-0 max-sm:rounded-b-none max-sm:rounded-t-2xl",
5919
6081
  className
5920
6082
  ),
5921
6083
  style: {
@@ -5926,12 +6088,10 @@ var init_Modal = __esm({
5926
6088
  transition: isDragging.current ? "none" : "transform 200ms ease-out"
5927
6089
  }
5928
6090
  },
5929
- role: "dialog",
5930
- "aria-modal": "true",
5931
6091
  ...title && { "aria-labelledby": "modal-title" },
5932
6092
  children: [
5933
6093
  /* @__PURE__ */ jsx(
5934
- "div",
6094
+ Box,
5935
6095
  {
5936
6096
  className: "hidden max-sm:flex justify-center py-2 cursor-grab active:cursor-grabbing touch-none",
5937
6097
  onPointerDown: (e) => {
@@ -5957,11 +6117,11 @@ var init_Modal = __esm({
5957
6117
  isDragging.current = false;
5958
6118
  setDragY(0);
5959
6119
  },
5960
- children: /* @__PURE__ */ jsx("div", { className: "w-10 h-1 rounded-full bg-border" })
6120
+ children: /* @__PURE__ */ jsx(Box, { className: "w-10 h-1 rounded-full bg-border" })
5961
6121
  }
5962
6122
  ),
5963
6123
  (title || showCloseButton) && /* @__PURE__ */ jsxs(
5964
- "div",
6124
+ Box,
5965
6125
  {
5966
6126
  className: cn(
5967
6127
  "px-6 py-4 flex items-center justify-between",
@@ -5970,25 +6130,22 @@ var init_Modal = __esm({
5970
6130
  children: [
5971
6131
  title && /* @__PURE__ */ jsx(Typography, { variant: "h4", as: "h2", id: "modal-title", children: title }),
5972
6132
  showCloseButton && /* @__PURE__ */ jsx(
5973
- "button",
6133
+ Button,
5974
6134
  {
5975
- type: "button",
6135
+ variant: "ghost",
6136
+ size: "sm",
6137
+ icon: X,
5976
6138
  onClick: handleClose,
5977
6139
  "data-event": "CLOSE",
5978
- className: cn(
5979
- "p-1 transition-colors rounded-sm",
5980
- "hover:bg-muted"
5981
- ),
5982
- "aria-label": "Close modal",
5983
- children: /* @__PURE__ */ jsx(Icon, { icon: X, size: "md" })
6140
+ "aria-label": "Close modal"
5984
6141
  }
5985
6142
  )
5986
6143
  ]
5987
6144
  }
5988
6145
  ),
5989
- /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto p-6", children }),
6146
+ /* @__PURE__ */ jsx(Box, { className: "flex-1 overflow-y-auto p-6", children }),
5990
6147
  footer && /* @__PURE__ */ jsx(
5991
- "div",
6148
+ Box,
5992
6149
  {
5993
6150
  className: cn(
5994
6151
  "px-6 py-4 bg-muted",
@@ -6011,21 +6168,19 @@ var sizeWidths, Drawer;
6011
6168
  var init_Drawer = __esm({
6012
6169
  "components/molecules/Drawer.tsx"() {
6013
6170
  "use client";
6014
- init_Icon();
6015
6171
  init_Box();
6172
+ init_Button();
6016
6173
  init_Typography();
6017
6174
  init_Overlay();
6018
6175
  init_cn();
6019
6176
  init_useEventBus();
6020
6177
  sizeWidths = {
6021
- sm: "w-80",
6178
+ sm: "w-full sm:w-80",
6022
6179
  // 320px
6023
- md: "w-96",
6180
+ md: "w-full sm:w-96",
6024
6181
  // 384px
6025
- lg: "w-[480px]",
6026
- // 480px
6027
- xl: "w-[640px]",
6028
- // 640px
6182
+ lg: "w-full sm:w-[480px]",
6183
+ xl: "w-full sm:w-[640px]",
6029
6184
  full: "w-screen"
6030
6185
  };
6031
6186
  Drawer = ({
@@ -6123,7 +6278,7 @@ var init_Drawer = __esm({
6123
6278
  ...title && { "aria-labelledby": "drawer-title" },
6124
6279
  children: [
6125
6280
  (title || showCloseButton) && /* @__PURE__ */ jsxs(
6126
- "div",
6281
+ Box,
6127
6282
  {
6128
6283
  className: cn(
6129
6284
  "px-6 py-4 flex items-center justify-between shrink-0",
@@ -6132,25 +6287,22 @@ var init_Drawer = __esm({
6132
6287
  children: [
6133
6288
  title && /* @__PURE__ */ jsx(Typography, { variant: "h4", as: "h2", id: "drawer-title", children: title }),
6134
6289
  showCloseButton && /* @__PURE__ */ jsx(
6135
- "button",
6290
+ Button,
6136
6291
  {
6137
- type: "button",
6292
+ variant: "ghost",
6293
+ size: "sm",
6294
+ icon: X,
6138
6295
  onClick: handleClose,
6139
- className: cn(
6140
- "p-1 transition-colors rounded-sm",
6141
- "hover:bg-muted",
6142
- !title && "ml-auto"
6143
- ),
6144
6296
  "aria-label": "Close drawer",
6145
- children: /* @__PURE__ */ jsx(Icon, { icon: X, size: "md" })
6297
+ className: cn(!title && "ml-auto")
6146
6298
  }
6147
6299
  )
6148
6300
  ]
6149
6301
  }
6150
6302
  ),
6151
- /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto p-6", children }),
6303
+ /* @__PURE__ */ jsx(Box, { className: "flex-1 overflow-y-auto p-6", children }),
6152
6304
  footer && /* @__PURE__ */ jsx(
6153
- "div",
6305
+ Box,
6154
6306
  {
6155
6307
  className: cn(
6156
6308
  "px-6 py-4 shrink-0 bg-muted",
@@ -6191,153 +6343,6 @@ var init_Drawer = __esm({
6191
6343
  Drawer.displayName = "Drawer";
6192
6344
  }
6193
6345
  });
6194
- function resolveIconProp(value, sizeClass) {
6195
- if (!value) return null;
6196
- if (typeof value === "string") {
6197
- const Resolved = resolveIcon(value);
6198
- return Resolved ? /* @__PURE__ */ jsx(Resolved, { className: sizeClass }) : null;
6199
- }
6200
- if (typeof value === "function") {
6201
- const IconComp = value;
6202
- return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
6203
- }
6204
- if (React93__default.isValidElement(value)) {
6205
- return value;
6206
- }
6207
- if (typeof value === "object" && value !== null && "render" in value) {
6208
- const IconComp = value;
6209
- return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
6210
- }
6211
- return value;
6212
- }
6213
- var variantStyles2, sizeStyles2, iconSizeStyles, Button;
6214
- var init_Button = __esm({
6215
- "components/atoms/Button.tsx"() {
6216
- "use client";
6217
- init_cn();
6218
- init_useEventBus();
6219
- init_Icon();
6220
- variantStyles2 = {
6221
- primary: [
6222
- "bg-primary text-primary-foreground",
6223
- "border-none",
6224
- "shadow-sm",
6225
- "hover:bg-primary-hover hover:shadow-lg",
6226
- "active:scale-[var(--active-scale)] active:shadow-sm"
6227
- ].join(" "),
6228
- secondary: [
6229
- "bg-transparent text-accent",
6230
- "border border-accent",
6231
- "hover:bg-accent hover:text-white hover:border-accent",
6232
- "active:scale-[var(--active-scale)]"
6233
- ].join(" "),
6234
- ghost: [
6235
- "bg-transparent text-muted-foreground",
6236
- "border border-transparent",
6237
- "hover:text-primary-foreground hover:bg-primary hover:border-primary",
6238
- "active:scale-[var(--active-scale)]"
6239
- ].join(" "),
6240
- danger: [
6241
- "bg-surface text-error",
6242
- "border-[length:var(--border-width)] border-error",
6243
- "shadow-sm",
6244
- "hover:bg-error hover:text-error-foreground hover:shadow-lg",
6245
- "active:scale-[var(--active-scale)] active:shadow-sm"
6246
- ].join(" "),
6247
- success: [
6248
- "bg-surface text-success",
6249
- "border-[length:var(--border-width)] border-success",
6250
- "shadow-sm",
6251
- "hover:bg-success hover:text-success-foreground hover:shadow-lg",
6252
- "active:scale-[var(--active-scale)] active:shadow-sm"
6253
- ].join(" "),
6254
- warning: [
6255
- "bg-surface text-warning",
6256
- "border-[length:var(--border-width)] border-warning",
6257
- "shadow-sm",
6258
- "hover:bg-warning hover:text-warning-foreground hover:shadow-lg",
6259
- "active:scale-[var(--active-scale)] active:shadow-sm"
6260
- ].join(" "),
6261
- // "default" is an alias for secondary
6262
- default: [
6263
- "bg-secondary text-secondary-foreground",
6264
- "border-[length:var(--border-width-thin)] border-border",
6265
- "hover:bg-secondary-hover",
6266
- "active:scale-[var(--active-scale)]"
6267
- ].join(" ")
6268
- };
6269
- variantStyles2.destructive = variantStyles2.danger;
6270
- sizeStyles2 = {
6271
- sm: "px-3 py-1.5 text-sm",
6272
- md: "px-4 py-2 text-sm",
6273
- lg: "px-6 py-3 text-base"
6274
- };
6275
- iconSizeStyles = {
6276
- sm: "h-3.5 w-3.5",
6277
- md: "h-4 w-4",
6278
- lg: "h-5 w-5"
6279
- };
6280
- Button = React93__default.forwardRef(
6281
- ({
6282
- className,
6283
- variant = "primary",
6284
- size = "md",
6285
- isLoading = false,
6286
- disabled,
6287
- leftIcon,
6288
- rightIcon,
6289
- icon: iconProp,
6290
- iconRight: iconRightProp,
6291
- action,
6292
- actionPayload,
6293
- label,
6294
- children,
6295
- onClick,
6296
- ...props
6297
- }, ref) => {
6298
- const eventBus = useEventBus();
6299
- const leftIconValue = leftIcon || iconProp;
6300
- const rightIconValue = rightIcon || iconRightProp;
6301
- const resolvedLeftIcon = resolveIconProp(leftIconValue, iconSizeStyles[size]);
6302
- const resolvedRightIcon = resolveIconProp(rightIconValue, iconSizeStyles[size]);
6303
- const handleClick = (e) => {
6304
- if (action) {
6305
- eventBus.emit(`UI:${action}`, actionPayload ?? {});
6306
- }
6307
- onClick?.(e);
6308
- };
6309
- return /* @__PURE__ */ jsxs(
6310
- "button",
6311
- {
6312
- ref,
6313
- disabled: disabled || isLoading,
6314
- className: cn(
6315
- "inline-flex items-center justify-center gap-2",
6316
- "font-[var(--font-weight-medium)]",
6317
- "rounded-sm",
6318
- "cursor-pointer",
6319
- "transition-all duration-[var(--transition-normal)]",
6320
- "focus:outline-none focus:ring-[length:var(--focus-ring-width)] focus:ring-ring focus:ring-offset-[length:var(--focus-ring-offset)]",
6321
- "disabled:opacity-50 disabled:cursor-not-allowed",
6322
- variantStyles2[variant],
6323
- sizeStyles2[size],
6324
- className
6325
- ),
6326
- onClick: handleClick,
6327
- ...props,
6328
- "data-testid": props["data-testid"] ?? (action ? `action-${action}` : void 0),
6329
- children: [
6330
- isLoading ? /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }) : resolvedLeftIcon && /* @__PURE__ */ jsx("span", { className: "flex-shrink-0", children: resolvedLeftIcon }),
6331
- children || label,
6332
- resolvedRightIcon && !isLoading && /* @__PURE__ */ jsx("span", { className: "flex-shrink-0", children: resolvedRightIcon })
6333
- ]
6334
- }
6335
- );
6336
- }
6337
- );
6338
- Button.displayName = "Button";
6339
- }
6340
- });
6341
6346
  var variantStyles3, sizeStyles3, Badge;
6342
6347
  var init_Badge = __esm({
6343
6348
  "components/atoms/Badge.tsx"() {
@@ -6380,7 +6385,7 @@ var init_Badge = __esm({
6380
6385
  md: "px-2.5 py-1 text-sm",
6381
6386
  lg: "px-3 py-1.5 text-base"
6382
6387
  };
6383
- Badge = React93__default.forwardRef(
6388
+ Badge = React96__default.forwardRef(
6384
6389
  ({ className, variant = "default", size = "sm", amount, label, icon, children, ...props }, ref) => {
6385
6390
  const iconSizes3 = { sm: "w-3 h-3", md: "w-3.5 h-3.5", lg: "w-4 h-4" };
6386
6391
  const resolvedIcon = typeof icon === "string" ? (() => {
@@ -6413,6 +6418,7 @@ var variantClasses, iconMap, iconColors, Toast;
6413
6418
  var init_Toast = __esm({
6414
6419
  "components/molecules/Toast.tsx"() {
6415
6420
  "use client";
6421
+ init_Box();
6416
6422
  init_Icon();
6417
6423
  init_Typography();
6418
6424
  init_Button();
@@ -6470,17 +6476,20 @@ var init_Toast = __esm({
6470
6476
  return () => clearTimeout(timer);
6471
6477
  }, [duration, onDismiss, dismissEvent]);
6472
6478
  return /* @__PURE__ */ jsx(
6473
- "div",
6479
+ Box,
6474
6480
  {
6475
6481
  className: cn(
6476
- "border-l-4 p-4 shadow min-w-[300px] max-w-md",
6482
+ // `min-w-[300px]` only kicks in at `sm:` and above so a phone
6483
+ // viewport doesn't get a toast wider than the screen near the
6484
+ // edge. `max-w-[calc(100vw-2rem)]` clamps to viewport too.
6485
+ "border-l-4 p-4 shadow min-w-0 sm:min-w-[300px] max-w-md max-w-[calc(100vw-2rem)]",
6477
6486
  "rounded-sm",
6478
6487
  variantClasses[variant],
6479
6488
  className
6480
6489
  ),
6481
6490
  role: "alert",
6482
- children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
6483
- /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 mt-0.5", children: /* @__PURE__ */ jsx(
6491
+ children: /* @__PURE__ */ jsxs(Box, { className: "flex items-start gap-3", children: [
6492
+ /* @__PURE__ */ jsx(Box, { className: "flex-shrink-0 mt-0.5", children: /* @__PURE__ */ jsx(
6484
6493
  Icon,
6485
6494
  {
6486
6495
  icon: iconMap[variant],
@@ -6488,25 +6497,22 @@ var init_Toast = __esm({
6488
6497
  className: iconColors[variant]
6489
6498
  }
6490
6499
  ) }),
6491
- /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
6500
+ /* @__PURE__ */ jsxs(Box, { className: "flex-1 min-w-0", children: [
6492
6501
  title && /* @__PURE__ */ jsx(Typography, { variant: "h6", className: "mb-1", children: title }),
6493
6502
  /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-sm", children: message }),
6494
- actionLabel && (onAction || actionEvent) && /* @__PURE__ */ jsx("div", { className: "mt-3", children: /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", onClick: handleAction, children: actionLabel }) })
6503
+ actionLabel && (onAction || actionEvent) && /* @__PURE__ */ jsx(Box, { className: "mt-3", children: /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", onClick: handleAction, children: actionLabel }) })
6495
6504
  ] }),
6496
- /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 flex-shrink-0", children: [
6505
+ /* @__PURE__ */ jsxs(Box, { className: "flex items-start gap-2 flex-shrink-0", children: [
6497
6506
  badge !== void 0 && /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: badge }),
6498
6507
  dismissible && /* @__PURE__ */ jsx(
6499
- "button",
6508
+ Button,
6500
6509
  {
6501
- type: "button",
6510
+ variant: "ghost",
6511
+ size: "sm",
6512
+ icon: X,
6502
6513
  onClick: handleDismiss,
6503
- className: cn(
6504
- "flex-shrink-0 p-1 transition-colors rounded-sm",
6505
- "hover:bg-muted",
6506
- "focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2"
6507
- ),
6508
6514
  "aria-label": "Dismiss toast",
6509
- children: /* @__PURE__ */ jsx(Icon, { icon: X, size: "sm" })
6515
+ className: "flex-shrink-0"
6510
6516
  }
6511
6517
  )
6512
6518
  ] })
@@ -6674,7 +6680,7 @@ var init_SvgFlow = __esm({
6674
6680
  opacity = 1,
6675
6681
  className
6676
6682
  }) => {
6677
- const markerId = React93__default.useMemo(() => {
6683
+ const markerId = React96__default.useMemo(() => {
6678
6684
  flowIdCounter += 1;
6679
6685
  return `almadar-flow-arrow-${flowIdCounter}`;
6680
6686
  }, []);
@@ -7217,7 +7223,7 @@ var init_SvgRing = __esm({
7217
7223
  className,
7218
7224
  label
7219
7225
  }) => {
7220
- const gradientId = React93__default.useMemo(() => {
7226
+ const gradientId = React96__default.useMemo(() => {
7221
7227
  ringIdCounter += 1;
7222
7228
  return `almadar-ring-glow-${ringIdCounter}`;
7223
7229
  }, []);
@@ -7378,7 +7384,7 @@ var Input;
7378
7384
  var init_Input = __esm({
7379
7385
  "components/atoms/Input.tsx"() {
7380
7386
  init_cn();
7381
- Input = React93__default.forwardRef(
7387
+ Input = React96__default.forwardRef(
7382
7388
  ({
7383
7389
  className,
7384
7390
  inputType,
@@ -7496,7 +7502,7 @@ var Label;
7496
7502
  var init_Label = __esm({
7497
7503
  "components/atoms/Label.tsx"() {
7498
7504
  init_cn();
7499
- Label = React93__default.forwardRef(
7505
+ Label = React96__default.forwardRef(
7500
7506
  ({ className, required, children, ...props }, ref) => {
7501
7507
  return /* @__PURE__ */ jsxs(
7502
7508
  "label",
@@ -7522,7 +7528,7 @@ var Textarea;
7522
7528
  var init_Textarea = __esm({
7523
7529
  "components/atoms/Textarea.tsx"() {
7524
7530
  init_cn();
7525
- Textarea = React93__default.forwardRef(
7531
+ Textarea = React96__default.forwardRef(
7526
7532
  ({ className, error, ...props }, ref) => {
7527
7533
  return /* @__PURE__ */ jsx(
7528
7534
  "textarea",
@@ -7551,7 +7557,7 @@ var Select;
7551
7557
  var init_Select = __esm({
7552
7558
  "components/atoms/Select.tsx"() {
7553
7559
  init_cn();
7554
- Select = React93__default.forwardRef(
7560
+ Select = React96__default.forwardRef(
7555
7561
  ({ className, options, placeholder, error, ...props }, ref) => {
7556
7562
  return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
7557
7563
  /* @__PURE__ */ jsxs(
@@ -7593,7 +7599,7 @@ var Checkbox;
7593
7599
  var init_Checkbox = __esm({
7594
7600
  "components/atoms/Checkbox.tsx"() {
7595
7601
  init_cn();
7596
- Checkbox = React93__default.forwardRef(
7602
+ Checkbox = React96__default.forwardRef(
7597
7603
  ({ className, label, id, ...props }, ref) => {
7598
7604
  const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
7599
7605
  return /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
@@ -7675,7 +7681,7 @@ var init_Card = __esm({
7675
7681
  md: "shadow",
7676
7682
  lg: "shadow-lg"
7677
7683
  };
7678
- Card = React93__default.forwardRef(
7684
+ Card = React96__default.forwardRef(
7679
7685
  ({
7680
7686
  className,
7681
7687
  variant = "bordered",
@@ -7711,9 +7717,9 @@ var init_Card = __esm({
7711
7717
  }
7712
7718
  );
7713
7719
  Card.displayName = "Card";
7714
- CardHeader = React93__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
7720
+ CardHeader = React96__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
7715
7721
  CardHeader.displayName = "CardHeader";
7716
- CardTitle = React93__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
7722
+ CardTitle = React96__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
7717
7723
  "h3",
7718
7724
  {
7719
7725
  ref,
@@ -7726,11 +7732,11 @@ var init_Card = __esm({
7726
7732
  }
7727
7733
  ));
7728
7734
  CardTitle.displayName = "CardTitle";
7729
- CardContent = React93__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
7735
+ CardContent = React96__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
7730
7736
  CardContent.displayName = "CardContent";
7731
7737
  CardBody = CardContent;
7732
7738
  CardBody.displayName = "CardBody";
7733
- CardFooter = React93__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
7739
+ CardFooter = React96__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
7734
7740
  "div",
7735
7741
  {
7736
7742
  ref,
@@ -7785,7 +7791,7 @@ var init_FilterPill = __esm({
7785
7791
  md: "w-3.5 h-3.5",
7786
7792
  lg: "w-4 h-4"
7787
7793
  };
7788
- FilterPill = React93__default.forwardRef(
7794
+ FilterPill = React96__default.forwardRef(
7789
7795
  ({
7790
7796
  className,
7791
7797
  variant = "default",
@@ -7864,7 +7870,7 @@ var init_Spinner = __esm({
7864
7870
  md: "h-6 w-6",
7865
7871
  lg: "h-8 w-8"
7866
7872
  };
7867
- Spinner = React93__default.forwardRef(
7873
+ Spinner = React96__default.forwardRef(
7868
7874
  ({ className, size = "md", ...props }, ref) => {
7869
7875
  return /* @__PURE__ */ jsx(
7870
7876
  "div",
@@ -8312,7 +8318,7 @@ var Radio;
8312
8318
  var init_Radio = __esm({
8313
8319
  "components/atoms/Radio.tsx"() {
8314
8320
  init_cn();
8315
- Radio = React93__default.forwardRef(
8321
+ Radio = React96__default.forwardRef(
8316
8322
  ({
8317
8323
  label,
8318
8324
  helperText,
@@ -8484,7 +8490,7 @@ var init_Switch = __esm({
8484
8490
  "components/atoms/Switch.tsx"() {
8485
8491
  "use client";
8486
8492
  init_cn();
8487
- Switch = React93.forwardRef(
8493
+ Switch = React96.forwardRef(
8488
8494
  ({
8489
8495
  checked,
8490
8496
  defaultChecked = false,
@@ -8495,10 +8501,10 @@ var init_Switch = __esm({
8495
8501
  name,
8496
8502
  className
8497
8503
  }, ref) => {
8498
- const [isChecked, setIsChecked] = React93.useState(
8504
+ const [isChecked, setIsChecked] = React96.useState(
8499
8505
  checked !== void 0 ? checked : defaultChecked
8500
8506
  );
8501
- React93.useEffect(() => {
8507
+ React96.useEffect(() => {
8502
8508
  if (checked !== void 0) {
8503
8509
  setIsChecked(checked);
8504
8510
  }
@@ -8761,6 +8767,16 @@ var init_FlipContainer = __esm({
8761
8767
  FlipContainer.displayName = "FlipContainer";
8762
8768
  }
8763
8769
  });
8770
+ var Aside;
8771
+ var init_Aside = __esm({
8772
+ "components/atoms/Aside.tsx"() {
8773
+ init_cn();
8774
+ Aside = React96__default.forwardRef(
8775
+ ({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
8776
+ );
8777
+ Aside.displayName = "Aside";
8778
+ }
8779
+ });
8764
8780
  function toSharedContext(ctx) {
8765
8781
  return createMinimalContext(
8766
8782
  {
@@ -8832,8 +8848,8 @@ var init_LawReferenceTooltip = __esm({
8832
8848
  position = "top",
8833
8849
  className
8834
8850
  }) => {
8835
- const [isVisible, setIsVisible] = React93__default.useState(false);
8836
- const timeoutRef = React93__default.useRef(null);
8851
+ const [isVisible, setIsVisible] = React96__default.useState(false);
8852
+ const timeoutRef = React96__default.useRef(null);
8837
8853
  const handleMouseEnter = () => {
8838
8854
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
8839
8855
  timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
@@ -8842,7 +8858,7 @@ var init_LawReferenceTooltip = __esm({
8842
8858
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
8843
8859
  setIsVisible(false);
8844
8860
  };
8845
- React93__default.useEffect(() => {
8861
+ React96__default.useEffect(() => {
8846
8862
  return () => {
8847
8863
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
8848
8864
  };
@@ -9052,7 +9068,7 @@ var init_StatusDot = __esm({
9052
9068
  md: "w-2.5 h-2.5",
9053
9069
  lg: "w-3 h-3"
9054
9070
  };
9055
- StatusDot = React93__default.forwardRef(
9071
+ StatusDot = React96__default.forwardRef(
9056
9072
  ({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
9057
9073
  return /* @__PURE__ */ jsx(
9058
9074
  "span",
@@ -9105,7 +9121,7 @@ var init_TrendIndicator = __esm({
9105
9121
  down: TrendingDown,
9106
9122
  flat: ArrowRight
9107
9123
  };
9108
- TrendIndicator = React93__default.forwardRef(
9124
+ TrendIndicator = React96__default.forwardRef(
9109
9125
  ({
9110
9126
  className,
9111
9127
  value,
@@ -9172,7 +9188,7 @@ var init_RangeSlider = __esm({
9172
9188
  md: "w-4 h-4",
9173
9189
  lg: "w-5 h-5"
9174
9190
  };
9175
- RangeSlider = React93__default.forwardRef(
9191
+ RangeSlider = React96__default.forwardRef(
9176
9192
  ({
9177
9193
  className,
9178
9194
  min = 0,
@@ -9740,7 +9756,7 @@ var init_ContentSection = __esm({
9740
9756
  md: "py-16",
9741
9757
  lg: "py-24"
9742
9758
  };
9743
- ContentSection = React93__default.forwardRef(
9759
+ ContentSection = React96__default.forwardRef(
9744
9760
  ({ children, background = "default", padding = "lg", id, className }, ref) => {
9745
9761
  return /* @__PURE__ */ jsx(
9746
9762
  Box,
@@ -10274,7 +10290,7 @@ var init_AnimatedReveal = __esm({
10274
10290
  "scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
10275
10291
  "none": {}
10276
10292
  };
10277
- AnimatedReveal = React93__default.forwardRef(
10293
+ AnimatedReveal = React96__default.forwardRef(
10278
10294
  ({
10279
10295
  trigger = "scroll",
10280
10296
  animation = "fade-up",
@@ -10434,7 +10450,7 @@ var init_AnimatedGraphic = __esm({
10434
10450
  "components/atoms/AnimatedGraphic.tsx"() {
10435
10451
  "use client";
10436
10452
  init_cn();
10437
- AnimatedGraphic = React93__default.forwardRef(
10453
+ AnimatedGraphic = React96__default.forwardRef(
10438
10454
  ({
10439
10455
  src,
10440
10456
  svgContent,
@@ -10457,7 +10473,7 @@ var init_AnimatedGraphic = __esm({
10457
10473
  const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
10458
10474
  const resolvedSvg = svgContent ?? fetchedSvg;
10459
10475
  const prevAnimateRef = useRef(animate);
10460
- const setRef = React93__default.useCallback(
10476
+ const setRef = React96__default.useCallback(
10461
10477
  (node) => {
10462
10478
  containerRef.current = node;
10463
10479
  if (typeof ref === "function") ref(node);
@@ -10684,9 +10700,9 @@ function ScoreDisplay({
10684
10700
  ...rest
10685
10701
  }) {
10686
10702
  const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof rest.score === "number" && !Number.isNaN(rest.score) ? rest.score : 0;
10687
- const [displayValue, setDisplayValue] = React93.useState(resolvedValue);
10688
- const [isAnimating, setIsAnimating] = React93.useState(false);
10689
- React93.useEffect(() => {
10703
+ const [displayValue, setDisplayValue] = React96.useState(resolvedValue);
10704
+ const [isAnimating, setIsAnimating] = React96.useState(false);
10705
+ React96.useEffect(() => {
10690
10706
  if (!animated || displayValue === resolvedValue) {
10691
10707
  setDisplayValue(resolvedValue);
10692
10708
  return;
@@ -10756,9 +10772,9 @@ function ControlButton({
10756
10772
  className
10757
10773
  }) {
10758
10774
  const eventBus = useEventBus();
10759
- const [isPressed, setIsPressed] = React93.useState(false);
10775
+ const [isPressed, setIsPressed] = React96.useState(false);
10760
10776
  const actualPressed = pressed ?? isPressed;
10761
- const handlePointerDown = React93.useCallback(
10777
+ const handlePointerDown = React96.useCallback(
10762
10778
  (e) => {
10763
10779
  e.preventDefault();
10764
10780
  if (disabled) return;
@@ -10768,7 +10784,7 @@ function ControlButton({
10768
10784
  },
10769
10785
  [disabled, pressEvent, eventBus, onPress]
10770
10786
  );
10771
- const handlePointerUp = React93.useCallback(
10787
+ const handlePointerUp = React96.useCallback(
10772
10788
  (e) => {
10773
10789
  e.preventDefault();
10774
10790
  if (disabled) return;
@@ -10778,7 +10794,7 @@ function ControlButton({
10778
10794
  },
10779
10795
  [disabled, releaseEvent, eventBus, onRelease]
10780
10796
  );
10781
- const handlePointerLeave = React93.useCallback(
10797
+ const handlePointerLeave = React96.useCallback(
10782
10798
  (e) => {
10783
10799
  if (isPressed) {
10784
10800
  setIsPressed(false);
@@ -11684,9 +11700,9 @@ function MiniMap({
11684
11700
  viewportRect,
11685
11701
  className
11686
11702
  }) {
11687
- const canvasRef = React93.useRef(null);
11688
- const frameRef = React93.useRef(0);
11689
- React93.useEffect(() => {
11703
+ const canvasRef = React96.useRef(null);
11704
+ const frameRef = React96.useRef(0);
11705
+ React96.useEffect(() => {
11690
11706
  const canvas = canvasRef.current;
11691
11707
  if (!canvas) return;
11692
11708
  const ctx = canvas.getContext("2d");
@@ -11980,7 +11996,7 @@ var init_ErrorBoundary = __esm({
11980
11996
  "use client";
11981
11997
  init_cn();
11982
11998
  init_ErrorState();
11983
- ErrorBoundary = class extends React93__default.Component {
11999
+ ErrorBoundary = class extends React96__default.Component {
11984
12000
  constructor(props) {
11985
12001
  super(props);
11986
12002
  __publicField(this, "reset", () => {
@@ -12560,7 +12576,7 @@ var init_HeroSection = __esm({
12560
12576
  HeroSection.displayName = "HeroSection";
12561
12577
  }
12562
12578
  });
12563
- var ArticleSection;
12579
+ var maxWidthMap, ArticleSection;
12564
12580
  var init_ArticleSection = __esm({
12565
12581
  "components/molecules/ArticleSection.tsx"() {
12566
12582
  "use client";
@@ -12568,6 +12584,11 @@ var init_ArticleSection = __esm({
12568
12584
  init_Box();
12569
12585
  init_Stack();
12570
12586
  init_Typography();
12587
+ maxWidthMap = {
12588
+ sm: "max-w-full sm:max-w-xl md:max-w-2xl",
12589
+ md: "max-w-full sm:max-w-2xl md:max-w-3xl",
12590
+ lg: "max-w-full sm:max-w-3xl md:max-w-4xl"
12591
+ };
12571
12592
  ArticleSection = ({
12572
12593
  title,
12573
12594
  children,
@@ -12582,7 +12603,7 @@ var init_ArticleSection = __esm({
12582
12603
  className
12583
12604
  ),
12584
12605
  padding: "md",
12585
- children: /* @__PURE__ */ jsxs(VStack, { gap: "lg", align: "start", children: [
12606
+ children: /* @__PURE__ */ jsxs(VStack, { gap: "lg", align: "start", className: cn("w-full mx-auto", maxWidthMap[maxWidth]), children: [
12586
12607
  /* @__PURE__ */ jsx(Typography, { variant: "h2", children: title }),
12587
12608
  /* @__PURE__ */ jsx(Box, { className: "w-full", children })
12588
12609
  ] })
@@ -12634,6 +12655,7 @@ var init_TeamCard = __esm({
12634
12655
  var gapStyles2, colStyles, SimpleGrid;
12635
12656
  var init_SimpleGrid = __esm({
12636
12657
  "components/molecules/SimpleGrid.tsx"() {
12658
+ init_Box();
12637
12659
  init_cn();
12638
12660
  gapStyles2 = {
12639
12661
  none: "gap-0",
@@ -12646,10 +12668,10 @@ var init_SimpleGrid = __esm({
12646
12668
  colStyles = {
12647
12669
  1: "grid-cols-1",
12648
12670
  2: "grid-cols-1 sm:grid-cols-2",
12649
- 3: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",
12650
- 4: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4",
12651
- 5: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5",
12652
- 6: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6"
12671
+ 3: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3",
12672
+ 4: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",
12673
+ 5: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5",
12674
+ 6: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6"
12653
12675
  };
12654
12676
  SimpleGrid = ({
12655
12677
  minChildWidth = 250,
@@ -12660,12 +12682,12 @@ var init_SimpleGrid = __esm({
12660
12682
  children
12661
12683
  }) => {
12662
12684
  if (cols) {
12663
- return /* @__PURE__ */ jsx("div", { className: cn("grid", colStyles[cols], gapStyles2[gap], className), children });
12685
+ return /* @__PURE__ */ jsx(Box, { className: cn("grid", colStyles[cols], gapStyles2[gap], className), children });
12664
12686
  }
12665
12687
  const minWidth = typeof minChildWidth === "number" ? `${minChildWidth}px` : minChildWidth;
12666
12688
  const templateColumns = maxCols ? `repeat(auto-fit, minmax(min(${minWidth}, 100%), 1fr))` : `repeat(auto-fit, minmax(${minWidth}, 1fr))`;
12667
12689
  return /* @__PURE__ */ jsx(
12668
- "div",
12690
+ Box,
12669
12691
  {
12670
12692
  className: cn("grid", gapStyles2[gap], className),
12671
12693
  style: {
@@ -13055,8 +13077,8 @@ var init_Tooltip = __esm({
13055
13077
  if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
13056
13078
  };
13057
13079
  }, []);
13058
- const triggerElement = React93__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
13059
- const trigger = React93__default.cloneElement(triggerElement, {
13080
+ const triggerElement = React96__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
13081
+ const trigger = React96__default.cloneElement(triggerElement, {
13060
13082
  ref: triggerRef,
13061
13083
  onMouseEnter: handleMouseEnter,
13062
13084
  onMouseLeave: handleMouseLeave,
@@ -13177,8 +13199,8 @@ var init_Popover = __esm({
13177
13199
  onMouseEnter: handleOpen,
13178
13200
  onMouseLeave: handleClose
13179
13201
  };
13180
- const childElement = React93__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
13181
- const triggerElement = React93__default.cloneElement(
13202
+ const childElement = React96__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
13203
+ const triggerElement = React96__default.cloneElement(
13182
13204
  childElement,
13183
13205
  {
13184
13206
  ref: triggerRef,
@@ -13227,6 +13249,7 @@ var Menu;
13227
13249
  var init_Menu = __esm({
13228
13250
  "components/molecules/Menu.tsx"() {
13229
13251
  "use client";
13252
+ init_Box();
13230
13253
  init_Icon();
13231
13254
  init_Divider();
13232
13255
  init_Typography();
@@ -13295,8 +13318,8 @@ var init_Menu = __esm({
13295
13318
  "bottom-start": "top-full left-0 mt-2",
13296
13319
  "bottom-end": "top-full right-0 mt-2"
13297
13320
  };
13298
- const triggerChild = React93__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx("span", { children: trigger });
13299
- const triggerElement = React93__default.cloneElement(
13321
+ const triggerChild = React96__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
13322
+ const triggerElement = React96__default.cloneElement(
13300
13323
  triggerChild,
13301
13324
  {
13302
13325
  ref: triggerRef,
@@ -13308,17 +13331,17 @@ var init_Menu = __esm({
13308
13331
  "border-[length:var(--border-width)] border-border",
13309
13332
  "shadow",
13310
13333
  "rounded-sm",
13311
- "min-w-[200px] py-1"
13334
+ "min-w-0 sm:min-w-[200px] max-w-[calc(100vw-1rem)] py-1"
13312
13335
  );
13313
13336
  const renderMenuItem = (item, hasSubMenu, index) => {
13314
13337
  const itemId = item.id ?? `item-${item.label.toLowerCase().replace(/\s+/g, "-")}-${index}`;
13315
13338
  const isDanger = item.variant === "danger";
13316
13339
  return /* @__PURE__ */ jsx(
13317
- "button",
13340
+ Box,
13318
13341
  {
13319
- type: "button",
13320
- onClick: () => handleItemClick({ ...item, id: itemId }),
13321
- disabled: item.disabled,
13342
+ as: "button",
13343
+ onClick: () => !item.disabled && handleItemClick({ ...item, id: itemId }),
13344
+ "aria-disabled": item.disabled || void 0,
13322
13345
  onMouseEnter: () => hasSubMenu && setActiveSubMenu(itemId),
13323
13346
  "data-testid": item.event ? `action-${item.event}` : void 0,
13324
13347
  className: cn(
@@ -13330,7 +13353,7 @@ var init_Menu = __esm({
13330
13353
  item.disabled && "cursor-not-allowed",
13331
13354
  isDanger && "text-error hover:bg-error/10"
13332
13355
  ),
13333
- children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 flex-1 min-w-0", children: [
13356
+ children: /* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-3 flex-1 min-w-0", children: [
13334
13357
  item.icon && (typeof item.icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: item.icon, size: "sm", className: "flex-shrink-0" }) : /* @__PURE__ */ jsx(Icon, { icon: item.icon, size: "sm", className: "flex-shrink-0" })),
13335
13358
  /* @__PURE__ */ jsx(
13336
13359
  Typography,
@@ -13355,10 +13378,10 @@ var init_Menu = __esm({
13355
13378
  if (isDivider) {
13356
13379
  return /* @__PURE__ */ jsx(Divider, { className: "my-1" }, `divider-${index}`);
13357
13380
  }
13358
- return /* @__PURE__ */ jsxs("div", { children: [
13381
+ return /* @__PURE__ */ jsxs(Box, { children: [
13359
13382
  renderMenuItem(item, !!hasSubMenu, index),
13360
13383
  hasSubMenu && activeSubMenu === itemId && item.subMenu && /* @__PURE__ */ jsx(
13361
- "div",
13384
+ Box,
13362
13385
  {
13363
13386
  className: cn(
13364
13387
  "absolute left-full top-0 ml-2 z-50",
@@ -13370,10 +13393,10 @@ var init_Menu = __esm({
13370
13393
  ] }, itemId);
13371
13394
  });
13372
13395
  };
13373
- return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
13396
+ return /* @__PURE__ */ jsxs(Box, { className: "relative", children: [
13374
13397
  triggerElement,
13375
13398
  isOpen && triggerRect && /* @__PURE__ */ jsx(
13376
- "div",
13399
+ Box,
13377
13400
  {
13378
13401
  ref: menuRef,
13379
13402
  className: cn(
@@ -13712,13 +13735,13 @@ var init_MapView = __esm({
13712
13735
  shadowSize: [41, 41]
13713
13736
  });
13714
13737
  L.Marker.prototype.options.icon = defaultIcon;
13715
- const { useEffect: useEffect87, useRef: useRef88, useCallback: useCallback128, useState: useState121 } = React93__default;
13738
+ const { useEffect: useEffect88, useRef: useRef88, useCallback: useCallback128, useState: useState122 } = React96__default;
13716
13739
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
13717
13740
  const { useEventBus: useEventBus3 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
13718
13741
  function MapUpdater({ centerLat, centerLng, zoom }) {
13719
13742
  const map = useMap();
13720
13743
  const prevRef = useRef88({ centerLat, centerLng, zoom });
13721
- useEffect87(() => {
13744
+ useEffect88(() => {
13722
13745
  const prev = prevRef.current;
13723
13746
  if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
13724
13747
  map.setView([centerLat, centerLng], zoom);
@@ -13729,7 +13752,7 @@ var init_MapView = __esm({
13729
13752
  }
13730
13753
  function MapClickHandler({ onMapClick }) {
13731
13754
  const map = useMap();
13732
- useEffect87(() => {
13755
+ useEffect88(() => {
13733
13756
  if (!onMapClick) return;
13734
13757
  const handler = (e) => {
13735
13758
  onMapClick(e.latlng.lat, e.latlng.lng);
@@ -13757,7 +13780,7 @@ var init_MapView = __esm({
13757
13780
  showAttribution = true
13758
13781
  }) {
13759
13782
  const eventBus = useEventBus3();
13760
- const [clickedPosition, setClickedPosition] = useState121(null);
13783
+ const [clickedPosition, setClickedPosition] = useState122(null);
13761
13784
  const handleMapClick = useCallback128((lat, lng) => {
13762
13785
  if (showClickedPin) {
13763
13786
  setClickedPosition({ lat, lng });
@@ -13958,7 +13981,7 @@ function InputPattern({
13958
13981
  fieldName
13959
13982
  }) {
13960
13983
  const { emit } = useEventBus();
13961
- const [localValue, setLocalValue] = React93__default.useState(value);
13984
+ const [localValue, setLocalValue] = React96__default.useState(value);
13962
13985
  const handleChange = (e) => {
13963
13986
  setLocalValue(e.target.value);
13964
13987
  if (onChange) {
@@ -13996,7 +14019,7 @@ function TextareaPattern({
13996
14019
  fieldName
13997
14020
  }) {
13998
14021
  const { emit } = useEventBus();
13999
- const [localValue, setLocalValue] = React93__default.useState(value);
14022
+ const [localValue, setLocalValue] = React96__default.useState(value);
14000
14023
  const handleChange = (e) => {
14001
14024
  setLocalValue(e.target.value);
14002
14025
  if (onChange) {
@@ -14028,7 +14051,7 @@ function SelectPattern({
14028
14051
  fieldName
14029
14052
  }) {
14030
14053
  const { emit } = useEventBus();
14031
- const [localValue, setLocalValue] = React93__default.useState(value);
14054
+ const [localValue, setLocalValue] = React96__default.useState(value);
14032
14055
  const handleChange = (e) => {
14033
14056
  setLocalValue(e.target.value);
14034
14057
  if (onChange) {
@@ -14057,7 +14080,7 @@ function CheckboxPattern({
14057
14080
  className
14058
14081
  }) {
14059
14082
  const { emit } = useEventBus();
14060
- const [localChecked, setLocalChecked] = React93__default.useState(checked);
14083
+ const [localChecked, setLocalChecked] = React96__default.useState(checked);
14061
14084
  const handleChange = (e) => {
14062
14085
  setLocalChecked(e.target.checked);
14063
14086
  if (onChange) {
@@ -14288,8 +14311,8 @@ function ActionButtons({
14288
14311
  disabled
14289
14312
  }) {
14290
14313
  const eventBus = useEventBus();
14291
- const [activeButtons, setActiveButtons] = React93.useState(/* @__PURE__ */ new Set());
14292
- const handlePress = React93.useCallback(
14314
+ const [activeButtons, setActiveButtons] = React96.useState(/* @__PURE__ */ new Set());
14315
+ const handlePress = React96.useCallback(
14293
14316
  (id) => {
14294
14317
  setActiveButtons((prev) => new Set(prev).add(id));
14295
14318
  if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
@@ -14297,7 +14320,7 @@ function ActionButtons({
14297
14320
  },
14298
14321
  [actionEvent, eventBus, onAction]
14299
14322
  );
14300
- const handleRelease = React93.useCallback(
14323
+ const handleRelease = React96.useCallback(
14301
14324
  (id) => {
14302
14325
  setActiveButtons((prev) => {
14303
14326
  const next = new Set(prev);
@@ -16361,7 +16384,7 @@ var init_MarkdownContent = __esm({
16361
16384
  init_Box();
16362
16385
  init_useTranslate();
16363
16386
  init_cn();
16364
- MarkdownContent = React93__default.memo(
16387
+ MarkdownContent = React96__default.memo(
16365
16388
  ({ content, direction, className }) => {
16366
16389
  const { t: _t } = useTranslate();
16367
16390
  const safeContent = typeof content === "string" ? content : String(content ?? "");
@@ -16579,7 +16602,7 @@ var init_CodeBlock = __esm({
16579
16602
  log8 = createLogger("almadar:ui:markdown-code");
16580
16603
  LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
16581
16604
  HIDDEN_LINE_NUMBERS = { display: "none" };
16582
- CodeBlock = React93__default.memo(
16605
+ CodeBlock = React96__default.memo(
16583
16606
  ({
16584
16607
  code: rawCode,
16585
16608
  language = "text",
@@ -17888,7 +17911,7 @@ var init_StateMachineView = __esm({
17888
17911
  style: { top: title ? 30 : 0 },
17889
17912
  children: [
17890
17913
  entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
17891
- states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React93__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
17914
+ states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React96__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
17892
17915
  StateNode,
17893
17916
  {
17894
17917
  state,
@@ -19469,27 +19492,23 @@ var init_Grid = __esm({
19469
19492
  as: Component2 = "div"
19470
19493
  }) => {
19471
19494
  const mergedStyle = rows ? { gridTemplateRows: `repeat(${rows}, minmax(0, 1fr))`, ...style } : style;
19472
- const Comp = Component2;
19473
- return /* @__PURE__ */ jsx(
19474
- Comp,
19495
+ return React96__default.createElement(
19496
+ Component2,
19475
19497
  {
19476
19498
  className: cn(
19477
19499
  "grid",
19478
19500
  getColsClass(cols),
19479
- // Gap (rowGap/colGap override gap)
19480
19501
  rowGap ? rowGapStyles[rowGap] : colGap ? void 0 : gapStyles3[gap],
19481
19502
  colGap ? colGapStyles[colGap] : rowGap ? void 0 : void 0,
19482
19503
  rowGap && colGap ? `${rowGapStyles[rowGap]} ${colGapStyles[colGap]}` : void 0,
19483
- // Alignment
19484
19504
  alignItems && alignStyles2[alignItems],
19485
19505
  justifyItems && justifyStyles2[justifyItems],
19486
- // Flow
19487
19506
  flow && flowStyles[flow],
19488
19507
  className
19489
19508
  ),
19490
- style: mergedStyle,
19491
- children
19492
- }
19509
+ style: mergedStyle
19510
+ },
19511
+ children
19493
19512
  );
19494
19513
  };
19495
19514
  Grid.displayName = "Grid";
@@ -20508,6 +20527,35 @@ var init_useSwipeGesture = __esm({
20508
20527
  "use client";
20509
20528
  }
20510
20529
  });
20530
+ function dayWindowForViewport(width) {
20531
+ if (width <= 640) return 1;
20532
+ if (width <= 1024) return 3;
20533
+ return 7;
20534
+ }
20535
+ function useDayWindow(override) {
20536
+ const [w, setW] = useState(() => {
20537
+ if (override !== "auto") return override;
20538
+ if (typeof window === "undefined") return 7;
20539
+ return dayWindowForViewport(window.innerWidth);
20540
+ });
20541
+ useEffect(() => {
20542
+ if (override !== "auto") {
20543
+ setW(override);
20544
+ return void 0;
20545
+ }
20546
+ if (typeof window === "undefined") return void 0;
20547
+ const onResize = () => setW(dayWindowForViewport(window.innerWidth));
20548
+ onResize();
20549
+ window.addEventListener("resize", onResize);
20550
+ return () => window.removeEventListener("resize", onResize);
20551
+ }, [override]);
20552
+ return w;
20553
+ }
20554
+ function formatDateRange(start, end) {
20555
+ const startStr = start.toLocaleDateString(void 0, SHORT_DATE);
20556
+ const endStr = end.toLocaleDateString(void 0, SHORT_DATE);
20557
+ return start.toDateString() === end.toDateString() ? startStr : `${startStr} \u2013 ${endStr}`;
20558
+ }
20511
20559
  function getStartOfWeek(date) {
20512
20560
  const d = new Date(date);
20513
20561
  const day = d.getDay();
@@ -20548,7 +20596,8 @@ function CalendarGrid({
20548
20596
  longPressEvent,
20549
20597
  longPressPayload,
20550
20598
  swipeLeftEvent,
20551
- swipeRightEvent
20599
+ swipeRightEvent,
20600
+ dayWindow = "auto"
20552
20601
  }) {
20553
20602
  const eventBus = useEventBus();
20554
20603
  const longPressTimer = useRef(null);
@@ -20564,6 +20613,26 @@ function CalendarGrid({
20564
20613
  () => timeSlots ?? generateDefaultTimeSlots(),
20565
20614
  [timeSlots]
20566
20615
  );
20616
+ const visibleCount = useDayWindow(dayWindow);
20617
+ const [dayOffset, setDayOffset] = useState(0);
20618
+ useEffect(() => {
20619
+ if (dayOffset + visibleCount > 7) {
20620
+ setDayOffset(Math.max(0, 7 - visibleCount));
20621
+ }
20622
+ }, [visibleCount, dayOffset]);
20623
+ const visibleDays = useMemo(
20624
+ () => weekDays.slice(dayOffset, dayOffset + visibleCount),
20625
+ [weekDays, dayOffset, visibleCount]
20626
+ );
20627
+ const canPrev = dayOffset > 0;
20628
+ const canNext = dayOffset + visibleCount < 7;
20629
+ const stepPrev = useCallback(() => {
20630
+ setDayOffset((d) => Math.max(0, d - visibleCount));
20631
+ }, [visibleCount]);
20632
+ const stepNext = useCallback(() => {
20633
+ setDayOffset((d) => Math.min(7 - visibleCount, d + visibleCount));
20634
+ }, [visibleCount]);
20635
+ const gridColsClass = visibleCount === 1 ? "grid-cols-2" : visibleCount === 3 ? "grid-cols-4" : "grid-cols-8";
20567
20636
  const handleSlotClick = useCallback(
20568
20637
  (day, time) => {
20569
20638
  onSlotClick?.(day, time);
@@ -20615,93 +20684,124 @@ function CalendarGrid({
20615
20684
  },
20616
20685
  event.id
20617
20686
  );
20618
- return /* @__PURE__ */ jsx(
20687
+ return /* @__PURE__ */ jsxs(
20619
20688
  Box,
20620
20689
  {
20621
- className: cn("overflow-x-auto", className),
20690
+ className,
20622
20691
  ...swipeLeftEvent || swipeRightEvent ? {
20623
20692
  onPointerDown: swipe.onPointerDown,
20624
20693
  onPointerMove: swipe.onPointerMove,
20625
20694
  onPointerUp: swipe.onPointerUp,
20626
20695
  onPointerCancel: swipe.onPointerCancel
20627
20696
  } : {},
20628
- children: /* @__PURE__ */ jsxs(Box, { className: "min-w-[800px]", children: [
20629
- /* @__PURE__ */ jsxs(Box, { className: "grid grid-cols-8 border-b border-border", children: [
20630
- /* @__PURE__ */ jsx(Box, { className: "p-2" }),
20631
- weekDays.map((day) => {
20632
- const isToday = day.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
20633
- const count = eventsForDayCount(day);
20634
- return /* @__PURE__ */ jsxs(
20635
- Box,
20636
- {
20637
- className: "border-l border-border",
20638
- children: [
20639
- /* @__PURE__ */ jsx(
20640
- DayCell,
20641
- {
20642
- date: day,
20643
- isToday,
20644
- onClick: onDayClick
20645
- }
20646
- ),
20647
- count > 0 && /* @__PURE__ */ jsx(Box, { className: "text-center pb-1", children: /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: count }) })
20648
- ]
20649
- },
20650
- day.toISOString()
20651
- );
20652
- })
20697
+ children: [
20698
+ visibleCount < 7 && /* @__PURE__ */ jsxs(HStack, { align: "center", justify: "between", className: "mb-2 px-2", children: [
20699
+ /* @__PURE__ */ jsx(
20700
+ Button,
20701
+ {
20702
+ variant: "ghost",
20703
+ size: "sm",
20704
+ icon: ChevronLeft,
20705
+ onClick: stepPrev,
20706
+ "aria-disabled": !canPrev || void 0,
20707
+ "aria-label": "Previous days",
20708
+ children: "Prev"
20709
+ }
20710
+ ),
20711
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground", children: formatDateRange(visibleDays[0], visibleDays[visibleDays.length - 1]) }),
20712
+ /* @__PURE__ */ jsx(
20713
+ Button,
20714
+ {
20715
+ variant: "ghost",
20716
+ size: "sm",
20717
+ iconRight: ChevronRight,
20718
+ onClick: stepNext,
20719
+ "aria-disabled": !canNext || void 0,
20720
+ "aria-label": "Next days",
20721
+ children: "Next"
20722
+ }
20723
+ )
20653
20724
  ] }),
20654
- /* @__PURE__ */ jsx(Box, { className: "max-h-[500px] overflow-y-auto", children: resolvedTimeSlots.map((time) => /* @__PURE__ */ jsxs(
20655
- Box,
20656
- {
20657
- className: "grid grid-cols-8 border-b border-border",
20658
- children: [
20659
- /* @__PURE__ */ jsx(Box, { className: "p-2 text-right pr-3", children: /* @__PURE__ */ jsx(
20660
- Typography,
20725
+ /* @__PURE__ */ jsxs(Box, { children: [
20726
+ /* @__PURE__ */ jsxs(Box, { className: cn("grid border-b border-border", gridColsClass), children: [
20727
+ /* @__PURE__ */ jsx(Box, { className: "p-2" }),
20728
+ visibleDays.map((day) => {
20729
+ const isToday = day.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
20730
+ const count = eventsForDayCount(day);
20731
+ return /* @__PURE__ */ jsxs(
20732
+ Box,
20661
20733
  {
20662
- variant: "small",
20663
- className: "text-muted-foreground",
20664
- children: time
20665
- }
20666
- ) }),
20667
- weekDays.map((day) => {
20668
- const slotEvents = events2.filter(
20669
- (ev) => eventInSlot(ev, day, time)
20670
- );
20671
- const isToday = day.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
20672
- return /* @__PURE__ */ jsx(
20673
- TimeSlotCell,
20674
- {
20675
- time,
20676
- isOccupied: slotEvents.length > 0,
20677
- onClick: () => handleSlotClick(day, time),
20678
- className: cn(
20679
- "border-l border-border",
20680
- isToday && "bg-blue-50/30"
20734
+ className: "border-l border-border",
20735
+ children: [
20736
+ /* @__PURE__ */ jsx(
20737
+ DayCell,
20738
+ {
20739
+ date: day,
20740
+ isToday,
20741
+ onClick: onDayClick
20742
+ }
20681
20743
  ),
20682
- ...longPressEvent ? {
20683
- onPointerDown: () => startLongPress(day, time),
20684
- onPointerUp: clearLongPress,
20685
- onPointerCancel: clearLongPress
20686
- } : {},
20687
- children: /* @__PURE__ */ jsx(VStack, { gap: "xs", children: slotEvents.map(renderEvent) })
20688
- },
20689
- `${day.toISOString()}-${time}`
20690
- );
20691
- })
20692
- ]
20693
- },
20694
- time
20695
- )) })
20696
- ] })
20744
+ count > 0 && /* @__PURE__ */ jsx(Box, { className: "text-center pb-1", children: /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: count }) })
20745
+ ]
20746
+ },
20747
+ day.toISOString()
20748
+ );
20749
+ })
20750
+ ] }),
20751
+ /* @__PURE__ */ jsx(Box, { className: "max-h-[500px] overflow-y-auto", children: resolvedTimeSlots.map((time) => /* @__PURE__ */ jsxs(
20752
+ Box,
20753
+ {
20754
+ className: cn("grid border-b border-border", gridColsClass),
20755
+ children: [
20756
+ /* @__PURE__ */ jsx(Box, { className: "p-2 text-right pr-3", children: /* @__PURE__ */ jsx(
20757
+ Typography,
20758
+ {
20759
+ variant: "small",
20760
+ className: "text-muted-foreground",
20761
+ children: time
20762
+ }
20763
+ ) }),
20764
+ visibleDays.map((day) => {
20765
+ const slotEvents = events2.filter(
20766
+ (ev) => eventInSlot(ev, day, time)
20767
+ );
20768
+ const isToday = day.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
20769
+ return /* @__PURE__ */ jsx(
20770
+ TimeSlotCell,
20771
+ {
20772
+ time,
20773
+ isOccupied: slotEvents.length > 0,
20774
+ onClick: () => handleSlotClick(day, time),
20775
+ className: cn(
20776
+ "border-l border-border",
20777
+ isToday && "bg-blue-50/30"
20778
+ ),
20779
+ ...longPressEvent ? {
20780
+ onPointerDown: () => startLongPress(day, time),
20781
+ onPointerUp: clearLongPress,
20782
+ onPointerCancel: clearLongPress
20783
+ } : {},
20784
+ children: /* @__PURE__ */ jsx(VStack, { gap: "xs", children: slotEvents.map(renderEvent) })
20785
+ },
20786
+ `${day.toISOString()}-${time}`
20787
+ );
20788
+ })
20789
+ ]
20790
+ },
20791
+ time
20792
+ )) })
20793
+ ] })
20794
+ ]
20697
20795
  }
20698
20796
  );
20699
20797
  }
20798
+ var SHORT_DATE;
20700
20799
  var init_CalendarGrid = __esm({
20701
20800
  "components/molecules/CalendarGrid.tsx"() {
20702
20801
  "use client";
20703
20802
  init_cn();
20704
20803
  init_Box();
20804
+ init_Button();
20705
20805
  init_Stack();
20706
20806
  init_Typography();
20707
20807
  init_Badge();
@@ -20709,6 +20809,7 @@ var init_CalendarGrid = __esm({
20709
20809
  init_TimeSlotCell();
20710
20810
  init_useEventBus();
20711
20811
  init_useSwipeGesture();
20812
+ SHORT_DATE = { month: "short", day: "numeric" };
20712
20813
  CalendarGrid.displayName = "CalendarGrid";
20713
20814
  }
20714
20815
  });
@@ -23870,9 +23971,9 @@ var init_Tabs = __esm({
23870
23971
  className
23871
23972
  }) => {
23872
23973
  const rawItems = items ?? tabs ?? [];
23873
- const safeItems = rawItems.map((item) => ({
23874
- ...item,
23875
- id: item.id || item.value || ""
23974
+ const safeItems = rawItems.map(({ id, value, ...rest }) => ({
23975
+ ...rest,
23976
+ id: id || value || ""
23876
23977
  }));
23877
23978
  const eventBus = useEventBus();
23878
23979
  const { t } = useTranslate();
@@ -23941,7 +24042,12 @@ var init_Tabs = __esm({
23941
24042
  role: "tablist",
23942
24043
  className: cn(
23943
24044
  "flex",
23944
- orientation === "horizontal" ? "flex-row border-b-[length:var(--border-width)] border-border" : "flex-col border-r-[length:var(--border-width)] border-border",
24045
+ // Horizontal tab strip becomes a horizontally-scrollable lane
24046
+ // below its container width — phones with many tabs scroll
24047
+ // instead of clipping. `snap-x` snaps to each tab; the
24048
+ // scrollbar is hidden for a cleaner affordance (the swipe
24049
+ // gesture is the discoverability cue).
24050
+ orientation === "horizontal" ? "flex-row border-b-[length:var(--border-width)] border-border overflow-x-auto snap-x snap-mandatory [&::-webkit-scrollbar]:hidden" : "flex-col border-r-[length:var(--border-width)] border-border",
23945
24051
  variant === "pills" && "gap-1 p-1 bg-muted border-0 rounded-md",
23946
24052
  variant === "underline" && orientation === "vertical" && "border-b-0"
23947
24053
  ),
@@ -23963,7 +24069,8 @@ var init_Tabs = __esm({
23963
24069
  onKeyDown: (e) => handleKeyDown(e, index),
23964
24070
  "data-active": isActive,
23965
24071
  className: cn(
23966
- "flex items-center gap-2 px-4 py-2 text-sm font-medium transition-all",
24072
+ "flex items-center gap-2 px-4 py-2 text-sm font-medium transition-all whitespace-nowrap",
24073
+ orientation === "horizontal" && "snap-start shrink-0",
23967
24074
  "focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
23968
24075
  isDisabled && "opacity-50 cursor-not-allowed",
23969
24076
  variantClasses2[variant],
@@ -24728,7 +24835,7 @@ function CraftingRecipe({
24728
24835
  className
24729
24836
  }) {
24730
24837
  const eventBus = useEventBus();
24731
- const handleCraft = React93.useCallback(() => {
24838
+ const handleCraft = React96.useCallback(() => {
24732
24839
  onCraft?.();
24733
24840
  if (craftEvent) {
24734
24841
  eventBus.emit(craftEvent, { output: output.label });
@@ -24745,7 +24852,7 @@ function CraftingRecipe({
24745
24852
  children: [
24746
24853
  /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
24747
24854
  const hasSufficient = ingredient.available >= ingredient.required;
24748
- return /* @__PURE__ */ jsxs(React93.Fragment, { children: [
24855
+ return /* @__PURE__ */ jsxs(React96.Fragment, { children: [
24749
24856
  /* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
24750
24857
  ItemSlot,
24751
24858
  {
@@ -24808,8 +24915,8 @@ function DPad({
24808
24915
  }) {
24809
24916
  const eventBus = useEventBus();
24810
24917
  const sizes = sizeMap15[size];
24811
- const [activeDirections, setActiveDirections] = React93.useState(/* @__PURE__ */ new Set());
24812
- const handlePress = React93.useCallback(
24918
+ const [activeDirections, setActiveDirections] = React96.useState(/* @__PURE__ */ new Set());
24919
+ const handlePress = React96.useCallback(
24813
24920
  (direction) => {
24814
24921
  setActiveDirections((prev) => new Set(prev).add(direction));
24815
24922
  if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
@@ -24817,7 +24924,7 @@ function DPad({
24817
24924
  },
24818
24925
  [directionEvent, eventBus, onDirection]
24819
24926
  );
24820
- const handleRelease = React93.useCallback(
24927
+ const handleRelease = React96.useCallback(
24821
24928
  (direction) => {
24822
24929
  setActiveDirections((prev) => {
24823
24930
  const next = new Set(prev);
@@ -25358,14 +25465,14 @@ function useDataDnd(args) {
25358
25465
  const isZone = Boolean(dragGroup || accepts || sortable);
25359
25466
  const enabled = isZone || Boolean(dndRoot);
25360
25467
  const eventBus = useEventBus();
25361
- const parentRoot = React93__default.useContext(RootCtx);
25468
+ const parentRoot = React96__default.useContext(RootCtx);
25362
25469
  const isRoot = enabled && parentRoot === null;
25363
- const zoneId = React93__default.useId();
25470
+ const zoneId = React96__default.useId();
25364
25471
  const ownGroup = dragGroup ?? accepts ?? zoneId;
25365
- const [optimisticOrders, setOptimisticOrders] = React93__default.useState(() => /* @__PURE__ */ new Map());
25366
- const optimisticOrdersRef = React93__default.useRef(optimisticOrders);
25472
+ const [optimisticOrders, setOptimisticOrders] = React96__default.useState(() => /* @__PURE__ */ new Map());
25473
+ const optimisticOrdersRef = React96__default.useRef(optimisticOrders);
25367
25474
  optimisticOrdersRef.current = optimisticOrders;
25368
- const clearOptimisticOrder = React93__default.useCallback((group) => {
25475
+ const clearOptimisticOrder = React96__default.useCallback((group) => {
25369
25476
  setOptimisticOrders((prev) => {
25370
25477
  if (!prev.has(group)) return prev;
25371
25478
  const next = new Map(prev);
@@ -25390,7 +25497,7 @@ function useDataDnd(args) {
25390
25497
  const raw = it[dndItemIdField];
25391
25498
  return String(raw ?? `__idx_${idx}`);
25392
25499
  }).join("|");
25393
- const itemIds = React93__default.useMemo(
25500
+ const itemIds = React96__default.useMemo(
25394
25501
  () => orderedItems.map((it, idx) => {
25395
25502
  const raw = it[dndItemIdField];
25396
25503
  return raw ?? `__idx_${idx}`;
@@ -25398,7 +25505,7 @@ function useDataDnd(args) {
25398
25505
  [itemIdsSignature]
25399
25506
  );
25400
25507
  const itemsContentSig = items.map((it, idx) => String(it[dndItemIdField] ?? `__${idx}`)).join("|");
25401
- React93__default.useEffect(() => {
25508
+ React96__default.useEffect(() => {
25402
25509
  const root = isRoot ? null : parentRoot;
25403
25510
  if (root) {
25404
25511
  root.clearOptimisticOrder(ownGroup);
@@ -25406,20 +25513,20 @@ function useDataDnd(args) {
25406
25513
  clearOptimisticOrder(ownGroup);
25407
25514
  }
25408
25515
  }, [itemsContentSig, ownGroup]);
25409
- const zonesRef = React93__default.useRef(/* @__PURE__ */ new Map());
25410
- const registerZone = React93__default.useCallback((zoneId2, meta2) => {
25516
+ const zonesRef = React96__default.useRef(/* @__PURE__ */ new Map());
25517
+ const registerZone = React96__default.useCallback((zoneId2, meta2) => {
25411
25518
  zonesRef.current.set(zoneId2, meta2);
25412
25519
  }, []);
25413
- const unregisterZone = React93__default.useCallback((zoneId2) => {
25520
+ const unregisterZone = React96__default.useCallback((zoneId2) => {
25414
25521
  zonesRef.current.delete(zoneId2);
25415
25522
  }, []);
25416
- const [activeDrag, setActiveDrag] = React93__default.useState(null);
25417
- const [overZoneGroup, setOverZoneGroup] = React93__default.useState(null);
25418
- const meta = React93__default.useMemo(
25523
+ const [activeDrag, setActiveDrag] = React96__default.useState(null);
25524
+ const [overZoneGroup, setOverZoneGroup] = React96__default.useState(null);
25525
+ const meta = React96__default.useMemo(
25419
25526
  () => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
25420
25527
  [ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
25421
25528
  );
25422
- React93__default.useEffect(() => {
25529
+ React96__default.useEffect(() => {
25423
25530
  const target = isRoot ? null : parentRoot;
25424
25531
  if (!target) {
25425
25532
  zonesRef.current.set(zoneId, meta);
@@ -25438,7 +25545,7 @@ function useDataDnd(args) {
25438
25545
  }, [parentRoot, isRoot, zoneId, meta]);
25439
25546
  const sensors = useAlmadarDndSensors(true);
25440
25547
  const collisionDetection = almadarDndCollisionDetection;
25441
- const findZoneByItem = React93__default.useCallback(
25548
+ const findZoneByItem = React96__default.useCallback(
25442
25549
  (id) => {
25443
25550
  for (const z of zonesRef.current.values()) {
25444
25551
  if (z.itemIds.includes(id)) return z;
@@ -25447,7 +25554,7 @@ function useDataDnd(args) {
25447
25554
  },
25448
25555
  []
25449
25556
  );
25450
- React93__default.useCallback(
25557
+ React96__default.useCallback(
25451
25558
  (group) => {
25452
25559
  for (const z of zonesRef.current.values()) {
25453
25560
  if (z.group === group) return z;
@@ -25456,7 +25563,7 @@ function useDataDnd(args) {
25456
25563
  },
25457
25564
  []
25458
25565
  );
25459
- const handleDragEnd = React93__default.useCallback(
25566
+ const handleDragEnd = React96__default.useCallback(
25460
25567
  (event) => {
25461
25568
  const { active, over } = event;
25462
25569
  const activeIdStr = String(active.id);
@@ -25547,8 +25654,8 @@ function useDataDnd(args) {
25547
25654
  },
25548
25655
  [eventBus]
25549
25656
  );
25550
- const sortableData = React93__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
25551
- const SortableItem = React93__default.useCallback(
25657
+ const sortableData = React96__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
25658
+ const SortableItem = React96__default.useCallback(
25552
25659
  ({ id, children }) => {
25553
25660
  const {
25554
25661
  attributes,
@@ -25588,7 +25695,7 @@ function useDataDnd(args) {
25588
25695
  id: droppableId,
25589
25696
  data: sortableData
25590
25697
  });
25591
- const ctx = React93__default.useContext(RootCtx);
25698
+ const ctx = React96__default.useContext(RootCtx);
25592
25699
  const activeDrag2 = ctx?.activeDrag ?? null;
25593
25700
  const overZoneGroup2 = ctx?.overZoneGroup ?? null;
25594
25701
  const isThisZoneOver = overZoneGroup2 === ownGroup;
@@ -25603,7 +25710,7 @@ function useDataDnd(args) {
25603
25710
  showForeignPlaceholder,
25604
25711
  ctxAvailable: ctx != null
25605
25712
  });
25606
- React93__default.useEffect(() => {
25713
+ React96__default.useEffect(() => {
25607
25714
  dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
25608
25715
  }, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
25609
25716
  return /* @__PURE__ */ jsx(
@@ -25617,11 +25724,11 @@ function useDataDnd(args) {
25617
25724
  }
25618
25725
  );
25619
25726
  };
25620
- const rootContextValue = React93__default.useMemo(
25727
+ const rootContextValue = React96__default.useMemo(
25621
25728
  () => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
25622
25729
  [registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
25623
25730
  );
25624
- const handleDragStart = React93__default.useCallback((event) => {
25731
+ const handleDragStart = React96__default.useCallback((event) => {
25625
25732
  const sourceZone = findZoneByItem(event.active.id);
25626
25733
  const rect = event.active.rect.current.initial;
25627
25734
  const height = rect?.height && rect.height > 0 ? rect.height : 64;
@@ -25640,7 +25747,7 @@ function useDataDnd(args) {
25640
25747
  isRoot
25641
25748
  });
25642
25749
  }, [findZoneByItem, isRoot, zoneId]);
25643
- const handleDragOver = React93__default.useCallback((event) => {
25750
+ const handleDragOver = React96__default.useCallback((event) => {
25644
25751
  const { active, over } = event;
25645
25752
  const overData = over?.data?.current;
25646
25753
  const overGroup = overData?.dndGroup ?? null;
@@ -25710,7 +25817,7 @@ function useDataDnd(args) {
25710
25817
  return next;
25711
25818
  });
25712
25819
  }, []);
25713
- const handleDragCancel = React93__default.useCallback((event) => {
25820
+ const handleDragCancel = React96__default.useCallback((event) => {
25714
25821
  setActiveDrag(null);
25715
25822
  setOverZoneGroup(null);
25716
25823
  dndLog.warn("dragCancel", {
@@ -25718,12 +25825,12 @@ function useDataDnd(args) {
25718
25825
  reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
25719
25826
  });
25720
25827
  }, []);
25721
- const handleDragEndWithCleanup = React93__default.useCallback((event) => {
25828
+ const handleDragEndWithCleanup = React96__default.useCallback((event) => {
25722
25829
  handleDragEnd(event);
25723
25830
  setActiveDrag(null);
25724
25831
  setOverZoneGroup(null);
25725
25832
  }, [handleDragEnd]);
25726
- const wrapContainer = React93__default.useCallback(
25833
+ const wrapContainer = React96__default.useCallback(
25727
25834
  (children) => {
25728
25835
  if (!enabled) return children;
25729
25836
  const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
@@ -25777,7 +25884,7 @@ var init_useDataDnd = __esm({
25777
25884
  init_useAlmadarDndCollision();
25778
25885
  init_Box();
25779
25886
  dndLog = createLogger("almadar:ui:dnd");
25780
- RootCtx = React93__default.createContext(null);
25887
+ RootCtx = React96__default.createContext(null);
25781
25888
  }
25782
25889
  });
25783
25890
  function fieldLabel2(key) {
@@ -26266,7 +26373,7 @@ function DataList({
26266
26373
  }) {
26267
26374
  const eventBus = useEventBus();
26268
26375
  const { t } = useTranslate();
26269
- const [visibleCount, setVisibleCount] = React93__default.useState(pageSize || Infinity);
26376
+ const [visibleCount, setVisibleCount] = React96__default.useState(pageSize || Infinity);
26270
26377
  const fieldDefs = fields ?? columns ?? [];
26271
26378
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
26272
26379
  const dnd = useDataDnd({
@@ -26285,7 +26392,7 @@ function DataList({
26285
26392
  const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
26286
26393
  const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
26287
26394
  const hasRenderProp = typeof children === "function";
26288
- React93__default.useEffect(() => {
26395
+ React96__default.useEffect(() => {
26289
26396
  const renderItemTypeOf = typeof schemaRenderItem;
26290
26397
  const childrenTypeOf = typeof children;
26291
26398
  if (data.length > 0 && !hasRenderProp) {
@@ -26342,7 +26449,7 @@ function DataList({
26342
26449
  const items2 = data.map((item) => item);
26343
26450
  const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
26344
26451
  const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
26345
- return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
26452
+ return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
26346
26453
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
26347
26454
  group.items.map((itemData, index) => {
26348
26455
  const id = itemData.id || `${gi}-${index}`;
@@ -26530,7 +26637,7 @@ function DataList({
26530
26637
  className
26531
26638
  ),
26532
26639
  children: [
26533
- groups.map((group, gi) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
26640
+ groups.map((group, gi) => /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
26534
26641
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
26535
26642
  group.items.map(
26536
26643
  (itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
@@ -27759,6 +27866,8 @@ var SidePanel;
27759
27866
  var init_SidePanel = __esm({
27760
27867
  "components/molecules/SidePanel.tsx"() {
27761
27868
  "use client";
27869
+ init_Aside();
27870
+ init_Box();
27762
27871
  init_Button();
27763
27872
  init_Typography();
27764
27873
  init_cn();
@@ -27768,7 +27877,7 @@ var init_SidePanel = __esm({
27768
27877
  children,
27769
27878
  isOpen,
27770
27879
  onClose,
27771
- width = "w-96",
27880
+ width = "w-full sm:w-96",
27772
27881
  position = "right",
27773
27882
  showOverlay = true,
27774
27883
  className,
@@ -27782,14 +27891,14 @@ var init_SidePanel = __esm({
27782
27891
  if (!isOpen) return null;
27783
27892
  return /* @__PURE__ */ jsxs(Fragment, { children: [
27784
27893
  showOverlay && /* @__PURE__ */ jsx(
27785
- "div",
27894
+ Box,
27786
27895
  {
27787
27896
  className: "fixed inset-0 bg-white/80 backdrop-blur-sm z-40 lg:hidden",
27788
27897
  onClick: handleClose
27789
27898
  }
27790
27899
  ),
27791
27900
  /* @__PURE__ */ jsxs(
27792
- "aside",
27901
+ Aside,
27793
27902
  {
27794
27903
  className: cn(
27795
27904
  "fixed top-16 lg:top-0 bottom-0 z-[60]",
@@ -27803,7 +27912,7 @@ var init_SidePanel = __esm({
27803
27912
  className
27804
27913
  ),
27805
27914
  children: [
27806
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between p-4 border-b-2 border-border sticky top-0 bg-card z-10", children: [
27915
+ /* @__PURE__ */ jsxs(Box, { className: "flex items-center justify-between p-4 border-b-2 border-border sticky top-0 bg-card z-10", children: [
27807
27916
  /* @__PURE__ */ jsx(Typography, { variant: "h6", children: title }),
27808
27917
  /* @__PURE__ */ jsx(
27809
27918
  Button,
@@ -27813,11 +27922,11 @@ var init_SidePanel = __esm({
27813
27922
  icon: X,
27814
27923
  onClick: handleClose,
27815
27924
  "aria-label": "Close panel",
27816
- children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
27925
+ children: /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", className: "sr-only", children: "Close" })
27817
27926
  }
27818
27927
  )
27819
27928
  ] }),
27820
- /* @__PURE__ */ jsx("div", { className: "p-4 flex-1 overflow-y-auto", children })
27929
+ /* @__PURE__ */ jsx(Box, { className: "p-4 flex-1 overflow-y-auto", children })
27821
27930
  ]
27822
27931
  }
27823
27932
  )
@@ -27868,7 +27977,7 @@ var init_WizardProgress = __esm({
27868
27977
  children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
27869
27978
  const isActive = index === currentStep;
27870
27979
  const isCompleted = index < currentStep;
27871
- return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
27980
+ return /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
27872
27981
  /* @__PURE__ */ jsx(
27873
27982
  "button",
27874
27983
  {
@@ -27993,7 +28102,9 @@ var init_WizardNavigation = __esm({
27993
28102
  {
27994
28103
  border: true,
27995
28104
  className: cn(
27996
- "border-t-2 border-x-0 border-b-0 border-border flex justify-between items-center",
28105
+ // `flex-wrap gap-2` lets the Back / Step / Next trio reflow on
28106
+ // narrow viewports rather than crushing the step counter.
28107
+ "border-t-2 border-x-0 border-b-0 border-border flex flex-wrap gap-2 justify-between items-center",
27997
28108
  compact ? "px-4 py-2" : "px-6 py-4",
27998
28109
  className
27999
28110
  ),
@@ -28924,7 +29035,7 @@ function InventoryGrid({
28924
29035
  const eventBus = useEventBus();
28925
29036
  const slotCount = totalSlots ?? items.length;
28926
29037
  const emptySlotCount = Math.max(0, slotCount - items.length);
28927
- const handleSelect = React93.useCallback(
29038
+ const handleSelect = React96.useCallback(
28928
29039
  (id) => {
28929
29040
  onSelect?.(id);
28930
29041
  if (selectEvent) {
@@ -29137,15 +29248,15 @@ function GameCanvas2D({
29137
29248
  fps = 60,
29138
29249
  className
29139
29250
  }) {
29140
- const canvasRef = React93.useRef(null);
29141
- const rafRef = React93.useRef(0);
29142
- const frameRef = React93.useRef(0);
29143
- const lastTimeRef = React93.useRef(0);
29144
- const onDrawRef = React93.useRef(onDraw);
29251
+ const canvasRef = React96.useRef(null);
29252
+ const rafRef = React96.useRef(0);
29253
+ const frameRef = React96.useRef(0);
29254
+ const lastTimeRef = React96.useRef(0);
29255
+ const onDrawRef = React96.useRef(onDraw);
29145
29256
  onDrawRef.current = onDraw;
29146
- const onTickRef = React93.useRef(onTick);
29257
+ const onTickRef = React96.useRef(onTick);
29147
29258
  onTickRef.current = onTick;
29148
- React93.useEffect(() => {
29259
+ React96.useEffect(() => {
29149
29260
  const canvas = canvasRef.current;
29150
29261
  if (!canvas) return;
29151
29262
  const ctx = canvas.getContext("2d");
@@ -29434,7 +29545,7 @@ function TurnPanel({
29434
29545
  className
29435
29546
  }) {
29436
29547
  const eventBus = useEventBus();
29437
- const handleAction = React93.useCallback(
29548
+ const handleAction = React96.useCallback(
29438
29549
  (event) => {
29439
29550
  if (event) {
29440
29551
  eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
@@ -29580,7 +29691,7 @@ function UnitCommandBar({
29580
29691
  className
29581
29692
  }) {
29582
29693
  const eventBus = useEventBus();
29583
- const handleCommand = React93.useCallback(
29694
+ const handleCommand = React96.useCallback(
29584
29695
  (event) => {
29585
29696
  if (event) {
29586
29697
  eventBus.emit(event, { unitId: selectedUnitId });
@@ -30065,7 +30176,7 @@ function GameMenu({
30065
30176
  } catch {
30066
30177
  }
30067
30178
  const eventBus = eventBusProp || eventBusFromHook;
30068
- const handleOptionClick = React93.useCallback(
30179
+ const handleOptionClick = React96.useCallback(
30069
30180
  (option) => {
30070
30181
  if (option.event && eventBus) {
30071
30182
  eventBus.emit(`UI:${option.event}`, { option });
@@ -30179,7 +30290,7 @@ function GameOverScreen({
30179
30290
  } catch {
30180
30291
  }
30181
30292
  const eventBus = eventBusProp || eventBusFromHook;
30182
- const handleActionClick = React93.useCallback(
30293
+ const handleActionClick = React96.useCallback(
30183
30294
  (action) => {
30184
30295
  if (action.event && eventBus) {
30185
30296
  eventBus.emit(`UI:${action.event}`, { action });
@@ -32838,7 +32949,7 @@ var init_StepFlow = __esm({
32838
32949
  className
32839
32950
  }) => {
32840
32951
  if (orientation === "vertical") {
32841
- return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React93__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
32952
+ return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React96__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
32842
32953
  /* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
32843
32954
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
32844
32955
  showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
@@ -32849,7 +32960,7 @@ var init_StepFlow = __esm({
32849
32960
  ] })
32850
32961
  ] }) }, index)) });
32851
32962
  }
32852
- 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(React93__default.Fragment, { children: [
32963
+ 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(React96__default.Fragment, { children: [
32853
32964
  /* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
32854
32965
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
32855
32966
  /* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
@@ -32917,9 +33028,9 @@ var init_SplitSection = __esm({
32917
33028
  className
32918
33029
  ),
32919
33030
  padding: "lg",
32920
- children: /* @__PURE__ */ jsxs(Box, { className: cn("w-full flex flex-col lg:flex-row gap-10 lg:gap-16 items-center", isImageLeft && "lg:flex-row-reverse"), children: [
32921
- /* @__PURE__ */ jsx(Box, { className: "flex-1 min-w-0 lg:min-w-[45%]", children: textContent }),
32922
- /* @__PURE__ */ jsx(Box, { className: "flex-1 min-w-0 lg:max-w-[50%]", children: mediaContent })
33031
+ children: /* @__PURE__ */ jsxs(Box, { className: cn("w-full flex flex-col md:flex-row gap-8 md:gap-12 lg:gap-16 items-center", isImageLeft && "md:flex-row-reverse"), children: [
33032
+ /* @__PURE__ */ jsx(Box, { className: "flex-1 min-w-0 md:min-w-[45%]", children: textContent }),
33033
+ /* @__PURE__ */ jsx(Box, { className: "flex-1 min-w-0 md:max-w-[50%]", children: mediaContent })
32923
33034
  ] })
32924
33035
  }
32925
33036
  );
@@ -33731,7 +33842,7 @@ var init_LikertScale = __esm({
33731
33842
  md: "text-base",
33732
33843
  lg: "text-lg"
33733
33844
  };
33734
- LikertScale = React93__default.forwardRef(
33845
+ LikertScale = React96__default.forwardRef(
33735
33846
  ({
33736
33847
  question,
33737
33848
  options = DEFAULT_LIKERT_OPTIONS,
@@ -33743,7 +33854,7 @@ var init_LikertScale = __esm({
33743
33854
  variant = "radios",
33744
33855
  className
33745
33856
  }, ref) => {
33746
- const groupId = React93__default.useId();
33857
+ const groupId = React96__default.useId();
33747
33858
  const eventBus = useEventBus();
33748
33859
  const handleSelect = useCallback(
33749
33860
  (next) => {
@@ -35747,7 +35858,7 @@ var init_VersionDiff = __esm({
35747
35858
  /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "center", className: "flex-wrap", children: [
35748
35859
  /* @__PURE__ */ jsx(Icon, { icon: GitCommit, size: "sm", className: "text-muted-foreground" }),
35749
35860
  /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "whitespace-nowrap", children: "Compare" }),
35750
- /* @__PURE__ */ jsx(Box, { className: "min-w-[160px]", children: /* @__PURE__ */ jsx(
35861
+ /* @__PURE__ */ jsx(Box, { className: "min-w-0 md:min-w-[160px]", children: /* @__PURE__ */ jsx(
35751
35862
  Select,
35752
35863
  {
35753
35864
  options,
@@ -35757,7 +35868,7 @@ var init_VersionDiff = __esm({
35757
35868
  }
35758
35869
  ) }),
35759
35870
  /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: "to" }),
35760
- /* @__PURE__ */ jsx(Box, { className: "min-w-[160px]", children: /* @__PURE__ */ jsx(
35871
+ /* @__PURE__ */ jsx(Box, { className: "min-w-0 md:min-w-[160px]", children: /* @__PURE__ */ jsx(
35761
35872
  Select,
35762
35873
  {
35763
35874
  options,
@@ -35822,8 +35933,8 @@ var init_VersionDiff = __esm({
35822
35933
  ]
35823
35934
  }
35824
35935
  ),
35825
- /* @__PURE__ */ jsx(Box, { className: "overflow-auto bg-muted/20", style: { maxHeight: 600 }, children: activeView === "side-by-side" ? /* @__PURE__ */ jsxs(Box, { className: "grid grid-cols-2", children: [
35826
- /* @__PURE__ */ jsx(Box, { className: "border-r border-border", children: /* @__PURE__ */ jsx(VStack, { gap: "none", className: "font-mono text-xs", children: beforeLines.map((line, idx) => {
35936
+ /* @__PURE__ */ jsx(Box, { className: "overflow-auto bg-muted/20", style: { maxHeight: 600 }, children: activeView === "side-by-side" ? /* @__PURE__ */ jsxs(Box, { className: "grid grid-cols-1 md:grid-cols-2", children: [
35937
+ /* @__PURE__ */ jsx(Box, { className: "border-b md:border-b-0 md:border-r border-border", children: /* @__PURE__ */ jsx(VStack, { gap: "none", className: "font-mono text-xs", children: beforeLines.map((line, idx) => {
35827
35938
  const isRemoved = line.type === "removed";
35828
35939
  return /* @__PURE__ */ jsxs(
35829
35940
  HStack,
@@ -35969,7 +36080,7 @@ var init_DocBreadcrumb = __esm({
35969
36080
  "aria-label": "Breadcrumb",
35970
36081
  children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
35971
36082
  const isLast = idx === items.length - 1;
35972
- return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
36083
+ return /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
35973
36084
  idx > 0 && /* @__PURE__ */ jsx(
35974
36085
  Icon,
35975
36086
  {
@@ -37833,7 +37944,7 @@ var init_DocumentViewer = __esm({
37833
37944
  }
37834
37945
  });
37835
37946
  function extractTitle(children) {
37836
- if (!React93__default.isValidElement(children)) return void 0;
37947
+ if (!React96__default.isValidElement(children)) return void 0;
37837
37948
  const props = children.props;
37838
37949
  if (typeof props.title === "string") {
37839
37950
  return props.title;
@@ -37888,7 +37999,7 @@ function LinearView({
37888
37999
  /* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
37889
38000
  const isDone = i < currentIdx;
37890
38001
  const isCurrent = i === currentIdx;
37891
- return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
38002
+ return /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
37892
38003
  i > 0 && /* @__PURE__ */ jsx(
37893
38004
  Typography,
37894
38005
  {
@@ -38789,12 +38900,12 @@ var init_Form = __esm({
38789
38900
  const isSchemaEntity = isOrbitalEntitySchema(entity);
38790
38901
  const resolvedEntity = isSchemaEntity ? entity : void 0;
38791
38902
  const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
38792
- const normalizedInitialData = React93__default.useMemo(() => {
38903
+ const normalizedInitialData = React96__default.useMemo(() => {
38793
38904
  const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
38794
38905
  const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
38795
38906
  return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
38796
38907
  }, [entity, initialData]);
38797
- const entityDerivedFields = React93__default.useMemo(() => {
38908
+ const entityDerivedFields = React96__default.useMemo(() => {
38798
38909
  if (fields && fields.length > 0) return void 0;
38799
38910
  if (!resolvedEntity) return void 0;
38800
38911
  return resolvedEntity.fields.map(
@@ -38813,16 +38924,16 @@ var init_Form = __esm({
38813
38924
  const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
38814
38925
  const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
38815
38926
  const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
38816
- const [formData, setFormData] = React93__default.useState(
38927
+ const [formData, setFormData] = React96__default.useState(
38817
38928
  normalizedInitialData
38818
38929
  );
38819
- const [collapsedSections, setCollapsedSections] = React93__default.useState(
38930
+ const [collapsedSections, setCollapsedSections] = React96__default.useState(
38820
38931
  /* @__PURE__ */ new Set()
38821
38932
  );
38822
- const [submitError, setSubmitError] = React93__default.useState(null);
38823
- const formRef = React93__default.useRef(null);
38933
+ const [submitError, setSubmitError] = React96__default.useState(null);
38934
+ const formRef = React96__default.useRef(null);
38824
38935
  const formMode = props.mode;
38825
- const mountedRef = React93__default.useRef(false);
38936
+ const mountedRef = React96__default.useRef(false);
38826
38937
  if (!mountedRef.current) {
38827
38938
  mountedRef.current = true;
38828
38939
  debug("forms", "mount", {
@@ -38835,7 +38946,7 @@ var init_Form = __esm({
38835
38946
  });
38836
38947
  }
38837
38948
  const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
38838
- const evalContext = React93__default.useMemo(
38949
+ const evalContext = React96__default.useMemo(
38839
38950
  () => ({
38840
38951
  formValues: formData,
38841
38952
  globalVariables: externalContext?.globalVariables ?? {},
@@ -38844,7 +38955,7 @@ var init_Form = __esm({
38844
38955
  }),
38845
38956
  [formData, externalContext]
38846
38957
  );
38847
- React93__default.useEffect(() => {
38958
+ React96__default.useEffect(() => {
38848
38959
  debug("forms", "initialData-sync", {
38849
38960
  mode: formMode,
38850
38961
  normalizedInitialData,
@@ -38855,7 +38966,7 @@ var init_Form = __esm({
38855
38966
  setFormData(normalizedInitialData);
38856
38967
  }
38857
38968
  }, [normalizedInitialData]);
38858
- const processCalculations = React93__default.useCallback(
38969
+ const processCalculations = React96__default.useCallback(
38859
38970
  (changedFieldId, newFormData) => {
38860
38971
  if (!hiddenCalculations.length) return;
38861
38972
  const context = {
@@ -38880,7 +38991,7 @@ var init_Form = __esm({
38880
38991
  },
38881
38992
  [hiddenCalculations, externalContext, eventBus]
38882
38993
  );
38883
- const checkViolations = React93__default.useCallback(
38994
+ const checkViolations = React96__default.useCallback(
38884
38995
  (changedFieldId, newFormData) => {
38885
38996
  if (!violationTriggers.length) return;
38886
38997
  const context = {
@@ -38918,7 +39029,7 @@ var init_Form = __esm({
38918
39029
  processCalculations(name, newFormData);
38919
39030
  checkViolations(name, newFormData);
38920
39031
  };
38921
- const isFieldVisible = React93__default.useCallback(
39032
+ const isFieldVisible = React96__default.useCallback(
38922
39033
  (fieldName) => {
38923
39034
  const condition = conditionalFields[fieldName];
38924
39035
  if (!condition) return true;
@@ -38926,7 +39037,7 @@ var init_Form = __esm({
38926
39037
  },
38927
39038
  [conditionalFields, evalContext]
38928
39039
  );
38929
- const isSectionVisible = React93__default.useCallback(
39040
+ const isSectionVisible = React96__default.useCallback(
38930
39041
  (section) => {
38931
39042
  if (!section.condition) return true;
38932
39043
  return Boolean(evaluateFormExpression(section.condition, evalContext));
@@ -39002,7 +39113,7 @@ var init_Form = __esm({
39002
39113
  eventBus.emit(`UI:${onCancel}`);
39003
39114
  }
39004
39115
  };
39005
- const renderField = React93__default.useCallback(
39116
+ const renderField = React96__default.useCallback(
39006
39117
  (field) => {
39007
39118
  const fieldName = field.name || field.field;
39008
39119
  if (!fieldName) return null;
@@ -39023,7 +39134,7 @@ var init_Form = __esm({
39023
39134
  [formData, isFieldVisible, relationsData, relationsLoading, isLoading]
39024
39135
  );
39025
39136
  const effectiveFields = entityDerivedFields ?? fields;
39026
- const normalizedFields = React93__default.useMemo(() => {
39137
+ const normalizedFields = React96__default.useMemo(() => {
39027
39138
  if (!effectiveFields || effectiveFields.length === 0) return [];
39028
39139
  return effectiveFields.map((field) => {
39029
39140
  if (typeof field === "string") {
@@ -39045,7 +39156,7 @@ var init_Form = __esm({
39045
39156
  return field;
39046
39157
  });
39047
39158
  }, [effectiveFields, resolvedEntity]);
39048
- const schemaFields = React93__default.useMemo(() => {
39159
+ const schemaFields = React96__default.useMemo(() => {
39049
39160
  if (normalizedFields.length === 0) return null;
39050
39161
  if (isDebugEnabled()) {
39051
39162
  debugGroup(`Form: ${entityName || "unknown"}`);
@@ -39055,7 +39166,7 @@ var init_Form = __esm({
39055
39166
  }
39056
39167
  return normalizedFields.map(renderField).filter(Boolean);
39057
39168
  }, [normalizedFields, renderField, entityName, conditionalFields]);
39058
- const sectionElements = React93__default.useMemo(() => {
39169
+ const sectionElements = React96__default.useMemo(() => {
39059
39170
  if (!sections || sections.length === 0) return null;
39060
39171
  return sections.map((section) => {
39061
39172
  if (!isSectionVisible(section)) {
@@ -40781,7 +40892,7 @@ var init_List = __esm({
40781
40892
  if (entity && typeof entity === "object" && "id" in entity) return [entity];
40782
40893
  return [];
40783
40894
  }, [entity]);
40784
- const getItemActions = React93__default.useCallback(
40895
+ const getItemActions = React96__default.useCallback(
40785
40896
  (item) => {
40786
40897
  if (!itemActions) return [];
40787
40898
  if (typeof itemActions === "function") {
@@ -41254,7 +41365,7 @@ var init_MediaGallery = __esm({
41254
41365
  [selectable, selectedItems, selectionEvent, eventBus]
41255
41366
  );
41256
41367
  const entityData = Array.isArray(entity) ? entity : [];
41257
- const items = React93__default.useMemo(() => {
41368
+ const items = React96__default.useMemo(() => {
41258
41369
  if (propItems) return propItems;
41259
41370
  if (entityData.length === 0) return [];
41260
41371
  return entityData.map((record, idx) => ({
@@ -41418,7 +41529,7 @@ var init_MediaGallery = __esm({
41418
41529
  }
41419
41530
  });
41420
41531
  function extractTitle2(children) {
41421
- if (!React93__default.isValidElement(children)) return void 0;
41532
+ if (!React96__default.isValidElement(children)) return void 0;
41422
41533
  const props = children.props;
41423
41534
  if (typeof props.title === "string") {
41424
41535
  return props.title;
@@ -42131,7 +42242,7 @@ var init_PageHeader = __esm({
42131
42242
  info: "bg-info/10 text-info"
42132
42243
  };
42133
42244
  return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
42134
- 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(React93__default.Fragment, { children: [
42245
+ 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(React96__default.Fragment, { children: [
42135
42246
  idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
42136
42247
  crumb.href ? /* @__PURE__ */ jsx(
42137
42248
  "a",
@@ -42446,7 +42557,7 @@ var init_debugRegistry = __esm({
42446
42557
  }
42447
42558
  });
42448
42559
  function useDebugData() {
42449
- const [data, setData] = React93.useState(() => ({
42560
+ const [data, setData] = React96.useState(() => ({
42450
42561
  traits: [],
42451
42562
  ticks: [],
42452
42563
  guards: [],
@@ -42460,7 +42571,7 @@ function useDebugData() {
42460
42571
  },
42461
42572
  lastUpdate: Date.now()
42462
42573
  }));
42463
- React93.useEffect(() => {
42574
+ React96.useEffect(() => {
42464
42575
  const updateData = () => {
42465
42576
  setData({
42466
42577
  traits: getAllTraits(),
@@ -42569,12 +42680,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
42569
42680
  return positions;
42570
42681
  }
42571
42682
  function WalkMinimap() {
42572
- const [walkStep, setWalkStep] = React93.useState(null);
42573
- const [traits2, setTraits] = React93.useState([]);
42574
- const [coveredEdges, setCoveredEdges] = React93.useState([]);
42575
- const [completedTraits, setCompletedTraits] = React93.useState(/* @__PURE__ */ new Set());
42576
- const prevTraitRef = React93.useRef(null);
42577
- React93.useEffect(() => {
42683
+ const [walkStep, setWalkStep] = React96.useState(null);
42684
+ const [traits2, setTraits] = React96.useState([]);
42685
+ const [coveredEdges, setCoveredEdges] = React96.useState([]);
42686
+ const [completedTraits, setCompletedTraits] = React96.useState(/* @__PURE__ */ new Set());
42687
+ const prevTraitRef = React96.useRef(null);
42688
+ React96.useEffect(() => {
42578
42689
  const interval = setInterval(() => {
42579
42690
  const w = window;
42580
42691
  const step = w.__orbitalWalkStep;
@@ -43021,15 +43132,15 @@ var init_EntitiesTab = __esm({
43021
43132
  }
43022
43133
  });
43023
43134
  function EventFlowTab({ events: events2 }) {
43024
- const [filter, setFilter] = React93.useState("all");
43025
- const containerRef = React93.useRef(null);
43026
- const [autoScroll, setAutoScroll] = React93.useState(true);
43027
- React93.useEffect(() => {
43135
+ const [filter, setFilter] = React96.useState("all");
43136
+ const containerRef = React96.useRef(null);
43137
+ const [autoScroll, setAutoScroll] = React96.useState(true);
43138
+ React96.useEffect(() => {
43028
43139
  if (autoScroll && containerRef.current) {
43029
43140
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
43030
43141
  }
43031
43142
  }, [events2.length, autoScroll]);
43032
- const filteredEvents = React93.useMemo(() => {
43143
+ const filteredEvents = React96.useMemo(() => {
43033
43144
  if (filter === "all") return events2;
43034
43145
  return events2.filter((e) => e.type === filter);
43035
43146
  }, [events2, filter]);
@@ -43148,7 +43259,7 @@ var init_EventFlowTab = __esm({
43148
43259
  }
43149
43260
  });
43150
43261
  function GuardsPanel({ guards }) {
43151
- const [filter, setFilter] = React93.useState("all");
43262
+ const [filter, setFilter] = React96.useState("all");
43152
43263
  if (guards.length === 0) {
43153
43264
  return /* @__PURE__ */ jsx(
43154
43265
  EmptyState,
@@ -43161,7 +43272,7 @@ function GuardsPanel({ guards }) {
43161
43272
  }
43162
43273
  const passedCount = guards.filter((g) => g.result).length;
43163
43274
  const failedCount = guards.length - passedCount;
43164
- const filteredGuards = React93.useMemo(() => {
43275
+ const filteredGuards = React96.useMemo(() => {
43165
43276
  if (filter === "all") return guards;
43166
43277
  if (filter === "passed") return guards.filter((g) => g.result);
43167
43278
  return guards.filter((g) => !g.result);
@@ -43322,10 +43433,10 @@ function EffectBadge({ effect }) {
43322
43433
  ] });
43323
43434
  }
43324
43435
  function TransitionTimeline({ transitions }) {
43325
- const containerRef = React93.useRef(null);
43326
- const [autoScroll, setAutoScroll] = React93.useState(true);
43327
- const [expandedId, setExpandedId] = React93.useState(null);
43328
- React93.useEffect(() => {
43436
+ const containerRef = React96.useRef(null);
43437
+ const [autoScroll, setAutoScroll] = React96.useState(true);
43438
+ const [expandedId, setExpandedId] = React96.useState(null);
43439
+ React96.useEffect(() => {
43329
43440
  if (autoScroll && containerRef.current) {
43330
43441
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
43331
43442
  }
@@ -43611,9 +43722,9 @@ function getAllEvents(traits2) {
43611
43722
  }
43612
43723
  function EventDispatcherTab({ traits: traits2, schema }) {
43613
43724
  const eventBus = useEventBus();
43614
- const [log20, setLog] = React93.useState([]);
43615
- const prevStatesRef = React93.useRef(/* @__PURE__ */ new Map());
43616
- React93.useEffect(() => {
43725
+ const [log20, setLog] = React96.useState([]);
43726
+ const prevStatesRef = React96.useRef(/* @__PURE__ */ new Map());
43727
+ React96.useEffect(() => {
43617
43728
  for (const trait of traits2) {
43618
43729
  const prev = prevStatesRef.current.get(trait.id);
43619
43730
  if (prev && prev !== trait.currentState) {
@@ -43783,10 +43894,10 @@ function VerifyModePanel({
43783
43894
  serverCount,
43784
43895
  localCount
43785
43896
  }) {
43786
- const [expanded, setExpanded] = React93.useState(true);
43787
- const scrollRef = React93.useRef(null);
43788
- const prevCountRef = React93.useRef(0);
43789
- React93.useEffect(() => {
43897
+ const [expanded, setExpanded] = React96.useState(true);
43898
+ const scrollRef = React96.useRef(null);
43899
+ const prevCountRef = React96.useRef(0);
43900
+ React96.useEffect(() => {
43790
43901
  if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
43791
43902
  scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
43792
43903
  }
@@ -43852,10 +43963,10 @@ function RuntimeDebugger({
43852
43963
  defaultTab,
43853
43964
  schema
43854
43965
  }) {
43855
- const [isCollapsed, setIsCollapsed] = React93.useState(mode === "verify" ? true : defaultCollapsed);
43856
- const [isVisible, setIsVisible] = React93.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
43966
+ const [isCollapsed, setIsCollapsed] = React96.useState(mode === "verify" ? true : defaultCollapsed);
43967
+ const [isVisible, setIsVisible] = React96.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
43857
43968
  const debugData = useDebugData();
43858
- React93.useEffect(() => {
43969
+ React96.useEffect(() => {
43859
43970
  if (mode === "inline") return;
43860
43971
  return onDebugToggle((enabled) => {
43861
43972
  setIsVisible(enabled);
@@ -43864,7 +43975,7 @@ function RuntimeDebugger({
43864
43975
  }
43865
43976
  });
43866
43977
  }, [mode]);
43867
- React93.useEffect(() => {
43978
+ React96.useEffect(() => {
43868
43979
  if (mode === "inline") return;
43869
43980
  const handleKeyDown = (e) => {
43870
43981
  if (e.key === "`" && isVisible) {
@@ -44413,7 +44524,7 @@ function SequenceBar({
44413
44524
  onSlotRemove(index);
44414
44525
  }, [onSlotRemove, playing]);
44415
44526
  const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
44416
- return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
44527
+ return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
44417
44528
  i > 0 && /* @__PURE__ */ jsx(
44418
44529
  Typography,
44419
44530
  {
@@ -45815,7 +45926,7 @@ var init_StatCard = __esm({
45815
45926
  const labelToUse = propLabel ?? propTitle;
45816
45927
  const eventBus = useEventBus();
45817
45928
  const { t } = useTranslate();
45818
- const handleActionClick = React93__default.useCallback(() => {
45929
+ const handleActionClick = React96__default.useCallback(() => {
45819
45930
  if (action?.event) {
45820
45931
  eventBus.emit(`UI:${action.event}`, {});
45821
45932
  }
@@ -45826,7 +45937,7 @@ var init_StatCard = __esm({
45826
45937
  const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
45827
45938
  const isLoading = externalLoading ?? false;
45828
45939
  const error = externalError;
45829
- const computeMetricValue = React93__default.useCallback(
45940
+ const computeMetricValue = React96__default.useCallback(
45830
45941
  (metric, items) => {
45831
45942
  if (metric.value !== void 0) {
45832
45943
  return metric.value;
@@ -45865,7 +45976,7 @@ var init_StatCard = __esm({
45865
45976
  },
45866
45977
  []
45867
45978
  );
45868
- const schemaStats = React93__default.useMemo(() => {
45979
+ const schemaStats = React96__default.useMemo(() => {
45869
45980
  if (!metrics || metrics.length === 0) return null;
45870
45981
  return metrics.map((metric) => ({
45871
45982
  label: metric.label,
@@ -45873,7 +45984,7 @@ var init_StatCard = __esm({
45873
45984
  format: metric.format
45874
45985
  }));
45875
45986
  }, [metrics, data, computeMetricValue]);
45876
- const calculatedTrend = React93__default.useMemo(() => {
45987
+ const calculatedTrend = React96__default.useMemo(() => {
45877
45988
  if (manualTrend !== void 0) return manualTrend;
45878
45989
  if (previousValue === void 0 || currentValue === void 0)
45879
45990
  return void 0;
@@ -46984,7 +47095,7 @@ var init_Timeline = __esm({
46984
47095
  }) => {
46985
47096
  const { t } = useTranslate();
46986
47097
  const entityData = Array.isArray(entity) ? entity : [];
46987
- const items = React93__default.useMemo(() => {
47098
+ const items = React96__default.useMemo(() => {
46988
47099
  if (propItems) return propItems;
46989
47100
  if (entityData.length === 0) return [];
46990
47101
  return entityData.map((record, idx) => {
@@ -47091,7 +47202,7 @@ var init_Timeline = __esm({
47091
47202
  }
47092
47203
  });
47093
47204
  function extractToastProps(children) {
47094
- if (!React93__default.isValidElement(children)) {
47205
+ if (!React96__default.isValidElement(children)) {
47095
47206
  if (typeof children === "string") {
47096
47207
  return { message: children };
47097
47208
  }
@@ -47129,7 +47240,7 @@ var init_ToastSlot = __esm({
47129
47240
  eventBus.emit("UI:CLOSE");
47130
47241
  };
47131
47242
  if (!isVisible) return null;
47132
- const isCustomContent = React93__default.isValidElement(children) && !message;
47243
+ const isCustomContent = React96__default.isValidElement(children) && !message;
47133
47244
  return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
47134
47245
  Toast,
47135
47246
  {
@@ -47398,7 +47509,7 @@ var init_WizardContainer = __esm({
47398
47509
  const isCompleted = index < currentStep;
47399
47510
  const stepKey = step.id ?? step.tabId ?? `step-${index}`;
47400
47511
  const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
47401
- return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
47512
+ return /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
47402
47513
  /* @__PURE__ */ jsx(
47403
47514
  Button,
47404
47515
  {
@@ -49591,7 +49702,7 @@ function UnitRenderer({
49591
49702
  onAnimationStateChange,
49592
49703
  animationSpeed = 1
49593
49704
  }) {
49594
- const handleUnitClick = React93__default.useCallback(
49705
+ const handleUnitClick = React96__default.useCallback(
49595
49706
  (unit) => {
49596
49707
  onUnitClick?.(unit);
49597
49708
  },
@@ -52787,7 +52898,7 @@ var init_Avl3DViewer = __esm({
52787
52898
  const handleTraitClick = useCallback((name) => {
52788
52899
  dispatch({ type: "ZOOM_INTO_TRAIT", trait: name, targetPosition: { x: 0, y: 0 } });
52789
52900
  }, []);
52790
- const [highlightedTrait, setHighlightedTrait] = React93__default.useState(null);
52901
+ const [highlightedTrait, setHighlightedTrait] = React96__default.useState(null);
52791
52902
  const handleTransitionClick = useCallback((index) => {
52792
52903
  dispatch({ type: "ZOOM_INTO_TRANSITION", transitionIndex: index, targetPosition: { x: 0, y: 0 } });
52793
52904
  }, []);
@@ -52874,7 +52985,7 @@ var init_Avl3DViewer = __esm({
52874
52985
  gap: "xs",
52875
52986
  align: "center",
52876
52987
  className: "absolute top-2 left-2 z-10 bg-surface/80 backdrop-blur rounded-md px-3 py-1.5",
52877
- children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
52988
+ children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
52878
52989
  i > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", className: "mx-1", children: "/" }),
52879
52990
  i < breadcrumbs.length - 1 ? /* @__PURE__ */ jsx(
52880
52991
  Box,
@@ -53252,12 +53363,12 @@ var init_three = __esm({
53252
53363
  }
53253
53364
  });
53254
53365
  function lazyThree(name, loader) {
53255
- const Lazy = React93__default.lazy(() => loader().then((m) => ({ default: m[name] })));
53366
+ const Lazy = React96__default.lazy(() => loader().then((m) => ({ default: m[name] })));
53256
53367
  function ThreeWrapper(props) {
53257
- return React93__default.createElement(
53258
- React93__default.Suspense,
53368
+ return React96__default.createElement(
53369
+ React96__default.Suspense,
53259
53370
  { fallback: null },
53260
- React93__default.createElement(Lazy, props)
53371
+ React96__default.createElement(Lazy, props)
53261
53372
  );
53262
53373
  }
53263
53374
  ThreeWrapper.displayName = `Lazy(${name})`;
@@ -53276,6 +53387,7 @@ var init_component_registry_generated = __esm({
53276
53387
  init_AnimatedGraphic();
53277
53388
  init_AnimatedReveal();
53278
53389
  init_ArticleSection();
53390
+ init_Aside();
53279
53391
  init_AuthLayout();
53280
53392
  init_BattleBoard();
53281
53393
  init_BattleTemplate();
@@ -53330,6 +53442,7 @@ var init_component_registry_generated = __esm({
53330
53442
  init_DayCell();
53331
53443
  init_DebuggerBoard();
53332
53444
  init_DetailPanel();
53445
+ init_Dialog();
53333
53446
  init_DialogueBox();
53334
53447
  init_DialogueBubble();
53335
53448
  init_DocBreadcrumb();
@@ -53543,6 +53656,7 @@ var init_component_registry_generated = __esm({
53543
53656
  "AnimatedGraphic": AnimatedGraphic,
53544
53657
  "AnimatedReveal": AnimatedReveal,
53545
53658
  "ArticleSection": ArticleSection,
53659
+ "Aside": Aside,
53546
53660
  "AuthLayout": AuthLayout,
53547
53661
  "Avatar": AvatarPattern,
53548
53662
  "AvatarPattern": AvatarPattern,
@@ -53612,6 +53726,7 @@ var init_component_registry_generated = __esm({
53612
53726
  "DayCell": DayCell,
53613
53727
  "DebuggerBoard": DebuggerBoard,
53614
53728
  "DetailPanel": DetailPanel,
53729
+ "Dialog": Dialog,
53615
53730
  "DialogueBox": DialogueBox,
53616
53731
  "DialogueBubble": DialogueBubble,
53617
53732
  "Divider": DividerPattern,
@@ -53865,7 +53980,7 @@ function SuspenseConfigProvider({
53865
53980
  config,
53866
53981
  children
53867
53982
  }) {
53868
- return React93__default.createElement(
53983
+ return React96__default.createElement(
53869
53984
  SuspenseConfigContext.Provider,
53870
53985
  { value: config },
53871
53986
  children
@@ -54348,7 +54463,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
54348
54463
  const key = `${parentId}-${index}-trait:${traitName}`;
54349
54464
  return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
54350
54465
  }
54351
- return /* @__PURE__ */ jsx(React93__default.Fragment, { children: child }, `${parentId}-${index}`);
54466
+ return /* @__PURE__ */ jsx(React96__default.Fragment, { children: child }, `${parentId}-${index}`);
54352
54467
  }
54353
54468
  if (!child || typeof child !== "object") return null;
54354
54469
  const childId = `${parentId}-${index}`;
@@ -54385,14 +54500,14 @@ function isPatternConfig(value) {
54385
54500
  if (value === null || value === void 0) return false;
54386
54501
  if (typeof value !== "object") return false;
54387
54502
  if (Array.isArray(value)) return false;
54388
- if (React93__default.isValidElement(value)) return false;
54503
+ if (React96__default.isValidElement(value)) return false;
54389
54504
  if (value instanceof Date) return false;
54390
54505
  if (typeof value === "function") return false;
54391
54506
  const record = value;
54392
54507
  return "type" in record && typeof record.type === "string";
54393
54508
  }
54394
54509
  function isPlainConfigObject(value) {
54395
- if (React93__default.isValidElement(value)) return false;
54510
+ if (React96__default.isValidElement(value)) return false;
54396
54511
  if (value instanceof Date) return false;
54397
54512
  const proto = Object.getPrototypeOf(value);
54398
54513
  return proto === Object.prototype || proto === null;
@@ -54847,7 +54962,7 @@ var AvlTransition = ({
54847
54962
  opacity = 1,
54848
54963
  className
54849
54964
  }) => {
54850
- const ids = React93__default.useMemo(() => {
54965
+ const ids = React96__default.useMemo(() => {
54851
54966
  avlTransitionId += 1;
54852
54967
  return { arrow: `avl-tr-${avlTransitionId}-arrow` };
54853
54968
  }, []);
@@ -55408,7 +55523,7 @@ var AvlStateMachine = ({
55408
55523
  color = "var(--color-primary)",
55409
55524
  animated = false
55410
55525
  }) => {
55411
- const ids = React93__default.useMemo(() => {
55526
+ const ids = React96__default.useMemo(() => {
55412
55527
  avlSmId += 1;
55413
55528
  const base = `avl-sm-${avlSmId}`;
55414
55529
  return { glow: `${base}-glow`, grad: `${base}-grad` };
@@ -55607,7 +55722,7 @@ var AvlOrbitalUnit = ({
55607
55722
  color = "var(--color-primary)",
55608
55723
  animated = false
55609
55724
  }) => {
55610
- const ids = React93__default.useMemo(() => {
55725
+ const ids = React96__default.useMemo(() => {
55611
55726
  avlOuId += 1;
55612
55727
  const base = `avl-ou-${avlOuId}`;
55613
55728
  return { glow: `${base}-glow`, grad: `${base}-grad` };
@@ -55703,7 +55818,7 @@ var AvlClosedCircuit = ({
55703
55818
  color = "var(--color-primary)",
55704
55819
  animated = false
55705
55820
  }) => {
55706
- const ids = React93__default.useMemo(() => {
55821
+ const ids = React96__default.useMemo(() => {
55707
55822
  avlCcId += 1;
55708
55823
  const base = `avl-cc-${avlCcId}`;
55709
55824
  return { glow: `${base}-glow`, grad: `${base}-grad`, arrow: `${base}-arrow` };
@@ -55858,7 +55973,7 @@ var AvlEmitListen = ({
55858
55973
  color = "var(--color-primary)",
55859
55974
  animated = false
55860
55975
  }) => {
55861
- const ids = React93__default.useMemo(() => {
55976
+ const ids = React96__default.useMemo(() => {
55862
55977
  avlElId += 1;
55863
55978
  const base = `avl-el-${avlElId}`;
55864
55979
  return { arrow: `${base}-arrow`, grad: `${base}-grad` };
@@ -56131,7 +56246,7 @@ function renderNode(node, color, glowId) {
56131
56246
  const baseR = node.type === "operator" ? 20 : 16;
56132
56247
  const r2 = Math.max(baseR, labelLen * 3.5 + 6);
56133
56248
  const nc = nodeColor(node.type, color);
56134
- return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
56249
+ return /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
56135
56250
  node.children.map((child, i) => {
56136
56251
  const childR = Math.max(
56137
56252
  child.type === "operator" ? 20 : 16,
@@ -56188,7 +56303,7 @@ var AvlExprTree = ({
56188
56303
  className,
56189
56304
  color = "var(--color-primary)"
56190
56305
  }) => {
56191
- const ids = React93__default.useMemo(() => {
56306
+ const ids = React96__default.useMemo(() => {
56192
56307
  avlEtId += 1;
56193
56308
  return { glow: `avl-et-${avlEtId}-glow` };
56194
56309
  }, []);
@@ -56751,7 +56866,7 @@ var SystemNode = ({ data }) => {
56751
56866
  stateChain.length > 0 && /* @__PURE__ */ jsx("svg", { width: stateChain.length * 14 + 2, height: 10, viewBox: `0 0 ${stateChain.length * 14 + 2} 10`, children: stateChain.map((s, i) => {
56752
56867
  const tc = transitionCounts[s.name] ?? 0;
56753
56868
  const role = getStateRole(s.name, s.isInitial, s.isTerminal, tc, maxTC);
56754
- return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
56869
+ return /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
56755
56870
  /* @__PURE__ */ jsx(AvlState, { x: i * 14 + 1, y: 1, width: 10, height: 8, name: "", role, isInitial: s.isInitial, isTerminal: s.isTerminal }),
56756
56871
  i < stateChain.length - 1 && /* @__PURE__ */ jsx("line", { x1: i * 14 + 12, y1: 5, x2: i * 14 + 15, y2: 5, stroke: "var(--color-border)", strokeWidth: 0.5 })
56757
56872
  ] }, s.name);
@@ -57091,10 +57206,17 @@ AvlBindingEdge.displayName = "AvlBindingEdge";
57091
57206
 
57092
57207
  // components/molecules/avl/avl-preview-types.ts
57093
57208
  var SCREEN_SIZE_PRESETS = {
57094
- mobile: { width: 375, minHeight: 300, label: "Mobile", icon: "smartphone" },
57095
- tablet: { width: 560, minHeight: 280, label: "Tablet", icon: "tablet" },
57096
- desktop: { width: 780, minHeight: 260, label: "Desktop", icon: "monitor" }
57209
+ mobile: { width: 375, minHeight: 320, label: "Mobile", icon: "smartphone" },
57210
+ tablet: { width: 768, minHeight: 320, label: "Tablet", icon: "tablet" },
57211
+ laptop: { width: 1280, minHeight: 360, label: "Laptop", icon: "monitor" },
57212
+ wide: { width: 1600, minHeight: 360, label: "Wide", icon: "monitor-up" }
57097
57213
  };
57214
+ function detectScreenSize(viewportWidth) {
57215
+ if (viewportWidth <= 640) return "mobile";
57216
+ if (viewportWidth <= 1024) return "tablet";
57217
+ if (viewportWidth <= 1440) return "laptop";
57218
+ return "wide";
57219
+ }
57098
57220
 
57099
57221
  // components/molecules/avl/avl-preview-converter.ts
57100
57222
  var OVERVIEW_SPACING = 900;
@@ -57995,7 +58117,7 @@ function resolveLambdaBindings(body, argName, arg) {
57995
58117
  if (Array.isArray(body)) {
57996
58118
  return body.map((b) => resolveLambdaBindings(b, argName, arg));
57997
58119
  }
57998
- if (body !== null && typeof body === "object" && !React93__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
58120
+ if (body !== null && typeof body === "object" && !React96__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
57999
58121
  const out = {};
58000
58122
  for (const [k, v] of Object.entries(body)) {
58001
58123
  out[k] = resolveLambdaBindings(v, argName, arg);
@@ -58014,7 +58136,7 @@ function getSlotContentRenderer2() {
58014
58136
  function makeLambdaFn(argName, lambdaBody, callerKey) {
58015
58137
  return (item, index) => {
58016
58138
  const resolvedBody = resolveLambdaBindings(lambdaBody, argName, item);
58017
- if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React93__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
58139
+ if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React96__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
58018
58140
  return null;
58019
58141
  }
58020
58142
  const record = resolvedBody;
@@ -58032,7 +58154,7 @@ function makeLambdaFn(argName, lambdaBody, callerKey) {
58032
58154
  props: childProps,
58033
58155
  priority: 0
58034
58156
  };
58035
- return React93__default.createElement(SlotContentRenderer2, { content: childContent });
58157
+ return React96__default.createElement(SlotContentRenderer2, { content: childContent });
58036
58158
  };
58037
58159
  }
58038
58160
  function convertNode(node, callerKey) {
@@ -58051,7 +58173,7 @@ function convertNode(node, callerKey) {
58051
58173
  });
58052
58174
  return anyChanged ? mapped : node;
58053
58175
  }
58054
- if (typeof node === "object" && !React93__default.isValidElement(node) && !(node instanceof Date)) {
58176
+ if (typeof node === "object" && !React96__default.isValidElement(node) && !(node instanceof Date)) {
58055
58177
  return convertObjectProps(node);
58056
58178
  }
58057
58179
  return node;
@@ -59782,8 +59904,8 @@ function CanvasDndProvider({
59782
59904
  }) {
59783
59905
  const eventBus = useEventBus();
59784
59906
  const sensors = useAlmadarDndSensors(false);
59785
- const [activePayload, setActivePayload] = React93__default.useState(null);
59786
- const handleDragStart = React93__default.useCallback((e) => {
59907
+ const [activePayload, setActivePayload] = React96__default.useState(null);
59908
+ const handleDragStart = React96__default.useCallback((e) => {
59787
59909
  const data = e.active.data.current;
59788
59910
  const payload = data?.payload;
59789
59911
  if (payload) {
@@ -59794,7 +59916,7 @@ function CanvasDndProvider({
59794
59916
  log18.warn("dragStart:missing-payload", { id: e.active.id });
59795
59917
  }
59796
59918
  }, [eventBus]);
59797
- const handleDragEnd = React93__default.useCallback((e) => {
59919
+ const handleDragEnd = React96__default.useCallback((e) => {
59798
59920
  setActivePayload(null);
59799
59921
  const activeData = e.active.data.current;
59800
59922
  const payload = activeData?.payload;
@@ -59823,7 +59945,7 @@ function CanvasDndProvider({
59823
59945
  const suppressed = onDrop ? onDrop(drop) === true : false;
59824
59946
  if (!suppressed) defaultEmit(eventBus, drop);
59825
59947
  }, [eventBus, onDrop]);
59826
- const handleDragCancel = React93__default.useCallback(() => {
59948
+ const handleDragCancel = React96__default.useCallback(() => {
59827
59949
  setActivePayload(null);
59828
59950
  log18.info("dragCancel");
59829
59951
  }, []);
@@ -60430,7 +60552,7 @@ var OrbPreviewNodeInner = (props) => {
60430
60552
  }
60431
60553
  );
60432
60554
  };
60433
- var OrbPreviewNode = React93__default.memo(OrbPreviewNodeInner);
60555
+ var OrbPreviewNode = React96__default.memo(OrbPreviewNodeInner);
60434
60556
  OrbPreviewNode.displayName = "OrbPreviewNode";
60435
60557
  orbPreviewLog.debug("export-resolved", () => ({
60436
60558
  type: typeof OrbPreviewNode,
@@ -60535,7 +60657,7 @@ var EventFlowEdgeInner = (props) => {
60535
60657
  ) })
60536
60658
  ] });
60537
60659
  };
60538
- var EventFlowEdge = React93__default.memo(EventFlowEdgeInner);
60660
+ var EventFlowEdge = React96__default.memo(EventFlowEdgeInner);
60539
60661
  EventFlowEdge.displayName = "EventFlowEdge";
60540
60662
 
60541
60663
  // components/molecules/avl/BehaviorComposeNode.tsx
@@ -60682,7 +60804,7 @@ var BehaviorComposeNodeInner = (props) => {
60682
60804
  }
60683
60805
  );
60684
60806
  };
60685
- var BehaviorComposeNode = React93__default.memo(BehaviorComposeNodeInner);
60807
+ var BehaviorComposeNode = React96__default.memo(BehaviorComposeNodeInner);
60686
60808
  BehaviorComposeNode.displayName = "BehaviorComposeNode";
60687
60809
 
60688
60810
  // components/molecules/avl/avl-behavior-compose-converter.ts
@@ -61548,7 +61670,23 @@ function FlowCanvasInner({
61548
61670
  const [expandedOrbital, setExpandedOrbital] = useState(
61549
61671
  initialOrbital
61550
61672
  );
61551
- const [screenSize, setScreenSize] = useState("desktop");
61673
+ const screenSizeUserOverrideRef = React96__default.useRef(false);
61674
+ const [screenSize, setScreenSize] = useState(
61675
+ () => typeof window === "undefined" ? "laptop" : detectScreenSize(window.innerWidth)
61676
+ );
61677
+ useEffect(() => {
61678
+ if (typeof window === "undefined") return void 0;
61679
+ const onResize = () => {
61680
+ if (screenSizeUserOverrideRef.current) return;
61681
+ setScreenSize(detectScreenSize(window.innerWidth));
61682
+ };
61683
+ window.addEventListener("resize", onResize);
61684
+ return () => window.removeEventListener("resize", onResize);
61685
+ }, []);
61686
+ const pickScreenSize = useCallback((size) => {
61687
+ screenSizeUserOverrideRef.current = true;
61688
+ setScreenSize(size);
61689
+ }, []);
61552
61690
  const [selectedNode, setSelectedNode] = useState(initialSelectedNode ?? null);
61553
61691
  const [selectedPattern, setSelectedPattern] = useState(null);
61554
61692
  const patternSelectionValue = useMemo(() => ({
@@ -61718,7 +61856,7 @@ function FlowCanvasInner({
61718
61856
  targetTraitName: tgtData.traitName
61719
61857
  });
61720
61858
  }, [nodes, onEventWire, eventBus]);
61721
- const screenSizeKeys = ["mobile", "tablet", "desktop"];
61859
+ const screenSizeKeys = ["mobile", "tablet", "laptop", "wide"];
61722
61860
  return /* @__PURE__ */ jsx(ScreenSizeContext.Provider, { value: screenSize, children: /* @__PURE__ */ jsx(PatternSelectionContext.Provider, { value: patternSelectionValue, children: /* @__PURE__ */ jsxs(
61723
61861
  Box,
61724
61862
  {
@@ -61797,7 +61935,7 @@ function FlowCanvasInner({
61797
61935
  "button",
61798
61936
  {
61799
61937
  onClick: () => {
61800
- setScreenSize(size);
61938
+ pickScreenSize(size);
61801
61939
  requestAnimationFrame(() => {
61802
61940
  reactFlow.fitView({ duration: 300, padding: 0.15 });
61803
61941
  });
@@ -61871,7 +62009,7 @@ var ZoomBreadcrumb = ({
61871
62009
  if (eventName && band === "detail") {
61872
62010
  segments.push({ icon: "\u26A1", label: eventName });
61873
62011
  }
61874
- return /* @__PURE__ */ jsx("div", { className: "absolute top-2 left-2 z-10 flex items-center gap-1 px-2 py-1 rounded-md bg-card/90 border border-border text-[11px] text-muted-foreground backdrop-blur-sm", children: segments.map((seg, i) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
62012
+ return /* @__PURE__ */ jsx("div", { className: "absolute top-2 left-2 z-10 flex items-center gap-1 px-2 py-1 rounded-md bg-card/90 border border-border text-[11px] text-muted-foreground backdrop-blur-sm", children: segments.map((seg, i) => /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
61875
62013
  i > 0 && /* @__PURE__ */ jsx("span", { className: "opacity-40", children: ">" }),
61876
62014
  /* @__PURE__ */ jsx("span", { className: "opacity-60", children: seg.icon }),
61877
62015
  /* @__PURE__ */ jsx("span", { children: seg.label })
@@ -62350,7 +62488,7 @@ var EventWireOverlay = ({
62350
62488
  containerW,
62351
62489
  containerH
62352
62490
  }) => {
62353
- const ids = React93__default.useMemo(() => {
62491
+ const ids = React96__default.useMemo(() => {
62354
62492
  avlOczWireId += 1;
62355
62493
  return { arrow: `avl-ocz-wire-${avlOczWireId}-arrow` };
62356
62494
  }, []);
@@ -62709,7 +62847,7 @@ var AvlOrbitalsCosmicZoom = ({
62709
62847
  borderRadius: 6,
62710
62848
  border: `1px solid ${color}`
62711
62849
  },
62712
- children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
62850
+ children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
62713
62851
  i > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", style: { opacity: 0.5, color }, children: "/" }),
62714
62852
  i < breadcrumbs.length - 1 ? /* @__PURE__ */ jsx(
62715
62853
  Box,