@ai-development-environment/server 0.0.35 → 0.0.36

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 (161) hide show
  1. package/package.json +1 -1
  2. package/standalone/.next/BUILD_ID +1 -1
  3. package/standalone/.next/build-manifest.json +3 -3
  4. package/standalone/.next/prerender-manifest.json +3 -3
  5. package/standalone/.next/server/app/[locale]/actions/page_client-reference-manifest.js +1 -1
  6. package/standalone/.next/server/app/[locale]/agents/[id]/page_client-reference-manifest.js +1 -1
  7. package/standalone/.next/server/app/[locale]/agents/page_client-reference-manifest.js +1 -1
  8. package/standalone/.next/server/app/[locale]/analytics-events/page_client-reference-manifest.js +1 -1
  9. package/standalone/.next/server/app/[locale]/build-data/page_client-reference-manifest.js +1 -1
  10. package/standalone/.next/server/app/[locale]/builds/[buildId]/coverage/page_client-reference-manifest.js +1 -1
  11. package/standalone/.next/server/app/[locale]/builds/[buildId]/page_client-reference-manifest.js +1 -1
  12. package/standalone/.next/server/app/[locale]/builds/page_client-reference-manifest.js +1 -1
  13. package/standalone/.next/server/app/[locale]/codebases/[codebaseId]/page_client-reference-manifest.js +1 -1
  14. package/standalone/.next/server/app/[locale]/codebases/page_client-reference-manifest.js +1 -1
  15. package/standalone/.next/server/app/[locale]/codebases/repositories/[repositoryId]/page_client-reference-manifest.js +1 -1
  16. package/standalone/.next/server/app/[locale]/comments/page_client-reference-manifest.js +1 -1
  17. package/standalone/.next/server/app/[locale]/console-logs/page_client-reference-manifest.js +1 -1
  18. package/standalone/.next/server/app/[locale]/devices/[id]/page_client-reference-manifest.js +1 -1
  19. package/standalone/.next/server/app/[locale]/devices/enroll/page_client-reference-manifest.js +1 -1
  20. package/standalone/.next/server/app/[locale]/devices/page_client-reference-manifest.js +1 -1
  21. package/standalone/.next/server/app/[locale]/jira/cache/page_client-reference-manifest.js +1 -1
  22. package/standalone/.next/server/app/[locale]/jira/cache/tickets/[issueKey]/page_client-reference-manifest.js +1 -1
  23. package/standalone/.next/server/app/[locale]/jira/tickets/[issueKey]/page_client-reference-manifest.js +1 -1
  24. package/standalone/.next/server/app/[locale]/jira/tickets/page_client-reference-manifest.js +1 -1
  25. package/standalone/.next/server/app/[locale]/jobs/[jobId]/page_client-reference-manifest.js +1 -1
  26. package/standalone/.next/server/app/[locale]/page_client-reference-manifest.js +1 -1
  27. package/standalone/.next/server/app/[locale]/provisioning-profiles/[profileId]/page_client-reference-manifest.js +1 -1
  28. package/standalone/.next/server/app/[locale]/provisioning-profiles/page_client-reference-manifest.js +1 -1
  29. package/standalone/.next/server/app/[locale]/pull-requests/[owner]/[repository]/[number]/page_client-reference-manifest.js +1 -1
  30. package/standalone/.next/server/app/[locale]/pull-requests/page_client-reference-manifest.js +1 -1
  31. package/standalone/.next/server/app/[locale]/push-notifications/page_client-reference-manifest.js +1 -1
  32. package/standalone/.next/server/app/[locale]/settings/page_client-reference-manifest.js +1 -1
  33. package/standalone/.next/server/app/[locale]/skills/[skillId]/page_client-reference-manifest.js +1 -1
  34. package/standalone/.next/server/app/[locale]/skills/groups/[groupId]/page_client-reference-manifest.js +1 -1
  35. package/standalone/.next/server/app/[locale]/skills/groups/page_client-reference-manifest.js +1 -1
  36. package/standalone/.next/server/app/[locale]/skills/page_client-reference-manifest.js +1 -1
  37. package/standalone/.next/server/app/[locale]/skills/sync/[runId]/page_client-reference-manifest.js +1 -1
  38. package/standalone/.next/server/app/[locale]/tools/page_client-reference-manifest.js +1 -1
  39. package/standalone/.next/server/app/[locale]/unified-events/page_client-reference-manifest.js +1 -1
  40. package/standalone/.next/server/app/[locale]/usage/page_client-reference-manifest.js +1 -1
  41. package/standalone/.next/server/app/[locale]/worktrees/[worktreeId]/page_client-reference-manifest.js +1 -1
  42. package/standalone/.next/server/app/[locale]/worktrees/page_client-reference-manifest.js +1 -1
  43. package/standalone/.next/server/app/_global-error.html +1 -1
  44. package/standalone/.next/server/app/_global-error.rsc +1 -1
  45. package/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  46. package/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  47. package/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  48. package/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  49. package/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  50. package/standalone/.next/server/app/_not-found.html +1 -1
  51. package/standalone/.next/server/app/_not-found.rsc +1 -1
  52. package/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  53. package/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  54. package/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  55. package/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  56. package/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  57. package/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  58. package/standalone/.next/server/chunks/ssr/[root-of-the-server]__0v12ijp._.js +1 -1
  59. package/standalone/.next/server/chunks/ssr/_012q7w6._.js +1 -1
  60. package/standalone/.next/server/chunks/ssr/_07qmjrj._.js +1 -1
  61. package/standalone/.next/server/chunks/ssr/_0dquba3._.js +1 -1
  62. package/standalone/.next/server/chunks/ssr/_0t2jwg3._.js +1 -1
  63. package/standalone/.next/server/chunks/ssr/_1bzibio._.js +1 -1
  64. package/standalone/.next/server/chunks/ssr/_1h1k5ja._.js +1 -1
  65. package/standalone/.next/server/chunks/ssr/_1kle1nm._.js +1 -1
  66. package/standalone/.next/server/chunks/ssr/_1m50niy._.js +1 -1
  67. package/standalone/.next/server/chunks/ssr/_1pja493._.js +1 -1
  68. package/standalone/.next/server/chunks/ssr/_1y98hs-._.js +1 -1
  69. package/standalone/.next/server/chunks/ssr/_1z02bsk._.js +1 -1
  70. package/standalone/.next/server/chunks/ssr/src_components_agents_agent-detail_tsx_0lfa4ui._.js +2 -2
  71. package/standalone/.next/server/chunks/ssr/src_components_build-data_build-data-page_tsx_1t2rrh0._.js +2 -2
  72. package/standalone/.next/server/chunks/ssr/src_components_builds_build-detail-page_tsx_0q1lvps._.js +1 -1
  73. package/standalone/.next/server/chunks/ssr/src_components_builds_coverage-report-page_tsx_1nhwba1._.js +1 -1
  74. package/standalone/.next/server/chunks/ssr/src_components_devices_device-detail-page_tsx_1mut_l4._.js +1 -1
  75. package/standalone/.next/server/chunks/ssr/src_components_devices_devices-page_tsx_1y45lv2._.js +1 -1
  76. package/standalone/.next/server/chunks/ssr/src_components_github_pull-request-detail-page_tsx_1etlamp._.js +1 -1
  77. package/standalone/.next/server/chunks/ssr/src_components_jira_cache-page_tsx_1znt1yl._.js +1 -1
  78. package/standalone/.next/server/chunks/ssr/src_components_jira_ticket-detail-page_tsx_0vmf8nk._.js +2 -2
  79. package/standalone/.next/server/chunks/ssr/src_components_jira_tickets-page_tsx_0_ocldp._.js +1 -1
  80. package/standalone/.next/server/chunks/ssr/src_components_push-notifications_push-notifications-page_tsx_1c_b-t4._.js +1 -1
  81. package/standalone/.next/server/chunks/ssr/src_components_signing-assets_provisioning-profiles-page_tsx_1zr20o7._.js +1 -1
  82. package/standalone/.next/server/chunks/ssr/src_components_skills_skill-sync-page_tsx_15sidhb._.js +1 -1
  83. package/standalone/.next/server/chunks/ssr/src_components_skills_skills-page_tsx_0o1nlbg._.js +1 -1
  84. package/standalone/.next/server/chunks/ssr/src_components_worktrees_worktree-detail-page_tsx_1oexgu_._.js +1 -1
  85. package/standalone/.next/server/middleware-build-manifest.js +3 -3
  86. package/standalone/.next/server/pages/404.html +1 -1
  87. package/standalone/.next/server/pages/500.html +1 -1
  88. package/standalone/.next/server/server-reference-manifest.js +1 -1
  89. package/standalone/.next/server/server-reference-manifest.json +1 -1
  90. package/standalone/.next/static/chunks/{0rrwapb85e3vs.js → 0a8bo5bqge171.js} +1 -1
  91. package/standalone/.next/static/chunks/0bx-vj8k3jlsz.js +35 -0
  92. package/standalone/.next/static/chunks/{1z2n-kfxw0xxf.js → 0s_vkk_t0i4mg.js} +1 -1
  93. package/standalone/.next/static/chunks/12msdp4rhv6ti.js +7 -0
  94. package/standalone/.next/static/chunks/{1rvz2z_cov6ug.js → 15rske_fphtgw.js} +2 -2
  95. package/standalone/.next/static/chunks/19l74y4_uc81t.js +33 -0
  96. package/standalone/.next/static/chunks/{0elijgx6pfo7w.js → 1a5_4cpwnx9uu.js} +1 -1
  97. package/standalone/.next/static/chunks/1a9j-qydwrg8m.js +7 -0
  98. package/standalone/.next/static/chunks/1e-vykrs41myl.js +41 -0
  99. package/standalone/.next/static/chunks/1jwc4nasae27c.js +1 -0
  100. package/standalone/.next/static/chunks/1llwo8aslhpdp.js +1 -0
  101. package/standalone/.next/static/chunks/{2-k0gnjfr6ayw.js → 1nkkb5gu3-rhf.js} +1 -1
  102. package/standalone/.next/static/chunks/1oh9kzyxfy5ih.js +1 -0
  103. package/standalone/.next/static/chunks/1q87ulu5dp43f.js +1 -0
  104. package/standalone/.next/static/chunks/{2i8eu37_ggvr8.js → 1smbfkd1cb015.js} +10 -10
  105. package/standalone/.next/static/chunks/1ynnv9u7cfr4c.js +1 -0
  106. package/standalone/.next/static/chunks/1yx2no0f8qqs5.js +7 -0
  107. package/standalone/.next/static/chunks/{3kswwcsm5y95r.js → 1zw6r-idmbfgl.js} +1 -1
  108. package/standalone/.next/static/chunks/224rpxiffot1u.js +9 -0
  109. package/standalone/.next/static/chunks/24tqnzr1nzhom.js +1 -0
  110. package/standalone/.next/static/chunks/292r4qzwbnzg7.js +45 -0
  111. package/standalone/.next/static/chunks/{3zmi_6t6n2zhl.js → 29bdsmo8ketwt.js} +2 -2
  112. package/standalone/.next/static/chunks/{08n97leuqvfec.js → 29pirjk9q8gfx.js} +1 -1
  113. package/standalone/.next/static/chunks/{0gduhhe5i5fyj.js → 2bdfoatg4qo7w.js} +1 -1
  114. package/standalone/.next/static/chunks/{1mdi8gmbt3v4y.js → 2mzx47_wqfqf6.js} +1 -1
  115. package/standalone/.next/static/chunks/2rplo_7t3zrb9.js +1 -0
  116. package/standalone/.next/static/chunks/{0txd8z6bbq8sd.js → 2rv5r0dwu0nv6.js} +1 -1
  117. package/standalone/.next/static/chunks/2u51t_6-1w566.js +1 -0
  118. package/standalone/.next/static/chunks/{3fdxq7wzqx26o.js → 2xgehciyxxmdl.js} +1 -1
  119. package/standalone/.next/static/chunks/34pq01spesbci.js +1 -0
  120. package/standalone/.next/static/chunks/34pqiakzvfxgg.js +1 -0
  121. package/standalone/.next/static/chunks/{3g004cn7om3tw.js → 35hg231a8ig1t.js} +1 -1
  122. package/standalone/.next/static/chunks/36r84wnfwt4kn.css +1 -0
  123. package/standalone/.next/static/chunks/{11x96hq8bk827.js → 37dd1jthysw7j.js} +1 -1
  124. package/standalone/.next/static/chunks/{2cohukhgw3x39.js → 384f6qhpff4pn.js} +3 -3
  125. package/standalone/.next/static/chunks/3_xim7hqyyfr0.js +1 -0
  126. package/standalone/.next/static/chunks/3eumqpi7f1fek.js +30 -0
  127. package/standalone/.next/static/chunks/{1209uyjs06prv.js → 3hq055db_1oe4.js} +1 -1
  128. package/standalone/.next/static/chunks/3ns362pjxzs4s.js +3 -0
  129. package/standalone/.next/static/chunks/3ojl4tmmy52v4.js +29 -0
  130. package/standalone/.next/static/chunks/3sxc882-vifa-.js +10 -0
  131. package/standalone/.next/static/chunks/40k5mbsz_tzvi.js +1 -0
  132. package/standalone/.next/static/chunks/43pkxbd7uiq6-.js +33 -0
  133. package/standalone/.next/static/chunks/00vmfj3b0p_9v.js +0 -1
  134. package/standalone/.next/static/chunks/05qk7dn22ctyw.js +0 -33
  135. package/standalone/.next/static/chunks/08b5rziqjcmmv.js +0 -9
  136. package/standalone/.next/static/chunks/0hcrlyp4czqm4.js +0 -33
  137. package/standalone/.next/static/chunks/0kkylz4dfb-6-.css +0 -1
  138. package/standalone/.next/static/chunks/0ouxq2tjuuo5p.js +0 -1
  139. package/standalone/.next/static/chunks/0qslkhjg4g4wo.js +0 -1
  140. package/standalone/.next/static/chunks/0sgv58x3pi1lt.js +0 -1
  141. package/standalone/.next/static/chunks/1-uwntvgs-8hy.js +0 -7
  142. package/standalone/.next/static/chunks/175wjcrz57-r8.js +0 -3
  143. package/standalone/.next/static/chunks/1aymjnttvjkz8.js +0 -35
  144. package/standalone/.next/static/chunks/1p0jamt--jvn2.js +0 -1
  145. package/standalone/.next/static/chunks/1wm2l6ainzpua.js +0 -30
  146. package/standalone/.next/static/chunks/2aaudeflwvhrw.js +0 -1
  147. package/standalone/.next/static/chunks/2jj9hlwqhy5pr.js +0 -41
  148. package/standalone/.next/static/chunks/2ldet81o6fvx9.js +0 -7
  149. package/standalone/.next/static/chunks/2nnls3_0a15ot.js +0 -1
  150. package/standalone/.next/static/chunks/32ynps2o_ve-q.js +0 -10
  151. package/standalone/.next/static/chunks/3812zpxehpne1.js +0 -1
  152. package/standalone/.next/static/chunks/398-3q0cwr6rj.js +0 -29
  153. package/standalone/.next/static/chunks/3f0s63l_3ts3k.js +0 -1
  154. package/standalone/.next/static/chunks/3ognjxt-gne6-.js +0 -1
  155. package/standalone/.next/static/chunks/3q82abj2-3h1-.js +0 -1
  156. package/standalone/.next/static/chunks/3zux6x75u6-5-.js +0 -1
  157. package/standalone/.next/static/chunks/4260c5fq33ytz.js +0 -7
  158. package/standalone/.next/static/chunks/448r-ornlfrsf.js +0 -45
  159. /package/standalone/.next/static/{7EXYkB15Ckf6ytAAy22z6 → _yJljIblhKpKw6X4lPPg3}/_buildManifest.js +0 -0
  160. /package/standalone/.next/static/{7EXYkB15Ckf6ytAAy22z6 → _yJljIblhKpKw6X4lPPg3}/_clientMiddlewareManifest.js +0 -0
  161. /package/standalone/.next/static/{7EXYkB15Ckf6ytAAy22z6 → _yJljIblhKpKw6X4lPPg3}/_ssgManifest.js +0 -0
