function __cfHardenFn(fn: Function) { Object.freeze(fn); const prototype = fn.prototype; if (prototype && typeof prototype === "object") { Object.freeze(prototype); } return fn; } import { __cfHelpers } from "commonfabric"; import { pattern, UI } from "commonfabric"; const define = undefined; const runtimeDeps = undefined; const __cfAmdHooks = undefined; const __cfLift_1 = __cfHelpers.lift<{ state: { task: { done: boolean; }; }; }, boolean>(({ state }) => !state.task.done, { type: "object", properties: { state: { type: "object", properties: { task: { type: "object", properties: { done: { type: "boolean" } }, required: ["done"] } }, required: ["task"] } }, required: ["state"] } as const satisfies __cfHelpers.JSONSchema, { type: "boolean" } as const satisfies __cfHelpers.JSONSchema); const __cfLift_2 = __cfHelpers.lift<{ state: { label?: string | null | undefined; }; }, string>(({ state }) => state.label ?? "Pending", { type: "object", properties: { state: { type: "object", properties: { label: { type: ["null", "string", "undefined"] } } } }, required: ["state"] } as const satisfies __cfHelpers.JSONSchema, { type: "string" } as const satisfies __cfHelpers.JSONSchema); // FIXTURE: jsx-direct-branch-roots // Verifies: direct JSX branch roots lower structurally without leaving raw // child expressions in place. // showCompleted || !task.done ? "Visible" : "" -> nested unless/ifElse path // primary ? "A" : secondary ? "B" : "C" -> nested ternary lowering // primary ? "A" : fallbackLabel || "C" -> nested logical branch lowering // label ?? "Pending" -> top-level JSX nullish lowering export default pattern((state) => ({ [UI]: (
{__cfHelpers.ifElse({ type: "boolean" } as const satisfies __cfHelpers.JSONSchema, { type: "string" } as const satisfies __cfHelpers.JSONSchema, { type: "string" } as const satisfies __cfHelpers.JSONSchema, { "enum": ["", "Visible"] } as const satisfies __cfHelpers.JSONSchema, __cfHelpers.unless({ type: "boolean" } as const satisfies __cfHelpers.JSONSchema, { type: "boolean" } as const satisfies __cfHelpers.JSONSchema, { type: "boolean" } as const satisfies __cfHelpers.JSONSchema, state.key("showCompleted"), __cfLift_1({ state: { task: { done: state.key("task", "done") } } })), "Visible", "")}
{__cfHelpers.ifElse({ type: "boolean" } as const satisfies __cfHelpers.JSONSchema, { type: "string" } as const satisfies __cfHelpers.JSONSchema, { "enum": ["B", "C"] } as const satisfies __cfHelpers.JSONSchema, { "enum": ["B", "C", "A"] } as const satisfies __cfHelpers.JSONSchema, state.key("primary"), "A", __cfHelpers.ifElse({ type: "boolean" } as const satisfies __cfHelpers.JSONSchema, { type: "string" } as const satisfies __cfHelpers.JSONSchema, { type: "string" } as const satisfies __cfHelpers.JSONSchema, { "enum": ["B", "C"] } as const satisfies __cfHelpers.JSONSchema, state.key("secondary"), "B", "C"))}
{__cfHelpers.ifElse({ type: "boolean" } as const satisfies __cfHelpers.JSONSchema, { type: "string" } as const satisfies __cfHelpers.JSONSchema, { type: "string" } as const satisfies __cfHelpers.JSONSchema, { type: "string" } as const satisfies __cfHelpers.JSONSchema, state.key("primary"), "A", __cfHelpers.unless({ type: ["string", "undefined"] } as const satisfies __cfHelpers.JSONSchema, { type: "string" } as const satisfies __cfHelpers.JSONSchema, { type: "string" } as const satisfies __cfHelpers.JSONSchema, state.key("fallbackLabel"), "C"))}
{__cfLift_2({ state: { label: state.key("label") } })}