@memberjunction/ng-dashboards 5.37.0 β 5.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -0
- package/dist/AI/components/autotagging/autotagging-pipeline-resource.component.d.ts +14 -0
- package/dist/AI/components/autotagging/autotagging-pipeline-resource.component.d.ts.map +1 -1
- package/dist/AI/components/autotagging/autotagging-pipeline-resource.component.js +450 -292
- package/dist/AI/components/autotagging/autotagging-pipeline-resource.component.js.map +1 -1
- package/dist/ComponentStudio/component-studio-dashboard.component.d.ts +73 -1
- package/dist/ComponentStudio/component-studio-dashboard.component.d.ts.map +1 -1
- package/dist/ComponentStudio/component-studio-dashboard.component.js +512 -127
- package/dist/ComponentStudio/component-studio-dashboard.component.js.map +1 -1
- package/dist/ComponentStudio/component-studio-resource.component.d.ts +22 -0
- package/dist/ComponentStudio/component-studio-resource.component.d.ts.map +1 -0
- package/dist/ComponentStudio/component-studio-resource.component.js +55 -0
- package/dist/ComponentStudio/component-studio-resource.component.js.map +1 -0
- package/dist/ComponentStudio/components/ai-assistant/ai-assistant-panel.component.d.ts +104 -45
- package/dist/ComponentStudio/components/ai-assistant/ai-assistant-panel.component.d.ts.map +1 -1
- package/dist/ComponentStudio/components/ai-assistant/ai-assistant-panel.component.js +234 -331
- package/dist/ComponentStudio/components/ai-assistant/ai-assistant-panel.component.js.map +1 -1
- package/dist/ComponentStudio/components/form-builder/form-builder-canvas.component.d.ts +54 -0
- package/dist/ComponentStudio/components/form-builder/form-builder-canvas.component.d.ts.map +1 -0
- package/dist/ComponentStudio/components/form-builder/form-builder-canvas.component.js +339 -0
- package/dist/ComponentStudio/components/form-builder/form-builder-canvas.component.js.map +1 -0
- package/dist/ComponentStudio/components/form-builder/form-builder-right-panel.component.d.ts +65 -0
- package/dist/ComponentStudio/components/form-builder/form-builder-right-panel.component.d.ts.map +1 -0
- package/dist/ComponentStudio/components/form-builder/form-builder-right-panel.component.js +492 -0
- package/dist/ComponentStudio/components/form-builder/form-builder-right-panel.component.js.map +1 -0
- package/dist/ComponentStudio/components/form-builder/form-builder-tab.component.d.ts +88 -0
- package/dist/ComponentStudio/components/form-builder/form-builder-tab.component.d.ts.map +1 -0
- package/dist/ComponentStudio/components/form-builder/form-builder-tab.component.js +457 -0
- package/dist/ComponentStudio/components/form-builder/form-builder-tab.component.js.map +1 -0
- package/dist/ComponentStudio/components/form-override-dialog.component.d.ts +106 -0
- package/dist/ComponentStudio/components/form-override-dialog.component.d.ts.map +1 -0
- package/dist/ComponentStudio/components/form-override-dialog.component.js +478 -0
- package/dist/ComponentStudio/components/form-override-dialog.component.js.map +1 -0
- package/dist/ComponentStudio/components/workspace/component-preview.component.d.ts +54 -0
- package/dist/ComponentStudio/components/workspace/component-preview.component.d.ts.map +1 -1
- package/dist/ComponentStudio/components/workspace/component-preview.component.js +361 -50
- package/dist/ComponentStudio/components/workspace/component-preview.component.js.map +1 -1
- package/dist/ComponentStudio/components/workspace/editor-tabs.component.d.ts +10 -0
- package/dist/ComponentStudio/components/workspace/editor-tabs.component.d.ts.map +1 -1
- package/dist/ComponentStudio/components/workspace/editor-tabs.component.js +114 -45
- package/dist/ComponentStudio/components/workspace/editor-tabs.component.js.map +1 -1
- package/dist/ComponentStudio/services/canvas-to-code.d.ts +32 -0
- package/dist/ComponentStudio/services/canvas-to-code.d.ts.map +1 -0
- package/dist/ComponentStudio/services/canvas-to-code.js +347 -0
- package/dist/ComponentStudio/services/canvas-to-code.js.map +1 -0
- package/dist/ComponentStudio/services/code-to-canvas.d.ts +32 -0
- package/dist/ComponentStudio/services/code-to-canvas.d.ts.map +1 -0
- package/dist/ComponentStudio/services/code-to-canvas.js +92 -0
- package/dist/ComponentStudio/services/code-to-canvas.js.map +1 -0
- package/dist/ComponentStudio/services/component-studio-state.service.d.ts +29 -0
- package/dist/ComponentStudio/services/component-studio-state.service.d.ts.map +1 -1
- package/dist/ComponentStudio/services/component-studio-state.service.js +76 -0
- package/dist/ComponentStudio/services/component-studio-state.service.js.map +1 -1
- package/dist/ComponentStudio/services/entity-form-override.service.d.ts +86 -0
- package/dist/ComponentStudio/services/entity-form-override.service.d.ts.map +1 -0
- package/dist/ComponentStudio/services/entity-form-override.service.js +246 -0
- package/dist/ComponentStudio/services/entity-form-override.service.js.map +1 -0
- package/dist/ComponentStudio/services/field-binding-scanner.d.ts +29 -0
- package/dist/ComponentStudio/services/field-binding-scanner.d.ts.map +1 -0
- package/dist/ComponentStudio/services/field-binding-scanner.js +110 -0
- package/dist/ComponentStudio/services/field-binding-scanner.js.map +1 -0
- package/dist/ComponentStudio/services/form-canvas-model.d.ts +56 -0
- package/dist/ComponentStudio/services/form-canvas-model.d.ts.map +1 -0
- package/dist/ComponentStudio/services/form-canvas-model.js +35 -0
- package/dist/ComponentStudio/services/form-canvas-model.js.map +1 -0
- package/dist/ComponentStudio/services/form-host-props-fixture.d.ts +10 -0
- package/dist/ComponentStudio/services/form-host-props-fixture.d.ts.map +1 -0
- package/dist/ComponentStudio/services/form-host-props-fixture.js +10 -0
- package/dist/ComponentStudio/services/form-host-props-fixture.js.map +1 -0
- package/dist/DataExplorer/data-explorer-dashboard.component.js +2 -2
- package/dist/DataExplorer/data-explorer-dashboard.component.js.map +1 -1
- package/dist/FormBuilder/form-builder-resource.component.d.ts +964 -0
- package/dist/FormBuilder/form-builder-resource.component.d.ts.map +1 -0
- package/dist/FormBuilder/form-builder-resource.component.js +4487 -0
- package/dist/FormBuilder/form-builder-resource.component.js.map +1 -0
- package/dist/FormBuilder/form-builder-version-rail.helpers.d.ts +55 -0
- package/dist/FormBuilder/form-builder-version-rail.helpers.d.ts.map +1 -0
- package/dist/FormBuilder/form-builder-version-rail.helpers.js +73 -0
- package/dist/FormBuilder/form-builder-version-rail.helpers.js.map +1 -0
- package/dist/Home/home-application.d.ts +21 -1
- package/dist/Home/home-application.d.ts.map +1 -1
- package/dist/Home/home-application.js +60 -8
- package/dist/Home/home-application.js.map +1 -1
- package/dist/QueryBrowser/query-browser-resource.component.d.ts +14 -14
- package/dist/QueryBrowser/query-browser-resource.component.d.ts.map +1 -1
- package/dist/QueryBrowser/query-browser-resource.component.js +11 -10
- package/dist/QueryBrowser/query-browser-resource.component.js.map +1 -1
- package/dist/component-studio-dashboards.module.d.ts +34 -22
- package/dist/component-studio-dashboards.module.d.ts.map +1 -1
- package/dist/component-studio-dashboards.module.js +65 -9
- package/dist/component-studio-dashboards.module.js.map +1 -1
- package/package.json +54 -53
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-builder-resource.component.js","sourceRoot":"","sources":["../../src/FormBuilder/form-builder-resource.component.ts","../../src/FormBuilder/form-builder-resource.component.html"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAEH,uBAAuB,EACvB,iBAAiB,EACjB,SAAS,EAET,MAAM,GACT,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,EAAmB,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpG,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAW,MAAM,wBAAwB,CAAC;AAExE,OAAO,EAAgB,2BAA2B,EAAE,cAAc,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAE3J,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAKzE,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAgB,MAAM,MAAM,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EACH,sBAAsB,EACtB,wBAAwB,GAE3B,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,M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C;;;ADpzBU,4BAA4B;IARxC,aAAa,CAAC,qBAAqB,EAAE,qBAAqB,CAAC;GAQ/C,4BAA4B,CA88FxC;;iFA98FY,4BAA4B;cAPxC,SAAS;6BACM,KAAK,YACP,0BAA0B,mBAGnB,uBAAuB,CAAC,MAAM;;kFAEtC,4BAA4B;AAg9FzC,4EAA4E;AAC5E,MAAM,UAAU,gCAAgC;IAC5C,yEAAyE;IACzE,2EAA2E;AAC/E,CAAC","sourcesContent":["import {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n OnDestroy,\n inject,\n} from '@angular/core';\nimport { BaseEntity, BaseEntityEvent, CompositeKey, LogError, RunView } from '@memberjunction/core';\nimport { MJGlobal, MJEventType, MJEvent } from '@memberjunction/global';\nimport type { IMetadataProvider, UserInfo } from '@memberjunction/core';\nimport { ResourceData, MJEnvironmentEntityExtended, UserInfoEngine, ComponentMetadataEngine, InteractiveFormsEngine } from '@memberjunction/core-entities';\nimport type { MJComponentEntity, MJEntityFormOverrideEntity, MJConversationEntity } from '@memberjunction/core-entities';\nimport { NormalizeUUID, RegisterClass, UUIDsEqual } from '@memberjunction/global';\nimport { BaseResourceComponent } from '@memberjunction/ng-shared';\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\nimport type { ComponentSpec } from '@memberjunction/interactive-component-types';\nimport type { MJTaskEntity } from '@memberjunction/core-entities';\nimport type { NavigationRequest } from '@memberjunction/ng-conversations';\nimport type { AppContextSnapshot } from '@memberjunction/ai-core-plus';\nimport { AIEngineBase } from '@memberjunction/ai-engine-base';\nimport { combineLatest, Subscription } from 'rxjs';\nimport { skip } from 'rxjs/operators';\nimport {\n buildCuratedFormSchema,\n buildDefaultFormScaffold,\n type CuratedFormSchema,\n} from '@memberjunction/interactive-component-types/forms';\nimport { generateCodeFromCanvas, toComponentIdentifier } from '../ComponentStudio/services/canvas-to-code';\nimport { parseCanvasFromCode } from '../ComponentStudio/services/code-to-canvas';\nimport {\n buildEmptyCanvas,\n generateCanvasId,\n type FormCanvasElement,\n type FormCanvasModel,\n type FormCanvasSection,\n} from '../ComponentStudio/services/form-canvas-model';\nimport { EntityFormOverrideService } from '../ComponentStudio/services/entity-form-override.service';\nimport { ConversationBridgeService } from '@memberjunction/ng-conversations';\nimport { joinVersionsWithOverrides, pickActiveVersionID } from './form-builder-version-rail.helpers';\nimport type { FormOverrideDialogResult } from '../ComponentStudio/components/form-override-dialog.component';\n\n/**\n * UserInfoEngine setting key for the Form Builder cockpit's persisted UI\n * preferences. Single key holds a JSON-serialized {@link FormBuilderPrefs}.\n * Namespaced under `mj.formBuilder.*` so admin-tier setting browsers can\n * filter for app-specific prefs at a glance.\n */\nconst FORM_BUILDER_PREFS_KEY = 'mj.formBuilder.cockpitPrefs.v1';\n\n/**\n * Persisted shape for the cockpit's resizable-pane sizes + collapse state.\n * Versioned via the storage key (`v1`) so future schema changes can read +\n * migrate older JSON without breaking on shape drift.\n */\nexport interface FormBuilderPrefs {\n /** Percent (0-100) widths of the three top-level shell panes. */\n leftPanePct?: number;\n centerPanePct?: number;\n chatPanePct?: number;\n /** Collapse flags persist across reloads. */\n leftCollapsed?: boolean;\n chatCollapsed?: boolean;\n /** Last center-pane tab used (Preview / Code / Layout). */\n lastCenterPaneMode?: 'preview' | 'code' | 'layout';\n\n // β Left-rail inner layout (forms list vs versions panel) β\n /** Height percent (0-100) for the forms-list section inside the left rail.\n * The versions panel takes the remainder. Drag the splitter to change. */\n formsListHeightPct?: number;\n /** Inner-panel collapse flags (VS-Code-style). When true, that section\n * shrinks to a header bar and the sibling takes full height. */\n formsListCollapsed?: boolean;\n versionsCollapsed?: boolean;\n\n // β Forms list display preferences β\n /** 'list' (flat) | 'tree' (Schema β Entity β Forms). */\n formsViewMode?: 'list' | 'tree';\n /** Entity filter selection ('All' or specific entity name). */\n formsEntityFilter?: string;\n /** Status filter chips. Forms whose OverrideStatus is in this set show. */\n formsStatusFilter?: ReadonlyArray<'Active' | 'Pending' | 'Inactive'>;\n /** Sort mode. */\n formsSortMode?: 'updated-desc' | 'updated-asc' | 'name-asc' | 'name-desc';\n /** Component IDs the user has pinned to the top of the list. */\n pinnedFormIds?: ReadonlyArray<string>;\n}\n\n/**\n * One Component version in the active form's Name lineage. The version rail\n * lists these; clicking activates / previews / diffs.\n */\nexport interface ComponentVersionRow {\n ID: string;\n Name: string;\n Version: string;\n VersionSequence: number;\n Status: string;\n UpdatedAt: Date | null;\n /** True when this version is the one currently pointed at by an Active\n * override for the calling user. */\n IsActive: boolean;\n /** True when this version is pointed at by a Pending override for the\n * user (i.e. an AI-authored refinement awaiting activation). */\n IsPending: boolean;\n}\n\n/**\n * Lightweight summary of a form-role Component, populated from MJ: Components\n * for the left-rail picker. Specification is loaded on demand when the user\n * actually opens a form so we don't pay the JSON parse cost N times.\n */\ninterface FormComponentSummary {\n ID: string;\n Name: string;\n Namespace: string | null;\n /**\n * `Component.Status` (Draft / Published / Deprecated) β kept on the\n * summary for callers that need it (e.g. the version rail), but NOT\n * what the left rail badge displays. The left rail surfaces the\n * **override** status (see `OverrideStatus` below) because that's\n * what drives runtime visibility for the user.\n */\n Status: string | null;\n /**\n * The current user's `EntityFormOverride.Status` (Active / Inactive /\n * Pending) for this Component, when an override exists. Null when no\n * user-scope override binds to this Component β in which case the\n * runtime falls through to a higher-scope (Role/Global) override or\n * the CodeGen Angular default. Populated by `loadExistingForms` via\n * a single batch lookup against `MJ: Entity Form Overrides`.\n */\n OverrideStatus: 'Active' | 'Inactive' | 'Pending' | null;\n Description: string | null;\n TargetEntityName: string | null;\n /** Entity ID extracted from the user's override (when present) β used to\n * resolve EntityInfo for icon/schema/name lookups. Null when no\n * user-scope override binds to this Component. */\n TargetEntityID?: string | null;\n /** Cached entity display name (resolved via provider.EntityByName at\n * loadExistingForms time). Used as the per-row entity subtitle. */\n TargetEntityDisplayName?: string | null;\n /** Cached entity icon class (Font Awesome) from EntityInfo.Icon. */\n TargetEntityIcon?: string | null;\n /** Cached entity schema name β drives tree-view grouping. */\n TargetEntitySchemaName?: string | null;\n /** Component row's last-modified timestamp β for \"edited 2h ago\" sorts. */\n UpdatedAt?: Date | null;\n}\n\n/**\n * Form Builder resource β the standalone Form Studio canvas reachable from\n * the top-left Application rail. Provides a drag-drop canvas, field-binding\n * inspector, and EntityFormOverride activation flow that mirrors Component\n * Studio's contextual Form Builder tab but as its own dedicated workspace.\n *\n * Owns its OWN state β does NOT depend on `ComponentStudioStateService`,\n * which is provided per-Component-Studio-dashboard. The canvas and right\n * panel children are state-agnostic and accept everything via @Input/@Output.\n *\n * Per `dashboards/CLAUDE.md`, this resource MUST call `NotifyLoadComplete()`\n * after the initial load β without it, the shell loading screen hangs forever\n * on direct URL navigation (e.g. `/app/form-studio/Form%20Builder`).\n */\n@RegisterClass(BaseResourceComponent, 'FormBuilderResource')\n@Component({\n standalone: false,\n selector: 'mj-form-builder-resource',\n templateUrl: './form-builder-resource.component.html',\n styleUrls: ['./form-builder-resource.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormBuilderResourceComponent\n extends BaseResourceComponent\n implements AfterViewInit, OnDestroy {\n\n public async GetResourceDisplayName(_data: ResourceData): Promise<string> {\n return 'Form Builder';\n }\n\n public async GetResourceIconClass(_data: ResourceData): Promise<string> {\n return 'fa-solid fa-pen-ruler';\n }\n\n public LeftRailCollapsed = false;\n public RightRailCollapsed = false;\n public ChatPaneCollapsed = false;\n public IsLoading = true;\n public ExistingForms: FormComponentSummary[] = [];\n public LeftRailFilter = '';\n\n // ββ Left-rail inner layout (forms list β versions panel) βββββββββ\n /** Percent (0-100) height of the forms-list section within the left\n * rail. The versions panel takes the remainder. */\n public FormsListHeightPct = 65;\n public FormsListCollapsed = false;\n public VersionsCollapsed = false;\n\n // ββ Forms list display preferences βββββββββββββββββββββββββββββββ\n public FormsViewMode: 'list' | 'tree' = 'list';\n /** Selected entity filter. Empty string = \"All entities\". */\n public FormsEntityFilter = '';\n /** Status chips currently enabled. Active+Pending+Inactive by default\n * so the list shows everything. Toggle a chip OFF to hide that bucket. */\n public FormsStatusFilter: Set<'Active' | 'Pending' | 'Inactive'> =\n new Set(['Active', 'Pending', 'Inactive']);\n public FormsSortMode: 'updated-desc' | 'updated-asc' | 'name-asc' | 'name-desc' = 'updated-desc';\n /** Pinned form Component IDs (kept sticky at the top of the list). */\n public PinnedFormIds: Set<string> = new Set();\n /** Right-click context-menu state. */\n public ContextMenuForm: FormComponentSummary | null = null;\n public ContextMenuX = 0;\n public ContextMenuY = 0;\n public ContextMenuOpen = false;\n /** Entity-filter dropdown open state. */\n public EntityFilterDropdownOpen = false;\n public EntityFilterSearch = '';\n\n // ββ Version diff state ββββββββββββββββββββββββββββββββββββββββββ\n /** When the user starts a diff via right-click on a version row,\n * this holds the first selection. Click another row to compare. */\n public DiffSourceVersionID: string | null = null;\n /** When set, render the diff modal showing both specs side-by-side. */\n public DiffTargetVersionID: string | null = null;\n public DiffSourceCode = '';\n public DiffTargetCode = '';\n public ShowDiffDialog = false;\n\n /**\n * Center-pane view mode for the cockpit. Default is 'preview' because the\n * preview is the most useful single view when a form is loaded; users\n * tab to 'code' to edit and 'layout' for the (legacy) drag-drop canvas.\n */\n public CenterPaneMode: 'preview' | 'code' | 'layout' = 'preview';\n\n /**\n * Version rail data. Lineage = all Component rows sharing the active\n * form's Name. Ordered by VersionSequence DESC so the newest is on top.\n */\n public Versions: ComponentVersionRow[] = [];\n\n /**\n * The version row matching the Component currently loaded in the\n * editor (`SelectedFormID`). Drives the floating \"Viewing v1.0.0\"\n * overlay on the center pane so the user always knows which\n * version's spec they're looking at β particularly useful when\n * they've clicked an older row in the version rail to inspect\n * historical work, and the on-screen form differs from what the\n * runtime is actually serving.\n */\n public get CurrentSelectedVersion(): ComponentVersionRow | null {\n if (!this.SelectedFormID) return null;\n return this.Versions.find(v => UUIDsEqual(v.ID, this.SelectedFormID!)) ?? null;\n }\n public VersionsLoading = false;\n public ActiveVersionID: string | null = null;\n\n /**\n * Live preview state. When the user switches to the Preview tab, we load\n * a Top-1 record from `TargetEntityName` and mount `<mj-interactive-form>`\n * with the working `componentSpec` derived from the current EditableCode.\n * Failure modes (no record, RunView error) fall back to a synthetic\n * NewRecord() so the form still mounts β the user just sees an empty\n * draft instead of a broken pane.\n */\n public PreviewRecord: BaseEntity | null = null;\n public PreviewRecordIsReal = false;\n public PreviewRecordLabel = '';\n public PreviewLoading = false;\n public PreviewError: string | null = null;\n public PreviewPickerOpen = false;\n\n /**\n * The saved ComponentSpec from the last loaded form, preserved so the\n * Preview pane can merge live code edits over the rich metadata\n * (dataRequirements / description / functionalRequirements / technicalDesign)\n * rather than rebuilding from `EditableCode` alone. Retrospective fix #5.\n */\n public SavedSpec: ComponentSpec | null = null;\n\n /**\n * True when the in-memory code (EditableCode) has diverged from what the\n * canvas can represent β e.g. hand-authored sections, computed JSX the\n * canvas-parser can't round-trip. Set by `hydrateCanvasFromCode`. The\n * Layout tab shows a warning banner so the user knows the canvas will\n * overwrite parts of the code on save. Retrospective fix #6.\n */\n public CanvasDiverged = false;\n public PreviewSearchTerm = '';\n public PreviewSearchResults: Array<{ ID: string; Label: string }> = [];\n\n /**\n * AppContext snapshot fed to the embedded `<mj-conversation-chat-area>`\n * so the agent sees the cockpit's current form + entity. Sourced from\n * `NavigationService.AppContextSnapshot$` β the same snapshot the floating\n * overlay uses β so both surfaces see identical context. Our cockpit-\n * specific state is pushed in via `SetAgentContext()` (which the Explorer\n * app shell merges into the snapshot's `AdditionalContext`).\n */\n public ChatAppContext: AppContextSnapshot | null = null;\n\n /**\n * Resolved ID of the Form Builder agent. Looked up once at init via\n * RunView. Bound to `<mj-conversation-chat-area>`'s `[defaultAgentId]`\n * so messages route directly to the Form Builder agent instead of going\n * through Sage β Sage doesn't author forms, the Form Builder agent does.\n * Null until the lookup resolves (or if the agent isn't installed); in\n * that case the chat falls back to Sage routing.\n */\n public FormBuilderAgentId: string | null = null;\n\n private appContextSubscription: Subscription | null = null;\n private entityEventSubscription: Subscription | null = null;\n /**\n * Subscription to `InteractiveFormsEngine` Forms$/Overrides$. Fires\n * whenever the engine's cache is mutated (local save, remote-invalidate,\n * delete) and drives a sync recompute of {@link ExistingForms} and\n * {@link Versions}. Replaces the old \"call loadExistingForms after every\n * mutation\" pattern β engine + observable handle invalidation.\n */\n private engineSubscription: Subscription | null = null;\n\n /**\n * Conversation state for the embedded chat. Initially null/new; when the\n * user sends the first message, the chat-area emits `conversationCreated`\n * and we flip these so subsequent renders keep the same conversation.\n * Without this binding, the chat appears \"stuck\" on the welcome message\n * because the wrapper never picks up the new conversation ID.\n */\n public ChatConversation: MJConversationEntity | null = null;\n public ChatConversationId: string | null = null;\n /**\n * Lightweight list of all conversations across the active form's\n * lineage β feeds the chat header's \"N conversations\" dropdown so the\n * user can switch back to a prior thread instead of being locked into\n * just the most-recent one. Populated alongside loadLinkedConversation.\n */\n public LineageConversations: Array<{ ID: string; Name: string | null; UpdatedAt: Date | null }> = [];\n public ConversationHistoryDropdownOpen = false;\n public ChatIsNewConversation = true;\n\n /**\n * Pending message + attachments that came back on `conversationCreated`.\n * The chat-area emits these as part of its atomic state-handoff so the\n * parent can re-feed them after the conversation has an ID. The\n * chat-area's `pendingMessageConsumed` event tells us when to clear.\n * Without this loop, the user's first message creates the conversation\n * but never actually posts.\n */\n public ChatPendingMessage: string | null = null;\n public ChatPendingAttachments: unknown[] | null = null;\n\n /**\n * Thread state for the embedded chat. Mirrors the workspace shell's\n * pattern: chat-area emits `threadOpened` with a thread ID when the\n * user drills into a sub-thread, and `threadClosed` when they leave.\n * Forwarded back as `[threadId]` so the chat-area knows which thread\n * to render. Without these handlers, clicking a thread message in\n * the cockpit's chat appears to do nothing (the chat-area emits but\n * no one binds back).\n */\n public ChatThreadId: string | null = null;\n\n /**\n * Pending artifact pointer for the chat-area to scroll to / highlight\n * after navigation. Set when an artifact link inside the chat is\n * clicked (the chat-area asks us to surface a specific artifact\n * version) and cleared when consumed.\n */\n public ChatPendingArtifactId: string | null = null;\n public ChatPendingArtifactVersionNumber: number | null = null;\n\n /**\n * Environment ID for the embedded chat-area. Resource components in\n * Explorer accept this via ResourceData.Configuration; we fall back to\n * the default environment when not supplied.\n */\n public get ChatEnvironmentId(): string {\n return (this.Data?.Configuration?.['environmentId'] as string | undefined)\n || MJEnvironmentEntityExtended.DefaultEnvironmentID;\n }\n\n /**\n * Pane sizes (percent) for the 3-pane horizontal split. Initialized\n * from {@link FormBuilderPrefs} loaded out of UserInfoEngine on init;\n * mutated by the splitter's drag-end event; written back via\n * {@link savePrefs}.\n */\n public LeftPanePct = 22;\n public CenterPanePct = 56;\n public ChatPanePct = 22;\n\n /**\n * True when a form is \"actively being shown\" β either an existing\n * form is loaded (SelectedFormID set) or the user clicked New Form\n * (IsNewForm). The right-side chat pane is gated on this so empty\n * cockpits don't render an agent shell against no subject.\n */\n public get HasActiveForm(): boolean {\n return this.IsNewForm || !!this.SelectedFormID;\n }\n\n public SelectedFormID: string | null = null;\n public SelectedFormName = '';\n public IsNewForm = false;\n public TargetEntityName: string | null = null;\n public Schema: CuratedFormSchema | null = null;\n public Canvas: FormCanvasModel | null = null;\n public SelectedElementId: string | null = null;\n public SelectedSectionId: string | null = null;\n public EditableCode = '';\n public DirtyFlag = false;\n\n public IsEntityPickerOpen = false;\n public EntityPickerSearch = '';\n public EntityChoices: ReadonlyArray<{ Name: string; DisplayName: string }> = [];\n\n // ββ In-app confirm dialog (replaces window.confirm) βββββββββββββββββ\n /**\n * State for the cockpit's reusable confirm dialog. Replaces the\n * browser-native `window.confirm()` calls (delete form, discard\n * unsaved edits) with a styled in-app dialog. Three reasons for the\n * switch: (a) consistent visual language with the override + diff\n * dialogs, (b) confirm/cancel button order matches MJ convention\n * (primary left), (c) browser confirm is blocked by some browsers /\n * tools when triggered from event handlers without recent user\n * gesture (e.g. agent-driven flows).\n *\n * Hold the resolver callback alongside the state so multiple confirm\n * call-sites can share the same dialog without each one re-binding.\n */\n public ConfirmDialog: {\n Open: boolean;\n Title: string;\n Body: string;\n ConfirmLabel: string;\n CancelLabel: string;\n Danger: boolean;\n OnConfirm: () => void | Promise<void>;\n OnCancel?: () => void;\n } | null = null;\n\n public ShowFormOverrideDialog = false;\n public PendingOverrideComponentID: string | null = null;\n public PendingOverrideComponentName = '';\n public PendingOverrideEntityName = '';\n /** Pre-fill values forwarded to the override dialog. Populated by\n * OnSave (for post-save flow) or OpenEditFormDetailsDialog (for the\n * edit-existing-override flow). */\n public PendingOverrideInitialName: string | null = null;\n public PendingOverrideInitialDescription: string | null = null;\n public PendingOverrideInitialNotes: string | null = null;\n public PendingOverrideInitialStatus: 'Active' | 'Inactive' | 'Pending' | null = null;\n public PendingOverrideInitialScope: 'User' | 'Role' | 'Global' | null = null;\n public PendingOverrideInitialRoleID: string | null | undefined = undefined;\n public PendingOverrideInitialPriority: number | undefined = undefined;\n /** Edit-mode flag β when true, the dialog updates the existing\n * override (`EditingOverrideID`) instead of creating a new one. */\n public FormOverrideDialogEditMode = false;\n public EditingOverrideID: string | null = null;\n\n private readonly cdr = inject(ChangeDetectorRef);\n private readonly notifications = inject(MJNotificationService);\n private readonly overrideService = inject(EntityFormOverrideService);\n private readonly conversationBridge = inject(ConversationBridgeService);\n\n /**\n * Name of the Application this cockpit lives in β must match the\n * `Application.Name` column. \"Form Studio\" is the nav-item LABEL\n * inside the \"Component Studio\" app, not a separate application;\n * the canonical Application row is named \"Component Studio\". See\n * `/metadata/applications/.component-studio-application.json`.\n */\n private static readonly COCKPIT_APP_NAME = 'Component Studio';\n\n /**\n * ID of the Application that owns this cockpit. Resolved at init from\n * `Metadata.Applications` (the in-memory cache populated at provider\n * bootstrap β NO RunView round-trip) and forwarded to the embedded\n * chat-area as `[applicationId]`, so conversations created inside this\n * cockpit are scoped to the Form Studio app and don't pollute the\n * main Chat list.\n */\n public CockpitApplicationId: string | null = null;\n\n /**\n * EntityID for `MJ: Components`, resolved from `Metadata.Entities` at\n * init. Bound to `<mj-conversation-chat-area>`'s `[linkedEntityId]`\n * so conversations created in the cockpit are stamped as \"about a\n * Component\" β enabling the future \"show prior conversations about\n * THIS form\" surface. In-memory lookup, no RunView.\n */\n public ComponentsEntityID: string | null = null;\n\n private get provider(): IMetadataProvider {\n return this.ProviderToUse;\n }\n\n // Public so the template can bind it to <mj-conversation-chat-area>'s\n // [currentUser] input. The chat-area requires a UserInfo at mount time;\n // we gate it with @if(currentUser) in the template to avoid a null bind.\n public get currentUser(): UserInfo | null {\n return this.provider?.CurrentUser ?? null;\n }\n\n public async ngAfterViewInit(): Promise<void> {\n try {\n this.refreshEntityChoices();\n // Resolve the owning Application's ID once from the Metadata\n // cache. Used to scope chat conversations to this cockpit so\n // they don't pollute the main Chat list. Deterministic name-\n // based lookup against in-memory data β no RunView.\n const md = this.provider;\n const app = md.Applications?.find(\n a => a.Name?.trim().toLowerCase() === FormBuilderResourceComponent.COCKPIT_APP_NAME.toLowerCase()\n );\n if (!app) {\n LogError(`FormBuilderResource: Application '${FormBuilderResourceComponent.COCKPIT_APP_NAME}' not found in Metadata cache β conversations will fall back to Global scope.`);\n }\n this.CockpitApplicationId = app?.ID ?? null;\n // Resolve the MJ: Components entity ID once. Used to stamp\n // every cockpit-created conversation's LinkedEntityID so we\n // can later answer \"show prior conversations about this form.\"\n const componentsEntity = md.EntityByName?.('MJ: Components');\n if (!componentsEntity) {\n LogError(`FormBuilderResource: Entity 'MJ: Components' not found in Metadata cache β conversation linkage will be skipped.`);\n }\n this.ComponentsEntityID = componentsEntity?.ID ?? null;\n // Warm the ComponentMetadataEngine so the available-libraries\n // catalog is in memory by the time we first publish agent\n // context. The engine caches all MJ: Component Libraries\n // (~60 rows); we only need the Active ones at injection time.\n // Fire-and-forget: if it hasn't loaded by first publish, the\n // libraries list will just be empty for that turn β degrades\n // gracefully.\n void ComponentMetadataEngine.Instance.Config(false, this.currentUser ?? undefined, this.provider);\n // Restore cockpit UI prefs (pane sizes, collapse, last tab)\n // from UserInfoEngine. Single JSON blob under FORM_BUILDER_PREFS_KEY.\n this.loadPrefs();\n // Lazy-load the interactive-forms cache. First caller pays the\n // ~1 RunView per entity; subsequent components hit the in-memory\n // cache. The cockpit doesn't survive without this β it's the\n // source of truth for both ExistingForms and Versions.\n try {\n await InteractiveFormsEngine.Instance.Config(\n false,\n this.currentUser ?? undefined,\n this.provider,\n );\n } catch (err) {\n LogError(`FormBuilderResource: InteractiveFormsEngine.Config failed: ${err instanceof Error ? err.message : String(err)}`);\n }\n await this.loadExistingForms();\n // Subscribe to the engine's reactive caches so any mutation\n // (local save, agent save β remote-invalidate, delete) refreshes\n // both the forms list and the version rail without an explicit\n // reload. `skip(1)` drops the BehaviorSubject's initial replay β\n // we already populated state via the awaited loadExistingForms()\n // above, no need to re-run on the first emit.\n this.engineSubscription = combineLatest([\n InteractiveFormsEngine.Instance.Forms$,\n InteractiveFormsEngine.Instance.Overrides$,\n ]).pipe(skip(1)).subscribe(() => {\n void this.loadExistingForms();\n if (this.SelectedFormName) void this.loadVersionsForActiveForm();\n });\n // Resolve the Form Builder agent ID once. Fire-and-forget β if it\n // doesn't resolve before the user opens chat, [defaultAgentId]\n // stays null and the chat falls back to Sage routing (degrades\n // gracefully rather than blocking init).\n void this.resolveFormBuilderAgentId();\n // Subscribe to the shell's published AppContextSnapshot so the\n // embedded chat-area sees the same {App, ActiveNavItem, User,\n // AdditionalContext} shape the floating overlay sees. Our\n // cockpit-specific state lands inside AdditionalContext via\n // `SetAgentContext()` below.\n this.appContextSubscription = this.navigationService.AppContextSnapshot$\n .subscribe(snapshot => {\n this.ChatAppContext = snapshot;\n this.cdr.markForCheck();\n });\n\n // BaseEntity event subscription β fires for both local and\n // remote saves (Redis pub/sub β GraphQL subscription on the\n // remote-invalidate side). When the Form Builder agent saves\n // a Component or EntityFormOverride row that belongs to the\n // form currently loaded in this cockpit, we reload so the\n // canvas/code/preview reflect the agent's edits without\n // requiring a manual refresh. Scoped tightly to the active\n // form's lineage to avoid cross-cockpit churn.\n this.entityEventSubscription = MJGlobal.Instance.GetEventListener(false)\n .subscribe(mjEvent => this.handleEntityEvent(mjEvent));\n } catch (err) {\n LogError(`FormBuilderResource.ngAfterViewInit: ${err instanceof Error ? err.message : String(err)}`);\n } finally {\n this.IsLoading = false;\n this.cdr.markForCheck();\n this.NotifyLoadComplete();\n this.registerAgentContext();\n }\n }\n\n public override ngOnDestroy(): void {\n this.appContextSubscription?.unsubscribe();\n this.appContextSubscription = null;\n this.entityEventSubscription?.unsubscribe();\n this.entityEventSubscription = null;\n this.engineSubscription?.unsubscribe();\n this.engineSubscription = null;\n super.ngOnDestroy();\n }\n\n /**\n * MJGlobal event handler β fires whenever any BaseEntity in the app\n * is saved/deleted/etc. We filter aggressively here: only react to\n * `save` (local + remote-invalidate from the agent's server-side\n * action) on `MJ: Components` or `MJ: Entity Form Overrides`, and\n * only when the affected row belongs to the lineage of the form\n * currently loaded in this cockpit. Anything else bails immediately\n * β this listener runs for every entity save in the entire app, so\n * cheapness matters.\n */\n private handleEntityEvent(mjEvent: MJEvent): void {\n try {\n if (mjEvent.event !== MJEventType.ComponentEvent) return;\n if (mjEvent.eventCode !== BaseEntity.BaseEventCode) return;\n const evt = mjEvent.args as BaseEntityEvent | undefined;\n if (!evt) return;\n // Only care about completed saves and server-side invalidations.\n if (evt.type !== 'save' && evt.type !== 'remote-invalidate') return;\n\n const entityName = evt.entityName ?? evt.baseEntity?.EntityInfo?.Name;\n if (entityName !== 'MJ: Components' && entityName !== 'MJ: Entity Form Overrides') return;\n\n // Need a form actively loaded to compare against.\n if (!this.SelectedFormID && !this.ActiveOverrideID && !this.SelectedFormName) return;\n\n // For local 'save' events `baseEntity` is the live instance; for\n // 'remote-invalidate' events (server-side saves broadcast over\n // GraphQL CacheInvalidation) `baseEntity` is null and the same\n // data lives on `evt.payload.primaryKeyValues` (stringified\n // `{ID: ...}`) + `evt.payload.recordData` (stringified row).\n // Resolve both shapes to a common `{ savedID, savedName }`.\n const resolved = this.resolveEntityEventIdentity(evt);\n const { savedID, savedName } = resolved;\n\n if (entityName === 'MJ: Components') {\n // Match: same Component (in-place Modify on Pending) OR\n // same Name (Active path β new Pending sibling row in the\n // form's lineage). Either way the cockpit should refresh.\n const sameID = savedID && this.SelectedFormID && UUIDsEqual(savedID, this.SelectedFormID);\n const sameLineage = savedName && this.SelectedFormName && savedName === this.SelectedFormName;\n if (sameID || sameLineage) {\n void this.handleAgentEditedActiveForm();\n }\n } else if (entityName === 'MJ: Entity Form Overrides') {\n // Override row change β either our exact override or any\n // override in the same lineage (new Pending sibling).\n // Reload the version rail so a new Pending row surfaces.\n const sameID = savedID && this.ActiveOverrideID && UUIDsEqual(savedID, this.ActiveOverrideID);\n if (sameID) {\n void this.handleAgentEditedActiveForm();\n } else {\n // Lineage match isn't free to compute here, but\n // refreshing the version rail is cheap and covers it.\n void this.loadVersionsForActiveForm();\n }\n }\n } catch (err) {\n LogError(`FormBuilderResource.handleEntityEvent: ${err instanceof Error ? err.message : String(err)}`);\n }\n }\n\n /**\n * Normalize the `{ID, Name}` we need to match a BaseEntity event against\n * the active form, regardless of whether the event came from a local\n * `Save()` (with a live `baseEntity` attached) or a server-broadcast\n * `remote-invalidate` (where `baseEntity` is null and the row lives in\n * `evt.payload.primaryKeyValues` + `evt.payload.recordData`, both\n * JSON-stringified by `MJServer/src/index.ts:626-641`).\n */\n private resolveEntityEventIdentity(evt: BaseEntityEvent): { savedID: string | null; savedName: string | null } {\n if (evt.baseEntity) {\n const savedID = evt.baseEntity.PrimaryKey?.ToConcatenatedString() ?? null;\n const savedName = (evt.baseEntity.Get?.('Name') as string | undefined) ?? null;\n return { savedID, savedName };\n }\n const payload = evt.payload as { primaryKeyValues?: string | null; recordData?: string | null } | undefined;\n if (!payload) return { savedID: null, savedName: null };\n let savedID: string | null = null;\n let savedName: string | null = null;\n try {\n if (payload.primaryKeyValues) {\n const pk = JSON.parse(payload.primaryKeyValues) as Record<string, unknown> | unknown[];\n // Server stringifies `entity.PrimaryKey.KeyValuePairs` β an\n // array of `{FieldName, Value}` pairs in current versions,\n // or a `{ID: '...'}` map in some older ones. Handle both.\n if (Array.isArray(pk)) {\n const idPair = pk.find(p => (p as { FieldName?: string }).FieldName === 'ID') as { Value?: unknown } | undefined;\n if (idPair?.Value != null) savedID = String(idPair.Value);\n } else if (pk && typeof pk === 'object' && 'ID' in pk) {\n const v = (pk as { ID?: unknown }).ID;\n if (v != null) savedID = String(v);\n }\n }\n } catch {\n // bad JSON β leave savedID null, caller will just skip the match\n }\n try {\n if (payload.recordData) {\n const row = JSON.parse(payload.recordData) as Record<string, unknown>;\n if (typeof row?.Name === 'string') savedName = row.Name;\n if (!savedID && typeof row?.ID === 'string') savedID = row.ID;\n }\n } catch {\n // ditto\n }\n return { savedID, savedName };\n }\n\n /**\n * Agent (or another client) just modified the Component / Override\n * for the form currently loaded in this cockpit. Reload the spec\n * from the same Component so the canvas + code + preview reflect\n * the new state without forcing a manual refresh.\n *\n * Guards: don't clobber unsaved user edits β if the cockpit has its\n * own `DirtyFlag` set, surface a notification instead of silently\n * overwriting. The user can manually re-pick the form when ready.\n */\n private async handleAgentEditedActiveForm(): Promise<void> {\n const formID = this.SelectedFormID;\n if (!formID) return;\n if (this.DirtyFlag) {\n this.notifications.CreateSimpleNotification(\n 'Agent saved an update to this form, but you have unsaved local edits. Save or discard your changes to see the agent\\'s version.',\n 'info', 6000);\n return;\n }\n // Find the summary in the picker list so OnFormPicked can do its\n // standard load path (parses spec, rebuilds canvas, refreshes the\n // version rail, re-pushes agent context, etc.). If the row was\n // freshly created and isn't in the picker yet, reload the list.\n let summary = this.ExistingForms.find(f => UUIDsEqual(f.ID, formID));\n if (!summary) {\n await this.loadExistingForms();\n summary = this.ExistingForms.find(f => UUIDsEqual(f.ID, formID));\n }\n if (summary) {\n await this.OnFormPicked(summary);\n this.notifications.CreateSimpleNotification(\n 'Form updated by agent β canvas refreshed.', 'success', 3500);\n } else {\n // Couldn't locate the row (deleted? out-of-scope?) β just\n // refresh the version rail so the UI isn't stale.\n await this.loadVersionsForActiveForm();\n }\n }\n\n /**\n * One-shot lookup of the Form Builder agent's ID. Used to bind the\n * chat-area's `[defaultAgentId]` so the cockpit's chat skips Sage routing\n * and addresses messages directly to the form-authoring specialist.\n *\n * Uses `AIEngineBase.Instance.Agents` (the in-memory cache that's\n * already loaded on app boot) rather than a RunView round-trip. This\n * also avoids the easy-to-trip entity-name typo (`'AI Agents'` vs\n * `'MJ: AI Agents'`) that previously left FormBuilderAgentId null and\n * silently fell back to Sage routing.\n */\n private async resolveFormBuilderAgentId(): Promise<void> {\n try {\n await AIEngineBase.Instance.Config(false);\n const agent = AIEngineBase.Instance.Agents\n ?.find(a => a.Name?.trim().toLowerCase() === 'form builder');\n if (agent) {\n this.FormBuilderAgentId = agent.ID;\n this.cdr.markForCheck();\n } else {\n LogError(`FormBuilderResource.resolveFormBuilderAgentId: 'Form Builder' agent not found in AIEngineBase cache`);\n }\n } catch (err) {\n LogError(`FormBuilderResource.resolveFormBuilderAgentId: ${err instanceof Error ? err.message : String(err)}`);\n }\n }\n\n /**\n * Recompute the left-rail forms list from `InteractiveFormsEngine`'s\n * in-memory caches. **Synchronous** in spirit β the `async` signature is\n * kept for backwards-compat with existing call sites and to surface\n * future lazy-load needs cleanly. Reads only from the engine, never the\n * DB. Driven by the engine subscription in {@link ngAfterViewInit}, so\n * any save/delete/remote-invalidate refreshes this list automatically.\n *\n * Representative selection per Name lineage (Active > Pending >\n * Inactive > none, then VersionSequence DESC) and the projection to\n * {@link FormComponentSummary} match the previous RunView-based\n * implementation exactly.\n */\n private async loadExistingForms(): Promise<void> {\n const provider = this.provider;\n const engine = InteractiveFormsEngine.Instance;\n if (!provider || !engine.Loaded) {\n this.ExistingForms = [];\n this.cdr.markForCheck();\n return;\n }\n const user = this.currentUser;\n\n // Build lookup ComponentID β override Status + EntityID from the\n // engine's cached overrides. Scoped to the current user's User-scope\n // rows β Role/Global don't drive the cockpit's \"your overrides\" view.\n const overrideStatusByComponentID = new Map<string, 'Active' | 'Inactive' | 'Pending'>();\n const overrideEntityIDByComponentID = new Map<string, string>();\n if (user) {\n for (const o of engine.GetUserOverrides(user.ID)) {\n const cid = o.ComponentID ? NormalizeUUID(o.ComponentID) : '';\n if (!cid) continue;\n if (o.Status === 'Active' || o.Status === 'Inactive' || o.Status === 'Pending') {\n overrideStatusByComponentID.set(cid, o.Status);\n }\n if (o.EntityID) {\n overrideEntityIDByComponentID.set(cid, o.EntityID);\n }\n }\n }\n\n // Group Components by Name (the lineage key) and pick ONE\n // representative per lineage. Same Active > Pending > Inactive >\n // VersionSequence-DESC priority as before.\n type FormRow = {\n ID: string;\n Name: string;\n Namespace: string | null;\n Status: string | null;\n Description: string | null;\n VersionSequence: number | null;\n UpdatedAt: Date | null;\n };\n const componentsByName = new Map<string, FormRow[]>();\n for (const c of engine.Forms) {\n const key = (c.Name ?? '').trim();\n if (!key) continue;\n const row: FormRow = {\n ID: c.ID,\n Name: c.Name,\n Namespace: c.Namespace,\n Status: c.Status,\n Description: c.Description,\n VersionSequence: c.VersionSequence,\n UpdatedAt: c.__mj_UpdatedAt instanceof Date ? c.__mj_UpdatedAt : (c.__mj_UpdatedAt ? new Date(c.__mj_UpdatedAt) : null),\n };\n const bucket = componentsByName.get(key);\n if (bucket) bucket.push(row); else componentsByName.set(key, [row]);\n }\n\n const rankOverride = (s: 'Active' | 'Inactive' | 'Pending' | null): number => {\n if (s === 'Active') return 3;\n if (s === 'Pending') return 2;\n if (s === 'Inactive') return 1;\n return 0;\n };\n\n const representatives: FormRow[] = [];\n for (const bucket of componentsByName.values()) {\n bucket.sort((a, b) => {\n const oa = overrideStatusByComponentID.get(NormalizeUUID(a.ID)) ?? null;\n const ob = overrideStatusByComponentID.get(NormalizeUUID(b.ID)) ?? null;\n const da = rankOverride(ob) - rankOverride(oa);\n if (da !== 0) return da;\n return (b.VersionSequence ?? 0) - (a.VersionSequence ?? 0);\n });\n representatives.push(bucket[0]);\n }\n representatives.sort((a, b) => (a.Name ?? '').localeCompare(b.Name ?? ''));\n\n this.ExistingForms = representatives.map(r => {\n const norm = NormalizeUUID(r.ID);\n const entityID = overrideEntityIDByComponentID.get(norm) ?? null;\n const entity = entityID ? provider.Entities?.find(e => UUIDsEqual(e.ID, entityID)) : null;\n return {\n ID: r.ID,\n Name: r.Name,\n Namespace: r.Namespace,\n Status: r.Status,\n OverrideStatus: overrideStatusByComponentID.get(norm) ?? null,\n Description: r.Description,\n TargetEntityName: entity?.Name ?? null,\n TargetEntityID: entityID,\n TargetEntityDisplayName: entity?.DisplayName ?? null,\n TargetEntityIcon: entity?.Icon ?? null,\n TargetEntitySchemaName: entity?.SchemaName ?? null,\n UpdatedAt: r.UpdatedAt,\n };\n });\n this.cdr.markForCheck();\n }\n\n /**\n * Forms list filtered + sorted per the user's left-rail prefs.\n * Pipeline: search text β entity filter β status chips β sort β\n * pinned-first. The result drives both the flat-list view and is\n * grouped by schema/entity for the tree view.\n */\n public get filteredForms(): ReadonlyArray<FormComponentSummary> {\n const q = this.LeftRailFilter.trim().toLowerCase();\n const entityFilter = this.FormsEntityFilter.trim();\n const statusSet = this.FormsStatusFilter;\n const filtered = this.ExistingForms.filter(f => {\n // Text search (name + namespace + entity display).\n if (q && !(\n f.Name.toLowerCase().includes(q) ||\n (f.Namespace?.toLowerCase().includes(q) ?? false) ||\n (f.TargetEntityName?.toLowerCase().includes(q) ?? false) ||\n (f.TargetEntityDisplayName?.toLowerCase().includes(q) ?? false)\n )) return false;\n // Entity filter β exact match on EntityName (or no filter).\n if (entityFilter && f.TargetEntityName !== entityFilter) return false;\n // Status filter β show only if its override status is in the\n // enabled set. Forms with no override status are shown when\n // ALL three status chips are on (the default), hidden otherwise.\n if (f.OverrideStatus) {\n if (!statusSet.has(f.OverrideStatus)) return false;\n } else {\n if (statusSet.size < 3) return false;\n }\n return true;\n });\n // Sort by current mode.\n const sorted = [...filtered].sort((a, b) => {\n switch (this.FormsSortMode) {\n case 'updated-desc':\n return (b.UpdatedAt?.getTime() ?? 0) - (a.UpdatedAt?.getTime() ?? 0);\n case 'updated-asc':\n return (a.UpdatedAt?.getTime() ?? 0) - (b.UpdatedAt?.getTime() ?? 0);\n case 'name-asc':\n return a.Name.localeCompare(b.Name);\n case 'name-desc':\n return b.Name.localeCompare(a.Name);\n }\n });\n // Pinned items float to the top, in pin-set insertion order.\n const pinned: FormComponentSummary[] = [];\n const unpinned: FormComponentSummary[] = [];\n for (const f of sorted) {\n if (this.PinnedFormIds.has(NormalizeUUID(f.ID))) pinned.push(f);\n else unpinned.push(f);\n }\n return [...pinned, ...unpinned];\n }\n\n /**\n * Tree-view groups: forms grouped by SchemaName β EntityName. Falls\n * back to a synthetic \"(no entity)\" group for forms without a\n * user-scope override bound to an entity.\n */\n public get treeGroups(): ReadonlyArray<{\n schema: string;\n entities: ReadonlyArray<{ entity: string; entityDisplay: string; icon: string | null; forms: ReadonlyArray<FormComponentSummary> }>;\n }> {\n const bySchema = new Map<string, Map<string, FormComponentSummary[]>>();\n for (const f of this.filteredForms) {\n const schema = f.TargetEntitySchemaName ?? '(no schema)';\n const entity = f.TargetEntityName ?? '(no entity)';\n let byEntity = bySchema.get(schema);\n if (!byEntity) { byEntity = new Map(); bySchema.set(schema, byEntity); }\n const bucket = byEntity.get(entity);\n if (bucket) bucket.push(f); else byEntity.set(entity, [f]);\n }\n const out: Array<{ schema: string; entities: Array<{ entity: string; entityDisplay: string; icon: string | null; forms: FormComponentSummary[] }> }> = [];\n const schemas = Array.from(bySchema.keys()).sort();\n for (const schema of schemas) {\n const byEntity = bySchema.get(schema)!;\n const entityKeys = Array.from(byEntity.keys()).sort();\n const entities = entityKeys.map(entity => {\n const forms = byEntity.get(entity)!;\n const firstWithDisplay = forms.find(f => f.TargetEntityDisplayName);\n const firstWithIcon = forms.find(f => f.TargetEntityIcon);\n return {\n entity,\n entityDisplay: firstWithDisplay?.TargetEntityDisplayName ?? entity,\n icon: firstWithIcon?.TargetEntityIcon ?? null,\n forms,\n };\n });\n out.push({ schema, entities });\n }\n return out;\n }\n\n /**\n * Distinct entity names that appear in the current forms list β used\n * to populate the entity-filter dropdown. Empty string (\"\") = \"All\n * entities\", added at the top. Search-text-filtered when the user\n * is typing into the dropdown's own search box.\n */\n public get entityFilterOptions(): ReadonlyArray<{ name: string; display: string; icon: string | null; count: number }> {\n const counts = new Map<string, { name: string; display: string; icon: string | null; count: number }>();\n for (const f of this.ExistingForms) {\n if (!f.TargetEntityName) continue;\n const existing = counts.get(f.TargetEntityName);\n if (existing) existing.count++;\n else counts.set(f.TargetEntityName, {\n name: f.TargetEntityName,\n display: f.TargetEntityDisplayName ?? f.TargetEntityName,\n icon: f.TargetEntityIcon ?? null,\n count: 1,\n });\n }\n const list = Array.from(counts.values()).sort((a, b) => a.display.localeCompare(b.display));\n const q = this.EntityFilterSearch.trim().toLowerCase();\n if (!q) return list;\n return list.filter(o => o.display.toLowerCase().includes(q) || o.name.toLowerCase().includes(q));\n }\n\n public OnLeftRailFilterChange(event: Event): void {\n this.LeftRailFilter = (event.target as HTMLInputElement).value;\n this.cdr.markForCheck();\n }\n\n public ToggleFormsViewMode(): void {\n this.FormsViewMode = this.FormsViewMode === 'list' ? 'tree' : 'list';\n this.savePrefs();\n this.cdr.markForCheck();\n }\n\n public ToggleEntityFilterDropdown(): void {\n this.EntityFilterDropdownOpen = !this.EntityFilterDropdownOpen;\n if (this.EntityFilterDropdownOpen) this.EntityFilterSearch = '';\n this.cdr.markForCheck();\n }\n\n public OnEntityFilterSearch(e: Event): void {\n this.EntityFilterSearch = (e.target as HTMLInputElement).value;\n this.cdr.markForCheck();\n }\n\n public PickEntityFilter(entityName: string): void {\n this.FormsEntityFilter = entityName;\n this.EntityFilterDropdownOpen = false;\n this.savePrefs();\n this.cdr.markForCheck();\n }\n\n public ToggleStatusFilter(status: 'Active' | 'Pending' | 'Inactive'): void {\n const next = new Set(this.FormsStatusFilter);\n if (next.has(status)) next.delete(status); else next.add(status);\n // Never let the user disable everything β re-enable if they tried.\n if (next.size === 0) next.add(status);\n this.FormsStatusFilter = next;\n this.savePrefs();\n this.cdr.markForCheck();\n }\n\n public SetFormsSortMode(mode: 'updated-desc' | 'updated-asc' | 'name-asc' | 'name-desc'): void {\n this.FormsSortMode = mode;\n this.savePrefs();\n this.cdr.markForCheck();\n }\n\n public TogglePinForm(form: FormComponentSummary, event?: Event): void {\n event?.stopPropagation();\n const next = new Set(this.PinnedFormIds);\n const id = NormalizeUUID(form.ID);\n if (next.has(id)) next.delete(id); else next.add(id);\n this.PinnedFormIds = next;\n this.savePrefs();\n this.cdr.markForCheck();\n }\n\n public IsFormPinned(form: FormComponentSummary): boolean {\n return this.PinnedFormIds.has(NormalizeUUID(form.ID));\n }\n\n public ToggleFormsListCollapsed(): void {\n this.FormsListCollapsed = !this.FormsListCollapsed;\n // If both inner panels would be collapsed, expand the other one.\n if (this.FormsListCollapsed && this.VersionsCollapsed) this.VersionsCollapsed = false;\n this.savePrefs();\n this.cdr.markForCheck();\n }\n\n public ToggleVersionsCollapsed(): void {\n this.VersionsCollapsed = !this.VersionsCollapsed;\n if (this.VersionsCollapsed && this.FormsListCollapsed) this.FormsListCollapsed = false;\n this.savePrefs();\n this.cdr.markForCheck();\n }\n\n /**\n * Drag-end handler for the inner vertical splitter between the forms\n * list and the versions panel inside the left rail. Persists the\n * percent split so the user's preferred layout sticks across reloads.\n */\n public OnInnerSplitterDragEnd(event: { sizes: ReadonlyArray<number | '*'> }): void {\n const sizes = event?.sizes ?? [];\n const numeric = (i: number): number | null => {\n const v = sizes[i];\n return typeof v === 'number' ? v : null;\n };\n const top = numeric(0);\n if (top !== null) this.FormsListHeightPct = top;\n this.savePrefs();\n }\n\n /** Right-click context menu on a form row. Opens at click coords. */\n public OnFormRowContextMenu(form: FormComponentSummary, event: MouseEvent): void {\n event.preventDefault();\n this.ContextMenuForm = form;\n this.ContextMenuX = event.clientX;\n this.ContextMenuY = event.clientY;\n this.ContextMenuOpen = true;\n this.cdr.markForCheck();\n }\n\n public CloseContextMenu(): void {\n this.ContextMenuOpen = false;\n this.ContextMenuForm = null;\n this.cdr.markForCheck();\n }\n\n public async ContextMenuDuplicate(): Promise<void> {\n const form = this.ContextMenuForm;\n this.CloseContextMenu();\n if (!form) return;\n // Duplicate the form by loading its spec and creating a new one\n // via Save β straightforward; user gets a \"(Copy)\" suffix.\n await this.OnFormPicked(form);\n if (!this.SelectedFormID) return;\n this.SelectedFormName = `${form.Name} (Copy)`;\n this.SelectedFormID = null;\n this.IsNewForm = true;\n this.markDirty();\n this.notifications.CreateSimpleNotification(\n `Duplicating \"${form.Name}\". Click Save to persist the copy.`, 'info', 5000);\n }\n\n public async ContextMenuDelete(): Promise<void> {\n const form = this.ContextMenuForm;\n this.CloseContextMenu();\n if (!form) return;\n if (!UUIDsEqual(this.SelectedFormID, form.ID)) await this.OnFormPicked(form);\n await this.OnDelete();\n }\n\n public ContextMenuCopyID(): void {\n const id = this.ContextMenuForm?.ID;\n this.CloseContextMenu();\n if (!id) return;\n if (typeof navigator !== 'undefined' && navigator.clipboard) {\n void navigator.clipboard.writeText(id);\n this.notifications.CreateSimpleNotification(`Copied ${id}`, 'success', 2000);\n }\n }\n\n public ContextMenuExportSpec(): void {\n const form = this.ContextMenuForm;\n this.CloseContextMenu();\n if (!form) return;\n if (!UUIDsEqual(this.SelectedFormID, form.ID)) {\n this.notifications.CreateSimpleNotification(\n `Open \"${form.Name}\" first, then export from there.`, 'info', 4000);\n return;\n }\n const spec = this.SavedSpec ?? null;\n const json = spec ? JSON.stringify(spec, null, 2) : this.EditableCode;\n if (typeof navigator !== 'undefined' && navigator.clipboard) {\n void navigator.clipboard.writeText(json);\n this.notifications.CreateSimpleNotification('Spec copied to clipboard.', 'success', 3000);\n }\n }\n\n public ContextMenuTogglePin(): void {\n const form = this.ContextMenuForm;\n this.CloseContextMenu();\n if (!form) return;\n this.TogglePinForm(form);\n }\n\n public ToggleLeftRail(): void {\n this.LeftRailCollapsed = !this.LeftRailCollapsed;\n this.savePrefs();\n this.cdr.markForCheck();\n }\n\n public ToggleRightRail(): void {\n this.RightRailCollapsed = !this.RightRailCollapsed;\n this.cdr.markForCheck();\n }\n\n public ToggleChatPane(): void {\n this.ChatPaneCollapsed = !this.ChatPaneCollapsed;\n this.savePrefs();\n this.cdr.markForCheck();\n }\n\n public SetCenterPaneMode(mode: 'preview' | 'code' | 'layout'): void {\n this.CenterPaneMode = mode;\n this.savePrefs();\n this.cdr.markForCheck();\n if (mode === 'preview' && this.TargetEntityName && !this.PreviewRecord) {\n // Lazy-load on first switch β avoids the RunView on every form\n // pick when the user prefers Code or Layout.\n void this.loadPreviewRecord();\n }\n }\n\n /**\n * Live `ComponentSpec` for the Preview pane. Derived from the in-memory\n * `EditableCode` so the preview reflects unsaved edits β switching to\n * Preview while typing in Code shows the in-progress version, not the\n * last-saved one. Falls back to null when there's no code yet, in which\n * case the Preview pane shows a friendly empty state.\n */\n public get PreviewSpec(): import('@memberjunction/interactive-component-types').ComponentSpec | null {\n if (!this.SelectedFormName || !this.EditableCode || !this.EditableCode.trim()) {\n return null;\n }\n // Retrospective fix #5: merge live edits over the saved spec so the\n // Preview keeps dataRequirements / functionalRequirements / etc.\n // intact. Previously the getter rebuilt a stripped spec from code +\n // name only β components whose hooks depend on dataRequirements\n // would render in Preview without their data context.\n const base: Record<string, unknown> = this.SavedSpec\n ? { ...(this.SavedSpec as unknown as Record<string, unknown>) }\n : {};\n base.name = toComponentIdentifier(this.SelectedFormName);\n base.componentRole = 'form';\n base.location = 'embedded';\n base.code = this.EditableCode;\n base.title = this.SelectedFormName;\n return base as unknown as import('@memberjunction/interactive-component-types').ComponentSpec;\n }\n\n /**\n * Load a Top-1 record from the target entity to bind into the preview.\n * If the entity has no rows, we still mount the form against a synthetic\n * NewRecord() so the layout / styling / event handlers can be evaluated.\n */\n public async loadPreviewRecord(): Promise<void> {\n const provider = this.provider;\n const user = this.currentUser;\n if (!provider || !user || !this.TargetEntityName) return;\n this.PreviewLoading = true;\n this.PreviewError = null;\n this.cdr.markForCheck();\n try {\n const entityInfo = provider.EntityByName(this.TargetEntityName);\n if (!entityInfo) {\n this.PreviewError = `Entity '${this.TargetEntityName}' is not registered.`;\n return;\n }\n // Retrospective fix #7: order by NameField (then created-at) so\n // the \"Top 1\" is deterministic β different users see the same\n // record bound to the preview.\n const orderBy = entityInfo.NameField?.Name\n ? `${entityInfo.NameField.Name} ASC`\n : `__mj_CreatedAt DESC`;\n const rv = RunView.FromMetadataProvider(provider);\n const result = await rv.RunView<BaseEntity>({\n EntityName: this.TargetEntityName,\n MaxRows: 1,\n OrderBy: orderBy,\n ResultType: 'entity_object',\n }, user);\n if (result.Success && (result.Results?.length ?? 0) > 0) {\n this.PreviewRecord = result.Results[0];\n this.PreviewRecordIsReal = true;\n this.PreviewRecordLabel = this.recordLabel(this.PreviewRecord);\n } else {\n // No rows β fall back to a fresh NewRecord. The form still\n // mounts and the user can see how create-mode renders.\n const fresh = await provider.GetEntityObject<BaseEntity>(this.TargetEntityName, user);\n fresh.NewRecord();\n this.PreviewRecord = fresh;\n this.PreviewRecordIsReal = false;\n this.PreviewRecordLabel = 'New record (mock)';\n }\n } catch (err) {\n this.PreviewError = err instanceof Error ? err.message : String(err);\n LogError(`FormBuilderResource.loadPreviewRecord: ${this.PreviewError}`);\n } finally {\n this.PreviewLoading = false;\n this.cdr.markForCheck();\n }\n }\n\n /** Pull a human label from the record's NameField or primary key. */\n private recordLabel(record: BaseEntity): string {\n const nameField = record.EntityInfo?.NameField?.Name;\n if (nameField) {\n const v = record.Get(nameField);\n if (v != null && String(v).trim().length > 0) return String(v);\n }\n if (record.PrimaryKey?.HasValue) return record.PrimaryKey.ToConcatenatedString();\n return record.EntityInfo?.Name ?? '(record)';\n }\n\n /**\n * Handle a LoadErrorChanged emit from <mj-interactive-form> in the\n * Preview pane. Surfaces the error in the cockpit's own error state so\n * users see \"Preview failed\" in the cockpit chrome instead of having\n * to look inside the form's React shell. Retrospective fix #10.\n */\n public OnPreviewLoadError(message: string | null): void {\n this.PreviewError = message;\n this.cdr.markForCheck();\n }\n\n /**\n * Open the preview record (the entity row currently bound to\n * `<mj-interactive-form>`) in a fresh Explorer tab. Useful sanity-check\n * β render the form against this same record in the production\n * resolver path to confirm the cockpit's preview matches reality.\n */\n public OpenPreviewRecord(): void {\n if (!this.PreviewRecord || !this.PreviewRecordIsReal || !this.TargetEntityName) return;\n try {\n const pk = this.PreviewRecord.PrimaryKey;\n if (!pk) return;\n this.navigationService.OpenEntityRecord(this.TargetEntityName, pk);\n } catch (err) {\n LogError(`OpenPreviewRecord: ${err instanceof Error ? err.message : String(err)}`);\n }\n }\n\n public TogglePreviewPicker(): void {\n this.PreviewPickerOpen = !this.PreviewPickerOpen;\n this.cdr.markForCheck();\n // Auto-populate the dropdown with the top N records on open so the\n // user sees something to click immediately. Search-as-you-type\n // narrows from there. Without this, the dropdown opens to an empty\n // \"Start typingβ¦\" hint, which is dead UX for entities where the\n // user just wants to flip between a handful of records.\n if (this.PreviewPickerOpen && this.TargetEntityName && this.PreviewSearchResults.length === 0) {\n void this.loadPreviewPickerResults('');\n }\n }\n\n /** Search-as-you-type for the preview record picker. */\n public async OnPreviewSearchInput(event: Event): Promise<void> {\n const term = (event.target as HTMLInputElement).value ?? '';\n this.PreviewSearchTerm = term;\n await this.loadPreviewPickerResults(term);\n }\n\n /**\n * Shared loader for the preview record picker. Empty term β top N\n * by name. Non-empty term β `LIKE %term%` on the name field. Both\n * paths share the result-mapping logic so the dropdown looks the same.\n */\n private async loadPreviewPickerResults(term: string): Promise<void> {\n if (!this.TargetEntityName) {\n this.PreviewSearchResults = [];\n this.cdr.markForCheck();\n return;\n }\n const provider = this.provider;\n const user = this.currentUser;\n if (!provider || !user) return;\n const entity = provider.EntityByName(this.TargetEntityName);\n const nameField = entity?.NameField?.Name;\n if (!nameField) {\n this.PreviewSearchResults = [];\n return;\n }\n const trimmed = term.trim();\n const filter = trimmed.length === 0\n ? '' // no filter β engine returns top N ordered by name field\n : `${nameField} LIKE '%${trimmed.replace(/'/g, \"''\")}%'`;\n try {\n const rv = RunView.FromMetadataProvider(provider);\n const result = await rv.RunView<BaseEntity>({\n EntityName: this.TargetEntityName,\n ExtraFilter: filter,\n OrderBy: `${nameField} ASC`,\n MaxRows: 8,\n ResultType: 'entity_object',\n }, user);\n this.PreviewSearchResults = (result.Results ?? []).map(r => ({\n ID: r.PrimaryKey?.ToConcatenatedString() ?? '',\n Label: this.recordLabel(r),\n }));\n this.cdr.markForCheck();\n } catch (err) {\n LogError(`FormBuilderResource.loadPreviewPickerResults: ${err instanceof Error ? err.message : String(err)}`);\n }\n }\n\n /** User picked a different record from the search results β re-bind preview. */\n public async OnPreviewRecordPicked(item: { ID: string; Label: string }): Promise<void> {\n const provider = this.provider;\n const user = this.currentUser;\n if (!provider || !user || !this.TargetEntityName) return;\n const entityInfo = provider.EntityByName(this.TargetEntityName);\n if (!entityInfo) return;\n try {\n const rec = await provider.GetEntityObject<BaseEntity>(this.TargetEntityName, user);\n const pk = new CompositeKey();\n pk.LoadFromURLSegment(entityInfo, item.ID);\n if (await rec.InnerLoad(pk)) {\n this.PreviewRecord = rec;\n this.PreviewRecordIsReal = true;\n this.PreviewRecordLabel = item.Label;\n this.PreviewPickerOpen = false;\n this.PreviewSearchTerm = '';\n this.PreviewSearchResults = [];\n this.cdr.markForCheck();\n }\n } catch (err) {\n LogError(`FormBuilderResource.OnPreviewRecordPicked: ${err instanceof Error ? err.message : String(err)}`);\n }\n }\n\n /**\n * Direct-edit handler used by `<mj-code-editor>` via ngModelChange.\n * Receives the new editor value as a string. Marks the form dirty so\n * the Save button activates; the Layout-tab canvas is *not* re-derived\n * here (avoids destructive round-trips when the JSX has hand-authored\n * bits the canvas-parser can't model).\n */\n /**\n * Chat-area emitted `conversationCreated` after the user sent the first\n * message β switch the embedded chat out of \"new conversation\" mode so\n * subsequent renders show the live conversation thread. Without this,\n * the chat appears stuck on its welcome screen.\n */\n public OnChatConversationCreated(event: {\n conversation: MJConversationEntity;\n pendingMessage?: string;\n pendingAttachments?: unknown[];\n }): void {\n // Atomic state-flip matching the overlay's pattern: set conversation\n // identity AND re-feed the pending message/attachments in the same\n // change-detection cycle. The chat-area picks them up on the next\n // render and actually delivers the message.\n this.ChatPendingMessage = event.pendingMessage ?? null;\n this.ChatPendingAttachments = (event.pendingAttachments ?? null) as unknown[] | null;\n this.ChatConversation = event.conversation;\n this.ChatConversationId = event.conversation.ID;\n this.ChatIsNewConversation = false;\n this.cdr.markForCheck();\n }\n\n /**\n * Chat-area finished delivering the pending message β clear the buffer\n * so a re-render doesn't try to send it again.\n */\n public OnChatPendingMessageConsumed(): void {\n this.ChatPendingMessage = null;\n this.ChatPendingAttachments = null;\n this.cdr.markForCheck();\n }\n\n // ββ Chat surface event wiring ββββββββββββββββββββββββββββββββββββ\n // The embedded <mj-conversation-chat-area> emits the same outbound\n // events the main workspace listens for; without handlers, clicks\n // inside the chat (entity record links, artifact links, task\n // navigation, thread drill-down) silently do nothing. Each handler\n // below mirrors the workspace's behavior but routes through\n // NavigationService so the target opens as an Explorer tab.\n\n /**\n * Chat-area emitted `openEntityRecord` β user clicked an entity link\n * inside an agent reply. Open the record as a new Explorer tab via\n * NavigationService (same as the workspace's actionable-command\n * path, but executed directly here since the cockpit has no\n * intermediate workspace shell).\n */\n public OnChatOpenEntityRecord(event: { entityName: string; compositeKey: CompositeKey }): void {\n try {\n this.navigationService.OpenEntityRecord(event.entityName, event.compositeKey);\n } catch (err) {\n LogError(`FormBuilderResource.OnChatOpenEntityRecord: ${err instanceof Error ? err.message : String(err)}`);\n }\n }\n\n /**\n * Chat-area emitted a generic `navigationRequest` (cross-resource\n * navigation, e.g. \"go to Collections with this artifact\"). Route\n * via NavigationService.OpenNavItemByName.\n */\n public OnChatNavigationRequest(event: NavigationRequest): void {\n void this.navigationService.OpenNavItemByName(\n event.navItemName,\n event.params,\n event.appId\n );\n }\n\n /**\n * Chat-area emitted `taskClicked` β user clicked a task pill in an\n * agent reply. The workspace switches to its Tasks tab; the cockpit\n * has no Tasks tab, so open the task record directly.\n */\n public OnChatTaskClicked(task: MJTaskEntity): void {\n try {\n const key = CompositeKey.FromID(task.ID);\n this.navigationService.OpenEntityRecord('MJ: Tasks', key);\n } catch (err) {\n LogError(`FormBuilderResource.OnChatTaskClicked: ${err instanceof Error ? err.message : String(err)}`);\n }\n }\n\n /**\n * Chat-area emitted `artifactLinkClicked` β user clicked an artifact\n * link inside a message. Conversation-type links point at another\n * conversation in main Chat; collection-type links point at a\n * collection. Both route into the main Chat / Collections app via\n * NavigationService so the artifact opens in its native context\n * (the cockpit is form-authoring focused, not the right surface to\n * render arbitrary artifacts inline).\n */\n public OnChatArtifactLinkClicked(event: { type: 'conversation' | 'collection'; id: string }): void {\n const navItemName = event.type === 'conversation' ? 'Conversations' : 'Collections';\n const paramKey = event.type === 'conversation' ? 'conversationId' : 'collectionId';\n void this.navigationService.OpenNavItemByName(navItemName, { [paramKey]: event.id });\n }\n\n /** Chat-area emitted `conversationRenamed` β purely informational for the cockpit (no convo list to animate). */\n public OnChatConversationRenamed(event: { conversationId: string; name: string; description: string }): void {\n // Mirror the locally-held conversation reference so the header\n // title in the chat-area stays in sync if we ever re-render. The\n // chat-area updates its own title via the conversation entity,\n // but we keep this hook here for parity with the workspace shell.\n if (this.ChatConversation && UUIDsEqual(this.ChatConversation.ID, event.conversationId)) {\n this.ChatConversation.Name = event.name;\n if (event.description !== undefined) {\n this.ChatConversation.Description = event.description;\n }\n this.cdr.markForCheck();\n }\n }\n\n /** Thread drill-down: chat-area opened a sub-thread. Track ID so the chat-area renders it. */\n public OnChatThreadOpened(threadId: string): void {\n this.ChatThreadId = threadId;\n this.cdr.markForCheck();\n }\n\n /** Thread drill-down: chat-area closed the sub-thread. Clear ID. */\n public OnChatThreadClosed(): void {\n this.ChatThreadId = null;\n this.cdr.markForCheck();\n }\n\n /** Pending artifact handed off to the chat-area (e.g. via deep link) has been consumed. */\n public OnChatPendingArtifactConsumed(): void {\n this.ChatPendingArtifactId = null;\n this.ChatPendingArtifactVersionNumber = null;\n this.cdr.markForCheck();\n }\n\n // ββ Persisted UI preferences (UserInfoEngine) ββββββββββββββββββββ\n\n /**\n * Load cockpit prefs from UserInfoEngine. Called once during\n * ngAfterViewInit. Missing / unparseable values fall through to the\n * defaults declared at field-init time β never throws.\n */\n private loadPrefs(): void {\n try {\n const raw = UserInfoEngine.Instance.GetSetting(FORM_BUILDER_PREFS_KEY);\n if (!raw) return;\n const prefs = JSON.parse(raw) as FormBuilderPrefs;\n if (typeof prefs.leftPanePct === 'number') this.LeftPanePct = prefs.leftPanePct;\n if (typeof prefs.centerPanePct === 'number') this.CenterPanePct = prefs.centerPanePct;\n if (typeof prefs.chatPanePct === 'number') this.ChatPanePct = prefs.chatPanePct;\n if (typeof prefs.leftCollapsed === 'boolean') this.LeftRailCollapsed = prefs.leftCollapsed;\n if (typeof prefs.chatCollapsed === 'boolean') this.ChatPaneCollapsed = prefs.chatCollapsed;\n if (prefs.lastCenterPaneMode === 'preview' ||\n prefs.lastCenterPaneMode === 'code' ||\n prefs.lastCenterPaneMode === 'layout') {\n this.CenterPaneMode = prefs.lastCenterPaneMode;\n }\n // ββ Inner left-rail layout βββββββββββββββββββββββββββββββββ\n if (typeof prefs.formsListHeightPct === 'number') this.FormsListHeightPct = prefs.formsListHeightPct;\n if (typeof prefs.formsListCollapsed === 'boolean') this.FormsListCollapsed = prefs.formsListCollapsed;\n if (typeof prefs.versionsCollapsed === 'boolean') this.VersionsCollapsed = prefs.versionsCollapsed;\n // ββ Forms list display βββββββββββββββββββββββββββββββββββββ\n if (prefs.formsViewMode === 'list' || prefs.formsViewMode === 'tree') this.FormsViewMode = prefs.formsViewMode;\n if (typeof prefs.formsEntityFilter === 'string') this.FormsEntityFilter = prefs.formsEntityFilter;\n if (Array.isArray(prefs.formsStatusFilter)) {\n const valid = prefs.formsStatusFilter.filter(s => s === 'Active' || s === 'Pending' || s === 'Inactive');\n if (valid.length > 0) this.FormsStatusFilter = new Set(valid);\n }\n if (prefs.formsSortMode === 'updated-desc' || prefs.formsSortMode === 'updated-asc'\n || prefs.formsSortMode === 'name-asc' || prefs.formsSortMode === 'name-desc') {\n this.FormsSortMode = prefs.formsSortMode;\n }\n if (Array.isArray(prefs.pinnedFormIds)) {\n this.PinnedFormIds = new Set(prefs.pinnedFormIds.map(id => NormalizeUUID(id)));\n }\n } catch (err) {\n LogError(`FormBuilderResource.loadPrefs: ${err instanceof Error ? err.message : String(err)}`);\n }\n }\n\n /**\n * Write the current cockpit UI state back to UserInfoEngine, debounced\n * (the engine handles debouncing internally). Called from the splitter's\n * drag-end event, the collapse toggles, and the center-pane mode setter.\n */\n private savePrefs(): void {\n const prefs: FormBuilderPrefs = {\n leftPanePct: this.LeftPanePct,\n centerPanePct: this.CenterPanePct,\n chatPanePct: this.ChatPanePct,\n leftCollapsed: this.LeftRailCollapsed,\n chatCollapsed: this.ChatPaneCollapsed,\n lastCenterPaneMode: this.CenterPaneMode,\n formsListHeightPct: this.FormsListHeightPct,\n formsListCollapsed: this.FormsListCollapsed,\n versionsCollapsed: this.VersionsCollapsed,\n formsViewMode: this.FormsViewMode,\n formsEntityFilter: this.FormsEntityFilter,\n formsStatusFilter: Array.from(this.FormsStatusFilter),\n formsSortMode: this.FormsSortMode,\n pinnedFormIds: Array.from(this.PinnedFormIds),\n };\n try {\n UserInfoEngine.Instance.SetSettingDebounced(FORM_BUILDER_PREFS_KEY, JSON.stringify(prefs));\n } catch (err) {\n LogError(`FormBuilderResource.savePrefs: ${err instanceof Error ? err.message : String(err)}`);\n }\n }\n\n /**\n * Splitter drag-end handler. `sizes` from angular-split is an array of\n * `SplitAreaSize` values (number | '*' for auto-size); for our\n * percent-unit splitter only numbers come through, but the union forces\n * us to filter. Order matches the visible-pane order: [left?, center, chat?].\n */\n public OnSplitterDragEnd(event: { sizes: ReadonlyArray<number | '*'> }): void {\n const sizes = event.sizes ?? [];\n const numeric = (i: number): number | undefined => {\n const v = sizes[i];\n return typeof v === 'number' ? v : undefined;\n };\n let i = 0;\n if (!this.LeftRailCollapsed) this.LeftPanePct = numeric(i++) ?? this.LeftPanePct;\n this.CenterPanePct = numeric(i++) ?? this.CenterPanePct;\n if (!this.ChatPaneCollapsed) this.ChatPanePct = numeric(i++) ?? this.ChatPanePct;\n this.savePrefs();\n }\n\n public OnEditableCodeChange(next: string | null | undefined): void {\n const value = next ?? '';\n if (value === this.EditableCode) return;\n this.EditableCode = value;\n this.DirtyFlag = true;\n this.cdr.markForCheck();\n }\n\n /**\n * Load all Component versions sharing the active form's Name. The version\n * rail renders these; `Active` / `Pending` flags come from cross-referencing\n * EntityFormOverrides for the user. Tolerates missing user / empty results\n * β version rail just shows nothing in that case.\n */\n /**\n * Look up the most-recent conversation linked to the active form\n * (LinkedEntityID=MJ:Components, LinkedRecordID anywhere in the form's\n * Component lineage for this entity) for the current user and bind it\n * to the embedded chat.\n *\n * **Lineage-aware**: a Form Builder conversation belongs to \"this form\"\n * (the Component.Name lineage), not to a single Component version. When\n * the agent does a `patch`/`minor`/`major` bump via Modify Interactive\n * Form, prior conversations were stamped with the old ComponentID β a\n * naive `LinkedRecordID = SelectedFormID` lookup would orphan them. We\n * expand the lookup to all Components in the same lineage by joining\n * `vwComponents.Name = SelectedFormName` with\n * `vwEntityFormOverrides.EntityID = TargetEntityID` inside an `IN`\n * subquery so it stays one round-trip.\n *\n * Note: this is ONLY about which prior conversation to show in the\n * cockpit chat. New conversations are still stamped with the current\n * SelectedFormID; the lineage join on read picks them up across\n * version bumps. Runtime form resolution is completely unaffected.\n *\n * If none exists, reset to a fresh pre-conversation state β the\n * suppressed empty-state path in <mj-conversation-chat-area> renders\n * the normal header + mode picker + input so the user can start a\n * new linked conversation in place. Errors are tolerated (chat just\n * stays on the previous state).\n */\n private async loadLinkedConversationForActiveForm(): Promise<void> {\n const provider = this.provider;\n const user = this.currentUser;\n // Always blank the chat first so the chat-area sees a clear\n // input transition (B.ID -> null -> A.ID) when switching between\n // forms.\n this.resetChatToFresh();\n this.LineageConversations = [];\n this.cdr.detectChanges();\n if (!provider || !user || !this.SelectedFormID || !this.ComponentsEntityID) return;\n // Defer to the next macrotask so the React form-preview component\n // (which remounts on every form switch and fires its own RunView\n // calls during ngAfterViewInit) finishes rendering before our\n // query lands on the shared provider. Without this, our params\n // race the React component's render wave and the provider's\n // PreRunView pipeline trips over the concurrent failing calls.\n await new Promise<void>(resolve => setTimeout(resolve, 0));\n const targetFormID = this.SelectedFormID;\n const filter = this.buildLinkedConvoFilter(provider, user.ID, targetFormID);\n // Pull all lineage conversations (not just the most recent) so the\n // chat header's \"N conversations\" dropdown has the full list.\n // MaxRows: 25 β anything more than 25 chats per form/user is rare.\n const result = await this.runLinkedConvoQuery(provider, user, filter, 25);\n if (!result) return;\n // Race guard β if the user switched forms again mid-query, drop\n // this stale result rather than clobbering the newer load.\n if (targetFormID !== this.SelectedFormID) return;\n if (result.Success && result.Results && result.Results.length > 0) {\n // Build the lineage summary list for the header dropdown.\n this.LineageConversations = result.Results.map(c => ({\n ID: c.ID,\n Name: c.Name,\n UpdatedAt: c.__mj_UpdatedAt ? new Date(c.__mj_UpdatedAt) : null,\n }));\n // Bind the most-recent (first) to the chat area.\n const found = result.Results[0];\n this.ChatConversation = found;\n this.ChatConversationId = found.ID;\n this.ChatIsNewConversation = false;\n }\n this.cdr.markForCheck();\n }\n\n public ToggleConversationHistoryDropdown(): void {\n this.ConversationHistoryDropdownOpen = !this.ConversationHistoryDropdownOpen;\n this.cdr.markForCheck();\n }\n\n /**\n * Switch the embedded chat to a different conversation in the same\n * lineage. Used by the header's \"N conversations\" dropdown.\n */\n public async PickLineageConversation(c: { ID: string; Name: string | null }): Promise<void> {\n this.ConversationHistoryDropdownOpen = false;\n if (UUIDsEqual(c.ID, this.ChatConversationId)) {\n this.cdr.markForCheck();\n return;\n }\n const provider = this.provider;\n const user = this.currentUser;\n if (!provider || !user) return;\n try {\n const entity = await provider.GetEntityObject<MJConversationEntity>(\n 'MJ: Conversations', user);\n const loaded = await entity.Load(c.ID);\n if (!loaded) {\n this.notifications.CreateSimpleNotification(\n `Could not load conversation ${c.ID}.`, 'error', 4000);\n return;\n }\n this.ChatConversation = entity;\n this.ChatConversationId = entity.ID;\n this.ChatIsNewConversation = false;\n this.ChatThreadId = null;\n this.cdr.markForCheck();\n } catch (err) {\n LogError(`PickLineageConversation: ${err instanceof Error ? err.message : String(err)}`);\n }\n }\n\n /**\n * Build the ExtraFilter for the lineage-aware conversation lookup.\n * Falls back to single-version filtering when the lineage signals\n * (SelectedFormName, TargetEntityNameβID, or the schema/view metadata\n * for Components/Overrides) aren't available β degrades to the\n * original behavior rather than breaking the chat.\n */\n private buildLinkedConvoFilter(provider: IMetadataProvider, userID: string, targetFormID: string): string {\n const singleVersion = `LinkedEntityID='${this.ComponentsEntityID}' AND UserID='${userID}' AND LinkedRecordID='${targetFormID}'`;\n if (!this.SelectedFormName || !this.TargetEntityName) return singleVersion;\n const entityInfo = provider.EntityByName(this.TargetEntityName);\n if (!entityInfo?.ID) return singleVersion;\n const componentsEntity = provider.EntityByName('MJ: Components');\n const overridesEntity = provider.EntityByName('MJ: Entity Form Overrides');\n if (!componentsEntity?.SchemaName || !componentsEntity?.BaseView\n || !overridesEntity?.SchemaName || !overridesEntity?.BaseView) {\n return singleVersion;\n }\n const escapedName = this.SelectedFormName.replace(/'/g, \"''\");\n // Inline subquery against the MJ views β Component.Name + Override.EntityID\n // collapses to the same lineage that the version rail uses, but we don't\n // need to fetch and round-trip the IDs first. ExtraFilter is appended into\n // the resolver's SQL, so subqueries against vwComponents / vwEntityFormOverrides\n // are valid here (same escape hatch loadVersionsForActiveForm uses).\n // Schema + view names resolved dynamically from EntityInfo so we don't\n // hardcode `__mj` β survives schema renames in custom MJ deployments.\n const cRef = `[${componentsEntity.SchemaName}].[${componentsEntity.BaseView}]`;\n const oRef = `[${overridesEntity.SchemaName}].[${overridesEntity.BaseView}]`;\n return `LinkedEntityID='${this.ComponentsEntityID}' AND UserID='${userID}' AND LinkedRecordID IN (\n SELECT c.ID FROM ${cRef} c\n INNER JOIN ${oRef} o ON o.ComponentID = c.ID\n WHERE c.Name = '${escapedName}' AND o.EntityID = '${entityInfo.ID}'\n )`;\n }\n\n /**\n * One-shot retry wrapper around the conversation lookup. The shared\n * GraphQLDataProvider occasionally throws \"Entity null not found in\n * metadata\" when the React form-preview's own RunView wave is in\n * flight concurrently β the failure is transient. Retrying once after\n * a short delay clears it.\n */\n private async runLinkedConvoQuery(\n provider: IMetadataProvider,\n user: UserInfo,\n filter: string,\n maxRows: number = 1,\n ): Promise<{ Success: boolean; Results?: MJConversationEntity[]; ErrorMessage?: string } | null> {\n const params = {\n EntityName: 'MJ: Conversations',\n ExtraFilter: filter,\n OrderBy: '__mj_UpdatedAt DESC',\n MaxRows: maxRows,\n ResultType: 'entity_object' as const,\n };\n const rv = RunView.FromMetadataProvider(provider);\n try {\n return await rv.RunView<MJConversationEntity>(params, user);\n } catch {\n // Wait long enough for any concurrent React render wave to settle.\n await new Promise<void>(resolve => setTimeout(resolve, 150));\n try {\n const rv2 = RunView.FromMetadataProvider(provider);\n return await rv2.RunView<MJConversationEntity>(params, user);\n } catch (err2) {\n LogError(`FormBuilderResource.loadLinkedConversationForActiveForm: ${err2 instanceof Error ? err2.message : String(err2)}`);\n return null;\n }\n }\n }\n\n /** Reset embedded chat to the pre-conversation state for a new form. */\n private resetChatToFresh(): void {\n this.ChatConversation = null;\n this.ChatConversationId = null;\n this.ChatIsNewConversation = true;\n this.ChatThreadId = null;\n this.ChatPendingMessage = null;\n this.ChatPendingAttachments = null;\n }\n\n /**\n * Recompute the version-rail rows from `InteractiveFormsEngine`'s\n * caches β all Component rows in the active form's Name lineage, joined\n * against the current user's override rows to tag Active / Pending.\n * No DB round-trip. Auto-refreshed by the engine subscription in\n * {@link ngAfterViewInit} on any save/delete/remote-invalidate.\n *\n * Kept `async` for callers that already `await` it; the body is sync.\n */\n public async loadVersionsForActiveForm(): Promise<void> {\n if (!this.SelectedFormName) {\n this.Versions = [];\n this.ActiveVersionID = null;\n this.cdr.markForCheck();\n return;\n }\n const engine = InteractiveFormsEngine.Instance;\n const user = this.currentUser;\n if (!engine.Loaded || !user) {\n this.Versions = [];\n this.cdr.markForCheck();\n return;\n }\n this.VersionsLoading = true;\n this.cdr.markForCheck();\n try {\n // Lineage rows from the engine β already sorted VersionSequence\n // DESC by GetLineageByName. Project to the helper's expected\n // simple-row shape so the existing join logic stays unchanged.\n const lineage = engine.GetLineageByName(this.SelectedFormName).map(c => ({\n ID: c.ID,\n Name: c.Name,\n Version: c.Version,\n VersionSequence: c.VersionSequence,\n Status: c.Status ?? '',\n __mj_UpdatedAt: c.__mj_UpdatedAt instanceof Date\n ? c.__mj_UpdatedAt.toISOString()\n : (c.__mj_UpdatedAt ?? null),\n }));\n // User-scoped overrides keyed by ComponentID. Filter to the\n // lineage's ComponentIDs so the helper sees only relevant rows.\n const lineageIDs = new Set(lineage.map(r => NormalizeUUID(r.ID)));\n const overrides = engine.GetUserOverrides(user.ID)\n .filter(o => o.ComponentID && lineageIDs.has(NormalizeUUID(o.ComponentID)))\n .map(o => ({ ComponentID: o.ComponentID, Status: o.Status }));\n this.Versions = joinVersionsWithOverrides(lineage, overrides);\n this.ActiveVersionID = pickActiveVersionID(this.Versions) ?? this.SelectedFormID;\n } finally {\n this.VersionsLoading = false;\n this.cdr.markForCheck();\n }\n }\n\n /**\n * Open the chat overlay with the active-form context already set. The\n * overlay is mounted at the app root; we don't construct it here. The\n * agent context is kept fresh by `registerAgentContext()` (called on\n * every form change).\n *\n * Side effect: also un-collapses the chat pane so the user sees the\n * surface they just clicked.\n */\n public OnOpenInChat(): void {\n // Make sure the agent context reflects the *current* form state\n // before we open the chat. registerAgentContext() reads SelectedForm*\n // and pushes through NavigationService so the next user message in\n // chat carries ActiveForm.\n this.registerAgentContext();\n this.ChatPaneCollapsed = false;\n // Pop the floating chat overlay. The bridge is the decoupled\n // request channel β see ConversationBridgeService.RequestExpandOverlay.\n this.conversationBridge.RequestExpandOverlay();\n this.cdr.markForCheck();\n }\n\n /**\n * Re-point this form's Active override at the picked version. Called\n * from the version rail \"Make Active\" button. Delegates to the\n * `Activate Interactive Form Version` action when the version is Pending,\n * otherwise delegates to `Revert Interactive Form` (re-point Active\n * override to an older Component row in the same Name lineage).\n */\n public async OnActivateVersion(version: ComponentVersionRow): Promise<void> {\n // The action layer is the source of truth for the swap semantics;\n // here we just translate the click into the right server call and\n // reload. We intentionally don't try to mimic the action's logic on\n // the client β keeps the lifecycle in one place.\n const provider = this.provider;\n if (!provider || !this.currentUser) return;\n if (version.IsActive) return; // already active, no-op\n\n // We don't have a direct action-invoke utility in the resource\n // component, so we use the lighter-weight path: locate the override\n // currently pointing at this version, OR (for Revert) the user's\n // currently-Active override + this version's ComponentID.\n try {\n const rv = RunView.FromMetadataProvider(provider);\n if (version.IsPending) {\n // Activate path: find the Pending override pointing at this version.\n const pending = await rv.RunView<{ ID: string }>({\n EntityName: 'MJ: Entity Form Overrides',\n ExtraFilter: `UserID='${this.currentUser.ID}' AND ComponentID='${version.ID}' AND Status='Pending'`,\n Fields: ['ID'],\n MaxRows: 1,\n ResultType: 'simple',\n }, this.currentUser);\n const overrideID = pending.Results?.[0]?.ID;\n if (!overrideID) {\n this.notifications.CreateSimpleNotification(\n `Could not find a Pending override for ${version.Version}.`, 'warning', 3500);\n return;\n }\n await this.overrideService.activateVersion(overrideID, this.currentUser ?? undefined, provider);\n } else {\n // Revert path: find the user's Active override for the same lineage.\n const active = await rv.RunView<{ ID: string }>({\n EntityName: 'MJ: Entity Form Overrides',\n ExtraFilter: `UserID='${this.currentUser.ID}' AND ComponentID IN (${this.Versions.map(v => `'${v.ID}'`).join(',')}) AND Status='Active'`,\n Fields: ['ID'],\n MaxRows: 1,\n ResultType: 'simple',\n }, this.currentUser);\n const overrideID = active.Results?.[0]?.ID;\n if (!overrideID) {\n this.notifications.CreateSimpleNotification(\n `Could not find an Active override to revert.`, 'warning', 3500);\n return;\n }\n await this.overrideService.revertToComponent(overrideID, version.ID, this.currentUser ?? undefined, provider);\n }\n await this.loadVersionsForActiveForm();\n this.notifications.CreateSimpleNotification(\n `Version ${version.Version} is now Active.`, 'info', 3000);\n } catch (err) {\n LogError(`FormBuilderResource.OnActivateVersion: ${err instanceof Error ? err.message : String(err)}`);\n this.notifications.CreateSimpleNotification(\n `Failed to switch version: ${err instanceof Error ? err.message : String(err)}`,\n 'error', 4500);\n }\n }\n\n /**\n * Version-rail row click. Loads that version's Component into the\n * cockpit's editor (Preview / Code / Layout) β does NOT change which\n * version the runtime resolver picks for users (that's still driven\n * by the Active override). To promote an older version to Active,\n * the user clicks the row's \"Activate\" / \"Restore\" button.\n *\n * No-op when the row is already loaded. Builds a synthetic summary\n * and delegates to {@link OnFormPicked} so the load path is exactly\n * the same as picking from the left rail (handles dirty-discard\n * confirmation, schema rebuild, version rail refresh, agent context\n * push, etc.).\n */\n public async OnVersionRowClick(v: ComponentVersionRow): Promise<void> {\n if (UUIDsEqual(v.ID, this.SelectedFormID)) return;\n const summary: FormComponentSummary = {\n ID: v.ID,\n Name: v.Name,\n Namespace: null,\n Status: v.Status,\n OverrideStatus: null, // OnFormPicked recomputes from the override row anyway\n Description: null,\n TargetEntityName: null,\n };\n await this.OnFormPicked(summary);\n }\n\n /**\n * Begin a diff selection from the version rail. The clicked version\n * becomes the \"source\"; the next clicked version becomes the \"target\"\n * and we render a side-by-side diff modal.\n *\n * Click the same version twice β cancels the selection.\n */\n public async OnVersionDiffClick(v: ComponentVersionRow, event: Event): Promise<void> {\n event.stopPropagation();\n if (!this.DiffSourceVersionID) {\n this.DiffSourceVersionID = v.ID;\n this.notifications.CreateSimpleNotification(\n `Diff: now pick a second version to compare with v${v.Version}.`, 'info', 5000);\n this.cdr.markForCheck();\n return;\n }\n if (UUIDsEqual(this.DiffSourceVersionID, v.ID)) {\n // Same version clicked again β cancel selection.\n this.DiffSourceVersionID = null;\n this.cdr.markForCheck();\n return;\n }\n // Second selection β load both specs and open the modal.\n const targetID = v.ID;\n const sourceID = this.DiffSourceVersionID;\n try {\n const provider = this.provider;\n const user = this.currentUser;\n if (!provider || !user) return;\n const [src, tgt] = await Promise.all([\n provider.GetEntityObject<MJComponentEntity>('MJ: Components', user).then(async e => { await e.Load(sourceID); return e; }),\n provider.GetEntityObject<MJComponentEntity>('MJ: Components', user).then(async e => { await e.Load(targetID); return e; }),\n ]);\n const srcSpec = this.parseSpec(src.Specification);\n const tgtSpec = this.parseSpec(tgt.Specification);\n this.DiffSourceCode = srcSpec?.code ?? src.Specification ?? '';\n this.DiffTargetCode = tgtSpec?.code ?? tgt.Specification ?? '';\n this.DiffSourceVersionID = sourceID;\n this.DiffTargetVersionID = targetID;\n this.ShowDiffDialog = true;\n this.cdr.markForCheck();\n } catch (err) {\n LogError(`OnVersionDiffClick: ${err instanceof Error ? err.message : String(err)}`);\n this.notifications.CreateSimpleNotification('Failed to load diff.', 'error', 4000);\n }\n }\n\n public CloseDiffDialog(): void {\n this.ShowDiffDialog = false;\n this.DiffSourceVersionID = null;\n this.DiffTargetVersionID = null;\n this.DiffSourceCode = '';\n this.DiffTargetCode = '';\n this.cdr.markForCheck();\n }\n\n /** Helper: lookup the version row for a given ID, used in the diff title. */\n public versionByID(id: string | null): ComponentVersionRow | null {\n if (!id) return null;\n return this.Versions.find(v => UUIDsEqual(v.ID, id)) ?? null;\n }\n\n public async OnFormPicked(form: FormComponentSummary): Promise<void> {\n if (this.DirtyFlag && !this.confirmDiscard()) return;\n try {\n const provider = this.provider;\n if (!provider) return;\n const componentEntity = await provider.GetEntityObject<MJComponentEntity>(\n 'MJ: Components',\n this.currentUser ?? undefined,\n );\n const loaded = await componentEntity.Load(form.ID);\n if (!loaded) {\n this.notifications.CreateSimpleNotification(\n `Couldn't load form ${form.Name}.`, 'error', 4000);\n return;\n }\n const spec = this.parseSpec(componentEntity.Specification);\n const code = spec?.code ?? '';\n // Canonical entity binding lives on the EntityFormOverride row,\n // not in the generated code (which destructures entityName as a\n // host prop, never as a string literal). Look up an active override\n // for this Component to find the entity. Fall back to the regex\n // inference for legacy/hand-authored forms that don't have an\n // override yet.\n const entityName = await this.lookupEntityForComponent(form.ID)\n ?? this.inferTargetEntityFromCode(code);\n this.SelectedFormID = form.ID;\n this.SelectedFormName = form.Name;\n this.IsNewForm = false;\n this.EditableCode = code;\n // Retrospective fix #5: keep the full loaded spec around so\n // PreviewSpec can merge live code edits over the saved metadata.\n this.SavedSpec = spec;\n this.TargetEntityName = entityName;\n this.Schema = entityName\n ? buildCuratedFormSchema(entityName, provider)\n : null;\n this.hydrateCanvasFromCode();\n this.DirtyFlag = false;\n this.cdr.markForCheck();\n this.registerAgentContext();\n // Auto-load the most recent conversation linked to this form\n // (LinkedEntityID=MJ:Components, LinkedRecordID=form.ID). If\n // none exists, reset to a fresh pre-conversation state so the\n // mode picker + input render via the suppressed empty-state.\n await this.loadLinkedConversationForActiveForm();\n // Populate the version rail (fire-and-forget β the rail shows\n // a loading spinner until this resolves).\n this.loadVersionsForActiveForm();\n // Reset preview state β record will lazy-load on next switch\n // to the Preview tab against the (new) target entity.\n this.PreviewRecord = null;\n this.PreviewRecordIsReal = false;\n this.PreviewRecordLabel = '';\n this.PreviewError = null;\n // If the user is already on the Preview tab, kick off loading now.\n if (this.CenterPaneMode === 'preview' && this.TargetEntityName) {\n void this.loadPreviewRecord();\n }\n } catch (err) {\n LogError(`FormBuilderResource.OnFormPicked: ${err instanceof Error ? err.message : String(err)}`);\n }\n }\n\n /**\n * Look up an EntityFormOverride that points at this Component and return\n * the bound entity's name. Used by `OnFormPicked` to recover the target\n * entity for forms that have been activated against a real entity.\n */\n /**\n * Override metadata for the active form β captured at form-load time so\n * the agent context can carry it inline (no `Get Active Form For Entity`\n * round-trip needed). The Form Builder agent prompt's lifecycle rules\n * branch on whether an active override exists and what its scope/status\n * is; passing this snapshot upfront lets the agent jump straight to\n * `Modify Interactive Form` instead of guessing.\n */\n public ActiveOverrideID: string | null = null;\n public ActiveOverrideScope: string | null = null;\n public ActiveOverrideStatus: string | null = null;\n\n /** Whether the cockpit's override-status popover is open. */\n public OverrideStatusPickerOpen = false;\n /** Inline saving flag β disables the picker buttons mid-save. */\n public OverrideStatusSaving = false;\n\n /**\n * Allowed values for `EntityFormOverride.Status` mirrored from the\n * DB CHECK constraint / EntityFieldValue rows. Hardcoded for two\n * reasons: (a) they're stable schema enums, and (b) the picker UI\n * needs them statically to render labels + icons without round-trip.\n */\n public readonly OverrideStatusOptions: ReadonlyArray<{\n value: 'Active' | 'Inactive' | 'Pending';\n label: string;\n description: string;\n icon: string;\n }> = [\n { value: 'Active', label: 'Active', icon: 'fa-solid fa-circle-check', description: 'Eligible for resolution β users see this form.' },\n { value: 'Inactive', label: 'Inactive', icon: 'fa-solid fa-circle-pause', description: 'Ignored by the resolver β users fall back to the next match.' },\n { value: 'Pending', label: 'Pending', icon: 'fa-solid fa-hourglass-half', description: 'AI-authored, awaiting human activation. Resolver treats as Inactive.' },\n ];\n\n /** Toggle the override status popover. No-op when no override is loaded. */\n public ToggleOverrideStatusPicker(): void {\n if (!this.ActiveOverrideID) return;\n this.OverrideStatusPickerOpen = !this.OverrideStatusPickerOpen;\n this.cdr.markForCheck();\n }\n\n /**\n * Persist a new status on the currently-loaded EntityFormOverride.\n * Loads the entity, sets the status, saves, then mirrors the new\n * value onto the cockpit's local snapshot fields so the agent\n * context + UI stay in sync. The BaseEntity event subscription\n * above will also fire as a side effect, but our local guard\n * (`ActiveOverrideStatus` already up to date) keeps the cockpit\n * from triggering a spurious refresh.\n */\n public async OnOverrideStatusPicked(next: 'Active' | 'Inactive' | 'Pending'): Promise<void> {\n if (!this.ActiveOverrideID || this.ActiveOverrideStatus === next) {\n this.OverrideStatusPickerOpen = false;\n this.cdr.markForCheck();\n return;\n }\n const provider = this.provider;\n const user = this.currentUser;\n if (!provider || !user) {\n this.notifications.CreateSimpleNotification(\n 'No provider or user β cannot update status.', 'error', 4000);\n return;\n }\n this.OverrideStatusSaving = true;\n this.cdr.markForCheck();\n try {\n const override = await provider.GetEntityObject<MJEntityFormOverrideEntity>(\n 'MJ: Entity Form Overrides', user);\n const loaded = await override.Load(this.ActiveOverrideID);\n if (!loaded) {\n this.notifications.CreateSimpleNotification(\n 'Could not load override row.', 'error', 4000);\n return;\n }\n override.Status = next;\n const saved = await override.Save();\n if (!saved) {\n this.notifications.CreateSimpleNotification(\n override.LatestResult?.CompleteMessage ?? 'Save failed.',\n 'error', 5000);\n return;\n }\n this.ActiveOverrideStatus = next;\n this.OverrideStatusPickerOpen = false;\n this.registerAgentContext(); // push updated status into agent context\n this.notifications.CreateSimpleNotification(\n `Override is now ${next}.`, 'success', 3000);\n } catch (err) {\n LogError(`FormBuilderResource.OnOverrideStatusPicked: ${err instanceof Error ? err.message : String(err)}`);\n this.notifications.CreateSimpleNotification(\n `Failed to update status: ${err instanceof Error ? err.message : String(err)}`,\n 'error', 5000);\n } finally {\n this.OverrideStatusSaving = false;\n this.cdr.markForCheck();\n }\n }\n\n private async lookupEntityForComponent(componentID: string): Promise<string | null> {\n const provider = this.provider;\n if (!provider) return null;\n const rv = RunView.FromMetadataProvider(provider);\n // Pull the override row's full identity (ID + EntityID + Scope +\n // Status) in one shot so callers also get the OverrideID snapshot\n // for the agent context. Top-1 by created-at DESC matches the prior\n // behavior β the most recently-stamped override for this Component.\n const result = await rv.RunView<{ ID: string; EntityID: string; Scope: string; Status: string }>({\n EntityName: 'MJ: Entity Form Overrides',\n Fields: ['ID', 'EntityID', 'Scope', 'Status'],\n ExtraFilter: `ComponentID='${componentID}'`,\n OrderBy: '__mj_CreatedAt DESC',\n MaxRows: 1,\n ResultType: 'simple',\n BypassCache: true,\n }, this.currentUser ?? undefined);\n const row = result.Success ? result.Results?.[0] : null;\n if (!row) {\n this.ActiveOverrideID = null;\n this.ActiveOverrideScope = null;\n this.ActiveOverrideStatus = null;\n return null;\n }\n this.ActiveOverrideID = row.ID ?? null;\n this.ActiveOverrideScope = row.Scope ?? null;\n this.ActiveOverrideStatus = row.Status ?? null;\n const entityInfo = provider.Entities?.find(e => UUIDsEqual(e.ID, row.EntityID));\n return entityInfo?.Name ?? null;\n }\n\n public OnNewForm(): void {\n if (this.DirtyFlag && !this.confirmDiscard()) return;\n this.SelectedFormID = null;\n // Empty default β the user fills the toolbar name input, OR picking\n // an entity auto-fills it with the entity's identifier. Either path\n // produces a valid function name for the emitted code.\n this.SelectedFormName = '';\n this.IsNewForm = true;\n this.EditableCode = '';\n this.TargetEntityName = null;\n this.Schema = null;\n this.Canvas = null;\n this.SelectedElementId = null;\n this.SelectedSectionId = null;\n this.DirtyFlag = false;\n // Retrospective #2 follow-up: clear leftover saved-spec / version /\n // preview state so the new form doesn't inherit the prior load's\n // metadata in PreviewSpec.\n this.SavedSpec = null;\n this.Versions = [];\n this.ActiveVersionID = null;\n this.PreviewRecord = null;\n this.PreviewRecordIsReal = false;\n this.PreviewRecordLabel = '';\n this.PreviewError = null;\n this.CanvasDiverged = false;\n // Clear chat so the new form doesn't inherit the previously-loaded\n // form's conversation. The chat surface is disabled until the form\n // is saved (template gates on SelectedFormID) β we don't want the\n // user typing into a chat that's bound to the wrong subject.\n this.resetChatToFresh();\n this.cdr.markForCheck();\n this.registerAgentContext();\n }\n\n private confirmDiscard(): boolean {\n return window.confirm('You have unsaved changes. Discard them?');\n }\n\n /**\n * Best-effort parse of the `Specification` JSON column on MJ: Components.\n * Returns `null` if the column is empty or malformed β callers should\n * fall back to empty-code initialization in that case.\n */\n private parseSpec(specJson: string | null): ComponentSpec | null {\n if (!specJson) return null;\n try {\n return JSON.parse(specJson) as ComponentSpec;\n } catch (err) {\n LogError(`FormBuilderResource.parseSpec: ${err instanceof Error ? err.message : String(err)}`);\n return null;\n }\n }\n\n /**\n * Best-effort attempt to extract the target entity from a form\n * Component's stored code. Form components conventionally reference\n * `host.entityName` or `entityName=\"β¦\"`. If we can't infer it, the user\n * needs to re-pick from the entity dropdown.\n */\n private inferTargetEntityFromCode(code: string): string | null {\n if (!code) return null;\n const m = code.match(/entityName\\s*[:=]\\s*['\"]([^'\"]+)['\"]/);\n return m ? m[1] : null;\n }\n\n public OnFormNameInput(event: Event): void {\n this.SelectedFormName = (event.target as HTMLInputElement).value;\n this.markDirty();\n // Regenerate code so the emitted `function <Name>(...)` keeps in sync\n // with the name. Spec.name is set from this at save time.\n this.regenerateCode();\n this.cdr.markForCheck();\n }\n\n public ToggleEntityPicker(): void {\n this.IsEntityPickerOpen = !this.IsEntityPickerOpen;\n if (this.IsEntityPickerOpen) this.refreshEntityChoices();\n this.cdr.markForCheck();\n }\n\n public OnEntityPickerSearch(event: Event): void {\n this.EntityPickerSearch = (event.target as HTMLInputElement).value;\n this.cdr.markForCheck();\n }\n\n public get filteredEntityChoices(): ReadonlyArray<{ Name: string; DisplayName: string }> {\n const q = this.EntityPickerSearch.trim().toLowerCase();\n if (!q) return this.EntityChoices;\n return this.EntityChoices.filter(e =>\n e.Name.toLowerCase().includes(q) ||\n e.DisplayName.toLowerCase().includes(q));\n }\n\n public OnEntityPicked(entityName: string): void {\n const provider = this.provider;\n const schema = buildCuratedFormSchema(entityName, provider);\n if (!schema) {\n this.notifications.CreateSimpleNotification(\n `Couldn't load schema for ${entityName}.`, 'error', 4000);\n return;\n }\n this.IsEntityPickerOpen = false;\n this.TargetEntityName = entityName;\n this.Schema = schema;\n // For brand-new forms still without an explicit name, auto-fill an\n // identifier-friendly default based on the entity. The runtime\n // compiler requires the function name in the emitted code to match\n // `spec.name` exactly, so we drive both from the same source.\n if (this.IsNewForm && !this.SelectedFormName?.trim()) {\n this.SelectedFormName = toComponentIdentifier(schema.displayName);\n }\n const existing = this.EditableCode ?? '';\n if (existing.length > 0) {\n const result = parseCanvasFromCode(existing, schema);\n this.Canvas = result.canvas ?? buildEmptyCanvas(entityName, schema.displayName);\n } else if (this.IsNewForm) {\n // Retrospective fix #4: new-form flow seeds the canvas + code\n // from the CodeGen-equivalent scaffold. Previously the user got\n // an empty canvas β worse UX than the agent path. Now both paths\n // start from the same baseline.\n const scaffold = buildDefaultFormScaffold(entityName, provider);\n if (scaffold?.code) {\n this.EditableCode = scaffold.code;\n const result = parseCanvasFromCode(scaffold.code, schema);\n this.Canvas = result.canvas ?? buildEmptyCanvas(entityName, schema.displayName);\n } else {\n this.Canvas = buildEmptyCanvas(entityName, schema.displayName);\n }\n } else {\n this.Canvas = buildEmptyCanvas(entityName, schema.displayName);\n }\n this.SelectedElementId = null;\n this.SelectedSectionId = this.Canvas?.sections[0]?.id ?? null;\n this.regenerateCode();\n this.markDirty();\n // Re-publish AppContextSnapshot: TargetEntityName + Schema just\n // populated, so the agent context that was null during OnNewForm\n // needs to refresh. Otherwise a chat sent before the user clicks\n // Save races with the stale-context publish (ActiveForm=null).\n this.registerAgentContext();\n this.cdr.markForCheck();\n }\n\n private refreshEntityChoices(): void {\n const provider = this.provider;\n if (!provider) {\n this.EntityChoices = [];\n return;\n }\n this.EntityChoices = (provider.Entities ?? [])\n .filter(e => e.AllowCreateAPI || e.AllowUpdateAPI)\n .map(e => ({ Name: e.Name, DisplayName: e.DisplayName ?? e.Name }))\n .sort((a, b) => a.DisplayName.localeCompare(b.DisplayName));\n }\n\n public OnCanvasChanged(next: FormCanvasModel): void {\n this.Canvas = next;\n this.markDirty();\n this.regenerateCode();\n this.cdr.markForCheck();\n }\n\n public OnElementSelected(payload: { sectionId: string; elementId: string }): void {\n this.SelectedSectionId = null;\n this.SelectedElementId = payload.elementId;\n this.cdr.markForCheck();\n }\n\n public OnSectionSelected(sectionId: string): void {\n this.SelectedElementId = null;\n this.SelectedSectionId = sectionId;\n this.cdr.markForCheck();\n }\n\n public OnDeselected(): void {\n this.SelectedElementId = null;\n this.SelectedSectionId = null;\n this.cdr.markForCheck();\n }\n\n public OnElementChanged(next: FormCanvasElement): void {\n if (!this.Canvas) return;\n const updated: FormCanvasModel = {\n ...this.Canvas,\n sections: this.Canvas.sections.map(s => ({\n ...s,\n elements: s.elements.map(e => e.id === next.id ? next : e),\n })),\n };\n this.OnCanvasChanged(updated);\n }\n\n public OnSectionChanged(next: FormCanvasSection): void {\n if (!this.Canvas) return;\n const updated: FormCanvasModel = {\n ...this.Canvas,\n sections: this.Canvas.sections.map(s => s.id === next.id ? next : s),\n };\n this.OnCanvasChanged(updated);\n }\n\n public OnElementDeleted(elementId: string): void {\n if (!this.Canvas) return;\n const updated: FormCanvasModel = {\n ...this.Canvas,\n sections: this.Canvas.sections.map(s => ({\n ...s,\n elements: s.elements.filter(e => e.id !== elementId),\n })),\n };\n this.SelectedElementId = null;\n this.OnCanvasChanged(updated);\n }\n\n public OnSectionDeleted(sectionId: string): void {\n if (!this.Canvas) return;\n const updated: FormCanvasModel = {\n ...this.Canvas,\n sections: this.Canvas.sections.filter(s => s.id !== sectionId),\n };\n this.SelectedSectionId = null;\n this.OnCanvasChanged(updated);\n }\n\n public OnFieldAddedFromPalette(payload: { fieldName: string }): void {\n if (!this.Canvas) return;\n const target = this.focusedSection();\n if (!target) return;\n const updated: FormCanvasModel = {\n ...this.Canvas,\n sections: this.Canvas.sections.map(s => s.id === target.id\n ? {\n ...s,\n elements: [...s.elements, {\n id: generateCanvasId('field'),\n type: 'field',\n fieldName: payload.fieldName,\n span: 1,\n }],\n }\n : s),\n };\n this.OnCanvasChanged(updated);\n }\n\n private focusedSection(): FormCanvasSection | null {\n if (!this.Canvas) return null;\n if (this.SelectedSectionId) {\n const s = this.Canvas.sections.find(sec => sec.id === this.SelectedSectionId);\n if (s) return s;\n }\n if (this.SelectedElementId) {\n const s = this.Canvas.sections.find(sec =>\n sec.elements.some(e => e.id === this.SelectedElementId));\n if (s) return s;\n }\n return this.Canvas.sections[0] ?? null;\n }\n\n private regenerateCode(): void {\n try {\n if (!this.Canvas || !this.Schema) return;\n // Drive the function name from SelectedFormName so the emitted\n // `function <Name>(...)` matches `spec.name` at save time. Falls\n // back to the entity displayName for safety.\n const name = this.SelectedFormName?.trim() || this.Schema.displayName;\n const code = generateCodeFromCanvas(this.Canvas, this.Schema, name);\n this.EditableCode = code;\n } catch (err) {\n LogError(`FormBuilderResource.regenerateCode: ${err instanceof Error ? err.message : String(err)}`);\n }\n }\n\n private hydrateCanvasFromCode(): void {\n if (!this.TargetEntityName || !this.Schema || !this.EditableCode) {\n this.Canvas = null;\n this.CanvasDiverged = false;\n return;\n }\n const result = parseCanvasFromCode(this.EditableCode, this.Schema);\n this.Canvas = result.canvas\n ?? buildEmptyCanvas(this.TargetEntityName, this.Schema.displayName);\n // Retrospective fix #6: parseCanvasFromCode signals \"code has stuff\n // the canvas can't represent\" via `hasUnknownConstructs` (true when\n // the parser found JSX it couldn't round-trip) and `canvas: null`\n // (parse failed outright). Either is a divergence signal β surface\n // it via the Layout-tab banner so users know saving will overwrite.\n this.CanvasDiverged = !!result.hasUnknownConstructs || !result.canvas;\n this.SelectedElementId = null;\n this.SelectedSectionId = this.Canvas?.sections[0]?.id ?? null;\n }\n\n public async OnSave(): Promise<void> {\n if (!this.TargetEntityName) {\n this.notifications.CreateSimpleNotification(\n 'Pick a target entity before saving.', 'warning', 4000);\n return;\n }\n if (!this.Canvas) {\n this.notifications.CreateSimpleNotification(\n 'Nothing to save.', 'warning', 3000);\n return;\n }\n this.regenerateCode();\n\n const provider = this.provider;\n const user = this.currentUser;\n if (!provider || !user) {\n this.notifications.CreateSimpleNotification(\n 'No metadata provider or current user β cannot save.', 'error', 4000);\n return;\n }\n\n try {\n const componentEntity = await provider.GetEntityObject<MJComponentEntity>(\n 'MJ: Components', user);\n let existingSpec: ComponentSpec | null = null;\n if (this.SelectedFormID) {\n const loaded = await componentEntity.Load(this.SelectedFormID);\n if (!loaded) {\n this.notifications.CreateSimpleNotification(\n `Couldn't load existing form ${this.SelectedFormName}.`, 'error', 4000);\n return;\n }\n existingSpec = this.parseSpec(componentEntity.Specification);\n } else {\n componentEntity.NewRecord();\n // Force the persisted Name to a valid JS identifier β the\n // runtime compiler requires `spec.name` to match the emitted\n // `function <Name>(...)`. Free-form names with spaces or\n // punctuation would mismatch and fail compilation.\n const safeName = toComponentIdentifier(\n this.SelectedFormName?.trim() || `Form for ${this.TargetEntityName}`);\n componentEntity.Name = safeName;\n this.SelectedFormName = safeName;\n componentEntity.Type = 'Form';\n componentEntity.Status = 'Draft';\n // Version is required on MJ: Components. Use semver 1.0.0 for\n // the initial cut; subsequent saves bump VersionSequence via\n // CodeGen-managed flows. (We don't bump here β the Studio is\n // editing in place, not publishing.)\n componentEntity.Version = '1.0.0';\n componentEntity.VersionSequence = 1;\n // Regenerate code with the now-canonical name so the function\n // identifier in the emitted code matches `spec.name` exactly.\n this.regenerateCode();\n }\n // Build the persisted spec. CRITICAL: enforce the form-role\n // contract β `componentRole: 'form'` + `location: 'embedded'`\n // β even when the inherited `existingSpec` is missing them\n // (brand-new forms have `existingSpec === null`). Without this\n // the saved Component fails `isFormRole()` at live-render time\n // with \"Component X does not declare componentRole='form'\".\n // PreviewSpec applies the same defaults; OnSave was the only\n // path that diverged, producing valid-in-preview / invalid-in-\n // runtime forms.\n const specToSave: ComponentSpec = {\n ...(existingSpec ?? {}),\n name: componentEntity.Name,\n code: this.EditableCode,\n componentRole: 'form',\n location: existingSpec?.location ?? 'embedded',\n title: componentEntity.Title ?? this.SelectedFormName ?? componentEntity.Name,\n } as ComponentSpec;\n componentEntity.Specification = JSON.stringify(specToSave, null, 2);\n\n const saved = await componentEntity.Save();\n if (!saved) {\n this.notifications.CreateSimpleNotification(\n componentEntity.LatestResult?.CompleteMessage\n ?? 'Save returned false with no diagnostic.',\n 'error', 6000);\n return;\n }\n\n this.SelectedFormID = componentEntity.ID;\n this.DirtyFlag = false;\n // Cache the just-saved spec so PreviewSpec and registerAgentContext\n // see the persisted shape on the next read β instead of relying\n // on whatever was last loaded (or null for a brand-new form).\n this.SavedSpec = specToSave;\n await this.loadExistingForms();\n this.notifications.CreateSimpleNotification(\n `Saved ${componentEntity.Name}.`, 'success', 3000);\n\n this.PendingOverrideComponentID = componentEntity.ID;\n this.PendingOverrideComponentName = componentEntity.Name;\n this.PendingOverrideEntityName = this.TargetEntityName;\n // Pre-fill from the cockpit state so the user doesn't re-type\n // the form name they just typed into the dashboard. Description\n // comes from the saved spec; Notes default empty for the post-\n // save flow (the user fills them in if they want).\n this.PendingOverrideInitialName = this.SelectedFormName?.trim() || componentEntity.Name;\n this.PendingOverrideInitialDescription = this.SavedSpec?.description ?? null;\n this.PendingOverrideInitialNotes = null;\n // Default Status='Pending' for the post-save flow β matches the\n // Create-Pending policy so the agent's first Modify can iterate\n // in-place instead of bumping a new version. User explicitly\n // promotes to Active via the dialog or the rail's Activate button.\n this.PendingOverrideInitialStatus = 'Pending';\n this.PendingOverrideInitialScope = 'User';\n this.PendingOverrideInitialRoleID = null;\n this.PendingOverrideInitialPriority = 0;\n this.FormOverrideDialogEditMode = false;\n this.EditingOverrideID = null;\n this.ShowFormOverrideDialog = true;\n // Re-publish the AppContextSnapshot now that this is a real\n // persisted form. Without this, a brand-new form's first chat\n // turn ships ActiveForm=null because the cockpit's last publish\n // happened during OnNewForm (when TargetEntityName/SelectedFormID\n // were still empty). Agent then has to discover everything via\n // tool calls β exactly the round-trip we just removed.\n this.registerAgentContext();\n this.cdr.markForCheck();\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n LogError(`FormBuilderResource.OnSave: ${message}`);\n this.notifications.CreateSimpleNotification(\n `Save failed: ${message}`, 'error', 6000);\n }\n }\n\n /**\n * Delete the currently-loaded form's Component AND any EntityFormOverride\n * rows pointing at it. Without the cascade, deleting just the Component\n * would leave orphan overrides whose resolver lookups fail silently.\n */\n public async OnDelete(): Promise<void> {\n if (!this.SelectedFormID) return;\n const formID = this.SelectedFormID;\n const formName = this.SelectedFormName || 'this form';\n if (!window.confirm(`Delete \"${formName}\" and any overrides pointing at it? This cannot be undone.`)) {\n return;\n }\n const provider = this.provider;\n const user = this.currentUser;\n if (!provider || !user) {\n this.notifications.CreateSimpleNotification(\n 'No metadata provider or current user β cannot delete.', 'error', 4000);\n return;\n }\n try {\n // Step 1 β delete overrides pointing at this Component.\n const rv = RunView.FromMetadataProvider(provider);\n const overridesResult = await rv.RunView<{ ID: string }>({\n EntityName: 'MJ: Entity Form Overrides',\n Fields: ['ID'],\n ExtraFilter: `ComponentID='${formID}'`,\n ResultType: 'simple',\n BypassCache: true,\n }, user);\n const overrideIDs = overridesResult.Success\n ? (overridesResult.Results ?? []).map(r => r.ID)\n : [];\n for (const id of overrideIDs) {\n const override = await provider.GetEntityObject<MJEntityFormOverrideEntity>(\n 'MJ: Entity Form Overrides', user);\n if (await override.Load(id)) {\n const ok = await override.Delete();\n if (!ok) {\n LogError(`FormBuilderResource.OnDelete: override ${id} delete failed: ${override.LatestResult?.CompleteMessage ?? 'unknown'}`);\n }\n }\n }\n\n // Step 2 β delete the Component itself.\n const componentEntity = await provider.GetEntityObject<MJComponentEntity>(\n 'MJ: Components', user);\n const loaded = await componentEntity.Load(formID);\n if (!loaded) {\n this.notifications.CreateSimpleNotification(\n `Form ${formName} not found β may have already been deleted.`, 'warning', 4000);\n await this.loadExistingForms();\n this.OnNewForm();\n return;\n }\n const deleted = await componentEntity.Delete();\n if (!deleted) {\n this.notifications.CreateSimpleNotification(\n componentEntity.LatestResult?.CompleteMessage ?? 'Delete returned false.',\n 'error', 6000);\n return;\n }\n this.notifications.CreateSimpleNotification(\n `Deleted ${formName}${overrideIDs.length ? ` and ${overrideIDs.length} override(s)` : ''}.`,\n 'success', 3000);\n await this.loadExistingForms();\n // Reset the canvas to an empty state.\n this.SelectedFormID = null;\n this.SelectedFormName = '';\n this.IsNewForm = false;\n this.TargetEntityName = null;\n this.Schema = null;\n this.Canvas = null;\n this.EditableCode = '';\n this.DirtyFlag = false;\n this.cdr.markForCheck();\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n LogError(`FormBuilderResource.OnDelete: ${message}`);\n this.notifications.CreateSimpleNotification(\n `Delete failed: ${message}`, 'error', 6000);\n }\n }\n\n public async OnFormOverrideDialogConfirm(result: FormOverrideDialogResult): Promise<void> {\n this.ShowFormOverrideDialog = false;\n const user = this.currentUser;\n if (!user) {\n this.notifications.CreateSimpleNotification(\n 'No current user β cannot save.', 'error', 4000);\n return;\n }\n // Two paths: edit an existing override row, or create a new one.\n if (this.FormOverrideDialogEditMode && this.EditingOverrideID) {\n const updated = await this.updateOverrideFromDialog(this.EditingOverrideID, result, user);\n if (updated) {\n this.notifications.CreateSimpleNotification(\n `Form details updated.`, 'success', 3000);\n // Refresh the rail + the active-override fields so the cockpit\n // chrome (status pill, etc.) reflects the new values.\n await this.loadExistingForms();\n if (this.SelectedFormID) {\n void this.loadVersionsForActiveForm();\n void this.refreshActiveOverrideMetadata(this.SelectedFormID);\n }\n } else {\n this.notifications.CreateSimpleNotification(\n 'Failed to update override details.', 'warning', 6000);\n }\n this.resetOverrideDialogState();\n this.cdr.markForCheck();\n return;\n }\n // Default path β create a new override for the just-saved Component.\n if (!this.PendingOverrideComponentID) {\n this.resetOverrideDialogState();\n this.cdr.markForCheck();\n return;\n }\n const writeResult = await this.overrideService.CreateOverride(\n this.PendingOverrideComponentID, result, user, this.provider);\n if (writeResult.Success) {\n this.notifications.CreateSimpleNotification(\n `Override \"${result.Name}\" created.`, 'success', 4000);\n } else {\n this.notifications.CreateSimpleNotification(\n writeResult.Error ?? 'Failed to create override.', 'warning', 6000);\n }\n this.resetOverrideDialogState();\n this.cdr.markForCheck();\n }\n\n public OnFormOverrideDialogDismiss(): void {\n this.ShowFormOverrideDialog = false;\n this.resetOverrideDialogState();\n this.cdr.markForCheck();\n }\n\n private resetOverrideDialogState(): void {\n this.PendingOverrideComponentID = null;\n this.PendingOverrideInitialName = null;\n this.PendingOverrideInitialDescription = null;\n this.PendingOverrideInitialNotes = null;\n this.PendingOverrideInitialStatus = null;\n this.PendingOverrideInitialScope = null;\n this.PendingOverrideInitialRoleID = undefined;\n this.PendingOverrideInitialPriority = undefined;\n this.FormOverrideDialogEditMode = false;\n this.EditingOverrideID = null;\n }\n\n /**\n * Open the form-override dialog in EDIT MODE β pre-fills all fields\n * from the active override row so the user can rename, retag, or\n * adjust scope/priority/status without retyping. On confirm, the\n * existing override is updated in place rather than a new one being\n * created.\n *\n * Available from the cockpit's toolbar via the \"Edit details\" pencil\n * icon next to the form name.\n */\n public async OpenEditFormDetailsDialog(): Promise<void> {\n const provider = this.provider;\n const user = this.currentUser;\n if (!provider || !user || !this.ActiveOverrideID) {\n this.notifications.CreateSimpleNotification(\n 'No active override to edit. Save the form first.', 'info', 4000);\n return;\n }\n try {\n const override = await provider.GetEntityObject<MJEntityFormOverrideEntity>(\n 'MJ: Entity Form Overrides', user);\n const loaded = await override.Load(this.ActiveOverrideID);\n if (!loaded) {\n this.notifications.CreateSimpleNotification(\n `Could not load override ${this.ActiveOverrideID} for editing.`, 'error', 4000);\n return;\n }\n this.PendingOverrideComponentID = override.ComponentID ?? this.SelectedFormID;\n this.PendingOverrideComponentName = this.SelectedFormName || override.Name || '';\n this.PendingOverrideEntityName = this.TargetEntityName ?? '';\n this.PendingOverrideInitialName = override.Name ?? this.SelectedFormName;\n this.PendingOverrideInitialDescription = override.Description ?? null;\n this.PendingOverrideInitialNotes = (override as unknown as { Notes?: string | null }).Notes ?? null;\n this.PendingOverrideInitialStatus =\n (override.Status as 'Active' | 'Inactive' | 'Pending' | null) ?? null;\n this.PendingOverrideInitialScope =\n (override.Scope as 'User' | 'Role' | 'Global' | null) ?? null;\n this.PendingOverrideInitialRoleID = override.RoleID ?? null;\n this.PendingOverrideInitialPriority = override.Priority ?? 0;\n this.FormOverrideDialogEditMode = true;\n this.EditingOverrideID = this.ActiveOverrideID;\n this.ShowFormOverrideDialog = true;\n this.cdr.markForCheck();\n } catch (err) {\n LogError(`FormBuilderResource.OpenEditFormDetailsDialog: ${err instanceof Error ? err.message : String(err)}`);\n }\n }\n\n /**\n * Update an existing EntityFormOverride row's editable fields from the\n * dialog result. Returns true on success, false on save failure.\n */\n private async updateOverrideFromDialog(\n overrideID: string,\n result: FormOverrideDialogResult,\n user: UserInfo,\n ): Promise<boolean> {\n const provider = this.provider;\n if (!provider) return false;\n try {\n const override = await provider.GetEntityObject<MJEntityFormOverrideEntity>(\n 'MJ: Entity Form Overrides', user);\n const loaded = await override.Load(overrideID);\n if (!loaded) return false;\n override.Name = result.Name;\n override.Description = result.Description;\n (override as unknown as { Notes?: string | null }).Notes = result.Notes;\n override.Scope = result.Scope;\n override.RoleID = result.Scope === 'Role' ? result.RoleID : null;\n override.UserID = result.Scope === 'User' ? user.ID : null;\n override.Priority = result.Priority;\n override.Status = result.Status;\n const saved = await override.Save();\n if (!saved) {\n LogError(`updateOverrideFromDialog: save failed: ${override.LatestResult?.CompleteMessage ?? 'unknown'}`);\n }\n return saved;\n } catch (err) {\n LogError(`updateOverrideFromDialog: ${err instanceof Error ? err.message : String(err)}`);\n return false;\n }\n }\n\n /**\n * Refresh `ActiveOverride*` fields after an edit so the cockpit chrome\n * picks up the new Status/Scope. Used by the edit-details dialog flow.\n */\n private async refreshActiveOverrideMetadata(componentID: string): Promise<void> {\n const provider = this.provider;\n const user = this.currentUser;\n if (!provider || !user) return;\n try {\n const rv = RunView.FromMetadataProvider(provider);\n const result = await rv.RunView<MJEntityFormOverrideEntity>({\n EntityName: 'MJ: Entity Form Overrides',\n ExtraFilter: `ComponentID='${componentID}'`,\n MaxRows: 1,\n ResultType: 'entity_object',\n }, user);\n if (result.Success && result.Results?.[0]) {\n const ovr = result.Results[0];\n this.ActiveOverrideID = ovr.ID;\n this.ActiveOverrideScope = ovr.Scope ?? null;\n this.ActiveOverrideStatus = (ovr.Status as 'Active' | 'Inactive' | 'Pending' | null) ?? null;\n this.cdr.markForCheck();\n }\n } catch (err) {\n LogError(`refreshActiveOverrideMetadata: ${err instanceof Error ? err.message : String(err)}`);\n }\n }\n\n /**\n * Compact list of the active entity's relationships, used to seed\n * the agent's context so it knows which related entities are\n * available to link to this form (sub-tables, lookups, etc.).\n *\n * Intentionally **summary-only** β name, relationship type, and\n * join fields. Full schemas for any related entity are still a\n * single `Get Entity Schema For Form` tool call away. Keeping this\n * list compact (~20-50 entries Γ ~80 chars = a few KB) avoids\n * token bloat while still giving the agent enough to plan without\n * asking the user \"what entity links to this?\".\n */\n /**\n * Compact catalog of **Active** Component Libraries the agent can\n * declare in `ComponentSpec.libraries`. Read from\n * `ComponentMetadataEngine` (cached at cockpit init). Same shape Skip\n * uses to inform Codesmith Agent β Form Builder forms run in the\n * exact same React runtime, so any Active library is fair game.\n *\n * Per-library payload is kept lean: Name (npm package), Category\n * (UI / Charting / Utility / Other), GlobalVariable (the runtime\n * binding the agent uses inside JSX), Description (one-liner), and\n * Version. UsageInstructions are included only when present AND\n * short (<500 chars) β longer docs would balloon the prompt.\n *\n * Result sorted by Category then Name so the agent sees related\n * libraries grouped together (all Charting options adjacent, all UI,\n * etc.).\n */\n /**\n * Pre-render the AvailableLibraries catalog as markdown for the agent\n * prompt. Token-efficient vs the previous JSON-array shape: nested\n * heading structure that LLMs parse natively, ~40-50% fewer tokens on\n * a typical 25-30 library catalog, and easier to skim in agent-run\n * logs. Grouped by Category (UI, Charting, etc.) with library entries\n * as `### Name (Category)` and per-library bullets for description,\n * version, GlobalVariable, and short usage instructions.\n */\n private buildAvailableLibrariesMarkdown(): string {\n const libs = (ComponentMetadataEngine.Instance.ComponentLibraries ?? [])\n .filter(l => l.Status === 'Active')\n .sort((a, b) => (a.Category ?? '').localeCompare(b.Category ?? '') || a.Name.localeCompare(b.Name));\n if (libs.length === 0) return '';\n const lines: string[] = ['## Available Libraries'];\n let lastCategory: string | null | undefined = undefined;\n for (const l of libs) {\n const cat = l.Category ?? 'Other';\n if (cat !== lastCategory) {\n lines.push(`### ${cat}`);\n lastCategory = cat;\n }\n const parts: string[] = [`#### ${l.Name}`];\n if (l.GlobalVariable) parts.push(`- GlobalVariable: \\`${l.GlobalVariable}\\``);\n if (l.Version) parts.push(`- Version: ${l.Version}`);\n if (l.Description) parts.push(`- ${l.Description}`);\n if (l.UsageInstructions && l.UsageInstructions.length > 0 && l.UsageInstructions.length < 500) {\n parts.push(`- Usage: ${l.UsageInstructions}`);\n }\n lines.push(...parts);\n }\n return lines.join('\\n');\n }\n\n /**\n * Pre-render the active form's curated schema as markdown for the\n * agent prompt. Replaces the JSON Schema payload β same information,\n * roughly half the tokens, and easier to read in logs.\n *\n * Field names are wrapped in inline code (`` `name` ``) so underscores\n * (e.g. `__mj_Internal`) don't get parsed as emphasis. Other text is\n * left raw β LLMs tolerate minor markdown imperfections in description\n * prose fine.\n */\n private buildSchemaMarkdown(): string {\n if (!this.Schema) return '';\n const s = this.Schema;\n const lines: string[] = [];\n lines.push(`## Schema: ${s.displayName} (\\`${s.entityName}\\`)`);\n if (s.description) lines.push(s.description);\n if (s.nameField) lines.push(`Name field: \\`${s.nameField}\\``);\n lines.push('### Fields');\n for (const f of s.fields) {\n const flags: string[] = [f.type];\n if (f.required) flags.push('required');\n if (f.isPrimaryKey) flags.push('primary key');\n if (f.maxLength != null) flags.push(`max ${f.maxLength}`);\n const label = f.displayName && f.displayName !== f.name ? `${f.displayName} (\\`${f.name}\\`)` : `\\`${f.name}\\``;\n lines.push(`#### ${label}`);\n lines.push(`- ${flags.join(', ')}`);\n if (f.description) lines.push(`- ${f.description}`);\n if (f.allowedValues?.length) lines.push(`- Allowed values: ${f.allowedValues.join(', ')}`);\n if (f.references) {\n const dispField = f.references.displayField ? `.${f.references.displayField}` : '';\n lines.push(`- References: \\`${f.references.entity}${dispField}\\``);\n }\n }\n return lines.join('\\n');\n }\n\n /**\n * Pre-render the active entity's related-entities summary as markdown.\n * Compact one-line-per-related entry β agent sees what tables it could\n * pull in (lookups, sub-grids, related-record cards) without paying the\n * token cost of full schemas (those are still one `Get Entity Schema\n * For Form` action call away).\n */\n private buildRelatedEntitiesMarkdown(): string {\n const provider = this.provider;\n if (!provider || !this.TargetEntityName) return '';\n const entity = provider.EntityByName?.(this.TargetEntityName);\n if (!entity) return '';\n const rels = entity.RelatedEntities ?? [];\n if (rels.length === 0) return '';\n const lines: string[] = ['## Related Entities'];\n for (const r of rels) {\n // Resolve RelatedEntity name from the ID. EntityRelationshipInfo\n // doesn't carry the friendly name directly; look it up from\n // the provider's cached entity list.\n const related = provider.Entities?.find(e => UUIDsEqual(e.ID, r.RelatedEntityID));\n const name = related?.Name ?? '(unknown)';\n const type = (r.Type ?? 'One To Many').trim();\n const display = r.DisplayName && r.DisplayName !== name ? ` β ${r.DisplayName}` : '';\n const parts = [`### \\`${name}\\`${display}`, `- Type: ${type}`];\n if (r.EntityKeyField) parts.push(`- Local key: \\`${r.EntityKeyField}\\``);\n if (r.RelatedEntityJoinField) parts.push(`- Join field on related: \\`${r.RelatedEntityJoinField}\\``);\n lines.push(...parts);\n }\n return lines.join('\\n');\n }\n\n private registerAgentContext(): void {\n try {\n const ctx: Record<string, unknown> = {\n ActiveForm: this.TargetEntityName\n ? {\n EntityName: this.TargetEntityName,\n FormName: this.SelectedFormName,\n // Human-authored description of THIS form (what it\n // does, when to use it). Pulled from the saved\n // ComponentSpec.description so the agent has a\n // running narrative of the form's intent across\n // turns β handy when the user asks \"make it more\n // X\" without re-explaining what the form is.\n Description: this.SavedSpec?.description ?? null,\n SectionCount: this.Canvas?.sections.length ?? 0,\n IsDirty: this.DirtyFlag,\n // Identity of the currently-loaded Component +\n // EntityFormOverride row, so the Form Builder\n // agent can call `Modify Interactive Form` with\n // the right OverrideID immediately β instead of\n // calling `Create Interactive Form` and getting\n // ALREADY_EXISTS, or having to round-trip through\n // `Get Active Form For Entity` first. Null when\n // the cockpit is mid-creation of a new form.\n ComponentID: this.SelectedFormID,\n OverrideID: this.ActiveOverrideID,\n OverrideScope: this.ActiveOverrideScope,\n OverrideStatus: this.ActiveOverrideStatus,\n // **Live source code** of the form, NOT a stale\n // snapshot. We ship `EditableCode` (the in-memory\n // editor state) rather than `SavedSpec.code`\n // because the user may have typed edits since\n // last save. The agent must operate on what the\n // user is actually looking at. This is the\n // largest piece of context β a few KB to ~15KB\n // per turn β but it's worth every byte: shipping\n // it inline eliminates the `Get Active Form For\n // Entity` round-trip that otherwise burned a\n // 5β7-second tool call on EVERY turn just to\n // re-fetch code we already had in memory.\n Code: this.EditableCode || null,\n // Curated, LLM-friendly schema for the entity this\n // form binds to (resolved FKs, value-list enums,\n // stripped audit fields), pre-rendered as nested\n // markdown. LLMs parse this natively and roughly\n // half the tokens of the prior JSON shape. The\n // agent doesn't need to spend a tool-call turn\n // fetching schema for the entity it's editing.\n SchemaMarkdown: this.buildSchemaMarkdown() || null,\n // Related-entities summary as markdown β just\n // enough for the agent to know what tables it\n // could pull in (lookups, sub-forms, related-\n // record cards). Full schemas are still one\n // `Get Entity Schema For Form` call away when\n // the agent actually drills into one.\n RelatedEntitiesMarkdown: this.buildRelatedEntitiesMarkdown() || null,\n }\n : null,\n // Cockpit-wide catalog of libraries the form-runtime\n // already supports β agent uses these as the source of\n // truth for `ComponentSpec.libraries` declarations. Sits\n // alongside ActiveForm rather than nested inside, since\n // it's not per-form state. Markdown-rendered (grouped by\n // Category) for token efficiency.\n AvailableLibrariesMarkdown: this.buildAvailableLibrariesMarkdown() || null,\n };\n // Push cockpit-specific state to NavigationService. The Explorer\n // shell merges this into the published AppContextSnapshot's\n // AdditionalContext, then re-publishes β our subscription in\n // ngAfterViewInit picks it up and refreshes `ChatAppContext` so\n // the embedded chat-area sees the latest form state. Same flow\n // the floating overlay uses; both surfaces stay in sync.\n this.navigationService.SetAgentContext(this, ctx);\n this.navigationService.SetAgentClientTools(this, [\n {\n Name: 'UpdateForm',\n Description: 'Replace the active form canvas with a new canvas model. Pass the new FormCanvasModel JSON.',\n ParameterSchema: {\n type: 'object',\n properties: {\n canvasModel: {\n type: 'object',\n description: 'A FormCanvasModel β sections + elements.',\n },\n },\n required: ['canvasModel'],\n },\n Handler: async (params: Record<string, unknown>): Promise<unknown> => {\n const canvasModel = params?.['canvasModel'] as FormCanvasModel | undefined;\n if (!canvasModel) {\n return { Success: false, Error: 'No canvasModel provided.' };\n }\n this.OnCanvasChanged(canvasModel);\n return { Success: true };\n },\n },\n ]);\n } catch (err) {\n LogError(`FormBuilderResource.registerAgentContext: ${err instanceof Error ? err.message : String(err)}`);\n }\n }\n\n private markDirty(): void {\n this.DirtyFlag = true;\n }\n}\n\n/** Tree-shake protection β referenced from the dashboards module loader. */\nexport function LoadFormBuilderResourceComponent(): void {\n // Intentional no-op. Forces the bundler to keep this file's side effects\n // (the @RegisterClass call above) when consumers only do `import { ... }`.\n}\n","<!--\n βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n β FORM BUILDER COCKPIT β\n β 4 panes: Forms list β Versions β Code / Preview / Layout β Chat AI β\n β Forms-list rail and Chat rail both collapse to a strip. β\n βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n-->\n<div class=\"fb-cockpit\"\n [class.left-collapsed]=\"LeftRailCollapsed\"\n [class.chat-collapsed]=\"ChatPaneCollapsed\">\n\n <!-- Collapsed strip (left). Rendered OUTSIDE the splitter so the\n splitter only ever contains expanded panes. Click the chevron to\n re-expand; persisted via UserInfoEngine. -->\n @if (LeftRailCollapsed) {\n <div class=\"fb-collapsed-strip\" role=\"region\" aria-label=\"Forms list (collapsed)\">\n <button class=\"fb-rail-collapse\" type=\"button\" (click)=\"ToggleLeftRail()\"\n aria-label=\"Expand forms list\">\n <i class=\"fa-solid fa-chevron-right\"></i>\n </button>\n <div class=\"fb-collapsed-strip-label\"><i class=\"fa-solid fa-table-list\"></i></div>\n </div>\n }\n\n <!-- ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n SPLITTER β wraps the visible (expanded) panes. Percentage-based;\n drag-end persists sizes via OnSplitterDragEnd β savePrefs.\n ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ -->\n <as-split direction=\"horizontal\"\n class=\"fb-splitter\"\n unit=\"percent\"\n gutterSize=\"6\"\n (dragEnd)=\"OnSplitterDragEnd($event)\">\n\n @if (!LeftRailCollapsed) {\n <as-split-area [size]=\"LeftPanePct\" [minSize]=\"12\">\n <!-- ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n LEFT β Forms list (existing form-role Components, with version rail\n below). Collapses to a strip.\n ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ -->\n <aside class=\"fb-forms-rail\">\n <div class=\"fb-rail-header\">\n <button class=\"fb-rail-collapse\" type=\"button\" (click)=\"ToggleLeftRail()\"\n [attr.aria-label]=\"LeftRailCollapsed ? 'Expand forms list' : 'Collapse forms list'\">\n <i class=\"fa-solid\" [class.fa-chevron-left]=\"!LeftRailCollapsed\" [class.fa-chevron-right]=\"LeftRailCollapsed\"></i>\n </button>\n @if (!LeftRailCollapsed) {\n <h3 class=\"fb-rail-title\">Forms</h3>\n <button class=\"fb-rail-icon-btn\" type=\"button\" (click)=\"ToggleFormsViewMode()\"\n [title]=\"FormsViewMode === 'list' ? 'Switch to tree view (Schema β Entity β Form)' : 'Switch to flat list'\">\n <i class=\"fa-solid\" [class.fa-list]=\"FormsViewMode === 'list'\" [class.fa-folder-tree]=\"FormsViewMode === 'tree'\"></i>\n </button>\n <button class=\"fb-rail-new\" type=\"button\" (click)=\"OnNewForm()\" title=\"New form\">\n <i class=\"fa-solid fa-plus\"></i>\n <span>New</span>\n </button>\n }\n </div>\n\n @if (!LeftRailCollapsed) {\n\n <!-- Inner vertical splitter: forms list β versions panel.\n Persisted via `formsListHeightPct` in cockpit prefs. When either\n inner panel is collapsed, only the other one renders (no\n splitter), matching VS-Code's panel collapse behavior. -->\n @if (FormsListCollapsed) {\n <!-- Forms list collapsed β just show the header strip + full versions -->\n <div class=\"fb-inner-panel-header\" (click)=\"ToggleFormsListCollapsed()\">\n <i class=\"fa-solid fa-chevron-right\"></i>\n <span>Forms</span>\n <span class=\"fb-inner-panel-count\">{{ ExistingForms.length }}</span>\n </div>\n <ng-container *ngTemplateOutlet=\"versionsPanel\"></ng-container>\n } @else if (VersionsCollapsed) {\n <!-- Versions collapsed β full forms list + header strip for versions -->\n <ng-container *ngTemplateOutlet=\"formsPanel\"></ng-container>\n @if (SelectedFormID) {\n <div class=\"fb-inner-panel-header\" (click)=\"ToggleVersionsCollapsed()\">\n <i class=\"fa-solid fa-chevron-right\"></i>\n <span>Versions</span>\n @if (Versions.length > 0) {\n <span class=\"fb-inner-panel-count\">{{ Versions.length }}</span>\n }\n </div>\n }\n } @else {\n <!-- Both panels open β use a vertical splitter between them. -->\n <as-split direction=\"vertical\"\n class=\"fb-inner-splitter\"\n unit=\"percent\"\n gutterSize=\"6\"\n (dragEnd)=\"OnInnerSplitterDragEnd($event)\">\n <as-split-area [size]=\"SelectedFormID ? FormsListHeightPct : 100\" [minSize]=\"20\">\n <ng-container *ngTemplateOutlet=\"formsPanel\"></ng-container>\n </as-split-area>\n @if (SelectedFormID) {\n <as-split-area [size]=\"100 - FormsListHeightPct\" [minSize]=\"15\">\n <ng-container *ngTemplateOutlet=\"versionsPanel\"></ng-container>\n </as-split-area>\n }\n </as-split>\n }\n\n <!-- βββ Forms-list panel template ββββββββββββββββββββββββββββββ -->\n <ng-template #formsPanel>\n <div class=\"fb-inner-panel\">\n <div class=\"fb-inner-panel-header fb-inner-panel-header--open\" (click)=\"ToggleFormsListCollapsed()\">\n <i class=\"fa-solid fa-chevron-down\"></i>\n <span>Forms</span>\n <span class=\"fb-inner-panel-count\">{{ filteredForms.length }} / {{ ExistingForms.length }}</span>\n </div>\n <div class=\"fb-rail-search-row\">\n <div class=\"fb-rail-search\">\n <i class=\"fa-solid fa-search\"></i>\n <input type=\"text\"\n placeholder=\"Search formsβ¦\"\n [value]=\"LeftRailFilter\"\n (input)=\"OnLeftRailFilterChange($event)\" />\n </div>\n <div class=\"fb-entity-filter\" [class.open]=\"EntityFilterDropdownOpen\">\n <button type=\"button\" class=\"fb-entity-filter-btn\" (click)=\"ToggleEntityFilterDropdown()\"\n [title]=\"FormsEntityFilter ? 'Entity: ' + FormsEntityFilter : 'All entities'\">\n <i class=\"fa-solid fa-table\"></i>\n <span>{{ FormsEntityFilter || 'All entities' }}</span>\n <i class=\"fa-solid fa-chevron-down chev\"></i>\n </button>\n @if (EntityFilterDropdownOpen) {\n <div class=\"fb-entity-filter-popover\" (click)=\"$event.stopPropagation()\">\n <input type=\"text\" class=\"fb-entity-filter-search\"\n placeholder=\"Search entitiesβ¦\"\n [value]=\"EntityFilterSearch\"\n (input)=\"OnEntityFilterSearch($event)\" />\n <ul class=\"fb-entity-filter-list\">\n <li class=\"fb-entity-filter-item\"\n [class.fb-entity-filter-item--selected]=\"!FormsEntityFilter\"\n (click)=\"PickEntityFilter('')\">\n <i class=\"fa-solid fa-asterisk\"></i>\n <span>All entities</span>\n <span class=\"fb-entity-filter-count\">{{ ExistingForms.length }}</span>\n </li>\n @for (opt of entityFilterOptions; track opt.name) {\n <li class=\"fb-entity-filter-item\"\n [class.fb-entity-filter-item--selected]=\"FormsEntityFilter === opt.name\"\n (click)=\"PickEntityFilter(opt.name)\">\n @if (opt.icon) { <i [class]=\"opt.icon\"></i> } @else { <i class=\"fa-solid fa-table\"></i> }\n <span>{{ opt.display }}</span>\n <span class=\"fb-entity-filter-count\">{{ opt.count }}</span>\n </li>\n }\n </ul>\n </div>\n }\n </div>\n </div>\n <!-- Status filter chips + sort -->\n <div class=\"fb-rail-chips\">\n <button type=\"button\"\n class=\"fb-chip\"\n [class.fb-chip--on]=\"FormsStatusFilter.has('Active')\"\n (click)=\"ToggleStatusFilter('Active')\"\n title=\"Show forms with Active overrides\">\n <i class=\"fa-solid fa-circle-dot\"></i>Active\n </button>\n <button type=\"button\"\n class=\"fb-chip\"\n [class.fb-chip--on]=\"FormsStatusFilter.has('Pending')\"\n (click)=\"ToggleStatusFilter('Pending')\"\n title=\"Show forms with Pending (draft) overrides\">\n <i class=\"fa-solid fa-circle-dot\"></i>Pending\n </button>\n <button type=\"button\"\n class=\"fb-chip\"\n [class.fb-chip--on]=\"FormsStatusFilter.has('Inactive')\"\n (click)=\"ToggleStatusFilter('Inactive')\"\n title=\"Show forms with Inactive overrides\">\n <i class=\"fa-solid fa-circle-dot\"></i>Inactive\n </button>\n <span class=\"fb-spacer\"></span>\n <select class=\"fb-rail-sort\" [value]=\"FormsSortMode\"\n (change)=\"SetFormsSortMode($any($event.target).value)\" title=\"Sort\">\n <option value=\"updated-desc\">Recently edited</option>\n <option value=\"updated-asc\">Oldest edits</option>\n <option value=\"name-asc\">Name AβZ</option>\n <option value=\"name-desc\">Name ZβA</option>\n </select>\n </div>\n <div class=\"fb-rail-list\">\n @if (IsLoading) {\n <div class=\"fb-rail-empty\">Loadingβ¦</div>\n } @else if (filteredForms.length === 0) {\n <div class=\"fb-rail-empty\">\n <i class=\"fa-solid fa-table-list\"></i>\n @if (LeftRailFilter || FormsEntityFilter || FormsStatusFilter.size < 3) {\n <p>No forms match the current filters.</p>\n } @else {\n <p>No forms yet. Click <strong>New</strong> to start.</p>\n }\n </div>\n } @else if (FormsViewMode === 'tree') {\n <!-- Tree view: Schema β Entity β Forms -->\n @for (g of treeGroups; track g.schema) {\n <div class=\"fb-tree-schema\">\n <div class=\"fb-tree-schema-header\">\n <i class=\"fa-solid fa-database\"></i>\n <span>{{ g.schema }}</span>\n </div>\n @for (e of g.entities; track e.entity) {\n <div class=\"fb-tree-entity\">\n <div class=\"fb-tree-entity-header\" [title]=\"e.entity\">\n @if (e.icon) { <i [class]=\"e.icon\"></i> } @else { <i class=\"fa-solid fa-table\"></i> }\n <span>{{ e.entityDisplay }}</span>\n <span class=\"fb-tree-entity-count\">{{ e.forms.length }}</span>\n </div>\n @for (form of e.forms; track form.ID) {\n <ng-container *ngTemplateOutlet=\"formRow; context: { $implicit: form, treeIndent: true }\"></ng-container>\n }\n </div>\n }\n </div>\n }\n } @else {\n <!-- Flat list view -->\n @for (form of filteredForms; track form.ID) {\n <ng-container *ngTemplateOutlet=\"formRow; context: { $implicit: form }\"></ng-container>\n }\n }\n </div>\n </div>\n </ng-template>\n\n <!-- βββ Form row template (used by both list + tree) βββββββββββ -->\n <ng-template #formRow let-form let-treeIndent=\"treeIndent\">\n <button class=\"fb-rail-item\"\n type=\"button\"\n [class.active]=\"form.ID === SelectedFormID\"\n [class.fb-rail-item--tree]=\"treeIndent\"\n [class.fb-rail-item--dirty]=\"form.ID === SelectedFormID && DirtyFlag\"\n (click)=\"OnFormPicked(form)\"\n (contextmenu)=\"OnFormRowContextMenu(form, $event)\">\n <button class=\"fb-rail-pin\"\n type=\"button\"\n [class.fb-rail-pin--on]=\"IsFormPinned(form)\"\n (click)=\"TogglePinForm(form, $event)\"\n [attr.aria-label]=\"IsFormPinned(form) ? 'Unpin' : 'Pin'\"\n [title]=\"IsFormPinned(form) ? 'Unpin from top' : 'Pin to top'\">\n <i class=\"fa-solid fa-thumbtack\"></i>\n </button>\n <div class=\"fb-rail-item-icon\">\n @if (form.TargetEntityIcon) { <i [class]=\"form.TargetEntityIcon\"></i> } @else { <i class=\"fa-solid fa-table-list\"></i> }\n </div>\n <div class=\"fb-rail-item-body\">\n <div class=\"fb-rail-item-name\">\n {{ form.Name }}\n @if (form.ID === SelectedFormID && DirtyFlag) { <span class=\"fb-rail-item-dirty-dot\" title=\"Unsaved changes\">β</span> }\n </div>\n <div class=\"fb-rail-item-sub\">\n @if (form.TargetEntityName) {\n <span class=\"fb-rail-item-entity\">{{ form.TargetEntityName }}</span>\n }\n @if (form.UpdatedAt) {\n <span class=\"fb-rail-item-time\">Β· {{ form.UpdatedAt | date:'short' }}</span>\n }\n </div>\n </div>\n @if (form.OverrideStatus) {\n <span class=\"fb-rail-badge\"\n [class.fb-rail-badge--active]=\"form.OverrideStatus === 'Active'\"\n [class.fb-rail-badge--inactive]=\"form.OverrideStatus === 'Inactive'\"\n [class.fb-rail-badge--pending]=\"form.OverrideStatus === 'Pending'\"\n [title]=\"form.OverrideStatus + ' override'\">\n <i class=\"fa-solid fa-circle-dot\"></i>\n </span>\n }\n </button>\n </ng-template>\n\n <!-- βββ Versions-panel template ββββββββββββββββββββββββββββββββ -->\n <ng-template #versionsPanel>\n @if (SelectedFormID) {\n <div class=\"fb-inner-panel\">\n <div class=\"fb-inner-panel-header fb-inner-panel-header--open\" (click)=\"ToggleVersionsCollapsed()\">\n <i class=\"fa-solid fa-chevron-down\"></i>\n <span>Versions</span>\n @if (Versions.length > 0) {\n <span class=\"fb-inner-panel-count\">{{ Versions.length }}</span>\n }\n </div>\n <div class=\"fb-versions-list\">\n @if (VersionsLoading) {\n <div class=\"fb-rail-empty\">Loadingβ¦</div>\n } @else if (Versions.length === 0) {\n <div class=\"fb-rail-empty\"><p>No version history yet.</p></div>\n } @else {\n @for (v of Versions; track v.ID) {\n <div class=\"fb-version-row\"\n [class.is-active]=\"v.IsActive\"\n [class.is-pending]=\"v.IsPending\"\n [class.is-selected]=\"v.ID === SelectedFormID\"\n [class.is-diff-source]=\"v.ID === DiffSourceVersionID\"\n role=\"button\"\n tabindex=\"0\"\n [title]=\"'Load v' + v.Version + ' into the editor. Right-click for more.'\"\n (click)=\"OnVersionRowClick(v)\"\n (keydown.enter)=\"OnVersionRowClick(v)\"\n (keydown.space)=\"OnVersionRowClick(v); $event.preventDefault()\">\n <span class=\"fb-version-marker\" aria-hidden=\"true\">\n <i class=\"fa-solid fa-circle\"></i>\n </span>\n <div class=\"fb-version-row-main\">\n <div class=\"fb-version-label\">\n v{{ v.Version }}\n @if (v.IsActive) {\n <span class=\"fb-version-tag is-active\">Active</span>\n } @else if (v.IsPending) {\n <span class=\"fb-version-tag is-pending\">Pending</span>\n } @else {\n <span class=\"fb-version-tag\">Inactive</span>\n }\n @if (v.ID === DiffSourceVersionID) {\n <span class=\"fb-version-tag fb-version-tag--diff\">Diff: A</span>\n }\n </div>\n <div class=\"fb-version-meta\">\n @if (v.UpdatedAt) { {{ v.UpdatedAt | date:'short' }} } @else { (no timestamp) }\n </div>\n </div>\n <button class=\"fb-version-action fb-version-action--diff\" type=\"button\"\n (click)=\"OnVersionDiffClick(v, $event)\"\n [title]=\"DiffSourceVersionID ? (DiffSourceVersionID === v.ID ? 'Click another version to compare. Click again to cancel.' : 'Compare with selected version') : 'Start diff: pick this as source, then click another version'\">\n <i class=\"fa-solid fa-code-compare\"></i>\n </button>\n @if (!v.IsActive) {\n <button class=\"fb-version-activate\" type=\"button\"\n (click)=\"$event.stopPropagation(); OnActivateVersion(v)\"\n [title]=\"v.IsPending ? 'Activate this Pending version' : 'Restore: roll back to this version'\">\n <i class=\"fa-solid\" [class.fa-circle-check]=\"v.IsPending\" [class.fa-rotate-left]=\"!v.IsPending\"></i>\n <span class=\"fb-version-activate-label\">{{ v.IsPending ? 'Activate' : 'Restore' }}</span>\n </button>\n }\n </div>\n }\n }\n </div>\n </div>\n }\n </ng-template>\n\n } <!-- end if !LeftRailCollapsed -->\n </aside>\n </as-split-area>\n }\n\n <!-- ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n CENTER β Tabbed (Preview / Code / Layout) + toolbar\n ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ -->\n <as-split-area [size]=\"CenterPanePct\" [minSize]=\"30\">\n <section class=\"fb-center\">\n\n <div class=\"fb-toolbar\">\n <input type=\"text\"\n class=\"fb-name-input\"\n [value]=\"SelectedFormName\"\n placeholder=\"Form nameβ¦\"\n (input)=\"OnFormNameInput($event)\"\n title=\"Form name β used as the JS function identifier in the generated code\" />\n\n <div class=\"fb-entity-picker\" [class.open]=\"IsEntityPickerOpen\">\n <button type=\"button\" class=\"fb-entity-btn\" (click)=\"ToggleEntityPicker()\">\n <i class=\"fa-solid fa-table\"></i>\n <span>\n @if (TargetEntityName) {\n {{ TargetEntityName }}\n } @else {\n <em>Pick entityβ¦</em>\n }\n </span>\n <i class=\"fa-solid fa-chevron-down chev\"></i>\n </button>\n @if (IsEntityPickerOpen) {\n <div class=\"fb-entity-popover\" (click)=\"$event.stopPropagation()\">\n <input type=\"text\"\n class=\"fb-entity-search\"\n placeholder=\"Search entitiesβ¦\"\n [value]=\"EntityPickerSearch\"\n (input)=\"OnEntityPickerSearch($event)\" />\n <ul class=\"fb-entity-list\">\n @for (e of filteredEntityChoices; track e.Name; let idx = $index) {\n @if (idx < 50) {\n <li class=\"fb-entity-item\" (click)=\"OnEntityPicked(e.Name)\">\n <span class=\"fb-entity-display\">{{ e.DisplayName }}</span>\n <span class=\"fb-entity-name\">{{ e.Name }}</span>\n </li>\n }\n }\n </ul>\n </div>\n }\n </div>\n\n <!-- Override status pill β only meaningful when an existing\n override is loaded. Controls EntityFormOverride.Status\n (Active / Inactive / Pending). The forms-runtime resolver\n reads this to decide whether to use this form for the user. -->\n @if (ActiveOverrideID && ActiveOverrideStatus) {\n <div class=\"fb-status-picker\" [class.open]=\"OverrideStatusPickerOpen\">\n <button type=\"button\"\n class=\"fb-status-pill\"\n [class.fb-status-pill--active]=\"ActiveOverrideStatus === 'Active'\"\n [class.fb-status-pill--inactive]=\"ActiveOverrideStatus === 'Inactive'\"\n [class.fb-status-pill--pending]=\"ActiveOverrideStatus === 'Pending'\"\n [disabled]=\"OverrideStatusSaving\"\n (click)=\"ToggleOverrideStatusPicker()\"\n [title]=\"'Override status: ' + ActiveOverrideStatus + ' β click to change'\">\n <i class=\"fa-solid fa-circle-dot\"></i>\n <span>{{ ActiveOverrideStatus }}</span>\n <i class=\"fa-solid fa-chevron-down chev\"></i>\n </button>\n @if (OverrideStatusPickerOpen) {\n <div class=\"fb-status-popover\" (click)=\"$event.stopPropagation()\">\n @for (opt of OverrideStatusOptions; track opt.value) {\n <button type=\"button\"\n class=\"fb-status-option\"\n [class.fb-status-option--selected]=\"ActiveOverrideStatus === opt.value\"\n [disabled]=\"OverrideStatusSaving\"\n (click)=\"OnOverrideStatusPicked(opt.value)\">\n <i [class]=\"opt.icon\"></i>\n <span class=\"fb-status-option-label\">{{ opt.label }}</span>\n <span class=\"fb-status-option-desc\">{{ opt.description }}</span>\n </button>\n }\n </div>\n }\n </div>\n }\n\n <!-- Custom-code chip β fires when the canvas parser flagged the\n loaded code as containing constructs it can't round-trip (hand-\n authored JSX, computed children, AI-generated patterns, etc.).\n Signals to the user that this form is in \"code-only\" authoring\n mode and is the on-screen explanation for why the Layout tab\n is disabled. Title spells out the contract on hover. -->\n @if (CanvasDiverged && HasActiveForm) {\n <span class=\"fb-custom-code-chip\"\n title=\"This form contains custom code the drag-and-drop canvas cannot round-trip. The Layout tab is disabled to prevent overwriting your code; edit in Code instead.\">\n <i class=\"fa-solid fa-code\"></i>\n Custom code\n </span>\n }\n\n <span class=\"fb-spacer\"></span>\n\n <!-- Center-pane view-mode segmented control -->\n <div class=\"fb-modeseg\" role=\"tablist\" aria-label=\"Center pane view\">\n <button type=\"button\"\n role=\"tab\"\n class=\"fb-modeseg-btn\"\n [class.active]=\"CenterPaneMode === 'preview'\"\n [attr.aria-selected]=\"CenterPaneMode === 'preview'\"\n (click)=\"SetCenterPaneMode('preview')\">\n <i class=\"fa-solid fa-eye\"></i> Preview\n </button>\n <button type=\"button\"\n role=\"tab\"\n class=\"fb-modeseg-btn\"\n [class.active]=\"CenterPaneMode === 'code'\"\n [attr.aria-selected]=\"CenterPaneMode === 'code'\"\n (click)=\"SetCenterPaneMode('code')\">\n <i class=\"fa-solid fa-code\"></i> Code\n </button>\n <!-- Layout tab is disabled when the code has diverged from what\n the canvas can represent (hand-authored JSX, computed\n constructs, etc.). The canvas can't safely round-trip such\n code, so editing on Layout and re-emitting would overwrite\n the user's hand-written bits. CanvasDiverged is set by\n `parseCanvasFromCode` when it sees `hasUnknownConstructs`\n or a parse failure. -->\n <button type=\"button\"\n role=\"tab\"\n class=\"fb-modeseg-btn\"\n [class.active]=\"CenterPaneMode === 'layout'\"\n [attr.aria-selected]=\"CenterPaneMode === 'layout'\"\n [disabled]=\"CanvasDiverged\"\n [title]=\"CanvasDiverged\n ? 'Layout is disabled β the form has hand-authored code the drag-drop canvas cannot round-trip. Edit in Code instead.'\n : 'Drag-and-drop canvas editor'\"\n (click)=\"SetCenterPaneMode('layout')\">\n <i class=\"fa-solid fa-table-cells\"></i> Layout\n </button>\n </div>\n\n @if (SelectedFormID && ActiveOverrideID) {\n <button type=\"button\" class=\"fb-action\" (click)=\"OpenEditFormDetailsDialog()\"\n title=\"Edit form details: name, description, scope, priority, status\">\n <i class=\"fa-solid fa-pen\"></i>\n <span>Details</span>\n </button>\n }\n @if (SelectedFormID) {\n <button type=\"button\" class=\"fb-action fb-action--danger\" (click)=\"OnDelete()\"\n title=\"Delete this form and its overrides\">\n <i class=\"fa-solid fa-trash\"></i>\n <span>Delete</span>\n </button>\n }\n <button type=\"button\" class=\"fb-action fb-action--primary\" (click)=\"OnSave()\" [disabled]=\"!DirtyFlag\">\n <i class=\"fa-solid fa-floppy-disk\"></i>\n <span>Save</span>\n </button>\n </div>\n\n <div class=\"fb-center-body\">\n <!-- Version overlay β floating, top-left of the center pane.\n Shows which Component version the editor is currently bound\n to, decoupled from the version-rail's selected highlight.\n When the user clicks an older row to inspect history, this\n chip stays in sync and visually flags \"you are NOT looking\n at what the runtime serves\" by going amber for non-Active\n historical versions. Clicking the chip dismisses focus\n but performs no navigation β it's a status indicator. -->\n @if (CurrentSelectedVersion && HasActiveForm) {\n <div class=\"fb-version-overlay\"\n [class.fb-version-overlay--active]=\"CurrentSelectedVersion.IsActive\"\n [class.fb-version-overlay--pending]=\"CurrentSelectedVersion.IsPending\"\n [class.fb-version-overlay--historical]=\"!CurrentSelectedVersion.IsActive && !CurrentSelectedVersion.IsPending\"\n [title]=\"CurrentSelectedVersion.IsActive\n ? 'Viewing the version the runtime is currently serving.'\n : CurrentSelectedVersion.IsPending\n ? 'Viewing a Pending version β AI-authored, not yet Activated.'\n : 'Viewing an Inactive historical version β the runtime is serving a different version.'\">\n <i class=\"fa-solid fa-clock-rotate-left\"></i>\n <span class=\"fb-version-overlay-label\">Viewing v{{ CurrentSelectedVersion.Version }}</span>\n @if (CurrentSelectedVersion.IsActive) {\n <span class=\"fb-version-overlay-tag fb-version-overlay-tag--active\">Active</span>\n } @else if (CurrentSelectedVersion.IsPending) {\n <span class=\"fb-version-overlay-tag fb-version-overlay-tag--pending\">Pending</span>\n } @else {\n <span class=\"fb-version-overlay-tag fb-version-overlay-tag--historical\">Historical</span>\n }\n </div>\n }\n\n @if (!SelectedFormID && !IsNewForm) {\n <!-- No form picked or being created β invite the user to pick or\n create one. Lists recently-edited forms for quick access. -->\n <div class=\"fb-empty fb-empty--landing\">\n <i class=\"fa-solid fa-pen-ruler\"></i>\n <h3>Form Builder</h3>\n <p>Pick a form on the left or click <strong>+ New</strong> above the list to start a new one. The Form Builder agent on the right will help you author and refine via natural language.</p>\n @if (ExistingForms.length > 0) {\n <div class=\"fb-empty-recent\">\n <div class=\"fb-empty-recent-label\">Recently edited</div>\n <div class=\"fb-empty-recent-list\">\n @for (form of filteredForms.slice(0, 5); track form.ID) {\n <button class=\"fb-empty-recent-item\" type=\"button\" (click)=\"OnFormPicked(form)\">\n @if (form.TargetEntityIcon) { <i [class]=\"form.TargetEntityIcon\"></i> } @else { <i class=\"fa-solid fa-table-list\"></i> }\n <div class=\"fb-empty-recent-meta\">\n <div class=\"fb-empty-recent-name\">{{ form.Name }}</div>\n <div class=\"fb-empty-recent-entity\">{{ form.TargetEntityName }}</div>\n </div>\n </button>\n }\n </div>\n </div>\n }\n </div>\n } @else if (!TargetEntityName) {\n <div class=\"fb-empty\">\n <i class=\"fa-solid fa-table-list\"></i>\n <h3>Pick an entity to start</h3>\n <p>Choose the target entity above, then refine the form via code, preview, or drag-drop layout.</p>\n </div>\n } @else {\n <!-- Preview pane: live render via mj-interactive-form when we have\n a usable spec + can resolve the entity. For an unsaved canvas,\n the code is what's \"live\" via canvas β code regen; preview\n will render off that. -->\n @if (CenterPaneMode === 'preview') {\n <div class=\"fb-preview-host\">\n <!-- Preview record picker strip β same affordance shape as the\n artifact-viewer form-aware branch, so users see one consistent\n pattern across the chat artifact path and the cockpit path. -->\n <div class=\"fb-preview-toolstrip\">\n <i class=\"fa-solid fa-circle-info\" aria-hidden=\"true\"></i>\n <span>Previewing record:</span>\n <button type=\"button\"\n class=\"fb-preview-chip\"\n (click)=\"TogglePreviewPicker()\">\n <i class=\"fa-solid fa-magnifying-glass\"></i>\n <strong>{{ PreviewRecordLabel || 'No record' }}</strong>\n @if (!PreviewRecordIsReal && PreviewRecord) {\n <span class=\"fb-preview-chip-badge\">Mock</span>\n }\n <i class=\"fa-solid fa-chevron-down\"></i>\n </button>\n <span class=\"fb-preview-chip-entity\">{{ TargetEntityName }}</span>\n @if (PreviewRecord && PreviewRecordIsReal) {\n <button type=\"button\" class=\"fb-preview-open-record\"\n (click)=\"OpenPreviewRecord()\"\n title=\"Open this record in a new tab\">\n <i class=\"fa-solid fa-arrow-up-right-from-square\"></i>\n <span>Open record</span>\n </button>\n }\n @if (PreviewError) {\n <span class=\"fb-preview-warning\" [title]=\"PreviewError\">\n <i class=\"fa-solid fa-triangle-exclamation\"></i>\n </span>\n }\n </div>\n\n @if (PreviewPickerOpen) {\n <div class=\"fb-preview-picker-panel\" (click)=\"$event.stopPropagation()\">\n <input type=\"text\"\n class=\"fb-preview-picker-search\"\n placeholder=\"Search records by nameβ¦\"\n [value]=\"PreviewSearchTerm\"\n (input)=\"OnPreviewSearchInput($event)\" />\n @if (PreviewSearchResults.length > 0) {\n <ul class=\"fb-preview-picker-results\">\n @for (r of PreviewSearchResults; track r.ID) {\n <li class=\"fb-preview-picker-row\" (click)=\"OnPreviewRecordPicked(r)\">\n <i class=\"fa-solid fa-circle-dot\"></i>\n <span>{{ r.Label }}</span>\n </li>\n }\n </ul>\n } @else if (PreviewSearchTerm.length > 0) {\n <div class=\"fb-preview-picker-empty\">No matches.</div>\n } @else {\n <div class=\"fb-preview-picker-empty\">No records in this entity.</div>\n }\n </div>\n }\n\n <div class=\"fb-preview-frame\">\n @if (PreviewLoading) {\n <div class=\"fb-preview-empty\">\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n <p>Loading previewβ¦</p>\n </div>\n } @else if (!PreviewSpec) {\n <div class=\"fb-preview-empty\">\n <i class=\"fa-solid fa-eye\"></i>\n <h4>Live preview</h4>\n <p>Code is empty β switch to <strong>Code</strong> or <strong>Layout</strong> to start.</p>\n </div>\n } @else if (PreviewRecord) {\n <!--\n Retrospective fix #10: subscribe to LoadErrorChanged so\n spec parse / mount errors surface in the cockpit's own\n error pane instead of only appearing inline inside the\n React component.\n -->\n <!-- previewMode=true β no toolbar wrap; just the form\n body. Cockpit's own toolbar already handles saving\n the spec; the form's own Save/Cancel/Edit/Delete are\n not relevant in preview. -->\n <mj-interactive-form\n [componentSpec]=\"PreviewSpec\"\n [record]=\"PreviewRecord\"\n [previewMode]=\"true\"\n (LoadErrorChanged)=\"OnPreviewLoadError($event)\">\n </mj-interactive-form>\n } @else {\n <div class=\"fb-preview-empty\">\n <i class=\"fa-solid fa-triangle-exclamation\"></i>\n <p>{{ PreviewError || 'Could not bind a record for preview.' }}</p>\n </div>\n }\n </div>\n </div>\n }\n\n @if (CenterPaneMode === 'code') {\n <div class=\"fb-code-host\">\n <!-- mj-code-editor (CodeMirror under the hood). The 'javascript'\n language extension enables full JS + JSX highlighting β\n enough for the form-role component spec the agent emits. -->\n <mj-code-editor\n class=\"fb-code-editor\"\n [ngModel]=\"EditableCode\"\n (ngModelChange)=\"OnEditableCodeChange($event)\"\n [language]=\"'javascript'\"\n [indentWithTab]=\"true\">\n </mj-code-editor>\n </div>\n }\n\n @if (CenterPaneMode === 'layout') {\n <div class=\"fb-canvas-host\">\n <!--\n Retrospective fix #6: warn the user when the loaded JSX has\n hand-authored content the canvas can't represent. Saving from\n the canvas regenerates code, which would overwrite those edits.\n The banner lets users know to keep editing in Code instead.\n -->\n @if (CanvasDiverged) {\n <div class=\"fb-canvas-divergence-banner\">\n <i class=\"fa-solid fa-triangle-exclamation\"></i>\n <span>\n <strong>Code has hand-authored content the canvas can't display.</strong>\n Saving from the Layout tab will regenerate code from the canvas and\n <strong>overwrite those edits</strong>. To preserve them, edit the Code tab directly.\n </span>\n </div>\n }\n <mj-form-builder-canvas\n [Canvas]=\"Canvas\"\n [Schema]=\"Schema\"\n [SelectedElementId]=\"SelectedElementId\"\n [SelectedSectionId]=\"SelectedSectionId\"\n (CanvasChanged)=\"OnCanvasChanged($event)\"\n (ElementSelected)=\"OnElementSelected($event)\"\n (SectionSelected)=\"OnSectionSelected($event)\"\n (Deselected)=\"OnDeselected()\">\n </mj-form-builder-canvas>\n </div>\n }\n }\n </div>\n </section>\n </as-split-area>\n\n <!-- ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n CHAT PANE β Form Builder AI cockpit-mate\n Embedded right pane that always sits next to the editor. Mounts the\n chat-area component directly (same interior the floating overlay\n wraps). Collapses to a strip rendered OUTSIDE the splitter so the\n drag handle doesn't appear next to a collapsed pane.\n ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ -->\n <!-- Chat pane only renders when a form is actively being shown. Empty\n cockpit (no form selected, no \"New Form\" in progress) hides the\n chat surface entirely so we don't show an agent shell against no\n subject. The collapsed strip below is gated on the same flag. -->\n @if (!ChatPaneCollapsed && HasActiveForm) {\n <as-split-area [size]=\"ChatPanePct\" [minSize]=\"15\">\n <aside class=\"fb-chat-pane\">\n <div class=\"fb-rail-header\">\n @if (!ChatPaneCollapsed) {\n <h3 class=\"fb-rail-title\">\n <i class=\"fa-solid fa-wand-magic-sparkles\"></i> Form Builder AI\n </h3>\n }\n <button class=\"fb-rail-collapse\" type=\"button\" (click)=\"ToggleChatPane()\"\n [attr.aria-label]=\"ChatPaneCollapsed ? 'Expand chat pane' : 'Collapse chat pane'\">\n <i class=\"fa-solid\" [class.fa-chevron-right]=\"!ChatPaneCollapsed\" [class.fa-chevron-left]=\"ChatPaneCollapsed\"></i>\n </button>\n </div>\n\n @if (!ChatPaneCollapsed) {\n <!-- Context strip β small label above the chat so the user always\n sees which form the agent has context on. Shows the override\n status + version too so the user knows what state they're\n editing (Active live vs Pending draft vs Inactive historical). -->\n @if (SelectedFormID && TargetEntityName) {\n <div class=\"fb-chat-context\">\n <div class=\"fb-chat-context-row\">\n <div class=\"fb-chat-context-label\">Editing</div>\n <div class=\"fb-chat-context-value\">{{ SelectedFormName }}</div>\n @if (CurrentSelectedVersion) {\n <span class=\"fb-chat-context-version\">v{{ CurrentSelectedVersion.Version }}</span>\n }\n @if (ActiveOverrideStatus) {\n <span class=\"fb-rail-badge\"\n [class.fb-rail-badge--active]=\"ActiveOverrideStatus === 'Active'\"\n [class.fb-rail-badge--inactive]=\"ActiveOverrideStatus === 'Inactive'\"\n [class.fb-rail-badge--pending]=\"ActiveOverrideStatus === 'Pending'\">\n <i class=\"fa-solid fa-circle-dot\"></i>\n {{ ActiveOverrideStatus }}\n </span>\n }\n </div>\n <div class=\"fb-chat-context-sub\">{{ TargetEntityName }}</div>\n @if (LineageConversations.length > 1) {\n <div class=\"fb-chat-context-row\">\n <button class=\"fb-chat-context-history\"\n type=\"button\"\n (click)=\"ToggleConversationHistoryDropdown()\"\n title=\"Switch to another conversation about this form\">\n <i class=\"fa-solid fa-clock-rotate-left\"></i>\n <span>{{ LineageConversations.length }} conversations</span>\n <i class=\"fa-solid fa-chevron-down\"></i>\n </button>\n @if (ConversationHistoryDropdownOpen) {\n <div class=\"fb-chat-context-history-popover\" (click)=\"$event.stopPropagation()\">\n @for (c of LineageConversations; track c.ID) {\n <button type=\"button\"\n class=\"fb-chat-context-history-item\"\n [class.fb-chat-context-history-item--active]=\"c.ID === ChatConversationId\"\n (click)=\"PickLineageConversation(c)\">\n <i class=\"fa-solid fa-message\"></i>\n <span class=\"fb-chat-context-history-name\">{{ c.Name || '(unnamed)' }}</span>\n @if (c.UpdatedAt) {\n <span class=\"fb-chat-context-history-time\">{{ c.UpdatedAt | date:'short' }}</span>\n }\n </button>\n }\n </div>\n }\n </div>\n }\n </div>\n } @else {\n <div class=\"fb-chat-context fb-chat-context--empty\">\n <div class=\"fb-chat-context-sub\">Pick or create a form to start.</div>\n </div>\n }\n\n <!-- Embedded chat-area β same interior component the floating overlay\n wraps. Mounting it directly here means the chat lives in the\n cockpit's right pane (no overlay popping). `appContext` carries\n the ActiveForm shape so Sage / Form Builder agent sees the\n cockpit state with every message. -->\n <div class=\"fb-chat-embed\">\n @if (IsNewForm && !SelectedFormID) {\n <!-- New, unsaved form β disable chat until the form has an ID.\n Without this, the chat would be bound to whatever conversation\n was previously loaded (wrong subject), or would create a\n conversation linked to a record that doesn't exist yet. -->\n <div class=\"fb-chat-context fb-chat-context--empty\">\n <i class=\"fa-solid fa-lock\" style=\"font-size: 1.5rem; opacity: 0.5; margin-bottom: 0.5rem;\"></i>\n <div class=\"fb-chat-context-sub\">Save the form to start a conversation with the Form Builder agent.</div>\n </div>\n } @else if (currentUser) {\n <!-- conversationCreated must be wired β without it the chat\n stays stuck on the welcome screen after the user sends the\n first message (we never flip out of new-conversation mode). -->\n <!-- pendingMessage + pendingAttachments are the atomic-handoff\n buffer the chat-area emits as part of `conversationCreated`.\n Feeding them back as inputs is what actually posts the\n user's first message after the conversation is created;\n without this, the chat creates the conversation but\n appears stuck on the welcome screen. -->\n <mj-conversation-chat-area\n [Provider]=\"Provider\"\n [environmentId]=\"ChatEnvironmentId\"\n [currentUser]=\"currentUser\"\n [conversationId]=\"ChatConversationId\"\n [conversation]=\"ChatConversation\"\n [isNewConversation]=\"ChatIsNewConversation\"\n [suppressNewConversationEmptyState]=\"true\"\n [showAgentModePicker]=\"true\"\n [allowMentions]=\"false\"\n [pendingMessage]=\"ChatPendingMessage\"\n [pendingAttachments]=\"$any(ChatPendingAttachments)\"\n [overlayMode]=\"true\"\n [showExportButton]=\"false\"\n [showShareButton]=\"false\"\n [showArtifactIndicator]=\"false\"\n [appContext]=\"$any(ChatAppContext)\"\n [defaultAgentId]=\"FormBuilderAgentId\"\n [showAgentPicker]=\"false\"\n [applicationScope]=\"'Application'\"\n [applicationId]=\"CockpitApplicationId\"\n [linkedEntityId]=\"ComponentsEntityID\"\n [linkedRecordId]=\"SelectedFormID\"\n [threadId]=\"ChatThreadId\"\n [pendingArtifactId]=\"ChatPendingArtifactId\"\n [pendingArtifactVersionNumber]=\"ChatPendingArtifactVersionNumber\"\n [emptyStateGreeting]=\"'How can I help with this form?'\"\n (conversationCreated)=\"OnChatConversationCreated($event)\"\n (pendingMessageConsumed)=\"OnChatPendingMessageConsumed()\"\n (openEntityRecord)=\"OnChatOpenEntityRecord($event)\"\n (navigationRequest)=\"OnChatNavigationRequest($event)\"\n (taskClicked)=\"OnChatTaskClicked($event)\"\n (artifactLinkClicked)=\"OnChatArtifactLinkClicked($event)\"\n (conversationRenamed)=\"OnChatConversationRenamed($event)\"\n (threadOpened)=\"OnChatThreadOpened($event)\"\n (threadClosed)=\"OnChatThreadClosed()\"\n (pendingArtifactConsumed)=\"OnChatPendingArtifactConsumed()\">\n </mj-conversation-chat-area>\n } @else {\n <div class=\"fb-chat-context fb-chat-context--empty\">\n <div class=\"fb-chat-context-sub\">Loadingβ¦</div>\n </div>\n }\n </div>\n }\n </aside>\n </as-split-area>\n }\n\n </as-split>\n\n <!-- Collapsed strip (chat). Same OUTSIDE-the-splitter pattern as the\n left rail's strip. -->\n @if (ChatPaneCollapsed && HasActiveForm) {\n <div class=\"fb-collapsed-strip\" role=\"region\" aria-label=\"Form Builder AI (collapsed)\">\n <button class=\"fb-rail-collapse\" type=\"button\" (click)=\"ToggleChatPane()\"\n aria-label=\"Expand Form Builder AI\">\n <i class=\"fa-solid fa-chevron-left\"></i>\n </button>\n <div class=\"fb-collapsed-strip-label\"><i class=\"fa-solid fa-wand-magic-sparkles\"></i></div>\n </div>\n }\n\n <!-- ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n POST-SAVE OVERRIDE DIALOG (unchanged)\n ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ -->\n <mj-form-override-dialog\n [Visible]=\"ShowFormOverrideDialog\"\n [ComponentName]=\"PendingOverrideComponentName\"\n [EntityName]=\"PendingOverrideEntityName\"\n [InitialName]=\"PendingOverrideInitialName\"\n [InitialDescription]=\"PendingOverrideInitialDescription\"\n [InitialNotes]=\"PendingOverrideInitialNotes\"\n [InitialStatus]=\"PendingOverrideInitialStatus\"\n [InitialScope]=\"PendingOverrideInitialScope\"\n [InitialRoleID]=\"PendingOverrideInitialRoleID\"\n [InitialPriority]=\"PendingOverrideInitialPriority\"\n [EditMode]=\"FormOverrideDialogEditMode\"\n (confirmed)=\"OnFormOverrideDialogConfirm($event)\"\n (dismissed)=\"OnFormOverrideDialogDismiss()\">\n </mj-form-override-dialog>\n\n <!-- Inspector pane for Layout mode lives inside the Layout view β for the\n Preview / Code modes it stays hidden (the field palette is only useful\n in the canvas surface). When we resurrect it as a pop-out, this is\n where it'll re-mount. -->\n\n <!-- ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n RIGHT-CLICK CONTEXT MENU on form rows\n ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ -->\n @if (ContextMenuOpen && ContextMenuForm) {\n <div class=\"fb-context-menu-backdrop\" (click)=\"CloseContextMenu()\" (contextmenu)=\"CloseContextMenu(); $event.preventDefault()\"></div>\n <div class=\"fb-context-menu\"\n [style.left.px]=\"ContextMenuX\"\n [style.top.px]=\"ContextMenuY\"\n (click)=\"$event.stopPropagation()\">\n <div class=\"fb-context-menu-header\">{{ ContextMenuForm.Name }}</div>\n <button type=\"button\" class=\"fb-context-menu-item\" (click)=\"ContextMenuTogglePin()\">\n <i class=\"fa-solid fa-thumbtack\"></i>\n <span>{{ IsFormPinned(ContextMenuForm) ? 'Unpin from top' : 'Pin to top' }}</span>\n </button>\n <button type=\"button\" class=\"fb-context-menu-item\" (click)=\"ContextMenuDuplicate()\">\n <i class=\"fa-solid fa-copy\"></i>\n <span>Duplicate</span>\n </button>\n <button type=\"button\" class=\"fb-context-menu-item\" (click)=\"ContextMenuCopyID()\">\n <i class=\"fa-solid fa-fingerprint\"></i>\n <span>Copy Component ID</span>\n </button>\n <button type=\"button\" class=\"fb-context-menu-item\" (click)=\"ContextMenuExportSpec()\">\n <i class=\"fa-solid fa-file-export\"></i>\n <span>Export Spec JSON</span>\n </button>\n <hr class=\"fb-context-menu-divider\" />\n <button type=\"button\" class=\"fb-context-menu-item fb-context-menu-item--danger\" (click)=\"ContextMenuDelete()\">\n <i class=\"fa-solid fa-trash\"></i>\n <span>Delete</span>\n </button>\n </div>\n }\n\n <!-- ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n VERSION DIFF DIALOG\n ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ -->\n @if (ShowDiffDialog) {\n <div class=\"fb-diff-backdrop\" (click)=\"CloseDiffDialog()\">\n <div class=\"fb-diff-modal\" (click)=\"$event.stopPropagation()\">\n <header class=\"fb-diff-header\">\n <h3>\n <i class=\"fa-solid fa-code-compare\"></i>\n Compare versions\n </h3>\n <button class=\"fb-diff-close\" type=\"button\" (click)=\"CloseDiffDialog()\" aria-label=\"Close\">\n <i class=\"fa-solid fa-times\"></i>\n </button>\n </header>\n <div class=\"fb-diff-body\">\n <div class=\"fb-diff-pane\">\n <div class=\"fb-diff-pane-label\">\n <span class=\"fb-diff-pane-tag\">A</span>\n <span>v{{ versionByID(DiffSourceVersionID)?.Version }}</span>\n <span class=\"fb-diff-pane-meta\">{{ versionByID(DiffSourceVersionID)?.UpdatedAt | date:'short' }}</span>\n </div>\n <pre class=\"fb-diff-code\">{{ DiffSourceCode }}</pre>\n </div>\n <div class=\"fb-diff-pane\">\n <div class=\"fb-diff-pane-label\">\n <span class=\"fb-diff-pane-tag fb-diff-pane-tag--b\">B</span>\n <span>v{{ versionByID(DiffTargetVersionID)?.Version }}</span>\n <span class=\"fb-diff-pane-meta\">{{ versionByID(DiffTargetVersionID)?.UpdatedAt | date:'short' }}</span>\n </div>\n <pre class=\"fb-diff-code\">{{ DiffTargetCode }}</pre>\n </div>\n </div>\n <footer class=\"fb-diff-footer\">\n <button class=\"btn\" type=\"button\" (click)=\"CloseDiffDialog()\">Close</button>\n </footer>\n </div>\n </div>\n }\n</div>\n"]}
|