@servicetitan/json-render-react 0.3.0 → 0.3.1

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.
@@ -2295,4 +2295,4 @@ var pi = ({ spec: e, sections: t, loading: n = !1, registry: r, handlers: i, act
2295
2295
  //#endregion
2296
2296
  export { ai as ContextSpecRenderer, pi as SectionedContextRenderer, $ as SpecRenderer, wr as catalog, H as composeCatalogComponents, or as contextCatalog, rr as createScopedCatalog, Qr as executeAction, ci as extractSectionSpec, yr as formatContextRenderReport, K as formatContextSpecIssues, $r as getContextRegistry, Z as getRegistry, Zr as handlers, vr as hasContextSpecErrors, ir as mergeCatalogs, _r as postProcessContextSpec, Xr as registry, G as validateContextSpec, gr as validateContextSpecDeep };
2297
2297
 
2298
- //# sourceMappingURL=json-render-react.js.map
2298
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../node_modules/.pnpm/@vanilla-extract+recipes@0.5.7_@vanilla-extract+css@1.20.1/node_modules/@vanilla-extract/recipes/dist/createRuntimeFn-62c9670f.esm.js","../src/context/components/collapsible-card.css.ts","../src/context/components/context-chip-tone.ts","../src/context/components/collapsible-card.tsx","../src/context/catalog/context-card.catalog.ts","../src/context/catalog/context-card.tsx","../src/context/catalog/context-data-table.catalog.ts","../src/context/catalog/context-data-table.css.ts","../src/context/catalog/context-data-table.tsx","../src/context/catalog/context-file-list.catalog.ts","../src/context/catalog/context-file-list.css.ts","../src/context/catalog/context-file-list.tsx","../src/context/catalog/context-list.catalog.ts","../src/context/catalog/context-list.css.ts","../src/context/catalog/context-list.tsx","../src/context/catalog/context-metric-grid.catalog.ts","../src/context/catalog/context-metric-grid.css.ts","../src/context/catalog/context-metric-grid.tsx","../src/context/components/context-ai-summary.css.ts","../src/context/components/context-ai-summary.tsx","../src/context/components/context-note-list.css.ts","../src/context/catalog/context-note-list.catalog.ts","../src/context/catalog/context-note-list.tsx","../src/context/catalog/context-overview.catalog.ts","../src/context/catalog/context-overview.css.ts","../src/context/catalog/context-overview.tsx","../src/context/catalog/context-panel.catalog.ts","../src/context/catalog/context-panel.css.ts","../src/context/catalog/context-panel.tsx","../src/context/catalog/context-tabular-list.catalog.ts","../src/context/catalog/context-tabular-list.css.ts","../src/context/catalog/context-tabular-list.tsx","../src/context/catalog/schemas.ts","../src/core/actions.ts","../src/core/catalog/alert.catalog.ts","../src/core/catalog/bar-chart.catalog.ts","../src/core/catalog/button.catalog.ts","../src/core/catalog/card.catalog.ts","../src/core/catalog/checkbox.catalog.ts","../src/core/catalog/chip.catalog.ts","../src/core/catalog/divider.catalog.ts","../src/core/catalog/donut-chart.catalog.ts","../src/core/catalog/flex.catalog.ts","../src/core/catalog/grid.catalog.ts","../src/core/catalog/icon.catalog.ts","../src/core/catalog/input.catalog.ts","../src/core/catalog/line-chart.catalog.ts","../src/core/catalog/link.catalog.ts","../src/core/catalog/listbox.catalog.ts","../src/core/catalog/progress-bar.catalog.ts","../src/core/catalog/radio-group.catalog.ts","../src/core/catalog/switch.catalog.ts","../src/core/catalog/text.catalog.ts","../src/core/catalog/textarea.catalog.ts","../src/core/catalog/schemas.ts","../src/scoped-catalog.ts","../src/context/catalog/catalog-def.ts","../src/context/catalog/index.ts","../src/context/constants.ts","../src/context/validate-context-spec.ts","../src/context/validate-context-spec-deep.ts","../src/core/catalog/alert.tsx","../src/core/catalog/chart.css.ts","../src/core/catalog/chart-utils.ts","../src/core/catalog/bar-chart.tsx","../src/utils/defined-props.ts","../src/core/catalog/button.tsx","../src/core/catalog/card.tsx","../src/core/catalog/catalog-def.ts","../src/core/catalog/checkbox.tsx","../src/core/catalog/chip.tsx","../src/core/catalog/divider.tsx","../src/core/catalog/donut-chart.tsx","../src/core/catalog/flex.tsx","../../../tooling/tools/src/cx.ts","../src/core/catalog/grid.css.ts","../src/core/catalog/grid.tsx","../src/core/catalog/icon.tsx","../src/core/catalog/input.tsx","../src/core/catalog/line-chart.tsx","../src/core/catalog/link.tsx","../src/core/catalog/listbox.css.ts","../src/core/catalog/listbox.tsx","../src/core/catalog/progress-bar.tsx","../src/core/catalog/radio-group.tsx","../src/core/catalog/switch.tsx","../src/core/catalog/text.tsx","../src/core/catalog/textarea.tsx","../src/core/catalog/index.ts","../src/marketing/catalog/components/revenue-card.catalog.ts","../src/marketing/catalog/components/revenue-card.css.ts","../src/marketing/catalog/components/revenue-card.tsx","../src/marketing/catalog/index.ts","../src/registry-utils.ts","../src/registry.ts","../src/renderers/internal/enrichments/button-actions.ts","../src/renderers/internal/enrichments/useEnrichedSpec.ts","../src/renderers/spec-renderer.tsx","../src/context/components/context-render-error-boundary.tsx","../src/renderers/wrap-context-registry.tsx","../src/renderers/context-spec-renderer.tsx","../src/renderers/sectioned-context-renderer.css.ts","../src/renderers/sectioned-context-renderer.tsx"],"sourcesContent":["function toPrimitive(t, r) {\n if (\"object\" != typeof t || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != typeof i) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\n\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == typeof i ? i : String(i);\n}\n\nfunction _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\n\nfunction ownKeys(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function (r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nfunction _objectSpread2(e) {\n for (var r = 1; r < arguments.length; r++) {\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {\n _defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}\n\nfunction mapValues(input, fn) {\n var result = {};\n for (var _key in input) {\n result[_key] = fn(input[_key], _key);\n }\n return result;\n}\n\nvar shouldApplyCompound = (compoundCheck, selections, defaultVariants) => {\n for (var key of Object.keys(compoundCheck)) {\n var _selections$key;\n if (compoundCheck[key] !== ((_selections$key = selections[key]) !== null && _selections$key !== void 0 ? _selections$key : defaultVariants[key])) {\n return false;\n }\n }\n return true;\n};\nvar createRuntimeFn = config => {\n var runtimeFn = options => {\n var className = config.defaultClassName;\n var selections = _objectSpread2(_objectSpread2({}, config.defaultVariants), options);\n for (var variantName in selections) {\n var _selections$variantNa;\n var variantSelection = (_selections$variantNa = selections[variantName]) !== null && _selections$variantNa !== void 0 ? _selections$variantNa : config.defaultVariants[variantName];\n if (variantSelection != null) {\n var selection = variantSelection;\n if (typeof selection === 'boolean') {\n // @ts-expect-error\n selection = selection === true ? 'true' : 'false';\n }\n var selectionClassName =\n // @ts-expect-error\n config.variantClassNames[variantName][selection];\n if (selectionClassName) {\n className += ' ' + selectionClassName;\n }\n }\n }\n for (var [compoundCheck, compoundClassName] of config.compoundVariants) {\n if (shouldApplyCompound(compoundCheck, selections, config.defaultVariants)) {\n className += ' ' + compoundClassName;\n }\n }\n return className;\n };\n runtimeFn.variants = () => Object.keys(config.variantClassNames);\n runtimeFn.classNames = {\n get base() {\n return config.defaultClassName.split(' ')[0];\n },\n get variants() {\n return mapValues(config.variantClassNames, classNames => mapValues(classNames, className => className.split(' ')[0]));\n }\n };\n return runtimeFn;\n};\n\nexport { createRuntimeFn as c, mapValues as m };\n","import { primitive, semantic } from \"@servicetitan/carto-react-kit/tokens\";\nimport { style } from \"@vanilla-extract/css\";\nimport { recipe } from \"@vanilla-extract/recipes\";\n\nconst expandMotion = `${semantic.motion.duration.transition} ${semantic.motion.easing.transition}`;\n\nconst reducedMotion = {\n \"@media\": {\n \"(prefers-reduced-motion: reduce)\": {\n transition: \"none\",\n },\n },\n} as const;\n\n/** Room inside the collapse clip for the highlighted Card's ~5px blurred halo. */\nconst panelGlowBleed = primitive.size[\"400\"];\n\nexport const fullWidth = style({\n width: \"100%\",\n});\n\nexport const cardBody = style({\n display: \"flex\",\n flexDirection: \"column\",\n gap: primitive.size[\"400\"],\n overflow: \"visible\",\n});\n\nexport const collapsibleCard = style({\n display: \"flex\",\n flexDirection: \"column\",\n width: \"100%\",\n});\n\nexport const collapsiblePanel = recipe({\n base: {\n display: \"grid\",\n overflow: \"visible\",\n transition: `grid-template-rows ${expandMotion}, margin-top ${expandMotion}, opacity ${expandMotion}`,\n ...reducedMotion,\n },\n variants: {\n expanded: {\n true: {\n gridTemplateRows: \"1fr\",\n marginTop: primitive.size[\"400\"],\n opacity: 1,\n },\n false: {\n gridTemplateRows: \"0fr\",\n marginTop: 0,\n opacity: 0,\n },\n },\n },\n defaultVariants: {\n expanded: false,\n },\n});\n\nexport const collapsiblePanelInner = recipe({\n base: {\n overflow: \"hidden\",\n minHeight: 0,\n transition: `padding ${expandMotion}, margin ${expandMotion}`,\n ...reducedMotion,\n },\n variants: {\n expanded: {\n true: {\n // Padding keeps the highlighted Card halo inside the clip; negative margin\n // cancels the inset so body content stays aligned with the card header.\n padding: panelGlowBleed,\n margin: `calc(-1 * ${panelGlowBleed})`,\n },\n false: {\n padding: 0,\n margin: 0,\n },\n },\n },\n defaultVariants: {\n expanded: false,\n },\n});\n\nexport const collapsibleCardSummary = style({\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n gap: primitive.size[\"200\"],\n width: \"100%\",\n margin: 0,\n padding: 0,\n border: \"none\",\n background: \"none\",\n cursor: \"pointer\",\n color: \"inherit\",\n font: \"inherit\",\n textAlign: \"left\",\n});\n\n/** Title + badge group — sits at the start; grows to fill available space before the chevron. */\nexport const collapsibleCardLeft = style({\n display: \"flex\",\n alignItems: \"center\",\n gap: primitive.size[\"200\"],\n flex: 1,\n minWidth: 0,\n});\n\nexport const collapsibleCardTitle = style({\n display: \"inline-flex\",\n alignItems: \"center\",\n flexShrink: 0,\n minWidth: 0,\n});\n\nexport const collapsibleChevron = recipe({\n base: {\n flexShrink: 0,\n transition: `transform ${expandMotion}`,\n transformOrigin: \"center\",\n ...reducedMotion,\n },\n variants: {\n expanded: {\n true: { transform: \"rotate(180deg)\" },\n false: {},\n },\n },\n defaultVariants: {\n expanded: false,\n },\n});\n","import { core } from \"@servicetitan/anvil2/token\";\n\n/** Semantic chip tones agents can reference — mapped to Anvil2 background tokens in the renderer. */\nexport const CONTEXT_CHIP_TONES = [\"success\", \"warning\", \"danger\", \"info\", \"neutral\"] as const;\n\nexport type ContextChipTone = (typeof CONTEXT_CHIP_TONES)[number];\n\nexport interface ContextChipCell {\n label: string;\n tone?: ContextChipTone;\n}\n\nconst toneBackground: Record<ContextChipTone, string> = {\n success: core.semantic.BackgroundColorSuccessSubdued.value,\n warning: core.semantic.BackgroundColorWarningSubdued.value,\n danger: core.semantic.BackgroundColorDangerSubdued.value,\n info: core.semantic.BackgroundColorPrimarySubdued.value,\n neutral: core.semantic.BackgroundColorSecondary.value,\n};\n\nexport function chipToneBackground(tone: ContextChipTone = \"neutral\"): string {\n return toneBackground[tone];\n}\n\n/** Foreground (text) color for a tone — used by metric-grid value text. */\nconst toneForeground: Record<ContextChipTone, string | undefined> = {\n success: core.semantic.BackgroundColorSuccess.value,\n warning: core.semantic.BackgroundColorWarning.value,\n danger: core.semantic.ForegroundColorDanger.value,\n info: core.semantic.ForegroundColorPrimary.value,\n neutral: undefined,\n};\n\nexport function toneForegroundColor(tone: ContextChipTone): string | undefined {\n return toneForeground[tone];\n}\n\nexport function parseChipCell(value: unknown): ContextChipCell | null {\n if (value == null || value === \"\") {\n return null;\n }\n\n if (typeof value === \"object\" && value !== null && \"label\" in value) {\n const cell = value as ContextChipCell;\n return {\n label: cell.label,\n tone: cell.tone ?? \"neutral\",\n };\n }\n\n if (typeof value === \"string\") {\n return { label: value, tone: \"neutral\" };\n }\n\n return { label: String(value), tone: \"neutral\" };\n}\n","import { Chip } from \"@servicetitan/anvil2\";\nimport { Card, Text } from \"@servicetitan/carto-react-kit\";\nimport { IconChevronDown } from \"@servicetitan/carto-react-kit/icons\";\nimport { type ReactNode, type TransitionEvent, useId, useState } from \"react\";\nimport {\n cardBody,\n collapsibleCard,\n collapsibleCardLeft,\n collapsibleCardSummary,\n collapsibleCardTitle,\n collapsibleChevron,\n collapsiblePanel,\n collapsiblePanelInner,\n fullWidth,\n} from \"./collapsible-card.css\";\nimport { type ContextChipTone, chipToneBackground } from \"./context-chip-tone\";\n\n/** A count-only badge (number, e.g. 3) or a labelled status badge ({ label: \"3 Variances\", tone: \"warning\" }). */\nexport type CollapsibleCardBadge = number | { label: string; tone?: ContextChipTone };\n\nexport interface CollapsibleCardProps {\n title: string;\n badge?: CollapsibleCardBadge;\n defaultExpanded?: boolean;\n children: ReactNode;\n}\n\nfunction BadgeChip({ badge }: { badge: CollapsibleCardBadge }) {\n if (typeof badge === \"number\") {\n return <Chip label={String(badge)} size=\"small\" style={{ marginTop: \"2px\" }} />;\n }\n\n return (\n <Chip\n label={badge.label}\n size=\"small\"\n color={chipToneBackground(badge.tone ?? \"neutral\")}\n style={{ marginTop: \"2px\" }}\n />\n );\n}\n\nexport const CollapsibleCard = ({\n title,\n badge,\n defaultExpanded = true,\n children,\n}: CollapsibleCardProps) => {\n const [expanded, setExpanded] = useState(defaultExpanded);\n const [contentMounted, setContentMounted] = useState(defaultExpanded);\n const panelId = useId();\n\n const toggleExpanded = () => {\n setExpanded((value) => {\n const next = !value;\n if (next) {\n setContentMounted(true);\n }\n return next;\n });\n };\n\n const handlePanelTransitionEnd = (event: TransitionEvent<HTMLDivElement>) => {\n if (event.propertyName !== \"grid-template-rows\" || expanded) {\n return;\n }\n setContentMounted(false);\n };\n\n return (\n <div className={fullWidth}>\n <Card\n padding=\"base\"\n content={\n <div className={collapsibleCard}>\n <Text\n variant=\"headline\"\n el=\"h3\"\n size=\"substantial\"\n text={\n <button\n type=\"button\"\n aria-expanded={expanded}\n aria-controls={panelId}\n onClick={toggleExpanded}\n className={collapsibleCardSummary}\n >\n <span className={collapsibleCardLeft}>\n <span className={collapsibleCardTitle}>{title}</span>\n {badge != null ? <BadgeChip badge={badge} /> : null}\n </span>\n <IconChevronDown className={collapsibleChevron({ expanded })} />\n </button>\n }\n />\n <div\n className={collapsiblePanel({ expanded })}\n onTransitionEnd={handlePanelTransitionEnd}\n >\n <div className={collapsiblePanelInner({ expanded })}>\n <div id={panelId} className={cardBody} aria-hidden={!expanded}>\n {contentMounted ? children : null}\n </div>\n </div>\n </div>\n </div>\n }\n />\n </div>\n );\n};\n","import { z } from \"zod\";\n\nimport { CONTEXT_CHIP_TONES } from \"../components/context-chip-tone\";\n\nconst badgeStatusSchema = z.object({\n label: z.string(),\n tone: z.enum(CONTEXT_CHIP_TONES).optional(),\n});\n\nconst badgeSchema = z.union([z.number().int().nonnegative(), badgeStatusSchema]);\n\nexport const contextCardCatalog = {\n props: z.object({\n title: z.string(),\n defaultExpanded: z.boolean().optional(),\n /**\n * Optional badge shown in the card header, next to the title and before the chevron.\n * Pass a number for a plain count pill (e.g. 3), or { label, tone? } for a\n * labelled status pill (e.g. { label: \"3 Variances\", tone: \"warning\" }).\n */\n badge: badgeSchema.optional(),\n }),\n slots: [\"default\"],\n description:\n \"Collapsible card for the Context panel. Each card holds a single content component as its body. Optional badge shows a count (number) or status label ({ label, tone? }) in the card header. Use defaultExpanded: false to start collapsed.\",\n};\n","import type { ReactNode } from \"react\";\nimport type { z } from \"zod\";\n\nimport { CollapsibleCard, type CollapsibleCardBadge } from \"../components/collapsible-card\";\nimport { contextCardCatalog } from \"./context-card.catalog\";\n\nexport { contextCardCatalog };\n\nexport const ContextCardRenderer = ({\n props,\n children,\n}: {\n props: z.infer<typeof contextCardCatalog.props>;\n children?: ReactNode;\n}) => (\n <CollapsibleCard\n title={props.title}\n {...(props.badge != null ? { badge: props.badge as CollapsibleCardBadge } : {})}\n defaultExpanded={props.defaultExpanded ?? true}\n >\n {children}\n </CollapsibleCard>\n);\n","import { z } from \"zod\";\n\nimport { CONTEXT_CHIP_TONES } from \"../components/context-chip-tone\";\n\nconst chipCellSchema = z.object({\n label: z.string(),\n tone: z.enum(CONTEXT_CHIP_TONES).optional(),\n});\n\nconst cellValueSchema = z.union([z.string(), z.number(), z.null(), chipCellSchema]);\n\nconst columnSchema = z.object({\n key: z.string(),\n header: z.string(),\n /**\n * Column rendering type.\n * - text: plain text (default)\n * - currency: formatted currency value\n * - chip: renders a Chip; cell value is a plain string (neutral) or { label, tone }\n * - delta: signed variance value (\"+5%\", \"-3%\", null/\"–\"). Positive → danger red,\n * negative → success green, null/empty/zero → renders \"–\" in neutral.\n */\n type: z.enum([\"text\", \"currency\", \"chip\", \"delta\"]).optional(),\n sortable: z.boolean().optional(),\n});\n\nconst rowSchema = z.record(z.string(), cellValueSchema).and(z.object({ id: z.string() }));\n\nexport const contextDataTableCatalog = {\n props: z.object({\n columns: z.array(columnSchema),\n rows: z.array(rowSchema),\n defaultSortedColumn: z\n .object({\n id: z.string(),\n desc: z.boolean().optional(),\n })\n .optional(),\n }),\n slots: [],\n description:\n \"Read-only DataTable for context cards. Column type: text (default), currency, chip, or delta. Chip cells: plain string (neutral tone) or { label, tone } where tone is success | warning | danger | info | neutral. Delta cells: signed string ('+5%', '-3%') or null — positive renders danger-red, negative renders success-green, null renders '–'. Rows must include id.\",\n};\n","import { style } from \"@vanilla-extract/css\";\n\nexport const tableScrollWrap = style({\n width: \"100%\",\n overflowX: \"auto\",\n});\n\nexport const deltaCell = style({\n fontVariantNumeric: \"tabular-nums\",\n fontWeight: 500,\n});\n","import { Chip } from \"@servicetitan/anvil2\";\nimport { createColumnHelper, DataTable } from \"@servicetitan/anvil2/beta\";\nimport { useMemo } from \"react\";\nimport type { z } from \"zod\";\nimport {\n chipToneBackground,\n parseChipCell,\n toneForegroundColor,\n} from \"../components/context-chip-tone\";\nimport { contextDataTableCatalog } from \"./context-data-table.catalog\";\nimport { deltaCell, tableScrollWrap } from \"./context-data-table.css\";\n\nexport { contextDataTableCatalog };\n\ntype RowData = Record<\n string,\n string | number | null | undefined | { label: string; tone?: string }\n> & {\n id: string;\n};\n\n/** Classify a delta string: positive, negative, or zero/empty. */\nfunction parseDelta(value: unknown): { text: string; sign: \"positive\" | \"negative\" | \"none\" } {\n if (value == null || value === \"\" || value === \"–\" || value === \"0\" || value === \"0%\") {\n return { text: \"–\", sign: \"none\" };\n }\n const str = String(value).trim();\n if (str.startsWith(\"+\") || (!str.startsWith(\"-\") && parseFloat(str) > 0)) {\n return { text: str, sign: \"positive\" };\n }\n if (str.startsWith(\"-\") || parseFloat(str) < 0) {\n return { text: str, sign: \"negative\" };\n }\n return { text: str, sign: \"none\" };\n}\n\nexport const ContextDataTableRenderer = ({\n props,\n}: {\n props: z.infer<typeof contextDataTableCatalog.props>;\n}) => {\n const columns = useMemo(() => {\n const createColumn = createColumnHelper<RowData>();\n\n return props.columns.map((column) =>\n createColumn(column.key as keyof RowData & string, {\n header: { label: column.header },\n ...(column.sortable ? { sortable: true } : {}),\n ...(column.type === \"currency\" ? { type: \"currency\" as const } : {}),\n ...(column.type === \"chip\"\n ? {\n renderCell: (value) => {\n const cell = parseChipCell(value);\n if (!cell) {\n return null;\n }\n return (\n <Chip label={cell.label} size=\"small\" color={chipToneBackground(cell.tone)} />\n );\n },\n }\n : {}),\n ...(column.type === \"delta\"\n ? {\n renderCell: (value) => {\n const { text, sign } = parseDelta(value);\n const color =\n sign === \"positive\"\n ? toneForegroundColor(\"danger\")\n : sign === \"negative\"\n ? toneForegroundColor(\"success\")\n : undefined;\n return (\n <span className={deltaCell} style={color ? { color } : undefined}>\n {text}\n </span>\n );\n },\n }\n : {}),\n }),\n );\n }, [props.columns]);\n\n const data = useMemo(() => props.rows.map((row) => ({ ...row })), [props.rows]);\n\n return (\n <div className={tableScrollWrap}>\n <DataTable\n columns={columns as Parameters<typeof DataTable>[0][\"columns\"]}\n data={data}\n isSelectable={false}\n {...(props.defaultSortedColumn\n ? {\n defaultSortedColumn: {\n id: props.defaultSortedColumn.id,\n desc: props.defaultSortedColumn.desc ?? false,\n },\n }\n : {})}\n />\n </div>\n );\n};\n","import { z } from \"zod\";\n\nconst fileItemSchema = z.object({\n /** Filename including extension (e.g. \"HVAC Inspection Checklist.pdf\"). Used to infer the file type icon. */\n label: z.string(),\n /**\n * File URL. Image files (jpg/jpeg/png/gif/webp/heic/svg) render inline in the\n * preview dialog; other types show a large file-type icon with a Download action.\n */\n url: z.string(),\n});\n\nexport const contextFileListCatalog = {\n props: z.object({\n items: z.array(fileItemSchema),\n }),\n slots: [],\n description:\n \"Vertical list of file attachments and documents. \" +\n \"Each row shows a color-coded file-type icon (inferred from the extension: pdf, xlsx/csv, doc/docx, image, or generic) \" +\n \"and the filename. Clicking a row opens a preview dialog. \" +\n \"Image files render from url; other files show a large icon and a Download footer action. \" +\n \"Use for Completed Forms and Attachments sections.\",\n};\n","import { primitive, semantic } from \"@servicetitan/carto-react-kit/tokens\";\nimport { style } from \"@vanilla-extract/css\";\n\nexport const fileList = style({\n display: \"flex\",\n flexDirection: \"column\",\n gap: primitive.size[\"200\"],\n width: \"100%\",\n});\n\n/** Full-width interactive card for each file row. */\nexport const fileCard = style({\n width: \"100%\",\n});\n\n/** Icon + label layout inside the card. */\nexport const fileRowContent = style({\n display: \"flex\",\n alignItems: \"center\",\n gap: primitive.size[\"300\"],\n minWidth: 0,\n});\n\n/** 32×32 gray circle behind list-row icons. */\nexport const fileIconBadge = style({\n width: primitive.size[\"800\"],\n height: primitive.size[\"800\"],\n borderRadius: \"50%\",\n flexShrink: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n backgroundColor: semantic.background.color.subtle.resting,\n});\n\n/** Preview dialog content wrapper. */\nexport const filePreviewContent = style({\n display: \"flex\",\n flexDirection: \"column\",\n gap: primitive.size[\"300\"],\n width: \"100%\",\n});\n\n/** Centers image or icon above the filename. */\nexport const filePreviewMedia = style({\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: \"100%\",\n});\n\nexport const filePreviewImage = style({\n maxWidth: \"100%\",\n maxHeight: \"65vh\",\n objectFit: \"contain\",\n borderRadius: semantic.radius.trim,\n});\n\n/** Non-image preview — large centered file-type icon. */\nexport const filePreviewIconWrap = style({\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: \"100%\",\n minHeight: primitive.size[\"1400\"],\n});\n\n/** Filename caption below the preview media. */\nexport const filePreviewLabel = style({\n width: \"100%\",\n textAlign: \"left\",\n});\n","import { Icon } from \"@servicetitan/anvil2\";\nimport ImageIcon from \"@servicetitan/anvil2/assets/icons/material/round/image.svg\";\nimport DocumentAudio from \"@servicetitan/anvil2/assets/icons/st/document_audio.svg\";\nimport DocumentDoc from \"@servicetitan/anvil2/assets/icons/st/document_doc.svg\";\nimport DocumentForm from \"@servicetitan/anvil2/assets/icons/st/document_form.svg\";\nimport DocumentOther from \"@servicetitan/anvil2/assets/icons/st/document_other.svg\";\nimport DocumentPdf from \"@servicetitan/anvil2/assets/icons/st/document_pdf.svg\";\nimport DocumentSpreadsheet from \"@servicetitan/anvil2/assets/icons/st/document_spreadsheet.svg\";\nimport DocumentText from \"@servicetitan/anvil2/assets/icons/st/document_text.svg\";\nimport { Card, Dialog, Text } from \"@servicetitan/carto-react-kit\";\nimport type { ComponentProps, CSSProperties } from \"react\";\nimport { useState } from \"react\";\nimport type { z } from \"zod\";\n\nimport { contextFileListCatalog } from \"./context-file-list.catalog\";\nimport {\n fileCard,\n fileIconBadge,\n fileList,\n filePreviewContent,\n filePreviewIconWrap,\n filePreviewImage,\n filePreviewLabel,\n filePreviewMedia,\n fileRowContent,\n} from \"./context-file-list.css\";\n\nexport { contextFileListCatalog };\n\ntype AnvilSvg = NonNullable<ComponentProps<typeof Icon>[\"svg\"]>;\n\ntype FileKind = \"pdf\" | \"spreadsheet\" | \"doc\" | \"text\" | \"form\" | \"audio\" | \"image\" | \"generic\";\n\nfunction inferFileKind(label: string): FileKind {\n const lower = label.toLowerCase();\n if (lower.endsWith(\".pdf\")) return \"pdf\";\n if (/\\.(xlsx|xls|csv|numbers)$/.test(lower)) return \"spreadsheet\";\n if (/\\.(doc|docx|pages)$/.test(lower)) {\n if (/form/i.test(lower.replace(/\\.[^.]+$/, \"\"))) return \"form\";\n return \"doc\";\n }\n if (/\\.(txt|rtf|md)$/.test(lower)) return \"text\";\n if (/\\.(mp3|wav|aac|m4a|flac|ogg)$/.test(lower)) return \"audio\";\n if (/\\.(jpg|jpeg|png|gif|webp|heic|svg)$/.test(lower)) return \"image\";\n if (/form/i.test(lower.replace(/\\.[^.]+$/, \"\"))) return \"form\";\n return \"generic\";\n}\n\nconst FILE_KIND_META: Record<FileKind, { svg: AnvilSvg; color: string }> = {\n pdf: { svg: DocumentPdf as AnvilSvg, color: \"#DC2626\" },\n spreadsheet: { svg: DocumentSpreadsheet as AnvilSvg, color: \"#16A34A\" },\n doc: { svg: DocumentDoc as AnvilSvg, color: \"#2563EB\" },\n text: { svg: DocumentText as AnvilSvg, color: \"#6B7280\" },\n form: { svg: DocumentForm as AnvilSvg, color: \"#2563EB\" },\n audio: { svg: DocumentAudio as AnvilSvg, color: \"#6B7280\" },\n image: { svg: ImageIcon as AnvilSvg, color: \"#374151\" },\n generic: { svg: DocumentOther as AnvilSvg, color: \"#6B7280\" },\n};\n\n/** 80px preview — Anvil Icon sizes cap at xlarge (32px), so override the token. */\nconst PREVIEW_ICON_STYLE = {\n \"--a2-mod-icon-font-size\": \"80px\",\n} as CSSProperties;\n\ntype FileItem = z.infer<typeof contextFileListCatalog.props>[\"items\"][number];\n\nfunction FileListIcon({ kind }: { kind: FileKind }) {\n const { svg, color } = FILE_KIND_META[kind];\n\n return (\n <div className={fileIconBadge} aria-hidden=\"true\">\n <Icon svg={svg} size=\"medium\" color={color} />\n </div>\n );\n}\n\nfunction downloadFile(url: string, filename: string) {\n const anchor = document.createElement(\"a\");\n anchor.href = url;\n anchor.download = filename;\n anchor.target = \"_blank\";\n anchor.rel = \"noopener noreferrer\";\n document.body.appendChild(anchor);\n anchor.click();\n anchor.remove();\n}\n\nfunction FilePreviewLabel({ label }: { label: string }) {\n return <Text variant=\"body\" size=\"regular\" text={label} className={filePreviewLabel} />;\n}\n\nfunction FilePreviewContent({ item, kind }: { item: FileItem; kind: FileKind }) {\n const { svg, color } = FILE_KIND_META[kind];\n\n return (\n <div className={filePreviewContent}>\n <div className={filePreviewMedia}>\n {kind === \"image\" ? (\n <img src={item.url} alt={item.label} className={filePreviewImage} />\n ) : (\n <div className={filePreviewIconWrap}>\n <Icon svg={svg} color={color} style={PREVIEW_ICON_STYLE} />\n </div>\n )}\n </div>\n <FilePreviewLabel label={item.label} />\n </div>\n );\n}\n\nfunction FileRow({ item, onPreview }: { item: FileItem; onPreview: () => void }) {\n const kind = inferFileKind(item.label);\n\n return (\n <Card\n className={fileCard}\n padding=\"snug\"\n onPress={onPreview}\n label={`Preview ${item.label}`}\n content={\n <div className={fileRowContent}>\n <FileListIcon kind={kind} />\n <Text variant=\"body\" size=\"compact\" text={item.label} />\n </div>\n }\n />\n );\n}\n\nfunction FileListItem({ item }: { item: FileItem }) {\n const [open, setOpen] = useState(false);\n const kind = inferFileKind(item.label);\n const isImage = kind === \"image\";\n\n return (\n <>\n <FileRow item={item} onPreview={() => setOpen(true)} />\n <Dialog\n title=\"View Attachment\"\n content={<FilePreviewContent item={item} kind={kind} />}\n isOpen={open}\n onOpenChange={setOpen}\n {...(isImage\n ? {}\n : {\n primaryAction: {\n label: \"Download\",\n onPress: () => downloadFile(item.url, item.label),\n },\n })}\n />\n </>\n );\n}\n\nexport const ContextFileListRenderer = ({\n props,\n}: {\n props: z.infer<typeof contextFileListCatalog.props>;\n}) => (\n <div className={fileList}>\n {props.items.map((item, idx) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: filenames may not be unique\n <FileListItem key={`${item.label}-${idx}`} item={item} />\n ))}\n </div>\n);\n","import { z } from \"zod\";\n\nimport { CONTEXT_CHIP_TONES } from \"../components/context-chip-tone\";\n\n/**\n * A single row in a ContextList — timesheet or recent-job style:\n * title: \"Devon Carter\"\n * meta: \"04/28/2026 · 8H · $65/HR · $520 TOTAL\"\n * callout: \"$520.00\", calloutLabel: \"INVOICED\"\n *\n * Or with a leading job link:\n * identifier: \"134536\", identifierHref: \"https://...\"\n * title: \"HVAC Inspection\"\n * meta: \"04/28/2026 · DEVON CARTER\"\n */\nexport const listItemSchema = z.object({\n /** Primary label (e.g. employee name, job title). Required. */\n title: z.string(),\n /** Leading linked reference shown before the title (e.g. job number). */\n identifier: z.string().optional(),\n /** URL for the identifier link. */\n identifierHref: z.string().optional(),\n /** Secondary detail line below the title (e.g. \"04/28/2026 · 8H · $65/HR\"). */\n meta: z.string().optional(),\n /** Right-aligned callout value (e.g. \"$520.00\"). */\n callout: z.string().optional(),\n /** Optional tone for the callout text. */\n calloutTone: z.enum(CONTEXT_CHIP_TONES).optional(),\n /** Small label below the callout (e.g. \"INVOICED\"). */\n calloutLabel: z.string().optional(),\n});\n\nexport const contextListCatalog = {\n props: z.object({\n items: z.array(listItemSchema),\n }),\n slots: [],\n description:\n \"Flat list for timesheets and recent jobs. \" +\n \"Each item has a required title, optional identifier link + meta on the left, \" +\n \"and optional callout + calloutLabel on the right. \" +\n \"For grouped procurement records with aligned columns, use ContextTabularList instead.\",\n};\n","import { primitive, semantic } from \"@servicetitan/carto-react-kit/tokens\";\nimport { style } from \"@vanilla-extract/css\";\n\n/** Outer list wrapper. */\nexport const listRoot = style({\n display: \"flex\",\n flexDirection: \"column\",\n width: \"100%\",\n});\n\n/** Subdued color for meta and callout labels. */\nexport const textSubdued = style({\n color: semantic.foreground.color.subtle,\n});\n\n/** A single list item row. */\nexport const listItem = style({\n padding: primitive.size[\"300\"],\n});\n\n/** Two-column grid: left fills space, right shrinks to content. */\nexport const listItemGrid = style({\n display: \"grid\",\n gridTemplateColumns: \"minmax(0, 1fr) max-content\",\n columnGap: primitive.size[\"300\"],\n rowGap: primitive.size[\"100\"],\n alignItems: \"start\",\n width: \"100%\",\n});\n\n/** Left column — title row + meta row. */\nexport const listColLeft = style({\n display: \"flex\",\n flexDirection: \"column\",\n gap: primitive.size[\"100\"],\n minWidth: 0,\n});\n\n/** Title row: optional link, divider, title. */\nexport const listPrimaryRow = style({\n display: \"flex\",\n alignItems: \"center\",\n gap: primitive.size[\"200\"],\n minWidth: 0,\n});\n\n/** Vertical divider between identifier link and title. */\nexport const listPrimaryDivider = style({\n alignSelf: \"stretch\",\n width: primitive.size[\"25\"],\n flexShrink: 0,\n backgroundColor: semantic.border.color.standard,\n});\n\n/** Right column — callout + callout label, right-aligned. */\nexport const listColRight = style({\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"flex-end\",\n gap: primitive.size[\"100\"],\n flexShrink: 0,\n});\n","import { Link, Text } from \"@servicetitan/carto-react-kit\";\nimport type { z } from \"zod\";\n\nimport { toneForegroundColor } from \"../components/context-chip-tone\";\nimport { contextListCatalog, type listItemSchema } from \"./context-list.catalog\";\nimport {\n listColLeft,\n listColRight,\n listItem,\n listItemGrid,\n listPrimaryDivider,\n listPrimaryRow,\n listRoot,\n textSubdued,\n} from \"./context-list.css\";\n\nexport { contextListCatalog };\n\ntype ListItem = z.infer<typeof listItemSchema>;\n\nfunction ListRow({ item }: { item: ListItem }) {\n const calloutColor = item.calloutTone ? toneForegroundColor(item.calloutTone) : undefined;\n const identifier = item.identifier;\n const hasRight = item.callout != null || item.calloutLabel != null;\n\n return (\n <div className={listItemGrid}>\n <div className={listColLeft}>\n <div className={listPrimaryRow}>\n {identifier && item.identifierHref ? (\n <Link href={item.identifierHref} target=\"_blank\" text={identifier} />\n ) : identifier ? (\n <Text variant=\"body\" size=\"compact\" text={identifier} />\n ) : null}\n {identifier ? <span aria-hidden=\"true\" className={listPrimaryDivider} /> : null}\n <Text variant=\"body\" size=\"regular\" text={item.title} />\n </div>\n {item.meta ? (\n <Text variant=\"body\" size=\"fine\" text={item.meta} className={textSubdued} />\n ) : null}\n </div>\n {hasRight ? (\n <div className={listColRight}>\n {item.callout ? (\n <Text\n variant=\"headline\"\n el=\"h6\"\n size=\"regular\"\n text={item.callout}\n {...(calloutColor ? { style: { color: calloutColor } } : {})}\n />\n ) : null}\n {item.calloutLabel ? (\n <Text variant=\"eyebrow\" text={item.calloutLabel} className={textSubdued} />\n ) : null}\n </div>\n ) : null}\n </div>\n );\n}\n\nexport const ContextListRenderer = ({\n props,\n}: {\n props: z.infer<typeof contextListCatalog.props>;\n}) => (\n <div className={listRoot}>\n {props.items.map((item, idx) => (\n <div key={item.identifier ?? item.title ?? idx} className={listItem}>\n <ListRow item={item} />\n </div>\n ))}\n </div>\n);\n","import { z } from \"zod\";\n\nimport { CONTEXT_CHIP_TONES } from \"../components/context-chip-tone\";\n\nconst metricItemSchema = z.object({\n label: z.string(),\n value: z.string(),\n /**\n * Optional tone applied to the value text.\n * Use \"danger\" for over-budget costs, \"success\" for positive metrics, etc.\n */\n tone: z.enum(CONTEXT_CHIP_TONES).optional(),\n});\n\nexport const contextMetricGridCatalog = {\n props: z.object({\n items: z.array(metricItemSchema),\n columns: z.enum([\"3\", \"4\"]).optional(),\n }),\n slots: [],\n description:\n \"KPI grid with label and value pairs. Optional columns: 3 (default) or 4. Each item supports an optional tone (danger | warning | success | info | neutral) to color the value text.\",\n};\n","import { primitive, semantic } from \"@servicetitan/carto-react-kit/tokens\";\nimport { style } from \"@vanilla-extract/css\";\nimport { recipe } from \"@vanilla-extract/recipes\";\n\nexport const metricGrid = recipe({\n base: {\n display: \"grid\",\n gap: primitive.size[\"400\"],\n width: \"100%\",\n },\n variants: {\n columns: {\n \"3\": { gridTemplateColumns: \"repeat(3, minmax(0, 1fr))\" },\n \"4\": { gridTemplateColumns: \"repeat(4, minmax(0, 1fr))\" },\n },\n },\n defaultVariants: {\n columns: \"3\",\n },\n});\n\n/** Subdued color for KPI label eyebrows. */\nexport const eyebrowSubdued = style({\n color: semantic.foreground.color.subtle,\n});\n\nexport const metricGridItem = style({\n display: \"flex\",\n flexDirection: \"column\",\n gap: primitive.size[\"100\"],\n minWidth: 0,\n});\n","import { Text } from \"@servicetitan/carto-react-kit\";\nimport type { z } from \"zod\";\n\nimport { toneForegroundColor } from \"../components/context-chip-tone\";\nimport { contextMetricGridCatalog } from \"./context-metric-grid.catalog\";\nimport { eyebrowSubdued, metricGrid, metricGridItem } from \"./context-metric-grid.css\";\n\nexport { contextMetricGridCatalog };\n\nexport const ContextMetricGridRenderer = ({\n props,\n}: {\n props: z.infer<typeof contextMetricGridCatalog.props>;\n}) => {\n const columns = props.columns === \"4\" ? \"4\" : \"3\";\n\n return (\n <div className={metricGrid({ columns })}>\n {props.items.map((item) => {\n const valueColor = item.tone ? toneForegroundColor(item.tone) : undefined;\n return (\n <div key={item.label} className={metricGridItem}>\n <Text variant=\"eyebrow\" text={item.label.toUpperCase()} className={eyebrowSubdued} />\n <Text\n variant=\"headline\"\n el=\"h6\"\n size=\"regular\"\n text={item.value}\n {...(valueColor ? { style: { color: valueColor } } : {})}\n />\n </div>\n );\n })}\n </div>\n );\n};\n","import { style } from \"@vanilla-extract/css\";\n\n/**\n * Isolated wrapper so the highlighted Card's `::before` glow (z-index -1)\n * paints within this context instead of behind the parent CollapsibleCard.\n */\nexport const aiSummaryRoot = style({\n position: \"relative\",\n isolation: \"isolate\",\n width: \"100%\",\n overflow: \"visible\",\n});\n","import { Card, Text } from \"@servicetitan/carto-react-kit\";\n\nimport { aiSummaryRoot } from \"./context-ai-summary.css\";\n\nexport interface ContextAiSummaryProps {\n summary: string;\n}\n\nexport const ContextAiSummary = ({ summary }: ContextAiSummaryProps) => (\n <div className={aiSummaryRoot} data-carto=\"context-ai-summary\">\n <Card\n highlighted\n padding=\"snug\"\n role=\"status\"\n style={{ width: \"100%\" }}\n content={<Text variant=\"body\" size=\"regular\" text={summary} />}\n />\n </div>\n);\n","import { primitive, semantic } from \"@servicetitan/carto-react-kit/tokens\";\nimport { style } from \"@vanilla-extract/css\";\n\n/** Outer list wrapper — the content area within the collapsible card. */\nexport const noteList = style({\n display: \"flex\",\n flexDirection: \"column\",\n width: \"100%\",\n});\n\n/** AI summary wrapper — sits above the note items. */\nexport const noteSummaryWrapper = style({\n marginBottom: primitive.size[\"300\"],\n});\n\n/** Single note item row. */\nexport const noteItem = style({\n paddingBlock: primitive.size[\"200\"],\n display: \"flex\",\n flexDirection: \"column\",\n gap: primitive.size[\"100\"],\n selectors: {\n \"&:first-child\": {\n paddingTop: 0,\n },\n },\n});\n\n/** Top row: category label (left) + author · date (right). */\nexport const noteItemHeader = style({\n display: \"flex\",\n alignItems: \"baseline\",\n justifyContent: \"space-between\",\n gap: primitive.size[\"200\"],\n});\n\n/** Subdued color for eyebrow labels (category, author/date). */\nexport const eyebrowSubdued = style({\n color: semantic.foreground.color.subtle,\n});\n","import { z } from \"zod\";\n\nconst noteItemSchema = z.object({\n /**\n * Optional category eyebrow shown above the body text (e.g. \"JOB SUMMARY\", \"APPOINTMENT SUMMARY\").\n * Displayed in small caps at the top-left of the item.\n */\n category: z.string().optional(),\n /** Main body text of the note. */\n body: z.string(),\n /** Author name shown at top-right (e.g. \"MARCUS D.\"). */\n author: z.string().optional(),\n /** Date shown at top-right (e.g. \"03/10/2026\"). */\n date: z.string().optional(),\n /**\n * Whether to truncate the body text to ~3 lines by default.\n * An inline \"More\" toggle lets the user expand to full text.\n * Defaults to false (show full text).\n */\n truncate: z.boolean().optional(),\n});\n\nexport const contextNoteListCatalog = {\n props: z.object({\n /**\n * Optional AI-generated summary shown in a highlighted card at the top of the list,\n * before the individual note items.\n */\n summary: z.string().optional(),\n items: z.array(noteItemSchema),\n }),\n slots: [],\n description:\n \"Notes & Summaries list. Optional summary renders an AI-highlighted box at the top. \" +\n \"Each item shows an optional category eyebrow (e.g. 'JOB SUMMARY'), body text, \" +\n \"and optional author + date at top-right. \" +\n \"Set truncate: true on long items to clamp to ~3 lines with an inline More/Less expand.\",\n};\n","import { OverflowText } from \"@servicetitan/anvil2\";\nimport { Text } from \"@servicetitan/carto-react-kit\";\nimport type { z } from \"zod\";\n\nimport { ContextAiSummary } from \"../components/context-ai-summary\";\nimport {\n eyebrowSubdued,\n noteItem,\n noteItemHeader,\n noteList,\n noteSummaryWrapper,\n} from \"../components/context-note-list.css\";\nimport { contextNoteListCatalog } from \"./context-note-list.catalog\";\n\nexport { contextNoteListCatalog };\n\ntype NoteItem = z.infer<typeof contextNoteListCatalog.props>[\"items\"][number];\n\nfunction NoteItemRow({ item }: { item: NoteItem }) {\n const hasHeader = item.category || item.author || item.date;\n\n return (\n <div className={noteItem}>\n {hasHeader ? (\n <div className={noteItemHeader}>\n {item.category ? (\n <Text variant=\"eyebrow\" text={item.category} className={eyebrowSubdued} />\n ) : (\n <span />\n )}\n {item.author || item.date ? (\n <Text\n variant=\"eyebrow\"\n text={[item.author, item.date].filter(Boolean).join(\" · \")}\n className={eyebrowSubdued}\n />\n ) : null}\n </div>\n ) : null}\n\n {item.truncate ? (\n <OverflowText rows={3} expandable expandText=\"More\" collapseText=\"Less\">\n {item.body}\n </OverflowText>\n ) : (\n <Text variant=\"body\" size=\"regular\" text={item.body} />\n )}\n </div>\n );\n}\n\nexport const ContextNoteListRenderer = ({\n props,\n}: {\n props: z.infer<typeof contextNoteListCatalog.props>;\n}) => (\n <div className={noteList}>\n {props.summary ? (\n <div className={noteSummaryWrapper}>\n <ContextAiSummary summary={props.summary} />\n </div>\n ) : null}\n {props.items.map((item, idx) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: items lack stable ids\n <NoteItemRow key={`${item.category ?? \"\"}-${idx}`} item={item} />\n ))}\n </div>\n);\n","import { z } from \"zod\";\n\nexport const contextOverviewCatalog = {\n props: z.object({\n summary: z.string(),\n }),\n slots: [] as string[],\n description:\n \"AI-generated overview summary for the Context panel. Optional first child of ContextPanel. Renders as a plain section (not a card): Overview headline with sparkle icon and body text. Leaf node — no children.\",\n};\n","import { primitive } from \"@servicetitan/carto-react-kit/tokens\";\nimport { style } from \"@vanilla-extract/css\";\n\nexport const overview = style({\n display: \"flex\",\n flexDirection: \"column\",\n gap: primitive.size[\"200\"],\n});\n\nexport const overviewTitleRow = style({\n display: \"flex\",\n alignItems: \"center\",\n gap: primitive.size[\"200\"],\n});\n","import { AiMark } from \"@servicetitan/anvil2\";\nimport { Text } from \"@servicetitan/carto-react-kit\";\nimport type { z } from \"zod\";\nimport { contextOverviewCatalog } from \"./context-overview.catalog\";\nimport { overview, overviewTitleRow } from \"./context-overview.css\";\n\nexport { contextOverviewCatalog };\n\nexport const ContextOverviewRenderer = ({\n props,\n}: {\n props: z.infer<typeof contextOverviewCatalog.props>;\n}) => (\n <section className={overview}>\n <div className={overviewTitleRow}>\n <Text variant=\"headline\" el=\"h2\" size=\"substantial\" text=\"Overview\" />\n <AiMark size=\"small\" type=\"gradient\" />\n </div>\n <Text variant=\"body\" size=\"regular\" text={props.summary} />\n </section>\n);\n","import { z } from \"zod\";\n\nexport const contextPanelCatalog = {\n props: z.object({}),\n slots: [\"default\"],\n description:\n \"Root container for the Context panel. MUST be the spec root. Children MUST only be ContextOverview (optional, first) followed by one or more ContextCard components.\",\n};\n","import { primitive } from \"@servicetitan/carto-react-kit/tokens\";\nimport { style } from \"@vanilla-extract/css\";\n\nexport const panel = style({\n display: \"flex\",\n flexDirection: \"column\",\n gap: primitive.size[\"300\"],\n maxWidth: \"800px\",\n margin: \"0 auto\",\n});\n","import { Children, type ReactNode } from \"react\";\nimport { contextPanelCatalog } from \"./context-panel.catalog\";\nimport { panel } from \"./context-panel.css\";\n\nexport { contextPanelCatalog };\n\nexport const ContextPanelRenderer = ({ children }: { children?: ReactNode }) => {\n const items = Children.toArray(children).filter(Boolean);\n\n return <div className={panel}>{items}</div>;\n};\n","import { z } from \"zod\";\n\nconst fieldSchema = z.object({\n /** Column header shown above the value (e.g. \"DATE\", \"AMOUNT\"). */\n label: z.string(),\n /** Cell value (e.g. \"03/05/2026\", \"$1,672.00\"). */\n value: z.string(),\n});\n\nconst tabularRowSchema = z.object({\n /** Row type label in the first column (e.g. \"PURCHASE ORDER\", \"RECEIPT\", \"BILL\"). */\n eyebrow: z.string().optional(),\n /** Leading linked reference in the first column (e.g. PO number). */\n identifier: z.string().optional(),\n /** URL for the identifier link. */\n identifierHref: z.string().optional(),\n /** Additional columns after the identifier column — same field count per group. */\n fields: z.array(fieldSchema),\n});\n\nconst groupSchema = z.object({\n /** Vendor or category heading (e.g. \"ABC Supply Co\"). */\n label: z.string(),\n items: z.array(tabularRowSchema),\n});\n\nexport const contextTabularListCatalog = {\n props: z.object({\n /** Vendor-grouped tabular rows. Each group renders as a neutral card with aligned columns. */\n groups: z.array(groupSchema),\n }),\n slots: [],\n description:\n \"Grouped tabular list for procurement-style records. \" +\n \"Each group has a vendor label and rows with an optional eyebrow + identifier in the first column \" +\n \"and additional label/value field columns (e.g. DATE, AMOUNT). \" +\n \"Use inside ContextCard for Procurement sections.\",\n};\n","import { primitive, semantic } from \"@servicetitan/carto-react-kit/tokens\";\nimport { style } from \"@vanilla-extract/css\";\n\n/** Outer wrapper — stacks vendor groups. */\nexport const tabularRoot = style({\n display: \"flex\",\n flexDirection: \"column\",\n width: \"100%\",\n});\n\n/** Vendor group card. */\nexport const tabularGroup = style({\n display: \"flex\",\n flexDirection: \"column\",\n backgroundColor: primitive.color.neutral[\"30\"],\n borderRadius: semantic.radius.moderate,\n padding: primitive.size[\"300\"],\n selectors: {\n \"&:not(:first-child)\": {\n marginTop: primitive.size[\"300\"],\n },\n },\n});\n\n/** Vendor group heading. */\nexport const tabularGroupLabel = style({\n marginBottom: primitive.size[\"200\"],\n});\n\n/** Subdued color for eyebrow labels and field headers. */\nexport const eyebrowSubdued = style({\n color: semantic.foreground.color.subtle,\n});\n\n/**\n * Shared-column grid — every cell is a direct child so column tracks align\n * across rows (e.g. PURCHASE ORDER sets the width of column 1 for all rows).\n */\nexport const tabularGroupGrid = style({\n display: \"grid\",\n width: \"100%\",\n justifyItems: \"start\",\n alignContent: \"start\",\n});\n\n/** Full-width divider between rows — equal margin above/below centers the line. */\nexport const tabularRowDivider = style({\n gridColumn: \"1 / -1\",\n width: \"100%\",\n marginTop: primitive.size[\"300\"],\n marginBottom: primitive.size[\"300\"],\n height: primitive.size[\"25\"],\n backgroundColor: semantic.border.color.standard,\n});\n\n/** Column cell — eyebrow + value stacked, left-aligned. */\nexport const tabularCell = style({\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"flex-start\",\n gap: primitive.size[\"100\"],\n justifySelf: \"start\",\n minWidth: 0,\n});\n","import { Link, Text } from \"@servicetitan/carto-react-kit\";\nimport { primitive } from \"@servicetitan/carto-react-kit/tokens\";\nimport { Fragment } from \"react\";\nimport type { z } from \"zod\";\n\nimport { contextTabularListCatalog } from \"./context-tabular-list.catalog\";\nimport {\n eyebrowSubdued,\n tabularCell,\n tabularGroup,\n tabularGroupGrid,\n tabularGroupLabel,\n tabularRoot,\n tabularRowDivider,\n} from \"./context-tabular-list.css\";\n\nexport { contextTabularListCatalog };\n\ntype TabularRow = z.infer<\n typeof contextTabularListCatalog.props\n>[\"groups\"][number][\"items\"][number];\n\nfunction tabularGridColumns(fieldCount: number): string {\n const colCount = fieldCount + 1;\n if (colCount <= 1) return \"max-content\";\n const spacer = `minmax(${primitive.size[\"400\"]}, 1fr)`;\n return Array(colCount).fill(\"max-content\").join(` ${spacer} `);\n}\n\nfunction tabularContentColumn(index: number): number {\n return index * 2 + 1;\n}\n\nfunction TabularRowCells({ item, gridRow }: { item: TabularRow; gridRow: number }) {\n const cellProps = (colIndex: number) => ({\n style: { gridColumn: tabularContentColumn(colIndex), gridRow },\n className: tabularCell,\n });\n\n return (\n <>\n <div {...cellProps(0)}>\n {item.eyebrow ? (\n <Text variant=\"eyebrow\" text={item.eyebrow} className={eyebrowSubdued} />\n ) : null}\n {item.identifier && item.identifierHref ? (\n <Link href={item.identifierHref} target=\"_blank\" text={item.identifier} />\n ) : item.identifier ? (\n <Text variant=\"body\" size=\"compact\" text={item.identifier} />\n ) : null}\n </div>\n {item.fields.map((f, index) => (\n <div key={f.label} {...cellProps(index + 1)}>\n <Text variant=\"eyebrow\" text={f.label} className={eyebrowSubdued} />\n <Text variant=\"body\" size=\"compact\" text={f.value} />\n </div>\n ))}\n </>\n );\n}\n\nexport const ContextTabularListRenderer = ({\n props,\n}: {\n props: z.infer<typeof contextTabularListCatalog.props>;\n}) => (\n <div className={tabularRoot}>\n {props.groups.map((group) => {\n const fieldCount = group.items[0]?.fields.length ?? 0;\n\n return (\n <div key={group.label} className={tabularGroup}>\n <div className={tabularGroupLabel}>\n <Text variant=\"headline\" el=\"h5\" size=\"regular\" text={group.label} />\n </div>\n <div\n className={tabularGroupGrid}\n style={{ gridTemplateColumns: tabularGridColumns(fieldCount) }}\n >\n {group.items.map((item, idx) => {\n const gridRow = idx * 2 + 1;\n\n return (\n <Fragment key={item.identifier ?? item.eyebrow ?? idx}>\n {idx > 0 ? (\n <div className={tabularRowDivider} style={{ gridRow: idx * 2 }} />\n ) : null}\n <TabularRowCells item={item} gridRow={gridRow} />\n </Fragment>\n );\n })}\n </div>\n </div>\n );\n })}\n </div>\n);\n","import { contextCardCatalog } from \"./context-card.catalog\";\nimport { contextDataTableCatalog } from \"./context-data-table.catalog\";\nimport { contextFileListCatalog } from \"./context-file-list.catalog\";\nimport { contextListCatalog } from \"./context-list.catalog\";\nimport { contextMetricGridCatalog } from \"./context-metric-grid.catalog\";\nimport { contextNoteListCatalog } from \"./context-note-list.catalog\";\nimport { contextOverviewCatalog } from \"./context-overview.catalog\";\nimport { contextPanelCatalog } from \"./context-panel.catalog\";\nimport { contextTabularListCatalog } from \"./context-tabular-list.catalog\";\n\nexport const contextShellComponents = {\n ContextPanel: contextPanelCatalog,\n ContextOverview: contextOverviewCatalog,\n ContextCard: contextCardCatalog,\n};\n\nexport const contextContentComponents = {\n ContextNoteList: contextNoteListCatalog,\n ContextMetricGrid: contextMetricGridCatalog,\n ContextDataTable: contextDataTableCatalog,\n ContextList: contextListCatalog,\n ContextTabularList: contextTabularListCatalog,\n ContextFileList: contextFileListCatalog,\n};\n","import { z } from \"zod\";\n\nexport const actionsCatalog = {\n \"atlas.submitUserAction\": {\n params: z.object({\n data: z.record(z.string(), z.unknown()).optional(),\n actionId: z.string().optional(),\n }),\n description: 'Submit form data. actionId overrides default \"form_submit\" identifier.',\n },\n \"atlas.navigate\": {\n params: z.object({ url: z.string() }),\n description:\n \"Navigate to a URL or internal route. External URLs (http/https) open in a new tab; internal route strings navigate within the app.\",\n },\n \"atlas.toolCall\": {\n params: z.object({\n tool: z.string(),\n args: z.record(z.string(), z.unknown()).optional(),\n }),\n description:\n \"Invoke a tool on the active artifact panel app (an MCP-backed MFE). args is the tool argument payload; if omitted the current form state is sent.\",\n },\n};\n\nexport const actionsHandlers = {\n \"atlas.submitUserAction\": async (_params: unknown) => {\n // no-op default — host overrides via SpecRenderer `actions` factory\n },\n \"atlas.navigate\": async (_params: unknown) => {\n // no-op default — host overrides via SpecRenderer `actions` factory\n },\n \"atlas.toolCall\": async (_params: unknown) => {\n // no-op default — host overrides via SpecRenderer `actions` factory\n },\n};\n","import { z } from \"zod\";\n\nexport const alertCatalog = {\n props: z.object({\n title: z.string(),\n status: z.enum([\"info\", \"success\", \"warning\", \"danger\"]).optional(),\n dismissible: z.boolean().optional(),\n aiMark: z.boolean().optional(),\n }),\n slots: [\"default\"],\n events: [\"close\"],\n description:\n 'Inline notification banner with a required title. status: info (default) | success | warning | danger — danger for errors, warning for cautions, success for confirmations. Put the main message in the alert\\'s children (rendered below the title). dismissible: true adds a close button that emits a \"close\" event.',\n};\n","import { z } from \"zod\";\n\nexport const barChartCatalog = {\n props: z.object({\n data: z.array(z.object({ category: z.string(), value: z.number() })),\n orientation: z.enum([\"vertical\", \"horizontal\"]).optional(),\n theme: z.enum([\"monochrome\", \"categorical\", \"semantic\"]).optional(),\n height: z.number().optional(),\n unit: z.string().optional(),\n }),\n slots: [],\n description:\n \"Bar chart (vertical or horizontal) with Anvil2 theme. data: [{category, value}]. theme: monochrome (default, ≤4 vars), categorical (5-9 distinct), semantic (success/neutral/warning/danger order). unit: tooltip suffix.\",\n};\n","import { z } from \"zod\";\n\nexport const buttonCatalog = {\n props: z.object({\n label: z.string(),\n appearance: z.enum([\"primary\", \"secondary\", \"ghost\", \"danger\"]).optional(),\n size: z.enum([\"xsmall\", \"small\", \"medium\", \"large\"]).optional(),\n loading: z.boolean().optional(),\n disabled: z.boolean().optional(),\n badge: z.string().optional(),\n }),\n slots: [],\n events: [\"press\"],\n description:\n 'Clickable button. Emits a \"press\" event when clicked; inside a form the host treats press as a submit and uses the element key as the actionId, so no explicit on.press wiring is needed for form submits. appearance: primary | secondary (default) | ghost | danger (destructive actions like delete/cancel). size: xsmall | small | medium (default) | large. loading: true shows a spinner and blocks interaction. disabled: true prevents interaction. badge: optional notification count shown as a superscript (e.g. \"3\", \"99+\"); use an empty string for a dot-only indicator.',\n};\n","import { z } from \"zod\";\n\nexport const cardCatalog = {\n props: z.object({\n title: z.string().optional(),\n description: z.string().optional(),\n background: z.enum([\"strong\", \"stronger\"]).optional(),\n padding: z.enum([\"0\", \"xsmall\", \"small\", \"medium\", \"large\"]).optional(),\n }),\n slots: [\"default\"],\n description:\n \"White surface that groups a logical section of related content. title: optional headline rendered at the top of the card. description: optional subdued line below the title. Children render below the header and are stacked vertically with consistent spacing — you do not need to wrap them in a Flex. Prefer the built-in title/description over standalone Text children for the heading. background: strong | stronger for nested/elevated surfaces. padding: 0 | xsmall | small | medium (default) | large. Do not nest a Card inside another Card.\",\n};\n","import { z } from \"zod\";\n\nexport const checkboxCatalog = {\n props: z.object({\n label: z.string(),\n checked: z.boolean().optional(),\n disabled: z.boolean().optional(),\n }),\n slots: [],\n events: [\"change\"],\n description:\n 'Checkbox for selecting zero or more independent options that are submitted with a form (one Checkbox per option). For a single on/off setting with immediate effect prefer Switch. Bind state with $bindState on checked; emits a \"change\" event when toggled. disabled: true prevents toggling.',\n};\n","import { z } from \"zod\";\n\nexport const chipCatalog = {\n props: z.object({\n label: z.string(),\n size: z.enum([\"small\", \"medium\"]).optional(),\n color: z.string().optional(),\n icon: z.enum([\"check-circle\", \"in-progress\", \"radio-button-unchecked\"]).optional(),\n removable: z.boolean().optional(),\n }),\n slots: [],\n events: [\"close\"],\n description:\n 'Inline label pill for metadata, tags, or categories — use for job statuses, not notification counts (use a Button/Link badge prop for those). size: small | medium (default). color: any CSS color. icon: optional leading status icon. removable: true adds a close button that emits a \"close\" event (ignored when size=small).',\n};\n","import { z } from \"zod\";\n\nexport const dividerCatalog = {\n props: z.object({\n vertical: z.boolean().optional(),\n spacing: z.enum([\"0\", \"half\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"8\", \"12\"]).optional(),\n alignContent: z.enum([\"start\", \"center\", \"end\"]).optional(),\n }),\n slots: [],\n description:\n \"Horizontal (default) or vertical rule that separates content sections. vertical: true for a vertical separator between side-by-side content. spacing (space around the divider, ~4px per step): 0 (default) | half | 1–6 | 8 | 12. alignContent: alignment of any divider content (start | center | end). Place between logical sections — not as a top/bottom border of a container.\",\n};\n","import { z } from \"zod\";\n\nexport const donutChartCatalog = {\n props: z.object({\n data: z.array(z.object({ category: z.string(), value: z.number() })),\n theme: z.enum([\"monochrome\", \"categorical\", \"semantic\"]).optional(),\n showLegend: z.boolean().optional(),\n height: z.number().optional(),\n unit: z.string().optional(),\n }),\n slots: [],\n description:\n \"Donut chart with optional legend and Anvil2 theme. data: [{category, value}]. theme: monochrome (≤4 vars), categorical (5-9 distinct), semantic (status values).\",\n};\n","import { z } from \"zod\";\n\nexport const flexCatalog = {\n props: z.object({\n direction: z.enum([\"row\", \"column\"]).optional(),\n gap: z.enum([\"0\", \"half\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"8\", \"12\"]).optional(),\n alignItems: z.enum([\"center\", \"flex-start\", \"flex-end\", \"stretch\", \"baseline\"]).optional(),\n justifyContent: z\n .enum([\"center\", \"flex-start\", \"flex-end\", \"space-between\", \"space-around\", \"space-evenly\"])\n .optional(),\n alignSelf: z\n .enum([\"auto\", \"center\", \"flex-start\", \"flex-end\", \"stretch\", \"baseline\"])\n .optional(),\n wrap: z.enum([\"wrap\", \"nowrap\", \"wrap-reverse\"]).optional(),\n grow: z.number().optional(),\n shrink: z.number().optional(),\n basis: z.string().optional(),\n inline: z.boolean().optional(),\n }),\n slots: [\"default\"],\n description:\n 'Flex layout container. direction: row (default) | column — always set column when stacking children vertically. gap (spacing token, ~4px per step): half=2px 1=4px 2=8px 3=12px 4=16px 5=20px 6=24px 8=32px 12=48px. alignItems: cross-axis alignment of children. justifyContent: main-axis distribution. When this Flex is itself a child of another Flex, use grow (1=fill available space), shrink, basis (CSS flex-basis e.g. \"200px\"), and alignSelf to control how it flexes.',\n};\n","import { z } from \"zod\";\n\nexport const gridCatalog = {\n props: z.object({\n templateColumns: z.string().optional(),\n gap: z.enum([\"0\", \"half\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"8\", \"12\"]).optional(),\n bordered: z.boolean().optional(),\n }),\n slots: [\"default\"],\n description:\n 'CSS Grid layout. templateColumns: CSS grid-template-columns value — \"repeat(3, 1fr)\" for equal columns, \"200px 1fr\" for fixed+flex two-column (e.g. key-value tables), \"1fr 1fr 80px\" for multi-column tables. Children flow into grid cells left-to-right, top-to-bottom. gap (spacing token, ~4px per step): 1=4px 2=8px … 6=24px 8=32px 12=48px (default 2). bordered: true renders a bordered table with row separators and cell padding — use for key-value and data tables.',\n};\n","import { z } from \"zod\";\n\nexport const iconCatalog = {\n props: z.object({\n name: z.enum([\"check-circle\", \"in-progress\", \"radio-button-unchecked\"]),\n size: z.enum([\"small\", \"medium\", \"large\", \"xlarge\"]).optional(),\n color: z.string().optional(),\n }),\n slots: [],\n description:\n \"Small status icon. name (only these three are available): check-circle=completed/success checkmark, in-progress=partial circle (active/working), radio-button-unchecked=empty circle (pending/not started). size: small | medium (default) | large | xlarge. color: any CSS color (defaults to the current text color). Commonly paired with status Text in lists and checklists.\",\n};\n","import { z } from \"zod\";\n\nexport const inputCatalog = {\n props: z.object({\n label: z.string(),\n placeholder: z.string().optional(),\n type: z.enum([\"text\", \"password\", \"email\", \"tel\", \"url\", \"number\"]).optional(),\n value: z.string().optional(),\n disabled: z.boolean().optional(),\n }),\n slots: [],\n events: [\"change\"],\n description:\n 'Free-text input field for user-typed values (names, notes, numbers, etc). type: text (default), password (masked), email, tel (phone), url, number. Bind value with $bindState so the typed value is captured in state; emits a \"change\" event on every keystroke. Prefer this over Listbox when the value is not from a fixed list. disabled: true prevents editing.',\n};\n","import { z } from \"zod\";\n\nexport const lineChartCatalog = {\n props: z.object({\n data: z.array(z.record(z.string(), z.union([z.string(), z.number()]))),\n series: z.array(z.string()).optional(),\n theme: z.enum([\"monochrome\", \"categorical\", \"semantic\"]).optional(),\n showLegend: z.boolean().optional(),\n showDots: z.boolean().optional(),\n height: z.number().optional(),\n unit: z.string().optional(),\n }),\n slots: [],\n description:\n 'Line chart for tracking trends over time with optional multiple series. data: array of objects with a \"category\" key (x-axis label) and one numeric key per series (e.g. [{category: \"Jan\", revenue: 100, cost: 60}]). series: explicit list of series keys to plot (inferred from data keys if omitted, max 6). theme: monochrome (1-2 series), categorical (3-6 distinct). showLegend: true when multiple series (default true for 2+ series). showDots: true adds data-point markers (default true). unit: tooltip value suffix.',\n};\n","import { z } from \"zod\";\n\nexport const linkCatalog = {\n props: z.object({\n label: z.string(),\n href: z.string(),\n appearance: z.enum([\"primary\", \"secondary\"]).optional(),\n target: z.enum([\"_blank\", \"_self\"]).optional(),\n ghost: z.boolean().optional(),\n badge: z.string().optional(),\n }),\n slots: [],\n events: [\"press\"],\n description:\n 'Inline navigation link (renders an <a>). Emits a \"press\" event when clicked — handle navigation in on.press; href and target are inputs for the host/router rather than native browser navigation. href: destination URL for the host/router. appearance: primary (default) | secondary. target: _blank marks the link as external (shows external-link icon) and lets the host open a new tab if desired. ghost: quieter styling (primary only). badge: optional notification count shown as a superscript (e.g. \"5\"); use an empty string for a dot-only indicator.',\n};\n","import { z } from \"zod\";\n\nexport const listboxCatalog = {\n props: z.object({\n label: z.string(),\n options: z.array(z.object({ value: z.string(), label: z.string() })),\n value: z.string().optional(),\n disabled: z.boolean().optional(),\n }),\n slots: [],\n events: [\"change\"],\n description:\n 'Single-select dropdown for choosing one value from a fixed list of known options. options: [{ value, label }] — value is stored in state, label is shown. Bind the selection with $bindState on value; emits a \"change\" event on selection. Use only when options are predefined; for free-text user input use Input, and for 2–7 visible mutually-exclusive choices prefer RadioGroup. disabled: true prevents selection.',\n};\n","import { z } from \"zod\";\n\nexport const progressBarCatalog = {\n props: z.object({\n label: z.string(),\n value: z.number().min(0).max(100).optional(),\n description: z.string().optional(),\n indeterminate: z.boolean().optional(),\n }),\n slots: [],\n description:\n \"Horizontal progress bar showing task completion. label is required (the accessible name for the bar). value: 0–100 percentage filled. Omit value and set indeterminate=true when progress cannot be measured (do not set both). description: optional helper text shown below the bar.\",\n};\n","import { z } from \"zod\";\n\nexport const radioGroupCatalog = {\n props: z.object({\n label: z.string(),\n options: z.array(z.object({ value: z.string(), label: z.string() })),\n value: z.string().optional(),\n disabled: z.boolean().optional(),\n }),\n slots: [],\n events: [\"change\"],\n description:\n 'Group of radio buttons for picking one option from 2–7 visible mutually-exclusive choices. options: [{ value, label }]. Bind the selection with $bindState on value; emits a \"change\" event on selection. For longer option lists use Listbox. disabled: true prevents selection.',\n};\n","import { z } from \"zod\";\n\nexport const switchCatalog = {\n props: z.object({\n label: z.string(),\n checked: z.boolean().optional(),\n disabled: z.boolean().optional(),\n }),\n slots: [],\n events: [\"change\"],\n description:\n 'Toggle switch for a single binary on/off setting with immediate effect (no form submit). Prefer over Checkbox for enabling/disabling features. Bind state with $bindState on checked; emits a \"change\" event when toggled. disabled: true prevents toggling.',\n};\n","import { z } from \"zod\";\n\nexport const textCatalog = {\n props: z.object({\n content: z.string(),\n variant: z.enum([\"headline\", \"body\", \"eyebrow\"]).optional(),\n size: z.enum([\"small\", \"medium\", \"large\", \"xlarge\"]).optional(),\n subdued: z.boolean().optional(),\n }),\n slots: [],\n description:\n \"Display text. variant: headline=bold title, eyebrow=small uppercase label, body=default (default variant). size: small | medium (default) | large | xlarge — applies to headline and body only (ignored for eyebrow). subdued: deemphasized secondary text (body only). Use eyebrow+headline pairs for KPI/stat labels above values.\",\n};\n","import { z } from \"zod\";\n\nexport const textareaCatalog = {\n props: z.object({\n label: z.string(),\n placeholder: z.string().optional(),\n description: z.string().optional(),\n moreInfo: z.string().optional(),\n value: z.string().optional(),\n rows: z.number().optional(),\n disabled: z.boolean().optional(),\n }),\n slots: [],\n events: [\"change\"],\n description:\n 'Multi-line free-text input for long values (notes, descriptions, email body). Bind value with $bindState; emits a \"change\" event on every keystroke. rows: visible row count (default 3). description: helper text below the field. moreInfo: tooltip text on the label. disabled: true prevents editing.',\n};\n","import { alertCatalog } from \"./alert.catalog\";\nimport { barChartCatalog } from \"./bar-chart.catalog\";\nimport { buttonCatalog } from \"./button.catalog\";\nimport { cardCatalog } from \"./card.catalog\";\nimport { checkboxCatalog } from \"./checkbox.catalog\";\nimport { chipCatalog } from \"./chip.catalog\";\nimport { dividerCatalog } from \"./divider.catalog\";\nimport { donutChartCatalog } from \"./donut-chart.catalog\";\nimport { flexCatalog } from \"./flex.catalog\";\nimport { gridCatalog } from \"./grid.catalog\";\nimport { iconCatalog } from \"./icon.catalog\";\nimport { inputCatalog } from \"./input.catalog\";\nimport { lineChartCatalog } from \"./line-chart.catalog\";\nimport { linkCatalog } from \"./link.catalog\";\nimport { listboxCatalog } from \"./listbox.catalog\";\nimport { progressBarCatalog } from \"./progress-bar.catalog\";\nimport { radioGroupCatalog } from \"./radio-group.catalog\";\nimport { switchCatalog } from \"./switch.catalog\";\nimport { textCatalog } from \"./text.catalog\";\nimport { textareaCatalog } from \"./textarea.catalog\";\n\nexport const baseComponents = {\n Text: textCatalog,\n Card: cardCatalog,\n Flex: flexCatalog,\n Grid: gridCatalog,\n Alert: alertCatalog,\n Divider: dividerCatalog,\n Icon: iconCatalog,\n Chip: chipCatalog,\n Link: linkCatalog,\n ProgressBar: progressBarCatalog,\n BarChart: barChartCatalog,\n DonutChart: donutChartCatalog,\n LineChart: lineChartCatalog,\n Button: buttonCatalog,\n Checkbox: checkboxCatalog,\n Input: inputCatalog,\n Textarea: textareaCatalog,\n Listbox: listboxCatalog,\n RadioGroup: radioGroupCatalog,\n Switch: switchCatalog,\n};\n","import { type Catalog, defineCatalog } from \"@json-render/core\";\nimport { schema } from \"@json-render/react/schema\";\nimport type { z } from \"zod\";\n\nimport { actionsCatalog } from \"./core/actions\";\nimport { baseComponents } from \"./core/catalog/schemas\";\n\nexport interface ComponentCatalogDef {\n props: z.ZodType;\n slots: string[];\n description: string;\n /**\n * Events this component emits, surfaced to the LLM as `[events: ...]` in the\n * generated prompt so it knows which event names are valid in an element's\n * `on` map (e.g. `{ \"press\": { \"action\": \"...\" } }`).\n */\n events?: string[];\n}\n\nexport interface ActionCatalogDef {\n params: z.ZodType;\n description: string;\n}\n\n/** Names of the components available in the core catalog. */\nexport type CoreComponentName = keyof typeof baseComponents;\n\n/** Replace or append to a component's catalog description (prompt + JSON schema). */\nexport interface DescriptionOverride {\n /** Replace the component's description entirely. */\n description?: string;\n /** Append to the existing description (joined with a space). */\n append?: string;\n}\n\nexport interface ComposeCatalogComponentsOptions {\n /** Core components to include: an array of names, or \"all\" (default). */\n core?: CoreComponentName[] | \"all\";\n /** Per-component description overrides/appends — applies to core and own components. */\n overrides?: Partial<Record<string, DescriptionOverride>>;\n /** This catalog's own (non-core) components. */\n components?: Record<string, ComponentCatalogDef>;\n}\n\n/**\n * Build the component map for a catalog: pick a subset of core components (or\n * all), merge in the catalog's own components, and apply per-component\n * description overrides. Descriptions feed both `defineCatalog(...).prompt()`\n * and `.jsonSchema()`, so this controls what an agent sees for the catalog.\n *\n * Overrides are applied immutably — the shared `baseComponents` definitions\n * (also used by the core catalog/registry) are never mutated.\n */\nexport function composeCatalogComponents(\n opts: ComposeCatalogComponentsOptions = {},\n): Record<string, ComponentCatalogDef> {\n const { core = \"all\", overrides = {}, components = {} } = opts;\n\n const selectedCore: Record<string, ComponentCatalogDef> =\n core === \"all\"\n ? { ...baseComponents }\n : Object.fromEntries(\n core.map((name) => {\n const def = baseComponents[name];\n if (!def) {\n throw new Error(`Unknown core component: ${String(name)}`);\n }\n return [name, def];\n }),\n );\n\n const merged: Record<string, ComponentCatalogDef> = { ...selectedCore, ...components };\n\n for (const [name, override] of Object.entries(overrides)) {\n const def = merged[name];\n if (!def || !override) {\n continue;\n }\n const description =\n override.description ??\n (override.append ? `${def.description} ${override.append}` : def.description);\n merged[name] = { ...def, description };\n }\n\n return merged;\n}\n\nexport interface ScopedCatalogDef {\n prefix: string;\n components?: Record<string, ComponentCatalogDef>;\n actions?: Record<string, ActionCatalogDef>;\n /** Core components to include: an array of names, or \"all\" (default). */\n core?: CoreComponentName[] | \"all\";\n /** Per-component description overrides/appends — applies to core and own components. */\n overrides?: Partial<Record<string, DescriptionOverride>>;\n /** Appended to base rules in generated prompt */\n rules?: string;\n}\n\nexport interface MergedCatalog {\n prefix: string;\n catalog: Catalog;\n prompt(baseRules: string): string;\n jsonSchema(): object;\n}\n\nexport function createScopedCatalog(def: ScopedCatalogDef): ScopedCatalogDef {\n return def;\n}\n\nexport function mergeCatalogs(scopedDef: ScopedCatalogDef): MergedCatalog {\n const mergedComponents = composeCatalogComponents({\n core: scopedDef.core ?? \"all\",\n ...(scopedDef.overrides ? { overrides: scopedDef.overrides } : {}),\n ...(scopedDef.components ? { components: scopedDef.components } : {}),\n });\n\n const prefixedScopedActions = Object.fromEntries(\n Object.entries(scopedDef.actions ?? {}).map(([key, val]) => [\n `${scopedDef.prefix}.${key}`,\n val,\n ]),\n );\n\n const mergedActions = {\n ...actionsCatalog,\n ...prefixedScopedActions,\n } as Record<string, ActionCatalogDef>;\n\n const mergedCatalog = defineCatalog(schema, {\n components: mergedComponents,\n actions: mergedActions,\n });\n\n return {\n prefix: scopedDef.prefix,\n catalog: mergedCatalog,\n prompt(baseRules: string): string {\n const parts = [mergedCatalog.prompt(), \"\\n\", baseRules];\n if (scopedDef.rules) {\n parts.push(\"\\n\", scopedDef.rules);\n }\n return parts.join(\"\");\n },\n jsonSchema(): object {\n return mergedCatalog.jsonSchema();\n },\n };\n}\n","import { defineCatalog } from \"@json-render/core\";\nimport { schema } from \"@json-render/react/schema\";\n\nimport { actionsCatalog } from \"../../core/actions\";\nimport {\n type CoreComponentName,\n composeCatalogComponents,\n type DescriptionOverride,\n} from \"../../scoped-catalog\";\n\nimport { contextContentComponents, contextShellComponents } from \"./schemas\";\n\nexport { contextContentComponents, contextShellComponents };\n\n/**\n * Core components the agent may use inside a context panel. Context surfaces are\n * read-only and composed from the Context* primitives, so charts, form inputs,\n * Button, Card, Flex, Grid, Badge, and ProgressBar are intentionally excluded.\n */\nconst CONTEXT_CORE_COMPONENTS: CoreComponentName[] = [\"Text\", \"Chip\", \"Link\", \"Alert\"];\n\nconst CONTEXT_CORE_OVERRIDES: Partial<Record<string, DescriptionOverride>> = {\n Link: {\n append:\n \"In a context panel, links appear inside content primitives (ContextList, ContextTabularList identifier links, ContextNoteList, etc.); use a standalone Link only for inline references within rich text.\",\n },\n};\n\nexport const contextComponents = composeCatalogComponents({\n core: CONTEXT_CORE_COMPONENTS,\n overrides: CONTEXT_CORE_OVERRIDES,\n components: { ...contextShellComponents, ...contextContentComponents },\n});\n\nexport const contextCatalog = defineCatalog(schema, {\n components: contextComponents,\n actions: actionsCatalog,\n});\n","import type { CatalogEntry } from \"../../types\";\nimport { ContextCardRenderer } from \"./context-card\";\nimport { ContextDataTableRenderer } from \"./context-data-table\";\nimport { ContextFileListRenderer } from \"./context-file-list\";\nimport { ContextListRenderer } from \"./context-list\";\nimport { ContextMetricGridRenderer } from \"./context-metric-grid\";\nimport { ContextNoteListRenderer } from \"./context-note-list\";\nimport { ContextOverviewRenderer } from \"./context-overview\";\nimport { ContextPanelRenderer } from \"./context-panel\";\nimport { ContextTabularListRenderer } from \"./context-tabular-list\";\nimport { contextContentComponents, contextShellComponents } from \"./schemas\";\n\nexport { contextCatalog, contextComponents, contextShellComponents } from \"./catalog-def\";\nexport { contextContentComponents } from \"./schemas\";\n\nexport const contextCatalogEntries: CatalogEntry[] = [\n {\n name: \"ContextPanel\",\n catalog: contextShellComponents.ContextPanel,\n renderer: ContextPanelRenderer,\n renderers: [\"context\"],\n },\n {\n name: \"ContextOverview\",\n catalog: contextShellComponents.ContextOverview,\n renderer: ContextOverviewRenderer,\n renderers: [\"context\"],\n },\n {\n name: \"ContextCard\",\n catalog: contextShellComponents.ContextCard,\n renderer: ContextCardRenderer,\n renderers: [\"context\"],\n },\n {\n name: \"ContextNoteList\",\n catalog: contextContentComponents.ContextNoteList,\n renderer: ContextNoteListRenderer,\n renderers: [\"context\"],\n },\n {\n name: \"ContextMetricGrid\",\n catalog: contextContentComponents.ContextMetricGrid,\n renderer: ContextMetricGridRenderer,\n renderers: [\"context\"],\n },\n {\n name: \"ContextDataTable\",\n catalog: contextContentComponents.ContextDataTable,\n renderer: ContextDataTableRenderer,\n renderers: [\"context\"],\n },\n {\n name: \"ContextList\",\n catalog: contextContentComponents.ContextList,\n renderer: ContextListRenderer,\n renderers: [\"context\"],\n },\n {\n name: \"ContextTabularList\",\n catalog: contextContentComponents.ContextTabularList,\n renderer: ContextTabularListRenderer,\n renderers: [\"context\"],\n },\n {\n name: \"ContextFileList\",\n catalog: contextContentComponents.ContextFileList,\n renderer: ContextFileListRenderer,\n renderers: [\"context\"],\n },\n];\n\nexport const contextShellRenderers = Object.fromEntries(\n contextCatalogEntries\n .filter(({ name }) => name in contextShellComponents)\n .map(({ name, renderer }) => [name, renderer]),\n);\n\nexport const contextContentRenderers = Object.fromEntries(\n contextCatalogEntries\n .filter(({ name }) => name in contextContentComponents)\n .map(({ name, renderer }) => [name, renderer]),\n);\n","export const CONTEXT_SHELL_TYPES = [\"ContextPanel\", \"ContextOverview\", \"ContextCard\"] as const;\n\nexport type ContextShellType = (typeof CONTEXT_SHELL_TYPES)[number];\n\nexport const CONTEXT_TOP_LEVEL_TYPES = [\"ContextOverview\", \"ContextCard\"] as const;\n\nexport type ContextTopLevelType = (typeof CONTEXT_TOP_LEVEL_TYPES)[number];\n\nexport function isContextShellType(type: string): type is ContextShellType {\n return (CONTEXT_SHELL_TYPES as readonly string[]).includes(type);\n}\n\nexport function isContextTopLevelType(type: string): type is ContextTopLevelType {\n return (CONTEXT_TOP_LEVEL_TYPES as readonly string[]).includes(type);\n}\n","import type { Spec } from \"@json-render/core\";\n\nimport {\n CONTEXT_SHELL_TYPES,\n CONTEXT_TOP_LEVEL_TYPES,\n isContextShellType,\n isContextTopLevelType,\n} from \"./constants\";\n\nexport interface ContextSpecIssue {\n path: string;\n message: string;\n severity?: ContextSpecIssueSeverity;\n}\n\nexport type ContextSpecIssueSeverity = \"error\" | \"warn\";\n\nfunction getElement(spec: Spec, key: string) {\n const elements = spec.elements as Record<\n string,\n { type: string; children?: string[] } | undefined\n >;\n return elements[key];\n}\n\nfunction collectDescendantKeys(\n spec: Spec,\n rootKey: string,\n visited = new Set<string>(),\n): Set<string> {\n const element = getElement(spec, rootKey);\n if (!element || visited.has(rootKey)) {\n return visited;\n }\n\n visited.add(rootKey);\n for (const childKey of element.children ?? []) {\n collectDescendantKeys(spec, childKey, visited);\n }\n\n return visited;\n}\n\nexport function validateContextSpec(spec: Spec): ContextSpecIssue[] {\n const issues: ContextSpecIssue[] = [];\n const rootKey = spec.root;\n const root = getElement(spec, rootKey);\n\n if (!root) {\n issues.push({ path: \"/root\", message: \"Root element is missing from elements map.\" });\n return issues;\n }\n\n if (root.type !== \"ContextPanel\") {\n issues.push({\n path: `/elements/${rootKey}`,\n message: `Root must be ContextPanel, got \"${root.type}\".`,\n });\n return issues;\n }\n\n let overviewCount = 0;\n\n for (const childKey of root.children ?? []) {\n const child = getElement(spec, childKey);\n if (!child) {\n issues.push({\n path: `/elements/${childKey}`,\n message: `Child \"${childKey}\" referenced by ContextPanel is missing.`,\n });\n continue;\n }\n\n if (!isContextTopLevelType(child.type)) {\n issues.push({\n path: `/elements/${childKey}`,\n message: `Direct child of ContextPanel must be ContextOverview or ContextCard — got \"${child.type}\".`,\n });\n continue;\n }\n\n if (child.type === \"ContextOverview\") {\n overviewCount += 1;\n if (overviewCount > 1) {\n issues.push({\n path: `/elements/${childKey}`,\n message: \"ContextOverview may appear at most once in ContextPanel.\",\n });\n }\n }\n\n for (const descendantKey of collectDescendantKeys(spec, childKey)) {\n if (descendantKey === childKey) {\n continue;\n }\n\n const descendant = getElement(spec, descendantKey);\n if (descendant && isContextShellType(descendant.type)) {\n issues.push({\n path: `/elements/${descendantKey}`,\n message: `Shell component \"${descendant.type}\" cannot be nested inside a card.`,\n });\n }\n }\n }\n\n return issues;\n}\n\nexport function formatContextSpecIssues(issues: ContextSpecIssue[]): string {\n return issues\n .map((issue) => {\n const severity = issue.severity ?? \"error\";\n return `${severity.toUpperCase()} ${issue.path}: ${issue.message}`;\n })\n .join(\"\\n\");\n}\n\nexport { CONTEXT_SHELL_TYPES, CONTEXT_TOP_LEVEL_TYPES };\n","import type { Spec } from \"@json-render/core\";\nimport { validateSpec } from \"@json-render/core\";\nimport type { z } from \"zod\";\n\nimport { contextCatalog, contextComponents } from \"./catalog/catalog-def\";\nimport {\n type ContextSpecIssue,\n type ContextSpecIssueSeverity,\n formatContextSpecIssues,\n validateContextSpec,\n} from \"./validate-context-spec\";\n\ntype CatalogComponent = {\n props?: z.ZodType;\n slots?: string[];\n};\n\nfunction pushIssue(\n issues: ContextSpecIssue[],\n path: string,\n message: string,\n severity: ContextSpecIssueSeverity,\n) {\n issues.push({ path, message, severity });\n}\n\nfunction formatZodPath(basePath: string, zodPath: PropertyKey[]): string {\n if (zodPath.length === 0) {\n return basePath;\n }\n\n const suffix = zodPath\n .map((segment) => (typeof segment === \"number\" ? `[${segment}]` : `.${String(segment)}`))\n .join(\"\")\n .replace(/^\\./, \"\");\n\n return `${basePath}/${suffix}`;\n}\n\nfunction getCatalogEntry(type: string): CatalogComponent | undefined {\n return contextComponents[type as keyof typeof contextComponents] as CatalogComponent | undefined;\n}\n\nfunction isLeafComponent(catalogEntry: CatalogComponent | undefined): boolean {\n return (catalogEntry?.slots?.length ?? 0) === 0;\n}\n\nfunction addAgentUxHints(spec: Spec, issues: ContextSpecIssue[]) {\n for (const [key, element] of Object.entries(spec.elements)) {\n if (!element) {\n continue;\n }\n\n if (element.type === \"ContextCard\") {\n const props = element.props as { defaultExpanded?: boolean };\n if (props.defaultExpanded === false) {\n pushIssue(\n issues,\n `/elements/${key}/props/defaultExpanded`,\n \"defaultExpanded: false shows only the card header until the user expands the card.\",\n \"warn\",\n );\n }\n }\n }\n}\n\nexport function validateContextSpecDeep(spec: Spec): ContextSpecIssue[] {\n const issues: ContextSpecIssue[] = [];\n\n for (const issue of validateContextSpec(spec)) {\n pushIssue(issues, issue.path, issue.message, \"error\");\n }\n\n const structural = validateSpec(spec);\n if (!structural.valid) {\n for (const issue of structural.issues) {\n const path = issue.elementKey ? `/elements/${issue.elementKey}` : \"/\";\n pushIssue(issues, path, issue.message, issue.severity === \"warning\" ? \"warn\" : \"error\");\n }\n }\n\n const catalogValidation = contextCatalog.validate(spec);\n if (!catalogValidation.success && catalogValidation.error) {\n for (const issue of catalogValidation.error.issues) {\n const path = issue.path.length > 0 ? `/${issue.path.join(\"/\")}` : \"/\";\n if (path.endsWith(\"/visible\")) {\n continue;\n }\n if (\n path.endsWith(\"/children\") &&\n issue.message.includes(\"expected array, received undefined\")\n ) {\n continue;\n }\n pushIssue(issues, path, issue.message, \"error\");\n }\n }\n\n for (const [key, element] of Object.entries(spec.elements)) {\n if (!element) {\n continue;\n }\n\n const catalogEntry = getCatalogEntry(element.type);\n if (!catalogEntry) {\n pushIssue(\n issues,\n `/elements/${key}`,\n `Unknown component type \"${element.type}\" for context catalog.`,\n \"error\",\n );\n continue;\n }\n\n if (catalogEntry.props) {\n const propsResult = catalogEntry.props.safeParse(element.props ?? {});\n if (!propsResult.success) {\n for (const issue of propsResult.error.issues) {\n pushIssue(\n issues,\n formatZodPath(`/elements/${key}/props`, issue.path),\n issue.message,\n \"error\",\n );\n }\n }\n }\n\n const childKeys = element.children;\n const leaf = isLeafComponent(catalogEntry);\n\n if (childKeys === undefined && leaf) {\n pushIssue(\n issues,\n `/elements/${key}/children`,\n `Leaf element \"${element.type}\" should include \"children\": [].`,\n \"warn\",\n );\n }\n\n if (leaf && (childKeys?.length ?? 0) > 0) {\n pushIssue(\n issues,\n `/elements/${key}/children`,\n `Leaf component \"${element.type}\" must not have children.`,\n \"error\",\n );\n }\n }\n\n addAgentUxHints(spec, issues);\n\n return issues;\n}\n\nexport function postProcessContextSpec(spec: Spec): { spec: Spec; fixes: string[] } {\n const fixes: string[] = [];\n const next = structuredClone(spec) as Spec;\n\n for (const [key, element] of Object.entries(next.elements)) {\n if (!element) {\n continue;\n }\n\n const catalogEntry = getCatalogEntry(element.type);\n const leaf = isLeafComponent(catalogEntry);\n\n if (element.children === undefined && leaf) {\n element.children = [];\n fixes.push(`Added children: [] to leaf element \"${key}\".`);\n }\n\n if (leaf && element.children && element.children.length > 0) {\n element.children = [];\n fixes.push(`Removed illegal children from leaf element \"${key}\".`);\n }\n }\n\n return { spec: next, fixes };\n}\n\nexport function hasContextSpecErrors(issues: ContextSpecIssue[]): boolean {\n return issues.some((issue) => issue.severity !== \"warn\");\n}\n\nexport function formatContextRenderReport(spec: Spec): string {\n const issues = validateContextSpecDeep(spec);\n return formatContextSpecIssues(issues);\n}\n","import { Alert } from \"@servicetitan/anvil2\";\nimport type { ReactNode } from \"react\";\nimport type { z } from \"zod\";\n\nimport { alertCatalog } from \"./alert.catalog\";\n\nexport { alertCatalog };\n\nexport const AlertRenderer = ({\n props,\n emit,\n children,\n}: {\n props: z.infer<typeof alertCatalog.props>;\n emit: (event: string) => void;\n children?: ReactNode;\n}) => (\n <Alert\n title={props.title}\n status={props.status ?? \"info\"}\n {...(props.aiMark ? { aiMark: true } : {})}\n {...(props.dismissible ? { onClose: () => emit(\"close\") } : {})}\n >\n {children}\n </Alert>\n);\n","import { style } from \"@vanilla-extract/css\";\n\nexport const chartContainer = style({\n width: \"100%\",\n});\n","import type * as am5 from \"@amcharts/amcharts5\";\nimport am5themes_Animated from \"@amcharts/amcharts5/themes/Animated\";\nimport {\n ThemeCategorical,\n ThemeMonochrome,\n ThemeSemantic,\n} from \"@servicetitan/anvil2-ext-charts/am5\";\n\nexport function applyChartTheme(root: am5.Root, theme: string = \"monochrome\") {\n const themeMap: Record<string, typeof am5.Theme> = {\n monochrome: ThemeMonochrome,\n categorical: ThemeCategorical,\n semantic: ThemeSemantic,\n };\n const T = themeMap[theme] ?? ThemeMonochrome;\n root.setThemes([am5themes_Animated.new(root), T.new(root)]);\n}\n","import * as am5 from \"@amcharts/amcharts5\";\nimport * as am5xy from \"@amcharts/amcharts5/xy\";\nimport { useEffect, useRef } from \"react\";\nimport type { z } from \"zod\";\n\nimport { barChartCatalog } from \"./bar-chart.catalog\";\nimport { chartContainer } from \"./chart.css\";\nimport { applyChartTheme } from \"./chart-utils\";\n\nexport { barChartCatalog };\n\nexport const BarChartRenderer = ({ props }: { props: z.infer<typeof barChartCatalog.props> }) => {\n const divRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const el = divRef.current;\n if (!el) {\n return;\n }\n\n let root: am5.Root | undefined;\n\n const init = () => {\n if (root) {\n root.dispose();\n }\n root = am5.Root.new(el);\n applyChartTheme(root, props.theme);\n const chart = root.container.children.push(am5xy.XYChart.new(root, { paddingLeft: 0 }));\n\n if (props.orientation === \"horizontal\") {\n const yAxis = chart.yAxes.push(\n am5xy.CategoryAxis.new(root, {\n categoryField: \"category\",\n renderer: am5xy.AxisRendererY.new(root, { minGridDistance: 20 }),\n }),\n );\n const xAxis = chart.xAxes.push(\n am5xy.ValueAxis.new(root, {\n renderer: am5xy.AxisRendererX.new(root, {}),\n }),\n );\n const series = chart.series.push(\n am5xy.ColumnSeries.new(root, {\n xAxis,\n yAxis,\n valueXField: \"value\",\n categoryYField: \"category\",\n }),\n );\n series.columns.template.setAll({\n tooltipText: `{categoryY}: ${props.unit ?? \"\"}{valueX}`,\n });\n yAxis.data.setAll(props.data);\n series.data.setAll(props.data);\n } else {\n const xAxis = chart.xAxes.push(\n am5xy.CategoryAxis.new(root, {\n categoryField: \"category\",\n renderer: am5xy.AxisRendererX.new(root, { minGridDistance: 30 }),\n }),\n );\n const yAxis = chart.yAxes.push(\n am5xy.ValueAxis.new(root, {\n renderer: am5xy.AxisRendererY.new(root, {}),\n }),\n );\n const series = chart.series.push(\n am5xy.ColumnSeries.new(root, {\n xAxis,\n yAxis,\n valueYField: \"value\",\n categoryXField: \"category\",\n }),\n );\n series.columns.template.setAll({\n tooltipText: `{categoryX}: ${props.unit ?? \"\"}{valueY}`,\n });\n xAxis.data.setAll(props.data);\n series.data.setAll(props.data);\n }\n };\n\n // Defer init until the element has a real width\n const observer = new ResizeObserver((entries) => {\n const width = entries[0]?.contentRect.width ?? 0;\n if (width > 0 && !root) {\n init();\n }\n });\n observer.observe(el);\n\n // Also try immediately in case it's already laid out\n if (el.offsetWidth > 0) {\n init();\n }\n\n return () => {\n observer.disconnect();\n root?.dispose();\n };\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n return <div ref={divRef} className={chartContainer} style={{ height: props.height ?? 300 }} />;\n};\n","type DefinedProps<T extends Record<string, unknown>> = {\n [K in keyof T as T[K] extends undefined ? never : K]: Exclude<T[K], undefined>;\n};\n\n/** Omit keys whose values are `undefined` — required for exactOptionalPropertyTypes spreads. */\nexport function definedProps<T extends Record<string, unknown>>(props: T): DefinedProps<T> {\n const result = {} as DefinedProps<T>;\n for (const key of Object.keys(props) as Array<keyof T>) {\n const value = props[key];\n if (value !== undefined) {\n result[key as keyof DefinedProps<T>] = value as DefinedProps<T>[keyof DefinedProps<T>];\n }\n }\n return result;\n}\n","import { Badge, Button } from \"@servicetitan/anvil2\";\nimport type { z } from \"zod\";\n\nimport { definedProps } from \"../../utils/defined-props\";\nimport { buttonCatalog } from \"./button.catalog\";\n\nexport { buttonCatalog };\n\nexport const ButtonRenderer = ({\n props,\n emit,\n}: {\n props: z.infer<typeof buttonCatalog.props>;\n emit: (event: string) => void;\n}) => (\n <Button\n appearance={props.appearance ?? \"secondary\"}\n {...definedProps({\n size: props.size,\n loading: props.loading,\n disabled: props.disabled,\n })}\n onClick={() => emit(\"press\")}\n >\n {props.label}\n {props.badge !== undefined ? (\n <Badge aria-label={props.badge ? `${props.badge} unread` : \"unread\"}>{props.badge}</Badge>\n ) : null}\n </Button>\n);\n","import { Card, Flex, Text } from \"@servicetitan/anvil2\";\nimport type { ReactNode } from \"react\";\nimport type { z } from \"zod\";\n\nimport { definedProps } from \"../../utils/defined-props\";\nimport { cardCatalog } from \"./card.catalog\";\n\nexport { cardCatalog };\n\nexport const CardRenderer = ({\n props,\n children,\n}: {\n props: z.infer<typeof cardCatalog.props>;\n children?: ReactNode;\n}) => {\n const hasHeader = props.title !== undefined || props.description !== undefined;\n\n return (\n <Card\n flexDirection=\"column\"\n gap=\"3\"\n {...definedProps({ background: props.background, padding: props.padding })}\n >\n {hasHeader ? (\n <Flex direction=\"column\" gap=\"half\">\n {props.title !== undefined ? (\n <Text variant=\"headline\" el=\"h3\" size=\"small\">\n {props.title}\n </Text>\n ) : null}\n {props.description !== undefined ? (\n <Text variant=\"body\" subdued>\n {props.description}\n </Text>\n ) : null}\n </Flex>\n ) : null}\n {children}\n </Card>\n );\n};\n","import { defineCatalog } from \"@json-render/core\";\nimport { schema } from \"@json-render/react/schema\";\n\nimport { actionsCatalog } from \"../actions\";\n\nimport { baseComponents } from \"./schemas\";\n\nexport { baseComponents };\n\nexport const catalog = defineCatalog(schema, {\n components: baseComponents,\n actions: actionsCatalog,\n});\n","import { getByPath } from \"@json-render/core\";\nimport { useStateStore } from \"@json-render/react\";\nimport { Checkbox } from \"@servicetitan/anvil2\";\nimport type { z } from \"zod\";\n\nimport { definedProps } from \"../../utils/defined-props\";\nimport { checkboxCatalog } from \"./checkbox.catalog\";\n\nexport { checkboxCatalog };\n\nexport const CheckboxRenderer = ({\n props,\n bindings,\n emit,\n}: {\n props: z.infer<typeof checkboxCatalog.props>;\n bindings?: Record<string, string>;\n emit: (event: string) => void;\n}) => {\n const bindingPath = bindings?.checked;\n const { state, set } = useStateStore();\n const stateChecked = bindingPath\n ? (getByPath(state, bindingPath) as boolean | undefined)\n : undefined;\n const checked = bindingPath ? (stateChecked ?? props.checked ?? false) : (props.checked ?? false);\n\n return (\n <Checkbox\n label={props.label}\n checked={checked}\n {...definedProps({ disabled: props.disabled })}\n onClick={(_e, state) => {\n if (bindingPath) {\n set(bindingPath, !(state?.checked ?? false));\n }\n emit(\"change\");\n }}\n />\n );\n};\n","import { Chip } from \"@servicetitan/anvil2\";\nimport CheckCircle from \"@servicetitan/anvil2/assets/icons/material/round/check_circle.svg\";\nimport RadioButtonUnchecked from \"@servicetitan/anvil2/assets/icons/material/round/radio_button_unchecked.svg\";\nimport InProgress from \"@servicetitan/anvil2/assets/icons/st/in_progress.svg\";\nimport type { z } from \"zod\";\n\nimport { definedProps } from \"../../utils/defined-props\";\nimport { chipCatalog } from \"./chip.catalog\";\n\nexport { chipCatalog };\n\nconst CHIP_ICON_MAP = {\n \"check-circle\": CheckCircle,\n \"in-progress\": InProgress,\n \"radio-button-unchecked\": RadioButtonUnchecked,\n} as const;\n\nexport const ChipRenderer = ({\n props,\n emit,\n}: {\n props: z.infer<typeof chipCatalog.props>;\n emit: (event: string) => void;\n}) => {\n const icon = props.icon ? CHIP_ICON_MAP[props.icon] : undefined;\n const onClose = props.removable && props.size !== \"small\" ? () => emit(\"close\") : undefined;\n return (\n <Chip\n label={props.label}\n {...definedProps({ size: props.size, color: props.color, icon, onClose })}\n />\n );\n};\n","import { Divider } from \"@servicetitan/anvil2\";\nimport type { z } from \"zod\";\n\nimport { definedProps } from \"../../utils/defined-props\";\nimport { dividerCatalog } from \"./divider.catalog\";\n\nexport { dividerCatalog };\n\nexport const DividerRenderer = ({ props }: { props: z.infer<typeof dividerCatalog.props> }) => (\n <Divider\n {...definedProps({\n vertical: props.vertical,\n spacing: props.spacing,\n alignContent: props.alignContent,\n })}\n />\n);\n","import * as am5 from \"@amcharts/amcharts5\";\nimport * as am5percent from \"@amcharts/amcharts5/percent\";\nimport { useEffect, useRef } from \"react\";\nimport type { z } from \"zod\";\nimport { chartContainer } from \"./chart.css\";\nimport { applyChartTheme } from \"./chart-utils\";\nimport { donutChartCatalog } from \"./donut-chart.catalog\";\n\nexport { donutChartCatalog };\n\nexport const DonutChartRenderer = ({\n props,\n}: {\n props: z.infer<typeof donutChartCatalog.props>;\n}) => {\n const divRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const el = divRef.current;\n if (!el) {\n return;\n }\n\n let root: am5.Root | undefined;\n\n const init = () => {\n if (root) {\n root.dispose();\n }\n root = am5.Root.new(el);\n applyChartTheme(root, props.theme);\n const chart = root.container.children.push(\n am5percent.PieChart.new(root, {\n layout: root.horizontalLayout,\n innerRadius: am5.percent(50),\n }),\n );\n const series = chart.series.push(\n am5percent.PieSeries.new(root, {\n valueField: \"value\",\n categoryField: \"category\",\n legendValueText: \"\",\n }),\n );\n series.labels.template.set(\"text\", \"{valuePercentTotal.formatNumber('#.')}%\");\n series.data.setAll(props.data);\n\n if (props.showLegend ?? true) {\n const legend = chart.children.push(\n am5.Legend.new(root, {\n centerY: am5.percent(50),\n y: am5.percent(50),\n layout: root.verticalLayout,\n }),\n );\n legend.data.setAll(series.dataItems);\n }\n };\n\n // Defer init until the element has a real width\n const observer = new ResizeObserver((entries) => {\n const width = entries[0]?.contentRect.width ?? 0;\n if (width > 0 && !root) {\n init();\n }\n });\n observer.observe(el);\n\n // Also try immediately in case it's already laid out\n if (el.offsetWidth > 0) {\n init();\n }\n\n return () => {\n observer.disconnect();\n root?.dispose();\n };\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n return <div ref={divRef} className={chartContainer} style={{ height: props.height ?? 300 }} />;\n};\n","import { Flex } from \"@servicetitan/anvil2\";\nimport type { ReactNode } from \"react\";\nimport type { z } from \"zod\";\n\nimport { definedProps } from \"../../utils/defined-props\";\nimport { flexCatalog } from \"./flex.catalog\";\n\nexport { flexCatalog };\n\nexport const FlexRenderer = ({\n props,\n children,\n}: {\n props: z.infer<typeof flexCatalog.props>;\n children?: ReactNode;\n}) => (\n <Flex\n {...definedProps({\n direction: props.direction,\n gap: props.gap,\n alignItems: props.alignItems,\n justifyContent: props.justifyContent,\n alignSelf: props.alignSelf,\n wrap: props.wrap,\n grow: props.grow,\n shrink: props.shrink,\n basis: props.basis,\n inline: props.inline,\n })}\n >\n {children}\n </Flex>\n);\n","/**\n * Join class names, dropping any falsy entry. The de-facto `clsx`-shaped\n * helper but kept dependency-free — vendored via `@carto-internal/tools` and\n * compiled into consuming packages at build time.\n */\nexport const cx = (...classes: Array<string | false | null | undefined>): string =>\n classes.filter(Boolean).join(\" \");\n","import { primitive, semantic } from \"@servicetitan/carto-react-kit/tokens\";\nimport { style } from \"@vanilla-extract/css\";\n\nexport const borderedGrid = style({\n display: \"grid\",\n borderWidth: primitive.size[\"25\"],\n borderStyle: \"solid\",\n borderColor: semantic.border.color.standard,\n borderRadius: semantic.radius.trim,\n overflow: \"hidden\",\n});\n\nexport const borderedGridCell = style({\n paddingBlock: primitive.size[\"200\"],\n paddingInline: primitive.size[\"300\"],\n});\n\n/** Row separator — omit on the last row so it does not stack on the container bottom edge. */\nexport const borderedGridRowDivider = style({\n borderBottomWidth: primitive.size[\"25\"],\n borderBottomStyle: \"solid\",\n borderBottomColor: semantic.border.color.standard,\n});\n","import { cx } from \"@carto-internal/tools/cx\";\nimport { Grid } from \"@servicetitan/anvil2\";\nimport { Children, type ReactNode } from \"react\";\nimport type { z } from \"zod\";\nimport { gridCatalog } from \"./grid.catalog\";\nimport { borderedGrid, borderedGridCell, borderedGridRowDivider } from \"./grid.css\";\n\nexport { gridCatalog };\n\n/** Best-effort column count for catalog templateColumns strings (e.g. `1fr 1fr`, `repeat(3, 1fr)`). */\nfunction estimateColumnCount(templateColumns: string): number {\n const repeatMatch = templateColumns.match(/repeat\\(\\s*(\\d+)/);\n if (repeatMatch?.[1]) {\n return Number(repeatMatch[1]);\n }\n return templateColumns.trim().split(/\\s+/).length;\n}\n\nexport const GridRenderer = ({\n props,\n children,\n}: {\n props: z.infer<typeof gridCatalog.props>;\n children?: ReactNode;\n}) => {\n if (props.bordered) {\n const templateColumns = props.templateColumns ?? \"1fr\";\n const childCount = Children.count(children);\n const columnCount = Math.max(1, estimateColumnCount(templateColumns));\n const lastRowStartIndex = Math.max(0, childCount - (childCount % columnCount || columnCount));\n\n return (\n <div className={borderedGrid} style={{ gridTemplateColumns: templateColumns }}>\n {Children.map(children, (child, index) => (\n <div\n className={cx(borderedGridCell, index < lastRowStartIndex && borderedGridRowDivider)}\n >\n {child}\n </div>\n ))}\n </div>\n );\n }\n\n return (\n <Grid templateColumns={props.templateColumns} gap={props.gap ?? \"2\"}>\n {children}\n </Grid>\n );\n};\n","import { Icon } from \"@servicetitan/anvil2\";\nimport CheckCircle from \"@servicetitan/anvil2/assets/icons/material/round/check_circle.svg\";\nimport RadioButtonUnchecked from \"@servicetitan/anvil2/assets/icons/material/round/radio_button_unchecked.svg\";\nimport InProgress from \"@servicetitan/anvil2/assets/icons/st/in_progress.svg\";\nimport type { ComponentProps } from \"react\";\nimport type { z } from \"zod\";\n\nimport { definedProps } from \"../../utils/defined-props\";\nimport { iconCatalog } from \"./icon.catalog\";\n\nexport { iconCatalog };\n\ntype IconName = z.infer<typeof iconCatalog.props>[\"name\"];\ntype IconSvg = NonNullable<ComponentProps<typeof Icon>[\"svg\"]>;\n\nconst SVG_MAP = {\n \"check-circle\": CheckCircle,\n \"in-progress\": InProgress,\n \"radio-button-unchecked\": RadioButtonUnchecked,\n} satisfies Record<IconName, IconSvg>;\n\nexport const IconRenderer = ({ props }: { props: z.infer<typeof iconCatalog.props> }) => {\n const svg = SVG_MAP[props.name];\n if (!svg) {\n return null;\n }\n return <Icon svg={svg} {...definedProps({ size: props.size, color: props.color })} />;\n};\n","import { getByPath } from \"@json-render/core\";\nimport { useStateStore } from \"@json-render/react\";\nimport { TextField } from \"@servicetitan/anvil2\";\nimport type { z } from \"zod\";\n\nimport { definedProps } from \"../../utils/defined-props\";\nimport { inputCatalog } from \"./input.catalog\";\n\nexport { inputCatalog };\n\nexport const InputRenderer = ({\n props,\n bindings,\n emit,\n}: {\n props: z.infer<typeof inputCatalog.props>;\n bindings?: Record<string, string>;\n emit: (event: string) => void;\n}) => {\n const bindingPath = bindings?.value;\n const { state, set } = useStateStore();\n const stateValue = bindingPath\n ? (getByPath(state, bindingPath) as string | undefined)\n : undefined;\n const value = bindingPath ? (stateValue ?? props.value ?? \"\") : (props.value ?? \"\");\n\n return (\n <TextField\n label={props.label}\n type={props.type ?? \"text\"}\n value={value}\n {...definedProps({ placeholder: props.placeholder, disabled: props.disabled })}\n onChange={(e) => {\n if (bindingPath) {\n set(bindingPath, e.target.value);\n }\n emit(\"change\");\n }}\n />\n );\n};\n","import * as am5 from \"@amcharts/amcharts5\";\nimport * as am5xy from \"@amcharts/amcharts5/xy\";\nimport { useEffect, useRef } from \"react\";\nimport type { z } from \"zod\";\nimport { chartContainer } from \"./chart.css\";\nimport { applyChartTheme } from \"./chart-utils\";\nimport { lineChartCatalog } from \"./line-chart.catalog\";\n\nexport { lineChartCatalog };\n\nexport const LineChartRenderer = ({ props }: { props: z.infer<typeof lineChartCatalog.props> }) => {\n const divRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const el = divRef.current;\n if (!el) {\n return;\n }\n\n let root: am5.Root | undefined;\n\n const init = () => {\n if (root) {\n root.dispose();\n }\n root = am5.Root.new(el);\n applyChartTheme(root, props.theme);\n\n const chart = root.container.children.push(am5xy.XYChart.new(root, { paddingLeft: 0 }));\n\n const xAxis = chart.xAxes.push(\n am5xy.CategoryAxis.new(root, {\n categoryField: \"category\",\n renderer: am5xy.AxisRendererX.new(root, { minGridDistance: 30 }),\n }),\n );\n\n const yAxis = chart.yAxes.push(\n am5xy.ValueAxis.new(root, {\n renderer: am5xy.AxisRendererY.new(root, {}),\n }),\n );\n\n const firstRow = props.data[0];\n const seriesKeys =\n props.series ?? (firstRow ? Object.keys(firstRow).filter((k) => k !== \"category\") : []);\n\n for (const key of seriesKeys) {\n const series = chart.series.push(\n am5xy.LineSeries.new(root, {\n name: key,\n xAxis,\n yAxis,\n valueYField: key,\n categoryXField: \"category\",\n tooltip: am5.Tooltip.new(root, {\n labelText: `${key}: ${props.unit ?? \"\"}{valueY}`,\n }),\n }),\n );\n\n series.strokes.template.setAll({ strokeWidth: 2 });\n\n if (props.showDots ?? true) {\n series.bullets.push(() => {\n if (!root) {\n throw new Error(\"Chart root is not initialized\");\n }\n const fill = series.get(\"fill\");\n return am5.Bullet.new(root, {\n sprite: am5.Circle.new(root, {\n radius: 4,\n ...(fill ? { fill } : {}),\n strokeWidth: 0,\n }),\n });\n });\n }\n\n series.data.setAll(props.data);\n }\n\n xAxis.data.setAll(props.data);\n\n const showLegend = props.showLegend ?? seriesKeys.length > 1;\n if (showLegend) {\n chart.children\n .push(\n am5.Legend.new(root, {\n centerX: am5.percent(50),\n x: am5.percent(50),\n marginTop: 8,\n }),\n )\n .data.setAll(chart.series.values);\n }\n };\n\n const observer = new ResizeObserver((entries) => {\n const width = entries[0]?.contentRect.width ?? 0;\n if (width > 0 && !root) {\n init();\n }\n });\n observer.observe(el);\n\n if (el.offsetWidth > 0) {\n init();\n }\n\n return () => {\n observer.disconnect();\n root?.dispose();\n };\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n return <div ref={divRef} className={chartContainer} style={{ height: props.height ?? 300 }} />;\n};\n","import { Badge, Link } from \"@servicetitan/anvil2\";\nimport type { MouseEvent } from \"react\";\nimport type { z } from \"zod\";\n\nimport { linkCatalog } from \"./link.catalog\";\n\nexport { linkCatalog };\n\nexport const LinkRenderer = ({\n props,\n emit,\n}: {\n props: z.infer<typeof linkCatalog.props>;\n emit: (event: string) => void;\n}) => {\n const { label, href, appearance, target, ghost, badge } = props;\n const onClick = (e: MouseEvent<HTMLAnchorElement>) => {\n e.preventDefault();\n emit(\"press\");\n };\n // The Anvil2 Badge is absolutely positioned and needs a positioned ancestor.\n // A Link renders an <a> that isn't position:relative on its own (unlike Button),\n // so wrap the label + badge in a relative inline anchor.\n const content =\n badge !== undefined ? (\n <span style={{ position: \"relative\", display: \"inline-flex\", alignItems: \"center\" }}>\n {label}\n <Badge aria-label={badge ? `${badge} unread` : \"unread\"} offset={{ x: \"8px\", y: \"0px\" }}>\n {badge}\n </Badge>\n </span>\n ) : (\n label\n );\n\n if (appearance === \"secondary\") {\n return (\n <Link\n appearance=\"secondary\"\n ghost={false}\n href={href}\n {...(target ? { target } : {})}\n onClick={onClick}\n >\n {content}\n </Link>\n );\n }\n\n if (ghost !== undefined) {\n return (\n <Link\n appearance=\"primary\"\n ghost={ghost}\n href={href}\n {...(target ? { target } : {})}\n onClick={onClick}\n >\n {content}\n </Link>\n );\n }\n\n return (\n <Link appearance=\"primary\" href={href} {...(target ? { target } : {})} onClick={onClick}>\n {content}\n </Link>\n );\n};\n","import { semantic } from \"@servicetitan/carto-react-kit/tokens\";\nimport { recipe } from \"@vanilla-extract/recipes\";\n\nexport const listboxWrapper = recipe({\n base: {},\n variants: {\n disabled: {\n true: {\n pointerEvents: \"none\",\n opacity: semantic.opacity.disabled,\n },\n false: {},\n },\n },\n});\n","import { getByPath } from \"@json-render/core\";\nimport { useStateStore } from \"@json-render/react\";\nimport { FieldLabel, Listbox } from \"@servicetitan/anvil2\";\nimport type { z } from \"zod\";\n\nimport { listboxCatalog } from \"./listbox.catalog\";\nimport { listboxWrapper } from \"./listbox.css\";\n\nexport { listboxCatalog };\n\nexport const ListboxRenderer = ({\n props,\n bindings,\n emit,\n}: {\n props: z.infer<typeof listboxCatalog.props>;\n bindings?: Record<string, string>;\n emit: (event: string) => void;\n}) => {\n const bindingPath = bindings?.value;\n const { state, set } = useStateStore();\n const stateSelected = bindingPath\n ? (getByPath(state, bindingPath) as string | undefined)\n : undefined;\n const selected = bindingPath ? (stateSelected ?? props.value ?? \"\") : (props.value ?? \"\");\n\n const items = props.options.map((o) => ({ id: o.value, label: o.label }));\n const selectedItem = items.find((i) => i.id === selected);\n\n return (\n <div className={listboxWrapper({ disabled: props.disabled ?? false })}>\n <FieldLabel>{props.label}</FieldLabel>\n <Listbox\n items={items}\n {...(selectedItem ? { selected: selectedItem } : {})}\n onSelectionChange={(item: { id: string } | undefined) => {\n const val = item?.id ?? \"\";\n if (bindingPath) {\n set(bindingPath, val);\n }\n emit(\"change\");\n }}\n >\n {({ items: renderedItems }: { items: typeof items }) =>\n renderedItems.map((item) => (\n <Listbox.Option key={item.id} item={item}>\n {item.label}\n </Listbox.Option>\n ))\n }\n </Listbox>\n </div>\n );\n};\n","import { ProgressBar } from \"@servicetitan/anvil2\";\nimport type { z } from \"zod\";\n\nimport { definedProps } from \"../../utils/defined-props\";\nimport { progressBarCatalog } from \"./progress-bar.catalog\";\n\nexport { progressBarCatalog };\n\nexport const ProgressBarRenderer = ({\n props,\n}: {\n props: z.infer<typeof progressBarCatalog.props>;\n}) => {\n const descriptionProps = definedProps({ description: props.description });\n\n if (props.indeterminate) {\n return <ProgressBar label={props.label} indeterminate {...descriptionProps} />;\n }\n\n if (props.value !== undefined) {\n return <ProgressBar label={props.label} value={props.value} {...descriptionProps} />;\n }\n\n return <ProgressBar label={props.label} indeterminate {...descriptionProps} />;\n};\n","import { getByPath } from \"@json-render/core\";\nimport { useStateStore } from \"@json-render/react\";\nimport { Radio } from \"@servicetitan/anvil2\";\nimport type { z } from \"zod\";\n\nimport { definedProps } from \"../../utils/defined-props\";\nimport { radioGroupCatalog } from \"./radio-group.catalog\";\n\nexport { radioGroupCatalog };\n\nexport const RadioGroupRenderer = ({\n props,\n bindings,\n emit,\n}: {\n props: z.infer<typeof radioGroupCatalog.props>;\n bindings?: Record<string, string>;\n emit: (event: string) => void;\n}) => {\n const bindingPath = bindings?.value;\n const { state, set } = useStateStore();\n const stateSelected = bindingPath\n ? (getByPath(state, bindingPath) as string | undefined)\n : undefined;\n const selected = bindingPath ? (stateSelected ?? props.value ?? \"\") : (props.value ?? \"\");\n\n return (\n <Radio.Group legend={props.label}>\n {props.options.map((o) => (\n <Radio\n key={o.value}\n label={o.label}\n value={o.value}\n checked={selected === o.value}\n {...definedProps({ disabled: props.disabled })}\n onChange={() => {\n if (bindingPath) {\n set(bindingPath, o.value);\n }\n emit(\"change\");\n }}\n />\n ))}\n </Radio.Group>\n );\n};\n","import { getByPath } from \"@json-render/core\";\nimport { useStateStore } from \"@json-render/react\";\nimport { Switch } from \"@servicetitan/anvil2\";\nimport type { z } from \"zod\";\n\nimport { definedProps } from \"../../utils/defined-props\";\nimport { switchCatalog } from \"./switch.catalog\";\n\nexport { switchCatalog };\n\nexport const SwitchRenderer = ({\n props,\n bindings,\n emit,\n}: {\n props: z.infer<typeof switchCatalog.props>;\n bindings?: Record<string, string>;\n emit: (event: string) => void;\n}) => {\n const bindingPath = bindings?.checked;\n const { state, set } = useStateStore();\n const stateChecked = bindingPath\n ? (getByPath(state, bindingPath) as boolean | undefined)\n : undefined;\n const checked = bindingPath ? (stateChecked ?? props.checked ?? false) : (props.checked ?? false);\n\n return (\n <Switch\n label={props.label}\n value={props.label}\n checked={checked}\n {...definedProps({ disabled: props.disabled })}\n onChange={(_e, state) => {\n if (bindingPath) {\n set(bindingPath, state?.checked ?? false);\n }\n emit(\"change\");\n }}\n />\n );\n};\n","import { Text } from \"@servicetitan/anvil2\";\nimport type { z } from \"zod\";\n\nimport { textCatalog } from \"./text.catalog\";\n\nexport { textCatalog };\n\nexport const TextRenderer = ({ props }: { props: z.infer<typeof textCatalog.props> }) => {\n if (props.variant === \"headline\") {\n if (props.size !== undefined) {\n return (\n <Text variant=\"headline\" el=\"h3\" size={props.size}>\n {props.content}\n </Text>\n );\n }\n return (\n <Text variant=\"headline\" el=\"h3\">\n {props.content}\n </Text>\n );\n }\n if (props.variant === \"eyebrow\") {\n return <Text variant=\"eyebrow\">{props.content}</Text>;\n }\n if (props.size !== undefined && props.subdued !== undefined) {\n return (\n <Text variant=\"body\" size={props.size} subdued={props.subdued}>\n {props.content}\n </Text>\n );\n }\n if (props.size !== undefined) {\n return (\n <Text variant=\"body\" size={props.size}>\n {props.content}\n </Text>\n );\n }\n if (props.subdued !== undefined) {\n return (\n <Text variant=\"body\" subdued={props.subdued}>\n {props.content}\n </Text>\n );\n }\n return <Text variant=\"body\">{props.content}</Text>;\n};\n","import { getByPath } from \"@json-render/core\";\nimport { useStateStore } from \"@json-render/react\";\nimport { Textarea } from \"@servicetitan/anvil2\";\nimport type { z } from \"zod\";\n\nimport { definedProps } from \"../../utils/defined-props\";\nimport { textareaCatalog } from \"./textarea.catalog\";\n\nexport { textareaCatalog };\n\nexport const TextareaRenderer = ({\n props,\n bindings,\n emit,\n}: {\n props: z.infer<typeof textareaCatalog.props>;\n bindings?: Record<string, string>;\n emit: (event: string) => void;\n}) => {\n const bindingPath = bindings?.value;\n const { state, set } = useStateStore();\n const stateValue = bindingPath\n ? (getByPath(state, bindingPath) as string | undefined)\n : undefined;\n const value = bindingPath ? (stateValue ?? props.value ?? \"\") : (props.value ?? \"\");\n\n return (\n <Textarea\n label={props.label}\n value={value}\n {...definedProps({\n placeholder: props.placeholder,\n description: props.description,\n moreInfo: props.moreInfo,\n rows: props.rows,\n disabled: props.disabled,\n })}\n onChange={(e) => {\n if (bindingPath) {\n set(bindingPath, e.target.value);\n }\n emit(\"change\");\n }}\n />\n );\n};\n","import type { CatalogEntry } from \"../../types\";\n\nimport { AlertRenderer, alertCatalog } from \"./alert\";\nimport { BarChartRenderer, barChartCatalog } from \"./bar-chart\";\nimport { ButtonRenderer, buttonCatalog } from \"./button\";\nimport { CardRenderer, cardCatalog } from \"./card\";\nimport { baseComponents, catalog } from \"./catalog-def\";\nimport { CheckboxRenderer, checkboxCatalog } from \"./checkbox\";\nimport { ChipRenderer, chipCatalog } from \"./chip\";\nimport { DividerRenderer, dividerCatalog } from \"./divider\";\nimport { DonutChartRenderer, donutChartCatalog } from \"./donut-chart\";\nimport { FlexRenderer, flexCatalog } from \"./flex\";\nimport { GridRenderer, gridCatalog } from \"./grid\";\nimport { IconRenderer, iconCatalog } from \"./icon\";\nimport { InputRenderer, inputCatalog } from \"./input\";\nimport { LineChartRenderer, lineChartCatalog } from \"./line-chart\";\nimport { LinkRenderer, linkCatalog } from \"./link\";\nimport { ListboxRenderer, listboxCatalog } from \"./listbox\";\nimport { ProgressBarRenderer, progressBarCatalog } from \"./progress-bar\";\nimport { RadioGroupRenderer, radioGroupCatalog } from \"./radio-group\";\nimport { SwitchRenderer, switchCatalog } from \"./switch\";\nimport { TextRenderer, textCatalog } from \"./text\";\nimport { TextareaRenderer, textareaCatalog } from \"./textarea\";\n\nexport { baseComponents, catalog };\n\nexport const coreCatalogEntries: CatalogEntry[] = [\n { name: \"Text\", catalog: textCatalog, renderer: TextRenderer, renderers: [\"all\"] },\n { name: \"Card\", catalog: cardCatalog, renderer: CardRenderer, renderers: [\"all\"] },\n { name: \"Flex\", catalog: flexCatalog, renderer: FlexRenderer, renderers: [\"all\"] },\n { name: \"Grid\", catalog: gridCatalog, renderer: GridRenderer, renderers: [\"all\"] },\n { name: \"Alert\", catalog: alertCatalog, renderer: AlertRenderer, renderers: [\"all\"] },\n { name: \"Divider\", catalog: dividerCatalog, renderer: DividerRenderer, renderers: [\"all\"] },\n { name: \"Icon\", catalog: iconCatalog, renderer: IconRenderer, renderers: [\"all\"] },\n { name: \"Chip\", catalog: chipCatalog, renderer: ChipRenderer, renderers: [\"all\"] },\n { name: \"Link\", catalog: linkCatalog, renderer: LinkRenderer, renderers: [\"all\"] },\n {\n name: \"ProgressBar\",\n catalog: progressBarCatalog,\n renderer: ProgressBarRenderer,\n renderers: [\"all\"],\n },\n {\n name: \"BarChart\",\n catalog: barChartCatalog,\n renderer: BarChartRenderer,\n renderers: [\"all\"],\n },\n {\n name: \"DonutChart\",\n catalog: donutChartCatalog,\n renderer: DonutChartRenderer,\n renderers: [\"all\"],\n },\n {\n name: \"LineChart\",\n catalog: lineChartCatalog,\n renderer: LineChartRenderer,\n renderers: [\"all\"],\n },\n { name: \"Button\", catalog: buttonCatalog, renderer: ButtonRenderer, renderers: [\"all\"] },\n {\n name: \"Checkbox\",\n catalog: checkboxCatalog,\n renderer: CheckboxRenderer,\n renderers: [\"all\"],\n },\n { name: \"Input\", catalog: inputCatalog, renderer: InputRenderer, renderers: [\"all\"] },\n {\n name: \"Textarea\",\n catalog: textareaCatalog,\n renderer: TextareaRenderer,\n renderers: [\"all\"],\n },\n { name: \"Listbox\", catalog: listboxCatalog, renderer: ListboxRenderer, renderers: [\"all\"] },\n {\n name: \"RadioGroup\",\n catalog: radioGroupCatalog,\n renderer: RadioGroupRenderer,\n renderers: [\"all\"],\n },\n { name: \"Switch\", catalog: switchCatalog, renderer: SwitchRenderer, renderers: [\"all\"] },\n];\n\nexport const baseRenderers = Object.fromEntries(\n coreCatalogEntries.map(({ name, renderer }) => [name, renderer]),\n);\n","import { z } from \"zod\";\n\nexport const revenueCardCatalog = {\n props: z.object({\n title: z.string(),\n value: z.string(),\n trend: z.enum([\"up\", \"down\", \"flat\"]).optional(),\n delta: z.string().optional(),\n }),\n slots: [] as string[],\n description:\n 'KPI metric card. trend: up=green↑ down=red↓ flat=grey→. delta e.g. \"+12% vs last month\". Leaf node — no children.',\n};\n","import { primitive, semantic } from \"@servicetitan/carto-react-kit/tokens\";\nimport { type RecipeVariants, recipe } from \"@vanilla-extract/recipes\";\n\nexport const trendText = recipe({\n base: {\n fontWeight: primitive.font.weight[\"600\"],\n // TODO(carto-tokens): adopt a component/semantic typography token for 13px eyebrow-adjacent sizing.\n fontSize: \"13px\",\n },\n variants: {\n trend: {\n up: { color: primitive.color.green[\"600\"] },\n down: { color: primitive.color.red[\"600\"] },\n flat: { color: semantic.foreground.color.subtle },\n },\n },\n});\n\nexport type TrendTextVariants = RecipeVariants<typeof trendText>;\n","import { Card, Flex, Text } from \"@servicetitan/anvil2\";\nimport type { z } from \"zod\";\n\nimport { revenueCardCatalog } from \"./revenue-card.catalog\";\nimport { trendText } from \"./revenue-card.css\";\n\nexport { revenueCardCatalog };\n\nexport const RevenueCardRenderer = ({\n props,\n}: {\n props: z.infer<typeof revenueCardCatalog.props>;\n}) => {\n const trend = props.trend ?? \"flat\";\n const trendIcon = props.trend === \"up\" ? \"↑\" : props.trend === \"down\" ? \"↓\" : \"→\";\n const trendClassName = trendText({ trend });\n\n return (\n <Card>\n <Flex direction=\"column\" gap=\"2\">\n <Text variant=\"eyebrow\">{props.title}</Text>\n <Text variant=\"headline\" el=\"h3\">\n {props.value}\n </Text>\n {props.delta && (\n <Flex direction=\"row\" gap=\"1\" alignItems=\"center\">\n <span className={trendClassName}>{trendIcon}</span>\n <Text variant=\"eyebrow\" className={trendClassName}>\n {props.delta}\n </Text>\n </Flex>\n )}\n </Flex>\n </Card>\n );\n};\n","import type { CatalogEntry } from \"../../types\";\n\nimport { marketingCatalog } from \"./catalog\";\nimport { RevenueCardRenderer } from \"./components/revenue-card\";\nimport { revenueCardCatalog } from \"./components/revenue-card.catalog\";\n\nexport { marketingRenderers } from \"./components\";\nexport { marketingCatalog };\n\nexport const marketingCatalogEntries: CatalogEntry[] = [\n {\n name: \"RevenueCard\",\n catalog: revenueCardCatalog,\n renderer: RevenueCardRenderer,\n renderers: [\"chat\"],\n },\n];\n\nexport { scopedCatalogs } from \"./scoped-catalogs\";\n","import type { AllComponentRenderers } from \"./renderers/types\";\nimport type { ComponentCatalogDef } from \"./scoped-catalog\";\nimport type { CatalogEntry, RendererContext } from \"./types\";\n\nexport function filterCatalogEntries(\n entries: CatalogEntry[],\n renderer: RendererContext,\n): CatalogEntry[] {\n if (renderer === \"all\") {\n return [...entries];\n }\n return entries.filter(\n ({ renderers }) => renderers.includes(\"all\") || renderers.includes(renderer),\n );\n}\n\nexport function toComponentCatalogMap(\n entries: CatalogEntry[],\n): Record<string, ComponentCatalogDef> {\n return Object.fromEntries(entries.map(({ name, catalog }) => [name, catalog]));\n}\n\nexport function toComponentRendererMap(entries: CatalogEntry[]): AllComponentRenderers {\n return Object.fromEntries(\n entries.map(({ name, renderer }) => [name, renderer]),\n ) as AllComponentRenderers;\n}\n","import { defineCatalog } from \"@json-render/core\";\nimport { type Components, defineRegistry } from \"@json-render/react\";\nimport { schema } from \"@json-render/react/schema\";\nimport { contextCatalogEntries } from \"./context/catalog\";\nimport { actionsCatalog, actionsHandlers } from \"./core/actions\";\nimport { coreCatalogEntries } from \"./core/catalog\";\nimport { catalog as coreCatalog } from \"./core/catalog/catalog-def\";\nimport { marketingCatalogEntries } from \"./marketing/catalog\";\nimport {\n filterCatalogEntries,\n toComponentCatalogMap,\n toComponentRendererMap,\n} from \"./registry-utils\";\nimport type { RendererContext } from \"./types\";\n\nconst allCatalogEntries = [\n ...coreCatalogEntries,\n ...marketingCatalogEntries,\n ...contextCatalogEntries,\n];\n\nexport function getRegistry(renderer: RendererContext = \"chat\") {\n const filtered = filterCatalogEntries(allCatalogEntries, renderer);\n const components = toComponentCatalogMap(filtered);\n const renderers = toComponentRendererMap(filtered);\n\n const catalog = defineCatalog(schema, {\n components,\n actions: actionsCatalog,\n });\n\n return defineRegistry(catalog, {\n components: renderers as Components<typeof catalog>,\n actions: actionsHandlers,\n });\n}\n\n/** Default chat registry — preserves parity with the original flat registry export. */\nconst defaultRegistry = getRegistry(\"chat\");\n\nexport const registry = defaultRegistry.registry;\nexport const handlers = defaultRegistry.handlers;\nexport const executeAction = defaultRegistry.executeAction;\n\nexport function getContextRegistry() {\n return getRegistry(\"context\");\n}\n\n/** Core catalog used for schema generation and prompt artifacts. */\nexport { coreCatalog as catalog };\n","import type { Spec } from \"@json-render/core\";\n\n/**\n * Enrich the spec so every Button element automatically gets\n * on.press → submitUserAction wired up, using the button's element key\n * as actionId. Buttons that already have on.press are left untouched.\n */\nexport function enrichButtonActions(spec: Spec): Spec {\n const elements = { ...spec.elements };\n for (const [key, element] of Object.entries(elements)) {\n if (element.type !== \"Button\") {\n continue;\n }\n if (element.on?.press) {\n continue;\n }\n const actionId = key;\n elements[key] = {\n ...element,\n on: {\n ...element.on,\n press: { action: \"atlas.submitUserAction\", params: { actionId } },\n },\n };\n }\n return { ...spec, elements };\n}\n","import type { Spec } from \"@json-render/core\";\nimport { useMemo } from \"react\";\n\nexport type SpecEnrichment = (spec: Spec) => Spec;\n\nexport function useEnrichedSpec(spec: Spec, enrichments: SpecEnrichment[]): Spec {\n return useMemo(\n () => enrichments.reduce((enriched, enrich) => enrich(enriched), spec),\n [spec, enrichments],\n );\n}\n","import type { Spec } from \"@json-render/core\";\nimport {\n type ComponentRegistry,\n createStateStore,\n type DefineRegistryResult,\n JSONUIProvider,\n Renderer,\n} from \"@json-render/react\";\nimport { useMemo, useRef } from \"react\";\nimport { enrichButtonActions } from \"./internal/enrichments/button-actions\";\nimport { useEnrichedSpec } from \"./internal/enrichments/useEnrichedSpec\";\n\nconst SPEC_ENRICHMENTS = [enrichButtonActions];\n\ntype SetState = (path: string, value: unknown) => void;\n\nexport interface SpecActionHelpers {\n setState: SetState;\n getSnapshot: () => Record<string, unknown>;\n}\n\nexport type SpecActionHandler = (params: unknown) => void | Promise<void>;\n\nexport type SpecActionsFactory = (helpers: SpecActionHelpers) => Record<string, SpecActionHandler>;\n\nexport interface SpecRendererProps {\n spec: Spec;\n registry: ComponentRegistry;\n handlers: DefineRegistryResult[\"handlers\"];\n /**\n * Build the runtime action handlers for this spec. Called with helpers that\n * expose the spec's local state store (`setState` for writing back,\n * `getSnapshot` for reading the current form data). Handlers returned here\n * are merged on top of the catalog defaults from `handlers`, so hosts can\n * implement any action declared in the catalog (e.g. `atlas.submitUserAction`,\n * `atlas.navigate`, `atlas.toolCall`) without changes to this package.\n */\n actions?: SpecActionsFactory;\n /**\n * True while the spec is still streaming in. Renders partial trees and\n * suppresses \"missing child\" warnings for elements that have not arrived yet.\n */\n loading?: boolean;\n}\n\nexport const SpecRenderer = ({ spec, registry, handlers, actions, loading }: SpecRendererProps) => {\n const enrichedSpec = useEnrichedSpec(spec, SPEC_ENRICHMENTS);\n\n const specRef = useRef<Spec | null>(null);\n const storeRef = useRef<ReturnType<typeof createStateStore> | null>(null);\n if (specRef.current !== spec) {\n specRef.current = spec;\n const specState = (enrichedSpec as unknown as { state?: Record<string, unknown> }).state ?? {};\n storeRef.current = createStateStore(specState);\n }\n if (storeRef.current === null) {\n throw new Error(\"State store is not initialized\");\n }\n const store = storeRef.current;\n\n const resolvedHandlers = useMemo(() => {\n const base = handlers(\n () => undefined,\n () => store.getSnapshot(),\n );\n const hostActions = actions\n ? actions({ setState: store.set, getSnapshot: () => store.getSnapshot() })\n : {};\n return { ...base, ...hostActions };\n }, [handlers, actions, store]);\n\n const functions = useMemo(\n () => ({\n computeTotal: (args: Record<string, unknown>) => {\n const qty = Number.parseFloat(String((args.quantity as number | string) ?? 0)) || 0;\n const price =\n Number.parseFloat(\n String((args.unitPrice as number | string) ?? \"0\").replace(/[^0-9.]/g, \"\"),\n ) || 0;\n return `$${(qty * price).toFixed(2)}`;\n },\n }),\n [],\n );\n\n return (\n <JSONUIProvider\n registry={registry}\n store={store}\n handlers={resolvedHandlers}\n functions={functions}\n >\n <Renderer spec={enrichedSpec} registry={registry} loading={loading ?? false} />\n </JSONUIProvider>\n );\n};\n","import { Alert, Text } from \"@servicetitan/anvil2\";\nimport { Component, type ErrorInfo, type ReactNode } from \"react\";\n\nexport interface ContextRenderErrorInfo {\n elementType: string;\n message: string;\n}\n\ninterface ContextRenderErrorBoundaryProps {\n elementType: string;\n children: ReactNode;\n onError?: (info: ContextRenderErrorInfo) => void;\n}\n\ninterface ContextRenderErrorBoundaryState {\n hasError: boolean;\n message: string;\n}\n\nexport class ContextRenderErrorBoundary extends Component<\n ContextRenderErrorBoundaryProps,\n ContextRenderErrorBoundaryState\n> {\n override state: ContextRenderErrorBoundaryState = { hasError: false, message: \"\" };\n\n static getDerivedStateFromError(error: Error): ContextRenderErrorBoundaryState {\n return { hasError: true, message: error.message };\n }\n\n override componentDidCatch(error: Error, info: ErrorInfo) {\n console.error(\n `[ContextSpecRenderer] Rendering error in <${this.props.elementType}>:`,\n error,\n info.componentStack,\n );\n this.props.onError?.({\n elementType: this.props.elementType,\n message: error.message,\n });\n }\n\n override render() {\n if (this.state.hasError) {\n if (process.env.NODE_ENV === \"production\") {\n return null;\n }\n\n return (\n <Alert status=\"danger\" title={`${this.props.elementType} failed to render`}>\n <Text variant=\"body\">{this.state.message}</Text>\n </Alert>\n );\n }\n\n return this.props.children;\n }\n}\n","import type { ComponentRegistry } from \"@json-render/react\";\nimport type { ComponentType } from \"react\";\n\nimport {\n ContextRenderErrorBoundary,\n type ContextRenderErrorInfo,\n} from \"../context/components/context-render-error-boundary\";\n\nexport function wrapContextRegistryWithErrorFallback(\n registry: ComponentRegistry,\n onRenderError?: (info: ContextRenderErrorInfo) => void,\n): ComponentRegistry {\n if (process.env.NODE_ENV === \"production\") {\n return registry;\n }\n\n const wrapped: ComponentRegistry = { ...registry };\n\n for (const [name, Component] of Object.entries(registry)) {\n const Renderer = Component as unknown as ComponentType<Record<string, unknown>>;\n wrapped[name] = ((props: Record<string, unknown>) => (\n <ContextRenderErrorBoundary\n elementType={name}\n {...(onRenderError ? { onError: onRenderError } : {})}\n >\n <Renderer {...props} />\n </ContextRenderErrorBoundary>\n )) as unknown as ComponentRegistry[string];\n }\n\n return wrapped;\n}\n","import { useMemo } from \"react\";\n\nimport type { ContextRenderErrorInfo } from \"../context/components/context-render-error-boundary\";\nimport { formatContextSpecIssues, validateContextSpec } from \"../context/validate-context-spec\";\nimport { getRegistry } from \"../registry\";\nimport { SpecRenderer, type SpecRendererProps } from \"./spec-renderer\";\nimport { wrapContextRegistryWithErrorFallback } from \"./wrap-context-registry\";\n\nexport type ContextSpecRendererProps = Omit<SpecRendererProps, \"registry\" | \"handlers\"> &\n Partial<Pick<SpecRendererProps, \"registry\" | \"handlers\">> & {\n onRenderError?: (info: ContextRenderErrorInfo) => void;\n };\n\nexport const ContextSpecRenderer = ({\n spec,\n registry,\n handlers,\n actions,\n onRenderError,\n loading,\n}: ContextSpecRendererProps) => {\n // Skip structural validation noise while the spec is still streaming in.\n const issues = loading ? [] : validateContextSpec(spec);\n if (issues.length > 0 && process.env.NODE_ENV !== \"production\") {\n console.warn(\n `[ContextSpecRenderer] Spec validation issues:\\n${formatContextSpecIssues(\n issues.map((issue) => ({ ...issue, severity: \"error\" as const })),\n )}`,\n );\n }\n\n const contextRegistry = registry ?? getRegistry(\"context\").registry;\n const contextHandlers = handlers ?? getRegistry(\"context\").handlers;\n\n const wrappedRegistry = useMemo(\n () => wrapContextRegistryWithErrorFallback(contextRegistry, onRenderError),\n [contextRegistry, onRenderError],\n );\n\n return (\n <SpecRenderer\n spec={spec}\n registry={wrappedRegistry}\n handlers={contextHandlers}\n {...(actions ? { actions } : {})}\n {...(loading !== undefined ? { loading } : {})}\n />\n );\n};\n","import { primitive } from \"@servicetitan/carto-react-kit/tokens\";\nimport { style } from \"@vanilla-extract/css\";\n\nexport const sectionLoadingTail = style({\n paddingTop: primitive.size[\"200\"],\n});\n","import type { Spec, UIElement } from \"@json-render/core\";\nimport type { ComponentRegistry, DefineRegistryResult } from \"@json-render/react\";\nimport { SkeletonRectangle, SkeletonText } from \"@servicetitan/anvil2\";\nimport { useMemo, useRef } from \"react\";\nimport { panel } from \"../context/catalog/context-panel.css\";\nimport { cardBody } from \"../context/components/collapsible-card.css\";\nimport {\n ContextRenderErrorBoundary,\n type ContextRenderErrorInfo,\n} from \"../context/components/context-render-error-boundary\";\nimport { getRegistry } from \"../registry\";\nimport { sectionLoadingTail } from \"./sectioned-context-renderer.css\";\nimport { SpecRenderer, type SpecRendererProps } from \"./spec-renderer\";\nimport { wrapContextRegistryWithErrorFallback } from \"./wrap-context-registry\";\n\nexport type ContextSectionStatus = \"loading\" | \"ready\" | \"error\";\n\n/** A single top-level context section rendered by its own SpecRenderer + store. */\nexport interface ContextSection {\n id: string;\n title?: string;\n spec: Spec | null;\n status: ContextSectionStatus;\n error?: string;\n}\n\nexport interface SectionedContextRendererProps {\n /** Combined ContextPanel spec — split client-side into per-section slots. */\n spec?: Spec | null;\n /** Explicit ordered section slots (parallel per-section streams). Wins over `spec`. */\n sections?: ContextSection[];\n /** Global streaming flag — the last in-progress section shows a loading state. */\n loading?: boolean;\n registry?: ComponentRegistry;\n handlers?: DefineRegistryResult[\"handlers\"];\n actions?: SpecRendererProps[\"actions\"];\n onRenderError?: (info: ContextRenderErrorInfo) => void;\n}\n\n/** Collect the subtree reachable from `sectionId`; flags dangling (not-yet-streamed) child refs. */\nfunction collectSection(\n spec: Spec,\n sectionId: string,\n): { elements: Record<string, UIElement>; hasMissingRefs: boolean } {\n const elements: Record<string, UIElement> = {};\n let hasMissingRefs = false;\n\n const visit = (id: string) => {\n const element = spec.elements[id];\n if (!element) {\n hasMissingRefs = true;\n return;\n }\n if (elements[id]) {\n return;\n }\n elements[id] = element;\n for (const childId of element.children ?? []) {\n visit(childId);\n }\n };\n\n visit(sectionId);\n return { elements, hasMissingRefs };\n}\n\n/** Build a standalone `{ root, elements, state }` spec for one section. */\nexport function extractSectionSpec(\n spec: Spec,\n sectionId: string,\n): { spec: Spec; hasMissingRefs: boolean } {\n const { elements, hasMissingRefs } = collectSection(spec, sectionId);\n const sub: Spec = { root: sectionId, elements };\n const state = (spec as { state?: Record<string, unknown> }).state;\n if (state !== undefined) {\n (sub as { state?: Record<string, unknown> }).state = state;\n }\n return { spec: sub, hasMissingRefs };\n}\n\n/**\n * Split a combined ContextPanel spec into ordered section slots, keeping a\n * stable spec reference per section so completed sections do not re-render (and\n * keep their store + local expansion state) when later sections stream in.\n */\nfunction useDerivedSections(spec: Spec | null | undefined, loading: boolean): ContextSection[] {\n const cacheRef = useRef<Map<string, { key: string; spec: Spec }>>(new Map());\n\n return useMemo(() => {\n if (!spec?.root) {\n return [];\n }\n const root = spec.elements[spec.root];\n if (!root) {\n return [];\n }\n\n const presentIds = (root.children ?? []).filter((id) => spec.elements[id]);\n const cache = cacheRef.current;\n const nextCache = new Map<string, { key: string; spec: Spec }>();\n\n const slots = presentIds.map((id, index): ContextSection => {\n const { spec: subSpec, hasMissingRefs } = extractSectionSpec(spec, id);\n const key = JSON.stringify(subSpec);\n const cached = cache.get(id);\n // Reuse the previous object when this section's subtree is unchanged.\n const stableSpec = cached && cached.key === key ? cached.spec : subSpec;\n nextCache.set(id, { key, spec: stableSpec });\n\n const isLast = index === presentIds.length - 1;\n const status: ContextSectionStatus =\n hasMissingRefs || (isLast && loading) ? \"loading\" : \"ready\";\n return { id, spec: stableSpec, status };\n });\n\n cacheRef.current = nextCache;\n return slots;\n }, [spec, loading]);\n}\n\n/**\n * Keep a stable spec object reference per section while its content is\n * unchanged. Needed for the explicit `sections` path: each parallel section\n * event clones the whole array (via postMessage), so without this an unchanged\n * section would get a new spec ref and reset its store/expansion.\n */\nfunction useStableSlotSpecs(slots: ContextSection[]): ContextSection[] {\n const cacheRef = useRef<Map<string, { key: string; spec: Spec | null }>>(new Map());\n\n return useMemo(() => {\n const cache = cacheRef.current;\n const nextCache = new Map<string, { key: string; spec: Spec | null }>();\n\n const stabilized = slots.map((slot) => {\n const key = slot.spec ? JSON.stringify(slot.spec) : \"\";\n const cached = cache.get(slot.id);\n const stableSpec = slot.spec && cached && cached.key === key ? cached.spec : slot.spec;\n nextCache.set(slot.id, { key, spec: stableSpec });\n return stableSpec === slot.spec ? slot : { ...slot, spec: stableSpec };\n });\n\n cacheRef.current = nextCache;\n return stabilized;\n }, [slots]);\n}\n\nfunction SectionSkeleton({ title }: { title?: string }) {\n return (\n <div className={cardBody} data-testid=\"context-section-skeleton\">\n <SkeletonText variant=\"headline\" {...(title ? { \"aria-label\": `Loading ${title}` } : {})} />\n <SkeletonRectangle height=\"64px\" />\n </div>\n );\n}\n\ninterface SectionSlotProps {\n slot: ContextSection;\n registry: ComponentRegistry;\n handlers: DefineRegistryResult[\"handlers\"];\n actions?: SpecRendererProps[\"actions\"];\n}\n\nfunction SectionSlot({ slot, registry, handlers, actions }: SectionSlotProps) {\n if (!slot.spec) {\n return <SectionSkeleton {...(slot.title ? { title: slot.title } : {})} />;\n }\n\n return (\n <div data-testid={`context-section-${slot.id}`} data-status={slot.status}>\n <SpecRenderer\n spec={slot.spec}\n registry={registry}\n handlers={handlers}\n loading={slot.status === \"loading\"}\n {...(actions ? { actions } : {})}\n />\n {slot.status === \"loading\" ? (\n <div className={sectionLoadingTail}>\n <SkeletonText variant=\"body\" rows={2} aria-label=\"Loading more of this section\" />\n </div>\n ) : null}\n </div>\n );\n}\n\n/**\n * Renders a context panel as independent per-section renderers. Each section\n * owns its own SpecRenderer + state store, so streaming in (or parallel-loading)\n * later sections never resets an already-expanded section.\n */\nexport const SectionedContextRenderer = ({\n spec,\n sections,\n loading = false,\n registry,\n handlers,\n actions,\n onRenderError,\n}: SectionedContextRendererProps) => {\n const fallbackRegistry = useMemo(() => getRegistry(\"context\"), []);\n const baseRegistry = registry ?? fallbackRegistry.registry;\n const contextHandlers = handlers ?? fallbackRegistry.handlers;\n\n const wrappedRegistry = useMemo(\n () => wrapContextRegistryWithErrorFallback(baseRegistry, onRenderError),\n [baseRegistry, onRenderError],\n );\n\n const derived = useDerivedSections(spec, loading);\n const slots = useStableSlotSpecs(sections ?? derived);\n\n return (\n <div className={panel} data-testid=\"sectioned-context-panel\">\n {slots.map((slot) => (\n <ContextRenderErrorBoundary\n key={slot.id}\n elementType={slot.id}\n {...(onRenderError ? { onError: onRenderError } : {})}\n >\n <SectionSlot\n slot={slot}\n registry={wrappedRegistry}\n handlers={contextHandlers}\n {...(actions ? { actions } : {})}\n />\n </ContextRenderErrorBoundary>\n ))}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AKR,kBAAC,OAAD;EAAK,eAAa,mBAAmB,EAAK;EAAM,eAAa,EAAK;YAAlE,CACE,kBAAC,GAAD;GACE,MAAM,EAAK;GACD;GACA;GACV,SAAS,EAAK,WAAW;GACzB,GAAK,IAAU,EAAE,YAAS,GAAG,EAAE;GAC/B,CAAA,EACD,EAAK,WAAW,YACf,kBAAC,OAAD;GAAK,WAAW;aACd,kBAAC,IAAD;IAAc,SAAQ;IAAO,MAAM;IAAG,cAAW;IAAiC,CAAA;GAC9E,CAAA,GACJ,KACA;MAjBC,kBAAC,IAAD,EAAiB,GAAK,EAAK,QAAQ,EAAE,OAAO,EAAK,OAAO,GAAG,EAAE,EAAK,CAAA;;AA0B7E,IAAa,MAA4B,EACvC,SACA,aACA,aAAU,IACV,aACA,aACA,YACA,uBACmC;CACnC,IAAM,IAAmB,QAAc,EAAY,UAAU,EAAE,EAAE,CAAC,EAC5D,IAAe,KAAY,EAAiB,UAC5C,IAAkB,KAAY,EAAiB,UAE/C,IAAkB,QAChB,GAAqC,GAAc,EAAc,EACvE,CAAC,GAAc,EAAc,CAC9B,EAEK,IAAU,GAAmB,GAAM,EAAQ;CAGjD,OACE,kBAAC,OAAD;EAAK,WAAW;EAAO,eAAY;YAHvB,GAAmB,KAAY,EAIxC,CAAM,KAAK,MACV,kBAAC,IAAD;GAEE,aAAa,EAAK;GAClB,GAAK,IAAgB,EAAE,SAAS,GAAe,GAAG,EAAE;aAEpD,kBAAC,IAAD;IACQ;IACN,UAAU;IACV,UAAU;IACV,GAAK,IAAU,EAAE,YAAS,GAAG,EAAE;IAC/B,CAAA;GACyB,EAVtB,EAAK,GAUiB,CAC7B;EACE,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicetitan/json-render-react",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Generative UI catalog, registry, and renderers for json-render",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -70,16 +70,17 @@
70
70
  "vite-plugin-dts": "^5.0.0",
71
71
  "vite-plugin-svgr": "^4.5.0",
72
72
  "vitest": "^4.1.6",
73
- "@carto-internal/biome-config": "0.0.0",
74
73
  "@carto-internal/tools": "0.0.0",
75
- "@carto-internal/tsconfig": "0.0.0",
76
74
  "@servicetitan/carto-react-kit": "0.3.3",
77
- "@servicetitan/carto-tokens": "0.2.0"
75
+ "@carto-internal/tsconfig": "0.0.0",
76
+ "@servicetitan/carto-tokens": "0.2.0",
77
+ "@carto-internal/biome-config": "0.0.0"
78
78
  },
79
79
  "scripts": {
80
80
  "build": "vite build && pnpm schema:gen",
81
81
  "dev": "vite build --watch",
82
82
  "schema:gen": "tsx scripts/generate-schema.ts",
83
+ "docs:gen": "tsx scripts/generate-catalog-docs.ts",
83
84
  "typecheck": "tsc --noEmit",
84
85
  "lint": "biome check .",
85
86
  "test": "vitest --project unit run",
@@ -1 +0,0 @@
1
- {"version":3,"file":"json-render-react.js","names":[],"sources":["../../../node_modules/.pnpm/@vanilla-extract+recipes@0.5.7_@vanilla-extract+css@1.20.1/node_modules/@vanilla-extract/recipes/dist/createRuntimeFn-62c9670f.esm.js","../src/context/components/collapsible-card.css.ts","../src/context/components/context-chip-tone.ts","../src/context/components/collapsible-card.tsx","../src/context/catalog/context-card.catalog.ts","../src/context/catalog/context-card.tsx","../src/context/catalog/context-data-table.catalog.ts","../src/context/catalog/context-data-table.css.ts","../src/context/catalog/context-data-table.tsx","../src/context/catalog/context-file-list.catalog.ts","../src/context/catalog/context-file-list.css.ts","../src/context/catalog/context-file-list.tsx","../src/context/catalog/context-list.catalog.ts","../src/context/catalog/context-list.css.ts","../src/context/catalog/context-list.tsx","../src/context/catalog/context-metric-grid.catalog.ts","../src/context/catalog/context-metric-grid.css.ts","../src/context/catalog/context-metric-grid.tsx","../src/context/components/context-ai-summary.css.ts","../src/context/components/context-ai-summary.tsx","../src/context/components/context-note-list.css.ts","../src/context/catalog/context-note-list.catalog.ts","../src/context/catalog/context-note-list.tsx","../src/context/catalog/context-overview.catalog.ts","../src/context/catalog/context-overview.css.ts","../src/context/catalog/context-overview.tsx","../src/context/catalog/context-panel.catalog.ts","../src/context/catalog/context-panel.css.ts","../src/context/catalog/context-panel.tsx","../src/context/catalog/context-tabular-list.catalog.ts","../src/context/catalog/context-tabular-list.css.ts","../src/context/catalog/context-tabular-list.tsx","../src/context/catalog/schemas.ts","../src/core/actions.ts","../src/core/catalog/alert.catalog.ts","../src/core/catalog/bar-chart.catalog.ts","../src/core/catalog/button.catalog.ts","../src/core/catalog/card.catalog.ts","../src/core/catalog/checkbox.catalog.ts","../src/core/catalog/chip.catalog.ts","../src/core/catalog/divider.catalog.ts","../src/core/catalog/donut-chart.catalog.ts","../src/core/catalog/flex.catalog.ts","../src/core/catalog/grid.catalog.ts","../src/core/catalog/icon.catalog.ts","../src/core/catalog/input.catalog.ts","../src/core/catalog/line-chart.catalog.ts","../src/core/catalog/link.catalog.ts","../src/core/catalog/listbox.catalog.ts","../src/core/catalog/progress-bar.catalog.ts","../src/core/catalog/radio-group.catalog.ts","../src/core/catalog/switch.catalog.ts","../src/core/catalog/text.catalog.ts","../src/core/catalog/textarea.catalog.ts","../src/core/catalog/schemas.ts","../src/scoped-catalog.ts","../src/context/catalog/catalog-def.ts","../src/context/catalog/index.ts","../src/context/constants.ts","../src/context/validate-context-spec.ts","../src/context/validate-context-spec-deep.ts","../src/core/catalog/alert.tsx","../src/core/catalog/chart.css.ts","../src/core/catalog/chart-utils.ts","../src/core/catalog/bar-chart.tsx","../src/utils/defined-props.ts","../src/core/catalog/button.tsx","../src/core/catalog/card.tsx","../src/core/catalog/catalog-def.ts","../src/core/catalog/checkbox.tsx","../src/core/catalog/chip.tsx","../src/core/catalog/divider.tsx","../src/core/catalog/donut-chart.tsx","../src/core/catalog/flex.tsx","../../../tooling/tools/src/cx.ts","../src/core/catalog/grid.css.ts","../src/core/catalog/grid.tsx","../src/core/catalog/icon.tsx","../src/core/catalog/input.tsx","../src/core/catalog/line-chart.tsx","../src/core/catalog/link.tsx","../src/core/catalog/listbox.css.ts","../src/core/catalog/listbox.tsx","../src/core/catalog/progress-bar.tsx","../src/core/catalog/radio-group.tsx","../src/core/catalog/switch.tsx","../src/core/catalog/text.tsx","../src/core/catalog/textarea.tsx","../src/core/catalog/index.ts","../src/marketing/catalog/components/revenue-card.catalog.ts","../src/marketing/catalog/components/revenue-card.css.ts","../src/marketing/catalog/components/revenue-card.tsx","../src/marketing/catalog/index.ts","../src/registry-utils.ts","../src/registry.ts","../src/renderers/internal/enrichments/button-actions.ts","../src/renderers/internal/enrichments/useEnrichedSpec.ts","../src/renderers/spec-renderer.tsx","../src/context/components/context-render-error-boundary.tsx","../src/renderers/wrap-context-registry.tsx","../src/renderers/context-spec-renderer.tsx","../src/renderers/sectioned-context-renderer.css.ts","../src/renderers/sectioned-context-renderer.tsx"],"sourcesContent":["function toPrimitive(t, r) {\n if (\"object\" != typeof t || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != typeof i) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\n\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == typeof i ? i : String(i);\n}\n\nfunction _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\n\nfunction ownKeys(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function (r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nfunction _objectSpread2(e) {\n for (var r = 1; r < arguments.length; r++) {\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {\n _defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}\n\nfunction mapValues(input, fn) {\n var result = {};\n for (var _key in input) {\n result[_key] = fn(input[_key], _key);\n }\n return result;\n}\n\nvar shouldApplyCompound = (compoundCheck, selections, defaultVariants) => {\n for (var key of Object.keys(compoundCheck)) {\n var _selections$key;\n if (compoundCheck[key] !== ((_selections$key = selections[key]) !== null && _selections$key !== void 0 ? _selections$key : defaultVariants[key])) {\n return false;\n }\n }\n return true;\n};\nvar createRuntimeFn = config => {\n var runtimeFn = options => {\n var className = config.defaultClassName;\n var selections = _objectSpread2(_objectSpread2({}, config.defaultVariants), options);\n for (var variantName in selections) {\n var _selections$variantNa;\n var variantSelection = (_selections$variantNa = selections[variantName]) !== null && _selections$variantNa !== void 0 ? _selections$variantNa : config.defaultVariants[variantName];\n if (variantSelection != null) {\n var selection = variantSelection;\n if (typeof selection === 'boolean') {\n // @ts-expect-error\n selection = selection === true ? 'true' : 'false';\n }\n var selectionClassName =\n // @ts-expect-error\n config.variantClassNames[variantName][selection];\n if (selectionClassName) {\n className += ' ' + selectionClassName;\n }\n }\n }\n for (var [compoundCheck, compoundClassName] of config.compoundVariants) {\n if (shouldApplyCompound(compoundCheck, selections, config.defaultVariants)) {\n className += ' ' + compoundClassName;\n }\n }\n return className;\n };\n runtimeFn.variants = () => Object.keys(config.variantClassNames);\n runtimeFn.classNames = {\n get base() {\n return config.defaultClassName.split(' ')[0];\n },\n get variants() {\n return mapValues(config.variantClassNames, classNames => mapValues(classNames, className => className.split(' ')[0]));\n }\n };\n return runtimeFn;\n};\n\nexport { createRuntimeFn as c, mapValues as m };\n","import { primitive, semantic } from \"@servicetitan/carto-react-kit/tokens\";\nimport { style } from \"@vanilla-extract/css\";\nimport { recipe } from \"@vanilla-extract/recipes\";\n\nconst expandMotion = `${semantic.motion.duration.transition} ${semantic.motion.easing.transition}`;\n\nconst reducedMotion = {\n \"@media\": {\n \"(prefers-reduced-motion: reduce)\": {\n transition: \"none\",\n },\n },\n} as const;\n\n/** Room inside the collapse clip for the highlighted Card's ~5px blurred halo. */\nconst panelGlowBleed = primitive.size[\"400\"];\n\nexport const fullWidth = style({\n width: \"100%\",\n});\n\nexport const cardBody = style({\n display: \"flex\",\n flexDirection: \"column\",\n gap: primitive.size[\"400\"],\n overflow: \"visible\",\n});\n\nexport const collapsibleCard = style({\n display: \"flex\",\n flexDirection: \"column\",\n width: \"100%\",\n});\n\nexport const collapsiblePanel = recipe({\n base: {\n display: \"grid\",\n overflow: \"visible\",\n transition: `grid-template-rows ${expandMotion}, margin-top ${expandMotion}, opacity ${expandMotion}`,\n ...reducedMotion,\n },\n variants: {\n expanded: {\n true: {\n gridTemplateRows: \"1fr\",\n marginTop: primitive.size[\"400\"],\n opacity: 1,\n },\n false: {\n gridTemplateRows: \"0fr\",\n marginTop: 0,\n opacity: 0,\n },\n },\n },\n defaultVariants: {\n expanded: false,\n },\n});\n\nexport const collapsiblePanelInner = recipe({\n base: {\n overflow: \"hidden\",\n minHeight: 0,\n transition: `padding ${expandMotion}, margin ${expandMotion}`,\n ...reducedMotion,\n },\n variants: {\n expanded: {\n true: {\n // Padding keeps the highlighted Card halo inside the clip; negative margin\n // cancels the inset so body content stays aligned with the card header.\n padding: panelGlowBleed,\n margin: `calc(-1 * ${panelGlowBleed})`,\n },\n false: {\n padding: 0,\n margin: 0,\n },\n },\n },\n defaultVariants: {\n expanded: false,\n },\n});\n\nexport const collapsibleCardSummary = style({\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n gap: primitive.size[\"200\"],\n width: \"100%\",\n margin: 0,\n padding: 0,\n border: \"none\",\n background: \"none\",\n cursor: \"pointer\",\n color: \"inherit\",\n font: \"inherit\",\n textAlign: \"left\",\n});\n\n/** Title + badge group — sits at the start; grows to fill available space before the chevron. */\nexport const collapsibleCardLeft = style({\n display: \"flex\",\n alignItems: \"center\",\n gap: primitive.size[\"200\"],\n flex: 1,\n minWidth: 0,\n});\n\nexport const collapsibleCardTitle = style({\n display: \"inline-flex\",\n alignItems: \"center\",\n flexShrink: 0,\n minWidth: 0,\n});\n\nexport const collapsibleChevron = recipe({\n base: {\n flexShrink: 0,\n transition: `transform ${expandMotion}`,\n transformOrigin: \"center\",\n ...reducedMotion,\n },\n variants: {\n expanded: {\n true: { transform: \"rotate(180deg)\" },\n false: {},\n },\n },\n defaultVariants: {\n expanded: false,\n },\n});\n","import { core } from \"@servicetitan/anvil2/token\";\n\n/** Semantic chip tones agents can reference — mapped to Anvil2 background tokens in the renderer. */\nexport const CONTEXT_CHIP_TONES = [\"success\", \"warning\", \"danger\", \"info\", \"neutral\"] as const;\n\nexport type ContextChipTone = (typeof CONTEXT_CHIP_TONES)[number];\n\nexport interface ContextChipCell {\n label: string;\n tone?: ContextChipTone;\n}\n\nconst toneBackground: Record<ContextChipTone, string> = {\n success: core.semantic.BackgroundColorSuccessSubdued.value,\n warning: core.semantic.BackgroundColorWarningSubdued.value,\n danger: core.semantic.BackgroundColorDangerSubdued.value,\n info: core.semantic.BackgroundColorPrimarySubdued.value,\n neutral: core.semantic.BackgroundColorSecondary.value,\n};\n\nexport function chipToneBackground(tone: ContextChipTone = \"neutral\"): string {\n return toneBackground[tone];\n}\n\n/** Foreground (text) color for a tone — used by metric-grid value text. */\nconst toneForeground: Record<ContextChipTone, string | undefined> = {\n success: core.semantic.BackgroundColorSuccess.value,\n warning: core.semantic.BackgroundColorWarning.value,\n danger: core.semantic.ForegroundColorDanger.value,\n info: core.semantic.ForegroundColorPrimary.value,\n neutral: undefined,\n};\n\nexport function toneForegroundColor(tone: ContextChipTone): string | undefined {\n return toneForeground[tone];\n}\n\nexport function parseChipCell(value: unknown): ContextChipCell | null {\n if (value == null || value === \"\") {\n return null;\n }\n\n if (typeof value === \"object\" && value !== null && \"label\" in value) {\n const cell = value as ContextChipCell;\n return {\n label: cell.label,\n tone: cell.tone ?? \"neutral\",\n };\n }\n\n if (typeof value === \"string\") {\n return { label: value, tone: \"neutral\" };\n }\n\n return { label: String(value), tone: \"neutral\" };\n}\n","import { Chip } from \"@servicetitan/anvil2\";\nimport { Card, Text } from \"@servicetitan/carto-react-kit\";\nimport { IconChevronDown } from \"@servicetitan/carto-react-kit/icons\";\nimport { type ReactNode, type TransitionEvent, useId, useState } from \"react\";\nimport {\n cardBody,\n collapsibleCard,\n collapsibleCardLeft,\n collapsibleCardSummary,\n collapsibleCardTitle,\n collapsibleChevron,\n collapsiblePanel,\n collapsiblePanelInner,\n fullWidth,\n} from \"./collapsible-card.css\";\nimport { type ContextChipTone, chipToneBackground } from \"./context-chip-tone\";\n\n/** A count-only badge (number, e.g. 3) or a labelled status badge ({ label: \"3 Variances\", tone: \"warning\" }). */\nexport type CollapsibleCardBadge = number | { label: string; tone?: ContextChipTone };\n\nexport interface CollapsibleCardProps {\n title: string;\n badge?: CollapsibleCardBadge;\n defaultExpanded?: boolean;\n children: ReactNode;\n}\n\nfunction BadgeChip({ badge }: { badge: CollapsibleCardBadge }) {\n if (typeof badge === \"number\") {\n return <Chip label={String(badge)} size=\"small\" style={{ marginTop: \"2px\" }} />;\n }\n\n return (\n <Chip\n label={badge.label}\n size=\"small\"\n color={chipToneBackground(badge.tone ?? \"neutral\")}\n style={{ marginTop: \"2px\" }}\n />\n );\n}\n\nexport const CollapsibleCard = ({\n title,\n badge,\n defaultExpanded = true,\n children,\n}: CollapsibleCardProps) => {\n const [expanded, setExpanded] = useState(defaultExpanded);\n const [contentMounted, setContentMounted] = useState(defaultExpanded);\n const panelId = useId();\n\n const toggleExpanded = () => {\n setExpanded((value) => {\n const next = !value;\n if (next) {\n setContentMounted(true);\n }\n return next;\n });\n };\n\n const handlePanelTransitionEnd = (event: TransitionEvent<HTMLDivElement>) => {\n if (event.propertyName !== \"grid-template-rows\" || expanded) {\n return;\n }\n setContentMounted(false);\n };\n\n return (\n <div className={fullWidth}>\n <Card\n padding=\"base\"\n content={\n <div className={collapsibleCard}>\n <Text\n variant=\"headline\"\n el=\"h3\"\n size=\"substantial\"\n text={\n <button\n type=\"button\"\n aria-expanded={expanded}\n aria-controls={panelId}\n onClick={toggleExpanded}\n className={collapsibleCardSummary}\n >\n <span className={collapsibleCardLeft}>\n <span className={collapsibleCardTitle}>{title}</span>\n {badge != null ? <BadgeChip badge={badge} /> : null}\n </span>\n <IconChevronDown className={collapsibleChevron({ expanded })} />\n </button>\n }\n />\n <div\n className={collapsiblePanel({ expanded })}\n onTransitionEnd={handlePanelTransitionEnd}\n >\n <div className={collapsiblePanelInner({ expanded })}>\n <div id={panelId} className={cardBody} aria-hidden={!expanded}>\n {contentMounted ? children : null}\n </div>\n </div>\n </div>\n </div>\n }\n />\n </div>\n );\n};\n","import { z } from \"zod\";\n\nimport { CONTEXT_CHIP_TONES } from \"../components/context-chip-tone\";\n\nconst badgeStatusSchema = z.object({\n label: z.string(),\n tone: z.enum(CONTEXT_CHIP_TONES).optional(),\n});\n\nconst badgeSchema = z.union([z.number().int().nonnegative(), badgeStatusSchema]);\n\nexport const contextCardCatalog = {\n props: z.object({\n title: z.string(),\n defaultExpanded: z.boolean().optional(),\n /**\n * Optional badge shown in the card header, next to the title and before the chevron.\n * Pass a number for a plain count pill (e.g. 3), or { label, tone? } for a\n * labelled status pill (e.g. { label: \"3 Variances\", tone: \"warning\" }).\n */\n badge: badgeSchema.optional(),\n }),\n slots: [\"default\"],\n description:\n \"Collapsible card for the Context panel. Each card holds a single content component as its body. Optional badge shows a count (number) or status label ({ label, tone? }) in the card header. Use defaultExpanded: false to start collapsed.\",\n};\n","import type { ReactNode } from \"react\";\nimport type { z } from \"zod\";\n\nimport { CollapsibleCard, type CollapsibleCardBadge } from \"../components/collapsible-card\";\nimport { contextCardCatalog } from \"./context-card.catalog\";\n\nexport { contextCardCatalog };\n\nexport const ContextCardRenderer = ({\n props,\n children,\n}: {\n props: z.infer<typeof contextCardCatalog.props>;\n children?: ReactNode;\n}) => (\n <CollapsibleCard\n title={props.title}\n {...(props.badge != null ? { badge: props.badge as CollapsibleCardBadge } : {})}\n defaultExpanded={props.defaultExpanded ?? true}\n >\n {children}\n </CollapsibleCard>\n);\n","import { z } from \"zod\";\n\nimport { CONTEXT_CHIP_TONES } from \"../components/context-chip-tone\";\n\nconst chipCellSchema = z.object({\n label: z.string(),\n tone: z.enum(CONTEXT_CHIP_TONES).optional(),\n});\n\nconst cellValueSchema = z.union([z.string(), z.number(), z.null(), chipCellSchema]);\n\nconst columnSchema = z.object({\n key: z.string(),\n header: z.string(),\n /**\n * Column rendering type.\n * - text: plain text (default)\n * - currency: formatted currency value\n * - chip: renders a Chip; cell value is a plain string (neutral) or { label, tone }\n * - delta: signed variance value (\"+5%\", \"-3%\", null/\"–\"). Positive → danger red,\n * negative → success green, null/empty/zero → renders \"–\" in neutral.\n */\n type: z.enum([\"text\", \"currency\", \"chip\", \"delta\"]).optional(),\n sortable: z.boolean().optional(),\n});\n\nconst rowSchema = z.record(z.string(), cellValueSchema).and(z.object({ id: z.string() }));\n\nexport const contextDataTableCatalog = {\n props: z.object({\n columns: z.array(columnSchema),\n rows: z.array(rowSchema),\n defaultSortedColumn: z\n .object({\n id: z.string(),\n desc: z.boolean().optional(),\n })\n .optional(),\n }),\n slots: [],\n description:\n \"Read-only DataTable for context cards. Column type: text (default), currency, chip, or delta. Chip cells: plain string (neutral tone) or { label, tone } where tone is success | warning | danger | info | neutral. Delta cells: signed string ('+5%', '-3%') or null — positive renders danger-red, negative renders success-green, null renders '–'. Rows must include id.\",\n};\n","import { style } from \"@vanilla-extract/css\";\n\nexport const tableScrollWrap = style({\n width: \"100%\",\n overflowX: \"auto\",\n});\n\nexport const deltaCell = style({\n fontVariantNumeric: \"tabular-nums\",\n fontWeight: 500,\n});\n","import { Chip } from \"@servicetitan/anvil2\";\nimport { createColumnHelper, DataTable } from \"@servicetitan/anvil2/beta\";\nimport { useMemo } from \"react\";\nimport type { z } from \"zod\";\nimport {\n chipToneBackground,\n parseChipCell,\n toneForegroundColor,\n} from \"../components/context-chip-tone\";\nimport { contextDataTableCatalog } from \"./context-data-table.catalog\";\nimport { deltaCell, tableScrollWrap } from \"./context-data-table.css\";\n\nexport { contextDataTableCatalog };\n\ntype RowData = Record<\n string,\n string | number | null | undefined | { label: string; tone?: string }\n> & {\n id: string;\n};\n\n/** Classify a delta string: positive, negative, or zero/empty. */\nfunction parseDelta(value: unknown): { text: string; sign: \"positive\" | \"negative\" | \"none\" } {\n if (value == null || value === \"\" || value === \"–\" || value === \"0\" || value === \"0%\") {\n return { text: \"–\", sign: \"none\" };\n }\n const str = String(value).trim();\n if (str.startsWith(\"+\") || (!str.startsWith(\"-\") && parseFloat(str) > 0)) {\n return { text: str, sign: \"positive\" };\n }\n if (str.startsWith(\"-\") || parseFloat(str) < 0) {\n return { text: str, sign: \"negative\" };\n }\n return { text: str, sign: \"none\" };\n}\n\nexport const ContextDataTableRenderer = ({\n props,\n}: {\n props: z.infer<typeof contextDataTableCatalog.props>;\n}) => {\n const columns = useMemo(() => {\n const createColumn = createColumnHelper<RowData>();\n\n return props.columns.map((column) =>\n createColumn(column.key as keyof RowData & string, {\n header: { label: column.header },\n ...(column.sortable ? { sortable: true } : {}),\n ...(column.type === \"currency\" ? { type: \"currency\" as const } : {}),\n ...(column.type === \"chip\"\n ? {\n renderCell: (value) => {\n const cell = parseChipCell(value);\n if (!cell) {\n return null;\n }\n return (\n <Chip label={cell.label} size=\"small\" color={chipToneBackground(cell.tone)} />\n );\n },\n }\n : {}),\n ...(column.type === \"delta\"\n ? {\n renderCell: (value) => {\n const { text, sign } = parseDelta(value);\n const color =\n sign === \"positive\"\n ? toneForegroundColor(\"danger\")\n : sign === \"negative\"\n ? toneForegroundColor(\"success\")\n : undefined;\n return (\n <span className={deltaCell} style={color ? { color } : undefined}>\n {text}\n </span>\n );\n },\n }\n : {}),\n }),\n );\n }, [props.columns]);\n\n const data = useMemo(() => props.rows.map((row) => ({ ...row })), [props.rows]);\n\n return (\n <div className={tableScrollWrap}>\n <DataTable\n columns={columns as Parameters<typeof DataTable>[0][\"columns\"]}\n data={data}\n isSelectable={false}\n {...(props.defaultSortedColumn\n ? {\n defaultSortedColumn: {\n id: props.defaultSortedColumn.id,\n desc: props.defaultSortedColumn.desc ?? false,\n },\n }\n : {})}\n />\n </div>\n );\n};\n","import { z } from \"zod\";\n\nconst fileItemSchema = z.object({\n /** Filename including extension (e.g. \"HVAC Inspection Checklist.pdf\"). Used to infer the file type icon. */\n label: z.string(),\n /**\n * File URL. Image files (jpg/jpeg/png/gif/webp/heic/svg) render inline in the\n * preview dialog; other types show a large file-type icon with a Download action.\n */\n url: z.string(),\n});\n\nexport const contextFileListCatalog = {\n props: z.object({\n items: z.array(fileItemSchema),\n }),\n slots: [],\n description:\n \"Vertical list of file attachments and documents. \" +\n \"Each row shows a color-coded file-type icon (inferred from the extension: pdf, xlsx/csv, doc/docx, image, or generic) \" +\n \"and the filename. Clicking a row opens a preview dialog. \" +\n \"Image files render from url; other files show a large icon and a Download footer action. \" +\n \"Use for Completed Forms and Attachments sections.\",\n};\n","import { primitive, semantic } from \"@servicetitan/carto-react-kit/tokens\";\nimport { style } from \"@vanilla-extract/css\";\n\nexport const fileList = style({\n display: \"flex\",\n flexDirection: \"column\",\n gap: primitive.size[\"200\"],\n width: \"100%\",\n});\n\n/** Full-width interactive card for each file row. */\nexport const fileCard = style({\n width: \"100%\",\n});\n\n/** Icon + label layout inside the card. */\nexport const fileRowContent = style({\n display: \"flex\",\n alignItems: \"center\",\n gap: primitive.size[\"300\"],\n minWidth: 0,\n});\n\n/** 32×32 gray circle behind list-row icons. */\nexport const fileIconBadge = style({\n width: primitive.size[\"800\"],\n height: primitive.size[\"800\"],\n borderRadius: \"50%\",\n flexShrink: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n backgroundColor: semantic.background.color.subtle.resting,\n});\n\n/** Preview dialog content wrapper. */\nexport const filePreviewContent = style({\n display: \"flex\",\n flexDirection: \"column\",\n gap: primitive.size[\"300\"],\n width: \"100%\",\n});\n\n/** Centers image or icon above the filename. */\nexport const filePreviewMedia = style({\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: \"100%\",\n});\n\nexport const filePreviewImage = style({\n maxWidth: \"100%\",\n maxHeight: \"65vh\",\n objectFit: \"contain\",\n borderRadius: semantic.radius.trim,\n});\n\n/** Non-image preview — large centered file-type icon. */\nexport const filePreviewIconWrap = style({\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: \"100%\",\n minHeight: primitive.size[\"1400\"],\n});\n\n/** Filename caption below the preview media. */\nexport const filePreviewLabel = style({\n width: \"100%\",\n textAlign: \"left\",\n});\n","import { Icon } from \"@servicetitan/anvil2\";\nimport ImageIcon from \"@servicetitan/anvil2/assets/icons/material/round/image.svg\";\nimport DocumentAudio from \"@servicetitan/anvil2/assets/icons/st/document_audio.svg\";\nimport DocumentDoc from \"@servicetitan/anvil2/assets/icons/st/document_doc.svg\";\nimport DocumentForm from \"@servicetitan/anvil2/assets/icons/st/document_form.svg\";\nimport DocumentOther from \"@servicetitan/anvil2/assets/icons/st/document_other.svg\";\nimport DocumentPdf from \"@servicetitan/anvil2/assets/icons/st/document_pdf.svg\";\nimport DocumentSpreadsheet from \"@servicetitan/anvil2/assets/icons/st/document_spreadsheet.svg\";\nimport DocumentText from \"@servicetitan/anvil2/assets/icons/st/document_text.svg\";\nimport { Card, Dialog, Text } from \"@servicetitan/carto-react-kit\";\nimport type { ComponentProps, CSSProperties } from \"react\";\nimport { useState } from \"react\";\nimport type { z } from \"zod\";\n\nimport { contextFileListCatalog } from \"./context-file-list.catalog\";\nimport {\n fileCard,\n fileIconBadge,\n fileList,\n filePreviewContent,\n filePreviewIconWrap,\n filePreviewImage,\n filePreviewLabel,\n filePreviewMedia,\n fileRowContent,\n} from \"./context-file-list.css\";\n\nexport { contextFileListCatalog };\n\ntype AnvilSvg = NonNullable<ComponentProps<typeof Icon>[\"svg\"]>;\n\ntype FileKind = \"pdf\" | \"spreadsheet\" | \"doc\" | \"text\" | \"form\" | \"audio\" | \"image\" | \"generic\";\n\nfunction inferFileKind(label: string): FileKind {\n const lower = label.toLowerCase();\n if (lower.endsWith(\".pdf\")) return \"pdf\";\n if (/\\.(xlsx|xls|csv|numbers)$/.test(lower)) return \"spreadsheet\";\n if (/\\.(doc|docx|pages)$/.test(lower)) {\n if (/form/i.test(lower.replace(/\\.[^.]+$/, \"\"))) return \"form\";\n return \"doc\";\n }\n if (/\\.(txt|rtf|md)$/.test(lower)) return \"text\";\n if (/\\.(mp3|wav|aac|m4a|flac|ogg)$/.test(lower)) return \"audio\";\n if (/\\.(jpg|jpeg|png|gif|webp|heic|svg)$/.test(lower)) return \"image\";\n if (/form/i.test(lower.replace(/\\.[^.]+$/, \"\"))) return \"form\";\n return \"generic\";\n}\n\nconst FILE_KIND_META: Record<FileKind, { svg: AnvilSvg; color: string }> = {\n pdf: { svg: DocumentPdf as AnvilSvg, color: \"#DC2626\" },\n spreadsheet: { svg: DocumentSpreadsheet as AnvilSvg, color: \"#16A34A\" },\n doc: { svg: DocumentDoc as AnvilSvg, color: \"#2563EB\" },\n text: { svg: DocumentText as AnvilSvg, color: \"#6B7280\" },\n form: { svg: DocumentForm as AnvilSvg, color: \"#2563EB\" },\n audio: { svg: DocumentAudio as AnvilSvg, color: \"#6B7280\" },\n image: { svg: ImageIcon as AnvilSvg, color: \"#374151\" },\n generic: { svg: DocumentOther as AnvilSvg, color: \"#6B7280\" },\n};\n\n/** 80px preview — Anvil Icon sizes cap at xlarge (32px), so override the token. */\nconst PREVIEW_ICON_STYLE = {\n \"--a2-mod-icon-font-size\": \"80px\",\n} as CSSProperties;\n\ntype FileItem = z.infer<typeof contextFileListCatalog.props>[\"items\"][number];\n\nfunction FileListIcon({ kind }: { kind: FileKind }) {\n const { svg, color } = FILE_KIND_META[kind];\n\n return (\n <div className={fileIconBadge} aria-hidden=\"true\">\n <Icon svg={svg} size=\"medium\" color={color} />\n </div>\n );\n}\n\nfunction downloadFile(url: string, filename: string) {\n const anchor = document.createElement(\"a\");\n anchor.href = url;\n anchor.download = filename;\n anchor.target = \"_blank\";\n anchor.rel = \"noopener noreferrer\";\n document.body.appendChild(anchor);\n anchor.click();\n anchor.remove();\n}\n\nfunction FilePreviewLabel({ label }: { label: string }) {\n return <Text variant=\"body\" size=\"regular\" text={label} className={filePreviewLabel} />;\n}\n\nfunction FilePreviewContent({ item, kind }: { item: FileItem; kind: FileKind }) {\n const { svg, color } = FILE_KIND_META[kind];\n\n return (\n <div className={filePreviewContent}>\n <div className={filePreviewMedia}>\n {kind === \"image\" ? (\n <img src={item.url} alt={item.label} className={filePreviewImage} />\n ) : (\n <div className={filePreviewIconWrap}>\n <Icon svg={svg} color={color} style={PREVIEW_ICON_STYLE} />\n </div>\n )}\n </div>\n <FilePreviewLabel label={item.label} />\n </div>\n );\n}\n\nfunction FileRow({ item, onPreview }: { item: FileItem; onPreview: () => void }) {\n const kind = inferFileKind(item.label);\n\n return (\n <Card\n className={fileCard}\n padding=\"snug\"\n onPress={onPreview}\n label={`Preview ${item.label}`}\n content={\n <div className={fileRowContent}>\n <FileListIcon kind={kind} />\n <Text variant=\"body\" size=\"compact\" text={item.label} />\n </div>\n }\n />\n );\n}\n\nfunction FileListItem({ item }: { item: FileItem }) {\n const [open, setOpen] = useState(false);\n const kind = inferFileKind(item.label);\n const isImage = kind === \"image\";\n\n return (\n <>\n <FileRow item={item} onPreview={() => setOpen(true)} />\n <Dialog\n title=\"View Attachment\"\n content={<FilePreviewContent item={item} kind={kind} />}\n isOpen={open}\n onOpenChange={setOpen}\n {...(isImage\n ? {}\n : {\n primaryAction: {\n label: \"Download\",\n onPress: () => downloadFile(item.url, item.label),\n },\n })}\n />\n </>\n );\n}\n\nexport const ContextFileListRenderer = ({\n props,\n}: {\n props: z.infer<typeof contextFileListCatalog.props>;\n}) => (\n <div className={fileList}>\n {props.items.map((item, idx) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: filenames may not be unique\n <FileListItem key={`${item.label}-${idx}`} item={item} />\n ))}\n </div>\n);\n","import { z } from \"zod\";\n\nimport { CONTEXT_CHIP_TONES } from \"../components/context-chip-tone\";\n\n/**\n * A single row in a ContextList — timesheet or recent-job style:\n * title: \"Devon Carter\"\n * meta: \"04/28/2026 · 8H · $65/HR · $520 TOTAL\"\n * callout: \"$520.00\", calloutLabel: \"INVOICED\"\n *\n * Or with a leading job link:\n * identifier: \"134536\", identifierHref: \"https://...\"\n * title: \"HVAC Inspection\"\n * meta: \"04/28/2026 · DEVON CARTER\"\n */\nexport const listItemSchema = z.object({\n /** Primary label (e.g. employee name, job title). Required. */\n title: z.string(),\n /** Leading linked reference shown before the title (e.g. job number). */\n identifier: z.string().optional(),\n /** URL for the identifier link. */\n identifierHref: z.string().optional(),\n /** Secondary detail line below the title (e.g. \"04/28/2026 · 8H · $65/HR\"). */\n meta: z.string().optional(),\n /** Right-aligned callout value (e.g. \"$520.00\"). */\n callout: z.string().optional(),\n /** Optional tone for the callout text. */\n calloutTone: z.enum(CONTEXT_CHIP_TONES).optional(),\n /** Small label below the callout (e.g. \"INVOICED\"). */\n calloutLabel: z.string().optional(),\n});\n\nexport const contextListCatalog = {\n props: z.object({\n items: z.array(listItemSchema),\n }),\n slots: [],\n description:\n \"Flat list for timesheets and recent jobs. \" +\n \"Each item has a required title, optional identifier link + meta on the left, \" +\n \"and optional callout + calloutLabel on the right. \" +\n \"For grouped procurement records with aligned columns, use ContextTabularList instead.\",\n};\n","import { primitive, semantic } from \"@servicetitan/carto-react-kit/tokens\";\nimport { style } from \"@vanilla-extract/css\";\n\n/** Outer list wrapper. */\nexport const listRoot = style({\n display: \"flex\",\n flexDirection: \"column\",\n width: \"100%\",\n});\n\n/** Subdued color for meta and callout labels. */\nexport const textSubdued = style({\n color: semantic.foreground.color.subtle,\n});\n\n/** A single list item row. */\nexport const listItem = style({\n padding: primitive.size[\"300\"],\n});\n\n/** Two-column grid: left fills space, right shrinks to content. */\nexport const listItemGrid = style({\n display: \"grid\",\n gridTemplateColumns: \"minmax(0, 1fr) max-content\",\n columnGap: primitive.size[\"300\"],\n rowGap: primitive.size[\"100\"],\n alignItems: \"start\",\n width: \"100%\",\n});\n\n/** Left column — title row + meta row. */\nexport const listColLeft = style({\n display: \"flex\",\n flexDirection: \"column\",\n gap: primitive.size[\"100\"],\n minWidth: 0,\n});\n\n/** Title row: optional link, divider, title. */\nexport const listPrimaryRow = style({\n display: \"flex\",\n alignItems: \"center\",\n gap: primitive.size[\"200\"],\n minWidth: 0,\n});\n\n/** Vertical divider between identifier link and title. */\nexport const listPrimaryDivider = style({\n alignSelf: \"stretch\",\n width: primitive.size[\"25\"],\n flexShrink: 0,\n backgroundColor: semantic.border.color.standard,\n});\n\n/** Right column — callout + callout label, right-aligned. */\nexport const listColRight = style({\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"flex-end\",\n gap: primitive.size[\"100\"],\n flexShrink: 0,\n});\n","import { Link, Text } from \"@servicetitan/carto-react-kit\";\nimport type { z } from \"zod\";\n\nimport { toneForegroundColor } from \"../components/context-chip-tone\";\nimport { contextListCatalog, type listItemSchema } from \"./context-list.catalog\";\nimport {\n listColLeft,\n listColRight,\n listItem,\n listItemGrid,\n listPrimaryDivider,\n listPrimaryRow,\n listRoot,\n textSubdued,\n} from \"./context-list.css\";\n\nexport { contextListCatalog };\n\ntype ListItem = z.infer<typeof listItemSchema>;\n\nfunction ListRow({ item }: { item: ListItem }) {\n const calloutColor = item.calloutTone ? toneForegroundColor(item.calloutTone) : undefined;\n const identifier = item.identifier;\n const hasRight = item.callout != null || item.calloutLabel != null;\n\n return (\n <div className={listItemGrid}>\n <div className={listColLeft}>\n <div className={listPrimaryRow}>\n {identifier && item.identifierHref ? (\n <Link href={item.identifierHref} target=\"_blank\" text={identifier} />\n ) : identifier ? (\n <Text variant=\"body\" size=\"compact\" text={identifier} />\n ) : null}\n {identifier ? <span aria-hidden=\"true\" className={listPrimaryDivider} /> : null}\n <Text variant=\"body\" size=\"regular\" text={item.title} />\n </div>\n {item.meta ? (\n <Text variant=\"body\" size=\"fine\" text={item.meta} className={textSubdued} />\n ) : null}\n </div>\n {hasRight ? (\n <div className={listColRight}>\n {item.callout ? (\n <Text\n variant=\"headline\"\n el=\"h6\"\n size=\"regular\"\n text={item.callout}\n {...(calloutColor ? { style: { color: calloutColor } } : {})}\n />\n ) : null}\n {item.calloutLabel ? (\n <Text variant=\"eyebrow\" text={item.calloutLabel} className={textSubdued} />\n ) : null}\n </div>\n ) : null}\n </div>\n );\n}\n\nexport const ContextListRenderer = ({\n props,\n}: {\n props: z.infer<typeof contextListCatalog.props>;\n}) => (\n <div className={listRoot}>\n {props.items.map((item, idx) => (\n <div key={item.identifier ?? item.title ?? idx} className={listItem}>\n <ListRow item={item} />\n </div>\n ))}\n </div>\n);\n","import { z } from \"zod\";\n\nimport { CONTEXT_CHIP_TONES } from \"../components/context-chip-tone\";\n\nconst metricItemSchema = z.object({\n label: z.string(),\n value: z.string(),\n /**\n * Optional tone applied to the value text.\n * Use \"danger\" for over-budget costs, \"success\" for positive metrics, etc.\n */\n tone: z.enum(CONTEXT_CHIP_TONES).optional(),\n});\n\nexport const contextMetricGridCatalog = {\n props: z.object({\n items: z.array(metricItemSchema),\n columns: z.enum([\"3\", \"4\"]).optional(),\n }),\n slots: [],\n description:\n \"KPI grid with label and value pairs. Optional columns: 3 (default) or 4. Each item supports an optional tone (danger | warning | success | info | neutral) to color the value text.\",\n};\n","import { primitive, semantic } from \"@servicetitan/carto-react-kit/tokens\";\nimport { style } from \"@vanilla-extract/css\";\nimport { recipe } from \"@vanilla-extract/recipes\";\n\nexport const metricGrid = recipe({\n base: {\n display: \"grid\",\n gap: primitive.size[\"400\"],\n width: \"100%\",\n },\n variants: {\n columns: {\n \"3\": { gridTemplateColumns: \"repeat(3, minmax(0, 1fr))\" },\n \"4\": { gridTemplateColumns: \"repeat(4, minmax(0, 1fr))\" },\n },\n },\n defaultVariants: {\n columns: \"3\",\n },\n});\n\n/** Subdued color for KPI label eyebrows. */\nexport const eyebrowSubdued = style({\n color: semantic.foreground.color.subtle,\n});\n\nexport const metricGridItem = style({\n display: \"flex\",\n flexDirection: \"column\",\n gap: primitive.size[\"100\"],\n minWidth: 0,\n});\n","import { Text } from \"@servicetitan/carto-react-kit\";\nimport type { z } from \"zod\";\n\nimport { toneForegroundColor } from \"../components/context-chip-tone\";\nimport { contextMetricGridCatalog } from \"./context-metric-grid.catalog\";\nimport { eyebrowSubdued, metricGrid, metricGridItem } from \"./context-metric-grid.css\";\n\nexport { contextMetricGridCatalog };\n\nexport const ContextMetricGridRenderer = ({\n props,\n}: {\n props: z.infer<typeof contextMetricGridCatalog.props>;\n}) => {\n const columns = props.columns === \"4\" ? \"4\" : \"3\";\n\n return (\n <div className={metricGrid({ columns })}>\n {props.items.map((item) => {\n const valueColor = item.tone ? toneForegroundColor(item.tone) : undefined;\n return (\n <div key={item.label} className={metricGridItem}>\n <Text variant=\"eyebrow\" text={item.label.toUpperCase()} className={eyebrowSubdued} />\n <Text\n variant=\"headline\"\n el=\"h6\"\n size=\"regular\"\n text={item.value}\n {...(valueColor ? { style: { color: valueColor } } : {})}\n />\n </div>\n );\n })}\n </div>\n );\n};\n","import { style } from \"@vanilla-extract/css\";\n\n/**\n * Isolated wrapper so the highlighted Card's `::before` glow (z-index -1)\n * paints within this context instead of behind the parent CollapsibleCard.\n */\nexport const aiSummaryRoot = style({\n position: \"relative\",\n isolation: \"isolate\",\n width: \"100%\",\n overflow: \"visible\",\n});\n","import { Card, Text } from \"@servicetitan/carto-react-kit\";\n\nimport { aiSummaryRoot } from \"./context-ai-summary.css\";\n\nexport interface ContextAiSummaryProps {\n summary: string;\n}\n\nexport const ContextAiSummary = ({ summary }: ContextAiSummaryProps) => (\n <div className={aiSummaryRoot} data-carto=\"context-ai-summary\">\n <Card\n highlighted\n padding=\"snug\"\n role=\"status\"\n style={{ width: \"100%\" }}\n content={<Text variant=\"body\" size=\"regular\" text={summary} />}\n />\n </div>\n);\n","import { primitive, semantic } from \"@servicetitan/carto-react-kit/tokens\";\nimport { style } from \"@vanilla-extract/css\";\n\n/** Outer list wrapper — the content area within the collapsible card. */\nexport const noteList = style({\n display: \"flex\",\n flexDirection: \"column\",\n width: \"100%\",\n});\n\n/** AI summary wrapper — sits above the note items. */\nexport const noteSummaryWrapper = style({\n marginBottom: primitive.size[\"300\"],\n});\n\n/** Single note item row. */\nexport const noteItem = style({\n paddingBlock: primitive.size[\"200\"],\n display: \"flex\",\n flexDirection: \"column\",\n gap: primitive.size[\"100\"],\n selectors: {\n \"&:first-child\": {\n paddingTop: 0,\n },\n },\n});\n\n/** Top row: category label (left) + author · date (right). */\nexport const noteItemHeader = style({\n display: \"flex\",\n alignItems: \"baseline\",\n justifyContent: \"space-between\",\n gap: primitive.size[\"200\"],\n});\n\n/** Subdued color for eyebrow labels (category, author/date). */\nexport const eyebrowSubdued = style({\n color: semantic.foreground.color.subtle,\n});\n","import { z } from \"zod\";\n\nconst noteItemSchema = z.object({\n /**\n * Optional category eyebrow shown above the body text (e.g. \"JOB SUMMARY\", \"APPOINTMENT SUMMARY\").\n * Displayed in small caps at the top-left of the item.\n */\n category: z.string().optional(),\n /** Main body text of the note. */\n body: z.string(),\n /** Author name shown at top-right (e.g. \"MARCUS D.\"). */\n author: z.string().optional(),\n /** Date shown at top-right (e.g. \"03/10/2026\"). */\n date: z.string().optional(),\n /**\n * Whether to truncate the body text to ~3 lines by default.\n * An inline \"More\" toggle lets the user expand to full text.\n * Defaults to false (show full text).\n */\n truncate: z.boolean().optional(),\n});\n\nexport const contextNoteListCatalog = {\n props: z.object({\n /**\n * Optional AI-generated summary shown in a highlighted card at the top of the list,\n * before the individual note items.\n */\n summary: z.string().optional(),\n items: z.array(noteItemSchema),\n }),\n slots: [],\n description:\n \"Notes & Summaries list. Optional summary renders an AI-highlighted box at the top. \" +\n \"Each item shows an optional category eyebrow (e.g. 'JOB SUMMARY'), body text, \" +\n \"and optional author + date at top-right. \" +\n \"Set truncate: true on long items to clamp to ~3 lines with an inline More/Less expand.\",\n};\n","import { OverflowText } from \"@servicetitan/anvil2\";\nimport { Text } from \"@servicetitan/carto-react-kit\";\nimport type { z } from \"zod\";\n\nimport { ContextAiSummary } from \"../components/context-ai-summary\";\nimport {\n eyebrowSubdued,\n noteItem,\n noteItemHeader,\n noteList,\n noteSummaryWrapper,\n} from \"../components/context-note-list.css\";\nimport { contextNoteListCatalog } from \"./context-note-list.catalog\";\n\nexport { contextNoteListCatalog };\n\ntype NoteItem = z.infer<typeof contextNoteListCatalog.props>[\"items\"][number];\n\nfunction NoteItemRow({ item }: { item: NoteItem }) {\n const hasHeader = item.category || item.author || item.date;\n\n return (\n <div className={noteItem}>\n {hasHeader ? (\n <div className={noteItemHeader}>\n {item.category ? (\n <Text variant=\"eyebrow\" text={item.category} className={eyebrowSubdued} />\n ) : (\n <span />\n )}\n {item.author || item.date ? (\n <Text\n variant=\"eyebrow\"\n text={[item.author, item.date].filter(Boolean).join(\" · \")}\n className={eyebrowSubdued}\n />\n ) : null}\n </div>\n ) : null}\n\n {item.truncate ? (\n <OverflowText rows={3} expandable expandText=\"More\" collapseText=\"Less\">\n {item.body}\n </OverflowText>\n ) : (\n <Text variant=\"body\" size=\"regular\" text={item.body} />\n )}\n </div>\n );\n}\n\nexport const ContextNoteListRenderer = ({\n props,\n}: {\n props: z.infer<typeof contextNoteListCatalog.props>;\n}) => (\n <div className={noteList}>\n {props.summary ? (\n <div className={noteSummaryWrapper}>\n <ContextAiSummary summary={props.summary} />\n </div>\n ) : null}\n {props.items.map((item, idx) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: items lack stable ids\n <NoteItemRow key={`${item.category ?? \"\"}-${idx}`} item={item} />\n ))}\n </div>\n);\n","import { z } from \"zod\";\n\nexport const contextOverviewCatalog = {\n props: z.object({\n summary: z.string(),\n }),\n slots: [] as string[],\n description:\n \"AI-generated overview summary for the Context panel. Optional first child of ContextPanel. Renders as a plain section (not a card): Overview headline with sparkle icon and body text. Leaf node — no children.\",\n};\n","import { primitive } from \"@servicetitan/carto-react-kit/tokens\";\nimport { style } from \"@vanilla-extract/css\";\n\nexport const overview = style({\n display: \"flex\",\n flexDirection: \"column\",\n gap: primitive.size[\"200\"],\n});\n\nexport const overviewTitleRow = style({\n display: \"flex\",\n alignItems: \"center\",\n gap: primitive.size[\"200\"],\n});\n","import { AiMark } from \"@servicetitan/anvil2\";\nimport { Text } from \"@servicetitan/carto-react-kit\";\nimport type { z } from \"zod\";\nimport { contextOverviewCatalog } from \"./context-overview.catalog\";\nimport { overview, overviewTitleRow } from \"./context-overview.css\";\n\nexport { contextOverviewCatalog };\n\nexport const ContextOverviewRenderer = ({\n props,\n}: {\n props: z.infer<typeof contextOverviewCatalog.props>;\n}) => (\n <section className={overview}>\n <div className={overviewTitleRow}>\n <Text variant=\"headline\" el=\"h2\" size=\"substantial\" text=\"Overview\" />\n <AiMark size=\"small\" type=\"gradient\" />\n </div>\n <Text variant=\"body\" size=\"regular\" text={props.summary} />\n </section>\n);\n","import { z } from \"zod\";\n\nexport const contextPanelCatalog = {\n props: z.object({}),\n slots: [\"default\"],\n description:\n \"Root container for the Context panel. MUST be the spec root. Children MUST only be ContextOverview (optional, first) followed by one or more ContextCard components.\",\n};\n","import { primitive } from \"@servicetitan/carto-react-kit/tokens\";\nimport { style } from \"@vanilla-extract/css\";\n\nexport const panel = style({\n display: \"flex\",\n flexDirection: \"column\",\n gap: primitive.size[\"300\"],\n maxWidth: \"800px\",\n margin: \"0 auto\",\n});\n","import { Children, type ReactNode } from \"react\";\nimport { contextPanelCatalog } from \"./context-panel.catalog\";\nimport { panel } from \"./context-panel.css\";\n\nexport { contextPanelCatalog };\n\nexport const ContextPanelRenderer = ({ children }: { children?: ReactNode }) => {\n const items = Children.toArray(children).filter(Boolean);\n\n return <div className={panel}>{items}</div>;\n};\n","import { z } from \"zod\";\n\nconst fieldSchema = z.object({\n /** Column header shown above the value (e.g. \"DATE\", \"AMOUNT\"). */\n label: z.string(),\n /** Cell value (e.g. \"03/05/2026\", \"$1,672.00\"). */\n value: z.string(),\n});\n\nconst tabularRowSchema = z.object({\n /** Row type label in the first column (e.g. \"PURCHASE ORDER\", \"RECEIPT\", \"BILL\"). */\n eyebrow: z.string().optional(),\n /** Leading linked reference in the first column (e.g. PO number). */\n identifier: z.string().optional(),\n /** URL for the identifier link. */\n identifierHref: z.string().optional(),\n /** Additional columns after the identifier column — same field count per group. */\n fields: z.array(fieldSchema),\n});\n\nconst groupSchema = z.object({\n /** Vendor or category heading (e.g. \"ABC Supply Co\"). */\n label: z.string(),\n items: z.array(tabularRowSchema),\n});\n\nexport const contextTabularListCatalog = {\n props: z.object({\n /** Vendor-grouped tabular rows. Each group renders as a neutral card with aligned columns. */\n groups: z.array(groupSchema),\n }),\n slots: [],\n description:\n \"Grouped tabular list for procurement-style records. \" +\n \"Each group has a vendor label and rows with an optional eyebrow + identifier in the first column \" +\n \"and additional label/value field columns (e.g. DATE, AMOUNT). \" +\n \"Use inside ContextCard for Procurement sections.\",\n};\n","import { primitive, semantic } from \"@servicetitan/carto-react-kit/tokens\";\nimport { style } from \"@vanilla-extract/css\";\n\n/** Outer wrapper — stacks vendor groups. */\nexport const tabularRoot = style({\n display: \"flex\",\n flexDirection: \"column\",\n width: \"100%\",\n});\n\n/** Vendor group card. */\nexport const tabularGroup = style({\n display: \"flex\",\n flexDirection: \"column\",\n backgroundColor: primitive.color.neutral[\"30\"],\n borderRadius: semantic.radius.moderate,\n padding: primitive.size[\"300\"],\n selectors: {\n \"&:not(:first-child)\": {\n marginTop: primitive.size[\"300\"],\n },\n },\n});\n\n/** Vendor group heading. */\nexport const tabularGroupLabel = style({\n marginBottom: primitive.size[\"200\"],\n});\n\n/** Subdued color for eyebrow labels and field headers. */\nexport const eyebrowSubdued = style({\n color: semantic.foreground.color.subtle,\n});\n\n/**\n * Shared-column grid — every cell is a direct child so column tracks align\n * across rows (e.g. PURCHASE ORDER sets the width of column 1 for all rows).\n */\nexport const tabularGroupGrid = style({\n display: \"grid\",\n width: \"100%\",\n justifyItems: \"start\",\n alignContent: \"start\",\n});\n\n/** Full-width divider between rows — equal margin above/below centers the line. */\nexport const tabularRowDivider = style({\n gridColumn: \"1 / -1\",\n width: \"100%\",\n marginTop: primitive.size[\"300\"],\n marginBottom: primitive.size[\"300\"],\n height: primitive.size[\"25\"],\n backgroundColor: semantic.border.color.standard,\n});\n\n/** Column cell — eyebrow + value stacked, left-aligned. */\nexport const tabularCell = style({\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"flex-start\",\n gap: primitive.size[\"100\"],\n justifySelf: \"start\",\n minWidth: 0,\n});\n","import { Link, Text } from \"@servicetitan/carto-react-kit\";\nimport { primitive } from \"@servicetitan/carto-react-kit/tokens\";\nimport { Fragment } from \"react\";\nimport type { z } from \"zod\";\n\nimport { contextTabularListCatalog } from \"./context-tabular-list.catalog\";\nimport {\n eyebrowSubdued,\n tabularCell,\n tabularGroup,\n tabularGroupGrid,\n tabularGroupLabel,\n tabularRoot,\n tabularRowDivider,\n} from \"./context-tabular-list.css\";\n\nexport { contextTabularListCatalog };\n\ntype TabularRow = z.infer<\n typeof contextTabularListCatalog.props\n>[\"groups\"][number][\"items\"][number];\n\nfunction tabularGridColumns(fieldCount: number): string {\n const colCount = fieldCount + 1;\n if (colCount <= 1) return \"max-content\";\n const spacer = `minmax(${primitive.size[\"400\"]}, 1fr)`;\n return Array(colCount).fill(\"max-content\").join(` ${spacer} `);\n}\n\nfunction tabularContentColumn(index: number): number {\n return index * 2 + 1;\n}\n\nfunction TabularRowCells({ item, gridRow }: { item: TabularRow; gridRow: number }) {\n const cellProps = (colIndex: number) => ({\n style: { gridColumn: tabularContentColumn(colIndex), gridRow },\n className: tabularCell,\n });\n\n return (\n <>\n <div {...cellProps(0)}>\n {item.eyebrow ? (\n <Text variant=\"eyebrow\" text={item.eyebrow} className={eyebrowSubdued} />\n ) : null}\n {item.identifier && item.identifierHref ? (\n <Link href={item.identifierHref} target=\"_blank\" text={item.identifier} />\n ) : item.identifier ? (\n <Text variant=\"body\" size=\"compact\" text={item.identifier} />\n ) : null}\n </div>\n {item.fields.map((f, index) => (\n <div key={f.label} {...cellProps(index + 1)}>\n <Text variant=\"eyebrow\" text={f.label} className={eyebrowSubdued} />\n <Text variant=\"body\" size=\"compact\" text={f.value} />\n </div>\n ))}\n </>\n );\n}\n\nexport const ContextTabularListRenderer = ({\n props,\n}: {\n props: z.infer<typeof contextTabularListCatalog.props>;\n}) => (\n <div className={tabularRoot}>\n {props.groups.map((group) => {\n const fieldCount = group.items[0]?.fields.length ?? 0;\n\n return (\n <div key={group.label} className={tabularGroup}>\n <div className={tabularGroupLabel}>\n <Text variant=\"headline\" el=\"h5\" size=\"regular\" text={group.label} />\n </div>\n <div\n className={tabularGroupGrid}\n style={{ gridTemplateColumns: tabularGridColumns(fieldCount) }}\n >\n {group.items.map((item, idx) => {\n const gridRow = idx * 2 + 1;\n\n return (\n <Fragment key={item.identifier ?? item.eyebrow ?? idx}>\n {idx > 0 ? (\n <div className={tabularRowDivider} style={{ gridRow: idx * 2 }} />\n ) : null}\n <TabularRowCells item={item} gridRow={gridRow} />\n </Fragment>\n );\n })}\n </div>\n </div>\n );\n })}\n </div>\n);\n","import { contextCardCatalog } from \"./context-card.catalog\";\nimport { contextDataTableCatalog } from \"./context-data-table.catalog\";\nimport { contextFileListCatalog } from \"./context-file-list.catalog\";\nimport { contextListCatalog } from \"./context-list.catalog\";\nimport { contextMetricGridCatalog } from \"./context-metric-grid.catalog\";\nimport { contextNoteListCatalog } from \"./context-note-list.catalog\";\nimport { contextOverviewCatalog } from \"./context-overview.catalog\";\nimport { contextPanelCatalog } from \"./context-panel.catalog\";\nimport { contextTabularListCatalog } from \"./context-tabular-list.catalog\";\n\nexport const contextShellComponents = {\n ContextPanel: contextPanelCatalog,\n ContextOverview: contextOverviewCatalog,\n ContextCard: contextCardCatalog,\n};\n\nexport const contextContentComponents = {\n ContextNoteList: contextNoteListCatalog,\n ContextMetricGrid: contextMetricGridCatalog,\n ContextDataTable: contextDataTableCatalog,\n ContextList: contextListCatalog,\n ContextTabularList: contextTabularListCatalog,\n ContextFileList: contextFileListCatalog,\n};\n","import { z } from \"zod\";\n\nexport const actionsCatalog = {\n \"atlas.submitUserAction\": {\n params: z.object({\n data: z.record(z.string(), z.unknown()).optional(),\n actionId: z.string().optional(),\n }),\n description: 'Submit form data. actionId overrides default \"form_submit\" identifier.',\n },\n \"atlas.navigate\": {\n params: z.object({ url: z.string() }),\n description:\n \"Navigate to a URL or internal route. External URLs (http/https) open in a new tab; internal route strings navigate within the app.\",\n },\n \"atlas.toolCall\": {\n params: z.object({\n tool: z.string(),\n args: z.record(z.string(), z.unknown()).optional(),\n }),\n description:\n \"Invoke a tool on the active artifact panel app (an MCP-backed MFE). args is the tool argument payload; if omitted the current form state is sent.\",\n },\n};\n\nexport const actionsHandlers = {\n \"atlas.submitUserAction\": async (_params: unknown) => {\n // no-op default — host overrides via SpecRenderer `actions` factory\n },\n \"atlas.navigate\": async (_params: unknown) => {\n // no-op default — host overrides via SpecRenderer `actions` factory\n },\n \"atlas.toolCall\": async (_params: unknown) => {\n // no-op default — host overrides via SpecRenderer `actions` factory\n },\n};\n","import { z } from \"zod\";\n\nexport const alertCatalog = {\n props: z.object({\n title: z.string(),\n status: z.enum([\"info\", \"success\", \"warning\", \"danger\"]).optional(),\n dismissible: z.boolean().optional(),\n aiMark: z.boolean().optional(),\n }),\n slots: [\"default\"],\n events: [\"close\"],\n description:\n 'Inline notification banner with a required title. status: info (default) | success | warning | danger — danger for errors, warning for cautions, success for confirmations. Put the main message in the alert\\'s children (rendered below the title). dismissible: true adds a close button that emits a \"close\" event.',\n};\n","import { z } from \"zod\";\n\nexport const barChartCatalog = {\n props: z.object({\n data: z.array(z.object({ category: z.string(), value: z.number() })),\n orientation: z.enum([\"vertical\", \"horizontal\"]).optional(),\n theme: z.enum([\"monochrome\", \"categorical\", \"semantic\"]).optional(),\n height: z.number().optional(),\n unit: z.string().optional(),\n }),\n slots: [],\n description:\n \"Bar chart (vertical or horizontal) with Anvil2 theme. data: [{category, value}]. theme: monochrome (default, ≤4 vars), categorical (5-9 distinct), semantic (success/neutral/warning/danger order). unit: tooltip suffix.\",\n};\n","import { z } from \"zod\";\n\nexport const buttonCatalog = {\n props: z.object({\n label: z.string(),\n appearance: z.enum([\"primary\", \"secondary\", \"ghost\", \"danger\"]).optional(),\n size: z.enum([\"xsmall\", \"small\", \"medium\", \"large\"]).optional(),\n loading: z.boolean().optional(),\n disabled: z.boolean().optional(),\n badge: z.string().optional(),\n }),\n slots: [],\n events: [\"press\"],\n description:\n 'Clickable button. Emits a \"press\" event when clicked; inside a form the host treats press as a submit and uses the element key as the actionId, so no explicit on.press wiring is needed for form submits. appearance: primary | secondary (default) | ghost | danger (destructive actions like delete/cancel). size: xsmall | small | medium (default) | large. loading: true shows a spinner and blocks interaction. disabled: true prevents interaction. badge: optional notification count shown as a superscript (e.g. \"3\", \"99+\"); use an empty string for a dot-only indicator.',\n};\n","import { z } from \"zod\";\n\nexport const cardCatalog = {\n props: z.object({\n title: z.string().optional(),\n description: z.string().optional(),\n background: z.enum([\"strong\", \"stronger\"]).optional(),\n padding: z.enum([\"0\", \"xsmall\", \"small\", \"medium\", \"large\"]).optional(),\n }),\n slots: [\"default\"],\n description:\n \"White surface that groups a logical section of related content. title: optional headline rendered at the top of the card. description: optional subdued line below the title. Children render below the header and are stacked vertically with consistent spacing — you do not need to wrap them in a Flex. Prefer the built-in title/description over standalone Text children for the heading. background: strong | stronger for nested/elevated surfaces. padding: 0 | xsmall | small | medium (default) | large. Do not nest a Card inside another Card.\",\n};\n","import { z } from \"zod\";\n\nexport const checkboxCatalog = {\n props: z.object({\n label: z.string(),\n checked: z.boolean().optional(),\n disabled: z.boolean().optional(),\n }),\n slots: [],\n events: [\"change\"],\n description:\n 'Checkbox for selecting zero or more independent options that are submitted with a form (one Checkbox per option). For a single on/off setting with immediate effect prefer Switch. Bind state with $bindState on checked; emits a \"change\" event when toggled. disabled: true prevents toggling.',\n};\n","import { z } from \"zod\";\n\nexport const chipCatalog = {\n props: z.object({\n label: z.string(),\n size: z.enum([\"small\", \"medium\"]).optional(),\n color: z.string().optional(),\n icon: z.enum([\"check-circle\", \"in-progress\", \"radio-button-unchecked\"]).optional(),\n removable: z.boolean().optional(),\n }),\n slots: [],\n events: [\"close\"],\n description:\n 'Inline label pill for metadata, tags, or categories — use for job statuses, not notification counts (use a Button/Link badge prop for those). size: small | medium (default). color: any CSS color. icon: optional leading status icon. removable: true adds a close button that emits a \"close\" event (ignored when size=small).',\n};\n","import { z } from \"zod\";\n\nexport const dividerCatalog = {\n props: z.object({\n vertical: z.boolean().optional(),\n spacing: z.enum([\"0\", \"half\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"8\", \"12\"]).optional(),\n alignContent: z.enum([\"start\", \"center\", \"end\"]).optional(),\n }),\n slots: [],\n description:\n \"Horizontal (default) or vertical rule that separates content sections. vertical: true for a vertical separator between side-by-side content. spacing (space around the divider, ~4px per step): 0 (default) | half | 1–6 | 8 | 12. alignContent: alignment of any divider content (start | center | end). Place between logical sections — not as a top/bottom border of a container.\",\n};\n","import { z } from \"zod\";\n\nexport const donutChartCatalog = {\n props: z.object({\n data: z.array(z.object({ category: z.string(), value: z.number() })),\n theme: z.enum([\"monochrome\", \"categorical\", \"semantic\"]).optional(),\n showLegend: z.boolean().optional(),\n height: z.number().optional(),\n unit: z.string().optional(),\n }),\n slots: [],\n description:\n \"Donut chart with optional legend and Anvil2 theme. data: [{category, value}]. theme: monochrome (≤4 vars), categorical (5-9 distinct), semantic (status values).\",\n};\n","import { z } from \"zod\";\n\nexport const flexCatalog = {\n props: z.object({\n direction: z.enum([\"row\", \"column\"]).optional(),\n gap: z.enum([\"0\", \"half\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"8\", \"12\"]).optional(),\n alignItems: z.enum([\"center\", \"flex-start\", \"flex-end\", \"stretch\", \"baseline\"]).optional(),\n justifyContent: z\n .enum([\"center\", \"flex-start\", \"flex-end\", \"space-between\", \"space-around\", \"space-evenly\"])\n .optional(),\n alignSelf: z\n .enum([\"auto\", \"center\", \"flex-start\", \"flex-end\", \"stretch\", \"baseline\"])\n .optional(),\n wrap: z.enum([\"wrap\", \"nowrap\", \"wrap-reverse\"]).optional(),\n grow: z.number().optional(),\n shrink: z.number().optional(),\n basis: z.string().optional(),\n inline: z.boolean().optional(),\n }),\n slots: [\"default\"],\n description:\n 'Flex layout container. direction: row (default) | column — always set column when stacking children vertically. gap (spacing token, ~4px per step): half=2px 1=4px 2=8px 3=12px 4=16px 5=20px 6=24px 8=32px 12=48px. alignItems: cross-axis alignment of children. justifyContent: main-axis distribution. When this Flex is itself a child of another Flex, use grow (1=fill available space), shrink, basis (CSS flex-basis e.g. \"200px\"), and alignSelf to control how it flexes.',\n};\n","import { z } from \"zod\";\n\nexport const gridCatalog = {\n props: z.object({\n templateColumns: z.string().optional(),\n gap: z.enum([\"0\", \"half\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"8\", \"12\"]).optional(),\n bordered: z.boolean().optional(),\n }),\n slots: [\"default\"],\n description:\n 'CSS Grid layout. templateColumns: CSS grid-template-columns value — \"repeat(3, 1fr)\" for equal columns, \"200px 1fr\" for fixed+flex two-column (e.g. key-value tables), \"1fr 1fr 80px\" for multi-column tables. Children flow into grid cells left-to-right, top-to-bottom. gap (spacing token, ~4px per step): 1=4px 2=8px … 6=24px 8=32px 12=48px (default 2). bordered: true renders a bordered table with row separators and cell padding — use for key-value and data tables.',\n};\n","import { z } from \"zod\";\n\nexport const iconCatalog = {\n props: z.object({\n name: z.enum([\"check-circle\", \"in-progress\", \"radio-button-unchecked\"]),\n size: z.enum([\"small\", \"medium\", \"large\", \"xlarge\"]).optional(),\n color: z.string().optional(),\n }),\n slots: [],\n description:\n \"Small status icon. name (only these three are available): check-circle=completed/success checkmark, in-progress=partial circle (active/working), radio-button-unchecked=empty circle (pending/not started). size: small | medium (default) | large | xlarge. color: any CSS color (defaults to the current text color). Commonly paired with status Text in lists and checklists.\",\n};\n","import { z } from \"zod\";\n\nexport const inputCatalog = {\n props: z.object({\n label: z.string(),\n placeholder: z.string().optional(),\n type: z.enum([\"text\", \"password\", \"email\", \"tel\", \"url\", \"number\"]).optional(),\n value: z.string().optional(),\n disabled: z.boolean().optional(),\n }),\n slots: [],\n events: [\"change\"],\n description:\n 'Free-text input field for user-typed values (names, notes, numbers, etc). type: text (default), password (masked), email, tel (phone), url, number. Bind value with $bindState so the typed value is captured in state; emits a \"change\" event on every keystroke. Prefer this over Listbox when the value is not from a fixed list. disabled: true prevents editing.',\n};\n","import { z } from \"zod\";\n\nexport const lineChartCatalog = {\n props: z.object({\n data: z.array(z.record(z.string(), z.union([z.string(), z.number()]))),\n series: z.array(z.string()).optional(),\n theme: z.enum([\"monochrome\", \"categorical\", \"semantic\"]).optional(),\n showLegend: z.boolean().optional(),\n showDots: z.boolean().optional(),\n height: z.number().optional(),\n unit: z.string().optional(),\n }),\n slots: [],\n description:\n 'Line chart for tracking trends over time with optional multiple series. data: array of objects with a \"category\" key (x-axis label) and one numeric key per series (e.g. [{category: \"Jan\", revenue: 100, cost: 60}]). series: explicit list of series keys to plot (inferred from data keys if omitted, max 6). theme: monochrome (1-2 series), categorical (3-6 distinct). showLegend: true when multiple series (default true for 2+ series). showDots: true adds data-point markers (default true). unit: tooltip value suffix.',\n};\n","import { z } from \"zod\";\n\nexport const linkCatalog = {\n props: z.object({\n label: z.string(),\n href: z.string(),\n appearance: z.enum([\"primary\", \"secondary\"]).optional(),\n target: z.enum([\"_blank\", \"_self\"]).optional(),\n ghost: z.boolean().optional(),\n badge: z.string().optional(),\n }),\n slots: [],\n events: [\"press\"],\n description:\n 'Inline navigation link (renders an <a>). Emits a \"press\" event when clicked — handle navigation in on.press; href and target are inputs for the host/router rather than native browser navigation. href: destination URL for the host/router. appearance: primary (default) | secondary. target: _blank marks the link as external (shows external-link icon) and lets the host open a new tab if desired. ghost: quieter styling (primary only). badge: optional notification count shown as a superscript (e.g. \"5\"); use an empty string for a dot-only indicator.',\n};\n","import { z } from \"zod\";\n\nexport const listboxCatalog = {\n props: z.object({\n label: z.string(),\n options: z.array(z.object({ value: z.string(), label: z.string() })),\n value: z.string().optional(),\n disabled: z.boolean().optional(),\n }),\n slots: [],\n events: [\"change\"],\n description:\n 'Single-select dropdown for choosing one value from a fixed list of known options. options: [{ value, label }] — value is stored in state, label is shown. Bind the selection with $bindState on value; emits a \"change\" event on selection. Use only when options are predefined; for free-text user input use Input, and for 2–7 visible mutually-exclusive choices prefer RadioGroup. disabled: true prevents selection.',\n};\n","import { z } from \"zod\";\n\nexport const progressBarCatalog = {\n props: z.object({\n label: z.string(),\n value: z.number().min(0).max(100).optional(),\n description: z.string().optional(),\n indeterminate: z.boolean().optional(),\n }),\n slots: [],\n description:\n \"Horizontal progress bar showing task completion. label is required (the accessible name for the bar). value: 0–100 percentage filled. Omit value and set indeterminate=true when progress cannot be measured (do not set both). description: optional helper text shown below the bar.\",\n};\n","import { z } from \"zod\";\n\nexport const radioGroupCatalog = {\n props: z.object({\n label: z.string(),\n options: z.array(z.object({ value: z.string(), label: z.string() })),\n value: z.string().optional(),\n disabled: z.boolean().optional(),\n }),\n slots: [],\n events: [\"change\"],\n description:\n 'Group of radio buttons for picking one option from 2–7 visible mutually-exclusive choices. options: [{ value, label }]. Bind the selection with $bindState on value; emits a \"change\" event on selection. For longer option lists use Listbox. disabled: true prevents selection.',\n};\n","import { z } from \"zod\";\n\nexport const switchCatalog = {\n props: z.object({\n label: z.string(),\n checked: z.boolean().optional(),\n disabled: z.boolean().optional(),\n }),\n slots: [],\n events: [\"change\"],\n description:\n 'Toggle switch for a single binary on/off setting with immediate effect (no form submit). Prefer over Checkbox for enabling/disabling features. Bind state with $bindState on checked; emits a \"change\" event when toggled. disabled: true prevents toggling.',\n};\n","import { z } from \"zod\";\n\nexport const textCatalog = {\n props: z.object({\n content: z.string(),\n variant: z.enum([\"headline\", \"body\", \"eyebrow\"]).optional(),\n size: z.enum([\"small\", \"medium\", \"large\", \"xlarge\"]).optional(),\n subdued: z.boolean().optional(),\n }),\n slots: [],\n description:\n \"Display text. variant: headline=bold title, eyebrow=small uppercase label, body=default (default variant). size: small | medium (default) | large | xlarge — applies to headline and body only (ignored for eyebrow). subdued: deemphasized secondary text (body only). Use eyebrow+headline pairs for KPI/stat labels above values.\",\n};\n","import { z } from \"zod\";\n\nexport const textareaCatalog = {\n props: z.object({\n label: z.string(),\n placeholder: z.string().optional(),\n description: z.string().optional(),\n moreInfo: z.string().optional(),\n value: z.string().optional(),\n rows: z.number().optional(),\n disabled: z.boolean().optional(),\n }),\n slots: [],\n events: [\"change\"],\n description:\n 'Multi-line free-text input for long values (notes, descriptions, email body). Bind value with $bindState; emits a \"change\" event on every keystroke. rows: visible row count (default 3). description: helper text below the field. moreInfo: tooltip text on the label. disabled: true prevents editing.',\n};\n","import { alertCatalog } from \"./alert.catalog\";\nimport { barChartCatalog } from \"./bar-chart.catalog\";\nimport { buttonCatalog } from \"./button.catalog\";\nimport { cardCatalog } from \"./card.catalog\";\nimport { checkboxCatalog } from \"./checkbox.catalog\";\nimport { chipCatalog } from \"./chip.catalog\";\nimport { dividerCatalog } from \"./divider.catalog\";\nimport { donutChartCatalog } from \"./donut-chart.catalog\";\nimport { flexCatalog } from \"./flex.catalog\";\nimport { gridCatalog } from \"./grid.catalog\";\nimport { iconCatalog } from \"./icon.catalog\";\nimport { inputCatalog } from \"./input.catalog\";\nimport { lineChartCatalog } from \"./line-chart.catalog\";\nimport { linkCatalog } from \"./link.catalog\";\nimport { listboxCatalog } from \"./listbox.catalog\";\nimport { progressBarCatalog } from \"./progress-bar.catalog\";\nimport { radioGroupCatalog } from \"./radio-group.catalog\";\nimport { switchCatalog } from \"./switch.catalog\";\nimport { textCatalog } from \"./text.catalog\";\nimport { textareaCatalog } from \"./textarea.catalog\";\n\nexport const baseComponents = {\n Text: textCatalog,\n Card: cardCatalog,\n Flex: flexCatalog,\n Grid: gridCatalog,\n Alert: alertCatalog,\n Divider: dividerCatalog,\n Icon: iconCatalog,\n Chip: chipCatalog,\n Link: linkCatalog,\n ProgressBar: progressBarCatalog,\n BarChart: barChartCatalog,\n DonutChart: donutChartCatalog,\n LineChart: lineChartCatalog,\n Button: buttonCatalog,\n Checkbox: checkboxCatalog,\n Input: inputCatalog,\n Textarea: textareaCatalog,\n Listbox: listboxCatalog,\n RadioGroup: radioGroupCatalog,\n Switch: switchCatalog,\n};\n","import { type Catalog, defineCatalog } from \"@json-render/core\";\nimport { schema } from \"@json-render/react/schema\";\nimport type { z } from \"zod\";\n\nimport { actionsCatalog } from \"./core/actions\";\nimport { baseComponents } from \"./core/catalog/schemas\";\n\nexport interface ComponentCatalogDef {\n props: z.ZodType;\n slots: string[];\n description: string;\n /**\n * Events this component emits, surfaced to the LLM as `[events: ...]` in the\n * generated prompt so it knows which event names are valid in an element's\n * `on` map (e.g. `{ \"press\": { \"action\": \"...\" } }`).\n */\n events?: string[];\n}\n\nexport interface ActionCatalogDef {\n params: z.ZodType;\n description: string;\n}\n\n/** Names of the components available in the core catalog. */\nexport type CoreComponentName = keyof typeof baseComponents;\n\n/** Replace or append to a component's catalog description (prompt + JSON schema). */\nexport interface DescriptionOverride {\n /** Replace the component's description entirely. */\n description?: string;\n /** Append to the existing description (joined with a space). */\n append?: string;\n}\n\nexport interface ComposeCatalogComponentsOptions {\n /** Core components to include: an array of names, or \"all\" (default). */\n core?: CoreComponentName[] | \"all\";\n /** Per-component description overrides/appends — applies to core and own components. */\n overrides?: Partial<Record<string, DescriptionOverride>>;\n /** This catalog's own (non-core) components. */\n components?: Record<string, ComponentCatalogDef>;\n}\n\n/**\n * Build the component map for a catalog: pick a subset of core components (or\n * all), merge in the catalog's own components, and apply per-component\n * description overrides. Descriptions feed both `defineCatalog(...).prompt()`\n * and `.jsonSchema()`, so this controls what an agent sees for the catalog.\n *\n * Overrides are applied immutably — the shared `baseComponents` definitions\n * (also used by the core catalog/registry) are never mutated.\n */\nexport function composeCatalogComponents(\n opts: ComposeCatalogComponentsOptions = {},\n): Record<string, ComponentCatalogDef> {\n const { core = \"all\", overrides = {}, components = {} } = opts;\n\n const selectedCore: Record<string, ComponentCatalogDef> =\n core === \"all\"\n ? { ...baseComponents }\n : Object.fromEntries(\n core.map((name) => {\n const def = baseComponents[name];\n if (!def) {\n throw new Error(`Unknown core component: ${String(name)}`);\n }\n return [name, def];\n }),\n );\n\n const merged: Record<string, ComponentCatalogDef> = { ...selectedCore, ...components };\n\n for (const [name, override] of Object.entries(overrides)) {\n const def = merged[name];\n if (!def || !override) {\n continue;\n }\n const description =\n override.description ??\n (override.append ? `${def.description} ${override.append}` : def.description);\n merged[name] = { ...def, description };\n }\n\n return merged;\n}\n\nexport interface ScopedCatalogDef {\n prefix: string;\n components?: Record<string, ComponentCatalogDef>;\n actions?: Record<string, ActionCatalogDef>;\n /** Core components to include: an array of names, or \"all\" (default). */\n core?: CoreComponentName[] | \"all\";\n /** Per-component description overrides/appends — applies to core and own components. */\n overrides?: Partial<Record<string, DescriptionOverride>>;\n /** Appended to base rules in generated prompt */\n rules?: string;\n}\n\nexport interface MergedCatalog {\n prefix: string;\n catalog: Catalog;\n prompt(baseRules: string): string;\n jsonSchema(): object;\n}\n\nexport function createScopedCatalog(def: ScopedCatalogDef): ScopedCatalogDef {\n return def;\n}\n\nexport function mergeCatalogs(scopedDef: ScopedCatalogDef): MergedCatalog {\n const mergedComponents = composeCatalogComponents({\n core: scopedDef.core ?? \"all\",\n ...(scopedDef.overrides ? { overrides: scopedDef.overrides } : {}),\n ...(scopedDef.components ? { components: scopedDef.components } : {}),\n });\n\n const prefixedScopedActions = Object.fromEntries(\n Object.entries(scopedDef.actions ?? {}).map(([key, val]) => [\n `${scopedDef.prefix}.${key}`,\n val,\n ]),\n );\n\n const mergedActions = {\n ...actionsCatalog,\n ...prefixedScopedActions,\n } as Record<string, ActionCatalogDef>;\n\n const mergedCatalog = defineCatalog(schema, {\n components: mergedComponents,\n actions: mergedActions,\n });\n\n return {\n prefix: scopedDef.prefix,\n catalog: mergedCatalog,\n prompt(baseRules: string): string {\n const parts = [mergedCatalog.prompt(), \"\\n\", baseRules];\n if (scopedDef.rules) {\n parts.push(\"\\n\", scopedDef.rules);\n }\n return parts.join(\"\");\n },\n jsonSchema(): object {\n return mergedCatalog.jsonSchema();\n },\n };\n}\n","import { defineCatalog } from \"@json-render/core\";\nimport { schema } from \"@json-render/react/schema\";\n\nimport { actionsCatalog } from \"../../core/actions\";\nimport {\n type CoreComponentName,\n composeCatalogComponents,\n type DescriptionOverride,\n} from \"../../scoped-catalog\";\n\nimport { contextContentComponents, contextShellComponents } from \"./schemas\";\n\nexport { contextContentComponents, contextShellComponents };\n\n/**\n * Core components the agent may use inside a context panel. Context surfaces are\n * read-only and composed from the Context* primitives, so charts, form inputs,\n * Button, Card, Flex, Grid, Badge, and ProgressBar are intentionally excluded.\n */\nconst CONTEXT_CORE_COMPONENTS: CoreComponentName[] = [\"Text\", \"Chip\", \"Link\", \"Alert\"];\n\nconst CONTEXT_CORE_OVERRIDES: Partial<Record<string, DescriptionOverride>> = {\n Link: {\n append:\n \"In a context panel, links appear inside content primitives (ContextList, ContextTabularList identifier links, ContextNoteList, etc.); use a standalone Link only for inline references within rich text.\",\n },\n};\n\nexport const contextComponents = composeCatalogComponents({\n core: CONTEXT_CORE_COMPONENTS,\n overrides: CONTEXT_CORE_OVERRIDES,\n components: { ...contextShellComponents, ...contextContentComponents },\n});\n\nexport const contextCatalog = defineCatalog(schema, {\n components: contextComponents,\n actions: actionsCatalog,\n});\n","import type { CatalogEntry } from \"../../types\";\nimport { ContextCardRenderer } from \"./context-card\";\nimport { ContextDataTableRenderer } from \"./context-data-table\";\nimport { ContextFileListRenderer } from \"./context-file-list\";\nimport { ContextListRenderer } from \"./context-list\";\nimport { ContextMetricGridRenderer } from \"./context-metric-grid\";\nimport { ContextNoteListRenderer } from \"./context-note-list\";\nimport { ContextOverviewRenderer } from \"./context-overview\";\nimport { ContextPanelRenderer } from \"./context-panel\";\nimport { ContextTabularListRenderer } from \"./context-tabular-list\";\nimport { contextContentComponents, contextShellComponents } from \"./schemas\";\n\nexport { contextCatalog, contextComponents, contextShellComponents } from \"./catalog-def\";\nexport { contextContentComponents } from \"./schemas\";\n\nexport const contextCatalogEntries: CatalogEntry[] = [\n {\n name: \"ContextPanel\",\n catalog: contextShellComponents.ContextPanel,\n renderer: ContextPanelRenderer,\n renderers: [\"context\"],\n },\n {\n name: \"ContextOverview\",\n catalog: contextShellComponents.ContextOverview,\n renderer: ContextOverviewRenderer,\n renderers: [\"context\"],\n },\n {\n name: \"ContextCard\",\n catalog: contextShellComponents.ContextCard,\n renderer: ContextCardRenderer,\n renderers: [\"context\"],\n },\n {\n name: \"ContextNoteList\",\n catalog: contextContentComponents.ContextNoteList,\n renderer: ContextNoteListRenderer,\n renderers: [\"context\"],\n },\n {\n name: \"ContextMetricGrid\",\n catalog: contextContentComponents.ContextMetricGrid,\n renderer: ContextMetricGridRenderer,\n renderers: [\"context\"],\n },\n {\n name: \"ContextDataTable\",\n catalog: contextContentComponents.ContextDataTable,\n renderer: ContextDataTableRenderer,\n renderers: [\"context\"],\n },\n {\n name: \"ContextList\",\n catalog: contextContentComponents.ContextList,\n renderer: ContextListRenderer,\n renderers: [\"context\"],\n },\n {\n name: \"ContextTabularList\",\n catalog: contextContentComponents.ContextTabularList,\n renderer: ContextTabularListRenderer,\n renderers: [\"context\"],\n },\n {\n name: \"ContextFileList\",\n catalog: contextContentComponents.ContextFileList,\n renderer: ContextFileListRenderer,\n renderers: [\"context\"],\n },\n];\n\nexport const contextShellRenderers = Object.fromEntries(\n contextCatalogEntries\n .filter(({ name }) => name in contextShellComponents)\n .map(({ name, renderer }) => [name, renderer]),\n);\n\nexport const contextContentRenderers = Object.fromEntries(\n contextCatalogEntries\n .filter(({ name }) => name in contextContentComponents)\n .map(({ name, renderer }) => [name, renderer]),\n);\n","export const CONTEXT_SHELL_TYPES = [\"ContextPanel\", \"ContextOverview\", \"ContextCard\"] as const;\n\nexport type ContextShellType = (typeof CONTEXT_SHELL_TYPES)[number];\n\nexport const CONTEXT_TOP_LEVEL_TYPES = [\"ContextOverview\", \"ContextCard\"] as const;\n\nexport type ContextTopLevelType = (typeof CONTEXT_TOP_LEVEL_TYPES)[number];\n\nexport function isContextShellType(type: string): type is ContextShellType {\n return (CONTEXT_SHELL_TYPES as readonly string[]).includes(type);\n}\n\nexport function isContextTopLevelType(type: string): type is ContextTopLevelType {\n return (CONTEXT_TOP_LEVEL_TYPES as readonly string[]).includes(type);\n}\n","import type { Spec } from \"@json-render/core\";\n\nimport {\n CONTEXT_SHELL_TYPES,\n CONTEXT_TOP_LEVEL_TYPES,\n isContextShellType,\n isContextTopLevelType,\n} from \"./constants\";\n\nexport interface ContextSpecIssue {\n path: string;\n message: string;\n severity?: ContextSpecIssueSeverity;\n}\n\nexport type ContextSpecIssueSeverity = \"error\" | \"warn\";\n\nfunction getElement(spec: Spec, key: string) {\n const elements = spec.elements as Record<\n string,\n { type: string; children?: string[] } | undefined\n >;\n return elements[key];\n}\n\nfunction collectDescendantKeys(\n spec: Spec,\n rootKey: string,\n visited = new Set<string>(),\n): Set<string> {\n const element = getElement(spec, rootKey);\n if (!element || visited.has(rootKey)) {\n return visited;\n }\n\n visited.add(rootKey);\n for (const childKey of element.children ?? []) {\n collectDescendantKeys(spec, childKey, visited);\n }\n\n return visited;\n}\n\nexport function validateContextSpec(spec: Spec): ContextSpecIssue[] {\n const issues: ContextSpecIssue[] = [];\n const rootKey = spec.root;\n const root = getElement(spec, rootKey);\n\n if (!root) {\n issues.push({ path: \"/root\", message: \"Root element is missing from elements map.\" });\n return issues;\n }\n\n if (root.type !== \"ContextPanel\") {\n issues.push({\n path: `/elements/${rootKey}`,\n message: `Root must be ContextPanel, got \"${root.type}\".`,\n });\n return issues;\n }\n\n let overviewCount = 0;\n\n for (const childKey of root.children ?? []) {\n const child = getElement(spec, childKey);\n if (!child) {\n issues.push({\n path: `/elements/${childKey}`,\n message: `Child \"${childKey}\" referenced by ContextPanel is missing.`,\n });\n continue;\n }\n\n if (!isContextTopLevelType(child.type)) {\n issues.push({\n path: `/elements/${childKey}`,\n message: `Direct child of ContextPanel must be ContextOverview or ContextCard — got \"${child.type}\".`,\n });\n continue;\n }\n\n if (child.type === \"ContextOverview\") {\n overviewCount += 1;\n if (overviewCount > 1) {\n issues.push({\n path: `/elements/${childKey}`,\n message: \"ContextOverview may appear at most once in ContextPanel.\",\n });\n }\n }\n\n for (const descendantKey of collectDescendantKeys(spec, childKey)) {\n if (descendantKey === childKey) {\n continue;\n }\n\n const descendant = getElement(spec, descendantKey);\n if (descendant && isContextShellType(descendant.type)) {\n issues.push({\n path: `/elements/${descendantKey}`,\n message: `Shell component \"${descendant.type}\" cannot be nested inside a card.`,\n });\n }\n }\n }\n\n return issues;\n}\n\nexport function formatContextSpecIssues(issues: ContextSpecIssue[]): string {\n return issues\n .map((issue) => {\n const severity = issue.severity ?? \"error\";\n return `${severity.toUpperCase()} ${issue.path}: ${issue.message}`;\n })\n .join(\"\\n\");\n}\n\nexport { CONTEXT_SHELL_TYPES, CONTEXT_TOP_LEVEL_TYPES };\n","import type { Spec } from \"@json-render/core\";\nimport { validateSpec } from \"@json-render/core\";\nimport type { z } from \"zod\";\n\nimport { contextCatalog, contextComponents } from \"./catalog/catalog-def\";\nimport {\n type ContextSpecIssue,\n type ContextSpecIssueSeverity,\n formatContextSpecIssues,\n validateContextSpec,\n} from \"./validate-context-spec\";\n\ntype CatalogComponent = {\n props?: z.ZodType;\n slots?: string[];\n};\n\nfunction pushIssue(\n issues: ContextSpecIssue[],\n path: string,\n message: string,\n severity: ContextSpecIssueSeverity,\n) {\n issues.push({ path, message, severity });\n}\n\nfunction formatZodPath(basePath: string, zodPath: PropertyKey[]): string {\n if (zodPath.length === 0) {\n return basePath;\n }\n\n const suffix = zodPath\n .map((segment) => (typeof segment === \"number\" ? `[${segment}]` : `.${String(segment)}`))\n .join(\"\")\n .replace(/^\\./, \"\");\n\n return `${basePath}/${suffix}`;\n}\n\nfunction getCatalogEntry(type: string): CatalogComponent | undefined {\n return contextComponents[type as keyof typeof contextComponents] as CatalogComponent | undefined;\n}\n\nfunction isLeafComponent(catalogEntry: CatalogComponent | undefined): boolean {\n return (catalogEntry?.slots?.length ?? 0) === 0;\n}\n\nfunction addAgentUxHints(spec: Spec, issues: ContextSpecIssue[]) {\n for (const [key, element] of Object.entries(spec.elements)) {\n if (!element) {\n continue;\n }\n\n if (element.type === \"ContextCard\") {\n const props = element.props as { defaultExpanded?: boolean };\n if (props.defaultExpanded === false) {\n pushIssue(\n issues,\n `/elements/${key}/props/defaultExpanded`,\n \"defaultExpanded: false shows only the card header until the user expands the card.\",\n \"warn\",\n );\n }\n }\n }\n}\n\nexport function validateContextSpecDeep(spec: Spec): ContextSpecIssue[] {\n const issues: ContextSpecIssue[] = [];\n\n for (const issue of validateContextSpec(spec)) {\n pushIssue(issues, issue.path, issue.message, \"error\");\n }\n\n const structural = validateSpec(spec);\n if (!structural.valid) {\n for (const issue of structural.issues) {\n const path = issue.elementKey ? `/elements/${issue.elementKey}` : \"/\";\n pushIssue(issues, path, issue.message, issue.severity === \"warning\" ? \"warn\" : \"error\");\n }\n }\n\n const catalogValidation = contextCatalog.validate(spec);\n if (!catalogValidation.success && catalogValidation.error) {\n for (const issue of catalogValidation.error.issues) {\n const path = issue.path.length > 0 ? `/${issue.path.join(\"/\")}` : \"/\";\n if (path.endsWith(\"/visible\")) {\n continue;\n }\n if (\n path.endsWith(\"/children\") &&\n issue.message.includes(\"expected array, received undefined\")\n ) {\n continue;\n }\n pushIssue(issues, path, issue.message, \"error\");\n }\n }\n\n for (const [key, element] of Object.entries(spec.elements)) {\n if (!element) {\n continue;\n }\n\n const catalogEntry = getCatalogEntry(element.type);\n if (!catalogEntry) {\n pushIssue(\n issues,\n `/elements/${key}`,\n `Unknown component type \"${element.type}\" for context catalog.`,\n \"error\",\n );\n continue;\n }\n\n if (catalogEntry.props) {\n const propsResult = catalogEntry.props.safeParse(element.props ?? {});\n if (!propsResult.success) {\n for (const issue of propsResult.error.issues) {\n pushIssue(\n issues,\n formatZodPath(`/elements/${key}/props`, issue.path),\n issue.message,\n \"error\",\n );\n }\n }\n }\n\n const childKeys = element.children;\n const leaf = isLeafComponent(catalogEntry);\n\n if (childKeys === undefined && leaf) {\n pushIssue(\n issues,\n `/elements/${key}/children`,\n `Leaf element \"${element.type}\" should include \"children\": [].`,\n \"warn\",\n );\n }\n\n if (leaf && (childKeys?.length ?? 0) > 0) {\n pushIssue(\n issues,\n `/elements/${key}/children`,\n `Leaf component \"${element.type}\" must not have children.`,\n \"error\",\n );\n }\n }\n\n addAgentUxHints(spec, issues);\n\n return issues;\n}\n\nexport function postProcessContextSpec(spec: Spec): { spec: Spec; fixes: string[] } {\n const fixes: string[] = [];\n const next = structuredClone(spec) as Spec;\n\n for (const [key, element] of Object.entries(next.elements)) {\n if (!element) {\n continue;\n }\n\n const catalogEntry = getCatalogEntry(element.type);\n const leaf = isLeafComponent(catalogEntry);\n\n if (element.children === undefined && leaf) {\n element.children = [];\n fixes.push(`Added children: [] to leaf element \"${key}\".`);\n }\n\n if (leaf && element.children && element.children.length > 0) {\n element.children = [];\n fixes.push(`Removed illegal children from leaf element \"${key}\".`);\n }\n }\n\n return { spec: next, fixes };\n}\n\nexport function hasContextSpecErrors(issues: ContextSpecIssue[]): boolean {\n return issues.some((issue) => issue.severity !== \"warn\");\n}\n\nexport function formatContextRenderReport(spec: Spec): string {\n const issues = validateContextSpecDeep(spec);\n return formatContextSpecIssues(issues);\n}\n","import { Alert } from \"@servicetitan/anvil2\";\nimport type { ReactNode } from \"react\";\nimport type { z } from \"zod\";\n\nimport { alertCatalog } from \"./alert.catalog\";\n\nexport { alertCatalog };\n\nexport const AlertRenderer = ({\n props,\n emit,\n children,\n}: {\n props: z.infer<typeof alertCatalog.props>;\n emit: (event: string) => void;\n children?: ReactNode;\n}) => (\n <Alert\n title={props.title}\n status={props.status ?? \"info\"}\n {...(props.aiMark ? { aiMark: true } : {})}\n {...(props.dismissible ? { onClose: () => emit(\"close\") } : {})}\n >\n {children}\n </Alert>\n);\n","import { style } from \"@vanilla-extract/css\";\n\nexport const chartContainer = style({\n width: \"100%\",\n});\n","import type * as am5 from \"@amcharts/amcharts5\";\nimport am5themes_Animated from \"@amcharts/amcharts5/themes/Animated\";\nimport {\n ThemeCategorical,\n ThemeMonochrome,\n ThemeSemantic,\n} from \"@servicetitan/anvil2-ext-charts/am5\";\n\nexport function applyChartTheme(root: am5.Root, theme: string = \"monochrome\") {\n const themeMap: Record<string, typeof am5.Theme> = {\n monochrome: ThemeMonochrome,\n categorical: ThemeCategorical,\n semantic: ThemeSemantic,\n };\n const T = themeMap[theme] ?? ThemeMonochrome;\n root.setThemes([am5themes_Animated.new(root), T.new(root)]);\n}\n","import * as am5 from \"@amcharts/amcharts5\";\nimport * as am5xy from \"@amcharts/amcharts5/xy\";\nimport { useEffect, useRef } from \"react\";\nimport type { z } from \"zod\";\n\nimport { barChartCatalog } from \"./bar-chart.catalog\";\nimport { chartContainer } from \"./chart.css\";\nimport { applyChartTheme } from \"./chart-utils\";\n\nexport { barChartCatalog };\n\nexport const BarChartRenderer = ({ props }: { props: z.infer<typeof barChartCatalog.props> }) => {\n const divRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const el = divRef.current;\n if (!el) {\n return;\n }\n\n let root: am5.Root | undefined;\n\n const init = () => {\n if (root) {\n root.dispose();\n }\n root = am5.Root.new(el);\n applyChartTheme(root, props.theme);\n const chart = root.container.children.push(am5xy.XYChart.new(root, { paddingLeft: 0 }));\n\n if (props.orientation === \"horizontal\") {\n const yAxis = chart.yAxes.push(\n am5xy.CategoryAxis.new(root, {\n categoryField: \"category\",\n renderer: am5xy.AxisRendererY.new(root, { minGridDistance: 20 }),\n }),\n );\n const xAxis = chart.xAxes.push(\n am5xy.ValueAxis.new(root, {\n renderer: am5xy.AxisRendererX.new(root, {}),\n }),\n );\n const series = chart.series.push(\n am5xy.ColumnSeries.new(root, {\n xAxis,\n yAxis,\n valueXField: \"value\",\n categoryYField: \"category\",\n }),\n );\n series.columns.template.setAll({\n tooltipText: `{categoryY}: ${props.unit ?? \"\"}{valueX}`,\n });\n yAxis.data.setAll(props.data);\n series.data.setAll(props.data);\n } else {\n const xAxis = chart.xAxes.push(\n am5xy.CategoryAxis.new(root, {\n categoryField: \"category\",\n renderer: am5xy.AxisRendererX.new(root, { minGridDistance: 30 }),\n }),\n );\n const yAxis = chart.yAxes.push(\n am5xy.ValueAxis.new(root, {\n renderer: am5xy.AxisRendererY.new(root, {}),\n }),\n );\n const series = chart.series.push(\n am5xy.ColumnSeries.new(root, {\n xAxis,\n yAxis,\n valueYField: \"value\",\n categoryXField: \"category\",\n }),\n );\n series.columns.template.setAll({\n tooltipText: `{categoryX}: ${props.unit ?? \"\"}{valueY}`,\n });\n xAxis.data.setAll(props.data);\n series.data.setAll(props.data);\n }\n };\n\n // Defer init until the element has a real width\n const observer = new ResizeObserver((entries) => {\n const width = entries[0]?.contentRect.width ?? 0;\n if (width > 0 && !root) {\n init();\n }\n });\n observer.observe(el);\n\n // Also try immediately in case it's already laid out\n if (el.offsetWidth > 0) {\n init();\n }\n\n return () => {\n observer.disconnect();\n root?.dispose();\n };\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n return <div ref={divRef} className={chartContainer} style={{ height: props.height ?? 300 }} />;\n};\n","type DefinedProps<T extends Record<string, unknown>> = {\n [K in keyof T as T[K] extends undefined ? never : K]: Exclude<T[K], undefined>;\n};\n\n/** Omit keys whose values are `undefined` — required for exactOptionalPropertyTypes spreads. */\nexport function definedProps<T extends Record<string, unknown>>(props: T): DefinedProps<T> {\n const result = {} as DefinedProps<T>;\n for (const key of Object.keys(props) as Array<keyof T>) {\n const value = props[key];\n if (value !== undefined) {\n result[key as keyof DefinedProps<T>] = value as DefinedProps<T>[keyof DefinedProps<T>];\n }\n }\n return result;\n}\n","import { Badge, Button } from \"@servicetitan/anvil2\";\nimport type { z } from \"zod\";\n\nimport { definedProps } from \"../../utils/defined-props\";\nimport { buttonCatalog } from \"./button.catalog\";\n\nexport { buttonCatalog };\n\nexport const ButtonRenderer = ({\n props,\n emit,\n}: {\n props: z.infer<typeof buttonCatalog.props>;\n emit: (event: string) => void;\n}) => (\n <Button\n appearance={props.appearance ?? \"secondary\"}\n {...definedProps({\n size: props.size,\n loading: props.loading,\n disabled: props.disabled,\n })}\n onClick={() => emit(\"press\")}\n >\n {props.label}\n {props.badge !== undefined ? (\n <Badge aria-label={props.badge ? `${props.badge} unread` : \"unread\"}>{props.badge}</Badge>\n ) : null}\n </Button>\n);\n","import { Card, Flex, Text } from \"@servicetitan/anvil2\";\nimport type { ReactNode } from \"react\";\nimport type { z } from \"zod\";\n\nimport { definedProps } from \"../../utils/defined-props\";\nimport { cardCatalog } from \"./card.catalog\";\n\nexport { cardCatalog };\n\nexport const CardRenderer = ({\n props,\n children,\n}: {\n props: z.infer<typeof cardCatalog.props>;\n children?: ReactNode;\n}) => {\n const hasHeader = props.title !== undefined || props.description !== undefined;\n\n return (\n <Card\n flexDirection=\"column\"\n gap=\"3\"\n {...definedProps({ background: props.background, padding: props.padding })}\n >\n {hasHeader ? (\n <Flex direction=\"column\" gap=\"half\">\n {props.title !== undefined ? (\n <Text variant=\"headline\" el=\"h3\" size=\"small\">\n {props.title}\n </Text>\n ) : null}\n {props.description !== undefined ? (\n <Text variant=\"body\" subdued>\n {props.description}\n </Text>\n ) : null}\n </Flex>\n ) : null}\n {children}\n </Card>\n );\n};\n","import { defineCatalog } from \"@json-render/core\";\nimport { schema } from \"@json-render/react/schema\";\n\nimport { actionsCatalog } from \"../actions\";\n\nimport { baseComponents } from \"./schemas\";\n\nexport { baseComponents };\n\nexport const catalog = defineCatalog(schema, {\n components: baseComponents,\n actions: actionsCatalog,\n});\n","import { getByPath } from \"@json-render/core\";\nimport { useStateStore } from \"@json-render/react\";\nimport { Checkbox } from \"@servicetitan/anvil2\";\nimport type { z } from \"zod\";\n\nimport { definedProps } from \"../../utils/defined-props\";\nimport { checkboxCatalog } from \"./checkbox.catalog\";\n\nexport { checkboxCatalog };\n\nexport const CheckboxRenderer = ({\n props,\n bindings,\n emit,\n}: {\n props: z.infer<typeof checkboxCatalog.props>;\n bindings?: Record<string, string>;\n emit: (event: string) => void;\n}) => {\n const bindingPath = bindings?.checked;\n const { state, set } = useStateStore();\n const stateChecked = bindingPath\n ? (getByPath(state, bindingPath) as boolean | undefined)\n : undefined;\n const checked = bindingPath ? (stateChecked ?? props.checked ?? false) : (props.checked ?? false);\n\n return (\n <Checkbox\n label={props.label}\n checked={checked}\n {...definedProps({ disabled: props.disabled })}\n onClick={(_e, state) => {\n if (bindingPath) {\n set(bindingPath, !(state?.checked ?? false));\n }\n emit(\"change\");\n }}\n />\n );\n};\n","import { Chip } from \"@servicetitan/anvil2\";\nimport CheckCircle from \"@servicetitan/anvil2/assets/icons/material/round/check_circle.svg\";\nimport RadioButtonUnchecked from \"@servicetitan/anvil2/assets/icons/material/round/radio_button_unchecked.svg\";\nimport InProgress from \"@servicetitan/anvil2/assets/icons/st/in_progress.svg\";\nimport type { z } from \"zod\";\n\nimport { definedProps } from \"../../utils/defined-props\";\nimport { chipCatalog } from \"./chip.catalog\";\n\nexport { chipCatalog };\n\nconst CHIP_ICON_MAP = {\n \"check-circle\": CheckCircle,\n \"in-progress\": InProgress,\n \"radio-button-unchecked\": RadioButtonUnchecked,\n} as const;\n\nexport const ChipRenderer = ({\n props,\n emit,\n}: {\n props: z.infer<typeof chipCatalog.props>;\n emit: (event: string) => void;\n}) => {\n const icon = props.icon ? CHIP_ICON_MAP[props.icon] : undefined;\n const onClose = props.removable && props.size !== \"small\" ? () => emit(\"close\") : undefined;\n return (\n <Chip\n label={props.label}\n {...definedProps({ size: props.size, color: props.color, icon, onClose })}\n />\n );\n};\n","import { Divider } from \"@servicetitan/anvil2\";\nimport type { z } from \"zod\";\n\nimport { definedProps } from \"../../utils/defined-props\";\nimport { dividerCatalog } from \"./divider.catalog\";\n\nexport { dividerCatalog };\n\nexport const DividerRenderer = ({ props }: { props: z.infer<typeof dividerCatalog.props> }) => (\n <Divider\n {...definedProps({\n vertical: props.vertical,\n spacing: props.spacing,\n alignContent: props.alignContent,\n })}\n />\n);\n","import * as am5 from \"@amcharts/amcharts5\";\nimport * as am5percent from \"@amcharts/amcharts5/percent\";\nimport { useEffect, useRef } from \"react\";\nimport type { z } from \"zod\";\nimport { chartContainer } from \"./chart.css\";\nimport { applyChartTheme } from \"./chart-utils\";\nimport { donutChartCatalog } from \"./donut-chart.catalog\";\n\nexport { donutChartCatalog };\n\nexport const DonutChartRenderer = ({\n props,\n}: {\n props: z.infer<typeof donutChartCatalog.props>;\n}) => {\n const divRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const el = divRef.current;\n if (!el) {\n return;\n }\n\n let root: am5.Root | undefined;\n\n const init = () => {\n if (root) {\n root.dispose();\n }\n root = am5.Root.new(el);\n applyChartTheme(root, props.theme);\n const chart = root.container.children.push(\n am5percent.PieChart.new(root, {\n layout: root.horizontalLayout,\n innerRadius: am5.percent(50),\n }),\n );\n const series = chart.series.push(\n am5percent.PieSeries.new(root, {\n valueField: \"value\",\n categoryField: \"category\",\n legendValueText: \"\",\n }),\n );\n series.labels.template.set(\"text\", \"{valuePercentTotal.formatNumber('#.')}%\");\n series.data.setAll(props.data);\n\n if (props.showLegend ?? true) {\n const legend = chart.children.push(\n am5.Legend.new(root, {\n centerY: am5.percent(50),\n y: am5.percent(50),\n layout: root.verticalLayout,\n }),\n );\n legend.data.setAll(series.dataItems);\n }\n };\n\n // Defer init until the element has a real width\n const observer = new ResizeObserver((entries) => {\n const width = entries[0]?.contentRect.width ?? 0;\n if (width > 0 && !root) {\n init();\n }\n });\n observer.observe(el);\n\n // Also try immediately in case it's already laid out\n if (el.offsetWidth > 0) {\n init();\n }\n\n return () => {\n observer.disconnect();\n root?.dispose();\n };\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n return <div ref={divRef} className={chartContainer} style={{ height: props.height ?? 300 }} />;\n};\n","import { Flex } from \"@servicetitan/anvil2\";\nimport type { ReactNode } from \"react\";\nimport type { z } from \"zod\";\n\nimport { definedProps } from \"../../utils/defined-props\";\nimport { flexCatalog } from \"./flex.catalog\";\n\nexport { flexCatalog };\n\nexport const FlexRenderer = ({\n props,\n children,\n}: {\n props: z.infer<typeof flexCatalog.props>;\n children?: ReactNode;\n}) => (\n <Flex\n {...definedProps({\n direction: props.direction,\n gap: props.gap,\n alignItems: props.alignItems,\n justifyContent: props.justifyContent,\n alignSelf: props.alignSelf,\n wrap: props.wrap,\n grow: props.grow,\n shrink: props.shrink,\n basis: props.basis,\n inline: props.inline,\n })}\n >\n {children}\n </Flex>\n);\n","/**\n * Join class names, dropping any falsy entry. The de-facto `clsx`-shaped\n * helper but kept dependency-free — vendored via `@carto-internal/tools` and\n * compiled into consuming packages at build time.\n */\nexport const cx = (...classes: Array<string | false | null | undefined>): string =>\n classes.filter(Boolean).join(\" \");\n","import { primitive, semantic } from \"@servicetitan/carto-react-kit/tokens\";\nimport { style } from \"@vanilla-extract/css\";\n\nexport const borderedGrid = style({\n display: \"grid\",\n borderWidth: primitive.size[\"25\"],\n borderStyle: \"solid\",\n borderColor: semantic.border.color.standard,\n borderRadius: semantic.radius.trim,\n overflow: \"hidden\",\n});\n\nexport const borderedGridCell = style({\n paddingBlock: primitive.size[\"200\"],\n paddingInline: primitive.size[\"300\"],\n});\n\n/** Row separator — omit on the last row so it does not stack on the container bottom edge. */\nexport const borderedGridRowDivider = style({\n borderBottomWidth: primitive.size[\"25\"],\n borderBottomStyle: \"solid\",\n borderBottomColor: semantic.border.color.standard,\n});\n","import { cx } from \"@carto-internal/tools/cx\";\nimport { Grid } from \"@servicetitan/anvil2\";\nimport { Children, type ReactNode } from \"react\";\nimport type { z } from \"zod\";\nimport { gridCatalog } from \"./grid.catalog\";\nimport { borderedGrid, borderedGridCell, borderedGridRowDivider } from \"./grid.css\";\n\nexport { gridCatalog };\n\n/** Best-effort column count for catalog templateColumns strings (e.g. `1fr 1fr`, `repeat(3, 1fr)`). */\nfunction estimateColumnCount(templateColumns: string): number {\n const repeatMatch = templateColumns.match(/repeat\\(\\s*(\\d+)/);\n if (repeatMatch?.[1]) {\n return Number(repeatMatch[1]);\n }\n return templateColumns.trim().split(/\\s+/).length;\n}\n\nexport const GridRenderer = ({\n props,\n children,\n}: {\n props: z.infer<typeof gridCatalog.props>;\n children?: ReactNode;\n}) => {\n if (props.bordered) {\n const templateColumns = props.templateColumns ?? \"1fr\";\n const childCount = Children.count(children);\n const columnCount = Math.max(1, estimateColumnCount(templateColumns));\n const lastRowStartIndex = Math.max(0, childCount - (childCount % columnCount || columnCount));\n\n return (\n <div className={borderedGrid} style={{ gridTemplateColumns: templateColumns }}>\n {Children.map(children, (child, index) => (\n <div\n className={cx(borderedGridCell, index < lastRowStartIndex && borderedGridRowDivider)}\n >\n {child}\n </div>\n ))}\n </div>\n );\n }\n\n return (\n <Grid templateColumns={props.templateColumns} gap={props.gap ?? \"2\"}>\n {children}\n </Grid>\n );\n};\n","import { Icon } from \"@servicetitan/anvil2\";\nimport CheckCircle from \"@servicetitan/anvil2/assets/icons/material/round/check_circle.svg\";\nimport RadioButtonUnchecked from \"@servicetitan/anvil2/assets/icons/material/round/radio_button_unchecked.svg\";\nimport InProgress from \"@servicetitan/anvil2/assets/icons/st/in_progress.svg\";\nimport type { ComponentProps } from \"react\";\nimport type { z } from \"zod\";\n\nimport { definedProps } from \"../../utils/defined-props\";\nimport { iconCatalog } from \"./icon.catalog\";\n\nexport { iconCatalog };\n\ntype IconName = z.infer<typeof iconCatalog.props>[\"name\"];\ntype IconSvg = NonNullable<ComponentProps<typeof Icon>[\"svg\"]>;\n\nconst SVG_MAP = {\n \"check-circle\": CheckCircle,\n \"in-progress\": InProgress,\n \"radio-button-unchecked\": RadioButtonUnchecked,\n} satisfies Record<IconName, IconSvg>;\n\nexport const IconRenderer = ({ props }: { props: z.infer<typeof iconCatalog.props> }) => {\n const svg = SVG_MAP[props.name];\n if (!svg) {\n return null;\n }\n return <Icon svg={svg} {...definedProps({ size: props.size, color: props.color })} />;\n};\n","import { getByPath } from \"@json-render/core\";\nimport { useStateStore } from \"@json-render/react\";\nimport { TextField } from \"@servicetitan/anvil2\";\nimport type { z } from \"zod\";\n\nimport { definedProps } from \"../../utils/defined-props\";\nimport { inputCatalog } from \"./input.catalog\";\n\nexport { inputCatalog };\n\nexport const InputRenderer = ({\n props,\n bindings,\n emit,\n}: {\n props: z.infer<typeof inputCatalog.props>;\n bindings?: Record<string, string>;\n emit: (event: string) => void;\n}) => {\n const bindingPath = bindings?.value;\n const { state, set } = useStateStore();\n const stateValue = bindingPath\n ? (getByPath(state, bindingPath) as string | undefined)\n : undefined;\n const value = bindingPath ? (stateValue ?? props.value ?? \"\") : (props.value ?? \"\");\n\n return (\n <TextField\n label={props.label}\n type={props.type ?? \"text\"}\n value={value}\n {...definedProps({ placeholder: props.placeholder, disabled: props.disabled })}\n onChange={(e) => {\n if (bindingPath) {\n set(bindingPath, e.target.value);\n }\n emit(\"change\");\n }}\n />\n );\n};\n","import * as am5 from \"@amcharts/amcharts5\";\nimport * as am5xy from \"@amcharts/amcharts5/xy\";\nimport { useEffect, useRef } from \"react\";\nimport type { z } from \"zod\";\nimport { chartContainer } from \"./chart.css\";\nimport { applyChartTheme } from \"./chart-utils\";\nimport { lineChartCatalog } from \"./line-chart.catalog\";\n\nexport { lineChartCatalog };\n\nexport const LineChartRenderer = ({ props }: { props: z.infer<typeof lineChartCatalog.props> }) => {\n const divRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const el = divRef.current;\n if (!el) {\n return;\n }\n\n let root: am5.Root | undefined;\n\n const init = () => {\n if (root) {\n root.dispose();\n }\n root = am5.Root.new(el);\n applyChartTheme(root, props.theme);\n\n const chart = root.container.children.push(am5xy.XYChart.new(root, { paddingLeft: 0 }));\n\n const xAxis = chart.xAxes.push(\n am5xy.CategoryAxis.new(root, {\n categoryField: \"category\",\n renderer: am5xy.AxisRendererX.new(root, { minGridDistance: 30 }),\n }),\n );\n\n const yAxis = chart.yAxes.push(\n am5xy.ValueAxis.new(root, {\n renderer: am5xy.AxisRendererY.new(root, {}),\n }),\n );\n\n const firstRow = props.data[0];\n const seriesKeys =\n props.series ?? (firstRow ? Object.keys(firstRow).filter((k) => k !== \"category\") : []);\n\n for (const key of seriesKeys) {\n const series = chart.series.push(\n am5xy.LineSeries.new(root, {\n name: key,\n xAxis,\n yAxis,\n valueYField: key,\n categoryXField: \"category\",\n tooltip: am5.Tooltip.new(root, {\n labelText: `${key}: ${props.unit ?? \"\"}{valueY}`,\n }),\n }),\n );\n\n series.strokes.template.setAll({ strokeWidth: 2 });\n\n if (props.showDots ?? true) {\n series.bullets.push(() => {\n if (!root) {\n throw new Error(\"Chart root is not initialized\");\n }\n const fill = series.get(\"fill\");\n return am5.Bullet.new(root, {\n sprite: am5.Circle.new(root, {\n radius: 4,\n ...(fill ? { fill } : {}),\n strokeWidth: 0,\n }),\n });\n });\n }\n\n series.data.setAll(props.data);\n }\n\n xAxis.data.setAll(props.data);\n\n const showLegend = props.showLegend ?? seriesKeys.length > 1;\n if (showLegend) {\n chart.children\n .push(\n am5.Legend.new(root, {\n centerX: am5.percent(50),\n x: am5.percent(50),\n marginTop: 8,\n }),\n )\n .data.setAll(chart.series.values);\n }\n };\n\n const observer = new ResizeObserver((entries) => {\n const width = entries[0]?.contentRect.width ?? 0;\n if (width > 0 && !root) {\n init();\n }\n });\n observer.observe(el);\n\n if (el.offsetWidth > 0) {\n init();\n }\n\n return () => {\n observer.disconnect();\n root?.dispose();\n };\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n return <div ref={divRef} className={chartContainer} style={{ height: props.height ?? 300 }} />;\n};\n","import { Badge, Link } from \"@servicetitan/anvil2\";\nimport type { MouseEvent } from \"react\";\nimport type { z } from \"zod\";\n\nimport { linkCatalog } from \"./link.catalog\";\n\nexport { linkCatalog };\n\nexport const LinkRenderer = ({\n props,\n emit,\n}: {\n props: z.infer<typeof linkCatalog.props>;\n emit: (event: string) => void;\n}) => {\n const { label, href, appearance, target, ghost, badge } = props;\n const onClick = (e: MouseEvent<HTMLAnchorElement>) => {\n e.preventDefault();\n emit(\"press\");\n };\n // The Anvil2 Badge is absolutely positioned and needs a positioned ancestor.\n // A Link renders an <a> that isn't position:relative on its own (unlike Button),\n // so wrap the label + badge in a relative inline anchor.\n const content =\n badge !== undefined ? (\n <span style={{ position: \"relative\", display: \"inline-flex\", alignItems: \"center\" }}>\n {label}\n <Badge aria-label={badge ? `${badge} unread` : \"unread\"} offset={{ x: \"8px\", y: \"0px\" }}>\n {badge}\n </Badge>\n </span>\n ) : (\n label\n );\n\n if (appearance === \"secondary\") {\n return (\n <Link\n appearance=\"secondary\"\n ghost={false}\n href={href}\n {...(target ? { target } : {})}\n onClick={onClick}\n >\n {content}\n </Link>\n );\n }\n\n if (ghost !== undefined) {\n return (\n <Link\n appearance=\"primary\"\n ghost={ghost}\n href={href}\n {...(target ? { target } : {})}\n onClick={onClick}\n >\n {content}\n </Link>\n );\n }\n\n return (\n <Link appearance=\"primary\" href={href} {...(target ? { target } : {})} onClick={onClick}>\n {content}\n </Link>\n );\n};\n","import { semantic } from \"@servicetitan/carto-react-kit/tokens\";\nimport { recipe } from \"@vanilla-extract/recipes\";\n\nexport const listboxWrapper = recipe({\n base: {},\n variants: {\n disabled: {\n true: {\n pointerEvents: \"none\",\n opacity: semantic.opacity.disabled,\n },\n false: {},\n },\n },\n});\n","import { getByPath } from \"@json-render/core\";\nimport { useStateStore } from \"@json-render/react\";\nimport { FieldLabel, Listbox } from \"@servicetitan/anvil2\";\nimport type { z } from \"zod\";\n\nimport { listboxCatalog } from \"./listbox.catalog\";\nimport { listboxWrapper } from \"./listbox.css\";\n\nexport { listboxCatalog };\n\nexport const ListboxRenderer = ({\n props,\n bindings,\n emit,\n}: {\n props: z.infer<typeof listboxCatalog.props>;\n bindings?: Record<string, string>;\n emit: (event: string) => void;\n}) => {\n const bindingPath = bindings?.value;\n const { state, set } = useStateStore();\n const stateSelected = bindingPath\n ? (getByPath(state, bindingPath) as string | undefined)\n : undefined;\n const selected = bindingPath ? (stateSelected ?? props.value ?? \"\") : (props.value ?? \"\");\n\n const items = props.options.map((o) => ({ id: o.value, label: o.label }));\n const selectedItem = items.find((i) => i.id === selected);\n\n return (\n <div className={listboxWrapper({ disabled: props.disabled ?? false })}>\n <FieldLabel>{props.label}</FieldLabel>\n <Listbox\n items={items}\n {...(selectedItem ? { selected: selectedItem } : {})}\n onSelectionChange={(item: { id: string } | undefined) => {\n const val = item?.id ?? \"\";\n if (bindingPath) {\n set(bindingPath, val);\n }\n emit(\"change\");\n }}\n >\n {({ items: renderedItems }: { items: typeof items }) =>\n renderedItems.map((item) => (\n <Listbox.Option key={item.id} item={item}>\n {item.label}\n </Listbox.Option>\n ))\n }\n </Listbox>\n </div>\n );\n};\n","import { ProgressBar } from \"@servicetitan/anvil2\";\nimport type { z } from \"zod\";\n\nimport { definedProps } from \"../../utils/defined-props\";\nimport { progressBarCatalog } from \"./progress-bar.catalog\";\n\nexport { progressBarCatalog };\n\nexport const ProgressBarRenderer = ({\n props,\n}: {\n props: z.infer<typeof progressBarCatalog.props>;\n}) => {\n const descriptionProps = definedProps({ description: props.description });\n\n if (props.indeterminate) {\n return <ProgressBar label={props.label} indeterminate {...descriptionProps} />;\n }\n\n if (props.value !== undefined) {\n return <ProgressBar label={props.label} value={props.value} {...descriptionProps} />;\n }\n\n return <ProgressBar label={props.label} indeterminate {...descriptionProps} />;\n};\n","import { getByPath } from \"@json-render/core\";\nimport { useStateStore } from \"@json-render/react\";\nimport { Radio } from \"@servicetitan/anvil2\";\nimport type { z } from \"zod\";\n\nimport { definedProps } from \"../../utils/defined-props\";\nimport { radioGroupCatalog } from \"./radio-group.catalog\";\n\nexport { radioGroupCatalog };\n\nexport const RadioGroupRenderer = ({\n props,\n bindings,\n emit,\n}: {\n props: z.infer<typeof radioGroupCatalog.props>;\n bindings?: Record<string, string>;\n emit: (event: string) => void;\n}) => {\n const bindingPath = bindings?.value;\n const { state, set } = useStateStore();\n const stateSelected = bindingPath\n ? (getByPath(state, bindingPath) as string | undefined)\n : undefined;\n const selected = bindingPath ? (stateSelected ?? props.value ?? \"\") : (props.value ?? \"\");\n\n return (\n <Radio.Group legend={props.label}>\n {props.options.map((o) => (\n <Radio\n key={o.value}\n label={o.label}\n value={o.value}\n checked={selected === o.value}\n {...definedProps({ disabled: props.disabled })}\n onChange={() => {\n if (bindingPath) {\n set(bindingPath, o.value);\n }\n emit(\"change\");\n }}\n />\n ))}\n </Radio.Group>\n );\n};\n","import { getByPath } from \"@json-render/core\";\nimport { useStateStore } from \"@json-render/react\";\nimport { Switch } from \"@servicetitan/anvil2\";\nimport type { z } from \"zod\";\n\nimport { definedProps } from \"../../utils/defined-props\";\nimport { switchCatalog } from \"./switch.catalog\";\n\nexport { switchCatalog };\n\nexport const SwitchRenderer = ({\n props,\n bindings,\n emit,\n}: {\n props: z.infer<typeof switchCatalog.props>;\n bindings?: Record<string, string>;\n emit: (event: string) => void;\n}) => {\n const bindingPath = bindings?.checked;\n const { state, set } = useStateStore();\n const stateChecked = bindingPath\n ? (getByPath(state, bindingPath) as boolean | undefined)\n : undefined;\n const checked = bindingPath ? (stateChecked ?? props.checked ?? false) : (props.checked ?? false);\n\n return (\n <Switch\n label={props.label}\n value={props.label}\n checked={checked}\n {...definedProps({ disabled: props.disabled })}\n onChange={(_e, state) => {\n if (bindingPath) {\n set(bindingPath, state?.checked ?? false);\n }\n emit(\"change\");\n }}\n />\n );\n};\n","import { Text } from \"@servicetitan/anvil2\";\nimport type { z } from \"zod\";\n\nimport { textCatalog } from \"./text.catalog\";\n\nexport { textCatalog };\n\nexport const TextRenderer = ({ props }: { props: z.infer<typeof textCatalog.props> }) => {\n if (props.variant === \"headline\") {\n if (props.size !== undefined) {\n return (\n <Text variant=\"headline\" el=\"h3\" size={props.size}>\n {props.content}\n </Text>\n );\n }\n return (\n <Text variant=\"headline\" el=\"h3\">\n {props.content}\n </Text>\n );\n }\n if (props.variant === \"eyebrow\") {\n return <Text variant=\"eyebrow\">{props.content}</Text>;\n }\n if (props.size !== undefined && props.subdued !== undefined) {\n return (\n <Text variant=\"body\" size={props.size} subdued={props.subdued}>\n {props.content}\n </Text>\n );\n }\n if (props.size !== undefined) {\n return (\n <Text variant=\"body\" size={props.size}>\n {props.content}\n </Text>\n );\n }\n if (props.subdued !== undefined) {\n return (\n <Text variant=\"body\" subdued={props.subdued}>\n {props.content}\n </Text>\n );\n }\n return <Text variant=\"body\">{props.content}</Text>;\n};\n","import { getByPath } from \"@json-render/core\";\nimport { useStateStore } from \"@json-render/react\";\nimport { Textarea } from \"@servicetitan/anvil2\";\nimport type { z } from \"zod\";\n\nimport { definedProps } from \"../../utils/defined-props\";\nimport { textareaCatalog } from \"./textarea.catalog\";\n\nexport { textareaCatalog };\n\nexport const TextareaRenderer = ({\n props,\n bindings,\n emit,\n}: {\n props: z.infer<typeof textareaCatalog.props>;\n bindings?: Record<string, string>;\n emit: (event: string) => void;\n}) => {\n const bindingPath = bindings?.value;\n const { state, set } = useStateStore();\n const stateValue = bindingPath\n ? (getByPath(state, bindingPath) as string | undefined)\n : undefined;\n const value = bindingPath ? (stateValue ?? props.value ?? \"\") : (props.value ?? \"\");\n\n return (\n <Textarea\n label={props.label}\n value={value}\n {...definedProps({\n placeholder: props.placeholder,\n description: props.description,\n moreInfo: props.moreInfo,\n rows: props.rows,\n disabled: props.disabled,\n })}\n onChange={(e) => {\n if (bindingPath) {\n set(bindingPath, e.target.value);\n }\n emit(\"change\");\n }}\n />\n );\n};\n","import type { CatalogEntry } from \"../../types\";\n\nimport { AlertRenderer, alertCatalog } from \"./alert\";\nimport { BarChartRenderer, barChartCatalog } from \"./bar-chart\";\nimport { ButtonRenderer, buttonCatalog } from \"./button\";\nimport { CardRenderer, cardCatalog } from \"./card\";\nimport { baseComponents, catalog } from \"./catalog-def\";\nimport { CheckboxRenderer, checkboxCatalog } from \"./checkbox\";\nimport { ChipRenderer, chipCatalog } from \"./chip\";\nimport { DividerRenderer, dividerCatalog } from \"./divider\";\nimport { DonutChartRenderer, donutChartCatalog } from \"./donut-chart\";\nimport { FlexRenderer, flexCatalog } from \"./flex\";\nimport { GridRenderer, gridCatalog } from \"./grid\";\nimport { IconRenderer, iconCatalog } from \"./icon\";\nimport { InputRenderer, inputCatalog } from \"./input\";\nimport { LineChartRenderer, lineChartCatalog } from \"./line-chart\";\nimport { LinkRenderer, linkCatalog } from \"./link\";\nimport { ListboxRenderer, listboxCatalog } from \"./listbox\";\nimport { ProgressBarRenderer, progressBarCatalog } from \"./progress-bar\";\nimport { RadioGroupRenderer, radioGroupCatalog } from \"./radio-group\";\nimport { SwitchRenderer, switchCatalog } from \"./switch\";\nimport { TextRenderer, textCatalog } from \"./text\";\nimport { TextareaRenderer, textareaCatalog } from \"./textarea\";\n\nexport { baseComponents, catalog };\n\nexport const coreCatalogEntries: CatalogEntry[] = [\n { name: \"Text\", catalog: textCatalog, renderer: TextRenderer, renderers: [\"all\"] },\n { name: \"Card\", catalog: cardCatalog, renderer: CardRenderer, renderers: [\"all\"] },\n { name: \"Flex\", catalog: flexCatalog, renderer: FlexRenderer, renderers: [\"all\"] },\n { name: \"Grid\", catalog: gridCatalog, renderer: GridRenderer, renderers: [\"all\"] },\n { name: \"Alert\", catalog: alertCatalog, renderer: AlertRenderer, renderers: [\"all\"] },\n { name: \"Divider\", catalog: dividerCatalog, renderer: DividerRenderer, renderers: [\"all\"] },\n { name: \"Icon\", catalog: iconCatalog, renderer: IconRenderer, renderers: [\"all\"] },\n { name: \"Chip\", catalog: chipCatalog, renderer: ChipRenderer, renderers: [\"all\"] },\n { name: \"Link\", catalog: linkCatalog, renderer: LinkRenderer, renderers: [\"all\"] },\n {\n name: \"ProgressBar\",\n catalog: progressBarCatalog,\n renderer: ProgressBarRenderer,\n renderers: [\"all\"],\n },\n {\n name: \"BarChart\",\n catalog: barChartCatalog,\n renderer: BarChartRenderer,\n renderers: [\"all\"],\n },\n {\n name: \"DonutChart\",\n catalog: donutChartCatalog,\n renderer: DonutChartRenderer,\n renderers: [\"all\"],\n },\n {\n name: \"LineChart\",\n catalog: lineChartCatalog,\n renderer: LineChartRenderer,\n renderers: [\"all\"],\n },\n { name: \"Button\", catalog: buttonCatalog, renderer: ButtonRenderer, renderers: [\"all\"] },\n {\n name: \"Checkbox\",\n catalog: checkboxCatalog,\n renderer: CheckboxRenderer,\n renderers: [\"all\"],\n },\n { name: \"Input\", catalog: inputCatalog, renderer: InputRenderer, renderers: [\"all\"] },\n {\n name: \"Textarea\",\n catalog: textareaCatalog,\n renderer: TextareaRenderer,\n renderers: [\"all\"],\n },\n { name: \"Listbox\", catalog: listboxCatalog, renderer: ListboxRenderer, renderers: [\"all\"] },\n {\n name: \"RadioGroup\",\n catalog: radioGroupCatalog,\n renderer: RadioGroupRenderer,\n renderers: [\"all\"],\n },\n { name: \"Switch\", catalog: switchCatalog, renderer: SwitchRenderer, renderers: [\"all\"] },\n];\n\nexport const baseRenderers = Object.fromEntries(\n coreCatalogEntries.map(({ name, renderer }) => [name, renderer]),\n);\n","import { z } from \"zod\";\n\nexport const revenueCardCatalog = {\n props: z.object({\n title: z.string(),\n value: z.string(),\n trend: z.enum([\"up\", \"down\", \"flat\"]).optional(),\n delta: z.string().optional(),\n }),\n slots: [] as string[],\n description:\n 'KPI metric card. trend: up=green↑ down=red↓ flat=grey→. delta e.g. \"+12% vs last month\". Leaf node — no children.',\n};\n","import { primitive, semantic } from \"@servicetitan/carto-react-kit/tokens\";\nimport { type RecipeVariants, recipe } from \"@vanilla-extract/recipes\";\n\nexport const trendText = recipe({\n base: {\n fontWeight: primitive.font.weight[\"600\"],\n // TODO(carto-tokens): adopt a component/semantic typography token for 13px eyebrow-adjacent sizing.\n fontSize: \"13px\",\n },\n variants: {\n trend: {\n up: { color: primitive.color.green[\"600\"] },\n down: { color: primitive.color.red[\"600\"] },\n flat: { color: semantic.foreground.color.subtle },\n },\n },\n});\n\nexport type TrendTextVariants = RecipeVariants<typeof trendText>;\n","import { Card, Flex, Text } from \"@servicetitan/anvil2\";\nimport type { z } from \"zod\";\n\nimport { revenueCardCatalog } from \"./revenue-card.catalog\";\nimport { trendText } from \"./revenue-card.css\";\n\nexport { revenueCardCatalog };\n\nexport const RevenueCardRenderer = ({\n props,\n}: {\n props: z.infer<typeof revenueCardCatalog.props>;\n}) => {\n const trend = props.trend ?? \"flat\";\n const trendIcon = props.trend === \"up\" ? \"↑\" : props.trend === \"down\" ? \"↓\" : \"→\";\n const trendClassName = trendText({ trend });\n\n return (\n <Card>\n <Flex direction=\"column\" gap=\"2\">\n <Text variant=\"eyebrow\">{props.title}</Text>\n <Text variant=\"headline\" el=\"h3\">\n {props.value}\n </Text>\n {props.delta && (\n <Flex direction=\"row\" gap=\"1\" alignItems=\"center\">\n <span className={trendClassName}>{trendIcon}</span>\n <Text variant=\"eyebrow\" className={trendClassName}>\n {props.delta}\n </Text>\n </Flex>\n )}\n </Flex>\n </Card>\n );\n};\n","import type { CatalogEntry } from \"../../types\";\n\nimport { marketingCatalog } from \"./catalog\";\nimport { RevenueCardRenderer } from \"./components/revenue-card\";\nimport { revenueCardCatalog } from \"./components/revenue-card.catalog\";\n\nexport { marketingRenderers } from \"./components\";\nexport { marketingCatalog };\n\nexport const marketingCatalogEntries: CatalogEntry[] = [\n {\n name: \"RevenueCard\",\n catalog: revenueCardCatalog,\n renderer: RevenueCardRenderer,\n renderers: [\"chat\"],\n },\n];\n\nexport { scopedCatalogs } from \"./scoped-catalogs\";\n","import type { AllComponentRenderers } from \"./renderers/types\";\nimport type { ComponentCatalogDef } from \"./scoped-catalog\";\nimport type { CatalogEntry, RendererContext } from \"./types\";\n\nexport function filterCatalogEntries(\n entries: CatalogEntry[],\n renderer: RendererContext,\n): CatalogEntry[] {\n if (renderer === \"all\") {\n return [...entries];\n }\n return entries.filter(\n ({ renderers }) => renderers.includes(\"all\") || renderers.includes(renderer),\n );\n}\n\nexport function toComponentCatalogMap(\n entries: CatalogEntry[],\n): Record<string, ComponentCatalogDef> {\n return Object.fromEntries(entries.map(({ name, catalog }) => [name, catalog]));\n}\n\nexport function toComponentRendererMap(entries: CatalogEntry[]): AllComponentRenderers {\n return Object.fromEntries(\n entries.map(({ name, renderer }) => [name, renderer]),\n ) as AllComponentRenderers;\n}\n","import { defineCatalog } from \"@json-render/core\";\nimport { type Components, defineRegistry } from \"@json-render/react\";\nimport { schema } from \"@json-render/react/schema\";\nimport { contextCatalogEntries } from \"./context/catalog\";\nimport { actionsCatalog, actionsHandlers } from \"./core/actions\";\nimport { coreCatalogEntries } from \"./core/catalog\";\nimport { catalog as coreCatalog } from \"./core/catalog/catalog-def\";\nimport { marketingCatalogEntries } from \"./marketing/catalog\";\nimport {\n filterCatalogEntries,\n toComponentCatalogMap,\n toComponentRendererMap,\n} from \"./registry-utils\";\nimport type { RendererContext } from \"./types\";\n\nconst allCatalogEntries = [\n ...coreCatalogEntries,\n ...marketingCatalogEntries,\n ...contextCatalogEntries,\n];\n\nexport function getRegistry(renderer: RendererContext = \"chat\") {\n const filtered = filterCatalogEntries(allCatalogEntries, renderer);\n const components = toComponentCatalogMap(filtered);\n const renderers = toComponentRendererMap(filtered);\n\n const catalog = defineCatalog(schema, {\n components,\n actions: actionsCatalog,\n });\n\n return defineRegistry(catalog, {\n components: renderers as Components<typeof catalog>,\n actions: actionsHandlers,\n });\n}\n\n/** Default chat registry — preserves parity with the original flat registry export. */\nconst defaultRegistry = getRegistry(\"chat\");\n\nexport const registry = defaultRegistry.registry;\nexport const handlers = defaultRegistry.handlers;\nexport const executeAction = defaultRegistry.executeAction;\n\nexport function getContextRegistry() {\n return getRegistry(\"context\");\n}\n\n/** Core catalog used for schema generation and prompt artifacts. */\nexport { coreCatalog as catalog };\n","import type { Spec } from \"@json-render/core\";\n\n/**\n * Enrich the spec so every Button element automatically gets\n * on.press → submitUserAction wired up, using the button's element key\n * as actionId. Buttons that already have on.press are left untouched.\n */\nexport function enrichButtonActions(spec: Spec): Spec {\n const elements = { ...spec.elements };\n for (const [key, element] of Object.entries(elements)) {\n if (element.type !== \"Button\") {\n continue;\n }\n if (element.on?.press) {\n continue;\n }\n const actionId = key;\n elements[key] = {\n ...element,\n on: {\n ...element.on,\n press: { action: \"atlas.submitUserAction\", params: { actionId } },\n },\n };\n }\n return { ...spec, elements };\n}\n","import type { Spec } from \"@json-render/core\";\nimport { useMemo } from \"react\";\n\nexport type SpecEnrichment = (spec: Spec) => Spec;\n\nexport function useEnrichedSpec(spec: Spec, enrichments: SpecEnrichment[]): Spec {\n return useMemo(\n () => enrichments.reduce((enriched, enrich) => enrich(enriched), spec),\n [spec, enrichments],\n );\n}\n","import type { Spec } from \"@json-render/core\";\nimport {\n type ComponentRegistry,\n createStateStore,\n type DefineRegistryResult,\n JSONUIProvider,\n Renderer,\n} from \"@json-render/react\";\nimport { useMemo, useRef } from \"react\";\nimport { enrichButtonActions } from \"./internal/enrichments/button-actions\";\nimport { useEnrichedSpec } from \"./internal/enrichments/useEnrichedSpec\";\n\nconst SPEC_ENRICHMENTS = [enrichButtonActions];\n\ntype SetState = (path: string, value: unknown) => void;\n\nexport interface SpecActionHelpers {\n setState: SetState;\n getSnapshot: () => Record<string, unknown>;\n}\n\nexport type SpecActionHandler = (params: unknown) => void | Promise<void>;\n\nexport type SpecActionsFactory = (helpers: SpecActionHelpers) => Record<string, SpecActionHandler>;\n\nexport interface SpecRendererProps {\n spec: Spec;\n registry: ComponentRegistry;\n handlers: DefineRegistryResult[\"handlers\"];\n /**\n * Build the runtime action handlers for this spec. Called with helpers that\n * expose the spec's local state store (`setState` for writing back,\n * `getSnapshot` for reading the current form data). Handlers returned here\n * are merged on top of the catalog defaults from `handlers`, so hosts can\n * implement any action declared in the catalog (e.g. `atlas.submitUserAction`,\n * `atlas.navigate`, `atlas.toolCall`) without changes to this package.\n */\n actions?: SpecActionsFactory;\n /**\n * True while the spec is still streaming in. Renders partial trees and\n * suppresses \"missing child\" warnings for elements that have not arrived yet.\n */\n loading?: boolean;\n}\n\nexport const SpecRenderer = ({ spec, registry, handlers, actions, loading }: SpecRendererProps) => {\n const enrichedSpec = useEnrichedSpec(spec, SPEC_ENRICHMENTS);\n\n const specRef = useRef<Spec | null>(null);\n const storeRef = useRef<ReturnType<typeof createStateStore> | null>(null);\n if (specRef.current !== spec) {\n specRef.current = spec;\n const specState = (enrichedSpec as unknown as { state?: Record<string, unknown> }).state ?? {};\n storeRef.current = createStateStore(specState);\n }\n if (storeRef.current === null) {\n throw new Error(\"State store is not initialized\");\n }\n const store = storeRef.current;\n\n const resolvedHandlers = useMemo(() => {\n const base = handlers(\n () => undefined,\n () => store.getSnapshot(),\n );\n const hostActions = actions\n ? actions({ setState: store.set, getSnapshot: () => store.getSnapshot() })\n : {};\n return { ...base, ...hostActions };\n }, [handlers, actions, store]);\n\n const functions = useMemo(\n () => ({\n computeTotal: (args: Record<string, unknown>) => {\n const qty = Number.parseFloat(String((args.quantity as number | string) ?? 0)) || 0;\n const price =\n Number.parseFloat(\n String((args.unitPrice as number | string) ?? \"0\").replace(/[^0-9.]/g, \"\"),\n ) || 0;\n return `$${(qty * price).toFixed(2)}`;\n },\n }),\n [],\n );\n\n return (\n <JSONUIProvider\n registry={registry}\n store={store}\n handlers={resolvedHandlers}\n functions={functions}\n >\n <Renderer spec={enrichedSpec} registry={registry} loading={loading ?? false} />\n </JSONUIProvider>\n );\n};\n","import { Alert, Text } from \"@servicetitan/anvil2\";\nimport { Component, type ErrorInfo, type ReactNode } from \"react\";\n\nexport interface ContextRenderErrorInfo {\n elementType: string;\n message: string;\n}\n\ninterface ContextRenderErrorBoundaryProps {\n elementType: string;\n children: ReactNode;\n onError?: (info: ContextRenderErrorInfo) => void;\n}\n\ninterface ContextRenderErrorBoundaryState {\n hasError: boolean;\n message: string;\n}\n\nexport class ContextRenderErrorBoundary extends Component<\n ContextRenderErrorBoundaryProps,\n ContextRenderErrorBoundaryState\n> {\n override state: ContextRenderErrorBoundaryState = { hasError: false, message: \"\" };\n\n static getDerivedStateFromError(error: Error): ContextRenderErrorBoundaryState {\n return { hasError: true, message: error.message };\n }\n\n override componentDidCatch(error: Error, info: ErrorInfo) {\n console.error(\n `[ContextSpecRenderer] Rendering error in <${this.props.elementType}>:`,\n error,\n info.componentStack,\n );\n this.props.onError?.({\n elementType: this.props.elementType,\n message: error.message,\n });\n }\n\n override render() {\n if (this.state.hasError) {\n if (process.env.NODE_ENV === \"production\") {\n return null;\n }\n\n return (\n <Alert status=\"danger\" title={`${this.props.elementType} failed to render`}>\n <Text variant=\"body\">{this.state.message}</Text>\n </Alert>\n );\n }\n\n return this.props.children;\n }\n}\n","import type { ComponentRegistry } from \"@json-render/react\";\nimport type { ComponentType } from \"react\";\n\nimport {\n ContextRenderErrorBoundary,\n type ContextRenderErrorInfo,\n} from \"../context/components/context-render-error-boundary\";\n\nexport function wrapContextRegistryWithErrorFallback(\n registry: ComponentRegistry,\n onRenderError?: (info: ContextRenderErrorInfo) => void,\n): ComponentRegistry {\n if (process.env.NODE_ENV === \"production\") {\n return registry;\n }\n\n const wrapped: ComponentRegistry = { ...registry };\n\n for (const [name, Component] of Object.entries(registry)) {\n const Renderer = Component as unknown as ComponentType<Record<string, unknown>>;\n wrapped[name] = ((props: Record<string, unknown>) => (\n <ContextRenderErrorBoundary\n elementType={name}\n {...(onRenderError ? { onError: onRenderError } : {})}\n >\n <Renderer {...props} />\n </ContextRenderErrorBoundary>\n )) as unknown as ComponentRegistry[string];\n }\n\n return wrapped;\n}\n","import { useMemo } from \"react\";\n\nimport type { ContextRenderErrorInfo } from \"../context/components/context-render-error-boundary\";\nimport { formatContextSpecIssues, validateContextSpec } from \"../context/validate-context-spec\";\nimport { getRegistry } from \"../registry\";\nimport { SpecRenderer, type SpecRendererProps } from \"./spec-renderer\";\nimport { wrapContextRegistryWithErrorFallback } from \"./wrap-context-registry\";\n\nexport type ContextSpecRendererProps = Omit<SpecRendererProps, \"registry\" | \"handlers\"> &\n Partial<Pick<SpecRendererProps, \"registry\" | \"handlers\">> & {\n onRenderError?: (info: ContextRenderErrorInfo) => void;\n };\n\nexport const ContextSpecRenderer = ({\n spec,\n registry,\n handlers,\n actions,\n onRenderError,\n loading,\n}: ContextSpecRendererProps) => {\n // Skip structural validation noise while the spec is still streaming in.\n const issues = loading ? [] : validateContextSpec(spec);\n if (issues.length > 0 && process.env.NODE_ENV !== \"production\") {\n console.warn(\n `[ContextSpecRenderer] Spec validation issues:\\n${formatContextSpecIssues(\n issues.map((issue) => ({ ...issue, severity: \"error\" as const })),\n )}`,\n );\n }\n\n const contextRegistry = registry ?? getRegistry(\"context\").registry;\n const contextHandlers = handlers ?? getRegistry(\"context\").handlers;\n\n const wrappedRegistry = useMemo(\n () => wrapContextRegistryWithErrorFallback(contextRegistry, onRenderError),\n [contextRegistry, onRenderError],\n );\n\n return (\n <SpecRenderer\n spec={spec}\n registry={wrappedRegistry}\n handlers={contextHandlers}\n {...(actions ? { actions } : {})}\n {...(loading !== undefined ? { loading } : {})}\n />\n );\n};\n","import { primitive } from \"@servicetitan/carto-react-kit/tokens\";\nimport { style } from \"@vanilla-extract/css\";\n\nexport const sectionLoadingTail = style({\n paddingTop: primitive.size[\"200\"],\n});\n","import type { Spec, UIElement } from \"@json-render/core\";\nimport type { ComponentRegistry, DefineRegistryResult } from \"@json-render/react\";\nimport { SkeletonRectangle, SkeletonText } from \"@servicetitan/anvil2\";\nimport { useMemo, useRef } from \"react\";\nimport { panel } from \"../context/catalog/context-panel.css\";\nimport { cardBody } from \"../context/components/collapsible-card.css\";\nimport {\n ContextRenderErrorBoundary,\n type ContextRenderErrorInfo,\n} from \"../context/components/context-render-error-boundary\";\nimport { getRegistry } from \"../registry\";\nimport { sectionLoadingTail } from \"./sectioned-context-renderer.css\";\nimport { SpecRenderer, type SpecRendererProps } from \"./spec-renderer\";\nimport { wrapContextRegistryWithErrorFallback } from \"./wrap-context-registry\";\n\nexport type ContextSectionStatus = \"loading\" | \"ready\" | \"error\";\n\n/** A single top-level context section rendered by its own SpecRenderer + store. */\nexport interface ContextSection {\n id: string;\n title?: string;\n spec: Spec | null;\n status: ContextSectionStatus;\n error?: string;\n}\n\nexport interface SectionedContextRendererProps {\n /** Combined ContextPanel spec — split client-side into per-section slots. */\n spec?: Spec | null;\n /** Explicit ordered section slots (parallel per-section streams). Wins over `spec`. */\n sections?: ContextSection[];\n /** Global streaming flag — the last in-progress section shows a loading state. */\n loading?: boolean;\n registry?: ComponentRegistry;\n handlers?: DefineRegistryResult[\"handlers\"];\n actions?: SpecRendererProps[\"actions\"];\n onRenderError?: (info: ContextRenderErrorInfo) => void;\n}\n\n/** Collect the subtree reachable from `sectionId`; flags dangling (not-yet-streamed) child refs. */\nfunction collectSection(\n spec: Spec,\n sectionId: string,\n): { elements: Record<string, UIElement>; hasMissingRefs: boolean } {\n const elements: Record<string, UIElement> = {};\n let hasMissingRefs = false;\n\n const visit = (id: string) => {\n const element = spec.elements[id];\n if (!element) {\n hasMissingRefs = true;\n return;\n }\n if (elements[id]) {\n return;\n }\n elements[id] = element;\n for (const childId of element.children ?? []) {\n visit(childId);\n }\n };\n\n visit(sectionId);\n return { elements, hasMissingRefs };\n}\n\n/** Build a standalone `{ root, elements, state }` spec for one section. */\nexport function extractSectionSpec(\n spec: Spec,\n sectionId: string,\n): { spec: Spec; hasMissingRefs: boolean } {\n const { elements, hasMissingRefs } = collectSection(spec, sectionId);\n const sub: Spec = { root: sectionId, elements };\n const state = (spec as { state?: Record<string, unknown> }).state;\n if (state !== undefined) {\n (sub as { state?: Record<string, unknown> }).state = state;\n }\n return { spec: sub, hasMissingRefs };\n}\n\n/**\n * Split a combined ContextPanel spec into ordered section slots, keeping a\n * stable spec reference per section so completed sections do not re-render (and\n * keep their store + local expansion state) when later sections stream in.\n */\nfunction useDerivedSections(spec: Spec | null | undefined, loading: boolean): ContextSection[] {\n const cacheRef = useRef<Map<string, { key: string; spec: Spec }>>(new Map());\n\n return useMemo(() => {\n if (!spec?.root) {\n return [];\n }\n const root = spec.elements[spec.root];\n if (!root) {\n return [];\n }\n\n const presentIds = (root.children ?? []).filter((id) => spec.elements[id]);\n const cache = cacheRef.current;\n const nextCache = new Map<string, { key: string; spec: Spec }>();\n\n const slots = presentIds.map((id, index): ContextSection => {\n const { spec: subSpec, hasMissingRefs } = extractSectionSpec(spec, id);\n const key = JSON.stringify(subSpec);\n const cached = cache.get(id);\n // Reuse the previous object when this section's subtree is unchanged.\n const stableSpec = cached && cached.key === key ? cached.spec : subSpec;\n nextCache.set(id, { key, spec: stableSpec });\n\n const isLast = index === presentIds.length - 1;\n const status: ContextSectionStatus =\n hasMissingRefs || (isLast && loading) ? \"loading\" : \"ready\";\n return { id, spec: stableSpec, status };\n });\n\n cacheRef.current = nextCache;\n return slots;\n }, [spec, loading]);\n}\n\n/**\n * Keep a stable spec object reference per section while its content is\n * unchanged. Needed for the explicit `sections` path: each parallel section\n * event clones the whole array (via postMessage), so without this an unchanged\n * section would get a new spec ref and reset its store/expansion.\n */\nfunction useStableSlotSpecs(slots: ContextSection[]): ContextSection[] {\n const cacheRef = useRef<Map<string, { key: string; spec: Spec | null }>>(new Map());\n\n return useMemo(() => {\n const cache = cacheRef.current;\n const nextCache = new Map<string, { key: string; spec: Spec | null }>();\n\n const stabilized = slots.map((slot) => {\n const key = slot.spec ? JSON.stringify(slot.spec) : \"\";\n const cached = cache.get(slot.id);\n const stableSpec = slot.spec && cached && cached.key === key ? cached.spec : slot.spec;\n nextCache.set(slot.id, { key, spec: stableSpec });\n return stableSpec === slot.spec ? slot : { ...slot, spec: stableSpec };\n });\n\n cacheRef.current = nextCache;\n return stabilized;\n }, [slots]);\n}\n\nfunction SectionSkeleton({ title }: { title?: string }) {\n return (\n <div className={cardBody} data-testid=\"context-section-skeleton\">\n <SkeletonText variant=\"headline\" {...(title ? { \"aria-label\": `Loading ${title}` } : {})} />\n <SkeletonRectangle height=\"64px\" />\n </div>\n );\n}\n\ninterface SectionSlotProps {\n slot: ContextSection;\n registry: ComponentRegistry;\n handlers: DefineRegistryResult[\"handlers\"];\n actions?: SpecRendererProps[\"actions\"];\n}\n\nfunction SectionSlot({ slot, registry, handlers, actions }: SectionSlotProps) {\n if (!slot.spec) {\n return <SectionSkeleton {...(slot.title ? { title: slot.title } : {})} />;\n }\n\n return (\n <div data-testid={`context-section-${slot.id}`} data-status={slot.status}>\n <SpecRenderer\n spec={slot.spec}\n registry={registry}\n handlers={handlers}\n loading={slot.status === \"loading\"}\n {...(actions ? { actions } : {})}\n />\n {slot.status === \"loading\" ? (\n <div className={sectionLoadingTail}>\n <SkeletonText variant=\"body\" rows={2} aria-label=\"Loading more of this section\" />\n </div>\n ) : null}\n </div>\n );\n}\n\n/**\n * Renders a context panel as independent per-section renderers. Each section\n * owns its own SpecRenderer + state store, so streaming in (or parallel-loading)\n * later sections never resets an already-expanded section.\n */\nexport const SectionedContextRenderer = ({\n spec,\n sections,\n loading = false,\n registry,\n handlers,\n actions,\n onRenderError,\n}: SectionedContextRendererProps) => {\n const fallbackRegistry = useMemo(() => getRegistry(\"context\"), []);\n const baseRegistry = registry ?? fallbackRegistry.registry;\n const contextHandlers = handlers ?? fallbackRegistry.handlers;\n\n const wrappedRegistry = useMemo(\n () => wrapContextRegistryWithErrorFallback(baseRegistry, onRenderError),\n [baseRegistry, onRenderError],\n );\n\n const derived = useDerivedSections(spec, loading);\n const slots = useStableSlotSpecs(sections ?? derived);\n\n return (\n <div className={panel} data-testid=\"sectioned-context-panel\">\n {slots.map((slot) => (\n <ContextRenderErrorBoundary\n key={slot.id}\n elementType={slot.id}\n {...(onRenderError ? { onError: onRenderError } : {})}\n >\n <SectionSlot\n slot={slot}\n registry={wrappedRegistry}\n handlers={contextHandlers}\n {...(actions ? { actions } : {})}\n />\n </ContextRenderErrorBoundary>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