spec-snake 0.0.1-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/cli/index.ts", "../src/cli/commands/init.ts", "../src/cli/commands/start.ts", "../src/schema.ts", "../src/server/api.ts", "../src/server/apps/docs.ts", "../src/server/helpers/docs/transform.ts", "../src/server/repositories/document.ts", "../src/server/helpers/docs/metadata.ts", "../src/server/usecases/docs/generate-doc.ts", "../src/server/apps/scenarios.ts", "../src/server/helpers/scenarios/build-form-defaults.ts", "../src/server/helpers/scenarios/build-section-info.ts"],
4
+ "sourcesContent": ["import { defineCommand, runMain } from 'citty';\n\nimport { initCommand } from './commands/init';\nimport { startCommand } from './commands/start';\n\nconst main = defineCommand({\n meta: {\n name: 'design-docs-generator',\n version: '0.0.1',\n description: 'Design Docs Generator CLI',\n },\n subCommands: {\n init: initCommand,\n start: startCommand,\n },\n});\n\nrunMain(main);\n", "import * as fs from 'node:fs';\nimport * as path from 'node:path';\n\nimport { defineCommand } from 'citty';\nimport { consola } from 'consola';\n\nconst CONFIG_TEMPLATE = `// For more detailed configuration examples, see:\n// https://github.com/cut0/spec-snake/blob/main/examples/spec-snake.ts\n\nimport { defineConfig, defineScenario } from '@cut0/spec-snake';\n\nexport default defineConfig({\n scenarios: [\n defineScenario({\n id: 'default',\n name: 'Design Doc Generator',\n steps: [\n {\n slug: 'overview',\n title: 'Overview',\n description: 'Basic information about the feature',\n section: {\n type: 'single',\n name: 'overview',\n fields: [\n {\n type: 'input',\n id: 'title',\n label: 'Title',\n description: 'Feature title',\n placeholder: 'Enter feature title',\n required: true,\n },\n {\n type: 'textarea',\n id: 'description',\n label: 'Description',\n description: 'Detailed description of the feature',\n placeholder: 'Describe the feature...',\n rows: 4,\n },\n {\n type: 'select',\n id: 'priority',\n label: 'Priority',\n description: 'Feature priority level',\n placeholder: 'Select priority',\n options: [\n { value: 'high', label: 'High' },\n { value: 'medium', label: 'Medium' },\n { value: 'low', label: 'Low' },\n ],\n },\n ],\n },\n },\n ],\n overrides: {\n filename: (params) => {\n return \\`\\${params.timestamp}.md\\`;\n },\n },\n prompt:\n 'Generate a design doc based on the following input: {{INPUT_JSON}}',\n }),\n ],\n permissions: {\n allowSave: true,\n },\n});\n`;\n\nexport const initCommand = defineCommand({\n meta: {\n name: 'init',\n description:\n 'Initialize a new spec-snake.config.ts file in the current directory',\n },\n args: {\n output: {\n type: 'string',\n description: 'Output file path',\n alias: 'o',\n default: 'spec-snake.config.ts',\n },\n force: {\n type: 'boolean',\n description: 'Overwrite existing file',\n alias: 'f',\n default: false,\n },\n },\n async run({ args }) {\n const outputPath = path.resolve(process.cwd(), args.output);\n\n if (fs.existsSync(outputPath) && !args.force) {\n consola.error(`File already exists: ${outputPath}`);\n consola.info('Use --force (-f) to overwrite');\n process.exit(1);\n }\n\n try {\n fs.writeFileSync(outputPath, CONFIG_TEMPLATE, 'utf-8');\n consola.success(`Config file created: ${outputPath}`);\n } catch (error) {\n consola.error('Failed to create config file:', error);\n process.exit(1);\n }\n },\n});\n", "import * as fs from 'node:fs';\nimport * as path from 'node:path';\nimport * as url from 'node:url';\n\nimport { serve } from '@hono/node-server';\nimport { serveStatic } from '@hono/node-server/serve-static';\nimport { defineCommand } from 'citty';\nimport { consola } from 'consola';\nimport { createJiti } from 'jiti';\n\nimport { type Config, safeParseConfig } from '../../definitions';\nimport { createApiServer } from '../../server/api';\n\nconst getDistClientDir = (): string => {\n const __filename = url.fileURLToPath(import.meta.url);\n const __dirname = path.dirname(__filename);\n\n // \u30D3\u30EB\u30C9\u5F8C: dist/cli.js \u2192 dist/client (\u540C\u3058 dist \u914D\u4E0B)\n // \u958B\u767A\u6642: src/cli/commands/start.ts \u2192 dist/client (3\u968E\u5C64\u4E0A\u306E dist \u914D\u4E0B)\n const isBuilt = __dirname.endsWith('/dist') || __dirname.includes('/dist/');\n return isBuilt\n ? path.resolve(__dirname, 'client')\n : path.resolve(__dirname, '../../../dist/client');\n};\n\nconst loadConfig = async (configPath: string): Promise<Config> => {\n const absolutePath = path.resolve(process.cwd(), configPath);\n\n if (!fs.existsSync(absolutePath)) {\n throw new Error(`Config file not found: ${absolutePath}`);\n }\n\n const jiti = createJiti(import.meta.url);\n const configModule = await jiti.import(absolutePath);\n const config = (configModule as { default: Config }).default;\n\n const result = safeParseConfig(config);\n if (!result.success) {\n const issues = result.issues.map((issue) => {\n const pathStr = issue.path?.map((p) => p.key).join('.') ?? '';\n return ` - ${pathStr}: ${issue.message}`;\n });\n throw new Error(`Invalid config:\\n${issues.join('\\n')}`);\n }\n\n // hooks \u306F valibot \u3067\u30D0\u30EA\u30C7\u30FC\u30B7\u30E7\u30F3\u3067\u304D\u306A\u3044\u305F\u3081\u3001\u5143\u306E config \u304B\u3089\u4FDD\u6301\n return config;\n};\n\nconst runServer = async (\n config: Config,\n options: { distDir: string; port: number; host: string },\n) => {\n consola.start('Starting server...');\n\n const app = createApiServer(config);\n\n app.use(\n '/*',\n serveStatic({\n root: options.distDir,\n rewriteRequestPath: (requestPath) => {\n const fullPath = path.join(options.distDir, requestPath);\n if (fs.existsSync(fullPath) && fs.statSync(fullPath).isFile()) {\n return requestPath;\n }\n return '/index.html';\n },\n }),\n );\n\n const server = serve(\n {\n fetch: app.fetch,\n port: options.port,\n hostname: options.host,\n },\n (info) => {\n const displayHost =\n info.address === '::1' || info.address === '127.0.0.1'\n ? 'localhost'\n : info.address;\n consola.success('Server started');\n consola.info(` \u279C Local: http://${displayHost}:${info.port}/`);\n },\n );\n\n const cleanup = () => {\n consola.info('Shutting down server...');\n server.close(() => {\n process.exit(0);\n });\n };\n\n process.on('SIGINT', cleanup);\n process.on('SIGTERM', cleanup);\n};\n\nexport const startCommand = defineCommand({\n meta: {\n name: 'start',\n description: 'Start the server with the specified config',\n },\n args: {\n config: {\n type: 'string',\n description: 'Path to config file',\n alias: 'c',\n default: 'spec-snake.config.ts',\n },\n port: {\n type: 'string',\n description: 'Port to run the server on',\n alias: 'p',\n default: '3000',\n },\n host: {\n type: 'string',\n description: 'Host to bind the server to',\n default: 'localhost',\n },\n },\n async run({ args }) {\n const configPath = args.config;\n const port = Number.parseInt(args.port, 10);\n\n consola.start(`Loading config from: ${configPath}`);\n\n try {\n const config = await loadConfig(configPath);\n consola.success(\n `Config loaded successfully (${config.scenarios.length} scenarios)`,\n );\n\n await runServer(config, {\n distDir: getDistClientDir(),\n port,\n host: args.host,\n });\n } catch (error) {\n if (error instanceof Error) {\n consola.error(error.message);\n } else {\n consola.error('Failed to start server:', error);\n }\n process.exit(1);\n }\n },\n});\n", "import * as v from 'valibot';\nimport type { Field, GridLayout, LayoutField } from './types';\n\n// =============================================================================\n// Type Guards\n// =============================================================================\n\nexport const isLayoutField = (field: Field): field is LayoutField => {\n return field.type === 'grid';\n};\n\n// =============================================================================\n// Form Field Schemas\n// =============================================================================\n\nconst FieldBaseSchema = v.object({\n id: v.string(),\n label: v.string(),\n description: v.string(),\n placeholder: v.optional(v.string()),\n required: v.optional(v.boolean()),\n});\n\nexport const SelectOptionSchema = v.object({\n value: v.string(),\n label: v.string(),\n});\n\nexport const InputFieldSchema = v.object({\n ...FieldBaseSchema.entries,\n type: v.literal('input'),\n inputType: v.optional(v.picklist(['text', 'date', 'url'])),\n suggestions: v.optional(v.array(v.string())),\n});\n\nexport const TextareaFieldSchema = v.object({\n ...FieldBaseSchema.entries,\n type: v.literal('textarea'),\n rows: v.optional(v.number()),\n});\n\nexport const SelectFieldSchema = v.object({\n ...FieldBaseSchema.entries,\n type: v.literal('select'),\n options: v.array(SelectOptionSchema),\n});\n\nexport const CheckboxFieldSchema = v.object({\n ...FieldBaseSchema.entries,\n type: v.literal('checkbox'),\n});\n\nexport const FormFieldSchema = v.union([\n InputFieldSchema,\n TextareaFieldSchema,\n SelectFieldSchema,\n CheckboxFieldSchema,\n]);\n\n// =============================================================================\n// Layout Schemas\n// =============================================================================\n\nexport const GridLayoutSchema: v.GenericSchema<GridLayout> = v.object({\n type: v.literal('grid'),\n columns: v.number(),\n fields: v.array(v.lazy(() => FieldSchema)),\n});\n\nexport const FieldSchema: v.GenericSchema<Field> = v.union([\n FormFieldSchema,\n GridLayoutSchema,\n]);\n\n// =============================================================================\n// Section Schemas\n// =============================================================================\n\nexport const SingleSectionSchema = v.object({\n type: v.literal('single'),\n name: v.string(),\n fields: v.array(FieldSchema),\n});\n\nexport const ArraySectionSchema = v.object({\n type: v.literal('array'),\n name: v.string(),\n fields: v.array(FieldSchema),\n minFieldCount: v.optional(v.number()),\n});\n\nexport const SectionSchema = v.union([SingleSectionSchema, ArraySectionSchema]);\n\n// =============================================================================\n// Step Schema\n// =============================================================================\n\nexport const StepSchema = v.object({\n slug: v.string(),\n title: v.string(),\n description: v.string(),\n section: SectionSchema,\n});\n\n// =============================================================================\n// AI Settings Schemas (Claude Agent SDK)\n// =============================================================================\n\nexport const McpServerConfigSchema = v.union([\n v.object({\n type: v.optional(v.literal('stdio')),\n command: v.string(),\n args: v.optional(v.array(v.string())),\n env: v.optional(v.record(v.string(), v.string())),\n }),\n v.object({\n type: v.literal('sse'),\n url: v.string(),\n headers: v.optional(v.record(v.string(), v.string())),\n }),\n v.object({\n type: v.literal('http'),\n url: v.string(),\n headers: v.optional(v.record(v.string(), v.string())),\n }),\n]);\n\nexport const AiSettingsSchema = v.optional(\n v.object({\n model: v.optional(v.string()),\n fallbackModel: v.optional(v.string()),\n maxThinkingTokens: v.optional(v.number()),\n maxTurns: v.optional(v.number()),\n maxBudgetUsd: v.optional(v.number()),\n allowedTools: v.optional(v.array(v.string())),\n disallowedTools: v.optional(v.array(v.string())),\n tools: v.optional(\n v.union([\n v.array(v.string()),\n v.object({\n type: v.literal('preset'),\n preset: v.literal('claude_code'),\n }),\n ]),\n ),\n permissionMode: v.optional(\n v.picklist([\n 'default',\n 'acceptEdits',\n 'bypassPermissions',\n 'plan',\n 'delegate',\n 'dontAsk',\n ]),\n ),\n allowDangerouslySkipPermissions: v.optional(v.boolean()),\n mcpServers: v.optional(v.record(v.string(), McpServerConfigSchema)),\n strictMcpConfig: v.optional(v.boolean()),\n }),\n);\n\n// =============================================================================\n// Scenario Schema\n// =============================================================================\n\nexport const ScenarioBaseSchema = v.object({\n id: v.string(),\n name: v.string(),\n steps: v.array(StepSchema),\n prompt: v.string(),\n aiSettings: AiSettingsSchema,\n});\n\nexport const ScenarioSchema = ScenarioBaseSchema;\n\n// =============================================================================\n// Configuration Schemas\n// =============================================================================\n\nexport const PermissionsSchema = v.object({\n allowSave: v.boolean(),\n});\n\nexport const ConfigSchema = v.object({\n scenarios: v.array(ScenarioSchema),\n permissions: PermissionsSchema,\n});\n\n// =============================================================================\n// Parser Functions\n// =============================================================================\n\nexport const parseConfig = (data: unknown) => {\n return v.parse(ConfigSchema, data);\n};\n\nexport const safeParseConfig = (data: unknown) => {\n return v.safeParse(ConfigSchema, data);\n};\n", "import { Hono } from 'hono';\n\nimport type { Config } from '../definitions';\n\nimport { createDocsApp } from './apps/docs';\nimport { createScenariosApp } from './apps/scenarios';\nimport { buildSectionInfoMap } from './helpers/scenarios/build-section-info';\n\nexport const createApiServer = (config: Config) => {\n const app = new Hono();\n\n // \u30B7\u30CA\u30EA\u30AA\u3054\u3068\u306E\u60C5\u5831\u3092\u4E8B\u524D\u306B\u30D3\u30EB\u30C9\n const scenarioInfoMap = new Map(\n config.scenarios.map((scenario) => [\n scenario.id,\n {\n scenario,\n sectionInfoMap: buildSectionInfoMap(scenario.steps),\n },\n ]),\n );\n\n // Scenarios App\n const scenariosApp = createScenariosApp(config, scenarioInfoMap);\n\n // Docs App\n const docsApp = createDocsApp(config, scenarioInfoMap);\n\n // Mount sub-apps\n app.route('/', scenariosApp);\n app.route('/', docsApp);\n\n return app;\n};\n", "import { Hono } from 'hono';\nimport { createMiddleware } from 'hono/factory';\n\nimport type { Config } from '../../definitions';\nimport { transformFormData } from '../helpers/docs/transform';\nimport {\n getDocumentsForScenario,\n getFilename,\n readDocument,\n saveDocument,\n} from '../repositories/document';\nimport { generateDesignDoc } from '../usecases/docs/generate-doc';\n\nimport type { ScenarioInfoMapEntry } from './scenarios';\n\ntype Variables = {\n scenarioInfo: ScenarioInfoMapEntry;\n};\n\ntype CreateDocBody = {\n content: string;\n formData: Record<string, unknown>;\n};\n\ntype UpdateDocBody = {\n content: string;\n formData: Record<string, unknown>;\n};\n\nconst createScenarioMiddleware = (\n scenarioInfoMap: Map<string, ScenarioInfoMapEntry>,\n) =>\n createMiddleware<{ Variables: Variables }>(async (c, next) => {\n const scenarioId = c.req.param('scenarioId');\n\n if (scenarioId == null) {\n return c.json({ error: 'Scenario ID is required' }, 400);\n }\n\n const scenarioInfo = scenarioInfoMap.get(scenarioId);\n\n if (scenarioInfo == null) {\n return c.json({ error: 'Scenario not found' }, 404);\n }\n\n c.set('scenarioInfo', scenarioInfo);\n await next();\n });\n\nexport const createDocsApp = (\n config: Config,\n scenarioInfoMap: Map<string, ScenarioInfoMapEntry>,\n) => {\n const app = new Hono<{ Variables: Variables }>();\n\n app.use(\n '/api/scenarios/:scenarioId/*',\n createScenarioMiddleware(scenarioInfoMap),\n );\n\n app.get('/api/scenarios/:scenarioId/docs', async (c) => {\n const { scenario } = c.get('scenarioInfo');\n const docs = await getDocumentsForScenario(scenario);\n\n return c.json({ docs });\n });\n\n app.post('/api/scenarios/:scenarioId/docs/preview', async (c) => {\n const { scenario, sectionInfoMap } = c.get('scenarioInfo');\n\n const formData = (await c.req.json()) as Record<string, unknown>;\n const inputData = transformFormData(formData, sectionInfoMap);\n const content = await generateDesignDoc({ scenario, formData, inputData });\n\n if (scenario.hooks?.onPreview != null) {\n await scenario.hooks.onPreview({ formData, inputData, content });\n }\n\n return c.json({ success: true, content });\n });\n\n app.post('/api/scenarios/:scenarioId/docs', async (c) => {\n const scenarioId = c.req.param('scenarioId');\n const { scenario, sectionInfoMap } = c.get('scenarioInfo');\n\n if (!config.permissions.allowSave) {\n return c.json({ error: 'Save is not allowed' }, 403);\n }\n\n const { content, formData } = (await c.req.json()) as CreateDocBody;\n const inputData = transformFormData(formData, sectionInfoMap);\n const filename = getFilename(\n scenario,\n scenarioId,\n content,\n formData,\n inputData,\n );\n const { outputPath } = await saveDocument({\n scenario,\n scenarioId,\n filename,\n content,\n formData,\n });\n\n if (scenario.hooks?.onSave != null) {\n await scenario.hooks.onSave({\n content,\n filename,\n outputPath,\n formData,\n inputData,\n });\n }\n\n return c.json({ success: true, filename });\n });\n\n app.get('/api/scenarios/:scenarioId/docs/:filename', async (c) => {\n const filename = c.req.param('filename');\n const { scenario } = c.get('scenarioInfo');\n\n const result = await readDocument(scenario, filename);\n\n if (!result.success) {\n return c.json({ error: 'Document not found' }, 404);\n }\n\n return c.json({ doc: result.doc });\n });\n\n app.put('/api/scenarios/:scenarioId/docs/:filename', async (c) => {\n const scenarioId = c.req.param('scenarioId');\n const filename = c.req.param('filename');\n const { scenario, sectionInfoMap } = c.get('scenarioInfo');\n\n if (!config.permissions.allowSave) {\n return c.json({ error: 'Save is not allowed' }, 403);\n }\n\n const { content, formData } = (await c.req.json()) as UpdateDocBody;\n const inputData = transformFormData(formData, sectionInfoMap);\n const { outputPath } = await saveDocument({\n scenario,\n scenarioId,\n filename,\n content,\n formData,\n });\n\n if (scenario.hooks?.onSave != null) {\n await scenario.hooks.onSave({\n content,\n filename,\n outputPath,\n formData,\n inputData,\n });\n }\n\n return c.json({ success: true, filename });\n });\n\n return app;\n};\n", "import type { InputData } from '../../../definitions';\nimport type { SectionInfo } from '../scenarios/build-section-info';\n\nexport const transformFormData = (\n body: Record<string, unknown>,\n sectionInfoMap: Map<string, SectionInfo>,\n): InputData => {\n const items: InputData['items'] = [];\n\n for (const [sectionName, sectionValue] of Object.entries(body)) {\n const sectionInfo = sectionInfoMap.get(sectionName);\n\n if (sectionInfo == null) {\n continue;\n }\n\n const fieldInfoMap = new Map(sectionInfo.fields.map((f) => [f.id, f]));\n\n const values = (\n Array.isArray(sectionValue) ? sectionValue : [sectionValue]\n ).map((item: Record<string, unknown>) => {\n const itemValues: Array<{\n label: string;\n description: string;\n value: unknown;\n }> = Object.entries(item)\n .map(([fieldId, fieldValue]) => {\n const fieldInfo = fieldInfoMap.get(fieldId);\n if (fieldInfo) {\n return {\n label: fieldInfo.label,\n description: fieldInfo.description,\n value: fieldValue,\n };\n }\n return null;\n })\n .filter((value) => value != null);\n\n return itemValues;\n });\n\n items.push({\n title: sectionInfo.title,\n description: sectionInfo.description,\n values,\n });\n }\n\n return { items };\n};\n", "import { mkdir, readFile, readdir, writeFile } from 'node:fs/promises';\nimport { join } from 'node:path';\n\nimport type { InputData, Scenario } from '../../definitions';\nimport {\n type DocumentWithMetadata,\n addMetadataToContent,\n parseMetadata,\n} from '../helpers/docs/metadata';\n\nexport const getOutputDir = (scenario: Scenario): string => {\n return scenario.outputDir ?? join(process.cwd(), 'output');\n};\n\ntype ReadDocumentResult =\n | { success: true; doc: DocumentWithMetadata }\n | { success: false; error: 'not_found' | 'scenario_mismatch' };\n\nexport const readDocument = async (\n scenario: Scenario,\n filename: string,\n): Promise<ReadDocumentResult> => {\n const outputDir = getOutputDir(scenario);\n const filePath = join(outputDir, filename);\n\n try {\n const rawContent = await readFile(filePath, 'utf-8');\n const { metadata, content } = parseMetadata(rawContent);\n\n if (metadata?.scenarioId !== scenario.id) {\n return { success: false, error: 'scenario_mismatch' };\n }\n\n return {\n success: true,\n doc: { filename, content, metadata },\n };\n } catch {\n return { success: false, error: 'not_found' };\n }\n};\n\nexport const getDocumentsForScenario = async (\n scenario: Scenario,\n): Promise<DocumentWithMetadata[]> => {\n const outputDir = getOutputDir(scenario);\n\n try {\n const files = await readdir(outputDir);\n const mdFiles = files.filter((file) => file.endsWith('.md'));\n\n const docs = await Promise.all(\n mdFiles.map(async (filename) => {\n const result = await readDocument(scenario, filename);\n return result.success ? result.doc : null;\n }),\n );\n\n return docs.filter((doc) => doc != null);\n } catch {\n return [];\n }\n};\n\ntype SaveDocumentOptions = {\n scenario: Scenario;\n scenarioId: string;\n filename: string;\n content: string;\n formData: Record<string, unknown>;\n};\n\nexport const saveDocument = async ({\n scenario,\n scenarioId,\n filename,\n content,\n formData,\n}: SaveDocumentOptions): Promise<{ outputPath: string }> => {\n const outputDir = getOutputDir(scenario);\n const outputPath = join(outputDir, filename);\n\n const contentWithMetadata = addMetadataToContent(content, {\n scenarioId,\n formData,\n });\n\n await mkdir(outputDir, { recursive: true });\n await writeFile(outputPath, contentWithMetadata, 'utf-8');\n\n return { outputPath };\n};\n\nexport const getFilename = (\n scenario: Scenario,\n scenarioId: string,\n content: string,\n formData: Record<string, unknown>,\n inputData: InputData,\n): string => {\n const timestamp = new Date().toISOString().replace(/[:.]/g, '-');\n\n const filenameOverride = scenario.overrides?.filename;\n if (filenameOverride != null) {\n return typeof filenameOverride === 'function'\n ? filenameOverride({\n scenarioId,\n timestamp,\n content,\n formData,\n inputData,\n })\n : filenameOverride;\n }\n\n return `design-doc-${scenarioId}-${timestamp}.md`;\n};\n", "export type DocumentMetadata = {\n scenarioId: string;\n formData: Record<string, unknown>;\n};\n\nexport type DocumentWithMetadata = {\n filename: string;\n content: string;\n metadata: DocumentMetadata | null;\n};\n\nconst METADATA_START = '<!-- design-docs-metadata';\nconst METADATA_END = '-->';\n\nexport const serializeMetadata = (metadata: DocumentMetadata): string => {\n return `${METADATA_START}\\n${JSON.stringify(metadata, null, 2)}\\n${METADATA_END}`;\n};\n\nexport const parseMetadata = (\n content: string,\n): { metadata: DocumentMetadata | null; content: string } => {\n const metadataStartIndex = content.lastIndexOf(METADATA_START);\n if (metadataStartIndex === -1) {\n return { metadata: null, content };\n }\n\n const metadataEndIndex = content.indexOf(METADATA_END, metadataStartIndex);\n if (metadataEndIndex === -1) {\n return { metadata: null, content };\n }\n\n try {\n const metadataJson = content\n .slice(metadataStartIndex + METADATA_START.length, metadataEndIndex)\n .trim();\n const metadata = JSON.parse(metadataJson) as DocumentMetadata;\n const cleanContent = content.slice(0, metadataStartIndex).trim();\n return { metadata, content: cleanContent };\n } catch {\n return { metadata: null, content };\n }\n};\n\nexport const addMetadataToContent = (\n content: string,\n metadata: DocumentMetadata,\n): string => {\n return `${content}\\n\\n${serializeMetadata(metadata)}`;\n};\n", "import {\n type Options,\n type SDKResultMessage,\n query,\n} from '@anthropic-ai/claude-agent-sdk';\n\nimport type { InputData, Scenario } from '../../../definitions';\n\ntype GenerateDesignDocParams = {\n scenario: Scenario;\n formData: Record<string, unknown>;\n inputData: InputData;\n};\n\nexport const generateDesignDoc = async ({\n scenario,\n formData,\n inputData,\n}: GenerateDesignDocParams): Promise<string> => {\n const promptTemplate =\n typeof scenario.prompt === 'function'\n ? scenario.prompt({ formData, inputData })\n : scenario.prompt;\n const prompt = promptTemplate.replace(\n '{{INPUT_JSON}}',\n JSON.stringify(inputData, null, 2),\n );\n\n let message: SDKResultMessage | null = null;\n\n for await (const msg of query({\n prompt,\n options: scenario.aiSettings as Options,\n })) {\n if (msg.type === 'result' && msg.subtype === 'success') {\n message = msg;\n }\n }\n\n if (message == null) {\n throw new Error('Query failed');\n }\n\n return message.result;\n};\n", "import { Hono } from 'hono';\n\nimport type { Config, Scenario } from '../../definitions';\nimport { buildFormDefaultValues } from '../helpers/scenarios/build-form-defaults';\nimport type { buildSectionInfoMap } from '../helpers/scenarios/build-section-info';\n\nexport type ScenarioInfo = {\n sectionInfoMap: ReturnType<typeof buildSectionInfoMap>;\n};\n\nexport type ScenarioInfoMapEntry = {\n scenario: Scenario;\n sectionInfoMap: ReturnType<typeof buildSectionInfoMap>;\n};\n\nexport const createScenariosApp = (\n config: Config,\n scenarioInfoMap: Map<string, ScenarioInfoMapEntry>,\n) => {\n const app = new Hono();\n\n // \u5168\u30B7\u30CA\u30EA\u30AA\u53D6\u5F97\n app.get('/api/scenarios', (c) => {\n return c.json({\n scenarios: config.scenarios,\n });\n });\n\n // \u5358\u4E00\u30B7\u30CA\u30EA\u30AA\u53D6\u5F97\n app.get('/api/scenarios/:scenarioId', (c) => {\n const scenarioId = c.req.param('scenarioId');\n const scenarioInfo = scenarioInfoMap.get(scenarioId);\n\n if (scenarioInfo == null) {\n return c.json({ error: 'Scenario not found' }, 404);\n }\n\n const formDefaultValues = buildFormDefaultValues(\n scenarioInfo.scenario.steps,\n );\n\n return c.json({\n scenario: scenarioInfo.scenario,\n formDefaultValues,\n permissions: config.permissions,\n });\n });\n\n return app;\n};\n", "import { type Field, type Step, isLayoutField } from '../../../definitions';\n\nexport const buildFieldDefaults = (\n fields: Field[],\n): Record<string, unknown> => {\n const getFieldDefaultValue = (field: Field): unknown => {\n if (isLayoutField(field)) {\n return undefined;\n }\n switch (field.type) {\n case 'checkbox':\n return false;\n default:\n return '';\n }\n };\n\n const defaults: Record<string, unknown> = {};\n for (const field of fields) {\n if (isLayoutField(field)) {\n Object.assign(defaults, buildFieldDefaults(field.fields));\n } else {\n defaults[field.id] = getFieldDefaultValue(field);\n }\n }\n return defaults;\n};\n\nexport const buildFormDefaultValues = (\n steps: Step[],\n): Record<string, unknown> => {\n const defaults: Record<string, unknown> = {};\n for (const config of steps) {\n if (config.section.type === 'single') {\n defaults[config.section.name] = buildFieldDefaults(config.section.fields);\n } else {\n const minCount = config.section.minFieldCount ?? 1;\n defaults[config.section.name] = Array.from({ length: minCount }, () =>\n buildFieldDefaults(config.section.fields),\n );\n }\n }\n return defaults;\n};\n", "import { type Field, type Step, isLayoutField } from '../../../definitions';\n\nexport type FieldInfo = {\n id: string;\n label: string;\n description: string;\n};\n\nexport type SectionInfo = {\n name: string;\n title: string;\n description: string;\n fields: FieldInfo[];\n};\n\nexport const extractFieldInfos = (fields: Field[]): FieldInfo[] => {\n const result: FieldInfo[] = [];\n for (const field of fields) {\n if (isLayoutField(field)) {\n result.push(...extractFieldInfos(field.fields));\n } else {\n result.push({\n id: field.id,\n label: field.label,\n description: field.description,\n });\n }\n }\n return result;\n};\n\nexport const buildSectionInfoMap = (\n steps: Step[],\n): Map<string, SectionInfo> => {\n const sectionMap = new Map<string, SectionInfo>(\n steps.map((step) => [\n step.section.name,\n {\n name: step.section.name,\n title: step.title,\n description: step.description,\n fields: extractFieldInfos(step.section.fields),\n },\n ]),\n );\n\n return sectionMap;\n};\n"],
5
+ "mappings": ";;;AAAA,SAAS,iBAAAA,gBAAe,eAAe;;;ACAvC,YAAY,QAAQ;AACpB,YAAY,UAAU;AAEtB,SAAS,qBAAqB;AAC9B,SAAS,eAAe;AAExB,IAAM,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkEjB,IAAM,cAAc,cAAc;AAAA,EACvC,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,aACE;AAAA,EACJ;AAAA,EACA,MAAM;AAAA,IACJ,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,aAAa;AAAA,MACb,OAAO;AAAA,MACP,SAAS;AAAA,IACX;AAAA,IACA,OAAO;AAAA,MACL,MAAM;AAAA,MACN,aAAa;AAAA,MACb,OAAO;AAAA,MACP,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EACA,MAAM,IAAI,EAAE,KAAK,GAAG;AAClB,UAAM,aAAkB,aAAQ,QAAQ,IAAI,GAAG,KAAK,MAAM;AAE1D,QAAO,cAAW,UAAU,KAAK,CAAC,KAAK,OAAO;AAC5C,cAAQ,MAAM,wBAAwB,UAAU,EAAE;AAClD,cAAQ,KAAK,+BAA+B;AAC5C,cAAQ,KAAK,CAAC;AAAA,IAChB;AAEA,QAAI;AACF,MAAG,iBAAc,YAAY,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AAC;AAAA,IACH,SAAS,OAAO;AACd,UAAI,iBAAiB,OAAO;AAC1B,QAAAA,SAAQ,MAAM,MAAM,OAAO;AAAA,MAC7B,OAAO;AACL,QAAAA,SAAQ,MAAM,2BAA2B,KAAK;AAAA,MAChD;AACA,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF;AACF,CAAC;;;AF/ID,IAAM,OAAOE,eAAc;AAAA,EACzB,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AAAA,EACA,aAAa;AAAA,IACX,MAAM;AAAA,IACN,OAAO;AAAA,EACT;AACF,CAAC;AAED,QAAQ,IAAI;",
6
+ "names": ["defineCommand", "fs", "path", "defineCommand", "consola", "Hono", "Hono", "Hono", "Hono", "consola", "defineCommand", "defineCommand"]
7
+ }
@@ -0,0 +1 @@
1
+ import{j as o}from"./index-D6usLrOW.js";const e=r=>o.jsx("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r,children:o.jsx("path",{d:"M6 4L10 8L6 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});export{e as C};
@@ -0,0 +1 @@
1
+ import{j as o}from"./index-D6usLrOW.js";const e=t=>o.jsx("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:o.jsx("path",{d:"M9 1H4C3.44772 1 3 1.44772 3 2V14C3 14.5523 3.44772 15 4 15H12C12.5523 15 13 14.5523 13 14V5M9 1L13 5M9 1V5H13M5 8H11M5 11H11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});export{e as D};
@@ -0,0 +1 @@
1
+ import{S as P,g as R,P as D,Q as E,U as L,V as B,W as N,X as A,Y as Q,n as F,r as d,k as H,j as n,Z as W,_,u as z,$ as V,L as Z}from"./index-D6usLrOW.js";var $=class extends P{constructor(t,e){super(),this.options=e,this.#s=t,this.#i=null,this.bindMethods(),this.setOptions(e)}#s;#t=void 0;#f=void 0;#e=void 0;#n;#u;#i;#p;#c;#l;#o;#a;#r;#d=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),I(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return C(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return C(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#R(),this.#t.removeObserver(this)}setOptions(t,e){const s=this.options,i=this.#t;if(this.options=this.#s.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.#C(),this.#t.setOptions(this.options),s._defaulted&&!R(this.options,s)&&this.#s.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const a=this.hasListeners();a&&U(this.#t,i,this.options,s)&&this.#h(),this.updateResult(e),a&&(this.#t!==i||this.options.enabled!==s.enabled||this.options.staleTime!==s.staleTime)&&this.#g();const u=this.#v();a&&(this.#t!==i||this.options.enabled!==s.enabled||u!==this.#r)&&this.#b(u)}getOptimisticResult(t){const e=this.#s.getQueryCache().build(this.#s,t),s=this.createResult(e,t);return K(this,s)&&(this.#e=s,this.#u=this.options,this.#n=this.#t.state),s}getCurrentResult(){return this.#e}trackResult(t,e){const s={};return Object.keys(t).forEach(i=>{Object.defineProperty(s,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),e?.(i),t[i])})}),s}trackProp(t){this.#d.add(t)}getCurrentQuery(){return this.#t}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#s.defaultQueryOptions(t),s=this.#s.getQueryCache().build(this.#s,e);return s.isFetchingOptimistic=!0,s.fetch().then(()=>this.createResult(s,e))}fetch(t){return this.#h({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#e))}#h(t){this.#C();let e=this.#t.fetch(this.options,t);return t?.throwOnError||(e=e.catch(D)),e}#g(){if(this.#x(),E||this.#e.isStale||!L(this.options.staleTime))return;const e=B(this.#e.dataUpdatedAt,this.options.staleTime)+1;this.#o=setTimeout(()=>{this.#e.isStale||this.updateResult()},e)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#b(t){this.#R(),this.#r=t,!(E||this.options.enabled===!1||!L(this.#r)||this.#r===0)&&(this.#a=setInterval(()=>{(this.options.refetchIntervalInBackground||N.isFocused())&&this.#h()},this.#r))}#y(){this.#g(),this.#b(this.#v())}#x(){this.#o&&(clearTimeout(this.#o),this.#o=void 0)}#R(){this.#a&&(clearInterval(this.#a),this.#a=void 0)}createResult(t,e){const s=this.#t,i=this.options,a=this.#e,u=this.#n,o=this.#u,f=t!==s?t.state:this.#f,{state:p}=t;let r={...p},O=!1,l;if(e._optimisticResults){const c=this.hasListeners(),x=!c&&I(t,e),T=c&&U(t,s,e,i);(x||T)&&(r={...r,...A(p.data,t.options)}),e._optimisticResults==="isRestoring"&&(r.fetchStatus="idle")}let{error:w,errorUpdatedAt:S,status:g}=r;if(e.select&&r.data!==void 0)if(a&&r.data===u?.data&&e.select===this.#p)l=this.#c;else try{this.#p=e.select,l=e.select(r.data),l=Q(a?.data,l,e),this.#c=l,this.#i=null}catch(c){this.#i=c}else l=r.data;if(e.placeholderData!==void 0&&l===void 0&&g==="pending"){let c;if(a?.isPlaceholderData&&e.placeholderData===o?.placeholderData)c=a.data;else if(c=typeof e.placeholderData=="function"?e.placeholderData(this.#l?.state.data,this.#l):e.placeholderData,e.select&&c!==void 0)try{c=e.select(c),this.#i=null}catch(x){this.#i=x}c!==void 0&&(g="success",l=Q(a?.data,c,e),O=!0)}this.#i&&(w=this.#i,l=this.#c,S=Date.now(),g="error");const v=r.fetchStatus==="fetching",b=g==="pending",y=g==="error",k=b&&v,j=l!==void 0;return{status:g,fetchStatus:r.fetchStatus,isPending:b,isSuccess:g==="success",isError:y,isInitialLoading:k,isLoading:k,data:l,dataUpdatedAt:r.dataUpdatedAt,error:w,errorUpdatedAt:S,failureCount:r.fetchFailureCount,failureReason:r.fetchFailureReason,errorUpdateCount:r.errorUpdateCount,isFetched:r.dataUpdateCount>0||r.errorUpdateCount>0,isFetchedAfterMount:r.dataUpdateCount>f.dataUpdateCount||r.errorUpdateCount>f.errorUpdateCount,isFetching:v,isRefetching:v&&!b,isLoadingError:y&&!j,isPaused:r.fetchStatus==="paused",isPlaceholderData:O,isRefetchError:y&&j,isStale:m(t,e),refetch:this.refetch}}updateResult(t){const e=this.#e,s=this.createResult(this.#t,this.options);if(this.#n=this.#t.state,this.#u=this.options,this.#n.data!==void 0&&(this.#l=this.#t),R(s,e))return;this.#e=s;const i={},a=()=>{if(!e)return!0;const{notifyOnChangeProps:u}=this.options,o=typeof u=="function"?u():u;if(o==="all"||!o&&!this.#d.size)return!0;const h=new Set(o??this.#d);return this.options.throwOnError&&h.add("error"),Object.keys(this.#e).some(f=>{const p=f;return this.#e[p]!==e[p]&&h.has(p)})};t?.listeners!==!1&&a()&&(i.listeners=!0),this.#m({...i,...t})}#C(){const t=this.#s.getQueryCache().build(this.#s,this.options);if(t===this.#t)return;const e=this.#t;this.#t=t,this.#f=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#m(t){F.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#e)}),this.#s.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function G(t,e){return e.enabled!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function I(t,e){return G(t,e)||t.state.data!==void 0&&C(t,e,e.refetchOnMount)}function C(t,e,s){if(e.enabled!==!1){const i=typeof s=="function"?s(t):s;return i==="always"||i!==!1&&m(t,e)}return!1}function U(t,e,s,i){return(t!==e||i.enabled===!1)&&(!s.suspense||t.state.status!=="error")&&m(t,s)}function m(t,e){return e.enabled!==!1&&t.isStaleByTime(e.staleTime)}function K(t,e){return!R(t.getCurrentResult(),e)}var M=d.createContext(!1),X=()=>d.useContext(M);M.Provider;function Y(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var q=d.createContext(Y()),J=()=>d.useContext(q);function tt(t,e){return typeof t=="function"?t(...e):!!t}function vt(){}var et=(t,e)=>{(t.suspense||t.throwOnError)&&(e.isReset()||(t.retryOnMount=!1))},st=t=>{d.useEffect(()=>{t.clearReset()},[t])},it=({result:t,errorResetBoundary:e,throwOnError:s,query:i})=>t.isError&&!e.isReset()&&!t.isFetching&&i&&tt(s,[t.error,i]),rt=(t,e)=>e.state.data===void 0,nt=t=>{t.suspense&&typeof t.staleTime!="number"&&(t.staleTime=1e3)},ot=(t,e)=>t?.suspense&&e.isPending,at=(t,e,s)=>e.fetchOptimistic(t).catch(()=>{s.clearReset()});function ht(t,e,s){const i=H(),a=X(),u=J(),o=i.defaultQueryOptions(t);o._optimisticResults=a?"isRestoring":"optimistic",nt(o),et(o,u),st(u);const[h]=d.useState(()=>new e(i,o)),f=h.getOptimisticResult(o);if(d.useSyncExternalStore(d.useCallback(p=>{const r=a?()=>{}:h.subscribe(F.batchCalls(p));return h.updateResult(),r},[h,a]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),d.useEffect(()=>{h.setOptions(o,{listeners:!1})},[o,h]),ot(o,f))throw at(o,h,u);if(it({result:f,errorResetBoundary:u,throwOnError:o.throwOnError,query:i.getQueryCache().get(o.queryHash)}))throw f.error;return o.notifyOnChangeProps?f:h.trackResult(f)}function bt(t,e){return ht({...t,enabled:!0,suspense:!0,throwOnError:rt,placeholderData:void 0},$)}const ut=()=>n.jsx("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),ct=()=>n.jsxs("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[n.jsx("path",{d:"M0.666992 8.00004C0.666992 8.00004 3.33366 2.66671 8.00033 2.66671C12.667 2.66671 15.3337 8.00004 15.3337 8.00004C15.3337 8.00004 12.667 13.3334 8.00033 13.3334C3.33366 13.3334 0.666992 8.00004 0.666992 8.00004Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M8.00033 10C9.10489 10 10.0003 9.10461 10.0003 8.00004C10.0003 6.89547 9.10489 6.00004 8.00033 6.00004C6.89576 6.00004 6.00033 6.89547 6.00033 8.00004C6.00033 9.10461 6.89576 10 8.00033 10Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),lt=()=>n.jsx("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{d:"M2 4H14M2 8H14M2 12H14",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),dt=({locale:t,isActive:e,onClick:s})=>{const i=d.useCallback(()=>{s(t)},[t,s]);return n.jsx("button",{className:`px-2 py-1 text-xs rounded transition-colors cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-300 focus-visible:ring-offset-2 ${e?"bg-indigo-500 text-white":"bg-gray-100 text-gray-600 hover:bg-gray-200"}`,type:"button",onClick:i,children:t.toUpperCase()})},ft=({currentLocale:t})=>{const e=d.useCallback(s=>{W(s),window.location.reload()},[]);return n.jsx("div",{className:"flex gap-1",children:Object.keys(_).map(s=>n.jsx(dt,{locale:s,isActive:t===s,onClick:e},s))})},yt=({isMenuOpen:t,onToggleMenu:e,onOpenPreview:s})=>{const{_:i}=z(),a=V();return n.jsxs("header",{className:"flex items-center justify-between h-14 px-4 xl:px-6 bg-white rounded-2xl border border-gray-100",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[e!=null&&n.jsx("button",{"aria-label":i(t?{id:"vcpc5o"}:{id:"GSr0rF"}),className:"xl:hidden p-2 rounded-lg text-gray-500 hover:text-gray-700 hover:bg-gray-100 transition-colors cursor-pointer *:size-5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-300 focus-visible:ring-offset-2",type:"button",onClick:e,children:t?n.jsx(ut,{}):n.jsx(lt,{})}),n.jsx(Z,{to:"/scenarios",className:"text-lg font-bold text-gray-900 hover:text-indigo-600 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-300 focus-visible:ring-offset-2 rounded",children:"Spec Snake Beta"})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(ft,{currentLocale:a}),s!=null&&n.jsx("button",{"aria-label":i({id:"fsyAH8"}),className:"lg:hidden p-2 rounded-lg text-gray-500 hover:text-gray-700 hover:bg-gray-100 transition-colors cursor-pointer *:size-5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-300 focus-visible:ring-offset-2",type:"button",onClick:s,children:n.jsx(ct,{})})]})]})};export{ut as C,ct as E,yt as H,vt as n,tt as s,bt as u};
@@ -0,0 +1 @@
1
+ import{j as o}from"./index-D6usLrOW.js";const e=r=>o.jsx("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r,children:o.jsx("path",{d:"M8 3V13M3 8H13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});export{e as P};
@@ -0,0 +1 @@
1
+ @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-amber-500:oklch(76.9% .188 70.08);--color-green-500:oklch(72.3% .219 149.579);--color-indigo-50:oklch(96.2% .018 272.314);--color-indigo-100:oklch(93% .034 272.788);--color-indigo-200:oklch(87% .065 274.039);--color-indigo-300:oklch(78.5% .115 274.713);--color-indigo-500:oklch(58.5% .233 277.117);--color-indigo-600:oklch(51.1% .262 276.966);--color-indigo-700:oklch(45.7% .24 277.023);--color-indigo-900:oklch(35.9% .144 278.697);--color-purple-50:oklch(97.7% .014 308.299);--color-purple-100:oklch(94.6% .033 307.174);--color-purple-200:oklch(90.2% .063 306.703);--color-purple-600:oklch(55.8% .288 302.321);--color-pink-50:oklch(97.1% .014 343.198);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-4xl:56rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing)*0)}.top-0{top:calc(var(--spacing)*0)}.top-6{top:calc(var(--spacing)*6)}.top-8{top:calc(var(--spacing)*8)}.right-0{right:calc(var(--spacing)*0)}.bottom-0{bottom:calc(var(--spacing)*0)}.left-0{left:calc(var(--spacing)*0)}.left-1\/2{left:50%}.z-10{z-index:10}.z-20{z-index:20}.z-40{z-index:40}.z-50{z-index:50}.col-span-1{grid-column:span 1/span 1}.row-span-2{grid-row:span 2/span 2}.mx-6{margin-inline:calc(var(--spacing)*6)}.mx-auto{margin-inline:auto}.prose{color:var(--tw-prose-body);max-width:65ch}.prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-lead);margin-top:1.2em;margin-bottom:1.2em;font-size:1.25em;line-height:1.6}.prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-links);font-weight:500;text-decoration:underline}.prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.prose :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em;list-style-type:decimal}.prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=A s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type=I s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type="1"]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em;list-style-type:disc}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-counters);font-weight:400}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}.prose :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);margin-top:1.25em;font-weight:600}.prose :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-quotes);border-inline-start-width:.25rem;border-inline-start-color:var(--tw-prose-quote-borders);quotes:"“""”""‘""’";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em;font-style:italic;font-weight:500}.prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:open-quote}.prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:close-quote}.prose :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);margin-top:0;margin-bottom:.888889em;font-size:2.25em;font-weight:800;line-height:1.11111}.prose :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-weight:900}.prose :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);margin-top:2em;margin-bottom:1em;font-size:1.5em;font-weight:700;line-height:1.33333}.prose :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-weight:800}.prose :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);margin-top:1.6em;margin-bottom:.6em;font-size:1.25em;font-weight:600;line-height:1.6}.prose :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-weight:700}.prose :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);margin-top:1.5em;margin-bottom:.5em;font-weight:600;line-height:1.5}.prose :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-weight:700}.prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em;display:block}.prose :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-kbd);box-shadow:0 0 0 1px var(--tw-prose-kbd-shadows),0 3px 0 var(--tw-prose-kbd-shadows);padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;border-radius:.3125rem;padding-inline-start:.375em;font-family:inherit;font-size:.875em;font-weight:500}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-code);font-size:.875em;font-weight:600}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before,.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:"`"}.prose :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.875em}.prose :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.9em}.prose :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);padding-top:.857143em;padding-inline-end:1.14286em;padding-bottom:.857143em;border-radius:.375rem;margin-top:1.71429em;margin-bottom:1.71429em;padding-inline-start:1.14286em;font-size:.875em;font-weight:400;line-height:1.71429;overflow-x:auto}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit;background-color:#0000;border-width:0;border-radius:0;padding:0}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):before,.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}.prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){table-layout:auto;width:100%;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.71429}.prose :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);vertical-align:bottom;padding-inline-end:.571429em;padding-bottom:.571429em;padding-inline-start:.571429em;font-weight:600}.prose :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.prose :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:baseline}.prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.prose :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:top}.prose :where(th,td):not(:where([class~=not-prose],[class~=not-prose] *)){text-align:start}.prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-captions);margin-top:.857143em;font-size:.875em;line-height:1.42857}.prose{--tw-prose-body:oklch(37.3% .034 259.733);--tw-prose-headings:oklch(21% .034 264.665);--tw-prose-lead:oklch(44.6% .03 256.802);--tw-prose-links:oklch(21% .034 264.665);--tw-prose-bold:oklch(21% .034 264.665);--tw-prose-counters:oklch(55.1% .027 264.364);--tw-prose-bullets:oklch(87.2% .01 258.338);--tw-prose-hr:oklch(92.8% .006 264.531);--tw-prose-quotes:oklch(21% .034 264.665);--tw-prose-quote-borders:oklch(92.8% .006 264.531);--tw-prose-captions:oklch(55.1% .027 264.364);--tw-prose-kbd:oklch(21% .034 264.665);--tw-prose-kbd-shadows:oklab(21% -.00316127 -.0338527/.1);--tw-prose-code:oklch(21% .034 264.665);--tw-prose-pre-code:oklch(92.8% .006 264.531);--tw-prose-pre-bg:oklch(27.8% .033 256.848);--tw-prose-th-borders:oklch(87.2% .01 258.338);--tw-prose-td-borders:oklch(92.8% .006 264.531);--tw-prose-invert-body:oklch(87.2% .01 258.338);--tw-prose-invert-headings:#fff;--tw-prose-invert-lead:oklch(70.7% .022 261.325);--tw-prose-invert-links:#fff;--tw-prose-invert-bold:#fff;--tw-prose-invert-counters:oklch(70.7% .022 261.325);--tw-prose-invert-bullets:oklch(44.6% .03 256.802);--tw-prose-invert-hr:oklch(37.3% .034 259.733);--tw-prose-invert-quotes:oklch(96.7% .003 264.542);--tw-prose-invert-quote-borders:oklch(37.3% .034 259.733);--tw-prose-invert-captions:oklch(70.7% .022 261.325);--tw-prose-invert-kbd:#fff;--tw-prose-invert-kbd-shadows:#ffffff1a;--tw-prose-invert-code:#fff;--tw-prose-invert-pre-code:oklch(87.2% .01 258.338);--tw-prose-invert-pre-bg:#00000080;--tw-prose-invert-th-borders:oklch(44.6% .03 256.802);--tw-prose-invert-td-borders:oklch(37.3% .034 259.733);font-size:1rem;line-height:1.75}.prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(.prose>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(.prose>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(.prose>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-inline-start:1.625em}.prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.571429em;padding-inline-end:.571429em;padding-bottom:.571429em;padding-inline-start:.571429em}.prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(.prose>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(.prose>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.prose-sm{font-size:.875rem;line-height:1.71429}.prose-sm :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.14286em;margin-bottom:1.14286em}.prose-sm :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.888889em;margin-bottom:.888889em;font-size:1.28571em;line-height:1.55556}.prose-sm :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.33333em;margin-bottom:1.33333em;padding-inline-start:1.11111em}.prose-sm :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:.8em;font-size:2.14286em;line-height:1.2}.prose-sm :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.6em;margin-bottom:.8em;font-size:1.42857em;line-height:1.4}.prose-sm :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.55556em;margin-bottom:.444444em;font-size:1.28571em;line-height:1.55556}.prose-sm :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.42857em;margin-bottom:.571429em;line-height:1.42857}.prose-sm :where(img):not(:where([class~=not-prose],[class~=not-prose] *)),.prose-sm :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.71429em;margin-bottom:1.71429em}.prose-sm :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.71429em;margin-bottom:1.71429em}.prose-sm :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.142857em;padding-inline-end:.357143em;padding-bottom:.142857em;border-radius:.3125rem;padding-inline-start:.357143em;font-size:.857143em}.prose-sm :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.857143em}.prose-sm :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.9em}.prose-sm :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.888889em}.prose-sm :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.666667em;padding-inline-end:1em;padding-bottom:.666667em;border-radius:.25rem;margin-top:1.66667em;margin-bottom:1.66667em;padding-inline-start:1em;font-size:.857143em;line-height:1.66667}.prose-sm :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)),.prose-sm :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.14286em;margin-bottom:1.14286em;padding-inline-start:1.57143em}.prose-sm :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.285714em;margin-bottom:.285714em}.prose-sm :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)),.prose-sm :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.428571em}.prose-sm :where(.prose-sm>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.571429em;margin-bottom:.571429em}.prose-sm :where(.prose-sm>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.14286em}.prose-sm :where(.prose-sm>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.14286em}.prose-sm :where(.prose-sm>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.14286em}.prose-sm :where(.prose-sm>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.14286em}.prose-sm :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.571429em;margin-bottom:.571429em}.prose-sm :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.14286em;margin-bottom:1.14286em}.prose-sm :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.14286em}.prose-sm :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.285714em;padding-inline-start:1.57143em}.prose-sm :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2.85714em;margin-bottom:2.85714em}.prose-sm :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)),.prose-sm :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)),.prose-sm :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)),.prose-sm :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.857143em;line-height:1.5}.prose-sm :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:1em;padding-bottom:.666667em;padding-inline-start:1em}.prose-sm :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.666667em;padding-inline-end:1em;padding-bottom:.666667em;padding-inline-start:1em}.prose-sm :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.71429em;margin-bottom:1.71429em}.prose-sm :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.666667em;font-size:.857143em;line-height:1.33333}.prose-sm :where(.prose-sm>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(.prose-sm>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-1\.5{margin-top:calc(var(--spacing)*1.5)}.mt-4{margin-top:calc(var(--spacing)*4)}.mr-2{margin-right:calc(var(--spacing)*2)}.mb-1\.5{margin-bottom:calc(var(--spacing)*1.5)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.ml-0\.5{margin-left:calc(var(--spacing)*.5)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-auto{margin-left:auto}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-flex{display:inline-flex}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-5{width:calc(var(--spacing)*5);height:calc(var(--spacing)*5)}.size-6{width:calc(var(--spacing)*6);height:calc(var(--spacing)*6)}.size-8{width:calc(var(--spacing)*8);height:calc(var(--spacing)*8)}.size-12{width:calc(var(--spacing)*12);height:calc(var(--spacing)*12)}.h-8{height:calc(var(--spacing)*8)}.h-10{height:calc(var(--spacing)*10)}.h-14{height:calc(var(--spacing)*14)}.h-\[calc\(100vh-64px\)\]{height:calc(100vh - 64px)}.h-\[calc\(100vh-64px-56px-24px\)\]{height:calc(100vh - 144px)}.h-full{height:100%}.max-h-60{max-height:calc(var(--spacing)*60)}.min-h-\[80px\]{min-height:80px}.min-h-screen{min-height:100vh}.w-8{width:calc(var(--spacing)*8)}.w-10{width:calc(var(--spacing)*10)}.w-80{width:calc(var(--spacing)*80)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-4xl{max-width:var(--container-4xl)}.max-w-full{max-width:100%}.max-w-none{max-width:none}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\[var\(--anchor-width\)\]{min-width:var(--anchor-width)}.flex-1{flex:1}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.-rotate-90{rotate:-90deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.resize-y{resize:vertical}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-rows-\[auto_1fr\]{grid-template-rows:auto 1fr}.flex-col{flex-direction:column}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-6{gap:calc(var(--spacing)*6)}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*8)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*8)*calc(1 - var(--tw-space-y-reverse)))}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-3{border-style:var(--tw-border-style);border-width:3px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-gray-100{border-color:var(--color-gray-100)}.border-gray-200{border-color:var(--color-gray-200)}.border-indigo-200{border-color:var(--color-indigo-200)}.border-indigo-300{border-color:var(--color-indigo-300)}.border-red-500{border-color:var(--color-red-500)}.border-transparent{border-color:#0000}.border-t-indigo-500{border-top-color:var(--color-indigo-500)}.bg-amber-500{background-color:var(--color-amber-500)}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-green-500{background-color:var(--color-green-500)}.bg-indigo-50{background-color:var(--color-indigo-50)}.bg-indigo-100{background-color:var(--color-indigo-100)}.bg-indigo-200{background-color:var(--color-indigo-200)}.bg-indigo-500{background-color:var(--color-indigo-500)}.bg-purple-100{background-color:var(--color-purple-100)}.bg-white{background-color:var(--color-white)}.bg-white\/80{background-color:#fffc}@supports (color:color-mix(in lab,red,red)){.bg-white\/80{background-color:color-mix(in oklab,var(--color-white)80%,transparent)}}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-indigo-50{--tw-gradient-from:var(--color-indigo-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.via-purple-50{--tw-gradient-via:var(--color-purple-50);--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.to-pink-50{--tw-gradient-to:var(--color-pink-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.p-0{padding:calc(var(--spacing)*0)}.p-1{padding:calc(var(--spacing)*1)}.p-2{padding:calc(var(--spacing)*2)}.p-2\.5{padding:calc(var(--spacing)*2.5)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.pt-6{padding-top:calc(var(--spacing)*6)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.pb-6{padding-bottom:calc(var(--spacing)*6)}.text-center{text-align:center}.font-mono{font-family:var(--font-mono)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.text-gray-200{color:var(--color-gray-200)}.text-gray-300{color:var(--color-gray-300)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-gray-900{color:var(--color-gray-900)}.text-green-500{color:var(--color-green-500)}.text-indigo-500{color:var(--color-indigo-500)}.text-indigo-600{color:var(--color-indigo-600)}.text-indigo-700{color:var(--color-indigo-700)}.text-indigo-900{color:var(--color-indigo-900)}.text-purple-600{color:var(--color-purple-600)}.text-red-500{color:var(--color-red-500)}.text-red-600{color:var(--color-red-600)}.text-white{color:var(--color-white)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-300{--tw-duration:.3s;transition-duration:.3s}.prose-gray{--tw-prose-body:oklch(37.3% .034 259.733);--tw-prose-headings:oklch(21% .034 264.665);--tw-prose-lead:oklch(44.6% .03 256.802);--tw-prose-links:oklch(21% .034 264.665);--tw-prose-bold:oklch(21% .034 264.665);--tw-prose-counters:oklch(55.1% .027 264.364);--tw-prose-bullets:oklch(87.2% .01 258.338);--tw-prose-hr:oklch(92.8% .006 264.531);--tw-prose-quotes:oklch(21% .034 264.665);--tw-prose-quote-borders:oklch(92.8% .006 264.531);--tw-prose-captions:oklch(55.1% .027 264.364);--tw-prose-kbd:oklch(21% .034 264.665);--tw-prose-kbd-shadows:oklab(21% -.00316127 -.0338527/.1);--tw-prose-code:oklch(21% .034 264.665);--tw-prose-pre-code:oklch(92.8% .006 264.531);--tw-prose-pre-bg:oklch(27.8% .033 256.848);--tw-prose-th-borders:oklch(87.2% .01 258.338);--tw-prose-td-borders:oklch(92.8% .006 264.531);--tw-prose-invert-body:oklch(87.2% .01 258.338);--tw-prose-invert-headings:#fff;--tw-prose-invert-lead:oklch(70.7% .022 261.325);--tw-prose-invert-links:#fff;--tw-prose-invert-bold:#fff;--tw-prose-invert-counters:oklch(70.7% .022 261.325);--tw-prose-invert-bullets:oklch(44.6% .03 256.802);--tw-prose-invert-hr:oklch(37.3% .034 259.733);--tw-prose-invert-quotes:oklch(96.7% .003 264.542);--tw-prose-invert-quote-borders:oklch(37.3% .034 259.733);--tw-prose-invert-captions:oklch(70.7% .022 261.325);--tw-prose-invert-kbd:#fff;--tw-prose-invert-kbd-shadows:#ffffff1a;--tw-prose-invert-code:#fff;--tw-prose-invert-pre-code:oklch(87.2% .01 258.338);--tw-prose-invert-pre-bg:#00000080;--tw-prose-invert-th-borders:oklch(44.6% .03 256.802);--tw-prose-invert-td-borders:oklch(37.3% .034 259.733)}.outline-none{--tw-outline-style:none;outline-style:none}:is(.\*\:size-5>*){width:calc(var(--spacing)*5);height:calc(var(--spacing)*5)}:is(.\*\:size-6>*){width:calc(var(--spacing)*6);height:calc(var(--spacing)*6)}@media(hover:hover){.group-hover\:bg-gray-200:is(:where(.group):hover *){background-color:var(--color-gray-200)}.group-hover\:bg-indigo-200:is(:where(.group):hover *){background-color:var(--color-indigo-200)}.group-hover\:bg-indigo-300:is(:where(.group):hover *){background-color:var(--color-indigo-300)}.group-hover\:bg-purple-200:is(:where(.group):hover *){background-color:var(--color-purple-200)}.group-hover\:text-indigo-600:is(:where(.group):hover *){color:var(--color-indigo-600)}.group-hover\:text-purple-600:is(:where(.group):hover *){color:var(--color-purple-600)}}.placeholder\:text-gray-400::placeholder{color:var(--color-gray-400)}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.last\:pb-0:last-child{padding-bottom:calc(var(--spacing)*0)}@media(hover:hover){.hover\:border-indigo-200:hover{border-color:var(--color-indigo-200)}.hover\:border-purple-200:hover{border-color:var(--color-purple-200)}.hover\:bg-gray-50:hover{background-color:var(--color-gray-50)}.hover\:bg-gray-100:hover{background-color:var(--color-gray-100)}.hover\:bg-gray-200:hover{background-color:var(--color-gray-200)}.hover\:bg-indigo-100:hover{background-color:var(--color-indigo-100)}.hover\:bg-indigo-600:hover{background-color:var(--color-indigo-600)}.hover\:text-gray-600:hover{color:var(--color-gray-600)}.hover\:text-gray-700:hover{color:var(--color-gray-700)}.hover\:text-indigo-600:hover{color:var(--color-indigo-600)}}.focus\:border-indigo-300:focus{border-color:var(--color-indigo-300)}.focus\:border-red-500:focus{border-color:var(--color-red-500)}.focus\:border-transparent:focus{border-color:#0000}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-indigo-300:focus{--tw-ring-color:var(--color-indigo-300)}.focus\:ring-red-500\/20:focus{--tw-ring-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.focus\:ring-red-500\/20:focus{--tw-ring-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-indigo-300:focus-visible{--tw-ring-color:var(--color-indigo-300)}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.active\:bg-gray-200:active{background-color:var(--color-gray-200)}.active\:bg-gray-300:active{background-color:var(--color-gray-300)}.active\:bg-indigo-700:active{background-color:var(--color-indigo-700)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:text-gray-500:disabled{color:var(--color-gray-500)}.disabled\:opacity-50:disabled{opacity:.5}.data-\[checked\]\:border-indigo-500[data-checked]{border-color:var(--color-indigo-500)}.data-\[checked\]\:bg-indigo-500[data-checked]{background-color:var(--color-indigo-500)}.data-\[highlighted\]\:bg-gray-100[data-highlighted]{background-color:var(--color-gray-100)}.data-\[highlighted\]\:bg-indigo-50[data-highlighted]{background-color:var(--color-indigo-50)}.data-\[highlighted\]\:text-indigo-900[data-highlighted]{color:var(--color-indigo-900)}.data-\[invalid\]\:border-red-500[data-invalid],.data-\[invalid\]\:focus\:border-red-500[data-invalid]:focus{border-color:var(--color-red-500)}.data-\[invalid\]\:focus\:ring-red-500\/20[data-invalid]:focus{--tw-ring-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.data-\[invalid\]\:focus\:ring-red-500\/20[data-invalid]:focus{--tw-ring-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.data-\[selected\]\:bg-indigo-50[data-selected]{background-color:var(--color-indigo-50)}.data-\[selected\]\:font-medium[data-selected]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.data-\[selected\]\:text-indigo-500[data-selected]{color:var(--color-indigo-500)}@media(min-width:48rem){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(min-width:64rem){.lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:grid-cols-\[1fr_1fr\]{grid-template-columns:1fr 1fr}}@media(min-width:80rem){.xl\:col-span-2{grid-column:span 2/span 2}.xl\:flex{display:flex}.xl\:hidden{display:none}.xl\:grid-cols-\[auto_1fr_1fr\]{grid-template-columns:auto 1fr 1fr}.xl\:px-6{padding-inline:calc(var(--spacing)*6)}}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-duration{syntax:"*";inherits:false}
@@ -0,0 +1 @@
1
+ import{u as $,c as q,q as U,d as W,e as E,a as Y,r as s,j as o}from"./index-D6usLrOW.js";import{u as Z,H as ee}from"./Header-DN39nNWE.js";import{u as se,a as te,b as oe,c as ne,d as ae,g as ie,M as re,P as ce,S as le,e as ue,f as de,A as pe,h as me,i as ge}from"./useStepFormStore-CBcs2c-9.js";import"./PlusIcon-DqYOBije.js";const Se=async t=>{if(!(await fetch(`/api/scenarios/${t.scenarioId}/docs`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:t.content,formData:t.formData})})).ok)throw new Error("Failed to submit");await U.invalidateQueries({queryKey:W(t.scenarioId).queryKey})},fe=()=>{const{_:t}=$(),r=q(c=>c.showSnackbar);return se({mutationFn:Se,onSuccess:()=>{r(t({id:"d61rJy"}),"success")},onError:()=>{r(t({id:"Vw8l6h"}),"error")}})},ve=()=>{const{_:t}=$(),{stepIndex:r,prevStep:c,step:n,nextStep:f}=E.useLoaderData(),{scenarioId:a}=E.useParams(),{data:F}=Z(Y(a)),{scenario:v,permissions:C}=F,{steps:l}=v,{formValues:u,setFormError:x}=te(),{previewContent:d,setPreviewContent:h}=oe(),{navStatuses:k,updateNavStatus:i}=ne(),p=fe(),m=ae(),{showSnackbar:S}=q(),[Q,P]=s.useState(!1),[y,j]=s.useState(!1),[H,R]=s.useState(!1),[M,V]=s.useState("preview"),w=s.useCallback(()=>{if(!p.isPending){if(d==null){S(t({id:"afF891"}),"error");return}p.mutate({scenarioId:a,content:d,formData:u})}},[p,d,a,u,S,t]),D=s.useCallback(()=>{if(m.isPending)return;let e=!1;for(const g of l){const b=g.section.name,B=u[b],_=ie(g.section,B)==="error";x(b,_),i(b),_&&(e=!0)}if(e){S(t({id:"T6PvRl"}),"error");return}m.mutate({scenarioId:a,formData:u})},[m,l,u,a,x,i,S,t]),N=s.useCallback(()=>{V(e=>e==="edit"?"preview":"edit")},[]),O=s.useCallback(e=>{h(e.target.value)},[h]),G=s.useCallback(()=>{P(!0)},[]),J=s.useCallback(()=>{P(!1)},[]),K=s.useCallback(()=>{j(e=>!e)},[]),L=s.useCallback(()=>{j(!1)},[]),z=s.useCallback(()=>{R(e=>!e)},[]),I=s.useMemo(()=>l.map((e,g)=>({to:`/scenarios/${a}/docs/new?step=${e.slug}`,title:e.title,description:e.description,step:g+1,sectionName:e.section.name,status:k[e.section.name]??"default",selected:g===r})),[l,a,k,r]),T=s.useCallback(()=>{i(n.section.name),requestAnimationFrame(()=>{document.querySelector('[role="tab"][aria-selected="true"]')?.focus()})},[n.section.name,i]),X=s.useMemo(()=>c!=null?{to:`/scenarios/${a}/docs/new?step=${c.slug}`,label:t({id:"iH8pgl"}),onClick:()=>i(n.section.name)}:void 0,[c,a,n.section.name,i,t]),A=s.useMemo(()=>f!=null?{to:`/scenarios/${a}/docs/new?step=${f.slug}`,label:t({id:"hXzOVo"}),onClick:()=>i(n.section.name)}:void 0,[f,a,n.section.name,i,t]);return o.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[1fr_1fr] xl:grid-cols-[auto_1fr_1fr] grid-rows-[auto_1fr] gap-6 min-h-screen bg-gradient-to-br from-indigo-50 via-purple-50 to-pink-50 p-8",children:[o.jsx(re,{scenarioName:v.name,isOpen:y,items:I,onClose:L,onItemClick:T}),o.jsx("div",{className:"col-span-1 xl:col-span-2",children:o.jsx(ee,{isMenuOpen:y,onOpenPreview:G,onToggleMenu:K})}),o.jsx("aside",{className:"hidden lg:flex row-span-2 min-w-0 bg-white rounded-2xl border border-gray-100 flex-col overflow-hidden sticky top-8 h-[calc(100vh-64px)] self-start",children:o.jsx(ce,{allowSave:C.allowSave,isGenerating:m.isPending,isSubmitting:p.isPending,previewContent:d,previewMode:M,onContentChange:O,onCreate:w,onPreview:D,onToggleMode:N})}),o.jsx(le,{scenarioName:v.name,isCollapsed:H,items:I,onItemClick:T,onToggleCollapse:z}),o.jsxs("main",{className:"flex flex-col gap-6 min-w-0",children:[o.jsx("div",{className:"xl:hidden",children:o.jsx(ue,{current:r+1,description:n.description,title:n.title,total:l.length})}),n.section.type==="single"?o.jsx(de,{step:n},n.slug):o.jsx(pe,{step:n},n.slug),o.jsx(me,{prev:X,next:A,onSubmit:A==null?w:void 0})]}),o.jsx(ge,{allowSave:C.allowSave,isGenerating:m.isPending,isOpen:Q,isSubmitting:p.isPending,previewContent:d,previewMode:M,onClose:J,onContentChange:O,onCreate:w,onPreview:D,onToggleMode:N})]})},he=ve;export{he as component};