@kidlat-dakila/flightplan 0.1.5 → 0.1.6

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.
Files changed (55) hide show
  1. package/backend/main.js +286 -53
  2. package/frontend/assets/_branchId-CPb8-qBw.js +1 -0
  3. package/frontend/assets/{_branchId-BctD9BVI.js → _branchId-LiwHskkW.js} +1 -1
  4. package/frontend/assets/{_id-DS2_k7mD.js → _id-BDFgPH36.js} +1 -1
  5. package/frontend/assets/_id-DlHylI1F.js +1 -0
  6. package/frontend/assets/agents-BGNiGYQQ.js +1 -0
  7. package/frontend/assets/{agents-Cg-w99VB.js → agents-DBPulyWi.js} +1 -1
  8. package/frontend/assets/configuration-C8ZTSPna.js +1 -0
  9. package/frontend/assets/{configuration-B1tYKnw1.js → configuration-DBU-Fvop.js} +1 -1
  10. package/frontend/assets/{create-BXn1thks.js → create-BWsYjEs5.js} +1 -1
  11. package/frontend/assets/{create-DQsVrUIP.js → create-DBNC2wSp.js} +1 -1
  12. package/frontend/assets/{create-CNT_ktA4.js → create-DBv4ZLt7.js} +1 -1
  13. package/frontend/assets/create-DXgFUVIW.js +1 -0
  14. package/frontend/assets/{download-BsAZZo3P.js → download-BnmEn_Ca.js} +1 -1
  15. package/frontend/assets/{forges-ChElPpOV.js → forges-BOWrvfZl.js} +1 -1
  16. package/frontend/assets/forges-DwSiwqas.js +1 -0
  17. package/frontend/assets/{index-eMdhkBjo.js → index-B1Rm0SQ5.js} +1 -1
  18. package/frontend/assets/index-BKKD-dvv.js +1 -0
  19. package/frontend/assets/{index-C8gx27Rr.js → index-BaflOxvR.js} +1 -1
  20. package/frontend/assets/{index-h6dRc3tV.js → index-CR5UGYQN.js} +1 -1
  21. package/frontend/assets/{index-Dfzoepph.js → index-CSoB1eP_.js} +1 -1
  22. package/frontend/assets/{index-DgodP5aC.js → index-CUqlioqL.js} +1 -1
  23. package/frontend/assets/{index-Baaegu29.js → index-CZN7BV83.js} +1 -1
  24. package/frontend/assets/index-CeY9TXPf.js +1 -0
  25. package/frontend/assets/{index-9KbVyMz4.js → index-CydhSU9g.js} +1 -1
  26. package/frontend/assets/index-D-k5POv5.js +1 -0
  27. package/frontend/assets/{index-B7lg0P4V.js → index-DCCyA67N.js} +1 -1
  28. package/frontend/assets/{index-CX9sF5Fh.js → index-DfRj4oZV.js} +3 -3
  29. package/frontend/assets/index-Dn9qaXzX.js +1 -0
  30. package/frontend/assets/{index-DzSYBwXV.js → index-Dw5NpM9d.js} +1 -1
  31. package/frontend/assets/{index-CPyhbNqS.js → index-DyfuBbIJ.js} +1 -1
  32. package/frontend/assets/{index-CIReAhWD.js → index-PzkXPYSX.js} +1 -1
  33. package/frontend/assets/{index-xoWXUJLW.js → index-QabB0_Qw.js} +1 -1
  34. package/frontend/assets/{index-Ccx_zqhL.js → index-V8tnJR9v.js} +1 -1
  35. package/frontend/assets/{index-BYtgetD4.js → index-XcYy-NBi.js} +1 -1
  36. package/frontend/assets/{index-BsRx8Pzi.js → index-efpZ6EEe.js} +1 -1
  37. package/frontend/assets/{index-BWM8kiQ0.js → index-s14Wy6CE.js} +1 -1
  38. package/frontend/assets/index-zxLaxo8R.js +1 -0
  39. package/frontend/assets/repositories-BLLfYDjf.js +1 -0
  40. package/frontend/assets/{repositories-DdOEWFoL.js → repositories-of9BXUjW.js} +1 -1
  41. package/frontend/assets/{route-qbVbAxtx.js → route-X94hglR1.js} +1 -1
  42. package/frontend/index.html +1 -1
  43. package/package.json +1 -1
  44. package/frontend/assets/_branchId--sAXSZ0Z.js +0 -1
  45. package/frontend/assets/_id-ZvG2tACL.js +0 -1
  46. package/frontend/assets/agents-DbSvvIcf.js +0 -1
  47. package/frontend/assets/configuration-PLwRj92u.js +0 -1
  48. package/frontend/assets/create-CGIYQfn-.js +0 -1
  49. package/frontend/assets/forges-D5lw6fYh.js +0 -1
  50. package/frontend/assets/index-BBbL0wfM.js +0 -1
  51. package/frontend/assets/index-BCEvS2zI.js +0 -1
  52. package/frontend/assets/index-D3gI7yfx.js +0 -1
  53. package/frontend/assets/index-D6S4PGCc.js +0 -1
  54. package/frontend/assets/index-DvVl2gWR.js +0 -1
  55. package/frontend/assets/repositories-Di8qfiyD.js +0 -1
