@octaviaflow/core 3.1.0-beta.67 → 3.1.0-beta.68

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.
Files changed (70) hide show
  1. package/dist/chunk-JMSZOWT2.js +2616 -0
  2. package/dist/chunk-JMSZOWT2.js.map +1 -0
  3. package/dist/chunk-KZP2MNBO.js +2516 -0
  4. package/dist/chunk-KZP2MNBO.js.map +1 -0
  5. package/dist/chunk-S4LE4BFQ.js +5934 -0
  6. package/dist/chunk-S4LE4BFQ.js.map +1 -0
  7. package/dist/chunk-X7YETDK7.js +107 -0
  8. package/dist/chunk-X7YETDK7.js.map +1 -0
  9. package/dist/components/WorkflowShowcase/ShowcaseScene.d.ts +20 -0
  10. package/dist/components/WorkflowShowcase/ShowcaseScene.d.ts.map +1 -0
  11. package/dist/components/WorkflowShowcase/ShowcaseSignup.d.ts +14 -0
  12. package/dist/components/WorkflowShowcase/ShowcaseSignup.d.ts.map +1 -0
  13. package/dist/components/WorkflowShowcase/WorkflowShowcase.d.ts +48 -0
  14. package/dist/components/WorkflowShowcase/WorkflowShowcase.d.ts.map +1 -0
  15. package/dist/components/WorkflowShowcase/index.d.ts +3 -0
  16. package/dist/components/WorkflowShowcase/index.d.ts.map +1 -0
  17. package/dist/components/WorkflowShowcase/showcaseEngine.d.ts +102 -0
  18. package/dist/components/WorkflowShowcase/showcaseEngine.d.ts.map +1 -0
  19. package/dist/index.js +7854 -13331
  20. package/dist/index.js.map +1 -1
  21. package/dist/marketing/components/AssistantTranscript/AssistantTranscript.d.ts +15 -0
  22. package/dist/marketing/components/AssistantTranscript/AssistantTranscript.d.ts.map +1 -0
  23. package/dist/marketing/components/CtaBanner/CtaBanner.d.ts +16 -0
  24. package/dist/marketing/components/CtaBanner/CtaBanner.d.ts.map +1 -0
  25. package/dist/marketing/components/FeatureGrid/FeatureGrid.d.ts +15 -0
  26. package/dist/marketing/components/FeatureGrid/FeatureGrid.d.ts.map +1 -0
  27. package/dist/marketing/components/IntegrationsWall/IntegrationsWall.d.ts +19 -0
  28. package/dist/marketing/components/IntegrationsWall/IntegrationsWall.d.ts.map +1 -0
  29. package/dist/marketing/components/LiveConsole/LiveConsole.d.ts +21 -0
  30. package/dist/marketing/components/LiveConsole/LiveConsole.d.ts.map +1 -0
  31. package/dist/marketing/components/MarketingFooter/MarketingFooter.d.ts +25 -0
  32. package/dist/marketing/components/MarketingFooter/MarketingFooter.d.ts.map +1 -0
  33. package/dist/marketing/components/MarketingHero/MarketingHero.d.ts +11 -0
  34. package/dist/marketing/components/MarketingHero/MarketingHero.d.ts.map +1 -0
  35. package/dist/marketing/components/MarketingNav/MarketingNav.d.ts +17 -0
  36. package/dist/marketing/components/MarketingNav/MarketingNav.d.ts.map +1 -0
  37. package/dist/marketing/components/MarketingSection/MarketingSection.d.ts +15 -0
  38. package/dist/marketing/components/MarketingSection/MarketingSection.d.ts.map +1 -0
  39. package/dist/marketing/components/StatBand/StatBand.d.ts +16 -0
  40. package/dist/marketing/components/StatBand/StatBand.d.ts.map +1 -0
  41. package/dist/marketing/components/WorkflowShowcase/ShowcaseScene.d.ts +20 -0
  42. package/dist/marketing/components/WorkflowShowcase/ShowcaseScene.d.ts.map +1 -0
  43. package/dist/marketing/components/WorkflowShowcase/ShowcaseSignup.d.ts +14 -0
  44. package/dist/marketing/components/WorkflowShowcase/ShowcaseSignup.d.ts.map +1 -0
  45. package/dist/marketing/components/WorkflowShowcase/WorkflowShowcase.d.ts +48 -0
  46. package/dist/marketing/components/WorkflowShowcase/WorkflowShowcase.d.ts.map +1 -0
  47. package/dist/marketing/components/WorkflowShowcase/index.d.ts +3 -0
  48. package/dist/marketing/components/WorkflowShowcase/index.d.ts.map +1 -0
  49. package/dist/marketing/components/WorkflowShowcase/showcaseEngine.d.ts +102 -0
  50. package/dist/marketing/components/WorkflowShowcase/showcaseEngine.d.ts.map +1 -0
  51. package/dist/marketing/glyphs.d.ts +20 -0
  52. package/dist/marketing/glyphs.d.ts.map +1 -0
  53. package/dist/marketing/index.d.ts +13 -0
  54. package/dist/marketing/index.d.ts.map +1 -0
  55. package/dist/marketing.cjs +3985 -0
  56. package/dist/marketing.cjs.map +1 -0
  57. package/dist/marketing.js +1669 -0
  58. package/dist/marketing.js.map +1 -0
  59. package/dist/styles.css +1 -1
  60. package/dist/workflow/components/HttpActionPanel/HttpActionPanel.d.ts +29 -0
  61. package/dist/workflow/components/HttpActionPanel/HttpActionPanel.d.ts.map +1 -0
  62. package/dist/workflow/components/HttpActionPanel/httpActionTypes.d.ts +135 -0
  63. package/dist/workflow/components/HttpActionPanel/httpActionTypes.d.ts.map +1 -0
  64. package/dist/workflow/index.d.ts +2 -0
  65. package/dist/workflow/index.d.ts.map +1 -1
  66. package/dist/workflow.cjs +6922 -271
  67. package/dist/workflow.cjs.map +1 -1
  68. package/dist/workflow.js +1587 -56
  69. package/dist/workflow.js.map +1 -1
  70. package/package.json +6 -1
