@surething/cockpit 1.0.186 → 1.0.188

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 (180) hide show
  1. package/.next-prod/BUILD_ID +1 -1
  2. package/.next-prod/app-path-routes-manifest.json +26 -26
  3. package/.next-prod/build-manifest.json +2 -2
  4. package/.next-prod/prerender-manifest.json +3 -3
  5. package/.next-prod/server/app/_global-error/page_client-reference-manifest.js +1 -1
  6. package/.next-prod/server/app/_global-error.html +2 -2
  7. package/.next-prod/server/app/_global-error.rsc +1 -1
  8. package/.next-prod/server/app/_global-error.segments/_full.segment.rsc +1 -1
  9. package/.next-prod/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  10. package/.next-prod/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  11. package/.next-prod/server/app/_global-error.segments/_head.segment.rsc +1 -1
  12. package/.next-prod/server/app/_global-error.segments/_index.segment.rsc +1 -1
  13. package/.next-prod/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  14. package/.next-prod/server/app/_not-found/page_client-reference-manifest.js +1 -1
  15. package/.next-prod/server/app/_not-found.html +2 -2
  16. package/.next-prod/server/app/_not-found.rsc +2 -2
  17. package/.next-prod/server/app/_not-found.segments/_full.segment.rsc +2 -2
  18. package/.next-prod/server/app/_not-found.segments/_head.segment.rsc +1 -1
  19. package/.next-prod/server/app/_not-found.segments/_index.segment.rsc +2 -2
  20. package/.next-prod/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  21. package/.next-prod/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  22. package/.next-prod/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  23. package/.next-prod/server/app/api/bash/route_client-reference-manifest.js +1 -1
  24. package/.next-prod/server/app/api/chat/codex/route_client-reference-manifest.js +1 -1
  25. package/.next-prod/server/app/api/chat/kimi/route_client-reference-manifest.js +1 -1
  26. package/.next-prod/server/app/api/chat/ollama/route_client-reference-manifest.js +1 -1
  27. package/.next-prod/server/app/api/chat/route.js +3 -3
  28. package/.next-prod/server/app/api/chat/route_client-reference-manifest.js +1 -1
  29. package/.next-prod/server/app/api/claude-stats/route.js +1 -1
  30. package/.next-prod/server/app/api/claude-stats/route_client-reference-manifest.js +1 -1
  31. package/.next-prod/server/app/api/commands/route.js +1 -1
  32. package/.next-prod/server/app/api/commands/route_client-reference-manifest.js +1 -1
  33. package/.next-prod/server/app/api/comments/route.js +1 -1
  34. package/.next-prod/server/app/api/comments/route_client-reference-manifest.js +1 -1
  35. package/.next-prod/server/app/api/db/columns/route_client-reference-manifest.js +1 -1
  36. package/.next-prod/server/app/api/db/connect/route_client-reference-manifest.js +1 -1
  37. package/.next-prod/server/app/api/db/disconnect/route_client-reference-manifest.js +1 -1
  38. package/.next-prod/server/app/api/db/export/route_client-reference-manifest.js +1 -1
  39. package/.next-prod/server/app/api/db/query/route_client-reference-manifest.js +1 -1
  40. package/.next-prod/server/app/api/db/schemas/route_client-reference-manifest.js +1 -1
  41. package/.next-prod/server/app/api/extension/version/route_client-reference-manifest.js +1 -1
  42. package/.next-prod/server/app/api/file/route_client-reference-manifest.js +1 -1
  43. package/.next-prod/server/app/api/files/blame/route_client-reference-manifest.js +1 -1
  44. package/.next-prod/server/app/api/files/clipboard/route_client-reference-manifest.js +1 -1
  45. package/.next-prod/server/app/api/files/copy/route_client-reference-manifest.js +1 -1
  46. package/.next-prod/server/app/api/files/delete/route_client-reference-manifest.js +1 -1
  47. package/.next-prod/server/app/api/files/expanded/route.js +1 -1
  48. package/.next-prod/server/app/api/files/expanded/route_client-reference-manifest.js +1 -1
  49. package/.next-prod/server/app/api/files/index/route_client-reference-manifest.js +1 -1
  50. package/.next-prod/server/app/api/files/init/route.js +1 -1
  51. package/.next-prod/server/app/api/files/init/route_client-reference-manifest.js +1 -1
  52. package/.next-prod/server/app/api/files/paste/route_client-reference-manifest.js +1 -1
  53. package/.next-prod/server/app/api/files/read/route_client-reference-manifest.js +1 -1
  54. package/.next-prod/server/app/api/files/readdir/route_client-reference-manifest.js +1 -1
  55. package/.next-prod/server/app/api/files/recent/route.js +1 -1
  56. package/.next-prod/server/app/api/files/recent/route_client-reference-manifest.js +1 -1
  57. package/.next-prod/server/app/api/files/save/route_client-reference-manifest.js +1 -1
  58. package/.next-prod/server/app/api/files/search/route_client-reference-manifest.js +1 -1
  59. package/.next-prod/server/app/api/git/branch-diff/route_client-reference-manifest.js +1 -1
  60. package/.next-prod/server/app/api/git/branches/route_client-reference-manifest.js +1 -1
  61. package/.next-prod/server/app/api/git/commit-diff/route_client-reference-manifest.js +1 -1
  62. package/.next-prod/server/app/api/git/commits/route_client-reference-manifest.js +1 -1
  63. package/.next-prod/server/app/api/git/diff/route_client-reference-manifest.js +1 -1
  64. package/.next-prod/server/app/api/git/discard/route_client-reference-manifest.js +1 -1
  65. package/.next-prod/server/app/api/git/stage/route_client-reference-manifest.js +1 -1
  66. package/.next-prod/server/app/api/git/status/route_client-reference-manifest.js +1 -1
  67. package/.next-prod/server/app/api/git/unstage/route_client-reference-manifest.js +1 -1
  68. package/.next-prod/server/app/api/git/worktree/route_client-reference-manifest.js +1 -1
  69. package/.next-prod/server/app/api/global-state/route_client-reference-manifest.js +1 -1
  70. package/.next-prod/server/app/api/jupyter/load/route_client-reference-manifest.js +1 -1
  71. package/.next-prod/server/app/api/jupyter/save/route_client-reference-manifest.js +1 -1
  72. package/.next-prod/server/app/api/jupyter/shutdown/route_client-reference-manifest.js +1 -1
  73. package/.next-prod/server/app/api/lsp/definition/route_client-reference-manifest.js +1 -1
  74. package/.next-prod/server/app/api/lsp/hover/route_client-reference-manifest.js +1 -1
  75. package/.next-prod/server/app/api/lsp/references/route_client-reference-manifest.js +1 -1
  76. package/.next-prod/server/app/api/lsp/status/route_client-reference-manifest.js +1 -1
  77. package/.next-prod/server/app/api/lsp/warmup/route_client-reference-manifest.js +1 -1
  78. package/.next-prod/server/app/api/mysql/columns/route_client-reference-manifest.js +1 -1
  79. package/.next-prod/server/app/api/mysql/connect/route_client-reference-manifest.js +1 -1
  80. package/.next-prod/server/app/api/mysql/disconnect/route_client-reference-manifest.js +1 -1
  81. package/.next-prod/server/app/api/mysql/export/route_client-reference-manifest.js +1 -1
  82. package/.next-prod/server/app/api/mysql/query/route_client-reference-manifest.js +1 -1
  83. package/.next-prod/server/app/api/mysql/schemas/route_client-reference-manifest.js +1 -1
  84. package/.next-prod/server/app/api/neo4j/connect/route_client-reference-manifest.js +1 -1
  85. package/.next-prod/server/app/api/neo4j/disconnect/route_client-reference-manifest.js +1 -1
  86. package/.next-prod/server/app/api/neo4j/query/route_client-reference-manifest.js +1 -1
  87. package/.next-prod/server/app/api/neo4j/schema/route_client-reference-manifest.js +1 -1
  88. package/.next-prod/server/app/api/note/route.js +1 -1
  89. package/.next-prod/server/app/api/note/route_client-reference-manifest.js +1 -1
  90. package/.next-prod/server/app/api/ollama/models/route_client-reference-manifest.js +1 -1
  91. package/.next-prod/server/app/api/ollama/start/route_client-reference-manifest.js +1 -1
  92. package/.next-prod/server/app/api/open-cursor/route_client-reference-manifest.js +1 -1
  93. package/.next-prod/server/app/api/open-vscode/route_client-reference-manifest.js +1 -1
  94. package/.next-prod/server/app/api/pick-folder/route_client-reference-manifest.js +1 -1
  95. package/.next-prod/server/app/api/pinned-sessions/route.js +1 -1
  96. package/.next-prod/server/app/api/pinned-sessions/route_client-reference-manifest.js +1 -1
  97. package/.next-prod/server/app/api/project-settings/route.js +1 -1
  98. package/.next-prod/server/app/api/project-settings/route_client-reference-manifest.js +1 -1
  99. package/.next-prod/server/app/api/project-state/route.js +1 -1
  100. package/.next-prod/server/app/api/project-state/route_client-reference-manifest.js +1 -1
  101. package/.next-prod/server/app/api/projects/route.js +1 -1
  102. package/.next-prod/server/app/api/projects/route_client-reference-manifest.js +1 -1
  103. package/.next-prod/server/app/api/redis/command/route_client-reference-manifest.js +1 -1
  104. package/.next-prod/server/app/api/redis/connect/route_client-reference-manifest.js +1 -1
  105. package/.next-prod/server/app/api/redis/delete/route_client-reference-manifest.js +1 -1
  106. package/.next-prod/server/app/api/redis/disconnect/route_client-reference-manifest.js +1 -1
  107. package/.next-prod/server/app/api/redis/get/route_client-reference-manifest.js +1 -1
  108. package/.next-prod/server/app/api/redis/keys/route_client-reference-manifest.js +1 -1
  109. package/.next-prod/server/app/api/redis/set/route_client-reference-manifest.js +1 -1
  110. package/.next-prod/server/app/api/review/[id]/comments/route_client-reference-manifest.js +1 -1
  111. package/.next-prod/server/app/api/review/[id]/replies/route_client-reference-manifest.js +1 -1
  112. package/.next-prod/server/app/api/review/[id]/route.js +1 -1
  113. package/.next-prod/server/app/api/review/[id]/route_client-reference-manifest.js +1 -1
  114. package/.next-prod/server/app/api/review/identify/route.js +1 -1
  115. package/.next-prod/server/app/api/review/identify/route_client-reference-manifest.js +1 -1
  116. package/.next-prod/server/app/api/review/order/route.js +1 -1
  117. package/.next-prod/server/app/api/review/order/route_client-reference-manifest.js +1 -1
  118. package/.next-prod/server/app/api/review/route_client-reference-manifest.js +1 -1
  119. package/.next-prod/server/app/api/review/share-info/route_client-reference-manifest.js +1 -1
  120. package/.next-prod/server/app/api/review/users/route.js +1 -1
  121. package/.next-prod/server/app/api/review/users/route_client-reference-manifest.js +1 -1
  122. package/.next-prod/server/app/api/scheduled-tasks/route.js +1 -1
  123. package/.next-prod/server/app/api/scheduled-tasks/route_client-reference-manifest.js +1 -1
  124. package/.next-prod/server/app/api/services/config/route.js +1 -1
  125. package/.next-prod/server/app/api/services/config/route_client-reference-manifest.js +1 -1
  126. package/.next-prod/server/app/api/services/scripts/route_client-reference-manifest.js +1 -1
  127. package/.next-prod/server/app/api/session/[sessionId]/fork/route.js +1 -1
  128. package/.next-prod/server/app/api/session/[sessionId]/fork/route_client-reference-manifest.js +1 -1
  129. package/.next-prod/server/app/api/session/[sessionId]/history/route.js +1 -1
  130. package/.next-prod/server/app/api/session/[sessionId]/history/route_client-reference-manifest.js +1 -1
  131. package/.next-prod/server/app/api/session-by-path/route.js +1 -1
  132. package/.next-prod/server/app/api/session-by-path/route_client-reference-manifest.js +1 -1
  133. package/.next-prod/server/app/api/sessions/projects/[encodedPath]/route.js +1 -1
  134. package/.next-prod/server/app/api/sessions/projects/[encodedPath]/route_client-reference-manifest.js +1 -1
  135. package/.next-prod/server/app/api/sessions/projects/route.js +1 -1
  136. package/.next-prod/server/app/api/sessions/projects/route_client-reference-manifest.js +1 -1
  137. package/.next-prod/server/app/api/sessions/route.js +1 -1
  138. package/.next-prod/server/app/api/sessions/route_client-reference-manifest.js +1 -1
  139. package/.next-prod/server/app/api/settings/route.js +1 -1
  140. package/.next-prod/server/app/api/settings/route_client-reference-manifest.js +1 -1
  141. package/.next-prod/server/app/api/terminal/aliases/route.js +1 -1
  142. package/.next-prod/server/app/api/terminal/aliases/route_client-reference-manifest.js +1 -1
  143. package/.next-prod/server/app/api/terminal/autocomplete/route_client-reference-manifest.js +1 -1
  144. package/.next-prod/server/app/api/terminal/bubble-order/route.js +1 -1
  145. package/.next-prod/server/app/api/terminal/bubble-order/route_client-reference-manifest.js +1 -1
  146. package/.next-prod/server/app/api/terminal/env/route.js +1 -1
  147. package/.next-prod/server/app/api/terminal/env/route_client-reference-manifest.js +1 -1
  148. package/.next-prod/server/app/api/terminal/history/route.js +1 -1
  149. package/.next-prod/server/app/api/terminal/history/route_client-reference-manifest.js +1 -1
  150. package/.next-prod/server/app/api/version/route_client-reference-manifest.js +1 -1
  151. package/.next-prod/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  152. package/.next-prod/server/app/page.js +1 -1
  153. package/.next-prod/server/app/page_client-reference-manifest.js +1 -1
  154. package/.next-prod/server/app/project/page.js +4 -4
  155. package/.next-prod/server/app/project/page_client-reference-manifest.js +1 -1
  156. package/.next-prod/server/app/review/[id]/page_client-reference-manifest.js +1 -1
  157. package/.next-prod/server/app-paths-manifest.json +26 -26
  158. package/.next-prod/server/chunks/4098.js +1 -1
  159. package/.next-prod/server/chunks/5394.js +1 -1
  160. package/.next-prod/server/chunks/6062.js +1 -1
  161. package/.next-prod/server/chunks/7284.js +1 -1
  162. package/.next-prod/server/pages/404.html +2 -2
  163. package/.next-prod/server/pages/500.html +2 -2
  164. package/.next-prod/server/server-reference-manifest.json +1 -1
  165. package/.next-prod/static/chunks/{1593-7902218f5b10761f.js → 1593-d845ec6e5c8de67e.js} +1 -1
  166. package/.next-prod/static/chunks/{5493-482fc2bbb049e7a4.js → 5493-83d6a5ec42d6cbb3.js} +1 -1
  167. package/.next-prod/static/chunks/app/page-cc2b332242bc2c93.js +1 -0
  168. package/.next-prod/static/chunks/app/project/page-b867dec5473dadac.js +25 -0
  169. package/.next-prod/static/css/bbd65867698c479b.css +3 -0
  170. package/.next-prod/trace +12 -12
  171. package/.next-prod/trace-build +1 -1
  172. package/dist/{chunk-VV5VMA4B.mjs → chunk-KLV3PBIZ.mjs} +17 -0
  173. package/dist/scheduledTasks.mjs +7 -2
  174. package/dist/wsServer.mjs +1 -1
  175. package/package.json +2 -2
  176. package/.next-prod/static/chunks/app/page-cc2bf3ca4c337090.js +0 -1
  177. package/.next-prod/static/chunks/app/project/page-62d5a8ed458279b8.js +0 -25
  178. package/.next-prod/static/css/1573b510894a4234.css +0 -3
  179. /package/.next-prod/static/{0mBqfZkcLM2Y1ikI9uxKG → _gYuZ_hBlVHw7RvEBSdgN}/_buildManifest.js +0 -0
  180. /package/.next-prod/static/{0mBqfZkcLM2Y1ikI9uxKG → _gYuZ_hBlVHw7RvEBSdgN}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- "use strict";exports.id=6062,exports.ids=[6062],exports.modules={132:(a,b,c)=>{c.d(b,{P:()=>e});var d=c(67484);function e(){let[a,b]=(0,d.useState)([]),c=(0,d.useCallback)(()=>{fetch("/api/pinned-sessions").then(a=>a.json()).then(a=>b(a.sessions||[])).catch(()=>{})},[]),e=(0,d.useCallback)(a=>{b(a),fetch("/api/pinned-sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessions:a})}).catch(()=>{});try{window.parent.postMessage({type:"PINNED_SESSIONS_CHANGED"},"*")}catch{}},[]),f=(0,d.useCallback)(b=>a.some(a=>a.sessionId===b),[a]),g=(0,d.useCallback)((b,c,d)=>{a.some(a=>a.sessionId===b)||e([...a,{sessionId:b,cwd:c,customTitle:d}])},[a,e]),h=(0,d.useCallback)(b=>{e(a.filter(a=>a.sessionId!==b))},[a,e]),i=(0,d.useCallback)((b,c)=>{e(a.map(a=>a.sessionId===b?{...a,customTitle:c}:a))},[a,e]);return{pinnedSessions:a,isPinned:f,pinSession:g,unpinSession:h,updateTitle:i,reorder:(0,d.useCallback)(a=>{e(a)},[e]),reload:c}}},13928:(a,b,c)=>{c.d(b,{h:()=>e});var d=c(67484);function e({url:a,onMessage:b,enabled:c=!0}){(0,d.useRef)(b)}},21108:(a,b,c)=>{c.d(b,{n:()=>g});var d=c(67484);let e="SCHEDULED_TASKS_CHANGED";function f(){try{window.parent.postMessage({type:e},"*")}catch{}document.querySelectorAll("iframe").forEach(a=>{try{a.contentWindow?.postMessage({type:e},"*")}catch{}})}function g(){let[a,b]=(0,d.useState)([]),[c,e]=(0,d.useState)(0),g=(0,d.useCallback)(()=>{fetch("/api/scheduled-tasks").then(a=>a.json()).then(a=>{b(a.tasks||[]),e(a.unreadCount||0)}).catch(()=>{})},[]),h=(0,d.useCallback)(async a=>{try{let b=await fetch("/api/scheduled-tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),c=await b.json();if(c.task)return g(),f(),c.task;return null}catch{return null}},[g]),i=(0,d.useCallback)(async a=>{await fetch("/api/scheduled-tasks",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:a,action:"pause"})}).catch(()=>{}),g(),f()},[g]),j=(0,d.useCallback)(async a=>{await fetch("/api/scheduled-tasks",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:a,action:"resume"})}).catch(()=>{}),g(),f()},[g]),k=(0,d.useCallback)(async a=>{await fetch("/api/scheduled-tasks",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:a})}).catch(()=>{}),g(),f()},[g]),l=(0,d.useCallback)(async(a,b)=>{await fetch("/api/scheduled-tasks",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:a,action:"update",fields:b})}).catch(()=>{}),g(),f()},[g]),m=(0,d.useCallback)(async a=>{await fetch("/api/scheduled-tasks",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:a,action:"trigger"})}).catch(()=>{}),g(),f()},[g]),n=(0,d.useCallback)(async a=>{await fetch("/api/scheduled-tasks",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:a,action:"markRead"})}).catch(()=>{}),g(),f()},[g]),o=(0,d.useCallback)(async()=>{await fetch("/api/scheduled-tasks",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:"_",action:"markAllRead"})}).catch(()=>{}),g(),f()},[g]),p=(0,d.useCallback)(async a=>{await fetch("/api/scheduled-tasks",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:"_",action:"reorder",fields:{orderedIds:a}})}).catch(()=>{}),g(),f()},[g]);return{tasks:a,unreadCount:c,reload:g,createTask:h,pauseTask:i,resumeTask:j,triggerTask:m,deleteTask:k,updateTask:l,markRead:n,markAllRead:o,reorderTasks:p}}},30976:(a,b,c)=>{function d(){return!("u"<typeof navigator)&&(/Mac|iPhone|iPad/.test(navigator.platform||"")||navigator.userAgentData?.platform==="macOS")}function e(){return d()?"⌘":"Ctrl+"}c.d(b,{L:()=>d,Mu:()=>e}),process.platform,process.platform,process.platform},31037:(a,b,c)=>{c.d(b,{E:()=>j});var d=c(48249),e=c(67484),f=c(44384),g=c(41564),h=c(30976);let i={once:[{labelKey:"scheduledTasks.5minLater",value:5},{labelKey:"scheduledTasks.15minLater",value:15},{labelKey:"scheduledTasks.30minLater",value:30},{labelKey:"scheduledTasks.1hourLater",value:60}],interval:[{labelKey:"scheduledTasks.every15min",value:15},{labelKey:"scheduledTasks.every30min",value:30},{labelKey:"scheduledTasks.every1hour",value:60},{labelKey:"scheduledTasks.every2hours",value:120}],cron:[{labelKey:"scheduledTasks.daily9am",value:"0 9 * * *"},{labelKey:"scheduledTasks.daily6pm",value:"0 18 * * *"},{labelKey:"scheduledTasks.weeklyMon9am",value:"0 9 * * 1"},{labelKey:"scheduledTasks.monthly1st9am",value:"0 9 1 * *"}]};function j({onClose:a,onCreate:b,editTask:c,onUpdate:j}){let{t:k}=(0,f.Bd)(),l=!!c,[m,n]=(0,e.useState)(c?.type||"once"),[o,p]=(0,e.useState)(c?.message||""),[q,r]=(0,e.useState)(c?String(c.delayMinutes||c.intervalMinutes||""):""),[s,t]=(0,e.useState)(c?.cron||""),[u,v]=(0,e.useState)(c?.activeFrom||"09:00"),[w,x]=(0,e.useState)(c?.activeTo||"18:00"),[y,z]=(0,e.useState)(!!(c?.activeFrom&&c?.activeTo)),[A,B]=(0,e.useState)(null),C=(0,e.useRef)(null),D=(0,e.useRef)(null),E=(0,e.useCallback)(()=>{if(!o.trim())return;let d=null;if("once"===m){let a=A||parseInt(q,10);if(!a||a<=0)return;d={message:o.trim(),type:"once",delayMinutes:a}}else if("interval"===m){let a=A||parseInt(q,10);if(!a||a<=0)return;d={message:o.trim(),type:"interval",intervalMinutes:a,...y?{activeFrom:u,activeTo:w}:{}}}else if("cron"===m){let a=A||s.trim();if(!a)return;d={message:o.trim(),type:"cron",cron:a}}d&&(l&&c&&j?j(c.id,d):b(d),a())},[o,m,A,q,s,y,u,w,b,a,l,c,j]);return(0,d.jsxs)("div",{ref:C,className:`w-80 bg-popover border border-border rounded-lg shadow-lg z-50 ${l?"":"absolute bottom-full left-0 mb-2"}`,onKeyDown:b=>{"Escape"===b.key?a():"Enter"===b.key&&(b.metaKey||b.ctrlKey)&&E()},children:[(0,d.jsx)("div",{className:"px-3 py-2 border-b border-border bg-muted/50 rounded-t-lg",children:(0,d.jsx)("span",{className:"text-sm font-medium",children:l?k("scheduledTasks.editTask"):k("scheduledTasks.createTask")})}),(0,d.jsxs)("div",{className:"p-3 space-y-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-xs text-muted-foreground mb-1 block",children:k("scheduledTasks.sendMessage")}),(0,d.jsx)("textarea",{ref:D,value:o,onChange:a=>p(a.target.value),placeholder:k("scheduledTasks.messagePlaceholder"),rows:2,className:"w-full px-2 py-1.5 text-sm border border-border rounded bg-card text-foreground placeholder-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring resize-none"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-xs text-muted-foreground mb-1 block",children:k("scheduledTasks.type")}),(0,d.jsx)("div",{className:"flex gap-1",children:["once","interval","cron"].map(a=>(0,d.jsx)("button",{onClick:()=>{n(a),B(null),r(""),t("")},className:`flex-1 px-2 py-1 text-xs rounded transition-colors ${m===a?"bg-brand text-white":"bg-muted text-muted-foreground hover:text-foreground"}`,children:"once"===a?k("scheduledTasks.once"):"interval"===a?k("scheduledTasks.interval"):"Cron"},a))})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-xs text-muted-foreground mb-1 block",children:k("scheduledTasks.quickSelect")}),(0,d.jsx)("div",{className:"grid grid-cols-2 gap-1",children:i[m].map(a=>(0,d.jsx)("button",{onClick:()=>{B(a.value),"cron"===m?t(String(a.value)):r(String(a.value))},className:`px-2 py-1 text-xs rounded border transition-colors ${A===a.value?"border-brand bg-brand/10 text-brand":"border-border text-muted-foreground hover:text-foreground hover:border-foreground/30"}`,children:k(a.labelKey)},a.labelKey))})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-xs text-muted-foreground mb-1 block",children:"cron"===m?k("scheduledTasks.customCron"):k("scheduledTasks.customMinutes")}),"cron"===m?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("input",{type:"text",value:s,onChange:a=>{t(a.target.value),B(null)},placeholder:k("scheduledTasks.cronPlaceholder"),className:"w-full px-2 py-1.5 text-sm border border-border rounded bg-card text-foreground placeholder-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring font-mono"}),s.trim()&&(0,d.jsx)("div",{className:"mt-1 text-xs text-muted-foreground",children:function(a){let b=g.A.t,c=a.trim().split(/\s+/);if(5!==c.length)return null;let[d,e,f,h,i]=c,j={0:b("cron.dowSun"),1:b("cron.dowMon"),2:b("cron.dowTue"),3:b("cron.dowWed"),4:b("cron.dowThu"),5:b("cron.dowFri"),6:b("cron.dowSat")},k={1:`1${b("cron.monthPrefix")}`,2:`2${b("cron.monthPrefix")}`,3:`3${b("cron.monthPrefix")}`,4:`4${b("cron.monthPrefix")}`,5:`5${b("cron.monthPrefix")}`,6:`6${b("cron.monthPrefix")}`,7:`7${b("cron.monthPrefix")}`,8:`8${b("cron.monthPrefix")}`,9:`9${b("cron.monthPrefix")}`,10:`10${b("cron.monthPrefix")}`,11:`11${b("cron.monthPrefix")}`,12:`12${b("cron.monthPrefix")}`};try{let a="";if(d.includes("/")||e.includes("/")){if("*"===e&&d.includes("/"))return b("cron.everyNMinutes",{n:d.split("/")[1]});if("0"===d&&e.includes("/"))return b("cron.everyNHours",{n:e.split("/")[1]});return null}let c=parseInt(e,10),g=parseInt(d,10);if(isNaN(c)&&"*"!==e||isNaN(g)&&"*"!==d)return null;a="*"===e&&"*"===d?b("cron.everyMinute"):"*"===e?b("cron.everyHourAtMin",{m:g}):"*"===d?b("cron.hourlyEveryMin",{h:c}):`${String(c).padStart(2,"0")}:${String(g).padStart(2,"0")}`;let l=[];if("*"!==h){let a=h.split(",").map(a=>k[a]||`${a}${b("cron.monthPrefix")}`);l.push(a.join(", "))}if("*"!==f)if(f.includes("-")){let[a,c]=f.split("-");l.push(b("cron.dayRange",{a,b:c}))}else f.includes(",")?l.push(f.split(",").map(a=>`${a}${b("cron.dayOfMonth")}`).join(", ")):l.push(`${f}${b("cron.dayOfMonth")}`);if("*"!==i)if("1-5"===i)l.push(b("cron.weekdays"));else if("0,6"===i||"6,0"===i)l.push(b("cron.weekends"));else{let a=i.split(",").map(a=>{if(a.includes("-")){let[c,d]=a.split("-");return b("cron.weekdayRange",{a:j[c]||c,b:j[d]||d})}return`${b("cron.weekdayPrefix")}${j[a]||a}`});l.push(a.join(", "))}if(0===l.length&&"*"===f&&"*"===h&&"*"===i)return b("cron.daily",{time:a});return`${l.join(" ")} ${a}`}catch{return null}}(s.trim())||(0,d.jsx)("span",{className:"text-destructive",children:k("scheduledTasks.cronFormat")})})]}):(0,d.jsx)("input",{type:"number",value:q,onChange:a=>{r(a.target.value),B(null)},placeholder:k("scheduledTasks.minutesPlaceholder"),min:1,className:"w-full px-2 py-1.5 text-sm border border-border rounded bg-card text-foreground placeholder-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),"interval"===m&&(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"flex items-center gap-2 text-xs text-muted-foreground mb-1 cursor-pointer",children:[(0,d.jsx)("input",{type:"checkbox",checked:y,onChange:a=>z(a.target.checked),className:"rounded border-border"}),k("scheduledTasks.limitTimeRange")]}),y&&(0,d.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,d.jsx)("input",{type:"time",value:u,onChange:a=>v(a.target.value),className:"flex-1 px-2 py-1 text-sm border border-border rounded bg-card text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:k("scheduledTasks.to")}),(0,d.jsx)("input",{type:"time",value:w,onChange:a=>x(a.target.value),className:"flex-1 px-2 py-1 text-sm border border-border rounded bg-card text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]})]}),(0,d.jsx)("button",{onClick:E,disabled:!(o.trim()&&("once"===m||"interval"===m?!!(A||q&&parseInt(q,10)>0):"cron"===m&&!!(A||s.trim()))),className:"w-full py-1.5 text-sm font-medium rounded bg-brand text-white hover:bg-brand/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:l?k("scheduledTasks.saveBtn",{modKey:(0,h.Mu)()}):k("scheduledTasks.createBtn",{modKey:(0,h.Mu)()})})]})]})}},60306:(a,b,c)=>{c.d(b,{b:()=>k});var d=c(48249),e=c(67484),f=c(44384),g=c(3532),h=c(81749),i=c(30976),j=c(74955);function k({isOpen:a,onClose:b}){let{t:c,i18n:k}=(0,f.Bd)(),{theme:l,setTheme:m}=(0,g.D)(),n=(0,j.G)(),[o,p]=(0,e.useState)(""),[q,r]=(0,e.useState)(""),[s,t]=(0,e.useState)("auto"),u=(0,e.useCallback)(a=>{t(a),fetch("/api/settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({language:a})}).catch(()=>{});let b="auto"===a?navigator.language.startsWith("zh")?"zh":"en":a;k.changeLanguage(b)},[k]),v=n?"installed":"not-installed",w=n?.version??null;if(!a)return null;let x=[{value:"system",label:c("settings.themeSystem"),icon:"\uD83D\uDCBB"},{value:"light",label:c("settings.themeLight"),icon:"☀️"},{value:"dark",label:c("settings.themeDark"),icon:"\uD83C\uDF19"}];return(0,d.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,d.jsx)("div",{className:"absolute inset-0 bg-black/50",onClick:b}),(0,d.jsxs)("div",{className:"relative bg-card rounded-lg shadow-xl w-full max-w-md mx-4 overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[(0,d.jsx)("h2",{className:"text-sm font-medium text-foreground",children:c("settings.title")}),(0,d.jsx)("button",{onClick:b,className:"p-1 text-muted-foreground hover:text-foreground hover:bg-accent rounded transition-colors",children:(0,d.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,d.jsxs)("div",{className:"p-4 space-y-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:c("settings.theme")}),(0,d.jsx)("div",{className:"grid grid-cols-3 gap-2",children:x.map(a=>(0,d.jsxs)("button",{onClick:()=>m(a.value),className:`flex flex-col items-center gap-1 p-3 rounded-lg border transition-colors ${l===a.value?"border-brand bg-brand/10 text-brand":"border-border hover:border-slate-6 text-muted-foreground hover:text-foreground"}`,children:[(0,d.jsx)("span",{className:"text-xl",children:a.icon}),(0,d.jsx)("span",{className:"text-xs font-medium",children:a.label})]},a.value))})]}),(0,d.jsx)("div",{className:"border-t border-border"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:c("settings.language")}),(0,d.jsx)("div",{className:"grid grid-cols-3 gap-2",children:[{value:"auto",label:c("settings.languageAuto"),icon:"\uD83C\uDF10"},{value:"en",label:"English",icon:"\uD83C\uDDFA\uD83C\uDDF8"},{value:"zh",label:"中文",icon:"\uD83C\uDDE8\uD83C\uDDF3"}].map(a=>(0,d.jsxs)("button",{onClick:()=>u(a.value),className:`flex flex-col items-center gap-1 p-3 rounded-lg border transition-colors ${s===a.value?"border-brand bg-brand/10 text-brand":"border-border hover:border-slate-6 text-muted-foreground hover:text-foreground"}`,children:[(0,d.jsx)("span",{className:"text-xl",children:a.icon}),(0,d.jsx)("span",{className:"text-xs font-medium",children:a.label})]},a.value))})]}),(0,d.jsx)("div",{className:"border-t border-border"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:c("settings.browserExtension")}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,d.jsx)("span",{className:`inline-block w-2 h-2 rounded-full flex-shrink-0 ${"installed"===v?"bg-green-500":"bg-slate-400"}`}),(0,d.jsxs)("span",{children:["installed"===v&&`${c("settings.extensionInstalled")}${w?` (v${w})`:""}`,"not-installed"===v&&c("settings.extensionNotInstalled")]})]}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground leading-relaxed",children:c("settings.extensionDescription")}),"installed"!==v&&(0,d.jsxs)("div",{className:"text-xs text-muted-foreground bg-muted/50 rounded-md p-2 space-y-1",children:[(0,d.jsx)("p",{className:"font-medium text-foreground",children:c("settings.installSteps")}),(0,d.jsxs)("p",{children:[c("settings.step1")," ",(0,d.jsx)("code",{className:"px-1 py-0.5 bg-muted rounded text-foreground",children:"chrome://extensions"})]}),(0,d.jsx)("p",{children:c("settings.step2")}),(0,d.jsx)("p",{children:c("settings.step3")}),(0,i.L)()&&(0,d.jsx)("p",{dangerouslySetInnerHTML:{__html:c("settings.step4mac")}})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("button",{onClick:()=>{let a=o||"chrome-extension";navigator.clipboard.writeText(a),(0,h.oR)(c("toast.copiedName",{name:a}))},className:"px-3 py-1.5 text-xs bg-brand text-white rounded-md hover:bg-brand/90 transition-colors",children:c("settings.copyExtensionPath")}),"installed"===v&&(0,d.jsx)("button",{onClick:()=>{n?.id&&window.chrome?.runtime?.sendMessage&&(window.chrome.runtime.sendMessage(n.id,{type:"reload"}),(0,h.oR)(c("toast.pluginReloading")))},className:"px-3 py-1.5 text-xs border border-border text-foreground rounded-md hover:bg-muted transition-colors",children:c("settings.reloadExtension")})]}),o&&(0,d.jsx)("p",{className:"text-[11px] text-muted-foreground font-mono truncate",children:o})]})]}),(0,d.jsx)("div",{className:"border-t border-border"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:c("settings.about")}),(0,d.jsxs)("div",{className:"text-xs text-muted-foreground space-y-1",children:[(0,d.jsxs)("p",{children:["Cockpit",q?` v${q}`:""]}),(0,d.jsx)("p",{className:"text-muted-foreground/60",children:"One seat. One AI. Everything under control."})]})]})]})]})]})}},64874:(a,b,c)=>{c.d(b,{r:()=>g});var d=c(48249),e=c(67484),f=c(44384);function g({isOpen:a,onClose:b,onSelectSession:c,onAddProject:g}){let{t:h}=(0,f.Bd)(),[i,j]=(0,e.useState)(!1),[k,l]=(0,e.useState)([]),[m,n]=(0,e.useState)({}),[o,p]=(0,e.useState)(!1),[q,r]=(0,e.useState)(null),[s,t]=(0,e.useState)(""),u=(0,e.useRef)(null);(0,e.useCallback)(async()=>{p(!0),r(null),n({});try{let a=await fetch("/api/sessions/projects");if(!a.ok)throw Error("Failed to load projects");let b=await a.json();l(b)}catch(a){r(a instanceof Error?a.message:"Unknown error")}finally{p(!1)}},[]);let v=(0,e.useCallback)(async a=>{n(b=>({...b,[a]:{...b[a],isExpanded:!0,isLoading:!0,sessions:[],error:null}}));try{let b=await fetch(`/api/sessions/projects/${encodeURIComponent(a)}`);if(!b.ok)throw Error("Failed to load sessions");let c=await b.json();n(b=>({...b,[a]:{...b[a],isLoading:!1,sessions:c}}))}catch(b){n(c=>({...c,[a]:{...c[a],isLoading:!1,error:b instanceof Error?b.message:"Unknown error"}}))}},[]),w=(0,e.useCallback)(a=>{let b=m[a];b?.isExpanded?n(b=>({...b,[a]:{...b[a],isExpanded:!1}})):b?.sessions?.length?n(b=>({...b,[a]:{...b[a],isExpanded:!0}})):v(a)},[m,v]),x=(0,e.useCallback)(async()=>{if(!i){j(!0);try{let a=await fetch("/api/pick-folder"),c=await a.json();c.folder&&g&&(g(c.folder),b())}catch{}finally{j(!1)}}},[i,g,b]);return a?(0,d.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,d.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:b}),(0,d.jsxs)("div",{className:"relative w-full max-w-6xl h-[90vh] mx-4 bg-card rounded-lg shadow-xl flex flex-col overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[(0,d.jsx)("h2",{className:"text-sm font-medium text-foreground",children:h("sessions.projectList")}),(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("input",{ref:u,type:"text",placeholder:h("workspace.searchProjectPath"),value:s,onChange:a=>t(a.target.value),className:"px-2 py-1 text-xs border border-border rounded bg-card text-foreground placeholder-slate-9 focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent"}),g&&(0,d.jsxs)("button",{onClick:x,disabled:i,className:"flex items-center gap-1.5 px-2.5 py-1 text-xs rounded-md border border-border text-muted-foreground hover:text-foreground hover:bg-accent transition-colors disabled:opacity-50",title:h("sessions.openFolder"),children:[(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 10v6m3-3H9m-4 7h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})}),i?h("sessions.selectingFolder"):h("sessions.openFolder")]}),(0,d.jsx)("button",{onClick:b,className:"p-1 text-slate-9 hover:text-foreground hover:bg-accent rounded transition-colors",children:(0,d.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]}),(0,d.jsxs)("div",{className:"flex-1 overflow-y-auto p-4",children:[o&&(0,d.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,d.jsxs)("svg",{className:"animate-spin h-4 w-4",fill:"none",viewBox:"0 0 24 24",children:[(0,d.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,d.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),(0,d.jsx)("span",{children:h("workspace.loadingProjects")})]})}),q&&(0,d.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,d.jsx)("div",{className:"text-xs text-red-11",children:q})}),!o&&!q&&0===k.length&&(0,d.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,d.jsx)("div",{className:"text-xs text-muted-foreground",children:h("workspace.projectNotFound")})}),!o&&!q&&k.filter(a=>a.fullPath.toLowerCase().includes(s.toLowerCase())).map(a=>{let b=m[a.encodedPath]||{isExpanded:!1,isLoading:!1,sessions:[],error:null};return(0,d.jsxs)("div",{className:"mb-3",children:[(0,d.jsxs)("button",{onClick:()=>w(a.encodedPath),className:"w-full flex items-center gap-2 p-2 rounded hover:bg-accent transition-colors text-left",children:[(0,d.jsx)("svg",{className:`w-3 h-3 text-muted-foreground transition-transform ${b.isExpanded?"rotate-90":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,d.jsx)("svg",{className:"w-4 h-4 text-muted-foreground",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})}),(0,d.jsx)("span",{className:"flex-1 text-xs font-medium text-foreground truncate",title:a.fullPath,children:a.fullPath}),(0,d.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",a.sessionCount,")"]})]}),b.isExpanded&&(0,d.jsxs)("div",{className:"ml-6 mt-2",children:[b.isLoading&&(0,d.jsxs)("div",{className:"flex items-center gap-2 p-3 text-xs text-muted-foreground",children:[(0,d.jsxs)("svg",{className:"animate-spin h-3 w-3",fill:"none",viewBox:"0 0 24 24",children:[(0,d.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,d.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),(0,d.jsx)("span",{children:h("sessions.loadingSessions")})]}),b.error&&(0,d.jsx)("div",{className:"p-3 text-xs text-red-11",children:b.error}),!b.isLoading&&!b.error&&(0,d.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:b.sessions.map(b=>(0,d.jsxs)("div",{onClick:()=>{var d;let e;return d=a.fullPath,e=(b.path.split("/").pop()||"").replace(".jsonl",""),void(c?c(d,e):window.parent.postMessage({type:"OPEN_PROJECT",cwd:d,sessionId:e},"*"))},className:"p-3 bg-secondary rounded border border-border hover:border-brand hover:shadow-md cursor-pointer transition-all",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[b.engine&&"claude"!==b.engine&&(0,d.jsx)("span",{className:`shrink-0 px-1 py-0.5 text-[10px] leading-none font-medium rounded ${"ollama"===b.engine?"bg-blue-500/15 text-blue-11":"codex"===b.engine?"bg-green-500/15 text-green-11":"kimi"===b.engine?"bg-purple-500/15 text-purple-11":"bg-muted text-muted-foreground"}`,children:b.engine}),(0,d.jsx)("h4",{className:"text-xs font-medium text-foreground truncate",title:b.title,children:b.title})]}),(0,d.jsx)("div",{className:"text-xs text-muted-foreground mb-2",children:new Date(b.modifiedAt).toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}),(0,d.jsxs)("div",{className:"space-y-0.5 text-xs",children:[b.firstMessages.map((a,b)=>(0,d.jsxs)("div",{className:"text-foreground truncate",title:a,children:[(0,d.jsx)("span",{className:"text-slate-9 mr-1",children:"•"}),a]},`first-${b}`)),b.lastMessages.length>0&&(0,d.jsx)("div",{className:"text-slate-9 text-center py-0.5",children:"\xb7\xb7\xb7"}),b.lastMessages.map((a,b)=>(0,d.jsxs)("div",{className:"text-foreground truncate",title:a,children:[(0,d.jsx)("span",{className:"text-slate-9 mr-1",children:"•"}),a]},`last-${b}`))]})]},b.path))})]})]},a.encodedPath)})]})]})]}):null}},74955:(a,b,c)=>{c.d(b,{G:()=>l,f:()=>m});var d=c(67484);function e(){if("u"<typeof document)return null;let a=document.querySelector('meta[name="cockpit-bridge"]');if(!a)return null;let b=a.dataset.id,c=a.dataset.version;return b?{id:b,version:c||"unknown"}:null}let f=null,g=new Set;function h(){g.forEach(a=>a())}function i(a){g.add(a);let b=e();return b&&!f&&(f=b,Promise.resolve().then(h)),()=>{g.delete(a)}}function j(){return f}function k(){return null}if("u">typeof document&&(f=e()),"u">typeof MutationObserver&&"u">typeof document){let a=new MutationObserver(()=>{let a=e();a&&(!f||a.id!==f.id||a.version!==f.version)&&(f=a,h())}),b=document.head||document.documentElement;b&&a.observe(b,{childList:!0})}function l(){return(0,d.useSyncExternalStore)(i,j,k)}function m(){return f??e()}}};
