conductor-oss 0.62.7 → 0.62.8

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 (160) hide show
  1. package/node_modules/@conductor-oss/core/package.json +1 -1
  2. package/package.json +5 -5
  3. package/web/.next/standalone/node_modules/nanoid/package.json +1 -1
  4. package/web/.next/standalone/package.json +1 -1
  5. package/web/.next/standalone/packages/web/.next/BUILD_ID +1 -1
  6. package/web/.next/standalone/packages/web/.next/app-path-routes-manifest.json +8 -8
  7. package/web/.next/standalone/packages/web/.next/build-manifest.json +3 -3
  8. package/web/.next/standalone/packages/web/.next/prerender-manifest.json +3 -3
  9. package/web/.next/standalone/packages/web/.next/react-loadable-manifest.json +15 -14
  10. package/web/.next/standalone/packages/web/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  11. package/web/.next/standalone/packages/web/.next/server/app/_global-error.html +1 -1
  12. package/web/.next/standalone/packages/web/.next/server/app/_global-error.rsc +1 -1
  13. package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  14. package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  15. package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  16. package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  17. package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  18. package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  19. package/web/.next/standalone/packages/web/.next/server/app/_not-found/page.js +1 -1
  20. package/web/.next/standalone/packages/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  21. package/web/.next/standalone/packages/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  22. package/web/.next/standalone/packages/web/.next/server/app/bridge/connect/page.js +1 -1
  23. package/web/.next/standalone/packages/web/.next/server/app/bridge/connect/page.js.nft.json +1 -1
  24. package/web/.next/standalone/packages/web/.next/server/app/bridge/connect/page_client-reference-manifest.js +1 -1
  25. package/web/.next/standalone/packages/web/.next/server/app/embed/terminal/[id]/page.js +1 -1
  26. package/web/.next/standalone/packages/web/.next/server/app/embed/terminal/[id]/page.js.nft.json +1 -1
  27. package/web/.next/standalone/packages/web/.next/server/app/embed/terminal/[id]/page_client-reference-manifest.js +1 -1
  28. package/web/.next/standalone/packages/web/.next/server/app/page.js +2 -2
  29. package/web/.next/standalone/packages/web/.next/server/app/page.js.nft.json +1 -1
  30. package/web/.next/standalone/packages/web/.next/server/app/page_client-reference-manifest.js +1 -1
  31. package/web/.next/standalone/packages/web/.next/server/app/sessions/[id]/page.js +2 -2
  32. package/web/.next/standalone/packages/web/.next/server/app/sessions/[id]/page.js.nft.json +1 -1
  33. package/web/.next/standalone/packages/web/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -1
  34. package/web/.next/standalone/packages/web/.next/server/app/settings/bridge/page.js +1 -1
  35. package/web/.next/standalone/packages/web/.next/server/app/settings/bridge/page.js.nft.json +1 -1
  36. package/web/.next/standalone/packages/web/.next/server/app/settings/bridge/page_client-reference-manifest.js +1 -1
  37. package/web/.next/standalone/packages/web/.next/server/app/sign-in/[[...sign-in]]/page.js +2 -2
  38. package/web/.next/standalone/packages/web/.next/server/app/sign-in/[[...sign-in]]/page.js.nft.json +1 -1
  39. package/web/.next/standalone/packages/web/.next/server/app/sign-in/[[...sign-in]]/page_client-reference-manifest.js +1 -1
  40. package/web/.next/standalone/packages/web/.next/server/app/sign-in/hosted/page.js +1 -1
  41. package/web/.next/standalone/packages/web/.next/server/app/sign-in/hosted/page.js.nft.json +1 -1
  42. package/web/.next/standalone/packages/web/.next/server/app/sign-in/hosted/page_client-reference-manifest.js +1 -1
  43. package/web/.next/standalone/packages/web/.next/server/app/sign-in/sso-callback/page.js +1 -1
  44. package/web/.next/standalone/packages/web/.next/server/app/sign-in/sso-callback/page.js.nft.json +1 -1
  45. package/web/.next/standalone/packages/web/.next/server/app/sign-in/sso-callback/page_client-reference-manifest.js +1 -1
  46. package/web/.next/standalone/packages/web/.next/server/app/sign-up/[[...sign-up]]/page.js +2 -2
  47. package/web/.next/standalone/packages/web/.next/server/app/sign-up/[[...sign-up]]/page.js.nft.json +1 -1
  48. package/web/.next/standalone/packages/web/.next/server/app/sign-up/[[...sign-up]]/page_client-reference-manifest.js +1 -1
  49. package/web/.next/standalone/packages/web/.next/server/app/unlock/page.js +1 -1
  50. package/web/.next/standalone/packages/web/.next/server/app/unlock/page.js.nft.json +1 -1
  51. package/web/.next/standalone/packages/web/.next/server/app/unlock/page_client-reference-manifest.js +1 -1
  52. package/web/.next/standalone/packages/web/.next/server/app-paths-manifest.json +8 -8
  53. package/web/.next/standalone/packages/web/.next/server/chunks/1725.js +1 -0
  54. package/web/.next/standalone/packages/web/.next/server/chunks/3303.js +1 -1
  55. package/web/.next/standalone/packages/web/.next/server/chunks/4191.js +1 -1
  56. package/web/.next/standalone/packages/web/.next/server/chunks/5658.js +1 -0
  57. package/web/.next/standalone/packages/web/.next/server/chunks/5734.js +1 -0
  58. package/web/.next/standalone/packages/web/.next/server/chunks/5790.js +2 -0
  59. package/web/.next/standalone/packages/web/.next/server/chunks/6108.js +1 -1
  60. package/web/.next/standalone/packages/web/.next/server/chunks/6472.js +1 -1
  61. package/web/.next/standalone/packages/web/.next/server/chunks/6744.js +1 -0
  62. package/web/.next/standalone/packages/web/.next/server/chunks/7714.js +2 -2
  63. package/web/.next/standalone/packages/web/.next/server/chunks/7801.js +1 -1
  64. package/web/.next/standalone/packages/web/.next/server/chunks/8352.js +1 -1
  65. package/web/.next/standalone/packages/web/.next/server/chunks/9455.js +1 -1
  66. package/web/.next/standalone/packages/web/.next/server/chunks/9516.js +1 -1
  67. package/web/.next/standalone/packages/web/.next/server/chunks/9930.js +4 -4
  68. package/web/.next/standalone/packages/web/.next/server/middleware-build-manifest.js +1 -1
  69. package/web/.next/standalone/packages/web/.next/server/middleware-react-loadable-manifest.js +1 -1
  70. package/web/.next/standalone/packages/web/.next/server/pages/500.html +1 -1
  71. package/web/.next/standalone/packages/web/.next/server/server-reference-manifest.js +1 -1
  72. package/web/.next/standalone/packages/web/.next/server/server-reference-manifest.json +1 -1
  73. package/web/.next/standalone/packages/web/.next/static/chunks/20038.fe65f7c2f63cf380.js +1 -0
  74. package/web/.next/standalone/packages/web/.next/static/chunks/29450-e298fd3b74f528a5.js +1 -0
  75. package/web/.next/standalone/packages/web/.next/static/chunks/{34443.6226599113ecee07.js → 34443.3021c37fce5f1966.js} +1 -1
  76. package/web/.next/standalone/packages/web/.next/static/chunks/35493-405b96c4dd41e057.js +1 -0
  77. package/web/.next/{static/chunks/37785-4c70b81506dde54c.js → standalone/packages/web/.next/static/chunks/37785-1fc09b3ce0839b64.js} +2 -2
  78. package/web/.next/{static/chunks/41696.3e691c667c1e7b81.js → standalone/packages/web/.next/static/chunks/41696.849ce60671c3fc20.js} +1 -1
  79. package/web/.next/standalone/packages/web/.next/static/chunks/47369.a4f0b46515a89877.js +3 -0
  80. package/web/.next/standalone/packages/web/.next/static/chunks/70008.848fd401840c9bce.js +1 -0
  81. package/web/.next/standalone/packages/web/.next/static/chunks/76892-8dd4340687959250.js +1 -0
  82. package/web/.next/standalone/packages/web/.next/static/chunks/81132.46e0113f762baba4.js +3 -0
  83. package/web/.next/standalone/packages/web/.next/static/chunks/86597-1974bd2fdc101983.js +2 -0
  84. package/web/.next/standalone/packages/web/.next/static/chunks/8798.be1c2bcbdf30d3d0.js +1 -0
  85. package/web/.next/standalone/packages/web/.next/static/chunks/88545.638d04d05b4cb291.js +1 -0
  86. package/web/.next/standalone/packages/web/.next/static/chunks/90036.6d4c9823456768d7.js +1 -0
  87. package/web/.next/standalone/packages/web/.next/static/chunks/app/bridge/connect/page-c4fcd887291e892d.js +1 -0
  88. package/web/.next/standalone/packages/web/.next/static/chunks/app/{layout-993567520eb26e1e.js → layout-42a934e328610863.js} +1 -1
  89. package/web/.next/standalone/packages/web/.next/static/chunks/app/page-5cdcce90b0cebb55.js +1 -0
  90. package/web/.next/standalone/packages/web/.next/static/chunks/app/sessions/[id]/{page-340961e7cd9d63cc.js → page-1f3578abecf4fb64.js} +1 -1
  91. package/web/.next/standalone/packages/web/.next/static/chunks/app/sign-in/[[...sign-in]]/page-bfd73815fe1dcf5e.js +9 -0
  92. package/web/.next/standalone/packages/web/.next/static/chunks/app/sign-up/[[...sign-up]]/page-a4f528b6782ed85c.js +9 -0
  93. package/web/.next/standalone/packages/web/.next/static/chunks/app/unlock/page-f95ae641f875a271.js +1 -0
  94. package/web/.next/standalone/packages/web/.next/static/chunks/webpack-3ea5ad7ca9f32ed6.js +1 -0
  95. package/web/.next/standalone/packages/web/.next/static/css/576f84ed441998c8.css +1 -0
  96. package/web/.next/static/chunks/20038.fe65f7c2f63cf380.js +1 -0
  97. package/web/.next/static/chunks/29450-e298fd3b74f528a5.js +1 -0
  98. package/web/.next/static/chunks/{34443.6226599113ecee07.js → 34443.3021c37fce5f1966.js} +1 -1
  99. package/web/.next/static/chunks/35493-405b96c4dd41e057.js +1 -0
  100. package/web/.next/{standalone/packages/web/.next/static/chunks/37785-4c70b81506dde54c.js → static/chunks/37785-1fc09b3ce0839b64.js} +2 -2
  101. package/web/.next/{standalone/packages/web/.next/static/chunks/41696.3e691c667c1e7b81.js → static/chunks/41696.849ce60671c3fc20.js} +1 -1
  102. package/web/.next/static/chunks/47369.a4f0b46515a89877.js +3 -0
  103. package/web/.next/static/chunks/70008.848fd401840c9bce.js +1 -0
  104. package/web/.next/static/chunks/76892-8dd4340687959250.js +1 -0
  105. package/web/.next/static/chunks/81132.46e0113f762baba4.js +3 -0
  106. package/web/.next/static/chunks/86597-1974bd2fdc101983.js +2 -0
  107. package/web/.next/static/chunks/8798.be1c2bcbdf30d3d0.js +1 -0
  108. package/web/.next/static/chunks/88545.638d04d05b4cb291.js +1 -0
  109. package/web/.next/static/chunks/90036.6d4c9823456768d7.js +1 -0
  110. package/web/.next/static/chunks/app/bridge/connect/page-c4fcd887291e892d.js +1 -0
  111. package/web/.next/static/chunks/app/{layout-993567520eb26e1e.js → layout-42a934e328610863.js} +1 -1
  112. package/web/.next/static/chunks/app/page-5cdcce90b0cebb55.js +1 -0
  113. package/web/.next/static/chunks/app/sessions/[id]/{page-340961e7cd9d63cc.js → page-1f3578abecf4fb64.js} +1 -1
  114. package/web/.next/static/chunks/app/sign-in/[[...sign-in]]/page-bfd73815fe1dcf5e.js +9 -0
  115. package/web/.next/static/chunks/app/sign-up/[[...sign-up]]/page-a4f528b6782ed85c.js +9 -0
  116. package/web/.next/static/chunks/app/unlock/page-f95ae641f875a271.js +1 -0
  117. package/web/.next/static/chunks/webpack-3ea5ad7ca9f32ed6.js +1 -0
  118. package/web/.next/static/css/576f84ed441998c8.css +1 -0
  119. package/web/.next/standalone/packages/web/.next/server/chunks/3775.js +0 -1
  120. package/web/.next/standalone/packages/web/.next/server/chunks/694.js +0 -2
  121. package/web/.next/standalone/packages/web/.next/server/chunks/724.js +0 -1
  122. package/web/.next/standalone/packages/web/.next/server/chunks/8603.js +0 -1
  123. package/web/.next/standalone/packages/web/.next/static/chunks/10215.e1adc6807da4cf05.js +0 -1
  124. package/web/.next/standalone/packages/web/.next/static/chunks/20038.0f95f26ad144c136.js +0 -1
  125. package/web/.next/standalone/packages/web/.next/static/chunks/29450-96ee8b2fdf605b68.js +0 -1
  126. package/web/.next/standalone/packages/web/.next/static/chunks/35493-8c8d75766e944f01.js +0 -1
  127. package/web/.next/standalone/packages/web/.next/static/chunks/39816.fa63b43ee1cbe027.js +0 -1
  128. package/web/.next/standalone/packages/web/.next/static/chunks/47369.5011bd3d9e80106a.js +0 -3
  129. package/web/.next/standalone/packages/web/.next/static/chunks/76892-5f15bcc6649e7bd4.js +0 -1
  130. package/web/.next/standalone/packages/web/.next/static/chunks/81132.8a9aaf302240ef27.js +0 -3
  131. package/web/.next/standalone/packages/web/.next/static/chunks/84271-9f5b4aa5a9c11bd9.js +0 -2
  132. package/web/.next/standalone/packages/web/.next/static/chunks/95381.bf3263b4d34504c7.js +0 -1
  133. package/web/.next/standalone/packages/web/.next/static/chunks/app/bridge/connect/page-a21257f88cf5a928.js +0 -1
  134. package/web/.next/standalone/packages/web/.next/static/chunks/app/page-06b5663e85e5e30e.js +0 -1
  135. package/web/.next/standalone/packages/web/.next/static/chunks/app/sign-in/[[...sign-in]]/page-4ad311894518c4e8.js +0 -9
  136. package/web/.next/standalone/packages/web/.next/static/chunks/app/sign-up/[[...sign-up]]/page-a8639099a42a668b.js +0 -9
  137. package/web/.next/standalone/packages/web/.next/static/chunks/app/unlock/page-4f87395d3035a5bf.js +0 -1
  138. package/web/.next/standalone/packages/web/.next/static/chunks/webpack-ce72c10ddc4a34ce.js +0 -1
  139. package/web/.next/standalone/packages/web/.next/static/css/5443e6375caddb6b.css +0 -1
  140. package/web/.next/static/chunks/10215.e1adc6807da4cf05.js +0 -1
  141. package/web/.next/static/chunks/20038.0f95f26ad144c136.js +0 -1
  142. package/web/.next/static/chunks/29450-96ee8b2fdf605b68.js +0 -1
  143. package/web/.next/static/chunks/35493-8c8d75766e944f01.js +0 -1
  144. package/web/.next/static/chunks/39816.fa63b43ee1cbe027.js +0 -1
  145. package/web/.next/static/chunks/47369.5011bd3d9e80106a.js +0 -3
  146. package/web/.next/static/chunks/76892-5f15bcc6649e7bd4.js +0 -1
  147. package/web/.next/static/chunks/81132.8a9aaf302240ef27.js +0 -3
  148. package/web/.next/static/chunks/84271-9f5b4aa5a9c11bd9.js +0 -2
  149. package/web/.next/static/chunks/95381.bf3263b4d34504c7.js +0 -1
  150. package/web/.next/static/chunks/app/bridge/connect/page-a21257f88cf5a928.js +0 -1
  151. package/web/.next/static/chunks/app/page-06b5663e85e5e30e.js +0 -1
  152. package/web/.next/static/chunks/app/sign-in/[[...sign-in]]/page-4ad311894518c4e8.js +0 -9
  153. package/web/.next/static/chunks/app/sign-up/[[...sign-up]]/page-a8639099a42a668b.js +0 -9
  154. package/web/.next/static/chunks/app/unlock/page-4f87395d3035a5bf.js +0 -1
  155. package/web/.next/static/chunks/webpack-ce72c10ddc4a34ce.js +0 -1
  156. package/web/.next/static/css/5443e6375caddb6b.css +0 -1
  157. /package/web/.next/standalone/packages/web/.next/static/{dg_PQxcnntSl1TuuRZaFW → uj1a_PBVefvWUi6yVk4E5}/_buildManifest.js +0 -0
  158. /package/web/.next/standalone/packages/web/.next/static/{dg_PQxcnntSl1TuuRZaFW → uj1a_PBVefvWUi6yVk4E5}/_ssgManifest.js +0 -0
  159. /package/web/.next/static/{dg_PQxcnntSl1TuuRZaFW → uj1a_PBVefvWUi6yVk4E5}/_buildManifest.js +0 -0
  160. /package/web/.next/static/{dg_PQxcnntSl1TuuRZaFW → uj1a_PBVefvWUi6yVk4E5}/_ssgManifest.js +0 -0
