@polishd/next 0.2.1-dev.0 → 0.2.1-dev.2

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 (53) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/README.md +24 -12
  3. package/dist/ai/profile.d.ts +11 -3
  4. package/dist/ai/profile.d.ts.map +1 -1
  5. package/dist/ai/profile.js.map +1 -1
  6. package/dist/client/design-scan.d.ts.map +1 -1
  7. package/dist/client/design-scan.js +6 -0
  8. package/dist/client/design-scan.js.map +1 -1
  9. package/dist/config.d.ts +12 -0
  10. package/dist/config.d.ts.map +1 -1
  11. package/dist/config.js +34 -0
  12. package/dist/config.js.map +1 -1
  13. package/dist/dashboard/chrome.d.ts +22 -0
  14. package/dist/dashboard/chrome.d.ts.map +1 -0
  15. package/dist/dashboard/chrome.js +107 -0
  16. package/dist/dashboard/chrome.js.map +1 -0
  17. package/dist/dashboard/design-review-card.d.ts.map +1 -1
  18. package/dist/dashboard/design-review-card.js +5 -23
  19. package/dist/dashboard/design-review-card.js.map +1 -1
  20. package/dist/dashboard/design.d.ts.map +1 -1
  21. package/dist/dashboard/design.js +57 -25
  22. package/dist/dashboard/design.js.map +1 -1
  23. package/dist/dashboard/index.d.ts +11 -1
  24. package/dist/dashboard/index.d.ts.map +1 -1
  25. package/dist/dashboard/index.js +37 -30
  26. package/dist/dashboard/index.js.map +1 -1
  27. package/dist/dashboard/settings.d.ts +18 -0
  28. package/dist/dashboard/settings.d.ts.map +1 -0
  29. package/dist/dashboard/settings.js +309 -0
  30. package/dist/dashboard/settings.js.map +1 -0
  31. package/dist/dashboard/show-more.d.ts +17 -0
  32. package/dist/dashboard/show-more.d.ts.map +1 -0
  33. package/dist/dashboard/show-more.js +18 -0
  34. package/dist/dashboard/show-more.js.map +1 -0
  35. package/dist/dashboard/summary.d.ts.map +1 -1
  36. package/dist/dashboard/summary.js +32 -316
  37. package/dist/dashboard/summary.js.map +1 -1
  38. package/dist/dashboard/ui.d.ts +30 -0
  39. package/dist/dashboard/ui.d.ts.map +1 -0
  40. package/dist/dashboard/ui.js +51 -0
  41. package/dist/dashboard/ui.js.map +1 -0
  42. package/dist/dashboard.css +136 -0
  43. package/dist/server/design.d.ts.map +1 -1
  44. package/dist/server/design.js +2 -27
  45. package/dist/server/design.js.map +1 -1
  46. package/dist/server/ingest.d.ts.map +1 -1
  47. package/dist/server/ingest.js +6 -2
  48. package/dist/server/ingest.js.map +1 -1
  49. package/dist/server/queries.d.ts +22 -0
  50. package/dist/server/queries.d.ts.map +1 -1
  51. package/dist/server/queries.js +22 -25
  52. package/dist/server/queries.js.map +1 -1
  53. package/package.json +1 -1