1
+ "use strict";exports.id=6062,exports.ids=[6062],exports.modules={132:(a,b,c)=>{c.d(b,{P:()=>e});var d=c(67484);function e(){let[a,b]=(0,d.useState)([]),c=(0,d.useCallback)(()=>{fetch("/api/pinned-sessions").then(a=>a.json()).then(a=>b(a.sessions||[])).catch(()=>{})},[]),e=(0,d.useCallback)(a=>{b(a),fetch("/api/pinned-sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessions:a})}).catch(()=>{});try{window.parent.postMessage({type:"PINNED_SESSIONS_CHANGED"},"*")}catch{}},[]),f=(0,d.useCallback)(b=>a.some(a=>a.sessionId===b),[a]),g=(0,d.useCallback)((b,c,d)=>{a.some(a=>a.sessionId===b)||e([...a,{sessionId:b,cwd:c,customTitle:d}])},[a,e]),h=(0,d.useCallback)(b=>{e(a.filter(a=>a.sessionId!==b))},[a,e]),i=(0,d.useCallback)((b,c)=>{e(a.map(a=>a.sessionId===b?{...a,customTitle:c}:a))},[a,e]);return{pinnedSessions:a,isPinned:f,pinSession:g,unpinSession:h,updateTitle:i,reorder:(0,d.useCallback)(a=>{e(a)},[e]),reload:c}}},13928:(a,b,c)=>{c.d(b,{h:()=>e});var d=c(67484);function e({url:a,onMessage:b,enabled:c=!0}){(0,d.useRef)(b)}},21108:(a,b,c)=>{c.d(b,{n:()=>g});var d=c(67484);let e="SCHEDULED_TASKS_CHANGED";function f(){try{window.parent.postMessage({type:e},"*")}catch{}document.querySelectorAll("iframe").forEach(a=>{try{a.contentWindow?.postMessage({type:e},"*")}catch{}})}function g(){let[a,b]=(0,d.useState)([]),[c,e]=(0,d.useState)(0),g=(0,d.useCallback)(()=>{fetch("/api/scheduled-tasks").then(a=>a.json()).then(a=>{b(a.tasks||[]),e(a.unreadCount||0)}).catch(()=>{})},[]),h=(0,d.useCallback)(async a=>{try{let b=await fetch("/api/scheduled-tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),c=await b.json();if(c.task)return g(),f(),c.task;return null}catch{return null}},[g]),i=(0,d.useCallback)(async a=>{await fetch("/api/scheduled-tasks",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:a,action:"pause"})}).catch(()=>{}),g(),f()},[g]),j=(0,d.useCallback)(async a=>{await fetch("/api/scheduled-tasks",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:a,action:"resume"})}).catch(()=>{}),g(),f()},[g]),k=(0,d.useCallback)(async a=>{await fetch("/api/scheduled-tasks",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:a})}).catch(()=>{}),g(),f()},[g]),l=(0,d.useCallback)(async(a,b)=>{await fetch("/api/scheduled-tasks",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:a,action:"update",fields:b})}).catch(()=>{}),g(),f()},[g]),m=(0,d.useCallback)(async a=>{await fetch("/api/scheduled-tasks",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:a,action:"trigger"})}).catch(()=>{}),g(),f()},[g]),n=(0,d.useCallback)(async a=>{await fetch("/api/scheduled-tasks",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:a,action:"markRead"})}).catch(()=>{}),g(),f()},[g]),o=(0,d.useCallback)(async()=>{await fetch("/api/scheduled-tasks",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:"_",action:"markAllRead"})}).catch(()=>{}),g(),f()},[g]),p=(0,d.useCallback)(async a=>{await fetch("/api/scheduled-tasks",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:"_",action:"reorder",fields:{orderedIds:a}})}).catch(()=>{}),g(),f()},[g]);return{tasks:a,unreadCount:c,reload:g,createTask:h,pauseTask:i,resumeTask:j,triggerTask:m,deleteTask:k,updateTask:l,markRead:n,markAllRead:o,reorderTasks:p}}},30976:(a,b,c)=>{function d(){return!("u"<typeof navigator)&&(/Mac|iPhone|iPad/.test(navigator.platform||"")||navigator.userAgentData?.platform==="macOS")}function e(){return d()?"⌘":"Ctrl+"}c.d(b,{L:()=>d,Mu:()=>e}),process.platform,process.platform,process.platform},31037:(a,b,c)=>{c.d(b,{E:()=>j});var d=c(48249),e=c(67484),f=c(44384),g=c(41564),h=c(30976);let i={once:[{labelKey:"scheduledTasks.5minLater",value:5},{labelKey:"scheduledTasks.15minLater",value:15},{labelKey:"scheduledTasks.30minLater",value:30},{labelKey:"scheduledTasks.1hourLater",value:60}],interval:[{labelKey:"scheduledTasks.every15min",value:15},{labelKey:"scheduledTasks.every30min",value:30},{labelKey:"scheduledTasks.every1hour",value:60},{labelKey:"scheduledTasks.every2hours",value:120}],cron:[{labelKey:"scheduledTasks.daily9am",value:"0 9 * * *"},{labelKey:"scheduledTasks.daily6pm",value:"0 18 * * *"},{labelKey:"scheduledTasks.weeklyMon9am",value:"0 9 * * 1"},{labelKey:"scheduledTasks.monthly1st9am",value:"0 9 1 * *"}]};function j({onClose:a,onCreate:b,editTask:c,onUpdate:j}){let{t:k}=(0,f.Bd)(),l=!!c,[m,n]=(0,e.useState)(c?.type||"once"),[o,p]=(0,e.useState)(c?.message||""),[q,r]=(0,e.useState)(c?String(c.delayMinutes||c.intervalMinutes||""):""),[s,t]=(0,e.useState)(c?.cron||""),[u,v]=(0,e.useState)(c?.activeFrom||"09:00"),[w,x]=(0,e.useState)(c?.activeTo||"18:00"),[y,z]=(0,e.useState)(!!(c?.activeFrom&&c?.activeTo)),[A,B]=(0,e.useState)(null),C=(0,e.useRef)(null),D=(0,e.useRef)(null),E=(0,e.useCallback)(()=>{if(!o.trim())return;let d=null;if("once"===m){let a=A||parseInt(q,10);if(!a||a<=0)return;d={message:o.trim(),type:"once",delayMinutes:a}}else if("interval"===m){let a=A||parseInt(q,10);if(!a||a<=0)return;d={message:o.trim(),type:"interval",intervalMinutes:a,...y?{activeFrom:u,activeTo:w}:{}}}else if("cron"===m){let a=A||s.trim();if(!a)return;d={message:o.trim(),type:"cron",cron:a}}d&&(l&&c&&j?j(c.id,d):b(d),a())},[o,m,A,q,s,y,u,w,b,a,l,c,j]);return(0,d.jsxs)("div",{ref:C,className:`w-80 bg-popover border border-border rounded-lg shadow-lg z-50 ${l?"":"absolute bottom-full left-0 mb-2"}`,onKeyDown:b=>{"Escape"===b.key?a():"Enter"===b.key&&(b.metaKey||b.ctrlKey)&&E()},children:[(0,d.jsx)("div",{className:"px-3 py-2 border-b border-border bg-muted/50 rounded-t-lg",children:(0,d.jsx)("span",{className:"text-sm font-medium",children:l?k("scheduledTasks.editTask"):k("scheduledTasks.createTask")})}),(0,d.jsxs)("div",{className:"p-3 space-y-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-xs text-muted-foreground mb-1 block",children:k("scheduledTasks.sendMessage")}),(0,d.jsx)("textarea",{ref:D,value:o,onChange:a=>p(a.target.value),placeholder:k("scheduledTasks.messagePlaceholder"),rows:2,className:"w-full px-2 py-1.5 text-sm border border-border rounded bg-card text-foreground placeholder-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring resize-none"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-xs text-muted-foreground mb-1 block",children:k("scheduledTasks.type")}),(0,d.jsx)("div",{className:"flex gap-1",children:["once","interval","cron"].map(a=>(0,d.jsx)("button",{onClick:()=>{n(a),B(null),r(""),t("")},className:`flex-1 px-2 py-1 text-xs rounded transition-colors ${m===a?"bg-brand text-white":"bg-muted text-muted-foreground hover:text-foreground"}`,children:"once"===a?k("scheduledTasks.once"):"interval"===a?k("scheduledTasks.interval"):"Cron"},a))})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-xs text-muted-foreground mb-1 block",children:k("scheduledTasks.quickSelect")}),(0,d.jsx)("div",{className:"grid grid-cols-2 gap-1",children:i[m].map(a=>(0,d.jsx)("button",{onClick:()=>{B(a.value),"cron"===m?t(String(a.value)):r(String(a.value))},className:`px-2 py-1 text-xs rounded border transition-colors ${A===a.value?"border-brand bg-brand/10 text-brand":"border-border text-muted-foreground hover:text-foreground hover:border-foreground/30"}`,children:k(a.labelKey)},a.labelKey))})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-xs text-muted-foreground mb-1 block",children:"cron"===m?k("scheduledTasks.customCron"):k("scheduledTasks.customMinutes")}),"cron"===m?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("input",{type:"text",value:s,onChange:a=>{t(a.target.value),B(null)},placeholder:k("scheduledTasks.cronPlaceholder"),className:"w-full px-2 py-1.5 text-sm border border-border rounded bg-card text-foreground placeholder-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring font-mono"}),s.trim()&&(0,d.jsx)("div",{className:"mt-1 text-xs text-muted-foreground",children:function(a){let b=g.A.t,c=a.trim().split(/\s+/);if(5!==c.length)return null;let[d,e,f,h,i]=c,j={0:b("cron.dowSun"),1:b("cron.dowMon"),2:b("cron.dowTue"),3:b("cron.dowWed"),4:b("cron.dowThu"),5:b("cron.dowFri"),6:b("cron.dowSat")},k={1:`1${b("cron.monthPrefix")}`,2:`2${b("cron.monthPrefix")}`,3:`3${b("cron.monthPrefix")}`,4:`4${b("cron.monthPrefix")}`,5:`5${b("cron.monthPrefix")}`,6:`6${b("cron.monthPrefix")}`,7:`7${b("cron.monthPrefix")}`,8:`8${b("cron.monthPrefix")}`,9:`9${b("cron.monthPrefix")}`,10:`10${b("cron.monthPrefix")}`,11:`11${b("cron.monthPrefix")}`,12:`12${b("cron.monthPrefix")}`};try{let a="";if(d.includes("/")||e.includes("/")){if("*"===e&&d.includes("/"))return b("cron.everyNMinutes",{n:d.split("/")[1]});if("0"===d&&e.includes("/"))return b("cron.everyNHours",{n:e.split("/")[1]});return null}let c=parseInt(e,10),g=parseInt(d,10);if(isNaN(c)&&"*"!==e||isNaN(g)&&"*"!==d)return null;a="*"===e&&"*"===d?b("cron.everyMinute"):"*"===e?b("cron.everyHourAtMin",{m:g}):"*"===d?b("cron.hourlyEveryMin",{h:c}):`${String(c).padStart(2,"0")}:${String(g).padStart(2,"0")}`;let l=[];if("*"!==h){let a=h.split(",").map(a=>k[a]||`${a}${b("cron.monthPrefix")}`);l.push(a.join(", "))}if("*"!==f)if(f.includes("-")){let[a,c]=f.split("-");l.push(b("cron.dayRange",{a,b:c}))}else f.includes(",")?l.push(f.split(",").map(a=>`${a}${b("cron.dayOfMonth")}`).join(", ")):l.push(`${f}${b("cron.dayOfMonth")}`);if("*"!==i)if("1-5"===i)l.push(b("cron.weekdays"));else if("0,6"===i||"6,0"===i)l.push(b("cron.weekends"));else{let a=i.split(",").map(a=>{if(a.includes("-")){let[c,d]=a.split("-");return b("cron.weekdayRange",{a:j[c]||c,b:j[d]||d})}return`${b("cron.weekdayPrefix")}${j[a]||a}`});l.push(a.join(", "))}if(0===l.length&&"*"===f&&"*"===h&&"*"===i)return b("cron.daily",{time:a});return`${l.join(" ")} ${a}`}catch{return null}}(s.trim())||(0,d.jsx)("span",{className:"text-destructive",children:k("scheduledTasks.cronFormat")})})]}):(0,d.jsx)("input",{type:"number",value:q,onChange:a=>{r(a.target.value),B(null)},placeholder:k("scheduledTasks.minutesPlaceholder"),min:1,className:"w-full px-2 py-1.5 text-sm border border-border rounded bg-card text-foreground placeholder-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),"interval"===m&&(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"flex items-center gap-2 text-xs text-muted-foreground mb-1 cursor-pointer",children:[(0,d.jsx)("input",{type:"checkbox",checked:y,onChange:a=>z(a.target.checked),className:"rounded border-border"}),k("scheduledTasks.limitTimeRange")]}),y&&(0,d.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,d.jsx)("input",{type:"time",value:u,onChange:a=>v(a.target.value),className:"flex-1 px-2 py-1 text-sm border border-border rounded bg-card text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:k("scheduledTasks.to")}),(0,d.jsx)("input",{type:"time",value:w,onChange:a=>x(a.target.value),className:"flex-1 px-2 py-1 text-sm border border-border rounded bg-card text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]})]}),(0,d.jsx)("button",{onClick:E,disabled:!(o.trim()&&("once"===m||"interval"===m?!!(A||q&&parseInt(q,10)>0):"cron"===m&&!!(A||s.trim()))),className:"w-full py-1.5 text-sm font-medium rounded bg-brand text-white hover:bg-brand/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:l?k("scheduledTasks.saveBtn",{modKey:(0,h.Mu)()}):k("scheduledTasks.createBtn",{modKey:(0,h.Mu)()})})]})]})}},60306:(a,b,c)=>{c.d(b,{b:()=>k});var d=c(48249),e=c(67484),f=c(44384),g=c(3532),h=c(81749),i=c(30976),j=c(74955);function k({isOpen:a,onClose:b}){let{t:c,i18n:k}=(0,f.Bd)(),{theme:l,setTheme:m}=(0,g.D)(),n=(0,j.G)(),[o,p]=(0,e.useState)(""),[q,r]=(0,e.useState)(""),[s,t]=(0,e.useState)("auto"),u=(0,e.useCallback)(a=>{t(a),fetch("/api/settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({language:a})}).catch(()=>{});let b="auto"===a?navigator.language.startsWith("zh")?"zh":"en":a;k.changeLanguage(b)},[k]),v=n?"installed":"not-installed",w=n?.version??null;if(!a)return null;let x=[{value:"system",label:c("settings.themeSystem"),icon:"\uD83D\uDCBB"},{value:"light",label:c("settings.themeLight"),icon:"☀️"},{value:"dark",label:c("settings.themeDark"),icon:"\uD83C\uDF19"}];return(0,d.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,d.jsx)("div",{className:"absolute inset-0 bg-black/50",onClick:b}),(0,d.jsxs)("div",{className:"relative bg-card rounded-lg shadow-xl w-full max-w-md mx-4 overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[(0,d.jsx)("h2",{className:"text-sm font-medium text-foreground",children:c("settings.title")}),(0,d.jsx)("button",{onClick:b,className:"p-1 text-muted-foreground hover:text-foreground hover:bg-accent rounded transition-colors",children:(0,d.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,d.jsxs)("div",{className:"p-4 space-y-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:c("settings.theme")}),(0,d.jsx)("div",{className:"grid grid-cols-3 gap-2",children:x.map(a=>(0,d.jsxs)("button",{onClick:()=>m(a.value),className:`flex flex-col items-center gap-1 p-3 rounded-lg border transition-colors ${l===a.value?"border-brand bg-brand/10 text-brand":"border-border hover:border-slate-6 text-muted-foreground hover:text-foreground"}`,children:[(0,d.jsx)("span",{className:"text-xl",children:a.icon}),(0,d.jsx)("span",{className:"text-xs font-medium",children:a.label})]},a.value))})]}),(0,d.jsx)("div",{className:"border-t border-border"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:c("settings.language")}),(0,d.jsx)("div",{className:"grid grid-cols-3 gap-2",children:[{value:"auto",label:c("settings.languageAuto"),icon:"\uD83C\uDF10"},{value:"en",label:"English",icon:"\uD83C\uDDFA\uD83C\uDDF8"},{value:"zh",label:"中文",icon:"\uD83C\uDDE8\uD83C\uDDF3"}].map(a=>(0,d.jsxs)("button",{onClick:()=>u(a.value),className:`flex flex-col items-center gap-1 p-3 rounded-lg border transition-colors ${s===a.value?"border-brand bg-brand/10 text-brand":"border-border hover:border-slate-6 text-muted-foreground hover:text-foreground"}`,children:[(0,d.jsx)("span",{className:"text-xl",children:a.icon}),(0,d.jsx)("span",{className:"text-xs font-medium",children:a.label})]},a.value))})]}),(0,d.jsx)("div",{className:"border-t border-border"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:c("settings.browserExtension")}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,d.jsx)("span",{className:`inline-block w-2 h-2 rounded-full flex-shrink-0 ${"installed"===v?"bg-green-500":"bg-slate-400"}`}),(0,d.jsxs)("span",{children:["installed"===v&&`${c("settings.extensionInstalled")}${w?` (v${w})`:""}`,"not-installed"===v&&c("settings.extensionNotInstalled")]})]}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground leading-relaxed",children:c("settings.extensionDescription")}),"installed"!==v&&(0,d.jsxs)("div",{className:"text-xs text-muted-foreground bg-muted/50 rounded-md p-2 space-y-1",children:[(0,d.jsx)("p",{className:"font-medium text-foreground",children:c("settings.installSteps")}),(0,d.jsxs)("p",{children:[c("settings.step1")," ",(0,d.jsx)("code",{className:"px-1 py-0.5 bg-muted rounded text-foreground",children:"chrome://extensions"})]}),(0,d.jsx)("p",{children:c("settings.step2")}),(0,d.jsx)("p",{children:c("settings.step3")}),(0,i.L)()&&(0,d.jsx)("p",{dangerouslySetInnerHTML:{__html:c("settings.step4mac")}})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("button",{onClick:()=>{let a=o||"chrome-extension";navigator.clipboard.writeText(a),(0,h.oR)(c("toast.copiedName",{name:a}))},className:"px-3 py-1.5 text-xs bg-brand text-white rounded-md hover:bg-brand/90 transition-colors",children:c("settings.copyExtensionPath")}),"installed"===v&&(0,d.jsx)("button",{onClick:()=>{n?.id&&window.chrome?.runtime?.sendMessage&&(window.chrome.runtime.sendMessage(n.id,{type:"reload"}),(0,h.oR)(c("toast.pluginReloading")))},className:"px-3 py-1.5 text-xs border border-border text-foreground rounded-md hover:bg-muted transition-colors",children:c("settings.reloadExtension")})]}),o&&(0,d.jsx)("p",{className:"text-[11px] text-muted-foreground font-mono truncate",children:o})]})]}),(0,d.jsx)("div",{className:"border-t border-border"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:c("settings.about")}),(0,d.jsxs)("div",{className:"text-xs text-muted-foreground space-y-1",children:[(0,d.jsxs)("p",{children:["Cockpit",q?` v${q}`:""]}),(0,d.jsx)("p",{className:"text-muted-foreground/60",children:"One seat. One AI. Everything under control."})]})]})]})]})]})}},64874:(a,b,c)=>{c.d(b,{r:()=>g});var d=c(48249),e=c(67484),f=c(44384);function g({isOpen:a,onClose:b,onSelectSession:c,onAddProject:g}){let{t:h}=(0,f.Bd)(),[i,j]=(0,e.useState)(!1),[k,l]=(0,e.useState)([]),[m,n]=(0,e.useState)({}),[o,p]=(0,e.useState)(!1),[q,r]=(0,e.useState)(null),[s,t]=(0,e.useState)(""),u=(0,e.useRef)(null);(0,e.useCallback)(async()=>{p(!0),r(null),n({});try{let a=await fetch("/api/sessions/projects");if(!a.ok)throw Error("Failed to load projects");let b=await a.json();l(b)}catch(a){r(a instanceof Error?a.message:"Unknown error")}finally{p(!1)}},[]);let v=(0,e.useCallback)(async a=>{n(b=>({...b,[a]:{...b[a],isExpanded:!0,isLoading:!0,sessions:[],error:null}}));try{let b=await fetch(`/api/sessions/projects/${encodeURIComponent(a)}`);if(!b.ok)throw Error("Failed to load sessions");let c=await b.json();n(b=>({...b,[a]:{...b[a],isLoading:!1,sessions:c}}))}catch(b){n(c=>({...c,[a]:{...c[a],isLoading:!1,error:b instanceof Error?b.message:"Unknown error"}}))}},[]),w=(0,e.useCallback)(a=>{let b=m[a];b?.isExpanded?n(b=>({...b,[a]:{...b[a],isExpanded:!1}})):b?.sessions?.length?n(b=>({...b,[a]:{...b[a],isExpanded:!0}})):v(a)},[m,v]),x=(0,e.useCallback)(async()=>{if(!i){j(!0);try{let a=await fetch("/api/pick-folder"),c=await a.json();c.folder&&g&&(g(c.folder),b())}catch{}finally{j(!1)}}},[i,g,b]);return a?(0,d.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,d.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:b}),(0,d.jsxs)("div",{className:"relative w-full max-w-6xl h-[90vh] mx-4 bg-card rounded-lg shadow-xl flex flex-col overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[(0,d.jsx)("h2",{className:"text-sm font-medium text-foreground",children:h("sessions.projectList")}),(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("input",{ref:u,type:"text",placeholder:h("workspace.searchProjectPath"),value:s,onChange:a=>t(a.target.value),className:"px-2 py-1 text-xs border border-border rounded bg-card text-foreground placeholder-slate-9 focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent"}),g&&(0,d.jsxs)("button",{onClick:x,disabled:i,className:"flex items-center gap-1.5 px-2.5 py-1 text-xs rounded-md border border-border text-muted-foreground hover:text-foreground hover:bg-accent transition-colors disabled:opacity-50",title:h("sessions.openFolder"),children:[(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 10v6m3-3H9m-4 7h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})}),i?h("sessions.selectingFolder"):h("sessions.openFolder")]}),(0,d.jsx)("button",{onClick:b,className:"p-1 text-slate-9 hover:text-foreground hover:bg-accent rounded transition-colors",children:(0,d.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]}),(0,d.jsxs)("div",{className:"flex-1 overflow-y-auto p-4",children:[o&&(0,d.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,d.jsxs)("svg",{className:"animate-spin h-4 w-4",fill:"none",viewBox:"0 0 24 24",children:[(0,d.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,d.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),(0,d.jsx)("span",{children:h("workspace.loadingProjects")})]})}),q&&(0,d.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,d.jsx)("div",{className:"text-xs text-red-11",children:q})}),!o&&!q&&0===k.length&&(0,d.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,d.jsx)("div",{className:"text-xs text-muted-foreground",children:h("workspace.projectNotFound")})}),!o&&!q&&k.filter(a=>a.fullPath.toLowerCase().includes(s.toLowerCase())).map(a=>{let b=m[a.encodedPath]||{isExpanded:!1,isLoading:!1,sessions:[],error:null};return(0,d.jsxs)("div",{className:"mb-3",children:[(0,d.jsxs)("button",{onClick:()=>w(a.encodedPath),className:"w-full flex items-center gap-2 p-2 rounded hover:bg-accent transition-colors text-left",children:[(0,d.jsx)("svg",{className:`w-3 h-3 text-muted-foreground transition-transform ${b.isExpanded?"rotate-90":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,d.jsx)("svg",{className:"w-4 h-4 text-muted-foreground",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})}),(0,d.jsx)("span",{className:"flex-1 text-xs font-medium text-foreground truncate",title:a.fullPath,children:a.fullPath}),(0,d.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",a.sessionCount,")"]})]}),b.isExpanded&&(0,d.jsxs)("div",{className:"ml-6 mt-2",children:[b.isLoading&&(0,d.jsxs)("div",{className:"flex items-center gap-2 p-3 text-xs text-muted-foreground",children:[(0,d.jsxs)("svg",{className:"animate-spin h-3 w-3",fill:"none",viewBox:"0 0 24 24",children:[(0,d.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,d.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),(0,d.jsx)("span",{children:h("sessions.loadingSessions")})]}),b.error&&(0,d.jsx)("div",{className:"p-3 text-xs text-red-11",children:b.error}),!b.isLoading&&!b.error&&(0,d.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:b.sessions.map(b=>(0,d.jsxs)("div",{onClick:()=>{var d;let e;return d=a.fullPath,e=(b.path.split("/").pop()||"").replace(".jsonl",""),void(c?c(d,e):window.parent.postMessage({type:"OPEN_PROJECT",cwd:d,sessionId:e},"*"))},className:"p-3 bg-secondary rounded border border-border hover:border-brand hover:shadow-md cursor-pointer transition-all",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[b.engine&&"claude"!==b.engine&&(0,d.jsx)("span",{className:`shrink-0 px-1 py-0.5 text-[10px] leading-none font-medium rounded ${"claude2"===b.engine?"bg-orange-500/15 text-orange-11":"ollama"===b.engine?"bg-blue-500/15 text-blue-11":"codex"===b.engine?"bg-green-500/15 text-green-11":"kimi"===b.engine?"bg-purple-500/15 text-purple-11":"bg-muted text-muted-foreground"}`,children:b.engine}),(0,d.jsx)("h4",{className:"text-xs font-medium text-foreground truncate",title:b.title,children:b.title})]}),(0,d.jsx)("div",{className:"text-xs text-muted-foreground mb-2",children:new Date(b.modifiedAt).toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}),(0,d.jsxs)("div",{className:"space-y-0.5 text-xs",children:[b.firstMessages.map((a,b)=>(0,d.jsxs)("div",{className:"text-foreground truncate",title:a,children:[(0,d.jsx)("span",{className:"text-slate-9 mr-1",children:"•"}),a]},`first-${b}`)),b.lastMessages.length>0&&(0,d.jsx)("div",{className:"text-slate-9 text-center py-0.5",children:"\xb7\xb7\xb7"}),b.lastMessages.map((a,b)=>(0,d.jsxs)("div",{className:"text-foreground truncate",title:a,children:[(0,d.jsx)("span",{className:"text-slate-9 mr-1",children:"•"}),a]},`last-${b}`))]})]},b.path))})]})]},a.encodedPath)})]})]})]}):null}},74955:(a,b,c)=>{c.d(b,{G:()=>l,f:()=>m});var d=c(67484);function e(){if("u"<typeof document)return null;let a=document.querySelector('meta[name="cockpit-bridge"]');if(!a)return null;let b=a.dataset.id,c=a.dataset.version;return b?{id:b,version:c||"unknown"}:null}let f=null,g=new Set;function h(){g.forEach(a=>a())}function i(a){g.add(a);let b=e();return b&&!f&&(f=b,Promise.resolve().then(h)),()=>{g.delete(a)}}function j(){return f}function k(){return null}if("u">typeof document&&(f=e()),"u">typeof MutationObserver&&"u">typeof document){let a=new MutationObserver(()=>{let a=e();a&&(!f||a.id!==f.id||a.version!==f.version)&&(f=a,h())}),b=document.head||document.documentElement;b&&a.observe(b,{childList:!0})}function l(){return(0,d.useSyncExternalStore)(i,j,k)}function m(){return f??e()}}};
@@ -1 +1 @@
1
- "use strict";exports.id=7284,exports.ids=[7284],exports.modules={15622:(a,b,c)=>{c.d(b,{_:()=>k});var d=c(48249),e=c(67484),f=c(44384),g=c(31172),h=c(81749),i=c(41564);function j(a,b,c){let d=(a,c)=>b[a]||c,e=[],f=null!=c?`[${c+1}] `:"",g=a.anchor.selectedText.length>200?a.anchor.selectedText.slice(0,197)+"...":a.anchor.selectedText;for(let b of(e.push(`${f}${i.A.t("review.quoteRef",{text:g})}`),e.push(i.A.t("review.commentAuthor",{author:d(a.authorId,a.author),content:a.content})),a.replies))e.push(i.A.t("review.replyAuthor",{author:d(b.authorId,b.author),content:b.content}));return e.join("\n")}function k({isOpen:a,onClose:b,comments:c,reviewTitle:k,userNameMap:m,onCommentClick:n}){let{t:o}=(0,f.Bd)(),[p,q]=(0,e.useState)(null),[r,s]=(0,e.useState)(!1);if(!a)return null;let t=[...c].sort((a,b)=>a.anchor.startOffset-b.anchor.startOffset),u=(a,b)=>m[a]||b,v=async a=>{q(a.id);try{let b=j(a,m);await navigator.clipboard.writeText(b),(0,h.oR)(o("toast.copiedComment"))}catch{(0,h.oR)(o("toast.copyFailed"),"error")}finally{q(null)}},w=async()=>{if(0!==c.length){s(!0);try{let a=function(a,b,c){if(0===a.length)return"";let d=[...a].sort((a,b)=>a.anchor.startOffset-b.anchor.startOffset),e=[i.A.t("review.reviewSummary",{title:b}),""];return d.forEach((a,b)=>{e.push(j(a,c,b)),e.push("")}),e.push(i.A.t("review.totalNComments",{count:a.length})),e.join("\n").trim()}(c,k,m);await navigator.clipboard.writeText(a),(0,h.oR)(o("toast.copiedAllComments"))}catch{(0,h.oR)(o("toast.copyFailed"),"error")}finally{s(!1)}}},x=a=>{n?.(a),b()},y=t.filter(a=>!a.closed),z=t.filter(a=>a.closed),A=(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",onClick:b,children:(0,d.jsxs)("div",{className:"w-full max-w-2xl max-h-[80vh] bg-card border border-border rounded-lg shadow-xl flex flex-col overflow-hidden",onClick:a=>a.stopPropagation(),children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-secondary",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:o("review.allCommentsTitle")}),(0,d.jsxs)("span",{className:"text-xs text-muted-foreground",children:[o("review.commentsCountBrief",{count:c.length}),z.length>0&&` (${o("review.closedCount",{count:z.length})})`]}),c.length>0&&(0,d.jsx)("button",{onClick:w,disabled:r,className:"p-1 rounded hover:bg-accent text-muted-foreground disabled:opacity-50",title:o("review.copyAllComments"),children:r?(0,d.jsx)("span",{className:"inline-block w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin"}):(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})})]}),(0,d.jsx)("button",{onClick:b,className:"p-1 rounded hover:bg-accent text-muted-foreground",children:(0,d.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,d.jsx)("div",{className:"flex-1 overflow-y-auto p-3",children:0===c.length?(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[(0,d.jsx)("div",{className:"text-2xl mb-2",children:"\uD83D\uDCAC"}),(0,d.jsx)("span",{className:"text-sm",children:o("review.noComments")})]}):(0,d.jsxs)("div",{className:"space-y-2",children:[y.map((a,b)=>(0,d.jsx)(l,{comment:a,index:b,resolveAuthor:u,copyingId:p,onCopy:v,onClick:x},a.id)),z.length>0&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"text-[11px] text-muted-foreground/60 pt-2 pb-1 px-1",children:o("review.closedComments",{count:z.length})}),z.map((a,b)=>(0,d.jsx)(l,{comment:a,index:y.length+b,resolveAuthor:u,copyingId:p,onCopy:v,onClick:x,closed:!0},a.id))]})]})})]})});return(0,d.jsx)(g.Z,{children:A})}function l({comment:a,index:b,resolveAuthor:c,copyingId:e,onCopy:f,onClick:g,closed:h}){let j=a.anchor.selectedText.length>100?a.anchor.selectedText.slice(0,97)+"...":a.anchor.selectedText;return(0,d.jsxs)("div",{className:`rounded-lg border border-border hover:border-muted-foreground/30 transition-all cursor-pointer group ${h?"opacity-50":""}`,onClick:()=>g(a.id),children:[(0,d.jsx)("div",{className:"px-3 pt-2.5 pb-1",children:(0,d.jsx)("div",{className:"text-xs bg-yellow-500/10 border-l-2 border-yellow-500 px-2 py-1 rounded-r text-muted-foreground truncate",children:j})}),(0,d.jsxs)("div",{className:"px-3 pt-1.5 pb-2 flex items-start gap-2",children:[(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-0.5",children:[(0,d.jsx)("span",{className:"w-4 h-4 rounded-full bg-brand/20 text-brand flex items-center justify-center text-[9px] font-bold flex-shrink-0",children:c(a.authorId,a.author).charAt(0)}),(0,d.jsx)("span",{className:"text-xs font-medium",children:c(a.authorId,a.author)}),(0,d.jsx)("span",{className:"text-[10px] text-muted-foreground",children:new Date(a.createdAt).toLocaleString("zh-CN",{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})}),h&&(0,d.jsx)("span",{className:"text-[10px] text-muted-foreground/60",children:i.A.t("review.closedLabel")})]}),(0,d.jsx)("p",{className:"text-sm text-foreground line-clamp-2 pl-6",children:a.content}),a.replies.length>0&&(0,d.jsxs)("div",{className:"pl-6 mt-1 space-y-0.5",children:[a.replies.slice(0,3).map(a=>(0,d.jsxs)("div",{className:"text-xs text-muted-foreground truncate",children:[(0,d.jsx)("span",{className:"font-medium",children:c(a.authorId,a.author)}),": ",a.content]},a.id)),a.replies.length>3&&(0,d.jsx)("div",{className:"text-[10px] text-muted-foreground/60",children:i.A.t("review.moreReplies",{count:a.replies.length-3})})]})]}),(0,d.jsx)("button",{onClick:b=>{b.stopPropagation(),f(a)},disabled:e===a.id,className:"p-1 rounded opacity-0 group-hover:opacity-100 hover:bg-accent text-muted-foreground transition-opacity disabled:opacity-50 flex-shrink-0 mt-0.5",title:i.A.t("review.copyComment"),children:e===a.id?(0,d.jsx)("span",{className:"inline-block w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin"}):(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})})]})]})}},30068:(a,b,c)=>{c.d(b,{l:()=>h});var d=c(48249),e=c(67484),f=c(44384),g=c(69005);function h({content:a,containerRef:b,width:c="w-80"}){let{t:h}=(0,f.Bd)(),i=(0,e.useMemo)(()=>(function(a){let b=[],c=a.split("\n"),d=!1;for(let a=0;a<c.length;a++){let e=c[a];if(e.trimStart().startsWith("```")){d=!d;continue}if(d)continue;let f=/^(#{1,6})\s+(.+)$/.exec(e);f&&b.push({level:f[1].length,text:f[2].replace(/\s*#+\s*$/,""),sourceLine:a+1})}return b})(a),[a]),[j,k]=(0,e.useState)(!1),[l,m]=(0,e.useState)(null),n=(0,e.useCallback)(a=>{let c=b.current;if(!c)return;let d=c.querySelector(`h1[data-source-start="${a}"], h2[data-source-start="${a}"], h3[data-source-start="${a}"], h4[data-source-start="${a}"], h5[data-source-start="${a}"], h6[data-source-start="${a}"]`);d&&d.scrollIntoView({behavior:"smooth",block:"start"})},[b]);return 0===i.length?null:(0,d.jsxs)("div",{className:`border-r border-border flex-shrink-0 flex flex-col transition-[width] duration-200 ${j?"w-8":c}`,children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-2 py-1.5 border-b border-border flex-shrink-0",children:[!j&&(0,d.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:h("editor.toc")}),(0,d.jsx)("button",{onClick:()=>k(a=>!a),className:"p-0.5 text-muted-foreground hover:text-foreground hover:bg-accent rounded transition-colors",title:h(j?"editor.expandToc":"editor.collapseToc"),children:(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:j?(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"}):(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})})]}),!j&&(0,d.jsx)("nav",{className:"flex-1 overflow-y-auto py-1",children:i.map((a,b)=>(0,d.jsx)(g.m,{content:a.text,delay:400,children:(0,d.jsx)("button",{onClick:()=>n(a.sourceLine),className:`block w-full text-left text-sm py-1 px-2 truncate transition-colors hover:bg-accent ${l===a.sourceLine?"text-brand font-medium bg-brand/5":"text-muted-foreground"}`,style:{paddingLeft:`${(a.level-1)*12+8}px`},children:a.text})},b))})]})}},31172:(a,b,c)=>{c.d(b,{Z:()=>i});var d=c(67484),e=c(74429);let f=()=>()=>{},g=()=>document.body,h=()=>null;function i({children:a}){let b=(0,d.useSyncExternalStore)(f,g,h);return b?(0,e.createPortal)(a,b):null}},44741:(a,b,c)=>{c.d(b,{T:()=>z});var d=c(48249),e=c(98051),f=c(38368),g=c(33972),h=c(10841),i=c(99773),j=c(61003);c(55583),c(87023);var k=c(50757),l=c(27454),m=c(37752),n=c(67484),o=c(3532),p=c(74429),q=c(44384);function r({code:a,isDark:b}){let{t:c}=(0,q.Bd)(),[e,f]=(0,n.useState)("diagram"),[g,h]=(0,n.useState)(null),[i,j]=(0,n.useState)(null),[o,r]=(0,n.useState)(!1);return(0,n.useRef)(0),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"my-3 rounded-lg border border-border overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-end gap-1 px-3 py-1.5 border-b border-border",children:[(0,d.jsxs)(s,{active:"diagram"===e,onClick:()=>f("diagram"),children:[(0,d.jsx)("span",{className:"text-xs",children:"\uD83D\uDCCA"})," ",c("mermaid.chart")]}),(0,d.jsxs)(s,{active:"code"===e,onClick:()=>f("code"),children:[(0,d.jsx)("span",{className:"text-xs opacity-70",children:"</>"})," ",c("mermaid.code")]})]}),"diagram"===e?(0,d.jsx)("div",{className:"p-4",children:i?(0,d.jsxs)("div",{className:"flex items-start gap-2 p-3 rounded bg-red-500/10 border border-red-500/20 text-red-400 text-sm",children:[(0,d.jsx)("span",{className:"flex-shrink-0 mt-0.5",children:"⚠️"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"font-medium mb-1",children:c("mermaid.renderFailed")}),(0,d.jsx)("pre",{className:"text-xs opacity-80 whitespace-pre-wrap break-all",children:i})]})]}):g?(0,d.jsx)("div",{className:"mermaid-preview cursor-pointer hover:opacity-90 transition-opacity [&>svg]:max-w-full [&>svg]:max-h-[300px] [&>svg]:mx-auto",onClick:()=>r(!0),title:c("mermaid.clickToEnlarge"),dangerouslySetInnerHTML:{__html:g}}):(0,d.jsx)("div",{className:"flex items-center justify-center py-6 text-muted-foreground text-sm",children:c("mermaid.rendering")})}):(0,d.jsx)(k.A,{style:b?l.A:m.A,language:"mermaid",PreTag:"div",customStyle:{margin:0,borderRadius:0,fontSize:"0.875rem"},children:a})]}),o&&g&&(0,p.createPortal)((0,d.jsx)(t,{svgHtml:g,onClose:()=>r(!1)}),document.body)]})}function s({active:a,onClick:b,children:c}){return(0,d.jsx)("button",{onClick:b,className:`flex items-center gap-1.5 px-2.5 py-1 text-xs rounded transition-colors ${a?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground hover:bg-accent"}`,children:c})}function t({svgHtml:a,onClose:b}){let{t:c}=(0,q.Bd)();return(0,d.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,d.jsx)("div",{className:"absolute inset-0 bg-black/50",onClick:b}),(0,d.jsxs)("div",{className:"relative bg-card rounded-lg shadow-xl w-[96vw] h-[94vh] flex flex-col overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-4 py-2.5 border-b border-border flex-shrink-0",children:[(0,d.jsx)("h3",{className:"text-sm font-medium text-foreground",children:c("mermaid.mermaidChart")}),(0,d.jsx)("button",{onClick:b,className:"p-1 text-muted-foreground hover:text-foreground hover:bg-accent rounded transition-colors",title:c("mermaid.closeEsc"),children:(0,d.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,d.jsx)("div",{className:"flex-1 min-h-0 flex items-center justify-center p-6",children:(0,d.jsx)("div",{className:"w-full h-full flex items-center justify-center [&>svg]:max-w-full [&>svg]:max-h-full",dangerouslySetInnerHTML:{__html:a}})})]})]})}let u=[f.A,g.A,h.jb],v=[i.A,j.A];function w(a){return a.replace(/^(\|.+\|)$/gm,a=>/^\|[\s:|-]+\|$/.test(a)?a:a.replace(/`([^`]*)`/g,(a,b)=>b.includes("|")?"`"+b.replace(/\|/g,"\\|")+"`":a))}function x(a){return a.replace(/\$(\d)/g,"\\$$1")}function y(a,b){return{code({className:c,children:e,node:f,...g}){let h=/language-(\w+)/.exec(c||""),i=String(e);if(!h&&!c&&!i.includes("\n"))return(0,d.jsx)("code",{className:"px-1.5 py-0.5 mx-0.5 rounded bg-accent text-sm font-mono",...g,children:e});let j=String(e).replace(/\n$/,""),n=h?.[1]||"text";if("mermaid"===n&&!b)return(0,d.jsx)(r,{code:j,isDark:a});let o=Number(g["data-source-start"])||0,p=o?o+1:0,q=0;return(0,d.jsx)(k.A,{style:a?l.A:m.A,language:n,PreTag:"div",customStyle:{margin:"0.75rem 0",borderRadius:"0.375rem",fontSize:"0.875rem"},wrapLines:!0,lineProps:()=>{let a=p+q;return q++,{"data-source-start":a,"data-source-end":a,style:{display:"block"}}},children:j})},p:({children:a,node:b,...c})=>(0,d.jsx)("p",{className:"mb-3 last:mb-0",...c,children:a}),h1:({children:a,node:b,...c})=>(0,d.jsx)("h1",{className:"text-xl font-bold mb-3 mt-4 first:mt-0",...c,children:a}),h2:({children:a,node:b,...c})=>(0,d.jsx)("h2",{className:"text-lg font-bold mb-2 mt-3 first:mt-0",...c,children:a}),h3:({children:a,node:b,...c})=>(0,d.jsx)("h3",{className:"text-base font-bold mb-2 mt-3 first:mt-0",...c,children:a}),ul:({children:a,node:b,...c})=>(0,d.jsx)("ul",{className:"list-disc list-inside mb-3 space-y-1",...c,children:a}),ol:({children:a,node:b,...c})=>(0,d.jsx)("ol",{className:"list-decimal list-inside mb-3 space-y-1",...c,children:a}),li:({children:a,node:b,...c})=>(0,d.jsx)("li",{className:"leading-relaxed",...c,children:a}),blockquote:({children:a,node:b,...c})=>(0,d.jsx)("blockquote",{className:"border-l-4 border-border pl-4 my-3 italic text-muted-foreground",...c,children:a}),a:({href:a,children:b,node:c,...e})=>(0,d.jsx)("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"text-brand hover:underline",...e,children:b}),table:({children:a,node:b,...c})=>(0,d.jsx)("div",{className:"overflow-x-auto my-3",...c,children:(0,d.jsx)("table",{className:"min-w-full border border-border",children:a})}),thead:({children:a,node:b,...c})=>(0,d.jsx)("thead",{className:"bg-accent",...c,children:a}),th:({children:a,node:b,...c})=>(0,d.jsx)("th",{className:"px-4 py-2 text-left font-semibold border-b border-border",...c,children:a}),td:({children:a,node:b,...c})=>(0,d.jsx)("td",{className:"px-4 py-2 border-b border-border",...c,children:a}),hr:({node:a,...b})=>(0,d.jsx)("hr",{className:"my-4 border-border",...b}),img:({src:a,alt:b,node:c,height:e,width:f,style:g,...h})=>{if(!(e||f||g))return(0,d.jsx)("img",{src:a,alt:b||"",className:"max-w-full h-auto rounded-lg my-3",...h});let i=a=>a?/^\d+$/.test(String(a))?`${a}px`:String(a):void 0,j={...g,height:i(e)??g?.height,width:i(f)??g?.width};return(0,d.jsx)("img",{src:a,alt:b||"",style:j,className:"inline-block align-middle",...h})},strong:({children:a,node:b,...c})=>(0,d.jsx)("strong",{className:"font-bold",...c,children:a}),em:({children:a,node:b,...c})=>(0,d.jsx)("em",{className:"italic",...c,children:a}),del:({children:a,node:b,...c})=>(0,d.jsx)("del",{className:"line-through",...c,children:a})}}let z=(0,n.memo)(function({content:a,isUser:b=!1,isStreaming:c=!1,rehypePlugins:f}){let{resolvedTheme:g}=(0,o.D)(),h="dark"===g,i=(0,n.useMemo)(()=>y(h),[h]),j=(0,n.useMemo)(()=>y(h,!0),[h]),k=(0,n.useMemo)(()=>b||c?a:x(w(!function(a){if(/^\|[\s:|-]+\|$/m.test(a))return!1;if(/[┌┐└┘│─├┤┬┴┼╔╗╚╝║═╭╮╯╰▲▼◀▶△▽◁▷]/.test(a)||/\+[-=]{2,}\+/.test(a))return!0;let b=a.split("\n").filter(a=>/^\s*\||\|\s*$/.test(a));if(b.length>=3){let a=b.map(a=>(a.match(/\|/g)||[]).length);return!a.every(b=>b===a[0])||!(a[0]>=3)}return!1}(a)||/^```[\s\S]*```$/m.test(a.trim())?a:"```text\n"+a.trim()+"\n```")),[a,b,c]),l=(0,n.useMemo)(()=>f?.length?[...v,...f]:v,[f]);if(b)return(0,d.jsx)("div",{className:"whitespace-pre-wrap break-words",children:a});if(c){let b=a.lastIndexOf("\n");if(-1===b)return(0,d.jsx)("div",{className:"whitespace-pre-wrap break-words",children:a});let c=a.slice(0,b+1),f=a.slice(b+1);return(0,d.jsxs)("div",{className:"markdown-body",children:[(0,d.jsx)(e.oz,{remarkPlugins:u,rehypePlugins:v,components:j,children:x(w(c))}),f&&(0,d.jsx)("span",{className:"whitespace-pre-wrap",children:f})]})}return(0,d.jsx)("div",{className:"markdown-body",children:(0,d.jsx)(e.oz,{remarkPlugins:u,rehypePlugins:l,components:i,children:k})})})},69005:(a,b,c)=>{c.d(b,{m:()=>g});var d=c(48249),e=c(67484),f=c(74429);function g({content:a,children:b,delay:c=300,className:g=""}){let[h,i]=(0,e.useState)(!1),[j,k]=(0,e.useState)({top:0,left:0}),l=(0,e.useRef)(null),m=(0,e.useRef)({x:0,y:0}),n=(0,e.useRef)(null);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{onMouseEnter:()=>{l.current=setTimeout(()=>{let{x:a,y:b}=m.current;k({top:b+12,left:a}),i(!0)},c)},onMouseMove:a=>{m.current={x:a.clientX,y:a.clientY}},onMouseLeave:()=>{l.current&&(clearTimeout(l.current),l.current=null),i(!1)},className:g,children:b}),h&&(0,f.createPortal)((0,d.jsx)("div",{ref:n,className:"fixed z-[9999] px-2 py-1 text-xs text-foreground bg-accent rounded shadow-lg max-w-md break-words pointer-events-none",style:{top:j.top,left:j.left},children:a}),document.body)]})}},90500:(a,b,c)=>{c.d(b,{W:()=>f});var d=c(50300);let e=new Set(["p","h1","h2","h3","h4","h5","h6","li","blockquote","pre","table","tr","hr","div","ul","ol"]);function f(){return a=>{(0,d.YR)(a,"element",a=>{if(e.has(a.tagName)&&a.position&&(a.properties||(a.properties={}),a.properties["data-source-start"]=a.position.start.line,a.properties["data-source-end"]=a.position.end.line,"pre"===a.tagName)){let b=a.children?.find(a=>"element"===a.type&&"code"===a.tagName);b&&(b.properties||(b.properties={}),b.properties["data-source-start"]=a.position.start.line,b.properties["data-source-end"]=a.position.end.line)}})}}}};
1
+ "use strict";exports.id=7284,exports.ids=[7284],exports.modules={15622:(a,b,c)=>{c.d(b,{_:()=>k});var d=c(48249),e=c(67484),f=c(44384),g=c(31172),h=c(81749),i=c(41564);function j(a,b,c){let d=(a,c)=>b[a]||c,e=[],f=null!=c?`[${c+1}] `:"",g=a.anchor.selectedText.length>200?a.anchor.selectedText.slice(0,197)+"...":a.anchor.selectedText;for(let b of(e.push(`${f}${i.A.t("review.quoteRef",{text:g})}`),e.push(i.A.t("review.commentAuthor",{author:d(a.authorId,a.author),content:a.content})),a.replies))e.push(i.A.t("review.replyAuthor",{author:d(b.authorId,b.author),content:b.content}));return e.join("\n")}function k({isOpen:a,onClose:b,comments:c,reviewTitle:k,userNameMap:m,onCommentClick:n}){let{t:o}=(0,f.Bd)(),[p,q]=(0,e.useState)(null),[r,s]=(0,e.useState)(!1);if(!a)return null;let t=[...c].sort((a,b)=>a.anchor.startOffset-b.anchor.startOffset),u=(a,b)=>m[a]||b,v=async a=>{q(a.id);try{let b=j(a,m);await navigator.clipboard.writeText(b),(0,h.oR)(o("toast.copiedComment"))}catch{(0,h.oR)(o("toast.copyFailed"),"error")}finally{q(null)}},w=async()=>{if(0!==c.length){s(!0);try{let a=function(a,b,c){if(0===a.length)return"";let d=[...a].sort((a,b)=>a.anchor.startOffset-b.anchor.startOffset),e=[i.A.t("review.reviewSummary",{title:b}),""];return d.forEach((a,b)=>{e.push(j(a,c,b)),e.push("")}),e.push(i.A.t("review.totalNComments",{count:a.length})),e.join("\n").trim()}(c,k,m);await navigator.clipboard.writeText(a),(0,h.oR)(o("toast.copiedAllComments"))}catch{(0,h.oR)(o("toast.copyFailed"),"error")}finally{s(!1)}}},x=a=>{n?.(a),b()},y=t.filter(a=>!a.closed),z=t.filter(a=>a.closed),A=(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",onClick:b,children:(0,d.jsxs)("div",{className:"w-full max-w-2xl max-h-[80vh] bg-card border border-border rounded-lg shadow-xl flex flex-col overflow-hidden",onClick:a=>a.stopPropagation(),children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-secondary",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:o("review.allCommentsTitle")}),(0,d.jsxs)("span",{className:"text-xs text-muted-foreground",children:[o("review.commentsCountBrief",{count:c.length}),z.length>0&&` (${o("review.closedCount",{count:z.length})})`]}),c.length>0&&(0,d.jsx)("button",{onClick:w,disabled:r,className:"p-1 rounded hover:bg-accent text-muted-foreground disabled:opacity-50",title:o("review.copyAllComments"),children:r?(0,d.jsx)("span",{className:"inline-block w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin"}):(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})})]}),(0,d.jsx)("button",{onClick:b,className:"p-1 rounded hover:bg-accent text-muted-foreground",children:(0,d.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,d.jsx)("div",{className:"flex-1 overflow-y-auto p-3",children:0===c.length?(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[(0,d.jsx)("div",{className:"text-2xl mb-2",children:"\uD83D\uDCAC"}),(0,d.jsx)("span",{className:"text-sm",children:o("review.noComments")})]}):(0,d.jsxs)("div",{className:"space-y-2",children:[y.map((a,b)=>(0,d.jsx)(l,{comment:a,index:b,resolveAuthor:u,copyingId:p,onCopy:v,onClick:x},a.id)),z.length>0&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"text-[11px] text-muted-foreground/60 pt-2 pb-1 px-1",children:o("review.closedComments",{count:z.length})}),z.map((a,b)=>(0,d.jsx)(l,{comment:a,index:y.length+b,resolveAuthor:u,copyingId:p,onCopy:v,onClick:x,closed:!0},a.id))]})]})})]})});return(0,d.jsx)(g.Z,{children:A})}function l({comment:a,index:b,resolveAuthor:c,copyingId:e,onCopy:f,onClick:g,closed:h}){let j=a.anchor.selectedText.length>100?a.anchor.selectedText.slice(0,97)+"...":a.anchor.selectedText;return(0,d.jsxs)("div",{className:`rounded-lg border border-border hover:border-muted-foreground/30 transition-all cursor-pointer group ${h?"opacity-50":""}`,onClick:()=>g(a.id),children:[(0,d.jsx)("div",{className:"px-3 pt-2.5 pb-1",children:(0,d.jsx)("div",{className:"text-xs bg-yellow-500/10 border-l-2 border-yellow-500 px-2 py-1 rounded-r text-muted-foreground truncate",children:j})}),(0,d.jsxs)("div",{className:"px-3 pt-1.5 pb-2 flex items-start gap-2",children:[(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-0.5",children:[(0,d.jsx)("span",{className:"w-4 h-4 rounded-full bg-brand/20 text-brand flex items-center justify-center text-[9px] font-bold flex-shrink-0",children:c(a.authorId,a.author).charAt(0)}),(0,d.jsx)("span",{className:"text-xs font-medium",children:c(a.authorId,a.author)}),(0,d.jsx)("span",{className:"text-[10px] text-muted-foreground",children:new Date(a.createdAt).toLocaleString("zh-CN",{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})}),h&&(0,d.jsx)("span",{className:"text-[10px] text-muted-foreground/60",children:i.A.t("review.closedLabel")})]}),(0,d.jsx)("p",{className:"text-sm text-foreground line-clamp-2 pl-6",children:a.content}),a.replies.length>0&&(0,d.jsxs)("div",{className:"pl-6 mt-1 space-y-0.5",children:[a.replies.slice(0,3).map(a=>(0,d.jsxs)("div",{className:"text-xs text-muted-foreground truncate",children:[(0,d.jsx)("span",{className:"font-medium",children:c(a.authorId,a.author)}),": ",a.content]},a.id)),a.replies.length>3&&(0,d.jsx)("div",{className:"text-[10px] text-muted-foreground/60",children:i.A.t("review.moreReplies",{count:a.replies.length-3})})]})]}),(0,d.jsx)("button",{onClick:b=>{b.stopPropagation(),f(a)},disabled:e===a.id,className:"p-1 rounded opacity-0 group-hover:opacity-100 hover:bg-accent text-muted-foreground transition-opacity disabled:opacity-50 flex-shrink-0 mt-0.5",title:i.A.t("review.copyComment"),children:e===a.id?(0,d.jsx)("span",{className:"inline-block w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin"}):(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})})]})]})}},30068:(a,b,c)=>{c.d(b,{l:()=>h});var d=c(48249),e=c(67484),f=c(44384),g=c(69005);function h({content:a,containerRef:b,width:c="w-80"}){let{t:h}=(0,f.Bd)(),i=(0,e.useMemo)(()=>(function(a){let b=[],c=a.split("\n"),d=!1;for(let a=0;a<c.length;a++){let e=c[a];if(e.trimStart().startsWith("```")){d=!d;continue}if(d)continue;let f=/^(#{1,6})\s+(.+)$/.exec(e);f&&b.push({level:f[1].length,text:f[2].replace(/\s*#+\s*$/,""),sourceLine:a+1})}return b})(a),[a]),[j,k]=(0,e.useState)(!1),[l,m]=(0,e.useState)(null),n=(0,e.useCallback)(a=>{let c=b.current;if(!c)return;let d=c.querySelector(`h1[data-source-start="${a}"], h2[data-source-start="${a}"], h3[data-source-start="${a}"], h4[data-source-start="${a}"], h5[data-source-start="${a}"], h6[data-source-start="${a}"]`);d&&d.scrollIntoView({behavior:"smooth",block:"start"})},[b]);return 0===i.length?null:(0,d.jsxs)("div",{className:`border-r border-border flex-shrink-0 flex flex-col transition-[width] duration-200 ${j?"w-8":c}`,children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-2 py-1.5 border-b border-border flex-shrink-0",children:[!j&&(0,d.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:h("editor.toc")}),(0,d.jsx)("button",{onClick:()=>k(a=>!a),className:"p-0.5 text-muted-foreground hover:text-foreground hover:bg-accent rounded transition-colors",title:h(j?"editor.expandToc":"editor.collapseToc"),children:(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:j?(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"}):(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})})]}),!j&&(0,d.jsx)("nav",{className:"flex-1 overflow-y-auto py-1",children:i.map((a,b)=>(0,d.jsx)(g.m,{content:a.text,delay:400,children:(0,d.jsx)("button",{onClick:()=>n(a.sourceLine),className:`block w-full text-left text-sm py-1 px-2 truncate transition-colors hover:bg-accent ${l===a.sourceLine?"text-brand font-medium bg-brand/5":"text-muted-foreground"}`,style:{paddingLeft:`${(a.level-1)*12+8}px`},children:a.text})},b))})]})}},31172:(a,b,c)=>{c.d(b,{Z:()=>i});var d=c(67484),e=c(74429);let f=()=>()=>{},g=()=>document.body,h=()=>null;function i({children:a}){let b=(0,d.useSyncExternalStore)(f,g,h);return b?(0,e.createPortal)(a,b):null}},44741:(a,b,c)=>{c.d(b,{T:()=>B});var d=c(48249),e=c(98051),f=c(38368),g=c(33972),h=c(10841),i=c(99773),j=c(61003);c(55583),c(87023);var k=c(50757),l=c(27454),m=c(37752),n=c(67484),o=c(3532),p=c(74429),q=c(44384);function r({code:a,isDark:b}){let{t:c}=(0,q.Bd)(),[e,f]=(0,n.useState)("diagram"),[g,h]=(0,n.useState)(null),[i,j]=(0,n.useState)(null),[o,r]=(0,n.useState)(!1);return(0,n.useRef)(0),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"my-3 rounded-lg border border-border overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-end gap-1 px-3 py-1.5 border-b border-border",children:[(0,d.jsxs)(s,{active:"diagram"===e,onClick:()=>f("diagram"),children:[(0,d.jsx)("span",{className:"text-xs",children:"\uD83D\uDCCA"})," ",c("mermaid.chart")]}),(0,d.jsxs)(s,{active:"code"===e,onClick:()=>f("code"),children:[(0,d.jsx)("span",{className:"text-xs opacity-70",children:"</>"})," ",c("mermaid.code")]})]}),"diagram"===e?(0,d.jsx)("div",{className:"p-4",children:i?(0,d.jsxs)("div",{className:"flex items-start gap-2 p-3 rounded bg-red-500/10 border border-red-500/20 text-red-400 text-sm",children:[(0,d.jsx)("span",{className:"flex-shrink-0 mt-0.5",children:"⚠️"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"font-medium mb-1",children:c("mermaid.renderFailed")}),(0,d.jsx)("pre",{className:"text-xs opacity-80 whitespace-pre-wrap break-all",children:i})]})]}):g?(0,d.jsx)("div",{className:"mermaid-preview cursor-pointer hover:opacity-90 transition-opacity [&>svg]:max-w-full [&>svg]:max-h-[300px] [&>svg]:mx-auto",onClick:()=>r(!0),title:c("mermaid.clickToEnlarge"),dangerouslySetInnerHTML:{__html:g}}):(0,d.jsx)("div",{className:"flex items-center justify-center py-6 text-muted-foreground text-sm",children:c("mermaid.rendering")})}):(0,d.jsx)(k.A,{style:b?l.A:m.A,language:"mermaid",PreTag:"div",customStyle:{margin:0,borderRadius:0,fontSize:"0.875rem"},children:a})]}),o&&g&&(0,p.createPortal)((0,d.jsx)(t,{svgHtml:g,onClose:()=>r(!1)}),document.body)]})}function s({active:a,onClick:b,children:c}){return(0,d.jsx)("button",{onClick:b,className:`flex items-center gap-1.5 px-2.5 py-1 text-xs rounded transition-colors ${a?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground hover:bg-accent"}`,children:c})}function t({svgHtml:a,onClose:b}){let{t:c}=(0,q.Bd)();return(0,d.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,d.jsx)("div",{className:"absolute inset-0 bg-black/50",onClick:b}),(0,d.jsxs)("div",{className:"relative bg-card rounded-lg shadow-xl w-[96vw] h-[94vh] flex flex-col overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-4 py-2.5 border-b border-border flex-shrink-0",children:[(0,d.jsx)("h3",{className:"text-sm font-medium text-foreground",children:c("mermaid.mermaidChart")}),(0,d.jsx)("button",{onClick:b,className:"p-1 text-muted-foreground hover:text-foreground hover:bg-accent rounded transition-colors",title:c("mermaid.closeEsc"),children:(0,d.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,d.jsx)("div",{className:"flex-1 min-h-0 flex items-center justify-center p-6",children:(0,d.jsx)("div",{className:"w-full h-full flex items-center justify-center [&>svg]:max-w-full [&>svg]:max-h-full",dangerouslySetInnerHTML:{__html:a}})})]})]})}let u=[f.A,g.A,h.jb],v=[f.A,h.jb],w=[i.A,j.A],x=[i.A];function y(a){return a.replace(/^(\|.+\|)$/gm,a=>/^\|[\s:|-]+\|$/.test(a)?a:a.replace(/`([^`]*)`/g,(a,b)=>b.includes("|")?"`"+b.replace(/\|/g,"\\|")+"`":a))}function z(a){return a.replace(/\$(\d)/g,"\\$$1")}function A(a,b){return{code({className:c,children:e,node:f,...g}){let h=/language-(\w+)/.exec(c||""),i=String(e);if(!h&&!c&&!i.includes("\n"))return(0,d.jsx)("code",{className:"px-1.5 py-0.5 mx-0.5 rounded bg-accent text-sm font-mono",...g,children:e});let j=String(e).replace(/\n$/,""),n=h?.[1]||"text";if("mermaid"===n&&!b)return(0,d.jsx)(r,{code:j,isDark:a});let o=Number(g["data-source-start"])||0,p=o?o+1:0,q=0;return(0,d.jsx)(k.A,{style:a?l.A:m.A,language:n,PreTag:"div",customStyle:{margin:"0.75rem 0",borderRadius:"0.375rem",fontSize:"0.875rem"},wrapLines:!0,lineProps:()=>{let a=p+q;return q++,{"data-source-start":a,"data-source-end":a,style:{display:"block"}}},children:j})},p:({children:a,node:b,...c})=>(0,d.jsx)("p",{className:"mb-3 last:mb-0",...c,children:a}),h1:({children:a,node:b,...c})=>(0,d.jsx)("h1",{className:"text-xl font-bold mb-3 mt-4 first:mt-0",...c,children:a}),h2:({children:a,node:b,...c})=>(0,d.jsx)("h2",{className:"text-lg font-bold mb-2 mt-3 first:mt-0",...c,children:a}),h3:({children:a,node:b,...c})=>(0,d.jsx)("h3",{className:"text-base font-bold mb-2 mt-3 first:mt-0",...c,children:a}),ul:({children:a,node:b,...c})=>(0,d.jsx)("ul",{className:"list-disc list-inside mb-3 space-y-1",...c,children:a}),ol:({children:a,node:b,...c})=>(0,d.jsx)("ol",{className:"list-decimal list-inside mb-3 space-y-1",...c,children:a}),li:({children:a,node:b,...c})=>(0,d.jsx)("li",{className:"leading-relaxed",...c,children:a}),blockquote:({children:a,node:b,...c})=>(0,d.jsx)("blockquote",{className:"border-l-4 border-border pl-4 my-3 italic text-muted-foreground",...c,children:a}),a:({href:a,children:b,node:c,...e})=>(0,d.jsx)("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"text-brand hover:underline",...e,children:b}),table:({children:a,node:b,...c})=>(0,d.jsx)("div",{className:"overflow-x-auto my-3",...c,children:(0,d.jsx)("table",{className:"min-w-full border border-border",children:a})}),thead:({children:a,node:b,...c})=>(0,d.jsx)("thead",{className:"bg-accent",...c,children:a}),th:({children:a,node:b,...c})=>(0,d.jsx)("th",{className:"px-4 py-2 text-left font-semibold border-b border-border",...c,children:a}),td:({children:a,node:b,...c})=>(0,d.jsx)("td",{className:"px-4 py-2 border-b border-border",...c,children:a}),hr:({node:a,...b})=>(0,d.jsx)("hr",{className:"my-4 border-border",...b}),img:({src:a,alt:b,node:c,height:e,width:f,style:g,...h})=>{if(!(e||f||g))return(0,d.jsx)("img",{src:a,alt:b||"",className:"max-w-full h-auto rounded-lg my-3",...h});let i=a=>a?/^\d+$/.test(String(a))?`${a}px`:String(a):void 0,j={...g,height:i(e)??g?.height,width:i(f)??g?.width};return(0,d.jsx)("img",{src:a,alt:b||"",style:j,className:"inline-block align-middle",...h})},strong:({children:a,node:b,...c})=>(0,d.jsx)("strong",{className:"font-bold",...c,children:a}),em:({children:a,node:b,...c})=>(0,d.jsx)("em",{className:"italic",...c,children:a}),del:({children:a,node:b,...c})=>(0,d.jsx)("del",{className:"line-through",...c,children:a})}}let B=(0,n.memo)(function({content:a,isUser:b=!1,isStreaming:c=!1,enableMath:f=!0,rehypePlugins:g}){let{resolvedTheme:h}=(0,o.D)(),i="dark"===h,j=(0,n.useMemo)(()=>A(i),[i]),k=(0,n.useMemo)(()=>A(i,!0),[i]),l=f?u:v,m=f?w:x,p=(0,n.useMemo)(()=>{if(b||c)return a;let d=y(!function(a){if(/^\|[\s:|-]+\|$/m.test(a))return!1;if(/[┌┐└┘│─├┤┬┴┼╔╗╚╝║═╭╮╯╰▲▼◀▶△▽◁▷]/.test(a)||/\+[-=]{2,}\+/.test(a))return!0;let b=a.split("\n").filter(a=>/^\s*\||\|\s*$/.test(a));if(b.length>=3){let a=b.map(a=>(a.match(/\|/g)||[]).length);return!a.every(b=>b===a[0])||!(a[0]>=3)}return!1}(a)||/^```[\s\S]*```$/m.test(a.trim())?a:"```text\n"+a.trim()+"\n```");return f?z(d):d},[a,b,c,f]),q=(0,n.useMemo)(()=>g?.length?[...m,...g]:m,[g,m]);if(b)return(0,d.jsx)("div",{className:"whitespace-pre-wrap break-words",children:a});if(c){let b=a.lastIndexOf("\n");if(-1===b)return(0,d.jsx)("div",{className:"whitespace-pre-wrap break-words",children:a});let c=a.slice(0,b+1),g=a.slice(b+1);return(0,d.jsxs)("div",{className:"markdown-body",children:[(0,d.jsx)(e.oz,{remarkPlugins:l,rehypePlugins:m,components:k,children:f?z(y(c)):y(c)}),g&&(0,d.jsx)("span",{className:"whitespace-pre-wrap",children:g})]})}return(0,d.jsx)("div",{className:"markdown-body",children:(0,d.jsx)(e.oz,{remarkPlugins:l,rehypePlugins:q,components:j,children:p})})})},69005:(a,b,c)=>{c.d(b,{m:()=>g});var d=c(48249),e=c(67484),f=c(74429);function g({content:a,children:b,delay:c=300,className:g=""}){let[h,i]=(0,e.useState)(!1),[j,k]=(0,e.useState)({top:0,left:0}),l=(0,e.useRef)(null),m=(0,e.useRef)({x:0,y:0}),n=(0,e.useRef)(null);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{onMouseEnter:()=>{l.current=setTimeout(()=>{let{x:a,y:b}=m.current;k({top:b+12,left:a}),i(!0)},c)},onMouseMove:a=>{m.current={x:a.clientX,y:a.clientY}},onMouseLeave:()=>{l.current&&(clearTimeout(l.current),l.current=null),i(!1)},className:g,children:b}),h&&(0,f.createPortal)((0,d.jsx)("div",{ref:n,className:"fixed z-[9999] px-2 py-1 text-xs text-foreground bg-accent rounded shadow-lg max-w-md break-words pointer-events-none",style:{top:j.top,left:j.left},children:a}),document.body)]})}},90500:(a,b,c)=>{c.d(b,{W:()=>f});var d=c(50300);let e=new Set(["p","h1","h2","h3","h4","h5","h6","li","blockquote","pre","table","tr","hr","div","ul","ol"]);function f(){return a=>{(0,d.YR)(a,"element",a=>{if(e.has(a.tagName)&&a.position&&(a.properties||(a.properties={}),a.properties["data-source-start"]=a.position.start.line,a.properties["data-source-end"]=a.position.end.line,"pre"===a.tagName)){let b=a.children?.find(a=>"element"===a.type&&"code"===a.tagName);b&&(b.properties||(b.properties={}),b.properties["data-source-start"]=a.position.start.line,b.properties["data-source-end"]=a.position.end.line)}})}}}};
@@ -1,4 +1,4 @@
1
- <!DOCTYPE html><!--0mBqfZkcLM2Y1ikI9uxKG--><html lang="en" class="overflow-hidden"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" href="/_next/static/media/5c0c2bcbaa4149ca-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/bb3ef058b751a6ad-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/e4af272ccee01ff0-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/1573b510894a4234.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-0f527ee7ab644d02.js"/><script src="/_next/static/chunks/4bd1b696-e5d7c65570c947b7.js" async=""></script><script src="/_next/static/chunks/3794-337d1ca25ad99a89.js" async=""></script><script src="/_next/static/chunks/main-app-b76c0df33a946918.js" async=""></script><script src="/_next/static/chunks/9114-abef8471519b7dee.js" async=""></script><script src="/_next/static/chunks/3530-6d8abfd0e950d439.js" async=""></script><script src="/_next/static/chunks/app/layout-44210aade5d56585.js" async=""></script><script src="/_next/static/chunks/app/global-error-3c48d7d42c672863.js" async=""></script><meta name="robots" content="noindex"/><meta name="next-size-adjust" content=""/><title>404: This page could not be found.</title><meta name="theme-color" media="(prefers-color-scheme: light)" content="#f9f9fb"/><meta name="theme-color" media="(prefers-color-scheme: dark)" content="#111113"/><title>Cockpit</title><meta name="description" content="One seat. One AI. Everything under control."/><link rel="manifest" href="/manifest.webmanifest"/><meta name="mobile-web-app-capable" content="yes"/><meta name="apple-mobile-web-app-title" content="Cockpit"/><meta name="apple-mobile-web-app-status-bar-style" content="default"/><link rel="icon" href="/favicon.ico?603d046c9a6fdfbb" type="image/x-icon" sizes="16x16"/><link rel="icon" href="/icons/icon-192x192.png"/><link rel="apple-touch-icon" href="/icons/icon-192x192.png"/><script>
1
+ <!DOCTYPE html><!--_gYuZ_hBlVHw7RvEBSdgN--><html lang="en" class="overflow-hidden"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" href="/_next/static/media/5c0c2bcbaa4149ca-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/bb3ef058b751a6ad-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/e4af272ccee01ff0-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/bbd65867698c479b.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-0f527ee7ab644d02.js"/><script src="/_next/static/chunks/4bd1b696-e5d7c65570c947b7.js" async=""></script><script src="/_next/static/chunks/3794-337d1ca25ad99a89.js" async=""></script><script src="/_next/static/chunks/main-app-b76c0df33a946918.js" async=""></script><script src="/_next/static/chunks/9114-abef8471519b7dee.js" async=""></script><script src="/_next/static/chunks/3530-6d8abfd0e950d439.js" async=""></script><script src="/_next/static/chunks/app/layout-44210aade5d56585.js" async=""></script><script src="/_next/static/chunks/app/global-error-3c48d7d42c672863.js" async=""></script><meta name="robots" content="noindex"/><meta name="next-size-adjust" content=""/><title>404: This page could not be found.</title><meta name="theme-color" media="(prefers-color-scheme: light)" content="#f9f9fb"/><meta name="theme-color" media="(prefers-color-scheme: dark)" content="#111113"/><title>Cockpit</title><meta name="description" content="One seat. One AI. Everything under control."/><link rel="manifest" href="/manifest.webmanifest"/><meta name="mobile-web-app-capable" content="yes"/><meta name="apple-mobile-web-app-title" content="Cockpit"/><meta name="apple-mobile-web-app-status-bar-style" content="default"/><link rel="icon" href="/favicon.ico?603d046c9a6fdfbb" type="image/x-icon" sizes="16x16"/><link rel="icon" href="/icons/icon-192x192.png"/><link rel="apple-touch-icon" href="/icons/icon-192x192.png"/><script>
2
2
  (function() {
3
3
  try {
4
4
  var theme = localStorage.getItem('theme') || 'dark';
@@ -15,4 +15,4 @@
15
15
  });
16
16
  }