@@ -0,0 +1,33 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,624687,e=>{"use strict";var t=e.i(843476),r=e.i(975157);e.s(["Textarea",0,function({className:e,...a}){return(0,t.jsx)("textarea",{className:(0,r.cn)("min-h-24 w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50",e),...a})}])},711241,e=>{"use strict";let t=(0,e.i(456420).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,t],711241)},929592,e=>{"use strict";var t=e.i(843476),r=e.i(225913),a=e.i(975157);let n=(0,r.cva)("group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current"}},defaultVariants:{variant:"default"}});e.s(["Alert",0,function({className:e,variant:r,...i}){return(0,t.jsx)("div",{"data-slot":"alert",role:"alert",className:(0,a.cn)(n({variant:r}),e),...i})},"AlertDescription",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"alert-description",className:(0,a.cn)("text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",e),...r})}])},758379,e=>{"use strict";let t=(0,e.i(456420).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["default",0,t])},987968,e=>{"use strict";var t=e.i(843476),r=e.i(975157),a=e.i(758379),a=a;e.s(["Spinner",0,function({className:e,...n}){return(0,t.jsx)(a.default,{"data-slot":"spinner",role:"status","aria-label":"Loading",className:(0,r.cn)("size-4 animate-spin",e),...n})}],987968)},637611,e=>{"use strict";var t,r,a=e.i(247167);function n(e){return null===e?"null":Array.isArray(e)?"array":typeof e}function i(e){return"object"===n(e)}function s(e,t){return e.length<124?e:t}var o=((t=o||{})[t.InternalServerError=4500]="InternalServerError",t[t.InternalClientError=4005]="InternalClientError",t[t.BadRequest=4400]="BadRequest",t[t.BadResponse=4004]="BadResponse",t[t.Unauthorized=4401]="Unauthorized",t[t.Forbidden=4403]="Forbidden",t[t.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",t[t.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",t[t.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",t[t.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",t[t.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests",t),l=((r=l||{}).ConnectionInit="connection_init",r.ConnectionAck="connection_ack",r.Ping="ping",r.Pong="pong",r.Subscribe="subscribe",r.Next="next",r.Error="error",r.Complete="complete",r);function d(e){if(!i(e))throw Error(`Message is expected to be an object, but got ${n(e)}`);if(!e.type)throw Error("Message is missing the 'type' property");if("string"!=typeof e.type)throw Error(`Message is expects the 'type' property to be a string, but got ${n(e.type)}`);switch(e.type){case"connection_init":case"connection_ack":case"ping":case"pong":if(null!=e.payload&&!i(e.payload))throw Error(`"${e.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${e.payload}"`);break;case"subscribe":if("string"!=typeof e.id)throw Error(`"${e.type}" message expects the 'id' property to be a string, but got ${n(e.id)}`);if(!e.id)throw Error(`"${e.type}" message requires a non-empty 'id' property`);if(!i(e.payload))throw Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${n(e.payload)}`);if("string"!=typeof e.payload.query)throw Error(`"${e.type}" message payload expects the 'query' property to be a string, but got ${n(e.payload.query)}`);if(null!=e.payload.variables&&!i(e.payload.variables))throw Error(`"${e.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${n(e.payload.variables)}`);if(null!=e.payload.operationName&&"string"!==n(e.payload.operationName))throw Error(`"${e.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${n(e.payload.operationName)}`);if(null!=e.payload.extensions&&!i(e.payload.extensions))throw Error(`"${e.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${n(e.payload.extensions)}`);break;case"next":if("string"!=typeof e.id)throw Error(`"${e.type}" message expects the 'id' property to be a string, but got ${n(e.id)}`);if(!e.id)throw Error(`"${e.type}" message requires a non-empty 'id' property`);if(!i(e.payload))throw Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${n(e.payload)}`);break;case"error":var t;if("string"!=typeof e.id)throw Error(`"${e.type}" message expects the 'id' property to be a string, but got ${n(e.id)}`);if(!e.id)throw Error(`"${e.type}" message requires a non-empty 'id' property`);if(!(Array.isArray(t=e.payload)&&t.length>0&&t.every(e=>"message"in e)))throw Error(`"${e.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(e.payload)}`);break;case"complete":if("string"!=typeof e.id)throw Error(`"${e.type}" message expects the 'id' property to be a string, but got ${n(e.id)}`);if(!e.id)throw Error(`"${e.type}" message requires a non-empty 'id' property`);break;default:throw Error(`Invalid message 'type' property "${e.type}"`)}return e}function c(e,t){return d(e),JSON.stringify(e,t)}class u extends Error{name="TerminatedCloseEvent";message="4499: Terminated";code=4499;reason="Terminated";wasClean=!1}function p(e){return i(e)&&"code"in e&&"reason"in e}async function f(e,t){let r=await fetch("/api/graphql",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({query:e,variables:t})}),a=await r.json();if(!r.ok||a.errors?.length||!a.data)throw Error(a.errors?.map(e=>e.message).join("; ")||`HTTP ${r.status}`);return a.data}let h=null;function m(){return function(e,t,r){let a=`${"https:"===t?"wss":"ws"}://${r}/graphql`;if(!e)return a;try{let r=new URL(e);if("https:"===t&&"wss:"!==r.protocol)return a}catch{}return e}(a.default.env.NEXT_PUBLIC_AGENT_WS_URL,window.location.protocol,window.location.host)}e.s(["controlPlaneRequest",0,f,"controlPlaneSubscriptions",0,function(){return h??=function(t){let r,a,n,i,{url:f,connectionParams:h,lazy:m=!0,onNonLazyError:g=console.error,lazyCloseTimeout:x=0,keepAlive:b=0,disablePong:y,connectionAckWaitTimeout:v=0,retryAttempts:j=5,retryWait:E=async function(e){let t=Math.pow(2,e);await new Promise(e=>setTimeout(e,1e3*t+Math.floor(2700*Math.random()+300)))},shouldRetry:C=p,on:w,webSocketImpl:D,generateID:N=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})},jsonMessageReplacer:S,jsonMessageReviver:A}=t;if(D){var T;if(!("function"==typeof(T=D)&&"constructor"in T&&"CLOSED"in T&&"CLOSING"in T&&"CONNECTING"in T&&"OPEN"in T))throw Error("Invalid WebSocket implementation provided");r=D}else r="u">typeof WebSocket?WebSocket:e.g.WebSocket||e.g.MozWebSocket;if(!r)throw Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");let I=r,R=(a={},n={on:(e,t)=>(a[e]=t,()=>{delete a[e]}),emit(e){"id"in e&&a[e.id]?.(e)}},i={connecting:w?.connecting?[w.connecting]:[],opened:w?.opened?[w.opened]:[],connected:w?.connected?[w.connected]:[],ping:w?.ping?[w.ping]:[],pong:w?.pong?[w.pong]:[],message:w?.message?[n.emit,w.message]:[n.emit],closed:w?.closed?[w.closed]:[],error:w?.error?[w.error]:[]},{onMessage:n.on,on(e,t){let r=i[e];return r.push(t),()=>{r.splice(r.indexOf(t),1)}},emit(e,...t){for(let r of[...i[e]])r(...t)}});function _(e){let t=[R.on("error",r=>{t.forEach(e=>e()),e(r)}),R.on("closed",r=>{t.forEach(e=>e()),e(r)})]}let k,O=0,B,$=!1,L=0,P=!1;async function J(){clearTimeout(B);let[e,t]=await (k??(k=new Promise((e,t)=>(async()=>{let r,a;if($){if(await E(L),!O)return k=void 0,t({code:1e3,reason:"All Subscriptions Gone"});L++}R.emit("connecting",$);let n=new I("function"==typeof f?await f():f,"graphql-transport-ws");function i(){isFinite(b)&&b>0&&(clearTimeout(a),a=setTimeout(()=>{n.readyState===I.OPEN&&(n.send(c({type:l.Ping})),R.emit("ping",!1,void 0))},b))}_(e=>{k=void 0,clearTimeout(r),clearTimeout(a),t(e),e instanceof u&&(n.close(4499,"Terminated"),n.onerror=null,n.onclose=null)}),n.onerror=e=>R.emit("error",e),n.onclose=e=>R.emit("closed",e),n.onopen=async()=>{try{R.emit("opened",n);let e="function"==typeof h?await h():h;if(n.readyState!==I.OPEN)return;n.send(c(e?{type:l.ConnectionInit,payload:e}:{type:l.ConnectionInit},S)),isFinite(v)&&v>0&&(r=setTimeout(()=>{n.close(o.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},v)),i()}catch(e){R.emit("error",e),n.close(o.InternalClientError,s(e instanceof Error?e.message:String(e),"Internal client error"))}};let p=!1;n.onmessage=({data:t})=>{try{let a=d("string"==typeof t?JSON.parse(t,A):t);if(R.emit("message",a),"ping"===a.type||"pong"===a.type){R.emit(a.type,!0,a.payload),"pong"===a.type?i():y||(n.send(c(a.payload?{type:l.Pong,payload:a.payload}:{type:l.Pong})),R.emit("pong",!1,a.payload));return}if(p)return;if(a.type!==l.ConnectionAck)throw Error(`First message cannot be of type ${a.type}`);clearTimeout(r),p=!0,R.emit("connected",n,a.payload,$),$=!1,L=0,e([n,new Promise((e,t)=>_(t))])}catch(e){n.onmessage=null,R.emit("error",e),n.close(o.BadResponse,s(e instanceof Error?e.message:String(e),"Bad response"))}}})())));e.readyState===I.CLOSING&&await t;let r=()=>{},a=new Promise(e=>r=e);return[e,r,Promise.race([a.then(()=>{O||(isFinite(x)&&x>0?B=setTimeout(()=>{e.readyState===I.OPEN&&e.close(1e3,"Normal Closure")},x):e.close(1e3,"Normal Closure"))}),t])]}function z(e){var t;if(p(e)&&(![1e3,1001,1006,1005,1012,1013,1014].includes(t=e.code)&&t>=1e3&&t<=1999||[o.InternalServerError,o.InternalClientError,o.BadRequest,o.BadResponse,o.Unauthorized,o.SubprotocolNotAcceptable,o.SubscriberAlreadyExists,o.TooManyInitialisationRequests].includes(e.code)))throw e;if(P)return!1;if(p(e)&&1e3===e.code)return O>0;if(!j||L>=j||!C(e))throw e;return $=!0}function M(e,t){let r=N(e),a=!1,n=!1,i=()=>{O--,a=!0};return(async()=>{for(O++;;)try{let[s,o,d]=await J();if(a)return o();let u=R.onMessage(r,e=>{switch(e.type){case l.Next:return void t.next(e.payload);case l.Error:n=!0,a=!0,t.error(e.payload),i();return;case l.Complete:a=!0,i();return}});s.send(c({id:r,type:l.Subscribe,payload:e},S)),i=()=>{a||s.readyState!==I.OPEN||s.send(c({id:r,type:l.Complete},S)),O--,a=!0,o()},await d.finally(u);return}catch(e){if(!z(e))return}})().then(()=>{n||t.complete()}).catch(e=>{t.error(e)}),()=>{a||i()}}return m||(async()=>{for(O++;;)try{let[,,e]=await J();await e}catch(e){try{if(!z(e))return}catch(e){return g?.(e)}}})(),{on:R.on,subscribe:M,iterate(e){let t=[],r={done:!1,error:null,resolve:()=>{}},a=M(e,{next(e){t.push(e),r.resolve()},error(e){r.done=!0,r.error=e,r.resolve()},complete(){r.done=!0,r.resolve()}}),n=async function*(){for(;;){for(t.length||await new Promise(e=>r.resolve=e);t.length;)yield t.shift();if(r.error)throw r.error;if(r.done)return}}();return n.throw=async e=>(r.done||(r.done=!0,r.error=e,r.resolve()),{done:!0,value:void 0}),n.return=async()=>(a(),{done:!0,value:void 0}),n},async dispose(){if(P=!0,k){let[e]=await k;e.close(1e3,"Normal Closure")}},terminate(){k&&R.emit("closed",new u)}}}({url:m,lazy:!0,retryAttempts:1/0,shouldRetry:()=>!0})}],637611)},515288,e=>{"use strict";var t=e.i(843476),r=e.i(975157);e.s(["Card",0,function({className:e,size:a="default",...n}){return(0,t.jsx)("div",{"data-slot":"card","data-size":a,className:(0,r.cn)("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>[data-slot=card-header]]:pt-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...n})},"CardAction",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-action",className:(0,r.cn)("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e),...a})},"CardContent",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,r.cn)("px-(--card-spacing)",e),...a})},"CardDescription",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-description",className:(0,r.cn)("text-sm text-muted-foreground",e),...a})},"CardFooter",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-footer",className:(0,r.cn)("flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)",e),...a})},"CardHeader",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,r.cn)("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl bg-muted/40 px-(--card-spacing) py-(--card-spacing) not-last:border-b has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto]",e),...a})},"CardTitle",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-title",className:(0,r.cn)("font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",e),...a})}])},487486,e=>{"use strict";var t=e.i(843476),r=e.i(225913),a=e.i(709840),n=e.i(975157);let i=(0,r.cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",success:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300 [a]:hover:bg-emerald-500/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});e.s(["Badge",0,function({className:e,variant:r="default",asChild:s=!1,...o}){let l=s?a.Slot.Root:"span";return(0,t.jsx)(l,{className:(0,n.cn)(i({variant:r}),e),"data-slot":"badge","data-variant":r,...o})}])},784774,e=>{"use strict";var t=e.i(843476),r=e.i(975157);e.s(["Table",0,function({className:e,containerClassName:a,...n}){return(0,t.jsx)("div",{className:(0,r.cn)("w-full overflow-x-auto",a),children:(0,t.jsx)("table",{className:(0,r.cn)("w-full caption-bottom text-sm",e),...n})})},"TableBody",0,function({className:e,...a}){return(0,t.jsx)("tbody",{className:(0,r.cn)("divide-y",e),...a})},"TableCell",0,function({className:e,...a}){return(0,t.jsx)("td",{className:(0,r.cn)("whitespace-nowrap px-3 py-3 align-middle",e),...a})},"TableFooter",0,function({className:e,...a}){return(0,t.jsx)("tfoot",{className:(0,r.cn)("border-t bg-muted/50 font-medium",e),...a})},"TableHead",0,function({className:e,...a}){return(0,t.jsx)("th",{className:(0,r.cn)("h-10 whitespace-nowrap px-3 text-left align-middle text-xs font-medium text-muted-foreground",e),...a})},"TableHeader",0,function({className:e,...a}){return(0,t.jsx)("thead",{className:(0,r.cn)("border-b",e),...a})},"TableRow",0,function({className:e,...a}){return(0,t.jsx)("tr",{className:(0,r.cn)("transition-colors hover:bg-muted/40",e),...a})}])},573474,e=>{"use strict";let t=(0,e.i(456420).default)("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.s(["Trash2",0,t],573474)},340953,e=>{"use strict";var t=e.i(843476),r=e.i(271645),a=e.i(30030);function n(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function i(...e){return r.useCallback(function(...e){return t=>{let r=!1,a=e.map(e=>{let a=n(e,t);return r||"function"!=typeof a||(r=!0),a});if(r)return()=>{for(let t=0;t<a.length;t++){let r=a[t];"function"==typeof r?r():n(e[t],null)}}}}(...e),e)}var s=e.i(326999);"u">typeof window&&window.document&&window.document.createElement;var o="AlertDialog",[l,d]=(0,a.createContextScope)(o,[s.createDialogScope]),c=(0,s.createDialogScope)(),u=e=>{let{__scopeAlertDialog:r,...a}=e,n=c(r);return(0,t.jsx)(s.Root,{...n,...a,modal:!0})};u.displayName=o;var p=r.forwardRef((e,r)=>{let{__scopeAlertDialog:a,...n}=e,i=c(a);return(0,t.jsx)(s.Trigger,{...i,...n,ref:r})});p.displayName="AlertDialogTrigger";var f=e=>{let{__scopeAlertDialog:r,...a}=e,n=c(r);return(0,t.jsx)(s.Portal,{...n,...a})};f.displayName="AlertDialogPortal";var h=r.forwardRef((e,r)=>{let{__scopeAlertDialog:a,...n}=e,i=c(a);return(0,t.jsx)(s.Overlay,{...i,...n,ref:r})});h.displayName="AlertDialogOverlay";var m="AlertDialogContent",[g,x]=l(m),b=r.forwardRef((e,a)=>{let{__scopeAlertDialog:n,children:o,...l}=e,d=c(n),u=i(a,r.useRef(null)),p=r.useRef(null);return(0,t.jsx)(g,{scope:n,cancelRef:p,children:(0,t.jsx)(s.Content,{role:"alertdialog",...d,...l,ref:u,onOpenAutoFocus:function(e,t,{checkForDefaultPrevented:r=!0}={}){return function(a){if(e?.(a),!1===r||!a||!a.defaultPrevented)return t?.(a)}}(l.onOpenAutoFocus,e=>{e.preventDefault(),p.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:o})})});b.displayName=m;var y=r.forwardRef((e,r)=>{let{__scopeAlertDialog:a,...n}=e,i=c(a);return(0,t.jsx)(s.Title,{...i,...n,ref:r})});y.displayName="AlertDialogTitle";var v=r.forwardRef((e,r)=>{let{__scopeAlertDialog:a,...n}=e,i=c(a);return(0,t.jsx)(s.Description,{...i,...n,ref:r})});v.displayName="AlertDialogDescription";var j=r.forwardRef((e,r)=>{let{__scopeAlertDialog:a,...n}=e,i=c(a);return(0,t.jsx)(s.Close,{...i,...n,ref:r})});j.displayName="AlertDialogAction";var E="AlertDialogCancel",C=r.forwardRef((e,r)=>{let{__scopeAlertDialog:a,...n}=e,{cancelRef:o}=x(E,a),l=c(a),d=i(r,o);return(0,t.jsx)(s.Close,{...l,...n,ref:d})});C.displayName=E,e.s(["Action",0,j,"AlertDialog",0,u,"AlertDialogAction",0,j,"AlertDialogCancel",0,C,"AlertDialogContent",0,b,"AlertDialogDescription",0,v,"AlertDialogOverlay",0,h,"AlertDialogPortal",0,f,"AlertDialogTitle",0,y,"AlertDialogTrigger",0,p,"Cancel",0,C,"Content",0,b,"Description",0,v,"Overlay",0,h,"Portal",0,f,"Root",0,u,"Title",0,y,"Trigger",0,p,"createAlertDialogScope",0,d],691162);var w=e.i(691162),w=w,D=e.i(975157),N=e.i(519455);function S({...e}){return(0,t.jsx)(w.Root,{"data-slot":"alert-dialog",...e})}function A({...e}){return(0,t.jsx)(w.Trigger,{"data-slot":"alert-dialog-trigger",...e})}function T({...e}){return(0,t.jsx)(w.Portal,{"data-slot":"alert-dialog-portal",...e})}function I({className:e,...r}){return(0,t.jsx)(w.Overlay,{"data-slot":"alert-dialog-overlay",className:(0,D.cn)("fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...r})}function R({className:e,size:r="default",...a}){return(0,t.jsxs)(T,{children:[(0,t.jsx)(I,{}),(0,t.jsx)(w.Content,{"data-slot":"alert-dialog-content","data-size":r,className:(0,D.cn)("group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...a})]})}function _({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-header",className:(0,D.cn)("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",e),...r})}function k({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-footer",className:(0,D.cn)("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",e),...r})}function O({className:e,...r}){return(0,t.jsx)(w.Title,{"data-slot":"alert-dialog-title",className:(0,D.cn)("font-heading text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",e),...r})}function B({className:e,...r}){return(0,t.jsx)(w.Description,{"data-slot":"alert-dialog-description",className:(0,D.cn)("text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...r})}function $({className:e,variant:r="default",size:a="default",...n}){return(0,t.jsx)(N.Button,{variant:r,size:a,asChild:!0,children:(0,t.jsx)(w.Action,{"data-slot":"alert-dialog-action",className:(0,D.cn)(e),...n})})}function L({className:e,variant:r="outline",size:a="default",...n}){return(0,t.jsx)(N.Button,{variant:r,size:a,asChild:!0,children:(0,t.jsx)(w.Cancel,{"data-slot":"alert-dialog-cancel",className:(0,D.cn)(e),...n})})}e.s(["ConfirmationDialog",0,function({actionLabel:e,cancelLabel:r,description:a,onConfirm:n,onOpenChange:i,open:s,title:o,trigger:l}){return(0,t.jsxs)(S,{onOpenChange:i,open:s,children:[l&&(0,t.jsx)(A,{asChild:!0,children:l}),(0,t.jsxs)(R,{children:[(0,t.jsxs)(_,{children:[(0,t.jsx)(O,{children:o}),(0,t.jsx)(B,{children:a})]}),(0,t.jsxs)(k,{children:[(0,t.jsx)(L,{children:r}),(0,t.jsx)($,{onClick:()=>void n(),variant:"destructive",children:e})]})]})]})}],340953)},778434,e=>{"use strict";e.s(["AGENT_FIELDS",0,"id name hostname version osVersion architecture cpuModel memoryTotalBytes memoryFreeBytes diskTotalBytes diskFreeBytes capabilities baseRepoDirectory derivedDataLocationMode derivedDataPath buildsDirectory defaultBuildsDirectory effectiveBuildsDirectory connectionStatus ipAddress lastSeenAt disconnectedAt createdAt","JOB_FIELDS",0,"id agentId kind payload status error result timeoutSeconds createdAt startedAt finishedAt updatedAt","JOB_LOG_FIELDS",0,"id jobId sequence stream message createdAt"])},59497,e=>{"use strict";var t=e.i(843476),r=e.i(271645);function a(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function n(...e){return r.useCallback(function(...e){return t=>{let r=!1,n=e.map(e=>{let n=a(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){let r=n[t];"function"==typeof r?r():a(e[t],null)}}}}(...e),e)}var i=e.i(30030);function s(e,t,{checkForDefaultPrevented:r=!0}={}){return function(a){if(e?.(a),!1===r||!a||!a.defaultPrevented)return t?.(a)}}"u">typeof window&&window.document&&window.document.createElement;var o=globalThis?.document?r.useLayoutEffect:()=>{};r[" useEffectEvent ".trim().toString()],r[" useInsertionEffect ".trim().toString()];var l=r[" useInsertionEffect ".trim().toString()]||o;Symbol("RADIX:SYNC_STATE");var d=e.i(999682),c=e.i(635804),u=e.i(296626);e.i(174080);var p=Symbol.for("radix.slottable"),f=Symbol.for("react.lazy");function h(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===f&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}var m=r[" use ".trim().toString()],g=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,a)=>{var i;let s,o=(i=`Primitive.${a}`,(s=r.forwardRef((e,t)=>{var a;let s,o,{children:l,...d}=e,c=null,u=!1,f=[];h(l)&&"function"==typeof m&&(l=m(l._payload)),r.Children.forEach(l,e=>{var t;if(t=e,r.isValidElement(t)&&"function"==typeof t.type&&"__radixId"in t.type&&t.type.__radixId===p){u=!0;let t="child"in e.props?e.props.child:e.props.children;h(t)&&"function"==typeof m&&(t=m(t._payload)),c=((e,t)=>{if("child"in e.props){let t=e.props.child;return r.isValidElement(t)?r.cloneElement(t,void 0,e.props.children(t.props.children)):null}return r.isValidElement(t)?t:null})(e,t),f.push(c?.props?.children)}else f.push(e)}),c?c=r.cloneElement(c,void 0,f):!u&&1===r.Children.count(l)&&r.isValidElement(l)&&(c=l);let g=c?(a=c,(o=(s=Object.getOwnPropertyDescriptor(a.props,"ref")?.get)&&"isReactWarning"in s&&s.isReactWarning)?a.ref:(o=(s=Object.getOwnPropertyDescriptor(a,"ref")?.get)&&"isReactWarning"in s&&s.isReactWarning)?a.props.ref:a.props.ref||a.ref):void 0,x=n(t,g);if(!c){if(l||0===l){let e,t;throw Error(u?(e=i,`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`):(t=i,`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`))}return l}let b=function(e,t){let r={...t};for(let a in t){let n=e[a],i=t[a];/^on[A-Z]/.test(a)?n&&i?r[a]=(...e)=>{let t=i(...e);return n(...e),t}:n&&(r[a]=n):"style"===a?r[a]={...n,...i}:"className"===a&&(r[a]=[n,i].filter(Boolean).join(" "))}return{...e,...r}}(d,c.props??{});return c.type!==r.Fragment&&(b.ref=t?x:g),r.cloneElement(c,b)})).displayName=`${i}.Slot`,s),l=r.forwardRef((e,r)=>{let{asChild:n,...i}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,t.jsx)(n?o:a,{...i,ref:r})});return l.displayName=`Primitive.${a}`,{...e,[a]:l}},{}),x="Checkbox",[b,y]=(0,i.createContextScope)(x),[v,j]=b(x);function E(e){let{__scopeCheckbox:a,checked:n,children:i,defaultChecked:s,disabled:o,form:d,name:c,onCheckedChange:u,required:p,value:f="on",internal_do_not_use_render:h}=e,[m,g]=function({prop:e,defaultProp:t,onChange:a=()=>{},caller:n}){let[i,s,o]=function({defaultProp:e,onChange:t}){let[a,n]=r.useState(e),i=r.useRef(a),s=r.useRef(t);return l(()=>{s.current=t},[t]),r.useEffect(()=>{i.current!==a&&(s.current?.(a),i.current=a)},[a,i]),[a,n,s]}({defaultProp:t,onChange:a}),d=void 0!==e,c=d?e:i;{let t=r.useRef(void 0!==e);r.useEffect(()=>{let e=t.current;if(e!==d){let t=d?"controlled":"uncontrolled";console.warn(`${n} is changing from ${e?"controlled":"uncontrolled"} to ${t}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=d},[d,n])}return[c,r.useCallback(t=>{if(d){let r="function"==typeof t?t(e):t;r!==e&&o.current?.(r)}else s(t)},[d,e,s,o])]}({prop:n,defaultProp:s??!1,onChange:u,caller:x}),[b,y]=r.useState(null),[j,E]=r.useState(null),C=r.useRef(!1),w=!b||!!d||!!b.closest("form"),D={checked:m,disabled:o,setChecked:g,control:b,setControl:y,name:c,form:d,value:f,hasConsumerStoppedPropagationRef:C,required:p,defaultChecked:!I(s)&&s,isFormControl:w,bubbleInput:j,setBubbleInput:E};return(0,t.jsx)(v,{scope:a,...D,children:"function"==typeof h?h(D):i})}var C="CheckboxTrigger",w=r.forwardRef(({__scopeCheckbox:e,onKeyDown:a,onClick:i,...o},l)=>{let{control:d,value:c,disabled:u,checked:p,required:f,setControl:h,setChecked:m,hasConsumerStoppedPropagationRef:x,isFormControl:b,bubbleInput:y}=j(C,e),v=n(l,h),E=r.useRef(p);return r.useEffect(()=>{let e=d?.form;if(e){let t=()=>m(E.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[d,m]),(0,t.jsx)(g.button,{type:"button",role:"checkbox","aria-checked":I(p)?"mixed":p,"aria-required":f,"data-state":R(p),"data-disabled":u?"":void 0,disabled:u,value:c,...o,ref:v,onKeyDown:s(a,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:s(i,e=>{m(e=>!!I(e)||!e),y&&b&&(x.current=e.isPropagationStopped(),x.current||e.stopPropagation())})})});w.displayName=C;var D=r.forwardRef((e,r)=>{let{__scopeCheckbox:a,name:n,checked:i,defaultChecked:s,required:o,disabled:l,value:d,onCheckedChange:c,form:u,...p}=e;return(0,t.jsx)(E,{__scopeCheckbox:a,checked:i,defaultChecked:s,disabled:l,required:o,onCheckedChange:c,name:n,form:u,value:d,internal_do_not_use_render:({isFormControl:e})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w,{...p,ref:r,__scopeCheckbox:a}),e&&(0,t.jsx)(T,{__scopeCheckbox:a})]})})});D.displayName=x;var N="CheckboxIndicator",S=r.forwardRef((e,r)=>{let{__scopeCheckbox:a,forceMount:n,...i}=e,s=j(N,a);return(0,t.jsx)(u.Presence,{present:n||I(s.checked)||!0===s.checked,children:(0,t.jsx)(g.span,{"data-state":R(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:r,style:{pointerEvents:"none",...e.style}})})});S.displayName=N;var A="CheckboxBubbleInput",T=r.forwardRef(({__scopeCheckbox:e,...a},i)=>{let{control:s,hasConsumerStoppedPropagationRef:o,checked:l,defaultChecked:u,required:p,disabled:f,name:h,value:m,form:x,bubbleInput:b,setBubbleInput:y}=j(A,e),v=n(i,y),E=(0,d.usePrevious)(l),C=(0,c.useSize)(s);r.useEffect(()=>{if(!b)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,t=!o.current;if(E!==l&&e){let r=new Event("click",{bubbles:t});b.indeterminate=I(l),e.call(b,!I(l)&&l),b.dispatchEvent(r)}},[b,E,l,o]);let w=r.useRef(!I(l)&&l);return(0,t.jsx)(g.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??w.current,required:p,disabled:f,name:h,value:m,form:x,...a,tabIndex:-1,ref:v,style:{...a.style,...C,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function I(e){return"indeterminate"===e}function R(e){return I(e)?"indeterminate":e?"checked":"unchecked"}T.displayName=A,e.s(["Checkbox",0,D,"CheckboxIndicator",0,S,"Indicator",0,S,"Root",0,D,"createCheckboxScope",0,y,"unstable_BubbleInput",0,T,"unstable_CheckboxBubbleInput",0,T,"unstable_CheckboxProvider",0,E,"unstable_CheckboxTrigger",0,w,"unstable_Provider",0,E,"unstable_Trigger",0,w],388474);var _=e.i(388474),_=_,k=e.i(975157),O=e.i(593698);e.s(["Checkbox",0,function({className:e,...r}){return(0,t.jsx)(_.Root,{"data-slot":"checkbox",className:(0,k.cn)("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary",e),...r,children:(0,t.jsx)(_.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:(0,t.jsx)(O.CheckIcon,{})})})}],59497)},630299,e=>{"use strict";let t=(0,e.i(456420).default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["default",0,t])},566595,e=>{"use strict";var t=e.i(630299);e.s(["Search",()=>t.default])},82612,e=>{"use strict";var t=e.i(843476),r=e.i(225913),a=e.i(975157);let n=(0,r.cva)("mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",icon:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-4"}},defaultVariants:{variant:"default"}});e.s(["Empty",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"empty",className:(0,a.cn)("flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-xl border-dashed p-6 text-center text-balance",e),...r})},"EmptyDescription",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"empty-description",className:(0,a.cn)("text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",e),...r})},"EmptyHeader",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"empty-header",className:(0,a.cn)("flex max-w-sm flex-col items-center gap-2",e),...r})},"EmptyMedia",0,function({className:e,variant:r="default",...i}){return(0,t.jsx)("div",{"data-slot":"empty-icon","data-variant":r,className:(0,a.cn)(n({variant:r,className:e})),...i})},"EmptyTitle",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"empty-title",className:(0,a.cn)("font-heading text-sm font-medium tracking-tight",e),...r})}])},689664,e=>{"use strict";var t=e.i(643957);e.s(["Check",()=>t.default])},508734,e=>{"use strict";let t=(0,e.i(456420).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,t],508734)},867927,e=>{"use strict";var t=e.i(986253);e.s(["ChevronRight",()=>t.default])},462777,e=>{"use strict";async function t(e){if(navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(e);return}catch{}let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.append(t),t.select();let r=document.execCommand("copy");if(t.remove(),!r)throw Error("Copy is not supported by this browser")}e.s(["copyText",0,t,"createClientId",0,function(){try{if(globalThis.crypto?.randomUUID)return globalThis.crypto.randomUUID()}catch{}if(globalThis.crypto?.getRandomValues)try{let e=globalThis.crypto.getRandomValues(new Uint8Array(16));return Array.from(e,e=>e.toString(16).padStart(2,"0")).join("")}catch{}return`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}])},716327,e=>{"use strict";var t=e.i(26495);e.s(["ChevronDown",()=>t.default])},110204,e=>{"use strict";var t=e.i(843476),r=e.i(271645);function a(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}e.i(174080);var n=Symbol.for("radix.slottable"),i=Symbol.for("react.lazy");function s(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===i&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}var o=r[" use ".trim().toString()],l=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,i)=>{var l;let d,c=(l=`Primitive.${i}`,(d=r.forwardRef((e,t)=>{var i;let d,c,{children:u,...p}=e,f=null,h=!1,m=[];s(u)&&"function"==typeof o&&(u=o(u._payload)),r.Children.forEach(u,e=>{var t;if(t=e,r.isValidElement(t)&&"function"==typeof t.type&&"__radixId"in t.type&&t.type.__radixId===n){h=!0;let t="child"in e.props?e.props.child:e.props.children;s(t)&&"function"==typeof o&&(t=o(t._payload)),f=((e,t)=>{if("child"in e.props){let t=e.props.child;return r.isValidElement(t)?r.cloneElement(t,void 0,e.props.children(t.props.children)):null}return r.isValidElement(t)?t:null})(e,t),m.push(f?.props?.children)}else m.push(e)}),f?f=r.cloneElement(f,void 0,m):!h&&1===r.Children.count(u)&&r.isValidElement(u)&&(f=u);let g=f?(i=f,(c=(d=Object.getOwnPropertyDescriptor(i.props,"ref")?.get)&&"isReactWarning"in d&&d.isReactWarning)?i.ref:(c=(d=Object.getOwnPropertyDescriptor(i,"ref")?.get)&&"isReactWarning"in d&&d.isReactWarning)?i.props.ref:i.props.ref||i.ref):void 0,x=function(...e){return r.useCallback(function(...e){return t=>{let r=!1,n=e.map(e=>{let n=a(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){let r=n[t];"function"==typeof r?r():a(e[t],null)}}}}(...e),e)}(t,g);if(!f){if(u||0===u){let e,t;throw Error(h?(e=l,`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`):(t=l,`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`))}return u}let b=function(e,t){let r={...t};for(let a in t){let n=e[a],i=t[a];/^on[A-Z]/.test(a)?n&&i?r[a]=(...e)=>{let t=i(...e);return n(...e),t}:n&&(r[a]=n):"style"===a?r[a]={...n,...i}:"className"===a&&(r[a]=[n,i].filter(Boolean).join(" "))}return{...e,...r}}(p,f.props??{});return f.type!==r.Fragment&&(b.ref=t?x:g),r.cloneElement(f,b)})).displayName=`${l}.Slot`,d),u=r.forwardRef((e,r)=>{let{asChild:a,...n}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,t.jsx)(a?c:i,{...n,ref:r})});return u.displayName=`Primitive.${i}`,{...e,[i]:u}},{}),d=r.forwardRef((e,r)=>(0,t.jsx)(l.label,{...e,ref:r,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));d.displayName="Label",e.s(["Label",0,d,"Root",0,d],973741);var c=e.i(973741),c=c,u=e.i(975157);e.s(["Label",0,function({className:e,...r}){return(0,t.jsx)(c.Root,{"data-slot":"label",className:(0,u.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...r})}],110204)},643957,e=>{"use strict";let t=(0,e.i(456420).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",0,t])},999682,e=>{"use strict";var t=e.i(271645);e.s(["usePrevious",0,function(e){let r=t.useRef({value:e,previous:e});return t.useMemo(()=>(r.current.value!==e&&(r.current.previous=r.current.value,r.current.value=e),r.current.previous),[e])}])},593698,e=>{"use strict";var t=e.i(643957);e.s(["CheckIcon",()=>t.default])},75830,586318,e=>{"use strict";var t=e.i(271645),r=e.i(30030);function a(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function n(...e){return t.useCallback(function(...e){return t=>{let r=!1,n=e.map(e=>{let n=a(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){let r=n[t];"function"==typeof r?r():a(e[t],null)}}}}(...e),e)}function i(e){let r=t.forwardRef((r,a)=>{var i;let l,f,{children:h,...m}=r,g=null,x=!1,b=[];d(h)&&"function"==typeof p&&(h=p(h._payload)),t.Children.forEach(h,e=>{var r;if(r=e,t.isValidElement(r)&&"function"==typeof r.type&&"__radixId"in r.type&&r.type.__radixId===s){x=!0;let t="child"in e.props?e.props.child:e.props.children;d(t)&&"function"==typeof p&&(t=p(t._payload)),g=o(e,t),b.push(g?.props?.children)}else b.push(e)}),g?g=t.cloneElement(g,void 0,b):!x&&1===t.Children.count(h)&&t.isValidElement(h)&&(g=h);let y=g?(i=g,(f=(l=Object.getOwnPropertyDescriptor(i.props,"ref")?.get)&&"isReactWarning"in l&&l.isReactWarning)?i.ref:(f=(l=Object.getOwnPropertyDescriptor(i,"ref")?.get)&&"isReactWarning"in l&&l.isReactWarning)?i.props.ref:i.props.ref||i.ref):void 0,v=n(a,y);if(!g){if(h||0===h)throw Error(x?u(e):c(e));return h}let j=function(e,t){let r={...t};for(let a in t){let n=e[a],i=t[a];/^on[A-Z]/.test(a)?n&&i?r[a]=(...e)=>{let t=i(...e);return n(...e),t}:n&&(r[a]=n):"style"===a?r[a]={...n,...i}:"className"===a&&(r[a]=[n,i].filter(Boolean).join(" "))}return{...e,...r}}(m,g.props??{});return g.type!==t.Fragment&&(j.ref=a?v:y),t.cloneElement(g,j)});return r.displayName=`${e}.Slot`,r}var s=Symbol.for("radix.slottable"),o=(e,r)=>{if("child"in e.props){let r=e.props.child;return t.isValidElement(r)?t.cloneElement(r,void 0,e.props.children(r.props.children)):null}return t.isValidElement(r)?r:null},l=Symbol.for("react.lazy");function d(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===l&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}var c=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,u=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,p=t[" use ".trim().toString()],f=e.i(843476),h=new WeakMap;function m(e,t){var r,a;let n,i,s;if("at"in Array.prototype)return Array.prototype.at.call(e,t);let o=(r=e,a=t,n=r.length,(s=(i=g(a))>=0?i:n+i)<0||s>=n?-1:s);return -1===o?void 0:e[o]}function g(e){return e!=e||0===e?0:Math.trunc(e)}(class e extends Map{#e;constructor(e){super(e),this.#e=[...super.keys()],h.set(this,!0)}set(e,t){return h.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,r){let a,n=this.has(t),i=this.#e.length,s=g(e),o=s>=0?s:i+s,l=o<0||o>=i?-1:o;if(l===this.size||n&&l===this.size-1||-1===l)return this.set(t,r),this;let d=this.size+ +!n;s<0&&o++;let c=[...this.#e],u=!1;for(let e=o;e<d;e++)if(o===e){let i=c[e];c[e]===t&&(i=c[e+1]),n&&this.delete(t),a=this.get(i),this.set(t,r)}else{u||c[e-1]!==t||(u=!0);let r=c[u?e:e-1],n=a;a=this.get(r),this.delete(r),this.set(r,n)}return this}with(t,r,a){let n=new e(this);return n.insert(t,r,a),n}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,r){let a=this.#e.indexOf(e);return -1===a?this:this.insert(a,t,r)}after(e){let t=this.#e.indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,r){let a=this.#e.indexOf(e);return -1===a?this:this.insert(a+1,t,r)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=m(this.#e,e);if(void 0!==t)return this.get(t)}entryAt(e){let t=m(this.#e,e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return m(this.#e,e)}from(e,t){let r=this.indexOf(e);if(-1===r)return;let a=r+t;return a<0&&(a=0),a>=this.size&&(a=this.size-1),this.at(a)}keyFrom(e,t){let r=this.indexOf(e);if(-1===r)return;let a=r+t;return a<0&&(a=0),a>=this.size&&(a=this.size-1),this.keyAt(a)}find(e,t){let r=0;for(let a of this){if(Reflect.apply(e,t,[a,r,this]))return a;r++}}findIndex(e,t){let r=0;for(let a of this){if(Reflect.apply(e,t,[a,r,this]))return r;r++}return -1}filter(t,r){let a=[],n=0;for(let e of this)Reflect.apply(t,r,[e,n,this])&&a.push(e),n++;return new e(a)}map(t,r){let a=[],n=0;for(let e of this)a.push([e[0],Reflect.apply(t,r,[e,n,this])]),n++;return new e(a)}reduce(...e){let[t,r]=e,a=0,n=r??this.at(0);for(let r of this)n=0===a&&1===e.length?r:Reflect.apply(t,this,[n,r,a,this]),a++;return n}reduceRight(...e){let[t,r]=e,a=r??this.at(-1);for(let r=this.size-1;r>=0;r--){let n=this.at(r);a=r===this.size-1&&1===e.length?n:Reflect.apply(t,this,[a,n,r,this])}return a}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let r=this.keyAt(e),a=this.get(r);t.set(r,a)}return t}toSpliced(...t){let r=[...this.entries()];return r.splice(...t),new e(r)}slice(t,r){let a=new e,n=this.size-1;if(void 0===t)return a;t<0&&(t+=this.size),void 0!==r&&r>0&&(n=r-1);for(let e=t;e<=n;e++){let t=this.keyAt(e),r=this.get(t);a.set(t,r)}return a}every(e,t){let r=0;for(let a of this){if(!Reflect.apply(e,t,[a,r,this]))return!1;r++}return!0}some(e,t){let r=0;for(let a of this){if(Reflect.apply(e,t,[a,r,this]))return!0;r++}return!1}}),e.s(["createCollection",0,function(e){let a=e+"CollectionProvider",[s,o]=(0,r.createContextScope)(a),[l,d]=s(a,{collectionRef:{current:null},itemMap:new Map}),c=e=>{let{scope:r,children:a}=e,n=t.useRef(null),i=t.useRef(new Map).current;return(0,f.jsx)(l,{scope:r,itemMap:i,collectionRef:n,children:a})};c.displayName=a;let u=e+"CollectionSlot",p=i(u),h=t.forwardRef((e,t)=>{let{scope:r,children:a}=e,i=n(t,d(u,r).collectionRef);return(0,f.jsx)(p,{ref:i,children:a})});h.displayName=u;let m=e+"CollectionItemSlot",g="data-radix-collection-item",x=i(m),b=t.forwardRef((e,r)=>{let{scope:a,children:i,...s}=e,o=t.useRef(null),l=n(r,o),c=d(m,a);return t.useEffect(()=>(c.itemMap.set(o,{ref:o,...s}),()=>void c.itemMap.delete(o))),(0,f.jsx)(x,{...{[g]:""},ref:l,children:i})});return b.displayName=m,[{Provider:c,Slot:h,ItemSlot:b},function(r){let a=d(e+"CollectionConsumer",r);return t.useCallback(()=>{let e=a.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${g}]`));return Array.from(a.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[a.collectionRef,a.itemMap])},o]}],75830);var x=t.createContext(void 0);e.s(["useDirection",0,function(e){let r=t.useContext(x);return e||r||"ltr"}],586318)},26495,e=>{"use strict";let t=(0,e.i(456420).default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["default",0,t])},144716,e=>{"use strict";let t=(0,e.i(456420).default)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);e.s(["default",0,t])},986253,e=>{"use strict";let t=(0,e.i(456420).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["default",0,t])},990142,e=>{"use strict";RegExp("^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$"),e.s(["CCUSAGE_REPORT_JOB_KIND",0,"ccusage.report"])},675926,e=>{"use strict";var t=e.i(843476),r=e.i(948148),a=e.i(487486),n=e.i(975157);e.s(["StatusBadge",0,function({status:e}){let i=(0,r.useTranslations)("status"),s="ONLINE"===e||"RUNNING"===e||"SUCCEEDED"===e,o="FAILED"===e||"TIMED_OUT"===e;return(0,t.jsx)(a.Badge,{className:(0,n.cn)(s&&"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",o&&"border-destructive/30 bg-destructive/10 text-destructive"),variant:s||o?"outline":"secondary",children:i(e.toLowerCase())})}])},929272,e=>{"use strict";let t=(0,e.i(456420).default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);e.s(["Square",0,t],929272)},997695,e=>{"use strict";var t=e.i(843476),r=e.i(929272),a=e.i(948148),n=e.i(271645),i=e.i(929592),s=e.i(519455),o=e.i(515288),l=e.i(987968),d=e.i(520133),c=e.i(637611),u=e.i(975157),p=e.i(778434),f=e.i(675926);e.s(["JobMonitor",0,function({jobId:e,compact:h=!1}){let m=(0,a.useTranslations)("jobs"),[g,x]=(0,n.useState)(null),[b,y]=(0,n.useState)([]),[v,j]=(0,n.useState)(!0),[E,C]=(0,n.useState)(null),w=(0,n.useRef)(null),D=(0,n.useRef)(!0),N=(0,n.useCallback)(async()=>{try{let t=await (0,c.controlPlaneRequest)(`query Job($id: ID!) { agentJob(id: $id) { ${p.JOB_FIELDS} } agentJobLogs(jobId: $id) { ${p.JOB_LOG_FIELDS} } }`,{id:e});x(t.agentJob),y(t.agentJobLogs),C(null)}catch(e){C(e instanceof Error?e.message:String(e))}finally{j(!1)}},[e]);(0,n.useEffect)(()=>{let t=window.setTimeout(()=>void N(),0),r=(0,c.controlPlaneSubscriptions)(),a=r.subscribe({query:`subscription JobChanged($jobId: ID!) { agentJobChanged(jobId: $jobId) { ${p.JOB_FIELDS} } }`,variables:{jobId:e}},{next:e=>e.data?.agentJobChanged&&x(e.data.agentJobChanged),error:()=>void 0,complete:()=>void 0}),n=r.subscribe({query:`subscription JobLog($jobId: ID!) { agentJobLogAdded(jobId: $jobId) { ${p.JOB_LOG_FIELDS} } }`,variables:{jobId:e}},{next:e=>{let t=e.data?.agentJobLogAdded;t&&y(e=>e.some(e=>e.sequence===t.sequence)?e:[...e,t].sort((e,t)=>e.sequence-t.sequence))},error:()=>void 0,complete:()=>void 0});return()=>{a(),n(),window.clearTimeout(t)}},[e,N]),(0,n.useEffect)(()=>{D.current&&w.current?.scrollTo({top:w.current.scrollHeight})},[b]);let S=async()=>{try{let t=await (0,c.controlPlaneRequest)(`mutation Cancel($jobId: ID!) { cancelAgentJob(jobId: $jobId) { ${p.JOB_FIELDS} } }`,{jobId:e});x(t.cancelAgentJob),C(null)}catch(e){C(e instanceof Error?e.message:String(e))}};return E?(0,t.jsx)(i.Alert,{variant:"destructive",children:(0,t.jsx)(i.AlertDescription,{children:E})}):v?(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(l.Spinner,{}),m("loading")]}):g?(0,t.jsx)(o.Card,{className:(0,u.cn)(h?"[--card-spacing:--spacing(4)]":void 0),children:(0,t.jsxs)(o.CardContent,{children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("h2",{className:"font-medium",children:g.kind}),(0,t.jsx)(f.StatusBadge,{status:g.status})]}),(0,t.jsx)("p",{className:"mt-1 font-mono text-xs text-muted-foreground",children:g.id})]}),(0,t.jsxs)("div",{className:"flex gap-2",children:[h&&(0,t.jsx)(s.Button,{asChild:!0,size:"sm",variant:"outline",children:(0,t.jsx)(d.Link,{href:`/jobs/${g.id}`,children:m("open")})}),("QUEUED"===g.status||"RUNNING"===g.status)&&(0,t.jsxs)(s.Button,{onClick:()=>void S(),size:"sm",variant:"destructive",children:[(0,t.jsx)(r.Square,{}),m("cancel")]})]})]}),g.error&&(0,t.jsx)(i.Alert,{className:"mt-3",variant:"destructive",children:(0,t.jsx)(i.AlertDescription,{children:g.error})}),(0,t.jsx)("div",{ref:w,className:(0,u.cn)("mt-4 overflow-auto rounded-lg border bg-zinc-950 p-3 font-mono text-xs leading-5 text-zinc-100",h?"h-80":"h-[32rem]"),onScroll:e=>{let t=e.currentTarget;D.current=t.scrollHeight-t.scrollTop-t.clientHeight<24},children:0===b.length?(0,t.jsx)("span",{className:"text-zinc-500",children:m("waiting")}):b.map(e=>(0,t.jsxs)("div",{className:(0,u.cn)("whitespace-pre-wrap break-all","STDERR"===e.stream&&"text-amber-300","SYSTEM"===e.stream&&"text-sky-300"),children:[(0,t.jsx)("span",{className:"mr-2 select-none text-zinc-600",children:String(e.sequence).padStart(4,"0")}),e.message]},e.id))})]})}):(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:m("notFound")})}])},434719,e=>{"use strict";let t=String.raw`\b([A-Z][A-Z0-9_]*-\d+)\b`;e.s(["DEFAULT_JIRA_BRANCH_REGEX",0,t,"DEFAULT_WORKTREE_FETCH_INTERVAL_SECONDS",0,300,"MAX_WORKTREE_FETCH_INTERVAL_SECONDS",0,86400,"MIN_WORKTREE_FETCH_INTERVAL_SECONDS",0,60,"WORKTREE_BRANCH_JOB_KIND",0,"worktree.branch","WORKTREE_DELETE_JOB_KIND",0,"worktree.delete","WORKTREE_INSPECT_JOB_KIND",0,"worktree.inspect","WORKTREE_MOVE_CHECKOUT_JOB_KIND",0,"worktree.move.checkout","WORKTREE_MOVE_PUSH_JOB_KIND",0,"worktree.move.push","WORKTREE_OPERATION_JOB_KIND",0,"worktree.operation","WORKTREE_WATCH_JOB_KIND",0,"worktree.watch"])},421645,e=>{"use strict";e.s(["CODEBASE_BROWSE_JOB_KIND",0,"codebase.browse","CODEBASE_FETCH_JOB_KIND",0,"codebase.fetch","CODEBASE_GIT_INSPECT_JOB_KIND",0,"codebase.git.inspect","CODEBASE_GIT_OPERATION_JOB_KIND",0,"codebase.git.operation","CODEBASE_INSPECT_JOB_KIND",0,"codebase.inspect","CODEBASE_RECONCILE_EVENT_CAPABILITY",0,"codebase.reconcile.requested","CODEBASE_REFRESH_JOB_KIND",0,"codebase.refresh","DEFAULT_CODEBASE_RECONCILE_INTERVAL_SECONDS",0,30,"MAX_CODEBASE_RECONCILE_INTERVAL_SECONDS",0,3600,"MIN_CODEBASE_RECONCILE_INTERVAL_SECONDS",0,10])},874801,e=>{"use strict";var t=e.i(843476),r=e.i(867927),a=e.i(456420);let n=(0,a.default)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]),i=(0,a.default)("folder-check",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"m9 13 2 2 4-4",key:"6343dt"}]]);var s=e.i(902434),s=s,o=e.i(948148),l=e.i(271645),d=e.i(929592),c=e.i(519455),u=e.i(59497),p=e.i(110204),f=e.i(987968),h=e.i(462777),m=e.i(637611);e.s(["AgentDirectoryBrowser",0,function({agentId:e,browseLabel:a,disabled:g=!1,initialPath:x=null,onPathChange:b,onSelect:y,selectIcon:v,selectLabel:j}){var E;let C=(0,o.useTranslations)("codebases"),[w,D]=(0,l.useState)(null),[N,S]=(0,l.useState)(!1),[A,T]=(0,l.useState)(!1),[I,R]=(0,l.useState)(null),_=(0,l.useRef)(0),k=(0,l.useCallback)(async t=>{let r=++_.current;T(!0);try{let a=await (0,m.controlPlaneRequest)(`mutation BrowseAgentDirectory($input: BrowseAgentDirectoryInput!) {
2
+ browseAgentDirectory(input: $input) {
3
+ path parentPath homePath truncated entries { name path hidden }
4
+ }
5
+ }`,{input:{agentId:e,path:t,requestId:(0,h.createClientId)()}});if(r!==_.current)return;D(a.browseAgentDirectory),b?.(a.browseAgentDirectory.path),R(null)}catch(e){if(r!==_.current)return;R(e instanceof Error?e.message:String(e))}finally{r===_.current&&T(!1)}},[e,b]);if((0,l.useEffect)(()=>{if(!x)return;let e=window.setTimeout(()=>void k(x),0);return()=>window.clearTimeout(e)},[k,x]),(0,l.useEffect)(()=>()=>{_.current+=1},[]),!w)return(0,t.jsxs)("div",{className:"space-y-3",children:[I&&(0,t.jsx)(d.Alert,{variant:"destructive",children:(0,t.jsx)(d.AlertDescription,{children:I})}),(0,t.jsxs)(c.Button,{disabled:A||g,onClick:()=>void k(null),type:"button",variant:"outline",children:[A?(0,t.jsx)(f.Spinner,{}):(0,t.jsx)(n,{})," ",a??C("browseHome")]})]});let O="/"===(E=w.path)?[{label:"/",path:"/"}]:[{label:"/",path:"/"},...E.split("/").filter(Boolean).map((e,t,r)=>({label:e,path:`/${r.slice(0,t+1).join("/")}`}))];return(0,t.jsxs)("div",{className:"space-y-3 rounded-lg border p-3",children:[I&&(0,t.jsx)(d.Alert,{variant:"destructive",children:(0,t.jsx)(d.AlertDescription,{children:I})}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[(0,t.jsx)(c.Button,{"aria-label":C("home"),disabled:A||g,onClick:()=>void k(w.homePath),size:"icon-sm",type:"button",variant:"ghost",children:(0,t.jsx)(s.default,{})}),O.map((e,a)=>(0,t.jsxs)("span",{className:"flex items-center",children:[a>0&&(0,t.jsx)(r.ChevronRight,{className:"size-3 text-muted-foreground"}),(0,t.jsx)(c.Button,{disabled:A||g,onClick:()=>void k(e.path),size:"sm",type:"button",variant:"ghost",children:e.label})]},e.path))]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(u.Checkbox,{checked:N,id:`show-hidden-${e}`,onCheckedChange:e=>S(!!e)}),(0,t.jsx)(p.Label,{htmlFor:`show-hidden-${e}`,children:C("showHidden")})]}),(0,t.jsx)("div",{className:"max-h-64 overflow-y-auto rounded-md border",children:w.entries.filter(e=>N||!e.hidden).map(e=>(0,t.jsxs)(c.Button,{className:"h-auto w-full justify-start rounded-none border-b px-3 py-2 last:border-0",disabled:A||g,onClick:()=>void k(e.path),size:"sm",type:"button",variant:"ghost",children:[(0,t.jsx)(n,{className:"size-4"})," ",e.name]},e.path))}),w.truncated&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:C("truncated")}),y&&j&&(0,t.jsxs)(c.Button,{disabled:A||g,onClick:()=>void y(w.path),type:"button",children:[g?(0,t.jsx)(f.Spinner,{}):v??(0,t.jsx)(i,{})," ",j]})]})}],874801)},354576,e=>{"use strict";var t=e.i(843476),r=e.i(421645),a=e.i(711241),n=e.i(689664),i=e.i(716327),s=e.i(867927),o=e.i(508734),l=e.i(566595),d=e.i(573474),c=e.i(747925),u=e.i(861745),p=e.i(948148),f=e.i(271645),h=e.i(874801),m=e.i(997695),g=e.i(675926),x=e.i(340953),b=e.i(929592),y=e.i(487486),v=e.i(519455),j=e.i(515288),E=e.i(82612),C=e.i(793479),w=e.i(110204),D=e.i(987968),N=e.i(967489),S=e.i(784774),A=e.i(624687),T=e.i(520133),I=e.i(462777),R=e.i(637611),_=e.i(975157),k=e.i(778434),O=e.i(990142),B=e.i(434719);let $=()=>({codebaseId:"",folder:"",gitDirectory:"",expectedOrigin:"",baseBranch:null}),L=e=>"QUEUED"===e.status||"RUNNING"===e.status;function P(e,t){return e.some(e=>e.id===t.id)?e.map(e=>e.id===t.id?t:e):[t,...e]}function J({agent:e,canBrowseDirectories:r,onSaved:a}){let n=(0,p.useTranslations)("agentDetail"),[i,s]=(0,f.useState)(e.buildsDirectory??""),[o,l]=(0,f.useState)(!1),[c,u]=(0,f.useState)(null),m=async t=>{l(!0),u(null);try{let r=await (0,R.controlPlaneRequest)(`mutation UpdateAgentBuildsDirectory($agentId: ID!, $buildsDirectory: String) {
6
+ updateAgentBuildsDirectory(agentId: $agentId, buildsDirectory: $buildsDirectory) { ${k.AGENT_FIELDS} }
7
+ }`,{agentId:e.id,buildsDirectory:t});a(r.updateAgentBuildsDirectory),s(r.updateAgentBuildsDirectory.buildsDirectory??"")}catch(e){u(e instanceof Error?e.message:String(e))}finally{l(!1)}};return(0,t.jsxs)(j.Card,{children:[(0,t.jsxs)(j.CardHeader,{children:[(0,t.jsx)(j.CardTitle,{children:n("buildsDirectory")}),(0,t.jsx)(j.CardDescription,{children:n("buildsDirectoryDescription")})]}),(0,t.jsxs)(j.CardContent,{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"rounded-lg bg-muted p-3",children:[(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:n("effectiveDirectory")}),(0,t.jsx)("p",{className:"mt-1 break-all font-mono text-xs",children:e.effectiveBuildsDirectory??n("notConfigured")}),!e.buildsDirectory&&e.baseRepoDirectory&&(0,t.jsx)(y.Badge,{className:"mt-2",variant:"outline",children:n("agentDefault")})]}),(0,t.jsxs)("div",{className:"grid gap-2",children:[(0,t.jsx)(w.Label,{htmlFor:"builds-directory-path",children:n("customBuildsDirectory")}),(0,t.jsx)(C.Input,{disabled:o,id:"builds-directory-path",onChange:e=>s(e.target.value),placeholder:e.effectiveBuildsDirectory??"/Users/example/Repositories/Builds",value:i})]}),r&&(0,t.jsx)(h.AgentDirectoryBrowser,{agentId:e.id,browseLabel:n("browseBuildsDirectory"),disabled:o,onSelect:s,selectLabel:n("useDirectory")}),c&&(0,t.jsx)(b.Alert,{variant:"destructive",children:(0,t.jsx)(b.AlertDescription,{children:c})}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsxs)(v.Button,{disabled:o||!i.trim(),onClick:()=>void m(i.trim()),children:[o&&(0,t.jsx)(D.Spinner,{})," ",n("saveBuildsDirectory")]}),e.buildsDirectory&&(0,t.jsxs)(v.Button,{disabled:o,onClick:()=>void m(null),variant:"outline",children:[(0,t.jsx)(d.Trash2,{})," ",n("useAgentDefault")]})]})]})]})}function z({agent:e,canBrowseDirectories:r,onSaved:a}){let n=(0,p.useTranslations)("agentDetail"),[i,s]=(0,f.useState)(e.derivedDataLocationMode??"DEFAULT"),[o,l]=(0,f.useState)(e.derivedDataPath??""),[d,c]=(0,f.useState)(!1),[u,m]=(0,f.useState)(null),g=async t=>{t.preventDefault(),c(!0),m(null);try{let t=await (0,R.controlPlaneRequest)(`mutation UpdateAgentDerivedDataSettings($agentId: ID!, $input: UpdateAgentDerivedDataSettingsInput!) {
8
+ updateAgentDerivedDataSettings(agentId: $agentId, input: $input) { ${k.AGENT_FIELDS} }
9
+ }`,{agentId:e.id,input:{mode:i,path:"DEFAULT"===i?null:o}});a(t.updateAgentDerivedDataSettings)}catch(e){m(e instanceof Error?e.message:String(e))}finally{c(!1)}};return(0,t.jsxs)(j.Card,{children:[(0,t.jsxs)(j.CardHeader,{children:[(0,t.jsx)(j.CardTitle,{children:n("derivedDataLocation")}),(0,t.jsx)(j.CardDescription,{children:n("derivedDataLocationDescription")})]}),(0,t.jsx)(j.CardContent,{children:(0,t.jsxs)("form",{className:"space-y-4",onSubmit:e=>void g(e),children:[(0,t.jsxs)("div",{className:"grid gap-2",children:[(0,t.jsx)(w.Label,{htmlFor:"derived-data-mode",children:n("derivedDataMode")}),(0,t.jsxs)(N.Select,{disabled:d,onValueChange:e=>s(e),value:i,children:[(0,t.jsx)(N.SelectTrigger,{id:"derived-data-mode",children:(0,t.jsx)(N.SelectValue,{})}),(0,t.jsxs)(N.SelectContent,{children:[(0,t.jsx)(N.SelectItem,{value:"DEFAULT",children:n("derivedDataDefault")}),(0,t.jsx)(N.SelectItem,{value:"ABSOLUTE",children:n("derivedDataAbsolute")}),(0,t.jsx)(N.SelectItem,{value:"RELATIVE",children:n("derivedDataRelative")})]})]})]}),"DEFAULT"===i?(0,t.jsx)("div",{className:"rounded-lg bg-muted p-3 font-mono text-xs",children:"~/Library/Developer/Xcode/DerivedData"}):(0,t.jsxs)("div",{className:"grid gap-2",children:[(0,t.jsx)(w.Label,{htmlFor:"derived-data-path",children:n("ABSOLUTE"===i?"derivedDataAbsolutePath":"derivedDataRelativePath")}),(0,t.jsx)(C.Input,{disabled:d,id:"derived-data-path",onChange:e=>l(e.target.value),placeholder:"ABSOLUTE"===i?"/Users/example/DerivedData":"DerivedData",value:o}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:n("ABSOLUTE"===i?"derivedDataAbsoluteHelp":"derivedDataRelativeHelp")})]}),"ABSOLUTE"===i&&r&&(0,t.jsx)(h.AgentDirectoryBrowser,{agentId:e.id,disabled:d,onSelect:l,selectLabel:n("useDirectory")}),u&&(0,t.jsx)(b.Alert,{variant:"destructive",children:(0,t.jsx)(b.AlertDescription,{children:u})}),(0,t.jsxs)(v.Button,{disabled:d||"DEFAULT"!==i&&!o.trim(),type:"submit",children:[d&&(0,t.jsx)(D.Spinner,{}),n("saveDerivedDataSettings")]})]})})]})}function M({label:e,value:r,mono:a=!1}){return(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("dt",{className:"text-xs text-muted-foreground",children:e}),(0,t.jsx)("dd",{className:(0,_.cn)("truncate",a&&"font-mono text-xs"),title:r,children:r})]})}function F(e,t){let r=["B","KiB","MiB","GiB","TiB"],a=Math.min(Math.floor(Math.log(Math.max(e,1))/Math.log(1024)),r.length-1);return`${new Intl.NumberFormat(t,{maximumFractionDigits:1}).format(e/1024**a)} ${r[a]}`}function H({label:e,total:r,free:a,locale:n,unavailable:i,usedLabel:s,freeLabel:o}){if(null==r||null==a||r<=0)return(0,t.jsxs)("div",{className:"rounded-lg border p-4",children:[(0,t.jsx)("p",{className:"font-medium",children:e}),(0,t.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:i})]});let l=Math.max(0,Math.min(a,r)),d=r-l,c=d/r*100;return(0,t.jsxs)("div",{className:"rounded-lg border p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("p",{className:"font-medium",children:e}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[Math.round(c),"%"]})]}),(0,t.jsx)("div",{className:"mt-3 h-2 overflow-hidden rounded-full bg-muted",children:(0,t.jsx)("div",{"aria-label":`${e}: ${Math.round(c)}%`,"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":Math.round(c),className:"h-full rounded-full bg-primary transition-[width]",role:"progressbar",style:{width:`${c}%`}})}),(0,t.jsxs)("dl",{className:"mt-3 grid grid-cols-2 gap-3 text-xs",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-muted-foreground",children:s}),(0,t.jsx)("dd",{children:F(d,n)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-muted-foreground",children:o}),(0,t.jsx)("dd",{children:F(l,n)})]})]})]})}function K({agentId:e,capability:a,offline:n,onJobChanged:o}){let l=(0,p.useTranslations)("agentDetail"),[d,c]=(0,f.useState)(!1),u=a===r.CODEBASE_RECONCILE_EVENT_CAPABILITY,h=()=>c(e=>!e);return(0,t.jsxs)(f.Fragment,{children:[(0,t.jsxs)(S.TableRow,{"aria-expanded":d,"aria-label":l(d?"collapseCapability":"expandCapability",{capability:a}),className:"cursor-pointer focus-visible:bg-muted/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",onClick:h,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),h())},role:"button",tabIndex:0,children:[(0,t.jsx)(S.TableCell,{children:d?(0,t.jsx)(i.ChevronDown,{className:"size-4"}):(0,t.jsx)(s.ChevronRight,{className:"size-4"})}),(0,t.jsx)(S.TableCell,{className:"font-mono text-xs font-medium",children:a}),(0,t.jsx)(S.TableCell,{children:(0,t.jsx)(y.Badge,{variant:"outline",children:l(u?"event":"job")})})]}),(0,t.jsx)(S.TableRow,{className:d?"bg-muted/20 hover:bg-muted/20":"hidden",children:(0,t.jsx)(S.TableCell,{className:"whitespace-normal p-4",colSpan:3,children:(0,t.jsx)(q,{agentId:e,capability:a,eventCapability:u,offline:n,onJobChanged:o})})})]})}function q({agentId:e,capability:a,eventCapability:i,offline:s,onJobChanged:l}){let d=(0,p.useTranslations)("agentDetail"),u=(0,p.useTranslations)("tools"),[h,m]=(0,f.useState)(()=>JSON.stringify(function(e){switch(e){case"cloudflared.runTunnel":return{tunnelName:""};case O.CCUSAGE_REPORT_JOB_KIND:return{};case r.CODEBASE_BROWSE_JOB_KIND:return{path:null};case r.CODEBASE_INSPECT_JOB_KIND:return{folder:""};case r.CODEBASE_REFRESH_JOB_KIND:return{codebaseId:"",folder:"",expectedOrigin:""};case r.CODEBASE_FETCH_JOB_KIND:return{codebaseId:"",folder:"",expectedOrigin:"",baseBranch:"",keepBaseBranchUpToDate:!1};case r.CODEBASE_GIT_INSPECT_JOB_KIND:return{action:"STATE",codebaseId:"",folder:"",expectedOrigin:""};case r.CODEBASE_GIT_OPERATION_JOB_KIND:return{codebaseId:"",folder:"",expectedOrigin:"",defaultBranch:null,operation:"SWITCH_BRANCH",branch:"",stashChanges:!1};case B.WORKTREE_INSPECT_JOB_KIND:return $();case B.WORKTREE_OPERATION_JOB_KIND:return{...$(),operation:"SYNC"};case B.WORKTREE_WATCH_JOB_KIND:return{...$(),action:"START",watchId:""};case B.WORKTREE_BRANCH_JOB_KIND:return{codebaseId:"",rootFolder:"",folder:null,gitDirectory:null,expectedOrigin:"",baseBranch:"",action:"CREATE",mode:"NEW",candidates:[""],stashOnFailure:!1};case B.WORKTREE_MOVE_PUSH_JOB_KIND:return{moveId:"",codebaseId:"",folder:"",gitDirectory:"",expectedOrigin:"",branch:"",expectedHeadSha:""};case B.WORKTREE_MOVE_CHECKOUT_JOB_KIND:return{moveId:"",codebaseId:"",rootFolder:"",folder:null,gitDirectory:null,expectedOrigin:"",branch:"",expectedHeadSha:"",baseBranch:"",mode:"NEW",stashOnFailure:!1};case B.WORKTREE_DELETE_JOB_KIND:return{moveId:null,codebaseId:"",rootFolder:"",folder:"",gitDirectory:"",expectedOrigin:"",branch:null,defaultBranch:null,deleteRemoteBranch:!1,requireClean:!1,expectedHeadSha:null};default:return{}}}(a),null,2)),[g,x]=(0,f.useState)(null),[y,j]=(0,f.useState)(void 0),[E,C]=(0,f.useState)(null),[N,S]=(0,f.useState)(!1),[T,_]=(0,f.useState)(!1);(0,f.useEffect)(()=>{if(g&&L(g))return(0,R.controlPlaneSubscriptions)().subscribe({query:`subscription CapabilityJobChanged($jobId: ID!) {
10
+ agentJobChanged(jobId: $jobId) { ${k.JOB_FIELDS} }
11
+ }`,variables:{jobId:g.id}},{next:e=>{let t=e.data?.agentJobChanged;t&&(x(t),l(t))},error:()=>void 0,complete:()=>void 0})},[g,l]);let P=async t=>{t.preventDefault(),S(!0),C(null),_(!1);try{if(i){let t=await (0,R.controlPlaneRequest)(`mutation RequestAgentCodebaseReconcile($agentId: ID!) {
12
+ requestAgentCodebaseReconcile(agentId: $agentId)
13
+ }`,{agentId:e});j({accepted:t.requestAgentCodebaseReconcile}),x(null);return}let t=JSON.parse(h);if(!t||"object"!=typeof t||Array.isArray(t))throw Error(u("invalidJsonObject"));let r=await (0,R.controlPlaneRequest)(`mutation InvokeAgentCapability($input: CreateAgentJobInput!) {
14
+ createAgentJob(input: $input) { ${k.JOB_FIELDS} }
15
+ }`,{input:{agentId:e,kind:a,payload:t,idempotencyKey:`manual:${a}:${(0,I.createClientId)()}`,timeoutSeconds:86400}});x(r.createAgentJob),j(void 0),l(r.createAgentJob,!0)}catch(e){C(e instanceof SyntaxError?u("invalidJsonObject"):e instanceof Error?e.message:String(e)),x(null),j(void 0)}finally{S(!1)}},J=g?{status:g.status,result:g.result,error:g.error}:y,z=void 0===J?"":JSON.stringify(J,null,2),M=async()=>{try{await (0,I.copyText)(z),_(!0)}catch{C(u("copyFailed"))}};return(0,t.jsxs)("form",{className:"grid gap-4 lg:grid-cols-2",onSubmit:P,children:[(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("h4",{className:"text-sm font-medium",children:u("parameters")}),i?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:d("eventCapabilityDescription")}):(0,t.jsxs)("div",{children:[(0,t.jsx)(w.Label,{className:"mb-1.5 block",htmlFor:`${a}-payload`,children:d("payload")}),(0,t.jsx)(A.Textarea,{className:"min-h-36 font-mono text-xs",id:`${a}-payload`,onChange:e=>m(e.target.value),spellCheck:!1,value:h})]}),(0,t.jsxs)(v.Button,{disabled:N||s,type:"submit",children:[N?(0,t.jsx)(D.Spinner,{}):(0,t.jsx)(c.Wrench,{}),N?u("running"):d("invoke")]}),s&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:d("invokeOffline")})]}),(0,t.jsxs)("div",{className:"min-w-0 space-y-2",children:[(0,t.jsxs)("div",{className:"flex min-h-7 items-center justify-between gap-2",children:[(0,t.jsx)("h4",{className:"text-sm font-medium",children:u("response")}),void 0!==J&&(0,t.jsx)(v.Button,{"aria-label":T?u("copied"):u("copyResponse"),onClick:()=>void M(),size:"icon-sm",type:"button",variant:"ghost",children:T?(0,t.jsx)(n.Check,{}):(0,t.jsx)(o.Copy,{})})]}),E?(0,t.jsx)(b.Alert,{variant:"destructive",children:(0,t.jsx)(b.AlertDescription,{children:E})}):void 0===J?(0,t.jsx)("div",{className:"rounded-lg border border-dashed p-4 text-sm text-muted-foreground",children:d("noCapabilityResponse")}):(0,t.jsx)("pre",{className:"max-h-96 overflow-auto rounded-lg bg-muted p-3 font-mono text-xs whitespace-pre-wrap",children:z})]})]})}function U({codebases:e,locale:r}){let a=(0,p.useTranslations)("agentDetail"),n=(0,p.useTranslations)("codebases");return(0,t.jsxs)(j.Card,{className:"gap-0 py-0",children:[(0,t.jsxs)(j.CardHeader,{children:[(0,t.jsx)(j.CardTitle,{children:a("codebases")}),(0,t.jsx)(j.CardDescription,{children:a("codebasesDescription")})]}),0===e.length?(0,t.jsx)("p",{className:"p-4 text-sm text-muted-foreground",children:a("noCodebases")}):(0,t.jsxs)(S.Table,{children:[(0,t.jsx)(S.TableHeader,{children:(0,t.jsxs)(S.TableRow,{children:[(0,t.jsx)(S.TableHead,{children:a("repository")}),(0,t.jsx)(S.TableHead,{children:n("folder")}),(0,t.jsx)(S.TableHead,{children:n("branch")}),(0,t.jsx)(S.TableHead,{children:a("status")}),(0,t.jsx)(S.TableHead,{children:n("lastChecked")}),(0,t.jsx)(S.TableHead,{className:"w-20"})]})}),(0,t.jsx)(S.TableBody,{children:e.map(e=>(0,t.jsxs)(S.TableRow,{children:[(0,t.jsxs)(S.TableCell,{children:[(0,t.jsx)("p",{className:"font-medium",children:e.repository.name}),(0,t.jsx)("p",{className:"max-w-sm truncate font-mono text-xs text-muted-foreground",children:e.repository.displayOrigin})]}),(0,t.jsx)(S.TableCell,{className:"max-w-sm truncate font-mono text-xs",children:e.folder}),(0,t.jsx)(S.TableCell,{className:"font-mono text-xs",children:e.branch??e.headSha?.slice(0,10)??n("unknown")}),(0,t.jsx)(S.TableCell,{children:(0,t.jsx)(y.Badge,{className:(0,_.cn)("IN_SYNC"===e.syncState&&"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300"),variant:"outline",children:"AVAILABLE"===e.availability?n(`sync.${e.syncState}`):n(`availability.${e.availability}`)})}),(0,t.jsx)(S.TableCell,{children:e.lastCheckedAt?new Date(e.lastCheckedAt).toLocaleString(r):n("never")}),(0,t.jsx)(S.TableCell,{children:(0,t.jsx)(v.Button,{asChild:!0,size:"sm",variant:"ghost",children:(0,t.jsx)(T.Link,{href:`/codebases/${e.id}`,children:n("view")})})})]},e.id))})]})]})}e.s(["AgentDetail",0,function({agentId:e}){let n=(0,p.useTranslations)("agentDetail"),i=(0,p.useTranslations)("common"),s=(0,u.useLocale)(),o=(0,T.useRouter)(),[c,y]=(0,f.useState)(null),[w,N]=(0,f.useState)([]),[A,I]=(0,f.useState)([]),[O,B]=(0,f.useState)(""),[$,F]=(0,f.useState)(null),[q,W]=(0,f.useState)(!0),[V,G]=(0,f.useState)(null),[Z,X]=(0,f.useState)(!1),[Y,Q]=(0,f.useState)(!1),[ee,et]=(0,f.useState)(null),er=(0,f.useRef)(0),ea=(0,f.useCallback)(async()=>{let t=++er.current;try{let r=await (0,R.controlPlaneRequest)(`query AgentDetail($id: ID!) {
16
+ agent(id: $id) { ${k.AGENT_FIELDS} }
17
+ agentJobs(agentId: $id) { ${k.JOB_FIELDS} }
18
+ codebaseOverview {
19
+ repositories {
20
+ id name description displayOrigin
21
+ codebases {
22
+ id folder branch headSha syncState availability lastCheckedAt
23
+ agent { id }
24
+ }
25
+ }
26
+ }
27
+ }`,{id:e});if(t!==er.current)return;y(r.agent),N(r.agentJobs),I((r.codebaseOverview?.repositories??[]).flatMap(t=>t.codebases.filter(t=>t.agent.id===e).map(e=>({id:e.id,folder:e.folder,branch:e.branch,headSha:e.headSha,syncState:e.syncState,availability:e.availability,lastCheckedAt:e.lastCheckedAt,repository:{id:t.id,name:t.name,description:t.description,displayOrigin:t.displayOrigin}})))),F(e=>e&&r.agentJobs.some(t=>t.id===e)?e:r.agentJobs[0]?.id??null),G(null)}catch(e){if(t!==er.current)return;G(e instanceof Error?e.message:String(e))}finally{t===er.current&&W(!1)}},[e]);(0,f.useEffect)(()=>{let t=window.setTimeout(()=>void ea(),0),r=(0,R.controlPlaneSubscriptions)(),a=r.subscribe({query:`subscription AgentChanged($agentId: ID!) { agentChanged(agentId: $agentId) { ${k.AGENT_FIELDS} } }`,variables:{agentId:e}},{next:e=>e.data?.agentChanged&&y(e.data.agentChanged),error:()=>void 0,complete:()=>void 0}),n=r.subscribe({query:`subscription CodebaseOverviewChanged {
28
+ codebaseOverviewChanged { codebaseId repositoryId }
29
+ }`},{next:()=>void ea(),error:()=>void 0,complete:()=>void 0});return()=>{window.clearTimeout(t),er.current+=1,a(),n()}},[e,ea]);let en=(0,f.useMemo)(()=>w.filter(L).map(e=>e.id),[w]);(0,f.useEffect)(()=>{let e=(0,R.controlPlaneSubscriptions)(),t=en.map(t=>e.subscribe({query:`subscription JobChanged($jobId: ID!) { agentJobChanged(jobId: $jobId) { ${k.JOB_FIELDS} } }`,variables:{jobId:t}},{next:e=>{let t=e.data?.agentJobChanged;t&&N(e=>P(e,t))},error:()=>void 0,complete:()=>void 0}));return()=>t.forEach(e=>e())},[en]);let ei=async t=>{Q(!0),et(null);try{let r=await (0,R.controlPlaneRequest)(`mutation UpdateAgentBaseRepoDirectory($agentId: ID!, $baseRepoDirectory: String) {
30
+ updateAgentBaseRepoDirectory(agentId: $agentId, baseRepoDirectory: $baseRepoDirectory) {
31
+ ${k.AGENT_FIELDS}
32
+ }
33
+ }`,{agentId:e,baseRepoDirectory:t});y(r.updateAgentBaseRepoDirectory)}catch(e){et(e instanceof Error?e.message:String(e))}finally{Q(!1)}},es=(0,f.useCallback)((e,t=!1)=>{N(t=>P(t,e)),t&&F(e.id)},[]),eo=async()=>{X(!0),G(null);try{await (0,R.controlPlaneRequest)("mutation DeleteAgent($agentId: ID!) { deleteAgent(agentId: $agentId) }",{agentId:e}),o.push("/agents")}catch(e){G(e instanceof Error?e.message:String(e)),X(!1)}};if(q)return(0,t.jsxs)("p",{className:"mx-auto flex max-w-6xl items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(D.Spinner,{}),n("loading")]});if(V&&!c)return(0,t.jsx)("p",{className:"mx-auto max-w-6xl text-sm text-destructive",children:V});if(!c)return(0,t.jsx)("p",{className:"mx-auto max-w-6xl text-sm text-muted-foreground",children:n("notFound")});let el="ONLINE"===c.connectionStatus&&c.capabilities.includes(r.CODEBASE_BROWSE_JOB_KIND),ed=c.capabilities.filter(e=>e.toLocaleLowerCase().includes(O.toLocaleLowerCase()));return(0,t.jsxs)("div",{className:"mx-auto flex w-full max-w-[1500px] flex-col gap-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,t.jsx)(v.Button,{asChild:!0,size:"sm",variant:"ghost",children:(0,t.jsxs)(T.Link,{href:"/agents",children:[(0,t.jsx)(a.ArrowLeft,{}),n("back")]})}),(0,t.jsx)(x.ConfirmationDialog,{actionLabel:n("deleteAgent"),cancelLabel:i("cancel"),description:n("deleteAgentDescription",{name:c.name}),onConfirm:eo,title:n("deleteAgentTitle"),trigger:(0,t.jsxs)(v.Button,{disabled:Z,size:"sm",variant:"destructive",children:[Z?(0,t.jsx)(D.Spinner,{}):(0,t.jsx)(d.Trash2,{}),n("deleteAgent")]})})]}),V&&(0,t.jsx)(b.Alert,{variant:"destructive",children:(0,t.jsx)(b.AlertDescription,{children:V})}),(0,t.jsxs)(j.Card,{children:[(0,t.jsx)(j.CardHeader,{children:(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(j.CardTitle,{className:"text-2xl font-semibold tracking-tight",children:c.name}),(0,t.jsx)(g.StatusBadge,{status:c.connectionStatus})]}),(0,t.jsxs)(j.CardDescription,{className:"mt-1",children:[c.hostname," · ",c.osVersion," · ",c.architecture]})]}),(0,t.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:c.id})]})}),(0,t.jsxs)(j.CardContent,{className:"space-y-5",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"font-medium",children:n("generalInformation")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:n("generalInformationDescription")})]}),(0,t.jsxs)("dl",{className:"grid gap-4 text-sm sm:grid-cols-2 lg:grid-cols-4",children:[(0,t.jsx)(M,{label:n("version"),value:c.version}),(0,t.jsx)(M,{label:n("cpuModel"),value:c.cpuModel??n("unavailable")}),(0,t.jsx)(M,{label:n("operatingSystem"),value:c.osVersion}),(0,t.jsx)(M,{label:n("architecture"),value:c.architecture}),(0,t.jsx)(M,{label:n("lastSeen"),value:c.lastSeenAt?new Date(c.lastSeenAt).toLocaleString(s):n("never")}),(0,t.jsx)(M,{label:n("ipAddress"),value:c.ipAddress??n("unavailable"),mono:!0})]}),(0,t.jsxs)("div",{className:"grid gap-3 md:grid-cols-2",children:[(0,t.jsx)(H,{free:c.memoryFreeBytes,label:n("memory"),locale:s,total:c.memoryTotalBytes,unavailable:n("unavailable"),usedLabel:n("used"),freeLabel:n("free")}),(0,t.jsx)(H,{free:c.diskFreeBytes,label:n("disk"),locale:s,total:c.diskTotalBytes,unavailable:n("unavailable"),usedLabel:n("used"),freeLabel:n("free")})]})]})]}),(0,t.jsxs)(j.Card,{className:"gap-0 py-0",children:[(0,t.jsxs)(j.CardHeader,{children:[(0,t.jsx)(j.CardTitle,{children:n("capabilities")}),(0,t.jsx)(j.CardDescription,{children:n("capabilitiesDescription")})]}),(0,t.jsx)("div",{className:"border-b p-4",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(l.Search,{className:"pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground"}),(0,t.jsx)(C.Input,{"aria-label":n("searchCapabilities"),className:"pl-9",onChange:e=>B(e.target.value),placeholder:n("searchCapabilitiesPlaceholder"),type:"search",value:O})]})}),0===ed.length?(0,t.jsx)("p",{className:"p-4 text-sm text-muted-foreground",children:n("noMatchingCapabilities")}):(0,t.jsxs)(S.Table,{children:[(0,t.jsx)(S.TableHeader,{children:(0,t.jsxs)(S.TableRow,{children:[(0,t.jsx)(S.TableHead,{className:"w-10"}),(0,t.jsx)(S.TableHead,{children:n("capability")}),(0,t.jsx)(S.TableHead,{children:n("kind")})]})}),(0,t.jsx)(S.TableBody,{children:ed.map(e=>(0,t.jsx)(K,{agentId:c.id,capability:e,offline:"ONLINE"!==c.connectionStatus,onJobChanged:es},e))})]})]}),(0,t.jsx)(U,{codebases:A,locale:s}),(0,t.jsxs)(j.Card,{children:[(0,t.jsxs)(j.CardHeader,{children:[(0,t.jsx)(j.CardTitle,{children:n("baseRepoDirectory")}),(0,t.jsx)(j.CardDescription,{children:n("baseRepoDirectoryDescription")})]}),(0,t.jsxs)(j.CardContent,{children:[(0,t.jsxs)("div",{className:"rounded-lg bg-muted p-3",children:[(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:n("currentDirectory")}),(0,t.jsx)("p",{className:"mt-1 break-all font-mono text-xs",children:c.baseRepoDirectory??n("notConfigured")})]}),ee&&(0,t.jsx)(b.Alert,{className:"mt-4",variant:"destructive",children:(0,t.jsx)(b.AlertDescription,{children:ee})}),(0,t.jsxs)("div",{className:"mt-4 flex flex-wrap items-start gap-2",children:[(0,t.jsx)("div",{className:"min-w-0 flex-1",children:el?(0,t.jsx)(h.AgentDirectoryBrowser,{agentId:c.id,disabled:Y,onSelect:e=>ei(e),selectLabel:n("useDirectory")},`${c.id}:${c.baseRepoDirectory??""}`):(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:n("directoryBrowsingUnavailable")})}),c.baseRepoDirectory&&(0,t.jsxs)(v.Button,{disabled:Y,onClick:()=>void ei(null),type:"button",variant:"outline",children:[(0,t.jsx)(d.Trash2,{})," ",n("clearDirectory")]})]})]})]}),(0,t.jsx)(z,{agent:c,canBrowseDirectories:el,onSaved:y},`${c.id}:${c.derivedDataLocationMode??"DEFAULT"}:${c.derivedDataPath??""}`),(0,t.jsx)(J,{agent:c,canBrowseDirectories:el,onSaved:y},`${c.id}:${c.buildsDirectory??"default"}:${c.defaultBuildsDirectory??""}`),$&&(0,t.jsx)(m.JobMonitor,{compact:!0,jobId:$},$),(0,t.jsxs)("section",{children:[(0,t.jsx)("h2",{className:"mb-3 font-medium",children:n("history")}),0===w.length?(0,t.jsx)(E.Empty,{children:(0,t.jsx)(E.EmptyHeader,{children:(0,t.jsx)(E.EmptyDescription,{children:n("noJobs")})})}):(0,t.jsx)(j.Card,{className:"gap-0 py-0",children:(0,t.jsxs)(S.Table,{children:[(0,t.jsx)(S.TableHeader,{children:(0,t.jsxs)(S.TableRow,{children:[(0,t.jsx)(S.TableHead,{children:n("job")}),(0,t.jsx)(S.TableHead,{children:n("status")}),(0,t.jsx)(S.TableHead,{children:n("created")}),(0,t.jsx)(S.TableHead,{children:n("finished")})]})}),(0,t.jsx)(S.TableBody,{children:w.map(e=>(0,t.jsxs)(S.TableRow,{"aria-current":$===e.id?"true":void 0,"aria-label":n("selectJob",{kind:e.kind}),className:(0,_.cn)("cursor-pointer focus-visible:bg-muted/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",$===e.id&&"bg-muted/50"),onClick:()=>F(e.id),onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),F(e.id))},role:"button",tabIndex:0,children:[(0,t.jsx)(S.TableCell,{className:"font-mono text-xs font-medium",children:e.kind}),(0,t.jsx)(S.TableCell,{children:(0,t.jsx)(g.StatusBadge,{status:e.status})}),(0,t.jsx)(S.TableCell,{children:new Date(e.createdAt).toLocaleString(s)}),(0,t.jsx)(S.TableCell,{children:e.finishedAt?new Date(e.finishedAt).toLocaleString(s):"—"})]},e.id))})]})})]})]})}],354576)}]);
@@ -52,4 +52,4 @@
52
52
  githubPullRequest(owner: $owner, name: $name, number: $number) {
53
53
  id number title url repositoryGithubId repositoryNameWithOwner repositoryUrl labels jiraKey pipelineStatus pipelines { id name status url checkSuiteId canRetry retryUnavailableReason jobs { id name status url canRetry retryUnavailableReason steps { number name status } } } reviewDecision unresolvedReviewThreadCount headRefName createdAt body bodyHtml author { login avatarUrl url } assignees { login avatarUrl url } reviewThreads { id isResolved isOutdated subjectType path line startLine originalLine originalStartLine viewerCanReply viewerCanResolve viewerCanUnresolve resolvedBy { login avatarUrl url } pullRequest { id number title url repositoryNameWithOwner } rootComment { id body bodyText bodyHtml url author { login avatarUrl url } createdAt updatedAt } replies { id body bodyText bodyHtml url author { login avatarUrl url } createdAt updatedAt } } baseRefName state isDraft mergeable additions deletions changedFiles commitCount updatedAt mergedAt worktreeId
54
54
  }
55
- }`,{owner:e,name:r,number:a});M(t.githubPullRequest),z(null)}catch(e){z(e instanceof Error?e.message:String(e))}finally{G(!1)}},[a,e,r]);(0,h.useEffect)(()=>{let e=window.setTimeout(()=>void F(),0);return()=>window.clearTimeout(e)},[F]);let _=e=>{M(t=>t?{...t,pipelineStatus:"PENDING",pipelines:t.pipelines.map(t=>t.id===e.id?{...e,jobs:e.jobs??t.jobs}:t)}:t)},W=(e,t)=>{M(s=>s?{...s,reviewThreads:s.reviewThreads.map(s=>s.id===e?{...s,replies:[...s.replies,t]}:s)}:s)},K=e=>{M(t=>{if(!t)return t;let s=t.reviewThreads.find(t=>t.id===e.id),r=s&&s.isResolved!==e.isResolved?e.isResolved?-1:1:0;return{...t,unresolvedReviewThreadCount:Math.max(0,t.unresolvedReviewThreadCount+r),reviewThreads:t.reviewThreads.map(t=>t.id===e.id?{...t,...e}:t)}})};if(U&&!L)return(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(S.Spinner,{}),f("loading")]});if(!L)return(0,t.jsxs)("section",{className:"mx-auto w-full max-w-5xl space-y-5",children:[O&&(0,t.jsx)(y.Alert,{variant:"destructive",children:(0,t.jsx)(y.AlertDescription,{children:O})}),(0,t.jsxs)(C.Empty,{className:"border py-12",children:[(0,t.jsxs)(C.EmptyHeader,{children:[(0,t.jsx)(C.EmptyMedia,{variant:"icon",children:(0,t.jsx)(n.GitPullRequest,{})}),(0,t.jsx)(C.EmptyTitle,{children:f("notFound")}),(0,t.jsx)(C.EmptyDescription,{children:f("notFoundDescription")})]}),(0,t.jsx)(N.Button,{asChild:!0,className:"mt-4",variant:"outline",children:(0,t.jsx)(T.Link,{href:"/pull-requests",children:f("back")})})]})]});let J=new Intl.DateTimeFormat(B,{dateStyle:"medium",timeStyle:"short"}),V=e=>e?J.format(new Date(e)):"—";return(0,t.jsxs)("section",{className:"mx-auto flex min-w-0 w-full max-w-6xl flex-col gap-5",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)(N.Button,{asChild:!0,className:"mb-3 -ml-2",variant:"ghost",children:(0,t.jsxs)(T.Link,{href:"/pull-requests",children:[(0,t.jsx)(s.ArrowLeft,{}),f("back")]})}),(0,t.jsxs)("p",{className:"text-sm text-muted-foreground",children:[L.repositoryNameWithOwner," #",L.number]}),(0,t.jsx)("h1",{className:"mt-1 text-2xl font-semibold break-words tracking-tight [overflow-wrap:anywhere]",children:L.title}),(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[(0,t.jsx)(w.Badge,{children:A(`pullRequestStates.${L.state}`)}),L.isDraft&&(0,t.jsx)(w.Badge,{children:f("draft")}),(0,t.jsx)(w.Badge,{className:"APPROVED"===(c=L.reviewDecision)?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":"CHANGES_REQUESTED"===c?"border-red-500/30 bg-red-500/10 text-red-700 dark:text-red-300":"REVIEW_REQUIRED"===c?"border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300":"border-slate-500/30 bg-slate-500/10 text-slate-700 dark:text-slate-300",children:A(`reviewStates.${L.reviewDecision}`)}),L.jiraKey&&(0,t.jsx)(w.Badge,{asChild:!0,className:"cursor-pointer hover:bg-muted/80",children:(0,t.jsx)("button",{onClick:()=>I(L.jiraKey),type:"button",children:L.jiraKey})})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[L.worktreeId&&(0,t.jsx)(N.Button,{asChild:!0,variant:"outline",children:(0,t.jsxs)(T.Link,{href:(0,D.worktreeDetailHref)(L.worktreeId),children:[(0,t.jsx)(d.GitBranch,{}),f("viewWorktree")]})}),"OPEN"===L.state&&(0,t.jsx)(b.MergePullRequestButton,{onMerged:F,pullRequest:L,size:"default"}),(0,t.jsxs)(N.Button,{disabled:U,onClick:()=>void F(),variant:"outline",children:[(0,t.jsx)(o.RefreshCw,{className:U?"animate-spin":void 0}),f("refresh")]}),(0,t.jsx)(N.Button,{asChild:!0,children:(0,t.jsxs)("a",{href:L.url,rel:"noreferrer",target:"_blank",children:[f("openInGitHub"),(0,t.jsx)(i.ExternalLink,{})]})})]})]}),O&&(0,t.jsx)(y.Alert,{variant:"destructive",children:(0,t.jsx)(y.AlertDescription,{children:O})}),(0,t.jsxs)("div",{className:"grid min-w-0 gap-5 lg:grid-cols-2",children:[(0,t.jsxs)("div",{className:"contents",children:[(0,t.jsx)(R.Card,{className:"min-w-0 order-2 lg:col-span-2",children:(0,t.jsx)(R.CardContent,{children:(0,t.jsx)(j.GitHubMarkdownBlock,{body:L.body,bodyHtml:L.bodyHtml,emptyLabel:f("noDescription"),header:(0,t.jsx)(R.CardTitle,{children:f("description")}),headerClassName:"border-b pb-4"})})}),(0,t.jsxs)("div",{className:"min-w-0 order-3 space-y-4 lg:col-span-2",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold",children:f("comments")}),(0,t.jsx)(w.Badge,{variant:"secondary",children:L.reviewThreads.length})]}),0===L.reviewThreads.length?(0,t.jsx)(C.Empty,{className:"border py-8",children:(0,t.jsxs)(C.EmptyHeader,{children:[(0,t.jsx)(C.EmptyTitle,{children:f("noComments")}),(0,t.jsx)(C.EmptyDescription,{children:f("noCommentsDescription")})]})}):(0,t.jsx)("div",{className:"space-y-5",children:L.reviewThreads.map(e=>(0,t.jsx)(g.ReviewThreadCard,{locale:B,onReplyAdded:W,onStateChanged:K,thread:e},e.id))})]}),(0,t.jsxs)(R.Card,{className:"min-w-0 order-4 gap-0 py-0 lg:col-span-2",children:[(0,t.jsxs)(R.CardHeader,{className:"flex grid-cols-none flex-row items-center justify-between gap-3 border-b py-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(R.CardTitle,{children:f("pipelines")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:f("pipelineCount",{count:L.pipelines.length})})]}),(0,t.jsx)(p.PipelineMenu,{onPipelineRetried:_,pipelineStatus:L.pipelineStatus,pipelines:L.pipelines,repositoryId:L.repositoryGithubId})]}),(0,t.jsx)(R.CardContent,{className:"px-0",children:0===L.pipelines.length?(0,t.jsx)("p",{className:"p-4 text-sm text-muted-foreground",children:A("noPipelines")}):(0,t.jsxs)(k.Table,{children:[(0,t.jsx)(k.TableHeader,{children:(0,t.jsxs)(k.TableRow,{className:"hover:bg-transparent",children:[(0,t.jsx)(k.TableHead,{children:f("pipelineName")}),(0,t.jsx)(k.TableHead,{children:f("pipelineStatus")}),(0,t.jsx)(k.TableHead,{className:"text-right",children:f("pipelineDetails")})]})}),(0,t.jsx)(k.TableBody,{children:L.pipelines.map(e=>(0,t.jsxs)(h.Fragment,{children:[(0,t.jsxs)(k.TableRow,{children:[(0,t.jsx)(k.TableCell,{className:"font-medium",children:e.name}),(0,t.jsx)(k.TableCell,{children:(0,t.jsx)(w.Badge,{className:(0,p.pipelineStateClass)(e.status),children:A(`pipelineStates.${e.status}`)})}),(0,t.jsx)(k.TableCell,{children:(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[e.url?(0,t.jsx)(N.Button,{asChild:!0,size:"sm",variant:"outline",children:(0,t.jsxs)("a",{href:e.url,rel:"noreferrer",target:"_blank",children:[f("viewPipeline"),(0,t.jsx)(i.ExternalLink,{})]})}):(0,t.jsxs)(N.Button,{disabled:!0,size:"sm",variant:"outline",children:[f("viewPipeline"),(0,t.jsx)(i.ExternalLink,{})]}),(0,t.jsx)(p.RetryPipelineButton,{onError:z,onPipelineRetried:_,pipeline:e,repositoryId:L.repositoryGithubId})]})})]}),(0,t.jsx)(k.TableRow,{className:"bg-muted/20 hover:bg-muted/20",children:(0,t.jsx)(k.TableCell,{className:"p-0",colSpan:3,children:(0,t.jsxs)("div",{className:"border-l-2 border-muted-foreground/20 px-4 py-1",children:[(0,t.jsx)("p",{className:"px-3 py-2 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:f("jobCount",{count:e.jobs.length})}),0===e.jobs.length?(0,t.jsx)("p",{className:"px-3 pb-3 text-sm text-muted-foreground",children:f("noJobs")}):(0,t.jsx)("div",{className:"divide-y",children:e.jobs.map(s=>(0,t.jsx)(P,{checkSuiteId:e.checkSuiteId,job:s,onError:z,onRetried:()=>{var t,r;return t=e.id,r=s.id,void M(e=>e?{...e,pipelineStatus:"PENDING",pipelines:e.pipelines.map(e=>e.id===t?{...e,status:"QUEUED",canRetry:!1,retryUnavailableReason:"NOT_COMPLETED",jobs:e.jobs.map(e=>e.id===r?{...e,status:"QUEUED",canRetry:!1,retryUnavailableReason:"NOT_COMPLETED",steps:[]}:{...e,canRetry:!1,retryUnavailableReason:"NOT_COMPLETED"})}:e)}:e)},repositoryId:L.repositoryGithubId},s.id))})]})})})]},e.id))})]})})]})]}),(0,t.jsxs)("div",{className:"contents",children:[(0,t.jsxs)(R.Card,{className:"min-w-0 order-1",children:[(0,t.jsx)(R.CardHeader,{className:"border-b",children:(0,t.jsx)(R.CardTitle,{children:f("details")})}),(0,t.jsx)(R.CardContent,{children:(0,t.jsxs)("dl",{className:"grid gap-4 text-sm",children:[(0,t.jsx)(H,{label:f("branches"),children:(0,t.jsxs)("span",{className:"font-mono text-xs break-all",children:[L.headRefName," → ",L.baseRefName]})}),(0,t.jsxs)(H,{label:f("changes"),children:[(0,t.jsxs)("span",{className:"text-emerald-600",children:["+",L.additions]})," ",(0,t.jsxs)("span",{className:"text-red-600",children:["−",L.deletions]})]}),(0,t.jsx)(H,{label:f("files"),children:L.changedFiles??"—"}),(0,t.jsx)(H,{label:f("commits"),children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,t.jsx)(l,{className:"size-4"}),L.commitCount]})}),(0,t.jsx)(H,{label:f("mergeable"),children:A(`mergeableStates.${L.mergeable}`)}),(0,t.jsx)(H,{label:f("openComments"),children:L.unresolvedReviewThreadCount}),(0,t.jsx)(H,{label:f("created"),children:V(L.createdAt)}),(0,t.jsx)(H,{label:f("updated"),children:V(L.updatedAt)}),L.mergedAt&&(0,t.jsx)(H,{label:f("merged"),children:V(L.mergedAt)})]})})]}),(0,t.jsxs)(R.Card,{className:"min-w-0 order-1",children:[(0,t.jsx)(R.CardHeader,{className:"border-b",children:(0,t.jsx)(R.CardTitle,{children:f("people")})}),(0,t.jsxs)(R.CardContent,{className:"space-y-4",children:[(0,t.jsx)($,{label:f("author"),person:L.author,unknownLabel:f("unknown")}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"mb-2 text-xs text-muted-foreground",children:f("assignees")}),0===L.assignees.length?(0,t.jsx)("p",{className:"text-sm",children:f("unassigned")}):(0,t.jsx)("div",{className:"space-y-2",children:L.assignees.map(e=>(0,t.jsx)($,{person:e,unknownLabel:f("unknown")},e.login))})]})]})]})]})]}),(0,t.jsx)(v.JiraTicketDrawer,{issueKey:q,onClose:()=>I(null)})]})}],337868)}]);
55
+ }`,{owner:e,name:r,number:a});M(t.githubPullRequest),z(null)}catch(e){z(e instanceof Error?e.message:String(e))}finally{G(!1)}},[a,e,r]);(0,h.useEffect)(()=>{let e=window.setTimeout(()=>void F(),0);return()=>window.clearTimeout(e)},[F]);let _=e=>{M(t=>t?{...t,pipelineStatus:"PENDING",pipelines:t.pipelines.map(t=>t.id===e.id?{...e,jobs:e.jobs??t.jobs}:t)}:t)},W=(e,t)=>{M(s=>s?{...s,reviewThreads:s.reviewThreads.map(s=>s.id===e?{...s,replies:[...s.replies,t]}:s)}:s)},K=e=>{M(t=>{if(!t)return t;let s=t.reviewThreads.find(t=>t.id===e.id),r=s&&s.isResolved!==e.isResolved?e.isResolved?-1:1:0;return{...t,unresolvedReviewThreadCount:Math.max(0,t.unresolvedReviewThreadCount+r),reviewThreads:t.reviewThreads.map(t=>t.id===e.id?{...t,...e}:t)}})};if(U&&!L)return(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(S.Spinner,{}),f("loading")]});if(!L)return(0,t.jsxs)("section",{className:"mx-auto w-full max-w-5xl space-y-5",children:[O&&(0,t.jsx)(y.Alert,{variant:"destructive",children:(0,t.jsx)(y.AlertDescription,{children:O})}),(0,t.jsxs)(C.Empty,{className:"border py-12",children:[(0,t.jsxs)(C.EmptyHeader,{children:[(0,t.jsx)(C.EmptyMedia,{variant:"icon",children:(0,t.jsx)(n.GitPullRequest,{})}),(0,t.jsx)(C.EmptyTitle,{children:f("notFound")}),(0,t.jsx)(C.EmptyDescription,{children:f("notFoundDescription")})]}),(0,t.jsx)(N.Button,{asChild:!0,className:"mt-4",variant:"outline",children:(0,t.jsx)(T.Link,{href:"/pull-requests",children:f("back")})})]})]});let J=new Intl.DateTimeFormat(B,{dateStyle:"medium",timeStyle:"short"}),V=e=>e?J.format(new Date(e)):"—";return(0,t.jsxs)("section",{className:"mx-auto flex min-w-0 w-full max-w-6xl flex-col gap-5",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)(N.Button,{asChild:!0,className:"mb-3 -ml-2",variant:"ghost",children:(0,t.jsxs)(T.Link,{href:"/pull-requests",children:[(0,t.jsx)(s.ArrowLeft,{}),f("back")]})}),(0,t.jsxs)("p",{className:"text-sm text-muted-foreground",children:[L.repositoryNameWithOwner," #",L.number]}),(0,t.jsx)("h1",{className:"mt-1 text-2xl font-semibold break-words tracking-tight [overflow-wrap:anywhere]",children:L.title}),(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[(0,t.jsx)(w.Badge,{children:A(`pullRequestStates.${L.state}`)}),L.isDraft&&(0,t.jsx)(w.Badge,{children:f("draft")}),(0,t.jsx)(w.Badge,{className:"APPROVED"===(c=L.reviewDecision)?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":"CHANGES_REQUESTED"===c?"border-red-500/30 bg-red-500/10 text-red-700 dark:text-red-300":"REVIEW_REQUIRED"===c?"border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300":"border-slate-500/30 bg-slate-500/10 text-slate-700 dark:text-slate-300",children:A(`reviewStates.${L.reviewDecision}`)}),L.jiraKey&&(0,t.jsx)(w.Badge,{asChild:!0,className:"cursor-pointer hover:bg-muted/80",children:(0,t.jsx)("button",{onClick:()=>I(L.jiraKey),type:"button",children:L.jiraKey})})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[L.worktreeId&&(0,t.jsx)(N.Button,{asChild:!0,variant:"outline",children:(0,t.jsxs)(T.Link,{href:(0,D.worktreeDetailHref)(L.worktreeId),children:[(0,t.jsx)(d.GitBranch,{}),f("viewWorktree")]})}),"OPEN"===L.state&&(0,t.jsx)(b.MergePullRequestButton,{onMerged:F,pullRequest:L,size:"default"}),(0,t.jsxs)(N.Button,{disabled:U,onClick:()=>void F(),variant:"outline",children:[(0,t.jsx)(o.RefreshCw,{className:U?"animate-spin":void 0}),f("refresh")]}),(0,t.jsx)(N.Button,{asChild:!0,children:(0,t.jsxs)("a",{href:L.url,rel:"noreferrer",target:"_blank",children:[f("openInGitHub"),(0,t.jsx)(i.ExternalLink,{})]})})]})]}),O&&(0,t.jsx)(y.Alert,{variant:"destructive",children:(0,t.jsx)(y.AlertDescription,{children:O})}),(0,t.jsxs)("div",{className:"grid min-w-0 gap-5 lg:grid-cols-2",children:[(0,t.jsxs)("div",{className:"contents",children:[(0,t.jsx)(R.Card,{className:"min-w-0 order-2 lg:col-span-2",children:(0,t.jsx)(R.CardContent,{children:(0,t.jsx)(j.GitHubMarkdownBlock,{body:L.body,bodyHtml:L.bodyHtml,emptyLabel:f("noDescription"),header:(0,t.jsx)(R.CardTitle,{children:f("description")}),headerClassName:"border-b pb-4"})})}),(0,t.jsxs)("div",{className:"min-w-0 order-3 space-y-4 lg:col-span-2",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold",children:f("comments")}),(0,t.jsx)(w.Badge,{variant:"secondary",children:L.reviewThreads.length})]}),0===L.reviewThreads.length?(0,t.jsx)(C.Empty,{className:"border py-8",children:(0,t.jsxs)(C.EmptyHeader,{children:[(0,t.jsx)(C.EmptyTitle,{children:f("noComments")}),(0,t.jsx)(C.EmptyDescription,{children:f("noCommentsDescription")})]})}):(0,t.jsx)("div",{className:"space-y-5",children:L.reviewThreads.map(e=>(0,t.jsx)(g.ReviewThreadCard,{locale:B,onReplyAdded:W,onStateChanged:K,thread:e},e.id))})]}),(0,t.jsxs)(R.Card,{className:"min-w-0 order-4 gap-0 py-0 lg:col-span-2",children:[(0,t.jsxs)(R.CardHeader,{className:"flex grid-cols-none flex-row items-center justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(R.CardTitle,{children:f("pipelines")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:f("pipelineCount",{count:L.pipelines.length})})]}),(0,t.jsx)(p.PipelineMenu,{onPipelineRetried:_,pipelineStatus:L.pipelineStatus,pipelines:L.pipelines,repositoryId:L.repositoryGithubId})]}),(0,t.jsx)(R.CardContent,{className:"px-0",children:0===L.pipelines.length?(0,t.jsx)("p",{className:"p-4 text-sm text-muted-foreground",children:A("noPipelines")}):(0,t.jsxs)(k.Table,{children:[(0,t.jsx)(k.TableHeader,{children:(0,t.jsxs)(k.TableRow,{className:"hover:bg-transparent",children:[(0,t.jsx)(k.TableHead,{children:f("pipelineName")}),(0,t.jsx)(k.TableHead,{children:f("pipelineStatus")}),(0,t.jsx)(k.TableHead,{className:"text-right",children:f("pipelineDetails")})]})}),(0,t.jsx)(k.TableBody,{children:L.pipelines.map(e=>(0,t.jsxs)(h.Fragment,{children:[(0,t.jsxs)(k.TableRow,{children:[(0,t.jsx)(k.TableCell,{className:"font-medium",children:e.name}),(0,t.jsx)(k.TableCell,{children:(0,t.jsx)(w.Badge,{className:(0,p.pipelineStateClass)(e.status),children:A(`pipelineStates.${e.status}`)})}),(0,t.jsx)(k.TableCell,{children:(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[e.url?(0,t.jsx)(N.Button,{asChild:!0,size:"sm",variant:"outline",children:(0,t.jsxs)("a",{href:e.url,rel:"noreferrer",target:"_blank",children:[f("viewPipeline"),(0,t.jsx)(i.ExternalLink,{})]})}):(0,t.jsxs)(N.Button,{disabled:!0,size:"sm",variant:"outline",children:[f("viewPipeline"),(0,t.jsx)(i.ExternalLink,{})]}),(0,t.jsx)(p.RetryPipelineButton,{onError:z,onPipelineRetried:_,pipeline:e,repositoryId:L.repositoryGithubId})]})})]}),(0,t.jsx)(k.TableRow,{className:"bg-muted/20 hover:bg-muted/20",children:(0,t.jsx)(k.TableCell,{className:"p-0",colSpan:3,children:(0,t.jsxs)("div",{className:"border-l-2 border-muted-foreground/20 px-4 py-1",children:[(0,t.jsx)("p",{className:"px-3 py-2 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:f("jobCount",{count:e.jobs.length})}),0===e.jobs.length?(0,t.jsx)("p",{className:"px-3 pb-3 text-sm text-muted-foreground",children:f("noJobs")}):(0,t.jsx)("div",{className:"divide-y",children:e.jobs.map(s=>(0,t.jsx)(P,{checkSuiteId:e.checkSuiteId,job:s,onError:z,onRetried:()=>{var t,r;return t=e.id,r=s.id,void M(e=>e?{...e,pipelineStatus:"PENDING",pipelines:e.pipelines.map(e=>e.id===t?{...e,status:"QUEUED",canRetry:!1,retryUnavailableReason:"NOT_COMPLETED",jobs:e.jobs.map(e=>e.id===r?{...e,status:"QUEUED",canRetry:!1,retryUnavailableReason:"NOT_COMPLETED",steps:[]}:{...e,canRetry:!1,retryUnavailableReason:"NOT_COMPLETED"})}:e)}:e)},repositoryId:L.repositoryGithubId},s.id))})]})})})]},e.id))})]})})]})]}),(0,t.jsxs)("div",{className:"contents",children:[(0,t.jsxs)(R.Card,{className:"min-w-0 order-1",children:[(0,t.jsx)(R.CardHeader,{children:(0,t.jsx)(R.CardTitle,{children:f("details")})}),(0,t.jsx)(R.CardContent,{children:(0,t.jsxs)("dl",{className:"grid gap-4 text-sm",children:[(0,t.jsx)(H,{label:f("branches"),children:(0,t.jsxs)("span",{className:"font-mono text-xs break-all",children:[L.headRefName," → ",L.baseRefName]})}),(0,t.jsxs)(H,{label:f("changes"),children:[(0,t.jsxs)("span",{className:"text-emerald-600",children:["+",L.additions]})," ",(0,t.jsxs)("span",{className:"text-red-600",children:["−",L.deletions]})]}),(0,t.jsx)(H,{label:f("files"),children:L.changedFiles??"—"}),(0,t.jsx)(H,{label:f("commits"),children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,t.jsx)(l,{className:"size-4"}),L.commitCount]})}),(0,t.jsx)(H,{label:f("mergeable"),children:A(`mergeableStates.${L.mergeable}`)}),(0,t.jsx)(H,{label:f("openComments"),children:L.unresolvedReviewThreadCount}),(0,t.jsx)(H,{label:f("created"),children:V(L.createdAt)}),(0,t.jsx)(H,{label:f("updated"),children:V(L.updatedAt)}),L.mergedAt&&(0,t.jsx)(H,{label:f("merged"),children:V(L.mergedAt)})]})})]}),(0,t.jsxs)(R.Card,{className:"min-w-0 order-1",children:[(0,t.jsx)(R.CardHeader,{children:(0,t.jsx)(R.CardTitle,{children:f("people")})}),(0,t.jsxs)(R.CardContent,{className:"space-y-4",children:[(0,t.jsx)($,{label:f("author"),person:L.author,unknownLabel:f("unknown")}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"mb-2 text-xs text-muted-foreground",children:f("assignees")}),0===L.assignees.length?(0,t.jsx)("p",{className:"text-sm",children:f("unassigned")}):(0,t.jsx)("div",{className:"space-y-2",children:L.assignees.map(e=>(0,t.jsx)($,{person:e,unknownLabel:f("unknown")},e.login))})]})]})]})]})]}),(0,t.jsx)(v.JiraTicketDrawer,{issueKey:q,onClose:()=>I(null)})]})}],337868)}]);
@@ -0,0 +1,7 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,689664,e=>{"use strict";var t=e.i(643957);e.s(["Check",()=>t.default])},508734,e=>{"use strict";let t=(0,e.i(456420).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,t],508734)},929592,e=>{"use strict";var t=e.i(843476),r=e.i(225913),n=e.i(975157);let a=(0,r.cva)("group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current"}},defaultVariants:{variant:"default"}});e.s(["Alert",0,function({className:e,variant:r,...i}){return(0,t.jsx)("div",{"data-slot":"alert",role:"alert",className:(0,n.cn)(a({variant:r}),e),...i})},"AlertDescription",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"alert-description",className:(0,n.cn)("text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",e),...r})}])},515288,e=>{"use strict";var t=e.i(843476),r=e.i(975157);e.s(["Card",0,function({className:e,size:n="default",...a}){return(0,t.jsx)("div",{"data-slot":"card","data-size":n,className:(0,r.cn)("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>[data-slot=card-header]]:pt-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...a})},"CardAction",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"card-action",className:(0,r.cn)("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e),...n})},"CardContent",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,r.cn)("px-(--card-spacing)",e),...n})},"CardDescription",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"card-description",className:(0,r.cn)("text-sm text-muted-foreground",e),...n})},"CardFooter",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"card-footer",className:(0,r.cn)("flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)",e),...n})},"CardHeader",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,r.cn)("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl bg-muted/40 px-(--card-spacing) py-(--card-spacing) not-last:border-b has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto]",e),...n})},"CardTitle",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"card-title",className:(0,r.cn)("font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",e),...n})}])},758379,e=>{"use strict";let t=(0,e.i(456420).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["default",0,t])},987968,e=>{"use strict";var t=e.i(843476),r=e.i(975157),n=e.i(758379),n=n;e.s(["Spinner",0,function({className:e,...a}){return(0,t.jsx)(n.default,{"data-slot":"spinner",role:"status","aria-label":"Loading",className:(0,r.cn)("size-4 animate-spin",e),...a})}],987968)},637611,e=>{"use strict";var t,r,n=e.i(247167);function a(e){return null===e?"null":Array.isArray(e)?"array":typeof e}function i(e){return"object"===a(e)}function o(e,t){return e.length<124?e:t}var s=((t=s||{})[t.InternalServerError=4500]="InternalServerError",t[t.InternalClientError=4005]="InternalClientError",t[t.BadRequest=4400]="BadRequest",t[t.BadResponse=4004]="BadResponse",t[t.Unauthorized=4401]="Unauthorized",t[t.Forbidden=4403]="Forbidden",t[t.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",t[t.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",t[t.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",t[t.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",t[t.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests",t),l=((r=l||{}).ConnectionInit="connection_init",r.ConnectionAck="connection_ack",r.Ping="ping",r.Pong="pong",r.Subscribe="subscribe",r.Next="next",r.Error="error",r.Complete="complete",r);function c(e){if(!i(e))throw Error(`Message is expected to be an object, but got ${a(e)}`);if(!e.type)throw Error("Message is missing the 'type' property");if("string"!=typeof e.type)throw Error(`Message is expects the 'type' property to be a string, but got ${a(e.type)}`);switch(e.type){case"connection_init":case"connection_ack":case"ping":case"pong":if(null!=e.payload&&!i(e.payload))throw Error(`"${e.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${e.payload}"`);break;case"subscribe":if("string"!=typeof e.id)throw Error(`"${e.type}" message expects the 'id' property to be a string, but got ${a(e.id)}`);if(!e.id)throw Error(`"${e.type}" message requires a non-empty 'id' property`);if(!i(e.payload))throw Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${a(e.payload)}`);if("string"!=typeof e.payload.query)throw Error(`"${e.type}" message payload expects the 'query' property to be a string, but got ${a(e.payload.query)}`);if(null!=e.payload.variables&&!i(e.payload.variables))throw Error(`"${e.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${a(e.payload.variables)}`);if(null!=e.payload.operationName&&"string"!==a(e.payload.operationName))throw Error(`"${e.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${a(e.payload.operationName)}`);if(null!=e.payload.extensions&&!i(e.payload.extensions))throw Error(`"${e.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${a(e.payload.extensions)}`);break;case"next":if("string"!=typeof e.id)throw Error(`"${e.type}" message expects the 'id' property to be a string, but got ${a(e.id)}`);if(!e.id)throw Error(`"${e.type}" message requires a non-empty 'id' property`);if(!i(e.payload))throw Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${a(e.payload)}`);break;case"error":var t;if("string"!=typeof e.id)throw Error(`"${e.type}" message expects the 'id' property to be a string, but got ${a(e.id)}`);if(!e.id)throw Error(`"${e.type}" message requires a non-empty 'id' property`);if(!(Array.isArray(t=e.payload)&&t.length>0&&t.every(e=>"message"in e)))throw Error(`"${e.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(e.payload)}`);break;case"complete":if("string"!=typeof e.id)throw Error(`"${e.type}" message expects the 'id' property to be a string, but got ${a(e.id)}`);if(!e.id)throw Error(`"${e.type}" message requires a non-empty 'id' property`);break;default:throw Error(`Invalid message 'type' property "${e.type}"`)}return e}function d(e,t){return c(e),JSON.stringify(e,t)}class u extends Error{name="TerminatedCloseEvent";message="4499: Terminated";code=4499;reason="Terminated";wasClean=!1}function p(e){return i(e)&&"code"in e&&"reason"in e}async function f(e,t){let r=await fetch("/api/graphql",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({query:e,variables:t})}),n=await r.json();if(!r.ok||n.errors?.length||!n.data)throw Error(n.errors?.map(e=>e.message).join("; ")||`HTTP ${r.status}`);return n.data}let m=null;function h(){return function(e,t,r){let n=`${"https:"===t?"wss":"ws"}://${r}/graphql`;if(!e)return n;try{let r=new URL(e);if("https:"===t&&"wss:"!==r.protocol)return n}catch{}return e}(n.default.env.NEXT_PUBLIC_AGENT_WS_URL,window.location.protocol,window.location.host)}e.s(["controlPlaneRequest",0,f,"controlPlaneSubscriptions",0,function(){return m??=function(t){let r,n,a,i,{url:f,connectionParams:m,lazy:h=!0,onNonLazyError:g=console.error,lazyCloseTimeout:x=0,keepAlive:y=0,disablePong:v,connectionAckWaitTimeout:b=0,retryAttempts:j=5,retryWait:w=async function(e){let t=Math.pow(2,e);await new Promise(e=>setTimeout(e,1e3*t+Math.floor(2700*Math.random()+300)))},shouldRetry:C=p,on:S,webSocketImpl:N,generateID:k=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})},jsonMessageReplacer:E,jsonMessageReviver:T}=t;if(N){var R;if(!("function"==typeof(R=N)&&"constructor"in R&&"CLOSED"in R&&"CLOSING"in R&&"CONNECTING"in R&&"OPEN"in R))throw Error("Invalid WebSocket implementation provided");r=N}else r="u">typeof WebSocket?WebSocket:e.g.WebSocket||e.g.MozWebSocket;if(!r)throw Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");let D=r,A=(n={},a={on:(e,t)=>(n[e]=t,()=>{delete n[e]}),emit(e){"id"in e&&n[e.id]?.(e)}},i={connecting:S?.connecting?[S.connecting]:[],opened:S?.opened?[S.opened]:[],connected:S?.connected?[S.connected]:[],ping:S?.ping?[S.ping]:[],pong:S?.pong?[S.pong]:[],message:S?.message?[a.emit,S.message]:[a.emit],closed:S?.closed?[S.closed]:[],error:S?.error?[S.error]:[]},{onMessage:a.on,on(e,t){let r=i[e];return r.push(t),()=>{r.splice(r.indexOf(t),1)}},emit(e,...t){for(let r of[...i[e]])r(...t)}});function P(e){let t=[A.on("error",r=>{t.forEach(e=>e()),e(r)}),A.on("closed",r=>{t.forEach(e=>e()),e(r)})]}let O,I=0,$,z=!1,_=0,M=!1;async function q(){clearTimeout($);let[e,t]=await (O??(O=new Promise((e,t)=>(async()=>{let r,n;if(z){if(await w(_),!I)return O=void 0,t({code:1e3,reason:"All Subscriptions Gone"});_++}A.emit("connecting",z);let a=new D("function"==typeof f?await f():f,"graphql-transport-ws");function i(){isFinite(y)&&y>0&&(clearTimeout(n),n=setTimeout(()=>{a.readyState===D.OPEN&&(a.send(d({type:l.Ping})),A.emit("ping",!1,void 0))},y))}P(e=>{O=void 0,clearTimeout(r),clearTimeout(n),t(e),e instanceof u&&(a.close(4499,"Terminated"),a.onerror=null,a.onclose=null)}),a.onerror=e=>A.emit("error",e),a.onclose=e=>A.emit("closed",e),a.onopen=async()=>{try{A.emit("opened",a);let e="function"==typeof m?await m():m;if(a.readyState!==D.OPEN)return;a.send(d(e?{type:l.ConnectionInit,payload:e}:{type:l.ConnectionInit},E)),isFinite(b)&&b>0&&(r=setTimeout(()=>{a.close(s.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},b)),i()}catch(e){A.emit("error",e),a.close(s.InternalClientError,o(e instanceof Error?e.message:String(e),"Internal client error"))}};let p=!1;a.onmessage=({data:t})=>{try{let n=c("string"==typeof t?JSON.parse(t,T):t);if(A.emit("message",n),"ping"===n.type||"pong"===n.type){A.emit(n.type,!0,n.payload),"pong"===n.type?i():v||(a.send(d(n.payload?{type:l.Pong,payload:n.payload}:{type:l.Pong})),A.emit("pong",!1,n.payload));return}if(p)return;if(n.type!==l.ConnectionAck)throw Error(`First message cannot be of type ${n.type}`);clearTimeout(r),p=!0,A.emit("connected",a,n.payload,z),z=!1,_=0,e([a,new Promise((e,t)=>P(t))])}catch(e){a.onmessage=null,A.emit("error",e),a.close(s.BadResponse,o(e instanceof Error?e.message:String(e),"Bad response"))}}})())));e.readyState===D.CLOSING&&await t;let r=()=>{},n=new Promise(e=>r=e);return[e,r,Promise.race([n.then(()=>{I||(isFinite(x)&&x>0?$=setTimeout(()=>{e.readyState===D.OPEN&&e.close(1e3,"Normal Closure")},x):e.close(1e3,"Normal Closure"))}),t])]}function L(e){var t;if(p(e)&&(![1e3,1001,1006,1005,1012,1013,1014].includes(t=e.code)&&t>=1e3&&t<=1999||[s.InternalServerError,s.InternalClientError,s.BadRequest,s.BadResponse,s.Unauthorized,s.SubprotocolNotAcceptable,s.SubscriberAlreadyExists,s.TooManyInitialisationRequests].includes(e.code)))throw e;if(M)return!1;if(p(e)&&1e3===e.code)return I>0;if(!j||_>=j||!C(e))throw e;return z=!0}function B(e,t){let r=k(e),n=!1,a=!1,i=()=>{I--,n=!0};return(async()=>{for(I++;;)try{let[o,s,c]=await q();if(n)return s();let u=A.onMessage(r,e=>{switch(e.type){case l.Next:return void t.next(e.payload);case l.Error:a=!0,n=!0,t.error(e.payload),i();return;case l.Complete:n=!0,i();return}});o.send(d({id:r,type:l.Subscribe,payload:e},E)),i=()=>{n||o.readyState!==D.OPEN||o.send(d({id:r,type:l.Complete},E)),I--,n=!0,s()},await c.finally(u);return}catch(e){if(!L(e))return}})().then(()=>{a||t.complete()}).catch(e=>{t.error(e)}),()=>{n||i()}}return h||(async()=>{for(I++;;)try{let[,,e]=await q();await e}catch(e){try{if(!L(e))return}catch(e){return g?.(e)}}})(),{on:A.on,subscribe:B,iterate(e){let t=[],r={done:!1,error:null,resolve:()=>{}},n=B(e,{next(e){t.push(e),r.resolve()},error(e){r.done=!0,r.error=e,r.resolve()},complete(){r.done=!0,r.resolve()}}),a=async function*(){for(;;){for(t.length||await new Promise(e=>r.resolve=e);t.length;)yield t.shift();if(r.error)throw r.error;if(r.done)return}}();return a.throw=async e=>(r.done||(r.done=!0,r.error=e,r.resolve()),{done:!0,value:void 0}),a.return=async()=>(n(),{done:!0,value:void 0}),a},async dispose(){if(M=!0,O){let[e]=await O;e.close(1e3,"Normal Closure")}},terminate(){O&&A.emit("closed",new u)}}}({url:h,lazy:!0,retryAttempts:1/0,shouldRetry:()=>!0})}],637611)},487486,e=>{"use strict";var t=e.i(843476),r=e.i(225913),n=e.i(709840),a=e.i(975157);let i=(0,r.cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",success:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300 [a]:hover:bg-emerald-500/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});e.s(["Badge",0,function({className:e,variant:r="default",asChild:o=!1,...s}){let l=o?n.Slot.Root:"span";return(0,t.jsx)(l,{className:(0,a.cn)(i({variant:r}),e),"data-slot":"badge","data-variant":r,...s})}])},784774,e=>{"use strict";var t=e.i(843476),r=e.i(975157);e.s(["Table",0,function({className:e,containerClassName:n,...a}){return(0,t.jsx)("div",{className:(0,r.cn)("w-full overflow-x-auto",n),children:(0,t.jsx)("table",{className:(0,r.cn)("w-full caption-bottom text-sm",e),...a})})},"TableBody",0,function({className:e,...n}){return(0,t.jsx)("tbody",{className:(0,r.cn)("divide-y",e),...n})},"TableCell",0,function({className:e,...n}){return(0,t.jsx)("td",{className:(0,r.cn)("whitespace-nowrap px-3 py-3 align-middle",e),...n})},"TableFooter",0,function({className:e,...n}){return(0,t.jsx)("tfoot",{className:(0,r.cn)("border-t bg-muted/50 font-medium",e),...n})},"TableHead",0,function({className:e,...n}){return(0,t.jsx)("th",{className:(0,r.cn)("h-10 whitespace-nowrap px-3 text-left align-middle text-xs font-medium text-muted-foreground",e),...n})},"TableHeader",0,function({className:e,...n}){return(0,t.jsx)("thead",{className:(0,r.cn)("border-b",e),...n})},"TableRow",0,function({className:e,...n}){return(0,t.jsx)("tr",{className:(0,r.cn)("transition-colors hover:bg-muted/40",e),...n})}])},573474,e=>{"use strict";let t=(0,e.i(456420).default)("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.s(["Trash2",0,t],573474)},340953,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(30030);function a(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function i(...e){return r.useCallback(function(...e){return t=>{let r=!1,n=e.map(e=>{let n=a(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){let r=n[t];"function"==typeof r?r():a(e[t],null)}}}}(...e),e)}var o=e.i(326999);"u">typeof window&&window.document&&window.document.createElement;var s="AlertDialog",[l,c]=(0,n.createContextScope)(s,[o.createDialogScope]),d=(0,o.createDialogScope)(),u=e=>{let{__scopeAlertDialog:r,...n}=e,a=d(r);return(0,t.jsx)(o.Root,{...a,...n,modal:!0})};u.displayName=s;var p=r.forwardRef((e,r)=>{let{__scopeAlertDialog:n,...a}=e,i=d(n);return(0,t.jsx)(o.Trigger,{...i,...a,ref:r})});p.displayName="AlertDialogTrigger";var f=e=>{let{__scopeAlertDialog:r,...n}=e,a=d(r);return(0,t.jsx)(o.Portal,{...a,...n})};f.displayName="AlertDialogPortal";var m=r.forwardRef((e,r)=>{let{__scopeAlertDialog:n,...a}=e,i=d(n);return(0,t.jsx)(o.Overlay,{...i,...a,ref:r})});m.displayName="AlertDialogOverlay";var h="AlertDialogContent",[g,x]=l(h),y=r.forwardRef((e,n)=>{let{__scopeAlertDialog:a,children:s,...l}=e,c=d(a),u=i(n,r.useRef(null)),p=r.useRef(null);return(0,t.jsx)(g,{scope:a,cancelRef:p,children:(0,t.jsx)(o.Content,{role:"alertdialog",...c,...l,ref:u,onOpenAutoFocus:function(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n||!n.defaultPrevented)return t?.(n)}}(l.onOpenAutoFocus,e=>{e.preventDefault(),p.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:s})})});y.displayName=h;var v=r.forwardRef((e,r)=>{let{__scopeAlertDialog:n,...a}=e,i=d(n);return(0,t.jsx)(o.Title,{...i,...a,ref:r})});v.displayName="AlertDialogTitle";var b=r.forwardRef((e,r)=>{let{__scopeAlertDialog:n,...a}=e,i=d(n);return(0,t.jsx)(o.Description,{...i,...a,ref:r})});b.displayName="AlertDialogDescription";var j=r.forwardRef((e,r)=>{let{__scopeAlertDialog:n,...a}=e,i=d(n);return(0,t.jsx)(o.Close,{...i,...a,ref:r})});j.displayName="AlertDialogAction";var w="AlertDialogCancel",C=r.forwardRef((e,r)=>{let{__scopeAlertDialog:n,...a}=e,{cancelRef:s}=x(w,n),l=d(n),c=i(r,s);return(0,t.jsx)(o.Close,{...l,...a,ref:c})});C.displayName=w,e.s(["Action",0,j,"AlertDialog",0,u,"AlertDialogAction",0,j,"AlertDialogCancel",0,C,"AlertDialogContent",0,y,"AlertDialogDescription",0,b,"AlertDialogOverlay",0,m,"AlertDialogPortal",0,f,"AlertDialogTitle",0,v,"AlertDialogTrigger",0,p,"Cancel",0,C,"Content",0,y,"Description",0,b,"Overlay",0,m,"Portal",0,f,"Root",0,u,"Title",0,v,"Trigger",0,p,"createAlertDialogScope",0,c],691162);var S=e.i(691162),S=S,N=e.i(975157),k=e.i(519455);function E({...e}){return(0,t.jsx)(S.Root,{"data-slot":"alert-dialog",...e})}function T({...e}){return(0,t.jsx)(S.Trigger,{"data-slot":"alert-dialog-trigger",...e})}function R({...e}){return(0,t.jsx)(S.Portal,{"data-slot":"alert-dialog-portal",...e})}function D({className:e,...r}){return(0,t.jsx)(S.Overlay,{"data-slot":"alert-dialog-overlay",className:(0,N.cn)("fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...r})}function A({className:e,size:r="default",...n}){return(0,t.jsxs)(R,{children:[(0,t.jsx)(D,{}),(0,t.jsx)(S.Content,{"data-slot":"alert-dialog-content","data-size":r,className:(0,N.cn)("group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...n})]})}function P({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-header",className:(0,N.cn)("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",e),...r})}function O({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-footer",className:(0,N.cn)("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",e),...r})}function I({className:e,...r}){return(0,t.jsx)(S.Title,{"data-slot":"alert-dialog-title",className:(0,N.cn)("font-heading text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",e),...r})}function $({className:e,...r}){return(0,t.jsx)(S.Description,{"data-slot":"alert-dialog-description",className:(0,N.cn)("text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...r})}function z({className:e,variant:r="default",size:n="default",...a}){return(0,t.jsx)(k.Button,{variant:r,size:n,asChild:!0,children:(0,t.jsx)(S.Action,{"data-slot":"alert-dialog-action",className:(0,N.cn)(e),...a})})}function _({className:e,variant:r="outline",size:n="default",...a}){return(0,t.jsx)(k.Button,{variant:r,size:n,asChild:!0,children:(0,t.jsx)(S.Cancel,{"data-slot":"alert-dialog-cancel",className:(0,N.cn)(e),...a})})}e.s(["ConfirmationDialog",0,function({actionLabel:e,cancelLabel:r,description:n,onConfirm:a,onOpenChange:i,open:o,title:s,trigger:l}){return(0,t.jsxs)(E,{onOpenChange:i,open:o,children:[l&&(0,t.jsx)(T,{asChild:!0,children:l}),(0,t.jsxs)(A,{children:[(0,t.jsxs)(P,{children:[(0,t.jsx)(I,{children:s}),(0,t.jsx)($,{children:n})]}),(0,t.jsxs)(O,{children:[(0,t.jsx)(_,{children:r}),(0,t.jsx)(z,{onClick:()=>void a(),variant:"destructive",children:e})]})]})]})}],340953)},59497,e=>{"use strict";var t=e.i(843476),r=e.i(271645);function n(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function a(...e){return r.useCallback(function(...e){return t=>{let r=!1,a=e.map(e=>{let a=n(e,t);return r||"function"!=typeof a||(r=!0),a});if(r)return()=>{for(let t=0;t<a.length;t++){let r=a[t];"function"==typeof r?r():n(e[t],null)}}}}(...e),e)}var i=e.i(30030);function o(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n||!n.defaultPrevented)return t?.(n)}}"u">typeof window&&window.document&&window.document.createElement;var s=globalThis?.document?r.useLayoutEffect:()=>{};r[" useEffectEvent ".trim().toString()],r[" useInsertionEffect ".trim().toString()];var l=r[" useInsertionEffect ".trim().toString()]||s;Symbol("RADIX:SYNC_STATE");var c=e.i(999682),d=e.i(635804),u=e.i(296626);e.i(174080);var p=Symbol.for("radix.slottable"),f=Symbol.for("react.lazy");function m(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===f&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}var h=r[" use ".trim().toString()],g=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,n)=>{var i;let o,s=(i=`Primitive.${n}`,(o=r.forwardRef((e,t)=>{var n;let o,s,{children:l,...c}=e,d=null,u=!1,f=[];m(l)&&"function"==typeof h&&(l=h(l._payload)),r.Children.forEach(l,e=>{var t;if(t=e,r.isValidElement(t)&&"function"==typeof t.type&&"__radixId"in t.type&&t.type.__radixId===p){u=!0;let t="child"in e.props?e.props.child:e.props.children;m(t)&&"function"==typeof h&&(t=h(t._payload)),d=((e,t)=>{if("child"in e.props){let t=e.props.child;return r.isValidElement(t)?r.cloneElement(t,void 0,e.props.children(t.props.children)):null}return r.isValidElement(t)?t:null})(e,t),f.push(d?.props?.children)}else f.push(e)}),d?d=r.cloneElement(d,void 0,f):!u&&1===r.Children.count(l)&&r.isValidElement(l)&&(d=l);let g=d?(n=d,(s=(o=Object.getOwnPropertyDescriptor(n.props,"ref")?.get)&&"isReactWarning"in o&&o.isReactWarning)?n.ref:(s=(o=Object.getOwnPropertyDescriptor(n,"ref")?.get)&&"isReactWarning"in o&&o.isReactWarning)?n.props.ref:n.props.ref||n.ref):void 0,x=a(t,g);if(!d){if(l||0===l){let e,t;throw Error(u?(e=i,`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`):(t=i,`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`))}return l}let y=function(e,t){let r={...t};for(let n in t){let a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...e)=>{let t=i(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...i}:"className"===n&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}(c,d.props??{});return d.type!==r.Fragment&&(y.ref=t?x:g),r.cloneElement(d,y)})).displayName=`${i}.Slot`,o),l=r.forwardRef((e,r)=>{let{asChild:a,...i}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,t.jsx)(a?s:n,{...i,ref:r})});return l.displayName=`Primitive.${n}`,{...e,[n]:l}},{}),x="Checkbox",[y,v]=(0,i.createContextScope)(x),[b,j]=y(x);function w(e){let{__scopeCheckbox:n,checked:a,children:i,defaultChecked:o,disabled:s,form:c,name:d,onCheckedChange:u,required:p,value:f="on",internal_do_not_use_render:m}=e,[h,g]=function({prop:e,defaultProp:t,onChange:n=()=>{},caller:a}){let[i,o,s]=function({defaultProp:e,onChange:t}){let[n,a]=r.useState(e),i=r.useRef(n),o=r.useRef(t);return l(()=>{o.current=t},[t]),r.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,a,o]}({defaultProp:t,onChange:n}),c=void 0!==e,d=c?e:i;{let t=r.useRef(void 0!==e);r.useEffect(()=>{let e=t.current;if(e!==c){let t=c?"controlled":"uncontrolled";console.warn(`${a} is changing from ${e?"controlled":"uncontrolled"} to ${t}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=c},[c,a])}return[d,r.useCallback(t=>{if(c){let r="function"==typeof t?t(e):t;r!==e&&s.current?.(r)}else o(t)},[c,e,o,s])]}({prop:a,defaultProp:o??!1,onChange:u,caller:x}),[y,v]=r.useState(null),[j,w]=r.useState(null),C=r.useRef(!1),S=!y||!!c||!!y.closest("form"),N={checked:h,disabled:s,setChecked:g,control:y,setControl:v,name:d,form:c,value:f,hasConsumerStoppedPropagationRef:C,required:p,defaultChecked:!D(o)&&o,isFormControl:S,bubbleInput:j,setBubbleInput:w};return(0,t.jsx)(b,{scope:n,...N,children:"function"==typeof m?m(N):i})}var C="CheckboxTrigger",S=r.forwardRef(({__scopeCheckbox:e,onKeyDown:n,onClick:i,...s},l)=>{let{control:c,value:d,disabled:u,checked:p,required:f,setControl:m,setChecked:h,hasConsumerStoppedPropagationRef:x,isFormControl:y,bubbleInput:v}=j(C,e),b=a(l,m),w=r.useRef(p);return r.useEffect(()=>{let e=c?.form;if(e){let t=()=>h(w.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[c,h]),(0,t.jsx)(g.button,{type:"button",role:"checkbox","aria-checked":D(p)?"mixed":p,"aria-required":f,"data-state":A(p),"data-disabled":u?"":void 0,disabled:u,value:d,...s,ref:b,onKeyDown:o(n,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:o(i,e=>{h(e=>!!D(e)||!e),v&&y&&(x.current=e.isPropagationStopped(),x.current||e.stopPropagation())})})});S.displayName=C;var N=r.forwardRef((e,r)=>{let{__scopeCheckbox:n,name:a,checked:i,defaultChecked:o,required:s,disabled:l,value:c,onCheckedChange:d,form:u,...p}=e;return(0,t.jsx)(w,{__scopeCheckbox:n,checked:i,defaultChecked:o,disabled:l,required:s,onCheckedChange:d,name:a,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(S,{...p,ref:r,__scopeCheckbox:n}),e&&(0,t.jsx)(R,{__scopeCheckbox:n})]})})});N.displayName=x;var k="CheckboxIndicator",E=r.forwardRef((e,r)=>{let{__scopeCheckbox:n,forceMount:a,...i}=e,o=j(k,n);return(0,t.jsx)(u.Presence,{present:a||D(o.checked)||!0===o.checked,children:(0,t.jsx)(g.span,{"data-state":A(o.checked),"data-disabled":o.disabled?"":void 0,...i,ref:r,style:{pointerEvents:"none",...e.style}})})});E.displayName=k;var T="CheckboxBubbleInput",R=r.forwardRef(({__scopeCheckbox:e,...n},i)=>{let{control:o,hasConsumerStoppedPropagationRef:s,checked:l,defaultChecked:u,required:p,disabled:f,name:m,value:h,form:x,bubbleInput:y,setBubbleInput:v}=j(T,e),b=a(i,v),w=(0,c.usePrevious)(l),C=(0,d.useSize)(o);r.useEffect(()=>{if(!y)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,t=!s.current;if(w!==l&&e){let r=new Event("click",{bubbles:t});y.indeterminate=D(l),e.call(y,!D(l)&&l),y.dispatchEvent(r)}},[y,w,l,s]);let S=r.useRef(!D(l)&&l);return(0,t.jsx)(g.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??S.current,required:p,disabled:f,name:m,value:h,form:x,...n,tabIndex:-1,ref:b,style:{...n.style,...C,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function D(e){return"indeterminate"===e}function A(e){return D(e)?"indeterminate":e?"checked":"unchecked"}R.displayName=T,e.s(["Checkbox",0,N,"CheckboxIndicator",0,E,"Indicator",0,E,"Root",0,N,"createCheckboxScope",0,v,"unstable_BubbleInput",0,R,"unstable_CheckboxBubbleInput",0,R,"unstable_CheckboxProvider",0,w,"unstable_CheckboxTrigger",0,S,"unstable_Provider",0,w,"unstable_Trigger",0,S],388474);var P=e.i(388474),P=P,O=e.i(975157),I=e.i(593698);e.s(["Checkbox",0,function({className:e,...r}){return(0,t.jsx)(P.Root,{"data-slot":"checkbox",className:(0,O.cn)("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary",e),...r,children:(0,t.jsx)(P.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:(0,t.jsx)(I.CheckIcon,{})})})}],59497)},624687,e=>{"use strict";var t=e.i(843476),r=e.i(975157);e.s(["Textarea",0,function({className:e,...n}){return(0,t.jsx)("textarea",{className:(0,r.cn)("min-h-24 w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50",e),...n})}])},515281,e=>{"use strict";let t=(0,e.i(456420).default)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);e.s(["Pencil",0,t],515281)},110204,e=>{"use strict";var t=e.i(843476),r=e.i(271645);function n(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}e.i(174080);var a=Symbol.for("radix.slottable"),i=Symbol.for("react.lazy");function o(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===i&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}var s=r[" use ".trim().toString()],l=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,i)=>{var l;let c,d=(l=`Primitive.${i}`,(c=r.forwardRef((e,t)=>{var i;let c,d,{children:u,...p}=e,f=null,m=!1,h=[];o(u)&&"function"==typeof s&&(u=s(u._payload)),r.Children.forEach(u,e=>{var t;if(t=e,r.isValidElement(t)&&"function"==typeof t.type&&"__radixId"in t.type&&t.type.__radixId===a){m=!0;let t="child"in e.props?e.props.child:e.props.children;o(t)&&"function"==typeof s&&(t=s(t._payload)),f=((e,t)=>{if("child"in e.props){let t=e.props.child;return r.isValidElement(t)?r.cloneElement(t,void 0,e.props.children(t.props.children)):null}return r.isValidElement(t)?t:null})(e,t),h.push(f?.props?.children)}else h.push(e)}),f?f=r.cloneElement(f,void 0,h):!m&&1===r.Children.count(u)&&r.isValidElement(u)&&(f=u);let g=f?(i=f,(d=(c=Object.getOwnPropertyDescriptor(i.props,"ref")?.get)&&"isReactWarning"in c&&c.isReactWarning)?i.ref:(d=(c=Object.getOwnPropertyDescriptor(i,"ref")?.get)&&"isReactWarning"in c&&c.isReactWarning)?i.props.ref:i.props.ref||i.ref):void 0,x=function(...e){return r.useCallback(function(...e){return t=>{let r=!1,a=e.map(e=>{let a=n(e,t);return r||"function"!=typeof a||(r=!0),a});if(r)return()=>{for(let t=0;t<a.length;t++){let r=a[t];"function"==typeof r?r():n(e[t],null)}}}}(...e),e)}(t,g);if(!f){if(u||0===u){let e,t;throw Error(m?(e=l,`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`):(t=l,`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`))}return u}let y=function(e,t){let r={...t};for(let n in t){let a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...e)=>{let t=i(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...i}:"className"===n&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}(p,f.props??{});return f.type!==r.Fragment&&(y.ref=t?x:g),r.cloneElement(f,y)})).displayName=`${l}.Slot`,c),u=r.forwardRef((e,r)=>{let{asChild:n,...a}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,t.jsx)(n?d:i,{...a,ref:r})});return u.displayName=`Primitive.${i}`,{...e,[i]:u}},{}),c=r.forwardRef((e,r)=>(0,t.jsx)(l.label,{...e,ref:r,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));c.displayName="Label",e.s(["Label",0,c,"Root",0,c],973741);var d=e.i(973741),d=d,u=e.i(975157);e.s(["Label",0,function({className:e,...r}){return(0,t.jsx)(d.Root,{"data-slot":"label",className:(0,u.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...r})}],110204)},643957,e=>{"use strict";let t=(0,e.i(456420).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",0,t])},999682,e=>{"use strict";var t=e.i(271645);e.s(["usePrevious",0,function(e){let r=t.useRef({value:e,previous:e});return t.useMemo(()=>(r.current.value!==e&&(r.current.previous=r.current.value,r.current.value=e),r.current.previous),[e])}])},593698,e=>{"use strict";var t=e.i(643957);e.s(["CheckIcon",()=>t.default])},75830,586318,e=>{"use strict";var t=e.i(271645),r=e.i(30030);function n(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function a(...e){return t.useCallback(function(...e){return t=>{let r=!1,a=e.map(e=>{let a=n(e,t);return r||"function"!=typeof a||(r=!0),a});if(r)return()=>{for(let t=0;t<a.length;t++){let r=a[t];"function"==typeof r?r():n(e[t],null)}}}}(...e),e)}function i(e){let r=t.forwardRef((r,n)=>{var i;let l,f,{children:m,...h}=r,g=null,x=!1,y=[];c(m)&&"function"==typeof p&&(m=p(m._payload)),t.Children.forEach(m,e=>{var r;if(r=e,t.isValidElement(r)&&"function"==typeof r.type&&"__radixId"in r.type&&r.type.__radixId===o){x=!0;let t="child"in e.props?e.props.child:e.props.children;c(t)&&"function"==typeof p&&(t=p(t._payload)),g=s(e,t),y.push(g?.props?.children)}else y.push(e)}),g?g=t.cloneElement(g,void 0,y):!x&&1===t.Children.count(m)&&t.isValidElement(m)&&(g=m);let v=g?(i=g,(f=(l=Object.getOwnPropertyDescriptor(i.props,"ref")?.get)&&"isReactWarning"in l&&l.isReactWarning)?i.ref:(f=(l=Object.getOwnPropertyDescriptor(i,"ref")?.get)&&"isReactWarning"in l&&l.isReactWarning)?i.props.ref:i.props.ref||i.ref):void 0,b=a(n,v);if(!g){if(m||0===m)throw Error(x?u(e):d(e));return m}let j=function(e,t){let r={...t};for(let n in t){let a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...e)=>{let t=i(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...i}:"className"===n&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}(h,g.props??{});return g.type!==t.Fragment&&(j.ref=n?b:v),t.cloneElement(g,j)});return r.displayName=`${e}.Slot`,r}var o=Symbol.for("radix.slottable"),s=(e,r)=>{if("child"in e.props){let r=e.props.child;return t.isValidElement(r)?t.cloneElement(r,void 0,e.props.children(r.props.children)):null}return t.isValidElement(r)?r:null},l=Symbol.for("react.lazy");function c(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===l&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}var d=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,u=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,p=t[" use ".trim().toString()],f=e.i(843476),m=new WeakMap;function h(e,t){var r,n;let a,i,o;if("at"in Array.prototype)return Array.prototype.at.call(e,t);let s=(r=e,n=t,a=r.length,(o=(i=g(n))>=0?i:a+i)<0||o>=a?-1:o);return -1===s?void 0:e[s]}function g(e){return e!=e||0===e?0:Math.trunc(e)}(class e extends Map{#e;constructor(e){super(e),this.#e=[...super.keys()],m.set(this,!0)}set(e,t){return m.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,r){let n,a=this.has(t),i=this.#e.length,o=g(e),s=o>=0?o:i+o,l=s<0||s>=i?-1:s;if(l===this.size||a&&l===this.size-1||-1===l)return this.set(t,r),this;let c=this.size+ +!a;o<0&&s++;let d=[...this.#e],u=!1;for(let e=s;e<c;e++)if(s===e){let i=d[e];d[e]===t&&(i=d[e+1]),a&&this.delete(t),n=this.get(i),this.set(t,r)}else{u||d[e-1]!==t||(u=!0);let r=d[u?e:e-1],a=n;n=this.get(r),this.delete(r),this.set(r,a)}return this}with(t,r,n){let a=new e(this);return a.insert(t,r,n),a}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,r){let n=this.#e.indexOf(e);return -1===n?this:this.insert(n,t,r)}after(e){let t=this.#e.indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,r){let n=this.#e.indexOf(e);return -1===n?this:this.insert(n+1,t,r)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=h(this.#e,e);if(void 0!==t)return this.get(t)}entryAt(e){let t=h(this.#e,e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return h(this.#e,e)}from(e,t){let r=this.indexOf(e);if(-1===r)return;let n=r+t;return n<0&&(n=0),n>=this.size&&(n=this.size-1),this.at(n)}keyFrom(e,t){let r=this.indexOf(e);if(-1===r)return;let n=r+t;return n<0&&(n=0),n>=this.size&&(n=this.size-1),this.keyAt(n)}find(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return n;r++}}findIndex(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return r;r++}return -1}filter(t,r){let n=[],a=0;for(let e of this)Reflect.apply(t,r,[e,a,this])&&n.push(e),a++;return new e(n)}map(t,r){let n=[],a=0;for(let e of this)n.push([e[0],Reflect.apply(t,r,[e,a,this])]),a++;return new e(n)}reduce(...e){let[t,r]=e,n=0,a=r??this.at(0);for(let r of this)a=0===n&&1===e.length?r:Reflect.apply(t,this,[a,r,n,this]),n++;return a}reduceRight(...e){let[t,r]=e,n=r??this.at(-1);for(let r=this.size-1;r>=0;r--){let a=this.at(r);n=r===this.size-1&&1===e.length?a:Reflect.apply(t,this,[n,a,r,this])}return n}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let r=this.keyAt(e),n=this.get(r);t.set(r,n)}return t}toSpliced(...t){let r=[...this.entries()];return r.splice(...t),new e(r)}slice(t,r){let n=new e,a=this.size-1;if(void 0===t)return n;t<0&&(t+=this.size),void 0!==r&&r>0&&(a=r-1);for(let e=t;e<=a;e++){let t=this.keyAt(e),r=this.get(t);n.set(t,r)}return n}every(e,t){let r=0;for(let n of this){if(!Reflect.apply(e,t,[n,r,this]))return!1;r++}return!0}some(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return!0;r++}return!1}}),e.s(["createCollection",0,function(e){let n=e+"CollectionProvider",[o,s]=(0,r.createContextScope)(n),[l,c]=o(n,{collectionRef:{current:null},itemMap:new Map}),d=e=>{let{scope:r,children:n}=e,a=t.useRef(null),i=t.useRef(new Map).current;return(0,f.jsx)(l,{scope:r,itemMap:i,collectionRef:a,children:n})};d.displayName=n;let u=e+"CollectionSlot",p=i(u),m=t.forwardRef((e,t)=>{let{scope:r,children:n}=e,i=a(t,c(u,r).collectionRef);return(0,f.jsx)(p,{ref:i,children:n})});m.displayName=u;let h=e+"CollectionItemSlot",g="data-radix-collection-item",x=i(h),y=t.forwardRef((e,r)=>{let{scope:n,children:i,...o}=e,s=t.useRef(null),l=a(r,s),d=c(h,n);return t.useEffect(()=>(d.itemMap.set(s,{ref:s,...o}),()=>void d.itemMap.delete(s))),(0,f.jsx)(x,{...{[g]:""},ref:l,children:i})});return y.displayName=h,[{Provider:d,Slot:m,ItemSlot:y},function(r){let n=c(e+"CollectionConsumer",r);return t.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${g}]`));return Array.from(n.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[n.collectionRef,n.itemMap])},s]}],75830);var x=t.createContext(void 0);e.s(["useDirection",0,function(e){let r=t.useContext(x);return e||r||"ltr"}],586318)},26495,e=>{"use strict";let t=(0,e.i(456420).default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["default",0,t])},144716,e=>{"use strict";let t=(0,e.i(456420).default)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);e.s(["default",0,t])},776639,e=>{"use strict";var t=e.i(843476),r=e.i(560964),n=e.i(964053),a=e.i(519455),i=e.i(975157);function o({...e}){return(0,t.jsx)(n.Dialog.Portal,{"data-slot":"dialog-portal",...e})}function s({className:e,...r}){return(0,t.jsx)(n.Dialog.Overlay,{className:(0,i.cn)("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),"data-slot":"dialog-overlay",...r})}e.s(["Dialog",0,function({...e}){return(0,t.jsx)(n.Dialog.Root,{"data-slot":"dialog",...e})},"DialogContent",0,function({className:e,children:l,showCloseButton:c=!0,...d}){return(0,t.jsxs)(o,{children:[(0,t.jsx)(s,{}),(0,t.jsxs)(n.Dialog.Content,{className:(0,i.cn)("fixed top-1/2 left-1/2 z-50 grid max-h-[85dvh] w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 overflow-y-auto rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),"data-slot":"dialog-content",...d,children:[l,c&&(0,t.jsx)(n.Dialog.Close,{asChild:!0,"data-slot":"dialog-close",children:(0,t.jsxs)(a.Button,{className:"absolute top-2 right-2",size:"icon-sm",variant:"ghost",children:[(0,t.jsx)(r.XIcon,{}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})})]})]})},"DialogDescription",0,function({className:e,...r}){return(0,t.jsx)(n.Dialog.Description,{className:(0,i.cn)("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),"data-slot":"dialog-description",...r})},"DialogFooter",0,function({className:e,showCloseButton:r=!1,children:o,...s}){return(0,t.jsxs)("div",{className:(0,i.cn)("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",e),"data-slot":"dialog-footer",...s,children:[o,r&&(0,t.jsx)(n.Dialog.Close,{asChild:!0,children:(0,t.jsx)(a.Button,{variant:"outline",children:"Close"})})]})},"DialogHeader",0,function({className:e,...r}){return(0,t.jsx)("div",{className:(0,i.cn)("flex flex-col gap-2",e),"data-slot":"dialog-header",...r})},"DialogTitle",0,function({className:e,...r}){return(0,t.jsx)(n.Dialog.Title,{className:(0,i.cn)("font-heading text-base leading-none font-medium",e),"data-slot":"dialog-title",...r})},"DialogTrigger",0,function({...e}){return(0,t.jsx)(n.Dialog.Trigger,{"data-slot":"dialog-trigger",...e})}])},986253,e=>{"use strict";let t=(0,e.i(456420).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["default",0,t])},462777,e=>{"use strict";async function t(e){if(navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(e);return}catch{}let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.append(t),t.select();let r=document.execCommand("copy");if(t.remove(),!r)throw Error("Copy is not supported by this browser")}e.s(["copyText",0,t,"createClientId",0,function(){try{if(globalThis.crypto?.randomUUID)return globalThis.crypto.randomUUID()}catch{}if(globalThis.crypto?.getRandomValues)try{let e=globalThis.crypto.getRandomValues(new Uint8Array(16));return Array.from(e,e=>e.toString(16).padStart(2,"0")).join("")}catch{}return`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}])},716327,e=>{"use strict";var t=e.i(26495);e.s(["ChevronDown",()=>t.default])},630299,e=>{"use strict";let t=(0,e.i(456420).default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["default",0,t])},867927,e=>{"use strict";var t=e.i(986253);e.s(["ChevronRight",()=>t.default])},77071,e=>{"use strict";let t=(0,e.i(456420).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",0,t],77071)},566595,e=>{"use strict";var t=e.i(630299);e.s(["Search",()=>t.default])},825398,e=>{"use strict";let t=(0,e.i(456420).default)("rotate-cw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);e.s(["RotateCw",0,t],825398)},523950,e=>{"use strict";var t=e.i(843476),r=e.i(689664),n=e.i(716327),a=e.i(867927),i=e.i(508734),o=e.i(515281),s=e.i(77071),l=e.i(825398),c=e.i(566595);let d=(0,e.i(456420).default)("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);var u=e.i(573474),p=e.i(747925),f=e.i(263676),m=e.i(948148),h=e.i(271645),g=e.i(340953),x=e.i(929592),y=e.i(487486),v=e.i(519455),b=e.i(515288),j=e.i(59497),w=e.i(776639),C=e.i(793479),S=e.i(110204),N=e.i(967489),k=e.i(987968),E=e.i(784774),T=e.i(624687),R=e.i(637611),D=e.i(462777);let A=()=>({name:"",url:"",transport:"STREAMABLE_HTTP",toolNamePrefix:"",headers:[]});async function P(e){let t=await e.json();if(!e.ok){let r=t&&"object"==typeof t&&"error"in t?t.error:null;throw Error("string"==typeof r?.message?r.message:`HTTP ${e.status}`)}return t}function O({draft:e,editing:r,error:n,onDraftChange:a,onOpenChange:i,onSubmit:o,open:l,saving:c}){let d=(0,m.useTranslations)("tools"),u=(0,m.useTranslations)("common"),p=(t,r)=>{a({...e,headers:e.headers.map((e,n)=>n===t?{...e,...r}:e)})};return(0,t.jsx)(w.Dialog,{onOpenChange:i,open:l,children:(0,t.jsx)(w.DialogContent,{className:"sm:max-w-2xl",children:(0,t.jsxs)("form",{className:"space-y-4",onSubmit:o,children:[(0,t.jsxs)(w.DialogHeader,{children:[(0,t.jsx)(w.DialogTitle,{children:r?d("editServerTitle"):d("addServerTitle")}),(0,t.jsx)(w.DialogDescription,{children:d("serverDialogDescription")})]}),n&&(0,t.jsx)(x.Alert,{variant:"destructive",children:(0,t.jsx)(x.AlertDescription,{children:n})}),(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,t.jsx)(I,{label:d("name"),children:(0,t.jsx)(C.Input,{"aria-label":d("name"),onChange:t=>a({...e,name:t.target.value}),required:!0,value:e.name})}),(0,t.jsx)(I,{label:d("transport"),children:(0,t.jsxs)(N.Select,{onValueChange:t=>a({...e,transport:t}),value:e.transport,children:[(0,t.jsx)(N.SelectTrigger,{"aria-label":d("transport"),className:"w-full",children:(0,t.jsx)(N.SelectValue,{})}),(0,t.jsxs)(N.SelectContent,{children:[(0,t.jsx)(N.SelectItem,{value:"STREAMABLE_HTTP",children:d("http")}),(0,t.jsx)(N.SelectItem,{value:"SSE",children:d("sse")})]})]})})]}),(0,t.jsx)(I,{label:d("url"),children:(0,t.jsx)(C.Input,{"aria-label":d("url"),onChange:t=>a({...e,url:t.target.value}),placeholder:"https://example.com/mcp",required:!0,type:"url",value:e.url})}),(0,t.jsxs)(I,{label:d("prefix"),children:[(0,t.jsx)(C.Input,{"aria-label":d("prefix"),className:"font-mono",onChange:t=>a({...e,toolNamePrefix:t.target.value}),placeholder:"example_",value:e.toolNamePrefix}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:d("prefixHelp")})]}),(0,t.jsxs)("div",{className:"space-y-3 rounded-lg border p-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(S.Label,{children:d("headers")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:d("headersHelp")})]}),(0,t.jsxs)(v.Button,{onClick:()=>a({...e,headers:[...e.headers,{name:"",value:"",valueConfigured:!1}]}),size:"sm",type:"button",variant:"outline",children:[(0,t.jsx)(s.Plus,{})," ",d("addHeader")]})]}),0===e.headers.length?(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:d("noHeaders")}):e.headers.map((r,n)=>(0,t.jsxs)("div",{className:"grid items-start gap-2 sm:grid-cols-[1fr_1fr_auto]",children:[(0,t.jsx)(C.Input,{"aria-label":d("headerName"),onChange:e=>p(n,{name:e.target.value}),placeholder:"Authorization",required:!0,value:r.name}),(0,t.jsx)("div",{children:(0,t.jsx)(C.Input,{"aria-label":d("headerValue"),autoComplete:"new-password",onChange:e=>p(n,{value:e.target.value}),placeholder:r.valueConfigured?d("keepHeaderValue"):d("headerValue"),required:!r.valueConfigured,type:"password",value:r.value})}),(0,t.jsx)(v.Button,{"aria-label":d("removeHeader"),onClick:()=>a({...e,headers:e.headers.filter((e,t)=>t!==n)}),size:"icon",type:"button",variant:"ghost",children:(0,t.jsx)(f.X,{})})]},r.id??n))]}),(0,t.jsxs)(w.DialogFooter,{children:[(0,t.jsx)(v.Button,{disabled:c,onClick:()=>i(!1),type:"button",variant:"outline",children:u("cancel")}),(0,t.jsxs)(v.Button,{disabled:c,type:"submit",children:[c&&(0,t.jsx)(k.Spinner,{}),d("saveServer")]})]})]})})})}function I({children:e,label:r}){return(0,t.jsxs)("div",{children:[(0,t.jsx)(S.Label,{className:"mb-1.5 block",children:r}),e]})}function $({group:e}){let r=(0,m.useTranslations)("tools");return(0,t.jsxs)(b.Card,{className:"gap-0 py-0",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3 border-b p-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:["BUILTIN"===e.source?(0,t.jsx)(p.Wrench,{className:"size-5"}):(0,t.jsx)(d,{className:"size-5"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"font-semibold",children:e.name}),e.url&&(0,t.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:e.url})]})]}),(0,t.jsx)(y.Badge,{variant:"outline",children:r("toolCount",{count:e.tools.length})})]}),e.error&&(0,t.jsx)("div",{className:"border-b p-4",children:(0,t.jsx)(x.Alert,{variant:"destructive",children:(0,t.jsx)(x.AlertDescription,{children:e.error})})}),e.tools.length>0&&(0,t.jsxs)(E.Table,{children:[(0,t.jsx)(E.TableHeader,{children:(0,t.jsxs)(E.TableRow,{children:[(0,t.jsx)(E.TableHead,{className:"w-10"}),(0,t.jsx)(E.TableHead,{children:r("tool")}),(0,t.jsx)(E.TableHead,{children:r("toolDescription")})]})}),(0,t.jsx)(E.TableBody,{children:e.tools.map(r=>(0,t.jsx)(z,{groupId:e.id,tool:r},r.name))})]})]})}function z({groupId:e,tool:r}){let i=(0,m.useTranslations)("tools"),[o,s]=(0,h.useState)(!1),l=()=>s(e=>!e);return(0,t.jsxs)(h.Fragment,{children:[(0,t.jsxs)(E.TableRow,{"aria-expanded":o,"aria-label":i(o?"collapseTool":"expandTool",{name:r.name}),className:"cursor-pointer focus-visible:bg-muted/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",onClick:l,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),l())},role:"button",tabIndex:0,children:[(0,t.jsx)(E.TableCell,{children:o?(0,t.jsx)(n.ChevronDown,{className:"size-4"}):(0,t.jsx)(a.ChevronRight,{className:"size-4"})}),(0,t.jsxs)(E.TableCell,{children:[(0,t.jsx)("p",{className:"font-mono text-xs font-medium",children:r.name}),r.title&&r.title!==r.name&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:r.title})]}),(0,t.jsx)(E.TableCell,{className:"max-w-2xl whitespace-normal text-muted-foreground",children:r.description||i("noDescription")})]}),(0,t.jsx)(E.TableRow,{className:o?"bg-muted/20 hover:bg-muted/20":"hidden",children:(0,t.jsx)(E.TableCell,{colSpan:3,className:"whitespace-normal p-4",children:(0,t.jsx)(q,{groupId:e,schema:r.inputSchema,toolName:r.name})})})]})}function _(e){return!e||"object"!=typeof e||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(e=>!!e[1]&&"object"==typeof e[1]&&!Array.isArray(e[1])))}function M(e){return Array.isArray(e)?e.filter(e=>"string"==typeof e):[]}function q({groupId:e,schema:n,toolName:a}){let o=(0,m.useTranslations)("tools"),[s,l]=(0,h.useState)(()=>(function e(t){if("default"in t)return t.default;if("object"===t.type){let r=_(t.properties),n=new Set(M(t.required));return Object.fromEntries(Object.entries(r).flatMap(([t,r])=>{if("default"in r||n.has(t)){let n=e(r);if(void 0!==n)return[[t,n]]}return[]}))}return"boolean"!==t.type&&("string"===t.type?"":void 0)})(n)??{}),[c,d]=(0,h.useState)(!1),[u,f]=(0,h.useState)(void 0),[g,y]=(0,h.useState)(null),[b,j]=(0,h.useState)("IDLE"),w=_(n.properties),C=0===Object.keys(_(n.properties)).length&&!1!==n.additionalProperties,N=new Set(M(n.required)),E=`${e}-${a}-arguments`,T=async t=>{t.preventDefault(),d(!0),y(null),j("IDLE");try{let t=await P(await fetch("/api/tools/call",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({groupId:e,name:a,arguments:s})}));f(t.result)}catch(e){y(e instanceof Error?e.message:String(e)),f(void 0)}finally{d(!1)}},R=void 0===u?"":JSON.stringify(u,null,2),A=async()=>{try{await (0,D.copyText)(R),j("COPIED")}catch{j("FAILED")}};return(0,t.jsxs)("form",{className:"grid gap-4 lg:grid-cols-2",onSubmit:T,children:[(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("h4",{className:"text-sm font-medium",children:o("parameters")}),C?(0,t.jsxs)("div",{children:[(0,t.jsx)(S.Label,{className:"mb-1.5 block",htmlFor:E,children:o("jsonArguments")}),(0,t.jsx)(B,{id:E,objectOnly:!0,onChange:e=>l(e),required:!0,value:s})]}):0===Object.keys(w).length?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:o("noParameters")}):Object.entries(w).map(([e,r])=>(0,t.jsx)(L,{name:e,onChange:(e,t)=>l(r=>{let n,a,i;return a=n=structuredClone(r),e.slice(0,-1).forEach(e=>{let t=a[e];(!t||"object"!=typeof t||Array.isArray(t))&&(a[e]={}),a=a[e]}),(i=e.at(-1))&&(void 0===t?delete a[i]:a[i]=t),n}),path:[e],required:N.has(e),schema:r,value:function(e,t){let r=e;for(let e of t){if(!r||"object"!=typeof r||Array.isArray(r))return;r=r[e]}return r}(s,[e])},e)),(0,t.jsxs)(v.Button,{disabled:c,type:"submit",children:[c?(0,t.jsx)(k.Spinner,{}):(0,t.jsx)(p.Wrench,{}),o(c?"running":"run")]})]}),(0,t.jsxs)("div",{className:"min-w-0 space-y-2",children:[(0,t.jsxs)("div",{className:"flex min-h-7 items-center justify-between gap-2",children:[(0,t.jsx)("h4",{className:"text-sm font-medium",children:o("response")}),void 0!==u&&(0,t.jsx)(v.Button,{"aria-label":o("COPIED"===b?"copied":"copyResponse"),onClick:()=>void A(),size:"icon-sm",title:o("COPIED"===b?"copied":"copyResponse"),type:"button",variant:"ghost",children:"COPIED"===b?(0,t.jsx)(r.Check,{}):(0,t.jsx)(i.Copy,{})})]}),"FAILED"===b&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:o("copyFailed")}),g?(0,t.jsx)(x.Alert,{variant:"destructive",children:(0,t.jsx)(x.AlertDescription,{children:g})}):void 0===u?(0,t.jsx)("div",{className:"rounded-lg border border-dashed p-4 text-sm text-muted-foreground",children:o("noResponse")}):(0,t.jsx)("pre",{className:"max-h-96 overflow-auto rounded-lg bg-muted p-3 font-mono text-xs whitespace-pre-wrap",children:R})]})]})}function L({name:e,onChange:r,path:n,required:a,schema:i,value:o}){let s,l=(0,m.useTranslations)("tools"),c="string"==typeof i.description?i.description:null,d="string"==typeof i.title&&i.title?i.title:e,u=Array.isArray(i.enum)?i.enum:null;if(u){let e=void 0===o?"__unset":JSON.stringify(o);s=(0,t.jsxs)(N.Select,{onValueChange:e=>r(n,"__unset"===e?void 0:JSON.parse(e)),value:e,children:[(0,t.jsx)(N.SelectTrigger,{className:"w-full",id:n.join("-"),children:(0,t.jsx)(N.SelectValue,{placeholder:l("selectValue")})}),(0,t.jsxs)(N.SelectContent,{children:[!a&&(0,t.jsx)(N.SelectItem,{value:"__unset",children:l("unset")}),u.map(e=>(0,t.jsx)(N.SelectItem,{value:JSON.stringify(e),children:String(e)},JSON.stringify(e)))]})]})}else if("boolean"===i.type)s=a?(0,t.jsxs)("div",{className:"flex items-center gap-2 py-1",children:[(0,t.jsx)(j.Checkbox,{checked:!!o,id:n.join("-"),onCheckedChange:e=>r(n,!0===e)}),(0,t.jsx)("span",{className:"text-sm",children:l(o?"true":"false")})]}):(0,t.jsxs)(N.Select,{onValueChange:e=>r(n,"unset"===e?void 0:"true"===e),value:void 0===o?"unset":String(!!o),children:[(0,t.jsx)(N.SelectTrigger,{className:"w-full",id:n.join("-"),children:(0,t.jsx)(N.SelectValue,{})}),(0,t.jsxs)(N.SelectContent,{children:[(0,t.jsx)(N.SelectItem,{value:"unset",children:l("unset")}),(0,t.jsx)(N.SelectItem,{value:"true",children:l("true")}),(0,t.jsx)(N.SelectItem,{value:"false",children:l("false")})]})]});else if("number"===i.type||"integer"===i.type)s=(0,t.jsx)(C.Input,{id:n.join("-"),max:"number"==typeof i.maximum?i.maximum:void 0,min:"number"==typeof i.minimum?i.minimum:void 0,onChange:e=>r(n,""===e.target.value?void 0:Number(e.target.value)),required:a,step:"integer"===i.type?1:"any",type:"number",value:"number"==typeof o?o:""});else if("string"===i.type)s=(0,t.jsx)(C.Input,{id:n.join("-"),maxLength:"number"==typeof i.maxLength?i.maxLength:void 0,minLength:"number"==typeof i.minLength?i.minLength:void 0,onChange:e=>r(n,a||""!==e.target.value?e.target.value:void 0),required:a,value:"string"==typeof o?o:""});else if("object"===i.type&&Object.keys(_(i.properties)).length){let e=_(i.properties),l=new Set(M(i.required));s=(0,t.jsx)("div",{className:"space-y-3 rounded-lg border p-3",children:Object.entries(e).map(([e,i])=>(0,t.jsx)(L,{name:e,onChange:r,path:[...n,e],required:a&&l.has(e),schema:i,value:o&&"object"==typeof o&&!Array.isArray(o)?o[e]:void 0},e))})}else s=(0,t.jsx)(B,{id:n.join("-"),onChange:e=>r(n,e),required:a,value:o});return(0,t.jsxs)("div",{children:[(0,t.jsxs)(S.Label,{className:"mb-1.5 block",htmlFor:n.join("-"),children:[d," ",a&&(0,t.jsx)("span",{className:"text-destructive",children:"*"})]}),s,c&&(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:c})]})}function B({id:e,objectOnly:r=!1,onChange:n,required:a,value:i}){let o=(0,m.useTranslations)("tools"),[s,l]=(0,h.useState)(()=>void 0===i?"":JSON.stringify(i,null,2));return(0,t.jsx)(T.Textarea,{id:e,className:"min-h-24 font-mono text-xs",onChange:e=>{let t=e.target.value;if(l(t),!t&&!a){e.target.setCustomValidity(""),n(void 0);return}try{let a=JSON.parse(t);if(r&&(!a||"object"!=typeof a||Array.isArray(a)))return void e.target.setCustomValidity(o("invalidJsonObject"));n(a),e.target.setCustomValidity("")}catch{e.target.setCustomValidity(o("invalidJson"))}},placeholder:r?o("jsonObjectPlaceholder"):o("jsonPlaceholder"),required:a,value:s})}e.s(["ToolsPage",0,function(){let e=(0,m.useTranslations)("tools"),r=(0,m.useTranslations)("common"),[n,a]=(0,h.useState)(""),[i,d]=(0,h.useState)([]),[p,f]=(0,h.useState)([]),[j,w]=(0,h.useState)(!0),[S,N]=(0,h.useState)(!0),[T,D]=(0,h.useState)(null),[I,z]=(0,h.useState)(!1),[_,M]=(0,h.useState)(null),[q,L]=(0,h.useState)(A),[B,V]=(0,h.useState)(!1),[H,W]=(0,h.useState)(null),F=(0,h.useCallback)(async()=>{d((await (0,R.controlPlaneRequest)("query ExternalMcpServers { externalMcpServers { id name url transport toolNamePrefix createdAt updatedAt headers { id name valueConfigured } } }")).externalMcpServers)},[]),U=(0,h.useCallback)(async()=>{N(!0);try{let e=await P(await fetch("/api/tools/catalog",{cache:"no-store"}));f(e.groups),D(null)}catch(e){D(e instanceof Error?e.message:String(e))}finally{N(!1)}},[]);(0,h.useEffect)(()=>{let e=window.setTimeout(()=>{Promise.all([F(),U()]).catch(e=>D(e instanceof Error?e.message:String(e))).finally(()=>w(!1))},0);return()=>window.clearTimeout(e)},[U,F]);let J=(0,h.useMemo)(()=>{let e=n.trim().toLocaleLowerCase();return e?p.flatMap(t=>{let r=[t.name,t.url??""].some(t=>t.toLocaleLowerCase().includes(e)),n=r?t.tools:t.tools.filter(t=>[t.name,t.title??"",t.description??""].some(t=>t.toLocaleLowerCase().includes(e)));return n.length||t.error&&r?[{...t,tools:n}]:[]}):p},[p,n]),G=async e=>{e.preventDefault(),V(!0),W(null);let t={...q,headers:q.headers.map(e=>({id:e.id??null,name:e.name,value:e.value||null}))};try{_?await (0,R.controlPlaneRequest)(`mutation UpdateExternalMcpServer($id: ID!, $input: ExternalMcpServerInput!) {
2
+ updateExternalMcpServer(id: $id, input: $input) { id }
3
+ }`,{id:_.id,input:t}):await (0,R.controlPlaneRequest)(`mutation CreateExternalMcpServer($input: ExternalMcpServerInput!) {
4
+ createExternalMcpServer(input: $input) { id }
5
+ }`,{input:t}),z(!1),await Promise.all([F(),U()])}catch(e){W(e instanceof Error?e.message:String(e))}finally{V(!1)}},X=async e=>{try{await (0,R.controlPlaneRequest)(`mutation DeleteExternalMcpServer($id: ID!) {
6
+ deleteExternalMcpServer(id: $id) { id }
7
+ }`,{id:e}),await Promise.all([F(),U()])}catch(e){D(e instanceof Error?e.message:String(e))}};return(0,t.jsxs)("section",{className:"mx-auto flex w-full max-w-[1500px] flex-col gap-6",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:e("title")}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:e("description")})]}),(0,t.jsxs)(v.Button,{onClick:()=>{M(null),L(A()),W(null),z(!0)},type:"button",children:[(0,t.jsx)(s.Plus,{}),e("addServer")]})]}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(c.Search,{className:"pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground"}),(0,t.jsx)(C.Input,{"aria-label":e("search"),className:"pl-9",onChange:e=>a(e.target.value),placeholder:e("searchPlaceholder"),type:"search",value:n})]}),T&&(0,t.jsx)(x.Alert,{variant:"destructive",children:(0,t.jsx)(x.AlertDescription,{children:T})}),(0,t.jsxs)(b.Card,{className:"gap-0 py-0",children:[(0,t.jsx)("div",{className:"border-b p-4",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"font-semibold",children:e("serversTitle")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("serversDescription")})]})}),j?(0,t.jsxs)("div",{className:"flex items-center gap-2 p-4 text-sm text-muted-foreground",children:[(0,t.jsx)(k.Spinner,{})," ",e("loadingServers")]}):0===i.length?(0,t.jsx)("p",{className:"p-4 text-sm text-muted-foreground",children:e("noServers")}):(0,t.jsxs)(E.Table,{children:[(0,t.jsx)(E.TableHeader,{children:(0,t.jsxs)(E.TableRow,{children:[(0,t.jsx)(E.TableHead,{children:e("name")}),(0,t.jsx)(E.TableHead,{children:e("url")}),(0,t.jsx)(E.TableHead,{children:e("transport")}),(0,t.jsx)(E.TableHead,{children:e("prefix")}),(0,t.jsx)(E.TableHead,{className:"text-right",children:e("actions")})]})}),(0,t.jsx)(E.TableBody,{children:i.map(n=>(0,t.jsxs)(E.TableRow,{children:[(0,t.jsx)(E.TableCell,{className:"font-medium",children:n.name}),(0,t.jsx)(E.TableCell,{className:"max-w-md truncate font-mono text-xs",children:n.url}),(0,t.jsx)(E.TableCell,{children:(0,t.jsx)(y.Badge,{variant:"outline",children:"STREAMABLE_HTTP"===n.transport?e("http"):e("sse")})}),(0,t.jsx)(E.TableCell,{className:"font-mono text-xs",children:n.toolNamePrefix||"—"}),(0,t.jsx)(E.TableCell,{children:(0,t.jsxs)("div",{className:"flex justify-end gap-1",children:[(0,t.jsx)(v.Button,{"aria-label":e("editServer",{name:n.name}),onClick:()=>{M(n),L({name:n.name,url:n.url,transport:n.transport,toolNamePrefix:n.toolNamePrefix,headers:n.headers.map(e=>({id:e.id,name:e.name,value:"",valueConfigured:e.valueConfigured}))}),W(null),z(!0)},size:"icon-sm",type:"button",variant:"ghost",children:(0,t.jsx)(o.Pencil,{})}),(0,t.jsx)(g.ConfirmationDialog,{actionLabel:e("delete"),cancelLabel:r("cancel"),description:e("confirmDeleteDescription",{name:n.name}),onConfirm:()=>X(n.id),title:e("confirmDelete"),trigger:(0,t.jsx)(v.Button,{"aria-label":e("deleteServer",{name:n.name}),size:"icon-sm",type:"button",variant:"ghost",children:(0,t.jsx)(u.Trash2,{})})})]})})]},n.id))})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"font-semibold",children:e("catalogTitle")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("catalogDescription")})]}),(0,t.jsxs)(v.Button,{disabled:S,onClick:()=>void U(),type:"button",variant:"outline",children:[S?(0,t.jsx)(k.Spinner,{}):(0,t.jsx)(l.RotateCw,{}),e("refresh")]})]}),S&&0===p.length?(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(k.Spinner,{})," ",e("loadingTools")]}):0===J.length?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("noMatchingTools")}):J.map(e=>(0,t.jsx)($,{group:e},e.id)),(0,t.jsx)(O,{draft:q,editing:_,error:H,onDraftChange:L,onOpenChange:z,onSubmit:G,open:I,saving:B})]})}],523950)}]);