@ui-workflow/core 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{i as e,t}from"./react-vendor-CH5vucNG.js";import{a as n,d as r,f as i,l as a,p as o,u as s}from"./index-KY1IHp8L.js";import{a as c,i as l,n as u,r as d}from"./account-modal--3DWt5me.js";import{r as ee,t as te}from"./Connections-C9b3n4ss.js";var f=e(),p=t(),m=[{id:`scope-intake`,title:`Read project`,inputs:[`Your static site, React/Vite, or Next.js folder, brief, and optional project rules`],checks:[`Detects your framework and styling stack, then snapshots only the UI files you allow`],modules:[`Framework detection`,`Project rules`,`Editable file scope`],boundaries:[`Reads only approved UI folders — never installs packages or runs repo scripts`]},{id:`direction-design`,title:`Pick direction`,inputs:[`Optional palette, reference screenshots, layout direction, and active design guides`],checks:[`Keeps your existing colors and typography consistent unless you ask for a change`],modules:[`Design guides`,`Project palette`,`Reference images`],boundaries:[`Shares only the images and guides you explicitly attach to the run`]},{id:`draft-qa`,title:`Build & check`,inputs:[`Proposed file edits and your project snapshot`],checks:[`Runs typecheck, build, security checks, and desktop/mobile/dark browser checks with line-by-line fixes`],modules:[`Build & typecheck`,`Security & a11y audit`,`Desktop & mobile browser checks`],boundaries:[`Builds and browser previews run on isolated copies only when you trust the project`]},{id:`diff-walkthrough`,title:`Review changes`,inputs:[`File diffs, effort summary, audit findings, and local responsive preview`],checks:[`Compare Before/After at desktop, tablet, and phone widths and inspect every changed line`],modules:[`Walkthrough & diffs`,`1up / 2up / slider preview`,`Before/After HTML report`],boundaries:[`Checks guide your review — nothing touches your files until you approve`]},{id:`reviewed-apply`,title:`Apply with Undo`,inputs:[`Approved edits and exact original file backups`],checks:[`Verifies files have not changed on disk, saves backups first, and keeps 1-click Undo`],modules:[`Safe Apply`,`Whole-run & per-file Undo`,`Git review branch export`],boundaries:[`Review-first Apply is the default; live-edit batches are opt-in and revocable`]}],h=[[`Uses`,`inputs`],[`What it checks`,`checks`],[`Included tools`,`modules`],[`Safety`,`boundaries`]],g=[`All`,`Hub`,`Project`],_={hub:`Hub`,project:`Project`,custom:`Custom`};function v({stages:e,modules:t}){let[n,r]=(0,f.useState)(``),i=e.find(e=>e.id===n)??e[0],a=50/e.length;return(0,p.jsxs)(`section`,{className:`settings-workflow-diagram`,"aria-labelledby":`workflow-diagram-heading`,children:[(0,p.jsx)(`h3`,{id:`workflow-diagram-heading`,children:`Workflow stage diagram`}),(0,p.jsxs)(`div`,{className:`settings-stage-map`,children:[(0,p.jsxs)(`svg`,{className:`settings-stage-track`,viewBox:`0 0 100 100`,preserveAspectRatio:`none`,"aria-hidden":`true`,children:[(0,p.jsx)(`path`,{className:`stage-track-horizontal`,d:`M ${a} 50 H ${100-a}`,vectorEffect:`non-scaling-stroke`}),(0,p.jsx)(`path`,{className:`stage-track-vertical`,d:`M 50 ${a} V ${100-a}`,vectorEffect:`non-scaling-stroke`})]}),(0,p.jsx)(`ol`,{children:e.map((e,t)=>(0,p.jsx)(`li`,{children:(0,p.jsxs)(`button`,{type:`button`,"aria-pressed":i.id===e.id,"aria-controls":`workflow-stage-detail`,onClick:()=>r(e.id),children:[(0,p.jsxs)(`span`,{className:`settings-stage-node`,children:[(0,p.jsx)(`svg`,{viewBox:`0 0 32 32`,"aria-hidden":`true`,children:(0,p.jsx)(`circle`,{cx:`16`,cy:`16`,r:`14`})}),(0,p.jsx)(`span`,{children:t+1})]}),(0,p.jsx)(`span`,{children:e.title})]})},e.id))})]}),(0,p.jsxs)(`div`,{className:`settings-stage-detail`,id:`workflow-stage-detail`,"aria-live":`polite`,children:[(0,p.jsx)(`h4`,{children:i.title}),i.summary&&(0,p.jsx)(`p`,{className:`settings-stage-summary`,children:i.summary}),(0,p.jsx)(`dl`,{children:h.map(([e,n])=>{let r=n===`modules`?[...new Set([...i.modules??[],...t])]:i[n]??[];return(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`dt`,{children:e}),(0,p.jsx)(`dd`,{children:r.length?r.join(` · `):`None reported`})]},n)})})]})]})}function y({skills:e,guides:t,projectModules:n,onChange:r,scope:a}){let[o,s]=(0,f.useState)(`All`),[c,l]=(0,f.useState)(``),[u,d]=(0,f.useState)(!1),[ee,te]=(0,f.useState)(``),[m,h]=(0,f.useState)(!1),[v,y]=(0,f.useState)(``),[b,x]=(0,f.useState)(``),S=t??[],C=S.find(e=>e.id===ee)??S[0],w=Array.isArray(e),T=[...e??[],...n.map(e=>({id:`module-`+e,name:e,scope:`project`,description:`Detected in the project`,enabled:!0,sourcePath:``,trigger:``}))].filter(e=>a===`custom`?e.scope===`custom`:e.scope!==`custom`&&(o===`All`||o.toLowerCase()===e.scope)&&[e.id,e.name,e.description,e.trigger,e.sourcePath].join(` `).toLowerCase().includes(c.trim().toLowerCase()));async function E(e){h(!0),y(``),x(``);try{await r(e),e.action===`add`&&(d(!1),l(``)),x(e.action===`add`?`Skill added.`:`Skill preference saved.`)}catch(e){y(e.message)}finally{h(!1)}}function D(e){e.preventDefault();let t=new FormData(e.currentTarget),n=String(t.get(`name`)??``).trim(),r=String(t.get(`sourcePath`)??``).trim(),i=String(t.get(`trigger`)??``).trim();!n||!r||!i?y(`Enter a skill name, source path and trigger.`):E({action:`add`,name:n,sourcePath:r,trigger:i})}return(0,p.jsxs)(`section`,{className:`settings-skills`,"data-skill-scope":a,"aria-labelledby":a===`custom`?`settings-custom-skills-title`:`settings-skills-title`,children:[(0,p.jsxs)(`div`,{className:`settings-section-heading`,children:[(0,p.jsx)(`h3`,{id:a===`custom`?`settings-custom-skills-title`:`settings-skills-title`,children:a===`custom`?`Custom skills`:`Skills & modules`}),a===`custom`&&(0,p.jsxs)(`button`,{className:`button subtle`,type:`button`,"aria-expanded":u,"aria-controls":`settings-add-skill`,onClick:()=>d(e=>!e),children:[(0,p.jsx)(i,{name:u?`minus`:`plus`}),` `,u?`Close form`:`Import skill`]})]}),v&&(0,p.jsx)(`p`,{className:`error-box`,role:`alert`,children:v}),b&&(0,p.jsx)(`p`,{className:`connection-success`,role:`status`,children:b}),a===`custom`&&(0,p.jsx)(`div`,{id:`settings-add-skill`,hidden:!u,children:u&&(0,p.jsxs)(`form`,{className:`settings-skill-form`,onSubmit:D,children:[(0,p.jsxs)(`label`,{children:[`Skill name`,(0,p.jsx)(`input`,{name:`name`,required:!0})]}),(0,p.jsxs)(`label`,{children:[`Source path`,(0,p.jsx)(`input`,{name:`sourcePath`,required:!0,placeholder:`C:\\skills\\example\\SKILL.md`})]}),(0,p.jsxs)(`label`,{children:[`Trigger`,(0,p.jsx)(`input`,{name:`trigger`,required:!0,placeholder:`When should Studio use this skill?`})]}),(0,p.jsx)(`button`,{className:`button primary`,type:`submit`,disabled:m||!w,children:`Save skill`})]})}),a===`studio`&&(0,p.jsxs)(`section`,{className:`settings-guide-preview`,"aria-label":`Design guidance`,children:[(0,p.jsxs)(`div`,{className:`settings-guide-header`,children:[(0,p.jsxs)(`div`,{className:`settings-guide-heading`,children:[(0,p.jsx)(`span`,{className:`settings-guide-mark`,"aria-hidden":`true`,children:(0,p.jsx)(i,{name:`palette`})}),(0,p.jsx)(`div`,{children:(0,p.jsx)(`h4`,{children:`Active design guide`})})]}),S.length>1&&(0,p.jsxs)(`label`,{className:`settings-guide-select`,children:[(0,p.jsx)(`span`,{children:`Guide`}),(0,p.jsx)(`select`,{value:C?.id??``,onChange:e=>te(e.target.value),children:S.map(e=>(0,p.jsx)(`option`,{value:e.id,children:e.name},e.id))})]})]}),!C&&(0,p.jsx)(`p`,{className:`settings-guide-empty`,children:`No design guidance available.`}),C&&(0,p.jsxs)(`div`,{className:`settings-guide-body`,children:[(0,p.jsxs)(`div`,{className:`settings-guide-summary`,children:[(0,p.jsx)(`strong`,{children:C.name}),C.summary&&(0,p.jsx)(`p`,{children:C.summary}),(0,p.jsxs)(`details`,{className:`settings-guide-source`,children:[(0,p.jsx)(`summary`,{children:`View source file`}),(0,p.jsx)(`code`,{translate:`no`,children:C.sourcePath})]})]}),(0,p.jsxs)(`dl`,{className:`settings-guide-facts`,children:[C.motionCurve&&(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`dt`,{children:`Motion`}),(0,p.jsx)(`dd`,{children:(0,p.jsx)(`code`,{children:C.motionCurve})})]}),C.typographyRatio&&(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`dt`,{children:`Typography`}),(0,p.jsx)(`dd`,{children:C.typographyRatio})]}),C.grid&&(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`dt`,{children:`Grid`}),(0,p.jsx)(`dd`,{children:C.grid})]}),C.colorAgnostic===!0&&(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`dt`,{children:`Palette`}),(0,p.jsx)(`dd`,{children:`Color follows the project palette.`})]})]})]})]}),(0,p.jsx)(`div`,{className:`settings-skills-layout`,children:(0,p.jsxs)(`div`,{className:`settings-skill-list-pane`,children:[a===`studio`&&(0,p.jsxs)(`div`,{className:`settings-directory-controls`,children:[(0,p.jsx)(`div`,{className:`settings-filters`,role:`group`,"aria-label":`Skill source`,children:g.map(e=>(0,p.jsx)(`button`,{type:`button`,"aria-pressed":e===o,onClick:()=>s(e),children:e},e))}),(0,p.jsxs)(`label`,{className:`settings-search`,children:[(0,p.jsx)(i,{name:`search`}),(0,p.jsx)(`input`,{type:`search`,"aria-label":`Search skills`,placeholder:`Search skills…`,value:c,onChange:e=>l(e.target.value)})]})]}),(0,p.jsxs)(`ul`,{className:`settings-directory-list`,"aria-label":`Skills and detected modules`,children:[T.map(e=>{let t=e.id.startsWith(`module-`);return(0,p.jsxs)(`li`,{className:`settings-directory-row settings-skill-row`,"data-skill-source":e.scope,children:[(0,p.jsx)(`span`,{className:`settings-directory-icon`,children:(0,p.jsx)(i,{name:t?`component`:e.scope===`project`?`folder`:`terminal`})}),(0,p.jsxs)(`div`,{className:`settings-directory-copy`,children:[(0,p.jsxs)(`div`,{className:`settings-directory-name`,children:[(0,p.jsx)(`strong`,{children:e.name}),(0,p.jsx)(`span`,{className:`settings-type-label`,children:_[e.scope]})]}),(0,p.jsx)(`p`,{children:e.description??e.trigger??e.sourcePath})]}),t?(0,p.jsx)(`span`,{className:`settings-connected`,children:`Detected`}):(0,p.jsx)(`button`,{type:`button`,className:`settings-skill-switch`,role:`switch`,"aria-label":e.name,"aria-checked":e.enabled,disabled:m||!w,onClick:()=>void E({action:`toggle`,id:e.id,enabled:!e.enabled})})]},e.id)}),T.length===0&&(0,p.jsx)(`li`,{className:`settings-directory-empty`,role:`status`,children:w?a===`custom`?`No custom skills have been imported.`:`No skills or modules match these filters.`:`Skill catalogue is unavailable.`})]})]})})]})}function b({data:e,inspection:t,onSelect:n,onSkillChange:a}){let[o,s]=(0,f.useState)(`workflows`),c=r(t),l=e?.workflowStages.length?[...e.workflowStages].sort((e,t)=>e.order-t.order).map(e=>({...m.find(t=>t.id===e.id)??{id:e.id,title:e.label,inputs:[],checks:[],modules:[],boundaries:[]},title:e.label,summary:e.summary})):m;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`div`,{className:`settings-intro`,children:[(0,p.jsx)(`h2`,{children:`How Studio runs a revision`}),(0,p.jsx)(`p`,{children:`Pick a workflow focus to tailor checks and design advice for your task. Studio can also choose automatically from your prompt.`})]}),(0,p.jsx)(v,{stages:l,modules:c}),(0,p.jsx)(`div`,{className:`mcp-client-tabs settings-connection-tabs settings-workflow-tabs`,role:`tablist`,"aria-label":`Workflow settings pages`,onKeyDown:e=>{if(![`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(e.key))return;let t=Array.from(e.currentTarget.querySelectorAll(`[role="tab"]`)),n=t.indexOf(document.activeElement),r=e.key===`Home`?0:e.key===`End`?t.length-1:(n+(e.key===`ArrowRight`?1:-1)+t.length)%t.length;e.preventDefault(),t[r]?.focus();let i=t[r]?.dataset.workflowTab;(i===`workflows`||i===`skills`||i===`custom`)&&s(i)},children:[[`workflows`,`Workflows`,`graph`],[`skills`,`Skills`,`terminal`],[`custom`,`Custom`,`plus`]].map(([e,t,n])=>(0,p.jsxs)(`button`,{id:`workflow-`+e+`-tab`,type:`button`,role:`tab`,"data-workflow-tab":e,tabIndex:o===e?0:-1,"aria-selected":o===e,"aria-controls":`workflow-`+e+`-panel`,onClick:()=>s(e),children:[(0,p.jsx)(i,{name:n}),t]},e))}),(0,p.jsx)(`div`,{id:`workflow-workflows-panel`,role:`tabpanel`,"aria-labelledby":`workflow-workflows-tab`,tabIndex:0,hidden:o!==`workflows`,children:o===`workflows`&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(`h3`,{className:`settings-workflow-focus-heading`,children:`Workflow focuses`}),(0,p.jsx)(`div`,{className:`workflow-overview`,children:e?.workflows?.map(e=>(0,p.jsxs)(`section`,{className:`workflow-focus`,children:[(0,p.jsx)(`div`,{className:`workflow-focus-icon`,children:(0,p.jsx)(i,{name:e.icon})}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`h3`,{children:e.title}),(0,p.jsx)(`p`,{children:e.summary}),(0,p.jsx)(`p`,{className:`workflow-includes-label`,children:`What this focus brings`}),(0,p.jsx)(`ul`,{className:`workflow-outputs`,"aria-label":e.title+` includes`,children:e.outputs.map(e=>(0,p.jsxs)(`li`,{children:[(0,p.jsx)(i,{name:`check`}),e]},e))}),(0,p.jsxs)(`details`,{children:[(0,p.jsx)(`summary`,{children:`How this workflow works`}),(0,p.jsx)(`p`,{children:e.detail})]}),n&&(0,p.jsxs)(`button`,{className:`text-button workflow-use`,type:`button`,"aria-label":`Use `+e.title+` focus`,onClick:()=>n(e.profile),children:[`Choose `,e.title,` `,(0,p.jsx)(i,{name:`arrow`})]})]})]},e.id))}),(0,p.jsxs)(`section`,{className:`hub-toolkit`,"aria-labelledby":`engine-capabilities-heading`,children:[(0,p.jsxs)(`div`,{className:`hub-toolkit-heading`,children:[(0,p.jsx)(`span`,{className:`hub-toolkit-icon`,children:(0,p.jsx)(i,{name:`terminal`})}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`h3`,{id:`engine-capabilities-heading`,children:`Frameworks, CLI & CI`}),(0,p.jsx)(`p`,{children:`The same local check engine powers Studio, the standalone CLI, connected AI clients, and GitHub Actions.`})]})]}),(0,p.jsxs)(`dl`,{className:`workflow-capability-grid`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`dt`,{children:`Supported projects`}),(0,p.jsx)(`dd`,{children:`Static HTML/CSS/JS, React + Vite (TypeScript or JS), and Next.js (App & Pages Router, Tailwind v4, shadcn/ui).`})]}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`dt`,{children:`Built-in checks`}),(0,p.jsx)(`dd`,{children:`Checks build, security, mobile/desktop layout, color contrast, accessibility, and console errors with copyable AI fix prompts.`})]}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`dt`,{children:`Project rules`}),(0,p.jsxs)(`dd`,{children:[`Save pages to test, design direction, must-keep behaviors, and optional warning overrides in `,(0,p.jsx)(`code`,{children:`.ui-workflow.json`}),`.`]})]}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`dt`,{children:`CLI & pull requests`}),(0,p.jsxs)(`dd`,{children:[`Run `,(0,p.jsx)(`code`,{children:`ui-workflow audit --render --compact`}),` locally, or copy`,` `,(0,p.jsx)(`code`,{children:`examples/github-actions/ui-workflow-pr-qa.yml`}),` for PR checks.`]})]})]})]}),(0,p.jsxs)(`section`,{className:`hub-toolkit`,children:[(0,p.jsxs)(`div`,{className:`hub-toolkit-heading`,children:[(0,p.jsx)(`span`,{className:`hub-toolkit-icon`,children:(0,p.jsx)(i,{name:`component`})}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`h3`,{children:`Optional local tools`}),(0,p.jsx)(`p`,{children:`Extra design and testing tools available in your local workspace.`})]})]}),(0,p.jsx)(`div`,{className:`hub-toolkit-list`,children:e?.hubToolGroups?.map(e=>(0,p.jsxs)(`details`,{children:[(0,p.jsxs)(`summary`,{children:[(0,p.jsx)(`span`,{className:`hub-group-icon`,children:(0,p.jsx)(i,{name:e.icon})}),(0,p.jsx)(`span`,{children:e.title}),(0,p.jsx)(i,{name:`chevron`})]}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`p`,{children:e.description}),(0,p.jsx)(`small`,{children:e.reach})]})]},e.id))})]}),(0,p.jsxs)(`p`,{className:`workflow-scope-note`,children:[(0,p.jsx)(i,{name:`shield`}),(0,p.jsx)(`span`,{children:`Every workflow keeps your files read-only until you review and approve changes.`})]})]})}),(0,p.jsx)(`div`,{id:`workflow-skills-panel`,role:`tabpanel`,"aria-labelledby":`workflow-skills-tab`,tabIndex:0,hidden:o!==`skills`,children:o===`skills`&&(0,p.jsx)(y,{skills:e?.skills,guides:e?.designGuides,projectModules:c,onChange:a,scope:`studio`})}),(0,p.jsx)(`div`,{id:`workflow-custom-panel`,role:`tabpanel`,"aria-labelledby":`workflow-custom-tab`,tabIndex:0,hidden:o!==`custom`,children:o===`custom`&&(0,p.jsx)(y,{skills:e?.skills,projectModules:c,onChange:a,scope:`custom`})})]})}var x=[{id:`hallmark`,label:`Dot Matrix`,hint:`Interactive dot field that responds to your cursor`},{id:`topo`,label:`Contour Blueprint`,hint:`Drafting rings and subtle grid halo`},{id:`isometric`,label:`Isometric Prism`,hint:`Interactive 30° architectural lattice with illuminated facets`},{id:`crosshair`,label:`Studio Crosshair`,hint:`Precision Swiss registration marks that rotate near your cursor`},{id:`mesh`,label:`Silk Ribbons`,hint:`Flowing translucent silk light waves tuned to your accent`},{id:`orbit`,label:`Constellation`,hint:`Orbital arcs and floating geometric nodes linked by hairlines`},{id:`horizon`,label:`Horizon Stage`,hint:`Volumetric overhead light shafts over a 3D perspective floor`},{id:`minimal`,label:`Clean Matte`,hint:`Still, distraction-free solid canvas`}],S=[{id:`crimson`,label:`Signal Crimson`,swatch:`#c80909`},{id:`indigo`,label:`Studio Indigo`,swatch:`#4f46e5`},{id:`orange`,label:`Cadmium Orange`,swatch:`#d94e1f`},{id:`emerald`,label:`Verdant Green`,swatch:`#0d7a5f`},{id:`custom`,label:`Custom colors`,swatch:`conic-gradient(#4f46e5, #ec4899, #06b6d4, #4f46e5)`}],C=[{id:`manrope`,label:`Studio Sans`,sample:`Aa`,hint:`Balanced geometric sans for headings and controls`},{id:`editorial`,label:`Editorial Serif`,sample:`Aa`,hint:`Bookish serif headlines paired with clean sans UI`},{id:`system`,label:`System Native`,sample:`Aa`,hint:`Matches your operating system’s native desktop font`},{id:`grotesk`,label:`Neo Grotesk`,sample:`Ag`,hint:`Tight Swiss-inspired display with crisp tabular numbers`},{id:`mono`,label:`Developer Mono`,sample:`01`,hint:`Code-first monospace titles and technical labels`},{id:`handwritten`,label:`Studio Script`,sample:`Aa`,hint:`Warm handwritten headings with readable sans controls`}],w=[{group:`Studio navigation`,items:[{action:`Show or hide the sidebar`,keys:[`Ctrl`,`B`]},{action:`Open or close Settings`,keys:[`Ctrl`,`,`]},{action:`Focus search in Connections or Settings`,keys:[`/`]},{action:`Close open panels, drawers, or Settings`,keys:[`Esc`]}]},{group:`Workspace & revisions`,items:[{action:`Run revision or send follow-up message`,keys:[`Ctrl`,`Enter`]},{action:`Previous changed file in code diff`,keys:[`[`]},{action:`Next changed file in code diff`,keys:[`]`]}]},{group:`Workflow visual editor`,items:[{action:`Open Add Step palette`,keys:[`A`]},{action:`Fit workflow graph to screen`,keys:[`0`]},{action:`Zoom in or zoom out`,keys:[`+`,`-`]},{action:`Pan around the canvas`,keys:[`Space`,`Drag`]},{action:`Remove selected optional step`,keys:[`Del`]}]}],T=[{title:`Default workflow mode`,description:`Start new revisions with Auto or your connected AI client`,section:`general`,sectionLabel:`General`,keywords:`auto mcp ai client mode execution default workspace`},{title:`Allow creating new files`,description:`Let revisions add new UI files instead of editing existing files only`,section:`general`,sectionLabel:`General`,keywords:`create files scope permissions write`},{title:`Default preview comparison`,description:`Open previews in Single (1up), Side by side (2up), or Diff slider mode`,section:`general`,sectionLabel:`General`,keywords:`preview compare 1up 2up slider visual diff before after`},{title:`Default preview width`,description:`Choose Desktop, Tablet, or Phone as the starting preview width`,section:`general`,sectionLabel:`General`,keywords:`preview size viewport responsive mobile phone tablet desktop`},{title:`Clear saved browser draft`,description:`Remove the unsent brief, project path, and mode cached in this browser`,section:`general`,sectionLabel:`General`,keywords:`draft cache storage clear reset browser`},{title:`Diagnostics & history`,description:`Open older jobs, manual imports, and low-level run records`,section:`general`,sectionLabel:`General`,keywords:`diagnostics logs jobs debug support`},{title:`Theme (System, Light, Dark)`,description:`Match your device theme or lock Studio to Light or Dark mode`,section:`appearance`,sectionLabel:`Appearance`,keywords:`theme dark light system polarity color scheme`},{title:`Contrast`,description:`Switch between Default and Strong borders and text contrast`,section:`appearance`,sectionLabel:`Appearance`,keywords:`contrast accessibility wcag borders readable high`},{title:`Text size`,description:`Adjust interface text density between Compact, Default, and Large`,section:`appearance`,sectionLabel:`Appearance`,keywords:`font size text scale compact large zoom readability`},{title:`Background motion & hover effects`,description:`Independently toggle background drift, cursor hover effects, and page reveals`,section:`appearance`,sectionLabel:`Appearance`,keywords:`motion hover cursor ripple glow animation reduced transitions`},{title:`Accent color, typography & atmosphere`,description:`Pick Signal Crimson, custom hex colors, font voice, and canvas backdrop`,section:`appearance`,sectionLabel:`Appearance`,keywords:`accent crimson indigo custom color hex font typography dot matrix backdrop`},{title:`Account & sign-in`,description:`Sign in with Google, GitHub, or GitLab for repository access and sync`,section:`account`,sectionLabel:`Account`,keywords:`account login sign in google github gitlab profile plan privacy`},{title:`Workflows, skills & design guides`,description:`Configure workflow focuses, built-in skills, custom skills, and design blueprints`,section:`workflows`,sectionLabel:`Workflows`,keywords:`workflows skills guides design system blueprints custom`},{title:`Local tools & browser checks`,description:`Install Playwright Chromium, visual diff tools, and optional local extensions`,section:`setup-modules`,sectionLabel:`Local tools`,keywords:`playwright chromium browser install tools modules setup checks`},{title:`Media, decks & voice dictation`,description:`Reference images, voice dictation, PowerPoint decks, video, and voiceovers`,section:`media`,sectionLabel:`Media`,keywords:`media images photos voice mic dictation pptx powerpoint video elevenlabs`},{title:`Keyboard shortcuts & quick start`,description:`Studio keyboard shortcuts, 4-step walkthrough, sample project, and CLI checks`,section:`guide`,sectionLabel:`Shortcuts & guide`,keywords:`shortcuts keyboard hotkeys guide onboarding sample trial cli ci`}];function E(e){let t=new URL(location.href).searchParams.get(`settings`);return[...e?[`connections`]:[],`general`,`appearance`,`account`,`workflows`,`setup-modules`,`media`,`guide`].includes(t)?t:e?`connections`:`general`}var D={switch:``};function O({theme:e,onTheme:t,contrast:r=`default`,onContrast:m,textScale:h=`default`,onTextScale:g,motion:_,onMotion:v,hoverEffects:y=!0,onHoverEffects:O,pageTransitions:ne=!0,onPageTransitions:re,backdrop:ie=`hallmark`,onBackdrop:ae,accent:k=`crimson`,onAccent:oe,customAccent:A=`#4f46e5`,onCustomAccent:se,customHighlight:j=`#ec4899`,onCustomHighlight:ce,typography:le=`manrope`,onTypography:ue,onResetAppearance:de,execution:fe=`auto`,onExecution:M,allowCreate:pe=!0,onAllowCreate:me,defaultCompareMode:he=`1up`,onDefaultCompareMode:ge,defaultPreviewSize:_e=`fit`,onDefaultPreviewSize:ve,hasSavedDraft:ye=!1,onClearSavedDraft:be,connected:xe=!0,connectionsSummary:N,auth:P,onOpenAccount:F,onSignOut:Se,onPilot:Ce,onClose:I,onConnections:we,onWorkflow:Te,onClientConnected:Ee,clientSetupTask:L,initialConnectionTab:R=`overview`,showConnections:z=!1,modal:B=!1,inspection:De,project:V=De?.project}){let H=(0,f.useRef)(null),Oe=(0,f.useRef)(null),U=(0,f.useRef)(null),[ke,Ae]=(0,f.useState)(L?`mcp-clients`:R),[W,G]=(0,f.useState)(``),[je,Me]=(0,f.useState)(!1);(0,f.useEffect)(()=>{Ae(L?`mcp-clients`:R)},[L,R]),(0,f.useEffect)(()=>{if(!B){document.getElementById(`settings-title`)?.focus();return}let e=H.current;if(e)return e.open||e.showModal(),()=>{e.open&&e.close()}},[B]),(0,f.useEffect)(()=>{if(B)return;let e=e=>{if(e.defaultPrevented||document.querySelector(`dialog[open]`))return;let t=!!e.target?.closest(`input, textarea, select, [contenteditable="true"]`);e.key===`/`&&!t&&!e.ctrlKey&&!e.metaKey&&!e.altKey?(e.preventDefault(),U.current?.focus()):e.key===`Escape`&&(W?(e.preventDefault(),G(``)):(e.preventDefault(),I()))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[B,I,W]);let[K,Ne]=(0,f.useState)(()=>E(z)),[Pe,Fe]=(0,f.useState)(null),[q,Ie]=(0,f.useState)(null),[Le,Re]=(0,f.useState)(``),[ze,Be]=(0,f.useState)(0),[Ve,He]=(0,f.useState)(K===`setup-modules`),J=V?`/api/settings?`+new URLSearchParams({project:V}):`/api/settings`;(0,f.useEffect)(()=>{let e=new AbortController;return o(J,void 0,e.signal).then(e=>{Fe(e),Re(``)}).catch(t=>{e.signal.aborted||Re(t.message)}),()=>e.abort()},[J,ze]),(0,f.useEffect)(()=>{let e=new AbortController;return o(`/api/setup/modules`,void 0,e.signal).then(e=>Ie(e)).catch(()=>{}),()=>e.abort()},[ze]);async function Ue(e){let t=await o(`/api/settings/skills`,{...e,...V?{project:V}:{}});Fe(e=>e&&{...e,...t})}function Y(e){Ne(e),G(``),e===`setup-modules`&&He(!0),Oe.current?.scrollTo(0,0);let t=new URL(location.href);t.searchParams.set(`settings`,e),history.replaceState(null,``,t)}function X(e){if(we){we(e);return}Ae(e),Y(`connections`);let t=new URL(location.href);t.searchParams.set(`tab`,e),history.replaceState(null,``,t),requestAnimationFrame(()=>document.getElementById(`conn-tab-`+e)?.focus())}function We(){Y(`setup-modules`),requestAnimationFrame(()=>document.getElementById(`setup-modules-title`)?.focus())}function Z(){B&&H.current?.open&&H.current.close(),I()}async function Ge(){try{await navigator.clipboard.writeText(`ui-workflow audit --render --compact`),Me(!0),window.setTimeout(()=>Me(!1),1800)}catch{}}let Ke=(0,f.useMemo)(()=>[...z?[{id:`connections`,label:`Connections`,icon:`mcp`,group:`Workspace`,keywords:[`connections`,`api`,`models`,`mcp`,`keys`]}]:[],{id:`general`,label:`General`,icon:`settings`,group:`Workspace`,keywords:[`general`,`defaults`,`preview`,`draft`,`environment`,`mode`]},{id:`appearance`,label:`Appearance`,icon:`palette`,group:`Workspace`,keywords:[`theme`,`dark`,`light`,`contrast`,`font`,`motion`,`accent`,`backdrop`]},{id:`account`,label:`Account`,icon:`shield`,group:`Workspace`,keywords:[`account`,`profile`,`google`,`github`,`gitlab`,`sign in`,`privacy`]},{id:`workflows`,label:`Workflows`,icon:`graph`,group:`Workflow & tools`,keywords:[`workflows`,`skills`,`guides`,`blueprints`,`focus`]},{id:`setup-modules`,label:`Local tools`,icon:`component`,group:`Workflow & tools`,keywords:[`tools`,`playwright`,`chromium`,`modules`,`install`,`setup`]},{id:`media`,label:`Media`,icon:`capture`,group:`Workflow & tools`,keywords:[`media`,`voice`,`dictation`,`decks`,`powerpoint`,`video`,`images`]},{id:`guide`,label:`Shortcuts & guide`,icon:`auto`,group:`Help`,keywords:[`shortcuts`,`keyboard`,`guide`,`getting started`,`help`,`sample`,`trial`]}],[z]),Q=W.trim().toLowerCase(),$=(0,f.useMemo)(()=>Q?T.filter(e=>`${e.title} ${e.description} ${e.sectionLabel} ${e.keywords}`.toLowerCase().includes(Q)):[],[Q]),qe=[`Workspace`,`Workflow & tools`,`Help`],Je=q?.modules.find(e=>e.id===`playwright`),Ye=q?.modules.filter(e=>[`ready`,`installed`,`configured`].includes(e.status)).length??0,Xe=q?.modules.length??0,Ze=e!==`system`||r!=="default"||h!=="default"||!_||!y||!ne||ie!==`hallmark`||k!==`crimson`||le!==`manrope`,Qe=(0,p.jsxs)(p.Fragment,{children:[B&&(0,p.jsxs)(`header`,{className:`settings-dialog-header`,children:[(0,p.jsx)(`div`,{children:(0,p.jsx)(`h1`,{id:`settings-title`,tabIndex:-1,children:`Settings`})}),(0,p.jsxs)(`button`,{type:`button`,className:`settings-close`,"aria-label":`Close settings and return to workspace`,onClick:Z,children:[(0,p.jsx)(`span`,{children:`Done`}),(0,p.jsx)(i,{name:`close`})]})]}),(0,p.jsx)(`section`,{id:`settings-view`,className:`settings-view`,children:(0,p.jsxs)(`div`,{className:`settings-layout`,children:[(0,p.jsxs)(`aside`,{className:`settings-sidebar`,"aria-label":`Settings navigation`,children:[!B&&(0,p.jsxs)(`div`,{className:`settings-sidebar-head`,children:[(0,p.jsxs)(`button`,{type:`button`,className:`settings-back-link`,"aria-label":`Close settings and return to workspace`,onClick:Z,children:[(0,p.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,children:(0,p.jsx)(`path`,{d:`M12.5 5 7.5 10l5 5`})}),(0,p.jsx)(`span`,{children:`Back to workspace`})]}),(0,p.jsx)(`h1`,{id:`settings-title`,className:`settings-sidebar-title`,tabIndex:-1,children:`Settings`})]}),(0,p.jsxs)(`div`,{className:`settings-rail-search`,children:[(0,p.jsx)(i,{name:`search`}),(0,p.jsx)(`input`,{ref:U,type:`search`,value:W,"aria-label":`Search settings`,placeholder:`Search settings…`,onChange:e=>G(e.target.value),onKeyDown:e=>{e.key===`Escape`&&W&&(e.preventDefault(),e.stopPropagation(),G(``))}}),W&&(0,p.jsx)(`button`,{type:`button`,className:`settings-rail-search-clear`,"aria-label":`Clear settings search`,onClick:()=>{G(``),U.current?.focus()},children:(0,p.jsx)(i,{name:`close`})})]}),(0,p.jsx)(`nav`,{className:`settings-nav`,"aria-label":`Settings sections`,children:qe.map(e=>{let t=Ke.filter(t=>t.group===e);return t.length?(0,p.jsxs)(`div`,{className:`settings-nav-group`,children:[(0,p.jsx)(`span`,{className:`settings-nav-group-label`,"aria-hidden":`true`,children:e}),t.map(e=>(0,p.jsxs)(`button`,{type:`button`,id:`settings-section-`+e.id,"aria-current":!Q&&K===e.id?`page`:void 0,onClick:()=>Y(e.id),children:[(0,p.jsx)(i,{name:e.icon}),(0,p.jsx)(`span`,{children:e.label})]},e.id))]},e):null})}),!B&&(0,p.jsx)(`div`,{className:`settings-sidebar-footer`,children:(0,p.jsxs)(`span`,{className:`settings-rail-hint`,children:[`Press `,(0,p.jsx)(`kbd`,{children:`Esc`}),` to return`]})})]}),(0,p.jsxs)(`div`,{className:`settings-content`,ref:Oe,children:[Le&&(0,p.jsxs)(`p`,{role:`alert`,className:`error-box`,children:[Le,` Refresh Studio to retry.`]}),Q?(0,p.jsxs)(`div`,{className:`settings-search-results`,role:`region`,"aria-label":`Search results`,children:[(0,p.jsxs)(`div`,{className:`settings-intro`,children:[(0,p.jsx)(`h2`,{children:`Search results`}),(0,p.jsx)(`p`,{children:$.length===0?`No settings match “${W.trim()}”.`:`${$.length} matching ${$.length===1?`setting`:`settings`} for “${W.trim()}”.`})]}),$.length>0?(0,p.jsx)(`div`,{className:`settings-card`,children:$.map(e=>(0,p.jsxs)(`button`,{type:`button`,className:`settings-row settings-search-row`,onClick:()=>Y(e.section),children:[(0,p.jsxs)(`span`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:e.title}),(0,p.jsx)(`small`,{children:e.description})]}),(0,p.jsx)(`span`,{className:`settings-search-section-tag`,children:e.sectionLabel})]},`${e.section}:${e.title}`))}):(0,p.jsx)(`button`,{type:`button`,className:`button subtle`,onClick:()=>G(``),children:`Clear search`})]}):(0,p.jsxs)(p.Fragment,{children:[z&&K===`connections`&&(0,p.jsx)(te,{initialTab:ke,auth:P,clientSetupTask:L,onClientConnected:Ee,onOpenAccount:F,onDone:I,onMedia:()=>{Y(`media`),document.getElementById(`settings-section-media`)?.focus()}}),K===`general`&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`div`,{className:`settings-intro`,children:[(0,p.jsx)(`h2`,{children:`General`}),(0,p.jsx)(`p`,{children:`Default workspace behavior, preview preferences, and local environment status.`})]}),(0,p.jsxs)(`div`,{className:`settings-status-card`,role:`region`,"aria-label":`Studio status`,children:[(0,p.jsxs)(`div`,{className:`settings-status-identity`,children:[(0,p.jsx)(`span`,{className:`settings-status-mark`,"aria-hidden":`true`,children:(0,p.jsx)(a,{})}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`strong`,{children:`UI Design Studio`}),(0,p.jsxs)(`small`,{children:[(0,p.jsx)(`span`,{className:`settings-inline-dot`,"data-state":xe?`ready`:`error`,"aria-hidden":`true`}),xe?`Running locally on your machine`:`Server offline`,N?.activeModel?` · ${N.activeProvider} (${N.activeModel})`:N&&N.modelKeys>0?` · ${N.modelKeys} API ${N.modelKeys===1?`key`:`keys`} saved`:` · No default AI model selected yet`]})]})]}),(0,p.jsx)(`button`,{type:`button`,className:`button subtle`,onClick:()=>X(`overview`),children:`Manage connections`})]}),(0,p.jsxs)(`section`,{className:`settings-group`,"aria-labelledby":`settings-defaults-heading`,children:[(0,p.jsx)(`h3`,{id:`settings-defaults-heading`,className:`settings-group-title`,children:`Revision defaults`}),(0,p.jsxs)(`div`,{className:`settings-card`,children:[M&&(0,p.jsxs)(`div`,{className:`settings-row`,children:[(0,p.jsxs)(`div`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Default workflow mode`}),(0,p.jsx)(`small`,{children:`Choose whether new revisions run with a connected API model or through your AI editor.`})]}),(0,p.jsxs)(`div`,{className:`settings-segmented`,role:`group`,"aria-label":`Default workflow mode`,children:[(0,p.jsx)(`button`,{type:`button`,"aria-pressed":fe===`auto`,onClick:()=>M(`auto`),children:`Auto`}),(0,p.jsx)(`button`,{type:`button`,"aria-pressed":fe===`mcp`,onClick:()=>M(`mcp`),children:`AI client`})]})]}),me&&(0,p.jsxs)(`label`,{className:`settings-row settings-row-interactive`,children:[(0,p.jsxs)(`span`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Allow creating new files`}),(0,p.jsx)(`small`,{children:`Permit revisions to create new UI components or stylesheets when needed.`})]}),(0,p.jsx)(`input`,{type:`checkbox`,role:`switch`,className:`settings-switch`,checked:pe,onChange:e=>me(e.target.checked),...D})]}),ge&&(0,p.jsxs)(`div`,{className:`settings-row`,children:[(0,p.jsxs)(`div`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Default preview layout`}),(0,p.jsx)(`small`,{children:`How before-and-after previews open when you review a revision.`})]}),(0,p.jsx)(`div`,{className:`settings-segmented`,role:`group`,"aria-label":`Default preview layout`,children:[[`1up`,`Single`],[`2up`,`Side by side`],[`slider`,`Diff slider`]].map(([e,t])=>(0,p.jsx)(`button`,{type:`button`,"aria-pressed":he===e,onClick:()=>ge(e),children:t},e))})]}),ve&&(0,p.jsxs)(`div`,{className:`settings-row`,children:[(0,p.jsxs)(`div`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Default preview width`}),(0,p.jsx)(`small`,{children:`Starting screen size when opening a staged local preview.`})]}),(0,p.jsx)(`div`,{className:`settings-segmented`,role:`group`,"aria-label":`Default preview width`,children:[[`fit`,`Desktop`],[`tablet`,`Tablet`],[`phone`,`Phone`]].map(([e,t])=>(0,p.jsx)(`button`,{type:`button`,"aria-pressed":_e===e,onClick:()=>ve(e),children:t},e))})]})]})]}),(0,p.jsxs)(`section`,{className:`settings-group`,"aria-labelledby":`settings-env-heading`,children:[(0,p.jsx)(`h3`,{id:`settings-env-heading`,className:`settings-group-title`,children:`Environment & data`}),(0,p.jsxs)(`div`,{className:`settings-card`,children:[(0,p.jsxs)(`div`,{className:`settings-row`,children:[(0,p.jsxs)(`div`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Browser checks & local tools`}),(0,p.jsx)(`small`,{children:q?`${Ye} of ${Xe} local tools ready · Playwright Chromium: ${Je&&[`ready`,`installed`,`configured`].includes(Je.status)?`Ready`:`Not installed yet`}.`:`Check installed browser rendering and visual QA tools.`})]}),(0,p.jsx)(`button`,{type:`button`,className:`button subtle`,onClick:We,children:`Manage local tools`})]}),be&&(0,p.jsxs)(`div`,{className:`settings-row`,children:[(0,p.jsxs)(`div`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Saved browser draft`}),(0,p.jsx)(`small`,{children:ye?`Your unsent brief, project path, and options are saved in this browser.`:`No unsent draft is currently stored in this browser.`})]}),(0,p.jsx)(`button`,{type:`button`,className:`button subtle`,disabled:!ye,onClick:be,children:`Clear draft`})]}),(0,p.jsxs)(`div`,{className:`settings-row`,children:[(0,p.jsxs)(`div`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Diagnostics & recovery records`}),(0,p.jsx)(`small`,{children:`Inspect older jobs, manual imports, and saved check logs when troubleshooting.`})]}),(0,p.jsxs)(`a`,{className:`button subtle settings-link-btn`,href:`?diagnostics=1`,children:[`Open Diagnostics `,(0,p.jsx)(i,{name:`external`})]})]})]})]})]}),K===`appearance`&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`div`,{className:`settings-intro settings-intro-row`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`h2`,{children:`Appearance`}),(0,p.jsx)(`p`,{children:`Customize theme, contrast, typography, canvas backdrop, and motion while keeping code diffs solid and easy to read.`})]}),de&&Ze&&(0,p.jsx)(`button`,{type:`button`,className:`button subtle`,onClick:de,children:`Reset defaults`})]}),(0,p.jsxs)(`section`,{className:`settings-group`,"aria-labelledby":`settings-display-heading`,children:[(0,p.jsx)(`h3`,{id:`settings-display-heading`,className:`settings-group-title`,children:`Display`}),(0,p.jsxs)(`div`,{className:`settings-card`,children:[(0,p.jsxs)(`div`,{className:`settings-row`,children:[(0,p.jsxs)(`div`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Theme`}),(0,p.jsx)(`small`,{children:`Match your device theme or lock Studio to Light or Dark.`})]}),(0,p.jsxs)(`div`,{className:`settings-segmented settings-theme-segmented`,role:`group`,"aria-label":`Theme`,children:[(0,p.jsxs)(`button`,{type:`button`,"aria-pressed":e===`system`,onClick:()=>t(`system`),children:[(0,p.jsxs)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,p.jsx)(`rect`,{x:`3`,y:`4`,width:`18`,height:`12`,rx:`2`}),(0,p.jsx)(`path`,{d:`M8 20h8M12 16v4`})]}),(0,p.jsx)(`span`,{children:`System`})]}),(0,p.jsxs)(`button`,{type:`button`,"aria-pressed":e===`light`,onClick:()=>t(`light`),children:[(0,p.jsxs)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,p.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`}),(0,p.jsx)(`path`,{d:`M12 2v2m0 16v2M2 12h2m16 0h2M5 5l1.4 1.4m11.2 11.2L19 19M5 19l1.4-1.4M17.6 6.4 19 5`})]}),(0,p.jsx)(`span`,{children:`Light`})]}),(0,p.jsxs)(`button`,{type:`button`,"aria-pressed":e===`dark`,onClick:()=>t(`dark`),children:[(0,p.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,p.jsx)(`path`,{d:`M20.8 14A9 9 0 0 1 10 3.2 9 9 0 1 0 20.8 14Z`})}),(0,p.jsx)(`span`,{children:`Dark`})]})]})]}),m&&(0,p.jsxs)(`div`,{className:`settings-row`,children:[(0,p.jsxs)(`div`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Contrast`}),(0,p.jsx)(`small`,{children:`Strengthen borders and secondary text for bright screens or higher legibility.`})]}),(0,p.jsxs)(`div`,{className:`settings-segmented`,role:`group`,"aria-label":`Interface contrast`,children:[(0,p.jsx)(`button`,{type:`button`,"aria-pressed":r==="default",onClick:()=>m(`default`),children:`Default`}),(0,p.jsx)(`button`,{type:`button`,"aria-pressed":r===`strong`,onClick:()=>m(`strong`),children:`Strong`})]})]}),g&&(0,p.jsxs)(`div`,{className:`settings-row`,children:[(0,p.jsxs)(`div`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Text size`}),(0,p.jsx)(`small`,{children:`Adjust the reading scale across menus, forms, and notes.`})]}),(0,p.jsx)(`div`,{className:`settings-segmented`,role:`group`,"aria-label":`Interface text size`,children:[[`compact`,`Compact`],[`default`,`Default`],[`large`,`Large`]].map(([e,t])=>(0,p.jsx)(`button`,{type:`button`,"aria-pressed":h===e,onClick:()=>g(e),children:t},e))})]})]})]}),(0,p.jsxs)(`section`,{className:`settings-group`,"aria-labelledby":`settings-motion-heading`,children:[(0,p.jsx)(`h3`,{id:`settings-motion-heading`,className:`settings-group-title`,children:`Motion & hover`}),(0,p.jsxs)(`div`,{className:`settings-card`,children:[(0,p.jsxs)(`label`,{className:`settings-row settings-row-interactive`,children:[(0,p.jsxs)(`span`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Background motion`}),(0,p.jsx)(`small`,{children:`Ambient backdrop drift and headline animation. Automatically pauses when hidden or when your device reduces motion.`})]}),(0,p.jsx)(`input`,{type:`checkbox`,role:`switch`,className:`settings-switch`,checked:_,onChange:e=>v(e.target.checked),...D})]}),O&&(0,p.jsxs)(`label`,{className:`settings-row settings-row-interactive`,children:[(0,p.jsxs)(`span`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Hover & cursor effects`}),(0,p.jsx)(`small`,{children:`Pointer-reactive dot ripples, backdrop cursor highlight, and subtle card hover lift.`})]}),(0,p.jsx)(`input`,{type:`checkbox`,role:`switch`,className:`settings-switch`,checked:y,onChange:e=>O(e.target.checked),...D})]}),re&&(0,p.jsxs)(`label`,{className:`settings-row settings-row-interactive`,children:[(0,p.jsxs)(`span`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Page reveal animation`}),(0,p.jsx)(`small`,{children:`Smooth section reveal when switching between Workspace, Workflows, and Repositories.`})]}),(0,p.jsx)(`input`,{type:`checkbox`,role:`switch`,className:`settings-switch`,checked:_&&ne,disabled:!_,onChange:e=>re(e.target.checked),...D})]})]})]}),oe&&(0,p.jsxs)(`section`,{className:`settings-group`,"aria-labelledby":`settings-accent-heading`,children:[(0,p.jsx)(`h3`,{id:`settings-accent-heading`,className:`settings-group-title`,children:`Accent color`}),(0,p.jsxs)(`div`,{className:`settings-card settings-card-padded`,children:[(0,p.jsx)(`div`,{className:`studio-choice-grid studio-accent-grid`,role:`radiogroup`,"aria-label":`Accent and highlight`,children:S.map(e=>(0,p.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":k===e.id,className:`studio-choice-card studio-accent-card`,onClick:()=>oe(e.id),children:[(0,p.jsx)(`span`,{className:`studio-accent-dot`,style:e.id===`custom`?{background:`linear-gradient(135deg, ${A} 0%, ${j} 100%)`}:e.id===`crimson`?{background:`linear-gradient(135deg, #c80909 0%, #c20030 100%)`}:{backgroundColor:e.swatch},"aria-hidden":`true`}),(0,p.jsx)(`strong`,{children:e.label})]},e.id))}),k===`custom`&&se&&ce&&(0,p.jsxs)(`div`,{className:`studio-custom-colors`,role:`group`,"aria-label":`Custom accent and highlight colors`,children:[(0,p.jsxs)(`label`,{className:`studio-color-field`,htmlFor:`studio-custom-accent`,children:[(0,p.jsxs)(`span`,{className:`studio-color-meta`,children:[(0,p.jsx)(`strong`,{children:`Accent color`}),(0,p.jsx)(`small`,{children:`Buttons, active controls & focus rings`})]}),(0,p.jsxs)(`span`,{className:`studio-color-input-wrap`,children:[(0,p.jsx)(`input`,{id:`studio-custom-accent`,type:`color`,value:A,onChange:e=>se(e.target.value)}),(0,p.jsx)(`code`,{children:A})]})]}),(0,p.jsxs)(`label`,{className:`studio-color-field`,htmlFor:`studio-custom-highlight`,children:[(0,p.jsxs)(`span`,{className:`studio-color-meta`,children:[(0,p.jsx)(`strong`,{children:`Highlight color`}),(0,p.jsx)(`small`,{children:`Headline highlight & canvas accent`})]}),(0,p.jsxs)(`span`,{className:`studio-color-input-wrap`,children:[(0,p.jsx)(`input`,{id:`studio-custom-highlight`,type:`color`,value:j,onChange:e=>ce(e.target.value)}),(0,p.jsx)(`code`,{children:j})]})]})]})]})]}),ue&&(0,p.jsxs)(`section`,{className:`settings-group`,"aria-labelledby":`settings-type-heading`,children:[(0,p.jsx)(`h3`,{id:`settings-type-heading`,className:`settings-group-title`,children:`Typography`}),(0,p.jsx)(`div`,{className:`settings-card settings-card-padded`,children:(0,p.jsx)(`div`,{className:`studio-choice-grid studio-type-grid`,role:`radiogroup`,"aria-label":`Typography and craft`,children:C.map(e=>(0,p.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":le===e.id,className:`studio-choice-card studio-type-card`,"data-type-choice":e.id,onClick:()=>ue(e.id),children:[(0,p.jsx)(`span`,{className:`studio-type-sample`,"aria-hidden":`true`,children:e.sample}),(0,p.jsxs)(`span`,{className:`studio-choice-copy`,children:[(0,p.jsx)(`strong`,{children:e.label}),(0,p.jsx)(`small`,{children:e.hint})]})]},e.id))})})]}),ae&&(0,p.jsxs)(`section`,{className:`settings-group`,"aria-labelledby":`settings-backdrop-heading`,children:[(0,p.jsx)(`h3`,{id:`settings-backdrop-heading`,className:`settings-group-title`,children:`Canvas atmosphere`}),(0,p.jsx)(`div`,{className:`settings-card settings-card-padded`,children:(0,p.jsx)(`div`,{className:`studio-choice-grid studio-backdrop-grid`,role:`radiogroup`,"aria-label":`Canvas atmosphere`,children:x.map(e=>(0,p.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":ie===e.id,className:`studio-choice-card`,"data-choice":e.id,onClick:()=>ae(e.id),children:[(0,p.jsx)(`span`,{className:`studio-backdrop-swatch is-${e.id}`,"aria-hidden":`true`}),(0,p.jsxs)(`span`,{className:`studio-choice-copy`,children:[(0,p.jsx)(`strong`,{children:e.label}),(0,p.jsx)(`small`,{children:e.hint})]})]},e.id))})})]})]}),K===`account`&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`div`,{className:`settings-intro`,children:[(0,p.jsx)(`h2`,{children:`Account`}),(0,p.jsx)(`p`,{children:`Sign in with Google, GitHub, or GitLab to browse and clone repositories in one click.`})]}),P?.authenticated&&P.account?(0,p.jsxs)(`section`,{className:`settings-group`,"aria-labelledby":`settings-profile-heading`,children:[(0,p.jsx)(`h3`,{id:`settings-profile-heading`,className:`settings-group-title`,children:`Details`}),(0,p.jsxs)(`div`,{className:`settings-card`,children:[(0,p.jsxs)(`div`,{className:`settings-row settings-account-hero-row`,children:[(0,p.jsxs)(`div`,{className:`wb-account-identity`,children:[(0,p.jsx)(`span`,{className:`wb-account-avatar`,"aria-hidden":`true`,children:s(P.account)}),(0,p.jsxs)(`div`,{className:`wb-account-copy`,children:[(0,p.jsx)(`strong`,{children:P.account.name||P.account.username}),(0,p.jsxs)(`small`,{children:[`@`,P.account.username,P.account.email?` · ${P.account.email}`:``]})]})]}),(0,p.jsxs)(`span`,{className:`settings-provider-pill`,children:[(0,p.jsx)(u,{provider:P.account.provider}),c(P.account.provider)]})]}),(0,p.jsxs)(`div`,{className:`settings-row`,children:[(0,p.jsxs)(`div`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Name`}),(0,p.jsx)(`small`,{children:`Display name from your connected account`})]}),(0,p.jsx)(`span`,{className:`settings-row-value`,children:P.account.name||P.account.username})]}),(0,p.jsxs)(`div`,{className:`settings-row`,children:[(0,p.jsxs)(`div`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Username`}),(0,p.jsx)(`small`,{children:`Account handle used for repository sync`})]}),(0,p.jsxs)(`span`,{className:`settings-row-value`,children:[`@`,P.account.username]})]}),P.account.email&&(0,p.jsxs)(`div`,{className:`settings-row`,children:[(0,p.jsxs)(`div`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Email`}),(0,p.jsx)(`small`,{children:`Email linked to this session`})]}),(0,p.jsx)(`span`,{className:`settings-row-value`,children:P.account.email})]}),(0,p.jsxs)(`div`,{className:`settings-row`,children:[(0,p.jsxs)(`div`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Plan`}),(0,p.jsx)(`small`,{children:`Current workspace access tier`})]}),(0,p.jsx)(`span`,{className:`settings-row-value`,children:l(P.account.subscription)})]}),(0,p.jsxs)(`div`,{className:`settings-row`,children:[(0,p.jsxs)(`div`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Sign-in method`}),(0,p.jsx)(`small`,{children:`How this local session was verified`})]}),(0,p.jsx)(`span`,{className:`settings-row-value`,children:d(P.account.method)})]}),(0,p.jsxs)(`div`,{className:`settings-row`,children:[(0,p.jsxs)(`div`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Session storage`}),(0,p.jsx)(`small`,{children:`Where your sign-in token is kept on this computer`})]}),(0,p.jsx)(`span`,{className:`settings-row-value`,children:P.account.remembered?`System credential vault`:`Memory only (this session)`})]}),(0,p.jsxs)(`div`,{className:`settings-row settings-account-actions-row`,children:[F&&(0,p.jsx)(`button`,{type:`button`,className:`button subtle`,onClick:()=>F(),children:`Manage account & sync`}),Se&&(0,p.jsx)(`button`,{type:`button`,className:`button subtle`,onClick:()=>void Se(),children:`Sign out`})]})]})]}):(0,p.jsxs)(`div`,{className:`settings-card settings-account-signedout`,children:[(0,p.jsxs)(`div`,{className:`settings-account-signedout-copy`,children:[(0,p.jsxs)(`div`,{className:`settings-provider-glyphs`,"aria-hidden":`true`,children:[(0,p.jsx)(u,{provider:`google`}),(0,p.jsx)(u,{provider:`github`}),(0,p.jsx)(u,{provider:`gitlab`})]}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`strong`,{children:`Not signed in`}),(0,p.jsx)(`p`,{children:`Studio works completely offline for local folders. Sign in only if you want to browse your GitHub or GitLab repositories or sync presets.`})]})]}),F&&(0,p.jsx)(`button`,{type:`button`,className:`button primary`,onClick:()=>{F()},children:`Sign in with Google, GitHub, or GitLab`})]}),(0,p.jsxs)(`section`,{className:`settings-group`,"aria-labelledby":`settings-privacy-heading`,children:[(0,p.jsx)(`h3`,{id:`settings-privacy-heading`,className:`settings-group-title`,children:`Privacy & credentials`}),(0,p.jsxs)(`div`,{className:`settings-card`,children:[(0,p.jsxs)(`div`,{className:`settings-row`,children:[(0,p.jsxs)(`div`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Separate from AI model keys`}),(0,p.jsx)(`small`,{children:`Signing in here never shares or bills AI model APIs. Manage model keys and spending caps separately in Connections.`})]}),(0,p.jsx)(`button`,{type:`button`,className:`button subtle`,onClick:()=>X(`ai-models`),children:`AI Models`})]}),(0,p.jsxs)(`div`,{className:`settings-row`,children:[(0,p.jsxs)(`div`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Separate from AI editor access`}),(0,p.jsx)(`small`,{children:`Connected editors (Cursor, Antigravity, Claude, Codex) use their own revocable project permissions.`})]}),(0,p.jsx)(`button`,{type:`button`,className:`button subtle`,onClick:()=>X(`mcp-clients`),children:`AI Clients`})]}),(0,p.jsx)(`div`,{className:`settings-row`,children:(0,p.jsxs)(`div`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Local-first files`}),(0,p.jsx)(`small`,{children:`Your code stays on this machine. Files are never edited without your approval, and Undo keeps exact originals.`})]})})]})]})]}),K===`media`&&(0,p.jsx)(ee,{}),K===`workflows`&&(0,p.jsx)(b,{data:Pe,inspection:De,onSelect:Te,onSkillChange:Ue}),Ve&&(0,p.jsx)(`div`,{hidden:K!==`setup-modules`,children:(0,p.jsx)(n,{initialInspection:q,onInstalled:()=>Be(e=>e+1)})}),K===`guide`&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`div`,{className:`settings-intro`,children:[(0,p.jsx)(`h2`,{children:`Shortcuts & guide`}),(0,p.jsx)(`p`,{children:`Keyboard shortcuts, a quick walkthrough of how revisions work, and command line checks for your projects.`})]}),(0,p.jsxs)(`section`,{className:`settings-group`,"aria-labelledby":`settings-shortcuts-heading`,children:[(0,p.jsx)(`h3`,{id:`settings-shortcuts-heading`,className:`settings-group-title`,children:`Keyboard shortcuts`}),(0,p.jsx)(`div`,{className:`settings-card`,children:w.map(e=>(0,p.jsxs)(`div`,{className:`settings-shortcut-block`,children:[(0,p.jsx)(`div`,{className:`settings-shortcut-group-name`,children:e.group}),e.items.map(e=>(0,p.jsxs)(`div`,{className:`settings-row settings-shortcut-row`,children:[(0,p.jsx)(`span`,{children:e.action}),(0,p.jsx)(`span`,{className:`settings-kbd-group`,children:e.keys.map(e=>(0,p.jsx)(`kbd`,{children:e},e))})]},e.action))]},e.group))})]}),(0,p.jsxs)(`section`,{className:`settings-group`,"aria-labelledby":`settings-guide-heading`,children:[(0,p.jsx)(`h3`,{id:`settings-guide-heading`,className:`settings-group-title`,children:`Start a revision in Studio`}),(0,p.jsx)(`div`,{className:`settings-card settings-card-padded`,children:(0,p.jsxs)(`ol`,{className:`guide-steps`,children:[(0,p.jsxs)(`li`,{children:[(0,p.jsx)(`h4`,{children:`Choose or create a project`}),(0,p.jsxs)(`p`,{children:[`Open any Static HTML, React + Vite, or Next.js project — or use`,` `,(0,p.jsx)(`strong`,{children:`Create new project`}),` to start from a clean template. Save reusable project rules in `,(0,p.jsx)(`code`,{children:`.ui-workflow.json`}),`.`]}),Ce&&(0,p.jsx)(`button`,{className:`button subtle`,type:`button`,onClick:Ce,children:`Try the sample Focus Board project`})]}),(0,p.jsxs)(`li`,{children:[(0,p.jsx)(`h4`,{children:`Choose how your AI works`}),(0,p.jsxs)(`div`,{className:`guide-execution-options`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsxs)(`h5`,{children:[(0,p.jsx)(i,{name:`auto`}),` Auto`]}),(0,p.jsx)(`p`,{children:`Add a Gemini, OpenRouter, or Groq key in Connections, pick a model, and review cost limits before starting.`}),(0,p.jsxs)(`button`,{className:`button subtle`,type:`button`,onClick:()=>X(`ai-models`),children:[`Set up Auto `,(0,p.jsx)(i,{name:`arrow`})]})]}),(0,p.jsxs)(`div`,{children:[(0,p.jsxs)(`h5`,{children:[(0,p.jsx)(i,{name:`mcp`}),` AI client`]}),(0,p.jsxs)(`p`,{children:[`Connect Cursor, Antigravity, Claude Desktop, Claude Code, or Codex in one click from Connections or via`,` `,(0,p.jsx)(`code`,{children:`ui-workflow connect <client>`}),`.`]}),(0,p.jsxs)(`button`,{className:`button subtle`,type:`button`,onClick:()=>X(`mcp-clients`),children:[`Choose an AI client `,(0,p.jsx)(i,{name:`arrow`})]})]})]})]}),(0,p.jsxs)(`li`,{children:[(0,p.jsx)(`h4`,{children:`Write a prompt and keep behaviors safe`}),(0,p.jsx)(`p`,{children:`Describe what to improve and list anything that must keep working (menus, forms, keyboard shortcuts). Pick colors, attach references, or adjust file scope below the prompt box.`})]}),(0,p.jsxs)(`li`,{children:[(0,p.jsx)(`h4`,{children:`Preview, check, then apply with Undo`}),(0,p.jsx)(`p`,{children:`Inspect changed lines, security and accessibility findings, and desktop/tablet/phone previews. Apply safely with 1-click Undo or export to a separate Git branch.`})]})]})})]}),(0,p.jsxs)(`section`,{className:`settings-group`,"aria-labelledby":`settings-cli-heading`,children:[(0,p.jsx)(`h3`,{id:`settings-cli-heading`,className:`settings-group-title`,children:`Terminal & pull request checks`}),(0,p.jsx)(`div`,{className:`settings-card`,children:(0,p.jsxs)(`div`,{className:`settings-row`,children:[(0,p.jsxs)(`div`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Run checks from your terminal`}),(0,p.jsxs)(`small`,{children:[`Run `,(0,p.jsx)(`code`,{children:`ui-workflow audit --render --compact`}),` in any project folder, or add`,` `,(0,p.jsx)(`code`,{children:`examples/github-actions/ui-workflow-pr-qa.yml`}),` to GitHub Actions.`]})]}),(0,p.jsxs)(`div`,{className:`settings-row-actions`,children:[(0,p.jsx)(`button`,{type:`button`,className:`button subtle`,onClick:()=>void Ge(),children:je?`Copied`:`Copy command`}),(0,p.jsx)(`button`,{type:`button`,className:`button subtle`,onClick:We,children:`Local tools`})]})]})})]})]})]})]})]})})]});return B?(0,p.jsx)(`dialog`,{ref:H,className:`settings-dialog`,"aria-labelledby":`settings-title`,onCancel:e=>{e.preventDefault(),Z()},onClick:e=>{if(e.target!==e.currentTarget)return;let t=e.currentTarget.getBoundingClientRect();(e.clientX<t.left||e.clientX>t.right||e.clientY<t.top||e.clientY>t.bottom)&&Z()},children:Qe}):(0,p.jsx)(`section`,{className:`settings-dialog settings-page`,"aria-labelledby":`settings-title`,onKeyDown:e=>{if(e.key===`Escape`&&!e.defaultPrevented){if(W){e.preventDefault(),G(``);return}Z()}},children:Qe})}export{O as default};
1
+ import{i as e,t}from"./react-vendor-CH5vucNG.js";import{a as n,d as r,f as i,l as a,p as o,u as s}from"./index-Dp8CdAV4.js";import{a as c,i as l,n as u,r as d}from"./account-modal-Cm9Rsqyi.js";import{r as ee,t as te}from"./Connections-BD_LstwM.js";var f=e(),p=t(),m=[{id:`scope-intake`,title:`Read project`,inputs:[`Your static site, React/Vite, or Next.js folder, brief, and optional project rules`],checks:[`Detects your framework and styling stack, then snapshots only the UI files you allow`],modules:[`Framework detection`,`Project rules`,`Editable file scope`],boundaries:[`Reads only approved UI folders — never installs packages or runs repo scripts`]},{id:`direction-design`,title:`Pick direction`,inputs:[`Optional palette, reference screenshots, layout direction, and active design guides`],checks:[`Keeps your existing colors and typography consistent unless you ask for a change`],modules:[`Design guides`,`Project palette`,`Reference images`],boundaries:[`Shares only the images and guides you explicitly attach to the run`]},{id:`draft-qa`,title:`Build & check`,inputs:[`Proposed file edits and your project snapshot`],checks:[`Runs typecheck, build, security checks, and desktop/mobile/dark browser checks with line-by-line fixes`],modules:[`Build & typecheck`,`Security & a11y audit`,`Desktop & mobile browser checks`],boundaries:[`Builds and browser previews run on isolated copies only when you trust the project`]},{id:`diff-walkthrough`,title:`Review changes`,inputs:[`File diffs, effort summary, audit findings, and local responsive preview`],checks:[`Compare Before/After at desktop, tablet, and phone widths and inspect every changed line`],modules:[`Walkthrough & diffs`,`1up / 2up / slider preview`,`Before/After HTML report`],boundaries:[`Checks guide your review — nothing touches your files until you approve`]},{id:`reviewed-apply`,title:`Apply with Undo`,inputs:[`Approved edits and exact original file backups`],checks:[`Verifies files have not changed on disk, saves backups first, and keeps 1-click Undo`],modules:[`Safe Apply`,`Whole-run & per-file Undo`,`Git review branch export`],boundaries:[`Review-first Apply is the default; live-edit batches are opt-in and revocable`]}],h=[[`Uses`,`inputs`],[`What it checks`,`checks`],[`Included tools`,`modules`],[`Safety`,`boundaries`]],g=[`All`,`Hub`,`Project`],_={hub:`Hub`,project:`Project`,custom:`Custom`};function v({stages:e,modules:t}){let[n,r]=(0,f.useState)(``),i=e.find(e=>e.id===n)??e[0],a=50/e.length;return(0,p.jsxs)(`section`,{className:`settings-workflow-diagram`,"aria-labelledby":`workflow-diagram-heading`,children:[(0,p.jsx)(`h3`,{id:`workflow-diagram-heading`,children:`Workflow stage diagram`}),(0,p.jsxs)(`div`,{className:`settings-stage-map`,children:[(0,p.jsxs)(`svg`,{className:`settings-stage-track`,viewBox:`0 0 100 100`,preserveAspectRatio:`none`,"aria-hidden":`true`,children:[(0,p.jsx)(`path`,{className:`stage-track-horizontal`,d:`M ${a} 50 H ${100-a}`,vectorEffect:`non-scaling-stroke`}),(0,p.jsx)(`path`,{className:`stage-track-vertical`,d:`M 50 ${a} V ${100-a}`,vectorEffect:`non-scaling-stroke`})]}),(0,p.jsx)(`ol`,{children:e.map((e,t)=>(0,p.jsx)(`li`,{children:(0,p.jsxs)(`button`,{type:`button`,"aria-pressed":i.id===e.id,"aria-controls":`workflow-stage-detail`,onClick:()=>r(e.id),children:[(0,p.jsxs)(`span`,{className:`settings-stage-node`,children:[(0,p.jsx)(`svg`,{viewBox:`0 0 32 32`,"aria-hidden":`true`,children:(0,p.jsx)(`circle`,{cx:`16`,cy:`16`,r:`14`})}),(0,p.jsx)(`span`,{children:t+1})]}),(0,p.jsx)(`span`,{children:e.title})]})},e.id))})]}),(0,p.jsxs)(`div`,{className:`settings-stage-detail`,id:`workflow-stage-detail`,"aria-live":`polite`,children:[(0,p.jsx)(`h4`,{children:i.title}),i.summary&&(0,p.jsx)(`p`,{className:`settings-stage-summary`,children:i.summary}),(0,p.jsx)(`dl`,{children:h.map(([e,n])=>{let r=n===`modules`?[...new Set([...i.modules??[],...t])]:i[n]??[];return(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`dt`,{children:e}),(0,p.jsx)(`dd`,{children:r.length?r.join(` · `):`None reported`})]},n)})})]})]})}function y({skills:e,guides:t,projectModules:n,onChange:r,scope:a}){let[o,s]=(0,f.useState)(`All`),[c,l]=(0,f.useState)(``),[u,d]=(0,f.useState)(!1),[ee,te]=(0,f.useState)(``),[m,h]=(0,f.useState)(!1),[v,y]=(0,f.useState)(``),[b,x]=(0,f.useState)(``),S=t??[],C=S.find(e=>e.id===ee)??S[0],w=Array.isArray(e),T=[...e??[],...n.map(e=>({id:`module-`+e,name:e,scope:`project`,description:`Detected in the project`,enabled:!0,sourcePath:``,trigger:``}))].filter(e=>a===`custom`?e.scope===`custom`:e.scope!==`custom`&&(o===`All`||o.toLowerCase()===e.scope)&&[e.id,e.name,e.description,e.trigger,e.sourcePath].join(` `).toLowerCase().includes(c.trim().toLowerCase()));async function E(e){h(!0),y(``),x(``);try{await r(e),e.action===`add`&&(d(!1),l(``)),x(e.action===`add`?`Skill added.`:`Skill preference saved.`)}catch(e){y(e.message)}finally{h(!1)}}function D(e){e.preventDefault();let t=new FormData(e.currentTarget),n=String(t.get(`name`)??``).trim(),r=String(t.get(`sourcePath`)??``).trim(),i=String(t.get(`trigger`)??``).trim();!n||!r||!i?y(`Enter a skill name, source path and trigger.`):E({action:`add`,name:n,sourcePath:r,trigger:i})}return(0,p.jsxs)(`section`,{className:`settings-skills`,"data-skill-scope":a,"aria-labelledby":a===`custom`?`settings-custom-skills-title`:`settings-skills-title`,children:[(0,p.jsxs)(`div`,{className:`settings-section-heading`,children:[(0,p.jsx)(`h3`,{id:a===`custom`?`settings-custom-skills-title`:`settings-skills-title`,children:a===`custom`?`Custom skills`:`Skills & modules`}),a===`custom`&&(0,p.jsxs)(`button`,{className:`button subtle`,type:`button`,"aria-expanded":u,"aria-controls":`settings-add-skill`,onClick:()=>d(e=>!e),children:[(0,p.jsx)(i,{name:u?`minus`:`plus`}),` `,u?`Close form`:`Import skill`]})]}),v&&(0,p.jsx)(`p`,{className:`error-box`,role:`alert`,children:v}),b&&(0,p.jsx)(`p`,{className:`connection-success`,role:`status`,children:b}),a===`custom`&&(0,p.jsx)(`div`,{id:`settings-add-skill`,hidden:!u,children:u&&(0,p.jsxs)(`form`,{className:`settings-skill-form`,onSubmit:D,children:[(0,p.jsxs)(`label`,{children:[`Skill name`,(0,p.jsx)(`input`,{name:`name`,required:!0})]}),(0,p.jsxs)(`label`,{children:[`Source path`,(0,p.jsx)(`input`,{name:`sourcePath`,required:!0,placeholder:`C:\\skills\\example\\SKILL.md`})]}),(0,p.jsxs)(`label`,{children:[`Trigger`,(0,p.jsx)(`input`,{name:`trigger`,required:!0,placeholder:`When should Studio use this skill?`})]}),(0,p.jsx)(`button`,{className:`button primary`,type:`submit`,disabled:m||!w,children:`Save skill`})]})}),a===`studio`&&(0,p.jsxs)(`section`,{className:`settings-guide-preview`,"aria-label":`Design guidance`,children:[(0,p.jsxs)(`div`,{className:`settings-guide-header`,children:[(0,p.jsxs)(`div`,{className:`settings-guide-heading`,children:[(0,p.jsx)(`span`,{className:`settings-guide-mark`,"aria-hidden":`true`,children:(0,p.jsx)(i,{name:`palette`})}),(0,p.jsx)(`div`,{children:(0,p.jsx)(`h4`,{children:`Active design guide`})})]}),S.length>1&&(0,p.jsxs)(`label`,{className:`settings-guide-select`,children:[(0,p.jsx)(`span`,{children:`Guide`}),(0,p.jsx)(`select`,{value:C?.id??``,onChange:e=>te(e.target.value),children:S.map(e=>(0,p.jsx)(`option`,{value:e.id,children:e.name},e.id))})]})]}),!C&&(0,p.jsx)(`p`,{className:`settings-guide-empty`,children:`No design guidance available.`}),C&&(0,p.jsxs)(`div`,{className:`settings-guide-body`,children:[(0,p.jsxs)(`div`,{className:`settings-guide-summary`,children:[(0,p.jsx)(`strong`,{children:C.name}),C.summary&&(0,p.jsx)(`p`,{children:C.summary}),(0,p.jsxs)(`details`,{className:`settings-guide-source`,children:[(0,p.jsx)(`summary`,{children:`View source file`}),(0,p.jsx)(`code`,{translate:`no`,children:C.sourcePath})]})]}),(0,p.jsxs)(`dl`,{className:`settings-guide-facts`,children:[C.motionCurve&&(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`dt`,{children:`Motion`}),(0,p.jsx)(`dd`,{children:(0,p.jsx)(`code`,{children:C.motionCurve})})]}),C.typographyRatio&&(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`dt`,{children:`Typography`}),(0,p.jsx)(`dd`,{children:C.typographyRatio})]}),C.grid&&(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`dt`,{children:`Grid`}),(0,p.jsx)(`dd`,{children:C.grid})]}),C.colorAgnostic===!0&&(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`dt`,{children:`Palette`}),(0,p.jsx)(`dd`,{children:`Color follows the project palette.`})]})]})]})]}),(0,p.jsx)(`div`,{className:`settings-skills-layout`,children:(0,p.jsxs)(`div`,{className:`settings-skill-list-pane`,children:[a===`studio`&&(0,p.jsxs)(`div`,{className:`settings-directory-controls`,children:[(0,p.jsx)(`div`,{className:`settings-filters`,role:`group`,"aria-label":`Skill source`,children:g.map(e=>(0,p.jsx)(`button`,{type:`button`,"aria-pressed":e===o,onClick:()=>s(e),children:e},e))}),(0,p.jsxs)(`label`,{className:`settings-search`,children:[(0,p.jsx)(i,{name:`search`}),(0,p.jsx)(`input`,{type:`search`,"aria-label":`Search skills`,placeholder:`Search skills…`,value:c,onChange:e=>l(e.target.value)})]})]}),(0,p.jsxs)(`ul`,{className:`settings-directory-list`,"aria-label":`Skills and detected modules`,children:[T.map(e=>{let t=e.id.startsWith(`module-`);return(0,p.jsxs)(`li`,{className:`settings-directory-row settings-skill-row`,"data-skill-source":e.scope,children:[(0,p.jsx)(`span`,{className:`settings-directory-icon`,children:(0,p.jsx)(i,{name:t?`component`:e.scope===`project`?`folder`:`terminal`})}),(0,p.jsxs)(`div`,{className:`settings-directory-copy`,children:[(0,p.jsxs)(`div`,{className:`settings-directory-name`,children:[(0,p.jsx)(`strong`,{children:e.name}),(0,p.jsx)(`span`,{className:`settings-type-label`,children:_[e.scope]})]}),(0,p.jsx)(`p`,{children:e.description??e.trigger??e.sourcePath})]}),t?(0,p.jsx)(`span`,{className:`settings-connected`,children:`Detected`}):(0,p.jsx)(`button`,{type:`button`,className:`settings-skill-switch`,role:`switch`,"aria-label":e.name,"aria-checked":e.enabled,disabled:m||!w,onClick:()=>void E({action:`toggle`,id:e.id,enabled:!e.enabled})})]},e.id)}),T.length===0&&(0,p.jsx)(`li`,{className:`settings-directory-empty`,role:`status`,children:w?a===`custom`?`No custom skills have been imported.`:`No skills or modules match these filters.`:`Skill catalogue is unavailable.`})]})]})})]})}function b({data:e,inspection:t,onSelect:n,onSkillChange:a}){let[o,s]=(0,f.useState)(`workflows`),c=r(t),l=e?.workflowStages.length?[...e.workflowStages].sort((e,t)=>e.order-t.order).map(e=>({...m.find(t=>t.id===e.id)??{id:e.id,title:e.label,inputs:[],checks:[],modules:[],boundaries:[]},title:e.label,summary:e.summary})):m;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`div`,{className:`settings-intro`,children:[(0,p.jsx)(`h2`,{children:`How Studio runs a revision`}),(0,p.jsx)(`p`,{children:`Pick a workflow focus to tailor checks and design advice for your task. Studio can also choose automatically from your prompt.`})]}),(0,p.jsx)(v,{stages:l,modules:c}),(0,p.jsx)(`div`,{className:`mcp-client-tabs settings-connection-tabs settings-workflow-tabs`,role:`tablist`,"aria-label":`Workflow settings pages`,onKeyDown:e=>{if(![`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(e.key))return;let t=Array.from(e.currentTarget.querySelectorAll(`[role="tab"]`)),n=t.indexOf(document.activeElement),r=e.key===`Home`?0:e.key===`End`?t.length-1:(n+(e.key===`ArrowRight`?1:-1)+t.length)%t.length;e.preventDefault(),t[r]?.focus();let i=t[r]?.dataset.workflowTab;(i===`workflows`||i===`skills`||i===`custom`)&&s(i)},children:[[`workflows`,`Workflows`,`graph`],[`skills`,`Skills`,`terminal`],[`custom`,`Custom`,`plus`]].map(([e,t,n])=>(0,p.jsxs)(`button`,{id:`workflow-`+e+`-tab`,type:`button`,role:`tab`,"data-workflow-tab":e,tabIndex:o===e?0:-1,"aria-selected":o===e,"aria-controls":`workflow-`+e+`-panel`,onClick:()=>s(e),children:[(0,p.jsx)(i,{name:n}),t]},e))}),(0,p.jsx)(`div`,{id:`workflow-workflows-panel`,role:`tabpanel`,"aria-labelledby":`workflow-workflows-tab`,tabIndex:0,hidden:o!==`workflows`,children:o===`workflows`&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(`h3`,{className:`settings-workflow-focus-heading`,children:`Workflow focuses`}),(0,p.jsx)(`div`,{className:`workflow-overview`,children:e?.workflows?.map(e=>(0,p.jsxs)(`section`,{className:`workflow-focus`,children:[(0,p.jsx)(`div`,{className:`workflow-focus-icon`,children:(0,p.jsx)(i,{name:e.icon})}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`h3`,{children:e.title}),(0,p.jsx)(`p`,{children:e.summary}),(0,p.jsx)(`p`,{className:`workflow-includes-label`,children:`What this focus brings`}),(0,p.jsx)(`ul`,{className:`workflow-outputs`,"aria-label":e.title+` includes`,children:e.outputs.map(e=>(0,p.jsxs)(`li`,{children:[(0,p.jsx)(i,{name:`check`}),e]},e))}),(0,p.jsxs)(`details`,{children:[(0,p.jsx)(`summary`,{children:`How this workflow works`}),(0,p.jsx)(`p`,{children:e.detail})]}),n&&(0,p.jsxs)(`button`,{className:`text-button workflow-use`,type:`button`,"aria-label":`Use `+e.title+` focus`,onClick:()=>n(e.profile),children:[`Choose `,e.title,` `,(0,p.jsx)(i,{name:`arrow`})]})]})]},e.id))}),(0,p.jsxs)(`section`,{className:`hub-toolkit`,"aria-labelledby":`engine-capabilities-heading`,children:[(0,p.jsxs)(`div`,{className:`hub-toolkit-heading`,children:[(0,p.jsx)(`span`,{className:`hub-toolkit-icon`,children:(0,p.jsx)(i,{name:`terminal`})}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`h3`,{id:`engine-capabilities-heading`,children:`Frameworks, CLI & CI`}),(0,p.jsx)(`p`,{children:`The same local check engine powers Studio, the standalone CLI, connected AI clients, and GitHub Actions.`})]})]}),(0,p.jsxs)(`dl`,{className:`workflow-capability-grid`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`dt`,{children:`Supported projects`}),(0,p.jsx)(`dd`,{children:`Static HTML/CSS/JS, React + Vite (TypeScript or JS), and Next.js (App & Pages Router, Tailwind v4, shadcn/ui).`})]}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`dt`,{children:`Built-in checks`}),(0,p.jsx)(`dd`,{children:`Checks build, security, mobile/desktop layout, color contrast, accessibility, and console errors with copyable AI fix prompts.`})]}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`dt`,{children:`Project rules`}),(0,p.jsxs)(`dd`,{children:[`Save pages to test, design direction, must-keep behaviors, and optional warning overrides in `,(0,p.jsx)(`code`,{children:`.ui-workflow.json`}),`.`]})]}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`dt`,{children:`CLI & pull requests`}),(0,p.jsxs)(`dd`,{children:[`Run `,(0,p.jsx)(`code`,{children:`ui-workflow audit --render --compact`}),` locally, or copy`,` `,(0,p.jsx)(`code`,{children:`examples/github-actions/ui-workflow-pr-qa.yml`}),` for PR checks.`]})]})]})]}),(0,p.jsxs)(`section`,{className:`hub-toolkit`,children:[(0,p.jsxs)(`div`,{className:`hub-toolkit-heading`,children:[(0,p.jsx)(`span`,{className:`hub-toolkit-icon`,children:(0,p.jsx)(i,{name:`component`})}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`h3`,{children:`Optional local tools`}),(0,p.jsx)(`p`,{children:`Extra design and testing tools available in your local workspace.`})]})]}),(0,p.jsx)(`div`,{className:`hub-toolkit-list`,children:e?.hubToolGroups?.map(e=>(0,p.jsxs)(`details`,{children:[(0,p.jsxs)(`summary`,{children:[(0,p.jsx)(`span`,{className:`hub-group-icon`,children:(0,p.jsx)(i,{name:e.icon})}),(0,p.jsx)(`span`,{children:e.title}),(0,p.jsx)(i,{name:`chevron`})]}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`p`,{children:e.description}),(0,p.jsx)(`small`,{children:e.reach})]})]},e.id))})]}),(0,p.jsxs)(`p`,{className:`workflow-scope-note`,children:[(0,p.jsx)(i,{name:`shield`}),(0,p.jsx)(`span`,{children:`Every workflow keeps your files read-only until you review and approve changes.`})]})]})}),(0,p.jsx)(`div`,{id:`workflow-skills-panel`,role:`tabpanel`,"aria-labelledby":`workflow-skills-tab`,tabIndex:0,hidden:o!==`skills`,children:o===`skills`&&(0,p.jsx)(y,{skills:e?.skills,guides:e?.designGuides,projectModules:c,onChange:a,scope:`studio`})}),(0,p.jsx)(`div`,{id:`workflow-custom-panel`,role:`tabpanel`,"aria-labelledby":`workflow-custom-tab`,tabIndex:0,hidden:o!==`custom`,children:o===`custom`&&(0,p.jsx)(y,{skills:e?.skills,projectModules:c,onChange:a,scope:`custom`})})]})}var x=[{id:`hallmark`,label:`Dot Matrix`,hint:`Interactive dot field that responds to your cursor`},{id:`topo`,label:`Contour Blueprint`,hint:`Drafting rings and subtle grid halo`},{id:`isometric`,label:`Isometric Prism`,hint:`Interactive 30° architectural lattice with illuminated facets`},{id:`crosshair`,label:`Studio Crosshair`,hint:`Precision Swiss registration marks that rotate near your cursor`},{id:`mesh`,label:`Silk Ribbons`,hint:`Flowing translucent silk light waves tuned to your accent`},{id:`orbit`,label:`Constellation`,hint:`Orbital arcs and floating geometric nodes linked by hairlines`},{id:`horizon`,label:`Horizon Stage`,hint:`Volumetric overhead light shafts over a 3D perspective floor`},{id:`minimal`,label:`Clean Matte`,hint:`Still, distraction-free solid canvas`}],S=[{id:`crimson`,label:`Signal Crimson`,swatch:`#c80909`},{id:`indigo`,label:`Studio Indigo`,swatch:`#4f46e5`},{id:`orange`,label:`Cadmium Orange`,swatch:`#d94e1f`},{id:`emerald`,label:`Verdant Green`,swatch:`#0d7a5f`},{id:`custom`,label:`Custom colors`,swatch:`conic-gradient(#4f46e5, #ec4899, #06b6d4, #4f46e5)`}],C=[{id:`manrope`,label:`Studio Sans`,sample:`Aa`,hint:`Balanced geometric sans for headings and controls`},{id:`editorial`,label:`Editorial Serif`,sample:`Aa`,hint:`Bookish serif headlines paired with clean sans UI`},{id:`system`,label:`System Native`,sample:`Aa`,hint:`Matches your operating system’s native desktop font`},{id:`grotesk`,label:`Neo Grotesk`,sample:`Ag`,hint:`Tight Swiss-inspired display with crisp tabular numbers`},{id:`mono`,label:`Developer Mono`,sample:`01`,hint:`Code-first monospace titles and technical labels`},{id:`handwritten`,label:`Studio Script`,sample:`Aa`,hint:`Warm handwritten headings with readable sans controls`}],w=[{group:`Studio navigation`,items:[{action:`Show or hide the sidebar`,keys:[`Ctrl`,`B`]},{action:`Open or close Settings`,keys:[`Ctrl`,`,`]},{action:`Focus search in Connections or Settings`,keys:[`/`]},{action:`Close open panels, drawers, or Settings`,keys:[`Esc`]}]},{group:`Workspace & revisions`,items:[{action:`Run revision or send follow-up message`,keys:[`Ctrl`,`Enter`]},{action:`Previous changed file in code diff`,keys:[`[`]},{action:`Next changed file in code diff`,keys:[`]`]}]},{group:`Workflow visual editor`,items:[{action:`Open Add Step palette`,keys:[`A`]},{action:`Fit workflow graph to screen`,keys:[`0`]},{action:`Zoom in or zoom out`,keys:[`+`,`-`]},{action:`Pan around the canvas`,keys:[`Space`,`Drag`]},{action:`Remove selected optional step`,keys:[`Del`]}]}],T=[{title:`Default workflow mode`,description:`Start new revisions with Auto or your connected AI client`,section:`general`,sectionLabel:`General`,keywords:`auto mcp ai client mode execution default workspace`},{title:`Allow creating new files`,description:`Let revisions add new UI files instead of editing existing files only`,section:`general`,sectionLabel:`General`,keywords:`create files scope permissions write`},{title:`Default preview comparison`,description:`Open previews in Single (1up), Side by side (2up), or Diff slider mode`,section:`general`,sectionLabel:`General`,keywords:`preview compare 1up 2up slider visual diff before after`},{title:`Default preview width`,description:`Choose Desktop, Tablet, or Phone as the starting preview width`,section:`general`,sectionLabel:`General`,keywords:`preview size viewport responsive mobile phone tablet desktop`},{title:`Clear saved browser draft`,description:`Remove the unsent brief, project path, and mode cached in this browser`,section:`general`,sectionLabel:`General`,keywords:`draft cache storage clear reset browser`},{title:`Diagnostics & history`,description:`Open older jobs, manual imports, and low-level run records`,section:`general`,sectionLabel:`General`,keywords:`diagnostics logs jobs debug support`},{title:`Theme (System, Light, Dark)`,description:`Match your device theme or lock Studio to Light or Dark mode`,section:`appearance`,sectionLabel:`Appearance`,keywords:`theme dark light system polarity color scheme`},{title:`Contrast`,description:`Switch between Default and Strong borders and text contrast`,section:`appearance`,sectionLabel:`Appearance`,keywords:`contrast accessibility wcag borders readable high`},{title:`Text size`,description:`Adjust interface text density between Compact, Default, and Large`,section:`appearance`,sectionLabel:`Appearance`,keywords:`font size text scale compact large zoom readability`},{title:`Background motion & hover effects`,description:`Independently toggle background drift, cursor hover effects, and page reveals`,section:`appearance`,sectionLabel:`Appearance`,keywords:`motion hover cursor ripple glow animation reduced transitions`},{title:`Accent color, typography & atmosphere`,description:`Pick Signal Crimson, custom hex colors, font voice, and canvas backdrop`,section:`appearance`,sectionLabel:`Appearance`,keywords:`accent crimson indigo custom color hex font typography dot matrix backdrop`},{title:`Account & sign-in`,description:`Sign in with Google, GitHub, or GitLab for repository access and sync`,section:`account`,sectionLabel:`Account`,keywords:`account login sign in google github gitlab profile plan privacy`},{title:`Workflows, skills & design guides`,description:`Configure workflow focuses, built-in skills, custom skills, and design blueprints`,section:`workflows`,sectionLabel:`Workflows`,keywords:`workflows skills guides design system blueprints custom`},{title:`Local tools & browser checks`,description:`Install Playwright Chromium, visual diff tools, and optional local extensions`,section:`setup-modules`,sectionLabel:`Local tools`,keywords:`playwright chromium browser install tools modules setup checks`},{title:`Media, decks & voice dictation`,description:`Reference images, voice dictation, PowerPoint decks, video, and voiceovers`,section:`media`,sectionLabel:`Media`,keywords:`media images photos voice mic dictation pptx powerpoint video elevenlabs`},{title:`Keyboard shortcuts & quick start`,description:`Studio keyboard shortcuts, 4-step walkthrough, sample project, and CLI checks`,section:`guide`,sectionLabel:`Shortcuts & guide`,keywords:`shortcuts keyboard hotkeys guide onboarding sample trial cli ci`}];function E(e){let t=new URL(location.href).searchParams.get(`settings`);return[...e?[`connections`]:[],`general`,`appearance`,`account`,`workflows`,`setup-modules`,`media`,`guide`].includes(t)?t:e?`connections`:`general`}var D={switch:``};function O({theme:e,onTheme:t,contrast:r=`default`,onContrast:m,textScale:h=`default`,onTextScale:g,motion:_,onMotion:v,hoverEffects:y=!0,onHoverEffects:O,pageTransitions:ne=!0,onPageTransitions:re,backdrop:ie=`hallmark`,onBackdrop:ae,accent:k=`crimson`,onAccent:oe,customAccent:A=`#4f46e5`,onCustomAccent:se,customHighlight:j=`#ec4899`,onCustomHighlight:ce,typography:le=`manrope`,onTypography:ue,onResetAppearance:de,execution:fe=`auto`,onExecution:M,allowCreate:pe=!0,onAllowCreate:me,defaultCompareMode:he=`1up`,onDefaultCompareMode:ge,defaultPreviewSize:_e=`fit`,onDefaultPreviewSize:ve,hasSavedDraft:ye=!1,onClearSavedDraft:be,connected:xe=!0,connectionsSummary:N,auth:P,onOpenAccount:F,onSignOut:Se,onPilot:Ce,onClose:I,onConnections:we,onWorkflow:Te,onClientConnected:Ee,clientSetupTask:L,initialConnectionTab:R=`overview`,showConnections:z=!1,modal:B=!1,inspection:De,project:V=De?.project}){let H=(0,f.useRef)(null),Oe=(0,f.useRef)(null),U=(0,f.useRef)(null),[ke,Ae]=(0,f.useState)(L?`mcp-clients`:R),[W,G]=(0,f.useState)(``),[je,Me]=(0,f.useState)(!1);(0,f.useEffect)(()=>{Ae(L?`mcp-clients`:R)},[L,R]),(0,f.useEffect)(()=>{if(!B){document.getElementById(`settings-title`)?.focus();return}let e=H.current;if(e)return e.open||e.showModal(),()=>{e.open&&e.close()}},[B]),(0,f.useEffect)(()=>{if(B)return;let e=e=>{if(e.defaultPrevented||document.querySelector(`dialog[open]`))return;let t=!!e.target?.closest(`input, textarea, select, [contenteditable="true"]`);e.key===`/`&&!t&&!e.ctrlKey&&!e.metaKey&&!e.altKey?(e.preventDefault(),U.current?.focus()):e.key===`Escape`&&(W?(e.preventDefault(),G(``)):(e.preventDefault(),I()))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[B,I,W]);let[K,Ne]=(0,f.useState)(()=>E(z)),[Pe,Fe]=(0,f.useState)(null),[q,Ie]=(0,f.useState)(null),[Le,Re]=(0,f.useState)(``),[ze,Be]=(0,f.useState)(0),[Ve,He]=(0,f.useState)(K===`setup-modules`),J=V?`/api/settings?`+new URLSearchParams({project:V}):`/api/settings`;(0,f.useEffect)(()=>{let e=new AbortController;return o(J,void 0,e.signal).then(e=>{Fe(e),Re(``)}).catch(t=>{e.signal.aborted||Re(t.message)}),()=>e.abort()},[J,ze]),(0,f.useEffect)(()=>{let e=new AbortController;return o(`/api/setup/modules`,void 0,e.signal).then(e=>Ie(e)).catch(()=>{}),()=>e.abort()},[ze]);async function Ue(e){let t=await o(`/api/settings/skills`,{...e,...V?{project:V}:{}});Fe(e=>e&&{...e,...t})}function Y(e){Ne(e),G(``),e===`setup-modules`&&He(!0),Oe.current?.scrollTo(0,0);let t=new URL(location.href);t.searchParams.set(`settings`,e),history.replaceState(null,``,t)}function X(e){if(we){we(e);return}Ae(e),Y(`connections`);let t=new URL(location.href);t.searchParams.set(`tab`,e),history.replaceState(null,``,t),requestAnimationFrame(()=>document.getElementById(`conn-tab-`+e)?.focus())}function We(){Y(`setup-modules`),requestAnimationFrame(()=>document.getElementById(`setup-modules-title`)?.focus())}function Z(){B&&H.current?.open&&H.current.close(),I()}async function Ge(){try{await navigator.clipboard.writeText(`ui-workflow audit --render --compact`),Me(!0),window.setTimeout(()=>Me(!1),1800)}catch{}}let Ke=(0,f.useMemo)(()=>[...z?[{id:`connections`,label:`Connections`,icon:`mcp`,group:`Workspace`,keywords:[`connections`,`api`,`models`,`mcp`,`keys`]}]:[],{id:`general`,label:`General`,icon:`settings`,group:`Workspace`,keywords:[`general`,`defaults`,`preview`,`draft`,`environment`,`mode`]},{id:`appearance`,label:`Appearance`,icon:`palette`,group:`Workspace`,keywords:[`theme`,`dark`,`light`,`contrast`,`font`,`motion`,`accent`,`backdrop`]},{id:`account`,label:`Account`,icon:`shield`,group:`Workspace`,keywords:[`account`,`profile`,`google`,`github`,`gitlab`,`sign in`,`privacy`]},{id:`workflows`,label:`Workflows`,icon:`graph`,group:`Workflow & tools`,keywords:[`workflows`,`skills`,`guides`,`blueprints`,`focus`]},{id:`setup-modules`,label:`Local tools`,icon:`component`,group:`Workflow & tools`,keywords:[`tools`,`playwright`,`chromium`,`modules`,`install`,`setup`]},{id:`media`,label:`Media`,icon:`capture`,group:`Workflow & tools`,keywords:[`media`,`voice`,`dictation`,`decks`,`powerpoint`,`video`,`images`]},{id:`guide`,label:`Shortcuts & guide`,icon:`auto`,group:`Help`,keywords:[`shortcuts`,`keyboard`,`guide`,`getting started`,`help`,`sample`,`trial`]}],[z]),Q=W.trim().toLowerCase(),$=(0,f.useMemo)(()=>Q?T.filter(e=>`${e.title} ${e.description} ${e.sectionLabel} ${e.keywords}`.toLowerCase().includes(Q)):[],[Q]),qe=[`Workspace`,`Workflow & tools`,`Help`],Je=q?.modules.find(e=>e.id===`playwright`),Ye=q?.modules.filter(e=>[`ready`,`installed`,`configured`].includes(e.status)).length??0,Xe=q?.modules.length??0,Ze=e!==`system`||r!=="default"||h!=="default"||!_||!y||!ne||ie!==`hallmark`||k!==`crimson`||le!==`manrope`,Qe=(0,p.jsxs)(p.Fragment,{children:[B&&(0,p.jsxs)(`header`,{className:`settings-dialog-header`,children:[(0,p.jsx)(`div`,{children:(0,p.jsx)(`h1`,{id:`settings-title`,tabIndex:-1,children:`Settings`})}),(0,p.jsxs)(`button`,{type:`button`,className:`settings-close`,"aria-label":`Close settings and return to workspace`,onClick:Z,children:[(0,p.jsx)(`span`,{children:`Done`}),(0,p.jsx)(i,{name:`close`})]})]}),(0,p.jsx)(`section`,{id:`settings-view`,className:`settings-view`,children:(0,p.jsxs)(`div`,{className:`settings-layout`,children:[(0,p.jsxs)(`aside`,{className:`settings-sidebar`,"aria-label":`Settings navigation`,children:[!B&&(0,p.jsxs)(`div`,{className:`settings-sidebar-head`,children:[(0,p.jsxs)(`button`,{type:`button`,className:`settings-back-link`,"aria-label":`Close settings and return to workspace`,onClick:Z,children:[(0,p.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,children:(0,p.jsx)(`path`,{d:`M12.5 5 7.5 10l5 5`})}),(0,p.jsx)(`span`,{children:`Back to workspace`})]}),(0,p.jsx)(`h1`,{id:`settings-title`,className:`settings-sidebar-title`,tabIndex:-1,children:`Settings`})]}),(0,p.jsxs)(`div`,{className:`settings-rail-search`,children:[(0,p.jsx)(i,{name:`search`}),(0,p.jsx)(`input`,{ref:U,type:`search`,value:W,"aria-label":`Search settings`,placeholder:`Search settings…`,onChange:e=>G(e.target.value),onKeyDown:e=>{e.key===`Escape`&&W&&(e.preventDefault(),e.stopPropagation(),G(``))}}),W&&(0,p.jsx)(`button`,{type:`button`,className:`settings-rail-search-clear`,"aria-label":`Clear settings search`,onClick:()=>{G(``),U.current?.focus()},children:(0,p.jsx)(i,{name:`close`})})]}),(0,p.jsx)(`nav`,{className:`settings-nav`,"aria-label":`Settings sections`,children:qe.map(e=>{let t=Ke.filter(t=>t.group===e);return t.length?(0,p.jsxs)(`div`,{className:`settings-nav-group`,children:[(0,p.jsx)(`span`,{className:`settings-nav-group-label`,"aria-hidden":`true`,children:e}),t.map(e=>(0,p.jsxs)(`button`,{type:`button`,id:`settings-section-`+e.id,"aria-current":!Q&&K===e.id?`page`:void 0,onClick:()=>Y(e.id),children:[(0,p.jsx)(i,{name:e.icon}),(0,p.jsx)(`span`,{children:e.label})]},e.id))]},e):null})}),!B&&(0,p.jsx)(`div`,{className:`settings-sidebar-footer`,children:(0,p.jsxs)(`span`,{className:`settings-rail-hint`,children:[`Press `,(0,p.jsx)(`kbd`,{children:`Esc`}),` to return`]})})]}),(0,p.jsxs)(`div`,{className:`settings-content`,ref:Oe,children:[Le&&(0,p.jsxs)(`p`,{role:`alert`,className:`error-box`,children:[Le,` Refresh Studio to retry.`]}),Q?(0,p.jsxs)(`div`,{className:`settings-search-results`,role:`region`,"aria-label":`Search results`,children:[(0,p.jsxs)(`div`,{className:`settings-intro`,children:[(0,p.jsx)(`h2`,{children:`Search results`}),(0,p.jsx)(`p`,{children:$.length===0?`No settings match “${W.trim()}”.`:`${$.length} matching ${$.length===1?`setting`:`settings`} for “${W.trim()}”.`})]}),$.length>0?(0,p.jsx)(`div`,{className:`settings-card`,children:$.map(e=>(0,p.jsxs)(`button`,{type:`button`,className:`settings-row settings-search-row`,onClick:()=>Y(e.section),children:[(0,p.jsxs)(`span`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:e.title}),(0,p.jsx)(`small`,{children:e.description})]}),(0,p.jsx)(`span`,{className:`settings-search-section-tag`,children:e.sectionLabel})]},`${e.section}:${e.title}`))}):(0,p.jsx)(`button`,{type:`button`,className:`button subtle`,onClick:()=>G(``),children:`Clear search`})]}):(0,p.jsxs)(p.Fragment,{children:[z&&K===`connections`&&(0,p.jsx)(te,{initialTab:ke,auth:P,clientSetupTask:L,onClientConnected:Ee,onOpenAccount:F,onDone:I,onMedia:()=>{Y(`media`),document.getElementById(`settings-section-media`)?.focus()}}),K===`general`&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`div`,{className:`settings-intro`,children:[(0,p.jsx)(`h2`,{children:`General`}),(0,p.jsx)(`p`,{children:`Default workspace behavior, preview preferences, and local environment status.`})]}),(0,p.jsxs)(`div`,{className:`settings-status-card`,role:`region`,"aria-label":`Studio status`,children:[(0,p.jsxs)(`div`,{className:`settings-status-identity`,children:[(0,p.jsx)(`span`,{className:`settings-status-mark`,"aria-hidden":`true`,children:(0,p.jsx)(a,{})}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`strong`,{children:`UI Design Studio`}),(0,p.jsxs)(`small`,{children:[(0,p.jsx)(`span`,{className:`settings-inline-dot`,"data-state":xe?`ready`:`error`,"aria-hidden":`true`}),xe?`Running locally on your machine`:`Server offline`,N?.activeModel?` · ${N.activeProvider} (${N.activeModel})`:N&&N.modelKeys>0?` · ${N.modelKeys} API ${N.modelKeys===1?`key`:`keys`} saved`:` · No default AI model selected yet`]})]})]}),(0,p.jsx)(`button`,{type:`button`,className:`button subtle`,onClick:()=>X(`overview`),children:`Manage connections`})]}),(0,p.jsxs)(`section`,{className:`settings-group`,"aria-labelledby":`settings-defaults-heading`,children:[(0,p.jsx)(`h3`,{id:`settings-defaults-heading`,className:`settings-group-title`,children:`Revision defaults`}),(0,p.jsxs)(`div`,{className:`settings-card`,children:[M&&(0,p.jsxs)(`div`,{className:`settings-row`,children:[(0,p.jsxs)(`div`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Default workflow mode`}),(0,p.jsx)(`small`,{children:`Choose whether new revisions run with a connected API model or through your AI editor.`})]}),(0,p.jsxs)(`div`,{className:`settings-segmented`,role:`group`,"aria-label":`Default workflow mode`,children:[(0,p.jsx)(`button`,{type:`button`,"aria-pressed":fe===`auto`,onClick:()=>M(`auto`),children:`Auto`}),(0,p.jsx)(`button`,{type:`button`,"aria-pressed":fe===`mcp`,onClick:()=>M(`mcp`),children:`AI client`})]})]}),me&&(0,p.jsxs)(`label`,{className:`settings-row settings-row-interactive`,children:[(0,p.jsxs)(`span`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Allow creating new files`}),(0,p.jsx)(`small`,{children:`Permit revisions to create new UI components or stylesheets when needed.`})]}),(0,p.jsx)(`input`,{type:`checkbox`,role:`switch`,className:`settings-switch`,checked:pe,onChange:e=>me(e.target.checked),...D})]}),ge&&(0,p.jsxs)(`div`,{className:`settings-row`,children:[(0,p.jsxs)(`div`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Default preview layout`}),(0,p.jsx)(`small`,{children:`How before-and-after previews open when you review a revision.`})]}),(0,p.jsx)(`div`,{className:`settings-segmented`,role:`group`,"aria-label":`Default preview layout`,children:[[`1up`,`Single`],[`2up`,`Side by side`],[`slider`,`Diff slider`]].map(([e,t])=>(0,p.jsx)(`button`,{type:`button`,"aria-pressed":he===e,onClick:()=>ge(e),children:t},e))})]}),ve&&(0,p.jsxs)(`div`,{className:`settings-row`,children:[(0,p.jsxs)(`div`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Default preview width`}),(0,p.jsx)(`small`,{children:`Starting screen size when opening a staged local preview.`})]}),(0,p.jsx)(`div`,{className:`settings-segmented`,role:`group`,"aria-label":`Default preview width`,children:[[`fit`,`Desktop`],[`tablet`,`Tablet`],[`phone`,`Phone`]].map(([e,t])=>(0,p.jsx)(`button`,{type:`button`,"aria-pressed":_e===e,onClick:()=>ve(e),children:t},e))})]})]})]}),(0,p.jsxs)(`section`,{className:`settings-group`,"aria-labelledby":`settings-env-heading`,children:[(0,p.jsx)(`h3`,{id:`settings-env-heading`,className:`settings-group-title`,children:`Environment & data`}),(0,p.jsxs)(`div`,{className:`settings-card`,children:[(0,p.jsxs)(`div`,{className:`settings-row`,children:[(0,p.jsxs)(`div`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Browser checks & local tools`}),(0,p.jsx)(`small`,{children:q?`${Ye} of ${Xe} local tools ready · Playwright Chromium: ${Je&&[`ready`,`installed`,`configured`].includes(Je.status)?`Ready`:`Not installed yet`}.`:`Check installed browser rendering and visual QA tools.`})]}),(0,p.jsx)(`button`,{type:`button`,className:`button subtle`,onClick:We,children:`Manage local tools`})]}),be&&(0,p.jsxs)(`div`,{className:`settings-row`,children:[(0,p.jsxs)(`div`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Saved browser draft`}),(0,p.jsx)(`small`,{children:ye?`Your unsent brief, project path, and options are saved in this browser.`:`No unsent draft is currently stored in this browser.`})]}),(0,p.jsx)(`button`,{type:`button`,className:`button subtle`,disabled:!ye,onClick:be,children:`Clear draft`})]}),(0,p.jsxs)(`div`,{className:`settings-row`,children:[(0,p.jsxs)(`div`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Diagnostics & recovery records`}),(0,p.jsx)(`small`,{children:`Inspect older jobs, manual imports, and saved check logs when troubleshooting.`})]}),(0,p.jsxs)(`a`,{className:`button subtle settings-link-btn`,href:`?diagnostics=1`,children:[`Open Diagnostics `,(0,p.jsx)(i,{name:`external`})]})]})]})]})]}),K===`appearance`&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`div`,{className:`settings-intro settings-intro-row`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`h2`,{children:`Appearance`}),(0,p.jsx)(`p`,{children:`Customize theme, contrast, typography, canvas backdrop, and motion while keeping code diffs solid and easy to read.`})]}),de&&Ze&&(0,p.jsx)(`button`,{type:`button`,className:`button subtle`,onClick:de,children:`Reset defaults`})]}),(0,p.jsxs)(`section`,{className:`settings-group`,"aria-labelledby":`settings-display-heading`,children:[(0,p.jsx)(`h3`,{id:`settings-display-heading`,className:`settings-group-title`,children:`Display`}),(0,p.jsxs)(`div`,{className:`settings-card`,children:[(0,p.jsxs)(`div`,{className:`settings-row`,children:[(0,p.jsxs)(`div`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Theme`}),(0,p.jsx)(`small`,{children:`Match your device theme or lock Studio to Light or Dark.`})]}),(0,p.jsxs)(`div`,{className:`settings-segmented settings-theme-segmented`,role:`group`,"aria-label":`Theme`,children:[(0,p.jsxs)(`button`,{type:`button`,"aria-pressed":e===`system`,onClick:()=>t(`system`),children:[(0,p.jsxs)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,p.jsx)(`rect`,{x:`3`,y:`4`,width:`18`,height:`12`,rx:`2`}),(0,p.jsx)(`path`,{d:`M8 20h8M12 16v4`})]}),(0,p.jsx)(`span`,{children:`System`})]}),(0,p.jsxs)(`button`,{type:`button`,"aria-pressed":e===`light`,onClick:()=>t(`light`),children:[(0,p.jsxs)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,p.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`}),(0,p.jsx)(`path`,{d:`M12 2v2m0 16v2M2 12h2m16 0h2M5 5l1.4 1.4m11.2 11.2L19 19M5 19l1.4-1.4M17.6 6.4 19 5`})]}),(0,p.jsx)(`span`,{children:`Light`})]}),(0,p.jsxs)(`button`,{type:`button`,"aria-pressed":e===`dark`,onClick:()=>t(`dark`),children:[(0,p.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,p.jsx)(`path`,{d:`M20.8 14A9 9 0 0 1 10 3.2 9 9 0 1 0 20.8 14Z`})}),(0,p.jsx)(`span`,{children:`Dark`})]})]})]}),m&&(0,p.jsxs)(`div`,{className:`settings-row`,children:[(0,p.jsxs)(`div`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Contrast`}),(0,p.jsx)(`small`,{children:`Strengthen borders and secondary text for bright screens or higher legibility.`})]}),(0,p.jsxs)(`div`,{className:`settings-segmented`,role:`group`,"aria-label":`Interface contrast`,children:[(0,p.jsx)(`button`,{type:`button`,"aria-pressed":r==="default",onClick:()=>m(`default`),children:`Default`}),(0,p.jsx)(`button`,{type:`button`,"aria-pressed":r===`strong`,onClick:()=>m(`strong`),children:`Strong`})]})]}),g&&(0,p.jsxs)(`div`,{className:`settings-row`,children:[(0,p.jsxs)(`div`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Text size`}),(0,p.jsx)(`small`,{children:`Adjust the reading scale across menus, forms, and notes.`})]}),(0,p.jsx)(`div`,{className:`settings-segmented`,role:`group`,"aria-label":`Interface text size`,children:[[`compact`,`Compact`],[`default`,`Default`],[`large`,`Large`]].map(([e,t])=>(0,p.jsx)(`button`,{type:`button`,"aria-pressed":h===e,onClick:()=>g(e),children:t},e))})]})]})]}),(0,p.jsxs)(`section`,{className:`settings-group`,"aria-labelledby":`settings-motion-heading`,children:[(0,p.jsx)(`h3`,{id:`settings-motion-heading`,className:`settings-group-title`,children:`Motion & hover`}),(0,p.jsxs)(`div`,{className:`settings-card`,children:[(0,p.jsxs)(`label`,{className:`settings-row settings-row-interactive`,children:[(0,p.jsxs)(`span`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Background motion`}),(0,p.jsx)(`small`,{children:`Ambient backdrop drift and headline animation. Automatically pauses when hidden or when your device reduces motion.`})]}),(0,p.jsx)(`input`,{type:`checkbox`,role:`switch`,className:`settings-switch`,checked:_,onChange:e=>v(e.target.checked),...D})]}),O&&(0,p.jsxs)(`label`,{className:`settings-row settings-row-interactive`,children:[(0,p.jsxs)(`span`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Hover & cursor effects`}),(0,p.jsx)(`small`,{children:`Pointer-reactive dot ripples, backdrop cursor highlight, and subtle card hover lift.`})]}),(0,p.jsx)(`input`,{type:`checkbox`,role:`switch`,className:`settings-switch`,checked:y,onChange:e=>O(e.target.checked),...D})]}),re&&(0,p.jsxs)(`label`,{className:`settings-row settings-row-interactive`,children:[(0,p.jsxs)(`span`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Page reveal animation`}),(0,p.jsx)(`small`,{children:`Smooth section reveal when switching between Workspace, Workflows, and Repositories.`})]}),(0,p.jsx)(`input`,{type:`checkbox`,role:`switch`,className:`settings-switch`,checked:_&&ne,disabled:!_,onChange:e=>re(e.target.checked),...D})]})]})]}),oe&&(0,p.jsxs)(`section`,{className:`settings-group`,"aria-labelledby":`settings-accent-heading`,children:[(0,p.jsx)(`h3`,{id:`settings-accent-heading`,className:`settings-group-title`,children:`Accent color`}),(0,p.jsxs)(`div`,{className:`settings-card settings-card-padded`,children:[(0,p.jsx)(`div`,{className:`studio-choice-grid studio-accent-grid`,role:`radiogroup`,"aria-label":`Accent and highlight`,children:S.map(e=>(0,p.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":k===e.id,className:`studio-choice-card studio-accent-card`,onClick:()=>oe(e.id),children:[(0,p.jsx)(`span`,{className:`studio-accent-dot`,style:e.id===`custom`?{background:`linear-gradient(135deg, ${A} 0%, ${j} 100%)`}:e.id===`crimson`?{background:`linear-gradient(135deg, #c80909 0%, #c20030 100%)`}:{backgroundColor:e.swatch},"aria-hidden":`true`}),(0,p.jsx)(`strong`,{children:e.label})]},e.id))}),k===`custom`&&se&&ce&&(0,p.jsxs)(`div`,{className:`studio-custom-colors`,role:`group`,"aria-label":`Custom accent and highlight colors`,children:[(0,p.jsxs)(`label`,{className:`studio-color-field`,htmlFor:`studio-custom-accent`,children:[(0,p.jsxs)(`span`,{className:`studio-color-meta`,children:[(0,p.jsx)(`strong`,{children:`Accent color`}),(0,p.jsx)(`small`,{children:`Buttons, active controls & focus rings`})]}),(0,p.jsxs)(`span`,{className:`studio-color-input-wrap`,children:[(0,p.jsx)(`input`,{id:`studio-custom-accent`,type:`color`,value:A,onChange:e=>se(e.target.value)}),(0,p.jsx)(`code`,{children:A})]})]}),(0,p.jsxs)(`label`,{className:`studio-color-field`,htmlFor:`studio-custom-highlight`,children:[(0,p.jsxs)(`span`,{className:`studio-color-meta`,children:[(0,p.jsx)(`strong`,{children:`Highlight color`}),(0,p.jsx)(`small`,{children:`Headline highlight & canvas accent`})]}),(0,p.jsxs)(`span`,{className:`studio-color-input-wrap`,children:[(0,p.jsx)(`input`,{id:`studio-custom-highlight`,type:`color`,value:j,onChange:e=>ce(e.target.value)}),(0,p.jsx)(`code`,{children:j})]})]})]})]})]}),ue&&(0,p.jsxs)(`section`,{className:`settings-group`,"aria-labelledby":`settings-type-heading`,children:[(0,p.jsx)(`h3`,{id:`settings-type-heading`,className:`settings-group-title`,children:`Typography`}),(0,p.jsx)(`div`,{className:`settings-card settings-card-padded`,children:(0,p.jsx)(`div`,{className:`studio-choice-grid studio-type-grid`,role:`radiogroup`,"aria-label":`Typography and craft`,children:C.map(e=>(0,p.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":le===e.id,className:`studio-choice-card studio-type-card`,"data-type-choice":e.id,onClick:()=>ue(e.id),children:[(0,p.jsx)(`span`,{className:`studio-type-sample`,"aria-hidden":`true`,children:e.sample}),(0,p.jsxs)(`span`,{className:`studio-choice-copy`,children:[(0,p.jsx)(`strong`,{children:e.label}),(0,p.jsx)(`small`,{children:e.hint})]})]},e.id))})})]}),ae&&(0,p.jsxs)(`section`,{className:`settings-group`,"aria-labelledby":`settings-backdrop-heading`,children:[(0,p.jsx)(`h3`,{id:`settings-backdrop-heading`,className:`settings-group-title`,children:`Canvas atmosphere`}),(0,p.jsx)(`div`,{className:`settings-card settings-card-padded`,children:(0,p.jsx)(`div`,{className:`studio-choice-grid studio-backdrop-grid`,role:`radiogroup`,"aria-label":`Canvas atmosphere`,children:x.map(e=>(0,p.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":ie===e.id,className:`studio-choice-card`,"data-choice":e.id,onClick:()=>ae(e.id),children:[(0,p.jsx)(`span`,{className:`studio-backdrop-swatch is-${e.id}`,"aria-hidden":`true`}),(0,p.jsxs)(`span`,{className:`studio-choice-copy`,children:[(0,p.jsx)(`strong`,{children:e.label}),(0,p.jsx)(`small`,{children:e.hint})]})]},e.id))})})]})]}),K===`account`&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`div`,{className:`settings-intro`,children:[(0,p.jsx)(`h2`,{children:`Account`}),(0,p.jsx)(`p`,{children:`Sign in with Google, GitHub, or GitLab to browse and clone repositories in one click.`})]}),P?.authenticated&&P.account?(0,p.jsxs)(`section`,{className:`settings-group`,"aria-labelledby":`settings-profile-heading`,children:[(0,p.jsx)(`h3`,{id:`settings-profile-heading`,className:`settings-group-title`,children:`Details`}),(0,p.jsxs)(`div`,{className:`settings-card`,children:[(0,p.jsxs)(`div`,{className:`settings-row settings-account-hero-row`,children:[(0,p.jsxs)(`div`,{className:`wb-account-identity`,children:[(0,p.jsx)(`span`,{className:`wb-account-avatar`,"aria-hidden":`true`,children:s(P.account)}),(0,p.jsxs)(`div`,{className:`wb-account-copy`,children:[(0,p.jsx)(`strong`,{children:P.account.name||P.account.username}),(0,p.jsxs)(`small`,{children:[`@`,P.account.username,P.account.email?` · ${P.account.email}`:``]})]})]}),(0,p.jsxs)(`span`,{className:`settings-provider-pill`,children:[(0,p.jsx)(u,{provider:P.account.provider}),c(P.account.provider)]})]}),(0,p.jsxs)(`div`,{className:`settings-row`,children:[(0,p.jsxs)(`div`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Name`}),(0,p.jsx)(`small`,{children:`Display name from your connected account`})]}),(0,p.jsx)(`span`,{className:`settings-row-value`,children:P.account.name||P.account.username})]}),(0,p.jsxs)(`div`,{className:`settings-row`,children:[(0,p.jsxs)(`div`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Username`}),(0,p.jsx)(`small`,{children:`Account handle used for repository sync`})]}),(0,p.jsxs)(`span`,{className:`settings-row-value`,children:[`@`,P.account.username]})]}),P.account.email&&(0,p.jsxs)(`div`,{className:`settings-row`,children:[(0,p.jsxs)(`div`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Email`}),(0,p.jsx)(`small`,{children:`Email linked to this session`})]}),(0,p.jsx)(`span`,{className:`settings-row-value`,children:P.account.email})]}),(0,p.jsxs)(`div`,{className:`settings-row`,children:[(0,p.jsxs)(`div`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Plan`}),(0,p.jsx)(`small`,{children:`Current workspace access tier`})]}),(0,p.jsx)(`span`,{className:`settings-row-value`,children:l(P.account.subscription)})]}),(0,p.jsxs)(`div`,{className:`settings-row`,children:[(0,p.jsxs)(`div`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Sign-in method`}),(0,p.jsx)(`small`,{children:`How this local session was verified`})]}),(0,p.jsx)(`span`,{className:`settings-row-value`,children:d(P.account.method)})]}),(0,p.jsxs)(`div`,{className:`settings-row`,children:[(0,p.jsxs)(`div`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Session storage`}),(0,p.jsx)(`small`,{children:`Where your sign-in token is kept on this computer`})]}),(0,p.jsx)(`span`,{className:`settings-row-value`,children:P.account.remembered?`System credential vault`:`Memory only (this session)`})]}),(0,p.jsxs)(`div`,{className:`settings-row settings-account-actions-row`,children:[F&&(0,p.jsx)(`button`,{type:`button`,className:`button subtle`,onClick:()=>F(),children:`Manage account & sync`}),Se&&(0,p.jsx)(`button`,{type:`button`,className:`button subtle`,onClick:()=>void Se(),children:`Sign out`})]})]})]}):(0,p.jsxs)(`div`,{className:`settings-card settings-account-signedout`,children:[(0,p.jsxs)(`div`,{className:`settings-account-signedout-copy`,children:[(0,p.jsxs)(`div`,{className:`settings-provider-glyphs`,"aria-hidden":`true`,children:[(0,p.jsx)(u,{provider:`google`}),(0,p.jsx)(u,{provider:`github`}),(0,p.jsx)(u,{provider:`gitlab`})]}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`strong`,{children:`Not signed in`}),(0,p.jsx)(`p`,{children:`Studio works completely offline for local folders. Sign in only if you want to browse your GitHub or GitLab repositories or sync presets.`})]})]}),F&&(0,p.jsx)(`button`,{type:`button`,className:`button primary`,onClick:()=>{F()},children:`Sign in with Google, GitHub, or GitLab`})]}),(0,p.jsxs)(`section`,{className:`settings-group`,"aria-labelledby":`settings-privacy-heading`,children:[(0,p.jsx)(`h3`,{id:`settings-privacy-heading`,className:`settings-group-title`,children:`Privacy & credentials`}),(0,p.jsxs)(`div`,{className:`settings-card`,children:[(0,p.jsxs)(`div`,{className:`settings-row`,children:[(0,p.jsxs)(`div`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Separate from AI model keys`}),(0,p.jsx)(`small`,{children:`Signing in here never shares or bills AI model APIs. Manage model keys and spending caps separately in Connections.`})]}),(0,p.jsx)(`button`,{type:`button`,className:`button subtle`,onClick:()=>X(`ai-models`),children:`AI Models`})]}),(0,p.jsxs)(`div`,{className:`settings-row`,children:[(0,p.jsxs)(`div`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Separate from AI editor access`}),(0,p.jsx)(`small`,{children:`Connected editors (Cursor, Antigravity, Claude, Codex) use their own revocable project permissions.`})]}),(0,p.jsx)(`button`,{type:`button`,className:`button subtle`,onClick:()=>X(`mcp-clients`),children:`AI Clients`})]}),(0,p.jsx)(`div`,{className:`settings-row`,children:(0,p.jsxs)(`div`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Local-first files`}),(0,p.jsx)(`small`,{children:`Your code stays on this machine. Files are never edited without your approval, and Undo keeps exact originals.`})]})})]})]})]}),K===`media`&&(0,p.jsx)(ee,{}),K===`workflows`&&(0,p.jsx)(b,{data:Pe,inspection:De,onSelect:Te,onSkillChange:Ue}),Ve&&(0,p.jsx)(`div`,{hidden:K!==`setup-modules`,children:(0,p.jsx)(n,{initialInspection:q,onInstalled:()=>Be(e=>e+1)})}),K===`guide`&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`div`,{className:`settings-intro`,children:[(0,p.jsx)(`h2`,{children:`Shortcuts & guide`}),(0,p.jsx)(`p`,{children:`Keyboard shortcuts, a quick walkthrough of how revisions work, and command line checks for your projects.`})]}),(0,p.jsxs)(`section`,{className:`settings-group`,"aria-labelledby":`settings-shortcuts-heading`,children:[(0,p.jsx)(`h3`,{id:`settings-shortcuts-heading`,className:`settings-group-title`,children:`Keyboard shortcuts`}),(0,p.jsx)(`div`,{className:`settings-card`,children:w.map(e=>(0,p.jsxs)(`div`,{className:`settings-shortcut-block`,children:[(0,p.jsx)(`div`,{className:`settings-shortcut-group-name`,children:e.group}),e.items.map(e=>(0,p.jsxs)(`div`,{className:`settings-row settings-shortcut-row`,children:[(0,p.jsx)(`span`,{children:e.action}),(0,p.jsx)(`span`,{className:`settings-kbd-group`,children:e.keys.map(e=>(0,p.jsx)(`kbd`,{children:e},e))})]},e.action))]},e.group))})]}),(0,p.jsxs)(`section`,{className:`settings-group`,"aria-labelledby":`settings-guide-heading`,children:[(0,p.jsx)(`h3`,{id:`settings-guide-heading`,className:`settings-group-title`,children:`Start a revision in Studio`}),(0,p.jsx)(`div`,{className:`settings-card settings-card-padded`,children:(0,p.jsxs)(`ol`,{className:`guide-steps`,children:[(0,p.jsxs)(`li`,{children:[(0,p.jsx)(`h4`,{children:`Choose or create a project`}),(0,p.jsxs)(`p`,{children:[`Open any Static HTML, React + Vite, or Next.js project — or use`,` `,(0,p.jsx)(`strong`,{children:`Create new project`}),` to start from a clean template. Save reusable project rules in `,(0,p.jsx)(`code`,{children:`.ui-workflow.json`}),`.`]}),Ce&&(0,p.jsx)(`button`,{className:`button subtle`,type:`button`,onClick:Ce,children:`Try the sample Focus Board project`})]}),(0,p.jsxs)(`li`,{children:[(0,p.jsx)(`h4`,{children:`Choose how your AI works`}),(0,p.jsxs)(`div`,{className:`guide-execution-options`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsxs)(`h5`,{children:[(0,p.jsx)(i,{name:`auto`}),` Auto`]}),(0,p.jsx)(`p`,{children:`Add a Gemini, OpenRouter, or Groq key in Connections, pick a model, and review cost limits before starting.`}),(0,p.jsxs)(`button`,{className:`button subtle`,type:`button`,onClick:()=>X(`ai-models`),children:[`Set up Auto `,(0,p.jsx)(i,{name:`arrow`})]})]}),(0,p.jsxs)(`div`,{children:[(0,p.jsxs)(`h5`,{children:[(0,p.jsx)(i,{name:`mcp`}),` AI client`]}),(0,p.jsxs)(`p`,{children:[`Connect Cursor, Antigravity, Claude Desktop, Claude Code, or Codex in one click from Connections or via`,` `,(0,p.jsx)(`code`,{children:`ui-workflow connect <client>`}),`.`]}),(0,p.jsxs)(`button`,{className:`button subtle`,type:`button`,onClick:()=>X(`mcp-clients`),children:[`Choose an AI client `,(0,p.jsx)(i,{name:`arrow`})]})]})]})]}),(0,p.jsxs)(`li`,{children:[(0,p.jsx)(`h4`,{children:`Write a prompt and keep behaviors safe`}),(0,p.jsx)(`p`,{children:`Describe what to improve and list anything that must keep working (menus, forms, keyboard shortcuts). Pick colors, attach references, or adjust file scope below the prompt box.`})]}),(0,p.jsxs)(`li`,{children:[(0,p.jsx)(`h4`,{children:`Preview, check, then apply with Undo`}),(0,p.jsx)(`p`,{children:`Inspect changed lines, security and accessibility findings, and desktop/tablet/phone previews. Apply safely with 1-click Undo or export to a separate Git branch.`})]})]})})]}),(0,p.jsxs)(`section`,{className:`settings-group`,"aria-labelledby":`settings-cli-heading`,children:[(0,p.jsx)(`h3`,{id:`settings-cli-heading`,className:`settings-group-title`,children:`Terminal & pull request checks`}),(0,p.jsx)(`div`,{className:`settings-card`,children:(0,p.jsxs)(`div`,{className:`settings-row`,children:[(0,p.jsxs)(`div`,{className:`settings-row-copy`,children:[(0,p.jsx)(`strong`,{children:`Run checks from your terminal`}),(0,p.jsxs)(`small`,{children:[`Run `,(0,p.jsx)(`code`,{children:`ui-workflow audit --render --compact`}),` in any project folder, or add`,` `,(0,p.jsx)(`code`,{children:`examples/github-actions/ui-workflow-pr-qa.yml`}),` to GitHub Actions.`]})]}),(0,p.jsxs)(`div`,{className:`settings-row-actions`,children:[(0,p.jsx)(`button`,{type:`button`,className:`button subtle`,onClick:()=>void Ge(),children:je?`Copied`:`Copy command`}),(0,p.jsx)(`button`,{type:`button`,className:`button subtle`,onClick:We,children:`Local tools`})]})]})})]})]})]})]})]})})]});return B?(0,p.jsx)(`dialog`,{ref:H,className:`settings-dialog`,"aria-labelledby":`settings-title`,onCancel:e=>{e.preventDefault(),Z()},onClick:e=>{if(e.target!==e.currentTarget)return;let t=e.currentTarget.getBoundingClientRect();(e.clientX<t.left||e.clientX>t.right||e.clientY<t.top||e.clientY>t.bottom)&&Z()},children:Qe}):(0,p.jsx)(`section`,{className:`settings-dialog settings-page`,"aria-labelledby":`settings-title`,onKeyDown:e=>{if(e.key===`Escape`&&!e.defaultPrevented){if(W){e.preventDefault(),G(``);return}Z()}},children:Qe})}export{O as default};
@@ -0,0 +1,4 @@
1
+ import{i as e,t}from"./react-vendor-CH5vucNG.js";import{f as n,o as r,p as i}from"./index-Dp8CdAV4.js";/* empty css */var a=e(),o={"node-intake":{x:32,y:204},"node-context":{x:316,y:78},"node-scope":{x:316,y:330},"node-engine":{x:600,y:204},"node-visual-qa":{x:884,y:78},"node-security-gate":{x:884,y:330},"node-delivery":{x:1168,y:204}},s=1440;function c(e,t){let n=String(e??``).trim().toLowerCase();return!n||n===`auto`?t&&t.trim()?t.trim():`Auto-detect`:n===`static-html`?`Static HTML`:n===`react-vite`?`React / Vite`:n===`nextjs-app`?`Next.js App`:n===`nextjs-pages`?`Next.js Pages`:e}var l=[{kind:`figma`,group:`connectors`,title:`Figma Design`,desc:`Pull a Figma frame URL & design tokens into your UI redesign.`,stage:`before-ai`,connectorId:`figma`,moduleId:`figmasync`,defaultConfig:{figmaUrl:``,figmaMode:`Colors & Layout`}},{kind:`git`,group:`connectors`,title:`GitHub / GitLab`,desc:`Set PR branch naming and connect repo delivery.`,stage:`delivery`,connectorId:`github`,defaultConfig:{branchPrefix:`studio/`}},{kind:`references`,group:`connectors`,title:`Style & References`,desc:`Pin visual reference boards and color palettes for UI work.`,stage:`before-ai`,connectorId:`reference-library`,defaultConfig:{notes:`Match layout rhythm and typography contrast.`}},{kind:`playwright`,group:`modules`,title:`Playwright Browser`,desc:`Capture desktop, mobile & dark screenshots and test clicks.`,stage:`after-ai`,moduleId:`playwright`,defaultConfig:{viewports:[`desktop`,`mobile`,`dark`]}},{kind:`a11y`,group:`modules`,title:`Accessibility Check`,desc:`Check WCAG contrast, keyboard focus rings, and native buttons.`,stage:`after-ai`,defaultConfig:{notes:`Enforce AA contrast >= 4.5:1 and keyboard navigation.`}},{kind:`seo`,group:`modules`,title:`SEO & AI Search`,desc:`Audit page titles, meta descriptions, headings & structured data.`,stage:`after-ai`,defaultConfig:{}},{kind:`graphify`,group:`modules`,title:`Project Map (Graphify)`,desc:`Map component imports and file impact before editing.`,stage:`after-ai`,moduleId:`graphify`,defaultConfig:{}}],u=[{id:`default`,name:`Default UI Pipeline`,profile:`ui`,hiddenCoreNodes:[],customNodes:[]},{id:`tpl-figma-redesign`,name:`Figma → UI Redesign`,profile:`ui`,hiddenCoreNodes:[],customNodes:[{id:`mod-figma-1`,kind:`figma`,stage:`before-ai`,title:`Figma Design`,subtitle:`Frame & tokens`,enabled:!0,connectorId:`figma`,moduleId:`figmasync`,config:{figmaUrl:``,figmaMode:`Colors & Layout`}},{id:`mod-playwright-1`,kind:`playwright`,stage:`after-ai`,title:`Playwright Browser`,subtitle:`Desktop, mobile & dark`,enabled:!0,moduleId:`playwright`,config:{viewports:[`desktop`,`mobile`,`dark`]}}]},{id:`tpl-playwright-audit`,name:`Playwright & Audit QA`,profile:`audit`,hiddenCoreNodes:[`node-context`],customNodes:[{id:`mod-playwright-qa`,kind:`playwright`,stage:`after-ai`,title:`Playwright Browser`,subtitle:`Desktop & mobile checks`,enabled:!0,moduleId:`playwright`,config:{viewports:[`desktop`,`mobile`]}},{id:`mod-a11y-qa`,kind:`a11y`,stage:`after-ai`,title:`Accessibility Check`,subtitle:`Contrast & keyboard`,enabled:!0,config:{}}]},{id:`tpl-seo-map`,name:`SEO & Project Map`,profile:`seo`,hiddenCoreNodes:[`node-context`,`node-visual-qa`],customNodes:[{id:`mod-seo-1`,kind:`seo`,stage:`after-ai`,title:`SEO & AI Search`,subtitle:`Metadata & headings`,enabled:!0,config:{}},{id:`mod-graphify-1`,kind:`graphify`,stage:`after-ai`,title:`Project Map (Graphify)`,subtitle:`Imports & impact`,enabled:!0,moduleId:`graphify`,config:{}}]}],d=new Set([`node-context`,`node-scope`,`node-visual-qa`,`node-security-gate`]),f={"node-intake":`Picks the project folder, framework, and pages Studio checks.`,"node-context":`Sets the visual design style when redesigning UI. Automatically skipped for Audit, SEO, and Project Map.`,"node-scope":`Controls which folders Studio reads and which features must stay working.`,"node-engine":`Sets size and cost limits when an AI model generates edits.`,"node-visual-qa":`Checks layout shifts, Before/After screenshots, and reusable components.`,"node-security-gate":`Scans code locally for security issues, accessibility bugs, and weak tests. No API key needed.`,"node-delivery":`Stages every change for review first, with 1-click Undo if you apply.`},p=[`Main navigation`,`Keyboard focus`,`Saved login state`,`Dark mode toggle`],m=[{id:`node-intake`,type:`trigger`,category:`Step 1`,title:`Project`,subtitle:`Auto-detect · UI Redesign`,position:o[`node-intake`],enabled:!0,locked:!0,status:`ready`,metrics:[],config:{}},{id:`node-context`,type:`context`,category:`Step 2`,title:`Design Style`,subtitle:`Modern default · 3 guides`,position:o[`node-context`],enabled:!0,locked:!1,status:`ready`,metrics:[],config:{}},{id:`node-scope`,type:`guardrail`,category:`Step 3`,title:`Files & Rules`,subtitle:`3 folders · 3 items kept`,position:o[`node-scope`],enabled:!0,locked:!1,status:`ready`,metrics:[],config:{}},{id:`node-engine`,type:`agent`,category:`Step 4`,title:`AI Helper`,subtitle:`Balanced · $0.25 cap`,position:o[`node-engine`],enabled:!0,locked:!0,status:`ready`,metrics:[],config:{}},{id:`node-visual-qa`,type:`verification`,category:`Step 5`,title:`Visual Check`,subtitle:`Normal diff · Standard`,position:o[`node-visual-qa`],enabled:!0,locked:!1,status:`ready`,metrics:[],config:{}},{id:`node-security-gate`,type:`security`,category:`Step 6`,title:`Security & Code Audit`,subtitle:`Local checks · Pass at 72`,position:o[`node-security-gate`],enabled:!0,locked:!1,status:`ready`,metrics:[],config:{}},{id:`node-delivery`,type:`output`,category:`Step 7`,title:`Review & Apply`,subtitle:`Preview first · 1-click Undo`,position:o[`node-delivery`],enabled:!0,locked:!0,status:`ready`,metrics:[],config:{}}];function h(e,t){if(t)switch(t){case`figma`:return`#1e1e24`;case`playwright`:return`#16a34a`;case`seo`:return`#0891b2`;case`graphify`:return`#6366f1`;case`a11y`:return`#0d9488`;case`git`:return`#475569`;case`references`:return`#ec4899`;default:return`#d97706`}switch(e){case`trigger`:return`#2563eb`;case`context`:return`#7c3aed`;case`guardrail`:return`#0284c7`;case`agent`:return`#d97706`;case`verification`:return`#059669`;case`security`:return`#db2777`;case`output`:return`#4f46e5`;default:return`#2563eb`}}function g(e,t){if(t)switch(t){case`figma`:return`figma`;case`playwright`:return`playwright`;case`seo`:return`search`;case`graphify`:return`graph`;case`a11y`:return`shield`;case`git`:return`github`;case`references`:return`image`;default:return`auto`}switch(e){case`trigger`:return`folder`;case`context`:return`palette`;case`guardrail`:return`assets`;case`agent`:return`auto`;case`verification`:return`capture`;case`security`:return`shield`;case`output`:return`check`;default:return`graph`}}function _(e){switch(e){case`audit`:return`Quick Audit`;case`seo`:case`ai-search`:return`SEO & AI`;case`architecture`:return`Project Map`;default:return`UI Redesign`}}function ee(e){return/security/i.test(e)?`Security`:/test/i.test(e)?`Test Quality`:/ui|craft|a11y/i.test(e)?`UI & Accessibility`:/verification|depth/i.test(e)?`Verification`:e}function v(e){return/gitleaks/i.test(e)?`Gitleaks (extra secret scan)`:/osv/i.test(e)?`OSV Vulnerability Check`:/semgrep/i.test(e)?`Semgrep Security Scan`:/context7/i.test(e)?`Context7 Library Docs`:/tautolog|test/i.test(e)?`Test Quality Check`:/sca|depend/i.test(e)?`Dependency Check`:/sast|secret/i.test(e)?`UI & Security Scan`:e}function y(e,t,n){return Math.max(t,Math.min(n,e))}function b(e,t){let n=new Set(e),r={...o},i=[...n.has(`node-context`)?[]:[`node-context`],...n.has(`node-scope`)?[]:[`node-scope`],...t.filter(e=>e.stage===`before-ai`).map(e=>e.id)],a=[...n.has(`node-visual-qa`)?[]:[`node-visual-qa`],...n.has(`node-security-gate`)?[]:[`node-security-gate`],...t.filter(e=>e.stage===`after-ai`).map(e=>e.id)],s=[`node-delivery`,...t.filter(e=>e.stage===`delivery`).map(e=>e.id)],c=(e,t)=>{let n=(e.length-1)*142+114,i=Math.max(30,Math.round((580-n)/2));e.forEach((e,n)=>{r[e]={x:t,y:y(i+n*142,24,442)}})};return r[`node-intake`]={x:32,y:233},c(i,316),r[`node-engine`]={x:600,y:233},c(a,884),c(s,1168),r}var te=[{id:`pr-visual-proof`,name:`Check a Pull Request`,shortDesc:`Scan changed UI files, check layout and contrast, and post one clean PR summary.`,trigger:`On pull requests`,outcome:`One PR summary + pass/fail check`,profile:`audit`,minScoreThreshold:75,connectors:[`github`,`playwright`,`gitleaks`,`osv`],cliCommand:`ui-workflow run pr-visual-proof`,steps:[`node-intake`,`node-scope`,`node-visual-qa`,`node-security-gate`,`node-delivery`]},{id:`branch-visual-diff`,name:`Compare Branch Changes`,shortDesc:`See before-and-after screenshots against main without touching your Git files.`,trigger:`Before opening a PR`,outcome:`Interactive diff slider + layout summary`,profile:`audit`,minScoreThreshold:72,connectors:[`github`,`playwright`],cliCommand:`ui-workflow run branch-visual-diff`,steps:[`node-intake`,`node-visual-qa`,`node-security-gate`,`node-delivery`]},{id:`pre-push-guardrail`,name:`Quick Check Before Push`,shortDesc:`Catch leaked keys, broken links, and accessibility bugs in under 2 seconds.`,trigger:`Before git push`,outcome:`Fast local pass/fail check`,profile:`audit`,minScoreThreshold:80,connectors:[`gitleaks`,`osv`,`github`],cliCommand:`ui-workflow run pre-push-guardrail`,steps:[`node-intake`,`node-scope`,`node-visual-qa`,`node-security-gate`,`node-delivery`]},{id:`multi-route-dev-audit`,name:`Check Running App`,shortDesc:`Finds your local dev server and checks desktop, mobile, and dark mode pages.`,trigger:`While your app runs locally`,outcome:`Screenshots & checks across pages`,profile:`audit`,minScoreThreshold:72,connectors:[`playwright`,`vercel`,`netlify`,`cloudflare`],cliCommand:`ui-workflow run multi-route-dev-audit`,steps:[`node-intake`,`node-scope`,`node-visual-qa`,`node-security-gate`,`node-delivery`]},{id:`figma-to-code-check`,name:`Match Figma Design`,shortDesc:`Compare your code against a Figma link or local design tokens.`,trigger:`After building a screen`,outcome:`Token match + contrast report`,profile:`ui`,minScoreThreshold:75,connectors:[`figma`,`storybook`,`reference-library`],cliCommand:`ui-workflow run figma-to-code-check`,steps:[`node-intake`,`node-context`,`node-scope`,`node-visual-qa`,`node-security-gate`,`node-delivery`]},{id:`ai-fix-loop`,name:`Prepare AI Fix List`,shortDesc:`Find UI bugs and copy a ready-to-paste fix prompt for Cursor, Claude, or Codex.`,trigger:`When fixing issues with AI`,outcome:`Ready-to-paste fix prompt`,profile:`audit`,minScoreThreshold:75,connectors:[`ide-mcp`,`github`,`linear`,`slack`],cliCommand:`ui-workflow run ai-fix-loop`,steps:[`node-intake`,`node-scope`,`node-engine`,`node-visual-qa`,`node-security-gate`,`node-delivery`]}],ne={"pr-visual-proof":{icon:`github`,tag:`Pull Request`},"branch-visual-diff":{icon:`capture`,tag:`Branch Diff`},"pre-push-guardrail":{icon:`gitleaks`,tag:`Fast · 2s`},"multi-route-dev-audit":{icon:`playwright`,tag:`Live App`},"figma-to-code-check":{icon:`figma`,tag:`Design`},"ai-fix-loop":{icon:`mcp`,tag:`AI Editor`}},x=t();function re({viewportRef:e,isPanning:t,pan:i,zoom:o,setZoom:c,addPanelOpen:u,setAddPanelOpen:d,addStageHint:f,setAddStageHint:p,onOpenAddForStage:m,hiddenCoreNodes:_,newStepTitle:ee,setNewStepTitle:v,newStepStage:b,setNewStepStage:te,newStepNotes:ne,setNewStepNotes:re,integrationStatusFor:ie,addModuleNode:S,restoreCoreNode:ae,addCustomStepNode:C,edges:w,liveNodes:T,selectedNode:oe,selectedNodeId:E,setSelectedNodeId:D,setInspectorOpen:O,draggingNodeId:se,activeExecNode:k,executing:ce,executionResult:A,profile:le,onViewportPointerDown:ue,onViewportPointerMove:de,onViewportPointerUp:fe,onViewportWheel:pe,onNodePointerDown:me,onNodePointerMove:he,onNodePointerUp:ge,executeWorkflowPipeline:_e,updateCustomNode:j,toggleCoreNodeEnabled:ve,removeNode:M,fitCanvasToView:N,tidyLayout:P,centerOnNode:F}){let[I,L]=(0,a.useState)(``),[R,z]=(0,a.useState)(`all`),B=(0,a.useRef)(null);(0,a.useEffect)(()=>{u&&(L(``),z(`all`),requestAnimationFrame(()=>B.current?.focus()))},[u]);let V=I.trim().toLowerCase(),H=(0,a.useMemo)(()=>l.filter(e=>R===`connectors`&&e.group!==`connectors`||R===`modules`&&e.group!==`modules`||R===`custom`?!1:!V||`${e.title} ${e.desc} ${e.kind}`.toLowerCase().includes(V)),[V,R]),ye=H.filter(e=>e.group===`connectors`),be=H.filter(e=>e.group===`modules`);function xe(e,t){return t.id===`node-delivery`||t.custom?.stage===`delivery`?`delivery`:e.id===`node-ai`||e.id===`node-visual-qa`||e.id===`node-security-gate`||e.custom?.stage===`after-ai`?`after-ai`:`before-ai`}function Se(e){return e.id===`node-visual-qa`||e.id===`node-security-gate`?`delivery`:e.id===`node-ai`||e.custom?.stage===`after-ai`?`after-ai`:`before-ai`}let Ce=e=>e===`before-ai`?`Before AI Helper`:e===`after-ai`?`After AI (QA & Audit)`:e===`delivery`?`At Delivery`:`Auto stage`,we=(0,a.useMemo)(()=>{let e=new Set,t=[];for(let n of w){let r=T.find(e=>e.id===n.source),i=T.find(e=>e.id===n.target);if(!r||!i||!r.enabled||!i.enabled)continue;let a=r.position.x+216,o=r.position.y+57,s=i.position.x,c=i.position.y+57,l=(a+s)/2,u=(o+c)/2,d=`${Math.round(l/36)}:${Math.round(u/36)}`;e.has(d)||(e.add(d),t.push({id:n.id,x:l,y:u,stage:xe(r,i),label:`Insert step between ${r.title} and ${i.title}`}))}return t},[w,T]);return(0,x.jsxs)(`div`,{ref:e,className:`wb-wf-canvas-viewport ${t?`is-panning`:``}`,onPointerDown:ue,onPointerMove:de,onPointerUp:fe,onWheel:pe,children:[(0,x.jsx)(r,{motion:!0,variant:`canvas`,spacing:22,offsetX:i.x,offsetY:i.y}),u&&(0,x.jsxs)(`div`,{className:`wb-wf-add-drawer`,role:`region`,"aria-label":`Add step to workflow`,onPointerDown:e=>e.stopPropagation(),onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),d(!1))},children:[(0,x.jsxs)(`div`,{className:`wb-wf-add-drawer-head`,children:[(0,x.jsxs)(`div`,{className:`wb-wf-add-drawer-title`,children:[(0,x.jsx)(`strong`,{children:`Add step`}),(0,x.jsx)(`span`,{className:`wb-wf-stage-badge`,children:Ce(f)})]}),(0,x.jsx)(`button`,{type:`button`,className:`text-button`,onClick:()=>{p(null),d(!1)},children:`Close`})]}),(0,x.jsx)(`div`,{className:`wb-wf-stage-picker`,role:`group`,"aria-label":`Insertion stage`,children:[{id:null,label:`Auto`},{id:`before-ai`,label:`Before AI`},{id:`after-ai`,label:`After AI`},{id:`delivery`,label:`Delivery`}].map(e=>(0,x.jsx)(`button`,{type:`button`,className:`wb-wf-stage-chip`,"aria-pressed":f===e.id,onClick:()=>{p(e.id),e.id&&te(e.id)},children:e.label},e.id??`auto`))}),(0,x.jsxs)(`div`,{className:`wb-wf-add-search-row`,children:[(0,x.jsx)(`label`,{className:`sr-only`,htmlFor:`wf-add-step-search`,children:`Search workflow steps`}),(0,x.jsx)(`input`,{ref:B,id:`wf-add-step-search`,type:`search`,className:`wb-wf-add-search`,value:I,placeholder:`Search connectors, checks, or modules… (Enter adds top match)`,onChange:e=>L(e.target.value),onKeyDown:e=>{e.key===`Enter`&&H.length>0&&(e.preventDefault(),S(H[0]))}}),(0,x.jsx)(`div`,{className:`wb-wf-add-tabs`,role:`group`,"aria-label":`Step category`,children:[{id:`all`,label:`All`},{id:`connectors`,label:`Connectors`},{id:`modules`,label:`Checks`},{id:`custom`,label:`Custom`}].map(e=>(0,x.jsx)(`button`,{type:`button`,className:`wb-focus-pill`,"aria-pressed":R===e.id,onClick:()=>z(e.id),children:e.label},e.id))})]}),ye.length>0&&(0,x.jsxs)(`div`,{className:`wb-wf-add-section`,children:[(0,x.jsx)(`span`,{children:`Connectors & Design`}),(0,x.jsx)(`div`,{className:`wb-wf-add-grid`,children:ye.map(e=>(0,x.jsxs)(`button`,{type:`button`,className:`wb-wf-add-card`,onClick:()=>S(e),children:[(0,x.jsx)(`span`,{className:`wb-n8n-icon-tile is-sm`,style:{backgroundColor:h(`context`,e.kind)},children:(0,x.jsx)(n,{name:g(`context`,e.kind)})}),(0,x.jsxs)(`div`,{className:`wb-wf-add-card-body`,children:[(0,x.jsxs)(`div`,{className:`wb-wf-add-card-top`,children:[(0,x.jsx)(`strong`,{children:e.title}),(0,x.jsx)(`span`,{className:`wb-wf-add-status`,children:ie(e)})]}),(0,x.jsx)(`small`,{children:e.desc})]})]},e.kind))})]}),be.length>0&&(0,x.jsxs)(`div`,{className:`wb-wf-add-section`,children:[(0,x.jsx)(`span`,{children:`Modules & Checks`}),(0,x.jsx)(`div`,{className:`wb-wf-add-grid`,children:be.map(e=>(0,x.jsxs)(`button`,{type:`button`,className:`wb-wf-add-card`,onClick:()=>S(e),children:[(0,x.jsx)(`span`,{className:`wb-n8n-icon-tile is-sm`,style:{backgroundColor:h(`verification`,e.kind)},children:(0,x.jsx)(n,{name:g(`verification`,e.kind)})}),(0,x.jsxs)(`div`,{className:`wb-wf-add-card-body`,children:[(0,x.jsxs)(`div`,{className:`wb-wf-add-card-top`,children:[(0,x.jsx)(`strong`,{children:e.title}),(0,x.jsx)(`span`,{className:`wb-wf-add-status`,children:ie(e)})]}),(0,x.jsx)(`small`,{children:e.desc})]})]},e.kind))})]}),R!==`custom`&&H.length===0&&(0,x.jsxs)(`p`,{className:`wb-wf-add-empty`,children:[`No built-in step matches “`,I.trim(),`”. Create a custom step below.`]}),_.length>0&&R!==`custom`&&(0,x.jsxs)(`div`,{className:`wb-wf-add-section`,children:[(0,x.jsx)(`span`,{children:`Restore Removed Built-in Steps`}),(0,x.jsx)(`div`,{className:`wb-wf-quick-chips`,children:_.map(e=>(0,x.jsxs)(`button`,{type:`button`,className:`wb-focus-pill`,onClick:()=>ae(e),children:[`+ `,e===`node-context`?`Design Style`:e===`node-scope`?`Files & Rules`:e===`node-visual-qa`?`Visual Check`:`Security & Code Audit`]},e))})]}),(R===`all`||R===`custom`||H.length===0)&&(0,x.jsxs)(`div`,{className:`wb-wf-add-section`,children:[(0,x.jsx)(`span`,{children:`Create Custom Step`}),(0,x.jsxs)(`div`,{className:`wb-wf-custom-creator`,children:[(0,x.jsx)(`input`,{type:`text`,value:ee,placeholder:`Step name (e.g. Brand Copy Review)`,onChange:e=>v(e.target.value)}),(0,x.jsxs)(`select`,{value:b,onChange:e=>te(e.target.value),children:[(0,x.jsx)(`option`,{value:`before-ai`,children:`Runs before AI Helper`}),(0,x.jsx)(`option`,{value:`after-ai`,children:`Runs after AI Helper (QA / Check)`}),(0,x.jsx)(`option`,{value:`delivery`,children:`Runs at Delivery`})]}),(0,x.jsx)(`input`,{type:`text`,value:ne,placeholder:`Short instruction or note (optional)`,onChange:e=>re(e.target.value)}),(0,x.jsx)(`button`,{type:`button`,className:`button primary`,disabled:!ee.trim(),onClick:C,children:`Add Custom Step`})]})]})]}),(0,x.jsxs)(`div`,{className:`wb-wf-canvas-stage`,style:{transform:`translate(${i.x}px, ${i.y}px) scale(${o})`,transformOrigin:`0 0`,width:`${s}px`,height:`580px`},children:[(0,x.jsxs)(`svg`,{className:`wb-wf-edges-svg`,viewBox:`0 0 ${s} 580`,width:s,height:580,"aria-hidden":`true`,children:[(0,x.jsx)(`defs`,{children:(0,x.jsx)(`marker`,{id:`wf-arrow`,viewBox:`0 0 10 10`,refX:`7`,refY:`5`,markerWidth:`6`,markerHeight:`6`,orient:`auto-start-reverse`,children:(0,x.jsx)(`path`,{d:`M 0 1 L 8 5 L 0 9 z`,fill:`currentColor`})})}),w.map(e=>{let t=T.find(t=>t.id===e.source),n=T.find(t=>t.id===e.target);if(!t||!n)return null;let r=t.position.x+216,i=t.position.y+57,a=n.position.x,o=n.position.y+57,s=Math.max(46,Math.abs(a-r)*.45),c=`M ${r} ${i} C ${r+s} ${i}, ${a-s} ${o}, ${a} ${o}`,l=(r+a)/2,u=(i+o)/2-9,d=A?.nodeResults?.[n.id],f=!t.enabled||!n.enabled,p=!f&&(ce||E===e.source||E===e.target||!!d),m=f?``:d?.status===`passed`?`tone-passed`:d?.status===`warning`?`tone-warning`:d?.status===`failed`?`tone-failed`:``;return(0,x.jsxs)(`g`,{className:`wb-wf-edge-group ${p?`is-active`:``} ${f?`is-disabled`:``} ${m}`,children:[(0,x.jsx)(`path`,{className:`wb-wf-edge-bg`,d:c}),(0,x.jsx)(`path`,{className:`wb-wf-edge-line ${ce&&!f?`is-animating`:``}`,d:c,markerEnd:`url(#wf-arrow)`}),(0,x.jsx)(`rect`,{x:l-28,y:u-9,width:`56`,height:`17`,rx:`8.5`,className:`wb-wf-edge-pill`}),(0,x.jsx)(`text`,{x:l,y:u+2.5,textAnchor:`middle`,className:`wb-wf-edge-label`,children:e.label})]},e.id)})]}),we.map(e=>(0,x.jsx)(`button`,{type:`button`,className:`wb-wf-edge-add`,style:{left:`${e.x}px`,top:`${e.y+14}px`},title:e.label,"aria-label":e.label,onPointerDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),m(e.stage)},children:(0,x.jsx)(n,{name:`plus`})},`ins-${e.id}`)),T.map(e=>{let t=h(e.type,e.custom?.kind),r=oe?.id===e.id,i=se===e.id,a=A?.nodeResults?.[e.id],o=k===e.id?`Running…`:e.enabled?a?a.status===`passed`?`✓ ${a.durationMs}ms`:a.status===`warning`?`! Check`:`× Issue`:``:`Skipped`;return(0,x.jsxs)(`div`,{role:`button`,tabIndex:0,"aria-label":`${e.title} workflow node`,"aria-pressed":r,className:`wb-wf-node-card wb-n8n-node ${r?`is-selected`:``} ${i?`is-dragging`:``} ${e.enabled?``:`is-disabled`} status-${e.status}`,style:{left:`${e.position.x}px`,top:`${e.position.y}px`,width:`216px`,minHeight:`114px`,"--wf-node-accent":t},onPointerDown:t=>me(t,e),onPointerMove:he,onPointerUp:ge,onDoubleClick:()=>{D(e.id),O(!0)},onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),D(e.id),O(!0))},children:[e.type!==`trigger`&&(0,x.jsx)(`span`,{className:`wb-wf-port wb-wf-port-in`,"aria-hidden":`true`}),(0,x.jsxs)(`div`,{className:`wb-n8n-hover-bar`,children:[(0,x.jsx)(`button`,{type:`button`,title:`Run & inspect ${e.title}`,"aria-label":`Run and inspect ${e.title}`,disabled:ce,onClick:t=>{t.stopPropagation(),_e(e.id)},children:`▶`}),!e.locked&&(e.id!==`node-context`||le===`ui`)&&(0,x.jsx)(`button`,{type:`button`,title:e.enabled?`Skip ${e.title}`:`Enable ${e.title}`,onClick:t=>{t.stopPropagation(),e.custom?j(e.id,{enabled:!e.enabled}):ve(e.id)},children:e.enabled?`On`:`Off`}),e.removable&&(0,x.jsx)(`button`,{type:`button`,className:`is-danger`,title:`Remove ${e.title}`,"aria-label":`Remove ${e.title}`,onClick:t=>{t.stopPropagation(),M(e.id)},children:`×`})]}),(0,x.jsxs)(`div`,{className:`wb-n8n-node-row`,children:[(0,x.jsx)(`span`,{className:`wb-n8n-icon-tile`,style:{backgroundColor:t},"aria-hidden":`true`,children:(0,x.jsx)(n,{name:g(e.type,e.custom?.kind)})}),(0,x.jsxs)(`div`,{className:`wb-n8n-node-body`,children:[(0,x.jsx)(`span`,{className:`wb-n8n-node-step`,children:e.category}),(0,x.jsx)(`strong`,{className:`wb-wf-node-title`,children:e.title})]})]}),(0,x.jsx)(`p`,{className:`wb-wf-node-sub`,children:a?a.summary:e.subtitle}),o&&(0,x.jsx)(`span`,{className:`wb-n8n-corner-badge status-${e.enabled?e.status:`skipped`}`,children:o}),e.id!==`node-delivery`&&e.custom?.stage!==`delivery`&&(0,x.jsx)(`button`,{type:`button`,className:`wb-wf-port wb-wf-port-out wb-wf-port-add`,title:`Add step after ${e.title}`,"aria-label":`Add step after ${e.title}`,onPointerDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),m(Se(e))},children:(0,x.jsx)(n,{name:`plus`})})]},e.id)})]}),(0,x.jsxs)(`div`,{className:`wb-wf-dock`,role:`toolbar`,"aria-label":`Canvas controls`,children:[(0,x.jsxs)(`button`,{type:`button`,className:`wb-wf-dock-add`,"aria-pressed":u,onClick:()=>{p(null),d(e=>!e)},title:`Add step to workflow (A)`,children:[(0,x.jsx)(n,{name:`plus`}),`Add step`]}),(0,x.jsx)(`span`,{className:`wb-wf-dock-sep`,"aria-hidden":`true`}),(0,x.jsx)(`button`,{type:`button`,onClick:N,title:`Fit all steps in view (0)`,children:`Fit`}),(0,x.jsx)(`button`,{type:`button`,onClick:()=>c(e=>y(Number((e-.1).toFixed(2)),.34,1.5)),"aria-label":`Zoom out`,title:`Zoom out (-)`,children:`−`}),(0,x.jsxs)(`span`,{className:`wb-wf-dock-pct`,children:[Math.round(o*100),`%`]}),(0,x.jsx)(`button`,{type:`button`,onClick:()=>c(e=>y(Number((e+.1).toFixed(2)),.34,1.5)),"aria-label":`Zoom in`,title:`Zoom in (+)`,children:`+`}),(0,x.jsx)(`button`,{type:`button`,onClick:P,title:`Line up steps neatly`,children:`Tidy`})]}),(0,x.jsx)(`div`,{className:`wb-wf-minimap`,"aria-label":`Workflow mini-map`,children:(0,x.jsxs)(`svg`,{viewBox:`0 0 ${s} 580`,width:`164`,height:`58`,children:[w.map(e=>{let t=T.find(t=>t.id===e.source),n=T.find(t=>t.id===e.target);return!t||!n?null:(0,x.jsx)(`line`,{x1:t.position.x+216,y1:t.position.y+57,x2:n.position.x,y2:n.position.y+57,stroke:`currentColor`,strokeWidth:`9`,opacity:!t.enabled||!n.enabled?.2:.45},e.id)}),T.map(e=>{let t=oe?.id===e.id,n=e.enabled?e.status===`failed`?`#ef4444`:e.status===`warning`?`#f59e0b`:e.status===`passed`?`#10b981`:h(e.type,e.custom?.kind):`#94a3b8`;return(0,x.jsx)(`rect`,{x:e.position.x,y:e.position.y,width:216,height:114,rx:`22`,fill:n,opacity:e.enabled?.92:.35,stroke:t?`#ffffff`:`none`,strokeWidth:t?`24`:`0`,style:{cursor:`pointer`},onClick:()=>F(e)},e.id)})]})})]})}function ie({selectedNode:e,inspectorTab:t,setInspectorTab:r,executing:i,executionResult:a,graph:o,rules:s,setRules:c,profile:u,setProfile:d,minScoreThreshold:m,setMinScoreThreshold:y,maxOutputTokens:b,setMaxOutputTokens:te,maxCostUsd:ne,setMaxCostUsd:re,strictDesignSystem:ie,setStrictDesignSystem:S,visualDiffThreshold:ae,setVisualDiffThreshold:C,showDiffBoxes:w,setShowDiffBoxes:T,activeDiffViewport:oe,setActiveDiffViewport:E,diffImageLayer:D,setDiffImageLayer:O,newRouteInput:se,setNewRouteInput:k,newDirInput:ce,setNewDirInput:A,newPreserveInput:le,setNewPreserveInput:ue,newInteractionInput:de,setNewInteractionInput:fe,newIgnoreCheckInput:pe,setNewIgnoreCheckInput:me,setError:he,removeNode:ge,updateCustomNode:_e,updateCustomNodeConfig:j,moveCustomNodeStage:ve,toggleSkill:M,toggleKeepItem:N,executeWorkflowPipeline:P,onOpenComposer:F}){let I=a?.securityReport,L=I?.scoreBreakdown,R=I?.testIntegrity,z=a?.designSystemLock,B=a?.visualDiff,V=B?.viewports?.find(e=>e.name===oe)??B?.viewports?.[0]??null,H=a?.nodeResults?.[e.id];return(0,x.jsxs)(`aside`,{className:`wb-wf-inspector`,"aria-label":`Selected workflow node inspector`,children:[(0,x.jsxs)(`div`,{className:`wb-wf-inspector-head`,children:[(0,x.jsxs)(`div`,{className:`wb-wf-inspector-top-row`,children:[(0,x.jsx)(`span`,{className:`wb-n8n-icon-tile is-sm`,style:{backgroundColor:h(e.type,e.custom?.kind)},"aria-hidden":`true`,children:(0,x.jsx)(n,{name:g(e.type,e.custom?.kind)})}),(0,x.jsxs)(`div`,{className:`wb-wf-inspector-title-wrap`,children:[(0,x.jsx)(`span`,{className:`wb-wf-inspector-badge`,style:{color:h(e.type,e.custom?.kind)},children:e.category}),(0,x.jsx)(`h3`,{children:e.title})]}),e.removable&&(0,x.jsx)(`button`,{type:`button`,className:`text-button wb-wf-remove-inline`,onClick:()=>ge(e.id),children:`Remove`})]}),(0,x.jsx)(`p`,{className:`wb-wf-step-desc`,children:e.custom?l.find(t=>t.kind===e.custom?.kind)?.desc??`Custom step in your workflow.`:f[e.id]??e.subtitle}),(0,x.jsxs)(`div`,{className:`wb-wf-inspector-tabs`,role:`tablist`,"aria-label":`Step details`,children:[(0,x.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":t===`settings`,onClick:()=>r(`settings`),children:`Settings`}),(0,x.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":t===`output`,onClick:()=>r(`output`),children:[`Output`,a?` · Ready`:``]})]})]}),t===`output`&&(0,x.jsx)(`div`,{className:`wb-wf-inspector-form`,children:a?(0,x.jsxs)(x.Fragment,{children:[H&&(0,x.jsxs)(`div`,{className:`wb-wf-step-output-card status-${H.status}`,children:[(0,x.jsxs)(`div`,{className:`wb-vdiff-lock-head`,children:[(0,x.jsx)(`strong`,{className:`wb-wf-status-cap`,children:H.status}),(0,x.jsxs)(`div`,{className:`wb-wf-node-metrics`,children:[H.source&&(0,x.jsx)(`span`,{className:`wb-wf-metric-chip`,children:H.source===`live`?`Live check`:H.source===`fallback`?`Setup needed`:`Static check`}),(0,x.jsxs)(`span`,{className:`wb-wf-metric-chip`,children:[H.durationMs,`ms`]})]})]}),(0,x.jsx)(`p`,{className:`wb-wf-note`,children:H.summary}),H.details&&H.details.length>0&&(0,x.jsx)(`ul`,{className:`wb-wf-step-detail-list`,children:H.details.map((e,t)=>(0,x.jsx)(`li`,{children:e},t))}),H.fallbackHint&&(0,x.jsx)(`p`,{className:`wb-wf-info-callout`,children:H.fallbackHint})]}),I&&(0,x.jsxs)(`div`,{className:`wb-wf-kpi-grid`,children:[(0,x.jsxs)(`div`,{className:`wb-wf-kpi-tile`,children:[(0,x.jsx)(`small`,{children:`Score`}),(0,x.jsxs)(`strong`,{children:[I.score,`/100`]})]}),(0,x.jsxs)(`div`,{className:`wb-wf-kpi-tile`,children:[(0,x.jsx)(`small`,{children:`Files`}),(0,x.jsx)(`strong`,{children:I.filesAudited})]}),(0,x.jsxs)(`div`,{className:`wb-wf-kpi-tile`,children:[(0,x.jsx)(`small`,{children:`Issues`}),(0,x.jsx)(`strong`,{children:I.findings.length})]}),(0,x.jsxs)(`div`,{className:`wb-wf-kpi-tile`,children:[(0,x.jsx)(`small`,{children:`Time`}),(0,x.jsxs)(`strong`,{children:[a.totalDurationMs,`ms`]})]})]}),e.id===`node-security-gate`&&L&&(0,x.jsxs)(`div`,{className:`wb-wf-rubric-box`,children:[(0,x.jsxs)(`div`,{className:`wb-wf-rubric-head`,children:[(0,x.jsx)(`strong`,{children:`Audit Score Breakdown`}),(0,x.jsxs)(`span`,{className:`wb-wf-total-score`,children:[I?.score,`/100`]})]}),[L.securitySurface,L.testIntegrity,L.uiCraftAndA11y,L.verificationDepth].map(e=>(0,x.jsxs)(`div`,{className:`wb-wf-pillar-row`,children:[(0,x.jsxs)(`div`,{className:`wb-wf-pillar-top`,children:[(0,x.jsx)(`span`,{children:ee(e.label)}),(0,x.jsxs)(`strong`,{children:[e.score,`/`,e.max]})]}),(0,x.jsx)(`div`,{className:`wb-wf-pillar-track`,children:(0,x.jsx)(`div`,{className:`wb-wf-pillar-fill`,style:{width:`${Math.round(e.score/e.max*100)}%`}})})]},e.label)),R&&(0,x.jsxs)(`div`,{className:`wb-wf-ti-summary`,children:[(0,x.jsxs)(`span`,{children:[`Tests: `,(0,x.jsx)(`strong`,{children:R.testFilesCount})]}),(0,x.jsxs)(`span`,{children:[`Checks: `,(0,x.jsx)(`strong`,{children:R.totalAssertions})]}),(0,x.jsxs)(`span`,{children:[`Empty Tests: `,(0,x.jsx)(`strong`,{children:R.tautologyCount})]})]})]}),e.id===`node-visual-qa`&&z&&(0,x.jsxs)(`div`,{className:`wb-vdiff-lock-box ${z.compliant?`is-clean`:`is-drift`}`,role:`region`,"aria-label":`Component check report`,children:[(0,x.jsxs)(`div`,{className:`wb-vdiff-lock-head`,children:[(0,x.jsx)(`strong`,{children:`Component Check`}),(0,x.jsx)(`span`,{className:`wb-wf-scanner-pill ${z.compliant?`status-ready`:`status-optional`}`,children:z.compliant?`Clean (${z.filesScanned??0} files)`:`${z.violationCount} issue(s)`})]}),(0,x.jsx)(`p`,{className:`wb-wf-note`,children:z.recommendation}),z.violations.length>0&&(0,x.jsx)(`ul`,{className:`wb-vdiff-violation-list`,children:z.violations.slice(0,6).map((e,t)=>(0,x.jsxs)(`li`,{children:[e.path&&(0,x.jsxs)(`code`,{translate:`no`,children:[e.path,e.line?`:${e.line}`:``]}),(0,x.jsx)(`span`,{children:e.message})]},`${e.rule}-${e.path??t}-${t}`))})]}),(e.id===`node-visual-qa`||e.custom?.kind===`playwright`)&&B&&(0,x.jsxs)(`div`,{className:`wb-vdiff-panel`,role:`region`,"aria-label":`Visual diff preview`,children:[(0,x.jsxs)(`div`,{className:`wb-vdiff-lock-head`,children:[(0,x.jsx)(`strong`,{children:`Visual Diff`}),(0,x.jsx)(`span`,{className:`wb-wf-metric-chip`,children:B.viewports.length>0?`${B.maxMismatchPercentage}% · ${B.totalBoundingBoxes} region(s)`:`No screenshots yet`})]}),(0,x.jsx)(`p`,{className:`wb-wf-note`,children:B.summary}),V&&(0,x.jsxs)(`div`,{className:`wb-vdiff-stage-wrap`,children:[(0,x.jsxs)(`div`,{className:`wb-vdiff-toolbar`,children:[(0,x.jsx)(`div`,{className:`wb-vdiff-vp-tabs`,role:`group`,"aria-label":`Viewport`,children:B.viewports.map(e=>(0,x.jsx)(`button`,{type:`button`,className:`button subtle`,"aria-pressed":V.name===e.name,onClick:()=>E(e.name),children:e.name},e.name))}),(0,x.jsxs)(`div`,{className:`wb-vdiff-layer-controls`,children:[(0,x.jsx)(`button`,{type:`button`,className:`button subtle`,"aria-pressed":D===`before`,onClick:()=>O(`before`),children:`Before`}),(0,x.jsx)(`button`,{type:`button`,className:`button subtle`,"aria-pressed":D===`after`,onClick:()=>O(`after`),children:`After`}),(0,x.jsxs)(`label`,{className:`wb-vdiff-toggle`,children:[(0,x.jsx)(`input`,{type:`checkbox`,checked:w,onChange:e=>T(e.target.checked)}),`Boxes (`,V.boundingBoxes.length,`)`]})]})]}),(0,x.jsxs)(`div`,{className:`wb-vdiff-canvas`,children:[(0,x.jsx)(`img`,{src:D===`before`?V.beforeUrl:V.afterUrl,alt:`${D===`before`?`Before`:`After`} ${V.name} capture`}),w&&V.width>0&&V.height>0&&V.boundingBoxes.map((e,t)=>(0,x.jsx)(`div`,{className:`wb-vdiff-bbox`,title:`Region #${t+1}: ${e.width}×${e.height}px`,style:{left:`${e.x/V.width*100}%`,top:`${e.y/V.height*100}%`,width:`${Math.max(1.5,e.width/V.width*100)}%`,height:`${Math.max(1.5,e.height/V.height*100)}%`},children:(0,x.jsxs)(`span`,{children:[`#`,t+1]})},`${e.x}-${e.y}-${t}`))]})]})]}),(0,x.jsx)(`button`,{type:`button`,className:`button subtle`,disabled:i,onClick:()=>void P(e.id),children:i?`Running…`:`Re-run Audit`})]}):(0,x.jsxs)(`div`,{className:`wb-wf-empty-output`,children:[(0,x.jsx)(`p`,{children:`Run a local audit to see live results for this step.`}),(0,x.jsx)(`button`,{type:`button`,className:`button primary`,disabled:i,onClick:()=>void P(e.id),children:i?`Running…`:`Run Audit`})]})}),t===`settings`&&(0,x.jsxs)(x.Fragment,{children:[e.custom&&(0,x.jsxs)(`div`,{className:`wb-wf-inspector-form`,children:[(0,x.jsxs)(`label`,{children:[`Step Name`,(0,x.jsx)(`input`,{type:`text`,value:e.custom.title,onChange:t=>_e(e.id,{title:t.target.value})})]}),(0,x.jsxs)(`label`,{children:[`Run Order`,(0,x.jsxs)(`select`,{value:e.custom.stage,onChange:t=>ve(e.id,t.target.value),children:[(0,x.jsx)(`option`,{value:`before-ai`,children:`Before AI edits (Context & Design)`}),(0,x.jsx)(`option`,{value:`after-ai`,children:`After AI edits (Checks & QA)`}),(0,x.jsx)(`option`,{value:`delivery`,children:`At Delivery (Git & Export)`})]})]}),e.custom.kind===`figma`&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`label`,{children:[`Figma Frame or File URL`,(0,x.jsx)(`input`,{type:`text`,value:e.custom.config.figmaUrl??``,placeholder:`https://www.figma.com/design/...`,onChange:t=>j(e.id,{figmaUrl:t.target.value})})]}),(0,x.jsxs)(`div`,{className:`wb-wf-list-editor`,children:[(0,x.jsx)(`span`,{children:`What to Pull from Figma`}),(0,x.jsx)(`div`,{className:`wb-wf-choice-grid`,children:[`Colors & Layout`,`Tokens Only`,`Full Frame`].map(t=>(0,x.jsx)(`button`,{type:`button`,className:`wb-wf-choice-card`,"aria-pressed":(e.custom?.config.figmaMode??`Colors & Layout`)===t,onClick:()=>j(e.id,{figmaMode:t}),children:(0,x.jsx)(`strong`,{children:t})},t))})]})]}),e.custom.kind===`playwright`&&(0,x.jsxs)(`div`,{className:`wb-wf-list-editor`,children:[(0,x.jsx)(`span`,{children:`Viewports to Capture`}),(0,x.jsx)(`div`,{className:`wb-wf-quick-chips`,children:[`desktop`,`mobile`,`dark`,`motion`].map(t=>{let n=e.custom?.config.viewports??[`desktop`,`mobile`],r=n.includes(t);return(0,x.jsxs)(`button`,{type:`button`,className:`wb-focus-pill`,"aria-pressed":r,onClick:()=>{let i=r?n.filter(e=>e!==t):[...n,t];j(e.id,{viewports:i.length?i:[`desktop`]})},children:[r?`✓ `:`+ `,t]},t)})})]}),e.custom.kind===`git`&&(0,x.jsxs)(`label`,{children:[`Export Branch Prefix`,(0,x.jsx)(`input`,{type:`text`,value:e.custom.config.branchPrefix??`studio/`,placeholder:`studio/`,onChange:t=>j(e.id,{branchPrefix:t.target.value})})]}),(0,x.jsxs)(`label`,{children:[`Step Notes / Instructions`,(0,x.jsx)(`input`,{type:`text`,value:e.custom.config.notes??``,placeholder:`Optional guidance for this step…`,onChange:t=>j(e.id,{notes:t.target.value})})]}),(0,x.jsx)(`button`,{type:`button`,className:`button subtle`,disabled:i,onClick:()=>void P(e.id),children:i?`Running…`:`Test This Step`})]}),!e.custom&&e.id===`node-intake`&&(0,x.jsxs)(`div`,{className:`wb-wf-inspector-form`,children:[(0,x.jsxs)(`label`,{children:[`Project Type`,(0,x.jsxs)(`select`,{value:s.framework??`auto`,onChange:e=>c(t=>({...t,framework:e.target.value})),children:[(0,x.jsx)(`option`,{value:`auto`,children:`Auto-detect`}),(0,x.jsx)(`option`,{value:`static-html`,children:`Static HTML / CSS`}),(0,x.jsx)(`option`,{value:`react-vite`,children:`React + Vite`}),(0,x.jsx)(`option`,{value:`nextjs-app`,children:`Next.js (App Router)`}),(0,x.jsx)(`option`,{value:`nextjs-pages`,children:`Next.js (Pages Router)`})]})]}),(0,x.jsxs)(`label`,{children:[`Task Focus`,(0,x.jsxs)(`select`,{value:u,onChange:e=>d(e.target.value),children:[(0,x.jsx)(`option`,{value:`ui`,children:`UI Redesign`}),(0,x.jsx)(`option`,{value:`audit`,children:`Quick Audit`}),(0,x.jsx)(`option`,{value:`seo`,children:`SEO & Page Structure`}),(0,x.jsx)(`option`,{value:`ai-search`,children:`AI Search Readiness`}),(0,x.jsx)(`option`,{value:`architecture`,children:`Project Map`})]})]}),(0,x.jsxs)(`label`,{children:[`Local Dev Command`,(0,x.jsxs)(`select`,{value:s.previewCommand??``,onChange:e=>c(t=>({...t,...e.target.value?{previewCommand:e.target.value}:{previewCommand:void 0}})),children:[(0,x.jsx)(`option`,{value:``,children:`Auto-detect build`}),(0,x.jsx)(`option`,{value:`npm run dev`,children:`npm run dev`}),(0,x.jsx)(`option`,{value:`npm run preview`,children:`npm run preview`}),(0,x.jsx)(`option`,{value:`npm run start`,children:`npm run start`}),(0,x.jsx)(`option`,{value:`npx vite`,children:`npx vite`}),(0,x.jsx)(`option`,{value:`npx next dev`,children:`npx next dev`})]})]}),(0,x.jsxs)(`div`,{className:`wb-wf-list-editor`,children:[(0,x.jsx)(`span`,{children:`Pages to Check`}),(0,x.jsx)(`div`,{className:`wb-wf-tag-list`,children:(s.routes??[`/`]).map(e=>(0,x.jsxs)(`span`,{className:`wb-wf-tag`,children:[(0,x.jsx)(`code`,{children:e}),(s.routes?.length??0)>1&&(0,x.jsx)(`button`,{type:`button`,"aria-label":`Remove page ${e}`,onClick:()=>c(t=>({...t,routes:(t.routes??[`/`]).filter(t=>t!==e)})),children:`×`})]},e))}),(0,x.jsxs)(`div`,{className:`wb-wf-inline-add`,children:[(0,x.jsx)(`input`,{type:`text`,value:se,placeholder:`/pricing`,onChange:e=>k(e.target.value)}),(0,x.jsx)(`button`,{type:`button`,className:`button subtle`,onClick:()=>{let e=se.trim();e.startsWith(`/`)&&(c(t=>({...t,routes:Array.from(new Set([...t.routes??[`/`],e])).slice(0,8)})),k(``))},children:`Add`})]})]})]}),!e.custom&&e.id===`node-context`&&(0,x.jsxs)(`div`,{className:`wb-wf-inspector-form`,children:[u!==`ui`&&(0,x.jsxs)(`div`,{className:`wb-wf-info-callout`,children:[`Skipped in `,(0,x.jsx)(`strong`,{children:_(u)}),` mode. Switch to`,` `,(0,x.jsx)(`strong`,{children:`UI Redesign`}),` above to use design styles.`]}),(0,x.jsxs)(`div`,{className:`wb-wf-list-editor`,children:[(0,x.jsx)(`span`,{children:`Visual Direction`}),(0,x.jsx)(`div`,{className:`wb-wf-choice-grid`,role:`group`,"aria-label":`Design guide`,children:[{id:`impeccable`,title:`Modern`,desc:`Clean, balanced UI`},{id:`hallmark`,title:`Editorial`,desc:`Bold & reference-led`},{id:`project`,title:`Keep Mine`,desc:`Match current styles`}].map(e=>(0,x.jsxs)(`button`,{type:`button`,className:`wb-wf-choice-card`,"aria-pressed":(s.designGuide??`impeccable`)===e.id,onClick:()=>c(t=>({...t,designGuide:e.id})),children:[(0,x.jsx)(`strong`,{children:e.title}),(0,x.jsx)(`small`,{children:e.desc})]},e.id))})]}),(0,x.jsxs)(`div`,{className:`wb-wf-list-editor`,children:[(0,x.jsx)(`span`,{children:`Active Guides`}),(0,x.jsx)(`div`,{className:`wb-wf-skill-checklist`,children:(o?.hubCatalog.skills??[]).map(e=>{let t=(s.pinnedSkills??[]).includes(e.id);return(0,x.jsxs)(`label`,{className:`wb-wf-skill-check`,children:[(0,x.jsx)(`input`,{type:`checkbox`,checked:t,onChange:()=>M(e.id)}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`strong`,{children:e.label}),(0,x.jsx)(`small`,{children:e.category})]})]},e.id)})})]})]}),!e.custom&&e.id===`node-scope`&&(0,x.jsxs)(`div`,{className:`wb-wf-inspector-form`,children:[(0,x.jsxs)(`div`,{className:`wb-wf-list-editor`,children:[(0,x.jsx)(`span`,{children:`Folders to Include`}),(0,x.jsx)(`div`,{className:`wb-wf-tag-list`,children:(s.includeDirs??[]).map(e=>(0,x.jsxs)(`span`,{className:`wb-wf-tag`,children:[(0,x.jsx)(`code`,{children:e}),(0,x.jsx)(`button`,{type:`button`,"aria-label":`Remove folder ${e}`,onClick:()=>c(t=>({...t,includeDirs:(t.includeDirs??[]).filter(t=>t!==e)})),children:`×`})]},e))}),(0,x.jsxs)(`div`,{className:`wb-wf-inline-add`,children:[(0,x.jsx)(`input`,{type:`text`,value:ce,placeholder:`src/components`,onChange:e=>A(e.target.value)}),(0,x.jsx)(`button`,{type:`button`,className:`button subtle`,onClick:()=>{let e=ce.trim().replace(/^\/+|\/+$/g,``);e&&(c(t=>({...t,includeDirs:Array.from(new Set([...t.includeDirs??[],e])).slice(0,16)})),A(``))},children:`Add`})]})]}),(0,x.jsxs)(`div`,{className:`wb-wf-list-editor`,children:[(0,x.jsx)(`span`,{children:`Must Keep Working`}),(0,x.jsx)(`div`,{className:`wb-wf-quick-chips`,children:p.map(e=>{let t=(s.mustPreserve??[]).includes(e);return(0,x.jsxs)(`button`,{type:`button`,className:`wb-focus-pill`,"aria-pressed":t,onClick:()=>N(e),children:[t?`✓ `:`+ `,e]},e)})}),(0,x.jsx)(`div`,{className:`wb-wf-tag-list`,children:(s.mustPreserve??[]).filter(e=>!p.includes(e)).map(e=>(0,x.jsxs)(`span`,{className:`wb-wf-tag`,children:[(0,x.jsx)(`span`,{children:e}),(0,x.jsx)(`button`,{type:`button`,"aria-label":`Remove ${e}`,onClick:()=>N(e),children:`×`})]},e))}),(0,x.jsxs)(`div`,{className:`wb-wf-inline-add`,children:[(0,x.jsx)(`input`,{type:`text`,value:le,placeholder:`Custom item or #selector`,onChange:e=>ue(e.target.value)}),(0,x.jsx)(`button`,{type:`button`,className:`button subtle`,onClick:()=>{let e=le.trim();e&&(c(t=>({...t,mustPreserve:Array.from(new Set([...t.mustPreserve??[],e])).slice(0,16)})),ue(``))},children:`Add`})]})]})]}),!e.custom&&e.id===`node-engine`&&(0,x.jsxs)(`div`,{className:`wb-wf-inspector-form`,children:[(0,x.jsxs)(`div`,{className:`wb-wf-list-editor`,children:[(0,x.jsx)(`span`,{children:`AI Run Size`}),(0,x.jsx)(`div`,{className:`wb-wf-choice-grid`,role:`group`,"aria-label":`AI size`,children:[{id:`light`,title:`Light`,desc:`8k · $0.10`,tok:8192,cost:.1},{id:`balanced`,title:`Balanced`,desc:`16k · $0.25`,tok:16384,cost:.25},{id:`deep`,title:`Deep`,desc:`32k · $0.75`,tok:32768,cost:.75}].map(e=>(0,x.jsxs)(`button`,{type:`button`,className:`wb-wf-choice-card`,"aria-pressed":b===e.tok&&ne===e.cost,onClick:()=>{te(e.tok),re(e.cost)},children:[(0,x.jsx)(`strong`,{children:e.title}),(0,x.jsx)(`small`,{children:e.desc})]},e.id))})]}),(0,x.jsxs)(`details`,{className:`wb-wf-subdetails`,children:[(0,x.jsx)(`summary`,{children:`Custom limits`}),(0,x.jsxs)(`div`,{className:`wb-wf-inspector-form`,style:{marginTop:`8px`},children:[(0,x.jsxs)(`label`,{children:[`Max Output (`,(b/1024).toFixed(0),`k tokens)`,(0,x.jsx)(`input`,{type:`range`,min:4096,max:65536,step:2048,value:b,onChange:e=>te(Number(e.target.value))})]}),(0,x.jsxs)(`label`,{children:[`Cost Cap ($`,ne.toFixed(2),`)`,(0,x.jsx)(`input`,{type:`number`,min:.01,max:10,step:.05,value:ne,onChange:e=>re(Number(e.target.value)||.25)})]})]})]}),(0,x.jsx)(`p`,{className:`wb-wf-note`,children:`Only applies to AI edits. Local audits use zero API credits.`})]}),!e.custom&&e.id===`node-visual-qa`&&(0,x.jsxs)(`div`,{className:`wb-wf-inspector-form`,children:[(0,x.jsxs)(`label`,{className:`wb-wf-skill-check`,children:[(0,x.jsx)(`input`,{type:`checkbox`,checked:ie,onChange:e=>S(e.target.checked)}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`strong`,{children:`Strict Component Check`}),(0,x.jsxs)(`small`,{children:[`Warn on raw `,(0,x.jsx)(`code`,{children:`<button>`}),` tags or inline hex colors when your project uses reusable components.`]})]})]}),(0,x.jsxs)(`div`,{className:`wb-wf-list-editor`,children:[(0,x.jsx)(`span`,{children:`Pixel Change Tolerance`}),(0,x.jsx)(`div`,{className:`wb-wf-choice-grid`,role:`group`,"aria-label":`Diff sensitivity`,children:[{label:`Strict`,val:.05,desc:`5% pixel`},{label:`Normal`,val:.1,desc:`10% pixel`},{label:`Relaxed`,val:.2,desc:`20% pixel`}].map(e=>(0,x.jsxs)(`button`,{type:`button`,className:`wb-wf-choice-card`,"aria-pressed":Math.abs(ae-e.val)<.02,onClick:()=>C(e.val),children:[(0,x.jsx)(`strong`,{children:e.label}),(0,x.jsx)(`small`,{children:e.desc})]},e.label))})]}),(0,x.jsxs)(`div`,{className:`wb-wf-list-editor`,children:[(0,x.jsx)(`span`,{children:`Click & Keyboard Checks`}),(0,x.jsx)(`ul`,{className:`wb-wf-step-list`,children:(s.interactions??[]).map((e,t)=>(0,x.jsxs)(`li`,{children:[(0,x.jsxs)(`span`,{children:[(0,x.jsxs)(`strong`,{children:[t+1,`.`]}),` `,e]}),(0,x.jsx)(`button`,{type:`button`,className:`text-button`,onClick:()=>c(t=>({...t,interactions:(t.interactions??[]).filter(t=>t!==e)})),children:`Remove`})]},e))}),(0,x.jsxs)(`div`,{className:`wb-wf-inline-add`,children:[(0,x.jsx)(`input`,{type:`text`,value:de,placeholder:`Click main button and check dialog`,onChange:e=>fe(e.target.value)}),(0,x.jsx)(`button`,{type:`button`,className:`button subtle`,onClick:()=>{let e=de.trim();e&&(c(t=>({...t,interactions:Array.from(new Set([...t.interactions??[],e])).slice(0,16)})),fe(``))},children:`Add`})]})]}),(0,x.jsxs)(`details`,{className:`wb-wf-subdetails`,children:[(0,x.jsxs)(`summary`,{children:[`Muted non-critical warnings (`,(s.ignoreChecks??[]).length,`)`]}),(0,x.jsxs)(`div`,{className:`wb-wf-list-editor`,style:{marginTop:`8px`},children:[(0,x.jsx)(`div`,{className:`wb-wf-tag-list`,children:(s.ignoreChecks??[]).map(e=>(0,x.jsxs)(`span`,{className:`wb-wf-tag`,children:[(0,x.jsx)(`code`,{children:e}),(0,x.jsx)(`button`,{type:`button`,onClick:()=>c(t=>({...t,ignoreChecks:(t.ignoreChecks??[]).filter(t=>t!==e)})),children:`×`})]},e))}),(0,x.jsxs)(`div`,{className:`wb-wf-inline-add`,children:[(0,x.jsx)(`input`,{type:`text`,value:pe,placeholder:`MISSING_REDUCED_MOTION_SUPPORT`,onChange:e=>me(e.target.value)}),(0,x.jsx)(`button`,{type:`button`,className:`button subtle`,onClick:()=>{let e=pe.trim().toUpperCase();e&&(o?.hubCatalog.nonIgnorableChecks.includes(e)?he(`Security rule ${e} cannot be ignored.`):(c(t=>({...t,ignoreChecks:Array.from(new Set([...t.ignoreChecks??[],e])).slice(0,16)})),me(``)))},children:`Ignore`})]})]})]})]}),!e.custom&&e.id===`node-security-gate`&&(0,x.jsxs)(`div`,{className:`wb-wf-inspector-form`,children:[(0,x.jsxs)(`label`,{children:[`Passing Score (`,m,` / 100)`,(0,x.jsx)(`input`,{type:`range`,min:45,max:95,step:1,value:m,onChange:e=>y(Number(e.target.value))})]}),(0,x.jsxs)(`div`,{className:`wb-wf-scanners-box`,children:[(0,x.jsx)(`span`,{children:`Built-in Checks`}),(0,x.jsx)(`ul`,{children:(o?.toolchain.scanners??[]).map(e=>(0,x.jsxs)(`li`,{children:[(0,x.jsx)(`strong`,{children:v(e.name)}),(0,x.jsx)(`span`,{className:`wb-wf-scanner-pill status-${e.status}`,children:e.status===`ready`?`Ready`:`Optional`})]},e.id))})]}),L&&(0,x.jsxs)(`button`,{type:`button`,className:`button subtle`,onClick:()=>r(`output`),children:[`View Score Breakdown (`,I?.score,`/100)`]})]}),!e.custom&&e.id===`node-delivery`&&(0,x.jsxs)(`div`,{className:`wb-wf-inspector-form`,children:[(0,x.jsxs)(`ol`,{className:`wb-wf-simple-steps`,children:[(0,x.jsx)(`li`,{children:`Preview changes side-by-side before touching your project.`}),(0,x.jsx)(`li`,{children:`Apply only the files you approve.`}),(0,x.jsx)(`li`,{children:`Use 1-click Undo anytime to restore originals.`})]}),F&&(0,x.jsx)(`button`,{type:`button`,className:`button primary`,onClick:F,children:`Open in Workspace`})]})]})]})}var S={version:1,pinnedSkills:[],designGuide:null,framework:`auto`,routes:[`/`,`/pricing`],includeDirs:[`src`,`app`,`components`],mustPreserve:[`Primary navigation`,`Keyboard focus rings`,`Responsive mobile menu`],ignoreChecks:[]};function ae({resultsRef:e,executionResult:t,executing:r=!1,runningRecipeName:i=``,onRunQuickCheck:o,severityFilter:s,setSeverityFilter:c,copiedChecklist:l,copyFindingsChecklist:u,onFixFindings:d,onSendToSlack:f,onCreateGitHubIssue:p,slackSending:m=!1,ghIssueSending:h=!1,showRawJson:g,rules:_,isDemoFallback:ee=!1,savingRules:v=!1,onSaveRawRules:y}){let[b,te]=(0,a.useState)(null),[ne,re]=(0,a.useState)(!1),[ie,ae]=(0,a.useState)(()=>JSON.stringify(_,null,2)),[C,w]=(0,a.useState)(``),[T,oe]=(0,a.useState)(!1);(0,a.useEffect)(()=>{ae(JSON.stringify(_,null,2)),w(``)},[_]);let E=t?.securityReport,D=t?.designSystemLock,O=(()=>{let e=E?.findings??[];return s===`all`?e:s===`high`?e.filter(e=>e.severity===`critical`||e.severity===`high`):e.filter(e=>e.severity===s)})();function se(){if(!E)return;let e=[`Fix the following UI and security findings (current score: ${E.score}/100):`,``,...E.findings.length>0?E.findings.slice(0,15).map((e,t)=>{let n=e.path?`${e.path}${e.line?`:${e.line}`:``}`:`project`;return`${t+1}. [${e.severity.toUpperCase()}] ${n} — ${e.message}${e.action?` (Fix: ${e.action})`:``}`}):[`No issues found.`],``,`Keep existing layouts, keyboard navigation, and component boundaries intact.`];navigator.clipboard?.writeText(e.join(`
2
+ `)).catch(()=>{}),re(!0),window.setTimeout(()=>re(!1),1800)}async function k(){w(``);let e;try{e=JSON.parse(ie)}catch(e){w(`Invalid JSON: ${e.message}`);return}!e||typeof e!=`object`||Array.isArray(e)?w(`Rules must be a JSON object (for example { "version": 1, "routes": ["/"] }).`):y&&await y(e)}return(0,x.jsxs)(x.Fragment,{children:[r&&!t&&(0,x.jsxs)(`section`,{className:`wb-wf-audit-results wb-wf-live-banner`,role:`status`,"aria-live":`polite`,children:[(0,x.jsx)(`span`,{className:`wb-wf-live-dot`,"aria-hidden":`true`}),(0,x.jsxs)(`strong`,{children:[`Running `,i||`workflow`,`…`]}),(0,x.jsx)(`span`,{children:`Scanning files and collecting results locally.`})]}),t&&E&&(0,x.jsxs)(`section`,{ref:e,className:`wb-wf-audit-results`,"aria-label":`Workflow audit results`,children:[t.visualDiff?.status===`git-required`&&(0,x.jsxs)(`div`,{className:`wb-wf-git-notice`,role:`status`,children:[(0,x.jsx)(`span`,{children:t.visualDiff.summary}),o&&(0,x.jsx)(`button`,{type:`button`,className:`button subtle`,disabled:r,onClick:o,children:`Run Quick Check`})]}),(0,x.jsxs)(`div`,{className:`wb-quick-audit-head`,children:[(0,x.jsxs)(`div`,{className:`wb-quick-audit-title`,children:[(0,x.jsxs)(`h3`,{children:[`Audit Results · `,E.score,`/100`]}),(0,x.jsx)(`span`,{className:`wb-wf-scanner-pill ${t.gatePassed?`status-ready`:`status-optional`}`,children:t.gatePassed?`Passed`:`Needs fixes`}),(0,x.jsxs)(`span`,{className:`wb-quick-audit-meta`,children:[E.filesAudited,` files · `,t.totalDurationMs,`ms`]})]}),(0,x.jsxs)(`div`,{className:`wb-quick-audit-actions`,children:[(0,x.jsx)(`div`,{className:`wb-wf-sev-filters`,role:`group`,"aria-label":`Filter issues`,children:[`all`,`high`,`medium`,`low`].map(e=>(0,x.jsx)(`button`,{type:`button`,className:`wb-focus-pill`,"aria-pressed":s===e,onClick:()=>c(e),children:e===`all`?`All (${E.findings.length})`:e.charAt(0).toUpperCase()+e.slice(1)},e))}),(0,x.jsx)(`button`,{type:`button`,className:`button subtle`,onClick:se,children:ne?`Copied prompt`:`Copy AI fix prompt`}),(0,x.jsx)(`button`,{type:`button`,className:`button subtle`,onClick:()=>void u(),children:l?`Copied!`:`Copy checklist`}),f&&(0,x.jsxs)(`button`,{type:`button`,className:`button subtle`,disabled:m,onClick:()=>void f(),children:[(0,x.jsx)(n,{name:`slack`}),m?`Sending…`:`Send to Slack`]}),p&&(0,x.jsxs)(`button`,{type:`button`,className:`button subtle`,disabled:h,onClick:()=>void p(),children:[(0,x.jsx)(n,{name:`github`}),h?`Creating…`:`GitHub Issue`]}),d&&(E.findings.length>0||(D?.violationCount??0)>0)&&(0,x.jsx)(`button`,{type:`button`,className:`button primary`,onClick:()=>d(t),children:`Fix in Workspace`})]})]}),O.length>0?(0,x.jsx)(`ul`,{className:`wb-quick-audit-list`,children:O.slice(0,14).map((e,n)=>{let r=`${e.code}-${e.path??n}-${n}`,i=e.path?`${e.path}${e.line?`:${e.line}`:``}`:`project`,a=`Fix [${e.code}] (${e.severity}) in ${i}: ${e.message}.${e.action?` Recommended fix: ${e.action}`:``}`;return(0,x.jsxs)(`li`,{children:[(0,x.jsx)(`span`,{className:`wb-sev-badge sev-${e.severity}`,children:e.severity}),(0,x.jsxs)(`div`,{className:`wb-quick-audit-item-body`,children:[(0,x.jsx)(`strong`,{children:e.message}),(0,x.jsxs)(`small`,{children:[e.path?(0,x.jsxs)(`code`,{translate:`no`,children:[e.path,e.line?`:${e.line}`:``]}):null,e.path&&e.action?` · `:``,e.action]})]}),(0,x.jsxs)(`div`,{className:`wb-quick-audit-item-actions`,children:[(0,x.jsx)(`button`,{type:`button`,className:`text-button`,onClick:()=>{navigator.clipboard?.writeText(a).catch(()=>{}),te(r),window.setTimeout(()=>te(e=>e===r?null:e),1800)},children:b===r?`Copied`:`Copy AI prompt`}),d&&(0,x.jsx)(`button`,{type:`button`,className:`button subtle wb-fix-one-btn`,onClick:()=>d({...t,securityReport:{...E,findings:[e]}}),children:`Fix`})]})]},r)})}):(0,x.jsx)(`p`,{className:`wb-quick-audit-clean`,children:E.findings.length===0?`No security or accessibility issues found.`:`No ${s} issues found.`})]}),g&&(0,x.jsxs)(`section`,{className:`wb-wf-json-drawer`,"aria-label":`Edit .ui-workflow.json`,children:[(0,x.jsxs)(`div`,{className:`wb-wf-json-head`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`strong`,{children:`.ui-workflow.json`}),(0,x.jsx)(`span`,{className:`wb-wf-focus-note`,children:`Controls which pages, folders, and rules Studio and the CLI check.`})]}),(0,x.jsxs)(`div`,{className:`wb-wf-actions`,children:[(0,x.jsx)(`button`,{type:`button`,className:`text-button`,onClick:()=>{ae(JSON.stringify(S,null,2)),w(``)},children:`Use starter rules`}),(0,x.jsx)(`button`,{type:`button`,className:`button subtle`,onClick:()=>{try{let e=JSON.parse(ie);ae(JSON.stringify(e,null,2)),w(``)}catch(e){w(`Invalid JSON: ${e.message}`)}},children:`Format`}),(0,x.jsx)(`button`,{type:`button`,className:`button subtle`,onClick:()=>{navigator.clipboard?.writeText(ie).catch(()=>{}),oe(!0),window.setTimeout(()=>oe(!1),1600)},children:T?`Copied`:`Copy`}),y&&(0,x.jsx)(`button`,{type:`button`,className:`button primary`,disabled:v,onClick:()=>void k(),children:v?`Saving…`:ee?`Apply rules`:`Save to .ui-workflow.json`})]})]}),C&&(0,x.jsx)(`p`,{className:`error-box`,role:`alert`,children:C}),(0,x.jsx)(`textarea`,{className:`wb-wf-json-editor`,"aria-label":`Edit .ui-workflow.json rules`,spellCheck:!1,rows:12,value:ie,onChange:e=>{ae(e.target.value),C&&w(``)}})]})]})}function C({project:e,picking:t,onBrowse:r,onOpenRepositories:l,onOpenComposer:f,onFixFindings:p,onRulesSaved:h}){let[g,ee]=(0,a.useState)(null),[v,S]=(0,a.useState)({version:1,pinnedSkills:[`impeccable`,`security-review`,`coderabbit-code-review`],mustPreserve:[`Main navigation`,`Keyboard focus`],designGuide:`impeccable`,includeDirs:[`src`,`app`,`components`],routes:[`/`],framework:`auto`,ignoreChecks:[],ignoreSelectors:[],interactions:[`Check main button click and keyboard focus`]}),[C,w]=(0,a.useState)(`ui`),[T,oe]=(0,a.useState)(72),[E,D]=(0,a.useState)(16384),[O,se]=(0,a.useState)(.25),[k,ce]=(0,a.useState)(!1),[A,le]=(0,a.useState)(.1),[ue,de]=(0,a.useState)(!0),[fe,pe]=(0,a.useState)(`desktop`),[me,he]=(0,a.useState)(`after`),[ge,_e]=(0,a.useState)(null),[j,ve]=(0,a.useState)(!1),[M,N]=(0,a.useState)([]),[P,F]=(0,a.useState)([]),[I,L]=(0,a.useState)(`default`),[R,z]=(0,a.useState)([]),[B,V]=(0,a.useState)(!1),[H,ye]=(0,a.useState)(``),[be,xe]=(0,a.useState)(`after-ai`),[Se,Ce]=(0,a.useState)(``),[we,Te]=(0,a.useState)(!1),[Ee,De]=(0,a.useState)(``),[Oe,U]=(0,a.useState)(o),W=(0,a.useRef)(Oe);W.current=Oe;let[ke,Ae]=(0,a.useState)({}),[je,G]=(0,a.useState)(`node-security-gate`),[Me,Ne]=(0,a.useState)(!0),[Pe,Fe]=(0,a.useState)(`settings`),[K,Ie]=(0,a.useState)(!1),[Le,Re]=(0,a.useState)(.8),[ze,Be]=(0,a.useState)({x:16,y:20}),[Ve,He]=(0,a.useState)(!1),[Ue,We]=(0,a.useState)(null),[Ge,Ke]=(0,a.useState)(!1),[qe,Je]=(0,a.useState)(`all`),[Ye,Xe]=(0,a.useState)(!1),[Ze,Qe]=(0,a.useState)(!1),[$e,et]=(0,a.useState)(!1),[q,tt]=(0,a.useState)(`recipes`),[nt,rt]=(0,a.useState)(null),[it,at]=(0,a.useState)(``),ot=(0,a.useRef)(null),[st,ct]=(0,a.useState)(null),[lt,ut]=(0,a.useState)(null),[dt,ft]=(0,a.useState)(!1),[pt,mt]=(0,a.useState)(!1),[ht,gt]=(0,a.useState)([]),[_t,vt]=(0,a.useState)(null),[yt,bt]=(0,a.useState)(!0),[xt,St]=(0,a.useState)(!1),[J,Ct]=(0,a.useState)(!1),[wt,Tt]=(0,a.useState)(null),[Y,Et]=(0,a.useState)(null),[Dt,X]=(0,a.useState)(``),[Ot,Z]=(0,a.useState)(``),[kt,At]=(0,a.useState)(``),[jt,Mt]=(0,a.useState)(``),[Nt,Pt]=(0,a.useState)(``),[Ft,It]=(0,a.useState)(``),[Lt,Rt]=(0,a.useState)(``),zt=(0,a.useRef)(null),Bt=(0,a.useRef)(null),Vt=(0,a.useRef)(null),Ht=(0,a.useRef)(null),Ut=(0,a.useRef)(!1),Wt=(0,a.useRef)([]),Q=(0,a.useCallback)((e,t)=>{let n=zt.current;if(!n)return;let r=n.getBoundingClientRect();if(!r.width||!r.height)return;let i=e??W.current,a=t??(Wt.current.length?Wt.current:null),o=a?a.map(e=>i[e]).filter(e=>!!e):Object.values(i);if(!o.length)return;let s=Math.min(...o.map(e=>e.x))-10,c=Math.min(...o.map(e=>e.y))-16,l=Math.max(...o.map(e=>e.x+216+16)),u=Math.max(...o.map(e=>e.y+114+24)),d=Math.max(420,l-s),f=Math.max(240,u-c),p=y(Math.min((r.width-44)/d,(r.height-44)/f),.3,1.05),m=Math.floor(p*100)/100,h=d*m,g=f*m,_=h+44>r.width?Math.round(22-s*m):Math.round((r.width-h)/2-s*m),ee=g+44>r.height?Math.round(22-c*m):Math.round((r.height-g)/2-c*m);Re(m),Be({x:_,y:ee})},[]),Gt=(0,a.useCallback)(async()=>{bt(!0),Z(``);try{let t=e?`?project=${encodeURIComponent(e)}`:``,n=await i(`/api/workflow-graph${t}`);ee(n),S(n.rules),gt(n.runHistory??[]),vt(n.runTrend??null),w(n.canvasState.profile||`ui`),oe(n.canvasState.minScoreThreshold||72),D(n.canvasState.maxOutputTokens||16384),se(n.canvasState.maxCostUsd||.25),ce(!!n.canvasState.strictDesignSystem),le(typeof n.canvasState.visualDiffThreshold==`number`?n.canvasState.visualDiffThreshold:.1);let r=n.canvasState.customNodes??[],a=n.canvasState.hiddenCoreNodes??[];N(r),F(a),L(n.canvasState.activeWorkflowId||`default`),z(n.canvasState.savedWorkflows??[]),Ae(n.canvasState.enabledNodes??{});let o=b(a,r),c=n.canvasState.positions??{},l=c[`node-delivery`]?.x,u=c[`node-visual-qa`]?.x,d=typeof l==`number`&&typeof u==`number`&&l-u<285,f={...o};if(!d)for(let[e,t]of Object.entries(c))t&&Number.isFinite(t.x)&&Number.isFinite(t.y)&&(f[e]={x:y(Math.round(t.x),12,s-216-12),y:y(Math.round(t.y),12,454)});W.current=f,U(f),i(`/api/cloud-sync/status`).then(_e).catch(()=>{}),requestAnimationFrame(()=>Q(f))}catch(e){Z(e.message)}finally{bt(!1)}},[e,Q]);(0,a.useEffect)(()=>{Gt()},[Gt]),(0,a.useEffect)(()=>{if(q!==`graph`)return;let e=window.setTimeout(()=>Q(),70);return()=>window.clearTimeout(e)},[q,K,Me,B,Q]),(0,a.useEffect)(()=>{if(q!==`graph`)return;let e=zt.current;if(!e||typeof ResizeObserver>`u`)return;let t=0,n=new ResizeObserver(()=>{cancelAnimationFrame(t),t=requestAnimationFrame(()=>Q())});return n.observe(e),()=>{cancelAnimationFrame(t),n.disconnect()}},[q,Q]),(0,a.useEffect)(()=>{if(!K){delete document.documentElement.dataset.wfFullscreen;return}document.documentElement.dataset.wfFullscreen=`true`;let e=document.documentElement.style.overflow;document.documentElement.style.overflow=`hidden`;let t=e=>{e.key===`Escape`&&Ie(!1)};return window.addEventListener(`keydown`,t),()=>{delete document.documentElement.dataset.wfFullscreen,document.documentElement.style.overflow=e,window.removeEventListener(`keydown`,t)}},[K]);let $=(0,a.useMemo)(()=>{let e=new Set(P),t=(g?.nodes?.length?g.nodes:m).filter(t=>!e.has(t.id)),n=g?.toolchain.scanners?g.toolchain.scanners.filter(e=>e.status===`ready`).length:3,r=C!==`ui`,i=C===`audit`,a=t.map(e=>{let t=Oe[e.id]??o[e.id]??{x:48,y:204},a=e.id===`node-context`&&r?!1:e.locked?!0:ke[e.id]!==!1,s=wt===e.id?`running`:Y?.nodeResults?.[e.id]?.status??`ready`,l=d.has(e.id);if(e.id===`node-intake`)return{...e,category:`Step 1`,title:`Project`,position:t,enabled:a,status:s,removable:!1,subtitle:`${c(v.framework,g?.detectedStack)} · ${_(C)}`};if(e.id===`node-context`){let n=v.designGuide===`hallmark`?`Editorial`:v.designGuide===`project`?`Keep mine`:`Modern default`;return{...e,category:`Step 2`,title:`Design Style`,position:t,enabled:a,status:s,removable:l,subtitle:r?`Skipped for ${_(C)}`:`${n} · ${(v.pinnedSkills??[]).length} guides`}}if(e.id===`node-scope`)return{...e,category:`Step 3`,title:`Files & Rules`,position:t,enabled:a,status:s,removable:l,subtitle:`${(v.includeDirs??[]).length||`All`} folders · ${(v.mustPreserve??[]).length} kept`};if(e.id===`node-engine`){let n=E<=8192?`Light`:E>=32768?`Deep`:`Balanced`;return{...e,category:`Step 4`,title:`AI Helper`,position:t,enabled:a,status:s,removable:!1,subtitle:i?`Skipped during local audit`:`${n} · $${O.toFixed(2)} cap`}}if(e.id===`node-visual-qa`){let n=Y?.designSystemLock,r=Y?.visualDiff,i=A<=.06?`Strict`:A>=.16?`Relaxed`:`Normal`;return{...e,category:`Step 5`,title:`Visual Check`,position:t,enabled:a,status:s,removable:l,subtitle:n?`${n.compliant?`Components clean`:`${n.violationCount} component issue(s)`}${r?.viewports?.length?` · ${r.maxMismatchPercentage}% diff`:``}`:`${i} diff · ${k?`Strict`:`Standard`}`}}if(e.id===`node-security-gate`){let r=Y?.securityReport?.score;return{...e,category:`Step 6`,title:`Security & Code Audit`,position:t,enabled:a,status:s,removable:l,subtitle:r===void 0?`${n} local checks · Pass at ${T}`:`Score ${r}/100 · ${Y?.securityReport.findings.length??0} issue(s)`}}return{...e,category:`Step 7`,title:`Review & Apply`,position:t,enabled:a,status:s,removable:!1,subtitle:`Preview first · 1-click Undo`}}),s=M.map(e=>{let t=Oe[e.id]??{x:e.stage===`before-ai`?360:e.stage===`delivery`?1296:984,y:448},n=wt===e.id?`running`:Y?.nodeResults?.[e.id]?.status??`ready`,r=e.kind===`figma`?e.config.figmaUrl?`Linked · ${e.config.figmaMode||`Tokens`}`:`Add Figma link in settings`:e.kind===`playwright`?`${(e.config.viewports??[`desktop`,`mobile`]).join(`, `)}`:e.kind===`git`?`Branch "${e.config.branchPrefix||`studio/`}"`:e.subtitle||e.config.notes||`Ready`;return{id:e.id,type:e.stage===`before-ai`?`context`:e.stage===`delivery`?`output`:`verification`,category:e.kind===`figma`||e.kind===`git`||e.kind===`references`?`Connector`:e.kind===`custom`?`Custom`:`Module`,title:e.title,subtitle:r,position:t,enabled:e.enabled,locked:!1,status:n,metrics:[],config:e.config,custom:e,removable:!0}});return[...a,...s]},[g,P,M,Oe,ke,wt,Y,v,C,E,O,T,k,A]);Wt.current=$.map(e=>e.id);let Kt=(0,a.useMemo)(()=>{let e=new Set($.map(e=>e.id)),t=[],n=$.filter(e=>e.id===`node-context`||e.id===`node-scope`||e.custom?.stage===`before-ai`),r=$.filter(e=>e.id===`node-visual-qa`||e.id===`node-security-gate`||e.custom?.stage===`after-ai`),i=$.filter(e=>e.custom?.stage===`delivery`);if(n.length>0)for(let e of n){let n=e.id===`node-context`?`style`:e.id===`node-scope`?`files`:e.custom?.kind===`figma`?`figma`:`input`;t.push({id:`e-in-${e.id}`,source:`node-intake`,target:e.id,label:n}),t.push({id:`e-${e.id}-ai`,source:e.id,target:`node-engine`,label:`guide`})}else e.has(`node-intake`)&&e.has(`node-engine`)&&t.push({id:`e-in-ai`,source:`node-intake`,target:`node-engine`,label:`files`});if(r.length>0)for(let e of r){let n=e.id===`node-visual-qa`?`preview`:e.id===`node-security-gate`?`code`:e.custom?.kind===`playwright`?`browser`:e.custom?.kind===`seo`?`seo`:e.custom?.kind===`graphify`?`map`:`check`;t.push({id:`e-ai-${e.id}`,source:`node-engine`,target:e.id,label:n}),t.push({id:`e-${e.id}-del`,source:e.id,target:`node-delivery`,label:e.id===`node-security-gate`?`audit`:`pass`})}else e.has(`node-engine`)&&e.has(`node-delivery`)&&t.push({id:`e-ai-del`,source:`node-engine`,target:`node-delivery`,label:`diff`});for(let e of i)t.push({id:`e-del-${e.id}`,source:`node-delivery`,target:e.id,label:e.custom?.kind===`git`?`branch`:`next`});return t.filter(t=>e.has(t.source)&&e.has(t.target))},[$]),qt=$.find(e=>e.id===je)??$[0]??null;(0,a.useEffect)(()=>{let e=e=>e instanceof HTMLElement&&!!e.closest(`input, textarea, select, [contenteditable="true"]`),t=e=>e instanceof HTMLElement&&!!e.closest(`button, a, [role="button"], [role="tab"]`),n=n=>{if(!(n.defaultPrevented||document.querySelector(`dialog[open], .settings-page`))){if(n.key===`Escape`){if(lt){n.preventDefault(),ut(null);return}if(B){n.preventDefault(),V(!1);return}if(Ge){n.preventDefault(),Ke(!1);return}K&&(n.preventDefault(),Ie(!1))}else q===`graph`&&(n.key===` `&&!e(n.target)&&!t(n.target)?(n.preventDefault(),Ut.current=!0):e(n.target)||((n.ctrlKey||n.metaKey)&&(n.key===`0`||n.code===`Numpad0`)?(n.preventDefault(),Q()):n.metaKey||n.ctrlKey||n.altKey||(n.key===`0`||n.code===`Numpad0`?(n.preventDefault(),Q()):n.key===`+`||n.key===`=`||n.code===`NumpadAdd`?(n.preventDefault(),Re(e=>y(Number((e+.1).toFixed(2)),.3,1.5))):n.key===`-`||n.key===`_`||n.code===`NumpadSubtract`?(n.preventDefault(),Re(e=>y(Number((e-.1).toFixed(2)),.3,1.5))):n.key.toLowerCase()===`a`?(n.preventDefault(),V(e=>!e)):(n.key===`Delete`||n.key===`Backspace`)&&qt?.removable&&(n.preventDefault(),en(qt.id)))))}},r=e=>{e.key===` `&&(Ut.current=!1)},i=()=>{Ut.current=!1};return window.addEventListener(`keydown`,n),window.addEventListener(`keyup`,r),window.addEventListener(`blur`,i),()=>{window.removeEventListener(`keydown`,n),window.removeEventListener(`keyup`,r),window.removeEventListener(`blur`,i)}},[B,lt,Q,K,qt,Ge,q,P,M]);let[Jt,Yt]=(0,a.useState)(null);function Xt(e){Yt(e),xe(e),V(!0)}function Zt(e,t){let n=`mod-${e.kind}-${Date.now().toString(36).slice(-4)}`,r=t??Jt??e.stage,i={id:n,kind:e.kind,stage:r,title:e.title,subtitle:e.desc.slice(0,48),enabled:!0,connectorId:e.connectorId,moduleId:e.moduleId,config:{...e.defaultConfig}},a=[...M,i],o=b(P,a);N(a),W.current=o,U(o),G(n),Ne(!0),Fe(`settings`),V(!1),Yt(null),X(`Added "${e.title}" to your workflow.`),requestAnimationFrame(()=>Q(o))}function Qt(){let e=H.trim();if(!e)return;let t=`custom-${Date.now().toString(36).slice(-5)}`,n={id:t,kind:`custom`,stage:be,title:e.slice(0,48),subtitle:Se.trim().slice(0,60)||`Custom workflow step`,enabled:!0,config:{notes:Se.trim()}},r=[...M,n],i=b(P,r);N(r),W.current=i,U(i),G(t),Ne(!0),Fe(`settings`),ye(``),Ce(``),V(!1),X(`Created custom step "${n.title}".`),requestAnimationFrame(()=>Q(i))}function $t(e){let t=P.filter(t=>t!==e),n=b(t,M);F(t),W.current=n,U(n),G(e),V(!1),requestAnimationFrame(()=>Q(n))}function en(e){if(d.has(e)){let t=Array.from(new Set([...P,e])),n=b(t,M);F(t),W.current=n,U(n),je===e&&G(`node-intake`),X(`Removed step from workflow (you can add it back anytime from + Add Step).`),requestAnimationFrame(()=>Q(n));return}let t=M.find(t=>t.id===e);if(!t)return;let n=M.filter(t=>t.id!==e),r=b(P,n);N(n),W.current=r,U(r),je===e&&G(`node-security-gate`),X(`Removed "${t.title}" from workflow.`),requestAnimationFrame(()=>Q(r))}function tn(e,t){N(n=>n.map(n=>n.id===e?{...n,...t}:n))}function nn(e,t){N(n=>n.map(n=>n.id===e?{...n,config:{...n.config,...t}}:n))}function rn(e,t){let n=M.map(n=>n.id===e?{...n,stage:t}:n),r=b(P,n);N(n),W.current=r,U(r),requestAnimationFrame(()=>Q(r))}function an(e){let t=u.find(t=>t.id===e);if(t){let e=b(t.hiddenCoreNodes,t.customNodes);L(t.id),w(t.profile),F(t.hiddenCoreNodes),N(t.customNodes),W.current=e,U(e),Et(null),X(`Loaded "${t.name}" workflow.`),requestAnimationFrame(()=>Q(e));return}let n=R.find(t=>t.id===e);if(n){let e={...b(n.hiddenCoreNodes,n.customNodes),...n.positions??{}};L(n.id),w(n.profile),F(n.hiddenCoreNodes),N(n.customNodes),Ae(n.enabledNodes??{}),W.current=e,U(e),Et(null),X(`Switched to "${n.name}".`),requestAnimationFrame(()=>Q(e))}}async function on(){let e=Ee.trim();if(!e)return;let t=`wf-${Date.now().toString(36).slice(-5)}`,n={id:t,name:e.slice(0,48),profile:C,customNodes:M,hiddenCoreNodes:P,enabledNodes:ke,positions:W.current,updatedAt:new Date().toISOString()},r=[...R,n].slice(-12);z(r),L(t),De(``),Te(!1),await vn(!1,{activeWorkflowId:t,savedWorkflows:r}),X(`Created and saved workflow "${n.name}".`)}async function sn(){let e=R.find(e=>e.id===I)?.name??u.find(e=>e.id===I)?.name??`Workflow`,t=`wf-${Date.now().toString(36).slice(-5)}`,n={id:t,name:`${e} (Copy)`.slice(0,48),profile:C,customNodes:M.map(e=>({...e,config:{...e.config}})),hiddenCoreNodes:[...P],enabledNodes:{...ke},positions:{...W.current},updatedAt:new Date().toISOString()},r=[...R,n].slice(-12);z(r),L(t),await vn(!1,{activeWorkflowId:t,savedWorkflows:r}),X(`Duplicated workflow as "${n.name}".`)}async function cn(){let e=R.find(e=>e.id===I);if(!e)return;let t=R.filter(t=>t.id!==e.id),n=u[0],r=b(n.hiddenCoreNodes,n.customNodes);z(t),L(n.id),w(n.profile),F(n.hiddenCoreNodes),N(n.customNodes),Ae({}),W.current=r,U(r),Et(null),await vn(!1,{activeWorkflowId:n.id,savedWorkflows:t}),X(`Deleted workflow "${e.name}".`),requestAnimationFrame(()=>Q(r))}function ln(e,t){e.button!==0||Ut.current||e.target.closest(`button, input, label`)||(e.stopPropagation(),e.currentTarget.setPointerCapture(e.pointerId),G(t.id),We(t.id),Vt.current={nodeId:t.id,startX:e.clientX,startY:e.clientY,origX:t.position.x,origY:t.position.y,zoomAtStart:Le})}function un(e){let t=Vt.current;if(!t)return;let n=(e.clientX-t.startX)/t.zoomAtStart,r=(e.clientY-t.startY)/t.zoomAtStart,i=y(Math.round(t.origX+n),12,s-216-12),a=y(Math.round(t.origY+r),12,454);U(e=>({...e,[t.nodeId]:{x:i,y:a}}))}function dn(e){Vt.current&&(e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),Vt.current=null,We(null))}function fn(e){let t=e.button===1,n=e.button===0&&Ut.current;(e.button===0||t)&&(t||n||!e.target.closest(`.wb-wf-node-card, .wb-wf-dock, .wb-wf-minimap, .wb-wf-add-drawer`))&&(t&&e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),He(!0),Ht.current={startX:e.clientX,startY:e.clientY,origX:ze.x,origY:ze.y})}function pn(e){let t=Ht.current;t&&Be({x:y(Math.round(t.origX+(e.clientX-t.startX)),-s+180,740),y:y(Math.round(t.origY+(e.clientY-t.startY)),-440,440)})}function mn(e){Ht.current&&(e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),Ht.current=null,He(!1))}function hn(e){if(e.ctrlKey||e.metaKey){e.preventDefault();let t=e.deltaY>0?-.08:.08,n=y(Number((Le+t).toFixed(2)),.34,1.5);if(n===Le)return;let r=zt.current;if(r){let t=r.getBoundingClientRect(),i=e.clientX-t.left,a=e.clientY-t.top,o=(i-ze.x)/Le,c=(a-ze.y)/Le;Be({x:y(Math.round(i-o*n),-s+180,740),y:y(Math.round(a-c*n),-440,440)})}Re(n)}else if(e.shiftKey||Math.abs(e.deltaX)>2){e.preventDefault();let t=e.shiftKey&&Math.abs(e.deltaX)<2?e.deltaY:e.deltaX,n=e.shiftKey&&Math.abs(e.deltaX)<2?0:e.deltaY;Be(e=>({x:y(Math.round(e.x-t),-s+180,740),y:y(Math.round(e.y-n),-440,440)}))}}function gn(e){G(e.id),Ne(!0);let t=zt.current;if(!t)return;let n=t.getBoundingClientRect();Be({x:Math.round(n.width/2-(e.position.x+108)*Le),y:Math.round(n.height/2-(e.position.y+57)*Le)})}function _n(){let e=b(P,M);W.current=e,U(e),requestAnimationFrame(()=>Q(e))}async function vn(t,n){St(!0),Z(``),X(``);try{let r=n?.rules??v,a=n?.activeWorkflowId??I,o=(n?.savedWorkflows??R).map(e=>e.id===a?{...e,profile:C,customNodes:M,hiddenCoreNodes:P,enabledNodes:ke,positions:W.current,updatedAt:new Date().toISOString()}:e),s=await i(`/api/workflow-graph`,{project:e||g?.project||``,writeToProject:t,rules:r,canvasState:{profile:C,minScoreThreshold:T,maxOutputTokens:E,maxCostUsd:O,strictDesignSystem:k,visualDiffThreshold:A,positions:W.current,enabledNodes:ke,customNodes:M,hiddenCoreNodes:P,activeWorkflowId:a,savedWorkflows:o}});ee(s),S(s.rules),z(s.canvasState.savedWorkflows??o),h?.(s.rules),X(s.wroteProjectFile?`Saved rules to .ui-workflow.json.`:`Saved workflow rules.`)}catch(e){Z(e.message)}finally{St(!1)}}async function yn(t,n){Ct(!0),n?(rt(n.id),at(n.name)):at(`Project Audit`),Z(``),X(``),window.requestAnimationFrame(()=>{ot.current?.scrollIntoView({behavior:`smooth`,block:`nearest`})});let r=$.filter(e=>e.enabled).map(e=>e.id);try{for(let e of r.slice(0,3))Tt(e),await new Promise(e=>window.setTimeout(e,50));Tt(t||`node-security-gate`);let a=await i(`/api/workflow-graph/execute`,{project:e||g?.project||``,recipeId:n?.id,profile:n?.profile??C,minScoreThreshold:n?.minScoreThreshold??T,strictDesignSystem:typeof n?.strictDesignSystem==`boolean`?n.strictDesignSystem:k,visualDiffThreshold:A,enableExternalScanners:!0,enabledNodes:ke,hiddenCoreNodes:P,customNodes:M,routes:v.routes});Et(a),a.runHistory&&gt(a.runHistory),a.runTrend!==void 0&&vt(a.runTrend??null),Tt(null),a.visualDiff?.viewports?.length&&pe(a.visualDiff.viewports[0].name);let o=$.some(e=>e.id===`node-security-gate`)?`node-security-gate`:$[0]?.id??`node-intake`;G(t||o),Ne(!0),Fe(`output`);let s=a.visualDiff?.status===`git-required`?a.visualDiff.summary:``;X(s?`${a.recipeName||`Workflow`} finished in ${a.totalDurationMs}ms · ${s}`:`${a.recipeName||`Workflow`} finished in ${a.totalDurationMs}ms · Score ${a.securityReport.score}/100 · ${a.securityReport.findings.length} ${a.securityReport.findings.length===1?`issue`:`issues`}.`),window.requestAnimationFrame(()=>{(ot.current??Bt.current)?.scrollIntoView({behavior:`smooth`,block:`start`})})}catch(e){Tt(null),Z(e.message),window.requestAnimationFrame(()=>{ot.current?.scrollIntoView({behavior:`smooth`,block:`nearest`})})}finally{Ct(!1),rt(null),at(``)}}async function bn(t,n=!1){ft(!0),Z(``),X(``);try{let r=await i(`/api/workflow-graph/export-yaml`,{project:e||g?.project||``,recipeId:t,minScoreThreshold:T,routes:v.routes,writeToProject:n,approved:n});ut(r),r.wrotePath&&X(`Saved GitHub Action to ${r.relativePath}.`)}catch(e){Z(e.message)}finally{ft(!1)}}function xn(e){S(t=>{let n=t.pinnedSkills??[],r=n.includes(e)?n.filter(t=>t!==e):[...n,e].slice(0,12);return{...t,pinnedSkills:r}})}function Sn(e){S(t=>{let n=t.mustPreserve??[],r=n.includes(e)?n.filter(t=>t!==e):[...n,e].slice(0,16);return{...t,mustPreserve:r}})}async function Cn(t){ve(!0),Z(``),X(``);try{if(t===`push`){let t=await i(`/api/cloud-sync/push`,{project:e||g?.project||``,rules:v,canvasState:{profile:C,minScoreThreshold:T,maxOutputTokens:E,maxCostUsd:O,strictDesignSystem:k,visualDiffThreshold:A,positions:W.current,enabledNodes:ke,customNodes:M,hiddenCoreNodes:P,activeWorkflowId:I,savedWorkflows:R}});X(`Synced workflow and ${t.syncedRunsCount} run ${t.syncedRunsCount===1?`summary`:`summaries`} to cloud.`)}else{let t=await i(`/api/cloud-sync/pull`,{project:e||g?.project||``});await Gt(),X(t.hasCloudPreset?`Pulled latest workflow settings from cloud.`:`Connected to cloud sync (no saved workflow yet).`)}let n=await i(`/api/cloud-sync/status`);_e(n)}catch(e){Z(e.message)}finally{ve(!1)}}async function wn(){let e=Y?.securityReport;if(!e)return;let t=[`# Audit Checklist — Score ${e.score}/100 (${e.filesAudited} files)`,``,...e.findings.length?e.findings.map(e=>`- [ ] [${e.severity.toUpperCase()}] ${e.path?`\`${e.path}${e.line?`:${e.line}`:``}\` — `:``}${e.message}${e.action?` (${e.action})`:``}`):[`- [x] No issues found.`]];await navigator.clipboard?.writeText(t.join(`
3
+ `)).catch(()=>{}),Xe(!0),window.setTimeout(()=>Xe(!1),1800)}async function Tn(){let e=Y?.securityReport;if(e){Qe(!0),Z(``),X(``);try{let t=await i(`/api/connectors/slack/send`,{title:`${Y.recipeName||`UI Check`} — ${kn}`,project:kn,score:e.score,findingsCount:e.findings.length,summary:Y.gatePassed?`All enabled checks passed.`:`Action required before shipping.`,findings:e.findings.slice(0,5)});X(`Sent audit summary to Slack (${t.channelLabel}).`)}catch(e){Z(e.message)}finally{Qe(!1)}}}async function En(){let t=Y?.securityReport;if(t){et(!0),Z(``),X(``);try{let n=[`## UI Design Studio Audit — ${kn}`,`- **Score:** ${t.score}/100 (${Y.gatePassed?`Passed`:`Needs fixes`})`,`- **Files checked:** ${t.filesAudited}`,``,`### Findings`,...t.findings.length>0?t.findings.slice(0,12).map(e=>{let t=e.path?`\`${e.path}${e.line?`:${e.line}`:``}\` — `:``;return`- [ ] **[${e.severity.toUpperCase()}]** ${t}${e.message}${e.action?` (${e.action})`:``}`}):[`- [x] No issues found.`]].join(`
4
+ `),r=await i(`/api/connectors/github-issues/status${e||g?.project?`?project=${encodeURIComponent(e||g?.project||``)}`:``}`),a=await i(`/api/connectors/github-issues/create`,{project:e||g?.project||``,title:`UI Audit (${t.score}/100) — ${t.findings.length} issue${t.findings.length===1?``:`s`} in ${kn}`,bodyText:n,submitDirectly:!!r.directCreateAvailable});a.created&&a.issueUrl?(X(`Created GitHub issue #${a.issueNumber} in ${a.repo}.`),window.open(a.issueUrl,`_blank`,`noopener,noreferrer`)):a.openInBrowserUrl&&(window.open(a.openInBrowserUrl,`_blank`,`noopener,noreferrer`),X(a.hint||`Opened pre-filled GitHub issue for ${a.repo}.`))}catch(e){Z(e.message)}finally{et(!1)}}}let Dn=e=>{let t=e.moduleId?g?.integrations?.modules.find(t=>t.id===e.moduleId):void 0,n=e.connectorId?g?.integrations?.connectors.find(t=>t.id===e.connectorId):void 0;return n?.status===`connected`||n?.status===`configured`?`Connected`:t?.installed?`Installed`:!e.moduleId&&!e.connectorId?`Built-in`:`Available`},On=Y?.securityReport,kn=g?.isDemoFallback?`Sample project`:g?.project?.split(/[\\/]/).pop()??`Project`,An=g?.recipes?.length?g.recipes:te;return(0,x.jsxs)(`section`,{className:`wb-workflow-visualizer ${K?`is-fullscreen`:``}`,"aria-label":`Workflow Studio`,children:[(0,x.jsxs)(`header`,{className:`wb-wf-header`,children:[(0,x.jsx)(`div`,{className:`wb-wf-title-block`,children:(0,x.jsxs)(`div`,{className:`wb-wf-title-row`,children:[(0,x.jsx)(`h2`,{className:`page-reveal page-reveal--title`,children:`Workflow Studio`}),(0,x.jsxs)(`div`,{className:`wb-wf-mode-switch`,role:`group`,"aria-label":`Workflow Studio view`,children:[(0,x.jsx)(`button`,{type:`button`,"aria-pressed":q===`recipes`,onClick:()=>tt(`recipes`),children:`Automations`}),(0,x.jsx)(`button`,{type:`button`,"aria-pressed":q===`graph`,onClick:()=>{tt(`graph`),requestAnimationFrame(()=>Q())},children:`Visual Editor`})]}),(0,x.jsxs)(`span`,{className:`wb-wf-target-pill`,title:g?.project??``,children:[(0,x.jsx)(n,{name:`folder`}),kn]}),r&&(0,x.jsx)(`button`,{type:`button`,className:`button subtle wb-pill-btn`,disabled:t||J,onClick:()=>void r(),children:t?`Opening…`:`Browse`}),l&&(0,x.jsx)(`button`,{type:`button`,className:`text-button wb-pill-text-btn`,disabled:t||J,onClick:l,children:`Repositories`})]})}),(0,x.jsxs)(`div`,{className:`wb-wf-actions page-reveal page-reveal--controls`,children:[q===`graph`&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`button`,{type:`button`,className:`button subtle`,"aria-pressed":B,onClick:()=>{Yt(null),V(e=>!e)},children:[(0,x.jsx)(n,{name:`plus`}),`Add Step`]}),(0,x.jsx)(`button`,{type:`button`,className:`button subtle`,"aria-pressed":Me,onClick:()=>Ne(e=>!e),children:Me?`Hide Panel`:`Edit Step`})]}),(0,x.jsx)(`button`,{type:`button`,className:`button subtle`,disabled:xt||yt,onClick:()=>void vn(!g?.isDemoFallback),children:xt?`Saving…`:g?.isDemoFallback?`Save Preset`:`Save Rules`}),ge?.active&&(0,x.jsx)(`button`,{type:`button`,className:`button subtle`,disabled:j||yt,onClick:()=>void Cn(`push`),children:j?`Syncing…`:`Cloud Sync`}),K&&On&&(0,x.jsxs)(`button`,{type:`button`,className:`button subtle`,onClick:()=>Bt.current?.scrollIntoView({behavior:`smooth`,block:`start`}),children:[`↓ Results (`,On.findings.length,`)`]}),(0,x.jsx)(`button`,{type:`button`,className:`button primary`,disabled:J||yt,onClick:()=>void yn(),children:J?`Running…`:`Run Audit`}),(0,x.jsxs)(`button`,{type:`button`,className:`button subtle wb-wf-fullscreen-action`,"aria-pressed":K,onClick:()=>Ie(e=>!e),title:K?`Exit Fullscreen (Esc)`:`Fullscreen`,children:[(0,x.jsx)(n,{name:K?`close`:`external`}),K?`Exit Fullscreen`:`Fullscreen`]})]})]}),Ot&&(0,x.jsx)(`p`,{className:`error-box`,role:`alert`,children:Ot}),Dt&&(0,x.jsx)(`p`,{className:`connection-success`,role:`status`,children:Dt}),q===`recipes`&&(0,x.jsxs)(`div`,{className:`wb-wf-recipes-layout page-reveal page-reveal--content`,children:[(0,x.jsxs)(`div`,{className:`wb-wf-recipes-intro`,children:[(0,x.jsx)(`p`,{children:`Ready-to-run checks for pull requests, branches, and live pages. Runs locally with no API key needed.`}),(0,x.jsx)(`div`,{className:`wb-wf-connector-strip`,"aria-label":`Workflow options`,children:(0,x.jsx)(`button`,{type:`button`,className:`text-button`,"aria-pressed":Ge,onClick:()=>Ke(e=>!e),children:Ge?`Hide project rules`:`Edit project rules`})})]}),(0,x.jsx)(`div`,{className:`wb-wf-recipes-grid`,role:`list`,"aria-label":`Workflow automations`,children:An.map(e=>{let t=nt===e.id,r=ne[e.id]??{icon:`graph`,tag:`Check`};return(0,x.jsxs)(`article`,{role:`listitem`,className:`wb-wf-recipe-card ${t?`is-running`:``}`,children:[(0,x.jsxs)(`div`,{className:`wb-wf-recipe-top`,children:[(0,x.jsxs)(`div`,{className:`wb-wf-recipe-head`,children:[(0,x.jsx)(`span`,{className:`wb-wf-recipe-icon`,"aria-hidden":`true`,children:(0,x.jsx)(n,{name:r.icon})}),(0,x.jsx)(`span`,{className:`wb-wf-metric-chip`,children:r.tag})]}),(0,x.jsx)(`h3`,{className:`wb-wf-recipe-title`,children:e.name}),(0,x.jsx)(`p`,{className:`wb-wf-recipe-desc`,children:e.shortDesc}),(0,x.jsxs)(`p`,{className:`wb-wf-recipe-meta`,children:[(0,x.jsx)(`span`,{children:e.trigger}),(0,x.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,x.jsx)(`span`,{children:e.outcome})]})]}),t&&(0,x.jsxs)(`p`,{className:`wb-wf-card-running`,role:`status`,"aria-live":`polite`,children:[(0,x.jsx)(`span`,{className:`wb-wf-live-dot`,"aria-hidden":`true`}),`Running `,e.name,` locally…`]}),(0,x.jsxs)(`div`,{className:`wb-wf-recipe-actions`,children:[(0,x.jsx)(`button`,{type:`button`,className:`button primary`,disabled:J||yt,onClick:()=>void yn(void 0,e),children:t?`Running…`:`Run now`}),(0,x.jsxs)(`div`,{className:`wb-wf-recipe-secondary`,children:[(0,x.jsx)(`button`,{type:`button`,className:`button subtle`,onClick:()=>{navigator.clipboard?.writeText(e.cliCommand).catch(()=>{}),ct(e.id),X(`Copied: ${e.cliCommand}`),window.setTimeout(()=>ct(t=>t===e.id?null:t),1800)},children:st===e.id?`Copied`:`Copy CLI`}),(0,x.jsx)(`button`,{type:`button`,className:`text-button`,disabled:dt,onClick:()=>void bn(e.id,!1),children:`GitHub YAML`})]})]})]},e.id)})}),(0,x.jsxs)(`div`,{ref:ot,className:`wb-wf-live-anchor`,"aria-live":`polite`,children:[J&&(0,x.jsxs)(`div`,{className:`wb-wf-live-banner`,role:`status`,children:[(0,x.jsx)(`span`,{className:`wb-wf-live-dot`,"aria-hidden":`true`}),(0,x.jsxs)(`strong`,{children:[`Running `,it||`workflow`,`…`]}),(0,x.jsx)(`span`,{children:`Checking your local project files now.`})]}),!J&&Y?.visualDiff?.status===`git-required`&&(0,x.jsxs)(`div`,{className:`wb-wf-git-notice`,role:`status`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`strong`,{children:Y.visualDiff.summary}),(0,x.jsxs)(`p`,{children:[`Branch comparison needs a local Git repository with a base branch (such as`,` `,(0,x.jsx)(`code`,{children:`main`}),`). You can run a full local check right now without Git.`]})]}),(0,x.jsx)(`button`,{type:`button`,className:`button primary`,disabled:J||yt,onClick:()=>{yn(void 0,An.find(e=>e.id===`quick-check`))},children:`Run Quick Check`})]})]}),Y?.steps&&Y.steps.length>0&&(0,x.jsxs)(`div`,{className:`wb-wf-history-card`,"aria-label":`Last workflow run steps`,children:[(0,x.jsxs)(`div`,{className:`wb-wf-history-head`,children:[(0,x.jsxs)(`h3`,{children:[`Last Run · `,Y.recipeName||`Check`,` (`,Y.totalDurationMs,`ms)`]}),(0,x.jsx)(`span`,{className:`wb-wf-scanner-pill ${Y.gatePassed?`status-ready`:`status-optional`}`,children:Y.gatePassed?`Passed`:`Needs fixes`})]}),(0,x.jsx)(`div`,{className:`wb-wf-step-summary-bar`,children:Y.steps.filter(e=>e.status!==`skipped`).map(e=>(0,x.jsxs)(`span`,{className:`wb-wf-step-pill status-${e.status}`,title:e.summary,children:[e.status===`passed`?`✓`:e.status===`failed`?`×`:`!`,` `,e.title,` (`,e.durationMs,`ms)`]},e.id))})]}),lt&&(0,x.jsxs)(`section`,{className:`wb-wf-yaml-drawer`,"aria-label":`Exported GitHub Actions workflow`,children:[(0,x.jsxs)(`div`,{className:`wb-wf-yaml-head`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`strong`,{children:lt.relativePath}),lt.wrotePath&&(0,x.jsx)(`span`,{className:`wb-wf-focus-note`,children:`Saved to project`})]}),(0,x.jsxs)(`div`,{className:`wb-wf-actions`,children:[(0,x.jsx)(`button`,{type:`button`,className:`button subtle`,onClick:()=>{navigator.clipboard?.writeText(lt.yaml).catch(()=>{}),mt(!0),window.setTimeout(()=>mt(!1),1800)},children:pt?`Copied YAML`:`Copy YAML`}),!g?.isDemoFallback&&(0,x.jsx)(`button`,{type:`button`,className:`button primary`,disabled:dt,onClick:()=>void bn(lt.recipeId,!0),children:`Save to project`}),(0,x.jsx)(`button`,{type:`button`,className:`text-button`,onClick:()=>ut(null),children:`Close`})]})]}),(0,x.jsx)(`pre`,{translate:`no`,children:lt.yaml})]}),ht.length>0&&(0,x.jsxs)(`section`,{className:`wb-wf-history-card`,"aria-label":`Recent workflow runs`,children:[(0,x.jsxs)(`div`,{className:`wb-wf-history-head`,children:[(0,x.jsx)(`h3`,{children:`Recent Runs & Score Trend`}),_t&&(0,x.jsxs)(`div`,{className:`wb-wf-trend-stats`,children:[(0,x.jsxs)(`span`,{children:[`Latest: `,(0,x.jsxs)(`strong`,{children:[_t.latestScore,`/100`]}),_t.scoreDelta===0?``:` (${_t.scoreDelta>0?`+`:``}${_t.scoreDelta})`]}),(0,x.jsxs)(`span`,{children:[`Pass rate: `,(0,x.jsxs)(`strong`,{children:[_t.passRate,`%`]})]}),(0,x.jsxs)(`span`,{children:[`Avg time: `,(0,x.jsxs)(`strong`,{children:[_t.avgDurationMs,`ms`]})]}),(0,x.jsxs)(`span`,{children:[`Runs: `,(0,x.jsx)(`strong`,{children:_t.runCount})]})]})]}),(0,x.jsx)(`ul`,{className:`wb-wf-history-list`,children:ht.slice(0,6).map(e=>(0,x.jsxs)(`li`,{children:[(0,x.jsxs)(`div`,{className:`wb-wf-history-main`,children:[(0,x.jsx)(`span`,{className:`wb-wf-scanner-pill ${e.gatePassed?`status-ready`:`status-optional`}`,children:e.gatePassed?`Passed`:`Review`}),(0,x.jsx)(`strong`,{children:e.recipeName}),(0,x.jsxs)(`span`,{children:[`Score `,e.score,`/100`,e.scoreDelta===0?``:` (${e.scoreDelta>0?`+`:``}${e.scoreDelta})`]})]}),(0,x.jsxs)(`div`,{className:`wb-wf-history-meta`,children:[(0,x.jsxs)(`span`,{children:[e.findingsCount,` issue`,e.findingsCount===1?``:`s`]}),(0,x.jsxs)(`span`,{children:[e.durationMs,`ms`]}),(0,x.jsx)(`span`,{children:new Date(e.executedAt).toLocaleTimeString()})]})]},e.id))})]})]}),q===`graph`&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`wb-wf-toolbar page-reveal page-reveal--controls`,children:[(0,x.jsxs)(`div`,{className:`wb-wf-preset-picker`,children:[(0,x.jsx)(`label`,{className:`sr-only`,htmlFor:`wf-preset-select`,children:`Active workflow`}),(0,x.jsxs)(`select`,{id:`wf-preset-select`,className:`wb-wf-preset-select`,value:I,onChange:e=>an(e.target.value),children:[(0,x.jsx)(`optgroup`,{label:`Starter Workflows`,children:u.map(e=>(0,x.jsx)(`option`,{value:e.id,children:e.name},e.id))}),R.length>0&&(0,x.jsx)(`optgroup`,{label:`Your Saved Workflows`,children:R.map(e=>(0,x.jsx)(`option`,{value:e.id,children:e.name},e.id))})]}),(0,x.jsx)(`button`,{type:`button`,className:`button subtle wb-pill-btn`,onClick:()=>Te(e=>!e),children:`+ New`}),(0,x.jsx)(`button`,{type:`button`,className:`text-button wb-pill-text-btn`,disabled:xt||yt,onClick:()=>void sn(),title:`Save a copy of the current workflow`,children:`Duplicate`}),R.some(e=>e.id===I)&&(0,x.jsx)(`button`,{type:`button`,className:`text-button wb-pill-text-btn wb-wf-delete-btn`,disabled:xt||yt,onClick:()=>void cn(),title:`Delete this saved workflow`,children:`Delete`})]}),(0,x.jsx)(`div`,{className:`wb-wf-focus-segmented`,role:`group`,"aria-label":`Workflow focus`,children:[{id:`ui`,label:`UI Redesign`},{id:`audit`,label:`Quick Audit`},{id:`seo`,label:`SEO & AI`},{id:`architecture`,label:`Project Map`}].map(e=>{let t=e.id===`seo`?C===`seo`||C===`ai-search`:C===e.id;return(0,x.jsx)(`button`,{type:`button`,className:`wb-focus-pill`,"aria-pressed":t,onClick:()=>w(e.id),children:e.label},e.id)})}),(0,x.jsxs)(`div`,{className:`wb-wf-quiet-tools`,children:[(0,x.jsx)(`button`,{type:`button`,className:`text-button`,"aria-pressed":Ge,onClick:()=>Ke(e=>!e),children:Ge?`Hide JSON`:`Rules JSON`}),ge?.active&&(0,x.jsx)(`button`,{type:`button`,className:`text-button`,disabled:j||yt,onClick:()=>void Cn(`pull`),children:`Pull cloud`})]})]}),we&&(0,x.jsxs)(`div`,{className:`wb-wf-new-bar`,role:`region`,"aria-label":`Create new workflow`,children:[(0,x.jsx)(`input`,{type:`text`,value:Ee,placeholder:`Name your new workflow (e.g. Figma + Playwright QA)…`,onChange:e=>De(e.target.value),onKeyDown:e=>{e.key===`Enter`&&on()}}),(0,x.jsx)(`button`,{type:`button`,className:`button primary`,disabled:!Ee.trim()||xt,onClick:()=>void on(),children:`Create Workflow`}),(0,x.jsx)(`button`,{type:`button`,className:`text-button`,onClick:()=>Te(!1),children:`Cancel`})]}),(0,x.jsxs)(`div`,{className:`wb-wf-split ${Me&&qt?`has-inspector`:``} page-reveal page-reveal--content`,children:[(0,x.jsx)(re,{viewportRef:zt,isPanning:Ve,pan:ze,zoom:Le,setZoom:Re,addPanelOpen:B,setAddPanelOpen:V,addStageHint:Jt,setAddStageHint:Yt,onOpenAddForStage:Xt,hiddenCoreNodes:P,newStepTitle:H,setNewStepTitle:ye,newStepStage:be,setNewStepStage:xe,newStepNotes:Se,setNewStepNotes:Ce,integrationStatusFor:Dn,addModuleNode:Zt,restoreCoreNode:$t,addCustomStepNode:Qt,edges:Kt,liveNodes:$,selectedNode:qt,selectedNodeId:je,setSelectedNodeId:G,setInspectorOpen:Ne,draggingNodeId:Ue,activeExecNode:wt,executing:J,executionResult:Y,profile:C,onViewportPointerDown:fn,onViewportPointerMove:pn,onViewportPointerUp:mn,onViewportWheel:hn,onNodePointerDown:ln,onNodePointerMove:un,onNodePointerUp:dn,executeWorkflowPipeline:yn,updateCustomNode:tn,toggleCoreNodeEnabled:e=>Ae(t=>({...t,[e]:t[e]===!1})),removeNode:en,fitCanvasToView:()=>Q(),tidyLayout:_n,centerOnNode:gn}),Me&&qt&&(0,x.jsx)(`div`,{className:`wb-wf-inspector-side`,children:(0,x.jsx)(ie,{selectedNode:qt,inspectorTab:Pe,setInspectorTab:Fe,executing:J,executionResult:Y,graph:g,rules:v,setRules:S,profile:C,setProfile:w,minScoreThreshold:T,setMinScoreThreshold:oe,maxOutputTokens:E,setMaxOutputTokens:D,maxCostUsd:O,setMaxCostUsd:se,strictDesignSystem:k,setStrictDesignSystem:ce,visualDiffThreshold:A,setVisualDiffThreshold:le,showDiffBoxes:ue,setShowDiffBoxes:de,activeDiffViewport:fe,setActiveDiffViewport:pe,diffImageLayer:me,setDiffImageLayer:he,newRouteInput:kt,setNewRouteInput:At,newDirInput:jt,setNewDirInput:Mt,newPreserveInput:Nt,setNewPreserveInput:Pt,newInteractionInput:Ft,setNewInteractionInput:It,newIgnoreCheckInput:Lt,setNewIgnoreCheckInput:Rt,setError:Z,removeNode:en,updateCustomNode:tn,updateCustomNodeConfig:nn,moveCustomNodeStage:rn,toggleSkill:xn,toggleKeepItem:Sn,executeWorkflowPipeline:yn,onOpenComposer:f})})]})]}),(0,x.jsx)(ae,{resultsRef:Bt,executionResult:Y,executing:J,runningRecipeName:it,onRunQuickCheck:()=>{yn(void 0,An.find(e=>e.id===`quick-check`))},severityFilter:qe,setSeverityFilter:Je,copiedChecklist:Ye,copyFindingsChecklist:wn,onFixFindings:p,onSendToSlack:Tn,onCreateGitHubIssue:En,slackSending:Ze,ghIssueSending:$e,showRawJson:Ge,rules:v,isDemoFallback:!!g?.isDemoFallback,savingRules:xt,onSaveRawRules:e=>vn(!g?.isDemoFallback,{rules:e})})]})}export{C as default};
@@ -1 +1 @@
1
- import{t as e}from"./react-vendor-CH5vucNG.js";import{u as t}from"./index-KY1IHp8L.js";var n=e();function r(e){return e===`google`?`Google`:e===`github`?`GitHub`:`GitLab`}function i(e){return e===`onetap`?`Google One Tap`:e===`firebase`?`Google Account`:e===`device`?`GitHub Sign-In`:e===`oauth`?`Browser SSO`:e===`cli`?`Local Git sign-in`:`Personal access token`}function a(e){if(!e||e.plan===`local-beta`)return`Local Beta (Free)`;let t=e.plan===`pro`?`Pro`:e.plan===`team`?`Team`:`Free`;return e.status&&e.status!==`none`?`${t} · ${e.status}`:t}function o({provider:e}){return e===`google`?(0,n.jsxs)(`svg`,{className:`wb-provider-glyph`,viewBox:`0 0 24 24`,fill:`none`,stroke:`none`,"aria-hidden":`true`,children:[(0,n.jsx)(`path`,{fill:`#4285F4`,d:`M23.49 12.27c0-.79-.07-1.54-.2-2.27H12v4.51h6.47a5.54 5.54 0 0 1-2.4 3.63v3h3.88c2.27-2.09 3.54-5.17 3.54-8.87Z`}),(0,n.jsx)(`path`,{fill:`#34A853`,d:`M12 24c3.24 0 5.95-1.07 7.94-2.91l-3.88-3c-1.07.72-2.45 1.15-4.06 1.15-3.12 0-5.77-2.11-6.72-4.96H1.28v3.09A12 12 0 0 0 12 24Z`}),(0,n.jsx)(`path`,{fill:`#FBBC05`,d:`M5.28 14.28A7.2 7.2 0 0 1 4.9 12c0-.79.14-1.56.38-2.28V6.63H1.28a12 12 0 0 0 0 10.74l4-3.09Z`}),(0,n.jsx)(`path`,{fill:`#EA4335`,d:`M12 4.77c1.76 0 3.34.61 4.58 1.8l3.44-3.44C17.95 1.19 15.24 0 12 0A12 12 0 0 0 1.28 6.63l4 3.09C6.23 6.88 8.88 4.77 12 4.77Z`})]}):e===`github`?(0,n.jsx)(`svg`,{className:`wb-provider-glyph`,viewBox:`0 0 24 24`,fill:`none`,stroke:`none`,"aria-hidden":`true`,children:(0,n.jsx)(`path`,{fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`,d:`M12 .5C5.65.5.5 5.65.5 12c0 5.08 3.29 9.39 7.86 10.91.58.11.79-.25.79-.56v-2.16c-3.2.7-3.87-1.36-3.87-1.36-.52-1.33-1.28-1.69-1.28-1.69-1.05-.72.08-.7.08-.7 1.16.08 1.77 1.19 1.77 1.19 1.03 1.76 2.7 1.25 3.36.96.1-.75.4-1.25.73-1.54-2.55-.29-5.24-1.28-5.24-5.68 0-1.25.45-2.28 1.19-3.08-.12-.29-.52-1.46.11-3.04 0 0 .97-.31 3.17 1.18a11 11 0 0 1 5.77 0c2.2-1.49 3.17-1.18 3.17-1.18.63 1.58.23 2.75.11 3.04.74.8 1.19 1.83 1.19 3.08 0 4.41-2.69 5.39-5.25 5.67.41.36.78 1.06.78 2.13v3.16c0 .31.21.67.8.56A11.51 11.51 0 0 0 23.5 12C23.5 5.65 18.35.5 12 .5Z`})}):(0,n.jsxs)(`svg`,{className:`wb-provider-glyph`,viewBox:`0 0 24 24`,fill:`none`,stroke:`none`,"aria-hidden":`true`,children:[(0,n.jsx)(`path`,{fill:`#E24329`,d:`M12 22.13 15.88 10.19H8.12L12 22.13Z`}),(0,n.jsx)(`path`,{fill:`#FC6D26`,d:`M12 22.13 8.12 10.19H2.68L12 22.13Z`}),(0,n.jsx)(`path`,{fill:`#FCA326`,d:`M2.68 10.19 1.5 13.82a.82.82 0 0 0 .3.92L12 22.13 2.68 10.19Z`}),(0,n.jsx)(`path`,{fill:`#E24329`,d:`M2.68 10.19h5.44L5.78 3a.41.41 0 0 0-.78 0l-2.32 7.19Z`}),(0,n.jsx)(`path`,{fill:`#FC6D26`,d:`M12 22.13 15.88 10.19h5.44L12 22.13Z`}),(0,n.jsx)(`path`,{fill:`#FCA326`,d:`m21.32 10.19 1.18 3.63a.82.82 0 0 1-.3.92L12 22.13l9.32-11.94Z`}),(0,n.jsx)(`path`,{fill:`#E24329`,d:`M21.32 10.19h-5.44L18.22 3a.41.41 0 0 1 .78 0l2.32 7.19Z`})]})}function s({account:e,auth:o,cloudSync:s,busy:c,onClose:l,onVerifyConnection:u,onSignOut:d,onToggleCloudSync:f,onPushCloudSync:p,onPullCloudSync:m}){return(0,n.jsxs)(`div`,{className:`wb-account-card`,children:[(0,n.jsxs)(`div`,{className:`wb-account-identity`,children:[(0,n.jsx)(`span`,{className:`wb-account-avatar`,"aria-hidden":`true`,children:t(e)}),(0,n.jsxs)(`div`,{className:`wb-account-copy`,children:[(0,n.jsx)(`strong`,{children:e.name||e.username}),(0,n.jsxs)(`small`,{children:[`@`,e.username,e.email?` · ${e.email}`:``]})]}),(0,n.jsx)(`span`,{className:`wb-account-badge`,children:r(e.provider)})]}),(0,n.jsxs)(`dl`,{className:`wb-account-meta`,children:[(0,n.jsxs)(`div`,{children:[(0,n.jsx)(`dt`,{children:`Plan`}),(0,n.jsx)(`dd`,{children:a(e.subscription)})]}),(0,n.jsxs)(`div`,{children:[(0,n.jsx)(`dt`,{children:`Sign-in method`}),(0,n.jsx)(`dd`,{children:i(e.method)})]}),(0,n.jsxs)(`div`,{children:[(0,n.jsx)(`dt`,{children:`Session storage`}),(0,n.jsx)(`dd`,{children:e.remembered?`System credential vault`:`Memory only (this session)`})]}),e.baseUrl&&(0,n.jsxs)(`div`,{children:[(0,n.jsx)(`dt`,{children:`Host`}),(0,n.jsx)(`dd`,{children:e.baseUrl})]})]}),(0,n.jsxs)(`div`,{className:`wb-account-card-actions`,children:[(0,n.jsx)(`button`,{type:`button`,className:`button subtle`,disabled:c,onClick:()=>void u(),children:`Verify Connection`}),(0,n.jsx)(`button`,{type:`button`,className:`button subtle`,disabled:c,onClick:l,children:`Done`}),(0,n.jsx)(`button`,{type:`button`,className:`button primary`,disabled:c,onClick:d,children:c?`Signing out…`:`Sign out`})]}),s&&(0,n.jsxs)(`div`,{className:`wb-account-cloud-sync`,role:`region`,"aria-label":`Cloud workspace sync`,children:[(0,n.jsxs)(`div`,{className:`wb-account-cloud-head`,children:[(0,n.jsxs)(`div`,{children:[(0,n.jsx)(`strong`,{children:`Cloud workspace sync`}),(0,n.jsxs)(`small`,{children:[`Optional cross-device sync for `,(0,n.jsx)(`code`,{children:`.ui-workflow.json`}),` presets, workflow layouts, and redacted run summaries only. Local paths, source code, and API keys are never uploaded.`]})]}),(0,n.jsxs)(`label`,{className:`wb-cloud-toggle`,children:[(0,n.jsx)(`input`,{type:`checkbox`,checked:s.optIn,disabled:c||!s.optIn&&!s.eligible,onChange:e=>void f(e.target.checked)}),(0,n.jsx)(`span`,{children:s.optIn?`Enabled`:`Off`})]})]}),!s.eligible&&(0,n.jsx)(`p`,{className:`wb-wf-note`,children:s.cloudSyncEntitlement?`Sign in with Google to activate cloud workspace sync.`:`Sign in with Google on an eligible plan to enable cloud workspace sync.`}),s.active&&(0,n.jsxs)(`div`,{className:`wb-account-cloud-actions`,children:[(0,n.jsx)(`button`,{type:`button`,className:`button subtle`,disabled:c,onClick:()=>void p(),children:`Push presets`}),(0,n.jsx)(`button`,{type:`button`,className:`button subtle`,disabled:c,onClick:()=>void m(),children:`Pull & refresh`}),s.lastSyncedAt&&(0,n.jsxs)(`small`,{children:[`Last synced: `,new Date(s.lastSyncedAt).toLocaleTimeString()]})]})]}),o?.plans&&o.plans.length>0&&(0,n.jsxs)(`details`,{className:`wb-account-plans-details`,children:[(0,n.jsxs)(`summary`,{children:[`Plan & workspace limits (`,a(e.subscription),`)`]}),(0,n.jsx)(`div`,{className:`wb-account-plans-grid`,children:o.plans.filter(e=>e.id!==`local-beta`).map(t=>{let r=e.subscription?.plan===t.id||e.subscription?.plan===`local-beta`&&t.id===`free`;return(0,n.jsxs)(`div`,{className:`wb-plan-tier-card ${r?`is-current`:``}`,children:[(0,n.jsxs)(`div`,{className:`wb-plan-tier-head`,children:[(0,n.jsx)(`strong`,{children:t.name}),(0,n.jsx)(`span`,{children:t.priceLabel})]}),(0,n.jsxs)(`ul`,{children:[(0,n.jsxs)(`li`,{children:[`Up to `,(t.maxOutputTokens/1024).toFixed(0),`k output tokens / run`]}),(0,n.jsx)(`li`,{children:`4-stage security & quality review`}),(0,n.jsx)(`li`,{children:t.cloudSync?`Cloud workspace sync`:`Local storage`}),t.enterpriseSso&&(0,n.jsx)(`li`,{children:`Team SSO & shared project rules`})]})]},t.id)})})]})]})}export{r as a,a as i,o as n,i as r,s as t};
1
+ import{t as e}from"./react-vendor-CH5vucNG.js";import{u as t}from"./index-Dp8CdAV4.js";var n=e();function r(e){return e===`google`?`Google`:e===`github`?`GitHub`:`GitLab`}function i(e){return e===`onetap`?`Google One Tap`:e===`firebase`?`Google Account`:e===`device`?`GitHub Sign-In`:e===`oauth`?`Browser SSO`:e===`cli`?`Local Git sign-in`:`Personal access token`}function a(e){if(!e||e.plan===`local-beta`)return`Local Beta (Free)`;let t=e.plan===`pro`?`Pro`:e.plan===`team`?`Team`:`Free`;return e.status&&e.status!==`none`?`${t} · ${e.status}`:t}function o({provider:e}){return e===`google`?(0,n.jsxs)(`svg`,{className:`wb-provider-glyph`,viewBox:`0 0 24 24`,fill:`none`,stroke:`none`,"aria-hidden":`true`,children:[(0,n.jsx)(`path`,{fill:`#4285F4`,d:`M23.49 12.27c0-.79-.07-1.54-.2-2.27H12v4.51h6.47a5.54 5.54 0 0 1-2.4 3.63v3h3.88c2.27-2.09 3.54-5.17 3.54-8.87Z`}),(0,n.jsx)(`path`,{fill:`#34A853`,d:`M12 24c3.24 0 5.95-1.07 7.94-2.91l-3.88-3c-1.07.72-2.45 1.15-4.06 1.15-3.12 0-5.77-2.11-6.72-4.96H1.28v3.09A12 12 0 0 0 12 24Z`}),(0,n.jsx)(`path`,{fill:`#FBBC05`,d:`M5.28 14.28A7.2 7.2 0 0 1 4.9 12c0-.79.14-1.56.38-2.28V6.63H1.28a12 12 0 0 0 0 10.74l4-3.09Z`}),(0,n.jsx)(`path`,{fill:`#EA4335`,d:`M12 4.77c1.76 0 3.34.61 4.58 1.8l3.44-3.44C17.95 1.19 15.24 0 12 0A12 12 0 0 0 1.28 6.63l4 3.09C6.23 6.88 8.88 4.77 12 4.77Z`})]}):e===`github`?(0,n.jsx)(`svg`,{className:`wb-provider-glyph`,viewBox:`0 0 24 24`,fill:`none`,stroke:`none`,"aria-hidden":`true`,children:(0,n.jsx)(`path`,{fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`,d:`M12 .5C5.65.5.5 5.65.5 12c0 5.08 3.29 9.39 7.86 10.91.58.11.79-.25.79-.56v-2.16c-3.2.7-3.87-1.36-3.87-1.36-.52-1.33-1.28-1.69-1.28-1.69-1.05-.72.08-.7.08-.7 1.16.08 1.77 1.19 1.77 1.19 1.03 1.76 2.7 1.25 3.36.96.1-.75.4-1.25.73-1.54-2.55-.29-5.24-1.28-5.24-5.68 0-1.25.45-2.28 1.19-3.08-.12-.29-.52-1.46.11-3.04 0 0 .97-.31 3.17 1.18a11 11 0 0 1 5.77 0c2.2-1.49 3.17-1.18 3.17-1.18.63 1.58.23 2.75.11 3.04.74.8 1.19 1.83 1.19 3.08 0 4.41-2.69 5.39-5.25 5.67.41.36.78 1.06.78 2.13v3.16c0 .31.21.67.8.56A11.51 11.51 0 0 0 23.5 12C23.5 5.65 18.35.5 12 .5Z`})}):(0,n.jsxs)(`svg`,{className:`wb-provider-glyph`,viewBox:`0 0 24 24`,fill:`none`,stroke:`none`,"aria-hidden":`true`,children:[(0,n.jsx)(`path`,{fill:`#E24329`,d:`M12 22.13 15.88 10.19H8.12L12 22.13Z`}),(0,n.jsx)(`path`,{fill:`#FC6D26`,d:`M12 22.13 8.12 10.19H2.68L12 22.13Z`}),(0,n.jsx)(`path`,{fill:`#FCA326`,d:`M2.68 10.19 1.5 13.82a.82.82 0 0 0 .3.92L12 22.13 2.68 10.19Z`}),(0,n.jsx)(`path`,{fill:`#E24329`,d:`M2.68 10.19h5.44L5.78 3a.41.41 0 0 0-.78 0l-2.32 7.19Z`}),(0,n.jsx)(`path`,{fill:`#FC6D26`,d:`M12 22.13 15.88 10.19h5.44L12 22.13Z`}),(0,n.jsx)(`path`,{fill:`#FCA326`,d:`m21.32 10.19 1.18 3.63a.82.82 0 0 1-.3.92L12 22.13l9.32-11.94Z`}),(0,n.jsx)(`path`,{fill:`#E24329`,d:`M21.32 10.19h-5.44L18.22 3a.41.41 0 0 1 .78 0l2.32 7.19Z`})]})}function s({account:e,auth:o,cloudSync:s,busy:c,onClose:l,onVerifyConnection:u,onSignOut:d,onToggleCloudSync:f,onPushCloudSync:p,onPullCloudSync:m}){return(0,n.jsxs)(`div`,{className:`wb-account-card`,children:[(0,n.jsxs)(`div`,{className:`wb-account-identity`,children:[(0,n.jsx)(`span`,{className:`wb-account-avatar`,"aria-hidden":`true`,children:t(e)}),(0,n.jsxs)(`div`,{className:`wb-account-copy`,children:[(0,n.jsx)(`strong`,{children:e.name||e.username}),(0,n.jsxs)(`small`,{children:[`@`,e.username,e.email?` · ${e.email}`:``]})]}),(0,n.jsx)(`span`,{className:`wb-account-badge`,children:r(e.provider)})]}),(0,n.jsxs)(`dl`,{className:`wb-account-meta`,children:[(0,n.jsxs)(`div`,{children:[(0,n.jsx)(`dt`,{children:`Plan`}),(0,n.jsx)(`dd`,{children:a(e.subscription)})]}),(0,n.jsxs)(`div`,{children:[(0,n.jsx)(`dt`,{children:`Sign-in method`}),(0,n.jsx)(`dd`,{children:i(e.method)})]}),(0,n.jsxs)(`div`,{children:[(0,n.jsx)(`dt`,{children:`Session storage`}),(0,n.jsx)(`dd`,{children:e.remembered?`System credential vault`:`Memory only (this session)`})]}),e.baseUrl&&(0,n.jsxs)(`div`,{children:[(0,n.jsx)(`dt`,{children:`Host`}),(0,n.jsx)(`dd`,{children:e.baseUrl})]})]}),(0,n.jsxs)(`div`,{className:`wb-account-card-actions`,children:[(0,n.jsx)(`button`,{type:`button`,className:`button subtle`,disabled:c,onClick:()=>void u(),children:`Verify Connection`}),(0,n.jsx)(`button`,{type:`button`,className:`button subtle`,disabled:c,onClick:l,children:`Done`}),(0,n.jsx)(`button`,{type:`button`,className:`button primary`,disabled:c,onClick:d,children:c?`Signing out…`:`Sign out`})]}),s&&(0,n.jsxs)(`div`,{className:`wb-account-cloud-sync`,role:`region`,"aria-label":`Cloud workspace sync`,children:[(0,n.jsxs)(`div`,{className:`wb-account-cloud-head`,children:[(0,n.jsxs)(`div`,{children:[(0,n.jsx)(`strong`,{children:`Cloud workspace sync`}),(0,n.jsxs)(`small`,{children:[`Optional cross-device sync for `,(0,n.jsx)(`code`,{children:`.ui-workflow.json`}),` presets, workflow layouts, and redacted run summaries only. Local paths, source code, and API keys are never uploaded.`]})]}),(0,n.jsxs)(`label`,{className:`wb-cloud-toggle`,children:[(0,n.jsx)(`input`,{type:`checkbox`,checked:s.optIn,disabled:c||!s.optIn&&!s.eligible,onChange:e=>void f(e.target.checked)}),(0,n.jsx)(`span`,{children:s.optIn?`Enabled`:`Off`})]})]}),!s.eligible&&(0,n.jsx)(`p`,{className:`wb-wf-note`,children:s.cloudSyncEntitlement?`Sign in with Google to activate cloud workspace sync.`:`Sign in with Google on an eligible plan to enable cloud workspace sync.`}),s.active&&(0,n.jsxs)(`div`,{className:`wb-account-cloud-actions`,children:[(0,n.jsx)(`button`,{type:`button`,className:`button subtle`,disabled:c,onClick:()=>void p(),children:`Push presets`}),(0,n.jsx)(`button`,{type:`button`,className:`button subtle`,disabled:c,onClick:()=>void m(),children:`Pull & refresh`}),s.lastSyncedAt&&(0,n.jsxs)(`small`,{children:[`Last synced: `,new Date(s.lastSyncedAt).toLocaleTimeString()]})]})]}),o?.plans&&o.plans.length>0&&(0,n.jsxs)(`details`,{className:`wb-account-plans-details`,children:[(0,n.jsxs)(`summary`,{children:[`Plan & workspace limits (`,a(e.subscription),`)`]}),(0,n.jsx)(`div`,{className:`wb-account-plans-grid`,children:o.plans.filter(e=>e.id!==`local-beta`).map(t=>{let r=e.subscription?.plan===t.id||e.subscription?.plan===`local-beta`&&t.id===`free`;return(0,n.jsxs)(`div`,{className:`wb-plan-tier-card ${r?`is-current`:``}`,children:[(0,n.jsxs)(`div`,{className:`wb-plan-tier-head`,children:[(0,n.jsx)(`strong`,{children:t.name}),(0,n.jsx)(`span`,{children:t.priceLabel})]}),(0,n.jsxs)(`ul`,{children:[(0,n.jsxs)(`li`,{children:[`Up to `,(t.maxOutputTokens/1024).toFixed(0),`k output tokens / run`]}),(0,n.jsx)(`li`,{children:`4-stage security & quality review`}),(0,n.jsx)(`li`,{children:t.cloudSync?`Cloud workspace sync`:`Local storage`}),t.enterpriseSso&&(0,n.jsx)(`li`,{children:`Team SSO & shared project rules`})]})]},t.id)})})]})]})}export{r as a,a as i,o as n,i as r,s as t};