vibebusiness 1.2.80 → 1.2.83

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 (123) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/app-build-manifest.json +31 -31
  3. package/.next/standalone/.next/app-path-routes-manifest.json +1 -1
  4. package/.next/standalone/.next/build-manifest.json +2 -2
  5. package/.next/standalone/.next/prerender-manifest.json +1 -1
  6. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  7. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  8. package/.next/standalone/.next/server/app/_not-found.rsc +1 -1
  9. package/.next/standalone/.next/server/app/api/analyze/route.js.nft.json +1 -1
  10. package/.next/standalone/.next/server/app/api/config/route.js.nft.json +1 -1
  11. package/.next/standalone/.next/server/app/api/epics/[id]/ideas/route.js.nft.json +1 -1
  12. package/.next/standalone/.next/server/app/api/epics/[id]/route.js.nft.json +1 -1
  13. package/.next/standalone/.next/server/app/api/epics/route.js.nft.json +1 -1
  14. package/.next/standalone/.next/server/app/api/goals/[id]/kpis/route.js.nft.json +1 -1
  15. package/.next/standalone/.next/server/app/api/goals/[id]/route.js.nft.json +1 -1
  16. package/.next/standalone/.next/server/app/api/goals/route.js.nft.json +1 -1
  17. package/.next/standalone/.next/server/app/api/hypotheses/[id]/route.js.nft.json +1 -1
  18. package/.next/standalone/.next/server/app/api/hypotheses/route.js.nft.json +1 -1
  19. package/.next/standalone/.next/server/app/api/ideas/[id]/card/route.js.nft.json +1 -1
  20. package/.next/standalone/.next/server/app/api/ideas/[id]/comments/route.js.nft.json +1 -1
  21. package/.next/standalone/.next/server/app/api/ideas/[id]/implement/route.js.nft.json +1 -1
  22. package/.next/standalone/.next/server/app/api/ideas/[id]/route.js.nft.json +1 -1
  23. package/.next/standalone/.next/server/app/api/ideas/[id]/transition/route.js +1 -1
  24. package/.next/standalone/.next/server/app/api/ideas/[id]/transition/route.js.nft.json +1 -1
  25. package/.next/standalone/.next/server/app/api/ideas/route.js.nft.json +1 -1
  26. package/.next/standalone/.next/server/app/api/implementations/route.js.nft.json +1 -1
  27. package/.next/standalone/.next/server/app/api/kpis/refresh/route.js.nft.json +1 -1
  28. package/.next/standalone/.next/server/app/api/social/[id]/publish/route.js +1 -1
  29. package/.next/standalone/.next/server/app/api/social/[id]/publish/route.js.nft.json +1 -1
  30. package/.next/standalone/.next/server/app/api/social/[id]/route.js.nft.json +1 -1
  31. package/.next/standalone/.next/server/app/api/social/route.js.nft.json +1 -1
  32. package/.next/standalone/.next/server/app/goals/[id]/page_client-reference-manifest.js +1 -1
  33. package/.next/standalone/.next/server/app/goals/page.js.nft.json +1 -1
  34. package/.next/standalone/.next/server/app/goals/page_client-reference-manifest.js +1 -1
  35. package/.next/standalone/.next/server/app/hypotheses/[id]/page_client-reference-manifest.js +1 -1
  36. package/.next/standalone/.next/server/app/hypotheses/page.js.nft.json +1 -1
  37. package/.next/standalone/.next/server/app/hypotheses/page_client-reference-manifest.js +1 -1
  38. package/.next/standalone/.next/server/app/ideas/[id]/page.js.nft.json +1 -1
  39. package/.next/standalone/.next/server/app/ideas/[id]/page_client-reference-manifest.js +1 -1
  40. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  41. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  42. package/.next/standalone/.next/server/app/roadmap/[id]/page_client-reference-manifest.js +1 -1
  43. package/.next/standalone/.next/server/app/roadmap/investors/page.js.nft.json +1 -1
  44. package/.next/standalone/.next/server/app/roadmap/investors/page_client-reference-manifest.js +1 -1
  45. package/.next/standalone/.next/server/app/roadmap/page.js.nft.json +1 -1
  46. package/.next/standalone/.next/server/app/roadmap/page_client-reference-manifest.js +1 -1
  47. package/.next/standalone/.next/server/app/roadmap/public/page.js.nft.json +1 -1
  48. package/.next/standalone/.next/server/app/roadmap/public/page_client-reference-manifest.js +1 -1
  49. package/.next/standalone/.next/server/app/sessions/page.js.nft.json +1 -1
  50. package/.next/standalone/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  51. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  52. package/.next/standalone/.next/server/app/settings.html +1 -1
  53. package/.next/standalone/.next/server/app/settings.rsc +1 -1
  54. package/.next/standalone/.next/server/app/social/page_client-reference-manifest.js +1 -1
  55. package/.next/standalone/.next/server/app/social.html +1 -1
  56. package/.next/standalone/.next/server/app/social.rsc +2 -2
  57. package/.next/standalone/.next/server/app/updates/[id]/page.js.nft.json +1 -1
  58. package/.next/standalone/.next/server/app/updates/[id]/page_client-reference-manifest.js +1 -1
  59. package/.next/standalone/.next/server/app/updates/new/page_client-reference-manifest.js +1 -1
  60. package/.next/standalone/.next/server/app/updates/new.html +1 -1
  61. package/.next/standalone/.next/server/app/updates/new.rsc +2 -2
  62. package/.next/standalone/.next/server/app/updates/page.js.nft.json +1 -1
  63. package/.next/standalone/.next/server/app/updates/page_client-reference-manifest.js +1 -1
  64. package/.next/standalone/.next/server/app-paths-manifest.json +21 -21
  65. package/.next/standalone/.next/server/chunks/{3794.js → 7151.js} +27 -27
  66. package/.next/standalone/.next/server/pages/404.html +1 -1
  67. package/.next/standalone/.next/server/pages/500.html +1 -1
  68. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  69. package/.next/standalone/data/business-context.json +1 -1
  70. package/.next/standalone/data/heartbeat-sessions.json +228 -0
  71. package/.next/standalone/data/ideas.json +510 -34
  72. package/.next/standalone/data/implementations.json +129 -0
  73. package/.next/standalone/data/videos/staging/while-you-slept-demo.json +66 -0
  74. package/.next/standalone/data/videos/while-you-slept-demo-feed.mp4 +0 -0
  75. package/.next/standalone/node_modules/.cache/webpack/remotion-production-4.0.428/c99d23d3548030c8ff8de678c71eeb15/0.pack +0 -0
  76. package/.next/standalone/node_modules/.cache/webpack/remotion-production-4.0.428/c99d23d3548030c8ff8de678c71eeb15/1.pack +0 -0
  77. package/.next/standalone/node_modules/.cache/webpack/remotion-production-4.0.428/c99d23d3548030c8ff8de678c71eeb15/2.pack +0 -0
  78. package/.next/standalone/node_modules/.cache/webpack/remotion-production-4.0.428/c99d23d3548030c8ff8de678c71eeb15/index.pack +0 -0
  79. package/.next/standalone/node_modules/.cache/webpack/remotion-production-4.0.428/c99d23d3548030c8ff8de678c71eeb15/index.pack.old +0 -0
  80. package/.next/standalone/package.json +1 -1
  81. package/.next/standalone/scripts/analyze.ts +1 -15
  82. package/.next/standalone/templates/commands/build-page.md +163 -0
  83. package/.next/standalone/templates/commands/email-marketing.md +339 -0
  84. package/.next/standalone/templates/commands/growth-audit.md +85 -0
  85. package/.next/standalone/templates/commands/launch-campaign.md +84 -0
  86. package/.next/standalone/templates/commands/manage.md +147 -0
  87. package/.next/standalone/templates/commands/measure-page.md +89 -0
  88. package/.next/standalone/templates/commands/positioning.md +128 -0
  89. package/.next/standalone/templates/commands/pricing-analysis.md +91 -0
  90. package/.next/standalone/templates/commands/promo-copy.md +186 -0
  91. package/.next/standalone/templates/commands/promo-video.md +75 -0
  92. package/.next/standalone/templates/commands/research-competitors.md +124 -0
  93. package/.next/standalone/templates/commands/setup-payments.md +107 -0
  94. package/.next/standalone/templates/commands/setup-posthog.md +116 -0
  95. package/.next/standalone/templates/commands/social-media.md +47 -0
  96. package/.next/standalone/templates/commands/status-summary.md +103 -0
  97. package/.next/standalone/templates/commands/validate-idea.md +102 -0
  98. package/.next/standalone/templates/emails/__tests__/validate-templates.test.ts +147 -0
  99. package/.next/standalone/templates/emails/day3-activation-feedback.txt +14 -0
  100. package/.next/standalone/templates/emails/day30-pmf-feedback.txt +19 -0
  101. package/.next/static/chunks/429-8f4030371ebef5c3.js +1 -0
  102. package/.next/static/chunks/827-6cf4bfc10d1ff0c7.js +1 -0
  103. package/.next/static/chunks/app/goals/[id]/page-231bb4daae0f06eb.js +1 -0
  104. package/.next/static/chunks/app/ideas/[id]/page-b3dfe1e61fc656a4.js +1 -0
  105. package/.next/static/chunks/app/roadmap/[id]/page-b93a96f017c8d3dd.js +1 -0
  106. package/.next/static/chunks/app/social/page-5211c78a5f37df65.js +1 -0
  107. package/.next/static/chunks/app/updates/new/page-dcc67ffca587dcc2.js +1 -0
  108. package/.next/static/css/654766eb547c6bab.css +3 -0
  109. package/dist/scripts/analyze.js +1 -14
  110. package/dist/scripts/heartbeat.js +224 -130
  111. package/package.json +1 -1
  112. package/scripts/lib/video/compositions/DemoVideo.tsx +425 -0
  113. package/scripts/lib/video/compositions/Root.tsx +24 -1
  114. package/.next/static/chunks/429-c3cc9856a8a9d0d4.js +0 -1
  115. package/.next/static/chunks/827-d5a9d09b31d7eb1c.js +0 -1
  116. package/.next/static/chunks/app/goals/[id]/page-7a60dffb8ee860ed.js +0 -1
  117. package/.next/static/chunks/app/ideas/[id]/page-565f78e223048e74.js +0 -1
  118. package/.next/static/chunks/app/roadmap/[id]/page-54f51490662106f5.js +0 -1
  119. package/.next/static/chunks/app/social/page-574752c4e67413de.js +0 -1
  120. package/.next/static/chunks/app/updates/new/page-c5da11133140a7f4.js +0 -1
  121. package/.next/static/css/ba6f5fe78931fee2.css +0 -3
  122. /package/.next/static/{9C8sbF668J83TlKDjSvQm → wJT1h-ifHTtYVlXZG2PFS}/_buildManifest.js +0 -0
  123. /package/.next/static/{9C8sbF668J83TlKDjSvQm → wJT1h-ifHTtYVlXZG2PFS}/_ssgManifest.js +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibebusiness",