@@ -0,0 +1 @@
1
+ import{X as r}from"./index-DfRj4oZV.js";const e=r;export{e as errorComponent};
@@ -1 +1 @@
1
- import{Y as e,j as t,Z as o}from"./index-CX9sF5Fh.js";const n=()=>{const a=e.useNavigate();return t.jsx(o,{params:e.useParams(),search:e.useSearch(),onSearchChange:s=>{a({search:r=>({...r,...s}),replace:!0,resetScroll:!1})}})};export{n as component};
1
+ import{Y as e,j as t,Z as o}from"./index-DfRj4oZV.js";const n=()=>{const a=e.useNavigate();return t.jsx(o,{params:e.useParams(),search:e.useSearch(),onSearchChange:s=>{a({search:r=>({...r,...s}),replace:!0,resetScroll:!1})}})};export{n as component};
@@ -1 +1 @@
1
- import{u as M,r as f,j as e,d as K,M as P,B as x,f as z,h as U,i as $,a1 as q,a2 as C,k as V,l as E}from"./index-CX9sF5Fh.js";import{T as G}from"./index-h6dRc3tV.js";function H(t,i){if(t===void 0)return{shouldBlockFn:()=>!0,withResolver:!1};if("shouldBlockFn"in t)return t;if(typeof t=="function")return{shouldBlockFn:async()=>await t(),enableBeforeUnload:!0,withResolver:!1};const l=!!(t.condition??!0),n=t.blockerFn;return{shouldBlockFn:async()=>l&&n!==void 0?await n():l,enableBeforeUnload:l,withResolver:n===void 0}}function Q(t,i){const{shouldBlockFn:l,enableBeforeUnload:n=!0,disabled:a=!1,withResolver:s=!1}=H(t),u=M(),{history:j}=u,[p,c]=f.useState({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0});return f.useEffect(()=>{const h=async m=>{function r(g){const N=u.parseLocation(g),[,L,y]=u.getMatchedRoutes(N.pathname);return y===void 0?{routeId:"__notFound__",fullPath:N.pathname,pathname:N.pathname,params:L,search:u.options.parseSearch(g.search)}:{routeId:y.id,fullPath:y.fullPath,pathname:N.pathname,params:L,search:u.options.parseSearch(g.search)}}const b=r(m.currentLocation),v=r(m.nextLocation);if(b.routeId==="__notFound__"&&v.routeId!=="__notFound__")return!1;const w=await l({action:m.action,current:b,next:v});if(!s)return w;if(!w)return!1;const o=await new Promise(g=>{c({status:"blocked",current:b,next:v,action:m.action,proceed:()=>g(!1),reset:()=>g(!0)})});return c({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0}),o};return a?void 0:j.block({blockerFn:h,enableBeforeUnload:n})},[l,n,a,s,j,u]),p}const Y="All configurations",W="Rename",X="Name",J="Save name",Z="Cancel",R="Delete",ee="Keep",te="text-2xl leading-8 font-bold tracking-[-0.015em] text-signal-text",se=t=>{const[i,l]=f.useState("none"),[n,a]=f.useState(t.name);return e.jsxs("header",{className:"pb-6",children:[e.jsx(K,{to:"/settings/profiles",className:"text-sm text-muted-foreground underline decoration-input underline-offset-[0.3em] hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring",children:Y}),e.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-x-4 gap-y-3",children:[i==="renaming"?e.jsxs("form",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-2",action:()=>{t.onRename(n),l("none")},children:[e.jsx(P,{value:n,"aria-label":X,className:"max-w-sm flex-1",onChange:s=>{a(s.target.value)}}),e.jsx(x,{type:"submit",size:"sm",children:J}),e.jsx(x,{type:"button",variant:"ghost",size:"sm",onClick:()=>{l("none")},children:Z})]}):e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h2",{className:te,children:t.name}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t.originLabel})]}),i==="deleting"?e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("p",{className:"text-sm",children:`Delete ${t.name}? This cannot be undone.`}),e.jsx(x,{type:"button",variant:"ghost",size:"sm",onClick:()=>{l("none")},children:ee}),e.jsx(x,{type:"button",variant:"destructive",size:"sm",disabled:t.isBusy,onClick:t.onDelete,children:R})]}):e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.canRename&&i==="none"?e.jsx(x,{type:"button",variant:"ghost",size:"sm",onClick:()=>{a(t.name),l("renaming")},children:W}):null,t.canDelete?e.jsx(x,{type:"button",variant:"ghost",size:"sm",onClick:()=>{l("deleting")},children:R}):null,t.notice===null?e.jsx(x,{type:"button",variant:"outline",size:"sm",disabled:t.isBusy,onClick:t.onDuplicate,children:t.duplicateLabel}):null]})]}),t.errorMessage===null?null:e.jsx("p",{role:"alert",className:"pt-3 text-sm text-destructive",children:t.errorMessage}),t.notice===null?null:e.jsxs("div",{role:"note",className:"mt-4 flex flex-wrap items-center gap-x-4 gap-y-2 border-y border-border py-2.5",children:[e.jsxs("p",{className:"min-w-0 flex-1 text-sm",children:[e.jsx("strong",{className:"font-bold",children:t.notice.lead}),` ${t.notice.advice}`]}),e.jsx(x,{type:"button",variant:"outline",size:"sm",disabled:t.isBusy,onClick:t.onDuplicate,children:t.duplicateLabel})]})]})},ne="cursor-pointer text-sm text-muted-foreground underline decoration-input underline-offset-[0.3em] hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring",ae="mt-2 max-w-[75ch] border-l border-input pl-4 text-sm leading-6 whitespace-pre-wrap text-muted-foreground",ie="You have not saved this field. Leave it and lose what you wrote?",le="Not saved yet",re="Keep editing",oe="Leave",ce=t=>Object.fromEntries(t.map(i=>[i.key,i.value])),de=({title:t,summary:i,path:l,offMessage:n,texts:a,renderActions:s,onSubmit:u})=>{const[j,p]=f.useState(()=>ce(a)),c=a.some(r=>j[r.key]!==r.value),h=Q({shouldBlockFn:()=>c,enableBeforeUnload:c,withResolver:!0}),m=h.status==="blocked"?e.jsxs("div",{role:"alert",className:"flex flex-wrap items-center justify-end gap-2 pb-3",children:[e.jsx("p",{className:"text-sm",children:ie}),e.jsx(x,{type:"button",variant:"ghost",size:"sm",onClick:h.reset,children:re}),e.jsx(x,{type:"button",variant:"destructive",size:"sm",onClick:h.proceed,children:oe})]}):null;return e.jsxs("form",{action:()=>{u(a.map(r=>({key:r.key,text:j[r.key]??r.value})))},children:[e.jsx("h3",{className:"text-xl leading-7 font-bold",children:t}),e.jsx("p",{className:"mt-1 max-w-[62ch] text-muted-foreground",children:i}),e.jsx("p",{className:"mt-1 font-mono text-[0.8125rem] wrap-anywhere text-muted-foreground",children:l}),n===null?null:e.jsx("p",{className:"mt-4 max-w-[62ch] border-y border-border py-2.5 text-sm",children:n}),a.map(r=>e.jsxs("section",{className:"mt-6",children:[e.jsx("h4",{className:"pb-1.5 text-sm font-bold",children:r.label}),e.jsx(G,{label:`${t}: ${r.label}`,value:r.value,errorMessage:null,onChange:b=>{p(v=>({...v,[r.key]:b}))}}),r.isChanged?e.jsxs("details",{className:"mt-2",children:[e.jsx("summary",{className:ne,children:r.shippedLabel}),e.jsx("p",{className:ae,children:r.shippedValue})]}):null]},r.key)),s(c?le:null,m)]})},ue="Fields of this configuration",me="What the marks mean",xe=[{mark:"changed",label:"Changed"},{mark:"unchanged",label:"Unchanged"},{mark:"off",label:"Off"}],he={changed:"border-foreground bg-foreground",unchanged:"border-muted-foreground",off:"border-dashed border-muted-foreground"},fe="group flex items-center gap-3 border-l-4 border-border py-1.5 pr-2 pl-4 transition-colors duration-[180ms] ease-out hover:bg-muted focus-visible:outline-2 focus-visible:outline-ring aria-[current=page]:border-(--line)",F=({mark:t})=>e.jsx("span",{"aria-hidden":"true",className:z("size-2.5 shrink-0 rounded-[2px] border-[1.5px]",he[t])}),ge="On",be="Off",je=({label:t,isOn:i,isDisabled:l,onToggle:n})=>e.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx("span",{"aria-hidden":"true",children:i?ge:be}),e.jsx("input",{type:"checkbox",checked:i,disabled:l,"aria-label":t,className:"size-3.5 accent-(--primary)",onChange:a=>{n(a.target.checked)}})]}),pe=({configurationId:t,groups:i,isSwitching:l,onSwitch:n})=>e.jsxs("nav",{"aria-label":ue,className:"flex flex-col lg:max-h-[calc(100dvh-7rem)]",children:[e.jsx("div",{className:"min-h-0 overflow-y-auto",children:i.map(a=>e.jsxs("section",{children:[a.title===null?null:e.jsxs("div",{className:"flex items-center gap-3 border-l-4 border-border pt-4 pr-2 pb-1 pl-4",children:[e.jsx("h3",{className:"min-w-0 flex-1 text-xs leading-4 font-bold text-muted-foreground",children:a.title}),a.switch===null?null:e.jsx(je,{label:a.switch.label,isOn:a.switch.isOn,isDisabled:l,onToggle:s=>{a.switch!==null&&n(a.switch.section,s)}})]}),e.jsx("ul",{children:a.entries.map(s=>e.jsx("li",{children:e.jsxs(K,{to:"/settings/profiles/$id",params:{id:t},search:{field:s.key},"aria-current":s.isOpen?"page":void 0,className:fe,children:[e.jsx("span",{className:"min-w-0 flex-1 text-sm leading-5 group-aria-[current=page]:font-bold group-aria-[current=page]:text-signal-text",children:s.label}),e.jsx(F,{mark:s.mark}),e.jsx("span",{className:"sr-only",children:s.markLabel})]})},s.key))})]},a.title??""))}),e.jsx("ul",{"aria-label":me,className:"flex shrink-0 flex-wrap gap-x-4 gap-y-1 border-t border-border pt-3 text-xs text-muted-foreground",children:xe.map(a=>e.jsxs("li",{className:"flex items-center gap-1.5",children:[e.jsx(F,{mark:a.mark}),a.label]},a.mark))})]}),ve="Save",Ne="Saving…",T=({isPending:t,errorMessage:i,savedMessage:l,unsavedLabel:n=null,question:a=null,children:s})=>e.jsxs("footer",{className:"sticky bottom-0 z-10 mt-6 border-t border-border bg-background py-4 before:absolute before:-inset-x-1 before:inset-y-0 before:-z-10 before:bg-background",children:[a,i===null?null:e.jsx("p",{role:"alert",className:"pb-3 text-sm text-destructive",children:i}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2",children:[s,n===null?e.jsx("p",{role:"status",className:"ml-auto text-sm text-muted-foreground",children:t?null:l}):e.jsx("p",{className:"ml-auto text-sm font-bold",children:n}),e.jsx(x,{type:"submit",disabled:t,children:t?Ne:ve})]})]}),D=(t,i)=>t.includes(i)?t.filter(l=>l!==i):[...t,i],I=({label:t,description:i,isChecked:l,onToggle:n})=>{const a=f.useId(),s=f.useId();return e.jsxs("li",{className:"flex items-start gap-3 border-b border-border py-3",children:[e.jsx("input",{id:a,type:"checkbox",checked:l,"aria-describedby":s,className:"mt-1 size-4 shrink-0 accent-(--primary)",onChange:n}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("label",{htmlFor:a,className:"block cursor-pointer font-bold",children:t}),e.jsx("p",{id:s,className:"max-w-[62ch] text-sm text-muted-foreground",children:i})]})]})},ke=t=>{const[i,l]=f.useState(()=>t.sections.filter(s=>s.isOn).map(s=>s.section)),[n,a]=f.useState(()=>t.contextKinds.filter(s=>s.isRequired).map(s=>s.kind));return e.jsxs("form",{action:()=>{t.onSubmit(i,n)},children:[e.jsx("h3",{className:"text-xl leading-7 font-bold",children:t.title}),e.jsx("p",{className:"mt-1 max-w-[62ch] text-muted-foreground",children:t.summary}),e.jsxs("fieldset",{className:"mt-6",children:[e.jsx("legend",{className:"pb-2 text-sm font-bold",children:t.sectionsTitle}),e.jsx("ul",{className:"border-t border-border",children:t.sections.map(s=>e.jsx(I,{label:s.label,description:s.description,isChecked:i.includes(s.section),onToggle:()=>{l(u=>D(u,s.section))}},s.section))}),e.jsx("p",{className:"pt-2 text-sm text-muted-foreground",children:t.alwaysWrittenNote})]}),e.jsxs("fieldset",{className:"mt-8",children:[e.jsx("legend",{className:"text-sm font-bold",children:t.contextKindsTitle}),e.jsx("p",{className:"max-w-[62ch] pb-2 text-sm text-muted-foreground",children:t.contextKindsHint}),e.jsx("ul",{className:"border-t border-border",children:t.contextKinds.map(s=>e.jsx(I,{label:s.label,description:s.description,isChecked:n.includes(s.kind),onToggle:()=>{a(u=>D(u,s.kind))}},s.kind))})]}),t.children]})},ye="Configurations • Settings • Flight Plan",Ee=()=>{var g,N,L,y,S,B,_,A;const t=U(),i=$(),l=q(),{id:n}=C.useParams(),{field:a=null}=C.useSearch(),{data:s}=V(t.configuration.get.queryOptions({id:n,field:a})),[u,j]=f.useState(0),p=async()=>{await i.invalidateQueries(t.configuration.pathFilter())},c=E(t.configuration.save.mutationOptions({onSuccess:async(d,k)=>{d.kind!=="rejected"&&(await p(),k.change==="reset"&&j(O=>O+1))}})),h=E(t.configuration.create.mutationOptions({onSuccess:async d=>{d.kind!=="rejected"&&(await p(),await l({to:"/settings/profiles/$id",params:{id:d.id}}))}})),m=E(t.configuration.delete.mutationOptions({onSuccess:async d=>{d.kind!=="rejected"&&(await l({to:"/settings/profiles"}),await p())}})),r=((g=c.variables)==null?void 0:g.change)==="rename",b=((N=c.data)==null?void 0:N.kind)==="rejected"?c.data.message:((L=c.error)==null?void 0:L.message)??null,v=(r?b:null)??(((y=h.data)==null?void 0:y.kind)==="rejected"?h.data.message:(S=h.error)==null?void 0:S.message)??(((B=m.data)==null?void 0:B.kind)==="rejected"?m.data.message:(_=m.error)==null?void 0:_.message)??null,w={isPending:c.isPending,errorMessage:r?null:b,savedMessage:((A=c.data)==null?void 0:A.kind)==="saved"&&!r?c.data.message:null},{panel:o}=s;return e.jsxs(e.Fragment,{children:[e.jsx("title",{children:`${s.name} • ${ye}`}),e.jsx(se,{name:s.name,originLabel:s.originLabel,notice:s.notice,canRename:s.canRename,canDelete:s.canDelete,duplicateLabel:s.duplicateLabel,isBusy:h.isPending||m.isPending,errorMessage:v,onDuplicate:()=>{h.mutate({name:null,sourceId:n})},onRename:d=>{c.mutate({change:"rename",id:n,name:d})},onDelete:()=>{m.mutate({id:n})}}),e.jsxs("div",{className:"grid gap-x-10 gap-y-8 lg:grid-cols-[17rem_minmax(0,1fr)]",children:[e.jsx("div",{className:"self-start lg:sticky lg:top-22",children:e.jsx(pe,{configurationId:n,groups:s.index,isSwitching:c.isPending,onSwitch:(d,k)=>{c.mutate({change:"section",id:n,section:d,isOn:k})}})}),e.jsx("div",{className:"min-w-0",children:o.kind==="switches"?e.jsx(ke,{title:o.title,summary:o.summary,sectionsTitle:o.sectionsTitle,sections:o.sections,alwaysWrittenNote:o.alwaysWrittenNote,contextKindsTitle:o.contextKindsTitle,contextKindsHint:o.contextKindsHint,contextKinds:o.contextKinds,onSubmit:(d,k)=>{c.mutate({change:"switches",id:n,sections:d,contextCodeBlockKinds:k})},children:e.jsx(T,{...w})},`${n}:${o.sections.map(d=>String(d.isOn)).join()}`):e.jsx(de,{title:o.title,summary:o.summary,path:o.path,offMessage:o.offMessage,texts:o.texts,renderActions:(d,k)=>e.jsx(T,{...w,unsavedLabel:d,question:k,children:o.resetLabel===null?null:e.jsx(x,{type:"button",variant:"outline",size:"sm",disabled:c.isPending,onClick:()=>{c.mutate({change:"reset",id:n,path:o.path})},children:o.resetLabel})}),onSubmit:d=>{c.mutate({change:"field",id:n,path:o.path,texts:d})}},`${n}:${o.path}:${String(u)}`)})]})]})};export{Ee as component};
1
+ import{u as M,r as f,j as e,q as K,N as P,B as x,t as z,g as U,h as $,a1 as q,a2 as C,w as V,k as E}from"./index-DfRj4oZV.js";import{T as G}from"./index-CR5UGYQN.js";function H(t,i){if(t===void 0)return{shouldBlockFn:()=>!0,withResolver:!1};if("shouldBlockFn"in t)return t;if(typeof t=="function")return{shouldBlockFn:async()=>await t(),enableBeforeUnload:!0,withResolver:!1};const l=!!(t.condition??!0),n=t.blockerFn;return{shouldBlockFn:async()=>l&&n!==void 0?await n():l,enableBeforeUnload:l,withResolver:n===void 0}}function Q(t,i){const{shouldBlockFn:l,enableBeforeUnload:n=!0,disabled:a=!1,withResolver:s=!1}=H(t),u=M(),{history:j}=u,[p,c]=f.useState({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0});return f.useEffect(()=>{const h=async m=>{function r(g){const N=u.parseLocation(g),[,L,y]=u.getMatchedRoutes(N.pathname);return y===void 0?{routeId:"__notFound__",fullPath:N.pathname,pathname:N.pathname,params:L,search:u.options.parseSearch(g.search)}:{routeId:y.id,fullPath:y.fullPath,pathname:N.pathname,params:L,search:u.options.parseSearch(g.search)}}const b=r(m.currentLocation),v=r(m.nextLocation);if(b.routeId==="__notFound__"&&v.routeId!=="__notFound__")return!1;const w=await l({action:m.action,current:b,next:v});if(!s)return w;if(!w)return!1;const o=await new Promise(g=>{c({status:"blocked",current:b,next:v,action:m.action,proceed:()=>g(!1),reset:()=>g(!0)})});return c({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0}),o};return a?void 0:j.block({blockerFn:h,enableBeforeUnload:n})},[l,n,a,s,j,u]),p}const Y="All configurations",W="Rename",X="Name",J="Save name",Z="Cancel",R="Delete",ee="Keep",te="text-2xl leading-8 font-bold tracking-[-0.015em] text-signal-text",se=t=>{const[i,l]=f.useState("none"),[n,a]=f.useState(t.name);return e.jsxs("header",{className:"pb-6",children:[e.jsx(K,{to:"/settings/profiles",className:"text-sm text-muted-foreground underline decoration-input underline-offset-[0.3em] hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring",children:Y}),e.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-x-4 gap-y-3",children:[i==="renaming"?e.jsxs("form",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-2",action:()=>{t.onRename(n),l("none")},children:[e.jsx(P,{value:n,"aria-label":X,className:"max-w-sm flex-1",onChange:s=>{a(s.target.value)}}),e.jsx(x,{type:"submit",size:"sm",children:J}),e.jsx(x,{type:"button",variant:"ghost",size:"sm",onClick:()=>{l("none")},children:Z})]}):e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h2",{className:te,children:t.name}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t.originLabel})]}),i==="deleting"?e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("p",{className:"text-sm",children:`Delete ${t.name}? This cannot be undone.`}),e.jsx(x,{type:"button",variant:"ghost",size:"sm",onClick:()=>{l("none")},children:ee}),e.jsx(x,{type:"button",variant:"destructive",size:"sm",disabled:t.isBusy,onClick:t.onDelete,children:R})]}):e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.canRename&&i==="none"?e.jsx(x,{type:"button",variant:"ghost",size:"sm",onClick:()=>{a(t.name),l("renaming")},children:W}):null,t.canDelete?e.jsx(x,{type:"button",variant:"ghost",size:"sm",onClick:()=>{l("deleting")},children:R}):null,t.notice===null?e.jsx(x,{type:"button",variant:"outline",size:"sm",disabled:t.isBusy,onClick:t.onDuplicate,children:t.duplicateLabel}):null]})]}),t.errorMessage===null?null:e.jsx("p",{role:"alert",className:"pt-3 text-sm text-destructive",children:t.errorMessage}),t.notice===null?null:e.jsxs("div",{role:"note",className:"mt-4 flex flex-wrap items-center gap-x-4 gap-y-2 border-y border-border py-2.5",children:[e.jsxs("p",{className:"min-w-0 flex-1 text-sm",children:[e.jsx("strong",{className:"font-bold",children:t.notice.lead}),` ${t.notice.advice}`]}),e.jsx(x,{type:"button",variant:"outline",size:"sm",disabled:t.isBusy,onClick:t.onDuplicate,children:t.duplicateLabel})]})]})},ne="cursor-pointer text-sm text-muted-foreground underline decoration-input underline-offset-[0.3em] hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring",ae="mt-2 max-w-[75ch] border-l border-input pl-4 text-sm leading-6 whitespace-pre-wrap text-muted-foreground",ie="You have not saved this field. Leave it and lose what you wrote?",le="Not saved yet",re="Keep editing",oe="Leave",ce=t=>Object.fromEntries(t.map(i=>[i.key,i.value])),de=({title:t,summary:i,path:l,offMessage:n,texts:a,renderActions:s,onSubmit:u})=>{const[j,p]=f.useState(()=>ce(a)),c=a.some(r=>j[r.key]!==r.value),h=Q({shouldBlockFn:()=>c,enableBeforeUnload:c,withResolver:!0}),m=h.status==="blocked"?e.jsxs("div",{role:"alert",className:"flex flex-wrap items-center justify-end gap-2 pb-3",children:[e.jsx("p",{className:"text-sm",children:ie}),e.jsx(x,{type:"button",variant:"ghost",size:"sm",onClick:h.reset,children:re}),e.jsx(x,{type:"button",variant:"destructive",size:"sm",onClick:h.proceed,children:oe})]}):null;return e.jsxs("form",{action:()=>{u(a.map(r=>({key:r.key,text:j[r.key]??r.value})))},children:[e.jsx("h3",{className:"text-xl leading-7 font-bold",children:t}),e.jsx("p",{className:"mt-1 max-w-[62ch] text-muted-foreground",children:i}),e.jsx("p",{className:"mt-1 font-mono text-[0.8125rem] wrap-anywhere text-muted-foreground",children:l}),n===null?null:e.jsx("p",{className:"mt-4 max-w-[62ch] border-y border-border py-2.5 text-sm",children:n}),a.map(r=>e.jsxs("section",{className:"mt-6",children:[e.jsx("h4",{className:"pb-1.5 text-sm font-bold",children:r.label}),e.jsx(G,{label:`${t}: ${r.label}`,value:r.value,errorMessage:null,onChange:b=>{p(v=>({...v,[r.key]:b}))}}),r.isChanged?e.jsxs("details",{className:"mt-2",children:[e.jsx("summary",{className:ne,children:r.shippedLabel}),e.jsx("p",{className:ae,children:r.shippedValue})]}):null]},r.key)),s(c?le:null,m)]})},ue="Fields of this configuration",me="What the marks mean",xe=[{mark:"changed",label:"Changed"},{mark:"unchanged",label:"Unchanged"},{mark:"off",label:"Off"}],he={changed:"border-foreground bg-foreground",unchanged:"border-muted-foreground",off:"border-dashed border-muted-foreground"},fe="group flex items-center gap-3 border-l-4 border-border py-1.5 pr-2 pl-4 transition-colors duration-[180ms] ease-out hover:bg-muted focus-visible:outline-2 focus-visible:outline-ring aria-[current=page]:border-(--line)",F=({mark:t})=>e.jsx("span",{"aria-hidden":"true",className:z("size-2.5 shrink-0 rounded-[2px] border-[1.5px]",he[t])}),ge="On",be="Off",je=({label:t,isOn:i,isDisabled:l,onToggle:n})=>e.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx("span",{"aria-hidden":"true",children:i?ge:be}),e.jsx("input",{type:"checkbox",checked:i,disabled:l,"aria-label":t,className:"size-3.5 accent-(--primary)",onChange:a=>{n(a.target.checked)}})]}),pe=({configurationId:t,groups:i,isSwitching:l,onSwitch:n})=>e.jsxs("nav",{"aria-label":ue,className:"flex flex-col lg:max-h-[calc(100dvh-7rem)]",children:[e.jsx("div",{className:"min-h-0 overflow-y-auto",children:i.map(a=>e.jsxs("section",{children:[a.title===null?null:e.jsxs("div",{className:"flex items-center gap-3 border-l-4 border-border pt-4 pr-2 pb-1 pl-4",children:[e.jsx("h3",{className:"min-w-0 flex-1 text-xs leading-4 font-bold text-muted-foreground",children:a.title}),a.switch===null?null:e.jsx(je,{label:a.switch.label,isOn:a.switch.isOn,isDisabled:l,onToggle:s=>{a.switch!==null&&n(a.switch.section,s)}})]}),e.jsx("ul",{children:a.entries.map(s=>e.jsx("li",{children:e.jsxs(K,{to:"/settings/profiles/$id",params:{id:t},search:{field:s.key},"aria-current":s.isOpen?"page":void 0,className:fe,children:[e.jsx("span",{className:"min-w-0 flex-1 text-sm leading-5 group-aria-[current=page]:font-bold group-aria-[current=page]:text-signal-text",children:s.label}),e.jsx(F,{mark:s.mark}),e.jsx("span",{className:"sr-only",children:s.markLabel})]})},s.key))})]},a.title??""))}),e.jsx("ul",{"aria-label":me,className:"flex shrink-0 flex-wrap gap-x-4 gap-y-1 border-t border-border pt-3 text-xs text-muted-foreground",children:xe.map(a=>e.jsxs("li",{className:"flex items-center gap-1.5",children:[e.jsx(F,{mark:a.mark}),a.label]},a.mark))})]}),ve="Save",Ne="Saving…",T=({isPending:t,errorMessage:i,savedMessage:l,unsavedLabel:n=null,question:a=null,children:s})=>e.jsxs("footer",{className:"sticky bottom-0 z-10 mt-6 border-t border-border bg-background py-4 before:absolute before:-inset-x-1 before:inset-y-0 before:-z-10 before:bg-background",children:[a,i===null?null:e.jsx("p",{role:"alert",className:"pb-3 text-sm text-destructive",children:i}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2",children:[s,n===null?e.jsx("p",{role:"status",className:"ml-auto text-sm text-muted-foreground",children:t?null:l}):e.jsx("p",{className:"ml-auto text-sm font-bold",children:n}),e.jsx(x,{type:"submit",disabled:t,children:t?Ne:ve})]})]}),D=(t,i)=>t.includes(i)?t.filter(l=>l!==i):[...t,i],I=({label:t,description:i,isChecked:l,onToggle:n})=>{const a=f.useId(),s=f.useId();return e.jsxs("li",{className:"flex items-start gap-3 border-b border-border py-3",children:[e.jsx("input",{id:a,type:"checkbox",checked:l,"aria-describedby":s,className:"mt-1 size-4 shrink-0 accent-(--primary)",onChange:n}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("label",{htmlFor:a,className:"block cursor-pointer font-bold",children:t}),e.jsx("p",{id:s,className:"max-w-[62ch] text-sm text-muted-foreground",children:i})]})]})},ke=t=>{const[i,l]=f.useState(()=>t.sections.filter(s=>s.isOn).map(s=>s.section)),[n,a]=f.useState(()=>t.contextKinds.filter(s=>s.isRequired).map(s=>s.kind));return e.jsxs("form",{action:()=>{t.onSubmit(i,n)},children:[e.jsx("h3",{className:"text-xl leading-7 font-bold",children:t.title}),e.jsx("p",{className:"mt-1 max-w-[62ch] text-muted-foreground",children:t.summary}),e.jsxs("fieldset",{className:"mt-6",children:[e.jsx("legend",{className:"pb-2 text-sm font-bold",children:t.sectionsTitle}),e.jsx("ul",{className:"border-t border-border",children:t.sections.map(s=>e.jsx(I,{label:s.label,description:s.description,isChecked:i.includes(s.section),onToggle:()=>{l(u=>D(u,s.section))}},s.section))}),e.jsx("p",{className:"pt-2 text-sm text-muted-foreground",children:t.alwaysWrittenNote})]}),e.jsxs("fieldset",{className:"mt-8",children:[e.jsx("legend",{className:"text-sm font-bold",children:t.contextKindsTitle}),e.jsx("p",{className:"max-w-[62ch] pb-2 text-sm text-muted-foreground",children:t.contextKindsHint}),e.jsx("ul",{className:"border-t border-border",children:t.contextKinds.map(s=>e.jsx(I,{label:s.label,description:s.description,isChecked:n.includes(s.kind),onToggle:()=>{a(u=>D(u,s.kind))}},s.kind))})]}),t.children]})},ye="Configurations • Settings • Flight Plan",Ee=()=>{var g,N,L,y,S,B,_,A;const t=U(),i=$(),l=q(),{id:n}=C.useParams(),{field:a=null}=C.useSearch(),{data:s}=V(t.configuration.get.queryOptions({id:n,field:a})),[u,j]=f.useState(0),p=async()=>{await i.invalidateQueries(t.configuration.pathFilter())},c=E(t.configuration.save.mutationOptions({onSuccess:async(d,k)=>{d.kind!=="rejected"&&(await p(),k.change==="reset"&&j(O=>O+1))}})),h=E(t.configuration.create.mutationOptions({onSuccess:async d=>{d.kind!=="rejected"&&(await p(),await l({to:"/settings/profiles/$id",params:{id:d.id}}))}})),m=E(t.configuration.delete.mutationOptions({onSuccess:async d=>{d.kind!=="rejected"&&(await l({to:"/settings/profiles"}),await p())}})),r=((g=c.variables)==null?void 0:g.change)==="rename",b=((N=c.data)==null?void 0:N.kind)==="rejected"?c.data.message:((L=c.error)==null?void 0:L.message)??null,v=(r?b:null)??(((y=h.data)==null?void 0:y.kind)==="rejected"?h.data.message:(S=h.error)==null?void 0:S.message)??(((B=m.data)==null?void 0:B.kind)==="rejected"?m.data.message:(_=m.error)==null?void 0:_.message)??null,w={isPending:c.isPending,errorMessage:r?null:b,savedMessage:((A=c.data)==null?void 0:A.kind)==="saved"&&!r?c.data.message:null},{panel:o}=s;return e.jsxs(e.Fragment,{children:[e.jsx("title",{children:`${s.name} • ${ye}`}),e.jsx(se,{name:s.name,originLabel:s.originLabel,notice:s.notice,canRename:s.canRename,canDelete:s.canDelete,duplicateLabel:s.duplicateLabel,isBusy:h.isPending||m.isPending,errorMessage:v,onDuplicate:()=>{h.mutate({name:null,sourceId:n})},onRename:d=>{c.mutate({change:"rename",id:n,name:d})},onDelete:()=>{m.mutate({id:n})}}),e.jsxs("div",{className:"grid gap-x-10 gap-y-8 lg:grid-cols-[17rem_minmax(0,1fr)]",children:[e.jsx("div",{className:"self-start lg:sticky lg:top-22",children:e.jsx(pe,{configurationId:n,groups:s.index,isSwitching:c.isPending,onSwitch:(d,k)=>{c.mutate({change:"section",id:n,section:d,isOn:k})}})}),e.jsx("div",{className:"min-w-0",children:o.kind==="switches"?e.jsx(ke,{title:o.title,summary:o.summary,sectionsTitle:o.sectionsTitle,sections:o.sections,alwaysWrittenNote:o.alwaysWrittenNote,contextKindsTitle:o.contextKindsTitle,contextKindsHint:o.contextKindsHint,contextKinds:o.contextKinds,onSubmit:(d,k)=>{c.mutate({change:"switches",id:n,sections:d,contextCodeBlockKinds:k})},children:e.jsx(T,{...w})},`${n}:${o.sections.map(d=>String(d.isOn)).join()}`):e.jsx(de,{title:o.title,summary:o.summary,path:o.path,offMessage:o.offMessage,texts:o.texts,renderActions:(d,k)=>e.jsx(T,{...w,unsavedLabel:d,question:k,children:o.resetLabel===null?null:e.jsx(x,{type:"button",variant:"outline",size:"sm",disabled:c.isPending,onClick:()=>{c.mutate({change:"reset",id:n,path:o.path})},children:o.resetLabel})}),onSubmit:d=>{c.mutate({change:"field",id:n,path:o.path,texts:d})}},`${n}:${o.path}:${String(u)}`)})]})]})};export{Ee as component};
@@ -0,0 +1 @@
1
+ import{S as r}from"./index-XcYy-NBi.js";import"./index-DfRj4oZV.js";const n=r;export{n as errorComponent};
@@ -0,0 +1 @@
1
+ import{S as r}from"./index-XcYy-NBi.js";import"./index-DfRj4oZV.js";const n=r;export{n as errorComponent};
@@ -1 +1 @@
1
- import{h as c,k as u,s as o,r as d,m as p,j as e}from"./index-CX9sF5Fh.js";import{u as m,S as h}from"./index-Baaegu29.js";import{A as f}from"./index-DzSYBwXV.js";import{S}from"./index-BsRx8Pzi.js";import"./index-D3gI7yfx.js";const w="Agents • Settings • Flight Plan",x="Agents",M=()=>{var l;const r=c(),{data:s}=u(r.settings.get.queryOptions(o)),t=m(),[n,a]=d.useState(null),i=p({...r.setup.browseFolders.queryOptions({path:n??"",purpose:"install-folder"}),enabled:n!==null});return s.section!==o.section?null:e.jsxs(e.Fragment,{children:[e.jsx("title",{children:w}),e.jsx(S,{title:x,children:"A coding agent writes each review. Flight Plan installs its skills, its plugin and its MCP server into the folder of each agent you pick, and installs them again each time you save."}),e.jsx(f,{agents:s.agents,defaultAgent:s.defaultAgent,connection:s.connection,connectionOptions:s.connectionOptions,problem:t.problem,folderBrowser:n===null?null:i.data??null,folderBrowserErrorMessage:((l=i.error)==null?void 0:l.message)??null,onBrowseFolder:a,onBrowseEnd:()=>{a(null)},onSubmit:g=>{t.save({...o,...g})},children:e.jsx(h,{isPending:t.isPending,errorMessage:t.errorMessage,savedMessage:t.savedMessage})})]})};export{M as component};
1
+ import{g as c,w as u,E as o,r as d,i as p,j as e}from"./index-DfRj4oZV.js";import{u as m,S as h}from"./index-CZN7BV83.js";import{A as f}from"./index-Dw5NpM9d.js";import{S}from"./index-efpZ6EEe.js";import"./index-Dn9qaXzX.js";const w="Agents • Settings • Flight Plan",x="Agents",M=()=>{var l;const r=c(),{data:s}=u(r.settings.get.queryOptions(o)),t=m(),[n,i]=d.useState(null),a=p({...r.setup.browseFolders.queryOptions({path:n??"",purpose:"install-folder"}),enabled:n!==null});return s.section!==o.section?null:e.jsxs(e.Fragment,{children:[e.jsx("title",{children:w}),e.jsx(S,{title:x,children:"A coding agent writes each review. Flight Plan installs its skills, its plugin and its MCP server into the folder of each agent you pick, and installs them again each time you save."}),e.jsx(f,{agents:s.agents,defaultAgent:s.defaultAgent,connection:s.connection,connectionOptions:s.connectionOptions,problem:t.problem,folderBrowser:n===null?null:a.data??null,folderBrowserErrorMessage:((l=a.error)==null?void 0:l.message)??null,onBrowseFolder:i,onBrowseEnd:()=>{i(null)},onSubmit:g=>{t.save({...o,...g})},children:e.jsx(h,{isPending:t.isPending,errorMessage:t.errorMessage,savedMessage:t.savedMessage})})]})};export{M as component};
@@ -0,0 +1 @@
1
+ import{S as r}from"./index-XcYy-NBi.js";import"./index-DfRj4oZV.js";const n=r;export{n as errorComponent};
@@ -1 +1 @@
1
- import{h as a,k as c,t as n,j as e}from"./index-CX9sF5Fh.js";import{u as g,S as u}from"./index-Baaegu29.js";import{D as l}from"./index-DgodP5aC.js";import{S as d}from"./index-BsRx8Pzi.js";const h="Configuration • Settings • Flight Plan",p="Default configuration",P=()=>{var i;const o=a(),{data:t}=c(o.settings.get.queryOptions(n)),s=g();return t.section!==n.section?null:e.jsxs(e.Fragment,{children:[e.jsx("title",{children:h}),e.jsx(d,{title:p,children:"A configuration decides how the agent writes a review: the voice of its prose, how each part is worded, and which sections it generates. The default is used unless you pick another when you create a Flight Plan."}),e.jsx(l,{presets:t.presets,selectedPreset:t.selectedPreset,onSubmit:r=>{s.save({...n,preset:r})},children:e.jsx(u,{isPending:s.isPending,errorMessage:((i=s.problem)==null?void 0:i.message)??null,savedMessage:s.savedMessage})})]})};export{P as component};
1
+ import{g as a,w as c,G as n,j as e}from"./index-DfRj4oZV.js";import{u as g,S as u}from"./index-CZN7BV83.js";import{D as l}from"./index-CUqlioqL.js";import{S as d}from"./index-efpZ6EEe.js";const p="Configuration • Settings • Flight Plan",h="Default configuration",x=()=>{var i;const o=a(),{data:t}=c(o.settings.get.queryOptions(n)),s=g();return t.section!==n.section?null:e.jsxs(e.Fragment,{children:[e.jsx("title",{children:p}),e.jsx(d,{title:h,children:"A configuration decides how the agent writes a review: the voice of its prose, how each part is worded, and which sections it generates. The default is used unless you pick another when you create a Flight Plan."}),e.jsx(l,{presets:t.presets,selectedPreset:t.selectedPreset,onSubmit:r=>{s.save({...n,preset:r})},children:e.jsx(u,{isPending:s.isPending,errorMessage:((i=s.problem)==null?void 0:i.message)??null,savedMessage:s.savedMessage})})]})};export{x as component};
@@ -1 +1 @@
1
- import{_ as a,$ as n,j as r,a0 as o}from"./index-CX9sF5Fh.js";const i=()=>{const{repoName:t}=a.useParams(),e=n(t,null);return r.jsxs(r.Fragment,{children:[r.jsxs("header",{className:"pb-6",children:[r.jsx("h1",{className:"text-4xl leading-10 font-bold tracking-[-0.02em]",children:e.creationForm.title}),r.jsx("p",{className:"mt-2 max-w-[62ch] text-muted-foreground",children:e.creationForm.description})]}),r.jsx(o,{creationForm:e.creationForm,targetSearch:e.targetSearch,problem:e.problem,errorMessage:e.errorMessage,isPending:e.isPending,onTargetQueryChange:e.onTargetQueryChange,onTargetSelect:e.onTargetSelect,onSubmit:e.onSubmit})]})};export{i as component};
1
+ import{_ as a,$ as n,j as r,a0 as o}from"./index-DfRj4oZV.js";const i=()=>{const{repoName:t}=a.useParams(),e=n(t,null);return r.jsxs(r.Fragment,{children:[r.jsxs("header",{className:"pb-6",children:[r.jsx("h1",{className:"text-4xl leading-10 font-bold tracking-[-0.02em]",children:e.creationForm.title}),r.jsx("p",{className:"mt-2 max-w-[62ch] text-muted-foreground",children:e.creationForm.description})]}),r.jsx(o,{creationForm:e.creationForm,targetSearch:e.targetSearch,problem:e.problem,errorMessage:e.errorMessage,isPending:e.isPending,onTargetQueryChange:e.onTargetQueryChange,onTargetSelect:e.onTargetSelect,onSubmit:e.onSubmit})]})};export{i as component};
@@ -1 +1 @@
1
- import{r as c,j as e,M as g,L as N,h as f,i as j,a1 as b,k as I,l as C,d as y,c as L,B as S}from"./index-CX9sF5Fh.js";import{S as E}from"./index-BsRx8Pzi.js";const v="Name",w="How the configuration is listed when you create a Flight Plan.",T="Start from",k="The new configuration is a copy: the same sections and the same instructions, yours to change.",A=({sources:i,selectedSourceId:d,nameError:r,sourceError:o,children:t,onSubmit:s})=>{const l=c.useId(),n=c.useId(),m=c.useId(),[u,h]=c.useState(""),[x,p]=c.useState(d);return e.jsxs("form",{action:()=>{s(u,x)},children:[e.jsxs("div",{className:"max-w-md",children:[e.jsx("label",{htmlFor:l,className:"block text-sm font-bold",children:v}),e.jsx("p",{className:"pb-2 text-sm text-muted-foreground",children:w}),e.jsx(g,{id:l,value:u,"aria-invalid":r!==null,"aria-describedby":r===null?void 0:n,onChange:a=>{h(a.target.value)}}),r===null?null:e.jsx("p",{id:n,role:"alert",className:"pt-1.5 text-sm text-destructive",children:r})]}),e.jsxs("fieldset",{className:"mt-8",children:[e.jsx("legend",{className:"text-sm font-bold",children:T}),e.jsx("p",{className:"max-w-[62ch] pb-2 text-sm text-muted-foreground",children:k}),e.jsx("ul",{className:"border-t border-border",children:i.map(a=>e.jsx("li",{className:"border-b border-border py-3",children:e.jsxs("label",{className:"flex cursor-pointer items-start gap-3",children:[e.jsx("input",{type:"radio",name:m,checked:x===a.id,className:"mt-1 size-4 shrink-0 accent-(--primary)",onChange:()=>{p(a.id)}}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block font-bold",children:a.name}),a.summary===null?null:e.jsx("span",{className:"block max-w-[62ch] text-sm",children:a.summary}),e.jsx(N,{segments:a.details,className:"text-sm text-muted-foreground"})]})]})},a.id))}),o===null?null:e.jsx("p",{role:"alert",className:"pt-2 text-sm text-destructive",children:o})]}),t]})},B="New configuration • Settings • Flight Plan",_="New configuration",F="Create",P="Creating…",M="Cancel",U=()=>{var l;const i=f(),d=j(),r=b(),{data:o}=I(i.configuration.creationForm.queryOptions()),t=C(i.configuration.create.mutationOptions({onSuccess:async n=>{n.kind!=="rejected"&&(await d.invalidateQueries(i.configuration.pathFilter()),await r({to:"/settings/profiles/$id",params:{id:n.id}}))}})),s=((l=t.data)==null?void 0:l.kind)==="rejected"?t.data:null;return e.jsxs(e.Fragment,{children:[e.jsx("title",{children:B}),e.jsx(E,{title:_,children:"Name the configuration and choose what it starts from. You change its sections and its instructions on the next page."}),e.jsx(A,{sources:o.sources,selectedSourceId:o.selectedSourceId,nameError:(s==null?void 0:s.field)==="name"?s.message:null,sourceError:(s==null?void 0:s.field)==="source"?s.message:null,onSubmit:(n,m)=>{t.mutate({name:n,sourceId:m})},children:e.jsxs("footer",{className:"mt-6 border-t border-border pt-4",children:[t.error===null?null:e.jsx("p",{role:"alert",className:"pb-3 text-sm text-destructive",children:t.error.message}),e.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[e.jsx(y,{to:"/settings/profiles",className:L({variant:"ghost"}),children:M}),e.jsx(S,{type:"submit",disabled:t.isPending,children:t.isPending?P:F})]})]})})]})};export{U as component};
1
+ import{r as c,j as e,N as p,L as N,g as f,h as j,a1 as b,w as I,k as C,q as y,o as L,B as S}from"./index-DfRj4oZV.js";import{S as E}from"./index-efpZ6EEe.js";const w="Name",v="How the configuration is listed when you create a Flight Plan.",T="Start from",k="The new configuration is a copy: the same sections and the same instructions, yours to change.",A=({sources:i,selectedSourceId:d,nameError:r,sourceError:o,children:t,onSubmit:s})=>{const l=c.useId(),n=c.useId(),m=c.useId(),[u,h]=c.useState(""),[x,g]=c.useState(d);return e.jsxs("form",{action:()=>{s(u,x)},children:[e.jsxs("div",{className:"max-w-md",children:[e.jsx("label",{htmlFor:l,className:"block text-sm font-bold",children:w}),e.jsx("p",{className:"pb-2 text-sm text-muted-foreground",children:v}),e.jsx(p,{id:l,value:u,"aria-invalid":r!==null,"aria-describedby":r===null?void 0:n,onChange:a=>{h(a.target.value)}}),r===null?null:e.jsx("p",{id:n,role:"alert",className:"pt-1.5 text-sm text-destructive",children:r})]}),e.jsxs("fieldset",{className:"mt-8",children:[e.jsx("legend",{className:"text-sm font-bold",children:T}),e.jsx("p",{className:"max-w-[62ch] pb-2 text-sm text-muted-foreground",children:k}),e.jsx("ul",{className:"border-t border-border",children:i.map(a=>e.jsx("li",{className:"border-b border-border py-3",children:e.jsxs("label",{className:"flex cursor-pointer items-start gap-3",children:[e.jsx("input",{type:"radio",name:m,checked:x===a.id,className:"mt-1 size-4 shrink-0 accent-(--primary)",onChange:()=>{g(a.id)}}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block font-bold",children:a.name}),a.summary===null?null:e.jsx("span",{className:"block max-w-[62ch] text-sm",children:a.summary}),e.jsx(N,{segments:a.details,className:"text-sm text-muted-foreground"})]})]})},a.id))}),o===null?null:e.jsx("p",{role:"alert",className:"pt-2 text-sm text-destructive",children:o})]}),t]})},B="New configuration • Settings • Flight Plan",_="New configuration",F="Create",P="Creating…",M="Cancel",U=()=>{var l;const i=f(),d=j(),r=b(),{data:o}=I(i.configuration.creationForm.queryOptions()),t=C(i.configuration.create.mutationOptions({onSuccess:async n=>{n.kind!=="rejected"&&(await d.invalidateQueries(i.configuration.pathFilter()),await r({to:"/settings/profiles/$id",params:{id:n.id}}))}})),s=((l=t.data)==null?void 0:l.kind)==="rejected"?t.data:null;return e.jsxs(e.Fragment,{children:[e.jsx("title",{children:B}),e.jsx(E,{title:_,children:"Name the configuration and choose what it starts from. You change its sections and its instructions on the next page."}),e.jsx(A,{sources:o.sources,selectedSourceId:o.selectedSourceId,nameError:(s==null?void 0:s.field)==="name"?s.message:null,sourceError:(s==null?void 0:s.field)==="source"?s.message:null,onSubmit:(n,m)=>{t.mutate({name:n,sourceId:m})},children:e.jsxs("footer",{className:"mt-6 border-t border-border pt-4",children:[t.error===null?null:e.jsx("p",{role:"alert",className:"pb-3 text-sm text-destructive",children:t.error.message}),e.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[e.jsx(y,{to:"/settings/profiles",className:L({variant:"ghost"}),children:M}),e.jsx(S,{type:"submit",disabled:t.isPending,children:t.isPending?P:F})]})]})})]})};export{U as component};
@@ -1 +1 @@
1
- import{u as t,j as e,B as n,d as r}from"./index-CX9sF5Fh.js";const a="The backend did not say what went wrong.",i=({error:o})=>{const s=t();return e.jsxs("section",{role:"alert",className:"max-w-prose",children:[e.jsx("h1",{className:"text-4xl leading-10 font-bold tracking-[-0.02em]",children:"Could not open this page"}),e.jsx("p",{className:"mt-2 text-muted-foreground",children:o instanceof Error?o.message:a}),e.jsxs("div",{className:"mt-4 flex items-center gap-4",children:[e.jsx(n,{onClick:()=>{s.invalidate()},children:"Try again"}),e.jsx(r,{to:"/",className:"underline",children:"Go to your repositories"})]})]})},c=i;export{c as errorComponent};
1
+ import{u as t,j as e,B as n,q as r}from"./index-DfRj4oZV.js";const a="The backend did not say what went wrong.",i=({error:o})=>{const s=t();return e.jsxs("section",{role:"alert",className:"max-w-prose",children:[e.jsx("h1",{className:"text-4xl leading-10 font-bold tracking-[-0.02em]",children:"Could not open this page"}),e.jsx("p",{className:"mt-2 text-muted-foreground",children:o instanceof Error?o.message:a}),e.jsxs("div",{className:"mt-4 flex items-center gap-4",children:[e.jsx(n,{onClick:()=>{s.invalidate()},children:"Try again"}),e.jsx(r,{to:"/",className:"underline",children:"Go to your repositories"})]})]})},c=i;export{c as errorComponent};
@@ -0,0 +1 @@
1
+ import{S as r}from"./index-XcYy-NBi.js";import"./index-DfRj4oZV.js";const n=r;export{n as errorComponent};
@@ -1 +1 @@
1
- import{j as s,T as g,f as h,h as f,i as N,U as u,V as b,r as j,k as I,l as v,W as w,B as y,d as L}from"./index-CX9sF5Fh.js";const R=({label:a,className:l})=>s.jsxs("p",{role:"status",className:h("flex items-center gap-2 font-bold",l),children:[s.jsx(g,{"aria-hidden":"true",className:"size-4 motion-safe:animate-spin"}),a]}),F=2e3,k=()=>{var c,d;const a=f(),l=N(),r=u.useSearch(),i=u.useLoaderData(),o=b(r),[p,x]=j.useState(i.importId),{data:e}=I({...a.review.importForm.queryOptions(o),refetchInterval:F}),t=v(a.review.import.mutationOptions({onSuccess:async({importId:n})=>{x(n),await l.invalidateQueries(a.review.importForm.pathFilter())}})),m=((c=t.error)==null?void 0:c.message)??(((d=t.data)==null?void 0:d.importId)===null?t.data.message:i.refusal);return e.isFinished&&e.importId!==null&&e.importId===p?s.jsx(w,{to:"/pr-reviews/$repoName/$branchId",params:{repoName:r.repository,branchId:r.target},replace:!0}):s.jsxs("section",{className:"max-w-prose",children:[s.jsx("h1",{className:"text-4xl leading-10 font-bold tracking-[-0.02em]",children:e.heading}),s.jsx("p",{className:"mt-2 text-muted-foreground",children:e.message}),e.details.length===0?null:s.jsx("dl",{className:"mt-6 grid grid-cols-[auto_minmax(0,1fr)] gap-x-6 gap-y-1 text-sm",children:e.details.map(n=>s.jsxs("div",{className:"contents",children:[s.jsx("dt",{className:"text-muted-foreground",children:n.label}),s.jsx("dd",{className:"font-mono break-all",children:n.value})]},n.label))}),e.warning===null?null:s.jsx("p",{className:"mt-6 font-bold text-signal-text",children:e.warning}),e.isImporting||t.isPending?s.jsx(R,{label:e.pendingLabel,className:"mt-6"}):null,m===null||e.isImporting?null:s.jsx("p",{role:"alert",className:"mt-6 text-destructive",children:m}),s.jsxs("div",{className:"mt-6 flex items-center gap-4",children:[e.submitLabel===null||e.isImporting?null:s.jsx(y,{disabled:t.isPending,onClick:()=>{t.mutate(o)},children:e.submitLabel}),e.reviewHref===null?null:s.jsx(L,{to:"/pr-reviews/$repoName/$branchId",params:{repoName:r.repository,branchId:r.target},className:"underline",children:"Open the review page"})]})]})};export{k as component};
1
+ import{j as s,T as g,t as h,g as N,h as f,U as u,V as b,r as j,w as I,k as w,W as v,B as y,q as L}from"./index-DfRj4oZV.js";const R=({label:a,className:l})=>s.jsxs("p",{role:"status",className:h("flex items-center gap-2 font-bold",l),children:[s.jsx(g,{"aria-hidden":"true",className:"size-4 motion-safe:animate-spin"}),a]}),F=2e3,k=()=>{var c,d;const a=N(),l=f(),r=u.useSearch(),i=u.useLoaderData(),o=b(r),[p,x]=j.useState(i.importId),{data:e}=I({...a.review.importForm.queryOptions(o),refetchInterval:F}),t=w(a.review.import.mutationOptions({onSuccess:async({importId:n})=>{x(n),await l.invalidateQueries(a.review.importForm.pathFilter())}})),m=((c=t.error)==null?void 0:c.message)??(((d=t.data)==null?void 0:d.importId)===null?t.data.message:i.refusal);return e.isFinished&&e.importId!==null&&e.importId===p?s.jsx(v,{to:"/pr-reviews/$repoName/$branchId",params:{repoName:r.repository,branchId:r.target},replace:!0}):s.jsxs("section",{className:"max-w-prose",children:[s.jsx("h1",{className:"text-4xl leading-10 font-bold tracking-[-0.02em]",children:e.heading}),s.jsx("p",{className:"mt-2 text-muted-foreground",children:e.message}),e.details.length===0?null:s.jsx("dl",{className:"mt-6 grid grid-cols-[auto_minmax(0,1fr)] gap-x-6 gap-y-1 text-sm",children:e.details.map(n=>s.jsxs("div",{className:"contents",children:[s.jsx("dt",{className:"text-muted-foreground",children:n.label}),s.jsx("dd",{className:"font-mono break-all",children:n.value})]},n.label))}),e.warning===null?null:s.jsx("p",{className:"mt-6 font-bold text-signal-text",children:e.warning}),e.isImporting||t.isPending?s.jsx(R,{label:e.pendingLabel,className:"mt-6"}):null,m===null||e.isImporting?null:s.jsx("p",{role:"alert",className:"mt-6 text-destructive",children:m}),s.jsxs("div",{className:"mt-6 flex items-center gap-4",children:[e.submitLabel===null||e.isImporting?null:s.jsx(y,{disabled:t.isPending,onClick:()=>{t.mutate(o)},children:e.submitLabel}),e.reviewHref===null?null:s.jsx(L,{to:"/pr-reviews/$repoName/$branchId",params:{repoName:r.repository,branchId:r.target},className:"underline",children:"Open the review page"})]})]})};export{k as component};
@@ -1 +1 @@
1
- import{h as i,k as a,v as r,j as e}from"./index-CX9sF5Fh.js";import{u as g,S as c}from"./index-Baaegu29.js";import{F as l}from"./index-9KbVyMz4.js";import{S as u}from"./index-BsRx8Pzi.js";const f="Git forge • Settings • Flight Plan",m="Git forge",F=()=>{const o=i(),{data:t}=a(o.settings.get.queryOptions(r)),s=g();return t.section!==r.section?null:e.jsxs(e.Fragment,{children:[e.jsx("title",{children:f}),e.jsx(u,{title:m,children:"A forge hosts your pull requests. Pick every way Flight Plan may reach one, and choose the default. Local git works without a forge, with fewer features."}),e.jsx(l,{forges:t.forges,defaultForge:t.defaultForge,problem:s.problem,onSubmit:n=>{s.save({...r,...n})},children:e.jsx(c,{isPending:s.isPending,errorMessage:s.errorMessage,savedMessage:s.savedMessage})})]})};export{F as component};
1
+ import{g as i,w as a,H as r,j as e}from"./index-DfRj4oZV.js";import{u as g,S as c}from"./index-CZN7BV83.js";import{F as l}from"./index-CydhSU9g.js";import{S as u}from"./index-efpZ6EEe.js";const f="Git forge • Settings • Flight Plan",m="Git forge",F=()=>{const o=i(),{data:t}=a(o.settings.get.queryOptions(r)),s=g();return t.section!==r.section?null:e.jsxs(e.Fragment,{children:[e.jsx("title",{children:f}),e.jsx(u,{title:m,children:"A forge hosts your pull requests. Pick every way Flight Plan may reach one, and choose the default. Local git works without a forge, with fewer features."}),e.jsx(l,{forges:t.forges,defaultForge:t.defaultForge,problem:s.problem,onSubmit:n=>{s.save({...r,...n})},children:e.jsx(c,{isPending:s.isPending,errorMessage:s.errorMessage,savedMessage:s.savedMessage})})]})};export{F as component};
@@ -0,0 +1 @@
1
+ import{S as r}from"./index-XcYy-NBi.js";import"./index-DfRj4oZV.js";const n=r;export{n as errorComponent};
@@ -1 +1 @@
1
- import{h as F,m as B,j as e,D as w,x as M,y as T,z as $,C as G,r,a3 as K,M as L,N as P,a4 as S,I as W,a5 as H,G as U,B as f}from"./index-CX9sF5Fh.js";import{T as q}from"./index-h6dRc3tV.js";const z="Loading the card…",Q=t=>{var c;const a=F(),n=B({...a.review.cardForm.queryOptions(t),gcTime:0}),d=n.isFetching?null:n.data??null;return{form:d,statusMessage:d===null?((c=n.error)==null?void 0:c.message)??z:null}},V="Modify a card",J="Write what the card says, and choose the rows it lists. Select lines in the code to add a row.",C="Label",D="Description",X="Rows",Y="No rows yet. Select lines in the code, then choose Add row.",Z="Kind",ee="Add row",v=t=>[...t].sort((a,n)=>a.lineStart-n.lineStart||a.lineEnd-n.lineEnd),se=t=>({...t,key:t.id}),ae=(t,a)=>t.kindOptions.some(n=>n.value===a),te=({reviewKey:t,form:a,isSaving:n,errorMessage:d,renderCodeLinkDialog:c,onSave:p,onClose:h})=>{const m=r.useId(),i=r.useId(),[x,g]=r.useState(a.label),[I,A]=r.useState(a.description),[j,b]=r.useState(()=>v(a.rows.map(se))),[O,y]=r.useState({lineStart:a.lineStart,lineEnd:a.lineEnd}),N=K(t,a.path),E=(s,l)=>{b(o=>o.map(u=>u.key===s?{...u,...l}:u))},R=s=>{const l={...s,key:crypto.randomUUID(),id:null,type:a.defaultKind,label:"",name:S(s)};b(o=>v([...o,l])),y(s)},_=()=>{p({label:x,description:I,rows:j.map(({id:s,type:l,label:o,lineStart:u,lineEnd:k})=>({id:s,type:l,label:o,lineStart:u,lineEnd:k}))})};return e.jsxs("form",{action:_,className:"contents",children:[e.jsxs("div",{className:"grid min-h-0 grid-cols-[minmax(0,26rem)_minmax(0,1fr)] gap-4 overflow-hidden",children:[e.jsxs("div",{className:"flex min-h-0 flex-col gap-4 overflow-y-auto pr-1",children:[e.jsxs("div",{className:"grid gap-1.5",children:[e.jsx("label",{htmlFor:m,className:"text-sm font-bold",children:C}),e.jsx(L,{id:m,value:x,placeholder:a.labelPlaceholder,onChange:s=>{g(s.target.value)}})]}),e.jsxs("div",{className:"grid gap-1.5",children:[e.jsx("p",{"aria-hidden":"true",className:"text-sm font-bold",children:D}),e.jsx(q,{label:D,value:a.description,errorMessage:null,renderCodeLinkDialog:c,onChange:A})]}),e.jsxs("section",{"aria-labelledby":i,className:"grid gap-2",children:[e.jsx("h3",{id:i,className:"text-sm font-bold",children:X}),j.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:Y}):null,e.jsx("ul",{className:"grid gap-2",children:j.map(s=>e.jsxs("li",{className:"grid gap-1.5 rounded-md border border-input p-2",onFocusCapture:()=>{y({lineStart:s.lineStart,lineEnd:s.lineEnd})},children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(P,{label:`${Z} of ${s.name}`,options:a.kindOptions,value:s.type,isLabelHidden:!0,className:"w-40 shrink-0",onChange:l=>{ae(a,l)&&E(s.key,{type:l})}}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-muted-foreground tabular-nums",children:S(s)}),e.jsx(W,{icon:"delete",label:`Delete the row ${s.label===""?s.name:s.label}`,onClick:()=>{b(l=>l.filter(o=>o.key!==s.key))}})]}),e.jsx(L,{value:s.label,"aria-label":`${C} of ${s.name}`,placeholder:s.name,onChange:l=>{E(s.key,{label:l.target.value})}})]},s.key))})]})]}),e.jsx(H,{path:a.path,lines:N.lines,statusMessage:N.statusMessage,waypoints:a.waypoints,waypointOptions:"toggle-off",highlightButtonLabel:ee,focusOn:O,onHighlightCode:R})]}),d===null?e.jsx("span",{}):e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:d}),e.jsxs(U,{children:[e.jsx(f,{type:"button",variant:"ghost",onClick:h,children:"Cancel"}),e.jsx(f,{type:"submit",disabled:n,children:n?"Saving…":"Save"})]})]})},ie=({reviewKey:t,change:{segmentId:a,nodeId:n,isSaving:d,errorMessage:c,onSave:p,onClose:h},renderCodeLinkDialog:m})=>{const{form:i,statusMessage:x}=Q({...t,segmentId:a,nodeId:n});return e.jsx(w,{open:!0,onOpenChange:g=>{g||h()},children:e.jsxs(M,{className:"h-[calc(100dvh-4rem)] grid-rows-[auto_minmax(0,1fr)_auto_auto] sm:max-w-[min(90rem,calc(100vw-4rem))]",children:[e.jsxs(T,{children:[e.jsx($,{children:(i==null?void 0:i.title)??V}),e.jsx(G,{children:J})]}),i===null?e.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:x}):e.jsx(te,{reviewKey:t,form:i,isSaving:d,errorMessage:c,renderCodeLinkDialog:m,onSave:p,onClose:h},i.nodeId)]})})};export{ie as default};
1
+ import{g as F,i as B,j as e,D as w,a as T,b as M,c as P,d as $,r,a3 as K,N as L,P as W,a4 as S,I as G,a5 as H,e as U,B as f}from"./index-DfRj4oZV.js";import{T as q}from"./index-CR5UGYQN.js";const Q="Loading the card…",V=t=>{var c;const a=F(),n=B({...a.review.cardForm.queryOptions(t),gcTime:0}),d=n.isFetching?null:n.data??null;return{form:d,statusMessage:d===null?((c=n.error)==null?void 0:c.message)??Q:null}},z="Modify a card",J="Write what the card says, and choose the rows it lists. Select lines in the code to add a row.",C="Label",D="Description",X="Rows",Y="No rows yet. Select lines in the code, then choose Add row.",Z="Kind",ee="Add row",v=t=>[...t].sort((a,n)=>a.lineStart-n.lineStart||a.lineEnd-n.lineEnd),se=t=>({...t,key:t.id}),ae=(t,a)=>t.kindOptions.some(n=>n.value===a),te=({reviewKey:t,form:a,isSaving:n,errorMessage:d,renderCodeLinkDialog:c,onSave:p,onClose:h})=>{const m=r.useId(),i=r.useId(),[x,g]=r.useState(a.label),[I,A]=r.useState(a.description),[j,b]=r.useState(()=>v(a.rows.map(se))),[O,N]=r.useState({lineStart:a.lineStart,lineEnd:a.lineEnd}),y=K(t,a.path),E=(s,l)=>{b(o=>o.map(u=>u.key===s?{...u,...l}:u))},R=s=>{const l={...s,key:crypto.randomUUID(),id:null,type:a.defaultKind,label:"",name:S(s)};b(o=>v([...o,l])),N(s)},_=()=>{p({label:x,description:I,rows:j.map(({id:s,type:l,label:o,lineStart:u,lineEnd:k})=>({id:s,type:l,label:o,lineStart:u,lineEnd:k}))})};return e.jsxs("form",{action:_,className:"contents",children:[e.jsxs("div",{className:"grid min-h-0 grid-cols-[minmax(0,26rem)_minmax(0,1fr)] gap-4 overflow-hidden",children:[e.jsxs("div",{className:"flex min-h-0 flex-col gap-4 overflow-y-auto pr-1",children:[e.jsxs("div",{className:"grid gap-1.5",children:[e.jsx("label",{htmlFor:m,className:"text-sm font-bold",children:C}),e.jsx(L,{id:m,value:x,placeholder:a.labelPlaceholder,onChange:s=>{g(s.target.value)}})]}),e.jsxs("div",{className:"grid gap-1.5",children:[e.jsx("p",{"aria-hidden":"true",className:"text-sm font-bold",children:D}),e.jsx(q,{label:D,value:a.description,errorMessage:null,renderCodeLinkDialog:c,onChange:A})]}),e.jsxs("section",{"aria-labelledby":i,className:"grid gap-2",children:[e.jsx("h3",{id:i,className:"text-sm font-bold",children:X}),j.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:Y}):null,e.jsx("ul",{className:"grid gap-2",children:j.map(s=>e.jsxs("li",{className:"grid gap-1.5 rounded-md border border-input p-2",onFocusCapture:()=>{N({lineStart:s.lineStart,lineEnd:s.lineEnd})},children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(W,{label:`${Z} of ${s.name}`,options:a.kindOptions,value:s.type,isLabelHidden:!0,className:"w-40 shrink-0",onChange:l=>{ae(a,l)&&E(s.key,{type:l})}}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-muted-foreground tabular-nums",children:S(s)}),e.jsx(G,{icon:"delete",label:`Delete the row ${s.label===""?s.name:s.label}`,onClick:()=>{b(l=>l.filter(o=>o.key!==s.key))}})]}),e.jsx(L,{value:s.label,"aria-label":`${C} of ${s.name}`,placeholder:s.name,onChange:l=>{E(s.key,{label:l.target.value})}})]},s.key))})]})]}),e.jsx(H,{path:a.path,lines:y.lines,statusMessage:y.statusMessage,waypoints:a.waypoints,waypointOptions:"toggle-off",highlightButtonLabel:ee,focusOn:O,onHighlightCode:R})]}),d===null?e.jsx("span",{}):e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:d}),e.jsxs(U,{children:[e.jsx(f,{type:"button",variant:"ghost",onClick:h,children:"Cancel"}),e.jsx(f,{type:"submit",disabled:n,children:n?"Saving…":"Save"})]})]})},ie=({reviewKey:t,change:{segmentId:a,nodeId:n,isSaving:d,errorMessage:c,onSave:p,onClose:h},renderCodeLinkDialog:m})=>{const{form:i,statusMessage:x}=V({...t,segmentId:a,nodeId:n});return e.jsx(w,{open:!0,onOpenChange:g=>{g||h()},children:e.jsxs(T,{className:"h-[calc(100dvh-4rem)] grid-rows-[auto_minmax(0,1fr)_auto_auto] sm:max-w-[min(90rem,calc(100vw-4rem))]",children:[e.jsxs(M,{children:[e.jsx(P,{children:(i==null?void 0:i.title)??z}),e.jsx($,{children:J})]}),i===null?e.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:x}):e.jsx(te,{reviewKey:t,form:i,isSaving:d,errorMessage:c,renderCodeLinkDialog:m,onSave:p,onClose:h},i.nodeId)]})})};export{ie as default};
@@ -0,0 +1 @@
1
+ import{j as e,q as d,L as m,B as p,g as x,h as g,a1 as f,w as h,k as b,o as j}from"./index-DfRj4oZV.js";import{S as N}from"./index-efpZ6EEe.js";const L="-mx-3 block min-w-0 flex-1 rounded-sm px-3 py-2.5 transition-colors duration-[180ms] ease-out hover:bg-muted focus-visible:outline-2 focus-visible:outline-ring",v=({title:i,rows:l,emptyMessage:a,isDuplicating:o,onDuplicate:t})=>e.jsxs("section",{className:"border-t-2 border-foreground pt-5 pb-6",children:[e.jsx("h3",{className:"pb-2 text-xl leading-7 font-bold",children:i}),a===null?null:e.jsx("p",{className:"max-w-[62ch] text-sm text-muted-foreground",children:a}),e.jsx("ul",{children:l.map(s=>e.jsxs("li",{className:"flex items-center gap-4 border-b border-border first:border-t",children:[e.jsxs(d,{to:"/settings/profiles/$id",params:{id:s.id},className:L,children:[e.jsxs("span",{className:"flex flex-wrap items-baseline gap-x-3",children:[e.jsx("span",{className:"font-bold underline decoration-input decoration-1 underline-offset-[0.3em]",children:s.name}),s.defaultLabel===null?null:e.jsx("span",{className:"text-sm font-bold",children:s.defaultLabel})]}),s.summary===null?null:e.jsx("span",{className:"block max-w-[62ch] text-sm",children:s.summary}),e.jsx(m,{segments:s.details,className:"text-sm text-muted-foreground"})]}),e.jsx(p,{type:"button",variant:"outline",size:"sm","aria-label":s.duplicateName,disabled:o,onClick:()=>{t(s.id)},children:s.duplicateLabel})]},s.id))})]}),y="Configurations • Settings • Flight Plan",C="Configurations",E="New configuration",w=()=>{var r,c;const i=x(),l=g(),a=f(),{data:o}=h(i.configuration.list.queryOptions()),t=b(i.configuration.create.mutationOptions({onSuccess:async n=>{n.kind!=="rejected"&&(await l.invalidateQueries(i.configuration.pathFilter()),await a({to:"/settings/profiles/$id",params:{id:n.id}}))}})),s=((r=t.data)==null?void 0:r.kind)==="rejected"?t.data.message:((c=t.error)==null?void 0:c.message)??null;return e.jsxs(e.Fragment,{children:[e.jsx("title",{children:y}),e.jsx(N,{title:C,children:"A configuration decides how the agent writes a review: its voice, how each field is worded and which sections it generates. Open one to read or change it, or duplicate one to start your own."}),e.jsx("div",{className:"pb-6",children:e.jsx(d,{to:"/settings/profiles/create",className:j(),children:E})}),s===null?null:e.jsx("p",{role:"alert",className:"pb-4 text-sm text-destructive",children:s}),o.groups.map(n=>e.jsx(v,{title:n.title,rows:n.rows,emptyMessage:n.emptyMessage,isDuplicating:t.isPending,onDuplicate:u=>{t.mutate({name:null,sourceId:u})}},n.title))]})};export{w as component};
@@ -1 +1 @@
1
- import{j as e}from"./index-CX9sF5Fh.js";import{T as o}from"./index-h6dRc3tV.js";const m="font-sans text-sm [&_.tiptap]:min-h-20 [&_.tiptap]:text-sm [&_.tiptap]:leading-6",p=({label:t,shouldFocus:s,onChange:a})=>e.jsx(o,{label:t,value:"",errorMessage:null,shouldFocus:s,className:m,onChange:a});export{p as default};
1
+ import{j as e}from"./index-DfRj4oZV.js";import{T as o}from"./index-CR5UGYQN.js";const m="font-sans text-sm [&_.tiptap]:min-h-20 [&_.tiptap]:text-sm [&_.tiptap]:leading-6",p=({label:t,shouldFocus:s,onChange:a})=>e.jsx(o,{label:t,value:"",errorMessage:null,shouldFocus:s,className:m,onChange:a});export{p as default};
@@ -1,4 +1,4 @@
1
- var Fs=Object.defineProperty;var Ws=(e,t,n)=>t in e?Fs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var C=(e,t,n)=>Ws(e,typeof t!="symbol"?t+"":t,n);import{a6 as X,a7 as H,a8 as Y,a9 as Ks,aa as Gs,ab as Rr,ac as ue,ad as Gn,ae as Vs,af as Qs,ag as Vn,ah as Xs,ai as Ue,r as O,aj as Ir,ak as ge,al as Zs,am as Ys,an as Z,j as M,ao as B,ap as Js,aq as ei,ar as ti,as as j,at as Ae,au as N,av as vn,aw as re,ax as Le,ay as oe,az as me,aA as an,aB as Fe,aC as ni,aD as ri,aE as $r,aF as Tn,aG as si,aH as ii,aI as oi,aJ as _r,aK as ai,aL as Or,aM as li,aN as ci,aO as ui,aP as Pr,aQ as ot,aR as di,aS as We,aT as hi,aU as pi,aV as fi,aW as gi,aX as mi,aY as Qn,aZ as ki,a_ as yi,a$ as ae,b0 as jt,b1 as bi,b2 as xi,b3 as wi,b4 as Nr,f as Dr,b5 as vi,M as Ti,B as Xn,b6 as Ei}from"./index-CX9sF5Fh.js";/**
1
+ var Fs=Object.defineProperty;var Ws=(e,t,n)=>t in e?Fs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var C=(e,t,n)=>Ws(e,typeof t!="symbol"?t+"":t,n);import{a6 as X,a7 as H,a8 as Y,a9 as Ks,aa as Gs,ab as Rr,ac as ue,ad as Gn,ae as Vs,af as Qs,ag as Vn,ah as Xs,ai as Ue,r as O,aj as Ir,ak as ge,al as Zs,am as Ys,an as Z,j as M,ao as B,ap as Js,aq as ei,ar as ti,as as j,at as Ae,au as N,av as vn,aw as re,ax as Le,ay as oe,az as me,aA as an,aB as Fe,aC as ni,aD as ri,aE as $r,aF as Tn,aG as si,aH as ii,aI as oi,aJ as _r,aK as ai,aL as Or,aM as li,aN as ci,aO as ui,aP as Pr,aQ as ot,aR as di,aS as We,aT as hi,aU as pi,aV as fi,aW as gi,aX as mi,aY as Qn,aZ as ki,a_ as yi,a$ as ae,b0 as jt,b1 as bi,b2 as xi,b3 as wi,b4 as Nr,t as Dr,b5 as vi,N as Ti,B as Xn,b6 as Ei}from"./index-DfRj4oZV.js";/**
2
2
  * @license lucide-react v1.49.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{j as e,d as G,c as z,B as F,f as w,r as N,S as R,A as U,I as Q,g as J,H as X,L as Z,h as P,i as V,J as C,n as ee,k as se,l as b,p as ne,q as te,m as K,K as ae}from"./index-CX9sF5Fh.js";import{P as re}from"./index-CqVakH8R.js";import{L as le,b as oe,u as ie,a as ce,A as de}from"./index-DvVl2gWR.js";import{A as ue}from"./index-DzSYBwXV.js";import{D as me}from"./index-DgodP5aC.js";import{F as pe}from"./index-9KbVyMz4.js";import"./index-D3gI7yfx.js";const xe="Back",y=({backStep:s,submitLabel:n,pendingLabel:l,isPending:r,isReady:c=!0,hint:a=null,errorMessage:u})=>e.jsxs("footer",{className:"mt-6 border-t border-border pt-4",children:[u===null?null:e.jsx("p",{role:"alert",className:"pb-3 text-sm text-destructive",children:u}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2",children:[s===null?null:e.jsx(G,{to:"/setup",search:{step:s},className:z({variant:"ghost"}),children:e.jsx("span",{className:"text-box-cap",children:xe})}),e.jsx("span",{className:"flex-1"}),a===null?null:e.jsx("p",{className:"text-sm text-muted-foreground",children:a}),e.jsx(F,{type:"submit",disabled:r||!c,children:r?l:n})]})]}),A=({title:s,children:n})=>e.jsxs("header",{className:"pb-6",children:[e.jsx("h2",{className:"text-2xl leading-8 font-bold tracking-[-0.015em] text-signal-text",children:s}),e.jsx("p",{className:"mt-2 max-w-[62ch] text-muted-foreground",children:n})]}),he="Choose your agents",ge=({backStep:s,problem:n,isPending:l,...r})=>e.jsxs(e.Fragment,{children:[e.jsx(A,{title:he,children:"A coding agent writes each review. Pick every agent you use. Flight Plan installs its skills, its plugin and its MCP server into the folder of each agent you pick."}),e.jsx(ue,{...r,problem:n,children:e.jsx(y,{backStep:s,submitLabel:"Save and continue",pendingLabel:"Saving…",isPending:l,errorMessage:n!==null&&n.field===null?n.message:null})})]}),je="Choose a default configuration",fe=({backStep:s,problem:n,isPending:l,...r})=>e.jsxs(e.Fragment,{children:[e.jsx(A,{title:je,children:"A configuration decides how the agent writes a review: the voice of its prose, how each part is worded, and which sections it generates. The structure of a review stays the same."}),e.jsxs(me,{...r,children:[e.jsxs("ul",{className:"max-w-[62ch] list-disc pt-4 pl-5 text-sm text-muted-foreground",children:[e.jsx("li",{children:"You can pick another configuration each time you create a Flight Plan."}),e.jsx("li",{children:"You can create your own configurations later, in the settings."})]}),e.jsx(y,{backStep:s,submitLabel:"Save and continue",pendingLabel:"Saving…",isPending:l,errorMessage:(n==null?void 0:n.message)??null})]})]}),be="Connect your git forge",Ne=({backStep:s,problem:n,isPending:l,...r})=>e.jsxs(e.Fragment,{children:[e.jsx(A,{title:be,children:"A forge hosts your pull requests. Pick every way Flight Plan may reach one, and choose the default. Local git works without a forge, with fewer features."}),e.jsx(pe,{...r,problem:n,children:e.jsx(y,{backStep:s,submitLabel:"Save and continue",pendingLabel:"Saving…",isPending:l,errorMessage:n!==null&&n.field===null?n.message:null})})]}),Se="Add your repositories",v="grid grid-cols-[2.5rem_minmax(0,1fr)]",ve=[],W=({label:s,hint:n,placeholder:l,authorRole:r,repositoryName:c,authorSearch:a,onQueryChange:u,onSelect:o})=>{const m=a.repositoryName===c&&a.role===r,p=m?a.options:ve;return e.jsx(oe,{label:s,hint:n,placeholder:l,query:m?a.query:"",options:p,message:m?a.message:null,errorMessage:m?a.errorMessage:null,onQueryChange:t=>{u(r,t)},onOpen:()=>{u(r,m?a.query:"")},onSelect:o})},we=({repositoryName:s,selfAuthor:n,authorSearch:l,onAuthorQueryChange:r,onSelfAuthorChange:c})=>e.jsxs("div",{className:v,children:[e.jsxs("span",{"aria-hidden":"true",className:"flex flex-col items-center",children:[e.jsx("span",{className:"h-2 w-1 bg-(--line)"}),e.jsx(R,{status:n.author===null?"no-review":"merged"}),e.jsx("span",{className:"w-1 flex-1 bg-(--line)"})]}),n.author===null?e.jsx("div",{className:"pt-1 pb-3",children:e.jsx(W,{label:`Which user are you in ${s}?`,hint:n.hint,placeholder:"Type your name or email",authorRole:"self",repositoryName:s,authorSearch:l,onQueryChange:r,onSelect:c})}):e.jsxs("div",{className:"flex max-w-md items-center gap-2 py-1",children:[e.jsx(U,{imageUrl:n.author.avatarUrl,monogram:n.author.monogram}),e.jsx("span",{className:"min-w-0 truncate",children:n.author.name}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-muted-foreground",children:n.author.detail}),e.jsx("span",{className:"text-sm font-bold",children:n.stateLabel}),e.jsx(Q,{icon:"close",label:`Choose another user as you in ${s}`,onClick:()=>{c(null)}})]})]}),ye=({repository:s,authorSearch:n,onRemove:l,onAuthorQueryChange:r,onAuthorTrackingChange:c,onSelfAuthorChange:a})=>{const u=N.useId();return e.jsxs("section",{"aria-labelledby":u,className:w("border-t-2 border-foreground pt-5 pb-6",J[s.lineColor]),children:[e.jsxs("div",{className:v,children:[e.jsxs("span",{"aria-hidden":"true",className:"flex flex-col items-center",children:[e.jsx(le,{label:s.lineLabel}),e.jsx("span",{className:"w-1 flex-1 bg-(--line)"})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 pb-2",children:[e.jsxs("div",{className:"min-w-0 flex-1 basis-64",children:[e.jsx("h2",{id:u,className:"text-xl leading-7 font-semibold tracking-[-0.01em] text-foreground",children:s.name}),e.jsx("p",{className:"font-mono text-[0.82rem] wrap-anywhere text-muted-foreground",children:s.path})]}),e.jsx(F,{type:"button",variant:"ghost",size:"sm","aria-label":`Remove ${s.name}`,onClick:l,children:"Remove"})]})]}),s.selfAuthor===null?null:e.jsx(we,{repositoryName:s.name,selfAuthor:s.selfAuthor,authorSearch:n,onAuthorQueryChange:r,onSelfAuthorChange:a}),e.jsx("ul",{"aria-label":`Tracked users of ${s.name}`,children:s.trackedAuthors.map(o=>e.jsxs("li",{className:v,children:[e.jsxs("span",{"aria-hidden":"true",className:"flex flex-col items-center",children:[e.jsx("span",{className:"h-2 w-1 bg-(--line)"}),e.jsx(R,{status:"merged"}),e.jsx("span",{className:"w-1 flex-1 bg-(--line)"})]}),e.jsxs("div",{className:"flex max-w-md items-center gap-2 py-1",children:[e.jsx(U,{imageUrl:o.avatarUrl,monogram:o.monogram}),e.jsx("span",{className:"min-w-0 truncate",children:o.name}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-muted-foreground",children:o.detail}),e.jsx(Q,{icon:"close",label:`Stop tracking ${o.name}`,onClick:()=>{c(o.id,!1)}})]})]},o.id))}),e.jsxs("div",{className:v,children:[e.jsxs("span",{"aria-hidden":"true",className:"flex flex-col items-center",children:[e.jsx("span",{className:"h-6 w-1 bg-(--line)"}),e.jsx("span",{className:"h-1 w-4 bg-(--line)"})]}),e.jsxs("div",{className:"pt-2",children:[s.missingAuthorMessage===null?null:e.jsx("p",{className:"max-w-[62ch] pb-2 text-sm",children:s.missingAuthorMessage}),e.jsx(W,{label:`Track a user in ${s.name}`,hint:s.authorSearchHint,placeholder:s.authorSearchPlaceholder,authorRole:"tracked",repositoryName:s.name,authorSearch:n,onQueryChange:r,onSelect:o=>{c(o,!0)}})]})]})]})},Ae=({repositories:s,repositoryErrorMessage:n,authorSearch:l,isReadyToFinish:r,finishHint:c,backStep:a,errorMessage:u,isPending:o,onOpenAddRepository:m,onRemoveRepository:p,onAuthorQueryChange:t,onAuthorTrackingChange:f,onSelfAuthorChange:i,onFinish:g})=>e.jsxs("form",{action:g,children:[e.jsx(A,{title:Se,children:"Flight Plan lists the pull requests and branches of each repository you add, and follows the users you track in it."}),e.jsxs("div",{className:"pb-6",children:[e.jsx(F,{type:"button",onClick:m,children:"Add repository"}),n===null?null:e.jsx("p",{role:"alert",className:"pt-2 text-sm text-destructive",children:n})]}),s.length===0?e.jsxs("div",{className:w(v,"border-t-2 border-foreground pt-5 [--line:var(--muted-foreground)]"),children:[e.jsxs("span",{"aria-hidden":"true",className:"flex flex-col items-center",children:[e.jsx("span",{className:"h-4 w-1 bg-(--line)"}),e.jsx("span",{className:"h-1 w-4 bg-(--line)"})]}),e.jsx("p",{className:"py-1.5 text-sm text-muted-foreground",children:"No repositories yet. Add one to start."})]}):null,s.map(d=>e.jsx(ye,{repository:d,authorSearch:l,onRemove:()=>{p(d.name)},onAuthorQueryChange:(j,x)=>{t(d.name,j,x)},onAuthorTrackingChange:(j,x)=>{f(d.name,j,x)},onSelfAuthorChange:j=>{i(d.name,j)}},d.name)),e.jsx(y,{backStep:a,submitLabel:"Finish setup",pendingLabel:"Finishing…",isPending:o,isReady:r,hint:c,errorMessage:u})]}),ke="Setup steps",Le={saved:"merged",current:"no-review",upcoming:"draft"},Ce={saved:"text-signal-text",current:"font-bold text-signal-text",upcoming:"text-muted-foreground"},Fe=({stop:s})=>s.state==="current"?e.jsx("span",{"aria-current":"step",children:s.label}):s.isReachable?e.jsx(G,{to:"/setup",search:{step:s.step},className:"rounded-sm underline decoration-input underline-offset-4 hover:decoration-foreground",children:s.label}):e.jsx("span",{children:s.label}),Re=({stops:s})=>e.jsx("nav",{"aria-label":ke,children:e.jsx("ol",{children:s.map(n=>e.jsxs("li",{className:"group grid min-h-22 grid-cols-[2.5rem_minmax(0,1fr)]",children:[e.jsxs("span",{"aria-hidden":"true",className:"flex flex-col items-center",children:[e.jsx("span",{className:"h-0.5 w-1 bg-(--line) group-first:invisible"}),e.jsx(R,{status:Le[n.state]}),e.jsx("span",{className:"w-1 flex-1 bg-(--line) group-last:invisible"})]}),e.jsxs("div",{className:"pb-5",children:[e.jsxs("p",{className:w("leading-6",Ce[n.state]),children:[e.jsx(Fe,{stop:n}),e.jsx("span",{className:"sr-only",children:`, ${n.stateLabel}`})]}),X(n.lines).map(l=>e.jsx(Z,{segments:l.item,className:"text-sm text-muted-foreground"},l.key))]})]},n.step))})}),Pe="[--line:var(--primary)]",Te="Setup",Ee="Setup • Flight Plan",Oe="Searching…",Be=({repositories:s,isReadyToFinish:n,finishHint:l,backStep:r,onChanged:c})=>{var B,I,_,q,M,D,$,H;const a=P(),u=V(),o=C.useNavigate(),[m,p]=N.useState(!1),[t,f]=N.useState(null),i=ie(m),g=ce({isEnabled:m,folderPath:i.search.query,repositoryName:null,saved:null}),d=N.useDeferredValue(t),j=K({...a.setup.searchAuthors.queryOptions({repositoryName:(d==null?void 0:d.repositoryName)??"",role:(d==null?void 0:d.role)??"tracked",query:(d==null?void 0:d.query)??""}),enabled:d!==null,placeholderData:ae}),x=b(a.setup.addRepository.mutationOptions({onSuccess:async()=>{p(!1),i.reset(),g.reset(),await c()}})),T=b(a.setup.removeRepository.mutationOptions({onSuccess:c})),E=b(a.setup.setAuthorTracking.mutationOptions({onSuccess:c})),O=b(a.setup.setSelfAuthor.mutationOptions({onSuccess:c})),k=b(a.setup.complete.mutationOptions({onSuccess:async h=>{u.removeQueries({type:"inactive"}),await o({to:h.redirectTo})}})),Y=()=>{x.reset(),i.reset(),g.reset(),p(!1)};return e.jsxs(e.Fragment,{children:[e.jsx(Ae,{repositories:s,repositoryErrorMessage:((B=T.error)==null?void 0:B.message)??null,authorSearch:{repositoryName:(t==null?void 0:t.repositoryName)??null,role:(t==null?void 0:t.role)??null,query:(t==null?void 0:t.query)??"",options:((I=j.data)==null?void 0:I.options)??[],message:((_=j.data)==null?void 0:_.message)??(j.isPending?Oe:null),errorMessage:((q=j.error)==null?void 0:q.message)??((M=E.error)==null?void 0:M.message)??((D=O.error)==null?void 0:D.message)??null},isReadyToFinish:n,finishHint:l,backStep:r,errorMessage:(($=k.error)==null?void 0:$.message)??null,isPending:k.isPending,onOpenAddRepository:()=>{p(!0)},onRemoveRepository:h=>{T.mutate({name:h})},onAuthorQueryChange:(h,S,L)=>{f({repositoryName:h,role:S,query:L})},onSelfAuthorChange:(h,S)=>{f(null),O.mutate({repositoryName:h,authorId:S})},onAuthorTrackingChange:(h,S,L)=>{f(null),E.mutate({repositoryName:h,authorId:S,isTracked:L})},onFinish:()=>{k.mutate({})}}),e.jsx(de,{isOpen:m,search:i.search,browse:i.browse,authors:g.authors,isAdding:x.isPending,errorMessage:((H=x.error)==null?void 0:H.message)??null,onQueryChange:i.onQueryChange,onChooseFolder:h=>{x.reset(),i.onChooseFolder(h)},onAuthorQueryChange:g.onAuthorQueryChange,onAuthorSelect:g.onAuthorSelect,onSelfAuthorRemove:g.onSelfAuthorRemove,onTrackedAuthorRemove:g.onTrackedAuthorRemove,onSubmit:()=>{x.mutate({path:i.search.query,...g.selection})},onBrowse:()=>{x.reset(),i.onBrowse()},onBrowseFolder:i.onBrowseFolder,onBrowseClose:()=>{x.reset(),i.onBrowseClose()},onClose:Y})]})},Ie=({form:s})=>{var a;const n=P(),[l,r]=N.useState(null),c=K({...n.setup.browseFolders.queryOptions({path:l??"",purpose:"install-folder"}),enabled:l!==null});return e.jsx(ge,{...s,folderBrowser:l===null?null:c.data??null,folderBrowserErrorMessage:((a=c.error)==null?void 0:a.message)??null,onBrowseFolder:r,onBrowseEnd:()=>{r(null)}})},Ue=()=>{var f;const s=P(),n=V(),l=C.useNavigate(),r=N.use(ee),{step:c=null}=C.useSearch(),{data:a}=se(s.setup.get.queryOptions({step:c})),u=async()=>{n.removeQueries({...s.setup.pathFilter(),type:"inactive"}),await n.invalidateQueries(s.setup.pathFilter())},o=b(s.setup.saveStep.mutationOptions({onSuccess:async i=>{i.kind!=="rejected"&&(await u(),await l({search:{step:i.nextStep}}))}})),m=((f=o.data)==null?void 0:f.kind)==="rejected"?o.data:null,p=o.error===null?m:{message:o.error.message,field:null},{form:t}=a;return e.jsxs(e.Fragment,{children:[e.jsx("title",{children:Ee}),r===null?null:ne.createPortal(e.jsxs(e.Fragment,{children:[e.jsx(te,{lineColor:"primary"}),e.jsxs("p",{className:"flex items-baseline gap-3",children:[e.jsx("span",{className:"font-bold",children:Te}),e.jsx("span",{className:"text-sm text-sign-muted tabular-nums",children:a.progressLabel})]})]}),r),e.jsxs("header",{className:"pb-8",children:[e.jsx("h1",{className:re,children:"Welcome to Flight Plan"}),e.jsx("p",{className:"mt-1 max-w-[62ch] text-muted-foreground",children:"Let's get you ready for your first review. It takes four short steps, and each one is saved as you go, so you can stop and pick up where you left off."})]}),e.jsxs("div",{className:w("grid gap-x-10 gap-y-8 lg:grid-cols-[17rem_minmax(0,1fr)]",Pe),children:[e.jsx("div",{className:"self-start lg:sticky lg:top-22",children:e.jsx(Re,{stops:a.route})}),e.jsxs("div",{className:"min-w-0",children:[t.step==="agents"?e.jsx(Ie,{form:{agents:t.agents,defaultAgent:t.defaultAgent,connection:t.connection,connectionOptions:t.connectionOptions,backStep:a.backStep,problem:p,isPending:o.isPending,onSubmit:i=>{o.mutate({step:"agents",...i})}}},t.step):null,t.step==="forges"?e.jsx(Ne,{forges:t.forges,defaultForge:t.defaultForge,backStep:a.backStep,problem:p,isPending:o.isPending,onSubmit:i=>{o.mutate({step:"forges",...i})}},t.step):null,t.step==="configuration"?e.jsx(fe,{presets:t.presets,selectedPreset:t.selectedPreset,backStep:a.backStep,problem:p,isPending:o.isPending,onSubmit:i=>{o.mutate({step:"configuration",preset:i})}},t.step):null,t.step==="repositories"?e.jsx(Be,{repositories:t.repositories,isReadyToFinish:t.isReadyToFinish,finishHint:t.finishHint,backStep:a.backStep,onChanged:u}):null]})]})]})};export{Ue as component};
1
+ import{j as e,q as H,o as Y,B as F,t as w,r as N,p as R,A as U,I as Q,v as J,K as X,L as Z,g as P,h as V,M as L,x as ee,w as se,k as b,z as te,C as ne,i as z,l as ae}from"./index-DfRj4oZV.js";import{P as re}from"./index-CqVakH8R.js";import{L as le,b as oe,u as ie,a as ce,A as de}from"./index-D-k5POv5.js";import{A as ue}from"./index-Dw5NpM9d.js";import{D as me}from"./index-CUqlioqL.js";import{F as pe}from"./index-CydhSU9g.js";import"./index-Dn9qaXzX.js";const xe="Back",y=({backStep:s,submitLabel:t,pendingLabel:l,isPending:r,isReady:c=!0,hint:a=null,errorMessage:u})=>e.jsxs("footer",{className:"mt-6 border-t border-border pt-4",children:[u===null?null:e.jsx("p",{role:"alert",className:"pb-3 text-sm text-destructive",children:u}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2",children:[s===null?null:e.jsx(H,{to:"/setup",search:{step:s},className:Y({variant:"ghost"}),children:e.jsx("span",{className:"text-box-cap",children:xe})}),e.jsx("span",{className:"flex-1"}),a===null?null:e.jsx("p",{className:"text-sm text-muted-foreground",children:a}),e.jsx(F,{type:"submit",disabled:r||!c,children:r?l:t})]})]}),A=({title:s,children:t})=>e.jsxs("header",{className:"pb-6",children:[e.jsx("h2",{className:"text-2xl leading-8 font-bold tracking-[-0.015em] text-signal-text",children:s}),e.jsx("p",{className:"mt-2 max-w-[62ch] text-muted-foreground",children:t})]}),he="Choose your agents",ge=({backStep:s,problem:t,isPending:l,...r})=>e.jsxs(e.Fragment,{children:[e.jsx(A,{title:he,children:"A coding agent writes each review. Pick every agent you use. Flight Plan installs its skills, its plugin and its MCP server into the folder of each agent you pick."}),e.jsx(ue,{...r,problem:t,children:e.jsx(y,{backStep:s,submitLabel:"Save and continue",pendingLabel:"Saving…",isPending:l,errorMessage:t!==null&&t.field===null?t.message:null})})]}),je="Choose a default configuration",fe=({backStep:s,problem:t,isPending:l,...r})=>e.jsxs(e.Fragment,{children:[e.jsx(A,{title:je,children:"A configuration decides how the agent writes a review: the voice of its prose, how each part is worded, and which sections it generates. The structure of a review stays the same."}),e.jsxs(me,{...r,children:[e.jsxs("ul",{className:"max-w-[62ch] list-disc pt-4 pl-5 text-sm text-muted-foreground",children:[e.jsx("li",{children:"You can pick another configuration each time you create a Flight Plan."}),e.jsx("li",{children:"You can create your own configurations later, in the settings."})]}),e.jsx(y,{backStep:s,submitLabel:"Save and continue",pendingLabel:"Saving…",isPending:l,errorMessage:(t==null?void 0:t.message)??null})]})]}),be="Connect your git forge",Ne=({backStep:s,problem:t,isPending:l,...r})=>e.jsxs(e.Fragment,{children:[e.jsx(A,{title:be,children:"A forge hosts your pull requests. Pick every way Flight Plan may reach one, and choose the default. Local git works without a forge, with fewer features."}),e.jsx(pe,{...r,problem:t,children:e.jsx(y,{backStep:s,submitLabel:"Save and continue",pendingLabel:"Saving…",isPending:l,errorMessage:t!==null&&t.field===null?t.message:null})})]}),Se="Add your repositories",v="grid grid-cols-[2.5rem_minmax(0,1fr)]",ve=[],K=({label:s,hint:t,placeholder:l,authorRole:r,repositoryName:c,authorSearch:a,onQueryChange:u,onSelect:o})=>{const m=a.repositoryName===c&&a.role===r,p=m?a.options:ve;return e.jsx(oe,{label:s,hint:t,placeholder:l,query:m?a.query:"",options:p,message:m?a.message:null,errorMessage:m?a.errorMessage:null,onQueryChange:n=>{u(r,n)},onOpen:()=>{u(r,m?a.query:"")},onSelect:o})},we=({repositoryName:s,selfAuthor:t,authorSearch:l,onAuthorQueryChange:r,onSelfAuthorChange:c})=>e.jsxs("div",{className:v,children:[e.jsxs("span",{"aria-hidden":"true",className:"flex flex-col items-center",children:[e.jsx("span",{className:"h-2 w-1 bg-(--line)"}),e.jsx(R,{status:t.author===null?"no-review":"merged"}),e.jsx("span",{className:"w-1 flex-1 bg-(--line)"})]}),t.author===null?e.jsx("div",{className:"pt-1 pb-3",children:e.jsx(K,{label:`Which user are you in ${s}?`,hint:t.hint,placeholder:"Type your name or email",authorRole:"self",repositoryName:s,authorSearch:l,onQueryChange:r,onSelect:c})}):e.jsxs("div",{className:"flex max-w-md items-center gap-2 py-1",children:[e.jsx(U,{imageUrl:t.author.avatarUrl,monogram:t.author.monogram}),e.jsx("span",{className:"min-w-0 truncate",children:t.author.name}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-muted-foreground",children:t.author.detail}),e.jsx("span",{className:"text-sm font-bold",children:t.stateLabel}),e.jsx(Q,{icon:"close",label:`Choose another user as you in ${s}`,onClick:()=>{c(null)}})]})]}),ye=({repository:s,authorSearch:t,onRemove:l,onAuthorQueryChange:r,onAuthorTrackingChange:c,onSelfAuthorChange:a})=>{const u=N.useId();return e.jsxs("section",{"aria-labelledby":u,className:w("border-t-2 border-foreground pt-5 pb-6",J[s.lineColor]),children:[e.jsxs("div",{className:v,children:[e.jsxs("span",{"aria-hidden":"true",className:"flex flex-col items-center",children:[e.jsx(le,{label:s.lineLabel}),e.jsx("span",{className:"w-1 flex-1 bg-(--line)"})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 pb-2",children:[e.jsxs("div",{className:"min-w-0 flex-1 basis-64",children:[e.jsx("h2",{id:u,className:"text-xl leading-7 font-semibold tracking-[-0.01em] text-foreground",children:s.name}),e.jsx("p",{className:"font-mono text-[0.82rem] wrap-anywhere text-muted-foreground",children:s.path})]}),e.jsx(F,{type:"button",variant:"ghost",size:"sm","aria-label":`Remove ${s.name}`,onClick:l,children:"Remove"})]})]}),s.selfAuthor===null?null:e.jsx(we,{repositoryName:s.name,selfAuthor:s.selfAuthor,authorSearch:t,onAuthorQueryChange:r,onSelfAuthorChange:a}),e.jsx("ul",{"aria-label":`Tracked users of ${s.name}`,children:s.trackedAuthors.map(o=>e.jsxs("li",{className:v,children:[e.jsxs("span",{"aria-hidden":"true",className:"flex flex-col items-center",children:[e.jsx("span",{className:"h-2 w-1 bg-(--line)"}),e.jsx(R,{status:"merged"}),e.jsx("span",{className:"w-1 flex-1 bg-(--line)"})]}),e.jsxs("div",{className:"flex max-w-md items-center gap-2 py-1",children:[e.jsx(U,{imageUrl:o.avatarUrl,monogram:o.monogram}),e.jsx("span",{className:"min-w-0 truncate",children:o.name}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-muted-foreground",children:o.detail}),e.jsx(Q,{icon:"close",label:`Stop tracking ${o.name}`,onClick:()=>{c(o.id,!1)}})]})]},o.id))}),e.jsxs("div",{className:v,children:[e.jsxs("span",{"aria-hidden":"true",className:"flex flex-col items-center",children:[e.jsx("span",{className:"h-6 w-1 bg-(--line)"}),e.jsx("span",{className:"h-1 w-4 bg-(--line)"})]}),e.jsxs("div",{className:"pt-2",children:[s.missingAuthorMessage===null?null:e.jsx("p",{className:"max-w-[62ch] pb-2 text-sm",children:s.missingAuthorMessage}),e.jsx(K,{label:`Track a user in ${s.name}`,hint:s.authorSearchHint,placeholder:s.authorSearchPlaceholder,authorRole:"tracked",repositoryName:s.name,authorSearch:t,onQueryChange:r,onSelect:o=>{c(o,!0)}})]})]})]})},Ae=({repositories:s,repositoryErrorMessage:t,authorSearch:l,isReadyToFinish:r,finishHint:c,backStep:a,errorMessage:u,isPending:o,onOpenAddRepository:m,onRemoveRepository:p,onAuthorQueryChange:n,onAuthorTrackingChange:f,onSelfAuthorChange:i,onFinish:g})=>e.jsxs("form",{action:g,children:[e.jsx(A,{title:Se,children:"Flight Plan lists the pull requests and branches of each repository you add, and follows the users you track in it."}),e.jsxs("div",{className:"pb-6",children:[e.jsx(F,{type:"button",onClick:m,children:"Add repository"}),t===null?null:e.jsx("p",{role:"alert",className:"pt-2 text-sm text-destructive",children:t})]}),s.length===0?e.jsxs("div",{className:w(v,"border-t-2 border-foreground pt-5 [--line:var(--muted-foreground)]"),children:[e.jsxs("span",{"aria-hidden":"true",className:"flex flex-col items-center",children:[e.jsx("span",{className:"h-4 w-1 bg-(--line)"}),e.jsx("span",{className:"h-1 w-4 bg-(--line)"})]}),e.jsx("p",{className:"py-1.5 text-sm text-muted-foreground",children:"No repositories yet. Add one to start."})]}):null,s.map(d=>e.jsx(ye,{repository:d,authorSearch:l,onRemove:()=>{p(d.name)},onAuthorQueryChange:(j,x)=>{n(d.name,j,x)},onAuthorTrackingChange:(j,x)=>{f(d.name,j,x)},onSelfAuthorChange:j=>{i(d.name,j)}},d.name)),e.jsx(y,{backStep:a,submitLabel:"Finish setup",pendingLabel:"Finishing…",isPending:o,isReady:r,hint:c,errorMessage:u})]}),ke="Setup steps",Ce={saved:"merged",current:"no-review",upcoming:"draft"},Le={saved:"text-signal-text",current:"font-bold text-signal-text",upcoming:"text-muted-foreground"},Fe=({stop:s})=>s.state==="current"?e.jsx("span",{"aria-current":"step",children:s.label}):s.isReachable?e.jsx(H,{to:"/setup",search:{step:s.step},className:"rounded-sm underline decoration-input underline-offset-4 hover:decoration-foreground",children:s.label}):e.jsx("span",{children:s.label}),Re=({stops:s})=>e.jsx("nav",{"aria-label":ke,children:e.jsx("ol",{children:s.map(t=>e.jsxs("li",{className:"group grid min-h-22 grid-cols-[2.5rem_minmax(0,1fr)]",children:[e.jsxs("span",{"aria-hidden":"true",className:"flex flex-col items-center",children:[e.jsx("span",{className:"h-0.5 w-1 bg-(--line) group-first:invisible"}),e.jsx(R,{status:Ce[t.state]}),e.jsx("span",{className:"w-1 flex-1 bg-(--line) group-last:invisible"})]}),e.jsxs("div",{className:"pb-5",children:[e.jsxs("p",{className:w("leading-6",Le[t.state]),children:[e.jsx(Fe,{stop:t}),e.jsx("span",{className:"sr-only",children:`, ${t.stateLabel}`})]}),X(t.lines).map(l=>e.jsx(Z,{segments:l.item,className:"text-sm text-muted-foreground"},l.key))]})]},t.step))})}),Pe="[--line:var(--primary)]",Te="Setup",Ee="Setup • Flight Plan",Oe="Searching…",Be=({repositories:s,isReadyToFinish:t,finishHint:l,backStep:r,onChanged:c})=>{var B,I,_,q,M,D,$,G;const a=P(),u=V(),o=L.useNavigate(),[m,p]=N.useState(!1),[n,f]=N.useState(null),i=ie(m),g=ce({isEnabled:m,folderPath:i.search.query,repositoryName:null,saved:null}),d=N.useDeferredValue(n),j=z({...a.setup.searchAuthors.queryOptions({repositoryName:(d==null?void 0:d.repositoryName)??"",role:(d==null?void 0:d.role)??"tracked",query:(d==null?void 0:d.query)??""}),enabled:d!==null,placeholderData:ae}),x=b(a.setup.addRepository.mutationOptions({onSuccess:async()=>{p(!1),i.reset(),g.reset(),await c()}})),T=b(a.setup.removeRepository.mutationOptions({onSuccess:c})),E=b(a.setup.setAuthorTracking.mutationOptions({onSuccess:c})),O=b(a.setup.setSelfAuthor.mutationOptions({onSuccess:c})),k=b(a.setup.complete.mutationOptions({onSuccess:async h=>{u.removeQueries({type:"inactive"}),await o({to:h.redirectTo})}})),W=()=>{x.reset(),i.reset(),g.reset(),p(!1)};return e.jsxs(e.Fragment,{children:[e.jsx(Ae,{repositories:s,repositoryErrorMessage:((B=T.error)==null?void 0:B.message)??null,authorSearch:{repositoryName:(n==null?void 0:n.repositoryName)??null,role:(n==null?void 0:n.role)??null,query:(n==null?void 0:n.query)??"",options:((I=j.data)==null?void 0:I.options)??[],message:((_=j.data)==null?void 0:_.message)??(j.isPending?Oe:null),errorMessage:((q=j.error)==null?void 0:q.message)??((M=E.error)==null?void 0:M.message)??((D=O.error)==null?void 0:D.message)??null},isReadyToFinish:t,finishHint:l,backStep:r,errorMessage:(($=k.error)==null?void 0:$.message)??null,isPending:k.isPending,onOpenAddRepository:()=>{p(!0)},onRemoveRepository:h=>{T.mutate({name:h})},onAuthorQueryChange:(h,S,C)=>{f({repositoryName:h,role:S,query:C})},onSelfAuthorChange:(h,S)=>{f(null),O.mutate({repositoryName:h,authorId:S})},onAuthorTrackingChange:(h,S,C)=>{f(null),E.mutate({repositoryName:h,authorId:S,isTracked:C})},onFinish:()=>{k.mutate({})}}),e.jsx(de,{isOpen:m,search:i.search,browse:i.browse,authors:g.authors,isAdding:x.isPending,errorMessage:((G=x.error)==null?void 0:G.message)??null,onQueryChange:i.onQueryChange,onChooseFolder:h=>{x.reset(),i.onChooseFolder(h)},onAuthorQueryChange:g.onAuthorQueryChange,onAuthorSelect:g.onAuthorSelect,onSelfAuthorRemove:g.onSelfAuthorRemove,onTrackedAuthorRemove:g.onTrackedAuthorRemove,onSubmit:()=>{x.mutate({path:i.search.query,...g.selection})},onBrowse:()=>{x.reset(),i.onBrowse()},onBrowseFolder:i.onBrowseFolder,onBrowseClose:()=>{x.reset(),i.onBrowseClose()},onClose:W})]})},Ie=({form:s})=>{var a;const t=P(),[l,r]=N.useState(null),c=z({...t.setup.browseFolders.queryOptions({path:l??"",purpose:"install-folder"}),enabled:l!==null});return e.jsx(ge,{...s,folderBrowser:l===null?null:c.data??null,folderBrowserErrorMessage:((a=c.error)==null?void 0:a.message)??null,onBrowseFolder:r,onBrowseEnd:()=>{r(null)}})},Ue=()=>{var f;const s=P(),t=V(),l=L.useNavigate(),r=N.use(ee),{step:c=null}=L.useSearch(),{data:a}=se(s.setup.get.queryOptions({step:c})),u=async()=>{t.removeQueries({...s.setup.pathFilter(),type:"inactive"}),await t.invalidateQueries(s.setup.pathFilter())},o=b(s.setup.saveStep.mutationOptions({onSuccess:async i=>{i.kind!=="rejected"&&(await u(),await l({search:{step:i.nextStep}}))}})),m=((f=o.data)==null?void 0:f.kind)==="rejected"?o.data:null,p=o.error===null?m:{message:o.error.message,field:null},{form:n}=a;return e.jsxs(e.Fragment,{children:[e.jsx("title",{children:Ee}),r===null?null:te.createPortal(e.jsxs(e.Fragment,{children:[e.jsx(ne,{lineColor:"primary"}),e.jsxs("p",{className:"flex items-baseline gap-3",children:[e.jsx("span",{className:"font-bold",children:Te}),e.jsx("span",{className:"text-sm text-sign-muted tabular-nums",children:a.progressLabel})]})]}),r),e.jsxs("header",{className:"pb-8",children:[e.jsx("h1",{className:re,children:"Welcome to Flight Plan"}),e.jsx("p",{className:"mt-1 max-w-[62ch] text-muted-foreground",children:"Let's get you ready for your first review. It takes four short steps, and each one is saved as you go, so you can stop and pick up where you left off."})]}),e.jsxs("div",{className:w("grid gap-x-10 gap-y-8 lg:grid-cols-[17rem_minmax(0,1fr)]",Pe),children:[e.jsx("div",{className:"self-start lg:sticky lg:top-22",children:e.jsx(Re,{stops:a.route})}),e.jsxs("div",{className:"min-w-0",children:[n.step==="agents"?e.jsx(Ie,{form:{agents:n.agents,defaultAgent:n.defaultAgent,connection:n.connection,connectionOptions:n.connectionOptions,backStep:a.backStep,problem:p,isPending:o.isPending,onSubmit:i=>{o.mutate({step:"agents",...i})}}},n.step):null,n.step==="forges"?e.jsx(Ne,{forges:n.forges,defaultForge:n.defaultForge,backStep:a.backStep,problem:p,isPending:o.isPending,onSubmit:i=>{o.mutate({step:"forges",...i})}},n.step):null,n.step==="configuration"?e.jsx(fe,{presets:n.presets,selectedPreset:n.selectedPreset,backStep:a.backStep,problem:p,isPending:o.isPending,onSubmit:i=>{o.mutate({step:"configuration",preset:i})}},n.step):null,n.step==="repositories"?e.jsx(Be,{repositories:n.repositories,isReadyToFinish:n.isReadyToFinish,finishHint:n.finishHint,backStep:a.backStep,onChanged:u}):null]})]})]})};export{Ue as component};
@@ -1 +1 @@
1
- import{r as a,j as e}from"./index-CX9sF5Fh.js";const x=({presets:t,selectedPreset:c,children:l,onSubmit:n})=>{const m=a.useId(),[r,o]=a.useState(c);return e.jsxs("form",{action:()=>{n(r)},children:[e.jsx("ul",{className:"border-t border-border",children:t.map(s=>e.jsx("li",{className:"border-b border-border py-3",children:e.jsxs("label",{className:"flex cursor-pointer items-start gap-3",children:[e.jsx("input",{type:"radio",name:m,checked:r===s.preset,className:"mt-1 size-4 shrink-0 accent-(--primary)",onChange:()=>{o(s.preset)}}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block font-bold",children:s.label}),e.jsx("span",{className:"block max-w-[62ch] text-sm",children:s.bestFor}),e.jsx("span",{className:"block max-w-[62ch] text-sm text-muted-foreground",children:s.description}),s.note===null?null:e.jsx("span",{className:"block max-w-[62ch] text-sm text-muted-foreground",children:s.note})]})]})},s.preset))}),l]})};export{x as D};
1
+ import{r as a,j as e}from"./index-DfRj4oZV.js";const x=({presets:t,selectedPreset:c,children:l,onSubmit:n})=>{const m=a.useId(),[r,o]=a.useState(c);return e.jsxs("form",{action:()=>{n(r)},children:[e.jsx("ul",{className:"border-t border-border",children:t.map(s=>e.jsx("li",{className:"border-b border-border py-3",children:e.jsxs("label",{className:"flex cursor-pointer items-start gap-3",children:[e.jsx("input",{type:"radio",name:m,checked:r===s.preset,className:"mt-1 size-4 shrink-0 accent-(--primary)",onChange:()=>{o(s.preset)}}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block font-bold",children:s.label}),e.jsx("span",{className:"block max-w-[62ch] text-sm",children:s.bestFor}),e.jsx("span",{className:"block max-w-[62ch] text-sm text-muted-foreground",children:s.description}),s.note===null?null:e.jsx("span",{className:"block max-w-[62ch] text-sm text-muted-foreground",children:s.note})]})]})},s.preset))}),l]})};export{x as D};
@@ -1 +1 @@
1
- import{h as u,i as c,l as d,j as a,B as m}from"./index-CX9sF5Fh.js";const v=()=>{var r,l;const s=u(),t=c(),e=d(s.settings.save.mutationOptions({onSuccess:async o=>{o.kind!=="rejected"&&(t.removeQueries({type:"inactive"}),await t.invalidateQueries(s.settings.pathFilter()))}})),i=((r=e.data)==null?void 0:r.kind)==="rejected"?e.data:null,n=e.error===null?i:{message:e.error.message,field:null};return{problem:n,errorMessage:n!==null&&n.field===null?n.message:null,savedMessage:((l=e.data)==null?void 0:l.kind)==="saved"?e.data.message:null,isPending:e.isPending,save:e.mutate}},p="Save",g="Saving…",j=({isPending:s,errorMessage:t,savedMessage:e})=>a.jsxs("footer",{className:"mt-6 border-t border-border pt-4",children:[t===null?null:a.jsx("p",{role:"alert",className:"pb-3 text-sm text-destructive",children:t}),a.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-x-4 gap-y-2",children:[a.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:s?null:e}),a.jsx(m,{type:"submit",disabled:s,children:s?g:p})]})]});export{j as S,v as u};
1
+ import{g as u,h as c,k as d,j as a,B as m}from"./index-DfRj4oZV.js";const v=()=>{var r,l;const s=u(),t=c(),e=d(s.settings.save.mutationOptions({onSuccess:async o=>{o.kind!=="rejected"&&(t.removeQueries({type:"inactive"}),await t.invalidateQueries(s.settings.pathFilter()))}})),i=((r=e.data)==null?void 0:r.kind)==="rejected"?e.data:null,n=e.error===null?i:{message:e.error.message,field:null};return{problem:n,errorMessage:n!==null&&n.field===null?n.message:null,savedMessage:((l=e.data)==null?void 0:l.kind)==="saved"?e.data.message:null,isPending:e.isPending,save:e.mutate}},g="Save",p="Saving…",j=({isPending:s,errorMessage:t,savedMessage:e})=>a.jsxs("footer",{className:"mt-6 border-t border-border pt-4",children:[t===null?null:a.jsx("p",{role:"alert",className:"pb-3 text-sm text-destructive",children:t}),a.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-x-4 gap-y-2",children:[a.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:s?null:e}),a.jsx(m,{type:"submit",disabled:s,children:s?p:g})]})]});export{j as S,v as u};
@@ -0,0 +1 @@
1
+ import{S as r}from"./index-XcYy-NBi.js";import"./index-DfRj4oZV.js";const n=r;export{n as errorComponent};
@@ -1 +1 @@
1
- import{r as u,j as a,f as p,M as y}from"./index-CX9sF5Fh.js";const v="size-4 shrink-0 accent-(--primary)",k="git",C=(e,l,r)=>r?l:e===l?k:e,x=(e,l)=>`${e}:${l}`,F=e=>{const l=e.flatMap(r=>r===null?[]:[r]);return l.length===0?void 0:l.join(" ")},I=({forgeLabel:e,field:l,value:r,errorMessage:m,onChange:h})=>{const n=u.useId(),d=u.useId(),o=u.useId(),c=m!==null;return a.jsxs("div",{className:"grid content-start gap-1.5",children:[a.jsx("label",{htmlFor:n,className:"text-sm font-bold",children:l.label}),l.hint===""?null:a.jsx("p",{id:d,className:"text-sm text-muted-foreground",children:l.hint}),a.jsx(y,{id:n,type:l.isSecret?"password":"text",value:r,placeholder:l.placeholder,autoComplete:"off",spellCheck:!1,"aria-label":`${l.label} for ${e}`,"aria-invalid":c,"aria-describedby":F([l.hint===""?null:d,c?o:null]),className:"font-mono placeholder:font-sans",onChange:b=>{h(b.target.value)}}),c?a.jsx("p",{id:o,role:"alert",className:"text-sm text-destructive",children:m}):null]})},w=({option:e,groupName:l,isPicked:r,isDefault:m,valueByField:h,problem:n,onPickedChange:d,onDefaultChange:o,onFieldChange:c})=>{const f=!(e.availability.kind==="available")||e.isRequired;return a.jsxs("li",{className:"border-b border-border py-3 last:border-b-0",children:[a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsxs("label",{className:p("flex min-w-0 flex-1 items-start gap-3",f?"":"cursor-pointer"),children:[a.jsx("input",{type:"checkbox",checked:r,disabled:f,className:`${v} mt-1`,onChange:t=>{d(t.target.checked)}}),a.jsxs("span",{className:"min-w-0",children:[a.jsx("span",{className:"font-bold",children:e.label}),e.availability.kind==="available"&&e.availability.statusLabel!==null?a.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:e.availability.statusLabel}):null,a.jsx("span",{className:"block max-w-[62ch] text-sm text-muted-foreground",children:e.description}),e.availability.kind==="unavailable"?a.jsxs("span",{className:"block max-w-[62ch] text-sm text-destructive",children:[a.jsx("span",{className:"font-bold",children:"Unavailable."}),` ${e.availability.reason}`]}):null]})]}),a.jsxs("label",{className:"flex cursor-pointer items-center gap-2 pt-0.5 text-sm has-disabled:cursor-default has-disabled:text-muted-foreground",children:[a.jsx("input",{type:"radio",name:l,checked:m,disabled:!r,className:v,onChange:o}),a.jsx("span",{"aria-hidden":"true",children:"Default"}),a.jsx("span",{className:"sr-only",children:`Default forge: ${e.label}`})]})]}),r&&e.fields.length>0?a.jsx("div",{className:"mt-3 grid max-w-xl gap-4 pl-7",children:e.fields.map(t=>{var j;return a.jsx(I,{forgeLabel:e.label,field:t,value:h[x(e.forge,t.name)]??"",errorMessage:((j=n==null?void 0:n.field)==null?void 0:j.owner)===e.forge&&n.field.name===t.name?n.message:null,onChange:s=>{c(t.name,s)}},t.name)})}):null,r&&e.limitation!==null?a.jsxs("div",{className:"mt-2 pl-7 text-sm",children:[a.jsx("p",{children:e.limitation.label}),a.jsx("ul",{className:"list-disc pl-5 text-muted-foreground",children:e.limitation.items.map(t=>a.jsx("li",{children:t},t))})]}):null]})},S=({forges:e,defaultForge:l,problem:r,children:m,onSubmit:h})=>{const n=u.useId(),[d,o]=u.useState(()=>Object.fromEntries(e.map(s=>[s.forge,s.isPicked]))),[c,b]=u.useState(()=>Object.fromEntries(e.flatMap(s=>s.fields.map(i=>[x(s.forge,i.name),i.value])))),[f,t]=u.useState(l),j=()=>{h({forges:e.map(s=>({forge:s.forge,isPicked:d[s.forge]??!1,username:c[x(s.forge,"username")]??"",token:c[x(s.forge,"token")]??"",baseUrl:c[x(s.forge,"baseUrl")]??""})),defaultForge:f})};return a.jsxs("form",{action:j,children:[a.jsx("ul",{className:"border-t border-border",children:e.map(s=>a.jsx(w,{option:s,groupName:n,isPicked:d[s.forge]??!1,isDefault:f===s.forge,valueByField:c,problem:r,onPickedChange:i=>{o(g=>({...g,[s.forge]:i})),t(g=>C(g,s.forge,i))},onDefaultChange:()=>{t(s.forge)},onFieldChange:(i,g)=>{b(N=>({...N,[x(s.forge,i)]:g}))}},s.forge))}),m]})};export{S as F};
1
+ import{r as u,j as a,t as p,N as y}from"./index-DfRj4oZV.js";const N="size-4 shrink-0 accent-(--primary)",k="git",C=(e,l,t)=>t?l:e===l?k:e,x=(e,l)=>`${e}:${l}`,F=e=>{const l=e.flatMap(t=>t===null?[]:[t]);return l.length===0?void 0:l.join(" ")},I=({forgeLabel:e,field:l,value:t,errorMessage:m,onChange:h})=>{const n=u.useId(),d=u.useId(),o=u.useId(),c=m!==null;return a.jsxs("div",{className:"grid content-start gap-1.5",children:[a.jsx("label",{htmlFor:n,className:"text-sm font-bold",children:l.label}),l.hint===""?null:a.jsx("p",{id:d,className:"text-sm text-muted-foreground",children:l.hint}),a.jsx(y,{id:n,type:l.isSecret?"password":"text",value:t,placeholder:l.placeholder,autoComplete:"off",spellCheck:!1,"aria-label":`${l.label} for ${e}`,"aria-invalid":c,"aria-describedby":F([l.hint===""?null:d,c?o:null]),className:"font-mono placeholder:font-sans",onChange:b=>{h(b.target.value)}}),c?a.jsx("p",{id:o,role:"alert",className:"text-sm text-destructive",children:m}):null]})},w=({option:e,groupName:l,isPicked:t,isDefault:m,valueByField:h,problem:n,onPickedChange:d,onDefaultChange:o,onFieldChange:c})=>{const f=!(e.availability.kind==="available")||e.isRequired;return a.jsxs("li",{className:"border-b border-border py-3 last:border-b-0",children:[a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsxs("label",{className:p("flex min-w-0 flex-1 items-start gap-3",f?"":"cursor-pointer"),children:[a.jsx("input",{type:"checkbox",checked:t,disabled:f,className:`${N} mt-1`,onChange:r=>{d(r.target.checked)}}),a.jsxs("span",{className:"min-w-0",children:[a.jsx("span",{className:"font-bold",children:e.label}),e.availability.kind==="available"&&e.availability.statusLabel!==null?a.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:e.availability.statusLabel}):null,a.jsx("span",{className:"block max-w-[62ch] text-sm text-muted-foreground",children:e.description}),e.availability.kind==="unavailable"?a.jsxs("span",{className:"block max-w-[62ch] text-sm text-destructive",children:[a.jsx("span",{className:"font-bold",children:"Unavailable."}),` ${e.availability.reason}`]}):null]})]}),a.jsxs("label",{className:"flex cursor-pointer items-center gap-2 pt-0.5 text-sm has-disabled:cursor-default has-disabled:text-muted-foreground",children:[a.jsx("input",{type:"radio",name:l,checked:m,disabled:!t,className:N,onChange:o}),a.jsx("span",{"aria-hidden":"true",children:"Default"}),a.jsx("span",{className:"sr-only",children:`Default forge: ${e.label}`})]})]}),t&&e.fields.length>0?a.jsx("div",{className:"mt-3 grid max-w-xl gap-4 pl-7",children:e.fields.map(r=>{var j;return a.jsx(I,{forgeLabel:e.label,field:r,value:h[x(e.forge,r.name)]??"",errorMessage:((j=n==null?void 0:n.field)==null?void 0:j.owner)===e.forge&&n.field.name===r.name?n.message:null,onChange:s=>{c(r.name,s)}},r.name)})}):null,t&&e.limitation!==null?a.jsxs("div",{className:"mt-2 pl-7 text-sm",children:[a.jsx("p",{children:e.limitation.label}),a.jsx("ul",{className:"list-disc pl-5 text-muted-foreground",children:e.limitation.items.map(r=>a.jsx("li",{children:r},r))})]}):null]})},S=({forges:e,defaultForge:l,problem:t,children:m,onSubmit:h})=>{const n=u.useId(),[d,o]=u.useState(()=>Object.fromEntries(e.map(s=>[s.forge,s.isPicked]))),[c,b]=u.useState(()=>Object.fromEntries(e.flatMap(s=>s.fields.map(i=>[x(s.forge,i.name),i.value])))),[f,r]=u.useState(l),j=()=>{h({forges:e.map(s=>({forge:s.forge,isPicked:d[s.forge]??!1,username:c[x(s.forge,"username")]??"",token:c[x(s.forge,"token")]??"",baseUrl:c[x(s.forge,"baseUrl")]??""})),defaultForge:f})};return a.jsxs("form",{action:j,children:[a.jsx("ul",{className:"border-t border-border",children:e.map(s=>a.jsx(w,{option:s,groupName:n,isPicked:d[s.forge]??!1,isDefault:f===s.forge,valueByField:c,problem:t,onPickedChange:i=>{o(g=>({...g,[s.forge]:i})),r(g=>C(g,s.forge,i))},onDefaultChange:()=>{r(s.forge)},onFieldChange:(i,g)=>{b(v=>({...v,[x(s.forge,i)]:g}))}},s.forge))}),m]})};export{S as F};
@@ -0,0 +1 @@
1
+ import{g as B,r as x,i as w,l as D,j as e,S as P,A as T,I,D as M,a as U,b as _,c as V,d as v,e as G,B as k,f as $,t as z}from"./index-DfRj4oZV.js";import{F as W}from"./index-Dn9qaXzX.js";const X="Searching…",Y=[],J=({id:l,name:t,detail:r,avatarUrl:s,monogram:n})=>({id:l,name:t,detail:r,avatarUrl:s,monogram:n}),re=({isEnabled:l,folderPath:t,repositoryName:r,saved:s})=>{var R,O,N;const n=B(),[o,d]=x.useState(null),[i,u]=x.useState(null),[a,c]=x.useState(null),h=x.useDeferredValue(a),f=x.useDeferredValue(t),m=o===null?(s==null?void 0:s.selfAuthor)??null:o.author,p=i??(s==null?void 0:s.trackedAuthors)??Y,A=p.map(j=>j.id),S=w({...n.repository.authorForm.queryOptions({path:f}),enabled:l&&r===null,placeholderData:D}),g=w({...n.repository.searchAuthors.queryOptions({path:f,repositoryName:r,role:(h==null?void 0:h.role)??"tracked",query:(h==null?void 0:h.query)??"",selfAuthorId:(m==null?void 0:m.id)??null,trackedAuthorIds:A}),enabled:l&&h!==null,placeholderData:D}),E=(j,y)=>{var q;const F=(q=g.data)==null?void 0:q.options.find(b=>b.id===y);if(F===void 0)return;const C=J(F);c(null),j==="self"?(d({author:C}),u(p.filter(b=>b.id!==C.id))):u([...p.filter(b=>b.id!==C.id),C])};return{authors:{form:(s==null?void 0:s.form)??S.data??null,selfAuthor:m,trackedAuthors:p,search:{role:(a==null?void 0:a.role)??null,query:(a==null?void 0:a.query)??"",options:((R=g.data)==null?void 0:R.options)??[],message:((O=g.data)==null?void 0:O.message)??(g.isPending?X:null),errorMessage:((N=g.error)==null?void 0:N.message)??null}},selection:{selfAuthorId:(m==null?void 0:m.id)??null,trackedAuthorIds:A},onAuthorQueryChange:(j,y)=>{c({role:j,query:y})},onAuthorSelect:E,onSelfAuthorRemove:()=>{d({author:null})},onTrackedAuthorRemove:j=>{u(p.filter(y=>y.id!==j))},reset:()=>{d(null),u(null),c(null)}}},K="Searching…",ne=l=>{var h,f,m;const t=B(),[r,s]=x.useState(""),[n,o]=x.useState(!1),[d,i]=x.useState(null),u=x.useDeferredValue(r),a=w({...t.setup.searchFolders.queryOptions({query:u}),enabled:l,placeholderData:D}),c=w({...t.setup.browseFolders.queryOptions({path:d,purpose:"repository"}),enabled:l&&n,placeholderData:D});return{search:{query:r,options:((h=a.data)==null?void 0:h.options)??[],message:((f=a.data)==null?void 0:f.message)??(a.isPending?K:null)},browse:{isOpen:n,browser:c.data??null,errorMessage:((m=c.error)==null?void 0:m.message)??null},onQueryChange:s,onChooseFolder:p=>{s(p),o(!1)},onBrowse:()=>{o(!0)},onBrowseFolder:i,onBrowseClose:()=>{o(!1)},reset:()=>{s(""),i(null),o(!1)}}},Z=({label:l,hint:t,placeholder:r,query:s,options:n,message:o,errorMessage:d,onQueryChange:i,onOpen:u,onSelect:a})=>e.jsx(P,{label:l,hint:t,placeholder:r,value:s,suggestions:n.map(c=>({id:c.id,label:c.name,detail:c.detail,stateLabel:c.stateLabel,isDisabled:c.isTaken,marker:e.jsx(T,{imageUrl:c.avatarUrl,monogram:c.monogram})})),message:o,errorMessage:d,className:"max-w-md",onValueChange:i,onOpen:u,onSelect:a}),Q=[],L=({author:l,stateLabel:t,removeLabel:r,onRemove:s})=>e.jsxs("div",{className:"flex max-w-md items-center gap-2 py-1",children:[e.jsx(T,{imageUrl:l.avatarUrl,monogram:l.monogram}),e.jsx("span",{className:"min-w-0 truncate",children:l.name}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-muted-foreground",children:l.detail}),t===null?null:e.jsx("span",{className:"text-sm font-bold",children:t}),e.jsx(I,{icon:"close",label:r,onClick:s})]}),H=({label:l,hint:t,placeholder:r,authorRole:s,search:n,onAuthorQueryChange:o,onAuthorSelect:d})=>{const i=n.role===s;return e.jsx(Z,{label:l,hint:t,placeholder:r,query:i?n.query:"",options:i?n.options:Q,message:i?n.message:null,errorMessage:i?n.errorMessage:null,onQueryChange:u=>{o(s,u)},onOpen:()=>{o(s,i?n.query:"")},onSelect:u=>{d(s,u)}})},ee=({hint:l,placeholder:t,selfAuthor:r,search:s,onAuthorQueryChange:n,onAuthorSelect:o,onRemove:d})=>r===null?e.jsx(H,{label:"Which user are you?",hint:l,placeholder:t,authorRole:"self",search:s,onAuthorQueryChange:n,onAuthorSelect:o}):e.jsx(L,{author:r,stateLabel:"You",removeLabel:"Choose another user as you",onRemove:d}),se=({authors:l,onAuthorQueryChange:t,onAuthorSelect:r,onSelfAuthorRemove:s,onTrackedAuthorRemove:n})=>{const{form:o,selfAuthor:d,trackedAuthors:i,search:u}=l;return o===null?e.jsx("p",{role:"status",className:"text-muted-foreground",children:"Reading the author settings…"}):e.jsxs("div",{className:"grid gap-4",children:[o.selfAuthorHint===null?null:e.jsx(ee,{hint:o.selfAuthorHint,placeholder:o.searchPlaceholder,selfAuthor:d,search:u,onAuthorQueryChange:t,onAuthorSelect:r,onRemove:s}),e.jsx(H,{label:"Track a user",hint:o.searchHint,placeholder:o.searchPlaceholder,authorRole:"tracked",search:u,onAuthorQueryChange:t,onAuthorSelect:r}),e.jsx("ul",{"aria-label":"Tracked users",children:i.map(a=>e.jsx("li",{children:e.jsx(L,{author:a,stateLabel:null,removeLabel:`Stop tracking ${a.name}`,onRemove:()=>{n(a.id)}})},a.id))})]})},le="/Users/you/projects/storefront",ae=({isOpen:l,search:t,browse:r,authors:s,isAdding:n,errorMessage:o,onQueryChange:d,onChooseFolder:i,onAuthorQueryChange:u,onAuthorSelect:a,onSelfAuthorRemove:c,onTrackedAuthorRemove:h,onSubmit:f,onBrowse:m,onBrowseFolder:p,onBrowseClose:A,onClose:S})=>e.jsx(M,{open:l,onOpenChange:$(S),children:e.jsxs(U,{className:"sm:max-w-lg",children:[e.jsxs(_,{children:[e.jsx(V,{children:"Add repository"}),e.jsx(v,{children:"Search this machine for a folder that holds a git repository, or type its full path. Then choose the users Flight Plan follows in it."})]}),e.jsxs("form",{action:f,className:"grid gap-4",children:[e.jsx(P,{label:"Repository folder",hint:null,placeholder:le,value:t.query,suggestions:t.options.map(g=>({id:g.path,label:g.path,detail:null,stateLabel:g.stateLabel,isDisabled:g.isAdded})),message:t.message,errorMessage:null,isLiteral:!0,onValueChange:d,onSelect:i,onEnter:f}),e.jsx(se,{authors:s,onAuthorQueryChange:u,onAuthorSelect:a,onSelfAuthorRemove:c,onTrackedAuthorRemove:h}),o===null?null:e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:o}),e.jsxs(G,{children:[e.jsx(k,{type:"button",variant:"outline",className:"sm:mr-auto",onClick:m,children:"Browse folders"}),e.jsx(k,{type:"button",variant:"ghost",onClick:S,children:"Cancel"}),e.jsx(k,{type:"submit",disabled:n,children:n?"Adding…":"Add"})]})]}),e.jsx(W,{isOpen:r.isOpen,title:"Browse folders",description:"Open folders until you reach a repository, then choose it.",browser:r.browser,errorMessage:r.errorMessage,onOpenFolder:p,onChooseRepository:i,onChooseFolder:null,onClose:A})]})}),ie=({label:l,className:t})=>e.jsx("span",{"aria-hidden":"true",className:z("inline-flex size-7 shrink-0 items-center justify-center rounded-full bg-(--line) text-sm leading-none font-bold text-line-foreground",t),children:e.jsx("span",{className:"text-box-cap",children:l})});export{ae as A,ie as L,se as R,re as a,Z as b,ne as u};
@@ -1 +1 @@
1
- import{h as b,i as y,l as I,r as n,j as e,M as k,B as p}from"./index-CX9sF5Fh.js";import{T as N}from"./index-h6dRc3tV.js";const w=(c,{segmentId:h,waypointId:u},g)=>{var a,i;const t=b(),l=y(),s=I(t.review.editWalkthrough.mutationOptions({onSuccess:async r=>{r.kind==="saved"&&(await l.invalidateQueries(t.review.get.pathFilter()),g())}})),d=((a=s.data)==null?void 0:a.kind)==="rejected"?s.data.message:null;return{isSaving:s.isPending,errorMessage:d??((i=s.error)==null?void 0:i.message)??null,onSave:r=>{s.mutate({...c,segmentId:h,edit:{kind:"change-waypoint",waypointId:u,...r}})}}},M="Title",j="Reading",R="Say what you changed in this code and what the change is for.",_="Needs Attention",L="Mark this change as an important part of the code review. This helps the reviewer see where to look first.",v="Additional context (optional)",C="Say why this change is important, or what the reviewer should check in it.",H=({reviewKey:c,segmentId:h,waypointId:u,legend:g,text:t,renderCodeLinkDialog:l,onClose:s})=>{const d=n.useId(),a=n.useId(),[i,r]=n.useState(t.title),[T,A]=n.useState(t.reading),[m,f]=n.useState(t.needsAttention!==null),[E,S]=n.useState(t.needsAttention??""),o=w(c,{segmentId:h,waypointId:u},s);return e.jsxs("form",{"aria-label":g,action:()=>{o.onSave({title:i,reading:T,needsAttention:m?E:null})},className:"grid gap-3",children:[e.jsxs("div",{className:"grid gap-1.5",children:[e.jsx("label",{htmlFor:d,className:"text-sm font-bold",children:M}),e.jsx(k,{id:d,value:i,onChange:x=>{r(x.target.value)}})]}),e.jsxs("div",{className:"grid gap-1.5",children:[e.jsx("p",{"aria-hidden":"true",className:"text-sm font-bold",children:j}),e.jsx("p",{className:"text-sm text-muted-foreground",children:R}),e.jsx(N,{label:j,value:t.reading,errorMessage:null,renderCodeLinkDialog:l,onChange:A})]}),e.jsxs("label",{className:"flex items-center gap-2 text-sm font-bold",children:[e.jsx("input",{type:"checkbox","aria-describedby":a,checked:m,onChange:x=>{f(x.target.checked)}}),_]}),e.jsx("p",{id:a,className:"-mt-2 text-sm text-muted-foreground",children:L}),e.jsxs("div",{hidden:!m,className:"grid gap-1.5",children:[e.jsx("p",{"aria-hidden":"true",className:"text-sm font-bold",children:v}),e.jsx("p",{className:"text-sm text-muted-foreground",children:C}),e.jsx(N,{label:v,value:t.needsAttention??"",errorMessage:null,renderCodeLinkDialog:l,onChange:S})]}),o.errorMessage===null?null:e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:o.errorMessage}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(p,{type:"button",variant:"ghost",onClick:s,children:"Cancel"}),e.jsx(p,{type:"submit",disabled:o.isSaving,children:o.isSaving?"Saving…":"Save"})]})]})};export{H as default};
1
+ import{g as b,h as y,k as I,r as n,j as e,N as k,B as p}from"./index-DfRj4oZV.js";import{T as N}from"./index-CR5UGYQN.js";const w=(c,{segmentId:h,waypointId:u},g)=>{var a,i;const t=b(),d=y(),s=I(t.review.editWalkthrough.mutationOptions({onSuccess:async r=>{r.kind==="saved"&&(await d.invalidateQueries(t.review.get.pathFilter()),g())}})),l=((a=s.data)==null?void 0:a.kind)==="rejected"?s.data.message:null;return{isSaving:s.isPending,errorMessage:l??((i=s.error)==null?void 0:i.message)??null,onSave:r=>{s.mutate({...c,segmentId:h,edit:{kind:"change-waypoint",waypointId:u,...r}})}}},M="Title",j="Reading",R="Say what you changed in this code and what the change is for.",_="Needs Attention",L="Mark this change as an important part of the code review. This helps the reviewer see where to look first.",v="Additional context (optional)",C="Say why this change is important, or what the reviewer should check in it.",H=({reviewKey:c,segmentId:h,waypointId:u,legend:g,text:t,renderCodeLinkDialog:d,onClose:s})=>{const l=n.useId(),a=n.useId(),[i,r]=n.useState(t.title),[T,A]=n.useState(t.reading),[m,f]=n.useState(t.needsAttention!==null),[E,S]=n.useState(t.needsAttention??""),o=w(c,{segmentId:h,waypointId:u},s);return e.jsxs("form",{"aria-label":g,action:()=>{o.onSave({title:i,reading:T,needsAttention:m?E:null})},className:"grid gap-3",children:[e.jsxs("div",{className:"grid gap-1.5",children:[e.jsx("label",{htmlFor:l,className:"text-sm font-bold",children:M}),e.jsx(k,{id:l,value:i,onChange:x=>{r(x.target.value)}})]}),e.jsxs("div",{className:"grid gap-1.5",children:[e.jsx("p",{"aria-hidden":"true",className:"text-sm font-bold",children:j}),e.jsx("p",{className:"text-sm text-muted-foreground",children:R}),e.jsx(N,{label:j,value:t.reading,errorMessage:null,renderCodeLinkDialog:d,onChange:A})]}),e.jsxs("label",{className:"flex items-center gap-2 text-sm font-bold",children:[e.jsx("input",{type:"checkbox","aria-describedby":a,checked:m,onChange:x=>{f(x.target.checked)}}),_]}),e.jsx("p",{id:a,className:"-mt-2 text-sm text-muted-foreground",children:L}),e.jsxs("div",{hidden:!m,className:"grid gap-1.5",children:[e.jsx("p",{"aria-hidden":"true",className:"text-sm font-bold",children:v}),e.jsx("p",{className:"text-sm text-muted-foreground",children:C}),e.jsx(N,{label:v,value:t.needsAttention??"",errorMessage:null,renderCodeLinkDialog:d,onChange:S})]}),o.errorMessage===null?null:e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:o.errorMessage}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(p,{type:"button",variant:"ghost",onClick:s,children:"Cancel"}),e.jsx(p,{type:"submit",disabled:o.isSaving,children:o.isSaving?"Saving…":"Save"})]})]})};export{H as default};