conductor-oss 0.3.1 → 0.3.3

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 (136) hide show
  1. package/node_modules/@conductor-oss/plugin-agent-amp/package.json +1 -1
  2. package/node_modules/@conductor-oss/plugin-agent-ccr/package.json +1 -1
  3. package/node_modules/@conductor-oss/plugin-agent-claude-code/package.json +1 -1
  4. package/node_modules/@conductor-oss/plugin-agent-codex/package.json +1 -1
  5. package/node_modules/@conductor-oss/plugin-agent-cursor-cli/package.json +1 -1
  6. package/node_modules/@conductor-oss/plugin-agent-droid/package.json +1 -1
  7. package/node_modules/@conductor-oss/plugin-agent-gemini/dist/index.d.ts +44 -2
  8. package/node_modules/@conductor-oss/plugin-agent-gemini/dist/index.js +203 -17
  9. package/node_modules/@conductor-oss/plugin-agent-gemini/package.json +1 -1
  10. package/node_modules/@conductor-oss/plugin-agent-github-copilot/package.json +1 -1
  11. package/node_modules/@conductor-oss/plugin-agent-opencode/package.json +1 -1
  12. package/node_modules/@conductor-oss/plugin-agent-qwen-code/package.json +1 -1
  13. package/node_modules/@conductor-oss/plugin-mcp-server/package.json +1 -1
  14. package/node_modules/@conductor-oss/plugin-notifier-desktop/package.json +1 -1
  15. package/node_modules/@conductor-oss/plugin-notifier-discord/package.json +1 -1
  16. package/node_modules/@conductor-oss/plugin-runtime-tmux/package.json +1 -1
  17. package/node_modules/@conductor-oss/plugin-scm-github/package.json +1 -1
  18. package/node_modules/@conductor-oss/plugin-terminal-web/package.json +1 -1
  19. package/node_modules/@conductor-oss/plugin-tracker-github/package.json +1 -1
  20. package/node_modules/@conductor-oss/plugin-workspace-worktree/package.json +1 -1
  21. package/package.json +24 -23
  22. package/web/.next/standalone/packages/web/.next/BUILD_ID +1 -1
  23. package/web/.next/standalone/packages/web/.next/build-manifest.json +2 -2
  24. package/web/.next/standalone/packages/web/.next/prerender-manifest.json +3 -3
  25. package/web/.next/standalone/packages/web/.next/server/app/_global-error.html +2 -2
  26. package/web/.next/standalone/packages/web/.next/server/app/_global-error.rsc +1 -1
  27. package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  28. package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  29. package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  30. package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  31. package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  32. package/web/.next/standalone/packages/web/.next/server/app/_not-found/page/server-reference-manifest.json +7 -7
  33. package/web/.next/standalone/packages/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  34. package/web/.next/standalone/packages/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  35. package/web/.next/standalone/packages/web/.next/server/app/_not-found.html +1 -1
  36. package/web/.next/standalone/packages/web/.next/server/app/_not-found.rsc +3 -3
  37. package/web/.next/standalone/packages/web/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  38. package/web/.next/standalone/packages/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  39. package/web/.next/standalone/packages/web/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
  40. package/web/.next/standalone/packages/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  41. package/web/.next/standalone/packages/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  42. package/web/.next/standalone/packages/web/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  43. package/web/.next/standalone/packages/web/.next/server/app/index.html +1 -1
  44. package/web/.next/standalone/packages/web/.next/server/app/index.rsc +4 -4
  45. package/web/.next/standalone/packages/web/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  46. package/web/.next/standalone/packages/web/.next/server/app/index.segments/_full.segment.rsc +4 -4
  47. package/web/.next/standalone/packages/web/.next/server/app/index.segments/_head.segment.rsc +1 -1
  48. package/web/.next/standalone/packages/web/.next/server/app/index.segments/_index.segment.rsc +3 -3
  49. package/web/.next/standalone/packages/web/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  50. package/web/.next/standalone/packages/web/.next/server/app/page/react-loadable-manifest.json +1 -1
  51. package/web/.next/standalone/packages/web/.next/server/app/page/server-reference-manifest.json +7 -7
  52. package/web/.next/standalone/packages/web/.next/server/app/page.js.nft.json +1 -1
  53. package/web/.next/standalone/packages/web/.next/server/app/page_client-reference-manifest.js +1 -1
  54. package/web/.next/standalone/packages/web/.next/server/app/sessions/[id]/page/server-reference-manifest.json +7 -7
  55. package/web/.next/standalone/packages/web/.next/server/app/sessions/[id]/page.js.nft.json +1 -1
  56. package/web/.next/standalone/packages/web/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -1
  57. package/web/.next/standalone/packages/web/.next/server/app/sign-in/[[...sign-in]]/page/server-reference-manifest.json +7 -7
  58. package/web/.next/standalone/packages/web/.next/server/app/sign-in/[[...sign-in]]/page.js.nft.json +1 -1
  59. package/web/.next/standalone/packages/web/.next/server/app/sign-in/[[...sign-in]]/page_client-reference-manifest.js +1 -1
  60. package/web/.next/standalone/packages/web/.next/server/app/unlock/page/server-reference-manifest.json +7 -7
  61. package/web/.next/standalone/packages/web/.next/server/app/unlock/page.js.nft.json +1 -1
  62. package/web/.next/standalone/packages/web/.next/server/app/unlock/page_client-reference-manifest.js +1 -1
  63. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/[root-of-the-server]__6622b514._.js +1 -1
  64. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/[root-of-the-server]__869d9ac0._.js +1 -1
  65. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/[root-of-the-server]__9dc23e5a._.js +1 -1
  66. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/{[root-of-the-server]__c3eb4913._.js → [root-of-the-server]__a324b6db._.js} +2 -2
  67. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/[root-of-the-server]__b388693f._.js +1 -1
  68. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_0e1412de._.js +1 -1
  69. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_3acfb388._.js +1 -1
  70. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_668c9201._.js +1 -1
  71. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_69e05fca._.js +1 -1
  72. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_80efe193._.js +1 -1
  73. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_b6d31783._.js +1 -1
  74. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_c0f0e227._.js +1 -1
  75. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_f36ddaa9._.js +1 -1
  76. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/{node_modules_@clerk_nextjs_dist_esm_app-router_129dde21._.js → node_modules_@clerk_nextjs_dist_esm_app-router_6ed7a74d._.js} +2 -2
  77. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/node_modules_@clerk_nextjs_dist_esm_app-router_9e576054._.js +3 -0
  78. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/node_modules_f2ebd7a9._.js +1 -1
  79. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/packages_web_src_79316445._.js +1 -1
  80. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/packages_web_src_a078c137._.js +1 -1
  81. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/packages_web_src_app_page_tsx_cd282e82._.js +1 -1
  82. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/{packages_web_src_components_aad7de7c._.js → packages_web_src_components_80ce6eea._.js} +1 -1
  83. package/web/.next/standalone/packages/web/.next/server/pages/404.html +1 -1
  84. package/web/.next/standalone/packages/web/.next/server/pages/500.html +2 -2
  85. package/web/.next/standalone/packages/web/.next/server/server-reference-manifest.js +1 -1
  86. package/web/.next/standalone/packages/web/.next/server/server-reference-manifest.json +8 -8
  87. package/web/.next/standalone/packages/web/.next/static/chunks/25438e9094804f85.js +1 -0
  88. package/web/.next/standalone/packages/web/.next/static/chunks/{5c5637796e242130.js → 34d660195aaf8635.js} +2 -2
  89. package/web/.next/standalone/packages/web/.next/static/chunks/{07a5ac7389686572.js → 3814813ead38f9ae.js} +1 -1
  90. package/web/.next/standalone/packages/web/.next/static/chunks/524a7c2a8e85ea2f.js +1 -0
  91. package/web/.next/{static/chunks/e8d146cc2723147b.js → standalone/packages/web/.next/static/chunks/5672ef74a562c5dd.js} +1 -1
  92. package/web/.next/standalone/packages/web/.next/static/chunks/77d150e9b7dda43c.js +1 -0
  93. package/web/.next/standalone/packages/web/.next/static/chunks/8ec81b945f12169b.js +1 -0
  94. package/web/.next/standalone/packages/web/.next/static/chunks/aa158726d4a10331.js +1 -0
  95. package/web/.next/standalone/packages/web/.next/static/chunks/d3cd3cf58c908ec9.js +1 -0
  96. package/web/.next/standalone/packages/web/.next/static/chunks/df9658182f4f7d54.css +3 -0
  97. package/web/.next/standalone/packages/web/package.json +1 -0
  98. package/web/.next/standalone/packages/web/src/components/layout/Sidebar.tsx +20 -2
  99. package/web/.next/standalone/packages/web/src/components/layout/WorkspaceSidebarPanel.tsx +64 -74
  100. package/web/.next/standalone/packages/web/src/components/sessions/SessionOverview.tsx +114 -50
  101. package/web/.next/standalone/packages/web/src/features/dashboard/DashboardClient.tsx +459 -115
  102. package/web/.next/standalone/packages/web/src/features/dashboard/components/WorkspaceOverview.tsx +13 -31
  103. package/web/.next/standalone/packages/web/src/features/sessions/SessionPageClient.tsx +4 -1
  104. package/web/.next/standalone/packages/web/src/hooks/useSessions.ts +13 -0
  105. package/web/.next/standalone/packages/web/src/lib/types.ts +3 -0
  106. package/web/.next/static/chunks/25438e9094804f85.js +1 -0
  107. package/web/.next/static/chunks/{5c5637796e242130.js → 34d660195aaf8635.js} +2 -2
  108. package/web/.next/static/chunks/{07a5ac7389686572.js → 3814813ead38f9ae.js} +1 -1
  109. package/web/.next/static/chunks/524a7c2a8e85ea2f.js +1 -0
  110. package/web/.next/{standalone/packages/web/.next/static/chunks/e8d146cc2723147b.js → static/chunks/5672ef74a562c5dd.js} +1 -1
  111. package/web/.next/static/chunks/77d150e9b7dda43c.js +1 -0
  112. package/web/.next/static/chunks/8ec81b945f12169b.js +1 -0
  113. package/web/.next/static/chunks/aa158726d4a10331.js +1 -0
  114. package/web/.next/static/chunks/d3cd3cf58c908ec9.js +1 -0
  115. package/web/.next/static/chunks/df9658182f4f7d54.css +3 -0
  116. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/node_modules_@clerk_nextjs_dist_esm_app-router_1776df7f._.js +0 -3
  117. package/web/.next/standalone/packages/web/.next/static/chunks/3603312f8407bd12.js +0 -1
  118. package/web/.next/standalone/packages/web/.next/static/chunks/382be8f0b30c5f08.js +0 -1
  119. package/web/.next/standalone/packages/web/.next/static/chunks/479b8cb58c95a8a0.js +0 -1
  120. package/web/.next/standalone/packages/web/.next/static/chunks/53e4f3b495e423c9.js +0 -1
  121. package/web/.next/standalone/packages/web/.next/static/chunks/5e05e67a26b7ecbc.js +0 -1
  122. package/web/.next/standalone/packages/web/.next/static/chunks/6d083840413686dd.css +0 -3
  123. package/web/.next/standalone/packages/web/.next/static/chunks/c7c1bd729f17c8bf.js +0 -1
  124. package/web/.next/static/chunks/3603312f8407bd12.js +0 -1
  125. package/web/.next/static/chunks/382be8f0b30c5f08.js +0 -1
  126. package/web/.next/static/chunks/479b8cb58c95a8a0.js +0 -1
  127. package/web/.next/static/chunks/53e4f3b495e423c9.js +0 -1
  128. package/web/.next/static/chunks/5e05e67a26b7ecbc.js +0 -1
  129. package/web/.next/static/chunks/6d083840413686dd.css +0 -3
  130. package/web/.next/static/chunks/c7c1bd729f17c8bf.js +0 -1
  131. /package/web/.next/standalone/packages/web/.next/static/{oFTStwDpHHac4pinj0rAJ → -Z2NIcYE-i0soCDJ1TgtS}/_buildManifest.js +0 -0
  132. /package/web/.next/standalone/packages/web/.next/static/{oFTStwDpHHac4pinj0rAJ → -Z2NIcYE-i0soCDJ1TgtS}/_clientMiddlewareManifest.json +0 -0
  133. /package/web/.next/standalone/packages/web/.next/static/{oFTStwDpHHac4pinj0rAJ → -Z2NIcYE-i0soCDJ1TgtS}/_ssgManifest.js +0 -0
  134. /package/web/.next/static/{oFTStwDpHHac4pinj0rAJ → -Z2NIcYE-i0soCDJ1TgtS}/_buildManifest.js +0 -0
  135. /package/web/.next/static/{oFTStwDpHHac4pinj0rAJ → -Z2NIcYE-i0soCDJ1TgtS}/_clientMiddlewareManifest.json +0 -0
  136. /package/web/.next/static/{oFTStwDpHHac4pinj0rAJ → -Z2NIcYE-i0soCDJ1TgtS}/_ssgManifest.js +0 -0
@@ -1,3 +1,3 @@
1
- module.exports=[62587,a=>{"use strict";let b,c,d,e,f;var g,h,i,j,k,l,m,n,o=a.i(87924),p=a.i(19721),q=a.i(72131),r=a.i(7554),s=a.i(70121),t=a.i(50104),u=a.i(25152),v=a.i(30553),w=a.i(37738),x=a.i(7827),y=a.i(46872),z="dismissableLayer.update",A=q.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),B=q.forwardRef((a,b)=>{let{disableOutsidePointerEvents:c=!1,onEscapeKeyDown:d,onPointerDownOutside:e,onFocusOutside:f,onInteractOutside:g,onDismiss:h,...i}=a,j=q.useContext(A),[k,l]=q.useState(null),n=k?.ownerDocument??globalThis?.document,[,p]=q.useState({}),t=(0,s.useComposedRefs)(b,a=>l(a)),u=Array.from(j.layers),[w]=[...j.layersWithOutsidePointerEventsDisabled].slice(-1),x=u.indexOf(w),B=k?u.indexOf(k):-1,E=j.layersWithOutsidePointerEventsDisabled.size>0,F=B>=x,G=function(a,b=globalThis?.document){let c=(0,y.useCallbackRef)(a),d=q.useRef(!1),e=q.useRef(()=>{});return q.useEffect(()=>{let a=a=>{if(a.target&&!d.current){let d=function(){D("dismissableLayer.pointerDownOutside",c,f,{discrete:!0})},f={originalEvent:a};"touch"===a.pointerType?(b.removeEventListener("click",e.current),e.current=d,b.addEventListener("click",e.current,{once:!0})):d()}else b.removeEventListener("click",e.current);d.current=!1},f=window.setTimeout(()=>{b.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(f),b.removeEventListener("pointerdown",a),b.removeEventListener("click",e.current)}},[b,c]),{onPointerDownCapture:()=>d.current=!0}}(a=>{let b=a.target,c=[...j.branches].some(a=>a.contains(b));F&&!c&&(e?.(a),g?.(a),a.defaultPrevented||h?.())},n),H=function(a,b=globalThis?.document){let c=(0,y.useCallbackRef)(a),d=q.useRef(!1);return q.useEffect(()=>{let a=a=>{a.target&&!d.current&&D("dismissableLayer.focusOutside",c,{originalEvent:a},{discrete:!1})};return b.addEventListener("focusin",a),()=>b.removeEventListener("focusin",a)},[b,c]),{onFocusCapture:()=>d.current=!0,onBlurCapture:()=>d.current=!1}}(a=>{let b=a.target;![...j.branches].some(a=>a.contains(b))&&(f?.(a),g?.(a),a.defaultPrevented||h?.())},n);return!function(a,b=globalThis?.document){let c=(0,y.useCallbackRef)(a);q.useEffect(()=>{let a=a=>{"Escape"===a.key&&c(a)};return b.addEventListener("keydown",a,{capture:!0}),()=>b.removeEventListener("keydown",a,{capture:!0})},[c,b])}(a=>{B===j.layers.size-1&&(d?.(a),!a.defaultPrevented&&h&&(a.preventDefault(),h()))},n),q.useEffect(()=>{if(k)return c&&(0===j.layersWithOutsidePointerEventsDisabled.size&&(m=n.body.style.pointerEvents,n.body.style.pointerEvents="none"),j.layersWithOutsidePointerEventsDisabled.add(k)),j.layers.add(k),C(),()=>{c&&1===j.layersWithOutsidePointerEventsDisabled.size&&(n.body.style.pointerEvents=m)}},[k,n,c,j]),q.useEffect(()=>()=>{k&&(j.layers.delete(k),j.layersWithOutsidePointerEventsDisabled.delete(k),C())},[k,j]),q.useEffect(()=>{let a=()=>p({});return document.addEventListener(z,a),()=>document.removeEventListener(z,a)},[]),(0,o.jsx)(v.Primitive.div,{...i,ref:t,style:{pointerEvents:E?F?"auto":"none":void 0,...a.style},onFocusCapture:(0,r.composeEventHandlers)(a.onFocusCapture,H.onFocusCapture),onBlurCapture:(0,r.composeEventHandlers)(a.onBlurCapture,H.onBlurCapture),onPointerDownCapture:(0,r.composeEventHandlers)(a.onPointerDownCapture,G.onPointerDownCapture)})});function C(){let a=new CustomEvent(z);document.dispatchEvent(a)}function D(a,b,c,{discrete:d}){let e=c.originalEvent.target,f=new CustomEvent(a,{bubbles:!1,cancelable:!0,detail:c});b&&e.addEventListener(a,b,{once:!0}),d?(0,v.dispatchDiscreteCustomEvent)(e,f):e.dispatchEvent(f)}B.displayName="DismissableLayer",q.forwardRef((a,b)=>{let c=q.useContext(A),d=q.useRef(null),e=(0,s.useComposedRefs)(b,d);return q.useEffect(()=>{let a=d.current;if(a)return c.branches.add(a),()=>{c.branches.delete(a)}},[c.branches]),(0,o.jsx)(v.Primitive.div,{...a,ref:e})}).displayName="DismissableLayerBranch";var E=0;function F(){let a=document.createElement("span");return a.setAttribute("data-radix-focus-guard",""),a.tabIndex=0,a.style.outline="none",a.style.opacity="0",a.style.position="fixed",a.style.pointerEvents="none",a}var G="focusScope.autoFocusOnMount",H="focusScope.autoFocusOnUnmount",I={bubbles:!1,cancelable:!0},J=q.forwardRef((a,b)=>{let{loop:c=!1,trapped:d=!1,onMountAutoFocus:e,onUnmountAutoFocus:f,...g}=a,[h,i]=q.useState(null),j=(0,y.useCallbackRef)(e),k=(0,y.useCallbackRef)(f),l=q.useRef(null),m=(0,s.useComposedRefs)(b,a=>i(a)),n=q.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;q.useEffect(()=>{if(d){let a=function(a){if(n.paused||!h)return;let b=a.target;h.contains(b)?l.current=b:M(l.current,{select:!0})},b=function(a){if(n.paused||!h)return;let b=a.relatedTarget;null!==b&&(h.contains(b)||M(l.current,{select:!0}))};document.addEventListener("focusin",a),document.addEventListener("focusout",b);let c=new MutationObserver(function(a){if(document.activeElement===document.body)for(let b of a)b.removedNodes.length>0&&M(h)});return h&&c.observe(h,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",a),document.removeEventListener("focusout",b),c.disconnect()}}},[d,h,n.paused]),q.useEffect(()=>{if(h){N.add(n);let a=document.activeElement;if(!h.contains(a)){let b=new CustomEvent(G,I);h.addEventListener(G,j),h.dispatchEvent(b),b.defaultPrevented||(function(a,{select:b=!1}={}){let c=document.activeElement;for(let d of a)if(M(d,{select:b}),document.activeElement!==c)return}(K(h).filter(a=>"A"!==a.tagName),{select:!0}),document.activeElement===a&&M(h))}return()=>{h.removeEventListener(G,j),setTimeout(()=>{let b=new CustomEvent(H,I);h.addEventListener(H,k),h.dispatchEvent(b),b.defaultPrevented||M(a??document.body,{select:!0}),h.removeEventListener(H,k),N.remove(n)},0)}}},[h,j,k,n]);let p=q.useCallback(a=>{if(!c&&!d||n.paused)return;let b="Tab"===a.key&&!a.altKey&&!a.ctrlKey&&!a.metaKey,e=document.activeElement;if(b&&e){var f;let b,d=a.currentTarget,[g,h]=[L(b=K(f=d),f),L(b.reverse(),f)];g&&h?a.shiftKey||e!==h?a.shiftKey&&e===g&&(a.preventDefault(),c&&M(h,{select:!0})):(a.preventDefault(),c&&M(g,{select:!0})):e===d&&a.preventDefault()}},[c,d,n.paused]);return(0,o.jsx)(v.Primitive.div,{tabIndex:-1,...g,ref:m,onKeyDown:p})});function K(a){let b=[],c=document.createTreeWalker(a,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{let b="INPUT"===a.tagName&&"hidden"===a.type;return a.disabled||a.hidden||b?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;c.nextNode();)b.push(c.currentNode);return b}function L(a,b){for(let c of a)if(!function(a,{upTo:b}){if("hidden"===getComputedStyle(a).visibility)return!0;for(;a&&(void 0===b||a!==b);){if("none"===getComputedStyle(a).display)return!0;a=a.parentElement}return!1}(c,{upTo:b}))return c}function M(a,{select:b=!1}={}){if(a&&a.focus){var c;let d=document.activeElement;a.focus({preventScroll:!0}),a!==d&&(c=a)instanceof HTMLInputElement&&"select"in c&&b&&a.select()}}J.displayName="FocusScope";var N=(e=[],{add(a){let b=e[0];a!==b&&b?.pause(),(e=O(e,a)).unshift(a)},remove(a){e=O(e,a),e[0]?.resume()}});function O(a,b){let c=[...a],d=c.indexOf(b);return -1!==d&&c.splice(d,1),c}var P=a.i(92843);let Q=["top","right","bottom","left"],R=Math.min,S=Math.max,T=Math.round,U=Math.floor,V=a=>({x:a,y:a}),W={left:"right",right:"left",bottom:"top",top:"bottom"};function X(a,b){return"function"==typeof a?a(b):a}function Y(a){return a.split("-")[0]}function Z(a){return a.split("-")[1]}function $(a){return"x"===a?"y":"x"}function _(a){return"y"===a?"height":"width"}function aa(a){let b=a[0];return"t"===b||"b"===b?"y":"x"}function ab(a){return a.includes("start")?a.replace("start","end"):a.replace("end","start")}let ac=["left","right"],ad=["right","left"],ae=["top","bottom"],af=["bottom","top"];function ag(a){let b=Y(a);return W[b]+a.slice(b.length)}function ah(a){return"number"!=typeof a?{top:0,right:0,bottom:0,left:0,...a}:{top:a,right:a,bottom:a,left:a}}function ai(a){let{x:b,y:c,width:d,height:e}=a;return{width:d,height:e,top:c,left:b,right:b+d,bottom:c+e,x:b,y:c}}function aj(a,b,c){let d,{reference:e,floating:f}=a,g=aa(b),h=$(aa(b)),i=_(h),j=Y(b),k="y"===g,l=e.x+e.width/2-f.width/2,m=e.y+e.height/2-f.height/2,n=e[i]/2-f[i]/2;switch(j){case"top":d={x:l,y:e.y-f.height};break;case"bottom":d={x:l,y:e.y+e.height};break;case"right":d={x:e.x+e.width,y:m};break;case"left":d={x:e.x-f.width,y:m};break;default:d={x:e.x,y:e.y}}switch(Z(b)){case"start":d[h]-=n*(c&&k?-1:1);break;case"end":d[h]+=n*(c&&k?-1:1)}return d}async function ak(a,b){var c;void 0===b&&(b={});let{x:d,y:e,platform:f,rects:g,elements:h,strategy:i}=a,{boundary:j="clippingAncestors",rootBoundary:k="viewport",elementContext:l="floating",altBoundary:m=!1,padding:n=0}=X(b,a),o=ah(n),p=h[m?"floating"===l?"reference":"floating":l],q=ai(await f.getClippingRect({element:null==(c=await (null==f.isElement?void 0:f.isElement(p)))||c?p:p.contextElement||await (null==f.getDocumentElement?void 0:f.getDocumentElement(h.floating)),boundary:j,rootBoundary:k,strategy:i})),r="floating"===l?{x:d,y:e,width:g.floating.width,height:g.floating.height}:g.reference,s=await (null==f.getOffsetParent?void 0:f.getOffsetParent(h.floating)),t=await (null==f.isElement?void 0:f.isElement(s))&&await (null==f.getScale?void 0:f.getScale(s))||{x:1,y:1},u=ai(f.convertOffsetParentRelativeRectToViewportRelativeRect?await f.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:r,offsetParent:s,strategy:i}):r);return{top:(q.top-u.top+o.top)/t.y,bottom:(u.bottom-q.bottom+o.bottom)/t.y,left:(q.left-u.left+o.left)/t.x,right:(u.right-q.right+o.right)/t.x}}let al=async(a,b,c)=>{let{placement:d="bottom",strategy:e="absolute",middleware:f=[],platform:g}=c,h=g.detectOverflow?g:{...g,detectOverflow:ak},i=await (null==g.isRTL?void 0:g.isRTL(b)),j=await g.getElementRects({reference:a,floating:b,strategy:e}),{x:k,y:l}=aj(j,d,i),m=d,n=0,o={};for(let c=0;c<f.length;c++){let p=f[c];if(!p)continue;let{name:q,fn:r}=p,{x:s,y:t,data:u,reset:v}=await r({x:k,y:l,initialPlacement:d,placement:m,strategy:e,middlewareData:o,rects:j,platform:h,elements:{reference:a,floating:b}});k=null!=s?s:k,l=null!=t?t:l,o[q]={...o[q],...u},v&&n<50&&(n++,"object"==typeof v&&(v.placement&&(m=v.placement),v.rects&&(j=!0===v.rects?await g.getElementRects({reference:a,floating:b,strategy:e}):v.rects),{x:k,y:l}=aj(j,m,i)),c=-1)}return{x:k,y:l,placement:m,strategy:e,middlewareData:o}};function am(a,b){return{top:a.top-b.height,right:a.right-b.width,bottom:a.bottom-b.height,left:a.left-b.width}}function an(a){return Q.some(b=>a[b]>=0)}let ao=new Set(["left","top"]);async function ap(a,b){let{placement:c,platform:d,elements:e}=a,f=await (null==d.isRTL?void 0:d.isRTL(e.floating)),g=Y(c),h=Z(c),i="y"===aa(c),j=ao.has(g)?-1:1,k=f&&i?-1:1,l=X(b,a),{mainAxis:m,crossAxis:n,alignmentAxis:o}="number"==typeof l?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:l.mainAxis||0,crossAxis:l.crossAxis||0,alignmentAxis:l.alignmentAxis};return h&&"number"==typeof o&&(n="end"===h?-1*o:o),i?{x:n*k,y:m*j}:{x:m*j,y:n*k}}function aq(a){return function(a){return!1}(a)?(a.nodeName||"").toLowerCase():"#document"}function ar(a){var b;return(null==a||null==(b=a.ownerDocument)?void 0:b.defaultView)||window}function as(a){var b;return null==(b=(function(a){return!1}(a)?a.ownerDocument:a.document)||window.document)?void 0:b.documentElement}function at(a){return!1}function au(a){let{overflow:b,overflowX:c,overflowY:d,display:e}=aC(a);return/auto|scroll|overlay|hidden|clip/.test(b+d+c)&&"inline"!==e&&"contents"!==e}function av(a){try{if(a.matches(":popover-open"))return!0}catch(a){}try{return a.matches(":modal")}catch(a){return!1}}let aw=/transform|translate|scale|rotate|perspective|filter/,ax=/paint|layout|strict|content/,ay=a=>!!a&&"none"!==a;function az(a){let b=a;return ay(b.transform)||ay(b.translate)||ay(b.scale)||ay(b.rotate)||ay(b.perspective)||!aA()&&(ay(b.backdropFilter)||ay(b.filter))||aw.test(b.willChange||"")||ax.test(b.contain||"")}function aA(){return null==b&&(b="u">typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),b}function aB(a){return/^(html|body|#document)$/.test(aq(a))}function aC(a){return ar(a).getComputedStyle(a)}function aD(a){return{scrollLeft:a.scrollX,scrollTop:a.scrollY}}function aE(a){if("html"===aq(a))return a;let b=a.assignedSlot||a.parentNode||!1||as(a);return b}function aF(a,b,c){var d;void 0===b&&(b=[]),void 0===c&&(c=!0);let e=function a(b){let c=aE(b);return aB(c)?b.ownerDocument?b.ownerDocument.body:b.body:a(c)}(a),f=e===(null==(d=a.ownerDocument)?void 0:d.body),g=ar(e);if(!f)return b.concat(e,aF(e,[],c));{let a=aG(g);return b.concat(g,g.visualViewport||[],au(e)?e:[],a&&c?aF(a):[])}}function aG(a){return a.parent&&Object.getPrototypeOf(a.parent)?a.frameElement:null}function aH(a){let b=aC(a),c=parseFloat(b.width)||0,d=parseFloat(b.height)||0,e=!1,f=e?a.offsetWidth:c,g=e?a.offsetHeight:d,h=T(c)!==f||T(d)!==g;return h&&(c=f,d=g),{width:c,height:d,$:h}}function aI(a){return 0,a.contextElement}function aJ(a){let b=aI(a);1;return V(1)}let aK=V(0);function aL(a){let b=ar(a);return aA()&&b.visualViewport?{x:b.visualViewport.offsetLeft,y:b.visualViewport.offsetTop}:aK}function aM(a,b,c,d){var e;void 0===b&&(b=!1),void 0===c&&(c=!1);let f=a.getBoundingClientRect(),g=aI(a),h=V(1);b&&(d||(h=aJ(a)));let i=(void 0===(e=c)&&(e=!1),d&&(!e||d===ar(g))&&e)?aL(g):V(0),j=(f.left+i.x)/h.x,k=(f.top+i.y)/h.y,l=f.width/h.x,m=f.height/h.y;if(g){let a=ar(g),b=d,c=a,e=aG(c);for(;e&&d&&b!==c;){let a=aJ(e),b=e.getBoundingClientRect(),d=aC(e),f=b.left+(e.clientLeft+parseFloat(d.paddingLeft))*a.x,g=b.top+(e.clientTop+parseFloat(d.paddingTop))*a.y;j*=a.x,k*=a.y,l*=a.x,m*=a.y,j+=f,k+=g,e=aG(c=ar(e))}}return ai({width:l,height:m,x:j,y:k})}function aN(a,b){let c=aD(a).scrollLeft;return b?b.left+c:aM(as(a)).left+c}function aO(a,b){let c=a.getBoundingClientRect();return{x:c.left+b.scrollLeft-aN(a,c),y:c.top+b.scrollTop}}function aP(a,b,c){var d;let e;if("viewport"===b)e=function(a,b){let c=ar(a),d=as(a),e=c.visualViewport,f=d.clientWidth,g=d.clientHeight,h=0,i=0;if(e){f=e.width,g=e.height;let a=aA();(!a||a&&"fixed"===b)&&(h=e.offsetLeft,i=e.offsetTop)}let j=aN(d);if(j<=0){let a=d.ownerDocument,b=a.body,c=getComputedStyle(b),e="CSS1Compat"===a.compatMode&&parseFloat(c.marginLeft)+parseFloat(c.marginRight)||0,g=Math.abs(d.clientWidth-b.clientWidth-e);g<=25&&(f-=g)}else j<=25&&(f+=j);return{width:f,height:g,x:h,y:i}}(a,c);else if("document"===b){let b,c,f,g,h,i,j;d=as(a),b=as(d),c=aD(d),f=d.ownerDocument.body,g=S(b.scrollWidth,b.clientWidth,f.scrollWidth,f.clientWidth),h=S(b.scrollHeight,b.clientHeight,f.scrollHeight,f.clientHeight),i=-c.scrollLeft+aN(d),j=-c.scrollTop,"rtl"===aC(f).direction&&(i+=S(b.clientWidth,f.clientWidth)-g),e={width:g,height:h,x:i,y:j}}else{1;{let c=aL(a);e={x:b.x-c.x,y:b.y-c.y,width:b.width,height:b.height}}}return ai(e)}function aQ(a){return"static"===aC(a).position}function aR(a,b){1;return null}function aS(a,b){var c;let d=ar(a);if(av(a))return d;1;{let b=aE(a);for(;b&&!aB(b);){0;b=aE(b)}return d}}let aT=async function(a){let b=this.getOffsetParent||aS,c=this.getDimensions,d=await c(a.floating);return{reference:function(a,b,c){var d;let e=(d=0,!1),f=as(b),g="fixed"===c,h=aM(a,!0,g,b),i={scrollLeft:0,scrollTop:0},j=V(0);if(e||!e&&!g)if(("body"!==aq(b)||au(f))&&(i=aD(b)),e){let a=aM(b,!0,g,b);j.x=a.x+b.clientLeft,j.y=a.y+b.clientTop}else f&&(j.x=aN(f));g&&!e&&f&&(j.x=aN(f));let k=!f||e||g?V(0):aO(f,i);return{x:h.left+i.scrollLeft-j.x-k.x,y:h.top+i.scrollTop-j.y-k.y,width:h.width,height:h.height}}(a.reference,await b(a.floating),a.strategy),floating:{x:0,y:0,width:d.width,height:d.height}}},aU={convertOffsetParentRelativeRectToViewportRelativeRect:function(a){var b;let{elements:c,rect:d,offsetParent:e,strategy:f}=a,g="fixed"===f,h=as(e),i=!!c&&av(c.floating);if(e===h||i&&g)return d;let j={scrollLeft:0,scrollTop:0},k=V(1),l=V(0),m=(b=0,!1);if((m||!m&&!g)&&(("body"!==aq(e)||au(h))&&(j=aD(e)),m)){let a=aM(e);k=aJ(e),l.x=a.x+e.clientLeft,l.y=a.y+e.clientTop}let n=!h||m||g?V(0):aO(h,j);return{width:d.width*k.x,height:d.height*k.y,x:d.x*k.x-j.scrollLeft*k.x+l.x+n.x,y:d.y*k.y-j.scrollTop*k.y+l.y+n.y}},getDocumentElement:as,getClippingRect:function(a){let{element:b,boundary:c,rootBoundary:d,strategy:e}=a,f=[..."clippingAncestors"===c?av(b)?[]:function(a,b){var c;let d=b.get(a);if(d)return d;let e=aF(a,[],!1).filter(a=>{var b;return b=0,!1}),f="fixed"===aC(a).position,g=f?aE(a):a;return c=0,b.set(a,e),e}(b,this._c):[].concat(c),d],g=aP(b,f[0],e),h=g.top,i=g.right,j=g.bottom,k=g.left;for(let a=1;a<f.length;a++){let c=aP(b,f[a],e);h=S(c.top,h),i=R(c.right,i),j=R(c.bottom,j),k=S(c.left,k)}return{width:i-k,height:j-h,x:k,y:h}},getOffsetParent:aS,getElementRects:aT,getClientRects:function(a){return Array.from(a.getClientRects())},getDimensions:function(a){let{width:b,height:c}=aH(a);return{width:b,height:c}},getScale:aJ,isElement:at,isRTL:function(a){return"rtl"===aC(a).direction}};function aV(a,b){return a.x===b.x&&a.y===b.y&&a.width===b.width&&a.height===b.height}let aW=a=>({name:"arrow",options:a,async fn(b){let{x:c,y:d,placement:e,rects:f,platform:g,elements:h,middlewareData:i}=b,{element:j,padding:k=0}=X(a,b)||{};if(null==j)return{};let l=ah(k),m={x:c,y:d},n=$(aa(e)),o=_(n),p=await g.getDimensions(j),q="y"===n,r=q?"clientHeight":"clientWidth",s=f.reference[o]+f.reference[n]-m[n]-f.floating[o],t=m[n]-f.reference[n],u=await (null==g.getOffsetParent?void 0:g.getOffsetParent(j)),v=u?u[r]:0;v&&await (null==g.isElement?void 0:g.isElement(u))||(v=h.floating[r]||f.floating[o]);let w=v/2-p[o]/2-1,x=R(l[q?"top":"left"],w),y=R(l[q?"bottom":"right"],w),z=v-p[o]-y,A=v/2-p[o]/2+(s/2-t/2),B=S(x,R(A,z)),C=!i.arrow&&null!=Z(e)&&A!==B&&f.reference[o]/2-(A<x?x:y)-p[o]/2<0,D=C?A<x?A-x:A-z:0;return{[n]:m[n]+D,data:{[n]:B,centerOffset:A-B-D,...C&&{alignmentOffset:D}},reset:C}}});var aX=a.i(35112),aY="u">typeof document?q.useLayoutEffect:function(){};function aZ(a,b){let c,d,e;if(a===b)return!0;if(typeof a!=typeof b)return!1;if("function"==typeof a&&a.toString()===b.toString())return!0;if(a&&b&&"object"==typeof a){if(Array.isArray(a)){if((c=a.length)!==b.length)return!1;for(d=c;0!=d--;)if(!aZ(a[d],b[d]))return!1;return!0}if((c=(e=Object.keys(a)).length)!==Object.keys(b).length)return!1;for(d=c;0!=d--;)if(!({}).hasOwnProperty.call(b,e[d]))return!1;for(d=c;0!=d--;){let c=e[d];if(("_owner"!==c||!a.$$typeof)&&!aZ(a[c],b[c]))return!1}return!0}return a!=a&&b!=b}function a$(a,b){let c=1;return Math.round(b*c)/c}function a_(a){let b=q.useRef(a);return aY(()=>{b.current=a}),b}var a0=q.forwardRef((a,b)=>{let{children:c,width:d=10,height:e=5,...f}=a;return(0,o.jsx)(v.Primitive.svg,{...f,ref:b,width:d,height:e,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:a.asChild?c:(0,o.jsx)("polygon",{points:"0,0 30,0 15,10"})})});a0.displayName="Arrow";var a1=a.i(72752),a2="Popper",[a3,a4]=(0,t.createContextScope)(a2),[a5,a6]=a3(a2),a7=a=>{let{__scopePopper:b,children:c}=a,[d,e]=q.useState(null);return(0,o.jsx)(a5,{scope:b,anchor:d,onAnchorChange:e,children:c})};a7.displayName=a2;var a8="PopperAnchor",a9=q.forwardRef((a,b)=>{let{__scopePopper:c,virtualRef:d,...e}=a,f=a6(a8,c),g=q.useRef(null),h=(0,s.useComposedRefs)(b,g),i=q.useRef(null);return q.useEffect(()=>{let a=i.current;i.current=d?.current||g.current,a!==i.current&&f.onAnchorChange(i.current)}),d?null:(0,o.jsx)(v.Primitive.div,{...e,ref:h})});a9.displayName=a8;var ba="PopperContent",[bb,bc]=a3(ba),bd=q.forwardRef((a,b)=>{var c,d,e,f,g,h,i,j,k,l,m,n,p,r,t,u,w,x,z,A,B;let C,D,E,F,G,H,{__scopePopper:I,side:J="bottom",sideOffset:K=0,align:L="center",alignOffset:M=0,arrowPadding:N=0,avoidCollisions:O=!0,collisionBoundary:P=[],collisionPadding:Q=0,sticky:T="partial",hideWhenDetached:V=!1,updatePositionStrategy:W="optimized",onPlaced:ah,...ai}=a,aj=a6(ba,I),[ak,aq]=q.useState(null),ar=(0,s.useComposedRefs)(b,a=>aq(a)),[at,au]=q.useState(null),av=function(a){let[b,c]=q.useState(void 0);return(0,a1.useLayoutEffect)(()=>{if(a){c({width:a.offsetWidth,height:a.offsetHeight});let b=new ResizeObserver(b=>{let d,e;if(!Array.isArray(b)||!b.length)return;let f=b[0];if("borderBoxSize"in f){let a=f.borderBoxSize,b=Array.isArray(a)?a[0]:a;d=b.inlineSize,e=b.blockSize}else d=a.offsetWidth,e=a.offsetHeight;c({width:d,height:e})});return b.observe(a,{box:"border-box"}),()=>b.unobserve(a)}c(void 0)},[a]),b}(at),aw=av?.width??0,ax=av?.height??0,ay="number"==typeof Q?Q:{top:0,right:0,bottom:0,left:0,...Q},az=Array.isArray(P)?P:[P],aA=az.length>0,aB={padding:ay,boundary:az.filter(bh),altBoundary:aA},{refs:aC,floatingStyles:aD,placement:aE,isPositioned:aG,middlewareData:aH}=function(a){void 0===a&&(a={});let{placement:b="bottom",strategy:c="absolute",middleware:d=[],platform:e,elements:{reference:f,floating:g}={},transform:h=!0,whileElementsMounted:i,open:j}=a,[k,l]=q.useState({x:0,y:0,strategy:c,placement:b,middlewareData:{},isPositioned:!1}),[m,n]=q.useState(d);aZ(m,d)||n(d);let[o,p]=q.useState(null),[r,s]=q.useState(null),t=q.useCallback(a=>{a!==x.current&&(x.current=a,p(a))},[]),u=q.useCallback(a=>{a!==y.current&&(y.current=a,s(a))},[]),v=f||o,w=g||r,x=q.useRef(null),y=q.useRef(null),z=q.useRef(k),A=null!=i,B=a_(i),C=a_(e),D=a_(j),E=q.useCallback(()=>{var a,d;let e,f,g;if(!x.current||!y.current)return;let h={placement:b,strategy:c,middleware:m};C.current&&(h.platform=C.current),(a=x.current,d=y.current,e=new Map,g={...(f={platform:aU,...h}).platform,_c:e},al(a,d,{...f,platform:g})).then(a=>{let b={...a,isPositioned:!1!==D.current};F.current&&!aZ(z.current,b)&&(z.current=b,aX.flushSync(()=>{l(b)}))})},[m,b,c,C,D]);aY(()=>{!1===j&&z.current.isPositioned&&(z.current.isPositioned=!1,l(a=>({...a,isPositioned:!1})))},[j]);let F=q.useRef(!1);aY(()=>(F.current=!0,()=>{F.current=!1}),[]),aY(()=>{if(v&&(x.current=v),w&&(y.current=w),v&&w){if(B.current)return B.current(v,w,E);E()}},[v,w,E,B,A]);let G=q.useMemo(()=>({reference:x,floating:y,setReference:t,setFloating:u}),[t,u]),H=q.useMemo(()=>({reference:v,floating:w}),[v,w]),I=q.useMemo(()=>{let a={position:c,left:0,top:0};if(!H.floating)return a;let b=a$(H.floating,k.x),d=a$(H.floating,k.y);if(h)return{...a,transform:"translate("+b+"px, "+d+"px)",...(H.floating,false)};return{position:c,left:b,top:d}},[c,h,H.floating,k.x,k.y]);return q.useMemo(()=>({...k,update:E,refs:G,elements:H,floatingStyles:I}),[k,E,G,H,I])}({strategy:"fixed",placement:J+("center"!==L?"-"+L:""),whileElementsMounted:(...a)=>(function(a,b,c,d){let e;void 0===d&&(d={});let{ancestorScroll:f=!0,ancestorResize:g=!0,elementResize:h="function"==typeof ResizeObserver,layoutShift:i="function"==typeof IntersectionObserver,animationFrame:j=!1}=d,k=aI(a),l=f||g?[...k?aF(k):[],...b?aF(b):[]]:[];l.forEach(a=>{f&&a.addEventListener("scroll",c,{passive:!0}),g&&a.addEventListener("resize",c)});let m=k&&i?function(a,b){let c,d=null,e=as(a);function f(){var a;clearTimeout(c),null==(a=d)||a.disconnect(),d=null}return!function g(h,i){void 0===h&&(h=!1),void 0===i&&(i=1),f();let j=a.getBoundingClientRect(),{left:k,top:l,width:m,height:n}=j;if(h||b(),!m||!n)return;let o={rootMargin:-U(l)+"px "+-U(e.clientWidth-(k+m))+"px "+-U(e.clientHeight-(l+n))+"px "+-U(k)+"px",threshold:S(0,R(1,i))||1},p=!0;function q(b){let d=b[0].intersectionRatio;if(d!==i){if(!p)return g();d?g(!1,d):c=setTimeout(()=>{g(!1,1e-7)},1e3)}1!==d||aV(j,a.getBoundingClientRect())||g(),p=!1}try{d=new IntersectionObserver(q,{...o,root:e.ownerDocument})}catch(a){d=new IntersectionObserver(q,o)}d.observe(a)}(!0),f}(k,c):null,n=-1,o=null;h&&(o=new ResizeObserver(a=>{let[d]=a;d&&d.target===k&&o&&b&&(o.unobserve(b),cancelAnimationFrame(n),n=requestAnimationFrame(()=>{var a;null==(a=o)||a.observe(b)})),c()}),k&&!j&&o.observe(k),b&&o.observe(b));let p=j?aM(a):null;return j&&function b(){let d=aM(a);p&&!aV(p,d)&&c(),p=d,e=requestAnimationFrame(b)}(),c(),()=>{var a;l.forEach(a=>{f&&a.removeEventListener("scroll",c),g&&a.removeEventListener("resize",c)}),null==m||m(),null==(a=o)||a.disconnect(),o=null,j&&cancelAnimationFrame(e)}})(...a,{animationFrame:"always"===W}),elements:{reference:aj.anchor},middleware:[{name:(C={name:"offset",options:e=c={mainAxis:K+ax,alignmentAxis:M},async fn(a){var b,c;let{x:d,y:f,placement:g,middlewareData:h}=a,i=await ap(a,e);return g===(null==(b=h.offset)?void 0:b.placement)&&null!=(c=h.arrow)&&c.alignmentOffset?{}:{x:d+i.x,y:f+i.y,data:{...i,placement:g}}}}).name,fn:C.fn,options:[c,d]},O&&{name:(D={name:"shift",options:k=i={mainAxis:!0,crossAxis:!1,limiter:"partial"===T?{fn:(void 0===(h=f)&&(h={}),{options:h,fn(a){let{x:b,y:c,placement:d,rects:e,middlewareData:f}=a,{offset:g=0,mainAxis:i=!0,crossAxis:j=!0}=X(h,a),k={x:b,y:c},l=aa(d),m=$(l),n=k[m],o=k[l],p=X(g,a),q="number"==typeof p?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(i){let a="y"===m?"height":"width",b=e.reference[m]-e.floating[a]+q.mainAxis,c=e.reference[m]+e.reference[a]-q.mainAxis;n<b?n=b:n>c&&(n=c)}if(j){var r,s;let a="y"===m?"width":"height",b=ao.has(Y(d)),c=e.reference[l]-e.floating[a]+(b&&(null==(r=f.offset)?void 0:r[l])||0)+(b?0:q.crossAxis),g=e.reference[l]+e.reference[a]+(b?0:(null==(s=f.offset)?void 0:s[l])||0)-(b?q.crossAxis:0);o<c?o=c:o>g&&(o=g)}return{[m]:n,[l]:o}}}).fn,options:[f,g]}:void 0,...aB},async fn(a){let{x:b,y:c,placement:d,platform:e}=a,{mainAxis:f=!0,crossAxis:g=!1,limiter:h={fn:a=>{let{x:b,y:c}=a;return{x:b,y:c}}},...i}=X(k,a),j={x:b,y:c},l=await e.detectOverflow(a,i),m=aa(Y(d)),n=$(m),o=j[n],p=j[m];if(f){let a="y"===n?"top":"left",b="y"===n?"bottom":"right",c=o+l[a],d=o-l[b];o=S(c,R(o,d))}if(g){let a="y"===m?"top":"left",b="y"===m?"bottom":"right",c=p+l[a],d=p-l[b];p=S(c,R(p,d))}let q=h.fn({...a,[n]:o,[m]:p});return{...q,data:{x:q.x-b,y:q.y-c,enabled:{[n]:f,[m]:g}}}}}).name,fn:D.fn,options:[i,j]},O&&{name:(E={name:"flip",options:n=l={...aB},async fn(a){var b,c,d,e,f,g,h,i;let j,k,l,{placement:m,middlewareData:o,rects:p,initialPlacement:q,platform:r,elements:s}=a,{mainAxis:t=!0,crossAxis:u=!0,fallbackPlacements:v,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:y=!0,...z}=X(n,a);if(null!=(b=o.arrow)&&b.alignmentOffset)return{};let A=Y(m),B=aa(q),C=Y(q)===q,D=await (null==r.isRTL?void 0:r.isRTL(s.floating)),E=v||(C||!y?[ag(q)]:(j=ag(q),[ab(q),j,ab(j)])),F="none"!==x;!v&&F&&E.push(...(k=Z(q),l=function(a,b,c){switch(a){case"top":case"bottom":if(c)return b?ad:ac;return b?ac:ad;case"left":case"right":return b?ae:af;default:return[]}}(Y(q),"start"===x,D),k&&(l=l.map(a=>a+"-"+k),y&&(l=l.concat(l.map(ab)))),l));let G=[q,...E],H=await r.detectOverflow(a,z),I=[],J=(null==(c=o.flip)?void 0:c.overflows)||[];if(t&&I.push(H[A]),u){let a,b,c,d,e=(g=m,h=p,void 0===(i=D)&&(i=!1),a=Z(g),c=_(b=$(aa(g))),d="x"===b?a===(i?"end":"start")?"right":"left":"start"===a?"bottom":"top",h.reference[c]>h.floating[c]&&(d=ag(d)),[d,ag(d)]);I.push(H[e[0]],H[e[1]])}if(J=[...J,{placement:m,overflows:I}],!I.every(a=>a<=0)){let a=((null==(d=o.flip)?void 0:d.index)||0)+1,b=G[a];if(b&&("alignment"!==u||B===aa(b)||J.every(a=>aa(a.placement)!==B||a.overflows[0]>0)))return{data:{index:a,overflows:J},reset:{placement:b}};let c=null==(e=J.filter(a=>a.overflows[0]<=0).sort((a,b)=>a.overflows[1]-b.overflows[1])[0])?void 0:e.placement;if(!c)switch(w){case"bestFit":{let a=null==(f=J.filter(a=>{if(F){let b=aa(a.placement);return b===B||"y"===b}return!0}).map(a=>[a.placement,a.overflows.filter(a=>a>0).reduce((a,b)=>a+b,0)]).sort((a,b)=>a[1]-b[1])[0])?void 0:f[0];a&&(c=a);break}case"initialPlacement":c=q}if(m!==c)return{reset:{placement:c}}}return{}}}).name,fn:E.fn,options:[l,m]},{name:(F={name:"size",options:t=p={...aB,apply:({elements:a,rects:b,availableWidth:c,availableHeight:d})=>{let{width:e,height:f}=b.reference,g=a.floating.style;g.setProperty("--radix-popper-available-width",`${c}px`),g.setProperty("--radix-popper-available-height",`${d}px`),g.setProperty("--radix-popper-anchor-width",`${e}px`),g.setProperty("--radix-popper-anchor-height",`${f}px`)}},async fn(a){var b,c;let d,e,{placement:f,rects:g,platform:h,elements:i}=a,{apply:j=()=>{},...k}=X(t,a),l=await h.detectOverflow(a,k),m=Y(f),n=Z(f),o="y"===aa(f),{width:p,height:q}=g.floating;"top"===m||"bottom"===m?(d=m,e=n===(await (null==h.isRTL?void 0:h.isRTL(i.floating))?"start":"end")?"left":"right"):(e=m,d="end"===n?"top":"bottom");let r=q-l.top-l.bottom,s=p-l.left-l.right,u=R(q-l[d],r),v=R(p-l[e],s),w=!a.middlewareData.shift,x=u,y=v;if(null!=(b=a.middlewareData.shift)&&b.enabled.x&&(y=s),null!=(c=a.middlewareData.shift)&&c.enabled.y&&(x=r),w&&!n){let a=S(l.left,0),b=S(l.right,0),c=S(l.top,0),d=S(l.bottom,0);o?y=p-2*(0!==a||0!==b?a+b:S(l.left,l.right)):x=q-2*(0!==c||0!==d?c+d:S(l.top,l.bottom))}await j({...a,availableWidth:y,availableHeight:x});let z=await h.getDimensions(i.floating);return p!==z.width||q!==z.height?{reset:{rects:!0}}:{}}}).name,fn:F.fn,options:[p,r]},at&&{name:(G={name:"arrow",options:x=u={element:at,padding:N},fn(a){let{element:b,padding:c}="function"==typeof x?x(a):x;return b&&({}).hasOwnProperty.call(b,"current")?null!=b.current?aW({element:b.current,padding:c}).fn(a):{}:b?aW({element:b,padding:c}).fn(a):{}}}).name,fn:G.fn,options:[u,w]},bi({arrowWidth:aw,arrowHeight:ax}),V&&{name:(H={name:"hide",options:B=z={strategy:"referenceHidden",...aB},async fn(a){let{rects:b,platform:c}=a,{strategy:d="referenceHidden",...e}=X(B,a);switch(d){case"referenceHidden":{let d=am(await c.detectOverflow(a,{...e,elementContext:"reference"}),b.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:an(d)}}}case"escaped":{let d=am(await c.detectOverflow(a,{...e,altBoundary:!0}),b.floating);return{data:{escapedOffsets:d,escaped:an(d)}}}default:return{}}}}).name,fn:H.fn,options:[z,A]}]}),[aJ,aK]=bj(aE),aL=(0,y.useCallbackRef)(ah);(0,a1.useLayoutEffect)(()=>{aG&&aL?.()},[aG,aL]);let aN=aH.arrow?.x,aO=aH.arrow?.y,aP=aH.arrow?.centerOffset!==0,[aQ,aR]=q.useState();return(0,a1.useLayoutEffect)(()=>{ak&&aR(window.getComputedStyle(ak).zIndex)},[ak]),(0,o.jsx)("div",{ref:aC.setFloating,"data-radix-popper-content-wrapper":"",style:{...aD,transform:aG?aD.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:aQ,"--radix-popper-transform-origin":[aH.transformOrigin?.x,aH.transformOrigin?.y].join(" "),...aH.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:a.dir,children:(0,o.jsx)(bb,{scope:I,placedSide:aJ,onArrowChange:au,arrowX:aN,arrowY:aO,shouldHideArrow:aP,children:(0,o.jsx)(v.Primitive.div,{"data-side":aJ,"data-align":aK,...ai,ref:ar,style:{...ai.style,animation:aG?void 0:"none"}})})})});bd.displayName=ba;var be="PopperArrow",bf={top:"bottom",right:"left",bottom:"top",left:"right"},bg=q.forwardRef(function(a,b){let{__scopePopper:c,...d}=a,e=bc(be,c),f=bf[e.placedSide];return(0,o.jsx)("span",{ref:e.onArrowChange,style:{position:"absolute",left:e.arrowX,top:e.arrowY,[f]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[e.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[e.placedSide],visibility:e.shouldHideArrow?"hidden":void 0},children:(0,o.jsx)(a0,{...d,ref:b,style:{...d.style,display:"block"}})})});function bh(a){return null!==a}bg.displayName=be;var bi=a=>({name:"transformOrigin",options:a,fn(b){let{placement:c,rects:d,middlewareData:e}=b,f=e.arrow?.centerOffset!==0,g=f?0:a.arrowWidth,h=f?0:a.arrowHeight,[i,j]=bj(c),k={start:"0%",center:"50%",end:"100%"}[j],l=(e.arrow?.x??0)+g/2,m=(e.arrow?.y??0)+h/2,n="",o="";return"bottom"===i?(n=f?k:`${l}px`,o=`${-h}px`):"top"===i?(n=f?k:`${l}px`,o=`${d.floating.height+h}px`):"right"===i?(n=`${-h}px`,o=f?k:`${m}px`):"left"===i&&(n=`${d.floating.width+h}px`,o=f?k:`${m}px`),{data:{x:n,y:o}}}});function bj(a){let[b,c="center"]=a.split("-");return[b,c]}var bk=q.forwardRef((a,b)=>{let{container:c,...d}=a,[e,f]=q.useState(!1);(0,a1.useLayoutEffect)(()=>f(!0),[]);let g=c||e&&globalThis?.document?.body;return g?aX.default.createPortal((0,o.jsx)(v.Primitive.div,{...d,ref:b}),g):null});bk.displayName="Portal";var bl=a.i(77192),bm=a.i(44572),bn=Symbol("radix.slottable");function bo(a){return q.isValidElement(a)&&"function"==typeof a.type&&"__radixId"in a.type&&a.type.__radixId===bn}var bp=new WeakMap,bq=new WeakMap,br={},bs=0,bt=function(a){return a&&(a.host||bt(a.parentNode))},bu=function(a,b,c,d){var e=(Array.isArray(a)?a:[a]).map(function(a){if(b.contains(a))return a;var c=bt(a);return c&&b.contains(c)?c:(console.error("aria-hidden",a,"in not contained inside",b,". Doing nothing"),null)}).filter(function(a){return!!a});br[c]||(br[c]=new WeakMap);var f=br[c],g=[],h=new Set,i=new Set(e),j=function(a){!a||h.has(a)||(h.add(a),j(a.parentNode))};e.forEach(j);var k=function(a){!a||i.has(a)||Array.prototype.forEach.call(a.children,function(a){if(h.has(a))k(a);else try{var b=a.getAttribute(d),e=null!==b&&"false"!==b,i=(bp.get(a)||0)+1,j=(f.get(a)||0)+1;bp.set(a,i),f.set(a,j),g.push(a),1===i&&e&&bq.set(a,!0),1===j&&a.setAttribute(c,"true"),e||a.setAttribute(d,"true")}catch(b){console.error("aria-hidden: cannot operate on ",a,b)}})};return k(b),h.clear(),bs++,function(){g.forEach(function(a){var b=bp.get(a)-1,e=f.get(a)-1;bp.set(a,b),f.set(a,e),b||(bq.has(a)||a.removeAttribute(d),bq.delete(a)),e||a.removeAttribute(c)}),--bs||(bp=new WeakMap,bp=new WeakMap,bq=new WeakMap,br={})}},bv=function(a,b,c){void 0===c&&(c="data-aria-hidden");var d=Array.from(Array.isArray(a)?a:[a]),e=b||("u"<typeof document?null:(Array.isArray(a)?a[0]:a).ownerDocument.body);return e?(d.push.apply(d,Array.from(e.querySelectorAll("[aria-live], script"))),bu(d,e,c,"aria-hidden")):function(){return null}},bw=function(){return(bw=Object.assign||function(a){for(var b,c=1,d=arguments.length;c<d;c++)for(var e in b=arguments[c])Object.prototype.hasOwnProperty.call(b,e)&&(a[e]=b[e]);return a}).apply(this,arguments)};function bx(a,b){var c={};for(var d in a)Object.prototype.hasOwnProperty.call(a,d)&&0>b.indexOf(d)&&(c[d]=a[d]);if(null!=a&&"function"==typeof Object.getOwnPropertySymbols)for(var e=0,d=Object.getOwnPropertySymbols(a);e<d.length;e++)0>b.indexOf(d[e])&&Object.prototype.propertyIsEnumerable.call(a,d[e])&&(c[d[e]]=a[d[e]]);return c}var by=("function"==typeof SuppressedError&&SuppressedError,"right-scroll-bar-position"),bz="width-before-scroll-bar";function bA(a,b){return"function"==typeof a?a(b):a&&(a.current=b),a}var bB=q.useEffect,bC=new WeakMap,bD=(void 0===g&&(g={}),(void 0===h&&(h=function(a){return a}),i=[],j=!1,k={read:function(){if(j)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return i.length?i[i.length-1]:null},useMedium:function(a){var b=h(a,j);return i.push(b),function(){i=i.filter(function(a){return a!==b})}},assignSyncMedium:function(a){for(j=!0;i.length;){var b=i;i=[],b.forEach(a)}i={push:function(b){return a(b)},filter:function(){return i}}},assignMedium:function(a){j=!0;var b=[];if(i.length){var c=i;i=[],c.forEach(a),b=i}var d=function(){var c=b;b=[],c.forEach(a)},e=function(){return Promise.resolve().then(d)};e(),i={push:function(a){b.push(a),e()},filter:function(a){return b=b.filter(a),i}}}}).options=bw({async:!0,ssr:!1},g),k),bE=function(){},bF=q.forwardRef(function(a,b){var c,d,e,f,g=q.useRef(null),h=q.useState({onScrollCapture:bE,onWheelCapture:bE,onTouchMoveCapture:bE}),i=h[0],j=h[1],k=a.forwardProps,l=a.children,m=a.className,n=a.removeScrollBar,o=a.enabled,p=a.shards,r=a.sideCar,s=a.noRelative,t=a.noIsolation,u=a.inert,v=a.allowPinchZoom,w=a.as,x=a.gapMode,y=bx(a,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),z=(c=[g,b],d=function(a){return c.forEach(function(b){return bA(b,a)})},(e=(0,q.useState)(function(){return{value:null,callback:d,facade:{get current(){return e.value},set current(value){var a=e.value;a!==value&&(e.value=value,e.callback(value,a))}}}})[0]).callback=d,f=e.facade,bB(function(){var a=bC.get(f);if(a){var b=new Set(a),d=new Set(c),e=f.current;b.forEach(function(a){d.has(a)||bA(a,null)}),d.forEach(function(a){b.has(a)||bA(a,e)})}bC.set(f,c)},[c]),f),A=bw(bw({},y),i);return q.createElement(q.Fragment,null,o&&q.createElement(r,{sideCar:bD,removeScrollBar:n,shards:p,noRelative:s,noIsolation:t,inert:u,setCallbacks:j,allowPinchZoom:!!v,lockRef:g,gapMode:x}),k?q.cloneElement(q.Children.only(l),bw(bw({},A),{ref:z})):q.createElement(void 0===w?"div":w,bw({},A,{className:m,ref:z}),l))});bF.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},bF.classNames={fullWidth:bz,zeroRight:by};var bG=function(a){var b=a.sideCar,c=bx(a,["sideCar"]);if(!b)throw Error("Sidecar: please provide `sideCar` property to import the right car");var d=b.read();if(!d)throw Error("Sidecar medium not found");return q.createElement(d,bw({},c))};bG.isSideCarExport=!0;var bH=function(){var a=0,b=null;return{add:function(c){if(0==a&&(b=function(){if(!document)return null;var a=document.createElement("style");a.type="text/css";var b=n||("u">typeof __webpack_nonce__?__webpack_nonce__:void 0);return b&&a.setAttribute("nonce",b),a}())){var d,e;(d=b).styleSheet?d.styleSheet.cssText=c:d.appendChild(document.createTextNode(c)),e=b,(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}a++},remove:function(){--a||!b||(b.parentNode&&b.parentNode.removeChild(b),b=null)}}},bI=function(){var a=bH();return function(b,c){q.useEffect(function(){return a.add(b),function(){a.remove()}},[b&&c])}},bJ=function(){var a=bI();return function(b){return a(b.styles,b.dynamic),null}},bK={left:0,top:0,right:0,gap:0},bL=bJ(),bM="data-scroll-locked",bN=function(a,b,c,d){var e=a.left,f=a.top,g=a.right,h=a.gap;return void 0===c&&(c="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(d,";\n padding-right: ").concat(h,"px ").concat(d,";\n }\n body[").concat(bM,"] {\n overflow: hidden ").concat(d,";\n overscroll-behavior: contain;\n ").concat([b&&"position: relative ".concat(d,";"),"margin"===c&&"\n padding-left: ".concat(e,"px;\n padding-top: ").concat(f,"px;\n padding-right: ").concat(g,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(h,"px ").concat(d,";\n "),"padding"===c&&"padding-right: ".concat(h,"px ").concat(d,";")].filter(Boolean).join(""),"\n }\n \n .").concat(by," {\n right: ").concat(h,"px ").concat(d,";\n }\n \n .").concat(bz," {\n margin-right: ").concat(h,"px ").concat(d,";\n }\n \n .").concat(by," .").concat(by," {\n right: 0 ").concat(d,";\n }\n \n .").concat(bz," .").concat(bz," {\n margin-right: 0 ").concat(d,";\n }\n \n body[").concat(bM,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(h,"px;\n }\n")},bO=function(){var a=parseInt(document.body.getAttribute(bM)||"0",10);return isFinite(a)?a:0},bP=function(){q.useEffect(function(){return document.body.setAttribute(bM,(bO()+1).toString()),function(){var a=bO()-1;a<=0?document.body.removeAttribute(bM):document.body.setAttribute(bM,a.toString())}},[])},bQ=function(a){var b=a.noRelative,c=a.noImportant,d=a.gapMode,e=void 0===d?"margin":d;bP();var f=q.useMemo(function(){return void 0===e,bK},[e]);return q.createElement(bL,{styles:bN(f,!b,e,c?"":"!important")})},bR=function(a,b){if(!(a instanceof Element))return!1;var c=window.getComputedStyle(a);return"hidden"!==c[b]&&(c.overflowY!==c.overflowX||"TEXTAREA"===a.tagName||"visible"!==c[b])},bS=function(a,b){var c=b.ownerDocument,d=b;do{if("u">typeof ShadowRoot&&d instanceof ShadowRoot&&(d=d.host),bT(a,d)){var e=bU(a,d);if(e[1]>e[2])return!0}d=d.parentNode}while(d&&d!==c.body)return!1},bT=function(a,b){return"v"===a?bR(b,"overflowY"):bR(b,"overflowX")},bU=function(a,b){return"v"===a?[b.scrollTop,b.scrollHeight,b.clientHeight]:[b.scrollLeft,b.scrollWidth,b.clientWidth]},bV=function(a,b,c,d,e){var f,g=(f=window.getComputedStyle(b).direction,"h"===a&&"rtl"===f?-1:1),h=g*d,i=c.target,j=b.contains(i),k=!1,l=h>0,m=0,n=0;do{if(!i)break;var o=bU(a,i),p=o[0],q=o[1]-o[2]-g*p;(p||q)&&bT(a,i)&&(m+=q,n+=p);var r=i.parentNode;i=r&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE?r.host:r}while(!j&&i!==document.body||j&&(b.contains(i)||b===i))return l&&(e&&1>Math.abs(m)||!e&&h>m)?k=!0:!l&&(e&&1>Math.abs(n)||!e&&-h>n)&&(k=!0),k},bW=function(a){return"changedTouches"in a?[a.changedTouches[0].clientX,a.changedTouches[0].clientY]:[0,0]},bX=function(a){return[a.deltaX,a.deltaY]},bY=function(a){return a&&"current"in a?a.current:a},bZ=0,b$=[];let b_=(l=function(a){var b=q.useRef([]),c=q.useRef([0,0]),d=q.useRef(),e=q.useState(bZ++)[0],f=q.useState(bJ)[0],g=q.useRef(a);q.useEffect(function(){g.current=a},[a]),q.useEffect(function(){if(a.inert){document.body.classList.add("block-interactivity-".concat(e));var b=(function(a,b,c){if(c||2==arguments.length)for(var d,e=0,f=b.length;e<f;e++)!d&&e in b||(d||(d=Array.prototype.slice.call(b,0,e)),d[e]=b[e]);return a.concat(d||Array.prototype.slice.call(b))})([a.lockRef.current],(a.shards||[]).map(bY),!0).filter(Boolean);return b.forEach(function(a){return a.classList.add("allow-interactivity-".concat(e))}),function(){document.body.classList.remove("block-interactivity-".concat(e)),b.forEach(function(a){return a.classList.remove("allow-interactivity-".concat(e))})}}},[a.inert,a.lockRef.current,a.shards]);var h=q.useCallback(function(a,b){if("touches"in a&&2===a.touches.length||"wheel"===a.type&&a.ctrlKey)return!g.current.allowPinchZoom;var e,f=bW(a),h=c.current,i="deltaX"in a?a.deltaX:h[0]-f[0],j="deltaY"in a?a.deltaY:h[1]-f[1],k=a.target,l=Math.abs(i)>Math.abs(j)?"h":"v";if("touches"in a&&"h"===l&&"range"===k.type)return!1;var m=window.getSelection(),n=m&&m.anchorNode;if(n&&(n===k||n.contains(k)))return!1;var o=bS(l,k);if(!o)return!0;if(o?e=l:(e="v"===l?"h":"v",o=bS(l,k)),!o)return!1;if(!d.current&&"changedTouches"in a&&(i||j)&&(d.current=e),!e)return!0;var p=d.current||e;return bV(p,b,a,"h"===p?i:j,!0)},[]),i=q.useCallback(function(a){if(b$.length&&b$[b$.length-1]===f){var c="deltaY"in a?bX(a):bW(a),d=b.current.filter(function(b){var d;return b.name===a.type&&(b.target===a.target||a.target===b.shadowParent)&&(d=b.delta,d[0]===c[0]&&d[1]===c[1])})[0];if(d&&d.should){a.cancelable&&a.preventDefault();return}if(!d){var e=(g.current.shards||[]).map(bY).filter(Boolean).filter(function(b){return b.contains(a.target)});(e.length>0?h(a,e[0]):!g.current.noIsolation)&&a.cancelable&&a.preventDefault()}}},[]),j=q.useCallback(function(a,c,d,e){var f={name:a,delta:c,target:d,should:e,shadowParent:function(a){for(var b=null;null!==a;)a instanceof ShadowRoot&&(b=a.host,a=a.host),a=a.parentNode;return b}(d)};b.current.push(f),setTimeout(function(){b.current=b.current.filter(function(a){return a!==f})},1)},[]),k=q.useCallback(function(a){c.current=bW(a),d.current=void 0},[]),l=q.useCallback(function(b){j(b.type,bX(b),b.target,h(b,a.lockRef.current))},[]),m=q.useCallback(function(b){j(b.type,bW(b),b.target,h(b,a.lockRef.current))},[]);q.useEffect(function(){return b$.push(f),a.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:m}),document.addEventListener("wheel",i,!1),document.addEventListener("touchmove",i,!1),document.addEventListener("touchstart",k,!1),function(){b$=b$.filter(function(a){return a!==f}),document.removeEventListener("wheel",i,!1),document.removeEventListener("touchmove",i,!1),document.removeEventListener("touchstart",k,!1)}},[]);var n=a.removeScrollBar,o=a.inert;return q.createElement(q.Fragment,null,o?q.createElement(f,{styles:"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")}):null,n?q.createElement(bQ,{noRelative:a.noRelative,gapMode:a.gapMode}):null)},bD.useMedium(l),bG);var b0=q.forwardRef(function(a,b){return q.createElement(bF,bw({},a,{ref:b,sideCar:b_}))});b0.classNames=bF.classNames;var b1=["Enter"," "],b2=["ArrowUp","PageDown","End"],b3=["ArrowDown","PageUp","Home",...b2],b4={ltr:[...b1,"ArrowRight"],rtl:[...b1,"ArrowLeft"]},b5={ltr:["ArrowLeft"],rtl:["ArrowRight"]},b6="Menu",[b7,b8,b9]=(0,w.createCollection)(b6),[ca,cb]=(0,t.createContextScope)(b6,[b9,a4,bm.createRovingFocusGroupScope]),cc=a4(),cd=(0,bm.createRovingFocusGroupScope)(),[ce,cf]=ca(b6),[cg,ch]=ca(b6),ci=a=>{let{__scopeMenu:b,open:c=!1,children:d,dir:e,onOpenChange:f,modal:g=!0}=a,h=cc(b),[i,j]=q.useState(null),k=q.useRef(!1),l=(0,y.useCallbackRef)(f),m=(0,x.useDirection)(e);return q.useEffect(()=>{let a=()=>{k.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>k.current=!1;return document.addEventListener("keydown",a,{capture:!0}),()=>{document.removeEventListener("keydown",a,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),(0,o.jsx)(a7,{...h,children:(0,o.jsx)(ce,{scope:b,open:c,onOpenChange:l,content:i,onContentChange:j,children:(0,o.jsx)(cg,{scope:b,onClose:q.useCallback(()=>l(!1),[l]),isUsingKeyboardRef:k,dir:m,modal:g,children:d})})})};ci.displayName=b6;var cj=q.forwardRef((a,b)=>{let{__scopeMenu:c,...d}=a,e=cc(c);return(0,o.jsx)(a9,{...e,...d,ref:b})});cj.displayName="MenuAnchor";var ck="MenuPortal",[cl,cm]=ca(ck,{forceMount:void 0}),cn=a=>{let{__scopeMenu:b,forceMount:c,children:d,container:e}=a,f=cf(ck,b);return(0,o.jsx)(cl,{scope:b,forceMount:c,children:(0,o.jsx)(bl.Presence,{present:c||f.open,children:(0,o.jsx)(bk,{asChild:!0,container:e,children:d})})})};cn.displayName=ck;var co="MenuContent",[cp,cq]=ca(co),cr=q.forwardRef((a,b)=>{let c=cm(co,a.__scopeMenu),{forceMount:d=c.forceMount,...e}=a,f=cf(co,a.__scopeMenu),g=ch(co,a.__scopeMenu);return(0,o.jsx)(b7.Provider,{scope:a.__scopeMenu,children:(0,o.jsx)(bl.Presence,{present:d||f.open,children:(0,o.jsx)(b7.Slot,{scope:a.__scopeMenu,children:g.modal?(0,o.jsx)(cs,{...e,ref:b}):(0,o.jsx)(ct,{...e,ref:b})})})})}),cs=q.forwardRef((a,b)=>{let c=cf(co,a.__scopeMenu),d=q.useRef(null),e=(0,s.useComposedRefs)(b,d);return q.useEffect(()=>{let a=d.current;if(a)return bv(a)},[]),(0,o.jsx)(cv,{...a,ref:e,trapFocus:c.open,disableOutsidePointerEvents:c.open,disableOutsideScroll:!0,onFocusOutside:(0,r.composeEventHandlers)(a.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>c.onOpenChange(!1)})}),ct=q.forwardRef((a,b)=>{let c=cf(co,a.__scopeMenu);return(0,o.jsx)(cv,{...a,ref:b,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>c.onOpenChange(!1)})}),cu=((f=q.forwardRef((a,b)=>{let{children:c,...d}=a;if(q.isValidElement(c)){var e;let a,f,g=(e=c,(f=(a=Object.getOwnPropertyDescriptor(e.props,"ref")?.get)&&"isReactWarning"in a&&a.isReactWarning)?e.ref:(f=(a=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in a&&a.isReactWarning)?e.props.ref:e.props.ref||e.ref),h=function(a,b){let c={...b};for(let d in b){let e=a[d],f=b[d];/^on[A-Z]/.test(d)?e&&f?c[d]=(...a)=>{let b=f(...a);return e(...a),b}:e&&(c[d]=e):"style"===d?c[d]={...e,...f}:"className"===d&&(c[d]=[e,f].filter(Boolean).join(" "))}return{...a,...c}}(d,c.props);return c.type!==q.Fragment&&(h.ref=b?(0,s.composeRefs)(b,g):g),q.cloneElement(c,h)}return q.Children.count(c)>1?q.Children.only(null):null})).displayName="MenuContent.ScrollLock.SlotClone",c=f,(d=q.forwardRef((a,b)=>{let{children:d,...e}=a,f=q.Children.toArray(d),g=f.find(bo);if(g){let a=g.props.children,d=f.map(b=>b!==g?b:q.Children.count(a)>1?q.Children.only(null):q.isValidElement(a)?a.props.children:null);return(0,o.jsx)(c,{...e,ref:b,children:q.isValidElement(a)?q.cloneElement(a,void 0,d):null})}return(0,o.jsx)(c,{...e,ref:b,children:d})})).displayName="MenuContent.ScrollLock.Slot",d),cv=q.forwardRef((a,b)=>{let{__scopeMenu:c,loop:d=!1,trapFocus:e,onOpenAutoFocus:f,onCloseAutoFocus:g,disableOutsidePointerEvents:h,onEntryFocus:i,onEscapeKeyDown:j,onPointerDownOutside:k,onFocusOutside:l,onInteractOutside:m,onDismiss:n,disableOutsideScroll:p,...t}=a,u=cf(co,c),v=ch(co,c),w=cc(c),x=cd(c),y=b8(c),[z,A]=q.useState(null),C=q.useRef(null),D=(0,s.useComposedRefs)(b,C,u.onContentChange),G=q.useRef(0),H=q.useRef(""),I=q.useRef(0),K=q.useRef(null),L=q.useRef("right"),M=q.useRef(0),N=p?b0:q.Fragment;q.useEffect(()=>()=>window.clearTimeout(G.current),[]),q.useEffect(()=>{let a=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",a[0]??F()),document.body.insertAdjacentElement("beforeend",a[1]??F()),E++,()=>{1===E&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),E--}},[]);let O=q.useCallback(a=>{var b,c;return L.current===K.current?.side&&(b=a,!!(c=K.current?.area)&&function(a,b){let{x:c,y:d}=a,e=!1;for(let a=0,f=b.length-1;a<b.length;f=a++){let g=b[a],h=b[f],i=g.x,j=g.y,k=h.x,l=h.y;j>d!=l>d&&c<(k-i)*(d-j)/(l-j)+i&&(e=!e)}return e}({x:b.clientX,y:b.clientY},c))},[]);return(0,o.jsx)(cp,{scope:c,searchRef:H,onItemEnter:q.useCallback(a=>{O(a)&&a.preventDefault()},[O]),onItemLeave:q.useCallback(a=>{O(a)||(C.current?.focus(),A(null))},[O]),onTriggerLeave:q.useCallback(a=>{O(a)&&a.preventDefault()},[O]),pointerGraceTimerRef:I,onPointerGraceIntentChange:q.useCallback(a=>{K.current=a},[]),children:(0,o.jsx)(N,{...p?{as:cu,allowPinchZoom:!0}:void 0,children:(0,o.jsx)(J,{asChild:!0,trapped:e,onMountAutoFocus:(0,r.composeEventHandlers)(f,a=>{a.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:g,children:(0,o.jsx)(B,{asChild:!0,disableOutsidePointerEvents:h,onEscapeKeyDown:j,onPointerDownOutside:k,onFocusOutside:l,onInteractOutside:m,onDismiss:n,children:(0,o.jsx)(bm.Root,{asChild:!0,...x,dir:v.dir,orientation:"vertical",loop:d,currentTabStopId:z,onCurrentTabStopIdChange:A,onEntryFocus:(0,r.composeEventHandlers)(i,a=>{v.isUsingKeyboardRef.current||a.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,o.jsx)(bd,{role:"menu","aria-orientation":"vertical","data-state":cV(u.open),"data-radix-menu-content":"",dir:v.dir,...w,...t,ref:D,style:{outline:"none",...t.style},onKeyDown:(0,r.composeEventHandlers)(t.onKeyDown,a=>{let b=a.target.closest("[data-radix-menu-content]")===a.currentTarget,c=a.ctrlKey||a.altKey||a.metaKey,d=1===a.key.length;if(b){var e;let b,f,g,h,i,j;"Tab"===a.key&&a.preventDefault(),!c&&d&&(e=a.key,b=H.current+e,f=y().filter(a=>!a.disabled),g=document.activeElement,h=f.find(a=>a.ref.current===g)?.textValue,i=function(a,b,c){var d;let e=b.length>1&&Array.from(b).every(a=>a===b[0])?b[0]:b,f=c?a.indexOf(c):-1,g=(d=Math.max(f,0),a.map((b,c)=>a[(d+c)%a.length]));1===e.length&&(g=g.filter(a=>a!==c));let h=g.find(a=>a.toLowerCase().startsWith(e.toLowerCase()));return h!==c?h:void 0}(f.map(a=>a.textValue),b,h),j=f.find(a=>a.textValue===i)?.ref.current,function a(b){H.current=b,window.clearTimeout(G.current),""!==b&&(G.current=window.setTimeout(()=>a(""),1e3))}(b),j&&setTimeout(()=>j.focus()))}let f=C.current;if(a.target!==f||!b3.includes(a.key))return;a.preventDefault();let g=y().filter(a=>!a.disabled).map(a=>a.ref.current);b2.includes(a.key)&&g.reverse(),function(a){let b=document.activeElement;for(let c of a)if(c===b||(c.focus(),document.activeElement!==b))return}(g)}),onBlur:(0,r.composeEventHandlers)(a.onBlur,a=>{a.currentTarget.contains(a.target)||(window.clearTimeout(G.current),H.current="")}),onPointerMove:(0,r.composeEventHandlers)(a.onPointerMove,cY(a=>{let b=a.target,c=M.current!==a.clientX;a.currentTarget.contains(b)&&c&&(L.current=a.clientX>M.current?"right":"left",M.current=a.clientX)}))})})})})})})});cr.displayName=co;var cw=q.forwardRef((a,b)=>{let{__scopeMenu:c,...d}=a;return(0,o.jsx)(v.Primitive.div,{role:"group",...d,ref:b})});cw.displayName="MenuGroup";var cx=q.forwardRef((a,b)=>{let{__scopeMenu:c,...d}=a;return(0,o.jsx)(v.Primitive.div,{...d,ref:b})});cx.displayName="MenuLabel";var cy="MenuItem",cz="menu.itemSelect",cA=q.forwardRef((a,b)=>{let{disabled:c=!1,onSelect:d,...e}=a,f=q.useRef(null),g=ch(cy,a.__scopeMenu),h=cq(cy,a.__scopeMenu),i=(0,s.useComposedRefs)(b,f),j=q.useRef(!1);return(0,o.jsx)(cB,{...e,ref:i,disabled:c,onClick:(0,r.composeEventHandlers)(a.onClick,()=>{let a=f.current;if(!c&&a){let b=new CustomEvent(cz,{bubbles:!0,cancelable:!0});a.addEventListener(cz,a=>d?.(a),{once:!0}),(0,v.dispatchDiscreteCustomEvent)(a,b),b.defaultPrevented?j.current=!1:g.onClose()}}),onPointerDown:b=>{a.onPointerDown?.(b),j.current=!0},onPointerUp:(0,r.composeEventHandlers)(a.onPointerUp,a=>{j.current||a.currentTarget?.click()}),onKeyDown:(0,r.composeEventHandlers)(a.onKeyDown,a=>{let b=""!==h.searchRef.current;c||b&&" "===a.key||b1.includes(a.key)&&(a.currentTarget.click(),a.preventDefault())})})});cA.displayName=cy;var cB=q.forwardRef((a,b)=>{let{__scopeMenu:c,disabled:d=!1,textValue:e,...f}=a,g=cq(cy,c),h=cd(c),i=q.useRef(null),j=(0,s.useComposedRefs)(b,i),[k,l]=q.useState(!1),[m,n]=q.useState("");return q.useEffect(()=>{let a=i.current;a&&n((a.textContent??"").trim())},[f.children]),(0,o.jsx)(b7.ItemSlot,{scope:c,disabled:d,textValue:e??m,children:(0,o.jsx)(bm.Item,{asChild:!0,...h,focusable:!d,children:(0,o.jsx)(v.Primitive.div,{role:"menuitem","data-highlighted":k?"":void 0,"aria-disabled":d||void 0,"data-disabled":d?"":void 0,...f,ref:j,onPointerMove:(0,r.composeEventHandlers)(a.onPointerMove,cY(a=>{d?g.onItemLeave(a):(g.onItemEnter(a),a.defaultPrevented||a.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:(0,r.composeEventHandlers)(a.onPointerLeave,cY(a=>g.onItemLeave(a))),onFocus:(0,r.composeEventHandlers)(a.onFocus,()=>l(!0)),onBlur:(0,r.composeEventHandlers)(a.onBlur,()=>l(!1))})})})}),cC=q.forwardRef((a,b)=>{let{checked:c=!1,onCheckedChange:d,...e}=a;return(0,o.jsx)(cK,{scope:a.__scopeMenu,checked:c,children:(0,o.jsx)(cA,{role:"menuitemcheckbox","aria-checked":cW(c)?"mixed":c,...e,ref:b,"data-state":cX(c),onSelect:(0,r.composeEventHandlers)(e.onSelect,()=>d?.(!!cW(c)||!c),{checkForDefaultPrevented:!1})})})});cC.displayName="MenuCheckboxItem";var cD="MenuRadioGroup",[cE,cF]=ca(cD,{value:void 0,onValueChange:()=>{}}),cG=q.forwardRef((a,b)=>{let{value:c,onValueChange:d,...e}=a,f=(0,y.useCallbackRef)(d);return(0,o.jsx)(cE,{scope:a.__scopeMenu,value:c,onValueChange:f,children:(0,o.jsx)(cw,{...e,ref:b})})});cG.displayName=cD;var cH="MenuRadioItem",cI=q.forwardRef((a,b)=>{let{value:c,...d}=a,e=cF(cH,a.__scopeMenu),f=c===e.value;return(0,o.jsx)(cK,{scope:a.__scopeMenu,checked:f,children:(0,o.jsx)(cA,{role:"menuitemradio","aria-checked":f,...d,ref:b,"data-state":cX(f),onSelect:(0,r.composeEventHandlers)(d.onSelect,()=>e.onValueChange?.(c),{checkForDefaultPrevented:!1})})})});cI.displayName=cH;var cJ="MenuItemIndicator",[cK,cL]=ca(cJ,{checked:!1}),cM=q.forwardRef((a,b)=>{let{__scopeMenu:c,forceMount:d,...e}=a,f=cL(cJ,c);return(0,o.jsx)(bl.Presence,{present:d||cW(f.checked)||!0===f.checked,children:(0,o.jsx)(v.Primitive.span,{...e,ref:b,"data-state":cX(f.checked)})})});cM.displayName=cJ;var cN=q.forwardRef((a,b)=>{let{__scopeMenu:c,...d}=a;return(0,o.jsx)(v.Primitive.div,{role:"separator","aria-orientation":"horizontal",...d,ref:b})});cN.displayName="MenuSeparator";var cO=q.forwardRef((a,b)=>{let{__scopeMenu:c,...d}=a,e=cc(c);return(0,o.jsx)(bg,{...e,...d,ref:b})});cO.displayName="MenuArrow";var[cP,cQ]=ca("MenuSub"),cR="MenuSubTrigger",cS=q.forwardRef((a,b)=>{let c=cf(cR,a.__scopeMenu),d=ch(cR,a.__scopeMenu),e=cQ(cR,a.__scopeMenu),f=cq(cR,a.__scopeMenu),g=q.useRef(null),{pointerGraceTimerRef:h,onPointerGraceIntentChange:i}=f,j={__scopeMenu:a.__scopeMenu},k=q.useCallback(()=>{g.current&&window.clearTimeout(g.current),g.current=null},[]);return q.useEffect(()=>k,[k]),q.useEffect(()=>{let a=h.current;return()=>{window.clearTimeout(a),i(null)}},[h,i]),(0,o.jsx)(cj,{asChild:!0,...j,children:(0,o.jsx)(cB,{id:e.triggerId,"aria-haspopup":"menu","aria-expanded":c.open,"aria-controls":e.contentId,"data-state":cV(c.open),...a,ref:(0,s.composeRefs)(b,e.onTriggerChange),onClick:b=>{a.onClick?.(b),a.disabled||b.defaultPrevented||(b.currentTarget.focus(),c.open||c.onOpenChange(!0))},onPointerMove:(0,r.composeEventHandlers)(a.onPointerMove,cY(b=>{f.onItemEnter(b),!b.defaultPrevented&&(a.disabled||c.open||g.current||(f.onPointerGraceIntentChange(null),g.current=window.setTimeout(()=>{c.onOpenChange(!0),k()},100)))})),onPointerLeave:(0,r.composeEventHandlers)(a.onPointerLeave,cY(a=>{k();let b=c.content?.getBoundingClientRect();if(b){let d=c.content?.dataset.side,e="right"===d,g=b[e?"left":"right"],i=b[e?"right":"left"];f.onPointerGraceIntentChange({area:[{x:a.clientX+(e?-5:5),y:a.clientY},{x:g,y:b.top},{x:i,y:b.top},{x:i,y:b.bottom},{x:g,y:b.bottom}],side:d}),window.clearTimeout(h.current),h.current=window.setTimeout(()=>f.onPointerGraceIntentChange(null),300)}else{if(f.onTriggerLeave(a),a.defaultPrevented)return;f.onPointerGraceIntentChange(null)}})),onKeyDown:(0,r.composeEventHandlers)(a.onKeyDown,b=>{let e=""!==f.searchRef.current;a.disabled||e&&" "===b.key||b4[d.dir].includes(b.key)&&(c.onOpenChange(!0),c.content?.focus(),b.preventDefault())})})})});cS.displayName=cR;var cT="MenuSubContent",cU=q.forwardRef((a,b)=>{let c=cm(co,a.__scopeMenu),{forceMount:d=c.forceMount,...e}=a,f=cf(co,a.__scopeMenu),g=ch(co,a.__scopeMenu),h=cQ(cT,a.__scopeMenu),i=q.useRef(null),j=(0,s.useComposedRefs)(b,i);return(0,o.jsx)(b7.Provider,{scope:a.__scopeMenu,children:(0,o.jsx)(bl.Presence,{present:d||f.open,children:(0,o.jsx)(b7.Slot,{scope:a.__scopeMenu,children:(0,o.jsx)(cv,{id:h.contentId,"aria-labelledby":h.triggerId,...e,ref:j,align:"start",side:"rtl"===g.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:a=>{g.isUsingKeyboardRef.current&&i.current?.focus(),a.preventDefault()},onCloseAutoFocus:a=>a.preventDefault(),onFocusOutside:(0,r.composeEventHandlers)(a.onFocusOutside,a=>{a.target!==h.trigger&&f.onOpenChange(!1)}),onEscapeKeyDown:(0,r.composeEventHandlers)(a.onEscapeKeyDown,a=>{g.onClose(),a.preventDefault()}),onKeyDown:(0,r.composeEventHandlers)(a.onKeyDown,a=>{let b=a.currentTarget.contains(a.target),c=b5[g.dir].includes(a.key);b&&c&&(f.onOpenChange(!1),h.trigger?.focus(),a.preventDefault())})})})})})});function cV(a){return a?"open":"closed"}function cW(a){return"indeterminate"===a}function cX(a){return cW(a)?"indeterminate":a?"checked":"unchecked"}function cY(a){return b=>"mouse"===b.pointerType?a(b):void 0}cU.displayName=cT;var cZ="DropdownMenu",[c$,c_]=(0,t.createContextScope)(cZ,[cb]),c0=cb(),[c1,c2]=c$(cZ),c3=a=>{let{__scopeDropdownMenu:b,children:c,dir:d,open:e,defaultOpen:f,onOpenChange:g,modal:h=!0}=a,i=c0(b),j=q.useRef(null),[k,l]=(0,u.useControllableState)({prop:e,defaultProp:f??!1,onChange:g,caller:cZ});return(0,o.jsx)(c1,{scope:b,triggerId:(0,P.useId)(),triggerRef:j,contentId:(0,P.useId)(),open:k,onOpenChange:l,onOpenToggle:q.useCallback(()=>l(a=>!a),[l]),modal:h,children:(0,o.jsx)(ci,{...i,open:k,onOpenChange:l,dir:d,modal:h,children:c})})};c3.displayName=cZ;var c4="DropdownMenuTrigger",c5=q.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,disabled:d=!1,...e}=a,f=c2(c4,c),g=c0(c);return(0,o.jsx)(cj,{asChild:!0,...g,children:(0,o.jsx)(v.Primitive.button,{type:"button",id:f.triggerId,"aria-haspopup":"menu","aria-expanded":f.open,"aria-controls":f.open?f.contentId:void 0,"data-state":f.open?"open":"closed","data-disabled":d?"":void 0,disabled:d,...e,ref:(0,s.composeRefs)(b,f.triggerRef),onPointerDown:(0,r.composeEventHandlers)(a.onPointerDown,a=>{!d&&0===a.button&&!1===a.ctrlKey&&(f.onOpenToggle(),f.open||a.preventDefault())}),onKeyDown:(0,r.composeEventHandlers)(a.onKeyDown,a=>{!d&&(["Enter"," "].includes(a.key)&&f.onOpenToggle(),"ArrowDown"===a.key&&f.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});c5.displayName=c4;var c6=a=>{let{__scopeDropdownMenu:b,...c}=a,d=c0(b);return(0,o.jsx)(cn,{...d,...c})};c6.displayName="DropdownMenuPortal";var c7="DropdownMenuContent",c8=q.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=c2(c7,c),f=c0(c),g=q.useRef(!1);return(0,o.jsx)(cr,{id:e.contentId,"aria-labelledby":e.triggerId,...f,...d,ref:b,onCloseAutoFocus:(0,r.composeEventHandlers)(a.onCloseAutoFocus,a=>{g.current||e.triggerRef.current?.focus(),g.current=!1,a.preventDefault()}),onInteractOutside:(0,r.composeEventHandlers)(a.onInteractOutside,a=>{let b=a.detail.originalEvent,c=0===b.button&&!0===b.ctrlKey,d=2===b.button||c;(!e.modal||d)&&(g.current=!0)}),style:{...a.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});c8.displayName=c7,q.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=c0(c);return(0,o.jsx)(cw,{...e,...d,ref:b})}).displayName="DropdownMenuGroup",q.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=c0(c);return(0,o.jsx)(cx,{...e,...d,ref:b})}).displayName="DropdownMenuLabel";var c9=q.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=c0(c);return(0,o.jsx)(cA,{...e,...d,ref:b})});c9.displayName="DropdownMenuItem",q.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=c0(c);return(0,o.jsx)(cC,{...e,...d,ref:b})}).displayName="DropdownMenuCheckboxItem",q.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=c0(c);return(0,o.jsx)(cG,{...e,...d,ref:b})}).displayName="DropdownMenuRadioGroup",q.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=c0(c);return(0,o.jsx)(cI,{...e,...d,ref:b})}).displayName="DropdownMenuRadioItem",q.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=c0(c);return(0,o.jsx)(cM,{...e,...d,ref:b})}).displayName="DropdownMenuItemIndicator";var da=q.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=c0(c);return(0,o.jsx)(cN,{...e,...d,ref:b})});da.displayName="DropdownMenuSeparator",q.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=c0(c);return(0,o.jsx)(cO,{...e,...d,ref:b})}).displayName="DropdownMenuArrow",q.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=c0(c);return(0,o.jsx)(cS,{...e,...d,ref:b})}).displayName="DropdownMenuSubTrigger",q.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=c0(c);return(0,o.jsx)(cU,{...e,...d,ref:b,style:{...a.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}).displayName="DropdownMenuSubContent";var db=a.i(67299),dc={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},dd=q.default.createContext&&q.default.createContext(dc),de=["attr","size","title"];function df(){return(df=Object.assign.bind()).apply(null,arguments)}function dg(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function dh(a){for(var b=1;b<arguments.length;b++){var c=null!=arguments[b]?arguments[b]:{};b%2?dg(Object(c),!0).forEach(function(b){var d,e,f;d=a,e=b,f=c[b],(e=function(a){var b=function(a,b){if("object"!=typeof a||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=typeof d)return d;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}(a,"string");return"symbol"==typeof b?b:b+""}(e))in d?Object.defineProperty(d,e,{value:f,enumerable:!0,configurable:!0,writable:!0}):d[e]=f}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(c)):dg(Object(c)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(c,b))})}return a}function di(a){return b=>q.default.createElement(dj,df({attr:dh({},a.attr)},b),function a(b){return b&&b.map((b,c)=>q.default.createElement(b.tag,dh({key:c},b.attr),a(b.child)))}(a.child))}function dj(a){var b=b=>{var c,{attr:d,size:e,title:f}=a,g=function(a,b){if(null==a)return{};var c,d,e=function(a,b){if(null==a)return{};var c={};for(var d in a)if(({}).hasOwnProperty.call(a,d)){if(-1!==b.indexOf(d))continue;c[d]=a[d]}return c}(a,b);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(a);for(d=0;d<f.length;d++)c=f[d],-1===b.indexOf(c)&&({}).propertyIsEnumerable.call(a,c)&&(e[c]=a[c])}return e}(a,de),h=e||b.size||"1em";return b.className&&(c=b.className),a.className&&(c=(c?c+" ":"")+a.className),q.default.createElement("svg",df({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},b.attr,d,g,{className:c,style:dh(dh({color:a.color||b.color},b.style),a.style),height:h,width:h,xmlns:"http://www.w3.org/2000/svg"}),f&&q.default.createElement("title",null,f),a.children)};return void 0!==dd?q.default.createElement(dd.Consumer,null,a=>b(a)):b(dc)}var dk=a.i(70106);let dl=(0,dk.default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]),dm=(0,dk.default)("book-text",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["path",{d:"M8 11h8",key:"vwpz6n"}],["path",{d:"M8 7h6",key:"1f0q6e"}]]),dn=(0,dk.default)("building-2",[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]]),dp=(0,dk.default)("chevrons-right",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);var dq=a.i(33441),dr=a.i(5784),ds=a.i(5151);let dt=(0,dk.default)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);var du=a.i(96101),dv=a.i(34531);let dw=(0,dk.default)("folder-kanban",[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]]),dx=(0,dk.default)("github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]),dy=(0,dk.default)("hand",[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]]),dz=(0,dk.default)("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]);var dA=a.i(96221);let dB=(0,dk.default)("plug-zap",[["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m18 3-4 4h6l-4 4",key:"16psg9"}]]),dC=(0,dk.default)("refresh-ccw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]);var dD=a.i(87532);let dE=(0,dk.default)("sliders-horizontal",[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]),dF=(0,dk.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"}]]),dG=(0,dk.default)("volume-2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]),dH=(0,dk.default)("volume-x",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);var dI=a.i(33508),dJ=a.i(53603),dK=a.i(72865),dL=a.i(35757),dM=a.i(36177),dN=a.i(48171),dO=a.i(62586),dP=a.i(52806),dQ=a.i(5913);let dR=["pro","max","api"],dS=["chatgpt","api"],dT=["oauth","api"],dU=["oauth","api"];function dV(a,b,c){return"string"==typeof a&&b.includes(a)?a:c}function dW(a){let b=!a||"object"!=typeof a||Array.isArray(a)?{}:{...a},c=(0,db.getDefaultModelAccessPreferences)();return{claudeCode:dV(b.claudeCode,dR,c.claudeCode),codex:dV(b.codex,dS,c.codex),gemini:dV(b.gemini,dT,c.gemini),qwenCode:dV(b.qwenCode,dU,c.qwenCode)}}let dX=(0,dk.default)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);var dY=a.i(10948),dZ=a.i(6444);let d$=(0,dk.default)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);var d_=a.i(71541),d0=a.i(50415),d1=a.i(48079),d2=a.i(69630);function d3({projects:a,sessions:b,selectedProjectId:c,workspaceView:d,agentCount:e,onCreateWorkspace:f,onSelectProject:g,onSelectSession:h,onShowView:i}){let j=(0,q.useMemo)(()=>b.filter(a=>"archived"!==a.status),[b]),k=(0,q.useMemo)(()=>a.map(a=>{let b=j.filter(b=>b.projectId===a.id),c=b.filter(a=>"done"!==(0,d2.getAttentionLevel)(a)).length;return{id:a.id,description:a.description,branch:a.defaultBranch||"main",totalSessions:b.length,activeSessions:c}}).sort((a,b)=>b.activeSessions-a.activeSessions||b.totalSessions-a.totalSessions||a.id.localeCompare(b.id)),[a,j]),l=(0,q.useMemo)(()=>[...j].sort((a,b)=>new Date(b.lastActivityAt).getTime()-new Date(a.lastActivityAt).getTime()).slice(0,5),[j]),m=j.filter(a=>"done"!==(0,d2.getAttentionLevel)(a)).length,n=j.filter(a=>{let b=(0,d2.getAttentionLevel)(a);return"merge"===b||"respond"===b||"review"===b}).length,p=j.filter(a=>"merge"===(0,d2.getAttentionLevel)(a)).length,r=k.find(a=>a.id===c)??null,s=0===a.length&&0===j.length,t=[{label:"Projects",value:String(a.length),icon:dv.FolderGit2},{label:"Active sessions",value:String(m),icon:dZ.Layers3},{label:"Need attention",value:String(n),icon:d$},{label:"Merge ready",value:String(p),icon:dY.GitBranch}];return s?(0,o.jsx)("div",{className:"flex min-h-full flex-col bg-[linear-gradient(180deg,rgba(255,255,255,0.03),rgba(255,255,255,0))]",children:(0,o.jsxs)("div",{className:"mx-auto flex min-h-full w-full max-w-[1200px] flex-1 flex-col px-3 py-3 sm:px-4 sm:py-4",children:[(0,o.jsx)("div",{className:"mb-4 flex justify-end",children:(0,o.jsx)(d_.Button,{variant:"outline",size:"md",onClick:f,children:"Add workspace"})}),(0,o.jsx)("div",{className:"flex flex-1 items-center justify-center",children:(0,o.jsx)(d1.Card,{className:"w-full max-w-[880px] border-[var(--vk-border)] bg-[color:color-mix(in_srgb,var(--vk-bg-panel)_88%,transparent)]",children:(0,o.jsxs)(d1.CardContent,{className:"flex flex-col items-center px-6 py-12 text-center sm:px-10 sm:py-16",children:[(0,o.jsx)("span",{className:"inline-flex h-14 w-14 items-center justify-center rounded-[12px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] text-[var(--vk-text-normal)]",children:(0,o.jsx)(dw,{className:"h-6 w-6"})}),(0,o.jsx)("p",{className:"mt-5 text-[11px] uppercase tracking-[0.14em] text-[var(--vk-text-muted)]",children:"Frontend Control Surface"}),(0,o.jsx)("h1",{className:"mt-3 max-w-[14ch] text-[30px] font-semibold leading-[1.02] tracking-[-0.05em] text-[var(--vk-text-strong)] sm:text-[44px]",children:"Operate workspaces, sessions, and agents from one surface."}),(0,o.jsx)("p",{className:"mt-4 max-w-[560px] text-[14px] leading-7 text-[var(--vk-text-muted)] sm:text-[15px]",children:"Start by linking a workspace. Once a project is connected, this page will show active sessions, recent work, and project focus without sending you through an empty composer first."}),(0,o.jsxs)("div",{className:"mt-8 flex flex-wrap items-center justify-center gap-3",children:[(0,o.jsx)(d_.Button,{variant:"primary",size:"md",onClick:f,children:"Add workspace"}),(0,o.jsx)("div",{className:"inline-flex rounded-[6px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-3 py-2 text-[12px] text-[var(--vk-text-muted)]",children:"0 projects · 0 active sessions"})]})]})})})]})}):(0,o.jsx)("div",{className:"flex min-h-full flex-col border-b border-[var(--vk-border)] bg-[linear-gradient(180deg,rgba(255,255,255,0.03),rgba(255,255,255,0))]",children:(0,o.jsxs)("div",{className:"mx-auto flex min-h-full w-full max-w-[1440px] flex-1 flex-col gap-4 px-3 py-3 sm:px-4",children:[(0,o.jsxs)("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between",children:[(0,o.jsxs)("div",{className:"max-w-3xl",children:[(0,o.jsx)("p",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Frontend Control Surface"}),(0,o.jsx)("h1",{className:"mt-1 text-[24px] font-semibold leading-[1.05] tracking-[-0.04em] text-[var(--vk-text-strong)] sm:text-[30px]",children:"Operate workspaces, sessions, and agents from one surface."}),(0,o.jsx)("p",{className:"mt-2 max-w-2xl text-[13px] leading-6 text-[var(--vk-text-muted)]",children:"The current design language stays intact, but the workspace entrypoint now exposes status, recent activity, and project context without forcing you into a blank composer first."})]}),(0,o.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,o.jsxs)("div",{className:"inline-flex rounded-[6px] border border-[var(--vk-border)] p-1",children:[(0,o.jsx)("button",{type:"button",onClick:()=>i("chat"),className:`min-h-[32px] rounded-[4px] px-3 text-[13px] ${"chat"===d?"bg-[var(--vk-bg-active)] text-[var(--vk-text-strong)]":"text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]"}`,children:"Chat launchpad"}),(0,o.jsx)("button",{type:"button",onClick:()=>i("board"),className:`min-h-[32px] rounded-[4px] px-3 text-[13px] ${"board"===d?"bg-[var(--vk-bg-active)] text-[var(--vk-text-strong)]":"text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]"}`,children:"Board view"})]}),(0,o.jsx)(d_.Button,{variant:"outline",size:"md",onClick:f,children:"Add workspace"})]})]}),(0,o.jsx)("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:t.map(({label:a,value:b,icon:c})=>(0,o.jsx)(d1.Card,{className:"bg-[color:color-mix(in_srgb,var(--vk-bg-panel)_86%,transparent)]",children:(0,o.jsxs)(d1.CardContent,{className:"flex items-center gap-3 py-3",children:[(0,o.jsx)("span",{className:"inline-flex h-10 w-10 items-center justify-center rounded-[6px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] text-[var(--vk-text-normal)]",children:(0,o.jsx)(c,{className:"h-4 w-4"})}),(0,o.jsxs)("div",{children:[(0,o.jsx)("p",{className:"text-[11px] uppercase tracking-[0.08em] text-[var(--vk-text-muted)]",children:a}),(0,o.jsx)("p",{className:"mt-1 text-[22px] font-semibold text-[var(--vk-text-strong)]",children:b})]})]})},a))}),(0,o.jsxs)("div",{className:"grid flex-1 gap-3 xl:grid-cols-[1.35fr_0.95fr]",children:[(0,o.jsxs)(d1.Card,{className:"flex h-full min-h-[280px] flex-col",children:[(0,o.jsxs)(d1.CardHeader,{className:"justify-between",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("p",{className:"text-[14px] font-semibold text-[var(--vk-text-strong)]",children:"Recent sessions"}),(0,o.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Jump back into active work without hunting through the sidebar."})]}),(0,o.jsx)(d0.Badge,{variant:"outline",children:j.length})]}),(0,o.jsx)(d1.CardContent,{className:"flex-1 space-y-2",children:0===l.length?(0,o.jsx)("div",{className:"flex h-full min-h-[180px] items-center justify-center rounded-[6px] border border-dashed border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-4 text-center text-[13px] text-[var(--vk-text-muted)]",children:"No sessions yet. Create or open a workspace to start work."}):l.map(a=>{let b,c;return(0,o.jsxs)("button",{type:"button",onClick:()=>h(a.id),className:"flex w-full items-center gap-3 rounded-[6px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-3 py-3 text-left transition-colors hover:bg-[var(--vk-bg-hover)]",children:[(0,o.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)("p",{className:"truncate text-[14px] font-medium text-[var(--vk-text-strong)]",children:a.summary?.trim()||a.projectId}),(0,o.jsx)(d0.Badge,{variant:"merge"===(b=(0,d2.getAttentionLevel)(a))?"success":"review"===b||"respond"===b?"warning":"errored"===a.status||"killed"===a.status?"error":"outline",children:"merge"===(c=(0,d2.getAttentionLevel)(a))?"Ready":"respond"===c?"Needs input":"review"===c?"Review":"pending"===c?"Pending":"done"===c?"Done":"Running"})]}),(0,o.jsxs)("p",{className:"mt-1 truncate text-[12px] text-[var(--vk-text-muted)]",children:[a.projectId,a.branch?` \xb7 ${a.branch}`:"",a.issueId?` \xb7 ${a.issueId}`:""]})]}),(0,o.jsxs)("div",{className:"shrink-0 text-right",children:[(0,o.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:function(a){let b=Date.now()-new Date(a).getTime();if(!Number.isFinite(b)||b<6e4)return"Updated now";let c=Math.floor(b/6e4);if(c<60)return`Updated ${c}m ago`;let d=Math.floor(c/60);if(d<24)return`Updated ${d}h ago`;let e=Math.floor(d/24);return`Updated ${e}d ago`}(a.lastActivityAt)}),(0,o.jsx)(dX,{className:"ml-auto mt-2 h-4 w-4 text-[var(--vk-text-muted)]"})]})]},a.id)})})]}),(0,o.jsxs)(d1.Card,{className:"flex h-full min-h-[280px] flex-col",children:[(0,o.jsxs)(d1.CardHeader,{className:"justify-between",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("p",{className:"text-[14px] font-semibold text-[var(--vk-text-strong)]",children:"Project focus"}),(0,o.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:r?`Selected: ${r.id}`:"Select a project to scope new work."})]}),(0,o.jsxs)(d0.Badge,{variant:"outline",children:[e," agents"]})]}),(0,o.jsxs)(d1.CardContent,{className:"flex-1 space-y-2",children:[(0,o.jsxs)("button",{type:"button",onClick:()=>g(null),className:`flex w-full items-center justify-between rounded-[6px] border px-3 py-2 text-left ${null===c?"border-[var(--vk-border)] bg-[var(--vk-bg-hover)] text-[var(--vk-text-strong)]":"border-[var(--vk-border)] bg-[var(--vk-bg-main)] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,o.jsx)("span",{children:"All projects"}),(0,o.jsx)(d0.Badge,{variant:"outline",children:j.length})]}),0===k.length?(0,o.jsx)("div",{className:"flex h-full min-h-[180px] items-center justify-center rounded-[6px] border border-dashed border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-4 text-center text-[13px] text-[var(--vk-text-muted)]",children:"No configured projects yet."}):k.slice(0,6).map(a=>(0,o.jsxs)("button",{type:"button",onClick:()=>g(a.id),className:`flex w-full items-start justify-between gap-3 rounded-[6px] border px-3 py-2.5 text-left ${c===a.id?"border-[var(--vk-border)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] bg-[var(--vk-bg-main)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,o.jsxs)("div",{className:"min-w-0",children:[(0,o.jsx)("p",{className:"truncate text-[13px] font-medium text-[var(--vk-text-strong)]",children:a.id}),(0,o.jsx)("p",{className:"truncate text-[12px] text-[var(--vk-text-muted)]",children:a.description?.trim()||`Default branch: ${a.branch}`})]}),(0,o.jsxs)("div",{className:"shrink-0 text-right",children:[(0,o.jsxs)("p",{className:"text-[12px] text-[var(--vk-text-strong)]",children:[a.activeSessions," active"]}),(0,o.jsxs)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:[a.totalSessions," total"]})]})]},a.id)),r?(0,o.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-3 py-3",children:[(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)(dw,{className:"h-4 w-4 text-[var(--vk-text-muted)]"}),(0,o.jsx)("p",{className:"text-[13px] font-medium text-[var(--vk-text-strong)]",children:r.id})]}),(0,o.jsx)("p",{className:"mt-2 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:r.description?.trim()||"This project is ready to launch work from chat or board mode."})]}):null]})]})]})]})})}let d4=["codex","gemini","qwen-code","droid","claude-code","amp","opencode","github-copilot","cursor-cli","ccr"],d5="claude-code",d6={codex:"Codex",gemini:"Gemini","qwen-code":"Qwen Code",droid:"Droid","claude-code":"Claude Code",amp:"Amp",opencode:"Opencode","github-copilot":"Copilot","cursor-cli":"Cursor Agent",ccr:"CCR"},d7={"claude-code":"https://claude.ai/",codex:"https://chatgpt.com/codex",gemini:"https://aistudio.google.com/","qwen-code":"https://chat.qwen.ai/",opencode:"https://opencode.ai/","github-copilot":"https://github.com/settings/copilot"},d8=(0,p.default)(()=>a.A(60928).then(a=>a.SessionDetail),{loadableGenerated:{modules:[31437]},loading:()=>(0,o.jsx)("div",{className:"flex h-full items-center justify-center text-[13px] text-[var(--vk-text-muted)]",children:"Loading session..."})}),d9=(0,p.default)(()=>a.A(67645).then(a=>a.WorkspaceKanban),{loadableGenerated:{modules:[96933]},loading:()=>(0,o.jsx)("div",{className:"flex h-full items-center justify-center text-[13px] text-[var(--vk-text-muted)]",children:"Loading board..."})});function ea(a){let b=(0,dJ.normalizeAgentName)(a);return d6[b]?d6[b]:a.split(/[-_\s]+/g).filter(Boolean).map(a=>a[0]?.toUpperCase()+a.slice(1)).join(" ")}function eb(a){return a.taskRef?.trim()||a.id}function ec(a){let[b]=a.split(" - ");return(b??a).trim()}let ed=[{id:"general",label:"General",icon:dF,implemented:!0},{id:"remote_access",label:"Remote Access",icon:dE,implemented:!0},{id:"repositories",label:"Repositories",icon:dv.FolderGit2,implemented:!0},{id:"organization",label:"Organization Settings",icon:dn,implemented:!0},{id:"projects",label:"Projects",icon:dw,implemented:!1},{id:"agents",label:"Agents",icon:dl,implemented:!0},{id:"mcp",label:"MCP Servers",icon:dB,implemented:!1},{id:"preferences",label:"Preferences",icon:dE,implemented:!1}],ee=[{id:"preferences",label:"Preferences",icon:dE,implemented:!0},{id:"repositories",label:"Repository",icon:dv.FolderGit2,implemented:!0}],ef=[{id:"vscode",label:"VS Code"},{id:"vscode-insiders",label:"VS Code Insiders"},{id:"cursor",label:"Cursor"},{id:"windsurf",label:"Windsurf"},{id:"intellij-idea",label:"IntelliJ IDEA"},{id:"zed",label:"Zed"},{id:"xcode",label:"Xcode"},{id:"antigravity",label:"Antigravity"},{id:"custom",label:"Custom"}],eg=[{id:"obsidian",label:"Obsidian"},{id:"vscode",label:"VS Code"},{id:"notion",label:"Notion"},{id:"typora",label:"Typora"},{id:"logseq",label:"Logseq"},{id:"custom",label:"Custom"}],eh=[{id:"abstract-sound-1",label:"Abstract Sound 1"},{id:"abstract-sound-2",label:"Abstract Sound 2"},{id:"abstract-sound-3",label:"Abstract Sound 3"},{id:"abstract-sound-4",label:"Abstract Sound 4"},{id:"cow-mooing",label:"Cow Mooing"},{id:"phone-vibration",label:"Phone Vibration"},{id:"rooster",label:"Rooster"}];function ei(a){return!a||"object"!=typeof a||Array.isArray(a)?{}:{...a}}function ej(a,b){let c=ei(a),d=ei(c.notifications),e=d.soundFile,f="string"==typeof c.codingAgent&&c.codingAgent.trim().length>0?c.codingAgent.trim():b,g="string"==typeof c.ide&&c.ide.trim().length>0?c.ide.trim():"vscode",h="string"==typeof c.remoteSshHost&&c.remoteSshHost.trim().length>0?c.remoteSshHost.trim():"",i="string"==typeof c.remoteSshUser&&c.remoteSshUser.trim().length>0?c.remoteSshUser.trim():"",j="string"==typeof c.markdownEditor&&c.markdownEditor.trim().length>0?c.markdownEditor.trim():"obsidian";return{onboardingAcknowledged:!0===c.onboardingAcknowledged,codingAgent:f,ide:g,remoteSshHost:h,remoteSshUser:i,markdownEditor:j,modelAccess:dW(c.modelAccess),notifications:{soundEnabled:!1!==d.soundEnabled,soundFile:null===e?null:"string"==typeof e&&e.trim().length>0?e.trim():"abstract-sound-4"}}}function ek(a){return Array.isArray(a)?a.filter(a=>"string"==typeof a).map(a=>a.trim()).filter(Boolean).join("\n"):"string"!=typeof a?"":a.split(/[\n,]+/g).map(a=>a.trim()).filter(Boolean).join("\n")}function el(a,b){let c=ei(a),d=ei(c.trustedHeaders),e=ei(c.roles),f=ei(b),g=c.defaultRole,h=f.role;return{requireAuth:!0===c.requireAuth,defaultRole:"viewer"===g||"admin"===g||"operator"===g?g:"operator",trustedHeaders:{enabled:!0===d.enabled,provider:"generic"===d.provider?"generic":"cloudflare-access",emailHeader:"string"==typeof d.emailHeader&&d.emailHeader.trim().length>0?d.emailHeader.trim():"Cf-Access-Authenticated-User-Email",jwtHeader:"string"==typeof d.jwtHeader&&d.jwtHeader.trim().length>0?d.jwtHeader.trim():"Cf-Access-Jwt-Assertion",teamDomain:"string"==typeof d.teamDomain&&d.teamDomain.trim().length>0?d.teamDomain.trim():"",audience:"string"==typeof d.audience&&d.audience.trim().length>0?d.audience.trim():""},roles:{viewers:ek(e.viewers),operators:ek(e.operators),admins:ek(e.admins),viewerDomains:ek(e.viewerDomains),operatorDomains:ek(e.operatorDomains),adminDomains:ek(e.adminDomains)},current:{authenticated:!0===f.authenticated,role:"viewer"===h||"operator"===h||"admin"===h?h:null,email:"string"==typeof f.email&&f.email.trim().length>0?f.email.trim():null,provider:"string"==typeof f.provider&&f.provider.trim().length>0?f.provider.trim():null}}}function em(){return{catalogModel:"",customModel:"",reasoningEffort:""}}function en(a,b){return b[(0,dJ.normalizeAgentName)(a)]??null}function eo(a){if(!a)return[];let b=[],c=new Set;for(let d of Object.values(a.modelsByAccess))if(Array.isArray(d))for(let a of d)!a?.id||c.has(a.id)||(c.add(a.id),b.push(a));return b}function ep(a,b,c){let d=en(a,c),e=(0,db.resolveAgentModelAccess)(a,b),f=d&&e?d.modelsByAccess[e]??[]:[],g=(0,db.getAvailableAgentModels)(a,b),h=[],i=new Set;for(let a of[...f,...g,...eo(d)])!a?.id||i.has(a.id)||(i.add(a.id),h.push(a));return h}function eq(a,b,c,d){let e=function(a,b,c){if(!a)return[];let d=b?.trim();return d&&a.reasoningOptionsByModel?.[d]?.length?a.reasoningOptionsByModel[d]??[]:c?a.reasoningOptionsByAccess?.[c]??[]:[]}(en(a,c),d,(0,db.resolveAgentModelAccess)(a,b)),f=(0,db.getAvailableAgentReasoningEfforts)(a,b),g=[],h=new Set;for(let a of[...e,...f])!a?.id||h.has(a.id)||(h.add(a.id),g.push(a));return g}function er(a,b,c,d){return function(a,b,c){if(!a)return null;let d=b?.trim();return d&&a.defaultReasoningByModel?.[d]?a.defaultReasoningByModel[d]??null:c?a.defaultReasoningByAccess?.[c]??null:null}(en(a,c),d,(0,db.resolveAgentModelAccess)(a,b))??(0,db.getDefaultAgentReasoningEffort)(a,b)??""}function es(a,b,c,d,e){let f,g,h=d?.trim()??"",i=e?.trim().toLowerCase()??"",j=ep(a,b,c),k=(f=en(a,c),g=(0,db.resolveAgentModelAccess)(a,b),(f&&g?f.defaultModelByAccess[g]??null:null)??(0,db.getDefaultAgentModel)(a,b)??eo(f)[0]?.id??""),l=d=>{let e=eq(a,b,c,d);return i.length>0&&e.some(a=>a.id===i)?i:er(a,b,c,d)};return h.length>0?j.some(a=>a.id===h)?{catalogModel:h,customModel:"",reasoningEffort:l(h)}:{catalogModel:k,customModel:h,reasoningEffort:l(h)}:{catalogModel:k,customModel:"",reasoningEffort:l(k)}}function et(a){let b=a.customModel.trim();if(b.length>0)return b;let c=a.catalogModel.trim();return c.length>0?c:void 0}function eu(a){let b=a.reasoningEffort.trim().toLowerCase();return b.length>0?b:void 0}let ev="block h-4 w-4 shrink-0",ew="block h-4 w-4 shrink-0 object-contain",ex={vscode:{kind:"image",imageSrc:"/icons/ide/vscode-dark.svg",className:ew},"vscode-insiders":{kind:"image",imageSrc:"/icons/ide/vscode-insiders.svg",className:ew},cursor:{kind:"image",imageSrc:"/icons/ide/cursor-dark.svg",className:ew},windsurf:{kind:"image",imageSrc:"/icons/ide/windsurf-dark.svg",className:ew},"intellij-idea":{kind:"image",imageSrc:"/icons/ide/intellij.svg",className:ew},zed:{kind:"image",imageSrc:"/icons/ide/zed-dark.svg",className:ew},xcode:{kind:"image",imageSrc:"/icons/ide/xcode.svg",className:ew},antigravity:{kind:"image",imageSrc:"/icons/ide/antigravity-dark.svg",className:ew},custom:{kind:"icon",icon:dF,className:`${ew} text-[var(--vk-text-muted)]`}};function ey({editorId:a,label:b}){let c=ex[a];if(!c)return(0,o.jsx)(dF,{className:`${ew} text-[var(--vk-text-muted)]`});if("image"===c.kind)return(0,o.jsx)("img",{src:c.imageSrc,alt:`${b} logo`,className:c.className});let d=c.icon;return(0,o.jsx)(d,{className:c.className})}function ez(a){return JSON.stringify(a)}let eA={obsidian:{kind:"icon",icon:function(a){return di({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19.355 18.538a68.967 68.959 0 0 0 1.858-2.954.81.81 0 0 0-.062-.9c-.516-.685-1.504-2.075-2.042-3.362-.553-1.321-.636-3.375-.64-4.377a1.707 1.707 0 0 0-.358-1.05l-3.198-4.064a3.744 3.744 0 0 1-.076.543c-.106.503-.307 1.004-.536 1.5-.134.29-.29.6-.446.914l-.31.626c-.516 1.068-.997 2.227-1.132 3.59-.124 1.26.046 2.73.815 4.481.128.011.257.025.386.044a6.363 6.363 0 0 1 3.326 1.505c.916.79 1.744 1.922 2.415 3.5zM8.199 22.569c.073.012.146.02.22.02.78.024 2.095.092 3.16.29.87.16 2.593.64 4.01 1.055 1.083.316 2.198-.548 2.355-1.664.114-.814.33-1.735.725-2.58l-.01.005c-.67-1.87-1.522-3.078-2.416-3.849a5.295 5.295 0 0 0-2.778-1.257c-1.54-.216-2.952.19-3.84.45.532 2.218.368 4.829-1.425 7.531zM5.533 9.938c-.023.1-.056.197-.098.29L2.82 16.059a1.602 1.602 0 0 0 .313 1.772l4.116 4.24c2.103-3.101 1.796-6.02.836-8.3-.728-1.73-1.832-3.081-2.55-3.831zM9.32 14.01c.615-.183 1.606-.465 2.745-.534-.683-1.725-.848-3.233-.716-4.577.154-1.552.7-2.847 1.235-3.95.113-.235.223-.454.328-.664.149-.297.288-.577.419-.86.217-.47.379-.885.46-1.27.08-.38.08-.72-.014-1.043-.095-.325-.297-.675-.68-1.06a1.6 1.6 0 0 0-1.475.36l-4.95 4.452a1.602 1.602 0 0 0-.513.952l-.427 2.83c.672.59 2.328 2.316 3.335 4.711.09.21.175.43.253.653z"},child:[]}]})(a)},className:`${ev} text-[#8b5cf6]`},vscode:{kind:"icon",icon:function(a){return di({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M10.8634 13.9195C10.6568 14.0195 10.4233 14.0246 10.2185 13.9444C10.1162 13.9044 10.021 13.843 9.93997 13.7614L4.81616 9.06268L2.58433 10.7656C2.37657 10.9241 2.08597 10.9111 1.89301 10.7347L1.17719 10.0802C0.941168 9.86437 0.940898 9.49112 1.17661 9.27496L3.11213 7.5L1.17661 5.72504C0.940898 5.50888 0.941168 5.13563 1.17719 4.91982L1.89301 4.2653C2.08597 4.08887 2.37657 4.07588 2.58433 4.2344L4.81616 5.93732L9.93997 1.23855C9.97037 1.20797 10.0028 1.18023 10.0368 1.15538C10.2748 0.981429 10.5922 0.949298 10.8634 1.08048L13.5399 2.37507C13.8212 2.5111 14 2.79721 14 3.11109V8H10.752V4.53356L6.86419 7.5L10.752 10.4664V8H14V11.8889C14 12.2028 13.8211 12.4889 13.5399 12.625L10.8634 13.9195Z"},child:[]}]})(a)},className:`${ev} text-[#22a3f5]`},notion:{kind:"icon",icon:function(a){return di({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4.459 4.208c.746.606 1.026.56 2.428.466l13.215-.793c.28 0 .047-.28-.046-.326L17.86 1.968c-.42-.326-.981-.7-2.055-.607L3.01 2.295c-.466.046-.56.28-.374.466zm.793 3.08v13.904c0 .747.373 1.027 1.214.98l14.523-.84c.841-.046.935-.56.935-1.167V6.354c0-.606-.233-.933-.748-.887l-15.177.887c-.56.047-.747.327-.747.933zm14.337.745c.093.42 0 .84-.42.888l-.7.14v10.264c-.608.327-1.168.514-1.635.514-.748 0-.935-.234-1.495-.933l-4.577-7.186v6.952L12.21 19s0 .84-1.168.84l-3.222.186c-.093-.186 0-.653.327-.746l.84-.233V9.854L7.822 9.76c-.094-.42.14-1.026.793-1.073l3.456-.233 4.764 7.279v-6.44l-1.215-.139c-.093-.514.28-.887.747-.933zM1.936 1.035l13.31-.98c1.634-.14 2.055-.047 3.082.7l4.249 2.986c.7.513.934.653.934 1.213v16.378c0 1.026-.373 1.634-1.68 1.726l-15.458.934c-.98.047-1.448-.093-1.962-.747l-3.129-4.06c-.56-.747-.793-1.306-.793-1.96V2.667c0-.839.374-1.54 1.447-1.632z"},child:[]}]})(a)},className:`${ev} text-white`},logseq:{kind:"image",imageSrc:"/icons/editors/logseq.svg",className:`${ev} object-contain`},typora:{kind:"image",imageSrc:"/icons/editors/typora-32.png",className:`${ev} rounded-[3px] bg-white/90 p-[1px] object-contain`},custom:{kind:"icon",icon:dF,className:`${ev} text-[var(--vk-text-muted)]`}};function eB({editorId:a}){let b=eA[a];if(!b)return(0,o.jsx)(dm,{className:`${ev} text-[var(--vk-text-muted)]`});if("image"===b.kind)return(0,o.jsx)("img",{src:b.imageSrc,alt:"",className:b.className});let c=b.icon;return(0,o.jsx)(c,{className:b.className})}function eC({agent:a,modelAccess:b,runtimeModelCatalogs:c,selection:d,onChange:e,compact:f=!1}){let g,h;if(!(0,db.supportsAgentModelSelection)(a))return null;let i=(0,db.getAgentModelCatalog)(a),j=ep(a,b,c),k=eq(a,b,c,et(d)??d.catalogModel),l=(g=(0,db.getAgentModelCatalog)(a),h=(0,db.resolveAgentModelAccess)(a,b),g&&h?g.accessOptions.find(a=>a.id===h)?.label??null:null);return i?(0,o.jsxs)("div",{className:f?"grid gap-3 md:grid-cols-3":"space-y-3",children:[(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Model"}),(0,o.jsxs)("select",{value:d.catalogModel,disabled:0===j.length,onChange:f=>{let g=f.target.value,h=eq(a,b,c,g);e({...d,catalogModel:g,reasoningEffort:h.some(a=>a.id===d.reasoningEffort)?d.reasoningEffort:er(a,b,c,g)})},className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60",children:[0===j.length&&(0,o.jsx)("option",{value:"",children:"No runtime models detected"}),j.map(a=>(0,o.jsx)("option",{value:a.id,children:a.label},a.id))]}),(0,o.jsxs)("p",{className:"mt-1 text-[11px] text-[var(--vk-text-muted)]",children:[l?`Filtered for ${l}.`:"Filtered for your current access preference."," Leave custom override blank to use this selection."]})]}),k.length>0&&(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Reasoning Effort"}),(0,o.jsx)("select",{value:d.reasoningEffort,onChange:a=>{e({...d,reasoningEffort:a.target.value})},className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:k.map(a=>(0,o.jsx)("option",{value:a.id,children:a.label},a.id))}),(0,o.jsx)("p",{className:"mt-1 text-[11px] text-[var(--vk-text-muted)]",children:"Choose how much deliberate reasoning the CLI should use before it acts."})]}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Custom Model Override"}),(0,o.jsx)("input",{value:d.customModel,onChange:f=>{let g=f.target.value,h=g.trim()||d.catalogModel,i=eq(a,b,c,h);e({...d,customModel:g,reasoningEffort:i.some(a=>a.id===d.reasoningEffort)?d.reasoningEffort:er(a,b,c,h)})},placeholder:function(a,b){let c=en(a,b);if(c?.customModelPlaceholder.trim())return c.customModelPlaceholder;let d=(0,db.getAgentModelCatalog)(a)?.label??"agent";return`Enter exact ${d} model id`}(a,c),className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,o.jsx)("p",{className:"mt-1 text-[11px] text-[var(--vk-text-muted)]",children:"Optional. Use this to force an exact model id from the installed CLI when you want to override the detected list."})]})]}):null}function eD(){let[a,b]=(0,q.useState)(null),{sessions:c,error:d,refresh:e}=(0,dK.useSessions)(a),{projects:f,error:g,refresh:h}=(0,dL.useConfig)(),{agents:i}=(0,dM.useAgents)(),[j,k]=(0,q.useState)(null),[l,m]=(0,q.useState)(!0),[n,p]=(0,q.useState)(""),[r,s]=(0,q.useState)(""),[t,u]=(0,q.useState)(em()),[v,w]=(0,q.useState)(!1),[x,y]=(0,q.useState)(null),[z,A]=(0,q.useState)(!1),[B,C]=(0,q.useState)(!1),[D,E]=(0,q.useState)(null),[F,G]=(0,q.useState)("chat"),[H,I]=(0,q.useState)(null),[J,K]=(0,q.useState)(!0),[L,M]=(0,q.useState)(!1),[N,O]=(0,q.useState)(null),[P,Q]=(0,q.useState)(!1),[R,S]=(0,q.useState)(!1),T=x??g??d??N;(0,q.useEffect)(()=>{},[]),(0,q.useEffect)(()=>{if(0===f.length){null!==a&&b(null);return}a&&f.some(b=>b.id===a)||b(f[0]?.id??null)},[f,a]),(0,q.useEffect)(()=>{j&&(c.some(a=>a.id===j)||k(null))},[c,j]);let U=(0,q.useMemo)(()=>c.find(a=>a.id===j)??null,[c,j]),V=(0,q.useMemo)(()=>f.find(b=>b.id===a)??null,[f,a]),W=(0,q.useMemo)(()=>U?[U.projectId,U.branch].filter(Boolean).join(" · "):V?[V.id,V.defaultBranch||"main"].filter(Boolean).join(" · "):"All Projects",[V,U]),X=(0,q.useMemo)(()=>{let a=Array.isArray(i)?i:[],b=new Set;for(let c of a)c.name&&b.add(c.name);for(let a of f)a.agent&&b.add(a.agent);return H?.codingAgent&&b.add(H.codingAgent),r&&b.add(r),0===b.size&&b.add(H?.codingAgent||d5),[...b]},[i,H?.codingAgent,f,r]),Y=(0,q.useMemo)(()=>{let a={};for(let b of Array.isArray(i)?i:[])b.name&&(a[(0,dJ.normalizeAgentName)(b.name)]={name:b.name,ready:!0===b.ready,installed:!1!==b.installed,configured:!1!==b.configured,homepage:"string"==typeof b.homepage?b.homepage:null,description:"string"==typeof b.description?b.description:null});return a},[i]),Z=(0,q.useMemo)(()=>{let a={};for(let b of Array.isArray(i)?i:[])b.name&&b.runtimeModelCatalog&&(a[(0,dJ.normalizeAgentName)(b.name)]=b.runtimeModelCatalog);return a},[i]),$=(0,q.useCallback)(a=>{let b=(0,dJ.normalizeAgentName)(a);Y[b]?.homepage||d7[b]},[Y]);async function _(a,b){M(!0),O(null);try{let c=await fetch("/api/preferences",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),d=await c.json().catch(()=>null);if(!c.ok)throw Error(d?.error??`Failed to save preferences: ${c.status}`);let e=ej(d?.preferences,a.codingAgent||d5);return I(e),s(e.codingAgent),b?.closeDialog!==!1&&Q(!1),!0}catch(a){return O(a instanceof Error?a.message:"Failed to save preferences"),!1}finally{M(!1)}}(0,q.useEffect)(()=>{let a=!1;return async function(){K(!0);try{let b=await fetch("/api/preferences"),c=await b.json().catch(()=>null);if(!b.ok)throw Error(c?.error??`Failed to load preferences: ${b.status}`);if(a)return;let d=ej(c?.preferences,d5);I(d),O(null)}catch(b){if(a)return;I(ej(null,d5)),O(b instanceof Error?b.message:"Failed to load preferences")}finally{a||K(!1)}}(),()=>{a=!0}},[]),(0,q.useEffect)(()=>{H&&(r||s(H.codingAgent))},[H,r]),(0,q.useEffect)(()=>{J||H&&(H.onboardingAcknowledged||Q(!0))},[H,J]),(0,q.useEffect)(()=>{if(0!==X.length&&(!r||!X.includes(r))){let a=H?.codingAgent||d5;s(X.includes(a)?a:X[0]??d5)}},[X,H?.codingAgent,r]),(0,q.useEffect)(()=>{let a=r||V?.agent||H?.codingAgent||d5,b=V&&(0,dJ.normalizeAgentName)(V.agent)===(0,dJ.normalizeAgentName)(a)?V.agentModel:null,c=V&&(0,dJ.normalizeAgentName)(V.agent)===(0,dJ.normalizeAgentName)(a)?V.agentReasoningEffort:null;u(es(a,H?.modelAccess??dW(null),Z,b,c))},[H?.modelAccess,H?.codingAgent,Z,r,V]);let aa=(0,q.useCallback)(()=>m(a=>!a),[]),ab=(0,q.useCallback)(()=>{},[]),ac=(0,q.useCallback)(()=>{m(!0)},[]),ad=(0,q.useCallback)(()=>{E(null),A(!0),ac()},[ac]);(0,q.useEffect)(()=>{R&&!P&&(S(!1),ad())},[R,P]);let ae=(0,q.useCallback)(async b=>{let c=n.trim();if(!c)return;let d=et(t),g=eu(t),h=b?.projectId??a??f[0]?.id;if(!h)return void y("No project is configured in conductor.yaml");let i=r||d5,j=Y[(0,dJ.normalizeAgentName)(i)]??null;if(j&&!j.ready){y(j.installed?`${ea(i)} is not ready yet. Finish setup or authentication and try again.`:`${ea(i)} is not installed on this machine yet. Open setup and try again.`),$(i);return}w(!0),y(null);try{let a=await fetch("/api/spawn",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:h,prompt:c,...b?.issueId?.trim()?{issueId:b.issueId.trim()}:{},agent:i,...b?.branch?{branch:b.branch}:{},...b?.baseBranch?{baseBranch:b.baseBranch}:{},..."boolean"==typeof b?.useWorktree?{useWorktree:b.useWorktree}:{},...b?.permissionMode?{permissionMode:b.permissionMode}:{},...d?{model:d}:{},...g?{reasoningEffort:g}:{}})}),f=await a.json().catch(()=>null);if(!a.ok)throw Error(f?.error??`Failed to create workspace: ${a.status}`);if(!f?.session?.id)throw Error("Session created but response is missing session id");p(""),G("chat"),ac(),await e(),k(f.session.id)}catch(a){y(a instanceof Error?a.message:"Failed to create workspace")}finally{w(!1)}},[Y,t,$,f,n,e,r,a,ac]),af=(0,q.useCallback)(async a=>{let b=await fetch(`/api/sessions/${encodeURIComponent(a)}/archive`,{method:"POST"}),c=await b.json().catch(()=>null);if(404===b.status&&(b=await fetch(`/api/sessions/${encodeURIComponent(a)}/actions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"archive"})}),c=await b.json().catch(()=>null)),!b.ok)throw Error(c?.error??`Failed to archive session: ${b.status}`);j===a&&k(null),await e()},[e,j]),ag=(0,q.useCallback)(async a=>{C(!0),E(null);try{let c=await fetch("/api/workspaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),d=await c.json().catch(()=>null);if(!c.ok)throw Error(d?.error??`Failed to add workspace: ${c.status}`);let e=d?.project?.id;if(!e)throw Error("Workspace created but response is missing project id");await h(),b(e),k(null),p(""),ac(),A(!1)}catch(a){E(a instanceof Error?a.message:"Failed to add workspace")}finally{C(!1)}},[h,ac]),ah=!J&&!!H&&!H.onboardingAcknowledged,ai=H??ej(null,r||d5),aj=r||ai.codingAgent||d5,ak=(0,q.useCallback)(a=>{b(a),k(null),s(H?.codingAgent||d5),ab()},[ab,H?.codingAgent]),al=(0,q.useCallback)(a=>{k(a),ab()},[ab]),am=(0,q.useCallback)(()=>{Q(!0)},[]),an=(0,q.useCallback)(()=>{B||A(!1)},[B]),ao=(0,q.useCallback)(()=>{L||ah||(Q(!1),O(null))},[ah,L]),ap=(0,q.useCallback)(async a=>{let b=encodeURIComponent(a),c=await fetch(`/api/repositories/${b}`,{method:"DELETE"});(404===c.status||405===c.status)&&(c=await fetch(`/api/repositories?id=${b}`,{method:"DELETE"}));let d=await c.json().catch(()=>null);if(!c.ok)throw Error(d?.error??`Failed to unlink project (${c.status})`);await h()},[h]),aq=(0,q.useMemo)(()=>(0,o.jsx)(dQ.WorkspaceSidebarPanel,{orgLabel:"conductor-oss",projects:f,selectedProjectId:a,onSelectProject:ak,onUnlinkProject:ap,sessions:c,selectedSessionId:j,onSelectSession:al,onArchiveSession:af,onCreateWorkspace:ad}),[c,af,ak,al,ap,ad,f,a,j]),ar=(0,q.useMemo)(()=>"board"===F?(0,o.jsx)(d9,{projectId:a,defaultAgent:aj,agentOptions:X}):(0,o.jsx)(eG,{prompt:n,setPrompt:p,selectedAgent:aj,setSelectedAgent:s,agentStates:Y,modelSelection:t,setModelSelection:u,modelAccess:ai.modelAccess,runtimeModelCatalogs:Z,agentOptions:X,projects:f,selectedProjectId:a,onSelectProject:b,projectLabel:a??"All projects",hasProject:f.length>0,creating:v,error:T,onOpenAddWorkspace:ad,onOpenAgentSetup:$,onCreate:ae}),[X,Y,v,ae,t,$,ad,f,n,aj,ai.modelAccess,Z,a,p,T,F]),as=(0,q.useMemo)(()=>j?(0,o.jsx)(d8,{sessionId:j}):null!==a?(0,o.jsx)("div",{className:"min-h-0 flex-1 overflow-hidden",children:ar}):(0,o.jsx)("div",{className:"min-h-0 flex-1 overflow-auto",children:(0,o.jsx)(d3,{projects:f,sessions:c,selectedProjectId:a,workspaceView:F,agentCount:X.length,onCreateWorkspace:ad,onSelectProject:ak,onSelectSession:al,onShowView:G})}),[c,j,ar,ak,al,ad,f,a,F,X.length]);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(dN.AppShell,{sidebarOpen:l,onToggleSidebar:aa,sidebar:aq,children:[(0,o.jsx)(dO.TopBar,{title:W,onOpenPreferences:am}),(0,o.jsx)("div",{className:"min-h-0 flex-1 overflow-hidden",children:as})]}),z?(0,o.jsx)(eE,{open:z,onClose:an,onCreate:ag,creating:B,error:D,defaultAgent:aj,agentOptions:X}):null,P||ah?(0,o.jsx)(eI,{open:P,mode:ah?"onboarding":"settings",creating:L,error:N,current:ai,projectCount:f.length,agentOptions:X,runtimeModelCatalogs:Z,onRepositoriesChanged:h,onOnboardingComplete:({needsProject:a})=>{a&&S(!0)},onClose:ao,onSave:_}):null]})}function eE({open:a,onClose:b,onCreate:c,creating:d,error:e,defaultAgent:f,agentOptions:g}){let[h,i]=(0,q.useState)("git"),[j,k]=(0,q.useState)(""),[l,m]=(0,q.useState)(""),[n,p]=(0,q.useState)(""),[r,s]=(0,q.useState)("main"),[t,u]=(0,q.useState)(f),[v,w]=(0,q.useState)(!0),[x,y]=(0,q.useState)(!0),[z,A]=(0,q.useState)([]),[B,C]=(0,q.useState)(!1),[D,E]=(0,q.useState)(null),[F,G]=(0,q.useState)(""),[H,I]=(0,q.useState)(""),[J,K]=(0,q.useState)(!1),[L,M]=(0,q.useState)("local"),[N,O]=(0,q.useState)([]),[P,Q]=(0,q.useState)(!1),[R,S]=(0,q.useState)(null);(0,q.useEffect)(()=>{a&&(i("git"),k(""),m(""),p(""),s("main"),y(!0),w(!0),u(f),A([]),E(null),G(""),I(""),O([]),S(null),Q(!1),K(!1),M("local"))},[f,a]),(0,q.useEffect)(()=>{!a||"local"!==h||n.trim().length>0||(M("local"),K(!0))},[h,a,n]);let T=(0,q.useMemo)(()=>{if(0===F.trim().length)return z;let a=F.trim().toLowerCase();return z.filter(b=>b.fullName.toLowerCase().includes(a)||b.name.toLowerCase().includes(a)||b.defaultBranch.toLowerCase().includes(a))},[F,z]),U=(0,q.useMemo)(()=>{let a=[...new Set(g)];0===a.length&&a.push(f||d5);let b=new Map(d4.map((a,b)=>[a,b]));return a.sort((a,c)=>{let d=b.get((0,dJ.normalizeAgentName)(a))??Number.MAX_SAFE_INTEGER,e=b.get((0,dJ.normalizeAgentName)(c))??Number.MAX_SAFE_INTEGER;return d!==e?d-e:ea(a).localeCompare(ea(c))})},[g,f]);(0,q.useEffect)(()=>{U.includes(t)||u(U[0]??d5)},[t,U]);let V=async()=>{C(!0),E(null);try{let a=F.trim(),b=a.length>0?`?q=${encodeURIComponent(a)}`:"",c=await fetch(`/api/github/repos${b}`),d=await c.json().catch(()=>null);if(!c.ok)throw Error(d?.error??`Failed to load GitHub repositories (${c.status})`);A(Array.isArray(d?.repos)?d.repos:[])}catch(a){A([]),E(a instanceof Error?a.message:"Failed to load GitHub repositories")}finally{C(!1)}},W=async a=>{let b=a?.gitUrl??("git"===h?l.trim():""),c=a?.path??("local"===h?n.trim():"");if(0===b.length&&0===c.length)return void S("git"===h?"Enter a Git URL first.":"Select a local repository path first.");Q(!0),S(null);try{let a=new URLSearchParams;b.length>0&&a.set("gitUrl",b),c.length>0&&a.set("path",c);let d=await fetch(`/api/workspaces/branches?${a.toString()}`),e=await d.json().catch(()=>null);if(!d.ok)throw Error(e?.error??`Failed to load branches (${d.status})`);let f=Array.isArray(e?.branches)?e.branches.filter(a=>"string"==typeof a&&a.trim().length>0):[];O(f);let g="string"==typeof e?.defaultBranch&&e.defaultBranch.trim().length>0?e.defaultBranch.trim():f[0]??null;g&&(0===r.trim().length||!f.includes(r))&&s(g)}catch(a){O([]),S(a instanceof Error?a.message:"Failed to load branches")}finally{Q(!1)}},X=async a=>{I(a);let b=z.find(b=>b.httpsUrl===a);b&&(m(b.httpsUrl),s(b.defaultBranch||"main"),0===j.trim().length&&k(b.name.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64)||j),await W({gitUrl:b.httpsUrl}))},Y=a=>{M(a),K(!0)};if(!a)return null;let Z="git"===h?l.trim().length>0&&r.trim().length>0:n.trim().length>0&&r.trim().length>0;async function $(a){if(a.preventDefault(),!Z||d)return;let b="git"===h?{mode:h,projectId:j.trim()||void 0,agent:t,defaultBranch:r.trim(),useWorktree:v,gitUrl:l.trim(),path:n.trim()||void 0}:{mode:h,projectId:j.trim()||void 0,agent:t,defaultBranch:r.trim(),useWorktree:v,path:n.trim(),initializeGit:x};await c(b)}return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{className:"fixed inset-0 z-[80] flex items-start justify-center overflow-y-auto bg-black/65 px-3 py-3 sm:items-center sm:py-0",onClick:()=>{d||J||b()},role:"presentation",children:(0,o.jsxs)("form",{onSubmit:$,onClick:a=>a.stopPropagation(),className:"flex max-h-[calc(100dvh-1.5rem)] w-full max-w-[760px] flex-col overflow-hidden rounded-[6px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] shadow-[0_24px_80px_rgba(0,0,0,0.55)]",children:[(0,o.jsxs)("header",{className:"flex items-center border-b border-[var(--vk-border)] px-4 py-3",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("h2",{className:"text-[18px] leading-[22px] text-[var(--vk-text-strong)]",children:"Add Workspace"}),(0,o.jsx)("p",{className:"pt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Select a repository with a folder picker, then choose the target branch."})]}),(0,o.jsx)("button",{type:"button",onClick:b,disabled:d,"aria-label":"Close dialog",className:"ml-auto inline-flex h-8 w-8 items-center justify-center rounded-[4px] text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:(0,o.jsx)(dI.X,{className:"h-4 w-4"})})]}),(0,o.jsxs)("div",{className:"min-h-0 flex-1 space-y-4 overflow-y-auto px-4 py-4",children:[(0,o.jsxs)("div",{className:"inline-flex rounded-[4px] border border-[var(--vk-border)] p-1",children:[(0,o.jsx)("button",{type:"button",onClick:()=>i("git"),className:`rounded-[3px] px-3 py-1.5 text-[13px] ${"git"===h?"bg-[var(--vk-bg-active)] text-[var(--vk-text-strong)]":"text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]"}`,children:"Git Repository"}),(0,o.jsx)("button",{type:"button",onClick:()=>i("local"),className:`rounded-[3px] px-3 py-1.5 text-[13px] ${"local"===h?"bg-[var(--vk-bg-active)] text-[var(--vk-text-strong)]":"text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]"}`,children:"Local Folder"})]}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Project ID (optional)"}),(0,o.jsx)("input",{value:j,onChange:a=>k(a.target.value),placeholder:"auto-derived from repo/folder",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),"git"===h?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:"rounded-[4px] border border-[var(--vk-border)] p-3",children:[(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)(dx,{className:"h-4 w-4 text-[var(--vk-text-muted)]"}),(0,o.jsx)("span",{className:"text-[12px] font-medium text-[var(--vk-text-normal)]",children:"GitHub Integration"})]}),(0,o.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[(0,o.jsx)("button",{type:"button",onClick:V,disabled:B,className:"inline-flex h-8 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:B?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(dA.Loader2,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Loading repos..."]}):"Load My GitHub Repositories"}),(0,o.jsxs)("div",{className:"relative min-w-[220px] flex-1",children:[(0,o.jsx)(dD.Search,{className:"pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--vk-text-muted)]"}),(0,o.jsx)("input",{value:F,onChange:a=>G(a.target.value),placeholder:"Filter repos...",className:"h-8 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent pl-7 pr-2 text-[12px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]})]}),T.length>0&&(0,o.jsxs)("label",{className:"mt-2 block",children:[(0,o.jsx)("span",{className:"mb-1 block text-[11px] text-[var(--vk-text-muted)]",children:"Choose repository"}),(0,o.jsxs)("select",{value:H,onChange:a=>{X(a.target.value)},className:"h-8 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[12px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:[(0,o.jsx)("option",{value:"",children:"Select a GitHub repo..."}),T.map(a=>(0,o.jsxs)("option",{value:a.httpsUrl,children:[a.fullName," (",a.defaultBranch,")"]},a.httpsUrl))]})]}),D&&(0,o.jsx)("p",{className:"mt-2 text-[11px] text-[var(--vk-red)]",children:D})]}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Git URL"}),(0,o.jsx)("input",{value:l,onChange:a=>m(a.target.value),placeholder:"https://github.com/org/repo.git",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Local Path (optional, clone target)"}),(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)("input",{value:n,readOnly:!0,onClick:()=>Y("clone"),placeholder:"Use Browse to choose a clone target folder",className:"h-9 w-full cursor-pointer rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,o.jsx)("button",{type:"button",onClick:()=>Y("clone"),className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",title:"Browse folders",children:(0,o.jsx)(du.FolderOpen,{className:"h-4 w-4"})})]})]})]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Local Path"}),(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)("input",{value:n,readOnly:!0,onClick:()=>Y("local"),placeholder:"Use Browse to select a repository folder",className:"h-9 w-full cursor-pointer rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,o.jsx)("button",{type:"button",onClick:()=>Y("local"),className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",title:"Browse folders",children:(0,o.jsx)(du.FolderOpen,{className:"h-4 w-4"})})]})]}),(0,o.jsxs)("label",{className:"flex items-center gap-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,o.jsx)("input",{type:"checkbox",checked:x,onChange:a=>y(a.target.checked),className:"h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,o.jsx)("span",{children:"Initialize git if this folder is non-git"})]})]}),(0,o.jsxs)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:[(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Default Branch"}),(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)("input",{value:r,onChange:a=>s(a.target.value),placeholder:"main",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,o.jsx)("button",{type:"button",onClick:()=>{W()},disabled:P,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",title:"Detect branches",children:P?(0,o.jsx)(dA.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,o.jsx)(dC,{className:"h-3.5 w-3.5"})})]}),N.length>0&&(0,o.jsx)("select",{value:r,onChange:a=>s(a.target.value),className:"mt-2 h-8 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[12px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:N.map(a=>(0,o.jsx)("option",{value:a,children:a},a))}),R&&(0,o.jsx)("p",{className:"mt-1 text-[11px] text-[var(--vk-red)]",children:R})]}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Agent"}),(0,o.jsx)("select",{value:t,onChange:a=>u(a.target.value),className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:U.map(a=>(0,o.jsx)("option",{value:a,className:"bg-[var(--vk-bg-panel)] text-[var(--vk-text-normal)]",children:ea(a)},a))})]})]}),(0,o.jsxs)("label",{className:"flex items-start gap-2 rounded-[4px] border border-[var(--vk-border)] px-2 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,o.jsx)("input",{type:"checkbox",checked:v,onChange:a=>w(a.target.checked),className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,o.jsxs)("span",{children:["Use worktree isolation",(0,o.jsx)("span",{className:"block text-[11px] text-[var(--vk-text-muted)]",children:"If unchecked, sessions run directly on the selected branch in the local repo."})]})]}),e&&(0,o.jsx)("p",{className:"text-[12px] text-[var(--vk-red)]",children:e})]}),(0,o.jsxs)("footer",{className:"flex flex-wrap items-center justify-end gap-2 border-t border-[var(--vk-border)] px-4 py-3",children:[(0,o.jsx)("button",{type:"button",onClick:b,disabled:d,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Cancel"}),(0,o.jsx)("button",{type:"submit",disabled:!Z||d,className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:d?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(dA.Loader2,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Adding..."]}):"Add Workspace"})]})]})}),(0,o.jsx)(eF,{open:J,initialPath:n,title:"local"===L?"Select Local Repository":"Select Clone Target Folder",description:"local"===L?"Choose the local repository folder.":"Choose where the git repository should be cloned.",onClose:()=>K(!1),onSelect:a=>{K(!1),a&&(p(a),("local"===h||"local"===L)&&W({path:a}))}})]})}function eF({open:a,initialPath:b,title:c,description:d,onClose:e,onSelect:f}){let[g,h]=(0,q.useState)(""),[i,j]=(0,q.useState)(b??""),[k,l]=(0,q.useState)([]),[m,n]=(0,q.useState)(""),[p,r]=(0,q.useState)(!1),[s,t]=(0,q.useState)(null),[u,v]=(0,q.useState)(!1);(0,q.useEffect)(()=>{if(!a)return;n(""),j(b??"");let c=b&&b.trim().length>0?b.trim():void 0,d=c?`?path=${encodeURIComponent(c)}`:"";r(!0),t(null),fetch(`/api/filesystem/directory${d}`).then(async a=>{let b=await a.json().catch(()=>null);if(!a.ok)throw Error(b?.error??`Failed to load directory (${a.status})`);h("string"==typeof b?.currentPath?b.currentPath:""),l(Array.isArray(b?.entries)?b.entries:[])}).catch(a=>{t(a instanceof Error?a.message:"Failed to load directory"),l([])}).finally(()=>{r(!1)})},[b,a]);let w=(0,q.useMemo)(()=>{if(0===m.trim().length)return k;let a=m.trim().toLowerCase();return k.filter(b=>b.name.toLowerCase().includes(a))},[k,m]),x=async a=>{r(!0),t(null);try{let b=a&&a.trim().length>0?`?path=${encodeURIComponent(a.trim())}`:"",c=await fetch(`/api/filesystem/directory${b}`),d=await c.json().catch(()=>null);if(!c.ok)throw Error(d?.error??`Failed to load directory (${c.status})`);let e="string"==typeof d?.currentPath?d.currentPath:"";h(e),l(Array.isArray(d?.entries)?d.entries:[]),j(e)}catch(a){t(a instanceof Error?a.message:"Failed to load directory"),l([])}finally{r(!1)}},y=async()=>{v(!0);try{let a=await fetch("/api/filesystem/pick-directory",{method:"POST"}),b=await a.json().catch(()=>null);if(!b||b.cancelled||!b.path)return;j(b.path),x(b.path)}catch{}finally{v(!1)}};return a?(0,o.jsx)("div",{className:"fixed inset-0 z-[95] flex items-start justify-center overflow-y-auto bg-black/70 px-3 py-3 sm:items-center sm:py-0",onClick:()=>{e(),f(null)},role:"presentation",children:(0,o.jsxs)("div",{className:"flex max-h-[calc(100dvh-1.5rem)] w-full max-w-[760px] flex-col overflow-hidden rounded-[6px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] shadow-[0_24px_80px_rgba(0,0,0,0.55)]",onClick:a=>a.stopPropagation(),children:[(0,o.jsxs)("header",{className:"border-b border-[var(--vk-border)] px-4 py-3",children:[(0,o.jsx)("h3",{className:"text-[16px] text-[var(--vk-text-strong)]",children:c}),(0,o.jsx)("p",{className:"pt-1 text-[12px] text-[var(--vk-text-muted)]",children:d})]}),(0,o.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-3 px-4 py-3",children:[(0,o.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,o.jsx)("input",{value:i,onChange:a=>j(a.target.value),placeholder:"/path/to/repository",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,o.jsx)("button",{type:"button",onClick:()=>{x(i)},className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Open"})]}),(0,o.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,o.jsx)("button",{type:"button",onClick:()=>{x()},className:"inline-flex h-8 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Home"}),(0,o.jsx)("button",{type:"button",onClick:()=>{if(!g)return;let a=g.replace(/\\/g,"/");if(/^[A-Za-z]:\/?$/.test(g)||"/"===a)return;let b=a.split("/").filter(Boolean),c=g.match(/^([A-Za-z]):[/\\]/);x(c?b.length>1?`${c[1]}:/${b.slice(1,-1).join("/")}`:`${c[1]}:/`:b.length>1?`/${b.slice(0,-1).join("/")}`:"/")},className:"inline-flex h-8 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Up"}),(0,o.jsxs)("button",{type:"button",disabled:u,onClick:()=>{y()},className:"inline-flex h-8 items-center gap-1 rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:[u?(0,o.jsx)(dA.Loader2,{className:"h-3 w-3 animate-spin"}):(0,o.jsx)(du.FolderOpen,{className:"h-3 w-3"}),u?"Opening...":"Browse"]}),(0,o.jsx)("div",{className:"truncate text-[12px] text-[var(--vk-text-muted)]",children:g||"Home"})]}),(0,o.jsxs)("div",{className:"relative",children:[(0,o.jsx)(dD.Search,{className:"pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--vk-text-muted)]"}),(0,o.jsx)("input",{value:m,onChange:a=>n(a.target.value),placeholder:"Filter folders",className:"h-8 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent pl-7 pr-2 text-[12px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,o.jsx)("div",{className:"min-h-0 flex-1 overflow-auto rounded-[4px] border border-[var(--vk-border)]",children:p?(0,o.jsx)("div",{className:"px-3 py-3 text-[12px] text-[var(--vk-text-muted)]",children:"Loading..."}):s?(0,o.jsx)("div",{className:"px-3 py-3 text-[12px] text-[var(--vk-red)]",children:s}):0===w.length?(0,o.jsx)("div",{className:"px-3 py-3 text-[12px] text-[var(--vk-text-muted)]",children:"No folders found."}):(0,o.jsx)("div",{className:"p-1",children:w.map(a=>(0,o.jsxs)("button",{type:"button",onClick:()=>{a.isDirectory&&x(a.path)},className:`mb-1 flex w-full items-center gap-2 rounded-[4px] px-2 py-2 text-left text-[12px] ${a.isDirectory?"text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]":"cursor-default text-[var(--vk-text-muted)]"}`,children:[(0,o.jsx)(du.FolderOpen,{className:"h-4 w-4 shrink-0"}),(0,o.jsx)("span",{className:"truncate",children:a.name}),a.isGitRepo&&(0,o.jsx)("span",{className:"ml-auto rounded-[999px] border border-[var(--vk-border)] px-1.5 py-0.5 text-[10px]",children:"git"})]},a.path))})})]}),(0,o.jsxs)("footer",{className:"flex items-center justify-end gap-2 border-t border-[var(--vk-border)] px-4 py-3",children:[(0,o.jsx)("button",{type:"button",onClick:()=>{e(),f(null)},className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Cancel"}),(0,o.jsx)("button",{type:"button",onClick:()=>{let a=i.trim().length>0?i.trim():g;e(),f(a||null)},className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)]",children:"Use this folder"})]})]})}):null}let eG=(0,q.memo)(function({prompt:a,setPrompt:b,selectedAgent:c,setSelectedAgent:d,agentStates:e,modelSelection:f,setModelSelection:g,modelAccess:h,runtimeModelCatalogs:i,agentOptions:j,projects:k,selectedProjectId:l,onSelectProject:m,projectLabel:n,hasProject:p,creating:r,error:s,onOpenAddWorkspace:t,onOpenAgentSetup:u,onCreate:v}){let w=(0,q.useMemo)(()=>{let a=new Map(d4.map((a,b)=>[a,b]));return[...j].sort((b,c)=>{let d=a.get((0,dJ.normalizeAgentName)(b))??Number.MAX_SAFE_INTEGER,e=a.get((0,dJ.normalizeAgentName)(c))??Number.MAX_SAFE_INTEGER;return d!==e?d-e:ea(b).localeCompare(ea(c))})},[j]),x=ea(c),y=e[(0,dJ.normalizeAgentName)(c)]??null,z=(0,q.useMemo)(()=>[...k].sort((a,b)=>a.id.localeCompare(b.id)),[k]),A=l??z[0]?.id??null,B=(0,q.useMemo)(()=>z.find(a=>a.id===A)??null,[A,z]),[C,D]=(0,q.useState)([]),[E,F]=(0,q.useState)(!1),[G,H]=(0,q.useState)(""),[I,J]=(0,q.useState)(""),[K,L]=(0,q.useState)([]),[M,N]=(0,q.useState)(!1),[O,P]=(0,q.useState)(!0),[Q,R]=(0,q.useState)("default");(0,q.useEffect)(()=>{if(!B){D([]),H("");return}let a=!1,b=B.defaultBranch.trim()||"main";return async function(){if(!B.path?.trim()){D([b]),H(b);return}F(!0);try{let c=new URLSearchParams({path:B.path}),d=await fetch(`/api/workspaces/branches?${c.toString()}`),e=await d.json().catch(()=>null),f=Array.isArray(e?.branches)?e.branches.filter(a=>"string"==typeof a&&a.trim().length>0):[],g="string"==typeof e?.defaultBranch&&e.defaultBranch.trim().length>0?e.defaultBranch.trim():b,h=f.length>0?f:[g];if(a)return;D(h),H(a=>a.trim().length>0&&h.includes(a)?a:g)}catch{if(a)return;D([b]),H(b)}finally{a||F(!1)}}(),()=>{a=!0}},[B]),(0,q.useEffect)(()=>{if(!A){L([]),J("");return}let a=!1;return async function(){N(!0);try{let b=await fetch(`/api/boards?projectId=${encodeURIComponent(A)}`),c=await b.json().catch(()=>null);if(!b.ok)throw Error(c?.error??`Failed to load tasks: ${b.status}`);let d=(Array.isArray(c?.columns)?c.columns:[]).flatMap(a=>Array.isArray(a.tasks)?a.tasks:[]),e=new Set,f=d.filter(a=>{let b=eb(a);return!(!b||e.has(b))&&(e.add(b),!0)});if(a)return;L(f),J(a=>f.some(b=>eb(b)===a)?a:"")}catch{if(a)return;L([]),J("")}finally{a||N(!1)}}(),()=>{a=!0}},[A]);let S=(0,q.useMemo)(()=>ep(c,h,i),[h,i,c]),T=(0,q.useMemo)(()=>K.find(a=>eb(a)===I)??null,[K,I]),U=et(f)??"",V=(0,q.useMemo)(()=>{let a=new Set,b=[],d=U.trim();for(let c of S)a.has(c.id)||(a.add(c.id),b.push(c));return d&&!a.has(d)&&(a.add(d),b.unshift({id:d,label:function(a,b){let c=b.trim(),d=(0,dJ.normalizeAgentName)(a);if(!c)return c;if("claude-code"===d){let a=c.toLowerCase();if("opus"===a)return"Claude Opus";if("sonnet"===a)return"Claude Sonnet";if("haiku"===a)return"Claude Haiku";let b=a.match(/^claude-(sonnet|opus|haiku)-(\d+)-(\d+)(?:-\d{8})?$/);if(b){let a=b[1];return`Claude ${a[0]?.toUpperCase()+a.slice(1)} ${b[2]}.${b[3]}`}}return c.split(/[-_]+/g).filter(Boolean).map(a=>"gpt"===a.toLowerCase()?"GPT":/^\d+(?:\.\d+)?$/.test(a)?a:a[0]?.toUpperCase()+a.slice(1)).join("-")}(c,d),description:"Current selected model.",access:[]})),b},[S,c,U]),W=(0,q.useMemo)(()=>!y||y.ready||U?U?V.find(a=>a.id===U)?.label??U:"Default":"Setup required",[V,y,U]),X="z-50 min-w-[240px] rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] p-2 shadow-[0_18px_50px_rgba(0,0,0,0.35)]",Y=`${X} max-h-[min(360px,50vh)] overflow-y-auto`,Z="flex min-h-[36px] cursor-default items-center gap-2 rounded-[3px] px-3 py-2 text-[14px] leading-[21px] text-[var(--vk-text-normal)] outline-none hover:bg-[var(--vk-bg-hover)] focus:bg-[var(--vk-bg-hover)]",$=[{id:"default",label:"Default",icon:dE},{id:"auto",label:"Auto",icon:dp},{id:"ask",label:"Ask",icon:dy},{id:"plan",label:"Plan",icon:dz}],_=$.find(a=>a.id===Q)??$[0],aa=a=>{let b=a.repo?.trim();if(b){let a=b.split("/").filter(Boolean),c=a[a.length-1]?.replace(/\.git$/i,"");if(c)return c}return a.id},ab=B?aa(B):null,ac=B?`${ab} \xb7 ${G||B.defaultBranch||"main"}`:p?n:"Select project",ad=T?.taskRef?.trim()||"Link task",ae=T?ec(T.text):"Choose a task, bug, or issue from this project's board";return(0,o.jsx)("section",{className:"flex h-full min-h-0 items-start justify-center overflow-auto bg-[var(--vk-bg-main)] px-3 py-4 sm:items-center sm:px-6 sm:py-6",children:(0,o.jsxs)("div",{className:"w-full max-w-[768px]",children:[(0,o.jsx)("h1",{className:"pb-4 text-center text-[30px] font-medium leading-[34px] tracking-[-0.7px] text-[var(--vk-text-strong)] sm:text-[36px] sm:leading-[40px] sm:tracking-[-0.9px]",children:"What would you like to work on?"}),(0,o.jsxs)("div",{className:"mx-auto w-full rounded-[3px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] p-px",children:[(0,o.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border-b border-[var(--vk-border)] px-2 pb-[9px] pt-2",children:[(0,o.jsx)(dP.AgentTileIcon,{seed:{label:c},className:"h-[25px] w-[25px] border-none bg-transparent"}),(0,o.jsxs)(c3,{children:[(0,o.jsx)(c5,{asChild:!0,children:(0,o.jsxs)("button",{type:"button",className:"inline-flex h-[31px] max-w-[70vw] items-center rounded-[3px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-[9px] py-[5px] text-[14px] leading-[21px] text-[var(--vk-text-normal)] outline-none hover:bg-[var(--vk-bg-hover)] data-[state=open]:bg-[var(--vk-bg-hover)] sm:max-w-none","aria-label":"Select agent",children:[(0,o.jsx)("span",{className:"truncate pr-1",children:x}),(0,o.jsx)(dr.ChevronDown,{className:"h-3 w-3 text-[var(--vk-text-muted)]"})]})}),(0,o.jsx)(c6,{children:(0,o.jsxs)(c8,{align:"start",sideOffset:6,className:X,children:[(0,o.jsx)("p",{className:"px-3 pb-1 text-[14px] font-semibold leading-[21px] text-[var(--vk-text-muted)]",children:"Agents"}),w.map(a=>{let b=a===c,f=e[(0,dJ.normalizeAgentName)(a)]??null;return(0,o.jsxs)(c9,{onSelect:()=>d(a),className:Z,children:[(0,o.jsx)(dP.AgentTileIcon,{seed:{label:a},className:"h-6 w-6 border-none bg-transparent"}),(0,o.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,o.jsx)("div",{children:ea(a)}),f?.ready?null:(0,o.jsx)("div",{className:"truncate text-[12px] leading-[16px] text-[var(--vk-text-muted)]",children:f?.installed?"Setup required":"Not installed"})]}),(0,o.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 items-center justify-center text-[var(--vk-text-strong)]",children:b?(0,o.jsx)(dq.Check,{className:"h-4 w-4"}):null})]},a)})]})})]}),(0,o.jsxs)(c3,{children:[(0,o.jsx)(c5,{asChild:!0,children:(0,o.jsxs)("button",{type:"button",disabled:!A,className:"ml-auto flex h-[31px] min-w-[220px] items-center rounded-[3px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-[9px] py-[5px] text-left disabled:cursor-not-allowed disabled:opacity-50 sm:ml-0 sm:w-[286px]","aria-label":"Link task",children:[(0,o.jsx)("span",{className:"pr-2 text-[12px] uppercase tracking-[0.08em] text-[var(--vk-text-muted)]",children:"Task"}),(0,o.jsx)("span",{className:"min-w-0 flex-1 truncate text-[14px] leading-[21px] text-[var(--vk-text-normal)]",children:ad}),(0,o.jsx)(dr.ChevronDown,{className:"h-3 w-3 text-[var(--vk-text-muted)]"})]})}),(0,o.jsx)(c6,{children:(0,o.jsxs)(c8,{align:"end",side:"bottom",sideOffset:6,className:Y,children:[(0,o.jsx)("p",{className:"px-3 pb-1 text-[14px] font-semibold leading-[21px] text-[var(--vk-text-muted)]",children:"Link task"}),(0,o.jsx)("p",{className:"px-3 pb-2 text-[12px] leading-[16px] text-[var(--text-faint)]",children:ae}),(0,o.jsxs)(c9,{onSelect:()=>J(""),className:Z,children:[(0,o.jsx)("span",{children:"No linked task"}),(0,o.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 items-center justify-center text-[var(--vk-text-strong)]",children:I?null:(0,o.jsx)(dq.Check,{className:"h-4 w-4"})})]}),M?(0,o.jsx)("div",{className:"px-3 py-2 text-[12px] leading-[18px] text-[var(--vk-text-muted)]",children:"Loading board tasks..."}):K.length>0?K.map(a=>{let b=eb(a),c=ec(a.text),d=[a.type,a.priority].filter(Boolean).join(" · ");return(0,o.jsxs)(c9,{onSelect:()=>J(b),className:`${Z} min-w-[320px] items-start`,children:[(0,o.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,o.jsx)("div",{className:"truncate",children:a.taskRef?.trim()||c}),(0,o.jsxs)("div",{className:"truncate text-[12px] leading-[16px] text-[var(--text-faint)]",children:[a.taskRef?.trim()?c:b,d?` \xb7 ${d}`:""]})]}),(0,o.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 items-center justify-center text-[var(--vk-text-strong)]",children:I===b?(0,o.jsx)(dq.Check,{className:"h-4 w-4"}):null})]},b)}):(0,o.jsx)("div",{className:"px-3 py-2 text-[12px] leading-[18px] text-[var(--vk-text-muted)]",children:"No existing tasks were found for this project."})]})})]})]}),(0,o.jsx)("div",{className:"rounded-[3.5px]",children:(0,o.jsxs)("div",{className:"flex flex-col gap-3 p-2",children:[(0,o.jsxs)("div",{className:"relative w-full",children:[(0,o.jsx)("textarea",{value:a,onChange:a=>b(a.target.value),placeholder:"Describe the task...",rows:1,className:"min-h-[24px] w-full resize-none bg-transparent pr-8 text-[16px] leading-[24px] text-[var(--vk-text-normal)] outline-none placeholder:text-[var(--vk-text-muted)]"}),(0,o.jsx)("button",{type:"button","aria-label":"Preview",className:"absolute right-0 top-0 inline-flex h-[24px] w-[24px] items-center justify-center rounded-[4px] text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]",children:(0,o.jsx)(dt,{className:"h-[14px] w-[14px]"})})]}),(0,o.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between",children:[(0,o.jsxs)("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-x-1 gap-y-2",children:[(0,o.jsxs)(c3,{children:[(0,o.jsx)(c5,{asChild:!0,children:(0,o.jsx)("button",{type:"button",className:"inline-flex h-[29px] w-[29px] items-center justify-center rounded-[3px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]","aria-label":"Select workspace or project",children:(0,o.jsx)(dE,{className:"h-[15px] w-[15px]"})})}),(0,o.jsx)(c6,{children:(0,o.jsxs)(c8,{align:"start",sideOffset:6,className:X,children:[(0,o.jsx)("p",{className:"px-3 pb-1 text-[14px] font-semibold leading-[21px] text-[var(--vk-text-muted)]",children:"Projects"}),z.map(a=>{let b=aa(a),c=a.id!==b?a.id:a.path?.trim()||a.repo?.trim()||null;return(0,o.jsxs)(c9,{onSelect:()=>m(a.id),className:`${Z} min-w-[280px] items-start`,children:[(0,o.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,o.jsx)("div",{className:"truncate",children:b}),c?(0,o.jsx)("div",{className:"truncate text-[12px] leading-[16px] text-[var(--text-faint)]",children:c}):null]}),(0,o.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 items-center justify-center text-[var(--vk-text-strong)]",children:a.id===A?(0,o.jsx)(dq.Check,{className:"h-4 w-4"}):null})]},a.id)}),(0,o.jsx)(da,{className:"my-1 h-px bg-[var(--vk-border)]"}),(0,o.jsxs)(c9,{onSelect:t,className:Z,children:[(0,o.jsx)(du.FolderOpen,{className:"h-4 w-4"}),(0,o.jsx)("span",{children:"Add Workspace"})]})]})})]}),(0,o.jsxs)(c3,{children:[(0,o.jsx)(c5,{asChild:!0,children:(0,o.jsxs)("button",{type:"button",className:"inline-flex h-[29px] items-center gap-[4px] rounded-[3px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-[9px] py-[5px] text-[14px] leading-[21px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:cursor-not-allowed disabled:opacity-60",children:[(0,o.jsx)("span",{children:W}),(0,o.jsx)(dr.ChevronDown,{className:"h-[10px] w-[10px] text-[var(--vk-text-muted)]"})]})}),(0,o.jsx)(c6,{children:(0,o.jsxs)(c8,{align:"start",sideOffset:6,className:X,children:[(0,o.jsx)("p",{className:"px-3 pb-1 text-[14px] font-semibold leading-[21px] text-[var(--vk-text-muted)]",children:"Model"}),(0,o.jsxs)(c9,{onSelect:()=>g(es(c,h,i,B?.agentModel,B?.agentReasoningEffort)),className:Z,children:[(0,o.jsx)("span",{children:"Default"}),(0,o.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 items-center justify-center text-[var(--vk-text-strong)]",children:U?null:(0,o.jsx)(dq.Check,{className:"h-4 w-4"})})]}),V.map(a=>(0,o.jsxs)(c9,{onSelect:()=>g({catalogModel:a.id,customModel:"",reasoningEffort:er(c,h,i,a.id)}),className:Z,children:[(0,o.jsx)("span",{children:a.label}),(0,o.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 items-center justify-center text-[var(--vk-text-strong)]",children:U===a.id?(0,o.jsx)(dq.Check,{className:"h-4 w-4"}):null})]},a.id)),0===V.length?(0,o.jsx)("div",{className:"px-3 py-2 text-[12px] leading-[18px] text-[var(--vk-text-muted)]",children:"Models will appear here after the selected agent is installed and its runtime catalog is detected."}):null,y&&!y.ready?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(da,{className:"my-1 h-px bg-[var(--vk-border)]"}),(0,o.jsx)("button",{type:"button",onClick:()=>u(c),className:"flex w-full items-center rounded-[3px] px-3 py-2 text-left text-[13px] text-[var(--vk-orange)] transition hover:bg-[var(--vk-bg-hover)]",children:y.installed?"Open setup":"Open install guide"})]}):null]})})]}),(0,o.jsxs)(c3,{children:[(0,o.jsx)(c5,{asChild:!0,children:(0,o.jsxs)("button",{type:"button",className:"inline-flex h-[29px] items-center gap-[4px] rounded-[3px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-[9px] py-[5px] text-[14px] leading-[21px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[(0,o.jsx)("span",{children:_.label}),(0,o.jsx)(dr.ChevronDown,{className:"h-[10px] w-[10px] text-[var(--vk-text-muted)]"})]})}),(0,o.jsx)(c6,{children:(0,o.jsxs)(c8,{align:"start",sideOffset:6,className:X,children:[(0,o.jsx)("p",{className:"px-3 pb-1 text-[14px] font-semibold leading-[21px] text-[var(--vk-text-muted)]",children:"Permissions"}),$.map(({id:a,label:b,icon:c})=>(0,o.jsxs)(c9,{onSelect:()=>R(a),className:Z,children:[(0,o.jsx)(c,{className:"h-4 w-4"}),(0,o.jsx)("span",{children:b}),(0,o.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 items-center justify-center text-[var(--vk-text-strong)]",children:Q===a?(0,o.jsx)(dq.Check,{className:"h-4 w-4"}):null})]},a))]})})]}),(0,o.jsxs)(c3,{children:[(0,o.jsx)(c5,{asChild:!0,children:(0,o.jsx)("button",{type:"button",disabled:!B,className:"inline-flex min-h-[29px] max-w-[320px] items-center justify-center truncate text-[14px] leading-[21px] text-[var(--vk-text-normal)] hover:text-[var(--vk-text-strong)] disabled:cursor-not-allowed disabled:opacity-50",children:ac})}),(0,o.jsx)(c6,{children:(0,o.jsxs)(c8,{align:"start",side:"bottom",sideOffset:6,avoidCollisions:!1,className:Y,children:[(0,o.jsx)("p",{className:"px-3 pb-1 text-[14px] font-semibold leading-[21px] text-[var(--vk-text-muted)]",children:"Branch"}),ab?(0,o.jsx)("p",{className:"px-3 pb-2 text-[12px] leading-[16px] text-[var(--text-faint)]",children:ab}):null,E?(0,o.jsx)("div",{className:"px-3 py-2 text-[14px] leading-[21px] text-[var(--vk-text-muted)]",children:"Loading branches..."}):C.map(a=>(0,o.jsxs)(c9,{onSelect:()=>H(a),className:Z,children:[(0,o.jsx)("span",{children:a}),(0,o.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 items-center justify-center text-[var(--vk-text-strong)]",children:G===a?(0,o.jsx)(dq.Check,{className:"h-4 w-4"}):null})]},a))]})})]})]}),(0,o.jsx)("div",{className:"flex w-full justify-end sm:w-auto",children:(0,o.jsx)("button",{type:"button",onClick:()=>v({projectId:A??void 0,...O?{baseBranch:G||B?.defaultBranch||void 0}:{branch:G||B?.defaultBranch||void 0},issueId:I.trim()||void 0,useWorktree:O,permissionMode:Q}),disabled:r||0===a.trim().length||!A,className:"inline-flex min-h-[29px] items-center justify-center rounded-[3px] bg-[var(--vk-bg-hover)] px-[8px] py-[6.5px] text-[16px] leading-[16px] text-[var(--vk-text-strong)] transition-colors hover:bg-[var(--vk-bg-active)] disabled:cursor-not-allowed disabled:opacity-50",children:r?(0,o.jsx)(dA.Loader2,{className:"h-4 w-4 animate-spin"}):"Create"})})]}),y&&!y.ready?(0,o.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-3 py-2 text-[13px] text-[var(--vk-text-normal)]",children:(0,o.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,o.jsxs)("div",{className:"min-w-0",children:[(0,o.jsxs)("p",{className:"text-[13px] text-[var(--vk-text-strong)]",children:[x," is not ready on this machine."]}),(0,o.jsx)("p",{className:"pt-0.5 text-[12px] text-[var(--vk-text-muted)]",children:y.installed?"Finish login or local setup to load models and start streaming sessions.":"Install the CLI first, then its models and authentication state will appear here."})]}),(0,o.jsx)("button",{type:"button",onClick:()=>u(c),className:"inline-flex h-[29px] items-center justify-center rounded-[3px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-orange)] hover:bg-[var(--vk-bg-hover)]",children:y.installed?"Open setup":"Open install"})]})}):null,(0,o.jsxs)("label",{className:"flex items-start gap-2 rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-2 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,o.jsx)("input",{type:"checkbox",checked:O,onChange:a=>P(a.target.checked),className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,o.jsxs)("span",{children:["Use worktree isolation",(0,o.jsx)("span",{className:"block text-[11px] text-[var(--vk-text-muted)]",children:"If unchecked, the session runs directly on the selected branch in the local repo."})]})]})]})})]}),s&&(0,o.jsx)("p",{className:"pt-2 text-[12px] text-[var(--status-error)]",children:s})]})})});function eH({value:a,idleLabel:b="Copy",copiedLabel:c="Copied"}){let[d,e]=(0,q.useState)(!1);async function f(){await navigator.clipboard.writeText(a),e(!0),window.setTimeout(()=>e(!1),1400)}return(0,o.jsxs)("button",{type:"button",onClick:()=>void f(),className:"inline-flex h-8 items-center gap-1.5 rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[d?(0,o.jsx)(dq.Check,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"}):(0,o.jsx)(ds.Copy,{className:"h-3.5 w-3.5"}),(0,o.jsx)("span",{children:d?c:b})]})}function eI({open:a,mode:b,creating:c,error:d,current:e,projectCount:f,agentOptions:g,runtimeModelCatalogs:h,onRepositoriesChanged:i,onOnboardingComplete:j,onClose:k,onSave:l}){var m,n;let p,[r,s]=(0,q.useState)("preferences"),[t,u]=(0,q.useState)(e.codingAgent),[v,w]=(0,q.useState)(e.ide),[x,y]=(0,q.useState)(e.remoteSshHost),[z,A]=(0,q.useState)(e.remoteSshUser),[B,C]=(0,q.useState)(e.markdownEditor),[D,E]=(0,q.useState)(e.modelAccess),[F,G]=(0,q.useState)(e.notifications.soundEnabled),[H,I]=(0,q.useState)(e.notifications.soundFile),[J,K]=(0,q.useState)([]),[L,M]=(0,q.useState)(!1),[N,O]=(0,q.useState)(!1),[P,Q]=(0,q.useState)(null),[R,S]=(0,q.useState)(""),[T,U]=(0,q.useState)(null),[V,W]=(0,q.useState)(em()),[X,Y]=(0,q.useState)([]),[Z,$]=(0,q.useState)(!1),[_,aa]=(0,q.useState)(null),[ab,ac]=(0,q.useState)(!1),[ad,ae]=(0,q.useState)(()=>el(null)),[af,ag]=(0,q.useState)(!1),[ah,ai]=(0,q.useState)(!1),[aj,ak]=(0,q.useState)(null),al=c||N||ah;function am(a){return{...a,pathHealth:{exists:a.pathHealth.exists,isGitRepository:a.pathHealth.isGitRepository,suggestedPath:a.pathHealth.suggestedPath}}}function an(a){return a.split(/\n+/g).map(a=>a.trim()).filter(Boolean)}async function ao(a){M(!0),Q(null);try{let b=await fetch("/api/repositories"),c=await b.json().catch(()=>null);if(!b.ok)throw Error(c?.error??`Failed to load repositories (${b.status})`);let d=Array.isArray(c?.repositories)?c.repositories:[];K(d);let e=d[0]?.id??"",f=a&&d.some(b=>b.id===a)?a:R&&d.some(a=>a.id===R)?R:e;S(f)}catch(a){K([]),S(""),U(null),W(em()),Q(a instanceof Error?a.message:"Failed to load repositories")}finally{M(!1)}}async function ap(a,b){let c=(a??T?.path??"").trim();if(0===c.length){aa("Select a repository path first."),Y([]);return}$(!0),aa(null);try{let a=new URLSearchParams({path:c}),d=await fetch(`/api/workspaces/branches?${a.toString()}`),e=await d.json().catch(()=>null);if(!d.ok)throw Error(e?.error??`Failed to detect branches (${d.status})`);let f=Array.isArray(e?.branches)?e.branches.filter(a=>"string"==typeof a&&a.trim().length>0):[];Y(f);let g=b?.trim()||("string"==typeof e?.defaultBranch&&e.defaultBranch.trim().length>0?e.defaultBranch.trim():f[0]??"");if(!g)return;U(a=>!a||a.defaultBranch.trim().length>0&&f.includes(a.defaultBranch)?a:{...a,defaultBranch:g})}catch(a){Y([]),aa(a instanceof Error?a.message:"Failed to detect branches")}finally{$(!1)}}async function aq(){if(!T||N||0===T.repo.trim().length||0===T.path.trim().length)return!1;O(!0),Q(null);try{let a=await fetch("/api/repositories",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:T.id,displayName:T.displayName,repo:T.repo,path:T.path,agent:T.agent,agentModel:et(V)??"",agentReasoningEffort:eu(V)??"",defaultWorkingDirectory:T.defaultWorkingDirectory,defaultBranch:T.defaultBranch,devServerScript:T.devServerScript,setupScript:T.setupScript,runSetupInParallel:T.runSetupInParallel,cleanupScript:T.cleanupScript,archiveScript:T.archiveScript,copyFiles:T.copyFiles})}),b=await a.json().catch(()=>null);if(!a.ok)throw Error(b?.error??`Failed to save repository settings (${a.status})`);let c=b?.repository;if(!c)throw Error("Repository saved but response is missing repository data");return K(a=>a.map(a=>a.id===c.id?c:a)),U(am(c)),S(c.id),aa(null),await ap(c.path,c.defaultBranch),i&&await i(),!0}catch(a){return Q(a instanceof Error?a.message:"Failed to save repository settings"),!1}finally{O(!1)}}async function ar(){ag(!0),ak(null);try{let a=await fetch("/api/access"),b=await a.json().catch(()=>null);if(!a.ok)throw Error(b?.error??`Failed to load organization settings (${a.status})`);ae(el(b?.access,b?.current))}catch(a){ae(el(null)),ak(a instanceof Error?a.message:"Failed to load organization settings")}finally{ag(!1)}}async function as(){if(ah)return!1;ai(!0),ak(null);try{let a=await fetch("/api/access",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireAuth:ad.requireAuth,defaultRole:ad.defaultRole,trustedHeaders:{enabled:ad.trustedHeaders.enabled,provider:ad.trustedHeaders.provider,emailHeader:ad.trustedHeaders.emailHeader,jwtHeader:ad.trustedHeaders.jwtHeader,teamDomain:ad.trustedHeaders.teamDomain,audience:ad.trustedHeaders.audience},roles:{viewers:an(ad.roles.viewers),operators:an(ad.roles.operators),admins:an(ad.roles.admins),viewerDomains:an(ad.roles.viewerDomains),operatorDomains:an(ad.roles.operatorDomains),adminDomains:an(ad.roles.adminDomains)}})}),b=await a.json().catch(()=>null);if(!a.ok)throw Error(b?.error??`Failed to save organization settings (${a.status})`);return ae(el(b?.access,b?.current)),!0}catch(a){return ak(a instanceof Error?a.message:"Failed to save organization settings"),!1}finally{ai(!1)}}(0,q.useEffect)(()=>{a&&(s("onboarding"===b?"preferences":"general"),u(e.codingAgent),w(e.ide),y(e.remoteSshHost),A(e.remoteSshUser),C(e.markdownEditor),E(e.modelAccess),G(e.notifications.soundEnabled),I(e.notifications.soundFile),Y([]),aa(null),Q(null),W(em()),ak(null))},[b,a]),(0,q.useEffect)(()=>{a&&("settings"===b||"repositories"===r)&&ao()},[r,b,a]),(0,q.useEffect)(()=>{a&&"onboarding"!==b&&ar()},[b,a]),(0,q.useEffect)(()=>{if(!a)return;if(!R){U(null),W(em());return}let b=J.find(a=>a.id===R);b&&(U(am(b)),W(es(b.agent,D,h,b.agentModel,b.agentReasoningEffort)),Y([]),aa(null),b.path.trim().length>0&&ap(b.path,b.defaultBranch))},[D,a,J,h,R]);let at="onboarding"===b&&f>0,au=(0,q.useMemo)(()=>"onboarding"===b?at?ee:ee.filter(a=>"preferences"===a.id):ed.filter(a=>a.implemented),[b,at]),av=au.find(a=>a.id===r)??au[0]??ed[0],aw="onboarding"===b,ax="preferences"===av.id,ay="general"===av.id,az="remote_access"===av.id,aA="agents"===av.id,aB=ax||ay||az||aA,aC="repositories"===av.id,aD="organization"===av.id,aE=au.findIndex(a=>a.id===av.id)+1,aF=au.some(a=>"repositories"===a.id),aG="admin"===ad.current.role,aH=(0,q.useMemo)(()=>{let a=new Set(g);t.trim().length>0&&a.add(t),0===a.size&&a.add(d5);let b=new Map(d4.map((a,b)=>[a,b]));return[...a].sort((a,c)=>{let d=b.get((0,dJ.normalizeAgentName)(a))??Number.MAX_SAFE_INTEGER,e=b.get((0,dJ.normalizeAgentName)(c))??Number.MAX_SAFE_INTEGER;return d!==e?d-e:ea(a).localeCompare(ea(c))})},[g,t]);if(!a)return null;let aI=t.trim().length>0&&v.trim().length>0&&B.trim().length>0,aJ=!!T&&T.displayName.trim().length>0&&T.repo.trim().length>0&&T.path.trim().length>0&&T.defaultBranch.trim().length>0,aK=aG&&!af&&(!ad.trustedHeaders.enabled||"generic"===ad.trustedHeaders.provider||ad.trustedHeaders.teamDomain.trim().length>0&&ad.trustedHeaders.audience.trim().length>0),aL=aC?P:aD?aj:d,aM=T?(m={...T,agentModel:et(V)??"",agentReasoningEffort:eu(V)??""},n={ide:v,markdownEditor:B},p=["npx conductor-oss@latest setup","--yes",`--path ${ez(m.path)}`,`--project-id ${ez(m.id)}`,`--display-name ${ez(m.displayName)}`,`--agent ${ez(m.agent||"claude-code")}`,`--ide ${ez(n.ide)}`,`--markdown-editor ${ez(n.markdownEditor)}`],m.repo.trim().length>0&&p.push(`--repo ${ez(m.repo.trim())}`),m.defaultBranch.trim().length>0&&p.push(`--default-branch ${ez(m.defaultBranch.trim())}`),m.agentModel.trim().length>0&&p.push(`--model ${ez(m.agentModel.trim())}`),m.agentReasoningEffort.trim().length>0&&p.push(`--reasoning-effort ${ez(m.agentReasoningEffort.trim())}`),m.defaultWorkingDirectory.trim().length>0&&p.push(`--default-working-directory ${ez(m.defaultWorkingDirectory.trim())}`),p.join(" ")):"";async function aN(a,b){let d;return!!aI&&!c&&l((d=F?H??eh[0]?.id??"abstract-sound-4":null,{onboardingAcknowledged:!!a||e.onboardingAcknowledged,codingAgent:t.trim(),ide:v.trim(),remoteSshHost:x.trim(),remoteSshUser:z.trim(),markdownEditor:B.trim(),modelAccess:D,notifications:{soundEnabled:F,soundFile:d}}),b)}async function aO(){if(!L){if(!aF){if(!await aN(!0,{closeDialog:!0}))return;j?.({needsProject:0===f});return}await aN(!1,{closeDialog:!1})&&s("repositories")}}async function aP(){(!aC||await aq())&&await aN(!0,{closeDialog:!0})&&j?.({needsProject:!1})}return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{className:"fixed inset-0 z-[90] flex items-start justify-center overflow-y-auto bg-black/70 px-3 py-3 sm:items-center",onClick:()=>{al||"onboarding"===b||ab||k()},role:"presentation",children:(0,o.jsxs)("div",{className:"flex max-h-[calc(100dvh-1.5rem)] w-full max-w-[1120px] flex-col overflow-hidden rounded-[6px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] shadow-[0_24px_80px_rgba(0,0,0,0.55)] sm:h-[min(92vh,760px)] sm:flex-row",onClick:a=>a.stopPropagation(),children:[(0,o.jsxs)("aside",{className:"flex w-full shrink-0 flex-col border-b border-[var(--vk-border)] bg-[rgba(28,28,28,0.8)] sm:w-[224px] sm:border-b-0 sm:border-r",children:[(0,o.jsx)("header",{className:"border-b border-[var(--vk-border)] px-4 py-3 sm:py-4",children:(0,o.jsx)("h2",{className:"text-[22px] leading-[24px] text-[var(--vk-text-strong)] sm:text-[27px] sm:leading-[27px]",children:aw?"Setup":"Settings"})}),(0,o.jsx)("nav",{className:"flex gap-1 overflow-x-auto p-2 sm:block sm:space-y-1 sm:overflow-auto",children:au.map(a=>{let b=a.icon,c=av.id===a.id;return(0,o.jsxs)("button",{type:"button",onClick:()=>s(a.id),disabled:al,className:`flex shrink-0 items-center gap-3 rounded-[3px] px-3 py-2 text-left text-[14px] leading-[21px] transition-colors sm:w-full ${c?"bg-[rgba(234,122,42,0.1)] text-[var(--vk-orange)]":"text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]"} disabled:opacity-50`,children:[(0,o.jsx)(b,{className:"h-4 w-4 shrink-0"}),(0,o.jsx)("span",{children:a.label})]},a.id)})})]}),(0,o.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,o.jsxs)("header",{className:"flex items-center justify-between border-b border-[var(--vk-border)] px-4 py-3 sm:py-4",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("h3",{className:"text-[20px] leading-[24px] text-[var(--vk-text-strong)] sm:text-[27px] sm:leading-[27px]",children:aw?ax?"Choose your preferences":"Review repository defaults":av.label}),aw&&(0,o.jsxs)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:["Step ",aE," of ",au.length]})]}),(0,o.jsx)("button",{type:"button",onClick:k,disabled:al||"onboarding"===b,"aria-label":"Close settings",className:"inline-flex h-7 w-7 items-center justify-center rounded-[4px] text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-40",children:(0,o.jsx)(dI.X,{className:"h-4 w-4"})})]}),(0,o.jsx)("div",{className:"min-h-0 flex-1 overflow-auto px-4 py-3 sm:px-6 sm:py-4",children:aB?(0,o.jsxs)("div",{className:"space-y-5",children:[aw&&(0,o.jsx)("section",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[rgba(234,122,42,0.08)] px-4 py-3",children:(0,o.jsx)("p",{className:"text-[13px] leading-5 text-[var(--vk-text-normal)]",children:"Conductor is already running locally. Finish setup here in the dashboard, then you can start using chat and boards immediately."})}),(ax||aA)&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("section",{className:"space-y-2",children:[(0,o.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Choose Your Coding Agent"}),(0,o.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Select the default coding agent configuration."}),(0,o.jsx)("div",{className:"grid gap-2",children:aH.map(a=>{let b=t===a;return(0,o.jsxs)("button",{type:"button",onClick:()=>u(a),className:`flex items-center gap-2 rounded-[4px] border px-3 py-2 text-left ${b?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,o.jsx)(dP.AgentTileIcon,{seed:{label:a},className:"h-5 w-5 border-none bg-transparent"}),(0,o.jsx)("span",{className:"flex-1 text-[13px] text-[var(--vk-text-normal)]",children:ea(a)}),b&&(0,o.jsx)(dq.Check,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]},a)})})]}),(0,o.jsxs)("section",{className:"space-y-3",children:[(0,o.jsxs)("div",{className:"space-y-1",children:[(0,o.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Model Access"}),(0,o.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Tell Conductor which account mode each agent is using so the model dropdown only shows options that make sense for that login path."})]}),(0,o.jsx)("div",{className:"grid gap-3",children:aH.filter(a=>(0,db.supportsAgentModelSelection)(a)).map(a=>{let b=(0,db.getAgentModelCatalog)(a);if(!b)return null;let c=(0,db.resolveAgentModelAccess)(a,D)??b.defaultAccess;return(0,o.jsxs)("label",{className:"block rounded-[4px] border border-[var(--vk-border)] px-3 py-3",children:[(0,o.jsx)("span",{className:"mb-1 block text-[13px] font-medium text-[var(--vk-text-normal)]",children:b.label}),(0,o.jsx)("select",{value:c,onChange:b=>{var c;let d;return c=b.target.value,void((d=(0,db.getAgentModelCatalog)(a))&&E(a=>({...a,[d.accessKey]:c})))},className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:b.accessOptions.map(a=>(0,o.jsx)("option",{value:a.id,children:a.label},a.id))}),(0,o.jsx)("p",{className:"mt-1.5 text-[11px] text-[var(--vk-text-muted)]",children:b.accessOptions.find(a=>a.id===c)?.description})]},a)})})]})]}),(ax||ay)&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("section",{className:"space-y-2",children:[(0,o.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Choose Your Code Editor"}),(0,o.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"This editor will be used when opening attempts and files."}),(0,o.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:ef.map(a=>{let b=v===a.id;return(0,o.jsxs)("button",{type:"button",onClick:()=>w(a.id),className:`flex items-center gap-2 rounded-[4px] border px-3 py-2 text-left ${b?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,o.jsx)(ey,{editorId:a.id,label:a.label}),(0,o.jsx)("span",{className:"flex-1 text-[13px] text-[var(--vk-text-normal)]",children:a.label}),b&&(0,o.jsx)(dq.Check,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]},a.id)})})]}),ax&&(0,o.jsxs)("section",{className:"space-y-3",children:[(0,o.jsxs)("div",{className:"space-y-1",children:[(0,o.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Remote Access"}),(0,o.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Use your local Remote-SSH editor to jump straight into a remote worktree. This complements ngrok or Cloudflare Tunnel for dashboard access; it does not replace the tunnel."})]}),(0,o.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"SSH Host or Alias"}),(0,o.jsx)("input",{value:x,onChange:a=>y(a.target.value),placeholder:"e.g., conductor-dev or 203.0.113.10",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"SSH User (optional)"}),(0,o.jsx)("input",{value:z,onChange:a=>A(a.target.value),placeholder:"e.g., ubuntu",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]})]}),(0,o.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"One-click remote open currently supports VS Code and VS Code Insiders. Other editors will still save as your preference, but they will not get a remote launch button yet."})]}),(0,o.jsxs)("section",{className:"space-y-2",children:[(0,o.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Markdown Editor"}),(0,o.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Used as your second-brain markdown source when feeding context into tasks."}),(0,o.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:eg.map(a=>{let b=B===a.id;return(0,o.jsxs)("button",{type:"button",onClick:()=>C(a.id),className:`flex items-center gap-2 rounded-[4px] border px-3 py-2 text-left ${b?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,o.jsx)(eB,{editorId:a.id}),(0,o.jsx)("span",{className:"flex-1 text-[13px] text-[var(--vk-text-normal)]",children:a.label}),b&&(0,o.jsx)(dq.Check,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]},a.id)})})]}),(0,o.jsxs)("section",{className:"space-y-2",children:[(0,o.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Notification Sound"}),(0,o.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Pick a sound for notifications, or disable sound."}),(0,o.jsxs)("div",{className:"grid gap-2 sm:grid-cols-2",children:[eh.map(a=>{let b=F&&H===a.id;return(0,o.jsxs)("button",{type:"button",onClick:()=>{G(!0),I(a.id)},className:`flex items-center gap-2 rounded-[4px] border px-3 py-2 text-left ${b?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,o.jsx)(dG,{className:"h-4 w-4 text-[var(--vk-text-muted)]"}),(0,o.jsx)("span",{className:"flex-1 text-[13px] text-[var(--vk-text-normal)]",children:a.label}),b&&(0,o.jsx)(dq.Check,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]},a.id)}),(0,o.jsxs)("button",{type:"button",onClick:()=>G(!1),className:`flex items-center gap-2 rounded-[4px] border px-3 py-2 text-left ${!F?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,o.jsx)(dH,{className:"h-4 w-4 text-[var(--vk-text-muted)]"}),(0,o.jsx)("span",{className:"flex-1 text-[13px] text-[var(--vk-text-normal)]",children:"No sound"}),!F&&(0,o.jsx)(dq.Check,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]})]})]})]}),az&&(0,o.jsxs)("section",{className:"space-y-3",children:[(0,o.jsxs)("div",{className:"space-y-1",children:[(0,o.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Remote Access"}),(0,o.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Use your local Remote-SSH editor to jump straight into a remote worktree. This complements ngrok or Cloudflare Tunnel for dashboard access; it does not replace the tunnel."})]}),(0,o.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"SSH Host or Alias"}),(0,o.jsx)("input",{value:x,onChange:a=>y(a.target.value),placeholder:"e.g., conductor-dev or 203.0.113.10",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"SSH User (optional)"}),(0,o.jsx)("input",{value:z,onChange:a=>A(a.target.value),placeholder:"e.g., ubuntu",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]})]}),(0,o.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"One-click remote open currently supports VS Code and VS Code Insiders. Other editors will still save as your preference, but they will not get a remote launch button yet."})]})]}):aC?(0,o.jsxs)("div",{className:"space-y-5",children:[(0,o.jsxs)("section",{className:"space-y-1",children:[(0,o.jsx)("h4",{className:"text-[24px] leading-[24px] text-[var(--vk-text-strong)]",children:aw?"Repository Defaults":"Repository Configuration"}),(0,o.jsx)("p",{className:"text-[14px] text-[var(--vk-text-muted)]",children:aw?"Review the repository Conductor will use for this workspace. You can edit advanced scripts later from Settings.":"Configure scripts and defaults used whenever this repository is selected for workspaces."})]}),("settings"===b||J.length>1)&&(0,o.jsxs)("section",{className:"space-y-2",children:[(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Select Repository"}),(0,o.jsxs)("select",{value:R,onChange:a=>S(a.target.value),disabled:L||0===J.length||al,className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60",children:[0===J.length&&(0,o.jsx)("option",{value:"",children:"No repositories configured"}),J.map(a=>(0,o.jsx)("option",{value:a.id,children:a.displayName},a.id))]})]}),(0,o.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Select a repository to view and edit its configuration."}),L&&(0,o.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Loading repositories..."})]}),aw&&1===J.length&&T&&(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Detected Repository"}),(0,o.jsxs)("div",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[rgba(15,15,15,0.52)] px-3 py-3 text-[13px] text-[var(--vk-text-normal)]",children:[T.displayName,(0,o.jsx)("span",{className:"ml-2 text-[var(--vk-text-muted)]",children:T.path})]})]}),T&&(0,o.jsxs)(o.Fragment,{children:["settings"===b&&(0,o.jsxs)("section",{className:"space-y-3 border-t border-[var(--vk-border)] pt-4",children:[(0,o.jsxs)("div",{className:"space-y-1",children:[(0,o.jsx)("h5",{className:"text-[22px] leading-[22px] text-[var(--vk-text-strong)]",children:"Repo-Preseed Bootstrap"}),(0,o.jsx)("p",{className:"text-[13px] text-[var(--vk-text-muted)]",children:"Use this when you already know the target repository and want one command to prefill it. The default first-run path is still `npx conductor-oss@latest`, which opens the dashboard and lets the user choose preferences before adding a project."})]}),(0,o.jsxs)("div",{className:"flex flex-wrap gap-2 text-[11px] text-[var(--vk-text-muted)]",children:[(0,o.jsxs)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1",children:["Workspace: ",T.workspaceMode]}),(0,o.jsxs)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1",children:["Runtime: ",T.runtimeMode]}),(0,o.jsxs)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1",children:["SCM: ",T.scmMode]})]}),(0,o.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[rgba(15,15,15,0.72)] p-3",children:(0,o.jsx)("pre",{className:"overflow-x-auto whitespace-pre-wrap break-all text-[12px] leading-5 text-[var(--vk-text-normal)]",children:aM})}),(0,o.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,o.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"This command uses your selected agent, editor, and notes app. Best on macOS with Homebrew. GitHub sign-in still opens a browser so the user can approve access."}),(0,o.jsx)(eH,{value:aM,idleLabel:"Copy Setup Command"})]})]}),(0,o.jsxs)("section",{className:"space-y-3 border-t border-[var(--vk-border)] pt-4",children:[(0,o.jsx)("h5",{className:"text-[22px] leading-[22px] text-[var(--vk-text-strong)]",children:"General Settings"}),(0,o.jsx)("p",{className:"text-[13px] text-[var(--vk-text-muted)]",children:"Configure basic repository information."}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Display Name"}),(0,o.jsx)("input",{value:T.displayName,onChange:a=>U(b=>b?{...b,displayName:a.target.value}:b),className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,o.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"A friendly name for this repository."})]}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Repository Slug"}),(0,o.jsx)("input",{value:T.repo,onChange:a=>U(b=>b?{...b,repo:a.target.value}:b),placeholder:"e.g., your-org/your-repo",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,o.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Used for PR tracking, GitHub links, and onboarding defaults."})]}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Agent"}),(0,o.jsx)("select",{value:T.agent,onChange:a=>{let b=a.target.value;U(a=>a?{...a,agent:b}:a),W(es(b,D,h,null))},className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:aH.map(a=>(0,o.jsx)("option",{value:a,children:ea(a)},a))}),(0,o.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Used by the one-line bootstrap and as the project default when tasks dispatch."})]}),(0,db.supportsAgentModelSelection)(T.agent)&&(0,o.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] px-3 py-3",children:(0,o.jsx)(eC,{agent:T.agent,modelAccess:D,runtimeModelCatalogs:h,selection:V,onChange:W})}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Repository Path"}),(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)("input",{value:T.path,readOnly:!0,onClick:()=>ac(!0),placeholder:"Use Browse to select a repository folder",className:"h-9 w-full cursor-pointer rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,o.jsx)("button",{type:"button",onClick:()=>ac(!0),disabled:al,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",children:(0,o.jsx)(du.FolderOpen,{className:"h-4 w-4"})})]}),!T.pathHealth.exists&&(0,o.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-red)]",children:"Configured path does not exist on disk."}),T.pathHealth.exists&&!T.pathHealth.isGitRepository&&(0,o.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-red)]",children:"Configured path exists but is not a git repository."}),T.pathHealth.suggestedPath&&(0,o.jsx)("button",{type:"button",onClick:()=>{let a=T.pathHealth.suggestedPath??"";a&&(U(b=>b?{...b,path:a,pathHealth:{...b.pathHealth,exists:!0,isGitRepository:!0,suggestedPath:null}}:b),ap(a))},className:"mt-1 inline-flex h-7 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[11px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Use detected git repo path"})]}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Working Directory"}),(0,o.jsx)("input",{value:T.defaultWorkingDirectory,onChange:a=>U(b=>b?{...b,defaultWorkingDirectory:a.target.value}:b),placeholder:"e.g., packages/frontend",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,o.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Subdirectory relative to the repository root where the coding agent starts."})]}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Target Branch"}),(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)("input",{value:T.defaultBranch,onChange:a=>U(b=>b?{...b,defaultBranch:a.target.value}:b),placeholder:"Select a branch",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,o.jsx)("button",{type:"button",onClick:()=>{ap()},disabled:Z,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",title:"Detect branches",children:Z?(0,o.jsx)(dA.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,o.jsx)(dC,{className:"h-3.5 w-3.5"})})]}),X.length>0&&(0,o.jsx)("select",{value:T.defaultBranch,onChange:a=>U(b=>b?{...b,defaultBranch:a.target.value}:b),className:"mt-2 h-8 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[12px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:X.map(a=>(0,o.jsx)("option",{value:a,children:a},a))}),_&&(0,o.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-red)]",children:_})]})]}),"settings"===b&&(0,o.jsxs)("section",{className:"space-y-3 border-t border-[var(--vk-border)] pt-4",children:[(0,o.jsx)("h5",{className:"text-[22px] leading-[22px] text-[var(--vk-text-strong)]",children:"Scripts & Configuration"}),(0,o.jsx)("p",{className:"text-[13px] text-[var(--vk-text-muted)]",children:"Configure dev server, setup, cleanup, archive, and file-copy behavior for this repository."}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Dev Server Script"}),(0,o.jsx)("textarea",{rows:3,value:T.devServerScript,onChange:a=>U(b=>b?{...b,devServerScript:a.target.value}:b),placeholder:"npm run dev",className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,o.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Starts a development server for this repository."})]}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Setup Script"}),(0,o.jsx)("textarea",{rows:4,value:T.setupScript,onChange:a=>U(b=>b?{...b,setupScript:a.target.value}:b),placeholder:"npm install",className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,o.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Runs in the worktree after creation and before/with coding-agent startup."})]}),(0,o.jsxs)("label",{className:"flex items-start gap-2 rounded-[4px] border border-[var(--vk-border)] px-3 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,o.jsx)("input",{type:"checkbox",checked:T.runSetupInParallel,onChange:a=>U(b=>b?{...b,runSetupInParallel:a.target.checked}:b),className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,o.jsx)("span",{children:"Run setup script in parallel with coding agent"})]}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Cleanup Script"}),(0,o.jsx)("textarea",{rows:4,value:T.cleanupScript,onChange:a=>U(b=>b?{...b,cleanupScript:a.target.value}:b),placeholder:"Runs when the workspace is archived and changes exist",className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Archive Script"}),(0,o.jsx)("textarea",{rows:4,value:T.archiveScript,onChange:a=>U(b=>b?{...b,archiveScript:a.target.value}:b),placeholder:"Runs when the workspace/session is archived",className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Copy Files"}),(0,o.jsx)("input",{value:T.copyFiles,onChange:a=>U(b=>b?{...b,copyFiles:a.target.value}:b),placeholder:".env, config/*.json",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,o.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Comma-separated relative file paths or glob patterns copied from the repo to each worktree."})]})]})]})]}):aD?(0,o.jsxs)("div",{className:"space-y-5",children:[(0,o.jsxs)("section",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[rgba(234,122,42,0.06)] px-4 py-3",children:[(0,o.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Security-First Remote Access"}),(0,o.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"The dashboard stays bound to localhost. For phone and team access, put a verified edge identity layer like Cloudflare Access in front of it, then map authenticated users into viewer, operator, or admin roles here."})]}),af?(0,o.jsxs)("section",{className:"flex items-center gap-2 rounded-[6px] border border-[var(--vk-border)] px-4 py-4 text-[13px] text-[var(--vk-text-muted)]",children:[(0,o.jsx)(dA.Loader2,{className:"h-4 w-4 animate-spin"}),"Loading organization access settings..."]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("section",{className:"grid gap-3 lg:grid-cols-3",children:[(0,o.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,o.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Current Identity"}),(0,o.jsx)("p",{className:"mt-2 text-[14px] text-[var(--vk-text-normal)]",children:ad.current.email??"Anonymous local session"})]}),(0,o.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,o.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Effective Role"}),(0,o.jsx)("p",{className:"mt-2 text-[14px] text-[var(--vk-text-normal)]",children:ad.current.role??"No access"})]}),(0,o.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,o.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Auth Provider"}),(0,o.jsx)("p",{className:"mt-2 text-[14px] text-[var(--vk-text-normal)]",children:ad.current.provider??"Local only"})]})]}),!aG&&(0,o.jsx)("section",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[rgba(80,80,80,0.18)] px-4 py-3",children:(0,o.jsx)("p",{className:"text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"You can review organization security here, but only an admin session can save changes. Use the built-in unlock link, a local admin session, or an admin identity from your edge auth provider to modify access rules."})}),(0,o.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,o.jsxs)("div",{className:"space-y-1",children:[(0,o.jsx)("h5",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Baseline Access Rules"}),(0,o.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Require authentication for every dashboard request and decide what authenticated users get by default before explicit role bindings are applied."})]}),(0,o.jsxs)("label",{className:"flex items-start gap-2 rounded-[4px] border border-[var(--vk-border)] px-3 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,o.jsx)("input",{type:"checkbox",checked:ad.requireAuth,onChange:a=>ae(b=>({...b,requireAuth:a.target.checked})),disabled:!aG||ah,className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,o.jsx)("span",{children:"Require authentication even on localhost"})]}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Role"}),(0,o.jsxs)("select",{value:ad.defaultRole,onChange:a=>ae(b=>({...b,defaultRole:a.target.value})),disabled:!aG||ah,className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60",children:[(0,o.jsx)("option",{value:"viewer",children:"Viewer"}),(0,o.jsx)("option",{value:"operator",children:"Operator"}),(0,o.jsx)("option",{value:"admin",children:"Admin"})]}),(0,o.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"This applies after identity verification when no explicit email or domain binding matches."})]})]}),(0,o.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,o.jsxs)("div",{className:"space-y-1",children:[(0,o.jsx)("h5",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Verified Edge Auth"}),(0,o.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Recommended for secure public phone access and free team collaboration. Conductor verifies the Cloudflare Access JWT instead of trusting a raw email header."})]}),(0,o.jsxs)("label",{className:"flex items-start gap-2 rounded-[4px] border border-[var(--vk-border)] px-3 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,o.jsx)("input",{type:"checkbox",checked:ad.trustedHeaders.enabled,onChange:a=>ae(b=>({...b,trustedHeaders:{...b.trustedHeaders,enabled:a.target.checked}})),disabled:!aG||ah,className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,o.jsx)("span",{children:"Enable verified Cloudflare Access authentication"})]}),(0,o.jsxs)("div",{className:"grid gap-3 lg:grid-cols-2",children:[(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Provider"}),(0,o.jsxs)("select",{value:ad.trustedHeaders.provider,onChange:a=>ae(b=>({...b,trustedHeaders:{...b.trustedHeaders,provider:a.target.value}})),disabled:!aG||ah,className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60",children:[(0,o.jsx)("option",{value:"cloudflare-access",children:"Cloudflare Access (verified JWT)"}),(0,o.jsx)("option",{value:"generic",children:"Generic header passthrough (advanced)"})]})]}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Identity Email Header"}),(0,o.jsx)("input",{value:ad.trustedHeaders.emailHeader,onChange:a=>ae(b=>({...b,trustedHeaders:{...b.trustedHeaders,emailHeader:a.target.value}})),disabled:!aG||ah,className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"})]}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"JWT Assertion Header"}),(0,o.jsx)("input",{value:ad.trustedHeaders.jwtHeader,onChange:a=>ae(b=>({...b,trustedHeaders:{...b.trustedHeaders,jwtHeader:a.target.value}})),disabled:!aG||ah,className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"})]}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Cloudflare Team Domain"}),(0,o.jsx)("input",{value:ad.trustedHeaders.teamDomain,onChange:a=>ae(b=>({...b,trustedHeaders:{...b.trustedHeaders,teamDomain:a.target.value}})),disabled:!aG||ah,placeholder:"your-team.cloudflareaccess.com",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"})]}),(0,o.jsxs)("label",{className:"block lg:col-span-2",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Cloudflare Access Audience"}),(0,o.jsx)("input",{value:ad.trustedHeaders.audience,onChange:a=>ae(b=>({...b,trustedHeaders:{...b.trustedHeaders,audience:a.target.value}})),disabled:!aG||ah,placeholder:"Copy the AUD value from your Cloudflare Access application",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"})]})]}),"generic"===ad.trustedHeaders.provider&&(0,o.jsx)("p",{className:"rounded-[4px] border border-[var(--vk-red)]/35 bg-[var(--vk-red)]/10 px-3 py-2 text-[12px] leading-5 text-[var(--vk-red)]",children:"Generic header passthrough is only safe when your reverse proxy strips user-supplied headers and injects identity itself. Conductor blocks this mode by default unless `CONDUCTOR_ALLOW_INSECURE_TRUSTED_HEADERS=true` is also set."})]}),(0,o.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,o.jsxs)("div",{className:"space-y-1",children:[(0,o.jsx)("h5",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Role Bindings"}),(0,o.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Map verified team identities into least-privilege roles. `viewer` can inspect work, `operator` can control agents, and `admin` can change global settings."})]}),(0,o.jsx)("div",{className:"grid gap-3 lg:grid-cols-2",children:[{label:"Viewer Emails",key:"viewers",placeholder:"alice@example.com"},{label:"Operator Emails",key:"operators",placeholder:"builder@example.com"},{label:"Admin Emails",key:"admins",placeholder:"owner@example.com"},{label:"Viewer Domains",key:"viewerDomains",placeholder:"guests.example.com"},{label:"Operator Domains",key:"operatorDomains",placeholder:"eng.example.com"},{label:"Admin Domains",key:"adminDomains",placeholder:"admins.example.com"}].map(({label:a,key:b,placeholder:c})=>(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:a}),(0,o.jsx)("textarea",{rows:4,value:ad.roles[b],onChange:a=>ae(c=>({...c,roles:{...c.roles,[b]:a.target.value}})),disabled:!aG||ah,placeholder:c,className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"}),(0,o.jsx)("p",{className:"mt-1 text-[11px] text-[var(--vk-text-muted)]",children:"One entry per line."})]},b))})]})]})]}):(0,o.jsxs)("section",{className:"space-y-3",children:[(0,o.jsx)("h4",{className:"text-[16px] font-medium text-[var(--vk-text-strong)]",children:av.label}),(0,o.jsx)("p",{className:"text-[14px] text-[var(--vk-text-muted)]",children:"This section is queued for implementation. General, Agents, Remote Access, and repository settings are available now."}),(0,o.jsx)("button",{type:"button",onClick:()=>s("general"),className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Open General"})]})}),(0,o.jsxs)("footer",{className:"flex flex-col gap-3 border-t border-[var(--vk-border)] px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-2",children:[(0,o.jsxs)("div",{className:"min-w-0",children:[aL&&(0,o.jsx)("p",{className:"truncate rounded-[4px] border border-[var(--vk-red)]/35 bg-[var(--vk-red)]/10 px-2 py-1 text-[12px] text-[var(--vk-red)]",children:aL}),!aL&&aB&&(0,o.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:aw?"Finish setup once here. You can change these preferences any time from Settings.":"Preferences are saved to your conductor config and applied immediately."}),!aL&&aC&&(0,o.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:aw?"These defaults will be used the first time workspaces and tasks are created for this repo.":"Repository settings are saved to your conductor config and used for future workspaces."}),!aL&&aD&&(0,o.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:"Organization access settings are written into `conductor.yaml`. Use admin role bindings for full control, operator bindings for day-to-day agent usage, and viewer bindings for read-only access."})]}),(0,o.jsxs)("div",{className:"flex w-full flex-wrap items-center justify-end gap-2 sm:w-auto",children:[!aw&&(0,o.jsx)("button",{type:"button",onClick:k,disabled:al,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Close"}),aw&&aC&&(0,o.jsx)("button",{type:"button",onClick:()=>s("preferences"),disabled:al,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Back"}),aB&&!aw&&(0,o.jsx)("button",{type:"button",onClick:()=>{aN(e.onboardingAcknowledged,{closeDialog:!0})},disabled:!aI||c,className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:c?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(dA.Loader2,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Saving..."]}):"Save"}),aC&&!aw&&(0,o.jsx)("button",{type:"button",onClick:()=>{aq()},disabled:!aJ||N||L,className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:N?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(dA.Loader2,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Saving..."]}):"Save Repository"}),aD&&!aw&&(0,o.jsx)("button",{type:"button",onClick:()=>{as()},disabled:!aK||ah,className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:ah?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(dA.Loader2,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Saving..."]}):"Save Access"}),aw&&(0,o.jsx)("button",{type:"button",onClick:()=>{ax?aO():aP()},disabled:ax?!aI||c||L:!aJ||al,className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:al||ax&&L?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(dA.Loader2,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),ax&&L?"Loading...":"Saving..."]}):ax&&aF?"Continue":"Finish Setup"})]})]})]})]})}),(0,o.jsx)(eF,{open:ab,initialPath:T?.path,title:"Select Repository Path",description:"Choose the local git repository folder.",onClose:()=>ac(!1),onSelect:a=>{ac(!1),a&&(U(b=>b?{...b,path:a,pathHealth:{...b.pathHealth,exists:!0,isGitRepository:!0,suggestedPath:null}}:b),ap(a))}})]})}function eJ(){return(0,o.jsx)(eD,{})}a.s(["default",()=>eJ],62587)}];
1
+ module.exports=[62587,a=>{"use strict";let b,c,d,e,f;var g,h,i,j,k,l,m,n,o=a.i(87924),p=a.i(19721),q=a.i(72131),r=a.i(7554),s=a.i(70121),t=a.i(50104),u=a.i(25152),v=a.i(30553),w=a.i(37738),x=a.i(7827),y=a.i(46872),z="dismissableLayer.update",A=q.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),B=q.forwardRef((a,b)=>{let{disableOutsidePointerEvents:c=!1,onEscapeKeyDown:d,onPointerDownOutside:e,onFocusOutside:f,onInteractOutside:g,onDismiss:h,...i}=a,j=q.useContext(A),[k,l]=q.useState(null),n=k?.ownerDocument??globalThis?.document,[,p]=q.useState({}),t=(0,s.useComposedRefs)(b,a=>l(a)),u=Array.from(j.layers),[w]=[...j.layersWithOutsidePointerEventsDisabled].slice(-1),x=u.indexOf(w),B=k?u.indexOf(k):-1,E=j.layersWithOutsidePointerEventsDisabled.size>0,F=B>=x,G=function(a,b=globalThis?.document){let c=(0,y.useCallbackRef)(a),d=q.useRef(!1),e=q.useRef(()=>{});return q.useEffect(()=>{let a=a=>{if(a.target&&!d.current){let d=function(){D("dismissableLayer.pointerDownOutside",c,f,{discrete:!0})},f={originalEvent:a};"touch"===a.pointerType?(b.removeEventListener("click",e.current),e.current=d,b.addEventListener("click",e.current,{once:!0})):d()}else b.removeEventListener("click",e.current);d.current=!1},f=window.setTimeout(()=>{b.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(f),b.removeEventListener("pointerdown",a),b.removeEventListener("click",e.current)}},[b,c]),{onPointerDownCapture:()=>d.current=!0}}(a=>{let b=a.target,c=[...j.branches].some(a=>a.contains(b));F&&!c&&(e?.(a),g?.(a),a.defaultPrevented||h?.())},n),H=function(a,b=globalThis?.document){let c=(0,y.useCallbackRef)(a),d=q.useRef(!1);return q.useEffect(()=>{let a=a=>{a.target&&!d.current&&D("dismissableLayer.focusOutside",c,{originalEvent:a},{discrete:!1})};return b.addEventListener("focusin",a),()=>b.removeEventListener("focusin",a)},[b,c]),{onFocusCapture:()=>d.current=!0,onBlurCapture:()=>d.current=!1}}(a=>{let b=a.target;![...j.branches].some(a=>a.contains(b))&&(f?.(a),g?.(a),a.defaultPrevented||h?.())},n);return!function(a,b=globalThis?.document){let c=(0,y.useCallbackRef)(a);q.useEffect(()=>{let a=a=>{"Escape"===a.key&&c(a)};return b.addEventListener("keydown",a,{capture:!0}),()=>b.removeEventListener("keydown",a,{capture:!0})},[c,b])}(a=>{B===j.layers.size-1&&(d?.(a),!a.defaultPrevented&&h&&(a.preventDefault(),h()))},n),q.useEffect(()=>{if(k)return c&&(0===j.layersWithOutsidePointerEventsDisabled.size&&(m=n.body.style.pointerEvents,n.body.style.pointerEvents="none"),j.layersWithOutsidePointerEventsDisabled.add(k)),j.layers.add(k),C(),()=>{c&&1===j.layersWithOutsidePointerEventsDisabled.size&&(n.body.style.pointerEvents=m)}},[k,n,c,j]),q.useEffect(()=>()=>{k&&(j.layers.delete(k),j.layersWithOutsidePointerEventsDisabled.delete(k),C())},[k,j]),q.useEffect(()=>{let a=()=>p({});return document.addEventListener(z,a),()=>document.removeEventListener(z,a)},[]),(0,o.jsx)(v.Primitive.div,{...i,ref:t,style:{pointerEvents:E?F?"auto":"none":void 0,...a.style},onFocusCapture:(0,r.composeEventHandlers)(a.onFocusCapture,H.onFocusCapture),onBlurCapture:(0,r.composeEventHandlers)(a.onBlurCapture,H.onBlurCapture),onPointerDownCapture:(0,r.composeEventHandlers)(a.onPointerDownCapture,G.onPointerDownCapture)})});function C(){let a=new CustomEvent(z);document.dispatchEvent(a)}function D(a,b,c,{discrete:d}){let e=c.originalEvent.target,f=new CustomEvent(a,{bubbles:!1,cancelable:!0,detail:c});b&&e.addEventListener(a,b,{once:!0}),d?(0,v.dispatchDiscreteCustomEvent)(e,f):e.dispatchEvent(f)}B.displayName="DismissableLayer",q.forwardRef((a,b)=>{let c=q.useContext(A),d=q.useRef(null),e=(0,s.useComposedRefs)(b,d);return q.useEffect(()=>{let a=d.current;if(a)return c.branches.add(a),()=>{c.branches.delete(a)}},[c.branches]),(0,o.jsx)(v.Primitive.div,{...a,ref:e})}).displayName="DismissableLayerBranch";var E=0;function F(){let a=document.createElement("span");return a.setAttribute("data-radix-focus-guard",""),a.tabIndex=0,a.style.outline="none",a.style.opacity="0",a.style.position="fixed",a.style.pointerEvents="none",a}var G="focusScope.autoFocusOnMount",H="focusScope.autoFocusOnUnmount",I={bubbles:!1,cancelable:!0},J=q.forwardRef((a,b)=>{let{loop:c=!1,trapped:d=!1,onMountAutoFocus:e,onUnmountAutoFocus:f,...g}=a,[h,i]=q.useState(null),j=(0,y.useCallbackRef)(e),k=(0,y.useCallbackRef)(f),l=q.useRef(null),m=(0,s.useComposedRefs)(b,a=>i(a)),n=q.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;q.useEffect(()=>{if(d){let a=function(a){if(n.paused||!h)return;let b=a.target;h.contains(b)?l.current=b:M(l.current,{select:!0})},b=function(a){if(n.paused||!h)return;let b=a.relatedTarget;null!==b&&(h.contains(b)||M(l.current,{select:!0}))};document.addEventListener("focusin",a),document.addEventListener("focusout",b);let c=new MutationObserver(function(a){if(document.activeElement===document.body)for(let b of a)b.removedNodes.length>0&&M(h)});return h&&c.observe(h,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",a),document.removeEventListener("focusout",b),c.disconnect()}}},[d,h,n.paused]),q.useEffect(()=>{if(h){N.add(n);let a=document.activeElement;if(!h.contains(a)){let b=new CustomEvent(G,I);h.addEventListener(G,j),h.dispatchEvent(b),b.defaultPrevented||(function(a,{select:b=!1}={}){let c=document.activeElement;for(let d of a)if(M(d,{select:b}),document.activeElement!==c)return}(K(h).filter(a=>"A"!==a.tagName),{select:!0}),document.activeElement===a&&M(h))}return()=>{h.removeEventListener(G,j),setTimeout(()=>{let b=new CustomEvent(H,I);h.addEventListener(H,k),h.dispatchEvent(b),b.defaultPrevented||M(a??document.body,{select:!0}),h.removeEventListener(H,k),N.remove(n)},0)}}},[h,j,k,n]);let p=q.useCallback(a=>{if(!c&&!d||n.paused)return;let b="Tab"===a.key&&!a.altKey&&!a.ctrlKey&&!a.metaKey,e=document.activeElement;if(b&&e){var f;let b,d=a.currentTarget,[g,h]=[L(b=K(f=d),f),L(b.reverse(),f)];g&&h?a.shiftKey||e!==h?a.shiftKey&&e===g&&(a.preventDefault(),c&&M(h,{select:!0})):(a.preventDefault(),c&&M(g,{select:!0})):e===d&&a.preventDefault()}},[c,d,n.paused]);return(0,o.jsx)(v.Primitive.div,{tabIndex:-1,...g,ref:m,onKeyDown:p})});function K(a){let b=[],c=document.createTreeWalker(a,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{let b="INPUT"===a.tagName&&"hidden"===a.type;return a.disabled||a.hidden||b?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;c.nextNode();)b.push(c.currentNode);return b}function L(a,b){for(let c of a)if(!function(a,{upTo:b}){if("hidden"===getComputedStyle(a).visibility)return!0;for(;a&&(void 0===b||a!==b);){if("none"===getComputedStyle(a).display)return!0;a=a.parentElement}return!1}(c,{upTo:b}))return c}function M(a,{select:b=!1}={}){if(a&&a.focus){var c;let d=document.activeElement;a.focus({preventScroll:!0}),a!==d&&(c=a)instanceof HTMLInputElement&&"select"in c&&b&&a.select()}}J.displayName="FocusScope";var N=(e=[],{add(a){let b=e[0];a!==b&&b?.pause(),(e=O(e,a)).unshift(a)},remove(a){e=O(e,a),e[0]?.resume()}});function O(a,b){let c=[...a],d=c.indexOf(b);return -1!==d&&c.splice(d,1),c}var P=a.i(92843);let Q=["top","right","bottom","left"],R=Math.min,S=Math.max,T=Math.round,U=Math.floor,V=a=>({x:a,y:a}),W={left:"right",right:"left",bottom:"top",top:"bottom"};function X(a,b){return"function"==typeof a?a(b):a}function Y(a){return a.split("-")[0]}function Z(a){return a.split("-")[1]}function $(a){return"x"===a?"y":"x"}function _(a){return"y"===a?"height":"width"}function aa(a){let b=a[0];return"t"===b||"b"===b?"y":"x"}function ab(a){return a.includes("start")?a.replace("start","end"):a.replace("end","start")}let ac=["left","right"],ad=["right","left"],ae=["top","bottom"],af=["bottom","top"];function ag(a){let b=Y(a);return W[b]+a.slice(b.length)}function ah(a){return"number"!=typeof a?{top:0,right:0,bottom:0,left:0,...a}:{top:a,right:a,bottom:a,left:a}}function ai(a){let{x:b,y:c,width:d,height:e}=a;return{width:d,height:e,top:c,left:b,right:b+d,bottom:c+e,x:b,y:c}}function aj(a,b,c){let d,{reference:e,floating:f}=a,g=aa(b),h=$(aa(b)),i=_(h),j=Y(b),k="y"===g,l=e.x+e.width/2-f.width/2,m=e.y+e.height/2-f.height/2,n=e[i]/2-f[i]/2;switch(j){case"top":d={x:l,y:e.y-f.height};break;case"bottom":d={x:l,y:e.y+e.height};break;case"right":d={x:e.x+e.width,y:m};break;case"left":d={x:e.x-f.width,y:m};break;default:d={x:e.x,y:e.y}}switch(Z(b)){case"start":d[h]-=n*(c&&k?-1:1);break;case"end":d[h]+=n*(c&&k?-1:1)}return d}async function ak(a,b){var c;void 0===b&&(b={});let{x:d,y:e,platform:f,rects:g,elements:h,strategy:i}=a,{boundary:j="clippingAncestors",rootBoundary:k="viewport",elementContext:l="floating",altBoundary:m=!1,padding:n=0}=X(b,a),o=ah(n),p=h[m?"floating"===l?"reference":"floating":l],q=ai(await f.getClippingRect({element:null==(c=await (null==f.isElement?void 0:f.isElement(p)))||c?p:p.contextElement||await (null==f.getDocumentElement?void 0:f.getDocumentElement(h.floating)),boundary:j,rootBoundary:k,strategy:i})),r="floating"===l?{x:d,y:e,width:g.floating.width,height:g.floating.height}:g.reference,s=await (null==f.getOffsetParent?void 0:f.getOffsetParent(h.floating)),t=await (null==f.isElement?void 0:f.isElement(s))&&await (null==f.getScale?void 0:f.getScale(s))||{x:1,y:1},u=ai(f.convertOffsetParentRelativeRectToViewportRelativeRect?await f.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:r,offsetParent:s,strategy:i}):r);return{top:(q.top-u.top+o.top)/t.y,bottom:(u.bottom-q.bottom+o.bottom)/t.y,left:(q.left-u.left+o.left)/t.x,right:(u.right-q.right+o.right)/t.x}}let al=async(a,b,c)=>{let{placement:d="bottom",strategy:e="absolute",middleware:f=[],platform:g}=c,h=g.detectOverflow?g:{...g,detectOverflow:ak},i=await (null==g.isRTL?void 0:g.isRTL(b)),j=await g.getElementRects({reference:a,floating:b,strategy:e}),{x:k,y:l}=aj(j,d,i),m=d,n=0,o={};for(let c=0;c<f.length;c++){let p=f[c];if(!p)continue;let{name:q,fn:r}=p,{x:s,y:t,data:u,reset:v}=await r({x:k,y:l,initialPlacement:d,placement:m,strategy:e,middlewareData:o,rects:j,platform:h,elements:{reference:a,floating:b}});k=null!=s?s:k,l=null!=t?t:l,o[q]={...o[q],...u},v&&n<50&&(n++,"object"==typeof v&&(v.placement&&(m=v.placement),v.rects&&(j=!0===v.rects?await g.getElementRects({reference:a,floating:b,strategy:e}):v.rects),{x:k,y:l}=aj(j,m,i)),c=-1)}return{x:k,y:l,placement:m,strategy:e,middlewareData:o}};function am(a,b){return{top:a.top-b.height,right:a.right-b.width,bottom:a.bottom-b.height,left:a.left-b.width}}function an(a){return Q.some(b=>a[b]>=0)}let ao=new Set(["left","top"]);async function ap(a,b){let{placement:c,platform:d,elements:e}=a,f=await (null==d.isRTL?void 0:d.isRTL(e.floating)),g=Y(c),h=Z(c),i="y"===aa(c),j=ao.has(g)?-1:1,k=f&&i?-1:1,l=X(b,a),{mainAxis:m,crossAxis:n,alignmentAxis:o}="number"==typeof l?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:l.mainAxis||0,crossAxis:l.crossAxis||0,alignmentAxis:l.alignmentAxis};return h&&"number"==typeof o&&(n="end"===h?-1*o:o),i?{x:n*k,y:m*j}:{x:m*j,y:n*k}}function aq(a){return function(a){return!1}(a)?(a.nodeName||"").toLowerCase():"#document"}function ar(a){var b;return(null==a||null==(b=a.ownerDocument)?void 0:b.defaultView)||window}function as(a){var b;return null==(b=(function(a){return!1}(a)?a.ownerDocument:a.document)||window.document)?void 0:b.documentElement}function at(a){return!1}function au(a){let{overflow:b,overflowX:c,overflowY:d,display:e}=aC(a);return/auto|scroll|overlay|hidden|clip/.test(b+d+c)&&"inline"!==e&&"contents"!==e}function av(a){try{if(a.matches(":popover-open"))return!0}catch(a){}try{return a.matches(":modal")}catch(a){return!1}}let aw=/transform|translate|scale|rotate|perspective|filter/,ax=/paint|layout|strict|content/,ay=a=>!!a&&"none"!==a;function az(a){let b=a;return ay(b.transform)||ay(b.translate)||ay(b.scale)||ay(b.rotate)||ay(b.perspective)||!aA()&&(ay(b.backdropFilter)||ay(b.filter))||aw.test(b.willChange||"")||ax.test(b.contain||"")}function aA(){return null==b&&(b="u">typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),b}function aB(a){return/^(html|body|#document)$/.test(aq(a))}function aC(a){return ar(a).getComputedStyle(a)}function aD(a){return{scrollLeft:a.scrollX,scrollTop:a.scrollY}}function aE(a){if("html"===aq(a))return a;let b=a.assignedSlot||a.parentNode||!1||as(a);return b}function aF(a,b,c){var d;void 0===b&&(b=[]),void 0===c&&(c=!0);let e=function a(b){let c=aE(b);return aB(c)?b.ownerDocument?b.ownerDocument.body:b.body:a(c)}(a),f=e===(null==(d=a.ownerDocument)?void 0:d.body),g=ar(e);if(!f)return b.concat(e,aF(e,[],c));{let a=aG(g);return b.concat(g,g.visualViewport||[],au(e)?e:[],a&&c?aF(a):[])}}function aG(a){return a.parent&&Object.getPrototypeOf(a.parent)?a.frameElement:null}function aH(a){let b=aC(a),c=parseFloat(b.width)||0,d=parseFloat(b.height)||0,e=!1,f=e?a.offsetWidth:c,g=e?a.offsetHeight:d,h=T(c)!==f||T(d)!==g;return h&&(c=f,d=g),{width:c,height:d,$:h}}function aI(a){return 0,a.contextElement}function aJ(a){let b=aI(a);1;return V(1)}let aK=V(0);function aL(a){let b=ar(a);return aA()&&b.visualViewport?{x:b.visualViewport.offsetLeft,y:b.visualViewport.offsetTop}:aK}function aM(a,b,c,d){var e;void 0===b&&(b=!1),void 0===c&&(c=!1);let f=a.getBoundingClientRect(),g=aI(a),h=V(1);b&&(d||(h=aJ(a)));let i=(void 0===(e=c)&&(e=!1),d&&(!e||d===ar(g))&&e)?aL(g):V(0),j=(f.left+i.x)/h.x,k=(f.top+i.y)/h.y,l=f.width/h.x,m=f.height/h.y;if(g){let a=ar(g),b=d,c=a,e=aG(c);for(;e&&d&&b!==c;){let a=aJ(e),b=e.getBoundingClientRect(),d=aC(e),f=b.left+(e.clientLeft+parseFloat(d.paddingLeft))*a.x,g=b.top+(e.clientTop+parseFloat(d.paddingTop))*a.y;j*=a.x,k*=a.y,l*=a.x,m*=a.y,j+=f,k+=g,e=aG(c=ar(e))}}return ai({width:l,height:m,x:j,y:k})}function aN(a,b){let c=aD(a).scrollLeft;return b?b.left+c:aM(as(a)).left+c}function aO(a,b){let c=a.getBoundingClientRect();return{x:c.left+b.scrollLeft-aN(a,c),y:c.top+b.scrollTop}}function aP(a,b,c){var d;let e;if("viewport"===b)e=function(a,b){let c=ar(a),d=as(a),e=c.visualViewport,f=d.clientWidth,g=d.clientHeight,h=0,i=0;if(e){f=e.width,g=e.height;let a=aA();(!a||a&&"fixed"===b)&&(h=e.offsetLeft,i=e.offsetTop)}let j=aN(d);if(j<=0){let a=d.ownerDocument,b=a.body,c=getComputedStyle(b),e="CSS1Compat"===a.compatMode&&parseFloat(c.marginLeft)+parseFloat(c.marginRight)||0,g=Math.abs(d.clientWidth-b.clientWidth-e);g<=25&&(f-=g)}else j<=25&&(f+=j);return{width:f,height:g,x:h,y:i}}(a,c);else if("document"===b){let b,c,f,g,h,i,j;d=as(a),b=as(d),c=aD(d),f=d.ownerDocument.body,g=S(b.scrollWidth,b.clientWidth,f.scrollWidth,f.clientWidth),h=S(b.scrollHeight,b.clientHeight,f.scrollHeight,f.clientHeight),i=-c.scrollLeft+aN(d),j=-c.scrollTop,"rtl"===aC(f).direction&&(i+=S(b.clientWidth,f.clientWidth)-g),e={width:g,height:h,x:i,y:j}}else{1;{let c=aL(a);e={x:b.x-c.x,y:b.y-c.y,width:b.width,height:b.height}}}return ai(e)}function aQ(a){return"static"===aC(a).position}function aR(a,b){1;return null}function aS(a,b){var c;let d=ar(a);if(av(a))return d;1;{let b=aE(a);for(;b&&!aB(b);){0;b=aE(b)}return d}}let aT=async function(a){let b=this.getOffsetParent||aS,c=this.getDimensions,d=await c(a.floating);return{reference:function(a,b,c){var d;let e=(d=0,!1),f=as(b),g="fixed"===c,h=aM(a,!0,g,b),i={scrollLeft:0,scrollTop:0},j=V(0);if(e||!e&&!g)if(("body"!==aq(b)||au(f))&&(i=aD(b)),e){let a=aM(b,!0,g,b);j.x=a.x+b.clientLeft,j.y=a.y+b.clientTop}else f&&(j.x=aN(f));g&&!e&&f&&(j.x=aN(f));let k=!f||e||g?V(0):aO(f,i);return{x:h.left+i.scrollLeft-j.x-k.x,y:h.top+i.scrollTop-j.y-k.y,width:h.width,height:h.height}}(a.reference,await b(a.floating),a.strategy),floating:{x:0,y:0,width:d.width,height:d.height}}},aU={convertOffsetParentRelativeRectToViewportRelativeRect:function(a){var b;let{elements:c,rect:d,offsetParent:e,strategy:f}=a,g="fixed"===f,h=as(e),i=!!c&&av(c.floating);if(e===h||i&&g)return d;let j={scrollLeft:0,scrollTop:0},k=V(1),l=V(0),m=(b=0,!1);if((m||!m&&!g)&&(("body"!==aq(e)||au(h))&&(j=aD(e)),m)){let a=aM(e);k=aJ(e),l.x=a.x+e.clientLeft,l.y=a.y+e.clientTop}let n=!h||m||g?V(0):aO(h,j);return{width:d.width*k.x,height:d.height*k.y,x:d.x*k.x-j.scrollLeft*k.x+l.x+n.x,y:d.y*k.y-j.scrollTop*k.y+l.y+n.y}},getDocumentElement:as,getClippingRect:function(a){let{element:b,boundary:c,rootBoundary:d,strategy:e}=a,f=[..."clippingAncestors"===c?av(b)?[]:function(a,b){var c;let d=b.get(a);if(d)return d;let e=aF(a,[],!1).filter(a=>{var b;return b=0,!1}),f="fixed"===aC(a).position,g=f?aE(a):a;return c=0,b.set(a,e),e}(b,this._c):[].concat(c),d],g=aP(b,f[0],e),h=g.top,i=g.right,j=g.bottom,k=g.left;for(let a=1;a<f.length;a++){let c=aP(b,f[a],e);h=S(c.top,h),i=R(c.right,i),j=R(c.bottom,j),k=S(c.left,k)}return{width:i-k,height:j-h,x:k,y:h}},getOffsetParent:aS,getElementRects:aT,getClientRects:function(a){return Array.from(a.getClientRects())},getDimensions:function(a){let{width:b,height:c}=aH(a);return{width:b,height:c}},getScale:aJ,isElement:at,isRTL:function(a){return"rtl"===aC(a).direction}};function aV(a,b){return a.x===b.x&&a.y===b.y&&a.width===b.width&&a.height===b.height}let aW=a=>({name:"arrow",options:a,async fn(b){let{x:c,y:d,placement:e,rects:f,platform:g,elements:h,middlewareData:i}=b,{element:j,padding:k=0}=X(a,b)||{};if(null==j)return{};let l=ah(k),m={x:c,y:d},n=$(aa(e)),o=_(n),p=await g.getDimensions(j),q="y"===n,r=q?"clientHeight":"clientWidth",s=f.reference[o]+f.reference[n]-m[n]-f.floating[o],t=m[n]-f.reference[n],u=await (null==g.getOffsetParent?void 0:g.getOffsetParent(j)),v=u?u[r]:0;v&&await (null==g.isElement?void 0:g.isElement(u))||(v=h.floating[r]||f.floating[o]);let w=v/2-p[o]/2-1,x=R(l[q?"top":"left"],w),y=R(l[q?"bottom":"right"],w),z=v-p[o]-y,A=v/2-p[o]/2+(s/2-t/2),B=S(x,R(A,z)),C=!i.arrow&&null!=Z(e)&&A!==B&&f.reference[o]/2-(A<x?x:y)-p[o]/2<0,D=C?A<x?A-x:A-z:0;return{[n]:m[n]+D,data:{[n]:B,centerOffset:A-B-D,...C&&{alignmentOffset:D}},reset:C}}});var aX=a.i(35112),aY="u">typeof document?q.useLayoutEffect:function(){};function aZ(a,b){let c,d,e;if(a===b)return!0;if(typeof a!=typeof b)return!1;if("function"==typeof a&&a.toString()===b.toString())return!0;if(a&&b&&"object"==typeof a){if(Array.isArray(a)){if((c=a.length)!==b.length)return!1;for(d=c;0!=d--;)if(!aZ(a[d],b[d]))return!1;return!0}if((c=(e=Object.keys(a)).length)!==Object.keys(b).length)return!1;for(d=c;0!=d--;)if(!({}).hasOwnProperty.call(b,e[d]))return!1;for(d=c;0!=d--;){let c=e[d];if(("_owner"!==c||!a.$$typeof)&&!aZ(a[c],b[c]))return!1}return!0}return a!=a&&b!=b}function a$(a,b){let c=1;return Math.round(b*c)/c}function a_(a){let b=q.useRef(a);return aY(()=>{b.current=a}),b}var a0=q.forwardRef((a,b)=>{let{children:c,width:d=10,height:e=5,...f}=a;return(0,o.jsx)(v.Primitive.svg,{...f,ref:b,width:d,height:e,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:a.asChild?c:(0,o.jsx)("polygon",{points:"0,0 30,0 15,10"})})});a0.displayName="Arrow";var a1=a.i(72752),a2="Popper",[a3,a4]=(0,t.createContextScope)(a2),[a5,a6]=a3(a2),a7=a=>{let{__scopePopper:b,children:c}=a,[d,e]=q.useState(null);return(0,o.jsx)(a5,{scope:b,anchor:d,onAnchorChange:e,children:c})};a7.displayName=a2;var a8="PopperAnchor",a9=q.forwardRef((a,b)=>{let{__scopePopper:c,virtualRef:d,...e}=a,f=a6(a8,c),g=q.useRef(null),h=(0,s.useComposedRefs)(b,g),i=q.useRef(null);return q.useEffect(()=>{let a=i.current;i.current=d?.current||g.current,a!==i.current&&f.onAnchorChange(i.current)}),d?null:(0,o.jsx)(v.Primitive.div,{...e,ref:h})});a9.displayName=a8;var ba="PopperContent",[bb,bc]=a3(ba),bd=q.forwardRef((a,b)=>{var c,d,e,f,g,h,i,j,k,l,m,n,p,r,t,u,w,x,z,A,B;let C,D,E,F,G,H,{__scopePopper:I,side:J="bottom",sideOffset:K=0,align:L="center",alignOffset:M=0,arrowPadding:N=0,avoidCollisions:O=!0,collisionBoundary:P=[],collisionPadding:Q=0,sticky:T="partial",hideWhenDetached:V=!1,updatePositionStrategy:W="optimized",onPlaced:ah,...ai}=a,aj=a6(ba,I),[ak,aq]=q.useState(null),ar=(0,s.useComposedRefs)(b,a=>aq(a)),[at,au]=q.useState(null),av=function(a){let[b,c]=q.useState(void 0);return(0,a1.useLayoutEffect)(()=>{if(a){c({width:a.offsetWidth,height:a.offsetHeight});let b=new ResizeObserver(b=>{let d,e;if(!Array.isArray(b)||!b.length)return;let f=b[0];if("borderBoxSize"in f){let a=f.borderBoxSize,b=Array.isArray(a)?a[0]:a;d=b.inlineSize,e=b.blockSize}else d=a.offsetWidth,e=a.offsetHeight;c({width:d,height:e})});return b.observe(a,{box:"border-box"}),()=>b.unobserve(a)}c(void 0)},[a]),b}(at),aw=av?.width??0,ax=av?.height??0,ay="number"==typeof Q?Q:{top:0,right:0,bottom:0,left:0,...Q},az=Array.isArray(P)?P:[P],aA=az.length>0,aB={padding:ay,boundary:az.filter(bh),altBoundary:aA},{refs:aC,floatingStyles:aD,placement:aE,isPositioned:aG,middlewareData:aH}=function(a){void 0===a&&(a={});let{placement:b="bottom",strategy:c="absolute",middleware:d=[],platform:e,elements:{reference:f,floating:g}={},transform:h=!0,whileElementsMounted:i,open:j}=a,[k,l]=q.useState({x:0,y:0,strategy:c,placement:b,middlewareData:{},isPositioned:!1}),[m,n]=q.useState(d);aZ(m,d)||n(d);let[o,p]=q.useState(null),[r,s]=q.useState(null),t=q.useCallback(a=>{a!==x.current&&(x.current=a,p(a))},[]),u=q.useCallback(a=>{a!==y.current&&(y.current=a,s(a))},[]),v=f||o,w=g||r,x=q.useRef(null),y=q.useRef(null),z=q.useRef(k),A=null!=i,B=a_(i),C=a_(e),D=a_(j),E=q.useCallback(()=>{var a,d;let e,f,g;if(!x.current||!y.current)return;let h={placement:b,strategy:c,middleware:m};C.current&&(h.platform=C.current),(a=x.current,d=y.current,e=new Map,g={...(f={platform:aU,...h}).platform,_c:e},al(a,d,{...f,platform:g})).then(a=>{let b={...a,isPositioned:!1!==D.current};F.current&&!aZ(z.current,b)&&(z.current=b,aX.flushSync(()=>{l(b)}))})},[m,b,c,C,D]);aY(()=>{!1===j&&z.current.isPositioned&&(z.current.isPositioned=!1,l(a=>({...a,isPositioned:!1})))},[j]);let F=q.useRef(!1);aY(()=>(F.current=!0,()=>{F.current=!1}),[]),aY(()=>{if(v&&(x.current=v),w&&(y.current=w),v&&w){if(B.current)return B.current(v,w,E);E()}},[v,w,E,B,A]);let G=q.useMemo(()=>({reference:x,floating:y,setReference:t,setFloating:u}),[t,u]),H=q.useMemo(()=>({reference:v,floating:w}),[v,w]),I=q.useMemo(()=>{let a={position:c,left:0,top:0};if(!H.floating)return a;let b=a$(H.floating,k.x),d=a$(H.floating,k.y);if(h)return{...a,transform:"translate("+b+"px, "+d+"px)",...(H.floating,false)};return{position:c,left:b,top:d}},[c,h,H.floating,k.x,k.y]);return q.useMemo(()=>({...k,update:E,refs:G,elements:H,floatingStyles:I}),[k,E,G,H,I])}({strategy:"fixed",placement:J+("center"!==L?"-"+L:""),whileElementsMounted:(...a)=>(function(a,b,c,d){let e;void 0===d&&(d={});let{ancestorScroll:f=!0,ancestorResize:g=!0,elementResize:h="function"==typeof ResizeObserver,layoutShift:i="function"==typeof IntersectionObserver,animationFrame:j=!1}=d,k=aI(a),l=f||g?[...k?aF(k):[],...b?aF(b):[]]:[];l.forEach(a=>{f&&a.addEventListener("scroll",c,{passive:!0}),g&&a.addEventListener("resize",c)});let m=k&&i?function(a,b){let c,d=null,e=as(a);function f(){var a;clearTimeout(c),null==(a=d)||a.disconnect(),d=null}return!function g(h,i){void 0===h&&(h=!1),void 0===i&&(i=1),f();let j=a.getBoundingClientRect(),{left:k,top:l,width:m,height:n}=j;if(h||b(),!m||!n)return;let o={rootMargin:-U(l)+"px "+-U(e.clientWidth-(k+m))+"px "+-U(e.clientHeight-(l+n))+"px "+-U(k)+"px",threshold:S(0,R(1,i))||1},p=!0;function q(b){let d=b[0].intersectionRatio;if(d!==i){if(!p)return g();d?g(!1,d):c=setTimeout(()=>{g(!1,1e-7)},1e3)}1!==d||aV(j,a.getBoundingClientRect())||g(),p=!1}try{d=new IntersectionObserver(q,{...o,root:e.ownerDocument})}catch(a){d=new IntersectionObserver(q,o)}d.observe(a)}(!0),f}(k,c):null,n=-1,o=null;h&&(o=new ResizeObserver(a=>{let[d]=a;d&&d.target===k&&o&&b&&(o.unobserve(b),cancelAnimationFrame(n),n=requestAnimationFrame(()=>{var a;null==(a=o)||a.observe(b)})),c()}),k&&!j&&o.observe(k),b&&o.observe(b));let p=j?aM(a):null;return j&&function b(){let d=aM(a);p&&!aV(p,d)&&c(),p=d,e=requestAnimationFrame(b)}(),c(),()=>{var a;l.forEach(a=>{f&&a.removeEventListener("scroll",c),g&&a.removeEventListener("resize",c)}),null==m||m(),null==(a=o)||a.disconnect(),o=null,j&&cancelAnimationFrame(e)}})(...a,{animationFrame:"always"===W}),elements:{reference:aj.anchor},middleware:[{name:(C={name:"offset",options:e=c={mainAxis:K+ax,alignmentAxis:M},async fn(a){var b,c;let{x:d,y:f,placement:g,middlewareData:h}=a,i=await ap(a,e);return g===(null==(b=h.offset)?void 0:b.placement)&&null!=(c=h.arrow)&&c.alignmentOffset?{}:{x:d+i.x,y:f+i.y,data:{...i,placement:g}}}}).name,fn:C.fn,options:[c,d]},O&&{name:(D={name:"shift",options:k=i={mainAxis:!0,crossAxis:!1,limiter:"partial"===T?{fn:(void 0===(h=f)&&(h={}),{options:h,fn(a){let{x:b,y:c,placement:d,rects:e,middlewareData:f}=a,{offset:g=0,mainAxis:i=!0,crossAxis:j=!0}=X(h,a),k={x:b,y:c},l=aa(d),m=$(l),n=k[m],o=k[l],p=X(g,a),q="number"==typeof p?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(i){let a="y"===m?"height":"width",b=e.reference[m]-e.floating[a]+q.mainAxis,c=e.reference[m]+e.reference[a]-q.mainAxis;n<b?n=b:n>c&&(n=c)}if(j){var r,s;let a="y"===m?"width":"height",b=ao.has(Y(d)),c=e.reference[l]-e.floating[a]+(b&&(null==(r=f.offset)?void 0:r[l])||0)+(b?0:q.crossAxis),g=e.reference[l]+e.reference[a]+(b?0:(null==(s=f.offset)?void 0:s[l])||0)-(b?q.crossAxis:0);o<c?o=c:o>g&&(o=g)}return{[m]:n,[l]:o}}}).fn,options:[f,g]}:void 0,...aB},async fn(a){let{x:b,y:c,placement:d,platform:e}=a,{mainAxis:f=!0,crossAxis:g=!1,limiter:h={fn:a=>{let{x:b,y:c}=a;return{x:b,y:c}}},...i}=X(k,a),j={x:b,y:c},l=await e.detectOverflow(a,i),m=aa(Y(d)),n=$(m),o=j[n],p=j[m];if(f){let a="y"===n?"top":"left",b="y"===n?"bottom":"right",c=o+l[a],d=o-l[b];o=S(c,R(o,d))}if(g){let a="y"===m?"top":"left",b="y"===m?"bottom":"right",c=p+l[a],d=p-l[b];p=S(c,R(p,d))}let q=h.fn({...a,[n]:o,[m]:p});return{...q,data:{x:q.x-b,y:q.y-c,enabled:{[n]:f,[m]:g}}}}}).name,fn:D.fn,options:[i,j]},O&&{name:(E={name:"flip",options:n=l={...aB},async fn(a){var b,c,d,e,f,g,h,i;let j,k,l,{placement:m,middlewareData:o,rects:p,initialPlacement:q,platform:r,elements:s}=a,{mainAxis:t=!0,crossAxis:u=!0,fallbackPlacements:v,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:y=!0,...z}=X(n,a);if(null!=(b=o.arrow)&&b.alignmentOffset)return{};let A=Y(m),B=aa(q),C=Y(q)===q,D=await (null==r.isRTL?void 0:r.isRTL(s.floating)),E=v||(C||!y?[ag(q)]:(j=ag(q),[ab(q),j,ab(j)])),F="none"!==x;!v&&F&&E.push(...(k=Z(q),l=function(a,b,c){switch(a){case"top":case"bottom":if(c)return b?ad:ac;return b?ac:ad;case"left":case"right":return b?ae:af;default:return[]}}(Y(q),"start"===x,D),k&&(l=l.map(a=>a+"-"+k),y&&(l=l.concat(l.map(ab)))),l));let G=[q,...E],H=await r.detectOverflow(a,z),I=[],J=(null==(c=o.flip)?void 0:c.overflows)||[];if(t&&I.push(H[A]),u){let a,b,c,d,e=(g=m,h=p,void 0===(i=D)&&(i=!1),a=Z(g),c=_(b=$(aa(g))),d="x"===b?a===(i?"end":"start")?"right":"left":"start"===a?"bottom":"top",h.reference[c]>h.floating[c]&&(d=ag(d)),[d,ag(d)]);I.push(H[e[0]],H[e[1]])}if(J=[...J,{placement:m,overflows:I}],!I.every(a=>a<=0)){let a=((null==(d=o.flip)?void 0:d.index)||0)+1,b=G[a];if(b&&("alignment"!==u||B===aa(b)||J.every(a=>aa(a.placement)!==B||a.overflows[0]>0)))return{data:{index:a,overflows:J},reset:{placement:b}};let c=null==(e=J.filter(a=>a.overflows[0]<=0).sort((a,b)=>a.overflows[1]-b.overflows[1])[0])?void 0:e.placement;if(!c)switch(w){case"bestFit":{let a=null==(f=J.filter(a=>{if(F){let b=aa(a.placement);return b===B||"y"===b}return!0}).map(a=>[a.placement,a.overflows.filter(a=>a>0).reduce((a,b)=>a+b,0)]).sort((a,b)=>a[1]-b[1])[0])?void 0:f[0];a&&(c=a);break}case"initialPlacement":c=q}if(m!==c)return{reset:{placement:c}}}return{}}}).name,fn:E.fn,options:[l,m]},{name:(F={name:"size",options:t=p={...aB,apply:({elements:a,rects:b,availableWidth:c,availableHeight:d})=>{let{width:e,height:f}=b.reference,g=a.floating.style;g.setProperty("--radix-popper-available-width",`${c}px`),g.setProperty("--radix-popper-available-height",`${d}px`),g.setProperty("--radix-popper-anchor-width",`${e}px`),g.setProperty("--radix-popper-anchor-height",`${f}px`)}},async fn(a){var b,c;let d,e,{placement:f,rects:g,platform:h,elements:i}=a,{apply:j=()=>{},...k}=X(t,a),l=await h.detectOverflow(a,k),m=Y(f),n=Z(f),o="y"===aa(f),{width:p,height:q}=g.floating;"top"===m||"bottom"===m?(d=m,e=n===(await (null==h.isRTL?void 0:h.isRTL(i.floating))?"start":"end")?"left":"right"):(e=m,d="end"===n?"top":"bottom");let r=q-l.top-l.bottom,s=p-l.left-l.right,u=R(q-l[d],r),v=R(p-l[e],s),w=!a.middlewareData.shift,x=u,y=v;if(null!=(b=a.middlewareData.shift)&&b.enabled.x&&(y=s),null!=(c=a.middlewareData.shift)&&c.enabled.y&&(x=r),w&&!n){let a=S(l.left,0),b=S(l.right,0),c=S(l.top,0),d=S(l.bottom,0);o?y=p-2*(0!==a||0!==b?a+b:S(l.left,l.right)):x=q-2*(0!==c||0!==d?c+d:S(l.top,l.bottom))}await j({...a,availableWidth:y,availableHeight:x});let z=await h.getDimensions(i.floating);return p!==z.width||q!==z.height?{reset:{rects:!0}}:{}}}).name,fn:F.fn,options:[p,r]},at&&{name:(G={name:"arrow",options:x=u={element:at,padding:N},fn(a){let{element:b,padding:c}="function"==typeof x?x(a):x;return b&&({}).hasOwnProperty.call(b,"current")?null!=b.current?aW({element:b.current,padding:c}).fn(a):{}:b?aW({element:b,padding:c}).fn(a):{}}}).name,fn:G.fn,options:[u,w]},bi({arrowWidth:aw,arrowHeight:ax}),V&&{name:(H={name:"hide",options:B=z={strategy:"referenceHidden",...aB},async fn(a){let{rects:b,platform:c}=a,{strategy:d="referenceHidden",...e}=X(B,a);switch(d){case"referenceHidden":{let d=am(await c.detectOverflow(a,{...e,elementContext:"reference"}),b.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:an(d)}}}case"escaped":{let d=am(await c.detectOverflow(a,{...e,altBoundary:!0}),b.floating);return{data:{escapedOffsets:d,escaped:an(d)}}}default:return{}}}}).name,fn:H.fn,options:[z,A]}]}),[aJ,aK]=bj(aE),aL=(0,y.useCallbackRef)(ah);(0,a1.useLayoutEffect)(()=>{aG&&aL?.()},[aG,aL]);let aN=aH.arrow?.x,aO=aH.arrow?.y,aP=aH.arrow?.centerOffset!==0,[aQ,aR]=q.useState();return(0,a1.useLayoutEffect)(()=>{ak&&aR(window.getComputedStyle(ak).zIndex)},[ak]),(0,o.jsx)("div",{ref:aC.setFloating,"data-radix-popper-content-wrapper":"",style:{...aD,transform:aG?aD.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:aQ,"--radix-popper-transform-origin":[aH.transformOrigin?.x,aH.transformOrigin?.y].join(" "),...aH.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:a.dir,children:(0,o.jsx)(bb,{scope:I,placedSide:aJ,onArrowChange:au,arrowX:aN,arrowY:aO,shouldHideArrow:aP,children:(0,o.jsx)(v.Primitive.div,{"data-side":aJ,"data-align":aK,...ai,ref:ar,style:{...ai.style,animation:aG?void 0:"none"}})})})});bd.displayName=ba;var be="PopperArrow",bf={top:"bottom",right:"left",bottom:"top",left:"right"},bg=q.forwardRef(function(a,b){let{__scopePopper:c,...d}=a,e=bc(be,c),f=bf[e.placedSide];return(0,o.jsx)("span",{ref:e.onArrowChange,style:{position:"absolute",left:e.arrowX,top:e.arrowY,[f]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[e.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[e.placedSide],visibility:e.shouldHideArrow?"hidden":void 0},children:(0,o.jsx)(a0,{...d,ref:b,style:{...d.style,display:"block"}})})});function bh(a){return null!==a}bg.displayName=be;var bi=a=>({name:"transformOrigin",options:a,fn(b){let{placement:c,rects:d,middlewareData:e}=b,f=e.arrow?.centerOffset!==0,g=f?0:a.arrowWidth,h=f?0:a.arrowHeight,[i,j]=bj(c),k={start:"0%",center:"50%",end:"100%"}[j],l=(e.arrow?.x??0)+g/2,m=(e.arrow?.y??0)+h/2,n="",o="";return"bottom"===i?(n=f?k:`${l}px`,o=`${-h}px`):"top"===i?(n=f?k:`${l}px`,o=`${d.floating.height+h}px`):"right"===i?(n=`${-h}px`,o=f?k:`${m}px`):"left"===i&&(n=`${d.floating.width+h}px`,o=f?k:`${m}px`),{data:{x:n,y:o}}}});function bj(a){let[b,c="center"]=a.split("-");return[b,c]}var bk=q.forwardRef((a,b)=>{let{container:c,...d}=a,[e,f]=q.useState(!1);(0,a1.useLayoutEffect)(()=>f(!0),[]);let g=c||e&&globalThis?.document?.body;return g?aX.default.createPortal((0,o.jsx)(v.Primitive.div,{...d,ref:b}),g):null});bk.displayName="Portal";var bl=a.i(77192),bm=a.i(44572),bn=Symbol("radix.slottable");function bo(a){return q.isValidElement(a)&&"function"==typeof a.type&&"__radixId"in a.type&&a.type.__radixId===bn}var bp=new WeakMap,bq=new WeakMap,br={},bs=0,bt=function(a){return a&&(a.host||bt(a.parentNode))},bu=function(a,b,c,d){var e=(Array.isArray(a)?a:[a]).map(function(a){if(b.contains(a))return a;var c=bt(a);return c&&b.contains(c)?c:(console.error("aria-hidden",a,"in not contained inside",b,". Doing nothing"),null)}).filter(function(a){return!!a});br[c]||(br[c]=new WeakMap);var f=br[c],g=[],h=new Set,i=new Set(e),j=function(a){!a||h.has(a)||(h.add(a),j(a.parentNode))};e.forEach(j);var k=function(a){!a||i.has(a)||Array.prototype.forEach.call(a.children,function(a){if(h.has(a))k(a);else try{var b=a.getAttribute(d),e=null!==b&&"false"!==b,i=(bp.get(a)||0)+1,j=(f.get(a)||0)+1;bp.set(a,i),f.set(a,j),g.push(a),1===i&&e&&bq.set(a,!0),1===j&&a.setAttribute(c,"true"),e||a.setAttribute(d,"true")}catch(b){console.error("aria-hidden: cannot operate on ",a,b)}})};return k(b),h.clear(),bs++,function(){g.forEach(function(a){var b=bp.get(a)-1,e=f.get(a)-1;bp.set(a,b),f.set(a,e),b||(bq.has(a)||a.removeAttribute(d),bq.delete(a)),e||a.removeAttribute(c)}),--bs||(bp=new WeakMap,bp=new WeakMap,bq=new WeakMap,br={})}},bv=function(a,b,c){void 0===c&&(c="data-aria-hidden");var d=Array.from(Array.isArray(a)?a:[a]),e=b||("u"<typeof document?null:(Array.isArray(a)?a[0]:a).ownerDocument.body);return e?(d.push.apply(d,Array.from(e.querySelectorAll("[aria-live], script"))),bu(d,e,c,"aria-hidden")):function(){return null}},bw=function(){return(bw=Object.assign||function(a){for(var b,c=1,d=arguments.length;c<d;c++)for(var e in b=arguments[c])Object.prototype.hasOwnProperty.call(b,e)&&(a[e]=b[e]);return a}).apply(this,arguments)};function bx(a,b){var c={};for(var d in a)Object.prototype.hasOwnProperty.call(a,d)&&0>b.indexOf(d)&&(c[d]=a[d]);if(null!=a&&"function"==typeof Object.getOwnPropertySymbols)for(var e=0,d=Object.getOwnPropertySymbols(a);e<d.length;e++)0>b.indexOf(d[e])&&Object.prototype.propertyIsEnumerable.call(a,d[e])&&(c[d[e]]=a[d[e]]);return c}var by=("function"==typeof SuppressedError&&SuppressedError,"right-scroll-bar-position"),bz="width-before-scroll-bar";function bA(a,b){return"function"==typeof a?a(b):a&&(a.current=b),a}var bB=q.useEffect,bC=new WeakMap,bD=(void 0===g&&(g={}),(void 0===h&&(h=function(a){return a}),i=[],j=!1,k={read:function(){if(j)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return i.length?i[i.length-1]:null},useMedium:function(a){var b=h(a,j);return i.push(b),function(){i=i.filter(function(a){return a!==b})}},assignSyncMedium:function(a){for(j=!0;i.length;){var b=i;i=[],b.forEach(a)}i={push:function(b){return a(b)},filter:function(){return i}}},assignMedium:function(a){j=!0;var b=[];if(i.length){var c=i;i=[],c.forEach(a),b=i}var d=function(){var c=b;b=[],c.forEach(a)},e=function(){return Promise.resolve().then(d)};e(),i={push:function(a){b.push(a),e()},filter:function(a){return b=b.filter(a),i}}}}).options=bw({async:!0,ssr:!1},g),k),bE=function(){},bF=q.forwardRef(function(a,b){var c,d,e,f,g=q.useRef(null),h=q.useState({onScrollCapture:bE,onWheelCapture:bE,onTouchMoveCapture:bE}),i=h[0],j=h[1],k=a.forwardProps,l=a.children,m=a.className,n=a.removeScrollBar,o=a.enabled,p=a.shards,r=a.sideCar,s=a.noRelative,t=a.noIsolation,u=a.inert,v=a.allowPinchZoom,w=a.as,x=a.gapMode,y=bx(a,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),z=(c=[g,b],d=function(a){return c.forEach(function(b){return bA(b,a)})},(e=(0,q.useState)(function(){return{value:null,callback:d,facade:{get current(){return e.value},set current(value){var a=e.value;a!==value&&(e.value=value,e.callback(value,a))}}}})[0]).callback=d,f=e.facade,bB(function(){var a=bC.get(f);if(a){var b=new Set(a),d=new Set(c),e=f.current;b.forEach(function(a){d.has(a)||bA(a,null)}),d.forEach(function(a){b.has(a)||bA(a,e)})}bC.set(f,c)},[c]),f),A=bw(bw({},y),i);return q.createElement(q.Fragment,null,o&&q.createElement(r,{sideCar:bD,removeScrollBar:n,shards:p,noRelative:s,noIsolation:t,inert:u,setCallbacks:j,allowPinchZoom:!!v,lockRef:g,gapMode:x}),k?q.cloneElement(q.Children.only(l),bw(bw({},A),{ref:z})):q.createElement(void 0===w?"div":w,bw({},A,{className:m,ref:z}),l))});bF.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},bF.classNames={fullWidth:bz,zeroRight:by};var bG=function(a){var b=a.sideCar,c=bx(a,["sideCar"]);if(!b)throw Error("Sidecar: please provide `sideCar` property to import the right car");var d=b.read();if(!d)throw Error("Sidecar medium not found");return q.createElement(d,bw({},c))};bG.isSideCarExport=!0;var bH=function(){var a=0,b=null;return{add:function(c){if(0==a&&(b=function(){if(!document)return null;var a=document.createElement("style");a.type="text/css";var b=n||("u">typeof __webpack_nonce__?__webpack_nonce__:void 0);return b&&a.setAttribute("nonce",b),a}())){var d,e;(d=b).styleSheet?d.styleSheet.cssText=c:d.appendChild(document.createTextNode(c)),e=b,(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}a++},remove:function(){--a||!b||(b.parentNode&&b.parentNode.removeChild(b),b=null)}}},bI=function(){var a=bH();return function(b,c){q.useEffect(function(){return a.add(b),function(){a.remove()}},[b&&c])}},bJ=function(){var a=bI();return function(b){return a(b.styles,b.dynamic),null}},bK={left:0,top:0,right:0,gap:0},bL=bJ(),bM="data-scroll-locked",bN=function(a,b,c,d){var e=a.left,f=a.top,g=a.right,h=a.gap;return void 0===c&&(c="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(d,";\n padding-right: ").concat(h,"px ").concat(d,";\n }\n body[").concat(bM,"] {\n overflow: hidden ").concat(d,";\n overscroll-behavior: contain;\n ").concat([b&&"position: relative ".concat(d,";"),"margin"===c&&"\n padding-left: ".concat(e,"px;\n padding-top: ").concat(f,"px;\n padding-right: ").concat(g,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(h,"px ").concat(d,";\n "),"padding"===c&&"padding-right: ".concat(h,"px ").concat(d,";")].filter(Boolean).join(""),"\n }\n \n .").concat(by," {\n right: ").concat(h,"px ").concat(d,";\n }\n \n .").concat(bz," {\n margin-right: ").concat(h,"px ").concat(d,";\n }\n \n .").concat(by," .").concat(by," {\n right: 0 ").concat(d,";\n }\n \n .").concat(bz," .").concat(bz," {\n margin-right: 0 ").concat(d,";\n }\n \n body[").concat(bM,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(h,"px;\n }\n")},bO=function(){var a=parseInt(document.body.getAttribute(bM)||"0",10);return isFinite(a)?a:0},bP=function(){q.useEffect(function(){return document.body.setAttribute(bM,(bO()+1).toString()),function(){var a=bO()-1;a<=0?document.body.removeAttribute(bM):document.body.setAttribute(bM,a.toString())}},[])},bQ=function(a){var b=a.noRelative,c=a.noImportant,d=a.gapMode,e=void 0===d?"margin":d;bP();var f=q.useMemo(function(){return void 0===e,bK},[e]);return q.createElement(bL,{styles:bN(f,!b,e,c?"":"!important")})},bR=function(a,b){if(!(a instanceof Element))return!1;var c=window.getComputedStyle(a);return"hidden"!==c[b]&&(c.overflowY!==c.overflowX||"TEXTAREA"===a.tagName||"visible"!==c[b])},bS=function(a,b){var c=b.ownerDocument,d=b;do{if("u">typeof ShadowRoot&&d instanceof ShadowRoot&&(d=d.host),bT(a,d)){var e=bU(a,d);if(e[1]>e[2])return!0}d=d.parentNode}while(d&&d!==c.body)return!1},bT=function(a,b){return"v"===a?bR(b,"overflowY"):bR(b,"overflowX")},bU=function(a,b){return"v"===a?[b.scrollTop,b.scrollHeight,b.clientHeight]:[b.scrollLeft,b.scrollWidth,b.clientWidth]},bV=function(a,b,c,d,e){var f,g=(f=window.getComputedStyle(b).direction,"h"===a&&"rtl"===f?-1:1),h=g*d,i=c.target,j=b.contains(i),k=!1,l=h>0,m=0,n=0;do{if(!i)break;var o=bU(a,i),p=o[0],q=o[1]-o[2]-g*p;(p||q)&&bT(a,i)&&(m+=q,n+=p);var r=i.parentNode;i=r&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE?r.host:r}while(!j&&i!==document.body||j&&(b.contains(i)||b===i))return l&&(e&&1>Math.abs(m)||!e&&h>m)?k=!0:!l&&(e&&1>Math.abs(n)||!e&&-h>n)&&(k=!0),k},bW=function(a){return"changedTouches"in a?[a.changedTouches[0].clientX,a.changedTouches[0].clientY]:[0,0]},bX=function(a){return[a.deltaX,a.deltaY]},bY=function(a){return a&&"current"in a?a.current:a},bZ=0,b$=[];let b_=(l=function(a){var b=q.useRef([]),c=q.useRef([0,0]),d=q.useRef(),e=q.useState(bZ++)[0],f=q.useState(bJ)[0],g=q.useRef(a);q.useEffect(function(){g.current=a},[a]),q.useEffect(function(){if(a.inert){document.body.classList.add("block-interactivity-".concat(e));var b=(function(a,b,c){if(c||2==arguments.length)for(var d,e=0,f=b.length;e<f;e++)!d&&e in b||(d||(d=Array.prototype.slice.call(b,0,e)),d[e]=b[e]);return a.concat(d||Array.prototype.slice.call(b))})([a.lockRef.current],(a.shards||[]).map(bY),!0).filter(Boolean);return b.forEach(function(a){return a.classList.add("allow-interactivity-".concat(e))}),function(){document.body.classList.remove("block-interactivity-".concat(e)),b.forEach(function(a){return a.classList.remove("allow-interactivity-".concat(e))})}}},[a.inert,a.lockRef.current,a.shards]);var h=q.useCallback(function(a,b){if("touches"in a&&2===a.touches.length||"wheel"===a.type&&a.ctrlKey)return!g.current.allowPinchZoom;var e,f=bW(a),h=c.current,i="deltaX"in a?a.deltaX:h[0]-f[0],j="deltaY"in a?a.deltaY:h[1]-f[1],k=a.target,l=Math.abs(i)>Math.abs(j)?"h":"v";if("touches"in a&&"h"===l&&"range"===k.type)return!1;var m=window.getSelection(),n=m&&m.anchorNode;if(n&&(n===k||n.contains(k)))return!1;var o=bS(l,k);if(!o)return!0;if(o?e=l:(e="v"===l?"h":"v",o=bS(l,k)),!o)return!1;if(!d.current&&"changedTouches"in a&&(i||j)&&(d.current=e),!e)return!0;var p=d.current||e;return bV(p,b,a,"h"===p?i:j,!0)},[]),i=q.useCallback(function(a){if(b$.length&&b$[b$.length-1]===f){var c="deltaY"in a?bX(a):bW(a),d=b.current.filter(function(b){var d;return b.name===a.type&&(b.target===a.target||a.target===b.shadowParent)&&(d=b.delta,d[0]===c[0]&&d[1]===c[1])})[0];if(d&&d.should){a.cancelable&&a.preventDefault();return}if(!d){var e=(g.current.shards||[]).map(bY).filter(Boolean).filter(function(b){return b.contains(a.target)});(e.length>0?h(a,e[0]):!g.current.noIsolation)&&a.cancelable&&a.preventDefault()}}},[]),j=q.useCallback(function(a,c,d,e){var f={name:a,delta:c,target:d,should:e,shadowParent:function(a){for(var b=null;null!==a;)a instanceof ShadowRoot&&(b=a.host,a=a.host),a=a.parentNode;return b}(d)};b.current.push(f),setTimeout(function(){b.current=b.current.filter(function(a){return a!==f})},1)},[]),k=q.useCallback(function(a){c.current=bW(a),d.current=void 0},[]),l=q.useCallback(function(b){j(b.type,bX(b),b.target,h(b,a.lockRef.current))},[]),m=q.useCallback(function(b){j(b.type,bW(b),b.target,h(b,a.lockRef.current))},[]);q.useEffect(function(){return b$.push(f),a.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:m}),document.addEventListener("wheel",i,!1),document.addEventListener("touchmove",i,!1),document.addEventListener("touchstart",k,!1),function(){b$=b$.filter(function(a){return a!==f}),document.removeEventListener("wheel",i,!1),document.removeEventListener("touchmove",i,!1),document.removeEventListener("touchstart",k,!1)}},[]);var n=a.removeScrollBar,o=a.inert;return q.createElement(q.Fragment,null,o?q.createElement(f,{styles:"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")}):null,n?q.createElement(bQ,{noRelative:a.noRelative,gapMode:a.gapMode}):null)},bD.useMedium(l),bG);var b0=q.forwardRef(function(a,b){return q.createElement(bF,bw({},a,{ref:b,sideCar:b_}))});b0.classNames=bF.classNames;var b1=["Enter"," "],b2=["ArrowUp","PageDown","End"],b3=["ArrowDown","PageUp","Home",...b2],b4={ltr:[...b1,"ArrowRight"],rtl:[...b1,"ArrowLeft"]},b5={ltr:["ArrowLeft"],rtl:["ArrowRight"]},b6="Menu",[b7,b8,b9]=(0,w.createCollection)(b6),[ca,cb]=(0,t.createContextScope)(b6,[b9,a4,bm.createRovingFocusGroupScope]),cc=a4(),cd=(0,bm.createRovingFocusGroupScope)(),[ce,cf]=ca(b6),[cg,ch]=ca(b6),ci=a=>{let{__scopeMenu:b,open:c=!1,children:d,dir:e,onOpenChange:f,modal:g=!0}=a,h=cc(b),[i,j]=q.useState(null),k=q.useRef(!1),l=(0,y.useCallbackRef)(f),m=(0,x.useDirection)(e);return q.useEffect(()=>{let a=()=>{k.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>k.current=!1;return document.addEventListener("keydown",a,{capture:!0}),()=>{document.removeEventListener("keydown",a,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),(0,o.jsx)(a7,{...h,children:(0,o.jsx)(ce,{scope:b,open:c,onOpenChange:l,content:i,onContentChange:j,children:(0,o.jsx)(cg,{scope:b,onClose:q.useCallback(()=>l(!1),[l]),isUsingKeyboardRef:k,dir:m,modal:g,children:d})})})};ci.displayName=b6;var cj=q.forwardRef((a,b)=>{let{__scopeMenu:c,...d}=a,e=cc(c);return(0,o.jsx)(a9,{...e,...d,ref:b})});cj.displayName="MenuAnchor";var ck="MenuPortal",[cl,cm]=ca(ck,{forceMount:void 0}),cn=a=>{let{__scopeMenu:b,forceMount:c,children:d,container:e}=a,f=cf(ck,b);return(0,o.jsx)(cl,{scope:b,forceMount:c,children:(0,o.jsx)(bl.Presence,{present:c||f.open,children:(0,o.jsx)(bk,{asChild:!0,container:e,children:d})})})};cn.displayName=ck;var co="MenuContent",[cp,cq]=ca(co),cr=q.forwardRef((a,b)=>{let c=cm(co,a.__scopeMenu),{forceMount:d=c.forceMount,...e}=a,f=cf(co,a.__scopeMenu),g=ch(co,a.__scopeMenu);return(0,o.jsx)(b7.Provider,{scope:a.__scopeMenu,children:(0,o.jsx)(bl.Presence,{present:d||f.open,children:(0,o.jsx)(b7.Slot,{scope:a.__scopeMenu,children:g.modal?(0,o.jsx)(cs,{...e,ref:b}):(0,o.jsx)(ct,{...e,ref:b})})})})}),cs=q.forwardRef((a,b)=>{let c=cf(co,a.__scopeMenu),d=q.useRef(null),e=(0,s.useComposedRefs)(b,d);return q.useEffect(()=>{let a=d.current;if(a)return bv(a)},[]),(0,o.jsx)(cv,{...a,ref:e,trapFocus:c.open,disableOutsidePointerEvents:c.open,disableOutsideScroll:!0,onFocusOutside:(0,r.composeEventHandlers)(a.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>c.onOpenChange(!1)})}),ct=q.forwardRef((a,b)=>{let c=cf(co,a.__scopeMenu);return(0,o.jsx)(cv,{...a,ref:b,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>c.onOpenChange(!1)})}),cu=((f=q.forwardRef((a,b)=>{let{children:c,...d}=a;if(q.isValidElement(c)){var e;let a,f,g=(e=c,(f=(a=Object.getOwnPropertyDescriptor(e.props,"ref")?.get)&&"isReactWarning"in a&&a.isReactWarning)?e.ref:(f=(a=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in a&&a.isReactWarning)?e.props.ref:e.props.ref||e.ref),h=function(a,b){let c={...b};for(let d in b){let e=a[d],f=b[d];/^on[A-Z]/.test(d)?e&&f?c[d]=(...a)=>{let b=f(...a);return e(...a),b}:e&&(c[d]=e):"style"===d?c[d]={...e,...f}:"className"===d&&(c[d]=[e,f].filter(Boolean).join(" "))}return{...a,...c}}(d,c.props);return c.type!==q.Fragment&&(h.ref=b?(0,s.composeRefs)(b,g):g),q.cloneElement(c,h)}return q.Children.count(c)>1?q.Children.only(null):null})).displayName="MenuContent.ScrollLock.SlotClone",c=f,(d=q.forwardRef((a,b)=>{let{children:d,...e}=a,f=q.Children.toArray(d),g=f.find(bo);if(g){let a=g.props.children,d=f.map(b=>b!==g?b:q.Children.count(a)>1?q.Children.only(null):q.isValidElement(a)?a.props.children:null);return(0,o.jsx)(c,{...e,ref:b,children:q.isValidElement(a)?q.cloneElement(a,void 0,d):null})}return(0,o.jsx)(c,{...e,ref:b,children:d})})).displayName="MenuContent.ScrollLock.Slot",d),cv=q.forwardRef((a,b)=>{let{__scopeMenu:c,loop:d=!1,trapFocus:e,onOpenAutoFocus:f,onCloseAutoFocus:g,disableOutsidePointerEvents:h,onEntryFocus:i,onEscapeKeyDown:j,onPointerDownOutside:k,onFocusOutside:l,onInteractOutside:m,onDismiss:n,disableOutsideScroll:p,...t}=a,u=cf(co,c),v=ch(co,c),w=cc(c),x=cd(c),y=b8(c),[z,A]=q.useState(null),C=q.useRef(null),D=(0,s.useComposedRefs)(b,C,u.onContentChange),G=q.useRef(0),H=q.useRef(""),I=q.useRef(0),K=q.useRef(null),L=q.useRef("right"),M=q.useRef(0),N=p?b0:q.Fragment;q.useEffect(()=>()=>window.clearTimeout(G.current),[]),q.useEffect(()=>{let a=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",a[0]??F()),document.body.insertAdjacentElement("beforeend",a[1]??F()),E++,()=>{1===E&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),E--}},[]);let O=q.useCallback(a=>{var b,c;return L.current===K.current?.side&&(b=a,!!(c=K.current?.area)&&function(a,b){let{x:c,y:d}=a,e=!1;for(let a=0,f=b.length-1;a<b.length;f=a++){let g=b[a],h=b[f],i=g.x,j=g.y,k=h.x,l=h.y;j>d!=l>d&&c<(k-i)*(d-j)/(l-j)+i&&(e=!e)}return e}({x:b.clientX,y:b.clientY},c))},[]);return(0,o.jsx)(cp,{scope:c,searchRef:H,onItemEnter:q.useCallback(a=>{O(a)&&a.preventDefault()},[O]),onItemLeave:q.useCallback(a=>{O(a)||(C.current?.focus(),A(null))},[O]),onTriggerLeave:q.useCallback(a=>{O(a)&&a.preventDefault()},[O]),pointerGraceTimerRef:I,onPointerGraceIntentChange:q.useCallback(a=>{K.current=a},[]),children:(0,o.jsx)(N,{...p?{as:cu,allowPinchZoom:!0}:void 0,children:(0,o.jsx)(J,{asChild:!0,trapped:e,onMountAutoFocus:(0,r.composeEventHandlers)(f,a=>{a.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:g,children:(0,o.jsx)(B,{asChild:!0,disableOutsidePointerEvents:h,onEscapeKeyDown:j,onPointerDownOutside:k,onFocusOutside:l,onInteractOutside:m,onDismiss:n,children:(0,o.jsx)(bm.Root,{asChild:!0,...x,dir:v.dir,orientation:"vertical",loop:d,currentTabStopId:z,onCurrentTabStopIdChange:A,onEntryFocus:(0,r.composeEventHandlers)(i,a=>{v.isUsingKeyboardRef.current||a.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,o.jsx)(bd,{role:"menu","aria-orientation":"vertical","data-state":cV(u.open),"data-radix-menu-content":"",dir:v.dir,...w,...t,ref:D,style:{outline:"none",...t.style},onKeyDown:(0,r.composeEventHandlers)(t.onKeyDown,a=>{let b=a.target.closest("[data-radix-menu-content]")===a.currentTarget,c=a.ctrlKey||a.altKey||a.metaKey,d=1===a.key.length;if(b){var e;let b,f,g,h,i,j;"Tab"===a.key&&a.preventDefault(),!c&&d&&(e=a.key,b=H.current+e,f=y().filter(a=>!a.disabled),g=document.activeElement,h=f.find(a=>a.ref.current===g)?.textValue,i=function(a,b,c){var d;let e=b.length>1&&Array.from(b).every(a=>a===b[0])?b[0]:b,f=c?a.indexOf(c):-1,g=(d=Math.max(f,0),a.map((b,c)=>a[(d+c)%a.length]));1===e.length&&(g=g.filter(a=>a!==c));let h=g.find(a=>a.toLowerCase().startsWith(e.toLowerCase()));return h!==c?h:void 0}(f.map(a=>a.textValue),b,h),j=f.find(a=>a.textValue===i)?.ref.current,function a(b){H.current=b,window.clearTimeout(G.current),""!==b&&(G.current=window.setTimeout(()=>a(""),1e3))}(b),j&&setTimeout(()=>j.focus()))}let f=C.current;if(a.target!==f||!b3.includes(a.key))return;a.preventDefault();let g=y().filter(a=>!a.disabled).map(a=>a.ref.current);b2.includes(a.key)&&g.reverse(),function(a){let b=document.activeElement;for(let c of a)if(c===b||(c.focus(),document.activeElement!==b))return}(g)}),onBlur:(0,r.composeEventHandlers)(a.onBlur,a=>{a.currentTarget.contains(a.target)||(window.clearTimeout(G.current),H.current="")}),onPointerMove:(0,r.composeEventHandlers)(a.onPointerMove,cY(a=>{let b=a.target,c=M.current!==a.clientX;a.currentTarget.contains(b)&&c&&(L.current=a.clientX>M.current?"right":"left",M.current=a.clientX)}))})})})})})})});cr.displayName=co;var cw=q.forwardRef((a,b)=>{let{__scopeMenu:c,...d}=a;return(0,o.jsx)(v.Primitive.div,{role:"group",...d,ref:b})});cw.displayName="MenuGroup";var cx=q.forwardRef((a,b)=>{let{__scopeMenu:c,...d}=a;return(0,o.jsx)(v.Primitive.div,{...d,ref:b})});cx.displayName="MenuLabel";var cy="MenuItem",cz="menu.itemSelect",cA=q.forwardRef((a,b)=>{let{disabled:c=!1,onSelect:d,...e}=a,f=q.useRef(null),g=ch(cy,a.__scopeMenu),h=cq(cy,a.__scopeMenu),i=(0,s.useComposedRefs)(b,f),j=q.useRef(!1);return(0,o.jsx)(cB,{...e,ref:i,disabled:c,onClick:(0,r.composeEventHandlers)(a.onClick,()=>{let a=f.current;if(!c&&a){let b=new CustomEvent(cz,{bubbles:!0,cancelable:!0});a.addEventListener(cz,a=>d?.(a),{once:!0}),(0,v.dispatchDiscreteCustomEvent)(a,b),b.defaultPrevented?j.current=!1:g.onClose()}}),onPointerDown:b=>{a.onPointerDown?.(b),j.current=!0},onPointerUp:(0,r.composeEventHandlers)(a.onPointerUp,a=>{j.current||a.currentTarget?.click()}),onKeyDown:(0,r.composeEventHandlers)(a.onKeyDown,a=>{let b=""!==h.searchRef.current;c||b&&" "===a.key||b1.includes(a.key)&&(a.currentTarget.click(),a.preventDefault())})})});cA.displayName=cy;var cB=q.forwardRef((a,b)=>{let{__scopeMenu:c,disabled:d=!1,textValue:e,...f}=a,g=cq(cy,c),h=cd(c),i=q.useRef(null),j=(0,s.useComposedRefs)(b,i),[k,l]=q.useState(!1),[m,n]=q.useState("");return q.useEffect(()=>{let a=i.current;a&&n((a.textContent??"").trim())},[f.children]),(0,o.jsx)(b7.ItemSlot,{scope:c,disabled:d,textValue:e??m,children:(0,o.jsx)(bm.Item,{asChild:!0,...h,focusable:!d,children:(0,o.jsx)(v.Primitive.div,{role:"menuitem","data-highlighted":k?"":void 0,"aria-disabled":d||void 0,"data-disabled":d?"":void 0,...f,ref:j,onPointerMove:(0,r.composeEventHandlers)(a.onPointerMove,cY(a=>{d?g.onItemLeave(a):(g.onItemEnter(a),a.defaultPrevented||a.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:(0,r.composeEventHandlers)(a.onPointerLeave,cY(a=>g.onItemLeave(a))),onFocus:(0,r.composeEventHandlers)(a.onFocus,()=>l(!0)),onBlur:(0,r.composeEventHandlers)(a.onBlur,()=>l(!1))})})})}),cC=q.forwardRef((a,b)=>{let{checked:c=!1,onCheckedChange:d,...e}=a;return(0,o.jsx)(cK,{scope:a.__scopeMenu,checked:c,children:(0,o.jsx)(cA,{role:"menuitemcheckbox","aria-checked":cW(c)?"mixed":c,...e,ref:b,"data-state":cX(c),onSelect:(0,r.composeEventHandlers)(e.onSelect,()=>d?.(!!cW(c)||!c),{checkForDefaultPrevented:!1})})})});cC.displayName="MenuCheckboxItem";var cD="MenuRadioGroup",[cE,cF]=ca(cD,{value:void 0,onValueChange:()=>{}}),cG=q.forwardRef((a,b)=>{let{value:c,onValueChange:d,...e}=a,f=(0,y.useCallbackRef)(d);return(0,o.jsx)(cE,{scope:a.__scopeMenu,value:c,onValueChange:f,children:(0,o.jsx)(cw,{...e,ref:b})})});cG.displayName=cD;var cH="MenuRadioItem",cI=q.forwardRef((a,b)=>{let{value:c,...d}=a,e=cF(cH,a.__scopeMenu),f=c===e.value;return(0,o.jsx)(cK,{scope:a.__scopeMenu,checked:f,children:(0,o.jsx)(cA,{role:"menuitemradio","aria-checked":f,...d,ref:b,"data-state":cX(f),onSelect:(0,r.composeEventHandlers)(d.onSelect,()=>e.onValueChange?.(c),{checkForDefaultPrevented:!1})})})});cI.displayName=cH;var cJ="MenuItemIndicator",[cK,cL]=ca(cJ,{checked:!1}),cM=q.forwardRef((a,b)=>{let{__scopeMenu:c,forceMount:d,...e}=a,f=cL(cJ,c);return(0,o.jsx)(bl.Presence,{present:d||cW(f.checked)||!0===f.checked,children:(0,o.jsx)(v.Primitive.span,{...e,ref:b,"data-state":cX(f.checked)})})});cM.displayName=cJ;var cN=q.forwardRef((a,b)=>{let{__scopeMenu:c,...d}=a;return(0,o.jsx)(v.Primitive.div,{role:"separator","aria-orientation":"horizontal",...d,ref:b})});cN.displayName="MenuSeparator";var cO=q.forwardRef((a,b)=>{let{__scopeMenu:c,...d}=a,e=cc(c);return(0,o.jsx)(bg,{...e,...d,ref:b})});cO.displayName="MenuArrow";var[cP,cQ]=ca("MenuSub"),cR="MenuSubTrigger",cS=q.forwardRef((a,b)=>{let c=cf(cR,a.__scopeMenu),d=ch(cR,a.__scopeMenu),e=cQ(cR,a.__scopeMenu),f=cq(cR,a.__scopeMenu),g=q.useRef(null),{pointerGraceTimerRef:h,onPointerGraceIntentChange:i}=f,j={__scopeMenu:a.__scopeMenu},k=q.useCallback(()=>{g.current&&window.clearTimeout(g.current),g.current=null},[]);return q.useEffect(()=>k,[k]),q.useEffect(()=>{let a=h.current;return()=>{window.clearTimeout(a),i(null)}},[h,i]),(0,o.jsx)(cj,{asChild:!0,...j,children:(0,o.jsx)(cB,{id:e.triggerId,"aria-haspopup":"menu","aria-expanded":c.open,"aria-controls":e.contentId,"data-state":cV(c.open),...a,ref:(0,s.composeRefs)(b,e.onTriggerChange),onClick:b=>{a.onClick?.(b),a.disabled||b.defaultPrevented||(b.currentTarget.focus(),c.open||c.onOpenChange(!0))},onPointerMove:(0,r.composeEventHandlers)(a.onPointerMove,cY(b=>{f.onItemEnter(b),!b.defaultPrevented&&(a.disabled||c.open||g.current||(f.onPointerGraceIntentChange(null),g.current=window.setTimeout(()=>{c.onOpenChange(!0),k()},100)))})),onPointerLeave:(0,r.composeEventHandlers)(a.onPointerLeave,cY(a=>{k();let b=c.content?.getBoundingClientRect();if(b){let d=c.content?.dataset.side,e="right"===d,g=b[e?"left":"right"],i=b[e?"right":"left"];f.onPointerGraceIntentChange({area:[{x:a.clientX+(e?-5:5),y:a.clientY},{x:g,y:b.top},{x:i,y:b.top},{x:i,y:b.bottom},{x:g,y:b.bottom}],side:d}),window.clearTimeout(h.current),h.current=window.setTimeout(()=>f.onPointerGraceIntentChange(null),300)}else{if(f.onTriggerLeave(a),a.defaultPrevented)return;f.onPointerGraceIntentChange(null)}})),onKeyDown:(0,r.composeEventHandlers)(a.onKeyDown,b=>{let e=""!==f.searchRef.current;a.disabled||e&&" "===b.key||b4[d.dir].includes(b.key)&&(c.onOpenChange(!0),c.content?.focus(),b.preventDefault())})})})});cS.displayName=cR;var cT="MenuSubContent",cU=q.forwardRef((a,b)=>{let c=cm(co,a.__scopeMenu),{forceMount:d=c.forceMount,...e}=a,f=cf(co,a.__scopeMenu),g=ch(co,a.__scopeMenu),h=cQ(cT,a.__scopeMenu),i=q.useRef(null),j=(0,s.useComposedRefs)(b,i);return(0,o.jsx)(b7.Provider,{scope:a.__scopeMenu,children:(0,o.jsx)(bl.Presence,{present:d||f.open,children:(0,o.jsx)(b7.Slot,{scope:a.__scopeMenu,children:(0,o.jsx)(cv,{id:h.contentId,"aria-labelledby":h.triggerId,...e,ref:j,align:"start",side:"rtl"===g.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:a=>{g.isUsingKeyboardRef.current&&i.current?.focus(),a.preventDefault()},onCloseAutoFocus:a=>a.preventDefault(),onFocusOutside:(0,r.composeEventHandlers)(a.onFocusOutside,a=>{a.target!==h.trigger&&f.onOpenChange(!1)}),onEscapeKeyDown:(0,r.composeEventHandlers)(a.onEscapeKeyDown,a=>{g.onClose(),a.preventDefault()}),onKeyDown:(0,r.composeEventHandlers)(a.onKeyDown,a=>{let b=a.currentTarget.contains(a.target),c=b5[g.dir].includes(a.key);b&&c&&(f.onOpenChange(!1),h.trigger?.focus(),a.preventDefault())})})})})})});function cV(a){return a?"open":"closed"}function cW(a){return"indeterminate"===a}function cX(a){return cW(a)?"indeterminate":a?"checked":"unchecked"}function cY(a){return b=>"mouse"===b.pointerType?a(b):void 0}cU.displayName=cT;var cZ="DropdownMenu",[c$,c_]=(0,t.createContextScope)(cZ,[cb]),c0=cb(),[c1,c2]=c$(cZ),c3=a=>{let{__scopeDropdownMenu:b,children:c,dir:d,open:e,defaultOpen:f,onOpenChange:g,modal:h=!0}=a,i=c0(b),j=q.useRef(null),[k,l]=(0,u.useControllableState)({prop:e,defaultProp:f??!1,onChange:g,caller:cZ});return(0,o.jsx)(c1,{scope:b,triggerId:(0,P.useId)(),triggerRef:j,contentId:(0,P.useId)(),open:k,onOpenChange:l,onOpenToggle:q.useCallback(()=>l(a=>!a),[l]),modal:h,children:(0,o.jsx)(ci,{...i,open:k,onOpenChange:l,dir:d,modal:h,children:c})})};c3.displayName=cZ;var c4="DropdownMenuTrigger",c5=q.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,disabled:d=!1,...e}=a,f=c2(c4,c),g=c0(c);return(0,o.jsx)(cj,{asChild:!0,...g,children:(0,o.jsx)(v.Primitive.button,{type:"button",id:f.triggerId,"aria-haspopup":"menu","aria-expanded":f.open,"aria-controls":f.open?f.contentId:void 0,"data-state":f.open?"open":"closed","data-disabled":d?"":void 0,disabled:d,...e,ref:(0,s.composeRefs)(b,f.triggerRef),onPointerDown:(0,r.composeEventHandlers)(a.onPointerDown,a=>{!d&&0===a.button&&!1===a.ctrlKey&&(f.onOpenToggle(),f.open||a.preventDefault())}),onKeyDown:(0,r.composeEventHandlers)(a.onKeyDown,a=>{!d&&(["Enter"," "].includes(a.key)&&f.onOpenToggle(),"ArrowDown"===a.key&&f.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});c5.displayName=c4;var c6=a=>{let{__scopeDropdownMenu:b,...c}=a,d=c0(b);return(0,o.jsx)(cn,{...d,...c})};c6.displayName="DropdownMenuPortal";var c7="DropdownMenuContent",c8=q.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=c2(c7,c),f=c0(c),g=q.useRef(!1);return(0,o.jsx)(cr,{id:e.contentId,"aria-labelledby":e.triggerId,...f,...d,ref:b,onCloseAutoFocus:(0,r.composeEventHandlers)(a.onCloseAutoFocus,a=>{g.current||e.triggerRef.current?.focus(),g.current=!1,a.preventDefault()}),onInteractOutside:(0,r.composeEventHandlers)(a.onInteractOutside,a=>{let b=a.detail.originalEvent,c=0===b.button&&!0===b.ctrlKey,d=2===b.button||c;(!e.modal||d)&&(g.current=!0)}),style:{...a.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});c8.displayName=c7,q.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=c0(c);return(0,o.jsx)(cw,{...e,...d,ref:b})}).displayName="DropdownMenuGroup",q.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=c0(c);return(0,o.jsx)(cx,{...e,...d,ref:b})}).displayName="DropdownMenuLabel";var c9=q.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=c0(c);return(0,o.jsx)(cA,{...e,...d,ref:b})});c9.displayName="DropdownMenuItem",q.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=c0(c);return(0,o.jsx)(cC,{...e,...d,ref:b})}).displayName="DropdownMenuCheckboxItem",q.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=c0(c);return(0,o.jsx)(cG,{...e,...d,ref:b})}).displayName="DropdownMenuRadioGroup",q.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=c0(c);return(0,o.jsx)(cI,{...e,...d,ref:b})}).displayName="DropdownMenuRadioItem",q.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=c0(c);return(0,o.jsx)(cM,{...e,...d,ref:b})}).displayName="DropdownMenuItemIndicator";var da=q.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=c0(c);return(0,o.jsx)(cN,{...e,...d,ref:b})});function db(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function dc(){return(dc=Object.assign.bind()).apply(this,arguments)}da.displayName="DropdownMenuSeparator",q.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=c0(c);return(0,o.jsx)(cO,{...e,...d,ref:b})}).displayName="DropdownMenuArrow",q.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=c0(c);return(0,o.jsx)(cS,{...e,...d,ref:b})}).displayName="DropdownMenuSubTrigger",q.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=c0(c);return(0,o.jsx)(cU,{...e,...d,ref:b,style:{...a.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}).displayName="DropdownMenuSubContent";var dd=["aria-label","aria-labelledby","tabIndex","className","fill","size","verticalAlign","id","title","style"],de={small:16,medium:32,large:64};function df(a,b,c){var d=c(),e=Object.keys(d),f=q.default.forwardRef(function(a,c){var f,g,h=a["aria-label"],i=a["aria-labelledby"],j=a.tabIndex,k=a.className,l=a.fill,m=a.size,n=void 0===m?16:m,o=a.verticalAlign,p=a.id,r=a.title,s=a.style,t=function(a,b){if(null==a)return{};var c,d,e=function(a,b){if(null==a)return{};var c,d,e={},f=Object.keys(a);for(d=0;d<f.length;d++)c=f[d],b.indexOf(c)>=0||(e[c]=a[c]);return e}(a,b);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(a);for(d=0;d<f.length;d++)c=f[d],!(b.indexOf(c)>=0)&&Object.prototype.propertyIsEnumerable.call(a,c)&&(e[c]=a[c])}return e}(a,dd),u=de[n]||n,v=(f=e,g=u,f.map(function(a){return parseInt(a,10)}).reduce(function(a,b){return b<=g?b:a},f[0])),w=d[v].width,x=w/v*u,y=d[v].path,z=h||i;return q.default.createElement("svg",dc({ref:c},t,{"aria-hidden":z?void 0:"true",tabIndex:j,focusable:j>=0?"true":"false","aria-label":h,"aria-labelledby":i,className:"".concat(b," ").concat(void 0===k?"":k).trim(),role:z?"img":void 0,viewBox:"0 0 ".concat(w," ").concat(v),width:x,height:u,fill:void 0===l?"currentColor":l,id:p,display:"inline-block",overflow:"visible",style:function(a){for(var b=1;b<arguments.length;b++){var c=null!=arguments[b]?arguments[b]:{};b%2?db(Object(c),!0).forEach(function(b){var d,e,f;d=a,e=b,f=c[b],e in d?Object.defineProperty(d,e,{value:f,enumerable:!0,configurable:!0,writable:!0}):d[e]=f}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(c)):db(Object(c)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(c,b))})}return a}({verticalAlign:void 0===o?"text-bottom":o},s)}),r?q.default.createElement("title",null,r):null,y)});return f.displayName=a,f}var dg=df("GitBranchIcon","octicon octicon-git-branch",function(){return{16:{width:16,path:q.default.createElement("path",{d:"M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"})},24:{width:24,path:q.default.createElement(q.default.Fragment,null,q.default.createElement("path",{d:"M15 4.75a3.25 3.25 0 1 1 6.5 0 3.25 3.25 0 0 1-6.5 0ZM2.5 19.25a3.25 3.25 0 1 1 6.5 0 3.25 3.25 0 0 1-6.5 0Zm0-14.5a3.25 3.25 0 1 1 6.5 0 3.25 3.25 0 0 1-6.5 0ZM5.75 6.5a1.75 1.75 0 1 0-.001-3.501A1.75 1.75 0 0 0 5.75 6.5Zm0 14.5a1.75 1.75 0 1 0-.001-3.501A1.75 1.75 0 0 0 5.75 21Zm12.5-14.5a1.75 1.75 0 1 0-.001-3.501A1.75 1.75 0 0 0 18.25 6.5Z"}),q.default.createElement("path",{d:"M5.75 16.75A.75.75 0 0 1 5 16V8a.75.75 0 0 1 1.5 0v8a.75.75 0 0 1-.75.75Z"}),q.default.createElement("path",{d:"M17.5 8.75v-1H19v1a3.75 3.75 0 0 1-3.75 3.75h-7a1.75 1.75 0 0 0-1.75 1.75H5A3.25 3.25 0 0 1 8.25 11h7a2.25 2.25 0 0 0 2.25-2.25Z"}))}}}),dh=df("LockIcon","octicon octicon-lock",function(){return{16:{width:16,path:q.default.createElement("path",{d:"M4 4a4 4 0 0 1 8 0v2h.25c.966 0 1.75.784 1.75 1.75v5.5A1.75 1.75 0 0 1 12.25 15h-8.5A1.75 1.75 0 0 1 2 13.25v-5.5C2 6.784 2.784 6 3.75 6H4Zm8.25 3.5h-8.5a.25.25 0 0 0-.25.25v5.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-5.5a.25.25 0 0 0-.25-.25ZM10.5 6V4a2.5 2.5 0 1 0-5 0v2Z"})},24:{width:24,path:q.default.createElement("path",{d:"M6 9V7.25C6 3.845 8.503 1 12 1s6 2.845 6 6.25V9h.5a2.5 2.5 0 0 1 2.5 2.5v8a2.5 2.5 0 0 1-2.5 2.5h-13A2.5 2.5 0 0 1 3 19.5v-8A2.5 2.5 0 0 1 5.5 9Zm-1.5 2.5v8a1 1 0 0 0 1 1h13a1 1 0 0 0 1-1v-8a1 1 0 0 0-1-1h-13a1 1 0 0 0-1 1Zm3-4.25V9h9V7.25c0-2.67-1.922-4.75-4.5-4.75-2.578 0-4.5 2.08-4.5 4.75Z"})}}}),di=df("MarkGithubIcon","octicon octicon-mark-github",function(){return{16:{width:16,path:q.default.createElement("path",{d:"M6.766 11.695C4.703 11.437 3.25 9.904 3.25 7.92c0-.806.281-1.677.75-2.258-.203-.532-.172-1.662.062-2.129.626-.081 1.469.258 1.969.726.594-.194 1.219-.291 1.985-.291.765 0 1.39.097 1.953.274.484-.451 1.343-.79 1.969-.709.218.435.25 1.564.046 2.113.5.613.766 1.436.766 2.274 0 1.984-1.453 3.485-3.547 3.759.531.355.891 1.129.891 2.016v1.678c0 .484.39.758.859.564C13.781 14.824 16 11.905 16 8.291 16 3.726 12.406 0 7.984 0 3.562 0 0 3.726 0 8.291c0 3.581 2.203 6.55 5.172 7.663A.595.595 0 0 0 6 15.389v-1.291c-.219.097-.5.162-.75.162-1.031 0-1.641-.581-2.078-1.662-.172-.435-.36-.693-.719-.742-.187-.016-.25-.097-.25-.193 0-.194.313-.339.625-.339.453 0 .844.29 1.25.887.313.468.641.678 1.031.678.391 0 .641-.146 1-.516.266-.275.469-.517.657-.678Z"})},24:{width:24,path:q.default.createElement("path",{d:"M10.303 16.652c-2.837-.344-4.835-2.385-4.835-5.028 0-1.074.387-2.235 1.031-3.008-.279-.709-.236-2.214.086-2.837.86-.107 2.02.344 2.708.967.816-.258 1.676-.386 2.728-.386 1.053 0 1.913.128 2.686.365.666-.602 1.848-1.053 2.708-.946.3.581.344 2.085.064 2.815.688.817 1.053 1.913 1.053 3.03 0 2.643-1.998 4.641-4.877 5.006.73.473 1.224 1.504 1.224 2.686v2.235c0 .644.537 1.01 1.182.752 3.889-1.483 6.94-5.372 6.94-10.185 0-6.081-4.942-11.044-11.022-11.044-6.081 0-10.98 4.963-10.98 11.044a10.84 10.84 0 0 0 7.112 10.206c.58.215 1.139-.172 1.139-.752v-1.719a2.768 2.768 0 0 1-1.032.215c-1.418 0-2.256-.773-2.857-2.213-.237-.58-.495-.924-.989-.988-.258-.022-.344-.129-.344-.258 0-.258.43-.451.86-.451.623 0 1.16.386 1.719 1.181.43.623.881.903 1.418.903.537 0 .881-.194 1.375-.688.365-.365.645-.687.903-.902Z"})}}}),dj=df("RepoIcon","octicon octicon-repo",function(){return{16:{width:16,path:q.default.createElement("path",{d:"M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"})},24:{width:24,path:q.default.createElement(q.default.Fragment,null,q.default.createElement("path",{d:"M3 2.75A2.75 2.75 0 0 1 5.75 0h14.5a.75.75 0 0 1 .75.75v20.5a.75.75 0 0 1-.75.75h-6a.75.75 0 0 1 0-1.5h5.25v-4H6A1.5 1.5 0 0 0 4.5 18v.75c0 .716.43 1.334 1.05 1.605a.75.75 0 0 1-.6 1.374A3.251 3.251 0 0 1 3 18.75ZM19.5 1.5H5.75c-.69 0-1.25.56-1.25 1.25v12.651A2.989 2.989 0 0 1 6 15h13.5Z"}),q.default.createElement("path",{d:"M7 18.25a.25.25 0 0 1 .25-.25h5a.25.25 0 0 1 .25.25v5.01a.25.25 0 0 1-.397.201l-2.206-1.604a.25.25 0 0 0-.294 0L7.397 23.46a.25.25 0 0 1-.397-.2v-5.01Z"}))}}}),dk=a.i(67299),dl={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},dm=q.default.createContext&&q.default.createContext(dl),dn=["attr","size","title"];function dp(){return(dp=Object.assign.bind()).apply(null,arguments)}function dq(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function dr(a){for(var b=1;b<arguments.length;b++){var c=null!=arguments[b]?arguments[b]:{};b%2?dq(Object(c),!0).forEach(function(b){var d,e,f;d=a,e=b,f=c[b],(e=function(a){var b=function(a,b){if("object"!=typeof a||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=typeof d)return d;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}(a,"string");return"symbol"==typeof b?b:b+""}(e))in d?Object.defineProperty(d,e,{value:f,enumerable:!0,configurable:!0,writable:!0}):d[e]=f}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(c)):dq(Object(c)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(c,b))})}return a}function ds(a){return b=>q.default.createElement(dt,dp({attr:dr({},a.attr)},b),function a(b){return b&&b.map((b,c)=>q.default.createElement(b.tag,dr({key:c},b.attr),a(b.child)))}(a.child))}function dt(a){var b=b=>{var c,{attr:d,size:e,title:f}=a,g=function(a,b){if(null==a)return{};var c,d,e=function(a,b){if(null==a)return{};var c={};for(var d in a)if(({}).hasOwnProperty.call(a,d)){if(-1!==b.indexOf(d))continue;c[d]=a[d]}return c}(a,b);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(a);for(d=0;d<f.length;d++)c=f[d],-1===b.indexOf(c)&&({}).propertyIsEnumerable.call(a,c)&&(e[c]=a[c])}return e}(a,dn),h=e||b.size||"1em";return b.className&&(c=b.className),a.className&&(c=(c?c+" ":"")+a.className),q.default.createElement("svg",dp({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},b.attr,d,g,{className:c,style:dr(dr({color:a.color||b.color},b.style),a.style),height:h,width:h,xmlns:"http://www.w3.org/2000/svg"}),f&&q.default.createElement("title",null,f),a.children)};return void 0!==dm?q.default.createElement(dm.Consumer,null,a=>b(a)):b(dl)}var du=a.i(70106);let dv=(0,du.default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]),dw=(0,du.default)("book-text",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["path",{d:"M8 11h8",key:"vwpz6n"}],["path",{d:"M8 7h6",key:"1f0q6e"}]]),dx=(0,du.default)("building-2",[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]]),dy=(0,du.default)("chevrons-right",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);var dz=a.i(33441),dA=a.i(5784),dB=a.i(5151);let dC=(0,du.default)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);var dD=a.i(96101),dE=a.i(34531);let dF=(0,du.default)("folder-kanban",[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]]),dG=(0,du.default)("hand",[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]]),dH=(0,du.default)("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]);var dI=a.i(96221);let dJ=(0,du.default)("plug-zap",[["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m18 3-4 4h6l-4 4",key:"16psg9"}]]),dK=(0,du.default)("refresh-ccw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]);var dL=a.i(87532);let dM=(0,du.default)("sliders-horizontal",[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]),dN=(0,du.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"}]]),dO=(0,du.default)("volume-2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]),dP=(0,du.default)("volume-x",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);var dQ=a.i(33508),dR=a.i(53603),dS=a.i(72865),dT=a.i(35757),dU=a.i(36177),dV=a.i(48171),dW=a.i(62586),dX=a.i(52806),dY=a.i(5913);let dZ=["pro","max","api"],d$=["chatgpt","api"],d_=["oauth","api"],d0=["oauth","api"];function d1(a,b,c){return"string"==typeof a&&b.includes(a)?a:c}function d2(a){let b=!a||"object"!=typeof a||Array.isArray(a)?{}:{...a},c=(0,dk.getDefaultModelAccessPreferences)();return{claudeCode:d1(b.claudeCode,dZ,c.claudeCode),codex:d1(b.codex,d$,c.codex),gemini:d1(b.gemini,d_,c.gemini),qwenCode:d1(b.qwenCode,d0,c.qwenCode)}}let d3=(0,du.default)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);var d4=a.i(10948);let d5=(0,du.default)("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]),d6=(0,du.default)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);var d7=a.i(71541),d8=a.i(50415),d9=a.i(48079),ea=a.i(69630);function eb({projects:a,sessions:b,selectedProjectId:c,agentCount:d,onCreateWorkspace:e,onSelectProject:f,onSelectSession:g}){let h=(0,q.useMemo)(()=>b.filter(a=>"archived"!==a.status),[b]),i=(0,q.useMemo)(()=>a.map(a=>{let b=h.filter(b=>b.projectId===a.id),c=b.filter(a=>"done"!==(0,ea.getAttentionLevel)(a)).length;return{id:a.id,description:a.description,branch:a.defaultBranch||"main",totalSessions:b.length,activeSessions:c}}).sort((a,b)=>b.activeSessions-a.activeSessions||b.totalSessions-a.totalSessions||a.id.localeCompare(b.id)),[a,h]),j=(0,q.useMemo)(()=>[...h].sort((a,b)=>new Date(b.lastActivityAt).getTime()-new Date(a.lastActivityAt).getTime()).slice(0,5),[h]),k=h.filter(a=>"done"!==(0,ea.getAttentionLevel)(a)).length,l=h.filter(a=>{let b=(0,ea.getAttentionLevel)(a);return"merge"===b||"respond"===b||"review"===b}).length,m=h.filter(a=>"merge"===(0,ea.getAttentionLevel)(a)).length,n=i.find(a=>a.id===c)??null,p=0===a.length&&0===h.length,r=[{label:"Projects",value:String(a.length),icon:dE.FolderGit2},{label:"Active sessions",value:String(k),icon:d5},{label:"Need attention",value:String(l),icon:d6},{label:"Merge ready",value:String(m),icon:d4.GitBranch}];return p?(0,o.jsx)("div",{className:"flex min-h-full flex-col bg-[linear-gradient(180deg,rgba(255,255,255,0.03),rgba(255,255,255,0))]",children:(0,o.jsxs)("div",{className:"mx-auto flex min-h-full w-full max-w-[1200px] flex-1 flex-col px-3 py-3 sm:px-4 sm:py-4",children:[(0,o.jsx)("div",{className:"mb-4 flex justify-end",children:(0,o.jsx)(d7.Button,{variant:"outline",size:"md",onClick:e,children:"Add workspace"})}),(0,o.jsx)("div",{className:"flex flex-1 items-center justify-center",children:(0,o.jsx)(d9.Card,{className:"w-full max-w-[880px] border-[var(--vk-border)] bg-[color:color-mix(in_srgb,var(--vk-bg-panel)_88%,transparent)]",children:(0,o.jsxs)(d9.CardContent,{className:"flex flex-col items-center px-6 py-12 text-center sm:px-10 sm:py-16",children:[(0,o.jsx)("span",{className:"inline-flex h-14 w-14 items-center justify-center rounded-[12px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] text-[var(--vk-text-normal)]",children:(0,o.jsx)(dF,{className:"h-6 w-6"})}),(0,o.jsx)("p",{className:"mt-5 text-[11px] uppercase tracking-[0.14em] text-[var(--vk-text-muted)]",children:"Frontend Control Surface"}),(0,o.jsx)("h1",{className:"mt-3 max-w-[14ch] text-[30px] font-semibold leading-[1.02] tracking-[-0.05em] text-[var(--vk-text-strong)] sm:text-[44px]",children:"Operate workspaces, sessions, and agents from one surface."}),(0,o.jsx)("p",{className:"mt-4 max-w-[560px] text-[14px] leading-7 text-[var(--vk-text-muted)] sm:text-[15px]",children:"Start by linking a workspace. Once a project is connected, this page will show active sessions, recent work, and project focus without sending you through an empty composer first."}),(0,o.jsxs)("div",{className:"mt-8 flex flex-wrap items-center justify-center gap-3",children:[(0,o.jsx)(d7.Button,{variant:"primary",size:"md",onClick:e,children:"Add workspace"}),(0,o.jsx)("div",{className:"inline-flex rounded-[6px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-3 py-2 text-[12px] text-[var(--vk-text-muted)]",children:"0 projects · 0 active sessions"})]})]})})})]})}):(0,o.jsx)("div",{className:"flex min-h-full flex-col border-b border-[var(--vk-border)] bg-[linear-gradient(180deg,rgba(255,255,255,0.03),rgba(255,255,255,0))]",children:(0,o.jsxs)("div",{className:"mx-auto flex min-h-full w-full max-w-[1440px] flex-1 flex-col gap-4 px-3 py-3 sm:px-4",children:[(0,o.jsxs)("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between",children:[(0,o.jsxs)("div",{className:"max-w-3xl",children:[(0,o.jsx)("p",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Frontend Control Surface"}),(0,o.jsx)("h1",{className:"mt-1 text-[24px] font-semibold leading-[1.05] tracking-[-0.04em] text-[var(--vk-text-strong)] sm:text-[30px]",children:"Operate workspaces, sessions, and agents from one surface."}),(0,o.jsx)("p",{className:"mt-2 max-w-2xl text-[13px] leading-6 text-[var(--vk-text-muted)]",children:"The current design language stays intact, but the workspace entrypoint now exposes status, recent activity, and project context without forcing you into a blank composer first."})]}),(0,o.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:(0,o.jsx)(d7.Button,{variant:"outline",size:"md",onClick:e,children:"Add workspace"})})]}),(0,o.jsx)("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:r.map(({label:a,value:b,icon:c})=>(0,o.jsx)(d9.Card,{className:"bg-[color:color-mix(in_srgb,var(--vk-bg-panel)_86%,transparent)]",children:(0,o.jsxs)(d9.CardContent,{className:"flex items-center gap-3 py-3",children:[(0,o.jsx)("span",{className:"inline-flex h-10 w-10 items-center justify-center rounded-[6px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] text-[var(--vk-text-normal)]",children:(0,o.jsx)(c,{className:"h-4 w-4"})}),(0,o.jsxs)("div",{children:[(0,o.jsx)("p",{className:"text-[11px] uppercase tracking-[0.08em] text-[var(--vk-text-muted)]",children:a}),(0,o.jsx)("p",{className:"mt-1 text-[22px] font-semibold text-[var(--vk-text-strong)]",children:b})]})]})},a))}),(0,o.jsxs)("div",{className:"grid flex-1 gap-3 xl:grid-cols-[1.35fr_0.95fr]",children:[(0,o.jsxs)(d9.Card,{className:"flex h-full min-h-[280px] flex-col",children:[(0,o.jsxs)(d9.CardHeader,{className:"justify-between",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("p",{className:"text-[14px] font-semibold text-[var(--vk-text-strong)]",children:"Recent sessions"}),(0,o.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Jump back into active work without hunting through the sidebar."})]}),(0,o.jsx)(d8.Badge,{variant:"outline",children:h.length})]}),(0,o.jsx)(d9.CardContent,{className:"flex-1 space-y-2",children:0===j.length?(0,o.jsx)("div",{className:"flex h-full min-h-[180px] items-center justify-center rounded-[6px] border border-dashed border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-4 text-center text-[13px] text-[var(--vk-text-muted)]",children:"No sessions yet. Create or open a workspace to start work."}):j.map(a=>{let b;return(0,o.jsxs)("button",{type:"button",onClick:()=>g(a.id),className:"flex w-full items-center gap-3 rounded-[6px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-3 py-3 text-left transition-colors hover:bg-[var(--vk-bg-hover)]",children:[(0,o.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)("p",{className:"truncate text-[14px] font-medium text-[var(--vk-text-strong)]",children:a.summary?.trim()||a.projectId}),(0,o.jsx)(d8.Badge,{variant:(b=(0,ea.getAttentionLevel)(a),"queued"===a.status?"outline":"merge"===b?"success":"review"===b||"respond"===b?"warning":"errored"===a.status||"killed"===a.status?"error":"outline"),children:function(a){if("queued"===a.status){let b=Number.parseInt(a.metadata.queuePosition??"",10);return Number.isFinite(b)&&b>0?`Queued #${b}`:"Queued"}if("reattach_pending"===a.metadata.recoveryState)return"Reattaching";if("detached_runtime"===a.metadata.recoveryState)return"Recover";let b=(0,ea.getAttentionLevel)(a);return"merge"===b?"Ready":"respond"===b?"Needs input":"review"===b?"Review":"pending"===b?"Pending":"done"===b?"Done":"Running"}(a)})]}),(0,o.jsxs)("p",{className:"mt-1 truncate text-[12px] text-[var(--vk-text-muted)]",children:[a.projectId,a.branch?` \xb7 ${a.branch}`:"",a.issueId?` \xb7 ${a.issueId}`:""]})]}),(0,o.jsxs)("div",{className:"shrink-0 text-right",children:[(0,o.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:function(a){let b=Date.now()-new Date(a).getTime();if(!Number.isFinite(b)||b<6e4)return"Updated now";let c=Math.floor(b/6e4);if(c<60)return`Updated ${c}m ago`;let d=Math.floor(c/60);if(d<24)return`Updated ${d}h ago`;let e=Math.floor(d/24);return`Updated ${e}d ago`}(a.lastActivityAt)}),(0,o.jsx)(d3,{className:"ml-auto mt-2 h-4 w-4 text-[var(--vk-text-muted)]"})]})]},a.id)})})]}),(0,o.jsxs)(d9.Card,{className:"flex h-full min-h-[280px] flex-col",children:[(0,o.jsxs)(d9.CardHeader,{className:"justify-between",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("p",{className:"text-[14px] font-semibold text-[var(--vk-text-strong)]",children:"Project focus"}),(0,o.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:n?`Selected: ${n.id}`:"Select a project to scope new work."})]}),(0,o.jsxs)(d8.Badge,{variant:"outline",children:[d," agents"]})]}),(0,o.jsxs)(d9.CardContent,{className:"flex-1 space-y-2",children:[(0,o.jsxs)("button",{type:"button",onClick:()=>f(null),className:`flex w-full items-center justify-between rounded-[6px] border px-3 py-2 text-left ${null===c?"border-[var(--vk-border)] bg-[var(--vk-bg-hover)] text-[var(--vk-text-strong)]":"border-[var(--vk-border)] bg-[var(--vk-bg-main)] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,o.jsx)("span",{children:"All projects"}),(0,o.jsx)(d8.Badge,{variant:"outline",children:h.length})]}),0===i.length?(0,o.jsx)("div",{className:"flex h-full min-h-[180px] items-center justify-center rounded-[6px] border border-dashed border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-4 text-center text-[13px] text-[var(--vk-text-muted)]",children:"No configured projects yet."}):i.slice(0,6).map(a=>(0,o.jsxs)("button",{type:"button",onClick:()=>f(a.id),className:`flex w-full items-start justify-between gap-3 rounded-[6px] border px-3 py-2.5 text-left ${c===a.id?"border-[var(--vk-border)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] bg-[var(--vk-bg-main)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,o.jsxs)("div",{className:"min-w-0",children:[(0,o.jsx)("p",{className:"truncate text-[13px] font-medium text-[var(--vk-text-strong)]",children:a.id}),(0,o.jsx)("p",{className:"truncate text-[12px] text-[var(--vk-text-muted)]",children:a.description?.trim()||`Default branch: ${a.branch}`})]}),(0,o.jsxs)("div",{className:"shrink-0 text-right",children:[(0,o.jsxs)("p",{className:"text-[12px] text-[var(--vk-text-strong)]",children:[a.activeSessions," active"]}),(0,o.jsxs)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:[a.totalSessions," total"]})]})]},a.id)),n?(0,o.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-3 py-3",children:[(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)(dF,{className:"h-4 w-4 text-[var(--vk-text-muted)]"}),(0,o.jsx)("p",{className:"text-[13px] font-medium text-[var(--vk-text-strong)]",children:n.id})]}),(0,o.jsx)("p",{className:"mt-2 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:n.description?.trim()||"This project is ready to launch work from chat or board mode."})]}):null]})]})]})]})})}let ec=["codex","gemini","qwen-code","droid","claude-code","amp","opencode","github-copilot","cursor-cli","ccr"],ed="claude-code",ee={codex:"Codex",gemini:"Gemini","qwen-code":"Qwen Code",droid:"Droid","claude-code":"Claude Code",amp:"Amp",opencode:"Opencode","github-copilot":"Copilot","cursor-cli":"Cursor Agent",ccr:"CCR"},ef={"claude-code":"https://claude.ai/",codex:"https://chatgpt.com/codex",gemini:"https://aistudio.google.com/","qwen-code":"https://chat.qwen.ai/",opencode:"https://opencode.ai/","github-copilot":"https://github.com/settings/copilot"},eg=(0,p.default)(()=>a.A(60928).then(a=>a.SessionDetail),{loadableGenerated:{modules:[31437]},loading:()=>(0,o.jsx)("div",{className:"flex h-full items-center justify-center text-[13px] text-[var(--vk-text-muted)]",children:"Loading session..."})}),eh=(0,p.default)(()=>a.A(67645).then(a=>a.WorkspaceKanban),{loadableGenerated:{modules:[96933]},loading:()=>(0,o.jsx)("div",{className:"flex h-full items-center justify-center text-[13px] text-[var(--vk-text-muted)]",children:"Loading board..."})});function ei(a){let b=(0,dR.normalizeAgentName)(a);return ee[b]?ee[b]:a.split(/[-_\s]+/g).filter(Boolean).map(a=>a[0]?.toUpperCase()+a.slice(1)).join(" ")}function ej(a){return a.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64)}function ek(a){if(!a)return null;let b=Date.parse(a);return Number.isNaN(b)?null:`Updated ${new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"}).format(new Date(b))}`}function el(a){return a.taskRef?.trim()||a.id}function em(a){let[b]=a.split(" - ");return(b??a).trim()}let en=[{id:"general",label:"General",icon:dN,implemented:!0},{id:"remote_access",label:"Remote Access",icon:dM,implemented:!0},{id:"repositories",label:"Repositories",icon:dE.FolderGit2,implemented:!0},{id:"organization",label:"Organization Settings",icon:dx,implemented:!0},{id:"projects",label:"Projects",icon:dF,implemented:!1},{id:"agents",label:"Agents",icon:dv,implemented:!0},{id:"mcp",label:"MCP Servers",icon:dJ,implemented:!1},{id:"preferences",label:"Preferences",icon:dM,implemented:!1}],eo=[{id:"preferences",label:"Preferences",icon:dM,implemented:!0},{id:"repositories",label:"Repository",icon:dE.FolderGit2,implemented:!0}],ep=[{id:"vscode",label:"VS Code"},{id:"vscode-insiders",label:"VS Code Insiders"},{id:"cursor",label:"Cursor"},{id:"windsurf",label:"Windsurf"},{id:"intellij-idea",label:"IntelliJ IDEA"},{id:"zed",label:"Zed"},{id:"xcode",label:"Xcode"},{id:"antigravity",label:"Antigravity"},{id:"custom",label:"Custom"}],eq=[{id:"obsidian",label:"Obsidian"},{id:"vscode",label:"VS Code"},{id:"notion",label:"Notion"},{id:"typora",label:"Typora"},{id:"logseq",label:"Logseq"},{id:"custom",label:"Custom"}],er=[{id:"abstract-sound-1",label:"Abstract Sound 1"},{id:"abstract-sound-2",label:"Abstract Sound 2"},{id:"abstract-sound-3",label:"Abstract Sound 3"},{id:"abstract-sound-4",label:"Abstract Sound 4"},{id:"cow-mooing",label:"Cow Mooing"},{id:"phone-vibration",label:"Phone Vibration"},{id:"rooster",label:"Rooster"}];function es(a){return!a||"object"!=typeof a||Array.isArray(a)?{}:{...a}}function et(a,b){let c=es(a),d=es(c.notifications),e=d.soundFile,f="string"==typeof c.codingAgent&&c.codingAgent.trim().length>0?c.codingAgent.trim():b,g="string"==typeof c.ide&&c.ide.trim().length>0?c.ide.trim():"vscode",h="string"==typeof c.remoteSshHost&&c.remoteSshHost.trim().length>0?c.remoteSshHost.trim():"",i="string"==typeof c.remoteSshUser&&c.remoteSshUser.trim().length>0?c.remoteSshUser.trim():"",j="string"==typeof c.markdownEditor&&c.markdownEditor.trim().length>0?c.markdownEditor.trim():"obsidian";return{onboardingAcknowledged:!0===c.onboardingAcknowledged,codingAgent:f,ide:g,remoteSshHost:h,remoteSshUser:i,markdownEditor:j,modelAccess:d2(c.modelAccess),notifications:{soundEnabled:!1!==d.soundEnabled,soundFile:null===e?null:"string"==typeof e&&e.trim().length>0?e.trim():"abstract-sound-4"}}}function eu(a){return Array.isArray(a)?a.filter(a=>"string"==typeof a).map(a=>a.trim()).filter(Boolean).join("\n"):"string"!=typeof a?"":a.split(/[\n,]+/g).map(a=>a.trim()).filter(Boolean).join("\n")}function ev(a,b){let c=es(a),d=es(c.trustedHeaders),e=es(c.roles),f=es(b),g=c.defaultRole,h=f.role;return{requireAuth:!0===c.requireAuth,defaultRole:"viewer"===g||"admin"===g||"operator"===g?g:"operator",trustedHeaders:{enabled:!0===d.enabled,provider:"generic"===d.provider?"generic":"cloudflare-access",emailHeader:"string"==typeof d.emailHeader&&d.emailHeader.trim().length>0?d.emailHeader.trim():"Cf-Access-Authenticated-User-Email",jwtHeader:"string"==typeof d.jwtHeader&&d.jwtHeader.trim().length>0?d.jwtHeader.trim():"Cf-Access-Jwt-Assertion",teamDomain:"string"==typeof d.teamDomain&&d.teamDomain.trim().length>0?d.teamDomain.trim():"",audience:"string"==typeof d.audience&&d.audience.trim().length>0?d.audience.trim():""},roles:{viewers:eu(e.viewers),operators:eu(e.operators),admins:eu(e.admins),viewerDomains:eu(e.viewerDomains),operatorDomains:eu(e.operatorDomains),adminDomains:eu(e.adminDomains)},current:{authenticated:!0===f.authenticated,role:"viewer"===h||"operator"===h||"admin"===h?h:null,email:"string"==typeof f.email&&f.email.trim().length>0?f.email.trim():null,provider:"string"==typeof f.provider&&f.provider.trim().length>0?f.provider.trim():null}}}function ew(){return{catalogModel:"",customModel:"",reasoningEffort:""}}function ex(a,b){return b[(0,dR.normalizeAgentName)(a)]??null}function ey(a){if(!a)return[];let b=[],c=new Set;for(let d of Object.values(a.modelsByAccess))if(Array.isArray(d))for(let a of d)!a?.id||c.has(a.id)||(c.add(a.id),b.push(a));return b}function ez(a,b,c){let d=ex(a,c),e=(0,dk.resolveAgentModelAccess)(a,b),f=d&&e?d.modelsByAccess[e]??[]:[],g=(0,dk.getAvailableAgentModels)(a,b),h=[],i=new Set;for(let a of[...f,...g,...ey(d)])!a?.id||i.has(a.id)||(i.add(a.id),h.push(a));return h}function eA(a,b,c,d){let e=function(a,b,c){if(!a)return[];let d=b?.trim();return d&&a.reasoningOptionsByModel?.[d]?.length?a.reasoningOptionsByModel[d]??[]:c?a.reasoningOptionsByAccess?.[c]??[]:[]}(ex(a,c),d,(0,dk.resolveAgentModelAccess)(a,b)),f=(0,dk.getAvailableAgentReasoningEfforts)(a,b),g=[],h=new Set;for(let a of[...e,...f])!a?.id||h.has(a.id)||(h.add(a.id),g.push(a));return g}function eB(a,b,c,d){return function(a,b,c){if(!a)return null;let d=b?.trim();return d&&a.defaultReasoningByModel?.[d]?a.defaultReasoningByModel[d]??null:c?a.defaultReasoningByAccess?.[c]??null:null}(ex(a,c),d,(0,dk.resolveAgentModelAccess)(a,b))??(0,dk.getDefaultAgentReasoningEffort)(a,b)??""}function eC(a,b,c,d,e){let f,g,h=d?.trim()??"",i=e?.trim().toLowerCase()??"",j=ez(a,b,c),k=(f=ex(a,c),g=(0,dk.resolveAgentModelAccess)(a,b),(f&&g?f.defaultModelByAccess[g]??null:null)??(0,dk.getDefaultAgentModel)(a,b)??ey(f)[0]?.id??""),l=d=>{let e=eA(a,b,c,d);return i.length>0&&e.some(a=>a.id===i)?i:eB(a,b,c,d)};return h.length>0?j.some(a=>a.id===h)?{catalogModel:h,customModel:"",reasoningEffort:l(h)}:{catalogModel:k,customModel:h,reasoningEffort:l(h)}:{catalogModel:k,customModel:"",reasoningEffort:l(k)}}function eD(a){let b=a.customModel.trim();if(b.length>0)return b;let c=a.catalogModel.trim();return c.length>0?c:void 0}function eE(a){let b=a.reasoningEffort.trim().toLowerCase();return b.length>0?b:void 0}let eF="block h-4 w-4 shrink-0",eG="block h-4 w-4 shrink-0 object-contain",eH={vscode:{kind:"image",imageSrc:"/icons/ide/vscode-dark.svg",className:eG},"vscode-insiders":{kind:"image",imageSrc:"/icons/ide/vscode-insiders.svg",className:eG},cursor:{kind:"image",imageSrc:"/icons/ide/cursor-dark.svg",className:eG},windsurf:{kind:"image",imageSrc:"/icons/ide/windsurf-dark.svg",className:eG},"intellij-idea":{kind:"image",imageSrc:"/icons/ide/intellij.svg",className:eG},zed:{kind:"image",imageSrc:"/icons/ide/zed-dark.svg",className:eG},xcode:{kind:"image",imageSrc:"/icons/ide/xcode.svg",className:eG},antigravity:{kind:"image",imageSrc:"/icons/ide/antigravity-dark.svg",className:eG},custom:{kind:"icon",icon:dN,className:`${eG} text-[var(--vk-text-muted)]`}};function eI({editorId:a,label:b}){let c=eH[a];if(!c)return(0,o.jsx)(dN,{className:`${eG} text-[var(--vk-text-muted)]`});if("image"===c.kind)return(0,o.jsx)("img",{src:c.imageSrc,alt:`${b} logo`,className:c.className});let d=c.icon;return(0,o.jsx)(d,{className:c.className})}function eJ(a){return JSON.stringify(a)}let eK={obsidian:{kind:"icon",icon:function(a){return ds({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19.355 18.538a68.967 68.959 0 0 0 1.858-2.954.81.81 0 0 0-.062-.9c-.516-.685-1.504-2.075-2.042-3.362-.553-1.321-.636-3.375-.64-4.377a1.707 1.707 0 0 0-.358-1.05l-3.198-4.064a3.744 3.744 0 0 1-.076.543c-.106.503-.307 1.004-.536 1.5-.134.29-.29.6-.446.914l-.31.626c-.516 1.068-.997 2.227-1.132 3.59-.124 1.26.046 2.73.815 4.481.128.011.257.025.386.044a6.363 6.363 0 0 1 3.326 1.505c.916.79 1.744 1.922 2.415 3.5zM8.199 22.569c.073.012.146.02.22.02.78.024 2.095.092 3.16.29.87.16 2.593.64 4.01 1.055 1.083.316 2.198-.548 2.355-1.664.114-.814.33-1.735.725-2.58l-.01.005c-.67-1.87-1.522-3.078-2.416-3.849a5.295 5.295 0 0 0-2.778-1.257c-1.54-.216-2.952.19-3.84.45.532 2.218.368 4.829-1.425 7.531zM5.533 9.938c-.023.1-.056.197-.098.29L2.82 16.059a1.602 1.602 0 0 0 .313 1.772l4.116 4.24c2.103-3.101 1.796-6.02.836-8.3-.728-1.73-1.832-3.081-2.55-3.831zM9.32 14.01c.615-.183 1.606-.465 2.745-.534-.683-1.725-.848-3.233-.716-4.577.154-1.552.7-2.847 1.235-3.95.113-.235.223-.454.328-.664.149-.297.288-.577.419-.86.217-.47.379-.885.46-1.27.08-.38.08-.72-.014-1.043-.095-.325-.297-.675-.68-1.06a1.6 1.6 0 0 0-1.475.36l-4.95 4.452a1.602 1.602 0 0 0-.513.952l-.427 2.83c.672.59 2.328 2.316 3.335 4.711.09.21.175.43.253.653z"},child:[]}]})(a)},className:`${eF} text-[#8b5cf6]`},vscode:{kind:"icon",icon:function(a){return ds({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M10.8634 13.9195C10.6568 14.0195 10.4233 14.0246 10.2185 13.9444C10.1162 13.9044 10.021 13.843 9.93997 13.7614L4.81616 9.06268L2.58433 10.7656C2.37657 10.9241 2.08597 10.9111 1.89301 10.7347L1.17719 10.0802C0.941168 9.86437 0.940898 9.49112 1.17661 9.27496L3.11213 7.5L1.17661 5.72504C0.940898 5.50888 0.941168 5.13563 1.17719 4.91982L1.89301 4.2653C2.08597 4.08887 2.37657 4.07588 2.58433 4.2344L4.81616 5.93732L9.93997 1.23855C9.97037 1.20797 10.0028 1.18023 10.0368 1.15538C10.2748 0.981429 10.5922 0.949298 10.8634 1.08048L13.5399 2.37507C13.8212 2.5111 14 2.79721 14 3.11109V8H10.752V4.53356L6.86419 7.5L10.752 10.4664V8H14V11.8889C14 12.2028 13.8211 12.4889 13.5399 12.625L10.8634 13.9195Z"},child:[]}]})(a)},className:`${eF} text-[#22a3f5]`},notion:{kind:"icon",icon:function(a){return ds({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4.459 4.208c.746.606 1.026.56 2.428.466l13.215-.793c.28 0 .047-.28-.046-.326L17.86 1.968c-.42-.326-.981-.7-2.055-.607L3.01 2.295c-.466.046-.56.28-.374.466zm.793 3.08v13.904c0 .747.373 1.027 1.214.98l14.523-.84c.841-.046.935-.56.935-1.167V6.354c0-.606-.233-.933-.748-.887l-15.177.887c-.56.047-.747.327-.747.933zm14.337.745c.093.42 0 .84-.42.888l-.7.14v10.264c-.608.327-1.168.514-1.635.514-.748 0-.935-.234-1.495-.933l-4.577-7.186v6.952L12.21 19s0 .84-1.168.84l-3.222.186c-.093-.186 0-.653.327-.746l.84-.233V9.854L7.822 9.76c-.094-.42.14-1.026.793-1.073l3.456-.233 4.764 7.279v-6.44l-1.215-.139c-.093-.514.28-.887.747-.933zM1.936 1.035l13.31-.98c1.634-.14 2.055-.047 3.082.7l4.249 2.986c.7.513.934.653.934 1.213v16.378c0 1.026-.373 1.634-1.68 1.726l-15.458.934c-.98.047-1.448-.093-1.962-.747l-3.129-4.06c-.56-.747-.793-1.306-.793-1.96V2.667c0-.839.374-1.54 1.447-1.632z"},child:[]}]})(a)},className:`${eF} text-white`},logseq:{kind:"image",imageSrc:"/icons/editors/logseq.svg",className:`${eF} object-contain`},typora:{kind:"image",imageSrc:"/icons/editors/typora-32.png",className:`${eF} rounded-[3px] bg-white/90 p-[1px] object-contain`},custom:{kind:"icon",icon:dN,className:`${eF} text-[var(--vk-text-muted)]`}};function eL({editorId:a}){let b=eK[a];if(!b)return(0,o.jsx)(dw,{className:`${eF} text-[var(--vk-text-muted)]`});if("image"===b.kind)return(0,o.jsx)("img",{src:b.imageSrc,alt:"",className:b.className});let c=b.icon;return(0,o.jsx)(c,{className:b.className})}function eM({agent:a,modelAccess:b,runtimeModelCatalogs:c,selection:d,onChange:e,compact:f=!1}){let g,h;if(!(0,dk.supportsAgentModelSelection)(a))return null;let i=(0,dk.getAgentModelCatalog)(a),j=ez(a,b,c),k=eA(a,b,c,eD(d)??d.catalogModel),l=(g=(0,dk.getAgentModelCatalog)(a),h=(0,dk.resolveAgentModelAccess)(a,b),g&&h?g.accessOptions.find(a=>a.id===h)?.label??null:null);return i?(0,o.jsxs)("div",{className:f?"grid gap-3 md:grid-cols-3":"space-y-3",children:[(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Model"}),(0,o.jsxs)("select",{value:d.catalogModel,disabled:0===j.length,onChange:f=>{let g=f.target.value,h=eA(a,b,c,g);e({...d,catalogModel:g,reasoningEffort:h.some(a=>a.id===d.reasoningEffort)?d.reasoningEffort:eB(a,b,c,g)})},className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60",children:[0===j.length&&(0,o.jsx)("option",{value:"",children:"No runtime models detected"}),j.map(a=>(0,o.jsx)("option",{value:a.id,children:a.label},a.id))]}),(0,o.jsxs)("p",{className:"mt-1 text-[11px] text-[var(--vk-text-muted)]",children:[l?`Filtered for ${l}.`:"Filtered for your current access preference."," Leave custom override blank to use this selection."]})]}),k.length>0&&(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Reasoning Effort"}),(0,o.jsx)("select",{value:d.reasoningEffort,onChange:a=>{e({...d,reasoningEffort:a.target.value})},className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:k.map(a=>(0,o.jsx)("option",{value:a.id,children:a.label},a.id))}),(0,o.jsx)("p",{className:"mt-1 text-[11px] text-[var(--vk-text-muted)]",children:"Choose how much deliberate reasoning the CLI should use before it acts."})]}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Custom Model Override"}),(0,o.jsx)("input",{value:d.customModel,onChange:f=>{let g=f.target.value,h=g.trim()||d.catalogModel,i=eA(a,b,c,h);e({...d,customModel:g,reasoningEffort:i.some(a=>a.id===d.reasoningEffort)?d.reasoningEffort:eB(a,b,c,h)})},placeholder:function(a,b){let c=ex(a,b);if(c?.customModelPlaceholder.trim())return c.customModelPlaceholder;let d=(0,dk.getAgentModelCatalog)(a)?.label??"agent";return`Enter exact ${d} model id`}(a,c),className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,o.jsx)("p",{className:"mt-1 text-[11px] text-[var(--vk-text-muted)]",children:"Optional. Use this to force an exact model id from the installed CLI when you want to override the detected list."})]})]}):null}function eN(){let[a,b]=(0,q.useState)(null),{sessions:c,error:d,refresh:e}=(0,dS.useSessions)(a),{projects:f,error:g,refresh:h}=(0,dT.useConfig)(),{agents:i}=(0,dU.useAgents)(),[j,k]=(0,q.useState)(null),[l,m]=(0,q.useState)(!0),[n,p]=(0,q.useState)(""),[r,s]=(0,q.useState)(""),[t,u]=(0,q.useState)(ew()),[v,w]=(0,q.useState)(!1),[x,y]=(0,q.useState)(null),[z,A]=(0,q.useState)(!1),[B,C]=(0,q.useState)(!1),[D,E]=(0,q.useState)(null),[F,G]=(0,q.useState)("chat"),[H,I]=(0,q.useState)(null),[J,K]=(0,q.useState)(!0),[L,M]=(0,q.useState)(!1),[N,O]=(0,q.useState)(null),[P,Q]=(0,q.useState)(!1),[R,S]=(0,q.useState)(!1),T=x??g??d??N;(0,q.useEffect)(()=>{},[]),(0,q.useEffect)(()=>{if(0===f.length){null!==a&&b(null);return}null===a||f.some(b=>b.id===a)||b(f[0]?.id??null)},[f,a]),(0,q.useEffect)(()=>{j&&(c.some(a=>a.id===j)||k(null))},[c,j]);let U=(0,q.useMemo)(()=>c.find(a=>a.id===j)??null,[c,j]),V=(0,q.useMemo)(()=>f.find(b=>b.id===a)??null,[f,a]),W=(0,q.useMemo)(()=>U?[U.projectId,U.branch].filter(Boolean).join(" · "):V?[V.id,V.defaultBranch||"main"].filter(Boolean).join(" · "):"All Projects",[V,U]),X=(0,q.useMemo)(()=>{let a=Array.isArray(i)?i:[],b=new Set;for(let c of a)c.name&&b.add(c.name);for(let a of f)a.agent&&b.add(a.agent);return H?.codingAgent&&b.add(H.codingAgent),r&&b.add(r),0===b.size&&b.add(H?.codingAgent||ed),[...b]},[i,H?.codingAgent,f,r]),Y=(0,q.useMemo)(()=>{let a={};for(let b of Array.isArray(i)?i:[])b.name&&(a[(0,dR.normalizeAgentName)(b.name)]={name:b.name,ready:!0===b.ready,installed:!1!==b.installed,configured:!1!==b.configured,homepage:"string"==typeof b.homepage?b.homepage:null,description:"string"==typeof b.description?b.description:null});return a},[i]),Z=(0,q.useMemo)(()=>{let a={};for(let b of Array.isArray(i)?i:[])b.name&&b.runtimeModelCatalog&&(a[(0,dR.normalizeAgentName)(b.name)]=b.runtimeModelCatalog);return a},[i]),$=(0,q.useCallback)(a=>{let b=(0,dR.normalizeAgentName)(a);Y[b]?.homepage||ef[b]},[Y]);async function _(a,b){M(!0),O(null);try{let c=await fetch("/api/preferences",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),d=await c.json().catch(()=>null);if(!c.ok)throw Error(d?.error??`Failed to save preferences: ${c.status}`);let e=et(d?.preferences,a.codingAgent||ed);return I(e),s(e.codingAgent),b?.closeDialog!==!1&&Q(!1),!0}catch(a){return O(a instanceof Error?a.message:"Failed to save preferences"),!1}finally{M(!1)}}(0,q.useEffect)(()=>{let a=!1;return async function(){K(!0);try{let b=await fetch("/api/preferences"),c=await b.json().catch(()=>null);if(!b.ok)throw Error(c?.error??`Failed to load preferences: ${b.status}`);if(a)return;let d=et(c?.preferences,ed);I(d),O(null)}catch(b){if(a)return;I(et(null,ed)),O(b instanceof Error?b.message:"Failed to load preferences")}finally{a||K(!1)}}(),()=>{a=!0}},[]),(0,q.useEffect)(()=>{H&&(r||s(H.codingAgent))},[H,r]),(0,q.useEffect)(()=>{J||H&&(H.onboardingAcknowledged||Q(!0))},[H,J]),(0,q.useEffect)(()=>{if(0!==X.length&&(!r||!X.includes(r))){let a=H?.codingAgent||ed;s(X.includes(a)?a:X[0]??ed)}},[X,H?.codingAgent,r]),(0,q.useEffect)(()=>{let a=r||V?.agent||H?.codingAgent||ed,b=V&&(0,dR.normalizeAgentName)(V.agent)===(0,dR.normalizeAgentName)(a)?V.agentModel:null,c=V&&(0,dR.normalizeAgentName)(V.agent)===(0,dR.normalizeAgentName)(a)?V.agentReasoningEffort:null;u(eC(a,H?.modelAccess??d2(null),Z,b,c))},[H?.modelAccess,H?.codingAgent,Z,r,V]);let aa=(0,q.useCallback)(()=>m(a=>!a),[]),ab=(0,q.useCallback)(()=>{},[]),ac=(0,q.useCallback)(()=>{m(!0)},[]),ad=(0,q.useCallback)(()=>{E(null),A(!0),ac()},[ac]);(0,q.useEffect)(()=>{R&&!P&&(S(!1),ad())},[R,P]);let ae=(0,q.useCallback)(async b=>{let c=n.trim();if(!c)return;let d=eD(t),g=eE(t),h=b?.projectId??a??f[0]?.id;if(!h)return void y("No project is configured in conductor.yaml");let i=r||ed,j=Y[(0,dR.normalizeAgentName)(i)]??null;if(j&&!j.ready){y(j.installed?`${ei(i)} is not ready yet. Finish setup or authentication and try again.`:`${ei(i)} is not installed on this machine yet. Open setup and try again.`),$(i);return}w(!0),y(null);try{let a=await fetch("/api/spawn",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:h,prompt:c,...b?.issueId?.trim()?{issueId:b.issueId.trim()}:{},agent:i,...b?.branch?{branch:b.branch}:{},...b?.baseBranch?{baseBranch:b.baseBranch}:{},..."boolean"==typeof b?.useWorktree?{useWorktree:b.useWorktree}:{},...b?.permissionMode?{permissionMode:b.permissionMode}:{},...d?{model:d}:{},...g?{reasoningEffort:g}:{}})}),f=await a.json().catch(()=>null);if(!a.ok)throw Error(f?.error??`Failed to create workspace: ${a.status}`);if(!f?.session?.id)throw Error("Session created but response is missing session id");p(""),G("chat"),ac(),await e(),k(f.session.id)}catch(a){y(a instanceof Error?a.message:"Failed to create workspace")}finally{w(!1)}},[Y,t,$,f,n,e,r,a,ac]),af=(0,q.useCallback)(async a=>{let b=await fetch(`/api/sessions/${encodeURIComponent(a)}/archive`,{method:"POST"}),c=await b.json().catch(()=>null);if(404===b.status&&(b=await fetch(`/api/sessions/${encodeURIComponent(a)}/actions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"archive"})}),c=await b.json().catch(()=>null)),!b.ok)throw Error(c?.error??`Failed to archive session: ${b.status}`);j===a&&k(null),await e()},[e,j]),ag=(0,q.useCallback)(async a=>{C(!0),E(null);try{let c=await fetch("/api/workspaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),d=await c.json().catch(()=>null);if(!c.ok)throw Error(d?.error??`Failed to add workspace: ${c.status}`);let e=d?.project?.id;if(!e)throw Error("Workspace created but response is missing project id");await h(),b(e),k(null),p(""),ac(),A(!1)}catch(a){E(a instanceof Error?a.message:"Failed to add workspace")}finally{C(!1)}},[h,ac]),ah=!J&&!!H&&!H.onboardingAcknowledged,ai=H??et(null,r||ed),aj=r||ai.codingAgent||ed,ak=(0,q.useCallback)(a=>{b(a),k(null),s(H?.codingAgent||ed),ab()},[ab,H?.codingAgent]),al=(0,q.useCallback)(a=>{k(a),ab()},[ab]),am=(0,q.useCallback)(()=>{Q(!0)},[]),an=(0,q.useCallback)(()=>{B||A(!1)},[B]),ao=(0,q.useCallback)(()=>{L||ah||(Q(!1),O(null))},[ah,L]),ap=(0,q.useCallback)(async a=>{let b=encodeURIComponent(a),c=await fetch(`/api/repositories/${b}`,{method:"DELETE"});(404===c.status||405===c.status)&&(c=await fetch(`/api/repositories?id=${b}`,{method:"DELETE"}));let d=await c.json().catch(()=>null);if(!c.ok)throw Error(d?.error??`Failed to unlink project (${c.status})`);await h()},[h]),aq=(0,q.useMemo)(()=>(0,o.jsx)(dY.WorkspaceSidebarPanel,{projects:f,selectedProjectId:a,onSelectProject:ak,onUnlinkProject:ap,sessions:c,selectedSessionId:j,onSelectSession:al,onArchiveSession:af,onCreateWorkspace:ad}),[c,af,ak,al,ap,ad,f,a,j]),ar=(0,q.useMemo)(()=>"board"===F?(0,o.jsx)(eh,{projectId:a,defaultAgent:aj,agentOptions:X}):(0,o.jsx)(eQ,{prompt:n,setPrompt:p,selectedAgent:aj,setSelectedAgent:s,agentStates:Y,modelSelection:t,setModelSelection:u,modelAccess:ai.modelAccess,runtimeModelCatalogs:Z,agentOptions:X,projects:f,selectedProjectId:a,onSelectProject:b,projectLabel:a??"All projects",hasProject:f.length>0,creating:v,error:T,onOpenAddWorkspace:ad,onOpenAgentSetup:$,onCreate:ae}),[X,Y,v,ae,t,$,ad,f,n,aj,ai.modelAccess,Z,a,p,T,F]),as=(0,q.useMemo)(()=>V?(0,o.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[(0,o.jsx)("div",{className:"border-b border-[var(--vk-border)] bg-[var(--vk-bg-panel)]/70 px-3 py-3 sm:px-4",children:(0,o.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,o.jsxs)("div",{className:"min-w-0",children:[(0,o.jsx)("p",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Project Workspace"}),(0,o.jsxs)("p",{className:"mt-1 truncate text-[14px] text-[var(--vk-text-strong)]",children:[V.id," · ",V.defaultBranch||"main"]})]}),(0,o.jsxs)("div",{className:"inline-flex w-fit rounded-[6px] border border-[var(--vk-border)] p-1",children:[(0,o.jsx)("button",{type:"button",onClick:()=>G("chat"),className:`min-h-[32px] rounded-[4px] px-3 text-[13px] ${"chat"===F?"bg-[var(--vk-bg-active)] text-[var(--vk-text-strong)]":"text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]"}`,children:"Chat launchpad"}),(0,o.jsx)("button",{type:"button",onClick:()=>G("board"),className:`min-h-[32px] rounded-[4px] px-3 text-[13px] ${"board"===F?"bg-[var(--vk-bg-active)] text-[var(--vk-text-strong)]":"text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]"}`,children:"Board view"})]})]})}),(0,o.jsx)("div",{className:"min-h-0 flex-1 overflow-hidden",children:ar})]}):ar,[V,ar,F]),at=(0,q.useMemo)(()=>j?(0,o.jsx)(eg,{sessionId:j}):null!==a?(0,o.jsx)("div",{className:"min-h-0 flex-1 overflow-hidden",children:as}):(0,o.jsx)("div",{className:"min-h-0 flex-1 overflow-auto",children:(0,o.jsx)(eb,{projects:f,sessions:c,selectedProjectId:a,agentCount:X.length,onCreateWorkspace:ad,onSelectProject:ak,onSelectSession:al})}),[c,as,j,ak,al,ad,f,a,X.length]);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(dV.AppShell,{sidebarOpen:l,onToggleSidebar:aa,sidebar:aq,children:[(0,o.jsx)(dW.TopBar,{title:W,onOpenPreferences:am}),(0,o.jsx)("div",{className:"min-h-0 flex-1 overflow-hidden",children:at})]}),z?(0,o.jsx)(eO,{open:z,onClose:an,onCreate:ag,creating:B,error:D,defaultAgent:aj,agentOptions:X}):null,P||ah?(0,o.jsx)(eS,{open:P,mode:ah?"onboarding":"settings",creating:L,error:N,current:ai,projectCount:f.length,agentOptions:X,runtimeModelCatalogs:Z,onRepositoriesChanged:h,onOnboardingComplete:({needsProject:a})=>{a&&S(!0)},onClose:ao,onSave:_}):null]})}function eO({open:a,onClose:b,onCreate:c,creating:d,error:e,defaultAgent:f,agentOptions:g}){let[h,i]=(0,q.useState)("git"),[j,k]=(0,q.useState)(""),[l,m]=(0,q.useState)(!1),[n,p]=(0,q.useState)(""),[r,s]=(0,q.useState)(""),[t,u]=(0,q.useState)("main"),[v,w]=(0,q.useState)(f),[x,y]=(0,q.useState)(!0),[z,A]=(0,q.useState)(!0),[B,C]=(0,q.useState)([]),[D,E]=(0,q.useState)(!1),[F,G]=(0,q.useState)(!1),[H,I]=(0,q.useState)(null),[J,K]=(0,q.useState)(""),[L,M]=(0,q.useState)(""),[N,O]=(0,q.useState)(!1),[P,Q]=(0,q.useState)("local"),[R,S]=(0,q.useState)([]),[T,U]=(0,q.useState)(!1),[V,W]=(0,q.useState)(null);(0,q.useEffect)(()=>{a&&(i("git"),k(""),m(!1),p(""),s(""),u("main"),A(!0),y(!0),w(f),C([]),G(!1),I(null),K(""),M(""),S([]),W(null),U(!1),O(!1),Q("local"))},[f,a]),(0,q.useEffect)(()=>{!a||"local"!==h||r.trim().length>0||(Q("local"),O(!0))},[h,a,r]);let X=(0,q.useMemo)(()=>{let a=J.trim().toLowerCase(),b=0===a.length?B:B.filter(b=>b.fullName.toLowerCase().includes(a)||b.name.toLowerCase().includes(a)||(b.ownerLogin??"").toLowerCase().includes(a)||(b.description??"").toLowerCase().includes(a)||b.defaultBranch.toLowerCase().includes(a));return 0===a.length?b.slice(0,10):b.slice(0,14)},[J,B]),Y=(0,q.useMemo)(()=>{let a=B.find(a=>a.httpsUrl===L);return a||(n.trim()?B.find(a=>a.httpsUrl===n.trim())??null:null)},[n,B,L]),Z=(0,q.useMemo)(()=>(function(a){let b=a.trim();if(!b)return null;let c=b.match(/^https?:\/\/github\.com\/([^/\s]+)\/([^/\s?#]+?)(?:\.git)?\/?$/i);if(c)return`https://github.com/${c[1]}/${c[2]}.git`;let d=b.match(/^git@github\.com:([^/\s]+)\/([^/\s]+?)(?:\.git)?$/i);return d?`https://github.com/${d[1]}/${d[2]}.git`:null})(J),[J]),$=(0,q.useMemo)(()=>{let a;return(a=J.trim())&&/^(https?:\/\/|git@)/i.test(a)?a:null},[J]),_=(0,q.useMemo)(()=>ek(Y?.updatedAt),[Y]),aa=(0,q.useMemo)(()=>{let a=Z??$;return!!a&&a.toLowerCase()!==n.trim().toLowerCase()},[n,Z,$]),ab=(0,q.useMemo)(()=>{let a=[...new Set(g)];0===a.length&&a.push(f||ed);let b=new Map(ec.map((a,b)=>[a,b]));return a.sort((a,c)=>{let d=b.get((0,dR.normalizeAgentName)(a))??Number.MAX_SAFE_INTEGER,e=b.get((0,dR.normalizeAgentName)(c))??Number.MAX_SAFE_INTEGER;return d!==e?d-e:ei(a).localeCompare(ei(c))})},[g,f]);(0,q.useEffect)(()=>{ab.includes(v)||w(ab[0]??ed)},[v,ab]);let ac=async(a=!1)=>{E(!0),I(null);try{let b=await fetch(`/api/github/repos${a?"?refresh=true":""}`),c=await b.json().catch(()=>null);if(!b.ok)throw Error(c?.error??`Failed to load GitHub repositories (${b.status})`);C(Array.isArray(c?.repos)?c.repos:[])}catch(a){C([]),I(a instanceof Error?a.message:"Failed to load GitHub repositories")}finally{G(!0),E(!1)}};(0,q.useEffect)(()=>{!a||"git"!==h||D||F||ac()},[F,D,h,a]);let ad=async a=>{let b=a?.gitUrl??("git"===h?n.trim():""),c=a?.path??("local"===h?r.trim():"");if(0===b.length&&0===c.length)return void W("git"===h?"Choose or paste a repository first.":"Select a local repository path first.");U(!0),W(null);try{let a=new URLSearchParams;b.length>0&&a.set("gitUrl",b),c.length>0&&a.set("path",c);let d=await fetch(`/api/workspaces/branches?${a.toString()}`),e=await d.json().catch(()=>null);if(!d.ok)throw Error(e?.error??`Failed to load branches (${d.status})`);let f=Array.isArray(e?.branches)?e.branches.filter(a=>"string"==typeof a&&a.trim().length>0):[];S(f);let g="string"==typeof e?.defaultBranch&&e.defaultBranch.trim().length>0?e.defaultBranch.trim():f[0]??null;g&&(0===t.trim().length||!f.includes(t))&&u(g)}catch(a){S([]),W(a instanceof Error?a.message:"Failed to load branches")}finally{U(!1)}},ae=async a=>{M(a);let b=B.find(b=>b.httpsUrl===a);b&&(p(b.httpsUrl),K(b.fullName),u(b.defaultBranch||"main"),l||k(ej(b.name)||j),await ad({gitUrl:b.httpsUrl}))},af=async()=>{let a=Z??$;if(!a)return;let b=B.find(b=>b.httpsUrl.toLowerCase()===a.toLowerCase())??null;if(b)return void await ae(b.httpsUrl);if(M(""),p(a),u("main"),S([]),W(null),!l){let b=function(a){let b=a.trim();if(!b)return null;let c=b.match(/^git@[^:]+:([^/]+)\/([^/\s]+?)(?:\.git)?$/i);if(c)return c[2]??null;try{let a=new URL(b).pathname.split("/").filter(Boolean).at(-1);return a?a.replace(/\.git$/i,""):null}catch{return null}}(a);b&&k(ej(b))}await ad({gitUrl:a})},ag=a=>{Q(a),O(!0)};if(!a)return null;let ah="git"===h?n.trim().length>0&&t.trim().length>0:r.trim().length>0&&t.trim().length>0;async function ai(a){if(a.preventDefault(),!ah||d)return;let b="git"===h?{mode:h,projectId:j.trim()||void 0,agent:v,defaultBranch:t.trim(),useWorktree:x,gitUrl:n.trim(),path:r.trim()||void 0}:{mode:h,projectId:j.trim()||void 0,agent:v,defaultBranch:t.trim(),useWorktree:x,path:r.trim(),initializeGit:z};await c(b)}return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{className:"fixed inset-0 z-[80] flex items-start justify-center overflow-y-auto bg-black/65 px-3 py-3 sm:items-center sm:py-0",onClick:()=>{d||N||b()},role:"presentation",children:(0,o.jsxs)("form",{onSubmit:ai,onClick:a=>a.stopPropagation(),className:"flex max-h-[calc(100dvh-1.5rem)] w-full max-w-[760px] flex-col overflow-hidden rounded-[6px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] shadow-[0_24px_80px_rgba(0,0,0,0.55)]",children:[(0,o.jsxs)("header",{className:"flex items-center border-b border-[var(--vk-border)] px-4 py-3",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("h2",{className:"text-[18px] leading-[22px] text-[var(--vk-text-strong)]",children:"Add Workspace"}),(0,o.jsx)("p",{className:"pt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Pick a GitHub repository or local folder, then confirm the branch."})]}),(0,o.jsx)("button",{type:"button",onClick:b,disabled:d,"aria-label":"Close dialog",className:"ml-auto inline-flex h-8 w-8 items-center justify-center rounded-[4px] text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:(0,o.jsx)(dQ.X,{className:"h-4 w-4"})})]}),(0,o.jsxs)("div",{className:"min-h-0 flex-1 space-y-4 overflow-y-auto px-4 py-4",children:[(0,o.jsxs)("div",{className:"inline-flex rounded-[4px] border border-[var(--vk-border)] p-1",children:[(0,o.jsx)("button",{type:"button",onClick:()=>i("git"),className:`rounded-[3px] px-3 py-1.5 text-[13px] ${"git"===h?"bg-[var(--vk-bg-active)] text-[var(--vk-text-strong)]":"text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]"}`,children:"GitHub"}),(0,o.jsx)("button",{type:"button",onClick:()=>i("local"),className:`rounded-[3px] px-3 py-1.5 text-[13px] ${"local"===h?"bg-[var(--vk-bg-active)] text-[var(--vk-text-strong)]":"text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]"}`,children:"Local Folder"})]}),"git"===h?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3",children:[(0,o.jsxs)("div",{className:"flex items-start gap-3",children:[(0,o.jsx)("span",{className:"inline-flex h-9 w-9 items-center justify-center rounded-[5px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-strong)]",children:(0,o.jsx)(di,{className:"h-[18px] w-[18px]"})}),(0,o.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,o.jsx)("p",{className:"text-[13px] font-medium text-[var(--vk-text-strong)]",children:"GitHub Repository"}),(0,o.jsx)("p",{className:"pt-0.5 text-[12px] text-[var(--vk-text-muted)]",children:"Search accessible repositories or paste a repository URL. Conductor fills the branch and clone URL after selection."})]}),(0,o.jsx)("button",{type:"button",onClick:()=>{G(!1),ac(!0)},disabled:D,className:"inline-flex h-8 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:D?(0,o.jsx)(dI.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(dK,{className:"mr-1.5 h-3.5 w-3.5"}),"Refresh"]})})]}),(0,o.jsxs)("div",{className:"relative mt-3",children:[(0,o.jsx)(di,{className:"pointer-events-none absolute left-3 top-1/2 h-[16px] w-[16px] -translate-y-1/2 text-[var(--vk-text-muted)]"}),(0,o.jsx)("input",{value:J,onChange:a=>K(a.target.value),onKeyDown:a=>{"Enter"===a.key&&aa&&(a.preventDefault(),af())},placeholder:"Search GitHub repos or paste a repository URL",className:"h-10 w-full rounded-[5px] border border-[var(--vk-border)] bg-transparent pl-10 pr-3 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),aa?(0,o.jsxs)("button",{type:"button",onClick:()=>{af()},className:"mt-3 inline-flex items-center gap-2 rounded-[5px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[(0,o.jsx)(dj,{className:"h-4 w-4 text-[var(--vk-text-strong)]"}),(0,o.jsxs)("span",{className:"truncate",children:["Use ",Z?"this GitHub repository":"pasted repository URL"]})]}):null,D&&0===B.length?(0,o.jsx)("div",{className:"mt-3 rounded-[5px] border border-[var(--vk-border)] px-3 py-3 text-[12px] text-[var(--vk-text-muted)]",children:"Loading accessible GitHub repositories..."}):null,H?(0,o.jsxs)("div",{className:"mt-3 rounded-[5px] border border-[var(--vk-red)]/40 bg-[var(--vk-bg-panel)] px-3 py-3 text-[12px] text-[var(--vk-red)]",children:[(0,o.jsx)("p",{children:H}),(0,o.jsx)("button",{type:"button",onClick:()=>{G(!1),ac(!0)},className:"mt-2 inline-flex items-center rounded-[4px] border border-[var(--vk-border)] px-2 py-1 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Retry"})]}):null,!H&&X.length>0?(0,o.jsx)("div",{className:"mt-3 max-h-[260px] space-y-2 overflow-y-auto pr-1",children:X.map(a=>{let b=ek(a.updatedAt),c=Y?.httpsUrl===a.httpsUrl;return(0,o.jsxs)("button",{type:"button",onClick:()=>{ae(a.httpsUrl)},className:`flex w-full items-start gap-3 rounded-[5px] border px-3 py-3 text-left transition ${c?"border-[var(--vk-orange)] bg-[var(--vk-bg-panel)]":"border-[var(--vk-border)] bg-[var(--vk-bg-panel)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,o.jsx)("span",{className:"mt-0.5 inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-[5px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] text-[var(--vk-text-strong)]",children:(0,o.jsx)(dj,{className:"h-4 w-4"})}),(0,o.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,o.jsxs)("span",{className:"flex flex-wrap items-center gap-2",children:[(0,o.jsx)("span",{className:"truncate text-[13px] font-medium text-[var(--vk-text-strong)]",children:a.fullName}),(0,o.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:[a.private?(0,o.jsx)(dh,{className:"h-3 w-3"}):(0,o.jsx)(di,{className:"h-3 w-3"}),a.private?"Private":"Public"]}),(0,o.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:[(0,o.jsx)(dg,{className:"h-3 w-3"}),a.defaultBranch]})]}),a.description?(0,o.jsx)("span",{className:"mt-1 block line-clamp-2 text-[12px] leading-[17px] text-[var(--vk-text-muted)]",children:a.description}):null,(0,o.jsxs)("span",{className:"mt-1 flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-[var(--vk-text-muted)]",children:[a.ownerLogin?(0,o.jsx)("span",{children:a.ownerLogin}):null,b?(0,o.jsx)("span",{children:b}):null,a.permission?(0,o.jsx)("span",{children:a.permission.toLowerCase()}):null]})]}),(0,o.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 shrink-0 items-center justify-center text-[var(--vk-text-strong)]",children:c?(0,o.jsx)(dz.Check,{className:"h-4 w-4"}):null})]},a.httpsUrl)})}):null,D||H||0!==X.length?null:(0,o.jsx)("p",{className:"mt-3 text-[12px] text-[var(--vk-text-muted)]",children:J.trim().length>0?"No matching repositories. Try another search or paste a repository URL.":"No accessible GitHub repositories were found for this machine yet."})]}),n.trim().length>0?(0,o.jsx)("div",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3",children:(0,o.jsxs)("div",{className:"flex items-start gap-3",children:[(0,o.jsx)("span",{className:"inline-flex h-9 w-9 items-center justify-center rounded-[5px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-strong)]",children:(0,o.jsx)(dj,{className:"h-[18px] w-[18px]"})}),(0,o.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,o.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,o.jsx)("span",{className:"truncate text-[14px] font-medium text-[var(--vk-text-strong)]",children:Y?.fullName??n}),(0,o.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:[Y&&Y.private?(0,o.jsx)(dh,{className:"h-3 w-3"}):(0,o.jsx)(di,{className:"h-3 w-3"}),Y?Y.private?"Private":"Public":"Manual URL"]}),(0,o.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:[(0,o.jsx)(dg,{className:"h-3 w-3"}),t||"main"]})]}),Y?.description?(0,o.jsx)("p",{className:"mt-1 line-clamp-2 text-[12px] leading-[17px] text-[var(--vk-text-muted)]",children:Y.description}):(0,o.jsx)("p",{className:"mt-1 truncate text-[12px] text-[var(--vk-text-muted)]",children:n}),(0,o.jsxs)("div",{className:"mt-1 flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-[var(--vk-text-muted)]",children:[Y?.ownerLogin?(0,o.jsx)("span",{children:Y.ownerLogin}):null,_?(0,o.jsx)("span",{children:_}):null,Y?.permission?(0,o.jsx)("span",{children:Y.permission.toLowerCase()}):null]})]})]})}):null]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Local Path"}),(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)("input",{value:r,readOnly:!0,onClick:()=>ag("local"),placeholder:"Use Browse to select a repository folder",className:"h-9 w-full cursor-pointer rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,o.jsx)("button",{type:"button",onClick:()=>ag("local"),className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",title:"Browse folders",children:(0,o.jsx)(dD.FolderOpen,{className:"h-4 w-4"})})]})]}),(0,o.jsxs)("label",{className:"flex items-center gap-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,o.jsx)("input",{type:"checkbox",checked:z,onChange:a=>A(a.target.checked),className:"h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,o.jsx)("span",{children:"Initialize git if this folder is non-git"})]})]}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Workspace Name (optional)"}),(0,o.jsx)("input",{value:j,onChange:a=>{k(a.target.value),m(!0)},placeholder:"auto-derived from the selected repository or folder",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,o.jsxs)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:[(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Branch"}),(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)("input",{value:t,onChange:a=>u(a.target.value),placeholder:"Uses the repository default branch",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,o.jsx)("button",{type:"button",onClick:()=>{ad()},disabled:T,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",title:"Detect branches",children:T?(0,o.jsx)(dI.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,o.jsx)(dK,{className:"h-3.5 w-3.5"})})]}),R.length>0&&(0,o.jsx)("select",{value:t,onChange:a=>u(a.target.value),className:"mt-2 h-8 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[12px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:R.map(a=>(0,o.jsx)("option",{value:a,children:a},a))}),V&&(0,o.jsx)("p",{className:"mt-1 text-[11px] text-[var(--vk-red)]",children:V})]}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Agent"}),(0,o.jsx)("select",{value:v,onChange:a=>w(a.target.value),className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:ab.map(a=>(0,o.jsx)("option",{value:a,className:"bg-[var(--vk-bg-panel)] text-[var(--vk-text-normal)]",children:ei(a)},a))})]})]}),"git"===h?(0,o.jsxs)("details",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)]",children:[(0,o.jsx)("summary",{className:"cursor-pointer list-none px-3 py-2 text-[13px] text-[var(--vk-text-normal)] marker:hidden",children:(0,o.jsxs)("span",{className:"inline-flex items-center gap-2",children:[(0,o.jsx)(dA.ChevronDown,{className:"h-3.5 w-3.5 text-[var(--vk-text-muted)]"}),"Advanced options"]})}),(0,o.jsxs)("div",{className:"space-y-3 border-t border-[var(--vk-border)] px-3 py-3",children:[(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Local Copy Location (optional)"}),(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)("input",{value:r,readOnly:!0,onClick:()=>ag("clone"),placeholder:"Choose a folder only if you want a specific clone location",className:"h-9 w-full cursor-pointer rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,o.jsx)("button",{type:"button",onClick:()=>ag("clone"),className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",title:"Browse folders",children:(0,o.jsx)(dD.FolderOpen,{className:"h-4 w-4"})})]})]}),(0,o.jsxs)("label",{className:"flex items-start gap-2 rounded-[4px] border border-[var(--vk-border)] px-2 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,o.jsx)("input",{type:"checkbox",checked:x,onChange:a=>y(a.target.checked),className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,o.jsxs)("span",{children:["Keep work isolated in a new worktree",(0,o.jsx)("span",{className:"block text-[11px] text-[var(--vk-text-muted)]",children:"Turn this off only if you want sessions to run directly in the selected branch."})]})]})]})]}):(0,o.jsxs)("label",{className:"flex items-start gap-2 rounded-[4px] border border-[var(--vk-border)] px-2 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,o.jsx)("input",{type:"checkbox",checked:x,onChange:a=>y(a.target.checked),className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,o.jsxs)("span",{children:["Keep work isolated in a new worktree",(0,o.jsx)("span",{className:"block text-[11px] text-[var(--vk-text-muted)]",children:"Turn this off only if you want sessions to run directly in the selected branch."})]})]}),e&&(0,o.jsx)("p",{className:"text-[12px] text-[var(--vk-red)]",children:e})]}),(0,o.jsxs)("footer",{className:"flex flex-wrap items-center justify-end gap-2 border-t border-[var(--vk-border)] px-4 py-3",children:[(0,o.jsx)("button",{type:"button",onClick:b,disabled:d,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Cancel"}),(0,o.jsx)("button",{type:"submit",disabled:!ah||d,className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:d?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(dI.Loader2,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Adding..."]}):"Add Workspace"})]})]})}),(0,o.jsx)(eP,{open:N,initialPath:r,title:"local"===P?"Select Local Repository":"Select Clone Target Folder",description:"local"===P?"Choose the local repository folder.":"Choose where the git repository should be cloned.",onClose:()=>O(!1),onSelect:a=>{if(O(!1),a){if(s(a),("local"===h||"local"===P)&&!l){let b,c=(b=a.trim())?b.split(/[\\/]+/).filter(Boolean).at(-1)??null:null;c&&k(ej(c))}("local"===h||"local"===P)&&ad({path:a})}}})]})}function eP({open:a,initialPath:b,title:c,description:d,onClose:e,onSelect:f}){let[g,h]=(0,q.useState)(""),[i,j]=(0,q.useState)(b??""),[k,l]=(0,q.useState)([]),[m,n]=(0,q.useState)(""),[p,r]=(0,q.useState)(!1),[s,t]=(0,q.useState)(null),[u,v]=(0,q.useState)(!1);(0,q.useEffect)(()=>{if(!a)return;n(""),j(b??"");let c=b&&b.trim().length>0?b.trim():void 0,d=c?`?path=${encodeURIComponent(c)}`:"";r(!0),t(null),fetch(`/api/filesystem/directory${d}`).then(async a=>{let b=await a.json().catch(()=>null);if(!a.ok)throw Error(b?.error??`Failed to load directory (${a.status})`);h("string"==typeof b?.currentPath?b.currentPath:""),l(Array.isArray(b?.entries)?b.entries:[])}).catch(a=>{t(a instanceof Error?a.message:"Failed to load directory"),l([])}).finally(()=>{r(!1)})},[b,a]);let w=(0,q.useMemo)(()=>{if(0===m.trim().length)return k;let a=m.trim().toLowerCase();return k.filter(b=>b.name.toLowerCase().includes(a))},[k,m]),x=async a=>{r(!0),t(null);try{let b=a&&a.trim().length>0?`?path=${encodeURIComponent(a.trim())}`:"",c=await fetch(`/api/filesystem/directory${b}`),d=await c.json().catch(()=>null);if(!c.ok)throw Error(d?.error??`Failed to load directory (${c.status})`);let e="string"==typeof d?.currentPath?d.currentPath:"";h(e),l(Array.isArray(d?.entries)?d.entries:[]),j(e)}catch(a){t(a instanceof Error?a.message:"Failed to load directory"),l([])}finally{r(!1)}},y=async()=>{v(!0);try{let a=await fetch("/api/filesystem/pick-directory",{method:"POST"}),b=await a.json().catch(()=>null);if(!b||b.cancelled||!b.path)return;j(b.path),x(b.path)}catch{}finally{v(!1)}};return a?(0,o.jsx)("div",{className:"fixed inset-0 z-[95] flex items-start justify-center overflow-y-auto bg-black/70 px-3 py-3 sm:items-center sm:py-0",onClick:()=>{e(),f(null)},role:"presentation",children:(0,o.jsxs)("div",{className:"flex max-h-[calc(100dvh-1.5rem)] w-full max-w-[760px] flex-col overflow-hidden rounded-[6px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] shadow-[0_24px_80px_rgba(0,0,0,0.55)]",onClick:a=>a.stopPropagation(),children:[(0,o.jsxs)("header",{className:"border-b border-[var(--vk-border)] px-4 py-3",children:[(0,o.jsx)("h3",{className:"text-[16px] text-[var(--vk-text-strong)]",children:c}),(0,o.jsx)("p",{className:"pt-1 text-[12px] text-[var(--vk-text-muted)]",children:d})]}),(0,o.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-3 px-4 py-3",children:[(0,o.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,o.jsx)("input",{value:i,onChange:a=>j(a.target.value),placeholder:"/path/to/repository",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,o.jsx)("button",{type:"button",onClick:()=>{x(i)},className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Open"})]}),(0,o.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,o.jsx)("button",{type:"button",onClick:()=>{x()},className:"inline-flex h-8 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Home"}),(0,o.jsx)("button",{type:"button",onClick:()=>{if(!g)return;let a=g.replace(/\\/g,"/");if(/^[A-Za-z]:\/?$/.test(g)||"/"===a)return;let b=a.split("/").filter(Boolean),c=g.match(/^([A-Za-z]):[/\\]/);x(c?b.length>1?`${c[1]}:/${b.slice(1,-1).join("/")}`:`${c[1]}:/`:b.length>1?`/${b.slice(0,-1).join("/")}`:"/")},className:"inline-flex h-8 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Up"}),(0,o.jsxs)("button",{type:"button",disabled:u,onClick:()=>{y()},className:"inline-flex h-8 items-center gap-1 rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:[u?(0,o.jsx)(dI.Loader2,{className:"h-3 w-3 animate-spin"}):(0,o.jsx)(dD.FolderOpen,{className:"h-3 w-3"}),u?"Opening...":"Browse"]}),(0,o.jsx)("div",{className:"truncate text-[12px] text-[var(--vk-text-muted)]",children:g||"Home"})]}),(0,o.jsxs)("div",{className:"relative",children:[(0,o.jsx)(dL.Search,{className:"pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--vk-text-muted)]"}),(0,o.jsx)("input",{value:m,onChange:a=>n(a.target.value),placeholder:"Filter folders",className:"h-8 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent pl-7 pr-2 text-[12px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,o.jsx)("div",{className:"min-h-0 flex-1 overflow-auto rounded-[4px] border border-[var(--vk-border)]",children:p?(0,o.jsx)("div",{className:"px-3 py-3 text-[12px] text-[var(--vk-text-muted)]",children:"Loading..."}):s?(0,o.jsx)("div",{className:"px-3 py-3 text-[12px] text-[var(--vk-red)]",children:s}):0===w.length?(0,o.jsx)("div",{className:"px-3 py-3 text-[12px] text-[var(--vk-text-muted)]",children:"No folders found."}):(0,o.jsx)("div",{className:"p-1",children:w.map(a=>(0,o.jsxs)("button",{type:"button",onClick:()=>{a.isDirectory&&x(a.path)},className:`mb-1 flex w-full items-center gap-2 rounded-[4px] px-2 py-2 text-left text-[12px] ${a.isDirectory?"text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]":"cursor-default text-[var(--vk-text-muted)]"}`,children:[(0,o.jsx)(dD.FolderOpen,{className:"h-4 w-4 shrink-0"}),(0,o.jsx)("span",{className:"truncate",children:a.name}),a.isGitRepo&&(0,o.jsx)("span",{className:"ml-auto rounded-[999px] border border-[var(--vk-border)] px-1.5 py-0.5 text-[10px]",children:"git"})]},a.path))})})]}),(0,o.jsxs)("footer",{className:"flex items-center justify-end gap-2 border-t border-[var(--vk-border)] px-4 py-3",children:[(0,o.jsx)("button",{type:"button",onClick:()=>{e(),f(null)},className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Cancel"}),(0,o.jsx)("button",{type:"button",onClick:()=>{let a=i.trim().length>0?i.trim():g;e(),f(a||null)},className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)]",children:"Use this folder"})]})]})}):null}let eQ=(0,q.memo)(function({prompt:a,setPrompt:b,selectedAgent:c,setSelectedAgent:d,agentStates:e,modelSelection:f,setModelSelection:g,modelAccess:h,runtimeModelCatalogs:i,agentOptions:j,projects:k,selectedProjectId:l,onSelectProject:m,projectLabel:n,hasProject:p,creating:r,error:s,onOpenAddWorkspace:t,onOpenAgentSetup:u,onCreate:v}){let w=(0,q.useMemo)(()=>{let a=new Map(ec.map((a,b)=>[a,b]));return[...j].sort((b,c)=>{let d=a.get((0,dR.normalizeAgentName)(b))??Number.MAX_SAFE_INTEGER,e=a.get((0,dR.normalizeAgentName)(c))??Number.MAX_SAFE_INTEGER;return d!==e?d-e:ei(b).localeCompare(ei(c))})},[j]),x=ei(c),y=e[(0,dR.normalizeAgentName)(c)]??null,z=(0,q.useMemo)(()=>[...k].sort((a,b)=>a.id.localeCompare(b.id)),[k]),A=l??z[0]?.id??null,B=(0,q.useMemo)(()=>z.find(a=>a.id===A)??null,[A,z]),[C,D]=(0,q.useState)([]),[E,F]=(0,q.useState)(!1),[G,H]=(0,q.useState)(""),[I,J]=(0,q.useState)(""),[K,L]=(0,q.useState)([]),[M,N]=(0,q.useState)(!1),[O,P]=(0,q.useState)(!0),[Q,R]=(0,q.useState)("default");(0,q.useEffect)(()=>{if(!B){D([]),H("");return}let a=!1,b=B.defaultBranch.trim()||"main";return async function(){if(!B.path?.trim()){D([b]),H(b);return}F(!0);try{let c=new URLSearchParams({path:B.path}),d=await fetch(`/api/workspaces/branches?${c.toString()}`),e=await d.json().catch(()=>null),f=Array.isArray(e?.branches)?e.branches.filter(a=>"string"==typeof a&&a.trim().length>0):[],g="string"==typeof e?.defaultBranch&&e.defaultBranch.trim().length>0?e.defaultBranch.trim():b,h=f.length>0?f:[g];if(a)return;D(h),H(a=>a.trim().length>0&&h.includes(a)?a:g)}catch{if(a)return;D([b]),H(b)}finally{a||F(!1)}}(),()=>{a=!0}},[B]),(0,q.useEffect)(()=>{if(!A){L([]),J("");return}let a=!1;return async function(){N(!0);try{let b=await fetch(`/api/boards?projectId=${encodeURIComponent(A)}`),c=await b.json().catch(()=>null);if(!b.ok)throw Error(c?.error??`Failed to load tasks: ${b.status}`);let d=(Array.isArray(c?.columns)?c.columns:[]).flatMap(a=>Array.isArray(a.tasks)?a.tasks:[]),e=new Set,f=d.filter(a=>{let b=el(a);return!(!b||e.has(b))&&(e.add(b),!0)});if(a)return;L(f),J(a=>f.some(b=>el(b)===a)?a:"")}catch{if(a)return;L([]),J("")}finally{a||N(!1)}}(),()=>{a=!0}},[A]);let S=(0,q.useMemo)(()=>ez(c,h,i),[h,i,c]),T=(0,q.useMemo)(()=>K.find(a=>el(a)===I)??null,[K,I]),U=eD(f)??"",V=(0,q.useMemo)(()=>{let a=new Set,b=[],d=U.trim();for(let c of S)a.has(c.id)||(a.add(c.id),b.push(c));return d&&!a.has(d)&&(a.add(d),b.unshift({id:d,label:function(a,b){let c=b.trim(),d=(0,dR.normalizeAgentName)(a);if(!c)return c;if("claude-code"===d){let a=c.toLowerCase();if("opus"===a)return"Claude Opus";if("sonnet"===a)return"Claude Sonnet";if("haiku"===a)return"Claude Haiku";let b=a.match(/^claude-(sonnet|opus|haiku)-(\d+)-(\d+)(?:-\d{8})?$/);if(b){let a=b[1];return`Claude ${a[0]?.toUpperCase()+a.slice(1)} ${b[2]}.${b[3]}`}}return c.split(/[-_]+/g).filter(Boolean).map(a=>"gpt"===a.toLowerCase()?"GPT":/^\d+(?:\.\d+)?$/.test(a)?a:a[0]?.toUpperCase()+a.slice(1)).join("-")}(c,d),description:"Current selected model.",access:[]})),b},[S,c,U]),W=(0,q.useMemo)(()=>!y||y.ready||U?U?V.find(a=>a.id===U)?.label??U:"Default":"Setup required",[V,y,U]),X="z-50 min-w-[240px] rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] p-2 shadow-[0_18px_50px_rgba(0,0,0,0.35)]",Y=`${X} max-h-[min(360px,50vh)] overflow-y-auto`,Z="flex min-h-[36px] cursor-default items-center gap-2 rounded-[3px] px-3 py-2 text-[14px] leading-[21px] text-[var(--vk-text-normal)] outline-none hover:bg-[var(--vk-bg-hover)] focus:bg-[var(--vk-bg-hover)]",$=[{id:"default",label:"Default",icon:dM},{id:"auto",label:"Auto",icon:dy},{id:"ask",label:"Ask",icon:dG},{id:"plan",label:"Plan",icon:dH}],_=$.find(a=>a.id===Q)??$[0],aa=a=>{let b=a.repo?.trim();if(b){let a=b.split("/").filter(Boolean),c=a[a.length-1]?.replace(/\.git$/i,"");if(c)return c}return a.id},ab=B?aa(B):null,ac=B?`${ab} \xb7 ${G||B.defaultBranch||"main"}`:p?n:"Select project",ad=T?.taskRef?.trim()||"Link task",ae=T?em(T.text):"Choose a task, bug, or issue from this project's board";return(0,o.jsx)("section",{className:"flex h-full min-h-0 items-start justify-center overflow-auto bg-[var(--vk-bg-main)] px-3 py-4 sm:items-center sm:px-6 sm:py-6",children:(0,o.jsxs)("div",{className:"w-full max-w-[768px]",children:[(0,o.jsx)("h1",{className:"pb-4 text-center text-[30px] font-medium leading-[34px] tracking-[-0.7px] text-[var(--vk-text-strong)] sm:text-[36px] sm:leading-[40px] sm:tracking-[-0.9px]",children:"What would you like to work on?"}),(0,o.jsxs)("div",{className:"mx-auto w-full rounded-[3px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] p-px",children:[(0,o.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border-b border-[var(--vk-border)] px-2 pb-[9px] pt-2",children:[(0,o.jsx)(dX.AgentTileIcon,{seed:{label:c},className:"h-[25px] w-[25px] border-none bg-transparent"}),(0,o.jsxs)(c3,{children:[(0,o.jsx)(c5,{asChild:!0,children:(0,o.jsxs)("button",{type:"button",className:"inline-flex h-[31px] max-w-[70vw] items-center rounded-[3px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-[9px] py-[5px] text-[14px] leading-[21px] text-[var(--vk-text-normal)] outline-none hover:bg-[var(--vk-bg-hover)] data-[state=open]:bg-[var(--vk-bg-hover)] sm:max-w-none","aria-label":"Select agent",children:[(0,o.jsx)("span",{className:"truncate pr-1",children:x}),(0,o.jsx)(dA.ChevronDown,{className:"h-3 w-3 text-[var(--vk-text-muted)]"})]})}),(0,o.jsx)(c6,{children:(0,o.jsxs)(c8,{align:"start",sideOffset:6,className:X,children:[(0,o.jsx)("p",{className:"px-3 pb-1 text-[14px] font-semibold leading-[21px] text-[var(--vk-text-muted)]",children:"Agents"}),w.map(a=>{let b=a===c,f=e[(0,dR.normalizeAgentName)(a)]??null;return(0,o.jsxs)(c9,{onSelect:()=>d(a),className:Z,children:[(0,o.jsx)(dX.AgentTileIcon,{seed:{label:a},className:"h-6 w-6 border-none bg-transparent"}),(0,o.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,o.jsx)("div",{children:ei(a)}),f?.ready?null:(0,o.jsx)("div",{className:"truncate text-[12px] leading-[16px] text-[var(--vk-text-muted)]",children:f?.installed?"Setup required":"Not installed"})]}),(0,o.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 items-center justify-center text-[var(--vk-text-strong)]",children:b?(0,o.jsx)(dz.Check,{className:"h-4 w-4"}):null})]},a)})]})})]}),(0,o.jsxs)(c3,{children:[(0,o.jsx)(c5,{asChild:!0,children:(0,o.jsxs)("button",{type:"button",disabled:!A,className:"ml-auto flex h-[31px] min-w-[220px] items-center rounded-[3px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-[9px] py-[5px] text-left disabled:cursor-not-allowed disabled:opacity-50 sm:ml-0 sm:w-[286px]","aria-label":"Link task",children:[(0,o.jsx)("span",{className:"pr-2 text-[12px] uppercase tracking-[0.08em] text-[var(--vk-text-muted)]",children:"Task"}),(0,o.jsx)("span",{className:"min-w-0 flex-1 truncate text-[14px] leading-[21px] text-[var(--vk-text-normal)]",children:ad}),(0,o.jsx)(dA.ChevronDown,{className:"h-3 w-3 text-[var(--vk-text-muted)]"})]})}),(0,o.jsx)(c6,{children:(0,o.jsxs)(c8,{align:"end",side:"bottom",sideOffset:6,className:Y,children:[(0,o.jsx)("p",{className:"px-3 pb-1 text-[14px] font-semibold leading-[21px] text-[var(--vk-text-muted)]",children:"Link task"}),(0,o.jsx)("p",{className:"px-3 pb-2 text-[12px] leading-[16px] text-[var(--text-faint)]",children:ae}),(0,o.jsxs)(c9,{onSelect:()=>J(""),className:Z,children:[(0,o.jsx)("span",{children:"No linked task"}),(0,o.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 items-center justify-center text-[var(--vk-text-strong)]",children:I?null:(0,o.jsx)(dz.Check,{className:"h-4 w-4"})})]}),M?(0,o.jsx)("div",{className:"px-3 py-2 text-[12px] leading-[18px] text-[var(--vk-text-muted)]",children:"Loading board tasks..."}):K.length>0?K.map(a=>{let b=el(a),c=em(a.text),d=[a.type,a.priority].filter(Boolean).join(" · ");return(0,o.jsxs)(c9,{onSelect:()=>J(b),className:`${Z} min-w-[320px] items-start`,children:[(0,o.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,o.jsx)("div",{className:"truncate",children:a.taskRef?.trim()||c}),(0,o.jsxs)("div",{className:"truncate text-[12px] leading-[16px] text-[var(--text-faint)]",children:[a.taskRef?.trim()?c:b,d?` \xb7 ${d}`:""]})]}),(0,o.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 items-center justify-center text-[var(--vk-text-strong)]",children:I===b?(0,o.jsx)(dz.Check,{className:"h-4 w-4"}):null})]},b)}):(0,o.jsx)("div",{className:"px-3 py-2 text-[12px] leading-[18px] text-[var(--vk-text-muted)]",children:"No existing tasks were found for this project."})]})})]})]}),(0,o.jsx)("div",{className:"rounded-[3.5px]",children:(0,o.jsxs)("div",{className:"flex flex-col gap-3 p-2",children:[(0,o.jsxs)("div",{className:"relative w-full",children:[(0,o.jsx)("textarea",{value:a,onChange:a=>b(a.target.value),placeholder:"Describe the task...",rows:1,className:"min-h-[24px] w-full resize-none bg-transparent pr-8 text-[16px] leading-[24px] text-[var(--vk-text-normal)] outline-none placeholder:text-[var(--vk-text-muted)]"}),(0,o.jsx)("button",{type:"button","aria-label":"Preview",className:"absolute right-0 top-0 inline-flex h-[24px] w-[24px] items-center justify-center rounded-[4px] text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]",children:(0,o.jsx)(dC,{className:"h-[14px] w-[14px]"})})]}),(0,o.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between",children:[(0,o.jsxs)("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-x-1 gap-y-2",children:[(0,o.jsxs)(c3,{children:[(0,o.jsx)(c5,{asChild:!0,children:(0,o.jsx)("button",{type:"button",className:"inline-flex h-[29px] w-[29px] items-center justify-center rounded-[3px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]","aria-label":"Select workspace or project",children:(0,o.jsx)(dM,{className:"h-[15px] w-[15px]"})})}),(0,o.jsx)(c6,{children:(0,o.jsxs)(c8,{align:"start",sideOffset:6,className:X,children:[(0,o.jsx)("p",{className:"px-3 pb-1 text-[14px] font-semibold leading-[21px] text-[var(--vk-text-muted)]",children:"Projects"}),z.map(a=>{let b=aa(a),c=a.id!==b?a.id:a.path?.trim()||a.repo?.trim()||null;return(0,o.jsxs)(c9,{onSelect:()=>m(a.id),className:`${Z} min-w-[280px] items-start`,children:[(0,o.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,o.jsx)("div",{className:"truncate",children:b}),c?(0,o.jsx)("div",{className:"truncate text-[12px] leading-[16px] text-[var(--text-faint)]",children:c}):null]}),(0,o.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 items-center justify-center text-[var(--vk-text-strong)]",children:a.id===A?(0,o.jsx)(dz.Check,{className:"h-4 w-4"}):null})]},a.id)}),(0,o.jsx)(da,{className:"my-1 h-px bg-[var(--vk-border)]"}),(0,o.jsxs)(c9,{onSelect:t,className:Z,children:[(0,o.jsx)(dD.FolderOpen,{className:"h-4 w-4"}),(0,o.jsx)("span",{children:"Add Workspace"})]})]})})]}),(0,o.jsxs)(c3,{children:[(0,o.jsx)(c5,{asChild:!0,children:(0,o.jsxs)("button",{type:"button",className:"inline-flex h-[29px] items-center gap-[4px] rounded-[3px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-[9px] py-[5px] text-[14px] leading-[21px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:cursor-not-allowed disabled:opacity-60",children:[(0,o.jsx)("span",{children:W}),(0,o.jsx)(dA.ChevronDown,{className:"h-[10px] w-[10px] text-[var(--vk-text-muted)]"})]})}),(0,o.jsx)(c6,{children:(0,o.jsxs)(c8,{align:"start",sideOffset:6,className:X,children:[(0,o.jsx)("p",{className:"px-3 pb-1 text-[14px] font-semibold leading-[21px] text-[var(--vk-text-muted)]",children:"Model"}),(0,o.jsxs)(c9,{onSelect:()=>g(eC(c,h,i,B?.agentModel,B?.agentReasoningEffort)),className:Z,children:[(0,o.jsx)("span",{children:"Default"}),(0,o.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 items-center justify-center text-[var(--vk-text-strong)]",children:U?null:(0,o.jsx)(dz.Check,{className:"h-4 w-4"})})]}),V.map(a=>(0,o.jsxs)(c9,{onSelect:()=>g({catalogModel:a.id,customModel:"",reasoningEffort:eB(c,h,i,a.id)}),className:Z,children:[(0,o.jsx)("span",{children:a.label}),(0,o.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 items-center justify-center text-[var(--vk-text-strong)]",children:U===a.id?(0,o.jsx)(dz.Check,{className:"h-4 w-4"}):null})]},a.id)),0===V.length?(0,o.jsx)("div",{className:"px-3 py-2 text-[12px] leading-[18px] text-[var(--vk-text-muted)]",children:"Models will appear here after the selected agent is installed and its runtime catalog is detected."}):null,y&&!y.ready?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(da,{className:"my-1 h-px bg-[var(--vk-border)]"}),(0,o.jsx)("button",{type:"button",onClick:()=>u(c),className:"flex w-full items-center rounded-[3px] px-3 py-2 text-left text-[13px] text-[var(--vk-orange)] transition hover:bg-[var(--vk-bg-hover)]",children:y.installed?"Open setup":"Open install guide"})]}):null]})})]}),(0,o.jsxs)(c3,{children:[(0,o.jsx)(c5,{asChild:!0,children:(0,o.jsxs)("button",{type:"button",className:"inline-flex h-[29px] items-center gap-[4px] rounded-[3px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-[9px] py-[5px] text-[14px] leading-[21px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[(0,o.jsx)("span",{children:_.label}),(0,o.jsx)(dA.ChevronDown,{className:"h-[10px] w-[10px] text-[var(--vk-text-muted)]"})]})}),(0,o.jsx)(c6,{children:(0,o.jsxs)(c8,{align:"start",sideOffset:6,className:X,children:[(0,o.jsx)("p",{className:"px-3 pb-1 text-[14px] font-semibold leading-[21px] text-[var(--vk-text-muted)]",children:"Permissions"}),$.map(({id:a,label:b,icon:c})=>(0,o.jsxs)(c9,{onSelect:()=>R(a),className:Z,children:[(0,o.jsx)(c,{className:"h-4 w-4"}),(0,o.jsx)("span",{children:b}),(0,o.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 items-center justify-center text-[var(--vk-text-strong)]",children:Q===a?(0,o.jsx)(dz.Check,{className:"h-4 w-4"}):null})]},a))]})})]}),(0,o.jsxs)(c3,{children:[(0,o.jsx)(c5,{asChild:!0,children:(0,o.jsx)("button",{type:"button",disabled:!B,className:"inline-flex min-h-[29px] max-w-[320px] items-center justify-center truncate text-[14px] leading-[21px] text-[var(--vk-text-normal)] hover:text-[var(--vk-text-strong)] disabled:cursor-not-allowed disabled:opacity-50",children:ac})}),(0,o.jsx)(c6,{children:(0,o.jsxs)(c8,{align:"start",side:"bottom",sideOffset:6,avoidCollisions:!1,className:Y,children:[(0,o.jsx)("p",{className:"px-3 pb-1 text-[14px] font-semibold leading-[21px] text-[var(--vk-text-muted)]",children:"Branch"}),ab?(0,o.jsx)("p",{className:"px-3 pb-2 text-[12px] leading-[16px] text-[var(--text-faint)]",children:ab}):null,E?(0,o.jsx)("div",{className:"px-3 py-2 text-[14px] leading-[21px] text-[var(--vk-text-muted)]",children:"Loading branches..."}):C.map(a=>(0,o.jsxs)(c9,{onSelect:()=>H(a),className:Z,children:[(0,o.jsx)("span",{children:a}),(0,o.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 items-center justify-center text-[var(--vk-text-strong)]",children:G===a?(0,o.jsx)(dz.Check,{className:"h-4 w-4"}):null})]},a))]})})]})]}),(0,o.jsx)("div",{className:"flex w-full justify-end sm:w-auto",children:(0,o.jsx)("button",{type:"button",onClick:()=>v({projectId:A??void 0,...O?{baseBranch:G||B?.defaultBranch||void 0}:{branch:G||B?.defaultBranch||void 0},issueId:I.trim()||void 0,useWorktree:O,permissionMode:Q}),disabled:r||0===a.trim().length||!A,className:"inline-flex min-h-[29px] items-center justify-center rounded-[3px] bg-[var(--vk-bg-hover)] px-[8px] py-[6.5px] text-[16px] leading-[16px] text-[var(--vk-text-strong)] transition-colors hover:bg-[var(--vk-bg-active)] disabled:cursor-not-allowed disabled:opacity-50",children:r?(0,o.jsx)(dI.Loader2,{className:"h-4 w-4 animate-spin"}):"Create"})})]}),y&&!y.ready?(0,o.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-3 py-2 text-[13px] text-[var(--vk-text-normal)]",children:(0,o.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,o.jsxs)("div",{className:"min-w-0",children:[(0,o.jsxs)("p",{className:"text-[13px] text-[var(--vk-text-strong)]",children:[x," is not ready on this machine."]}),(0,o.jsx)("p",{className:"pt-0.5 text-[12px] text-[var(--vk-text-muted)]",children:y.installed?"Finish login or local setup to load models and start streaming sessions.":"Install the CLI first, then its models and authentication state will appear here."})]}),(0,o.jsx)("button",{type:"button",onClick:()=>u(c),className:"inline-flex h-[29px] items-center justify-center rounded-[3px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-orange)] hover:bg-[var(--vk-bg-hover)]",children:y.installed?"Open setup":"Open install"})]})}):null,(0,o.jsxs)("label",{className:"flex items-start gap-2 rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-2 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,o.jsx)("input",{type:"checkbox",checked:O,onChange:a=>P(a.target.checked),className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,o.jsxs)("span",{children:["Use worktree isolation",(0,o.jsx)("span",{className:"block text-[11px] text-[var(--vk-text-muted)]",children:"If unchecked, the session runs directly on the selected branch in the local repo."})]})]})]})})]}),s&&(0,o.jsx)("p",{className:"pt-2 text-[12px] text-[var(--status-error)]",children:s})]})})});function eR({value:a,idleLabel:b="Copy",copiedLabel:c="Copied"}){let[d,e]=(0,q.useState)(!1);async function f(){await navigator.clipboard.writeText(a),e(!0),window.setTimeout(()=>e(!1),1400)}return(0,o.jsxs)("button",{type:"button",onClick:()=>void f(),className:"inline-flex h-8 items-center gap-1.5 rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[d?(0,o.jsx)(dz.Check,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"}):(0,o.jsx)(dB.Copy,{className:"h-3.5 w-3.5"}),(0,o.jsx)("span",{children:d?c:b})]})}function eS({open:a,mode:b,creating:c,error:d,current:e,projectCount:f,agentOptions:g,runtimeModelCatalogs:h,onRepositoriesChanged:i,onOnboardingComplete:j,onClose:k,onSave:l}){var m,n;let p,[r,s]=(0,q.useState)("preferences"),[t,u]=(0,q.useState)(e.codingAgent),[v,w]=(0,q.useState)(e.ide),[x,y]=(0,q.useState)(e.remoteSshHost),[z,A]=(0,q.useState)(e.remoteSshUser),[B,C]=(0,q.useState)(e.markdownEditor),[D,E]=(0,q.useState)(e.modelAccess),[F,G]=(0,q.useState)(e.notifications.soundEnabled),[H,I]=(0,q.useState)(e.notifications.soundFile),[J,K]=(0,q.useState)([]),[L,M]=(0,q.useState)(!1),[N,O]=(0,q.useState)(!1),[P,Q]=(0,q.useState)(null),[R,S]=(0,q.useState)(""),[T,U]=(0,q.useState)(null),[V,W]=(0,q.useState)(ew()),[X,Y]=(0,q.useState)([]),[Z,$]=(0,q.useState)(!1),[_,aa]=(0,q.useState)(null),[ab,ac]=(0,q.useState)(!1),[ad,ae]=(0,q.useState)(()=>ev(null)),[af,ag]=(0,q.useState)(!1),[ah,ai]=(0,q.useState)(!1),[aj,ak]=(0,q.useState)(null),al=c||N||ah;function am(a){return{...a,pathHealth:{exists:a.pathHealth.exists,isGitRepository:a.pathHealth.isGitRepository,suggestedPath:a.pathHealth.suggestedPath}}}function an(a){return a.split(/\n+/g).map(a=>a.trim()).filter(Boolean)}async function ao(a){M(!0),Q(null);try{let b=await fetch("/api/repositories"),c=await b.json().catch(()=>null);if(!b.ok)throw Error(c?.error??`Failed to load repositories (${b.status})`);let d=Array.isArray(c?.repositories)?c.repositories:[];K(d);let e=d[0]?.id??"",f=a&&d.some(b=>b.id===a)?a:R&&d.some(a=>a.id===R)?R:e;S(f)}catch(a){K([]),S(""),U(null),W(ew()),Q(a instanceof Error?a.message:"Failed to load repositories")}finally{M(!1)}}async function ap(a,b){let c=(a??T?.path??"").trim();if(0===c.length){aa("Select a repository path first."),Y([]);return}$(!0),aa(null);try{let a=new URLSearchParams({path:c}),d=await fetch(`/api/workspaces/branches?${a.toString()}`),e=await d.json().catch(()=>null);if(!d.ok)throw Error(e?.error??`Failed to detect branches (${d.status})`);let f=Array.isArray(e?.branches)?e.branches.filter(a=>"string"==typeof a&&a.trim().length>0):[];Y(f);let g=b?.trim()||("string"==typeof e?.defaultBranch&&e.defaultBranch.trim().length>0?e.defaultBranch.trim():f[0]??"");if(!g)return;U(a=>!a||a.defaultBranch.trim().length>0&&f.includes(a.defaultBranch)?a:{...a,defaultBranch:g})}catch(a){Y([]),aa(a instanceof Error?a.message:"Failed to detect branches")}finally{$(!1)}}async function aq(){if(!T||N||0===T.repo.trim().length||0===T.path.trim().length)return!1;O(!0),Q(null);try{let a=await fetch("/api/repositories",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:T.id,displayName:T.displayName,repo:T.repo,path:T.path,agent:T.agent,agentModel:eD(V)??"",agentReasoningEffort:eE(V)??"",defaultWorkingDirectory:T.defaultWorkingDirectory,defaultBranch:T.defaultBranch,devServerScript:T.devServerScript,setupScript:T.setupScript,runSetupInParallel:T.runSetupInParallel,cleanupScript:T.cleanupScript,archiveScript:T.archiveScript,copyFiles:T.copyFiles})}),b=await a.json().catch(()=>null);if(!a.ok)throw Error(b?.error??`Failed to save repository settings (${a.status})`);let c=b?.repository;if(!c)throw Error("Repository saved but response is missing repository data");return K(a=>a.map(a=>a.id===c.id?c:a)),U(am(c)),S(c.id),aa(null),await ap(c.path,c.defaultBranch),i&&await i(),!0}catch(a){return Q(a instanceof Error?a.message:"Failed to save repository settings"),!1}finally{O(!1)}}async function ar(){ag(!0),ak(null);try{let a=await fetch("/api/access"),b=await a.json().catch(()=>null);if(!a.ok)throw Error(b?.error??`Failed to load organization settings (${a.status})`);ae(ev(b?.access,b?.current))}catch(a){ae(ev(null)),ak(a instanceof Error?a.message:"Failed to load organization settings")}finally{ag(!1)}}async function as(){if(ah)return!1;ai(!0),ak(null);try{let a=await fetch("/api/access",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireAuth:ad.requireAuth,defaultRole:ad.defaultRole,trustedHeaders:{enabled:ad.trustedHeaders.enabled,provider:ad.trustedHeaders.provider,emailHeader:ad.trustedHeaders.emailHeader,jwtHeader:ad.trustedHeaders.jwtHeader,teamDomain:ad.trustedHeaders.teamDomain,audience:ad.trustedHeaders.audience},roles:{viewers:an(ad.roles.viewers),operators:an(ad.roles.operators),admins:an(ad.roles.admins),viewerDomains:an(ad.roles.viewerDomains),operatorDomains:an(ad.roles.operatorDomains),adminDomains:an(ad.roles.adminDomains)}})}),b=await a.json().catch(()=>null);if(!a.ok)throw Error(b?.error??`Failed to save organization settings (${a.status})`);return ae(ev(b?.access,b?.current)),!0}catch(a){return ak(a instanceof Error?a.message:"Failed to save organization settings"),!1}finally{ai(!1)}}(0,q.useEffect)(()=>{a&&(s("onboarding"===b?"preferences":"general"),u(e.codingAgent),w(e.ide),y(e.remoteSshHost),A(e.remoteSshUser),C(e.markdownEditor),E(e.modelAccess),G(e.notifications.soundEnabled),I(e.notifications.soundFile),Y([]),aa(null),Q(null),W(ew()),ak(null))},[b,a]),(0,q.useEffect)(()=>{a&&("settings"===b||"repositories"===r)&&ao()},[r,b,a]),(0,q.useEffect)(()=>{a&&"onboarding"!==b&&ar()},[b,a]),(0,q.useEffect)(()=>{if(!a)return;if(!R){U(null),W(ew());return}let b=J.find(a=>a.id===R);b&&(U(am(b)),W(eC(b.agent,D,h,b.agentModel,b.agentReasoningEffort)),Y([]),aa(null),b.path.trim().length>0&&ap(b.path,b.defaultBranch))},[D,a,J,h,R]);let at="onboarding"===b&&f>0,au=(0,q.useMemo)(()=>"onboarding"===b?at?eo:eo.filter(a=>"preferences"===a.id):en.filter(a=>a.implemented),[b,at]),av=au.find(a=>a.id===r)??au[0]??en[0],aw="onboarding"===b,ax="preferences"===av.id,ay="general"===av.id,az="remote_access"===av.id,aA="agents"===av.id,aB=ax||ay||az||aA,aC="repositories"===av.id,aD="organization"===av.id,aE=au.findIndex(a=>a.id===av.id)+1,aF=au.some(a=>"repositories"===a.id),aG="admin"===ad.current.role,aH=(0,q.useMemo)(()=>{let a=new Set(g);t.trim().length>0&&a.add(t),0===a.size&&a.add(ed);let b=new Map(ec.map((a,b)=>[a,b]));return[...a].sort((a,c)=>{let d=b.get((0,dR.normalizeAgentName)(a))??Number.MAX_SAFE_INTEGER,e=b.get((0,dR.normalizeAgentName)(c))??Number.MAX_SAFE_INTEGER;return d!==e?d-e:ei(a).localeCompare(ei(c))})},[g,t]);if(!a)return null;let aI=t.trim().length>0&&v.trim().length>0&&B.trim().length>0,aJ=!!T&&T.displayName.trim().length>0&&T.repo.trim().length>0&&T.path.trim().length>0&&T.defaultBranch.trim().length>0,aK=aG&&!af&&(!ad.trustedHeaders.enabled||"generic"===ad.trustedHeaders.provider||ad.trustedHeaders.teamDomain.trim().length>0&&ad.trustedHeaders.audience.trim().length>0),aL=aC?P:aD?aj:d,aM=T?(m={...T,agentModel:eD(V)??"",agentReasoningEffort:eE(V)??""},n={ide:v,markdownEditor:B},p=["npx conductor-oss@latest setup","--yes",`--path ${eJ(m.path)}`,`--project-id ${eJ(m.id)}`,`--display-name ${eJ(m.displayName)}`,`--agent ${eJ(m.agent||"claude-code")}`,`--ide ${eJ(n.ide)}`,`--markdown-editor ${eJ(n.markdownEditor)}`],m.repo.trim().length>0&&p.push(`--repo ${eJ(m.repo.trim())}`),m.defaultBranch.trim().length>0&&p.push(`--default-branch ${eJ(m.defaultBranch.trim())}`),m.agentModel.trim().length>0&&p.push(`--model ${eJ(m.agentModel.trim())}`),m.agentReasoningEffort.trim().length>0&&p.push(`--reasoning-effort ${eJ(m.agentReasoningEffort.trim())}`),m.defaultWorkingDirectory.trim().length>0&&p.push(`--default-working-directory ${eJ(m.defaultWorkingDirectory.trim())}`),p.join(" ")):"";async function aN(a,b){let d;return!!aI&&!c&&l((d=F?H??er[0]?.id??"abstract-sound-4":null,{onboardingAcknowledged:!!a||e.onboardingAcknowledged,codingAgent:t.trim(),ide:v.trim(),remoteSshHost:x.trim(),remoteSshUser:z.trim(),markdownEditor:B.trim(),modelAccess:D,notifications:{soundEnabled:F,soundFile:d}}),b)}async function aO(){if(!L){if(!aF){if(!await aN(!0,{closeDialog:!0}))return;j?.({needsProject:0===f});return}await aN(!1,{closeDialog:!1})&&s("repositories")}}async function aP(){(!aC||await aq())&&await aN(!0,{closeDialog:!0})&&j?.({needsProject:!1})}return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{className:"fixed inset-0 z-[90] flex items-start justify-center overflow-y-auto bg-black/70 px-3 py-3 sm:items-center",onClick:()=>{al||"onboarding"===b||ab||k()},role:"presentation",children:(0,o.jsxs)("div",{className:"flex max-h-[calc(100dvh-1.5rem)] w-full max-w-[1120px] flex-col overflow-hidden rounded-[6px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] shadow-[0_24px_80px_rgba(0,0,0,0.55)] sm:h-[min(92vh,760px)] sm:flex-row",onClick:a=>a.stopPropagation(),children:[(0,o.jsxs)("aside",{className:"flex w-full shrink-0 flex-col border-b border-[var(--vk-border)] bg-[rgba(28,28,28,0.8)] sm:w-[224px] sm:border-b-0 sm:border-r",children:[(0,o.jsx)("header",{className:"border-b border-[var(--vk-border)] px-4 py-3 sm:py-4",children:(0,o.jsx)("h2",{className:"text-[22px] leading-[24px] text-[var(--vk-text-strong)] sm:text-[27px] sm:leading-[27px]",children:aw?"Setup":"Settings"})}),(0,o.jsx)("nav",{className:"flex gap-1 overflow-x-auto p-2 sm:block sm:space-y-1 sm:overflow-auto",children:au.map(a=>{let b=a.icon,c=av.id===a.id;return(0,o.jsxs)("button",{type:"button",onClick:()=>s(a.id),disabled:al,className:`flex shrink-0 items-center gap-3 rounded-[3px] px-3 py-2 text-left text-[14px] leading-[21px] transition-colors sm:w-full ${c?"bg-[rgba(234,122,42,0.1)] text-[var(--vk-orange)]":"text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]"} disabled:opacity-50`,children:[(0,o.jsx)(b,{className:"h-4 w-4 shrink-0"}),(0,o.jsx)("span",{children:a.label})]},a.id)})})]}),(0,o.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,o.jsxs)("header",{className:"flex items-center justify-between border-b border-[var(--vk-border)] px-4 py-3 sm:py-4",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("h3",{className:"text-[20px] leading-[24px] text-[var(--vk-text-strong)] sm:text-[27px] sm:leading-[27px]",children:aw?ax?"Choose your preferences":"Review repository defaults":av.label}),aw&&(0,o.jsxs)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:["Step ",aE," of ",au.length]})]}),(0,o.jsx)("button",{type:"button",onClick:k,disabled:al||"onboarding"===b,"aria-label":"Close settings",className:"inline-flex h-7 w-7 items-center justify-center rounded-[4px] text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-40",children:(0,o.jsx)(dQ.X,{className:"h-4 w-4"})})]}),(0,o.jsx)("div",{className:"min-h-0 flex-1 overflow-auto px-4 py-3 sm:px-6 sm:py-4",children:aB?(0,o.jsxs)("div",{className:"space-y-5",children:[aw&&(0,o.jsx)("section",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[rgba(234,122,42,0.08)] px-4 py-3",children:(0,o.jsx)("p",{className:"text-[13px] leading-5 text-[var(--vk-text-normal)]",children:"Conductor is already running locally. Finish setup here in the dashboard, then you can start using chat and boards immediately."})}),(ax||aA)&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("section",{className:"space-y-2",children:[(0,o.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Choose Your Coding Agent"}),(0,o.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Select the default coding agent configuration."}),(0,o.jsx)("div",{className:"grid gap-2",children:aH.map(a=>{let b=t===a;return(0,o.jsxs)("button",{type:"button",onClick:()=>u(a),className:`flex items-center gap-2 rounded-[4px] border px-3 py-2 text-left ${b?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,o.jsx)(dX.AgentTileIcon,{seed:{label:a},className:"h-5 w-5 border-none bg-transparent"}),(0,o.jsx)("span",{className:"flex-1 text-[13px] text-[var(--vk-text-normal)]",children:ei(a)}),b&&(0,o.jsx)(dz.Check,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]},a)})})]}),(0,o.jsxs)("section",{className:"space-y-3",children:[(0,o.jsxs)("div",{className:"space-y-1",children:[(0,o.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Model Access"}),(0,o.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Tell Conductor which account mode each agent is using so the model dropdown only shows options that make sense for that login path."})]}),(0,o.jsx)("div",{className:"grid gap-3",children:aH.filter(a=>(0,dk.supportsAgentModelSelection)(a)).map(a=>{let b=(0,dk.getAgentModelCatalog)(a);if(!b)return null;let c=(0,dk.resolveAgentModelAccess)(a,D)??b.defaultAccess;return(0,o.jsxs)("label",{className:"block rounded-[4px] border border-[var(--vk-border)] px-3 py-3",children:[(0,o.jsx)("span",{className:"mb-1 block text-[13px] font-medium text-[var(--vk-text-normal)]",children:b.label}),(0,o.jsx)("select",{value:c,onChange:b=>{var c;let d;return c=b.target.value,void((d=(0,dk.getAgentModelCatalog)(a))&&E(a=>({...a,[d.accessKey]:c})))},className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:b.accessOptions.map(a=>(0,o.jsx)("option",{value:a.id,children:a.label},a.id))}),(0,o.jsx)("p",{className:"mt-1.5 text-[11px] text-[var(--vk-text-muted)]",children:b.accessOptions.find(a=>a.id===c)?.description})]},a)})})]})]}),(ax||ay)&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("section",{className:"space-y-2",children:[(0,o.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Choose Your Code Editor"}),(0,o.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"This editor will be used when opening attempts and files."}),(0,o.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:ep.map(a=>{let b=v===a.id;return(0,o.jsxs)("button",{type:"button",onClick:()=>w(a.id),className:`flex items-center gap-2 rounded-[4px] border px-3 py-2 text-left ${b?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,o.jsx)(eI,{editorId:a.id,label:a.label}),(0,o.jsx)("span",{className:"flex-1 text-[13px] text-[var(--vk-text-normal)]",children:a.label}),b&&(0,o.jsx)(dz.Check,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]},a.id)})})]}),ax&&(0,o.jsxs)("section",{className:"space-y-3",children:[(0,o.jsxs)("div",{className:"space-y-1",children:[(0,o.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Remote Access"}),(0,o.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Use your local Remote-SSH editor to jump straight into a remote worktree. This complements ngrok or Cloudflare Tunnel for dashboard access; it does not replace the tunnel."})]}),(0,o.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"SSH Host or Alias"}),(0,o.jsx)("input",{value:x,onChange:a=>y(a.target.value),placeholder:"e.g., conductor-dev or 203.0.113.10",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"SSH User (optional)"}),(0,o.jsx)("input",{value:z,onChange:a=>A(a.target.value),placeholder:"e.g., ubuntu",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]})]}),(0,o.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"One-click remote open currently supports VS Code and VS Code Insiders. Other editors will still save as your preference, but they will not get a remote launch button yet."})]}),(0,o.jsxs)("section",{className:"space-y-2",children:[(0,o.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Markdown Editor"}),(0,o.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Used as your second-brain markdown source when feeding context into tasks."}),(0,o.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:eq.map(a=>{let b=B===a.id;return(0,o.jsxs)("button",{type:"button",onClick:()=>C(a.id),className:`flex items-center gap-2 rounded-[4px] border px-3 py-2 text-left ${b?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,o.jsx)(eL,{editorId:a.id}),(0,o.jsx)("span",{className:"flex-1 text-[13px] text-[var(--vk-text-normal)]",children:a.label}),b&&(0,o.jsx)(dz.Check,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]},a.id)})})]}),(0,o.jsxs)("section",{className:"space-y-2",children:[(0,o.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Notification Sound"}),(0,o.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Pick a sound for notifications, or disable sound."}),(0,o.jsxs)("div",{className:"grid gap-2 sm:grid-cols-2",children:[er.map(a=>{let b=F&&H===a.id;return(0,o.jsxs)("button",{type:"button",onClick:()=>{G(!0),I(a.id)},className:`flex items-center gap-2 rounded-[4px] border px-3 py-2 text-left ${b?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,o.jsx)(dO,{className:"h-4 w-4 text-[var(--vk-text-muted)]"}),(0,o.jsx)("span",{className:"flex-1 text-[13px] text-[var(--vk-text-normal)]",children:a.label}),b&&(0,o.jsx)(dz.Check,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]},a.id)}),(0,o.jsxs)("button",{type:"button",onClick:()=>G(!1),className:`flex items-center gap-2 rounded-[4px] border px-3 py-2 text-left ${!F?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,o.jsx)(dP,{className:"h-4 w-4 text-[var(--vk-text-muted)]"}),(0,o.jsx)("span",{className:"flex-1 text-[13px] text-[var(--vk-text-normal)]",children:"No sound"}),!F&&(0,o.jsx)(dz.Check,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]})]})]})]}),az&&(0,o.jsxs)("section",{className:"space-y-3",children:[(0,o.jsxs)("div",{className:"space-y-1",children:[(0,o.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Remote Access"}),(0,o.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Use your local Remote-SSH editor to jump straight into a remote worktree. This complements ngrok or Cloudflare Tunnel for dashboard access; it does not replace the tunnel."})]}),(0,o.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"SSH Host or Alias"}),(0,o.jsx)("input",{value:x,onChange:a=>y(a.target.value),placeholder:"e.g., conductor-dev or 203.0.113.10",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"SSH User (optional)"}),(0,o.jsx)("input",{value:z,onChange:a=>A(a.target.value),placeholder:"e.g., ubuntu",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]})]}),(0,o.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"One-click remote open currently supports VS Code and VS Code Insiders. Other editors will still save as your preference, but they will not get a remote launch button yet."})]})]}):aC?(0,o.jsxs)("div",{className:"space-y-5",children:[(0,o.jsxs)("section",{className:"space-y-1",children:[(0,o.jsx)("h4",{className:"text-[24px] leading-[24px] text-[var(--vk-text-strong)]",children:aw?"Repository Defaults":"Repository Configuration"}),(0,o.jsx)("p",{className:"text-[14px] text-[var(--vk-text-muted)]",children:aw?"Review the repository Conductor will use for this workspace. You can edit advanced scripts later from Settings.":"Configure scripts and defaults used whenever this repository is selected for workspaces."})]}),("settings"===b||J.length>1)&&(0,o.jsxs)("section",{className:"space-y-2",children:[(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Select Repository"}),(0,o.jsxs)("select",{value:R,onChange:a=>S(a.target.value),disabled:L||0===J.length||al,className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60",children:[0===J.length&&(0,o.jsx)("option",{value:"",children:"No repositories configured"}),J.map(a=>(0,o.jsx)("option",{value:a.id,children:a.displayName},a.id))]})]}),(0,o.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Select a repository to view and edit its configuration."}),L&&(0,o.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Loading repositories..."})]}),aw&&1===J.length&&T&&(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Detected Repository"}),(0,o.jsxs)("div",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[rgba(15,15,15,0.52)] px-3 py-3 text-[13px] text-[var(--vk-text-normal)]",children:[T.displayName,(0,o.jsx)("span",{className:"ml-2 text-[var(--vk-text-muted)]",children:T.path})]})]}),T&&(0,o.jsxs)(o.Fragment,{children:["settings"===b&&(0,o.jsxs)("section",{className:"space-y-3 border-t border-[var(--vk-border)] pt-4",children:[(0,o.jsxs)("div",{className:"space-y-1",children:[(0,o.jsx)("h5",{className:"text-[22px] leading-[22px] text-[var(--vk-text-strong)]",children:"Repo-Preseed Bootstrap"}),(0,o.jsx)("p",{className:"text-[13px] text-[var(--vk-text-muted)]",children:"Use this when you already know the target repository and want one command to prefill it. The default first-run path is still `npx conductor-oss@latest`, which opens the dashboard and lets the user choose preferences before adding a project."})]}),(0,o.jsxs)("div",{className:"flex flex-wrap gap-2 text-[11px] text-[var(--vk-text-muted)]",children:[(0,o.jsxs)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1",children:["Workspace: ",T.workspaceMode]}),(0,o.jsxs)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1",children:["Runtime: ",T.runtimeMode]}),(0,o.jsxs)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1",children:["SCM: ",T.scmMode]})]}),(0,o.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[rgba(15,15,15,0.72)] p-3",children:(0,o.jsx)("pre",{className:"overflow-x-auto whitespace-pre-wrap break-all text-[12px] leading-5 text-[var(--vk-text-normal)]",children:aM})}),(0,o.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,o.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"This command uses your selected agent, editor, and notes app. Best on macOS with Homebrew. GitHub sign-in still opens a browser so the user can approve access."}),(0,o.jsx)(eR,{value:aM,idleLabel:"Copy Setup Command"})]})]}),(0,o.jsxs)("section",{className:"space-y-3 border-t border-[var(--vk-border)] pt-4",children:[(0,o.jsx)("h5",{className:"text-[22px] leading-[22px] text-[var(--vk-text-strong)]",children:"General Settings"}),(0,o.jsx)("p",{className:"text-[13px] text-[var(--vk-text-muted)]",children:"Configure basic repository information."}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Display Name"}),(0,o.jsx)("input",{value:T.displayName,onChange:a=>U(b=>b?{...b,displayName:a.target.value}:b),className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,o.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"A friendly name for this repository."})]}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Repository Slug"}),(0,o.jsx)("input",{value:T.repo,onChange:a=>U(b=>b?{...b,repo:a.target.value}:b),placeholder:"e.g., your-org/your-repo",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,o.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Used for PR tracking, GitHub links, and onboarding defaults."})]}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Agent"}),(0,o.jsx)("select",{value:T.agent,onChange:a=>{let b=a.target.value;U(a=>a?{...a,agent:b}:a),W(eC(b,D,h,null))},className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:aH.map(a=>(0,o.jsx)("option",{value:a,children:ei(a)},a))}),(0,o.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Used by the one-line bootstrap and as the project default when tasks dispatch."})]}),(0,dk.supportsAgentModelSelection)(T.agent)&&(0,o.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] px-3 py-3",children:(0,o.jsx)(eM,{agent:T.agent,modelAccess:D,runtimeModelCatalogs:h,selection:V,onChange:W})}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Repository Path"}),(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)("input",{value:T.path,readOnly:!0,onClick:()=>ac(!0),placeholder:"Use Browse to select a repository folder",className:"h-9 w-full cursor-pointer rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,o.jsx)("button",{type:"button",onClick:()=>ac(!0),disabled:al,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",children:(0,o.jsx)(dD.FolderOpen,{className:"h-4 w-4"})})]}),!T.pathHealth.exists&&(0,o.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-red)]",children:"Configured path does not exist on disk."}),T.pathHealth.exists&&!T.pathHealth.isGitRepository&&(0,o.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-red)]",children:"Configured path exists but is not a git repository."}),T.pathHealth.suggestedPath&&(0,o.jsx)("button",{type:"button",onClick:()=>{let a=T.pathHealth.suggestedPath??"";a&&(U(b=>b?{...b,path:a,pathHealth:{...b.pathHealth,exists:!0,isGitRepository:!0,suggestedPath:null}}:b),ap(a))},className:"mt-1 inline-flex h-7 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[11px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Use detected git repo path"})]}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Working Directory"}),(0,o.jsx)("input",{value:T.defaultWorkingDirectory,onChange:a=>U(b=>b?{...b,defaultWorkingDirectory:a.target.value}:b),placeholder:"e.g., packages/frontend",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,o.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Subdirectory relative to the repository root where the coding agent starts."})]}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Target Branch"}),(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)("input",{value:T.defaultBranch,onChange:a=>U(b=>b?{...b,defaultBranch:a.target.value}:b),placeholder:"Select a branch",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,o.jsx)("button",{type:"button",onClick:()=>{ap()},disabled:Z,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",title:"Detect branches",children:Z?(0,o.jsx)(dI.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,o.jsx)(dK,{className:"h-3.5 w-3.5"})})]}),X.length>0&&(0,o.jsx)("select",{value:T.defaultBranch,onChange:a=>U(b=>b?{...b,defaultBranch:a.target.value}:b),className:"mt-2 h-8 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[12px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:X.map(a=>(0,o.jsx)("option",{value:a,children:a},a))}),_&&(0,o.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-red)]",children:_})]})]}),"settings"===b&&(0,o.jsxs)("section",{className:"space-y-3 border-t border-[var(--vk-border)] pt-4",children:[(0,o.jsx)("h5",{className:"text-[22px] leading-[22px] text-[var(--vk-text-strong)]",children:"Scripts & Configuration"}),(0,o.jsx)("p",{className:"text-[13px] text-[var(--vk-text-muted)]",children:"Configure dev server, setup, cleanup, archive, and file-copy behavior for this repository."}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Dev Server Script"}),(0,o.jsx)("textarea",{rows:3,value:T.devServerScript,onChange:a=>U(b=>b?{...b,devServerScript:a.target.value}:b),placeholder:"npm run dev",className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,o.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Starts a development server for this repository."})]}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Setup Script"}),(0,o.jsx)("textarea",{rows:4,value:T.setupScript,onChange:a=>U(b=>b?{...b,setupScript:a.target.value}:b),placeholder:"npm install",className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,o.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Runs in the worktree after creation and before/with coding-agent startup."})]}),(0,o.jsxs)("label",{className:"flex items-start gap-2 rounded-[4px] border border-[var(--vk-border)] px-3 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,o.jsx)("input",{type:"checkbox",checked:T.runSetupInParallel,onChange:a=>U(b=>b?{...b,runSetupInParallel:a.target.checked}:b),className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,o.jsx)("span",{children:"Run setup script in parallel with coding agent"})]}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Cleanup Script"}),(0,o.jsx)("textarea",{rows:4,value:T.cleanupScript,onChange:a=>U(b=>b?{...b,cleanupScript:a.target.value}:b),placeholder:"Runs when the workspace is archived and changes exist",className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Archive Script"}),(0,o.jsx)("textarea",{rows:4,value:T.archiveScript,onChange:a=>U(b=>b?{...b,archiveScript:a.target.value}:b),placeholder:"Runs when the workspace/session is archived",className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Copy Files"}),(0,o.jsx)("input",{value:T.copyFiles,onChange:a=>U(b=>b?{...b,copyFiles:a.target.value}:b),placeholder:".env, config/*.json",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,o.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Comma-separated relative file paths or glob patterns copied from the repo to each worktree."})]})]})]})]}):aD?(0,o.jsxs)("div",{className:"space-y-5",children:[(0,o.jsxs)("section",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[rgba(234,122,42,0.06)] px-4 py-3",children:[(0,o.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Security-First Remote Access"}),(0,o.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"The dashboard stays bound to localhost. For phone and team access, put a verified edge identity layer like Cloudflare Access in front of it, then map authenticated users into viewer, operator, or admin roles here."})]}),af?(0,o.jsxs)("section",{className:"flex items-center gap-2 rounded-[6px] border border-[var(--vk-border)] px-4 py-4 text-[13px] text-[var(--vk-text-muted)]",children:[(0,o.jsx)(dI.Loader2,{className:"h-4 w-4 animate-spin"}),"Loading organization access settings..."]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("section",{className:"grid gap-3 lg:grid-cols-3",children:[(0,o.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,o.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Current Identity"}),(0,o.jsx)("p",{className:"mt-2 text-[14px] text-[var(--vk-text-normal)]",children:ad.current.email??"Anonymous local session"})]}),(0,o.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,o.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Effective Role"}),(0,o.jsx)("p",{className:"mt-2 text-[14px] text-[var(--vk-text-normal)]",children:ad.current.role??"No access"})]}),(0,o.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,o.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Auth Provider"}),(0,o.jsx)("p",{className:"mt-2 text-[14px] text-[var(--vk-text-normal)]",children:ad.current.provider??"Local only"})]})]}),!aG&&(0,o.jsx)("section",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[rgba(80,80,80,0.18)] px-4 py-3",children:(0,o.jsx)("p",{className:"text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"You can review organization security here, but only an admin session can save changes. Use the built-in unlock link, a local admin session, or an admin identity from your edge auth provider to modify access rules."})}),(0,o.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,o.jsxs)("div",{className:"space-y-1",children:[(0,o.jsx)("h5",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Baseline Access Rules"}),(0,o.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Require authentication for every dashboard request and decide what authenticated users get by default before explicit role bindings are applied."})]}),(0,o.jsxs)("label",{className:"flex items-start gap-2 rounded-[4px] border border-[var(--vk-border)] px-3 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,o.jsx)("input",{type:"checkbox",checked:ad.requireAuth,onChange:a=>ae(b=>({...b,requireAuth:a.target.checked})),disabled:!aG||ah,className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,o.jsx)("span",{children:"Require authentication even on localhost"})]}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Role"}),(0,o.jsxs)("select",{value:ad.defaultRole,onChange:a=>ae(b=>({...b,defaultRole:a.target.value})),disabled:!aG||ah,className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60",children:[(0,o.jsx)("option",{value:"viewer",children:"Viewer"}),(0,o.jsx)("option",{value:"operator",children:"Operator"}),(0,o.jsx)("option",{value:"admin",children:"Admin"})]}),(0,o.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"This applies after identity verification when no explicit email or domain binding matches."})]})]}),(0,o.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,o.jsxs)("div",{className:"space-y-1",children:[(0,o.jsx)("h5",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Verified Edge Auth"}),(0,o.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Recommended for secure public phone access and free team collaboration. Conductor verifies the Cloudflare Access JWT instead of trusting a raw email header."})]}),(0,o.jsxs)("label",{className:"flex items-start gap-2 rounded-[4px] border border-[var(--vk-border)] px-3 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,o.jsx)("input",{type:"checkbox",checked:ad.trustedHeaders.enabled,onChange:a=>ae(b=>({...b,trustedHeaders:{...b.trustedHeaders,enabled:a.target.checked}})),disabled:!aG||ah,className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,o.jsx)("span",{children:"Enable verified Cloudflare Access authentication"})]}),(0,o.jsxs)("div",{className:"grid gap-3 lg:grid-cols-2",children:[(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Provider"}),(0,o.jsxs)("select",{value:ad.trustedHeaders.provider,onChange:a=>ae(b=>({...b,trustedHeaders:{...b.trustedHeaders,provider:a.target.value}})),disabled:!aG||ah,className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60",children:[(0,o.jsx)("option",{value:"cloudflare-access",children:"Cloudflare Access (verified JWT)"}),(0,o.jsx)("option",{value:"generic",children:"Generic header passthrough (advanced)"})]})]}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Identity Email Header"}),(0,o.jsx)("input",{value:ad.trustedHeaders.emailHeader,onChange:a=>ae(b=>({...b,trustedHeaders:{...b.trustedHeaders,emailHeader:a.target.value}})),disabled:!aG||ah,className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"})]}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"JWT Assertion Header"}),(0,o.jsx)("input",{value:ad.trustedHeaders.jwtHeader,onChange:a=>ae(b=>({...b,trustedHeaders:{...b.trustedHeaders,jwtHeader:a.target.value}})),disabled:!aG||ah,className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"})]}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Cloudflare Team Domain"}),(0,o.jsx)("input",{value:ad.trustedHeaders.teamDomain,onChange:a=>ae(b=>({...b,trustedHeaders:{...b.trustedHeaders,teamDomain:a.target.value}})),disabled:!aG||ah,placeholder:"your-team.cloudflareaccess.com",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"})]}),(0,o.jsxs)("label",{className:"block lg:col-span-2",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Cloudflare Access Audience"}),(0,o.jsx)("input",{value:ad.trustedHeaders.audience,onChange:a=>ae(b=>({...b,trustedHeaders:{...b.trustedHeaders,audience:a.target.value}})),disabled:!aG||ah,placeholder:"Copy the AUD value from your Cloudflare Access application",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"})]})]}),"generic"===ad.trustedHeaders.provider&&(0,o.jsx)("p",{className:"rounded-[4px] border border-[var(--vk-red)]/35 bg-[var(--vk-red)]/10 px-3 py-2 text-[12px] leading-5 text-[var(--vk-red)]",children:"Generic header passthrough is only safe when your reverse proxy strips user-supplied headers and injects identity itself. Conductor blocks this mode by default unless `CONDUCTOR_ALLOW_INSECURE_TRUSTED_HEADERS=true` is also set."})]}),(0,o.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,o.jsxs)("div",{className:"space-y-1",children:[(0,o.jsx)("h5",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Role Bindings"}),(0,o.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Map verified team identities into least-privilege roles. `viewer` can inspect work, `operator` can control agents, and `admin` can change global settings."})]}),(0,o.jsx)("div",{className:"grid gap-3 lg:grid-cols-2",children:[{label:"Viewer Emails",key:"viewers",placeholder:"alice@example.com"},{label:"Operator Emails",key:"operators",placeholder:"builder@example.com"},{label:"Admin Emails",key:"admins",placeholder:"owner@example.com"},{label:"Viewer Domains",key:"viewerDomains",placeholder:"guests.example.com"},{label:"Operator Domains",key:"operatorDomains",placeholder:"eng.example.com"},{label:"Admin Domains",key:"adminDomains",placeholder:"admins.example.com"}].map(({label:a,key:b,placeholder:c})=>(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:a}),(0,o.jsx)("textarea",{rows:4,value:ad.roles[b],onChange:a=>ae(c=>({...c,roles:{...c.roles,[b]:a.target.value}})),disabled:!aG||ah,placeholder:c,className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"}),(0,o.jsx)("p",{className:"mt-1 text-[11px] text-[var(--vk-text-muted)]",children:"One entry per line."})]},b))})]})]})]}):(0,o.jsxs)("section",{className:"space-y-3",children:[(0,o.jsx)("h4",{className:"text-[16px] font-medium text-[var(--vk-text-strong)]",children:av.label}),(0,o.jsx)("p",{className:"text-[14px] text-[var(--vk-text-muted)]",children:"This section is queued for implementation. General, Agents, Remote Access, and repository settings are available now."}),(0,o.jsx)("button",{type:"button",onClick:()=>s("general"),className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Open General"})]})}),(0,o.jsxs)("footer",{className:"flex flex-col gap-3 border-t border-[var(--vk-border)] px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-2",children:[(0,o.jsxs)("div",{className:"min-w-0",children:[aL&&(0,o.jsx)("p",{className:"truncate rounded-[4px] border border-[var(--vk-red)]/35 bg-[var(--vk-red)]/10 px-2 py-1 text-[12px] text-[var(--vk-red)]",children:aL}),!aL&&aB&&(0,o.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:aw?"Finish setup once here. You can change these preferences any time from Settings.":"Preferences are saved to your conductor config and applied immediately."}),!aL&&aC&&(0,o.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:aw?"These defaults will be used the first time workspaces and tasks are created for this repo.":"Repository settings are saved to your conductor config and used for future workspaces."}),!aL&&aD&&(0,o.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:"Organization access settings are written into `conductor.yaml`. Use admin role bindings for full control, operator bindings for day-to-day agent usage, and viewer bindings for read-only access."})]}),(0,o.jsxs)("div",{className:"flex w-full flex-wrap items-center justify-end gap-2 sm:w-auto",children:[!aw&&(0,o.jsx)("button",{type:"button",onClick:k,disabled:al,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Close"}),aw&&aC&&(0,o.jsx)("button",{type:"button",onClick:()=>s("preferences"),disabled:al,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Back"}),aB&&!aw&&(0,o.jsx)("button",{type:"button",onClick:()=>{aN(e.onboardingAcknowledged,{closeDialog:!0})},disabled:!aI||c,className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:c?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(dI.Loader2,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Saving..."]}):"Save"}),aC&&!aw&&(0,o.jsx)("button",{type:"button",onClick:()=>{aq()},disabled:!aJ||N||L,className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:N?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(dI.Loader2,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Saving..."]}):"Save Repository"}),aD&&!aw&&(0,o.jsx)("button",{type:"button",onClick:()=>{as()},disabled:!aK||ah,className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:ah?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(dI.Loader2,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Saving..."]}):"Save Access"}),aw&&(0,o.jsx)("button",{type:"button",onClick:()=>{ax?aO():aP()},disabled:ax?!aI||c||L:!aJ||al,className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:al||ax&&L?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(dI.Loader2,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),ax&&L?"Loading...":"Saving..."]}):ax&&aF?"Continue":"Finish Setup"})]})]})]})]})}),(0,o.jsx)(eP,{open:ab,initialPath:T?.path,title:"Select Repository Path",description:"Choose the local git repository folder.",onClose:()=>ac(!1),onSelect:a=>{ac(!1),a&&(U(b=>b?{...b,path:a,pathHealth:{...b.pathHealth,exists:!0,isGitRepository:!0,suggestedPath:null}}:b),ap(a))}})]})}function eT(){return(0,o.jsx)(eN,{})}a.s(["default",()=>eT],62587)}];
2
2
 
3
3
  //# sourceMappingURL=packages_web_src_app_page_tsx_cd282e82._.js.map