@@ -0,0 +1,309 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ /**
4
+ * Polishd — the Settings tab.
5
+ *
6
+ * Everything about *configuring* Polishd: which model to call, what the site
7
+ * is, the cached codebase profile, and the GitHub connection. All of it used
8
+ * to live behind a gear on the analytics summary card, which meant the first
9
+ * screen of the dashboard was also its setup screen — the form pushed the
10
+ * actual analytics down the page, and the design review had to send people to
11
+ * "the Analytics tab's summary card" to connect a model it also uses. Setup is
12
+ * its own concern, so it gets its own tab.
13
+ *
14
+ * The API key and GitHub token are write-only: they are sent up, stored
15
+ * server-side, and never come back — the form only ever learns whether one
16
+ * exists.
17
+ */
18
+ import { useRouter } from "next/navigation";
19
+ import { useEffect, useState, useTransition } from "react";
20
+ import { generateProfileAction, generateSummaryAction, listModelsAction, saveAISettingsAction, verifyGithubAction, } from "../ai/actions";
21
+ import { border, card, ghostBtn, inputCls, labelCls, primaryBtn, relTime, } from "./ui";
22
+ export const PROVIDERS = [
23
+ {
24
+ value: "anthropic",
25
+ label: "Anthropic (Claude)",
26
+ modelHint: "claude-opus-4-8",
27
+ keyUrl: "https://console.anthropic.com/settings/keys",
28
+ keyHost: "console.anthropic.com",
29
+ },
30
+ {
31
+ value: "openai",
32
+ label: "OpenAI",
33
+ modelHint: "gpt-4o-mini",
34
+ keyUrl: "https://platform.openai.com/api-keys",
35
+ keyHost: "platform.openai.com",
36
+ },
37
+ {
38
+ value: "openai-compatible",
39
+ label: "OpenAI-compatible",
40
+ modelHint: "model id",
41
+ keyUrl: "https://openrouter.ai/keys",
42
+ keyHost: "your provider (e.g. openrouter.ai)",
43
+ },
44
+ {
45
+ value: "google",
46
+ label: "Google (Gemini)",
47
+ modelHint: "gemini-1.5-flash",
48
+ keyUrl: "https://aistudio.google.com/app/apikey",
49
+ keyHost: "aistudio.google.com",
50
+ },
51
+ ];
52
+ const CADENCES = [
53
+ { value: "manual", label: "Manual", hint: "Only when you press refresh" },
54
+ {
55
+ value: "daily",
56
+ label: "Daily",
57
+ hint: "Refreshes on your first dashboard visit each day, if data changed",
58
+ },
59
+ { value: "weekly", label: "Weekly", hint: "Refreshes at most once a week, if data changed" },
60
+ ];
61
+ // ── Model field ──────────────────────────────────────────────────────────────
62
+ /**
63
+ * The "Model" input, shared by the onboarding wizard and the settings form.
64
+ * Starts as free text (any provider works this way). If the provider exposes
65
+ * a list-models endpoint and a usable key is available (typed in this form,
66
+ * or already stored for this same provider), a "Load available models" link
67
+ * fetches the live list and swaps the input for a dropdown — so the owner
68
+ * picks from what their key can actually call instead of guessing an id.
69
+ */
70
+ function ModelField({ provider, model, onModel, apiKey, baseUrl, hasStoredKey, }) {
71
+ const [models, setModels] = useState(null);
72
+ const [error, setError] = useState(null);
73
+ const [pending, startLoad] = useTransition();
74
+ const prov = PROVIDERS.find((p) => p.value === provider);
75
+ // A fetched list is provider-specific — drop it the moment the provider
76
+ // changes so a stale Gemini list can't linger under "OpenAI".
77
+ useEffect(() => {
78
+ setModels(null);
79
+ setError(null);
80
+ }, [provider]);
81
+ const needsBaseUrl = provider === "openai-compatible" && !baseUrl.trim();
82
+ const canFetch = (apiKey.trim().length > 0 || hasStoredKey) && !needsBaseUrl;
83
+ const load = () => {
84
+ if (!canFetch || pending)
85
+ return;
86
+ setError(null);
87
+ startLoad(async () => {
88
+ const res = await listModelsAction({
89
+ provider,
90
+ apiKey: apiKey.trim() || undefined,
91
+ baseUrl: baseUrl.trim() || undefined,
92
+ });
93
+ if (res.ok) {
94
+ setModels(res.models);
95
+ if (res.models.length > 0 && !res.models.includes(model))
96
+ onModel(res.models[0]);
97
+ }
98
+ else {
99
+ setError(res.message);
100
+ }
101
+ });
102
+ };
103
+ // Auto-load once when a stored key already covers this provider — most
104
+ // visits land here with nothing to type, so the dropdown should just work.
105
+ useEffect(() => {
106
+ if (hasStoredKey && models === null && !pending)
107
+ load();
108
+ // eslint-disable-next-line react-hooks/exhaustive-deps
109
+ }, [hasStoredKey]);
110
+ return (_jsxs("label", { className: "block", children: [_jsx("span", { className: labelCls, children: "Model" }), models && models.length > 0 ? (_jsxs(_Fragment, { children: [_jsxs("select", { value: model, onChange: (e) => onModel(e.target.value), className: `${inputCls} mt-1.5 font-mono`, children: [!models.includes(model) && model && _jsx("option", { value: model, children: model }), models.map((m) => (_jsx("option", { value: m, children: m }, m)))] }), _jsx("button", { type: "button", onClick: () => setModels(null), className: "mt-1 text-[11px] text-[#555] hover:text-[#888]", children: "Type a different model id" })] })) : (_jsxs(_Fragment, { children: [_jsx("input", { value: model, onChange: (e) => onModel(e.target.value), placeholder: prov?.modelHint, className: `${inputCls} mt-1.5 font-mono` }), _jsx("button", { type: "button", onClick: load, disabled: !canFetch || pending, title: needsBaseUrl
111
+ ? "Add a base URL first"
112
+ : canFetch
113
+ ? "Fetch the list of models available to this key"
114
+ : "Add an API key first", className: "mt-1 text-[11px] text-[#888] underline decoration-[#444] underline-offset-2 hover:text-white disabled:cursor-not-allowed disabled:no-underline disabled:opacity-40", children: pending ? "Loading models…" : "Load available models" }), error && _jsx("span", { className: "mt-1 block text-[11px] text-red-400", children: error })] }))] }));
115
+ }
116
+ export default function SettingsView({ initialSettings, initialProfile, initialGaps, sourceAvailable, }) {
117
+ const router = useRouter();
118
+ const [settings, setSettings] = useState(initialSettings);
119
+ const [profile, setProfile] = useState(initialProfile);
120
+ const [gaps, setGaps] = useState(initialGaps);
121
+ const [error, setError] = useState(null);
122
+ // The wizard is for a genuinely fresh install — no key stored and none
123
+ // supplied by the environment. Once step 1 saves a key it never returns.
124
+ const [onboarding, setOnboarding] = useState(!initialSettings.hasApiKey && !initialSettings.fromEnv);
125
+ return (_jsxs("main", { className: "text-white", children: [_jsxs("div", { className: `mb-8 flex items-start justify-between gap-3 border-b ${border} pb-6`, children: [_jsxs("div", { children: [_jsx("h1", { className: "text-[22px] font-semibold tracking-tight text-white", children: "Settings" }), _jsx("p", { className: "mt-1 max-w-xl text-[13px] leading-relaxed text-[#666]", children: "The model Polishd calls, what it knows about your site, and where it files what it finds. One model serves both the analytics summary and the design review." })] }), _jsx("div", { className: `shrink-0 whitespace-nowrap rounded-full px-3 py-1 text-[11px] font-medium ${settings.hasApiKey ? "bg-emerald-950 text-emerald-400" : "bg-[#1a1a1a] text-[#666]"}`, children: settings.hasApiKey ? `● ${settings.provider}` : "○ no model" })] }), error && (_jsx("div", { className: "mb-6 rounded-lg border border-red-900/50 bg-red-950/30 px-4 py-3 text-[13px] text-red-400", children: error })), onboarding ? (_jsxs("section", { className: `${card} overflow-hidden`, children: [_jsx("div", { className: `border-b ${border} px-4 py-3 sm:px-5`, children: _jsx("span", { className: labelCls, children: "First-time setup" }) }), _jsx(OnboardingWizard, { settings: settings, sourceAvailable: sourceAvailable, onSettings: setSettings, onProfile: (p) => {
126
+ setProfile(p);
127
+ setGaps([]);
128
+ }, onError: setError, onSkip: () => setOnboarding(false), onFinished: () => {
129
+ setOnboarding(false);
130
+ // The first summary was just generated — go and read it.
131
+ router.push("?tab=analytics");
132
+ } })] })) : (_jsx(SettingsForm, { settings: settings, profile: profile, gaps: gaps, sourceAvailable: sourceAvailable, onSaved: (next) => {
133
+ setSettings(next);
134
+ setError(null);
135
+ }, onProfile: (p) => {
136
+ setProfile(p);
137
+ setGaps([]);
138
+ setError(null);
139
+ }, onError: setError }))] }));
140
+ }
141
+ // ── Onboarding wizard ────────────────────────────────────────────────────────
142
+ const STEPS = ["Model", "Your site", "Codebase", "GitHub", "Cadence"];
143
+ function StepShell({ step, title, intro, children, }) {
144
+ return (_jsxs("div", { className: "px-4 py-5 sm:px-5", children: [_jsx("div", { className: "mb-4 flex flex-wrap items-center gap-1.5", children: STEPS.map((name, i) => (_jsxs("span", { className: "flex items-center gap-1.5", children: [_jsxs("span", { className: `flex h-5 items-center rounded-full px-2 text-[10px] font-medium ${i === step
145
+ ? "bg-white text-black"
146
+ : i < step
147
+ ? "bg-[#1a1a1a] text-emerald-400"
148
+ : "bg-[#1a1a1a] text-[#555]"}`, children: [i < step ? "✓ " : `${i + 1} · `, name] }), i < STEPS.length - 1 && _jsx("span", { className: "h-px w-3 bg-[#2e2e2e]" })] }, name))) }), _jsx("h3", { className: "text-[15px] font-semibold text-white", children: title }), _jsx("p", { className: "mt-1 max-w-xl text-[12px] leading-relaxed text-[#888]", children: intro }), _jsx("div", { className: "mt-4", children: children })] }));
149
+ }
150
+ function OnboardingWizard({ settings, sourceAvailable, onSettings, onProfile, onError, onSkip, onFinished, }) {
151
+ const [step, setStep] = useState(0);
152
+ const [error, setError] = useState(null);
153
+ // Step 1 — model
154
+ const [provider, setProvider] = useState(settings.provider);
155
+ const [model, setModel] = useState(settings.model);
156
+ const [apiKey, setApiKey] = useState("");
157
+ const [baseUrl, setBaseUrl] = useState(settings.baseUrl ?? "");
158
+ // Step 2 — site
159
+ const [context, setContext] = useState(settings.context ?? "");
160
+ const [audience, setAudience] = useState(settings.audience ?? "");
161
+ const [ideology, setIdeology] = useState(settings.ideology ?? "");
162
+ // Step 3 — codebase
163
+ const [sourceDirs, setSourceDirs] = useState(settings.sourceDirs ?? "");
164
+ const [scanned, setScanned] = useState(null);
165
+ // Step 4 — GitHub
166
+ const [githubRepo, setGithubRepo] = useState(settings.githubRepo ?? "");
167
+ const [githubToken, setGithubToken] = useState("");
168
+ const [githubStatus, setGithubStatus] = useState(null);
169
+ const [autoIssues, setAutoIssues] = useState(settings.githubAutoIssues ?? false);
170
+ // Step 5 — cadence
171
+ const [cadence, setCadence] = useState("manual");
172
+ const [pending, startStep] = useTransition();
173
+ const prov = PROVIDERS.find((p) => p.value === provider);
174
+ const next = () => {
175
+ setError(null);
176
+ setStep((s) => s + 1);
177
+ };
178
+ const saveModel = () => startStep(async () => {
179
+ const saved = await saveAISettingsAction({ provider, model, apiKey, baseUrl });
180
+ onSettings(saved);
181
+ setApiKey("");
182
+ if (!saved.hasApiKey) {
183
+ setError("Paste an API key to continue — the model can't be called without one.");
184
+ return;
185
+ }
186
+ next();
187
+ });
188
+ const saveSite = () => startStep(async () => {
189
+ onSettings(await saveAISettingsAction({ context, audience, ideology }));
190
+ next();
191
+ });
192
+ const scan = () => startStep(async () => {
193
+ setError(null);
194
+ onSettings(await saveAISettingsAction({ sourceDirs }));
195
+ const res = await generateProfileAction();
196
+ if (res.ok) {
197
+ setScanned(res.profile);
198
+ onProfile(res.profile);
199
+ }
200
+ else {
201
+ setError(res.message);
202
+ }
203
+ });
204
+ const connectGithub = () => startStep(async () => {
205
+ setError(null);
206
+ const saved = await saveAISettingsAction({
207
+ githubRepo,
208
+ githubToken,
209
+ githubAutoIssues: autoIssues,
210
+ });
211
+ onSettings(saved);
212
+ setGithubToken("");
213
+ const res = await verifyGithubAction();
214
+ if (res.ok)
215
+ setGithubStatus(res.status);
216
+ else
217
+ setError(res.message);
218
+ });
219
+ // The toggle stays visible after connecting — persist its latest state.
220
+ const finishGithub = () => startStep(async () => {
221
+ onSettings(await saveAISettingsAction({ githubAutoIssues: autoIssues }));
222
+ next();
223
+ });
224
+ const finish = () => startStep(async () => {
225
+ onSettings(await saveAISettingsAction({ refreshCadence: cadence }));
226
+ const res = await generateSummaryAction(false);
227
+ // The wizard is closing and the Analytics tab is about to render the
228
+ // result — a failure has to surface on the tab that outlives it.
229
+ if (!res.ok)
230
+ onError(res.message);
231
+ onFinished();
232
+ });
233
+ return (_jsxs("div", { className: "bg-[#080808]", children: [error && (_jsx("div", { className: "mx-4 mt-4 rounded-md border border-red-900/50 bg-red-950/30 px-3 py-2 text-[12px] text-red-400 sm:mx-5", children: error })), step === 0 && (_jsxs(StepShell, { step: 0, title: "Connect a model", intro: "Bring your own key \u2014 pick the provider you already pay for. The key is stored server-side in your database and never sent back to the browser.", children: [_jsxs("div", { className: "grid gap-4 sm:grid-cols-2", children: [_jsxs("label", { className: "block", children: [_jsx("span", { className: labelCls, children: "Provider" }), _jsx("select", { value: provider, onChange: (e) => setProvider(e.target.value), className: `${inputCls} mt-1.5`, children: PROVIDERS.map((p) => (_jsx("option", { value: p.value, children: p.label }, p.value))) })] }), _jsx(ModelField, { provider: provider, model: model, onModel: setModel, apiKey: apiKey, baseUrl: baseUrl, hasStoredKey: settings.hasApiKey && settings.provider === provider }), _jsxs("label", { className: "block sm:col-span-2", children: [_jsx("span", { className: labelCls, children: "API key" }), _jsx("input", { type: "password", value: apiKey, onChange: (e) => setApiKey(e.target.value), placeholder: settings.hasApiKey ? "•••••••• (stored — leave blank to keep)" : "Paste your key", autoComplete: "off", className: `${inputCls} mt-1.5` }), prov && (_jsxs("span", { className: "mt-1 block text-[11px] text-[#555]", children: ["Get a key from", " ", _jsx("a", { href: prov.keyUrl, target: "_blank", rel: "noreferrer noopener", className: "text-[#888] underline decoration-[#444] underline-offset-2 hover:text-white", children: prov.keyHost }), "."] }))] }), provider === "openai-compatible" && (_jsxs("label", { className: "block sm:col-span-2", children: [_jsx("span", { className: labelCls, children: "Base URL" }), _jsx("input", { value: baseUrl, onChange: (e) => setBaseUrl(e.target.value), placeholder: "https://openrouter.ai/api/v1", className: `${inputCls} mt-1.5 font-mono` })] }))] }), _jsxs("div", { className: "mt-4 flex items-center gap-3", children: [_jsx("button", { type: "button", onClick: saveModel, disabled: pending || (!apiKey && !settings.hasApiKey), className: primaryBtn, children: pending ? "Saving…" : "Continue" }), _jsx("button", { type: "button", onClick: onSkip, className: "text-[11px] text-[#555] hover:text-[#888]", children: "Skip setup" })] })] })), step === 1 && (_jsxs(StepShell, { step: 1, title: "Tell it about your site", intro: "Optional, but the story gets sharper when the model knows what the site is for and who it serves. All three feed the codebase profile in the next step.", children: [_jsxs("label", { className: "block", children: [_jsx("span", { className: labelCls, children: "What is this site?" }), _jsx("textarea", { value: context, onChange: (e) => setContext(e.target.value), rows: 2, placeholder: "e.g. A personal notes site. Visitors read articles and browse by tag. The /admin editor is owner-only.", className: `${inputCls} mt-1.5 resize-y` })] }), _jsxs("div", { className: "mt-4 grid gap-4 sm:grid-cols-2", children: [_jsxs("label", { className: "block", children: [_jsx("span", { className: labelCls, children: "Target audience" }), _jsx("input", { value: audience, onChange: (e) => setAudience(e.target.value), placeholder: "e.g. Recruiters and fellow designers", className: `${inputCls} mt-1.5` })] }), _jsxs("label", { className: "block", children: [_jsx("span", { className: labelCls, children: "Ideology / values" }), _jsx("input", { value: ideology, onChange: (e) => setIdeology(e.target.value), placeholder: "e.g. Depth over clicks \u2014 long reads matter most", className: `${inputCls} mt-1.5` })] })] }), _jsxs("div", { className: "mt-4 flex items-center gap-3", children: [_jsx("button", { type: "button", onClick: saveSite, disabled: pending, className: primaryBtn, children: pending ? "Saving…" : "Continue" }), _jsx("button", { type: "button", onClick: next, className: ghostBtn, children: "Skip" })] })] })), step === 2 && (_jsxs(StepShell, { step: 2, title: "Scan your codebase", intro: "A one-time scan teaches the model your pages and components, so every future summary understands the site without re-reading code. It's cached in your database \u2014 the codebase is only touched again if new components appear or you re-scan.", children: [scanned ? (_jsxs("div", { className: "rounded-md border border-emerald-900/50 bg-emerald-950/20 px-3 py-2.5 text-[12px] text-emerald-400", children: ["Profiled ", scanned.sourceFiles, " files \u00B7 ", scanned.coveredIdentifiers.length, " components", scanned.truncated ? " (large app — clipped to budget)" : "", ". The model now knows your site's structure."] })) : (_jsxs(_Fragment, { children: [!sourceAvailable && (_jsx("div", { className: "mb-3 rounded-md border border-amber-900/50 bg-amber-950/20 px-3 py-2 text-[12px] text-amber-400", children: "No source tree found on disk here \u2014 this step needs to run where the code lives (local dev or CI). You can skip it now and scan later." })), _jsxs("label", { className: "block max-w-md", children: [_jsx("span", { className: labelCls, children: "Source folders" }), _jsx("span", { className: "ml-1 text-[11px] text-[#555]", children: "\u2014 optional; defaults to src / app / components / pages / lib." }), _jsx("input", { value: sourceDirs, onChange: (e) => setSourceDirs(e.target.value), placeholder: "e.g. src, content", className: `${inputCls} mt-1.5 font-mono` })] })] })), _jsx("div", { className: "mt-4 flex items-center gap-3", children: scanned ? (_jsx("button", { type: "button", onClick: next, className: primaryBtn, children: "Continue" })) : (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", onClick: scan, disabled: pending || !sourceAvailable, className: primaryBtn, children: pending ? "Scanning…" : "Scan codebase" }), _jsx("button", { type: "button", onClick: next, className: ghostBtn, children: "Skip for now" })] })) })] })), step === 3 && (_jsxs(StepShell, { step: 3, title: "Connect your GitHub repository", intro: "Optional. With the repo connected, problems the model finds are verified against your actual source code \u2014 real ones become GitHub issues with the technical analysis and fix suggestions, false alarms are dropped. A fine-grained token scoped to just this repo is all it needs.", children: [githubStatus ? (_jsxs("div", { className: "rounded-md border border-emerald-900/50 bg-emerald-950/20 px-3 py-2.5 text-[12px] text-emerald-400", children: ["Connected to ", githubStatus.repo, " \u00B7 default branch", " ", _jsx("code", { className: "font-mono", children: githubStatus.defaultBranch }), !githubStatus.issuesEnabled && " · issues are disabled on this repo", !githubStatus.canPush && " · token can't push (branches/PRs unavailable)"] })) : (_jsxs("div", { className: "grid gap-4 sm:grid-cols-2", children: [_jsxs("label", { className: "block", children: [_jsx("span", { className: labelCls, children: "Repository" }), _jsx("input", { value: githubRepo, onChange: (e) => setGithubRepo(e.target.value), placeholder: "owner/repo", className: `${inputCls} mt-1.5 font-mono` })] }), _jsxs("label", { className: "block", children: [_jsx("span", { className: labelCls, children: "Access token" }), _jsx("input", { type: "password", value: githubToken, onChange: (e) => setGithubToken(e.target.value), placeholder: settings.hasGithubToken
234
+ ? "•••••••• (stored — leave blank to keep)"
235
+ : "github_pat_…", autoComplete: "off", className: `${inputCls} mt-1.5` }), _jsxs("span", { className: "mt-1 block text-[11px] text-[#555]", children: ["Create a", " ", _jsx("a", { href: "https://github.com/settings/personal-access-tokens/new", target: "_blank", rel: "noreferrer noopener", className: "text-[#888] underline decoration-[#444] underline-offset-2 hover:text-white", children: "fine-grained token" }), " ", "for this repo with Contents (read) and Issues & Pull requests (write). Stored server-side; never sent to the browser."] })] })] })), _jsxs("label", { className: "mt-4 flex max-w-xl cursor-pointer items-start gap-2.5", children: [_jsx("input", { type: "checkbox", checked: autoIssues, onChange: (e) => setAutoIssues(e.target.checked), className: "mt-0.5 h-3.5 w-3.5 shrink-0 cursor-pointer accent-white" }), _jsxs("span", { children: [_jsx("span", { className: "block text-[13px] font-medium text-white", children: "Allow creating issues automatically" }), _jsx("span", { className: "mt-0.5 block text-[11px] leading-snug text-[#666]", children: "Every new problem a summary finds is verified against the source and \u2014 when it holds up \u2014 filed as a GitHub issue on its own, with technical details and fix suggestions. The same problem is never filed twice." })] })] }), _jsx("div", { className: "mt-4 flex items-center gap-3", children: githubStatus ? (_jsx("button", { type: "button", onClick: finishGithub, disabled: pending, className: primaryBtn, children: pending ? "Saving…" : "Continue" })) : (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", onClick: connectGithub, disabled: pending || !githubRepo.trim() || (!githubToken && !settings.hasGithubToken), className: primaryBtn, children: pending ? "Connecting…" : "Connect GitHub" }), _jsx("button", { type: "button", onClick: next, className: ghostBtn, children: "Skip for now" })] })) })] })), step === 4 && (_jsxs(StepShell, { step: 4, title: "How often should the story refresh?", intro: "With the profile cached, a refresh only spends tokens when there's new behavior to narrate \u2014 unchanged data is always free. Auto-refresh runs in the background when you open the dashboard past the cadence.", children: [_jsx("div", { className: "grid gap-2 sm:grid-cols-3", children: CADENCES.map((c) => (_jsxs("button", { type: "button", onClick: () => setCadence(c.value), className: `rounded-md border px-3 py-2.5 text-left transition-colors ${cadence === c.value
236
+ ? "border-white bg-[#141414]"
237
+ : "border-[#2e2e2e] hover:border-[#555]"}`, children: [_jsx("span", { className: "block text-[13px] font-medium text-white", children: c.label }), _jsx("span", { className: "mt-0.5 block text-[11px] leading-snug text-[#666]", children: c.hint })] }, c.value))) }), _jsx("div", { className: "mt-4", children: _jsx("button", { type: "button", onClick: finish, disabled: pending, className: primaryBtn, children: pending ? "Generating your first summary…" : "Finish & generate first summary" }) })] }))] }));
238
+ }
239
+ // ── The settled settings form ────────────────────────────────────────────────
240
+ /** One titled card in the settings stack. */
241
+ function Group({ title, hint, children, }) {
242
+ return (_jsxs("section", { className: `mb-4 ${card} overflow-hidden`, children: [_jsxs("div", { className: `border-b ${border} px-4 py-3 sm:px-5`, children: [_jsx("span", { className: labelCls, children: title }), _jsx("p", { className: "mt-1 text-[12px] leading-relaxed text-[#666]", children: hint })] }), _jsx("div", { className: "px-4 py-4 sm:px-5", children: children })] }));
243
+ }
244
+ function SettingsForm({ settings, profile, gaps, sourceAvailable, onSaved, onProfile, onError, }) {
245
+ const [provider, setProvider] = useState(settings.provider);
246
+ const [model, setModel] = useState(settings.model);
247
+ const [apiKey, setApiKey] = useState("");
248
+ const [baseUrl, setBaseUrl] = useState(settings.baseUrl ?? "");
249
+ const [instructions, setInstructions] = useState(settings.instructions ?? "");
250
+ const [context, setContext] = useState(settings.context ?? "");
251
+ const [audience, setAudience] = useState(settings.audience ?? "");
252
+ const [ideology, setIdeology] = useState(settings.ideology ?? "");
253
+ const [sourceDirs, setSourceDirs] = useState(settings.sourceDirs ?? "");
254
+ const [cadence, setCadence] = useState(settings.refreshCadence ?? "manual");
255
+ const [githubRepo, setGithubRepo] = useState(settings.githubRepo ?? "");
256
+ const [githubToken, setGithubToken] = useState("");
257
+ const [autoIssues, setAutoIssues] = useState(settings.githubAutoIssues ?? false);
258
+ const [saved, setSaved] = useState(false);
259
+ const [pending, startSave] = useTransition();
260
+ const prov = PROVIDERS.find((p) => p.value === provider);
261
+ const save = () => {
262
+ setSaved(false);
263
+ startSave(async () => {
264
+ const next = await saveAISettingsAction({
265
+ provider,
266
+ model,
267
+ apiKey, // blank keeps the stored key
268
+ baseUrl,
269
+ instructions,
270
+ context,
271
+ audience,
272
+ ideology,
273
+ sourceDirs,
274
+ refreshCadence: cadence,
275
+ githubRepo,
276
+ githubToken, // blank keeps the stored token
277
+ githubAutoIssues: autoIssues,
278
+ });
279
+ onSaved(next);
280
+ setApiKey("");
281
+ setGithubToken("");
282
+ setSaved(true);
283
+ });
284
+ };
285
+ return (_jsxs(_Fragment, { children: [_jsx(Group, { title: "Model", hint: "Bring your own key. The same provider answers the analytics summary and the design review.", children: _jsxs("div", { className: "grid gap-4 sm:grid-cols-2", children: [_jsxs("label", { className: "block", children: [_jsx("span", { className: labelCls, children: "Provider" }), _jsx("select", { value: provider, onChange: (e) => setProvider(e.target.value), className: `${inputCls} mt-1.5`, children: PROVIDERS.map((p) => (_jsx("option", { value: p.value, children: p.label }, p.value))) })] }), _jsx(ModelField, { provider: provider, model: model, onModel: setModel, apiKey: apiKey, baseUrl: baseUrl, hasStoredKey: settings.hasApiKey && settings.provider === provider }), _jsxs("label", { className: "block", children: [_jsx("span", { className: labelCls, children: "API key" }), _jsx("input", { type: "password", value: apiKey, onChange: (e) => setApiKey(e.target.value), placeholder: settings.hasApiKey ? "•••••••• (stored — leave blank to keep)" : "Paste your key", autoComplete: "off", className: `${inputCls} mt-1.5` }), prov && (_jsxs("span", { className: "mt-1 block text-[11px] text-[#555]", children: ["Get a key from", " ", _jsx("a", { href: prov.keyUrl, target: "_blank", rel: "noreferrer noopener", className: "text-[#888] underline decoration-[#444] underline-offset-2 hover:text-white", children: prov.keyHost }), ". Stored server-side; never sent to the browser."] }))] }), _jsxs("label", { className: "block", children: [_jsx("span", { className: labelCls, children: "Auto-refresh" }), _jsx("select", { value: cadence, onChange: (e) => setCadence(e.target.value), className: `${inputCls} mt-1.5`, children: CADENCES.map((c) => (_jsxs("option", { value: c.value, children: [c.label, " \u2014 ", c.hint.toLowerCase()] }, c.value))) })] }), provider === "openai-compatible" && (_jsxs("label", { className: "block", children: [_jsx("span", { className: labelCls, children: "Base URL" }), _jsx("input", { value: baseUrl, onChange: (e) => setBaseUrl(e.target.value), placeholder: "https://openrouter.ai/api/v1", className: `${inputCls} mt-1.5 font-mono` })] }))] }) }), _jsxs(Group, { title: "Your site", hint: "Context the model reads before it interprets a single number. Optional, and the story is noticeably sharper with it.", children: [_jsxs("label", { className: "block", children: [_jsx("span", { className: labelCls, children: "Site description" }), _jsx("span", { className: "ml-1 text-[11px] text-[#555]", children: "\u2014 what the site is, who it's for, key flows." }), _jsx("textarea", { value: context, onChange: (e) => setContext(e.target.value), rows: 2, placeholder: "e.g. A personal notes site. Visitors read articles and browse by tag. The /admin editor is owner-only.", className: `${inputCls} mt-1.5 resize-y` })] }), _jsxs("div", { className: "mt-4 grid gap-4 sm:grid-cols-2", children: [_jsxs("label", { className: "block", children: [_jsx("span", { className: labelCls, children: "Target audience" }), _jsx("input", { value: audience, onChange: (e) => setAudience(e.target.value), placeholder: "e.g. Recruiters and fellow designers", className: `${inputCls} mt-1.5` })] }), _jsxs("label", { className: "block", children: [_jsx("span", { className: labelCls, children: "Ideology / values" }), _jsx("input", { value: ideology, onChange: (e) => setIdeology(e.target.value), placeholder: "e.g. Depth over clicks \u2014 long reads matter most", className: `${inputCls} mt-1.5` })] })] }), _jsxs("label", { className: "mt-4 block", children: [_jsx("span", { className: labelCls, children: "Instructions" }), _jsx("span", { className: "ml-1 text-[11px] text-[#555]", children: "\u2014 optional: tone, focus, what to call out." }), _jsx("textarea", { value: instructions, onChange: (e) => setInstructions(e.target.value), rows: 2, placeholder: "e.g. Focus on conversion blockers. Keep it blunt.", className: `${inputCls} mt-1.5 resize-y` })] })] }), _jsxs(Group, { title: "Codebase", hint: "One scan teaches the model your pages and components, and every later summary reuses it instead of re-reading code.", children: [_jsx(ProfileStrip, { profile: profile, gaps: gaps, hasApiKey: settings.hasApiKey, sourceAvailable: sourceAvailable, onScanned: onProfile, onError: onError }), _jsxs("label", { className: "mt-4 block", children: [_jsx("span", { className: labelCls, children: "Source folders" }), _jsx("span", { className: "ml-1 text-[11px] text-[#555]", children: "\u2014 optional, comma-separated, relative to the project root. Defaults to src / app / components / pages / lib." }), _jsx("input", { value: sourceDirs, onChange: (e) => setSourceDirs(e.target.value), placeholder: "e.g. src, content", className: `${inputCls} mt-1.5 font-mono` })] })] }), _jsxs(Group, { title: "GitHub", hint: "Where findings go to get fixed. Problems are verified against the source first \u2014 false alarms never become issues.", children: [_jsxs("div", { className: "grid gap-4 sm:grid-cols-2", children: [_jsxs("label", { className: "block", children: [_jsx("span", { className: labelCls, children: "Repository" }), _jsx("input", { value: githubRepo, onChange: (e) => setGithubRepo(e.target.value), placeholder: "owner/repo", className: `${inputCls} mt-1.5 font-mono` })] }), _jsxs("label", { className: "block", children: [_jsx("span", { className: labelCls, children: "Access token" }), _jsx("span", { className: "ml-1 text-[11px] text-[#555]", children: "\u2014 Contents (read), Issues & Pull requests (write)." }), _jsx("input", { type: "password", value: githubToken, onChange: (e) => setGithubToken(e.target.value), placeholder: settings.hasGithubToken ? "•••••••• (stored — leave blank to keep)" : "github_pat_…", autoComplete: "off", className: `${inputCls} mt-1.5` })] })] }), _jsxs("label", { className: "mt-4 flex cursor-pointer items-start gap-2.5", children: [_jsx("input", { type: "checkbox", checked: autoIssues, onChange: (e) => setAutoIssues(e.target.checked), className: "mt-0.5 h-3.5 w-3.5 shrink-0 cursor-pointer accent-white" }), _jsxs("span", { children: [_jsx("span", { className: "block text-[13px] text-white", children: "Allow creating issues automatically" }), _jsx("span", { className: "mt-0.5 block text-[11px] leading-snug text-[#666]", children: "New problems are verified against the source, then filed on their own; never twice." })] })] })] }), _jsxs("div", { className: "flex flex-wrap items-center gap-3 pb-4", children: [_jsx("button", { type: "button", onClick: save, disabled: pending, className: primaryBtn, children: pending ? "Saving…" : "Save settings" }), saved && _jsx("span", { className: "text-[12px] text-emerald-400", children: "Saved" }), settings.fromEnv && (_jsx("span", { className: "text-[11px] text-[#555]", children: "Defaults loaded from environment variables." }))] })] }));
286
+ }
287
+ // ── Project profile ──────────────────────────────────────────────────────────
288
+ function ProfileStrip({ profile, gaps, hasApiKey, sourceAvailable, onScanned, onError, }) {
289
+ const [expanded, setExpanded] = useState(false);
290
+ const [pending, startScan] = useTransition();
291
+ const scan = () => {
292
+ startScan(async () => {
293
+ const res = await generateProfileAction();
294
+ if (res.ok)
295
+ onScanned(res.profile);
296
+ else
297
+ onError(res.message);
298
+ });
299
+ };
300
+ const canScan = hasApiKey && sourceAvailable && !pending;
301
+ return (_jsxs("div", { className: `rounded-md border ${border} bg-[#080808] px-3 py-2.5`, children: [_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2 text-[11px] text-[#555]", children: [_jsx("span", { className: labelCls, children: "Project profile" }), profile ? (_jsxs(_Fragment, { children: [_jsxs("span", { children: ["scanned ", relTime(profile.generatedAt), " \u00B7 ", profile.sourceFiles, " files \u00B7", " ", profile.coveredIdentifiers.length, " components", profile.truncated ? " · clipped to budget" : ""] }), gaps.length > 0 && (_jsxs("span", { className: "rounded-full bg-amber-950/50 px-2 py-0.5 text-amber-400", children: [gaps.length, " new ", gaps.length === 1 ? "component" : "components", " not covered \u2014 re-scan"] })), _jsx("button", { type: "button", onClick: () => setExpanded((e) => !e), className: "text-[#888] underline decoration-[#444] underline-offset-2 hover:text-white", children: expanded ? "Hide" : "View" })] })) : (_jsx("span", { className: "max-w-md", children: sourceAvailable
302
+ ? "Not scanned yet."
303
+ : "Source not on disk here — run the scan in local dev; the saved profile then serves everywhere." }))] }), _jsx("button", { type: "button", onClick: scan, disabled: !canScan, title: !hasApiKey
304
+ ? "Add an API key first"
305
+ : !sourceAvailable
306
+ ? "No source tree found on disk"
307
+ : undefined, className: "rounded-md border border-[#2e2e2e] px-2.5 py-1 text-[11px] text-[#aaa] transition-colors hover:border-[#555] hover:text-white disabled:cursor-not-allowed disabled:opacity-40", children: pending ? "Scanning…" : profile ? "Re-scan codebase" : "Scan codebase" })] }), expanded && profile && (_jsx("p", { className: "mt-3 whitespace-pre-wrap text-[12px] leading-relaxed text-[#999]", children: profile.text }))] }));
308
+ }
309
+ //# sourceMappingURL=settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.js","sourceRoot":"","sources":["../../src/dashboard/settings.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAkB,MAAM,OAAO,CAAC;AAE3E,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,eAAe,CAAC;AAQvB,OAAO,EACL,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,OAAO,GACR,MAAM,MAAM,CAAC;AAEd,MAAM,CAAC,MAAM,SAAS,GAMhB;IACJ;QACE,KAAK,EAAE,WAAW;QAClB,KAAK,EAAE,oBAAoB;QAC3B,SAAS,EAAE,iBAAiB;QAC5B,MAAM,EAAE,6CAA6C;QACrD,OAAO,EAAE,uBAAuB;KACjC;IACD;QACE,KAAK,EAAE,QAAQ;QACf,KAAK,EAAE,QAAQ;QACf,SAAS,EAAE,aAAa;QACxB,MAAM,EAAE,sCAAsC;QAC9C,OAAO,EAAE,qBAAqB;KAC/B;IACD;QACE,KAAK,EAAE,mBAAmB;QAC1B,KAAK,EAAE,mBAAmB;QAC1B,SAAS,EAAE,UAAU;QACrB,MAAM,EAAE,4BAA4B;QACpC,OAAO,EAAE,oCAAoC;KAC9C;IACD;QACE,KAAK,EAAE,QAAQ;QACf,KAAK,EAAE,iBAAiB;QACxB,SAAS,EAAE,kBAAkB;QA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G,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EACrC,SAAS,EAAC,6EAA6E,YAEtF,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,GACpB,IACR,CACJ,CAAC,CAAC,CAAC,CACF,eAAM,SAAS,EAAC,UAAU,YACvB,eAAe;oCACd,CAAC,CAAC,kBAAkB;oCACpB,CAAC,CAAC,gGAAgG,GAC/F,CACR,IACG,EACN,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,IAAI,EACb,QAAQ,EAAE,CAAC,OAAO,EAClB,KAAK,EACH,CAAC,SAAS;4BACR,CAAC,CAAC,sBAAsB;4BACxB,CAAC,CAAC,CAAC,eAAe;gCAChB,CAAC,CAAC,8BAA8B;gCAChC,CAAC,CAAC,SAAS,EAEjB,SAAS,EAAC,+KAA+K,YAExL,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,eAAe,GAChE,IACL,EACL,QAAQ,IAAI,OAAO,IAAI,CACtB,YAAG,SAAS,EAAC,kEAAkE,YAC5E,OAAO,CAAC,IAAI,GACX,CACL,IACG,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Polishd — collapse long lists behind a "Show more" toggle.
3
+ *
4
+ * The Design tab's sections are server-rendered; this is the one client-side
5
+ * piece they share. The server passes the overflow rows as `children`, so the
6
+ * hidden content is already rendered and toggling costs nothing — no state
7
+ * beyond a boolean, no refetch.
8
+ */
9
+ import { type ReactNode } from "react";
10
+ export default function ShowMore({ count, label, children, }: {
11
+ /** How many items are hidden behind the toggle. */
12
+ count: number;
13
+ /** What the items are, plural — "type styles", "colors", "pages". */
14
+ label: string;
15
+ children: ReactNode;
16
+ }): import("react").JSX.Element;
17
+ //# sourceMappingURL=show-more.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"show-more.d.ts","sourceRoot":"","sources":["../../src/dashboard/show-more.tsx"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEjD,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAC/B,KAAK,EACL,KAAK,EACL,QAAQ,GACT,EAAE;IACD,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,SAAS,CAAC;CACrB,+BAiBA"}
@@ -0,0 +1,18 @@
1
+ "use client";
2
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ /**
4
+ * Polishd — collapse long lists behind a "Show more" toggle.
5
+ *
6
+ * The Design tab's sections are server-rendered; this is the one client-side
7
+ * piece they share. The server passes the overflow rows as `children`, so the
8
+ * hidden content is already rendered and toggling costs nothing — no state
9
+ * beyond a boolean, no refetch.
10
+ */
11
+ import { useState } from "react";
12
+ export default function ShowMore({ count, label, children, }) {
13
+ const [open, setOpen] = useState(false);
14
+ if (count <= 0)
15
+ return _jsx(_Fragment, { children: children });
16
+ return (_jsxs(_Fragment, { children: [open && children, _jsx("div", { className: "border-t border-[#2e2e2e] px-4 py-2.5 sm:px-5", children: _jsx("button", { type: "button", onClick: () => setOpen((o) => !o), className: "text-[11px] font-medium text-[#888] transition-colors hover:text-white", children: open ? `Show less ↑` : `Show ${count} more ${label} ↓` }) })] }));
17
+ }
18
+ //# sourceMappingURL=show-more.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"show-more.js","sourceRoot":"","sources":["../../src/dashboard/show-more.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb;;;;;;;GAOG;AACH,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAEjD,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAC/B,KAAK,EACL,KAAK,EACL,QAAQ,GAOT;IACC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxC,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,4BAAG,QAAQ,GAAI,CAAC;IACvC,OAAO,CACL,8BACG,IAAI,IAAI,QAAQ,EACjB,cAAK,SAAS,EAAC,+CAA+C,YAC5D,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EACjC,SAAS,EAAC,wEAAwE,YAEjF,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,KAAK,SAAS,KAAK,IAAI,GAChD,GACL,IACL,CACJ,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../../src/dashboard/summary.tsx"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAEV,uBAAuB,EAGvB,qBAAqB,EAErB,cAAc,EACf,MAAM,aAAa,CAAC;AAoOrB,MAAM,WAAW,gBAAgB;IAC/B,cAAc,EAAE,cAAc,GAAG,IAAI,CAAC;IACtC,eAAe,EAAE,uBAAuB,CAAC;IACzC,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAC7C,6EAA6E;IAC7E,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,qEAAqE;IACrE,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,cAAc,EACd,eAAe,EACf,YAAY,EACZ,cAAc,EACd,WAAW,EACX,eAAe,GAChB,EAAE,gBAAgB,+BAoKlB"}
1
+ {"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../../src/dashboard/summary.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EACV,uBAAuB,EAEvB,qBAAqB,EACrB,cAAc,EACf,MAAM,aAAa,CAAC;AAGrB,MAAM,WAAW,gBAAgB;IAC/B,cAAc,EAAE,cAAc,GAAG,IAAI,CAAC;IACtC,eAAe,EAAE,uBAAuB,CAAC;IACzC,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAC7C,6EAA6E;IAC7E,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,qEAAqE;IACrE,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,cAAc,EACd,eAAe,EACf,YAAY,EACZ,cAAc,EACd,WAAW,EACX,eAAe,GAChB,EAAE,gBAAgB,+BAmHlB"}