@shepai/cli 1.119.0 → 1.120.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/dist/src/presentation/web/components/layouts/app-shell/app-shell.d.ts.map +1 -1
  2. package/dist/src/presentation/web/components/layouts/app-shell/app-shell.js +8 -3
  3. package/dist/tsconfig.build.tsbuildinfo +1 -1
  4. package/package.json +1 -1
  5. package/web/.next/BUILD_ID +1 -1
  6. package/web/.next/build-manifest.json +2 -2
  7. package/web/.next/fallback-build-manifest.json +2 -2
  8. package/web/.next/prerender-manifest.json +3 -3
  9. package/web/.next/required-server-files.js +2 -2
  10. package/web/.next/required-server-files.json +2 -2
  11. package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +21 -21
  12. package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  13. package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  14. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +27 -27
  15. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  16. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  17. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +27 -27
  18. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  19. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  20. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +19 -19
  21. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  22. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  23. package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +21 -21
  24. package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  25. package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  26. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +27 -27
  27. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  28. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  29. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +27 -27
  30. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  31. package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  32. package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +19 -19
  33. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  34. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  35. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +19 -19
  36. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  37. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  38. package/web/.next/server/app/_global-error.html +2 -2
  39. package/web/.next/server/app/_global-error.rsc +1 -1
  40. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  41. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  42. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  43. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  44. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  45. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  46. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  47. package/web/.next/server/app/settings/page/server-reference-manifest.json +6 -6
  48. package/web/.next/server/app/settings/page.js.nft.json +1 -1
  49. package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  50. package/web/.next/server/app/skills/page/server-reference-manifest.json +6 -6
  51. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  52. package/web/.next/server/app/tools/page/server-reference-manifest.json +6 -6
  53. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  54. package/web/.next/server/app/version/page/server-reference-manifest.json +1 -1
  55. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  56. package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
  57. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
  58. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
  59. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_ed372306.js +1 -1
  60. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_ed372306.js.map +1 -1
  61. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_32e26434.js +1 -1
  62. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_32e26434.js.map +1 -1
  63. package/web/.next/server/chunks/ssr/[root-of-the-server]__06fef644._.js +1 -1
  64. package/web/.next/server/chunks/ssr/[root-of-the-server]__3b14e5a0._.js +1 -1
  65. package/web/.next/server/chunks/ssr/[root-of-the-server]__3b14e5a0._.js.map +1 -1
  66. package/web/.next/server/chunks/ssr/[root-of-the-server]__545792ab._.js +1 -1
  67. package/web/.next/server/chunks/ssr/[root-of-the-server]__545792ab._.js.map +1 -1
  68. package/web/.next/server/chunks/ssr/[root-of-the-server]__6b17a22d._.js +1 -1
  69. package/web/.next/server/chunks/ssr/[root-of-the-server]__6b17a22d._.js.map +1 -1
  70. package/web/.next/server/chunks/ssr/[root-of-the-server]__6bb00d90._.js +2 -2
  71. package/web/.next/server/chunks/ssr/[root-of-the-server]__6bb00d90._.js.map +1 -1
  72. package/web/.next/server/chunks/ssr/[root-of-the-server]__804c006d._.js +1 -1
  73. package/web/.next/server/chunks/ssr/[root-of-the-server]__804c006d._.js.map +1 -1
  74. package/web/.next/server/chunks/ssr/[root-of-the-server]__8b59c03e._.js +1 -1
  75. package/web/.next/server/chunks/ssr/[root-of-the-server]__8b59c03e._.js.map +1 -1
  76. package/web/.next/server/chunks/ssr/[root-of-the-server]__8c553503._.js +2 -2
  77. package/web/.next/server/chunks/ssr/[root-of-the-server]__994ad9fe._.js +1 -1
  78. package/web/.next/server/chunks/ssr/[root-of-the-server]__994ad9fe._.js.map +1 -1
  79. package/web/.next/server/chunks/ssr/[root-of-the-server]__a022445f._.js +2 -2
  80. package/web/.next/server/chunks/ssr/[root-of-the-server]__a7de2711._.js +2 -2
  81. package/web/.next/server/chunks/ssr/[root-of-the-server]__c9c1cfee._.js +1 -1
  82. package/web/.next/server/chunks/ssr/[root-of-the-server]__c9c1cfee._.js.map +1 -1
  83. package/web/.next/server/chunks/ssr/_135edb9c._.js +1 -1
  84. package/web/.next/server/chunks/ssr/_135edb9c._.js.map +1 -1
  85. package/web/.next/server/chunks/ssr/{_bed4bbb9._.js → _16e2ff25._.js} +2 -2
  86. package/web/.next/server/chunks/ssr/{_bed4bbb9._.js.map → _16e2ff25._.js.map} +1 -1
  87. package/web/.next/server/chunks/ssr/_2f6f48b8._.js +1 -1
  88. package/web/.next/server/chunks/ssr/_2f6f48b8._.js.map +1 -1
  89. package/web/.next/server/chunks/ssr/_503b26e9._.js +3 -0
  90. package/web/.next/server/chunks/ssr/{_59ae996e._.js.map → _503b26e9._.js.map} +1 -1
  91. package/web/.next/server/chunks/ssr/_ab069e13._.js +1 -1
  92. package/web/.next/server/chunks/ssr/_ab069e13._.js.map +1 -1
  93. package/web/.next/server/chunks/ssr/{_aeb74a70._.js → _c93f4352._.js} +2 -2
  94. package/web/.next/server/chunks/ssr/{_aeb74a70._.js.map → _c93f4352._.js.map} +1 -1
  95. package/web/.next/server/chunks/ssr/_cc77a143._.js +1 -1
  96. package/web/.next/server/chunks/ssr/_cc77a143._.js.map +1 -1
  97. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
  98. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
  99. package/web/.next/server/chunks/ssr/src_presentation_web_0835b28e._.js +2 -2
  100. package/web/.next/server/chunks/ssr/src_presentation_web_0835b28e._.js.map +1 -1
  101. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_e99d78dd.js +1 -1
  102. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_e99d78dd.js.map +1 -1
  103. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js +1 -1
  104. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js.map +1 -1
  105. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js +1 -1
  106. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js.map +1 -1
  107. package/web/.next/server/chunks/ssr/src_presentation_web_components_bf50c527._.js +1 -1
  108. package/web/.next/server/chunks/ssr/src_presentation_web_components_de814675._.js +1 -1
  109. package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js +1 -1
  110. package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js.map +1 -1
  111. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
  112. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
  113. package/web/.next/server/chunks/ssr/src_presentation_web_e8034a29._.js +2 -2
  114. package/web/.next/server/chunks/ssr/src_presentation_web_e8034a29._.js.map +1 -1
  115. package/web/.next/server/pages/500.html +2 -2
  116. package/web/.next/server/server-reference-manifest.js +1 -1
  117. package/web/.next/server/server-reference-manifest.json +33 -33
  118. package/web/.next/static/chunks/{1c5310cfde612b81.js → 027d779d1dd1535e.js} +1 -1
  119. package/web/.next/static/chunks/{69c6d3ba1606e98d.js → 263497416e5198a3.js} +1 -1
  120. package/web/.next/static/chunks/{30097f88cdf8fad8.js → 51244236801cad96.js} +1 -1
  121. package/web/.next/static/chunks/{f3c4a7bb76c69b01.js → 57e0b981e00941e4.js} +1 -1
  122. package/web/.next/static/chunks/{2b35632c1b784fae.js → 700fc491c912dd68.js} +1 -1
  123. package/web/.next/static/chunks/{619af41a8d3232e5.js → 71161130b2462279.js} +1 -1
  124. package/web/.next/static/chunks/{ed113fb744f2e4d8.js → 844405e9e0f44c8b.js} +1 -1
  125. package/web/.next/static/chunks/943a2b78e452a2fb.js +2 -0
  126. package/web/.next/static/chunks/{7c57a9143e66868c.js → a5ff70a7709ec5af.js} +1 -1
  127. package/web/.next/static/chunks/{c1a6934d2281c088.js → abb2b485cb0da264.js} +1 -1
  128. package/web/.next/static/chunks/f518c011aaa1941e.js +1 -0
  129. package/web/.next/server/chunks/ssr/_59ae996e._.js +0 -3
  130. package/web/.next/static/chunks/3678617c34576e18.js +0 -2
  131. package/web/.next/static/chunks/c4477c532d2081e8.js +0 -1
  132. /package/web/.next/static/{qmHUdyRBvaVksgjcL6w-m → oxdz8EAvGqpg8JW3gRSSs}/_buildManifest.js +0 -0
  133. /package/web/.next/static/{qmHUdyRBvaVksgjcL6w-m → oxdz8EAvGqpg8JW3gRSSs}/_clientMiddlewareManifest.json +0 -0
  134. /package/web/.next/static/{qmHUdyRBvaVksgjcL6w-m → oxdz8EAvGqpg8JW3gRSSs}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,24042,64970,e=>{"use strict";var t=e.i(3645);let n=(0,t.default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);e.s(["Play",()=>n],24042);let r=(0,t.default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);e.s(["Square",()=>r],64970)},81803,72714,2287,17466,99348,e=>{"use strict";var t=e.i(20314),n=e.i(83428),r=e.i(51251),a=e.i(31777),o=e.i(35364),l=e.i(8361);function i({label:e,onClick:i,loading:s,error:u,icon:d,iconOnly:c=!1,variant:f="outline",size:p="sm"}){let m=(0,l.useSoundAction)("click");return(0,t.jsxs)(o.Button,{variant:f,size:p,"aria-label":e,disabled:s,onClick:()=>{m.play(),i()},className:(0,a.cn)("gap-1.5",u&&"text-destructive hover:text-destructive",!u&&c&&"ghost"===f&&"text-muted-foreground cursor-pointer rounded-full transition-colors hover:text-blue-500"),children:[s?(0,t.jsx)(n.Loader2,{className:"size-4 animate-spin"}):u?(0,t.jsx)(r.CircleAlert,{className:"size-4"}):(0,t.jsx)(d,{className:"size-4"}),c?null:e]})}e.s(["ActionButton",()=>i],72714),e.s([],81803);var s=e.i(79054),u=e.i(30702),d=e.i(38573),c=e.i(17406),f=e.i(81846),p=e.i(90033),m=e.i(60253);let g=p.Dialog.Root,h=p.Dialog.Trigger,v=p.Dialog.Portal,w=p.Dialog.Close,y=s.forwardRef(({className:e,onClick:n,...r},o)=>(0,t.jsx)(p.Dialog.Overlay,{ref:o,className:(0,a.cn)("data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 fixed inset-0 z-50 bg-black/80 duration-150",e),onClick:e=>{e.stopPropagation(),n?.(e)},...r}));y.displayName=p.Dialog.Overlay.displayName;let b=s.forwardRef(({className:e,children:n,...r},o)=>(0,t.jsxs)(v,{children:[(0,t.jsx)(y,{}),(0,t.jsxs)(p.Dialog.Content,{ref:o,className:(0,a.cn)("bg-background data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-150 sm:rounded-lg",e),...r,children:[n,(0,t.jsxs)(p.Dialog.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 cursor-pointer rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none",children:[(0,t.jsx)(m.X,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));b.displayName=p.Dialog.Content.displayName;let x=({className:e,...n})=>(0,t.jsx)("div",{className:(0,a.cn)("flex flex-col space-y-1.5 text-center sm:text-left",e),...n});x.displayName="DialogHeader";let D=({className:e,...n})=>(0,t.jsx)("div",{className:(0,a.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...n});D.displayName="DialogFooter";let j=s.forwardRef(({className:e,...n},r)=>(0,t.jsx)(p.Dialog.Title,{ref:r,className:(0,a.cn)("text-lg leading-none font-semibold tracking-tight",e),...n}));j.displayName=p.Dialog.Title.displayName;let R=s.forwardRef(({className:e,...n},r)=>(0,t.jsx)(p.Dialog.Description,{ref:r,className:(0,a.cn)("text-muted-foreground text-sm",e),...n}));R.displayName=p.Dialog.Description.displayName,e.s(["Dialog",()=>g,"DialogClose",()=>w,"DialogContent",()=>b,"DialogDescription",()=>R,"DialogFooter",()=>D,"DialogHeader",()=>x,"DialogTitle",()=>j,"DialogTrigger",()=>h],2287);var C=e.i(21023);let T=(0,C.createServerReference)("40192e8ab56a976d7b4ab02e5ac4e86b81844753c0",C.callServer,void 0,C.findSourceMapURL,"getDeploymentLogs");function N({open:e,onOpenChange:n,targetId:r}){let{logs:a,isConnected:o}=function(e){let[t,n]=(0,s.useState)([]),[r,a]=(0,s.useState)(!1),o=(0,s.useRef)(null),l=(0,s.useCallback)(()=>{o.current&&(o.current.close(),o.current=null),a(!1)},[]);return(0,s.useEffect)(()=>{if(!e){n([]),a(!1);return}T(e).then(e=>{e&&n(e)}).catch(()=>{});let t=new EventSource(`/api/deployment-logs?targetId=${e}`);return o.current=t,t.onopen=()=>{a(!0)},t.addEventListener("log",e=>{let t=JSON.parse(e.data);n(e=>[...e,t])}),t.onerror=()=>{a(!1)},()=>{t.close(),o.current=null}},[e,l]),{logs:t,isConnected:r}}(e?r:null);return(0,t.jsx)(E,{open:e,onOpenChange:n,logs:a,isConnected:o})}function E({open:e,onOpenChange:n,logs:r,isConnected:a}){let o=(0,s.useRef)(null),l=(0,s.useRef)(!0),i=(0,s.useCallback)(()=>{let e=o.current;e&&(l.current=e.scrollTop+e.clientHeight>=e.scrollHeight-50)},[]);return(0,s.useEffect)(()=>{l.current&&o.current&&(o.current.scrollTop=o.current.scrollHeight)},[r]),(0,t.jsx)(g,{open:e,onOpenChange:n,children:(0,t.jsxs)(b,{className:"flex h-[calc(100vh-48px)] max-h-[calc(100vh-48px)] w-full max-w-[calc(100vw-48px)] flex-col gap-0 bg-zinc-950 p-0 text-zinc-100 sm:rounded-lg","aria-describedby":void 0,children:[(0,t.jsxs)(x,{className:"flex flex-row items-center justify-between border-b border-zinc-800 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(d.Terminal,{className:"h-4 w-4 text-zinc-400"}),(0,t.jsx)(j,{className:"text-sm font-medium text-zinc-100",children:"Server Logs"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 pr-8",children:[(0,t.jsx)("span",{className:`inline-block h-2 w-2 rounded-full ${a?"bg-green-500":"bg-zinc-500"}`}),(0,t.jsx)("span",{className:"text-xs text-zinc-400",children:a?"Connected":"Disconnected"})]})]}),(0,t.jsxs)("div",{ref:o,onScroll:i,className:"flex-1 overflow-auto p-4 font-mono text-sm leading-relaxed",children:[0===r.length?(0,t.jsx)("p",{className:"text-zinc-500",children:"Waiting for log output..."}):r.map(e=>(0,t.jsx)(S,{entry:e},`${e.timestamp}-${e.stream}-${e.line}`)),!a&&r.length>0&&(0,t.jsx)("div",{className:"mt-2 border-t border-zinc-800 pt-2 text-zinc-500",children:"[Server stopped]"})]})]})})}function S({entry:e}){return(0,t.jsx)("div",{"data-stream":e.stream,className:"stderr"===e.stream?"text-red-400":"text-zinc-200",children:(0,t.jsx)("span",{className:"break-all whitespace-pre-wrap",children:e.line})})}function $({status:e,url:r,targetId:a}){let[o,l]=(0,s.useState)(!1),i=a&&(e===c.DeploymentState.Booting||e===c.DeploymentState.Ready);switch(e){case c.DeploymentState.Booting:return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(f.Badge,{className:"border-transparent bg-blue-50 text-blue-700 hover:bg-blue-50",children:[(0,t.jsx)(n.Loader2,{className:"mr-1 h-3.5 w-3.5 animate-spin"}),"Starting...",i?(0,t.jsx)("button",{type:"button","aria-label":"View server logs",className:"ml-1.5 inline-flex items-center rounded-sm p-0.5 hover:bg-blue-100",onClick:e=>{e.stopPropagation(),l(!0)},children:(0,t.jsx)(d.Terminal,{className:"h-3 w-3"})}):null]}),i?(0,t.jsx)(N,{open:o,onOpenChange:l,targetId:a}):null]});case c.DeploymentState.Ready:return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(f.Badge,{className:"border-transparent bg-green-50 text-green-700 hover:bg-green-50",children:[(0,t.jsx)("span",{className:"mr-1 inline-block h-2 w-2 rounded-full bg-green-500"}),r?(0,t.jsxs)("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 hover:underline",onClick:e=>e.stopPropagation(),children:[r,(0,t.jsx)(u.ExternalLink,{className:"h-3 w-3"})]}):"Ready",i?(0,t.jsx)("button",{type:"button","aria-label":"View server logs",className:"ml-1.5 inline-flex items-center rounded-sm p-0.5 hover:bg-green-100",onClick:e=>{e.stopPropagation(),l(!0)},children:(0,t.jsx)(d.Terminal,{className:"h-3 w-3"})}):null]}),i?(0,t.jsx)(N,{open:o,onOpenChange:l,targetId:a}):null]});default:return null}}e.s(["DeploymentStatusBadge",()=>$],17466),e.s([],99348)},45811,e=>{"use strict";let t;var n=e.i(20314),r=e.i(48249),a=e.i(567),o=e.i(79054);let l=o.default.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),i=()=>{let e=o.default.useContext(l);if(!e)throw Error("useDrawerContext must be used within a Drawer.Root");return e};function s(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function u(){return d(/^iPhone/)||d(/^iPad/)||d(/^Mac/)&&navigator.maxTouchPoints>1}function d(e){return"u">typeof window&&null!=window.navigator?e.test(window.navigator.platform):void 0}!function(e){if(!e||"u"<typeof document)return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}("[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(\n[data-state=closed]\n){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}");let c="u">typeof window?o.useLayoutEffect:o.useEffect;function f(...e){return(...t)=>{for(let n of e)"function"==typeof n&&n(...t)}}let p="u">typeof document&&window.visualViewport;function m(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function g(e){for(m(e)&&(e=e.parentElement);e&&!m(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}let h=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]),v=0;function w(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function y(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let t=g(e);if(t!==document.documentElement&&t!==document.body&&t!==e){let n=t.getBoundingClientRect().top,r=e.getBoundingClientRect().top;e.getBoundingClientRect().bottom>t.getBoundingClientRect().bottom+24&&(t.scrollTop+=r-n)}e=t.parentElement}}function b(e){return e instanceof HTMLInputElement&&!h.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function x(...e){return o.useCallback(function(...e){return t=>e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}(...e),e)}let D=new WeakMap;function j(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([t,n])=>{t.startsWith("--")?e.style.setProperty(t,n):(r[t]=e.style[t],e.style[t]=n)}),n||D.set(e,r)}let R=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function C(e,t){if(!e)return null;let n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform,a=r.match(/^matrix3d\((.+)\)$/);return a?parseFloat(a[1].split(", ")[R(t)?13:12]):(a=r.match(/^matrix\((.+)\)$/))?parseFloat(a[1].split(", ")[R(t)?5:4]):null}function T(e,t){if(!e)return()=>{};let n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}let N=[.32,.72,0,1],E="vaul-dragging";function S(e){let t=o.default.useRef(e);return o.default.useEffect(()=>{t.current=e}),o.default.useMemo(()=>(...e)=>null==t.current?void 0:t.current.call(t,...e),[])}function $({prop:e,defaultProp:t,onChange:n=()=>{}}){let[r,a]=function({defaultProp:e,onChange:t}){let n=o.default.useState(e),[r]=n,a=o.default.useRef(r),l=S(t);return o.default.useEffect(()=>{a.current!==r&&(l(r),a.current=r)},[r,a,l]),n}({defaultProp:t,onChange:n}),l=void 0!==e,i=l?e:r,s=S(n);return[i,o.default.useCallback(t=>{if(l){let n="function"==typeof t?t(e):t;n!==e&&s(n)}else a(t)},[l,e,a,s])]}let k=()=>()=>{},P=null;function M({open:e,onOpenChange:n,children:r,onDrag:i,onRelease:d,snapPoints:m,shouldScaleBackground:h=!1,setBackgroundColorOnScale:x=!0,closeThreshold:T=.25,scrollLockTimeout:S=100,dismissible:k=!0,handleOnly:M=!1,fadeFromIndex:z=m&&m.length-1,activeSnapPoint:O,setActiveSnapPoint:L,fixed:B,modal:F=!0,onClose:A,nested:I,noBodyStyles:H=!1,direction:W="bottom",defaultOpen:q=!1,disablePreventScroll:Y=!0,snapToSequentialPoint:U=!1,preventScrollRestoration:X=!1,repositionInputs:V=!0,onAnimationEnd:K,container:J,autoFocus:_=!1}){var G,Q;let[Z=!1,ee]=$({defaultProp:q,prop:e,onChange:e=>{null==n||n(e),e||I||ek(),setTimeout(()=>{null==K||K(e)},500),e&&!F&&"u">typeof window&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),e||(document.body.style.pointerEvents="auto")}}),[et,en]=o.default.useState(!1),[er,ea]=o.default.useState(!1),[eo,el]=o.default.useState(!1),ei=o.default.useRef(null),es=o.default.useRef(null),eu=o.default.useRef(null),ed=o.default.useRef(null),ec=o.default.useRef(null),ef=o.default.useRef(!1),ep=o.default.useRef(null),em=o.default.useRef(0),eg=o.default.useRef(!1),eh=o.default.useRef(!q),ev=o.default.useRef(0),ew=o.default.useRef(null),ey=o.default.useRef((null==(G=ew.current)?void 0:G.getBoundingClientRect().height)||0),eb=o.default.useRef((null==(Q=ew.current)?void 0:Q.getBoundingClientRect().width)||0),ex=o.default.useRef(0),eD=o.default.useCallback(e=>{m&&e===eN.length-1&&(es.current=new Date)},[]),{activeSnapPoint:ej,activeSnapPointIndex:eR,setActiveSnapPoint:eC,onRelease:eT,snapPointsOffset:eN,onDrag:eE,shouldFade:eS,getPercentageDragged:e$}=function({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:a,fadeFromIndex:l,onSnapPointChange:i,direction:s="bottom",container:u,snapToSequentialPoint:d}){let[c,f]=$({prop:e,defaultProp:null==n?void 0:n[0],onChange:t}),[p,m]=o.default.useState("u">typeof window?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);o.default.useEffect(()=>{function e(){m({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);let g=o.default.useMemo(()=>c===(null==n?void 0:n[n.length-1])||null,[n,c]),h=o.default.useMemo(()=>{var e;return null!=(e=null==n?void 0:n.findIndex(e=>e===c))?e:null},[n,c]),v=n&&n.length>0&&(l||0===l)&&!Number.isNaN(l)&&n[l]===c||!n,w=o.default.useMemo(()=>{var e;let t=u?{width:u.getBoundingClientRect().width,height:u.getBoundingClientRect().height}:"u">typeof window?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};return null!=(e=null==n?void 0:n.map(e=>{let n="string"==typeof e,r=0;if(n&&(r=parseInt(e,10)),R(s)){let a=n?r:p?e*t.height:0;return p?"bottom"===s?t.height-a:-t.height+a:a}let a=n?r:p?e*t.width:0;return p?"right"===s?t.width-a:-t.width+a:a}))?e:[]},[n,p,u]),y=o.default.useMemo(()=>null!==h?null==w?void 0:w[h]:null,[w,h]),b=o.default.useCallback(e=>{var t;let o=null!=(t=null==w?void 0:w.findIndex(t=>t===e))?t:null;i(o),j(r.current,{transition:`transform 0.5s cubic-bezier(${N.join(",")})`,transform:R(s)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`}),w&&o!==w.length-1&&void 0!==l&&o!==l&&o<l?j(a.current,{transition:`opacity 0.5s cubic-bezier(${N.join(",")})`,opacity:"0"}):j(a.current,{transition:`opacity 0.5s cubic-bezier(${N.join(",")})`,opacity:"1"}),f(null==n?void 0:n[Math.max(o,0)])},[r.current,n,w,l,a,f]);return o.default.useEffect(()=>{if(c||e){var t;let r=null!=(t=null==n?void 0:n.findIndex(t=>t===e||t===c))?t:-1;w&&-1!==r&&"number"==typeof w[r]&&b(w[r])}},[c,e,n,w,b]),{isLastSnapPoint:g,activeSnapPoint:c,shouldFade:v,getPercentageDragged:function(e,t){if(!n||"number"!=typeof h||!w||void 0===l)return null;let r=h===l-1;if(h>=l&&t)return 0;if(r&&!t)return 1;if(!v&&!r)return null;let a=r?h+1:h-1,o=e/Math.abs(r?w[a]-w[a-1]:w[a+1]-w[a]);return r?1-o:o},setActiveSnapPoint:f,activeSnapPointIndex:h,onRelease:function({draggedDistance:e,closeDrawer:t,velocity:r,dismissible:o}){if(void 0===l)return;let i="bottom"===s||"right"===s?(null!=y?y:0)-e:(null!=y?y:0)+e,u=h===l-1,c=0===h,f=e>0;if(u&&j(a.current,{transition:`opacity 0.5s cubic-bezier(${N.join(",")})`}),!d&&r>2&&!f)return void(o?t():b(w[0]));if(!d&&r>2&&f&&w&&n)return void b(w[n.length-1]);let p=null==w?void 0:w.reduce((e,t)=>"number"!=typeof e||"number"!=typeof t?e:Math.abs(t-i)<Math.abs(e-i)?t:e),m=R(s)?window.innerHeight:window.innerWidth;if(r>.4&&Math.abs(e)<.4*m){let e=f?1:-1;return e>0&&g&&n?void b(w[n.length-1]):void(c&&e<0&&o&&t(),null===h||b(w[h+e]))}b(p)},onDrag:function({draggedDistance:e}){if(null===y)return;let t="bottom"===s||"right"===s?y-e:y+e;("bottom"===s||"right"===s)&&t<w[w.length-1]||("top"===s||"left"===s)&&t>w[w.length-1]||j(r.current,{transform:R(s)?`translate3d(0, ${t}px, 0)`:`translate3d(${t}px, 0, 0)`})},snapPointsOffset:w}}({snapPoints:m,activeSnapPointProp:O,setActiveSnapPointProp:L,drawerRef:ew,fadeFromIndex:z,overlayRef:ei,onSnapPointChange:eD,direction:W,container:J,snapToSequentialPoint:U});!function(e={}){let{isDisabled:n}=e;c(()=>{if(!n){var e,r,a;let n,o,l,i,s,d,c;return 1==++v&&u()&&(l=0,i=window.pageXOffset,s=window.pageYOffset,d=f((e=document.documentElement,r="paddingRight",a=`${window.innerWidth-document.documentElement.clientWidth}px`,n=e.style[r],e.style[r]=a,()=>{e.style[r]=n})),window.scrollTo(0,0),c=f(w(document,"touchstart",e=>{((o=g(e.target))!==document.documentElement||o!==document.body)&&(l=e.changedTouches[0].pageY)},{passive:!1,capture:!0}),w(document,"touchmove",e=>{if(!o||o===document.documentElement||o===document.body)return void e.preventDefault();let t=e.changedTouches[0].pageY,n=o.scrollTop,r=o.scrollHeight-o.clientHeight;0!==r&&((n<=0&&t>l||n>=r&&t<l)&&e.preventDefault(),l=t)},{passive:!1,capture:!0}),w(document,"touchend",e=>{let t=e.target;b(t)&&t!==document.activeElement&&(e.preventDefault(),t.style.transform="translateY(-2000px)",t.focus(),requestAnimationFrame(()=>{t.style.transform=""}))},{passive:!1,capture:!0}),w(document,"focus",e=>{let t=e.target;b(t)&&(t.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{t.style.transform="",p&&(p.height<window.innerHeight?requestAnimationFrame(()=>{y(t)}):p.addEventListener("resize",()=>y(t),{once:!0}))}))},!0),w(window,"scroll",()=>{window.scrollTo(0,0)})),t=()=>{d(),c(),window.scrollTo(i,s)}),()=>{0==--v&&(null==t||t())}}},[n])}({isDisabled:!Z||er||!F||eo||!et||!V||!Y});let{restorePositionSetting:ek}=function({isOpen:e,modal:t,nested:n,hasBeenOpened:r,preventScrollRestoration:a,noBodyStyles:l}){let[i,u]=o.default.useState(()=>"u">typeof window?window.location.href:""),d=o.default.useRef(0),c=o.default.useCallback(()=>{if(s()&&null===P&&e&&!l){P={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};let{scrollX:e,innerHeight:t}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-d.current}px`,left:`${-e}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{let e=t-window.innerHeight;e&&d.current>=t&&(document.body.style.top=`${-(d.current+e)}px`)}),300)}},[e]),f=o.default.useCallback(()=>{if(s()&&null!==P&&!l){let e=-parseInt(document.body.style.top,10),t=-parseInt(document.body.style.left,10);Object.assign(document.body.style,P),window.requestAnimationFrame(()=>{a&&i!==window.location.href?u(window.location.href):window.scrollTo(t,e)}),P=null}},[i]);return o.default.useEffect(()=>{function e(){d.current=window.scrollY}return e(),window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[]),o.default.useEffect(()=>{if(t)return()=>{"u"<typeof document||document.querySelector("[data-vaul-drawer]")||f()}},[t,f]),o.default.useEffect(()=>{!n&&r&&(e?(window.matchMedia("(display-mode: standalone)").matches||c(),t||window.setTimeout(()=>{f()},500)):f())},[e,r,i,t,n,c,f]),{restorePositionSetting:f}}({isOpen:Z,modal:F,nested:null!=I&&I,hasBeenOpened:et,preventScrollRestoration:X,noBodyStyles:H});function eP(){return(window.innerWidth-26)/window.innerWidth}function eM(e,t){var n;let r=e,a=null==(n=window.getSelection())?void 0:n.toString(),o=ew.current?C(ew.current,W):null,l=new Date;if("SELECT"===r.tagName||r.hasAttribute("data-vaul-no-drag")||r.closest("[data-vaul-no-drag]"))return!1;if("right"===W||"left"===W)return!0;if(es.current&&l.getTime()-es.current.getTime()<500)return!1;if(null!==o&&("bottom"===W?o>0:o<0))return!0;if(a&&a.length>0)return!1;if(ec.current&&l.getTime()-ec.current.getTime()<S&&0===o||t)return ec.current=l,!1;for(;r;){if(r.scrollHeight>r.clientHeight){if(0!==r.scrollTop)return ec.current=new Date,!1;if("dialog"===r.getAttribute("role"))break}r=r.parentNode}return!0}function ez(e){er&&ew.current&&(ew.current.classList.remove(E),ef.current=!1,ea(!1),ed.current=new Date),null==A||A(),e||ee(!1),setTimeout(()=>{m&&eC(m[0])},500)}function eO(){if(!ew.current)return;let e=document.querySelector("[data-vaul-drawer-wrapper]"),t=C(ew.current,W);j(ew.current,{transform:"translate3d(0, 0, 0)",transition:`transform 0.5s cubic-bezier(${N.join(",")})`}),j(ei.current,{transition:`opacity 0.5s cubic-bezier(${N.join(",")})`,opacity:"1"}),h&&t&&t>0&&Z&&j(e,{borderRadius:"8px",overflow:"hidden",...R(W)?{transform:`scale(${eP()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${eP()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:"0.5s",transitionTimingFunction:`cubic-bezier(${N.join(",")})`},!0)}return o.default.useEffect(()=>{window.requestAnimationFrame(()=>{eh.current=!0})},[]),o.default.useEffect(()=>{var e;function t(){if(ew.current&&V&&(b(document.activeElement)||eg.current)){var e;let t=(null==(e=window.visualViewport)?void 0:e.height)||0,n=window.innerHeight,r=n-t,a=ew.current.getBoundingClientRect().height||0;ex.current||(ex.current=a);let o=ew.current.getBoundingClientRect().top;if(Math.abs(ev.current-r)>60&&(eg.current=!eg.current),m&&m.length>0&&eN&&eR&&(r+=eN[eR]||0),ev.current=r,a>t||eg.current){let e=ew.current.getBoundingClientRect().height,l=e;e>t&&(l=t-(a>.8*n?o:26)),B?ew.current.style.height=`${e-Math.max(r,0)}px`:ew.current.style.height=`${Math.max(l,t-o)}px`}else{let e;e=navigator.userAgent,"u">typeof window&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))||(ew.current.style.height=`${ex.current}px`)}m&&m.length>0&&!eg.current?ew.current.style.bottom="0px":ew.current.style.bottom=`${Math.max(r,0)}px`}}return null==(e=window.visualViewport)||e.addEventListener("resize",t),()=>{var e;return null==(e=window.visualViewport)?void 0:e.removeEventListener("resize",t)}},[eR,m,eN]),o.default.useEffect(()=>(Z&&(j(document.documentElement,{scrollBehavior:"auto"}),es.current=new Date),()=>{!function(e,t){if(!e||!(e instanceof HTMLElement))return;let n=D.get(e);n&&(e.style[t]=n[t])}(document.documentElement,"scrollBehavior")}),[Z]),o.default.useEffect(()=>{F||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[F]),o.default.createElement(a.Root,{defaultOpen:q,onOpenChange:e=>{(k||e)&&(e?en(!0):ez(!0),ee(e))},open:Z},o.default.createElement(l.Provider,{value:{activeSnapPoint:ej,snapPoints:m,setActiveSnapPoint:eC,drawerRef:ew,overlayRef:ei,onOpenChange:n,onPress:function(e){var t,n;!k&&!m||(!ew.current||ew.current.contains(e.target))&&(ey.current=(null==(t=ew.current)?void 0:t.getBoundingClientRect().height)||0,eb.current=(null==(n=ew.current)?void 0:n.getBoundingClientRect().width)||0,ea(!0),eu.current=new Date,u()&&window.addEventListener("touchend",()=>ef.current=!1,{once:!0}),e.target.setPointerCapture(e.pointerId),em.current=R(W)?e.pageY:e.pageX)},onRelease:function(e){var t,n;if(!er||!ew.current)return;ew.current.classList.remove(E),ef.current=!1,ea(!1),ed.current=new Date;let r=C(ew.current,W);if(!e||!eM(e.target,!1)||!r||Number.isNaN(r)||null===eu.current)return;let a=ed.current.getTime()-eu.current.getTime(),o=em.current-(R(W)?e.pageY:e.pageX),l=Math.abs(o)/a;if(l>.05&&(el(!0),setTimeout(()=>{el(!1)},200)),m){eT({draggedDistance:o*("bottom"===W||"right"===W?1:-1),closeDrawer:ez,velocity:l,dismissible:k}),null==d||d(e,!0);return}if("bottom"===W||"right"===W?o>0:o<0){eO(),null==d||d(e,!0);return}if(l>.4){ez(),null==d||d(e,!1);return}let i=Math.min(null!=(t=ew.current.getBoundingClientRect().height)?t:0,window.innerHeight),s=Math.min(null!=(n=ew.current.getBoundingClientRect().width)?n:0,window.innerWidth);if(Math.abs(r)>=("left"===W||"right"===W?s:i)*T){ez(),null==d||d(e,!1);return}null==d||d(e,!0),eO()},onDrag:function(e){if(ew.current&&er){let t="bottom"===W||"right"===W?1:-1,n=(em.current-(R(W)?e.pageY:e.pageX))*t,r=n>0,a=m&&!k&&!r;if(a&&0===eR)return;let o=Math.abs(n),l=document.querySelector("[data-vaul-drawer-wrapper]"),s=o/("bottom"===W||"top"===W?ey.current:eb.current),u=e$(o,r);if(null!==u&&(s=u),a&&s>=1||!ef.current&&!eM(e.target,r))return;if(ew.current.classList.add(E),ef.current=!0,j(ew.current,{transition:"none"}),j(ei.current,{transition:"none"}),m&&eE({draggedDistance:n}),r&&!m){let e=Math.min(-(8*(Math.log(n+1)-2)*1),0)*t;j(ew.current,{transform:R(W)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`});return}let d=1-s;if((eS||z&&eR===z-1)&&(null==i||i(e,s),j(ei.current,{opacity:`${d}`,transition:"none"},!0)),l&&ei.current&&h){let e=Math.min(eP()+s*(1-eP()),1),t=8-8*s,n=Math.max(0,14-14*s);j(l,{borderRadius:`${t}px`,transform:R(W)?`scale(${e}) translate3d(0, ${n}px, 0)`:`scale(${e}) translate3d(${n}px, 0, 0)`,transition:"none"},!0)}if(!m){let e=o*t;j(ew.current,{transform:R(W)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})}}},dismissible:k,shouldAnimate:eh,handleOnly:M,isOpen:Z,isDragging:er,shouldFade:eS,closeDrawer:ez,onNestedDrag:function(e,t){if(t<0)return;let n=(window.innerWidth-16)/window.innerWidth,r=n+t*(1-n),a=-16+16*t;j(ew.current,{transform:R(W)?`scale(${r}) translate3d(0, ${a}px, 0)`:`scale(${r}) translate3d(${a}px, 0, 0)`,transition:"none"})},onNestedOpenChange:function(e){let t=e?(window.innerWidth-16)/window.innerWidth:1,n=e?-16:0;ep.current&&window.clearTimeout(ep.current),j(ew.current,{transition:`transform 0.5s cubic-bezier(${N.join(",")})`,transform:R(W)?`scale(${t}) translate3d(0, ${n}px, 0)`:`scale(${t}) translate3d(${n}px, 0, 0)`}),!e&&ew.current&&(ep.current=setTimeout(()=>{let e=C(ew.current,W);j(ew.current,{transition:"none",transform:R(W)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})},500))},onNestedRelease:function(e,t){let n=R(W)?window.innerHeight:window.innerWidth,r=t?(n-16)/n:1,a=t?-16:0;t&&j(ew.current,{transition:`transform 0.5s cubic-bezier(${N.join(",")})`,transform:R(W)?`scale(${r}) translate3d(0, ${a}px, 0)`:`scale(${r}) translate3d(${a}px, 0, 0)`})},keyboardIsOpen:eg,modal:F,snapPointsOffset:eN,activeSnapPointIndex:eR,direction:W,shouldScaleBackground:h,setBackgroundColorOnScale:x,noBodyStyles:H,container:J,autoFocus:_}},r))}let z=o.default.forwardRef(function({...e},t){let{overlayRef:n,snapPoints:r,onRelease:l,shouldFade:s,isOpen:u,modal:d,shouldAnimate:c}=i(),f=x(t,n),p=r&&r.length>0;if(!d)return null;let m=o.default.useCallback(e=>l(e),[l]);return o.default.createElement(a.Overlay,{onMouseUp:m,ref:f,"data-vaul-overlay":"","data-vaul-snap-points":u&&p?"true":"false","data-vaul-snap-points-overlay":u&&s?"true":"false","data-vaul-animate":(null==c?void 0:c.current)?"true":"false",...e})});z.displayName="Drawer.Overlay";let O=o.default.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...r},l){let{drawerRef:s,onPress:u,onRelease:d,onDrag:c,keyboardIsOpen:f,snapPointsOffset:p,activeSnapPointIndex:m,modal:g,isOpen:h,direction:v,snapPoints:w,container:y,handleOnly:b,shouldAnimate:D,autoFocus:j}=i(),[C,E]=o.default.useState(!1),S=x(l,s),$=o.default.useRef(null),P=o.default.useRef(null),M=o.default.useRef(!1),z=w&&w.length>0;function O(e){$.current=null,M.current=!1,d(e)}return!function(){let{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:a}=i(),l=o.default.useRef(null),s=(0,o.useMemo)(()=>document.body.style.backgroundColor,[]);function u(){return(window.innerWidth-26)/window.innerWidth}o.default.useEffect(()=>{if(t&&n){l.current&&clearTimeout(l.current);let t=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!t)return;!function(...e){}(r&&!a?T(document.body,{background:"black"}):k,T(t,{transformOrigin:R(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:"0.5s",transitionTimingFunction:`cubic-bezier(${N.join(",")})`}));let n=T(t,{borderRadius:"8px",overflow:"hidden",...R(e)?{transform:`scale(${u()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${u()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{n(),l.current=window.setTimeout(()=>{s?document.body.style.background=s:document.body.style.removeProperty("background")},500)}}},[t,n,s])}(),o.default.useEffect(()=>{z&&window.requestAnimationFrame(()=>{E(!0)})},[]),o.default.createElement(a.Content,{"data-vaul-drawer-direction":v,"data-vaul-drawer":"","data-vaul-delayed-snap-points":C?"true":"false","data-vaul-snap-points":h&&z?"true":"false","data-vaul-custom-container":y?"true":"false","data-vaul-animate":(null==D?void 0:D.current)?"true":"false",...r,ref:S,style:p&&p.length>0?{"--snap-point-height":`${p[null!=m?m:0]}px`,...t}:t,onPointerDown:e=>{b||(null==r.onPointerDown||r.onPointerDown.call(r,e),$.current={x:e.pageX,y:e.pageY},u(e))},onOpenAutoFocus:e=>{null==n||n(e),j||e.preventDefault()},onPointerDownOutside:t=>{(null==e||e(t),!g||t.defaultPrevented)?t.preventDefault():f.current&&(f.current=!1)},onFocusOutside:e=>{if(!g)return void e.preventDefault()},onPointerMove:e=>{if(P.current=e,b||(null==r.onPointerMove||r.onPointerMove.call(r,e),!$.current))return;let t=e.pageY-$.current.y,n=e.pageX-$.current.x,a="touch"===e.pointerType?10:2;((e,t,n=0)=>{if(M.current)return!0;let r=Math.abs(e.y),a=Math.abs(e.x),o=a>r,l=["bottom","right"].includes(t)?1:-1;if("left"===t||"right"===t){if(!(e.x*l<0)&&a>=0&&a<=n)return o}else if(!(e.y*l<0)&&r>=0&&r<=n)return!o;return M.current=!0,!0})({x:n,y:t},v,a)?c(e):(Math.abs(n)>a||Math.abs(t)>a)&&($.current=null)},onPointerUp:e=>{null==r.onPointerUp||r.onPointerUp.call(r,e),$.current=null,M.current=!1,d(e)},onPointerOut:e=>{null==r.onPointerOut||r.onPointerOut.call(r,e),O(P.current)},onContextMenu:e=>{null==r.onContextMenu||r.onContextMenu.call(r,e),P.current&&O(P.current)}})});O.displayName="Drawer.Content";let L=o.default.forwardRef(function({preventCycle:e=!1,children:t,...n},r){let{closeDrawer:a,isDragging:l,snapPoints:s,activeSnapPoint:u,setActiveSnapPoint:d,dismissible:c,handleOnly:f,isOpen:p,onPress:m,onDrag:g}=i(),h=o.default.useRef(null),v=o.default.useRef(!1);function w(){h.current&&window.clearTimeout(h.current),v.current=!1}return o.default.createElement("div",{onClick:function(){v.current?w():window.setTimeout(()=>{!function(){if(l||e||v.current)return w();if(w(),!s||0===s.length){c||a();return}if(u===s[s.length-1]&&c)return a();let t=s.findIndex(e=>e===u);-1===t||d(s[t+1])}()},120)},onPointerCancel:w,onPointerDown:e=>{f&&m(e),h.current=window.setTimeout(()=>{v.current=!0},250)},onPointerMove:e=>{f&&g(e)},ref:r,"data-vaul-drawer-visible":p?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},o.default.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});L.displayName="Drawer.Handle";let B={Root:M,NestedRoot:function({onDrag:e,onOpenChange:t,open:n,...r}){let{onNestedDrag:a,onNestedOpenChange:l,onNestedRelease:s}=i();if(!a)throw Error("Drawer.NestedRoot must be placed in another drawer");return o.default.createElement(M,{nested:!0,open:n,onClose:()=>{l(!1)},onDrag:(t,n)=>{a(t,n),null==e||e(t,n)},onOpenChange:e=>{e&&l(e),null==t||t(e)},onRelease:s,...r})},Content:O,Overlay:z,Trigger:a.Trigger,Portal:function(e){let t=i(),{container:n=t.container,...r}=e;return o.default.createElement(a.Portal,{container:n,...r})},Handle:L,Close:a.Close,Title:a.Title,Description:a.Description};var F=e.i(31777);function A({...e}){return(0,n.jsx)(B.Root,{"data-slot":"drawer",...e})}function I({...e}){return(0,n.jsx)(B.Portal,{"data-slot":"drawer-portal",...e})}function H({className:e,...t}){return(0,n.jsx)(B.Overlay,{"data-slot":"drawer-overlay",className:(0,F.cn)("fixed inset-0 z-50 bg-black/50",e),...t})}function W({className:e,children:t,direction:a="bottom",showCloseButton:o=!0,...l}){return(0,n.jsx)(I,{children:(0,n.jsxs)(B.Content,{"data-slot":"drawer-content",className:(0,F.cn)("bg-background fixed z-50 flex flex-col shadow-lg","bottom"===a&&"inset-x-0 bottom-0 mb-24 rounded-t-lg border-t","top"===a&&"inset-x-0 top-0 mt-24 rounded-b-lg border-b","right"===a&&"inset-y-0 right-0 h-full w-3/4 border-l","left"===a&&"inset-y-0 left-0 h-full w-3/4 border-r",e),style:{"--initial-transform":"right"===a?"calc(100% + 8px)":"left"===a||"top"===a?"calc(-100% - 8px)":"calc(100% + 8px)",userSelect:"text",...l.style??{}},...l,children:[t,o?(0,n.jsxs)(B.Close,{className:"ring-offset-background focus:ring-ring absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[(0,n.jsx)(r.XIcon,{className:"size-4"}),(0,n.jsx)("span",{className:"sr-only",children:"Close"})]}):null]})})}function q({className:e,...t}){return(0,n.jsx)("div",{"data-slot":"drawer-header",className:(0,F.cn)("flex flex-col gap-1.5 p-4",e),...t})}function Y({className:e,...t}){return(0,n.jsx)("div",{"data-slot":"drawer-footer",className:(0,F.cn)("mt-auto flex flex-col gap-2 p-4",e),...t})}function U({className:e,...t}){return(0,n.jsx)(B.Title,{"data-slot":"drawer-title",className:(0,F.cn)("text-foreground font-semibold",e),...t})}function X({className:e,...t}){return(0,n.jsx)(B.Description,{"data-slot":"drawer-description",className:(0,F.cn)("text-muted-foreground text-sm",e),...t})}e.s(["Drawer",()=>A,"DrawerContent",()=>W,"DrawerDescription",()=>X,"DrawerFooter",()=>Y,"DrawerHeader",()=>q,"DrawerOverlay",()=>H,"DrawerTitle",()=>U],45811)},8537,e=>{"use strict";var t=e.i(79054),n=e.i(18354),r=e.i(21023);let a=(0,r.createServerReference)("40c56f5c3a822bb270b79ce59904bd1a4547ae8dd4",r.callServer,void 0,r.findSourceMapURL,"deployFeature"),o=(0,r.createServerReference)("407be534406b318f0e53b8cf725a013960c34c4eab",r.callServer,void 0,r.findSourceMapURL,"deployRepository"),l=(0,r.createServerReference)("40e8b017976f8965562a10c76df713c49c812175a5",r.callServer,void 0,r.findSourceMapURL,"stopDeployment"),i=(0,r.createServerReference)("40edcd4f8ffa551f80627eea24794aeb5eb5b4bf1d",r.callServer,void 0,r.findSourceMapURL,"getDeploymentStatus"),s=(0,n.createLogger)("[useDeployAction]");function u(e){let[n,r]=(0,t.useState)(!1),[u,d]=(0,t.useState)(!1),[c,f]=(0,t.useState)(null),[p,m]=(0,t.useState)(null),[g,h]=(0,t.useState)(null),v=(0,t.useRef)(null),w=(0,t.useRef)(null),y=(0,t.useRef)(!0),b=(0,t.useRef)(p);(0,t.useEffect)(()=>{b.current=p},[p]),(0,t.useEffect)(()=>(y.current=!0,()=>{y.current=!1}),[]),(0,t.useEffect)(()=>()=>{v.current&&clearTimeout(v.current),w.current&&clearInterval(w.current)},[]);let x=(0,t.useCallback)(()=>{w.current&&(s.debug("stopping polling"),clearInterval(w.current),w.current=null)},[]),D=(0,t.useCallback)(e=>{x(),s.debug(`starting polling for "${e}" every 3000ms`),w.current=setInterval(async()=>{if(!y.current)return void x();let t=await i(e);y.current&&(t&&"Stopped"!==t.state?(t.state!==b.current&&s.info(`poll state changed: ${b.current} → ${t.state}, url=${t.url}`),m(t.state),h(t.url)):(s.info(`poll result: ${t?`state=${t.state}`:"null (deployment gone)"} — stopping poll`),m(null),h(null),x()))},3e3)},[x]),j=(0,t.useCallback)(async()=>{if(!e)return void s.warn("deploy() called but input is null — no-op");if(n)return void s.warn("deploy() called but already loading — no-op");s.info(`deploy() — targetType="${e.targetType}", targetId="${e.targetId}", repositoryPath="${e.repositoryPath}"`),v.current&&clearTimeout(v.current),r(!0),f(null);try{let t="feature"===e.targetType?await a(e.targetId):await o(e.repositoryPath);if(s.info("server action result:",t),!y.current)return void s.warn("component unmounted after deploy — discarding result");if(t.success)s.info(`deploy succeeded — initial state=${t.state}, starting polling`),m(t.state??null),h(null),D(e.targetId);else{let e=t.error??"An unexpected error occurred";s.error(`deploy failed: ${e}`),f(e),v.current=setTimeout(()=>f(null),5e3)}}catch(t){if(!y.current)return;let e=t instanceof Error?t.message:"An unexpected error occurred";s.error(`deploy threw exception: ${e}`,t),f(e),v.current=setTimeout(()=>f(null),5e3)}finally{y.current&&r(!1)}},[e,n,D]),R=(0,t.useCallback)(async()=>{if(e&&!u){s.info(`stop() — targetId="${e.targetId}"`),d(!0);try{let t=await l(e.targetId);if(s.info("stop result:",t),!y.current)return;t.success&&(x(),m(null),h(null))}catch(e){s.warn("stop error (non-critical):",e)}finally{y.current&&d(!1)}}},[e,u,x]);return{deploy:j,stop:R,deployLoading:n,stopLoading:u,deployError:c,status:p,url:g}}e.s(["useDeployAction",()=>u],8537)},11495,e=>{"use strict";var t=e.i(20314),n=e.i(79054),r=e.i(48249),a=e.i(24042),o=e.i(64970),l=e.i(94237),i=e.i(31777);e.i(81803);var s=e.i(72714);e.i(99348);var u=e.i(17466),d=e.i(45811),c=e.i(25235),f=e.i(2828),p=e.i(8537),m=e.i(75921);let g=(0,l.cva)("",{variants:{size:{sm:"w-96",md:"w-2xl"}},defaultVariants:{size:"sm"}});function h({open:e,onClose:a,modal:o=!1,dismissOnOutsideClick:l=!1,title:s="Drawer",size:u,header:f,children:p,footer:h,className:w,"data-testid":y,deployTarget:b}){let x=(0,m.useFeatureFlags)(),D=(0,n.useRef)(null);return(0,n.useEffect)(()=>{if(!e||o)return;let t=e=>{let t=e.target;!document.body.contains(t)||D.current?.contains(t)||t.closest(l?'[role="alertdialog"], [role="dialog"], [role="menu"], [role="listbox"], [data-radix-popper-content-wrapper]':'[data-no-drawer-close], [role="alertdialog"], [role="dialog"], [role="menu"], [role="listbox"], [data-radix-popper-content-wrapper]')||a()};return document.addEventListener("click",t),()=>document.removeEventListener("click",t)},[e,o,a,l]),(0,t.jsxs)(d.Drawer,{direction:"right",modal:o,handleOnly:!0,open:e,onOpenChange:e=>{e||a()},children:[o?(0,t.jsx)(d.DrawerOverlay,{}):null,(0,t.jsxs)(d.DrawerContent,{ref:D,direction:"right",showCloseButton:!1,className:(0,i.cn)(g({size:u}),w),"data-testid":y,onInteractOutside:o?void 0:e=>e.preventDefault(),children:[(0,t.jsx)(d.DrawerTitle,{asChild:!0,children:(0,t.jsx)("span",{className:"sr-only",children:s})}),(0,t.jsx)(d.DrawerDescription,{asChild:!0,children:(0,t.jsx)("span",{className:"sr-only",children:s})}),(0,t.jsxs)("button",{type:"button","aria-label":"Close",onClick:a,className:"ring-offset-background focus:ring-ring absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden","data-testid":y?`${y}-close-button`:void 0,children:[(0,t.jsx)(r.XIcon,{className:"size-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]}),f?(0,t.jsx)(d.DrawerHeader,{className:"shrink-0",children:f}):null,f?(0,t.jsx)(c.Separator,{}):null,x.envDeploy&&b?(0,t.jsx)(v,{deployTarget:b}):null,(0,t.jsx)("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:p}),h?(0,t.jsx)(d.DrawerFooter,{className:"shrink-0",children:h}):null]})]})}function v({deployTarget:e}){let n=(0,p.useDeployAction)(e),r="Booting"===n.status||"Ready"===n.status;return(0,t.jsxs)("div",{"data-testid":"base-drawer-deploy-bar",className:"flex items-center gap-2 px-4 pb-3",children:[(0,t.jsx)(f.TooltipProvider,{children:(0,t.jsxs)(f.Tooltip,{children:[(0,t.jsx)(f.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{children:(0,t.jsx)(s.ActionButton,{label:r?"Stop Dev Server":"Start Dev Server",onClick:r?n.stop:n.deploy,loading:n.deployLoading||n.stopLoading,error:!!n.deployError,icon:r?o.Square:a.Play,iconOnly:!0,variant:"outline",size:"icon-sm"})})}),(0,t.jsx)(f.TooltipContent,{children:r?"Stop Dev Server":"Start Dev Server"})]})}),r?(0,t.jsx)(u.DeploymentStatusBadge,{status:n.status,url:n.url,targetId:e.targetId}):null]})}e.s(["BaseDrawer",()=>h])}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,24042,64970,e=>{"use strict";var t=e.i(3645);let n=(0,t.default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);e.s(["Play",()=>n],24042);let r=(0,t.default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);e.s(["Square",()=>r],64970)},81803,72714,2287,17466,99348,e=>{"use strict";var t=e.i(20314),n=e.i(83428),r=e.i(51251),a=e.i(31777),o=e.i(35364),l=e.i(8361);function i({label:e,onClick:i,loading:s,error:u,icon:d,iconOnly:c=!1,variant:f="outline",size:p="sm"}){let m=(0,l.useSoundAction)("click");return(0,t.jsxs)(o.Button,{variant:f,size:p,"aria-label":e,disabled:s,onClick:()=>{m.play(),i()},className:(0,a.cn)("gap-1.5",u&&"text-destructive hover:text-destructive",!u&&c&&"ghost"===f&&"text-muted-foreground cursor-pointer rounded-full transition-colors hover:text-blue-500"),children:[s?(0,t.jsx)(n.Loader2,{className:"size-4 animate-spin"}):u?(0,t.jsx)(r.CircleAlert,{className:"size-4"}):(0,t.jsx)(d,{className:"size-4"}),c?null:e]})}e.s(["ActionButton",()=>i],72714),e.s([],81803);var s=e.i(79054),u=e.i(30702),d=e.i(38573),c=e.i(17406),f=e.i(81846),p=e.i(90033),m=e.i(60253);let g=p.Dialog.Root,h=p.Dialog.Trigger,v=p.Dialog.Portal,w=p.Dialog.Close,y=s.forwardRef(({className:e,onClick:n,...r},o)=>(0,t.jsx)(p.Dialog.Overlay,{ref:o,className:(0,a.cn)("data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 fixed inset-0 z-50 bg-black/80 duration-150",e),onClick:e=>{e.stopPropagation(),n?.(e)},...r}));y.displayName=p.Dialog.Overlay.displayName;let x=s.forwardRef(({className:e,children:n,...r},o)=>(0,t.jsxs)(v,{children:[(0,t.jsx)(y,{}),(0,t.jsxs)(p.Dialog.Content,{ref:o,className:(0,a.cn)("bg-background data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-150 sm:rounded-lg",e),...r,children:[n,(0,t.jsxs)(p.Dialog.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 cursor-pointer rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none",children:[(0,t.jsx)(m.X,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));x.displayName=p.Dialog.Content.displayName;let b=({className:e,...n})=>(0,t.jsx)("div",{className:(0,a.cn)("flex flex-col space-y-1.5 text-center sm:text-left",e),...n});b.displayName="DialogHeader";let D=({className:e,...n})=>(0,t.jsx)("div",{className:(0,a.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...n});D.displayName="DialogFooter";let j=s.forwardRef(({className:e,...n},r)=>(0,t.jsx)(p.Dialog.Title,{ref:r,className:(0,a.cn)("text-lg leading-none font-semibold tracking-tight",e),...n}));j.displayName=p.Dialog.Title.displayName;let R=s.forwardRef(({className:e,...n},r)=>(0,t.jsx)(p.Dialog.Description,{ref:r,className:(0,a.cn)("text-muted-foreground text-sm",e),...n}));R.displayName=p.Dialog.Description.displayName,e.s(["Dialog",()=>g,"DialogClose",()=>w,"DialogContent",()=>x,"DialogDescription",()=>R,"DialogFooter",()=>D,"DialogHeader",()=>b,"DialogTitle",()=>j,"DialogTrigger",()=>h],2287);var C=e.i(21023);let T=(0,C.createServerReference)("405df776f04e555f55e87c541cb8d78960e3d6e412",C.callServer,void 0,C.findSourceMapURL,"getDeploymentLogs");function N({open:e,onOpenChange:n,targetId:r}){let{logs:a,isConnected:o}=function(e){let[t,n]=(0,s.useState)([]),[r,a]=(0,s.useState)(!1),o=(0,s.useRef)(null),l=(0,s.useCallback)(()=>{o.current&&(o.current.close(),o.current=null),a(!1)},[]);return(0,s.useEffect)(()=>{if(!e){n([]),a(!1);return}T(e).then(e=>{e&&n(e)}).catch(()=>{});let t=new EventSource(`/api/deployment-logs?targetId=${e}`);return o.current=t,t.onopen=()=>{a(!0)},t.addEventListener("log",e=>{let t=JSON.parse(e.data);n(e=>[...e,t])}),t.onerror=()=>{a(!1)},()=>{t.close(),o.current=null}},[e,l]),{logs:t,isConnected:r}}(e?r:null);return(0,t.jsx)(E,{open:e,onOpenChange:n,logs:a,isConnected:o})}function E({open:e,onOpenChange:n,logs:r,isConnected:a}){let o=(0,s.useRef)(null),l=(0,s.useRef)(!0),i=(0,s.useCallback)(()=>{let e=o.current;e&&(l.current=e.scrollTop+e.clientHeight>=e.scrollHeight-50)},[]);return(0,s.useEffect)(()=>{l.current&&o.current&&(o.current.scrollTop=o.current.scrollHeight)},[r]),(0,t.jsx)(g,{open:e,onOpenChange:n,children:(0,t.jsxs)(x,{className:"flex h-[calc(100vh-48px)] max-h-[calc(100vh-48px)] w-full max-w-[calc(100vw-48px)] flex-col gap-0 bg-zinc-950 p-0 text-zinc-100 sm:rounded-lg","aria-describedby":void 0,children:[(0,t.jsxs)(b,{className:"flex flex-row items-center justify-between border-b border-zinc-800 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(d.Terminal,{className:"h-4 w-4 text-zinc-400"}),(0,t.jsx)(j,{className:"text-sm font-medium text-zinc-100",children:"Server Logs"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 pr-8",children:[(0,t.jsx)("span",{className:`inline-block h-2 w-2 rounded-full ${a?"bg-green-500":"bg-zinc-500"}`}),(0,t.jsx)("span",{className:"text-xs text-zinc-400",children:a?"Connected":"Disconnected"})]})]}),(0,t.jsxs)("div",{ref:o,onScroll:i,className:"flex-1 overflow-auto p-4 font-mono text-sm leading-relaxed",children:[0===r.length?(0,t.jsx)("p",{className:"text-zinc-500",children:"Waiting for log output..."}):r.map(e=>(0,t.jsx)(S,{entry:e},`${e.timestamp}-${e.stream}-${e.line}`)),!a&&r.length>0&&(0,t.jsx)("div",{className:"mt-2 border-t border-zinc-800 pt-2 text-zinc-500",children:"[Server stopped]"})]})]})})}function S({entry:e}){return(0,t.jsx)("div",{"data-stream":e.stream,className:"stderr"===e.stream?"text-red-400":"text-zinc-200",children:(0,t.jsx)("span",{className:"break-all whitespace-pre-wrap",children:e.line})})}function $({status:e,url:r,targetId:a}){let[o,l]=(0,s.useState)(!1),i=a&&(e===c.DeploymentState.Booting||e===c.DeploymentState.Ready);switch(e){case c.DeploymentState.Booting:return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(f.Badge,{className:"border-transparent bg-blue-50 text-blue-700 hover:bg-blue-50",children:[(0,t.jsx)(n.Loader2,{className:"mr-1 h-3.5 w-3.5 animate-spin"}),"Starting...",i?(0,t.jsx)("button",{type:"button","aria-label":"View server logs",className:"ml-1.5 inline-flex items-center rounded-sm p-0.5 hover:bg-blue-100",onClick:e=>{e.stopPropagation(),l(!0)},children:(0,t.jsx)(d.Terminal,{className:"h-3 w-3"})}):null]}),i?(0,t.jsx)(N,{open:o,onOpenChange:l,targetId:a}):null]});case c.DeploymentState.Ready:return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(f.Badge,{className:"border-transparent bg-green-50 text-green-700 hover:bg-green-50",children:[(0,t.jsx)("span",{className:"mr-1 inline-block h-2 w-2 rounded-full bg-green-500"}),r?(0,t.jsxs)("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 hover:underline",onClick:e=>e.stopPropagation(),children:[r,(0,t.jsx)(u.ExternalLink,{className:"h-3 w-3"})]}):"Ready",i?(0,t.jsx)("button",{type:"button","aria-label":"View server logs",className:"ml-1.5 inline-flex items-center rounded-sm p-0.5 hover:bg-green-100",onClick:e=>{e.stopPropagation(),l(!0)},children:(0,t.jsx)(d.Terminal,{className:"h-3 w-3"})}):null]}),i?(0,t.jsx)(N,{open:o,onOpenChange:l,targetId:a}):null]});default:return null}}e.s(["DeploymentStatusBadge",()=>$],17466),e.s([],99348)},45811,e=>{"use strict";let t;var n=e.i(20314),r=e.i(48249),a=e.i(567),o=e.i(79054);let l=o.default.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),i=()=>{let e=o.default.useContext(l);if(!e)throw Error("useDrawerContext must be used within a Drawer.Root");return e};function s(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function u(){return d(/^iPhone/)||d(/^iPad/)||d(/^Mac/)&&navigator.maxTouchPoints>1}function d(e){return"u">typeof window&&null!=window.navigator?e.test(window.navigator.platform):void 0}!function(e){if(!e||"u"<typeof document)return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}("[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(\n[data-state=closed]\n){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}");let c="u">typeof window?o.useLayoutEffect:o.useEffect;function f(...e){return(...t)=>{for(let n of e)"function"==typeof n&&n(...t)}}let p="u">typeof document&&window.visualViewport;function m(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function g(e){for(m(e)&&(e=e.parentElement);e&&!m(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}let h=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]),v=0;function w(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function y(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let t=g(e);if(t!==document.documentElement&&t!==document.body&&t!==e){let n=t.getBoundingClientRect().top,r=e.getBoundingClientRect().top;e.getBoundingClientRect().bottom>t.getBoundingClientRect().bottom+24&&(t.scrollTop+=r-n)}e=t.parentElement}}function x(e){return e instanceof HTMLInputElement&&!h.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function b(...e){return o.useCallback(function(...e){return t=>e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}(...e),e)}let D=new WeakMap;function j(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([t,n])=>{t.startsWith("--")?e.style.setProperty(t,n):(r[t]=e.style[t],e.style[t]=n)}),n||D.set(e,r)}let R=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function C(e,t){if(!e)return null;let n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform,a=r.match(/^matrix3d\((.+)\)$/);return a?parseFloat(a[1].split(", ")[R(t)?13:12]):(a=r.match(/^matrix\((.+)\)$/))?parseFloat(a[1].split(", ")[R(t)?5:4]):null}function T(e,t){if(!e)return()=>{};let n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}let N=[.32,.72,0,1],E="vaul-dragging";function S(e){let t=o.default.useRef(e);return o.default.useEffect(()=>{t.current=e}),o.default.useMemo(()=>(...e)=>null==t.current?void 0:t.current.call(t,...e),[])}function $({prop:e,defaultProp:t,onChange:n=()=>{}}){let[r,a]=function({defaultProp:e,onChange:t}){let n=o.default.useState(e),[r]=n,a=o.default.useRef(r),l=S(t);return o.default.useEffect(()=>{a.current!==r&&(l(r),a.current=r)},[r,a,l]),n}({defaultProp:t,onChange:n}),l=void 0!==e,i=l?e:r,s=S(n);return[i,o.default.useCallback(t=>{if(l){let n="function"==typeof t?t(e):t;n!==e&&s(n)}else a(t)},[l,e,a,s])]}let k=()=>()=>{},P=null;function M({open:e,onOpenChange:n,children:r,onDrag:i,onRelease:d,snapPoints:m,shouldScaleBackground:h=!1,setBackgroundColorOnScale:b=!0,closeThreshold:T=.25,scrollLockTimeout:S=100,dismissible:k=!0,handleOnly:M=!1,fadeFromIndex:z=m&&m.length-1,activeSnapPoint:O,setActiveSnapPoint:L,fixed:B,modal:F=!0,onClose:A,nested:I,noBodyStyles:H=!1,direction:W="bottom",defaultOpen:q=!1,disablePreventScroll:Y=!0,snapToSequentialPoint:U=!1,preventScrollRestoration:X=!1,repositionInputs:V=!0,onAnimationEnd:K,container:J,autoFocus:_=!1}){var G,Q;let[Z=!1,ee]=$({defaultProp:q,prop:e,onChange:e=>{null==n||n(e),e||I||ek(),setTimeout(()=>{null==K||K(e)},500),e&&!F&&"u">typeof window&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),e||(document.body.style.pointerEvents="auto")}}),[et,en]=o.default.useState(!1),[er,ea]=o.default.useState(!1),[eo,el]=o.default.useState(!1),ei=o.default.useRef(null),es=o.default.useRef(null),eu=o.default.useRef(null),ed=o.default.useRef(null),ec=o.default.useRef(null),ef=o.default.useRef(!1),ep=o.default.useRef(null),em=o.default.useRef(0),eg=o.default.useRef(!1),eh=o.default.useRef(!q),ev=o.default.useRef(0),ew=o.default.useRef(null),ey=o.default.useRef((null==(G=ew.current)?void 0:G.getBoundingClientRect().height)||0),ex=o.default.useRef((null==(Q=ew.current)?void 0:Q.getBoundingClientRect().width)||0),eb=o.default.useRef(0),eD=o.default.useCallback(e=>{m&&e===eN.length-1&&(es.current=new Date)},[]),{activeSnapPoint:ej,activeSnapPointIndex:eR,setActiveSnapPoint:eC,onRelease:eT,snapPointsOffset:eN,onDrag:eE,shouldFade:eS,getPercentageDragged:e$}=function({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:a,fadeFromIndex:l,onSnapPointChange:i,direction:s="bottom",container:u,snapToSequentialPoint:d}){let[c,f]=$({prop:e,defaultProp:null==n?void 0:n[0],onChange:t}),[p,m]=o.default.useState("u">typeof window?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);o.default.useEffect(()=>{function e(){m({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);let g=o.default.useMemo(()=>c===(null==n?void 0:n[n.length-1])||null,[n,c]),h=o.default.useMemo(()=>{var e;return null!=(e=null==n?void 0:n.findIndex(e=>e===c))?e:null},[n,c]),v=n&&n.length>0&&(l||0===l)&&!Number.isNaN(l)&&n[l]===c||!n,w=o.default.useMemo(()=>{var e;let t=u?{width:u.getBoundingClientRect().width,height:u.getBoundingClientRect().height}:"u">typeof window?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};return null!=(e=null==n?void 0:n.map(e=>{let n="string"==typeof e,r=0;if(n&&(r=parseInt(e,10)),R(s)){let a=n?r:p?e*t.height:0;return p?"bottom"===s?t.height-a:-t.height+a:a}let a=n?r:p?e*t.width:0;return p?"right"===s?t.width-a:-t.width+a:a}))?e:[]},[n,p,u]),y=o.default.useMemo(()=>null!==h?null==w?void 0:w[h]:null,[w,h]),x=o.default.useCallback(e=>{var t;let o=null!=(t=null==w?void 0:w.findIndex(t=>t===e))?t:null;i(o),j(r.current,{transition:`transform 0.5s cubic-bezier(${N.join(",")})`,transform:R(s)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`}),w&&o!==w.length-1&&void 0!==l&&o!==l&&o<l?j(a.current,{transition:`opacity 0.5s cubic-bezier(${N.join(",")})`,opacity:"0"}):j(a.current,{transition:`opacity 0.5s cubic-bezier(${N.join(",")})`,opacity:"1"}),f(null==n?void 0:n[Math.max(o,0)])},[r.current,n,w,l,a,f]);return o.default.useEffect(()=>{if(c||e){var t;let r=null!=(t=null==n?void 0:n.findIndex(t=>t===e||t===c))?t:-1;w&&-1!==r&&"number"==typeof w[r]&&x(w[r])}},[c,e,n,w,x]),{isLastSnapPoint:g,activeSnapPoint:c,shouldFade:v,getPercentageDragged:function(e,t){if(!n||"number"!=typeof h||!w||void 0===l)return null;let r=h===l-1;if(h>=l&&t)return 0;if(r&&!t)return 1;if(!v&&!r)return null;let a=r?h+1:h-1,o=e/Math.abs(r?w[a]-w[a-1]:w[a+1]-w[a]);return r?1-o:o},setActiveSnapPoint:f,activeSnapPointIndex:h,onRelease:function({draggedDistance:e,closeDrawer:t,velocity:r,dismissible:o}){if(void 0===l)return;let i="bottom"===s||"right"===s?(null!=y?y:0)-e:(null!=y?y:0)+e,u=h===l-1,c=0===h,f=e>0;if(u&&j(a.current,{transition:`opacity 0.5s cubic-bezier(${N.join(",")})`}),!d&&r>2&&!f)return void(o?t():x(w[0]));if(!d&&r>2&&f&&w&&n)return void x(w[n.length-1]);let p=null==w?void 0:w.reduce((e,t)=>"number"!=typeof e||"number"!=typeof t?e:Math.abs(t-i)<Math.abs(e-i)?t:e),m=R(s)?window.innerHeight:window.innerWidth;if(r>.4&&Math.abs(e)<.4*m){let e=f?1:-1;return e>0&&g&&n?void x(w[n.length-1]):void(c&&e<0&&o&&t(),null===h||x(w[h+e]))}x(p)},onDrag:function({draggedDistance:e}){if(null===y)return;let t="bottom"===s||"right"===s?y-e:y+e;("bottom"===s||"right"===s)&&t<w[w.length-1]||("top"===s||"left"===s)&&t>w[w.length-1]||j(r.current,{transform:R(s)?`translate3d(0, ${t}px, 0)`:`translate3d(${t}px, 0, 0)`})},snapPointsOffset:w}}({snapPoints:m,activeSnapPointProp:O,setActiveSnapPointProp:L,drawerRef:ew,fadeFromIndex:z,overlayRef:ei,onSnapPointChange:eD,direction:W,container:J,snapToSequentialPoint:U});!function(e={}){let{isDisabled:n}=e;c(()=>{if(!n){var e,r,a;let n,o,l,i,s,d,c;return 1==++v&&u()&&(l=0,i=window.pageXOffset,s=window.pageYOffset,d=f((e=document.documentElement,r="paddingRight",a=`${window.innerWidth-document.documentElement.clientWidth}px`,n=e.style[r],e.style[r]=a,()=>{e.style[r]=n})),window.scrollTo(0,0),c=f(w(document,"touchstart",e=>{((o=g(e.target))!==document.documentElement||o!==document.body)&&(l=e.changedTouches[0].pageY)},{passive:!1,capture:!0}),w(document,"touchmove",e=>{if(!o||o===document.documentElement||o===document.body)return void e.preventDefault();let t=e.changedTouches[0].pageY,n=o.scrollTop,r=o.scrollHeight-o.clientHeight;0!==r&&((n<=0&&t>l||n>=r&&t<l)&&e.preventDefault(),l=t)},{passive:!1,capture:!0}),w(document,"touchend",e=>{let t=e.target;x(t)&&t!==document.activeElement&&(e.preventDefault(),t.style.transform="translateY(-2000px)",t.focus(),requestAnimationFrame(()=>{t.style.transform=""}))},{passive:!1,capture:!0}),w(document,"focus",e=>{let t=e.target;x(t)&&(t.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{t.style.transform="",p&&(p.height<window.innerHeight?requestAnimationFrame(()=>{y(t)}):p.addEventListener("resize",()=>y(t),{once:!0}))}))},!0),w(window,"scroll",()=>{window.scrollTo(0,0)})),t=()=>{d(),c(),window.scrollTo(i,s)}),()=>{0==--v&&(null==t||t())}}},[n])}({isDisabled:!Z||er||!F||eo||!et||!V||!Y});let{restorePositionSetting:ek}=function({isOpen:e,modal:t,nested:n,hasBeenOpened:r,preventScrollRestoration:a,noBodyStyles:l}){let[i,u]=o.default.useState(()=>"u">typeof window?window.location.href:""),d=o.default.useRef(0),c=o.default.useCallback(()=>{if(s()&&null===P&&e&&!l){P={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};let{scrollX:e,innerHeight:t}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-d.current}px`,left:`${-e}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{let e=t-window.innerHeight;e&&d.current>=t&&(document.body.style.top=`${-(d.current+e)}px`)}),300)}},[e]),f=o.default.useCallback(()=>{if(s()&&null!==P&&!l){let e=-parseInt(document.body.style.top,10),t=-parseInt(document.body.style.left,10);Object.assign(document.body.style,P),window.requestAnimationFrame(()=>{a&&i!==window.location.href?u(window.location.href):window.scrollTo(t,e)}),P=null}},[i]);return o.default.useEffect(()=>{function e(){d.current=window.scrollY}return e(),window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[]),o.default.useEffect(()=>{if(t)return()=>{"u"<typeof document||document.querySelector("[data-vaul-drawer]")||f()}},[t,f]),o.default.useEffect(()=>{!n&&r&&(e?(window.matchMedia("(display-mode: standalone)").matches||c(),t||window.setTimeout(()=>{f()},500)):f())},[e,r,i,t,n,c,f]),{restorePositionSetting:f}}({isOpen:Z,modal:F,nested:null!=I&&I,hasBeenOpened:et,preventScrollRestoration:X,noBodyStyles:H});function eP(){return(window.innerWidth-26)/window.innerWidth}function eM(e,t){var n;let r=e,a=null==(n=window.getSelection())?void 0:n.toString(),o=ew.current?C(ew.current,W):null,l=new Date;if("SELECT"===r.tagName||r.hasAttribute("data-vaul-no-drag")||r.closest("[data-vaul-no-drag]"))return!1;if("right"===W||"left"===W)return!0;if(es.current&&l.getTime()-es.current.getTime()<500)return!1;if(null!==o&&("bottom"===W?o>0:o<0))return!0;if(a&&a.length>0)return!1;if(ec.current&&l.getTime()-ec.current.getTime()<S&&0===o||t)return ec.current=l,!1;for(;r;){if(r.scrollHeight>r.clientHeight){if(0!==r.scrollTop)return ec.current=new Date,!1;if("dialog"===r.getAttribute("role"))break}r=r.parentNode}return!0}function ez(e){er&&ew.current&&(ew.current.classList.remove(E),ef.current=!1,ea(!1),ed.current=new Date),null==A||A(),e||ee(!1),setTimeout(()=>{m&&eC(m[0])},500)}function eO(){if(!ew.current)return;let e=document.querySelector("[data-vaul-drawer-wrapper]"),t=C(ew.current,W);j(ew.current,{transform:"translate3d(0, 0, 0)",transition:`transform 0.5s cubic-bezier(${N.join(",")})`}),j(ei.current,{transition:`opacity 0.5s cubic-bezier(${N.join(",")})`,opacity:"1"}),h&&t&&t>0&&Z&&j(e,{borderRadius:"8px",overflow:"hidden",...R(W)?{transform:`scale(${eP()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${eP()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:"0.5s",transitionTimingFunction:`cubic-bezier(${N.join(",")})`},!0)}return o.default.useEffect(()=>{window.requestAnimationFrame(()=>{eh.current=!0})},[]),o.default.useEffect(()=>{var e;function t(){if(ew.current&&V&&(x(document.activeElement)||eg.current)){var e;let t=(null==(e=window.visualViewport)?void 0:e.height)||0,n=window.innerHeight,r=n-t,a=ew.current.getBoundingClientRect().height||0;eb.current||(eb.current=a);let o=ew.current.getBoundingClientRect().top;if(Math.abs(ev.current-r)>60&&(eg.current=!eg.current),m&&m.length>0&&eN&&eR&&(r+=eN[eR]||0),ev.current=r,a>t||eg.current){let e=ew.current.getBoundingClientRect().height,l=e;e>t&&(l=t-(a>.8*n?o:26)),B?ew.current.style.height=`${e-Math.max(r,0)}px`:ew.current.style.height=`${Math.max(l,t-o)}px`}else{let e;e=navigator.userAgent,"u">typeof window&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))||(ew.current.style.height=`${eb.current}px`)}m&&m.length>0&&!eg.current?ew.current.style.bottom="0px":ew.current.style.bottom=`${Math.max(r,0)}px`}}return null==(e=window.visualViewport)||e.addEventListener("resize",t),()=>{var e;return null==(e=window.visualViewport)?void 0:e.removeEventListener("resize",t)}},[eR,m,eN]),o.default.useEffect(()=>(Z&&(j(document.documentElement,{scrollBehavior:"auto"}),es.current=new Date),()=>{!function(e,t){if(!e||!(e instanceof HTMLElement))return;let n=D.get(e);n&&(e.style[t]=n[t])}(document.documentElement,"scrollBehavior")}),[Z]),o.default.useEffect(()=>{F||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[F]),o.default.createElement(a.Root,{defaultOpen:q,onOpenChange:e=>{(k||e)&&(e?en(!0):ez(!0),ee(e))},open:Z},o.default.createElement(l.Provider,{value:{activeSnapPoint:ej,snapPoints:m,setActiveSnapPoint:eC,drawerRef:ew,overlayRef:ei,onOpenChange:n,onPress:function(e){var t,n;!k&&!m||(!ew.current||ew.current.contains(e.target))&&(ey.current=(null==(t=ew.current)?void 0:t.getBoundingClientRect().height)||0,ex.current=(null==(n=ew.current)?void 0:n.getBoundingClientRect().width)||0,ea(!0),eu.current=new Date,u()&&window.addEventListener("touchend",()=>ef.current=!1,{once:!0}),e.target.setPointerCapture(e.pointerId),em.current=R(W)?e.pageY:e.pageX)},onRelease:function(e){var t,n;if(!er||!ew.current)return;ew.current.classList.remove(E),ef.current=!1,ea(!1),ed.current=new Date;let r=C(ew.current,W);if(!e||!eM(e.target,!1)||!r||Number.isNaN(r)||null===eu.current)return;let a=ed.current.getTime()-eu.current.getTime(),o=em.current-(R(W)?e.pageY:e.pageX),l=Math.abs(o)/a;if(l>.05&&(el(!0),setTimeout(()=>{el(!1)},200)),m){eT({draggedDistance:o*("bottom"===W||"right"===W?1:-1),closeDrawer:ez,velocity:l,dismissible:k}),null==d||d(e,!0);return}if("bottom"===W||"right"===W?o>0:o<0){eO(),null==d||d(e,!0);return}if(l>.4){ez(),null==d||d(e,!1);return}let i=Math.min(null!=(t=ew.current.getBoundingClientRect().height)?t:0,window.innerHeight),s=Math.min(null!=(n=ew.current.getBoundingClientRect().width)?n:0,window.innerWidth);if(Math.abs(r)>=("left"===W||"right"===W?s:i)*T){ez(),null==d||d(e,!1);return}null==d||d(e,!0),eO()},onDrag:function(e){if(ew.current&&er){let t="bottom"===W||"right"===W?1:-1,n=(em.current-(R(W)?e.pageY:e.pageX))*t,r=n>0,a=m&&!k&&!r;if(a&&0===eR)return;let o=Math.abs(n),l=document.querySelector("[data-vaul-drawer-wrapper]"),s=o/("bottom"===W||"top"===W?ey.current:ex.current),u=e$(o,r);if(null!==u&&(s=u),a&&s>=1||!ef.current&&!eM(e.target,r))return;if(ew.current.classList.add(E),ef.current=!0,j(ew.current,{transition:"none"}),j(ei.current,{transition:"none"}),m&&eE({draggedDistance:n}),r&&!m){let e=Math.min(-(8*(Math.log(n+1)-2)*1),0)*t;j(ew.current,{transform:R(W)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`});return}let d=1-s;if((eS||z&&eR===z-1)&&(null==i||i(e,s),j(ei.current,{opacity:`${d}`,transition:"none"},!0)),l&&ei.current&&h){let e=Math.min(eP()+s*(1-eP()),1),t=8-8*s,n=Math.max(0,14-14*s);j(l,{borderRadius:`${t}px`,transform:R(W)?`scale(${e}) translate3d(0, ${n}px, 0)`:`scale(${e}) translate3d(${n}px, 0, 0)`,transition:"none"},!0)}if(!m){let e=o*t;j(ew.current,{transform:R(W)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})}}},dismissible:k,shouldAnimate:eh,handleOnly:M,isOpen:Z,isDragging:er,shouldFade:eS,closeDrawer:ez,onNestedDrag:function(e,t){if(t<0)return;let n=(window.innerWidth-16)/window.innerWidth,r=n+t*(1-n),a=-16+16*t;j(ew.current,{transform:R(W)?`scale(${r}) translate3d(0, ${a}px, 0)`:`scale(${r}) translate3d(${a}px, 0, 0)`,transition:"none"})},onNestedOpenChange:function(e){let t=e?(window.innerWidth-16)/window.innerWidth:1,n=e?-16:0;ep.current&&window.clearTimeout(ep.current),j(ew.current,{transition:`transform 0.5s cubic-bezier(${N.join(",")})`,transform:R(W)?`scale(${t}) translate3d(0, ${n}px, 0)`:`scale(${t}) translate3d(${n}px, 0, 0)`}),!e&&ew.current&&(ep.current=setTimeout(()=>{let e=C(ew.current,W);j(ew.current,{transition:"none",transform:R(W)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})},500))},onNestedRelease:function(e,t){let n=R(W)?window.innerHeight:window.innerWidth,r=t?(n-16)/n:1,a=t?-16:0;t&&j(ew.current,{transition:`transform 0.5s cubic-bezier(${N.join(",")})`,transform:R(W)?`scale(${r}) translate3d(0, ${a}px, 0)`:`scale(${r}) translate3d(${a}px, 0, 0)`})},keyboardIsOpen:eg,modal:F,snapPointsOffset:eN,activeSnapPointIndex:eR,direction:W,shouldScaleBackground:h,setBackgroundColorOnScale:b,noBodyStyles:H,container:J,autoFocus:_}},r))}let z=o.default.forwardRef(function({...e},t){let{overlayRef:n,snapPoints:r,onRelease:l,shouldFade:s,isOpen:u,modal:d,shouldAnimate:c}=i(),f=b(t,n),p=r&&r.length>0;if(!d)return null;let m=o.default.useCallback(e=>l(e),[l]);return o.default.createElement(a.Overlay,{onMouseUp:m,ref:f,"data-vaul-overlay":"","data-vaul-snap-points":u&&p?"true":"false","data-vaul-snap-points-overlay":u&&s?"true":"false","data-vaul-animate":(null==c?void 0:c.current)?"true":"false",...e})});z.displayName="Drawer.Overlay";let O=o.default.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...r},l){let{drawerRef:s,onPress:u,onRelease:d,onDrag:c,keyboardIsOpen:f,snapPointsOffset:p,activeSnapPointIndex:m,modal:g,isOpen:h,direction:v,snapPoints:w,container:y,handleOnly:x,shouldAnimate:D,autoFocus:j}=i(),[C,E]=o.default.useState(!1),S=b(l,s),$=o.default.useRef(null),P=o.default.useRef(null),M=o.default.useRef(!1),z=w&&w.length>0;function O(e){$.current=null,M.current=!1,d(e)}return!function(){let{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:a}=i(),l=o.default.useRef(null),s=(0,o.useMemo)(()=>document.body.style.backgroundColor,[]);function u(){return(window.innerWidth-26)/window.innerWidth}o.default.useEffect(()=>{if(t&&n){l.current&&clearTimeout(l.current);let t=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!t)return;!function(...e){}(r&&!a?T(document.body,{background:"black"}):k,T(t,{transformOrigin:R(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:"0.5s",transitionTimingFunction:`cubic-bezier(${N.join(",")})`}));let n=T(t,{borderRadius:"8px",overflow:"hidden",...R(e)?{transform:`scale(${u()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${u()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{n(),l.current=window.setTimeout(()=>{s?document.body.style.background=s:document.body.style.removeProperty("background")},500)}}},[t,n,s])}(),o.default.useEffect(()=>{z&&window.requestAnimationFrame(()=>{E(!0)})},[]),o.default.createElement(a.Content,{"data-vaul-drawer-direction":v,"data-vaul-drawer":"","data-vaul-delayed-snap-points":C?"true":"false","data-vaul-snap-points":h&&z?"true":"false","data-vaul-custom-container":y?"true":"false","data-vaul-animate":(null==D?void 0:D.current)?"true":"false",...r,ref:S,style:p&&p.length>0?{"--snap-point-height":`${p[null!=m?m:0]}px`,...t}:t,onPointerDown:e=>{x||(null==r.onPointerDown||r.onPointerDown.call(r,e),$.current={x:e.pageX,y:e.pageY},u(e))},onOpenAutoFocus:e=>{null==n||n(e),j||e.preventDefault()},onPointerDownOutside:t=>{(null==e||e(t),!g||t.defaultPrevented)?t.preventDefault():f.current&&(f.current=!1)},onFocusOutside:e=>{if(!g)return void e.preventDefault()},onPointerMove:e=>{if(P.current=e,x||(null==r.onPointerMove||r.onPointerMove.call(r,e),!$.current))return;let t=e.pageY-$.current.y,n=e.pageX-$.current.x,a="touch"===e.pointerType?10:2;((e,t,n=0)=>{if(M.current)return!0;let r=Math.abs(e.y),a=Math.abs(e.x),o=a>r,l=["bottom","right"].includes(t)?1:-1;if("left"===t||"right"===t){if(!(e.x*l<0)&&a>=0&&a<=n)return o}else if(!(e.y*l<0)&&r>=0&&r<=n)return!o;return M.current=!0,!0})({x:n,y:t},v,a)?c(e):(Math.abs(n)>a||Math.abs(t)>a)&&($.current=null)},onPointerUp:e=>{null==r.onPointerUp||r.onPointerUp.call(r,e),$.current=null,M.current=!1,d(e)},onPointerOut:e=>{null==r.onPointerOut||r.onPointerOut.call(r,e),O(P.current)},onContextMenu:e=>{null==r.onContextMenu||r.onContextMenu.call(r,e),P.current&&O(P.current)}})});O.displayName="Drawer.Content";let L=o.default.forwardRef(function({preventCycle:e=!1,children:t,...n},r){let{closeDrawer:a,isDragging:l,snapPoints:s,activeSnapPoint:u,setActiveSnapPoint:d,dismissible:c,handleOnly:f,isOpen:p,onPress:m,onDrag:g}=i(),h=o.default.useRef(null),v=o.default.useRef(!1);function w(){h.current&&window.clearTimeout(h.current),v.current=!1}return o.default.createElement("div",{onClick:function(){v.current?w():window.setTimeout(()=>{!function(){if(l||e||v.current)return w();if(w(),!s||0===s.length){c||a();return}if(u===s[s.length-1]&&c)return a();let t=s.findIndex(e=>e===u);-1===t||d(s[t+1])}()},120)},onPointerCancel:w,onPointerDown:e=>{f&&m(e),h.current=window.setTimeout(()=>{v.current=!0},250)},onPointerMove:e=>{f&&g(e)},ref:r,"data-vaul-drawer-visible":p?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},o.default.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});L.displayName="Drawer.Handle";let B={Root:M,NestedRoot:function({onDrag:e,onOpenChange:t,open:n,...r}){let{onNestedDrag:a,onNestedOpenChange:l,onNestedRelease:s}=i();if(!a)throw Error("Drawer.NestedRoot must be placed in another drawer");return o.default.createElement(M,{nested:!0,open:n,onClose:()=>{l(!1)},onDrag:(t,n)=>{a(t,n),null==e||e(t,n)},onOpenChange:e=>{e&&l(e),null==t||t(e)},onRelease:s,...r})},Content:O,Overlay:z,Trigger:a.Trigger,Portal:function(e){let t=i(),{container:n=t.container,...r}=e;return o.default.createElement(a.Portal,{container:n,...r})},Handle:L,Close:a.Close,Title:a.Title,Description:a.Description};var F=e.i(31777);function A({...e}){return(0,n.jsx)(B.Root,{"data-slot":"drawer",...e})}function I({...e}){return(0,n.jsx)(B.Portal,{"data-slot":"drawer-portal",...e})}function H({className:e,...t}){return(0,n.jsx)(B.Overlay,{"data-slot":"drawer-overlay",className:(0,F.cn)("fixed inset-0 z-50 bg-black/50",e),...t})}function W({className:e,children:t,direction:a="bottom",showCloseButton:o=!0,...l}){return(0,n.jsx)(I,{children:(0,n.jsxs)(B.Content,{"data-slot":"drawer-content",className:(0,F.cn)("bg-background fixed z-50 flex flex-col shadow-lg","bottom"===a&&"inset-x-0 bottom-0 mb-24 rounded-t-lg border-t","top"===a&&"inset-x-0 top-0 mt-24 rounded-b-lg border-b","right"===a&&"inset-y-0 right-0 h-full w-3/4 border-l","left"===a&&"inset-y-0 left-0 h-full w-3/4 border-r",e),style:{"--initial-transform":"right"===a?"calc(100% + 8px)":"left"===a||"top"===a?"calc(-100% - 8px)":"calc(100% + 8px)",userSelect:"text",...l.style??{}},...l,children:[t,o?(0,n.jsxs)(B.Close,{className:"ring-offset-background focus:ring-ring absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[(0,n.jsx)(r.XIcon,{className:"size-4"}),(0,n.jsx)("span",{className:"sr-only",children:"Close"})]}):null]})})}function q({className:e,...t}){return(0,n.jsx)("div",{"data-slot":"drawer-header",className:(0,F.cn)("flex flex-col gap-1.5 p-4",e),...t})}function Y({className:e,...t}){return(0,n.jsx)("div",{"data-slot":"drawer-footer",className:(0,F.cn)("mt-auto flex flex-col gap-2 p-4",e),...t})}function U({className:e,...t}){return(0,n.jsx)(B.Title,{"data-slot":"drawer-title",className:(0,F.cn)("text-foreground font-semibold",e),...t})}function X({className:e,...t}){return(0,n.jsx)(B.Description,{"data-slot":"drawer-description",className:(0,F.cn)("text-muted-foreground text-sm",e),...t})}e.s(["Drawer",()=>A,"DrawerContent",()=>W,"DrawerDescription",()=>X,"DrawerFooter",()=>Y,"DrawerHeader",()=>q,"DrawerOverlay",()=>H,"DrawerTitle",()=>U],45811)},8537,e=>{"use strict";var t=e.i(79054),n=e.i(18354),r=e.i(21023);let a=(0,r.createServerReference)("408c434a42f5933b1316c6962fb23f17b2b04b8279",r.callServer,void 0,r.findSourceMapURL,"deployFeature"),o=(0,r.createServerReference)("403168fc6184f738b6545828a36461497ded4523ff",r.callServer,void 0,r.findSourceMapURL,"deployRepository"),l=(0,r.createServerReference)("4051e864c01392c7226112807139c0acac684a65e9",r.callServer,void 0,r.findSourceMapURL,"stopDeployment"),i=(0,r.createServerReference)("4024314f8ec9ae176c3ce812df1dbe5d2e565faba9",r.callServer,void 0,r.findSourceMapURL,"getDeploymentStatus"),s=(0,n.createLogger)("[useDeployAction]");function u(e){let[n,r]=(0,t.useState)(!1),[u,d]=(0,t.useState)(!1),[c,f]=(0,t.useState)(null),[p,m]=(0,t.useState)(null),[g,h]=(0,t.useState)(null),v=(0,t.useRef)(null),w=(0,t.useRef)(null),y=(0,t.useRef)(!0),x=(0,t.useRef)(p);(0,t.useEffect)(()=>{x.current=p},[p]),(0,t.useEffect)(()=>(y.current=!0,()=>{y.current=!1}),[]),(0,t.useEffect)(()=>()=>{v.current&&clearTimeout(v.current),w.current&&clearInterval(w.current)},[]);let b=(0,t.useCallback)(()=>{w.current&&(s.debug("stopping polling"),clearInterval(w.current),w.current=null)},[]),D=(0,t.useCallback)(e=>{b(),s.debug(`starting polling for "${e}" every 3000ms`),w.current=setInterval(async()=>{if(!y.current)return void b();let t=await i(e);y.current&&(t&&"Stopped"!==t.state?(t.state!==x.current&&s.info(`poll state changed: ${x.current} → ${t.state}, url=${t.url}`),m(t.state),h(t.url)):(s.info(`poll result: ${t?`state=${t.state}`:"null (deployment gone)"} — stopping poll`),m(null),h(null),b()))},3e3)},[b]),j=(0,t.useCallback)(async()=>{if(!e)return void s.warn("deploy() called but input is null — no-op");if(n)return void s.warn("deploy() called but already loading — no-op");s.info(`deploy() — targetType="${e.targetType}", targetId="${e.targetId}", repositoryPath="${e.repositoryPath}"`),v.current&&clearTimeout(v.current),r(!0),f(null);try{let t="feature"===e.targetType?await a(e.targetId):await o(e.repositoryPath);if(s.info("server action result:",t),!y.current)return void s.warn("component unmounted after deploy — discarding result");if(t.success)s.info(`deploy succeeded — initial state=${t.state}, starting polling`),m(t.state??null),h(null),D(e.targetId);else{let e=t.error??"An unexpected error occurred";s.error(`deploy failed: ${e}`),f(e),v.current=setTimeout(()=>f(null),5e3)}}catch(t){if(!y.current)return;let e=t instanceof Error?t.message:"An unexpected error occurred";s.error(`deploy threw exception: ${e}`,t),f(e),v.current=setTimeout(()=>f(null),5e3)}finally{y.current&&r(!1)}},[e,n,D]),R=(0,t.useCallback)(async()=>{if(e&&!u){s.info(`stop() — targetId="${e.targetId}"`),d(!0);try{let t=await l(e.targetId);if(s.info("stop result:",t),!y.current)return;t.success&&(b(),m(null),h(null))}catch(e){s.warn("stop error (non-critical):",e)}finally{y.current&&d(!1)}}},[e,u,b]);return{deploy:j,stop:R,deployLoading:n,stopLoading:u,deployError:c,status:p,url:g}}e.s(["useDeployAction",()=>u],8537)},11495,e=>{"use strict";var t=e.i(20314),n=e.i(79054),r=e.i(48249),a=e.i(24042),o=e.i(64970),l=e.i(94237),i=e.i(31777);e.i(81803);var s=e.i(72714);e.i(99348);var u=e.i(17466),d=e.i(45811),c=e.i(25235),f=e.i(2828),p=e.i(8537),m=e.i(75921);let g=(0,l.cva)("",{variants:{size:{sm:"w-96",md:"w-2xl"}},defaultVariants:{size:"sm"}});function h({open:e,onClose:a,modal:o=!1,dismissOnOutsideClick:l=!1,title:s="Drawer",size:u,header:f,children:p,footer:h,className:w,"data-testid":y,deployTarget:x}){let b=(0,m.useFeatureFlags)(),D=(0,n.useRef)(null);return(0,n.useEffect)(()=>{if(!e||o)return;let t=e=>{let t=e.target;!document.body.contains(t)||D.current?.contains(t)||t.closest(l?'[role="alertdialog"], [role="dialog"], [role="menu"], [role="listbox"], [data-radix-popper-content-wrapper]':'[data-no-drawer-close], [role="alertdialog"], [role="dialog"], [role="menu"], [role="listbox"], [data-radix-popper-content-wrapper]')||a()};return document.addEventListener("click",t),()=>document.removeEventListener("click",t)},[e,o,a,l]),(0,t.jsxs)(d.Drawer,{direction:"right",modal:o,handleOnly:!0,open:e,onOpenChange:e=>{e||a()},children:[o?(0,t.jsx)(d.DrawerOverlay,{}):null,(0,t.jsxs)(d.DrawerContent,{ref:D,direction:"right",showCloseButton:!1,className:(0,i.cn)(g({size:u}),w),"data-testid":y,onInteractOutside:o?void 0:e=>e.preventDefault(),children:[(0,t.jsx)(d.DrawerTitle,{asChild:!0,children:(0,t.jsx)("span",{className:"sr-only",children:s})}),(0,t.jsx)(d.DrawerDescription,{asChild:!0,children:(0,t.jsx)("span",{className:"sr-only",children:s})}),(0,t.jsxs)("button",{type:"button","aria-label":"Close",onClick:a,className:"ring-offset-background focus:ring-ring absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden","data-testid":y?`${y}-close-button`:void 0,children:[(0,t.jsx)(r.XIcon,{className:"size-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]}),f?(0,t.jsx)(d.DrawerHeader,{className:"shrink-0",children:f}):null,f?(0,t.jsx)(c.Separator,{}):null,b.envDeploy&&x?(0,t.jsx)(v,{deployTarget:x}):null,(0,t.jsx)("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:p}),h?(0,t.jsx)(d.DrawerFooter,{className:"shrink-0",children:h}):null]})]})}function v({deployTarget:e}){let n=(0,p.useDeployAction)(e),r="Booting"===n.status||"Ready"===n.status;return(0,t.jsxs)("div",{"data-testid":"base-drawer-deploy-bar",className:"flex items-center gap-2 px-4 pb-3",children:[(0,t.jsx)(f.TooltipProvider,{children:(0,t.jsxs)(f.Tooltip,{children:[(0,t.jsx)(f.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{children:(0,t.jsx)(s.ActionButton,{label:r?"Stop Dev Server":"Start Dev Server",onClick:r?n.stop:n.deploy,loading:n.deployLoading||n.stopLoading,error:!!n.deployError,icon:r?o.Square:a.Play,iconOnly:!0,variant:"outline",size:"icon-sm"})})}),(0,t.jsx)(f.TooltipContent,{children:r?"Stop Dev Server":"Start Dev Server"})]})}),r?(0,t.jsx)(u.DeploymentStatusBadge,{status:n.status,url:n.url,targetId:e.targetId}):null]})}e.s(["BaseDrawer",()=>h])}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,41952,e=>{"use strict";var t=e.i(20314),n=e.i(79054),r=e.i(87889),a=e.i(3645);let i=(0,a.default)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);var o=e.i(23925),l=e.i(26370),s=e.i(38573),d=e.i(49228);let c=(0,a.default)("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),u=(0,a.default)("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]),p=(0,a.default)("flag",[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]]),m=(0,a.default)("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);var h=e.i(10714),h=h,f=e.i(3214),g=e.i(30702);let x=(0,a.default)("settings-2",[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]),v=(0,a.default)("timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);var w=e.i(60112),b=e.i(31777),y=e.i(41957),j=e.i(98127),S=e.i(35364),C=e.i(51911),k=e.i(2828),I=e.i(26036),M=e.i(27069),N=e.i(91967),P=e.i(87342),E=e.i(5978),R=e.i(22528),T=e.i(66033),A=e.i(53532),D=e.i(41687),L=e.i(56720),F=e.i(13123),H=e.i(52740),z=e.i(39979),B=e.i(87620),_=e.i(86874),V=e.i(29297),W=e.i(36589),O=e.i(5192),U=e.i(23405),K=e.i(1693),q=e.i(73772),G=e.i(13044),$=[" ","Enter","ArrowUp","ArrowDown"],Y=[" ","Enter"],Z="Select",[X,Q,J]=(0,P.createCollection)(Z),[ee,et]=(0,R.createContextScope)(Z,[J,H.createPopperScope]),en=(0,H.createPopperScope)(),[er,ea]=ee(Z),[ei,eo]=ee(Z),el=e=>{let{__scopeSelect:r,children:a,open:i,defaultOpen:o,onOpenChange:l,value:s,defaultValue:d,onValueChange:c,dir:u,name:p,autoComplete:m,disabled:h,required:f,form:g}=e,x=en(r),[v,w]=n.useState(null),[b,y]=n.useState(null),[j,S]=n.useState(!1),C=(0,T.useDirection)(u),[k,I]=(0,W.useControllableState)({prop:i,defaultProp:o??!1,onChange:l,caller:Z}),[M,N]=(0,W.useControllableState)({prop:s,defaultProp:d,onChange:c,caller:Z}),P=n.useRef(null),E=!v||g||!!v.closest("form"),[R,A]=n.useState(new Set),D=Array.from(R).map(e=>e.props.value).join(";");return(0,t.jsx)(H.Root,{...x,children:(0,t.jsxs)(er,{required:f,scope:r,trigger:v,onTriggerChange:w,valueNode:b,onValueNodeChange:y,valueNodeHasChildren:j,onValueNodeHasChildrenChange:S,contentId:(0,F.useId)(),value:M,onValueChange:N,open:k,onOpenChange:I,dir:C,triggerPointerDownPosRef:P,disabled:h,children:[(0,t.jsx)(X.Provider,{scope:r,children:(0,t.jsx)(ei,{scope:e.__scopeSelect,onNativeOptionAdd:n.useCallback(e=>{A(t=>new Set(t).add(e))},[]),onNativeOptionRemove:n.useCallback(e=>{A(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:a})}),E?(0,t.jsxs)(e$,{"aria-hidden":!0,required:f,tabIndex:-1,name:p,autoComplete:m,value:M,onChange:e=>N(e.target.value),disabled:h,form:g,children:[void 0===M?(0,t.jsx)("option",{value:""}):null,Array.from(R)]},D):null]})})};el.displayName=Z;var es="SelectTrigger",ed=n.forwardRef((e,r)=>{let{__scopeSelect:a,disabled:i=!1,...o}=e,l=en(a),s=ea(es,a),d=s.disabled||i,c=(0,E.useComposedRefs)(r,s.onTriggerChange),u=Q(a),p=n.useRef("touch"),[m,h,f]=eZ(e=>{let t=u().filter(e=>!e.disabled),n=t.find(e=>e.value===s.value),r=eX(t,e,n);void 0!==r&&s.onValueChange(r.value)}),g=e=>{d||(s.onOpenChange(!0),f()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,t.jsx)(H.Anchor,{asChild:!0,...l,children:(0,t.jsx)(B.Primitive.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:d,"data-disabled":d?"":void 0,"data-placeholder":eY(s.value)?"":void 0,...o,ref:c,onClick:(0,N.composeEventHandlers)(o.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&g(e)}),onPointerDown:(0,N.composeEventHandlers)(o.onPointerDown,e=>{p.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(g(e),e.preventDefault())}),onKeyDown:(0,N.composeEventHandlers)(o.onKeyDown,e=>{let t=""!==m.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||h(e.key),(!t||" "!==e.key)&&$.includes(e.key)&&(g(),e.preventDefault())})})})});ed.displayName=es;var ec="SelectValue",eu=n.forwardRef((e,n)=>{let{__scopeSelect:r,className:a,style:i,children:o,placeholder:l="",...s}=e,d=ea(ec,r),{onValueNodeHasChildrenChange:c}=d,u=void 0!==o,p=(0,E.useComposedRefs)(n,d.onValueNodeChange);return(0,O.useLayoutEffect)(()=>{c(u)},[c,u]),(0,t.jsx)(B.Primitive.span,{...s,ref:p,style:{pointerEvents:"none"},children:eY(d.value)?(0,t.jsx)(t.Fragment,{children:l}):o})});eu.displayName=ec;var ep=n.forwardRef((e,n)=>{let{__scopeSelect:r,children:a,...i}=e;return(0,t.jsx)(B.Primitive.span,{"aria-hidden":!0,...i,ref:n,children:a||"▼"})});ep.displayName="SelectIcon";var em=e=>(0,t.jsx)(z.Portal,{asChild:!0,...e});em.displayName="SelectPortal";var eh="SelectContent",ef=n.forwardRef((e,r)=>{let a=ea(eh,e.__scopeSelect),[i,o]=n.useState();return((0,O.useLayoutEffect)(()=>{o(new DocumentFragment)},[]),a.open)?(0,t.jsx)(ew,{...e,ref:r}):i?I.createPortal((0,t.jsx)(eg,{scope:e.__scopeSelect,children:(0,t.jsx)(X.Slot,{scope:e.__scopeSelect,children:(0,t.jsx)("div",{children:e.children})})}),i):null});ef.displayName=eh;var[eg,ex]=ee(eh),ev=(0,_.createSlot)("SelectContent.RemoveScroll"),ew=n.forwardRef((e,r)=>{let{__scopeSelect:a,position:i="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:l,onPointerDownOutside:s,side:d,sideOffset:c,align:u,alignOffset:p,arrowPadding:m,collisionBoundary:h,collisionPadding:f,sticky:g,hideWhenDetached:x,avoidCollisions:v,...w}=e,b=ea(eh,a),[y,j]=n.useState(null),[S,C]=n.useState(null),k=(0,E.useComposedRefs)(r,e=>j(e)),[I,M]=n.useState(null),[P,R]=n.useState(null),T=Q(a),[F,H]=n.useState(!1),z=n.useRef(!1);n.useEffect(()=>{if(y)return(0,q.hideOthers)(y)},[y]),(0,D.useFocusGuards)();let B=n.useCallback(e=>{let[t,...n]=T().map(e=>e.ref.current),[r]=n.slice(-1),a=document.activeElement;for(let n of e)if(n===a||(n?.scrollIntoView({block:"nearest"}),n===t&&S&&(S.scrollTop=0),n===r&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==a))return},[T,S]),_=n.useCallback(()=>B([I,y]),[B,I,y]);n.useEffect(()=>{F&&_()},[F,_]);let{onOpenChange:V,triggerPointerDownPosRef:W}=b;n.useEffect(()=>{if(y){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(W.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(W.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():y.contains(n.target)||V(!1),document.removeEventListener("pointermove",t),W.current=null};return null!==W.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[y,V,W]),n.useEffect(()=>{let e=()=>V(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[V]);let[O,U]=eZ(e=>{let t=T().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),r=eX(t,e,n);r&&setTimeout(()=>r.ref.current.focus())}),K=n.useCallback((e,t,n)=>{let r=!z.current&&!n;(void 0!==b.value&&b.value===t||r)&&(M(e),r&&(z.current=!0))},[b.value]),$=n.useCallback(()=>y?.focus(),[y]),Y=n.useCallback((e,t,n)=>{let r=!z.current&&!n;(void 0!==b.value&&b.value===t||r)&&R(e)},[b.value]),Z="popper"===i?ey:eb,X=Z===ey?{side:d,sideOffset:c,align:u,alignOffset:p,arrowPadding:m,collisionBoundary:h,collisionPadding:f,sticky:g,hideWhenDetached:x,avoidCollisions:v}:{};return(0,t.jsx)(eg,{scope:a,content:y,viewport:S,onViewportChange:C,itemRefCallback:K,selectedItem:I,onItemLeave:$,itemTextRefCallback:Y,focusSelectedItem:_,selectedItemText:P,position:i,isPositioned:F,searchRef:O,children:(0,t.jsx)(G.RemoveScroll,{as:ev,allowPinchZoom:!0,children:(0,t.jsx)(L.FocusScope,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:(0,N.composeEventHandlers)(o,e=>{b.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,t.jsx)(A.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:(0,t.jsx)(Z,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:e=>e.preventDefault(),...w,...X,onPlaced:()=>H(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:(0,N.composeEventHandlers)(w.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||U(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=T().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>B(t)),e.preventDefault()}})})})})})})});ew.displayName="SelectContentImpl";var eb=n.forwardRef((e,r)=>{let{__scopeSelect:a,onPlaced:i,...o}=e,l=ea(eh,a),s=ex(eh,a),[d,c]=n.useState(null),[u,p]=n.useState(null),m=(0,E.useComposedRefs)(r,e=>p(e)),h=Q(a),f=n.useRef(!1),g=n.useRef(!0),{viewport:x,selectedItem:v,selectedItemText:w,focusSelectedItem:b}=s,y=n.useCallback(()=>{if(l.trigger&&l.valueNode&&d&&u&&x&&v&&w){let e=l.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=l.valueNode.getBoundingClientRect(),r=w.getBoundingClientRect();if("rtl"!==l.dir){let a=r.left-t.left,i=n.left-a,o=e.left-i,l=e.width+o,s=Math.max(l,t.width),c=window.innerWidth-10,u=(0,M.clamp)(i,[10,Math.max(10,c-s)]);d.style.minWidth=l+"px",d.style.left=u+"px"}else{let a=t.right-r.right,i=window.innerWidth-n.right-a,o=window.innerWidth-e.right-i,l=e.width+o,s=Math.max(l,t.width),c=window.innerWidth-10,u=(0,M.clamp)(i,[10,Math.max(10,c-s)]);d.style.minWidth=l+"px",d.style.right=u+"px"}let a=h(),o=window.innerHeight-20,s=x.scrollHeight,c=window.getComputedStyle(u),p=parseInt(c.borderTopWidth,10),m=parseInt(c.paddingTop,10),g=parseInt(c.borderBottomWidth,10),b=p+m+s+parseInt(c.paddingBottom,10)+g,y=Math.min(5*v.offsetHeight,b),j=window.getComputedStyle(x),S=parseInt(j.paddingTop,10),C=parseInt(j.paddingBottom,10),k=e.top+e.height/2-10,I=v.offsetHeight/2,N=p+m+(v.offsetTop+I);if(N<=k){let e=a.length>0&&v===a[a.length-1].ref.current;d.style.bottom="0px";let t=Math.max(o-k,I+(e?C:0)+(u.clientHeight-x.offsetTop-x.offsetHeight)+g);d.style.height=N+t+"px"}else{let e=a.length>0&&v===a[0].ref.current;d.style.top="0px";let t=Math.max(k,p+x.offsetTop+(e?S:0)+I);d.style.height=t+(b-N)+"px",x.scrollTop=N-k+x.offsetTop}d.style.margin="10px 0",d.style.minHeight=y+"px",d.style.maxHeight=o+"px",i?.(),requestAnimationFrame(()=>f.current=!0)}},[h,l.trigger,l.valueNode,d,u,x,v,w,l.dir,i]);(0,O.useLayoutEffect)(()=>y(),[y]);let[j,S]=n.useState();(0,O.useLayoutEffect)(()=>{u&&S(window.getComputedStyle(u).zIndex)},[u]);let C=n.useCallback(e=>{e&&!0===g.current&&(y(),b?.(),g.current=!1)},[y,b]);return(0,t.jsx)(ej,{scope:a,contentWrapper:d,shouldExpandOnScrollRef:f,onScrollButtonChange:C,children:(0,t.jsx)("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:(0,t.jsx)(B.Primitive.div,{...o,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});eb.displayName="SelectItemAlignedPosition";var ey=n.forwardRef((e,n)=>{let{__scopeSelect:r,align:a="start",collisionPadding:i=10,...o}=e,l=en(r);return(0,t.jsx)(H.Content,{...l,...o,ref:n,align:a,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ey.displayName="SelectPopperPosition";var[ej,eS]=ee(eh,{}),eC="SelectViewport",ek=n.forwardRef((e,r)=>{let{__scopeSelect:a,nonce:i,...o}=e,l=ex(eC,a),s=eS(eC,a),d=(0,E.useComposedRefs)(r,l.onViewportChange),c=n.useRef(0);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),(0,t.jsx)(X.Slot,{scope:a,children:(0,t.jsx)(B.Primitive.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:(0,N.composeEventHandlers)(o.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=s;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-20,a=Math.max(parseFloat(n.style.minHeight),parseFloat(n.style.height));if(a<r){let i=a+e,o=Math.min(r,i),l=i-o;n.style.height=o+"px","0px"===n.style.bottom&&(t.scrollTop=l>0?l:0,n.style.justifyContent="flex-end")}}}c.current=t.scrollTop})})})]})});ek.displayName=eC;var eI="SelectGroup",[eM,eN]=ee(eI),eP=n.forwardRef((e,n)=>{let{__scopeSelect:r,...a}=e,i=(0,F.useId)();return(0,t.jsx)(eM,{scope:r,id:i,children:(0,t.jsx)(B.Primitive.div,{role:"group","aria-labelledby":i,...a,ref:n})})});eP.displayName=eI;var eE="SelectLabel",eR=n.forwardRef((e,n)=>{let{__scopeSelect:r,...a}=e,i=eN(eE,r);return(0,t.jsx)(B.Primitive.div,{id:i.id,...a,ref:n})});eR.displayName=eE;var eT="SelectItem",[eA,eD]=ee(eT),eL=n.forwardRef((e,r)=>{let{__scopeSelect:a,value:i,disabled:o=!1,textValue:l,...s}=e,d=ea(eT,a),c=ex(eT,a),u=d.value===i,[p,m]=n.useState(l??""),[h,f]=n.useState(!1),g=(0,E.useComposedRefs)(r,e=>c.itemRefCallback?.(e,i,o)),x=(0,F.useId)(),v=n.useRef("touch"),w=()=>{o||(d.onValueChange(i),d.onOpenChange(!1))};if(""===i)throw Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return(0,t.jsx)(eA,{scope:a,value:i,disabled:o,textId:x,isSelected:u,onItemTextChange:n.useCallback(e=>{m(t=>t||(e?.textContent??"").trim())},[]),children:(0,t.jsx)(X.ItemSlot,{scope:a,value:i,disabled:o,textValue:p,children:(0,t.jsx)(B.Primitive.div,{role:"option","aria-labelledby":x,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:g,onFocus:(0,N.composeEventHandlers)(s.onFocus,()=>f(!0)),onBlur:(0,N.composeEventHandlers)(s.onBlur,()=>f(!1)),onClick:(0,N.composeEventHandlers)(s.onClick,()=>{"mouse"!==v.current&&w()}),onPointerUp:(0,N.composeEventHandlers)(s.onPointerUp,()=>{"mouse"===v.current&&w()}),onPointerDown:(0,N.composeEventHandlers)(s.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:(0,N.composeEventHandlers)(s.onPointerMove,e=>{v.current=e.pointerType,o?c.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:(0,N.composeEventHandlers)(s.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:(0,N.composeEventHandlers)(s.onKeyDown,e=>{(c.searchRef?.current===""||" "!==e.key)&&(Y.includes(e.key)&&w()," "===e.key&&e.preventDefault())})})})})});eL.displayName=eT;var eF="SelectItemText",eH=n.forwardRef((e,r)=>{let{__scopeSelect:a,className:i,style:o,...l}=e,s=ea(eF,a),d=ex(eF,a),c=eD(eF,a),u=eo(eF,a),[p,m]=n.useState(null),h=(0,E.useComposedRefs)(r,e=>m(e),c.onItemTextChange,e=>d.itemTextRefCallback?.(e,c.value,c.disabled)),f=p?.textContent,g=n.useMemo(()=>(0,t.jsx)("option",{value:c.value,disabled:c.disabled,children:f},c.value),[c.disabled,c.value,f]),{onNativeOptionAdd:x,onNativeOptionRemove:v}=u;return(0,O.useLayoutEffect)(()=>(x(g),()=>v(g)),[x,v,g]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(B.Primitive.span,{id:c.textId,...l,ref:h}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?I.createPortal(l.children,s.valueNode):null]})});eH.displayName=eF;var ez="SelectItemIndicator",eB=n.forwardRef((e,n)=>{let{__scopeSelect:r,...a}=e;return eD(ez,r).isSelected?(0,t.jsx)(B.Primitive.span,{"aria-hidden":!0,...a,ref:n}):null});eB.displayName=ez;var e_="SelectScrollUpButton",eV=n.forwardRef((e,r)=>{let a=ex(e_,e.__scopeSelect),i=eS(e_,e.__scopeSelect),[o,l]=n.useState(!1),s=(0,E.useComposedRefs)(r,i.onScrollButtonChange);return(0,O.useLayoutEffect)(()=>{if(a.viewport&&a.isPositioned){let e=function(){l(t.scrollTop>0)},t=a.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[a.viewport,a.isPositioned]),o?(0,t.jsx)(eU,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=a;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});eV.displayName=e_;var eW="SelectScrollDownButton",eO=n.forwardRef((e,r)=>{let a=ex(eW,e.__scopeSelect),i=eS(eW,e.__scopeSelect),[o,l]=n.useState(!1),s=(0,E.useComposedRefs)(r,i.onScrollButtonChange);return(0,O.useLayoutEffect)(()=>{if(a.viewport&&a.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;l(Math.ceil(t.scrollTop)<e)},t=a.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[a.viewport,a.isPositioned]),o?(0,t.jsx)(eU,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=a;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});eO.displayName=eW;var eU=n.forwardRef((e,r)=>{let{__scopeSelect:a,onAutoScroll:i,...o}=e,l=ex("SelectScrollButton",a),s=n.useRef(null),d=Q(a),c=n.useCallback(()=>{null!==s.current&&(window.clearInterval(s.current),s.current=null)},[]);return n.useEffect(()=>()=>c(),[c]),(0,O.useLayoutEffect)(()=>{let e=d().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[d]),(0,t.jsx)(B.Primitive.div,{"aria-hidden":!0,...o,ref:r,style:{flexShrink:0,...o.style},onPointerDown:(0,N.composeEventHandlers)(o.onPointerDown,()=>{null===s.current&&(s.current=window.setInterval(i,50))}),onPointerMove:(0,N.composeEventHandlers)(o.onPointerMove,()=>{l.onItemLeave?.(),null===s.current&&(s.current=window.setInterval(i,50))}),onPointerLeave:(0,N.composeEventHandlers)(o.onPointerLeave,()=>{c()})})}),eK=n.forwardRef((e,n)=>{let{__scopeSelect:r,...a}=e;return(0,t.jsx)(B.Primitive.div,{"aria-hidden":!0,...a,ref:n})});eK.displayName="SelectSeparator";var eq="SelectArrow",eG=n.forwardRef((e,n)=>{let{__scopeSelect:r,...a}=e,i=en(r),o=ea(eq,r),l=ex(eq,r);return o.open&&"popper"===l.position?(0,t.jsx)(H.Arrow,{...i,...a,ref:n}):null});eG.displayName=eq;var e$=n.forwardRef(({__scopeSelect:e,value:r,...a},i)=>{let o=n.useRef(null),l=(0,E.useComposedRefs)(i,o),s=(0,U.usePrevious)(r);return n.useEffect(()=>{let e=o.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLSelectElement.prototype,"value").set;if(s!==r&&t){let n=new Event("change",{bubbles:!0});t.call(e,r),e.dispatchEvent(n)}},[s,r]),(0,t.jsx)(B.Primitive.select,{...a,style:{...K.VISUALLY_HIDDEN_STYLES,...a.style},ref:l,defaultValue:r})});function eY(e){return""===e||void 0===e}function eZ(e){let t=(0,V.useCallbackRef)(e),r=n.useRef(""),a=n.useRef(0),i=n.useCallback(e=>{let n=r.current+e;t(n),function e(t){r.current=t,window.clearTimeout(a.current),""!==t&&(a.current=window.setTimeout(()=>e(""),1e3))}(n)},[t]),o=n.useCallback(()=>{r.current="",window.clearTimeout(a.current)},[]);return n.useEffect(()=>()=>window.clearTimeout(a.current),[]),[r,i,o]}function eX(e,t,n){var r,a;let i=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,o=n?e.indexOf(n):-1,l=(r=e,a=Math.max(o,0),r.map((e,t)=>r[(a+t)%r.length]));1===i.length&&(l=l.filter(e=>e!==n));let s=l.find(e=>e.textValue.toLowerCase().startsWith(i.toLowerCase()));return s!==n?s:void 0}e$.displayName="SelectBubbleInput",e.s(["Arrow",()=>eG,"Content",()=>ef,"Group",()=>eP,"Icon",()=>ep,"Item",()=>eL,"ItemIndicator",()=>eB,"ItemText",()=>eH,"Label",()=>eR,"Portal",()=>em,"Root",()=>el,"ScrollDownButton",()=>eO,"ScrollUpButton",()=>eV,"Select",()=>el,"SelectArrow",()=>eG,"SelectContent",()=>ef,"SelectGroup",()=>eP,"SelectIcon",()=>ep,"SelectItem",()=>eL,"SelectItemIndicator",()=>eB,"SelectItemText",()=>eH,"SelectLabel",()=>eR,"SelectPortal",()=>em,"SelectScrollDownButton",()=>eO,"SelectScrollUpButton",()=>eV,"SelectSeparator",()=>eK,"SelectTrigger",()=>ed,"SelectValue",()=>eu,"SelectViewport",()=>ek,"Separator",()=>eK,"Trigger",()=>ed,"Value",()=>eu,"Viewport",()=>ek,"createSelectScope",()=>et],83830);var eQ=e.i(83830),eQ=eQ,eJ=e.i(99105);let e0=(0,a.default)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),e1=eQ.Root;eQ.Group;let e2=eQ.Value,e3=n.forwardRef(({className:e,children:n,...r},a)=>(0,t.jsxs)(eQ.Trigger,{ref:a,className:(0,b.cn)("border-input ring-offset-background placeholder:text-muted-foreground focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-sm focus:ring-1 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[n,(0,t.jsx)(eQ.Icon,{asChild:!0,children:(0,t.jsx)(eJ.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));e3.displayName=eQ.Trigger.displayName;let e5=n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(eQ.ScrollUpButton,{ref:r,className:(0,b.cn)("flex cursor-default items-center justify-center py-1",e),...n,children:(0,t.jsx)(e0,{className:"h-4 w-4"})}));e5.displayName=eQ.ScrollUpButton.displayName;let e4=n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(eQ.ScrollDownButton,{ref:r,className:(0,b.cn)("flex cursor-default items-center justify-center py-1",e),...n,children:(0,t.jsx)(eJ.ChevronDown,{className:"h-4 w-4"})}));e4.displayName=eQ.ScrollDownButton.displayName;let e8=n.forwardRef(({className:e,children:n,position:r="popper",...a},i)=>(0,t.jsx)(eQ.Portal,{children:(0,t.jsxs)(eQ.Content,{ref:i,className:(0,b.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md","popper"===r&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...a,children:[(0,t.jsx)(e5,{}),(0,t.jsx)(eQ.Viewport,{className:(0,b.cn)("p-1","popper"===r&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),(0,t.jsx)(e4,{})]})}));e8.displayName=eQ.Content.displayName,n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(eQ.Label,{ref:r,className:(0,b.cn)("px-2 py-1.5 text-sm font-semibold",e),...n})).displayName=eQ.Label.displayName;let e6=n.forwardRef(({className:e,children:n,...r},a)=>(0,t.jsxs)(eQ.Item,{ref:a,className:(0,b.cn)("focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-8 pl-2 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[(0,t.jsx)("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,t.jsx)(eQ.ItemIndicator,{children:(0,t.jsx)(o.Check,{className:"h-4 w-4"})})}),(0,t.jsx)(eQ.ItemText,{children:n})]}));e6.displayName=eQ.Item.displayName,n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(eQ.Separator,{ref:r,className:(0,b.cn)("bg-muted -mx-1 my-1 h-px",e),...n})).displayName=eQ.Separator.displayName;var e7=e.i(21023);let e9=(0,e7.createServerReference)("40eb236a3c47a1649e7dca894afb67f5716f277722",e7.callServer,void 0,e7.findSourceMapURL,"updateSettingsAction");var te=e.i(17406),tt=e.i(98804),tn=e.i(44229),tr=e.i(83902);function ta(e){return(0,t.jsx)(tn.Code,{className:(0,b.cn)("h-4 w-4",e.className),...e})}function ti({className:e}){return(0,t.jsx)(tt.default,{src:"/icons/editors/vscode.svg",alt:"VS Code",width:24,height:24,className:(0,b.cn)("rounded-sm object-contain",e)})}function to({className:e}){return(0,t.jsx)(tt.default,{src:"/icons/agents/cursor.jpeg",alt:"Cursor",width:24,height:24,className:(0,b.cn)("rounded-sm object-contain",e)})}function tl({className:e}){return(0,t.jsx)(tt.default,{src:"/icons/editors/windsurf.svg",alt:"Windsurf",width:24,height:24,className:(0,b.cn)("rounded-sm object-contain",e)})}function ts({className:e}){return(0,t.jsx)(tt.default,{src:"/icons/editors/zed.svg",alt:"Zed",width:24,height:24,className:(0,b.cn)("rounded-sm object-contain",e)})}function td({className:e,...n}){return(0,t.jsx)(tr.Rocket,{className:(0,b.cn)("h-4 w-4",e),...n})}ti.displayName="VsCodeIcon",to.displayName="CursorEditorIcon",tl.displayName="WindsurfIcon",ts.displayName="ZedIcon",td.displayName="AntigravityIcon";let tc={vscode:ti,cursor:to,windsurf:tl,zed:ts,antigravity:td};var tu=e.i(41413),tp=e.i(77624),tm=["PageUp","PageDown"],th=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],tf={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},tg="Slider",[tx,tv,tw]=(0,P.createCollection)(tg),[tb,ty]=(0,R.createContextScope)(tg,[tw]),[tj,tS]=tb(tg),tC=n.forwardRef((e,r)=>{let{name:a,min:i=0,max:o=100,step:l=1,orientation:s="horizontal",disabled:d=!1,minStepsBetweenThumbs:c=0,defaultValue:u=[i],value:p,onValueChange:m=()=>{},onValueCommit:h=()=>{},inverted:f=!1,form:g,...x}=e,v=n.useRef(new Set),w=n.useRef(0),b="horizontal"===s,[y=[],j]=(0,W.useControllableState)({prop:p,defaultProp:u,onChange:e=>{let t=[...v.current];t[w.current]?.focus(),m(e)}}),S=n.useRef(y);function C(e,t,{commit:n}={commit:!1}){let r,a=(String(l).split(".")[1]||"").length,s=Math.round((Math.round((e-i)/l)*l+i)*(r=Math.pow(10,a)))/r,d=(0,M.clamp)(s,[i,o]);j((e=[])=>{let r=function(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}(e,d,t);if(!function(e,t){if(t>0)return Math.min(...e.slice(0,-1).map((t,n)=>e[n+1]-t))>=t;return!0}(r,c*l))return e;{w.current=r.indexOf(d);let t=String(r)!==String(e);return t&&n&&h(r),t?r:e}})}return(0,t.jsx)(tj,{scope:e.__scopeSlider,name:a,disabled:d,min:i,max:o,valueIndexToChangeRef:w,thumbs:v.current,values:y,orientation:s,form:g,children:(0,t.jsx)(tx.Provider,{scope:e.__scopeSlider,children:(0,t.jsx)(tx.Slot,{scope:e.__scopeSlider,children:(0,t.jsx)(b?tM:tN,{"aria-disabled":d,"data-disabled":d?"":void 0,...x,ref:r,onPointerDown:(0,N.composeEventHandlers)(x.onPointerDown,()=>{d||(S.current=y)}),min:i,max:o,inverted:f,onSlideStart:d?void 0:function(e){let t=function(e,t){if(1===e.length)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}(y,e);C(e,t)},onSlideMove:d?void 0:function(e){C(e,w.current)},onSlideEnd:d?void 0:function(){let e=S.current[w.current];y[w.current]!==e&&h(y)},onHomeKeyDown:()=>!d&&C(i,0,{commit:!0}),onEndKeyDown:()=>!d&&C(o,y.length-1,{commit:!0}),onStepKeyDown:({event:e,direction:t})=>{if(!d){let n=tm.includes(e.key)||e.shiftKey&&th.includes(e.key),r=w.current;C(y[r]+l*(n?10:1)*t,r,{commit:!0})}}})})})})});tC.displayName=tg;var[tk,tI]=tb(tg,{startEdge:"left",endEdge:"right",size:"width",direction:1}),tM=n.forwardRef((e,r)=>{let{min:a,max:i,dir:o,inverted:l,onSlideStart:s,onSlideMove:d,onSlideEnd:c,onStepKeyDown:u,...p}=e,[m,h]=n.useState(null),f=(0,E.useComposedRefs)(r,e=>h(e)),g=n.useRef(void 0),x=(0,T.useDirection)(o),v="ltr"===x,w=v&&!l||!v&&l;function b(e){let t=g.current||m.getBoundingClientRect(),n=tB([0,t.width],w?[a,i]:[i,a]);return g.current=t,n(e-t.left)}return(0,t.jsx)(tk,{scope:e.__scopeSlider,startEdge:w?"left":"right",endEdge:w?"right":"left",direction:w?1:-1,size:"width",children:(0,t.jsx)(tP,{dir:x,"data-orientation":"horizontal",...p,ref:f,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:e=>{let t=b(e.clientX);s?.(t)},onSlideMove:e=>{let t=b(e.clientX);d?.(t)},onSlideEnd:()=>{g.current=void 0,c?.()},onStepKeyDown:e=>{let t=tf[w?"from-left":"from-right"].includes(e.key);u?.({event:e,direction:t?-1:1})}})})}),tN=n.forwardRef((e,r)=>{let{min:a,max:i,inverted:o,onSlideStart:l,onSlideMove:s,onSlideEnd:d,onStepKeyDown:c,...u}=e,p=n.useRef(null),m=(0,E.useComposedRefs)(r,p),h=n.useRef(void 0),f=!o;function g(e){let t=h.current||p.current.getBoundingClientRect(),n=tB([0,t.height],f?[i,a]:[a,i]);return h.current=t,n(e-t.top)}return(0,t.jsx)(tk,{scope:e.__scopeSlider,startEdge:f?"bottom":"top",endEdge:f?"top":"bottom",size:"height",direction:f?1:-1,children:(0,t.jsx)(tP,{"data-orientation":"vertical",...u,ref:m,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:e=>{let t=g(e.clientY);l?.(t)},onSlideMove:e=>{let t=g(e.clientY);s?.(t)},onSlideEnd:()=>{h.current=void 0,d?.()},onStepKeyDown:e=>{let t=tf[f?"from-bottom":"from-top"].includes(e.key);c?.({event:e,direction:t?-1:1})}})})}),tP=n.forwardRef((e,n)=>{let{__scopeSlider:r,onSlideStart:a,onSlideMove:i,onSlideEnd:o,onHomeKeyDown:l,onEndKeyDown:s,onStepKeyDown:d,...c}=e,u=tS(tg,r);return(0,t.jsx)(B.Primitive.span,{...c,ref:n,onKeyDown:(0,N.composeEventHandlers)(e.onKeyDown,e=>{"Home"===e.key?(l(e),e.preventDefault()):"End"===e.key?(s(e),e.preventDefault()):tm.concat(th).includes(e.key)&&(d(e),e.preventDefault())}),onPointerDown:(0,N.composeEventHandlers)(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),u.thumbs.has(t)?t.focus():a(e)}),onPointerMove:(0,N.composeEventHandlers)(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&i(e)}),onPointerUp:(0,N.composeEventHandlers)(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),o(e))})})}),tE="SliderTrack",tR=n.forwardRef((e,n)=>{let{__scopeSlider:r,...a}=e,i=tS(tE,r);return(0,t.jsx)(B.Primitive.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...a,ref:n})});tR.displayName=tE;var tT="SliderRange",tA=n.forwardRef((e,r)=>{let{__scopeSlider:a,...i}=e,o=tS(tT,a),l=tI(tT,a),s=n.useRef(null),d=(0,E.useComposedRefs)(r,s),c=o.values.length,u=o.values.map(e=>tz(e,o.min,o.max)),p=c>1?Math.min(...u):0,m=100-Math.max(...u);return(0,t.jsx)(B.Primitive.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,...i,ref:d,style:{...e.style,[l.startEdge]:p+"%",[l.endEdge]:m+"%"}})});tA.displayName=tT;var tD="SliderThumb",tL=n.forwardRef((e,r)=>{let a=tv(e.__scopeSlider),[i,o]=n.useState(null),l=(0,E.useComposedRefs)(r,e=>o(e)),s=n.useMemo(()=>i?a().findIndex(e=>e.ref.current===i):-1,[a,i]);return(0,t.jsx)(tF,{...e,ref:l,index:s})}),tF=n.forwardRef((e,r)=>{var a,i,o,l,s;let d,c,{__scopeSlider:u,index:p,name:m,...h}=e,f=tS(tD,u),g=tI(tD,u),[x,v]=n.useState(null),w=(0,E.useComposedRefs)(r,e=>v(e)),b=!x||f.form||!!x.closest("form"),y=(0,tp.useSize)(x),j=f.values[p],S=void 0===j?0:tz(j,f.min,f.max),C=(a=p,(i=f.values.length)>2?`Value ${a+1} of ${i}`:2===i?["Minimum","Maximum"][a]:void 0),k=y?.[g.size],I=k?(o=k,l=S,s=g.direction,c=tB([0,50],[0,d=o/2]),(d-c(l)*s)*s):0;return n.useEffect(()=>{if(x)return f.thumbs.add(x),()=>{f.thumbs.delete(x)}},[x,f.thumbs]),(0,t.jsxs)("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[g.startEdge]:`calc(${S}% + ${I}px)`},children:[(0,t.jsx)(tx.ItemSlot,{scope:e.__scopeSlider,children:(0,t.jsx)(B.Primitive.span,{role:"slider","aria-label":e["aria-label"]||C,"aria-valuemin":f.min,"aria-valuenow":j,"aria-valuemax":f.max,"aria-orientation":f.orientation,"data-orientation":f.orientation,"data-disabled":f.disabled?"":void 0,tabIndex:f.disabled?void 0:0,...h,ref:w,style:void 0===j?{display:"none"}:e.style,onFocus:(0,N.composeEventHandlers)(e.onFocus,()=>{f.valueIndexToChangeRef.current=p})})}),b&&(0,t.jsx)(tH,{name:m??(f.name?f.name+(f.values.length>1?"[]":""):void 0),form:f.form,value:j},p)]})});tL.displayName=tD;var tH=n.forwardRef(({__scopeSlider:e,value:r,...a},i)=>{let o=n.useRef(null),l=(0,E.useComposedRefs)(o,i),s=(0,U.usePrevious)(r);return n.useEffect(()=>{let e=o.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value").set;if(s!==r&&t){let n=new Event("input",{bubbles:!0});t.call(e,r),e.dispatchEvent(n)}},[s,r]),(0,t.jsx)(B.Primitive.input,{style:{display:"none"},...a,ref:l,defaultValue:r})});function tz(e,t,n){return(0,M.clamp)(100/(n-t)*(e-t),[0,100])}function tB(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}tH.displayName="RadioBubbleInput",e.s(["Range",()=>tA,"Root",()=>tC,"Slider",()=>tC,"SliderRange",()=>tA,"SliderThumb",()=>tL,"SliderTrack",()=>tR,"Thumb",()=>tL,"Track",()=>tR,"createSliderScope",()=>ty],29991);var t_=e.i(29991),t_=t_;function tV({className:e,defaultValue:r,value:a,min:i=0,max:o=100,...l}){let s=n.useMemo(()=>Array.isArray(a)?a:Array.isArray(r)?r:[i,o],[a,r,i,o]);return(0,t.jsxs)(t_.Root,{"data-slot":"slider",defaultValue:r,value:a,min:i,max:o,className:(0,b.cn)("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",e),...l,children:[(0,t.jsx)(t_.Track,{"data-slot":"slider-track",className:(0,b.cn)("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:(0,t.jsx)(t_.Range,{"data-slot":"slider-range",className:(0,b.cn)("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:s.length},(e,n)=>(0,t.jsx)(t_.Thumb,{"data-slot":"slider-thumb",className:"border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},n))]})}let tW=[60,120,300,600,900,1800,2700,3600,7200,10800,14400,21600,28800,43200,86400],tO=tW.length-1;function tU(e){let t=0,n=Math.abs(e-tW[0]);for(let r=1;r<tW.length;r++){let a=Math.abs(e-tW[r]);a<n&&(n=a,t=r)}return t}function tK({id:e,testId:r,value:a,onChange:i,onBlur:o,defaultSeconds:l=1800}){var s;let d,c,u=(""===a?l:parseInt(a,10))||l,[p,m]=(0,n.useState)(()=>tU(u)),h=tU(u);h!==p&&tW[p]!==u&&m(h);let f=(0,n.useCallback)(([e])=>{m(e),i(String(tW[e]))},[i]);return(0,t.jsxs)("div",{className:"flex w-55 items-center gap-2",children:[(0,t.jsx)(tV,{id:e,"data-testid":r,min:0,max:tO,step:1,value:[p],onValueChange:f,onValueCommit:()=>o(),className:"min-w-0 flex-1"}),(0,t.jsx)("span",{className:"text-muted-foreground shrink-0 text-right text-xs tabular-nums",children:(d=Math.floor((s=tW[p])/3600),c=Math.round(s%3600/60),0===d?`${c}m`:0===c?`${d}h`:`${d}h ${c}m`)})]})}let tq=[{value:te.AgentAuthMethod.Session,label:"Session"},{value:te.AgentAuthMethod.Token,label:"Token"}],tG=[{value:te.EditorType.VsCode,label:"VS Code"},{value:te.EditorType.Cursor,label:"Cursor"},{value:te.EditorType.Windsurf,label:"Windsurf"},{value:te.EditorType.Zed,label:"Zed"},{value:te.EditorType.Antigravity,label:"Antigravity"}],t$=[{value:"bash",label:"Bash"},{value:"zsh",label:"Zsh"},{value:"fish",label:"Fish"}],tY=[{id:"agent",label:"Agent",icon:l.Bot},{id:"environment",label:"Environment",icon:s.Terminal},{id:"workflow",label:"Workflow",icon:d.GitBranch},{id:"ci",label:"CI",icon:c},{id:"stage-timeouts",label:"Timeouts",icon:v},{id:"notifications",label:"Notifications",icon:u},{id:"feature-flags",label:"Flags",icon:p},{id:"database",label:"Database",icon:m}];function tZ({label:e,description:n,htmlFor:r,children:a}){return(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4 border-b py-2.5 last:border-b-0",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)(y.Label,{htmlFor:r,className:"cursor-pointer text-sm font-normal whitespace-nowrap",children:e}),n?(0,t.jsx)("p",{className:"text-muted-foreground text-[11px] leading-tight",children:n}):null]}),(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:a})]})}function tX({label:e,description:n,id:r,testId:a,checked:i,onChange:o,disabled:l}){return(0,t.jsx)(tZ,{label:e,description:n,htmlFor:r,children:(0,t.jsx)(C.Switch,{id:r,"data-testid":a,checked:i,onCheckedChange:o,disabled:l,className:(0,b.cn)("cursor-pointer",l&&"cursor-not-allowed opacity-50")})})}function tQ({icon:e,title:n,description:r,badge:a,testId:i,children:o}){return(0,t.jsxs)("div",{className:"bg-background rounded-lg border","data-testid":i,children:[(0,t.jsxs)("div",{className:"bg-muted/30 border-b px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(e,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,t.jsx)("h2",{className:"text-sm font-semibold",children:n}),a?(0,t.jsx)("span",{className:"bg-muted text-muted-foreground rounded px-1.5 py-0.5 text-[9px] font-medium tracking-wider uppercase",children:a}):null]}),(0,t.jsx)("p",{className:"text-muted-foreground mt-0.5 text-[11px]",children:r})]}),(0,t.jsx)("div",{className:"px-4",children:o})]})}function tJ({id:e,testId:n,value:r,onChange:a,onBlur:i,placeholder:o,min:l=1,max:s,step:d=1,suffix:c}){let u=""===r?void 0:parseInt(r,10);return(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)("div",{className:"flex items-center overflow-hidden rounded-md border",children:[(0,t.jsx)("button",{type:"button",onClick:()=>{a(String(Math.max(l,(u??parseInt(o,10))-d)))},onMouseUp:i,className:"text-muted-foreground hover:bg-muted hover:text-foreground flex h-8 w-7 cursor-pointer items-center justify-center border-r transition-colors","aria-label":"Decrease",children:(0,t.jsx)(h.default,{className:"h-3 w-3"})}),(0,t.jsx)("input",{id:e,"data-testid":n,type:"text",inputMode:"numeric",pattern:"[0-9]*",value:r,placeholder:o,onChange:e=>{a(e.target.value.replace(/[^0-9]/g,""))},onBlur:i,className:"h-8 w-14 bg-transparent text-center text-xs outline-none"}),(0,t.jsx)("button",{type:"button",onClick:()=>{let e;e=u??parseInt(o,10),a(String(null!=s?Math.min(s,e+d):e+d))},onMouseUp:i,className:"text-muted-foreground hover:bg-muted hover:text-foreground flex h-8 w-7 cursor-pointer items-center justify-center border-l transition-colors","aria-label":"Increase",children:(0,t.jsx)(f.Plus,{className:"h-3 w-3"})})]}),c?(0,t.jsx)("span",{className:"text-muted-foreground text-[11px]",children:c}):null]})}function t0({children:e}){return(0,t.jsx)("div",{className:"border-b pt-3 pb-1",children:(0,t.jsx)("span",{className:"text-muted-foreground text-[10px] font-semibold tracking-wider uppercase",children:e})})}function t1({children:e,links:n}){return(0,t.jsxs)("div",{className:"hidden pt-2 lg:block",children:[(0,t.jsx)("p",{className:"text-muted-foreground/70 text-[11px] leading-relaxed",children:e}),null!=n&&n.length>0?(0,t.jsx)("div",{className:"mt-2 flex flex-col gap-1",children:n.map(e=>(0,t.jsxs)("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-[10px] transition-colors",children:[(0,t.jsx)(g.ExternalLink,{className:"h-2.5 w-2.5"}),e.label]},e.href))}):null]})}function t2({settings:e,shepHome:a,dbFileSize:h,availableTerminals:f}){let{showSaving:g,showSaved:y,save:C}=function(){let[e,t]=(0,n.useTransition)(),[r,a]=(0,n.useState)(!1),[i,o]=(0,n.useState)(!1),l=(0,n.useRef)(null),s=(0,n.useRef)(!1);return(0,n.useEffect)(()=>{e&&!r&&(a(!0),s.current=!1,l.current=setTimeout(()=>{l.current=null,s.current&&(a(!1),o(!0),setTimeout(()=>o(!1),2e3))},350)),!e&&r&&(s.current=!0,l.current||(a(!1),o(!0),setTimeout(()=>o(!1),2e3)))},[e,r]),{showSaving:r,showSaved:i,save:(0,n.useCallback)(e=>{t(async()=>{let t=await e9(e);t.success||w.toast.error(t.error??"Failed to save settings")})},[t])}}(),I=e.featureFlags??{skills:!1,envDeploy:!1,debug:!1},[M,N]=(0,n.useState)(e.agent.type),P=e.agent.authMethod,[E,R]=(0,n.useState)(e.agent.token??""),[T,A]=(0,n.useState)(!1),[D,L]=(0,n.useState)(e.environment.defaultEditor),[F,H]=(0,n.useState)(e.environment.shellPreference),[z,B]=(0,n.useState)(e.environment.terminalPreference??te.TerminalType.System),_=f?f.filter(e=>e.available):[{id:te.TerminalType.System,name:"System Terminal",available:!0}],[V,W]=(0,n.useState)(e.workflow.openPrOnImplementationComplete),[O,U]=(0,n.useState)(e.workflow.approvalGateDefaults.pushOnImplementationComplete),[K,q]=(0,n.useState)(e.workflow.approvalGateDefaults.allowPrd),[G,$]=(0,n.useState)(e.workflow.approvalGateDefaults.allowPlan),[Y,Z]=(0,n.useState)(e.workflow.approvalGateDefaults.allowMerge),[X,Q]=(0,n.useState)(e.workflow.enableEvidence),[J,ee]=(0,n.useState)(e.workflow.commitEvidence),[et,en]=(0,n.useState)(!1!==e.workflow.ciWatchEnabled),[er,ea]=(0,n.useState)(null!=e.workflow.ciMaxFixAttempts?String(e.workflow.ciMaxFixAttempts):""),[ei,eo]=(0,n.useState)(null!=e.workflow.ciWatchTimeoutMs?String(Math.round(e.workflow.ciWatchTimeoutMs/1e3)):""),[el,es]=(0,n.useState)(null!=e.workflow.ciLogMaxChars?String(e.workflow.ciLogMaxChars):""),[ed,ec]=(0,n.useState)(null!=e.workflow.ciWatchPollIntervalSeconds?String(e.workflow.ciWatchPollIntervalSeconds):""),eu=e.workflow.stageTimeouts,[ep,em]=(0,n.useState)(String(Math.round((eu?.analyzeMs??18e5)/1e3))),[eh,ef]=(0,n.useState)(String(Math.round((eu?.requirementsMs??18e5)/1e3))),[eg,ex]=(0,n.useState)(String(Math.round((eu?.researchMs??18e5)/1e3))),[ev,ew]=(0,n.useState)(String(Math.round((eu?.planMs??18e5)/1e3))),[eb,ey]=(0,n.useState)(String(Math.round((eu?.implementMs??18e5)/1e3))),[ej,eS]=(0,n.useState)(String(Math.round((eu?.mergeMs??18e5)/1e3))),eC=e.workflow.analyzeRepoTimeouts,[ek,eI]=(0,n.useState)(String(Math.round((eC?.analyzeMs??6e5)/1e3))),[eM,eN]=(0,n.useState)(e.notifications.inApp.enabled),[eP,eE]=(0,n.useState)(e.notifications.browser.enabled),[eR,eT]=(0,n.useState)(e.notifications.desktop.enabled),[eA,eD]=(0,n.useState)({...e.notifications.events}),[eL,eF]=(0,n.useState)({...I}),eH=null!=e.workflow.ciMaxFixAttempts?String(e.workflow.ciMaxFixAttempts):"",ez=null!=e.workflow.ciWatchTimeoutMs?String(Math.round(e.workflow.ciWatchTimeoutMs/1e3)):"",eB=null!=e.workflow.ciLogMaxChars?String(e.workflow.ciLogMaxChars):"",e_=null!=e.workflow.ciWatchPollIntervalSeconds?String(e.workflow.ciWatchPollIntervalSeconds):"",eV=eu?.analyzeMs!=null?String(Math.round(eu.analyzeMs/1e3)):"",eW=eu?.requirementsMs!=null?String(Math.round(eu.requirementsMs/1e3)):"",eO=eu?.researchMs!=null?String(Math.round(eu.researchMs/1e3)):"",eU=eu?.planMs!=null?String(Math.round(eu.planMs/1e3)):"",eK=eu?.implementMs!=null?String(Math.round(eu.implementMs/1e3)):"",eq=eu?.mergeMs!=null?String(Math.round(eu.mergeMs/1e3)):"",eG=eC?.analyzeMs!=null?String(Math.round(eC.analyzeMs/1e3)):"";function e$(e){if(""===e)return;let t=parseInt(e,10);return Number.isNaN(t)||t<=0?void 0:t}function eY(e){if(void 0===e)return;let t=e$(e);return null!=t?1e3*t:void 0}function eZ(e={}){let t=e$(e.ciTimeout??ei);return{workflow:{openPrOnImplementationComplete:e.openPr??V,approvalGateDefaults:{pushOnImplementationComplete:e.pushOnComplete??O,allowPrd:e.allowPrd??K,allowPlan:e.allowPlan??G,allowMerge:e.allowMerge??Y},enableEvidence:e.enableEvidence??X,commitEvidence:e.commitEvidence??J,ciWatchEnabled:e.ciWatchEnabled??et,ciMaxFixAttempts:e$(e.ciMaxFix??er),ciWatchTimeoutMs:null!=t?1e3*t:void 0,ciLogMaxChars:e$(e.ciLogMax??el),ciWatchPollIntervalSeconds:e$(e.ciPollInterval??ed),stageTimeouts:{analyzeMs:eY(e.analyzeTimeout??ep),requirementsMs:eY(e.requirementsTimeout??eh),researchMs:eY(e.researchTimeout??eg),planMs:eY(e.planTimeout??ev),implementMs:eY(e.implementTimeout??eb),mergeMs:eY(e.mergeTimeout??ej)},analyzeRepoTimeouts:{analyzeMs:eY(e.analyzeRepoTimeout??ek)}}}}function eX(e={}){return{notifications:{inApp:{enabled:e.inApp??eM},browser:{enabled:e.browser??eP},desktop:{enabled:e.desktop??eR},events:e.events??eA}}}let[eQ,eJ]=(0,n.useState)("agent");(0,n.useEffect)(()=>{let e=tY.map(e=>document.getElementById(`section-${e.id}`)).filter(Boolean);if(0===e.length)return;let t=new IntersectionObserver(e=>{for(let t of e)t.isIntersecting&&eJ(t.target.id.replace("section-",""))},{rootMargin:"-65px 0px -60% 0px",threshold:0});for(let n of e)t.observe(n);return()=>t.disconnect()},[]);let e0=(0,n.useCallback)(e=>{let t=document.getElementById(`section-${e}`);t&&(t.scrollIntoView({behavior:"smooth",block:"start"}),t.style.animation="none",t.offsetHeight,t.style.animation="section-flash 1s ease-out")},[]);return(0,t.jsxs)("div",{"data-testid":"settings-page-client",className:"max-w-5xl",children:[(0,t.jsx)("div",{className:"bg-background/95 supports-backdrop-filter:bg-background/80 sticky top-0 z-10 grid grid-cols-1 gap-x-5 pt-6 pb-4 backdrop-blur lg:grid-cols-[1fr_280px]",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(x,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("h1",{className:"text-sm font-bold tracking-tight",children:"Settings"}),(0,t.jsxs)("span",{className:"relative h-4 w-16",children:[(0,t.jsx)("span",{className:(0,b.cn)("text-muted-foreground absolute inset-0 flex items-center text-xs transition-opacity duration-300",g?"opacity-100":"opacity-0"),children:"Saving..."}),(0,t.jsxs)("span",{className:(0,b.cn)("absolute inset-0 flex items-center gap-1 text-xs text-green-600 transition-opacity duration-300",y&&!g?"opacity-100":"opacity-0"),children:[(0,t.jsx)(o.Check,{className:"h-3 w-3"}),"Saved"]})]}),(0,t.jsx)("nav",{className:"ml-auto flex items-center gap-0.5",children:tY.map(e=>{let n=e.icon,r=eQ===e.id;return(0,t.jsxs)("button",{type:"button",onClick:()=>e0(e.id),className:(0,b.cn)("flex cursor-pointer items-center gap-1 rounded-md px-1.5 py-1 text-[11px] transition-all",r?"bg-accent text-foreground font-medium":"text-muted-foreground/60 hover:text-foreground hover:bg-accent/50"),children:[(0,t.jsx)(n,{className:"h-3 w-3"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:e.label})]},e.id)})})]})}),(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsxs)("div",{id:"section-agent",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tQ,{icon:l.Bot,title:"Agent",description:"AI coding agent and authentication",testId:"agent-settings-section",children:[(0,t.jsx)(tZ,{label:"Agent & Model",description:"Provider and model for all operations",htmlFor:"agent-model-picker",children:(0,t.jsx)(tu.AgentModelPicker,{initialAgentType:M,initialModel:e.models.default,mode:"settings",onAgentModelChange:e=>N(e),className:"w-55"})}),(0,t.jsx)(tZ,{label:"Authentication",description:"How the agent authenticates",htmlFor:"auth-method",children:(0,t.jsx)(k.TooltipProvider,{children:(0,t.jsxs)(k.Tooltip,{children:[(0,t.jsx)(k.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("div",{children:(0,t.jsxs)(e1,{value:P,disabled:!0,children:[(0,t.jsx)(e3,{id:"auth-method","data-testid":"auth-method-select",className:"w-55 cursor-not-allowed text-xs opacity-60",children:(0,t.jsx)(e2,{})}),(0,t.jsx)(e8,{children:tq.map(e=>(0,t.jsx)(e6,{value:e.value,children:e.label},e.value))})]})})}),(0,t.jsx)(k.TooltipContent,{children:"Coming soon"})]})})}),P===te.AgentAuthMethod.Token&&(0,t.jsx)(tZ,{label:"API Token",htmlFor:"agent-token",children:(0,t.jsxs)("div",{className:"relative w-45",children:[(0,t.jsx)(j.Input,{id:"agent-token","data-testid":"agent-token-input",type:T?"text":"password",value:E,onChange:e=>R(e.target.value),onBlur:()=>{E!==(e.agent.token??"")&&C(function(e={}){let t={type:M,authMethod:P,...e},n={type:t.type,authMethod:t.authMethod};return t.authMethod===te.AgentAuthMethod.Token&&(n.token=e.token??E),{agent:n}}({token:E}))},placeholder:"Enter token",className:"pr-8"}),(0,t.jsx)(S.Button,{type:"button",variant:"ghost",size:"sm",className:"absolute top-0 right-0 h-full px-2 hover:bg-transparent",onClick:()=>A(!T),"data-testid":"toggle-token-visibility","aria-label":T?"Hide token":"Show token",children:T?(0,t.jsx)(i,{className:"h-3 w-3"}):(0,t.jsx)(r.Eye,{className:"h-3 w-3"})})]})})]}),(0,t.jsx)(t1,{links:[{label:"Agent system",href:"https://github.com/shep-ai/cli/blob/main/docs/architecture/agent-system.md"},{label:"Adding agents",href:"https://github.com/shep-ai/cli/blob/main/docs/development/adding-agents.md"},{label:"Configuration guide",href:"https://github.com/shep-ai/cli/blob/main/docs/guides/configuration.md"}],children:"Choose which AI coding agent powers your features. Each agent supports different models and capabilities. Authentication is resolved automatically via your active session."})]}),(0,t.jsxs)("div",{id:"section-environment",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tQ,{icon:s.Terminal,title:"Environment",description:"Editor, shell, and terminal preferences",testId:"environment-settings-section",children:[(0,t.jsx)(tZ,{label:"Default Editor",description:"Editor launched for file operations",htmlFor:"default-editor",children:(0,t.jsxs)(e1,{value:D,onValueChange:e=>{L(e),C({environment:{defaultEditor:e,shellPreference:F,terminalPreference:z}})},children:[(0,t.jsx)(e3,{id:"default-editor","data-testid":"editor-select",className:"w-55 cursor-pointer text-xs",children:(0,t.jsx)(e2,{})}),(0,t.jsx)(e8,{children:tG.map(e=>{var n;let r=(n=e.value)&&n in tc?tc[n]:ta;return(0,t.jsx)(e6,{value:e.value,children:(0,t.jsxs)("span",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)(r,{className:"h-4 w-4 shrink-0"}),e.label]})},e.value)})})]})}),(0,t.jsx)(tZ,{label:"Shell",description:"Default shell for generated scripts",htmlFor:"shell-preference",children:(0,t.jsxs)(e1,{value:F,onValueChange:e=>{H(e),C({environment:{defaultEditor:D,shellPreference:e,terminalPreference:z}})},children:[(0,t.jsx)(e3,{id:"shell-preference","data-testid":"shell-select",className:"w-55 cursor-pointer text-xs",children:(0,t.jsx)(e2,{})}),(0,t.jsx)(e8,{children:t$.map(e=>(0,t.jsx)(e6,{value:e.value,children:e.label},e.value))})]})}),(0,t.jsx)(tZ,{label:"Terminal",description:"Terminal emulator for shell sessions",htmlFor:"terminal-preference",children:(0,t.jsxs)(e1,{value:z,onValueChange:e=>{B(e),C({environment:{defaultEditor:D,shellPreference:F,terminalPreference:e}})},children:[(0,t.jsx)(e3,{id:"terminal-preference","data-testid":"terminal-select",className:"w-55 cursor-pointer text-xs",children:(0,t.jsx)(e2,{})}),(0,t.jsx)(e8,{children:_.map(e=>(0,t.jsx)(e6,{value:e.id,children:e.name},e.id))})]})})]}),(0,t.jsx)(t1,{links:[{label:"Configuration guide",href:"https://github.com/shep-ai/cli/blob/main/docs/guides/configuration.md"}],children:"Your preferred editor opens files for review. The shell setting controls generated scripts. The terminal emulator is launched when opening shell sessions from the web UI."})]}),(0,t.jsxs)("div",{id:"section-workflow",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tQ,{icon:d.GitBranch,title:"Workflow",description:"Automation behavior after implementation",testId:"workflow-settings-section",children:[(0,t.jsx)(t0,{children:"Approve"}),(0,t.jsx)(tX,{label:"Auto-approve PRD",description:"Skip manual review of requirements",id:"allow-prd",testId:"switch-allow-prd",checked:K,onChange:e=>{q(e),C(eZ({allowPrd:e}))}}),(0,t.jsx)(tX,{label:"Auto-approve Plan",description:"Skip manual review of implementation plan",id:"allow-plan",testId:"switch-allow-plan",checked:G,onChange:e=>{$(e),C(eZ({allowPlan:e}))}}),(0,t.jsx)(tX,{label:"Auto-approve Merge",description:"Merge without manual review",id:"allow-merge",testId:"switch-allow-merge",checked:Y,onChange:e=>{Z(e),C(eZ({allowMerge:e}))}}),(0,t.jsx)(t0,{children:"Evidence"}),(0,t.jsx)(tX,{label:"Collect evidence",description:"Capture screenshots and artifacts after implementation",id:"enable-evidence",testId:"switch-enable-evidence",checked:X,onChange:e=>{Q(e),e?C(eZ({enableEvidence:e})):(ee(!1),C(eZ({enableEvidence:e,commitEvidence:!1})))}}),(0,t.jsx)(tX,{label:"Add evidence to PR",description:"Include evidence in the pull request body",id:"commit-evidence",testId:"switch-commit-evidence",checked:J,disabled:!X||!V,onChange:e=>{ee(e),C(eZ({commitEvidence:e}))}}),(0,t.jsx)(t0,{children:"Git"}),(0,t.jsx)(tX,{label:"Push on complete",description:"Push to remote when implementation finishes",id:"push-on-complete",testId:"switch-push-on-complete",checked:O,onChange:e=>{U(e),C(eZ({pushOnComplete:e}))}}),(0,t.jsx)(tX,{label:"Open PR on complete",description:"Create a pull request when done",id:"open-pr",testId:"switch-open-pr",checked:V,onChange:e=>{W(e),e?C(eZ({openPr:e})):(ee(!1),C(eZ({openPr:e,commitEvidence:!1})))}}),(0,t.jsx)(tX,{label:"Watch CI after push",description:"Monitor CI and auto-fix failures. Disable to avoid rate limits.",id:"ci-watch-enabled",testId:"switch-ci-watch-enabled",checked:et,onChange:e=>{en(e),C(eZ({ciWatchEnabled:e}))}})]}),(0,t.jsx)(t1,{links:[{label:"Approval gates",href:"https://github.com/shep-ai/cli/blob/main/specs/016-hitl-approval-gates/spec.yaml"},{label:"Push & PR flags",href:"https://github.com/shep-ai/cli/blob/main/specs/037-feature-pr-push-flags/spec.yaml"}],children:"Control how autonomous each feature run is. Auto-approve skips the human review pause at each phase. Push and PR options control what happens after successful implementation."})]}),(0,t.jsxs)("div",{id:"section-ci",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tQ,{icon:c,title:"Continuous Integration",description:"Limits and timeouts for CI monitoring",testId:"ci-settings-section",children:[(0,t.jsx)(tZ,{label:"Max fix attempts",description:"Agent retries on failing CI",htmlFor:"ci-max-fix",children:(0,t.jsx)(tJ,{id:"ci-max-fix",testId:"ci-max-fix-input",placeholder:"3",value:er,onChange:ea,onBlur:()=>{er!==eH&&C(eZ({ciMaxFix:er}))},min:1,max:10})}),(0,t.jsx)(tZ,{label:"Watch timeout",description:"Max wait for CI completion",htmlFor:"ci-timeout",children:(0,t.jsx)(tJ,{id:"ci-timeout",testId:"ci-timeout-input",placeholder:"300",value:ei,onChange:eo,onBlur:()=>{ei!==ez&&C(eZ({ciTimeout:ei}))},min:30,step:30,suffix:"sec"})}),(0,t.jsx)(tZ,{label:"Max log size",description:"Truncate CI logs beyond this limit",htmlFor:"ci-log-max",children:(0,t.jsx)(tJ,{id:"ci-log-max",testId:"ci-log-max-input",placeholder:"50000",value:el,onChange:es,onBlur:()=>{el!==eB&&C(eZ({ciLogMax:el}))},min:1e3,step:5e3,suffix:"chars"})}),(0,t.jsx)(tZ,{label:"Poll interval",description:"How often to check GitHub for CI status updates",htmlFor:"ci-poll-interval",children:(0,t.jsx)(tJ,{id:"ci-poll-interval",testId:"ci-poll-interval-input",placeholder:"30",value:ed,onChange:ec,onBlur:()=>{ed!==e_&&C(eZ({ciPollInterval:ed}))},min:5,step:5,suffix:"sec"})})]}),(0,t.jsx)(t1,{links:[{label:"CI/CD pipeline",href:"https://github.com/shep-ai/cli/blob/main/docs/development/cicd.md"},{label:"CI security gates",href:"https://github.com/shep-ai/cli/blob/main/specs/003-cicd-security-gates/spec.md"}],children:"When a feature completes, the agent can watch CI and auto-fix failures. These limits prevent runaway retries and control how much log output is sent to the agent for analysis."})]}),(0,t.jsxs)("div",{id:"section-stage-timeouts",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tQ,{icon:v,title:"Stage Timeouts",description:"Maximum execution time per agent stage",testId:"stage-timeouts-settings-section",children:[(0,t.jsx)(t0,{children:"Feature Agent"}),(0,t.jsx)(tZ,{label:"Analyze",description:"Repository analysis timeout",htmlFor:"timeout-analyze",children:(0,t.jsx)(tK,{id:"timeout-analyze",testId:"timeout-analyze-input",value:ep,onChange:em,onBlur:()=>{ep!==eV&&C(eZ({analyzeTimeout:ep}))},defaultSeconds:1800})}),(0,t.jsx)(tZ,{label:"Requirements",description:"Requirements gathering timeout",htmlFor:"timeout-requirements",children:(0,t.jsx)(tK,{id:"timeout-requirements",testId:"timeout-requirements-input",value:eh,onChange:ef,onBlur:()=>{eh!==eW&&C(eZ({requirementsTimeout:eh}))},defaultSeconds:1800})}),(0,t.jsx)(tZ,{label:"Research",description:"Technical research timeout",htmlFor:"timeout-research",children:(0,t.jsx)(tK,{id:"timeout-research",testId:"timeout-research-input",value:eg,onChange:ex,onBlur:()=>{eg!==eO&&C(eZ({researchTimeout:eg}))},defaultSeconds:1800})}),(0,t.jsx)(tZ,{label:"Plan",description:"Implementation planning timeout",htmlFor:"timeout-plan",children:(0,t.jsx)(tK,{id:"timeout-plan",testId:"timeout-plan-input",value:ev,onChange:ew,onBlur:()=>{ev!==eU&&C(eZ({planTimeout:ev}))},defaultSeconds:1800})}),(0,t.jsx)(tZ,{label:"Implement",description:"Code implementation timeout",htmlFor:"timeout-implement",children:(0,t.jsx)(tK,{id:"timeout-implement",testId:"timeout-implement-input",value:eb,onChange:ey,onBlur:()=>{eb!==eK&&C(eZ({implementTimeout:eb}))},defaultSeconds:1800})}),(0,t.jsx)(tZ,{label:"Merge",description:"PR creation and merge timeout",htmlFor:"timeout-merge",children:(0,t.jsx)(tK,{id:"timeout-merge",testId:"timeout-merge-input",value:ej,onChange:eS,onBlur:()=>{ej!==eq&&C(eZ({mergeTimeout:ej}))},defaultSeconds:1800})}),(0,t.jsx)(t0,{children:"Analyze Repository Agent"}),(0,t.jsx)(tZ,{label:"Analyze",description:"Repository analysis timeout",htmlFor:"timeout-analyze-repo",children:(0,t.jsx)(tK,{id:"timeout-analyze-repo",testId:"timeout-analyze-repo-input",value:ek,onChange:eI,onBlur:()=>{ek!==eG&&C(eZ({analyzeRepoTimeout:ek}))},defaultSeconds:600})})]}),(0,t.jsx)(t1,{children:"Each agent has independently configurable stage timeouts. When a stage exceeds its timeout, the agent is terminated. Longer timeouts are useful for complex implementations. Feature agent defaults to 30 minutes per stage. Analyze repository agent defaults to 10 minutes."})]}),(0,t.jsxs)("div",{id:"section-notifications",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tQ,{icon:u,title:"Notifications",description:"How and when you get notified",testId:"notification-settings-section",children:[(0,t.jsx)(t0,{children:"Channels"}),(0,t.jsx)(tX,{label:"In-app",description:"Notifications inside the Shep UI",id:"notif-in-app",testId:"switch-in-app",checked:eM,onChange:e=>{eN(e),C(eX({inApp:e}))}}),(0,t.jsx)(tX,{label:"Browser",description:"Push notifications via the browser",id:"notif-browser",testId:"switch-browser",checked:eP,onChange:e=>{eE(e),C(eX({browser:e}))}}),(0,t.jsx)(tX,{label:"Desktop",description:"Native OS notifications",id:"notif-desktop",testId:"switch-desktop",checked:eR,onChange:e=>{eT(e),C(eX({desktop:e}))}}),(0,t.jsx)(t0,{children:"Agent Events"}),(0,t.jsx)(tX,{label:"Agent started",id:"notif-event-agentStarted",testId:"switch-event-agentStarted",checked:eA.agentStarted,onChange:e=>{let t={...eA,agentStarted:e};eD(t),C(eX({events:t}))}}),(0,t.jsx)(tX,{label:"Phase completed",id:"notif-event-phaseCompleted",testId:"switch-event-phaseCompleted",checked:eA.phaseCompleted,onChange:e=>{let t={...eA,phaseCompleted:e};eD(t),C(eX({events:t}))}}),(0,t.jsx)(tX,{label:"Waiting approval",id:"notif-event-waitingApproval",testId:"switch-event-waitingApproval",checked:eA.waitingApproval,onChange:e=>{let t={...eA,waitingApproval:e};eD(t),C(eX({events:t}))}}),(0,t.jsx)(tX,{label:"Agent completed",id:"notif-event-agentCompleted",testId:"switch-event-agentCompleted",checked:eA.agentCompleted,onChange:e=>{let t={...eA,agentCompleted:e};eD(t),C(eX({events:t}))}}),(0,t.jsx)(tX,{label:"Agent failed",id:"notif-event-agentFailed",testId:"switch-event-agentFailed",checked:eA.agentFailed,onChange:e=>{let t={...eA,agentFailed:e};eD(t),C(eX({events:t}))}}),(0,t.jsx)(t0,{children:"Pull Request Events"}),(0,t.jsx)(tX,{label:"PR merged",id:"notif-event-prMerged",testId:"switch-event-prMerged",checked:eA.prMerged,onChange:e=>{let t={...eA,prMerged:e};eD(t),C(eX({events:t}))}}),(0,t.jsx)(tX,{label:"PR closed",id:"notif-event-prClosed",testId:"switch-event-prClosed",checked:eA.prClosed,onChange:e=>{let t={...eA,prClosed:e};eD(t),C(eX({events:t}))}}),(0,t.jsx)(tX,{label:"PR checks passed",id:"notif-event-prChecksPassed",testId:"switch-event-prChecksPassed",checked:eA.prChecksPassed,onChange:e=>{let t={...eA,prChecksPassed:e};eD(t),C(eX({events:t}))}}),(0,t.jsx)(tX,{label:"PR checks failed",id:"notif-event-prChecksFailed",testId:"switch-event-prChecksFailed",checked:eA.prChecksFailed,onChange:e=>{let t={...eA,prChecksFailed:e};eD(t),C(eX({events:t}))}})]}),(0,t.jsx)(t1,{links:[{label:"Notification system",href:"https://github.com/shep-ai/cli/blob/main/specs/021-agent-notifications/spec.yaml"}],children:"Three notification channels keep you in the loop: in-app toasts, browser push notifications, and native desktop alerts. Fine-tune which agent lifecycle events trigger a notification."})]}),(0,t.jsxs)("div",{id:"section-feature-flags",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tQ,{icon:p,title:"Feature Flags",description:"Enable or disable experimental features",badge:"Experimental",testId:"feature-flags-settings-section",children:[(0,t.jsx)(tX,{label:"Skills",description:"Enable the skills system for agent capabilities",id:"flag-skills",testId:"switch-flag-skills",checked:eL.skills,onChange:e=>{let t={...eL,skills:e};eF(t),C({featureFlags:t})}}),(0,t.jsx)(tX,{label:"Deployments",description:"Enable environment deployment workflows",id:"flag-envDeploy",testId:"switch-flag-envDeploy",checked:eL.envDeploy,onChange:e=>{let t={...eL,envDeploy:e};eF(t),C({featureFlags:t})}}),(0,t.jsx)(tX,{label:"Debug",description:"Show debug panels and verbose logging",id:"flag-debug",testId:"switch-flag-debug",checked:eL.debug,onChange:e=>{let t={...eL,debug:e};eF(t),C({featureFlags:t})}})]}),(0,t.jsx)(t1,{children:"Experimental features that are still under development. Enable at your own risk — they may change or be removed in future versions. Debug mode adds verbose logging useful for troubleshooting."})]}),(0,t.jsxs)("div",{id:"section-database",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tQ,{icon:m,title:"Database",description:"Local storage information",testId:"database-settings-section",children:[(0,t.jsx)(tZ,{label:"Location",description:"Path to the local SQLite database",children:(0,t.jsx)("span",{className:"text-muted-foreground max-w-50 truncate font-mono text-xs","data-testid":"shep-home-path",children:a})}),(0,t.jsx)(tZ,{label:"Size",children:(0,t.jsx)("span",{className:"text-muted-foreground text-xs","data-testid":"db-file-size",children:h})})]}),(0,t.jsx)(t1,{links:[{label:"Settings service",href:"https://github.com/shep-ai/cli/blob/main/docs/architecture/settings-service.md"},{label:"Settings spec",href:"https://github.com/shep-ai/cli/blob/main/specs/005-global-settings-service/spec.md"}],children:"All settings are stored in a local SQLite database at ~/.shep/data. The database uses a singleton record pattern with automatic migrations on startup."})]})]})]})}e.s(["SettingsPageClient",()=>t2],41952)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,41952,e=>{"use strict";var t=e.i(20314),n=e.i(79054),r=e.i(87889),a=e.i(3645);let i=(0,a.default)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);var o=e.i(23925),l=e.i(26370),s=e.i(38573),d=e.i(49228);let c=(0,a.default)("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),u=(0,a.default)("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]),p=(0,a.default)("flag",[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]]),m=(0,a.default)("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);var h=e.i(10714),h=h,f=e.i(3214),g=e.i(30702);let x=(0,a.default)("settings-2",[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]),v=(0,a.default)("timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);var w=e.i(60112),b=e.i(31777),y=e.i(41957),j=e.i(98127),S=e.i(35364),C=e.i(51911),k=e.i(2828),I=e.i(26036),M=e.i(27069),N=e.i(91967),P=e.i(87342),E=e.i(5978),R=e.i(22528),T=e.i(66033),A=e.i(53532),D=e.i(41687),L=e.i(56720),F=e.i(13123),H=e.i(52740),z=e.i(39979),B=e.i(87620),_=e.i(86874),V=e.i(29297),W=e.i(36589),O=e.i(5192),U=e.i(23405),K=e.i(1693),q=e.i(73772),G=e.i(13044),$=[" ","Enter","ArrowUp","ArrowDown"],Y=[" ","Enter"],Z="Select",[X,Q,J]=(0,P.createCollection)(Z),[ee,et]=(0,R.createContextScope)(Z,[J,H.createPopperScope]),en=(0,H.createPopperScope)(),[er,ea]=ee(Z),[ei,eo]=ee(Z),el=e=>{let{__scopeSelect:r,children:a,open:i,defaultOpen:o,onOpenChange:l,value:s,defaultValue:d,onValueChange:c,dir:u,name:p,autoComplete:m,disabled:h,required:f,form:g}=e,x=en(r),[v,w]=n.useState(null),[b,y]=n.useState(null),[j,S]=n.useState(!1),C=(0,T.useDirection)(u),[k,I]=(0,W.useControllableState)({prop:i,defaultProp:o??!1,onChange:l,caller:Z}),[M,N]=(0,W.useControllableState)({prop:s,defaultProp:d,onChange:c,caller:Z}),P=n.useRef(null),E=!v||g||!!v.closest("form"),[R,A]=n.useState(new Set),D=Array.from(R).map(e=>e.props.value).join(";");return(0,t.jsx)(H.Root,{...x,children:(0,t.jsxs)(er,{required:f,scope:r,trigger:v,onTriggerChange:w,valueNode:b,onValueNodeChange:y,valueNodeHasChildren:j,onValueNodeHasChildrenChange:S,contentId:(0,F.useId)(),value:M,onValueChange:N,open:k,onOpenChange:I,dir:C,triggerPointerDownPosRef:P,disabled:h,children:[(0,t.jsx)(X.Provider,{scope:r,children:(0,t.jsx)(ei,{scope:e.__scopeSelect,onNativeOptionAdd:n.useCallback(e=>{A(t=>new Set(t).add(e))},[]),onNativeOptionRemove:n.useCallback(e=>{A(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:a})}),E?(0,t.jsxs)(e$,{"aria-hidden":!0,required:f,tabIndex:-1,name:p,autoComplete:m,value:M,onChange:e=>N(e.target.value),disabled:h,form:g,children:[void 0===M?(0,t.jsx)("option",{value:""}):null,Array.from(R)]},D):null]})})};el.displayName=Z;var es="SelectTrigger",ed=n.forwardRef((e,r)=>{let{__scopeSelect:a,disabled:i=!1,...o}=e,l=en(a),s=ea(es,a),d=s.disabled||i,c=(0,E.useComposedRefs)(r,s.onTriggerChange),u=Q(a),p=n.useRef("touch"),[m,h,f]=eZ(e=>{let t=u().filter(e=>!e.disabled),n=t.find(e=>e.value===s.value),r=eX(t,e,n);void 0!==r&&s.onValueChange(r.value)}),g=e=>{d||(s.onOpenChange(!0),f()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,t.jsx)(H.Anchor,{asChild:!0,...l,children:(0,t.jsx)(B.Primitive.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:d,"data-disabled":d?"":void 0,"data-placeholder":eY(s.value)?"":void 0,...o,ref:c,onClick:(0,N.composeEventHandlers)(o.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&g(e)}),onPointerDown:(0,N.composeEventHandlers)(o.onPointerDown,e=>{p.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(g(e),e.preventDefault())}),onKeyDown:(0,N.composeEventHandlers)(o.onKeyDown,e=>{let t=""!==m.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||h(e.key),(!t||" "!==e.key)&&$.includes(e.key)&&(g(),e.preventDefault())})})})});ed.displayName=es;var ec="SelectValue",eu=n.forwardRef((e,n)=>{let{__scopeSelect:r,className:a,style:i,children:o,placeholder:l="",...s}=e,d=ea(ec,r),{onValueNodeHasChildrenChange:c}=d,u=void 0!==o,p=(0,E.useComposedRefs)(n,d.onValueNodeChange);return(0,O.useLayoutEffect)(()=>{c(u)},[c,u]),(0,t.jsx)(B.Primitive.span,{...s,ref:p,style:{pointerEvents:"none"},children:eY(d.value)?(0,t.jsx)(t.Fragment,{children:l}):o})});eu.displayName=ec;var ep=n.forwardRef((e,n)=>{let{__scopeSelect:r,children:a,...i}=e;return(0,t.jsx)(B.Primitive.span,{"aria-hidden":!0,...i,ref:n,children:a||"▼"})});ep.displayName="SelectIcon";var em=e=>(0,t.jsx)(z.Portal,{asChild:!0,...e});em.displayName="SelectPortal";var eh="SelectContent",ef=n.forwardRef((e,r)=>{let a=ea(eh,e.__scopeSelect),[i,o]=n.useState();return((0,O.useLayoutEffect)(()=>{o(new DocumentFragment)},[]),a.open)?(0,t.jsx)(ew,{...e,ref:r}):i?I.createPortal((0,t.jsx)(eg,{scope:e.__scopeSelect,children:(0,t.jsx)(X.Slot,{scope:e.__scopeSelect,children:(0,t.jsx)("div",{children:e.children})})}),i):null});ef.displayName=eh;var[eg,ex]=ee(eh),ev=(0,_.createSlot)("SelectContent.RemoveScroll"),ew=n.forwardRef((e,r)=>{let{__scopeSelect:a,position:i="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:l,onPointerDownOutside:s,side:d,sideOffset:c,align:u,alignOffset:p,arrowPadding:m,collisionBoundary:h,collisionPadding:f,sticky:g,hideWhenDetached:x,avoidCollisions:v,...w}=e,b=ea(eh,a),[y,j]=n.useState(null),[S,C]=n.useState(null),k=(0,E.useComposedRefs)(r,e=>j(e)),[I,M]=n.useState(null),[P,R]=n.useState(null),T=Q(a),[F,H]=n.useState(!1),z=n.useRef(!1);n.useEffect(()=>{if(y)return(0,q.hideOthers)(y)},[y]),(0,D.useFocusGuards)();let B=n.useCallback(e=>{let[t,...n]=T().map(e=>e.ref.current),[r]=n.slice(-1),a=document.activeElement;for(let n of e)if(n===a||(n?.scrollIntoView({block:"nearest"}),n===t&&S&&(S.scrollTop=0),n===r&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==a))return},[T,S]),_=n.useCallback(()=>B([I,y]),[B,I,y]);n.useEffect(()=>{F&&_()},[F,_]);let{onOpenChange:V,triggerPointerDownPosRef:W}=b;n.useEffect(()=>{if(y){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(W.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(W.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():y.contains(n.target)||V(!1),document.removeEventListener("pointermove",t),W.current=null};return null!==W.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[y,V,W]),n.useEffect(()=>{let e=()=>V(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[V]);let[O,U]=eZ(e=>{let t=T().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),r=eX(t,e,n);r&&setTimeout(()=>r.ref.current.focus())}),K=n.useCallback((e,t,n)=>{let r=!z.current&&!n;(void 0!==b.value&&b.value===t||r)&&(M(e),r&&(z.current=!0))},[b.value]),$=n.useCallback(()=>y?.focus(),[y]),Y=n.useCallback((e,t,n)=>{let r=!z.current&&!n;(void 0!==b.value&&b.value===t||r)&&R(e)},[b.value]),Z="popper"===i?ey:eb,X=Z===ey?{side:d,sideOffset:c,align:u,alignOffset:p,arrowPadding:m,collisionBoundary:h,collisionPadding:f,sticky:g,hideWhenDetached:x,avoidCollisions:v}:{};return(0,t.jsx)(eg,{scope:a,content:y,viewport:S,onViewportChange:C,itemRefCallback:K,selectedItem:I,onItemLeave:$,itemTextRefCallback:Y,focusSelectedItem:_,selectedItemText:P,position:i,isPositioned:F,searchRef:O,children:(0,t.jsx)(G.RemoveScroll,{as:ev,allowPinchZoom:!0,children:(0,t.jsx)(L.FocusScope,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:(0,N.composeEventHandlers)(o,e=>{b.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,t.jsx)(A.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:(0,t.jsx)(Z,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:e=>e.preventDefault(),...w,...X,onPlaced:()=>H(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:(0,N.composeEventHandlers)(w.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||U(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=T().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>B(t)),e.preventDefault()}})})})})})})});ew.displayName="SelectContentImpl";var eb=n.forwardRef((e,r)=>{let{__scopeSelect:a,onPlaced:i,...o}=e,l=ea(eh,a),s=ex(eh,a),[d,c]=n.useState(null),[u,p]=n.useState(null),m=(0,E.useComposedRefs)(r,e=>p(e)),h=Q(a),f=n.useRef(!1),g=n.useRef(!0),{viewport:x,selectedItem:v,selectedItemText:w,focusSelectedItem:b}=s,y=n.useCallback(()=>{if(l.trigger&&l.valueNode&&d&&u&&x&&v&&w){let e=l.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=l.valueNode.getBoundingClientRect(),r=w.getBoundingClientRect();if("rtl"!==l.dir){let a=r.left-t.left,i=n.left-a,o=e.left-i,l=e.width+o,s=Math.max(l,t.width),c=window.innerWidth-10,u=(0,M.clamp)(i,[10,Math.max(10,c-s)]);d.style.minWidth=l+"px",d.style.left=u+"px"}else{let a=t.right-r.right,i=window.innerWidth-n.right-a,o=window.innerWidth-e.right-i,l=e.width+o,s=Math.max(l,t.width),c=window.innerWidth-10,u=(0,M.clamp)(i,[10,Math.max(10,c-s)]);d.style.minWidth=l+"px",d.style.right=u+"px"}let a=h(),o=window.innerHeight-20,s=x.scrollHeight,c=window.getComputedStyle(u),p=parseInt(c.borderTopWidth,10),m=parseInt(c.paddingTop,10),g=parseInt(c.borderBottomWidth,10),b=p+m+s+parseInt(c.paddingBottom,10)+g,y=Math.min(5*v.offsetHeight,b),j=window.getComputedStyle(x),S=parseInt(j.paddingTop,10),C=parseInt(j.paddingBottom,10),k=e.top+e.height/2-10,I=v.offsetHeight/2,N=p+m+(v.offsetTop+I);if(N<=k){let e=a.length>0&&v===a[a.length-1].ref.current;d.style.bottom="0px";let t=Math.max(o-k,I+(e?C:0)+(u.clientHeight-x.offsetTop-x.offsetHeight)+g);d.style.height=N+t+"px"}else{let e=a.length>0&&v===a[0].ref.current;d.style.top="0px";let t=Math.max(k,p+x.offsetTop+(e?S:0)+I);d.style.height=t+(b-N)+"px",x.scrollTop=N-k+x.offsetTop}d.style.margin="10px 0",d.style.minHeight=y+"px",d.style.maxHeight=o+"px",i?.(),requestAnimationFrame(()=>f.current=!0)}},[h,l.trigger,l.valueNode,d,u,x,v,w,l.dir,i]);(0,O.useLayoutEffect)(()=>y(),[y]);let[j,S]=n.useState();(0,O.useLayoutEffect)(()=>{u&&S(window.getComputedStyle(u).zIndex)},[u]);let C=n.useCallback(e=>{e&&!0===g.current&&(y(),b?.(),g.current=!1)},[y,b]);return(0,t.jsx)(ej,{scope:a,contentWrapper:d,shouldExpandOnScrollRef:f,onScrollButtonChange:C,children:(0,t.jsx)("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:(0,t.jsx)(B.Primitive.div,{...o,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});eb.displayName="SelectItemAlignedPosition";var ey=n.forwardRef((e,n)=>{let{__scopeSelect:r,align:a="start",collisionPadding:i=10,...o}=e,l=en(r);return(0,t.jsx)(H.Content,{...l,...o,ref:n,align:a,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ey.displayName="SelectPopperPosition";var[ej,eS]=ee(eh,{}),eC="SelectViewport",ek=n.forwardRef((e,r)=>{let{__scopeSelect:a,nonce:i,...o}=e,l=ex(eC,a),s=eS(eC,a),d=(0,E.useComposedRefs)(r,l.onViewportChange),c=n.useRef(0);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),(0,t.jsx)(X.Slot,{scope:a,children:(0,t.jsx)(B.Primitive.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:(0,N.composeEventHandlers)(o.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=s;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-20,a=Math.max(parseFloat(n.style.minHeight),parseFloat(n.style.height));if(a<r){let i=a+e,o=Math.min(r,i),l=i-o;n.style.height=o+"px","0px"===n.style.bottom&&(t.scrollTop=l>0?l:0,n.style.justifyContent="flex-end")}}}c.current=t.scrollTop})})})]})});ek.displayName=eC;var eI="SelectGroup",[eM,eN]=ee(eI),eP=n.forwardRef((e,n)=>{let{__scopeSelect:r,...a}=e,i=(0,F.useId)();return(0,t.jsx)(eM,{scope:r,id:i,children:(0,t.jsx)(B.Primitive.div,{role:"group","aria-labelledby":i,...a,ref:n})})});eP.displayName=eI;var eE="SelectLabel",eR=n.forwardRef((e,n)=>{let{__scopeSelect:r,...a}=e,i=eN(eE,r);return(0,t.jsx)(B.Primitive.div,{id:i.id,...a,ref:n})});eR.displayName=eE;var eT="SelectItem",[eA,eD]=ee(eT),eL=n.forwardRef((e,r)=>{let{__scopeSelect:a,value:i,disabled:o=!1,textValue:l,...s}=e,d=ea(eT,a),c=ex(eT,a),u=d.value===i,[p,m]=n.useState(l??""),[h,f]=n.useState(!1),g=(0,E.useComposedRefs)(r,e=>c.itemRefCallback?.(e,i,o)),x=(0,F.useId)(),v=n.useRef("touch"),w=()=>{o||(d.onValueChange(i),d.onOpenChange(!1))};if(""===i)throw Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return(0,t.jsx)(eA,{scope:a,value:i,disabled:o,textId:x,isSelected:u,onItemTextChange:n.useCallback(e=>{m(t=>t||(e?.textContent??"").trim())},[]),children:(0,t.jsx)(X.ItemSlot,{scope:a,value:i,disabled:o,textValue:p,children:(0,t.jsx)(B.Primitive.div,{role:"option","aria-labelledby":x,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:g,onFocus:(0,N.composeEventHandlers)(s.onFocus,()=>f(!0)),onBlur:(0,N.composeEventHandlers)(s.onBlur,()=>f(!1)),onClick:(0,N.composeEventHandlers)(s.onClick,()=>{"mouse"!==v.current&&w()}),onPointerUp:(0,N.composeEventHandlers)(s.onPointerUp,()=>{"mouse"===v.current&&w()}),onPointerDown:(0,N.composeEventHandlers)(s.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:(0,N.composeEventHandlers)(s.onPointerMove,e=>{v.current=e.pointerType,o?c.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:(0,N.composeEventHandlers)(s.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:(0,N.composeEventHandlers)(s.onKeyDown,e=>{(c.searchRef?.current===""||" "!==e.key)&&(Y.includes(e.key)&&w()," "===e.key&&e.preventDefault())})})})})});eL.displayName=eT;var eF="SelectItemText",eH=n.forwardRef((e,r)=>{let{__scopeSelect:a,className:i,style:o,...l}=e,s=ea(eF,a),d=ex(eF,a),c=eD(eF,a),u=eo(eF,a),[p,m]=n.useState(null),h=(0,E.useComposedRefs)(r,e=>m(e),c.onItemTextChange,e=>d.itemTextRefCallback?.(e,c.value,c.disabled)),f=p?.textContent,g=n.useMemo(()=>(0,t.jsx)("option",{value:c.value,disabled:c.disabled,children:f},c.value),[c.disabled,c.value,f]),{onNativeOptionAdd:x,onNativeOptionRemove:v}=u;return(0,O.useLayoutEffect)(()=>(x(g),()=>v(g)),[x,v,g]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(B.Primitive.span,{id:c.textId,...l,ref:h}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?I.createPortal(l.children,s.valueNode):null]})});eH.displayName=eF;var ez="SelectItemIndicator",eB=n.forwardRef((e,n)=>{let{__scopeSelect:r,...a}=e;return eD(ez,r).isSelected?(0,t.jsx)(B.Primitive.span,{"aria-hidden":!0,...a,ref:n}):null});eB.displayName=ez;var e_="SelectScrollUpButton",eV=n.forwardRef((e,r)=>{let a=ex(e_,e.__scopeSelect),i=eS(e_,e.__scopeSelect),[o,l]=n.useState(!1),s=(0,E.useComposedRefs)(r,i.onScrollButtonChange);return(0,O.useLayoutEffect)(()=>{if(a.viewport&&a.isPositioned){let e=function(){l(t.scrollTop>0)},t=a.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[a.viewport,a.isPositioned]),o?(0,t.jsx)(eU,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=a;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});eV.displayName=e_;var eW="SelectScrollDownButton",eO=n.forwardRef((e,r)=>{let a=ex(eW,e.__scopeSelect),i=eS(eW,e.__scopeSelect),[o,l]=n.useState(!1),s=(0,E.useComposedRefs)(r,i.onScrollButtonChange);return(0,O.useLayoutEffect)(()=>{if(a.viewport&&a.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;l(Math.ceil(t.scrollTop)<e)},t=a.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[a.viewport,a.isPositioned]),o?(0,t.jsx)(eU,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=a;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});eO.displayName=eW;var eU=n.forwardRef((e,r)=>{let{__scopeSelect:a,onAutoScroll:i,...o}=e,l=ex("SelectScrollButton",a),s=n.useRef(null),d=Q(a),c=n.useCallback(()=>{null!==s.current&&(window.clearInterval(s.current),s.current=null)},[]);return n.useEffect(()=>()=>c(),[c]),(0,O.useLayoutEffect)(()=>{let e=d().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[d]),(0,t.jsx)(B.Primitive.div,{"aria-hidden":!0,...o,ref:r,style:{flexShrink:0,...o.style},onPointerDown:(0,N.composeEventHandlers)(o.onPointerDown,()=>{null===s.current&&(s.current=window.setInterval(i,50))}),onPointerMove:(0,N.composeEventHandlers)(o.onPointerMove,()=>{l.onItemLeave?.(),null===s.current&&(s.current=window.setInterval(i,50))}),onPointerLeave:(0,N.composeEventHandlers)(o.onPointerLeave,()=>{c()})})}),eK=n.forwardRef((e,n)=>{let{__scopeSelect:r,...a}=e;return(0,t.jsx)(B.Primitive.div,{"aria-hidden":!0,...a,ref:n})});eK.displayName="SelectSeparator";var eq="SelectArrow",eG=n.forwardRef((e,n)=>{let{__scopeSelect:r,...a}=e,i=en(r),o=ea(eq,r),l=ex(eq,r);return o.open&&"popper"===l.position?(0,t.jsx)(H.Arrow,{...i,...a,ref:n}):null});eG.displayName=eq;var e$=n.forwardRef(({__scopeSelect:e,value:r,...a},i)=>{let o=n.useRef(null),l=(0,E.useComposedRefs)(i,o),s=(0,U.usePrevious)(r);return n.useEffect(()=>{let e=o.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLSelectElement.prototype,"value").set;if(s!==r&&t){let n=new Event("change",{bubbles:!0});t.call(e,r),e.dispatchEvent(n)}},[s,r]),(0,t.jsx)(B.Primitive.select,{...a,style:{...K.VISUALLY_HIDDEN_STYLES,...a.style},ref:l,defaultValue:r})});function eY(e){return""===e||void 0===e}function eZ(e){let t=(0,V.useCallbackRef)(e),r=n.useRef(""),a=n.useRef(0),i=n.useCallback(e=>{let n=r.current+e;t(n),function e(t){r.current=t,window.clearTimeout(a.current),""!==t&&(a.current=window.setTimeout(()=>e(""),1e3))}(n)},[t]),o=n.useCallback(()=>{r.current="",window.clearTimeout(a.current)},[]);return n.useEffect(()=>()=>window.clearTimeout(a.current),[]),[r,i,o]}function eX(e,t,n){var r,a;let i=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,o=n?e.indexOf(n):-1,l=(r=e,a=Math.max(o,0),r.map((e,t)=>r[(a+t)%r.length]));1===i.length&&(l=l.filter(e=>e!==n));let s=l.find(e=>e.textValue.toLowerCase().startsWith(i.toLowerCase()));return s!==n?s:void 0}e$.displayName="SelectBubbleInput",e.s(["Arrow",()=>eG,"Content",()=>ef,"Group",()=>eP,"Icon",()=>ep,"Item",()=>eL,"ItemIndicator",()=>eB,"ItemText",()=>eH,"Label",()=>eR,"Portal",()=>em,"Root",()=>el,"ScrollDownButton",()=>eO,"ScrollUpButton",()=>eV,"Select",()=>el,"SelectArrow",()=>eG,"SelectContent",()=>ef,"SelectGroup",()=>eP,"SelectIcon",()=>ep,"SelectItem",()=>eL,"SelectItemIndicator",()=>eB,"SelectItemText",()=>eH,"SelectLabel",()=>eR,"SelectPortal",()=>em,"SelectScrollDownButton",()=>eO,"SelectScrollUpButton",()=>eV,"SelectSeparator",()=>eK,"SelectTrigger",()=>ed,"SelectValue",()=>eu,"SelectViewport",()=>ek,"Separator",()=>eK,"Trigger",()=>ed,"Value",()=>eu,"Viewport",()=>ek,"createSelectScope",()=>et],83830);var eQ=e.i(83830),eQ=eQ,eJ=e.i(99105);let e0=(0,a.default)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),e1=eQ.Root;eQ.Group;let e2=eQ.Value,e3=n.forwardRef(({className:e,children:n,...r},a)=>(0,t.jsxs)(eQ.Trigger,{ref:a,className:(0,b.cn)("border-input ring-offset-background placeholder:text-muted-foreground focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-sm focus:ring-1 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[n,(0,t.jsx)(eQ.Icon,{asChild:!0,children:(0,t.jsx)(eJ.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));e3.displayName=eQ.Trigger.displayName;let e5=n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(eQ.ScrollUpButton,{ref:r,className:(0,b.cn)("flex cursor-default items-center justify-center py-1",e),...n,children:(0,t.jsx)(e0,{className:"h-4 w-4"})}));e5.displayName=eQ.ScrollUpButton.displayName;let e4=n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(eQ.ScrollDownButton,{ref:r,className:(0,b.cn)("flex cursor-default items-center justify-center py-1",e),...n,children:(0,t.jsx)(eJ.ChevronDown,{className:"h-4 w-4"})}));e4.displayName=eQ.ScrollDownButton.displayName;let e8=n.forwardRef(({className:e,children:n,position:r="popper",...a},i)=>(0,t.jsx)(eQ.Portal,{children:(0,t.jsxs)(eQ.Content,{ref:i,className:(0,b.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md","popper"===r&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...a,children:[(0,t.jsx)(e5,{}),(0,t.jsx)(eQ.Viewport,{className:(0,b.cn)("p-1","popper"===r&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),(0,t.jsx)(e4,{})]})}));e8.displayName=eQ.Content.displayName,n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(eQ.Label,{ref:r,className:(0,b.cn)("px-2 py-1.5 text-sm font-semibold",e),...n})).displayName=eQ.Label.displayName;let e6=n.forwardRef(({className:e,children:n,...r},a)=>(0,t.jsxs)(eQ.Item,{ref:a,className:(0,b.cn)("focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-8 pl-2 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[(0,t.jsx)("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,t.jsx)(eQ.ItemIndicator,{children:(0,t.jsx)(o.Check,{className:"h-4 w-4"})})}),(0,t.jsx)(eQ.ItemText,{children:n})]}));e6.displayName=eQ.Item.displayName,n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(eQ.Separator,{ref:r,className:(0,b.cn)("bg-muted -mx-1 my-1 h-px",e),...n})).displayName=eQ.Separator.displayName;var e7=e.i(21023);let e9=(0,e7.createServerReference)("40931e04ed38332cd1d5a727e3ff3b822d83f7736c",e7.callServer,void 0,e7.findSourceMapURL,"updateSettingsAction");var te=e.i(17406),tt=e.i(98804),tn=e.i(44229),tr=e.i(83902);function ta(e){return(0,t.jsx)(tn.Code,{className:(0,b.cn)("h-4 w-4",e.className),...e})}function ti({className:e}){return(0,t.jsx)(tt.default,{src:"/icons/editors/vscode.svg",alt:"VS Code",width:24,height:24,className:(0,b.cn)("rounded-sm object-contain",e)})}function to({className:e}){return(0,t.jsx)(tt.default,{src:"/icons/agents/cursor.jpeg",alt:"Cursor",width:24,height:24,className:(0,b.cn)("rounded-sm object-contain",e)})}function tl({className:e}){return(0,t.jsx)(tt.default,{src:"/icons/editors/windsurf.svg",alt:"Windsurf",width:24,height:24,className:(0,b.cn)("rounded-sm object-contain",e)})}function ts({className:e}){return(0,t.jsx)(tt.default,{src:"/icons/editors/zed.svg",alt:"Zed",width:24,height:24,className:(0,b.cn)("rounded-sm object-contain",e)})}function td({className:e,...n}){return(0,t.jsx)(tr.Rocket,{className:(0,b.cn)("h-4 w-4",e),...n})}ti.displayName="VsCodeIcon",to.displayName="CursorEditorIcon",tl.displayName="WindsurfIcon",ts.displayName="ZedIcon",td.displayName="AntigravityIcon";let tc={vscode:ti,cursor:to,windsurf:tl,zed:ts,antigravity:td};var tu=e.i(41413),tp=e.i(77624),tm=["PageUp","PageDown"],th=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],tf={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},tg="Slider",[tx,tv,tw]=(0,P.createCollection)(tg),[tb,ty]=(0,R.createContextScope)(tg,[tw]),[tj,tS]=tb(tg),tC=n.forwardRef((e,r)=>{let{name:a,min:i=0,max:o=100,step:l=1,orientation:s="horizontal",disabled:d=!1,minStepsBetweenThumbs:c=0,defaultValue:u=[i],value:p,onValueChange:m=()=>{},onValueCommit:h=()=>{},inverted:f=!1,form:g,...x}=e,v=n.useRef(new Set),w=n.useRef(0),b="horizontal"===s,[y=[],j]=(0,W.useControllableState)({prop:p,defaultProp:u,onChange:e=>{let t=[...v.current];t[w.current]?.focus(),m(e)}}),S=n.useRef(y);function C(e,t,{commit:n}={commit:!1}){let r,a=(String(l).split(".")[1]||"").length,s=Math.round((Math.round((e-i)/l)*l+i)*(r=Math.pow(10,a)))/r,d=(0,M.clamp)(s,[i,o]);j((e=[])=>{let r=function(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}(e,d,t);if(!function(e,t){if(t>0)return Math.min(...e.slice(0,-1).map((t,n)=>e[n+1]-t))>=t;return!0}(r,c*l))return e;{w.current=r.indexOf(d);let t=String(r)!==String(e);return t&&n&&h(r),t?r:e}})}return(0,t.jsx)(tj,{scope:e.__scopeSlider,name:a,disabled:d,min:i,max:o,valueIndexToChangeRef:w,thumbs:v.current,values:y,orientation:s,form:g,children:(0,t.jsx)(tx.Provider,{scope:e.__scopeSlider,children:(0,t.jsx)(tx.Slot,{scope:e.__scopeSlider,children:(0,t.jsx)(b?tM:tN,{"aria-disabled":d,"data-disabled":d?"":void 0,...x,ref:r,onPointerDown:(0,N.composeEventHandlers)(x.onPointerDown,()=>{d||(S.current=y)}),min:i,max:o,inverted:f,onSlideStart:d?void 0:function(e){let t=function(e,t){if(1===e.length)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}(y,e);C(e,t)},onSlideMove:d?void 0:function(e){C(e,w.current)},onSlideEnd:d?void 0:function(){let e=S.current[w.current];y[w.current]!==e&&h(y)},onHomeKeyDown:()=>!d&&C(i,0,{commit:!0}),onEndKeyDown:()=>!d&&C(o,y.length-1,{commit:!0}),onStepKeyDown:({event:e,direction:t})=>{if(!d){let n=tm.includes(e.key)||e.shiftKey&&th.includes(e.key),r=w.current;C(y[r]+l*(n?10:1)*t,r,{commit:!0})}}})})})})});tC.displayName=tg;var[tk,tI]=tb(tg,{startEdge:"left",endEdge:"right",size:"width",direction:1}),tM=n.forwardRef((e,r)=>{let{min:a,max:i,dir:o,inverted:l,onSlideStart:s,onSlideMove:d,onSlideEnd:c,onStepKeyDown:u,...p}=e,[m,h]=n.useState(null),f=(0,E.useComposedRefs)(r,e=>h(e)),g=n.useRef(void 0),x=(0,T.useDirection)(o),v="ltr"===x,w=v&&!l||!v&&l;function b(e){let t=g.current||m.getBoundingClientRect(),n=tB([0,t.width],w?[a,i]:[i,a]);return g.current=t,n(e-t.left)}return(0,t.jsx)(tk,{scope:e.__scopeSlider,startEdge:w?"left":"right",endEdge:w?"right":"left",direction:w?1:-1,size:"width",children:(0,t.jsx)(tP,{dir:x,"data-orientation":"horizontal",...p,ref:f,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:e=>{let t=b(e.clientX);s?.(t)},onSlideMove:e=>{let t=b(e.clientX);d?.(t)},onSlideEnd:()=>{g.current=void 0,c?.()},onStepKeyDown:e=>{let t=tf[w?"from-left":"from-right"].includes(e.key);u?.({event:e,direction:t?-1:1})}})})}),tN=n.forwardRef((e,r)=>{let{min:a,max:i,inverted:o,onSlideStart:l,onSlideMove:s,onSlideEnd:d,onStepKeyDown:c,...u}=e,p=n.useRef(null),m=(0,E.useComposedRefs)(r,p),h=n.useRef(void 0),f=!o;function g(e){let t=h.current||p.current.getBoundingClientRect(),n=tB([0,t.height],f?[i,a]:[a,i]);return h.current=t,n(e-t.top)}return(0,t.jsx)(tk,{scope:e.__scopeSlider,startEdge:f?"bottom":"top",endEdge:f?"top":"bottom",size:"height",direction:f?1:-1,children:(0,t.jsx)(tP,{"data-orientation":"vertical",...u,ref:m,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:e=>{let t=g(e.clientY);l?.(t)},onSlideMove:e=>{let t=g(e.clientY);s?.(t)},onSlideEnd:()=>{h.current=void 0,d?.()},onStepKeyDown:e=>{let t=tf[f?"from-bottom":"from-top"].includes(e.key);c?.({event:e,direction:t?-1:1})}})})}),tP=n.forwardRef((e,n)=>{let{__scopeSlider:r,onSlideStart:a,onSlideMove:i,onSlideEnd:o,onHomeKeyDown:l,onEndKeyDown:s,onStepKeyDown:d,...c}=e,u=tS(tg,r);return(0,t.jsx)(B.Primitive.span,{...c,ref:n,onKeyDown:(0,N.composeEventHandlers)(e.onKeyDown,e=>{"Home"===e.key?(l(e),e.preventDefault()):"End"===e.key?(s(e),e.preventDefault()):tm.concat(th).includes(e.key)&&(d(e),e.preventDefault())}),onPointerDown:(0,N.composeEventHandlers)(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),u.thumbs.has(t)?t.focus():a(e)}),onPointerMove:(0,N.composeEventHandlers)(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&i(e)}),onPointerUp:(0,N.composeEventHandlers)(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),o(e))})})}),tE="SliderTrack",tR=n.forwardRef((e,n)=>{let{__scopeSlider:r,...a}=e,i=tS(tE,r);return(0,t.jsx)(B.Primitive.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...a,ref:n})});tR.displayName=tE;var tT="SliderRange",tA=n.forwardRef((e,r)=>{let{__scopeSlider:a,...i}=e,o=tS(tT,a),l=tI(tT,a),s=n.useRef(null),d=(0,E.useComposedRefs)(r,s),c=o.values.length,u=o.values.map(e=>tz(e,o.min,o.max)),p=c>1?Math.min(...u):0,m=100-Math.max(...u);return(0,t.jsx)(B.Primitive.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,...i,ref:d,style:{...e.style,[l.startEdge]:p+"%",[l.endEdge]:m+"%"}})});tA.displayName=tT;var tD="SliderThumb",tL=n.forwardRef((e,r)=>{let a=tv(e.__scopeSlider),[i,o]=n.useState(null),l=(0,E.useComposedRefs)(r,e=>o(e)),s=n.useMemo(()=>i?a().findIndex(e=>e.ref.current===i):-1,[a,i]);return(0,t.jsx)(tF,{...e,ref:l,index:s})}),tF=n.forwardRef((e,r)=>{var a,i,o,l,s;let d,c,{__scopeSlider:u,index:p,name:m,...h}=e,f=tS(tD,u),g=tI(tD,u),[x,v]=n.useState(null),w=(0,E.useComposedRefs)(r,e=>v(e)),b=!x||f.form||!!x.closest("form"),y=(0,tp.useSize)(x),j=f.values[p],S=void 0===j?0:tz(j,f.min,f.max),C=(a=p,(i=f.values.length)>2?`Value ${a+1} of ${i}`:2===i?["Minimum","Maximum"][a]:void 0),k=y?.[g.size],I=k?(o=k,l=S,s=g.direction,c=tB([0,50],[0,d=o/2]),(d-c(l)*s)*s):0;return n.useEffect(()=>{if(x)return f.thumbs.add(x),()=>{f.thumbs.delete(x)}},[x,f.thumbs]),(0,t.jsxs)("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[g.startEdge]:`calc(${S}% + ${I}px)`},children:[(0,t.jsx)(tx.ItemSlot,{scope:e.__scopeSlider,children:(0,t.jsx)(B.Primitive.span,{role:"slider","aria-label":e["aria-label"]||C,"aria-valuemin":f.min,"aria-valuenow":j,"aria-valuemax":f.max,"aria-orientation":f.orientation,"data-orientation":f.orientation,"data-disabled":f.disabled?"":void 0,tabIndex:f.disabled?void 0:0,...h,ref:w,style:void 0===j?{display:"none"}:e.style,onFocus:(0,N.composeEventHandlers)(e.onFocus,()=>{f.valueIndexToChangeRef.current=p})})}),b&&(0,t.jsx)(tH,{name:m??(f.name?f.name+(f.values.length>1?"[]":""):void 0),form:f.form,value:j},p)]})});tL.displayName=tD;var tH=n.forwardRef(({__scopeSlider:e,value:r,...a},i)=>{let o=n.useRef(null),l=(0,E.useComposedRefs)(o,i),s=(0,U.usePrevious)(r);return n.useEffect(()=>{let e=o.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value").set;if(s!==r&&t){let n=new Event("input",{bubbles:!0});t.call(e,r),e.dispatchEvent(n)}},[s,r]),(0,t.jsx)(B.Primitive.input,{style:{display:"none"},...a,ref:l,defaultValue:r})});function tz(e,t,n){return(0,M.clamp)(100/(n-t)*(e-t),[0,100])}function tB(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}tH.displayName="RadioBubbleInput",e.s(["Range",()=>tA,"Root",()=>tC,"Slider",()=>tC,"SliderRange",()=>tA,"SliderThumb",()=>tL,"SliderTrack",()=>tR,"Thumb",()=>tL,"Track",()=>tR,"createSliderScope",()=>ty],29991);var t_=e.i(29991),t_=t_;function tV({className:e,defaultValue:r,value:a,min:i=0,max:o=100,...l}){let s=n.useMemo(()=>Array.isArray(a)?a:Array.isArray(r)?r:[i,o],[a,r,i,o]);return(0,t.jsxs)(t_.Root,{"data-slot":"slider",defaultValue:r,value:a,min:i,max:o,className:(0,b.cn)("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",e),...l,children:[(0,t.jsx)(t_.Track,{"data-slot":"slider-track",className:(0,b.cn)("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:(0,t.jsx)(t_.Range,{"data-slot":"slider-range",className:(0,b.cn)("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:s.length},(e,n)=>(0,t.jsx)(t_.Thumb,{"data-slot":"slider-thumb",className:"border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},n))]})}let tW=[60,120,300,600,900,1800,2700,3600,7200,10800,14400,21600,28800,43200,86400],tO=tW.length-1;function tU(e){let t=0,n=Math.abs(e-tW[0]);for(let r=1;r<tW.length;r++){let a=Math.abs(e-tW[r]);a<n&&(n=a,t=r)}return t}function tK({id:e,testId:r,value:a,onChange:i,onBlur:o,defaultSeconds:l=1800}){var s;let d,c,u=(""===a?l:parseInt(a,10))||l,[p,m]=(0,n.useState)(()=>tU(u)),h=tU(u);h!==p&&tW[p]!==u&&m(h);let f=(0,n.useCallback)(([e])=>{m(e),i(String(tW[e]))},[i]);return(0,t.jsxs)("div",{className:"flex w-55 items-center gap-2",children:[(0,t.jsx)(tV,{id:e,"data-testid":r,min:0,max:tO,step:1,value:[p],onValueChange:f,onValueCommit:()=>o(),className:"min-w-0 flex-1"}),(0,t.jsx)("span",{className:"text-muted-foreground shrink-0 text-right text-xs tabular-nums",children:(d=Math.floor((s=tW[p])/3600),c=Math.round(s%3600/60),0===d?`${c}m`:0===c?`${d}h`:`${d}h ${c}m`)})]})}let tq=[{value:te.AgentAuthMethod.Session,label:"Session"},{value:te.AgentAuthMethod.Token,label:"Token"}],tG=[{value:te.EditorType.VsCode,label:"VS Code"},{value:te.EditorType.Cursor,label:"Cursor"},{value:te.EditorType.Windsurf,label:"Windsurf"},{value:te.EditorType.Zed,label:"Zed"},{value:te.EditorType.Antigravity,label:"Antigravity"}],t$=[{value:"bash",label:"Bash"},{value:"zsh",label:"Zsh"},{value:"fish",label:"Fish"}],tY=[{id:"agent",label:"Agent",icon:l.Bot},{id:"environment",label:"Environment",icon:s.Terminal},{id:"workflow",label:"Workflow",icon:d.GitBranch},{id:"ci",label:"CI",icon:c},{id:"stage-timeouts",label:"Timeouts",icon:v},{id:"notifications",label:"Notifications",icon:u},{id:"feature-flags",label:"Flags",icon:p},{id:"database",label:"Database",icon:m}];function tZ({label:e,description:n,htmlFor:r,children:a}){return(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4 border-b py-2.5 last:border-b-0",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)(y.Label,{htmlFor:r,className:"cursor-pointer text-sm font-normal whitespace-nowrap",children:e}),n?(0,t.jsx)("p",{className:"text-muted-foreground text-[11px] leading-tight",children:n}):null]}),(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:a})]})}function tX({label:e,description:n,id:r,testId:a,checked:i,onChange:o,disabled:l}){return(0,t.jsx)(tZ,{label:e,description:n,htmlFor:r,children:(0,t.jsx)(C.Switch,{id:r,"data-testid":a,checked:i,onCheckedChange:o,disabled:l,className:(0,b.cn)("cursor-pointer",l&&"cursor-not-allowed opacity-50")})})}function tQ({icon:e,title:n,description:r,badge:a,testId:i,children:o}){return(0,t.jsxs)("div",{className:"bg-background rounded-lg border","data-testid":i,children:[(0,t.jsxs)("div",{className:"bg-muted/30 border-b px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(e,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,t.jsx)("h2",{className:"text-sm font-semibold",children:n}),a?(0,t.jsx)("span",{className:"bg-muted text-muted-foreground rounded px-1.5 py-0.5 text-[9px] font-medium tracking-wider uppercase",children:a}):null]}),(0,t.jsx)("p",{className:"text-muted-foreground mt-0.5 text-[11px]",children:r})]}),(0,t.jsx)("div",{className:"px-4",children:o})]})}function tJ({id:e,testId:n,value:r,onChange:a,onBlur:i,placeholder:o,min:l=1,max:s,step:d=1,suffix:c}){let u=""===r?void 0:parseInt(r,10);return(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)("div",{className:"flex items-center overflow-hidden rounded-md border",children:[(0,t.jsx)("button",{type:"button",onClick:()=>{a(String(Math.max(l,(u??parseInt(o,10))-d)))},onMouseUp:i,className:"text-muted-foreground hover:bg-muted hover:text-foreground flex h-8 w-7 cursor-pointer items-center justify-center border-r transition-colors","aria-label":"Decrease",children:(0,t.jsx)(h.default,{className:"h-3 w-3"})}),(0,t.jsx)("input",{id:e,"data-testid":n,type:"text",inputMode:"numeric",pattern:"[0-9]*",value:r,placeholder:o,onChange:e=>{a(e.target.value.replace(/[^0-9]/g,""))},onBlur:i,className:"h-8 w-14 bg-transparent text-center text-xs outline-none"}),(0,t.jsx)("button",{type:"button",onClick:()=>{let e;e=u??parseInt(o,10),a(String(null!=s?Math.min(s,e+d):e+d))},onMouseUp:i,className:"text-muted-foreground hover:bg-muted hover:text-foreground flex h-8 w-7 cursor-pointer items-center justify-center border-l transition-colors","aria-label":"Increase",children:(0,t.jsx)(f.Plus,{className:"h-3 w-3"})})]}),c?(0,t.jsx)("span",{className:"text-muted-foreground text-[11px]",children:c}):null]})}function t0({children:e}){return(0,t.jsx)("div",{className:"border-b pt-3 pb-1",children:(0,t.jsx)("span",{className:"text-muted-foreground text-[10px] font-semibold tracking-wider uppercase",children:e})})}function t1({children:e,links:n}){return(0,t.jsxs)("div",{className:"hidden pt-2 lg:block",children:[(0,t.jsx)("p",{className:"text-muted-foreground/70 text-[11px] leading-relaxed",children:e}),null!=n&&n.length>0?(0,t.jsx)("div",{className:"mt-2 flex flex-col gap-1",children:n.map(e=>(0,t.jsxs)("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-[10px] transition-colors",children:[(0,t.jsx)(g.ExternalLink,{className:"h-2.5 w-2.5"}),e.label]},e.href))}):null]})}function t2({settings:e,shepHome:a,dbFileSize:h,availableTerminals:f}){let{showSaving:g,showSaved:y,save:C}=function(){let[e,t]=(0,n.useTransition)(),[r,a]=(0,n.useState)(!1),[i,o]=(0,n.useState)(!1),l=(0,n.useRef)(null),s=(0,n.useRef)(!1);return(0,n.useEffect)(()=>{e&&!r&&(a(!0),s.current=!1,l.current=setTimeout(()=>{l.current=null,s.current&&(a(!1),o(!0),setTimeout(()=>o(!1),2e3))},350)),!e&&r&&(s.current=!0,l.current||(a(!1),o(!0),setTimeout(()=>o(!1),2e3)))},[e,r]),{showSaving:r,showSaved:i,save:(0,n.useCallback)(e=>{t(async()=>{let t=await e9(e);t.success||w.toast.error(t.error??"Failed to save settings")})},[t])}}(),I=e.featureFlags??{skills:!1,envDeploy:!1,debug:!1},[M,N]=(0,n.useState)(e.agent.type),P=e.agent.authMethod,[E,R]=(0,n.useState)(e.agent.token??""),[T,A]=(0,n.useState)(!1),[D,L]=(0,n.useState)(e.environment.defaultEditor),[F,H]=(0,n.useState)(e.environment.shellPreference),[z,B]=(0,n.useState)(e.environment.terminalPreference??te.TerminalType.System),_=f?f.filter(e=>e.available):[{id:te.TerminalType.System,name:"System Terminal",available:!0}],[V,W]=(0,n.useState)(e.workflow.openPrOnImplementationComplete),[O,U]=(0,n.useState)(e.workflow.approvalGateDefaults.pushOnImplementationComplete),[K,q]=(0,n.useState)(e.workflow.approvalGateDefaults.allowPrd),[G,$]=(0,n.useState)(e.workflow.approvalGateDefaults.allowPlan),[Y,Z]=(0,n.useState)(e.workflow.approvalGateDefaults.allowMerge),[X,Q]=(0,n.useState)(e.workflow.enableEvidence),[J,ee]=(0,n.useState)(e.workflow.commitEvidence),[et,en]=(0,n.useState)(!1!==e.workflow.ciWatchEnabled),[er,ea]=(0,n.useState)(null!=e.workflow.ciMaxFixAttempts?String(e.workflow.ciMaxFixAttempts):""),[ei,eo]=(0,n.useState)(null!=e.workflow.ciWatchTimeoutMs?String(Math.round(e.workflow.ciWatchTimeoutMs/1e3)):""),[el,es]=(0,n.useState)(null!=e.workflow.ciLogMaxChars?String(e.workflow.ciLogMaxChars):""),[ed,ec]=(0,n.useState)(null!=e.workflow.ciWatchPollIntervalSeconds?String(e.workflow.ciWatchPollIntervalSeconds):""),eu=e.workflow.stageTimeouts,[ep,em]=(0,n.useState)(String(Math.round((eu?.analyzeMs??18e5)/1e3))),[eh,ef]=(0,n.useState)(String(Math.round((eu?.requirementsMs??18e5)/1e3))),[eg,ex]=(0,n.useState)(String(Math.round((eu?.researchMs??18e5)/1e3))),[ev,ew]=(0,n.useState)(String(Math.round((eu?.planMs??18e5)/1e3))),[eb,ey]=(0,n.useState)(String(Math.round((eu?.implementMs??18e5)/1e3))),[ej,eS]=(0,n.useState)(String(Math.round((eu?.mergeMs??18e5)/1e3))),eC=e.workflow.analyzeRepoTimeouts,[ek,eI]=(0,n.useState)(String(Math.round((eC?.analyzeMs??6e5)/1e3))),[eM,eN]=(0,n.useState)(e.notifications.inApp.enabled),[eP,eE]=(0,n.useState)(e.notifications.browser.enabled),[eR,eT]=(0,n.useState)(e.notifications.desktop.enabled),[eA,eD]=(0,n.useState)({...e.notifications.events}),[eL,eF]=(0,n.useState)({...I}),eH=null!=e.workflow.ciMaxFixAttempts?String(e.workflow.ciMaxFixAttempts):"",ez=null!=e.workflow.ciWatchTimeoutMs?String(Math.round(e.workflow.ciWatchTimeoutMs/1e3)):"",eB=null!=e.workflow.ciLogMaxChars?String(e.workflow.ciLogMaxChars):"",e_=null!=e.workflow.ciWatchPollIntervalSeconds?String(e.workflow.ciWatchPollIntervalSeconds):"",eV=eu?.analyzeMs!=null?String(Math.round(eu.analyzeMs/1e3)):"",eW=eu?.requirementsMs!=null?String(Math.round(eu.requirementsMs/1e3)):"",eO=eu?.researchMs!=null?String(Math.round(eu.researchMs/1e3)):"",eU=eu?.planMs!=null?String(Math.round(eu.planMs/1e3)):"",eK=eu?.implementMs!=null?String(Math.round(eu.implementMs/1e3)):"",eq=eu?.mergeMs!=null?String(Math.round(eu.mergeMs/1e3)):"",eG=eC?.analyzeMs!=null?String(Math.round(eC.analyzeMs/1e3)):"";function e$(e){if(""===e)return;let t=parseInt(e,10);return Number.isNaN(t)||t<=0?void 0:t}function eY(e){if(void 0===e)return;let t=e$(e);return null!=t?1e3*t:void 0}function eZ(e={}){let t=e$(e.ciTimeout??ei);return{workflow:{openPrOnImplementationComplete:e.openPr??V,approvalGateDefaults:{pushOnImplementationComplete:e.pushOnComplete??O,allowPrd:e.allowPrd??K,allowPlan:e.allowPlan??G,allowMerge:e.allowMerge??Y},enableEvidence:e.enableEvidence??X,commitEvidence:e.commitEvidence??J,ciWatchEnabled:e.ciWatchEnabled??et,ciMaxFixAttempts:e$(e.ciMaxFix??er),ciWatchTimeoutMs:null!=t?1e3*t:void 0,ciLogMaxChars:e$(e.ciLogMax??el),ciWatchPollIntervalSeconds:e$(e.ciPollInterval??ed),stageTimeouts:{analyzeMs:eY(e.analyzeTimeout??ep),requirementsMs:eY(e.requirementsTimeout??eh),researchMs:eY(e.researchTimeout??eg),planMs:eY(e.planTimeout??ev),implementMs:eY(e.implementTimeout??eb),mergeMs:eY(e.mergeTimeout??ej)},analyzeRepoTimeouts:{analyzeMs:eY(e.analyzeRepoTimeout??ek)}}}}function eX(e={}){return{notifications:{inApp:{enabled:e.inApp??eM},browser:{enabled:e.browser??eP},desktop:{enabled:e.desktop??eR},events:e.events??eA}}}let[eQ,eJ]=(0,n.useState)("agent");(0,n.useEffect)(()=>{let e=tY.map(e=>document.getElementById(`section-${e.id}`)).filter(Boolean);if(0===e.length)return;let t=new IntersectionObserver(e=>{for(let t of e)t.isIntersecting&&eJ(t.target.id.replace("section-",""))},{rootMargin:"-65px 0px -60% 0px",threshold:0});for(let n of e)t.observe(n);return()=>t.disconnect()},[]);let e0=(0,n.useCallback)(e=>{let t=document.getElementById(`section-${e}`);t&&(t.scrollIntoView({behavior:"smooth",block:"start"}),t.style.animation="none",t.offsetHeight,t.style.animation="section-flash 1s ease-out")},[]);return(0,t.jsxs)("div",{"data-testid":"settings-page-client",className:"max-w-5xl",children:[(0,t.jsx)("div",{className:"bg-background/95 supports-backdrop-filter:bg-background/80 sticky top-0 z-10 grid grid-cols-1 gap-x-5 pt-6 pb-4 backdrop-blur lg:grid-cols-[1fr_280px]",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(x,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("h1",{className:"text-sm font-bold tracking-tight",children:"Settings"}),(0,t.jsxs)("span",{className:"relative h-4 w-16",children:[(0,t.jsx)("span",{className:(0,b.cn)("text-muted-foreground absolute inset-0 flex items-center text-xs transition-opacity duration-300",g?"opacity-100":"opacity-0"),children:"Saving..."}),(0,t.jsxs)("span",{className:(0,b.cn)("absolute inset-0 flex items-center gap-1 text-xs text-green-600 transition-opacity duration-300",y&&!g?"opacity-100":"opacity-0"),children:[(0,t.jsx)(o.Check,{className:"h-3 w-3"}),"Saved"]})]}),(0,t.jsx)("nav",{className:"ml-auto flex items-center gap-0.5",children:tY.map(e=>{let n=e.icon,r=eQ===e.id;return(0,t.jsxs)("button",{type:"button",onClick:()=>e0(e.id),className:(0,b.cn)("flex cursor-pointer items-center gap-1 rounded-md px-1.5 py-1 text-[11px] transition-all",r?"bg-accent text-foreground font-medium":"text-muted-foreground/60 hover:text-foreground hover:bg-accent/50"),children:[(0,t.jsx)(n,{className:"h-3 w-3"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:e.label})]},e.id)})})]})}),(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsxs)("div",{id:"section-agent",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tQ,{icon:l.Bot,title:"Agent",description:"AI coding agent and authentication",testId:"agent-settings-section",children:[(0,t.jsx)(tZ,{label:"Agent & Model",description:"Provider and model for all operations",htmlFor:"agent-model-picker",children:(0,t.jsx)(tu.AgentModelPicker,{initialAgentType:M,initialModel:e.models.default,mode:"settings",onAgentModelChange:e=>N(e),className:"w-55"})}),(0,t.jsx)(tZ,{label:"Authentication",description:"How the agent authenticates",htmlFor:"auth-method",children:(0,t.jsx)(k.TooltipProvider,{children:(0,t.jsxs)(k.Tooltip,{children:[(0,t.jsx)(k.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("div",{children:(0,t.jsxs)(e1,{value:P,disabled:!0,children:[(0,t.jsx)(e3,{id:"auth-method","data-testid":"auth-method-select",className:"w-55 cursor-not-allowed text-xs opacity-60",children:(0,t.jsx)(e2,{})}),(0,t.jsx)(e8,{children:tq.map(e=>(0,t.jsx)(e6,{value:e.value,children:e.label},e.value))})]})})}),(0,t.jsx)(k.TooltipContent,{children:"Coming soon"})]})})}),P===te.AgentAuthMethod.Token&&(0,t.jsx)(tZ,{label:"API Token",htmlFor:"agent-token",children:(0,t.jsxs)("div",{className:"relative w-45",children:[(0,t.jsx)(j.Input,{id:"agent-token","data-testid":"agent-token-input",type:T?"text":"password",value:E,onChange:e=>R(e.target.value),onBlur:()=>{E!==(e.agent.token??"")&&C(function(e={}){let t={type:M,authMethod:P,...e},n={type:t.type,authMethod:t.authMethod};return t.authMethod===te.AgentAuthMethod.Token&&(n.token=e.token??E),{agent:n}}({token:E}))},placeholder:"Enter token",className:"pr-8"}),(0,t.jsx)(S.Button,{type:"button",variant:"ghost",size:"sm",className:"absolute top-0 right-0 h-full px-2 hover:bg-transparent",onClick:()=>A(!T),"data-testid":"toggle-token-visibility","aria-label":T?"Hide token":"Show token",children:T?(0,t.jsx)(i,{className:"h-3 w-3"}):(0,t.jsx)(r.Eye,{className:"h-3 w-3"})})]})})]}),(0,t.jsx)(t1,{links:[{label:"Agent system",href:"https://github.com/shep-ai/cli/blob/main/docs/architecture/agent-system.md"},{label:"Adding agents",href:"https://github.com/shep-ai/cli/blob/main/docs/development/adding-agents.md"},{label:"Configuration guide",href:"https://github.com/shep-ai/cli/blob/main/docs/guides/configuration.md"}],children:"Choose which AI coding agent powers your features. Each agent supports different models and capabilities. Authentication is resolved automatically via your active session."})]}),(0,t.jsxs)("div",{id:"section-environment",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tQ,{icon:s.Terminal,title:"Environment",description:"Editor, shell, and terminal preferences",testId:"environment-settings-section",children:[(0,t.jsx)(tZ,{label:"Default Editor",description:"Editor launched for file operations",htmlFor:"default-editor",children:(0,t.jsxs)(e1,{value:D,onValueChange:e=>{L(e),C({environment:{defaultEditor:e,shellPreference:F,terminalPreference:z}})},children:[(0,t.jsx)(e3,{id:"default-editor","data-testid":"editor-select",className:"w-55 cursor-pointer text-xs",children:(0,t.jsx)(e2,{})}),(0,t.jsx)(e8,{children:tG.map(e=>{var n;let r=(n=e.value)&&n in tc?tc[n]:ta;return(0,t.jsx)(e6,{value:e.value,children:(0,t.jsxs)("span",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)(r,{className:"h-4 w-4 shrink-0"}),e.label]})},e.value)})})]})}),(0,t.jsx)(tZ,{label:"Shell",description:"Default shell for generated scripts",htmlFor:"shell-preference",children:(0,t.jsxs)(e1,{value:F,onValueChange:e=>{H(e),C({environment:{defaultEditor:D,shellPreference:e,terminalPreference:z}})},children:[(0,t.jsx)(e3,{id:"shell-preference","data-testid":"shell-select",className:"w-55 cursor-pointer text-xs",children:(0,t.jsx)(e2,{})}),(0,t.jsx)(e8,{children:t$.map(e=>(0,t.jsx)(e6,{value:e.value,children:e.label},e.value))})]})}),(0,t.jsx)(tZ,{label:"Terminal",description:"Terminal emulator for shell sessions",htmlFor:"terminal-preference",children:(0,t.jsxs)(e1,{value:z,onValueChange:e=>{B(e),C({environment:{defaultEditor:D,shellPreference:F,terminalPreference:e}})},children:[(0,t.jsx)(e3,{id:"terminal-preference","data-testid":"terminal-select",className:"w-55 cursor-pointer text-xs",children:(0,t.jsx)(e2,{})}),(0,t.jsx)(e8,{children:_.map(e=>(0,t.jsx)(e6,{value:e.id,children:e.name},e.id))})]})})]}),(0,t.jsx)(t1,{links:[{label:"Configuration guide",href:"https://github.com/shep-ai/cli/blob/main/docs/guides/configuration.md"}],children:"Your preferred editor opens files for review. The shell setting controls generated scripts. The terminal emulator is launched when opening shell sessions from the web UI."})]}),(0,t.jsxs)("div",{id:"section-workflow",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tQ,{icon:d.GitBranch,title:"Workflow",description:"Automation behavior after implementation",testId:"workflow-settings-section",children:[(0,t.jsx)(t0,{children:"Approve"}),(0,t.jsx)(tX,{label:"Auto-approve PRD",description:"Skip manual review of requirements",id:"allow-prd",testId:"switch-allow-prd",checked:K,onChange:e=>{q(e),C(eZ({allowPrd:e}))}}),(0,t.jsx)(tX,{label:"Auto-approve Plan",description:"Skip manual review of implementation plan",id:"allow-plan",testId:"switch-allow-plan",checked:G,onChange:e=>{$(e),C(eZ({allowPlan:e}))}}),(0,t.jsx)(tX,{label:"Auto-approve Merge",description:"Merge without manual review",id:"allow-merge",testId:"switch-allow-merge",checked:Y,onChange:e=>{Z(e),C(eZ({allowMerge:e}))}}),(0,t.jsx)(t0,{children:"Evidence"}),(0,t.jsx)(tX,{label:"Collect evidence",description:"Capture screenshots and artifacts after implementation",id:"enable-evidence",testId:"switch-enable-evidence",checked:X,onChange:e=>{Q(e),e?C(eZ({enableEvidence:e})):(ee(!1),C(eZ({enableEvidence:e,commitEvidence:!1})))}}),(0,t.jsx)(tX,{label:"Add evidence to PR",description:"Include evidence in the pull request body",id:"commit-evidence",testId:"switch-commit-evidence",checked:J,disabled:!X||!V,onChange:e=>{ee(e),C(eZ({commitEvidence:e}))}}),(0,t.jsx)(t0,{children:"Git"}),(0,t.jsx)(tX,{label:"Push on complete",description:"Push to remote when implementation finishes",id:"push-on-complete",testId:"switch-push-on-complete",checked:O,onChange:e=>{U(e),C(eZ({pushOnComplete:e}))}}),(0,t.jsx)(tX,{label:"Open PR on complete",description:"Create a pull request when done",id:"open-pr",testId:"switch-open-pr",checked:V,onChange:e=>{W(e),e?C(eZ({openPr:e})):(ee(!1),C(eZ({openPr:e,commitEvidence:!1})))}}),(0,t.jsx)(tX,{label:"Watch CI after push",description:"Monitor CI and auto-fix failures. Disable to avoid rate limits.",id:"ci-watch-enabled",testId:"switch-ci-watch-enabled",checked:et,onChange:e=>{en(e),C(eZ({ciWatchEnabled:e}))}})]}),(0,t.jsx)(t1,{links:[{label:"Approval gates",href:"https://github.com/shep-ai/cli/blob/main/specs/016-hitl-approval-gates/spec.yaml"},{label:"Push & PR flags",href:"https://github.com/shep-ai/cli/blob/main/specs/037-feature-pr-push-flags/spec.yaml"}],children:"Control how autonomous each feature run is. Auto-approve skips the human review pause at each phase. Push and PR options control what happens after successful implementation."})]}),(0,t.jsxs)("div",{id:"section-ci",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tQ,{icon:c,title:"Continuous Integration",description:"Limits and timeouts for CI monitoring",testId:"ci-settings-section",children:[(0,t.jsx)(tZ,{label:"Max fix attempts",description:"Agent retries on failing CI",htmlFor:"ci-max-fix",children:(0,t.jsx)(tJ,{id:"ci-max-fix",testId:"ci-max-fix-input",placeholder:"3",value:er,onChange:ea,onBlur:()=>{er!==eH&&C(eZ({ciMaxFix:er}))},min:1,max:10})}),(0,t.jsx)(tZ,{label:"Watch timeout",description:"Max wait for CI completion",htmlFor:"ci-timeout",children:(0,t.jsx)(tJ,{id:"ci-timeout",testId:"ci-timeout-input",placeholder:"300",value:ei,onChange:eo,onBlur:()=>{ei!==ez&&C(eZ({ciTimeout:ei}))},min:30,step:30,suffix:"sec"})}),(0,t.jsx)(tZ,{label:"Max log size",description:"Truncate CI logs beyond this limit",htmlFor:"ci-log-max",children:(0,t.jsx)(tJ,{id:"ci-log-max",testId:"ci-log-max-input",placeholder:"50000",value:el,onChange:es,onBlur:()=>{el!==eB&&C(eZ({ciLogMax:el}))},min:1e3,step:5e3,suffix:"chars"})}),(0,t.jsx)(tZ,{label:"Poll interval",description:"How often to check GitHub for CI status updates",htmlFor:"ci-poll-interval",children:(0,t.jsx)(tJ,{id:"ci-poll-interval",testId:"ci-poll-interval-input",placeholder:"30",value:ed,onChange:ec,onBlur:()=>{ed!==e_&&C(eZ({ciPollInterval:ed}))},min:5,step:5,suffix:"sec"})})]}),(0,t.jsx)(t1,{links:[{label:"CI/CD pipeline",href:"https://github.com/shep-ai/cli/blob/main/docs/development/cicd.md"},{label:"CI security gates",href:"https://github.com/shep-ai/cli/blob/main/specs/003-cicd-security-gates/spec.md"}],children:"When a feature completes, the agent can watch CI and auto-fix failures. These limits prevent runaway retries and control how much log output is sent to the agent for analysis."})]}),(0,t.jsxs)("div",{id:"section-stage-timeouts",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tQ,{icon:v,title:"Stage Timeouts",description:"Maximum execution time per agent stage",testId:"stage-timeouts-settings-section",children:[(0,t.jsx)(t0,{children:"Feature Agent"}),(0,t.jsx)(tZ,{label:"Analyze",description:"Repository analysis timeout",htmlFor:"timeout-analyze",children:(0,t.jsx)(tK,{id:"timeout-analyze",testId:"timeout-analyze-input",value:ep,onChange:em,onBlur:()=>{ep!==eV&&C(eZ({analyzeTimeout:ep}))},defaultSeconds:1800})}),(0,t.jsx)(tZ,{label:"Requirements",description:"Requirements gathering timeout",htmlFor:"timeout-requirements",children:(0,t.jsx)(tK,{id:"timeout-requirements",testId:"timeout-requirements-input",value:eh,onChange:ef,onBlur:()=>{eh!==eW&&C(eZ({requirementsTimeout:eh}))},defaultSeconds:1800})}),(0,t.jsx)(tZ,{label:"Research",description:"Technical research timeout",htmlFor:"timeout-research",children:(0,t.jsx)(tK,{id:"timeout-research",testId:"timeout-research-input",value:eg,onChange:ex,onBlur:()=>{eg!==eO&&C(eZ({researchTimeout:eg}))},defaultSeconds:1800})}),(0,t.jsx)(tZ,{label:"Plan",description:"Implementation planning timeout",htmlFor:"timeout-plan",children:(0,t.jsx)(tK,{id:"timeout-plan",testId:"timeout-plan-input",value:ev,onChange:ew,onBlur:()=>{ev!==eU&&C(eZ({planTimeout:ev}))},defaultSeconds:1800})}),(0,t.jsx)(tZ,{label:"Implement",description:"Code implementation timeout",htmlFor:"timeout-implement",children:(0,t.jsx)(tK,{id:"timeout-implement",testId:"timeout-implement-input",value:eb,onChange:ey,onBlur:()=>{eb!==eK&&C(eZ({implementTimeout:eb}))},defaultSeconds:1800})}),(0,t.jsx)(tZ,{label:"Merge",description:"PR creation and merge timeout",htmlFor:"timeout-merge",children:(0,t.jsx)(tK,{id:"timeout-merge",testId:"timeout-merge-input",value:ej,onChange:eS,onBlur:()=>{ej!==eq&&C(eZ({mergeTimeout:ej}))},defaultSeconds:1800})}),(0,t.jsx)(t0,{children:"Analyze Repository Agent"}),(0,t.jsx)(tZ,{label:"Analyze",description:"Repository analysis timeout",htmlFor:"timeout-analyze-repo",children:(0,t.jsx)(tK,{id:"timeout-analyze-repo",testId:"timeout-analyze-repo-input",value:ek,onChange:eI,onBlur:()=>{ek!==eG&&C(eZ({analyzeRepoTimeout:ek}))},defaultSeconds:600})})]}),(0,t.jsx)(t1,{children:"Each agent has independently configurable stage timeouts. When a stage exceeds its timeout, the agent is terminated. Longer timeouts are useful for complex implementations. Feature agent defaults to 30 minutes per stage. Analyze repository agent defaults to 10 minutes."})]}),(0,t.jsxs)("div",{id:"section-notifications",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tQ,{icon:u,title:"Notifications",description:"How and when you get notified",testId:"notification-settings-section",children:[(0,t.jsx)(t0,{children:"Channels"}),(0,t.jsx)(tX,{label:"In-app",description:"Notifications inside the Shep UI",id:"notif-in-app",testId:"switch-in-app",checked:eM,onChange:e=>{eN(e),C(eX({inApp:e}))}}),(0,t.jsx)(tX,{label:"Browser",description:"Push notifications via the browser",id:"notif-browser",testId:"switch-browser",checked:eP,onChange:e=>{eE(e),C(eX({browser:e}))}}),(0,t.jsx)(tX,{label:"Desktop",description:"Native OS notifications",id:"notif-desktop",testId:"switch-desktop",checked:eR,onChange:e=>{eT(e),C(eX({desktop:e}))}}),(0,t.jsx)(t0,{children:"Agent Events"}),(0,t.jsx)(tX,{label:"Agent started",id:"notif-event-agentStarted",testId:"switch-event-agentStarted",checked:eA.agentStarted,onChange:e=>{let t={...eA,agentStarted:e};eD(t),C(eX({events:t}))}}),(0,t.jsx)(tX,{label:"Phase completed",id:"notif-event-phaseCompleted",testId:"switch-event-phaseCompleted",checked:eA.phaseCompleted,onChange:e=>{let t={...eA,phaseCompleted:e};eD(t),C(eX({events:t}))}}),(0,t.jsx)(tX,{label:"Waiting approval",id:"notif-event-waitingApproval",testId:"switch-event-waitingApproval",checked:eA.waitingApproval,onChange:e=>{let t={...eA,waitingApproval:e};eD(t),C(eX({events:t}))}}),(0,t.jsx)(tX,{label:"Agent completed",id:"notif-event-agentCompleted",testId:"switch-event-agentCompleted",checked:eA.agentCompleted,onChange:e=>{let t={...eA,agentCompleted:e};eD(t),C(eX({events:t}))}}),(0,t.jsx)(tX,{label:"Agent failed",id:"notif-event-agentFailed",testId:"switch-event-agentFailed",checked:eA.agentFailed,onChange:e=>{let t={...eA,agentFailed:e};eD(t),C(eX({events:t}))}}),(0,t.jsx)(t0,{children:"Pull Request Events"}),(0,t.jsx)(tX,{label:"PR merged",id:"notif-event-prMerged",testId:"switch-event-prMerged",checked:eA.prMerged,onChange:e=>{let t={...eA,prMerged:e};eD(t),C(eX({events:t}))}}),(0,t.jsx)(tX,{label:"PR closed",id:"notif-event-prClosed",testId:"switch-event-prClosed",checked:eA.prClosed,onChange:e=>{let t={...eA,prClosed:e};eD(t),C(eX({events:t}))}}),(0,t.jsx)(tX,{label:"PR checks passed",id:"notif-event-prChecksPassed",testId:"switch-event-prChecksPassed",checked:eA.prChecksPassed,onChange:e=>{let t={...eA,prChecksPassed:e};eD(t),C(eX({events:t}))}}),(0,t.jsx)(tX,{label:"PR checks failed",id:"notif-event-prChecksFailed",testId:"switch-event-prChecksFailed",checked:eA.prChecksFailed,onChange:e=>{let t={...eA,prChecksFailed:e};eD(t),C(eX({events:t}))}})]}),(0,t.jsx)(t1,{links:[{label:"Notification system",href:"https://github.com/shep-ai/cli/blob/main/specs/021-agent-notifications/spec.yaml"}],children:"Three notification channels keep you in the loop: in-app toasts, browser push notifications, and native desktop alerts. Fine-tune which agent lifecycle events trigger a notification."})]}),(0,t.jsxs)("div",{id:"section-feature-flags",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tQ,{icon:p,title:"Feature Flags",description:"Enable or disable experimental features",badge:"Experimental",testId:"feature-flags-settings-section",children:[(0,t.jsx)(tX,{label:"Skills",description:"Enable the skills system for agent capabilities",id:"flag-skills",testId:"switch-flag-skills",checked:eL.skills,onChange:e=>{let t={...eL,skills:e};eF(t),C({featureFlags:t})}}),(0,t.jsx)(tX,{label:"Deployments",description:"Enable environment deployment workflows",id:"flag-envDeploy",testId:"switch-flag-envDeploy",checked:eL.envDeploy,onChange:e=>{let t={...eL,envDeploy:e};eF(t),C({featureFlags:t})}}),(0,t.jsx)(tX,{label:"Debug",description:"Show debug panels and verbose logging",id:"flag-debug",testId:"switch-flag-debug",checked:eL.debug,onChange:e=>{let t={...eL,debug:e};eF(t),C({featureFlags:t})}})]}),(0,t.jsx)(t1,{children:"Experimental features that are still under development. Enable at your own risk — they may change or be removed in future versions. Debug mode adds verbose logging useful for troubleshooting."})]}),(0,t.jsxs)("div",{id:"section-database",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tQ,{icon:m,title:"Database",description:"Local storage information",testId:"database-settings-section",children:[(0,t.jsx)(tZ,{label:"Location",description:"Path to the local SQLite database",children:(0,t.jsx)("span",{className:"text-muted-foreground max-w-50 truncate font-mono text-xs","data-testid":"shep-home-path",children:a})}),(0,t.jsx)(tZ,{label:"Size",children:(0,t.jsx)("span",{className:"text-muted-foreground text-xs","data-testid":"db-file-size",children:h})})]}),(0,t.jsx)(t1,{links:[{label:"Settings service",href:"https://github.com/shep-ai/cli/blob/main/docs/architecture/settings-service.md"},{label:"Settings spec",href:"https://github.com/shep-ai/cli/blob/main/specs/005-global-settings-service/spec.md"}],children:"All settings are stored in a local SQLite database at ~/.shep/data. The database uses a singleton record pattern with automatic migrations on startup."})]})]})]})}e.s(["SettingsPageClient",()=>t2],41952)}]);