@@ -0,0 +1,3985 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/marketing/index.ts
31
+ var marketing_exports = {};
32
+ __export(marketing_exports, {
33
+ ActionGlyph: () => ActionGlyph,
34
+ AssistantTranscript: () => AssistantTranscript,
35
+ BrandMark: () => BrandMark,
36
+ ConnectorGlyph: () => ConnectorGlyph,
37
+ CtaBanner: () => CtaBanner,
38
+ DestinationGlyph: () => DestinationGlyph,
39
+ FeatureGrid: () => FeatureGrid,
40
+ IntegrationsWall: () => IntegrationsWall,
41
+ LiveConsole: () => LiveConsole,
42
+ MarketingFooter: () => MarketingFooter,
43
+ MarketingHero: () => MarketingHero,
44
+ MarketingNav: () => MarketingNav,
45
+ MarketingSection: () => MarketingSection,
46
+ NotifyGlyph: () => NotifyGlyph,
47
+ SourceGlyph: () => SourceGlyph,
48
+ StatBand: () => StatBand,
49
+ WORKFLOW_SHOWCASE_DEFAULT_CONNECTORS: () => WORKFLOW_SHOWCASE_DEFAULT_CONNECTORS,
50
+ WORKFLOW_SHOWCASE_DEFAULT_EXAMPLES: () => WORKFLOW_SHOWCASE_DEFAULT_EXAMPLES,
51
+ WORKFLOW_SHOWCASE_DEFAULT_METRICS: () => WORKFLOW_SHOWCASE_DEFAULT_METRICS,
52
+ WORKFLOW_SHOWCASE_DEFAULT_TILES: () => WORKFLOW_SHOWCASE_DEFAULT_TILES,
53
+ WORKFLOW_SHOWCASE_SCHEDULES: () => WORKFLOW_SHOWCASE_SCHEDULES,
54
+ WorkflowShowcase: () => WorkflowShowcase,
55
+ roleGlyph: () => roleGlyph
56
+ });
57
+ module.exports = __toCommonJS(marketing_exports);
58
+
59
+ // src/utils/cn.ts
60
+ var import_clsx = require("clsx");
61
+ function cn(...inputs) {
62
+ return (0, import_clsx.clsx)(inputs);
63
+ }
64
+
65
+ // src/marketing/components/AssistantTranscript/AssistantTranscript.tsx
66
+ var import_jsx_runtime = require("react/jsx-runtime");
67
+ function AssistantTranscript({
68
+ title = "OctaviaFlow AI Assistant",
69
+ turns,
70
+ userLabel = "you",
71
+ assistantLabel = "octavia",
72
+ className,
73
+ ...rest
74
+ }) {
75
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { ...rest, className: cn("ods-mkt-transcript", className), children: [
76
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "ods-mkt-transcript__head", children: title }),
77
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "ods-mkt-transcript__body", children: turns.map((turn) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "ods-mkt-transcript__turn", children: [
78
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
79
+ "span",
80
+ {
81
+ className: cn(
82
+ "ods-mkt-transcript__speaker",
83
+ `ods-mkt-transcript__speaker--${turn.speaker}`
84
+ ),
85
+ children: [
86
+ turn.speaker === "user" ? userLabel : assistantLabel,
87
+ " \u2192"
88
+ ]
89
+ }
90
+ ),
91
+ " ",
92
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "ods-mkt-transcript__content", children: turn.content })
93
+ ] }, turn.id)) })
94
+ ] });
95
+ }
96
+
97
+ // src/components/Button/Button.tsx
98
+ var import_framer_motion = require("framer-motion");
99
+ var import_react3 = require("react");
100
+ var import_react_aria = require("react-aria");
101
+
102
+ // src/utils/a11y.ts
103
+ var import_react = require("react");
104
+ function hasRenderableText(node) {
105
+ if (node === null || node === void 0 || typeof node === "boolean") return false;
106
+ if (typeof node === "string") return node.trim().length > 0;
107
+ if (typeof node === "number") return true;
108
+ if (Array.isArray(node)) return node.some(hasRenderableText);
109
+ if ((0, import_react.isValidElement)(node)) {
110
+ return hasRenderableText(node.props.children);
111
+ }
112
+ return false;
113
+ }
114
+ function resolveAccessibleName(input) {
115
+ if (input.ariaLabelledby) {
116
+ return { "aria-labelledby": input.ariaLabelledby };
117
+ }
118
+ if (input.ariaLabel) {
119
+ return { "aria-label": input.ariaLabel };
120
+ }
121
+ if (typeof input.label === "string" && input.label.trim().length > 0) {
122
+ return { "aria-label": input.label };
123
+ }
124
+ for (const candidate of input.fallbacks ?? []) {
125
+ if (typeof candidate === "string" && candidate.trim().length > 0) {
126
+ return { "aria-label": candidate };
127
+ }
128
+ }
129
+ if (process.env.NODE_ENV !== "production") {
130
+ console.error(
131
+ `[@octaviaflow/core ${input.componentName}] No accessible name. Pass a string \`label\`, or \`aria-label\`, or \`aria-labelledby\` so screen readers can announce this control.`
132
+ );
133
+ }
134
+ return { "aria-label": `Unlabeled ${input.componentName}` };
135
+ }
136
+
137
+ // src/utils/Slot.tsx
138
+ var import_react2 = require("react");
139
+
140
+ // src/utils/composeRefs.ts
141
+ function composeRefs(...refs) {
142
+ return (node) => {
143
+ for (const ref of refs) {
144
+ if (typeof ref === "function") {
145
+ ref(node);
146
+ } else if (ref != null) {
147
+ ref.current = node;
148
+ }
149
+ }
150
+ };
151
+ }
152
+
153
+ // src/utils/Slot.tsx
154
+ var Slot = (0, import_react2.forwardRef)(function Slot2({ children, ...slotProps }, forwardedRef) {
155
+ if (!(0, import_react2.isValidElement)(children)) {
156
+ return null;
157
+ }
158
+ const child = import_react2.Children.only(children);
159
+ const childProps = child.props ?? {};
160
+ const childRef = child.ref;
161
+ return (0, import_react2.cloneElement)(child, {
162
+ ...mergeProps(slotProps, childProps),
163
+ ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef
164
+ });
165
+ });
166
+ function mergeProps(slotProps, childProps) {
167
+ const merged = { ...slotProps, ...childProps };
168
+ for (const key of Object.keys(slotProps)) {
169
+ const slotValue = slotProps[key];
170
+ const childValue = childProps[key];
171
+ if (/^on[A-Z]/.test(key) && typeof slotValue === "function" && typeof childValue === "function") {
172
+ merged[key] = (...args) => {
173
+ slotValue(...args);
174
+ const event = args[0];
175
+ if (event?.defaultPrevented) return;
176
+ childValue(...args);
177
+ };
178
+ continue;
179
+ }
180
+ if (key === "className") {
181
+ merged.className = [slotValue, childValue].filter(Boolean).join(" ");
182
+ continue;
183
+ }
184
+ if (key === "style") {
185
+ merged.style = {
186
+ ...slotValue,
187
+ ...childValue
188
+ };
189
+ continue;
190
+ }
191
+ }
192
+ return merged;
193
+ }
194
+
195
+ // src/components/Button/Button.tsx
196
+ var import_jsx_runtime2 = require("react/jsx-runtime");
197
+ var Button = (0, import_react3.forwardRef)(function Button2({
198
+ variant = "primary",
199
+ size = "md",
200
+ loading = false,
201
+ loadingText,
202
+ loadingLabel = "Loading",
203
+ disabled = false,
204
+ leftIcon,
205
+ rightIcon,
206
+ fullWidth = false,
207
+ pressed,
208
+ asChild = false,
209
+ className,
210
+ children,
211
+ type,
212
+ cursor,
213
+ style,
214
+ ...props
215
+ }, forwardedRef) {
216
+ const ref = (0, import_react3.useRef)(null);
217
+ (0, import_react3.useImperativeHandle)(forwardedRef, () => ref.current);
218
+ const isDisabled = disabled || loading;
219
+ const prefersReducedMotion = (0, import_framer_motion.useReducedMotion)();
220
+ const hasAction = Boolean(props.onClick) || type === "submit" || type === "reset";
221
+ const resolvedCursor = cursor ?? (disabled ? "not-allowed" : loading ? "progress" : hasAction ? "pointer" : "default");
222
+ const resolvedType = type ?? "button";
223
+ const hasVisibleText = hasRenderableText(children);
224
+ const needsAriaName = !hasVisibleText && !asChild;
225
+ const ariaNameProps = needsAriaName ? resolveAccessibleName({
226
+ ariaLabel: props["aria-label"],
227
+ ariaLabelledby: props["aria-labelledby"],
228
+ componentName: "Button"
229
+ }) : void 0;
230
+ const { buttonProps } = (0, import_react_aria.useButton)(
231
+ {
232
+ isDisabled,
233
+ onPress: props.onClick,
234
+ type: resolvedType,
235
+ ...ariaNameProps ?? {}
236
+ },
237
+ ref
238
+ );
239
+ const { onDrag, onDragStart, onDragEnd, onAnimationStart, ...safeButtonProps } = buttonProps;
240
+ const {
241
+ onClick: _onClick,
242
+ onKeyDown: _onKeyDown,
243
+ onKeyUp: _onKeyUp,
244
+ onMouseDown: _onMouseDown,
245
+ onPointerDown: _onPointerDown,
246
+ onPointerUp: _onPointerUp,
247
+ onFocus: _onFocus,
248
+ onBlur: _onBlur,
249
+ ...passthroughProps
250
+ } = props;
251
+ const rootClassName = cn(
252
+ "ods-btn",
253
+ `ods-btn--${variant}`,
254
+ `ods-btn--${size}`,
255
+ loading && "ods-btn--loading",
256
+ fullWidth && "ods-btn--full",
257
+ pressed && "ods-btn--pressed",
258
+ className
259
+ );
260
+ if (asChild) {
261
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
262
+ Slot,
263
+ {
264
+ ...passthroughProps,
265
+ ref: forwardedRef,
266
+ className: rootClassName,
267
+ style: { cursor: resolvedCursor, ...style },
268
+ "aria-pressed": pressed,
269
+ "aria-disabled": isDisabled || void 0,
270
+ children
271
+ }
272
+ );
273
+ }
274
+ const visibleLabel = loading && loadingText !== void 0 ? loadingText : children;
275
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
276
+ import_framer_motion.motion.button,
277
+ {
278
+ ...passthroughProps,
279
+ ...safeButtonProps,
280
+ type: resolvedType,
281
+ ref,
282
+ className: rootClassName,
283
+ style: { cursor: resolvedCursor, ...style },
284
+ "data-loading": loading || void 0,
285
+ "aria-busy": loading || void 0,
286
+ "aria-pressed": pressed,
287
+ whileTap: isDisabled || prefersReducedMotion ? void 0 : { scale: 0.97 },
288
+ transition: { duration: 0.1 },
289
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: "ods-btn__content", children: [
290
+ loading ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
291
+ "span",
292
+ {
293
+ className: "ods-btn__icon ods-btn__icon--left ods-btn__icon--spinner",
294
+ role: "status",
295
+ "aria-label": loadingLabel,
296
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
297
+ "circle",
298
+ {
299
+ cx: "12",
300
+ cy: "12",
301
+ r: "10",
302
+ fill: "none",
303
+ stroke: "currentColor",
304
+ strokeWidth: "2.5",
305
+ strokeLinecap: "round",
306
+ strokeDasharray: "32",
307
+ strokeDashoffset: "12"
308
+ }
309
+ ) })
310
+ }
311
+ ) : leftIcon && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "ods-btn__icon ods-btn__icon--left", children: leftIcon }),
312
+ visibleLabel != null && visibleLabel !== false && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "ods-btn__label", children: visibleLabel }),
313
+ rightIcon && !loading && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "ods-btn__icon ods-btn__icon--right", children: rightIcon })
314
+ ] })
315
+ }
316
+ );
317
+ });
318
+ Button.displayName = "Button";
319
+
320
+ // src/marketing/components/CtaBanner/CtaBanner.tsx
321
+ var import_jsx_runtime3 = require("react/jsx-runtime");
322
+ function Action({
323
+ action,
324
+ variant
325
+ }) {
326
+ if (action.href) {
327
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
328
+ "a",
329
+ {
330
+ className: cn("ods-mkt-cta__link", `ods-mkt-cta__link--${variant}`),
331
+ href: action.href,
332
+ onClick: action.onClick,
333
+ children: action.label
334
+ }
335
+ );
336
+ }
337
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Button, { variant, onClick: action.onClick, children: action.label });
338
+ }
339
+ function CtaBanner({
340
+ title,
341
+ lede,
342
+ primary,
343
+ secondary,
344
+ footnote,
345
+ className,
346
+ ...rest
347
+ }) {
348
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("section", { ...rest, className: cn("ods-mkt-cta", className), children: [
349
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h2", { className: "ods-mkt-cta__title", children: title }),
350
+ lede && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "ods-mkt-cta__lede", children: lede }),
351
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "ods-mkt-cta__actions", children: [
352
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Action, { action: primary, variant: "primary" }),
353
+ secondary && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Action, { action: secondary, variant: "secondary" })
354
+ ] }),
355
+ footnote && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "ods-mkt-cta__footnote", children: footnote })
356
+ ] });
357
+ }
358
+
359
+ // src/marketing/components/FeatureGrid/FeatureGrid.tsx
360
+ var import_jsx_runtime4 = require("react/jsx-runtime");
361
+ function FeatureGrid({
362
+ items,
363
+ columns = 3,
364
+ dense = false,
365
+ className,
366
+ ...rest
367
+ }) {
368
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
369
+ "div",
370
+ {
371
+ ...rest,
372
+ className: cn(
373
+ "ods-mkt-features",
374
+ `ods-mkt-features--${columns}`,
375
+ dense && "ods-mkt-features--dense",
376
+ className
377
+ ),
378
+ children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("article", { className: "ods-mkt-features__cell", children: [
379
+ item.icon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "ods-mkt-features__icon", "aria-hidden": "true", children: item.icon }),
380
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h3", { className: "ods-mkt-features__title", children: item.title }),
381
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "ods-mkt-features__body", children: item.body })
382
+ ] }, item.id))
383
+ }
384
+ );
385
+ }
386
+
387
+ // src/marketing/glyphs.tsx
388
+ var import_jsx_runtime5 = require("react/jsx-runtime");
389
+ var base = {
390
+ xmlns: "http://www.w3.org/2000/svg",
391
+ viewBox: "0 0 24 24",
392
+ fill: "none",
393
+ stroke: "currentColor",
394
+ strokeWidth: 2,
395
+ strokeLinecap: "round",
396
+ strokeLinejoin: "round"
397
+ };
398
+ function SourceGlyph({ size = 12 }) {
399
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("svg", { ...base, width: size, height: size, "aria-hidden": "true", children: [
400
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("ellipse", { cx: "12", cy: "5", rx: "9", ry: "3" }),
401
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M3 5v14a9 3 0 0 0 18 0V5" }),
402
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M3 12a9 3 0 0 0 18 0" })
403
+ ] });
404
+ }
405
+ function DestinationGlyph({ size = 12 }) {
406
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("svg", { ...base, width: size, height: size, "aria-hidden": "true", children: [
407
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("rect", { x: "2", y: "3", width: "20", height: "5", rx: "1" }),
408
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8" }),
409
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M10 12h4" })
410
+ ] });
411
+ }
412
+ function ActionGlyph({ size = 12 }) {
413
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("svg", { ...base, width: size, height: size, "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M13 2 3 14h9l-1 8 10-12h-9l1-8z" }) });
414
+ }
415
+ function NotifyGlyph({ size = 12 }) {
416
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("svg", { ...base, width: size, height: size, "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }) });
417
+ }
418
+ function ConnectorGlyph({ size = 12 }) {
419
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("svg", { ...base, width: size, height: size, "aria-hidden": "true", children: [
420
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M12 22v-5" }),
421
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M9 8V2M15 8V2" }),
422
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8h12z" })
423
+ ] });
424
+ }
425
+ function BrandMark({ size = 18 }) {
426
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("svg", { viewBox: "0 0 18 18", width: size, height: size, "aria-hidden": "true", children: [
427
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("rect", { width: "18", height: "18", fill: "var(--ods-accent)" }),
428
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M4 9h8.5M9.5 5.5 13 9l-3.5 3.5", stroke: "#fff", strokeWidth: "1.6", fill: "none" })
429
+ ] });
430
+ }
431
+ function roleGlyph(role, size = 12) {
432
+ switch (role) {
433
+ case "source":
434
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SourceGlyph, { size });
435
+ case "destination":
436
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(DestinationGlyph, { size });
437
+ case "action":
438
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ActionGlyph, { size });
439
+ case "notify":
440
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(NotifyGlyph, { size });
441
+ }
442
+ }
443
+
444
+ // src/marketing/components/IntegrationsWall/IntegrationsWall.tsx
445
+ var import_jsx_runtime6 = require("react/jsx-runtime");
446
+ function IntegrationsWall({
447
+ categories,
448
+ footnote,
449
+ bareChips = false,
450
+ className,
451
+ ...rest
452
+ }) {
453
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { ...rest, className: cn("ods-mkt-wall", className), children: [
454
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "ods-mkt-wall__grid", children: categories.map((category) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "ods-mkt-wall__row", children: [
455
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "ods-mkt-wall__category", children: category.label }),
456
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "ods-mkt-wall__chips", children: category.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "ods-mkt-wall__chip", children: [
457
+ (item.icon || !bareChips) && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "ods-mkt-wall__chip-icon", "aria-hidden": "true", children: item.icon ?? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ConnectorGlyph, { size: 13 }) }),
458
+ item.name
459
+ ] }, item.name)) })
460
+ ] }, category.id)) }),
461
+ footnote && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "ods-mkt-wall__footnote", children: footnote })
462
+ ] });
463
+ }
464
+
465
+ // src/marketing/components/LiveConsole/LiveConsole.tsx
466
+ var import_jsx_runtime7 = require("react/jsx-runtime");
467
+ var STATE_GLYPH = {
468
+ done: "\u2713",
469
+ running: "\u27F3",
470
+ queued: "\u2192",
471
+ error: "\u2715"
472
+ };
473
+ function LiveConsole({
474
+ title,
475
+ badge = "LIVE",
476
+ lines,
477
+ animated = true,
478
+ className,
479
+ ...rest
480
+ }) {
481
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { ...rest, className: cn("ods-mkt-console", className), children: [
482
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "ods-mkt-console__head", children: [
483
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "ods-mkt-console__title", children: title }),
484
+ badge != null && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "ods-mkt-console__badge", children: [
485
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "ods-mkt-console__dot" }),
486
+ badge
487
+ ] })
488
+ ] }),
489
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "ods-mkt-console__body", children: lines.map((line, i) => {
490
+ const state = line.state ?? "done";
491
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
492
+ "div",
493
+ {
494
+ className: cn("ods-mkt-console__line", animated && "ods-mkt-console__line--animated"),
495
+ style: animated ? { animationDelay: `${0.3 + i * 0.6}s` } : void 0,
496
+ children: [
497
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
498
+ "span",
499
+ {
500
+ className: cn("ods-mkt-console__glyph", `ods-mkt-console__glyph--${state}`),
501
+ "aria-hidden": "true",
502
+ children: STATE_GLYPH[state]
503
+ }
504
+ ),
505
+ " ",
506
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "ods-mkt-console__label", children: line.label }),
507
+ line.detail && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
508
+ "span",
509
+ {
510
+ className: cn(
511
+ "ods-mkt-console__detail",
512
+ state === "running" && "ods-mkt-console__detail--running"
513
+ ),
514
+ children: [
515
+ " ",
516
+ line.detail
517
+ ]
518
+ }
519
+ )
520
+ ]
521
+ },
522
+ line.id
523
+ );
524
+ }) })
525
+ ] });
526
+ }
527
+
528
+ // src/marketing/components/MarketingFooter/MarketingFooter.tsx
529
+ var import_jsx_runtime8 = require("react/jsx-runtime");
530
+ function MarketingFooter({
531
+ brand,
532
+ tagline,
533
+ meta,
534
+ columns = [],
535
+ legal,
536
+ social,
537
+ className,
538
+ ...rest
539
+ }) {
540
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("footer", { ...rest, className: cn("ods-mkt-footer", className), children: [
541
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "ods-mkt-footer__grid", children: [
542
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "ods-mkt-footer__brand-col", children: [
543
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "ods-mkt-footer__brand", children: brand ?? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
544
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(BrandMark, { size: 16 }),
545
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: "OctaviaFlow" })
546
+ ] }) }),
547
+ tagline && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "ods-mkt-footer__tagline", children: tagline }),
548
+ meta && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "ods-mkt-footer__meta", children: meta })
549
+ ] }),
550
+ columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("nav", { className: "ods-mkt-footer__col", "aria-label": String(column.id), children: [
551
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "ods-mkt-footer__col-label", children: column.label }),
552
+ column.links.map((link) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("a", { className: "ods-mkt-footer__link", href: link.href, children: link.label }, link.href))
553
+ ] }, column.id))
554
+ ] }),
555
+ (legal || social) && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "ods-mkt-footer__bar", children: [
556
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: legal }),
557
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: social })
558
+ ] })
559
+ ] });
560
+ }
561
+
562
+ // src/marketing/components/MarketingHero/MarketingHero.tsx
563
+ var import_framer_motion2 = require("framer-motion");
564
+ var import_jsx_runtime9 = require("react/jsx-runtime");
565
+ function MarketingHero({
566
+ kicker,
567
+ title,
568
+ lede,
569
+ align = "center",
570
+ className,
571
+ children,
572
+ ...rest
573
+ }) {
574
+ const reducedMotion = (0, import_framer_motion2.useReducedMotion)();
575
+ const words = title.split(/\s+/).filter(Boolean);
576
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
577
+ "section",
578
+ {
579
+ ...rest,
580
+ className: cn("ods-mkt-hero", align === "center" && "ods-mkt-hero--center", className),
581
+ children: [
582
+ kicker && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "ods-mkt-hero__kicker", children: kicker }),
583
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h1", { className: "ods-mkt-hero__title", children: words.map((word, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
584
+ "span",
585
+ {
586
+ className: "ods-mkt-hero__word-clip",
587
+ children: [
588
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
589
+ import_framer_motion2.motion.span,
590
+ {
591
+ className: "ods-mkt-hero__word",
592
+ initial: reducedMotion ? false : { opacity: 0, y: "100%" },
593
+ animate: { opacity: 1, y: 0 },
594
+ transition: {
595
+ duration: 0.7,
596
+ delay: 0.05 + i * 0.08,
597
+ ease: [0.2, 0.7, 0.2, 1]
598
+ },
599
+ children: word
600
+ }
601
+ ),
602
+ " "
603
+ ]
604
+ },
605
+ i
606
+ )) }),
607
+ lede && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
608
+ import_framer_motion2.motion.p,
609
+ {
610
+ className: "ods-mkt-hero__lede",
611
+ initial: reducedMotion ? false : { opacity: 0, y: 12 },
612
+ animate: { opacity: 1, y: 0 },
613
+ transition: { duration: 0.8, delay: 0.6, ease: [0.2, 0.7, 0.2, 1] },
614
+ children: lede
615
+ }
616
+ ),
617
+ children && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
618
+ import_framer_motion2.motion.div,
619
+ {
620
+ className: "ods-mkt-hero__body",
621
+ initial: reducedMotion ? false : { opacity: 0, y: 12 },
622
+ animate: { opacity: 1, y: 0 },
623
+ transition: { duration: 0.8, delay: 0.75, ease: [0.2, 0.7, 0.2, 1] },
624
+ children
625
+ }
626
+ )
627
+ ]
628
+ }
629
+ );
630
+ }
631
+
632
+ // src/marketing/components/MarketingNav/MarketingNav.tsx
633
+ var import_jsx_runtime10 = require("react/jsx-runtime");
634
+ function MarketingNav({
635
+ brand,
636
+ brandHref = "/",
637
+ links = [],
638
+ actions,
639
+ sticky = true,
640
+ className,
641
+ ...rest
642
+ }) {
643
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("header", { ...rest, className: cn("ods-mkt-nav", sticky && "ods-mkt-nav--sticky", className), children: [
644
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("a", { className: "ods-mkt-nav__brand", href: brandHref, children: brand ?? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
645
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(BrandMark, {}),
646
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "OctaviaFlow" })
647
+ ] }) }),
648
+ links.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("nav", { className: "ods-mkt-nav__links", "aria-label": "Main", children: links.map((link) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
649
+ "a",
650
+ {
651
+ href: link.href,
652
+ className: cn("ods-mkt-nav__link", link.active && "ods-mkt-nav__link--active"),
653
+ "aria-current": link.active ? "page" : void 0,
654
+ children: link.label
655
+ },
656
+ link.href
657
+ )) }),
658
+ actions && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "ods-mkt-nav__actions", children: actions })
659
+ ] });
660
+ }
661
+
662
+ // src/marketing/components/MarketingSection/MarketingSection.tsx
663
+ var import_jsx_runtime11 = require("react/jsx-runtime");
664
+ function MarketingSection({
665
+ kicker,
666
+ title,
667
+ lede,
668
+ align = "start",
669
+ tone = "default",
670
+ flushTop = false,
671
+ className,
672
+ children,
673
+ ...rest
674
+ }) {
675
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
676
+ "section",
677
+ {
678
+ ...rest,
679
+ className: cn(
680
+ "ods-mkt-section",
681
+ align === "center" && "ods-mkt-section--center",
682
+ tone === "subtle" && "ods-mkt-section--subtle",
683
+ flushTop && "ods-mkt-section--flush",
684
+ className
685
+ ),
686
+ children: [
687
+ (kicker || title || lede) && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("header", { className: "ods-mkt-section__head", children: [
688
+ kicker && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "ods-mkt-section__kicker", children: kicker }),
689
+ title && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h2", { className: "ods-mkt-section__title", children: title }),
690
+ lede && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "ods-mkt-section__lede", children: lede })
691
+ ] }),
692
+ children
693
+ ]
694
+ }
695
+ );
696
+ }
697
+
698
+ // src/marketing/components/StatBand/StatBand.tsx
699
+ var import_framer_motion3 = require("framer-motion");
700
+
701
+ // src/components/CountUp/CountUp.tsx
702
+ var import_react4 = require("react");
703
+ var import_jsx_runtime12 = require("react/jsx-runtime");
704
+ var easeOutCubic = (t) => 1 - Math.pow(1 - t, 3);
705
+ var CountUp = (0, import_react4.forwardRef)(
706
+ function CountUp2({
707
+ value,
708
+ from = 0,
709
+ duration = 800,
710
+ easing = easeOutCubic,
711
+ decimals = 0,
712
+ formatValue,
713
+ prefix,
714
+ suffix,
715
+ delay = 0,
716
+ disableAnimation = false,
717
+ onComplete,
718
+ className,
719
+ ...rest
720
+ }, ref) {
721
+ const [n, setN] = (0, import_react4.useState)(disableAnimation ? value : from);
722
+ const lastRendered = (0, import_react4.useRef)(disableAnimation ? value : from);
723
+ (0, import_react4.useEffect)(() => {
724
+ const reduced = typeof window !== "undefined" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
725
+ if (disableAnimation || reduced) {
726
+ setN(value);
727
+ lastRendered.current = value;
728
+ onComplete?.();
729
+ return;
730
+ }
731
+ const startValue = lastRendered.current;
732
+ const delta = value - startValue;
733
+ if (delta === 0) return;
734
+ let raf = null;
735
+ let timeoutId = null;
736
+ let startTime = null;
737
+ let cancelled = false;
738
+ const tick = (ts) => {
739
+ if (cancelled) return;
740
+ if (startTime === null) startTime = ts;
741
+ const t = Math.min(1, (ts - startTime) / Math.max(1, duration));
742
+ const eased = easing(t);
743
+ const current = startValue + delta * eased;
744
+ setN(current);
745
+ lastRendered.current = current;
746
+ if (t < 1) {
747
+ raf = requestAnimationFrame(tick);
748
+ } else {
749
+ lastRendered.current = value;
750
+ setN(value);
751
+ onComplete?.();
752
+ }
753
+ };
754
+ const start = () => {
755
+ raf = requestAnimationFrame(tick);
756
+ };
757
+ if (delay > 0) {
758
+ timeoutId = window.setTimeout(start, delay);
759
+ } else {
760
+ start();
761
+ }
762
+ return () => {
763
+ cancelled = true;
764
+ if (raf !== null) cancelAnimationFrame(raf);
765
+ if (timeoutId !== null) window.clearTimeout(timeoutId);
766
+ };
767
+ }, [value, duration, delay, disableAnimation]);
768
+ const display = formatValue ? formatValue(n) : n.toFixed(decimals);
769
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
770
+ "span",
771
+ {
772
+ ...rest,
773
+ ref,
774
+ className: cn("ods-count-up", className),
775
+ "aria-live": "polite",
776
+ "aria-atomic": "true",
777
+ children: [
778
+ prefix,
779
+ display,
780
+ suffix
781
+ ]
782
+ }
783
+ );
784
+ }
785
+ );
786
+ CountUp.displayName = "CountUp";
787
+
788
+ // src/marketing/components/StatBand/StatBand.tsx
789
+ var import_jsx_runtime13 = require("react/jsx-runtime");
790
+ function StatBand({ items, orientation = "column", className, ...rest }) {
791
+ const reducedMotion = (0, import_framer_motion3.useReducedMotion)();
792
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
793
+ "div",
794
+ {
795
+ ...rest,
796
+ className: cn("ods-mkt-statband", `ods-mkt-statband--${orientation}`, className),
797
+ children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "ods-mkt-statband__item", children: [
798
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "ods-mkt-statband__value", children: typeof item.value === "number" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
799
+ CountUp,
800
+ {
801
+ value: item.value,
802
+ duration: 900,
803
+ disableAnimation: Boolean(reducedMotion),
804
+ prefix: item.prefix,
805
+ suffix: item.suffix,
806
+ formatValue: (v) => Math.round(v).toLocaleString("en-US")
807
+ }
808
+ ) : /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
809
+ item.prefix,
810
+ item.value,
811
+ item.suffix
812
+ ] }) }),
813
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "ods-mkt-statband__label", children: item.label })
814
+ ] }, item.id))
815
+ }
816
+ );
817
+ }
818
+
819
+ // src/marketing/components/WorkflowShowcase/showcaseEngine.ts
820
+ var SETTLED_PHASES = [
821
+ "done",
822
+ "signup",
823
+ "creating",
824
+ "welcome"
825
+ ];
826
+ var WORKFLOW_SHOWCASE_DEFAULT_CONNECTORS = [
827
+ { name: "Storefront", role: "source", aliases: ["store", "shop orders"] },
828
+ { name: "Payments", role: "source", aliases: ["payouts"] },
829
+ { name: "Orders DB", role: "source", aliases: ["orders database"] },
830
+ { name: "CRM", role: "source", aliases: ["crm leads"] },
831
+ { name: "Warehouse", role: "destination" },
832
+ { name: "Lakehouse", role: "destination" },
833
+ { name: "Campaigns", role: "action", aliases: ["campaign"] },
834
+ { name: "Team Chat", role: "notify", aliases: ["chat", "alert the team"] }
835
+ ];
836
+ var WORKFLOW_SHOWCASE_DEFAULT_EXAMPLES = [
837
+ {
838
+ id: "hourly-sync",
839
+ label: "Storefront orders \u2192 Warehouse, hourly",
840
+ prompt: "Sync Storefront orders to Warehouse every hour, alert sales in Team Chat"
841
+ },
842
+ {
843
+ id: "daily-load",
844
+ label: "Payments payouts \u2192 Lakehouse, daily",
845
+ prompt: "Load Payments payouts into Lakehouse daily"
846
+ },
847
+ {
848
+ id: "realtime-stream",
849
+ label: "Orders DB changes \u2192 Warehouse + Team Chat",
850
+ prompt: "Stream Orders DB changes to Warehouse in real-time and notify Team Chat"
851
+ }
852
+ ];
853
+ var WORKFLOW_SHOWCASE_DEFAULT_METRICS = [
854
+ { id: "throughput", value: 2341, buildingValue: 842, unit: "rows/min", label: "THROUGHPUT" },
855
+ {
856
+ id: "latency",
857
+ value: 0.8,
858
+ buildingValue: 1.1,
859
+ decimals: 1,
860
+ unit: "s latency",
861
+ label: "SYNC SPEED"
862
+ },
863
+ { id: "cost", value: 43, prefix: "\u2212", suffix: "%", label: "COST VS BASELINE", tone: "success" }
864
+ ];
865
+ var WORKFLOW_SHOWCASE_SCHEDULES = ["AUTO", "HOURLY", "DAILY", "REAL-TIME"];
866
+ var WORKFLOW_SHOWCASE_DEFAULT_TILES = [
867
+ "ELT",
868
+ "CDC",
869
+ "DAG",
870
+ "CRON",
871
+ "HEAL",
872
+ "COST",
873
+ "API",
874
+ "LOG"
875
+ ];
876
+ function escapeRegExp(value) {
877
+ return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
878
+ }
879
+ function mentionsOf(catalog) {
880
+ const out = [];
881
+ for (const connector of catalog) {
882
+ out.push({ connector, pattern: connector.name });
883
+ for (const alias of connector.aliases ?? []) out.push({ connector, pattern: alias });
884
+ }
885
+ return out.sort((a, b) => b.pattern.length - a.pattern.length);
886
+ }
887
+ function detectConnectors(prompt, catalog) {
888
+ const lower = prompt.toLowerCase();
889
+ return catalog.filter((c) => [c.name, ...c.aliases ?? []].some((p) => lower.includes(p.toLowerCase()))).map((c) => c.name);
890
+ }
891
+ function segmentPrompt(prompt, catalog) {
892
+ if (!prompt) return [];
893
+ const mentions = mentionsOf(catalog);
894
+ if (!mentions.length) return [{ text: prompt }];
895
+ const re = new RegExp(`(${mentions.map((m) => escapeRegExp(m.pattern)).join("|")})`, "gi");
896
+ const byPattern = new Map(mentions.map((m) => [m.pattern.toLowerCase(), m.connector]));
897
+ return prompt.split(re).filter((part) => part !== "").map((part) => {
898
+ const connector = byPattern.get(part.toLowerCase());
899
+ return connector ? { text: part, connector } : { text: part };
900
+ });
901
+ }
902
+ function scheduleFromPrompt(prompt) {
903
+ const t = prompt.toLowerCase();
904
+ if (/stream|real.?time|cdc/.test(t)) return "REAL-TIME";
905
+ if (/hour/.test(t)) return "HOURLY";
906
+ if (/dail|every day|nightly/.test(t)) return "DAILY";
907
+ return null;
908
+ }
909
+ var RIGHT_ORDER = {
910
+ source: -1,
911
+ destination: 0,
912
+ action: 1,
913
+ notify: 2
914
+ };
915
+ function resolvePlan(selected, detected, catalog) {
916
+ const byName = new Map(catalog.map((c) => [c.name, c]));
917
+ let names = [.../* @__PURE__ */ new Set([...selected, ...detected])].filter((n) => byName.has(n));
918
+ if (!names.length) {
919
+ const fallback = [
920
+ catalog.find((c) => c.role === "source"),
921
+ catalog.find((c) => c.role === "destination"),
922
+ catalog.find((c) => c.role === "notify")
923
+ ].filter((c) => Boolean(c));
924
+ names = fallback.map((c) => c.name);
925
+ }
926
+ const has = (predicate) => names.some((n) => {
927
+ const c = byName.get(n);
928
+ return Boolean(c && predicate(c));
929
+ });
930
+ if (!has((c) => c.role === "source")) {
931
+ const source = catalog.find((c) => c.role === "source");
932
+ if (source) names = [source.name, ...names];
933
+ }
934
+ if (!has((c) => c.role !== "source")) {
935
+ const sink = catalog.find((c) => c.role === "notify") ?? catalog.find((c) => c.role !== "source");
936
+ if (sink) names = [...names, sink.name];
937
+ }
938
+ const picked = catalog.filter((c) => names.includes(c.name));
939
+ const left = picked.filter((c) => c.role === "source");
940
+ const right = picked.filter((c) => c.role !== "source").sort((a, b) => RIGHT_ORDER[a.role] - RIGHT_ORDER[b.role]);
941
+ const all = [...left, ...right];
942
+ return { left, right, all, totalSteps: all.length + 1 };
943
+ }
944
+ function stepVerb(role) {
945
+ if (role === "notify") return "alert";
946
+ if (role === "action") return "trigger";
947
+ return "load";
948
+ }
949
+ function assembleSteps(plan) {
950
+ return [
951
+ ...plan.left.map((c) => `${c.name.toLowerCase()} extract`),
952
+ "schema map \xB7 14 fields",
953
+ ...plan.right.map((c) => `${c.name.toLowerCase()} ${stepVerb(c.role)}`)
954
+ ];
955
+ }
956
+ function buildActivity(args) {
957
+ const { phase, shown, plan, selected, status } = args;
958
+ const settled = SETTLED_PHASES.includes(phase);
959
+ const lines = [];
960
+ if (phase === "idle") {
961
+ if (!selected.length) {
962
+ lines.push({ id: "wait", text: "\u25B8 waiting for instructions\u2026", tone: "muted" });
963
+ lines.push({ id: "hint", text: "\xB7 type a request or pick apps", tone: "faint" });
964
+ }
965
+ for (const name of selected.slice(-6)) {
966
+ lines.push({ id: `sel-${name}`, text: `+ ${name.toLowerCase()} connected`, tone: "plain" });
967
+ }
968
+ return lines;
969
+ }
970
+ if (phase === "analyzing") {
971
+ for (const name of selected.slice(-4)) {
972
+ lines.push({ id: `sel-${name}`, text: `+ ${name.toLowerCase()} connected`, tone: "muted" });
973
+ }
974
+ lines.push({ id: "status", text: `\u27F3 ${status}`, tone: "active" });
975
+ return lines;
976
+ }
977
+ assembleSteps(plan).forEach((step, i) => {
978
+ if (settled || shown > i) lines.push({ id: `step-${i}`, text: `\u2713 ${step}`, tone: "done" });
979
+ else if (shown === i) lines.push({ id: `step-${i}`, text: `\u27F3 ${step}\u2026`, tone: "active" });
980
+ else lines.push({ id: `step-${i}`, text: `\xB7 ${step} queued`, tone: "muted" });
981
+ });
982
+ if (settled) lines.push({ id: "errors", text: "\u2713 error handling attached", tone: "done" });
983
+ return lines.slice(-8);
984
+ }
985
+ function slugify(value) {
986
+ return value.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "") || "your-team";
987
+ }
988
+ function isValidEmail(value) {
989
+ return /^\S+@\S+\.\S+$/.test(value.trim());
990
+ }
991
+
992
+ // src/marketing/components/WorkflowShowcase/WorkflowShowcase.tsx
993
+ var import_framer_motion7 = require("framer-motion");
994
+ var import_react20 = require("react");
995
+
996
+ // src/marketing/components/WorkflowShowcase/ShowcaseScene.tsx
997
+ var import_react5 = require("react");
998
+ var import_jsx_runtime14 = require("react/jsx-runtime");
999
+ function slots(n) {
1000
+ return Array.from({ length: n }, (_, i) => 208 + (i - (n - 1) / 2) * 80);
1001
+ }
1002
+ var leftGuide = (cy) => `M74 ${cy} H150 V228 H193`;
1003
+ var rightGuide = (cy) => `M263 228 H340 V${cy} H388`;
1004
+ function particlesFor(side, index, path, active, fast) {
1005
+ const base2 = index * 0.4 + (side === "r" ? 0.5 : 0);
1006
+ const duration = fast ? active ? "1.1s" : "2.6s" : active ? "2.2s" : "4.8s";
1007
+ const size = active ? 8 : 6;
1008
+ const out = [
1009
+ { key: `${side}${index}-a`, path, size, duration, delay: `${base2}s`, variant: "lead" },
1010
+ {
1011
+ key: `${side}${index}-b`,
1012
+ path,
1013
+ size,
1014
+ duration,
1015
+ delay: `${base2 + (active ? 1.1 : 2.4)}s`,
1016
+ variant: "echo"
1017
+ }
1018
+ ];
1019
+ if (active) {
1020
+ out.push({
1021
+ key: `${side}${index}-c`,
1022
+ path,
1023
+ size: 6,
1024
+ duration,
1025
+ delay: `${base2 + 0.55}s`,
1026
+ variant: "spark"
1027
+ });
1028
+ }
1029
+ return out;
1030
+ }
1031
+ function DefaultCoreGlyph() {
1032
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("svg", { viewBox: "0 0 24 24", width: "30", height: "30", fill: "none", "aria-hidden": "true", children: [
1033
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("rect", { x: "3", y: "3", width: "18", height: "18", rx: "1", stroke: "currentColor", strokeWidth: "1.6" }),
1034
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1035
+ "path",
1036
+ {
1037
+ d: "M7 12h7M11.5 8.5 15 12l-3.5 3.5",
1038
+ stroke: "currentColor",
1039
+ strokeWidth: "1.6",
1040
+ strokeLinecap: "round",
1041
+ strokeLinejoin: "round"
1042
+ }
1043
+ )
1044
+ ] });
1045
+ }
1046
+ function CubeFace({ connector }) {
1047
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1048
+ "span",
1049
+ {
1050
+ className: cn(
1051
+ "ods-showcase__apptile",
1052
+ "ods-showcase__apptile--lg",
1053
+ `ods-showcase__apptile--${connector.role}`
1054
+ ),
1055
+ children: connector.icon ?? roleGlyph(connector.role, 18)
1056
+ }
1057
+ );
1058
+ }
1059
+ function ShowcaseScene({
1060
+ left,
1061
+ right,
1062
+ engaged,
1063
+ tiles,
1064
+ coreIcon,
1065
+ caption
1066
+ }) {
1067
+ const [pulse, setPulse] = (0, import_react5.useState)(false);
1068
+ const pulseTimer = (0, import_react5.useRef)(null);
1069
+ (0, import_react5.useEffect)(
1070
+ () => () => {
1071
+ if (pulseTimer.current) clearTimeout(pulseTimer.current);
1072
+ },
1073
+ []
1074
+ );
1075
+ const firePulse = () => {
1076
+ if (pulse) return;
1077
+ setPulse(true);
1078
+ pulseTimer.current = setTimeout(() => setPulse(false), 1500);
1079
+ };
1080
+ const leftYs = slots(left.length);
1081
+ const rightYs = slots(right.length);
1082
+ const guides = [];
1083
+ const particles = [];
1084
+ left.forEach((node, i) => {
1085
+ const d = leftGuide(leftYs[i]);
1086
+ const on = engaged && node.active;
1087
+ guides.push({ d, on, delay: `${i * 0.2}s` });
1088
+ particles.push(...particlesFor("l", i, d, on, pulse));
1089
+ });
1090
+ right.forEach((node, j) => {
1091
+ const d = rightGuide(rightYs[j]);
1092
+ const on = engaged && node.active;
1093
+ guides.push({ d, on, delay: `${j * 0.2 + 0.3}s` });
1094
+ particles.push(...particlesFor("r", j, d, on, pulse));
1095
+ });
1096
+ if (!left.length) guides.push({ d: leftGuide(208), on: false, delay: "0s" });
1097
+ if (!right.length) guides.push({ d: rightGuide(208), on: false, delay: "0s" });
1098
+ const pins = [];
1099
+ for (let x = 118; x <= 338; x += 20) {
1100
+ pins.push({ d: `M${x} 346 L${x} 368`, accent: x / 20 % 4 === 0 });
1101
+ }
1102
+ for (let y = 118; y <= 338; y += 20) {
1103
+ pins.push({ d: `M346 ${y} L368 ${y}`, accent: y / 20 % 4 === 1 });
1104
+ }
1105
+ const tilePositions = [
1106
+ { left: 8, top: 8 },
1107
+ { left: 83, top: 8 },
1108
+ { left: 158, top: 8 },
1109
+ { left: 8, top: 83 },
1110
+ { left: 158, top: 83 },
1111
+ { left: 8, top: 158 },
1112
+ { left: 83, top: 158 },
1113
+ { left: 158, top: 158 }
1114
+ ];
1115
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "ods-showcase__scene", "aria-hidden": "true", children: [
1116
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "ods-showcase__scene-stage", children: [
1117
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("svg", { className: "ods-showcase__wires", width: "460", height: "460", "aria-hidden": "true", children: [
1118
+ pins.map((pin) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1119
+ "path",
1120
+ {
1121
+ d: pin.d,
1122
+ className: cn("ods-showcase__pin", pin.accent && "ods-showcase__pin--accent")
1123
+ },
1124
+ pin.d
1125
+ )),
1126
+ guides.map((guide) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("g", { children: [
1127
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: guide.d, className: "ods-showcase__guide" }),
1128
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1129
+ "path",
1130
+ {
1131
+ d: guide.d,
1132
+ className: cn(
1133
+ "ods-showcase__guide-trace",
1134
+ guide.on && "ods-showcase__guide-trace--on"
1135
+ ),
1136
+ style: { animationDelay: guide.delay }
1137
+ }
1138
+ )
1139
+ ] }, guide.d))
1140
+ ] }),
1141
+ particles.map((p) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1142
+ "span",
1143
+ {
1144
+ className: cn("ods-showcase__particle", `ods-showcase__particle--${p.variant}`),
1145
+ style: {
1146
+ width: p.size,
1147
+ height: p.size,
1148
+ offsetPath: `path('${p.path}')`,
1149
+ animationDuration: p.duration,
1150
+ animationDelay: p.delay
1151
+ }
1152
+ },
1153
+ p.key
1154
+ )),
1155
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "ods-showcase__platform", children: [
1156
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "ods-showcase__platform-south" }),
1157
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "ods-showcase__platform-east" }),
1158
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "ods-showcase__platform-top" }),
1159
+ tiles.slice(0, 8).map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1160
+ "span",
1161
+ {
1162
+ className: "ods-showcase__tile",
1163
+ style: { left: tilePositions[i].left, top: tilePositions[i].top },
1164
+ children: label
1165
+ },
1166
+ label
1167
+ )),
1168
+ pulse && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "ods-showcase__core-ring" }),
1169
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", tabIndex: -1, className: "ods-showcase__core", onClick: firePulse, children: [
1170
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "ods-showcase__core-south" }),
1171
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "ods-showcase__core-east" }),
1172
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "ods-showcase__core-top", children: coreIcon ?? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DefaultCoreGlyph, {}) })
1173
+ ] })
1174
+ ] }),
1175
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "ods-showcase__floater ods-showcase__floater--a" }),
1176
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "ods-showcase__floater ods-showcase__floater--b" }),
1177
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "ods-showcase__floater ods-showcase__floater--c" }),
1178
+ !left.length && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "ods-showcase__ghost", style: { left: 8, top: 178 }, children: "+" }),
1179
+ !right.length && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "ods-showcase__ghost", style: { left: 392, top: 178 }, children: "+" }),
1180
+ left.map((node, i) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
1181
+ "span",
1182
+ {
1183
+ className: cn(
1184
+ "ods-showcase__cube",
1185
+ node.active && "ods-showcase__cube--active",
1186
+ i % 2 ? "ods-showcase__cube--float-b" : "ods-showcase__cube--float-a"
1187
+ ),
1188
+ style: { left: 8, top: leftYs[i] - 30, animationDelay: `${i * 0.15}s` },
1189
+ children: [
1190
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "ods-showcase__cube-south" }),
1191
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "ods-showcase__cube-east" }),
1192
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "ods-showcase__cube-top", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CubeFace, { connector: node.connector }) })
1193
+ ]
1194
+ },
1195
+ node.connector.name
1196
+ )),
1197
+ right.map((node, j) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
1198
+ "span",
1199
+ {
1200
+ className: cn(
1201
+ "ods-showcase__cube",
1202
+ node.active && "ods-showcase__cube--active",
1203
+ j % 2 ? "ods-showcase__cube--float-a" : "ods-showcase__cube--float-b"
1204
+ ),
1205
+ style: { left: 392, top: rightYs[j] - 30, animationDelay: `${j * 0.15}s` },
1206
+ children: [
1207
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "ods-showcase__cube-south" }),
1208
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "ods-showcase__cube-east" }),
1209
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "ods-showcase__cube-top", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CubeFace, { connector: node.connector }) })
1210
+ ]
1211
+ },
1212
+ node.connector.name
1213
+ ))
1214
+ ] }),
1215
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "ods-showcase__scene-caption", children: caption })
1216
+ ] });
1217
+ }
1218
+
1219
+ // src/marketing/components/WorkflowShowcase/ShowcaseSignup.tsx
1220
+ var import_framer_motion6 = require("framer-motion");
1221
+ var import_react19 = require("react");
1222
+ var import_react_aria4 = require("react-aria");
1223
+
1224
+ // src/components/Input/Input.tsx
1225
+ var import_icons = require("@octaviaflow/icons");
1226
+ var import_react6 = require("react");
1227
+ var import_jsx_runtime15 = require("react/jsx-runtime");
1228
+ var CLEAR_GLYPH = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_icons.CloseIcon, { width: 12, height: 12, "aria-hidden": "true" });
1229
+ var Input = (0, import_react6.forwardRef)(
1230
+ ({
1231
+ type = "text",
1232
+ size = "md",
1233
+ error = false,
1234
+ errorMessage,
1235
+ label,
1236
+ helperText,
1237
+ leftIcon,
1238
+ rightIcon,
1239
+ clearable,
1240
+ onClear,
1241
+ shortcutHint,
1242
+ disabled = false,
1243
+ required,
1244
+ id,
1245
+ className,
1246
+ value,
1247
+ defaultValue,
1248
+ onChange,
1249
+ onKeyDown,
1250
+ ...props
1251
+ }, forwardedRef) => {
1252
+ const innerRef = (0, import_react6.useRef)(null);
1253
+ (0, import_react6.useImperativeHandle)(forwardedRef, () => innerRef.current);
1254
+ const reactId = (0, import_react6.useId)();
1255
+ const inputId = id ?? `${reactId}-input`;
1256
+ const errorId = `${reactId}-err`;
1257
+ const helperId = `${reactId}-help`;
1258
+ const isControlled = value !== void 0;
1259
+ const isClearable = (clearable ?? type === "search") && !disabled;
1260
+ const isSearch = type === "search";
1261
+ const currentValue = isControlled ? String(value ?? "") : innerRef.current?.value ?? String(defaultValue ?? "");
1262
+ const showClear = isClearable && currentValue.length > 0;
1263
+ const clearValue = () => {
1264
+ const el = innerRef.current;
1265
+ if (el && !isControlled) {
1266
+ const setter = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set;
1267
+ setter?.call(el, "");
1268
+ el.dispatchEvent(new Event("input", { bubbles: true }));
1269
+ }
1270
+ onClear?.();
1271
+ el?.focus();
1272
+ };
1273
+ const handleClear = (e) => {
1274
+ e.preventDefault();
1275
+ e.stopPropagation();
1276
+ clearValue();
1277
+ };
1278
+ const handleKeyDown = (e) => {
1279
+ onKeyDown?.(e);
1280
+ if (e.defaultPrevented) return;
1281
+ if (isClearable && isSearch && e.key === "Escape" && currentValue) {
1282
+ e.preventDefault();
1283
+ clearValue();
1284
+ }
1285
+ };
1286
+ const describedBy = error && errorMessage ? errorId : helperText ? helperId : void 0;
1287
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
1288
+ "div",
1289
+ {
1290
+ className: cn(
1291
+ "ods-input",
1292
+ `ods-input--${size}`,
1293
+ error && "ods-input--error",
1294
+ disabled && "ods-input--disabled",
1295
+ isSearch && "ods-input--search",
1296
+ className
1297
+ ),
1298
+ children: [
1299
+ label && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { htmlFor: inputId, className: "ods-input__label", children: [
1300
+ label,
1301
+ required && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "ods-input__required", "aria-hidden": "true", children: "*" })
1302
+ ] }),
1303
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "ods-input__wrapper", children: [
1304
+ leftIcon && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "ods-input__icon--left", "aria-hidden": "true", children: leftIcon }),
1305
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1306
+ "input",
1307
+ {
1308
+ ...props,
1309
+ id: inputId,
1310
+ ref: innerRef,
1311
+ type,
1312
+ disabled,
1313
+ required,
1314
+ value,
1315
+ defaultValue,
1316
+ onChange,
1317
+ onKeyDown: handleKeyDown,
1318
+ className: cn(
1319
+ "ods-input__field",
1320
+ leftIcon && "ods-input__field--with-left-icon",
1321
+ (rightIcon || showClear || shortcutHint) && "ods-input__field--with-right-icon",
1322
+ showClear && shortcutHint && "ods-input__field--with-right-actions"
1323
+ ),
1324
+ "aria-invalid": error || void 0,
1325
+ "aria-required": required || void 0,
1326
+ "aria-describedby": describedBy
1327
+ }
1328
+ ),
1329
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "ods-input__right", children: [
1330
+ showClear && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1331
+ "button",
1332
+ {
1333
+ type: "button",
1334
+ className: "ods-input__clear",
1335
+ onClick: handleClear,
1336
+ "aria-label": "Clear",
1337
+ tabIndex: -1,
1338
+ children: CLEAR_GLYPH
1339
+ }
1340
+ ),
1341
+ shortcutHint && !showClear && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "ods-input__kbd", "aria-hidden": "true", children: shortcutHint }),
1342
+ rightIcon && !showClear && !shortcutHint && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "ods-input__icon--right", "aria-hidden": "true", children: rightIcon })
1343
+ ] })
1344
+ ] }),
1345
+ error && errorMessage && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { id: errorId, className: "ods-input__error-message", role: "alert", children: errorMessage }),
1346
+ !error && helperText && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { id: helperId, className: "ods-input__helper", children: helperText })
1347
+ ]
1348
+ }
1349
+ );
1350
+ }
1351
+ );
1352
+ Input.displayName = "Input";
1353
+
1354
+ // src/components/Select/Select.tsx
1355
+ var import_framer_motion5 = require("framer-motion");
1356
+ var import_react18 = require("react");
1357
+ var import_react_aria3 = require("react-aria");
1358
+ var import_react_dom2 = require("react-dom");
1359
+
1360
+ // ../../node_modules/react-stately/dist/private/utils/useControlledState.mjs
1361
+ var import_react7 = __toESM(require("react"), 1);
1362
+ var $3e6197669829fe11$var$useEarlyEffect = typeof document !== "undefined" ? (0, import_react7.default)["useInsertionEffect"] ?? (0, import_react7.default).useLayoutEffect : () => {
1363
+ };
1364
+ function $3e6197669829fe11$export$40bfa8c7b0832715(value, defaultValue, onChange) {
1365
+ let [stateValue, setStateValue] = (0, import_react7.useState)(value || defaultValue);
1366
+ let valueRef = (0, import_react7.useRef)(stateValue);
1367
+ let isControlledRef = (0, import_react7.useRef)(value !== void 0);
1368
+ let isControlled = value !== void 0;
1369
+ (0, import_react7.useEffect)(() => {
1370
+ let wasControlled = isControlledRef.current;
1371
+ if (wasControlled !== isControlled && process.env.NODE_ENV !== "production") console.warn(`WARN: A component changed from ${wasControlled ? "controlled" : "uncontrolled"} to ${isControlled ? "controlled" : "uncontrolled"}.`);
1372
+ isControlledRef.current = isControlled;
1373
+ }, [
1374
+ isControlled
1375
+ ]);
1376
+ let currentValue = isControlled ? value : stateValue;
1377
+ $3e6197669829fe11$var$useEarlyEffect(() => {
1378
+ valueRef.current = currentValue;
1379
+ });
1380
+ let [, forceUpdate] = (0, import_react7.useReducer)(() => ({}), {});
1381
+ let setValue = (0, import_react7.useCallback)((value2, ...args) => {
1382
+ let newValue = typeof value2 === "function" ? value2(valueRef.current) : value2;
1383
+ if (!Object.is(valueRef.current, newValue)) {
1384
+ valueRef.current = newValue;
1385
+ setStateValue(newValue);
1386
+ forceUpdate();
1387
+ onChange?.(newValue, ...args);
1388
+ }
1389
+ }, [
1390
+ onChange
1391
+ ]);
1392
+ return [
1393
+ currentValue,
1394
+ setValue
1395
+ ];
1396
+ }
1397
+
1398
+ // ../../node_modules/react-stately/dist/private/form/useFormValidationState.mjs
1399
+ var import_react8 = require("react");
1400
+ var $fd2148440a13ec26$export$aca958c65c314e6c = {
1401
+ badInput: false,
1402
+ customError: false,
1403
+ patternMismatch: false,
1404
+ rangeOverflow: false,
1405
+ rangeUnderflow: false,
1406
+ stepMismatch: false,
1407
+ tooLong: false,
1408
+ tooShort: false,
1409
+ typeMismatch: false,
1410
+ valueMissing: false,
1411
+ valid: true
1412
+ };
1413
+ var $fd2148440a13ec26$var$CUSTOM_VALIDITY_STATE = {
1414
+ ...$fd2148440a13ec26$export$aca958c65c314e6c,
1415
+ customError: true,
1416
+ valid: false
1417
+ };
1418
+ var $fd2148440a13ec26$export$dad6ae84456c676a = {
1419
+ isInvalid: false,
1420
+ validationDetails: $fd2148440a13ec26$export$aca958c65c314e6c,
1421
+ validationErrors: []
1422
+ };
1423
+ var $fd2148440a13ec26$export$571b5131b7e65c11 = (0, import_react8.createContext)({});
1424
+ var $fd2148440a13ec26$export$a763b9476acd3eb = "__reactAriaFormValidationState";
1425
+ function $fd2148440a13ec26$export$fc1a364ae1f3ff10(props) {
1426
+ if (props[$fd2148440a13ec26$export$a763b9476acd3eb]) {
1427
+ let { realtimeValidation, displayValidation, updateValidation, resetValidation, commitValidation } = props[$fd2148440a13ec26$export$a763b9476acd3eb];
1428
+ return {
1429
+ realtimeValidation,
1430
+ displayValidation,
1431
+ updateValidation,
1432
+ resetValidation,
1433
+ commitValidation
1434
+ };
1435
+ }
1436
+ return $fd2148440a13ec26$var$useFormValidationStateImpl(props);
1437
+ }
1438
+ function $fd2148440a13ec26$var$useFormValidationStateImpl(props) {
1439
+ let { isInvalid, validationState, name, value, builtinValidation, validate, validationBehavior = "aria" } = props;
1440
+ if (validationState) isInvalid ||= validationState === "invalid";
1441
+ let controlledError = isInvalid !== void 0 ? {
1442
+ isInvalid,
1443
+ validationErrors: [],
1444
+ validationDetails: $fd2148440a13ec26$var$CUSTOM_VALIDITY_STATE
1445
+ } : null;
1446
+ let clientError = (0, import_react8.useMemo)(() => {
1447
+ if (!validate || value == null) return null;
1448
+ let validateErrors = $fd2148440a13ec26$var$runValidate(validate, value);
1449
+ return $fd2148440a13ec26$var$getValidationResult(validateErrors);
1450
+ }, [
1451
+ validate,
1452
+ value
1453
+ ]);
1454
+ if (builtinValidation?.validationDetails.valid) builtinValidation = void 0;
1455
+ let serverErrors = (0, import_react8.useContext)($fd2148440a13ec26$export$571b5131b7e65c11);
1456
+ let serverErrorMessages = (0, import_react8.useMemo)(() => {
1457
+ if (name) return Array.isArray(name) ? name.flatMap((name2) => $fd2148440a13ec26$var$asArray(serverErrors[name2])) : $fd2148440a13ec26$var$asArray(serverErrors[name]);
1458
+ return [];
1459
+ }, [
1460
+ serverErrors,
1461
+ name
1462
+ ]);
1463
+ let [lastServerErrors, setLastServerErrors] = (0, import_react8.useState)(serverErrors);
1464
+ let [isServerErrorCleared, setServerErrorCleared] = (0, import_react8.useState)(false);
1465
+ if (serverErrors !== lastServerErrors) {
1466
+ setLastServerErrors(serverErrors);
1467
+ setServerErrorCleared(false);
1468
+ }
1469
+ let serverError = (0, import_react8.useMemo)(() => $fd2148440a13ec26$var$getValidationResult(isServerErrorCleared ? [] : serverErrorMessages), [
1470
+ isServerErrorCleared,
1471
+ serverErrorMessages
1472
+ ]);
1473
+ let nextValidation = (0, import_react8.useRef)($fd2148440a13ec26$export$dad6ae84456c676a);
1474
+ let [currentValidity, setCurrentValidity] = (0, import_react8.useState)($fd2148440a13ec26$export$dad6ae84456c676a);
1475
+ let lastError = (0, import_react8.useRef)($fd2148440a13ec26$export$dad6ae84456c676a);
1476
+ let commitValidation = () => {
1477
+ if (!commitQueued) return;
1478
+ setCommitQueued(false);
1479
+ let error = clientError || builtinValidation || nextValidation.current;
1480
+ if (!$fd2148440a13ec26$var$isEqualValidation(error, lastError.current)) {
1481
+ lastError.current = error;
1482
+ setCurrentValidity(error);
1483
+ }
1484
+ };
1485
+ let [commitQueued, setCommitQueued] = (0, import_react8.useState)(false);
1486
+ (0, import_react8.useEffect)(commitValidation);
1487
+ let realtimeValidation = controlledError || serverError || clientError || builtinValidation || $fd2148440a13ec26$export$dad6ae84456c676a;
1488
+ let displayValidation = validationBehavior === "native" ? controlledError || serverError || currentValidity : controlledError || serverError || clientError || builtinValidation || currentValidity;
1489
+ return {
1490
+ realtimeValidation,
1491
+ displayValidation,
1492
+ updateValidation(value2) {
1493
+ if (validationBehavior === "aria" && !$fd2148440a13ec26$var$isEqualValidation(currentValidity, value2)) setCurrentValidity(value2);
1494
+ else nextValidation.current = value2;
1495
+ },
1496
+ resetValidation() {
1497
+ let error = $fd2148440a13ec26$export$dad6ae84456c676a;
1498
+ if (!$fd2148440a13ec26$var$isEqualValidation(error, lastError.current)) {
1499
+ lastError.current = error;
1500
+ setCurrentValidity(error);
1501
+ }
1502
+ if (validationBehavior === "native") setCommitQueued(false);
1503
+ setServerErrorCleared(true);
1504
+ },
1505
+ commitValidation() {
1506
+ if (validationBehavior === "native") setCommitQueued(true);
1507
+ setServerErrorCleared(true);
1508
+ }
1509
+ };
1510
+ }
1511
+ function $fd2148440a13ec26$var$asArray(v) {
1512
+ if (!v) return [];
1513
+ return Array.isArray(v) ? v : [
1514
+ v
1515
+ ];
1516
+ }
1517
+ function $fd2148440a13ec26$var$runValidate(validate, value) {
1518
+ if (typeof validate === "function") {
1519
+ let e = validate(value);
1520
+ if (e && typeof e !== "boolean") return $fd2148440a13ec26$var$asArray(e);
1521
+ }
1522
+ return [];
1523
+ }
1524
+ function $fd2148440a13ec26$var$getValidationResult(errors) {
1525
+ return errors.length ? {
1526
+ isInvalid: true,
1527
+ validationErrors: errors,
1528
+ validationDetails: $fd2148440a13ec26$var$CUSTOM_VALIDITY_STATE
1529
+ } : null;
1530
+ }
1531
+ function $fd2148440a13ec26$var$isEqualValidation(a, b) {
1532
+ if (a === b) return true;
1533
+ return !!a && !!b && a.isInvalid === b.isInvalid && a.validationErrors.length === b.validationErrors.length && a.validationErrors.every((a2, i) => a2 === b.validationErrors[i]) && Object.entries(a.validationDetails).every(([k, v]) => b.validationDetails[k] === v);
1534
+ }
1535
+
1536
+ // ../../node_modules/react-stately/dist/private/collections/getChildNodes.mjs
1537
+ function $cd5ea4b915021f1d$export$1005530eda016c13(node, collection) {
1538
+ if (typeof collection.getChildren === "function") return collection.getChildren(node.key);
1539
+ return node.childNodes;
1540
+ }
1541
+ function $cd5ea4b915021f1d$export$fbdeaa6a76694f71(iterable) {
1542
+ return $cd5ea4b915021f1d$export$5f3398f8733f90e2(iterable, 0);
1543
+ }
1544
+ function $cd5ea4b915021f1d$export$5f3398f8733f90e2(iterable, index) {
1545
+ if (index < 0) return void 0;
1546
+ let i = 0;
1547
+ for (let item of iterable) {
1548
+ if (i === index) return item;
1549
+ i++;
1550
+ }
1551
+ }
1552
+ function $cd5ea4b915021f1d$export$8c434b3a7a4dad6(collection, a, b) {
1553
+ if (a.parentKey === b.parentKey) return a.index - b.index;
1554
+ let aAncestors = [
1555
+ ...$cd5ea4b915021f1d$var$getAncestors(collection, a),
1556
+ a
1557
+ ];
1558
+ let bAncestors = [
1559
+ ...$cd5ea4b915021f1d$var$getAncestors(collection, b),
1560
+ b
1561
+ ];
1562
+ let firstNonMatchingAncestor = aAncestors.slice(0, bAncestors.length).findIndex((a2, i) => a2 !== bAncestors[i]);
1563
+ if (firstNonMatchingAncestor !== -1) {
1564
+ a = aAncestors[firstNonMatchingAncestor];
1565
+ b = bAncestors[firstNonMatchingAncestor];
1566
+ return a.index - b.index;
1567
+ }
1568
+ if (aAncestors.findIndex((node) => node === b) >= 0) return 1;
1569
+ else if (bAncestors.findIndex((node) => node === a) >= 0) return -1;
1570
+ return -1;
1571
+ }
1572
+ function $cd5ea4b915021f1d$var$getAncestors(collection, node) {
1573
+ let parents = [];
1574
+ let currNode = node;
1575
+ while (currNode?.parentKey != null) {
1576
+ currNode = collection.getItem(currNode.parentKey);
1577
+ if (currNode) parents.unshift(currNode);
1578
+ }
1579
+ return parents;
1580
+ }
1581
+
1582
+ // ../../node_modules/react-stately/dist/private/list/ListCollection.mjs
1583
+ var $f664a81d022446b5$export$d085fb9e920b5ca7 = class {
1584
+ constructor(nodes) {
1585
+ this.keyMap = /* @__PURE__ */ new Map();
1586
+ this.firstKey = null;
1587
+ this.lastKey = null;
1588
+ this.iterable = nodes;
1589
+ let visit = (node) => {
1590
+ this.keyMap.set(node.key, node);
1591
+ if (node.childNodes && node.type === "section") for (let child of node.childNodes) visit(child);
1592
+ };
1593
+ for (let node of nodes) visit(node);
1594
+ let last = null;
1595
+ let index = 0;
1596
+ let size = 0;
1597
+ for (let [key, node] of this.keyMap) {
1598
+ if (last) {
1599
+ last.nextKey = key;
1600
+ node.prevKey = last.key;
1601
+ } else {
1602
+ this.firstKey = key;
1603
+ node.prevKey = void 0;
1604
+ }
1605
+ if (node.type === "item") node.index = index++;
1606
+ if (node.type === "section" || node.type === "item") size++;
1607
+ last = node;
1608
+ last.nextKey = void 0;
1609
+ }
1610
+ this._size = size;
1611
+ this.lastKey = last?.key ?? null;
1612
+ }
1613
+ *[Symbol.iterator]() {
1614
+ yield* this.iterable;
1615
+ }
1616
+ get size() {
1617
+ return this._size;
1618
+ }
1619
+ getKeys() {
1620
+ return this.keyMap.keys();
1621
+ }
1622
+ getKeyBefore(key) {
1623
+ let node = this.keyMap.get(key);
1624
+ return node ? node.prevKey ?? null : null;
1625
+ }
1626
+ getKeyAfter(key) {
1627
+ let node = this.keyMap.get(key);
1628
+ return node ? node.nextKey ?? null : null;
1629
+ }
1630
+ getFirstKey() {
1631
+ return this.firstKey;
1632
+ }
1633
+ getLastKey() {
1634
+ return this.lastKey;
1635
+ }
1636
+ getItem(key) {
1637
+ return this.keyMap.get(key) ?? null;
1638
+ }
1639
+ at(idx) {
1640
+ const keys = [
1641
+ ...this.getKeys()
1642
+ ];
1643
+ return this.getItem(keys[idx]);
1644
+ }
1645
+ getChildren(key) {
1646
+ let node = this.keyMap.get(key);
1647
+ return node?.childNodes || [];
1648
+ }
1649
+ };
1650
+
1651
+ // ../../node_modules/react-stately/dist/private/selection/Selection.mjs
1652
+ var $8b2540e09867b15e$export$52baac22726c72bf = class _$8b2540e09867b15e$export$52baac22726c72bf extends Set {
1653
+ constructor(keys, anchorKey, currentKey) {
1654
+ super(keys);
1655
+ if (keys instanceof _$8b2540e09867b15e$export$52baac22726c72bf) {
1656
+ this.anchorKey = anchorKey ?? keys.anchorKey;
1657
+ this.currentKey = currentKey ?? keys.currentKey;
1658
+ } else {
1659
+ this.anchorKey = anchorKey ?? null;
1660
+ this.currentKey = currentKey ?? null;
1661
+ }
1662
+ }
1663
+ };
1664
+
1665
+ // ../../node_modules/react-stately/dist/private/selection/useMultipleSelectionState.mjs
1666
+ var import_react9 = require("react");
1667
+ function $60f19cefd567a3e4$var$equalSets(setA, setB) {
1668
+ if (setA.size !== setB.size) return false;
1669
+ for (let item of setA) {
1670
+ if (!setB.has(item)) return false;
1671
+ }
1672
+ return true;
1673
+ }
1674
+ function $60f19cefd567a3e4$export$253fe78d46329472(props) {
1675
+ let { selectionMode = "none", disallowEmptySelection = false, allowDuplicateSelectionEvents, selectionBehavior: selectionBehaviorProp = "toggle", disabledBehavior = "all" } = props;
1676
+ let isFocusedRef = (0, import_react9.useRef)(false);
1677
+ let [, setFocused] = (0, import_react9.useState)(false);
1678
+ let focusedKeyRef = (0, import_react9.useRef)(null);
1679
+ let childFocusStrategyRef = (0, import_react9.useRef)(null);
1680
+ let [, setFocusedKey] = (0, import_react9.useState)(null);
1681
+ let selectedKeysProp = (0, import_react9.useMemo)(() => $60f19cefd567a3e4$var$convertSelection(props.selectedKeys), [
1682
+ props.selectedKeys
1683
+ ]);
1684
+ let defaultSelectedKeys = (0, import_react9.useMemo)(() => $60f19cefd567a3e4$var$convertSelection(props.defaultSelectedKeys, new (0, $8b2540e09867b15e$export$52baac22726c72bf)()), [
1685
+ props.defaultSelectedKeys
1686
+ ]);
1687
+ let [selectedKeys, setSelectedKeys] = (0, $3e6197669829fe11$export$40bfa8c7b0832715)(selectedKeysProp, defaultSelectedKeys, props.onSelectionChange);
1688
+ let disabledKeysProp = (0, import_react9.useMemo)(() => props.disabledKeys ? new Set(props.disabledKeys) : /* @__PURE__ */ new Set(), [
1689
+ props.disabledKeys
1690
+ ]);
1691
+ let [selectionBehavior, setSelectionBehavior] = (0, import_react9.useState)(selectionBehaviorProp);
1692
+ if (selectionBehaviorProp === "replace" && selectionBehavior === "toggle" && typeof selectedKeys === "object" && selectedKeys.size === 0) setSelectionBehavior("replace");
1693
+ let lastSelectionBehavior = (0, import_react9.useRef)(selectionBehaviorProp);
1694
+ (0, import_react9.useEffect)(() => {
1695
+ if (selectionBehaviorProp !== lastSelectionBehavior.current) {
1696
+ setSelectionBehavior(selectionBehaviorProp);
1697
+ lastSelectionBehavior.current = selectionBehaviorProp;
1698
+ }
1699
+ }, [
1700
+ selectionBehaviorProp
1701
+ ]);
1702
+ return {
1703
+ selectionMode,
1704
+ disallowEmptySelection,
1705
+ selectionBehavior,
1706
+ setSelectionBehavior,
1707
+ get isFocused() {
1708
+ return isFocusedRef.current;
1709
+ },
1710
+ setFocused(f) {
1711
+ isFocusedRef.current = f;
1712
+ setFocused(f);
1713
+ },
1714
+ get focusedKey() {
1715
+ return focusedKeyRef.current;
1716
+ },
1717
+ get childFocusStrategy() {
1718
+ return childFocusStrategyRef.current;
1719
+ },
1720
+ setFocusedKey(k, childFocusStrategy = "first") {
1721
+ focusedKeyRef.current = k;
1722
+ childFocusStrategyRef.current = childFocusStrategy;
1723
+ setFocusedKey(k);
1724
+ },
1725
+ selectedKeys,
1726
+ setSelectedKeys(keys) {
1727
+ if (allowDuplicateSelectionEvents || !$60f19cefd567a3e4$var$equalSets(keys, selectedKeys)) setSelectedKeys(keys);
1728
+ },
1729
+ disabledKeys: disabledKeysProp,
1730
+ disabledBehavior
1731
+ };
1732
+ }
1733
+ function $60f19cefd567a3e4$var$convertSelection(selection, defaultValue) {
1734
+ if (!selection) return defaultValue;
1735
+ return selection === "all" ? "all" : new (0, $8b2540e09867b15e$export$52baac22726c72bf)(selection);
1736
+ }
1737
+
1738
+ // ../../node_modules/react-stately/dist/private/selection/SelectionManager.mjs
1739
+ var $4a07ac835f260f78$export$6c8a5aaad13c9852 = class _$4a07ac835f260f78$export$6c8a5aaad13c9852 {
1740
+ constructor(collection, state, options) {
1741
+ this.collection = collection;
1742
+ this.state = state;
1743
+ this.allowsCellSelection = options?.allowsCellSelection ?? false;
1744
+ this._isSelectAll = null;
1745
+ this.layoutDelegate = options?.layoutDelegate || null;
1746
+ this.fullCollection = options?.fullCollection || null;
1747
+ }
1748
+ /**
1749
+ * The type of selection that is allowed in the collection.
1750
+ */
1751
+ get selectionMode() {
1752
+ return this.state.selectionMode;
1753
+ }
1754
+ /**
1755
+ * Whether the collection allows empty selection.
1756
+ */
1757
+ get disallowEmptySelection() {
1758
+ return this.state.disallowEmptySelection;
1759
+ }
1760
+ /**
1761
+ * The selection behavior for the collection.
1762
+ */
1763
+ get selectionBehavior() {
1764
+ return this.state.selectionBehavior;
1765
+ }
1766
+ /**
1767
+ * Sets the selection behavior for the collection.
1768
+ */
1769
+ setSelectionBehavior(selectionBehavior) {
1770
+ this.state.setSelectionBehavior(selectionBehavior);
1771
+ }
1772
+ /**
1773
+ * Whether the collection is currently focused.
1774
+ */
1775
+ get isFocused() {
1776
+ return this.state.isFocused;
1777
+ }
1778
+ /**
1779
+ * Sets whether the collection is focused.
1780
+ */
1781
+ setFocused(isFocused) {
1782
+ this.state.setFocused(isFocused);
1783
+ }
1784
+ /**
1785
+ * The current focused key in the collection.
1786
+ */
1787
+ get focusedKey() {
1788
+ return this.state.focusedKey;
1789
+ }
1790
+ /** Whether the first or last child of the focused key should receive focus. */
1791
+ get childFocusStrategy() {
1792
+ return this.state.childFocusStrategy;
1793
+ }
1794
+ /**
1795
+ * Sets the focused key.
1796
+ */
1797
+ setFocusedKey(key, childFocusStrategy) {
1798
+ if (key == null || this.collection.getItem(key)) this.state.setFocusedKey(key, childFocusStrategy);
1799
+ }
1800
+ /**
1801
+ * The currently selected keys in the collection.
1802
+ */
1803
+ get selectedKeys() {
1804
+ return this.state.selectedKeys === "all" ? new Set(this.getSelectAllKeys()) : this.state.selectedKeys;
1805
+ }
1806
+ /**
1807
+ * The raw selection value for the collection.
1808
+ * Either 'all' for select all, or a set of keys.
1809
+ */
1810
+ get rawSelection() {
1811
+ return this.state.selectedKeys;
1812
+ }
1813
+ /**
1814
+ * Returns whether a key is selected.
1815
+ */
1816
+ isSelected(key) {
1817
+ if (this.state.selectionMode === "none") return false;
1818
+ let mappedKey = this.getKey(key);
1819
+ if (mappedKey == null) return false;
1820
+ return this.state.selectedKeys === "all" ? this.canSelectItem(mappedKey) : this.state.selectedKeys.has(mappedKey);
1821
+ }
1822
+ /**
1823
+ * Whether the selection is empty.
1824
+ */
1825
+ get isEmpty() {
1826
+ return this.state.selectedKeys !== "all" && this.state.selectedKeys.size === 0;
1827
+ }
1828
+ /**
1829
+ * Whether all items in the collection are selected.
1830
+ */
1831
+ get isSelectAll() {
1832
+ if (this.isEmpty) return false;
1833
+ if (this.state.selectedKeys === "all") return true;
1834
+ if (this._isSelectAll != null) return this._isSelectAll;
1835
+ let allKeys = this.getSelectAllKeys();
1836
+ let selectedKeys = this.state.selectedKeys;
1837
+ this._isSelectAll = allKeys.every((k) => selectedKeys.has(k));
1838
+ return this._isSelectAll;
1839
+ }
1840
+ get firstSelectedKey() {
1841
+ let first = null;
1842
+ for (let key of this.state.selectedKeys) {
1843
+ let item = this.collection.getItem(key);
1844
+ if (!first || item && (0, $cd5ea4b915021f1d$export$8c434b3a7a4dad6)(this.collection, item, first) < 0) first = item;
1845
+ }
1846
+ return first?.key ?? null;
1847
+ }
1848
+ get lastSelectedKey() {
1849
+ let last = null;
1850
+ for (let key of this.state.selectedKeys) {
1851
+ let item = this.collection.getItem(key);
1852
+ if (!last || item && (0, $cd5ea4b915021f1d$export$8c434b3a7a4dad6)(this.collection, item, last) > 0) last = item;
1853
+ }
1854
+ return last?.key ?? null;
1855
+ }
1856
+ get disabledKeys() {
1857
+ return this.state.disabledKeys;
1858
+ }
1859
+ get disabledBehavior() {
1860
+ return this.state.disabledBehavior;
1861
+ }
1862
+ /**
1863
+ * Extends the selection to the given key.
1864
+ */
1865
+ extendSelection(toKey) {
1866
+ if (this.selectionMode === "none") return;
1867
+ if (this.selectionMode === "single") {
1868
+ this.replaceSelection(toKey);
1869
+ return;
1870
+ }
1871
+ let mappedToKey = this.getKey(toKey);
1872
+ if (mappedToKey == null) return;
1873
+ let selection;
1874
+ if (this.state.selectedKeys === "all") selection = new (0, $8b2540e09867b15e$export$52baac22726c72bf)([
1875
+ mappedToKey
1876
+ ], mappedToKey, mappedToKey);
1877
+ else {
1878
+ let selectedKeys = this.state.selectedKeys;
1879
+ let anchorKey = selectedKeys.anchorKey ?? mappedToKey;
1880
+ selection = new (0, $8b2540e09867b15e$export$52baac22726c72bf)(selectedKeys, anchorKey, mappedToKey);
1881
+ for (let key of this.getKeyRange(anchorKey, selectedKeys.currentKey ?? mappedToKey)) selection.delete(key);
1882
+ for (let key of this.getKeyRange(mappedToKey, anchorKey)) if (this.canSelectItem(key)) selection.add(key);
1883
+ }
1884
+ this.state.setSelectedKeys(selection);
1885
+ }
1886
+ getKeyRange(from, to) {
1887
+ let fromItem = this.collection.getItem(from);
1888
+ let toItem = this.collection.getItem(to);
1889
+ if (fromItem && toItem) {
1890
+ if ((0, $cd5ea4b915021f1d$export$8c434b3a7a4dad6)(this.collection, fromItem, toItem) <= 0) return this.getKeyRangeInternal(from, to);
1891
+ return this.getKeyRangeInternal(to, from);
1892
+ }
1893
+ return [];
1894
+ }
1895
+ getKeyRangeInternal(from, to) {
1896
+ if (this.layoutDelegate?.getKeyRange) return this.layoutDelegate.getKeyRange(from, to);
1897
+ let keys = [];
1898
+ let key = from;
1899
+ while (key != null) {
1900
+ let item = this.collection.getItem(key);
1901
+ if (item && (item.type === "item" || item.type === "cell" && this.allowsCellSelection)) keys.push(key);
1902
+ if (key === to) return keys;
1903
+ key = this.collection.getKeyAfter(key);
1904
+ }
1905
+ return [];
1906
+ }
1907
+ getKey(key) {
1908
+ let item = this.collection.getItem(key);
1909
+ if (!item)
1910
+ return key;
1911
+ if (item.type === "cell" && this.allowsCellSelection) return key;
1912
+ while (item && item.type !== "item" && item.parentKey != null) item = this.collection.getItem(item.parentKey);
1913
+ if (!item || item.type !== "item") return null;
1914
+ return item.key;
1915
+ }
1916
+ /**
1917
+ * Toggles whether the given key is selected.
1918
+ */
1919
+ toggleSelection(key) {
1920
+ if (this.selectionMode === "none") return;
1921
+ if (this.selectionMode === "single" && !this.isSelected(key)) {
1922
+ this.replaceSelection(key);
1923
+ return;
1924
+ }
1925
+ let mappedKey = this.getKey(key);
1926
+ if (mappedKey == null) return;
1927
+ let keys = new (0, $8b2540e09867b15e$export$52baac22726c72bf)(this.state.selectedKeys === "all" ? this.getSelectAllKeys() : this.state.selectedKeys);
1928
+ if (keys.has(mappedKey)) keys.delete(mappedKey);
1929
+ else if (this.canSelectItem(mappedKey)) {
1930
+ keys.add(mappedKey);
1931
+ keys.anchorKey = mappedKey;
1932
+ keys.currentKey = mappedKey;
1933
+ }
1934
+ if (this.disallowEmptySelection && keys.size === 0) return;
1935
+ this.state.setSelectedKeys(keys);
1936
+ }
1937
+ /**
1938
+ * Replaces the selection with only the given key.
1939
+ */
1940
+ replaceSelection(key) {
1941
+ if (this.selectionMode === "none") return;
1942
+ let mappedKey = this.getKey(key);
1943
+ if (mappedKey == null) return;
1944
+ let selection = this.canSelectItem(mappedKey) ? new (0, $8b2540e09867b15e$export$52baac22726c72bf)([
1945
+ mappedKey
1946
+ ], mappedKey, mappedKey) : new (0, $8b2540e09867b15e$export$52baac22726c72bf)();
1947
+ this.state.setSelectedKeys(selection);
1948
+ }
1949
+ /**
1950
+ * Replaces the selection with the given keys.
1951
+ */
1952
+ setSelectedKeys(keys) {
1953
+ if (this.selectionMode === "none") return;
1954
+ let selection = new (0, $8b2540e09867b15e$export$52baac22726c72bf)();
1955
+ for (let key of keys) {
1956
+ let mappedKey = this.getKey(key);
1957
+ if (mappedKey != null) {
1958
+ selection.add(mappedKey);
1959
+ if (this.selectionMode === "single") break;
1960
+ }
1961
+ }
1962
+ this.state.setSelectedKeys(selection);
1963
+ }
1964
+ getSelectAllKeys() {
1965
+ let collection = this.fullCollection ?? this.collection;
1966
+ let keys = [];
1967
+ let addKeys = (key) => {
1968
+ while (key != null) {
1969
+ if (this.canSelectItemIn(key, collection)) {
1970
+ let item = collection.getItem(key);
1971
+ if (item?.type === "item") keys.push(key);
1972
+ if (item?.hasChildNodes && (this.allowsCellSelection || item.type !== "item")) addKeys((0, $cd5ea4b915021f1d$export$fbdeaa6a76694f71)((0, $cd5ea4b915021f1d$export$1005530eda016c13)(item, collection))?.key ?? null);
1973
+ }
1974
+ key = collection.getKeyAfter(key);
1975
+ }
1976
+ };
1977
+ addKeys(collection.getFirstKey());
1978
+ return keys;
1979
+ }
1980
+ /**
1981
+ * Selects all items in the collection.
1982
+ */
1983
+ selectAll() {
1984
+ if (!this.isSelectAll && this.selectionMode === "multiple") this.state.setSelectedKeys("all");
1985
+ }
1986
+ /**
1987
+ * Removes all keys from the selection.
1988
+ */
1989
+ clearSelection() {
1990
+ if (!this.disallowEmptySelection && (this.state.selectedKeys === "all" || this.state.selectedKeys.size > 0)) this.state.setSelectedKeys(new (0, $8b2540e09867b15e$export$52baac22726c72bf)());
1991
+ }
1992
+ /**
1993
+ * Toggles between select all and an empty selection.
1994
+ */
1995
+ toggleSelectAll() {
1996
+ if (this.isSelectAll) this.clearSelection();
1997
+ else this.selectAll();
1998
+ }
1999
+ select(key, e) {
2000
+ if (this.selectionMode === "none") return;
2001
+ if (this.selectionMode === "single") {
2002
+ if (this.isSelected(key) && !this.disallowEmptySelection) this.toggleSelection(key);
2003
+ else this.replaceSelection(key);
2004
+ } else if (this.selectionBehavior === "toggle" || e && (e.pointerType === "touch" || e.pointerType === "virtual"))
2005
+ this.toggleSelection(key);
2006
+ else this.replaceSelection(key);
2007
+ }
2008
+ /**
2009
+ * Returns whether the current selection is equal to the given selection.
2010
+ */
2011
+ isSelectionEqual(selection) {
2012
+ if (selection === this.state.selectedKeys) return true;
2013
+ let selectedKeys = this.selectedKeys;
2014
+ if (selection.size !== selectedKeys.size) return false;
2015
+ for (let key of selection) {
2016
+ if (!selectedKeys.has(key)) return false;
2017
+ }
2018
+ for (let key of selectedKeys) {
2019
+ if (!selection.has(key)) return false;
2020
+ }
2021
+ return true;
2022
+ }
2023
+ canSelectItem(key) {
2024
+ return this.canSelectItemIn(key, this.collection);
2025
+ }
2026
+ canSelectItemIn(key, collection) {
2027
+ if (this.state.selectionMode === "none" || this.state.disabledKeys.has(key)) return false;
2028
+ let item = collection.getItem(key);
2029
+ if (!item || item?.props?.isDisabled || item.type === "cell" && !this.allowsCellSelection) return false;
2030
+ return true;
2031
+ }
2032
+ isDisabled(key) {
2033
+ return this.state.disabledBehavior === "all" && (this.state.disabledKeys.has(key) || !!this.collection.getItem(key)?.props?.isDisabled);
2034
+ }
2035
+ isLink(key) {
2036
+ return !!this.collection.getItem(key)?.props?.href;
2037
+ }
2038
+ getItemProps(key) {
2039
+ return this.collection.getItem(key)?.props;
2040
+ }
2041
+ withCollection(collection) {
2042
+ return new _$4a07ac835f260f78$export$6c8a5aaad13c9852(collection, this.state, {
2043
+ allowsCellSelection: this.allowsCellSelection,
2044
+ layoutDelegate: this.layoutDelegate || void 0,
2045
+ fullCollection: this.fullCollection ?? this.collection
2046
+ });
2047
+ }
2048
+ };
2049
+
2050
+ // ../../node_modules/react-stately/dist/private/collections/CollectionBuilder.mjs
2051
+ var import_react10 = __toESM(require("react"), 1);
2052
+ var $bda7a7e55e1ff206$export$bf788dd355e3a401 = class {
2053
+ build(props, context) {
2054
+ this.context = context;
2055
+ return $bda7a7e55e1ff206$var$iterable(() => this.iterateCollection(props));
2056
+ }
2057
+ *iterateCollection(props) {
2058
+ let { children, items } = props;
2059
+ if ((0, import_react10.default).isValidElement(children) && children.type === (0, import_react10.default).Fragment) yield* this.iterateCollection({
2060
+ children: children.props.children,
2061
+ items
2062
+ });
2063
+ else if (typeof children === "function") {
2064
+ if (!items) throw new Error("props.children was a function but props.items is missing");
2065
+ let index = 0;
2066
+ for (let item of items) {
2067
+ yield* this.getFullNode({
2068
+ value: item,
2069
+ index
2070
+ }, {
2071
+ renderer: children
2072
+ });
2073
+ index++;
2074
+ }
2075
+ } else {
2076
+ let items2 = [];
2077
+ (0, import_react10.default).Children.forEach(children, (child) => {
2078
+ if (child) items2.push(child);
2079
+ });
2080
+ let index = 0;
2081
+ for (let item of items2) {
2082
+ let nodes = this.getFullNode({
2083
+ element: item,
2084
+ index
2085
+ }, {});
2086
+ for (let node of nodes) {
2087
+ index++;
2088
+ yield node;
2089
+ }
2090
+ }
2091
+ }
2092
+ }
2093
+ getKey(item, partialNode, state, parentKey) {
2094
+ if (item.key != null) return item.key;
2095
+ if (partialNode.type === "cell" && partialNode.key != null) return `${parentKey}${partialNode.key}`;
2096
+ let v = partialNode.value;
2097
+ if (v != null) {
2098
+ let key = v.key ?? v.id;
2099
+ if (key == null) throw new Error("No key found for item");
2100
+ return key;
2101
+ }
2102
+ return parentKey ? `${parentKey}.${partialNode.index}` : `$.${partialNode.index}`;
2103
+ }
2104
+ getChildState(state, partialNode) {
2105
+ return {
2106
+ renderer: partialNode.renderer || state.renderer
2107
+ };
2108
+ }
2109
+ *getFullNode(partialNode, state, parentKey, parentNode) {
2110
+ if ((0, import_react10.default).isValidElement(partialNode.element) && partialNode.element.type === (0, import_react10.default).Fragment) {
2111
+ let children = [];
2112
+ (0, import_react10.default).Children.forEach(partialNode.element.props.children, (child) => {
2113
+ children.push(child);
2114
+ });
2115
+ let index = partialNode.index ?? 0;
2116
+ for (const child of children) yield* this.getFullNode({
2117
+ element: child,
2118
+ index: index++
2119
+ }, state, parentKey, parentNode);
2120
+ return;
2121
+ }
2122
+ let element = partialNode.element;
2123
+ if (!element && partialNode.value && state && state.renderer) {
2124
+ let cached = this.cache.get(partialNode.value);
2125
+ if (cached && (!cached.shouldInvalidate || !cached.shouldInvalidate(this.context))) {
2126
+ cached.index = partialNode.index;
2127
+ cached.parentKey = parentNode ? parentNode.key : null;
2128
+ yield cached;
2129
+ return;
2130
+ }
2131
+ element = state.renderer(partialNode.value);
2132
+ }
2133
+ if ((0, import_react10.default).isValidElement(element)) {
2134
+ let type = element.type;
2135
+ if (typeof type !== "function" && typeof type.getCollectionNode !== "function") {
2136
+ let name = element.type;
2137
+ throw new Error(`Unknown element <${name}> in collection.`);
2138
+ }
2139
+ let childNodes = type.getCollectionNode(element.props, this.context);
2140
+ let index = partialNode.index ?? 0;
2141
+ let result = childNodes.next();
2142
+ while (!result.done && result.value) {
2143
+ let childNode = result.value;
2144
+ partialNode.index = index;
2145
+ let nodeKey = childNode.key ?? null;
2146
+ if (nodeKey == null) nodeKey = childNode.element ? null : this.getKey(element, partialNode, state, parentKey);
2147
+ let nodes = this.getFullNode({
2148
+ ...childNode,
2149
+ key: nodeKey,
2150
+ index,
2151
+ wrapper: $bda7a7e55e1ff206$var$compose(partialNode.wrapper, childNode.wrapper)
2152
+ }, this.getChildState(state, childNode), parentKey ? `${parentKey}${element.key}` : element.key, parentNode);
2153
+ let children = [
2154
+ ...nodes
2155
+ ];
2156
+ for (let node2 of children) {
2157
+ node2.value = childNode.value ?? partialNode.value ?? null;
2158
+ if (node2.value) this.cache.set(node2.value, node2);
2159
+ if (partialNode.type && node2.type !== partialNode.type) throw new Error(`Unsupported type <${$bda7a7e55e1ff206$var$capitalize(node2.type)}> in <${$bda7a7e55e1ff206$var$capitalize(parentNode?.type ?? "unknown parent type")}>. Only <${$bda7a7e55e1ff206$var$capitalize(partialNode.type)}> is supported.`);
2160
+ index++;
2161
+ yield node2;
2162
+ }
2163
+ result = childNodes.next(children);
2164
+ }
2165
+ return;
2166
+ }
2167
+ if (partialNode.key == null || partialNode.type == null) return;
2168
+ let builder = this;
2169
+ let node = {
2170
+ type: partialNode.type,
2171
+ props: partialNode.props,
2172
+ key: partialNode.key,
2173
+ parentKey: parentNode ? parentNode.key : null,
2174
+ value: partialNode.value ?? null,
2175
+ level: (parentNode?.level ?? 0) + (parentNode?.type === "item" ? 1 : 0),
2176
+ index: partialNode.index,
2177
+ rendered: partialNode.rendered,
2178
+ textValue: partialNode.textValue ?? "",
2179
+ "aria-label": partialNode["aria-label"],
2180
+ wrapper: partialNode.wrapper,
2181
+ shouldInvalidate: partialNode.shouldInvalidate,
2182
+ hasChildNodes: partialNode.hasChildNodes || false,
2183
+ childNodes: $bda7a7e55e1ff206$var$iterable(function* () {
2184
+ if (!partialNode.hasChildNodes || !partialNode.childNodes) return;
2185
+ let index = 0;
2186
+ for (let child of partialNode.childNodes()) {
2187
+ if (child.key != null)
2188
+ child.key = `${node.key}${child.key}`;
2189
+ let nodes = builder.getFullNode({
2190
+ ...child,
2191
+ index
2192
+ }, builder.getChildState(state, child), node.key, node);
2193
+ for (let node2 of nodes) {
2194
+ index++;
2195
+ yield node2;
2196
+ }
2197
+ }
2198
+ })
2199
+ };
2200
+ yield node;
2201
+ }
2202
+ constructor() {
2203
+ this.cache = /* @__PURE__ */ new WeakMap();
2204
+ }
2205
+ };
2206
+ function $bda7a7e55e1ff206$var$iterable(iterator) {
2207
+ let cache = [];
2208
+ let iterable = null;
2209
+ return {
2210
+ *[Symbol.iterator]() {
2211
+ for (let item of cache) yield item;
2212
+ if (!iterable) iterable = iterator();
2213
+ for (let item of iterable) {
2214
+ cache.push(item);
2215
+ yield item;
2216
+ }
2217
+ }
2218
+ };
2219
+ }
2220
+ function $bda7a7e55e1ff206$var$compose(outer, inner) {
2221
+ if (outer && inner) return (element) => outer(inner(element));
2222
+ if (outer) return outer;
2223
+ if (inner) return inner;
2224
+ }
2225
+ function $bda7a7e55e1ff206$var$capitalize(str) {
2226
+ return str[0].toUpperCase() + str.slice(1);
2227
+ }
2228
+
2229
+ // ../../node_modules/react-stately/dist/private/collections/useCollection.mjs
2230
+ var import_react11 = require("react");
2231
+ function $d03379b88399b8c5$export$6cd28814d92fa9c9(props, factory, context) {
2232
+ let builder = (0, import_react11.useMemo)(() => new (0, $bda7a7e55e1ff206$export$bf788dd355e3a401)(), []);
2233
+ let { children, items, collection } = props;
2234
+ let result = (0, import_react11.useMemo)(() => {
2235
+ if (collection) return collection;
2236
+ let nodes = builder.build({
2237
+ children,
2238
+ items
2239
+ }, context);
2240
+ return factory(nodes);
2241
+ }, [
2242
+ builder,
2243
+ children,
2244
+ items,
2245
+ collection,
2246
+ context,
2247
+ factory
2248
+ ]);
2249
+ return result;
2250
+ }
2251
+
2252
+ // ../../node_modules/react-stately/dist/private/list/useListState.mjs
2253
+ var import_react12 = require("react");
2254
+ function $b14b6f590b50af39$export$2f645645f7bca764(props) {
2255
+ let { filter, layoutDelegate } = props;
2256
+ let selectionState = (0, $60f19cefd567a3e4$export$253fe78d46329472)(props);
2257
+ let disabledKeys = (0, import_react12.useMemo)(() => props.disabledKeys ? new Set(props.disabledKeys) : /* @__PURE__ */ new Set(), [
2258
+ props.disabledKeys
2259
+ ]);
2260
+ let factory = (0, import_react12.useCallback)((nodes) => filter ? new (0, $f664a81d022446b5$export$d085fb9e920b5ca7)(filter(nodes)) : new (0, $f664a81d022446b5$export$d085fb9e920b5ca7)(nodes), [
2261
+ filter
2262
+ ]);
2263
+ let context = (0, import_react12.useMemo)(() => ({
2264
+ suppressTextValueWarning: props.suppressTextValueWarning
2265
+ }), [
2266
+ props.suppressTextValueWarning
2267
+ ]);
2268
+ let collection = (0, $d03379b88399b8c5$export$6cd28814d92fa9c9)(props, factory, context);
2269
+ let selectionManager = (0, import_react12.useMemo)(() => new (0, $4a07ac835f260f78$export$6c8a5aaad13c9852)(collection, selectionState, {
2270
+ layoutDelegate
2271
+ }), [
2272
+ collection,
2273
+ selectionState,
2274
+ layoutDelegate
2275
+ ]);
2276
+ $b14b6f590b50af39$var$useFocusedKeyReset(collection, selectionManager);
2277
+ return {
2278
+ collection,
2279
+ disabledKeys,
2280
+ selectionManager
2281
+ };
2282
+ }
2283
+ function $b14b6f590b50af39$var$useFocusedKeyReset(collection, selectionManager) {
2284
+ const cachedCollection = (0, import_react12.useRef)(null);
2285
+ (0, import_react12.useEffect)(() => {
2286
+ if (selectionManager.focusedKey != null && !collection.getItem(selectionManager.focusedKey) && cachedCollection.current) {
2287
+ let key = cachedCollection.current.getKeyAfter(selectionManager.focusedKey);
2288
+ let nextFocusedKey = null;
2289
+ while (key != null) {
2290
+ let node = collection.getItem(key);
2291
+ if (node && node.type === "item" && !selectionManager.isDisabled(key)) {
2292
+ nextFocusedKey = key;
2293
+ break;
2294
+ }
2295
+ key = cachedCollection.current.getKeyAfter(key);
2296
+ }
2297
+ if (nextFocusedKey == null) {
2298
+ key = cachedCollection.current.getKeyBefore(selectionManager.focusedKey);
2299
+ while (key != null) {
2300
+ let node = collection.getItem(key);
2301
+ if (node && node.type === "item" && !selectionManager.isDisabled(key)) {
2302
+ nextFocusedKey = key;
2303
+ break;
2304
+ }
2305
+ key = cachedCollection.current.getKeyBefore(key);
2306
+ }
2307
+ }
2308
+ selectionManager.setFocusedKey(nextFocusedKey);
2309
+ }
2310
+ cachedCollection.current = collection;
2311
+ }, [
2312
+ collection,
2313
+ selectionManager
2314
+ ]);
2315
+ }
2316
+
2317
+ // ../../node_modules/react-stately/dist/private/overlays/useOverlayTriggerState.mjs
2318
+ var import_react13 = require("react");
2319
+ function $f11fb0bcf1b2687a$export$61c6a8c84e605fb6(props) {
2320
+ let [isOpen, setOpen] = (0, $3e6197669829fe11$export$40bfa8c7b0832715)(props.isOpen, props.defaultOpen || false, props.onOpenChange);
2321
+ const open = (0, import_react13.useCallback)(() => {
2322
+ setOpen(true);
2323
+ }, [
2324
+ setOpen
2325
+ ]);
2326
+ const close = (0, import_react13.useCallback)(() => {
2327
+ setOpen(false);
2328
+ }, [
2329
+ setOpen
2330
+ ]);
2331
+ const toggle = (0, import_react13.useCallback)(() => {
2332
+ setOpen(!isOpen);
2333
+ }, [
2334
+ setOpen,
2335
+ isOpen
2336
+ ]);
2337
+ return {
2338
+ isOpen,
2339
+ setOpen,
2340
+ open,
2341
+ close,
2342
+ toggle
2343
+ };
2344
+ }
2345
+
2346
+ // ../../node_modules/react-stately/dist/private/collections/Item.mjs
2347
+ var import_react14 = __toESM(require("react"), 1);
2348
+ function $05678f3aee5e7d1a$var$Item(props) {
2349
+ return null;
2350
+ }
2351
+ $05678f3aee5e7d1a$var$Item.getCollectionNode = function* getCollectionNode(props, context) {
2352
+ let { childItems, title, children } = props;
2353
+ let rendered = props.title || props.children;
2354
+ let textValue = props.textValue || (typeof rendered === "string" ? rendered : "") || props["aria-label"] || "";
2355
+ if (!textValue && !context?.suppressTextValueWarning && process.env.NODE_ENV !== "production") console.warn("<Item> with non-plain text contents is unsupported by type to select for accessibility. Please add a `textValue` prop.");
2356
+ yield {
2357
+ type: "item",
2358
+ props,
2359
+ rendered,
2360
+ textValue,
2361
+ "aria-label": props["aria-label"],
2362
+ hasChildNodes: $05678f3aee5e7d1a$var$hasChildItems(props),
2363
+ *childNodes() {
2364
+ if (childItems) for (let child of childItems) yield {
2365
+ type: "item",
2366
+ value: child
2367
+ };
2368
+ else if (title) {
2369
+ let items = [];
2370
+ (0, import_react14.default).Children.forEach(children, (child) => {
2371
+ items.push({
2372
+ type: "item",
2373
+ element: child
2374
+ });
2375
+ });
2376
+ yield* items;
2377
+ }
2378
+ }
2379
+ };
2380
+ };
2381
+ function $05678f3aee5e7d1a$var$hasChildItems(props) {
2382
+ if (props.hasChildItems != null) return props.hasChildItems;
2383
+ if (props.childItems) return true;
2384
+ if (props.title && (0, import_react14.default).Children.count(props.children) > 0) return true;
2385
+ return false;
2386
+ }
2387
+ var $05678f3aee5e7d1a$export$6d08773d2e66f8f2 = $05678f3aee5e7d1a$var$Item;
2388
+
2389
+ // ../../node_modules/react-stately/dist/private/select/useSelectState.mjs
2390
+ var import_react15 = require("react");
2391
+ function $29256f53a2edafe9$export$5159ec8b34d4ec12(props) {
2392
+ let { selectionMode = "single", shouldCloseOnSelect = selectionMode === "single" } = props;
2393
+ let triggerState = (0, $f11fb0bcf1b2687a$export$61c6a8c84e605fb6)(props);
2394
+ let [focusStrategy, setFocusStrategy] = (0, import_react15.useState)(null);
2395
+ let defaultValue = (0, import_react15.useMemo)(() => {
2396
+ return props.defaultValue !== void 0 ? props.defaultValue : selectionMode === "single" ? props.defaultSelectedKey ?? null : [];
2397
+ }, [
2398
+ props.defaultValue,
2399
+ props.defaultSelectedKey,
2400
+ selectionMode
2401
+ ]);
2402
+ let value = (0, import_react15.useMemo)(() => {
2403
+ return props.value !== void 0 ? props.value : selectionMode === "single" ? props.selectedKey : void 0;
2404
+ }, [
2405
+ props.value,
2406
+ props.selectedKey,
2407
+ selectionMode
2408
+ ]);
2409
+ let [controlledValue, setControlledValue] = (0, $3e6197669829fe11$export$40bfa8c7b0832715)(value, defaultValue, props.onChange);
2410
+ let displayValue = selectionMode === "single" && Array.isArray(controlledValue) ? controlledValue[0] : controlledValue;
2411
+ let setValue = (value2) => {
2412
+ if (selectionMode === "single") {
2413
+ let key = Array.isArray(value2) ? value2[0] ?? null : value2;
2414
+ setControlledValue(key);
2415
+ if (key !== displayValue) props.onSelectionChange?.(key);
2416
+ } else {
2417
+ let keys = [];
2418
+ if (Array.isArray(value2)) keys = value2;
2419
+ else if (value2 != null) keys = [
2420
+ value2
2421
+ ];
2422
+ setControlledValue(keys);
2423
+ }
2424
+ };
2425
+ let listState = (0, $b14b6f590b50af39$export$2f645645f7bca764)({
2426
+ ...props,
2427
+ selectionMode,
2428
+ disallowEmptySelection: selectionMode === "single",
2429
+ allowDuplicateSelectionEvents: true,
2430
+ selectedKeys: (0, import_react15.useMemo)(() => $29256f53a2edafe9$var$convertValue(displayValue), [
2431
+ displayValue
2432
+ ]),
2433
+ onSelectionChange: (keys) => {
2434
+ if (keys === "all") return;
2435
+ if (selectionMode === "single") {
2436
+ let key = keys.values().next().value ?? null;
2437
+ setValue(key);
2438
+ } else setValue([
2439
+ ...keys
2440
+ ]);
2441
+ if (shouldCloseOnSelect) triggerState.close();
2442
+ validationState.commitValidation();
2443
+ }
2444
+ });
2445
+ let selectedKey = listState.selectionManager.firstSelectedKey;
2446
+ let selectedItems = (0, import_react15.useMemo)(() => {
2447
+ return [
2448
+ ...listState.selectionManager.selectedKeys
2449
+ ].map((key) => listState.collection.getItem(key)).filter((item) => item != null);
2450
+ }, [
2451
+ listState.selectionManager.selectedKeys,
2452
+ listState.collection
2453
+ ]);
2454
+ let validationState = (0, $fd2148440a13ec26$export$fc1a364ae1f3ff10)({
2455
+ ...props,
2456
+ value: Array.isArray(displayValue) && displayValue.length === 0 ? null : displayValue
2457
+ });
2458
+ let [isFocused, setFocused] = (0, import_react15.useState)(false);
2459
+ let [initialValue] = (0, import_react15.useState)(displayValue);
2460
+ return {
2461
+ ...validationState,
2462
+ ...listState,
2463
+ ...triggerState,
2464
+ value: displayValue,
2465
+ defaultValue: defaultValue ?? initialValue,
2466
+ setValue,
2467
+ selectedKey,
2468
+ setSelectedKey: setValue,
2469
+ selectedItem: selectedItems[0] ?? null,
2470
+ selectedItems,
2471
+ defaultSelectedKey: props.defaultSelectedKey ?? (props.selectionMode === "single" ? initialValue : null),
2472
+ focusStrategy,
2473
+ open(focusStrategy2 = null) {
2474
+ if (listState.collection.size !== 0 || props.allowsEmptyCollection) {
2475
+ setFocusStrategy(focusStrategy2);
2476
+ triggerState.open();
2477
+ }
2478
+ },
2479
+ toggle(focusStrategy2 = null) {
2480
+ if (listState.collection.size !== 0 || props.allowsEmptyCollection) {
2481
+ setFocusStrategy(focusStrategy2);
2482
+ triggerState.toggle();
2483
+ }
2484
+ },
2485
+ isFocused,
2486
+ setFocused
2487
+ };
2488
+ }
2489
+ function $29256f53a2edafe9$var$convertValue(value) {
2490
+ if (value === void 0) return void 0;
2491
+ if (value === null) return [];
2492
+ return Array.isArray(value) ? value : [
2493
+ value
2494
+ ];
2495
+ }
2496
+
2497
+ // ../../node_modules/react-stately/dist/private/tooltip/useTooltipTriggerState.mjs
2498
+ var import_react16 = require("react");
2499
+ var $3834487504f4fc00$var$TOOLTIP_DELAY = 1500;
2500
+ var $3834487504f4fc00$var$TOOLTIP_COOLDOWN = 500;
2501
+ var $3834487504f4fc00$var$tooltips = {};
2502
+ var $3834487504f4fc00$var$tooltipId = 0;
2503
+ var $3834487504f4fc00$var$globalWarmedUp = false;
2504
+ var $3834487504f4fc00$var$globalWarmUpTimeout = null;
2505
+ var $3834487504f4fc00$var$globalCooldownTimeout = null;
2506
+ function $3834487504f4fc00$export$4d40659c25ecb50b(props = {}) {
2507
+ let { delay = $3834487504f4fc00$var$TOOLTIP_DELAY, closeDelay = $3834487504f4fc00$var$TOOLTIP_COOLDOWN } = props;
2508
+ let { isOpen, open, close } = (0, $f11fb0bcf1b2687a$export$61c6a8c84e605fb6)(props);
2509
+ let id = (0, import_react16.useMemo)(() => `${++$3834487504f4fc00$var$tooltipId}`, []);
2510
+ let closeTimeout = (0, import_react16.useRef)(null);
2511
+ let closeCallback = (0, import_react16.useRef)(close);
2512
+ let ensureTooltipEntry = () => {
2513
+ $3834487504f4fc00$var$tooltips[id] = hideTooltip;
2514
+ };
2515
+ let closeOpenTooltips = () => {
2516
+ for (let hideTooltipId in $3834487504f4fc00$var$tooltips) if (hideTooltipId !== id) {
2517
+ $3834487504f4fc00$var$tooltips[hideTooltipId](true);
2518
+ delete $3834487504f4fc00$var$tooltips[hideTooltipId];
2519
+ }
2520
+ };
2521
+ let showTooltip = () => {
2522
+ if (closeTimeout.current) clearTimeout(closeTimeout.current);
2523
+ closeTimeout.current = null;
2524
+ closeOpenTooltips();
2525
+ ensureTooltipEntry();
2526
+ $3834487504f4fc00$var$globalWarmedUp = true;
2527
+ open();
2528
+ if ($3834487504f4fc00$var$globalWarmUpTimeout) {
2529
+ clearTimeout($3834487504f4fc00$var$globalWarmUpTimeout);
2530
+ $3834487504f4fc00$var$globalWarmUpTimeout = null;
2531
+ }
2532
+ if ($3834487504f4fc00$var$globalCooldownTimeout) {
2533
+ clearTimeout($3834487504f4fc00$var$globalCooldownTimeout);
2534
+ $3834487504f4fc00$var$globalCooldownTimeout = null;
2535
+ }
2536
+ };
2537
+ let hideTooltip = (immediate) => {
2538
+ if (immediate || closeDelay <= 0) {
2539
+ if (closeTimeout.current) clearTimeout(closeTimeout.current);
2540
+ closeTimeout.current = null;
2541
+ closeCallback.current();
2542
+ } else if (!closeTimeout.current) closeTimeout.current = setTimeout(() => {
2543
+ closeTimeout.current = null;
2544
+ closeCallback.current();
2545
+ }, closeDelay);
2546
+ if ($3834487504f4fc00$var$globalWarmUpTimeout) {
2547
+ clearTimeout($3834487504f4fc00$var$globalWarmUpTimeout);
2548
+ $3834487504f4fc00$var$globalWarmUpTimeout = null;
2549
+ }
2550
+ if ($3834487504f4fc00$var$globalWarmedUp) {
2551
+ if ($3834487504f4fc00$var$globalCooldownTimeout) clearTimeout($3834487504f4fc00$var$globalCooldownTimeout);
2552
+ $3834487504f4fc00$var$globalCooldownTimeout = setTimeout(() => {
2553
+ delete $3834487504f4fc00$var$tooltips[id];
2554
+ $3834487504f4fc00$var$globalCooldownTimeout = null;
2555
+ $3834487504f4fc00$var$globalWarmedUp = false;
2556
+ }, Math.max($3834487504f4fc00$var$TOOLTIP_COOLDOWN, closeDelay));
2557
+ }
2558
+ };
2559
+ let warmupTooltip = () => {
2560
+ closeOpenTooltips();
2561
+ ensureTooltipEntry();
2562
+ if (!isOpen && !$3834487504f4fc00$var$globalWarmedUp) {
2563
+ if ($3834487504f4fc00$var$globalWarmUpTimeout) clearTimeout($3834487504f4fc00$var$globalWarmUpTimeout);
2564
+ $3834487504f4fc00$var$globalWarmUpTimeout = setTimeout(() => {
2565
+ $3834487504f4fc00$var$globalWarmUpTimeout = null;
2566
+ $3834487504f4fc00$var$globalWarmedUp = true;
2567
+ showTooltip();
2568
+ }, delay);
2569
+ } else if (!isOpen) showTooltip();
2570
+ };
2571
+ (0, import_react16.useEffect)(() => {
2572
+ closeCallback.current = close;
2573
+ }, [
2574
+ close
2575
+ ]);
2576
+ (0, import_react16.useEffect)(() => {
2577
+ return () => {
2578
+ if (closeTimeout.current) clearTimeout(closeTimeout.current);
2579
+ let tooltip = $3834487504f4fc00$var$tooltips[id];
2580
+ if (tooltip) delete $3834487504f4fc00$var$tooltips[id];
2581
+ };
2582
+ }, [
2583
+ id
2584
+ ]);
2585
+ return {
2586
+ isOpen,
2587
+ open: (immediate) => {
2588
+ if (!immediate && delay > 0 && !closeTimeout.current) warmupTooltip();
2589
+ else showTooltip();
2590
+ },
2591
+ close: hideTooltip
2592
+ };
2593
+ }
2594
+
2595
+ // src/components/Select/Select.tsx
2596
+ var import_icons2 = require("@octaviaflow/icons");
2597
+
2598
+ // src/components/Tooltip/Tooltip.tsx
2599
+ var import_framer_motion4 = require("framer-motion");
2600
+ var import_react17 = require("react");
2601
+ var import_react_aria2 = require("react-aria");
2602
+ var import_react_dom = require("react-dom");
2603
+ var import_jsx_runtime16 = require("react/jsx-runtime");
2604
+ var FLIP = {
2605
+ top: "bottom",
2606
+ bottom: "top",
2607
+ left: "right",
2608
+ right: "left"
2609
+ };
2610
+ function placeOn(rect, tipRect, position, offset) {
2611
+ const cx = rect.left + rect.width / 2;
2612
+ const cy = rect.top + rect.height / 2;
2613
+ switch (position) {
2614
+ case "top":
2615
+ return {
2616
+ top: rect.top - tipRect.height - offset,
2617
+ left: cx - tipRect.width / 2
2618
+ };
2619
+ case "bottom":
2620
+ return { top: rect.bottom + offset, left: cx - tipRect.width / 2 };
2621
+ case "left":
2622
+ return {
2623
+ top: cy - tipRect.height / 2,
2624
+ left: rect.left - tipRect.width - offset
2625
+ };
2626
+ case "right":
2627
+ return { top: cy - tipRect.height / 2, left: rect.right + offset };
2628
+ }
2629
+ }
2630
+ function computePosition(rect, tipRect, position, offset, viewport) {
2631
+ const tryAt = (p) => {
2632
+ const c = placeOn(rect, tipRect, p, offset);
2633
+ const fits = c.top >= 0 && c.left >= 0 && c.top + tipRect.height <= viewport.height && c.left + tipRect.width <= viewport.width;
2634
+ return { ...c, position: p, fits };
2635
+ };
2636
+ const preferred = tryAt(position);
2637
+ if (preferred.fits) return preferred;
2638
+ const flipped = tryAt(FLIP[position]);
2639
+ if (flipped.fits) return flipped;
2640
+ const fallback = preferred;
2641
+ const clampedLeft = Math.max(
2642
+ 4,
2643
+ Math.min(fallback.left, viewport.width - tipRect.width - 4)
2644
+ );
2645
+ const clampedTop = Math.max(
2646
+ 4,
2647
+ Math.min(fallback.top, viewport.height - tipRect.height - 4)
2648
+ );
2649
+ return { top: clampedTop, left: clampedLeft, position: fallback.position };
2650
+ }
2651
+ var animVariants = {
2652
+ top: { initial: { opacity: 0, y: 4 }, animate: { opacity: 1, y: 0 } },
2653
+ bottom: { initial: { opacity: 0, y: -4 }, animate: { opacity: 1, y: 0 } },
2654
+ left: { initial: { opacity: 0, x: 4 }, animate: { opacity: 1, x: 0 } },
2655
+ right: { initial: { opacity: 0, x: -4 }, animate: { opacity: 1, x: 0 } }
2656
+ };
2657
+ function TooltipContent({
2658
+ state,
2659
+ content,
2660
+ position,
2661
+ triggerRef,
2662
+ className,
2663
+ offset,
2664
+ tooltipId
2665
+ }) {
2666
+ const { tooltipProps } = (0, import_react_aria2.useTooltip)({ isOpen: state.isOpen }, state);
2667
+ const tipRef = (0, import_react17.useRef)(null);
2668
+ const [coords, setCoords] = (0, import_react17.useState)(null);
2669
+ const reposition = (0, import_react17.useCallback)(() => {
2670
+ if (!triggerRef.current || !tipRef.current) return;
2671
+ const trigRect = triggerRef.current.getBoundingClientRect();
2672
+ const tipRect = tipRef.current.getBoundingClientRect();
2673
+ const viewport = {
2674
+ width: window.innerWidth || document.documentElement.clientWidth,
2675
+ height: window.innerHeight || document.documentElement.clientHeight
2676
+ };
2677
+ setCoords(computePosition(trigRect, tipRect, position, offset, viewport));
2678
+ }, [triggerRef, position, offset]);
2679
+ (0, import_react17.useLayoutEffect)(() => {
2680
+ if (!state.isOpen) return;
2681
+ reposition();
2682
+ const id = requestAnimationFrame(reposition);
2683
+ return () => cancelAnimationFrame(id);
2684
+ }, [state.isOpen, reposition]);
2685
+ (0, import_react17.useEffect)(() => {
2686
+ if (!state.isOpen) return;
2687
+ const handler = () => reposition();
2688
+ window.addEventListener("scroll", handler, true);
2689
+ window.addEventListener("resize", handler);
2690
+ return () => {
2691
+ window.removeEventListener("scroll", handler, true);
2692
+ window.removeEventListener("resize", handler);
2693
+ };
2694
+ }, [state.isOpen, reposition]);
2695
+ const resolvedPos = coords?.position ?? position;
2696
+ const variants = animVariants[resolvedPos];
2697
+ const {
2698
+ onDrag: _onDrag,
2699
+ onDragStart: _onDragStart,
2700
+ onDragEnd: _onDragEnd,
2701
+ onAnimationStart: _onAnimationStart,
2702
+ ...safeTipProps
2703
+ } = tooltipProps;
2704
+ const portalContent = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_framer_motion4.AnimatePresence, { children: state.isOpen && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2705
+ "div",
2706
+ {
2707
+ className: "ods-tooltip__wrapper",
2708
+ style: {
2709
+ position: "fixed",
2710
+ zIndex: 1500,
2711
+ top: coords?.top ?? -9999,
2712
+ left: coords?.left ?? -9999,
2713
+ visibility: coords ? "visible" : "hidden",
2714
+ pointerEvents: "none"
2715
+ },
2716
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
2717
+ import_framer_motion4.motion.div,
2718
+ {
2719
+ ref: tipRef,
2720
+ ...safeTipProps,
2721
+ id: tooltipId,
2722
+ role: "tooltip",
2723
+ "data-position": resolvedPos,
2724
+ className: cn("ods-tooltip", className),
2725
+ initial: variants.initial,
2726
+ animate: variants.animate,
2727
+ exit: { opacity: 0 },
2728
+ transition: { duration: 0.15, ease: "easeOut" },
2729
+ children: [
2730
+ content,
2731
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "ods-tooltip__arrow", "aria-hidden": "true" })
2732
+ ]
2733
+ }
2734
+ )
2735
+ }
2736
+ ) });
2737
+ if (typeof document === "undefined") return null;
2738
+ return (0, import_react_dom.createPortal)(portalContent, document.body);
2739
+ }
2740
+ function mergeRefs(...refs) {
2741
+ return (node) => {
2742
+ for (const r of refs) {
2743
+ if (!r) continue;
2744
+ if (typeof r === "function") r(node);
2745
+ else r.current = node;
2746
+ }
2747
+ };
2748
+ }
2749
+ function mergeHandler(childHandler, ariaHandler) {
2750
+ if (!childHandler && !ariaHandler) return void 0;
2751
+ return (e) => {
2752
+ childHandler?.(e);
2753
+ if (!e.defaultPrevented) ariaHandler?.(e);
2754
+ };
2755
+ }
2756
+ function Tooltip({
2757
+ content,
2758
+ position = "top",
2759
+ delay = 200,
2760
+ offset = 8,
2761
+ disabled = false,
2762
+ id: providedId,
2763
+ children,
2764
+ className
2765
+ }) {
2766
+ const reactId = (0, import_react17.useId)();
2767
+ const tooltipId = providedId ?? `ods-tooltip-${reactId}`;
2768
+ const triggerRef = (0, import_react17.useRef)(null);
2769
+ const state = $3834487504f4fc00$export$4d40659c25ecb50b({ delay });
2770
+ const { triggerProps } = (0, import_react_aria2.useTooltipTrigger)(
2771
+ { delay, isDisabled: disabled },
2772
+ state,
2773
+ triggerRef
2774
+ );
2775
+ if (!(0, import_react17.isValidElement)(children)) {
2776
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_jsx_runtime16.Fragment, { children });
2777
+ }
2778
+ const childProps = children.props;
2779
+ const childRef = childProps.ref ?? children.ref;
2780
+ const merged = { ...childProps };
2781
+ for (const [key, value] of Object.entries(
2782
+ triggerProps
2783
+ )) {
2784
+ if (key.startsWith("on") && typeof value === "function") {
2785
+ merged[key] = mergeHandler(
2786
+ childProps[key],
2787
+ value
2788
+ );
2789
+ } else {
2790
+ merged[key] = value;
2791
+ }
2792
+ }
2793
+ merged.ref = mergeRefs(triggerRef, childRef);
2794
+ merged["aria-describedby"] = [childProps["aria-describedby"], tooltipId].filter(Boolean).join(" ");
2795
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
2796
+ (0, import_react17.cloneElement)(children, merged),
2797
+ !disabled && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2798
+ TooltipContent,
2799
+ {
2800
+ state,
2801
+ content,
2802
+ position,
2803
+ triggerRef,
2804
+ offset,
2805
+ className,
2806
+ tooltipId
2807
+ }
2808
+ )
2809
+ ] });
2810
+ }
2811
+ Tooltip.displayName = "Tooltip";
2812
+
2813
+ // src/components/Select/Select.tsx
2814
+ var import_jsx_runtime17 = require("react/jsx-runtime");
2815
+ function OverflowTooltip({
2816
+ enabled,
2817
+ content,
2818
+ children
2819
+ }) {
2820
+ if (!enabled || content == null || content === "") return children;
2821
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Tooltip, { content, children });
2822
+ }
2823
+ function ListBox(props) {
2824
+ const ref = (0, import_react18.useRef)(null);
2825
+ const {
2826
+ listBoxRef = ref,
2827
+ state,
2828
+ showCheckmark,
2829
+ showOverflowTooltips
2830
+ } = props;
2831
+ const { listBoxProps } = (0, import_react_aria3.useListBox)(props, state, listBoxRef);
2832
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("ul", { ...listBoxProps, ref: listBoxRef, className: "ods-select__options", children: [...state.collection].map((item) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
2833
+ Option,
2834
+ {
2835
+ item,
2836
+ state,
2837
+ showCheckmark,
2838
+ showOverflowTooltips
2839
+ },
2840
+ item.key
2841
+ )) });
2842
+ }
2843
+ function Option({
2844
+ item,
2845
+ state,
2846
+ showCheckmark,
2847
+ showOverflowTooltips
2848
+ }) {
2849
+ const ref = (0, import_react18.useRef)(null);
2850
+ const { optionProps, isSelected, isFocused, isDisabled } = (0, import_react_aria3.useOption)(
2851
+ { key: item.key },
2852
+ state,
2853
+ ref
2854
+ );
2855
+ const raw = item.value;
2856
+ const option = raw?.value ?? raw;
2857
+ const tooltipContent = option?.description ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
2858
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: option.label }),
2859
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("br", {}),
2860
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: { opacity: 0.75 }, children: option.description })
2861
+ ] }) : option?.label;
2862
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
2863
+ OverflowTooltip,
2864
+ {
2865
+ enabled: !!showOverflowTooltips,
2866
+ content: tooltipContent,
2867
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
2868
+ "li",
2869
+ {
2870
+ ...optionProps,
2871
+ ref,
2872
+ className: cn(
2873
+ "ods-select__option",
2874
+ isFocused && "ods-select__option--highlighted",
2875
+ isSelected && "ods-select__option--selected",
2876
+ isDisabled && "ods-select__option--disabled"
2877
+ ),
2878
+ children: [
2879
+ option?.icon && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "ods-select__option-icon", children: option.icon }),
2880
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "ods-select__option-text", children: [
2881
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "ods-select__option-label", children: item.rendered }),
2882
+ option?.description && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "ods-select__option-desc", children: option.description })
2883
+ ] }),
2884
+ isSelected && showCheckmark && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "ods-select__check", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_icons2.CheckmarkIcon, { size: "xs", tone: "accent" }) })
2885
+ ]
2886
+ }
2887
+ )
2888
+ }
2889
+ );
2890
+ }
2891
+ var DEFAULT_SELECT_PLACEHOLDER = "Select an option...";
2892
+ var Select = (0, import_react18.forwardRef)(function Select2({
2893
+ options,
2894
+ value,
2895
+ defaultValue,
2896
+ onChange,
2897
+ placeholder = DEFAULT_SELECT_PLACEHOLDER,
2898
+ searchable = false,
2899
+ label,
2900
+ error = false,
2901
+ errorMessage,
2902
+ helperText,
2903
+ disabled = false,
2904
+ size = "md",
2905
+ className,
2906
+ name,
2907
+ required,
2908
+ id: providedId,
2909
+ form,
2910
+ autoFocus,
2911
+ "aria-label": ariaLabel,
2912
+ "aria-labelledby": ariaLabelledBy,
2913
+ "aria-describedby": consumerDescribedBy,
2914
+ showCheckmark = false,
2915
+ closeOnOutsideClick = true,
2916
+ showOverflowTooltips = false,
2917
+ dropdownMinWidth
2918
+ }, forwardedRef) {
2919
+ const triggerRef = (0, import_react18.useRef)(null);
2920
+ const listBoxRef = (0, import_react18.useRef)(null);
2921
+ const dropdownRef = (0, import_react18.useRef)(null);
2922
+ const searchRef = (0, import_react18.useRef)(null);
2923
+ const [searchQuery, setSearchQuery] = (0, import_react18.useState)("");
2924
+ const [dropdownPos, setDropdownPos] = (0, import_react18.useState)({ left: 0, width: 0, maxHeight: 240, direction: "down" });
2925
+ const setTriggerRef = (node) => {
2926
+ triggerRef.current = node;
2927
+ if (typeof forwardedRef === "function") forwardedRef(node);
2928
+ else if (forwardedRef)
2929
+ forwardedRef.current = node;
2930
+ };
2931
+ const reactId = (0, import_react18.useId)();
2932
+ const baseId = providedId ?? `ods-select-${reactId}`;
2933
+ const hintId = error || helperText ? `${baseId}-hint` : void 0;
2934
+ const describedBy = [consumerDescribedBy, hintId].filter(Boolean).join(" ") || void 0;
2935
+ const filteredOptions = (0, import_react18.useMemo)(() => {
2936
+ if (!searchable || !searchQuery) return options;
2937
+ const q = searchQuery.toLowerCase();
2938
+ return options.filter(
2939
+ (o) => o.label.toLowerCase().includes(q) || o.description?.toLowerCase().includes(q)
2940
+ );
2941
+ }, [options, searchQuery, searchable]);
2942
+ const ariaNameProps = (0, import_react18.useMemo)(
2943
+ () => resolveAccessibleName({
2944
+ label,
2945
+ ariaLabel,
2946
+ ariaLabelledby: ariaLabelledBy,
2947
+ componentName: "Select",
2948
+ fallbacks: [
2949
+ placeholder && placeholder !== DEFAULT_SELECT_PLACEHOLDER ? placeholder : void 0
2950
+ ]
2951
+ }),
2952
+ [label, ariaLabel, ariaLabelledBy, placeholder]
2953
+ );
2954
+ const ariaProps = (0, import_react18.useMemo)(() => {
2955
+ const items = filteredOptions.map((o) => ({
2956
+ key: o.value,
2957
+ label: o.label,
2958
+ value: o,
2959
+ isDisabled: o.disabled
2960
+ }));
2961
+ const props = {
2962
+ // Visible string label when present; otherwise rely on the aria-*
2963
+ // props for screen-reader name.
2964
+ label: typeof label === "string" ? label : void 0,
2965
+ ...ariaNameProps,
2966
+ items,
2967
+ children: (item) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)($05678f3aee5e7d1a$export$6d08773d2e66f8f2, { textValue: item.label, children: item.label }, item.key),
2968
+ isDisabled: disabled,
2969
+ onSelectionChange: (key) => {
2970
+ onChange?.(String(key));
2971
+ setSearchQuery("");
2972
+ }
2973
+ };
2974
+ if (value !== void 0) {
2975
+ props.selectedKey = value;
2976
+ }
2977
+ if (defaultValue !== void 0) {
2978
+ props.defaultSelectedKey = defaultValue;
2979
+ }
2980
+ return props;
2981
+ }, [filteredOptions, label, disabled, value, defaultValue, onChange, ariaNameProps]);
2982
+ const state = $29256f53a2edafe9$export$5159ec8b34d4ec12(ariaProps);
2983
+ const { triggerProps, menuProps } = (0, import_react_aria3.useSelect)(ariaProps, state, triggerRef);
2984
+ const { buttonProps } = (0, import_react_aria3.useButton)(triggerProps, triggerRef);
2985
+ const updatePosition = (0, import_react18.useCallback)(() => {
2986
+ if (!triggerRef.current) return;
2987
+ const rect = triggerRef.current.getBoundingClientRect();
2988
+ const viewportH = window.innerHeight;
2989
+ const margin = 8;
2990
+ const gap = 4;
2991
+ const spaceBelow = viewportH - rect.bottom - gap - margin;
2992
+ const spaceAbove = rect.top - gap - margin;
2993
+ const PREFERRED_MIN = 200;
2994
+ const openUp = spaceBelow < PREFERRED_MIN && spaceAbove > spaceBelow;
2995
+ setDropdownPos({
2996
+ ...openUp ? { bottom: viewportH - rect.top + gap } : { top: rect.bottom + gap },
2997
+ left: rect.left,
2998
+ width: rect.width,
2999
+ maxHeight: Math.max(120, openUp ? spaceAbove : spaceBelow),
3000
+ direction: openUp ? "up" : "down"
3001
+ });
3002
+ }, []);
3003
+ (0, import_react18.useEffect)(() => {
3004
+ if (state.isOpen) {
3005
+ updatePosition();
3006
+ window.addEventListener("scroll", updatePosition, true);
3007
+ window.addEventListener("resize", updatePosition);
3008
+ return () => {
3009
+ window.removeEventListener("scroll", updatePosition, true);
3010
+ window.removeEventListener("resize", updatePosition);
3011
+ };
3012
+ }
3013
+ }, [state.isOpen, updatePosition]);
3014
+ (0, import_react18.useEffect)(() => {
3015
+ if (state.isOpen && searchable && searchRef.current) {
3016
+ requestAnimationFrame(() => searchRef.current?.focus());
3017
+ }
3018
+ }, [state.isOpen, searchable]);
3019
+ (0, import_react18.useEffect)(() => {
3020
+ if (!state.isOpen || !closeOnOutsideClick) return;
3021
+ const onPointer = (e) => {
3022
+ const target = e.target;
3023
+ if (dropdownRef.current?.contains(target)) return;
3024
+ if (triggerRef.current?.contains(target)) return;
3025
+ state.close();
3026
+ };
3027
+ const onKey = (e) => {
3028
+ if (e.key === "Escape") state.close();
3029
+ };
3030
+ document.addEventListener("mousedown", onPointer);
3031
+ document.addEventListener("keydown", onKey);
3032
+ return () => {
3033
+ document.removeEventListener("mousedown", onPointer);
3034
+ document.removeEventListener("keydown", onKey);
3035
+ };
3036
+ }, [state.isOpen, state.close, closeOnOutsideClick]);
3037
+ const selectedOption = options.find((o) => o.value === String(state.selectedKey ?? ""));
3038
+ const wasOpenBeforePressRef = (0, import_react18.useRef)(false);
3039
+ const handleTriggerPointerDown = (e) => {
3040
+ wasOpenBeforePressRef.current = state.isOpen;
3041
+ const baseHandler = buttonProps.onPointerDown;
3042
+ baseHandler?.(e);
3043
+ };
3044
+ const handleTriggerClick = (e) => {
3045
+ const baseHandler = buttonProps.onClick;
3046
+ baseHandler?.(e);
3047
+ if (wasOpenBeforePressRef.current && state.isOpen) {
3048
+ state.close();
3049
+ }
3050
+ wasOpenBeforePressRef.current = false;
3051
+ };
3052
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
3053
+ "div",
3054
+ {
3055
+ className: cn(
3056
+ "ods-select",
3057
+ `ods-select--${size}`,
3058
+ error && "ods-select--error",
3059
+ disabled && "ods-select--disabled",
3060
+ className
3061
+ ),
3062
+ children: [
3063
+ label && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("label", { className: "ods-select__label", htmlFor: baseId, children: label }),
3064
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_aria3.HiddenSelect, { state, triggerRef, label, name }),
3065
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
3066
+ "button",
3067
+ {
3068
+ ...buttonProps,
3069
+ onPointerDown: handleTriggerPointerDown,
3070
+ onClick: handleTriggerClick,
3071
+ ref: setTriggerRef,
3072
+ id: baseId,
3073
+ form,
3074
+ autoFocus,
3075
+ "aria-label": ariaLabel,
3076
+ "aria-labelledby": ariaLabelledBy,
3077
+ "aria-describedby": describedBy,
3078
+ "aria-required": required || void 0,
3079
+ "aria-invalid": error ? true : void 0,
3080
+ className: cn("ods-select__trigger", state.isOpen && "ods-select__trigger--open"),
3081
+ children: [
3082
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "ods-select__value", children: selectedOption ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
3083
+ selectedOption.icon && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "ods-select__value-icon", children: selectedOption.icon }),
3084
+ selectedOption.label
3085
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "ods-select__placeholder", children: placeholder }) }),
3086
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
3087
+ "span",
3088
+ {
3089
+ className: cn(
3090
+ "ods-select__chevron",
3091
+ state.isOpen && "ods-select__chevron--open"
3092
+ ),
3093
+ "aria-hidden": "true",
3094
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_icons2.ChevronDownIcon, { size: "xs" })
3095
+ }
3096
+ )
3097
+ ]
3098
+ }
3099
+ ),
3100
+ typeof document !== "undefined" && (0, import_react_dom2.createPortal)(
3101
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_framer_motion5.AnimatePresence, { children: state.isOpen && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
3102
+ import_framer_motion5.motion.div,
3103
+ {
3104
+ ref: dropdownRef,
3105
+ className: "ods-select__dropdown",
3106
+ style: {
3107
+ position: "fixed",
3108
+ ...dropdownPos.top !== void 0 && { top: dropdownPos.top },
3109
+ ...dropdownPos.bottom !== void 0 && { bottom: dropdownPos.bottom },
3110
+ left: dropdownPos.left,
3111
+ // `minWidth` (not `width`) keeps the popover at
3112
+ // least as wide as the trigger — preserves visual
3113
+ // alignment — but allows the consumer to widen it
3114
+ // explicitly when option labels demand more room
3115
+ // (pass `dropdownMinWidth` to set a higher floor).
3116
+ // Avoids the previous `max-content` recipe which
3117
+ // made the popover grow uncomfortably wide on
3118
+ // searchable / long-option menus.
3119
+ minWidth: Math.max(dropdownPos.width, dropdownMinWidth ?? 0),
3120
+ // Bound the popover to the available viewport edge so
3121
+ // it never spills off-screen on tall pages. Pairs with
3122
+ // `overflow-y: auto` from the .ods-select__dropdown
3123
+ // SCSS so long option lists scroll internally.
3124
+ maxHeight: dropdownPos.maxHeight
3125
+ },
3126
+ initial: { opacity: 0, scale: 0.95 },
3127
+ animate: { opacity: 1, scale: 1 },
3128
+ exit: { opacity: 0, scale: 0.95 },
3129
+ transition: { duration: 0.2, ease: [0.16, 1, 0.3, 1] },
3130
+ children: [
3131
+ searchable && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "ods-select__search-wrap", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
3132
+ "input",
3133
+ {
3134
+ ref: searchRef,
3135
+ className: "ods-select__search",
3136
+ type: "text",
3137
+ placeholder: "Search...",
3138
+ value: searchQuery,
3139
+ onChange: (e) => setSearchQuery(e.target.value),
3140
+ "aria-label": "Search options",
3141
+ onKeyDown: (e) => {
3142
+ if (e.key === "Escape") {
3143
+ state.close();
3144
+ }
3145
+ }
3146
+ }
3147
+ ) }),
3148
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
3149
+ ListBox,
3150
+ {
3151
+ ...menuProps,
3152
+ listBoxRef,
3153
+ state,
3154
+ showCheckmark,
3155
+ showOverflowTooltips
3156
+ }
3157
+ ),
3158
+ filteredOptions.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "ods-select__empty", children: "No results found" })
3159
+ ]
3160
+ }
3161
+ ) }),
3162
+ document.body
3163
+ ),
3164
+ error && errorMessage ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
3165
+ "span",
3166
+ {
3167
+ id: hintId,
3168
+ className: "ods-select__error",
3169
+ role: "alert",
3170
+ children: errorMessage
3171
+ }
3172
+ ) : helperText ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { id: hintId, className: "ods-select__hint", children: helperText }) : null
3173
+ ]
3174
+ }
3175
+ );
3176
+ });
3177
+ Select.displayName = "Select";
3178
+
3179
+ // src/marketing/components/WorkflowShowcase/ShowcaseSignup.tsx
3180
+ var import_jsx_runtime18 = require("react/jsx-runtime");
3181
+ var OVERLAY_MOTION = {
3182
+ initial: { opacity: 0 },
3183
+ animate: { opacity: 1 },
3184
+ exit: { opacity: 0 }
3185
+ };
3186
+ function ShowcaseSignup({
3187
+ phase,
3188
+ stepCount,
3189
+ workspaceDomain,
3190
+ teamSizes,
3191
+ error,
3192
+ onSubmit,
3193
+ onBack,
3194
+ dashboardHref = "#",
3195
+ onboardingHref = "#"
3196
+ }) {
3197
+ const reducedMotion = (0, import_framer_motion6.useReducedMotion)();
3198
+ const titleId = (0, import_react19.useId)();
3199
+ const subtitleId = (0, import_react19.useId)();
3200
+ const [values, setValues] = (0, import_react19.useState)({
3201
+ name: "",
3202
+ email: "",
3203
+ company: "",
3204
+ teamSize: teamSizes[0] ?? "1\u201310"
3205
+ });
3206
+ const open = phase === "signup" || phase === "creating" || phase === "welcome";
3207
+ const cardMotion = reducedMotion ? OVERLAY_MOTION : {
3208
+ initial: { opacity: 0, y: 14, scale: 0.985 },
3209
+ animate: { opacity: 1, y: 0, scale: 1 },
3210
+ exit: { opacity: 0, y: 8, scale: 0.99 }
3211
+ };
3212
+ const handleSubmit = (event) => {
3213
+ event.preventDefault();
3214
+ onSubmit(values);
3215
+ };
3216
+ const firstName = values.name.trim().split(/\s+/)[0] || "";
3217
+ const emailShown = values.email.trim() || "your inbox";
3218
+ const slug = `${slugify(values.company)}.${workspaceDomain}`;
3219
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_framer_motion6.AnimatePresence, { children: open && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3220
+ import_framer_motion6.motion.div,
3221
+ {
3222
+ className: "ods-showcase__veil",
3223
+ ...OVERLAY_MOTION,
3224
+ transition: { duration: reducedMotion ? 0 : 0.22 },
3225
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_aria4.FocusScope, { contain: true, restoreFocus: true, autoFocus: true, children: [
3226
+ phase === "signup" && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
3227
+ import_framer_motion6.motion.form,
3228
+ {
3229
+ className: "ods-showcase__glass-card",
3230
+ role: "dialog",
3231
+ "aria-modal": "true",
3232
+ "aria-labelledby": titleId,
3233
+ "aria-describedby": subtitleId,
3234
+ onSubmit: handleSubmit,
3235
+ onKeyDown: (e) => {
3236
+ if (e.key === "Escape") onBack();
3237
+ },
3238
+ ...cardMotion,
3239
+ transition: { duration: reducedMotion ? 0 : 0.3, ease: [0.2, 0.7, 0.2, 1] },
3240
+ children: [
3241
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "ods-showcase__glass-head", children: [
3242
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("h3", { id: titleId, className: "ods-showcase__glass-title", children: "Create your workspace" }),
3243
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("p", { id: subtitleId, className: "ods-showcase__microcopy", children: [
3244
+ "FREE IN PRIVATE BETA \xB7 YOUR ",
3245
+ stepCount,
3246
+ "-STEP WORKFLOW COMES WITH YOU"
3247
+ ] })
3248
+ ] }),
3249
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "ods-showcase__form-grid", children: [
3250
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "ods-showcase__field", children: [
3251
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "ods-showcase__field-label", children: "FULL NAME" }),
3252
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3253
+ Input,
3254
+ {
3255
+ "aria-label": "Full name",
3256
+ autoComplete: "name",
3257
+ placeholder: "Ada Lovelace",
3258
+ value: values.name,
3259
+ onChange: (e) => setValues((v) => ({ ...v, name: e.target.value }))
3260
+ }
3261
+ )
3262
+ ] }),
3263
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "ods-showcase__field", children: [
3264
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "ods-showcase__field-label", children: "WORK EMAIL" }),
3265
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3266
+ Input,
3267
+ {
3268
+ "aria-label": "Work email",
3269
+ type: "email",
3270
+ autoComplete: "email",
3271
+ placeholder: "ada@company.com",
3272
+ value: values.email,
3273
+ onChange: (e) => setValues((v) => ({ ...v, email: e.target.value }))
3274
+ }
3275
+ )
3276
+ ] }),
3277
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "ods-showcase__field", children: [
3278
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "ods-showcase__field-label", children: "COMPANY" }),
3279
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3280
+ Input,
3281
+ {
3282
+ "aria-label": "Company",
3283
+ autoComplete: "organization",
3284
+ placeholder: "Acme Inc.",
3285
+ value: values.company,
3286
+ onChange: (e) => setValues((v) => ({ ...v, company: e.target.value }))
3287
+ }
3288
+ )
3289
+ ] }),
3290
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "ods-showcase__field", children: [
3291
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "ods-showcase__field-label", children: "TEAM SIZE" }),
3292
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3293
+ Select,
3294
+ {
3295
+ "aria-label": "Team size",
3296
+ options: teamSizes.map((size) => ({ value: size, label: size })),
3297
+ value: values.teamSize,
3298
+ onChange: (teamSize) => setValues((v) => ({ ...v, teamSize }))
3299
+ }
3300
+ )
3301
+ ] })
3302
+ ] }),
3303
+ error && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "ods-showcase__form-error", role: "alert", children: error }),
3304
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "ods-showcase__glass-foot", children: [
3305
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "ods-showcase__microcopy", children: "NO CREDIT CARD \xB7 SSO & SELF-HOSTING LATER" }),
3306
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "ods-showcase__glass-actions", children: [
3307
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Button, { type: "button", variant: "secondary", onClick: onBack, children: "Back" }),
3308
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Button, { type: "submit", variant: "primary", children: "Create account & deploy \u2192" })
3309
+ ] })
3310
+ ] })
3311
+ ]
3312
+ },
3313
+ "signup"
3314
+ ),
3315
+ phase === "creating" && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
3316
+ import_framer_motion6.motion.div,
3317
+ {
3318
+ className: "ods-showcase__glass-card ods-showcase__glass-card--slim",
3319
+ role: "status",
3320
+ ...cardMotion,
3321
+ transition: { duration: reducedMotion ? 0 : 0.25 },
3322
+ children: [
3323
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "ods-showcase__spin", "aria-hidden": "true", children: "\u27F3" }),
3324
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "ods-showcase__creating-line", children: [
3325
+ "provisioning workspace \xB7 saving draft \xB7 inviting ",
3326
+ emailShown
3327
+ ] })
3328
+ ]
3329
+ },
3330
+ "creating"
3331
+ ),
3332
+ phase === "welcome" && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
3333
+ import_framer_motion6.motion.div,
3334
+ {
3335
+ className: "ods-showcase__glass-card ods-showcase__glass-card--welcome",
3336
+ role: "dialog",
3337
+ "aria-modal": "true",
3338
+ "aria-labelledby": titleId,
3339
+ ...cardMotion,
3340
+ transition: { duration: reducedMotion ? 0 : 0.3, ease: [0.2, 0.7, 0.2, 1] },
3341
+ children: [
3342
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "ods-showcase__glass-head", children: [
3343
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "ods-showcase__microcopy ods-showcase__microcopy--success", children: "\u2713 WORKSPACE READY" }),
3344
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("h3", { id: titleId, className: "ods-showcase__glass-title", children: [
3345
+ "Welcome to OctaviaFlow",
3346
+ firstName ? `, ${firstName}` : "",
3347
+ "."
3348
+ ] }),
3349
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("p", { className: "ods-showcase__welcome-body", children: [
3350
+ "We emailed a sign-in link to ",
3351
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("strong", { children: emailShown }),
3352
+ ". Your ",
3353
+ stepCount,
3354
+ "-step workflow is saved as a draft in",
3355
+ " ",
3356
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("code", { className: "ods-showcase__slug", children: slug }),
3357
+ " \u2014 deploy it from the dashboard whenever you're ready."
3358
+ ] })
3359
+ ] }),
3360
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "ods-showcase__glass-foot", children: [
3361
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "ods-showcase__glass-actions", children: [
3362
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("a", { className: "ods-showcase__solid-link", href: dashboardHref, children: "Open dashboard \u2192" }),
3363
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("a", { className: "ods-showcase__text-link", href: onboardingHref, children: "Book onboarding \u2192" })
3364
+ ] }),
3365
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "ods-showcase__microcopy ods-showcase__microcopy--right", children: [
3366
+ "PRIVATE BETA",
3367
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("br", {}),
3368
+ "ONBOARDING INCLUDED"
3369
+ ] })
3370
+ ] })
3371
+ ]
3372
+ },
3373
+ "welcome"
3374
+ )
3375
+ ] })
3376
+ }
3377
+ ) });
3378
+ }
3379
+
3380
+ // src/marketing/components/WorkflowShowcase/WorkflowShowcase.tsx
3381
+ var import_jsx_runtime19 = require("react/jsx-runtime");
3382
+ var EMPTY_PLAN = { left: [], right: [], all: [], totalSteps: 1 };
3383
+ function ConnectorTile({ connector }) {
3384
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3385
+ "span",
3386
+ {
3387
+ "aria-hidden": "true",
3388
+ className: cn("ods-showcase__apptile", `ods-showcase__apptile--${connector.role}`),
3389
+ children: connector.icon ?? roleGlyph(connector.role)
3390
+ }
3391
+ );
3392
+ }
3393
+ function WorkflowShowcase({
3394
+ connectors = WORKFLOW_SHOWCASE_DEFAULT_CONNECTORS,
3395
+ examples = WORKFLOW_SHOWCASE_DEFAULT_EXAMPLES,
3396
+ metrics = WORKFLOW_SHOWCASE_DEFAULT_METRICS,
3397
+ defaultPrompt = "",
3398
+ modelLabel = "octavia-core-1",
3399
+ canvasLabel = "workflow_canvas",
3400
+ railLabel = "OCTAVIA IS DOING",
3401
+ platformTiles = WORKFLOW_SHOWCASE_DEFAULT_TILES,
3402
+ coreIcon,
3403
+ catalogNote = "600+",
3404
+ teamSizes = ["1\u201310", "11\u201350", "51\u2013200", "200+"],
3405
+ workspaceDomain = "octaviaflow.com",
3406
+ dashboardHref,
3407
+ onboardingHref = "#",
3408
+ promptAriaLabel = "Describe your pipeline",
3409
+ onBuild,
3410
+ onPhaseChange,
3411
+ onSignup,
3412
+ className,
3413
+ ...rest
3414
+ }) {
3415
+ const reducedMotion = (0, import_framer_motion7.useReducedMotion)();
3416
+ const [prompt, setPrompt] = (0, import_react20.useState)(defaultPrompt);
3417
+ const [selected, setSelected] = (0, import_react20.useState)([]);
3418
+ const [phase, setPhase] = (0, import_react20.useState)("idle");
3419
+ const [shown, setShown] = (0, import_react20.useState)(0);
3420
+ const [status, setStatus] = (0, import_react20.useState)("");
3421
+ const [pickerOpen, setPickerOpen] = (0, import_react20.useState)(false);
3422
+ const [schedIdx, setSchedIdx] = (0, import_react20.useState)(0);
3423
+ const [swap, setSwap] = (0, import_react20.useState)(null);
3424
+ const [signupError, setSignupError] = (0, import_react20.useState)(null);
3425
+ const cardRef = (0, import_react20.useRef)(null);
3426
+ const timers = (0, import_react20.useRef)([]);
3427
+ const clearTimers = (0, import_react20.useCallback)(() => {
3428
+ for (const t of timers.current) clearTimeout(t);
3429
+ timers.current = [];
3430
+ }, []);
3431
+ (0, import_react20.useEffect)(() => clearTimers, [clearTimers]);
3432
+ const tempo = reducedMotion ? 0.35 : 1;
3433
+ const at = (0, import_react20.useCallback)(
3434
+ (ms, fn) => {
3435
+ timers.current.push(setTimeout(fn, ms * tempo));
3436
+ },
3437
+ [tempo]
3438
+ );
3439
+ const firstPhase = (0, import_react20.useRef)(true);
3440
+ (0, import_react20.useEffect)(() => {
3441
+ if (firstPhase.current) {
3442
+ firstPhase.current = false;
3443
+ return;
3444
+ }
3445
+ onPhaseChange?.(phase);
3446
+ }, [phase, onPhaseChange]);
3447
+ const phaseRef = (0, import_react20.useRef)(phase);
3448
+ phaseRef.current = phase;
3449
+ const byName = (0, import_react20.useMemo)(() => new Map(connectors.map((c) => [c.name, c])), [connectors]);
3450
+ const detected = (0, import_react20.useMemo)(() => detectConnectors(prompt, connectors), [prompt, connectors]);
3451
+ const union = (0, import_react20.useMemo)(() => [.../* @__PURE__ */ new Set([...selected, ...detected])], [selected, detected]);
3452
+ const settled = SETTLED_PHASES.includes(phase);
3453
+ const engaged = phase !== "idle";
3454
+ const buildingNow = phase === "analyzing" || phase === "building";
3455
+ const plan = (0, import_react20.useMemo)(() => {
3456
+ if (!selected.length) return EMPTY_PLAN;
3457
+ return resolvePlan(selected, [], connectors);
3458
+ }, [selected, connectors]);
3459
+ const schedules = WORKFLOW_SHOWCASE_SCHEDULES;
3460
+ const inferredSchedule = scheduleFromPrompt(prompt);
3461
+ const manualSchedule = schedules[schedIdx];
3462
+ const scheduleShown = inferredSchedule ?? (manualSchedule === "AUTO" ? "HOURLY" : manualSchedule);
3463
+ const startBuild = (0, import_react20.useCallback)(
3464
+ (text, baseSelected) => {
3465
+ if (phaseRef.current === "analyzing" || phaseRef.current === "building") return;
3466
+ phaseRef.current = "analyzing";
3467
+ clearTimers();
3468
+ const resolved = resolvePlan(baseSelected, detectConnectors(text, connectors), connectors);
3469
+ const target = resolved.all.map((c) => c.name);
3470
+ const additions = target.filter((n) => !baseSelected.includes(n));
3471
+ setPrompt(text);
3472
+ setSelected(baseSelected);
3473
+ setPhase("analyzing");
3474
+ setShown(0);
3475
+ setStatus("analyzing request \xB7 matching connectors");
3476
+ setPickerOpen(false);
3477
+ setSwap(null);
3478
+ onBuild?.({ prompt: text, connectors: target, schedule: scheduleShown });
3479
+ additions.forEach((name, i) => {
3480
+ at(250 + i * 200, () => setSelected((s) => s.includes(name) ? s : [...s, name]));
3481
+ });
3482
+ const t0 = 250 + additions.length * 200;
3483
+ at(t0 + 750, () => setStatus("wiring transforms \xB7 adding error handling"));
3484
+ at(t0 + 1500, () => {
3485
+ setPhase("building");
3486
+ setStatus("assembling workflow \xB7 optimizing plan");
3487
+ });
3488
+ for (let i = 0; i < resolved.totalSteps; i++) {
3489
+ at(t0 + 1600 + i * 380, () => setShown(i + 1));
3490
+ }
3491
+ at(t0 + 1600 + resolved.totalSteps * 380 + 350, () => setPhase("done"));
3492
+ },
3493
+ [clearTimers, connectors, onBuild, scheduleShown, at]
3494
+ );
3495
+ const resetToIdle = (0, import_react20.useCallback)(() => {
3496
+ clearTimers();
3497
+ phaseRef.current = "idle";
3498
+ setPhase("idle");
3499
+ setShown(0);
3500
+ setStatus("");
3501
+ setSwap(null);
3502
+ }, [clearTimers]);
3503
+ const toggleConnector = (name) => {
3504
+ resetToIdle();
3505
+ setSelected((s) => s.includes(name) ? s.filter((n) => n !== name) : [...s, name]);
3506
+ };
3507
+ const runExample = (example) => {
3508
+ resetToIdle();
3509
+ startBuild(example.prompt, []);
3510
+ };
3511
+ const openSwap = (name, text, anchor) => {
3512
+ const card = cardRef.current;
3513
+ if (!card) return;
3514
+ const r = anchor.getBoundingClientRect();
3515
+ const cr = card.getBoundingClientRect();
3516
+ const x = Math.max(8, Math.min(r.left - cr.left, cr.width - 264));
3517
+ setSwap({ name, text, x, y: r.bottom - cr.top + 6 });
3518
+ };
3519
+ const doSwap = (current, next) => {
3520
+ resetToIdle();
3521
+ const re = new RegExp(current.text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "i");
3522
+ setPrompt((p) => p.replace(re, next));
3523
+ setSelected((s) => s.map((n) => n === current.name ? next : n));
3524
+ };
3525
+ const swapRole = swap ? byName.get(swap.name)?.role : void 0;
3526
+ const swapItems = swapRole ? connectors.filter((c) => c.role === swapRole) : [];
3527
+ const roles = union.map((n) => byName.get(n)?.role);
3528
+ const hasSource = roles.includes("source");
3529
+ const hasSink = roles.some((r) => r && r !== "source");
3530
+ const hasNotify = roles.includes("notify");
3531
+ let coachLine;
3532
+ let coachAdds = [];
3533
+ const notIn = (c) => !union.includes(c.name);
3534
+ if (!union.length) {
3535
+ coachLine = prompt ? "LISTENING\u2026 CONNECTOR NAMES LIGHT UP AS OCTAVIA RECOGNIZES THEM" : `OCTAVIA MATCHES CONNECTORS LIVE AS YOU TYPE \u2014 OR PICK FROM ${catalogNote}`;
3536
+ } else if (union.length >= connectors.length) {
3537
+ coachLine = "FULL STACK \u2014 OCTAVIA SPLITS THIS INTO PARALLEL INGEST \u2192 AI TRANSFORM \u2192 SEQUENCED ACTIONS";
3538
+ } else if (union.length >= 6) {
3539
+ coachLine = `BIG STACK \u2014 ${union.length} CONNECTORS FAN OUT ACROSS PARALLEL BRANCHES \xB7 COST OPTIMIZER ON`;
3540
+ } else if (hasSource && !hasSink) {
3541
+ coachLine = "SOURCES WIRED \u2014 WHERE SHOULD THE DATA LAND?";
3542
+ coachAdds = connectors.filter((c) => c.role === "destination" && notIn(c)).slice(0, 2);
3543
+ } else if (!hasSource && hasSink) {
3544
+ coachLine = "DESTINATION SET \u2014 WHAT SHOULD OCTAVIA PULL FROM?";
3545
+ coachAdds = connectors.filter((c) => c.role === "source" && notIn(c)).slice(0, 2);
3546
+ } else if (!hasNotify) {
3547
+ coachLine = `\u2713 ${union.length} CONNECTORS \xB7 ${scheduleShown} \xB7 TIP: ALERT YOUR TEAM WHEN RUNS FINISH`;
3548
+ coachAdds = connectors.filter((c) => c.role === "notify" && notIn(c)).slice(0, 1);
3549
+ } else {
3550
+ coachLine = `\u2713 ${union.length} CONNECTORS \xB7 ${scheduleShown} \xB7 CLICK A HIGHLIGHTED NAME TO SWAP IT`;
3551
+ }
3552
+ const coachTone = union.length ? hasSource && hasSink ? "success" : "accent" : "muted";
3553
+ const badge = settled ? { label: "LIVE", tone: "success", pulse: true } : buildingNow ? {
3554
+ label: phase === "analyzing" ? "ANALYZING" : "BUILDING",
3555
+ tone: "accent",
3556
+ pulse: true
3557
+ } : { label: "IDLE", tone: "muted", pulse: false };
3558
+ const canvasSub = settled ? "production" : buildingNow ? "generating" : "draft";
3559
+ const sceneCaption = settled ? "PIPELINE LIVE \xB7 SQUARES = ROWS IN FLIGHT" : phase === "building" ? "ASSEMBLING WORKFLOW\u2026" : phase === "analyzing" ? "ANALYZING REQUEST\u2026" : "CLICK THE CORE \xB7 CONNECTORS LAND AS CUBES";
3560
+ const activity = buildActivity({ phase, shown, plan, selected, status });
3561
+ const costMetric = metrics.find((m) => m.tone === "success");
3562
+ const costLabel = costMetric ? `${costMetric.prefix ?? ""}${costMetric.value}${costMetric.suffix ?? ""}` : "";
3563
+ const railFoot = phase === "idle" ? `${catalogNote} CONNECTORS \xB7 FREE IN PRIVATE BETA` : settled ? `COST PLAN SELECTED \xB7 ${costLabel}` : "COST OPTIMIZER RUNNING\u2026";
3564
+ const nLeft = plan.left.length;
3565
+ const sceneLeft = plan.left.map((c, i) => ({
3566
+ connector: c,
3567
+ active: engaged && (settled || shown > i)
3568
+ }));
3569
+ const sceneRight = plan.right.map((c, j) => ({
3570
+ connector: c,
3571
+ active: engaged && (settled || shown > nLeft + 1 + j)
3572
+ }));
3573
+ const stepCount = (selected.length || 3) + 1;
3574
+ const doneNote = costMetric ? `${stepCount}-step workflow generated \xB7 cost optimizer: ${costMetric.value}% below baseline` : `${stepCount}-step workflow generated`;
3575
+ const submitSignup = (values) => {
3576
+ if (!values.name.trim() || !isValidEmail(values.email)) {
3577
+ setSignupError("Please enter your name and a valid work email.");
3578
+ return;
3579
+ }
3580
+ setSignupError(null);
3581
+ setPhase("creating");
3582
+ const finish = () => setPhase("welcome");
3583
+ const fail = () => {
3584
+ setSignupError("Something went wrong \u2014 please try again.");
3585
+ setPhase("signup");
3586
+ };
3587
+ if (!onSignup) {
3588
+ at(1600, finish);
3589
+ return;
3590
+ }
3591
+ try {
3592
+ const result = onSignup(values);
3593
+ if (result && typeof result.then === "function") {
3594
+ result.then(finish, fail);
3595
+ } else {
3596
+ finish();
3597
+ }
3598
+ } catch {
3599
+ fail();
3600
+ }
3601
+ };
3602
+ const segments = segmentPrompt(prompt, connectors);
3603
+ const onPromptKeyDown = (e) => {
3604
+ if (e.key === "Enter" && !e.shiftKey) {
3605
+ e.preventDefault();
3606
+ startBuild(prompt, selected);
3607
+ }
3608
+ };
3609
+ const rise = (delay = 0) => reducedMotion ? {} : {
3610
+ initial: { opacity: 0, y: 10 },
3611
+ animate: { opacity: 1, y: 0 },
3612
+ transition: { duration: 0.4, delay, ease: [0.2, 0.7, 0.2, 1] }
3613
+ };
3614
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("section", { ...rest, className: cn("ods-showcase", className), children: [
3615
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { ref: cardRef, className: "ods-showcase__card", children: [
3616
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "ods-showcase__prompt", children: [
3617
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3618
+ "textarea",
3619
+ {
3620
+ className: "ods-showcase__prompt-input",
3621
+ value: prompt,
3622
+ onChange: (e) => setPrompt(e.target.value),
3623
+ onKeyDown: onPromptKeyDown,
3624
+ "aria-label": promptAriaLabel,
3625
+ spellCheck: false,
3626
+ rows: 2
3627
+ }
3628
+ ),
3629
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "ods-showcase__prompt-render", "aria-hidden": "true", children: prompt ? segments.map(
3630
+ (seg, i) => seg.connector ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3631
+ "button",
3632
+ {
3633
+ type: "button",
3634
+ tabIndex: -1,
3635
+ className: cn(
3636
+ "ods-showcase__token",
3637
+ `ods-showcase__token--${seg.connector.role}`
3638
+ ),
3639
+ onClick: (e) => {
3640
+ const name = seg.connector?.name;
3641
+ if (name) openSwap(name, seg.text, e.currentTarget);
3642
+ },
3643
+ children: seg.text
3644
+ },
3645
+ i
3646
+ ) : (
3647
+ // biome-ignore lint/suspicious/noArrayIndexKey: segments are positional by nature
3648
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: seg.text }, i)
3649
+ )
3650
+ ) : /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
3651
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "ods-showcase__placeholder", children: "Describe your pipeline \u2014 e.g. " }),
3652
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "ods-showcase__placeholder ods-showcase__placeholder--faint", children: '"Sync Storefront orders to Warehouse hourly, alert sales in Team Chat"' })
3653
+ ] }) })
3654
+ ] }),
3655
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "ods-showcase__coach", children: [
3656
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3657
+ "span",
3658
+ {
3659
+ className: cn("ods-showcase__coach-line", `ods-showcase__coach-line--${coachTone}`),
3660
+ children: coachLine
3661
+ }
3662
+ ),
3663
+ coachAdds.map((c) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
3664
+ "button",
3665
+ {
3666
+ type: "button",
3667
+ className: "ods-showcase__coach-add",
3668
+ onClick: () => toggleConnector(c.name),
3669
+ children: [
3670
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ConnectorTile, { connector: c }),
3671
+ "+ ",
3672
+ c.name
3673
+ ]
3674
+ },
3675
+ c.name
3676
+ ))
3677
+ ] }),
3678
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_framer_motion7.AnimatePresence, { initial: false, children: pickerOpen && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3679
+ import_framer_motion7.motion.div,
3680
+ {
3681
+ className: "ods-showcase__picker",
3682
+ initial: reducedMotion ? false : { opacity: 0, height: 0 },
3683
+ animate: { opacity: 1, height: "auto" },
3684
+ exit: reducedMotion ? { opacity: 0 } : { opacity: 0, height: 0 },
3685
+ transition: { duration: 0.22, ease: [0.2, 0.7, 0.2, 1] },
3686
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "ods-showcase__picker-row", children: [
3687
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "ods-showcase__microcopy", children: "CONNECTORS" }),
3688
+ connectors.map((c) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
3689
+ "button",
3690
+ {
3691
+ type: "button",
3692
+ className: cn(
3693
+ "ods-showcase__pick",
3694
+ selected.includes(c.name) && "ods-showcase__pick--on"
3695
+ ),
3696
+ "aria-pressed": selected.includes(c.name),
3697
+ onClick: () => toggleConnector(c.name),
3698
+ children: [
3699
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ConnectorTile, { connector: c }),
3700
+ c.name
3701
+ ]
3702
+ },
3703
+ c.name
3704
+ )),
3705
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: "ods-showcase__microcopy ods-showcase__microcopy--faint", children: [
3706
+ "+ ",
3707
+ catalogNote,
3708
+ " IN THE APP"
3709
+ ] })
3710
+ ] })
3711
+ }
3712
+ ) }),
3713
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "ods-showcase__toolbar", children: [
3714
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
3715
+ "button",
3716
+ {
3717
+ type: "button",
3718
+ className: cn(
3719
+ "ods-showcase__tool",
3720
+ (pickerOpen || selected.length > 0) && "ods-showcase__tool--on"
3721
+ ),
3722
+ "aria-expanded": pickerOpen,
3723
+ onClick: () => setPickerOpen((o) => !o),
3724
+ children: [
3725
+ "\uFF0B Connectors",
3726
+ selected.length ? ` \xB7 ${selected.length}` : ""
3727
+ ]
3728
+ }
3729
+ ),
3730
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
3731
+ "button",
3732
+ {
3733
+ type: "button",
3734
+ className: "ods-showcase__tool",
3735
+ onClick: () => setSchedIdx((i) => (i + 1) % schedules.length),
3736
+ children: [
3737
+ "\u25F7 ",
3738
+ manualSchedule
3739
+ ]
3740
+ }
3741
+ ),
3742
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "ods-showcase__model", children: modelLabel }),
3743
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3744
+ Button,
3745
+ {
3746
+ variant: "primary",
3747
+ onClick: () => startBuild(prompt, selected),
3748
+ disabled: buildingNow,
3749
+ children: buildingNow ? "Building\u2026" : "Build workflow \u2192"
3750
+ }
3751
+ )
3752
+ ] }),
3753
+ swap && swapRole && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
3754
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3755
+ "button",
3756
+ {
3757
+ type: "button",
3758
+ className: "ods-showcase__swap-backdrop",
3759
+ "aria-label": "Close swap menu",
3760
+ onClick: () => setSwap(null)
3761
+ }
3762
+ ),
3763
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
3764
+ "div",
3765
+ {
3766
+ className: "ods-showcase__swap",
3767
+ role: "menu",
3768
+ style: { left: swap.x, top: swap.y },
3769
+ onKeyDown: (e) => {
3770
+ if (e.key === "Escape") setSwap(null);
3771
+ },
3772
+ children: [
3773
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "ods-showcase__swap-head", children: [
3774
+ "SWAP ",
3775
+ swapRole.toUpperCase(),
3776
+ " \u2014 ",
3777
+ swap.name.toUpperCase()
3778
+ ] }),
3779
+ swapItems.map((c) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
3780
+ "button",
3781
+ {
3782
+ type: "button",
3783
+ role: "menuitem",
3784
+ className: "ods-showcase__swap-item",
3785
+ onClick: () => doSwap(swap, c.name),
3786
+ children: [
3787
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ConnectorTile, { connector: c }),
3788
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "ods-showcase__swap-name", children: c.name }),
3789
+ c.name === swap.name && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "ods-showcase__swap-mark", children: "\u25CF CURRENT" })
3790
+ ]
3791
+ },
3792
+ c.name
3793
+ )),
3794
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "ods-showcase__swap-foot", children: [
3795
+ catalogNote,
3796
+ " CONNECTORS IN THE APP"
3797
+ ] })
3798
+ ]
3799
+ }
3800
+ )
3801
+ ] })
3802
+ ] }),
3803
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "ods-showcase__examples", children: [
3804
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "ods-showcase__microcopy", children: "TRY:" }),
3805
+ examples.map((ex) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3806
+ "button",
3807
+ {
3808
+ type: "button",
3809
+ className: "ods-showcase__try",
3810
+ onClick: () => runExample(ex),
3811
+ children: ex.label
3812
+ },
3813
+ ex.id
3814
+ ))
3815
+ ] }),
3816
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "ods-showcase__canvas", children: [
3817
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "ods-showcase__canvas-head", children: [
3818
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: "ods-showcase__microcopy", children: [
3819
+ canvasLabel,
3820
+ " \xB7 ",
3821
+ canvasSub
3822
+ ] }),
3823
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: cn("ods-showcase__badge", `ods-showcase__badge--${badge.tone}`), children: [
3824
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: cn("ods-showcase__dot", badge.pulse && "ods-showcase__dot--pulse") }),
3825
+ badge.label
3826
+ ] })
3827
+ ] }),
3828
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "ods-showcase__stage", children: [
3829
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "ods-showcase__rail", children: [
3830
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "ods-showcase__rail-head", children: [
3831
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "ods-showcase__microcopy", children: railLabel }),
3832
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3833
+ "span",
3834
+ {
3835
+ className: cn("ods-showcase__dot", badge.pulse && "ods-showcase__dot--pulse")
3836
+ }
3837
+ )
3838
+ ] }),
3839
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "ods-showcase__rail-body", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_framer_motion7.AnimatePresence, { initial: false, children: activity.map((line) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3840
+ import_framer_motion7.motion.div,
3841
+ {
3842
+ className: cn("ods-showcase__act", `ods-showcase__act--${line.tone}`),
3843
+ initial: reducedMotion ? false : { opacity: 0, y: 6 },
3844
+ animate: { opacity: 1, y: 0 },
3845
+ exit: { opacity: 0 },
3846
+ transition: { duration: 0.25 },
3847
+ children: line.text
3848
+ },
3849
+ line.id
3850
+ )) }) }),
3851
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3852
+ "div",
3853
+ {
3854
+ className: cn(
3855
+ "ods-showcase__rail-foot",
3856
+ settled && "ods-showcase__rail-foot--done",
3857
+ buildingNow && "ods-showcase__rail-foot--active"
3858
+ ),
3859
+ children: railFoot
3860
+ }
3861
+ )
3862
+ ] }),
3863
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3864
+ ShowcaseScene,
3865
+ {
3866
+ left: sceneLeft,
3867
+ right: sceneRight,
3868
+ engaged,
3869
+ tiles: platformTiles,
3870
+ coreIcon,
3871
+ caption: sceneCaption
3872
+ }
3873
+ ),
3874
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "ods-showcase__metrics", children: metrics.map((m, idx) => {
3875
+ const revealed = settled || phase === "building" && shown > idx;
3876
+ const interim = m.buildingValue != null && !settled && revealed;
3877
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "ods-showcase__metric", children: [
3878
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
3879
+ "div",
3880
+ {
3881
+ className: cn(
3882
+ "ods-showcase__metric-value",
3883
+ !revealed && "ods-showcase__metric-value--empty",
3884
+ m.tone === "success" && settled && "ods-showcase__metric-value--success"
3885
+ ),
3886
+ children: [
3887
+ settled ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3888
+ CountUp,
3889
+ {
3890
+ value: m.value,
3891
+ from: m.buildingValue ?? 0,
3892
+ decimals: m.decimals ?? 0,
3893
+ duration: reducedMotion ? 0 : 900,
3894
+ disableAnimation: Boolean(reducedMotion),
3895
+ prefix: m.prefix,
3896
+ formatValue: m.decimals ? void 0 : (v) => Math.round(v).toLocaleString("en-US")
3897
+ }
3898
+ ) : interim ? `${m.prefix ?? ""}${m.buildingValue}` : "\u2014",
3899
+ revealed && m.suffix ? m.suffix : null,
3900
+ revealed && m.unit ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: "ods-showcase__metric-unit", children: [
3901
+ " ",
3902
+ m.unit
3903
+ ] }) : null
3904
+ ]
3905
+ }
3906
+ ),
3907
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "ods-showcase__microcopy", children: m.label })
3908
+ ] }, m.id);
3909
+ }) }),
3910
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3911
+ ShowcaseSignup,
3912
+ {
3913
+ phase,
3914
+ stepCount,
3915
+ workspaceDomain,
3916
+ teamSizes,
3917
+ error: signupError,
3918
+ onSubmit: submitSignup,
3919
+ onBack: () => {
3920
+ setSignupError(null);
3921
+ setPhase("done");
3922
+ },
3923
+ dashboardHref,
3924
+ onboardingHref
3925
+ }
3926
+ )
3927
+ ] })
3928
+ ] }),
3929
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "ods-showcase__outro", "aria-live": "polite", children: [
3930
+ buildingNow && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "ods-showcase__building", children: [
3931
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "ods-showcase__spin", "aria-hidden": "true", children: "\u27F3" }),
3932
+ " ",
3933
+ status
3934
+ ] }),
3935
+ phase === "done" && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "ods-showcase__done", children: [
3936
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_framer_motion7.motion.div, { className: "ods-showcase__done-note", ...rise(0), children: [
3937
+ "\u2713 ",
3938
+ doneNote
3939
+ ] }),
3940
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_framer_motion7.motion.div, { className: "ods-showcase__cta", ...rise(0.2), children: [
3941
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "ods-showcase__cta-copy", children: "Deploy it on your own data \u2014 takes 2 minutes." }),
3942
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3943
+ Button,
3944
+ {
3945
+ variant: "primary",
3946
+ onClick: () => {
3947
+ setSignupError(null);
3948
+ setPhase("signup");
3949
+ },
3950
+ children: "Create free account \u2192"
3951
+ }
3952
+ ),
3953
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("a", { className: "ods-showcase__text-link", href: onboardingHref, children: "Book onboarding \u2192" })
3954
+ ] })
3955
+ ] })
3956
+ ] })
3957
+ ] });
3958
+ }
3959
+ // Annotate the CommonJS export names for ESM import in node:
3960
+ 0 && (module.exports = {
3961
+ ActionGlyph,
3962
+ AssistantTranscript,
3963
+ BrandMark,
3964
+ ConnectorGlyph,
3965
+ CtaBanner,
3966
+ DestinationGlyph,
3967
+ FeatureGrid,
3968
+ IntegrationsWall,
3969
+ LiveConsole,
3970
+ MarketingFooter,
3971
+ MarketingHero,
3972
+ MarketingNav,
3973
+ MarketingSection,
3974
+ NotifyGlyph,
3975
+ SourceGlyph,
3976
+ StatBand,
3977
+ WORKFLOW_SHOWCASE_DEFAULT_CONNECTORS,
3978
+ WORKFLOW_SHOWCASE_DEFAULT_EXAMPLES,
3979
+ WORKFLOW_SHOWCASE_DEFAULT_METRICS,
3980
+ WORKFLOW_SHOWCASE_DEFAULT_TILES,
3981
+ WORKFLOW_SHOWCASE_SCHEDULES,
3982
+ WorkflowShowcase,
3983
+ roleGlyph
3984
+ });
3985
+ //# sourceMappingURL=marketing.cjs.map