17
17
  })();
18
- </script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="__variable_f367f3 __variable_c1a059 __variable_3c557b antialiased overflow-hidden"><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><div class="fixed bottom-4 right-4 z-[100] flex flex-col gap-2"></div><script src="/_next/static/chunks/webpack-0f527ee7ab644d02.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[83599,[\"9114\",\"static/chunks/9114-abef8471519b7dee.js\",\"3530\",\"static/chunks/3530-6d8abfd0e950d439.js\",\"7177\",\"static/chunks/app/layout-44210aade5d56585.js\"],\"Providers\"]\n3:I[57121,[],\"\"]\n4:I[74581,[],\"\"]\n5:I[90484,[],\"OutletBoundary\"]\n6:\"$Sreact.suspense\"\n8:I[90484,[],\"ViewportBoundary\"]\na:I[90484,[],\"MetadataBoundary\"]\nc:I[26719,[\"4219\",\"static/chunks/app/global-error-3c48d7d42c672863.js\"],\"default\"]\n:HL[\"/_next/static/media/5c0c2bcbaa4149ca-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n:HL[\"/_next/static/media/bb3ef058b751a6ad-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n:HL[\"/_next/static/media/e4af272ccee01ff0-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n:HL[\"/_next/static/css/1573b510894a4234.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"0mBqfZkcLM2Y1ikI9uxKG\",\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/1573b510894a4234.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"className\":\"overflow-hidden\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n (function() {\\n try {\\n var theme = localStorage.getItem('theme') || 'dark';\\n var resolved = theme;\\n if (theme === 'system') {\\n resolved = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\\n }\\n document.documentElement.classList.add(resolved);\\n } catch (e) {}\\n // Unregister any leftover Service Workers (PWA has been removed)\\n if ('serviceWorker' in navigator) {\\n navigator.serviceWorker.getRegistrations().then(function(regs) {\\n regs.forEach(function(r) { r.unregister(); });\\n });\\n }\\n })();\\n \"}}]}],[\"$\",\"body\",null,{\"className\":\"__variable_f367f3 __variable_c1a059 __variable_3c557b antialiased overflow-hidden\",\"children\":[\"$\",\"$L2\",null,{\"children\":[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}]]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L5\",null,{\"children\":[\"$\",\"$6\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@7\"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$6\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true}\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"2\",{\"name\":\"theme-color\",\"media\":\"(prefers-color-scheme: light)\",\"content\":\"#f9f9fb\"}],[\"$\",\"meta\",\"3\",{\"name\":\"theme-color\",\"media\":\"(prefers-color-scheme: dark)\",\"content\":\"#111113\"}]]\n"])</script><script>self.__next_f.push([1,"d:I[86869,[],\"IconMark\"]\n7:null\nb:[[\"$\",\"title\",\"0\",{\"children\":\"Cockpit\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"One seat. One AI. Everything under control.\"}],[\"$\",\"link\",\"2\",{\"rel\":\"manifest\",\"href\":\"/manifest.webmanifest\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"meta\",\"3\",{\"name\":\"mobile-web-app-capable\",\"content\":\"yes\"}],[\"$\",\"meta\",\"4\",{\"name\":\"apple-mobile-web-app-title\",\"content\":\"Cockpit\"}],[\"$\",\"meta\",\"5\",{\"name\":\"apple-mobile-web-app-status-bar-style\",\"content\":\"default\"}],[\"$\",\"link\",\"6\",{\"rel\":\"icon\",\"href\":\"/favicon.ico?603d046c9a6fdfbb\",\"type\":\"image/x-icon\",\"sizes\":\"16x16\"}],[\"$\",\"link\",\"7\",{\"rel\":\"icon\",\"href\":\"/icons/icon-192x192.png\"}],[\"$\",\"link\",\"8\",{\"rel\":\"apple-touch-icon\",\"href\":\"/icons/icon-192x192.png\"}],[\"$\",\"$Ld\",\"9\",{}]]\n"])</script></body></html>
18
+ </script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="__variable_f367f3 __variable_c1a059 __variable_3c557b antialiased overflow-hidden"><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><div class="fixed bottom-4 right-4 z-[100] flex flex-col gap-2"></div><script src="/_next/static/chunks/webpack-0f527ee7ab644d02.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[83599,[\"9114\",\"static/chunks/9114-abef8471519b7dee.js\",\"3530\",\"static/chunks/3530-6d8abfd0e950d439.js\",\"7177\",\"static/chunks/app/layout-44210aade5d56585.js\"],\"Providers\"]\n3:I[57121,[],\"\"]\n4:I[74581,[],\"\"]\n5:I[90484,[],\"OutletBoundary\"]\n6:\"$Sreact.suspense\"\n8:I[90484,[],\"ViewportBoundary\"]\na:I[90484,[],\"MetadataBoundary\"]\nc:I[26719,[\"4219\",\"static/chunks/app/global-error-3c48d7d42c672863.js\"],\"default\"]\n:HL[\"/_next/static/media/5c0c2bcbaa4149ca-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n:HL[\"/_next/static/media/bb3ef058b751a6ad-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n:HL[\"/_next/static/media/e4af272ccee01ff0-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n:HL[\"/_next/static/css/bbd65867698c479b.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"_gYuZ_hBlVHw7RvEBSdgN\",\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/bbd65867698c479b.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"className\":\"overflow-hidden\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n (function() {\\n try {\\n var theme = localStorage.getItem('theme') || 'dark';\\n var resolved = theme;\\n if (theme === 'system') {\\n resolved = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\\n }\\n document.documentElement.classList.add(resolved);\\n } catch (e) {}\\n // Unregister any leftover Service Workers (PWA has been removed)\\n if ('serviceWorker' in navigator) {\\n navigator.serviceWorker.getRegistrations().then(function(regs) {\\n regs.forEach(function(r) { r.unregister(); });\\n });\\n }\\n })();\\n \"}}]}],[\"$\",\"body\",null,{\"className\":\"__variable_f367f3 __variable_c1a059 __variable_3c557b antialiased overflow-hidden\",\"children\":[\"$\",\"$L2\",null,{\"children\":[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}]]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L5\",null,{\"children\":[\"$\",\"$6\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@7\"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$6\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true}\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"2\",{\"name\":\"theme-color\",\"media\":\"(prefers-color-scheme: light)\",\"content\":\"#f9f9fb\"}],[\"$\",\"meta\",\"3\",{\"name\":\"theme-color\",\"media\":\"(prefers-color-scheme: dark)\",\"content\":\"#111113\"}]]\n"])</script><script>self.__next_f.push([1,"d:I[86869,[],\"IconMark\"]\n7:null\nb:[[\"$\",\"title\",\"0\",{\"children\":\"Cockpit\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"One seat. One AI. Everything under control.\"}],[\"$\",\"link\",\"2\",{\"rel\":\"manifest\",\"href\":\"/manifest.webmanifest\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"meta\",\"3\",{\"name\":\"mobile-web-app-capable\",\"content\":\"yes\"}],[\"$\",\"meta\",\"4\",{\"name\":\"apple-mobile-web-app-title\",\"content\":\"Cockpit\"}],[\"$\",\"meta\",\"5\",{\"name\":\"apple-mobile-web-app-status-bar-style\",\"content\":\"default\"}],[\"$\",\"link\",\"6\",{\"rel\":\"icon\",\"href\":\"/favicon.ico?603d046c9a6fdfbb\",\"type\":\"image/x-icon\",\"sizes\":\"16x16\"}],[\"$\",\"link\",\"7\",{\"rel\":\"icon\",\"href\":\"/icons/icon-192x192.png\"}],[\"$\",\"link\",\"8\",{\"rel\":\"apple-touch-icon\",\"href\":\"/icons/icon-192x192.png\"}],[\"$\",\"$Ld\",\"9\",{}]]\n"])</script></body></html>
@@ -1,2 +1,2 @@
1
- <!DOCTYPE html><!--0mBqfZkcLM2Y1ikI9uxKG--><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-0f527ee7ab644d02.js"/><script src="/_next/static/chunks/4bd1b696-e5d7c65570c947b7.js" async=""></script><script src="/_next/static/chunks/3794-337d1ca25ad99a89.js" async=""></script><script src="/_next/static/chunks/main-app-b76c0df33a946918.js" async=""></script><script src="/_next/static/chunks/app/global-error-3c48d7d42c672863.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: Internal Server Error.</title><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}
2
- @media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-0f527ee7ab644d02.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[57121,[],\"\"]\n3:I[74581,[],\"\"]\n4:I[90484,[],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n7:I[90484,[],\"ViewportBoundary\"]\n9:I[90484,[],\"MetadataBoundary\"]\nb:I[26719,[\"4219\",\"static/chunks/app/global-error-3c48d7d42c672863.js\"],\"default\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"0mBqfZkcLM2Y1ikI9uxKG\",\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"_global-error\",{\"children\":[\"__PAGE__\",{}]}]}],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"title\",null,{\"children\":\"500: Internal Server Error.\"}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"lineHeight\":\"48px\"},\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}\\n@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"paddingRight\":23,\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\"},\"children\":\"500\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"28px\"},\"children\":\"Internal Server Error.\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L7\",null,{\"children\":\"$L8\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$L9\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$La\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$b\",[]],\"S\":true}\n"])</script><script>self.__next_f.push([1,"8:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"6:null\na:[]\n"])</script></body></html>
1
+ <!DOCTYPE html><!--_gYuZ_hBlVHw7RvEBSdgN--><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-0f527ee7ab644d02.js"/><script src="/_next/static/chunks/4bd1b696-e5d7c65570c947b7.js" async=""></script><script src="/_next/static/chunks/3794-337d1ca25ad99a89.js" async=""></script><script src="/_next/static/chunks/main-app-b76c0df33a946918.js" async=""></script><script src="/_next/static/chunks/app/global-error-3c48d7d42c672863.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: Internal Server Error.</title><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}
2
+ @media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-0f527ee7ab644d02.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[57121,[],\"\"]\n3:I[74581,[],\"\"]\n4:I[90484,[],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n7:I[90484,[],\"ViewportBoundary\"]\n9:I[90484,[],\"MetadataBoundary\"]\nb:I[26719,[\"4219\",\"static/chunks/app/global-error-3c48d7d42c672863.js\"],\"default\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"_gYuZ_hBlVHw7RvEBSdgN\",\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"_global-error\",{\"children\":[\"__PAGE__\",{}]}]}],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"title\",null,{\"children\":\"500: Internal Server Error.\"}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"lineHeight\":\"48px\"},\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}\\n@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"paddingRight\":23,\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\"},\"children\":\"500\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"28px\"},\"children\":\"Internal Server Error.\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L7\",null,{\"children\":\"$L8\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$L9\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$La\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$b\",[]],\"S\":true}\n"])</script><script>self.__next_f.push([1,"8:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"6:null\na:[]\n"])</script></body></html>
@@ -1 +1 @@
1
- {"node":{},"edge":{},"encryptionKey":"Ko78oqNr6QDV+9AIK0f5faWk+4FJS8AJ5pqybpLLMj0="}
1
+ {"node":{},"edge":{},"encryptionKey":"wF+HbFBnW/R+h5sn77uMns5zH1ieDiYA4Wy8yJ1e5IU="}
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1593],{24750:(e,t,r)=>{r.d(t,{_:()=>c});var n=r(95155),s=r(12115),l=r(79114),o=r(44810),a=r(38093),i=r(87918);function d(e,t,r){let n=(e,r)=>t[e]||r,s=[],l=null!=r?`[${r+1}] `:"",o=e.anchor.selectedText.length>200?e.anchor.selectedText.slice(0,197)+"...":e.anchor.selectedText;for(let t of(s.push(`${l}${i.A.t("review.quoteRef",{text:o})}`),s.push(i.A.t("review.commentAuthor",{author:n(e.authorId,e.author),content:e.content})),e.replies))s.push(i.A.t("review.replyAuthor",{author:n(t.authorId,t.author),content:t.content}));return s.join("\n")}function c({isOpen:e,onClose:t,comments:r,reviewTitle:c,userNameMap:m,onCommentClick:h}){let{t:x}=(0,l.Bd)(),[p,f]=(0,s.useState)(null),[g,b]=(0,s.useState)(!1);if(!e)return null;let v=[...r].sort((e,t)=>e.anchor.startOffset-t.anchor.startOffset),j=(e,t)=>m[e]||t,y=async e=>{f(e.id);try{let t=d(e,m);await navigator.clipboard.writeText(t),(0,a.oR)(x("toast.copiedComment"))}catch{(0,a.oR)(x("toast.copyFailed"),"error")}finally{f(null)}},N=async()=>{if(0!==r.length){b(!0);try{let e=function(e,t,r){if(0===e.length)return"";let n=[...e].sort((e,t)=>e.anchor.startOffset-t.anchor.startOffset),s=[i.A.t("review.reviewSummary",{title:t}),""];return n.forEach((e,t)=>{s.push(d(e,r,t)),s.push("")}),s.push(i.A.t("review.totalNComments",{count:e.length})),s.join("\n").trim()}(r,c,m);await navigator.clipboard.writeText(e),(0,a.oR)(x("toast.copiedAllComments"))}catch{(0,a.oR)(x("toast.copyFailed"),"error")}finally{b(!1)}}},w=e=>{h?.(e),t()},k=v.filter(e=>!e.closed),C=v.filter(e=>e.closed),L=(0,n.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",onClick:t,children:(0,n.jsxs)("div",{className:"w-full max-w-2xl max-h-[80vh] bg-card border border-border rounded-lg shadow-xl flex flex-col overflow-hidden",onClick:e=>e.stopPropagation(),children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-secondary",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:x("review.allCommentsTitle")}),(0,n.jsxs)("span",{className:"text-xs text-muted-foreground",children:[x("review.commentsCountBrief",{count:r.length}),C.length>0&&` (${x("review.closedCount",{count:C.length})})`]}),r.length>0&&(0,n.jsx)("button",{onClick:N,disabled:g,className:"p-1 rounded hover:bg-accent text-muted-foreground disabled:opacity-50",title:x("review.copyAllComments"),children:g?(0,n.jsx)("span",{className:"inline-block w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin"}):(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})})]}),(0,n.jsx)("button",{onClick:t,className:"p-1 rounded hover:bg-accent text-muted-foreground",children:(0,n.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsx)("div",{className:"flex-1 overflow-y-auto p-3",children:0===r.length?(0,n.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[(0,n.jsx)("div",{className:"text-2xl mb-2",children:"\uD83D\uDCAC"}),(0,n.jsx)("span",{className:"text-sm",children:x("review.noComments")})]}):(0,n.jsxs)("div",{className:"space-y-2",children:[k.map((e,t)=>(0,n.jsx)(u,{comment:e,index:t,resolveAuthor:j,copyingId:p,onCopy:y,onClick:w},e.id)),C.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"text-[11px] text-muted-foreground/60 pt-2 pb-1 px-1",children:x("review.closedComments",{count:C.length})}),C.map((e,t)=>(0,n.jsx)(u,{comment:e,index:k.length+t,resolveAuthor:j,copyingId:p,onCopy:y,onClick:w,closed:!0},e.id))]})]})})]})});return(0,n.jsx)(o.Z,{children:L})}function u({comment:e,index:t,resolveAuthor:r,copyingId:s,onCopy:l,onClick:o,closed:a}){let d=e.anchor.selectedText.length>100?e.anchor.selectedText.slice(0,97)+"...":e.anchor.selectedText;return(0,n.jsxs)("div",{className:`rounded-lg border border-border hover:border-muted-foreground/30 transition-all cursor-pointer group ${a?"opacity-50":""}`,onClick:()=>o(e.id),children:[(0,n.jsx)("div",{className:"px-3 pt-2.5 pb-1",children:(0,n.jsx)("div",{className:"text-xs bg-yellow-500/10 border-l-2 border-yellow-500 px-2 py-1 rounded-r text-muted-foreground truncate",children:d})}),(0,n.jsxs)("div",{className:"px-3 pt-1.5 pb-2 flex items-start gap-2",children:[(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 mb-0.5",children:[(0,n.jsx)("span",{className:"w-4 h-4 rounded-full bg-brand/20 text-brand flex items-center justify-center text-[9px] font-bold flex-shrink-0",children:r(e.authorId,e.author).charAt(0)}),(0,n.jsx)("span",{className:"text-xs font-medium",children:r(e.authorId,e.author)}),(0,n.jsx)("span",{className:"text-[10px] text-muted-foreground",children:new Date(e.createdAt).toLocaleString("zh-CN",{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})}),a&&(0,n.jsx)("span",{className:"text-[10px] text-muted-foreground/60",children:i.A.t("review.closedLabel")})]}),(0,n.jsx)("p",{className:"text-sm text-foreground line-clamp-2 pl-6",children:e.content}),e.replies.length>0&&(0,n.jsxs)("div",{className:"pl-6 mt-1 space-y-0.5",children:[e.replies.slice(0,3).map(e=>(0,n.jsxs)("div",{className:"text-xs text-muted-foreground truncate",children:[(0,n.jsx)("span",{className:"font-medium",children:r(e.authorId,e.author)}),": ",e.content]},e.id)),e.replies.length>3&&(0,n.jsx)("div",{className:"text-[10px] text-muted-foreground/60",children:i.A.t("review.moreReplies",{count:e.replies.length-3})})]})]}),(0,n.jsx)("button",{onClick:t=>{t.stopPropagation(),l(e)},disabled:s===e.id,className:"p-1 rounded opacity-0 group-hover:opacity-100 hover:bg-accent text-muted-foreground transition-opacity disabled:opacity-50 flex-shrink-0 mt-0.5",title:i.A.t("review.copyComment"),children:s===e.id?(0,n.jsx)("span",{className:"inline-block w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin"}):(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})})]})]})}},26108:(e,t,r)=>{r.d(t,{T:()=>$});var n=r(95155),s=r(46361),l=r(79204),o=r(98164),a=r(77815),i=r(75035),d=r(88374);r(84559),r(21227);var c=r(91334),u=r(38194),m=r(88522),h=r(12115),x=r(72816),p=r(47650),f=r(79114);let g=null,b=null;async function v(){return g||(b||(b=Promise.all([r.e(221),r.e(8776)]).then(r.bind(r,28776)).then(e=>g=e.default)),b)}function j({code:e,isDark:t}){let{t:r}=(0,f.Bd)(),[s,l]=(0,h.useState)("diagram"),[o,a]=(0,h.useState)(null),[i,d]=(0,h.useState)(null),[x,g]=(0,h.useState)(!1),b=(0,h.useRef)(0);return(0,h.useEffect)(()=>{let r=!1,n=`mermaid-${Math.random().toString(36).slice(2,9)}-${++b.current}`;return async function(){try{let s=await v();s.initialize({startOnLoad:!1,theme:t?"dark":"default",securityLevel:"loose"});let{svg:l}=await s.render(n,e);r||(a(l),d(null))}catch(e){r||(d(e instanceof Error?e.message:String(e)),a(null))}}(),()=>{r=!0}},[e,t]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"my-3 rounded-lg border border-border overflow-hidden",children:[(0,n.jsxs)("div",{className:"flex items-center justify-end gap-1 px-3 py-1.5 border-b border-border",children:[(0,n.jsxs)(y,{active:"diagram"===s,onClick:()=>l("diagram"),children:[(0,n.jsx)("span",{className:"text-xs",children:"\uD83D\uDCCA"})," ",r("mermaid.chart")]}),(0,n.jsxs)(y,{active:"code"===s,onClick:()=>l("code"),children:[(0,n.jsx)("span",{className:"text-xs opacity-70",children:"</>"})," ",r("mermaid.code")]})]}),"diagram"===s?(0,n.jsx)("div",{className:"p-4",children:i?(0,n.jsxs)("div",{className:"flex items-start gap-2 p-3 rounded bg-red-500/10 border border-red-500/20 text-red-400 text-sm",children:[(0,n.jsx)("span",{className:"flex-shrink-0 mt-0.5",children:"⚠️"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"font-medium mb-1",children:r("mermaid.renderFailed")}),(0,n.jsx)("pre",{className:"text-xs opacity-80 whitespace-pre-wrap break-all",children:i})]})]}):o?(0,n.jsx)("div",{className:"mermaid-preview cursor-pointer hover:opacity-90 transition-opacity [&>svg]:max-w-full [&>svg]:max-h-[300px] [&>svg]:mx-auto",onClick:()=>g(!0),title:r("mermaid.clickToEnlarge"),dangerouslySetInnerHTML:{__html:o}}):(0,n.jsx)("div",{className:"flex items-center justify-center py-6 text-muted-foreground text-sm",children:r("mermaid.rendering")})}):(0,n.jsx)(c.A,{style:t?u.A:m.A,language:"mermaid",PreTag:"div",customStyle:{margin:0,borderRadius:0,fontSize:"0.875rem"},children:e})]}),x&&o&&(0,p.createPortal)((0,n.jsx)(N,{svgHtml:o,onClose:()=>g(!1)}),document.body)]})}function y({active:e,onClick:t,children:r}){return(0,n.jsx)("button",{onClick:t,className:`flex items-center gap-1.5 px-2.5 py-1 text-xs rounded transition-colors ${e?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground hover:bg-accent"}`,children:r})}function N({svgHtml:e,onClose:t}){let{t:r}=(0,f.Bd)();return(0,h.useEffect)(()=>{let e=e=>{"Escape"===e.key&&t()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t]),(0,n.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,n.jsx)("div",{className:"absolute inset-0 bg-black/50",onClick:t}),(0,n.jsxs)("div",{className:"relative bg-card rounded-lg shadow-xl w-[96vw] h-[94vh] flex flex-col overflow-hidden",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-4 py-2.5 border-b border-border flex-shrink-0",children:[(0,n.jsx)("h3",{className:"text-sm font-medium text-foreground",children:r("mermaid.mermaidChart")}),(0,n.jsx)("button",{onClick:t,className:"p-1 text-muted-foreground hover:text-foreground hover:bg-accent rounded transition-colors",title:r("mermaid.closeEsc"),children:(0,n.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsx)("div",{className:"flex-1 min-h-0 flex items-center justify-center p-6",children:(0,n.jsx)("div",{className:"w-full h-full flex items-center justify-center [&>svg]:max-w-full [&>svg]:max-h-full",dangerouslySetInnerHTML:{__html:e}})})]})]})}let w=[l.A,o.A,a.jb],k=[i.A,d.A];function C(e){return e.replace(/^(\|.+\|)$/gm,e=>/^\|[\s:|-]+\|$/.test(e)?e:e.replace(/`([^`]*)`/g,(e,t)=>t.includes("|")?"`"+t.replace(/\|/g,"\\|")+"`":e))}function L(e){return e.replace(/\$(\d)/g,"\\$$1")}function S(e,t){return{code({className:r,children:s,node:l,...o}){let a=/language-(\w+)/.exec(r||""),i=String(s);if(!a&&!r&&!i.includes("\n"))return(0,n.jsx)("code",{className:"px-1.5 py-0.5 mx-0.5 rounded bg-accent text-sm font-mono",...o,children:s});let d=String(s).replace(/\n$/,""),h=a?.[1]||"text";if("mermaid"===h&&!t)return(0,n.jsx)(j,{code:d,isDark:e});let x=Number(o["data-source-start"])||0,p=x?x+1:0,f=0;return(0,n.jsx)(c.A,{style:e?u.A:m.A,language:h,PreTag:"div",customStyle:{margin:"0.75rem 0",borderRadius:"0.375rem",fontSize:"0.875rem"},wrapLines:!0,lineProps:()=>{let e=p+f;return f++,{"data-source-start":e,"data-source-end":e,style:{display:"block"}}},children:d})},p:({children:e,node:t,...r})=>(0,n.jsx)("p",{className:"mb-3 last:mb-0",...r,children:e}),h1:({children:e,node:t,...r})=>(0,n.jsx)("h1",{className:"text-xl font-bold mb-3 mt-4 first:mt-0",...r,children:e}),h2:({children:e,node:t,...r})=>(0,n.jsx)("h2",{className:"text-lg font-bold mb-2 mt-3 first:mt-0",...r,children:e}),h3:({children:e,node:t,...r})=>(0,n.jsx)("h3",{className:"text-base font-bold mb-2 mt-3 first:mt-0",...r,children:e}),ul:({children:e,node:t,...r})=>(0,n.jsx)("ul",{className:"list-disc list-inside mb-3 space-y-1",...r,children:e}),ol:({children:e,node:t,...r})=>(0,n.jsx)("ol",{className:"list-decimal list-inside mb-3 space-y-1",...r,children:e}),li:({children:e,node:t,...r})=>(0,n.jsx)("li",{className:"leading-relaxed",...r,children:e}),blockquote:({children:e,node:t,...r})=>(0,n.jsx)("blockquote",{className:"border-l-4 border-border pl-4 my-3 italic text-muted-foreground",...r,children:e}),a:({href:e,children:t,node:r,...s})=>(0,n.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-brand hover:underline",...s,children:t}),table:({children:e,node:t,...r})=>(0,n.jsx)("div",{className:"overflow-x-auto my-3",...r,children:(0,n.jsx)("table",{className:"min-w-full border border-border",children:e})}),thead:({children:e,node:t,...r})=>(0,n.jsx)("thead",{className:"bg-accent",...r,children:e}),th:({children:e,node:t,...r})=>(0,n.jsx)("th",{className:"px-4 py-2 text-left font-semibold border-b border-border",...r,children:e}),td:({children:e,node:t,...r})=>(0,n.jsx)("td",{className:"px-4 py-2 border-b border-border",...r,children:e}),hr:({node:e,...t})=>(0,n.jsx)("hr",{className:"my-4 border-border",...t}),img:({src:e,alt:t,node:r,height:s,width:l,style:o,...a})=>{if(!(s||l||o))return(0,n.jsx)("img",{src:e,alt:t||"",className:"max-w-full h-auto rounded-lg my-3",...a});let i=e=>e?/^\d+$/.test(String(e))?`${e}px`:String(e):void 0,d={...o,height:i(s)??o?.height,width:i(l)??o?.width};return(0,n.jsx)("img",{src:e,alt:t||"",style:d,className:"inline-block align-middle",...a})},strong:({children:e,node:t,...r})=>(0,n.jsx)("strong",{className:"font-bold",...r,children:e}),em:({children:e,node:t,...r})=>(0,n.jsx)("em",{className:"italic",...r,children:e}),del:({children:e,node:t,...r})=>(0,n.jsx)("del",{className:"line-through",...r,children:e})}}let $=(0,h.memo)(function({content:e,isUser:t=!1,isStreaming:r=!1,rehypePlugins:l}){let{resolvedTheme:o}=(0,x.D)(),a="dark"===o,i=(0,h.useMemo)(()=>S(a),[a]),d=(0,h.useMemo)(()=>S(a,!0),[a]),c=(0,h.useMemo)(()=>t||r?e:L(C(!function(e){if(/^\|[\s:|-]+\|$/m.test(e))return!1;if(/[┌┐└┘│─├┤┬┴┼╔╗╚╝║═╭╮╯╰▲▼◀▶△▽◁▷]/.test(e)||/\+[-=]{2,}\+/.test(e))return!0;let t=e.split("\n").filter(e=>/^\s*\||\|\s*$/.test(e));if(t.length>=3){let e=t.map(e=>(e.match(/\|/g)||[]).length);return!e.every(t=>t===e[0])||!(e[0]>=3)}return!1}(e)||/^```[\s\S]*```$/m.test(e.trim())?e:"```text\n"+e.trim()+"\n```")),[e,t,r]),u=(0,h.useMemo)(()=>l?.length?[...k,...l]:k,[l]);if(t)return(0,n.jsx)("div",{className:"whitespace-pre-wrap break-words",children:e});if(r){let t=e.lastIndexOf("\n");if(-1===t)return(0,n.jsx)("div",{className:"whitespace-pre-wrap break-words",children:e});let r=e.slice(0,t+1),l=e.slice(t+1);return(0,n.jsxs)("div",{className:"markdown-body",children:[(0,n.jsx)(s.oz,{remarkPlugins:w,rehypePlugins:k,components:d,children:L(C(r))}),l&&(0,n.jsx)("span",{className:"whitespace-pre-wrap",children:l})]})}return(0,n.jsx)("div",{className:"markdown-body",children:(0,n.jsx)(s.oz,{remarkPlugins:w,rehypePlugins:u,components:i,children:c})})})},44810:(e,t,r)=>{r.d(t,{Z:()=>i});var n=r(12115),s=r(47650);let l=()=>()=>{},o=()=>document.body,a=()=>null;function i({children:e}){let t=(0,n.useSyncExternalStore)(l,o,a);return t?(0,s.createPortal)(e,t):null}},80777:(e,t,r)=>{r.d(t,{m:()=>o});var n=r(95155),s=r(12115),l=r(47650);function o({content:e,children:t,delay:r=300,className:o=""}){let[a,i]=(0,s.useState)(!1),[d,c]=(0,s.useState)({top:0,left:0}),u=(0,s.useRef)(null),m=(0,s.useRef)({x:0,y:0}),h=(0,s.useRef)(null);return(0,s.useEffect)(()=>{if(a&&h.current){let e=h.current.getBoundingClientRect(),t=d.left,r=d.top;e.right>window.innerWidth-8&&(t=window.innerWidth-e.width-8),e.left<8&&(t=8),e.bottom>window.innerHeight-8&&(r=m.current.y-e.height-8),(t!==d.left||r!==d.top)&&queueMicrotask(()=>c({top:r,left:t}))}},[a,d.left,d.top]),(0,s.useEffect)(()=>()=>{u.current&&clearTimeout(u.current)},[]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{onMouseEnter:()=>{u.current=setTimeout(()=>{let{x:e,y:t}=m.current;c({top:t+12,left:e}),i(!0)},r)},onMouseMove:e=>{m.current={x:e.clientX,y:e.clientY}},onMouseLeave:()=>{u.current&&(clearTimeout(u.current),u.current=null),i(!1)},className:o,children:t}),a&&(0,l.createPortal)((0,n.jsx)("div",{ref:h,className:"fixed z-[9999] px-2 py-1 text-xs text-foreground bg-accent rounded shadow-lg max-w-md break-words pointer-events-none",style:{top:d.top,left:d.left},children:e}),document.body)]})}},94002:(e,t,r)=>{r.d(t,{l:()=>i});var n=r(95155),s=r(12115),l=r(79114),o=r(80777);let a=e=>`h1[data-source-start="${e}"], h2[data-source-start="${e}"], h3[data-source-start="${e}"], h4[data-source-start="${e}"], h5[data-source-start="${e}"], h6[data-source-start="${e}"]`;function i({content:e,containerRef:t,width:r="w-80"}){let{t:i}=(0,l.Bd)(),d=(0,s.useMemo)(()=>(function(e){let t=[],r=e.split("\n"),n=!1;for(let e=0;e<r.length;e++){let s=r[e];if(s.trimStart().startsWith("```")){n=!n;continue}if(n)continue;let l=/^(#{1,6})\s+(.+)$/.exec(s);l&&t.push({level:l[1].length,text:l[2].replace(/\s*#+\s*$/,""),sourceLine:e+1})}return t})(e),[e]),[c,u]=(0,s.useState)(!1),[m,h]=(0,s.useState)(null),x=(0,s.useCallback)(e=>{let r=t.current;if(!r)return;let n=r.querySelector(a(e));n&&n.scrollIntoView({behavior:"smooth",block:"start"})},[t]);return((0,s.useEffect)(()=>{let e=t.current;if(!e||0===d.length)return;let r=()=>{let t=[];for(let r of d){let n=e.querySelector(a(r.sourceLine));if(n){let s=n.getBoundingClientRect().top-e.getBoundingClientRect().top;t.push({line:r.sourceLine,top:s})}}let r=null;for(let e of t)e.top<=60&&(r=e.line);null===r&&t.length>0&&(r=t[0].line),h(r)},n=setTimeout(r,150);return e.addEventListener("scroll",r,{passive:!0}),()=>{clearTimeout(n),e.removeEventListener("scroll",r)}},[d,e,t]),0===d.length)?null:(0,n.jsxs)("div",{className:`border-r border-border flex-shrink-0 flex flex-col transition-[width] duration-200 ${c?"w-8":r}`,children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-2 py-1.5 border-b border-border flex-shrink-0",children:[!c&&(0,n.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:i("editor.toc")}),(0,n.jsx)("button",{onClick:()=>u(e=>!e),className:"p-0.5 text-muted-foreground hover:text-foreground hover:bg-accent rounded transition-colors",title:i(c?"editor.expandToc":"editor.collapseToc"),children:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c?(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"}):(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})})]}),!c&&(0,n.jsx)("nav",{className:"flex-1 overflow-y-auto py-1",children:d.map((e,t)=>(0,n.jsx)(o.m,{content:e.text,delay:400,children:(0,n.jsx)("button",{onClick:()=>x(e.sourceLine),className:`block w-full text-left text-sm py-1 px-2 truncate transition-colors hover:bg-accent ${m===e.sourceLine?"text-brand font-medium bg-brand/5":"text-muted-foreground"}`,style:{paddingLeft:`${(e.level-1)*12+8}px`},children:e.text})},t))})]})}},95766:(e,t,r)=>{r.d(t,{W:()=>l});var n=r(48250);let s=new Set(["p","h1","h2","h3","h4","h5","h6","li","blockquote","pre","table","tr","hr","div","ul","ol"]);function l(){return e=>{(0,n.YR)(e,"element",e=>{if(s.has(e.tagName)&&e.position&&(e.properties||(e.properties={}),e.properties["data-source-start"]=e.position.start.line,e.properties["data-source-end"]=e.position.end.line,"pre"===e.tagName)){let t=e.children?.find(e=>"element"===e.type&&"code"===e.tagName);t&&(t.properties||(t.properties={}),t.properties["data-source-start"]=e.position.start.line,t.properties["data-source-end"]=e.position.end.line)}})}}}}]);
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1593],{24750:(e,t,r)=>{r.d(t,{_:()=>c});var n=r(95155),s=r(12115),l=r(79114),o=r(44810),a=r(38093),i=r(87918);function d(e,t,r){let n=(e,r)=>t[e]||r,s=[],l=null!=r?`[${r+1}] `:"",o=e.anchor.selectedText.length>200?e.anchor.selectedText.slice(0,197)+"...":e.anchor.selectedText;for(let t of(s.push(`${l}${i.A.t("review.quoteRef",{text:o})}`),s.push(i.A.t("review.commentAuthor",{author:n(e.authorId,e.author),content:e.content})),e.replies))s.push(i.A.t("review.replyAuthor",{author:n(t.authorId,t.author),content:t.content}));return s.join("\n")}function c({isOpen:e,onClose:t,comments:r,reviewTitle:c,userNameMap:m,onCommentClick:h}){let{t:x}=(0,l.Bd)(),[p,f]=(0,s.useState)(null),[g,b]=(0,s.useState)(!1);if(!e)return null;let v=[...r].sort((e,t)=>e.anchor.startOffset-t.anchor.startOffset),j=(e,t)=>m[e]||t,y=async e=>{f(e.id);try{let t=d(e,m);await navigator.clipboard.writeText(t),(0,a.oR)(x("toast.copiedComment"))}catch{(0,a.oR)(x("toast.copyFailed"),"error")}finally{f(null)}},N=async()=>{if(0!==r.length){b(!0);try{let e=function(e,t,r){if(0===e.length)return"";let n=[...e].sort((e,t)=>e.anchor.startOffset-t.anchor.startOffset),s=[i.A.t("review.reviewSummary",{title:t}),""];return n.forEach((e,t)=>{s.push(d(e,r,t)),s.push("")}),s.push(i.A.t("review.totalNComments",{count:e.length})),s.join("\n").trim()}(r,c,m);await navigator.clipboard.writeText(e),(0,a.oR)(x("toast.copiedAllComments"))}catch{(0,a.oR)(x("toast.copyFailed"),"error")}finally{b(!1)}}},w=e=>{h?.(e),t()},k=v.filter(e=>!e.closed),C=v.filter(e=>e.closed),L=(0,n.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",onClick:t,children:(0,n.jsxs)("div",{className:"w-full max-w-2xl max-h-[80vh] bg-card border border-border rounded-lg shadow-xl flex flex-col overflow-hidden",onClick:e=>e.stopPropagation(),children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-secondary",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:x("review.allCommentsTitle")}),(0,n.jsxs)("span",{className:"text-xs text-muted-foreground",children:[x("review.commentsCountBrief",{count:r.length}),C.length>0&&` (${x("review.closedCount",{count:C.length})})`]}),r.length>0&&(0,n.jsx)("button",{onClick:N,disabled:g,className:"p-1 rounded hover:bg-accent text-muted-foreground disabled:opacity-50",title:x("review.copyAllComments"),children:g?(0,n.jsx)("span",{className:"inline-block w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin"}):(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})})]}),(0,n.jsx)("button",{onClick:t,className:"p-1 rounded hover:bg-accent text-muted-foreground",children:(0,n.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsx)("div",{className:"flex-1 overflow-y-auto p-3",children:0===r.length?(0,n.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[(0,n.jsx)("div",{className:"text-2xl mb-2",children:"\uD83D\uDCAC"}),(0,n.jsx)("span",{className:"text-sm",children:x("review.noComments")})]}):(0,n.jsxs)("div",{className:"space-y-2",children:[k.map((e,t)=>(0,n.jsx)(u,{comment:e,index:t,resolveAuthor:j,copyingId:p,onCopy:y,onClick:w},e.id)),C.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"text-[11px] text-muted-foreground/60 pt-2 pb-1 px-1",children:x("review.closedComments",{count:C.length})}),C.map((e,t)=>(0,n.jsx)(u,{comment:e,index:k.length+t,resolveAuthor:j,copyingId:p,onCopy:y,onClick:w,closed:!0},e.id))]})]})})]})});return(0,n.jsx)(o.Z,{children:L})}function u({comment:e,index:t,resolveAuthor:r,copyingId:s,onCopy:l,onClick:o,closed:a}){let d=e.anchor.selectedText.length>100?e.anchor.selectedText.slice(0,97)+"...":e.anchor.selectedText;return(0,n.jsxs)("div",{className:`rounded-lg border border-border hover:border-muted-foreground/30 transition-all cursor-pointer group ${a?"opacity-50":""}`,onClick:()=>o(e.id),children:[(0,n.jsx)("div",{className:"px-3 pt-2.5 pb-1",children:(0,n.jsx)("div",{className:"text-xs bg-yellow-500/10 border-l-2 border-yellow-500 px-2 py-1 rounded-r text-muted-foreground truncate",children:d})}),(0,n.jsxs)("div",{className:"px-3 pt-1.5 pb-2 flex items-start gap-2",children:[(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 mb-0.5",children:[(0,n.jsx)("span",{className:"w-4 h-4 rounded-full bg-brand/20 text-brand flex items-center justify-center text-[9px] font-bold flex-shrink-0",children:r(e.authorId,e.author).charAt(0)}),(0,n.jsx)("span",{className:"text-xs font-medium",children:r(e.authorId,e.author)}),(0,n.jsx)("span",{className:"text-[10px] text-muted-foreground",children:new Date(e.createdAt).toLocaleString("zh-CN",{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})}),a&&(0,n.jsx)("span",{className:"text-[10px] text-muted-foreground/60",children:i.A.t("review.closedLabel")})]}),(0,n.jsx)("p",{className:"text-sm text-foreground line-clamp-2 pl-6",children:e.content}),e.replies.length>0&&(0,n.jsxs)("div",{className:"pl-6 mt-1 space-y-0.5",children:[e.replies.slice(0,3).map(e=>(0,n.jsxs)("div",{className:"text-xs text-muted-foreground truncate",children:[(0,n.jsx)("span",{className:"font-medium",children:r(e.authorId,e.author)}),": ",e.content]},e.id)),e.replies.length>3&&(0,n.jsx)("div",{className:"text-[10px] text-muted-foreground/60",children:i.A.t("review.moreReplies",{count:e.replies.length-3})})]})]}),(0,n.jsx)("button",{onClick:t=>{t.stopPropagation(),l(e)},disabled:s===e.id,className:"p-1 rounded opacity-0 group-hover:opacity-100 hover:bg-accent text-muted-foreground transition-opacity disabled:opacity-50 flex-shrink-0 mt-0.5",title:i.A.t("review.copyComment"),children:s===e.id?(0,n.jsx)("span",{className:"inline-block w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin"}):(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})})]})]})}},26108:(e,t,r)=>{r.d(t,{T:()=>T});var n=r(95155),s=r(46361),l=r(79204),o=r(98164),a=r(77815),i=r(75035),d=r(88374);r(84559),r(21227);var c=r(91334),u=r(38194),m=r(88522),h=r(12115),x=r(72816),p=r(47650),f=r(79114);let g=null,b=null;async function v(){return g||(b||(b=Promise.all([r.e(221),r.e(8776)]).then(r.bind(r,28776)).then(e=>g=e.default)),b)}function j({code:e,isDark:t}){let{t:r}=(0,f.Bd)(),[s,l]=(0,h.useState)("diagram"),[o,a]=(0,h.useState)(null),[i,d]=(0,h.useState)(null),[x,g]=(0,h.useState)(!1),b=(0,h.useRef)(0);return(0,h.useEffect)(()=>{let r=!1,n=`mermaid-${Math.random().toString(36).slice(2,9)}-${++b.current}`;return async function(){try{let s=await v();s.initialize({startOnLoad:!1,theme:t?"dark":"default",securityLevel:"loose"});let{svg:l}=await s.render(n,e);r||(a(l),d(null))}catch(e){r||(d(e instanceof Error?e.message:String(e)),a(null))}}(),()=>{r=!0}},[e,t]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"my-3 rounded-lg border border-border overflow-hidden",children:[(0,n.jsxs)("div",{className:"flex items-center justify-end gap-1 px-3 py-1.5 border-b border-border",children:[(0,n.jsxs)(y,{active:"diagram"===s,onClick:()=>l("diagram"),children:[(0,n.jsx)("span",{className:"text-xs",children:"\uD83D\uDCCA"})," ",r("mermaid.chart")]}),(0,n.jsxs)(y,{active:"code"===s,onClick:()=>l("code"),children:[(0,n.jsx)("span",{className:"text-xs opacity-70",children:"</>"})," ",r("mermaid.code")]})]}),"diagram"===s?(0,n.jsx)("div",{className:"p-4",children:i?(0,n.jsxs)("div",{className:"flex items-start gap-2 p-3 rounded bg-red-500/10 border border-red-500/20 text-red-400 text-sm",children:[(0,n.jsx)("span",{className:"flex-shrink-0 mt-0.5",children:"⚠️"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"font-medium mb-1",children:r("mermaid.renderFailed")}),(0,n.jsx)("pre",{className:"text-xs opacity-80 whitespace-pre-wrap break-all",children:i})]})]}):o?(0,n.jsx)("div",{className:"mermaid-preview cursor-pointer hover:opacity-90 transition-opacity [&>svg]:max-w-full [&>svg]:max-h-[300px] [&>svg]:mx-auto",onClick:()=>g(!0),title:r("mermaid.clickToEnlarge"),dangerouslySetInnerHTML:{__html:o}}):(0,n.jsx)("div",{className:"flex items-center justify-center py-6 text-muted-foreground text-sm",children:r("mermaid.rendering")})}):(0,n.jsx)(c.A,{style:t?u.A:m.A,language:"mermaid",PreTag:"div",customStyle:{margin:0,borderRadius:0,fontSize:"0.875rem"},children:e})]}),x&&o&&(0,p.createPortal)((0,n.jsx)(N,{svgHtml:o,onClose:()=>g(!1)}),document.body)]})}function y({active:e,onClick:t,children:r}){return(0,n.jsx)("button",{onClick:t,className:`flex items-center gap-1.5 px-2.5 py-1 text-xs rounded transition-colors ${e?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground hover:bg-accent"}`,children:r})}function N({svgHtml:e,onClose:t}){let{t:r}=(0,f.Bd)();return(0,h.useEffect)(()=>{let e=e=>{"Escape"===e.key&&t()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t]),(0,n.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,n.jsx)("div",{className:"absolute inset-0 bg-black/50",onClick:t}),(0,n.jsxs)("div",{className:"relative bg-card rounded-lg shadow-xl w-[96vw] h-[94vh] flex flex-col overflow-hidden",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-4 py-2.5 border-b border-border flex-shrink-0",children:[(0,n.jsx)("h3",{className:"text-sm font-medium text-foreground",children:r("mermaid.mermaidChart")}),(0,n.jsx)("button",{onClick:t,className:"p-1 text-muted-foreground hover:text-foreground hover:bg-accent rounded transition-colors",title:r("mermaid.closeEsc"),children:(0,n.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsx)("div",{className:"flex-1 min-h-0 flex items-center justify-center p-6",children:(0,n.jsx)("div",{className:"w-full h-full flex items-center justify-center [&>svg]:max-w-full [&>svg]:max-h-full",dangerouslySetInnerHTML:{__html:e}})})]})]})}let w=[l.A,o.A,a.jb],k=[l.A,a.jb],C=[i.A,d.A],L=[i.A];function S(e){return e.replace(/^(\|.+\|)$/gm,e=>/^\|[\s:|-]+\|$/.test(e)?e:e.replace(/`([^`]*)`/g,(e,t)=>t.includes("|")?"`"+t.replace(/\|/g,"\\|")+"`":e))}function $(e){return e.replace(/\$(\d)/g,"\\$$1")}function A(e,t){return{code({className:r,children:s,node:l,...o}){let a=/language-(\w+)/.exec(r||""),i=String(s);if(!a&&!r&&!i.includes("\n"))return(0,n.jsx)("code",{className:"px-1.5 py-0.5 mx-0.5 rounded bg-accent text-sm font-mono",...o,children:s});let d=String(s).replace(/\n$/,""),h=a?.[1]||"text";if("mermaid"===h&&!t)return(0,n.jsx)(j,{code:d,isDark:e});let x=Number(o["data-source-start"])||0,p=x?x+1:0,f=0;return(0,n.jsx)(c.A,{style:e?u.A:m.A,language:h,PreTag:"div",customStyle:{margin:"0.75rem 0",borderRadius:"0.375rem",fontSize:"0.875rem"},wrapLines:!0,lineProps:()=>{let e=p+f;return f++,{"data-source-start":e,"data-source-end":e,style:{display:"block"}}},children:d})},p:({children:e,node:t,...r})=>(0,n.jsx)("p",{className:"mb-3 last:mb-0",...r,children:e}),h1:({children:e,node:t,...r})=>(0,n.jsx)("h1",{className:"text-xl font-bold mb-3 mt-4 first:mt-0",...r,children:e}),h2:({children:e,node:t,...r})=>(0,n.jsx)("h2",{className:"text-lg font-bold mb-2 mt-3 first:mt-0",...r,children:e}),h3:({children:e,node:t,...r})=>(0,n.jsx)("h3",{className:"text-base font-bold mb-2 mt-3 first:mt-0",...r,children:e}),ul:({children:e,node:t,...r})=>(0,n.jsx)("ul",{className:"list-disc list-inside mb-3 space-y-1",...r,children:e}),ol:({children:e,node:t,...r})=>(0,n.jsx)("ol",{className:"list-decimal list-inside mb-3 space-y-1",...r,children:e}),li:({children:e,node:t,...r})=>(0,n.jsx)("li",{className:"leading-relaxed",...r,children:e}),blockquote:({children:e,node:t,...r})=>(0,n.jsx)("blockquote",{className:"border-l-4 border-border pl-4 my-3 italic text-muted-foreground",...r,children:e}),a:({href:e,children:t,node:r,...s})=>(0,n.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-brand hover:underline",...s,children:t}),table:({children:e,node:t,...r})=>(0,n.jsx)("div",{className:"overflow-x-auto my-3",...r,children:(0,n.jsx)("table",{className:"min-w-full border border-border",children:e})}),thead:({children:e,node:t,...r})=>(0,n.jsx)("thead",{className:"bg-accent",...r,children:e}),th:({children:e,node:t,...r})=>(0,n.jsx)("th",{className:"px-4 py-2 text-left font-semibold border-b border-border",...r,children:e}),td:({children:e,node:t,...r})=>(0,n.jsx)("td",{className:"px-4 py-2 border-b border-border",...r,children:e}),hr:({node:e,...t})=>(0,n.jsx)("hr",{className:"my-4 border-border",...t}),img:({src:e,alt:t,node:r,height:s,width:l,style:o,...a})=>{if(!(s||l||o))return(0,n.jsx)("img",{src:e,alt:t||"",className:"max-w-full h-auto rounded-lg my-3",...a});let i=e=>e?/^\d+$/.test(String(e))?`${e}px`:String(e):void 0,d={...o,height:i(s)??o?.height,width:i(l)??o?.width};return(0,n.jsx)("img",{src:e,alt:t||"",style:d,className:"inline-block align-middle",...a})},strong:({children:e,node:t,...r})=>(0,n.jsx)("strong",{className:"font-bold",...r,children:e}),em:({children:e,node:t,...r})=>(0,n.jsx)("em",{className:"italic",...r,children:e}),del:({children:e,node:t,...r})=>(0,n.jsx)("del",{className:"line-through",...r,children:e})}}let T=(0,h.memo)(function({content:e,isUser:t=!1,isStreaming:r=!1,enableMath:l=!0,rehypePlugins:o}){let{resolvedTheme:a}=(0,x.D)(),i="dark"===a,d=(0,h.useMemo)(()=>A(i),[i]),c=(0,h.useMemo)(()=>A(i,!0),[i]),u=l?w:k,m=l?C:L,p=(0,h.useMemo)(()=>{if(t||r)return e;let n=S(!function(e){if(/^\|[\s:|-]+\|$/m.test(e))return!1;if(/[┌┐└┘│─├┤┬┴┼╔╗╚╝║═╭╮╯╰▲▼◀▶△▽◁▷]/.test(e)||/\+[-=]{2,}\+/.test(e))return!0;let t=e.split("\n").filter(e=>/^\s*\||\|\s*$/.test(e));if(t.length>=3){let e=t.map(e=>(e.match(/\|/g)||[]).length);return!e.every(t=>t===e[0])||!(e[0]>=3)}return!1}(e)||/^```[\s\S]*```$/m.test(e.trim())?e:"```text\n"+e.trim()+"\n```");return l?$(n):n},[e,t,r,l]),f=(0,h.useMemo)(()=>o?.length?[...m,...o]:m,[o,m]);if(t)return(0,n.jsx)("div",{className:"whitespace-pre-wrap break-words",children:e});if(r){let t=e.lastIndexOf("\n");if(-1===t)return(0,n.jsx)("div",{className:"whitespace-pre-wrap break-words",children:e});let r=e.slice(0,t+1),o=e.slice(t+1);return(0,n.jsxs)("div",{className:"markdown-body",children:[(0,n.jsx)(s.oz,{remarkPlugins:u,rehypePlugins:m,components:c,children:l?$(S(r)):S(r)}),o&&(0,n.jsx)("span",{className:"whitespace-pre-wrap",children:o})]})}return(0,n.jsx)("div",{className:"markdown-body",children:(0,n.jsx)(s.oz,{remarkPlugins:u,rehypePlugins:f,components:d,children:p})})})},44810:(e,t,r)=>{r.d(t,{Z:()=>i});var n=r(12115),s=r(47650);let l=()=>()=>{},o=()=>document.body,a=()=>null;function i({children:e}){let t=(0,n.useSyncExternalStore)(l,o,a);return t?(0,s.createPortal)(e,t):null}},80777:(e,t,r)=>{r.d(t,{m:()=>o});var n=r(95155),s=r(12115),l=r(47650);function o({content:e,children:t,delay:r=300,className:o=""}){let[a,i]=(0,s.useState)(!1),[d,c]=(0,s.useState)({top:0,left:0}),u=(0,s.useRef)(null),m=(0,s.useRef)({x:0,y:0}),h=(0,s.useRef)(null);return(0,s.useEffect)(()=>{if(a&&h.current){let e=h.current.getBoundingClientRect(),t=d.left,r=d.top;e.right>window.innerWidth-8&&(t=window.innerWidth-e.width-8),e.left<8&&(t=8),e.bottom>window.innerHeight-8&&(r=m.current.y-e.height-8),(t!==d.left||r!==d.top)&&queueMicrotask(()=>c({top:r,left:t}))}},[a,d.left,d.top]),(0,s.useEffect)(()=>()=>{u.current&&clearTimeout(u.current)},[]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{onMouseEnter:()=>{u.current=setTimeout(()=>{let{x:e,y:t}=m.current;c({top:t+12,left:e}),i(!0)},r)},onMouseMove:e=>{m.current={x:e.clientX,y:e.clientY}},onMouseLeave:()=>{u.current&&(clearTimeout(u.current),u.current=null),i(!1)},className:o,children:t}),a&&(0,l.createPortal)((0,n.jsx)("div",{ref:h,className:"fixed z-[9999] px-2 py-1 text-xs text-foreground bg-accent rounded shadow-lg max-w-md break-words pointer-events-none",style:{top:d.top,left:d.left},children:e}),document.body)]})}},94002:(e,t,r)=>{r.d(t,{l:()=>i});var n=r(95155),s=r(12115),l=r(79114),o=r(80777);let a=e=>`h1[data-source-start="${e}"], h2[data-source-start="${e}"], h3[data-source-start="${e}"], h4[data-source-start="${e}"], h5[data-source-start="${e}"], h6[data-source-start="${e}"]`;function i({content:e,containerRef:t,width:r="w-80"}){let{t:i}=(0,l.Bd)(),d=(0,s.useMemo)(()=>(function(e){let t=[],r=e.split("\n"),n=!1;for(let e=0;e<r.length;e++){let s=r[e];if(s.trimStart().startsWith("```")){n=!n;continue}if(n)continue;let l=/^(#{1,6})\s+(.+)$/.exec(s);l&&t.push({level:l[1].length,text:l[2].replace(/\s*#+\s*$/,""),sourceLine:e+1})}return t})(e),[e]),[c,u]=(0,s.useState)(!1),[m,h]=(0,s.useState)(null),x=(0,s.useCallback)(e=>{let r=t.current;if(!r)return;let n=r.querySelector(a(e));n&&n.scrollIntoView({behavior:"smooth",block:"start"})},[t]);return((0,s.useEffect)(()=>{let e=t.current;if(!e||0===d.length)return;let r=()=>{let t=[];for(let r of d){let n=e.querySelector(a(r.sourceLine));if(n){let s=n.getBoundingClientRect().top-e.getBoundingClientRect().top;t.push({line:r.sourceLine,top:s})}}let r=null;for(let e of t)e.top<=60&&(r=e.line);null===r&&t.length>0&&(r=t[0].line),h(r)},n=setTimeout(r,150);return e.addEventListener("scroll",r,{passive:!0}),()=>{clearTimeout(n),e.removeEventListener("scroll",r)}},[d,e,t]),0===d.length)?null:(0,n.jsxs)("div",{className:`border-r border-border flex-shrink-0 flex flex-col transition-[width] duration-200 ${c?"w-8":r}`,children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-2 py-1.5 border-b border-border flex-shrink-0",children:[!c&&(0,n.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:i("editor.toc")}),(0,n.jsx)("button",{onClick:()=>u(e=>!e),className:"p-0.5 text-muted-foreground hover:text-foreground hover:bg-accent rounded transition-colors",title:i(c?"editor.expandToc":"editor.collapseToc"),children:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c?(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"}):(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})})]}),!c&&(0,n.jsx)("nav",{className:"flex-1 overflow-y-auto py-1",children:d.map((e,t)=>(0,n.jsx)(o.m,{content:e.text,delay:400,children:(0,n.jsx)("button",{onClick:()=>x(e.sourceLine),className:`block w-full text-left text-sm py-1 px-2 truncate transition-colors hover:bg-accent ${m===e.sourceLine?"text-brand font-medium bg-brand/5":"text-muted-foreground"}`,style:{paddingLeft:`${(e.level-1)*12+8}px`},children:e.text})},t))})]})}},95766:(e,t,r)=>{r.d(t,{W:()=>l});var n=r(48250);let s=new Set(["p","h1","h2","h3","h4","h5","h6","li","blockquote","pre","table","tr","hr","div","ul","ol"]);function l(){return e=>{(0,n.YR)(e,"element",e=>{if(s.has(e.tagName)&&e.position&&(e.properties||(e.properties={}),e.properties["data-source-start"]=e.position.start.line,e.properties["data-source-end"]=e.position.end.line,"pre"===e.tagName)){let t=e.children?.find(e=>"element"===e.type&&"code"===e.tagName);t&&(t.properties||(t.properties={}),t.properties["data-source-start"]=e.position.start.line,t.properties["data-source-end"]=e.position.end.line)}})}}}}]);