@shepai/cli 1.148.0 → 1.149.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. package/dist/src/presentation/web/app/api/agent-events/route.js +1 -1
  2. package/dist/src/presentation/web/app/api/sessions/route.d.ts.map +1 -1
  3. package/dist/src/presentation/web/app/api/sessions/route.js +2 -268
  4. package/dist/src/presentation/web/app/api/sessions-batch/route.d.ts +17 -0
  5. package/dist/src/presentation/web/app/api/sessions-batch/route.d.ts.map +1 -0
  6. package/dist/src/presentation/web/app/api/sessions-batch/route.js +61 -0
  7. package/dist/src/presentation/web/components/common/feature-node/feature-sessions-dropdown.d.ts +1 -1
  8. package/dist/src/presentation/web/components/common/feature-node/feature-sessions-dropdown.d.ts.map +1 -1
  9. package/dist/src/presentation/web/components/common/feature-node/feature-sessions-dropdown.js +15 -73
  10. package/dist/src/presentation/web/components/common/feature-node/feature-sessions-dropdown.stories.d.ts.map +1 -1
  11. package/dist/src/presentation/web/components/common/feature-node/feature-sessions-dropdown.stories.js +18 -17
  12. package/dist/src/presentation/web/components/features/control-center/control-center.d.ts.map +1 -1
  13. package/dist/src/presentation/web/components/features/control-center/control-center.js +2 -1
  14. package/dist/src/presentation/web/components/features/control-center/use-control-center-state.d.ts.map +1 -1
  15. package/dist/src/presentation/web/components/features/control-center/use-control-center-state.js +4 -1
  16. package/dist/src/presentation/web/components/layouts/app-sidebar/app-sidebar.d.ts.map +1 -1
  17. package/dist/src/presentation/web/components/layouts/app-sidebar/app-sidebar.js +32 -33
  18. package/dist/src/presentation/web/hooks/sessions-provider.d.ts +12 -0
  19. package/dist/src/presentation/web/hooks/sessions-provider.d.ts.map +1 -0
  20. package/dist/src/presentation/web/hooks/sessions-provider.js +57 -0
  21. package/dist/src/presentation/web/hooks/use-deploy-action.d.ts.map +1 -1
  22. package/dist/src/presentation/web/hooks/use-deploy-action.js +8 -54
  23. package/dist/src/presentation/web/lib/session-scanner.d.ts +27 -0
  24. package/dist/src/presentation/web/lib/session-scanner.d.ts.map +1 -0
  25. package/dist/src/presentation/web/lib/session-scanner.js +255 -0
  26. package/dist/tsconfig.build.tsbuildinfo +1 -1
  27. package/package.json +1 -1
  28. package/web/.next/BUILD_ID +1 -1
  29. package/web/.next/app-path-routes-manifest.json +1 -0
  30. package/web/.next/build-manifest.json +2 -2
  31. package/web/.next/fallback-build-manifest.json +2 -2
  32. package/web/.next/prerender-manifest.json +3 -3
  33. package/web/.next/required-server-files.js +2 -2
  34. package/web/.next/required-server-files.json +2 -2
  35. package/web/.next/routes-manifest.json +6 -0
  36. package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +28 -28
  37. package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
  38. package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
  39. package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +28 -28
  40. package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  41. package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  42. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +36 -36
  43. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  44. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  45. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +36 -36
  46. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  47. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  48. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +26 -26
  49. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  50. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  51. package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +28 -28
  52. package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  53. package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  54. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +36 -36
  55. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  56. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  57. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +36 -36
  58. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  59. package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  60. package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +26 -26
  61. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  62. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  63. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +26 -26
  64. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  65. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  66. package/web/.next/server/app/_global-error.html +2 -2
  67. package/web/.next/server/app/_global-error.rsc +1 -1
  68. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  69. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  70. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  71. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  72. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  73. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +3 -3
  74. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  75. package/web/.next/server/app/api/attachments/preview/route.js.nft.json +1 -1
  76. package/web/.next/server/app/api/evidence/route.js.nft.json +1 -1
  77. package/web/.next/server/app/api/graph-data/route.js.nft.json +1 -1
  78. package/web/.next/server/app/api/sessions/route.js +2 -3
  79. package/web/.next/server/app/api/sessions/route.js.nft.json +1 -1
  80. package/web/.next/server/app/api/sessions-batch/route/app-paths-manifest.json +3 -0
  81. package/web/.next/server/app/api/sessions-batch/route/build-manifest.json +11 -0
  82. package/web/.next/server/app/api/sessions-batch/route/server-reference-manifest.json +4 -0
  83. package/web/.next/server/app/api/sessions-batch/route.js +7 -0
  84. package/web/.next/server/app/api/sessions-batch/route.js.map +5 -0
  85. package/web/.next/server/app/api/sessions-batch/route.js.nft.json +1 -0
  86. package/web/.next/server/app/api/sessions-batch/route_client-reference-manifest.js +2 -0
  87. package/web/.next/server/app/settings/page/server-reference-manifest.json +8 -8
  88. package/web/.next/server/app/settings/page.js.nft.json +1 -1
  89. package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  90. package/web/.next/server/app/skills/page/server-reference-manifest.json +8 -8
  91. package/web/.next/server/app/skills/page.js.nft.json +1 -1
  92. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  93. package/web/.next/server/app/tools/page/server-reference-manifest.json +8 -8
  94. package/web/.next/server/app/tools/page.js.nft.json +1 -1
  95. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  96. package/web/.next/server/app/version/page/server-reference-manifest.json +3 -3
  97. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  98. package/web/.next/server/app-paths-manifest.json +1 -0
  99. package/web/.next/server/chunks/403f9_next_dist_esm_build_templates_app-route_4d623b8e.js +1 -1
  100. package/web/.next/server/chunks/403f9_next_dist_esm_build_templates_app-route_4d623b8e.js.map +1 -1
  101. package/web/.next/server/chunks/744ca_web__next-internal_server_app_api_sessions-batch_route_actions_4859f283.js +3 -0
  102. package/web/.next/server/chunks/[root-of-the-server]__0d33c29e._.js +3 -0
  103. package/web/.next/server/chunks/[root-of-the-server]__0d33c29e._.js.map +1 -0
  104. package/web/.next/server/chunks/[root-of-the-server]__2f61738a._.js +3 -0
  105. package/web/.next/server/chunks/[root-of-the-server]__2f61738a._.js.map +1 -0
  106. package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
  107. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
  108. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
  109. package/web/.next/server/chunks/ssr/[root-of-the-server]__2138fa7e._.js +2 -2
  110. package/web/.next/server/chunks/ssr/[root-of-the-server]__29580090._.js +1 -1
  111. package/web/.next/server/chunks/ssr/[root-of-the-server]__29580090._.js.map +1 -1
  112. package/web/.next/server/chunks/ssr/[root-of-the-server]__357d99f9._.js +1 -1
  113. package/web/.next/server/chunks/ssr/[root-of-the-server]__3ef34e4c._.js +1 -1
  114. package/web/.next/server/chunks/ssr/[root-of-the-server]__43f51aa6._.js +1 -1
  115. package/web/.next/server/chunks/ssr/[root-of-the-server]__43f51aa6._.js.map +1 -1
  116. package/web/.next/server/chunks/ssr/[root-of-the-server]__815546bd._.js +1 -1
  117. package/web/.next/server/chunks/ssr/[root-of-the-server]__815546bd._.js.map +1 -1
  118. package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js +2 -2
  119. package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js.map +1 -1
  120. package/web/.next/server/chunks/ssr/[root-of-the-server]__c094882b._.js +1 -1
  121. package/web/.next/server/chunks/ssr/[root-of-the-server]__c094882b._.js.map +1 -1
  122. package/web/.next/server/chunks/ssr/[root-of-the-server]__d48c5b11._.js +1 -1
  123. package/web/.next/server/chunks/ssr/[root-of-the-server]__d48c5b11._.js.map +1 -1
  124. package/web/.next/server/chunks/ssr/[root-of-the-server]__dac5dbf1._.js +1 -1
  125. package/web/.next/server/chunks/ssr/[root-of-the-server]__dac5dbf1._.js.map +1 -1
  126. package/web/.next/server/chunks/ssr/[root-of-the-server]__fae8b355._.js +1 -1
  127. package/web/.next/server/chunks/ssr/[root-of-the-server]__fae8b355._.js.map +1 -1
  128. package/web/.next/server/chunks/ssr/_05c23ad9._.js +1 -1
  129. package/web/.next/server/chunks/ssr/_05c23ad9._.js.map +1 -1
  130. package/web/.next/server/chunks/ssr/_0c5f56e3._.js +2 -2
  131. package/web/.next/server/chunks/ssr/_0c5f56e3._.js.map +1 -1
  132. package/web/.next/server/chunks/ssr/_16eb4fec._.js +1 -1
  133. package/web/.next/server/chunks/ssr/_16eb4fec._.js.map +1 -1
  134. package/web/.next/server/chunks/ssr/_1b719e7f._.js +1 -1
  135. package/web/.next/server/chunks/ssr/_1b719e7f._.js.map +1 -1
  136. package/web/.next/server/chunks/ssr/_37e8548b._.js +1 -1
  137. package/web/.next/server/chunks/ssr/_37e8548b._.js.map +1 -1
  138. package/web/.next/server/chunks/ssr/{_fe63a7f9._.js → _458e9a64._.js} +2 -2
  139. package/web/.next/server/chunks/ssr/{_fe63a7f9._.js.map → _458e9a64._.js.map} +1 -1
  140. package/web/.next/server/chunks/ssr/_5022e2b1._.js +4 -0
  141. package/web/.next/server/chunks/ssr/_5022e2b1._.js.map +1 -0
  142. package/web/.next/server/chunks/ssr/_55d763e2._.js +1 -1
  143. package/web/.next/server/chunks/ssr/_55d763e2._.js.map +1 -1
  144. package/web/.next/server/chunks/ssr/_6256a985._.js +1 -1
  145. package/web/.next/server/chunks/ssr/_6256a985._.js.map +1 -1
  146. package/web/.next/server/chunks/ssr/_64bdfc6f._.js +2 -2
  147. package/web/.next/server/chunks/ssr/_64bdfc6f._.js.map +1 -1
  148. package/web/.next/server/chunks/ssr/_8fcc39d4._.js +1 -1
  149. package/web/.next/server/chunks/ssr/_b71645b4._.js +1 -1
  150. package/web/.next/server/chunks/ssr/_b71645b4._.js.map +1 -1
  151. package/web/.next/server/chunks/ssr/_d8575088._.js +1 -1
  152. package/web/.next/server/chunks/ssr/_d8575088._.js.map +1 -1
  153. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
  154. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
  155. package/web/.next/server/chunks/ssr/{src_presentation_web_7b2fda40._.js → src_presentation_web_35159458._.js} +2 -2
  156. package/web/.next/server/chunks/ssr/{src_presentation_web_7b2fda40._.js.map → src_presentation_web_35159458._.js.map} +1 -1
  157. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1b176e3c.js +1 -1
  158. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1b176e3c.js.map +1 -1
  159. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_bd9f0dda.js +1 -1
  160. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_bd9f0dda.js.map +1 -1
  161. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_baaca5d5._.js +1 -1
  162. package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js +1 -1
  163. package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js.map +1 -1
  164. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
  165. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
  166. package/web/.next/server/pages/500.html +2 -2
  167. package/web/.next/server/server-reference-manifest.js +1 -1
  168. package/web/.next/server/server-reference-manifest.json +44 -44
  169. package/web/.next/static/chunks/{0137d4850cab3c45.js → 24b1c1e60fd3b7b5.js} +2 -2
  170. package/web/.next/static/chunks/{c731682077fbac4f.js → 3e7a130816229439.js} +1 -1
  171. package/web/.next/static/chunks/{7c5131e33516a325.js → 3f1b33498b472b00.js} +1 -1
  172. package/web/.next/static/chunks/{04869f1d3f5d9071.js → 4ef564fb1174e497.js} +1 -1
  173. package/web/.next/static/chunks/75834e430247b325.js +1 -0
  174. package/web/.next/static/chunks/79dc2e2f1c2ff519.js +1 -0
  175. package/web/.next/static/chunks/{063a24b49d9818a0.js → a086f8dfef2c3325.js} +1 -1
  176. package/web/.next/static/chunks/{48850e202dd814ac.js → a6363f73e05ccf47.js} +1 -1
  177. package/web/.next/static/chunks/{6f76e63ead3fac2e.js → b7126c0b3a97e77e.js} +1 -1
  178. package/web/.next/static/chunks/d3df6e6434e16519.js +1 -0
  179. package/web/.next/static/chunks/eaca60cc3ab0bf9f.js +2 -0
  180. package/web/.next/static/chunks/{9dad6769d10a32df.js → fe5d48f8ca483935.js} +1 -1
  181. package/web/.next/server/chunks/403f9_next_dist_esm_build_templates_app-route_ff60e4a5.js +0 -3
  182. package/web/.next/server/chunks/403f9_next_dist_esm_build_templates_app-route_ff60e4a5.js.map +0 -1
  183. package/web/.next/server/chunks/[externals]__448264a3._.js +0 -3
  184. package/web/.next/server/chunks/ssr/_4533d6f8._.js +0 -4
  185. package/web/.next/server/chunks/ssr/_4533d6f8._.js.map +0 -1
  186. package/web/.next/static/chunks/21e82fee1a7e1668.js +0 -1
  187. package/web/.next/static/chunks/682563e4503cbd58.js +0 -1
  188. package/web/.next/static/chunks/683b1d85e789c2eb.js +0 -2
  189. package/web/.next/static/chunks/d62ae5e449d87057.js +0 -1
  190. /package/web/.next/server/chunks/{[externals]__448264a3._.js.map → 744ca_web__next-internal_server_app_api_sessions-batch_route_actions_4859f283.js.map} +0 -0
  191. /package/web/.next/static/{zYKuE1zbe1UWwAJv5EVwg → 1CQHYZVn3VajyhdvnsCaw}/_buildManifest.js +0 -0
  192. /package/web/.next/static/{zYKuE1zbe1UWwAJv5EVwg → 1CQHYZVn3VajyhdvnsCaw}/_clientMiddlewareManifest.json +0 -0
  193. /package/web/.next/static/{zYKuE1zbe1UWwAJv5EVwg → 1CQHYZVn3VajyhdvnsCaw}/_ssgManifest.js +0 -0
@@ -1,5 +1,5 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,69090,(e,t,n)=>{"use strict";var r=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,l=/\n/g,a=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,u=/^\s+|\s+$/g;function d(e){return e?e.replace(u,""):""}t.exports=function(e,t){if("string"!=typeof e)throw TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,u=1;function p(e){var t=e.match(l);t&&(n+=t.length);var r=e.lastIndexOf("\n");u=~r?e.length-r:u+e.length}function f(){var e={line:n,column:u};return function(t){return t.position=new h(e),x(a),t}}function h(e){this.start=e,this.end={line:n,column:u},this.source=t.source}function m(r){var l=Error(t.source+":"+n+":"+u+": "+r);if(l.reason=r,l.filename=t.source,l.line=n,l.column=u,l.source=e,t.silent);else throw l}function x(t){var n=t.exec(e);if(n){var r=n[0];return p(r),e=e.slice(r.length),n}}function g(e){var t;for(e=e||[];t=y();)!1!==t&&e.push(t);return e}function y(){var t=f();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;""!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return m("End of comment missing");var r=e.slice(2,n-2);return u+=2,p(r),e=e.slice(n),u+=2,t({type:"comment",comment:r})}}h.prototype.content=e,x(a);var v,b=[];for(g(b);v=function(){var e=f(),t=x(i);if(t){if(y(),!x(s))return m("property missing ':'");var n=x(o),l=e({type:"declaration",property:d(t[0].replace(r,"")),value:n?d(n[0].replace(r,"")):""});return x(c),l}}();)!1!==v&&(b.push(v),g(b));return b}},59596,(e,t,n)=>{"use strict";var r=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e,t){let n=null;if(!e||"string"!=typeof e)return n;let r=(0,l.default)(e),a="function"==typeof t;return r.forEach(e=>{if("declaration"!==e.type)return;let{property:r,value:l}=e;a?t(r,l,e):l&&((n=n||{})[r]=l)}),n};let l=r(e.r(69090))},51521,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.camelCase=void 0;var r=/^--[a-zA-Z0-9_-]+$/,l=/-([a-z])/g,a=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,o=function(e,t){return t.toUpperCase()},c=function(e,t){return"".concat(t,"-")};n.camelCase=function(e,t){var n;return(void 0===t&&(t={}),!(n=e)||a.test(n)||r.test(n))?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(s,c):e.replace(i,c)).replace(l,o))}},63185,(e,t,n)=>{"use strict";var r=(e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(e.r(59596)),l=e.r(51521);function a(e,t){var n={};return e&&"string"==typeof e&&(0,r.default)(e,function(e,r){e&&r&&(n[(0,l.camelCase)(e,t)]=r)}),n}a.default=a,t.exports=a},75609,(e,t,n)=>{"use strict";var r=Object.prototype.hasOwnProperty,l=Object.prototype.toString,a=Object.defineProperty,i=Object.getOwnPropertyDescriptor,s=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===l.call(e)},o=function(e){if(!e||"[object Object]"!==l.call(e))return!1;var t,n=r.call(e,"constructor"),a=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!a)return!1;for(t in e);return void 0===t||r.call(e,t)},c=function(e,t){a&&"__proto__"===t.name?a(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},u=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;else if(i)return i(e,t).value}return e[t]};t.exports=function e(){var t,n,r,l,a,i,d=arguments[0],p=1,f=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},p=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});p<f;++p)if(t=arguments[p],null!=t)for(n in t)r=u(d,n),d!==(l=u(t,n))&&(h&&l&&(o(l)||(a=s(l)))?(a?(a=!1,i=r&&s(r)?r:[]):i=r&&o(r)?r:{},c(d,{name:n,newValue:e(h,i,l)})):void 0!==l&&c(d,{name:n,newValue:l}));return d}},36986,e=>{"use strict";var t=e.i(20314),n=e.i(79054),r=e.i(31406),l=e.i(60112),a=e.i(83428),i=e.i(67669),s=e.i(24042),o=e.i(64970),c=e.i(33548),u=e.i(23925),d=e.i(8986),p=e.i(30702),f=e.i(21023);let h=(0,f.createServerReference)("602b6c5a9e6d52afe63150e717afa950e5e25b9f4a",f.callServer,void 0,f.findSourceMapURL,"approveFeature");var m=e.i(26023),x=e.i(24055);let g=(0,f.createServerReference)("706f6b7411b8292a3580c4cbe33760d7479fc57565",f.callServer,void 0,f.findSourceMapURL,"rejectFeature"),y=(0,f.createServerReference)("40396254d38a6462da6d678573d3e7e5360d8acde9",f.callServer,void 0,f.findSourceMapURL,"getFeatureArtifact"),v=(0,f.createServerReference)("4000a6dcd3276a6b4c88ad85005089f943619c81c0",f.callServer,void 0,f.findSourceMapURL,"getResearchArtifact"),b=(0,f.createServerReference)("405c4a4e2573c8c30ccea949daa2bda19a8d4c7087",f.callServer,void 0,f.findSourceMapURL,"getMergeReviewData");var k=e.i(75921),j=e.i(8361),w=e.i(30153),N=e.i(8537),S=e.i(39443);e.i(1650);var C=e.i(11495);e.i(99348);var T=e.i(17466),E=e.i(45811),M=e.i(35364),I=e.i(2828);e.i(31566);var A=e.i(65104);e.i(81803);var P=e.i(72714),R=e.i(38573),D=e.i(19933),L=e.i(99105),z=e.i(51251),F=e.i(70646);function O({actions:e,repositoryPath:r,worktreePath:l,showSpecs:i}){let[s,o]=(0,n.useState)(!1),p=e.ideLoading||e.shellLoading||e.specsLoading,f=e.ideError??e.shellError??e.specsError;return(0,t.jsxs)(F.DropdownMenu,{modal:!1,children:[(0,t.jsx)(F.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsxs)(M.Button,{variant:"outline",size:"sm",className:"gap-1.5",disabled:p,children:[p?(0,t.jsx)(a.Loader2,{className:"size-4 animate-spin"}):f?(0,t.jsx)(z.CircleAlert,{className:"text-destructive size-4"}):(0,t.jsx)(D.FolderOpen,{className:"size-4"}),"Open",(0,t.jsx)(L.ChevronDown,{className:"size-3 opacity-60"})]})}),(0,t.jsxs)(F.DropdownMenuContent,{align:"start",className:"w-48",children:[(0,t.jsx)(F.DropdownMenuLabel,{children:"Open in"}),(0,t.jsxs)(F.DropdownMenuItem,{onClick:e.openInIde,disabled:e.ideLoading,className:"gap-2",children:[e.ideLoading?(0,t.jsx)(a.Loader2,{className:"size-4 animate-spin"}):e.ideError?(0,t.jsx)(z.CircleAlert,{className:"text-destructive size-4"}):(0,t.jsx)(d.Code2,{className:"size-4"}),"IDE"]}),(0,t.jsxs)(F.DropdownMenuItem,{onClick:e.openInShell,disabled:e.shellLoading,className:"gap-2",children:[e.shellLoading?(0,t.jsx)(a.Loader2,{className:"size-4 animate-spin"}):e.shellError?(0,t.jsx)(z.CircleAlert,{className:"text-destructive size-4"}):(0,t.jsx)(R.Terminal,{className:"size-4"}),"Terminal"]}),(0,t.jsxs)(F.DropdownMenuItem,{onClick:e.openSpecsFolder,disabled:e.specsLoading||!i,className:"gap-2",children:[e.specsLoading?(0,t.jsx)(a.Loader2,{className:"size-4 animate-spin"}):e.specsError?(0,t.jsx)(z.CircleAlert,{className:"text-destructive size-4"}):(0,t.jsx)(D.FolderOpen,{className:"size-4"}),"Specs Folder"]}),(0,t.jsx)(F.DropdownMenuSeparator,{}),(0,t.jsxs)(F.DropdownMenuItem,{onClick:()=>{navigator.clipboard.writeText(l??r),o(!0),setTimeout(()=>o(!1),2e3)},className:"gap-2",children:[s?(0,t.jsx)(u.Check,{className:"size-4 text-green-600"}):(0,t.jsx)(c.Copy,{className:"size-4"}),s?"Copied!":"Copy path"]})]})]})}var B=e.i(79687),$=e.i(68304);let _=(0,f.createServerReference)("40e23c25623c85b29c841baa543e62b1c5387983e0",f.callServer,void 0,f.findSourceMapURL,"getFeaturePhaseTimings"),U=(0,f.createServerReference)("407dc1202b0afa38a5995cf91729ed671bc98b1c4d",f.callServer,void 0,f.findSourceMapURL,"getFeaturePlan");var q=e.i(11345),H=e.i(76016),V=e.i(31777),W=e.i(81846),K=e.i(16868),Q=e.i(3645);let G=(0,Q.default)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);var J=e.i(58481),X=e.i(48306);e.i(50032);var Z=e.i(86254),Y=e.i(42076);let ee=new Set([".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp",".ico",".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".txt",".md",".csv",".json",".yaml",".yml",".xml",".ts",".tsx",".js",".jsx",".py",".rb",".go",".rs",".java",".c",".cpp",".h",".hpp",".cs",".swift",".kt",".html",".css",".scss",".less",".sh",".bash",".zsh",".fish",".toml",".ini",".cfg",".conf",".env",".zip",".tar",".gz",".log"]);function et({onReject:e,onApprove:r,approveLabel:l,approveVariant:a="default",revisionPlaceholder:i,isProcessing:s=!1,isRejecting:o=!1,children:c,chatInput:d,onChatInputChange:p}){let f="warning"===a,h=f?J.AlertTriangle:u.Check,m=f?"bg-orange-500/85":"bg-blue-500/85",[x,g]=(0,n.useState)(""),y=d??x,v=p??g,b=(0,j.useSoundAction)("approve"),k=s||o,[w,N]=(0,n.useState)([]),[S,C]=(0,n.useState)(!1),[T,E]=(0,n.useState)(null),[A,P]=(0,n.useState)(!1),[R,D]=(0,n.useState)(!1),[L,z]=(0,n.useState)(!1),F=y.trim().length>0,O=F?A||R&&L:!A,B=(0,n.useRef)(0),$=(0,n.useRef)(crypto.randomUUID()),_=(0,n.useRef)(null);(0,n.useEffect)(()=>{function e(e){("Control"===e.key||"Meta"===e.key)&&D(!0),"Shift"===e.key&&z(!0)}function t(e){("Control"===e.key||"Meta"===e.key)&&D(!1),"Shift"===e.key&&z(!1)}function n(){D(!1),z(!1)}return window.addEventListener("keydown",e),window.addEventListener("keyup",t),window.addEventListener("blur",n),()=>{window.removeEventListener("keydown",e),window.removeEventListener("keyup",t),window.removeEventListener("blur",n)}},[]);let U=(0,n.useCallback)(async e=>{for(let t of(E(null),e)){if(t.size>0xa00000)return void E(`"${t.name}" exceeds 10 MB limit`);let e=function(e){let t=e.lastIndexOf(".");return t>=0?e.slice(t).toLowerCase():""}(t.name);if(e&&!ee.has(e))return void E(`File type "${e}" is not allowed`)}for(let t of e){let e=crypto.randomUUID();N(n=>[...n,{id:e,name:t.name,size:t.size,mimeType:t.type||"application/octet-stream",path:"",loading:!0}]);try{let n=new FormData;n.append("file",t),n.append("sessionId",$.current);let r=await fetch("/api/attachments/upload",{method:"POST",body:n});if(!r.ok){let t=await r.json().catch(()=>({error:"Upload failed"}));N(t=>t.filter(t=>t.id!==e)),E(t.error??"Upload failed");return}let l=await r.json();N(t=>t.some(t=>t.id!==e&&t.path===l.path)?t.filter(t=>t.id!==e):t.map(t=>t.id===e?{...l,id:e,loading:!1}:t))}catch{N(t=>t.filter(t=>t.id!==e)),E("Upload failed")}}},[]),H=(0,n.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),B.current+=1,1===B.current&&C(!0)},[]),W=(0,n.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),B.current-=1,0===B.current&&C(!1)},[]),Q=(0,n.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),et=(0,n.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),B.current=0,C(!1);let t=Array.from(e.dataTransfer.files);t.length>0&&U(t)},[U]),en=(0,n.useCallback)(e=>{let t=e.clipboardData?.items;if(!t)return;let n=[];for(let e of Array.from(t))if("file"===e.kind){let t=e.getAsFile();t&&n.push(t)}n.length>0&&(e.preventDefault(),U(n))},[U]),er=(0,n.useCallback)(async()=>{try{let e=await (0,Y.pickFiles)();e&&N(t=>{let n=new Set(t.map(e=>e.path)),r=e.filter(e=>!n.has(e.path)).map(e=>({id:crypto.randomUUID(),name:e.name,size:e.size,mimeType:"application/octet-stream",path:e.path}));return r.length>0?[...t,...r]:t})}catch{}},[]),el=(0,n.useCallback)(e=>{N(t=>t.filter(t=>t.id!==e))},[]),ea=(0,n.useCallback)((e,t)=>{N(n=>n.map(n=>n.id===e?{...n,notes:t}:n))},[]),ei=(0,n.useCallback)(()=>{v(""),N([]),E(null)},[v]),es=(0,n.useCallback)(e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),_.current?.requestSubmit())},[]),eo="u">typeof navigator&&/Mac/i.test(navigator.userAgent)?"⌘":"Ctrl";return(0,t.jsxs)("div",{className:"border-border shrink-0 border-t",children:[c,e?(0,t.jsx)(I.TooltipProvider,{delayDuration:400,children:(0,t.jsx)("form",{ref:_,onSubmit:function(t){t.preventDefault();let n=y.trim();if(O)b.play(),r(),ei();else{if(!n||!e)return;e(n,w.filter(e=>!e.loading)),ei()}},className:"p-3",children:(0,t.jsx)("div",{role:"region","aria-label":"File drop zone","data-drag-over":S?"true":"false",onDragEnter:H,onDragLeave:W,onDragOver:Q,onDrop:et,className:(0,V.cn)("rounded-md border-2 border-transparent transition-colors",S&&"border-primary/50 bg-primary/5"),children:(0,t.jsxs)("div",{className:"border-input focus-within:ring-ring/50 focus-within:border-ring flex flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow] focus-within:ring-[3px]",children:[(0,t.jsx)(X.Textarea,{placeholder:i??"Ask AI to revise...","aria-label":i??"Ask AI to revise...",disabled:k,value:y,onChange:e=>v(e.target.value),onKeyDown:es,onPaste:en,rows:1,className:"max-h-[35dvh] min-h-9 flex-1 resize-none overflow-y-auto rounded-none border-0 py-2 shadow-none focus-visible:ring-0","data-testid":"drawer-chat-input"}),w.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:w.map(e=>(0,t.jsx)(Z.AttachmentChip,{name:e.name,size:e.size,mimeType:e.mimeType,path:e.path,onRemove:()=>el(e.id),disabled:k,loading:e.loading,notes:e.notes,onNotesChange:t=>ea(e.id,t)},e.id))}),T?(0,t.jsx)("p",{className:"text-destructive px-3 pb-2 text-xs",children:T}):null,(0,t.jsxs)("div",{className:"border-input flex items-center gap-2 border-t px-3 py-1.5",children:[(0,t.jsxs)("span",{className:"text-muted-foreground flex-1 truncate text-[11px]",children:[(0,t.jsxs)("kbd",{className:"bg-muted rounded px-1 py-0.5 font-mono text-[10px]",children:[eo,"+Enter"]})," ",F?"reject":"approve"]}),(0,t.jsxs)(I.Tooltip,{children:[(0,t.jsx)(I.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:er,disabled:k,"aria-label":"Attach files",className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,t.jsx)(K.PaperclipIcon,{className:"h-4 w-4"})})}),(0,t.jsx)(I.TooltipContent,{side:"top",children:"Attach files"})]}),(0,t.jsx)("div",{onMouseLeave:()=>P(!1),children:(0,t.jsxs)(I.Tooltip,{children:[(0,t.jsx)(I.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"submit",disabled:k,"data-testid":"drawer-action-submit",className:(0,V.cn)("relative flex h-9 min-w-[12rem] cursor-pointer items-center overflow-hidden rounded-md border pr-10 pl-4 text-sm font-medium whitespace-nowrap transition-colors","disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",O?`${f?"border-orange-400/60":"border-blue-400/60"} text-white`:F&&R&&!L?"border-primary bg-muted ring-primary/30 shadow-sm ring-1":"border-border bg-muted/50 hover:bg-muted shadow-sm"),children:[(0,t.jsx)("div",{className:(0,V.cn)("pointer-events-none absolute inset-0 transition-transform duration-300 ease-in-out",m),style:{transform:O?"translateX(0)":"translateX(100%)"}}),(0,t.jsxs)("span",{className:(0,V.cn)("absolute inset-0 z-10 flex items-center justify-center gap-2 pr-8 transition-opacity duration-300",O?"opacity-0":"opacity-100"),children:[(0,t.jsx)(G,{className:"h-4 w-4 shrink-0"}),"Reject"]}),(0,t.jsxs)("span",{className:(0,V.cn)("absolute inset-0 z-10 flex items-center justify-center gap-2 text-white transition-opacity duration-300",O?"opacity-100":"opacity-0"),children:[(0,t.jsx)(h,{className:"h-4 w-4 shrink-0"}),l]}),(0,t.jsx)("span",{className:(0,V.cn)(`border-input/60 absolute inset-y-0 right-0 z-20 flex w-8 cursor-pointer items-center justify-center rounded-r-[5px] border-l ${m} transition-opacity duration-300`,!F&&!A&&"pointer-events-none opacity-0"),onMouseEnter:()=>P(!0),children:(0,t.jsx)(q.ChevronLeft,{className:"h-4 w-4 text-white"})})]})}),f?null:(0,t.jsx)(I.TooltipContent,{side:"top",children:O?l:"Send revision feedback"})]})})]})]})})})}):(0,t.jsx)("div",{className:"flex items-center gap-2 px-4 pb-4",children:(0,t.jsx)(M.Button,{type:"button",className:"flex-1",disabled:k,onClick:()=>{b.play(),r()},children:l})})]})}function en({data:e,selections:r,onSelect:l,onApprove:a,onReject:i,isProcessing:s=!1,isRejecting:o=!1,showHeader:c=!1,chatInput:u,onChatInputChange:d}){let{question:p,context:f,questions:h,finalAction:m}=e,[x,g]=(0,n.useState)(0),y=(0,j.useSoundAction)("select"),v=(0,j.useSoundAction)("navigate"),b=h.length,k=x===b-1,w=h[x],N=(0,n.useMemo)(()=>Object.keys(r).length,[r]),S=(0,n.useCallback)((e,t)=>{y.play(),l(e,t),k||setTimeout(()=>g(e=>e+1),250)},[l,k,y]);return 0===b?null:(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsxs)("div",{className:"flex-1 space-y-4 overflow-y-auto p-4",children:[c?(0,t.jsxs)("div",{className:"border-border flex items-start gap-3 border-b pb-3",children:[(0,t.jsx)("div",{className:"mt-1.5 h-2 w-2 shrink-0 rounded-full bg-amber-500"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("h3",{className:"text-foreground mb-1.5 text-sm font-bold",children:p}),(0,t.jsx)("p",{className:"text-muted-foreground text-xs leading-relaxed",children:f})]})]}):null,(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsxs)("label",{className:"text-foreground min-w-0 flex-1 text-sm font-semibold",children:[x+1,". ",w.question]}),(0,t.jsx)("div",{className:"mt-1.5 flex shrink-0 gap-1",children:h.map((e,n)=>(0,t.jsx)("button",{type:"button","aria-label":`Go to question ${n+1}`,className:(0,V.cn)("h-1.5 rounded-full transition-all duration-200",n===x?"bg-primary w-4":"w-1.5",n!==x&&r[e.id]?"bg-primary/50":"",n===x||r[e.id]?"":"bg-muted-foreground/25"),onClick:()=>{v.play(),g(n)}},e.id))})]}),(0,t.jsx)("div",{className:"space-y-2",children:w.options.map((e,n)=>{let l=r[w.id]===e.id,a=String.fromCharCode(65+n);return(0,t.jsx)("button",{type:"button",className:(0,V.cn)("border-border w-full overflow-hidden rounded-md border px-3 py-3 text-left text-xs transition-all","hover:border-primary/70 hover:bg-primary/5 group",l&&"border-primary bg-primary/5",e.isNew&&"animate-option-highlight"),disabled:s,onClick:()=>S(w.id,e.id),children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsxs)("span",{className:"text-muted-foreground mt-0.5 font-mono text-xs",children:[a,"."]}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("div",{className:"text-foreground mb-0.5 text-xs font-semibold wrap-break-word",children:e.label}),(0,t.jsx)("div",{className:"text-muted-foreground text-xs leading-snug",children:e.rationale})]}),e.recommended||e.isNew?(0,t.jsx)("div",{className:"shrink-0 pt-0.5",children:e.recommended?(0,t.jsx)(W.Badge,{className:"px-1.5 py-0 text-[10px] whitespace-nowrap",children:"AI Recommended"}):(0,t.jsx)(W.Badge,{className:"border-transparent bg-emerald-600 px-1.5 py-0 text-[10px] whitespace-nowrap text-white hover:bg-emerald-600/80",children:"New"})}):null]})},e.id)})})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between pt-2",children:[(0,t.jsxs)(M.Button,{type:"button",variant:"ghost",size:"sm",disabled:0===x||s,onClick:()=>{v.play(),g(e=>e-1)},children:[(0,t.jsx)(q.ChevronLeft,{className:"mr-1 h-4 w-4"}),"Previous"]}),k?null:(0,t.jsxs)(M.Button,{type:"button",variant:"ghost",size:"sm",disabled:s,onClick:()=>{v.play(),g(e=>e+1)},children:[r[w.id]?"Next":"Skip",(0,t.jsx)(H.ChevronRight,{className:"ml-1 h-4 w-4"})]})]})]}),(0,t.jsx)(et,{onReject:i,onApprove:()=>a(m.id),approveLabel:m.label,revisionPlaceholder:"Ask AI to refine requirements...",isProcessing:s,isRejecting:o,chatInput:u,onChatInputChange:d,children:(0,t.jsx)("div",{className:(0,V.cn)("bg-muted h-1.5 overflow-hidden",N>0&&N<b||s?"opacity-100":"opacity-0","transition-opacity duration-200"),"data-testid":"progress-bar-container",children:s?(0,t.jsx)("div",{className:"bg-primary animate-indeterminate-progress h-full w-1/3"}):(0,t.jsx)("div",{className:"bg-primary h-full transition-all duration-300",style:{width:`${b>0?N/b*100:0}%`},"data-testid":"progress-bar"})})})]})}function er(){}function el(){}let ea=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ei=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,es={};function eo(e,t){return((t||es).jsx?ei:ea).test(e)}let ec=/[ \t\n\f\r]/g;function eu(e){return""===e.replace(ec,"")}class ed{constructor(e,t){this.attribute=t,this.property=e}}ed.prototype.attribute="",ed.prototype.booleanish=!1,ed.prototype.boolean=!1,ed.prototype.commaOrSpaceSeparated=!1,ed.prototype.commaSeparated=!1,ed.prototype.defined=!1,ed.prototype.mustUseProperty=!1,ed.prototype.number=!1,ed.prototype.overloadedBoolean=!1,ed.prototype.property="",ed.prototype.spaceSeparated=!1,ed.prototype.space=void 0;let ep=0,ef=eb(),eh=eb(),em=eb(),ex=eb(),eg=eb(),ey=eb(),ev=eb();function eb(){return 2**++ep}e.s(["boolean",0,ef,"booleanish",0,eh,"commaOrSpaceSeparated",0,ev,"commaSeparated",0,ey,"number",0,ex,"overloadedBoolean",0,em,"spaceSeparated",0,eg],83954);var ek=e.i(83954);let ej=Object.keys(ek);class ew extends ed{constructor(e,t,n,r){let l=-1;if(super(e,t),function(e,t,n){n&&(e[t]=n)}(this,"space",r),"number"==typeof n)for(;++l<ej.length;){const e=ej[l];!function(e,t,n){n&&(e[t]=n)}(this,ej[l],(n&ek[e])===ek[e])}}}function eN(e){return e.toLowerCase()}ew.prototype.defined=!0;let eS=/[A-Z]/g,eC=/-[a-z]/g,eT=/^data[-\w.:]+$/i;function eE(e){return"-"+e.toLowerCase()}function eM(e){return e.charAt(1).toUpperCase()}let eI={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};class eA{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function eP(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new eA(n,r,t)}function eR(e){let t={},n={};for(let[r,l]of Object.entries(e.properties)){let a=new ew(r,e.transform(e.attributes||{},r),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[eN(r)]=r,n[eN(a.attribute)]=r}return new eA(t,n,e.space)}eA.prototype.normal={},eA.prototype.property={},eA.prototype.space=void 0;let eD=eR({properties:{ariaActiveDescendant:null,ariaAtomic:eh,ariaAutoComplete:null,ariaBusy:eh,ariaChecked:eh,ariaColCount:ex,ariaColIndex:ex,ariaColSpan:ex,ariaControls:eg,ariaCurrent:null,ariaDescribedBy:eg,ariaDetails:null,ariaDisabled:eh,ariaDropEffect:eg,ariaErrorMessage:null,ariaExpanded:eh,ariaFlowTo:eg,ariaGrabbed:eh,ariaHasPopup:null,ariaHidden:eh,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:eg,ariaLevel:ex,ariaLive:null,ariaModal:eh,ariaMultiLine:eh,ariaMultiSelectable:eh,ariaOrientation:null,ariaOwns:eg,ariaPlaceholder:null,ariaPosInSet:ex,ariaPressed:eh,ariaReadOnly:eh,ariaRelevant:null,ariaRequired:eh,ariaRoleDescription:eg,ariaRowCount:ex,ariaRowIndex:ex,ariaRowSpan:ex,ariaSelected:eh,ariaSetSize:ex,ariaSort:null,ariaValueMax:ex,ariaValueMin:ex,ariaValueNow:ex,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function eL(e,t){return t in e?e[t]:t}function ez(e,t){return eL(e,t.toLowerCase())}let eF=eR({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ey,acceptCharset:eg,accessKey:eg,action:null,allow:null,allowFullScreen:ef,allowPaymentRequest:ef,allowUserMedia:ef,alt:null,as:null,async:ef,autoCapitalize:null,autoComplete:eg,autoFocus:ef,autoPlay:ef,blocking:eg,capture:null,charSet:null,checked:ef,cite:null,className:eg,cols:ex,colSpan:null,content:null,contentEditable:eh,controls:ef,controlsList:eg,coords:ex|ey,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ef,defer:ef,dir:null,dirName:null,disabled:ef,download:em,draggable:eh,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ef,formTarget:null,headers:eg,height:ex,hidden:em,high:ex,href:null,hrefLang:null,htmlFor:eg,httpEquiv:eg,id:null,imageSizes:null,imageSrcSet:null,inert:ef,inputMode:null,integrity:null,is:null,isMap:ef,itemId:null,itemProp:eg,itemRef:eg,itemScope:ef,itemType:eg,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ef,low:ex,manifest:null,max:null,maxLength:ex,media:null,method:null,min:null,minLength:ex,multiple:ef,muted:ef,name:null,nonce:null,noModule:ef,noValidate:ef,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ef,optimum:ex,pattern:null,ping:eg,placeholder:null,playsInline:ef,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ef,referrerPolicy:null,rel:eg,required:ef,reversed:ef,rows:ex,rowSpan:ex,sandbox:eg,scope:null,scoped:ef,seamless:ef,selected:ef,shadowRootClonable:ef,shadowRootDelegatesFocus:ef,shadowRootMode:null,shape:null,size:ex,sizes:null,slot:null,span:ex,spellCheck:eh,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ex,step:null,style:null,tabIndex:ex,target:null,title:null,translate:null,type:null,typeMustMatch:ef,useMap:null,value:eh,width:ex,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:eg,axis:null,background:null,bgColor:null,border:ex,borderColor:null,bottomMargin:ex,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ef,declare:ef,event:null,face:null,frame:null,frameBorder:null,hSpace:ex,leftMargin:ex,link:null,longDesc:null,lowSrc:null,marginHeight:ex,marginWidth:ex,noResize:ef,noHref:ef,noShade:ef,noWrap:ef,object:null,profile:null,prompt:null,rev:null,rightMargin:ex,rules:null,scheme:null,scrolling:eh,standby:null,summary:null,text:null,topMargin:ex,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ex,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ef,disableRemotePlayback:ef,prefix:null,property:null,results:ex,security:null,unselectable:null},space:"html",transform:ez}),eO=eR({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ev,accentHeight:ex,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ex,amplitude:ex,arabicForm:null,ascent:ex,attributeName:null,attributeType:null,azimuth:ex,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ex,by:null,calcMode:null,capHeight:ex,className:eg,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ex,diffuseConstant:ex,direction:null,display:null,dur:null,divisor:ex,dominantBaseline:null,download:ef,dx:null,dy:null,edgeMode:null,editable:null,elevation:ex,enableBackground:null,end:null,event:null,exponent:ex,externalResourcesRequired:null,fill:null,fillOpacity:ex,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ey,g2:ey,glyphName:ey,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ex,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ex,horizOriginX:ex,horizOriginY:ex,id:null,ideographic:ex,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ex,k:ex,k1:ex,k2:ex,k3:ex,k4:ex,kernelMatrix:ev,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ex,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ex,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ex,overlineThickness:ex,paintOrder:null,panose1:null,path:null,pathLength:ex,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:eg,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ex,pointsAtY:ex,pointsAtZ:ex,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ev,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ev,rev:ev,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ev,requiredFeatures:ev,requiredFonts:ev,requiredFormats:ev,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ex,specularExponent:ex,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ex,strikethroughThickness:ex,string:null,stroke:null,strokeDashArray:ev,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ex,strokeOpacity:ex,strokeWidth:null,style:null,surfaceScale:ex,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ev,tabIndex:ex,tableValues:null,target:null,targetX:ex,targetY:ex,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ev,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ex,underlineThickness:ex,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ex,values:null,vAlphabetic:ex,vMathematical:ex,vectorEffect:null,vHanging:ex,vIdeographic:ex,version:null,vertAdvY:ex,vertOriginX:ex,vertOriginY:ex,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ex,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:eL}),eB=eR({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),e$=eR({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ez}),e_=eR({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),eU=eP([eD,eF,eB,e$,e_],"html"),eq=eP([eD,eO,eB,e$,e_],"svg");var eH=e.i(63185);let eV=eK("end"),eW=eK("start");function eK(e){return function(t){let n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function eQ(e){return e&&"object"==typeof e?"position"in e||"type"in e?eJ(e.position):"start"in e||"end"in e?eJ(e):"line"in e||"column"in e?eG(e):"":""}function eG(e){return eX(e&&e.line)+":"+eX(e&&e.column)}function eJ(e){return eG(e&&e.start)+"-"+eG(e&&e.end)}function eX(e){return e&&"number"==typeof e?e:1}class eZ extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",l={},a=!1;if(t&&(l="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!l.cause&&e&&(a=!0,r=e.message,l.cause=e),!l.ruleId&&!l.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?l.ruleId=n:(l.source=n.slice(0,e),l.ruleId=n.slice(e+1))}if(!l.place&&l.ancestors&&l.ancestors){const e=l.ancestors[l.ancestors.length-1];e&&(l.place=e.position)}const i=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=i?i.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=i?i.line:void 0,this.name=eQ(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=a&&l.cause&&"string"==typeof l.cause.stack?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}eZ.prototype.file="",eZ.prototype.name="",eZ.prototype.reason="",eZ.prototype.message="",eZ.prototype.stack="",eZ.prototype.column=void 0,eZ.prototype.line=void 0,eZ.prototype.ancestors=void 0,eZ.prototype.cause=void 0,eZ.prototype.fatal=void 0,eZ.prototype.place=void 0,eZ.prototype.ruleId=void 0,eZ.prototype.source=void 0;let eY={}.hasOwnProperty,e0=new Map,e1=/[A-Z]/g,e2=new Set(["table","tbody","thead","tfoot","tr"]),e5=new Set(["td","th"]),e3="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function e4(e,t,n){var r,l,a,i,s,o,c,u,d;let p,f,h,m,x,g,y,v,b,k,j;return"element"===t.type?(r=e,l=t,a=n,f=p=r.schema,"svg"===l.tagName.toLowerCase()&&"html"===p.space&&(r.schema=eq),r.ancestors.push(l),h=e7(r,l.tagName,!1),m=function(e,t){let n,r,l={};for(r in t.properties)if("children"!==r&&eY.call(t.properties,r)){let a=function(e,t,n){let r=function(e,t){let n=eN(t),r=t,l=ed;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&eT.test(t)){if("-"===t.charAt(4)){let e=t.slice(5).replace(eC,eM);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!eC.test(e)){let n=e.replace(eS,eE);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}l=ew}return new l(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){var l;let t;if(Array.isArray(n)&&(n=r.commaSeparated?(t={},(""===(l=n)[l.length-1]?[...l,""]:l).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()):n.join(" ").trim()),"style"===r.property){let t="object"==typeof n?n:function(e,t){try{return(0,eH.default)(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};let t=new eZ("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=e3+"#cannot-parse-style-attribute",t}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){let t,n={};for(t in e)eY.call(e,t)&&(n[function(e){let t=e.replace(e1,tt);return"ms-"===t.slice(0,3)&&(t="-"+t),t}(t)]=e[t]);return n}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?eI[r.property]||r.property:r.attribute,n]}}(e,r,t.properties[r]);if(a){let[r,i]=a;e.tableCellAlignToStyle&&"align"===r&&"string"==typeof i&&e5.has(t.tagName)?n=i:l[r]=i}}return n&&((l.style||(l.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=n),l}(r,l),x=e8(r,l),e2.has(l.tagName)&&(x=x.filter(function(e){return"string"!=typeof e||!("object"==typeof e?"text"===e.type&&eu(e.value):eu(e))})),e6(r,m,h,l),e9(m,x),r.ancestors.pop(),r.schema=p,r.create(l,h,m,a)):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return er("ExpressionStatement"===n.type),e.evaluater.evaluateExpression(n.expression)}te(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?(i=e,s=t,o=n,y=g=i.schema,"svg"===s.name&&"html"===g.space&&(i.schema=eq),i.ancestors.push(s),v=null===s.name?i.Fragment:e7(i,s.name,!0),b=function(e,t){let n={};for(let r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];er("ExpressionStatement"===t.type);let l=t.expression;er("ObjectExpression"===l.type);let a=l.properties[0];er("SpreadElement"===a.type),Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else te(e,t.position);else{let l,a=r.name;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];er("ExpressionStatement"===t.type),l=e.evaluater.evaluateExpression(t.expression)}else te(e,t.position);else l=null===r.value||r.value;n[a]=l}return n}(i,s),k=e8(i,s),e6(i,b,v,s),e9(b,k),i.ancestors.pop(),i.schema=g,i.create(s,v,b,o)):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);te(e,t.position)}(e,t):"root"===t.type?(c=e,u=t,d=n,e9(j={},e8(c,u)),c.create(u,c.Fragment,j,d)):"text"===t.type?t.value:void 0}function e6(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function e9(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function e8(e,t){let n=[],r=-1,l=e.passKeys?new Map:e0;for(;++r<t.children.length;){let a,i=t.children[r];if(e.passKeys){let e="element"===i.type?i.tagName:"mdxJsxFlowElement"===i.type||"mdxJsxTextElement"===i.type?i.name:void 0;if(e){let t=l.get(e)||0;a=e+"-"+t,l.set(e,t+1)}}let s=e4(e,i,a);void 0!==s&&n.push(s)}return n}function e7(e,t,n){let r;if(n)if(t.includes(".")){let e,n=t.split("."),l=-1;for(;++l<n.length;){let t=eo(n[l])?{type:"Identifier",name:n[l]}:{type:"Literal",value:n[l]};e=e?{type:"MemberExpression",object:e,property:t,computed:!!(l&&"Literal"===t.type),optional:!1}:t}er(e,"always a result"),r=e}else r=eo(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else r={type:"Literal",value:t};if("Literal"===r.type){let t=r.value;return eY.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);te(e)}function te(e,t){let n=new eZ("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=e3+"#cannot-handle-mdx-estrees-without-createevaluater",n}function tt(e){return"-"+e.toLowerCase()}let tn={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},tr={};function tl(e,t,n){var r;if((r=e)&&"object"==typeof r){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return ta(e.children,t,n)}return Array.isArray(e)?ta(e,t,n):""}function ta(e,t,n){let r=[],l=-1;for(;++l<e.length;)r[l]=tl(e[l],t,n);return r.join("")}function ti(e,t,n,r){let l,a=e.length,i=0;if(t=t<0?-t>a?0:a+t:t>a?a:t,n=n>0?n:0,r.length<1e4)(l=Array.from(r)).unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);i<r.length;)(l=r.slice(i,i+1e4)).unshift(t,0),e.splice(...l),i+=1e4,t+=1e4}function ts(e,t){return e.length>0?(ti(e,e.length,0,t),e):t}let to={}.hasOwnProperty,tc=tk(/[A-Za-z]/),tu=tk(/[\dA-Za-z]/),td=tk(/[#-'*+\--9=?A-Z^-~]/);function tp(e){return null!==e&&(e<32||127===e)}let tf=tk(/\d/),th=tk(/[\dA-Fa-f]/),tm=tk(/[!-/:-@[-`{-~]/);function tx(e){return null!==e&&e<-2}function tg(e){return null!==e&&(e<0||32===e)}function ty(e){return -2===e||-1===e||32===e}let tv=tk(/\p{P}|\p{S}/u),tb=tk(/\s/);function tk(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function tj(e,t,n,r){let l=r?r-1:1/0,a=0;return function(r){return ty(r)?(e.enter(n),function r(i){return ty(i)&&a++<l?(e.consume(i),r):(e.exit(n),t(i))}(r)):t(r)}}let tw={tokenize:function(e){let t,n=e.attempt(this.parser.constructs.contentInitial,function(t){return null===t?void e.consume(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),tj(e,n,"linePrefix"))},function(n){return e.enter("paragraph"),function n(r){let l=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=l),t=l,function t(r){if(null===r){e.exit("chunkText"),e.exit("paragraph"),e.consume(r);return}return tx(r)?(e.consume(r),e.exit("chunkText"),n):(e.consume(r),t)}(r)}(n)});return n}},tN={tokenize:function(e){let t,n,r,l=this,a=[],i=0;return s;function s(t){if(i<a.length){let n=a[i];return l.containerState=n[1],e.attempt(n[0].continuation,o,c)(t)}return c(t)}function o(e){if(i++,l.containerState._closeFlow){let n;l.containerState._closeFlow=void 0,t&&g();let r=l.events.length,a=r;for(;a--;)if("exit"===l.events[a][0]&&"chunkFlow"===l.events[a][1].type){n=l.events[a][1].end;break}x(i);let s=r;for(;s<l.events.length;)l.events[s][1].end={...n},s++;return ti(l.events,a+1,0,l.events.slice(r)),l.events.length=s,c(e)}return s(e)}function c(n){if(i===a.length){if(!t)return p(n);if(t.currentConstruct&&t.currentConstruct.concrete)return h(n);l.interrupt=!!(t.currentConstruct&&!t._gfmTableDynamicInterruptHack)}return l.containerState={},e.check(tS,u,d)(n)}function u(e){return t&&g(),x(i),p(e)}function d(e){return l.parser.lazy[l.now().line]=i!==a.length,r=l.now().offset,h(e)}function p(t){return l.containerState={},e.attempt(tS,f,h)(t)}function f(e){return i++,a.push([l.currentConstruct,l.containerState]),p(e)}function h(r){if(null===r){t&&g(),x(0),e.consume(r);return}return t=t||l.parser.flow(l.now()),e.enter("chunkFlow",{_tokenizer:t,contentType:"flow",previous:n}),function t(n){if(null===n){m(e.exit("chunkFlow"),!0),x(0),e.consume(n);return}return tx(n)?(e.consume(n),m(e.exit("chunkFlow")),i=0,l.interrupt=void 0,s):(e.consume(n),t)}(r)}function m(e,a){let s=l.sliceStream(e);if(a&&s.push(null),e.previous=n,n&&(n.next=e),n=e,t.defineSkip(e.start),t.write(s),l.parser.lazy[e.start.line]){let e,n,a=t.events.length;for(;a--;)if(t.events[a][1].start.offset<r&&(!t.events[a][1].end||t.events[a][1].end.offset>r))return;let s=l.events.length,o=s;for(;o--;)if("exit"===l.events[o][0]&&"chunkFlow"===l.events[o][1].type){if(e){n=l.events[o][1].end;break}e=!0}for(x(i),a=s;a<l.events.length;)l.events[a][1].end={...n},a++;ti(l.events,o+1,0,l.events.slice(s)),l.events.length=a}}function x(t){let n=a.length;for(;n-- >t;){let t=a[n];l.containerState=t[1],t[0].exit.call(l,e)}a.length=t}function g(){t.write([null]),n=void 0,t=void 0,l.containerState._closeFlow=void 0}}},tS={tokenize:function(e,t,n){return tj(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},tC={partial:!0,tokenize:function(e,t,n){return function(t){return ty(t)?tj(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||tx(e)?t(e):n(e)}}};class tT{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=null==t?1/0:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){this.setCursor(Math.trunc(e));let r=this.right.splice(this.right.length-(t||0),1/0);return n&&tE(this.left,n),r.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),tE(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),tE(this.right,e.reverse())}setCursor(e){if(e!==this.left.length&&(!(e>this.left.length)||0!==this.right.length)&&(!(e<0)||0!==this.left.length))if(e<this.left.length){let t=this.left.splice(e,1/0);tE(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);tE(this.left,t.reverse())}}}function tE(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function tM(e){let t,n,r,l,a,i,s,o={},c=-1,u=new tT(e);for(;++c<u.length;){for(;c in o;)c=o[c];if(t=u.get(c),c&&"chunkFlow"===t[1].type&&"listItemPrefix"===u.get(c-1)[1].type&&((r=0)<(i=t[1]._tokenizer.events).length&&"lineEndingBlank"===i[r][1].type&&(r+=2),r<i.length&&"content"===i[r][1].type))for(;++r<i.length&&"content"!==i[r][1].type;)"chunkText"===i[r][1].type&&(i[r][1]._isInFirstContentOfListItem=!0,r++);if("enter"===t[0])t[1].contentType&&(Object.assign(o,function(e,t){let n,r,l=e.get(t)[1],a=e.get(t)[2],i=t-1,s=[],o=l._tokenizer;!o&&(o=a.parser[l.contentType](l.start),l._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let c=o.events,u=[],d={},p=-1,f=l,h=0,m=0,x=[0];for(;f;){for(;e.get(++i)[1]!==f;);s.push(i),!f._tokenizer&&(n=a.sliceStream(f),f.next||n.push(null),r&&o.defineSkip(f.start),f._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(n),f._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),r=f,f=f.next}for(f=l;++p<c.length;)"exit"===c[p][0]&&"enter"===c[p-1][0]&&c[p][1].type===c[p-1][1].type&&c[p][1].start.line!==c[p][1].end.line&&(m=p+1,x.push(m),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(o.events=[],f?(f._tokenizer=void 0,f.previous=void 0):x.pop(),p=x.length;p--;){let t=c.slice(x[p],x[p+1]),n=s.pop();u.push([n,n+t.length-1]),e.splice(n,2,t)}for(u.reverse(),p=-1;++p<u.length;)d[h+u[p][0]]=h+u[p][1],h+=u[p][1]-u[p][0]-1;return d}(u,c)),c=o[c],s=!0);else if(t[1]._container){for(r=c,n=void 0;r--;)if("lineEnding"===(l=u.get(r))[1].type||"lineEndingBlank"===l[1].type)"enter"===l[0]&&(n&&(u.get(n)[1].type="lineEndingBlank"),l[1].type="lineEnding",n=r);else if("linePrefix"===l[1].type||"listItemIndent"===l[1].type);else break;n&&(t[1].end={...u.get(n)[1].start},(a=u.slice(n,c)).unshift(t),u.splice(n,c-n+1,a))}}return ti(e,0,1/0,u.slice(0)),!s}let tI={resolve:function(e){return tM(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?l(t):tx(t)?e.check(tA,a,l)(t):(e.consume(t),r)}function l(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function a(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},tA={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),tj(e,l,"linePrefix")};function l(l){if(null===l||tx(l))return n(l);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&"linePrefix"===a[1].type&&a[2].sliceSerialize(a[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}},tP={tokenize:function(e){let t=this,n=e.attempt(tC,function(r){return null===r?void e.consume(r):(e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n)},e.attempt(this.parser.constructs.flowInitial,r,tj(e,e.attempt(this.parser.constructs.flow,r,e.attempt(tI,r)),"linePrefix")));return n;function r(r){return null===r?void e.consume(r):(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n)}}},tR={resolveAll:tF()},tD=tz("string"),tL=tz("text");function tz(e){return{resolveAll:tF("text"===e?tO:void 0),tokenize:function(t){let n=this,r=this.parser.constructs[e],l=t.attempt(r,a,i);return a;function a(e){return o(e)?l(e):i(e)}function i(e){return null===e?void t.consume(e):(t.enter("data"),t.consume(e),s)}function s(e){return o(e)?(t.exit("data"),l(e)):(t.consume(e),s)}function o(e){if(null===e)return!0;let t=r[e],l=-1;if(t)for(;++l<t.length;){let e=t[l];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function tF(e){return function(t,n){let r,l=-1;for(;++l<=t.length;)void 0===r?t[l]&&"data"===t[l][1].type&&(r=l,l++):t[l]&&"data"===t[l][1].type||(l!==r+2&&(t[r][1].end=t[l-1][1].end,t.splice(r+2,l-r-2),l=r+2),r=void 0);return e?e(t,n):t}}function tO(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){let r,l=e[n-1][1],a=t.sliceStream(l),i=a.length,s=-1,o=0;for(;i--;){let e=a[i];if("string"==typeof e){for(s=e.length;32===e.charCodeAt(s-1);)o++,s--;if(s)break;s=-1}else if(-2===e)r=!0,o++;else if(-1===e);else{i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){let a={type:n===e.length||r||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?s:l.start._bufferIndex+s,_index:l.start._index+i,line:l.end.line,column:l.end.column-o,offset:l.end.offset-o},end:{...l.end}};l.end={...a.start},l.start.offset===l.end.offset?Object.assign(l,a):(e.splice(n,0,["enter",a,t],["exit",a,t]),n+=2)}n++}return e}function tB(e){return null===e||tg(e)||tb(e)?1:tv(e)?2:void 0}function t$(e,t,n){let r=[],l=-1;for(;++l<e.length;){let a=e[l].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}let t_={name:"attention",resolveAll:function(e,t){let n,r,l,a,i,s,o,c,u=-1;for(;++u<e.length;)if("enter"===e[u][0]&&"attentionSequence"===e[u][1].type&&e[u][1]._close){for(n=u;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[u][1]).charCodeAt(0)){if((e[n][1]._close||e[u][1]._open)&&(e[u][1].end.offset-e[u][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[u][1].end.offset-e[u][1].start.offset)%3))continue;s=e[n][1].end.offset-e[n][1].start.offset>1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;let d={...e[n][1].end},p={...e[u][1].start};tU(d,-s),tU(p,s),a={type:s>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},i={type:s>1?"strongSequence":"emphasisSequence",start:{...e[u][1].start},end:p},l={type:s>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[u][1].start}},r={type:s>1?"strong":"emphasis",start:{...a.start},end:{...i.end}},e[n][1].end={...a.start},e[u][1].start={...i.end},o=[],e[n][1].end.offset-e[n][1].start.offset&&(o=ts(o,[["enter",e[n][1],t],["exit",e[n][1],t]])),o=ts(o,[["enter",r,t],["enter",a,t],["exit",a,t],["enter",l,t]]),o=ts(o,t$(t.parser.constructs.insideSpan.null,e.slice(n+1,u),t)),o=ts(o,[["exit",l,t],["enter",i,t],["exit",i,t],["exit",r,t]]),e[u][1].end.offset-e[u][1].start.offset?(c=2,o=ts(o,[["enter",e[u][1],t],["exit",e[u][1],t]])):c=0,ti(e,n-1,u-n+3,o),u=n+o.length-c-2;break}}for(u=-1;++u<e.length;)"attentionSequence"===e[u][1].type&&(e[u][1].type="data");return e},tokenize:function(e,t){let n,r=this.parser.constructs.attentionMarkers.null,l=this.previous,a=tB(l);return function(i){return n=i,e.enter("attentionSequence"),function i(s){if(s===n)return e.consume(s),i;let o=e.exit("attentionSequence"),c=tB(s),u=!c||2===c&&a||r.includes(s),d=!a||2===a&&c||r.includes(l);return o._open=!!(42===n?u:u&&(a||!d)),o._close=!!(42===n?d:d&&(c||!u)),t(s)}(i)}}};function tU(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}let tq={continuation:{tokenize:function(e,t,n){let r=this;return function(t){return ty(t)?tj(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):l(t)};function l(r){return e.attempt(tq,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){let r=this;return function(t){if(62===t){let n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),l}return n(t)};function l(n){return ty(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}},tH={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return tm(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}},tV=document.createElement("i");function tW(e){let t="&"+e+";";tV.innerHTML=t;let n=tV.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}let tK={name:"characterReference",tokenize:function(e,t,n){let r,l,a=this,i=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),s};function s(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),o):(e.enter("characterReferenceValue"),r=31,l=tu,c(t))}function o(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),r=6,l=th,c):(e.enter("characterReferenceValue"),r=7,l=tf,c(t))}function c(s){if(59===s&&i){let r=e.exit("characterReferenceValue");return l!==tu||tW(a.sliceSerialize(r))?(e.enter("characterReferenceMarker"),e.consume(s),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(s)}return l(s)&&i++<r?(e.consume(s),c):n(s)}}},tQ={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l)};function l(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},tG={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){let r,l=this,a={partial:!0,tokenize:function(e,t,n){let a=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i};function i(t){return e.enter("codeFencedFence"),ty(t)?tj(e,o,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):o(t)}function o(t){return t===r?(e.enter("codeFencedFenceSequence"),function t(l){return l===r?(a++,e.consume(l),t):a>=s?(e.exit("codeFencedFenceSequence"),ty(l)?tj(e,c,"whitespace")(l):c(l)):n(l)}(t)):n(t)}function c(r){return null===r||tx(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}},i=0,s=0;return function(t){var a;let c;return a=t,i=(c=l.events[l.events.length-1])&&"linePrefix"===c[1].type?c[2].sliceSerialize(c[1],!0).length:0,r=a,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),function t(l){return l===r?(s++,e.consume(l),t):s<3?n(l):(e.exit("codeFencedFenceSequence"),ty(l)?tj(e,o,"whitespace")(l):o(l))}(a)};function o(a){return null===a||tx(a)?(e.exit("codeFencedFence"),l.interrupt?t(a):e.check(tQ,u,h)(a)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),function t(l){return null===l||tx(l)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),o(l)):ty(l)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),tj(e,c,"whitespace")(l)):96===l&&l===r?n(l):(e.consume(l),t)}(a))}function c(t){return null===t||tx(t)?o(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),function t(l){return null===l||tx(l)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),o(l)):96===l&&l===r?n(l):(e.consume(l),t)}(t))}function u(t){return e.attempt(a,h,d)(t)}function d(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),p}function p(t){return i>0&&ty(t)?tj(e,f,"linePrefix",i+1)(t):f(t)}function f(t){return null===t||tx(t)?e.check(tQ,u,h)(t):(e.enter("codeFlowValue"),function t(n){return null===n||tx(n)?(e.exit("codeFlowValue"),f(n)):(e.consume(n),t)}(t))}function h(n){return e.exit("codeFenced"),t(n)}}},tJ={name:"codeIndented",tokenize:function(e,t,n){let r=this;return function(t){return e.enter("codeIndented"),tj(e,l,"linePrefix",5)(t)};function l(t){let l=r.events[r.events.length-1];return l&&"linePrefix"===l[1].type&&l[2].sliceSerialize(l[1],!0).length>=4?function t(n){return null===n?a(n):tx(n)?e.attempt(tX,t,a)(n):(e.enter("codeFlowValue"),function n(r){return null===r||tx(r)?(e.exit("codeFlowValue"),t(r)):(e.consume(r),n)}(n))}(t):n(t)}function a(n){return e.exit("codeIndented"),t(n)}}},tX={partial:!0,tokenize:function(e,t,n){let r=this;return l;function l(t){return r.parser.lazy[r.now().line]?n(t):tx(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l):tj(e,a,"linePrefix",5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&"linePrefix"===a[1].type&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):tx(e)?l(e):n(e)}}};function tZ(e,t,n,r,l,a,i,s,o){let c=o||1/0,u=0;return function(t){return 60===t?(e.enter(r),e.enter(l),e.enter(a),e.consume(t),e.exit(a),d):null===t||32===t||41===t||tp(t)?n(t):(e.enter(r),e.enter(i),e.enter(s),e.enter("chunkString",{contentType:"string"}),h(t))};function d(n){return 62===n?(e.enter(a),e.consume(n),e.exit(a),e.exit(l),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),p(n))}function p(t){return 62===t?(e.exit("chunkString"),e.exit(s),d(t)):null===t||60===t||tx(t)?n(t):(e.consume(t),92===t?f:p)}function f(t){return 60===t||62===t||92===t?(e.consume(t),p):p(t)}function h(l){return!u&&(null===l||41===l||tg(l))?(e.exit("chunkString"),e.exit(s),e.exit(i),e.exit(r),t(l)):u<c&&40===l?(e.consume(l),u++,h):41===l?(e.consume(l),u--,h):null===l||32===l||40===l||tp(l)?n(l):(e.consume(l),92===l?m:h)}function m(t){return 40===t||41===t||92===t?(e.consume(t),h):h(t)}}function tY(e,t,n,r,l,a){let i,s=this,o=0;return function(t){return e.enter(r),e.enter(l),e.consume(t),e.exit(l),e.enter(a),c};function c(d){return o>999||null===d||91===d||93===d&&!i||94===d&&!o&&"_hiddenFootnoteSupport"in s.parser.constructs?n(d):93===d?(e.exit(a),e.enter(l),e.consume(d),e.exit(l),e.exit(r),t):tx(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(t){return null===t||91===t||93===t||tx(t)||o++>999?(e.exit("chunkString"),c(t)):(e.consume(t),i||(i=!ty(t)),92===t?d:u)}function d(t){return 91===t||92===t||93===t?(e.consume(t),o++,u):u(t)}}function t0(e,t,n,r,l,a){let i;return function(t){return 34===t||39===t||40===t?(e.enter(r),e.enter(l),e.consume(t),e.exit(l),i=40===t?41:t,s):n(t)};function s(n){return n===i?(e.enter(l),e.consume(n),e.exit(l),e.exit(r),t):(e.enter(a),o(n))}function o(t){return t===i?(e.exit(a),s(i)):null===t?n(t):tx(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),tj(e,o,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===i||null===t||tx(t)?(e.exit("chunkString"),o(t)):(e.consume(t),92===t?u:c)}function u(t){return t===i||92===t?(e.consume(t),c):c(t)}}function t1(e,t){let n;return function r(l){return tx(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n=!0,r):ty(l)?tj(e,r,n?"linePrefix":"lineSuffix")(l):t(l)}}function t2(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}let t5={partial:!0,tokenize:function(e,t,n){return function(t){return tg(t)?t1(e,r)(t):n(t)};function r(t){return t0(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function l(t){return ty(t)?tj(e,a,"whitespace")(t):a(t)}function a(e){return null===e||tx(e)?t(e):n(e)}}},t3=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],t4=["pre","script","style","textarea"],t6={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(tC,t,n)}}},t9={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return tx(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l):n(t)};function l(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},t8={name:"labelEnd",resolveAll:function(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){let e="labelImage"===r.type?4:2;r.type="data",t+=e}}return e.length!==n.length&&ti(e,0,e.length,n),e},resolveTo:function(e,t){let n,r,l,a,i=e.length,s=0;for(;i--;)if(n=e[i][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[i][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(l){if("enter"===e[i][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=i,"labelLink"!==n.type)){s=2;break}}else"labelEnd"===n.type&&(l=i);let o={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[r][1].start},end:{...e[l][1].end}},u={type:"labelText",start:{...e[r+s+2][1].end},end:{...e[l-2][1].start}};return a=ts(a=[["enter",o,t],["enter",c,t]],e.slice(r+1,r+s+3)),a=ts(a,[["enter",u,t]]),a=ts(a,t$(t.parser.constructs.insideSpan.null,e.slice(r+s+4,l-3),t)),a=ts(a,[["exit",u,t],e[l-2],e[l-1],["exit",c,t]]),a=ts(a,e.slice(l+1)),a=ts(a,[["exit",o,t]]),ti(e,r,e.length,a),e},tokenize:function(e,t,n){let r,l,a=this,i=a.events.length;for(;i--;)if(("labelImage"===a.events[i][1].type||"labelLink"===a.events[i][1].type)&&!a.events[i][1]._balanced){r=a.events[i][1];break}return function(t){return r?r._inactive?u(t):(l=a.parser.defined.includes(t2(a.sliceSerialize({start:r.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),s):n(t)};function s(t){return 40===t?e.attempt(t7,c,l?c:u)(t):91===t?e.attempt(ne,c,l?o:u)(t):l?c(t):u(t)}function o(t){return e.attempt(nt,c,u)(t)}function c(e){return t(e)}function u(e){return r._balanced=!0,n(e)}}},t7={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return tg(t)?t1(e,l)(t):l(t)}function l(t){return 41===t?c(t):tZ(e,a,i,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function a(t){return tg(t)?t1(e,s)(t):c(t)}function i(e){return n(e)}function s(t){return 34===t||39===t||40===t?t0(e,o,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):c(t)}function o(t){return tg(t)?t1(e,c)(t):c(t)}function c(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},ne={tokenize:function(e,t,n){let r=this;return function(t){return tY.call(r,e,l,a,"reference","referenceMarker","referenceString")(t)};function l(e){return r.parser.defined.includes(t2(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function a(e){return n(e)}}},nt={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}},nn={name:"labelStartImage",resolveAll:t8.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),l};function l(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),a):n(t)}function a(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},nr={name:"labelStartLink",resolveAll:t8.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),l};function l(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},nl={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),tj(e,t,"linePrefix")}}},na={name:"thematicBreak",tokenize:function(e,t,n){let r,l=0;return function(a){var i;return e.enter("thematicBreak"),r=i=a,function a(i){return i===r?(e.enter("thematicBreakSequence"),function t(n){return n===r?(e.consume(n),l++,t):(e.exit("thematicBreakSequence"),ty(n)?tj(e,a,"whitespace")(n):a(n))}(i)):l>=3&&(null===i||tx(i))?(e.exit("thematicBreak"),t(i)):n(i)}(i)}}},ni={continuation:{tokenize:function(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(tC,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,tj(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){return r.containerState.furtherBlankLines||!ty(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(no,t,l)(n))});function l(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,tj(e,e.attempt(ni,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){let r=this,l=r.events[r.events.length-1],a=l&&"linePrefix"===l[1].type?l[2].sliceSerialize(l[1],!0).length:0,i=0;return function(t){let l=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===l?!r.containerState.marker||t===r.containerState.marker:tf(t)){if(r.containerState.type||(r.containerState.type=l,e.enter(l,{_container:!0})),"listUnordered"===l)return e.enter("listItemPrefix"),42===t||45===t?e.check(na,n,s)(t):s(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),function t(l){return tf(l)&&++i<10?(e.consume(l),t):(!r.interrupt||i<2)&&(r.containerState.marker?l===r.containerState.marker:41===l||46===l)?(e.exit("listItemValue"),s(l)):n(l)}(t)}return n(t)};function s(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(tC,r.interrupt?n:o,e.attempt(ns,u,c))}function o(e){return r.containerState.initialBlankLine=!0,a++,u(e)}function c(t){return ty(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),u):n(t)}function u(n){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},ns={partial:!0,tokenize:function(e,t,n){let r=this;return tj(e,function(e){let l=r.events[r.events.length-1];return!ty(e)&&l&&"listItemPrefixWhitespace"===l[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},no={partial:!0,tokenize:function(e,t,n){let r=this;return tj(e,function(e){let l=r.events[r.events.length-1];return l&&"listItemIndent"===l[1].type&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}},nc={name:"setextUnderline",resolveTo:function(e,t){let n,r,l,a=e.length;for(;a--;)if("enter"===e[a][0]){if("content"===e[a][1].type){n=a;break}"paragraph"===e[a][1].type&&(r=a)}else"content"===e[a][1].type&&e.splice(a,1),l||"definition"!==e[a][1].type||(l=a);let i={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",l?(e.splice(r,0,["enter",i,t]),e.splice(l+1,0,["exit",e[n][1],t]),e[n][1].end={...e[l][1].end}):e[n][1]=i,e.push(["exit",i,t]),e},tokenize:function(e,t,n){let r,l=this;return function(t){var i;let s,o=l.events.length;for(;o--;)if("lineEnding"!==l.events[o][1].type&&"linePrefix"!==l.events[o][1].type&&"content"!==l.events[o][1].type){s="paragraph"===l.events[o][1].type;break}return!l.parser.lazy[l.now().line]&&(l.interrupt||s)?(e.enter("setextHeadingLine"),r=t,i=t,e.enter("setextHeadingLineSequence"),function t(n){return n===r?(e.consume(n),t):(e.exit("setextHeadingLineSequence"),ty(n)?tj(e,a,"lineSuffix")(n):a(n))}(i)):n(t)};function a(r){return null===r||tx(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};e.s(["attentionMarkers",0,{null:[42,95]},"contentInitial",0,{91:{name:"definition",tokenize:function(e,t,n){let r,l=this;return function(t){var r;return e.enter("definition"),r=t,tY.call(l,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(r)};function a(t){return(r=t2(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)),58===t)?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),i):n(t)}function i(t){return tg(t)?t1(e,s)(t):s(t)}function s(t){return tZ(e,o,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function o(t){return e.attempt(t5,c,c)(t)}function c(t){return ty(t)?tj(e,u,"whitespace")(t):u(t)}function u(a){return null===a||tx(a)?(e.exit("definition"),l.parser.defined.push(r),t(a)):n(a)}}}},"disable",0,{null:[]},"document",0,{42:ni,43:ni,45:ni,48:ni,49:ni,50:ni,51:ni,52:ni,53:ni,54:ni,55:ni,56:ni,57:ni,62:tq},"flow",0,{35:{name:"headingAtx",resolve:function(e,t){let n,r,l=e.length-2,a=3;return"whitespace"===e[3][1].type&&(a+=2),l-2>a&&"whitespace"===e[l][1].type&&(l-=2),"atxHeadingSequence"===e[l][1].type&&(a===l-1||l-4>a&&"whitespace"===e[l-2][1].type)&&(l-=a+1===l?2:4),l>a&&(n={type:"atxHeadingText",start:e[a][1].start,end:e[l][1].end},r={type:"chunkText",start:e[a][1].start,end:e[l][1].end,contentType:"text"},ti(e,a,l-a+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e},tokenize:function(e,t,n){let r=0;return function(l){var a;return e.enter("atxHeading"),a=l,e.enter("atxHeadingSequence"),function l(a){return 35===a&&r++<6?(e.consume(a),l):null===a||tg(a)?(e.exit("atxHeadingSequence"),function n(r){return 35===r?(e.enter("atxHeadingSequence"),function t(r){return 35===r?(e.consume(r),t):(e.exit("atxHeadingSequence"),n(r))}(r)):null===r||tx(r)?(e.exit("atxHeading"),t(r)):ty(r)?tj(e,n,"whitespace")(r):(e.enter("atxHeadingText"),function t(r){return null===r||35===r||tg(r)?(e.exit("atxHeadingText"),n(r)):(e.consume(r),t)}(r))}(a)):n(a)}(a)}}},42:na,45:[nc,na],60:{concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},tokenize:function(e,t,n){let r,l,a,i,s,o=this;return function(t){var n;return n=t,e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(n),c};function c(i){return 33===i?(e.consume(i),u):47===i?(e.consume(i),l=!0,f):63===i?(e.consume(i),r=3,o.interrupt?t:P):tc(i)?(e.consume(i),a=String.fromCharCode(i),h):n(i)}function u(l){return 45===l?(e.consume(l),r=2,d):91===l?(e.consume(l),r=5,i=0,p):tc(l)?(e.consume(l),r=4,o.interrupt?t:P):n(l)}function d(r){return 45===r?(e.consume(r),o.interrupt?t:P):n(r)}function p(r){let l="CDATA[";return r===l.charCodeAt(i++)?(e.consume(r),i===l.length)?o.interrupt?t:N:p:n(r)}function f(t){return tc(t)?(e.consume(t),a=String.fromCharCode(t),h):n(t)}function h(i){if(null===i||47===i||62===i||tg(i)){let s=47===i,c=a.toLowerCase();return!s&&!l&&t4.includes(c)?(r=1,o.interrupt?t(i):N(i)):t3.includes(a.toLowerCase())?(r=6,s)?(e.consume(i),m):o.interrupt?t(i):N(i):(r=7,o.interrupt&&!o.parser.lazy[o.now().line]?n(i):l?function t(n){return ty(n)?(e.consume(n),t):j(n)}(i):x(i))}return 45===i||tu(i)?(e.consume(i),a+=String.fromCharCode(i),h):n(i)}function m(r){return 62===r?(e.consume(r),o.interrupt?t:N):n(r)}function x(t){return 47===t?(e.consume(t),j):58===t||95===t||tc(t)?(e.consume(t),g):ty(t)?(e.consume(t),x):j(t)}function g(t){return 45===t||46===t||58===t||95===t||tu(t)?(e.consume(t),g):y(t)}function y(t){return 61===t?(e.consume(t),v):ty(t)?(e.consume(t),y):x(t)}function v(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),s=t,b):ty(t)?(e.consume(t),v):function t(n){return null===n||34===n||39===n||47===n||60===n||61===n||62===n||96===n||tg(n)?y(n):(e.consume(n),t)}(t)}function b(t){return t===s?(e.consume(t),s=null,k):null===t||tx(t)?n(t):(e.consume(t),b)}function k(e){return 47===e||62===e||ty(e)?x(e):n(e)}function j(t){return 62===t?(e.consume(t),w):n(t)}function w(t){return null===t||tx(t)?N(t):ty(t)?(e.consume(t),w):n(t)}function N(t){return 45===t&&2===r?(e.consume(t),E):60===t&&1===r?(e.consume(t),M):62===t&&4===r?(e.consume(t),R):63===t&&3===r?(e.consume(t),P):93===t&&5===r?(e.consume(t),A):tx(t)&&(6===r||7===r)?(e.exit("htmlFlowData"),e.check(t6,D,S)(t)):null===t||tx(t)?(e.exit("htmlFlowData"),S(t)):(e.consume(t),N)}function S(t){return e.check(t9,C,D)(t)}function C(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),T}function T(t){return null===t||tx(t)?S(t):(e.enter("htmlFlowData"),N(t))}function E(t){return 45===t?(e.consume(t),P):N(t)}function M(t){return 47===t?(e.consume(t),a="",I):N(t)}function I(t){if(62===t){let n=a.toLowerCase();return t4.includes(n)?(e.consume(t),R):N(t)}return tc(t)&&a.length<8?(e.consume(t),a+=String.fromCharCode(t),I):N(t)}function A(t){return 93===t?(e.consume(t),P):N(t)}function P(t){return 62===t?(e.consume(t),R):45===t&&2===r?(e.consume(t),P):N(t)}function R(t){return null===t||tx(t)?(e.exit("htmlFlowData"),D(t)):(e.consume(t),R)}function D(n){return e.exit("htmlFlow"),t(n)}}},61:nc,95:na,96:tG,126:tG},"flowInitial",0,{[-2]:tJ,[-1]:tJ,32:tJ},"insideSpan",0,{null:[t_,tR]},"string",0,{38:tK,92:tH},"text",0,{[-5]:nl,[-4]:nl,[-3]:nl,33:nn,38:tK,42:t_,60:[{name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l};function l(t){return tc(t)?(e.consume(t),a):64===t?n(t):s(t)}function a(t){return 43===t||45===t||46===t||tu(t)?(r=1,function t(n){return 58===n?(e.consume(n),r=0,i):(43===n||45===n||46===n||tu(n))&&r++<32?(e.consume(n),t):(r=0,s(n))}(t)):s(t)}function i(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||tp(r)?n(r):(e.consume(r),i)}function s(t){return 64===t?(e.consume(t),o):td(t)?(e.consume(t),s):n(t)}function o(l){return tu(l)?function l(a){return 46===a?(e.consume(a),r=0,o):62===a?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(a),e.exit("autolinkMarker"),e.exit("autolink"),t):function t(a){if((45===a||tu(a))&&r++<63){let n=45===a?t:l;return e.consume(a),n}return n(a)}(a)}(l):n(l)}}},{name:"htmlText",tokenize:function(e,t,n){let r,l,a,i=this;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),s};function s(t){return 33===t?(e.consume(t),o):47===t?(e.consume(t),b):63===t?(e.consume(t),y):tc(t)?(e.consume(t),j):n(t)}function o(t){return 45===t?(e.consume(t),c):91===t?(e.consume(t),l=0,f):tc(t)?(e.consume(t),g):n(t)}function c(t){return 45===t?(e.consume(t),p):n(t)}function u(t){return null===t?n(t):45===t?(e.consume(t),d):tx(t)?(a=u,I(t)):(e.consume(t),u)}function d(t){return 45===t?(e.consume(t),p):u(t)}function p(e){return 62===e?M(e):45===e?d(e):u(e)}function f(t){let r="CDATA[";return t===r.charCodeAt(l++)?(e.consume(t),l===r.length?h:f):n(t)}function h(t){return null===t?n(t):93===t?(e.consume(t),m):tx(t)?(a=h,I(t)):(e.consume(t),h)}function m(t){return 93===t?(e.consume(t),x):h(t)}function x(t){return 62===t?M(t):93===t?(e.consume(t),x):h(t)}function g(t){return null===t||62===t?M(t):tx(t)?(a=g,I(t)):(e.consume(t),g)}function y(t){return null===t?n(t):63===t?(e.consume(t),v):tx(t)?(a=y,I(t)):(e.consume(t),y)}function v(e){return 62===e?M(e):y(e)}function b(t){return tc(t)?(e.consume(t),k):n(t)}function k(t){return 45===t||tu(t)?(e.consume(t),k):function t(n){return tx(n)?(a=t,I(n)):ty(n)?(e.consume(n),t):M(n)}(t)}function j(t){return 45===t||tu(t)?(e.consume(t),j):47===t||62===t||tg(t)?w(t):n(t)}function w(t){return 47===t?(e.consume(t),M):58===t||95===t||tc(t)?(e.consume(t),N):tx(t)?(a=w,I(t)):ty(t)?(e.consume(t),w):M(t)}function N(t){return 45===t||46===t||58===t||95===t||tu(t)?(e.consume(t),N):function t(n){return 61===n?(e.consume(n),S):tx(n)?(a=t,I(n)):ty(n)?(e.consume(n),t):w(n)}(t)}function S(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),r=t,C):tx(t)?(a=S,I(t)):ty(t)?(e.consume(t),S):(e.consume(t),T)}function C(t){return t===r?(e.consume(t),r=void 0,E):null===t?n(t):tx(t)?(a=C,I(t)):(e.consume(t),C)}function T(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||tg(t)?w(t):(e.consume(t),T)}function E(e){return 47===e||62===e||tg(e)?w(e):n(e)}function M(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function I(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),A}function A(t){return ty(t)?tj(e,P,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):P(t)}function P(t){return e.enter("htmlTextData"),a(t)}}}],91:nr,92:[{name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return tx(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}},tH],93:t8,95:t_,96:{name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,l=3;if(("lineEnding"===e[3][1].type||"space"===e[l][1].type)&&("lineEnding"===e[r][1].type||"space"===e[r][1].type)){for(t=l;++t<r;)if("codeTextData"===e[t][1].type){e[l][1].type="codeTextPadding",e[r][1].type="codeTextPadding",l+=2,r-=2;break}}for(t=l-1,r++;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):(t===r||"lineEnding"===e[t][1].type)&&(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,l,a=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),function t(n){return 96===n?(e.consume(n),a++,t):(e.exit("codeTextSequence"),i(n))}(t)};function i(o){return null===o?n(o):32===o?(e.enter("space"),e.consume(o),e.exit("space"),i):96===o?(l=e.enter("codeTextSequence"),r=0,function n(i){return 96===i?(e.consume(i),r++,n):r===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(i)):(l.type="codeTextData",s(i))}(o)):tx(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):(e.enter("codeTextData"),s(o))}function s(t){return null===t||32===t||96===t||tx(t)?(e.exit("codeTextData"),i(t)):(e.consume(t),s)}}}}],19210);var nu=e.i(19210);let nd=/[\0\t\n\r]/g;function np(e,t){let n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(65535&n)==65535||(65535&n)==65534||n>1114111?"�":String.fromCodePoint(n)}let nf=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function nh(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){let e=n.charCodeAt(1),t=120===e||88===e;return np(n.slice(t?2:1),t?16:10)}return tW(n)||e}let nm={}.hasOwnProperty;function nx(e){return{line:e.line,column:e.column,offset:e.offset}}function ng(e,t){if(e)throw Error("Cannot close `"+e.type+"` ("+eQ({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+eQ({start:t.start,end:t.end})+") is open");throw Error("Cannot close document, a token (`"+t.type+"`, "+eQ({start:t.start,end:t.end})+") is still open")}function ny(e){let t=this;t.parser=function(n){var r,l;let a,i,s,o;return"object"==typeof(r={...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})&&(l=r,r=void 0),(function(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:r(g),autolinkProtocol:c,autolinkEmail:c,atxHeading:r(h),blockQuote:r(function(){return{type:"blockquote",children:[]}}),characterEscape:c,characterReference:c,codeFenced:r(f),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:r(f,l),codeText:r(function(){return{type:"inlineCode",value:""}},l),codeTextData:c,data:c,codeFlowValue:c,definition:r(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:r(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:r(m),hardBreakTrailing:r(m),htmlFlow:r(x,l),htmlFlowData:c,htmlText:r(x,l),htmlTextData:c,image:r(function(){return{type:"image",title:null,url:"",alt:null}}),label:l,link:r(g),listItem:r(function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}),listItemValue:function(e){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:r(y,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:r(y),paragraph:r(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:r(h),strong:r(function(){return{type:"strong",children:[]}}),thematicBreak:r(function(){return{type:"thematicBreak"}})},exit:{atxHeading:i(),atxHeadingSequence:function(e){let t=this.stack[this.stack.length-1];t.depth||(t.depth=this.sliceSerialize(e).length)},autolink:i(),autolinkEmail:function(e){u.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){u.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:i(),characterEscapeValue:u,characterReferenceMarkerHexadecimal:p,characterReferenceMarkerNumeric:p,characterReferenceValue:function(e){let t,n=this.sliceSerialize(e),r=this.data.characterReferenceType;r?(t=np(n,"characterReferenceMarkerNumeric"===r?10:16),this.data.characterReferenceType=void 0):t=tW(n);let l=this.stack[this.stack.length-1];l.value+=t},characterReference:function(e){this.stack.pop().position.end=nx(e.end)},codeFenced:i(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){let e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){let e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:u,codeIndented:i(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:i(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:u,data:u,definition:i(),definitionDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=t2(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:i(),hardBreakEscape:i(d),hardBreakTrailing:i(d),htmlFlow:i(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:u,htmlText:i(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:u,image:i(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),label:function(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,"link"===n.type?n.children=e.children:n.alt=t},labelText:function(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=t.replace(nf,nh),n.identifier=t2(t).toLowerCase()},lineEnding:function(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){n.children[n.children.length-1].position.end=nx(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(c.call(this,e),u.call(this,e))},link:i(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),listItem:i(),listOrdered:i(),listUnordered:i(),paragraph:i(),referenceString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=t2(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){this.data.inReference=void 0},setextHeading:i(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:i(),thematicBreak:i()}};!function e(t,n){let r=-1;for(;++r<n.length;){let l=n[r];Array.isArray(l)?e(t,l):function(e,t){let n;for(n in t)if(nm.call(t,n))switch(n){case"canContainEols":{let r=t[n];r&&e[n].push(...r);break}case"transforms":{let r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{let r=t[n];r&&Object.assign(e[n],r)}}}(t,l)}}(t,(e||{}).mdastExtensions||[]);let n={};return function(e){let r={type:"root",children:[]},i={stack:[r],tokenStack:[],config:t,enter:a,exit:s,buffer:l,resume:o,data:n},c=[],u=-1;for(;++u<e.length;)("listOrdered"===e[u][1].type||"listUnordered"===e[u][1].type)&&("enter"===e[u][0]?c.push(u):u=function(e,t,n){let r,l,a,i,s=t-1,o=-1,c=!1;for(;++s<=n;){let t=e[s];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?o++:o--,i=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!r||i||o||a||(a=s),i=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:i=void 0}if(!o&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===o&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let i=s;for(l=void 0;i--;){let t=e[i];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;l&&(e[l][1].type="lineEndingBlank",c=!0),t[1].type="lineEnding",l=i}else if("linePrefix"===t[1].type||"blockQuotePrefix"===t[1].type||"blockQuotePrefixWhitespace"===t[1].type||"blockQuoteMarker"===t[1].type||"listItemIndent"===t[1].type);else break}a&&(!l||a<l)&&(r._spread=!0),r.end=Object.assign({},l?e[l][1].start:t[1].end),e.splice(l||s,0,["exit",r,t[2]]),s++,n++}if("listItemPrefix"===t[1].type){let l={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=l,e.splice(s,0,["enter",l,t[2]]),s++,n++,a=void 0,i=!0}}}return e[t][1]._spread=c,n}(e,c.pop(),u));for(u=-1;++u<e.length;){let n=t[e[u][0]];nm.call(n,e[u][1].type)&&n[e[u][1].type].call(Object.assign({sliceSerialize:e[u][2].sliceSerialize},i),e[u][1])}if(i.tokenStack.length>0){let e=i.tokenStack[i.tokenStack.length-1];(e[1]||ng).call(i,void 0,e[0])}for(r.position={start:nx(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:nx(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},u=-1;++u<t.transforms.length;)r=t.transforms[u](r)||r;return r};function r(e,t){return function(n){a.call(this,e(n),n),t&&t.call(this,n)}}function l(){this.stack.push({type:"fragment",children:[]})}function a(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:nx(t.start),end:void 0}}function i(e){return function(t){e&&e.call(this,t),s.call(this,t)}}function s(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||ng).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+eQ({start:e.start,end:e.end})+"): it’s not open");n.position.end=nx(e.end)}function o(){var e;return e=this.stack.pop(),tl(e,"boolean"!=typeof tr.includeImageAlt||tr.includeImageAlt,"boolean"!=typeof tr.includeHtml||tr.includeHtml)}function c(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&"text"===n.type||((n={type:"text",value:""}).position={start:nx(e.start),end:void 0},t.push(n)),this.stack.push(n)}function u(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=nx(e.end)}function d(){this.data.atHardBreak=!0}function p(e){this.data.characterReferenceType=e.type}function f(){return{type:"code",lang:null,meta:null,value:""}}function h(){return{type:"heading",depth:0,children:[]}}function m(){return{type:"break"}}function x(){return{type:"html",value:""}}function g(){return{type:"link",title:null,url:"",children:[]}}function y(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}})(l)(function(e){for(;!tM(e););return e}((function(e){let t={constructs:function(e){let t={},n=-1;for(;++n<e.length;)!function(e,t){let n;for(n in t){let r,l=(to.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];if(a)for(r in a){to.call(l,r)||(l[r]=[]);let e=a[r];!function(e,t){let n=-1,r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);ti(e,0,0,r)}(l[r],Array.isArray(e)?e:e?[e]:[])}}}(t,e[n]);return t}([nu,...(e||{}).extensions||[]]),content:n(tw),defined:[],document:n(tN),flow:n(tP),lazy:{},string:n(tD),text:n(tL)};return t;function n(e){return function(n){return function(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},l={},a=[],i=[],s=[],o={attempt:h(function(e,t){m(e,t.from)}),check:h(f),consume:function(e){tx(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,x()):-1!==e&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===i[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=e},enter:function(e,t){let n=t||{};return n.type=e,n.start=p(),c.events.push(["enter",n,c]),s.push(n),n},exit:function(e){let t=s.pop();return t.end=p(),c.events.push(["exit",t,c]),t},interrupt:h(f,{interrupt:!0})},c={code:null,containerState:{},defineSkip:function(e){l[e.line]=e.column,x()},events:[],now:p,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n,r=-1,l=[];for(;++r<e.length;){let a,i=e[r];if("string"==typeof i)a=i;else switch(i){case -5:a="\r";break;case -4:a="\n";break;case -3:a="\r\n";break;case -2:a=t?" ":" ";break;case -1:if(!t&&n)continue;a=" ";break;default:a=String.fromCharCode(i)}n=-2===i,l.push(a)}return l.join("")}(d(e),t)},sliceStream:d,write:function(e){return(i=ts(i,e),function(){let e;for(;r._index<i.length;){let n=i[r._index];if("string"==typeof n)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<n.length;){var t;t=n.charCodeAt(r._bufferIndex),u=u(t)}else u=u(n)}}(),null!==i[i.length-1])?[]:(m(t,0),c.events=t$(a,c.events,c),c.events)}},u=t.tokenize.call(c,o);return t.resolveAll&&a.push(t),c;function d(e){return function(e,t){let n,r=t.start._index,l=t.start._bufferIndex,a=t.end._index,i=t.end._bufferIndex;if(r===a)n=[e[r].slice(l,i)];else{if(n=e.slice(r,a),l>-1){let e=n[0];"string"==typeof e?n[0]=e.slice(l):n.shift()}i>0&&n.push(e[a].slice(0,i))}return n}(i,e)}function p(){let{_bufferIndex:e,_index:t,line:n,column:l,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:l,offset:a}}function f(e,t){t.restore()}function h(e,t){return function(n,l,a){var i;let u,d,f,h;return Array.isArray(n)?m(n):"tokenize"in n?m([n]):(i=n,function(e){let t=null!==e&&i[e],n=null!==e&&i.null;return m([...Array.isArray(t)?t:t?[t]:[],...Array.isArray(n)?n:n?[n]:[]])(e)});function m(e){return(u=e,d=0,0===e.length)?a:g(e[d])}function g(e){return function(n){let l,a,i,u,d;return(l=p(),a=c.previous,i=c.currentConstruct,u=c.events.length,d=Array.from(s),h={from:u,restore:function(){r=l,c.previous=a,c.currentConstruct=i,c.events.length=u,s=d,x()}},f=e,e.partial||(c.currentConstruct=e),e.name&&c.parser.constructs.disable.null.includes(e.name))?v(n):e.tokenize.call(t?Object.assign(Object.create(c),t):c,o,y,v)(n)}}function y(t){return e(f,h),l}function v(e){return(h.restore(),++d<u.length)?g(u[d]):a}}}function m(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&ti(c.events,t,c.events.length-t,e.resolve(c.events.slice(t),c)),e.resolveTo&&(c.events=e.resolveTo(c.events,c))}function x(){r.line in l&&r.column<2&&(r.column=l[r.line],r.offset+=l[r.line]-1)}}(t,e,n)}}})(l).document().write((i=1,s="",o=!0,function(e,t,n){let r,l,c,u,d,p=[];for(e=s+("string"==typeof e?e.toString():new TextDecoder(t||void 0).decode(e)),c=0,s="",o&&(65279===e.charCodeAt(0)&&c++,o=void 0);c<e.length;){if(nd.lastIndex=c,u=(r=nd.exec(e))&&void 0!==r.index?r.index:e.length,d=e.charCodeAt(u),!r){s=e.slice(c);break}if(10===d&&c===u&&a)p.push(-3),a=void 0;else switch(a&&(p.push(-5),a=void 0),c<u&&(p.push(e.slice(c,u)),i+=u-c),d){case 0:p.push(65533),i++;break;case 9:for(l=4*Math.ceil(i/4),p.push(-2);i++<l;)p.push(-1);break;case 10:p.push(-4),i=1;break;default:a=!0,i=1}c=u+1}return n&&(a&&p.push(-5),s&&p.push(s),p.push(null)),p})(n,r,!0))))}}let nv="object"==typeof self?self:globalThis,nb=e=>{var t;let n,r;return(t=new Map,n=(e,n)=>(t.set(n,e),e),r=l=>{if(t.has(l))return t.get(l);let[a,i]=e[l];switch(a){case 0:case -1:return n(i,l);case 1:{let e=n([],l);for(let t of i)e.push(r(t));return e}case 2:{let e=n({},l);for(let[t,n]of i)e[r(t)]=r(n);return e}case 3:return n(new Date(i),l);case 4:{let{source:e,flags:t}=i;return n(new RegExp(e,t),l)}case 5:{let e=n(new Map,l);for(let[t,n]of i)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,l);for(let t of i)e.add(r(t));return e}case 7:{let{name:e,message:t}=i;return n(new nv[e](t),l)}case 8:return n(BigInt(i),l);case"BigInt":return n(Object(BigInt(i)),l);case"ArrayBuffer":return n(new Uint8Array(i).buffer,i);case"DataView":{let{buffer:e}=new Uint8Array(i);return n(new DataView(e),i)}}return n(new nv[a](i),l)})(0)},{toString:nk}={},{keys:nj}=Object,nw=e=>{let t=typeof e;if("object"!==t||!e)return[0,t];let n=nk.call(e).slice(8,-1);switch(n){case"Array":return[1,""];case"Object":return[2,""];case"Date":return[3,""];case"RegExp":return[4,""];case"Map":return[5,""];case"Set":return[6,""];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},nN=([e,t])=>0===e&&("function"===t||"symbol"===t),nS=(e,{json:t,lossy:n}={})=>{var r,l,a;let i,s,o=[];return(r=!(t||n),l=!!t,a=new Map,i=(e,t)=>{let n=o.push(e)-1;return a.set(t,n),n},s=e=>{if(a.has(e))return a.get(e);let[t,n]=nw(e);switch(t){case 0:{let l=e;switch(n){case"bigint":t=8,l=e.toString();break;case"function":case"symbol":if(r)throw TypeError("unable to serialize "+n);l=null;break;case"undefined":return i([-1],e)}return i([t,l],e)}case 1:{if(n){let t=e;return"DataView"===n?t=new Uint8Array(e.buffer):"ArrayBuffer"===n&&(t=new Uint8Array(e)),i([n,[...t]],e)}let r=[],l=i([t,r],e);for(let t of e)r.push(s(t));return l}case 2:{if(n)switch(n){case"BigInt":return i([n,e.toString()],e);case"Boolean":case"Number":case"String":return i([n,e.valueOf()],e)}if(l&&"toJSON"in e)return s(e.toJSON());let a=[],o=i([t,a],e);for(let t of nj(e))(r||!nN(nw(e[t])))&&a.push([s(t),s(e[t])]);return o}case 3:return i([t,e.toISOString()],e);case 4:{let{source:n,flags:r}=e;return i([t,{source:n,flags:r}],e)}case 5:{let n=[],l=i([t,n],e);for(let[t,l]of e)(r||!(nN(nw(t))||nN(nw(l))))&&n.push([s(t),s(l)]);return l}case 6:{let n=[],l=i([t,n],e);for(let t of e)(r||!nN(nw(t)))&&n.push(s(t));return l}}let{message:o}=e;return i([t,{name:n,message:o}],e)})(e),o},nC="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?nb(nS(e,t)):structuredClone(e):(e,t)=>nb(nS(e,t));function nT(e){let t=[],n=-1,r=0,l=0;for(;++n<e.length;){let a=e.charCodeAt(n),i="";if(37===a&&tu(e.charCodeAt(n+1))&&tu(e.charCodeAt(n+2)))l=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(i=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(i=String.fromCharCode(a,t),l=1):i="�"}else i=String.fromCharCode(a);i&&(t.push(e.slice(r,n),encodeURIComponent(i)),r=n+l+1,i=""),l&&(n+=l,l=0)}return t.join("")+e.slice(r)}function nE(e,t){let n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function nM(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}let nI=function(e){var t,n;if(null==e)return nP;if("function"==typeof e)return nA(e);if("object"==typeof e){return Array.isArray(e)?function(e){let t=[],n=-1;for(;++n<e.length;)t[n]=nI(e[n]);return nA(function(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1})}(e):(t=e,nA(function(e){let n;for(n in t)if(e[n]!==t[n])return!1;return!0}))}if("string"==typeof e){return n=e,nA(function(e){return e&&e.type===n})}throw Error("Expected function, string, or object as test")};function nA(e){return function(t,n,r){return!!(function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function nP(){return!0}let nR=[];function nD(e,t,n,r){var l,a,i;let s,o,c,u,d,p;"function"==typeof t&&"function"!=typeof n?(o=void 0,c=t,s=n):(o=t,c=n,s=r),l=o,a=function(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return c(e,r,n)},i=s,"function"==typeof l&&"function"!=typeof a?(i=a,a=l):u=l,d=nI(u),p=i?-1:1,(function e(t,n,r){let s=t&&"object"==typeof t?t:{};if("string"==typeof s.type){let e="string"==typeof s.tagName?s.tagName:"string"==typeof s.name?s.name:void 0;Object.defineProperty(o,"name",{value:"node ("+t.type+(e?"<"+e+">":"")+")"})}return o;function o(){var s;let o,c,u,f=nR;if((!l||d(t,n,r[r.length-1]||void 0))&&!1===(f=Array.isArray(s=a(t,r))?s:"number"==typeof s?[!0,s]:null==s?nR:[s])[0])return f;if("children"in t&&t.children&&t.children&&"skip"!==f[0])for(c=(i?t.children.length:-1)+p,u=r.concat(t);c>-1&&c<t.children.length;){if(!1===(o=e(t.children[c],c,u)())[0])return o;c="number"==typeof o[1]?o[1]:c+p}return f}})(e,void 0,[])()}function nL(e,t){let n=t.referenceType,r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];let l=e.all(t),a=l[0];a&&"text"===a.type?a.value="["+a.value:l.unshift({type:"text",value:"["});let i=l[l.length-1];return i&&"text"===i.type?i.value+=r:l.push({type:"text",value:r}),l}function nz(e){let t=e.spread;return null==t?e.children.length>1:t}function nF(e,t,n){let r=0,l=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(l-1);for(;9===t||32===t;)l--,t=e.codePointAt(l-1)}return l>r?e.slice(r,l):""}let nO={blockquote:function(e,t){let n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){let n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){let n=t.value?t.value+"\n":"",r={},l=t.lang?t.lang.split(/\s+/):[];l.length>0&&(r.className=["language-"+l[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a={type:"element",tagName:"pre",properties:{},children:[a=e.applyData(t,a)]},e.patch(t,a),a},delete:function(e,t){let n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){let n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){let n,r="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",l=String(t.identifier).toUpperCase(),a=nT(l.toLowerCase()),i=e.footnoteOrder.indexOf(l),s=e.footnoteCounts.get(l);void 0===s?(s=0,e.footnoteOrder.push(l),n=e.footnoteOrder.length):n=i+1,s+=1,e.footnoteCounts.set(l,s);let o={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+a,id:r+"fnref-"+a+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(n)}]};e.patch(t,o);let c={type:"element",tagName:"sup",properties:{},children:[o]};return e.patch(t,c),e.applyData(t,c)},heading:function(e,t){let n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){let n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return nL(e,t);let l={src:nT(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(l.title=r.title);let a={type:"element",tagName:"img",properties:l,children:[]};return e.patch(t,a),e.applyData(t,a)},image:function(e,t){let n={src:nT(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){let n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);let r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return nL(e,t);let l={href:nT(r.url||"")};null!==r.title&&void 0!==r.title&&(l.title=r.title);let a={type:"element",tagName:"a",properties:l,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)},link:function(e,t){let n={href:nT(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){let r=e.all(t),l=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=nz(n[r])}return t}(n):nz(t),a={},i=[];if("boolean"==typeof t.checked){let e,n=r[0];n&&"element"===n.type&&"p"===n.tagName?e=n:(e={type:"element",tagName:"p",properties:{},children:[]},r.unshift(e)),e.children.length>0&&e.children.unshift({type:"text",value:" "}),e.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let s=-1;for(;++s<r.length;){let e=r[s];(l||0!==s||"element"!==e.type||"p"!==e.tagName)&&i.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||l?i.push(e):i.push(...e.children)}let o=r[r.length-1];o&&(l||"element"!==o.type||"p"!==o.tagName)&&i.push({type:"text",value:"\n"});let c={type:"element",tagName:"li",properties:a,children:i};return e.patch(t,c),e.applyData(t,c)},list:function(e,t){let n={},r=e.all(t),l=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++l<r.length;){let e=r[l];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}let a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)},paragraph:function(e,t){let n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){let n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){let n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){let n=e.all(t),r=n.shift(),l=[];if(r){let n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),l.push(n)}if(n.length>0){let r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=eW(t.children[1]),i=eV(t.children[t.children.length-1]);a&&i&&(r.position={start:a,end:i}),l.push(r)}let a={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,a),e.applyData(t,a)},tableCell:function(e,t){let n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){let r=n?n.children:void 0,l=0===(r?r.indexOf(t):1)?"th":"td",a=n&&"table"===n.type?n.align:void 0,i=a?a.length:t.children.length,s=-1,o=[];for(;++s<i;){let n=t.children[s],r={},i=a?a[s]:void 0;i&&(r.align=i);let c={type:"element",tagName:l,properties:r,children:[]};n&&(c.children=e.all(n),e.patch(n,c),c=e.applyData(n,c)),o.push(c)}let c={type:"element",tagName:"tr",properties:{},children:e.wrap(o,!0)};return e.patch(t,c),e.applyData(t,c)},text:function(e,t){let n={type:"text",value:function(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),l=0,a=[];for(;r;)a.push(nF(t.slice(l,r.index),l>0,!0),r[0]),l=r.index+r[0].length,r=n.exec(t);return a.push(nF(t.slice(l),l>0,!1)),a.join("")}(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){let n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:nB,yaml:nB,definition:nB,footnoteDefinition:nB};function nB(){}let n$={}.hasOwnProperty,n_={};function nU(e,t){e.position&&(t.position=function(e){let t=eW(e),n=eV(e);if(t&&n)return{start:t,end:n}}(e))}function nq(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,l=e.data.hProperties;"string"==typeof t&&("element"===n.type?n.tagName=t:n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}),"element"===n.type&&l&&Object.assign(n.properties,nC(l)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function nH(e,t){let n=[],r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function nV(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function nW(e,t){let n,r,l,a,i=(n=t||n_,r=new Map,l=new Map,a={all:function(e){let t=[];if("children"in e){let n=e.children,r=-1;for(;++r<n.length;){let l=a.one(n[r],e);if(l){if(r&&"break"===n[r-1].type&&(Array.isArray(l)||"text"!==l.type||(l.value=nV(l.value)),!Array.isArray(l)&&"element"===l.type)){let e=l.children[0];e&&"text"===e.type&&(e.value=nV(e.value))}Array.isArray(l)?t.push(...l):t.push(l)}}}return t},applyData:nq,definitionById:r,footnoteById:l,footnoteCounts:new Map,footnoteOrder:[],handlers:{...nO,...n.handlers},one:function(e,t){let n=e.type,r=a.handlers[n];if(n$.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if("children"in e){let{children:t,...n}=e,r=nC(n);return r.children=a.all(e),r}return nC(e)}return(a.options.unknownHandler||function(e,t){let n=t.data||{},r="value"in t&&!(n$.call(n,"hProperties")||n$.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)})(a,e,t)},options:n,patch:nU,wrap:nH},nD(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){let t="definition"===e.type?r:l,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a),s=i.one(e,void 0),o=function(e){let t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||nE,r=e.options.footnoteBackLabel||nM,l=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",i=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[],o=-1;for(;++o<e.footnoteOrder.length;){let l=e.footnoteById.get(e.footnoteOrder[o]);if(!l)continue;let a=e.all(l),i=String(l.identifier).toUpperCase(),c=nT(i.toLowerCase()),u=0,d=[],p=e.footnoteCounts.get(i);for(;void 0!==p&&++u<=p;){d.length>0&&d.push({type:"text",value:" "});let e="string"==typeof n?n:n(o,u);"string"==typeof e&&(e={type:"text",value:e}),d.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+c+(u>1?"-"+u:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(o,u),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}let f=a[a.length-1];if(f&&"element"===f.type&&"p"===f.tagName){let e=f.children[f.children.length-1];e&&"text"===e.type?e.value+=" ":f.children.push({type:"text",value:" "}),f.children.push(...d)}else a.push(...d);let h={type:"element",tagName:"li",properties:{id:t+"fn-"+c},children:e.wrap(a,!0)};e.patch(l,h),s.push(h)}if(0!==s.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...nC(i),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:"\n"}]}}(i),c=Array.isArray(s)?{type:"root",children:s}:s||{type:"root",children:[]};return o&&(er("children"in c),c.children.push({type:"text",value:"\n"},o)),c}function nK(e,t){return e&&"run"in e?async function(n,r){let l=nW(n,{file:r,...t});await e.run(l,r)}:function(n,r){return nW(n,{file:r,...e||t})}}function nQ(e){if(e)throw e}var nG=e.i(75609);function nJ(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}let nX=function(e,t){let n;if(void 0!==t&&"string"!=typeof t)throw TypeError('"ext" argument must be a string');n1(e);let r=0,l=-1,a=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;a--;)if(47===e.codePointAt(a)){if(n){r=a+1;break}}else l<0&&(n=!0,l=a+1);return l<0?"":e.slice(r,l)}if(t===e)return"";let i=-1,s=t.length-1;for(;a--;)if(47===e.codePointAt(a)){if(n){r=a+1;break}}else i<0&&(n=!0,i=a+1),s>-1&&(e.codePointAt(a)===t.codePointAt(s--)?s<0&&(l=a):(s=-1,l=i));return r===l?l=i:l<0&&(l=e.length),e.slice(r,l)},nZ=function(e){let t;if(n1(e),0===e.length)return".";let n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},nY=function(e){let t;n1(e);let n=e.length,r=-1,l=0,a=-1,i=0;for(;n--;){let s=e.codePointAt(n);if(47===s){if(t){l=n+1;break}continue}r<0&&(t=!0,r=n+1),46===s?a<0?a=n:1!==i&&(i=1):a>-1&&(i=-1)}return a<0||r<0||0===i||1===i&&a===r-1&&a===l+1?"":e.slice(a,r)},n0=function(...e){var t;let n,r,l,a=-1;for(;++a<e.length;)n1(e[a]),e[a]&&(l=void 0===l?e[a]:l+"/"+e[a]);return void 0===l?".":(n1(t=l),n=47===t.codePointAt(0),0!==(r=function(e,t){let n,r,l="",a=0,i=-1,s=0,o=-1;for(;++o<=e.length;){if(o<e.length)n=e.codePointAt(o);else if(47===n)break;else n=47;if(47===n){if(i===o-1||1===s);else if(i!==o-1&&2===s){if(l.length<2||2!==a||46!==l.codePointAt(l.length-1)||46!==l.codePointAt(l.length-2)){if(l.length>2){if((r=l.lastIndexOf("/"))!==l.length-1){r<0?(l="",a=0):a=(l=l.slice(0,r)).length-1-l.lastIndexOf("/"),i=o,s=0;continue}}else if(l.length>0){l="",a=0,i=o,s=0;continue}}t&&(l=l.length>0?l+"/..":"..",a=2)}else l.length>0?l+="/"+e.slice(i+1,o):l=e.slice(i+1,o),a=o-i-1;i=o,s=0}else 46===n&&s>-1?s++:s=-1}return l}(t,!n)).length||n||(r="."),r.length>0&&47===t.codePointAt(t.length-1)&&(r+="/"),n?"/"+r:r)};function n1(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function n2(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}let n5=["history","path","basename","stem","extname","dirname"];class n3{constructor(e){let t,n;t=e?n2(e)?{path:e}:"string"==typeof e||function(e){return!!(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":"/",this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<n5.length;){const e=n5[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)n5.includes(n)||(this[n]=t[n])}get basename(){return"string"==typeof this.path?nX(this.path):void 0}set basename(e){n6(e,"basename"),n4(e,"basename"),this.path=n0(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?nZ(this.path):void 0}set dirname(e){n9(this.basename,"dirname"),this.path=n0(e||"",this.basename)}get extname(){return"string"==typeof this.path?nY(this.path):void 0}set extname(e){if(n4(e,"extname"),n9(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw Error("`extname` must start with `.`");if(e.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=n0(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){n2(e)&&(e=function(e){if("string"==typeof e)e=new URL(e);else if(!n2(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){let e=TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){let e=TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}let t=e.pathname,n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){let e=t.codePointAt(n+2);if(70===e||102===e){let e=TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}(e)),n6(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?nX(this.path,this.extname):void 0}set stem(e){n6(e,"stem"),n4(e,"stem"),this.path=n0(this.dirname||"",e+(this.extname||""))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new eZ(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(e||void 0).decode(this.value)}}function n4(e,t){if(e&&e.includes("/"))throw Error("`"+t+"` cannot be a path: did not expect `/`")}function n6(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function n9(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}let n8=function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},n7={}.hasOwnProperty;class re extends n8{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=function(){let e=[],t={run:function(...t){let n=-1,r=t.pop();if("function"!=typeof r)throw TypeError("Expected function as last argument, not "+r);!function l(a,...i){let s=e[++n],o=-1;if(a)return void r(a);for(;++o<t.length;)(null===i[o]||void 0===i[o])&&(i[o]=t[o]);t=i,s?(function(e,t){let n;return function(...t){let a,i=e.length>t.length;i&&t.push(r);try{a=e.apply(this,t)}catch(e){if(i&&n)throw e;return r(e)}i||(a&&a.then&&"function"==typeof a.then?a.then(l,r):a instanceof Error?r(a):l(a))};function r(e,...l){n||(n=!0,t(e,...l))}function l(e){r(null,e)}})(s,l)(...i):r(null,...i)}(null,...t)},use:function(n){if("function"!=typeof n)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}()}copy(){let e=new re,t=-1;for(;++t<this.attachers.length;){let n=this.attachers[t];e.use(...n)}return e.data((0,nG.default)(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2==arguments.length?(rl("data",this.frozen),this.namespace[e]=t,this):n7.call(this.namespace,e)&&this.namespace[e]||void 0:e?(rl("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;for(;++this.freezeIndex<this.attachers.length;){let[e,...t]=this.attachers[this.freezeIndex];if(!1===t[0])continue;!0===t[0]&&(t[0]=void 0);let n=e.call(this,...t);"function"==typeof n&&this.transformers.use(n)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=rs(e),n=this.parser||this.Parser;return rn("parse",n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),rn("process",this.parser||this.Parser),rr("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,l){let a=rs(e),i=n.parse(a);function s(e,n){e||!n?l(e):r?r(n):(er(t,"`done` is defined if `resolve` is not"),t(void 0,n))}n.run(i,a,function(e,t,r){var l,a;if(e||!t||!r)return s(e);let i=n.stringify(t,r);"string"==typeof(l=i)||(a=l)&&"object"==typeof a&&"byteLength"in a&&"byteOffset"in a?r.value=i:r.result=i,s(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),rn("processSync",this.parser||this.Parser),rr("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,nQ(e),t=r}),ri("processSync","process",n),er(t,"we either bailed on an error or have a tree"),t}run(e,t,n){ra(e),this.freeze();let r=this.transformers;return n||"function"!=typeof t||(n=t,t=void 0),n?l(void 0,n):new Promise(l);function l(l,a){er("function"!=typeof t,"`file` can’t be a `done` anymore, we checked");let i=rs(t);r.run(e,i,function(t,r,i){let s=r||e;t?a(t):l?l(s):(er(n,"`done` is defined if `resolve` is not"),n(void 0,s,i))})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){nQ(e),n=t,r=!0}),ri("runSync","run",r),er(n,"we either bailed on an error or have a tree"),n}stringify(e,t){this.freeze();let n=rs(t),r=this.compiler||this.Compiler;return rr("stringify",r),ra(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(rl("use",this.frozen),null==e);else if("function"==typeof e)i(e,t);else if("object"==typeof e)Array.isArray(e)?a(e):l(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function l(e){if(!("plugins"in e)&&!("settings"in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(e.plugins),e.settings&&(r.settings=(0,nG.default)(!0,r.settings,e.settings))}function a(e){let t=-1;if(null==e);else if(Array.isArray(e))for(;++t<e.length;)!function(e){if("function"==typeof e)i(e,[]);else if("object"==typeof e)if(Array.isArray(e)){let[t,...n]=e;i(t,n)}else l(e);else throw TypeError("Expected usable value, not `"+e+"`")}(e[t]);else throw TypeError("Expected a list of plugins, not `"+e+"`")}function i(e,t){let r=-1,l=-1;for(;++r<n.length;)if(n[r][0]===e){l=r;break}if(-1===l)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,i=n[l][1];nJ(i)&&nJ(r)&&(r=(0,nG.default)(!0,i,r)),n[l]=[e,r,...a]}}}}let rt=new re().freeze();function rn(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `parser`")}function rr(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `compiler`")}function rl(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ra(e){if(!nJ(e)||"string"!=typeof e.type)throw TypeError("Expected node, got `"+e+"`")}function ri(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function rs(e){var t;return(t=e)&&"object"==typeof t&&"message"in t&&"messages"in t?e:new n3(e)}let ro=[],rc={allowDangerousHtml:!0},ru=/^(https?|ircs?|mailto|xmpp)$/i,rd=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function rp(e){var n;let r,l,a,i,s,o=(r=(n=e).rehypePlugins||ro,l=n.remarkPlugins||ro,a=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...rc}:rc,rt().use(ny).use(l).use(nK,a).use(r)),c=(i=e.children||"",s=new n3,"string"==typeof i?s.value=i:el("Unexpected value `"+i+"` for `children` prop, expected `string`"),s);return function(e,n){let r=n.allowedElements,l=n.allowElement,a=n.components,i=n.disallowedElements,s=n.skipHtml,o=n.unwrapDisallowed,c=n.urlTransform||rf;for(let e of rd)Object.hasOwn(n,e.from)&&el("Unexpected `"+e.from+"` prop, "+(e.to?"use `"+e.to+"` instead":"remove it")+" (see <https://github.com/remarkjs/react-markdown/blob/main/changelog.md#"+e.id+"> for more info)");return r&&i&&el("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other"),nD(e,function(e,t,n){if("raw"===e.type&&n&&"number"==typeof t)return s?n.children.splice(t,1):n.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in tn)if(Object.hasOwn(tn,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=tn[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=c(String(n||""),t,e))}}if("element"===e.type){let a=r?!r.includes(e.tagName):!!i&&i.includes(e.tagName);if(!a&&l&&"number"==typeof t&&(a=!l(e,t,n)),a&&n&&"number"==typeof t)return o&&e.children?n.children.splice(t,1,...e.children):n.children.splice(t,1),t}}),function(e,t){var n,r,l,a;let i;if(!t||void 0===t.Fragment)throw TypeError("Expected `Fragment` in options");let s=t.filePath||void 0;if(t.development){if("function"!=typeof t.jsxDEV)throw TypeError("Expected `jsxDEV` in options when `development: true`");n=s,r=t.jsxDEV,i=function(e,t,l,a){let i=Array.isArray(l.children),s=eW(e);return r(t,l,a,i,{columnNumber:s?s.column-1:void 0,fileName:n,lineNumber:s?s.line:void 0},void 0)}}else{if("function"!=typeof t.jsx)throw TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw TypeError("Expected `jsxs` in production options");l=t.jsx,a=t.jsxs,i=function(e,t,n,r){let i=Array.isArray(n.children)?a:l;return r?i(t,n,r):i(t,n)}}let o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:s,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?eq:eU,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},c=e4(o,e,void 0);return c&&"string"!=typeof c?c:o.create(e,o.Fragment,{children:c||void 0},void 0)}(e,{Fragment:t.Fragment,components:a,ignoreInvalidStyle:!0,jsx:t.jsx,jsxs:t.jsxs,passKeys:!0,passNode:!0})}(o.runSync(o.parse(c),c),e)}function rf(e){let t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),l=e.indexOf("/");return -1===t||-1!==l&&t>l||-1!==n&&t>n||-1!==r&&t>r||ru.test(e.slice(0,t))?e:""}let rh=(0,Q.default)("git-compare-arrows",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]]),rm=(0,Q.default)("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]),rx={p:({children:e})=>(0,t.jsx)("p",{className:"text-muted-foreground mb-2 text-xs leading-relaxed last:mb-0",children:e}),strong:({children:e})=>(0,t.jsx)("strong",{className:"text-foreground font-semibold",children:e}),em:({children:e})=>(0,t.jsx)("em",{className:"italic",children:e}),code:({children:e,className:n})=>n?(0,t.jsx)("code",{className:`${n} text-[11px]`,children:e}):(0,t.jsx)("code",{className:"bg-muted text-foreground rounded-md px-1.5 py-0.5 font-mono text-[11px]",children:e}),pre:({children:e})=>(0,t.jsx)("pre",{className:"bg-muted my-2 overflow-x-auto rounded-lg border p-3",children:e}),ul:({children:e})=>(0,t.jsx)("ul",{className:"text-muted-foreground mb-2 list-disc space-y-1 pl-4 text-xs",children:e}),ol:({children:e})=>(0,t.jsx)("ol",{className:"text-muted-foreground mb-2 list-decimal space-y-1 pl-4 text-xs",children:e}),li:({children:e})=>(0,t.jsx)("li",{className:"leading-relaxed",children:e}),a:({children:e,href:n})=>(0,t.jsx)("a",{href:n,className:"text-primary underline underline-offset-2",target:"_blank",rel:"noopener noreferrer",children:e})};function rg({decision:e,index:r}){let[l,a]=(0,n.useState)(!1),i=(0,j.useSoundAction)("expand"),s=(0,j.useSoundAction)("collapse");return(0,t.jsxs)("div",{className:"border-border rounded-lg border",children:[(0,t.jsxs)("div",{className:"space-y-3 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,t.jsx)("span",{className:"bg-primary text-primary-foreground flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-bold",children:r+1}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h3",{className:"text-foreground text-sm leading-tight font-semibold",children:e.title}),(0,t.jsx)("p",{className:"text-muted-foreground mt-0.5 text-xs",children:e.chosen})]})]}),"decisionName"in e&&e.decisionName?(0,t.jsx)(W.Badge,{variant:"secondary",className:"bg-primary/10 text-primary shrink-0",children:e.decisionName}):null]}),e.rationale?(0,t.jsx)(rp,{components:rx,children:e.rationale}):null]}),e.rejected.length>0?(0,t.jsxs)("div",{className:"border-border border-t",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>{l?s.play():i.play(),a(e=>!e)},className:"text-muted-foreground hover:bg-muted/50 flex w-full items-center gap-1.5 px-4 py-3 text-xs font-medium transition-colors",children:[(0,t.jsx)(H.ChevronRight,{className:`h-3.5 w-3.5 transition-transform ${l?"rotate-90":""}`}),(0,t.jsx)(rm,{className:"h-3.5 w-3.5"}),"Other Options Considered (",e.rejected.length,")"]}),l?(0,t.jsx)("div",{className:"space-y-1.5 px-4 pb-3",children:e.rejected.map(e=>(0,t.jsx)("div",{className:"bg-primary/5 rounded-md px-3 py-2",children:(0,t.jsx)("span",{className:"text-foreground text-xs",children:e})},e))}):null]}):null]})}function ry({data:e}){let{summary:n,decisions:r}=e;return 0===r.length?null:(0,t.jsxs)("div",{className:"space-y-4 p-4",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"mt-1.5 h-2.5 w-2.5 shrink-0 rounded-full bg-blue-500"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("h2",{className:"text-foreground text-sm font-bold",children:"Technical Implementation Plan Review"}),n?(0,t.jsx)("p",{className:"text-muted-foreground mt-1 text-xs leading-relaxed",children:n}):null]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 pt-1",children:[(0,t.jsx)(rh,{className:"text-primary h-4 w-4"}),(0,t.jsx)("h3",{className:"text-foreground text-sm font-bold",children:"Technical Decisions"})]}),r.map((e,n)=>(0,t.jsx)(rg,{decision:e,index:n},e.title))]})}var rv=e.i(41698);function rb({item:e,index:n}){return(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsx)("div",{className:"space-y-2 px-4 py-3",children:(0,t.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,t.jsx)("span",{className:"bg-primary text-primary-foreground flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-bold",children:n+1}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h3",{className:"text-foreground text-sm leading-tight font-semibold",children:e.question}),(0,t.jsxs)("div",{className:"mt-1 flex items-center gap-2",children:[(0,t.jsx)("p",{className:"text-muted-foreground min-w-0 truncate text-xs",children:e.selectedOption}),e.wasRecommended?(0,t.jsx)(W.Badge,{className:"shrink-0 px-1.5 py-0 text-[10px] whitespace-nowrap",children:"AI Recommended"}):null]})]})]})})})}function rk({data:e}){let{questions:n}=e;return 0===n.length?null:(0,t.jsxs)("div",{className:"space-y-4 p-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(rv.ClipboardList,{className:"text-primary h-4 w-4"}),(0,t.jsx)("h3",{className:"text-foreground text-sm font-bold",children:"Product Decisions"})]}),n.map((e,n)=>(0,t.jsx)(rb,{item:e,index:n},e.question))]})}let rj=(0,Q.default)("file-diff",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]]);var rw=e.i(65530),rN=e.i(49228);let rS=(0,Q.default)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),rC=(0,Q.default)("camera",[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);var rT=e.i(70471);let rE=(0,Q.default)("monitor-play",[["path",{d:"M15.033 9.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56V7.648a.645.645 0 0 1 .967-.56z",key:"vbtd3f"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",key:"x3v2xh"}]]);var rM=e.i(81181),rI=e.i(35e3),rA=e.i(30090),rA=rA,rP=e.i(17406);function rR({status:e}){switch(e){case rP.CiStatus.Success:return(0,t.jsxs)(W.Badge,{className:"border-transparent bg-green-50 text-green-700 hover:bg-green-50",children:[(0,t.jsx)(rI.CheckCircle2,{className:"mr-1 h-3.5 w-3.5"}),"Passing"]});case rP.CiStatus.Pending:return(0,t.jsxs)(W.Badge,{className:"border-transparent bg-yellow-50 text-yellow-700 hover:bg-yellow-50",children:[(0,t.jsx)(a.Loader2,{className:"mr-1 h-3.5 w-3.5 animate-spin"}),"Pending"]});case rP.CiStatus.Failure:return(0,t.jsxs)(W.Badge,{className:"border-transparent bg-red-50 text-red-700 hover:bg-red-50",children:[(0,t.jsx)(rA.default,{className:"mr-1 h-3.5 w-3.5"}),"Failing"]})}}let rD=(0,Q.default)("file-plus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]),rL=(0,Q.default)("file-minus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}]]),rz=(0,Q.default)("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]),rF={added:{icon:rD,label:"A",className:"text-green-600"},modified:{icon:rz,label:"M",className:"text-amber-600"},deleted:{icon:rL,label:"D",className:"text-red-600"},renamed:{icon:rz,label:"R",className:"text-blue-600"}};function rO({status:e}){let n=rF[e],r=n.icon;return(0,t.jsx)(r,{className:(0,V.cn)("h-3.5 w-3.5 shrink-0",n.className)})}function rB({hunk:e}){return(0,t.jsxs)("div",{className:"border-border border-t first:border-t-0",children:[(0,t.jsx)("div",{className:"bg-muted/50 text-muted-foreground px-3 py-1 font-mono text-[10px]",children:e.header}),(0,t.jsx)("div",{className:"font-mono text-[11px] leading-[18px]",children:e.lines.map(e=>(0,t.jsxs)("div",{className:(0,V.cn)("flex","added"===e.type&&"bg-green-50 dark:bg-green-950/30","removed"===e.type&&"bg-red-50 dark:bg-red-950/30"),children:[(0,t.jsx)("span",{className:"text-muted-foreground w-10 shrink-0 px-1 text-right text-[10px] select-none",children:e.oldNumber??""}),(0,t.jsx)("span",{className:"text-muted-foreground w-10 shrink-0 px-1 text-right text-[10px] select-none",children:e.newNumber??""}),(0,t.jsx)("span",{className:(0,V.cn)("w-4 shrink-0 text-center select-none","added"===e.type&&"text-green-700 dark:text-green-400","removed"===e.type&&"text-red-700 dark:text-red-400"),children:"added"===e.type?"+":"removed"===e.type?"-":" "}),(0,t.jsx)("span",{className:"min-w-0 flex-1 pr-2 break-all whitespace-pre-wrap",children:e.content})]},`${e.type}-${e.oldNumber??""}-${e.newNumber??""}`))})]})}function r$({file:e}){let[r,l]=(0,n.useState)(!1),a=e.path.split("/").pop()??e.path,i=e.path.includes("/")?e.path.slice(0,e.path.lastIndexOf("/")):"";return(0,t.jsxs)("div",{className:"border-border border-b last:border-b-0",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>l(!r),className:"hover:bg-muted/50 flex w-full items-center gap-2 px-3 py-2 text-left",children:[(0,t.jsx)(H.ChevronRight,{className:(0,V.cn)("text-muted-foreground h-3 w-3 shrink-0 transition-transform duration-150",r&&"rotate-90")}),(0,t.jsx)(rO,{status:e.status}),(0,t.jsx)("span",{className:"text-foreground min-w-0 flex-1 truncate text-xs",children:i?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{className:"text-muted-foreground",children:[i,"/"]}),a]}):a}),e.oldPath?(0,t.jsxs)("span",{className:"text-muted-foreground truncate text-[10px]",children:["← ",e.oldPath.split("/").pop()]}):null,(0,t.jsxs)("span",{className:"shrink-0 text-[10px]",children:[e.additions>0?(0,t.jsxs)("span",{className:"text-green-600",children:["+",e.additions]}):null,e.additions>0&&e.deletions>0?" ":null,e.deletions>0?(0,t.jsxs)("span",{className:"text-red-600",children:["-",e.deletions]}):null]})]}),r&&e.hunks.length>0?(0,t.jsx)("div",{className:"border-border overflow-x-auto border-t",children:e.hunks.map(e=>(0,t.jsx)(rB,{hunk:e},e.header))}):null]})}function r_({fileDiffs:e}){return 0===e.length?null:(0,t.jsxs)("div",{className:"border-border rounded-lg border",children:[(0,t.jsx)("div",{className:"px-4 py-3",children:(0,t.jsxs)("div",{className:"mb-2 flex items-center gap-2",children:[(0,t.jsx)(rT.FileText,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("span",{className:"text-foreground text-xs font-semibold",children:"Changed Files"}),(0,t.jsxs)("span",{className:"text-muted-foreground text-[10px]",children:["(",e.length,")"]})]})}),(0,t.jsx)("div",{className:"border-border border-t",children:e.map(e=>(0,t.jsx)(r$,{file:e},`${e.status}-${e.path}`))})]})}let rU={Screenshot:rC,Video:rE,TestOutput:rT.FileText,TerminalRecording:R.Terminal},rq=new Set([".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp"]),rH=new Set([".mp4",".webm",".mov"]);function rV({evidence:e}){var r,l;let a,[i,s]=(0,n.useState)(!0),o=rU[e.type]??rC,c=(a=(r=e.relativePath).lastIndexOf("."))>=0?r.slice(a).toLowerCase():"",u=(l=e.relativePath,`/api/evidence?path=${encodeURIComponent(l)}`),d="Screenshot"===e.type||rq.has(c),p="Video"===e.type||rH.has(c),f="TestOutput"===e.type||"TerminalRecording"===e.type;return(0,t.jsxs)("li",{className:"border-border rounded-md border",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>s(!i),className:"flex w-full cursor-pointer items-center gap-2.5 px-3 py-2.5 text-left",children:[i?(0,t.jsx)(L.ChevronDown,{className:"text-muted-foreground h-3 w-3 shrink-0"}):(0,t.jsx)(H.ChevronRight,{className:"text-muted-foreground h-3 w-3 shrink-0"}),(0,t.jsx)(o,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"text-foreground text-xs font-medium",children:e.description}),e.taskRef?(0,t.jsxs)("span",{className:"text-muted-foreground ml-1.5 text-[10px]",children:["(",e.taskRef,")"]}):null]}),(0,t.jsx)("a",{href:u,download:!0,onClick:e=>e.stopPropagation(),className:"text-muted-foreground hover:text-foreground shrink-0 rounded p-1 transition-colors","aria-label":"Download",children:(0,t.jsx)(rM.Download,{className:"h-3 w-3"})})]}),i&&u?(0,t.jsx)("div",{className:"border-border border-t px-3 py-2.5",children:d?(0,t.jsx)("img",{src:u,alt:e.description,className:"max-h-80 w-full rounded-md border object-contain",loading:"lazy"}):p?(0,t.jsx)("video",{src:u,controls:!0,className:"max-h-80 w-full rounded-md border",preload:"metadata",children:(0,t.jsx)("track",{kind:"captions"})}):f?(0,t.jsx)(rW,{url:u}):(0,t.jsx)("p",{className:"text-muted-foreground truncate font-mono text-[10px]",children:e.relativePath})}):null,null]})}function rW({url:e}){let[r,l]=(0,n.useState)(null),[a,i]=(0,n.useState)(!1);return a?r?(0,t.jsx)("pre",{className:"bg-muted/50 max-h-60 overflow-auto rounded-md p-3 font-mono text-[11px] leading-relaxed",children:r}):(0,t.jsx)("p",{className:"text-muted-foreground text-[10px]",children:"Unable to load preview"}):(fetch(e).then(e=>e.ok?e.text():Promise.reject(Error("Failed"))).then(e=>{let t=e.split("\n");l(t.length>100?`${t.slice(0,100).join("\n")}
2
- ...`:e)}).catch(()=>l(null)).finally(()=>i(!0)),(0,t.jsx)("div",{className:"bg-muted/50 h-16 animate-pulse rounded-md"}))}function rK({evidence:e}){return(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"px-4 py-3",children:[(0,t.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,t.jsx)(rC,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("span",{className:"text-foreground text-xs font-semibold",children:"Evidence"}),(0,t.jsx)(W.Badge,{variant:"secondary",className:"text-[10px]",children:e.length})]}),(0,t.jsx)("ul",{className:"space-y-2",children:e.map(e=>(0,t.jsx)(rV,{evidence:e},`${e.type}-${e.relativePath}`))})]})})}function rQ({data:e,readOnly:n=!1,onApprove:r,onReject:l,isProcessing:a=!1,isRejecting:i=!1,chatInput:s,onChatInputChange:o}){let{pr:c,diffSummary:u,fileDiffs:d,branch:f,warning:h,evidence:m,hideCiStatus:x}=e,g=c?.mergeable===!1,y=g&&l?()=>l("Resolve merge conflicts",[]):r;return(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsxs)("div",{className:"flex-1 space-y-4 overflow-y-auto p-4",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"mt-1.5 h-2.5 w-2.5 shrink-0 rounded-full bg-emerald-500"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("h2",{className:"text-foreground text-sm font-bold",children:n?"Merge History":"Merge Review"}),(0,t.jsx)("p",{className:"text-muted-foreground mt-1 text-xs leading-relaxed",children:n?"This feature was merged. Review the pull request details and evidence below.":c?"Review the pull request details and approve to merge.":"Review the changes and approve to merge."})]})]}),f?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3",children:[(0,t.jsx)(rN.GitBranch,{className:"text-muted-foreground h-4 w-4 shrink-0"}),(0,t.jsx)(W.Badge,{variant:"secondary",className:"font-mono text-[11px]",children:f.source}),(0,t.jsx)(rS,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}),(0,t.jsx)(W.Badge,{variant:"outline",className:"font-mono text-[11px]",children:f.target})]})}):null,c?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"space-y-3 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("a",{href:c.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary flex items-center gap-1.5 text-sm font-semibold underline underline-offset-2",children:["PR #",c.number,(0,t.jsx)(p.ExternalLink,{className:"h-3.5 w-3.5"})]}),(0,t.jsx)(W.Badge,{variant:"outline",className:"text-xs",children:c.status})]}),!1===c.mergeable?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Merge Status"}),(0,t.jsxs)(W.Badge,{className:"border-transparent bg-orange-50 text-orange-700 hover:bg-orange-50",children:[(0,t.jsx)(J.AlertTriangle,{className:"mr-1 h-3.5 w-3.5"}),"Conflicts"]})]}):null,c.ciStatus&&!0!==x?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"CI Status"}),(0,t.jsx)(rR,{status:c.ciStatus})]}):null,c.commitHash?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Commit"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(rw.GitCommitHorizontal,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,t.jsx)("code",{className:"bg-muted text-foreground rounded-md px-1.5 py-0.5 font-mono text-[11px]",children:c.commitHash.slice(0,7)})]})]}):null]})}):null,u?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"px-4 py-3",children:[(0,t.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,t.jsx)(rj,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("span",{className:"text-foreground text-xs font-semibold",children:"Changes"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-4 gap-3",children:[(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("div",{className:"text-foreground text-sm font-bold",children:u.filesChanged}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"files"})]}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsxs)("div",{className:"text-sm font-bold text-green-600",children:["+",u.additions]}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"additions"})]}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsxs)("div",{className:"text-sm font-bold text-red-600",children:["-",u.deletions]}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"deletions"})]}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("div",{className:"text-foreground text-sm font-bold",children:u.commitCount}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"commits"})]})]})]})}):h?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3",children:[(0,t.jsx)(J.AlertTriangle,{className:"text-muted-foreground h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:h})]})}):null,m&&m.length>0?(0,t.jsx)(rK,{evidence:m}):null,d&&d.length>0?(0,t.jsx)(r_,{fileDiffs:d}):null]}),!n&&(0,t.jsx)(et,{onReject:l,onApprove:y,approveLabel:g?"Resolve Conflicts":"Approve Merge",approveVariant:g?"warning":"default",revisionPlaceholder:"Ask AI to revise before merging...",isProcessing:a,isRejecting:i,chatInput:s,onChatInputChange:o})]})}let rG=(0,Q.default)("file-search",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"11.5",cy:"14.5",r:"2.5",key:"1bq0ko"}],["path",{d:"M13.3 16.3 15 18",key:"2quom7"}]]);var rJ=e.i(38227);let rX=(0,Q.default)("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var rZ=e.i(60253),rY=e.i(53360),r0=e.i(2287),r1=e.i(28267),r2=e.i(80436);let r5=(0,Q.default)("image-off",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]]),r3=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]);function r4(e){let t=e.lastIndexOf(".");return t>=0&&r3.has(e.slice(t).toLowerCase())}function r6(e){let t=e.lastIndexOf(".")>=0?e.slice(e.lastIndexOf(".")):"",n=r4(e)?`image/${t.slice(1).replace("jpg","jpeg")}`:"",r=new URLSearchParams({path:e,...n&&{mimeType:n}});return`/api/attachments/preview?${r.toString()}`}let r9=/(?:^|\s)@(\/[^\s]+)/g;function r8({text:e,attachmentPaths:n}){let r=function(e){let t=[],n=0;for(let r of e.matchAll(r9)){let l=r.index,a=l+(r[0].length-r[0].trimStart().length);a>n&&t.push({type:"text",value:e.slice(n,a)}),t.push({type:"attachment",path:r[1]}),n=l+r[0].length}return n<e.length&&t.push({type:"text",value:e.slice(n)}),t}(e),l=r.some(e=>"attachment"===e.type),a=n?.filter(Boolean)??[];return l||0!==a.length?(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[r.map(e=>{if("text"===e.type){let n=e.value.trim();return n?(0,t.jsx)("span",{className:"text-sm leading-relaxed",children:n},`text-${n.slice(0,40)}`):null}return(0,t.jsx)(r7,{path:e.path},`att-${e.path}`)}),a.map(e=>(0,t.jsx)(r7,{path:e},`extra-${e}`))]}):(0,t.jsx)("span",{className:"text-sm leading-relaxed",children:e})}function r7({path:e}){let r=e.split("/").pop()??e,[l,a]=(0,n.useState)(!1);return r4(e)?l?(0,t.jsxs)("div",{"data-testid":"inline-attachment-image-error",className:"text-muted-foreground flex items-center gap-2 rounded-md border px-3 py-2 text-sm",children:[(0,t.jsx)(r5,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:r})]}):(0,t.jsxs)(r0.Dialog,{children:[(0,t.jsx)(r0.DialogTrigger,{asChild:!0,children:(0,t.jsx)("img",{src:r6(e),alt:r,"data-testid":"inline-attachment-image",onError:()=>a(!0),className:"max-h-48 max-w-full cursor-pointer rounded-md border object-contain transition-opacity hover:opacity-80"})}),(0,t.jsxs)(r0.DialogContent,{className:"max-w-3xl gap-0 overflow-hidden border-0 p-0 [&>button:last-child]:!cursor-pointer [&>button:last-child]:!rounded-full [&>button:last-child]:!bg-black/70 [&>button:last-child]:!p-1.5 [&>button:last-child]:!text-white [&>button:last-child]:!opacity-100 [&>button:last-child]:!shadow-lg [&>button:last-child]:!backdrop-blur-md [&>button:last-child]:hover:!bg-black/90",children:[(0,t.jsx)(r1.VisuallyHidden.Root,{children:(0,t.jsxs)(r0.DialogTitle,{children:["Preview: ",r]})}),(0,t.jsx)("div",{className:"relative bg-black/90",children:(0,t.jsx)("img",{src:r6(e),alt:r,className:"h-auto max-h-[70vh] w-full object-contain"})}),(0,t.jsxs)("div",{className:"bg-background flex items-center gap-3 px-4 py-3",children:[(0,t.jsx)("div",{className:"flex min-w-0 flex-1 flex-col",children:(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:r})}),(0,t.jsx)("a",{href:r6(e),download:r,className:"text-muted-foreground hover:text-foreground shrink-0 cursor-pointer rounded p-1.5 transition-colors","aria-label":`Download ${r}`,children:(0,t.jsx)(r2.DownloadIcon,{className:"h-4 w-4"})})]})]})]}):(0,t.jsx)("a",{href:r6(e),download:r,"data-testid":"inline-attachment-file",className:"text-primary text-sm underline underline-offset-2",children:r})}var le=e.i(25235);let lt=(0,e.i(94237).cva)("inline-block shrink-0",{variants:{size:{sm:"size-5",md:"size-8",lg:"size-12"}},defaultVariants:{size:"md"}}),ln=[{r:9,spline:"0.12 0 0.04 1",opacity:1},{r:8.2,spline:"0.16 0 0.08 1",opacity:.95},{r:7.4,spline:"0.20 0 0.12 1",opacity:.9},{r:6.6,spline:"0.25 0 0.16 1",opacity:.84},{r:5.8,spline:"0.30 0 0.20 1",opacity:.76},{r:5,spline:"0.36 0 0.25 1",opacity:.67},{r:4.2,spline:"0.42 0 0.31 1",opacity:.56},{r:3.4,spline:"0.48 0 0.37 1",opacity:.44},{r:2.6,spline:"0.55 0 0.44 1",opacity:.32},{r:1.8,spline:"0.62 0 0.52 1",opacity:.2},{r:1,spline:"0.70 0 0.60 1",opacity:.1}];function lr({className:e,size:n="md",duration:r=5,...l}){return(0,t.jsxs)("svg",{"data-slot":"comet-spinner",role:"status","aria-label":"Loading",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",className:(0,V.cn)(lt({size:n}),e),...l,children:[(0,t.jsx)("defs",{children:(0,t.jsxs)("filter",{id:"comet-gooey",x:"-100%",y:"-100%",width:"300%",height:"300%",colorInterpolationFilters:"sRGB",children:[(0,t.jsx)("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"2.5"}),(0,t.jsx)("feColorMatrix",{mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 50 -30",result:"goo"})]})}),(0,t.jsxs)("g",{filter:"url(#comet-gooey)",children:[(0,t.jsx)("animateTransform",{attributeName:"transform",type:"rotate",from:"0 50 50",to:"360 50 50",dur:`${r}s`,repeatCount:"indefinite"}),ln.map(e=>(0,t.jsxs)("g",{children:[(0,t.jsx)("animateTransform",{attributeName:"transform",type:"rotate",calcMode:"spline",values:"0 50 50;360 50 50",keyTimes:"0;1",keySplines:e.spline,dur:"1s",repeatCount:"indefinite"}),(0,t.jsx)("circle",{cx:"50",cy:"18",r:e.r,fill:"currentColor",opacity:e.opacity})]},e.r)),(0,t.jsxs)("circle",{cx:"50",cy:"50",r:"4",fill:"currentColor",opacity:"0.15",children:[(0,t.jsx)("animate",{attributeName:"r",values:"3;5;3",dur:"2s",repeatCount:"indefinite"}),(0,t.jsx)("animate",{attributeName:"opacity",values:"0.1;0.25;0.1",dur:"2s",repeatCount:"indefinite"})]})]})]})}e.i(47506);var ll=e.i(2929),la=e.i(86782),li=e.i(29847);function ls(e){if(0===e)return"0s";let t=Math.floor(e/1e3);if(0===t)return"<1s";let n=Math.floor(t/3600),r=Math.floor(t%3600/60),l=t%60;return n>0?`${n}h ${r}m`:r>0?`${r}m ${l}s`:`${l}s`}let lo=(0,Q.default)("git-merge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);var lc=e.i(43416);function lu({syncStatus:e,syncLoading:n,syncError:r,onRefreshSync:l,onRebaseOnMain:a,rebaseLoading:i,rebaseError:s}){let o=null!=e&&e.behind>0,c=e?.behind===0,u=e?.baseBranch??"main";return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(le.Separator,{}),(0,t.jsxs)("div",{"data-testid":"branch-sync-status",className:"flex flex-col gap-3 p-4",children:[(0,t.jsx)("div",{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"BRANCH SYNC"}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("div",{className:"flex items-center gap-2",children:n&&!e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(lr,{size:"sm",className:"shrink-0"}),(0,t.jsx)("span",{className:"text-muted-foreground text-sm",children:"Checking..."})]}):r?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(J.AlertTriangle,{className:"h-4 w-4 shrink-0 text-red-500"}),(0,t.jsx)("span",{className:"text-sm text-red-600",children:r})]}):i?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(lr,{size:"sm",className:"shrink-0"}),(0,t.jsxs)("span",{className:"text-sm",children:["Rebasing on"," ",(0,t.jsx)("code",{className:"bg-muted rounded px-1 py-0.5 font-mono text-xs",children:u}),"..."]})]}):o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(J.AlertTriangle,{className:"h-4 w-4 shrink-0 text-orange-500"}),(0,t.jsxs)("span",{className:"text-sm",children:[e.behind," commit",1===e.behind?"":"s"," behind"," ",(0,t.jsx)("code",{className:"bg-muted rounded px-1 py-0.5 font-mono text-xs",children:u}),e.ahead>0?(0,t.jsxs)("span",{className:"text-muted-foreground ml-1",children:["· ",e.ahead," ahead"]}):null]})]}):c?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(rI.CheckCircle2,{className:"h-4 w-4 shrink-0 text-green-500"}),(0,t.jsxs)("span",{className:"text-sm",children:["Up to date with"," ",(0,t.jsx)("code",{className:"bg-muted rounded px-1 py-0.5 font-mono text-xs",children:u}),e.ahead>0?(0,t.jsxs)("span",{className:"text-muted-foreground ml-1",children:["· ",e.ahead," ahead"]}):null]})]}):null}),(e||r)&&!i?(0,t.jsx)("button",{"data-testid":"sync-refresh-button",onClick:l,disabled:n,className:"text-muted-foreground hover:text-foreground inline-flex items-center rounded p-1 transition-colors disabled:opacity-50","aria-label":"Refresh sync status",children:(0,t.jsx)(lc.RefreshCw,{className:`h-3.5 w-3.5 ${n?"animate-spin":""}`})}):null]}),o&&!i?(0,t.jsx)(P.ActionButton,{label:"Rebase on Main",onClick:a,loading:!1,error:!!s,icon:lo,variant:"outline",size:"sm"}):null,s?(0,t.jsx)("p",{className:"text-destructive text-xs",children:s}):null]})]})}function ld({data:e,syncStatus:n,syncLoading:r,syncError:l,onRefreshSync:a,onRebaseOnMain:i,rebaseLoading:s,rebaseError:c}){let u="maintain"===e.lifecycle;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{"data-testid":"feature-drawer-status",className:"flex flex-col gap-3 p-4",children:[(0,t.jsx)("div",{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:ll.lifecycleDisplayLabels[e.lifecycle]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(lp,{data:e}),"error"===e.state&&e.onRetry?(0,t.jsxs)("button",{"data-testid":"feature-drawer-retry-button",onClick:()=>e.onRetry(e.featureId),className:"flex shrink-0 cursor-pointer items-center gap-1.5 rounded-full bg-red-50 px-3 py-1.5 text-sm font-medium text-red-700 transition-colors hover:bg-red-100",children:[(0,t.jsx)(rJ.RotateCcw,{className:"h-3.5 w-3.5"}),"Retry"]}):null,("running"===e.state||"action-required"===e.state)&&e.onStop?(0,t.jsxs)("button",{"data-testid":"feature-drawer-stop-button",onClick:()=>e.onStop(e.featureId),className:"flex shrink-0 cursor-pointer items-center gap-1.5 rounded-full bg-red-50 px-3 py-1.5 text-sm font-medium text-red-700 transition-colors hover:bg-red-100",children:[(0,t.jsx)(o.Square,{className:"h-3.5 w-3.5"}),"Stop"]}):null]}),!u&&e.progress>0?(0,t.jsxs)("div",{"data-testid":"feature-drawer-progress",className:"flex flex-col gap-1",children:[(0,t.jsxs)("div",{className:"text-muted-foreground flex items-center justify-between text-xs",children:[(0,t.jsx)("span",{children:"Progress"}),(0,t.jsxs)("span",{children:[e.progress,"%"]})]}),(0,t.jsx)("div",{className:"bg-muted h-2 w-full overflow-hidden rounded-full",children:(0,t.jsx)("div",{className:(0,V.cn)("h-full rounded-full transition-all",ll.featureNodeStateConfig[e.state].progressClass),style:{width:`${e.progress}%`}})})]}):null,u&&e.pr?(0,t.jsx)(lm,{pr:e.pr,hideCiStatus:e.hideCiStatus}):null]}),(0,t.jsx)(lf,{data:e}),!u&&e.pr?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(le.Separator,{}),(0,t.jsx)("div",{className:"p-4",children:(0,t.jsx)(lm,{pr:e.pr,hideCiStatus:e.hideCiStatus})})]}):null,(0,t.jsx)(lx,{data:e}),i&&e.branch&&a?(0,t.jsx)(lu,{syncStatus:n??null,syncLoading:r??!1,syncError:l??null,onRefreshSync:a,onRebaseOnMain:i,rebaseLoading:s??!1,rebaseError:c??null}):null,(0,t.jsx)(lv,{data:e})]})}function lp({data:e}){let n=ll.featureNodeStateConfig[e.state],r=n.icon;return(0,t.jsxs)("div",{className:(0,V.cn)("flex items-center gap-2 rounded-full px-3 py-1.5 text-sm font-medium",n.badgeBgClass,n.badgeClass),children:["running"===e.state?(0,t.jsx)(lr,{size:"sm",className:"shrink-0"}):(0,t.jsx)(r,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:n.label})]})}function lf({data:e}){var n;let r,l,a,i,s,o=!!e.summary&&!(e.userQuery&&e.summary?.trim()===e.userQuery.trim());return e.branch||e.oneLiner||o||e.userQuery||e.createdAt?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(le.Separator,{}),(0,t.jsxs)("div",{"data-testid":"feature-drawer-info",className:"flex flex-col gap-3 p-4",children:[e.branch?(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Branch"}),(0,t.jsxs)("span",{className:"flex items-center gap-1.5 text-sm",children:[(0,t.jsx)(rN.GitBranch,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}),(0,t.jsx)("code",{className:"bg-muted rounded px-1 py-0.5 font-mono text-xs",children:e.branch}),e.baseBranch?(0,t.jsxs)("span",{className:"text-muted-foreground text-xs",children:["from ",e.baseBranch]}):null]})]}):null,e.oneLiner?(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"One-Liner"}),(0,t.jsx)("span",{className:"text-sm leading-relaxed",children:e.oneLiner})]}):null,e.userQuery?(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"User Query"}),(0,t.jsx)(r8,{text:e.userQuery})]}):null,o?(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Summary"}),(0,t.jsx)("span",{className:"text-sm leading-relaxed",children:e.summary})]}):null,e.createdAt?(0,t.jsx)(lb,{label:"Created",value:(n=e.createdAt,r=Date.now(),(s=Math.floor((i=Math.floor((a=Math.floor(Math.floor((r-(l="string"==typeof n?new Date(n).getTime():n))/1e3)/60))/60))/24))>30?new Date(l).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}):s>0?`${s} day${1===s?"":"s"} ago`:i>0?`${i} hour${1===i?"":"s"} ago`:a>0?`${a} minute${1===a?"":"s"} ago`:"just now")}):null]})]}):null}let lh={[rP.PrStatus.Open]:"border-transparent bg-blue-50 text-blue-700 hover:bg-blue-50",[rP.PrStatus.Merged]:"border-transparent bg-purple-50 text-purple-700 hover:bg-purple-50",[rP.PrStatus.Closed]:"border-transparent bg-red-50 text-red-700 hover:bg-red-50"};function lm({pr:e,hideCiStatus:n}){return(0,t.jsx)("div",{"data-testid":"feature-drawer-pr",children:(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary flex items-center gap-1.5 text-sm font-semibold underline underline-offset-2",children:["PR #",e.number,(0,t.jsx)(p.ExternalLink,{className:"h-3.5 w-3.5"})]}),(0,t.jsx)(W.Badge,{className:lh[e.status],children:e.status})]}),e.ciStatus&&!0!==n?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"CI Status"}),(0,t.jsx)(rR,{status:e.ciStatus})]}):null,!1===e.mergeable?(0,t.jsxs)("div",{"data-testid":"pr-merge-conflict",className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Merge Status"}),(0,t.jsxs)(W.Badge,{className:"border-transparent bg-orange-50 text-orange-700 hover:bg-orange-50",children:[(0,t.jsx)(J.AlertTriangle,{className:"mr-1 h-3.5 w-3.5"}),"Conflicts"]})]}):null,e.commitHash?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Commit"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(rw.GitCommitHorizontal,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,t.jsx)("code",{className:"bg-muted text-foreground rounded-md px-1.5 py-0.5 font-mono text-[11px]",children:e.commitHash.slice(0,7)})]})]}):null]})})}function lx({data:e}){let r=function(e){let[t,r]=(0,n.useState)(null),l=(0,n.useRef)(null);return(0,n.useEffect)(()=>e?(r(ls(Math.max(0,Date.now()-e))),l.current=setInterval(()=>{r(ls(Math.max(0,Date.now()-e)))},1e3),()=>{l.current&&(clearInterval(l.current),l.current=null)}):void r(null),[e]),t}("running"===e.state||"action-required"===e.state?e.startedAt:void 0);return e.fastMode??e.agentType??e.runtime??r??e.blockedBy??e.errorMessage?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(le.Separator,{}),(0,t.jsxs)("div",{"data-testid":"feature-drawer-details",className:"flex flex-col gap-3 p-4",children:[e.fastMode?(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Mode"}),(0,t.jsxs)("span",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)(rY.Zap,{className:"h-4 w-4 shrink-0 text-amber-500"}),"Fast Mode"]})]}):null,e.agentType?(0,t.jsx)(lg,{agentType:e.agentType}):null,e.runtime?(0,t.jsx)(lb,{label:"Runtime",value:e.runtime}):null,!e.runtime&&r?(0,t.jsx)(lb,{label:"Running for",value:r}):null,e.blockedBy?(0,t.jsx)(lb,{label:"Blocked by",value:e.blockedBy}):null,e.errorMessage?(0,t.jsx)(lb,{label:"Error",value:e.errorMessage}):null]})]}):null}function lg({agentType:e}){let n=(0,la.getAgentTypeIcon)(e),r=la.agentTypeLabels[e]??e;return(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Agent"}),(0,t.jsxs)("span",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)(n,{className:"h-4 w-4 shrink-0"}),r]})]})}function ly({enabled:e,label:n}){return(0,t.jsxs)("span",{className:(0,V.cn)("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium",e?"bg-emerald-50 text-emerald-700":"bg-muted text-muted-foreground"),children:[e?(0,t.jsx)(u.Check,{className:"h-3 w-3"}):(0,t.jsx)(rZ.X,{className:"h-3 w-3"}),n]})}function lv({data:e}){return null!=e.approvalGates||null!=e.push||null!=e.openPr||null!=e.ciWatchEnabled||null!=e.enableEvidence||null!=e.forkAndPr||null!=e.commitSpecs||e.modelId?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(le.Separator,{}),(0,t.jsxs)("div",{"data-testid":"feature-drawer-settings",className:"flex flex-col gap-3 p-4",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"SETTINGS"}),e.modelId?(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Model"}),(0,t.jsx)("span",{className:"text-sm",children:(0,li.getModelMeta)(e.modelId).displayName||e.modelId})]}):null,e.approvalGates?(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("span",{className:"text-muted-foreground flex items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(rX,{className:"h-3 w-3"}),"Auto-Approve"]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,t.jsx)(ly,{enabled:e.approvalGates.allowPrd,label:"PRD"}),(0,t.jsx)(ly,{enabled:e.approvalGates.allowPlan,label:"Plan"}),(0,t.jsx)(ly,{enabled:e.approvalGates.allowMerge,label:"Merge"})]})]}):null,null!=e.enableEvidence?(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("span",{className:"text-muted-foreground flex items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(rG,{className:"h-3 w-3"}),"Evidence"]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,t.jsx)(ly,{enabled:e.enableEvidence,label:"Collect"}),null!=e.commitEvidence?(0,t.jsx)(ly,{enabled:e.commitEvidence,label:"Add to PR"}):null]})]}):null,null!=e.push||null!=e.openPr||null!=e.ciWatchEnabled||null!=e.commitSpecs||null!=e.forkAndPr?(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("span",{className:"text-muted-foreground flex items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(rN.GitBranch,{className:"h-3 w-3"}),"Git"]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[null!=e.push?(0,t.jsx)(ly,{enabled:e.push,label:"Push"}):null,null!=e.openPr?(0,t.jsx)(ly,{enabled:e.openPr,label:"PR"}):null,null!=e.ciWatchEnabled?(0,t.jsx)(ly,{enabled:e.ciWatchEnabled,label:"Watch"}):null,null!=e.commitSpecs?(0,t.jsx)(ly,{enabled:e.commitSpecs,label:"Commit Specs"}):null,null!=e.forkAndPr?(0,t.jsx)(ly,{enabled:e.forkAndPr,label:"Fork & PR"}):null]})]}):null]})]}):null}function lb({label:e,value:n}){return(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:e}),(0,t.jsx)("span",{className:"text-sm",children:n})]})}var lk=e.i(55016);let lj=(0,Q.default)("dollar-sign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);var rA=rA,lw=e.i(94819),lN=e.i(48109),lS=e.i(58860);let lC=(0,Q.default)("arrow-down-to-line",[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]]),lT=(0,Q.default)("arrow-up-from-line",[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]]);function lE(e,t){if(null!=e.durationMs&&e.durationMs>0)return e.durationMs;if(!e.completedAt&&e.startedAt){let n=new Date(e.startedAt).getTime();if(!Number.isNaN(n))return Math.max(0,t-n)}return 0}function lM(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function lI(e){let t=e instanceof Date?e:new Date(String(e));return Number.isNaN(t.getTime())?"":t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function lA(e){return e>=1?`$${e.toFixed(2)}`:e>=.01?`$${e.toFixed(3)}`:`$${e.toFixed(4)}`}let lP={analyze:"Analyzing",requirements:"Requirements",research:"Researching",plan:"Planning",implement:"Implementing",rebase:"Rebasing","fast-implement":"Fast Implement",evidence:"Evidence",validate:"Validating",repair:"Repairing",merge:"Merging"},lR={"run:started":{label:"started",colorClass:"text-blue-600",bgClass:"bg-blue-50 dark:bg-blue-950/30",icon:s.Play},"run:resumed":{label:"resumed",colorClass:"text-blue-600",bgClass:"bg-blue-50 dark:bg-blue-950/30",icon:rJ.RotateCcw},"run:completed":{label:"completed",colorClass:"text-emerald-600",bgClass:"bg-emerald-50 dark:bg-emerald-950/30",icon:rI.CheckCircle2},"run:failed":{label:"failed",colorClass:"text-red-600",bgClass:"bg-red-50 dark:bg-red-950/30",icon:rA.default},"run:stopped":{label:"stopped",colorClass:"text-amber-600",bgClass:"bg-amber-50 dark:bg-amber-950/30",icon:o.Square},"run:crashed":{label:"crashed",colorClass:"text-red-600",bgClass:"bg-red-50 dark:bg-red-950/30",icon:rA.default},"run:rejected":{label:"rejected",colorClass:"text-orange-600",bgClass:"bg-orange-50 dark:bg-orange-950/30",icon:lw.Ban}};function lD(e){return e.startsWith("run:")}function lL({timings:e,loading:r,error:l,rejectionFeedback:i}){let s=function(e){let[t,r]=(0,n.useState)(Date.now),l=(0,n.useRef)(null);return(0,n.useEffect)(()=>(e&&e.some(e=>!e.phase.startsWith("run:")&&!e.completedAt&&e.startedAt)&&(l.current=setInterval(()=>r(Date.now()),1e3)),()=>{l.current&&(clearInterval(l.current),l.current=null)}),[e]),t}(e);if(r)return(0,t.jsx)("div",{"data-testid":"activity-tab-loading",className:"flex items-center justify-center p-8",children:(0,t.jsx)(a.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})});if(l)return(0,t.jsxs)("div",{className:"flex items-center gap-2 p-4 text-base text-red-600",children:[(0,t.jsx)(B.AlertCircle,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:l})]});if(!e||0===e.length)return(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 p-8",children:[(0,t.jsx)(lk.Clock,{className:"text-muted-foreground h-8 w-8"}),(0,t.jsx)("p",{className:"text-muted-foreground text-base",children:"No activity recorded yet"})]});let o=e.filter(e=>!lD(e.phase)),c=Math.max(...o.map(e=>lE(e,s)),...o.map(e=>e.approvalWaitMs??0),0),u=function(e,t){if(!e.length)return[];let n=e.filter(e=>"run:rejected"===e.phase).length,r=t?.length??0,l=e;if(r>n){l=[...e];let a=e[e.length-1].agentRunId;for(let e=n;e<r;e++){let r=t[e];e>n&&l.push({agentRunId:a,phase:"run:resumed",startedAt:r.timestamp??`synthetic-resumed-${e}`}),l.push({agentRunId:a,phase:"run:rejected",startedAt:r.timestamp??`synthetic-${e}`})}}let a=[],i=[],s=0;for(let e of l)if(i.push(e),"run:rejected"===e.phase){let e=t?.[s];a.push({number:a.length+1,timings:i,rejectionMessage:e?.message,rejectionAttachments:e?.attachments}),i=[],s++}return i.length>0&&a.push({number:a.length+1,timings:i}),a}(e,i),d=u.length>1,p=o.reduce((e,t)=>e+lE(t,s),0),f=o.reduce((e,t)=>e+(t.approvalWaitMs??0),0),h=o.reduce((e,t)=>e+(t.inputTokens??0),0),m=o.reduce((e,t)=>e+(t.outputTokens??0),0),x=o.reduce((e,t)=>e+(t.costUsd??0),0);return(0,t.jsxs)("div",{className:"flex flex-col gap-3 p-4",children:[(0,t.jsx)("div",{"data-testid":"activity-timings",className:"flex flex-col gap-3",children:u.map(e=>(0,t.jsx)(lz,{iteration:e,showHeader:d,maxDurationMs:c,now:s},e.number))}),p>0?(0,t.jsx)(l$,{totalExecMs:p,totalWaitMs:f,totalInputTokens:h,totalOutputTokens:m,totalCostUsd:x}):null]})}function lz({iteration:e,showHeader:n,maxDurationMs:r,now:l}){let a=function(e){let t=[...e.timings].reverse().find(e=>lD(e.phase));if(!t)return null;switch(t.phase){case"run:rejected":return{label:"Rejected",colorClass:"text-orange-600",dotClass:"bg-orange-500"};case"run:completed":return{label:"Completed",colorClass:"text-emerald-600",dotClass:"bg-emerald-500"};case"run:failed":return{label:"Failed",colorClass:"text-red-600",dotClass:"bg-red-500"};case"run:crashed":return{label:"Crashed",colorClass:"text-red-600",dotClass:"bg-red-500"};case"run:stopped":return{label:"Stopped",colorClass:"text-amber-600",dotClass:"bg-amber-500"};default:return null}}(e);return(0,t.jsxs)("div",{"data-testid":`iteration-${e.number}`,className:"border-border/50 bg-card/50 flex flex-col overflow-hidden rounded-lg border",children:[n?(0,t.jsxs)("div",{className:"bg-muted/30 border-border/50 flex items-center justify-between border-b px-3 py-1.5",children:[(0,t.jsxs)("span",{className:"text-muted-foreground text-sm font-semibold tracking-wide",children:["Iteration ",e.number]}),a?(0,t.jsxs)("span",{className:`flex items-center gap-1 text-xs font-medium ${a.colorClass}`,children:[(0,t.jsx)("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${a.dotClass}`}),a.label]}):null]}):null,(0,t.jsxs)("div",{className:"relative flex flex-col",children:[(0,t.jsx)("div",{className:"bg-border/60 absolute top-4 bottom-4 left-[21.5px] w-px"}),e.timings.map((n,a)=>{if(lD(n.phase)){let r,l="run:rejected"===n.phase,i="run:failed"===n.phase||"run:crashed"===n.phase||"run:stopped"===n.phase;if(l)r=e.rejectionMessage;else if(i){let t=[...e.timings].reverse().find(e=>!lD(e.phase)&&e.errorMessage);r=t?.errorMessage??n.errorMessage}return(0,t.jsx)(lF,{timing:n,message:r,attachments:l?e.rejectionAttachments:void 0,isFirst:0===a,isLast:a===e.timings.length-1},`${n.agentRunId}-${n.phase}-${n.startedAt}`)}return(0,t.jsx)(lO,{timing:n,maxDurationMs:r,now:l},`${n.agentRunId}-${n.phase}-${n.startedAt}`)})]})]})}function lF({timing:e,message:n,attachments:r,isFirst:l,isLast:a}){let i,s=lR[e.phase];if(!s)return null;let o=r&&r.length>0,c=s.icon;return(0,t.jsxs)("div",{className:`relative flex flex-col gap-1 px-3 ${l?"pt-2":"pt-1"} ${a?"pb-2":"pb-1"}`,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:`relative z-10 flex h-5 w-5 shrink-0 items-center justify-center rounded-full ${s.bgClass}`,children:(0,t.jsx)(c,{className:`h-3 w-3 ${s.colorClass}`})}),(0,t.jsx)("span",{className:`text-sm font-medium ${s.colorClass}`,children:s.label}),e.startedAt&&!("string"==typeof e.startedAt&&e.startedAt.startsWith("synthetic"))?(0,t.jsx)("span",{className:"text-muted-foreground/60 ml-auto text-xs tabular-nums",children:lI(String(e.startedAt))}):null]}),n?(i="run:failed"===e.phase||"run:crashed"===e.phase||"run:stopped"===e.phase,(0,t.jsxs)("div",{className:`ml-[26px] flex items-start gap-1.5 rounded-md px-2 py-1.5 ${i?"bg-red-50/50 dark:bg-red-950/20":"bg-orange-50/50 dark:bg-orange-950/20"}`,children:[i?(0,t.jsx)(B.AlertCircle,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-red-400"}):(0,t.jsx)(lN.MessageSquare,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-orange-400"}),(0,t.jsxs)("span",{"data-testid":i?"error-message-text":"rejection-feedback-text",className:"text-muted-foreground text-xs leading-relaxed italic",children:["— ",n]})]})):null,o?(0,t.jsx)("div",{"data-testid":"rejection-feedback-attachments",className:"ml-[26px]",children:(0,t.jsx)(r8,{text:"",attachmentPaths:r})}):null]})}function lO({timing:e,maxDurationMs:r,now:l}){let a=e.phase.includes(":")?e.phase.split(":")[0]:e.phase,i=e.phase.includes(":")?e.phase.split(":")[1]:null,s=null!==i,o=i?.startsWith("phase-")??!1,d=lP[a]??a,p=o?`Phase ${i.replace("phase-","")}`:null!==i?`${d} #${i}`:d,f=lE(e,l),h=!e.completedAt&&!!e.startedAt,m=h?15:2,x=r>0?Math.max(m,f/r*100):m,g=e.completedAt?o?"bg-emerald-400":s?"bg-amber-500":"bg-emerald-500":"bg-blue-500",y=null!=e.inputTokens||null!=e.outputTokens?(e.inputTokens??0)+(e.outputTokens??0):null,[v,b]=(0,n.useState)(!1),k=(0,n.useCallback)(()=>{e.prompt&&navigator.clipboard.writeText(e.prompt).then(()=>{b(!0),setTimeout(()=>b(!1),1500)})},[e.prompt]);return(0,t.jsxs)("div",{className:`group/phase relative flex flex-col gap-0.5 px-3 py-1.5 ${s?"ml-4":""}`,children:[(0,t.jsxs)("div",{"data-testid":`timing-bar-${e.phase}`,className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"relative z-10 flex h-5 w-5 shrink-0 items-center justify-center",children:(0,t.jsx)("div",{className:`rounded-full ${h?"h-3 w-3 animate-pulse":"h-2.5 w-2.5"} ${h?"bg-blue-500":e.completedAt?"bg-emerald-500":"bg-muted-foreground/30"}`})}),(0,t.jsx)("span",{className:`w-28 shrink-0 truncate text-sm font-medium ${s?"text-muted-foreground":"text-foreground/80"}`,children:p}),e.prompt?(0,t.jsx)("button",{type:"button",onClick:k,className:"text-muted-foreground/50 hover:text-foreground/70 -ml-1 shrink-0 opacity-0 transition-opacity group-hover/phase:opacity-100",title:"Copy prompt to clipboard",children:v?(0,t.jsx)(u.Check,{className:"h-3.5 w-3.5 text-emerald-500"}):(0,t.jsx)(c.Copy,{className:"h-3.5 w-3.5"})}):null,(0,t.jsx)("div",{className:`bg-muted relative min-w-0 flex-1 overflow-hidden rounded-full ${s?"h-1.5":"h-2"}`,children:h?(0,t.jsx)("div",{className:"absolute inset-0 rounded-full bg-blue-500/30",style:{backgroundImage:"linear-gradient(90deg, transparent 0%, rgb(59 130 246) 50%, transparent 100%)",backgroundSize:"200% 100%",animation:"shimmer 1.5s ease-in-out infinite"}}):(0,t.jsx)("div",{className:`h-full rounded-full transition-all duration-300 ${g}`,style:{width:`${Math.min(x,100)}%`}})}),(0,t.jsx)("span",{className:"text-muted-foreground w-14 shrink-0 text-right text-sm font-medium tabular-nums",children:ls(f)})]}),(0,t.jsxs)("div",{className:"ml-[28px] flex items-center gap-3 text-xs",children:[e.startedAt?(0,t.jsx)("span",{className:"text-muted-foreground/60 tabular-nums",children:lI(e.startedAt)}):null,null!=y&&y>0?(0,t.jsxs)("span",{className:"text-muted-foreground/70 inline-flex items-center gap-0.5",children:[(0,t.jsx)(rY.Zap,{className:"h-3 w-3 opacity-50"}),lM(y)]}):null,null!=e.costUsd&&e.costUsd>0?(0,t.jsxs)("span",{className:"text-muted-foreground/70 inline-flex items-center gap-0.5",children:[(0,t.jsx)(lj,{className:"h-3 w-3 opacity-50"}),lA(e.costUsd)]}):null]}),null!=e.approvalWaitMs&&e.approvalWaitMs>0?(0,t.jsx)(lB,{timing:e,maxDurationMs:r}):null]})}function lB({timing:e,maxDurationMs:n}){let r=e.approvalWaitMs??0,l=n>0?Math.max(2,r/n*100):2;return(0,t.jsxs)("div",{"data-testid":`approval-wait-${e.phase}`,className:"ml-[26px] flex items-center gap-2 rounded-md bg-amber-50/50 px-1.5 py-1 dark:bg-amber-950/20",children:[(0,t.jsx)(lS.Timer,{className:"h-3.5 w-3.5 shrink-0 text-amber-500"}),(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 text-xs",children:"approval"}),(0,t.jsx)("div",{className:"bg-muted h-1.5 min-w-0 flex-1 overflow-hidden rounded-full",children:(0,t.jsx)("div",{className:"h-full rounded-full bg-amber-500",style:{width:`${Math.min(l,100)}%`}})}),(0,t.jsx)("span",{className:"text-muted-foreground w-14 shrink-0 text-right text-xs tabular-nums",children:ls(r)})]})}function l$({totalExecMs:e,totalWaitMs:n,totalInputTokens:r,totalOutputTokens:l,totalCostUsd:a}){let i=r+l;return(0,t.jsxs)("div",{"data-testid":"activity-summary",className:"border-border bg-card/30 flex flex-col gap-2 rounded-lg border p-3",children:[(0,t.jsx)("div",{className:"text-muted-foreground mb-1 text-xs font-semibold tracking-wider uppercase",children:"Summary"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-x-4 gap-y-3",children:[(0,t.jsx)(l_,{icon:lk.Clock,label:"Execution",value:ls(e)}),(0,t.jsx)(l_,{icon:lS.Timer,label:"Wait",value:n>0?ls(n):"n/a"}),(0,t.jsx)(l_,{icon:lk.Clock,label:"Wall-clock",value:n>0?ls(e+n):ls(e)}),(0,t.jsx)(l_,{icon:lj,label:"Cost",value:a>0?lA(a):"n/a"}),(0,t.jsxs)("div",{className:"col-span-2 flex flex-col gap-0.5",children:[(0,t.jsxs)("span",{className:"text-muted-foreground flex items-center gap-1 text-xs",children:[(0,t.jsx)(rY.Zap,{className:"h-3 w-3 opacity-40"}),"Tokens"]}),i>0?(0,t.jsxs)("span",{className:"flex items-center gap-2.5 text-sm tabular-nums",children:[(0,t.jsx)("span",{children:lM(i)}),(0,t.jsxs)("span",{className:"text-muted-foreground flex items-center gap-3 text-xs",title:"Input tokens / Output tokens",children:[(0,t.jsxs)("span",{className:"flex items-center gap-0.5",children:[(0,t.jsx)(lC,{className:"h-3 w-3 text-blue-500 opacity-60"}),lM(r)]}),(0,t.jsxs)("span",{className:"flex items-center gap-0.5",children:[(0,t.jsx)(lT,{className:"h-3 w-3 text-emerald-500 opacity-60"}),lM(l)]})]})]}):(0,t.jsx)("span",{className:"text-muted-foreground/40 text-sm italic tabular-nums",children:"n/a"})]})]})]})}function l_({icon:e,label:n,value:r,className:l=""}){let a="n/a"===r;return(0,t.jsxs)("div",{className:`flex flex-col gap-0.5 ${l}`,children:[(0,t.jsxs)("span",{className:"text-muted-foreground flex items-center gap-1 text-xs",children:[(0,t.jsx)(e,{className:"h-3 w-3 opacity-40"}),n]}),(0,t.jsx)("span",{className:`text-sm tabular-nums ${a?"text-muted-foreground/40 italic":""}`,children:r})]})}var lU=e.i(7311),lq=e.i(44229);let lH=(0,Q.default)("coins",[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]]),lV=(0,Q.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"}]]),lW=(0,Q.default)("file-code",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]]),lK=/^\[(\d{4}-\d{2}-\d{2}T[\d:.]+Z?)\]\s+(?:\[([^\]]+)\]\s+)?(?:\[([^\]|]+)(?:\|([^\]]+))?\]\s+)?(.*)$/,lQ=/^\[(tool|text|result|tokens|raw|WORKER)\]\s*(.*)/;function lG(e){let t=e.match(lK);if(!t)return{timestamp:null,phase:null,agent:null,model:null,tag:"raw",message:e,raw:e};let[,n,r,l,a,i]=t,s=null,o=null,c=null,u=i??"";if(null!=l&&null!=r)if(r.includes("|")){let[e,t]=r.split("|");o=e,c=t??null,u=`[${l}] ${i??""}`}else s=r,o=l,c=a??null;else if(null!=r)if(r.includes("|")){let[e,t]=r.split("|");o=e,c=t??null}else s=r;let d=u.match(lQ),p="info";return d&&(p=d[1].toLowerCase(),u=d[2]),{timestamp:n??null,phase:s,agent:o,model:c,tag:p,message:u.trim(),raw:e}}function lJ({content:e}){let r=(0,n.useMemo)(()=>e?e.split("\n").filter(e=>e.trim().length>0).map(lG):[],[e]);return 0===r.length?null:(0,t.jsx)("div",{className:"flex flex-col",children:r.map((e,n)=>(0,t.jsx)(lX,{line:e},n))})}function lX({line:e}){switch(e.tag){case"tool":return(0,t.jsx)(l0,{line:e});case"text":return(0,t.jsx)(l2,{line:e});case"result":return(0,t.jsx)(l5,{line:e});case"tokens":return(0,t.jsx)(l3,{line:e});case"worker":return(0,t.jsx)(l4,{line:e});case"info":return(0,t.jsx)(l6,{line:e});default:return(0,t.jsx)(l9,{line:e})}}function lZ({value:e}){if(!e)return null;let n=e.replace(/^.*T/,"").replace("Z",""),r=n.split(":"),l=r.length>=3?`${r[1]}:${r[2].split(".")[0]}`:n;return(0,t.jsx)("span",{className:"text-muted-foreground/60 w-11 shrink-0 font-mono text-[10px]",children:l})}function lY({phase:e}){return e?(0,t.jsx)("span",{className:"bg-muted text-muted-foreground w-20 shrink-0 truncate rounded px-1.5 py-0.5 font-mono text-[10px] font-medium",title:e,children:e}):(0,t.jsx)("span",{className:"w-20 shrink-0"})}function l0({line:e}){var n;let r,{toolName:l,args:a}=-1===(r=(n=e.message).indexOf(" "))?{toolName:n,args:""}:{toolName:n.slice(0,r),args:n.slice(r+1)},i=function(e,t){try{let n=JSON.parse(t);if("Read"===e&&n.file_path||"Write"===e&&n.file_path||"Edit"===e&&n.file_path)return n.file_path;if("Glob"===e&&n.pattern||"Grep"===e&&n.pattern)return n.pattern;if("Bash"===e&&n.command)return n.command;if("Task"===e&&n.description)return n.description}catch{if(t.length>0)return t}return null}(l,a);return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 border-b border-transparent px-3 py-1.5 transition-colors",children:[(0,t.jsx)(lZ,{value:e.timestamp}),(0,t.jsx)(lY,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(l1,{toolName:l}),(0,t.jsx)("span",{className:"text-xs font-semibold text-violet-600 dark:text-violet-400",children:l}),i?(0,t.jsx)("span",{className:"text-muted-foreground min-w-0 font-mono text-xs break-all",children:i}):null]})]})}function l1({toolName:e}){let n=e.toLowerCase();return"bash"===n?(0,t.jsx)(R.Terminal,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-500"}):"read"===n||"glob"===n||"grep"===n?(0,t.jsx)(rT.FileText,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-500"}):"write"===n||"edit"===n?(0,t.jsx)(lW,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-500"}):(0,t.jsx)(R.Terminal,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-500"})}function l2({line:e}){return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,t.jsx)(lZ,{value:e.timestamp}),(0,t.jsx)(lY,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(lN.MessageSquare,{className:"mt-0.5 h-3 w-3 shrink-0 text-blue-500"}),(0,t.jsx)("span",{className:"text-foreground/80 min-w-0 text-xs leading-relaxed",children:e.message})]})]})}function l5({line:e}){var n;let r,l,{chars:a}=(r=(n=e.message).match(/^(\d+)\s+chars/),l=n.match(/session=(\S+)/),{chars:r?parseInt(r[1],10):0,sessionId:l?l[1]:null});return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,t.jsx)(lZ,{value:e.timestamp}),(0,t.jsx)(lY,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(rI.CheckCircle2,{className:"mt-0.5 h-3 w-3 shrink-0 text-emerald-500"}),(0,t.jsxs)("span",{className:"text-xs font-medium text-emerald-600 dark:text-emerald-400",children:["Result: ",a.toLocaleString()," chars"]})]})]})}function l3({line:e}){let n,{inputTokens:r,outputTokens:l}=(n=e.message.match(/^(\d+)\s+in\s*\/\s*(\d+)\s+out/))?{inputTokens:parseInt(n[1],10),outputTokens:parseInt(n[2],10)}:{inputTokens:0,outputTokens:0};return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,t.jsx)(lZ,{value:e.timestamp}),(0,t.jsx)(lY,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(lH,{className:"mt-0.5 h-3 w-3 shrink-0 text-amber-500"}),(0,t.jsxs)("span",{className:"text-muted-foreground text-xs",children:[(0,t.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:r.toLocaleString()})," in / ",(0,t.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:l.toLocaleString()})," out"]})]})]})}function l4({line:e}){return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 bg-zinc-50 px-3 py-1.5 transition-colors dark:bg-zinc-900/50",children:[(0,t.jsx)(lZ,{value:e.timestamp}),(0,t.jsx)(lY,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(lV,{className:"mt-0.5 h-3 w-3 shrink-0 text-zinc-500"}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium break-all",children:e.message})]})]})}function l6({line:e}){return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,t.jsx)(lZ,{value:e.timestamp}),(0,t.jsx)(lY,{phase:e.phase}),(0,t.jsx)("span",{className:"text-muted-foreground min-w-0 text-xs break-all",children:e.message})]})}function l9({line:e}){return(0,t.jsx)("div",{className:"px-3 py-0.5",children:(0,t.jsx)("span",{className:"text-muted-foreground/70 font-mono text-[11px] break-all whitespace-pre-wrap",children:e.raw})})}function l8({content:e,isConnected:r,error:l}){let a=(0,n.useRef)(null),[i,s]=(0,n.useState)(!0),[o,c]=(0,n.useState)("structured"),u=(0,n.useCallback)(()=>{let e=a.current;e&&s(e.scrollHeight-e.scrollTop-e.clientHeight<40)},[]),d=(0,n.useCallback)(()=>{let e=a.current;e&&(e.scrollTop=e.scrollHeight,s(!0))},[]);return((0,n.useEffect)(()=>{i&&a.current&&(a.current.scrollTop=a.current.scrollHeight)},[e,i]),l)?(0,t.jsxs)("div",{className:"flex items-center gap-2 p-4 text-sm text-red-600",children:[(0,t.jsx)(B.AlertCircle,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:l})]}):e?(0,t.jsxs)("div",{className:"flex h-full flex-col","data-testid":"log-tab",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b px-3 py-1.5",children:[(0,t.jsx)("span",{className:`h-2 w-2 rounded-full ${r?"bg-emerald-500":"bg-zinc-400"}`}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:r?"Live":"Disconnected"}),(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[(0,t.jsx)("button",{type:"button",onClick:()=>c("structured"),className:`rounded p-1 transition-colors ${"structured"===o?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,title:"Structured view",children:(0,t.jsx)(rT.FileText,{className:"h-3.5 w-3.5"})}),(0,t.jsx)("button",{type:"button",onClick:()=>c("raw"),className:`rounded p-1 transition-colors ${"raw"===o?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,title:"Raw view",children:(0,t.jsx)(lq.Code,{className:"h-3.5 w-3.5"})}),i?null:(0,t.jsxs)("button",{type:"button",onClick:d,className:"text-muted-foreground hover:text-foreground ml-1 flex items-center gap-1 text-xs",children:[(0,t.jsx)(lU.ArrowDown,{className:"h-3 w-3"}),"Jump to bottom"]})]})]}),(0,t.jsx)("div",{ref:a,onScroll:u,className:`flex-1 overflow-y-auto ${"raw"===o?"bg-zinc-950 p-3 font-mono text-xs leading-relaxed break-all whitespace-pre-wrap text-zinc-300":"bg-background"}`,children:"structured"===o?(0,t.jsx)(lJ,{content:e}):e})]}):(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 p-8",children:[(0,t.jsx)(R.Terminal,{className:"text-muted-foreground h-8 w-8"}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:"No log output yet"}),r?(0,t.jsx)("p",{className:"text-muted-foreground text-xs",children:"Waiting for log data..."}):null]})}let l7=(0,Q.default)("list-todo",[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]]);var ae=e.i(95812),at=e.i(87889);let an=(0,Q.default)("circle-dashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]),ar={Todo:{icon:ae.Circle,colorClass:"text-muted-foreground",borderClass:"border-border",label:"Todo"},"Work in Progress":{icon:a.Loader2,colorClass:"text-blue-600",borderClass:"border-blue-200",spinning:!0,label:"In Progress"},Done:{icon:u.Check,colorClass:"text-emerald-600",borderClass:"border-emerald-200",label:"Done"},Review:{icon:at.Eye,colorClass:"text-amber-600",borderClass:"border-amber-200",label:"Review"}},al={icon:ae.Circle,colorClass:"text-muted-foreground",borderClass:"border-border",label:"Unknown"};function aa({tasks:e}){return 0===e.length?(0,t.jsx)("div",{className:"flex flex-col items-center justify-center gap-2 py-4",children:(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:"No tasks defined yet"})}):(0,t.jsxs)("div",{"data-testid":"task-progress-view",className:"flex flex-col gap-3",children:[(0,t.jsx)(ai,{tasks:e}),(0,t.jsx)("div",{"data-testid":"task-progress-list",className:"flex flex-col gap-2",children:e.map((e,n)=>(0,t.jsx)(ao,{task:e,index:n},e.title||`task-${n}`))})]})}function ai({tasks:e}){let r=(0,n.useMemo)(()=>{let t=e.filter(e=>"Done"===e.state).length,n=e.filter(e=>"Work in Progress"===e.state).length,r=e.filter(e=>"Review"===e.state).length,l=e.filter(e=>"Done"!==e.state&&"Work in Progress"!==e.state&&"Review"!==e.state).length,a=e.length,i=a>0?Math.round(t/a*100):0;return{done:t,wip:n,review:r,todo:l,total:a,percent:i}},[e]);return(0,t.jsxs)("div",{"data-testid":"task-progress-summary",className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Task Progress"}),(0,t.jsxs)("span",{className:"text-muted-foreground text-xs",children:[r.done," of ",r.total," done"]})]}),(0,t.jsx)("div",{className:"bg-muted h-2 w-full overflow-hidden rounded-full",children:(0,t.jsx)("div",{"data-testid":"task-progress-bar",className:"h-full rounded-full bg-emerald-500 transition-all",style:{width:`${r.percent}%`}})}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-3",children:[r.done>0?(0,t.jsx)(as,{icon:u.Check,label:"Done",count:r.done,className:"text-emerald-600"}):null,r.wip>0?(0,t.jsx)(as,{icon:a.Loader2,label:"In Progress",count:r.wip,className:"text-blue-600"}):null,r.review>0?(0,t.jsx)(as,{icon:at.Eye,label:"Review",count:r.review,className:"text-amber-600"}):null,r.todo>0?(0,t.jsx)(as,{icon:ae.Circle,label:"Todo",count:r.todo,className:"text-muted-foreground"}):null]})]})}function as({icon:e,label:n,count:r,className:l}){return(0,t.jsxs)("span",{className:(0,V.cn)("flex items-center gap-1 text-xs",l),children:[(0,t.jsx)(e,{className:"h-3 w-3"}),r," ",n]})}function ao({task:e,index:r}){let[l,a]=(0,n.useState)(!1),i=ar[e.state]??al,s=i.icon,o=e.actionItems.length>0,c=(0,n.useCallback)(()=>{o&&a(e=>!e)},[o]);return(0,t.jsxs)("div",{"data-testid":`task-card-${r}`,className:(0,V.cn)("rounded-lg border",i.borderClass),children:[(0,t.jsxs)("button",{type:"button",onClick:c,disabled:!o,className:(0,V.cn)("flex w-full items-start gap-2 px-3 py-2.5 text-left",o&&"hover:bg-muted/50 cursor-pointer transition-colors"),children:[(0,t.jsx)(s,{className:(0,V.cn)("mt-0.5 h-4 w-4 shrink-0",i.colorClass,i.spinning&&"animate-spin")}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,t.jsx)("span",{className:(0,V.cn)("text-sm font-medium",i.colorClass),children:e.title}),e.description?(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:e.description}):null]}),o?(0,t.jsx)(H.ChevronRight,{className:(0,V.cn)("text-muted-foreground mt-0.5 h-4 w-4 shrink-0 transition-transform",l&&"rotate-90")}):null]}),l&&o?(0,t.jsx)("div",{className:"border-t px-3 py-2.5",children:(0,t.jsx)("div",{className:"flex flex-col gap-2",children:e.actionItems.map((e,n)=>(0,t.jsx)(ac,{item:e},e.name||`ai-${n}`))})}):null]})}function ac({item:e}){let n=e.acceptanceCriteria.length,r=e.acceptanceCriteria.filter(e=>e.verified).length,l=n>0&&r===n;return(0,t.jsxs)("div",{"data-testid":"action-item",className:"flex flex-col gap-1.5",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[l?(0,t.jsx)(rI.CheckCircle2,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-emerald-600"}):(0,t.jsx)(an,{className:"text-muted-foreground mt-0.5 h-3.5 w-3.5 shrink-0"}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:e.name}),e.description?(0,t.jsx)("span",{className:"text-muted-foreground text-[11px]",children:e.description}):null]}),n>0?(0,t.jsxs)("span",{className:"text-muted-foreground ml-auto shrink-0 text-[11px]",children:[r,"/",n]}):null]}),n>0?(0,t.jsx)("div",{className:"ml-5.5 flex flex-col gap-1",children:e.acceptanceCriteria.map((e,n)=>(0,t.jsx)(au,{criterion:e},e.description||`ac-${n}`))}):null]})}function au({criterion:e}){return(0,t.jsxs)("div",{"data-testid":"acceptance-criterion",className:"flex items-start gap-1.5",children:[e.verified?(0,t.jsx)(u.Check,{className:"mt-0.5 h-3 w-3 shrink-0 text-emerald-600"}):(0,t.jsx)(ae.Circle,{className:"text-muted-foreground mt-0.5 h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:(0,V.cn)("text-[11px]",e.verified?"text-muted-foreground line-through":"text-foreground"),children:e.description})]})}let ad={Requirements:"border-transparent bg-blue-50 text-blue-700 hover:bg-blue-50",ClarificationRequired:"border-transparent bg-amber-50 text-amber-700 hover:bg-amber-50",Ready:"border-transparent bg-green-50 text-green-700 hover:bg-green-50"};function ap({plan:e,loading:n,error:r}){return n?(0,t.jsx)("div",{"data-testid":"plan-tab-loading",className:"flex items-center justify-center p-8",children:(0,t.jsx)(a.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})}):r?(0,t.jsxs)("div",{className:"flex items-center gap-2 p-4 text-sm text-red-600",children:[(0,t.jsx)(B.AlertCircle,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:r})]}):e?(0,t.jsxs)("div",{className:"flex flex-col gap-4 p-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Plan State"}),(0,t.jsx)(W.Badge,{className:ad[e.state]??"border-transparent bg-gray-50 text-gray-700",children:e.state})]}),e.overview?(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Overview"}),(0,t.jsx)("p",{className:"text-sm leading-relaxed",children:e.overview})]}):null,(0,t.jsx)(aa,{tasks:e.tasks})]}):(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 p-8",children:[(0,t.jsx)(l7,{className:"text-muted-foreground h-8 w-8"}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:"No plan created yet"})]})}function af(){return{data:null,loading:!1,error:null}}let ah=[{key:"overview",label:"Overview"},{key:"activity",label:"Activity"},{key:"log",label:"Log"},{key:"plan",label:"Plan"},{key:"prd-review",label:"PRD Review"},{key:"tech-decisions",label:"Tech Decisions"},{key:"product-decisions",label:"Product"},{key:"merge-review",label:"Merge Review"}],am={activity:async function(e){let t=await _(e);if("error"in t)throw Error(t.error);return{timings:t.timings,rejectionFeedback:t.rejectionFeedback}},plan:async function(e){let t=await U(e);if("error"in t)throw Error(t.error);return t.plan}};function ax({featureNode:e,featureId:l,initialTab:i,urlTab:s,prdData:o,prdSelections:c,onPrdSelect:u,onPrdApprove:d,onPrdReject:p,isPrdLoading:f,techData:h,onTechApprove:m,onTechReject:x,isTechLoading:g,productData:y,mergeData:v,onMergeApprove:b,onMergeReject:k,isMergeLoading:j,syncStatus:w,syncLoading:N,syncError:S,onRefreshSync:C,onRebaseOnMain:T,rebaseLoading:E,rebaseError:M,isRejecting:I,chatInput:A,onChatInputChange:P,sseEvents:R}){let D=(0,r.usePathname)(),L=(0,n.useMemo)(()=>{let t;return t=["overview","activity"],e.hasAgentRun&&t.push("log"),e.hasPlan&&t.push("plan"),"requirements"===e.lifecycle&&"action-required"===e.state&&t.push("prd-review"),"implementation"===e.lifecycle&&"action-required"===e.state&&t.push("tech-decisions","product-decisions"),"review"===e.lifecycle&&("action-required"===e.state||"error"===e.state)&&t.push("merge-review"),"maintain"===e.lifecycle&&e.pr&&t.push("merge-review"),t},[e]),z=(0,n.useMemo)(()=>ah.filter(e=>L.includes(e.key)).map(t=>"merge-review"===t.key&&"maintain"===e.lifecycle?{...t,label:"Merge History"}:t),[L,e.lifecycle]),F=(0,n.useMemo)(()=>{let e=D.match(/^(\/feature\/[^/]+)/);return e?e[1]:D},[D]),O=(0,n.useMemo)(()=>s&&L.includes(s)?s:i&&L.includes(i)?i:"overview",[]),[_,U]=(0,n.useState)(O),q=function(e){let[t,r]=(0,n.useState)(""),[l,a]=(0,n.useState)(!1),[i,s]=(0,n.useState)(null),o=(0,n.useRef)(null),c=(0,n.useCallback)(()=>{o.current&&(o.current.close(),o.current=null),a(!1)},[]);return(0,n.useEffect)(()=>{if(!e){r(""),a(!1),s(null);return}r(""),s(null);let t=new EventSource(`/api/feature-logs?featureId=${e}`);return o.current=t,t.onopen=()=>{a(!0)},t.addEventListener("initial",e=>{r(JSON.parse(e.data).content)}),t.addEventListener("log",e=>{let t=JSON.parse(e.data);r(e=>e+t.content)}),t.addEventListener("error",e=>{try{let t=JSON.parse(e.data);s(t.error)}catch{s(e.data?String(e.data):"Log stream unavailable")}}),t.onerror=()=>{a(!1)},()=>{t.close(),o.current=null}},[e,c]),{content:t,isConnected:l,error:i}}("log"===_?l:null),{tabs:H,fetchTab:V,refreshTab:W}=function(e,t){let r=Object.keys(t),[l,a]=(0,n.useState)(()=>{let e={};for(let t of r)e[t]=af();return e}),i=(0,n.useRef)(t);i.current=t;let s=(0,n.useRef)(e);s.current=e;let o=(0,n.useRef)(!0);(0,n.useEffect)(()=>(o.current=!0,()=>{o.current=!1}),[]);let c=(0,n.useRef)(e);(0,n.useEffect)(()=>{c.current!==e&&(c.current=e,a(e=>{let t={};for(let n of Object.keys(e))t[n]=af();return t}))},[e]);let u=(0,n.useCallback)(async e=>{let t=i.current[e],n=s.current;if(t){o.current&&a(t=>t[e]?.data!==null?t:{...t,[e]:{...t[e],loading:!0,error:null}});try{let r=await t(n);o.current&&a(t=>({...t,[e]:{data:r,loading:!1,error:null}}))}catch(t){o.current&&a(n=>{let r=t instanceof Error?t.message:"Failed to fetch tab data",l=n[e]?.data??null;return{...n,[e]:{data:l,loading:!1,error:l?null:r}}})}}},[]),d=(0,n.useCallback)(async e=>{let t=l[e];t&&null!==t.data||t&&t.loading||await u(e)},[l,u]);return{tabs:l,fetchTab:d,refreshTab:(0,n.useCallback)(async e=>{await u(e)},[u])}}(l,am),K=(0,n.useRef)(!1);(0,n.useEffect)(()=>{if(!K.current)return;K.current=!1;let e="overview"===_?F:`${F}/${_}`;e!==D&&window.history.pushState(null,"",e)},[_,F,D]);let Q=(0,n.useRef)(D);(0,n.useEffect)(()=>{if(Q.current===D||(Q.current=D,K.current))return;let e=D.split("/"),t=e.length>=4?e[3]:void 0,n=t&&L.includes(t)?t:"overview";n!==_&&(U(n),("activity"===n||"plan"===n)&&V(n))},[D]);let G=(0,n.useRef)(!1);(0,n.useEffect)(()=>{if(!G.current&&(G.current=!0,!s&&"overview"!==O)){let e=`${F}/${O}`;e!==D&&window.history.replaceState(null,"",e)}},[]);let J=(0,n.useRef)(!1);(0,n.useEffect)(()=>{J.current||(J.current=!0,("activity"===_||"plan"===_)&&V(_))},[_,V]);let X=(0,n.useRef)(l);(0,n.useEffect)(()=>{X.current!==l&&(X.current=l,U("overview"))},[l]);let Z=(0,n.useRef)(i);(0,n.useEffect)(()=>{if(Z.current!==i&&i&&L.includes(i)){Z.current=i,U(i),("activity"===i||"plan"===i)&&V(i);let e="overview"===i?F:`${F}/${i}`;e!==window.location.pathname&&window.history.replaceState(null,"",e)}},[i,L,F,V]),(0,n.useEffect)(()=>{L.includes(_)||(U("overview"),window.location.pathname!==F&&window.history.replaceState(null,"",F))},[L,_,F]);let Y=(0,n.useRef)(_);Y.current=_;let ee=(0,n.useRef)(0);(0,n.useEffect)(()=>{if(!R||0===R.length||(ee.current>R.length&&(ee.current=0),R.length<=ee.current))return;let e=R.slice(ee.current);if(ee.current=R.length,!e.some(e=>e.featureId===l))return;W("activity");let t=Y.current;"plan"===t&&W(t)},[R,l,W]);let et="running"===e.state||"creating"===e.state;(0,n.useEffect)(()=>{if(!et)return;let e=setInterval(()=>{W("activity")},5e3);return()=>clearInterval(e)},[et,W]);let er=(0,n.useCallback)(e=>{K.current=!0,U(e),("activity"===e||"plan"===e)&&V(e)},[V]);return(0,t.jsx)("div",{className:"flex min-h-0 flex-1 flex-col",children:(0,t.jsxs)($.Tabs,{value:_,onValueChange:er,className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsx)("div",{className:"shrink-0 overflow-x-auto px-4 pt-4",children:(0,t.jsx)($.TabsList,{className:"flex w-full",children:z.map(e=>(0,t.jsx)($.TabsTrigger,{value:e.key,className:"flex-1",children:e.label},e.key))})}),(0,t.jsx)($.TabsContent,{value:"overview",className:"mt-0 flex-1 overflow-y-auto",children:(0,t.jsx)(ld,{data:e,syncStatus:w,syncLoading:N,syncError:S,onRefreshSync:C,onRebaseOnMain:T,rebaseLoading:E,rebaseError:M})}),(0,t.jsx)($.TabsContent,{value:"activity",className:"mt-0 flex-1 overflow-y-auto",children:(0,t.jsx)(lL,{timings:H.activity.data?.timings??null,loading:H.activity.loading,error:H.activity.error,rejectionFeedback:H.activity.data?.rejectionFeedback})}),(0,t.jsx)($.TabsContent,{value:"log",className:"mt-0 flex-1 overflow-hidden",children:(0,t.jsx)(l8,{content:q.content,isConnected:q.isConnected,error:q.error})}),(0,t.jsx)($.TabsContent,{value:"plan",className:"mt-0 flex-1 overflow-y-auto",children:(0,t.jsx)(ap,{plan:H.plan.data,loading:H.plan.loading,error:H.plan.error})}),L.includes("prd-review")?(0,t.jsx)($.TabsContent,{value:"prd-review",className:"mt-0 flex min-h-0 flex-1 flex-col",children:o?(0,t.jsx)(en,{data:o,selections:c??{},onSelect:u??(()=>void 0),onApprove:d??(()=>void 0),onReject:p,isProcessing:f,isRejecting:I,chatInput:A,onChatInputChange:P}):(0,t.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,t.jsx)(a.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})})}):null,L.includes("tech-decisions")?(0,t.jsx)($.TabsContent,{value:"tech-decisions",className:"mt-0 flex min-h-0 flex-1 flex-col",children:h?(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,t.jsx)(ry,{data:h})}),(0,t.jsx)(ag,{onApprove:m??(()=>void 0),onReject:x,isProcessing:g,isRejecting:I,chatInput:A,onChatInputChange:P})]}):(0,t.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,t.jsx)(a.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})})}):null,L.includes("product-decisions")?(0,t.jsx)($.TabsContent,{value:"product-decisions",className:"mt-0 flex-1 overflow-y-auto",children:null===y?(0,t.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,t.jsx)(a.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})}):y?(0,t.jsx)(rk,{data:y}):(0,t.jsx)("p",{className:"text-muted-foreground p-4 text-center text-sm",children:"No product decisions available."})}):null,L.includes("merge-review")?(0,t.jsx)($.TabsContent,{value:"merge-review",className:"mt-0 flex min-h-0 flex-1 flex-col",children:v?(0,t.jsx)(rQ,{data:v,readOnly:"maintain"===e.lifecycle,onApprove:b??(()=>void 0),onReject:k,isProcessing:j,isRejecting:I,chatInput:A,onChatInputChange:P}):(0,t.jsx)("div",{className:"flex items-center justify-center p-8",children:j?(0,t.jsx)(a.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"}):(0,t.jsxs)("div",{className:"text-muted-foreground flex flex-col items-center gap-2 text-sm",children:[(0,t.jsx)(B.AlertCircle,{className:"h-6 w-6"}),(0,t.jsx)("span",{children:"Merge review data unavailable"})]})})}):null]})})}function ag({onApprove:e,onReject:n,isProcessing:r,isRejecting:l,chatInput:a,onChatInputChange:i}){return(0,t.jsx)(et,{onReject:n,onApprove:e,approveLabel:"Approve Plan",revisionPlaceholder:"Ask AI to revise the plan...",isProcessing:r,isRejecting:l,chatInput:a,onChatInputChange:i})}var ay=e.i(50923),av=e.i(21269),ab=e.i(1264);let ak=(0,f.createServerReference)("40fa985fabafece2635f86e6e865cd984ecfa46a6f",f.callServer,void 0,f.findSourceMapURL,"rebaseFeature");var aj=e.i(99045);function aw(e){return"requirements"===e.lifecycle&&"action-required"===e.state?"prd-review":"implementation"===e.lifecycle&&"action-required"===e.state?"tech-decisions":"review"===e.lifecycle&&("action-required"===e.state||"error"===e.state)?"merge-review":"overview"}function aN(e,t,r,a,i,s){let[o,c]=(0,n.useState)(!1),u=(0,n.useRef)(r),d=(0,n.useRef)(a);return u.current=r,d.current=a,(0,n.useEffect)(()=>{if(d.current(),!e)return;let n=!1;return c(!0),t(e).then(e=>{n||u.current(e)}).catch(()=>{!n&&i&&l.toast.error(i)}).finally(()=>{n||c(!1)}),()=>{n=!0}},[e,t,i,s]),o}let aS=(0,f.createServerReference)("408c3061b1b4d63b526b0b58e911a7bf5907d035ff",f.callServer,void 0,f.findSourceMapURL,"getFeatureDrawerData"),aC=(0,f.createServerReference)("40c244e58d6970627c5fa19bf95f21da09ea2f9834",f.callServer,void 0,f.findSourceMapURL,"getBranchSyncStatus"),aT=new Map;function aE({view:e,urlTab:f}){var R;let D,L,z,F,B,$=(0,k.useFeatureFlags)(),_=(0,r.useRouter)(),U=(0,j.useSoundAction)("reject"),[q,H]=(0,n.useState)(e);(0,n.useEffect)(()=>{H(e)},[e]);let V="feature"===q.type?q.node:null,{events:W}=(0,S.useAgentEventsContext)(),K=(0,n.useRef)(0);(0,n.useEffect)(()=>{if(K.current>W.length&&(K.current=0),!V||W.length<=K.current)return;let e=W.slice(K.current);for(let t of(K.current=W.length,(0,aj.resolveSseEventUpdates)(e)))t.featureId===V.featureId&&"deleting"!==V.state&&(void 0!==t.state||void 0!==t.lifecycle)&&H(e=>{if("feature"!==e.type)return e;let n={...e.node,...void 0!==t.state&&{state:t.state},...void 0!==t.lifecycle&&{lifecycle:t.lifecycle}};return{...e,node:n,initialTab:aw(n)}})},[W,V]);let Q=(0,r.usePathname)().startsWith("/feature/");R=V?.featureId??null,D=(0,n.useRef)(Q),L=(0,n.useRef)(!1),z=(0,n.useCallback)(async()=>{if(R&&!L.current){L.current=!0;try{let e=await aS(R);if(!e)return;H(t=>(function(e,t){if("feature"!==e.type)return e;let n={...e.node,...t},r=n.state!==e.node.state||n.lifecycle!==e.node.lifecycle;return{...e,node:n,initialTab:r?aw(n):e.initialTab}})(t,e))}catch{}finally{L.current=!1}}},[R,H]),F=(0,n.useRef)(!1),(0,n.useEffect)(()=>{!Q||D.current&&F.current||(F.current=!0,z()),D.current=Q},[Q,z]),(0,n.useEffect)(()=>{if(!Q||!R)return;let e=setInterval(()=>{z()},15e3);return()=>clearInterval(e)},[Q,R,z]);let G=(0,n.useCallback)(()=>{_.push("/")},[_]),[J,X]=(0,n.useState)(""),[Z,Y]=(0,n.useState)(null),[ee,et]=(0,n.useState)({}),[en,er]=(0,n.useState)({}),[el,ea]=(0,n.useState)(null),[ei,es]=(0,n.useState)(void 0),[eo,ec]=(0,n.useState)(null),[eu,ed]=(0,n.useState)(!1),[ep,ef]=(0,n.useState)(!1),[eh,em]=(0,n.useState)(!1),ex=(0,n.useRef)(!1),eg="feature"===q.type?q.initialTab:void 0;(0,n.useEffect)(()=>{X("")},[eg]);let ey=(0,n.useRef)(0),ev=(0,n.useRef)(V?.state),eb=(0,n.useRef)(V?.lifecycle);(V?.state!==ev.current||V?.lifecycle!==eb.current)&&(ev.current=V?.state,eb.current=V?.lifecycle,ey.current+=1);let ek=ey.current,ej=aN(V?.lifecycle==="requirements"&&V?.state==="action-required"?V.featureId:null,y,e=>{if(e.error)return void l.toast.error(e.error);if(e.questionnaire){Y(e.questionnaire);let t={};for(let n of e.questionnaire.questions){let e=n.options.find(e=>e.recommended);e&&(t[n.id]=e.id)}et(t),er(t)}},()=>{et({}),er({}),Y(null)},"Failed to load questionnaire",ek),ew=V?.lifecycle==="implementation"&&V?.state==="action-required"?V.featureId:null,eN=aN(ew,v,e=>{e.error?l.toast.error(e.error):e.techDecisions&&ea(e.techDecisions)},()=>ea(null),"Failed to load tech decisions",ek),eS=aN(ew,y,e=>{e.productDecisions&&es(e.productDecisions)},()=>es(void 0),void 0,ek),eC=aN(V?.lifecycle==="review"&&(V?.state==="action-required"||V?.state==="error")||V?.lifecycle==="maintain"&&V?.pr?V.featureId:null,b,e=>{"error"in e?l.toast.error(e.error):ec(e)},()=>ec(null),"Failed to load merge review data",ek),eT=J.trim().length>0,eE=V?.lifecycle==="requirements"&&V?.state==="action-required"&&Object.keys(en).some(e=>en[e]!==ee[e]),eM=(0,n.useCallback)(()=>{X(""),et({...en})},[en]),{attemptClose:eI}=(0,w.useGuardedDrawerClose)({open:Q,isDirty:eT||eE,onClose:G,onReset:eM}),eA=(0,n.useCallback)(async(e,t,n=[],r)=>{if(V?.featureId){ex.current=!0,em(!0);try{let a=n.map(e=>e.path).filter(Boolean),i=n.filter(e=>e.notes?.trim()),s=i.length>0?`${e}
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,69090,(e,t,n)=>{"use strict";var r=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,l=/\n/g,a=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,u=/^\s+|\s+$/g;function d(e){return e?e.replace(u,""):""}t.exports=function(e,t){if("string"!=typeof e)throw TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,u=1;function p(e){var t=e.match(l);t&&(n+=t.length);var r=e.lastIndexOf("\n");u=~r?e.length-r:u+e.length}function f(){var e={line:n,column:u};return function(t){return t.position=new h(e),x(a),t}}function h(e){this.start=e,this.end={line:n,column:u},this.source=t.source}function m(r){var l=Error(t.source+":"+n+":"+u+": "+r);if(l.reason=r,l.filename=t.source,l.line=n,l.column=u,l.source=e,t.silent);else throw l}function x(t){var n=t.exec(e);if(n){var r=n[0];return p(r),e=e.slice(r.length),n}}function g(e){var t;for(e=e||[];t=y();)!1!==t&&e.push(t);return e}function y(){var t=f();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;""!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return m("End of comment missing");var r=e.slice(2,n-2);return u+=2,p(r),e=e.slice(n),u+=2,t({type:"comment",comment:r})}}h.prototype.content=e,x(a);var v,b=[];for(g(b);v=function(){var e=f(),t=x(i);if(t){if(y(),!x(s))return m("property missing ':'");var n=x(o),l=e({type:"declaration",property:d(t[0].replace(r,"")),value:n?d(n[0].replace(r,"")):""});return x(c),l}}();)!1!==v&&(b.push(v),g(b));return b}},59596,(e,t,n)=>{"use strict";var r=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e,t){let n=null;if(!e||"string"!=typeof e)return n;let r=(0,l.default)(e),a="function"==typeof t;return r.forEach(e=>{if("declaration"!==e.type)return;let{property:r,value:l}=e;a?t(r,l,e):l&&((n=n||{})[r]=l)}),n};let l=r(e.r(69090))},51521,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.camelCase=void 0;var r=/^--[a-zA-Z0-9_-]+$/,l=/-([a-z])/g,a=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,o=function(e,t){return t.toUpperCase()},c=function(e,t){return"".concat(t,"-")};n.camelCase=function(e,t){var n;return(void 0===t&&(t={}),!(n=e)||a.test(n)||r.test(n))?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(s,c):e.replace(i,c)).replace(l,o))}},63185,(e,t,n)=>{"use strict";var r=(e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(e.r(59596)),l=e.r(51521);function a(e,t){var n={};return e&&"string"==typeof e&&(0,r.default)(e,function(e,r){e&&r&&(n[(0,l.camelCase)(e,t)]=r)}),n}a.default=a,t.exports=a},75609,(e,t,n)=>{"use strict";var r=Object.prototype.hasOwnProperty,l=Object.prototype.toString,a=Object.defineProperty,i=Object.getOwnPropertyDescriptor,s=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===l.call(e)},o=function(e){if(!e||"[object Object]"!==l.call(e))return!1;var t,n=r.call(e,"constructor"),a=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!a)return!1;for(t in e);return void 0===t||r.call(e,t)},c=function(e,t){a&&"__proto__"===t.name?a(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},u=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;else if(i)return i(e,t).value}return e[t]};t.exports=function e(){var t,n,r,l,a,i,d=arguments[0],p=1,f=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},p=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});p<f;++p)if(t=arguments[p],null!=t)for(n in t)r=u(d,n),d!==(l=u(t,n))&&(h&&l&&(o(l)||(a=s(l)))?(a?(a=!1,i=r&&s(r)?r:[]):i=r&&o(r)?r:{},c(d,{name:n,newValue:e(h,i,l)})):void 0!==l&&c(d,{name:n,newValue:l}));return d}},36986,e=>{"use strict";var t=e.i(20314),n=e.i(79054),r=e.i(31406),l=e.i(60112),a=e.i(83428),i=e.i(67669),s=e.i(24042),o=e.i(64970),c=e.i(33548),u=e.i(23925),d=e.i(8986),p=e.i(30702),f=e.i(21023);let h=(0,f.createServerReference)("601add01582b1aa78884bc53b6e83ece2832d4abef",f.callServer,void 0,f.findSourceMapURL,"approveFeature");var m=e.i(57431),x=e.i(17033);let g=(0,f.createServerReference)("70b07ec6f2d57e7833e585bb9cab7ba92dbcf780a1",f.callServer,void 0,f.findSourceMapURL,"rejectFeature"),y=(0,f.createServerReference)("4042b8753e2425602beb5ef8df81f66b8e4531927a",f.callServer,void 0,f.findSourceMapURL,"getFeatureArtifact"),v=(0,f.createServerReference)("408b58a4adf28db0ed38249400b865d17b7dd90f5f",f.callServer,void 0,f.findSourceMapURL,"getResearchArtifact"),b=(0,f.createServerReference)("405b226fc478d1d14004d924ec7fddde40441ba3a4",f.callServer,void 0,f.findSourceMapURL,"getMergeReviewData");var k=e.i(75921),j=e.i(8361),w=e.i(30153),N=e.i(8537),S=e.i(39443);e.i(1650);var C=e.i(11495);e.i(99348);var T=e.i(17466),E=e.i(45811),M=e.i(35364),I=e.i(2828);e.i(31566);var A=e.i(65104);e.i(81803);var P=e.i(72714),R=e.i(38573),D=e.i(19933),L=e.i(99105),z=e.i(51251),F=e.i(70646);function O({actions:e,repositoryPath:r,worktreePath:l,showSpecs:i}){let[s,o]=(0,n.useState)(!1),p=e.ideLoading||e.shellLoading||e.specsLoading,f=e.ideError??e.shellError??e.specsError;return(0,t.jsxs)(F.DropdownMenu,{modal:!1,children:[(0,t.jsx)(F.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsxs)(M.Button,{variant:"outline",size:"sm",className:"gap-1.5",disabled:p,children:[p?(0,t.jsx)(a.Loader2,{className:"size-4 animate-spin"}):f?(0,t.jsx)(z.CircleAlert,{className:"text-destructive size-4"}):(0,t.jsx)(D.FolderOpen,{className:"size-4"}),"Open",(0,t.jsx)(L.ChevronDown,{className:"size-3 opacity-60"})]})}),(0,t.jsxs)(F.DropdownMenuContent,{align:"start",className:"w-48",children:[(0,t.jsx)(F.DropdownMenuLabel,{children:"Open in"}),(0,t.jsxs)(F.DropdownMenuItem,{onClick:e.openInIde,disabled:e.ideLoading,className:"gap-2",children:[e.ideLoading?(0,t.jsx)(a.Loader2,{className:"size-4 animate-spin"}):e.ideError?(0,t.jsx)(z.CircleAlert,{className:"text-destructive size-4"}):(0,t.jsx)(d.Code2,{className:"size-4"}),"IDE"]}),(0,t.jsxs)(F.DropdownMenuItem,{onClick:e.openInShell,disabled:e.shellLoading,className:"gap-2",children:[e.shellLoading?(0,t.jsx)(a.Loader2,{className:"size-4 animate-spin"}):e.shellError?(0,t.jsx)(z.CircleAlert,{className:"text-destructive size-4"}):(0,t.jsx)(R.Terminal,{className:"size-4"}),"Terminal"]}),(0,t.jsxs)(F.DropdownMenuItem,{onClick:e.openSpecsFolder,disabled:e.specsLoading||!i,className:"gap-2",children:[e.specsLoading?(0,t.jsx)(a.Loader2,{className:"size-4 animate-spin"}):e.specsError?(0,t.jsx)(z.CircleAlert,{className:"text-destructive size-4"}):(0,t.jsx)(D.FolderOpen,{className:"size-4"}),"Specs Folder"]}),(0,t.jsx)(F.DropdownMenuSeparator,{}),(0,t.jsxs)(F.DropdownMenuItem,{onClick:()=>{navigator.clipboard.writeText(l??r),o(!0),setTimeout(()=>o(!1),2e3)},className:"gap-2",children:[s?(0,t.jsx)(u.Check,{className:"size-4 text-green-600"}):(0,t.jsx)(c.Copy,{className:"size-4"}),s?"Copied!":"Copy path"]})]})]})}var B=e.i(79687),$=e.i(68304);let _=(0,f.createServerReference)("409e44d5bca1040351490dc8608cf408a328d887dc",f.callServer,void 0,f.findSourceMapURL,"getFeaturePhaseTimings"),U=(0,f.createServerReference)("40bf611ba18b63e09303b06141faef675f94ba2c84",f.callServer,void 0,f.findSourceMapURL,"getFeaturePlan");var q=e.i(11345),H=e.i(76016),V=e.i(31777),W=e.i(81846),K=e.i(16868),Q=e.i(3645);let G=(0,Q.default)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);var J=e.i(58481),X=e.i(48306);e.i(50032);var Z=e.i(86254),Y=e.i(42076);let ee=new Set([".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp",".ico",".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".txt",".md",".csv",".json",".yaml",".yml",".xml",".ts",".tsx",".js",".jsx",".py",".rb",".go",".rs",".java",".c",".cpp",".h",".hpp",".cs",".swift",".kt",".html",".css",".scss",".less",".sh",".bash",".zsh",".fish",".toml",".ini",".cfg",".conf",".env",".zip",".tar",".gz",".log"]);function et({onReject:e,onApprove:r,approveLabel:l,approveVariant:a="default",revisionPlaceholder:i,isProcessing:s=!1,isRejecting:o=!1,children:c,chatInput:d,onChatInputChange:p}){let f="warning"===a,h=f?J.AlertTriangle:u.Check,m=f?"bg-orange-500/85":"bg-blue-500/85",[x,g]=(0,n.useState)(""),y=d??x,v=p??g,b=(0,j.useSoundAction)("approve"),k=s||o,[w,N]=(0,n.useState)([]),[S,C]=(0,n.useState)(!1),[T,E]=(0,n.useState)(null),[A,P]=(0,n.useState)(!1),[R,D]=(0,n.useState)(!1),[L,z]=(0,n.useState)(!1),F=y.trim().length>0,O=F?A||R&&L:!A,B=(0,n.useRef)(0),$=(0,n.useRef)(crypto.randomUUID()),_=(0,n.useRef)(null);(0,n.useEffect)(()=>{function e(e){("Control"===e.key||"Meta"===e.key)&&D(!0),"Shift"===e.key&&z(!0)}function t(e){("Control"===e.key||"Meta"===e.key)&&D(!1),"Shift"===e.key&&z(!1)}function n(){D(!1),z(!1)}return window.addEventListener("keydown",e),window.addEventListener("keyup",t),window.addEventListener("blur",n),()=>{window.removeEventListener("keydown",e),window.removeEventListener("keyup",t),window.removeEventListener("blur",n)}},[]);let U=(0,n.useCallback)(async e=>{for(let t of(E(null),e)){if(t.size>0xa00000)return void E(`"${t.name}" exceeds 10 MB limit`);let e=function(e){let t=e.lastIndexOf(".");return t>=0?e.slice(t).toLowerCase():""}(t.name);if(e&&!ee.has(e))return void E(`File type "${e}" is not allowed`)}for(let t of e){let e=crypto.randomUUID();N(n=>[...n,{id:e,name:t.name,size:t.size,mimeType:t.type||"application/octet-stream",path:"",loading:!0}]);try{let n=new FormData;n.append("file",t),n.append("sessionId",$.current);let r=await fetch("/api/attachments/upload",{method:"POST",body:n});if(!r.ok){let t=await r.json().catch(()=>({error:"Upload failed"}));N(t=>t.filter(t=>t.id!==e)),E(t.error??"Upload failed");return}let l=await r.json();N(t=>t.some(t=>t.id!==e&&t.path===l.path)?t.filter(t=>t.id!==e):t.map(t=>t.id===e?{...l,id:e,loading:!1}:t))}catch{N(t=>t.filter(t=>t.id!==e)),E("Upload failed")}}},[]),H=(0,n.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),B.current+=1,1===B.current&&C(!0)},[]),W=(0,n.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),B.current-=1,0===B.current&&C(!1)},[]),Q=(0,n.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),et=(0,n.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),B.current=0,C(!1);let t=Array.from(e.dataTransfer.files);t.length>0&&U(t)},[U]),en=(0,n.useCallback)(e=>{let t=e.clipboardData?.items;if(!t)return;let n=[];for(let e of Array.from(t))if("file"===e.kind){let t=e.getAsFile();t&&n.push(t)}n.length>0&&(e.preventDefault(),U(n))},[U]),er=(0,n.useCallback)(async()=>{try{let e=await (0,Y.pickFiles)();e&&N(t=>{let n=new Set(t.map(e=>e.path)),r=e.filter(e=>!n.has(e.path)).map(e=>({id:crypto.randomUUID(),name:e.name,size:e.size,mimeType:"application/octet-stream",path:e.path}));return r.length>0?[...t,...r]:t})}catch{}},[]),el=(0,n.useCallback)(e=>{N(t=>t.filter(t=>t.id!==e))},[]),ea=(0,n.useCallback)((e,t)=>{N(n=>n.map(n=>n.id===e?{...n,notes:t}:n))},[]),ei=(0,n.useCallback)(()=>{v(""),N([]),E(null)},[v]),es=(0,n.useCallback)(e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),_.current?.requestSubmit())},[]),eo="u">typeof navigator&&/Mac/i.test(navigator.userAgent)?"⌘":"Ctrl";return(0,t.jsxs)("div",{className:"border-border shrink-0 border-t",children:[c,e?(0,t.jsx)(I.TooltipProvider,{delayDuration:400,children:(0,t.jsx)("form",{ref:_,onSubmit:function(t){t.preventDefault();let n=y.trim();if(O)b.play(),r(),ei();else{if(!n||!e)return;e(n,w.filter(e=>!e.loading)),ei()}},className:"p-3",children:(0,t.jsx)("div",{role:"region","aria-label":"File drop zone","data-drag-over":S?"true":"false",onDragEnter:H,onDragLeave:W,onDragOver:Q,onDrop:et,className:(0,V.cn)("rounded-md border-2 border-transparent transition-colors",S&&"border-primary/50 bg-primary/5"),children:(0,t.jsxs)("div",{className:"border-input focus-within:ring-ring/50 focus-within:border-ring flex flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow] focus-within:ring-[3px]",children:[(0,t.jsx)(X.Textarea,{placeholder:i??"Ask AI to revise...","aria-label":i??"Ask AI to revise...",disabled:k,value:y,onChange:e=>v(e.target.value),onKeyDown:es,onPaste:en,rows:1,className:"max-h-[35dvh] min-h-9 flex-1 resize-none overflow-y-auto rounded-none border-0 py-2 shadow-none focus-visible:ring-0","data-testid":"drawer-chat-input"}),w.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:w.map(e=>(0,t.jsx)(Z.AttachmentChip,{name:e.name,size:e.size,mimeType:e.mimeType,path:e.path,onRemove:()=>el(e.id),disabled:k,loading:e.loading,notes:e.notes,onNotesChange:t=>ea(e.id,t)},e.id))}),T?(0,t.jsx)("p",{className:"text-destructive px-3 pb-2 text-xs",children:T}):null,(0,t.jsxs)("div",{className:"border-input flex items-center gap-2 border-t px-3 py-1.5",children:[(0,t.jsxs)("span",{className:"text-muted-foreground flex-1 truncate text-[11px]",children:[(0,t.jsxs)("kbd",{className:"bg-muted rounded px-1 py-0.5 font-mono text-[10px]",children:[eo,"+Enter"]})," ",F?"reject":"approve"]}),(0,t.jsxs)(I.Tooltip,{children:[(0,t.jsx)(I.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:er,disabled:k,"aria-label":"Attach files",className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,t.jsx)(K.PaperclipIcon,{className:"h-4 w-4"})})}),(0,t.jsx)(I.TooltipContent,{side:"top",children:"Attach files"})]}),(0,t.jsx)("div",{onMouseLeave:()=>P(!1),children:(0,t.jsxs)(I.Tooltip,{children:[(0,t.jsx)(I.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"submit",disabled:k,"data-testid":"drawer-action-submit",className:(0,V.cn)("relative flex h-9 min-w-[12rem] cursor-pointer items-center overflow-hidden rounded-md border pr-10 pl-4 text-sm font-medium whitespace-nowrap transition-colors","disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",O?`${f?"border-orange-400/60":"border-blue-400/60"} text-white`:F&&R&&!L?"border-primary bg-muted ring-primary/30 shadow-sm ring-1":"border-border bg-muted/50 hover:bg-muted shadow-sm"),children:[(0,t.jsx)("div",{className:(0,V.cn)("pointer-events-none absolute inset-0 transition-transform duration-300 ease-in-out",m),style:{transform:O?"translateX(0)":"translateX(100%)"}}),(0,t.jsxs)("span",{className:(0,V.cn)("absolute inset-0 z-10 flex items-center justify-center gap-2 pr-8 transition-opacity duration-300",O?"opacity-0":"opacity-100"),children:[(0,t.jsx)(G,{className:"h-4 w-4 shrink-0"}),"Reject"]}),(0,t.jsxs)("span",{className:(0,V.cn)("absolute inset-0 z-10 flex items-center justify-center gap-2 text-white transition-opacity duration-300",O?"opacity-100":"opacity-0"),children:[(0,t.jsx)(h,{className:"h-4 w-4 shrink-0"}),l]}),(0,t.jsx)("span",{className:(0,V.cn)(`border-input/60 absolute inset-y-0 right-0 z-20 flex w-8 cursor-pointer items-center justify-center rounded-r-[5px] border-l ${m} transition-opacity duration-300`,!F&&!A&&"pointer-events-none opacity-0"),onMouseEnter:()=>P(!0),children:(0,t.jsx)(q.ChevronLeft,{className:"h-4 w-4 text-white"})})]})}),f?null:(0,t.jsx)(I.TooltipContent,{side:"top",children:O?l:"Send revision feedback"})]})})]})]})})})}):(0,t.jsx)("div",{className:"flex items-center gap-2 px-4 pb-4",children:(0,t.jsx)(M.Button,{type:"button",className:"flex-1",disabled:k,onClick:()=>{b.play(),r()},children:l})})]})}function en({data:e,selections:r,onSelect:l,onApprove:a,onReject:i,isProcessing:s=!1,isRejecting:o=!1,showHeader:c=!1,chatInput:u,onChatInputChange:d}){let{question:p,context:f,questions:h,finalAction:m}=e,[x,g]=(0,n.useState)(0),y=(0,j.useSoundAction)("select"),v=(0,j.useSoundAction)("navigate"),b=h.length,k=x===b-1,w=h[x],N=(0,n.useMemo)(()=>Object.keys(r).length,[r]),S=(0,n.useCallback)((e,t)=>{y.play(),l(e,t),k||setTimeout(()=>g(e=>e+1),250)},[l,k,y]);return 0===b?null:(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsxs)("div",{className:"flex-1 space-y-4 overflow-y-auto p-4",children:[c?(0,t.jsxs)("div",{className:"border-border flex items-start gap-3 border-b pb-3",children:[(0,t.jsx)("div",{className:"mt-1.5 h-2 w-2 shrink-0 rounded-full bg-amber-500"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("h3",{className:"text-foreground mb-1.5 text-sm font-bold",children:p}),(0,t.jsx)("p",{className:"text-muted-foreground text-xs leading-relaxed",children:f})]})]}):null,(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsxs)("label",{className:"text-foreground min-w-0 flex-1 text-sm font-semibold",children:[x+1,". ",w.question]}),(0,t.jsx)("div",{className:"mt-1.5 flex shrink-0 gap-1",children:h.map((e,n)=>(0,t.jsx)("button",{type:"button","aria-label":`Go to question ${n+1}`,className:(0,V.cn)("h-1.5 rounded-full transition-all duration-200",n===x?"bg-primary w-4":"w-1.5",n!==x&&r[e.id]?"bg-primary/50":"",n===x||r[e.id]?"":"bg-muted-foreground/25"),onClick:()=>{v.play(),g(n)}},e.id))})]}),(0,t.jsx)("div",{className:"space-y-2",children:w.options.map((e,n)=>{let l=r[w.id]===e.id,a=String.fromCharCode(65+n);return(0,t.jsx)("button",{type:"button",className:(0,V.cn)("border-border w-full overflow-hidden rounded-md border px-3 py-3 text-left text-xs transition-all","hover:border-primary/70 hover:bg-primary/5 group",l&&"border-primary bg-primary/5",e.isNew&&"animate-option-highlight"),disabled:s,onClick:()=>S(w.id,e.id),children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsxs)("span",{className:"text-muted-foreground mt-0.5 font-mono text-xs",children:[a,"."]}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("div",{className:"text-foreground mb-0.5 text-xs font-semibold wrap-break-word",children:e.label}),(0,t.jsx)("div",{className:"text-muted-foreground text-xs leading-snug",children:e.rationale})]}),e.recommended||e.isNew?(0,t.jsx)("div",{className:"shrink-0 pt-0.5",children:e.recommended?(0,t.jsx)(W.Badge,{className:"px-1.5 py-0 text-[10px] whitespace-nowrap",children:"AI Recommended"}):(0,t.jsx)(W.Badge,{className:"border-transparent bg-emerald-600 px-1.5 py-0 text-[10px] whitespace-nowrap text-white hover:bg-emerald-600/80",children:"New"})}):null]})},e.id)})})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between pt-2",children:[(0,t.jsxs)(M.Button,{type:"button",variant:"ghost",size:"sm",disabled:0===x||s,onClick:()=>{v.play(),g(e=>e-1)},children:[(0,t.jsx)(q.ChevronLeft,{className:"mr-1 h-4 w-4"}),"Previous"]}),k?null:(0,t.jsxs)(M.Button,{type:"button",variant:"ghost",size:"sm",disabled:s,onClick:()=>{v.play(),g(e=>e+1)},children:[r[w.id]?"Next":"Skip",(0,t.jsx)(H.ChevronRight,{className:"ml-1 h-4 w-4"})]})]})]}),(0,t.jsx)(et,{onReject:i,onApprove:()=>a(m.id),approveLabel:m.label,revisionPlaceholder:"Ask AI to refine requirements...",isProcessing:s,isRejecting:o,chatInput:u,onChatInputChange:d,children:(0,t.jsx)("div",{className:(0,V.cn)("bg-muted h-1.5 overflow-hidden",N>0&&N<b||s?"opacity-100":"opacity-0","transition-opacity duration-200"),"data-testid":"progress-bar-container",children:s?(0,t.jsx)("div",{className:"bg-primary animate-indeterminate-progress h-full w-1/3"}):(0,t.jsx)("div",{className:"bg-primary h-full transition-all duration-300",style:{width:`${b>0?N/b*100:0}%`},"data-testid":"progress-bar"})})})]})}function er(){}function el(){}let ea=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ei=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,es={};function eo(e,t){return((t||es).jsx?ei:ea).test(e)}let ec=/[ \t\n\f\r]/g;function eu(e){return""===e.replace(ec,"")}class ed{constructor(e,t){this.attribute=t,this.property=e}}ed.prototype.attribute="",ed.prototype.booleanish=!1,ed.prototype.boolean=!1,ed.prototype.commaOrSpaceSeparated=!1,ed.prototype.commaSeparated=!1,ed.prototype.defined=!1,ed.prototype.mustUseProperty=!1,ed.prototype.number=!1,ed.prototype.overloadedBoolean=!1,ed.prototype.property="",ed.prototype.spaceSeparated=!1,ed.prototype.space=void 0;let ep=0,ef=eb(),eh=eb(),em=eb(),ex=eb(),eg=eb(),ey=eb(),ev=eb();function eb(){return 2**++ep}e.s(["boolean",0,ef,"booleanish",0,eh,"commaOrSpaceSeparated",0,ev,"commaSeparated",0,ey,"number",0,ex,"overloadedBoolean",0,em,"spaceSeparated",0,eg],83954);var ek=e.i(83954);let ej=Object.keys(ek);class ew extends ed{constructor(e,t,n,r){let l=-1;if(super(e,t),function(e,t,n){n&&(e[t]=n)}(this,"space",r),"number"==typeof n)for(;++l<ej.length;){const e=ej[l];!function(e,t,n){n&&(e[t]=n)}(this,ej[l],(n&ek[e])===ek[e])}}}function eN(e){return e.toLowerCase()}ew.prototype.defined=!0;let eS=/[A-Z]/g,eC=/-[a-z]/g,eT=/^data[-\w.:]+$/i;function eE(e){return"-"+e.toLowerCase()}function eM(e){return e.charAt(1).toUpperCase()}let eI={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};class eA{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function eP(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new eA(n,r,t)}function eR(e){let t={},n={};for(let[r,l]of Object.entries(e.properties)){let a=new ew(r,e.transform(e.attributes||{},r),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[eN(r)]=r,n[eN(a.attribute)]=r}return new eA(t,n,e.space)}eA.prototype.normal={},eA.prototype.property={},eA.prototype.space=void 0;let eD=eR({properties:{ariaActiveDescendant:null,ariaAtomic:eh,ariaAutoComplete:null,ariaBusy:eh,ariaChecked:eh,ariaColCount:ex,ariaColIndex:ex,ariaColSpan:ex,ariaControls:eg,ariaCurrent:null,ariaDescribedBy:eg,ariaDetails:null,ariaDisabled:eh,ariaDropEffect:eg,ariaErrorMessage:null,ariaExpanded:eh,ariaFlowTo:eg,ariaGrabbed:eh,ariaHasPopup:null,ariaHidden:eh,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:eg,ariaLevel:ex,ariaLive:null,ariaModal:eh,ariaMultiLine:eh,ariaMultiSelectable:eh,ariaOrientation:null,ariaOwns:eg,ariaPlaceholder:null,ariaPosInSet:ex,ariaPressed:eh,ariaReadOnly:eh,ariaRelevant:null,ariaRequired:eh,ariaRoleDescription:eg,ariaRowCount:ex,ariaRowIndex:ex,ariaRowSpan:ex,ariaSelected:eh,ariaSetSize:ex,ariaSort:null,ariaValueMax:ex,ariaValueMin:ex,ariaValueNow:ex,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function eL(e,t){return t in e?e[t]:t}function ez(e,t){return eL(e,t.toLowerCase())}let eF=eR({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ey,acceptCharset:eg,accessKey:eg,action:null,allow:null,allowFullScreen:ef,allowPaymentRequest:ef,allowUserMedia:ef,alt:null,as:null,async:ef,autoCapitalize:null,autoComplete:eg,autoFocus:ef,autoPlay:ef,blocking:eg,capture:null,charSet:null,checked:ef,cite:null,className:eg,cols:ex,colSpan:null,content:null,contentEditable:eh,controls:ef,controlsList:eg,coords:ex|ey,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ef,defer:ef,dir:null,dirName:null,disabled:ef,download:em,draggable:eh,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ef,formTarget:null,headers:eg,height:ex,hidden:em,high:ex,href:null,hrefLang:null,htmlFor:eg,httpEquiv:eg,id:null,imageSizes:null,imageSrcSet:null,inert:ef,inputMode:null,integrity:null,is:null,isMap:ef,itemId:null,itemProp:eg,itemRef:eg,itemScope:ef,itemType:eg,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ef,low:ex,manifest:null,max:null,maxLength:ex,media:null,method:null,min:null,minLength:ex,multiple:ef,muted:ef,name:null,nonce:null,noModule:ef,noValidate:ef,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ef,optimum:ex,pattern:null,ping:eg,placeholder:null,playsInline:ef,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ef,referrerPolicy:null,rel:eg,required:ef,reversed:ef,rows:ex,rowSpan:ex,sandbox:eg,scope:null,scoped:ef,seamless:ef,selected:ef,shadowRootClonable:ef,shadowRootDelegatesFocus:ef,shadowRootMode:null,shape:null,size:ex,sizes:null,slot:null,span:ex,spellCheck:eh,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ex,step:null,style:null,tabIndex:ex,target:null,title:null,translate:null,type:null,typeMustMatch:ef,useMap:null,value:eh,width:ex,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:eg,axis:null,background:null,bgColor:null,border:ex,borderColor:null,bottomMargin:ex,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ef,declare:ef,event:null,face:null,frame:null,frameBorder:null,hSpace:ex,leftMargin:ex,link:null,longDesc:null,lowSrc:null,marginHeight:ex,marginWidth:ex,noResize:ef,noHref:ef,noShade:ef,noWrap:ef,object:null,profile:null,prompt:null,rev:null,rightMargin:ex,rules:null,scheme:null,scrolling:eh,standby:null,summary:null,text:null,topMargin:ex,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ex,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ef,disableRemotePlayback:ef,prefix:null,property:null,results:ex,security:null,unselectable:null},space:"html",transform:ez}),eO=eR({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ev,accentHeight:ex,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ex,amplitude:ex,arabicForm:null,ascent:ex,attributeName:null,attributeType:null,azimuth:ex,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ex,by:null,calcMode:null,capHeight:ex,className:eg,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ex,diffuseConstant:ex,direction:null,display:null,dur:null,divisor:ex,dominantBaseline:null,download:ef,dx:null,dy:null,edgeMode:null,editable:null,elevation:ex,enableBackground:null,end:null,event:null,exponent:ex,externalResourcesRequired:null,fill:null,fillOpacity:ex,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ey,g2:ey,glyphName:ey,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ex,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ex,horizOriginX:ex,horizOriginY:ex,id:null,ideographic:ex,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ex,k:ex,k1:ex,k2:ex,k3:ex,k4:ex,kernelMatrix:ev,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ex,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ex,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ex,overlineThickness:ex,paintOrder:null,panose1:null,path:null,pathLength:ex,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:eg,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ex,pointsAtY:ex,pointsAtZ:ex,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ev,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ev,rev:ev,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ev,requiredFeatures:ev,requiredFonts:ev,requiredFormats:ev,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ex,specularExponent:ex,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ex,strikethroughThickness:ex,string:null,stroke:null,strokeDashArray:ev,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ex,strokeOpacity:ex,strokeWidth:null,style:null,surfaceScale:ex,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ev,tabIndex:ex,tableValues:null,target:null,targetX:ex,targetY:ex,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ev,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ex,underlineThickness:ex,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ex,values:null,vAlphabetic:ex,vMathematical:ex,vectorEffect:null,vHanging:ex,vIdeographic:ex,version:null,vertAdvY:ex,vertOriginX:ex,vertOriginY:ex,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ex,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:eL}),eB=eR({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),e$=eR({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ez}),e_=eR({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),eU=eP([eD,eF,eB,e$,e_],"html"),eq=eP([eD,eO,eB,e$,e_],"svg");var eH=e.i(63185);let eV=eK("end"),eW=eK("start");function eK(e){return function(t){let n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function eQ(e){return e&&"object"==typeof e?"position"in e||"type"in e?eJ(e.position):"start"in e||"end"in e?eJ(e):"line"in e||"column"in e?eG(e):"":""}function eG(e){return eX(e&&e.line)+":"+eX(e&&e.column)}function eJ(e){return eG(e&&e.start)+"-"+eG(e&&e.end)}function eX(e){return e&&"number"==typeof e?e:1}class eZ extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",l={},a=!1;if(t&&(l="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!l.cause&&e&&(a=!0,r=e.message,l.cause=e),!l.ruleId&&!l.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?l.ruleId=n:(l.source=n.slice(0,e),l.ruleId=n.slice(e+1))}if(!l.place&&l.ancestors&&l.ancestors){const e=l.ancestors[l.ancestors.length-1];e&&(l.place=e.position)}const i=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=i?i.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=i?i.line:void 0,this.name=eQ(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=a&&l.cause&&"string"==typeof l.cause.stack?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}eZ.prototype.file="",eZ.prototype.name="",eZ.prototype.reason="",eZ.prototype.message="",eZ.prototype.stack="",eZ.prototype.column=void 0,eZ.prototype.line=void 0,eZ.prototype.ancestors=void 0,eZ.prototype.cause=void 0,eZ.prototype.fatal=void 0,eZ.prototype.place=void 0,eZ.prototype.ruleId=void 0,eZ.prototype.source=void 0;let eY={}.hasOwnProperty,e0=new Map,e1=/[A-Z]/g,e2=new Set(["table","tbody","thead","tfoot","tr"]),e5=new Set(["td","th"]),e3="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function e4(e,t,n){var r,l,a,i,s,o,c,u,d;let p,f,h,m,x,g,y,v,b,k,j;return"element"===t.type?(r=e,l=t,a=n,f=p=r.schema,"svg"===l.tagName.toLowerCase()&&"html"===p.space&&(r.schema=eq),r.ancestors.push(l),h=e7(r,l.tagName,!1),m=function(e,t){let n,r,l={};for(r in t.properties)if("children"!==r&&eY.call(t.properties,r)){let a=function(e,t,n){let r=function(e,t){let n=eN(t),r=t,l=ed;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&eT.test(t)){if("-"===t.charAt(4)){let e=t.slice(5).replace(eC,eM);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!eC.test(e)){let n=e.replace(eS,eE);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}l=ew}return new l(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){var l;let t;if(Array.isArray(n)&&(n=r.commaSeparated?(t={},(""===(l=n)[l.length-1]?[...l,""]:l).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()):n.join(" ").trim()),"style"===r.property){let t="object"==typeof n?n:function(e,t){try{return(0,eH.default)(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};let t=new eZ("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=e3+"#cannot-parse-style-attribute",t}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){let t,n={};for(t in e)eY.call(e,t)&&(n[function(e){let t=e.replace(e1,tt);return"ms-"===t.slice(0,3)&&(t="-"+t),t}(t)]=e[t]);return n}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?eI[r.property]||r.property:r.attribute,n]}}(e,r,t.properties[r]);if(a){let[r,i]=a;e.tableCellAlignToStyle&&"align"===r&&"string"==typeof i&&e5.has(t.tagName)?n=i:l[r]=i}}return n&&((l.style||(l.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=n),l}(r,l),x=e8(r,l),e2.has(l.tagName)&&(x=x.filter(function(e){return"string"!=typeof e||!("object"==typeof e?"text"===e.type&&eu(e.value):eu(e))})),e6(r,m,h,l),e9(m,x),r.ancestors.pop(),r.schema=p,r.create(l,h,m,a)):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return er("ExpressionStatement"===n.type),e.evaluater.evaluateExpression(n.expression)}te(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?(i=e,s=t,o=n,y=g=i.schema,"svg"===s.name&&"html"===g.space&&(i.schema=eq),i.ancestors.push(s),v=null===s.name?i.Fragment:e7(i,s.name,!0),b=function(e,t){let n={};for(let r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];er("ExpressionStatement"===t.type);let l=t.expression;er("ObjectExpression"===l.type);let a=l.properties[0];er("SpreadElement"===a.type),Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else te(e,t.position);else{let l,a=r.name;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];er("ExpressionStatement"===t.type),l=e.evaluater.evaluateExpression(t.expression)}else te(e,t.position);else l=null===r.value||r.value;n[a]=l}return n}(i,s),k=e8(i,s),e6(i,b,v,s),e9(b,k),i.ancestors.pop(),i.schema=g,i.create(s,v,b,o)):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);te(e,t.position)}(e,t):"root"===t.type?(c=e,u=t,d=n,e9(j={},e8(c,u)),c.create(u,c.Fragment,j,d)):"text"===t.type?t.value:void 0}function e6(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function e9(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function e8(e,t){let n=[],r=-1,l=e.passKeys?new Map:e0;for(;++r<t.children.length;){let a,i=t.children[r];if(e.passKeys){let e="element"===i.type?i.tagName:"mdxJsxFlowElement"===i.type||"mdxJsxTextElement"===i.type?i.name:void 0;if(e){let t=l.get(e)||0;a=e+"-"+t,l.set(e,t+1)}}let s=e4(e,i,a);void 0!==s&&n.push(s)}return n}function e7(e,t,n){let r;if(n)if(t.includes(".")){let e,n=t.split("."),l=-1;for(;++l<n.length;){let t=eo(n[l])?{type:"Identifier",name:n[l]}:{type:"Literal",value:n[l]};e=e?{type:"MemberExpression",object:e,property:t,computed:!!(l&&"Literal"===t.type),optional:!1}:t}er(e,"always a result"),r=e}else r=eo(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else r={type:"Literal",value:t};if("Literal"===r.type){let t=r.value;return eY.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);te(e)}function te(e,t){let n=new eZ("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=e3+"#cannot-handle-mdx-estrees-without-createevaluater",n}function tt(e){return"-"+e.toLowerCase()}let tn={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},tr={};function tl(e,t,n){var r;if((r=e)&&"object"==typeof r){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return ta(e.children,t,n)}return Array.isArray(e)?ta(e,t,n):""}function ta(e,t,n){let r=[],l=-1;for(;++l<e.length;)r[l]=tl(e[l],t,n);return r.join("")}function ti(e,t,n,r){let l,a=e.length,i=0;if(t=t<0?-t>a?0:a+t:t>a?a:t,n=n>0?n:0,r.length<1e4)(l=Array.from(r)).unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);i<r.length;)(l=r.slice(i,i+1e4)).unshift(t,0),e.splice(...l),i+=1e4,t+=1e4}function ts(e,t){return e.length>0?(ti(e,e.length,0,t),e):t}let to={}.hasOwnProperty,tc=tk(/[A-Za-z]/),tu=tk(/[\dA-Za-z]/),td=tk(/[#-'*+\--9=?A-Z^-~]/);function tp(e){return null!==e&&(e<32||127===e)}let tf=tk(/\d/),th=tk(/[\dA-Fa-f]/),tm=tk(/[!-/:-@[-`{-~]/);function tx(e){return null!==e&&e<-2}function tg(e){return null!==e&&(e<0||32===e)}function ty(e){return -2===e||-1===e||32===e}let tv=tk(/\p{P}|\p{S}/u),tb=tk(/\s/);function tk(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function tj(e,t,n,r){let l=r?r-1:1/0,a=0;return function(r){return ty(r)?(e.enter(n),function r(i){return ty(i)&&a++<l?(e.consume(i),r):(e.exit(n),t(i))}(r)):t(r)}}let tw={tokenize:function(e){let t,n=e.attempt(this.parser.constructs.contentInitial,function(t){return null===t?void e.consume(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),tj(e,n,"linePrefix"))},function(n){return e.enter("paragraph"),function n(r){let l=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=l),t=l,function t(r){if(null===r){e.exit("chunkText"),e.exit("paragraph"),e.consume(r);return}return tx(r)?(e.consume(r),e.exit("chunkText"),n):(e.consume(r),t)}(r)}(n)});return n}},tN={tokenize:function(e){let t,n,r,l=this,a=[],i=0;return s;function s(t){if(i<a.length){let n=a[i];return l.containerState=n[1],e.attempt(n[0].continuation,o,c)(t)}return c(t)}function o(e){if(i++,l.containerState._closeFlow){let n;l.containerState._closeFlow=void 0,t&&g();let r=l.events.length,a=r;for(;a--;)if("exit"===l.events[a][0]&&"chunkFlow"===l.events[a][1].type){n=l.events[a][1].end;break}x(i);let s=r;for(;s<l.events.length;)l.events[s][1].end={...n},s++;return ti(l.events,a+1,0,l.events.slice(r)),l.events.length=s,c(e)}return s(e)}function c(n){if(i===a.length){if(!t)return p(n);if(t.currentConstruct&&t.currentConstruct.concrete)return h(n);l.interrupt=!!(t.currentConstruct&&!t._gfmTableDynamicInterruptHack)}return l.containerState={},e.check(tS,u,d)(n)}function u(e){return t&&g(),x(i),p(e)}function d(e){return l.parser.lazy[l.now().line]=i!==a.length,r=l.now().offset,h(e)}function p(t){return l.containerState={},e.attempt(tS,f,h)(t)}function f(e){return i++,a.push([l.currentConstruct,l.containerState]),p(e)}function h(r){if(null===r){t&&g(),x(0),e.consume(r);return}return t=t||l.parser.flow(l.now()),e.enter("chunkFlow",{_tokenizer:t,contentType:"flow",previous:n}),function t(n){if(null===n){m(e.exit("chunkFlow"),!0),x(0),e.consume(n);return}return tx(n)?(e.consume(n),m(e.exit("chunkFlow")),i=0,l.interrupt=void 0,s):(e.consume(n),t)}(r)}function m(e,a){let s=l.sliceStream(e);if(a&&s.push(null),e.previous=n,n&&(n.next=e),n=e,t.defineSkip(e.start),t.write(s),l.parser.lazy[e.start.line]){let e,n,a=t.events.length;for(;a--;)if(t.events[a][1].start.offset<r&&(!t.events[a][1].end||t.events[a][1].end.offset>r))return;let s=l.events.length,o=s;for(;o--;)if("exit"===l.events[o][0]&&"chunkFlow"===l.events[o][1].type){if(e){n=l.events[o][1].end;break}e=!0}for(x(i),a=s;a<l.events.length;)l.events[a][1].end={...n},a++;ti(l.events,o+1,0,l.events.slice(s)),l.events.length=a}}function x(t){let n=a.length;for(;n-- >t;){let t=a[n];l.containerState=t[1],t[0].exit.call(l,e)}a.length=t}function g(){t.write([null]),n=void 0,t=void 0,l.containerState._closeFlow=void 0}}},tS={tokenize:function(e,t,n){return tj(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},tC={partial:!0,tokenize:function(e,t,n){return function(t){return ty(t)?tj(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||tx(e)?t(e):n(e)}}};class tT{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=null==t?1/0:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){this.setCursor(Math.trunc(e));let r=this.right.splice(this.right.length-(t||0),1/0);return n&&tE(this.left,n),r.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),tE(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),tE(this.right,e.reverse())}setCursor(e){if(e!==this.left.length&&(!(e>this.left.length)||0!==this.right.length)&&(!(e<0)||0!==this.left.length))if(e<this.left.length){let t=this.left.splice(e,1/0);tE(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);tE(this.left,t.reverse())}}}function tE(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function tM(e){let t,n,r,l,a,i,s,o={},c=-1,u=new tT(e);for(;++c<u.length;){for(;c in o;)c=o[c];if(t=u.get(c),c&&"chunkFlow"===t[1].type&&"listItemPrefix"===u.get(c-1)[1].type&&((r=0)<(i=t[1]._tokenizer.events).length&&"lineEndingBlank"===i[r][1].type&&(r+=2),r<i.length&&"content"===i[r][1].type))for(;++r<i.length&&"content"!==i[r][1].type;)"chunkText"===i[r][1].type&&(i[r][1]._isInFirstContentOfListItem=!0,r++);if("enter"===t[0])t[1].contentType&&(Object.assign(o,function(e,t){let n,r,l=e.get(t)[1],a=e.get(t)[2],i=t-1,s=[],o=l._tokenizer;!o&&(o=a.parser[l.contentType](l.start),l._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let c=o.events,u=[],d={},p=-1,f=l,h=0,m=0,x=[0];for(;f;){for(;e.get(++i)[1]!==f;);s.push(i),!f._tokenizer&&(n=a.sliceStream(f),f.next||n.push(null),r&&o.defineSkip(f.start),f._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(n),f._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),r=f,f=f.next}for(f=l;++p<c.length;)"exit"===c[p][0]&&"enter"===c[p-1][0]&&c[p][1].type===c[p-1][1].type&&c[p][1].start.line!==c[p][1].end.line&&(m=p+1,x.push(m),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(o.events=[],f?(f._tokenizer=void 0,f.previous=void 0):x.pop(),p=x.length;p--;){let t=c.slice(x[p],x[p+1]),n=s.pop();u.push([n,n+t.length-1]),e.splice(n,2,t)}for(u.reverse(),p=-1;++p<u.length;)d[h+u[p][0]]=h+u[p][1],h+=u[p][1]-u[p][0]-1;return d}(u,c)),c=o[c],s=!0);else if(t[1]._container){for(r=c,n=void 0;r--;)if("lineEnding"===(l=u.get(r))[1].type||"lineEndingBlank"===l[1].type)"enter"===l[0]&&(n&&(u.get(n)[1].type="lineEndingBlank"),l[1].type="lineEnding",n=r);else if("linePrefix"===l[1].type||"listItemIndent"===l[1].type);else break;n&&(t[1].end={...u.get(n)[1].start},(a=u.slice(n,c)).unshift(t),u.splice(n,c-n+1,a))}}return ti(e,0,1/0,u.slice(0)),!s}let tI={resolve:function(e){return tM(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?l(t):tx(t)?e.check(tA,a,l)(t):(e.consume(t),r)}function l(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function a(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},tA={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),tj(e,l,"linePrefix")};function l(l){if(null===l||tx(l))return n(l);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&"linePrefix"===a[1].type&&a[2].sliceSerialize(a[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}},tP={tokenize:function(e){let t=this,n=e.attempt(tC,function(r){return null===r?void e.consume(r):(e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n)},e.attempt(this.parser.constructs.flowInitial,r,tj(e,e.attempt(this.parser.constructs.flow,r,e.attempt(tI,r)),"linePrefix")));return n;function r(r){return null===r?void e.consume(r):(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n)}}},tR={resolveAll:tF()},tD=tz("string"),tL=tz("text");function tz(e){return{resolveAll:tF("text"===e?tO:void 0),tokenize:function(t){let n=this,r=this.parser.constructs[e],l=t.attempt(r,a,i);return a;function a(e){return o(e)?l(e):i(e)}function i(e){return null===e?void t.consume(e):(t.enter("data"),t.consume(e),s)}function s(e){return o(e)?(t.exit("data"),l(e)):(t.consume(e),s)}function o(e){if(null===e)return!0;let t=r[e],l=-1;if(t)for(;++l<t.length;){let e=t[l];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function tF(e){return function(t,n){let r,l=-1;for(;++l<=t.length;)void 0===r?t[l]&&"data"===t[l][1].type&&(r=l,l++):t[l]&&"data"===t[l][1].type||(l!==r+2&&(t[r][1].end=t[l-1][1].end,t.splice(r+2,l-r-2),l=r+2),r=void 0);return e?e(t,n):t}}function tO(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){let r,l=e[n-1][1],a=t.sliceStream(l),i=a.length,s=-1,o=0;for(;i--;){let e=a[i];if("string"==typeof e){for(s=e.length;32===e.charCodeAt(s-1);)o++,s--;if(s)break;s=-1}else if(-2===e)r=!0,o++;else if(-1===e);else{i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){let a={type:n===e.length||r||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?s:l.start._bufferIndex+s,_index:l.start._index+i,line:l.end.line,column:l.end.column-o,offset:l.end.offset-o},end:{...l.end}};l.end={...a.start},l.start.offset===l.end.offset?Object.assign(l,a):(e.splice(n,0,["enter",a,t],["exit",a,t]),n+=2)}n++}return e}function tB(e){return null===e||tg(e)||tb(e)?1:tv(e)?2:void 0}function t$(e,t,n){let r=[],l=-1;for(;++l<e.length;){let a=e[l].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}let t_={name:"attention",resolveAll:function(e,t){let n,r,l,a,i,s,o,c,u=-1;for(;++u<e.length;)if("enter"===e[u][0]&&"attentionSequence"===e[u][1].type&&e[u][1]._close){for(n=u;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[u][1]).charCodeAt(0)){if((e[n][1]._close||e[u][1]._open)&&(e[u][1].end.offset-e[u][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[u][1].end.offset-e[u][1].start.offset)%3))continue;s=e[n][1].end.offset-e[n][1].start.offset>1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;let d={...e[n][1].end},p={...e[u][1].start};tU(d,-s),tU(p,s),a={type:s>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},i={type:s>1?"strongSequence":"emphasisSequence",start:{...e[u][1].start},end:p},l={type:s>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[u][1].start}},r={type:s>1?"strong":"emphasis",start:{...a.start},end:{...i.end}},e[n][1].end={...a.start},e[u][1].start={...i.end},o=[],e[n][1].end.offset-e[n][1].start.offset&&(o=ts(o,[["enter",e[n][1],t],["exit",e[n][1],t]])),o=ts(o,[["enter",r,t],["enter",a,t],["exit",a,t],["enter",l,t]]),o=ts(o,t$(t.parser.constructs.insideSpan.null,e.slice(n+1,u),t)),o=ts(o,[["exit",l,t],["enter",i,t],["exit",i,t],["exit",r,t]]),e[u][1].end.offset-e[u][1].start.offset?(c=2,o=ts(o,[["enter",e[u][1],t],["exit",e[u][1],t]])):c=0,ti(e,n-1,u-n+3,o),u=n+o.length-c-2;break}}for(u=-1;++u<e.length;)"attentionSequence"===e[u][1].type&&(e[u][1].type="data");return e},tokenize:function(e,t){let n,r=this.parser.constructs.attentionMarkers.null,l=this.previous,a=tB(l);return function(i){return n=i,e.enter("attentionSequence"),function i(s){if(s===n)return e.consume(s),i;let o=e.exit("attentionSequence"),c=tB(s),u=!c||2===c&&a||r.includes(s),d=!a||2===a&&c||r.includes(l);return o._open=!!(42===n?u:u&&(a||!d)),o._close=!!(42===n?d:d&&(c||!u)),t(s)}(i)}}};function tU(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}let tq={continuation:{tokenize:function(e,t,n){let r=this;return function(t){return ty(t)?tj(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):l(t)};function l(r){return e.attempt(tq,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){let r=this;return function(t){if(62===t){let n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),l}return n(t)};function l(n){return ty(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}},tH={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return tm(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}},tV=document.createElement("i");function tW(e){let t="&"+e+";";tV.innerHTML=t;let n=tV.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}let tK={name:"characterReference",tokenize:function(e,t,n){let r,l,a=this,i=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),s};function s(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),o):(e.enter("characterReferenceValue"),r=31,l=tu,c(t))}function o(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),r=6,l=th,c):(e.enter("characterReferenceValue"),r=7,l=tf,c(t))}function c(s){if(59===s&&i){let r=e.exit("characterReferenceValue");return l!==tu||tW(a.sliceSerialize(r))?(e.enter("characterReferenceMarker"),e.consume(s),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(s)}return l(s)&&i++<r?(e.consume(s),c):n(s)}}},tQ={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l)};function l(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},tG={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){let r,l=this,a={partial:!0,tokenize:function(e,t,n){let a=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i};function i(t){return e.enter("codeFencedFence"),ty(t)?tj(e,o,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):o(t)}function o(t){return t===r?(e.enter("codeFencedFenceSequence"),function t(l){return l===r?(a++,e.consume(l),t):a>=s?(e.exit("codeFencedFenceSequence"),ty(l)?tj(e,c,"whitespace")(l):c(l)):n(l)}(t)):n(t)}function c(r){return null===r||tx(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}},i=0,s=0;return function(t){var a;let c;return a=t,i=(c=l.events[l.events.length-1])&&"linePrefix"===c[1].type?c[2].sliceSerialize(c[1],!0).length:0,r=a,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),function t(l){return l===r?(s++,e.consume(l),t):s<3?n(l):(e.exit("codeFencedFenceSequence"),ty(l)?tj(e,o,"whitespace")(l):o(l))}(a)};function o(a){return null===a||tx(a)?(e.exit("codeFencedFence"),l.interrupt?t(a):e.check(tQ,u,h)(a)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),function t(l){return null===l||tx(l)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),o(l)):ty(l)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),tj(e,c,"whitespace")(l)):96===l&&l===r?n(l):(e.consume(l),t)}(a))}function c(t){return null===t||tx(t)?o(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),function t(l){return null===l||tx(l)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),o(l)):96===l&&l===r?n(l):(e.consume(l),t)}(t))}function u(t){return e.attempt(a,h,d)(t)}function d(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),p}function p(t){return i>0&&ty(t)?tj(e,f,"linePrefix",i+1)(t):f(t)}function f(t){return null===t||tx(t)?e.check(tQ,u,h)(t):(e.enter("codeFlowValue"),function t(n){return null===n||tx(n)?(e.exit("codeFlowValue"),f(n)):(e.consume(n),t)}(t))}function h(n){return e.exit("codeFenced"),t(n)}}},tJ={name:"codeIndented",tokenize:function(e,t,n){let r=this;return function(t){return e.enter("codeIndented"),tj(e,l,"linePrefix",5)(t)};function l(t){let l=r.events[r.events.length-1];return l&&"linePrefix"===l[1].type&&l[2].sliceSerialize(l[1],!0).length>=4?function t(n){return null===n?a(n):tx(n)?e.attempt(tX,t,a)(n):(e.enter("codeFlowValue"),function n(r){return null===r||tx(r)?(e.exit("codeFlowValue"),t(r)):(e.consume(r),n)}(n))}(t):n(t)}function a(n){return e.exit("codeIndented"),t(n)}}},tX={partial:!0,tokenize:function(e,t,n){let r=this;return l;function l(t){return r.parser.lazy[r.now().line]?n(t):tx(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l):tj(e,a,"linePrefix",5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&"linePrefix"===a[1].type&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):tx(e)?l(e):n(e)}}};function tZ(e,t,n,r,l,a,i,s,o){let c=o||1/0,u=0;return function(t){return 60===t?(e.enter(r),e.enter(l),e.enter(a),e.consume(t),e.exit(a),d):null===t||32===t||41===t||tp(t)?n(t):(e.enter(r),e.enter(i),e.enter(s),e.enter("chunkString",{contentType:"string"}),h(t))};function d(n){return 62===n?(e.enter(a),e.consume(n),e.exit(a),e.exit(l),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),p(n))}function p(t){return 62===t?(e.exit("chunkString"),e.exit(s),d(t)):null===t||60===t||tx(t)?n(t):(e.consume(t),92===t?f:p)}function f(t){return 60===t||62===t||92===t?(e.consume(t),p):p(t)}function h(l){return!u&&(null===l||41===l||tg(l))?(e.exit("chunkString"),e.exit(s),e.exit(i),e.exit(r),t(l)):u<c&&40===l?(e.consume(l),u++,h):41===l?(e.consume(l),u--,h):null===l||32===l||40===l||tp(l)?n(l):(e.consume(l),92===l?m:h)}function m(t){return 40===t||41===t||92===t?(e.consume(t),h):h(t)}}function tY(e,t,n,r,l,a){let i,s=this,o=0;return function(t){return e.enter(r),e.enter(l),e.consume(t),e.exit(l),e.enter(a),c};function c(d){return o>999||null===d||91===d||93===d&&!i||94===d&&!o&&"_hiddenFootnoteSupport"in s.parser.constructs?n(d):93===d?(e.exit(a),e.enter(l),e.consume(d),e.exit(l),e.exit(r),t):tx(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(t){return null===t||91===t||93===t||tx(t)||o++>999?(e.exit("chunkString"),c(t)):(e.consume(t),i||(i=!ty(t)),92===t?d:u)}function d(t){return 91===t||92===t||93===t?(e.consume(t),o++,u):u(t)}}function t0(e,t,n,r,l,a){let i;return function(t){return 34===t||39===t||40===t?(e.enter(r),e.enter(l),e.consume(t),e.exit(l),i=40===t?41:t,s):n(t)};function s(n){return n===i?(e.enter(l),e.consume(n),e.exit(l),e.exit(r),t):(e.enter(a),o(n))}function o(t){return t===i?(e.exit(a),s(i)):null===t?n(t):tx(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),tj(e,o,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===i||null===t||tx(t)?(e.exit("chunkString"),o(t)):(e.consume(t),92===t?u:c)}function u(t){return t===i||92===t?(e.consume(t),c):c(t)}}function t1(e,t){let n;return function r(l){return tx(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n=!0,r):ty(l)?tj(e,r,n?"linePrefix":"lineSuffix")(l):t(l)}}function t2(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}let t5={partial:!0,tokenize:function(e,t,n){return function(t){return tg(t)?t1(e,r)(t):n(t)};function r(t){return t0(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function l(t){return ty(t)?tj(e,a,"whitespace")(t):a(t)}function a(e){return null===e||tx(e)?t(e):n(e)}}},t3=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],t4=["pre","script","style","textarea"],t6={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(tC,t,n)}}},t9={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return tx(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l):n(t)};function l(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},t8={name:"labelEnd",resolveAll:function(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){let e="labelImage"===r.type?4:2;r.type="data",t+=e}}return e.length!==n.length&&ti(e,0,e.length,n),e},resolveTo:function(e,t){let n,r,l,a,i=e.length,s=0;for(;i--;)if(n=e[i][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[i][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(l){if("enter"===e[i][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=i,"labelLink"!==n.type)){s=2;break}}else"labelEnd"===n.type&&(l=i);let o={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[r][1].start},end:{...e[l][1].end}},u={type:"labelText",start:{...e[r+s+2][1].end},end:{...e[l-2][1].start}};return a=ts(a=[["enter",o,t],["enter",c,t]],e.slice(r+1,r+s+3)),a=ts(a,[["enter",u,t]]),a=ts(a,t$(t.parser.constructs.insideSpan.null,e.slice(r+s+4,l-3),t)),a=ts(a,[["exit",u,t],e[l-2],e[l-1],["exit",c,t]]),a=ts(a,e.slice(l+1)),a=ts(a,[["exit",o,t]]),ti(e,r,e.length,a),e},tokenize:function(e,t,n){let r,l,a=this,i=a.events.length;for(;i--;)if(("labelImage"===a.events[i][1].type||"labelLink"===a.events[i][1].type)&&!a.events[i][1]._balanced){r=a.events[i][1];break}return function(t){return r?r._inactive?u(t):(l=a.parser.defined.includes(t2(a.sliceSerialize({start:r.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),s):n(t)};function s(t){return 40===t?e.attempt(t7,c,l?c:u)(t):91===t?e.attempt(ne,c,l?o:u)(t):l?c(t):u(t)}function o(t){return e.attempt(nt,c,u)(t)}function c(e){return t(e)}function u(e){return r._balanced=!0,n(e)}}},t7={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return tg(t)?t1(e,l)(t):l(t)}function l(t){return 41===t?c(t):tZ(e,a,i,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function a(t){return tg(t)?t1(e,s)(t):c(t)}function i(e){return n(e)}function s(t){return 34===t||39===t||40===t?t0(e,o,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):c(t)}function o(t){return tg(t)?t1(e,c)(t):c(t)}function c(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},ne={tokenize:function(e,t,n){let r=this;return function(t){return tY.call(r,e,l,a,"reference","referenceMarker","referenceString")(t)};function l(e){return r.parser.defined.includes(t2(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function a(e){return n(e)}}},nt={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}},nn={name:"labelStartImage",resolveAll:t8.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),l};function l(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),a):n(t)}function a(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},nr={name:"labelStartLink",resolveAll:t8.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),l};function l(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},nl={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),tj(e,t,"linePrefix")}}},na={name:"thematicBreak",tokenize:function(e,t,n){let r,l=0;return function(a){var i;return e.enter("thematicBreak"),r=i=a,function a(i){return i===r?(e.enter("thematicBreakSequence"),function t(n){return n===r?(e.consume(n),l++,t):(e.exit("thematicBreakSequence"),ty(n)?tj(e,a,"whitespace")(n):a(n))}(i)):l>=3&&(null===i||tx(i))?(e.exit("thematicBreak"),t(i)):n(i)}(i)}}},ni={continuation:{tokenize:function(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(tC,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,tj(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){return r.containerState.furtherBlankLines||!ty(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(no,t,l)(n))});function l(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,tj(e,e.attempt(ni,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){let r=this,l=r.events[r.events.length-1],a=l&&"linePrefix"===l[1].type?l[2].sliceSerialize(l[1],!0).length:0,i=0;return function(t){let l=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===l?!r.containerState.marker||t===r.containerState.marker:tf(t)){if(r.containerState.type||(r.containerState.type=l,e.enter(l,{_container:!0})),"listUnordered"===l)return e.enter("listItemPrefix"),42===t||45===t?e.check(na,n,s)(t):s(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),function t(l){return tf(l)&&++i<10?(e.consume(l),t):(!r.interrupt||i<2)&&(r.containerState.marker?l===r.containerState.marker:41===l||46===l)?(e.exit("listItemValue"),s(l)):n(l)}(t)}return n(t)};function s(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(tC,r.interrupt?n:o,e.attempt(ns,u,c))}function o(e){return r.containerState.initialBlankLine=!0,a++,u(e)}function c(t){return ty(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),u):n(t)}function u(n){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},ns={partial:!0,tokenize:function(e,t,n){let r=this;return tj(e,function(e){let l=r.events[r.events.length-1];return!ty(e)&&l&&"listItemPrefixWhitespace"===l[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},no={partial:!0,tokenize:function(e,t,n){let r=this;return tj(e,function(e){let l=r.events[r.events.length-1];return l&&"listItemIndent"===l[1].type&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}},nc={name:"setextUnderline",resolveTo:function(e,t){let n,r,l,a=e.length;for(;a--;)if("enter"===e[a][0]){if("content"===e[a][1].type){n=a;break}"paragraph"===e[a][1].type&&(r=a)}else"content"===e[a][1].type&&e.splice(a,1),l||"definition"!==e[a][1].type||(l=a);let i={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",l?(e.splice(r,0,["enter",i,t]),e.splice(l+1,0,["exit",e[n][1],t]),e[n][1].end={...e[l][1].end}):e[n][1]=i,e.push(["exit",i,t]),e},tokenize:function(e,t,n){let r,l=this;return function(t){var i;let s,o=l.events.length;for(;o--;)if("lineEnding"!==l.events[o][1].type&&"linePrefix"!==l.events[o][1].type&&"content"!==l.events[o][1].type){s="paragraph"===l.events[o][1].type;break}return!l.parser.lazy[l.now().line]&&(l.interrupt||s)?(e.enter("setextHeadingLine"),r=t,i=t,e.enter("setextHeadingLineSequence"),function t(n){return n===r?(e.consume(n),t):(e.exit("setextHeadingLineSequence"),ty(n)?tj(e,a,"lineSuffix")(n):a(n))}(i)):n(t)};function a(r){return null===r||tx(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};e.s(["attentionMarkers",0,{null:[42,95]},"contentInitial",0,{91:{name:"definition",tokenize:function(e,t,n){let r,l=this;return function(t){var r;return e.enter("definition"),r=t,tY.call(l,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(r)};function a(t){return(r=t2(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)),58===t)?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),i):n(t)}function i(t){return tg(t)?t1(e,s)(t):s(t)}function s(t){return tZ(e,o,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function o(t){return e.attempt(t5,c,c)(t)}function c(t){return ty(t)?tj(e,u,"whitespace")(t):u(t)}function u(a){return null===a||tx(a)?(e.exit("definition"),l.parser.defined.push(r),t(a)):n(a)}}}},"disable",0,{null:[]},"document",0,{42:ni,43:ni,45:ni,48:ni,49:ni,50:ni,51:ni,52:ni,53:ni,54:ni,55:ni,56:ni,57:ni,62:tq},"flow",0,{35:{name:"headingAtx",resolve:function(e,t){let n,r,l=e.length-2,a=3;return"whitespace"===e[3][1].type&&(a+=2),l-2>a&&"whitespace"===e[l][1].type&&(l-=2),"atxHeadingSequence"===e[l][1].type&&(a===l-1||l-4>a&&"whitespace"===e[l-2][1].type)&&(l-=a+1===l?2:4),l>a&&(n={type:"atxHeadingText",start:e[a][1].start,end:e[l][1].end},r={type:"chunkText",start:e[a][1].start,end:e[l][1].end,contentType:"text"},ti(e,a,l-a+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e},tokenize:function(e,t,n){let r=0;return function(l){var a;return e.enter("atxHeading"),a=l,e.enter("atxHeadingSequence"),function l(a){return 35===a&&r++<6?(e.consume(a),l):null===a||tg(a)?(e.exit("atxHeadingSequence"),function n(r){return 35===r?(e.enter("atxHeadingSequence"),function t(r){return 35===r?(e.consume(r),t):(e.exit("atxHeadingSequence"),n(r))}(r)):null===r||tx(r)?(e.exit("atxHeading"),t(r)):ty(r)?tj(e,n,"whitespace")(r):(e.enter("atxHeadingText"),function t(r){return null===r||35===r||tg(r)?(e.exit("atxHeadingText"),n(r)):(e.consume(r),t)}(r))}(a)):n(a)}(a)}}},42:na,45:[nc,na],60:{concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},tokenize:function(e,t,n){let r,l,a,i,s,o=this;return function(t){var n;return n=t,e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(n),c};function c(i){return 33===i?(e.consume(i),u):47===i?(e.consume(i),l=!0,f):63===i?(e.consume(i),r=3,o.interrupt?t:P):tc(i)?(e.consume(i),a=String.fromCharCode(i),h):n(i)}function u(l){return 45===l?(e.consume(l),r=2,d):91===l?(e.consume(l),r=5,i=0,p):tc(l)?(e.consume(l),r=4,o.interrupt?t:P):n(l)}function d(r){return 45===r?(e.consume(r),o.interrupt?t:P):n(r)}function p(r){let l="CDATA[";return r===l.charCodeAt(i++)?(e.consume(r),i===l.length)?o.interrupt?t:N:p:n(r)}function f(t){return tc(t)?(e.consume(t),a=String.fromCharCode(t),h):n(t)}function h(i){if(null===i||47===i||62===i||tg(i)){let s=47===i,c=a.toLowerCase();return!s&&!l&&t4.includes(c)?(r=1,o.interrupt?t(i):N(i)):t3.includes(a.toLowerCase())?(r=6,s)?(e.consume(i),m):o.interrupt?t(i):N(i):(r=7,o.interrupt&&!o.parser.lazy[o.now().line]?n(i):l?function t(n){return ty(n)?(e.consume(n),t):j(n)}(i):x(i))}return 45===i||tu(i)?(e.consume(i),a+=String.fromCharCode(i),h):n(i)}function m(r){return 62===r?(e.consume(r),o.interrupt?t:N):n(r)}function x(t){return 47===t?(e.consume(t),j):58===t||95===t||tc(t)?(e.consume(t),g):ty(t)?(e.consume(t),x):j(t)}function g(t){return 45===t||46===t||58===t||95===t||tu(t)?(e.consume(t),g):y(t)}function y(t){return 61===t?(e.consume(t),v):ty(t)?(e.consume(t),y):x(t)}function v(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),s=t,b):ty(t)?(e.consume(t),v):function t(n){return null===n||34===n||39===n||47===n||60===n||61===n||62===n||96===n||tg(n)?y(n):(e.consume(n),t)}(t)}function b(t){return t===s?(e.consume(t),s=null,k):null===t||tx(t)?n(t):(e.consume(t),b)}function k(e){return 47===e||62===e||ty(e)?x(e):n(e)}function j(t){return 62===t?(e.consume(t),w):n(t)}function w(t){return null===t||tx(t)?N(t):ty(t)?(e.consume(t),w):n(t)}function N(t){return 45===t&&2===r?(e.consume(t),E):60===t&&1===r?(e.consume(t),M):62===t&&4===r?(e.consume(t),R):63===t&&3===r?(e.consume(t),P):93===t&&5===r?(e.consume(t),A):tx(t)&&(6===r||7===r)?(e.exit("htmlFlowData"),e.check(t6,D,S)(t)):null===t||tx(t)?(e.exit("htmlFlowData"),S(t)):(e.consume(t),N)}function S(t){return e.check(t9,C,D)(t)}function C(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),T}function T(t){return null===t||tx(t)?S(t):(e.enter("htmlFlowData"),N(t))}function E(t){return 45===t?(e.consume(t),P):N(t)}function M(t){return 47===t?(e.consume(t),a="",I):N(t)}function I(t){if(62===t){let n=a.toLowerCase();return t4.includes(n)?(e.consume(t),R):N(t)}return tc(t)&&a.length<8?(e.consume(t),a+=String.fromCharCode(t),I):N(t)}function A(t){return 93===t?(e.consume(t),P):N(t)}function P(t){return 62===t?(e.consume(t),R):45===t&&2===r?(e.consume(t),P):N(t)}function R(t){return null===t||tx(t)?(e.exit("htmlFlowData"),D(t)):(e.consume(t),R)}function D(n){return e.exit("htmlFlow"),t(n)}}},61:nc,95:na,96:tG,126:tG},"flowInitial",0,{[-2]:tJ,[-1]:tJ,32:tJ},"insideSpan",0,{null:[t_,tR]},"string",0,{38:tK,92:tH},"text",0,{[-5]:nl,[-4]:nl,[-3]:nl,33:nn,38:tK,42:t_,60:[{name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l};function l(t){return tc(t)?(e.consume(t),a):64===t?n(t):s(t)}function a(t){return 43===t||45===t||46===t||tu(t)?(r=1,function t(n){return 58===n?(e.consume(n),r=0,i):(43===n||45===n||46===n||tu(n))&&r++<32?(e.consume(n),t):(r=0,s(n))}(t)):s(t)}function i(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||tp(r)?n(r):(e.consume(r),i)}function s(t){return 64===t?(e.consume(t),o):td(t)?(e.consume(t),s):n(t)}function o(l){return tu(l)?function l(a){return 46===a?(e.consume(a),r=0,o):62===a?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(a),e.exit("autolinkMarker"),e.exit("autolink"),t):function t(a){if((45===a||tu(a))&&r++<63){let n=45===a?t:l;return e.consume(a),n}return n(a)}(a)}(l):n(l)}}},{name:"htmlText",tokenize:function(e,t,n){let r,l,a,i=this;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),s};function s(t){return 33===t?(e.consume(t),o):47===t?(e.consume(t),b):63===t?(e.consume(t),y):tc(t)?(e.consume(t),j):n(t)}function o(t){return 45===t?(e.consume(t),c):91===t?(e.consume(t),l=0,f):tc(t)?(e.consume(t),g):n(t)}function c(t){return 45===t?(e.consume(t),p):n(t)}function u(t){return null===t?n(t):45===t?(e.consume(t),d):tx(t)?(a=u,I(t)):(e.consume(t),u)}function d(t){return 45===t?(e.consume(t),p):u(t)}function p(e){return 62===e?M(e):45===e?d(e):u(e)}function f(t){let r="CDATA[";return t===r.charCodeAt(l++)?(e.consume(t),l===r.length?h:f):n(t)}function h(t){return null===t?n(t):93===t?(e.consume(t),m):tx(t)?(a=h,I(t)):(e.consume(t),h)}function m(t){return 93===t?(e.consume(t),x):h(t)}function x(t){return 62===t?M(t):93===t?(e.consume(t),x):h(t)}function g(t){return null===t||62===t?M(t):tx(t)?(a=g,I(t)):(e.consume(t),g)}function y(t){return null===t?n(t):63===t?(e.consume(t),v):tx(t)?(a=y,I(t)):(e.consume(t),y)}function v(e){return 62===e?M(e):y(e)}function b(t){return tc(t)?(e.consume(t),k):n(t)}function k(t){return 45===t||tu(t)?(e.consume(t),k):function t(n){return tx(n)?(a=t,I(n)):ty(n)?(e.consume(n),t):M(n)}(t)}function j(t){return 45===t||tu(t)?(e.consume(t),j):47===t||62===t||tg(t)?w(t):n(t)}function w(t){return 47===t?(e.consume(t),M):58===t||95===t||tc(t)?(e.consume(t),N):tx(t)?(a=w,I(t)):ty(t)?(e.consume(t),w):M(t)}function N(t){return 45===t||46===t||58===t||95===t||tu(t)?(e.consume(t),N):function t(n){return 61===n?(e.consume(n),S):tx(n)?(a=t,I(n)):ty(n)?(e.consume(n),t):w(n)}(t)}function S(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),r=t,C):tx(t)?(a=S,I(t)):ty(t)?(e.consume(t),S):(e.consume(t),T)}function C(t){return t===r?(e.consume(t),r=void 0,E):null===t?n(t):tx(t)?(a=C,I(t)):(e.consume(t),C)}function T(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||tg(t)?w(t):(e.consume(t),T)}function E(e){return 47===e||62===e||tg(e)?w(e):n(e)}function M(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function I(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),A}function A(t){return ty(t)?tj(e,P,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):P(t)}function P(t){return e.enter("htmlTextData"),a(t)}}}],91:nr,92:[{name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return tx(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}},tH],93:t8,95:t_,96:{name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,l=3;if(("lineEnding"===e[3][1].type||"space"===e[l][1].type)&&("lineEnding"===e[r][1].type||"space"===e[r][1].type)){for(t=l;++t<r;)if("codeTextData"===e[t][1].type){e[l][1].type="codeTextPadding",e[r][1].type="codeTextPadding",l+=2,r-=2;break}}for(t=l-1,r++;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):(t===r||"lineEnding"===e[t][1].type)&&(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,l,a=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),function t(n){return 96===n?(e.consume(n),a++,t):(e.exit("codeTextSequence"),i(n))}(t)};function i(o){return null===o?n(o):32===o?(e.enter("space"),e.consume(o),e.exit("space"),i):96===o?(l=e.enter("codeTextSequence"),r=0,function n(i){return 96===i?(e.consume(i),r++,n):r===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(i)):(l.type="codeTextData",s(i))}(o)):tx(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):(e.enter("codeTextData"),s(o))}function s(t){return null===t||32===t||96===t||tx(t)?(e.exit("codeTextData"),i(t)):(e.consume(t),s)}}}}],19210);var nu=e.i(19210);let nd=/[\0\t\n\r]/g;function np(e,t){let n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(65535&n)==65535||(65535&n)==65534||n>1114111?"�":String.fromCodePoint(n)}let nf=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function nh(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){let e=n.charCodeAt(1),t=120===e||88===e;return np(n.slice(t?2:1),t?16:10)}return tW(n)||e}let nm={}.hasOwnProperty;function nx(e){return{line:e.line,column:e.column,offset:e.offset}}function ng(e,t){if(e)throw Error("Cannot close `"+e.type+"` ("+eQ({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+eQ({start:t.start,end:t.end})+") is open");throw Error("Cannot close document, a token (`"+t.type+"`, "+eQ({start:t.start,end:t.end})+") is still open")}function ny(e){let t=this;t.parser=function(n){var r,l;let a,i,s,o;return"object"==typeof(r={...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})&&(l=r,r=void 0),(function(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:r(g),autolinkProtocol:c,autolinkEmail:c,atxHeading:r(h),blockQuote:r(function(){return{type:"blockquote",children:[]}}),characterEscape:c,characterReference:c,codeFenced:r(f),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:r(f,l),codeText:r(function(){return{type:"inlineCode",value:""}},l),codeTextData:c,data:c,codeFlowValue:c,definition:r(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:r(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:r(m),hardBreakTrailing:r(m),htmlFlow:r(x,l),htmlFlowData:c,htmlText:r(x,l),htmlTextData:c,image:r(function(){return{type:"image",title:null,url:"",alt:null}}),label:l,link:r(g),listItem:r(function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}),listItemValue:function(e){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:r(y,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:r(y),paragraph:r(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:r(h),strong:r(function(){return{type:"strong",children:[]}}),thematicBreak:r(function(){return{type:"thematicBreak"}})},exit:{atxHeading:i(),atxHeadingSequence:function(e){let t=this.stack[this.stack.length-1];t.depth||(t.depth=this.sliceSerialize(e).length)},autolink:i(),autolinkEmail:function(e){u.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){u.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:i(),characterEscapeValue:u,characterReferenceMarkerHexadecimal:p,characterReferenceMarkerNumeric:p,characterReferenceValue:function(e){let t,n=this.sliceSerialize(e),r=this.data.characterReferenceType;r?(t=np(n,"characterReferenceMarkerNumeric"===r?10:16),this.data.characterReferenceType=void 0):t=tW(n);let l=this.stack[this.stack.length-1];l.value+=t},characterReference:function(e){this.stack.pop().position.end=nx(e.end)},codeFenced:i(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){let e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){let e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:u,codeIndented:i(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:i(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:u,data:u,definition:i(),definitionDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=t2(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:i(),hardBreakEscape:i(d),hardBreakTrailing:i(d),htmlFlow:i(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:u,htmlText:i(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:u,image:i(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),label:function(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,"link"===n.type?n.children=e.children:n.alt=t},labelText:function(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=t.replace(nf,nh),n.identifier=t2(t).toLowerCase()},lineEnding:function(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){n.children[n.children.length-1].position.end=nx(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(c.call(this,e),u.call(this,e))},link:i(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),listItem:i(),listOrdered:i(),listUnordered:i(),paragraph:i(),referenceString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=t2(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){this.data.inReference=void 0},setextHeading:i(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:i(),thematicBreak:i()}};!function e(t,n){let r=-1;for(;++r<n.length;){let l=n[r];Array.isArray(l)?e(t,l):function(e,t){let n;for(n in t)if(nm.call(t,n))switch(n){case"canContainEols":{let r=t[n];r&&e[n].push(...r);break}case"transforms":{let r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{let r=t[n];r&&Object.assign(e[n],r)}}}(t,l)}}(t,(e||{}).mdastExtensions||[]);let n={};return function(e){let r={type:"root",children:[]},i={stack:[r],tokenStack:[],config:t,enter:a,exit:s,buffer:l,resume:o,data:n},c=[],u=-1;for(;++u<e.length;)("listOrdered"===e[u][1].type||"listUnordered"===e[u][1].type)&&("enter"===e[u][0]?c.push(u):u=function(e,t,n){let r,l,a,i,s=t-1,o=-1,c=!1;for(;++s<=n;){let t=e[s];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?o++:o--,i=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!r||i||o||a||(a=s),i=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:i=void 0}if(!o&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===o&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let i=s;for(l=void 0;i--;){let t=e[i];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;l&&(e[l][1].type="lineEndingBlank",c=!0),t[1].type="lineEnding",l=i}else if("linePrefix"===t[1].type||"blockQuotePrefix"===t[1].type||"blockQuotePrefixWhitespace"===t[1].type||"blockQuoteMarker"===t[1].type||"listItemIndent"===t[1].type);else break}a&&(!l||a<l)&&(r._spread=!0),r.end=Object.assign({},l?e[l][1].start:t[1].end),e.splice(l||s,0,["exit",r,t[2]]),s++,n++}if("listItemPrefix"===t[1].type){let l={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=l,e.splice(s,0,["enter",l,t[2]]),s++,n++,a=void 0,i=!0}}}return e[t][1]._spread=c,n}(e,c.pop(),u));for(u=-1;++u<e.length;){let n=t[e[u][0]];nm.call(n,e[u][1].type)&&n[e[u][1].type].call(Object.assign({sliceSerialize:e[u][2].sliceSerialize},i),e[u][1])}if(i.tokenStack.length>0){let e=i.tokenStack[i.tokenStack.length-1];(e[1]||ng).call(i,void 0,e[0])}for(r.position={start:nx(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:nx(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},u=-1;++u<t.transforms.length;)r=t.transforms[u](r)||r;return r};function r(e,t){return function(n){a.call(this,e(n),n),t&&t.call(this,n)}}function l(){this.stack.push({type:"fragment",children:[]})}function a(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:nx(t.start),end:void 0}}function i(e){return function(t){e&&e.call(this,t),s.call(this,t)}}function s(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||ng).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+eQ({start:e.start,end:e.end})+"): it’s not open");n.position.end=nx(e.end)}function o(){var e;return e=this.stack.pop(),tl(e,"boolean"!=typeof tr.includeImageAlt||tr.includeImageAlt,"boolean"!=typeof tr.includeHtml||tr.includeHtml)}function c(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&"text"===n.type||((n={type:"text",value:""}).position={start:nx(e.start),end:void 0},t.push(n)),this.stack.push(n)}function u(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=nx(e.end)}function d(){this.data.atHardBreak=!0}function p(e){this.data.characterReferenceType=e.type}function f(){return{type:"code",lang:null,meta:null,value:""}}function h(){return{type:"heading",depth:0,children:[]}}function m(){return{type:"break"}}function x(){return{type:"html",value:""}}function g(){return{type:"link",title:null,url:"",children:[]}}function y(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}})(l)(function(e){for(;!tM(e););return e}((function(e){let t={constructs:function(e){let t={},n=-1;for(;++n<e.length;)!function(e,t){let n;for(n in t){let r,l=(to.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];if(a)for(r in a){to.call(l,r)||(l[r]=[]);let e=a[r];!function(e,t){let n=-1,r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);ti(e,0,0,r)}(l[r],Array.isArray(e)?e:e?[e]:[])}}}(t,e[n]);return t}([nu,...(e||{}).extensions||[]]),content:n(tw),defined:[],document:n(tN),flow:n(tP),lazy:{},string:n(tD),text:n(tL)};return t;function n(e){return function(n){return function(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},l={},a=[],i=[],s=[],o={attempt:h(function(e,t){m(e,t.from)}),check:h(f),consume:function(e){tx(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,x()):-1!==e&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===i[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=e},enter:function(e,t){let n=t||{};return n.type=e,n.start=p(),c.events.push(["enter",n,c]),s.push(n),n},exit:function(e){let t=s.pop();return t.end=p(),c.events.push(["exit",t,c]),t},interrupt:h(f,{interrupt:!0})},c={code:null,containerState:{},defineSkip:function(e){l[e.line]=e.column,x()},events:[],now:p,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n,r=-1,l=[];for(;++r<e.length;){let a,i=e[r];if("string"==typeof i)a=i;else switch(i){case -5:a="\r";break;case -4:a="\n";break;case -3:a="\r\n";break;case -2:a=t?" ":" ";break;case -1:if(!t&&n)continue;a=" ";break;default:a=String.fromCharCode(i)}n=-2===i,l.push(a)}return l.join("")}(d(e),t)},sliceStream:d,write:function(e){return(i=ts(i,e),function(){let e;for(;r._index<i.length;){let n=i[r._index];if("string"==typeof n)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<n.length;){var t;t=n.charCodeAt(r._bufferIndex),u=u(t)}else u=u(n)}}(),null!==i[i.length-1])?[]:(m(t,0),c.events=t$(a,c.events,c),c.events)}},u=t.tokenize.call(c,o);return t.resolveAll&&a.push(t),c;function d(e){return function(e,t){let n,r=t.start._index,l=t.start._bufferIndex,a=t.end._index,i=t.end._bufferIndex;if(r===a)n=[e[r].slice(l,i)];else{if(n=e.slice(r,a),l>-1){let e=n[0];"string"==typeof e?n[0]=e.slice(l):n.shift()}i>0&&n.push(e[a].slice(0,i))}return n}(i,e)}function p(){let{_bufferIndex:e,_index:t,line:n,column:l,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:l,offset:a}}function f(e,t){t.restore()}function h(e,t){return function(n,l,a){var i;let u,d,f,h;return Array.isArray(n)?m(n):"tokenize"in n?m([n]):(i=n,function(e){let t=null!==e&&i[e],n=null!==e&&i.null;return m([...Array.isArray(t)?t:t?[t]:[],...Array.isArray(n)?n:n?[n]:[]])(e)});function m(e){return(u=e,d=0,0===e.length)?a:g(e[d])}function g(e){return function(n){let l,a,i,u,d;return(l=p(),a=c.previous,i=c.currentConstruct,u=c.events.length,d=Array.from(s),h={from:u,restore:function(){r=l,c.previous=a,c.currentConstruct=i,c.events.length=u,s=d,x()}},f=e,e.partial||(c.currentConstruct=e),e.name&&c.parser.constructs.disable.null.includes(e.name))?v(n):e.tokenize.call(t?Object.assign(Object.create(c),t):c,o,y,v)(n)}}function y(t){return e(f,h),l}function v(e){return(h.restore(),++d<u.length)?g(u[d]):a}}}function m(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&ti(c.events,t,c.events.length-t,e.resolve(c.events.slice(t),c)),e.resolveTo&&(c.events=e.resolveTo(c.events,c))}function x(){r.line in l&&r.column<2&&(r.column=l[r.line],r.offset+=l[r.line]-1)}}(t,e,n)}}})(l).document().write((i=1,s="",o=!0,function(e,t,n){let r,l,c,u,d,p=[];for(e=s+("string"==typeof e?e.toString():new TextDecoder(t||void 0).decode(e)),c=0,s="",o&&(65279===e.charCodeAt(0)&&c++,o=void 0);c<e.length;){if(nd.lastIndex=c,u=(r=nd.exec(e))&&void 0!==r.index?r.index:e.length,d=e.charCodeAt(u),!r){s=e.slice(c);break}if(10===d&&c===u&&a)p.push(-3),a=void 0;else switch(a&&(p.push(-5),a=void 0),c<u&&(p.push(e.slice(c,u)),i+=u-c),d){case 0:p.push(65533),i++;break;case 9:for(l=4*Math.ceil(i/4),p.push(-2);i++<l;)p.push(-1);break;case 10:p.push(-4),i=1;break;default:a=!0,i=1}c=u+1}return n&&(a&&p.push(-5),s&&p.push(s),p.push(null)),p})(n,r,!0))))}}let nv="object"==typeof self?self:globalThis,nb=e=>{var t;let n,r;return(t=new Map,n=(e,n)=>(t.set(n,e),e),r=l=>{if(t.has(l))return t.get(l);let[a,i]=e[l];switch(a){case 0:case -1:return n(i,l);case 1:{let e=n([],l);for(let t of i)e.push(r(t));return e}case 2:{let e=n({},l);for(let[t,n]of i)e[r(t)]=r(n);return e}case 3:return n(new Date(i),l);case 4:{let{source:e,flags:t}=i;return n(new RegExp(e,t),l)}case 5:{let e=n(new Map,l);for(let[t,n]of i)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,l);for(let t of i)e.add(r(t));return e}case 7:{let{name:e,message:t}=i;return n(new nv[e](t),l)}case 8:return n(BigInt(i),l);case"BigInt":return n(Object(BigInt(i)),l);case"ArrayBuffer":return n(new Uint8Array(i).buffer,i);case"DataView":{let{buffer:e}=new Uint8Array(i);return n(new DataView(e),i)}}return n(new nv[a](i),l)})(0)},{toString:nk}={},{keys:nj}=Object,nw=e=>{let t=typeof e;if("object"!==t||!e)return[0,t];let n=nk.call(e).slice(8,-1);switch(n){case"Array":return[1,""];case"Object":return[2,""];case"Date":return[3,""];case"RegExp":return[4,""];case"Map":return[5,""];case"Set":return[6,""];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},nN=([e,t])=>0===e&&("function"===t||"symbol"===t),nS=(e,{json:t,lossy:n}={})=>{var r,l,a;let i,s,o=[];return(r=!(t||n),l=!!t,a=new Map,i=(e,t)=>{let n=o.push(e)-1;return a.set(t,n),n},s=e=>{if(a.has(e))return a.get(e);let[t,n]=nw(e);switch(t){case 0:{let l=e;switch(n){case"bigint":t=8,l=e.toString();break;case"function":case"symbol":if(r)throw TypeError("unable to serialize "+n);l=null;break;case"undefined":return i([-1],e)}return i([t,l],e)}case 1:{if(n){let t=e;return"DataView"===n?t=new Uint8Array(e.buffer):"ArrayBuffer"===n&&(t=new Uint8Array(e)),i([n,[...t]],e)}let r=[],l=i([t,r],e);for(let t of e)r.push(s(t));return l}case 2:{if(n)switch(n){case"BigInt":return i([n,e.toString()],e);case"Boolean":case"Number":case"String":return i([n,e.valueOf()],e)}if(l&&"toJSON"in e)return s(e.toJSON());let a=[],o=i([t,a],e);for(let t of nj(e))(r||!nN(nw(e[t])))&&a.push([s(t),s(e[t])]);return o}case 3:return i([t,e.toISOString()],e);case 4:{let{source:n,flags:r}=e;return i([t,{source:n,flags:r}],e)}case 5:{let n=[],l=i([t,n],e);for(let[t,l]of e)(r||!(nN(nw(t))||nN(nw(l))))&&n.push([s(t),s(l)]);return l}case 6:{let n=[],l=i([t,n],e);for(let t of e)(r||!nN(nw(t)))&&n.push(s(t));return l}}let{message:o}=e;return i([t,{name:n,message:o}],e)})(e),o},nC="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?nb(nS(e,t)):structuredClone(e):(e,t)=>nb(nS(e,t));function nT(e){let t=[],n=-1,r=0,l=0;for(;++n<e.length;){let a=e.charCodeAt(n),i="";if(37===a&&tu(e.charCodeAt(n+1))&&tu(e.charCodeAt(n+2)))l=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(i=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(i=String.fromCharCode(a,t),l=1):i="�"}else i=String.fromCharCode(a);i&&(t.push(e.slice(r,n),encodeURIComponent(i)),r=n+l+1,i=""),l&&(n+=l,l=0)}return t.join("")+e.slice(r)}function nE(e,t){let n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function nM(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}let nI=function(e){var t,n;if(null==e)return nP;if("function"==typeof e)return nA(e);if("object"==typeof e){return Array.isArray(e)?function(e){let t=[],n=-1;for(;++n<e.length;)t[n]=nI(e[n]);return nA(function(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1})}(e):(t=e,nA(function(e){let n;for(n in t)if(e[n]!==t[n])return!1;return!0}))}if("string"==typeof e){return n=e,nA(function(e){return e&&e.type===n})}throw Error("Expected function, string, or object as test")};function nA(e){return function(t,n,r){return!!(function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function nP(){return!0}let nR=[];function nD(e,t,n,r){var l,a,i;let s,o,c,u,d,p;"function"==typeof t&&"function"!=typeof n?(o=void 0,c=t,s=n):(o=t,c=n,s=r),l=o,a=function(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return c(e,r,n)},i=s,"function"==typeof l&&"function"!=typeof a?(i=a,a=l):u=l,d=nI(u),p=i?-1:1,(function e(t,n,r){let s=t&&"object"==typeof t?t:{};if("string"==typeof s.type){let e="string"==typeof s.tagName?s.tagName:"string"==typeof s.name?s.name:void 0;Object.defineProperty(o,"name",{value:"node ("+t.type+(e?"<"+e+">":"")+")"})}return o;function o(){var s;let o,c,u,f=nR;if((!l||d(t,n,r[r.length-1]||void 0))&&!1===(f=Array.isArray(s=a(t,r))?s:"number"==typeof s?[!0,s]:null==s?nR:[s])[0])return f;if("children"in t&&t.children&&t.children&&"skip"!==f[0])for(c=(i?t.children.length:-1)+p,u=r.concat(t);c>-1&&c<t.children.length;){if(!1===(o=e(t.children[c],c,u)())[0])return o;c="number"==typeof o[1]?o[1]:c+p}return f}})(e,void 0,[])()}function nL(e,t){let n=t.referenceType,r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];let l=e.all(t),a=l[0];a&&"text"===a.type?a.value="["+a.value:l.unshift({type:"text",value:"["});let i=l[l.length-1];return i&&"text"===i.type?i.value+=r:l.push({type:"text",value:r}),l}function nz(e){let t=e.spread;return null==t?e.children.length>1:t}function nF(e,t,n){let r=0,l=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(l-1);for(;9===t||32===t;)l--,t=e.codePointAt(l-1)}return l>r?e.slice(r,l):""}let nO={blockquote:function(e,t){let n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){let n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){let n=t.value?t.value+"\n":"",r={},l=t.lang?t.lang.split(/\s+/):[];l.length>0&&(r.className=["language-"+l[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a={type:"element",tagName:"pre",properties:{},children:[a=e.applyData(t,a)]},e.patch(t,a),a},delete:function(e,t){let n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){let n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){let n,r="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",l=String(t.identifier).toUpperCase(),a=nT(l.toLowerCase()),i=e.footnoteOrder.indexOf(l),s=e.footnoteCounts.get(l);void 0===s?(s=0,e.footnoteOrder.push(l),n=e.footnoteOrder.length):n=i+1,s+=1,e.footnoteCounts.set(l,s);let o={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+a,id:r+"fnref-"+a+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(n)}]};e.patch(t,o);let c={type:"element",tagName:"sup",properties:{},children:[o]};return e.patch(t,c),e.applyData(t,c)},heading:function(e,t){let n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){let n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return nL(e,t);let l={src:nT(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(l.title=r.title);let a={type:"element",tagName:"img",properties:l,children:[]};return e.patch(t,a),e.applyData(t,a)},image:function(e,t){let n={src:nT(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){let n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);let r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return nL(e,t);let l={href:nT(r.url||"")};null!==r.title&&void 0!==r.title&&(l.title=r.title);let a={type:"element",tagName:"a",properties:l,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)},link:function(e,t){let n={href:nT(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){let r=e.all(t),l=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=nz(n[r])}return t}(n):nz(t),a={},i=[];if("boolean"==typeof t.checked){let e,n=r[0];n&&"element"===n.type&&"p"===n.tagName?e=n:(e={type:"element",tagName:"p",properties:{},children:[]},r.unshift(e)),e.children.length>0&&e.children.unshift({type:"text",value:" "}),e.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let s=-1;for(;++s<r.length;){let e=r[s];(l||0!==s||"element"!==e.type||"p"!==e.tagName)&&i.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||l?i.push(e):i.push(...e.children)}let o=r[r.length-1];o&&(l||"element"!==o.type||"p"!==o.tagName)&&i.push({type:"text",value:"\n"});let c={type:"element",tagName:"li",properties:a,children:i};return e.patch(t,c),e.applyData(t,c)},list:function(e,t){let n={},r=e.all(t),l=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++l<r.length;){let e=r[l];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}let a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)},paragraph:function(e,t){let n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){let n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){let n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){let n=e.all(t),r=n.shift(),l=[];if(r){let n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),l.push(n)}if(n.length>0){let r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=eW(t.children[1]),i=eV(t.children[t.children.length-1]);a&&i&&(r.position={start:a,end:i}),l.push(r)}let a={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,a),e.applyData(t,a)},tableCell:function(e,t){let n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){let r=n?n.children:void 0,l=0===(r?r.indexOf(t):1)?"th":"td",a=n&&"table"===n.type?n.align:void 0,i=a?a.length:t.children.length,s=-1,o=[];for(;++s<i;){let n=t.children[s],r={},i=a?a[s]:void 0;i&&(r.align=i);let c={type:"element",tagName:l,properties:r,children:[]};n&&(c.children=e.all(n),e.patch(n,c),c=e.applyData(n,c)),o.push(c)}let c={type:"element",tagName:"tr",properties:{},children:e.wrap(o,!0)};return e.patch(t,c),e.applyData(t,c)},text:function(e,t){let n={type:"text",value:function(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),l=0,a=[];for(;r;)a.push(nF(t.slice(l,r.index),l>0,!0),r[0]),l=r.index+r[0].length,r=n.exec(t);return a.push(nF(t.slice(l),l>0,!1)),a.join("")}(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){let n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:nB,yaml:nB,definition:nB,footnoteDefinition:nB};function nB(){}let n$={}.hasOwnProperty,n_={};function nU(e,t){e.position&&(t.position=function(e){let t=eW(e),n=eV(e);if(t&&n)return{start:t,end:n}}(e))}function nq(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,l=e.data.hProperties;"string"==typeof t&&("element"===n.type?n.tagName=t:n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}),"element"===n.type&&l&&Object.assign(n.properties,nC(l)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function nH(e,t){let n=[],r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function nV(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function nW(e,t){let n,r,l,a,i=(n=t||n_,r=new Map,l=new Map,a={all:function(e){let t=[];if("children"in e){let n=e.children,r=-1;for(;++r<n.length;){let l=a.one(n[r],e);if(l){if(r&&"break"===n[r-1].type&&(Array.isArray(l)||"text"!==l.type||(l.value=nV(l.value)),!Array.isArray(l)&&"element"===l.type)){let e=l.children[0];e&&"text"===e.type&&(e.value=nV(e.value))}Array.isArray(l)?t.push(...l):t.push(l)}}}return t},applyData:nq,definitionById:r,footnoteById:l,footnoteCounts:new Map,footnoteOrder:[],handlers:{...nO,...n.handlers},one:function(e,t){let n=e.type,r=a.handlers[n];if(n$.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if("children"in e){let{children:t,...n}=e,r=nC(n);return r.children=a.all(e),r}return nC(e)}return(a.options.unknownHandler||function(e,t){let n=t.data||{},r="value"in t&&!(n$.call(n,"hProperties")||n$.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)})(a,e,t)},options:n,patch:nU,wrap:nH},nD(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){let t="definition"===e.type?r:l,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a),s=i.one(e,void 0),o=function(e){let t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||nE,r=e.options.footnoteBackLabel||nM,l=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",i=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[],o=-1;for(;++o<e.footnoteOrder.length;){let l=e.footnoteById.get(e.footnoteOrder[o]);if(!l)continue;let a=e.all(l),i=String(l.identifier).toUpperCase(),c=nT(i.toLowerCase()),u=0,d=[],p=e.footnoteCounts.get(i);for(;void 0!==p&&++u<=p;){d.length>0&&d.push({type:"text",value:" "});let e="string"==typeof n?n:n(o,u);"string"==typeof e&&(e={type:"text",value:e}),d.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+c+(u>1?"-"+u:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(o,u),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}let f=a[a.length-1];if(f&&"element"===f.type&&"p"===f.tagName){let e=f.children[f.children.length-1];e&&"text"===e.type?e.value+=" ":f.children.push({type:"text",value:" "}),f.children.push(...d)}else a.push(...d);let h={type:"element",tagName:"li",properties:{id:t+"fn-"+c},children:e.wrap(a,!0)};e.patch(l,h),s.push(h)}if(0!==s.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...nC(i),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:"\n"}]}}(i),c=Array.isArray(s)?{type:"root",children:s}:s||{type:"root",children:[]};return o&&(er("children"in c),c.children.push({type:"text",value:"\n"},o)),c}function nK(e,t){return e&&"run"in e?async function(n,r){let l=nW(n,{file:r,...t});await e.run(l,r)}:function(n,r){return nW(n,{file:r,...e||t})}}function nQ(e){if(e)throw e}var nG=e.i(75609);function nJ(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}let nX=function(e,t){let n;if(void 0!==t&&"string"!=typeof t)throw TypeError('"ext" argument must be a string');n1(e);let r=0,l=-1,a=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;a--;)if(47===e.codePointAt(a)){if(n){r=a+1;break}}else l<0&&(n=!0,l=a+1);return l<0?"":e.slice(r,l)}if(t===e)return"";let i=-1,s=t.length-1;for(;a--;)if(47===e.codePointAt(a)){if(n){r=a+1;break}}else i<0&&(n=!0,i=a+1),s>-1&&(e.codePointAt(a)===t.codePointAt(s--)?s<0&&(l=a):(s=-1,l=i));return r===l?l=i:l<0&&(l=e.length),e.slice(r,l)},nZ=function(e){let t;if(n1(e),0===e.length)return".";let n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},nY=function(e){let t;n1(e);let n=e.length,r=-1,l=0,a=-1,i=0;for(;n--;){let s=e.codePointAt(n);if(47===s){if(t){l=n+1;break}continue}r<0&&(t=!0,r=n+1),46===s?a<0?a=n:1!==i&&(i=1):a>-1&&(i=-1)}return a<0||r<0||0===i||1===i&&a===r-1&&a===l+1?"":e.slice(a,r)},n0=function(...e){var t;let n,r,l,a=-1;for(;++a<e.length;)n1(e[a]),e[a]&&(l=void 0===l?e[a]:l+"/"+e[a]);return void 0===l?".":(n1(t=l),n=47===t.codePointAt(0),0!==(r=function(e,t){let n,r,l="",a=0,i=-1,s=0,o=-1;for(;++o<=e.length;){if(o<e.length)n=e.codePointAt(o);else if(47===n)break;else n=47;if(47===n){if(i===o-1||1===s);else if(i!==o-1&&2===s){if(l.length<2||2!==a||46!==l.codePointAt(l.length-1)||46!==l.codePointAt(l.length-2)){if(l.length>2){if((r=l.lastIndexOf("/"))!==l.length-1){r<0?(l="",a=0):a=(l=l.slice(0,r)).length-1-l.lastIndexOf("/"),i=o,s=0;continue}}else if(l.length>0){l="",a=0,i=o,s=0;continue}}t&&(l=l.length>0?l+"/..":"..",a=2)}else l.length>0?l+="/"+e.slice(i+1,o):l=e.slice(i+1,o),a=o-i-1;i=o,s=0}else 46===n&&s>-1?s++:s=-1}return l}(t,!n)).length||n||(r="."),r.length>0&&47===t.codePointAt(t.length-1)&&(r+="/"),n?"/"+r:r)};function n1(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function n2(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}let n5=["history","path","basename","stem","extname","dirname"];class n3{constructor(e){let t,n;t=e?n2(e)?{path:e}:"string"==typeof e||function(e){return!!(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":"/",this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<n5.length;){const e=n5[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)n5.includes(n)||(this[n]=t[n])}get basename(){return"string"==typeof this.path?nX(this.path):void 0}set basename(e){n6(e,"basename"),n4(e,"basename"),this.path=n0(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?nZ(this.path):void 0}set dirname(e){n9(this.basename,"dirname"),this.path=n0(e||"",this.basename)}get extname(){return"string"==typeof this.path?nY(this.path):void 0}set extname(e){if(n4(e,"extname"),n9(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw Error("`extname` must start with `.`");if(e.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=n0(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){n2(e)&&(e=function(e){if("string"==typeof e)e=new URL(e);else if(!n2(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){let e=TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){let e=TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}let t=e.pathname,n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){let e=t.codePointAt(n+2);if(70===e||102===e){let e=TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}(e)),n6(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?nX(this.path,this.extname):void 0}set stem(e){n6(e,"stem"),n4(e,"stem"),this.path=n0(this.dirname||"",e+(this.extname||""))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new eZ(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(e||void 0).decode(this.value)}}function n4(e,t){if(e&&e.includes("/"))throw Error("`"+t+"` cannot be a path: did not expect `/`")}function n6(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function n9(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}let n8=function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},n7={}.hasOwnProperty;class re extends n8{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=function(){let e=[],t={run:function(...t){let n=-1,r=t.pop();if("function"!=typeof r)throw TypeError("Expected function as last argument, not "+r);!function l(a,...i){let s=e[++n],o=-1;if(a)return void r(a);for(;++o<t.length;)(null===i[o]||void 0===i[o])&&(i[o]=t[o]);t=i,s?(function(e,t){let n;return function(...t){let a,i=e.length>t.length;i&&t.push(r);try{a=e.apply(this,t)}catch(e){if(i&&n)throw e;return r(e)}i||(a&&a.then&&"function"==typeof a.then?a.then(l,r):a instanceof Error?r(a):l(a))};function r(e,...l){n||(n=!0,t(e,...l))}function l(e){r(null,e)}})(s,l)(...i):r(null,...i)}(null,...t)},use:function(n){if("function"!=typeof n)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}()}copy(){let e=new re,t=-1;for(;++t<this.attachers.length;){let n=this.attachers[t];e.use(...n)}return e.data((0,nG.default)(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2==arguments.length?(rl("data",this.frozen),this.namespace[e]=t,this):n7.call(this.namespace,e)&&this.namespace[e]||void 0:e?(rl("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;for(;++this.freezeIndex<this.attachers.length;){let[e,...t]=this.attachers[this.freezeIndex];if(!1===t[0])continue;!0===t[0]&&(t[0]=void 0);let n=e.call(this,...t);"function"==typeof n&&this.transformers.use(n)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=rs(e),n=this.parser||this.Parser;return rn("parse",n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),rn("process",this.parser||this.Parser),rr("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,l){let a=rs(e),i=n.parse(a);function s(e,n){e||!n?l(e):r?r(n):(er(t,"`done` is defined if `resolve` is not"),t(void 0,n))}n.run(i,a,function(e,t,r){var l,a;if(e||!t||!r)return s(e);let i=n.stringify(t,r);"string"==typeof(l=i)||(a=l)&&"object"==typeof a&&"byteLength"in a&&"byteOffset"in a?r.value=i:r.result=i,s(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),rn("processSync",this.parser||this.Parser),rr("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,nQ(e),t=r}),ri("processSync","process",n),er(t,"we either bailed on an error or have a tree"),t}run(e,t,n){ra(e),this.freeze();let r=this.transformers;return n||"function"!=typeof t||(n=t,t=void 0),n?l(void 0,n):new Promise(l);function l(l,a){er("function"!=typeof t,"`file` can’t be a `done` anymore, we checked");let i=rs(t);r.run(e,i,function(t,r,i){let s=r||e;t?a(t):l?l(s):(er(n,"`done` is defined if `resolve` is not"),n(void 0,s,i))})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){nQ(e),n=t,r=!0}),ri("runSync","run",r),er(n,"we either bailed on an error or have a tree"),n}stringify(e,t){this.freeze();let n=rs(t),r=this.compiler||this.Compiler;return rr("stringify",r),ra(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(rl("use",this.frozen),null==e);else if("function"==typeof e)i(e,t);else if("object"==typeof e)Array.isArray(e)?a(e):l(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function l(e){if(!("plugins"in e)&&!("settings"in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(e.plugins),e.settings&&(r.settings=(0,nG.default)(!0,r.settings,e.settings))}function a(e){let t=-1;if(null==e);else if(Array.isArray(e))for(;++t<e.length;)!function(e){if("function"==typeof e)i(e,[]);else if("object"==typeof e)if(Array.isArray(e)){let[t,...n]=e;i(t,n)}else l(e);else throw TypeError("Expected usable value, not `"+e+"`")}(e[t]);else throw TypeError("Expected a list of plugins, not `"+e+"`")}function i(e,t){let r=-1,l=-1;for(;++r<n.length;)if(n[r][0]===e){l=r;break}if(-1===l)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,i=n[l][1];nJ(i)&&nJ(r)&&(r=(0,nG.default)(!0,i,r)),n[l]=[e,r,...a]}}}}let rt=new re().freeze();function rn(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `parser`")}function rr(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `compiler`")}function rl(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ra(e){if(!nJ(e)||"string"!=typeof e.type)throw TypeError("Expected node, got `"+e+"`")}function ri(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function rs(e){var t;return(t=e)&&"object"==typeof t&&"message"in t&&"messages"in t?e:new n3(e)}let ro=[],rc={allowDangerousHtml:!0},ru=/^(https?|ircs?|mailto|xmpp)$/i,rd=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function rp(e){var n;let r,l,a,i,s,o=(r=(n=e).rehypePlugins||ro,l=n.remarkPlugins||ro,a=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...rc}:rc,rt().use(ny).use(l).use(nK,a).use(r)),c=(i=e.children||"",s=new n3,"string"==typeof i?s.value=i:el("Unexpected value `"+i+"` for `children` prop, expected `string`"),s);return function(e,n){let r=n.allowedElements,l=n.allowElement,a=n.components,i=n.disallowedElements,s=n.skipHtml,o=n.unwrapDisallowed,c=n.urlTransform||rf;for(let e of rd)Object.hasOwn(n,e.from)&&el("Unexpected `"+e.from+"` prop, "+(e.to?"use `"+e.to+"` instead":"remove it")+" (see <https://github.com/remarkjs/react-markdown/blob/main/changelog.md#"+e.id+"> for more info)");return r&&i&&el("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other"),nD(e,function(e,t,n){if("raw"===e.type&&n&&"number"==typeof t)return s?n.children.splice(t,1):n.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in tn)if(Object.hasOwn(tn,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=tn[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=c(String(n||""),t,e))}}if("element"===e.type){let a=r?!r.includes(e.tagName):!!i&&i.includes(e.tagName);if(!a&&l&&"number"==typeof t&&(a=!l(e,t,n)),a&&n&&"number"==typeof t)return o&&e.children?n.children.splice(t,1,...e.children):n.children.splice(t,1),t}}),function(e,t){var n,r,l,a;let i;if(!t||void 0===t.Fragment)throw TypeError("Expected `Fragment` in options");let s=t.filePath||void 0;if(t.development){if("function"!=typeof t.jsxDEV)throw TypeError("Expected `jsxDEV` in options when `development: true`");n=s,r=t.jsxDEV,i=function(e,t,l,a){let i=Array.isArray(l.children),s=eW(e);return r(t,l,a,i,{columnNumber:s?s.column-1:void 0,fileName:n,lineNumber:s?s.line:void 0},void 0)}}else{if("function"!=typeof t.jsx)throw TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw TypeError("Expected `jsxs` in production options");l=t.jsx,a=t.jsxs,i=function(e,t,n,r){let i=Array.isArray(n.children)?a:l;return r?i(t,n,r):i(t,n)}}let o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:s,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?eq:eU,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},c=e4(o,e,void 0);return c&&"string"!=typeof c?c:o.create(e,o.Fragment,{children:c||void 0},void 0)}(e,{Fragment:t.Fragment,components:a,ignoreInvalidStyle:!0,jsx:t.jsx,jsxs:t.jsxs,passKeys:!0,passNode:!0})}(o.runSync(o.parse(c),c),e)}function rf(e){let t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),l=e.indexOf("/");return -1===t||-1!==l&&t>l||-1!==n&&t>n||-1!==r&&t>r||ru.test(e.slice(0,t))?e:""}let rh=(0,Q.default)("git-compare-arrows",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]]),rm=(0,Q.default)("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]),rx={p:({children:e})=>(0,t.jsx)("p",{className:"text-muted-foreground mb-2 text-xs leading-relaxed last:mb-0",children:e}),strong:({children:e})=>(0,t.jsx)("strong",{className:"text-foreground font-semibold",children:e}),em:({children:e})=>(0,t.jsx)("em",{className:"italic",children:e}),code:({children:e,className:n})=>n?(0,t.jsx)("code",{className:`${n} text-[11px]`,children:e}):(0,t.jsx)("code",{className:"bg-muted text-foreground rounded-md px-1.5 py-0.5 font-mono text-[11px]",children:e}),pre:({children:e})=>(0,t.jsx)("pre",{className:"bg-muted my-2 overflow-x-auto rounded-lg border p-3",children:e}),ul:({children:e})=>(0,t.jsx)("ul",{className:"text-muted-foreground mb-2 list-disc space-y-1 pl-4 text-xs",children:e}),ol:({children:e})=>(0,t.jsx)("ol",{className:"text-muted-foreground mb-2 list-decimal space-y-1 pl-4 text-xs",children:e}),li:({children:e})=>(0,t.jsx)("li",{className:"leading-relaxed",children:e}),a:({children:e,href:n})=>(0,t.jsx)("a",{href:n,className:"text-primary underline underline-offset-2",target:"_blank",rel:"noopener noreferrer",children:e})};function rg({decision:e,index:r}){let[l,a]=(0,n.useState)(!1),i=(0,j.useSoundAction)("expand"),s=(0,j.useSoundAction)("collapse");return(0,t.jsxs)("div",{className:"border-border rounded-lg border",children:[(0,t.jsxs)("div",{className:"space-y-3 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,t.jsx)("span",{className:"bg-primary text-primary-foreground flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-bold",children:r+1}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h3",{className:"text-foreground text-sm leading-tight font-semibold",children:e.title}),(0,t.jsx)("p",{className:"text-muted-foreground mt-0.5 text-xs",children:e.chosen})]})]}),"decisionName"in e&&e.decisionName?(0,t.jsx)(W.Badge,{variant:"secondary",className:"bg-primary/10 text-primary shrink-0",children:e.decisionName}):null]}),e.rationale?(0,t.jsx)(rp,{components:rx,children:e.rationale}):null]}),e.rejected.length>0?(0,t.jsxs)("div",{className:"border-border border-t",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>{l?s.play():i.play(),a(e=>!e)},className:"text-muted-foreground hover:bg-muted/50 flex w-full items-center gap-1.5 px-4 py-3 text-xs font-medium transition-colors",children:[(0,t.jsx)(H.ChevronRight,{className:`h-3.5 w-3.5 transition-transform ${l?"rotate-90":""}`}),(0,t.jsx)(rm,{className:"h-3.5 w-3.5"}),"Other Options Considered (",e.rejected.length,")"]}),l?(0,t.jsx)("div",{className:"space-y-1.5 px-4 pb-3",children:e.rejected.map(e=>(0,t.jsx)("div",{className:"bg-primary/5 rounded-md px-3 py-2",children:(0,t.jsx)("span",{className:"text-foreground text-xs",children:e})},e))}):null]}):null]})}function ry({data:e}){let{summary:n,decisions:r}=e;return 0===r.length?null:(0,t.jsxs)("div",{className:"space-y-4 p-4",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"mt-1.5 h-2.5 w-2.5 shrink-0 rounded-full bg-blue-500"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("h2",{className:"text-foreground text-sm font-bold",children:"Technical Implementation Plan Review"}),n?(0,t.jsx)("p",{className:"text-muted-foreground mt-1 text-xs leading-relaxed",children:n}):null]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 pt-1",children:[(0,t.jsx)(rh,{className:"text-primary h-4 w-4"}),(0,t.jsx)("h3",{className:"text-foreground text-sm font-bold",children:"Technical Decisions"})]}),r.map((e,n)=>(0,t.jsx)(rg,{decision:e,index:n},e.title))]})}var rv=e.i(41698);function rb({item:e,index:n}){return(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsx)("div",{className:"space-y-2 px-4 py-3",children:(0,t.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,t.jsx)("span",{className:"bg-primary text-primary-foreground flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-bold",children:n+1}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h3",{className:"text-foreground text-sm leading-tight font-semibold",children:e.question}),(0,t.jsxs)("div",{className:"mt-1 flex items-center gap-2",children:[(0,t.jsx)("p",{className:"text-muted-foreground min-w-0 truncate text-xs",children:e.selectedOption}),e.wasRecommended?(0,t.jsx)(W.Badge,{className:"shrink-0 px-1.5 py-0 text-[10px] whitespace-nowrap",children:"AI Recommended"}):null]})]})]})})})}function rk({data:e}){let{questions:n}=e;return 0===n.length?null:(0,t.jsxs)("div",{className:"space-y-4 p-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(rv.ClipboardList,{className:"text-primary h-4 w-4"}),(0,t.jsx)("h3",{className:"text-foreground text-sm font-bold",children:"Product Decisions"})]}),n.map((e,n)=>(0,t.jsx)(rb,{item:e,index:n},e.question))]})}let rj=(0,Q.default)("file-diff",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]]);var rw=e.i(65530),rN=e.i(49228);let rS=(0,Q.default)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),rC=(0,Q.default)("camera",[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);var rT=e.i(70471);let rE=(0,Q.default)("monitor-play",[["path",{d:"M15.033 9.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56V7.648a.645.645 0 0 1 .967-.56z",key:"vbtd3f"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",key:"x3v2xh"}]]);var rM=e.i(81181),rI=e.i(35e3),rA=e.i(30090),rA=rA,rP=e.i(17406);function rR({status:e}){switch(e){case rP.CiStatus.Success:return(0,t.jsxs)(W.Badge,{className:"border-transparent bg-green-50 text-green-700 hover:bg-green-50",children:[(0,t.jsx)(rI.CheckCircle2,{className:"mr-1 h-3.5 w-3.5"}),"Passing"]});case rP.CiStatus.Pending:return(0,t.jsxs)(W.Badge,{className:"border-transparent bg-yellow-50 text-yellow-700 hover:bg-yellow-50",children:[(0,t.jsx)(a.Loader2,{className:"mr-1 h-3.5 w-3.5 animate-spin"}),"Pending"]});case rP.CiStatus.Failure:return(0,t.jsxs)(W.Badge,{className:"border-transparent bg-red-50 text-red-700 hover:bg-red-50",children:[(0,t.jsx)(rA.default,{className:"mr-1 h-3.5 w-3.5"}),"Failing"]})}}let rD=(0,Q.default)("file-plus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]),rL=(0,Q.default)("file-minus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}]]),rz=(0,Q.default)("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]),rF={added:{icon:rD,label:"A",className:"text-green-600"},modified:{icon:rz,label:"M",className:"text-amber-600"},deleted:{icon:rL,label:"D",className:"text-red-600"},renamed:{icon:rz,label:"R",className:"text-blue-600"}};function rO({status:e}){let n=rF[e],r=n.icon;return(0,t.jsx)(r,{className:(0,V.cn)("h-3.5 w-3.5 shrink-0",n.className)})}function rB({hunk:e}){return(0,t.jsxs)("div",{className:"border-border border-t first:border-t-0",children:[(0,t.jsx)("div",{className:"bg-muted/50 text-muted-foreground px-3 py-1 font-mono text-[10px]",children:e.header}),(0,t.jsx)("div",{className:"font-mono text-[11px] leading-[18px]",children:e.lines.map(e=>(0,t.jsxs)("div",{className:(0,V.cn)("flex","added"===e.type&&"bg-green-50 dark:bg-green-950/30","removed"===e.type&&"bg-red-50 dark:bg-red-950/30"),children:[(0,t.jsx)("span",{className:"text-muted-foreground w-10 shrink-0 px-1 text-right text-[10px] select-none",children:e.oldNumber??""}),(0,t.jsx)("span",{className:"text-muted-foreground w-10 shrink-0 px-1 text-right text-[10px] select-none",children:e.newNumber??""}),(0,t.jsx)("span",{className:(0,V.cn)("w-4 shrink-0 text-center select-none","added"===e.type&&"text-green-700 dark:text-green-400","removed"===e.type&&"text-red-700 dark:text-red-400"),children:"added"===e.type?"+":"removed"===e.type?"-":" "}),(0,t.jsx)("span",{className:"min-w-0 flex-1 pr-2 break-all whitespace-pre-wrap",children:e.content})]},`${e.type}-${e.oldNumber??""}-${e.newNumber??""}`))})]})}function r$({file:e}){let[r,l]=(0,n.useState)(!1),a=e.path.split("/").pop()??e.path,i=e.path.includes("/")?e.path.slice(0,e.path.lastIndexOf("/")):"";return(0,t.jsxs)("div",{className:"border-border border-b last:border-b-0",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>l(!r),className:"hover:bg-muted/50 flex w-full items-center gap-2 px-3 py-2 text-left",children:[(0,t.jsx)(H.ChevronRight,{className:(0,V.cn)("text-muted-foreground h-3 w-3 shrink-0 transition-transform duration-150",r&&"rotate-90")}),(0,t.jsx)(rO,{status:e.status}),(0,t.jsx)("span",{className:"text-foreground min-w-0 flex-1 truncate text-xs",children:i?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{className:"text-muted-foreground",children:[i,"/"]}),a]}):a}),e.oldPath?(0,t.jsxs)("span",{className:"text-muted-foreground truncate text-[10px]",children:["← ",e.oldPath.split("/").pop()]}):null,(0,t.jsxs)("span",{className:"shrink-0 text-[10px]",children:[e.additions>0?(0,t.jsxs)("span",{className:"text-green-600",children:["+",e.additions]}):null,e.additions>0&&e.deletions>0?" ":null,e.deletions>0?(0,t.jsxs)("span",{className:"text-red-600",children:["-",e.deletions]}):null]})]}),r&&e.hunks.length>0?(0,t.jsx)("div",{className:"border-border overflow-x-auto border-t",children:e.hunks.map(e=>(0,t.jsx)(rB,{hunk:e},e.header))}):null]})}function r_({fileDiffs:e}){return 0===e.length?null:(0,t.jsxs)("div",{className:"border-border rounded-lg border",children:[(0,t.jsx)("div",{className:"px-4 py-3",children:(0,t.jsxs)("div",{className:"mb-2 flex items-center gap-2",children:[(0,t.jsx)(rT.FileText,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("span",{className:"text-foreground text-xs font-semibold",children:"Changed Files"}),(0,t.jsxs)("span",{className:"text-muted-foreground text-[10px]",children:["(",e.length,")"]})]})}),(0,t.jsx)("div",{className:"border-border border-t",children:e.map(e=>(0,t.jsx)(r$,{file:e},`${e.status}-${e.path}`))})]})}let rU={Screenshot:rC,Video:rE,TestOutput:rT.FileText,TerminalRecording:R.Terminal},rq=new Set([".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp"]),rH=new Set([".mp4",".webm",".mov"]);function rV({evidence:e}){var r,l;let a,[i,s]=(0,n.useState)(!0),o=rU[e.type]??rC,c=(a=(r=e.relativePath).lastIndexOf("."))>=0?r.slice(a).toLowerCase():"",u=(l=e.relativePath,`/api/evidence?path=${encodeURIComponent(l)}`),d="Screenshot"===e.type||rq.has(c),p="Video"===e.type||rH.has(c),f="TestOutput"===e.type||"TerminalRecording"===e.type;return(0,t.jsxs)("li",{className:"border-border rounded-md border",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>s(!i),className:"flex w-full cursor-pointer items-center gap-2.5 px-3 py-2.5 text-left",children:[i?(0,t.jsx)(L.ChevronDown,{className:"text-muted-foreground h-3 w-3 shrink-0"}):(0,t.jsx)(H.ChevronRight,{className:"text-muted-foreground h-3 w-3 shrink-0"}),(0,t.jsx)(o,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"text-foreground text-xs font-medium",children:e.description}),e.taskRef?(0,t.jsxs)("span",{className:"text-muted-foreground ml-1.5 text-[10px]",children:["(",e.taskRef,")"]}):null]}),(0,t.jsx)("a",{href:u,download:!0,onClick:e=>e.stopPropagation(),className:"text-muted-foreground hover:text-foreground shrink-0 rounded p-1 transition-colors","aria-label":"Download",children:(0,t.jsx)(rM.Download,{className:"h-3 w-3"})})]}),i&&u?(0,t.jsx)("div",{className:"border-border border-t px-3 py-2.5",children:d?(0,t.jsx)("img",{src:u,alt:e.description,className:"max-h-80 w-full rounded-md border object-contain",loading:"lazy"}):p?(0,t.jsx)("video",{src:u,controls:!0,className:"max-h-80 w-full rounded-md border",preload:"metadata",children:(0,t.jsx)("track",{kind:"captions"})}):f?(0,t.jsx)(rW,{url:u}):(0,t.jsx)("p",{className:"text-muted-foreground truncate font-mono text-[10px]",children:e.relativePath})}):null,null]})}function rW({url:e}){let[r,l]=(0,n.useState)(null),[a,i]=(0,n.useState)(!1);return a?r?(0,t.jsx)("pre",{className:"bg-muted/50 max-h-60 overflow-auto rounded-md p-3 font-mono text-[11px] leading-relaxed",children:r}):(0,t.jsx)("p",{className:"text-muted-foreground text-[10px]",children:"Unable to load preview"}):(fetch(e).then(e=>e.ok?e.text():Promise.reject(Error("Failed"))).then(e=>{let t=e.split("\n");l(t.length>100?`${t.slice(0,100).join("\n")}
2
+ ...`:e)}).catch(()=>l(null)).finally(()=>i(!0)),(0,t.jsx)("div",{className:"bg-muted/50 h-16 animate-pulse rounded-md"}))}function rK({evidence:e}){return(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"px-4 py-3",children:[(0,t.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,t.jsx)(rC,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("span",{className:"text-foreground text-xs font-semibold",children:"Evidence"}),(0,t.jsx)(W.Badge,{variant:"secondary",className:"text-[10px]",children:e.length})]}),(0,t.jsx)("ul",{className:"space-y-2",children:e.map(e=>(0,t.jsx)(rV,{evidence:e},`${e.type}-${e.relativePath}`))})]})})}function rQ({data:e,readOnly:n=!1,onApprove:r,onReject:l,isProcessing:a=!1,isRejecting:i=!1,chatInput:s,onChatInputChange:o}){let{pr:c,diffSummary:u,fileDiffs:d,branch:f,warning:h,evidence:m,hideCiStatus:x}=e,g=c?.mergeable===!1,y=g&&l?()=>l("Resolve merge conflicts",[]):r;return(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsxs)("div",{className:"flex-1 space-y-4 overflow-y-auto p-4",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"mt-1.5 h-2.5 w-2.5 shrink-0 rounded-full bg-emerald-500"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("h2",{className:"text-foreground text-sm font-bold",children:n?"Merge History":"Merge Review"}),(0,t.jsx)("p",{className:"text-muted-foreground mt-1 text-xs leading-relaxed",children:n?"This feature was merged. Review the pull request details and evidence below.":c?"Review the pull request details and approve to merge.":"Review the changes and approve to merge."})]})]}),f?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3",children:[(0,t.jsx)(rN.GitBranch,{className:"text-muted-foreground h-4 w-4 shrink-0"}),(0,t.jsx)(W.Badge,{variant:"secondary",className:"font-mono text-[11px]",children:f.source}),(0,t.jsx)(rS,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}),(0,t.jsx)(W.Badge,{variant:"outline",className:"font-mono text-[11px]",children:f.target})]})}):null,c?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"space-y-3 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("a",{href:c.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary flex items-center gap-1.5 text-sm font-semibold underline underline-offset-2",children:["PR #",c.number,(0,t.jsx)(p.ExternalLink,{className:"h-3.5 w-3.5"})]}),(0,t.jsx)(W.Badge,{variant:"outline",className:"text-xs",children:c.status})]}),!1===c.mergeable?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Merge Status"}),(0,t.jsxs)(W.Badge,{className:"border-transparent bg-orange-50 text-orange-700 hover:bg-orange-50",children:[(0,t.jsx)(J.AlertTriangle,{className:"mr-1 h-3.5 w-3.5"}),"Conflicts"]})]}):null,c.ciStatus&&!0!==x?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"CI Status"}),(0,t.jsx)(rR,{status:c.ciStatus})]}):null,c.commitHash?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Commit"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(rw.GitCommitHorizontal,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,t.jsx)("code",{className:"bg-muted text-foreground rounded-md px-1.5 py-0.5 font-mono text-[11px]",children:c.commitHash.slice(0,7)})]})]}):null]})}):null,u?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"px-4 py-3",children:[(0,t.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,t.jsx)(rj,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("span",{className:"text-foreground text-xs font-semibold",children:"Changes"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-4 gap-3",children:[(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("div",{className:"text-foreground text-sm font-bold",children:u.filesChanged}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"files"})]}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsxs)("div",{className:"text-sm font-bold text-green-600",children:["+",u.additions]}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"additions"})]}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsxs)("div",{className:"text-sm font-bold text-red-600",children:["-",u.deletions]}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"deletions"})]}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("div",{className:"text-foreground text-sm font-bold",children:u.commitCount}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"commits"})]})]})]})}):h?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3",children:[(0,t.jsx)(J.AlertTriangle,{className:"text-muted-foreground h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:h})]})}):null,m&&m.length>0?(0,t.jsx)(rK,{evidence:m}):null,d&&d.length>0?(0,t.jsx)(r_,{fileDiffs:d}):null]}),!n&&(0,t.jsx)(et,{onReject:l,onApprove:y,approveLabel:g?"Resolve Conflicts":"Approve Merge",approveVariant:g?"warning":"default",revisionPlaceholder:"Ask AI to revise before merging...",isProcessing:a,isRejecting:i,chatInput:s,onChatInputChange:o})]})}let rG=(0,Q.default)("file-search",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"11.5",cy:"14.5",r:"2.5",key:"1bq0ko"}],["path",{d:"M13.3 16.3 15 18",key:"2quom7"}]]);var rJ=e.i(38227);let rX=(0,Q.default)("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var rZ=e.i(60253),rY=e.i(53360),r0=e.i(2287),r1=e.i(28267),r2=e.i(80436);let r5=(0,Q.default)("image-off",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]]),r3=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]);function r4(e){let t=e.lastIndexOf(".");return t>=0&&r3.has(e.slice(t).toLowerCase())}function r6(e){let t=e.lastIndexOf(".")>=0?e.slice(e.lastIndexOf(".")):"",n=r4(e)?`image/${t.slice(1).replace("jpg","jpeg")}`:"",r=new URLSearchParams({path:e,...n&&{mimeType:n}});return`/api/attachments/preview?${r.toString()}`}let r9=/(?:^|\s)@(\/[^\s]+)/g;function r8({text:e,attachmentPaths:n}){let r=function(e){let t=[],n=0;for(let r of e.matchAll(r9)){let l=r.index,a=l+(r[0].length-r[0].trimStart().length);a>n&&t.push({type:"text",value:e.slice(n,a)}),t.push({type:"attachment",path:r[1]}),n=l+r[0].length}return n<e.length&&t.push({type:"text",value:e.slice(n)}),t}(e),l=r.some(e=>"attachment"===e.type),a=n?.filter(Boolean)??[];return l||0!==a.length?(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[r.map(e=>{if("text"===e.type){let n=e.value.trim();return n?(0,t.jsx)("span",{className:"text-sm leading-relaxed",children:n},`text-${n.slice(0,40)}`):null}return(0,t.jsx)(r7,{path:e.path},`att-${e.path}`)}),a.map(e=>(0,t.jsx)(r7,{path:e},`extra-${e}`))]}):(0,t.jsx)("span",{className:"text-sm leading-relaxed",children:e})}function r7({path:e}){let r=e.split("/").pop()??e,[l,a]=(0,n.useState)(!1);return r4(e)?l?(0,t.jsxs)("div",{"data-testid":"inline-attachment-image-error",className:"text-muted-foreground flex items-center gap-2 rounded-md border px-3 py-2 text-sm",children:[(0,t.jsx)(r5,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:r})]}):(0,t.jsxs)(r0.Dialog,{children:[(0,t.jsx)(r0.DialogTrigger,{asChild:!0,children:(0,t.jsx)("img",{src:r6(e),alt:r,"data-testid":"inline-attachment-image",onError:()=>a(!0),className:"max-h-48 max-w-full cursor-pointer rounded-md border object-contain transition-opacity hover:opacity-80"})}),(0,t.jsxs)(r0.DialogContent,{className:"max-w-3xl gap-0 overflow-hidden border-0 p-0 [&>button:last-child]:!cursor-pointer [&>button:last-child]:!rounded-full [&>button:last-child]:!bg-black/70 [&>button:last-child]:!p-1.5 [&>button:last-child]:!text-white [&>button:last-child]:!opacity-100 [&>button:last-child]:!shadow-lg [&>button:last-child]:!backdrop-blur-md [&>button:last-child]:hover:!bg-black/90",children:[(0,t.jsx)(r1.VisuallyHidden.Root,{children:(0,t.jsxs)(r0.DialogTitle,{children:["Preview: ",r]})}),(0,t.jsx)("div",{className:"relative bg-black/90",children:(0,t.jsx)("img",{src:r6(e),alt:r,className:"h-auto max-h-[70vh] w-full object-contain"})}),(0,t.jsxs)("div",{className:"bg-background flex items-center gap-3 px-4 py-3",children:[(0,t.jsx)("div",{className:"flex min-w-0 flex-1 flex-col",children:(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:r})}),(0,t.jsx)("a",{href:r6(e),download:r,className:"text-muted-foreground hover:text-foreground shrink-0 cursor-pointer rounded p-1.5 transition-colors","aria-label":`Download ${r}`,children:(0,t.jsx)(r2.DownloadIcon,{className:"h-4 w-4"})})]})]})]}):(0,t.jsx)("a",{href:r6(e),download:r,"data-testid":"inline-attachment-file",className:"text-primary text-sm underline underline-offset-2",children:r})}var le=e.i(25235);let lt=(0,e.i(94237).cva)("inline-block shrink-0",{variants:{size:{sm:"size-5",md:"size-8",lg:"size-12"}},defaultVariants:{size:"md"}}),ln=[{r:9,spline:"0.12 0 0.04 1",opacity:1},{r:8.2,spline:"0.16 0 0.08 1",opacity:.95},{r:7.4,spline:"0.20 0 0.12 1",opacity:.9},{r:6.6,spline:"0.25 0 0.16 1",opacity:.84},{r:5.8,spline:"0.30 0 0.20 1",opacity:.76},{r:5,spline:"0.36 0 0.25 1",opacity:.67},{r:4.2,spline:"0.42 0 0.31 1",opacity:.56},{r:3.4,spline:"0.48 0 0.37 1",opacity:.44},{r:2.6,spline:"0.55 0 0.44 1",opacity:.32},{r:1.8,spline:"0.62 0 0.52 1",opacity:.2},{r:1,spline:"0.70 0 0.60 1",opacity:.1}];function lr({className:e,size:n="md",duration:r=5,...l}){return(0,t.jsxs)("svg",{"data-slot":"comet-spinner",role:"status","aria-label":"Loading",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",className:(0,V.cn)(lt({size:n}),e),...l,children:[(0,t.jsx)("defs",{children:(0,t.jsxs)("filter",{id:"comet-gooey",x:"-100%",y:"-100%",width:"300%",height:"300%",colorInterpolationFilters:"sRGB",children:[(0,t.jsx)("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"2.5"}),(0,t.jsx)("feColorMatrix",{mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 50 -30",result:"goo"})]})}),(0,t.jsxs)("g",{filter:"url(#comet-gooey)",children:[(0,t.jsx)("animateTransform",{attributeName:"transform",type:"rotate",from:"0 50 50",to:"360 50 50",dur:`${r}s`,repeatCount:"indefinite"}),ln.map(e=>(0,t.jsxs)("g",{children:[(0,t.jsx)("animateTransform",{attributeName:"transform",type:"rotate",calcMode:"spline",values:"0 50 50;360 50 50",keyTimes:"0;1",keySplines:e.spline,dur:"1s",repeatCount:"indefinite"}),(0,t.jsx)("circle",{cx:"50",cy:"18",r:e.r,fill:"currentColor",opacity:e.opacity})]},e.r)),(0,t.jsxs)("circle",{cx:"50",cy:"50",r:"4",fill:"currentColor",opacity:"0.15",children:[(0,t.jsx)("animate",{attributeName:"r",values:"3;5;3",dur:"2s",repeatCount:"indefinite"}),(0,t.jsx)("animate",{attributeName:"opacity",values:"0.1;0.25;0.1",dur:"2s",repeatCount:"indefinite"})]})]})]})}e.i(47506);var ll=e.i(2929),la=e.i(86782),li=e.i(29847);function ls(e){if(0===e)return"0s";let t=Math.floor(e/1e3);if(0===t)return"<1s";let n=Math.floor(t/3600),r=Math.floor(t%3600/60),l=t%60;return n>0?`${n}h ${r}m`:r>0?`${r}m ${l}s`:`${l}s`}let lo=(0,Q.default)("git-merge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);var lc=e.i(43416);function lu({syncStatus:e,syncLoading:n,syncError:r,onRefreshSync:l,onRebaseOnMain:a,rebaseLoading:i,rebaseError:s}){let o=null!=e&&e.behind>0,c=e?.behind===0,u=e?.baseBranch??"main";return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(le.Separator,{}),(0,t.jsxs)("div",{"data-testid":"branch-sync-status",className:"flex flex-col gap-3 p-4",children:[(0,t.jsx)("div",{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"BRANCH SYNC"}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("div",{className:"flex items-center gap-2",children:n&&!e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(lr,{size:"sm",className:"shrink-0"}),(0,t.jsx)("span",{className:"text-muted-foreground text-sm",children:"Checking..."})]}):r?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(J.AlertTriangle,{className:"h-4 w-4 shrink-0 text-red-500"}),(0,t.jsx)("span",{className:"text-sm text-red-600",children:r})]}):i?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(lr,{size:"sm",className:"shrink-0"}),(0,t.jsxs)("span",{className:"text-sm",children:["Rebasing on"," ",(0,t.jsx)("code",{className:"bg-muted rounded px-1 py-0.5 font-mono text-xs",children:u}),"..."]})]}):o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(J.AlertTriangle,{className:"h-4 w-4 shrink-0 text-orange-500"}),(0,t.jsxs)("span",{className:"text-sm",children:[e.behind," commit",1===e.behind?"":"s"," behind"," ",(0,t.jsx)("code",{className:"bg-muted rounded px-1 py-0.5 font-mono text-xs",children:u}),e.ahead>0?(0,t.jsxs)("span",{className:"text-muted-foreground ml-1",children:["· ",e.ahead," ahead"]}):null]})]}):c?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(rI.CheckCircle2,{className:"h-4 w-4 shrink-0 text-green-500"}),(0,t.jsxs)("span",{className:"text-sm",children:["Up to date with"," ",(0,t.jsx)("code",{className:"bg-muted rounded px-1 py-0.5 font-mono text-xs",children:u}),e.ahead>0?(0,t.jsxs)("span",{className:"text-muted-foreground ml-1",children:["· ",e.ahead," ahead"]}):null]})]}):null}),(e||r)&&!i?(0,t.jsx)("button",{"data-testid":"sync-refresh-button",onClick:l,disabled:n,className:"text-muted-foreground hover:text-foreground inline-flex items-center rounded p-1 transition-colors disabled:opacity-50","aria-label":"Refresh sync status",children:(0,t.jsx)(lc.RefreshCw,{className:`h-3.5 w-3.5 ${n?"animate-spin":""}`})}):null]}),o&&!i?(0,t.jsx)(P.ActionButton,{label:"Rebase on Main",onClick:a,loading:!1,error:!!s,icon:lo,variant:"outline",size:"sm"}):null,s?(0,t.jsx)("p",{className:"text-destructive text-xs",children:s}):null]})]})}function ld({data:e,syncStatus:n,syncLoading:r,syncError:l,onRefreshSync:a,onRebaseOnMain:i,rebaseLoading:s,rebaseError:c}){let u="maintain"===e.lifecycle;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{"data-testid":"feature-drawer-status",className:"flex flex-col gap-3 p-4",children:[(0,t.jsx)("div",{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:ll.lifecycleDisplayLabels[e.lifecycle]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(lp,{data:e}),"error"===e.state&&e.onRetry?(0,t.jsxs)("button",{"data-testid":"feature-drawer-retry-button",onClick:()=>e.onRetry(e.featureId),className:"flex shrink-0 cursor-pointer items-center gap-1.5 rounded-full bg-red-50 px-3 py-1.5 text-sm font-medium text-red-700 transition-colors hover:bg-red-100",children:[(0,t.jsx)(rJ.RotateCcw,{className:"h-3.5 w-3.5"}),"Retry"]}):null,("running"===e.state||"action-required"===e.state)&&e.onStop?(0,t.jsxs)("button",{"data-testid":"feature-drawer-stop-button",onClick:()=>e.onStop(e.featureId),className:"flex shrink-0 cursor-pointer items-center gap-1.5 rounded-full bg-red-50 px-3 py-1.5 text-sm font-medium text-red-700 transition-colors hover:bg-red-100",children:[(0,t.jsx)(o.Square,{className:"h-3.5 w-3.5"}),"Stop"]}):null]}),!u&&e.progress>0?(0,t.jsxs)("div",{"data-testid":"feature-drawer-progress",className:"flex flex-col gap-1",children:[(0,t.jsxs)("div",{className:"text-muted-foreground flex items-center justify-between text-xs",children:[(0,t.jsx)("span",{children:"Progress"}),(0,t.jsxs)("span",{children:[e.progress,"%"]})]}),(0,t.jsx)("div",{className:"bg-muted h-2 w-full overflow-hidden rounded-full",children:(0,t.jsx)("div",{className:(0,V.cn)("h-full rounded-full transition-all",ll.featureNodeStateConfig[e.state].progressClass),style:{width:`${e.progress}%`}})})]}):null,u&&e.pr?(0,t.jsx)(lm,{pr:e.pr,hideCiStatus:e.hideCiStatus}):null]}),(0,t.jsx)(lf,{data:e}),!u&&e.pr?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(le.Separator,{}),(0,t.jsx)("div",{className:"p-4",children:(0,t.jsx)(lm,{pr:e.pr,hideCiStatus:e.hideCiStatus})})]}):null,(0,t.jsx)(lx,{data:e}),i&&e.branch&&a?(0,t.jsx)(lu,{syncStatus:n??null,syncLoading:r??!1,syncError:l??null,onRefreshSync:a,onRebaseOnMain:i,rebaseLoading:s??!1,rebaseError:c??null}):null,(0,t.jsx)(lv,{data:e})]})}function lp({data:e}){let n=ll.featureNodeStateConfig[e.state],r=n.icon;return(0,t.jsxs)("div",{className:(0,V.cn)("flex items-center gap-2 rounded-full px-3 py-1.5 text-sm font-medium",n.badgeBgClass,n.badgeClass),children:["running"===e.state?(0,t.jsx)(lr,{size:"sm",className:"shrink-0"}):(0,t.jsx)(r,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:n.label})]})}function lf({data:e}){var n;let r,l,a,i,s,o=!!e.summary&&!(e.userQuery&&e.summary?.trim()===e.userQuery.trim());return e.branch||e.oneLiner||o||e.userQuery||e.createdAt?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(le.Separator,{}),(0,t.jsxs)("div",{"data-testid":"feature-drawer-info",className:"flex flex-col gap-3 p-4",children:[e.branch?(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Branch"}),(0,t.jsxs)("span",{className:"flex items-center gap-1.5 text-sm",children:[(0,t.jsx)(rN.GitBranch,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}),(0,t.jsx)("code",{className:"bg-muted rounded px-1 py-0.5 font-mono text-xs",children:e.branch}),e.baseBranch?(0,t.jsxs)("span",{className:"text-muted-foreground text-xs",children:["from ",e.baseBranch]}):null]})]}):null,e.oneLiner?(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"One-Liner"}),(0,t.jsx)("span",{className:"text-sm leading-relaxed",children:e.oneLiner})]}):null,e.userQuery?(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"User Query"}),(0,t.jsx)(r8,{text:e.userQuery})]}):null,o?(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Summary"}),(0,t.jsx)("span",{className:"text-sm leading-relaxed",children:e.summary})]}):null,e.createdAt?(0,t.jsx)(lb,{label:"Created",value:(n=e.createdAt,r=Date.now(),(s=Math.floor((i=Math.floor((a=Math.floor(Math.floor((r-(l="string"==typeof n?new Date(n).getTime():n))/1e3)/60))/60))/24))>30?new Date(l).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}):s>0?`${s} day${1===s?"":"s"} ago`:i>0?`${i} hour${1===i?"":"s"} ago`:a>0?`${a} minute${1===a?"":"s"} ago`:"just now")}):null]})]}):null}let lh={[rP.PrStatus.Open]:"border-transparent bg-blue-50 text-blue-700 hover:bg-blue-50",[rP.PrStatus.Merged]:"border-transparent bg-purple-50 text-purple-700 hover:bg-purple-50",[rP.PrStatus.Closed]:"border-transparent bg-red-50 text-red-700 hover:bg-red-50"};function lm({pr:e,hideCiStatus:n}){return(0,t.jsx)("div",{"data-testid":"feature-drawer-pr",children:(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary flex items-center gap-1.5 text-sm font-semibold underline underline-offset-2",children:["PR #",e.number,(0,t.jsx)(p.ExternalLink,{className:"h-3.5 w-3.5"})]}),(0,t.jsx)(W.Badge,{className:lh[e.status],children:e.status})]}),e.ciStatus&&!0!==n?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"CI Status"}),(0,t.jsx)(rR,{status:e.ciStatus})]}):null,!1===e.mergeable?(0,t.jsxs)("div",{"data-testid":"pr-merge-conflict",className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Merge Status"}),(0,t.jsxs)(W.Badge,{className:"border-transparent bg-orange-50 text-orange-700 hover:bg-orange-50",children:[(0,t.jsx)(J.AlertTriangle,{className:"mr-1 h-3.5 w-3.5"}),"Conflicts"]})]}):null,e.commitHash?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Commit"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(rw.GitCommitHorizontal,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,t.jsx)("code",{className:"bg-muted text-foreground rounded-md px-1.5 py-0.5 font-mono text-[11px]",children:e.commitHash.slice(0,7)})]})]}):null]})})}function lx({data:e}){let r=function(e){let[t,r]=(0,n.useState)(null),l=(0,n.useRef)(null);return(0,n.useEffect)(()=>e?(r(ls(Math.max(0,Date.now()-e))),l.current=setInterval(()=>{r(ls(Math.max(0,Date.now()-e)))},1e3),()=>{l.current&&(clearInterval(l.current),l.current=null)}):void r(null),[e]),t}("running"===e.state||"action-required"===e.state?e.startedAt:void 0);return e.fastMode??e.agentType??e.runtime??r??e.blockedBy??e.errorMessage?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(le.Separator,{}),(0,t.jsxs)("div",{"data-testid":"feature-drawer-details",className:"flex flex-col gap-3 p-4",children:[e.fastMode?(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Mode"}),(0,t.jsxs)("span",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)(rY.Zap,{className:"h-4 w-4 shrink-0 text-amber-500"}),"Fast Mode"]})]}):null,e.agentType?(0,t.jsx)(lg,{agentType:e.agentType}):null,e.runtime?(0,t.jsx)(lb,{label:"Runtime",value:e.runtime}):null,!e.runtime&&r?(0,t.jsx)(lb,{label:"Running for",value:r}):null,e.blockedBy?(0,t.jsx)(lb,{label:"Blocked by",value:e.blockedBy}):null,e.errorMessage?(0,t.jsx)(lb,{label:"Error",value:e.errorMessage}):null]})]}):null}function lg({agentType:e}){let n=(0,la.getAgentTypeIcon)(e),r=la.agentTypeLabels[e]??e;return(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Agent"}),(0,t.jsxs)("span",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)(n,{className:"h-4 w-4 shrink-0"}),r]})]})}function ly({enabled:e,label:n}){return(0,t.jsxs)("span",{className:(0,V.cn)("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium",e?"bg-emerald-50 text-emerald-700":"bg-muted text-muted-foreground"),children:[e?(0,t.jsx)(u.Check,{className:"h-3 w-3"}):(0,t.jsx)(rZ.X,{className:"h-3 w-3"}),n]})}function lv({data:e}){return null!=e.approvalGates||null!=e.push||null!=e.openPr||null!=e.ciWatchEnabled||null!=e.enableEvidence||null!=e.forkAndPr||null!=e.commitSpecs||e.modelId?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(le.Separator,{}),(0,t.jsxs)("div",{"data-testid":"feature-drawer-settings",className:"flex flex-col gap-3 p-4",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"SETTINGS"}),e.modelId?(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Model"}),(0,t.jsx)("span",{className:"text-sm",children:(0,li.getModelMeta)(e.modelId).displayName||e.modelId})]}):null,e.approvalGates?(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("span",{className:"text-muted-foreground flex items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(rX,{className:"h-3 w-3"}),"Auto-Approve"]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,t.jsx)(ly,{enabled:e.approvalGates.allowPrd,label:"PRD"}),(0,t.jsx)(ly,{enabled:e.approvalGates.allowPlan,label:"Plan"}),(0,t.jsx)(ly,{enabled:e.approvalGates.allowMerge,label:"Merge"})]})]}):null,null!=e.enableEvidence?(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("span",{className:"text-muted-foreground flex items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(rG,{className:"h-3 w-3"}),"Evidence"]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,t.jsx)(ly,{enabled:e.enableEvidence,label:"Collect"}),null!=e.commitEvidence?(0,t.jsx)(ly,{enabled:e.commitEvidence,label:"Add to PR"}):null]})]}):null,null!=e.push||null!=e.openPr||null!=e.ciWatchEnabled||null!=e.commitSpecs||null!=e.forkAndPr?(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("span",{className:"text-muted-foreground flex items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(rN.GitBranch,{className:"h-3 w-3"}),"Git"]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[null!=e.push?(0,t.jsx)(ly,{enabled:e.push,label:"Push"}):null,null!=e.openPr?(0,t.jsx)(ly,{enabled:e.openPr,label:"PR"}):null,null!=e.ciWatchEnabled?(0,t.jsx)(ly,{enabled:e.ciWatchEnabled,label:"Watch"}):null,null!=e.commitSpecs?(0,t.jsx)(ly,{enabled:e.commitSpecs,label:"Commit Specs"}):null,null!=e.forkAndPr?(0,t.jsx)(ly,{enabled:e.forkAndPr,label:"Fork & PR"}):null]})]}):null]})]}):null}function lb({label:e,value:n}){return(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:e}),(0,t.jsx)("span",{className:"text-sm",children:n})]})}var lk=e.i(55016);let lj=(0,Q.default)("dollar-sign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);var rA=rA,lw=e.i(94819),lN=e.i(48109),lS=e.i(58860);let lC=(0,Q.default)("arrow-down-to-line",[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]]),lT=(0,Q.default)("arrow-up-from-line",[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]]);function lE(e,t){if(null!=e.durationMs&&e.durationMs>0)return e.durationMs;if(!e.completedAt&&e.startedAt){let n=new Date(e.startedAt).getTime();if(!Number.isNaN(n))return Math.max(0,t-n)}return 0}function lM(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function lI(e){let t=e instanceof Date?e:new Date(String(e));return Number.isNaN(t.getTime())?"":t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function lA(e){return e>=1?`$${e.toFixed(2)}`:e>=.01?`$${e.toFixed(3)}`:`$${e.toFixed(4)}`}let lP={analyze:"Analyzing",requirements:"Requirements",research:"Researching",plan:"Planning",implement:"Implementing",rebase:"Rebasing","fast-implement":"Fast Implement",evidence:"Evidence",validate:"Validating",repair:"Repairing",merge:"Merging"},lR={"run:started":{label:"started",colorClass:"text-blue-600",bgClass:"bg-blue-50 dark:bg-blue-950/30",icon:s.Play},"run:resumed":{label:"resumed",colorClass:"text-blue-600",bgClass:"bg-blue-50 dark:bg-blue-950/30",icon:rJ.RotateCcw},"run:completed":{label:"completed",colorClass:"text-emerald-600",bgClass:"bg-emerald-50 dark:bg-emerald-950/30",icon:rI.CheckCircle2},"run:failed":{label:"failed",colorClass:"text-red-600",bgClass:"bg-red-50 dark:bg-red-950/30",icon:rA.default},"run:stopped":{label:"stopped",colorClass:"text-amber-600",bgClass:"bg-amber-50 dark:bg-amber-950/30",icon:o.Square},"run:crashed":{label:"crashed",colorClass:"text-red-600",bgClass:"bg-red-50 dark:bg-red-950/30",icon:rA.default},"run:rejected":{label:"rejected",colorClass:"text-orange-600",bgClass:"bg-orange-50 dark:bg-orange-950/30",icon:lw.Ban}};function lD(e){return e.startsWith("run:")}function lL({timings:e,loading:r,error:l,rejectionFeedback:i}){let s=function(e){let[t,r]=(0,n.useState)(Date.now),l=(0,n.useRef)(null);return(0,n.useEffect)(()=>(e&&e.some(e=>!e.phase.startsWith("run:")&&!e.completedAt&&e.startedAt)&&(l.current=setInterval(()=>r(Date.now()),1e3)),()=>{l.current&&(clearInterval(l.current),l.current=null)}),[e]),t}(e);if(r)return(0,t.jsx)("div",{"data-testid":"activity-tab-loading",className:"flex items-center justify-center p-8",children:(0,t.jsx)(a.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})});if(l)return(0,t.jsxs)("div",{className:"flex items-center gap-2 p-4 text-base text-red-600",children:[(0,t.jsx)(B.AlertCircle,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:l})]});if(!e||0===e.length)return(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 p-8",children:[(0,t.jsx)(lk.Clock,{className:"text-muted-foreground h-8 w-8"}),(0,t.jsx)("p",{className:"text-muted-foreground text-base",children:"No activity recorded yet"})]});let o=e.filter(e=>!lD(e.phase)),c=Math.max(...o.map(e=>lE(e,s)),...o.map(e=>e.approvalWaitMs??0),0),u=function(e,t){if(!e.length)return[];let n=e.filter(e=>"run:rejected"===e.phase).length,r=t?.length??0,l=e;if(r>n){l=[...e];let a=e[e.length-1].agentRunId;for(let e=n;e<r;e++){let r=t[e];e>n&&l.push({agentRunId:a,phase:"run:resumed",startedAt:r.timestamp??`synthetic-resumed-${e}`}),l.push({agentRunId:a,phase:"run:rejected",startedAt:r.timestamp??`synthetic-${e}`})}}let a=[],i=[],s=0;for(let e of l)if(i.push(e),"run:rejected"===e.phase){let e=t?.[s];a.push({number:a.length+1,timings:i,rejectionMessage:e?.message,rejectionAttachments:e?.attachments}),i=[],s++}return i.length>0&&a.push({number:a.length+1,timings:i}),a}(e,i),d=u.length>1,p=o.reduce((e,t)=>e+lE(t,s),0),f=o.reduce((e,t)=>e+(t.approvalWaitMs??0),0),h=o.reduce((e,t)=>e+(t.inputTokens??0),0),m=o.reduce((e,t)=>e+(t.outputTokens??0),0),x=o.reduce((e,t)=>e+(t.costUsd??0),0);return(0,t.jsxs)("div",{className:"flex flex-col gap-3 p-4",children:[(0,t.jsx)("div",{"data-testid":"activity-timings",className:"flex flex-col gap-3",children:u.map(e=>(0,t.jsx)(lz,{iteration:e,showHeader:d,maxDurationMs:c,now:s},e.number))}),p>0?(0,t.jsx)(l$,{totalExecMs:p,totalWaitMs:f,totalInputTokens:h,totalOutputTokens:m,totalCostUsd:x}):null]})}function lz({iteration:e,showHeader:n,maxDurationMs:r,now:l}){let a=function(e){let t=[...e.timings].reverse().find(e=>lD(e.phase));if(!t)return null;switch(t.phase){case"run:rejected":return{label:"Rejected",colorClass:"text-orange-600",dotClass:"bg-orange-500"};case"run:completed":return{label:"Completed",colorClass:"text-emerald-600",dotClass:"bg-emerald-500"};case"run:failed":return{label:"Failed",colorClass:"text-red-600",dotClass:"bg-red-500"};case"run:crashed":return{label:"Crashed",colorClass:"text-red-600",dotClass:"bg-red-500"};case"run:stopped":return{label:"Stopped",colorClass:"text-amber-600",dotClass:"bg-amber-500"};default:return null}}(e);return(0,t.jsxs)("div",{"data-testid":`iteration-${e.number}`,className:"border-border/50 bg-card/50 flex flex-col overflow-hidden rounded-lg border",children:[n?(0,t.jsxs)("div",{className:"bg-muted/30 border-border/50 flex items-center justify-between border-b px-3 py-1.5",children:[(0,t.jsxs)("span",{className:"text-muted-foreground text-sm font-semibold tracking-wide",children:["Iteration ",e.number]}),a?(0,t.jsxs)("span",{className:`flex items-center gap-1 text-xs font-medium ${a.colorClass}`,children:[(0,t.jsx)("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${a.dotClass}`}),a.label]}):null]}):null,(0,t.jsxs)("div",{className:"relative flex flex-col",children:[(0,t.jsx)("div",{className:"bg-border/60 absolute top-4 bottom-4 left-[21.5px] w-px"}),e.timings.map((n,a)=>{if(lD(n.phase)){let r,l="run:rejected"===n.phase,i="run:failed"===n.phase||"run:crashed"===n.phase||"run:stopped"===n.phase;if(l)r=e.rejectionMessage;else if(i){let t=[...e.timings].reverse().find(e=>!lD(e.phase)&&e.errorMessage);r=t?.errorMessage??n.errorMessage}return(0,t.jsx)(lF,{timing:n,message:r,attachments:l?e.rejectionAttachments:void 0,isFirst:0===a,isLast:a===e.timings.length-1},`${n.agentRunId}-${n.phase}-${n.startedAt}`)}return(0,t.jsx)(lO,{timing:n,maxDurationMs:r,now:l},`${n.agentRunId}-${n.phase}-${n.startedAt}`)})]})]})}function lF({timing:e,message:n,attachments:r,isFirst:l,isLast:a}){let i,s=lR[e.phase];if(!s)return null;let o=r&&r.length>0,c=s.icon;return(0,t.jsxs)("div",{className:`relative flex flex-col gap-1 px-3 ${l?"pt-2":"pt-1"} ${a?"pb-2":"pb-1"}`,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:`relative z-10 flex h-5 w-5 shrink-0 items-center justify-center rounded-full ${s.bgClass}`,children:(0,t.jsx)(c,{className:`h-3 w-3 ${s.colorClass}`})}),(0,t.jsx)("span",{className:`text-sm font-medium ${s.colorClass}`,children:s.label}),e.startedAt&&!("string"==typeof e.startedAt&&e.startedAt.startsWith("synthetic"))?(0,t.jsx)("span",{className:"text-muted-foreground/60 ml-auto text-xs tabular-nums",children:lI(String(e.startedAt))}):null]}),n?(i="run:failed"===e.phase||"run:crashed"===e.phase||"run:stopped"===e.phase,(0,t.jsxs)("div",{className:`ml-[26px] flex items-start gap-1.5 rounded-md px-2 py-1.5 ${i?"bg-red-50/50 dark:bg-red-950/20":"bg-orange-50/50 dark:bg-orange-950/20"}`,children:[i?(0,t.jsx)(B.AlertCircle,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-red-400"}):(0,t.jsx)(lN.MessageSquare,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-orange-400"}),(0,t.jsxs)("span",{"data-testid":i?"error-message-text":"rejection-feedback-text",className:"text-muted-foreground text-xs leading-relaxed italic",children:["— ",n]})]})):null,o?(0,t.jsx)("div",{"data-testid":"rejection-feedback-attachments",className:"ml-[26px]",children:(0,t.jsx)(r8,{text:"",attachmentPaths:r})}):null]})}function lO({timing:e,maxDurationMs:r,now:l}){let a=e.phase.includes(":")?e.phase.split(":")[0]:e.phase,i=e.phase.includes(":")?e.phase.split(":")[1]:null,s=null!==i,o=i?.startsWith("phase-")??!1,d=lP[a]??a,p=o?`Phase ${i.replace("phase-","")}`:null!==i?`${d} #${i}`:d,f=lE(e,l),h=!e.completedAt&&!!e.startedAt,m=h?15:2,x=r>0?Math.max(m,f/r*100):m,g=e.completedAt?o?"bg-emerald-400":s?"bg-amber-500":"bg-emerald-500":"bg-blue-500",y=null!=e.inputTokens||null!=e.outputTokens?(e.inputTokens??0)+(e.outputTokens??0):null,[v,b]=(0,n.useState)(!1),k=(0,n.useCallback)(()=>{e.prompt&&navigator.clipboard.writeText(e.prompt).then(()=>{b(!0),setTimeout(()=>b(!1),1500)})},[e.prompt]);return(0,t.jsxs)("div",{className:`group/phase relative flex flex-col gap-0.5 px-3 py-1.5 ${s?"ml-4":""}`,children:[(0,t.jsxs)("div",{"data-testid":`timing-bar-${e.phase}`,className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"relative z-10 flex h-5 w-5 shrink-0 items-center justify-center",children:(0,t.jsx)("div",{className:`rounded-full ${h?"h-3 w-3 animate-pulse":"h-2.5 w-2.5"} ${h?"bg-blue-500":e.completedAt?"bg-emerald-500":"bg-muted-foreground/30"}`})}),(0,t.jsx)("span",{className:`w-28 shrink-0 truncate text-sm font-medium ${s?"text-muted-foreground":"text-foreground/80"}`,children:p}),e.prompt?(0,t.jsx)("button",{type:"button",onClick:k,className:"text-muted-foreground/50 hover:text-foreground/70 -ml-1 shrink-0 opacity-0 transition-opacity group-hover/phase:opacity-100",title:"Copy prompt to clipboard",children:v?(0,t.jsx)(u.Check,{className:"h-3.5 w-3.5 text-emerald-500"}):(0,t.jsx)(c.Copy,{className:"h-3.5 w-3.5"})}):null,(0,t.jsx)("div",{className:`bg-muted relative min-w-0 flex-1 overflow-hidden rounded-full ${s?"h-1.5":"h-2"}`,children:h?(0,t.jsx)("div",{className:"absolute inset-0 rounded-full bg-blue-500/30",style:{backgroundImage:"linear-gradient(90deg, transparent 0%, rgb(59 130 246) 50%, transparent 100%)",backgroundSize:"200% 100%",animation:"shimmer 1.5s ease-in-out infinite"}}):(0,t.jsx)("div",{className:`h-full rounded-full transition-all duration-300 ${g}`,style:{width:`${Math.min(x,100)}%`}})}),(0,t.jsx)("span",{className:"text-muted-foreground w-14 shrink-0 text-right text-sm font-medium tabular-nums",children:ls(f)})]}),(0,t.jsxs)("div",{className:"ml-[28px] flex items-center gap-3 text-xs",children:[e.startedAt?(0,t.jsx)("span",{className:"text-muted-foreground/60 tabular-nums",children:lI(e.startedAt)}):null,null!=y&&y>0?(0,t.jsxs)("span",{className:"text-muted-foreground/70 inline-flex items-center gap-0.5",children:[(0,t.jsx)(rY.Zap,{className:"h-3 w-3 opacity-50"}),lM(y)]}):null,null!=e.costUsd&&e.costUsd>0?(0,t.jsxs)("span",{className:"text-muted-foreground/70 inline-flex items-center gap-0.5",children:[(0,t.jsx)(lj,{className:"h-3 w-3 opacity-50"}),lA(e.costUsd)]}):null]}),null!=e.approvalWaitMs&&e.approvalWaitMs>0?(0,t.jsx)(lB,{timing:e,maxDurationMs:r}):null]})}function lB({timing:e,maxDurationMs:n}){let r=e.approvalWaitMs??0,l=n>0?Math.max(2,r/n*100):2;return(0,t.jsxs)("div",{"data-testid":`approval-wait-${e.phase}`,className:"ml-[26px] flex items-center gap-2 rounded-md bg-amber-50/50 px-1.5 py-1 dark:bg-amber-950/20",children:[(0,t.jsx)(lS.Timer,{className:"h-3.5 w-3.5 shrink-0 text-amber-500"}),(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 text-xs",children:"approval"}),(0,t.jsx)("div",{className:"bg-muted h-1.5 min-w-0 flex-1 overflow-hidden rounded-full",children:(0,t.jsx)("div",{className:"h-full rounded-full bg-amber-500",style:{width:`${Math.min(l,100)}%`}})}),(0,t.jsx)("span",{className:"text-muted-foreground w-14 shrink-0 text-right text-xs tabular-nums",children:ls(r)})]})}function l$({totalExecMs:e,totalWaitMs:n,totalInputTokens:r,totalOutputTokens:l,totalCostUsd:a}){let i=r+l;return(0,t.jsxs)("div",{"data-testid":"activity-summary",className:"border-border bg-card/30 flex flex-col gap-2 rounded-lg border p-3",children:[(0,t.jsx)("div",{className:"text-muted-foreground mb-1 text-xs font-semibold tracking-wider uppercase",children:"Summary"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-x-4 gap-y-3",children:[(0,t.jsx)(l_,{icon:lk.Clock,label:"Execution",value:ls(e)}),(0,t.jsx)(l_,{icon:lS.Timer,label:"Wait",value:n>0?ls(n):"n/a"}),(0,t.jsx)(l_,{icon:lk.Clock,label:"Wall-clock",value:n>0?ls(e+n):ls(e)}),(0,t.jsx)(l_,{icon:lj,label:"Cost",value:a>0?lA(a):"n/a"}),(0,t.jsxs)("div",{className:"col-span-2 flex flex-col gap-0.5",children:[(0,t.jsxs)("span",{className:"text-muted-foreground flex items-center gap-1 text-xs",children:[(0,t.jsx)(rY.Zap,{className:"h-3 w-3 opacity-40"}),"Tokens"]}),i>0?(0,t.jsxs)("span",{className:"flex items-center gap-2.5 text-sm tabular-nums",children:[(0,t.jsx)("span",{children:lM(i)}),(0,t.jsxs)("span",{className:"text-muted-foreground flex items-center gap-3 text-xs",title:"Input tokens / Output tokens",children:[(0,t.jsxs)("span",{className:"flex items-center gap-0.5",children:[(0,t.jsx)(lC,{className:"h-3 w-3 text-blue-500 opacity-60"}),lM(r)]}),(0,t.jsxs)("span",{className:"flex items-center gap-0.5",children:[(0,t.jsx)(lT,{className:"h-3 w-3 text-emerald-500 opacity-60"}),lM(l)]})]})]}):(0,t.jsx)("span",{className:"text-muted-foreground/40 text-sm italic tabular-nums",children:"n/a"})]})]})]})}function l_({icon:e,label:n,value:r,className:l=""}){let a="n/a"===r;return(0,t.jsxs)("div",{className:`flex flex-col gap-0.5 ${l}`,children:[(0,t.jsxs)("span",{className:"text-muted-foreground flex items-center gap-1 text-xs",children:[(0,t.jsx)(e,{className:"h-3 w-3 opacity-40"}),n]}),(0,t.jsx)("span",{className:`text-sm tabular-nums ${a?"text-muted-foreground/40 italic":""}`,children:r})]})}var lU=e.i(7311),lq=e.i(44229);let lH=(0,Q.default)("coins",[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]]),lV=(0,Q.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"}]]),lW=(0,Q.default)("file-code",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]]),lK=/^\[(\d{4}-\d{2}-\d{2}T[\d:.]+Z?)\]\s+(?:\[([^\]]+)\]\s+)?(?:\[([^\]|]+)(?:\|([^\]]+))?\]\s+)?(.*)$/,lQ=/^\[(tool|text|result|tokens|raw|WORKER)\]\s*(.*)/;function lG(e){let t=e.match(lK);if(!t)return{timestamp:null,phase:null,agent:null,model:null,tag:"raw",message:e,raw:e};let[,n,r,l,a,i]=t,s=null,o=null,c=null,u=i??"";if(null!=l&&null!=r)if(r.includes("|")){let[e,t]=r.split("|");o=e,c=t??null,u=`[${l}] ${i??""}`}else s=r,o=l,c=a??null;else if(null!=r)if(r.includes("|")){let[e,t]=r.split("|");o=e,c=t??null}else s=r;let d=u.match(lQ),p="info";return d&&(p=d[1].toLowerCase(),u=d[2]),{timestamp:n??null,phase:s,agent:o,model:c,tag:p,message:u.trim(),raw:e}}function lJ({content:e}){let r=(0,n.useMemo)(()=>e?e.split("\n").filter(e=>e.trim().length>0).map(lG):[],[e]);return 0===r.length?null:(0,t.jsx)("div",{className:"flex flex-col",children:r.map((e,n)=>(0,t.jsx)(lX,{line:e},n))})}function lX({line:e}){switch(e.tag){case"tool":return(0,t.jsx)(l0,{line:e});case"text":return(0,t.jsx)(l2,{line:e});case"result":return(0,t.jsx)(l5,{line:e});case"tokens":return(0,t.jsx)(l3,{line:e});case"worker":return(0,t.jsx)(l4,{line:e});case"info":return(0,t.jsx)(l6,{line:e});default:return(0,t.jsx)(l9,{line:e})}}function lZ({value:e}){if(!e)return null;let n=e.replace(/^.*T/,"").replace("Z",""),r=n.split(":"),l=r.length>=3?`${r[1]}:${r[2].split(".")[0]}`:n;return(0,t.jsx)("span",{className:"text-muted-foreground/60 w-11 shrink-0 font-mono text-[10px]",children:l})}function lY({phase:e}){return e?(0,t.jsx)("span",{className:"bg-muted text-muted-foreground w-20 shrink-0 truncate rounded px-1.5 py-0.5 font-mono text-[10px] font-medium",title:e,children:e}):(0,t.jsx)("span",{className:"w-20 shrink-0"})}function l0({line:e}){var n;let r,{toolName:l,args:a}=-1===(r=(n=e.message).indexOf(" "))?{toolName:n,args:""}:{toolName:n.slice(0,r),args:n.slice(r+1)},i=function(e,t){try{let n=JSON.parse(t);if("Read"===e&&n.file_path||"Write"===e&&n.file_path||"Edit"===e&&n.file_path)return n.file_path;if("Glob"===e&&n.pattern||"Grep"===e&&n.pattern)return n.pattern;if("Bash"===e&&n.command)return n.command;if("Task"===e&&n.description)return n.description}catch{if(t.length>0)return t}return null}(l,a);return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 border-b border-transparent px-3 py-1.5 transition-colors",children:[(0,t.jsx)(lZ,{value:e.timestamp}),(0,t.jsx)(lY,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(l1,{toolName:l}),(0,t.jsx)("span",{className:"text-xs font-semibold text-violet-600 dark:text-violet-400",children:l}),i?(0,t.jsx)("span",{className:"text-muted-foreground min-w-0 font-mono text-xs break-all",children:i}):null]})]})}function l1({toolName:e}){let n=e.toLowerCase();return"bash"===n?(0,t.jsx)(R.Terminal,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-500"}):"read"===n||"glob"===n||"grep"===n?(0,t.jsx)(rT.FileText,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-500"}):"write"===n||"edit"===n?(0,t.jsx)(lW,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-500"}):(0,t.jsx)(R.Terminal,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-500"})}function l2({line:e}){return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,t.jsx)(lZ,{value:e.timestamp}),(0,t.jsx)(lY,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(lN.MessageSquare,{className:"mt-0.5 h-3 w-3 shrink-0 text-blue-500"}),(0,t.jsx)("span",{className:"text-foreground/80 min-w-0 text-xs leading-relaxed",children:e.message})]})]})}function l5({line:e}){var n;let r,l,{chars:a}=(r=(n=e.message).match(/^(\d+)\s+chars/),l=n.match(/session=(\S+)/),{chars:r?parseInt(r[1],10):0,sessionId:l?l[1]:null});return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,t.jsx)(lZ,{value:e.timestamp}),(0,t.jsx)(lY,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(rI.CheckCircle2,{className:"mt-0.5 h-3 w-3 shrink-0 text-emerald-500"}),(0,t.jsxs)("span",{className:"text-xs font-medium text-emerald-600 dark:text-emerald-400",children:["Result: ",a.toLocaleString()," chars"]})]})]})}function l3({line:e}){let n,{inputTokens:r,outputTokens:l}=(n=e.message.match(/^(\d+)\s+in\s*\/\s*(\d+)\s+out/))?{inputTokens:parseInt(n[1],10),outputTokens:parseInt(n[2],10)}:{inputTokens:0,outputTokens:0};return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,t.jsx)(lZ,{value:e.timestamp}),(0,t.jsx)(lY,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(lH,{className:"mt-0.5 h-3 w-3 shrink-0 text-amber-500"}),(0,t.jsxs)("span",{className:"text-muted-foreground text-xs",children:[(0,t.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:r.toLocaleString()})," in / ",(0,t.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:l.toLocaleString()})," out"]})]})]})}function l4({line:e}){return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 bg-zinc-50 px-3 py-1.5 transition-colors dark:bg-zinc-900/50",children:[(0,t.jsx)(lZ,{value:e.timestamp}),(0,t.jsx)(lY,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(lV,{className:"mt-0.5 h-3 w-3 shrink-0 text-zinc-500"}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium break-all",children:e.message})]})]})}function l6({line:e}){return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,t.jsx)(lZ,{value:e.timestamp}),(0,t.jsx)(lY,{phase:e.phase}),(0,t.jsx)("span",{className:"text-muted-foreground min-w-0 text-xs break-all",children:e.message})]})}function l9({line:e}){return(0,t.jsx)("div",{className:"px-3 py-0.5",children:(0,t.jsx)("span",{className:"text-muted-foreground/70 font-mono text-[11px] break-all whitespace-pre-wrap",children:e.raw})})}function l8({content:e,isConnected:r,error:l}){let a=(0,n.useRef)(null),[i,s]=(0,n.useState)(!0),[o,c]=(0,n.useState)("structured"),u=(0,n.useCallback)(()=>{let e=a.current;e&&s(e.scrollHeight-e.scrollTop-e.clientHeight<40)},[]),d=(0,n.useCallback)(()=>{let e=a.current;e&&(e.scrollTop=e.scrollHeight,s(!0))},[]);return((0,n.useEffect)(()=>{i&&a.current&&(a.current.scrollTop=a.current.scrollHeight)},[e,i]),l)?(0,t.jsxs)("div",{className:"flex items-center gap-2 p-4 text-sm text-red-600",children:[(0,t.jsx)(B.AlertCircle,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:l})]}):e?(0,t.jsxs)("div",{className:"flex h-full flex-col","data-testid":"log-tab",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b px-3 py-1.5",children:[(0,t.jsx)("span",{className:`h-2 w-2 rounded-full ${r?"bg-emerald-500":"bg-zinc-400"}`}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:r?"Live":"Disconnected"}),(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[(0,t.jsx)("button",{type:"button",onClick:()=>c("structured"),className:`rounded p-1 transition-colors ${"structured"===o?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,title:"Structured view",children:(0,t.jsx)(rT.FileText,{className:"h-3.5 w-3.5"})}),(0,t.jsx)("button",{type:"button",onClick:()=>c("raw"),className:`rounded p-1 transition-colors ${"raw"===o?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,title:"Raw view",children:(0,t.jsx)(lq.Code,{className:"h-3.5 w-3.5"})}),i?null:(0,t.jsxs)("button",{type:"button",onClick:d,className:"text-muted-foreground hover:text-foreground ml-1 flex items-center gap-1 text-xs",children:[(0,t.jsx)(lU.ArrowDown,{className:"h-3 w-3"}),"Jump to bottom"]})]})]}),(0,t.jsx)("div",{ref:a,onScroll:u,className:`flex-1 overflow-y-auto ${"raw"===o?"bg-zinc-950 p-3 font-mono text-xs leading-relaxed break-all whitespace-pre-wrap text-zinc-300":"bg-background"}`,children:"structured"===o?(0,t.jsx)(lJ,{content:e}):e})]}):(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 p-8",children:[(0,t.jsx)(R.Terminal,{className:"text-muted-foreground h-8 w-8"}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:"No log output yet"}),r?(0,t.jsx)("p",{className:"text-muted-foreground text-xs",children:"Waiting for log data..."}):null]})}let l7=(0,Q.default)("list-todo",[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]]);var ae=e.i(95812),at=e.i(87889);let an=(0,Q.default)("circle-dashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]),ar={Todo:{icon:ae.Circle,colorClass:"text-muted-foreground",borderClass:"border-border",label:"Todo"},"Work in Progress":{icon:a.Loader2,colorClass:"text-blue-600",borderClass:"border-blue-200",spinning:!0,label:"In Progress"},Done:{icon:u.Check,colorClass:"text-emerald-600",borderClass:"border-emerald-200",label:"Done"},Review:{icon:at.Eye,colorClass:"text-amber-600",borderClass:"border-amber-200",label:"Review"}},al={icon:ae.Circle,colorClass:"text-muted-foreground",borderClass:"border-border",label:"Unknown"};function aa({tasks:e}){return 0===e.length?(0,t.jsx)("div",{className:"flex flex-col items-center justify-center gap-2 py-4",children:(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:"No tasks defined yet"})}):(0,t.jsxs)("div",{"data-testid":"task-progress-view",className:"flex flex-col gap-3",children:[(0,t.jsx)(ai,{tasks:e}),(0,t.jsx)("div",{"data-testid":"task-progress-list",className:"flex flex-col gap-2",children:e.map((e,n)=>(0,t.jsx)(ao,{task:e,index:n},e.title||`task-${n}`))})]})}function ai({tasks:e}){let r=(0,n.useMemo)(()=>{let t=e.filter(e=>"Done"===e.state).length,n=e.filter(e=>"Work in Progress"===e.state).length,r=e.filter(e=>"Review"===e.state).length,l=e.filter(e=>"Done"!==e.state&&"Work in Progress"!==e.state&&"Review"!==e.state).length,a=e.length,i=a>0?Math.round(t/a*100):0;return{done:t,wip:n,review:r,todo:l,total:a,percent:i}},[e]);return(0,t.jsxs)("div",{"data-testid":"task-progress-summary",className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Task Progress"}),(0,t.jsxs)("span",{className:"text-muted-foreground text-xs",children:[r.done," of ",r.total," done"]})]}),(0,t.jsx)("div",{className:"bg-muted h-2 w-full overflow-hidden rounded-full",children:(0,t.jsx)("div",{"data-testid":"task-progress-bar",className:"h-full rounded-full bg-emerald-500 transition-all",style:{width:`${r.percent}%`}})}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-3",children:[r.done>0?(0,t.jsx)(as,{icon:u.Check,label:"Done",count:r.done,className:"text-emerald-600"}):null,r.wip>0?(0,t.jsx)(as,{icon:a.Loader2,label:"In Progress",count:r.wip,className:"text-blue-600"}):null,r.review>0?(0,t.jsx)(as,{icon:at.Eye,label:"Review",count:r.review,className:"text-amber-600"}):null,r.todo>0?(0,t.jsx)(as,{icon:ae.Circle,label:"Todo",count:r.todo,className:"text-muted-foreground"}):null]})]})}function as({icon:e,label:n,count:r,className:l}){return(0,t.jsxs)("span",{className:(0,V.cn)("flex items-center gap-1 text-xs",l),children:[(0,t.jsx)(e,{className:"h-3 w-3"}),r," ",n]})}function ao({task:e,index:r}){let[l,a]=(0,n.useState)(!1),i=ar[e.state]??al,s=i.icon,o=e.actionItems.length>0,c=(0,n.useCallback)(()=>{o&&a(e=>!e)},[o]);return(0,t.jsxs)("div",{"data-testid":`task-card-${r}`,className:(0,V.cn)("rounded-lg border",i.borderClass),children:[(0,t.jsxs)("button",{type:"button",onClick:c,disabled:!o,className:(0,V.cn)("flex w-full items-start gap-2 px-3 py-2.5 text-left",o&&"hover:bg-muted/50 cursor-pointer transition-colors"),children:[(0,t.jsx)(s,{className:(0,V.cn)("mt-0.5 h-4 w-4 shrink-0",i.colorClass,i.spinning&&"animate-spin")}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,t.jsx)("span",{className:(0,V.cn)("text-sm font-medium",i.colorClass),children:e.title}),e.description?(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:e.description}):null]}),o?(0,t.jsx)(H.ChevronRight,{className:(0,V.cn)("text-muted-foreground mt-0.5 h-4 w-4 shrink-0 transition-transform",l&&"rotate-90")}):null]}),l&&o?(0,t.jsx)("div",{className:"border-t px-3 py-2.5",children:(0,t.jsx)("div",{className:"flex flex-col gap-2",children:e.actionItems.map((e,n)=>(0,t.jsx)(ac,{item:e},e.name||`ai-${n}`))})}):null]})}function ac({item:e}){let n=e.acceptanceCriteria.length,r=e.acceptanceCriteria.filter(e=>e.verified).length,l=n>0&&r===n;return(0,t.jsxs)("div",{"data-testid":"action-item",className:"flex flex-col gap-1.5",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[l?(0,t.jsx)(rI.CheckCircle2,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-emerald-600"}):(0,t.jsx)(an,{className:"text-muted-foreground mt-0.5 h-3.5 w-3.5 shrink-0"}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:e.name}),e.description?(0,t.jsx)("span",{className:"text-muted-foreground text-[11px]",children:e.description}):null]}),n>0?(0,t.jsxs)("span",{className:"text-muted-foreground ml-auto shrink-0 text-[11px]",children:[r,"/",n]}):null]}),n>0?(0,t.jsx)("div",{className:"ml-5.5 flex flex-col gap-1",children:e.acceptanceCriteria.map((e,n)=>(0,t.jsx)(au,{criterion:e},e.description||`ac-${n}`))}):null]})}function au({criterion:e}){return(0,t.jsxs)("div",{"data-testid":"acceptance-criterion",className:"flex items-start gap-1.5",children:[e.verified?(0,t.jsx)(u.Check,{className:"mt-0.5 h-3 w-3 shrink-0 text-emerald-600"}):(0,t.jsx)(ae.Circle,{className:"text-muted-foreground mt-0.5 h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:(0,V.cn)("text-[11px]",e.verified?"text-muted-foreground line-through":"text-foreground"),children:e.description})]})}let ad={Requirements:"border-transparent bg-blue-50 text-blue-700 hover:bg-blue-50",ClarificationRequired:"border-transparent bg-amber-50 text-amber-700 hover:bg-amber-50",Ready:"border-transparent bg-green-50 text-green-700 hover:bg-green-50"};function ap({plan:e,loading:n,error:r}){return n?(0,t.jsx)("div",{"data-testid":"plan-tab-loading",className:"flex items-center justify-center p-8",children:(0,t.jsx)(a.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})}):r?(0,t.jsxs)("div",{className:"flex items-center gap-2 p-4 text-sm text-red-600",children:[(0,t.jsx)(B.AlertCircle,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:r})]}):e?(0,t.jsxs)("div",{className:"flex flex-col gap-4 p-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Plan State"}),(0,t.jsx)(W.Badge,{className:ad[e.state]??"border-transparent bg-gray-50 text-gray-700",children:e.state})]}),e.overview?(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Overview"}),(0,t.jsx)("p",{className:"text-sm leading-relaxed",children:e.overview})]}):null,(0,t.jsx)(aa,{tasks:e.tasks})]}):(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 p-8",children:[(0,t.jsx)(l7,{className:"text-muted-foreground h-8 w-8"}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:"No plan created yet"})]})}function af(){return{data:null,loading:!1,error:null}}let ah=[{key:"overview",label:"Overview"},{key:"activity",label:"Activity"},{key:"log",label:"Log"},{key:"plan",label:"Plan"},{key:"prd-review",label:"PRD Review"},{key:"tech-decisions",label:"Tech Decisions"},{key:"product-decisions",label:"Product"},{key:"merge-review",label:"Merge Review"}],am={activity:async function(e){let t=await _(e);if("error"in t)throw Error(t.error);return{timings:t.timings,rejectionFeedback:t.rejectionFeedback}},plan:async function(e){let t=await U(e);if("error"in t)throw Error(t.error);return t.plan}};function ax({featureNode:e,featureId:l,initialTab:i,urlTab:s,prdData:o,prdSelections:c,onPrdSelect:u,onPrdApprove:d,onPrdReject:p,isPrdLoading:f,techData:h,onTechApprove:m,onTechReject:x,isTechLoading:g,productData:y,mergeData:v,onMergeApprove:b,onMergeReject:k,isMergeLoading:j,syncStatus:w,syncLoading:N,syncError:S,onRefreshSync:C,onRebaseOnMain:T,rebaseLoading:E,rebaseError:M,isRejecting:I,chatInput:A,onChatInputChange:P,sseEvents:R}){let D=(0,r.usePathname)(),L=(0,n.useMemo)(()=>{let t;return t=["overview","activity"],e.hasAgentRun&&t.push("log"),e.hasPlan&&t.push("plan"),"requirements"===e.lifecycle&&"action-required"===e.state&&t.push("prd-review"),"implementation"===e.lifecycle&&"action-required"===e.state&&t.push("tech-decisions","product-decisions"),"review"===e.lifecycle&&("action-required"===e.state||"error"===e.state)&&t.push("merge-review"),"maintain"===e.lifecycle&&e.pr&&t.push("merge-review"),t},[e]),z=(0,n.useMemo)(()=>ah.filter(e=>L.includes(e.key)).map(t=>"merge-review"===t.key&&"maintain"===e.lifecycle?{...t,label:"Merge History"}:t),[L,e.lifecycle]),F=(0,n.useMemo)(()=>{let e=D.match(/^(\/feature\/[^/]+)/);return e?e[1]:D},[D]),O=(0,n.useMemo)(()=>s&&L.includes(s)?s:i&&L.includes(i)?i:"overview",[]),[_,U]=(0,n.useState)(O),q=function(e){let[t,r]=(0,n.useState)(""),[l,a]=(0,n.useState)(!1),[i,s]=(0,n.useState)(null),o=(0,n.useRef)(null),c=(0,n.useCallback)(()=>{o.current&&(o.current.close(),o.current=null),a(!1)},[]);return(0,n.useEffect)(()=>{if(!e){r(""),a(!1),s(null);return}r(""),s(null);let t=new EventSource(`/api/feature-logs?featureId=${e}`);return o.current=t,t.onopen=()=>{a(!0)},t.addEventListener("initial",e=>{r(JSON.parse(e.data).content)}),t.addEventListener("log",e=>{let t=JSON.parse(e.data);r(e=>e+t.content)}),t.addEventListener("error",e=>{try{let t=JSON.parse(e.data);s(t.error)}catch{s(e.data?String(e.data):"Log stream unavailable")}}),t.onerror=()=>{a(!1)},()=>{t.close(),o.current=null}},[e,c]),{content:t,isConnected:l,error:i}}("log"===_?l:null),{tabs:H,fetchTab:V,refreshTab:W}=function(e,t){let r=Object.keys(t),[l,a]=(0,n.useState)(()=>{let e={};for(let t of r)e[t]=af();return e}),i=(0,n.useRef)(t);i.current=t;let s=(0,n.useRef)(e);s.current=e;let o=(0,n.useRef)(!0);(0,n.useEffect)(()=>(o.current=!0,()=>{o.current=!1}),[]);let c=(0,n.useRef)(e);(0,n.useEffect)(()=>{c.current!==e&&(c.current=e,a(e=>{let t={};for(let n of Object.keys(e))t[n]=af();return t}))},[e]);let u=(0,n.useCallback)(async e=>{let t=i.current[e],n=s.current;if(t){o.current&&a(t=>t[e]?.data!==null?t:{...t,[e]:{...t[e],loading:!0,error:null}});try{let r=await t(n);o.current&&a(t=>({...t,[e]:{data:r,loading:!1,error:null}}))}catch(t){o.current&&a(n=>{let r=t instanceof Error?t.message:"Failed to fetch tab data",l=n[e]?.data??null;return{...n,[e]:{data:l,loading:!1,error:l?null:r}}})}}},[]),d=(0,n.useCallback)(async e=>{let t=l[e];t&&null!==t.data||t&&t.loading||await u(e)},[l,u]);return{tabs:l,fetchTab:d,refreshTab:(0,n.useCallback)(async e=>{await u(e)},[u])}}(l,am),K=(0,n.useRef)(!1);(0,n.useEffect)(()=>{if(!K.current)return;K.current=!1;let e="overview"===_?F:`${F}/${_}`;e!==D&&window.history.pushState(null,"",e)},[_,F,D]);let Q=(0,n.useRef)(D);(0,n.useEffect)(()=>{if(Q.current===D||(Q.current=D,K.current))return;let e=D.split("/"),t=e.length>=4?e[3]:void 0,n=t&&L.includes(t)?t:"overview";n!==_&&(U(n),("activity"===n||"plan"===n)&&V(n))},[D]);let G=(0,n.useRef)(!1);(0,n.useEffect)(()=>{if(!G.current&&(G.current=!0,!s&&"overview"!==O)){let e=`${F}/${O}`;e!==D&&window.history.replaceState(null,"",e)}},[]);let J=(0,n.useRef)(!1);(0,n.useEffect)(()=>{J.current||(J.current=!0,("activity"===_||"plan"===_)&&V(_))},[_,V]);let X=(0,n.useRef)(l);(0,n.useEffect)(()=>{X.current!==l&&(X.current=l,U("overview"))},[l]);let Z=(0,n.useRef)(i);(0,n.useEffect)(()=>{if(Z.current!==i&&i&&L.includes(i)){Z.current=i,U(i),("activity"===i||"plan"===i)&&V(i);let e="overview"===i?F:`${F}/${i}`;e!==window.location.pathname&&window.history.replaceState(null,"",e)}},[i,L,F,V]),(0,n.useEffect)(()=>{L.includes(_)||(U("overview"),window.location.pathname!==F&&window.history.replaceState(null,"",F))},[L,_,F]);let Y=(0,n.useRef)(_);Y.current=_;let ee=(0,n.useRef)(0);(0,n.useEffect)(()=>{if(!R||0===R.length||(ee.current>R.length&&(ee.current=0),R.length<=ee.current))return;let e=R.slice(ee.current);if(ee.current=R.length,!e.some(e=>e.featureId===l))return;W("activity");let t=Y.current;"plan"===t&&W(t)},[R,l,W]);let et="running"===e.state||"creating"===e.state;(0,n.useEffect)(()=>{if(!et)return;let e=setInterval(()=>{W("activity")},5e3);return()=>clearInterval(e)},[et,W]);let er=(0,n.useCallback)(e=>{K.current=!0,U(e),("activity"===e||"plan"===e)&&V(e)},[V]);return(0,t.jsx)("div",{className:"flex min-h-0 flex-1 flex-col",children:(0,t.jsxs)($.Tabs,{value:_,onValueChange:er,className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsx)("div",{className:"shrink-0 overflow-x-auto px-4 pt-4",children:(0,t.jsx)($.TabsList,{className:"flex w-full",children:z.map(e=>(0,t.jsx)($.TabsTrigger,{value:e.key,className:"flex-1",children:e.label},e.key))})}),(0,t.jsx)($.TabsContent,{value:"overview",className:"mt-0 flex-1 overflow-y-auto",children:(0,t.jsx)(ld,{data:e,syncStatus:w,syncLoading:N,syncError:S,onRefreshSync:C,onRebaseOnMain:T,rebaseLoading:E,rebaseError:M})}),(0,t.jsx)($.TabsContent,{value:"activity",className:"mt-0 flex-1 overflow-y-auto",children:(0,t.jsx)(lL,{timings:H.activity.data?.timings??null,loading:H.activity.loading,error:H.activity.error,rejectionFeedback:H.activity.data?.rejectionFeedback})}),(0,t.jsx)($.TabsContent,{value:"log",className:"mt-0 flex-1 overflow-hidden",children:(0,t.jsx)(l8,{content:q.content,isConnected:q.isConnected,error:q.error})}),(0,t.jsx)($.TabsContent,{value:"plan",className:"mt-0 flex-1 overflow-y-auto",children:(0,t.jsx)(ap,{plan:H.plan.data,loading:H.plan.loading,error:H.plan.error})}),L.includes("prd-review")?(0,t.jsx)($.TabsContent,{value:"prd-review",className:"mt-0 flex min-h-0 flex-1 flex-col",children:o?(0,t.jsx)(en,{data:o,selections:c??{},onSelect:u??(()=>void 0),onApprove:d??(()=>void 0),onReject:p,isProcessing:f,isRejecting:I,chatInput:A,onChatInputChange:P}):(0,t.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,t.jsx)(a.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})})}):null,L.includes("tech-decisions")?(0,t.jsx)($.TabsContent,{value:"tech-decisions",className:"mt-0 flex min-h-0 flex-1 flex-col",children:h?(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,t.jsx)(ry,{data:h})}),(0,t.jsx)(ag,{onApprove:m??(()=>void 0),onReject:x,isProcessing:g,isRejecting:I,chatInput:A,onChatInputChange:P})]}):(0,t.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,t.jsx)(a.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})})}):null,L.includes("product-decisions")?(0,t.jsx)($.TabsContent,{value:"product-decisions",className:"mt-0 flex-1 overflow-y-auto",children:null===y?(0,t.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,t.jsx)(a.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})}):y?(0,t.jsx)(rk,{data:y}):(0,t.jsx)("p",{className:"text-muted-foreground p-4 text-center text-sm",children:"No product decisions available."})}):null,L.includes("merge-review")?(0,t.jsx)($.TabsContent,{value:"merge-review",className:"mt-0 flex min-h-0 flex-1 flex-col",children:v?(0,t.jsx)(rQ,{data:v,readOnly:"maintain"===e.lifecycle,onApprove:b??(()=>void 0),onReject:k,isProcessing:j,isRejecting:I,chatInput:A,onChatInputChange:P}):(0,t.jsx)("div",{className:"flex items-center justify-center p-8",children:j?(0,t.jsx)(a.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"}):(0,t.jsxs)("div",{className:"text-muted-foreground flex flex-col items-center gap-2 text-sm",children:[(0,t.jsx)(B.AlertCircle,{className:"h-6 w-6"}),(0,t.jsx)("span",{children:"Merge review data unavailable"})]})})}):null]})})}function ag({onApprove:e,onReject:n,isProcessing:r,isRejecting:l,chatInput:a,onChatInputChange:i}){return(0,t.jsx)(et,{onReject:n,onApprove:e,approveLabel:"Approve Plan",revisionPlaceholder:"Ask AI to revise the plan...",isProcessing:r,isRejecting:l,chatInput:a,onChatInputChange:i})}var ay=e.i(66626),av=e.i(10950),ab=e.i(92994);let ak=(0,f.createServerReference)("401eb6eec79639ca87e09f70a54da922d62a02393c",f.callServer,void 0,f.findSourceMapURL,"rebaseFeature");var aj=e.i(99045);function aw(e){return"requirements"===e.lifecycle&&"action-required"===e.state?"prd-review":"implementation"===e.lifecycle&&"action-required"===e.state?"tech-decisions":"review"===e.lifecycle&&("action-required"===e.state||"error"===e.state)?"merge-review":"overview"}function aN(e,t,r,a,i,s){let[o,c]=(0,n.useState)(!1),u=(0,n.useRef)(r),d=(0,n.useRef)(a);return u.current=r,d.current=a,(0,n.useEffect)(()=>{if(d.current(),!e)return;let n=!1;return c(!0),t(e).then(e=>{n||u.current(e)}).catch(()=>{!n&&i&&l.toast.error(i)}).finally(()=>{n||c(!1)}),()=>{n=!0}},[e,t,i,s]),o}let aS=(0,f.createServerReference)("406f2ddd625eef5a26bfbb946a853856cd89cb5949",f.callServer,void 0,f.findSourceMapURL,"getFeatureDrawerData"),aC=(0,f.createServerReference)("4093d1dfcee1531976f437916a383a58ff94cead9c",f.callServer,void 0,f.findSourceMapURL,"getBranchSyncStatus"),aT=new Map;function aE({view:e,urlTab:f}){var R;let D,L,z,F,B,$=(0,k.useFeatureFlags)(),_=(0,r.useRouter)(),U=(0,j.useSoundAction)("reject"),[q,H]=(0,n.useState)(e);(0,n.useEffect)(()=>{H(e)},[e]);let V="feature"===q.type?q.node:null,{events:W}=(0,S.useAgentEventsContext)(),K=(0,n.useRef)(0);(0,n.useEffect)(()=>{if(K.current>W.length&&(K.current=0),!V||W.length<=K.current)return;let e=W.slice(K.current);for(let t of(K.current=W.length,(0,aj.resolveSseEventUpdates)(e)))t.featureId===V.featureId&&"deleting"!==V.state&&(void 0!==t.state||void 0!==t.lifecycle)&&H(e=>{if("feature"!==e.type)return e;let n={...e.node,...void 0!==t.state&&{state:t.state},...void 0!==t.lifecycle&&{lifecycle:t.lifecycle}};return{...e,node:n,initialTab:aw(n)}})},[W,V]);let Q=(0,r.usePathname)().startsWith("/feature/");R=V?.featureId??null,D=(0,n.useRef)(Q),L=(0,n.useRef)(!1),z=(0,n.useCallback)(async()=>{if(R&&!L.current){L.current=!0;try{let e=await aS(R);if(!e)return;H(t=>(function(e,t){if("feature"!==e.type)return e;let n={...e.node,...t},r=n.state!==e.node.state||n.lifecycle!==e.node.lifecycle;return{...e,node:n,initialTab:r?aw(n):e.initialTab}})(t,e))}catch{}finally{L.current=!1}}},[R,H]),F=(0,n.useRef)(!1),(0,n.useEffect)(()=>{!Q||D.current&&F.current||(F.current=!0,z()),D.current=Q},[Q,z]),(0,n.useEffect)(()=>{if(!Q||!R)return;let e=setInterval(()=>{z()},15e3);return()=>clearInterval(e)},[Q,R,z]);let G=(0,n.useCallback)(()=>{_.push("/")},[_]),[J,X]=(0,n.useState)(""),[Z,Y]=(0,n.useState)(null),[ee,et]=(0,n.useState)({}),[en,er]=(0,n.useState)({}),[el,ea]=(0,n.useState)(null),[ei,es]=(0,n.useState)(void 0),[eo,ec]=(0,n.useState)(null),[eu,ed]=(0,n.useState)(!1),[ep,ef]=(0,n.useState)(!1),[eh,em]=(0,n.useState)(!1),ex=(0,n.useRef)(!1),eg="feature"===q.type?q.initialTab:void 0;(0,n.useEffect)(()=>{X("")},[eg]);let ey=(0,n.useRef)(0),ev=(0,n.useRef)(V?.state),eb=(0,n.useRef)(V?.lifecycle);(V?.state!==ev.current||V?.lifecycle!==eb.current)&&(ev.current=V?.state,eb.current=V?.lifecycle,ey.current+=1);let ek=ey.current,ej=aN(V?.lifecycle==="requirements"&&V?.state==="action-required"?V.featureId:null,y,e=>{if(e.error)return void l.toast.error(e.error);if(e.questionnaire){Y(e.questionnaire);let t={};for(let n of e.questionnaire.questions){let e=n.options.find(e=>e.recommended);e&&(t[n.id]=e.id)}et(t),er(t)}},()=>{et({}),er({}),Y(null)},"Failed to load questionnaire",ek),ew=V?.lifecycle==="implementation"&&V?.state==="action-required"?V.featureId:null,eN=aN(ew,v,e=>{e.error?l.toast.error(e.error):e.techDecisions&&ea(e.techDecisions)},()=>ea(null),"Failed to load tech decisions",ek),eS=aN(ew,y,e=>{e.productDecisions&&es(e.productDecisions)},()=>es(void 0),void 0,ek),eC=aN(V?.lifecycle==="review"&&(V?.state==="action-required"||V?.state==="error")||V?.lifecycle==="maintain"&&V?.pr?V.featureId:null,b,e=>{"error"in e?l.toast.error(e.error):ec(e)},()=>ec(null),"Failed to load merge review data",ek),eT=J.trim().length>0,eE=V?.lifecycle==="requirements"&&V?.state==="action-required"&&Object.keys(en).some(e=>en[e]!==ee[e]),eM=(0,n.useCallback)(()=>{X(""),et({...en})},[en]),{attemptClose:eI}=(0,w.useGuardedDrawerClose)({open:Q,isDirty:eT||eE,onClose:G,onReset:eM}),eA=(0,n.useCallback)(async(e,t,n=[],r)=>{if(V?.featureId){ex.current=!0,em(!0);try{let a=n.map(e=>e.path).filter(Boolean),i=n.filter(e=>e.notes?.trim()),s=i.length>0?`${e}
3
3
 
4
4
  Image notes:
5
5
  ${i.map(e=>`- @${e.path}: ${e.notes.trim()}`).join("\n")}`:e,o=await g(V.featureId,s,a);if(!o.rejected)return void l.toast.error(o.error??`Failed to reject ${t.toLowerCase()}`);U.play(),X(""),l.toast.success(`${t} rejected — agent re-iterating (iteration ${o.iteration})`),o.iterationWarning&&l.toast.warning(`Iteration ${o.iteration} — consider approving or adjusting feedback to avoid excessive iterations`),window.dispatchEvent(new CustomEvent("shep:feature-approved",{detail:{featureId:V.featureId}})),G(),r?.()}finally{ex.current=!1,em(!1)}}},[V,G,U]),eP=(0,n.useCallback)((e,t)=>eA(e,"Requirements",t,()=>et({})),[eA]),eR=(0,n.useCallback)((e,t)=>eA(e,"Plan",t),[eA]),eD=(0,n.useCallback)((e,t)=>eA(e,"Merge",t),[eA]),eL=(0,n.useCallback)(async e=>{if(!V?.featureId)return;let t=await h(V.featureId);t.approved?(X(""),l.toast.success(`${e} approved — agent resuming`),window.dispatchEvent(new CustomEvent("shep:feature-approved",{detail:{featureId:V.featureId}})),G()):l.toast.error(t.error??`Failed to approve ${e.toLowerCase()}`)},[V,G]),ez=(0,n.useCallback)(async e=>{let t;if("feature"!==q.type||!V)return;if(Z){let e=[];for(let[t,n]of Object.entries(ee)){let r=Z.questions.find(e=>e.id===t),l=r?.options.find(e=>e.id===n);r&&l&&e.push({questionId:r.question,selectedOption:l.label})}t={approved:!0,changedSelections:e}}let n=await h(V.featureId,t);n.approved?(X(""),l.toast.success("Requirements approved — agent resuming"),window.dispatchEvent(new CustomEvent("shep:feature-approved",{detail:{featureId:V.featureId}})),et({}),G()):l.toast.error(n.error??"Failed to approve requirements")},[q,V,Z,ee,G]),eF=(0,n.useCallback)(()=>eL("Plan"),[eL]),eO=(0,n.useCallback)(()=>eL("Merge"),[eL]),eB=(0,n.useCallback)(async(e,t,n,r)=>{ed(!0),ef(!1),window.dispatchEvent(new CustomEvent("shep:feature-delete-requested",{detail:{featureId:e,cleanup:t,cascadeDelete:n,closePr:r}})),_.push("/")},[_]),e$=(0,n.useCallback)(async e=>{let t=await (0,m.resumeFeature)(e);t.error?l.toast.error(t.error):(l.toast.success("Feature resumed — agent restarting"),window.dispatchEvent(new CustomEvent("shep:feature-approved",{detail:{featureId:e}})),H(e=>"feature"!==e.type?e:{...e,node:{...e.node,state:"running"}}))},[]),e_=(0,n.useCallback)(async e=>{let t=await (0,x.startFeature)(e);t.error?l.toast.error(t.error):(l.toast.success("Feature started"),H(e=>"feature"!==e.type?e:{...e,node:{...e.node,state:"running"}}))},[]),eU=V?.repositoryPath&&V?.branch?{featureId:V.featureId,repositoryPath:V.repositoryPath,branch:V.branch,worktreePath:V.worktreePath,specPath:V.specPath}:null,eq=function(e){let[t,r]=(0,n.useState)(!1),[l,a]=(0,n.useState)(!1),[i,s]=(0,n.useState)(!1),[o,c]=(0,n.useState)(!1),[u,d]=(0,n.useState)(null),[p,f]=(0,n.useState)(null),[h,m]=(0,n.useState)(null),[x,g]=(0,n.useState)(null),y=(0,n.useRef)(null),v=(0,n.useRef)(null),b=(0,n.useRef)(null),k=(0,n.useRef)(null);(0,n.useEffect)(()=>{let e=[y,v,b,k];return()=>{for(let t of e)t.current&&clearTimeout(t.current)}},[]);let j=(0,n.useCallback)(async(t,n,r,l,a)=>{if(e&&!a){l.current&&clearTimeout(l.current),n(!0),r(null);try{let n=await t({repositoryPath:e.repositoryPath,branch:e.branch});if(!n.success){let e=n.error??"An unexpected error occurred";r(e),l.current=setTimeout(()=>r(null),5e3)}}catch(e){r(e instanceof Error?e.message:"An unexpected error occurred"),l.current=setTimeout(()=>r(null),5e3)}finally{n(!1)}}},[e]);return{openInIde:(0,n.useCallback)(()=>j(ay.openIde,r,d,y,t),[j,t]),openInShell:(0,n.useCallback)(()=>j(av.openShell,a,f,v,l),[j,l]),openSpecsFolder:(0,n.useCallback)(async()=>{if(e?.specPath&&!i){b.current&&clearTimeout(b.current),s(!0),m(null);try{let t=await (0,ab.openFolder)(e.specPath);if(!t.success){let e=t.error??"An unexpected error occurred";m(e),b.current=setTimeout(()=>m(null),5e3)}}catch(e){m(e instanceof Error?e.message:"An unexpected error occurred"),b.current=setTimeout(()=>m(null),5e3)}finally{s(!1)}}},[e,i]),rebaseOnMain:(0,n.useCallback)(async()=>{if(e?.featureId&&!o){k.current&&clearTimeout(k.current),c(!0),g(null);try{let t=await ak(e.featureId);if(!t.success){let e=t.error??"An unexpected error occurred";g(e),k.current=setTimeout(()=>g(null),5e3)}}catch(e){g(e instanceof Error?e.message:"An unexpected error occurred"),k.current=setTimeout(()=>g(null),5e3)}finally{c(!1)}}},[e,o]),ideLoading:t,shellLoading:l,specsLoading:i,rebaseLoading:o,ideError:u,shellError:p,specsError:h,rebaseError:x}}(eU),{data:eH,loading:eV,error:eW,refresh:eK}=function(e){let[t,r]=(0,n.useState)(()=>{if(!e)return null;let t=aT.get(e);return t?t.data:null}),[l,a]=(0,n.useState)(!1),[i,s]=(0,n.useState)(null),o=(0,n.useRef)(e);o.current=e;let c=(0,n.useCallback)(async e=>{a(!0),s(null);try{let t=await aC(e);if(o.current!==e)return;if(t.success&&t.data){let n=t.data;aT.set(e,{data:n,timestamp:Date.now()}),r(n)}else s(t.error??"Failed to check sync status")}catch{if(o.current!==e)return;s("Failed to check sync status")}finally{o.current===e&&a(!1)}},[]);return(0,n.useEffect)(()=>{if(!e){r(null),s(null);return}let t=aT.get(e);t&&(r(t.data),Date.now()-t.timestamp<3e4)||c(e)},[e,c]),{data:t,loading:l,error:i,refresh:(0,n.useCallback)(()=>{e&&c(e)},[e,c])}}($.gitRebaseSync&&V?.branch?V.featureId:null),eQ=(0,n.useRef)(eq.rebaseLoading);(0,n.useEffect)(()=>{!eQ.current||eq.rebaseLoading||eq.rebaseError||eK(),eQ.current=eq.rebaseLoading},[eq.rebaseLoading,eq.rebaseError,eK]);let eG=V?.repositoryPath&&V.branch?{targetId:V.featureId,targetType:"feature",repositoryPath:V.repositoryPath,branch:V.branch}:null,eJ=(0,N.useDeployAction)(eG),eX="Booting"===eJ.status||"Ready"===eJ.status,[eZ,eY]=(0,n.useState)(!1),e0=(0,n.useCallback)(()=>{V?.featureId&&(navigator.clipboard.writeText(V.featureId),eY(!0),setTimeout(()=>eY(!1),2e3))},[V?.featureId]);if(V){let e=V.featureId.slice(0,8),n=V.repositoryName??V.repositoryPath.split("/").filter(Boolean).at(-1)??"";B=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{"data-testid":"feature-drawer-header",children:[(0,t.jsx)(E.DrawerTitle,{children:V.name}),n?(0,t.jsxs)("div",{className:"flex items-center gap-1.5 pt-0.5",children:[(0,t.jsx)(d.Code2,{className:"text-muted-foreground size-3.5 shrink-0"}),V.remoteUrl?(0,t.jsxs)("a",{href:V.remoteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-xs transition-colors","data-testid":"feature-drawer-repo-link",children:[n,(0,t.jsx)(p.ExternalLink,{className:"size-3"})]}):(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:n})]}):null,(0,t.jsx)(E.DrawerDescription,{className:"sr-only",children:V.name})]}),eU?(0,t.jsxs)("div",{className:"flex items-center gap-2 pt-2","data-testid":"feature-drawer-actions",children:[(0,t.jsx)(O,{actions:eq,repositoryPath:eU.repositoryPath,worktreePath:eU.worktreePath,showSpecs:!!eU.specPath}),$.envDeploy&&eG?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(I.TooltipProvider,{children:(0,t.jsxs)(I.Tooltip,{children:[(0,t.jsx)(I.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{children:(0,t.jsx)(P.ActionButton,{label:eX?"Stop Dev Server":"Start Dev Server",onClick:eX?eJ.stop:eJ.deploy,loading:eJ.deployLoading||eJ.stopLoading,error:!!eJ.deployError,icon:eX?o.Square:s.Play,iconOnly:!0,variant:"outline",size:"icon-sm"})})}),(0,t.jsx)(I.TooltipContent,{children:eX?"Stop Dev Server":"Start Dev Server"})]})}),eX?(0,t.jsx)(T.DeploymentStatusBadge,{status:eJ.status,url:eJ.url,targetId:eG?.targetId}):null]}):null,(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-1.5",children:[(0,t.jsx)("code",{className:"bg-muted text-muted-foreground rounded px-1.5 py-0.5 font-mono text-xs",children:e}),(0,t.jsx)("button",{type:"button",onClick:e0,className:"text-muted-foreground hover:text-foreground inline-flex items-center rounded p-0.5 transition-colors","aria-label":"Copy feature ID","data-testid":"feature-drawer-copy-id",children:eZ?(0,t.jsx)(u.Check,{className:"size-3.5 text-green-600"}):(0,t.jsx)(c.Copy,{className:"size-3.5"})})]}),V.featureId?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M.Button,{variant:"ghost",size:"icon-sm","aria-label":"Delete feature",disabled:eu,className:"text-muted-foreground hover:text-destructive","data-testid":"feature-drawer-delete",onClick:()=>ef(!0),children:eu?(0,t.jsx)(a.Loader2,{className:"size-4 animate-spin"}):(0,t.jsx)(i.Trash2,{className:"size-4"})}),(0,t.jsx)(A.DeleteFeatureDialog,{open:ep,onOpenChange:ef,onConfirm:(e,t,n)=>eB(V.featureId,e,t,n),isDeleting:eu,featureName:V.name,featureId:V.featureId,hasChildren:V.hasChildren,hasOpenPr:!!V.pr&&"Open"===V.pr.status})]}):null]}):null]})}let e1=null;if("feature"===q.type&&V){let e={...V,..."error"===V.state&&{onRetry:e$},..."pending"===V.state&&{onStart:e_}};e1=(0,t.jsx)(ax,{featureNode:e,featureId:V.featureId,initialTab:q.initialTab,urlTab:f,sseEvents:W,prdData:Z,prdSelections:ee,onPrdSelect:(e,t)=>et(n=>({...n,[e]:t})),onPrdApprove:ez,onPrdReject:eP,isPrdLoading:ej,techData:el,onTechApprove:eF,onTechReject:eR,isTechLoading:eN,productData:eS?null:ei,mergeData:eo,onMergeApprove:eO,onMergeReject:eD,isMergeLoading:eC,syncStatus:$.gitRebaseSync?eH:void 0,syncLoading:eV,syncError:eW,onRefreshSync:$.gitRebaseSync?eK:void 0,onRebaseOnMain:$.gitRebaseSync?eq.rebaseOnMain:void 0,rebaseLoading:eq.rebaseLoading,rebaseError:eq.rebaseError,isRejecting:eh,chatInput:J,onChatInputChange:X})}return(0,t.jsx)(C.BaseDrawer,{open:Q,onClose:eI,size:"md",modal:!1,header:B,"data-testid":"feature"===q.type?"feature-drawer":"repository-drawer",children:e1})}e.s(["FeatureDrawerClient",()=>aE],36986)}]);