3
- "version": "1.2.80",
3
+ "version": "1.2.83",
4
4
  "description": "AI-powered autonomous product manager. Research. Build. Ship. Grow.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "private": false,
@@ -0,0 +1,425 @@
1
+ /**
2
+ * DemoVideo — marketing/demo video composition with custom scene types.
3
+ *
4
+ * Extends standard slide types with specialized marketing scenes:
5
+ * - terminal: typewriter terminal output
6
+ * - notification: slide-in notification card
7
+ * - kanban: kanban board visualization
8
+ * - pipeline: flowchart with animated progress
9
+ *
10
+ * Format: Feed (1080×1080) for landing page
11
+ * Total: 810 frames (27s at 30fps)
12
+ */
13
+
14
+ import React from 'react';
15
+ import { AbsoluteFill, Sequence, useCurrentFrame, interpolate } from 'remotion';
16
+ import { BackgroundMusic } from './BackgroundMusic';
17
+ import type { AudioConfig } from '../renderer';
18
+
19
+ // ─── Types ──────────────────────────────────────────────────────────────────
20
+
21
+ export interface DemoSlideData {
22
+ type: 'cover' | 'terminal' | 'key_point' | 'notification' | 'steps' | 'kanban' | 'pipeline' | 'quote' | 'cta';
23
+ title: string;
24
+ subtitle?: string;
25
+ content?: string;
26
+ items?: string[];
27
+ value?: string;
28
+ label?: string;
29
+ background_style?: string;
30
+ cta_text?: string;
31
+ }
32
+
33
+ export interface DemoVideoProps {
34
+ slides: DemoSlideData[];
35
+ format: 'feed' | 'reels';
36
+ audio?: AudioConfig;
37
+ }
38
+
39
+ // ─── Constants ──────────────────────────────────────────────────────────────
40
+
41
+ const ACCENT = '#10b981';
42
+ const TEXT = '#ffffff';
43
+ const MUTED = 'rgba(255,255,255,0.6)';
44
+ const FONT = '"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif';
45
+
46
+ // Custom frame durations for different scene types
47
+ const FRAME_DURATIONS: Record<string, number> = {
48
+ cover: 90, // 3s
49
+ terminal: 150, // 5s
50
+ key_point: 90, // 3s
51
+ notification: 90, // 3s
52
+ steps: 150, // 5s (kanban)
53
+ kanban: 150, // 5s
54
+ pipeline: 135, // 4.5s
55
+ quote: 135, // 4.5s
56
+ cta: 105, // 3.5s
57
+ };
58
+
59
+ // ─── DemoVideo ──────────────────────────────────────────────────────────────
60
+
61
+ export const DemoVideo: React.FC<DemoVideoProps> = ({ slides, audio }) => {
62
+ let currentFrame = 0;
63
+
64
+ return (
65
+ <AbsoluteFill
66
+ style={{
67
+ background: 'linear-gradient(135deg, #0f172a 0%, #1e293b 100%)',
68
+ }}
69
+ >
70
+ {slides.map((slide, i) => {
71
+ const duration = FRAME_DURATIONS[slide.type] || 90;
72
+ const from = currentFrame;
73
+ currentFrame += duration;
74
+
75
+ return (
76
+ <Sequence key={i} from={from} durationInFrames={duration}>
77
+ <DemoSlide slide={slide} />
78
+ </Sequence>
79
+ );
80
+ })}
81
+ {audio && <BackgroundMusic audio={audio} />}
82
+ </AbsoluteFill>
83
+ );
84
+ };
85
+
86
+ // ─── DemoSlide ──────────────────────────────────────────────────────────────
87
+
88
+ const DemoSlide: React.FC<{ slide: DemoSlideData }> = ({ slide }) => {
89
+ const frame = useCurrentFrame();
90
+ const opacity = interpolate(frame, [0, 15], [0, 1], { extrapolateRight: 'clamp' });
91
+ const y = interpolate(frame, [0, 15], [24, 0], { extrapolateRight: 'clamp' });
92
+
93
+ return (
94
+ <AbsoluteFill
95
+ style={{
96
+ opacity,
97
+ transform: `translateY(${y}px)`,
98
+ fontFamily: FONT,
99
+ color: TEXT,
100
+ padding: '80px',
101
+ display: 'flex',
102
+ flexDirection: 'column',
103
+ justifyContent: 'center',
104
+ alignItems: 'flex-start',
105
+ }}
106
+ >
107
+ <SlideContent slide={slide} />
108
+ </AbsoluteFill>
109
+ );
110
+ };
111
+
112
+ // ─── Slide content by type ──────────────────────────────────────────────────
113
+
114
+ function SlideContent({ slide }: { slide: DemoSlideData }) {
115
+ const frame = useCurrentFrame();
116
+
117
+ switch (slide.type) {
118
+ case 'cover':
119
+ return (
120
+ <>
121
+ <h1
122
+ style={{
123
+ fontSize: 72,
124
+ fontWeight: 900,
125
+ lineHeight: 1.1,
126
+ margin: 0,
127
+ marginBottom: 20,
128
+ color: TEXT,
129
+ }}
130
+ >
131
+ {slide.title}
132
+ </h1>
133
+ {slide.subtitle && (
134
+ <p style={{ fontSize: 36, color: MUTED, fontWeight: 400, margin: 0 }}>
135
+ {slide.subtitle}
136
+ </p>
137
+ )}
138
+ </>
139
+ );
140
+
141
+ case 'terminal':
142
+ return <TerminalScene title={slide.title} content={slide.content || ''} frame={frame} />;
143
+
144
+ case 'notification':
145
+ return <NotificationScene title={slide.title} content={slide.content || ''} frame={frame} />;
146
+
147
+ case 'key_point':
148
+ return (
149
+ <>
150
+ <div
151
+ style={{
152
+ fontSize: 13,
153
+ fontWeight: 600,
154
+ letterSpacing: 2,
155
+ color: ACCENT,
156
+ textTransform: 'uppercase',
157
+ marginBottom: 16,
158
+ }}
159
+ >
160
+ {slide.title}
161
+ </div>
162
+ <p style={{ fontSize: 40, fontWeight: 600, lineHeight: 1.4, margin: 0, color: TEXT }}>
163
+ {slide.content}
164
+ </p>
165
+ </>
166
+ );
167
+
168
+ case 'steps':
169
+ case 'kanban':
170
+ return <KanbanScene title={slide.title} items={slide.items || []} frame={frame} />;
171
+
172
+ case 'pipeline':
173
+ return <PipelineScene title={slide.title} content={slide.content || ''} label={slide.label} frame={frame} />;
174
+
175
+ case 'quote':
176
+ return (
177
+ <>
178
+ <div
179
+ style={{
180
+ width: 48,
181
+ height: 4,
182
+ background: ACCENT,
183
+ marginBottom: 32,
184
+ borderRadius: 2,
185
+ }}
186
+ />
187
+ <p
188
+ style={{
189
+ fontSize: 36,
190
+ fontWeight: 600,
191
+ lineHeight: 1.5,
192
+ margin: 0,
193
+ marginBottom: 32,
194
+ fontStyle: 'italic',
195
+ color: TEXT,
196
+ }}
197
+ >
198
+ &ldquo;{slide.content}&rdquo;
199
+ </p>
200
+ </>
201
+ );
202
+
203
+ case 'cta':
204
+ return (
205
+ <>
206
+ <h2
207
+ style={{
208
+ fontSize: 56,
209
+ fontWeight: 800,
210
+ lineHeight: 1.1,
211
+ margin: 0,
212
+ marginBottom: 40,
213
+ color: TEXT,
214
+ }}
215
+ >
216
+ {slide.title}
217
+ </h2>
218
+ <div
219
+ style={{
220
+ padding: '20px 40px',
221
+ background: ACCENT,
222
+ borderRadius: 12,
223
+ fontSize: 22,
224
+ fontWeight: 700,
225
+ color: '#0f172a',
226
+ fontFamily: 'monospace',
227
+ }}
228
+ >
229
+ {slide.cta_text || 'Get Started'}
230
+ </div>
231
+ </>
232
+ );
233
+
234
+ default:
235
+ return <div style={{ fontSize: 32 }}>{slide.title}</div>;
236
+ }
237
+ }
238
+
239
+ // ─── Custom Scene Components ────────────────────────────────────────────────
240
+
241
+ function TerminalScene({ title, content, frame }: { title: string; content: string; frame: number }) {
242
+ // Typewriter effect
243
+ const lines = content.split('\n');
244
+ const charsPerFrame = 2;
245
+ const visibleChars = Math.floor(frame * charsPerFrame);
246
+
247
+ let charCount = 0;
248
+ const visibleLines = lines.map((line) => {
249
+ const lineStart = charCount;
250
+ charCount += line.length + 1; // +1 for newline
251
+ const lineEnd = lineStart + line.length;
252
+
253
+ if (visibleChars < lineStart) return '';
254
+ if (visibleChars >= lineEnd) return line;
255
+ return line.slice(0, visibleChars - lineStart);
256
+ });
257
+
258
+ return (
259
+ <div style={{ width: '100%' }}>
260
+ <div
261
+ style={{
262
+ fontSize: 13,
263
+ fontWeight: 600,
264
+ letterSpacing: 2,
265
+ color: ACCENT,
266
+ textTransform: 'uppercase',
267
+ marginBottom: 24,
268
+ }}
269
+ >
270
+ {title}
271
+ </div>
272
+ <div
273
+ style={{
274
+ background: 'rgba(15, 23, 42, 0.8)',
275
+ border: `1px solid ${ACCENT}`,
276
+ borderRadius: 8,
277
+ padding: '32px',
278
+ fontFamily: 'monospace',
279
+ fontSize: 20,
280
+ lineHeight: 1.8,
281
+ }}
282
+ >
283
+ {visibleLines.map((line, i) => (
284
+ <div key={i} style={{ color: i === visibleLines.length - 1 ? ACCENT : TEXT }}>
285
+ {line || '\u00A0'}
286
+ </div>
287
+ ))}
288
+ </div>
289
+ </div>
290
+ );
291
+ }
292
+
293
+ function NotificationScene({ title, content, frame }: { title: string; content: string; frame: number }) {
294
+ // Slide in from right
295
+ const x = interpolate(frame, [0, 20], [100, 0], { extrapolateRight: 'clamp' });
296
+
297
+ return (
298
+ <div style={{ width: '100%', display: 'flex', flexDirection: 'column', alignItems: 'center' }}>
299
+ <div
300
+ style={{
301
+ fontSize: 80,
302
+ fontWeight: 900,
303
+ color: TEXT,
304
+ marginBottom: 40,
305
+ }}
306
+ >
307
+ {title}
308
+ </div>
309
+ <div
310
+ style={{
311
+ transform: `translateX(${x}px)`,
312
+ background: 'rgba(16, 185, 129, 0.1)',
313
+ border: `2px solid ${ACCENT}`,
314
+ borderRadius: 16,
315
+ padding: '32px 48px',
316
+ boxShadow: `0 0 40px rgba(16, 185, 129, 0.3)`,
317
+ }}
318
+ >
319
+ <div style={{ fontSize: 32, fontWeight: 600, color: TEXT }}>{content}</div>
320
+ </div>
321
+ </div>
322
+ );
323
+ }
324
+
325
+ function KanbanScene({ title, items, frame }: { title: string; items: string[]; frame: number }) {
326
+ return (
327
+ <div style={{ width: '100%' }}>
328
+ <div
329
+ style={{
330
+ fontSize: 13,
331
+ fontWeight: 600,
332
+ letterSpacing: 2,
333
+ color: ACCENT,
334
+ textTransform: 'uppercase',
335
+ marginBottom: 32,
336
+ }}
337
+ >
338
+ {title}
339
+ </div>
340
+ <div style={{ display: 'flex', gap: 24 }}>
341
+ {items.map((item, i) => {
342
+ const delay = i * 10;
343
+ const opacity = interpolate(frame, [delay, delay + 15], [0, 1], { extrapolateRight: 'clamp' });
344
+ const scale = interpolate(frame, [delay, delay + 15], [0.8, 1], { extrapolateRight: 'clamp' });
345
+
346
+ return (
347
+ <div
348
+ key={i}
349
+ style={{
350
+ flex: 1,
351
+ opacity,
352
+ transform: `scale(${scale})`,
353
+ background: 'rgba(15, 23, 42, 0.6)',
354
+ border: `1px solid ${i === 2 ? ACCENT : 'rgba(255,255,255,0.1)'}`,
355
+ borderRadius: 12,
356
+ padding: '24px 20px',
357
+ boxShadow: i === 2 ? `0 0 20px rgba(16, 185, 129, 0.3)` : 'none',
358
+ }}
359
+ >
360
+ <div style={{ fontSize: 24, fontWeight: 600, color: TEXT, textAlign: 'center' }}>
361
+ {item}
362
+ </div>
363
+ </div>
364
+ );
365
+ })}
366
+ </div>
367
+ </div>
368
+ );
369
+ }
370
+
371
+ function PipelineScene({ title, content, label, frame }: { title: string; content: string; label?: string; frame: number }) {
372
+ const steps = content.split(' → ');
373
+ const progress = interpolate(frame, [0, 100], [0, 1], { extrapolateRight: 'clamp' });
374
+
375
+ return (
376
+ <div style={{ width: '100%' }}>
377
+ <div
378
+ style={{
379
+ fontSize: 13,
380
+ fontWeight: 600,
381
+ letterSpacing: 2,
382
+ color: ACCENT,
383
+ textTransform: 'uppercase',
384
+ marginBottom: 32,
385
+ }}
386
+ >
387
+ {title}
388
+ </div>
389
+ <div style={{ display: 'flex', alignItems: 'center', gap: 16, marginBottom: 32 }}>
390
+ {steps.map((step, i) => (
391
+ <React.Fragment key={i}>
392
+ <div
393
+ style={{
394
+ padding: '16px 24px',
395
+ background: i / (steps.length - 1) <= progress ? ACCENT : 'rgba(255,255,255,0.1)',
396
+ borderRadius: 8,
397
+ fontSize: 20,
398
+ fontWeight: 600,
399
+ color: i / (steps.length - 1) <= progress ? '#0f172a' : TEXT,
400
+ transition: 'all 0.3s',
401
+ }}
402
+ >
403
+ {step}
404
+ </div>
405
+ {i < steps.length - 1 && (
406
+ <div style={{ fontSize: 24, color: MUTED }}>→</div>
407
+ )}
408
+ </React.Fragment>
409
+ ))}
410
+ </div>
411
+ {label && (
412
+ <div
413
+ style={{
414
+ fontSize: 48,
415
+ fontWeight: 800,
416
+ color: ACCENT,
417
+ textAlign: 'center',
418
+ }}
419
+ >
420
+ {label}
421
+ </div>
422
+ )}
423
+ </div>
424
+ );
425
+ }
@@ -1,11 +1,12 @@
1
1
  /**
2
2
  * Root — Remotion entry point.
3
3
  *
4
- * Registers 4 compositions:
4
+ * Registers 5 compositions:
5
5
  * ShipFeed — 7-slide ship announcement, 1080×1080
6
6
  * ShipReels — 7-slide ship announcement, 1080×1920
7
7
  * AdFeed — 5-7 slide ad video, 1080×1080
8
8
  * AdReels — 5-7 slide ad video, 1080×1920
9
+ * DemoFeed — marketing demo video with custom scenes, 1080×1080
9
10
  *
10
11
  * Ad compositions use calculateMetadata for dynamic duration — Claude may
11
12
  * generate 5-7 slides, so duration is computed from props at render time.
@@ -20,6 +21,8 @@ import { ShipVideo } from './ShipVideo';
20
21
  import type { ShipVideoProps } from './ShipVideo';
21
22
  import { AdVideo } from './AdVideo';
22
23
  import type { AdVideoProps } from './AdVideo';
24
+ import { DemoVideo } from './DemoVideo';
25
+ import type { DemoVideoProps, DemoSlideData } from './DemoVideo';
23
26
  import type { SlideData } from './Slide';
24
27
 
25
28
  // Remotion v4 Composition requires both <Schema, Props> type args.
@@ -27,6 +30,7 @@ import type { SlideData } from './Slide';
27
30
  type AnyComp = React.ComponentType<Record<string, unknown>>;
28
31
  const ShipComp = ShipVideo as unknown as AnyComp;
29
32
  const AdComp = AdVideo as unknown as AnyComp;
33
+ const DemoComp = DemoVideo as unknown as AnyComp;
30
34
 
31
35
  // ─── Frame counts ────────────────────────────────────────────────────────────
32
36
 
@@ -45,6 +49,16 @@ const placeholderSlide: SlideData = {
45
49
  const defaultShipSlides: SlideData[] = Array(SHIP_SLIDE_COUNT).fill(placeholderSlide);
46
50
  const defaultAdSlides: SlideData[] = Array(AD_SLIDE_COUNT_DEFAULT).fill(placeholderSlide);
47
51
 
52
+ const defaultDemoSlides: DemoSlideData[] = [
53
+ { type: 'cover', title: 'Demo Preview', subtitle: 'While You Slept' },
54
+ { type: 'terminal', title: 'Processing', content: 'Loading...' },
55
+ { type: 'key_point', title: 'Key Point', content: 'Demo content' },
56
+ { type: 'notification', title: 'Alert', content: 'Demo notification' },
57
+ { type: 'kanban', title: 'Board', items: ['Col 1', 'Col 2', 'Col 3', 'Col 4'] },
58
+ { type: 'pipeline', title: 'Pipeline', content: 'Step 1 → Step 2 → Step 3' },
59
+ { type: 'cta', title: 'Get Started', cta_text: 'npm install vibebusiness' },
60
+ ];
61
+
48
62
  // ─── Root component ──────────────────────────────────────────────────────────
49
63
 
50
64
  export const RemotionRoot: React.FC = () => {
@@ -94,6 +108,15 @@ export const RemotionRoot: React.FC = () => {
94
108
  props,
95
109
  })}
96
110
  />
111
+ <Composition
112
+ id="DemoFeed"
113
+ component={DemoComp}
114
+ durationInFrames={810} // 27 seconds at 30fps
115
+ fps={30}
116
+ width={1080}
117
+ height={1080}
118
+ defaultProps={{ slides: defaultDemoSlides, format: 'feed' } as DemoVideoProps}
119
+ />
97
120
  </>
98
121
  );
99
122
  };
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[429],{9205:function(t,e,n){"use strict";n.d(e,{Z:function(){return o}});var r=n(2265);let u=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),i=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.filter((t,e,n)=>!!t&&n.indexOf(t)===e).join(" ")};var c={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let a=(0,r.forwardRef)((t,e)=>{let{color:n="currentColor",size:u=24,strokeWidth:a=2,absoluteStrokeWidth:o,className:l="",children:s,iconNode:h,...f}=t;return(0,r.createElement)("svg",{ref:e,...c,width:u,height:u,stroke:n,strokeWidth:o?24*Number(a)/Number(u):a,className:i("lucide",l),...f},[...h.map(t=>{let[e,n]=t;return(0,r.createElement)(e,n)}),...Array.isArray(s)?s:[s]])}),o=(t,e)=>{let n=(0,r.forwardRef)((n,c)=>{let{className:o,...l}=n;return(0,r.createElement)(a,{ref:c,iconNode:e,className:i("lucide-".concat(u(t)),o),...l})});return n.displayName="".concat(t),n}},1178:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9205).Z)("Bookmark",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]])},2222:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9205).Z)("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]])},1047:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9205).Z)("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]])},401:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9205).Z)("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},875:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9205).Z)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},2135:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9205).Z)("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},9322:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9205).Z)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},6362:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9205).Z)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},2208:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9205).Z)("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},6399:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9205).Z)("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]])},8220:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9205).Z)("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]])},8997:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9205).Z)("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]])},5621:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9205).Z)("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]])},5466:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9205).Z)("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]])},2048:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9205).Z)("Map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]])},2718:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9205).Z)("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]])},5675:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9205).Z)("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])},9397:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9205).Z)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},7168:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9205).Z)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},4743:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9205).Z)("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]])},8728:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9205).Z)("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},2023:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9205).Z)("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]])},8896:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9205).Z)("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]])},8930:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9205).Z)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},525:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9205).Z)("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]])},2489:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9205).Z)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},1239:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9205).Z)("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]])},7648:function(t,e,n){"use strict";n.d(e,{default:function(){return u.a}});var r=n(2972),u=n.n(r)},9376:function(t,e,n){"use strict";var r=n(5475);n.o(r,"usePathname")&&n.d(e,{usePathname:function(){return r.usePathname}}),n.o(r,"useRouter")&&n.d(e,{useRouter:function(){return r.useRouter}})},257:function(t,e,n){"use strict";var r,u;t.exports=(null==(r=n.g.process)?void 0:r.env)&&"object"==typeof(null==(u=n.g.process)?void 0:u.env)?n.g.process:n(4227)},4227:function(t){!function(){var e={229:function(t){var e,n,r,u=t.exports={};function i(){throw Error("setTimeout has not been defined")}function c(){throw Error("clearTimeout has not been defined")}function a(t){if(e===setTimeout)return setTimeout(t,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(n){try{return e.call(null,t,0)}catch(n){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:i}catch(t){e=i}try{n="function"==typeof clearTimeout?clearTimeout:c}catch(t){n=c}}();var o=[],l=!1,s=-1;function h(){l&&r&&(l=!1,r.length?o=r.concat(o):s=-1,o.length&&f())}function f(){if(!l){var t=a(h);l=!0;for(var e=o.length;e;){for(r=o,o=[];++s<e;)r&&r[s].run();s=-1,e=o.length}r=null,l=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===c||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function y(){}u.nextTick=function(t){var e=Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];o.push(new d(t,e)),1!==o.length||l||a(f)},d.prototype.run=function(){this.fun.apply(null,this.array)},u.title="browser",u.browser=!0,u.env={},u.argv=[],u.version="",u.versions={},u.on=y,u.addListener=y,u.once=y,u.off=y,u.removeListener=y,u.removeAllListeners=y,u.emit=y,u.prependListener=y,u.prependOnceListener=y,u.listeners=function(t){return[]},u.binding=function(t){throw Error("process.binding is not supported")},u.cwd=function(){return"/"},u.chdir=function(t){throw Error("process.chdir is not supported")},u.umask=function(){return 0}}},n={};function r(t){var u=n[t];if(void 0!==u)return u.exports;var i=n[t]={exports:{}},c=!0;try{e[t](i,i.exports,r),c=!1}finally{c&&delete n[t]}return i.exports}r.ab="//";var u=r(229);t.exports=u}()},1994:function(t,e,n){"use strict";e.Z=function(){for(var t,e,n=0,r="",u=arguments.length;n<u;n++)(t=arguments[n])&&(e=function t(e){var n,r,u="";if("string"==typeof e||"number"==typeof e)u+=e;else if("object"==typeof e){if(Array.isArray(e)){var i=e.length;for(n=0;n<i;n++)e[n]&&(r=t(e[n]))&&(u&&(u+=" "),u+=r)}else for(r in e)e[r]&&(u&&(u+=" "),u+=r)}return u}(t))&&(r&&(r+=" "),r+=e);return r}}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[827],{9205:function(t,e,r){"use strict";r.d(e,{Z:function(){return o}});var n=r(2265);let i=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),u=function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return e.filter((t,e,r)=>!!t&&r.indexOf(t)===e).join(" ")};var a={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let c=(0,n.forwardRef)((t,e)=>{let{color:r="currentColor",size:i=24,strokeWidth:c=2,absoluteStrokeWidth:o,className:l="",children:s,iconNode:h,...f}=t;return(0,n.createElement)("svg",{ref:e,...a,width:i,height:i,stroke:r,strokeWidth:o?24*Number(c)/Number(i):c,className:u("lucide",l),...f},[...h.map(t=>{let[e,r]=t;return(0,n.createElement)(e,r)}),...Array.isArray(s)?s:[s]])}),o=(t,e)=>{let r=(0,n.forwardRef)((r,a)=>{let{className:o,...l}=r;return(0,n.createElement)(c,{ref:a,iconNode:e,className:u("lucide-".concat(i(t)),o),...l})});return r.displayName="".concat(t),r}},2660:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(9205).Z)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},2222:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(9205).Z)("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]])},1047:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(9205).Z)("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]])},2934:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(9205).Z)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},6362:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(9205).Z)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},8220:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(9205).Z)("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]])},5621:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(9205).Z)("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]])},5466:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(9205).Z)("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]])},5846:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(9205).Z)("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]])},2048:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(9205).Z)("Map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]])},2718:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(9205).Z)("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]])},9554:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(9205).Z)("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]])},7168:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(9205).Z)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},8728:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(9205).Z)("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},2023:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(9205).Z)("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]])},8896:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(9205).Z)("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]])},525:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(9205).Z)("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]])},6865:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(9205).Z)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},7648:function(t,e,r){"use strict";r.d(e,{default:function(){return i.a}});var n=r(2972),i=r.n(n)},9376:function(t,e,r){"use strict";var n=r(5475);r.o(n,"usePathname")&&r.d(e,{usePathname:function(){return n.usePathname}}),r.o(n,"useRouter")&&r.d(e,{useRouter:function(){return n.useRouter}})},257:function(t,e,r){"use strict";var n,i;t.exports=(null==(n=r.g.process)?void 0:n.env)&&"object"==typeof(null==(i=r.g.process)?void 0:i.env)?r.g.process:r(4227)},4227:function(t){!function(){var e={229:function(t){var e,r,n,i=t.exports={};function u(){throw Error("setTimeout has not been defined")}function a(){throw Error("clearTimeout has not been defined")}function c(t){if(e===setTimeout)return setTimeout(t,0);if((e===u||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:u}catch(t){e=u}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var o=[],l=!1,s=-1;function h(){l&&n&&(l=!1,n.length?o=n.concat(o):s=-1,o.length&&f())}function f(){if(!l){var t=c(h);l=!0;for(var e=o.length;e;){for(n=o,o=[];++s<e;)n&&n[s].run();s=-1,e=o.length}n=null,l=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function y(){}i.nextTick=function(t){var e=Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];o.push(new d(t,e)),1!==o.length||l||c(f)},d.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=y,i.addListener=y,i.once=y,i.off=y,i.removeListener=y,i.removeAllListeners=y,i.emit=y,i.prependListener=y,i.prependOnceListener=y,i.listeners=function(t){return[]},i.binding=function(t){throw Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw Error("process.chdir is not supported")},i.umask=function(){return 0}}},r={};function n(t){var i=r[t];if(void 0!==i)return i.exports;var u=r[t]={exports:{}},a=!0;try{e[t](u,u.exports,n),a=!1}finally{a&&delete r[t]}return u.exports}n.ab="//";var i=n(229);t.exports=i}()},1994:function(t,e,r){"use strict";e.Z=function(){for(var t,e,r=0,n="",i=arguments.length;r<i;r++)(t=arguments[r])&&(e=function t(e){var r,n,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e){if(Array.isArray(e)){var u=e.length;for(r=0;r<u;r++)e[r]&&(n=t(e[r]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n)}return i}(t))&&(n&&(n+=" "),n+=e);return n}}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[945],{1806:function(e,t,s){Promise.resolve().then(s.bind(s,8935))},9397:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(9205).Z)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},8935:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return Z}});var a=s(7437),l=s(2265),r=s(9376),i=s(7648),n=s(525),c=s(6865),d=s(3085),x=s(2934),o=s(7168),h=s(2660),m=s(8896),u=s(1047),p=s(5846),j=s(6362),g=s(1994),N=s(1259),f=s(104),b=s(9554),v=s(9397),y=s(6153),w=s(281);function k(e){let{kpis:t,goalId:s,onUpdateKPI:r}=e,[i,c]=(0,l.useState)(null),[x,o]=(0,l.useState)(null),[h,m]=(0,l.useState)(""),[u,p]=(0,l.useState)(!1),j=async e=>{if(!r||!h.trim())return;let t=parseFloat(h);if(!isNaN(t)){p(!0);try{await r(e,t),o(null),m("")}catch(e){console.error("Failed to update KPI:",e)}finally{p(!1)}}};return(0,a.jsx)("div",{className:"bg-white rounded-lg border border-slate-200 overflow-hidden",children:(0,a.jsxs)("table",{className:"w-full",children:[(0,a.jsx)("thead",{className:"bg-slate-50 border-b border-slate-200",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"text-left text-xs font-medium text-slate-500 uppercase tracking-wider px-4 py-3",children:"KPI"}),(0,a.jsx)("th",{className:"text-center text-xs font-medium text-slate-500 uppercase tracking-wider px-4 py-3 w-24",children:"Trend"}),(0,a.jsx)("th",{className:"text-right text-xs font-medium text-slate-500 uppercase tracking-wider px-4 py-3 w-24",children:"Current"}),(0,a.jsx)("th",{className:"text-right text-xs font-medium text-slate-500 uppercase tracking-wider px-4 py-3 w-24",children:"Target"}),(0,a.jsx)("th",{className:"text-center text-xs font-medium text-slate-500 uppercase tracking-wider px-4 py-3 w-20",children:"Progress"}),(0,a.jsx)("th",{className:"text-center text-xs font-medium text-slate-500 uppercase tracking-wider px-4 py-3 w-16",children:"Source"}),r&&(0,a.jsx)("th",{className:"text-center text-xs font-medium text-slate-500 uppercase tracking-wider px-4 py-3 w-16",children:"Action"})]})}),(0,a.jsx)("tbody",{className:"divide-y divide-slate-100",children:t.map(e=>{let t=function(e){if(e.history.length<2)return{icon:b.Z,color:"text-slate-400",label:"No trend"};let t=e.history[0].value,s=e.history[e.history.length-1].value,a="higher_is_better"===e.direction?s>t:s<t;return t===s?{icon:b.Z,color:"text-slate-400",label:"Stable"}:a?{icon:n.Z,color:"text-emerald-500",label:"Improving"}:{icon:d.Z,color:"text-red-500",label:"Declining"}}(e),s=null===e.current_value||null===e.target_value?null:"higher_is_better"===e.direction?e.current_value/e.target_value*100:e.current_value<=e.target_value?100:e.target_value/e.current_value*100,l=t.icon,p=i===e.id,N=x===e.id;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("tr",{className:(0,g.Z)("hover:bg-slate-50 cursor-pointer transition-colors",p&&"bg-slate-50"),onClick:()=>c(p?null:e.id),children:[(0,a.jsx)("td",{className:"px-4 py-3",children:(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"w-16 h-8",children:(0,a.jsx)(w.Z,{kpi:e,height:32,width:64})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-slate-900",children:e.name}),(0,a.jsx)("p",{className:"text-xs text-slate-500 line-clamp-1",children:e.description})]})]})}),(0,a.jsx)("td",{className:"px-4 py-3 text-center",children:(0,a.jsx)("span",{className:(0,g.Z)("inline-flex items-center gap-1",t.color),title:t.label,children:(0,a.jsx)(l,{className:"w-4 h-4"})})}),(0,a.jsx)("td",{className:"px-4 py-3 text-right",children:(0,a.jsx)("span",{className:"text-sm font-medium text-slate-900",children:null!==e.current_value?"".concat(e.current_value).concat(e.unit):"--"})}),(0,a.jsx)("td",{className:"px-4 py-3 text-right",children:(0,a.jsx)("span",{className:"text-sm text-slate-500",children:null!==e.target_value?"".concat(e.target_value).concat(e.unit):"--"})}),(0,a.jsx)("td",{className:"px-4 py-3",children:null!==s?(0,a.jsx)("div",{className:"flex items-center justify-center",children:(0,a.jsx)("div",{className:"w-12 h-1.5 bg-slate-100 rounded-full overflow-hidden",children:(0,a.jsx)("div",{className:(0,g.Z)("h-full rounded-full",s>=100?"bg-emerald-500":s>=70?"bg-amber-500":"bg-red-500"),style:{width:"".concat(Math.min(s,100),"%")}})})}):(0,a.jsx)("span",{className:"text-xs text-slate-400 text-center block",children:"--"})}),(0,a.jsx)("td",{className:"px-4 py-3 text-center",children:(0,a.jsx)("span",{className:(0,g.Z)("text-xs px-1.5 py-0.5 rounded","manual"===e.source?"bg-slate-100 text-slate-600":"bg-blue-50 text-blue-600"),children:y.en[e.source]})}),r&&(0,a.jsx)("td",{className:"px-4 py-3 text-center",onClick:e=>e.stopPropagation(),children:"manual"===e.source&&(0,a.jsx)("button",{onClick:t=>{var s;t.stopPropagation(),o(e.id),m((null===(s=e.current_value)||void 0===s?void 0:s.toString())||"")},className:"p-1 text-slate-400 hover:text-emerald-600 transition-colors",title:"Add value",children:(0,a.jsx)(v.Z,{className:"w-4 h-4"})})})]},e.id),p&&(0,a.jsx)("tr",{children:(0,a.jsxs)("td",{colSpan:r?7:6,className:"px-4 py-4 bg-slate-50",children:[(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"text-xs font-medium text-slate-500 uppercase mb-2",children:"History"}),e.history.length>0?(0,a.jsx)("div",{className:"h-32 bg-white rounded border border-slate-200 p-2",children:(0,a.jsx)(w.Z,{kpi:e,height:112,showTarget:!0})}):(0,a.jsx)("div",{className:"h-32 bg-white rounded border border-slate-200 flex items-center justify-center text-sm text-slate-400",children:"No historical data"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"text-xs font-medium text-slate-500 uppercase mb-2",children:"Details"}),(0,a.jsxs)("dl",{className:"space-y-2 text-sm",children:[(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("dt",{className:"text-slate-500",children:"Direction"}),(0,a.jsx)("dd",{className:"text-slate-900",children:"higher_is_better"===e.direction?"Higher is better":"Lower is better"})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("dt",{className:"text-slate-500",children:"Data points"}),(0,a.jsx)("dd",{className:"text-slate-900",children:e.history.length})]}),e.history.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("dt",{className:"text-slate-500",children:"First recorded"}),(0,a.jsx)("dd",{className:"text-slate-900",children:e.history[0].date})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("dt",{className:"text-slate-500",children:"Last updated"}),(0,a.jsx)("dd",{className:"text-slate-900",children:e.history[e.history.length-1].date})]})]})]}),(0,a.jsxs)("div",{className:"mt-4",children:[(0,a.jsx)("h4",{className:"text-xs font-medium text-slate-500 uppercase mb-1",children:"Query"}),(0,a.jsx)("pre",{className:"text-xs text-slate-600 bg-white p-2 rounded border border-slate-200 overflow-x-auto",children:e.query})]})]})]}),N&&"manual"===e.source&&r&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-slate-200 flex items-center gap-3",children:[(0,a.jsx)("label",{className:"text-sm text-slate-600",children:"Add new value:"}),(0,a.jsx)("input",{type:"number",value:h,onChange:e=>m(e.target.value),className:"w-24 px-2 py-1 text-sm border border-slate-300 rounded focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500",placeholder:"Value",step:"any"}),(0,a.jsx)("span",{className:"text-sm text-slate-500",children:e.unit}),(0,a.jsx)("button",{onClick:()=>j(e.id),disabled:u||!h.trim(),className:"px-3 py-1 text-sm bg-emerald-600 text-white rounded hover:bg-emerald-700 disabled:opacity-50 disabled:cursor-not-allowed",children:u?"Saving...":"Save"}),(0,a.jsx)("button",{onClick:()=>{o(null),m("")},className:"px-3 py-1 text-sm text-slate-600 hover:text-slate-900",children:"Cancel"})]})]})},"".concat(e.id,"-expanded"))]})})})]})})}function _(e){let{status:t}=e;switch(t){case"on_track":return(0,a.jsx)(n.Z,{className:"w-5 h-5"});case"at_risk":return(0,a.jsx)(c.Z,{className:"w-5 h-5"});case"behind":return(0,a.jsx)(d.Z,{className:"w-5 h-5"});case"achieved":return(0,a.jsx)(x.Z,{className:"w-5 h-5"})}}function Z(e){let{params:t}=e;(0,r.useRouter)();let{id:s}=t,[n,c]=(0,l.useState)(null),[d,x]=(0,l.useState)([]),[b,v]=(0,l.useState)(!0),[w,Z]=(0,l.useState)(!1),[S,C]=(0,l.useState)(null),P=async()=>{try{let e=await fetch("/api/goals/".concat(s)),t=await e.json();if(!t.success){C(t.error||"Failed to load goal");return}if(c(t.data),t.data.related_ideas.length>0){let e=await fetch("/api/ideas"),s=await e.json();if(s.success){let e=s.data.filter(e=>t.data.related_ideas.includes(e.id));x(e)}}}catch(e){C("Failed to load goal"),console.error("Error fetching goal:",e)}finally{v(!1)}};(0,l.useEffect)(()=>{P()},[s]);let I=async(e,t)=>{try{let a=await fetch("/api/goals/".concat(s,"/kpis"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({kpi_id:e,action:"add_history",value:t})}),l=await a.json();if(l.success)await P();else throw Error(l.error)}catch(e){throw console.error("Failed to update KPI:",e),e}},T=async e=>{try{let t=await fetch("/api/goals/".concat(s),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:e})}),a=await t.json();a.success&&c(a.data)}catch(e){console.error("Failed to update status:",e)}},F=async()=>{Z(!0);try{let e=await fetch("/api/kpis/refresh",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({goal_id:s})}),t=await e.json();t.success||console.error("KPI refresh failed:",t.error),await P()}catch(e){console.error("Error refreshing KPIs:",e)}finally{Z(!1)}};return b?(0,a.jsx)(N.default,{children:(0,a.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,a.jsx)(o.Z,{className:"w-8 h-8 text-slate-400 animate-spin"})})}):S||!n?(0,a.jsx)(N.default,{children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)(i.default,{href:"/goals",className:"inline-flex items-center gap-2 text-slate-600 hover:text-slate-900 mb-6",children:[(0,a.jsx)(h.Z,{className:"w-4 h-4"}),(0,a.jsx)("span",{children:"Back to Goals"})]}),(0,a.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-lg p-6 text-center",children:(0,a.jsx)("p",{className:"text-red-600",children:S||"Goal not found"})})]})}):(0,a.jsx)(N.default,{children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)(i.default,{href:"/goals",className:"inline-flex items-center gap-2 text-slate-600 hover:text-slate-900 mb-6",children:[(0,a.jsx)(h.Z,{className:"w-4 h-4"}),(0,a.jsx)("span",{children:"Back to Goals"})]}),(0,a.jsxs)("div",{className:"bg-white rounded-lg border border-slate-200 p-6 mb-6",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-4",children:[(0,a.jsx)("div",{className:"w-14 h-14 bg-emerald-100 rounded-xl flex items-center justify-center flex-shrink-0",children:(0,a.jsx)(m.Z,{className:"w-7 h-7 text-emerald-600"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"flex items-center gap-2 mb-1",children:(0,a.jsx)("span",{className:(0,g.Z)("text-xs px-2 py-0.5 rounded-full",y.l5[n.category]),children:y.kT[n.category]})}),(0,a.jsx)("h1",{className:"text-2xl font-bold text-slate-900 mb-1",children:n.title}),(0,a.jsx)("p",{className:"text-slate-500",children:n.description})]})]}),(0,a.jsxs)("div",{className:"flex flex-col items-end gap-2",children:[(0,a.jsxs)("span",{className:(0,g.Z)("inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full text-sm font-medium border",y.i2[n.status]),children:[(0,a.jsx)(_,{status:n.status}),(0,a.jsx)("span",{children:y.tV[n.status]})]}),(0,a.jsxs)("select",{value:n.status,onChange:e=>T(e.target.value),className:"text-xs border border-slate-200 rounded px-2 py-1 text-slate-600",children:[(0,a.jsx)("option",{value:"on_track",children:"On Track"}),(0,a.jsx)("option",{value:"at_risk",children:"At Risk"}),(0,a.jsx)("option",{value:"behind",children:"Behind"}),(0,a.jsx)("option",{value:"achieved",children:"Achieved"})]})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-6 text-sm text-slate-500 mb-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(u.Z,{className:"w-4 h-4"}),(0,a.jsxs)("span",{children:["Deadline: ",(0,a.jsx)("span",{className:"font-medium text-slate-700",children:n.deadline})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(p.Z,{className:"w-4 h-4"}),(0,a.jsxs)("span",{children:[n.related_ideas.length," linked ideas"]})]})]}),(0,a.jsx)(f.Z,{current:n.current_value,target:n.target_value,unit:n.target_unit,status:n.status})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[(0,a.jsxs)("div",{className:"lg:col-span-2",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold text-slate-900",children:["Key Performance Indicators (",n.kpis.length,")"]}),(0,a.jsxs)("button",{onClick:F,disabled:w,className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm text-slate-600 hover:text-slate-900 border border-slate-200 rounded-lg hover:bg-slate-50 disabled:opacity-50",children:[(0,a.jsx)(o.Z,{className:(0,g.Z)("w-4 h-4",w&&"animate-spin")}),(0,a.jsx)("span",{children:w?"Refreshing...":"Refresh KPIs"})]})]}),n.kpis.length>0?(0,a.jsx)(k,{kpis:n.kpis,goalId:n.id,onUpdateKPI:I}):(0,a.jsx)("div",{className:"bg-white rounded-lg border border-slate-200 p-8 text-center",children:(0,a.jsx)("p",{className:"text-slate-500",children:"No KPIs defined for this goal."})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-lg font-semibold text-slate-900 mb-4",children:"Related Ideas"}),d.length>0?(0,a.jsx)("div",{className:"space-y-3",children:d.map(e=>(0,a.jsxs)(i.default,{href:"/ideas/".concat(e.id),className:"block bg-white rounded-lg border border-slate-200 p-4 hover:border-emerald-300 hover:shadow-sm transition-all",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-medium text-slate-900 mb-1",children:e.title}),(0,a.jsx)("p",{className:"text-xs text-slate-500 line-clamp-2",children:e.summary})]}),(0,a.jsx)(j.Z,{className:"w-4 h-4 text-slate-400 flex-shrink-0"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,a.jsx)("span",{className:(0,g.Z)("text-xs px-1.5 py-0.5 rounded","shipped"===e.stage?"bg-green-100 text-green-700":"in_progress"===e.stage?"bg-violet-100 text-violet-700":"bg-slate-100 text-slate-600"),children:e.stage.replace("_"," ")}),e.expected_impact&&(0,a.jsx)("span",{className:"text-xs text-slate-400",children:e.expected_impact})]})]},e.id))}):(0,a.jsxs)("div",{className:"bg-white rounded-lg border border-slate-200 p-6 text-center",children:[(0,a.jsx)(p.Z,{className:"w-8 h-8 text-slate-300 mx-auto mb-2"}),(0,a.jsx)("p",{className:"text-sm text-slate-500 mb-3",children:"No ideas linked to this goal yet."}),(0,a.jsx)(i.default,{href:"/",className:"text-sm text-emerald-600 hover:text-emerald-700",children:"Browse Ideas"})]}),(0,a.jsxs)("div",{className:"mt-6 bg-slate-50 rounded-lg border border-slate-200 p-4",children:[(0,a.jsx)("h3",{className:"text-sm font-medium text-slate-700 mb-2",children:"Tip: Link Ideas to Goals"}),(0,a.jsx)("p",{className:"text-xs text-slate-500",children:"When approving ideas, link them to this goal to track which improvements support your business objectives. Ideas linked to goals are prioritized in the analysis process."})]})]})]}),(0,a.jsxs)("div",{className:"mt-6 text-xs text-slate-400",children:[(0,a.jsxs)("p",{children:["Created: ",new Date(n.created_at).toLocaleString()]}),(0,a.jsxs)("p",{children:["Last updated: ",new Date(n.updated_at).toLocaleString()]})]})]})})}}},function(e){e.O(0,[972,827,354,971,117,744],function(){return e(e.s=1806)}),_N_E=e.O()}]);