{"components":{"App":{"visual":{"recipes":{"frame":{"base":{"height":"100dvh","display":"flex","flexDirection":"column","overflow":"hidden","boxSizing":"border-box","background":"{colorCanvasLight}","color":"{colorTextLight}","fontFamily":"{fontBody}","lineHeight":"1.5"},"at":{"dark":{"background":"{colorCanvasDark}","color":"{colorTextDark}"}}}}},"view":{"tag":"div","visual":"frame","children":[{"component":"NotFoundRoute","when":"{{ route.matched == false }}"},{"outlet":"route"}]}},"Logo":{"view":{"tag":"a","href":"/","visual":"brandLogoLink","children":[{"tag":"picture","children":[{"tag":"source","props":{"srcset":"/assets/brand/fl_logo_nav_darkmode.png","media":"(prefers-color-scheme: dark)"}},{"tag":"img","props":{"src":"/assets/brand/fl_logo_nav.png","alt":"","width":"150","height":"33"},"visual":"mark"}]}],"props":{"aria-label":"First Light home"}},"visual":{"recipes":{"mark":{"base":{"display":"block"}}}}},"ChromeRow":{"slots":{"left":{"required":false},"center":{"required":false},"right":{"required":false}},"visual":{"recipes":{"row":{"base":{"display":"flex","minHeight":"4rem","alignItems":"center","gap":"{space3}","borderBottom":"{borderThin} solid {colorBorderLight}","background":"{colorSurfaceLight}","color":"{colorTextLight}","paddingBlock":"{space2}"},"at":{"dark":{"borderBottomColor":"{colorBorderDark}","background":"{colorSurfaceDark}","color":"{colorTextDark}"}}},"region":{"base":{"flex":"1 1 0","minWidth":"0","display":"flex","alignItems":"center","gap":"{space2}"},"state":{"leadingLeft":{"flex":"1 1 auto"},"leadingCenter":{"flex":"0 0 0","overflow":"hidden"},"leadingRight":{"flex":"0 0 auto","marginLeft":"auto"}}},"left":{"base":{"justifyContent":"flex-start"}},"center":{"base":{"justifyContent":"center"}},"right":{"base":{"justifyContent":"flex-end"}}}},"view":{"tag":"div","visual":["surfaceGutter","row"],"children":[{"tag":"div","visual":[{"recipe":"region","states":{"leadingLeft":"{{ props.distribution == 'leading' }}"}},"left"],"children":[{"slot":"left"}]},{"tag":"div","visual":[{"recipe":"region","states":{"leadingCenter":"{{ props.distribution == 'leading' }}"}},"center"],"children":[{"slot":"center"}]},{"tag":"div","visual":[{"recipe":"region","states":{"leadingRight":"{{ props.distribution == 'leading' }}"}},"right"],"children":[{"slot":"right"}]}]},"inputs":{"distribution":{"type":"string","required":false,"default":"equal","enum":["equal","leading"]}}},"BuilderHeader":{"inputs":{"appId":{"type":"string","required":true},"showPublish":{"type":"boolean","required":true},"canPublish":{"type":"boolean","required":true},"publishBusy":{"type":"boolean","required":true},"publishedUrl":{"type":"string","required":true},"publishProblemMessage":{"type":"string","required":true},"appName":{"type":"string","required":true},"renaming":{"type":"boolean","required":true},"renameDraft":{"type":"string","required":true},"renameBusy":{"type":"boolean","required":true},"canSaveRename":{"type":"boolean","required":true},"renameProblemMessage":{"type":"string","required":true},"publishedCurrent":{"type":"boolean","required":true}},"outputs":{"publish":{"payload":{"appId":{"type":"string","required":true}}},"beginRename":{"payload":{"appId":{"type":"string","required":true},"name":{"type":"string","required":true}}},"changeRename":{"payload":{"appId":{"type":"string","required":true},"value":{"type":"string","required":true}}},"saveRename":{"payload":{"appId":{"type":"string","required":true},"name":{"type":"string","required":true}}},"cancelRename":{"payload":{"appId":{"type":"string","required":true}}}},"view":{"component":"ChromeRow","props":{"distribution":"leading"},"slots":{"left":{"component":"SlotCluster","props":{"grow":true},"children":[{"component":"IconLink","props":{"href":"/dashboard","icon":"lucide__X","label":"Back to dashboard"},"when":"{{ !props.renaming || media.sm }}"},{"component":"BuilderAppName","when":"{{ props.appName != '' && !props.renaming }}","props":{"name":"{{ props.appName }}"},"on":{"edit":{"emit":"beginRename","appId":"{{ props.appId }}","name":"{{ props.appName }}"}}},{"tag":"div","when":"{{ props.renaming }}","visual":"renameEditor","children":[{"tag":"input","visual":[{"recipe":"textInput","states":{"disabled":"{{ props.renameBusy }}","compact":"{{ true }}"}},"zRenameInput"],"props":{"type":"text","name":"app-name","aria-label":"App name","value":"{{ props.renameDraft }}","disabled":"{{ props.renameBusy }}"},"on":{"input":{"emit":"changeRename","appId":"{{ props.appId }}","value":"{{ event.value }}"}}},{"component":"SlotCluster","children":[{"component":"Button","props":{"label":"Save","treatment":"primary","size":"small","disabled":"{{ !props.canSaveRename }}","busy":"{{ props.renameBusy }}"},"on":{"press":{"emit":"saveRename","appId":"{{ props.appId }}","name":"{{ trim(props.renameDraft) }}"}}},{"component":"Button","props":{"label":"Cancel","treatment":"plain","size":"small","disabled":"{{ props.renameBusy }}"},"on":{"press":{"emit":"cancelRename","appId":"{{ props.appId }}"}}}]},{"component":"AsyncStatus","when":"{{ props.renameProblemMessage != '' }}","visual":"renameProblem","props":{"kind":"error","message":"{{ props.renameProblemMessage }}"}}]}]},"right":{"component":"SlotCluster","children":[{"component":"Button","when":"{{ (props.showPublish || props.publishedCurrent) && !props.renaming }}","props":{"label":"{{ props.publishBusy ? 'Publishing…' : props.publishedCurrent ? 'Published' : 'Publish' }}","treatment":"primary","disabled":"{{ !props.canPublish }}","busy":"{{ props.publishBusy }}"},"on":{"press":{"emit":"publish","appId":"{{ props.appId }}"}}},{"component":"IconLink","when":"{{ props.publishedUrl != '' && !props.renaming }}","props":{"href":"{{ props.publishedUrl }}","icon":"lucide__ExternalLink","label":"View published app"}},{"component":"AsyncStatus","when":"{{ props.publishProblemMessage != '' && !props.renaming }}","props":{"kind":"error","message":"{{ props.publishProblemMessage }}"}}]}}},"visual":{"recipes":{"renameEditor":{"base":{"minWidth":"0","flex":"1 1 16rem","display":"flex","alignItems":"center","flexWrap":"wrap","gap":"{space2}"}},"zRenameInput":{"base":{"width":"auto","minWidth":"8rem","flex":"1 1 10rem"}},"renameProblem":{"base":{"flex":"1 0 100%"}}}}},"BuilderRoute":{"inputs":{"appId":{"type":"string","required":true}},"view":{"tag":"section","children":[{"component":"AsyncStatus","fallback":true,"props":{"kind":"error","message":"{{ problem.message }}"}},{"component":"BuilderPreviewStage","when":"{{ selectedAppWorkspace.id == props.appId && selectedAppWorkspace.app.source.revision != '' }}","children":[{"component":"BuilderAppPreview","props":{"appId":"{{ props.appId }}","revision":"{{ selectedAppWorkspace.app.source.revision }}"}}]},{"component":"AsyncStatus","when":"{{ selectedAppWorkspace.id == props.appId && selectedAppWorkspace.app.source.revision == '' }}","props":{"kind":"notFound","message":"Preview unavailable."}}],"visual":["routeOwner","routeFill"]}},"DashboardRoute":{"view":{"tag":"section","children":[{"component":"SplitRow","slots":{"left":{"tag":"h1","text":"Dashboard"},"right":{"component":"Button","props":{"label":"{{ fx.createBlankApp.busy ? 'Creating app…' : fx.createBlankApp.ok && findBy(accountApps, 'id', fx.createBlankApp.result.appId) == null ? 'Opening app…' : 'New app' }}","treatment":"primary","disabled":"{{ fx.createBlankApp.busy || (fx.createBlankApp.ok && findBy(accountApps, 'id', fx.createBlankApp.result.appId) == null) }}","busy":"{{ fx.createBlankApp.busy || (fx.createBlankApp.ok && findBy(accountApps, 'id', fx.createBlankApp.result.appId) == null) }}"},"on":{"press":{"call":"createBlankApp","when":"{{ !fx.createBlankApp.busy && !(fx.createBlankApp.ok && findBy(accountApps, 'id', fx.createBlankApp.result.appId) == null) }}","name":"Untitled app"}}}}},{"component":"AsyncStatus","when":"{{ fx.createBlankApp.problem }}","props":{"kind":"error","message":"{{ fx.createBlankApp.problem.message }}"}},{"component":"AppCatalog"}],"visual":"pageContent"}},"OverlayHeader":{"inputs":{"showClose":{"type":"boolean","required":false,"default":true}},"outputs":{"close":{"payload":{}}},"view":{"component":"ChromeRow","slots":{"right":{"component":"IconButton","when":"{{ props.showClose }}","props":{"icon":"lucide__X","label":"Close"},"on":{"press":{"emit":"close"}}}}}},"SignInRoute":{"view":{"tag":"div","visual":"centeredPageContent","children":[{"tag":"section","visual":"signInPage","props":{"aria-label":"Member access"},"children":[{"component":"SignInFlow","id":"signInFlow"},{"tag":"div","when":"{{ state.user.status == 'signedIn' && route.query.templateId == null }}","use":[{"behavior":"delay","ms":0,"action":{"call":"navigate","to":"/dashboard","replace":true}}]},{"tag":"div","when":"{{ state.user.status == 'signedIn' && route.query.templateId != null }}","use":[{"behavior":"delay","ms":0,"action":{"call":"navigate","to":"/templates/{{ route.query.templateId }}","replace":true}}]}]}]}},"BuilderShell":{"inputs":{"appId":{"type":"string","required":true}},"slots":{"default":{"required":true}},"view":{"tag":"div","visual":"routeGate","children":[{"component":"FixedShell","when":"{{ state.user.status == 'loading' }}","props":{"header":"GuestHeader"},"children":[{"tag":"div","visual":"centeredPageContent","children":[{"component":"AsyncStatus","props":{"kind":"loading","message":"Checking your session…"}}]}]},{"component":"FixedShell","when":"{{ state.user.status == 'signedOut' }}","props":{"header":"GuestHeader"},"children":[{"tag":"div","visual":"centeredPageContent","children":[{"component":"AsyncStatus","props":{"kind":"loading","message":"Opening home…"}}],"use":[{"behavior":"delay","ms":0,"action":{"call":"navigate","to":"/","replace":true}}]}]},{"tag":"div","when":"{{ state.user.status == 'signedIn' }}","visual":"routeGate","children":[{"tag":"div","children":[{"component":"PageShell","fallback":true,"props":{"header":"GuestHeader"},"children":[{"tag":"div","visual":"centeredPageContent","children":[{"component":"AsyncStatus","props":{"kind":"error","message":"App unavailable."}}]}]},{"component":"PageShell","when":"{{ !fx.appWorkspace.ok && fx.appWorkspace.status != 'problem' && selectedAppWorkspace.id != props.appId }}","props":{"header":"GuestHeader"},"children":[{"tag":"div","visual":"centeredPageContent","children":[{"component":"AsyncStatus","props":{"kind":"loading","message":"Loading app…"}}]}]},{"component":"PageShell","when":"{{ (fx.appWorkspace.ok || fx.appWorkspace.status == 'problem') && selectedAppWorkspace.id != props.appId }}","props":{"header":"GuestHeader"},"children":[{"tag":"div","visual":"centeredPageContent","children":[{"component":"AsyncStatus","props":{"kind":"notFound","message":"App unavailable."}}]}]}]},{"component":"BuilderWorkspaceShell","when":"{{ selectedAppWorkspace.id == props.appId }}","props":{"appId":"{{ props.appId }}"},"children":[{"slot":"default"}]}]},{"tag":"div","visual":"toastRegion","props":{"role":"status","aria-live":"polite","aria-atomic":"false"},"children":[{"tag":"div","repeat":{"items":"{{ okNotifications }}","as":"note","key":"id"},"children":[{"component":"Toast","props":{"message":"{{ note.message }}"},"on":{"dismiss":{"call":"notifications.dismiss","value":"{{ note.id }}"}}}]}]}]},"visual":{"recipes":{}}},"ControlContent":{"inputs":{"icon":{"type":"component","required":false},"text":{"type":"string","required":true},"textVisibility":{"type":"string","required":false,"default":"visible","enum":["none","visible","desktop"]}},"view":{"tag":"span","visual":"controlContent","children":[{"component":"{{ props.icon }}","when":"{{ props.icon != null }}"},{"tag":"span","when":"{{ props.textVisibility != 'none' }}","visual":{"recipe":"controlCompanionDesktop","when":"{{ props.textVisibility == 'desktop' }}"},"text":"{{ props.text }}"}]}},"Button":{"inputs":{"label":{"type":"string","required":true},"treatment":{"type":"string","required":false,"default":"secondary","enum":["primary","secondary","plain"]},"size":{"type":"string","required":false,"default":"medium","enum":["small","medium","large"]},"type":{"type":"string","required":false,"default":"button","enum":["button","submit"]},"disabled":{"type":"boolean","required":false,"default":false},"busy":{"type":"boolean","required":false,"default":false},"icon":{"type":"component","required":false},"form":{"type":"string","required":false,"default":""}},"outputs":{"press":{"payload":{}}},"view":{"tag":"button","visual":[{"recipe":"controlBase","states":{"disabled":"{{ props.disabled }}","busy":"{{ props.busy }}"}},{"recipe":"controlPrimary","when":"{{ props.treatment == 'primary' }}"},{"recipe":"controlSecondary","when":"{{ props.treatment == 'secondary' }}"},{"recipe":"controlPlain","when":"{{ props.treatment == 'plain' }}"},{"recipe":"controlSmall","when":"{{ props.size == 'small' }}"},{"recipe":"controlMedium","when":"{{ props.size == 'medium' }}"},{"recipe":"controlLarge","when":"{{ props.size == 'large' }}"}],"props":{"type":"{{ props.type }}","disabled":"{{ props.disabled }}","aria-busy":"{{ props.busy }}","form":"{{ props.form != '' ? props.form : null }}"},"on":{"click":{"emit":"press"}},"children":[{"component":"ControlContent","props":{"text":"{{ props.label }}","icon":"{{ props.icon }}"}}]}},"Link":{"inputs":{"href":{"type":"string","required":true},"label":{"type":"string","required":true},"icon":{"type":"component","required":false},"treatment":{"type":"string","required":false,"default":"plain","enum":["primary","secondary","plain"]},"size":{"type":"string","required":false,"default":"medium","enum":["small","medium","large"]},"current":{"type":"boolean","required":false,"default":false}},"view":{"tag":"a","href":"{{ props.href }}","visual":[{"recipe":"controlBase","states":{"current":"{{ props.current }}"}},{"recipe":"controlPrimary","when":"{{ props.treatment == 'primary' }}"},{"recipe":"controlSecondary","when":"{{ props.treatment == 'secondary' }}"},{"recipe":"controlPlain","when":"{{ props.treatment == 'plain' }}"},{"recipe":"controlSmall","when":"{{ props.size == 'small' }}"},{"recipe":"controlMedium","when":"{{ props.size == 'medium' }}"},{"recipe":"controlLarge","when":"{{ props.size == 'large' }}"}],"children":[{"component":"ControlContent","props":{"icon":"{{ props.icon }}","text":"{{ props.label }}"}}],"props":{"aria-current":"{{ props.current ? 'page' : false }}"},"on":{"click":{"emit":"select"}}},"outputs":{"select":{"payload":{}}}},"IconButton":{"inputs":{"icon":{"type":"component","required":true},"label":{"type":"string","required":true},"companion":{"type":"string","required":false,"default":"none","enum":["none","visible","desktop"]},"treatment":{"type":"string","required":false,"default":"plain","enum":["primary","secondary","plain"]},"size":{"type":"string","required":false,"default":"medium","enum":["small","medium","large"]},"disabled":{"type":"boolean","required":false,"default":false},"busy":{"type":"boolean","required":false,"default":false},"controls":{"type":"string","required":false,"default":""},"expanded":{"type":"boolean","required":false,"default":false}},"outputs":{"press":{"payload":{}}},"view":{"tag":"button","visual":[{"recipe":"controlBase","states":{"disabled":"{{ props.disabled }}","busy":"{{ props.busy }}","expanded":"{{ props.expanded }}"}},{"recipe":"controlPrimary","when":"{{ props.treatment == 'primary' }}"},{"recipe":"controlSecondary","when":"{{ props.treatment == 'secondary' }}"},{"recipe":"controlPlain","when":"{{ props.treatment == 'plain' }}"},{"recipe":"controlSmall","when":"{{ props.size == 'small' }}"},{"recipe":"controlMedium","when":"{{ props.size == 'medium' }}"},{"recipe":"controlLarge","when":"{{ props.size == 'large' }}"}],"props":{"type":"button","aria-label":"{{ props.label }}","disabled":"{{ props.disabled }}","aria-busy":"{{ props.busy }}","aria-controls":"{{ props.controls != '' ? props.controls : null }}","aria-expanded":"{{ props.controls != '' ? (props.expanded ? 'true' : 'false') : null }}"},"on":{"click":{"emit":"press"}},"children":[{"component":"ControlContent","props":{"icon":"{{ props.icon }}","text":"{{ props.label }}","textVisibility":"{{ props.companion }}"}}]}},"IconLink":{"inputs":{"href":{"type":"string","required":true},"icon":{"type":"component","required":true},"label":{"type":"string","required":true},"companion":{"type":"string","required":false,"default":"none","enum":["none","visible","desktop"]},"treatment":{"type":"string","required":false,"default":"plain","enum":["primary","secondary","plain"]},"size":{"type":"string","required":false,"default":"medium","enum":["small","medium","large"]}},"view":{"tag":"a","href":"{{ props.href }}","visual":["controlBase",{"recipe":"controlPrimary","when":"{{ props.treatment == 'primary' }}"},{"recipe":"controlSecondary","when":"{{ props.treatment == 'secondary' }}"},{"recipe":"controlPlain","when":"{{ props.treatment == 'plain' }}"},{"recipe":"controlSmall","when":"{{ props.size == 'small' }}"},{"recipe":"controlMedium","when":"{{ props.size == 'medium' }}"},{"recipe":"controlLarge","when":"{{ props.size == 'large' }}"}],"props":{"aria-label":"{{ props.label }}"},"children":[{"component":"ControlContent","props":{"icon":"{{ props.icon }}","text":"{{ props.label }}","textVisibility":"{{ props.companion }}"}}]}},"LegalNavigation":{"view":{"tag":"nav","visual":"legalNavigation","props":{"aria-label":"Legal"},"children":[{"component":"Link","props":{"href":"/privacy","label":"Privacy"}},{"component":"Link","props":{"href":"/terms","label":"Terms"}}]}},"GuestFooter":{"view":{"component":"ChromeRow","visual":"guestFooter","slots":{"center":{"component":"LegalNavigation"}}}},"PrivacyRoute":{"view":{"tag":"section","visual":"pageContent","children":[{"tag":"h1","text":"Privacy"}]}},"TermsRoute":{"view":{"tag":"section","visual":"pageContent","children":[{"tag":"h1","text":"Terms"}]}},"GuestHeader":{"view":{"component":"ChromeRow","slots":{"center":{"component":"Logo"}}}},"TemplatesRoute":{"view":{"tag":"section","visual":"pageContent","children":[{"tag":"h1","text":"Templates"},{"component":"TemplateCatalog"}]}},"NavigationItem":{"inputs":{"destination":{"type":"string","required":true},"label":{"type":"string","required":true},"icon":{"type":"component","required":false},"current":{"type":"boolean","required":false,"default":false}},"view":{"tag":"li","visual":"navigationItem","children":[{"component":"Link","visual":"navigationItemContent","props":{"href":"{{ props.destination }}","label":"{{ props.label }}","icon":"{{ props.icon }}","current":"{{ props.current }}"},"on":{"select":{"emit":"select"}}}]},"outputs":{"select":{"payload":{}}}},"PlatformNavigation":{"outputs":{"dismiss":{"payload":{}}},"view":{"tag":"nav","visual":"platformNavigation","props":{"aria-label":"Platform"},"children":[{"component":"NavigationList","children":[{"component":"NavigationItem","props":{"destination":"/","label":"Home","icon":"lucide__House","current":"{{ route.name == 'home' }}"},"on":{"select":{"emit":"dismiss"}}},{"component":"NavigationItem","props":{"destination":"/templates","label":"Templates","icon":"lucide__LayoutGrid","current":"{{ route.name == 'templates' }}"},"on":{"select":{"emit":"dismiss"}}}]},{"component":"Divider","when":"{{ state.user.status != 'loading' }}"},{"component":"NavigationList","when":"{{ state.user.status != 'loading' }}","children":[{"component":"NavigationItem","when":"{{ state.user.status == 'signedOut' }}","props":{"destination":"/sign-in","label":"Sign in","icon":"lucide__LogIn","current":"{{ route.name == 'signIn' }}"},"on":{"select":{"emit":"dismiss"}}},{"component":"NavigationItem","when":"{{ state.user.status == 'signedIn' }}","props":{"destination":"/dashboard","label":"Dashboard","icon":"lucide__LayoutDashboard","current":"{{ route.name == 'dashboard' }}"},"on":{"select":{"emit":"dismiss"}}},{"component":"NavigationItem","when":"{{ state.user.status == 'signedIn' }}","props":{"destination":"/dashboard/settings","label":"Settings","icon":"lucide__Cog","current":"{{ route.name == 'settings' }}"},"on":{"select":{"emit":"dismiss"}}},{"component":"NavigationActionItem","when":"{{ state.user.status == 'signedIn' }}","props":{"label":"Sign out","icon":"lucide__LogOut","disabled":"{{ fx.auth.signOut.busy }}","busy":"{{ fx.auth.signOut.busy }}"},"on":{"activate":[{"emit":"dismiss","when":"{{ !fx.auth.signOut.busy }}"},{"call":"auth.signOut","when":"{{ !fx.auth.signOut.busy }}"}]}}]},{"component":"AsyncStatus","when":"{{ state.user.status == 'signedIn' && fx.auth.signOut.busy }}","props":{"kind":"loading","message":"Signing out…"}},{"component":"AsyncStatus","when":"{{ state.user.status == 'signedIn' && fx.auth.signOut.problem }}","props":{"kind":"error","message":"{{ fx.auth.signOut.problem.message }}"}}]}},"TemplateDetailRoute":{"inputs":{"templateId":{"type":"string","required":true}},"state":{},"computed":{"selectedTemplateMatches":"{{ selectedPublicTemplate.id == props.templateId }}"},"view":{"tag":"section","visual":["pageContent","templateDetail"],"children":[{"component":"AsyncStatus","fallback":true,"props":{"kind":"error","message":"Template unavailable."}},{"component":"AsyncStatus","when":"{{ !fx.publicCatalog.ok && count(state.publicCatalog) == 0 }}","props":{"kind":"loading","message":"Loading template…"}},{"component":"AsyncStatus","when":"{{ (fx.publicCatalog.ok || count(publicTemplates) > 0) && !local.selectedTemplateMatches }}","props":{"kind":"notFound","message":"Template not found."}},{"component":"AppPreview","when":"{{ local.selectedTemplateMatches }}","props":{"name":"{{ selectedPublicTemplateName }}","screenshotUrl":"{{ selectedPublicTemplateScreenshotUrl }}"}},{"tag":"h1","when":"{{ local.selectedTemplateMatches }}","text":"{{ selectedPublicTemplateName }}"},{"tag":"div","when":"{{ local.selectedTemplateMatches }}","children":[{"component":"Link","when":"{{ state.user.status == 'signedOut' }}","props":{"href":"/sign-in?templateId={{ props.templateId }}","label":"Sign in to use template","treatment":"primary"}},{"component":"Button","when":"{{ state.user.status == 'signedIn' }}","props":{"label":"{{ fx.createAppFromTemplate[props.templateId].busy ? 'Creating app…' : fx.createAppFromTemplate[props.templateId].ok && findBy(accountApps, 'id', fx.createAppFromTemplate[props.templateId].result.appId) == null ? 'Opening app…' : 'Use template' }}","treatment":"primary","disabled":"{{ fx.createAppFromTemplate[props.templateId].busy || (fx.createAppFromTemplate[props.templateId].ok && findBy(accountApps, 'id', fx.createAppFromTemplate[props.templateId].result.appId) == null) }}","busy":"{{ fx.createAppFromTemplate[props.templateId].busy || (fx.createAppFromTemplate[props.templateId].ok && findBy(accountApps, 'id', fx.createAppFromTemplate[props.templateId].result.appId) == null) }}"},"on":{"press":[{"op":"set","path":"templateAppRequest","value":"{{ props.templateId }}","when":"{{ !fx.createAppFromTemplate[props.templateId].busy && !(fx.createAppFromTemplate[props.templateId].ok && findBy(accountApps, 'id', fx.createAppFromTemplate[props.templateId].result.appId) == null) }}"},{"call":"createAppFromTemplate","key":"{{ props.templateId }}","when":"{{ !fx.createAppFromTemplate[props.templateId].busy && !(fx.createAppFromTemplate[props.templateId].ok && findBy(accountApps, 'id', fx.createAppFromTemplate[props.templateId].result.appId) == null) }}","name":"{{ selectedPublicTemplateName }}","templateId":"{{ props.templateId }}"}]}},{"component":"AsyncStatus","when":"{{ state.user.status == 'signedIn' && fx.createAppFromTemplate[props.templateId].problem }}","props":{"kind":"error","message":"{{ fx.createAppFromTemplate[props.templateId].problem.message }}"}}]}]}},"PublicBrowsingShell":{"slots":{"default":{"required":true}},"view":{"component":"NavigationPageShell","props":{"footer":"GuestFooter"},"children":[{"slot":"default"}]}},"HomeRoute":{"view":{"tag":"section","children":[{"tag":"h1","text":"Home"}],"visual":"pageContent"}},"CollectionGrid":{"slots":{"default":{"required":true}},"view":{"tag":"ul","visual":"collectionGrid","children":[{"slot":"default"}]}},"CollectionItem":{"slots":{"default":{"required":true}},"view":{"tag":"li","visual":"collectionItem","children":[{"slot":"default"}]}},"AppPreview":{"inputs":{"name":{"type":"string","required":true},"screenshotUrl":{"type":"string","required":false},"width":{"type":"integer","required":false},"height":{"type":"integer","required":false},"loading":{"type":"string","required":false,"enum":["eager","lazy"]},"decoding":{"type":"string","required":false,"enum":["sync","async","auto"]}},"view":{"tag":"div","visual":"appPreview","children":[{"tag":"img","when":"{{ props.screenshotUrl != null && props.screenshotUrl != '' }}","visual":"appPreviewMedia","props":{"src":"{{ props.screenshotUrl }}","alt":"Preview of {{ props.name }}","width":"{{ props.width }}","height":"{{ props.height }}","loading":"{{ props.loading }}","decoding":"{{ props.decoding }}"}},{"tag":"div","when":"{{ props.screenshotUrl == null || props.screenshotUrl == '' }}","visual":"appPreviewFallback","props":{"aria-hidden":"true"}}]}},"TemplateCatalogItem":{"inputs":{"id":{"type":"string","required":true},"name":{"type":"string","required":true},"screenshots":{"type":"array","required":true,"items":{"type":"object","members":{"url":"string"}}}},"view":{"component":"CollectionItem","children":[{"component":"AppPreview","props":{"name":"{{ props.name }}","screenshotUrl":"{{ props.screenshots[0].url }}"}},{"component":"Link","props":{"href":"/templates/{{ props.id }}","label":"{{ props.name }}"}}]}},"TemplateCatalog":{"view":{"tag":"section","visual":"catalogStack","children":[{"component":"AsyncStatus","fallback":true,"props":{"kind":"error","message":"Templates unavailable."}},{"component":"AsyncStatus","when":"{{ !fx.publicCatalog.ok && count(state.publicCatalog) == 0 }}","props":{"kind":"loading","message":"Loading templates…"}},{"component":"AsyncStatus","when":"{{ fx.publicCatalog.ok && count(publicTemplates) == 0 }}","props":{"kind":"empty","message":"No templates."}},{"component":"CollectionGrid","when":"{{ count(publicTemplates) > 0 }}","children":[{"component":"TemplateCatalogItem","repeat":{"items":"{{ publicTemplates }}","as":"template","key":"id"},"props":{"id":"{{ template.id }}","name":"{{ template.name }}","screenshots":"{{ template.screenshots }}"}}]}]}},"LoadingIndicator":{"view":{"tag":"span","visual":"loadingIndicator","props":{"aria-hidden":"true"},"text":"…"}},"AsyncStatus":{"inputs":{"kind":{"type":"string","required":true,"enum":["loading","empty","error","notFound","success"]},"message":{"type":"string","required":true}},"view":{"tag":"div","visual":{"recipe":"asyncStatus","states":{"loading":"{{ props.kind == 'loading' }}","error":"{{ props.kind == 'error' }}","success":"{{ props.kind == 'success' }}"}},"props":{"role":"{{ props.kind == 'error' ? 'alert' : 'status' }}","aria-live":"{{ props.kind == 'error' ? 'assertive' : 'polite' }}","aria-busy":"{{ props.kind == 'loading' }}"},"children":[{"component":"LoadingIndicator","when":"{{ props.kind == 'loading' }}"},{"tag":"span","text":"{{ props.message }}"}]}},"SettingsRoute":{"state":{"billingDialogOpen":false},"computed":{"billingReturnActive":"{{ (route.query.billing == 'card-return' && route.query.setup_intent != null) || route.query.billing == 'payment-return' }}"},"view":{"tag":"section","visual":"pageContent","children":[{"tag":"h1","text":"Settings"},{"component":"SettingsSection","props":{"title":"Billing"},"children":[{"component":"BillingSettings","on":{"addCredits":{"op":"set","path":"local.billingDialogOpen","value":true}}}]},{"component":"AddCreditsDialog","when":"{{ local.billingDialogOpen || local.billingReturnActive }}","props":{"cardReturnUrl":"{{ route.origin }}/dashboard/settings?billing=card-return","paymentReturnUrl":"{{ route.origin }}/dashboard/settings?billing=payment-return"},"on":{"close":[{"op":"set","when":"{{ !local.billingReturnActive }}","path":"local.billingDialogOpen","value":false},{"call":"navigate","when":"{{ local.billingReturnActive }}","to":"/dashboard/settings","replace":true}]},"id":"addCreditsDialog"}]}},"PlatformHeader":{"inputs":{"panelOpen":{"type":"boolean","required":true}},"outputs":{"togglePanel":{"payload":{}}},"view":{"component":"ChromeRow","slots":{"left":{"component":"Logo"},"right":[{"component":"Link","when":"{{ state.user.status == 'signedOut' }}","props":{"href":"/sign-in","label":"Sign in"}},{"component":"Link","when":"{{ state.user.status == 'signedIn' }}","props":{"href":"/dashboard","label":"Dashboard"}},{"component":"IconButton","props":{"icon":"lucide__Menu","label":"{{ props.panelOpen ? 'Close navigation' : 'Open navigation' }}","controls":"navigation-panel","expanded":"{{ props.panelOpen }}"},"on":{"press":{"emit":"togglePanel"}},"visual":{"recipe":"concealedControl","when":"{{ props.panelOpen && !media.lg }}"}}]}}},"DashboardShell":{"slots":{"default":{"required":true}},"view":{"tag":"div","visual":"routeGate","children":[{"component":"FixedShell","when":"{{ state.user.status == 'loading' }}","props":{"header":"GuestHeader"},"children":[{"tag":"div","visual":"centeredPageContent","children":[{"component":"AsyncStatus","props":{"kind":"loading","message":"Checking your session…"}}]}]},{"component":"FixedShell","when":"{{ state.user.status == 'signedOut' }}","props":{"header":"GuestHeader"},"children":[{"tag":"div","visual":"centeredPageContent","children":[{"component":"AsyncStatus","props":{"kind":"loading","message":"Opening home…"}}],"use":[{"behavior":"delay","ms":0,"action":{"call":"navigate","to":"/","replace":true}}]}]},{"component":"NavigationPageShell","when":"{{ state.user.status == 'signedIn' }}","children":[{"slot":"default"}]},{"tag":"div","visual":"toastRegion","props":{"role":"status","aria-live":"polite","aria-atomic":"false"},"children":[{"tag":"div","repeat":{"items":"{{ okNotifications }}","as":"note","key":"id"},"children":[{"component":"Toast","props":{"message":"{{ note.message }}"},"on":{"dismiss":{"call":"notifications.dismiss","value":"{{ note.id }}"}}}]}]}]},"visual":{"recipes":{}}},"AppCatalogItem":{"inputs":{"id":{"type":"string","required":true},"name":{"type":"string","required":false},"thumbnailUrl":{"type":"string","required":false},"previewWidth":{"type":"integer","required":false,"default":768}},"view":{"component":"CollectionItem","children":[{"component":"AppPreview","props":{"name":"{{ props.name ?? props.id }}","screenshotUrl":"{{ tenant_media__imageUrl(props.thumbnailUrl, props.previewWidth) }}","width":"{{ props.previewWidth }}","height":480,"loading":"lazy","decoding":"async"}},{"component":"Link","props":{"href":"/app/{{ props.id }}","label":"{{ props.name ?? props.id }}"}}]}},"AppCatalog":{"view":{"tag":"section","visual":"catalogStack","children":[{"component":"AsyncStatus","fallback":true,"props":{"kind":"error","message":"Apps unavailable."}},{"component":"AsyncStatus","when":"{{ !fx.accountPortfolio.ok && count(state.accountPortfolio) == 0 }}","props":{"kind":"loading","message":"Loading apps…"}},{"component":"EmptyState","when":"{{ fx.accountPortfolio.ok && count(accountApps) == 0 }}","props":{"title":"No apps yet"},"slots":{"action":{"component":"Link","props":{"href":"/templates","label":"Browse templates"}}}},{"component":"CollectionGrid","when":"{{ count(accountApps) > 0 }}","children":[{"component":"AppCatalogItem","repeat":{"items":"{{ accountApps }}","as":"app","key":"id"},"props":{"id":"{{ app.id }}","name":"{{ app.name }}","thumbnailUrl":"{{ app.thumbnailUrl }}"}}]}]}},"Field":{"inputs":{"id":{"type":"string","required":true},"label":{"type":"string","required":true}},"slots":{"default":{"required":true}},"view":{"tag":"div","visual":"field","children":[{"tag":"label","visual":"fieldLabel","props":{"for":"{{ props.id }}"},"text":"{{ props.label }}"},{"slot":"default","provides":{"controlId":{"from":"props.id"}}}]}},"TextInput":{"inputs":{"id":{"type":"string","required":true},"name":{"type":"string","required":true},"type":{"type":"string","required":true,"enum":["email","text","password"]},"autocomplete":{"type":"string","required":true,"enum":["email","one-time-code","off"]},"value":{"type":"string","required":true},"required":{"type":"boolean","required":false,"default":false},"inputMode":{"type":"string","required":false,"default":"text","enum":["text","numeric"]},"describedBy":{"type":"string","required":false,"default":""},"disabled":{"type":"boolean","required":false,"default":false},"invalid":{"type":"boolean","required":false,"default":false}},"outputs":{"change":{"payload":{"value":{"type":"string","required":true}}}},"view":{"tag":"input","visual":{"recipe":"textInput","states":{"disabled":"{{ props.disabled }}"}},"props":{"id":"{{ props.id }}","name":"{{ props.name }}","type":"{{ props.type }}","autocomplete":"{{ props.autocomplete }}","value":"{{ props.value }}","required":"{{ props.required }}","inputmode":"{{ props.inputMode }}","aria-describedby":"{{ props.describedBy != '' ? props.describedBy : null }}","disabled":"{{ props.disabled }}","aria-invalid":"{{ props.invalid }}"},"on":{"input":{"emit":"change","value":"{{ event.value }}"}}}},"SignInForm":{"inputs":{"busy":{"type":"boolean","required":true},"submitLabel":{"type":"string","required":true}},"outputs":{"request":{"payload":{"email":{"type":"string","required":true}}}},"state":{"emailDraft":""},"view":{"tag":"form","visual":"signInForm","on":{"submit":{"emit":"request","email":"{{ local.emailDraft }}","when":"{{ !props.busy && local.emailDraft != '' }}"}},"children":[{"component":"Field","props":{"id":"auth-email","label":"Email address"},"slots":{"default":{"component":"TextInput","props":{"id":"{{ slot.controlId }}","name":"email","type":"email","autocomplete":"email","value":"{{ local.emailDraft }}","required":true,"disabled":"{{ props.busy }}"},"on":{"change":{"op":"set","path":"local.emailDraft","value":"{{ event.value }}"}}}}},{"tag":"div","visual":"formActions","children":[{"component":"Button","props":{"label":"{{ props.submitLabel }}","treatment":"primary","type":"submit","disabled":"{{ props.busy || local.emailDraft == '' }}","busy":"{{ props.busy }}"}}]}]}},"NavigationList":{"slots":{"default":{"required":true}},"view":{"tag":"ul","visual":"navigationList","children":[{"slot":"default"}]}},"Divider":{"view":{"tag":"hr","visual":"divider"}},"NavigationActionItem":{"inputs":{"label":{"type":"string","required":true},"icon":{"type":"component","required":false},"disabled":{"type":"boolean","required":false,"default":false},"busy":{"type":"boolean","required":false,"default":false}},"outputs":{"activate":{"payload":{}}},"view":{"tag":"li","visual":"navigationItem","children":[{"component":"Button","visual":"navigationItemContent","props":{"label":"{{ props.label }}","icon":"{{ props.icon }}","treatment":"plain","disabled":"{{ props.disabled }}","busy":"{{ props.busy }}"},"on":{"press":{"emit":"activate"}}}]}},"EmptyState":{"inputs":{"title":{"type":"string","required":false},"message":{"type":"string","required":false}},"slots":{"action":{"required":false}},"view":{"tag":"div","visual":"emptyState","children":[{"tag":"h2","when":"{{ props.title != null }}","text":"{{ props.title }}"},{"tag":"p","when":"{{ props.message != null }}","text":"{{ props.message }}"},{"slot":"action"}]}},"SignInFlow":{"state":{"codeDraft":""},"computed":{"correctableCodeProblem":"{{ fx.auth.confirmCode.problem && fx.auth.confirmCode.problem.retry == 'after-correction' }}","retiredChallenge":"{{ state.user.status == 'signedOut' && state.user.pending && fx.auth.confirmCode.problem && fx.auth.confirmCode.problem.retry != 'after-correction' }}"},"view":{"tag":"section","props":{"aria-label":"Sign in"},"children":[{"component":"AsyncStatus","when":"{{ state.user.status == 'loading' }}","props":{"kind":"loading","message":"Checking your session…"}},{"component":"SignInForm","id":"signInEmailForm","when":"{{ state.user.status == 'signedOut' && !state.user.pending }}","props":{"busy":"{{ fx.auth.requestCode.busy }}","submitLabel":"{{ fx.auth.requestCode.busy ? 'Sending code…' : 'Email me a code' }}"},"on":{"request":{"call":"auth.requestCode","when":"{{ !fx.auth.requestCode.busy }}","value":{"email":"{{ event.email }}"}}}},{"component":"AsyncStatus","when":"{{ state.user.status == 'signedOut' && !state.user.pending && fx.auth.requestCode.problem }}","props":{"kind":"error","message":"{{ fx.auth.requestCode.problem.message }}"}},{"tag":"div","when":"{{ state.user.status == 'signedOut' && state.user.pending }}","children":[{"component":"AsyncStatus","props":{"kind":"success","message":"Check your email for the newest one-time code."}},{"component":"AsyncStatus","when":"{{ state.user.pending.localCode != null }}","props":{"kind":"success","message":"Local development code: {{ state.user.pending.localCode }}"}},{"tag":"form","when":"{{ !local.retiredChallenge }}","visual":"signInForm","props":{"aria-label":"Confirm one-time code"},"on":{"submit":{"call":"auth.confirmCode","when":"{{ !fx.auth.confirmCode.busy && trim(local.codeDraft) != '' }}","value":{"code":"{{ trim(local.codeDraft) }}"},"onSuccess":{"op":"set","path":"local.codeDraft","value":""}}},"children":[{"component":"Field","props":{"id":"auth-code","label":"One-time code"},"slots":{"default":{"component":"TextInput","props":{"id":"{{ slot.controlId }}","name":"code","type":"text","autocomplete":"one-time-code","inputMode":"numeric","describedBy":"auth-code-status","value":"{{ local.codeDraft }}","required":true,"disabled":"{{ fx.auth.confirmCode.busy }}","invalid":"{{ local.correctableCodeProblem }}"},"on":{"change":{"op":"set","path":"local.codeDraft","value":"{{ event.value }}"}}}}},{"tag":"div","visual":"formActions","children":[{"component":"Button","props":{"label":"{{ fx.auth.confirmCode.busy ? 'Checking code…' : 'Continue' }}","treatment":"primary","type":"submit","disabled":"{{ fx.auth.confirmCode.busy || trim(local.codeDraft) == '' }}","busy":"{{ fx.auth.confirmCode.busy }}"}}]}]},{"component":"AsyncStatus","when":"{{ fx.auth.confirmCode.problem }}","props":{"kind":"error","message":"{{ local.correctableCodeProblem ? fx.auth.confirmCode.problem.message : 'That sign-in code can no longer be used. Reset and request a fresh code.' }}"}},{"tag":"span","props":{"id":"auth-code-status"},"text":"{{ local.correctableCodeProblem ? 'Check the code and try again.' : 'Enter the newest code sent to ' + state.user.pending.email + '.' }}","visual":"formHint"},{"tag":"div","visual":"formActions","children":[{"component":"Button","props":{"label":"{{ fx.auth.signOut.busy ? 'Resetting…' : 'Reset sign in' }}","treatment":"plain","disabled":"{{ fx.auth.signOut.busy }}","busy":"{{ fx.auth.signOut.busy }}"},"on":{"press":{"call":"auth.signOut","when":"{{ !fx.auth.signOut.busy }}","onSuccess":{"op":"set","path":"local.codeDraft","value":""}}}}]},{"component":"AsyncStatus","when":"{{ fx.auth.signOut.problem }}","props":{"kind":"error","message":"{{ fx.auth.signOut.problem.message }}"}}]},{"component":"AsyncStatus","when":"{{ state.user.status == 'signedIn' }}","props":{"kind":"success","message":"Signed in. Opening your dashboard…"}}]}},"BuilderAppName":{"inputs":{"name":{"type":"string","required":true}},"view":{"component":"Button","visual":"builderAppName","props":{"label":"{{ props.name }}","treatment":"plain","size":"small"},"on":{"press":{"emit":"edit"}}},"outputs":{"edit":{"payload":{}}}},"BuilderAssistantHeader":{"inputs":{"showClose":{"type":"boolean","required":false,"default":true},"activeView":{"type":"string","required":true,"enum":["build","features","settings"]}},"outputs":{"close":{"payload":{}},"changeView":{"payload":{"view":{"type":"string","required":true,"enum":["build","features","settings"]}}}},"view":{"component":"ChromeRow","props":{"distribution":"leading"},"slots":{"left":{"component":"HorizontalTabs","props":{"label":"Builder panel"},"on":{"move":{"emit":"changeView","view":"{{ event.index == 0 ? 'build' : (event.index == 1 ? 'features' : 'settings') }}"}},"slots":{"default":[{"component":"Tab","props":{"label":"Build","selected":"{{ props.activeView == 'build' }}","tabId":"builder-build-tab","panelId":"builder-build-panel","icon":"lucide__Sparkles"},"on":{"select":{"emit":"changeView","view":"build"}}},{"component":"Tab","props":{"label":"Features","selected":"{{ props.activeView == 'features' }}","tabId":"builder-features-tab","panelId":"builder-features-panel","icon":"lucide__Plug"},"on":{"select":{"emit":"changeView","view":"features"}}},{"component":"Tab","props":{"label":"Settings","selected":"{{ props.activeView == 'settings' }}","tabId":"builder-settings-tab","panelId":"builder-settings-panel","icon":"lucide__SlidersHorizontal"},"on":{"select":{"emit":"changeView","view":"settings"}}}]}},"right":{"component":"IconButton","when":"{{ props.showClose }}","props":{"icon":"lucide__X","label":"Close Build assistant"},"on":{"press":{"emit":"close"}}}}},"visual":{"recipes":{}}},"BuilderPreviewStage":{"slots":{"default":{"required":true}},"view":{"tag":"div","visual":[{"recipe":"surfaceGutter","states":{"flush":"{{ !media.sm }}"}},{"recipe":"builderPreviewStage","states":{"mobileFlush":"{{ !media.sm }}"}}],"children":[{"slot":"default"}]}},"MessageThread":{"inputs":{"appId":{"type":"string","required":true}},"view":{"tag":"div","key":"{{ props.appId }}","children":[{"component":"AsyncStatus","fallback":true,"props":{"kind":"error","message":"{{ problem.message }}"}},{"component":"AsyncStatus","when":"{{ selectedAppWorkspace.id == props.appId && count(currentBuilderMessages) == 0 }}","props":{"kind":"empty","message":"No messages yet."}},{"tag":"ol","when":"{{ selectedAppWorkspace.id == props.appId && count(currentBuilderMessages) > 0 }}","children":[{"tag":"li","repeat":{"items":"{{ currentBuilderMessages }}","as":"message","key":"id"},"children":[{"tag":"span","text":"{{ message.role == 'user' ? 'User' : 'First Light' }}","visual":"role"},{"tag":"p","text":"{{ message.text }}"}],"visual":["message",{"recipe":"userMessage","when":"{{ message.role == 'user' }}"}],"props":{"data-conversation-message":""}}],"visual":"list"}],"visual":"root"},"visual":{"recipes":{"root":{"base":{"minWidth":"0"}},"list":{"base":{"display":"grid","gap":"{space3}","listStyle":"none","margin":"0","padding":"0"}},"message":{"base":{"minWidth":"0","padding":"{space3}","border":"{borderThin} solid {colorBorderLight}","borderRadius":"{radiusControl}","background":"{colorSurfaceMutedLight}"},"at":{"dark":{"borderColor":"{colorBorderDark}","background":"{colorSurfaceMutedDark}"}}},"role":{"base":{"color":"{colorInteractiveLight}","fontSize":"0.8125rem","fontWeight":"750","letterSpacing":"0.04em"},"at":{"dark":{"color":"{colorInteractiveDark}"}}},"userMessage":{"base":{"borderColor":"{colorAccentLight}","background":"{colorAccentSoftLight}"},"at":{"dark":{"borderColor":"{colorAccentDark}","background":"{colorAccentSoftDark}"}}}}}},"SplitRow":{"slots":{"left":{"required":true},"right":{"required":true}},"visual":{"recipes":{"row":{"base":{"display":"flex","alignItems":"center","minWidth":"0","flexWrap":"wrap","gap":"{space3}"}},"region":{"base":{"display":"flex","alignItems":"center","minWidth":"0","flexWrap":"wrap","gap":"{space2}","flex":"1 1 0"}},"rightRegion":{"base":{"display":"flex","alignItems":"center","minWidth":"0","marginLeft":"auto","flexWrap":"wrap","gap":"{space2}","flex":"0 0 auto"}}}},"view":{"tag":"div","visual":"row","children":[{"tag":"div","visual":"region","children":[{"slot":"left"}]},{"tag":"div","visual":"rightRegion","children":[{"slot":"right"}]}]}},"MultilineInput":{"inputs":{"name":{"type":"string","required":true},"label":{"type":"string","required":true},"value":{"type":"string","required":true},"required":{"type":"boolean","required":false,"default":false},"disabled":{"type":"boolean","required":false,"default":false},"maxLength":{"type":"integer","required":false,"default":4000}},"outputs":{"change":{"payload":{"value":{"type":"string","required":true}}}},"visual":{"recipes":{"control":{"base":{"boxSizing":"border-box","width":"100%","minWidth":"0","resize":"vertical"}}}},"view":{"tag":"textarea","visual":[{"recipe":"textInput","states":{"disabled":"{{ props.disabled }}"}},"control"],"props":{"name":"{{ props.name }}","aria-label":"{{ props.label }}","value":"{{ props.value }}","required":"{{ props.required }}","disabled":"{{ props.disabled }}","maxlength":"{{ props.maxLength }}","rows":3},"on":{"input":{"emit":"change","value":"{{ event.value }}"}}}},"MessageQualitySelect":{"inputs":{"value":{"type":"string","required":false,"default":"medium","enum":["low","medium","high"]},"disabled":{"type":"boolean","required":false,"default":false}},"outputs":{"change":{"payload":{"value":{"type":"string","required":true,"enum":["low","medium","high"]}}}},"view":{"tag":"select","props":{"aria-label":"Build quality","value":"{{ props.value }}","disabled":"{{ props.disabled }}"},"on":{"change":{"emit":"change","value":"{{ event.value }}"}},"children":[{"tag":"option","props":{"value":"low"},"text":"Fast"},{"tag":"option","props":{"value":"medium"},"text":"Balanced"},{"tag":"option","props":{"value":"high"},"text":"Best"}],"visual":{"recipe":"textInput","states":{"disabled":"{{ props.disabled }}","compact":"{{ true }}"}}}},"MessageComposer":{"inputs":{"draft":{"type":"string","required":true},"quality":{"type":"string","required":false,"default":"medium","enum":["low","medium","high"]},"canSendMessage":{"type":"boolean","required":true},"canCancel":{"type":"boolean","required":true},"cancelLabel":{"type":"string","required":true},"interactionLocked":{"type":"boolean","required":true},"sendBusy":{"type":"boolean","required":true},"cancelBusy":{"type":"boolean","required":true},"sendProblemMessage":{"type":"string","required":false,"default":""},"cancelProblemMessage":{"type":"string","required":false,"default":""}},"outputs":{"changeDraft":{"payload":{"value":{"type":"string","required":true}}},"changeQuality":{"payload":{"value":{"type":"string","required":true,"enum":["low","medium","high"]}}},"submit":{"payload":{"message":{"type":"string","required":true},"quality":{"type":"string","required":true,"enum":["low","medium","high"]}}},"cancel":{"payload":{}}},"view":{"tag":"form","props":{"aria-label":"Message composer"},"children":[{"component":"MultilineInput","props":{"name":"message","label":"Message","value":"{{ props.draft }}","required":true,"disabled":"{{ props.interactionLocked }}","maxLength":4000},"on":{"change":{"emit":"changeDraft","value":"{{ event.value }}"}}},{"component":"SplitRow","slots":{"left":{"component":"MessageQualitySelect","props":{"value":"{{ props.quality }}","disabled":"{{ props.interactionLocked }}"},"on":{"change":{"emit":"changeQuality","value":"{{ event.value }}"}}},"right":[{"component":"Button","when":"{{ props.canCancel }}","props":{"label":"{{ props.cancelLabel }}","treatment":"secondary","size":"small","disabled":"{{ props.interactionLocked }}","busy":"{{ props.cancelBusy }}"},"on":{"press":{"emit":"cancel","when":"{{ props.canCancel && !props.interactionLocked }}"}}},{"component":"Button","props":{"label":"Send message","treatment":"primary","size":"small","type":"submit","disabled":"{{ !props.canSendMessage || props.interactionLocked || trim(props.draft) == '' }}","busy":"{{ props.sendBusy }}"}}]}},{"component":"AsyncStatus","when":"{{ props.sendProblemMessage != '' }}","props":{"kind":"error","message":"{{ props.sendProblemMessage }}"}},{"component":"AsyncStatus","when":"{{ props.cancelProblemMessage != '' }}","props":{"kind":"error","message":"{{ props.cancelProblemMessage }}"}}],"visual":"composer","on":{"submit":{"emit":"submit","when":"{{ props.canSendMessage && !props.interactionLocked && trim(props.draft) != '' }}","message":"{{ trim(props.draft) }}","quality":"{{ props.quality }}"}}},"visual":{"recipes":{"composer":{"base":{"display":"grid","gap":"{space3}","minWidth":"0","background":"{colorSurfaceRaisedLight}","color":"{colorTextLight}"},"at":{"dark":{"background":"{colorSurfaceRaisedDark}","color":"{colorTextDark}"}}}}}},"BuilderPosture":{"inputs":{"posture":{"type":"object","required":true}},"view":{"tag":"div","children":[{"tag":"p","when":"{{ props.posture.type == 'working' }}","text":"{{ props.posture.activity.label }}"},{"tag":"div","when":"{{ props.posture.type == 'paused' || props.posture.type == 'readyToContinue' || props.posture.type == 'failed' || props.posture.type == 'cancelled' }}","children":[{"tag":"strong","text":"{{ props.posture.title }}"},{"tag":"p","text":"{{ props.posture.message }}"},{"component":"Button","when":"{{ props.posture.type == 'paused' && props.posture.cause == 'funds' && props.posture.actions[0] != null && props.posture.actions[0].type == 'addFunds' }}","props":{"label":"{{ props.posture.actions[0].label }}","treatment":"primary"},"on":{"press":{"emit":"addCredits"}}},{"component":"Button","when":"{{ props.posture.type == 'readyToContinue' && canContinue }}","props":{"label":"{{ continueActionLabel }}","treatment":"primary"},"on":{"press":{"emit":"continue"}}},{"component":"Button","when":"{{ props.posture.type == 'failed' && canRetry }}","props":{"label":"{{ retryActionLabel }}","treatment":"primary"},"on":{"press":{"emit":"retry"}}}]}],"visual":{"recipe":"posture","states":{"working":"{{ props.posture.type == 'working' }}","failed":"{{ props.posture.type == 'failed' }}","ready":"{{ props.posture.type == 'readyToContinue' }}"}}},"visual":{"recipes":{"posture":{"base":{"marginTop":"{space3}","padding":"{space3}","border":"{borderThin} solid {colorBorderLight}","borderRadius":"{radiusControl}","background":"{colorSurfaceMutedLight}","color":"{colorTextMutedLight}"},"state":{"working":{"borderColor":"{colorAccentLight}","background":"{colorAccentSoftLight}","color":"{colorInteractiveLight}"},"failed":{"borderColor":"{colorDangerLight}","background":"{colorDangerSoftLight}","color":"{colorDangerLight}"},"ready":{"borderColor":"{colorSuccessLight}","background":"{colorSuccessSoftLight}","color":"{colorSuccessLight}"}},"at":{"dark":{"borderColor":"{colorBorderDark}","background":"{colorSurfaceMutedDark}","color":"{colorTextMutedDark}","state":{"working":{"borderColor":"{colorAccentDark}","background":"{colorAccentSoftDark}","color":"{colorInteractiveDark}"},"failed":{"borderColor":"{colorDangerDark}","background":"{colorDangerSoftDark}","color":"{colorDangerDark}"},"ready":{"borderColor":"{colorSuccessDark}","background":"{colorSuccessSoftDark}","color":"{colorSuccessDark}"}}}}}}},"outputs":{"addCredits":{"payload":{}},"continue":{"payload":{}},"retry":{"payload":{}}}},"BuilderAppPreview":{"inputs":{"appId":{"type":"string","required":true},"revision":{"type":"string","required":true}},"visual":{"recipes":{"previewHost":{"base":{"width":"100%","height":"100%","minWidth":"0","minHeight":"0","overflow":"hidden","border":"{borderThin} solid {colorBorderLight}","borderRadius":"{radiusSurface}","background":"{colorSurfaceRaisedLight}","boxShadow":"0 0.75rem 2.5rem rgba(27, 37, 32, 0.14)"},"at":{"dark":{"borderColor":"{colorBorderDark}","background":"{colorSurfaceRaisedDark}","boxShadow":"0 0.75rem 2.5rem rgba(0, 0, 0, 0.38)"}},"state":{"mobileFlush":{"border":"0","borderRadius":"0","boxShadow":"none"}}}}},"view":{"tag":"div","props":{"role":"region","aria-label":"App preview"},"use":[{"element":"builder_app_preview","appId":"{{ props.appId }}","revision":"{{ props.revision }}"}],"visual":{"recipe":"previewHost","states":{"mobileFlush":"{{ !media.sm }}"}}}},"PageShell":{"inputs":{"header":{"type":"component","required":false},"footer":{"type":"component","required":false},"panelOpen":{"type":"boolean","required":false,"default":false}},"slots":{"header":{"required":false},"default":{"required":true},"panel":{"required":false},"overlay":{"required":false}},"view":{"tag":"div","visual":{"recipe":"panelLayout","states":{"withPanel":"{{ props.panelOpen }}"}},"children":[{"tag":"div","visual":"document","props":{"data-mui-scroll-root":""},"children":[{"tag":"div","visual":"viewport","children":[{"tag":"header","visual":"fixedChrome","children":[{"slot":"header","children":[{"component":"{{ props.header }}","when":"{{ props.header != null }}"}]}]},{"tag":"main","visual":"main","children":[{"slot":"default"}]}]},{"tag":"footer","when":"{{ props.footer != null }}","visual":"fixedChrome","children":[{"component":"{{ props.footer }}"}]}]},{"component":"DockedPanel","when":"{{ media.lg }}","visual":"dockTarget","props":{"open":"{{ props.panelOpen }}"},"children":[{"slot":"panel"}]},{"slot":"overlay"}]},"visual":{"recipes":{"document":{"base":{"minWidth":"0","minHeight":"0","overflowX":"clip","overflowY":"auto"}},"viewport":{"base":{"minHeight":"100dvh","minWidth":"0","display":"flex","flexDirection":"column"}},"main":{"base":{"minWidth":"0","flex":"1 0 auto"}},"dockTarget":{"base":{"--dock-target-width":"{navigationPanelWidth}"}}}}},"FixedShell":{"inputs":{"header":{"type":"component","required":false}},"slots":{"header":{"required":false},"default":{"required":true}},"view":{"tag":"div","visual":"frame","children":[{"tag":"header","visual":"fixedChrome","children":[{"slot":"header","children":[{"component":"{{ props.header }}","when":"{{ props.header != null }}"}]}]},{"tag":"main","visual":"main","children":[{"slot":"default"}]}]},"visual":{"recipes":{"frame":{"base":{"height":"100dvh","minWidth":"0","minHeight":"0","display":"flex","flexDirection":"column","overflow":"hidden"}},"main":{"base":{"minWidth":"0","minHeight":"0","flex":"1 1 auto","overflow":"hidden"}}}}},"BuilderFrame":{"inputs":{"panelOpen":{"type":"boolean","required":true}},"slots":{"header":{"required":true},"default":{"required":true},"panel":{"required":false},"overlay":{"required":false}},"view":{"tag":"div","visual":{"recipe":"panelLayout","states":{"withPanel":"{{ props.panelOpen }}"}},"children":[{"tag":"div","visual":"workspace","children":[{"tag":"header","visual":"fixedChrome","children":[{"slot":"header"}]},{"tag":"main","visual":"primary","children":[{"slot":"default"}]}]},{"component":"DockedPanel","when":"{{ media.lg }}","visual":"dockTarget","props":{"open":"{{ props.panelOpen }}"},"children":[{"slot":"panel"}]},{"slot":"overlay"}]},"visual":{"recipes":{"workspace":{"base":{"minWidth":"0","minHeight":"0","display":"flex","overflow":"hidden","flexDirection":"column"}},"primary":{"base":{"minWidth":"0","minHeight":"0","display":"flex","flexDirection":"column","overflow":"hidden","flex":"1 1 auto"}},"dockTarget":{"base":{"--dock-target-width":"{builderPanelWidth}"}}}}},"PanelFrame":{"inputs":{"surfaceId":{"type":"string","required":true},"showFooter":{"type":"boolean","required":false,"default":false},"label":{"type":"string","required":true},"followLatest":{"type":"boolean","required":false,"default":false},"streamKey":{"type":"string","required":false,"default":""}},"slots":{"default":{"required":true},"footer":{"required":false},"header":{"required":true}},"view":{"tag":"aside","visual":"frame","props":{"id":"{{ props.surfaceId }}","aria-label":"{{ props.label }}"},"children":[{"tag":"header","visual":"fixedChrome","children":[{"slot":"header"}]},{"tag":"div","visual":["surfaceGutter","body"],"props":{"data-mui-scroll-root":""},"children":[{"slot":"default"}],"use":[{"behavior":"pinToBottom","enabled":"{{ props.followLatest }}","itemSelector":"[data-conversation-message]","streamKey":"{{ props.streamKey }}"}]},{"tag":"footer","when":"{{ props.showFooter }}","visual":["surfaceGutter","footer"],"children":[{"slot":"footer"}]}]},"visual":{"recipes":{"frame":{"base":{"width":"100%","height":"100%","minWidth":"0","minHeight":"0","display":"flex","flexDirection":"column","overflow":"hidden","background":"{colorSurfaceRaisedLight}","color":"{colorTextLight}","borderInlineStart":"{borderThin} solid {colorBorderLight}","boxSizing":"border-box"},"at":{"dark":{"background":"{colorSurfaceRaisedDark}","color":"{colorTextDark}","borderInlineStartColor":"{colorBorderDark}"}}},"body":{"base":{"minWidth":"0","minHeight":"0","flex":"1 1 auto","overflowX":"clip","overflowY":"auto","background":"{colorSurfaceLight}","paddingBlock":"{space4}"},"at":{"dark":{"background":"{colorSurfaceDark}"}}},"footer":{"base":{"minWidth":"0","flex":"0 0 auto","borderTop":"{borderThin} solid {colorBorderLight}","background":"{colorSurfaceRaisedLight}","paddingBlock":"{space4}"},"at":{"dark":{"borderTopColor":"{colorBorderDark}","background":"{colorSurfaceRaisedDark}"}}}}}},"ResponsivePanelOverlay":{"inputs":{"surfaceId":{"type":"string","required":true},"label":{"type":"string","required":true}},"outputs":{"close":{"payload":{"reason":{"type":"string","required":true,"enum":["button","escape","outside"]}}}},"slots":{"default":{"required":true}},"view":{"tag":"div","visual":"layer","use":[{"behavior":"modalSurface","surface":"[data-governed-surface]","action":{"emit":"close","reason":"{{ modal.reason }}"},"initialFocus":"button"}],"children":[{"tag":"div","visual":"surface","props":{"id":"{{ props.surfaceId }}","role":"dialog","aria-modal":"true","aria-label":"{{ props.label }}","data-governed-surface":""},"children":[{"slot":"default"}]}],"key":"responsive-panel-overlay","motion":["drawerEnter","drawerExit"]},"visual":{"recipes":{"layer":{"base":{"position":"fixed","inset":"0","display":"flex","justifyContent":"flex-end","overflow":"hidden","zIndex":"2","background":"{colorBackdropLight}"},"at":{"dark":{"background":"{colorBackdropDark}"}}},"surface":{"base":{"width":"100%","maxWidth":"100%","height":"100dvh","minWidth":"0","minHeight":"0","overflow":"hidden","background":"{colorSurfaceRaisedLight}","boxShadow":"-0.75rem 0 2.5rem rgba(16, 24, 20, 0.24)"},"at":{"dark":{"background":"{colorSurfaceRaisedDark}","boxShadow":"-0.75rem 0 2.5rem rgba(0, 0, 0, 0.46)"}}}}}},"NavigationPanel":{"inputs":{"surfaceId":{"type":"string","required":true}},"outputs":{"close":{"payload":{}}},"view":{"component":"PanelFrame","visual":"size","props":{"surfaceId":"{{ props.surfaceId }}","showFooter":false,"label":"Navigation"},"children":[{"component":"PlatformNavigation","on":{"dismiss":{"emit":"close"}}}],"slots":{"header":{"component":"OverlayHeader","props":{"showClose":true},"on":{"close":{"emit":"close"}}}}},"visual":{"recipes":{"size":{"base":{"width":"100%","maxWidth":"100%","height":"100%","minWidth":"0"},"at":{"lg":{"width":"{navigationPanelWidth}","maxWidth":"{navigationPanelWidth}","minWidth":"{navigationPanelWidth}"}}}}}},"BuilderPanel":{"inputs":{"surfaceId":{"type":"string","required":true},"appId":{"type":"string","required":true},"draft":{"type":"string","required":true},"quality":{"type":"string","required":true},"activeView":{"type":"string","required":true,"enum":["build","features","settings"]}},"outputs":{"close":{"payload":{}},"changeDraft":{"payload":{"value":{"type":"string","required":true}}},"changeQuality":{"payload":{"value":{"type":"string","required":true}}},"submit":{"payload":{"appId":{"type":"string","required":true},"message":{"type":"string","required":true},"quality":{"type":"string","required":true}}},"cancel":{"payload":{"appId":{"type":"string","required":true}}},"changeView":{"payload":{"view":{"type":"string","required":true,"enum":["build","features","settings"]}}},"openBilling":{"payload":{}},"openDomains":{"payload":{}},"continue":{"payload":{"appId":{"type":"string","required":true}}},"retry":{"payload":{"appId":{"type":"string","required":true}}}},"view":{"component":"PanelFrame","visual":"size","props":{"surfaceId":"{{ props.surfaceId }}","showFooter":"{{ props.activeView == 'build' && selectedAppWorkspace.id == props.appId }}","label":"Build assistant","followLatest":"{{ props.activeView == 'build' }}","streamKey":"{{ props.appId }}"},"slots":{"footer":{"component":"MessageComposer","when":"{{ props.activeView == 'build' }}","props":{"draft":"{{ props.draft }}","quality":"{{ props.quality }}","canSendMessage":"{{ canSendMessage }}","canCancel":"{{ canCancel }}","cancelLabel":"{{ cancelActionLabel }}","interactionLocked":"{{ fx.sendBuilderMessage[props.appId].busy || fx.cancelBuilderWork[props.appId].busy || fx.sendBuilderMessage[props.appId].problem.retry == 'reconcile' || fx.cancelBuilderWork[props.appId].problem.retry == 'reconcile' }}","sendBusy":"{{ fx.sendBuilderMessage[props.appId].busy }}","cancelBusy":"{{ fx.cancelBuilderWork[props.appId].busy }}","sendProblemMessage":"{{ fx.sendBuilderMessage[props.appId].problem ? fx.sendBuilderMessage[props.appId].problem.message : '' }}","cancelProblemMessage":"{{ fx.cancelBuilderWork[props.appId].problem ? fx.cancelBuilderWork[props.appId].problem.message : '' }}"},"on":{"changeDraft":{"emit":"changeDraft","value":"{{ event.value }}"},"changeQuality":{"emit":"changeQuality","value":"{{ event.value }}"},"submit":{"emit":"submit","appId":"{{ props.appId }}","message":"{{ event.message }}","quality":"{{ event.quality }}"},"cancel":{"emit":"cancel","appId":"{{ props.appId }}"}}},"header":{"component":"BuilderAssistantHeader","props":{"showClose":true,"activeView":"{{ props.activeView }}"},"on":{"close":{"emit":"close"},"changeView":{"emit":"changeView","view":"{{ event.view }}"}}}},"children":[{"tag":"div","when":"{{ props.activeView == 'build' }}","props":{"id":"builder-build-panel","role":"tabpanel","aria-labelledby":"builder-build-tab"},"children":[{"component":"MessageThread","props":{"appId":"{{ props.appId }}"}},{"component":"BuilderPosture","when":"{{ selectedAppWorkspace.id == props.appId && (currentBuilderPosture.type == 'working' || currentBuilderPosture.type == 'paused' || currentBuilderPosture.type == 'readyToContinue' || currentBuilderPosture.type == 'failed' || currentBuilderPosture.type == 'cancelled') }}","props":{"posture":"{{ currentBuilderPosture }}"},"on":{"addCredits":{"emit":"openBilling"},"continue":{"emit":"continue","appId":"{{ props.appId }}"},"retry":{"emit":"retry","appId":"{{ props.appId }}"}}}]},{"component":"BuilderFeatures","when":"{{ props.activeView == 'features' }}","props":{"appId":"{{ props.appId }}"}},{"component":"BuilderSettings","when":"{{ props.activeView == 'settings' }}","on":{"openBilling":{"emit":"openBilling"},"openDomains":{"emit":"openDomains"}}}]},"visual":{"recipes":{"size":{"base":{"width":"100%","maxWidth":"100%","height":"100%","minWidth":"0"},"at":{"lg":{"width":"{builderPanelWidth}","maxWidth":"{builderPanelWidth}","minWidth":"{builderPanelWidth}"}}}}}},"NavigationPageShell":{"inputs":{"footer":{"type":"component","required":false}},"slots":{"default":{"required":true}},"state":{"panelOpen":false},"view":{"component":"PageShell","props":{"footer":"{{ props.footer }}","panelOpen":"{{ local.panelOpen }}"},"slots":{"header":{"component":"PlatformHeader","props":{"panelOpen":"{{ local.panelOpen }}"},"on":{"togglePanel":{"op":"set","path":"local.panelOpen","value":"{{ !local.panelOpen }}"}}},"panel":{"component":"NavigationPanel","when":"{{ media.lg }}","props":{"surfaceId":"navigation-panel"},"on":{"close":{"op":"set","path":"local.panelOpen","value":false}}},"overlay":{"component":"ResponsivePanelOverlay","when":"{{ local.panelOpen && !media.lg }}","props":{"surfaceId":"navigation-panel-dialog","label":"Navigation"},"on":{"close":{"op":"set","path":"local.panelOpen","value":false}},"children":[{"component":"NavigationPanel","props":{"surfaceId":"navigation-panel"},"on":{"close":{"op":"set","path":"local.panelOpen","value":false}}}]}},"children":[{"slot":"default"}]}},"BuilderWorkspaceShell":{"slots":{"default":{"required":true}},"state":{"draftAppId":"","message":"","quality":"medium","requestedPublishHead":"","renameAppId":"","renameDraft":"","assistantPreference":"default","assistantView":"build","billingDialogOpen":false,"domainsDialogOpen":false,"publicationDialogOpen":false,"publicationRefusalSeen":""},"computed":{"activeDraft":"{{ local.draftAppId == props.appId ? local.message : '' }}","activeQuality":"{{ local.draftAppId == props.appId ? local.quality : 'medium' }}","publishAwaitingProjection":"{{ fx.publishApp[props.appId].status == 'ok' && local.requestedPublishHead == currentPublishHead && !publishedCurrent }}","publishControlBusy":"{{ publishBusy || local.publishAwaitingProjection }}","renamingCurrentApp":"{{ local.renameAppId == props.appId }}","currentRenameDraft":"{{ local.renamingCurrentApp ? local.renameDraft : '' }}","renameBusy":"{{ fx.renameApp[props.appId].busy || fx.renameApp[props.appId].problem.retry == 'reconcile' }}","canSaveRename":"{{ local.renamingCurrentApp && selectedAppWorkspace.id == props.appId && trim(local.currentRenameDraft) != '' && trim(local.currentRenameDraft) != selectedAppWorkspaceName && !local.renameBusy }}","renameProblemMessage":"{{ local.renamingCurrentApp && fx.renameApp[props.appId].status == 'problem' && fx.renameApp[props.appId].problem.retry != 'reconcile' ? fx.renameApp[props.appId].problem.message : '' }}","assistantOpen":"{{ local.assistantPreference == 'open' || (local.assistantPreference == 'default' && media.lg) }}","billingReturnActive":"{{ route.name == 'builder' && ((route.query.billing == 'card-return' && route.query.setup_intent != null) || route.query.billing == 'payment-return') }}","publicationReturnActive":"{{ route.name == 'builder' && ((route.query.publication == 'card-return' && route.query.setup_intent != null) || route.query.publication == 'payment-return') }}","publicationRefused":"{{ fx.publishApp[props.appId].status == 'problem' && fx.publishApp[props.appId].problem.code == 'PUBLICATION_SUBSCRIPTION_REQUIRED' && fx.publishApp[props.appId].occurrence != local.publicationRefusalSeen }}"},"view":{"component":"BuilderFrame","slots":{"header":{"component":"BuilderHeader","props":{"appId":"{{ props.appId }}","showPublish":"{{ showPublish }}","canPublish":"{{ canPublish && !local.publishAwaitingProjection }}","publishBusy":"{{ local.publishControlBusy }}","publishedUrl":"{{ publishedUrl }}","publishProblemMessage":"{{ publishProblemMessage }}","appName":"{{ selectedAppWorkspace.id == props.appId ? selectedAppWorkspaceName : '' }}","renaming":"{{ local.renamingCurrentApp }}","renameDraft":"{{ local.currentRenameDraft }}","renameBusy":"{{ local.renameBusy }}","canSaveRename":"{{ local.canSaveRename }}","renameProblemMessage":"{{ local.renameProblemMessage }}","publishedCurrent":"{{ publishedCurrent }}"},"on":{"publish":[{"op":"set","path":"local.requestedPublishHead","value":"{{ currentPublishHead }}"},{"op":"set","when":"{{ event.appId == props.appId && !publicationFunded }}","path":"local.publicationDialogOpen","value":true},{"call":"publishApp","key":"{{ event.appId }}","when":"{{ event.appId == props.appId && selectedAppWorkspace.id == event.appId && canPublish && publicationFunded }}","appId":"{{ event.appId }}"}],"beginRename":[{"op":"set","when":"{{ event.appId == props.appId && selectedAppWorkspace.id == event.appId }}","path":"local.renameDraft","value":"{{ event.name }}"},{"op":"set","when":"{{ event.appId == props.appId && selectedAppWorkspace.id == event.appId }}","path":"local.renameAppId","value":"{{ event.appId }}"}],"changeRename":{"op":"set","when":"{{ event.appId == props.appId && local.renameAppId == event.appId }}","path":"local.renameDraft","value":"{{ event.value }}"},"saveRename":{"call":"renameApp","key":"{{ event.appId }}","when":"{{ event.appId == props.appId && local.renameAppId == event.appId && selectedAppWorkspace.id == event.appId && event.name == trim(local.renameDraft) && event.name != '' && event.name != selectedAppWorkspaceName && !fx.renameApp[event.appId].busy && fx.renameApp[event.appId].problem.retry != 'reconcile' }}","appId":"{{ event.appId }}","name":"{{ trim(event.name) }}","onSuccess":[{"op":"set","when":"{{ local.renameAppId == event.appId }}","path":"local.renameDraft","value":""},{"op":"set","when":"{{ local.renameAppId == event.appId }}","path":"local.renameAppId","value":""}]},"cancelRename":[{"op":"set","when":"{{ event.appId == props.appId && local.renameAppId == event.appId && !local.renameBusy }}","path":"local.renameDraft","value":""},{"op":"set","when":"{{ event.appId == props.appId && local.renameAppId == event.appId && !local.renameBusy }}","path":"local.renameAppId","value":""}]}},"overlay":[{"component":"IconButton","visual":["builderAssistantFab",{"recipe":"concealedControl","when":"{{ local.assistantOpen }}"}],"props":{"icon":"lucide__Sparkles","label":"Open Build assistant","controls":"builder-panel","treatment":"primary","expanded":"{{ local.assistantOpen }}"},"on":{"press":{"op":"set","path":"local.assistantPreference","value":"{{ local.assistantOpen ? 'closed' : 'open' }}"}}},{"component":"ResponsivePanelOverlay","when":"{{ local.assistantOpen && !media.lg }}","props":{"surfaceId":"builder-panel-dialog","label":"Build assistant"},"on":{"close":{"op":"set","path":"local.assistantPreference","value":"closed"}},"children":[{"component":"BuilderPanel","props":{"surfaceId":"builder-panel","appId":"{{ props.appId }}","draft":"{{ local.activeDraft }}","quality":"{{ local.activeQuality }}","activeView":"{{ local.assistantView }}"},"on":{"close":{"op":"set","path":"local.assistantPreference","value":"closed"},"changeDraft":[{"op":"set","path":"local.quality","value":"{{ local.draftAppId == props.appId ? local.quality : 'medium' }}"},{"op":"set","path":"local.draftAppId","value":"{{ props.appId }}"},{"op":"set","path":"local.message","value":"{{ event.value }}"}],"changeQuality":[{"op":"set","path":"local.message","value":"{{ local.draftAppId == props.appId ? local.message : '' }}"},{"op":"set","path":"local.draftAppId","value":"{{ props.appId }}"},{"op":"set","path":"local.quality","value":"{{ event.value }}"}],"submit":{"call":"sendBuilderMessage","key":"{{ event.appId }}","when":"{{ event.appId == props.appId && selectedAppWorkspace.id == event.appId && canSendMessage && !fx.cancelBuilderWork[event.appId].busy && fx.cancelBuilderWork[event.appId].problem.retry != 'reconcile' && trim(event.message) != '' }}","appId":"{{ event.appId }}","message":"{{ trim(event.message) }}","quality":"{{ event.quality }}","onSuccess":{"op":"set","when":"{{ local.draftAppId == event.appId && trim(local.message) == event.message }}","path":"local.message","value":""}},"cancel":{"call":"cancelBuilderWork","key":"{{ event.appId }}","when":"{{ event.appId == props.appId && selectedAppWorkspace.id == event.appId && canCancel && !fx.sendBuilderMessage[event.appId].busy && fx.sendBuilderMessage[event.appId].problem.retry != 'reconcile' }}","appId":"{{ event.appId }}","control":"cancel"},"changeView":{"op":"set","path":"local.assistantView","value":"{{ event.view }}"},"openBilling":{"op":"set","path":"local.billingDialogOpen","value":true},"openDomains":{"op":"set","path":"local.domainsDialogOpen","value":true},"continue":{"call":"cancelBuilderWork","key":"{{ event.appId }}","when":"{{ event.appId == props.appId && selectedAppWorkspace.id == event.appId && canContinue && !fx.sendBuilderMessage[event.appId].busy && fx.sendBuilderMessage[event.appId].problem.retry != 'reconcile' }}","appId":"{{ event.appId }}","control":"continue"},"retry":{"call":"cancelBuilderWork","key":"{{ event.appId }}","when":"{{ event.appId == props.appId && selectedAppWorkspace.id == event.appId && canRetry && !fx.sendBuilderMessage[event.appId].busy && fx.sendBuilderMessage[event.appId].problem.retry != 'reconcile' }}","appId":"{{ event.appId }}","control":"retry"}}}]},{"component":"AddCreditsDialog","when":"{{ local.billingDialogOpen || local.billingReturnActive }}","props":{"cardReturnUrl":"{{ route.origin }}/app/{{ props.appId }}?billing=card-return","paymentReturnUrl":"{{ route.origin }}/app/{{ props.appId }}?billing=payment-return"},"on":{"close":[{"op":"set","when":"{{ !local.billingReturnActive }}","path":"local.billingDialogOpen","value":false},{"call":"navigate","when":"{{ local.billingReturnActive }}","to":"/app/{{ props.appId }}","replace":true}]},"id":"builderAddCreditsDialog"},{"component":"DomainDialog","when":"{{ local.domainsDialogOpen }}","on":{"close":{"op":"set","path":"local.domainsDialogOpen","value":false}}},{"component":"PublishSiteDialog","when":"{{ local.publicationDialogOpen || local.publicationReturnActive || local.publicationRefused }}","warm":true,"props":{"appId":"{{ props.appId }}","appName":"{{ selectedAppWorkspace.id == props.appId ? selectedAppWorkspaceName : '' }}","siteAddress":"{{ publishedUrl }}","siteLabel":"{{ publicationSiteLabel }}","cardReturnUrl":"{{ route.origin }}/app/{{ props.appId }}?publication=card-return","paymentReturnUrl":"{{ route.origin }}/app/{{ props.appId }}?publication=payment-return"},"on":{"close":[{"op":"set","path":"local.publicationDialogOpen","value":false},{"op":"set","when":"{{ local.publicationRefused }}","path":"local.publicationRefusalSeen","value":"{{ fx.publishApp[props.appId].occurrence }}"},{"call":"navigate","when":"{{ local.publicationReturnActive }}","to":"/app/{{ props.appId }}","replace":true}]},"id":"builderPublishSiteDialog"}],"panel":{"component":"BuilderPanel","when":"{{ media.lg }}","props":{"surfaceId":"builder-panel","appId":"{{ props.appId }}","draft":"{{ local.activeDraft }}","quality":"{{ local.activeQuality }}","activeView":"{{ local.assistantView }}"},"on":{"close":{"op":"set","path":"local.assistantPreference","value":"closed"},"changeDraft":[{"op":"set","path":"local.quality","value":"{{ local.draftAppId == props.appId ? local.quality : 'medium' }}"},{"op":"set","path":"local.draftAppId","value":"{{ props.appId }}"},{"op":"set","path":"local.message","value":"{{ event.value }}"}],"changeQuality":[{"op":"set","path":"local.message","value":"{{ local.draftAppId == props.appId ? local.message : '' }}"},{"op":"set","path":"local.draftAppId","value":"{{ props.appId }}"},{"op":"set","path":"local.quality","value":"{{ event.value }}"}],"submit":{"call":"sendBuilderMessage","key":"{{ event.appId }}","when":"{{ event.appId == props.appId && selectedAppWorkspace.id == event.appId && canSendMessage && !fx.cancelBuilderWork[event.appId].busy && fx.cancelBuilderWork[event.appId].problem.retry != 'reconcile' && trim(event.message) != '' }}","appId":"{{ event.appId }}","message":"{{ trim(event.message) }}","quality":"{{ event.quality }}","onSuccess":{"op":"set","when":"{{ local.draftAppId == event.appId && trim(local.message) == event.message }}","path":"local.message","value":""}},"cancel":{"call":"cancelBuilderWork","key":"{{ event.appId }}","when":"{{ event.appId == props.appId && selectedAppWorkspace.id == event.appId && canCancel && !fx.sendBuilderMessage[event.appId].busy && fx.sendBuilderMessage[event.appId].problem.retry != 'reconcile' }}","appId":"{{ event.appId }}","control":"cancel"},"changeView":{"op":"set","path":"local.assistantView","value":"{{ event.view }}"},"openBilling":{"op":"set","path":"local.billingDialogOpen","value":true},"openDomains":{"op":"set","path":"local.domainsDialogOpen","value":true},"continue":{"call":"cancelBuilderWork","key":"{{ event.appId }}","when":"{{ event.appId == props.appId && selectedAppWorkspace.id == event.appId && canContinue && !fx.sendBuilderMessage[event.appId].busy && fx.sendBuilderMessage[event.appId].problem.retry != 'reconcile' }}","appId":"{{ event.appId }}","control":"continue"},"retry":{"call":"cancelBuilderWork","key":"{{ event.appId }}","when":"{{ event.appId == props.appId && selectedAppWorkspace.id == event.appId && canRetry && !fx.sendBuilderMessage[event.appId].busy && fx.sendBuilderMessage[event.appId].problem.retry != 'reconcile' }}","appId":"{{ event.appId }}","control":"retry"}}}},"children":[{"slot":"default"}],"props":{"panelOpen":"{{ local.assistantOpen }}"}},"inputs":{"appId":{"type":"string","required":true}},"visual":{"recipes":{}}},"SlotCluster":{"inputs":{"grow":{"type":"boolean","required":false,"default":false},"wrap":{"type":"boolean","required":false,"default":false}},"slots":{"default":{"required":true}},"view":{"tag":"div","visual":{"recipe":"cluster","states":{"grow":"{{ props.grow }}","wrap":"{{ props.wrap }}"}},"children":[{"slot":"default"}]},"visual":{"recipes":{"cluster":{"base":{"minWidth":"0","display":"flex","alignItems":"center","gap":"{space2}"},"state":{"grow":{"flex":"1 1 auto"},"wrap":{"flexWrap":"wrap"}}}}}},"NotFoundRoute":{"view":{"component":"PageShell","props":{"header":"GuestHeader","footer":"GuestFooter"},"children":[{"tag":"section","visual":"pageContent","children":[{"tag":"h1","text":"Page not found."}]}]}},"DockedPanel":{"inputs":{"open":{"type":"boolean","required":true}},"slots":{"default":{"required":true}},"view":{"tag":"div","visual":{"recipe":"dock","states":{"open":"{{ props.open }}"}},"children":[{"tag":"div","when":"{{ props.open }}","visual":"surface","motion":["drawerEnter","drawerExit"],"children":[{"slot":"default"}],"key":"panel-surface"}]},"visual":{"recipes":{"dock":{"base":{"position":"relative","width":"0","maxWidth":"0","height":"100%","minWidth":"0","minHeight":"0","overflow":"hidden","boxSizing":"border-box","transition":"width 180ms ease-in, max-width 180ms ease-in"},"state":{"open":{"width":"var(--dock-target-width)","maxWidth":"var(--dock-target-width)","transition":"width 180ms ease-out, max-width 180ms ease-out"}},"at":{"reducedMotion":{"transition":"none","state":{"open":{"transition":"none"}}}}},"surface":{"base":{"position":"absolute","insetBlock":"0","insetInlineEnd":"0","width":"var(--dock-target-width)","maxWidth":"var(--dock-target-width)","height":"100%","minWidth":"0","minHeight":"0","overflow":"hidden","boxSizing":"border-box"}}}}},"BuilderSettings":{"outputs":{"openBilling":{"payload":{}},"openDomains":{"payload":{}}},"view":{"tag":"section","visual":"settings","props":{"role":"tabpanel","id":"builder-settings-panel","aria-labelledby":"builder-settings-tab"},"children":[{"tag":"h2","visual":"title","text":"Settings"},{"component":"SettingsSection","props":{"title":"Billing"},"children":[{"component":"BillingSettings","on":{"addCredits":{"emit":"openBilling"}}}]},{"component":"SettingsSection","props":{"title":"Domains"},"children":[{"component":"Button","props":{"label":"Add Domain","treatment":"primary"},"on":{"press":{"emit":"openDomains"}}}]}]},"visual":{"recipes":{"settings":{"base":{"display":"grid","alignContent":"start","gap":"{space4}","minWidth":"0"}},"title":{"base":{"margin":"0"}}}}},"SettingsSection":{"inputs":{"title":{"type":"string","required":true}},"slots":{"default":{"required":true}},"view":{"tag":"section","visual":"section","children":[{"tag":"h3","visual":"sectionTitle","text":"{{ props.title }}"},{"slot":"default"}]},"visual":{"recipes":{"section":{"base":{"display":"grid","gap":"{space3}","paddingBlock":"{space4}","borderTop":"{borderThin} solid {colorBorderLight}"},"at":{"dark":{"borderTopColor":"{colorBorderDark}"}}}}}},"BillingSettings":{"outputs":{"addCredits":{"payload":{}}},"view":{"tag":"div","visual":"formStack","children":[{"component":"AsyncStatus","when":"{{ fx.accountSummary.busy && currentAccountBilling == null }}","props":{"kind":"loading","message":"Loading billing…"}},{"tag":"div","when":"{{ currentAccountBilling != null }}","visual":"formStack","children":[{"component":"SplitRow","slots":{"left":{"tag":"div","visual":"labelValueStack","children":[{"tag":"strong","text":"Credits"},{"tag":"span","text":"{{ currentAccountBilling.enabled ? currentAccountBilling.availableUsd : 'Unavailable' }}"}]},"right":[{"component":"Button","props":{"label":"Manage credits","treatment":"primary","disabled":"{{ !currentAccountBilling.enabled || !currentAccountBilling.payments }}"},"on":{"press":{"emit":"addCredits","when":"{{ currentAccountBilling.enabled && currentAccountBilling.payments }}"}}}]}},{"component":"AsyncStatus","when":"{{ currentAccountBilling.enabled && !currentAccountBilling.payments }}","props":{"kind":"empty","message":"Payments are not available yet."}},{"component":"AsyncStatus","when":"{{ !currentAccountBilling.enabled }}","props":{"kind":"empty","message":"Billing is not enabled."}}]},{"component":"AsyncStatus","when":"{{ !fx.accountSummary.busy && currentAccountBilling == null }}","props":{"kind":"empty","message":"Billing is unavailable."}},{"component":"AsyncStatus","fallback":true,"props":{"kind":"error","message":"{{ problem.message }}"}}]},"visual":{"recipes":{}}},"DialogOverlay":{"outputs":{"close":{"payload":{"reason":{"type":"string","required":true,"enum":["button","escape","outside"]}}}},"slots":{"default":{"required":true}},"view":{"tag":"div","visual":"dialogBackdrop","use":[{"behavior":"modalSurface","surface":"[data-governed-surface]","action":{"emit":"close","reason":"{{ modal.reason }}"},"initialFocus":"button"}],"children":[{"slot":"default"}],"key":"dialog-overlay"}},"DomainDialog":{"outputs":{"close":{"payload":{}}},"state":{"activeTab":"buy"},"view":{"component":"DialogOverlay","on":{"close":{"emit":"close"}},"children":[{"tag":"div","visual":["dialogSurface","surfaceFrame"],"props":{"role":"dialog","aria-modal":"true","aria-labelledby":"domain-dialog-title","data-governed-surface":"","data-dialog-surface":""},"children":[{"tag":"header","visual":"fixedChrome","children":[{"component":"ChromeRow","props":{"distribution":"leading"},"slots":{"left":{"tag":"h2","visual":"dialogTitle","props":{"id":"domain-dialog-title"},"text":"Add a Domain"},"right":{"component":"IconButton","props":{"icon":"lucide__X","label":"Close domain dialog"},"on":{"press":{"emit":"close"}}}}}]},{"tag":"div","visual":["surfaceGutter","scrollingContent","content"],"props":{"data-mui-scroll-root":""},"children":[{"component":"HorizontalTabs","props":{"label":"Domain setup"},"on":{"move":{"op":"set","path":"local.activeTab","value":"{{ event.index == 0 ? 'buy' : 'transfer' }}"}},"slots":{"default":[{"component":"Tab","props":{"label":"Buy a Domain","selected":"{{ local.activeTab == 'buy' }}","tabId":"domain-buy-tab","panelId":"domain-buy-panel","icon":"lucide__ShoppingCart"},"on":{"select":{"op":"set","path":"local.activeTab","value":"buy"}}},{"component":"Tab","props":{"label":"Transfer Domain","selected":"{{ local.activeTab == 'transfer' }}","tabId":"domain-transfer-tab","panelId":"domain-transfer-panel","icon":"lucide__ArrowRightLeft"},"on":{"select":{"op":"set","path":"local.activeTab","value":"transfer"}}}]}},{"tag":"section","when":"{{ local.activeTab == 'buy' }}","visual":"formStack","props":{"id":"domain-buy-panel","role":"tabpanel","aria-labelledby":"domain-buy-tab"},"children":[{"tag":"form","visual":"searchForm","props":{"role":"search","aria-label":"Search for a domain"},"on":{"submit":{"op":"set","path":"domainSearchQuery","value":"{{ trim(state.domainSearchDraft) }}","when":"{{ trim(state.domainSearchDraft) != '' }}"}},"children":[{"component":"Field","props":{"id":"domain-search","label":"Search for a domain"},"slots":{"default":{"component":"TextInput","props":{"id":"{{ slot.controlId }}","name":"domain","type":"text","autocomplete":"off","value":"{{ state.domainSearchDraft }}","required":true},"on":{"change":{"op":"set","path":"domainSearchDraft","value":"{{ event.value }}"}}}}},{"component":"Button","props":{"label":"Search","treatment":"primary","type":"submit","disabled":"{{ trim(state.domainSearchDraft) == '' }}"}}]},{"component":"AsyncStatus","when":"{{ state.domainSearchQuery == '' }}","props":{"kind":"empty","message":"Search for a domain to see available options."}},{"tag":"div","when":"{{ state.domainSearchQuery != '' }}","visual":"formStack","children":[{"tag":"div","fallback":true,"visual":"formStack","children":[{"component":"AsyncStatus","props":{"kind":"error","message":"{{ problem.message }}"}},{"component":"Button","when":"{{ problem.retry != 'never' }}","props":{"label":"Try again"},"on":{"press":{"call":"data.refresh","value":"domainSearch"}}}]},{"component":"AsyncStatus","when":"{{ !fx.domainSearch.ok && count(state.domainSearch) == 0 }}","props":{"kind":"loading","message":"Searching for domains…"}},{"component":"AsyncStatus","when":"{{ fx.domainSearch.ok && count(state.domainSearch) == 0 }}","props":{"kind":"empty","message":"No domains matched that search."}},{"tag":"ul","when":"{{ count(state.domainSearch) > 0 }}","visual":"actionList","children":[{"tag":"li","repeat":{"items":"{{ state.domainSearch }}","as":"domain","index":"domainIndex","key":"name"},"children":[{"tag":"div","visual":"actionRowSurface","children":[{"tag":"strong","visual":"resultName","text":"{{ domain.name }}"},{"component":"SlotCluster","children":[{"tag":"div","visual":"resultPrice","children":[{"tag":"span","text":"{{ domain.available ? (domain.priceDollars != null ? currency(domain.priceDollars, domain.currency, 'symbol') : 'Price unavailable') : (domain.reason ?? 'Unavailable') }}"},{"tag":"span","when":"{{ domain.available && domain.priceDollars != null }}","visual":"formHint","text":"/ year"}]},{"component":"Button","visual":"promoteAction","props":{"label":"Buy","treatment":"secondary","disabled":true}}]}]}],"visual":"actionRowGroup"}]}]}]},{"tag":"section","when":"{{ local.activeTab == 'transfer' }}","props":{"id":"domain-transfer-panel","role":"tabpanel","aria-labelledby":"domain-transfer-tab"},"children":[{"tag":"p","visual":"stub","text":"Domain transfers will be added here."}]}]}]}]},"visual":{"recipes":{"content":{"base":{"display":"grid","alignContent":"start","gap":"{space4}"}},"stub":{"base":{"margin":"0"}},"searchForm":{"base":{"display":"grid","gridTemplateColumns":"minmax(0, 1fr) auto","alignItems":"end","gap":"{space3}","minWidth":"0"}},"resultName":{"base":{"minWidth":"0","overflowWrap":"anywhere"}},"resultPrice":{"base":{"minWidth":"0","textAlign":"right","overflowWrap":"anywhere","display":"flex","alignItems":"flex-end","justifyContent":"flex-end","gap":"{space1}"}}}}},"Tab":{"inputs":{"label":{"type":"string","required":true},"selected":{"type":"boolean","required":true},"tabId":{"type":"string","required":true},"panelId":{"type":"string","required":true},"icon":{"type":"component","required":false}},"outputs":{"select":{"payload":{}}},"view":{"tag":"button","visual":[{"recipe":"controlBase","states":{"current":"{{ props.selected }}"}},"controlPlain","controlMedium","tab"],"props":{"type":"button","role":"tab","aria-selected":"{{ props.selected ? 'true' : 'false' }}","tabindex":"{{ props.selected ? 0 : -1 }}","id":"{{ props.tabId }}","aria-controls":"{{ props.panelId }}"},"on":{"click":{"emit":"select"}},"children":[{"component":"ControlContent","props":{"icon":"{{ props.icon }}","text":"{{ props.label }}"}}]},"visual":{"recipes":{"tab":{"base":{"minWidth":"0"}}}}},"PaymentMethodSetup":{"inputs":{"publishableKey":{"type":"string","required":true},"clientSecret":{"type":"string","required":true},"returnUrl":{"type":"string","required":true},"showCancel":{"type":"boolean","required":false,"default":true},"formId":{"type":"string","required":false,"default":"add-credits-payment-method-form"}},"outputs":{"save":{"payload":{"setupIntentId":{"type":"string","required":true}}},"lock":{"payload":{"locked":{"type":"boolean","required":true}}},"cancel":{"payload":{}}},"state":{"confirming":false,"message":""},"computed":{"locked":"{{ local.confirming }}"},"view":{"tag":"form","visual":"formStack","props":{"id":"{{ props.formId }}"},"use":[{"element":"card_setup_form","publishableKey":"{{ props.publishableKey }}","clientSecret":"{{ props.clientSecret }}","mode":"setup","returnUrl":"{{ props.returnUrl }}","mountSelector":"[data-card-setup-element]","appearance":{"theme":"stripe","variables":{"colorPrimary":"#174D3B","colorBackground":"#FFFFFF","colorText":"#1B2520","colorTextSecondary":"#5B665F","colorTextPlaceholder":"#858A85","colorDanger":"#A63A32","borderRadius":"10px"},"rules":{".TermsText":{"color":"#5B665F","fontSize":"0.875rem"}}},"appearanceDark":{"theme":"night","variables":{"colorPrimary":"#8BD9B7","colorBackground":"#202A25","colorText":"#F4EEE2","colorTextSecondary":"#C2B9AB","colorTextPlaceholder":"#777F79","colorDanger":"#F19A8F","borderRadius":"10px"},"rules":{".TermsText":{"color":"#C2B9AB","fontSize":"0.875rem"}}},"onReady":{"op":"set","path":"local.message","value":""},"onChange":{"op":"set","path":"local.message","value":"{{ card.message }}"},"onSubmit":[{"op":"set","path":"local.confirming","value":true},{"op":"set","path":"local.message","value":""},{"emit":"lock","locked":true}],"onSuccess":[{"op":"set","path":"local.confirming","value":false},{"emit":"lock","locked":false},{"emit":"save","setupIntentId":"{{ card.setupIntentId }}"}],"onError":[{"op":"set","path":"local.confirming","value":false},{"op":"set","path":"local.message","value":"{{ card.message }}"},{"emit":"lock","locked":false}]}],"children":[{"tag":"div","visual":"paymentMount","props":{"data-card-setup-element":""}},{"component":"AsyncStatus","when":"{{ local.message != '' }}","props":{"kind":"error","message":"{{ local.message }}"}},{"tag":"div","visual":"actions","children":[{"component":"Button","props":{"label":"Cancel","treatment":"plain","disabled":"{{ local.locked }}"},"on":{"press":{"emit":"cancel","when":"{{ !local.locked }}"}}}],"when":"{{ props.showCancel }}"}]},"visual":{"recipes":{"paymentMount":{"base":{"minWidth":"0","minHeight":"8rem"}},"actions":{"base":{"display":"flex","justifyContent":"flex-end","alignItems":"center","gap":"{space2}"}}}}},"PaymentAuthentication":{"inputs":{"publishableKey":{"type":"string","required":true},"clientSecret":{"type":"string","required":true},"paymentMethodId":{"type":"string","required":false,"default":""},"returnUrl":{"type":"string","required":true},"recoveryId":{"type":"string","required":true},"amountCents":{"type":"number","required":true},"completing":{"type":"boolean","required":true},"problem":{"type":"any","required":true},"reconciling":{"type":"boolean","required":true}},"outputs":{"complete":{"payload":{"recoveryId":{"type":"string","required":true},"amountCents":{"type":"number","required":true}}},"lock":{"payload":{"locked":{"type":"boolean","required":true}}}},"state":{"ready":false,"confirming":false,"message":""},"computed":{"locked":"{{ local.confirming || props.completing || props.reconciling }}","canSubmit":"{{ local.ready && !local.locked }}"},"view":{"tag":"form","visual":"formStack","props":{"id":"add-credits-payment-authentication-form"},"use":[{"element":"card_setup_form","publishableKey":"{{ props.publishableKey }}","clientSecret":"{{ props.clientSecret }}","paymentMethodId":"{{ props.paymentMethodId }}","mode":"authentication","returnUrl":"{{ props.returnUrl }}","appearance":{"theme":"stripe","variables":{"colorPrimary":"#174D3B","colorBackground":"#FFFFFF","colorText":"#1B2520","colorTextSecondary":"#5B665F","colorTextPlaceholder":"#858A85","colorDanger":"#A63A32","borderRadius":"10px"}},"appearanceDark":{"theme":"night","variables":{"colorPrimary":"#8BD9B7","colorBackground":"#202A25","colorText":"#F4EEE2","colorTextSecondary":"#C2B9AB","colorTextPlaceholder":"#777F79","colorDanger":"#F19A8F","borderRadius":"10px"}},"onReady":{"op":"set","path":"local.ready","value":true},"onSubmit":[{"op":"set","path":"local.confirming","value":true},{"op":"set","path":"local.message","value":""},{"emit":"lock","locked":true}],"onSuccess":[{"op":"set","path":"local.confirming","value":false},{"emit":"lock","locked":false},{"emit":"complete","recoveryId":"{{ props.recoveryId }}","amountCents":"{{ props.amountCents }}"}],"onError":[{"op":"set","path":"local.confirming","value":false},{"op":"set","path":"local.message","value":"{{ card.message }}"},{"emit":"lock","locked":false}],"onChange":{"op":"set","path":"local.message","value":"{{ card.message }}"}}],"children":[{"component":"AsyncStatus","when":"{{ local.message != '' }}","props":{"kind":"error","message":"{{ local.message }}"}},{"component":"AsyncStatus","when":"{{ props.completing }}","props":{"kind":"loading","message":"Finishing payment..."}},{"component":"AsyncStatus","when":"{{ props.reconciling }}","props":{"kind":"loading","message":"Confirming payment..."}},{"component":"AsyncStatus","when":"{{ props.problem != null && !props.reconciling }}","props":{"kind":"error","message":"{{ props.problem.message }}"}},{"component":"Button","props":{"label":"Confirm payment","treatment":"primary","type":"submit","disabled":"{{ !local.canSubmit }}","busy":"{{ local.locked }}"}}]},"visual":{"recipes":{}}},"AddCreditsDialog":{"inputs":{"cardReturnUrl":{"type":"string","required":true},"paymentReturnUrl":{"type":"string","required":true}},"outputs":{"close":{"payload":{}}},"state":{"choiceCents":null,"saveAttempted":false,"cardSaveAttempted":false,"authenticationRequested":false,"authenticationCompleted":false,"paymentLocked":false,"removeAttempted":false,"cardUpdateRequested":false,"spentCardSession":""},"computed":{"cardReturnActive":"{{ route.query.billing == 'card-return' && route.query.setup_intent != null }}","paymentReturnActive":"{{ route.query.billing == 'payment-return' }}","billingReady":"{{ currentAccountBilling != null && currentAccountBilling.enabled && currentAccountBilling.payments }}","paymentRecovery":"{{ currentAccountBilling != null && currentAccountBilling.enabled && currentAccountBilling.paymentRecovery != null ? currentAccountBilling.paymentRecovery : null }}","paymentPending":"{{ currentAccountBilling != null && currentAccountBilling.enabled && currentAccountBilling.paymentPending != null ? currentAccountBilling.paymentPending : null }}","paymentPendingCheckable":"{{ currentAccountBilling != null && currentAccountBilling.enabled && currentAccountBilling.paymentPending != null && currentAccountBilling.paymentPending.checkable }}","currentCents":"{{ local.billingReady && currentAccountBilling.topOff.enabled ? currentAccountBilling.topOff.amountCents : 0 }}","pickedCents":"{{ local.choiceCents ?? (local.currentCents > 0 ? local.currentCents : 2000) }}","choiceDirty":"{{ local.pickedCents != local.currentCents }}","authenticationBeginReady":"{{ local.authenticationRequested && fx.beginPaymentAuthentication.status == 'ok' && fx.beginPaymentAuthentication.result != null }}","authenticationSessionReady":"{{ local.authenticationBeginReady && !fx.beginPaymentAuthentication.result.complete && fx.beginPaymentAuthentication.result.recovery_id != null && fx.beginPaymentAuthentication.result.recovery_id != '' && fx.beginPaymentAuthentication.result.amount_cents > 0 && fx.beginPaymentAuthentication.result.publishable_key != null && fx.beginPaymentAuthentication.result.publishable_key != '' && fx.beginPaymentAuthentication.result.client_secret != null && fx.beginPaymentAuthentication.result.client_secret != '' }}","authenticationDirectReady":"{{ local.authenticationBeginReady && fx.beginPaymentAuthentication.result.complete && fx.beginPaymentAuthentication.result.recovery_id != null && fx.beginPaymentAuthentication.result.recovery_id != '' && fx.beginPaymentAuthentication.result.amount_cents > 0 }}","authenticationResultMalformed":"{{ local.authenticationBeginReady && !local.authenticationDirectReady && !local.authenticationSessionReady }}","returnedPaymentComplete":"{{ local.paymentReturnActive && route.query.payment_intent != null && currentAccountBilling != null && currentAccountBilling.enabled && currentAccountBilling.paymentOutcome != null && currentAccountBilling.paymentOutcome.paymentIntentId == route.query.payment_intent && currentAccountBilling.paymentOutcome.status == 'succeeded' }}","returnedPaymentCanceled":"{{ local.paymentReturnActive && route.query.payment_intent != null && currentAccountBilling != null && currentAccountBilling.enabled && currentAccountBilling.paymentOutcome != null && currentAccountBilling.paymentOutcome.paymentIntentId == route.query.payment_intent && currentAccountBilling.paymentOutcome.status == 'canceled' }}","outcomeMessage":"{{ (local.authenticationCompleted || local.returnedPaymentComplete) ? 'Payment confirmed. Credits added.' : (local.returnedPaymentCanceled ? 'Payment canceled. No credits were added.' : '') }}","outcomeKind":"{{ local.returnedPaymentCanceled && !local.authenticationCompleted && !local.returnedPaymentComplete ? 'error' : 'success' }}","dialogLocked":"{{ local.paymentLocked || fx.saveCard.busy || fx.saveCard.problem.retry == 'reconcile' || fx.beginPaymentAuthentication.busy || fx.completePaymentAuthentication.busy || fx.completePaymentAuthentication.problem.retry == 'reconcile' || fx.saveTopOff.busy || fx.saveTopOff.problem.retry == 'reconcile' || fx.removeCard.busy || fx.removeCard.problem.retry == 'reconcile' }}","dialogActive":"{{ local.billingReady && (!local.cardReturnActive || fx.saveCard.status == 'ok' || local.paymentRecovery != null || local.paymentPending != null) && local.outcomeMessage == '' }}","formVisible":"{{ local.dialogActive && local.paymentRecovery == null && local.paymentPending == null }}","cardSaved":"{{ billingCardOnFile && !local.cardUpdateRequested }}","cardSaveInFlight":"{{ local.cardSaveAttempted && (fx.saveCard.busy || fx.saveCard.problem.retry == 'reconcile' || (fx.saveCard.status == 'ok' && !billingCardOnFile)) }}","cardSaveFailed":"{{ local.cardSaveAttempted && fx.saveCard.status == 'problem' && fx.saveCard.problem.retry != 'reconcile' }}","cardSessionFresh":"{{ fx.beginCardSetup.status == 'ok' && fx.beginCardSetup.result != null && fx.beginCardSetup.result.publishable_key != null && fx.beginCardSetup.result.client_secret != null && fx.beginCardSetup.occurrence != local.spentCardSession }}","cardEntryPending":"{{ !local.cardSaveInFlight && !local.cardSaveFailed && !local.cardSessionFresh }}","cardSessionFailed":"{{ local.cardEntryPending && fx.beginCardSetup.status == 'problem' }}","cardSessionPreparing":"{{ local.cardEntryPending && fx.beginCardSetup.status != 'problem' }}","cardSessionWanted":"{{ local.cardEntryPending && (fx.beginCardSetup.status == 'idle' || fx.beginCardSetup.occurrence == local.spentCardSession) }}","cardEntryVisible":"{{ !local.cardSaved && local.cardSessionFresh }}","canSave":"{{ !local.dialogLocked && local.paymentRecovery == null && local.paymentPending == null && (local.cardEntryVisible || (local.choiceDirty && (local.pickedCents == 0 || billingCardOnFile))) }}","choiceMarksVisible":"{{ local.billingReady && currentAccountBilling.topOff.updatedAtMs != null }}"},"view":{"component":"DialogOverlay","on":{"close":[{"op":"set","when":"{{ !local.dialogLocked }}","path":"local.saveAttempted","value":false,"andThen":{"op":"set","path":"local.authenticationCompleted","value":false,"andThen":{"op":"set","path":"local.choiceCents","value":null}}},{"emit":"close","when":"{{ !local.dialogLocked }}"}]},"children":[{"tag":"div","visual":["dialogSurface","surfaceFrame"],"props":{"role":"dialog","aria-modal":"true","aria-labelledby":"add-credits-dialog-title","data-governed-surface":"","data-dialog-surface":""},"children":[{"tag":"div","visual":"fixedChrome","children":[{"component":"ChromeRow","props":{"distribution":"leading"},"slots":{"left":{"component":"SlotCluster","props":{"wrap":true},"children":[{"tag":"h2","visual":"dialogTitle","props":{"id":"add-credits-dialog-title"},"text":"Manage credits"},{"tag":"span","when":"{{ local.billingReady }}","visual":["hint","pill"],"props":{"aria-label":"Current balance {{ currentAccountBilling.availableUsd }}"},"text":"{{ currentAccountBilling.availableUsd }} available"}]},"right":{"component":"IconButton","props":{"icon":"lucide__X","label":"Close Manage credits","disabled":"{{ local.dialogLocked }}"},"on":{"press":[{"op":"set","when":"{{ !local.dialogLocked }}","path":"local.saveAttempted","value":false,"andThen":{"op":"set","path":"local.authenticationCompleted","value":false,"andThen":{"op":"set","path":"local.choiceCents","value":null}}},{"emit":"close","when":"{{ !local.dialogLocked }}"}]}}}}]},{"tag":"div","visual":["surfaceGutter","scrollingContent"],"props":{"data-mui-scroll-root":""},"children":[{"component":"AsyncStatus","when":"{{ fx.accountSummary.busy && currentAccountBilling == null }}","props":{"kind":"loading","message":"Loading billing..."}},{"component":"AsyncStatus","when":"{{ !fx.accountSummary.busy && currentAccountBilling == null }}","props":{"kind":"empty","message":"Billing is unavailable."}},{"component":"AsyncStatus","when":"{{ currentAccountBilling != null && !currentAccountBilling.enabled }}","props":{"kind":"empty","message":"Billing is not enabled."}},{"component":"AsyncStatus","when":"{{ currentAccountBilling != null && currentAccountBilling.enabled && !currentAccountBilling.payments }}","props":{"kind":"empty","message":"Payments are not available yet."}},{"tag":"div","when":"{{ local.cardReturnActive && local.paymentRecovery == null && local.paymentPending == null }}","visual":"contentStack","children":[{"component":"AsyncStatus","when":"{{ fx.saveCard.status == 'idle' || fx.saveCard.busy || fx.saveCard.problem.retry == 'reconcile' }}","props":{"kind":"loading","message":"Finishing your payment method..."}},{"component":"AsyncStatus","when":"{{ fx.saveCard.status == 'problem' && fx.saveCard.problem.retry != 'reconcile' }}","props":{"kind":"error","message":"{{ fx.saveCard.problem.message }}"}},{"component":"AsyncStatus","when":"{{ fx.saveCard.status == 'ok' }}","props":{"kind":"success","message":"Payment method saved."}},{"component":"Button","when":"{{ fx.saveCard.status == 'problem' && fx.saveCard.problem.retry != 'never' && fx.saveCard.problem.retry != 'reconcile' }}","props":{"label":"Try Again","treatment":"primary"},"on":{"press":{"call":"saveCard","when":"{{ local.paymentRecovery == null && local.paymentPending == null && route.query.setup_intent != null && !fx.saveCard.busy }}","setup_intent_id":"{{ route.query.setup_intent }}"}}},{"tag":"div","when":"{{ state.user.status == 'signedIn' && route.query.setup_intent != null && currentAccountBilling != null && currentAccountBilling.enabled && fx.saveCard.status == 'idle' }}","use":[{"behavior":"delay","ms":0,"action":[{"op":"set","path":"local.cardSaveAttempted","value":true},{"call":"saveCard","when":"{{ route.query.setup_intent != null && !fx.saveCard.busy && !fx.saveCard.ok }}","setup_intent_id":"{{ route.query.setup_intent }}"}]}]}]},{"tag":"div","when":"{{ local.outcomeMessage != '' }}","visual":"contentStack","children":[{"component":"AsyncStatus","props":{"kind":"{{ local.outcomeKind }}","message":"{{ local.outcomeMessage }}"}},{"tag":"div","visual":"actions","children":[{"component":"Button","props":{"label":"Done","treatment":"primary"},"on":{"press":[{"op":"set","path":"local.saveAttempted","value":false,"andThen":{"op":"set","path":"local.authenticationCompleted","value":false,"andThen":{"op":"set","path":"local.choiceCents","value":null}}},{"emit":"close"}]}}]}]},{"tag":"div","when":"{{ local.dialogActive }}","visual":"contentStack","children":[{"tag":"section","when":"{{ local.paymentRecovery != null || local.paymentPending != null }}","visual":"formStack","children":[{"tag":"h3","visual":"sectionTitle","text":"{{ (local.authenticationSessionReady || (local.paymentRecovery != null && local.paymentPending == null)) ? 'Payment authentication' : 'Payment pending' }}"},{"tag":"p","visual":"hint","text":"{{ (local.authenticationSessionReady || (local.paymentRecovery != null && local.paymentPending == null)) ? 'Additional authentication is required to finish this payment.' : 'We’re still confirming this payment. Don’t submit another payment while it is pending.' }}"},{"component":"AsyncStatus","when":"{{ local.authenticationRequested && (fx.beginPaymentAuthentication.status == 'idle' || fx.beginPaymentAuthentication.busy) }}","props":{"kind":"loading","message":"{{ local.paymentPending != null ? 'Checking payment...' : 'Preparing payment authentication...' }}"}},{"component":"AsyncStatus","when":"{{ local.authenticationRequested && fx.beginPaymentAuthentication.status == 'problem' }}","props":{"kind":"error","message":"{{ fx.beginPaymentAuthentication.problem.message }}"}},{"component":"Button","when":"{{ !local.authenticationSessionReady && !local.authenticationDirectReady && ((local.paymentRecovery != null && (!local.authenticationRequested || fx.beginPaymentAuthentication.status == 'problem' || local.authenticationResultMalformed)) || (local.paymentPendingCheckable && !fx.beginPaymentAuthentication.busy)) }}","props":{"label":"{{ local.paymentPending != null ? 'Check payment' : (local.authenticationRequested ? 'Try Again' : 'Continue authentication') }}","treatment":"primary","disabled":"{{ fx.beginPaymentAuthentication.busy || fx.beginPaymentAuthentication.problem.retry == 'never' || fx.beginPaymentAuthentication.problem.retry == 'reconcile' }}","busy":"{{ fx.beginPaymentAuthentication.busy }}"},"on":{"press":[{"op":"set","path":"local.authenticationRequested","value":true},{"call":"beginPaymentAuthentication","when":"{{ !fx.beginPaymentAuthentication.busy && fx.beginPaymentAuthentication.problem.retry != 'never' && fx.beginPaymentAuthentication.problem.retry != 'reconcile' }}"}]}},{"component":"PaymentAuthentication","when":"{{ local.authenticationSessionReady }}","props":{"publishableKey":"{{ fx.beginPaymentAuthentication.result.publishable_key }}","clientSecret":"{{ fx.beginPaymentAuthentication.result.client_secret }}","paymentMethodId":"{{ fx.beginPaymentAuthentication.result.payment_method_id != null ? fx.beginPaymentAuthentication.result.payment_method_id : '' }}","returnUrl":"{{ props.paymentReturnUrl }}","recoveryId":"{{ fx.beginPaymentAuthentication.result.recovery_id }}","amountCents":"{{ fx.beginPaymentAuthentication.result.amount_cents }}","completing":"{{ fx.completePaymentAuthentication.busy }}","problem":"{{ fx.completePaymentAuthentication.problem }}","reconciling":"{{ fx.completePaymentAuthentication.problem.retry == 'reconcile' }}"},"on":{"lock":{"op":"set","path":"local.paymentLocked","value":"{{ event.locked }}"},"complete":{"call":"completePaymentAuthentication","when":"{{ event.recoveryId != '' && event.amountCents > 0 && !fx.completePaymentAuthentication.busy && fx.completePaymentAuthentication.problem.retry != 'reconcile' }}","recoveryId":"{{ event.recoveryId }}","amountCents":"{{ event.amountCents }}","onSuccess":{"op":"set","path":"local.authenticationCompleted","value":true}}}},{"component":"Button","when":"{{ local.authenticationDirectReady }}","props":{"label":"Finish payment","treatment":"primary","disabled":"{{ fx.completePaymentAuthentication.busy || fx.completePaymentAuthentication.problem.retry == 'reconcile' }}","busy":"{{ fx.completePaymentAuthentication.busy }}"},"on":{"press":{"call":"completePaymentAuthentication","when":"{{ fx.beginPaymentAuthentication.result.recovery_id != null && fx.beginPaymentAuthentication.result.amount_cents > 0 && !fx.completePaymentAuthentication.busy && fx.completePaymentAuthentication.problem.retry != 'reconcile' }}","recoveryId":"{{ fx.beginPaymentAuthentication.result.recovery_id }}","amountCents":"{{ fx.beginPaymentAuthentication.result.amount_cents }}","onSuccess":{"op":"set","path":"local.authenticationCompleted","value":true}}}},{"component":"AsyncStatus","when":"{{ local.authenticationResultMalformed }}","props":{"kind":"error","message":"Payment details could not be prepared. Try again."}}]},{"tag":"div","when":"{{ local.formVisible }}","visual":"formStack","children":[{"tag":"div","visual":"labelValueStack","children":[{"component":"SlotCluster","props":{"wrap":true},"children":[{"tag":"h3","visual":"sectionTitle","props":{"id":"add-credits-auto-reload-heading"},"text":"Automatic reload"},{"tag":"span","when":"{{ local.choiceDirty }}","visual":["hint","pill"],"text":"Not saved"}]},{"tag":"p","visual":"hint","text":"When a build needs more than your balance, we'll charge your card for this amount."}]},{"component":"SlotCluster","props":{"wrap":true},"children":[{"tag":"div","repeat":{"items":"{{ state.reloadLevels }}","key":true},"visual":"choiceCell","children":[{"component":"Button","visual":{"recipe":"currentChoice","when":"{{ local.choiceMarksVisible && item == local.currentCents }}"},"props":{"label":"{{ item == 0 ? 'Off' : '$' + item / 100 + ' credits' }}","treatment":"{{ item == local.pickedCents ? 'primary' : 'secondary' }}","disabled":"{{ local.dialogLocked }}"},"on":{"press":{"op":"set","path":"local.choiceCents","value":"{{ item }}"}}},{"tag":"span","when":"{{ local.choiceMarksVisible && item == local.currentCents }}","visual":["choiceMark","currentMark"],"text":"Current"},{"tag":"span","when":"{{ local.choiceMarksVisible && item == local.pickedCents && item != local.currentCents }}","visual":["choiceMark","newMark"],"text":"New"}]}],"visual":"choiceRow"},{"tag":"div","children":[{"component":"Divider"},{"tag":"h3","visual":["sectionTitle","spaceBelow"],"text":"Payment method"},{"tag":"div","when":"{{ local.cardSaved }}","visual":"collectionItem","children":[{"tag":"div","visual":"paymentMethod","children":[{"tag":"div","visual":"labelValueStack","children":[{"tag":"span","text":"{{ currentAccountBilling.card.brand != null && currentAccountBilling.card.brand != '' ? currentAccountBilling.card.brand : 'Card' }} ending in {{ currentAccountBilling.card.last4 }}"},{"tag":"span","when":"{{ currentAccountBilling.card.expMonth != null && currentAccountBilling.card.expYear != null }}","visual":"hint","text":"Expires {{ currentAccountBilling.card.expMonth }}/{{ currentAccountBilling.card.expYear }}"}]},{"component":"SlotCluster","children":[{"component":"Button","props":{"label":"Update","treatment":"plain","disabled":"{{ local.dialogLocked }}"},"on":{"press":[{"op":"set","path":"local.cardSaveAttempted","value":false,"andThen":{"op":"set","path":"local.cardUpdateRequested","value":true}}]}},{"component":"IconButton","props":{"icon":"lucide__Trash","label":"Remove saved card","treatment":"plain","disabled":"{{ local.dialogLocked }}","busy":"{{ fx.removeCard.busy }}"},"on":{"press":[{"op":"set","path":"local.removeAttempted","value":true},{"call":"removeCard","when":"{{ local.paymentRecovery == null && local.paymentPending == null && !fx.removeCard.busy && fx.removeCard.problem.retry != 'never' && fx.removeCard.problem.retry != 'reconcile' }}","onSuccess":[{"op":"set","path":"local.removeAttempted","value":false},{"op":"set","path":"local.cardUpdateRequested","value":false},{"op":"set","path":"local.cardSaveAttempted","value":false}]}]}}]}]}]},{"tag":"div","when":"{{ !local.cardSaved }}","visual":"contentStack","children":[{"component":"AsyncStatus","when":"{{ local.cardSaveInFlight }}","props":{"kind":"loading","message":"{{ fx.saveCard.problem.retry == 'reconcile' ? 'Confirming your saved card...' : 'Saving your card...' }}"}},{"tag":"div","when":"{{ local.cardSaveFailed }}","visual":"contentStack","children":[{"component":"AsyncStatus","props":{"kind":"error","message":"{{ fx.saveCard.problem.message }}"}},{"component":"Button","props":{"label":"Try again","treatment":"primary"},"on":{"press":{"op":"set","path":"local.cardSaveAttempted","value":false}}}]},{"component":"PaymentMethodSetup","when":"{{ local.cardSessionFresh }}","props":{"publishableKey":"{{ fx.beginCardSetup.result.publishable_key }}","clientSecret":"{{ fx.beginCardSetup.result.client_secret }}","returnUrl":"{{ props.cardReturnUrl }}","showCancel":"{{ billingCardOnFile }}"},"on":{"lock":{"op":"set","path":"local.paymentLocked","value":"{{ event.locked }}"},"save":[{"op":"set","path":"local.spentCardSession","value":"{{ fx.beginCardSetup.occurrence }}","andThen":{"op":"set","path":"local.cardSaveAttempted","value":true}},{"call":"saveCard","when":"{{ local.paymentRecovery == null && local.paymentPending == null && event.setupIntentId != '' && !fx.saveCard.busy && fx.saveCard.problem.retry != 'reconcile' }}","setup_intent_id":"{{ event.setupIntentId }}","onSuccess":{"op":"set","path":"local.cardUpdateRequested","value":false},"topOffEnabled":"{{ local.pickedCents > 0 }}","topOffAmountCents":"{{ local.pickedCents > 0 ? local.pickedCents : 1000 }}"}],"cancel":{"op":"set","path":"local.cardUpdateRequested","value":false}}},{"tag":"div","when":"{{ local.cardSessionFailed }}","visual":"contentStack","children":[{"component":"AsyncStatus","props":{"kind":"error","message":"{{ fx.beginCardSetup.problem.message }}"}},{"component":"Button","props":{"label":"Try again","treatment":"primary","disabled":"{{ fx.beginCardSetup.problem.retry == 'never' || fx.beginCardSetup.problem.retry == 'reconcile' }}"},"on":{"press":{"call":"beginCardSetup","when":"{{ !fx.beginCardSetup.busy && fx.beginCardSetup.problem.retry != 'never' && fx.beginCardSetup.problem.retry != 'reconcile' }}"}}}]},{"component":"AsyncStatus","when":"{{ local.cardSessionPreparing }}","props":{"kind":"loading","message":"Preparing the secure card form..."}},{"tag":"div","when":"{{ local.cardSessionWanted }}","use":[{"behavior":"delay","ms":0,"action":{"call":"beginCardSetup"}}]}]}]},{"component":"AsyncStatus","when":"{{ local.removeAttempted && fx.removeCard.status == 'problem' && fx.removeCard.problem.retry != 'reconcile' }}","props":{"kind":"error","message":"{{ fx.removeCard.problem.message }}"}},{"component":"AsyncStatus","when":"{{ local.removeAttempted && fx.removeCard.problem.retry == 'reconcile' }}","props":{"kind":"loading","message":"Confirming the card removal..."}},{"component":"AsyncStatus","when":"{{ local.saveAttempted && fx.saveTopOff.status == 'problem' && fx.saveTopOff.problem.retry != 'reconcile' }}","props":{"kind":"error","message":"{{ fx.saveTopOff.problem.message }}"}},{"component":"AsyncStatus","when":"{{ local.saveAttempted && fx.saveTopOff.problem.retry == 'reconcile' }}","props":{"kind":"loading","message":"Confirming your automatic reload settings..."}}]}]},{"component":"AsyncStatus","fallback":true,"props":{"kind":"error","message":"{{ problem.message }}"}}]},{"tag":"footer","when":"{{ local.formVisible }}","visual":"fixedChrome","children":[{"component":"ChromeRow","visual":"dialogFooter","props":{"distribution":"leading"},"slots":{"right":{"component":"Button","props":{"label":"Save Auto-Reload","treatment":"primary","type":"{{ local.cardEntryVisible ? 'submit' : 'button' }}","form":"{{ local.cardEntryVisible ? 'add-credits-payment-method-form' : '' }}","disabled":"{{ !local.canSave }}","busy":"{{ fx.saveTopOff.busy || fx.saveTopOff.problem.retry == 'reconcile' || fx.saveCard.busy || local.paymentLocked }}"},"on":{"press":[{"op":"set","path":"local.saveAttempted","value":true},{"call":"saveTopOff","when":"{{ !local.cardEntryVisible && local.canSave }}","enabled":"{{ local.pickedCents > 0 }}","amountCents":"{{ local.pickedCents > 0 ? local.pickedCents : 1000 }}"}]}}}}]}]}]},"visual":{"recipes":{"contentStack":{"base":{"display":"grid","gap":"{space4}","minWidth":"0"}},"hint":{"base":{"margin":"0","color":"{colorTextMutedLight}","fontSize":"0.875rem"},"at":{"dark":{"color":"{colorTextMutedDark}"}}},"actions":{"base":{"display":"flex","justifyContent":"flex-end","alignItems":"center","gap":"{space2}"}},"paymentMethod":{"base":{"display":"flex","alignItems":"center","justifyContent":"space-between","gap":"{space3}","minWidth":"0"}},"choiceCell":{"base":{"display":"grid","justifyItems":"center","gap":"{space1}","minWidth":"0"}},"currentChoice":{"base":{"boxShadow":"0 0 0 2px {colorBorderStrongLight}"},"at":{"dark":{"boxShadow":"0 0 0 2px {colorBorderStrongDark}"}}},"currentMark":{"base":{"color":"{colorTextMutedLight}"},"at":{"dark":{"color":"{colorTextMutedDark}"}}},"choiceMark":{"base":{"fontSize":"0.6875rem","lineHeight":"1.2","fontWeight":"650"}},"newMark":{"base":{"color":"{colorSuccessLight}"},"at":{"dark":{"color":"{colorSuccessDark}"}}}}}},"HorizontalTabs":{"inputs":{"label":{"type":"string","required":true}},"outputs":{"move":{"payload":{"index":{"type":"integer","required":true}}}},"slots":{"default":{"required":true}},"view":{"tag":"div","visual":"horizontalTabs","props":{"role":"tablist","aria-label":"{{ props.label }}"},"use":[{"behavior":"keyNav","itemSelector":"[role=tab]","orientation":"horizontal","onMove":{"emit":"move","index":"{{ nav.index }}"}}],"children":[{"slot":"default"}]},"visual":{"recipes":{"horizontalTabs":{"base":{"display":"flex","alignItems":"center","gap":"{space1}","width":"100%","minWidth":"0","maxWidth":"100%","overflowX":"auto","overflowY":"hidden","overscrollBehaviorX":"contain","blockSize":"max-content"}}}}},"BuilderFeatures":{"inputs":{"appId":{"type":"string","required":true}},"state":{"selectedCapabilityId":""},"view":{"tag":"section","visual":"formStack","props":{"id":"builder-features-panel","role":"tabpanel","aria-labelledby":"builder-features-tab"},"children":[{"tag":"div","fallback":true,"visual":"formStack","children":[{"component":"AsyncStatus","props":{"kind":"error","message":"{{ problem.message }}"}},{"component":"Button","when":"{{ problem.retry != 'never' }}","props":{"label":"Try again"},"on":{"press":{"call":"data.refresh","value":"appAdministration"}}}]},{"component":"AsyncStatus","when":"{{ selectedAppAdministration.id != props.appId && !fx.appAdministration.ok }}","props":{"kind":"loading","message":"Loading features…"}},{"component":"AsyncStatus","when":"{{ selectedAppAdministration.id == props.appId && fx.appAdministration.ok && count(selectedAppCapabilities) == 0 }}","props":{"kind":"empty","message":"No features are available for this app."}},{"tag":"ul","when":"{{ count(selectedAppCapabilities) > 0 }}","visual":"actionList","children":[{"tag":"li","repeat":{"items":"{{ selectedAppCapabilities }}","as":"capability","key":"id"},"visual":"actionRowGroup","children":[{"tag":"div","visual":"actionRowSurface","children":[{"tag":"div","visual":"labelValueStack","children":[{"tag":"strong","text":"{{ capability.label }}"},{"tag":"span","visual":"actionRowSummary","text":"{{ capability.summary }}"}]},{"tag":"span","when":"{{ capability.status == 'included' }}","visual":"pill","text":"Included"},{"component":"Button","when":"{{ capability.manageable && capability.status != 'included' }}","visual":"promoteAction","props":{"label":"{{ capability.configuration.replacement != null || capability.status != 'off' ? 'Manage' : 'Setup' }}","treatment":"secondary","size":"small"},"on":{"press":{"op":"set","path":"local.selectedCapabilityId","value":"{{ capability.id }}"}}}]},{"component":"CapabilitySetupDialog","when":"{{ local.selectedCapabilityId == capability.id && capability.configuration != null }}","props":{"appId":"{{ props.appId }}","capabilityId":"{{ capability.id }}","label":"{{ capability.label }}","summary":"{{ capability.summary }}","kind":"{{ capability.kind }}","revision":"{{ capability.configuration.revision }}","fields":"{{ capability.configuration.fields }}","secrets":"{{ capability.configuration.secrets }}","hasReplacement":"{{ capability.configuration.replacement != null }}","replacementFields":"{{ capability.configuration.replacement.fields }}","replacementSecrets":"{{ capability.configuration.replacement.secrets }}","hasSavedSettings":"{{ capability.configuration.replacement != null || capability.status != 'off' }}","capability":"{{ capability }}"},"on":{"close":{"op":"set","path":"local.selectedCapabilityId","value":""}}}]}]}]}},"CapabilitySetupDialog":{"inputs":{"appId":{"type":"string","required":true},"capabilityId":{"type":"string","required":true},"label":{"type":"string","required":true},"summary":{"type":"string","required":true},"kind":{"type":"string","required":true},"revision":{"type":"number","required":true},"fields":{"type":"array","required":true,"items":{"type":"object","members":{"id":"string","label":"string","description":"string","type":"string","required":"boolean","value":{"type":"any","optional":true}}}},"secrets":{"type":"array","required":true,"items":{"type":"object","members":{"id":"string","label":"string","description":"string","type":"string","required":"boolean","set":"boolean"}}},"hasReplacement":{"type":"boolean","required":true},"replacementFields":{"type":"array","required":false,"default":[],"items":{"type":"object","members":{"id":"string","label":"string","description":"string","type":"string","required":"boolean","value":{"type":"any","optional":true}}}},"replacementSecrets":{"type":"array","required":false,"default":[],"items":{"type":"object","members":{"id":"string","label":"string","description":"string","type":"string","required":"boolean","set":"boolean"}}},"hasSavedSettings":{"type":"boolean","required":true},"capability":{"type":"object","required":true}},"outputs":{"close":{"payload":{}}},"state":{"configDraft":{},"secretDraft":{},"saveAttempted":false,"readyMissingFieldIds":[],"invalidCurrentFieldIds":[],"readyMissingSecretIds":[]},"computed":{"locked":"{{ fx.saveAndCheckFeature[props.capabilityId].busy || fx.saveAndCheckFeature[props.capabilityId].problem.retry == 'reconcile' }}","activeFields":"{{ props.hasReplacement ? props.replacementFields : props.fields }}","activeSecrets":"{{ props.hasReplacement ? props.replacementSecrets : props.secrets }}","requiredFields":"{{ filterBy(local.activeFields, 'required', true) }}","requiredSecrets":"{{ filterBy(local.activeSecrets, 'required', true) }}","publishedRequiredFieldsReady":"{{ count(compact(pluck(local.requiredFields, 'value'))) }}","publishedRequiredSecretsReady":"{{ count(filterBy(local.requiredSecrets, 'set', true)) }}","requiredReady":"{{ local.publishedRequiredFieldsReady + count(local.readyMissingFieldIds) - count(local.invalidCurrentFieldIds) == count(local.requiredFields) && local.publishedRequiredSecretsReady + count(local.readyMissingSecretIds) == count(local.requiredSecrets) }}","verificationStatus":"{{ props.hasReplacement ? props.capability.configuration.replacement.verification.status : props.capability.verification.status }}","verificationCode":"{{ props.hasReplacement ? get(props.capability.configuration.replacement.verification, 'code', '') : get(props.capability.verification, 'code', '') }}","verificationMessage":"{{ props.hasReplacement ? get(first(filterBy(props.capability.configuration.replacement.verification.facts, 'readiness', 'attention')), 'message', '') : get(first(filterBy(props.capability.verification.facts, 'readiness', 'attention')), 'message', '') }}"},"view":{"component":"DialogOverlay","on":{"close":[{"op":"set","path":"local.secretDraft","value":{}},{"op":"set","path":"local.readyMissingSecretIds","value":[]},{"emit":"close","when":"{{ !local.locked }}"}]},"children":[{"tag":"div","visual":["dialogSurface","surfaceFrame"],"props":{"role":"dialog","aria-modal":"true","aria-labelledby":"capability-setup-dialog-title","data-governed-surface":"","data-dialog-surface":""},"children":[{"tag":"header","visual":"fixedChrome","children":[{"component":"ChromeRow","props":{"distribution":"leading"},"slots":{"left":{"tag":"h2","visual":"dialogTitle","props":{"id":"capability-setup-dialog-title"},"text":"{{ props.label }}"},"right":{"component":"IconButton","props":{"icon":"lucide__X","label":"Close feature setup","disabled":"{{ local.locked }}"},"on":{"press":[{"op":"set","path":"local.secretDraft","value":{}},{"op":"set","path":"local.readyMissingSecretIds","value":[]},{"emit":"close","when":"{{ !local.locked }}"}]}}}}]},{"tag":"div","visual":["surfaceGutter","scrollingContent","formStack"],"props":{"data-mui-scroll-root":""},"children":[{"tag":"p","visual":"formHint","text":"{{ props.summary }}"},{"tag":"form","visual":"formStack","props":{"id":"capability-setup-form"},"on":{"submit":[{"op":"set","path":"local.saveAttempted","value":true},{"op":"set","path":"local.secretDraft","value":{}},{"op":"set","path":"local.readyMissingSecretIds","value":[]},{"call":"saveAndCheckFeature","key":"{{ props.capabilityId }}","when":"{{ !local.locked && local.requiredReady }}","appId":"{{ props.appId }}","kind":"{{ props.kind }}","expectedRevision":"{{ props.revision }}","config":"{{ local.configDraft }}","secrets":"{{ local.secretDraft }}"}]},"children":[{"tag":"div","when":"{{ !props.hasReplacement }}","children":[{"component":"CapabilityConfigInput","repeat":{"items":"{{ props.fields }}","as":"featureField","key":"id"},"props":{"id":"{{ featureField.id }}","label":"{{ featureField.label }}","description":"{{ featureField.description }}","currentValue":"{{ featureField.value ?? '' }}","value":"{{ get(local.configDraft, featureField.id, featureField.value ?? '') }}","required":"{{ featureField.required }}","disabled":"{{ local.locked }}"},"on":{"change":[{"op":"set","path":"local.saveAttempted","value":false},{"op":"merge","path":"local.configDraft","value":"{{ fromJson('{' + toJson(event.id) + ':' + toJson(event.value) + '}') }}"},{"op":"pushUnique","when":"{{ event.required && trim(event.currentValue) == '' && trim(event.value) != '' }}","path":"local.readyMissingFieldIds","value":"{{ event.id }}"},{"op":"removeFromList","when":"{{ event.required && trim(event.currentValue) == '' && trim(event.value) == '' }}","path":"local.readyMissingFieldIds","value":"{{ event.id }}"},{"op":"pushUnique","when":"{{ event.required && trim(event.currentValue) != '' && trim(event.value) == '' }}","path":"local.invalidCurrentFieldIds","value":"{{ event.id }}"},{"op":"removeFromList","when":"{{ event.required && trim(event.currentValue) != '' && trim(event.value) != '' }}","path":"local.invalidCurrentFieldIds","value":"{{ event.id }}"}]}}]},{"tag":"div","when":"{{ props.hasReplacement }}","children":[{"component":"CapabilityConfigInput","repeat":{"items":"{{ props.replacementFields }}","as":"replacementField","key":"id"},"props":{"id":"{{ replacementField.id }}","label":"{{ replacementField.label }}","description":"{{ replacementField.description }}","currentValue":"{{ replacementField.value ?? '' }}","value":"{{ get(local.configDraft, replacementField.id, replacementField.value ?? '') }}","required":"{{ replacementField.required }}","disabled":"{{ local.locked }}"},"on":{"change":[{"op":"set","path":"local.saveAttempted","value":false},{"op":"merge","path":"local.configDraft","value":"{{ fromJson('{' + toJson(event.id) + ':' + toJson(event.value) + '}') }}"},{"op":"pushUnique","when":"{{ event.required && trim(event.currentValue) == '' && trim(event.value) != '' }}","path":"local.readyMissingFieldIds","value":"{{ event.id }}"},{"op":"removeFromList","when":"{{ event.required && trim(event.currentValue) == '' && trim(event.value) == '' }}","path":"local.readyMissingFieldIds","value":"{{ event.id }}"},{"op":"pushUnique","when":"{{ event.required && trim(event.currentValue) != '' && trim(event.value) == '' }}","path":"local.invalidCurrentFieldIds","value":"{{ event.id }}"},{"op":"removeFromList","when":"{{ event.required && trim(event.currentValue) != '' && trim(event.value) != '' }}","path":"local.invalidCurrentFieldIds","value":"{{ event.id }}"}]}}]},{"tag":"div","when":"{{ !props.hasReplacement }}","children":[{"component":"CapabilitySecretInput","repeat":{"items":"{{ props.secrets }}","as":"featureSecret","key":"id"},"props":{"id":"{{ featureSecret.id }}","label":"{{ featureSecret.label }}","description":"{{ featureSecret.description }}","set":"{{ featureSecret.set }}","value":"{{ get(local.secretDraft, featureSecret.id, '') }}","required":"{{ featureSecret.required }}","disabled":"{{ local.locked }}"},"on":{"change":[{"op":"set","path":"local.saveAttempted","value":false},{"op":"merge","path":"local.secretDraft","value":"{{ fromJson('{' + toJson(event.id) + ':' + toJson(event.value) + '}') }}"},{"op":"pushUnique","when":"{{ event.required && !event.set && trim(event.value) != '' }}","path":"local.readyMissingSecretIds","value":"{{ event.id }}"},{"op":"removeFromList","when":"{{ event.required && !event.set && trim(event.value) == '' }}","path":"local.readyMissingSecretIds","value":"{{ event.id }}"}]}}]},{"tag":"div","when":"{{ props.hasReplacement }}","children":[{"component":"CapabilitySecretInput","repeat":{"items":"{{ props.replacementSecrets }}","as":"replacementSecret","key":"id"},"props":{"id":"{{ replacementSecret.id }}","label":"{{ replacementSecret.label }}","description":"{{ replacementSecret.description }}","set":"{{ replacementSecret.set }}","value":"{{ get(local.secretDraft, replacementSecret.id, '') }}","required":"{{ replacementSecret.required }}","disabled":"{{ local.locked }}"},"on":{"change":[{"op":"set","path":"local.saveAttempted","value":false},{"op":"merge","path":"local.secretDraft","value":"{{ fromJson('{' + toJson(event.id) + ':' + toJson(event.value) + '}') }}"},{"op":"pushUnique","when":"{{ event.required && !event.set && trim(event.value) != '' }}","path":"local.readyMissingSecretIds","value":"{{ event.id }}"},{"op":"removeFromList","when":"{{ event.required && !event.set && trim(event.value) == '' }}","path":"local.readyMissingSecretIds","value":"{{ event.id }}"}]}}]},{"component":"AsyncStatus","when":"{{ local.saveAttempted && fx.saveAndCheckFeature[props.capabilityId].busy }}","props":{"kind":"loading","message":"Saving and checking this feature…"}},{"component":"AsyncStatus","when":"{{ local.saveAttempted && fx.saveAndCheckFeature[props.capabilityId].problem.retry == 'reconcile' }}","props":{"kind":"loading","message":"Confirming the feature setup…"}},{"component":"AsyncStatus","when":"{{ local.saveAttempted && fx.saveAndCheckFeature[props.capabilityId].status == 'problem' && fx.saveAndCheckFeature[props.capabilityId].problem.retry != 'reconcile' }}","props":{"kind":"error","message":"{{ fx.saveAndCheckFeature[props.capabilityId].problem.message }}"}},{"component":"AsyncStatus","when":"{{ props.hasSavedSettings || local.verificationStatus == 'verified' }}","props":{"kind":"success","message":"{{ local.verificationStatus == 'verified' ? 'Connection verified.' : 'Settings are saved.' }}"}},{"component":"AsyncStatus","when":"{{ local.verificationStatus == 'rejected' }}","props":{"kind":"error","message":"{{ local.verificationMessage != '' ? local.verificationMessage : lookup(local.verificationCode, fromJson('{\"permission-denied\":\"The provider did not grant the required access. Update access or enter replacement details and check again.\"}'), 'The provider did not accept these details. Enter replacement details and check again.') }}"}},{"component":"AsyncStatus","when":"{{ local.verificationStatus == 'not-checked' && local.verificationMessage != '' }}","props":{"kind":"empty","message":"{{ local.verificationMessage }}"}},{"tag":"div","visual":"formActions","children":[{"component":"Button","props":{"label":"Save and check","treatment":"primary","type":"submit","busy":"{{ local.locked }}","disabled":"{{ local.locked || !local.requiredReady }}"}}]}]}]}]}]}},"CapabilityConfigInput":{"inputs":{"id":{"type":"string","required":true},"label":{"type":"string","required":true},"description":{"type":"string","required":true},"currentValue":{"type":"string","required":false,"default":""},"value":{"type":"string","required":true},"required":{"type":"boolean","required":true},"disabled":{"type":"boolean","required":true}},"outputs":{"change":{"payload":{"id":{"type":"string","required":true},"value":{"type":"string","required":true},"currentValue":{"type":"string","required":true},"required":{"type":"boolean","required":true}}}},"view":{"tag":"div","visual":"labelValueStack","children":[{"component":"Field","props":{"id":"capability-field-{{ props.id }}","label":"{{ props.label }}"},"slots":{"default":{"component":"TextInput","props":{"id":"{{ slot.controlId }}","name":"{{ props.id }}","type":"text","autocomplete":"off","value":"{{ props.value }}","required":"{{ props.required }}","disabled":"{{ props.disabled }}","describedBy":"capability-field-{{ props.id }}-hint"},"on":{"change":{"emit":"change","id":"{{ props.id }}","value":"{{ event.value }}","currentValue":"{{ props.currentValue }}","required":"{{ props.required }}"}}}}},{"tag":"p","visual":"formHint","props":{"id":"capability-field-{{ props.id }}-hint"},"text":"{{ props.description }}"}]}},"CapabilitySecretInput":{"inputs":{"id":{"type":"string","required":true},"label":{"type":"string","required":true},"description":{"type":"string","required":true},"set":{"type":"boolean","required":true},"value":{"type":"string","required":true},"required":{"type":"boolean","required":true},"disabled":{"type":"boolean","required":true}},"outputs":{"change":{"payload":{"id":{"type":"string","required":true},"value":{"type":"string","required":true},"required":{"type":"boolean","required":true},"set":{"type":"boolean","required":true}}}},"view":{"tag":"div","visual":"labelValueStack","children":[{"component":"Field","props":{"id":"capability-secret-{{ props.id }}","label":"{{ props.label }}"},"slots":{"default":{"component":"TextInput","props":{"id":"{{ slot.controlId }}","name":"{{ props.id }}","type":"password","autocomplete":"off","value":"{{ props.value }}","required":"{{ props.required && !props.set }}","disabled":"{{ props.disabled }}","describedBy":"capability-secret-{{ props.id }}-hint"},"on":{"change":{"emit":"change","id":"{{ props.id }}","value":"{{ event.value }}","required":"{{ props.required }}","set":"{{ props.set }}"}}}}},{"tag":"p","visual":"formHint","props":{"id":"capability-secret-{{ props.id }}-hint"},"text":"{{ props.description + (props.set ? ' A value is already saved.' : '') }}"}]}},"Toast":{"inputs":{"message":{"type":"string","required":true}},"outputs":{"dismiss":{"payload":{}}},"view":{"tag":"div","visual":"toast","use":[{"behavior":"delay","ms":4000,"action":{"emit":"dismiss"}}],"children":[{"tag":"span","text":"{{ props.message }}"},{"component":"IconButton","props":{"icon":"lucide__X","label":"Dismiss notification: {{ props.message }}"},"on":{"press":{"emit":"dismiss"}}}]},"visual":{"recipes":{"toast":{"base":{"display":"inline-flex","alignItems":"center","gap":"{space2}","paddingBlock":"{space1}","paddingInlineStart":"{space4}","paddingInlineEnd":"{space1}","borderRadius":"999px","border":"{borderThin} solid {colorBorderLight}","background":"{colorSurfaceRaisedLight}","color":"{colorTextLight}","fontSize":"0.875rem","boxShadow":"0 1.5rem 4rem rgba(16, 24, 20, 0.28)","pointerEvents":"auto"},"at":{"dark":{"borderColor":"{colorBorderDark}","background":"{colorSurfaceRaisedDark}","color":"{colorTextDark}","boxShadow":"0 1.5rem 4rem rgba(0, 0, 0, 0.48)"}}}}}},"PublishSiteDialog":{"inputs":{"appId":{"type":"string","required":true},"appName":{"type":"string","required":true},"siteAddress":{"type":"string","required":true},"siteLabel":{"type":"string","required":true},"cardReturnUrl":{"type":"string","required":true},"paymentReturnUrl":{"type":"string","required":true}},"outputs":{"close":{"payload":{}}},"state":{"cardSaveAttempted":false,"authenticationRequested":false,"authenticationCompleted":false,"paymentLocked":false,"removeAttempted":false,"cardUpdateRequested":false,"spentCardSession":"","purchaseAttempted":false},"computed":{"cardReturnActive":"{{ route.query.publication == 'card-return' && route.query.setup_intent != null }}","paymentReturnActive":"{{ route.query.publication == 'payment-return' }}","billingReady":"{{ currentAccountBilling != null && currentAccountBilling.enabled && currentAccountBilling.payments }}","paymentRecovery":"{{ currentAccountBilling != null && currentAccountBilling.enabled && currentAccountBilling.paymentRecovery != null ? currentAccountBilling.paymentRecovery : null }}","paymentPending":"{{ currentAccountBilling != null && currentAccountBilling.enabled && currentAccountBilling.paymentPending != null ? currentAccountBilling.paymentPending : null }}","paymentPendingCheckable":"{{ currentAccountBilling != null && currentAccountBilling.enabled && currentAccountBilling.paymentPending != null && currentAccountBilling.paymentPending.checkable }}","authenticationBeginReady":"{{ local.authenticationRequested && fx.beginPaymentAuthentication.status == 'ok' && fx.beginPaymentAuthentication.result != null }}","authenticationSessionReady":"{{ local.authenticationBeginReady && !fx.beginPaymentAuthentication.result.complete && fx.beginPaymentAuthentication.result.recovery_id != null && fx.beginPaymentAuthentication.result.recovery_id != '' && fx.beginPaymentAuthentication.result.amount_cents > 0 && fx.beginPaymentAuthentication.result.publishable_key != null && fx.beginPaymentAuthentication.result.publishable_key != '' && fx.beginPaymentAuthentication.result.client_secret != null && fx.beginPaymentAuthentication.result.client_secret != '' }}","authenticationDirectReady":"{{ local.authenticationBeginReady && fx.beginPaymentAuthentication.result.complete && fx.beginPaymentAuthentication.result.recovery_id != null && fx.beginPaymentAuthentication.result.recovery_id != '' && fx.beginPaymentAuthentication.result.amount_cents > 0 }}","authenticationResultMalformed":"{{ local.authenticationBeginReady && !local.authenticationDirectReady && !local.authenticationSessionReady }}","returnedPaymentComplete":"{{ local.paymentReturnActive && route.query.payment_intent != null && currentAccountBilling != null && currentAccountBilling.enabled && currentAccountBilling.paymentOutcome != null && currentAccountBilling.paymentOutcome.paymentIntentId == route.query.payment_intent && currentAccountBilling.paymentOutcome.status == 'succeeded' }}","returnedPaymentCanceled":"{{ local.paymentReturnActive && route.query.payment_intent != null && currentAccountBilling != null && currentAccountBilling.enabled && currentAccountBilling.paymentOutcome != null && currentAccountBilling.paymentOutcome.paymentIntentId == route.query.payment_intent && currentAccountBilling.paymentOutcome.status == 'canceled' }}","purchaseSettling":"{{ fx.purchasePublication[props.appId].busy || fx.purchasePublication[props.appId].problem.retry == 'reconcile' }}","publishSettling":"{{ fx.publishApp[props.appId].busy || fx.publishApp[props.appId].problem.retry == 'reconcile' }}","purchaseSettled":"{{ fx.purchasePublication[props.appId].ok }}","sitePublished":"{{ fx.publishApp[props.appId].ok }}","purchaseFailed":"{{ local.purchaseAttempted && fx.purchasePublication[props.appId].status == 'problem' && fx.purchasePublication[props.appId].problem.retry != 'reconcile' }}","publishFailed":"{{ local.purchaseSettled && fx.publishApp[props.appId].status == 'problem' && fx.publishApp[props.appId].problem.retry != 'reconcile' }}","outcomeMessage":"{{ (local.purchaseSettled && local.sitePublished) ? 'Subscription started. Your site is live.' : ((local.authenticationCompleted || local.returnedPaymentComplete) ? 'Payment confirmed. Press Publish again to put the site live.' : (local.returnedPaymentCanceled ? 'Payment canceled. Nothing was charged and the site was not published.' : '')) }}","outcomeKind":"{{ local.returnedPaymentCanceled && !local.sitePublished && !local.authenticationCompleted && !local.returnedPaymentComplete ? 'error' : 'success' }}","dialogLocked":"{{ local.paymentLocked || local.purchaseSettling || local.publishSettling || fx.saveCard.busy || fx.saveCard.problem.retry == 'reconcile' || fx.beginPaymentAuthentication.busy || fx.completePaymentAuthentication.busy || fx.completePaymentAuthentication.problem.retry == 'reconcile' || fx.removeCard.busy || fx.removeCard.problem.retry == 'reconcile' }}","dialogActive":"{{ local.billingReady && (!local.cardReturnActive || fx.saveCard.status == 'ok' || local.paymentRecovery != null || local.paymentPending != null) && local.outcomeMessage == '' }}","formVisible":"{{ local.dialogActive && local.paymentRecovery == null && local.paymentPending == null }}","cardSaved":"{{ billingCardOnFile && !local.cardUpdateRequested }}","cardSaveInFlight":"{{ local.cardSaveAttempted && (fx.saveCard.busy || fx.saveCard.problem.retry == 'reconcile' || (fx.saveCard.status == 'ok' && !billingCardOnFile)) }}","cardSaveFailed":"{{ local.cardSaveAttempted && fx.saveCard.status == 'problem' && fx.saveCard.problem.retry != 'reconcile' }}","cardSessionFresh":"{{ fx.beginCardSetup.status == 'ok' && fx.beginCardSetup.result != null && fx.beginCardSetup.result.publishable_key != null && fx.beginCardSetup.result.client_secret != null && fx.beginCardSetup.occurrence != local.spentCardSession }}","cardEntryPending":"{{ !local.cardSaveInFlight && !local.cardSaveFailed && !local.cardSessionFresh }}","cardSessionFailed":"{{ local.cardEntryPending && fx.beginCardSetup.status == 'problem' }}","cardSessionPreparing":"{{ local.cardEntryPending && fx.beginCardSetup.status != 'problem' }}","cardSessionWanted":"{{ local.cardEntryPending && (fx.beginCardSetup.status == 'idle' || fx.beginCardSetup.occurrence == local.spentCardSession) }}","cardEntryVisible":"{{ !local.cardSaved && local.cardSessionFresh }}","canBuy":"{{ !local.dialogLocked && local.paymentRecovery == null && local.paymentPending == null && (local.cardEntryVisible || local.cardSaved) }}","periodEndLabel":"{{ selectedAppSubscription != null && selectedAppSubscription.periodEndMs != null ? formatDate(fromUnix(selectedAppSubscription.periodEndMs / 1000), 'YYYY-MM-DD') : '' }}","delinquentSinceLabel":"{{ selectedAppSubscription != null && selectedAppSubscription.delinquentSinceMs != null ? formatDate(fromUnix(selectedAppSubscription.delinquentSinceMs / 1000), 'YYYY-MM-DD') : '' }}"},"view":{"component":"DialogOverlay","on":{"close":[{"op":"set","when":"{{ !local.dialogLocked }}","path":"local.purchaseAttempted","value":false,"andThen":{"op":"set","path":"local.authenticationCompleted","value":false}},{"emit":"close","when":"{{ !local.dialogLocked }}"}]},"children":[{"tag":"div","visual":["dialogSurface","surfaceFrame"],"props":{"role":"dialog","aria-modal":"true","aria-labelledby":"publish-site-dialog-title","data-governed-surface":"","data-dialog-surface":""},"children":[{"tag":"div","visual":"fixedChrome","children":[{"component":"ChromeRow","props":{"distribution":"leading"},"slots":{"left":{"component":"SlotCluster","props":{"wrap":true},"children":[{"tag":"h2","visual":"dialogTitle","props":{"id":"publish-site-dialog-title"},"text":"Publish this site"},{"tag":"span","when":"{{ local.billingReady }}","visual":["hint","pill"],"props":{"aria-label":"Current balance {{ currentAccountBilling.availableUsd }}"},"text":"{{ currentAccountBilling.availableUsd }} available"}]},"right":{"component":"IconButton","props":{"icon":"lucide__X","label":"Close Publish this site","disabled":"{{ local.dialogLocked }}"},"on":{"press":[{"op":"set","when":"{{ !local.dialogLocked }}","path":"local.purchaseAttempted","value":false,"andThen":{"op":"set","path":"local.authenticationCompleted","value":false}},{"emit":"close","when":"{{ !local.dialogLocked }}"}]}}}}]},{"tag":"div","visual":["surfaceGutter","scrollingContent"],"props":{"data-mui-scroll-root":""},"children":[{"component":"AsyncStatus","when":"{{ fx.accountSummary.busy && currentAccountBilling == null }}","props":{"kind":"loading","message":"Loading billing..."}},{"component":"AsyncStatus","when":"{{ !fx.accountSummary.busy && currentAccountBilling == null }}","props":{"kind":"empty","message":"Billing is unavailable."}},{"component":"AsyncStatus","when":"{{ currentAccountBilling != null && !currentAccountBilling.enabled }}","props":{"kind":"empty","message":"Billing is not enabled."}},{"component":"AsyncStatus","when":"{{ currentAccountBilling != null && currentAccountBilling.enabled && !currentAccountBilling.payments }}","props":{"kind":"empty","message":"Payments are not available yet."}},{"tag":"div","when":"{{ local.cardReturnActive && local.paymentRecovery == null && local.paymentPending == null }}","visual":"contentStack","children":[{"component":"AsyncStatus","when":"{{ fx.saveCard.status == 'idle' || fx.saveCard.busy || fx.saveCard.problem.retry == 'reconcile' }}","props":{"kind":"loading","message":"Finishing your payment method..."}},{"component":"AsyncStatus","when":"{{ fx.saveCard.status == 'problem' && fx.saveCard.problem.retry != 'reconcile' }}","props":{"kind":"error","message":"{{ fx.saveCard.problem.message }}"}},{"component":"AsyncStatus","when":"{{ fx.saveCard.status == 'ok' }}","props":{"kind":"success","message":"Payment method saved."}},{"component":"Button","when":"{{ fx.saveCard.status == 'problem' && fx.saveCard.problem.retry != 'never' && fx.saveCard.problem.retry != 'reconcile' }}","props":{"label":"Try Again","treatment":"primary"},"on":{"press":{"call":"saveCard","when":"{{ local.paymentRecovery == null && local.paymentPending == null && route.query.setup_intent != null && !fx.saveCard.busy }}","setup_intent_id":"{{ route.query.setup_intent }}"}}},{"tag":"div","when":"{{ state.user.status == 'signedIn' && route.query.setup_intent != null && currentAccountBilling != null && currentAccountBilling.enabled && fx.saveCard.status == 'idle' }}","use":[{"behavior":"delay","ms":0,"action":[{"op":"set","path":"local.cardSaveAttempted","value":true},{"call":"saveCard","when":"{{ route.query.setup_intent != null && !fx.saveCard.busy && !fx.saveCard.ok }}","setup_intent_id":"{{ route.query.setup_intent }}"}]}]}]},{"tag":"div","when":"{{ local.outcomeMessage != '' }}","visual":"contentStack","children":[{"component":"AsyncStatus","props":{"kind":"{{ local.outcomeKind }}","message":"{{ local.outcomeMessage }}"}},{"tag":"div","visual":"actions","children":[{"component":"Button","props":{"label":"Done","treatment":"primary"},"on":{"press":[{"op":"set","path":"local.purchaseAttempted","value":false,"andThen":{"op":"set","path":"local.authenticationCompleted","value":false}},{"emit":"close"}]}}]}]},{"tag":"div","when":"{{ local.dialogActive }}","visual":"contentStack","children":[{"tag":"section","when":"{{ local.paymentRecovery != null || local.paymentPending != null }}","visual":"formStack","children":[{"tag":"h3","visual":"sectionTitle","text":"{{ (local.authenticationSessionReady || (local.paymentRecovery != null && local.paymentPending == null)) ? 'Payment authentication' : 'Payment pending' }}"},{"tag":"p","visual":"hint","text":"{{ (local.authenticationSessionReady || (local.paymentRecovery != null && local.paymentPending == null)) ? 'Additional authentication is required to finish this payment.' : 'We’re still confirming this payment. Don’t submit another payment while it is pending.' }}"},{"component":"AsyncStatus","when":"{{ local.authenticationRequested && (fx.beginPaymentAuthentication.status == 'idle' || fx.beginPaymentAuthentication.busy) }}","props":{"kind":"loading","message":"{{ local.paymentPending != null ? 'Checking payment...' : 'Preparing payment authentication...' }}"}},{"component":"AsyncStatus","when":"{{ local.authenticationRequested && fx.beginPaymentAuthentication.status == 'problem' }}","props":{"kind":"error","message":"{{ fx.beginPaymentAuthentication.problem.message }}"}},{"component":"Button","when":"{{ !local.authenticationSessionReady && !local.authenticationDirectReady && ((local.paymentRecovery != null && (!local.authenticationRequested || fx.beginPaymentAuthentication.status == 'problem' || local.authenticationResultMalformed)) || (local.paymentPendingCheckable && !fx.beginPaymentAuthentication.busy)) }}","props":{"label":"{{ local.paymentPending != null ? 'Check payment' : (local.authenticationRequested ? 'Try Again' : 'Continue authentication') }}","treatment":"primary","disabled":"{{ fx.beginPaymentAuthentication.busy || fx.beginPaymentAuthentication.problem.retry == 'never' || fx.beginPaymentAuthentication.problem.retry == 'reconcile' }}","busy":"{{ fx.beginPaymentAuthentication.busy }}"},"on":{"press":[{"op":"set","path":"local.authenticationRequested","value":true},{"call":"beginPaymentAuthentication","when":"{{ !fx.beginPaymentAuthentication.busy && fx.beginPaymentAuthentication.problem.retry != 'never' && fx.beginPaymentAuthentication.problem.retry != 'reconcile' }}"}]}},{"component":"PaymentAuthentication","when":"{{ local.authenticationSessionReady }}","props":{"publishableKey":"{{ fx.beginPaymentAuthentication.result.publishable_key }}","clientSecret":"{{ fx.beginPaymentAuthentication.result.client_secret }}","paymentMethodId":"{{ fx.beginPaymentAuthentication.result.payment_method_id != null ? fx.beginPaymentAuthentication.result.payment_method_id : '' }}","returnUrl":"{{ props.paymentReturnUrl }}","recoveryId":"{{ fx.beginPaymentAuthentication.result.recovery_id }}","amountCents":"{{ fx.beginPaymentAuthentication.result.amount_cents }}","completing":"{{ fx.completePaymentAuthentication.busy }}","problem":"{{ fx.completePaymentAuthentication.problem }}","reconciling":"{{ fx.completePaymentAuthentication.problem.retry == 'reconcile' }}"},"on":{"lock":{"op":"set","path":"local.paymentLocked","value":"{{ event.locked }}"},"complete":{"call":"completePaymentAuthentication","when":"{{ event.recoveryId != '' && event.amountCents > 0 && !fx.completePaymentAuthentication.busy && fx.completePaymentAuthentication.problem.retry != 'reconcile' }}","recoveryId":"{{ event.recoveryId }}","amountCents":"{{ event.amountCents }}","onSuccess":{"op":"set","path":"local.authenticationCompleted","value":true}}}},{"component":"Button","when":"{{ local.authenticationDirectReady }}","props":{"label":"Finish payment","treatment":"primary","disabled":"{{ fx.completePaymentAuthentication.busy || fx.completePaymentAuthentication.problem.retry == 'reconcile' }}","busy":"{{ fx.completePaymentAuthentication.busy }}"},"on":{"press":{"call":"completePaymentAuthentication","when":"{{ fx.beginPaymentAuthentication.result.recovery_id != null && fx.beginPaymentAuthentication.result.amount_cents > 0 && !fx.completePaymentAuthentication.busy && fx.completePaymentAuthentication.problem.retry != 'reconcile' }}","recoveryId":"{{ fx.beginPaymentAuthentication.result.recovery_id }}","amountCents":"{{ fx.beginPaymentAuthentication.result.amount_cents }}","onSuccess":{"op":"set","path":"local.authenticationCompleted","value":true}}}},{"component":"AsyncStatus","when":"{{ local.authenticationResultMalformed }}","props":{"kind":"error","message":"Payment details could not be prepared. Try again."}}]},{"tag":"div","when":"{{ local.formVisible }}","visual":"formStack","children":[{"tag":"section","visual":"labelValueStack","children":[{"tag":"h3","visual":"sectionTitle","text":"Site"},{"tag":"span","visual":"siteName","text":"{{ props.appName }}"},{"tag":"a","when":"{{ props.siteAddress != '' }}","href":"{{ props.siteAddress }}","visual":"hint","text":"{{ props.siteAddress }}"},{"tag":"span","when":"{{ props.siteAddress == '' && props.siteLabel != '' }}","visual":"hint","text":"{{ props.siteLabel }}"}]},{"component":"AsyncStatus","when":"{{ publicationDelinquent }}","props":{"kind":"error","message":"This site is unfunded — its last payment did not go through{{ local.delinquentSinceLabel != '' ? ', on ' + local.delinquentSinceLabel : '' }}. It stays live for a short grace period. Pay now to keep it up."}},{"tag":"section","visual":"labelValueStack","children":[{"component":"Divider"},{"tag":"h3","visual":"sectionTitle","text":"Subscription"},{"tag":"p","visual":"offerTitle","text":"Keep this site published"},{"tag":"p","visual":"hint","text":"A monthly subscription that keeps your site live on the web."},{"tag":"p","when":"{{ publicationPriceLabel != '' }}","visual":"priceLine","text":"{{ publicationPriceLabel }} a month"},{"tag":"p","when":"{{ local.periodEndLabel != '' }}","visual":"hint","text":"{{ publicationDelinquent ? 'Unpaid period ended ' + local.periodEndLabel : 'Paid through ' + local.periodEndLabel }}"}]},{"tag":"div","children":[{"component":"Divider"},{"tag":"h3","visual":["sectionTitle","spaceBelow"],"text":"Payment method"},{"tag":"div","when":"{{ local.cardSaved }}","visual":"collectionItem","children":[{"tag":"div","visual":"paymentMethod","children":[{"tag":"div","visual":"labelValueStack","children":[{"tag":"span","text":"{{ currentAccountBilling.card.brand != null && currentAccountBilling.card.brand != '' ? currentAccountBilling.card.brand : 'Card' }} ending in {{ currentAccountBilling.card.last4 }}"},{"tag":"span","when":"{{ currentAccountBilling.card.expMonth != null && currentAccountBilling.card.expYear != null }}","visual":"hint","text":"Expires {{ currentAccountBilling.card.expMonth }}/{{ currentAccountBilling.card.expYear }}"}]},{"component":"SlotCluster","children":[{"component":"Button","props":{"label":"Update","treatment":"plain","disabled":"{{ local.dialogLocked }}"},"on":{"press":[{"op":"set","path":"local.cardSaveAttempted","value":false,"andThen":{"op":"set","path":"local.cardUpdateRequested","value":true}}]}},{"component":"IconButton","props":{"icon":"lucide__Trash","label":"Remove saved card","treatment":"plain","disabled":"{{ local.dialogLocked }}","busy":"{{ fx.removeCard.busy }}"},"on":{"press":[{"op":"set","path":"local.removeAttempted","value":true},{"call":"removeCard","when":"{{ local.paymentRecovery == null && local.paymentPending == null && !fx.removeCard.busy && fx.removeCard.problem.retry != 'never' && fx.removeCard.problem.retry != 'reconcile' }}","onSuccess":[{"op":"set","path":"local.removeAttempted","value":false},{"op":"set","path":"local.cardUpdateRequested","value":false},{"op":"set","path":"local.cardSaveAttempted","value":false}]}]}}]}]}]},{"tag":"div","when":"{{ !local.cardSaved }}","visual":"contentStack","children":[{"component":"AsyncStatus","when":"{{ local.cardSaveInFlight }}","props":{"kind":"loading","message":"{{ fx.saveCard.problem.retry == 'reconcile' ? 'Confirming your saved card...' : 'Saving your card...' }}"}},{"tag":"div","when":"{{ local.cardSaveFailed }}","visual":"contentStack","children":[{"component":"AsyncStatus","props":{"kind":"error","message":"{{ fx.saveCard.problem.message }}"}},{"component":"Button","props":{"label":"Try again","treatment":"primary"},"on":{"press":{"op":"set","path":"local.cardSaveAttempted","value":false}}}]},{"component":"PaymentMethodSetup","when":"{{ local.cardSessionFresh }}","props":{"publishableKey":"{{ fx.beginCardSetup.result.publishable_key }}","clientSecret":"{{ fx.beginCardSetup.result.client_secret }}","returnUrl":"{{ props.cardReturnUrl }}","showCancel":"{{ billingCardOnFile }}","formId":"publish-site-payment-method-form"},"on":{"lock":{"op":"set","path":"local.paymentLocked","value":"{{ event.locked }}"},"save":[{"op":"set","path":"local.spentCardSession","value":"{{ fx.beginCardSetup.occurrence }}","andThen":{"op":"set","path":"local.cardSaveAttempted","value":true}},{"call":"saveCard","when":"{{ local.paymentRecovery == null && local.paymentPending == null && event.setupIntentId != '' && !fx.saveCard.busy && fx.saveCard.problem.retry != 'reconcile' }}","setup_intent_id":"{{ event.setupIntentId }}","onSuccess":{"op":"set","path":"local.cardUpdateRequested","value":false}}],"cancel":{"op":"set","path":"local.cardUpdateRequested","value":false}}},{"tag":"div","when":"{{ local.cardSessionFailed }}","visual":"contentStack","children":[{"component":"AsyncStatus","props":{"kind":"error","message":"{{ fx.beginCardSetup.problem.message }}"}},{"component":"Button","props":{"label":"Try again","treatment":"primary","disabled":"{{ fx.beginCardSetup.problem.retry == 'never' || fx.beginCardSetup.problem.retry == 'reconcile' }}"},"on":{"press":{"call":"beginCardSetup","when":"{{ !fx.beginCardSetup.busy && fx.beginCardSetup.problem.retry != 'never' && fx.beginCardSetup.problem.retry != 'reconcile' }}"}}}]},{"component":"AsyncStatus","when":"{{ local.cardSessionPreparing }}","props":{"kind":"loading","message":"Preparing the secure card form..."}},{"tag":"div","when":"{{ local.cardSessionWanted }}","use":[{"behavior":"delay","ms":0,"action":{"call":"beginCardSetup"}}]}]}]},{"component":"AsyncStatus","when":"{{ local.removeAttempted && fx.removeCard.status == 'problem' && fx.removeCard.problem.retry != 'reconcile' }}","props":{"kind":"error","message":"{{ fx.removeCard.problem.message }}"}},{"component":"AsyncStatus","when":"{{ local.removeAttempted && fx.removeCard.problem.retry == 'reconcile' }}","props":{"kind":"loading","message":"Confirming the card removal..."}},{"component":"AsyncStatus","when":"{{ local.purchaseFailed }}","props":{"kind":"error","message":"{{ fx.purchasePublication[props.appId].problem.message }}"}},{"component":"AsyncStatus","when":"{{ local.purchaseAttempted && fx.purchasePublication[props.appId].problem.retry == 'reconcile' }}","props":{"kind":"loading","message":"Confirming your subscription payment..."}},{"component":"AsyncStatus","when":"{{ local.purchaseSettled && local.publishSettling }}","props":{"kind":"loading","message":"Publishing your site..."}},{"component":"AsyncStatus","when":"{{ local.publishFailed }}","props":{"kind":"error","message":"{{ fx.publishApp[props.appId].problem.message }}"}}]}]},{"component":"AsyncStatus","fallback":true,"props":{"kind":"error","message":"{{ problem.message }}"}}]},{"tag":"footer","when":"{{ local.formVisible }}","visual":"fixedChrome","children":[{"component":"ChromeRow","visual":"dialogFooter","props":{"distribution":"leading"},"slots":{"right":{"component":"Button","props":{"label":"{{ local.cardEntryVisible ? 'Save card' : (publicationDelinquent ? 'Pay now and publish' : 'Buy and publish') }}","treatment":"primary","type":"{{ local.cardEntryVisible ? 'submit' : 'button' }}","form":"{{ local.cardEntryVisible ? 'publish-site-payment-method-form' : '' }}","disabled":"{{ !local.canBuy }}","busy":"{{ local.purchaseSettling || local.publishSettling || fx.saveCard.busy || local.paymentLocked }}"},"on":{"press":[{"op":"set","when":"{{ !local.cardEntryVisible && local.canBuy }}","path":"local.purchaseAttempted","value":true},{"op":"set","when":"{{ !local.cardEntryVisible && local.canBuy }}","path":"publicationPurchaseAppId","value":"{{ props.appId }}"},{"call":"purchasePublication","key":"{{ props.appId }}","when":"{{ !local.cardEntryVisible && local.canBuy }}","appId":"{{ props.appId }}"}]}}}}]}]}]},"visual":{"recipes":{"contentStack":{"base":{"display":"grid","gap":"{space4}","minWidth":"0"}},"hint":{"base":{"margin":"0","color":"{colorTextMutedLight}","fontSize":"0.875rem"},"at":{"dark":{"color":"{colorTextMutedDark}"}}},"actions":{"base":{"display":"flex","justifyContent":"flex-end","alignItems":"center","gap":"{space2}"}},"paymentMethod":{"base":{"display":"flex","alignItems":"center","justifyContent":"space-between","gap":"{space3}","minWidth":"0"}},"siteName":{"base":{"fontWeight":"650","minWidth":"0","overflowWrap":"anywhere"}},"offerTitle":{"base":{"margin":"0","fontWeight":"650"}},"priceLine":{"base":{"margin":"0","fontSize":"1.125rem","fontWeight":"700"}}}}}},"routes":{"/":{"name":"homeLayout","layout":{"component":"PublicBrowsingShell","slot":"default"},"children":{"/":{"name":"home","screen":{"component":"HomeRoute"},"head":{"description":"Describe the app you want and First Light builds it, hosts it and puts it online — no code, no setup. Start from a blank page or a ready-made template."}}}},"/dashboard":{"name":"dashboardLayout","guard":"{{ state.user.status == 'signedIn' }}","layout":{"component":"DashboardShell","slot":"default"},"children":{"/":{"name":"dashboard","screen":{"component":"DashboardRoute"}},"/settings":{"name":"settings","screen":{"component":"SettingsRoute"},"query":{"billing":"string","setup_intent":"string","payment_intent":"string"}}}},"/sign-in":{"name":"signInLayout","layout":{"component":"FixedShell","slot":"default","props":{"header":"GuestHeader"}},"children":{"/":{"name":"signIn","screen":{"component":"SignInRoute"},"query":{"templateId":"string"},"head":{"description":"Sign in to First Light with your email address and a one-time code — no password to remember. Your apps, drafts and published sites are waiting inside."}}}},"/privacy":{"name":"privacyLayout","layout":{"component":"PageShell","slot":"default","props":{"header":"GuestHeader","footer":"GuestFooter"}},"children":{"/":{"name":"privacy","screen":{"component":"PrivacyRoute"},"head":{"description":"How First Light handles your account details, the apps you build and the data they hold: what we collect, why we keep it, and how to have it deleted."}}}},"/terms":{"name":"termsLayout","layout":{"component":"PageShell","slot":"default","props":{"header":"GuestHeader","footer":"GuestFooter"}},"children":{"/":{"name":"terms","screen":{"component":"TermsRoute"},"head":{"description":"The agreement for building and hosting apps on First Light — what you may publish, what we provide, how billing works, and how either side can end it."}}}},"/templates":{"name":"templatesLayout","layout":{"component":"PublicBrowsingShell","slot":"default"},"children":{"/":{"name":"templates","screen":{"component":"TemplatesRoute"},"head":{"description":"Start from a working app instead of a blank page. Browse First Light templates, open one, describe the changes you want, and publish it under your name."}},"/:templateId":{"name":"templateDetail","params":{"templateId":"string"},"screen":{"component":"TemplateDetailRoute","props":{"templateId":"{{ route.params.templateId }}"}}}}},"/app/:appId":{"name":"builderLayout","params":{"appId":"string"},"guard":"{{ state.user.status == 'signedIn' }}","layout":{"component":"BuilderShell","slot":"default","props":{"appId":"{{ route.params.appId }}"}},"children":{"/":{"name":"builder","screen":{"component":"BuilderRoute","props":{"appId":"{{ route.params.appId }}"}}}},"query":{"billing":"string","setup_intent":"string","payment_intent":"string"}}},"view":{"component":"App"},"capabilities":{"platformIdentity":{"kind":"platform.auth.web","as":{"auth":"identity"}},"appLifecycle":{"kind":"first-light.apps"},"accountBilling":{"kind":"first-light.billing"},"featureAdministration":{"kind":"first-light.features"}},"auth":{"source":"identity","notify":{"problem":"silent"}},"state":{"user":{"status":"loading"},"publicCatalog":[],"accountPortfolio":[],"appWorkspace":[],"accountSummary":[],"domainSearch":[],"domainSearchDraft":"","domainSearchQuery":"","appAdministration":[],"templateAppRequest":"","reloadLevels":[0,1000,2000,5000],"publicationPurchaseAppId":""},"visual":{"recipes":{"fixedChrome":{"base":{"flex":"0 0 auto"}},"scrollingContent":{"base":{"flex":"1 1 auto","minHeight":"0","overflowX":"clip","overflowY":"auto","background":"{colorSurfaceLight}","paddingBlock":"{space4}"},"at":{"dark":{"background":"{colorSurfaceDark}"}}},"dialogBackdrop":{"base":{"position":"fixed","inset":"0","display":"flex","alignItems":"center","justifyContent":"center","padding":"{space4}","overflow":"hidden","background":"{colorBackdropLight}","zIndex":"3"},"at":{"dark":{"background":"{colorBackdropDark}"}}},"dialogSurface":{"base":{"width":"min(100%, 40rem)","maxWidth":"100%","maxHeight":"calc(100dvh - 2rem)","border":"{borderThin} solid {colorBorderLight}","borderRadius":"{radiusSurface}","background":"{colorSurfaceRaisedLight}","boxShadow":"0 1.5rem 4rem rgba(16, 24, 20, 0.28)","overflow":"hidden"},"at":{"dark":{"borderColor":"{colorBorderDark}","background":"{colorSurfaceRaisedDark}","boxShadow":"0 1.5rem 4rem rgba(0, 0, 0, 0.48)"}}},"surfaceFrame":{"base":{"minWidth":"0","minHeight":"0","display":"flex","flexDirection":"column","overflow":"hidden","background":"{colorSurfaceRaisedLight}","color":"{colorTextLight}"},"at":{"dark":{"background":"{colorSurfaceRaisedDark}","color":"{colorTextDark}"}}},"routeOwner":{"base":{"minWidth":"0","minHeight":"0","display":"flex","flexDirection":"column"}},"routeFill":{"base":{"flex":"1 1 auto"}},"controlBase":{"base":{"display":"inline-flex","alignItems":"center","justifyContent":"center","boxSizing":"border-box","flex":"0 0 auto","border":"{borderThin} solid transparent","borderRadius":"{radiusControl}","font":"inherit","fontWeight":"650","lineHeight":"1.2","textDecoration":"none","cursor":"pointer","transition":"background-color 140ms ease, border-color 140ms ease, color 140ms ease"},"focus":{"outline":"{focusWidth} solid {colorFocusLight}","outlineOffset":"2px"},"state":{"disabled":{"cursor":"not-allowed","opacity":"0.5"},"busy":{"cursor":"progress","opacity":"0.8"},"current":{"background":"{colorAccentSoftLight}","color":"{colorInteractiveLight}"},"expanded":{"borderColor":"{colorAccentLight}"}},"at":{"dark":{"focus":{"outlineColor":"{colorFocusDark}"},"state":{"current":{"background":"{colorAccentSoftDark}","color":"{colorInteractiveDark}"},"expanded":{"borderColor":"{colorAccentDark}"}}},"reducedMotion":{"transition":"none"}}},"controlPrimary":{"base":{"borderColor":"{colorPrimaryLight}","background":"{colorPrimaryLight}","color":"{colorOnPrimaryLight}"},"hover":{"borderColor":"{colorPrimaryHoverLight}","background":"{colorPrimaryHoverLight}"},"at":{"dark":{"borderColor":"{colorPrimaryDark}","background":"{colorPrimaryDark}","color":"{colorOnPrimaryDark}","hover":{"borderColor":"{colorPrimaryHoverDark}","background":"{colorPrimaryHoverDark}"}}}},"controlSecondary":{"base":{"borderColor":"{colorBorderLight}","background":"{colorSurfaceRaisedLight}","color":"{colorTextLight}"},"hover":{"borderColor":"{colorBorderStrongLight}","background":"{colorSurfaceMutedLight}"},"at":{"dark":{"borderColor":"{colorBorderDark}","background":"{colorSurfaceRaisedDark}","color":"{colorTextDark}","hover":{"borderColor":"{colorBorderStrongDark}","background":"{colorSurfaceMutedDark}"}}}},"controlPlain":{"base":{"background":"transparent","color":"{colorInteractiveLight}"},"hover":{"background":"{colorSurfaceMutedLight}","color":"{colorInteractiveHoverLight}"},"at":{"dark":{"color":"{colorInteractiveDark}","hover":{"background":"{colorSurfaceMutedDark}","color":"{colorInteractiveHoverDark}"}}}},"controlSmall":{"base":{"minHeight":"2rem","padding":"0.25rem 0.5rem"}},"controlMedium":{"base":{"minHeight":"2.75rem","padding":"0.5rem 0.75rem"}},"controlLarge":{"base":{"minHeight":"3.25rem","padding":"0.75rem 1rem"}},"controlContent":{"base":{"display":"inline-flex","alignItems":"center","justifyContent":"center","gap":"{space2}"}},"controlCompanionDesktop":{"base":{"position":"absolute","width":"1px","height":"1px","padding":"0","margin":"-1px","overflow":"hidden","clip":"rect(0, 0, 0, 0)","whiteSpace":"nowrap","border":"0"},"at":{"sm":{"position":"static","width":"auto","height":"auto","padding":"0","margin":"0","overflow":"visible","clip":"auto","whiteSpace":"normal","border":"0"}}},"guestFooter":{"base":{"minHeight":"3.5rem","borderTop":"{borderThin} solid {colorBorderLight}","borderBottom":"0"},"at":{"dark":{"borderTopColor":"{colorBorderDark}"}}},"legalNavigation":{"base":{"display":"inline-flex","alignItems":"center","gap":"{space2}","flexWrap":"wrap"}},"platformNavigation":{"base":{"display":"grid","gap":"{space3}"}},"navigationList":{"base":{"display":"flex","flexDirection":"column","gap":"{space1}","listStyle":"none","margin":"0","padding":"0"}},"navigationItem":{"base":{}},"navigationItemContent":{"base":{"width":"100%","display":"flex","alignItems":"center","justifyContent":"flex-start"}},"collectionGrid":{"base":{"display":"grid","gridTemplateColumns":"repeat(auto-fit, minmax(min(100%, 16rem), 1fr))","gap":"{space4}","listStyle":"none","margin":"0","padding":"0"}},"collectionItem":{"base":{"minWidth":"0","padding":"{space4}","border":"{borderThin} solid {colorBorderLight}","borderRadius":"{radiusSurface}","background":"{colorSurfaceRaisedLight}","boxShadow":"0 0.25rem 1rem rgba(27, 37, 32, 0.06)","transition":"border-color 140ms ease, transform 140ms ease"},"hover":{"borderColor":"{colorBorderStrongLight}","transform":"translateY(-1px)"},"at":{"dark":{"borderColor":"{colorBorderDark}","background":"{colorSurfaceRaisedDark}","boxShadow":"0 0.25rem 1rem rgba(0, 0, 0, 0.25)","hover":{"borderColor":"{colorBorderStrongDark}"}},"reducedMotion":{"transition":"none","hover":{"transform":"none"}}}},"appPreview":{"base":{"aspectRatio":"16 / 10","overflow":"hidden","border":"{borderThin} solid {colorBorderLight}","borderRadius":"{radiusControl}","background":"{colorSurfaceMutedLight}"},"at":{"dark":{"borderColor":"{colorBorderDark}","background":"{colorSurfaceMutedDark}"}}},"appPreviewMedia":{"base":{"display":"block","width":"100%","height":"100%","objectFit":"cover"}},"appPreviewFallback":{"base":{"width":"100%","height":"100%","background":"linear-gradient(145deg, {colorSurfaceMutedLight}, {colorAccentSoftLight})"},"at":{"dark":{"background":"linear-gradient(145deg, {colorSurfaceMutedDark}, {colorAccentSoftDark})"}}},"loadingIndicator":{"base":{"color":"{colorAccentLight}","fontWeight":"800"},"at":{"dark":{"color":"{colorAccentDark}"}}},"asyncStatus":{"base":{"display":"flex","alignItems":"center","gap":"{space2}","padding":"{space3}","border":"{borderThin} solid {colorBorderLight}","borderRadius":"{radiusControl}","background":"{colorSurfaceMutedLight}","color":"{colorTextMutedLight}"},"state":{"loading":{"borderColor":"{colorAccentLight}","background":"{colorAccentSoftLight}","color":"{colorInteractiveLight}"},"error":{"borderColor":"{colorDangerLight}","background":"{colorDangerSoftLight}","color":"{colorDangerLight}"},"success":{"borderColor":"{colorSuccessLight}","background":"{colorSuccessSoftLight}","color":"{colorSuccessLight}"}},"at":{"dark":{"borderColor":"{colorBorderDark}","background":"{colorSurfaceMutedDark}","color":"{colorTextMutedDark}","state":{"loading":{"borderColor":"{colorAccentDark}","background":"{colorAccentSoftDark}","color":"{colorInteractiveDark}"},"error":{"borderColor":"{colorDangerDark}","background":"{colorDangerSoftDark}","color":"{colorDangerDark}"},"success":{"borderColor":"{colorSuccessDark}","background":"{colorSuccessSoftDark}","color":"{colorSuccessDark}"}}}}},"templateDetail":{"base":{"width":"min(100%, 64rem)"}},"centeredPageContent":{"base":{"minHeight":"100%","display":"grid","placeItems":"safe center"}},"signInPage":{"base":{"boxSizing":"border-box","width":"min(calc(100% - 2rem), 30rem)","padding":"{space6}","border":"{borderThin} solid {colorBorderLight}","borderRadius":"{radiusSurface}","background":"{colorSurfaceRaisedLight}","boxShadow":"0 1rem 3rem rgba(27, 37, 32, 0.12)"},"at":{"sm":{"padding":"{space8}"},"dark":{"borderColor":"{colorBorderDark}","background":"{colorSurfaceRaisedDark}","boxShadow":"0 1rem 3rem rgba(0, 0, 0, 0.36)"}}},"signInForm":{"base":{"display":"grid","gap":"{space4}","marginTop":"{space4}"}},"field":{"base":{"display":"grid","gap":"{space2}"}},"fieldLabel":{"base":{"color":"{colorTextMutedLight}","fontSize":"0.9375rem","fontWeight":"700"},"at":{"dark":{"color":"{colorTextMutedDark}"}}},"textInput":{"base":{"boxSizing":"border-box","width":"100%","minWidth":"0","minHeight":"2.75rem","padding":"{space3}","border":"{borderThin} solid {colorBorderLight}","borderRadius":"{radiusControl}","background":"{colorSurfaceRaisedLight}","color":"{colorTextLight}","font":"inherit","transition":"border-color 140ms ease, background-color 140ms ease"},"hover":{"borderColor":"{colorBorderStrongLight}"},"focus":{"outline":"{focusWidth} solid {colorFocusLight}","outlineOffset":"2px"},"state":{"disabled":{"background":"{colorSurfaceMutedLight}","color":"{colorDisabledTextLight}","cursor":"not-allowed"},"compact":{"height":"2rem","minHeight":"2rem","padding":"{space1} {space2}","lineHeight":"1.2"}},"at":{"dark":{"borderColor":"{colorBorderDark}","background":"{colorSurfaceRaisedDark}","color":"{colorTextDark}","hover":{"borderColor":"{colorBorderStrongDark}"},"focus":{"outlineColor":"{colorFocusDark}"},"state":{"disabled":{"background":"{colorSurfaceMutedDark}","color":"{colorDisabledTextDark}"}}},"reducedMotion":{"transition":"none"}}},"formActions":{"base":{"display":"flex","flexWrap":"wrap","alignItems":"center","gap":"{space2}","marginTop":"{space3}"}},"divider":{"base":{"height":"{borderThin}","border":"0","background":"{colorBorderLight}","marginBlock":"{space3}","minWidth":"0","marginInline":"0"},"at":{"dark":{"background":"{colorBorderDark}"}}},"emptyState":{"base":{"padding":"{space6}","border":"{borderThin} dashed {colorBorderLight}","borderRadius":"{radiusSurface}","background":"{colorSurfaceMutedLight}","color":"{colorTextMutedLight}"},"at":{"dark":{"borderColor":"{colorBorderDark}","background":"{colorSurfaceMutedDark}","color":"{colorTextMutedDark}"}}},"builderAppName":{"base":{}},"builderAssistantFab":{"base":{"position":"fixed","right":"{space4}","bottom":"{space4}","zIndex":"1","boxShadow":"0 0.5rem 1.5rem rgba(42, 27, 8, 0.24)"}},"builderPreviewStage":{"base":{"width":"100%","height":"100%","minWidth":"0","minHeight":"0","display":"grid","placeItems":"safe center","overflow":"auto","background":"{colorSurfaceMutedLight}","paddingBlock":"{space4}"},"at":{"dark":{"background":"{colorSurfaceMutedDark}"}},"state":{"mobileFlush":{"overflow":"hidden","paddingBlock":"0"}}},"formHint":{"base":{"display":"block","fontSize":"0.875rem","lineHeight":"1.45","color":"{colorTextMutedLight}","marginTop":"{space2}"},"at":{"dark":{"color":"{colorTextMutedDark}"}}},"pageContent":{"base":{"boxSizing":"border-box","width":"min(100%, 76rem)","marginInline":"auto","padding":"{space6} {space4}","display":"grid","alignContent":"start","gap":"{space4}"},"at":{"sm":{"padding":"{space8} {space6}"}}},"catalogStack":{"base":{"display":"grid","gap":"{space4}","minWidth":"0"}},"brandLogoLink":{"base":{"display":"inline-flex","alignItems":"center"}},"pill":{"base":{"display":"inline-flex","alignItems":"center","flex":"0 0 auto","minHeight":"1.5rem","padding":"{space1} {space2}","borderRadius":"999px","background":"{colorSurfaceMutedLight}","lineHeight":"1.2","whiteSpace":"nowrap"},"at":{"dark":{"background":"{colorSurfaceMutedDark}"}}},"surfaceGutter":{"base":{"paddingInline":"{space4}"},"at":{"sm":{"paddingInline":"{space6}"}},"state":{"flush":{"paddingInline":"0"}}},"formStack":{"base":{"display":"grid","gap":"{space3}","minWidth":"0"}},"labelValueStack":{"base":{"display":"grid","gap":"{space1}","minWidth":"0","overflowWrap":"anywhere"}},"dialogTitle":{"base":{"margin":"0","fontSize":"1.125rem"}},"sectionTitle":{"base":{"margin":"0","fontSize":"1rem"}},"routeGate":{"base":{"height":"100dvh","minWidth":"0","minHeight":"0","overflow":"hidden"}},"panelLayout":{"base":{"height":"100dvh","minWidth":"0","minHeight":"0","display":"grid","overflow":"hidden","gridTemplateColumns":"minmax(0, 1fr)"},"at":{"lg":{"gridTemplateColumns":"minmax(0, 1fr) max-content","state":{"withPanel":{"gridTemplateColumns":"minmax(0, 1fr) max-content"}}}}},"concealedControl":{"base":{"opacity":"0","pointerEvents":"none"}},"actionList":{"base":{"display":"grid","gap":"0","minWidth":"0","listStyle":"none","margin":"0","padding":"0"}},"actionRowGroup":{"base":{"minWidth":"0"}},"actionRowSurface":{"base":{"display":"grid","gridTemplateColumns":"minmax(0, 1fr) auto","alignItems":"center","gap":"{space3}","minWidth":"0","paddingBlock":"{space3}","paddingInline":"{space3}","borderBottom":"{borderThin} solid {colorBorderLight}"},"group":{"actionRowGroup":{"recipe":"rowInteractionSurface"}},"at":{"dark":{"borderBottomColor":"{colorBorderDark}"}}},"actionRowSummary":{"base":{"minWidth":"0","overflow":"hidden","textOverflow":"ellipsis","whiteSpace":"nowrap","fontSize":"0.875rem","lineHeight":"1.45","color":"{colorTextMutedLight}"},"at":{"dark":{"color":"{colorTextMutedDark}"}}},"promoteAction":{"group":{"actionRowGroup":{"recipe":"controlPrimary"}}},"rowInteractionSurface":{"base":{"background":"{colorSurfaceMutedLight}"},"at":{"dark":{"background":"{colorSurfaceMutedDark}"}}},"spaceBelow":{"base":{"marginBottom":"{space2}"}},"dialogFooter":{"base":{"borderBottom":"0"}},"toastRegion":{"base":{"position":"fixed","insetBlockEnd":"{space6}","insetInlineStart":"50%","transform":"translateX(-50%)","zIndex":"4","display":"flex","flexDirection":"column","alignItems":"center","gap":"{space2}","pointerEvents":"none"}},"choiceRow":{"base":{"alignItems":"flex-start"}}},"keyframes":{"drawerEnter":{"from":{"transform":"translateX(100%)"},"to":{"transform":"translateX(0)"}},"drawerExit":{"from":{"transform":"translateX(0)"},"to":{"transform":"translateX(100%)"}}},"motion":{"drawerEnter":{"play":"drawerEnter","duration":"180ms","easing":"ease-out"},"drawerExit":{"play":"drawerExit","exit":true,"duration":"180ms","easing":"ease-in"}},"tokens":{"colorCanvasLight":"#F7F3EA","colorCanvasDark":"#111713","colorSurfaceLight":"#FFFCF7","colorSurfaceDark":"#18211D","colorSurfaceRaisedLight":"#FFFFFF","colorSurfaceRaisedDark":"#202A25","colorSurfaceMutedLight":"#EEE9DF","colorSurfaceMutedDark":"#26322C","colorTextLight":"#1B2520","colorTextDark":"#F4EEE2","colorTextMutedLight":"#5B665F","colorTextMutedDark":"#C2B9AB","colorBorderLight":"#D8D1C5","colorBorderDark":"#3B4941","colorBorderStrongLight":"#A8B0AA","colorBorderStrongDark":"#607168","colorPrimaryLight":"#174D3B","colorPrimaryDark":"#2F775A","colorPrimaryHoverLight":"#0F3D2E","colorPrimaryHoverDark":"#347C5F","colorOnPrimaryLight":"#FFFDF8","colorOnPrimaryDark":"#FFF8ED","colorInteractiveLight":"#174D3B","colorInteractiveDark":"#8BD9B7","colorInteractiveHoverLight":"#0F3D2E","colorInteractiveHoverDark":"#A7E6CB","colorAccentLight":"#B9781C","colorAccentDark":"#D5A044","colorAccentHoverLight":"#965F12","colorAccentHoverDark":"#E2B35E","colorAccentSoftLight":"#F5E6C8","colorAccentSoftDark":"#3C3020","colorOnAccentLight":"#2A1B08","colorOnAccentDark":"#1F1608","colorDangerLight":"#A63A32","colorDangerDark":"#F19A8F","colorDangerSoftLight":"#F9E5E2","colorDangerSoftDark":"#3A2421","colorSuccessLight":"#276749","colorSuccessDark":"#78C79E","colorSuccessSoftLight":"#E2F1E8","colorSuccessSoftDark":"#20362B","colorFocusLight":"#B9781C","colorFocusDark":"#E0AA4B","colorBackdropLight":"rgba(16, 24, 20, 0.52)","colorBackdropDark":"rgba(4, 9, 7, 0.72)","colorDisabledTextLight":"#858A85","colorDisabledTextDark":"#777F79","space1":"0.25rem","space2":"0.5rem","space3":"0.75rem","space4":"1rem","space6":"1.5rem","space8":"2rem","borderThin":"1px","radiusControl":"0.625rem","radiusSurface":"0.875rem","fontBody":"ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif","focusWidth":"3px","builderPanelWidth":"clamp(26rem, 34vw, 34rem)","navigationPanelWidth":"24rem"}},"computed":{"publicTemplates":"{{ state.publicCatalog[0].templates ?? [] }}","selectedPublicTemplate":"{{ findBy(publicTemplates, 'id', route.params.templateId) }}","selectedPublicTemplateName":"{{ selectedPublicTemplate.name }}","selectedPublicTemplateScreenshotUrl":"{{ selectedPublicTemplate.screenshots[0].url }}","accountApps":"{{ state.accountPortfolio[0].apps ?? [] }}","selectedAppWorkspace":"{{ findBy(state.appWorkspace, 'id', route.params.appId) }}","selectedAppWorkspaceName":"{{ selectedAppWorkspace.app.name ?? '' }}","currentBuilderMessages":"{{ selectedAppWorkspace.builder.messages ?? [] }}","currentBuilderPosture":"{{ selectedAppWorkspace.id == route.params.appId ? selectedAppWorkspace.builder.posture : null }}","canSendMessage":"{{ findBy(currentBuilderPosture == null ? [] : currentBuilderPosture.actions, 'type', 'sendMessage') != null }}","currentCancelAction":"{{ findBy(currentBuilderPosture == null ? [] : currentBuilderPosture.actions, 'type', 'cancel') ?? null }}","canCancel":"{{ currentCancelAction != null }}","cancelActionLabel":"{{ currentCancelAction == null ? '' : currentCancelAction.label }}","currentPublishHead":"{{ selectedAppWorkspace.id == route.params.appId ? (selectedAppWorkspace.app.source.head ?? '') : '' }}","publishedCurrent":"{{ currentPublishHead != '' && selectedAppWorkspace.deployment.head == currentPublishHead }}","showPublish":"{{ selectedAppWorkspace.id == route.params.appId && selectedAppWorkspace.access.permissions.publish && currentPublishHead != '' && !publishedCurrent }}","publishBusy":"{{ fx.publishApp[route.params.appId].busy || fx.publishApp[route.params.appId].problem.retry == 'reconcile' }}","canPublish":"{{ showPublish && currentBuilderPosture.type != 'working' && !publishBusy && fx.publishApp[route.params.appId].problem.retry != 'reconcile' }}","publishedUrl":"{{ selectedAppWorkspace.id == route.params.appId ? (selectedAppWorkspace.deployment.primaryAddress.url ?? '') : '' }}","publishProblemMessage":"{{ fx.publishApp[route.params.appId].status == 'problem' && fx.publishApp[route.params.appId].problem.retry != 'reconcile' && fx.publishApp[route.params.appId].problem.code != 'PUBLICATION_SUBSCRIPTION_REQUIRED' ? fx.publishApp[route.params.appId].problem.message : '' }}","currentAccountSummary":"{{ state.accountSummary[0] ?? null }}","currentAccountBilling":"{{ currentAccountSummary ? currentAccountSummary.billing : null }}","billingCardOnFile":"{{ currentAccountBilling != null && currentAccountBilling.enabled && currentAccountBilling.card != null }}","selectedAppAdministration":"{{ findBy(state.appAdministration, 'id', route.params.appId) }}","selectedAppCapabilities":"{{ selectedAppAdministration.capabilities ?? [] }}","currentContinueAction":"{{ findBy(currentBuilderPosture == null ? [] : currentBuilderPosture.actions, 'type', 'continue') ?? null }}","canContinue":"{{ currentContinueAction != null }}","continueActionLabel":"{{ currentContinueAction == null ? '' : currentContinueAction.label }}","currentRetryAction":"{{ findBy(currentBuilderPosture == null ? [] : currentBuilderPosture.actions, 'type', 'retry') ?? null }}","canRetry":"{{ currentRetryAction != null }}","retryActionLabel":"{{ currentRetryAction == null ? '' : currentRetryAction.label }}","okNotifications":"{{ filterBy(notifications, 'kind', 'ok') }}","selectedAppPortfolioEntry":"{{ findBy(accountApps, 'id', route.params.appId) }}","selectedAppSubscription":"{{ selectedAppPortfolioEntry.subscription ?? null }}","publicationFunded":"{{ selectedAppSubscription != null && selectedAppSubscription.status == 'active' }}","publicationDelinquent":"{{ selectedAppSubscription != null && selectedAppSubscription.status == 'delinquent' }}","publicationPriceLabel":"{{ selectedAppSubscription != null ? selectedAppSubscription.priceUsd : (currentAccountBilling != null && currentAccountBilling.enabled ? currentAccountBilling.publicationUsd : '') }}","publicationSiteLabel":"{{ selectedAppPortfolioEntry.deployment.slug ?? '' }}"},"actors":{"visitor":{"using":"first-light-actor.has","actor":"first-light.app-visitor"},"accountSubject":{"using":"first-light-actor.has","actor":"first-light.app-subject"}},"data":{"publicCatalog":{"source":"publicCatalog","collection":"publicCatalog","fields":{"id":"string","templates":"array"},"live":true,"access":{"read":[{"actors":["visitor"]}]}},"accountPortfolio":{"source":"accountPortfolio","collection":"accountPortfolio","fields":{"id":"string","apps":"array"},"live":true,"access":{"read":[{"actors":["accountSubject"]}]}},"appWorkspace":{"source":"appWorkspace","collection":"appWorkspace","query":{"appId":"{{ route.params.appId }}"},"fields":{"id":"string","app":"object","builder":"object"},"live":true,"access":{"read":[{"actors":["accountSubject"]}]}},"accountSummary":{"source":"accountSummary","collection":"accountSummary","fields":{"id":"string","profile":"object","billing":"object","entitlements":"object"},"live":true,"access":{"read":[{"actors":["accountSubject"]}]}},"domainSearch":{"source":"domainSearch","collection":"domainSearch","key":"name","query":{"q":"{{ state.domainSearchQuery }}"},"fields":{"name":"string","available":"boolean","premium":"boolean","reason":"string?","priceDollars":"number?","totalMicrocents":"number?","currency":"string?"},"access":{"read":{"actors":["accountSubject"]}}},"appAdministration":{"source":"appAdministration","collection":"appAdministration","query":{"appId":"{{ route.params.appId }}"},"fields":{"id":"string","capabilities":"array"},"live":true,"access":{"read":[{"actors":["accountSubject"]}]}}},"triggers":{"openCreatedTemplateApp":{"observe":"{{ state.templateAppRequest != '' && fx.createAppFromTemplate[state.templateAppRequest].ok && findBy(accountApps, 'id', fx.createAppFromTemplate[state.templateAppRequest].result.appId) != null }}","key":"{{ fx.createAppFromTemplate[state.templateAppRequest].occurrence }}","act":[{"call":"navigate","to":"/app/{{ fx.createAppFromTemplate[state.templateAppRequest].result.appId }}"}]},"openCreatedBlankApp":{"observe":"{{ fx.createBlankApp.ok && findBy(accountApps, 'id', fx.createBlankApp.result.appId) != null }}","key":"{{ fx.createBlankApp.occurrence }}","act":[{"call":"navigate","to":"/app/{{ fx.createBlankApp.result.appId }}"}]},"publishPurchasedSite":{"observe":"{{ state.publicationPurchaseAppId != '' && fx.purchasePublication[state.publicationPurchaseAppId].ok }}","key":"{{ fx.purchasePublication[state.publicationPurchaseAppId].occurrence }}","act":[{"call":"publishApp","key":"{{ state.publicationPurchaseAppId }}","appId":"{{ state.publicationPurchaseAppId }}"}]}},"commands":{"createAppFromTemplate":{"capability":"appLifecycle","action":"app.create","access":[{"actors":["accountSubject"]}],"notify":{"problem":"silent"},"per":"key","lane":"session"},"sendBuilderMessage":{"capability":"appLifecycle","action":"app.builder.message","access":[{"actors":["accountSubject"]}],"notify":{"problem":"silent"},"per":"key","lane":"app"},"cancelBuilderWork":{"capability":"appLifecycle","action":"app.builder.control","access":[{"actors":["accountSubject"]}],"notify":{"problem":"silent"},"per":"key","lane":"app"},"publishApp":{"capability":"appLifecycle","action":"app.publish","access":[{"actors":["accountSubject"]}],"notify":{"problem":"silent"},"per":"key","lane":"app"},"renameApp":{"capability":"appLifecycle","action":"app.rename","access":[{"actors":["accountSubject"]}],"notify":{"problem":"silent"},"per":"key","lane":"app"},"createBlankApp":{"capability":"appLifecycle","action":"app.create","access":[{"actors":["accountSubject"]}],"notify":{"problem":"silent"},"lane":"session"},"beginCardSetup":{"capability":"accountBilling","action":"card.begin","access":[{"actors":["accountSubject"]}],"notify":{"problem":"silent"},"lane":"session"},"saveCard":{"capability":"accountBilling","action":"card.save","access":[{"actors":["accountSubject"]}],"notify":{"problem":"silent"},"lane":"session"},"beginPaymentAuthentication":{"capability":"accountBilling","action":"payment.authentication.begin","access":[{"actors":["accountSubject"]}],"notify":{"problem":"silent"},"lane":"session"},"completePaymentAuthentication":{"capability":"accountBilling","action":"payment.authentication.complete","access":[{"actors":["accountSubject"]}],"notify":{"problem":"silent"},"lane":"session"},"saveTopOff":{"capability":"accountBilling","action":"topoff.save","access":[{"actors":["accountSubject"]}],"notify":{"problem":"silent","ok":"Auto reload saved"},"lane":"session"},"saveAndCheckFeature":{"capability":"featureAdministration","action":"features.save-and-check","access":[{"actors":["accountSubject"]}],"notify":{"problem":"silent"},"per":"key","lane":"app"},"removeCard":{"capability":"accountBilling","action":"card.remove","access":[{"actors":["accountSubject"]}],"notify":{"problem":"silent","ok":"Saved card removed"},"lane":"session"},"purchasePublication":{"capability":"accountBilling","action":"publication.purchase","access":[{"actors":["accountSubject"]}],"notify":{"problem":"silent"},"per":"key","lane":"app"}},"head":{"lang":"en","title":"First Light","viewport":"width=device-width, initial-scale=1","colorScheme":"light dark","themeColor":"#174D3B","links":[{"rel":"icon","href":"/assets/brand/fl_icon.png","type":"image/png"}]},"name":"First Light"}