@@ -0,0 +1,2 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[86597],{10926:(e,t,r)=>{r.d(t,{Bp:()=>a,C0:()=>i,DW:()=>s,kV:()=>o});let n="bridge:";function i(e){let t=e?.trim();return t&&t.length>0?t:null}function a(e,t){return`${n}${e}:${t}`}function s(e){let t=e?.trim();if(!t||!t.startsWith(n))return null;let r=t.slice(n.length),a=r.indexOf(":");if(a<=0||a>=r.length-1)return null;let s=i(r.slice(0,a)),o=r.slice(a+1).trim();return s&&0!==o.length?{bridgeId:s,sessionId:o}:null}function o(e){let t=e?.trim()??"";return t?s(t)?.sessionId??t:""}},11984:(e,t,r)=>{function n(e){let t=e?.trim().toLowerCase()??"";return!!t&&(t.includes("127.0.0.1:4749")||t.includes("older bridge build")||t.includes("one-time local bridge upgrade"))}function i(e){return`This laptop needs a one-time local bridge upgrade before ${function(e){switch(e){case"repair":return"Repair bridge";case"restart":return"Restart service";case"update":return"Update Conductor"}}(e)} can run from the dashboard.`}function a(e){let t=e?.trim()||"This laptop";return`${t} is still on an older bridge build, so Conductor cannot repair, restart, or update it remotely yet. Upgrade the bridge once on that laptop, then future fixes run from the dashboard.`}r.d(t,{Az:()=>n,IG:()=>i,_5:()=>a})},15115:(e,t,r)=>{function n(e,t){return"string"==typeof e&&e.trim().length>0?e.trim():t}function i(e){let t="string"==typeof e?e.trim():"";return t?` (build ${t})`:""}function a(e){return Array.isArray(e)?e.filter(e=>!!e&&"object"==typeof e).map(e=>{let t,r,i;return t=n(e.hostname,"unknown-host"),r=n(e.os,"unknown-os"),i=n(e.arch,"unknown-arch"),{device_id:n(e.device_id,t),device_name:n(e.device_name,t),hostname:t,os:r,arch:i,connected:!0===e.connected,last_status:e.last_status?{hostname:n(e.last_status.hostname,t),os:n(e.last_status.os,r),connected:!0===e.last_status.connected,version:"string"==typeof e.last_status.version&&e.last_status.version.trim().length>0?e.last_status.version.trim():null}:null}}):[]}r.d(t,{oH:()=>a,wj:()=>i})},15321:(e,t,r)=>{r.d(t,{i:()=>m});var n=r(54568),i=r(7620),a=r(65587),s=r.n(a),o=r(56961),d=r(61201),l=r(2937),c=r(76081),u=r(46916),v=r(11984),p=r(61369);function m({deviceId:e,deviceName:t,deviceOs:r,dashboardUrl:a,installScriptUrl:h,installPowerShellUrl:g,relayUrl:f,className:x}){let[b,w]=(0,i.useState)(!1),k=(0,i.useMemo)(()=>(0,p.Y8)(r),[r]),y="windows"===k?g:h,N=(0,i.useMemo)(()=>(0,p.$y)(y,a,f,k),[a,f,y,k]),_=(0,i.useMemo)(()=>(0,p.kw)(e),[e]);return(0,n.jsxs)("div",{className:(0,u.cn)("mt-3 rounded-[14px] border border-[color:color-mix(in_srgb,var(--vk-orange)_28%,transparent)] bg-[color:color-mix(in_srgb,var(--vk-orange)_10%,transparent)] px-3 py-3",x),children:[(0,n.jsx)("div",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-[var(--vk-text-muted)]",children:"One-time local repair"}),(0,n.jsx)("div",{className:"mt-2 text-[12px] leading-5 text-[var(--vk-text-normal)]",children:(0,v._5)(t)}),(0,n.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2",children:[(0,n.jsxs)(c.$,{type:"button",variant:"outline",size:"sm",onClick:()=>{navigator.clipboard?.writeText?(w(!1),navigator.clipboard.writeText(N).then(()=>{w(!0)}).catch(()=>{w(!1)})):w(!1)},children:[b?(0,n.jsx)(o.A,{className:"h-4 w-4"}):(0,n.jsx)(d.A,{className:"h-4 w-4"}),b?"Repair command copied":"Copy repair command"]}),(0,n.jsx)(c.$,{asChild:!0,variant:"outline",size:"sm",children:(0,n.jsxs)(s(),{href:_,children:[(0,n.jsx)(l.A,{className:"h-4 w-4"}),"Open repair steps"]})})]})]})}},26167:(e,t,r)=>{r.d(t,{E:()=>a,b:()=>i});var n=r(11984);async function i(e){let t=await s(e,"service-restart",{});return t?.message??"Bridge service restart scheduled. This laptop should reconnect once the bridge is back online."}async function a(e,t){let r=await s(e,"repair",{installScriptUrl:t});return r?.message??"Bridge reinstall requested. This laptop should reconnect shortly."}async function s(e,t,r){let i=await fetch(`/api/bridge/devices/${encodeURIComponent(e)}/${t}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r),cache:"no-store"}),a=await i.json().catch(()=>null);if(!i.ok){var s,o;let e;throw Error((s=a?.error??a?.message??null,o=i.status,e=s?.trim()??"",(0,n.Az)(e)?(0,n.IG)("repair"===t?"repair":"restart"):e||`Failed to run ${t} on the bridge service (${o})`))}return a}},31404:(e,t,r)=>{r.d(t,{S:()=>i,y:()=>a});var n=r(10926);function i(e,t){let r=(0,n.C0)(t);if(!r)return e;let i=new URL(e,"http://127.0.0.1");return i.searchParams.set("bridgeId",r),`${i.pathname}${i.search}${i.hash}`}function a(e){let t=function(e){if(!e)return null;if(e instanceof URL)return e;if("string"==typeof e)try{return new URL(e,"http://127.0.0.1")}catch{return null}if("string"==typeof e.href)try{return new URL(e.href)}catch{}return null}(e);if(!t)return null;let r=(0,n.C0)(t.searchParams.get("bridge")??t.searchParams.get("bridgeId"));if(r)return r;let i=(0,n.DW)(t.searchParams.get("session"))?.bridgeId;if(i)return i;let a=t.pathname.match(/^\/sessions\/([^/]+)$/);if(!a)return null;try{return(0,n.DW)(decodeURIComponent(a[1]))?.bridgeId??null}catch{return null}}},44522:(e,t,r)=>{r.d(t,{N8:()=>c,Tr:()=>p,jV:()=>m,m7:()=>v,qv:()=>s,xv:()=>o});var n=r(31404),i=r(11984);let a="conductor-bridge-recent-pairing";function s(e){switch(e){case"checking":return"Checking";case"updating":return"Updating";case"restarting":return"Restarting";case"completed":return"Completed";case"skipped":return"Skipped";case"failed":return"Failed";default:return"Idle"}}function o(e,t){return e.deviceId===t&&("checking"===e.phase||"updating"===e.phase||"restarting"===e.phase)}function d(e,t){return t.jobMessage??`Installing Conductor ${t.latestVersion??"latest"} on ${e.device_name}.`}function l(e){let t=e.currentVersion?.trim();return t?` (build ${t})`:""}function c(e){if(!e.enabled)switch(e.reason){case"source-checkout":return"This laptop is running from a source checkout, so there is no published package to auto-update.";case"missing-cli-metadata":return"This install could not determine its update metadata, so automatic package updates are unavailable.";default:return"Automatic package updates are unavailable for this laptop."}return e.updateAvailable?e.canAutoUpdate?`This laptop is already running the latest Conductor release${l(e)}.`:"npx"===e.installMode?"This laptop was launched via npx, so the next launch will pick up the latest package automatically.":e.updateCommand?`A newer Conductor release is available, but this install still needs a manual update: ${e.updateCommand}`:"A newer Conductor release is available, but this install cannot update itself automatically.":`This laptop is already running the latest Conductor release${l(e)}.`}async function u(e,t){var r,a;let s=t?.method??"GET",o=`/api/bridge/devices/${encodeURIComponent(e)}/app-update`,d=new URL((0,n.S)(o,e),window.location.origin);t?.force&&d.searchParams.set("force","1");let l=await fetch(d.toString(),{method:s,headers:t?.body?{"Content-Type":"application/json"}:void 0,body:t?.body?JSON.stringify(t.body):void 0,cache:"no-store"}),c=await l.json().catch(()=>null);if(!l.ok){let e;throw Error((r=c&&"object"==typeof c&&"error"in c&&"string"==typeof c.error?c.error:null,a=l.status,e=r?.trim()??"",(0,i.Az)(e)?(0,i.IG)("update"):e||`Failed to update Conductor on this laptop (${a})`))}let u=c&&"object"==typeof c?c:null;if(!u)throw Error("Paired device returned an invalid update payload.");return u}function v(e){let t={deviceId:e.deviceId,deviceName:e.deviceName??null,pairedAt:new Date().toISOString()};try{window.localStorage.setItem(a,JSON.stringify(t))}catch{}}function p(){try{let e=window.localStorage.getItem(a);if(!e)return null;let t=JSON.parse(e);if(!(t&&"object"==typeof t&&"string"==typeof t.deviceId&&"string"==typeof t.pairedAt&&(null===t.deviceName||"string"==typeof t.deviceName)))return window.localStorage.removeItem(a),null;let r=Date.parse(t.pairedAt);if(!Number.isFinite(r)||Date.now()-r>18e5)return window.localStorage.removeItem(a),null;return t}catch{return null}}async function m(e,t){let r=(r,n)=>{t({deviceId:e.device_id,phase:r,message:n})};r("checking",`Checking for Conductor updates on ${e.device_name}.`);try{let t=await u(e.device_id,{force:!0});if(t.restarting)return void r("restarting",t.jobMessage??`Restart scheduled on ${e.device_name}. This page will reconnect once the bridge runtime is back online.`);if("running"===t.jobStatus)r("updating",d(e,t));else{if(!t.updateAvailable||!t.enabled||!t.canAutoUpdate)return void r(t.enabled&&t.canAutoUpdate?"completed":"skipped",c(t));t=await u(e.device_id,{method:"POST"}),r("updating",d(e,t))}let n=Date.now()+3e5;for(;Date.now()<n&&"running"===t.jobStatus;){if(await new Promise(e=>{window.setTimeout(e,1500)}),(t=await u(e.device_id)).restarting)return void r("restarting",t.jobMessage??`Restart scheduled on ${e.device_name}. This page will reconnect once the bridge runtime is back online.`);r("updating",d(e,t))}if("running"===t.jobStatus)return void r("updating",`The package update is still running on ${e.device_name}. Leave this page open and Conductor will finish applying it in the background.`);if("failed"===t.jobStatus)throw Error(t.jobMessage??t.error??`Automatic package update failed on ${e.device_name}.`);if(t.restartRequired){if(t.canRestart){t=await u(e.device_id,{method:"POST",body:{action:"restart"}}),r("restarting",t.jobMessage??`Restart scheduled on ${e.device_name} to finish updating Conductor.`);return}r("completed",t.jobMessage??`The latest Conductor package is installed on ${e.device_name}. Restart that laptop to finish updating.`);return}r("completed",t.jobMessage??`${e.device_name} is now updated to Conductor ${t.latestVersion??"latest"}.`)}catch(t){r("failed",t instanceof Error?t.message:`Failed to auto-update ${e.device_name}.`)}}},46916:(e,t,r)=>{r.d(t,{cn:()=>a});var n=r(9917),i=r(2809);function a(...e){return(0,i.QP)((0,n.$)(e))}},54717:(e,t,r)=>{r.d(t,{x:()=>a});var n=r(7620),i=r(66423);function a({children:e,lockDocumentScrolling:t=!1}){return(0,n.useEffect)(()=>{let e=document.documentElement,r=window.visualViewport,n=()=>Math.max(0,window.innerWidth,e.clientWidth),a=n(),s=(0,i.lZ)(0,window.innerHeight,e.clientHeight,r?.height??NaN,r?.offsetTop??NaN),o=()=>{let t=window.visualViewport,r=n();(0,i.hU)(a,r)&&(s=0),a=r,s=(0,i.lZ)(s,window.innerHeight,e.clientHeight,t?.height??NaN,t?.offsetTop??NaN);let o=(0,i.mn)(s,t?.height??NaN,t?.offsetTop??NaN);e.style.setProperty(i.tc,`${o.bottom}px`),e.style.setProperty(i.e,`${o.visibleHeight}px`),e.style.setProperty(i.Kc,`${o.offsetTop}px`)};t&&e.classList.add(i.w4),o();let d=window.visualViewport;return d?.addEventListener("resize",o),d?.addEventListener("scroll",o),window.addEventListener("resize",o),()=>{d?.removeEventListener("resize",o),d?.removeEventListener("scroll",o),window.removeEventListener("resize",o),t&&e.classList.remove(i.w4),e.style.removeProperty(i.tc),e.style.removeProperty(i.e),e.style.removeProperty(i.Kc)}},[t]),e}},61369:(e,t,r)=>{function n(e){return/^[A-Za-z0-9_./:=@%+-]+$/.test(e)?e:`'${e.replace(/'/g,"'\"'\"'")}'`}function i(e){return e.map(n).join(" ")}function a(e){return`'${e.replace(/'/g,"''")}'`}function s(e){return/^[A-Za-z0-9_./:=@%+\\-]+$/.test(e)?e:a(e)}function o(e,t="unix"){return"windows"===t?["& (Join-Path $HOME '.conductor\\bin\\conductor-bridge.exe')",...e.map(s)].join(" "):i(["conductor-bridge",...e])}function d(e){return(e?.trim().toLowerCase()??"").startsWith("windows")?"windows":"unix"}function l(e,t="unix"){return new URL("windows"===t?"/bridge/install.ps1":"/bridge/install.sh",e).toString()}function c(e){return`/bridge/connect?device=${encodeURIComponent(e)}#bridge-setup`}function u(e,t="unix"){return"windows"===t?`& ([scriptblock]::Create((Invoke-RestMethod -Uri ${a(e)})))`:`curl -fsSL ${n(e)} | sh`}function v(e,t,r,s="unix"){if("windows"===s){let n=[`& ([scriptblock]::Create((Invoke-RestMethod -Uri ${a(e)})))`,"-Connect","-DashboardUrl",a(t)];return r?.trim()&&n.push("-RelayUrl",a(r.trim())),n.join(" ")}let o=["sh","-s","--","--connect","--dashboard-url",t];return r?.trim()&&o.push("--relay-url",r.trim()),`curl -fsSL ${n(e)} | ${i(o)}`}function p(e,t,r="unix"){let n=["connect","--dashboard-url",e];return t?.trim()&&n.push("--relay-url",t.trim()),o(n,r)}function m(e,t,r="unix"){let n=["pair","--code",e?.trim()||"ABC123"],i=["daemon"];return t?.trim()&&(n.push("--relay-url",t.trim()),i.push("--relay-url",t.trim())),`${o(n,r)}
2
+ ${o(i,r)}`}r.d(t,{$y:()=>v,G7:()=>u,Y8:()=>d,hI:()=>p,kw:()=>c,pj:()=>l,zd:()=>m})},63582:(e,t,r)=>{r.d(t,{J:()=>S});var n=r(54568),i=r(7620),a=r(45492),s=r(65587),o=r.n(s),d=r(79748),l=r(3368),c=r(37812),u=r(38874),v=r(2937),p=r(54314),m=r(94110),h=r(25010),g=r(15321),f=r(76929),x=r(44522),b=r(11984),w=r(46916),k=r(26167),y=r(83770),N=r(61369),_=r(15115),j=r(67506);let C="/bridge/connect";function $({label:e,tone:t,className:r,title:i,suffix:a}){let s="online"===t?{pill:"border-[rgba(24,197,143,0.35)] bg-[rgba(24,197,143,0.12)] text-[var(--vk-green)]",dot:"bg-[var(--vk-green)]"}:"neutral"===t?{pill:"border-[var(--vk-border)] bg-[rgba(255,255,255,0.04)] text-[var(--vk-text-muted)]",dot:"bg-[var(--vk-text-muted)]"}:{pill:"border-[rgba(255,143,122,0.24)] bg-[rgba(255,143,122,0.08)] text-[var(--vk-red)]",dot:"bg-[var(--vk-red)]"};return(0,n.jsxs)("span",{className:(0,w.cn)("inline-flex items-center gap-2 rounded-full border px-2.5 py-1 text-[12px] font-medium",s.pill,r),title:i,children:[(0,n.jsx)("span",{className:(0,w.cn)("h-2.5 w-2.5 rounded-full",s.dot)}),(0,n.jsx)("span",{children:e}),a]})}function M({className:e}){let t=(0,d.useRouter)(),r=(0,d.usePathname)(),s=(0,d.useSearchParams)(),[S,I]=(0,i.useState)([]),[R,E]=(0,i.useState)(!0),[L,F]=(0,i.useState)(null),[T,A]=(0,i.useState)(null),[U,P]=(0,i.useState)({deviceId:null,phase:"idle",message:null}),[D,O]=(0,i.useState)({deviceId:null,kind:null,status:"idle",message:null}),[z,H]=(0,i.useState)(null),W=(0,i.useRef)(new Set),B=(0,j.y)(),q=!!B&&null===z,G=(0,i.useCallback)(async e=>{if(!q){e&&E(!1),I([]),F(null);return}e&&E(!0);try{let e=await fetch("/api/bridge/devices",{cache:"no-store"}),t=await e.json().catch(()=>null);if(!e.ok){if((0,y.Xt)(t?.error)){H(t?.error??null),I([]),F(null);return}throw Error(t?.error??`Failed to load bridge devices (${e.status})`)}I((0,_.oH)(t?.devices)),H(null),F(null)}catch(e){F(e instanceof Error?e.message:"Failed to load bridge devices.")}finally{E(!1)}},[q]);(0,i.useEffect)(()=>{if(!q){E(!1),I([]),F(null);return}let e=!1,t=null,r=async t=>{e||await G(t)};return r(!0),t=window.setInterval(()=>{r(!1)},15e3),()=>{e=!0,null!==t&&window.clearInterval(t)}},[q,G]),(0,i.useEffect)(()=>{let e=()=>{A((0,x.Tr)()?.deviceId??null)};return e(),window.addEventListener("focus",e),window.addEventListener("storage",e),()=>{window.removeEventListener("focus",e),window.removeEventListener("storage",e)}},[]),(0,i.useEffect)(()=>{r!==C&&t.prefetch(C)},[r,t]);let V=S.filter(e=>e.connected),J=s.get("bridge")?.trim()||null,Y=window.location.origin,Z=J?S.find(e=>e.device_id===J)??null:null,X=q&&!R&&0===V.length,K=T?S.find(e=>e.device_id===T)??null:null,Q=X?Z?.device_id?(0,N.kw)(Z.device_id):K?.device_id?(0,N.kw)(K.device_id):S[0]?.device_id?(0,N.kw)(S[0].device_id):C:C,ee=V.length>0,et={relayConfigured:q,connectedDevices:V.length,totalDevices:S.length,loading:R},er=et.connectedDevices>0?"Online":et.relayConfigured?et.loading?"Checking":0===et.totalDevices?"No bridge":"Bridge offline":"Local backend",en=et.connectedDevices>0?"online":!et.relayConfigured||0===et.totalDevices||et.loading?"neutral":"offline",ei=q?L??(ee?`${V.length} bridge${1===V.length?"":"s"} online`:S.length>0?"No paired bridges are online":"No paired bridges yet"):"Local backend is running. Paired-device bridge relay is not configured.";(0,i.useEffect)(()=>{let e=(K?.connected?K:null)??(Z?.connected?Z:null);!e||W.current.has(e.device_id)||(W.current.add(e.device_id),(0,x.jV)(e,P))},[K,Z]),(0,i.useEffect)(()=>{!K||K.connected||U.message||P({deviceId:K.device_id,phase:"checking",message:`Waiting for ${K.device_name} to reconnect so Conductor can finish its package update.`})},[U.message,K]);let ea=(0,i.useCallback)(async e=>{O({deviceId:e.device_id,kind:"restart",status:"running",message:`Restarting the bridge service on ${e.device_name}.`});try{let t=await (0,k.b)(e.device_id);O({deviceId:e.device_id,kind:"restart",status:"completed",message:`${t} Waiting for ${e.device_name} to reconnect.`}),[2e3,5e3,1e4,2e4,35e3].forEach(e=>{window.setTimeout(()=>{G(!1)},e)})}catch(t){O({deviceId:e.device_id,kind:"restart",status:"failed",message:t instanceof Error?t.message:`Failed to restart ${e.device_name}.`})}},[G]),es=(0,i.useCallback)(async e=>{O({deviceId:e.device_id,kind:"repair",status:"running",message:`Reinstalling the bridge service on ${e.device_name}.`});try{let t=(0,N.pj)(window.location.origin,(0,N.Y8)(e.os)),r=await (0,k.E)(e.device_id,t);O({deviceId:e.device_id,kind:"repair",status:"completed",message:r}),window.setTimeout(()=>{G(!1)},2e3)}catch(t){O({deviceId:e.device_id,kind:"repair",status:"failed",message:t instanceof Error?t.message:`Failed to repair ${e.device_name}.`})}},[G]),eo=(0,i.useCallback)(async e=>{await (0,x.jV)(e,P),window.setTimeout(()=>{G(!1)},2e3)},[G]);return X?(0,n.jsx)(o(),{href:Q,prefetch:!0,className:"inline-flex",title:S.length>0?"Reconnect paired device":"Pair a device",children:(0,n.jsx)($,{label:er,tone:en,className:e,title:S.length>0?"Reconnect paired device":"Pair a device",suffix:(0,n.jsx)(l.A,{className:"h-3.5 w-3.5"})})}):(0,n.jsxs)(a.bL,{children:[(0,n.jsx)(a.l9,{asChild:!0,children:(0,n.jsx)("button",{type:"button",className:"outline-none",children:(0,n.jsx)($,{label:er,tone:en,className:e,title:ei,suffix:(0,n.jsx)(c.A,{className:"h-3.5 w-3.5 text-current/70"})})})}),(0,n.jsxs)(f.ww,{align:"end",className:"w-[min(320px,calc(100vw-1rem))] rounded-[18px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] p-2 text-[var(--vk-text-normal)] shadow-[0_22px_48px_rgba(0,0,0,0.34)]",children:[(0,n.jsxs)("div",{className:"rounded-[14px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-3 py-3",children:[(0,n.jsx)("div",{className:"text-[11px] font-semibold uppercase tracking-[0.22em] text-[var(--vk-text-muted)]",children:"Conductor Bridge"}),(0,n.jsx)("div",{className:"mt-2 text-[13px] text-[var(--vk-text-normal)]",children:ee?`${V.length} device${1===V.length?"":"s"} online`:q?R?"Loading device status":"No live bridge connection":"Local backend is healthy. Paired-device relay is not configured."}),(0,n.jsx)("div",{className:"mt-2 text-[11px] leading-5 text-[var(--vk-text-faint)]",children:"If a laptop is online but misbehaving, repair the bridge, update Conductor, or restart the service here."}),L?(0,n.jsx)("div",{className:"mt-2 text-[12px] leading-5 text-[var(--vk-red)]",children:L}):null,U.message?(0,n.jsxs)("div",{className:(0,w.cn)("mt-2 flex flex-wrap items-center gap-2 text-[12px] leading-5","failed"===U.phase?"text-[var(--vk-red)]":"skipped"===U.phase?"text-[var(--vk-text-muted)]":"text-[var(--vk-text-faint)]"),children:[(0,n.jsx)("span",{className:"inline-flex items-center rounded-full border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 py-0.5 text-[10px] font-semibold uppercase tracking-[0.16em] text-[var(--vk-text-muted)]",children:(0,x.qv)(U.phase)}),(0,n.jsx)("span",{children:U.message})]}):null]}),(0,n.jsx)("div",{className:"mt-2",children:S.length>0?S.map(e=>{let t=(0,x.xv)(U,e.device_id),r="running"===D.status&&D.deviceId===e.device_id,i=r&&"repair"===D.kind,a=r&&"restart"===D.kind,s=D.deviceId===e.device_id&&(0,b.Az)(D.message)||U.deviceId===e.device_id&&(0,b.Az)(U.message);return(0,n.jsx)("div",{className:"rounded-[14px] px-3 py-2.5 transition-colors hover:bg-[var(--vk-bg-hover)]",children:(0,n.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("div",{className:"truncate text-[13px] font-medium text-[var(--vk-text-strong)]",children:e.device_name}),(0,n.jsxs)("div",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:[e.hostname," \xb7 ",e.os,"/",e.arch,(0,_.wj)(e.last_status?.version)]}),(0,n.jsxs)("div",{className:"mt-1 text-[11px] text-[var(--vk-text-muted)]",children:["Relay: ",e.last_status?.hostname??e.hostname,(0,_.wj)(e.last_status?.version)]}),U.message&&U.deviceId===e.device_id?(0,n.jsxs)("div",{className:(0,w.cn)("mt-1 flex flex-wrap items-center gap-2 text-[11px] leading-5","failed"===U.phase?"text-[var(--vk-red)]":"skipped"===U.phase?"text-[var(--vk-text-muted)]":"text-[var(--vk-text-faint)]"),children:[(0,n.jsx)("span",{className:"inline-flex items-center rounded-full border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 py-0.5 text-[10px] font-semibold uppercase tracking-[0.16em] text-[var(--vk-text-muted)]",children:(0,x.qv)(U.phase)}),(0,n.jsx)("span",{children:U.message})]}):null,D.message&&D.deviceId===e.device_id?(0,n.jsx)("div",{className:(0,w.cn)("mt-1 text-[11px] leading-5","failed"===D.status?"text-[var(--vk-red)]":"completed"===D.status?"text-[var(--vk-green)]":"text-[var(--vk-text-faint)]"),children:D.message}):null,s&&Y?(0,n.jsx)(g.i,{deviceId:e.device_id,deviceName:e.device_name,deviceOs:e.os,dashboardUrl:Y,installScriptUrl:(0,N.pj)(Y),installPowerShellUrl:(0,N.pj)(Y,"windows"),relayUrl:B}):null,e.connected?(0,n.jsxs)("div",{className:"mt-2 flex flex-wrap gap-2",children:[(0,n.jsxs)("button",{type:"button",className:"inline-flex items-center gap-1.5 rounded-[10px] border border-[var(--vk-border)] px-2.5 py-1 text-[11px] font-medium text-[var(--vk-text-normal)] transition-colors hover:bg-[var(--vk-bg-hover)]",disabled:r||t,onClick:()=>{es(e)},children:[i?(0,n.jsx)(u.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,n.jsx)(v.A,{className:"h-3.5 w-3.5"}),"Repair bridge"]}),(0,n.jsxs)("button",{type:"button",className:"inline-flex items-center gap-1.5 rounded-[10px] border border-[var(--vk-border)] px-2.5 py-1 text-[11px] font-medium text-[var(--vk-text-normal)] transition-colors hover:bg-[var(--vk-bg-hover)]",disabled:t||r,onClick:()=>{eo(e)},children:[t?(0,n.jsx)(u.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,n.jsx)(p.A,{className:"h-3.5 w-3.5"}),t?"Updating...":"Update Conductor"]}),(0,n.jsxs)("button",{type:"button",className:"inline-flex items-center gap-1.5 rounded-[10px] border border-[var(--vk-border)] px-2.5 py-1 text-[11px] font-medium text-[var(--vk-text-normal)] transition-colors hover:bg-[var(--vk-bg-hover)]",disabled:r||t,onClick:()=>{ea(e)},children:[a?(0,n.jsx)(u.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,n.jsx)(m.A,{className:"h-3.5 w-3.5"}),"Restart service"]})]}):null]}),(0,n.jsx)($,{label:!0===e.connected?"Online":"Offline",tone:!0===e.connected?"online":"offline"})]})},e.device_id)}):(0,n.jsx)("div",{className:"rounded-[14px] border border-dashed border-[var(--vk-border)] px-3 py-4 text-[12px] text-[var(--vk-text-muted)]",children:R?"Loading paired devices...":"Pair a laptop to see bridge status here."})}),(0,n.jsx)(a.wv,{className:"my-2 h-px bg-[var(--vk-border)]"}),(0,n.jsx)(a.q7,{asChild:!0,children:(0,n.jsxs)(o(),{href:C,prefetch:!0,className:"flex items-center justify-between rounded-[12px] px-3 py-2 text-[13px] font-medium text-[var(--vk-text-normal)] outline-none transition-colors hover:bg-[var(--vk-bg-hover)] focus:bg-[var(--vk-bg-hover)]",children:[(0,n.jsx)("span",{children:"Open paired devices"}),(0,n.jsx)(h.A,{className:"h-4 w-4 text-[var(--vk-text-muted)]"})]})})]})]})}function S({connected:e,className:t,title:r}={}){return"boolean"==typeof e?(0,n.jsx)($,{label:e?"Online":"Offline",tone:e?"online":"offline",className:t,title:r}):(0,n.jsx)(M,{className:t})}},66423:(e,t,r)=>{r.d(t,{Aw:()=>p,Bx:()=>l,Cf:()=>u,Kc:()=>a,Rn:()=>d,e:()=>i,hU:()=>h,lZ:()=>m,mn:()=>g,tE:()=>o,tc:()=>n,w1:()=>v,w4:()=>s,yq:()=>c});let n="--oc-safe-viewport-height",i="--oc-visual-viewport-height",a="--oc-visual-viewport-offset-top",s="conductor-app-shell-active",o="var(--oc-safe-viewport-height,100dvh)",d="inset-x-0 top-[var(--oc-visual-viewport-offset-top,0px)] h-[var(--oc-visual-viewport-height,100dvh)]",l="max-h-[var(--oc-safe-viewport-height,100dvh)]",c="h-[var(--oc-visual-viewport-height,100dvh)]",u="max-h-[calc(var(--oc-visual-viewport-height,100dvh)-1.5rem)]",v="sm:max-h-[calc(var(--oc-visual-viewport-height,100dvh)-3rem)]",p="top-[calc(var(--oc-visual-viewport-offset-top,0px)+10dvh)] h-[calc(var(--oc-visual-viewport-height,100dvh)-10dvh)]";function m(e,t,r,n,i){let a=Math.max(0,...[t,r].map(e=>Number.isFinite(e)?Math.max(0,e):0));if(!(Number.isFinite(n)&&n>0))return Math.round(a);let s=Number.isFinite(i)?Math.max(0,i):0;return 0===s?Math.round(a):Math.round(Math.max(0,...[e,a,n+s].map(e=>Number.isFinite(e)?Math.max(0,e):0)))}function h(e,t){return!!Number.isFinite(e)&&!!Number.isFinite(t)&&!(e<=0)&&!(t<=0)&&Math.round(e)!==Math.round(t)}function g(e,t,r){let n=Number.isFinite(e)&&e>0,i=n?Math.max(0,e):0,a=Number.isFinite(t)&&t>0,s=a?Math.max(0,t):i,o=a&&Number.isFinite(r)?Math.max(0,r):0,d=n?Math.min(i,o+s):o+s,l=Math.min(o,d);return{visibleHeight:Math.round(Math.max(0,d-l)),offsetTop:Math.round(l),bottom:Math.round(d)}}},67506:(e,t,r)=>{r.d(t,{y:()=>i});var n=r(63680);function i(){let e=function(e){let t=e?.trim();if(!t)return null;try{let e=new URL(t);if("http:"!==e.protocol&&"https:"!==e.protocol)return null;return e.toString()}catch{return null}}(n.env.CONDUCTOR_BRIDGE_RELAY_URL??n.env.NEXT_PUBLIC_CONDUCTOR_BRIDGE_RELAY_URL);return e||null}},76081:(e,t,r)=>{r.d(t,{$:()=>l});var n=r(54568),i=r(46916),a=r(78347),s=r(7620);let o={default:"border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",primary:"border-[var(--vk-border)] bg-[var(--vk-bg-active)] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",ghost:"border-transparent bg-transparent text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)] hover:text-[var(--vk-text-normal)]",danger:"border-[var(--vk-red)]/40 bg-[color:color-mix(in_srgb,var(--vk-red)_18%,transparent)] text-[var(--vk-red)] hover:bg-[color:color-mix(in_srgb,var(--vk-red)_24%,transparent)]",outline:"border-[var(--vk-border)] bg-transparent text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]"},d={sm:"h-7 px-2.5 text-[12px] gap-1",md:"h-8 px-3 text-[13px] gap-1.5",lg:"h-9 px-3.5 text-[14px] gap-2",icon:"h-8 w-8 p-0"},l=(0,s.forwardRef)(({variant:e="default",size:t="md",asChild:r,className:s,children:l,...c},u)=>{let v=r?a.DX:"button";return(0,n.jsx)(v,{ref:u,className:(0,i.cn)("oc-mobile-touch-target inline-flex items-center justify-center rounded-[var(--radius-sm)] border font-medium","transition-colors duration-150","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--vk-orange)]","disabled:pointer-events-none disabled:opacity-45",o[e],d[t],s),...c,children:l})});l.displayName="Button"},76929:(e,t,r)=>{r.d(t,{ww:()=>o});var n=r(54568),i=r(45492),a=r(7620),s=r(46916);let o=(0,a.forwardRef)(function({children:e,className:t,collisionPadding:r=16,sideOffset:a=8,hideWhenDetached:o=!0,style:d,...l},c){let u={...d,maxHeight:"min(var(--radix-dropdown-menu-content-available-height), max(0px, calc(var(--oc-visual-viewport-height, 100dvh) - max(1rem, env(safe-area-inset-top)) - max(1rem, env(safe-area-inset-bottom)))))",maxWidth:"min(var(--radix-dropdown-menu-content-available-width), max(0px, calc(100vw - max(0.5rem, env(safe-area-inset-left)) - max(0.5rem, env(safe-area-inset-right)))))"};return(0,n.jsx)(i.ZL,{children:(0,n.jsx)(i.UC,{ref:c,collisionPadding:r,sideOffset:a,hideWhenDetached:o,className:(0,s.cn)(t,"oc-mobile-menu-content z-[160] overflow-y-auto overscroll-contain touch-pan-y [-webkit-overflow-scrolling:touch] outline-none"),style:u,...l,children:e})})});o.displayName="MobileDropdownMenuContent"},77522:(e,t,r)=>{r.d(t,{C:()=>n,n:()=>i});let n=new Set(["archived","done","killed","errored","terminated","merged","cleanup"]);function i(e){return"merged"===e.status||"archived"===e.status||"killed"===e.status||"errored"===e.status||"cleanup"===e.status||"done"===e.status||"terminated"===e.status||e.pr&&("merged"===e.pr.state||"closed"===e.pr.state)?"done":"mergeable"===e.status||"approved"===e.status||e.pr?.mergeability.mergeable?"merge":"waiting_input"===e.activity||"blocked"===e.activity||"needs_input"===e.status||"stuck"===e.status?"respond":"queued"===e.status?"pending":"exited"===e.activity?"respond":"ci_failed"===e.status||"changes_requested"===e.status||e.pr&&("failing"===e.pr.ciStatus||"changes_requested"===e.pr.reviewDecision||!e.pr.mergeability.noConflicts)?"review":"review_pending"===e.status||e.pr&&!e.pr.isDraft&&("pending"===e.pr.reviewDecision||"none"===e.pr.reviewDecision)?"pending":"working"}},83770:(e,t,r)=>{r.d(t,{Xt:()=>n});function n(e){let t=e?.trim();return"Bridge relay URL is not configured"===t||"RELAY_JWT_SECRET is required for bridge relay access"===t||"RELAY_JWT_SECRET must contain at least 32 bytes"===t}},86181:(e,t,r)=>{r.d(t,{Jn:()=>i,k$:()=>a,wP:()=>s});let n='MesloLGM Nerd Font, MesloLGM NF, MesloLGS NF, MesloLGS Nerd Font, Hack Nerd Font, FiraCode Nerd Font, JetBrainsMono Nerd Font, CaskaydiaCove Nerd Font, Menlo, Monaco, "Courier New", SF Mono, SF Pro, monospace';function i(e){var t;return(t="number"==typeof e&&Number.isFinite(e)&&e>0?e:1280)<420?{fontFamily:"'SF Mono', Menlo, Monaco, monospace",fontSize:10,lineHeight:1.1}:t<560?{fontFamily:"'SF Mono', Menlo, Monaco, monospace",fontSize:11,lineHeight:1.15}:t<768?{fontFamily:"'SF Mono', Menlo, Monaco, monospace",fontSize:12,lineHeight:1.2}:t<1024?{fontFamily:n,fontSize:13,lineHeight:1.2}:{fontFamily:n,fontSize:14,lineHeight:1.2}}function a(){var e;return"function"==typeof window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,"u"<typeof navigator||navigator.maxTouchPoints,e=window.innerWidth,window.innerHeight,e<1024}function s(e,t,r,n){let i=Number.isFinite(e)?Math.max(0,e):0,a=Number.isFinite(t)?Math.max(0,t):i,s=Number.isFinite(r)?Math.max(0,r):0,o=Number.isFinite(n)?Math.max(0,n):0,d=Math.max(0,i-(a+s));return{usableHeight:Math.round(Math.max(0,a-Math.max(0,o-s))),keyboardInset:Math.round(d),keyboardVisible:d>=80}}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8798],{8798:(e,t,r)=>{r.r(t),r.d(t,{NewWorkspaceDialog:()=>em,SettingsDialog:()=>eb});var a=r(54568),s=r(34703),n=r(97764),l=r(77233),o=r(816),i=r(69363),d=r(76196),c=r(7620),x=r(52353),p=r(20487),v=r(3376),m=r(58212),u=r(38724),h=r(19755),b=r(83328),g=r(15255),k=r(43508),f=r(46277),j=r(28017),N=r(77024),y=r(13932),w=r(1173),C=r(38874),S=r(76839),A=r(37812),R=r(88742),H=r(61201),E=r(5029),$=r(11023),P=r(5739),U=r(33866),D=r(72410),B=r(31404),L=r(85626),F=r(53989);r(51164);var M=r(66423),_=r(83342),O=r(84661);function T(e){switch(e){case"clerk":return"Clerk";case"cloudflare-access":return"Cloudflare Access";case"trusted-header":return"Verified Header";case"local":return"Local";default:return"Unknown"}}function I(e){return e?e.split("-").map(e=>e[0]?.toUpperCase()+e.slice(1)).join(" "):"No access"}function q({label:e,value:t,href:r}){return(0,a.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:e}),r?(0,a.jsx)("a",{href:r,target:"_blank",rel:"noreferrer",className:"mt-2 block break-all text-[14px] text-[var(--vk-orange)] hover:underline",children:t}):(0,a.jsx)("p",{className:"mt-2 break-all text-[14px] text-[var(--vk-text-normal)]",children:t})]})}function G({profile:e}){let t=(e?.displayName??e?.email??"User").split(/[\s@._-]+/g).filter(Boolean).slice(0,2).map(e=>e[0]?.toUpperCase()??"").join("").slice(0,2);return e?.avatarUrl?(0,a.jsx)("img",{src:e.avatarUrl,alt:e.displayName??e.email??"Profile avatar",className:"h-20 w-20 rounded-full border border-[var(--vk-border)] object-cover shadow-[0_10px_30px_rgba(0,0,0,0.28)]"}):(0,a.jsx)("div",{className:"flex h-20 w-20 items-center justify-center rounded-full border border-[var(--vk-border)] bg-[color:color-mix(in_srgb,var(--vk-accent)_14%,transparent)] text-[26px] font-semibold text-[var(--vk-accent)]",children:t||"U"})}function z({profile:e,loading:t,error:r,onRefresh:s}){if(t)return(0,a.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,a.jsx)(C.A,{className:"h-4 w-4 animate-spin"}),"Loading profile details..."]});if(r&&!e)return(0,a.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Profile Unavailable"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Conductor could not load the active user profile for this session."})]}),(0,a.jsxs)("button",{type:"button",onClick:s,className:"inline-flex h-9 items-center gap-2 rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[(0,a.jsx)(S.A,{className:"h-3.5 w-3.5"}),"Retry"]})]});let l=e?.displayName??"Unknown user",o=e?.email??"Not available",i=e?.githubUsername?`@${e.githubUsername}`:"Not linked";return(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsx)("section",{className:"rounded-[6px] border border-[var(--vk-border)] px-5 py-5",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)(G,{profile:e}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h4",{className:"truncate text-[24px] leading-[26px] text-[var(--vk-text-strong)]",children:l}),(0,a.jsx)("p",{className:"mt-1 truncate text-[14px] text-[var(--vk-text-muted)]",children:o}),(0,a.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2 text-[11px]",children:[(0,a.jsx)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1 text-[var(--vk-text-normal)]",children:I(e?.role??null)}),(0,a.jsx)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1 text-[var(--vk-text-normal)]",children:T(e?.provider??null)}),(0,a.jsx)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1 text-[var(--vk-text-normal)]",children:e?"local"===e.provider?"Local admin session":e.authenticated?"Authenticated":"Anonymous":"Unknown"})]})]})]}),(0,a.jsxs)("button",{type:"button",onClick:s,className:"inline-flex h-9 items-center gap-2 self-start rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[(0,a.jsx)(S.A,{className:"h-3.5 w-3.5"}),"Refresh"]})]})}),(0,a.jsxs)("section",{className:"grid gap-3 lg:grid-cols-2",children:[(0,a.jsx)(q,{label:"Display Name",value:l}),(0,a.jsx)(q,{label:"Email",value:o}),(0,a.jsx)(q,{label:"GitHub Username",value:i,href:e?.githubProfileUrl??null}),(0,a.jsx)(q,{label:"Username",value:e?.username??"Not available"}),(0,a.jsx)(q,{label:"Auth Provider",value:T(e?.provider??null)}),(0,a.jsx)(q,{label:"Access Role",value:I(e?.role??null)})]}),(0,a.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h5",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Session Actions"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Review how this browser session is authenticated and sign out when Conductor owns the session lifecycle."})]}),e?.canLogout&&"clerk"===e.logoutMode?(0,a.jsx)(_.ct,{redirectUrl:"/sign-in",children:(0,a.jsxs)("button",{type:"button",className:"inline-flex h-9 items-center gap-2 rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)]",children:[(0,a.jsx)(O.A,{className:"h-3.5 w-3.5"}),"Log Out"]})}):(0,a.jsx)("div",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[rgba(80,80,80,0.18)] px-3 py-3 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:e?.provider==="local"?"This is a local recovery session on the current machine, so there is nothing to sign out of.":`This session is managed by ${T(e?.provider??null)}. Sign out from that provider if you need to end access.`}),e?.githubProfileUrl&&(0,a.jsxs)("a",{href:e.githubProfileUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-2 text-[13px] text-[var(--vk-orange)] hover:underline",children:[(0,a.jsx)(n.u,{size:14}),"Open GitHub Profile"]})]})]})}var W=r(88272),Z=r(33897);let V="claude-code";function J(e){let t=(0,U.h7)(e);return t?.label?t.label:e.split(/[-_\s]+/g).filter(Boolean).map(e=>e[0]?.toUpperCase()+e.slice(1)).join(" ")}function Y(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64)}function X(e){let t=e.trim();return t?t.split(/[\\/]+/).filter(Boolean).at(-1)??null:null}function K(e){let t=e.trim();if(!t)return null;let r=t.match(/^git@[^:]+:([^/]+)\/([^/\s]+?)(?:\.git)?$/i);if(r)return r[2]??null;try{let e=new URL(t).pathname.split("/").filter(Boolean).at(-1);return e?e.replace(/\.git$/i,""):null}catch{return null}}function Q(e,t,r){let a=t?.trim();if(a)return a;let s=K(e);if(s)return s;let n=r?.trim();return n||"workspace"}function ee(e){if(!e)return null;let t=Date.parse(e);return Number.isNaN(t)?null:`Updated ${new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",timeZone:"UTC"}).format(new Date(t))}`}let et=[{id:"profile",label:"Profile",icon:v.A,implemented:!0},{id:"general",label:"General",icon:m.A,implemented:!0},{id:"repositories",label:"Repositories",icon:u.A,implemented:!0},{id:"organization",label:"Organization Settings",icon:h.A,implemented:!0},{id:"projects",label:"Projects",icon:b.A,implemented:!1},{id:"agents",label:"Agents",icon:g.A,implemented:!0},{id:"mcp",label:"MCP Servers",icon:k.A,implemented:!1},{id:"preferences",label:"Preferences",icon:f.A,implemented:!1}],er=[{id:"preferences",label:"Preferences",icon:f.A,implemented:!0},{id:"repositories",label:"Repository",icon:u.A,implemented:!0}],ea=[{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"}],es=[{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 en(e){return!e||"object"!=typeof e||Array.isArray(e)?{}:{...e}}function el(e){return Array.isArray(e)?e.filter(e=>"string"==typeof e).map(e=>e.trim()).filter(Boolean).join("\n"):"string"!=typeof e?"":e.split(/[\n,]+/g).map(e=>e.trim()).filter(Boolean).join("\n")}function eo(e,t){let r=en(e),a=en(r.trustedHeaders),s=en(r.roles),n=en(t),l=r.defaultRole,o=n.role;return{requireAuth:!0===r.requireAuth||!0===a.enabled,defaultRole:"viewer"===l||"admin"===l||"operator"===l?l:"operator",trustedHeaders:{enabled:!0===a.enabled,provider:"cloudflare-access",emailHeader:"string"==typeof a.emailHeader&&a.emailHeader.trim().length>0?a.emailHeader.trim():"Cf-Access-Authenticated-User-Email",jwtHeader:"string"==typeof a.jwtHeader&&a.jwtHeader.trim().length>0?a.jwtHeader.trim():"Cf-Access-Jwt-Assertion",teamDomain:"string"==typeof a.teamDomain&&a.teamDomain.trim().length>0?a.teamDomain.trim():"",audience:"string"==typeof a.audience&&a.audience.trim().length>0?a.audience.trim():""},roles:{viewers:el(s.viewers),operators:el(s.operators),admins:el(s.admins),viewerDomains:el(s.viewerDomains),operatorDomains:el(s.operatorDomains),adminDomains:el(s.adminDomains)},current:{authenticated:!0===n.authenticated,role:"viewer"===o||"operator"===o||"admin"===o?o:null,email:"string"==typeof n.email&&n.email.trim().length>0?n.email.trim():null,provider:"string"==typeof n.provider&&n.provider.trim().length>0?n.provider.trim():null}}}function ei(e,t){let r=(0,d.yM)(e);if(!r||r.accessOptions.length<=1)return null;let a=(0,d.Tk)(e,t);return a?r.accessOptions.find(e=>e.id===a)?.label??null:null}let ed="block h-4 w-4 shrink-0";function ec(e){return JSON.stringify(e)}let ex={obsidian:{kind:"icon",icon:x.mWn,className:`${ed} text-[#8b5cf6]`},vscode:{kind:"icon",icon:p.$$9,className:`${ed} text-[#22a3f5]`},notion:{kind:"icon",icon:x.i4$,className:`${ed} text-white`},logseq:{kind:"image",imageSrc:"/icons/editors/logseq.svg",className:`${ed} object-contain`},typora:{kind:"image",imageSrc:"/icons/editors/typora-32.png",className:`${ed} rounded-[3px] bg-white/90 p-[1px] object-contain`},custom:{kind:"icon",icon:m.A,className:`${ed} text-[var(--vk-text-muted)]`}};function ep({editorId:e}){let t=ex[e];if(!t)return(0,a.jsx)(j.A,{className:`${ed} text-[var(--vk-text-muted)]`});if("image"===t.kind)return(0,a.jsx)("img",{src:t.imageSrc,alt:"",className:t.className});let r=t.icon;return(0,a.jsx)(r,{className:t.className})}function ev({agent:e,modelAccess:t,runtimeModelCatalogs:r,selection:s,onChange:n,compact:l=!1}){if(!(0,d.Zz)(e))return null;let o=(0,d.yM)(e),i=(0,W.Ik)(e,t,r),c=(0,W.xb)(s)??s.catalogModel,x=(0,W.iL)(e,t,r,c),p=ei(e,t);return o?(0,a.jsxs)("div",{className:l?"grid gap-3 md:grid-cols-3":"space-y-3",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Model"}),(0,a.jsxs)("select",{value:s.catalogModel,disabled:0===i.length,onChange:a=>{let l=a.target.value,o=(0,W.iL)(e,t,r,l);n({...s,catalogModel:l,reasoningEffort:o.some(e=>e.id===s.reasoningEffort)?s.reasoningEffort:(0,W.YS)(e,t,r,l)})},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===i.length&&(0,a.jsx)("option",{value:"",children:"No runtime models detected"}),i.map(e=>(0,a.jsx)("option",{value:e.id,children:e.label},e.id))]}),(0,a.jsxs)("p",{className:"mt-1 text-[11px] text-[var(--vk-text-muted)]",children:[p?`Filtered for ${p}.`:"Filtered for your current access preference."," Leave custom override blank to use this selection."]})]}),x.length>0&&(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Reasoning Effort"}),(0,a.jsx)("select",{value:s.reasoningEffort,onChange:e=>{n({...s,reasoningEffort:e.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:x.map(e=>(0,a.jsx)("option",{value:e.id,children:e.label},e.id))}),(0,a.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,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Custom Model Override"}),(0,a.jsx)("input",{value:s.customModel,onChange:a=>{let l=a.target.value,o=l.trim()||s.catalogModel,i=(0,W.iL)(e,t,r,o);n({...s,customModel:l,reasoningEffort:i.some(e=>e.id===s.reasoningEffort)?s.reasoningEffort:(0,W.YS)(e,t,r,o)})},placeholder:(0,W.ZA)(e,r),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,a.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 em({open:e,onClose:t,onCreate:r,creating:x,error:p,defaultAgent:v,agentOptions:m,modelAccess:u,runtimeModelCatalogs:h,bridgeId:b}){let g=(0,c.useRef)(null),[k,f]=(0,c.useState)("git"),[j,R]=(0,c.useState)("source"),[H,E]=(0,c.useState)(""),[$,D]=(0,c.useState)(!1),[L,F]=(0,c.useState)(""),[_,O]=(0,c.useState)(""),[T,I]=(0,c.useState)(""),[q,G]=(0,c.useState)("main"),[z,et]=(0,c.useState)(v),[er,ea]=(0,c.useState)((0,W.Z3)()),[es,en]=(0,c.useState)(!0),[el,eo]=(0,c.useState)(!0),[ei,ed]=(0,c.useState)([]),[ec,ex]=(0,c.useState)(!1),[ep,eh]=(0,c.useState)(!1),[eb,eg]=(0,c.useState)(null),[ek,ef]=(0,c.useState)(""),[ej,eN]=(0,c.useState)(""),[ey,ew]=(0,c.useState)(!1),[eC,eS]=(0,c.useState)("local"),[eA,eR]=(0,c.useState)([]),[eH,eE]=(0,c.useState)(!1),[e$,eP]=(0,c.useState)(null);(0,c.useEffect)(()=>{e&&(f("git"),R("source"),E(""),D(!1),F(""),O(""),I(""),G("main"),eo(!0),en(!0),et(v),ea((0,W.Z3)()),ed([]),eh(!1),eg(null),ef(""),eN(""),eR([]),eP(null),eE(!1),ew(!1),eS("local"))},[v,e]),(0,c.useEffect)(()=>{e&&ea(e=>{let t=(0,W.c0)(z,u,h,(0,W.xb)(e)??null,(0,W.aB)(e)??null);return e.catalogModel===t.catalogModel&&e.customModel===t.customModel&&e.reasoningEffort===t.reasoningEffort?e:t})},[z,u,e,h]),(0,c.useEffect)(()=>{if(!e)return;let t="git"===k?L.trim().length>0:_.trim().length>0;"source"===j||t||R("source")},[L,_,k,e,j]);let eU=(0,c.useMemo)(()=>{let e;return 0===(e=ek.trim().toLowerCase()).length?ei:ei.filter(t=>t.fullName.toLowerCase().includes(e)||t.name.toLowerCase().includes(e)||(t.ownerLogin??"").toLowerCase().includes(e)||(t.description??"").toLowerCase().includes(e)||t.defaultBranch.toLowerCase().includes(e))},[ek,ei]),eD=(0,c.useMemo)(()=>{let e=ei.find(e=>e.httpsUrl===ej);return e||(L.trim()?ei.find(e=>e.httpsUrl===L.trim())??null:null)},[L,ei,ej]),eB=(0,c.useMemo)(()=>(function(e){let t=e.trim();if(!t)return null;let r=t.match(/^https?:\/\/github\.com\/([^/\s]+)\/([^/\s?#]+?)(?:\.git)?\/?$/i);if(r)return`https://github.com/${r[1]}/${r[2]}.git`;let a=t.match(/^git@github\.com:([^/\s]+)\/([^/\s]+?)(?:\.git)?$/i);return a?`https://github.com/${a[1]}/${a[2]}.git`:null})(ek),[ek]),eL=(0,c.useMemo)(()=>{let e;return(e=ek.trim())&&/^(https?:\/\/|git@)/i.test(e)?e:null},[ek]),eF=(0,c.useMemo)(()=>ee(eD?.updatedAt),[eD]),eM=(0,c.useMemo)(()=>{let e=eB??eL;return!!e&&e.toLowerCase()!==L.trim().toLowerCase()},[L,eB,eL]),e_="git"===k?L.trim().length>0:_.trim().length>0,eO=(0,c.useMemo)(()=>{let e=Y(H);return e||("git"===k?Y(Q(L,eD?.name)):Y(X(_)??"workspace"))},[L,_,k,H,eD?.name]),eT=(0,c.useMemo)(()=>Q(L,eD?.name,eO),[eO,L,eD?.name]),eI=(0,c.useMemo)(()=>{if(0===T.trim().length)return"";let e=T.trim().replace(/[\\/]+$/,""),t=eT.trim().replace(/^[\\/]+/,"");if(!e)return t;if(!t)return e;let r=e.includes("\\")&&!e.includes("/")?"\\":"/";return`${e}${r}${t}`},[eT,T]),eq=(0,c.useMemo)(()=>"git"===k?eD?.fullName??L.trim():X(_)??_.trim(),[L,_,k,eD]),eG=(0,c.useMemo)(()=>"git"===k?eD?.description?.trim()||L.trim():_.trim(),[L,_,k,eD]),ez=(0,c.useMemo)(()=>{let e=[...new Set(m)];0===e.length&&e.push(v||V);let t=new Map(U.BO.map((e,t)=>[e,t]));return e.sort((e,r)=>{let a=t.get((0,P.q)(e))??Number.MAX_SAFE_INTEGER,s=t.get((0,P.q)(r))??Number.MAX_SAFE_INTEGER;return a!==s?a-s:J(e).localeCompare(J(r))})},[m,v]);(0,c.useEffect)(()=>{ez.includes(z)||et(ez[0]??V)},[z,ez]);let eW=async(e=!1)=>{ex(!0),eg(null);try{let t=await fetch((0,B.S)(`/api/github/repos${e?"?refresh=true":""}`,b)),r=await t.json().catch(()=>null);if(!t.ok)throw Error(r?.error??`Failed to load GitHub repositories (${t.status})`);ed(Array.isArray(r?.repos)?r.repos:[])}catch(e){ed([]),eg(e instanceof Error?e.message:"Failed to load GitHub repositories")}finally{eh(!0),ex(!1)}};(0,c.useEffect)(()=>{!e||"git"!==k||ec||ep||eW()},[ep,ec,k,e]);let eZ=async e=>{let t=e?.gitUrl??("git"===k?L.trim():""),r=e?.path??("local"===k?_.trim():"");if(0===t.length&&0===r.length)return void eP("git"===k?"Choose or paste a repository first.":"Select a local repository path first.");eE(!0),eP(null);try{let e=new URLSearchParams;t.length>0&&e.set("gitUrl",t),r.length>0&&e.set("path",r);let a=await fetch((0,B.S)(`/api/workspaces/branches?${e.toString()}`,b)),s=await a.json().catch(()=>null);if(!a.ok)throw Error(s?.error??`Failed to load branches (${a.status})`);let n=Array.isArray(s?.branches)?s.branches.filter(e=>"string"==typeof e&&e.trim().length>0):[];eR(n);let l="string"==typeof s?.defaultBranch&&s.defaultBranch.trim().length>0?s.defaultBranch.trim():n[0]??null;l&&(0===q.trim().length||!n.includes(q))&&G(l)}catch(e){eR([]),eP(e instanceof Error?e.message:"Failed to load branches")}finally{eE(!1)}},eV=async e=>{eN(e);let t=ei.find(t=>t.httpsUrl===e);t&&(F(t.httpsUrl),ef(t.fullName),G(t.defaultBranch||"main"),$||E(Y(t.name)||H),await eZ({gitUrl:t.httpsUrl}),R("details"))},eJ=async()=>{let e=eB??eL;if(!e)return;let t=ei.find(t=>t.httpsUrl.toLowerCase()===e.toLowerCase())??null;if(t)return void await eV(t.httpsUrl);if(eN(""),F(e),G("main"),eR([]),eP(null),!$){let t=K(e);t&&E(Y(t))}await eZ({gitUrl:e}),R("details")},eY=e=>{eS(e),ew(!0)},eX=e=>{f(e),R("source"),eR([]),eP(null)},eK=e_&&q.trim().length>0;async function eQ(e){if(e.preventDefault(),"review"!==j||!eK||x)return;let t="git"===k?{mode:k,projectId:eO||void 0,agent:z,agentModel:(0,W.xb)(er)??"",agentReasoningEffort:(0,W.aB)(er)??"",defaultBranch:q.trim(),useWorktree:es,gitUrl:L.trim(),path:eI||void 0}:{mode:k,projectId:eO||void 0,agent:z,agentModel:(0,W.xb)(er)??"",agentReasoningEffort:(0,W.aB)(er)??"",defaultBranch:q.trim(),useWorktree:es,path:_.trim(),initializeGit:el};await r(t)}return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s.bL,{open:e,onOpenChange:e=>{e||x||ey||t()},children:(0,a.jsxs)(s.ZL,{children:[(0,a.jsx)(s.hJ,{className:`fixed ${M.Rn} z-[80] bg-black/65`}),(0,a.jsx)(s.UC,{asChild:!0,onOpenAutoFocus:()=>{(0,Z.e7)(g)},onCloseAutoFocus:e=>{if((0,Z.AI)(g,e))return;let t=(0,Z.Ae)();t&&(e.preventDefault(),t.focus({preventScroll:!0}))},onEscapeKeyDown:e=>{(x||ey)&&e.preventDefault()},onPointerDownOutside:e=>{(x||ey)&&e.preventDefault()},children:(0,a.jsxs)("form",{onSubmit:eQ,className:`fixed ${M.Rn} z-[81] flex items-start justify-center overflow-y-auto px-0 py-0 sm:items-center sm:px-3 sm:py-3`,children:[(0,a.jsx)(s.VY,{className:"sr-only",children:"Add a repository or local folder and configure the workspace before Conductor creates it."}),(0,a.jsxs)("div",{className:`flex ${M.yq} ${M.w1} w-full max-w-none flex-col overflow-hidden rounded-none border-x-0 border-b-0 border-t border-[var(--vk-border)] bg-[var(--vk-bg-panel)] shadow-[0_24px_80px_rgba(0,0,0,0.55)] sm:h-auto sm:max-w-[860px] sm:rounded-[10px] sm:border`,children:[(0,a.jsxs)("header",{className:"border-b border-[var(--vk-border)] bg-[color:color-mix(in_srgb,var(--vk-bg-panel)_92%,transparent)] px-4 py-3 backdrop-blur",children:[(0,a.jsx)("div",{className:"mb-3 flex justify-center sm:hidden",children:(0,a.jsx)("span",{className:"h-1 w-10 rounded-full bg-[color:color-mix(in_srgb,var(--vk-text-muted)_36%,transparent)]"})}),(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)(s.hE,{asChild:!0,children:(0,a.jsx)("h2",{id:"new-workspace-dialog-title",className:"text-[18px] leading-[22px] text-[var(--vk-text-strong)]",children:"Add Workspace"})}),(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:"source"===j?"Step 1 of 3":"details"===j?"Step 2 of 3":"Step 3 of 3"})]}),(0,a.jsx)("p",{className:"pt-1 text-[12px] text-[var(--vk-text-muted)]",children:"source"===j?"Start with the repository or folder you want Conductor to manage.":"details"===j?"Confirm the project defaults Conductor should use when this workspace is created.":"Review the project and destination details before Conductor adds it."}),(0,a.jsx)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[{id:"source",label:"git"===k?"Repository":"Folder"},{id:"details",label:"Project"},{id:"review",label:"Review"}].map(e=>{let t=j===e.id,r="source"===e.id?"source"!==j&&e_:"details"===e.id&&"review"===j;return(0,a.jsxs)("div",{className:`inline-flex items-center gap-2 rounded-full border px-3 py-1 text-[11px] ${t?"border-[var(--vk-orange)] bg-[color:color-mix(in_srgb,var(--vk-orange)_12%,transparent)] text-[var(--vk-text-strong)]":"border-[var(--vk-border)] text-[var(--vk-text-muted)]"}`,children:[(0,a.jsx)("span",{className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] ${r?"border-[var(--vk-orange)] bg-[var(--vk-orange)] text-black":t?"border-[var(--vk-orange)] text-[var(--vk-text-strong)]":"border-[var(--vk-border)]"}`,children:r?(0,a.jsx)(N.A,{className:"h-3 w-3"}):"source"===e.id?"1":"details"===e.id?"2":"3"}),(0,a.jsx)("span",{children:e.label})]},e.id)})})]}),(0,a.jsx)("button",{type:"button",onClick:t,disabled:x,"aria-label":"Close dialog",className:"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,a.jsx)(y.A,{className:"h-4 w-4"})})]})]}),(0,a.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 py-4 sm:px-5 sm:py-5",children:"source"===j?(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"grid gap-2 sm:grid-cols-2",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>eX("git"),className:`rounded-[10px] border px-4 py-4 text-left transition ${"git"===k?"border-[var(--vk-orange)] bg-[color:color-mix(in_srgb,var(--vk-orange)_12%,transparent)]":"border-[var(--vk-border)] bg-[var(--vk-bg-main)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsx)("span",{className:"inline-flex h-10 w-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-strong)]",children:(0,a.jsx)(n.u,{className:"h-[18px] w-[18px]"})}),(0,a.jsx)("p",{className:"mt-3 text-[14px] font-medium text-[var(--vk-text-strong)]",children:"GitHub repository"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Search repos you already have access to, or paste a GitHub URL directly."})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>eX("local"),className:`rounded-[10px] border px-4 py-4 text-left transition ${"local"===k?"border-[var(--vk-orange)] bg-[color:color-mix(in_srgb,var(--vk-orange)_12%,transparent)]":"border-[var(--vk-border)] bg-[var(--vk-bg-main)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsx)("span",{className:"inline-flex h-10 w-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-strong)]",children:(0,a.jsx)(w.A,{className:"h-5 w-5"})}),(0,a.jsx)("p",{className:"mt-3 text-[14px] font-medium text-[var(--vk-text-strong)]",children:"Local folder"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Point Conductor at a repository already on this machine."})]})]}),"git"===k?(0,a.jsxs)("div",{className:"space-y-3 rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"inline-flex h-10 w-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-strong)]",children:(0,a.jsx)(l.S,{className:"h-4 w-4"})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"text-[14px] font-medium text-[var(--vk-text-strong)]",children:"Choose repository"}),(0,a.jsx)("p",{className:"pt-0.5 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Select a repo first. Branch, workspace name, and runtime defaults come next."})]}),(0,a.jsx)("button",{type:"button",onClick:()=>{eh(!1),eW(!0)},disabled:ec,className:"inline-flex h-9 items-center rounded-[6px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:ec?(0,a.jsx)(C.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.A,{className:"mr-1.5 h-3.5 w-3.5"}),"Refresh"]})})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(n.u,{className:"pointer-events-none absolute left-3 top-1/2 h-[16px] w-[16px] -translate-y-1/2 text-[var(--vk-text-muted)]"}),(0,a.jsx)("input",{value:ek,onChange:e=>ef(e.target.value),onKeyDown:e=>{"Enter"===e.key&&eM&&(e.preventDefault(),eJ())},placeholder:"Search GitHub repos or paste a repository URL",className:"h-11 w-full rounded-[8px] 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)]"})]}),eM?(0,a.jsxs)("button",{type:"button",onClick:()=>{eJ()},className:"inline-flex w-full items-center justify-center gap-2 rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-2.5 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[(0,a.jsx)(l.S,{className:"h-4 w-4 text-[var(--vk-text-strong)]"}),(0,a.jsxs)("span",{className:"truncate",children:["Use ",eB?"this GitHub repository":"pasted repository URL"]})]}):null,ec&&0===ei.length?(0,a.jsx)("div",{className:"rounded-[8px] border border-[var(--vk-border)] px-3 py-3 text-[12px] text-[var(--vk-text-muted)]",children:"Loading accessible GitHub repositories..."}):null,eb?(0,a.jsxs)("div",{className:"rounded-[8px] border border-[var(--vk-red)]/40 bg-[var(--vk-bg-panel)] px-3 py-3 text-[12px] text-[var(--vk-red)]",children:[(0,a.jsx)("p",{children:eb}),(0,a.jsx)("button",{type:"button",onClick:()=>{eh(!1),eW(!0)},className:"mt-2 inline-flex items-center rounded-[6px] 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,!eb&&eU.length>0?(0,a.jsx)("div",{className:"max-h-[min(42dvh,340px)] space-y-2 overflow-y-auto pr-1",children:eU.map(e=>{let t=ee(e.updatedAt),r=eD?.httpsUrl===e.httpsUrl;return(0,a.jsxs)("button",{type:"button",onClick:()=>{eV(e.httpsUrl)},className:`flex w-full items-start gap-3 rounded-[8px] border px-3 py-3 text-left transition ${r?"border-[var(--vk-orange)] bg-[color:color-mix(in_srgb,var(--vk-orange)_10%,transparent)]":"border-[var(--vk-border)] bg-[var(--vk-bg-panel)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsx)("span",{className:"mt-0.5 inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] text-[var(--vk-text-strong)]",children:(0,a.jsx)(l.S,{className:"h-4 w-4"})}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("span",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"truncate text-[13px] font-medium text-[var(--vk-text-strong)]",children:e.fullName}),(0,a.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:[e.private?(0,a.jsx)(o.X,{className:"h-3 w-3"}):(0,a.jsx)(n.u,{className:"h-3 w-3"}),e.private?"Private":"Public"]}),(0,a.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,a.jsx)(i.C,{className:"h-3 w-3"}),e.defaultBranch]})]}),e.description?(0,a.jsx)("span",{className:"mt-1 block line-clamp-2 text-[12px] leading-[17px] text-[var(--vk-text-muted)]",children:e.description}):null,(0,a.jsxs)("span",{className:"mt-1 flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-[var(--vk-text-muted)]",children:[e.ownerLogin?(0,a.jsx)("span",{children:e.ownerLogin}):null,t?(0,a.jsx)("span",{children:t}):null,e.permission?(0,a.jsx)("span",{children:e.permission.toLowerCase()}):null]})]}),(0,a.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 shrink-0 items-center justify-center text-[var(--vk-text-strong)]",children:r?(0,a.jsx)(N.A,{className:"h-4 w-4"}):null})]},e.httpsUrl)})}):null,ec||eb||0!==eU.length?null:(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:ek.trim().length>0?"No matching repositories. Try another search or paste a repository URL.":"No accessible GitHub repositories were found for this machine yet."})]}):(0,a.jsxs)("div",{className:"space-y-3 rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"inline-flex h-10 w-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-strong)]",children:(0,a.jsx)(w.A,{className:"h-5 w-5"})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"text-[14px] font-medium text-[var(--vk-text-strong)]",children:"Choose folder"}),(0,a.jsx)("p",{className:"pt-0.5 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Pick the repository folder already on disk. You can adjust branch and runtime defaults next."})]})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>eY("local"),className:"inline-flex h-11 w-full items-center justify-center gap-2 rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[(0,a.jsx)(w.A,{className:"h-4 w-4"}),_.trim().length>0?"Choose another folder":"Choose folder"]}),_.trim().length>0?(0,a.jsxs)("div",{className:"rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-3",children:[(0,a.jsx)("p",{className:"text-[12px] font-medium text-[var(--vk-text-strong)]",children:"Selected folder"}),(0,a.jsx)("p",{className:"mt-1 break-all text-[12px] leading-5 text-[var(--vk-text-muted)]",children:_})]}):(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"The folder picker stays separate so you do not lose your place in this setup flow on mobile."})]}),p?(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-red)]",children:p}):null]}):"details"===j?(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"text-[12px] uppercase tracking-[0.08em] text-[var(--vk-text-muted)]",children:"git"===k?"Selected repository":"Selected folder"}),(0,a.jsx)("p",{className:"mt-1 break-words text-[15px] font-medium text-[var(--vk-text-strong)]",children:eq}),(0,a.jsx)("p",{className:"mt-1 break-all text-[12px] leading-5 text-[var(--vk-text-muted)]",children:eG}),(0,a.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:"git"===k?(0,a.jsxs)(a.Fragment,{children:[(0,a.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:[eD?.private?(0,a.jsx)(o.X,{className:"h-3 w-3"}):(0,a.jsx)(n.u,{className:"h-3 w-3"}),eD?eD.private?"Private":"Public":"Manual URL"]}),(0,a.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,a.jsx)(i.C,{className:"h-3 w-3"}),q||"main"]}),eD?.ownerLogin?(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:eD.ownerLogin}):null,eF?(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:eF}):null]}):(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:"Local repository"})})]}),(0,a.jsx)("button",{type:"button",onClick:()=>R("source"),className:"inline-flex h-9 items-center justify-center rounded-[6px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Change"})]})}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-3 lg:grid-cols-2",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Workspace Name (optional)"}),(0,a.jsx)("input",{value:H,onChange:e=>{E(e.target.value),D(!0)},placeholder:"auto-derived from the selected repository or folder",className:"h-10 w-full rounded-[8px] border border-[var(--vk-border)] bg-transparent px-3 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Branch"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{value:q,onChange:e=>G(e.target.value),placeholder:"Uses the repository default branch",className:"h-10 w-full rounded-[8px] border border-[var(--vk-border)] bg-transparent px-3 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("button",{type:"button",onClick:()=>{eZ()},disabled:eH,className:"inline-flex h-10 items-center rounded-[8px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",title:"Detect branches",children:eH?(0,a.jsx)(C.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsx)(S.A,{className:"h-3.5 w-3.5"})})]}),eA.length>0?(0,a.jsx)("select",{value:q,onChange:e=>G(e.target.value),className:"mt-2 h-9 w-full rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 text-[12px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:eA.map(e=>(0,a.jsx)("option",{value:e,children:e},e))}):null,e$?(0,a.jsx)("p",{className:"mt-1 text-[11px] text-[var(--vk-red)]",children:e$}):null]})]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 text-[11px] text-[var(--vk-text-muted)]",children:[(0,a.jsxs)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5",children:["Agent: ",J(z)]}),(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5",children:es?"Worktree isolation on":"Runs on selected branch"}),"local"===k?(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5",children:el?"Auto-init git if needed":"Do not init git"}):null]}),(0,d.Zz)(z)?(0,a.jsxs)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsx)("div",{className:"flex flex-col gap-1 sm:flex-row sm:items-end sm:justify-between",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-[13px] font-medium text-[var(--vk-text-strong)]",children:"Agent defaults"}),(0,a.jsx)("p",{className:"mt-0.5 text-[11px] leading-5 text-[var(--vk-text-muted)]",children:"Choose the model and reasoning this workspace should inherit when sessions launch."})]})}),(0,a.jsx)("div",{className:"mt-3",children:(0,a.jsx)(ev,{compact:!0,agent:z,modelAccess:u,runtimeModelCatalogs:h,selection:er,onChange:ea})})]}):null,(0,a.jsxs)("details",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)]",children:[(0,a.jsx)("summary",{className:"cursor-pointer list-none px-3 py-3 text-[13px] text-[var(--vk-text-normal)] marker:hidden",children:(0,a.jsxs)("span",{className:"inline-flex items-center gap-2",children:[(0,a.jsx)(A.A,{className:"h-3.5 w-3.5 text-[var(--vk-text-muted)]"}),"Runtime and repository options"]})}),(0,a.jsxs)("div",{className:"space-y-3 border-t border-[var(--vk-border)] px-3 py-3",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Agent"}),(0,a.jsx)("select",{value:z,onChange:e=>et(e.target.value),className:"h-10 w-full rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:ez.map(e=>(0,a.jsx)("option",{value:e,className:"bg-[var(--vk-bg-panel)] text-[var(--vk-text-normal)]",children:J(e)},e))})]}),(0,a.jsx)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-3",children:(0,a.jsxs)("label",{className:"flex items-start gap-3 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsx)("input",{type:"checkbox",checked:es,onChange:e=>en(e.target.checked),className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,a.jsxs)("span",{children:["Keep work isolated in a new worktree",(0,a.jsx)("span",{className:"mt-1 block text-[11px] leading-5 text-[var(--vk-text-muted)]",children:"Recommended. Turn this off only if sessions should run directly on the selected branch."})]})]})}),"local"===k?(0,a.jsx)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-3",children:(0,a.jsxs)("label",{className:"flex items-start gap-3 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsx)("input",{type:"checkbox",checked:el,onChange:e=>eo(e.target.checked),className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,a.jsxs)("span",{children:["Initialize git if this folder is not already a repository",(0,a.jsx)("span",{className:"mt-1 block text-[11px] leading-5 text-[var(--vk-text-muted)]",children:"Leave this on unless you know the folder should stay non-git."})]})]})}):(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Clone into parent folder"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{value:T,readOnly:!0,onClick:()=>eY("clone"),placeholder:"Leave empty to use Conductor's default repo location",className:"h-10 w-full cursor-pointer rounded-[8px] border border-[var(--vk-border)] bg-transparent px-3 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("button",{type:"button",onClick:()=>eY("clone"),className:"inline-flex h-10 items-center rounded-[8px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",title:"Browse folders",children:(0,a.jsx)(w.A,{className:"h-4 w-4"})})]}),(0,a.jsx)("p",{className:"mt-1 text-[11px] leading-5 text-[var(--vk-text-muted)]",children:eI?`Conductor will create ${eI}.`:"Conductor will create the cloned repository inside the selected parent folder."})]})]})]}),p?(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-red)]",children:p}):null]}):(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsx)("p",{className:"text-[13px] font-medium text-[var(--vk-text-strong)]",children:"Review project"}),(0,a.jsxs)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:["Conductor will add ",(0,a.jsx)("span",{className:"font-medium text-[var(--vk-text-normal)]",children:eO||"workspace"})," ","and sync the board plus support files for this project."]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-3 lg:grid-cols-2",children:[(0,a.jsxs)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsx)("p",{className:"text-[12px] uppercase tracking-[0.08em] text-[var(--vk-text-muted)]",children:"Project"}),(0,a.jsx)("p",{className:"mt-2 text-[15px] font-medium text-[var(--vk-text-strong)]",children:eO||"workspace"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:H.trim().length>0?"Uses the custom workspace name you entered.":"Auto-derived from the selected repository or folder."})]}),(0,a.jsxs)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsx)("p",{className:"text-[12px] uppercase tracking-[0.08em] text-[var(--vk-text-muted)]",children:"Source"}),(0,a.jsx)("p",{className:"mt-2 break-words text-[15px] font-medium text-[var(--vk-text-strong)]",children:eq}),(0,a.jsx)("p",{className:"mt-1 break-all text-[12px] leading-5 text-[var(--vk-text-muted)]",children:eG})]}),(0,a.jsxs)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsx)("p",{className:"text-[12px] uppercase tracking-[0.08em] text-[var(--vk-text-muted)]",children:"Destination"}),(0,a.jsx)("p",{className:"mt-2 break-all text-[15px] font-medium text-[var(--vk-text-strong)]",children:"git"===k?eI||"Conductor default repo location":_}),(0,a.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"git"===k?eI?`The repository will be cloned into ${eI}.`:"Conductor will choose the default clone location for this repository.":"Conductor will link the selected folder directly."})]}),(0,a.jsxs)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsx)("p",{className:"text-[12px] uppercase tracking-[0.08em] text-[var(--vk-text-muted)]",children:"Runtime Defaults"}),(0,a.jsxs)("div",{className:"mt-2 space-y-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsxs)("p",{children:["Branch: ",(0,a.jsx)("span",{className:"text-[var(--vk-text-strong)]",children:q.trim()||"main"})]}),(0,a.jsxs)("p",{children:["Agent: ",(0,a.jsx)("span",{className:"text-[var(--vk-text-strong)]",children:J(z)})]}),(0,a.jsxs)("p",{children:["Isolation: ",(0,a.jsx)("span",{className:"text-[var(--vk-text-strong)]",children:es?"Worktree enabled":"Runs on selected branch"})]}),(0,W.xb)(er)?(0,a.jsxs)("p",{children:["Model: ",(0,a.jsx)("span",{className:"text-[var(--vk-text-strong)]",children:(0,W.xb)(er)})]}):null,(0,W.aB)(er)?(0,a.jsxs)("p",{children:["Reasoning: ",(0,a.jsx)("span",{className:"text-[var(--vk-text-strong)]",children:(0,W.aB)(er)})]}):null,"local"===k?(0,a.jsxs)("p",{children:["Git init: ",(0,a.jsx)("span",{className:"text-[var(--vk-text-strong)]",children:el?"Enabled if needed":"Disabled"})]}):null]})]})]}),p?(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-red)]",children:p}):null]})}),(0,a.jsx)("footer",{className:"border-t border-[var(--vk-border)] bg-[color:color-mix(in_srgb,var(--vk-bg-panel)_92%,transparent)] px-4 py-3 pb-[calc(0.75rem+env(safe-area-inset-bottom))] backdrop-blur",children:"source"===j?(0,a.jsxs)("div",{className:"flex flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("button",{type:"button",onClick:t,disabled:x,className:"inline-flex h-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] px-4 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Cancel"}),(0,a.jsx)("button",{type:"button",onClick:()=>{"local"!==k||e_?e_&&!x&&R("details"):eY("local")},disabled:"git"===k&&!e_||x,className:"inline-flex h-10 items-center justify-center rounded-[8px] bg-[var(--vk-bg-active)] px-4 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"local"!==k||e_?"Continue":"Choose folder"})]}):"details"===j?(0,a.jsxs)("div",{className:"flex flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("button",{type:"button",onClick:()=>R("source"),disabled:x,className:"inline-flex h-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] px-4 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Back"}),(0,a.jsx)("button",{type:"button",onClick:()=>{e_&&0!==q.trim().length&&!x&&R("review")},disabled:!eK||x,className:"inline-flex h-10 items-center justify-center rounded-[8px] bg-[var(--vk-bg-active)] px-4 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Review"})]}):(0,a.jsxs)("div",{className:"flex flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("button",{type:"button",onClick:()=>R("details"),disabled:x,className:"inline-flex h-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] px-4 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Back"}),(0,a.jsx)("button",{type:"submit",disabled:!eK||x,className:"inline-flex h-10 items-center justify-center rounded-[8px] bg-[var(--vk-bg-active)] px-4 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:x?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(C.A,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Adding..."]}):"Add Workspace"})]})})]})]})})]})}),(0,a.jsx)(eu,{open:ey,bridgeId:b,initialPath:"clone"===eC?T:_,title:"local"===eC?"Select Local Repository":"Select Clone Parent Folder",description:"local"===eC?"Choose the local repository folder.":"Choose the parent folder where Conductor should create the cloned repository.",onClose:()=>ew(!1),onSelect:e=>{if(ew(!1),e){if("clone"===eC)return void I(e);if(O(e),!$){let t=X(e);t&&E(Y(t))}eZ({path:e}),R("details")}}})]})}function eu({open:e,bridgeId:t,initialPath:r,title:n,description:l,onClose:o,onSelect:i}){let d=(0,c.useRef)(null),[x,p]=(0,c.useState)(""),[v,m]=(0,c.useState)(r??""),[u,h]=(0,c.useState)([]),[b,g]=(0,c.useState)(""),[k,f]=(0,c.useState)(!1),[j,N]=(0,c.useState)(null),[y,S]=(0,c.useState)(!1);(0,c.useEffect)(()=>{if(!e)return;g(""),m(r??"");let a=r&&r.trim().length>0?r.trim():void 0,s=a?`?path=${encodeURIComponent(a)}`:"";f(!0),N(null),fetch((0,B.S)(`/api/filesystem/directory${s}`,t)).then(async e=>{let t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Failed to load directory (${e.status})`);p("string"==typeof t?.currentPath?t.currentPath:""),h(Array.isArray(t?.entries)?t.entries:[])}).catch(e=>{N(e instanceof Error?e.message:"Failed to load directory"),h([])}).finally(()=>{f(!1)})},[r,e]);let A=(0,c.useMemo)(()=>{if(0===b.trim().length)return u;let e=b.trim().toLowerCase();return u.filter(t=>t.name.toLowerCase().includes(e))},[u,b]),H=async e=>{f(!0),N(null);try{let r=e&&e.trim().length>0?`?path=${encodeURIComponent(e.trim())}`:"",a=await fetch((0,B.S)(`/api/filesystem/directory${r}`,t)),s=await a.json().catch(()=>null);if(!a.ok)throw Error(s?.error??`Failed to load directory (${a.status})`);let n="string"==typeof s?.currentPath?s.currentPath:"";p(n),h(Array.isArray(s?.entries)?s.entries:[]),m(n)}catch(e){N(e instanceof Error?e.message:"Failed to load directory"),h([])}finally{f(!1)}},E=async()=>{S(!0);try{let e=await fetch((0,B.S)("/api/filesystem/pick-directory",t),{method:"POST"}),r=await e.json().catch(()=>null);if(!r||r.cancelled||!r.path)return;m(r.path),H(r.path)}catch{}finally{S(!1)}};return(0,a.jsx)(s.bL,{open:e,onOpenChange:e=>{e||(o(),i(null))},children:(0,a.jsxs)(s.ZL,{children:[(0,a.jsx)(s.hJ,{className:`fixed ${M.Rn} z-[95] bg-black/70`}),(0,a.jsx)(s.UC,{className:`fixed ${M.Rn} z-[96] flex items-start justify-center overflow-y-auto px-3 py-3 outline-none sm:items-center sm:py-0`,onOpenAutoFocus:()=>{(0,Z.e7)(d)},onCloseAutoFocus:e=>{(0,Z.AI)(d,e)},children:(0,a.jsxs)("div",{className:`flex ${M.Cf} 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,a.jsxs)("header",{className:"border-b border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsx)(s.hE,{asChild:!0,children:(0,a.jsx)("h3",{id:"folder-picker-dialog-title",className:"text-[16px] text-[var(--vk-text-strong)]",children:n})}),(0,a.jsx)(s.VY,{asChild:!0,children:(0,a.jsx)("p",{className:"pt-1 text-[12px] text-[var(--vk-text-muted)]",children:l})})]}),(0,a.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-3 px-4 py-3",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("input",{value:v,onChange:e=>m(e.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,a.jsx)("button",{type:"button",onClick:()=>{H(v)},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,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("button",{type:"button",onClick:()=>{H()},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,a.jsx)("button",{type:"button",onClick:()=>{if(!x)return;let e=x.replace(/\\/g,"/");if(/^[A-Za-z]:\/?$/.test(x)||"/"===e)return;let t=e.split("/").filter(Boolean),r=x.match(/^([A-Za-z]):[/\\]/);H(r?t.length>1?`${r[1]}:/${t.slice(1,-1).join("/")}`:`${r[1]}:/`:t.length>1?`/${t.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,a.jsxs)("button",{type:"button",disabled:y,onClick:()=>{E()},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:[y?(0,a.jsx)(C.A,{className:"h-3 w-3 animate-spin"}):(0,a.jsx)(w.A,{className:"h-3 w-3"}),y?"Opening...":"Browse"]}),(0,a.jsx)("div",{className:"truncate text-[12px] text-[var(--vk-text-muted)]",children:x||"Home"})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(R.A,{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,a.jsx)("input",{value:b,onChange:e=>g(e.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,a.jsx)("div",{className:"min-h-0 flex-1 overflow-auto rounded-[4px] border border-[var(--vk-border)]",children:k?(0,a.jsx)("div",{className:"px-3 py-3 text-[12px] text-[var(--vk-text-muted)]",children:"Loading..."}):j?(0,a.jsx)("div",{className:"px-3 py-3 text-[12px] text-[var(--vk-red)]",children:j}):0===A.length?(0,a.jsx)("div",{className:"px-3 py-3 text-[12px] text-[var(--vk-text-muted)]",children:"No folders found."}):(0,a.jsx)("div",{className:"p-1",children:A.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>{e.isDirectory&&H(e.path)},className:`mb-1 flex w-full items-center gap-2 rounded-[4px] px-2 py-2 text-left text-[12px] ${e.isDirectory?"text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]":"cursor-default text-[var(--vk-text-muted)]"}`,children:[(0,a.jsx)(w.A,{className:"h-4 w-4 shrink-0"}),(0,a.jsx)("span",{className:"truncate",children:e.name}),e.isGitRepo&&(0,a.jsx)("span",{className:"ml-auto rounded-[999px] border border-[var(--vk-border)] px-1.5 py-0.5 text-[10px]",children:"git"})]},e.path))})})]}),(0,a.jsxs)("footer",{className:"flex items-center justify-end gap-2 border-t border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsx)("button",{type:"button",onClick:()=>{o(),i(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,a.jsx)("button",{type:"button",onClick:()=>{let e=v.trim().length>0?v.trim():x;o(),i(e||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"})]})]})})]})})}function eh({value:e,idleLabel:t="Copy",copiedLabel:r="Copied"}){let[s,n]=(0,c.useState)(!1);async function l(){await navigator.clipboard.writeText(e),n(!0),window.setTimeout(()=>n(!1),1400)}return(0,a.jsxs)("button",{type:"button",onClick:()=>void l(),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:[s?(0,a.jsx)(N.A,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"}):(0,a.jsx)(H.A,{className:"h-3.5 w-3.5"}),(0,a.jsx)("span",{children:s?r:t})]})}function eb({open:e,mode:t,creating:r,error:n,current:l,projectCount:o,agentOptions:i,agentStates:x,runtimeModelCatalogs:p,onRepositoriesChanged:v,onOnboardingComplete:m,onOpenAgentSetup:u,onClose:h,onSave:b,bridgeId:g}){var k,f;let j,A=(0,c.useRef)(null),[R,H]=(0,c.useState)("preferences"),[_,O]=(0,c.useState)(l.codingAgent),[T,I]=(0,c.useState)(l.ide),[q,G]=(0,c.useState)(l.markdownEditor),[Y,X]=(0,c.useState)(l.markdownEditorPath??""),[K,Q]=(0,c.useState)(()=>l.filesystemBrowseRoots.join("\n")),[ee,en]=(0,c.useState)(!0===l.allowHomeBrowse),[el,ed]=(0,c.useState)(l.modelAccess),[ex,em]=(0,c.useState)(l.notifications.soundEnabled),[eg,ek]=(0,c.useState)(l.notifications.soundFile),[ef,ej]=(0,c.useState)([]),[eN,ey]=(0,c.useState)(!1),[ew,eC]=(0,c.useState)(!1),[eS,eA]=(0,c.useState)(null),[eR,eH]=(0,c.useState)(""),[eE,e$]=(0,c.useState)(null),[eP,eU]=(0,c.useState)((0,W.Z3)()),[eD,eB]=(0,c.useState)([]),[eL,eF]=(0,c.useState)(!1),[eM,e_]=(0,c.useState)(null),[eO,eT]=(0,c.useState)(!1),[eI,eq]=(0,c.useState)(!1),[eG,ez]=(0,c.useState)(!1),[eW,eZ]=(0,c.useState)(()=>eo(null)),[eV,eJ]=(0,c.useState)(!1),[eY,eX]=(0,c.useState)(!1),[eK,eQ]=(0,c.useState)(null),[e0,e1]=(0,c.useState)(null),[e2,e3]=(0,c.useState)(!1),[e4,e5]=(0,c.useState)(null),e8=r||ew||eY;function e9(e){return{...e,agentPermissions:"skip"===e.agentPermissions?"skip":"default",devServerScript:e.devServerScript??"",devServerCwd:e.devServerCwd??"",devServerUrl:e.devServerUrl??"",devServerPort:e.devServerPort??"",devServerHost:e.devServerHost??"",devServerPath:e.devServerPath??"",devServerHttps:!0===e.devServerHttps,pathHealth:{exists:e.pathHealth.exists,isGitRepository:e.pathHealth.isGitRepository,suggestedPath:e.pathHealth.suggestedPath}}}function e6(e){return e.split(/\n+/g).map(e=>e.trim()).filter(Boolean)}async function e7(e){ey(!0),eA(null);try{let t=await fetch((0,B.S)("/api/repositories",g)),r=await t.json().catch(()=>null);if(!t.ok)throw Error(r?.error??`Failed to load repositories (${t.status})`);let a=Array.isArray(r?.repositories)?r.repositories:[];ej(a);let s=a[0]?.id??"",n=e&&a.some(t=>t.id===e)?e:eR&&a.some(e=>e.id===eR)?eR:s;eH(n)}catch(e){ej([]),eH(""),e$(null),eU((0,W.Z3)()),eA(e instanceof Error?e.message:"Failed to load repositories")}finally{ey(!1)}}async function te(e,t){let r=(e??eE?.path??"").trim();if(0===r.length){e_("Select a repository path first."),eB([]);return}eF(!0),e_(null);try{let e=new URLSearchParams({path:r}),a=await fetch((0,B.S)(`/api/workspaces/branches?${e.toString()}`,g)),s=await a.json().catch(()=>null);if(!a.ok)throw Error(s?.error??`Failed to detect branches (${a.status})`);let n=Array.isArray(s?.branches)?s.branches.filter(e=>"string"==typeof e&&e.trim().length>0):[];eB(n);let l=t?.trim()||("string"==typeof s?.defaultBranch&&s.defaultBranch.trim().length>0?s.defaultBranch.trim():n[0]??"");if(!l)return;e$(e=>!e||e.defaultBranch.trim().length>0&&n.includes(e.defaultBranch)?e:{...e,defaultBranch:l})}catch(e){eB([]),e_(e instanceof Error?e.message:"Failed to detect branches")}finally{eF(!1)}}async function tt(){if(!eE||ew||0===eE.repo.trim().length||0===eE.path.trim().length)return!1;eC(!0),eA(null);try{let e=await fetch((0,B.S)("/api/repositories",g),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:eE.id,displayName:eE.displayName,repo:eE.repo,path:eE.path,agent:eE.agent,agentPermissions:eE.agentPermissions,agentModel:(0,W.xb)(eP)??"",agentReasoningEffort:(0,W.aB)(eP)??"",defaultWorkingDirectory:eE.defaultWorkingDirectory,defaultBranch:eE.defaultBranch,devServerScript:eE.devServerScript,devServerCwd:eE.devServerCwd,devServerUrl:eE.devServerUrl,devServerPort:eE.devServerPort,devServerHost:eE.devServerHost,devServerPath:eE.devServerPath,devServerHttps:eE.devServerHttps,setupScript:eE.setupScript,runSetupInParallel:eE.runSetupInParallel,cleanupScript:eE.cleanupScript,archiveScript:eE.archiveScript,copyFiles:eE.copyFiles})}),t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Failed to save repository settings (${e.status})`);let r=t?.repository;if(!r)throw Error("Repository saved but response is missing repository data");return ej(e=>e.map(e=>e.id===r.id?r:e)),e$(e9(r)),eH(r.id),e_(null),await te(r.path,r.defaultBranch),v&&await v(),!0}catch(e){return eA(e instanceof Error?e.message:"Failed to save repository settings"),!1}finally{eC(!1)}}async function tr(){eJ(!0),eQ(null);try{let e=await fetch("/api/access"),t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Failed to load organization settings (${e.status})`);eZ(eo(t?.access,t?.current))}catch(e){eZ(eo(null)),eQ(e instanceof Error?e.message:"Failed to load organization settings")}finally{eJ(!1)}}async function ta(){e3(!0),e5(null);try{let e=await fetch("/api/auth/profile",{cache:"no-store"}),t=await e.json().catch(()=>null);if(!e.ok){let r=t&&"object"==typeof t&&"error"in t&&"string"==typeof t.error?t.error:`Failed to load profile (${e.status})`;throw Error(r)}e1(t)}catch(e){e1(null),e5(e instanceof Error?e.message:"Failed to load profile")}finally{e3(!1)}}async function ts(){if(eY)return!1;eX(!0),eQ(null);try{let e=await fetch("/api/access",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireAuth:eW.requireAuth||eW.trustedHeaders.enabled,defaultRole:eW.defaultRole,trustedHeaders:{enabled:eW.trustedHeaders.enabled,provider:"cloudflare-access",emailHeader:eW.trustedHeaders.emailHeader,jwtHeader:eW.trustedHeaders.jwtHeader,teamDomain:eW.trustedHeaders.teamDomain,audience:eW.trustedHeaders.audience},roles:{viewers:e6(eW.roles.viewers),operators:e6(eW.roles.operators),admins:e6(eW.roles.admins),viewerDomains:e6(eW.roles.viewerDomains),operatorDomains:e6(eW.roles.operatorDomains),adminDomains:e6(eW.roles.adminDomains)}})}),t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Failed to save organization settings (${e.status})`);return eZ(eo(t?.access,t?.current)),!0}catch(e){return eQ(e instanceof Error?e.message:"Failed to save organization settings"),!1}finally{eX(!1)}}(0,c.useEffect)(()=>{e&&(H("onboarding"===t?"preferences":"general"),O(l.codingAgent),I(l.ide),G(l.markdownEditor),X(l.markdownEditorPath??""),Q(l.filesystemBrowseRoots.join("\n")),en(!0===l.allowHomeBrowse),ed(l.modelAccess),em(l.notifications.soundEnabled),ek(l.notifications.soundFile),eB([]),e_(null),eA(null),eU((0,W.Z3)()),eQ(null),e1(null),e5(null))},[t,e]),(0,c.useEffect)(()=>{e&&("settings"===t||"repositories"===R)&&e7()},[R,t,e]),(0,c.useEffect)(()=>{e&&"onboarding"!==t&&tr()},[t,e]),(0,c.useEffect)(()=>{e&&"onboarding"!==t&&"profile"===R&&ta()},[R,t,e]),(0,c.useEffect)(()=>{if(!e)return;if(!eR){e$(null),eU((0,W.Z3)());return}let t=ef.find(e=>e.id===eR);if(!t)return;let r=(0,U.a6)(t.agent,_||V);e$(e9({...t,agent:r})),eU((0,W.c0)(r,el,p,t.agentModel,t.agentReasoningEffort)),eB([]),e_(null),t.path.trim().length>0&&te(t.path,t.defaultBranch)},[_,el,e,ef,p,eR]);let tn="onboarding"===t&&o>0,tl=(0,c.useMemo)(()=>"onboarding"===t?tn?er:er.filter(e=>"preferences"===e.id):et.filter(e=>e.implemented),[t,tn]),to=tl.find(e=>e.id===R)??tl[0]??et[0],ti="onboarding"===t,td="preferences"===to.id,tc="profile"===to.id,tx="general"===to.id,tp="agents"===to.id,tv=td||tx||tp,tm="repositories"===to.id,tu="organization"===to.id,th=tl.findIndex(e=>e.id===to.id)+1,tb=tl.some(e=>"repositories"===e.id),tg="admin"===eW.current.role,tk=(0,c.useMemo)(()=>{let e=new Set((0,U.Ge)(i));_.trim().length>0&&(0,U.iQ)(_)&&e.add(_),0===e.size&&e.add(V);let t=new Map(U.BO.map((e,t)=>[e,t]));return[...e].sort((e,r)=>{let a=t.get((0,P.q)(e))??Number.MAX_SAFE_INTEGER,s=t.get((0,P.q)(r))??Number.MAX_SAFE_INTEGER;return a!==s?a-s:J(e).localeCompare(J(r))})},[i,_]);(0,c.useEffect)(()=>{0!==tk.length&&(_&&tk.includes(_)||O((0,U.a6)(_,tk[0]??V)))},[_,tk]);let tf=x[(0,P.q)(_)]??null,tj=_.trim().length>0&&T.trim().length>0&&q.trim().length>0,tN=!!eE&&eE.displayName.trim().length>0&&eE.repo.trim().length>0&&eE.path.trim().length>0&&eE.defaultBranch.trim().length>0,ty=tg&&!eV&&(!eW.trustedHeaders.enabled||eW.trustedHeaders.teamDomain.trim().length>0&&eW.trustedHeaders.audience.trim().length>0),tw=tm?eS:tu?eK:tc?e4:n,tC=eE?(k={...eE,agentModel:(0,W.xb)(eP)??"",agentReasoningEffort:(0,W.aB)(eP)??""},f={ide:T,markdownEditor:q},j=["npx --yes --registry=https://registry.npmjs.org conductor-oss@latest setup","--yes",`--path ${ec(k.path)}`,`--project-id ${ec(k.id)}`,`--display-name ${ec(k.displayName)}`,`--agent ${ec(k.agent||"claude-code")}`,`--ide ${ec(f.ide)}`,`--markdown-editor ${ec(f.markdownEditor)}`],k.repo.trim().length>0&&j.push(`--repo ${ec(k.repo.trim())}`),k.defaultBranch.trim().length>0&&j.push(`--default-branch ${ec(k.defaultBranch.trim())}`),k.agentModel.trim().length>0&&j.push(`--model ${ec(k.agentModel.trim())}`),k.agentReasoningEffort.trim().length>0&&j.push(`--reasoning-effort ${ec(k.agentReasoningEffort.trim())}`),k.defaultWorkingDirectory.trim().length>0&&j.push(`--default-working-directory ${ec(k.defaultWorkingDirectory.trim())}`),j.join(" ")):"";async function tS(e,t){let a,s;if(!tj||r)return!1;let n=await b((a=ex?eg??es[0]?.id??"abstract-sound-4":null,s=K.split(/\n+/g).map(e=>e.trim()).filter(Boolean),{onboardingAcknowledged:!!e||l.onboardingAcknowledged,codingAgent:_.trim(),ide:T.trim(),markdownEditor:q.trim(),markdownEditorPath:(Y??"").trim(),filesystemBrowseRoots:s,allowHomeBrowse:ee,modelAccess:el,notifications:{soundEnabled:ex,soundFile:a}}),t);return n&&t?.openAgentSetup!==!1&&tf&&!tf.ready&&u(_),n}async function tA(){if(!eN){if(!tb){if(!await tS(!0,{closeDialog:!0}))return;m?.({needsProject:0===o});return}await tS(!1,{closeDialog:!1})&&H("repositories")}}async function tR(){(!tm||await tt())&&await tS(!0,{closeDialog:!0})&&m?.({needsProject:!1})}async function tH(){await tS(!0,{closeDialog:!0,openAgentSetup:!1})&&m?.({needsProject:!1})}return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s.bL,{open:e,onOpenChange:e=>{e||e8||"onboarding"===t||eO||eI||eG||h()},children:(0,a.jsxs)(s.ZL,{children:[(0,a.jsx)(s.hJ,{className:`fixed ${M.Rn} z-[89] bg-black/70`}),(0,a.jsxs)(s.UC,{className:`fixed ${M.Rn} z-[90] flex items-start justify-center overflow-hidden px-0 py-0 outline-none sm:items-center sm:overflow-y-auto sm:px-3 sm:py-6`,onOpenAutoFocus:()=>{(0,Z.e7)(A)},onCloseAutoFocus:e=>{(0,Z.AI)(A,e)},onEscapeKeyDown:e=>{(e8||"onboarding"===t||eO||eI||eG)&&e.preventDefault()},onPointerDownOutside:e=>{(e8||"onboarding"===t||eO||eI||eG)&&e.preventDefault()},children:[(0,a.jsx)(s.VY,{className:"sr-only",children:"Review and update dashboard preferences, repository defaults, and organization settings."}),(0,a.jsxs)("div",{className:`flex ${M.yq} ${M.w1} w-full flex-col overflow-hidden border-[var(--vk-border)] bg-[var(--vk-bg-panel)] shadow-[0_24px_80px_rgba(0,0,0,0.55)] sm:h-[min(90vh,820px)] sm:max-w-[1180px] sm:rounded-[6px] sm:border sm:flex-row`,children:[(0,a.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,a.jsx)("header",{className:"border-b border-[var(--vk-border)] px-4 py-3 sm:py-4",children:(0,a.jsx)(s.hE,{asChild:!0,children:(0,a.jsx)("h2",{id:"settings-dialog-title",className:"text-[22px] leading-[24px] text-[var(--vk-text-strong)] sm:text-[27px] sm:leading-[27px]",children:ti?"Setup":"Settings"})})}),(0,a.jsx)("nav",{className:"-mx-0.5 flex gap-1 overflow-x-auto px-2 py-2 sm:mx-0 sm:block sm:space-y-1 sm:overflow-auto sm:px-2",children:tl.map(e=>{let t=e.icon,r=to.id===e.id;return(0,a.jsxs)("button",{type:"button",onClick:()=>H(e.id),disabled:e8,className:`flex min-h-[44px] shrink-0 items-center gap-3 rounded-[3px] px-3 py-2 text-left text-[14px] leading-[21px] transition-colors sm:min-h-0 sm:w-full ${r?"bg-[color:color-mix(in_srgb,var(--vk-accent)_12%,transparent)] text-[var(--vk-accent)]":"text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]"} disabled:opacity-50`,children:[(0,a.jsx)(t,{className:"h-4 w-4 shrink-0"}),(0,a.jsx)("span",{children:e.label})]},e.id)})})]}),(0,a.jsxs)("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[(0,a.jsxs)("header",{className:"flex items-center justify-between border-b border-[var(--vk-border)] px-4 py-3 sm:py-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-[20px] leading-[24px] text-[var(--vk-text-strong)] sm:text-[27px] sm:leading-[27px]",children:ti?td?"Choose your preferences":"Review repository defaults":to.label}),ti&&(0,a.jsxs)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:["Step ",th," of ",tl.length]})]}),(0,a.jsx)("button",{type:"button",onClick:h,disabled:e8||"onboarding"===t,"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,a.jsx)(y.A,{className:"h-4 w-4"})})]}),(0,a.jsx)("div",{className:"min-h-0 flex-1 overflow-auto px-4 py-3 pb-8 sm:px-6 sm:py-4 sm:pb-8",children:tv?(0,a.jsxs)("div",{className:"space-y-5",children:[ti&&(0,a.jsx)("section",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[color:color-mix(in_srgb,var(--vk-accent)_10%,transparent)] px-4 py-3",children:(0,a.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 terminals and boards immediately."})}),(td||tp)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("section",{className:"space-y-2",children:[(0,a.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Choose Your Coding Agent"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Select the default coding agent, review its setup state, and confirm which models Conductor can offer for it."}),(0,a.jsx)("div",{className:"grid gap-3 lg:grid-cols-2",children:tk.map(e=>{let t=_===e,r=x[(0,P.q)(e)]??null,s=ei(e,el),n=(0,W.Ik)(e,el,p),l=n.slice(0,3),o=n.length-l.length,i=(0,F.f)(r),c=(0,F.y)(s);return(0,a.jsxs)("div",{className:`flex min-h-full flex-col gap-3 rounded-[4px] border px-3 py-3 text-left ${t?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[(0,a.jsx)(D.N,{seed:{label:e},className:"mt-0.5 h-5 w-5 border-none bg-transparent"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-[13px] font-medium text-[var(--vk-text-normal)]",children:J(e)}),(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:i}),c?(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:c}):null]}),(0,a.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:r?.description??(0,U.h7)(e)?.description??"Agent metadata not available."}),(0,a.jsxs)("div",{className:"mt-2 flex flex-wrap gap-1.5",children:[l.map(t=>(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 py-0.5 text-[11px] text-[var(--vk-text-normal)]",children:t.label},`${e}-${t.id}`)),o>0?(0,a.jsxs)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:["+",o," more"]}):null,0===l.length?(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:(0,d.Zz)(e)?"Models appear after setup":"Uses the agent default model"}):null]}),!r?.installed&&r?.installHint?(0,a.jsxs)("p",{className:"mt-2 text-[11px] text-[var(--vk-text-muted)]",children:["Install hint: ",(0,a.jsx)("code",{className:"rounded bg-[var(--vk-bg-main)] px-1.5 py-0.5 text-[11px] text-[var(--vk-text-normal)]",children:r.installHint})]}):null]})]}),(0,a.jsxs)("div",{className:"mt-auto flex shrink-0 items-center gap-2 self-start",children:[r?.ready?null:(0,a.jsx)("button",{type:"button",onClick:()=>{O(e),u(e)},className:"inline-flex h-8 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-orange)] hover:bg-[var(--vk-bg-panel)]",children:r?.installed?"Authenticate":"Install"}),(0,a.jsx)("button",{type:"button",onClick:()=>O(e),className:`inline-flex h-8 items-center rounded-[4px] border px-3 text-[12px] ${t?"border-[var(--vk-orange)] bg-[var(--vk-orange)]/12 text-[var(--vk-orange)]":"border-[var(--vk-border)] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-panel)]"}`,children:t?"Selected":"Use this agent"}),t&&(0,a.jsx)(N.A,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]})]},e)})})]}),(0,a.jsxs)("section",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Model Access"}),(0,a.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,a.jsx)("div",{className:"grid gap-3",children:tk.filter(e=>{let t=(0,d.yM)(e);return(0,d.Zz)(e)&&(t?.accessOptions.length??0)>1}).map(e=>{let t=(0,d.yM)(e);if(!t)return null;let r=(0,d.Tk)(e,el)??t.defaultAccess;return(0,a.jsxs)("label",{className:"block rounded-[4px] border border-[var(--vk-border)] px-3 py-3",children:[(0,a.jsx)("span",{className:"mb-1 block text-[13px] font-medium text-[var(--vk-text-normal)]",children:t.label}),(0,a.jsx)("select",{value:r,onChange:t=>{var r;let a;return r=t.target.value,void((a=(0,d.yM)(e))&&ed(e=>({...e,[a.accessKey]:r})))},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:t.accessOptions.map(e=>(0,a.jsx)("option",{value:e.id,children:e.label},e.id))}),(0,a.jsx)("p",{className:"mt-1.5 text-[11px] text-[var(--vk-text-muted)]",children:t.accessOptions.find(e=>e.id===r)?.description})]},e)})})]})]}),(td||tx)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("section",{className:"space-y-2",children:[(0,a.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Markdown Editor"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Used as your second-brain markdown source when feeding context into tasks."}),(0,a.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:ea.map(e=>{let t=q===e.id;return(0,a.jsxs)("button",{type:"button",onClick:()=>G(e.id),className:`flex items-center gap-2 rounded-[4px] border px-3 py-2 text-left ${t?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsx)(ep,{editorId:e.id}),(0,a.jsx)("span",{className:"flex-1 text-[13px] text-[var(--vk-text-normal)]",children:e.label}),t&&(0,a.jsx)(N.A,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]},e.id)})}),"notion"!==q&&(0,a.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] px-3 py-3",children:(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Notes Root"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{value:Y??"",readOnly:!0,onClick:()=>eq(!0),placeholder:"Select your Obsidian vault, Logseq graph, or notes 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,a.jsx)("button",{type:"button",onClick:()=>eq(!0),disabled:e8,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:"Browse folders",children:(0,a.jsx)(w.A,{className:"h-4 w-4"})}),(Y??"").trim().length>0&&(0,a.jsx)("button",{type:"button",onClick:()=>X(""),disabled:e8,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:"Clear"})]}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Context attachments are discovered from this folder first. Leave it blank to fall back to the current workspace."})]})}),(0,a.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] px-3 py-3",children:(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Extra Filesystem Roots"}),(0,a.jsx)("textarea",{value:K,onChange:e=>Q(e.target.value),placeholder:"One absolute path per line\n/Applications\n/Users/Shared\n/mnt/projects",rows:5,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,a.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>ez(!0),disabled:e8,className:"inline-flex h-9 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-60",children:[(0,a.jsx)(w.A,{className:"h-4 w-4"}),"Add folder"]}),(0,a.jsx)("button",{type:"button",onClick:()=>Q(""),disabled:e8||0===K.trim().length,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:"Clear list"})]}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Conductor exposes the current workspace, configured project roots, and any extra roots listed here by default. Add another root only when the operator folder picker should expose that explicit location on this machine."})]})}),(0,a.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] px-3 py-3",children:(0,a.jsxs)("label",{className:"flex items-start gap-3",children:[(0,a.jsx)("input",{type:"checkbox",checked:ee,onChange:e=>en(e.target.checked),className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent"}),(0,a.jsxs)("span",{className:"block",children:[(0,a.jsx)("span",{className:"block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Allow full home-directory browse"}),(0,a.jsx)("span",{className:"mt-1 block text-[12px] text-[var(--vk-text-muted)]",children:"Off by default. Enable this only when operator or admin sessions need to browse the full local home directory. Viewer sessions never get this access."}),(0,a.jsxs)("span",{className:"mt-1 block text-[11px] text-[var(--vk-text-dim)]",children:["Saved as ",(0,a.jsx)("code",{children:"preferences.allowHomeBrowse"})," in ",(0,a.jsx)("code",{children:"conductor.yaml"}),"."]})]})]})})]}),(0,a.jsxs)("section",{className:"space-y-2",children:[(0,a.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Notification Sound"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Pick a sound for notifications, or disable sound."}),(0,a.jsxs)("div",{className:"grid gap-2 sm:grid-cols-2",children:[es.map(e=>{let t=ex&&eg===e.id;return(0,a.jsxs)("button",{type:"button",onClick:()=>{em(!0),ek(e.id),(0,L.$E)(e.id)},className:`flex items-center gap-2 rounded-[4px] border px-3 py-2 text-left ${t?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsx)(E.A,{className:"h-4 w-4 text-[var(--vk-text-muted)]"}),(0,a.jsx)("span",{className:"flex-1 text-[13px] text-[var(--vk-text-normal)]",children:e.label}),t&&(0,a.jsx)(N.A,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]},e.id)}),(0,a.jsxs)("button",{type:"button",onClick:()=>em(!1),className:`flex items-center gap-2 rounded-[4px] border px-3 py-2 text-left ${!ex?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsx)($.A,{className:"h-4 w-4 text-[var(--vk-text-muted)]"}),(0,a.jsx)("span",{className:"flex-1 text-[13px] text-[var(--vk-text-normal)]",children:"No sound"}),!ex&&(0,a.jsx)(N.A,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]})]})]})]})]}):tc?(0,a.jsx)(z,{profile:e0,loading:e2,error:e4,onRefresh:()=>{ta()}}):tm?(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsxs)("section",{className:"space-y-1",children:[(0,a.jsx)("h4",{className:"text-[24px] leading-[24px] text-[var(--vk-text-strong)]",children:ti?"Repository Defaults":"Repository Configuration"}),(0,a.jsx)("p",{className:"text-[14px] text-[var(--vk-text-muted)]",children:ti?"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"===t||ef.length>1)&&(0,a.jsxs)("section",{className:"space-y-2",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Select Repository"}),(0,a.jsxs)("select",{value:eR,onChange:e=>eH(e.target.value),disabled:eN||0===ef.length||e8,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===ef.length&&(0,a.jsx)("option",{value:"",children:"No repositories configured"}),ef.map(e=>(0,a.jsx)("option",{value:e.id,children:e.displayName},e.id))]})]}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Select a repository to view and edit its configuration."}),eN&&(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Loading repositories..."})]}),ti&&1===ef.length&&eE&&(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Detected Repository"}),(0,a.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:[eE.displayName,(0,a.jsx)("span",{className:"ml-2 text-[var(--vk-text-muted)]",children:eE.path})]})]}),eE&&(0,a.jsxs)(a.Fragment,{children:["settings"===t&&(0,a.jsxs)("section",{className:"space-y-3 border-t border-[var(--vk-border)] pt-4",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h5",{className:"text-[22px] leading-[22px] text-[var(--vk-text-strong)]",children:"Repo-Preseed Bootstrap"}),(0,a.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 --yes --registry=https://registry.npmjs.org conductor-oss@latest`, which opens the dashboard and lets the user choose preferences before adding a project."})]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 text-[11px] text-[var(--vk-text-muted)]",children:[(0,a.jsxs)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1",children:["Workspace: ",eE.workspaceMode]}),(0,a.jsxs)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1",children:["Runtime: ",eE.runtimeMode]}),(0,a.jsxs)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1",children:["SCM: ",eE.scmMode]})]}),(0,a.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[rgba(15,15,15,0.72)] p-3",children:(0,a.jsx)("pre",{className:"overflow-x-auto whitespace-pre-wrap break-all text-[12px] leading-5 text-[var(--vk-text-normal)]",children:tC})}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,a.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,a.jsx)(eh,{value:tC,idleLabel:"Copy Setup Command"})]})]}),(0,a.jsxs)("section",{className:"space-y-3 border-t border-[var(--vk-border)] pt-4",children:[(0,a.jsx)("h5",{className:"text-[22px] leading-[22px] text-[var(--vk-text-strong)]",children:"General Settings"}),(0,a.jsx)("p",{className:"text-[13px] text-[var(--vk-text-muted)]",children:"Configure basic repository information."}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Display Name"}),(0,a.jsx)("input",{value:eE.displayName,onChange:e=>e$(t=>t?{...t,displayName:e.target.value}:t),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,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"A friendly name for this repository."})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Repository Slug"}),(0,a.jsx)("input",{value:eE.repo,onChange:e=>e$(t=>t?{...t,repo:e.target.value}:t),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,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Used for PR tracking, GitHub links, and onboarding defaults."})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Agent"}),(0,a.jsx)("select",{value:eE.agent,onChange:e=>{let t=e.target.value;e$(e=>e?{...e,agent:t}:e),eU((0,W.c0)(t,el,p,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:tk.map(e=>(0,a.jsx)("option",{value:e,children:J(e)},e))}),(0,a.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,d.Zz)(eE.agent)&&(0,a.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] px-3 py-3",children:(0,a.jsx)(ev,{agent:eE.agent,modelAccess:el,runtimeModelCatalogs:p,selection:eP,onChange:eU})}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Agent Permission Default"}),(0,a.jsxs)("select",{value:eE.agentPermissions,onChange:e=>e$(t=>t?{...t,agentPermissions:"skip"===e.target.value?"skip":"default"}:t),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:[(0,a.jsx)("option",{value:"default",children:"Agent default (approval prompts when supported)"}),(0,a.jsx)("option",{value:"skip",children:"Automatic mode (bypasses agent approval prompts)"})]}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Applies to new sessions for this repository. Automatic mode grants the selected agent broad local execution authority and should only be used in trusted workspaces."})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Repository Path"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{value:eE.path,readOnly:!0,onClick:()=>eT(!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,a.jsx)("button",{type:"button",onClick:()=>eT(!0),disabled:e8,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,a.jsx)(w.A,{className:"h-4 w-4"})})]}),!eE.pathHealth.exists&&(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-red)]",children:"Configured path does not exist on disk."}),eE.pathHealth.exists&&!eE.pathHealth.isGitRepository&&(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-red)]",children:"Configured path exists but is not a git repository."}),eE.pathHealth.suggestedPath&&(0,a.jsx)("button",{type:"button",onClick:()=>{let e=eE.pathHealth.suggestedPath??"";e&&(e$(t=>t?{...t,path:e,pathHealth:{...t.pathHealth,exists:!0,isGitRepository:!0,suggestedPath:null}}:t),te(e))},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,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Working Directory"}),(0,a.jsx)("input",{value:eE.defaultWorkingDirectory,onChange:e=>e$(t=>t?{...t,defaultWorkingDirectory:e.target.value}:t),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,a.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,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Target Branch"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{value:eE.defaultBranch,onChange:e=>e$(t=>t?{...t,defaultBranch:e.target.value}:t),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,a.jsx)("button",{type:"button",onClick:()=>{te()},disabled:eL,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:eL?(0,a.jsx)(C.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsx)(S.A,{className:"h-3.5 w-3.5"})})]}),eD.length>0&&(0,a.jsx)("select",{value:eE.defaultBranch,onChange:e=>e$(t=>t?{...t,defaultBranch:e.target.value}:t),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:eD.map(e=>(0,a.jsx)("option",{value:e,children:e},e))}),eM&&(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-red)]",children:eM})]})]}),"settings"===t&&(0,a.jsxs)("section",{className:"space-y-3 border-t border-[var(--vk-border)] pt-4",children:[(0,a.jsx)("h5",{className:"text-[22px] leading-[22px] text-[var(--vk-text-strong)]",children:"Scripts & Configuration"}),(0,a.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,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Dev Server Script"}),(0,a.jsx)("textarea",{rows:3,value:eE.devServerScript,onChange:e=>e$(t=>t?{...t,devServerScript:e.target.value}:t),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,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Optional. Leave this blank if you run the local app yourself and only want Conductor to auto-connect the preview."})]}),(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Dev Server CWD"}),(0,a.jsx)("input",{value:eE.devServerCwd,onChange:e=>e$(t=>t?{...t,devServerCwd:e.target.value}:t),placeholder:"e.g., apps/web",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,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Runs the dev server from this subdirectory when set."})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Preview URL Override"}),(0,a.jsx)("input",{value:eE.devServerUrl,onChange:e=>e$(t=>t?{...t,devServerUrl:e.target.value}:t),placeholder:"e.g., https://preview.example.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)]"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"If set, preview connects here first instead of inferring from logs."})]})]}),(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-4",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Preview Port"}),(0,a.jsx)("input",{value:eE.devServerPort,onChange:e=>e$(t=>t?{...t,devServerPort:e.target.value}:t),inputMode:"numeric",placeholder:"3000",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,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Preview Host"}),(0,a.jsx)("input",{value:eE.devServerHost,onChange:e=>e$(t=>t?{...t,devServerHost:e.target.value}:t),placeholder:"127.0.0.1",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,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Preview Path"}),(0,a.jsx)("input",{value:eE.devServerPath,onChange:e=>e$(t=>t?{...t,devServerPath:e.target.value}:t),placeholder:"/",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,a.jsxs)("label",{className:"flex items-center gap-2 rounded-[4px] border border-[var(--vk-border)] px-3 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsx)("input",{type:"checkbox",checked:eE.devServerHttps,onChange:e=>e$(t=>t?{...t,devServerHttps:e.target.checked}:t),className:"h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,a.jsx)("span",{children:"Use HTTPS"})]})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Setup Script"}),(0,a.jsx)("textarea",{rows:4,value:eE.setupScript,onChange:e=>e$(t=>t?{...t,setupScript:e.target.value}:t),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,a.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,a.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,a.jsx)("input",{type:"checkbox",checked:eE.runSetupInParallel,onChange:e=>e$(t=>t?{...t,runSetupInParallel:e.target.checked}:t),className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,a.jsx)("span",{children:"Run setup script in parallel with coding agent"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Cleanup Script"}),(0,a.jsx)("textarea",{rows:4,value:eE.cleanupScript,onChange:e=>e$(t=>t?{...t,cleanupScript:e.target.value}:t),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,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Archive Script"}),(0,a.jsx)("textarea",{rows:4,value:eE.archiveScript,onChange:e=>e$(t=>t?{...t,archiveScript:e.target.value}:t),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,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Copy Files"}),(0,a.jsx)("input",{value:eE.copyFiles,onChange:e=>e$(t=>t?{...t,copyFiles:e.target.value}:t),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,a.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."})]})]})]})]}):tu?(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsxs)("section",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[color:color-mix(in_srgb,var(--vk-accent)_8%,transparent)] px-4 py-3",children:[(0,a.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Access Control"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"The dashboard stays bound to localhost by default. If you need access beyond the local machine, put a verified identity layer like Cloudflare Access or Clerk in front of it, then map authenticated users into viewer, operator, or admin roles here."})]}),eV?(0,a.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,a.jsx)(C.A,{className:"h-4 w-4 animate-spin"}),"Loading organization access settings..."]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("section",{className:"grid gap-3 lg:grid-cols-3",children:[(0,a.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Current Identity"}),(0,a.jsx)("p",{className:"mt-2 text-[14px] text-[var(--vk-text-normal)]",children:eW.current.email??"Anonymous local session"})]}),(0,a.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Effective Role"}),(0,a.jsx)("p",{className:"mt-2 text-[14px] text-[var(--vk-text-normal)]",children:eW.current.role??"No access"})]}),(0,a.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Auth Provider"}),(0,a.jsx)("p",{className:"mt-2 text-[14px] text-[var(--vk-text-normal)]",children:eW.current.provider??"Local only"})]})]}),!tg&&(0,a.jsx)("section",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[rgba(80,80,80,0.18)] px-4 py-3",children:(0,a.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 a local admin session or an admin identity from your edge auth provider to modify access rules."})}),(0,a.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h5",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Baseline Access Rules"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Require authentication for remote dashboard requests and decide what authenticated users get by default before explicit role bindings are applied. Localhost on this machine stays in a local admin recovery mode so setup and break-glass access keep working."})]}),(0,a.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,a.jsx)("input",{type:"checkbox",checked:eW.requireAuth,onChange:e=>eZ(t=>({...t,requireAuth:e.target.checked})),disabled:!tg||eY||eW.trustedHeaders.enabled,className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,a.jsx)("span",{children:"Require authentication for remote dashboard requests"})]}),(0,a.jsx)("p",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-2 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Unauthenticated public dashboard access is not supported. Use a verified identity provider such as Cloudflare Access or Clerk before exposing the dashboard beyond localhost."}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Role"}),(0,a.jsxs)("select",{value:eW.defaultRole,onChange:e=>eZ(t=>({...t,defaultRole:e.target.value})),disabled:!tg||eY,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,a.jsx)("option",{value:"viewer",children:"Viewer"}),(0,a.jsx)("option",{value:"operator",children:"Operator"}),(0,a.jsx)("option",{value:"admin",children:"Admin"})]}),(0,a.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. Cloudflare Access enterprise mode forces full authentication automatically."})]})]}),(0,a.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h5",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Verified Edge Auth"}),(0,a.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,a.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,a.jsx)("input",{type:"checkbox",checked:eW.trustedHeaders.enabled,onChange:e=>eZ(t=>({...t,requireAuth:!!e.target.checked||t.requireAuth,trustedHeaders:{...t.trustedHeaders,enabled:e.target.checked}})),disabled:!tg||eY,className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,a.jsx)("span",{children:"Enable verified Cloudflare Access authentication"})]}),(0,a.jsxs)("div",{className:"grid gap-3 lg:grid-cols-2",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Provider"}),(0,a.jsx)("div",{className:"flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)]",children:"Cloudflare Access (verified JWT)"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Identity Email Header"}),(0,a.jsx)("input",{value:eW.trustedHeaders.emailHeader,onChange:e=>eZ(t=>({...t,trustedHeaders:{...t.trustedHeaders,emailHeader:e.target.value}})),disabled:!tg||eY,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,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"JWT Assertion Header"}),(0,a.jsx)("input",{value:eW.trustedHeaders.jwtHeader,onChange:e=>eZ(t=>({...t,trustedHeaders:{...t.trustedHeaders,jwtHeader:e.target.value}})),disabled:!tg||eY,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,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Cloudflare Team Domain"}),(0,a.jsx)("input",{value:eW.trustedHeaders.teamDomain,onChange:e=>eZ(t=>({...t,trustedHeaders:{...t.trustedHeaders,teamDomain:e.target.value}})),disabled:!tg||eY,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,a.jsxs)("label",{className:"block lg:col-span-2",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Cloudflare Access Audience"}),(0,a.jsx)("input",{value:eW.trustedHeaders.audience,onChange:e=>eZ(t=>({...t,trustedHeaders:{...t.trustedHeaders,audience:e.target.value}})),disabled:!tg||eY,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"})]})]}),(0,a.jsx)("p",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-2 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Verified public dashboard access requires a Cloudflare Access application that injects a signed JWT and identity email header. Conductor will not trust a public request path when that verification layer is missing."})]}),(0,a.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h5",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Role Bindings"}),(0,a.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,a.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:e,key:t,placeholder:r})=>(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:e}),(0,a.jsx)("textarea",{rows:4,value:eW.roles[t],onChange:e=>eZ(r=>({...r,roles:{...r.roles,[t]:e.target.value}})),disabled:!tg||eY,placeholder:r,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,a.jsx)("p",{className:"mt-1 text-[11px] text-[var(--vk-text-muted)]",children:"One entry per line."})]},t))})]})]})]}):(0,a.jsxs)("section",{className:"space-y-3",children:[(0,a.jsx)("h4",{className:"text-[16px] font-medium text-[var(--vk-text-strong)]",children:to.label}),(0,a.jsx)("p",{className:"text-[14px] text-[var(--vk-text-muted)]",children:"This section is queued for implementation. General, Agents, and repository settings are available now."}),(0,a.jsx)("button",{type:"button",onClick:()=>H("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,a.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,a.jsxs)("div",{className:"min-w-0",children:[tw&&(0,a.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:tw}),!tw&&tv&&(0,a.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:ti?"Finish setup once here. You can change these preferences any time from Settings.":"Preferences are saved to your conductor config and applied immediately."}),!tw&&tm&&(0,a.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:ti?"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."}),!tw&&tu&&(0,a.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."}),!tw&&tc&&(0,a.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:"Profile details reflect the current dashboard identity. GitHub avatar and logout controls appear when this session is authenticated through Clerk."})]}),(0,a.jsxs)("div",{className:"flex w-full flex-wrap items-center justify-end gap-2 sm:w-auto",children:[!ti&&(0,a.jsx)("button",{type:"button",onClick:h,disabled:e8,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"}),ti&&tm&&(0,a.jsx)("button",{type:"button",onClick:()=>H("preferences"),disabled:e8,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"}),tv&&!ti&&(0,a.jsx)("button",{type:"button",onClick:()=>{tS(l.onboardingAcknowledged,{closeDialog:!0})},disabled:!tj||r,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:r?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(C.A,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Saving..."]}):"Save"}),tm&&!ti&&(0,a.jsx)("button",{type:"button",onClick:()=>{tt()},disabled:!tN||ew||eN,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:ew?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(C.A,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Saving..."]}):"Save Repository"}),tu&&!ti&&(0,a.jsx)("button",{type:"button",onClick:()=>{ts()},disabled:!ty||eY,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:eY?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(C.A,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Saving..."]}):"Save Access"}),ti&&(0,a.jsx)("button",{type:"button",onClick:()=>{tH()},disabled:!tj||e8,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:"Skip for now"}),ti&&(0,a.jsx)("button",{type:"button",onClick:()=>{td?tA():tR()},disabled:td?!tj||r||eN:!tN||e8,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:e8||td&&eN?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(C.A,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),td&&eN?"Loading...":"Saving..."]}):td&&tb?"Continue":"Finish Setup"})]})]})]})]})]})]})}),(0,a.jsx)(eu,{open:eO,bridgeId:g,initialPath:eE?.path,title:"Select Repository Path",description:"Choose the local git repository folder.",onClose:()=>eT(!1),onSelect:e=>{eT(!1),e&&(e$(t=>t?{...t,path:e,pathHealth:{...t.pathHealth,exists:!0,isGitRepository:!0,suggestedPath:null}}:t),te(e))}}),(0,a.jsx)(eu,{open:eI,bridgeId:g,initialPath:Y??"",title:"Select Notes Root",description:"Choose the local Obsidian vault, Logseq graph, or markdown notes folder used for context attachments.",onClose:()=>eq(!1),onSelect:e=>{eq(!1),null!==e&&X(e)}}),(0,a.jsx)(eu,{open:eG,bridgeId:g,title:"Add Filesystem Root",description:"Choose an extra folder root that should stay visible in the filesystem browser on this machine.",onClose:()=>ez(!1),onSelect:e=>{ez(!1),null!==e&&Q(t=>{let r=t.split(/\n+/g).map(e=>e.trim()).filter(Boolean);return r.includes(e)?r.join("\n"):[...r,e].join("\n")})}})]})}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[88545],{42658:(e,c,r)=>{r.d(c,{a:()=>d});var a=r(5974);let d=(0,a.createServerReference)("00dc8cdac0e5d3191bc163037b775a69c29f4728b9",a.callServer,void 0,a.findSourceMapURL,"createOrReadKeylessAction")},88545:(e,c,r)=>{r.r(c),r.d(c,{createOrReadKeylessAction:()=>a.a,deleteKeylessAction:()=>f,syncKeylessConfigAction:()=>s});var a=r(42658),d=r(5974);let f=(0,d.createServerReference)("00f12dfaa039d850c3157c45f344e7ed41092dcb8e",d.callServer,void 0,d.findSourceMapURL,"deleteKeylessAction"),s=(0,d.createServerReference)("40b9c6f54c08f996dcef07d1492ca6d37daf2f885a",d.callServer,void 0,d.findSourceMapURL,"syncKeylessConfigAction")}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[90036],{816:(e,t,r)=>{r.d(t,{X:()=>l});var a=r(7620),n=r(34908),o=["16","24"],i={16:{width:16,path:a.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:a.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"})}},l=a.forwardRef(function(e,t){return(0,n.r)(e,t,"octicon octicon-lock",i,o)});l.displayName="LockIcon"},3376:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(39789).A)("circle-user",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]])},5029:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(39789).A)("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"}]])},11023:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(39789).A)("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"}]])},28017:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(39789).A)("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"}]])},34703:(e,t,r)=>{r.d(t,{UC:()=>N,VY:()=>z,ZL:()=>Z,bL:()=>M,bm:()=>G,hE:()=>q,hJ:()=>I});var a=r(7620),n=r(37188),o=r(33670),i=r(55556),l=r(30586),c=r(79405),u=r(8955),d=r(60378),s=r(25249),f=r(98386),p=r(78858),h=r(89694),v=r(58009),m=r(86803),g=r(54009),y=r(78347),b=r(54568),w=Object.defineProperty,O=(e,t)=>w(e,"name",{value:t,configurable:!0}),A="Dialog",[j,D]=(0,i.A)(A),[k,x]=j(A),M=O(e=>{let{__scopeDialog:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:u=!0}=e,d=a.useRef(null),s=a.useRef(null),[f,p]=(0,c.i)({prop:n,defaultProp:o??!1,onChange:i,caller:A}),[h,v]=a.useState(0),[m,g]=a.useState(0);return(0,b.jsx)(k,{scope:t,triggerRef:d,contentRef:s,contentId:(0,l.B)(),titleId:(0,l.B)(),descriptionId:(0,l.B)(),titlePresent:h>0,descriptionPresent:m>0,setTitleCount:v,setDescriptionCount:g,open:f,onOpenChange:p,onOpenToggle:a.useCallback(()=>p(e=>!e),[p]),modal:u,children:r})},"Dialog"),C="DialogPortal",[P,E]=j(C,{forceMount:void 0}),Z=O(e=>{let{__scopeDialog:t,forceMount:r,children:n,container:o}=e,i=x(C,t);return(0,b.jsx)(P,{scope:t,forceMount:r,children:a.Children.map(n,e=>(0,b.jsx)(f.C,{present:r||i.open,children:(0,b.jsx)(s.Z,{asChild:!0,container:o,children:e})}))})},"DialogPortal"),R="DialogOverlay",I=a.forwardRef(O(function(e,t){let r=E(R,e.__scopeDialog),{forceMount:a=r.forceMount,...n}=e,o=x(R,e.__scopeDialog);return o.modal?(0,b.jsx)(f.C,{present:a||o.open,children:(0,b.jsx)(F,{...n,ref:t})}):null},"DialogOverlay")),_=(0,y.TL)("DialogOverlay.RemoveScroll"),F=a.forwardRef(O(function(e,t){let{__scopeDialog:r,...a}=e,n=x(R,r),i=(0,u.e0)(),l=(0,o.s)(t,i);return(0,b.jsx)(m.A,{as:_,allowPinchZoom:!0,shards:[n.contentRef],children:(0,b.jsx)(p.sG.div,{"data-state":B(n.open),...a,ref:l,style:{pointerEvents:"auto",...a.style}})})},"DialogOverlayImpl")),H="DialogContent",N=a.forwardRef(O(function(e,t){let r=E(H,e.__scopeDialog),{forceMount:a=r.forceMount,...n}=e,o=x(H,e.__scopeDialog);return(0,b.jsx)(f.C,{present:a||o.open,children:o.modal?(0,b.jsx)(V,{...n,ref:t}):(0,b.jsx)(S,{...n,ref:t})})},"DialogContent")),V=a.forwardRef(O(function(e,t){let r=x(H,e.__scopeDialog),i=a.useRef(null),l=(0,o.s)(t,r.contentRef,i);return a.useEffect(()=>{let e=i.current;if(e)return(0,g.Eq)(e)},[]),(0,b.jsx)(L,{...e,ref:l,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:(0,n.mK)(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:(0,n.mK)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:(0,n.mK)(e.onFocusOutside,e=>e.preventDefault())})},"DialogContentModal")),S=a.forwardRef(O(function(e,t){let r=x(H,e.__scopeDialog),n=a.useRef(!1),o=a.useRef(!1);return(0,b.jsx)(L,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(n.current||r.triggerRef.current?.focus(),t.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(n.current=!0,"pointerdown"===t.detail.originalEvent.type&&(o.current=!0));let a=t.target;r.triggerRef.current?.contains(a)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&o.current&&t.preventDefault()}})},"DialogContentNonModal")),L=a.forwardRef(O(function(e,t){let{__scopeDialog:r,trapFocus:a,onOpenAutoFocus:n,onCloseAutoFocus:o,...i}=e,l=x(H,r);return(0,h.Oh)(),(0,b.jsx)(b.Fragment,{children:(0,b.jsx)(d.n,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:n,onUnmountAutoFocus:o,children:(0,b.jsx)(u.qW,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionPresent?l.descriptionId:void 0,"aria-labelledby":l.titlePresent?l.titleId:void 0,"data-state":B(l.open),...i,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})},"DialogContentImpl")),q=a.forwardRef(O(function(e,t){let{__scopeDialog:r,...a}=e,n=x("DialogTitle",r),{setTitleCount:o}=n;return(0,v.N)(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),(0,b.jsx)(p.sG.h2,{id:n.titleId,...a,ref:t})},"DialogTitle")),z=a.forwardRef(O(function(e,t){let{__scopeDialog:r,...a}=e,n=x("DialogDescription",r),{setDescriptionCount:o}=n;return(0,v.N)(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),(0,b.jsx)(p.sG.p,{id:n.descriptionId,...a,ref:t})},"DialogDescription")),G=a.forwardRef(O(function(e,t){let{__scopeDialog:r,...a}=e,o=x("DialogClose",r);return(0,b.jsx)(p.sG.button,{type:"button",...a,ref:t,onClick:(0,n.mK)(e.onClick,()=>o.onOpenChange(!1))})},"DialogClose"));function B(e){return e?"open":"closed"}O(B,"getState")},34908:(e,t,r)=>{r.d(t,{r:()=>c});var a=r(7620);function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(null,arguments)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)}return r}var i=["aria-hidden","aria-label","aria-labelledby","tabIndex","className","fill","size","verticalAlign","id","title","style"],l={small:16,medium:32,large:64};function c(e,t,r,c,u){var d,s,f=e["aria-hidden"],p=e["aria-label"],h=e["aria-labelledby"],v=e.tabIndex,m=e.className,g=e.fill,y=e.size,b=void 0===y?16:y,w=e.verticalAlign,O=e.id,A=e.title,j=e.style,D=function(e,t){if(null==e)return{};var r,a,n=function(e,t){if(null==e)return{};var r={};for(var a in e)if(({}).hasOwnProperty.call(e,a)){if(-1!==t.indexOf(a))continue;r[a]=e[a]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,i),k=l[b]||b,x=(d=u,s=k,d.map(function(e){return parseInt(e,10)}).reduce(function(e,t){return t<=s?t:e},d[0])),M=c[x].width,C=M/x*k,P=c[x].path,E=p||h,Z=void 0===f?E?void 0:"true":f;return a.createElement("svg",n({ref:t,"data-component":"Octicon"},D,{"aria-hidden":Z,tabIndex:v,focusable:v>=0?"true":"false","aria-label":p,"aria-labelledby":h,className:"".concat(r," ").concat(void 0===m?"":m).trim(),role:E&&"true"!==Z?"img":void 0,viewBox:"0 0 ".concat(M," ").concat(x),width:C,height:k,fill:void 0===g?"currentColor":g,id:O,display:"inline-block",overflow:"visible",style:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach(function(t){var a,n;a=t,n=r[t],(a=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t||"default");if("object"!=typeof a)return a;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(a))in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({verticalAlign:void 0===w?"text-bottom":w},j)}),A?a.createElement("title",null,A):null,P)}},69363:(e,t,r)=>{r.d(t,{C:()=>l});var a=r(7620),n=r(34908),o=["16","24"],i={16:{width:16,path:a.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:a.createElement(a.Fragment,null,a.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"}),a.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"}),a.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"}))}},l=a.forwardRef(function(e,t){return(0,n.r)(e,t,"octicon octicon-git-branch",i,o)});l.displayName="GitBranchIcon"},77233:(e,t,r)=>{r.d(t,{S:()=>l});var a=r(7620),n=r(34908),o=["16","24"],i={16:{width:16,path:a.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:a.createElement(a.Fragment,null,a.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"}),a.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"}))}},l=a.forwardRef(function(e,t){return(0,n.r)(e,t,"octicon octicon-repo",i,o)});l.displayName="RepoIcon"},84661:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(39789).A)("log-out",[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]])},88742:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(39789).A)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]])},97764:(e,t,r)=>{r.d(t,{u:()=>l});var a=r(7620),n=r(34908),o=["16","24"],i={16:{width:16,path:a.createElement("path",{d:"M6.766 11.328c-2.063-.25-3.516-1.734-3.516-3.656 0-.781.281-1.625.75-2.188-.203-.515-.172-1.609.063-2.062.625-.078 1.468.25 1.968.703.594-.187 1.219-.281 1.985-.281.765 0 1.39.094 1.953.265.484-.437 1.344-.765 1.969-.687.218.422.25 1.515.046 2.047.5.593.766 1.39.766 2.203 0 1.922-1.453 3.375-3.547 3.64.531.344.89 1.094.89 1.954v1.625c0 .468.391.734.86.547C13.781 14.359 16 11.53 16 8.03 16 3.61 12.406 0 7.984 0 3.563 0 0 3.61 0 8.031a7.88 7.88 0 0 0 5.172 7.422c.422.156.828-.125.828-.547v-1.25c-.219.094-.5.156-.75.156-1.031 0-1.64-.562-2.078-1.609-.172-.422-.36-.672-.719-.719-.187-.015-.25-.093-.25-.187 0-.188.313-.328.625-.328.453 0 .844.281 1.25.86.313.452.64.655 1.031.655s.641-.14 1-.5c.266-.265.47-.5.657-.656"})},24:{width:24,path:a.createElement("path",{d:"M10.226 17.284c-2.965-.36-5.054-2.493-5.054-5.256 0-1.123.404-2.336 1.078-3.144-.292-.741-.247-2.314.09-2.965.898-.112 2.111.36 2.83 1.01.853-.269 1.752-.404 2.853-.404 1.1 0 1.999.135 2.807.382.696-.629 1.932-1.1 2.83-.988.315.606.36 2.179.067 2.942.72.854 1.101 2 1.101 3.167 0 2.763-2.089 4.852-5.098 5.234.763.494 1.28 1.572 1.28 2.807v2.336c0 .674.561 1.056 1.235.786 4.066-1.55 7.255-5.615 7.255-10.646C23.5 6.188 18.334 1 11.978 1 5.62 1 .5 6.188.5 12.545c0 4.986 3.167 9.12 7.435 10.669.606.225 1.19-.18 1.19-.786V20.63a2.9 2.9 0 0 1-1.078.224c-1.483 0-2.359-.808-2.987-2.313-.247-.607-.517-.966-1.034-1.033-.27-.023-.359-.135-.359-.27 0-.27.45-.471.898-.471.652 0 1.213.404 1.797 1.235.45.651.921.943 1.483.943.561 0 .92-.202 1.437-.719.382-.381.674-.718.944-.943"})}},l=a.forwardRef(function(e,t){return(0,n.r)(e,t,"octicon octicon-mark-github",i,o)});l.displayName="MarkGithubIcon"}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[51063],{31410:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(39789).A)("square-terminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]])},52915:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(39789).A)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},69902:(e,t,s)=>{"use strict";s.d(t,{PublicPageShell:()=>l,PublicPanel:()=>c,PublicSection:()=>o});var a=s(54568),r=s(82175),i=s(54717),n=s(66423),d=s(46916);function l({children:e,className:t}){return(0,a.jsx)(i.x,{children:(0,a.jsx)("main",{className:"overflow-x-hidden overflow-y-auto bg-[var(--bg-canvas)] text-[var(--text-strong)]",style:{height:n.tE},children:(0,a.jsxs)("div",{className:"mx-auto flex min-h-full w-full max-w-6xl flex-col px-6 py-8 sm:px-8 sm:py-10",children:[(0,a.jsxs)("header",{className:"flex items-center gap-3 border-b border-[var(--border-soft)] pb-6",children:[(0,a.jsx)("img",{src:"/icon.svg",alt:"Conductor icon",width:40,height:40,className:"h-10 w-10 rounded-[10px] border border-[var(--border-soft)] bg-[var(--bg-panel)] p-1.5"}),(0,a.jsx)(r.default,{src:"/brand/conductor-wordmark-dark.png",alt:"Conductor",width:320,height:62,priority:!0,className:"h-auto w-[168px] sm:w-[220px]"})]}),(0,a.jsx)("div",{className:(0,d.cn)("flex-1 py-10 sm:py-12",t),children:e})]})})})}function c({children:e,className:t}){return(0,a.jsx)("section",{className:(0,d.cn)("surface-card rounded-[var(--radius-lg)] border border-[var(--border-soft)] bg-[var(--bg-panel)]",t),children:e})}function o({eyebrow:e,title:t,description:s,children:r,className:i}){return(0,a.jsxs)("div",{className:(0,d.cn)("space-y-4",i),children:[e?(0,a.jsx)("p",{className:"text-xs font-semibold uppercase tracking-[0.24em] text-[var(--text-muted)]",children:e}):null,(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("h1",{className:"text-3xl font-semibold tracking-[-0.02em] text-[var(--text-strong)] sm:text-4xl",children:t}),s?(0,a.jsx)("p",{className:"max-w-2xl text-base leading-7 text-[var(--text-muted)] sm:text-lg",children:s}):null]}),r]})}},82767:(e,t,s)=>{Promise.resolve().then(s.t.bind(s,65587,23)),Promise.resolve().then(s.bind(s,69902)),Promise.resolve().then(s.bind(s,91591))},91591:(e,t,s)=>{"use strict";s.d(t,{default:()=>L});var a=s(54568),r=s(7620),i=s(65587),n=s.n(i),d=s(25010),l=s(94110),c=s(38874),o=s(31410),m=s(56961),x=s(61201),v=s(52915),h=s(37812),p=s(2937),u=s(54314),g=s(93035),b=s(13932),f=s(15321),j=s(63582),k=s(69902),w=s(61782),N=s(76081),y=s(66423),_=s(44522),C=s(11984),$=s(46916),A=s(26167),S=s(61369),I=s(31404),E=s(15115),R=s(77522);function z(e){return`${e.hostname} \xb7 ${e.os}/${e.arch}${(0,E.wj)(e.last_status?.version)}`}function U({children:e,className:t,id:s}){return(0,a.jsx)("section",{id:s,className:(0,$.cn)("rounded-[24px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] p-6","shadow-[0_18px_36px_rgba(0,0,0,0.2)]",t),children:e})}function M({children:e}){return(0,a.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-[0.24em] text-[var(--vk-text-muted)]",children:e})}function O({children:e}){return(0,a.jsx)("div",{className:"rounded-full border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-3 py-1.5 text-xs text-[var(--vk-text-muted)]",children:e})}function P({title:e,description:t,command:s,children:r,footer:i}){return(0,a.jsxs)("div",{className:"rounded-[20px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-5",children:[(0,a.jsx)("h3",{className:"text-base font-semibold text-[var(--vk-text-strong)]",children:e}),(0,a.jsx)("p",{className:"mt-2 text-sm leading-6 text-[var(--vk-text-muted)]",children:t}),r,(0,a.jsx)("pre",{className:"mt-4 overflow-x-auto whitespace-pre-wrap break-all rounded-[16px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-4 py-3 font-mono text-sm leading-6 text-[var(--vk-text-normal)]",children:s}),i?(0,a.jsx)("div",{className:"mt-4 flex flex-wrap gap-2",children:i}):null]})}function L({initialClaimToken:e=null,initialSelectedDeviceId:t=null,dashboardUrl:s,relayUrl:i,installScriptUrl:T,installPowerShellUrl:F}){let[B,W]=(0,r.useState)([]),[q,D]=(0,r.useState)(null),[G,J]=(0,r.useState)(null),[V,Y]=(0,r.useState)(!0),[H,K]=(0,r.useState)(!1),[Q,X]=(0,r.useState)(null),[Z,ee]=(0,r.useState)(null),[et,es]=(0,r.useState)(null),[ea,er]=(0,r.useState)(!1),[ei,en]=(0,r.useState)(!1),[ed,el]=(0,r.useState)(null),[ec,eo]=(0,r.useState)(null),[em,ex]=(0,r.useState)(e?"pending":"idle"),[ev,eh]=(0,r.useState)(!1),[ep,eu]=(0,r.useState)("unix"),[eg,eb]=(0,r.useState)(null),[ef,ej]=(0,r.useState)(null),[ek,ew]=(0,r.useState)(null),[eN,ey]=(0,r.useState)(t),[e_,eC]=(0,r.useState)({deviceId:null,phase:"idle",message:null}),[e$,eA]=(0,r.useState)({deviceId:null,kind:null,status:"idle",message:null}),eS=(0,r.useRef)(new Set),eI=!!i?.trim(),eE="windows"===ep?F:T,eR=(0,r.useMemo)(()=>(0,S.$y)(eE,s,i,ep),[s,i,eE,ep]),ez=(0,r.useMemo)(()=>(0,S.G7)(eE,ep),[eE,ep]),eU=(0,r.useMemo)(()=>(0,S.hI)(s,i,ep),[s,i,ep]),eM=(0,r.useMemo)(()=>(0,S.zd)(q,i,ep),[q,i,ep]),eO=B.filter(e=>e.connected),eP=(0,r.useMemo)(()=>ef?B.find(e=>e.device_id===ef.deviceId)??null:null,[ef,B]),eL=(0,r.useMemo)(()=>ek?B.find(e=>e.device_id===ek)??null:null,[B,ek]),eT=(0,r.useMemo)(()=>B.find(e=>e.device_id===eN)??eP??eL??eO[0]??B[0]??null,[eP,eO,B,eL,eN]),eF=(0,r.useMemo)(()=>(0,S.Y8)(eT?.os),[eT?.os]),eB="windows"===eF?F:T,eW=(0,r.useMemo)(()=>(0,S.$y)(eB,s,i,eF),[s,F,T,i,eF,eB]),eq=(0,r.useMemo)(()=>(0,S.hI)(s,i,eF),[s,i,eF]),eD=(0,r.useMemo)(()=>(eP?.connected?eP:null)??(eL?.connected?eL:null)??(eT?.connected?eT:null)??eO[0]??null,[eP,eO,eL,eT]),eG=eD?`/?bridge=${encodeURIComponent(eD.device_id)}`:null,eJ=eT?(0,S.kw)(eT.device_id):null,eV=!!eT&&"running"===e$.status&&e$.deviceId===eT?.device_id,eY=eV&&"repair"===e$.kind,eH=eV&&"restart"===e$.kind,eK=!!eT&&(e$.deviceId===eT?.device_id&&(0,C.Az)(e$.message)||e_.deviceId===eT?.device_id&&(0,C.Az)(e_.message));(0,r.useEffect)(()=>{"u">typeof navigator&&eu(navigator.userAgent.toLowerCase().includes("windows")?"windows":"unix")},[]),(0,r.useEffect)(()=>{ey(e=>e&&(0===B.length||B.some(t=>t.device_id===e))?e:t&&(0===B.length||B.some(e=>e.device_id===t))?t:eP?.device_id??eL?.device_id??eO[0]?.device_id??B[0]?.device_id??null)},[eP,eO,B,t,eL]),(0,r.useEffect)(()=>{let e=()=>{ew((0,_.Tr)()?.deviceId??null)};return e(),window.addEventListener("focus",e),window.addEventListener("storage",e),()=>{window.removeEventListener("focus",e),window.removeEventListener("storage",e)}},[]);let eQ=(0,r.useCallback)(async()=>{if(!eI){Y(!1),W([]),es(null);return}Y(!0);try{let e=await fetch("/api/bridge/devices",{cache:"no-store"}),t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Failed to load devices (${e.status})`);W((0,E.oH)(t?.devices)),es(null)}catch(e){W([]),es(e instanceof Error?e.message:"Failed to load paired devices.")}finally{Y(!1)}},[eI]),eX=(0,r.useCallback)(async()=>{if(e){if(!eI){ex("idle"),eb("Bridge relay URL is not configured.");return}ex("pending"),eb(null);try{let t=await fetch("/api/bridge/devices/claims/complete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({claim_token:e})}),s=await t.json().catch(()=>null);if(!t.ok||!s?.paired||!s.device_id||!s.device_name)throw Error(s?.error??`Failed to pair this laptop (${t.status})`);ej({deviceId:s.device_id,deviceName:s.device_name}),(0,_.m7)({deviceId:s.device_id,deviceName:s.device_name}),ew(s.device_id),ex("paired"),await eQ()}catch(e){ex("idle"),eb(e instanceof Error?e.message:"Failed to complete the laptop claim.")}}},[e,eI,eQ]);async function eZ(){if(!eI)return void es("Bridge relay URL is not configured.");K(!0),ee(null);try{let e=await fetch("/api/bridge/devices/code",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})}),t=await e.json().catch(()=>null);if(!e.ok||!t?.code)throw Error(t?.error??`Failed to create pairing code (${e.status})`);D(t.code),J(t.expires_in??null),es(null)}catch(e){es(e instanceof Error?e.message:"Failed to create pairing code.")}finally{K(!1)}}async function e0(e,t){try{await navigator.clipboard.writeText(e),ee(t),es(null)}catch(e){ee(null),es(e instanceof Error?e.message:"Failed to copy command.")}}async function e4(e){if(eI){X(e);try{let t=await fetch(`/api/bridge/devices/${encodeURIComponent(e)}`,{method:"DELETE"}),s=await t.json().catch(()=>null);if(!t.ok)throw Error(s?.error??`Failed to revoke device (${t.status})`);await eQ()}catch(e){es(e instanceof Error?e.message:"Failed to revoke device.")}finally{X(null)}}}async function e1(e){if(eI){eA({deviceId:e.device_id,kind:"restart",status:"running",message:`Restarting the bridge service on ${e.device_name}.`});try{let t=await (0,A.b)(e.device_id);eA({deviceId:e.device_id,kind:"restart",status:"completed",message:`${t} Waiting for ${e.device_name} to reconnect.`}),[2e3,5e3,1e4,2e4,35e3].forEach(e=>{window.setTimeout(()=>{eQ()},e)})}catch(t){eA({deviceId:e.device_id,kind:"restart",status:"failed",message:t instanceof Error?t.message:`Failed to restart ${e.device_name}.`})}}}async function e2(e){if(eI){eA({deviceId:e.device_id,kind:"repair",status:"running",message:`Reinstalling the bridge service on ${e.device_name}.`});try{let t=(0,S.pj)(s,(0,S.Y8)(e.os)),a=await (0,A.E)(e.device_id,t);eA({deviceId:e.device_id,kind:"repair",status:"completed",message:a}),window.setTimeout(()=>{eQ()},2e3)}catch(t){eA({deviceId:e.device_id,kind:"repair",status:"failed",message:t instanceof Error?t.message:`Failed to repair ${e.device_name}.`})}}}async function e3(e){eI&&(await (0,_.jV)(e,eC),window.setTimeout(()=>{eQ()},2e3))}async function e6(){if(!eI){er(!0),en(!1),el("Bridge relay URL is not configured.");return}er(!0),en(!0),el(null),eo(null);try{var e;let t=eO[0];if(!t)throw Error("Connect a laptop first, then reopen the device terminal test.");let s=await fetch((0,I.S)("/api/sessions",t.device_id),{cache:"no-store"}),a=await s.json().catch(()=>null);if(!s.ok){let e=a&&!Array.isArray(a)?a.error:null;throw Error(e??`Failed to load sessions (${s.status})`)}let r=(e=Array.isArray(a)?a:a?.sessions??[]).find(e=>!R.C.has(e.status))??e[0]??null;if(!r)throw Error("Create or resume a session first, then reopen the bridge terminal test.");eo(r)}catch(e){el(e instanceof Error?e.message:"Failed to load a session for bridge testing.")}finally{en(!1)}}return(0,r.useEffect)(()=>{eI?eQ():Y(!1)},[eI,eQ]),(0,r.useEffect)(()=>{if(e){if(!eI){ex("idle"),eb("Bridge relay URL is not configured.");return}eX()}},[eX,e,eI]),(0,r.useEffect)(()=>{let e=(eP?.connected?eP:null)??(eL?.connected?eL:null)??(eT?.connected?eT:null);!e||eS.current.has(e.device_id)||(eS.current.add(e.device_id),(0,_.jV)(e,eC))},[em,eP,eL,eT]),(0,r.useEffect)(()=>{!eL||eL.connected||e_.message||eC({deviceId:eL.device_id,phase:"checking",message:`Waiting for ${eL.device_name} to come online so Conductor can finish checking its package version.`})},[e_.message,eL]),(0,r.useEffect)(()=>{let t=!!ek&&!eL?.connected,s=!!eN&&!eT?.connected;if(!e&&("paired"!==em||0!==eO.length)&&!t&&!s)return;let a=window.setInterval(()=>{eQ()},4e3);return()=>{window.clearInterval(a)}},[em,eO.length,e,ek,eL?.connected,eQ,eT?.connected,eN]),(0,r.useEffect)(()=>{!eI||e||q||H||!ev||eZ()},[H,e,q,eI,ev]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(k.PublicPageShell,{className:"py-8 sm:py-10",children:(0,a.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-5",children:[(0,a.jsx)(U,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-5 lg:flex-row lg:items-start lg:justify-between",children:[(0,a.jsxs)("div",{className:"max-w-3xl",children:[(0,a.jsx)(M,{children:"Conductor Bridge"}),(0,a.jsx)("h1",{className:"mt-3 text-3xl font-semibold tracking-[-0.03em] text-[var(--vk-text-strong)] sm:text-4xl",children:"Connect a laptop"}),(0,a.jsx)("p",{className:"mt-3 text-base leading-7 text-[var(--vk-text-muted)]",children:"Pair one machine, keep the bridge daemon running on it, and use it from the normal Conductor dashboard."}),(0,a.jsxs)("div",{className:"mt-4 flex flex-wrap gap-2",children:[(0,a.jsxs)(O,{children:[B.length," paired"]}),(0,a.jsxs)(O,{children:[eO.length," online"]}),(0,a.jsx)(O,{children:eD?`${eD.device_name} ready`:eT?`${eT.device_name} selected`:"No device selected"})]})]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 lg:justify-end",children:[eG?(0,a.jsx)(N.$,{asChild:!0,variant:"primary",size:"lg",children:(0,a.jsxs)(n(),{href:eG,children:[(0,a.jsx)(d.A,{className:"h-4 w-4"}),"Open ",eD?.device_name??"device"]})}):(0,a.jsx)(N.$,{asChild:!0,variant:"primary",size:"lg",children:(0,a.jsxs)("a",{href:"#bridge-setup",children:[(0,a.jsx)(d.A,{className:"h-4 w-4"}),"Set up this laptop"]})}),(0,a.jsxs)(N.$,{type:"button",variant:"outline",size:"lg",disabled:!eI,onClick:()=>{eQ()},children:[(0,a.jsx)(l.A,{className:"h-4 w-4"}),"Refresh"]}),(0,a.jsxs)(N.$,{type:"button",variant:"outline",size:"lg",disabled:!eI||ei||0===eO.length,onClick:()=>{e6()},children:[ei?(0,a.jsx)(c.A,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(o.A,{className:"h-4 w-4"}),"Test connection"]})]})]})}),eI?null:(0,a.jsxs)(U,{className:"border-[color:color-mix(in_srgb,var(--vk-orange)_34%,transparent)] bg-[color:color-mix(in_srgb,var(--vk-orange)_12%,transparent)] shadow-none",children:[(0,a.jsx)(M,{children:"Bridge relay"}),(0,a.jsx)("h2",{className:"mt-2 text-xl font-semibold text-[var(--vk-text-strong)]",children:"Bridge relay URL is not configured"}),(0,a.jsxs)("p",{className:"mt-2 text-sm leading-6 text-[var(--vk-text-muted)]",children:["Set ",(0,a.jsx)("code",{children:"CONDUCTOR_BRIDGE_RELAY_URL"})," to enable paired-device refresh, claims, and bridge management on this page."]})]}),eD?(0,a.jsx)(U,{className:"border-[rgba(24,197,143,0.32)] bg-[rgba(24,197,143,0.08)] shadow-none",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(M,{children:"Ready to use"}),(0,a.jsxs)("h2",{className:"mt-2 text-xl font-semibold text-[var(--vk-text-strong)]",children:[eD.device_name," is online"]}),(0,a.jsx)("p",{className:"mt-2 text-sm leading-6 text-[var(--vk-text-muted)]",children:"Continue into the dashboard with this laptop selected, or open a live bridge test."})]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,a.jsx)(N.$,{asChild:!0,variant:"primary",size:"lg",children:(0,a.jsxs)(n(),{href:eG??"/",children:[(0,a.jsx)(d.A,{className:"h-4 w-4"}),"Open dashboard"]})}),(0,a.jsxs)(N.$,{type:"button",variant:"outline",size:"lg",disabled:!eI||ei,onClick:()=>{e6()},children:[(0,a.jsx)(o.A,{className:"h-4 w-4"}),"Open terminal test"]})]})]})}):null,et?(0,a.jsx)("div",{className:"rounded-[20px] border border-[color:color-mix(in_srgb,var(--vk-red)_30%,transparent)] bg-[color:color-mix(in_srgb,var(--vk-red)_12%,transparent)] px-5 py-4 text-sm text-[var(--vk-red)]",children:et}):null,e?(0,a.jsxs)(U,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[(0,a.jsxs)("div",{className:"max-w-3xl",children:[(0,a.jsx)(M,{children:"Device-first pairing"}),(0,a.jsx)("h2",{className:"mt-2 text-xl font-semibold text-[var(--vk-text-strong)]",children:"paired"===em?"This laptop is paired":"Finishing this laptop claim"}),(0,a.jsx)("p",{className:"mt-2 text-sm leading-6 text-[var(--vk-text-muted)]",children:"paired"===em?"The local command can now finish the handshake on the same machine. This page will keep refreshing until the laptop reports online.":"Conductor is binding the currently-running machine to your account and returning device credentials to that local command."})]}),ef?(0,a.jsx)(N.$,{asChild:!0,variant:"primary",size:"lg",children:(0,a.jsxs)(n(),{href:`/?bridge=${encodeURIComponent(ef.deviceId)}`,children:[(0,a.jsx)(d.A,{className:"h-4 w-4"}),"Open ",ef.deviceName]})}):null]}),(0,a.jsx)("div",{className:"mt-5 rounded-[18px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-4 py-4 text-sm text-[var(--vk-text-muted)]",children:"pending"===em?(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)(c.A,{className:"h-4 w-4 animate-spin"}),"Waiting for the local command to receive its one-time device credentials."]}):"paired"===em&&ef?(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)(m.A,{className:"mt-0.5 h-4 w-4 text-[var(--vk-green)]"}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"font-medium text-[var(--vk-text-strong)]",children:[ef.deviceName," is now paired."]}),(0,a.jsx)("div",{className:"mt-1",children:eP?.connected?"This laptop is online and ready to use.":"Conductor is still waiting for this laptop to come online. If you closed the setup terminal, rerun the hosted installer or `conductor-bridge connect` and keep that terminal open until the device reports online."}),e_.message?(0,a.jsxs)("div",{className:(0,$.cn)("mt-2 flex flex-wrap items-center gap-2 text-xs leading-5","failed"===e_.phase?"text-[var(--vk-red)]":"skipped"===e_.phase?"text-[var(--vk-text-muted)]":"text-[var(--vk-text-faint)]"),children:[(0,a.jsx)("span",{className:"inline-flex items-center rounded-full border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 py-0.5 text-[10px] font-semibold uppercase tracking-[0.16em] text-[var(--vk-text-muted)]",children:(0,_.qv)(e_.phase)}),(0,a.jsx)("span",{children:e_.message})]}):null]})]}):eg?(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("div",{className:"text-[var(--vk-red)]",children:eg}),(0,a.jsxs)(N.$,{type:"button",variant:"outline",size:"md",onClick:()=>{eX()},children:[(0,a.jsx)(l.A,{className:"h-4 w-4"}),"Retry claim"]})]}):null})]}):null,(0,a.jsxs)("div",{className:"grid gap-5 lg:grid-cols-[minmax(0,1.08fr)_minmax(0,0.92fr)]",children:[(0,a.jsxs)(U,{id:"bridge-setup",children:[(0,a.jsx)(M,{children:"Setup"}),(0,a.jsx)("h2",{className:"mt-2 text-xl font-semibold text-[var(--vk-text-strong)]",children:"Connect this laptop"}),(0,a.jsx)("p",{className:"mt-2 text-sm leading-6 text-[var(--vk-text-muted)]",children:"Most users only need one command. Choose the shell for this laptop, then run the hosted bridge installer. It installs the bridge, opens the browser, and pairs the current laptop to this dashboard without requiring the full Conductor CLI first."}),(0,a.jsx)("div",{className:"mt-5 flex flex-wrap gap-2",children:[{value:"unix",label:"macOS / Linux"},{value:"windows",label:"Windows PowerShell"}].map(e=>(0,a.jsx)("button",{type:"button",className:(0,$.cn)("rounded-full border px-3 py-1.5 text-xs font-medium transition-colors",ep===e.value?"border-[var(--vk-orange)] bg-[color:color-mix(in_srgb,var(--vk-orange)_14%,transparent)] text-[var(--vk-text-strong)]":"border-[var(--vk-border)] bg-[var(--vk-bg-main)] text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]"),onClick:()=>{eu(e.value)},children:e.label},e.value))}),(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsx)(P,{title:"Recommended command",description:"windows"===ep?"Run this in Windows PowerShell on the laptop you want to pair.":"Run this in Terminal on the laptop you want to pair.",command:eR,footer:(0,a.jsxs)(N.$,{type:"button",variant:"primary",size:"md",onClick:()=>{e0(eR,"setup")},children:["setup"===Z?(0,a.jsx)(m.A,{className:"h-4 w-4"}):(0,a.jsx)(x.A,{className:"h-4 w-4"}),"setup"===Z?"Setup command copied":"Copy setup command"]})})}),(0,a.jsxs)("ol",{className:"mt-5 grid gap-3 sm:grid-cols-3",children:[(0,a.jsxs)("li",{className:"rounded-[18px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-4 py-4",children:[(0,a.jsx)("div",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-[var(--vk-text-muted)]",children:"Step 1"}),(0,a.jsx)("p",{className:"mt-2 text-sm leading-6 text-[var(--vk-text-normal)]",children:"Run the command in Terminal on macOS or Linux, or in PowerShell on Windows."})]}),(0,a.jsxs)("li",{className:"rounded-[18px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-4 py-4",children:[(0,a.jsx)("div",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-[var(--vk-text-muted)]",children:"Step 2"}),(0,a.jsx)("p",{className:"mt-2 text-sm leading-6 text-[var(--vk-text-normal)]",children:"Finish sign-in in the browser tab the command opens."})]}),(0,a.jsxs)("li",{className:"rounded-[18px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-4 py-4",children:[(0,a.jsx)("div",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-[var(--vk-text-muted)]",children:"Step 3"}),(0,a.jsx)("p",{className:"mt-2 text-sm leading-6 text-[var(--vk-text-normal)]",children:"Leave the bridge daemon running so the laptop stays available."})]})]}),(0,a.jsxs)("div",{className:"mt-5 rounded-[20px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)]",children:[(0,a.jsxs)("button",{type:"button",className:"flex w-full items-center justify-between gap-4 px-5 py-4 text-left",onClick:()=>{eh(e=>!e)},children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-sm font-medium text-[var(--vk-text-strong)]",children:"Advanced options"}),(0,a.jsx)("div",{className:"mt-1 text-sm text-[var(--vk-text-muted)]",children:"Use these only if the default setup flow is not right for your case."})]}),ev?(0,a.jsx)(v.A,{className:"h-4 w-4 text-[var(--vk-text-muted)]"}):(0,a.jsx)(h.A,{className:"h-4 w-4 text-[var(--vk-text-muted)]"})]}),ev?(0,a.jsxs)("div",{className:"space-y-4 border-t border-[var(--vk-border)] px-4 py-4",children:[(0,a.jsx)(P,{title:"Install only",description:"Install the bridge now, then connect later from a new shell.",command:ez,footer:(0,a.jsxs)(N.$,{type:"button",variant:"outline",size:"md",onClick:()=>{e0(ez,"install")},children:[(0,a.jsx)(x.A,{className:"h-4 w-4"}),"install"===Z?"Install command copied":"Copy install command"]})}),(0,a.jsx)(P,{title:"Already installed",description:"Use this when the bridge is already installed on the laptop.",command:eU,footer:(0,a.jsxs)(N.$,{type:"button",variant:"outline",size:"md",onClick:()=>{e0(eU,"connect")},children:[(0,a.jsx)(x.A,{className:"h-4 w-4"}),"connect"===Z?"Connect command copied":"Copy connect command"]})}),(0,a.jsx)(P,{title:"Manual fallback",description:"Use a one-time code only if the browser claim flow cannot finish on the same machine.",command:eM,children:(0,a.jsx)("div",{className:"mt-4 rounded-[16px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-4 py-4",children:(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-[var(--vk-text-muted)]",children:"One-time code"}),(0,a.jsx)("div",{className:"mt-3 font-mono text-4xl font-semibold tracking-[0.18em] text-[var(--vk-text-strong)]",children:q??"------"}),(0,a.jsx)("div",{className:"mt-3 text-sm text-[var(--vk-text-muted)]",children:q?`Valid for about ${Math.max(1,Math.round((G??600)/60))} minutes.`:"Generate a code to reveal the manual pair command."})]}),(0,a.jsxs)(N.$,{type:"button",variant:"outline",size:"md",disabled:H||!eI,onClick:()=>{eZ()},children:[H?(0,a.jsx)(c.A,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(l.A,{className:"h-4 w-4"}),q?"Generate new code":"Generate code"]})]})}),footer:(0,a.jsxs)(N.$,{type:"button",variant:"outline",size:"md",disabled:!q||!eI,onClick:()=>{e0(eM,"manual")},children:["manual"===Z?(0,a.jsx)(m.A,{className:"h-4 w-4"}):(0,a.jsx)(x.A,{className:"h-4 w-4"}),"manual"===Z?"Manual command copied":"Copy manual command"]})})]}):null]})]}),(0,a.jsxs)(U,{children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(M,{children:"Devices"}),(0,a.jsx)("h2",{className:"mt-2 text-xl font-semibold text-[var(--vk-text-strong)]",children:"Paired devices"}),(0,a.jsx)("p",{className:"mt-2 text-sm leading-6 text-[var(--vk-text-muted)]",children:"Pick a laptop below, then continue into the dashboard with that device selected."})]}),(0,a.jsxs)(O,{children:[B.length," total"]})]}),eT?(0,a.jsx)("div",{className:"mt-5 rounded-[18px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-4 py-4",children:(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("div",{className:"text-base font-semibold text-[var(--vk-text-strong)]",children:eT.device_name}),(0,a.jsx)(j.J,{connected:eT.connected,title:`${eT.device_name} is ${eT.connected?"online":"offline"}`})]}),(0,a.jsx)("div",{className:"text-sm text-[var(--vk-text-muted)]",children:z(eT)}),e_.message&&e_.deviceId===eT.device_id?(0,a.jsxs)("div",{className:(0,$.cn)("flex flex-wrap items-center gap-2 text-xs leading-5","failed"===e_.phase?"text-[var(--vk-red)]":"skipped"===e_.phase?"text-[var(--vk-text-muted)]":"text-[var(--vk-text-faint)]"),children:[(0,a.jsx)("span",{className:"inline-flex items-center rounded-full border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 py-0.5 text-[10px] font-semibold uppercase tracking-[0.16em] text-[var(--vk-text-muted)]",children:(0,_.qv)(e_.phase)}),(0,a.jsx)("span",{children:e_.message})]}):null,e$.message&&e$.deviceId===eT.device_id?(0,a.jsx)("div",{className:(0,$.cn)("text-xs leading-5","failed"===e$.status?"text-[var(--vk-red)]":"completed"===e$.status?"text-[var(--vk-green)]":"text-[var(--vk-text-faint)]"),children:e$.message}):null,eK?(0,a.jsx)(f.i,{deviceId:eT.device_id,deviceName:eT.device_name,deviceOs:eT.os,dashboardUrl:s,installScriptUrl:T,installPowerShellUrl:F,relayUrl:i}):null,eT.connected?(0,a.jsxs)("div",{className:"flex w-full flex-wrap gap-2",children:[(0,a.jsxs)(N.$,{type:"button",variant:"outline",size:"md",disabled:eV||(0,_.xv)(e_,eT.device_id),onClick:()=>{e2(eT)},children:[eY?(0,a.jsx)(c.A,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(p.A,{className:"h-4 w-4"}),"Repair bridge"]}),(0,a.jsxs)(N.$,{type:"button",variant:"outline",size:"md",disabled:(0,_.xv)(e_,eT.device_id)||eV,onClick:()=>{e3(eT)},children:[(0,_.xv)(e_,eT.device_id)?(0,a.jsx)(c.A,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(u.A,{className:"h-4 w-4"}),(0,_.xv)(e_,eT.device_id)?"Updating...":"Update Conductor"]}),(0,a.jsx)(N.$,{asChild:!0,variant:"primary",size:"md",children:(0,a.jsxs)(n(),{href:`/?bridge=${encodeURIComponent(eT.device_id)}`,children:[(0,a.jsx)(d.A,{className:"h-4 w-4"}),"Continue with ",eT.device_name]})}),(0,a.jsxs)(N.$,{type:"button",variant:"outline",size:"md",disabled:eV||(0,_.xv)(e_,eT.device_id),onClick:()=>{e1(eT)},children:[eH?(0,a.jsx)(c.A,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(l.A,{className:"h-4 w-4"}),"Restart service"]})]}):(0,a.jsxs)("div",{className:"w-full rounded-[16px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-4 py-4",children:[(0,a.jsxs)("div",{className:"text-sm font-medium text-[var(--vk-text-strong)]",children:[eT.device_name," is offline"]}),(0,a.jsx)("p",{className:"mt-2 text-sm leading-6 text-[var(--vk-text-muted)]",children:"Open the same laptop and run the reconnect command below. If Conductor Bridge is missing or broken on that machine, use the full setup command instead."}),(0,a.jsx)("pre",{className:"mt-3 overflow-x-auto whitespace-pre-wrap break-all rounded-[14px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-4 py-3 font-mono text-sm leading-6 text-[var(--vk-text-normal)]",children:eq}),(0,a.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2",children:[(0,a.jsxs)(N.$,{type:"button",variant:"primary",size:"md",onClick:()=>{e0(eq,"connect")},children:["connect"===Z?(0,a.jsx)(m.A,{className:"h-4 w-4"}):(0,a.jsx)(x.A,{className:"h-4 w-4"}),"connect"===Z?"Reconnect command copied":"Copy reconnect command"]}),(0,a.jsxs)(N.$,{type:"button",variant:"outline",size:"md",onClick:()=>{e0(eW,"setup")},children:["setup"===Z?(0,a.jsx)(m.A,{className:"h-4 w-4"}):(0,a.jsx)(x.A,{className:"h-4 w-4"}),"setup"===Z?"Setup command copied":"Copy full setup command"]}),eJ?(0,a.jsx)(N.$,{asChild:!0,variant:"outline",size:"md",children:(0,a.jsxs)(n(),{href:eJ,children:[(0,a.jsx)(p.A,{className:"h-4 w-4"}),"Reopen recovery steps"]})}):null]})]})]})}):null,(0,a.jsx)("div",{className:"mt-5 space-y-3",children:V?(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-[18px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-4 py-4 text-sm text-[var(--vk-text-muted)]",children:[(0,a.jsx)(c.A,{className:"h-4 w-4 animate-spin"}),"Loading paired devices..."]}):B.length>0?B.map(e=>{let t=eT?.device_id===e.device_id,s=(0,_.xv)(e_,e.device_id),r="running"===e$.status&&e$.deviceId===e.device_id,i=r&&"repair"===e$.kind,d=r&&"restart"===e$.kind;return(0,a.jsx)("div",{className:(0,$.cn)("rounded-[18px] border bg-[var(--vk-bg-main)] p-4",t?"border-[var(--vk-orange)]":"border-[var(--vk-border)]"),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4 xl:flex-row xl:items-start xl:justify-between",children:[(0,a.jsxs)("button",{type:"button",className:"min-w-0 flex-1 text-left",onClick:()=>{ey(e.device_id)},children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("div",{className:"truncate text-base font-medium text-[var(--vk-text-strong)]",children:e.device_name}),(0,a.jsx)(j.J,{connected:e.connected,title:`${e.device_name} is ${e.connected?"online":"offline"}`}),t?(0,a.jsx)("span",{className:"rounded-full border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 py-1 text-[11px] text-[var(--vk-text-muted)]",children:"Selected"}):null]}),(0,a.jsx)("div",{className:"mt-2 text-sm text-[var(--vk-text-muted)]",children:z(e)}),(0,a.jsxs)("div",{className:"mt-1 text-xs text-[var(--vk-text-muted)]",children:["Relay: ",e.last_status?.hostname??e.hostname,(0,E.wj)(e.last_status?.version)]}),e_.message&&e_.deviceId===e.device_id?(0,a.jsxs)("div",{className:(0,$.cn)("mt-2 flex flex-wrap items-center gap-2 text-xs leading-5","failed"===e_.phase?"text-[var(--vk-red)]":"skipped"===e_.phase?"text-[var(--vk-text-muted)]":"text-[var(--vk-text-faint)]"),children:[(0,a.jsx)("span",{className:"inline-flex items-center rounded-full border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 py-0.5 text-[10px] font-semibold uppercase tracking-[0.16em] text-[var(--vk-text-muted)]",children:(0,_.qv)(e_.phase)}),(0,a.jsx)("span",{children:e_.message})]}):null,e$.message&&e$.deviceId===e.device_id?(0,a.jsx)("div",{className:(0,$.cn)("mt-2 text-xs leading-5","failed"===e$.status?"text-[var(--vk-red)]":"completed"===e$.status?"text-[var(--vk-green)]":"text-[var(--vk-text-faint)]"),children:e$.message}):null]}),(0,a.jsxs)("div",{className:"flex w-full flex-wrap items-center gap-2 xl:w-auto xl:justify-end",children:[e.connected?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(N.$,{asChild:!0,variant:t?"primary":"outline",size:"md",children:(0,a.jsx)(n(),{href:`/?bridge=${encodeURIComponent(e.device_id)}`,children:t?"Continue":"Open"})}),(0,a.jsxs)(N.$,{type:"button",variant:"outline",size:"md",disabled:r||s,onClick:()=>{ey(e.device_id),e2(e)},children:[i?(0,a.jsx)(c.A,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(p.A,{className:"h-4 w-4"}),"Repair"]}),(0,a.jsxs)(N.$,{type:"button",variant:"outline",size:"md",disabled:s||r,onClick:()=>{ey(e.device_id),e3(e)},children:[s?(0,a.jsx)(c.A,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(u.A,{className:"h-4 w-4"}),s?"Updating...":"Update"]}),(0,a.jsxs)(N.$,{type:"button",variant:"outline",size:"md",disabled:r||s,onClick:()=>{ey(e.device_id),e1(e)},children:[d?(0,a.jsx)(c.A,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(l.A,{className:"h-4 w-4"}),"Restart"]})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"text-xs text-[var(--vk-text-muted)]",children:"Offline"}),(0,a.jsx)(N.$,{asChild:!0,variant:t?"primary":"outline",size:"md",children:(0,a.jsx)(n(),{href:(0,S.kw)(e.device_id),onClick:()=>{ey(e.device_id)},children:"Reconnect"})})]}),(0,a.jsx)(N.$,{type:"button",variant:"ghost",size:"icon",disabled:Q===e.device_id,onClick:()=>{e4(e.device_id)},"aria-label":`Revoke ${e.device_name}`,children:Q===e.device_id?(0,a.jsx)(c.A,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(g.A,{className:"h-4 w-4"})})]})]})},e.device_id)}):(0,a.jsx)("div",{className:"rounded-[18px] border border-dashed border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-4 py-6 text-sm text-[var(--vk-text-muted)]",children:"No laptops have been paired yet. Run the setup command on the laptop you want to use."})})]})]})]})}),ea?(0,a.jsxs)("div",{className:`fixed ${y.Rn} z-[140] flex items-start justify-center overflow-y-auto bg-black/70 px-3 py-3 sm:items-center sm:py-0`,children:[(0,a.jsx)("button",{type:"button",className:"absolute inset-0","aria-label":"Close bridge terminal test",onClick:()=>{er(!1)}}),(0,a.jsxs)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"bridge-test-title",className:`relative z-10 flex ${y.Cf} w-full max-w-6xl flex-col overflow-hidden rounded-[24px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] shadow-[0_28px_80px_rgba(0,0,0,0.4)]`,children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4 border-b border-[var(--vk-border)] px-5 py-5 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs font-semibold uppercase tracking-[0.24em] text-[var(--vk-text-muted)]",children:"Bridge terminal test"}),(0,a.jsx)("h2",{id:"bridge-test-title",className:"mt-2 text-xl font-semibold text-[var(--vk-text-strong)]",children:"Live session over Conductor Bridge"}),(0,a.jsx)("p",{className:"mt-2 max-w-2xl text-sm leading-6 text-[var(--vk-text-muted)]",children:ec?`${ec.projectId}${ec.branch?` \xb7 ${ec.branch}`:""}`:"Open a session here to verify terminal input and output through the bridge."})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)(j.J,{connected:eO.length>0,title:`${eO.length} connected device${1===eO.length?"":"s"}`}),(0,a.jsx)(N.$,{type:"button",variant:"ghost",size:"icon",onClick:()=>{er(!1)},"aria-label":"Close bridge test modal",children:(0,a.jsx)(b.A,{className:"h-4 w-4"})})]})]}),(0,a.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col px-5 py-5",children:[0===eO.length?(0,a.jsx)("div",{className:"mb-4 rounded-[18px] border border-[color:color-mix(in_srgb,var(--vk-red)_28%,transparent)] bg-[color:color-mix(in_srgb,var(--vk-red)_10%,transparent)] px-4 py-3 text-sm text-[var(--vk-text-muted)]",children:"No paired bridge reports as online right now. Reconnect a laptop to test the live terminal path."}):null,ei?(0,a.jsx)("div",{className:"flex min-h-[360px] flex-1 items-center justify-center rounded-[20px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] text-sm text-[var(--vk-text-muted)]",children:(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)(c.A,{className:"h-4 w-4 animate-spin"}),"Preparing a session for the bridge test..."]})}):ed?(0,a.jsx)("div",{className:"rounded-[20px] border border-[color:color-mix(in_srgb,var(--vk-red)_30%,transparent)] bg-[color:color-mix(in_srgb,var(--vk-red)_12%,transparent)] px-5 py-4 text-sm text-[var(--vk-red)]",children:ed}):ec?(0,a.jsx)("div",{className:"min-h-[420px] flex-1 overflow-hidden rounded-[20px] border border-[var(--vk-border)] bg-[#060404]",children:(0,a.jsx)(w.SessionTerminal,{sessionId:ec.id,projectId:ec.projectId,bridgeId:ec.bridgeId,sessionState:ec.status,pendingInsert:null})}):(0,a.jsx)("div",{className:"rounded-[20px] border border-dashed border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-5 py-10 text-sm text-[var(--vk-text-muted)]",children:"No session is available for bridge testing yet."})]})]})]}):null]})}},93035:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(39789).A)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]])}},e=>{e.O(0,[63357,65587,82746,68782,76509,86597,61782,587,61968,77358],()=>e(e.s=82767)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{46916:(e,r,t)=>{"use strict";t.d(r,{cn:()=>s});var o=t(9917),n=t(2809);function s(...e){return(0,n.QP)((0,o.$)(e))}},48204:(e,r,t)=>{"use strict";t.d(r,{ThemeProvider:()=>a});var o=t(54568),n=t(7620);let s=(0,n.createContext)({theme:"dark",toggleTheme:()=>{}});function i(e){let r=document.documentElement;r.classList.remove("dark","light"),r.classList.add(e)}function a({children:e}){let[r,t]=(0,n.useState)("dark");(0,n.useEffect)(()=>{let e=localStorage.getItem("conductor-theme");if("light"===e||"dark"===e){t(e),i(e);return}i("dark")},[]);let d=(0,n.useCallback)(()=>{t(e=>{let r="dark"===e?"light":"dark";return localStorage.setItem("conductor-theme",r),i(r),r})},[]);return(0,o.jsx)(s.Provider,{value:{theme:r,toggleTheme:d},children:e})}},74471:()=>{},90560:(e,r,t)=>{"use strict";t.d(r,{y:()=>n});var o=t(5974);let n=(0,o.createServerReference)("0097c054ba5840b351302c272e683f8e9cda971357",o.callServer,void 0,o.findSourceMapURL,"invalidateCacheAction")},92690:(e,r,t)=>{"use strict";t.d(r,{TooltipProvider:()=>a});var o=t(54568),n=t(32423),s=t(7620),i=t(46916);let a=n.Kq;n.bL,n.l9,(0,s.forwardRef)(({className:e,sideOffset:r=8,...t},s)=>(0,o.jsx)(n.ZL,{children:(0,o.jsx)(n.UC,{ref:s,sideOffset:r,className:(0,i.cn)("z-50 rounded-[var(--radius-xs)] border border-[var(--border-strong)] bg-[var(--bg-panel)] px-2 py-1.5","text-[11px] text-[var(--text-normal)] shadow-[var(--shadow-soft)]","animate-in fade-in-0 zoom-in-95",e),...t})})).displayName="TooltipContent"},96144:(e,r,t)=>{Promise.resolve().then(t.bind(t,93249)),Promise.resolve().then(t.bind(t,36727)),Promise.resolve().then(t.bind(t,76940)),Promise.resolve().then(t.bind(t,41926)),Promise.resolve().then(t.bind(t,62520)),Promise.resolve().then(t.bind(t,93603)),Promise.resolve().then(t.t.bind(t,48477,23)),Promise.resolve().then(t.t.bind(t,91745,23)),Promise.resolve().then(t.t.bind(t,79584,23)),Promise.resolve().then(t.t.bind(t,84978,23)),Promise.resolve().then(t.t.bind(t,74471,23)),Promise.resolve().then(t.bind(t,48204)),Promise.resolve().then(t.bind(t,92690))}},e=>{e.O(0,[49271,89306,63357,83342,82746,37785,587,61968,77358],()=>e(e.s=96144)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{46916:(e,r,t)=>{"use strict";t.d(r,{cn:()=>s});var o=t(9917),n=t(2809);function s(...e){return(0,n.QP)((0,o.$)(e))}},48204:(e,r,t)=>{"use strict";t.d(r,{ThemeProvider:()=>d});var o=t(54568),n=t(7620);let s=(0,n.createContext)({theme:"dark",toggleTheme:()=>{}});function i(e){let r=document.documentElement;r.classList.remove("dark","light"),r.classList.add(e)}function d({children:e}){let[r,t]=(0,n.useState)("dark");(0,n.useEffect)(()=>{let e=localStorage.getItem("conductor-theme");if("light"===e||"dark"===e){t(e),i(e);return}i("dark")},[]);let a=(0,n.useCallback)(()=>{t(e=>{let r="dark"===e?"light":"dark";return localStorage.setItem("conductor-theme",r),i(r),r})},[]);return(0,o.jsx)(s.Provider,{value:{theme:r,toggleTheme:a},children:e})}},74471:()=>{},83201:(e,r,t)=>{"use strict";t.d(r,{y:()=>n});var o=t(5974);let n=(0,o.createServerReference)("00a83f3e7d71dea075bc986d565951deaf2ee181f3",o.callServer,void 0,o.findSourceMapURL,"invalidateCacheAction")},92690:(e,r,t)=>{"use strict";t.d(r,{TooltipProvider:()=>d});var o=t(54568),n=t(32423),s=t(7620),i=t(46916);let d=n.Kq;n.bL,n.l9,(0,s.forwardRef)(({className:e,sideOffset:r=8,...t},s)=>(0,o.jsx)(n.ZL,{children:(0,o.jsx)(n.UC,{ref:s,sideOffset:r,className:(0,i.cn)("z-50 rounded-[var(--radius-xs)] border border-[var(--border-strong)] bg-[var(--bg-panel)] px-2 py-1.5","text-[11px] text-[var(--text-normal)] shadow-[var(--shadow-soft)]","animate-in fade-in-0 zoom-in-95",e),...t})})).displayName="TooltipContent"},96144:(e,r,t)=>{Promise.resolve().then(t.bind(t,93249)),Promise.resolve().then(t.bind(t,36727)),Promise.resolve().then(t.bind(t,76940)),Promise.resolve().then(t.bind(t,41926)),Promise.resolve().then(t.bind(t,62520)),Promise.resolve().then(t.bind(t,93603)),Promise.resolve().then(t.t.bind(t,48477,23)),Promise.resolve().then(t.t.bind(t,91745,23)),Promise.resolve().then(t.t.bind(t,79584,23)),Promise.resolve().then(t.t.bind(t,84978,23)),Promise.resolve().then(t.t.bind(t,74471,23)),Promise.resolve().then(t.bind(t,48204)),Promise.resolve().then(t.bind(t,92690))}},e=>{e.O(0,[49271,89306,63357,83342,82746,37785,587,61968,77358],()=>e(e.s=96144)),_N_E=e.O()}]);