@witty-ai/skill-insight 0.5.0-beta → 0.6.0-beta

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 (223) hide show
  1. package/.env.example +5 -0
  2. package/.next/standalone/.next/BUILD_ID +1 -1
  3. package/.next/standalone/.next/app-path-routes-manifest.json +4 -0
  4. package/.next/standalone/.next/build-manifest.json +2 -2
  5. package/.next/standalone/.next/prerender-manifest.json +3 -3
  6. package/.next/standalone/.next/routes-manifest.json +24 -0
  7. package/.next/standalone/.next/server/app/_global-error.html +2 -2
  8. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  10. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  11. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  12. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  13. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  14. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  15. package/.next/standalone/.next/server/app/_not-found.rsc +1 -1
  16. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  17. package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  18. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  19. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  20. package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  21. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  22. package/.next/standalone/.next/server/app/api/config/route.js +3 -3
  23. package/.next/standalone/.next/server/app/api/config/route.js.nft.json +1 -1
  24. package/.next/standalone/.next/server/app/api/data/route.js +3 -3
  25. package/.next/standalone/.next/server/app/api/data/route.js.nft.json +1 -1
  26. package/.next/standalone/.next/server/app/api/otel/v1/logs/route.js +3 -3
  27. package/.next/standalone/.next/server/app/api/otel/v1/logs/route.js.nft.json +1 -1
  28. package/.next/standalone/.next/server/app/api/otel/v1/traces/route.js +1 -1
  29. package/.next/standalone/.next/server/app/api/otel/v1/traces/route.js.nft.json +1 -1
  30. package/.next/standalone/.next/server/app/api/proxy/[taskId]/end/route.js +4 -4
  31. package/.next/standalone/.next/server/app/api/proxy/[taskId]/end/route.js.nft.json +1 -1
  32. package/.next/standalone/.next/server/app/api/rejudge/route.js +3 -3
  33. package/.next/standalone/.next/server/app/api/rejudge/route.js.nft.json +1 -1
  34. package/.next/standalone/.next/server/app/api/session/route.js +1 -1
  35. package/.next/standalone/.next/server/app/api/session/route.js.nft.json +1 -1
  36. package/.next/standalone/.next/server/app/api/setup/opencode-commands/si-optimizer/route/app-paths-manifest.json +3 -0
  37. package/.next/standalone/.next/server/app/api/setup/opencode-commands/si-optimizer/route/build-manifest.json +11 -0
  38. package/.next/standalone/.next/server/app/api/setup/opencode-commands/si-optimizer/route/server-reference-manifest.json +4 -0
  39. package/.next/standalone/.next/server/app/api/setup/opencode-commands/si-optimizer/route.js +6 -0
  40. package/.next/standalone/.next/server/app/api/setup/opencode-commands/si-optimizer/route.js.map +5 -0
  41. package/.next/standalone/.next/server/app/api/setup/opencode-commands/si-optimizer/route.js.nft.json +1 -0
  42. package/.next/standalone/.next/server/app/api/setup/opencode-commands/si-optimizer/route_client-reference-manifest.js +2 -0
  43. package/.next/standalone/.next/server/app/api/setup/opencode-tui/route/app-paths-manifest.json +3 -0
  44. package/.next/standalone/.next/server/app/api/setup/opencode-tui/route/build-manifest.json +11 -0
  45. package/.next/standalone/.next/server/app/api/setup/opencode-tui/route/server-reference-manifest.json +4 -0
  46. package/.next/standalone/.next/server/app/api/setup/opencode-tui/route.js +6 -0
  47. package/.next/standalone/.next/server/app/api/setup/opencode-tui/route.js.map +5 -0
  48. package/.next/standalone/.next/server/app/api/setup/opencode-tui/route.js.nft.json +1 -0
  49. package/.next/standalone/.next/server/app/api/setup/opencode-tui/route_client-reference-manifest.js +2 -0
  50. package/.next/standalone/.next/server/app/api/skills/[id]/versions/[version]/download/route.js.nft.json +1 -1
  51. package/.next/standalone/.next/server/app/api/skills/[id]/versions/[version]/route.js +3 -2
  52. package/.next/standalone/.next/server/app/api/skills/[id]/versions/[version]/route.js.nft.json +1 -1
  53. package/.next/standalone/.next/server/app/api/skills/automation/import/route.js.nft.json +1 -1
  54. package/.next/standalone/.next/server/app/api/skills/logs/route.js +2 -2
  55. package/.next/standalone/.next/server/app/api/skills/logs/route.js.nft.json +1 -1
  56. package/.next/standalone/.next/server/app/api/skills/route.js +3 -2
  57. package/.next/standalone/.next/server/app/api/skills/route.js.nft.json +1 -1
  58. package/.next/standalone/.next/server/app/api/skills/sync-enterprise/route/app-paths-manifest.json +3 -0
  59. package/.next/standalone/.next/server/app/api/skills/sync-enterprise/route/build-manifest.json +11 -0
  60. package/.next/standalone/.next/server/app/api/skills/sync-enterprise/route/server-reference-manifest.json +4 -0
  61. package/.next/standalone/.next/server/app/api/skills/sync-enterprise/route.js +8 -0
  62. package/.next/standalone/.next/server/app/api/skills/sync-enterprise/route.js.map +5 -0
  63. package/.next/standalone/.next/server/app/api/skills/sync-enterprise/route.js.nft.json +1 -0
  64. package/.next/standalone/.next/server/app/api/skills/sync-enterprise/route_client-reference-manifest.js +2 -0
  65. package/.next/standalone/.next/server/app/api/task-stats/route/app-paths-manifest.json +3 -0
  66. package/.next/standalone/.next/server/app/api/task-stats/route/build-manifest.json +11 -0
  67. package/.next/standalone/.next/server/app/api/task-stats/route/server-reference-manifest.json +4 -0
  68. package/.next/standalone/.next/server/app/api/task-stats/route.js +11 -0
  69. package/.next/standalone/.next/server/app/api/task-stats/route.js.map +5 -0
  70. package/.next/standalone/.next/server/app/api/task-stats/route.js.nft.json +1 -0
  71. package/.next/standalone/.next/server/app/api/task-stats/route_client-reference-manifest.js +2 -0
  72. package/.next/standalone/.next/server/app/api/upload/route.js +1 -1
  73. package/.next/standalone/.next/server/app/api/upload/route.js.nft.json +1 -1
  74. package/.next/standalone/.next/server/app/details/page/react-loadable-manifest.json +2 -2
  75. package/.next/standalone/.next/server/app/details/page_client-reference-manifest.js +1 -1
  76. package/.next/standalone/.next/server/app/details.html +1 -1
  77. package/.next/standalone/.next/server/app/details.rsc +2 -2
  78. package/.next/standalone/.next/server/app/details.segments/_full.segment.rsc +2 -2
  79. package/.next/standalone/.next/server/app/details.segments/_head.segment.rsc +1 -1
  80. package/.next/standalone/.next/server/app/details.segments/_index.segment.rsc +1 -1
  81. package/.next/standalone/.next/server/app/details.segments/_tree.segment.rsc +1 -1
  82. package/.next/standalone/.next/server/app/details.segments/details/__PAGE__.segment.rsc +2 -2
  83. package/.next/standalone/.next/server/app/details.segments/details.segment.rsc +1 -1
  84. package/.next/standalone/.next/server/app/index.html +1 -1
  85. package/.next/standalone/.next/server/app/index.rsc +2 -2
  86. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  87. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +2 -2
  88. package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  89. package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +1 -1
  90. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  91. package/.next/standalone/.next/server/app/login.html +1 -1
  92. package/.next/standalone/.next/server/app/login.rsc +1 -1
  93. package/.next/standalone/.next/server/app/login.segments/_full.segment.rsc +1 -1
  94. package/.next/standalone/.next/server/app/login.segments/_head.segment.rsc +1 -1
  95. package/.next/standalone/.next/server/app/login.segments/_index.segment.rsc +1 -1
  96. package/.next/standalone/.next/server/app/login.segments/_tree.segment.rsc +1 -1
  97. package/.next/standalone/.next/server/app/login.segments/login/__PAGE__.segment.rsc +1 -1
  98. package/.next/standalone/.next/server/app/login.segments/login.segment.rsc +1 -1
  99. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  100. package/.next/standalone/.next/server/app/skills.html +1 -1
  101. package/.next/standalone/.next/server/app/skills.rsc +1 -1
  102. package/.next/standalone/.next/server/app/skills.segments/_full.segment.rsc +1 -1
  103. package/.next/standalone/.next/server/app/skills.segments/_head.segment.rsc +1 -1
  104. package/.next/standalone/.next/server/app/skills.segments/_index.segment.rsc +1 -1
  105. package/.next/standalone/.next/server/app/skills.segments/_tree.segment.rsc +1 -1
  106. package/.next/standalone/.next/server/app/skills.segments/skills/__PAGE__.segment.rsc +1 -1
  107. package/.next/standalone/.next/server/app/skills.segments/skills.segment.rsc +1 -1
  108. package/.next/standalone/.next/server/app-paths-manifest.json +4 -0
  109. package/.next/standalone/.next/server/chunks/[root-of-the-server]__15dbd1f2._.js +3 -0
  110. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1ce5e3b8._.js +1 -1
  111. package/.next/standalone/.next/server/chunks/[root-of-the-server]__53775b48._.js +1 -1
  112. package/.next/standalone/.next/server/chunks/[root-of-the-server]__6923eecf._.js +1 -1
  113. package/.next/standalone/.next/server/chunks/[root-of-the-server]__6d8053e2._.js +1 -1
  114. package/.next/standalone/.next/server/chunks/[root-of-the-server]__8402dfd1._.js +3 -0
  115. package/.next/standalone/.next/server/chunks/[root-of-the-server]__863cf6de._.js +1 -1
  116. package/.next/standalone/.next/server/chunks/[root-of-the-server]__89404730._.js +3 -0
  117. package/.next/standalone/.next/server/chunks/[root-of-the-server]__aa5c8858._.js +2 -2
  118. package/.next/standalone/.next/server/chunks/[root-of-the-server]__c20da96a._.js +3 -0
  119. package/.next/standalone/.next/server/chunks/[root-of-the-server]__ddf63a21._.js +3 -0
  120. package/.next/standalone/.next/server/chunks/[root-of-the-server]__f9e66e02._.js +3 -0
  121. package/.next/standalone/.next/server/chunks/_3e8b4d8c._.js +1 -1
  122. package/.next/standalone/.next/server/chunks/_41a98bd8._.js +1 -1
  123. package/.next/standalone/.next/server/chunks/_4c806e26._.js +3 -0
  124. package/.next/standalone/.next/server/chunks/_cd3d20ca._.js +1 -1
  125. package/.next/standalone/.next/server/chunks/_ddffef3e._.js +1 -1
  126. package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_setup_opencode-tui_route_actions_fc8ae29f.js +3 -0
  127. package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_skills_sync-enterprise_route_actions_0ca45899.js +3 -0
  128. package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_task-stats_route_actions_983505cd.js +3 -0
  129. package/.next/standalone/.next/server/chunks/ce889_server_app_api_setup_opencode-commands_si-optimizer_route_actions_fcde30ef.js +3 -0
  130. package/.next/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_c33286ed.js +47 -4
  131. package/.next/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_f42faeee.js +1 -1
  132. package/.next/standalone/.next/server/chunks/src_98433cb8._.js +175 -0
  133. package/.next/standalone/.next/server/chunks/src_lib_12408140._.js +1 -1
  134. package/.next/standalone/.next/server/chunks/ssr/_c8c8c083._.js +2 -2
  135. package/.next/standalone/.next/server/chunks/ssr/_fd46f439._.js +2 -1
  136. package/.next/standalone/.next/server/chunks/ssr/node_modules_dagre-d3-es_src_dagre_index_3582f3d0.js +1 -1
  137. package/.next/standalone/.next/server/chunks/ssr/node_modules_lodash-es_a1341fea._.js +1 -1
  138. package/.next/standalone/.next/server/chunks/ssr/node_modules_lodash-es_e1de6ed8._.js +1 -1
  139. package/.next/standalone/.next/server/pages/404.html +1 -1
  140. package/.next/standalone/.next/server/pages/500.html +2 -2
  141. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  142. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  143. package/.next/standalone/.next/static/chunks/{01eddf501c574a44.js → 4ee8dc41c9f15b7b.js} +1 -1
  144. package/.next/standalone/.next/static/chunks/{737b8cff3c6a4e30.js → 9445b2873a413c58.js} +1 -1
  145. package/.next/standalone/.next/static/chunks/94dfb15df65ef720.js +2 -0
  146. package/.next/standalone/.next/static/chunks/9d1c5c3494fa53de.js +109 -0
  147. package/.next/standalone/.next/static/chunks/{e09d9ee16fe90255.js → cd0fde15dc0dfcca.js} +1 -1
  148. package/.next/standalone/.next/static/chunks/{ff6357067630b168.js → e13d208072a48316.js} +1 -1
  149. package/.next/standalone/node_modules/.prisma/client/edge.js +6 -3
  150. package/.next/standalone/node_modules/.prisma/client/index-browser.js +3 -0
  151. package/.next/standalone/node_modules/.prisma/client/index.js +6 -3
  152. package/.next/standalone/node_modules/.prisma/client/package.json +1 -1
  153. package/.next/standalone/node_modules/.prisma/client/schema.prisma +12 -9
  154. package/.next/standalone/node_modules/.prisma/client/wasm.js +3 -0
  155. package/.next/standalone/node_modules/adm-zip/util/constants.js +142 -0
  156. package/.next/standalone/node_modules/adm-zip/util/decoder.js +5 -0
  157. package/.next/standalone/node_modules/adm-zip/util/errors.js +63 -0
  158. package/.next/standalone/node_modules/adm-zip/util/fattr.js +76 -0
  159. package/.next/standalone/node_modules/adm-zip/util/index.js +5 -0
  160. package/.next/standalone/node_modules/adm-zip/util/utils.js +339 -0
  161. package/.next/standalone/package.json +6 -2
  162. package/.next/standalone/prisma/schema.prisma +3 -0
  163. package/.next/standalone/scripts/opencode_plugin.ts +23 -5
  164. package/.next/standalone/scripts/opencode_tui_plugin.tsx +308 -0
  165. package/.next/standalone/scripts/si-optimizer.md +5 -0
  166. package/.next/static/chunks/{01eddf501c574a44.js → 4ee8dc41c9f15b7b.js} +1 -1
  167. package/.next/static/chunks/{737b8cff3c6a4e30.js → 9445b2873a413c58.js} +1 -1
  168. package/.next/static/chunks/94dfb15df65ef720.js +2 -0
  169. package/.next/static/chunks/9d1c5c3494fa53de.js +109 -0
  170. package/.next/static/chunks/{e09d9ee16fe90255.js → cd0fde15dc0dfcca.js} +1 -1
  171. package/.next/static/chunks/{ff6357067630b168.js → e13d208072a48316.js} +1 -1
  172. package/package.json +6 -2
  173. package/prisma/schema.prisma +3 -0
  174. package/scripts/activate_telemetry.sh +44 -1
  175. package/scripts/opencode_plugin.ts +23 -5
  176. package/scripts/opencode_tui_plugin.tsx +308 -0
  177. package/scripts/si-optimizer.md +5 -0
  178. package/scripts/utils.js +0 -1
  179. package/.next/standalone/.next/server/chunks/[root-of-the-server]__e2f0baee._.js +0 -3
  180. package/.next/standalone/.next/server/chunks/[root-of-the-server]__fc05579d._.js +0 -3
  181. package/.next/standalone/.next/server/chunks/src_497d2ad2._.js +0 -175
  182. package/.next/standalone/.next/static/chunks/4071dbec4cf7e72e.js +0 -109
  183. package/.next/standalone/.next/static/chunks/a87b5e84254095a5.js +0 -1
  184. package/.next/standalone/LICENSE +0 -21
  185. package/.next/standalone/bin/cli.js +0 -106
  186. package/.next/standalone/custom-models.example.json +0 -21
  187. package/.next/standalone/eslint.config.mjs +0 -18
  188. package/.next/standalone/features/feature-skill-used-jump-link/design/2026-03-18-skill-used-jump-link-design.md +0 -126
  189. package/.next/standalone/features/feature-skill-used-jump-link/feature.json +0 -32
  190. package/.next/standalone/features/feature-skill-used-jump-link/issue.md +0 -32
  191. package/.next/standalone/features/feature-skill-used-jump-link/plans/2026-03-18-skill-used-jump-link.md +0 -528
  192. package/.next/standalone/next.config.ts +0 -41
  193. package/.next/standalone/scripts/activate_telemetry.sh +0 -159
  194. package/.next/standalone/scripts/create_migration_package.sh +0 -124
  195. package/.next/standalone/scripts/fix_models.js +0 -66
  196. package/.next/standalone/scripts/init_opengauss.py +0 -284
  197. package/.next/standalone/scripts/install.js +0 -273
  198. package/.next/standalone/scripts/logs.js +0 -38
  199. package/.next/standalone/scripts/otel_data/logs.jsonl +0 -12
  200. package/.next/standalone/scripts/otel_data/metrics.jsonl +0 -21
  201. package/.next/standalone/scripts/otel_data/raw_requests.jsonl +0 -8
  202. package/.next/standalone/scripts/otel_data/raw_requests.jsonl.bak +0 -6
  203. package/.next/standalone/scripts/otel_receiver.py +0 -580
  204. package/.next/standalone/scripts/postinstall.js +0 -192
  205. package/.next/standalone/scripts/publish-npm.js +0 -401
  206. package/.next/standalone/scripts/restart.js +0 -26
  207. package/.next/standalone/scripts/restart.sh +0 -138
  208. package/.next/standalone/scripts/restart_dev.sh +0 -132
  209. package/.next/standalone/scripts/start.js +0 -291
  210. package/.next/standalone/scripts/status.js +0 -41
  211. package/.next/standalone/scripts/stop.js +0 -90
  212. package/.next/standalone/scripts/sync_skills.js +0 -216
  213. package/.next/standalone/scripts/utils.js +0 -235
  214. package/.next/standalone/tests/setup_skill_optimizer.sh +0 -118
  215. package/.next/standalone/tsconfig.json +0 -34
  216. package/.next/static/chunks/4071dbec4cf7e72e.js +0 -109
  217. package/.next/static/chunks/a87b5e84254095a5.js +0 -1
  218. /package/.next/standalone/.next/static/{H581Rok68JtPV4bAVVH3l → 0uvhCJooDO_gMNlKOaHwB}/_buildManifest.js +0 -0
  219. /package/.next/standalone/.next/static/{H581Rok68JtPV4bAVVH3l → 0uvhCJooDO_gMNlKOaHwB}/_clientMiddlewareManifest.json +0 -0
  220. /package/.next/standalone/.next/static/{H581Rok68JtPV4bAVVH3l → 0uvhCJooDO_gMNlKOaHwB}/_ssgManifest.js +0 -0
  221. /package/.next/static/{H581Rok68JtPV4bAVVH3l → 0uvhCJooDO_gMNlKOaHwB}/_buildManifest.js +0 -0
  222. /package/.next/static/{H581Rok68JtPV4bAVVH3l → 0uvhCJooDO_gMNlKOaHwB}/_clientMiddlewareManifest.json +0 -0
  223. /package/.next/static/{H581Rok68JtPV4bAVVH3l → 0uvhCJooDO_gMNlKOaHwB}/_ssgManifest.js +0 -0
@@ -0,0 +1,2 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,16015,(e,s,t)=>{},98547,(e,s,t)=>{var r=e.i(18392);e.r(16015);var d=e.r(71645),a=d&&"object"==typeof d&&"default"in d?d:{default:d},l=void 0!==r.default&&r.default.env&&!0,n=function(e){return"[object String]"===Object.prototype.toString.call(e)},i=function(){function e(e){var s=void 0===e?{}:e,t=s.name,r=void 0===t?"stylesheet":t,d=s.optimizeForSpeed,a=void 0===d?l:d;c(n(r),"`name` must be a string"),this._name=r,this._deletedRulePlaceholder="#"+r+"-deleted-rule____{}",c("boolean"==typeof a,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=a,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var i="u">typeof window&&document.querySelector('meta[property="csp-nonce"]');this._nonce=i?i.getAttribute("content"):null}var s,t=e.prototype;return t.setOptimizeForSpeed=function(e){c("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),c(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},t.isOptimizeForSpeed=function(){return this._optimizeForSpeed},t.inject=function(){var e=this;if(c(!this._injected,"sheet already injected"),this._injected=!0,"u">typeof window&&this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(l||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(s,t){return"number"==typeof t?e._serverSheet.cssRules[t]={cssText:s}:e._serverSheet.cssRules.push({cssText:s}),t},deleteRule:function(s){e._serverSheet.cssRules[s]=null}}},t.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var s=0;s<document.styleSheets.length;s++)if(document.styleSheets[s].ownerNode===e)return document.styleSheets[s]},t.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},t.insertRule=function(e,s){if(c(n(e),"`insertRule` accepts only strings"),"u"<typeof window)return"number"!=typeof s&&(s=this._serverSheet.cssRules.length),this._serverSheet.insertRule(e,s),this._rulesCount++;if(this._optimizeForSpeed){var t=this.getSheet();"number"!=typeof s&&(s=t.cssRules.length);try{t.insertRule(e,s)}catch(s){return l||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var r=this._tags[s];this._tags.push(this.makeStyleTag(this._name,e,r))}return this._rulesCount++},t.replaceRule=function(e,s){if(this._optimizeForSpeed||"u"<typeof window){var t="u">typeof window?this.getSheet():this._serverSheet;if(s.trim()||(s=this._deletedRulePlaceholder),!t.cssRules[e])return e;t.deleteRule(e);try{t.insertRule(s,e)}catch(r){l||console.warn("StyleSheet: illegal rule: \n\n"+s+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),t.insertRule(this._deletedRulePlaceholder,e)}}else{var r=this._tags[e];c(r,"old rule at index `"+e+"` not found"),r.textContent=s}return e},t.deleteRule=function(e){if("u"<typeof window)return void this._serverSheet.deleteRule(e);if(this._optimizeForSpeed)this.replaceRule(e,"");else{var s=this._tags[e];c(s,"rule at index `"+e+"` not found"),s.parentNode.removeChild(s),this._tags[e]=null}},t.flush=function(){this._injected=!1,this._rulesCount=0,"u">typeof window?(this._tags.forEach(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]):this._serverSheet.cssRules=[]},t.cssRules=function(){var e=this;return"u"<typeof window?this._serverSheet.cssRules:this._tags.reduce(function(s,t){return t?s=s.concat(Array.prototype.map.call(e.getSheetForTag(t).cssRules,function(s){return s.cssText===e._deletedRulePlaceholder?null:s})):s.push(null),s},[])},t.makeStyleTag=function(e,s,t){s&&c(n(s),"makeStyleTag accepts only strings as second parameter");var r=document.createElement("style");this._nonce&&r.setAttribute("nonce",this._nonce),r.type="text/css",r.setAttribute("data-"+e,""),s&&r.appendChild(document.createTextNode(s));var d=document.head||document.getElementsByTagName("head")[0];return t?d.insertBefore(r,t):d.appendChild(r),r},s=[{key:"length",get:function(){return this._rulesCount}}],function(e,s){for(var t=0;t<s.length;t++){var r=s[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,s),e}();function c(e,s){if(!e)throw Error("StyleSheet: "+s+".")}var o=function(e){for(var s=5381,t=e.length;t;)s=33*s^e.charCodeAt(--t);return s>>>0},x={};function p(e,s){if(!s)return"jsx-"+e;var t=String(s),r=e+t;return x[r]||(x[r]="jsx-"+o(e+"-"+t)),x[r]}function f(e,s){"u"<typeof window&&(s=s.replace(/\/style/gi,"\\/style"));var t=e+s;return x[t]||(x[t]=s.replace(/__jsx-style-dynamic-selector/g,e)),x[t]}var m=function(){function e(e){var s=void 0===e?{}:e,t=s.styleSheet,r=void 0===t?null:t,d=s.optimizeForSpeed,a=void 0!==d&&d;this._sheet=r||new i({name:"styled-jsx",optimizeForSpeed:a}),this._sheet.inject(),r&&"boolean"==typeof a&&(this._sheet.setOptimizeForSpeed(a),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var s=e.prototype;return s.add=function(e){var s=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),"u">typeof window&&!this._fromServer&&(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,s){return e[s]=0,e},{}));var t=this.getIdAndRules(e),r=t.styleId,d=t.rules;if(r in this._instancesCounts){this._instancesCounts[r]+=1;return}var a=d.map(function(e){return s._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[r]=a,this._instancesCounts[r]=1},s.remove=function(e){var s=this,t=this.getIdAndRules(e).styleId;if(function(e,s){if(!e)throw Error("StyleSheetRegistry: "+s+".")}(t in this._instancesCounts,"styleId: `"+t+"` not found"),this._instancesCounts[t]-=1,this._instancesCounts[t]<1){var r=this._fromServer&&this._fromServer[t];r?(r.parentNode.removeChild(r),delete this._fromServer[t]):(this._indices[t].forEach(function(e){return s._sheet.deleteRule(e)}),delete this._indices[t]),delete this._instancesCounts[t]}},s.update=function(e,s){this.add(s),this.remove(e)},s.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},s.cssRules=function(){var e=this,s=this._fromServer?Object.keys(this._fromServer).map(function(s){return[s,e._fromServer[s]]}):[],t=this._sheet.cssRules();return s.concat(Object.keys(this._indices).map(function(s){return[s,e._indices[s].map(function(e){return t[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},s.styles=function(e){var s,t;return s=this.cssRules(),void 0===(t=e)&&(t={}),s.map(function(e){var s=e[0],r=e[1];return a.default.createElement("style",{id:"__"+s,key:"__"+s,nonce:t.nonce?t.nonce:void 0,dangerouslySetInnerHTML:{__html:r}})})},s.getIdAndRules=function(e){var s=e.children,t=e.dynamic,r=e.id;if(t){var d=p(r,t);return{styleId:d,rules:Array.isArray(s)?s.map(function(e){return f(d,e)}):[f(d,s)]}}return{styleId:p(r),rules:Array.isArray(s)?s:[s]}},s.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,s){return e[s.id.slice(2)]=s,e},{})},e}(),u=d.createContext(null);function b(){return new m}function h(){return d.useContext(u)}u.displayName="StyleSheetContext";var g=a.default.useInsertionEffect||a.default.useLayoutEffect,j="u">typeof window?b():void 0;function y(e){var s=j||h();return s&&("u"<typeof window?s.add(e):g(function(){return s.add(e),function(){s.remove(e)}},[e.id,String(e.dynamic)])),null}y.dynamic=function(e){return e.map(function(e){return p(e[0],e[1])}).join(" ")},t.StyleRegistry=function(e){var s=e.registry,t=e.children,r=d.useContext(u),l=d.useState(function(){return r||s||b()})[0];return a.default.createElement(u.Provider,{value:l},t)},t.createStyleRegistry=b,t.style=y,t.useStyleRegistry=h},37902,(e,s,t)=>{s.exports=e.r(98547).style},58116,e=>{"use strict";e.i(18392);var s=e.i(43476),t=e.i(37902),r=e.i(71645),d=e.i(74080),a=e.i(75225),l=e.i(9694),n=e.i(72526),i=e.i(59559),c=e.i(31195),o=e.i(34239),x=e.i(85183),p=e.i(93230),f=e.i(9665),m=e.i(97703),u=e.i(9165),b=e.i(94690);function h({onSuccess:e}){let{apiKey:t}=(0,b.useAuth)(),[d,a]=(0,r.useState)(!1),[l,n]=(0,r.useState)(null),[i,c]=(0,r.useState)(""),o=async()=>{a(!0),c("正在从企业同步技能..."),n(null);try{let s=await (0,u.apiFetch)("/api/skills/sync-enterprise",{method:"POST",headers:t?{"x-witty-api-key":t}:{}}),r=await s.json();s.ok?(c("同步完成!"),n(r),e()):(c(`同步失败: ${r.error}`),alert(`同步失败: ${r.error}`))}catch(e){c(`同步出错: ${e.message}`),alert("同步出错")}finally{a(!1)}};return(0,s.jsxs)("div",{className:"upload-card",children:[(0,s.jsx)("div",{style:{fontSize:"3rem",marginBottom:"1rem",color:"#94a3b8"},children:"🔄"}),(0,s.jsx)("h3",{style:{fontSize:"1.25rem",fontWeight:600,marginBottom:"0.5rem",color:"#1e293b"},children:"从'skill市场--我的skill'同步"}),(0,s.jsxs)("p",{style:{color:"#64748b",marginBottom:"1.5rem",maxWidth:"400px",fontSize:"0.9rem",lineHeight:1.5},children:["从'skill市场--我的skill'自动拉取所有技能并同步到本地。",(0,s.jsx)("br",{}),"同版本号skill将被覆盖。"]}),(0,s.jsx)("button",{className:"btn-primary",onClick:o,disabled:d,style:{opacity:d?.6:1,cursor:d?"not-allowed":"pointer"},children:d?"同步中...":"开始同步"}),i&&(0,s.jsx)("div",{style:{marginTop:"1rem",color:"#64748b",fontSize:"0.9rem"},children:i}),l&&(0,s.jsxs)("div",{style:{marginTop:"1rem",padding:"1rem",backgroundColor:"#f1f5f9",borderRadius:"0.5rem"},children:[(0,s.jsx)("div",{style:{fontWeight:600,marginBottom:"0.5rem"},children:"同步结果:"}),(0,s.jsxs)("div",{children:["总技能数: ",l.totalSkills]}),(0,s.jsxs)("div",{style:{color:"#16a34a"},children:["成功: ",l.successCount]}),(0,s.jsxs)("div",{style:{color:"#dc2626"},children:["失败: ",l.failedCount]}),l.failedCount>0&&(0,s.jsxs)("details",{style:{marginTop:"0.5rem"},children:[(0,s.jsx)("summary",{style:{cursor:"pointer",color:"#64748b"},children:"查看失败详情"}),(0,s.jsx)("ul",{style:{marginTop:"0.5rem",paddingLeft:"1.5rem"},children:l.results.filter(e=>!e.success).map((e,t)=>(0,s.jsxs)("li",{style:{color:"#dc2626"},children:[e.skillName," (v",e.version,"): ",e.error]},t))})]})]})]})}function g({onSuccess:e}){let{user:t}=(0,b.useAuth)(),[d,a]=(0,r.useState)(!1),[l,n]=(0,r.useState)([]),i=(0,r.useRef)(null),c=async s=>{let r=s.target.files;if(!r||0===r.length)return;a(!0),n(["Preparing upload..."]);let d=new FormData;t&&d.append("user",t);for(let e=0;e<r.length;e++)d.append("files",r[e]),d.append("paths",r[e].webkitRelativePath);try{n(e=>[...e,`Uploading ${r.length} files...`]);let s=await (0,u.apiFetch)("/api/skills/upload",{method:"POST",body:d}),t=await s.json();s.ok?(n(e=>[...e,"Upload successful!",`Skill: ${t.skill.name} (v${t.version.version})`]),alert("技能上传成功!"),e()):(n(e=>[...e,`Error: ${t.error}`]),alert(`上传失败: ${t.error}`))}catch(e){n(s=>[...s,`Network Error: ${e.message}`]),alert("上传出错")}finally{a(!1),i.current&&(i.current.value="")}};return(0,s.jsxs)("div",{className:"upload-card",children:[(0,s.jsx)("div",{style:{fontSize:"3rem",marginBottom:"1rem",color:"#94a3b8"},children:"📂"}),(0,s.jsx)("h3",{style:{fontSize:"1.25rem",fontWeight:600,marginBottom:"0.5rem",color:"#1e293b"},children:"上传 Skill"}),(0,s.jsxs)("p",{style:{color:"#64748b",marginBottom:"1.5rem",maxWidth:"400px",fontSize:"0.9rem",lineHeight:1.5},children:["选择包含 ",(0,s.jsx)("code",{children:"SKILL.md"}),"的文件夹。",(0,s.jsx)("br",{}),(0,s.jsx)("span",{style:{color:"#d97706"},children:"注意: 请上传整个文件夹"}),(0,s.jsx)("br",{}),(0,s.jsx)("span",{style:{color:"#dc2626",fontWeight:"bold"},children:"重要: 文件夹名称不得包含中文字符。"})]}),(0,s.jsxs)("div",{style:{position:"relative",display:"inline-block"},children:[(0,s.jsx)("button",{className:"btn-primary",style:{display:"flex",alignItems:"center",gap:"0.5rem",padding:"0.75rem 1.5rem",fontSize:"1rem"},onClick:()=>i.current?.click(),children:(0,s.jsx)("span",{children:"选择文件夹"})}),(0,s.jsx)("input",{ref:i,type:"file",webkitdirectory:"",directory:"",multiple:!0,style:{display:"none"},onChange:c})]}),l.length>0&&(0,s.jsx)("div",{style:{marginTop:"2rem",width:"100%",maxWidth:"600px",textAlign:"left",background:"#f8fafc",padding:"1rem",borderRadius:"0.5rem",maxHeight:"150px",overflowY:"auto"},children:l.map((e,t)=>(0,s.jsx)("div",{style:{color:"#475569",fontSize:"0.8rem",fontFamily:"monospace",marginBottom:"4px",borderBottom:"1px solid #e2e8f0",paddingBottom:"2px"},children:e},t))})]})}function j({skillId:e,version:t,onClose:d}){let{user:a}=(0,b.useAuth)(),[l,n]=(0,r.useState)(null),[i,c]=(0,r.useState)(!0),[o,x]=(0,r.useState)(!1),[p,f]=(0,r.useState)(null);(0,r.useEffect)(()=>{c(!0),(0,u.apiFetch)(`/api/skills/${e}/versions/${t}?user=${encodeURIComponent(a||"")}`).then(e=>e.json()).then(e=>{n(e),c(!1)}).catch(e=>{alert("Failed to load details"),c(!1)}),(0,u.apiFetch)(`/api/skills/${e}/versions/${t}/parse-flow?user=${encodeURIComponent(a||"")}`).then(e=>e.json()).then(e=>{e.parsed&&f(e)}).catch(()=>{})},[e,t]);let m=async()=>{x(!0);try{let s=await (0,u.apiFetch)(`/api/skills/${e}/versions/${t}/parse-flow`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({user:a})}),r=await s.json();r.success?f({parsed:!0,flowJson:JSON.stringify(r.flow),mermaidCode:r.mermaidCode,parsedAt:new Date().toISOString()}):alert(`解析失败: ${r.error}`)}catch(s){let e=s instanceof Error?s.message:"未知错误";alert(`解析出错: ${e}`)}finally{x(!1)}};return(0,s.jsx)("div",{className:"modal-overlay",onClick:d,style:{zIndex:1100},children:(0,s.jsxs)("div",{className:"modal-content card",onClick:e=>e.stopPropagation(),style:{width:"1200px",maxWidth:"95vw",maxHeight:"90vh",display:"flex",flexDirection:"column",padding:0,overflow:"hidden"},children:[(0,s.jsxs)("div",{className:"modal-header-new",style:{padding:"1rem 1.5rem",background:"#f8fafc",borderBottom:"1px solid #e2e8f0",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,s.jsxs)("h3",{style:{margin:0,fontSize:"1.25rem",fontWeight:"bold",color:"#1e293b"},children:["Version Details (v",t,")"]}),(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"1rem"},children:[(0,s.jsx)("button",{onClick:m,disabled:o,style:{padding:"6px 16px",background:o?"#cbd5e1":"#2563eb",color:o?"#64748b":"#ffffff",border:"none",borderRadius:"4px",cursor:o?"not-allowed":"pointer",fontWeight:"bold",fontSize:"0.9rem"},children:o?"解析中...":p?"重新解析":"解析流程"}),(0,s.jsx)("button",{onClick:d,style:{background:"none",border:"none",color:"#64748b",fontSize:"1.5rem",cursor:"pointer",padding:"0 0.5rem",lineHeight:1},children:"×"})]})]}),(0,s.jsx)("div",{style:{flex:1,display:"flex",gap:"1.5rem",padding:"1.5rem",minHeight:0,overflowY:"auto"},children:i?(0,s.jsx)("div",{style:{textAlign:"center",padding:"2rem",color:"#64748b",flex:1},children:"Loading details..."}):l?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{style:{flex:"1 1 50%",display:"flex",flexDirection:"column",gap:"1.5rem",minWidth:0},children:[(0,s.jsx)("div",{style:{background:"#f8fafc",padding:"1rem",borderRadius:"8px",border:"1px solid #e2e8f0"},children:(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{style:{color:"#64748b",fontSize:"0.85rem",display:"block",marginBottom:"4px"},children:"Created At"}),(0,s.jsx)("div",{style:{color:"#1e293b",fontWeight:500},children:new Date(l.createdAt).toLocaleString()})]})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{style:{color:"#64748b",marginBottom:"0.5rem",fontSize:"0.85rem",textTransform:"uppercase",letterSpacing:"0.05em",fontWeight:600},children:"变更历史"}),(0,s.jsx)("div",{style:{background:"#f8fafc",padding:"1rem",borderRadius:"6px",color:"#334155",whiteSpace:"pre-wrap",border:"1px solid #e2e8f0",fontSize:"0.9rem",lineHeight:1.6},children:l.changeLog||(0,s.jsx)("span",{style:{color:"#94a3b8",fontStyle:"italic"},children:"无变更历史"})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{style:{color:"#64748b",marginBottom:"0.5rem",fontSize:"0.85rem",textTransform:"uppercase",letterSpacing:"0.05em",fontWeight:600},children:"Skill Content (SKILL.md)"}),(0,s.jsx)("pre",{style:{background:"#f8fafc",padding:"1rem",borderRadius:"6px",color:"#334155",overflowX:"auto",fontFamily:"monospace",fontSize:"0.85rem",border:"1px solid #e2e8f0",maxHeight:"300px",whiteSpace:"pre-wrap"},children:l.content||(0,s.jsx)("span",{style:{color:"#94a3b8",fontStyle:"italic"},children:"(Empty content)"})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{style:{color:"#64748b",marginBottom:"0.5rem",fontSize:"0.85rem",textTransform:"uppercase",letterSpacing:"0.05em",fontWeight:600},children:"Included Files"}),(0,s.jsx)("div",{style:{background:"#f8fafc",padding:"1rem",borderRadius:"6px",border:"1px solid #e2e8f0"},children:(()=>{try{let e=l.files?JSON.parse(l.files):[];if(0===e.length)return(0,s.jsx)("span",{style:{color:"#94a3b8",fontSize:"0.9rem",fontStyle:"italic"},children:"No additional files."});return(0,s.jsx)("ul",{style:{margin:0,paddingLeft:"1.2rem",color:"#475569",fontSize:"0.9rem"},children:e.map((e,t)=>(0,s.jsx)("li",{style:{marginBottom:"4px"},children:e},t))})}catch(e){return(0,s.jsx)("span",{style:{color:"#dc2626",fontSize:"0.9rem"},children:"Error parsing file list."})}})()})]})]}),(0,s.jsxs)("div",{style:{flex:"1 1 50%",minWidth:0,display:"flex",flexDirection:"column"},children:[(0,s.jsx)("h4",{style:{color:"#64748b",marginBottom:"0.5rem",fontSize:"0.85rem",textTransform:"uppercase",letterSpacing:"0.05em",fontWeight:600},children:"预期执行流程"}),p?(0,s.jsxs)("div",{style:{background:"#f8fafc",padding:"1rem",borderRadius:"6px",border:"1px solid #e2e8f0",flex:1,display:"flex",flexDirection:"column"},children:[(0,s.jsxs)("div",{style:{marginBottom:"0.5rem",fontSize:"0.8rem",color:"#94a3b8",flexShrink:0},children:["解析时间: ",new Date(p.parsedAt).toLocaleString()]}),(0,s.jsx)("div",{style:{flex:1,overflow:"auto"},children:(0,s.jsx)(y,{code:p.mermaidCode})})]}):(0,s.jsx)("div",{style:{background:"#f8fafc",padding:"2rem",borderRadius:"6px",border:"1px solid #e2e8f0",flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"#94a3b8"},children:"点击「解析流程」按钮生成预期执行流程图"})]})]}):(0,s.jsx)("div",{style:{color:"#dc2626",textAlign:"center",padding:"2rem",flex:1},children:"Failed to load details."})})]})})}function y({code:t}){let[d,a]=(0,r.useState)(""),[l,n]=(0,r.useState)("");return((0,r.useEffect)(()=>{let s=async()=>{try{let s=(await e.A(95802)).default;s.initialize({startOnLoad:!1,theme:"default",flowchart:{useMaxWidth:!1}});let{svg:r}=await s.render("mermaid-"+Date.now(),t);a(r),n("")}catch(e){console.error("Mermaid render error:",e),n("流程图渲染失败")}};t&&s()},[t]),l)?(0,s.jsx)("div",{style:{color:"#dc2626"},children:l}):(0,s.jsx)("div",{style:{width:"100%",display:"flex",justifyContent:"center",alignItems:"flex-start"},dangerouslySetInnerHTML:{__html:d}})}function k({skill:e,onClose:t,onUpdate:d}){let{user:a}=(0,b.useAuth)(),[l,n]=(0,r.useState)([]),[i,c]=(0,r.useState)(e.activeVersion),[o,x]=(0,r.useState)(!1),[p,f]=(0,r.useState)(null),[m,h]=(0,r.useState)(!1);(0,r.useEffect)(()=>{(0,u.apiFetch)(`/api/skills/${e.id}/versions?user=${encodeURIComponent(a||"")}`).then(e=>e.json()).then(e=>{n(e)})},[e.id]),(0,r.useEffect)(()=>{c(e.activeVersion)},[e.activeVersion]),(0,r.useEffect)(()=>{(0,u.apiFetch)("/api/config/status?check_org=true").then(e=>e.json()).then(e=>{h(e.org_mode||!1)}).catch(()=>{})},[]);let g=()=>{o&&d(),t()},y=async s=>{try{let t=await (0,u.apiFetch)(`/api/skills/${e.id}/activate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({version:s,user:a})});if(t.ok)c(s),x(!0);else{let e=await t.json();alert(`Failed to activate: ${e.error}`)}}catch(e){alert(`Error: ${e.message}`)}},k=async s=>{let{semanticVersion:t}=l.find(e=>e.version===s)||{},r=t||s;if(confirm(m?`确定要删除版本 ${r} 吗?此操作将同时删除企业中的对应skill(如果存在),无法撤销。`:`Are you sure you want to delete version ${r}? This action cannot be undone.`))try{let t=await (0,u.apiFetch)(`/api/skills/${e.id}/versions/${s}?user=${encodeURIComponent(a||"")}`,{method:"DELETE"});if(t.ok){alert(`Version ${r} deleted successfully!`);let t=await (0,u.apiFetch)(`/api/skills/${e.id}/versions?user=${encodeURIComponent(a||"")}`),d=await t.json();n(d),x(!0),i===s&&d.length>0&&c(d[0].version)}else{let e=await t.json();alert(`Failed to delete version: ${e.error}`)}}catch(e){alert(`Error: ${e.message}`)}},v=(0,r.useRef)(null),N=async s=>{let t=s.target.files;if(!t||0===t.length)return;let r=new FormData;r.append("targetSkillId",e.id),a&&r.append("user",a);for(let e=0;e<t.length;e++)r.append("files",t[e]),r.append("paths",t[e].webkitRelativePath);try{let s=await (0,u.apiFetch)("/api/skills/upload",{method:"POST",body:r}),t=await s.json();if(s.ok){alert(`Version v${t.version.version} uploaded successfully!`);let s=await (0,u.apiFetch)(`/api/skills/${e.id}/versions?user=${encodeURIComponent(a||"")}`);n(await s.json()),x(!0)}else alert(`Upload failed: ${t.error}`)}catch(e){alert(`Upload error: ${e.message}`)}finally{v.current&&(v.current.value="")}};return(0,s.jsx)("div",{className:"modal-overlay",onClick:g,children:(0,s.jsxs)("div",{className:"modal-window-lg",onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"modal-header-new",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{style:{margin:0,fontSize:"1.25rem",fontWeight:"bold",color:"#1e293b"},children:e.name}),(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",marginTop:"0.25rem",fontSize:"0.875rem",color:"#64748b"},children:[(0,s.jsx)("span",{children:"当前使用 (Active):"}),(0,s.jsxs)("span",{style:{color:"#16a34a",fontFamily:"monospace",fontWeight:"bold",background:"rgba(22, 163, 74, 0.1)",padding:"0 6px",borderRadius:"4px"},children:["v",l.find(e=>e.version===i)?.semanticVersion||i]})]})]}),(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"1rem"},children:[(0,s.jsx)("button",{className:"btn-primary",style:{fontSize:"0.85rem",display:"flex",alignItems:"center",gap:"0.5rem"},onClick:()=>v.current?.click(),children:(0,s.jsx)("span",{children:"📤 上传新版本"})}),(0,s.jsx)("button",{onClick:g,style:{background:"none",border:"none",color:"#64748b",fontSize:"1.5rem",cursor:"pointer",padding:"0 0.5rem"},children:"×"})]}),(0,s.jsx)("input",{ref:v,type:"file",webkitdirectory:"",directory:"",multiple:!0,style:{display:"none"},onChange:N})]}),(0,s.jsxs)("div",{className:"modal-content-scroll",children:[(0,s.jsxs)("table",{className:"version-table w-full text-left order-collapse",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{style:{width:"120px"},children:"版本"}),(0,s.jsx)("th",{children:"变更历史"}),(0,s.jsx)("th",{style:{textAlign:"right",width:"220px"},children:"Action"})]})}),(0,s.jsx)("tbody",{children:l.map(e=>{let t=e.version===i;return(0,s.jsxs)("tr",{className:`version-row ${t?"version-active-row":""}`,children:[(0,s.jsxs)("td",{children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,s.jsxs)("span",{style:{fontSize:"1rem",fontFamily:"monospace",fontWeight:"bold",color:t?"#16a34a":"#2563eb"},children:["v",e.semanticVersion||e.version]}),t&&(0,s.jsx)("span",{style:{fontSize:"0.7rem",backgroundColor:"rgba(22, 163, 74, 0.15)",color:"#16a34a",padding:"2px 6px",borderRadius:"4px",fontWeight:"bold",border:"1px solid rgba(22, 163, 74, 0.3)"},children:"ACTIVE"})]}),(0,s.jsx)("span",{style:{fontSize:"0.75rem",color:"#94a3b8"},children:new Date(e.createdAt).toLocaleDateString()})]}),(0,s.jsx)("td",{children:(0,s.jsx)("p",{style:{margin:0,color:"#334155",whiteSpace:"pre-wrap",lineHeight:1.6,fontSize:"0.9rem"},children:e.changeLog||(0,s.jsx)("span",{style:{color:"#94a3b8",fontStyle:"italic"},children:"无变更历史"})})}),(0,s.jsx)("td",{style:{textAlign:"right",minWidth:"280px"},children:(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:"0.5rem",flexWrap:"nowrap",alignItems:"center"},children:[(0,s.jsx)("button",{onClick:()=>f(e.version),className:"btn-sm",style:{background:"#f1f5f9",border:"1px solid #cbd5e1",padding:"6px 12px",color:"#475569",whiteSpace:"nowrap",fontSize:"0.85rem",minWidth:"60px"},children:"查看"}),t?(0,s.jsxs)("span",{style:{padding:"6px 12px",fontSize:"0.85rem",fontFamily:"monospace",color:"#16a34a",display:"flex",alignItems:"center",gap:"6px",whiteSpace:"nowrap"},children:[(0,s.jsx)("span",{style:{width:"6px",height:"6px",borderRadius:"50%",background:"#16a34a"}}),"当前"]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{onClick:()=>y(e.version),className:"btn-sm",style:{background:"#dbeafe",border:"1px solid #3b82f6",padding:"6px 12px",color:"#1d4ed8",whiteSpace:"nowrap",fontSize:"0.85rem",minWidth:"85px"},children:"激活 (set active)"}),(0,s.jsx)("button",{onClick:()=>k(e.version),className:"btn-sm",style:{background:"#fee2e2",border:"1px solid #f87171",padding:"6px 12px",color:"#dc2626",whiteSpace:"nowrap",fontSize:"0.85rem",minWidth:"65px"},children:"Delete"})]})]})})]},e.id)})})]}),0===l.length&&(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"200px",color:"#94a3b8"},children:[(0,s.jsx)("div",{style:{fontSize:"2rem",marginBottom:"1rem",opacity:.5},children:"📂"}),(0,s.jsx)("p",{children:"没有历史版本"})]})]}),null!==p&&(0,s.jsx)(j,{skillId:e.id,version:p,onClose:()=>f(null)})]})})}function v({refresh:e}){let{user:t}=(0,b.useAuth)(),[d,a]=(0,r.useState)([]),[l,n]=(0,r.useState)(!0),[i,c]=(0,r.useState)(null),[o,x]=(0,r.useState)(!1),p=()=>{t&&(n(!0),(0,u.apiFetch)(`/api/skills?user=${encodeURIComponent(t)}`).then(e=>e.json()).then(e=>{a(Array.isArray(e)?e:[]),n(!1)}))};(0,r.useEffect)(()=>{p()},[e]),(0,r.useEffect)(()=>{(0,u.apiFetch)("/api/config/status?check_org=true").then(e=>e.json()).then(e=>{x(e.org_mode||!1)}).catch(()=>{})},[]),(0,r.useEffect)(()=>{if(i){let e=d.find(e=>e.id===i.id);e&&c(e)}},[d]);let f=async e=>{if(confirm(o?"确定要删除这个skill吗?此操作将同时删除企业中的对应skill,无法撤销。":"Are you sure you want to delete this skill? This action cannot be undone."))try{let s=await (0,u.apiFetch)(`/api/skills?id=${e}&user=${encodeURIComponent(t||"")}`,{method:"DELETE"}),r=await s.json();s.ok?p():alert(`Failed to delete skill: ${r.error}`)}catch(e){alert(`Delete error: ${e.message}`)}},m=async(e,s,r)=>{r.stopPropagation();try{(await (0,u.apiFetch)(`/api/skills/${e}/toggle`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({isUploaded:!s,user:t})})).ok?p():alert("Failed to toggle upload status")}catch(e){alert(`Error: ${e.message}`)}},h=d.length,g=d.filter(e=>e.isUploaded).length;return l?(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",padding:"5rem"},children:[(0,s.jsx)("div",{className:"loading-spinner",style:{width:"2rem",height:"2rem",border:"2px solid #e2e8f0",borderTopColor:"#2563eb",borderRadius:"50%",animation:"spin 1s linear infinite"}}),(0,s.jsx)("style",{children:"@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }"})]}):(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"stats-header",style:{display:"flex",gap:"2rem",marginBottom:"2rem",background:"#f8fafc",padding:"1.5rem",borderRadius:"0.75rem",border:"1px solid #e2e8f0"},children:[(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column"},children:[(0,s.jsx)("span",{style:{fontSize:"0.875rem",color:"#64748b",textTransform:"uppercase",letterSpacing:"0.05em",fontWeight:600},children:"Skill 总数"}),(0,s.jsx)("span",{style:{fontSize:"2.5rem",fontWeight:700,color:"#1e293b",lineHeight:1},children:h})]}),(0,s.jsx)("div",{style:{width:"1px",background:"#e2e8f0"}}),(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column"},children:[(0,s.jsx)("span",{style:{fontSize:"0.875rem",color:"#64748b",textTransform:"uppercase",letterSpacing:"0.05em",fontWeight:600},children:"已上传 Skill"}),(0,s.jsx)("span",{style:{fontSize:"2.5rem",fontWeight:700,color:"#16a34a",lineHeight:1},children:g})]})]}),(0,s.jsxs)("div",{className:"skill-grid",children:[d.map(e=>(0,s.jsxs)("div",{className:"skill-card",children:[(0,s.jsxs)("div",{className:"skill-card-header",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"skill-title",title:e.name,children:e.name}),(0,s.jsxs)("div",{className:"skill-meta",children:[(0,s.jsx)("span",{className:"skill-version-badge",children:e.semanticVersion?`v${e.semanticVersion}`:`v${e.version}`}),(0,s.jsx)("span",{className:"skill-date",children:new Date(e.updatedAt).toLocaleDateString()})]})]}),(0,s.jsx)("div",{className:"skill-icon",children:"🧩"})]}),(0,s.jsxs)("div",{className:"skill-body",children:[(0,s.jsx)("div",{className:"skill-description",children:e.description||(0,s.jsx)("span",{style:{fontStyle:"italic",color:"#94a3b8"},children:"No description provided for this skill."})}),(0,s.jsxs)("div",{className:"skill-tags",children:[e.tags?.slice(0,3).map((e,t)=>(0,s.jsxs)("span",{className:"skill-tag",children:["#",e]},t)),(e.tags?.length||0)>3&&(0,s.jsxs)("span",{className:"skill-tag",style:{background:"transparent",border:"none",color:"#94a3b8"},children:["+",e.tags.length-3]})]})]}),(0,s.jsxs)("div",{className:"skill-actions",children:[(0,s.jsx)("button",{onClick:s=>m(e.id,e.isUploaded,s),className:`btn-icon ${e.isUploaded?"uploaded":""}`,title:e.isUploaded?"Withdraw Skill (Stop Sync)":"Upload Skill (Enable Sync)",style:{background:e.isUploaded?"rgba(22, 163, 74, 0.1)":"transparent",border:`1px solid ${e.isUploaded?"#16a34a":"#cbd5e1"}`,color:e.isUploaded?"#16a34a":"#64748b",padding:"0.4rem",borderRadius:"4px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s"},children:e.isUploaded?"☁️ 激活":"☁️ 未激活"}),(0,s.jsxs)("button",{onClick:()=>c(e),className:"btn-manage",children:[(0,s.jsx)("span",{children:"⚙️"}),(0,s.jsx)("span",{children:"版本管理"})]}),(0,s.jsx)("button",{onClick:()=>f(e.id),className:"btn-delete",title:"Delete Skill",children:(0,s.jsx)("span",{children:"🗑️"})})]})]},e.id)),0===d.length&&(0,s.jsxs)("div",{className:"upload-card",style:{gridColumn:"1 / -1",background:"transparent",borderStyle:"dashed"},children:[(0,s.jsx)("div",{style:{fontSize:"3rem",marginBottom:"1rem",opacity:.3},children:"📦"}),(0,s.jsx)("p",{style:{color:"#64748b",fontSize:"1.2rem"},children:"无 skill"}),(0,s.jsx)("p",{style:{color:"#94a3b8",fontSize:"0.9rem",marginTop:"0.5rem"},children:"上传 skill"})]})]}),i&&(0,s.jsx)(k,{skill:i,onClose:()=>c(null),onUpdate:p})]})}function N(){let[e,t]=(0,r.useState)("catalog"),[d,a]=(0,r.useState)(0),[l,n]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{(0,u.apiFetch)("/api/config/status?check_org=true").then(e=>e.json()).then(e=>{n(e.org_mode||!1)}).catch(()=>{})},[]),(0,s.jsxs)("div",{style:{marginTop:"1rem"},children:[(0,s.jsxs)("div",{className:"nav-tabs",children:[(0,s.jsx)("button",{onClick:()=>t("catalog"),className:`nav-tab-item ${"catalog"===e?"active":""}`,children:"Skill 管理"}),(0,s.jsx)("button",{onClick:()=>t("upload"),className:`nav-tab-item ${"upload"===e?"active":""}`,children:"上传 Skill"})]}),(0,s.jsxs)("div",{style:{minHeight:"400px"},children:["catalog"===e&&(0,s.jsx)(v,{refresh:d}),"upload"===e&&(0,s.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(300px, 1fr))",gap:"2rem"},children:[(0,s.jsx)(g,{onSuccess:()=>{a(e=>e+1),t("catalog")}}),l&&(0,s.jsx)(h,{onSuccess:()=>{a(e=>e+1)}})]})]})]})}function S({step:e,currentStep:a,totalSteps:l,onNext:n,onPrev:i,onSkip:c,onDismiss:o,onDontShowAgain:x,isVisible:p}){let[f,m]=(0,r.useState)({top:0,left:0}),[u,b]=(0,r.useState)({top:0,left:0}),h=(0,r.useRef)(null),g=e=>{if(navigator.clipboard&&window.isSecureContext)navigator.clipboard.writeText(e).then(()=>{alert("复制成功!")}).catch(()=>{alert("复制失败,请手动复制")});else{let s=document.createElement("textarea");s.value=e,s.style.position="fixed",s.style.left="-9999px",s.style.top="0",document.body.appendChild(s),s.focus(),s.select();try{document.execCommand("copy"),alert("复制成功!")}catch(e){console.error("Fallback: Fallback: Oops, unable to copy",e),alert("复制失败,请手动复制")}document.body.removeChild(s)}},j=(0,r.useCallback)(()=>{if("center"===e.position){if(!h.current)return;let e=h.current.getBoundingClientRect();m({top:(window.innerHeight-e.height)/2,left:(window.innerWidth-e.width)/2}),b({top:0,left:0});return}let s=document.querySelector(e.target);if(!s||!h.current)return;let t=s.getBoundingClientRect(),r=h.current.getBoundingClientRect(),d=0,a=0,l=0,n=0,i=t.left+t.width/2,c=t.top+t.height/2;switch(e.position){case"top":d=t.top-r.height-12,a=i-r.width/2;break;case"bottom":d=t.bottom+12,a=i-r.width/2;break;case"left":d=c-r.height/2,a=t.left-r.width-12;break;case"right":d=c-r.height/2,a=t.right+12}switch(a<10&&(a=10),a+r.width>window.innerWidth-10&&(a=window.innerWidth-r.width-10),d<10&&(d=10),d+r.height>window.innerHeight-10&&(d=window.innerHeight-r.height-10),e.position){case"top":case"bottom":n=i-a-8,l="top"===e.position?r.height-8:-8;break;case"left":case"right":l=c-d-8,n="left"===e.position?r.width-8:-8}m({top:d,left:a}),b({top:l,left:n})},[e]);if((0,r.useEffect)(()=>{if(p){let e=requestAnimationFrame(()=>{j()});return window.addEventListener("resize",j),window.addEventListener("scroll",j,!0),()=>{cancelAnimationFrame(e),window.removeEventListener("resize",j),window.removeEventListener("scroll",j,!0)}}},[p,j]),!p)return null;let y="center"===e.position;return(0,d.createPortal)((0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"rgba(0, 0, 0, 0.5)",zIndex:9998,pointerEvents:"auto"},onClick:o,className:"jsx-f29a97b83a083e27"}),(0,s.jsxs)("div",{ref:h,style:{position:"fixed",top:f.top,left:f.left,background:y?"linear-gradient(135deg, #1e293b 0%, #0f172a 100%)":"#1e293b",border:"1px solid #38bdf8",borderRadius:y?"16px":"12px",padding:y?"32px 40px":"20px",maxWidth:y?"480px":"360px",minWidth:y?"320px":"280px",zIndex:9999,boxShadow:y?"0 25px 50px rgba(0, 0, 0, 0.5), 0 0 40px rgba(56, 189, 248, 0.3)":"0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(56, 189, 248, 0.2)",animation:"fadeInScale 0.3s ease-out",textAlign:y?"center":"left"},className:"jsx-f29a97b83a083e27",children:[!y&&(0,s.jsx)("div",{style:(()=>{if("center"===e.position)return null;let s={position:"absolute",width:0,height:0,borderStyle:"solid"};switch(e.position){case"top":return{...s,top:u.top,left:u.left,borderWidth:"8px 8px 0 8px",borderColor:"#1e293b transparent transparent transparent"};case"bottom":return{...s,top:u.top,left:u.left,borderWidth:"0 8px 8px 8px",borderColor:"transparent transparent #1e293b transparent"};case"left":return{...s,top:u.top,left:u.left,borderWidth:"8px 0 8px 8px",borderColor:"transparent transparent transparent #1e293b"};case"right":return{...s,top:u.top,left:u.left,borderWidth:"8px 8px 8px 0",borderColor:"transparent #1e293b transparent transparent"};default:return null}})()||{},className:"jsx-f29a97b83a083e27"}),y&&(0,s.jsx)("div",{style:{fontSize:"3rem",marginBottom:"16px"},className:"jsx-f29a97b83a083e27",children:"👋"}),(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"12px"},className:"jsx-f29a97b83a083e27",children:[(0,s.jsx)("h3",{style:{margin:0,color:"#38bdf8",fontSize:y?"1.4rem":"1.1rem",fontWeight:600,width:"100%"},className:"jsx-f29a97b83a083e27",children:e.title}),(0,s.jsx)("button",{onClick:o,style:{background:"transparent",border:"none",color:"#94a3b8",cursor:"pointer",fontSize:"1.2rem",padding:"0",lineHeight:1},className:"jsx-f29a97b83a083e27",children:"✕"})]}),(0,s.jsx)("p",{style:{margin:"0 0 16px 0",color:"#e2e8f0",fontSize:"0.9rem",lineHeight:1.6},className:"jsx-f29a97b83a083e27",children:e.content}),e.linkUrl&&e.linkText&&(0,s.jsx)("div",{style:{marginBottom:"16px"},className:"jsx-f29a97b83a083e27",children:(0,s.jsxs)("a",{href:e.linkUrl,target:"_blank",rel:"noopener noreferrer",style:{color:"#38bdf8",textDecoration:"none",fontSize:"0.9rem",fontWeight:500,display:"inline-flex",alignItems:"center",gap:"6px",padding:"8px 16px",background:"rgba(56, 189, 248, 0.1)",borderRadius:"6px",border:"1px solid rgba(56, 189, 248, 0.3)",transition:"all 0.2s"},onClick:e=>e.stopPropagation(),className:"jsx-f29a97b83a083e27",children:[e.linkText,(0,s.jsx)("span",{style:{fontSize:"0.8rem"},className:"jsx-f29a97b83a083e27",children:"↗"})]})}),e.setupCommands&&(0,s.jsxs)("div",{style:{marginBottom:"16px",textAlign:"left"},className:"jsx-f29a97b83a083e27",children:[(0,s.jsx)("div",{style:{color:"#94a3b8",fontSize:"0.85rem",marginBottom:"12px",lineHeight:1.5},className:"jsx-f29a97b83a083e27",children:"为了让客户端能够连接到平台并上报数据,需要配置客户端环境。请根据您的操作系统选择以下命令执行:"}),(0,s.jsxs)("div",{style:{marginBottom:"10px"},className:"jsx-f29a97b83a083e27",children:[(0,s.jsxs)("div",{style:{color:"#38bdf8",fontSize:"0.85rem",fontWeight:600,marginBottom:"6px",display:"flex",alignItems:"center",gap:"6px"},className:"jsx-f29a97b83a083e27",children:[(0,s.jsx)("span",{className:"jsx-f29a97b83a083e27",children:"🐧"}),(0,s.jsx)("span",{className:"jsx-f29a97b83a083e27",children:"Linux / macOS"})]}),(0,s.jsxs)("div",{style:{background:"#0f172a",border:"1px solid #334155",borderRadius:"6px",padding:"10px",position:"relative"},className:"jsx-f29a97b83a083e27",children:[(0,s.jsx)("code",{style:{color:"#e2e8f0",fontSize:"0.8rem",fontFamily:"monospace",wordBreak:"break-all",display:"block",paddingRight:"40px"},className:"jsx-f29a97b83a083e27",children:e.setupCommands.linux}),(0,s.jsx)("button",{onClick:()=>{g(e.setupCommands.linux)},style:{position:"absolute",top:"8px",right:"8px",background:"rgba(56, 189, 248, 0.2)",border:"1px solid rgba(56, 189, 248, 0.4)",color:"#38bdf8",padding:"4px 8px",borderRadius:"4px",cursor:"pointer",fontSize:"0.75rem",fontWeight:500,transition:"all 0.2s"},onMouseEnter:e=>{e.currentTarget.style.background="rgba(56, 189, 248, 0.3)"},onMouseLeave:e=>{e.currentTarget.style.background="rgba(56, 189, 248, 0.2)"},className:"jsx-f29a97b83a083e27",children:"复制"})]})]}),(0,s.jsxs)("div",{className:"jsx-f29a97b83a083e27",children:[(0,s.jsxs)("div",{style:{color:"#38bdf8",fontSize:"0.85rem",fontWeight:600,marginBottom:"6px",display:"flex",alignItems:"center",gap:"6px"},className:"jsx-f29a97b83a083e27",children:[(0,s.jsx)("span",{className:"jsx-f29a97b83a083e27",children:"🪟"}),(0,s.jsx)("span",{className:"jsx-f29a97b83a083e27",children:"Windows"})]}),(0,s.jsxs)("div",{style:{background:"#0f172a",border:"1px solid #334155",borderRadius:"6px",padding:"10px",position:"relative"},className:"jsx-f29a97b83a083e27",children:[(0,s.jsx)("code",{style:{color:"#e2e8f0",fontSize:"0.8rem",fontFamily:"monospace",wordBreak:"break-all",display:"block",paddingRight:"40px"},className:"jsx-f29a97b83a083e27",children:e.setupCommands.windows}),(0,s.jsx)("button",{onClick:()=>{g(e.setupCommands.windows)},style:{position:"absolute",top:"8px",right:"8px",background:"rgba(56, 189, 248, 0.2)",border:"1px solid rgba(56, 189, 248, 0.4)",color:"#38bdf8",padding:"4px 8px",borderRadius:"4px",cursor:"pointer",fontSize:"0.75rem",fontWeight:500,transition:"all 0.2s"},onMouseEnter:e=>{e.currentTarget.style.background="rgba(56, 189, 248, 0.3)"},onMouseLeave:e=>{e.currentTarget.style.background="rgba(56, 189, 248, 0.2)"},className:"jsx-f29a97b83a083e27",children:"复制"})]})]}),e.apiKey&&(0,s.jsxs)("div",{style:{background:"rgba(56, 189, 248, 0.1)",border:"1px solid rgba(56, 189, 248, 0.3)",borderRadius:"6px",padding:"10px",marginTop:"12px"},className:"jsx-f29a97b83a083e27",children:[(0,s.jsx)("div",{style:{color:"#38bdf8",fontSize:"0.85rem",fontWeight:600,marginBottom:"6px"},className:"jsx-f29a97b83a083e27",children:"🔑 您的 API Key"}),(0,s.jsxs)("div",{style:{position:"relative"},className:"jsx-f29a97b83a083e27",children:[(0,s.jsx)("div",{style:{color:"#e2e8f0",fontSize:"0.8rem",fontFamily:"monospace",wordBreak:"break-all",marginBottom:"6px",paddingRight:"50px"},className:"jsx-f29a97b83a083e27",children:e.apiKey}),(0,s.jsx)("button",{onClick:()=>{g(e.apiKey)},style:{position:"absolute",top:"0",right:"0",background:"rgba(56, 189, 248, 0.2)",border:"1px solid rgba(56, 189, 248, 0.4)",color:"#38bdf8",padding:"4px 8px",borderRadius:"4px",cursor:"pointer",fontSize:"0.75rem",fontWeight:500,transition:"all 0.2s"},onMouseEnter:e=>{e.currentTarget.style.background="rgba(56, 189, 248, 0.3)"},onMouseLeave:e=>{e.currentTarget.style.background="rgba(56, 189, 248, 0.2)"},className:"jsx-f29a97b83a083e27",children:"复制"})]}),(0,s.jsx)("div",{style:{color:"#94a3b8",fontSize:"0.75rem",lineHeight:1.4},className:"jsx-f29a97b83a083e27",children:"执行上述命令时,系统会提示您输入 API Key,请复制上面的 Key 粘贴到终端中。"})]})]}),(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",marginBottom:"16px",gap:"8px"},className:"jsx-f29a97b83a083e27",children:[Array.from({length:l}).map((e,t)=>(0,s.jsx)("div",{style:{width:"8px",height:"8px",borderRadius:"50%",background:t===a?"#38bdf8":"#475569",transition:"background 0.2s"},className:"jsx-f29a97b83a083e27"},t)),(0,s.jsxs)("span",{style:{marginLeft:"auto",color:"#94a3b8",fontSize:"0.8rem"},className:"jsx-f29a97b83a083e27",children:[a+1," / ",l]})]}),(0,s.jsxs)("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap"},className:"jsx-f29a97b83a083e27",children:[a>0&&(0,s.jsx)("button",{onClick:i,style:{background:"transparent",border:"1px solid #475569",color:"#94a3b8",padding:"8px 16px",borderRadius:"6px",cursor:"pointer",fontSize:"0.85rem"},className:"jsx-f29a97b83a083e27",children:"上一步"}),e.action&&e.actionLabel&&(0,s.jsx)("button",{onClick:()=>{e.action?.(),n()},style:{background:"linear-gradient(135deg, #38bdf8, #818cf8)",border:"none",color:"white",padding:"8px 16px",borderRadius:"6px",cursor:"pointer",fontSize:"0.85rem",fontWeight:600},className:"jsx-f29a97b83a083e27",children:e.actionLabel}),a<l-1?(0,s.jsx)("button",{onClick:n,style:{background:"#38bdf8",border:"none",color:"#0f172a",padding:"8px 16px",borderRadius:"6px",cursor:"pointer",fontSize:"0.85rem",fontWeight:600},className:"jsx-f29a97b83a083e27",children:"下一步"}):(0,s.jsx)("button",{onClick:o,style:{background:"#4ade80",border:"none",color:"#0f172a",padding:"8px 16px",borderRadius:"6px",cursor:"pointer",fontSize:"0.85rem",fontWeight:600},className:"jsx-f29a97b83a083e27",children:"完成"}),(0,s.jsx)("button",{onClick:c,style:{background:"transparent",border:"none",color:"#94a3b8",padding:"8px 12px",borderRadius:"6px",cursor:"pointer",fontSize:"0.8rem"},className:"jsx-f29a97b83a083e27",children:"跳过"})]}),(0,s.jsx)("div",{style:{marginTop:"12px",paddingTop:"12px",borderTop:"1px solid #334155"},className:"jsx-f29a97b83a083e27",children:(0,s.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:"8px",color:"#94a3b8",fontSize:"0.8rem",cursor:"pointer"},className:"jsx-f29a97b83a083e27",children:[(0,s.jsx)("input",{type:"checkbox",onChange:e=>{e.target.checked&&x()},style:{accentColor:"#38bdf8"},className:"jsx-f29a97b83a083e27"}),"不再显示指引"]})})]}),(0,s.jsx)(t.default,{id:"f29a97b83a083e27",children:"@keyframes fadeInScale{0%{opacity:0;transform:scale(.9)}to{opacity:1;transform:scale(1)}}"})]}),document.body)}function w({steps:e,onComplete:t,onSkip:d,onDontShowAgain:a,startStep:l=0}){let[n,i]=(0,r.useState)(l),[c,o]=(0,r.useState)(!0);return 0===e.length||n>=e.length?null:(0,s.jsx)(S,{step:e[n],currentStep:n,totalSteps:e.length,onNext:()=>{n<e.length-1?i(n+1):(o(!1),t())},onPrev:()=>{n>0&&i(n-1)},onSkip:()=>{d(e[n].id),o(!1),t()},onDismiss:()=>{o(!1),t()},onDontShowAgain:a,isVisible:c})}let _=[{id:"welcome",target:"",title:"欢迎使用 Skill-Insight",content:"这是智能体技能评估、分析与优化平台。接下来将引导您完成关键配置,帮助您快速上手使用。",position:"center"},{id:"eval-config",target:".controls",title:"配置评测模型",content:"配置评测模型是使用平台核心分析能力的前提,用于:数据集数据项抽取、Skill执行分析、有效性分析。您可以选择 DeepSeek、OpenAI 等模型作为评测引擎。点击⚙️按钮可以配置评测模型的 API Key 和参数。",position:"bottom",actionLabel:"配置模型"},{id:"dataset-config",target:".tabs .tab-btn:nth-child(2)",title:"配置数据集",content:'数据集用于定义测试问题和标准答案。配置数据集后,系统将使用刚才配置的评测模型自动评估 Agent 的回答质量。点击"数据集管理"标签页可以添加和管理您的测试数据集。',position:"bottom",actionLabel:"前往配置"},{id:"skill-upload",target:".tabs .tab-btn:nth-child(3)",title:"上传技能包",content:'Skill(技能包)是 Agent 执行特定任务的指导文档。上传技能包后,您可以评估其在 Agent 中的实际效果。点击"技能管理"标签页可以上传和管理技能包。',position:"bottom",actionLabel:"前往上传"},{id:"user-manual",target:".title",title:"查看用户手册",content:"需要更详细的帮助?您可以查看用户使用手册获取完整的使用说明和最佳实践指南。",position:"bottom",linkUrl:"https://atomgit.com/openeuler/witty-skill-insight/wiki/%E7%94%A8%E6%88%B7%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C",linkText:"📖 查看用户使用手册"}],C=["#2563eb","#db2777","#16a34a","#d97706","#7c3aed","#dc2626"],z=e=>{if(e<1e3)return`${e.toFixed(0)}ms`;let s=e/1e3;if(s>=60){let e=Math.floor(s/60),t=Math.round(s%60);return 0===t?`${e}m`:`${e}m${t}s`}return`${s.toFixed(1)}s`},T=e=>e>=1e3?`${(e/1e3).toFixed(1)}k`:e.toString(),R=e=>null==e?null:0===e?"$0.00":e<.01?`$${e.toFixed(4)}`:e<1?`$${e.toFixed(3)}`:`$${e.toFixed(2)}`,F=(e,s)=>{switch(s){case"latency":return e.latency;case"accuracy":return e.answer_score??0;case"tokens":return e.tokens;case"cost":return e.cost??0;case"recall":return(e.skill_recall_rate??0)*100}},I=(e,s)=>{switch(s){case"latency":return null!=e.latency;case"accuracy":return null!=e.answer_score;case"tokens":return null!=e.tokens;case"cost":return null!=e.cost;case"recall":return null!=e.skill_recall_rate}},$=e=>{switch(e){case"latency":return"时延";case"accuracy":return"准确率";case"tokens":return"Token";case"cost":return"成本";case"recall":return"召回率"}},A=(e,s)=>{switch(s){case"latency":return z(e.latency);case"accuracy":return null===e.answer_score?"--":(e.answer_score||0).toFixed(2);case"tokens":return T(e.tokens);case"cost":return R(e.cost)||"-";case"recall":return null==e.skill_recall_rate?"--":`${((e.skill_recall_rate??0)*100).toFixed(1)}%`}},W=e=>"latency"===e||"tokens"===e||"cost"===e,D=(e,t)=>{if(null===e)return null;if(.05>Math.abs(e))return(0,s.jsx)("span",{style:{fontSize:"0.75rem",color:"#94a3b8",marginLeft:"4px"},children:"—"});let r=e>0;return(0,s.jsxs)("span",{style:{fontSize:"0.75rem",color:(t?!r:r)?"#4ade80":"#f87171",marginLeft:"4px"},children:[r?"↑":"↓",Math.abs(e).toFixed(1),"%"]})},B=e=>{let s=e.filter(e=>null!=e.cost);if(0===s.length)return null;let t=s.length,r=s.filter(e=>e.is_answer_correct).length;return 0===r?null:s.reduce((e,s)=>e+(s.cost||0),0)/t/(r/t)},E=e=>{let s=e.filter(e=>null!==e.answer_score&&void 0!==e.answer_score);return 0===s.length?{successRate:null,evaluatedCount:0}:{successRate:s.filter(e=>!0===e.is_answer_correct).length/s.length,evaluatedCount:s.length}},O=e=>{if(!e)return"-";let s=new Date(e);return s.getFullYear()+"/"+String(s.getMonth()+1).padStart(2,"0")+"/"+String(s.getDate()).padStart(2,"0")+" "+String(s.getHours()).padStart(2,"0")+":"+String(s.getMinutes()).padStart(2,"0")+":"+String(s.getSeconds()).padStart(2,"0")},L=({content:e})=>{let[t,a]=(0,r.useState)(!1),l=(0,r.useRef)(null),[n,i]=(0,r.useState)({top:0,left:0});return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{ref:l,style:{marginLeft:"4px",cursor:"help",fontSize:"0.8rem",display:"inline-block"},onMouseEnter:()=>{if(l.current){let e=l.current.getBoundingClientRect();i({top:e.top,left:e.left+e.width/2}),a(!0)}},onMouseLeave:()=>a(!1),children:"ⓘ"}),t&&"u">typeof document&&(0,d.createPortal)((0,s.jsxs)("div",{style:{position:"fixed",top:n.top-8,left:n.left,transform:"translate(-50%, -100%)",background:"#ffffff",border:"1px solid #e2e8f0",color:"#334155",padding:"6px 10px",borderRadius:"4px",whiteSpace:"pre-wrap",minWidth:"200px",textAlign:"left",zIndex:9999,boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1)",pointerEvents:"none"},children:[e,(0,s.jsx)("div",{style:{position:"absolute",top:"100%",left:"50%",marginLeft:"-4px",width:0,height:0,borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderTop:"4px solid #e2e8f0"}})]}),document.body)]})};function P(){let e,d,h,g,j,y,{user:k,apiKey:v}=(0,b.useAuth)(),[S,P]=(0,r.useState)(!1),{theme:M,toggleTheme:U,isDark:q}=(0,m.useTheme)(),[H,K]=(0,r.useState)(null),{guideState:J,loading:V,shouldShowGuide:Y,setShouldShowGuide:Q,markStepSkipped:X,disableGuide:G,dismissForToday:Z}=function(e){let[s,t]=(0,r.useState)(null),[d,a]=(0,r.useState)(!0),[l,n]=(0,r.useState)(!1),i=(0,r.useCallback)(async()=>{if(!e)return void a(!1);try{let s=await (0,u.apiFetch)("/api/guide",{headers:{"x-user-id":e}});if(s.ok){let e=await s.json(),r={...e,completedSteps:JSON.parse(e.completedSteps||"[]"),skippedSteps:JSON.parse(e.skippedSteps||"[]")};t(r);let d=e.guideDisabled,a=e.dismissedAt&&new Date(e.dismissedAt).toDateString()===new Date().toDateString();n(!d&&!a)}}catch(e){console.error("Failed to fetch guide state:",e)}finally{a(!1)}},[e]);(0,r.useEffect)(()=>{i()},[i]);let c=(0,r.useCallback)(async s=>{if(e)try{let r=await (0,u.apiFetch)("/api/guide",{method:"POST",headers:{"Content-Type":"application/json","x-user-id":e},body:JSON.stringify(s)});if(r.ok){let e=await r.json(),s={...e,completedSteps:JSON.parse(e.completedSteps||"[]"),skippedSteps:JSON.parse(e.skippedSteps||"[]")};return t(s),s}}catch(e){console.error("Failed to update guide state:",e)}},[e]),o=(0,r.useCallback)(async e=>{if(!s)return;let t=[...new Set([...s.completedSteps,e])];await c({completedSteps:t})},[s,c]),x=(0,r.useCallback)(async e=>{if(!s)return;let t=[...new Set([...s.skippedSteps,e])];await c({skippedSteps:t})},[s,c]),p=(0,r.useCallback)(async()=>{await c({guideDisabled:!0}),n(!1)},[c]),f=(0,r.useCallback)(async()=>{await c({guideDisabled:!1,dismissedAt:null}),n(!0)},[c]),m=(0,r.useCallback)(async()=>{await c({dismissedAt:new Date().toISOString()}),n(!1)},[c]),b=(0,r.useCallback)(async()=>{await c({currentStep:0,completedSteps:[],skippedSteps:[],guideDisabled:!1,dismissedAt:null}),n(!0)},[c]);return{guideState:s,loading:d,shouldShowGuide:l,setShouldShowGuide:n,markStepCompleted:o,markStepSkipped:x,disableGuide:p,enableGuide:f,dismissForToday:m,resetGuide:b,setCurrentStep:(0,r.useCallback)(async e=>{await c({currentStep:e})},[c]),refresh:i}}(k),[ee,es]=(0,r.useState)([]);(0,r.useEffect)(()=>{if(J){var e,s;es((e=J.completedSteps,s=J.skippedSteps,_.filter(t=>!e.includes(t.id)&&!s.includes(t.id))).map(e=>{if("welcome"===e.id&&v&&1){let s=window.location.host,t=window.location.protocol,r=`${t}//${s}`,d=(0,u.getApiUrl)("/api/setup"),a=`curl -sSf "${r}${d}" | bash`,l=`irm "${r}${d}" | iex`;return{...e,setupCommands:{linux:a,windows:l},apiKey:v}}return e}))}},[J,v]),(0,r.useEffect)(()=>{if(v)K(v);else if(1){let e=localStorage.getItem("api_key");e&&K(e)}},[v]);let[et,er]=(0,r.useState)("dashboard"),[ed,ea]=(0,r.useState)(!1);(0,r.useEffect)(()=>{ed&&k&&(0,u.apiFetch)("/api/auth/apikey",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:k})}).then(e=>e.json()).then(e=>{e.apiKey&&(K(e.apiKey),localStorage.setItem("api_key",e.apiKey))}).catch(e=>console.error("Failed to fetch fresh API key",e))},[ed,k]);let[el,en]=(0,r.useState)([]),[ei,ec]=(0,r.useState)(!0),[eo,ex]=(0,r.useState)([]),[ep,ef]=(0,r.useState)([]),[em,eu]=(0,r.useState)(new Set),[eb,eh]=(0,r.useState)(null),[eg,ej]=(0,r.useState)(null),[ey,ek]=(0,r.useState)(""),[ev,eN]=(0,r.useState)("all"),[eS,ew]=(0,r.useState)("latest_10"),[e_,eC]=(0,r.useState)(""),[ez,eT]=(0,r.useState)(""),[eR,eF]=(0,r.useState)(""),[eI,e$]=(0,r.useState)(""),[eA,eW]=(0,r.useState)(!1),[eD,eB]=(0,r.useState)([]),[eE,eO]=(0,r.useState)("framework"),[eL,eP]=(0,r.useState)(!1),[eM,eU]=(0,r.useState)(!1),[eq,eH]=(0,r.useState)([]),[eK,eJ]=(0,r.useState)([]),[eV,eY]=(0,r.useState)("latency"),[eQ,eX]=(0,r.useState)(""),[eG,eZ]=(0,r.useState)(!1),[e0,e1]=(0,r.useState)(!1),[e2,e9]=(0,r.useState)(!1),[e3,e6]=(0,r.useState)(null),[e7,e8]=(0,r.useState)([]),[e4,e5]=(0,r.useState)("default"),[se,ss]=(0,r.useState)(null),[st,sr]=(0,r.useState)({id:"new",name:"New Config",provider:"deepseek",model:"deepseek-chat"}),sd=async()=>{e9(!0),e6(null);try{let e=[...e7],s={...st};"new"===s.id?(s.id=`config_${Date.now()}`,e.push(s)):e=e.map(e=>e.id===s.id?s:e);let t={provider:s.provider,apiKey:s.apiKey,baseUrl:s.baseUrl,model:s.model};e6({type:"success",msg:"Testing connection..."});let r=await (0,u.apiFetch)("/api/settings/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),d=await r.json();if(!d.success){e6({type:"error",msg:`Connection Test Failed: ${d.error}`}),e9(!1);return}let a=e4;(1===e.length||"default"===e4)&&(a=s.id);let l={activeConfigId:a,configs:e},n=await (0,u.apiFetch)("/api/settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:l,user:k})});if(n.ok)e8(e),e5(a),ss(null),e6({type:"success",msg:"Saved!"}),setTimeout(()=>e6(null),1500);else{let e=await n.json();e6({type:"error",msg:`Failed to save settings: ${e.error||n.statusText}`})}}catch(e){e6({type:"error",msg:`Error: ${e.message}`})}finally{e9(!1)}},sa=async e=>{await (0,u.apiFetch)("/api/settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:{activeConfigId:e,configs:e7},user:k})}),e5(e)},sl=async e=>{if(!confirm("Are you sure?"))return;let s=e7.filter(s=>s.id!==e),t=e4;e===e4&&(t=s[0]?.id||"");let r={activeConfigId:t,configs:s};await (0,u.apiFetch)("/api/settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:r,user:k})}),e8(s),e5(t)};(0,r.useEffect)(()=>{sg()},[]),(0,r.useEffect)(()=>{(0,u.apiFetch)("/api/config/status?check_org=true").then(e=>e.json()).then(e=>P(e.org_mode||!1)).catch(()=>{})},[]),(0,r.useEffect)(()=>{e0&&(sg(),e6(null),ss(null))},[e0]),(0,r.useEffect)(()=>{eb&&eb.user_feedback?eX(eb.user_feedback.comment||""):eX("")},[eb]);let[sn,si]=(0,r.useState)(""),[sc,so]=(0,r.useState)(""),[sx,sp]=(0,r.useState)(""),[sf,sm]=(0,r.useState)(""),[su,sb]=(0,r.useState)(1);(0,r.useEffect)(()=>{sb(1)},[sn,sc,sx,sf,ev]);let sh=async()=>{ec(!0);try{let e=k?`/api/data?user=${encodeURIComponent(k)}`:"/api/data",s=await (0,u.apiFetch)(e,{cache:"no-store"}),t=(await s.json()).filter(e=>e.query&&""!==e.query.trim()).map(e=>{let s=Number(e.latency||0);return("opencode"===e.framework||"openhands"===e.framework||"claude"===e.framework)&&(s*=1e3),{...e,tokens:Number(e.tokens||e.Token||0),latency:s,framework:("claude"===e.framework?"claudecode":e.framework)||"Unknown",model:e.model||"Unknown",skill_score:void 0!==e.skill_score?Number(e.skill_score):void 0,answer_score:null===e.answer_score?null:void 0!==e.answer_score?Number(e.answer_score):+!!e.is_answer_correct}});en(t)}catch(e){console.error("Failed to fetch data",e)}finally{ec(!1)}},sg=(0,r.useCallback)(async()=>{if(k)try{let e=await (0,u.apiFetch)(`/api/settings?user=${encodeURIComponent(k)}`);if(e.ok){let s=await e.json();s.configs&&(e8(s.configs),e5(s.activeConfigId||s.configs[0]?.id||"default"))}}catch(e){console.error("Failed to fetch settings",e)}},[k]);(0,r.useEffect)(()=>{k&&(sh(),k&&(0,u.apiFetch)(`/api/config?user=${encodeURIComponent(k)}`).then(e=>e.json()).then(e=>{Array.isArray(e)?ex(e):console.error("Invalid config data received:",e)}).catch(e=>console.error("Failed to fetch configs",e)),k&&(0,u.apiFetch)(`/api/skills?user=${encodeURIComponent(k)}`).then(e=>e.json()).then(e=>{Array.isArray(e)?ef(e):console.error("Invalid skills data received:",e)}).catch(e=>console.error("Failed to fetch skills",e)),sg())},[k,sg]);let sj=async e=>{if(confirm("确定要删除这条记录吗?"))try{(await (0,u.apiFetch)(`/api/data?user=${encodeURIComponent(k||"")}`,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok?sh():alert("删除失败")}catch(e){alert("删除出错")}},sy=async(e,s)=>{if(eb)try{let t={type:e,comment:void 0!==s?s:eQ},r={...eb,user_feedback:t};eh(r),en(e=>e.map(e=>e.task_id===eb.task_id||e.upload_id===eb.upload_id?r:e)),(await (0,u.apiFetch)("/api/data",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({task_id:eb.task_id,upload_id:eb.upload_id,user_feedback:t})})).ok?alert("保存成功"):console.error("Feedback save failed")}catch(e){console.error("Feedback error",e)}},sk=async e=>{let s=e.upload_id||e.task_id||"";if(s&&confirm("确定要重新评估这条记录吗?")){console.log("Rejudging ID:",s),eu(e=>{let t=new Set(e);return t.add(s),t});try{let s=await (0,u.apiFetch)("/api/rejudge",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...e,currentUser:k})});if(s.ok){let t=await s.json();(t.record?.judgment_reason||"").includes("未找到匹配的评测配置")?alert(`重评完成: 未找到匹配的评测配置,Score 已归零。请在「数据集管理」中为该 query 添加完全一致的条目后再重评。`):alert(`重评完成: Score ${t.record.answer_score?.toFixed(2)}`);let r={...t.record,tokens:Number(t.record.tokens||t.record.Token||0),latency:Number(t.record.latency||0),framework:t.record.framework||"Unknown",skill_score:void 0!==t.record.skill_score?Number(t.record.skill_score):void 0,answer_score:null!==t.record.answer_score?Number(t.record.answer_score):+!!t.record.is_answer_correct};en(s=>s.map(s=>s.upload_id===e.upload_id||s.task_id===e.task_id?r:s)),eb&&(eb.task_id===e.task_id||eb.upload_id===e.upload_id)&&eh(r),sh()}else{let e="重评失败";try{let t=await s.json();t&&t.error&&(e+=`: ${t.error}`)}catch(e){}alert(e)}}catch(e){alert("重评请求出错")}finally{eu(e=>{let t=new Set(e);return t.delete(s),t})}}},sv=async(e,s)=>{try{let t={task_id:e.task_id,upload_id:e.upload_id,label:s};(await (0,u.apiFetch)("/api/data",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).ok?(ej(null),sh()):alert("更新标签失败")}catch(e){alert("更新标签出错")}},[sN,sS]=(0,r.useState)({}),[sw,s_]=(0,r.useState)(!1),[sC,sz]=(0,r.useState)(!1),[sT,sR]=(0,r.useState)("manual"),[sF,sI]=(0,r.useState)(null),s$=(0,r.useRef)(new Map);(0,r.useEffect)(()=>()=>{s$.current.forEach(e=>clearTimeout(e))},[]);let sA=(0,r.useCallback)(e=>{let s=async()=>{try{let t=await (0,u.apiFetch)(`/api/config/status?id=${e}`);if(!t.ok)return;let r=await t.json();if("completed"===r.parse_status||"failed"===r.parse_status){ex(s=>s.map(s=>s.id===e?{...s,standard_answer:r.standard_answer||s.standard_answer,root_causes:r.root_causes,key_actions:r.key_actions,parse_status:r.parse_status}:s));let s=s$.current.get(e);s&&clearTimeout(s),s$.current.delete(e)}else{let t=setTimeout(s,2e3);s$.current.set(e,t)}}catch(r){console.error("Config status poll error:",r);let t=setTimeout(s,5e3);s$.current.set(e,t)}},t=setTimeout(s,2e3);s$.current.set(e,t)},[]);(0,r.useEffect)(()=>{eo.forEach(e=>{"parsing"!==e.parse_status||s$.current.has(e.id)||sA(e.id)})},[eo,sA]);let sW=async()=>{if(!sN.query?.trim())return alert("问题 (Query) 不能为空");if(!sN.id){let e=sN.query.trim();if(eo.some(s=>s.query.trim()===e))return alert("该问题已存在于数据集中,请修改后再保存");sN.query=e}sz(!0);try{if(sN.id){let e=[...eo];e=e.map(e=>e.id===sN.id?{...e,...sN}:e),(await (0,u.apiFetch)("/api/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({configs:e,user:k})})).ok?(ex(e),s_(!1),sS({})):alert("保存失败")}else{let e;if("manual"===sT&&!sN.standard_answer?.trim())return sz(!1),alert("请填写标准答案");if("document"===sT&&!sF)return sz(!1),alert("请上传案例文档");if("document"===sT&&sF){let s=new FormData;s.append("query",sN.query),s.append("document",sF),k&&s.append("user",k),sN.expectedSkills&&s.append("expectedSkills",JSON.stringify(sN.expectedSkills)),e=await (0,u.apiFetch)("/api/config/create",{method:"POST",body:s})}else e=await (0,u.apiFetch)("/api/config/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:sN.query,standardAnswer:sN.standard_answer,skill:sN.skill,skillVersion:sN.skillVersion,expectedSkills:sN.expectedSkills,user:k})});if(e.ok){let s=await e.json();s&&s.id&&(ex(e=>[s,...e]),"parsing"===s.parse_status&&sA(s.id)),s_(!1),sS({}),sI(null),sR("manual")}else{let s=await e.json();alert(`保存失败: ${s.error||"Unknown error"}`)}}}catch(e){console.error(e),alert("保存出错: "+e.message)}finally{sz(!1)}},sD=async e=>{if(!confirm("确定删除此配置?"))return;let s=eo.filter(s=>s.id!==e);(await (0,u.apiFetch)("/api/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({configs:s,user:k})})).ok&&ex(s)},sB=(0,r.useMemo)(()=>Array.from(new Set(el.map(e=>e.framework))).sort(),[el]),sE=(0,r.useMemo)(()=>Array.from(new Set(el.map(e=>e.query))).sort(),[el]),sO=(0,r.useMemo)(()=>{if("all"===ev)return el;let e=Date.now()-(({"1h":36e5,"3h":108e5,"24h":864e5})[ev]||0);return el.filter(s=>new Date(s.timestamp).getTime()>e)},[el,ev]),sL=(0,r.useMemo)(()=>{let e=new Set;return sO.forEach(s=>{s.label&&e.add(s.label)}),Array.from(e).sort()},[sO]),sP=(0,r.useMemo)(()=>{let e=new Set;return sO.forEach(s=>{s.model&&e.add(s.model)}),Array.from(e).sort()},[sO]),sM="framework"===eE?sB:sP,sU=(0,r.useMemo)(()=>{let e=sO;return"single"===eS&&(e=e.filter(e=>e.query===e_)),Array.from(new Set(e.map(e=>e.label||"Other"))).sort()},[sO,eS,e_]),sq=(0,r.useMemo)(()=>{let e=sO;return eR&&(e=e.filter(e=>e.query===eR)),ez&&(e=e.filter(e=>e.framework===ez)),Array.from(new Set(e.map(e=>e.label||"Other"))).sort()},[sO,eR,ez]),sH=(0,r.useMemo)(()=>{let e=sO;return eR&&(e=e.filter(e=>e.query===eR)),ez&&(e=e.filter(e=>e.framework===ez)),Array.from(new Set(e.map(e=>e.model||"Unknown"))).sort()},[sO,eR,ez]),sK=(0,r.useMemo)(()=>{let e=sO;return ez&&(e=e.filter(e=>e.framework===ez)),Array.from(new Set(e.map(e=>e.query))).sort()},[sO,ez]);(0,r.useEffect)(()=>{ez&&sB.includes(ez)||!(sB.length>0)||eT(sB[0]),!e_&&sE.length>0&&eC(sE[0])},[sB,sE]),(0,r.useEffect)(()=>{eR&&sK.includes(eR)||!(sK.length>0)||eF(sK[0])},[sK]);let sJ=(0,r.useMemo)(()=>{let e=sO;if("single"===eS)e=e.filter(e=>e.query===e_);else if("latest_10"===eS){let s=Array.from(new Set(e.map(e=>e.query))).map(s=>({query:s,latestTimestamp:Math.max(...e.filter(e=>e.query===s).map(e=>new Date(e.timestamp).getTime()))})).sort((e,s)=>s.latestTimestamp-e.latestTimestamp).slice(0,10).map(e=>e.query);e=e.filter(e=>s.includes(e.query))}if(eA){let s=[];return Array.from(new Set(e.map(e=>e.label||"Other"))).sort().forEach(t=>{if(eD.length>0&&!eD.includes(t))return;let r=e.filter(e=>(e.label||"Other")===t);if(0===r.length)return;let d={label:t,data:[]};Array.from(new Set(r.map(e=>e.query))).forEach(e=>{let s={shortQuery:e.length>15?e.substring(0,15)+"...":e};sM.forEach(t=>{let d=r.filter(s=>s.query===e&&("framework"===eE?s.framework:s.model||"Unknown")===t);if(d.length>0){let e=d.reduce((e,s)=>e+s.latency,0)/d.length,r=d.reduce((e,s)=>e+s.tokens,0)/d.length,a=d.filter(e=>null!==e.answer_score),l=a.length>0,n=l?a.reduce((e,s)=>e+(s.answer_score||0),0)/a.length:0,i=d.reduce((e,s)=>e+(s.skill_recall_rate??0),0)/d.length*100;s[`${t}_lat`]=parseFloat(e.toFixed(2)),s[`${t}_tok`]=Math.round(r),s[`${t}_score`]=l?parseFloat(n.toFixed(2)):null,s[`${t}_recall`]=parseFloat(i.toFixed(1))}}),Object.keys(s).length>1&&d.data.push(s)}),d.data.length>0&&s.push(d)}),s}{let s={};e.forEach(e=>{s[e.query]||(s[e.query]=[]),s[e.query].push(e)});let t=[];return(Object.keys(s).forEach(e=>{let r=s[e],d=Math.max(...r.map(e=>new Date(e.timestamp).getTime())),a={query:e,shortQuery:e.length>15?e.substring(0,15)+"...":e,latestTimestamp:d},l=!1;sM.forEach(e=>{let s=r.filter(s=>("framework"===eE?s.framework:s.model||"Unknown")===e);if(s.length>0){let t=s.reduce((e,s)=>e+s.latency,0)/s.length,r=s.reduce((e,s)=>e+s.tokens,0)/s.length,d=s.reduce((e,s)=>e+(s.skill_recall_rate??0),0)/s.length*100,n=s.filter(e=>null!==e.answer_score),i=n.length>0,c=i?n.reduce((e,s)=>e+(s.answer_score||0),0)/n.length:0;a[`${e}_lat`]=parseFloat(t.toFixed(2)),a[`${e}_tok`]=Math.round(r),a[`${e}_recall`]=parseFloat(d.toFixed(1)),a[`${e}_score`]=i?parseFloat(c.toFixed(2)):null,l=!0}}),l&&t.push(a)}),t.sort((e,s)=>s.latestTimestamp-e.latestTimestamp),"latest_10"===eS)?t.slice(0,10):t}},[sO,eS,e_,eA,eD,sM,eE]),sV=(0,r.useMemo)(()=>{if(!eR)return null;let e=sO.filter(e=>e.query===eR);if(ez&&(e=e.filter(e=>e.framework===ez)),0===e.length)return null;let s=e.reduce((e,s)=>e+s.latency,0),t=W(eV),r=e.filter(e=>I(e,eV)),d=r.length>0?[...r].sort((e,s)=>{let r=F(e,eV),d=F(s,eV);return t?r-d:d-r}):[],a=new Set(eo.filter(e=>e.skill&&""!==e.skill.trim()||e.expectedSkills&&e.expectedSkills.some(e=>e.skill&&""!==e.skill.trim())).map(e=>e.query.trim())),l=sO.filter(e=>e.query&&a.has(e.query.trim())).filter(e=>null!==e.skill_recall_rate&&void 0!==e.skill_recall_rate),n=l.length>0?l.reduce((e,s)=>e+(s.skill_recall_rate??0),0)/l.length*100:0,i=e.filter(e=>null!==e.skill_recall_rate&&void 0!==e.skill_recall_rate),c=i.length>0?i.reduce((e,s)=>e+(s.skill_recall_rate??0),0)/i.length*100:0,o=e.filter(e=>null!=e.cost),x=o.length?o.reduce((e,s)=>e+(s.cost||0),0)/o.length:null,p=B(e);return{count:e.length,avgLatency:s/e.length,avgTokens:Math.round(e.reduce((e,s)=>e+s.tokens,0)/e.length),avgCost:x,globalSkillRecallRate:n,querySkillRecallRate:c,cpsr:p,avgAnsScore:e.filter(e=>null!==e.answer_score).length?e.filter(e=>null!==e.answer_score).reduce((e,s)=>e+(s.answer_score||0),0)/e.filter(e=>null!==e.answer_score).length:0,best:d.length>0?d[0]:null,worst:d.length>0?d[d.length-1]:null,avgSkillScore:e.reduce((e,s)=>e+(s.skill_score||0),0)/e.filter(e=>void 0!==e.skill_score).length||0}},[sO,ez,eR,eo,eV]),sY=(0,r.useMemo)(()=>sO.filter(e=>(!sn||e.framework===sn)&&(!sc||e.label===sc)&&(!sf||e.model===sf)&&(!sx||!!e.query.toLowerCase().includes(sx.toLowerCase()))),[sO,sn,sc,sf,sx]),sQ=Math.ceil(sY.length/10),sX=sY.slice((su-1)*10,10*su),sG=(0,r.useMemo)(()=>{let e=new Map,s=sO.filter(e=>e.skill&&null!=e.skill_version),t=new Map;for(let e of s){let s=`${e.query}|||${e.skill}`;t.has(s)||t.set(s,[]),t.get(s).push(e)}for(let[,s]of Array.from(t.entries())){s.sort((e,s)=>parseInt(e.skill_version||"0")-parseInt(s.skill_version||"0"));let t=new Map;for(let e of s){let s=parseInt(e.skill_version||"0");t.has(s)||t.set(s,{latency:0,tokens:0,accuracy:0,cost:0,count:0});let r=t.get(s);r.latency+=e.latency,r.tokens+=e.tokens,r.accuracy+=e.answer_score??0,r.cost+=e.cost??0,r.count+=1}for(let r of s){let s=parseInt(r.skill_version||"0")-1;if(!t.has(s))continue;let d=t.get(s),a=d.latency/d.count,l=d.tokens/d.count,n=d.accuracy/d.count,i=d.cost/d.count,c=r.upload_id||r.task_id||"";c&&e.set(c,{latencyDiff:0!==a?(r.latency-a)/a*100:null,tokenDiff:0!==l?(r.tokens-l)/l*100:null,accuracyDiff:0!==n?((r.answer_score??0)-n)/n*100:null,costDiff:0!==i?((r.cost??0)-i)/i*100:null})}}return e},[sO]),sZ=({title:e,dataKey:t,unit:r="",data:d,frameworks:f,yFormatter:m})=>(0,s.jsxs)("div",{className:"card",style:{height:"350px",display:"flex",flexDirection:"column"},children:[(0,s.jsx)("div",{className:"card-title",style:{marginBottom:"10px"},children:e}),(0,s.jsx)("div",{style:{flex:1,minHeight:0},children:(0,s.jsx)(c.ResponsiveContainer,{width:"100%",height:"100%",children:(0,s.jsxs)(l.BarChart,{data:d,margin:{top:10,right:10,left:0,bottom:20},children:[(0,s.jsx)(n.CartesianGrid,{strokeDasharray:"3 3",stroke:"var(--border)"}),(0,s.jsx)(x.XAxis,{dataKey:"shortQuery",stroke:"var(--foreground-secondary)",fontSize:11,angle:-20,textAnchor:"end",height:60}),(0,s.jsx)(p.YAxis,{stroke:"var(--foreground-secondary)",tickFormatter:m}),(0,s.jsx)(o.Tooltip,{formatter:(e,s)=>[void 0!==e?m?m(e):e+r:"-",s||""],contentStyle:{backgroundColor:"var(--dropdown-bg)",borderColor:"var(--border)",color:"var(--foreground)"}}),(0,s.jsx)(i.Legend,{}),f.map((e,r)=>(0,s.jsx)(a.Bar,{dataKey:`${e}_${t}`,name:e,fill:C[r%C.length],radius:[4,4,0,0]},e))]})})})]});return(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9 dashboard-container",children:[(0,s.jsxs)("header",{style:{flexDirection:"column",alignItems:"flex-start",gap:"1rem"},className:"jsx-29dfb32d17c16cd9 header",children:[(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",width:"100%",alignItems:"center"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("h1",{style:{marginBottom:0},className:"jsx-29dfb32d17c16cd9 title",children:"Skill-Insight"}),(0,s.jsx)("span",{style:{fontSize:"0.8rem",color:"var(--foreground-secondary)",letterSpacing:"1px"},className:"jsx-29dfb32d17c16cd9",children:"智能体技能评估、分析与优化"})]}),(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9 tabs",children:[(0,s.jsx)("button",{onClick:()=>er("dashboard"),className:`jsx-29dfb32d17c16cd9 tab-btn ${"dashboard"===et?"active":""}`,children:"数据概览"}),(0,s.jsx)("button",{onClick:()=>er("config"),className:`jsx-29dfb32d17c16cd9 tab-btn ${"config"===et?"active":""}`,children:"数据集管理"}),(0,s.jsx)("button",{onClick:()=>er("skill"),className:`jsx-29dfb32d17c16cd9 tab-btn ${"skill"===et?"active":""}`,children:"技能管理"})]})]}),"dashboard"===et&&(0,s.jsxs)("div",{style:{display:"flex",gap:"8px"},className:"jsx-29dfb32d17c16cd9 controls",children:[(0,s.jsx)("button",{onClick:U,title:q?"切换到浅色主题":"切换到深色主题",className:"jsx-29dfb32d17c16cd9 theme-toggle-btn",children:q?"☀️":"🌙"}),(0,s.jsxs)("select",{value:ev,onChange:e=>eN(e.target.value),className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("option",{value:"all",className:"jsx-29dfb32d17c16cd9",children:"全部时间"}),(0,s.jsx)("option",{value:"24h",className:"jsx-29dfb32d17c16cd9",children:"24H"}),(0,s.jsx)("option",{value:"3h",className:"jsx-29dfb32d17c16cd9",children:"3H"}),(0,s.jsx)("option",{value:"1h",className:"jsx-29dfb32d17c16cd9",children:"1H"})]}),e7.length>0?(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"4px",border:"1px solid var(--border)",borderRadius:"4px",padding:"4px 8px",background:"var(--background-secondary)"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("span",{style:{fontSize:"0.8rem",color:"var(--foreground-secondary)"},className:"jsx-29dfb32d17c16cd9",children:"模型:"}),(0,s.jsxs)("select",{value:e4||"none",onChange:e=>sa(e.target.value),style:{background:"transparent",color:"var(--foreground-secondary)",border:"none",maxWidth:"140px",outline:"none",cursor:"pointer"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("option",{value:"none",className:"jsx-29dfb32d17c16cd9",children:"未配置模型"}),e7.map(e=>(0,s.jsx)("option",{value:e.id,className:"jsx-29dfb32d17c16cd9",children:e.name},e.id))]}),(0,s.jsx)("div",{style:{width:"1px",height:"14px",background:"var(--border)",margin:"0 4px"},className:"jsx-29dfb32d17c16cd9"}),(0,s.jsx)("button",{onClick:()=>e1(!0),style:{background:"transparent",border:"none",cursor:"pointer",padding:"0",fontSize:"1rem"},title:"Manage Configurations",className:"jsx-29dfb32d17c16cd9",children:"⚙️"})]}):(0,s.jsx)("button",{style:{padding:"4px 8px",background:"transparent",border:"1px solid var(--border)",color:"var(--foreground-secondary)"},onClick:()=>e1(!0),className:"jsx-29dfb32d17c16cd9 btn-secondary",children:"⚙️ Eval Config"})]})]}),e0&&(0,s.jsx)("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"rgba(0,0,0,0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:2e3},onClick:e=>{e.target===e.currentTarget&&e1(!1)},className:"jsx-29dfb32d17c16cd9",children:(0,s.jsxs)("div",{style:{width:"600px",maxHeight:"90vh",overflowY:"auto"},className:"jsx-29dfb32d17c16cd9 card",children:[!se&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"1rem",alignItems:"center"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("h3",{style:{margin:0,color:"#1e293b"},className:"jsx-29dfb32d17c16cd9",children:"管理模型配置"}),(0,s.jsx)("button",{onClick:()=>e1(!1),style:{background:"transparent",border:"none",color:"#64748b",fontSize:"1.2rem",cursor:"pointer"},className:"jsx-29dfb32d17c16cd9",children:"✕"})]}),(0,s.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"8px",marginBottom:"1.5rem"},className:"jsx-29dfb32d17c16cd9",children:e7.map(e=>{let t=e.id.startsWith("default_");return(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"10px",background:e4===e.id?"rgba(37, 99, 235, 0.1)":"#f8fafc",border:e4===e.id?"1px solid #2563eb":"1px solid #e2e8f0",borderRadius:"6px"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsxs)("div",{style:{fontWeight:"bold",color:e4===e.id?"#2563eb":"#1e293b"},className:"jsx-29dfb32d17c16cd9",children:[e.name," ",e4===e.id&&"(Active)",t&&(0,s.jsx)("span",{style:{marginLeft:"8px",fontSize:"0.8rem",color:"#64748b"},className:"jsx-29dfb32d17c16cd9",children:"📋 Default (Read-only)"})]}),(0,s.jsxs)("div",{style:{fontSize:"0.8rem",color:"#64748b"},className:"jsx-29dfb32d17c16cd9",children:[e.provider," • ",e.model]})]}),(0,s.jsxs)("div",{style:{display:"flex",gap:"8px"},className:"jsx-29dfb32d17c16cd9",children:[e4!==e.id&&(0,s.jsx)("button",{style:{padding:"4px 8px",fontSize:"0.8rem"},onClick:()=>sa(e.id),className:"jsx-29dfb32d17c16cd9 btn-secondary",children:"Activate"}),!t&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{style:{padding:"4px 8px",fontSize:"0.8rem"},onClick:()=>{sr({...e}),ss(e.id),e6(null)},className:"jsx-29dfb32d17c16cd9 btn-secondary",children:"Edit"}),(0,s.jsx)("button",{style:{padding:"4px 8px",fontSize:"0.8rem",color:"#dc2626",borderColor:"#f87171"},onClick:()=>sl(e.id),className:"jsx-29dfb32d17c16cd9 btn-secondary",children:"Del"})]})]})]},e.id)})}),(0,s.jsx)("button",{style:{width:"100%",display:"flex",justifyContent:"center",gap:"8px"},onClick:()=>{sr({id:"new",name:"新配置",provider:"deepseek",model:"deepseek-chat",apiKey:"",baseUrl:"https://api.deepseek.com"}),ss("new"),e6(null)},className:"jsx-29dfb32d17c16cd9 btn-primary",children:"+ 添加新配置"})]}),se&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"1rem",alignItems:"center"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("h3",{style:{margin:0,color:"#1e293b"},className:"jsx-29dfb32d17c16cd9",children:"new"===se?"新配置":"编辑"}),(0,s.jsx)("button",{onClick:()=>ss(null),style:{background:"transparent",border:"none",color:"#64748b",fontSize:"0.9rem",cursor:"pointer"},className:"jsx-29dfb32d17c16cd9",children:"Back to List"})]}),e3&&(0,s.jsx)("div",{style:{padding:"10px",marginBottom:"1rem",borderRadius:"4px",background:"success"===e3.type?"rgba(22, 163, 74, 0.1)":"rgba(220, 38, 38, 0.1)",border:`1px solid ${"success"===e3.type?"#16a34a":"#dc2626"}`,color:"success"===e3.type?"#16a34a":"#dc2626",fontSize:"0.9rem"},className:"jsx-29dfb32d17c16cd9",children:e3.msg}),(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9 form-group",children:[(0,s.jsx)("label",{className:"jsx-29dfb32d17c16cd9",children:"Config Name"}),(0,s.jsx)("input",{placeholder:"e.g. My DeepSeek, Company OpenAI Proxy",value:st.name||"",onChange:e=>sr({...st,name:e.target.value}),disabled:se.startsWith("default_"),style:{width:"100%",padding:"10px",background:"#ffffff",border:"1px solid #cbd5e1",color:"#1e293b",borderRadius:"4px"},className:"jsx-29dfb32d17c16cd9"})]}),(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9 form-group",children:[(0,s.jsx)("label",{className:"jsx-29dfb32d17c16cd9",children:"Provider"}),(0,s.jsxs)("select",{value:st.provider,onChange:e=>{let s=e.target.value,t={provider:s};"deepseek"===s?(t.baseUrl="https://api.deepseek.com",t.model="deepseek-chat"):"siliconflow"===s?(t.baseUrl="https://api.siliconflow.cn/v1",t.model="deepseek-ai/DeepSeek-V3"):"openai"===s?(t.baseUrl="https://api.openai.com/v1",t.model="gpt-4o"):"anthropic"===s&&(t.baseUrl="https://api.anthropic.com/v1",t.model="claude-3-5-sonnet-20240620"),sr({...st,...t})},disabled:se.startsWith("default_"),style:{width:"100%",padding:"10px",background:"#ffffff",border:"1px solid #cbd5e1",color:"#1e293b",borderRadius:"4px"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("option",{value:"deepseek",className:"jsx-29dfb32d17c16cd9",children:"DeepSeek (Official)"}),(0,s.jsx)("option",{value:"siliconflow",className:"jsx-29dfb32d17c16cd9",children:"SiliconFlow (DeepSeek V3 High Speed)"}),(0,s.jsx)("option",{value:"openai",className:"jsx-29dfb32d17c16cd9",children:"OpenAI"}),(0,s.jsx)("option",{value:"anthropic",className:"jsx-29dfb32d17c16cd9",children:"Anthropic"}),(0,s.jsx)("option",{value:"custom",className:"jsx-29dfb32d17c16cd9",children:"Custom (OpenAI Compatible)"})]})]}),(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9 form-group",children:[(0,s.jsx)("label",{className:"jsx-29dfb32d17c16cd9",children:"Base URL (Optional)"}),(0,s.jsx)("input",{placeholder:"e.g. https://api.deepseek.com or https://api.openai.com/v1",value:st.baseUrl||"",onChange:e=>{let s=e.target.value;s=s.replace(/\/chat\/completions\/?$/,""),sr({...st,baseUrl:s})},disabled:se.startsWith("default_"),style:{width:"100%",padding:"10px",background:"#ffffff",border:"1px solid #cbd5e1",color:"#1e293b",borderRadius:"4px"},className:"jsx-29dfb32d17c16cd9"})]}),(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9 form-group",children:[(0,s.jsx)("label",{className:"jsx-29dfb32d17c16cd9",children:"API Key"}),(0,s.jsx)("input",{type:"password",placeholder:"sk-...",value:st.apiKey||"",onChange:e=>sr({...st,apiKey:e.target.value}),disabled:se.startsWith("default_"),style:{width:"100%",padding:"10px",background:"#ffffff",border:"1px solid #cbd5e1",color:"#1e293b",borderRadius:"4px"},className:"jsx-29dfb32d17c16cd9"})]}),(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9 form-group",children:[(0,s.jsx)("label",{className:"jsx-29dfb32d17c16cd9",children:"Model Name"}),(0,s.jsx)("input",{placeholder:"e.g. deepseek-chat, gpt-4o",value:st.model||"",onChange:e=>sr({...st,model:e.target.value}),disabled:se.startsWith("default_"),style:{width:"100%",padding:"10px",background:"#ffffff",border:"1px solid #cbd5e1",color:"#1e293b",borderRadius:"4px"},className:"jsx-29dfb32d17c16cd9"})]}),(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"2rem"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("button",{onClick:()=>ss(null),className:"jsx-29dfb32d17c16cd9 btn-secondary",children:"Cancel"}),!se.startsWith("default_")&&(0,s.jsxs)("button",{onClick:sd,disabled:e2,style:{opacity:e2?.7:1,display:"flex",alignItems:"center",gap:"6px"},className:"jsx-29dfb32d17c16cd9 btn-primary",children:[e2&&(0,s.jsx)("span",{style:{width:"12px",height:"12px",border:"2px solid white",borderTopColor:"transparent",borderRadius:"50%",animation:"spin 1s linear infinite"},className:"jsx-29dfb32d17c16cd9"}),e2?"Testing & Saving...":"Test Connection & Save"]})]})]})]})}),"dashboard"===et&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h2",{className:"jsx-29dfb32d17c16cd9 section-title",children:"全景概览"}),(0,s.jsx)("div",{className:"jsx-29dfb32d17c16cd9 grid",children:sB.map((e,t)=>{let r=sO.filter(s=>s.framework===e),d=new Set(eo.filter(e=>e.skill&&""!==e.skill.trim()||e.expectedSkills&&e.expectedSkills.some(e=>e.skill&&""!==e.skill.trim())).map(e=>e.query.trim())),a=r.filter(e=>e.query&&d.has(e.query.trim())),l=r.length?r.reduce((e,s)=>e+s.latency,0)/r.length:0,n=r.length?r.reduce((e,s)=>e+s.tokens,0)/r.length:0,i=r.filter(e=>null!==e.answer_score),c=i.length>0,o=c?i.reduce((e,s)=>e+(s.answer_score||0),0)/i.length:0,x=a.length?a.reduce((e,s)=>e+(s.skill_recall_rate??0),0)/a.length*100:0;return(0,s.jsxs)("div",{style:{borderLeft:`4px solid ${C[t%C.length]}`},className:"jsx-29dfb32d17c16cd9 card",children:[(0,s.jsx)("div",{style:{color:C[t%C.length]},className:"jsx-29dfb32d17c16cd9 card-title",children:e}),(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9 stat-value",children:[r.length," ",(0,s.jsx)("small",{style:{fontSize:"1rem",color:"var(--foreground-muted)"},className:"jsx-29dfb32d17c16cd9",children:"执行数"})]}),(0,s.jsxs)("div",{style:{marginTop:"1rem",display:"grid",gridTemplateColumns:"1fr 1fr",gap:"0.2rem"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("span",{style:{fontSize:"0.8rem",color:"var(--foreground-secondary)",textTransform:"uppercase"},className:"jsx-29dfb32d17c16cd9",children:"时延"}),(0,s.jsx)("span",{style:{fontSize:"1.5rem",fontWeight:700,color:"var(--foreground)"},className:"jsx-29dfb32d17c16cd9",children:z(l)})]}),(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("span",{style:{fontSize:"0.8rem",color:"var(--foreground-secondary)",textTransform:"uppercase"},className:"jsx-29dfb32d17c16cd9",children:"TOKEN"}),(0,s.jsx)("span",{style:{fontSize:"1.5rem",fontWeight:700,color:"var(--foreground)"},className:"jsx-29dfb32d17c16cd9",children:T(Math.round(n))})]})]}),(0,s.jsxs)("div",{style:{marginTop:"0.8rem",paddingTop:"0.8rem",borderTop:"1px solid var(--border)",display:"grid",gridTemplateColumns:"1fr 1fr",gap:"0.2rem"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("span",{style:{fontSize:"0.8rem",color:"var(--foreground-secondary)"},className:"jsx-29dfb32d17c16cd9",children:"准确率"}),(0,s.jsx)("span",{style:{fontSize:"1.5rem",fontWeight:700,color:c?o>.8?"var(--success)":"var(--warning)":"var(--foreground-muted)"},className:"jsx-29dfb32d17c16cd9",children:c?`${(100*o).toFixed(1)}%`:"--"})]}),(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("span",{style:{fontSize:"0.8rem",color:"var(--foreground-secondary)"},className:"jsx-29dfb32d17c16cd9",children:"技能召回率"}),(0,s.jsxs)("span",{style:{fontSize:"1.5rem",fontWeight:700,color:"var(--warning)"},className:"jsx-29dfb32d17c16cd9",children:[x.toFixed(1),"%"]})]})]})]},e)})}),(0,s.jsx)("h2",{className:"jsx-29dfb32d17c16cd9 section-title",children:"对比分析"}),(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9 analysis-controls",children:[(0,s.jsx)("div",{style:{display:"flex",gap:"1rem",flexWrap:"wrap"},className:"jsx-29dfb32d17c16cd9",children:["latest_10","all","single"].map(e=>(0,s.jsxs)("label",{style:{cursor:"pointer",color:"var(--foreground)",display:"flex",alignItems:"center",gap:"5px"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("input",{type:"radio",checked:eS===e,onChange:()=>ew(e),className:"jsx-29dfb32d17c16cd9"}),"latest_10"===e?"最新10问":"all"===e?"所有":"单问题"]},e))}),"single"===eS&&(0,s.jsx)("select",{value:e_,onChange:e=>eC(e.target.value),style:{maxWidth:"300px"},className:"jsx-29dfb32d17c16cd9",children:sE.map(e=>(0,s.jsx)("option",{value:e,className:"jsx-29dfb32d17c16cd9",children:e.substring(0,40)},e))}),(0,s.jsxs)("div",{style:{marginLeft:"10px",display:"flex",gap:"8px",borderLeft:"1px solid var(--border)",paddingLeft:"10px"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("span",{style:{color:"var(--foreground-secondary)",fontSize:"0.9rem",display:"flex",alignItems:"center"},className:"jsx-29dfb32d17c16cd9",children:"分类:"}),(0,s.jsx)("button",{onClick:()=>eO("framework"),style:{padding:"2px 8px",fontSize:"0.8rem",background:"framework"===eE?"var(--primary)":"transparent",color:"framework"===eE?"#ffffff":"var(--foreground-secondary)",border:"1px solid var(--primary)"},className:`jsx-29dfb32d17c16cd9 tab-btn-sm ${"framework"===eE?"active":""}`,children:"框架"}),(0,s.jsx)("button",{onClick:()=>eO("model"),style:{padding:"2px 8px",fontSize:"0.8rem",background:"model"===eE?"var(--primary)":"transparent",color:"model"===eE?"#ffffff":"var(--foreground-secondary)",border:"1px solid var(--primary)"},className:`jsx-29dfb32d17c16cd9 tab-btn-sm ${"model"===eE?"active":""}`,children:"模型"})]}),(0,s.jsxs)("div",{style:{marginLeft:"10px",display:"flex",alignItems:"center",gap:"10px"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsxs)("label",{style:{cursor:"pointer",color:"var(--foreground)",display:"flex",alignItems:"center",gap:"5px"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("input",{type:"checkbox",checked:eA,onChange:e=>{eW(e.target.checked),e.target.checked&&eD.length},className:"jsx-29dfb32d17c16cd9"}),"按标签分类"]}),eA&&(0,s.jsxs)("div",{style:{position:"relative",display:"inline-block"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsxs)("div",{style:{background:"var(--dropdown-bg)",padding:"4px 8px",borderRadius:"4px",cursor:"pointer",border:"1px solid var(--dropdown-border)",minWidth:"150px",color:"var(--foreground)"},className:"jsx-29dfb32d17c16cd9 dropdown-trigger",children:[0===eD.length?"所有标签":`已选 ${eD.length} 个`,(0,s.jsx)("span",{style:{float:"right",fontSize:"0.8rem"},className:"jsx-29dfb32d17c16cd9",children:"▼"})]}),(0,s.jsxs)("div",{style:{position:"absolute",top:"100%",left:0,zIndex:10,background:"var(--dropdown-bg)",border:"1px solid var(--dropdown-border)",borderRadius:"4px",padding:"0.5rem",minWidth:"200px",maxHeight:"300px",overflowY:"auto",boxShadow:"0 4px 6px -1px var(--shadow-color)"},className:"jsx-29dfb32d17c16cd9 dropdown-content",children:[(0,s.jsxs)("label",{style:{display:"block",marginBottom:"4px",cursor:"pointer",color:"var(--foreground)"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("input",{type:"checkbox",checked:0===eD.length,onChange:()=>eB([]),className:"jsx-29dfb32d17c16cd9"})," ",(0,s.jsx)("span",{style:{marginLeft:"4px"},className:"jsx-29dfb32d17c16cd9",children:"所有标签"})]}),(0,s.jsx)("hr",{style:{borderColor:"var(--border)",margin:"4px 0"},className:"jsx-29dfb32d17c16cd9"}),sU.map(e=>(0,s.jsxs)("label",{style:{display:"block",marginBottom:"4px",cursor:"pointer",color:"var(--foreground)"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("input",{type:"checkbox",checked:eD.includes(e),onChange:s=>{s.target.checked?eB([...eD,e]):eB(eD.filter(s=>s!==e))},className:"jsx-29dfb32d17c16cd9"})," ",(0,s.jsx)("span",{style:{marginLeft:"4px"},className:"jsx-29dfb32d17c16cd9",children:e})]},e))]})]})]})]}),eA?(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9",children:[sJ.map(e=>(0,s.jsxs)("div",{style:{marginBottom:"2rem"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsxs)("h3",{style:{color:"var(--foreground)",borderBottom:"1px solid var(--border)",paddingBottom:"0.5rem",marginBottom:"1rem"},className:"jsx-29dfb32d17c16cd9",children:["Tag: ",(0,s.jsx)("span",{style:{color:"#2563eb"},className:"jsx-29dfb32d17c16cd9",children:e.label})]}),(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9 analysis-grid",children:[(0,s.jsx)(sZ,{title:"平均时延",unit:"m",dataKey:"lat",data:e.data,frameworks:sM,yFormatter:e=>(e/6e4).toFixed(2)+"m"}),(0,s.jsx)(sZ,{title:"平均消耗 (Tokens)",dataKey:"tok",data:e.data,frameworks:sM,yFormatter:T}),(0,s.jsx)(sZ,{title:"平均准确率",dataKey:"score",unit:"",data:e.data,frameworks:sM}),(0,s.jsx)(sZ,{title:"平均技能召回率",dataKey:"recall",unit:"%",data:e.data,frameworks:sM,yFormatter:e=>Number(e).toFixed(1)+"%"})]})]},e.label)),0===sJ.length&&(0,s.jsx)("div",{style:{textAlign:"center",padding:"2rem",color:"#64748b"},className:"jsx-29dfb32d17c16cd9 card",children:"无数据"})]}):sJ.length>0?(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9 analysis-grid",children:[(0,s.jsx)(sZ,{title:(0,s.jsxs)("span",{className:"jsx-29dfb32d17c16cd9",children:["平均时延 ",(0,s.jsx)(L,{content:"基于选中查询的所有执行结果计算出的平均总响应耗时(分钟)"})]}),dataKey:"lat",unit:"m",data:sJ,frameworks:sM,yFormatter:e=>(e/6e4).toFixed(2)+"m",className:"jsx-29dfb32d17c16cd9"}),(0,s.jsx)(sZ,{title:(0,s.jsxs)("span",{className:"jsx-29dfb32d17c16cd9",children:["平均消耗 (Tokens) ",(0,s.jsx)(L,{content:"基于选中查询的所有执行结果计算出的平均 Token 消耗总额"})]}),dataKey:"tok",unit:"",data:sJ,frameworks:sM,yFormatter:T,className:"jsx-29dfb32d17c16cd9"}),(0,s.jsx)(sZ,{title:(0,s.jsxs)("span",{className:"jsx-29dfb32d17c16cd9",children:["平均准确率 ",(0,s.jsx)(L,{content:(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9",children:["基于LLM评估所有执行结果与期望答案的差异,计算出的0-1分值的平均值,1表示完全正确。",(0,s.jsx)("br",{className:"jsx-29dfb32d17c16cd9"}),'"--"表示评估失败,可能是由于模型未配置(请在首页左上角的设置中配置 LLM)或者数据项未配置。']})})]}),dataKey:"score",unit:"",data:sJ,frameworks:sM,className:"jsx-29dfb32d17c16cd9"}),(0,s.jsx)(sZ,{title:(0,s.jsxs)("span",{className:"jsx-29dfb32d17c16cd9",children:["平均技能召回率 ",(0,s.jsx)(L,{content:(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9",children:["基于执行结果是否使用了预期技能计算出的百分比,表示正确调用技能的比例。",(0,s.jsx)("br",{className:"jsx-29dfb32d17c16cd9"}),"这是全局指标,反映技能路由的准确性。"]})})]}),dataKey:"recall",unit:"%",data:sJ,frameworks:sM,yFormatter:e=>Number(e).toFixed(1)+"%",className:"jsx-29dfb32d17c16cd9"})]}):(0,s.jsx)("div",{style:{textAlign:"center",padding:"2rem",color:"#64748b"},className:"jsx-29dfb32d17c16cd9 card",children:"无数据"}),(0,s.jsx)("h2",{className:"jsx-29dfb32d17c16cd9 section-title",children:"单问题详情 (Drill-down)"}),(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9 analysis-controls",children:[(0,s.jsxs)("select",{value:ez,onChange:e=>eT(e.target.value),className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("option",{value:"",className:"jsx-29dfb32d17c16cd9",children:"选择框架"}),sB.map(e=>(0,s.jsx)("option",{value:e,className:"jsx-29dfb32d17c16cd9",children:e},e))]}),(0,s.jsxs)("select",{value:eR,onChange:e=>eF(e.target.value),style:{flex:1},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("option",{value:"",className:"jsx-29dfb32d17c16cd9",children:"选择问题"}),sK.map(e=>(0,s.jsx)("option",{value:e,className:"jsx-29dfb32d17c16cd9",children:e.substring(0,80)},e))]}),(0,s.jsxs)("select",{value:eV,onChange:e=>eY(e.target.value),style:{fontSize:"0.9rem"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("option",{value:"latency",className:"jsx-29dfb32d17c16cd9",children:"最好/最差指标: 时延"}),(0,s.jsx)("option",{value:"accuracy",className:"jsx-29dfb32d17c16cd9",children:"最好/最差指标: 准确率"}),(0,s.jsx)("option",{value:"tokens",className:"jsx-29dfb32d17c16cd9",children:"最好/最差指标: Token"}),(0,s.jsx)("option",{value:"cost",className:"jsx-29dfb32d17c16cd9",children:"最好/最差指标: 成本"}),(0,s.jsx)("option",{value:"recall",className:"jsx-29dfb32d17c16cd9",children:"最好/最差指标: 召回率"})]}),(0,s.jsxs)("div",{style:{marginLeft:"10px",display:"flex",alignItems:"center",gap:"20px"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsxs)("label",{style:{cursor:"pointer",color:"var(--foreground)",display:"flex",alignItems:"center",gap:"5px"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("input",{type:"checkbox",checked:eL,onChange:e=>{eP(e.target.checked),e.target.checked&&eU(!1)},className:"jsx-29dfb32d17c16cd9"}),"按标签分类"]}),(0,s.jsxs)("label",{style:{cursor:"pointer",color:"var(--foreground)",display:"flex",alignItems:"center",gap:"5px"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("input",{type:"checkbox",checked:eM,onChange:e=>{eU(e.target.checked),e.target.checked&&eP(!1)},className:"jsx-29dfb32d17c16cd9"}),"按模型分类"]}),eL&&(0,s.jsxs)("div",{style:{position:"relative",display:"inline-block"},className:"jsx-29dfb32d17c16cd9 dropdown-container",children:[(0,s.jsxs)("div",{style:{background:"var(--dropdown-bg)",padding:"4px 8px",borderRadius:"4px",cursor:"pointer",border:"1px solid var(--dropdown-border)",minWidth:"150px",display:"flex",alignItems:"center",justifyContent:"space-between",color:"var(--foreground)"},className:"jsx-29dfb32d17c16cd9 dropdown-trigger",children:[0===eq.length?"所有标签 (All Labels)":`已选 ${eq.length} 个`,(0,s.jsx)("span",{style:{fontSize:"0.8rem",marginLeft:"8px"},className:"jsx-29dfb32d17c16cd9",children:"▼"})]}),(0,s.jsxs)("div",{style:{position:"absolute",top:"100%",left:0,zIndex:10,background:"var(--dropdown-bg)",border:"1px solid var(--dropdown-border)",borderRadius:"4px",padding:"0.5rem",minWidth:"200px",maxHeight:"300px",overflowY:"auto",boxShadow:"0 4px 6px -1px var(--shadow-color)",color:"var(--foreground)"},className:"jsx-29dfb32d17c16cd9 dropdown-content",children:[(0,s.jsxs)("label",{style:{display:"block",marginBottom:"4px",cursor:"pointer"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("input",{type:"checkbox",checked:0===eq.length,onChange:()=>eH([]),className:"jsx-29dfb32d17c16cd9"})," ",(0,s.jsx)("span",{style:{marginLeft:"4px"},className:"jsx-29dfb32d17c16cd9",children:"所有标签 (All)"})]}),(0,s.jsx)("hr",{style:{borderColor:"var(--border)",margin:"4px 0"},className:"jsx-29dfb32d17c16cd9"}),sq.map(e=>(0,s.jsxs)("label",{style:{display:"block",marginBottom:"4px",cursor:"pointer"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("input",{type:"checkbox",checked:eq.includes(e),onChange:s=>{s.target.checked?eH([...eq,e]):eH(eq.filter(s=>s!==e))},className:"jsx-29dfb32d17c16cd9"})," ",(0,s.jsx)("span",{style:{marginLeft:"4px"},className:"jsx-29dfb32d17c16cd9",children:e})]},e))]})]}),eM&&(0,s.jsxs)("div",{style:{position:"relative",display:"inline-block"},className:"jsx-29dfb32d17c16cd9 dropdown-container",children:[(0,s.jsxs)("div",{style:{background:"var(--dropdown-bg)",padding:"4px 8px",borderRadius:"4px",cursor:"pointer",border:"1px solid var(--dropdown-border)",minWidth:"150px",display:"flex",alignItems:"center",justifyContent:"space-between",color:"var(--foreground)"},className:"jsx-29dfb32d17c16cd9 dropdown-trigger",children:[0===eK.length?"所有模型 (All Models)":`已选 ${eK.length} 个`,(0,s.jsx)("span",{style:{fontSize:"0.8rem",marginLeft:"8px"},className:"jsx-29dfb32d17c16cd9",children:"▼"})]}),(0,s.jsxs)("div",{style:{position:"absolute",top:"100%",left:0,zIndex:10,background:"var(--dropdown-bg)",border:"1px solid var(--dropdown-border)",borderRadius:"4px",padding:"0.5rem",minWidth:"200px",maxHeight:"300px",overflowY:"auto",boxShadow:"0 4px 6px -1px var(--shadow-color)",color:"var(--foreground)"},className:"jsx-29dfb32d17c16cd9 dropdown-content",children:[(0,s.jsxs)("label",{style:{display:"block",marginBottom:"4px",cursor:"pointer"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("input",{type:"checkbox",checked:0===eK.length,onChange:()=>eJ([]),className:"jsx-29dfb32d17c16cd9"})," ",(0,s.jsx)("span",{style:{marginLeft:"4px"},className:"jsx-29dfb32d17c16cd9",children:"所有模型 (All)"})]}),(0,s.jsx)("hr",{style:{borderColor:"var(--border)",margin:"4px 0"},className:"jsx-29dfb32d17c16cd9"}),sH.map(e=>(0,s.jsxs)("label",{style:{display:"block",marginBottom:"4px",cursor:"pointer"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("input",{type:"checkbox",checked:eK.includes(e),onChange:s=>{s.target.checked?eJ([...eK,e]):eJ(eK.filter(s=>s!==e))},className:"jsx-29dfb32d17c16cd9"})," ",(0,s.jsx)("span",{style:{marginLeft:"4px"},className:"jsx-29dfb32d17c16cd9",children:e})]},e))]})]})]})]}),eL||eM?(0,s.jsx)("div",{className:"jsx-29dfb32d17c16cd9",children:(eL?sq:sH).filter(e=>eL?0===eq.length||eq.includes(e):0===eK.length||eK.includes(e)).map(e=>{let t=sO;if(t=eL?t.filter(s=>(s.label||"Other")===e):t.filter(s=>(s.model||"Unknown")===e),eR&&(t=t.filter(e=>e.query===eR)),ez&&(t=t.filter(e=>e.framework===ez)),0===t.length)return null;let r=t.length,d=t.reduce((e,s)=>e+s.latency,0)/r,a=Math.round(t.reduce((e,s)=>e+s.tokens,0)/r);t.reduce((e,s)=>e+(s.skill_recall_rate??0),0);let l=t.filter(e=>null!==e.answer_score),n=l.length?l.reduce((e,s)=>e+(s.answer_score||0),0)/l.length:0,i=t.filter(e=>I(e,eV)),c=i.length>0?[...i].sort((e,s)=>{let t=F(e,eV),r=F(s,eV);return W(eV)?t-r:r-t})[0]:null,o=i.length>0?[...i].sort((e,s)=>{let t=F(e,eV),r=F(s,eV);return W(eV)?r-t:t-r})[0]:null,x=t.filter(e=>null!=e.cost),p=x.length?x.reduce((e,s)=>e+(s.cost||0),0)/x.length:null,f=B(t),m=null;if(eL&&eR&&"without-skill"!==e&&"Other"!==e){let s=sO.filter(e=>e.query===eR);ez&&(s=s.filter(e=>e.framework===ez)),m=((e,s)=>{let t=e.filter(e=>(e.label||"Other")===s),r=e.filter(e=>"without-skill"===e.label),{successRate:d,evaluatedCount:a}=E(t),{successRate:l,evaluatedCount:n}=E(r);return 0===n?{valuePct:null,passSkill:d,passNoSkill:l,evaluatedSkillCount:a,evaluatedBaselineCount:n,reason:"缺少 without-skill 基线或基线数据尚未完成评测,暂无法计算。"}:0===a?{valuePct:null,passSkill:d,passNoSkill:l,evaluatedSkillCount:a,evaluatedBaselineCount:n,reason:"当前标签下暂无可用于计算的已评测数据。"}:null===d||null===l?{valuePct:null,passSkill:d,passNoSkill:l,evaluatedSkillCount:a,evaluatedBaselineCount:n,reason:"当前数据不足以完成 Skill Lift 计算。"}:l>=1?{valuePct:null,passSkill:d,passNoSkill:l,evaluatedSkillCount:a,evaluatedBaselineCount:n,reason:"without-skill 基线成功率为 100%,公式分母为 0,暂无法计算。"}:{valuePct:(d-l)/(1-l)*100,passSkill:d,passNoSkill:l,evaluatedSkillCount:a,evaluatedBaselineCount:n,reason:null}})(s,e)}return(0,s.jsxs)("div",{style:{marginBottom:"2rem"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("div",{style:{marginBottom:"0.5rem"},className:"jsx-29dfb32d17c16cd9",children:(0,s.jsxs)("h3",{style:{margin:0,color:"#38bdf8",fontSize:"1.1rem"},className:"jsx-29dfb32d17c16cd9",children:[eL?"标签 (Label): ":"模型 (Model): "," ",e]})}),(0,s.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))",gap:"1rem"},className:"jsx-29dfb32d17c16cd9 grid",children:[(0,s.jsxs)("div",{style:{gridColumn:"span 2"},className:"jsx-29dfb32d17c16cd9 card",children:[(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9 card-title",children:["平均表现",(0,s.jsxs)("span",{style:{fontSize:"0.85rem",color:"#94a3b8",fontWeight:"normal",marginLeft:"8px"},className:"jsx-29dfb32d17c16cd9",children:["(基于 ",r," 条记录)"]})]}),(0,s.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:"1rem",textAlign:"center"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("div",{className:"jsx-29dfb32d17c16cd9 text-sm text-slate-400",children:"平均时延"}),(0,s.jsx)("div",{className:"jsx-29dfb32d17c16cd9 text-xl font-bold",children:z(d)})]}),(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("div",{className:"jsx-29dfb32d17c16cd9 text-sm text-slate-400",children:"平均 Token"}),(0,s.jsx)("div",{className:"jsx-29dfb32d17c16cd9 text-xl font-bold",children:T(a)})]}),(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("div",{className:"jsx-29dfb32d17c16cd9 text-sm text-slate-400",children:"平均准确率"}),(0,s.jsx)("div",{style:{color:n>.8?"#4ade80":"#fbbf24"},className:"jsx-29dfb32d17c16cd9 text-xl font-bold",children:n.toFixed(2)})]}),(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9 text-sm text-slate-400",children:["平均成本 ",(0,s.jsx)(L,{content:"根据默认定价或自定义(custom-models.json)定价估算得出。"})]}),(0,s.jsx)("div",{style:null==p?{color:"#64748b"}:{},className:"jsx-29dfb32d17c16cd9 text-xl font-bold",children:null!=p?R(p):"N/A"})]}),(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9 text-sm text-slate-400",children:["CPSR ",(0,s.jsx)(L,{content:"单次成功解决成本:每次任务成功解决的平均开销。\n计算公式:(总成本)÷(成功解决的运行次数)"})]}),(0,s.jsx)("div",{style:{color:null!=f?"#38bdf8":"#64748b"},className:"jsx-29dfb32d17c16cd9 text-xl font-bold",children:null!=f?R(f):"N/A"})]})]})]}),c&&o?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"space-between"},className:"jsx-29dfb32d17c16cd9 card",children:[(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsxs)("div",{style:{fontSize:"0.85rem"},className:"jsx-29dfb32d17c16cd9 card-title text-green-400",children:["最好表现 (",W(eV)?"Min":"Max"," ",$(eV),")"]}),(0,s.jsx)("div",{className:"jsx-29dfb32d17c16cd9 text-xl font-bold",children:A(c,eV)}),(0,s.jsxs)("div",{style:{fontSize:"0.75rem"},className:"jsx-29dfb32d17c16cd9 text-sm text-slate-400 mt-2",children:["Token: ",T(c.tokens)," | Score: ",c.answer_score?.toFixed(2)||"-"," ",(0,s.jsx)("br",{className:"jsx-29dfb32d17c16cd9"}),"Cost: ",R(c.cost)||"-"," | Latency: ",z(c.latency)]})]}),(0,s.jsx)("div",{style:{fontSize:"0.75rem",color:"#38bdf8",cursor:"pointer",marginTop:"0.5rem",textAlign:"right"},onClick:()=>{let e=`/details?framework=${encodeURIComponent(c.framework)}&expandTaskId=${c.task_id||c.upload_id}`;window.open(e,"_blank")},className:"jsx-29dfb32d17c16cd9",children:"查看 >"})]}),(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"space-between"},className:"jsx-29dfb32d17c16cd9 card",children:[(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsxs)("div",{style:{fontSize:"0.85rem"},className:"jsx-29dfb32d17c16cd9 card-title text-red-400",children:["最差表现 (",W(eV)?"Max":"Min"," ",$(eV),")"]}),(0,s.jsx)("div",{className:"jsx-29dfb32d17c16cd9 text-xl font-bold",children:A(o,eV)}),(0,s.jsxs)("div",{style:{fontSize:"0.75rem"},className:"jsx-29dfb32d17c16cd9 text-sm text-slate-400 mt-2",children:["Token: ",T(o.tokens)," | Score: ",o.answer_score?.toFixed(2)||"-"," ",(0,s.jsx)("br",{className:"jsx-29dfb32d17c16cd9"}),"Cost: ",R(o.cost)||"-"," | Latency: ",z(o.latency)]})]}),(0,s.jsx)("div",{style:{fontSize:"0.75rem",color:"#38bdf8",cursor:"pointer",marginTop:"0.5rem",textAlign:"right"},onClick:()=>window.open(`/details?framework=${encodeURIComponent(o.framework)}&expandTaskId=${o.task_id||o.upload_id}`,"_blank"),className:"jsx-29dfb32d17c16cd9",children:"查看 >"})]})]}):(0,s.jsx)("div",{style:{textAlign:"center",padding:"1rem",color:"#94a3b8",fontSize:"0.85rem"},className:"jsx-29dfb32d17c16cd9 card",children:"该指标暂无有效数据"}),eL&&null!==m&&(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"space-between"},className:"jsx-29dfb32d17c16cd9 card",children:[(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsxs)("div",{style:{fontSize:"0.85rem"},className:"jsx-29dfb32d17c16cd9 card-title text-purple-400",children:["技能提升 (Skill Lift)",(0,s.jsx)(L,{content:"表示启用当前 Skill 标签后,相对 without-skill 基线带来的成功率提升。\n计算公式:(skill_success_rate - no_skill_success_rate) / (1 - no_skill_success_rate)\n其中:skill_success_rate 为当前标签下已评测记录的成功率;no_skill_success_rate 为 without-skill 基线下已评测记录的成功率。\n仅在同时存在已评测的当前标签数据和 without-skill 基线数据时才计算。"})]}),(0,s.jsx)("div",{style:{marginTop:"0.5rem",fontSize:"0.85rem"},className:"jsx-29dfb32d17c16cd9",children:(0,s.jsx)("div",{style:{marginBottom:"0.5rem"},className:"jsx-29dfb32d17c16cd9",children:(0,s.jsx)("div",{style:{fontSize:"1.2rem",fontWeight:"bold",color:null==m.valuePct?"#94a3b8":m.valuePct>0?"#4ade80":m.valuePct<0?"#f87171":"#94a3b8"},className:"jsx-29dfb32d17c16cd9",children:null==m.valuePct?"N/A":`${m.valuePct>0?"+":""}${m.valuePct.toFixed(2)}%`})})})]}),(0,s.jsxs)("div",{style:{fontSize:"0.75rem",color:"#64748b"},className:"jsx-29dfb32d17c16cd9",children:["当前标签成功率:",null==m.passSkill?"N/A":`${(100*m.passSkill).toFixed(1)}%`,(0,s.jsx)("br",{className:"jsx-29dfb32d17c16cd9"}),"基线成功率:",null==m.passNoSkill?"N/A":`${(100*m.passNoSkill).toFixed(1)}%`]}),(0,s.jsx)("div",{style:{fontSize:"0.75rem",color:"#64748b",marginTop:"0.5rem",textAlign:"left",whiteSpace:"pre-wrap"},className:"jsx-29dfb32d17c16cd9",children:m.reason||"基于 without-skill 基线计算。"})]})]})]},e)})}):sV?(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9 grid",children:[(0,s.jsxs)("div",{style:{gridColumn:"span 2"},className:"jsx-29dfb32d17c16cd9 card",children:[(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9 card-title",children:["平均表现",(0,s.jsxs)("span",{style:{fontSize:"0.9rem",color:"#94a3b8",fontWeight:"normal",marginLeft:"8px"},className:"jsx-29dfb32d17c16cd9",children:["(基于 ",sV.count," 条记录)"]})]}),(0,s.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:"1rem",textAlign:"center"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("div",{className:"jsx-29dfb32d17c16cd9 text-sm text-slate-400",children:"平均时延"}),(0,s.jsx)("div",{className:"jsx-29dfb32d17c16cd9 text-xl font-bold",children:z(sV.avgLatency)})]}),(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("div",{className:"jsx-29dfb32d17c16cd9 text-sm text-slate-400",children:"平均 Token"}),(0,s.jsx)("div",{className:"jsx-29dfb32d17c16cd9 text-xl font-bold",children:T(sV.avgTokens)})]}),(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("div",{className:"jsx-29dfb32d17c16cd9 text-sm text-slate-400",children:"平均技能召回率"}),(0,s.jsxs)("div",{style:{color:"#f1f5f9"},className:"jsx-29dfb32d17c16cd9 text-xl font-bold",children:[sV.querySkillRecallRate?.toFixed(2),"%"]})]}),(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("div",{className:"jsx-29dfb32d17c16cd9 text-sm text-slate-400",children:"平均准确率"}),(0,s.jsx)("div",{style:{color:sV.avgAnsScore>.8?"#4ade80":"#fbbf24"},className:"jsx-29dfb32d17c16cd9 text-xl font-bold",children:sV.avgAnsScore.toFixed(2)})]}),(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9 text-sm text-slate-400",children:["平均成本 ",(0,s.jsx)(L,{content:"根据默认定价或自定义(custom-models.json)定价估算得出。"})]}),(0,s.jsx)("div",{style:null==sV.avgCost?{color:"#64748b"}:{},className:"jsx-29dfb32d17c16cd9 text-xl font-bold",children:null!=sV.avgCost?R(sV.avgCost):"N/A"})]}),(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9 text-sm text-slate-400",children:["CPSR",(0,s.jsx)(L,{content:"单次成功解决成本:每次任务成功解决的平均开销。\n计算公式:(总成本)÷(成功解决的运行次数)"})]}),(0,s.jsx)("div",{style:{color:null!=sV.cpsr?"#38bdf8":"#64748b"},className:"jsx-29dfb32d17c16cd9 text-xl font-bold",children:null!=sV.cpsr?R(sV.cpsr):"N/A"})]})]})]}),sV.best&&sV.worst?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"space-between"},className:"jsx-29dfb32d17c16cd9 card",children:[(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9 card-title text-green-400",children:["最好表现 (",W(eV)?"Min":"Max"," ",$(eV),")"]}),(0,s.jsx)("div",{className:"jsx-29dfb32d17c16cd9 text-2xl font-bold",children:A(sV.best,eV)}),(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9 text-sm text-slate-400 mt-2",children:["Token: ",T(sV.best.tokens)," | Cost: ",R(sV.best.cost)||"-"," | Latency: ",z(sV.best.latency)," ",(0,s.jsx)("br",{className:"jsx-29dfb32d17c16cd9"}),"Time: ",O(sV.best.timestamp)]})]}),(0,s.jsx)("div",{style:{fontSize:"0.8rem",color:"#38bdf8",cursor:"pointer",marginTop:"0.5rem",textAlign:"right"},onClick:()=>{let e=sV.best;e&&window.open(`/details?framework=${encodeURIComponent(e.framework)}&expandTaskId=${e.task_id||e.upload_id}`,"_blank")},className:"jsx-29dfb32d17c16cd9",children:"查看 >"})]}),(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"space-between"},className:"jsx-29dfb32d17c16cd9 card",children:[(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9 card-title text-red-400",children:["最差表现 (",W(eV)?"Max":"Min"," ",$(eV),")"]}),(0,s.jsx)("div",{className:"jsx-29dfb32d17c16cd9 text-2xl font-bold",children:A(sV.worst,eV)}),(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9 text-sm text-slate-400 mt-2",children:["Token: ",T(sV.worst.tokens)," | Cost: ",R(sV.worst.cost)||"-"," | Latency: ",z(sV.worst.latency)," ",(0,s.jsx)("br",{className:"jsx-29dfb32d17c16cd9"}),"Time: ",O(sV.worst.timestamp)]})]}),(0,s.jsx)("div",{style:{fontSize:"0.8rem",color:"#38bdf8",cursor:"pointer",marginTop:"0.5rem",textAlign:"right"},onClick:()=>{let e=sV.worst;if(!e)return;let s=`/details?framework=${encodeURIComponent(e.framework)}&expandTaskId=${e.task_id||e.upload_id}`;window.open(s,"_blank")},className:"jsx-29dfb32d17c16cd9",children:"查看 >"})]})]}):(0,s.jsx)("div",{style:{textAlign:"center",padding:"2rem",color:"#94a3b8"},className:"jsx-29dfb32d17c16cd9 card",children:"该指标暂无有效数据"})]}):(0,s.jsx)("div",{style:{textAlign:"center",padding:"2rem",color:"#94a3b8"},className:"jsx-29dfb32d17c16cd9 card",children:eR?"该组合下暂无数据":"请选择一个问题进行分析"}),(0,s.jsx)("h2",{className:"jsx-29dfb32d17c16cd9 section-title",children:"执行记录"}),(0,s.jsxs)("div",{style:{marginBottom:"1rem"},className:"jsx-29dfb32d17c16cd9 analysis-controls",children:[(0,s.jsxs)("select",{value:sn,onChange:e=>si(e.target.value),style:{fontSize:"0.9rem"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("option",{value:"",className:"jsx-29dfb32d17c16cd9",children:"所有框架 (All Frameworks)"}),sB.map(e=>(0,s.jsx)("option",{value:e,className:"jsx-29dfb32d17c16cd9",children:e},e))]}),(0,s.jsxs)("select",{value:sc,onChange:e=>so(e.target.value),style:{fontSize:"0.9rem"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("option",{value:"",className:"jsx-29dfb32d17c16cd9",children:"所有标签 (All Labels)"}),sL.map(e=>(0,s.jsx)("option",{value:e,className:"jsx-29dfb32d17c16cd9",children:e},e))]}),(0,s.jsxs)("select",{value:sf,onChange:e=>sm(e.target.value),style:{fontSize:"0.9rem"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("option",{value:"",className:"jsx-29dfb32d17c16cd9",children:"所有模型 (All Models)"}),sP.map(e=>(0,s.jsx)("option",{value:e,className:"jsx-29dfb32d17c16cd9",children:e},e))]}),(0,s.jsx)("input",{type:"text",placeholder:"搜索问题...",value:sx,onChange:e=>sp(e.target.value),style:{padding:"0.5rem",background:"var(--input-bg)",border:"1px solid var(--input-border)",borderRadius:"4px",color:"var(--foreground)",minWidth:"250px"},className:"jsx-29dfb32d17c16cd9"}),(0,s.jsxs)("span",{style:{marginLeft:"auto",color:"var(--foreground-secondary)",fontSize:"0.9rem"},className:"jsx-29dfb32d17c16cd9",children:["共有 ",sY.length," 条数据"]})]}),(0,s.jsx)("div",{className:"jsx-29dfb32d17c16cd9 card table-container",children:(0,s.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("thead",{style:{textAlign:"left",color:"var(--foreground-secondary)",borderBottom:"1px solid var(--border)"},className:"jsx-29dfb32d17c16cd9",children:(0,s.jsxs)("tr",{className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("th",{style:{whiteSpace:"nowrap"},className:"jsx-29dfb32d17c16cd9 p-2",children:"时间"}),(0,s.jsx)("th",{style:{whiteSpace:"nowrap"},className:"jsx-29dfb32d17c16cd9 p-2",children:"框架"}),(0,s.jsx)("th",{style:{whiteSpace:"nowrap"},className:"jsx-29dfb32d17c16cd9 p-2",children:"用户输入"}),(0,s.jsx)("th",{style:{whiteSpace:"nowrap"},className:"jsx-29dfb32d17c16cd9 p-2",children:(0,s.jsxs)("span",{className:"jsx-29dfb32d17c16cd9",children:["时延 ",(0,s.jsx)(L,{content:"从请求发出到收到最终完整回复的总耗时"})]})}),(0,s.jsx)("th",{style:{whiteSpace:"nowrap"},className:"jsx-29dfb32d17c16cd9 p-2",children:(0,s.jsxs)("span",{className:"jsx-29dfb32d17c16cd9",children:["Token ",(0,s.jsx)(L,{content:"输入 Prompt 与输出 Completion 的 Token 总和"})]})}),(0,s.jsx)("th",{style:{whiteSpace:"nowrap"},className:"jsx-29dfb32d17c16cd9 p-2",children:(0,s.jsxs)("span",{className:"jsx-29dfb32d17c16cd9",children:["准确率 ",(0,s.jsx)(L,{content:(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9",children:["基于LLM评估Agent真实运行结果与期望答案的差异,给出0-1分值,1表示完全正确。",(0,s.jsx)("br",{className:"jsx-29dfb32d17c16cd9"}),'"--"表示评估失败,可能是由于模型未配置(请在首页左上角的设置中配置 LLM)或者数据项未配置。']})})]})}),(0,s.jsx)("th",{style:{whiteSpace:"nowrap"},className:"jsx-29dfb32d17c16cd9 p-2",children:(0,s.jsxs)("span",{className:"jsx-29dfb32d17c16cd9",children:["预估花费 ",(0,s.jsx)(L,{content:"根据默认定价或自定义(custom-models.json)定价估算得出"})]})}),(0,s.jsx)("th",{style:{whiteSpace:"nowrap"},className:"jsx-29dfb32d17c16cd9 p-2",children:"模型"}),(0,s.jsx)("th",{style:{whiteSpace:"nowrap"},className:"jsx-29dfb32d17c16cd9 p-2",children:"标签"}),(0,s.jsx)("th",{style:{whiteSpace:"nowrap"},className:"jsx-29dfb32d17c16cd9 p-2",children:"操作"})]})}),(0,s.jsx)("tbody",{className:"jsx-29dfb32d17c16cd9",children:sX.map((e,t)=>{let r=e.upload_id||e.task_id||"",d=sG.get(r);return(0,s.jsxs)("tr",{style:{borderBottom:"1px solid var(--table-row-border)"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("td",{style:{fontSize:"0.85rem",whiteSpace:"nowrap"},className:"jsx-29dfb32d17c16cd9 p-2",children:O(e.timestamp)}),(0,s.jsx)("td",{style:{whiteSpace:"nowrap"},className:"jsx-29dfb32d17c16cd9 p-2",children:e.framework}),(0,s.jsx)("td",{title:e.query,className:"jsx-29dfb32d17c16cd9 p-2",children:e.query.length>30?e.query.substring(0,30)+"...":e.query}),(0,s.jsxs)("td",{style:{whiteSpace:"nowrap"},className:"jsx-29dfb32d17c16cd9 p-2",children:[z(e.latency),d&&D(d.latencyDiff,!0)]}),(0,s.jsxs)("td",{style:{whiteSpace:"nowrap"},title:e.reasoning_tokens?`Output: ${T(e.output_tokens||0)} (Reasoning: ${T(e.reasoning_tokens)}, Response: ${T((e.output_tokens||0)-e.reasoning_tokens)})`+(e.input_tokens?`
2
+ Input: ${T(e.input_tokens)}`:""):e.input_tokens||e.output_tokens?`Input: ${T(e.input_tokens||0)}, Output: ${T(e.output_tokens||0)}`:void 0,className:"jsx-29dfb32d17c16cd9 p-2",children:[T(e.tokens),d&&D(d.tokenDiff,!0)]}),(0,s.jsxs)("td",{style:{whiteSpace:"nowrap"},className:"jsx-29dfb32d17c16cd9 p-2",children:[(0,s.jsx)("span",{style:{color:null===e.answer_score?"var(--foreground-muted)":(e.answer_score||0)>.8?"var(--success)":"var(--error)",fontWeight:"bold"},className:"jsx-29dfb32d17c16cd9",children:null===e.answer_score?"--":(e.answer_score||0).toFixed(2)}),d&&D(d.accuracyDiff,!1)]}),(0,s.jsxs)("td",{style:{fontSize:"0.85rem",whiteSpace:"nowrap"},title:null!=e.cost&&e.cost_pricing?(e.cache_read_input_tokens||e.cache_creation_input_tokens?`Cost = base_input \xd7 $${e.cost_pricing.inputTokenPrice}/M + cache_read \xd7 $${e.cost_pricing.cacheReadInputTokenPrice}/M + cache_create \xd7 $${e.cost_pricing.cacheCreationInputTokenPrice}/M + output \xd7 $${e.cost_pricing.outputTokenPrice}/M`:`Cost = input_tokens \xd7 $${e.cost_pricing.inputTokenPrice}/M + output_tokens \xd7 $${e.cost_pricing.outputTokenPrice}/M`)+(e.model?` (${e.model})`:"")+`. Estimated from ${"custom"===e.cost_pricing.source?"custom":"default"} pricing.`:void 0,className:"jsx-29dfb32d17c16cd9 p-2",children:[null!=e.cost?R(e.cost):e.tokens?(0,s.jsx)("span",{style:{color:"var(--foreground-muted)"},className:"jsx-29dfb32d17c16cd9",children:"N/A"}):"-",d&&D(d.costDiff,!0)]}),(0,s.jsx)("td",{style:{fontSize:"0.85rem",whiteSpace:"nowrap"},className:"jsx-29dfb32d17c16cd9 p-2",children:e.model||"-"}),(0,s.jsx)("td",{className:"jsx-29dfb32d17c16cd9 p-2",children:eg===r?(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"4px"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("input",{value:ey,onChange:e=>ek(e.target.value),style:{width:"80px",padding:"2px 4px",fontSize:"0.8rem",background:"var(--input-bg)",border:"1px solid var(--input-border)",color:"var(--foreground)"},className:"jsx-29dfb32d17c16cd9"}),(0,s.jsx)("button",{onClick:()=>sv(e,ey),style:{color:"var(--success)",background:"none",border:"none",cursor:"pointer"},className:"jsx-29dfb32d17c16cd9",children:"✓"}),(0,s.jsx)("button",{onClick:()=>ej(null),style:{color:"var(--error)",background:"none",border:"none",cursor:"pointer"},className:"jsx-29dfb32d17c16cd9",children:"✕"})]}):(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px",cursor:"pointer"},onClick:()=>{r&&(ej(r),ek(e.label||""))},className:"jsx-29dfb32d17c16cd9",children:[e.label?(0,s.jsx)("span",{style:{padding:"2px 6px",background:"var(--background-secondary)",borderRadius:"4px",fontSize:"0.8rem",border:"1px solid var(--border)"},className:"jsx-29dfb32d17c16cd9",children:e.label}):(0,s.jsx)("span",{style:{color:"var(--foreground-muted)"},className:"jsx-29dfb32d17c16cd9",children:"-"}),(0,s.jsx)("span",{style:{fontSize:"0.7rem",color:"var(--foreground-muted)",opacity:.5},className:"jsx-29dfb32d17c16cd9",children:"✎"})]})}),(0,s.jsx)("td",{className:"jsx-29dfb32d17c16cd9 p-2",children:(0,s.jsxs)("div",{style:{display:"flex",gap:"8px",whiteSpace:"nowrap"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("button",{onClick:()=>{let s=`/details?framework=${encodeURIComponent(e.framework)}&expandTaskId=${r}`;window.open(s,"_blank")},style:{background:"var(--primary)"},className:"jsx-29dfb32d17c16cd9 btn-sm",children:"详情"}),(0,s.jsx)("button",{onClick:()=>sk(e),disabled:em.has(r),style:{background:em.has(r)?"var(--foreground-muted)":"var(--warning)",color:"#ffffff",cursor:em.has(r)?"not-allowed":"pointer",display:"inline-flex",alignItems:"center",gap:"4px",opacity:em.has(r)?.7:1},className:"jsx-29dfb32d17c16cd9 btn-sm",children:em.has(r)?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{style:{width:"12px",height:"12px",border:"2px solid #0f172a",borderTopColor:"transparent",borderRadius:"50%",animation:"spin 1s linear infinite",display:"inline-block"},className:"jsx-29dfb32d17c16cd9"}),(0,s.jsx)("span",{className:"jsx-29dfb32d17c16cd9",children:"评估中..."})]}):"重评"}),(0,s.jsx)("button",{onClick:()=>sj(e),style:{background:"#ef4444"},className:"jsx-29dfb32d17c16cd9 btn-sm",children:"删"})]})})]},t)})})]})}),sQ>1&&(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"1rem",gap:"1rem"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("button",{disabled:1===su,onClick:()=>sb(e=>Math.max(1,e-1)),style:{background:1===su?"#334155":"#38bdf8",color:1===su?"#94a3b8":"#0f172a",cursor:1===su?"not-allowed":"pointer"},className:"jsx-29dfb32d17c16cd9 btn-sm",children:"< Prev"}),(0,s.jsxs)("span",{style:{color:"#94a3b8"},className:"jsx-29dfb32d17c16cd9",children:["Page ",su," of ",sQ]}),(0,s.jsx)("button",{disabled:su===sQ,onClick:()=>sb(e=>Math.min(sQ,e+1)),style:{background:su===sQ?"#334155":"#38bdf8",color:su===sQ?"#94a3b8":"#0f172a",cursor:su===sQ?"not-allowed":"pointer"},className:"jsx-29dfb32d17c16cd9 btn-sm",children:"Next >"})]}),(0,s.jsx)("div",{style:{marginTop:"2rem",marginBottom:"0.5rem",height:"1px",background:"linear-gradient(to right, transparent, rgba(56, 189, 248, 0.5), transparent)"},className:"jsx-29dfb32d17c16cd9"}),(0,s.jsx)("div",{style:{marginTop:"0.5rem",padding:"0.5rem",textAlign:"center"},className:"jsx-29dfb32d17c16cd9",children:(0,s.jsx)("p",{style:{margin:0,fontSize:"0.9rem",color:"#94a3b8",lineHeight:1.6},className:"jsx-29dfb32d17c16cd9",children:(0,s.jsx)("a",{href:"https://atomgit.com/openeuler/witty-skill-insight",target:"_blank",rel:"noopener noreferrer",style:{color:"#94a3b8",textDecoration:"underline",textUnderlineOffset:"3px"},className:"jsx-29dfb32d17c16cd9",children:"你的 ⭐ Star 是前进动力,📢 Issue 使产品更稳,🚀 PR 让功能更强。"})})})]}),"config"===et&&(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9 config-container",children:[(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"1rem",alignItems:"center"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("h2",{style:{marginBottom:0},className:"jsx-29dfb32d17c16cd9 section-title",children:"数据集管理"}),(0,s.jsx)("button",{onClick:()=>{sS({}),sR("manual"),sI(null),s_(!0)},style:{padding:"8px 20px",fontSize:"0.9rem",borderRadius:"6px"},className:"jsx-29dfb32d17c16cd9 btn-primary",children:"+ 新增数据项"})]}),(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},className:"jsx-29dfb32d17c16cd9",children:[Array.isArray(eo)&&0===eo.length&&(0,s.jsx)("div",{style:{textAlign:"center",padding:"3rem",color:"#64748b"},className:"jsx-29dfb32d17c16cd9 card",children:'暂无数据项,点击上方"+ 新增数据项"开始添加'}),Array.isArray(eo)&&eo.map(e=>(0,s.jsxs)("div",{style:{padding:"14px 18px",display:"flex",flexDirection:"row",alignItems:"center",gap:"16px",transition:"border-color 0.2s",borderColor:"#1e293b"},className:"jsx-29dfb32d17c16cd9 card",children:[(0,s.jsx)("div",{style:{flexShrink:0,width:"8px",height:"8px",borderRadius:"50%",background:"parsing"===e.parse_status?"#fbbf24":"failed"===e.parse_status?"#ef4444":"#4ade80",boxShadow:`0 0 6px ${"parsing"===e.parse_status?"#fbbf2444":"failed"===e.parse_status?"#ef444444":"#4ade8044"}`,..."parsing"===e.parse_status?{animation:"pulse-dot 1.5s ease-in-out infinite"}:{}},className:"jsx-29dfb32d17c16cd9"}),(0,s.jsxs)("div",{style:{flex:1,minWidth:0},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("div",{style:{fontWeight:500,color:"#e2e8f0",fontSize:"0.9rem",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",marginBottom:"4px"},className:"jsx-29dfb32d17c16cd9",children:e.query}),(0,s.jsx)("div",{style:{color:"#64748b",fontSize:"0.8rem",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},className:"jsx-29dfb32d17c16cd9",children:(e.standard_answer||"").length>100?(e.standard_answer||"").substring(0,100)+"...":e.standard_answer||"暂无标准答案"}),e.expectedSkills&&e.expectedSkills.length>0?(0,s.jsxs)("div",{style:{color:"#94a3b8",fontSize:"0.75rem",marginTop:"2px"},className:"jsx-29dfb32d17c16cd9",children:["预期技能: ",e.expectedSkills.map(e=>`${e.skill}${null!==e.version&&void 0!==e.version?` (v${e.version})`:""}`).join(", ")]}):e.skill&&(0,s.jsxs)("div",{style:{color:"#94a3b8",fontSize:"0.75rem",marginTop:"2px"},className:"jsx-29dfb32d17c16cd9",children:["预期技能: ",e.skill,null!==e.skillVersion&&void 0!==e.skillVersion?` (v${e.skillVersion})`:""]})]}),(0,s.jsx)("div",{style:{flexShrink:0},className:"jsx-29dfb32d17c16cd9",children:"parsing"===e.parse_status?(0,s.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:"5px",padding:"3px 10px",borderRadius:"12px",fontSize:"0.75rem",fontWeight:500,background:"rgba(251, 191, 36, 0.12)",color:"#fbbf24",border:"1px solid rgba(251, 191, 36, 0.25)"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("span",{style:{width:"10px",height:"10px",border:"1.5px solid #fbbf24",borderTopColor:"transparent",borderRadius:"50%",animation:"spin 1s linear infinite",display:"inline-block"},className:"jsx-29dfb32d17c16cd9"}),"解析中"]}):"failed"===e.parse_status?(0,s.jsx)("span",{style:{padding:"3px 10px",borderRadius:"12px",fontSize:"0.75rem",fontWeight:500,background:"rgba(239, 68, 68, 0.12)",color:"#ef4444",border:"1px solid rgba(239, 68, 68, 0.25)"},className:"jsx-29dfb32d17c16cd9",children:"✕ 失败"}):(0,s.jsx)("span",{style:{padding:"3px 10px",borderRadius:"12px",fontSize:"0.75rem",fontWeight:500,background:"rgba(74, 222, 128, 0.12)",color:"#4ade80",border:"1px solid rgba(74, 222, 128, 0.25)"},className:"jsx-29dfb32d17c16cd9",children:"✓ 完成"})}),(0,s.jsxs)("div",{style:{display:"flex",gap:"6px",flexShrink:0},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("button",{onClick:()=>{let s={...e};!s.expectedSkills&&s.skill&&(s.expectedSkills=[{skill:s.skill,version:s.skillVersion??null}]),sS(s),s_(!0)},style:{padding:"5px 12px",background:"#1e3a5f",color:"#38bdf8",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"0.8rem",fontWeight:500,transition:"background 0.2s"},className:"jsx-29dfb32d17c16cd9",children:"详情"}),(0,s.jsx)("button",{onClick:()=>{sS({query:e.query,skill:"",expectedSkills:e.expectedSkills?[...e.expectedSkills]:e.skill?[{skill:e.skill,version:e.skillVersion??null}]:void 0,standard_answer:e.standard_answer}),sR("manual"),sI(null),s_(!0)},style:{padding:"5px 12px",background:"#2d1b4e",color:"#a855f7",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"0.8rem",fontWeight:500,transition:"background 0.2s"},className:"jsx-29dfb32d17c16cd9",children:"复制"}),(0,s.jsx)("button",{onClick:()=>sD(e.id),style:{padding:"5px 12px",background:"#3b1c1c",color:"#ef4444",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"0.8rem",fontWeight:500,transition:"background 0.2s"},className:"jsx-29dfb32d17c16cd9",children:"删除"})]})]},e.id))]})]}),"skill"===et&&(0,s.jsx)(N,{}),sw&&(0,s.jsx)("div",{onClick:()=>s_(!1),className:"jsx-29dfb32d17c16cd9 modal-overlay",children:(0,s.jsxs)("div",{onClick:e=>e.stopPropagation(),style:{maxHeight:"90vh",overflowY:"auto",maxWidth:"900px",width:"66vw",minWidth:"500px",flexDirection:"column"},className:"jsx-29dfb32d17c16cd9 modal-content card",children:[(0,s.jsx)("h3",{className:"jsx-29dfb32d17c16cd9",children:sN.id?"数据项详情":"新增数据项"}),(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9 form-group",children:[(0,s.jsxs)("label",{style:{fontWeight:600,fontSize:"0.95rem",color:"#e2e8f0"},className:"jsx-29dfb32d17c16cd9",children:["问题 (Query) ",(0,s.jsx)("span",{style:{color:"#ef4444"},className:"jsx-29dfb32d17c16cd9",children:"*"})]}),(0,s.jsx)("textarea",{value:sN.query||"",onChange:e=>sS({...sN,query:e.target.value}),disabled:!!sN.id,placeholder:"请输入需要评估的问题...",style:{width:"100%",padding:"10px",minHeight:"60px",opacity:sN.id?.7:1,cursor:sN.id?"not-allowed":"text",background:"#0f172a",border:"1px solid #334155",color:"#e2e8f0",borderRadius:"6px",fontSize:"0.95rem"},className:"jsx-29dfb32d17c16cd9"})]}),sN.id?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9 form-group",children:[(0,s.jsx)("label",{style:{fontWeight:600,fontSize:"0.95rem",color:"#e2e8f0"},className:"jsx-29dfb32d17c16cd9",children:"标准答案"}),(0,s.jsx)("textarea",{value:sN.standard_answer||"",onChange:e=>sS({...sN,standard_answer:e.target.value}),style:{width:"100%",padding:"10px",minHeight:"120px",background:"#0f172a",border:"1px solid #334155",color:"#e2e8f0",borderRadius:"6px",fontSize:"0.9rem"},className:"jsx-29dfb32d17c16cd9"})]}),(0,s.jsxs)("div",{style:{marginTop:"1rem"},className:"jsx-29dfb32d17c16cd9 form-group",children:[(0,s.jsxs)("label",{style:{fontWeight:600,fontSize:"0.95rem",color:"#e2e8f0"},className:"jsx-29dfb32d17c16cd9",children:["预期技能 (Expected Skills) ",(0,s.jsx)("span",{style:{color:"#64748b",fontWeight:400},className:"jsx-29dfb32d17c16cd9",children:"(可选)"})]}),(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},className:"jsx-29dfb32d17c16cd9",children:[(sN.expectedSkills||[]).map((e,t)=>(0,s.jsxs)("div",{style:{display:"flex",gap:"8px",alignItems:"center"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("input",{type:"text",value:e.skill,onChange:e=>{let s=[...sN.expectedSkills||[]];s[t]={...s[t],skill:e.target.value},sS({...sN,expectedSkills:s})},placeholder:"技能名称",style:{flex:2,padding:"10px",background:"#0f172a",border:"1px solid #334155",color:"#e2e8f0",borderRadius:"6px",fontSize:"0.95rem"},className:"jsx-29dfb32d17c16cd9"}),(0,s.jsx)("input",{type:"number",value:e.version??0,onChange:e=>{let s=e.target.value,r=[...sN.expectedSkills||[]];r[t]={...r[t],version:""===s?0:Math.max(0,parseInt(s,10)||0)},sS({...sN,expectedSkills:r})},placeholder:"版本 (默认: 0)",style:{flex:1,padding:"10px",background:"#0f172a",border:"1px solid #334155",color:"#e2e8f0",borderRadius:"6px",fontSize:"0.95rem"},className:"jsx-29dfb32d17c16cd9"}),(0,s.jsx)("button",{type:"button",onClick:()=>{let e=(sN.expectedSkills||[]).filter((e,s)=>s!==t);sS({...sN,expectedSkills:e})},style:{padding:"10px",background:"#3b1c1c",color:"#ef4444",border:"none",borderRadius:"6px",cursor:"pointer"},className:"jsx-29dfb32d17c16cd9",children:"✕"})]},t)),(0,s.jsx)("button",{type:"button",onClick:()=>{let e=[...sN.expectedSkills||[],{skill:"",version:0}];sS({...sN,expectedSkills:e})},style:{padding:"8px",background:"#1e3a5f",color:"#38bdf8",border:"1px dashed #38bdf8",borderRadius:"6px",cursor:"pointer",fontSize:"0.85rem"},className:"jsx-29dfb32d17c16cd9",children:"+ 添加预期技能"})]})]}),(0,s.jsxs)("details",{style:{marginBottom:"1rem"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsxs)("summary",{style:{cursor:"pointer",color:"#94a3b8",fontSize:"0.9rem",padding:"10px 12px",userSelect:"none",display:"flex",alignItems:"center",gap:"8px",background:"rgba(30, 41, 59, 0.5)",borderRadius:"6px",border:"1px solid #334155",listStyle:"none",transition:"background 0.2s"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("span",{style:{fontSize:"0.7rem",color:"#64748b",transition:"transform 0.2s",display:"inline-block"},className:"jsx-29dfb32d17c16cd9 details-arrow",children:"▶"}),(0,s.jsx)("span",{style:{fontWeight:500},className:"jsx-29dfb32d17c16cd9",children:"关键观点 (Expected Key Points)"}),(0,s.jsxs)("span",{style:{fontSize:"0.8rem",color:"#64748b",marginLeft:"auto"},className:"jsx-29dfb32d17c16cd9",children:[(sN.root_causes||[]).length," 项 · 点击展开"]})]}),(0,s.jsxs)("div",{style:{background:"#0f172a",padding:"10px",borderRadius:"4px",border:"1px solid #334155",marginTop:"8px"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("div",{style:{color:"#64748b",fontSize:"0.8rem",marginBottom:"10px",padding:"6px 8px",background:"rgba(100, 116, 139, 0.1)",borderRadius:"4px"},className:"jsx-29dfb32d17c16cd9",children:"来源:从标准答案中自动提取 · 作用:评估 Agent 回答是否包含了所有关键信息"}),(sN.root_causes||[]).map((e,t)=>(0,s.jsxs)("div",{style:{display:"flex",gap:"10px",marginBottom:"8px"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("input",{placeholder:"内容",value:e.content,onChange:e=>{let s=[...sN.root_causes||[]];s[t].content=e.target.value,sS({...sN,root_causes:s})},style:{flex:1,padding:"6px"},className:"jsx-29dfb32d17c16cd9"}),(0,s.jsx)("input",{type:"number",placeholder:"权重",value:e.weight,onChange:e=>{let s=[...sN.root_causes||[]];s[t].weight=Number(e.target.value),sS({...sN,root_causes:s})},style:{width:"80px",padding:"6px"},className:"jsx-29dfb32d17c16cd9"}),(0,s.jsx)("button",{onClick:()=>{let e=(sN.root_causes||[]).filter((e,s)=>s!==t);sS({...sN,root_causes:e})},style:{color:"#ef4444",padding:"0 8px",background:"none",border:"none",cursor:"pointer"},className:"jsx-29dfb32d17c16cd9",children:"✕"})]},t)),(0,s.jsx)("button",{style:{background:"#334155",marginTop:"5px"},onClick:()=>sS({...sN,root_causes:[...sN.root_causes||[],{content:"",weight:1}]}),className:"jsx-29dfb32d17c16cd9 btn-sm",children:"+ 添加关键观点"})]})]}),(0,s.jsxs)("details",{style:{marginBottom:"1rem"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsxs)("summary",{style:{cursor:"pointer",color:"#94a3b8",fontSize:"0.9rem",padding:"10px 12px",userSelect:"none",display:"flex",alignItems:"center",gap:"8px",background:"rgba(30, 41, 59, 0.5)",borderRadius:"6px",border:"1px solid #334155",listStyle:"none",transition:"background 0.2s"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("span",{style:{fontSize:"0.7rem",color:"#64748b",transition:"transform 0.2s",display:"inline-block"},className:"jsx-29dfb32d17c16cd9 details-arrow",children:"▶"}),(0,s.jsx)("span",{style:{fontWeight:500},className:"jsx-29dfb32d17c16cd9",children:"关键动作 (Expected Key Actions)"}),(0,s.jsxs)("span",{style:{fontSize:"0.8rem",color:"#64748b",marginLeft:"auto"},className:"jsx-29dfb32d17c16cd9",children:[(sN.key_actions||[]).length," 项 · 点击展开"]})]}),(0,s.jsxs)("div",{style:{background:"#0f172a",padding:"10px",borderRadius:"4px",border:"1px solid #334155",marginTop:"8px"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("div",{style:{color:"#64748b",fontSize:"0.8rem",marginBottom:"10px",padding:"6px 8px",background:"rgba(100, 116, 139, 0.1)",borderRadius:"4px"},className:"jsx-29dfb32d17c16cd9",children:"来源:从标准答案中自动提取 · 作用:评估 Agent 是否执行了所有必要的操作步骤"}),(sN.key_actions||[]).map((e,t)=>(0,s.jsxs)("div",{style:{display:"flex",gap:"10px",marginBottom:"8px"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("input",{placeholder:"内容",value:e.content,onChange:e=>{let s=[...sN.key_actions||[]];s[t].content=e.target.value,sS({...sN,key_actions:s})},style:{flex:1,padding:"6px"},className:"jsx-29dfb32d17c16cd9"}),(0,s.jsx)("input",{type:"number",placeholder:"权重",value:e.weight,onChange:e=>{let s=[...sN.key_actions||[]];s[t].weight=Number(e.target.value),sS({...sN,key_actions:s})},style:{width:"80px",padding:"6px"},className:"jsx-29dfb32d17c16cd9"}),(0,s.jsx)("button",{onClick:()=>{let e=(sN.key_actions||[]).filter((e,s)=>s!==t);sS({...sN,key_actions:e})},style:{color:"#ef4444",padding:"0 8px",background:"none",border:"none",cursor:"pointer"},className:"jsx-29dfb32d17c16cd9",children:"✕"})]},t)),(0,s.jsx)("button",{style:{background:"#334155",marginTop:"5px"},onClick:()=>sS({...sN,key_actions:[...sN.key_actions||[],{content:"",weight:1}]}),className:"jsx-29dfb32d17c16cd9 btn-sm",children:"+ 添加关键动作"})]})]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9 form-group",children:[(0,s.jsxs)("label",{style:{fontWeight:600,fontSize:"0.95rem",color:"#e2e8f0"},className:"jsx-29dfb32d17c16cd9",children:["标准答案 ",(0,s.jsx)("span",{style:{color:"#ef4444"},className:"jsx-29dfb32d17c16cd9",children:"*"})]}),(0,s.jsxs)("div",{style:{display:"flex",gap:"12px",marginBottom:"10px"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("button",{onClick:()=>{sR("manual"),sI(null)},style:{padding:"6px 16px",background:"manual"===sT?"#38bdf8":"#1e293b",color:"manual"===sT?"#0f172a":"#94a3b8",border:`1px solid ${"manual"===sT?"#38bdf8":"#334155"}`,borderRadius:"6px",cursor:"pointer",fontSize:"0.85rem",fontWeight:"manual"===sT?600:400,transition:"all 0.2s"},className:"jsx-29dfb32d17c16cd9",children:"✏️ 手动填写"}),(0,s.jsx)("button",{onClick:()=>sR("document"),style:{padding:"6px 16px",background:"document"===sT?"#38bdf8":"#1e293b",color:"document"===sT?"#0f172a":"#94a3b8",border:`1px solid ${"document"===sT?"#38bdf8":"#334155"}`,borderRadius:"6px",cursor:"pointer",fontSize:"0.85rem",fontWeight:"document"===sT?600:400,transition:"all 0.2s"},className:"jsx-29dfb32d17c16cd9",children:"📄 上传案例文档"})]}),"manual"===sT?(0,s.jsx)("textarea",{value:sN.standard_answer||"",onChange:e=>sS({...sN,standard_answer:e.target.value}),placeholder:"请填写该问题的标准答案...",style:{width:"100%",padding:"10px",minHeight:"150px",background:"#0f172a",border:"1px solid #334155",color:"#e2e8f0",borderRadius:"6px",fontSize:"0.9rem"},className:"jsx-29dfb32d17c16cd9"}):(0,s.jsx)("div",{style:{border:"2px dashed #334155",borderRadius:"8px",padding:"2rem",textAlign:"center",background:"#0f172a",cursor:"pointer",transition:"border-color 0.2s"},onDragOver:e=>{e.preventDefault(),e.currentTarget.style.borderColor="#38bdf8"},onDragLeave:e=>{e.currentTarget.style.borderColor="#334155"},onDrop:e=>{e.preventDefault(),e.currentTarget.style.borderColor="#334155";let s=e.dataTransfer.files[0];s&&sI(s)},onClick:()=>{let e=document.createElement("input");e.type="file",e.accept=".txt,.md,.markdown,.pdf",e.onchange=e=>{let s=e.target.files[0];s&&sI(s)},e.click()},className:"jsx-29dfb32d17c16cd9",children:sF?(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("div",{style:{fontSize:"2rem",marginBottom:"0.5rem"},className:"jsx-29dfb32d17c16cd9",children:"📄"}),(0,s.jsx)("div",{style:{color:"#4ade80",fontWeight:500},className:"jsx-29dfb32d17c16cd9",children:sF.name}),(0,s.jsxs)("div",{style:{color:"#94a3b8",fontSize:"0.8rem",marginTop:"4px"},className:"jsx-29dfb32d17c16cd9",children:[(sF.size/1024).toFixed(1)," KB · 点击更换文件"]})]}):(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("div",{style:{fontSize:"2rem",marginBottom:"0.5rem"},className:"jsx-29dfb32d17c16cd9",children:"📁"}),(0,s.jsx)("div",{style:{color:"#94a3b8"},className:"jsx-29dfb32d17c16cd9",children:"点击或拖拽上传案例文档"}),(0,s.jsx)("div",{style:{color:"#64748b",fontSize:"0.8rem",marginTop:"4px"},className:"jsx-29dfb32d17c16cd9",children:"支持 .txt, .md, .pdf 格式"})]})})]}),(0,s.jsxs)("div",{style:{marginTop:"1rem"},className:"jsx-29dfb32d17c16cd9 form-group",children:[(0,s.jsxs)("label",{style:{fontWeight:600,fontSize:"0.95rem",color:"#e2e8f0"},className:"jsx-29dfb32d17c16cd9",children:["预期技能 (Expected Skills) ",(0,s.jsx)("span",{style:{color:"#64748b",fontWeight:400},className:"jsx-29dfb32d17c16cd9",children:"(可选)"})]}),(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},className:"jsx-29dfb32d17c16cd9",children:[(sN.expectedSkills||[]).map((e,t)=>(0,s.jsxs)("div",{style:{display:"flex",gap:"8px",alignItems:"center"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("input",{type:"text",value:e.skill,onChange:e=>{let s=[...sN.expectedSkills||[]];s[t]={...s[t],skill:e.target.value},sS({...sN,expectedSkills:s})},placeholder:"技能名称",style:{flex:2,padding:"10px",background:"#0f172a",border:"1px solid #334155",color:"#e2e8f0",borderRadius:"6px",fontSize:"0.95rem"},className:"jsx-29dfb32d17c16cd9"}),(0,s.jsx)("input",{type:"number",value:e.version??0,onChange:e=>{let s=e.target.value,r=[...sN.expectedSkills||[]];r[t]={...r[t],version:""===s?0:Math.max(0,parseInt(s,10)||0)},sS({...sN,expectedSkills:r})},placeholder:"版本 (默认: 0)",style:{flex:1,padding:"10px",background:"#0f172a",border:"1px solid #334155",color:"#e2e8f0",borderRadius:"6px",fontSize:"0.95rem"},className:"jsx-29dfb32d17c16cd9"}),(0,s.jsx)("button",{type:"button",onClick:()=>{let e=(sN.expectedSkills||[]).filter((e,s)=>s!==t);sS({...sN,expectedSkills:e})},style:{padding:"10px",background:"#3b1c1c",color:"#ef4444",border:"none",borderRadius:"6px",cursor:"pointer"},className:"jsx-29dfb32d17c16cd9",children:"✕"})]},t)),(0,s.jsx)("button",{type:"button",onClick:()=>{let e=[...sN.expectedSkills||[],{skill:"",version:0}];sS({...sN,expectedSkills:e})},style:{padding:"8px",background:"#1e3a5f",color:"#38bdf8",border:"1px dashed #38bdf8",borderRadius:"6px",cursor:"pointer",fontSize:"0.85rem"},className:"jsx-29dfb32d17c16cd9",children:"+ 添加预期技能"})]})]}),(0,s.jsx)("div",{style:{marginTop:"1rem",padding:"12px 16px",background:"rgba(56, 189, 248, 0.08)",border:"1px solid rgba(56, 189, 248, 0.2)",borderRadius:"8px",color:"#94a3b8",fontSize:"0.85rem"},className:"jsx-29dfb32d17c16cd9",children:(0,s.jsxs)("p",{style:{margin:0},className:"jsx-29dfb32d17c16cd9",children:["💡 保存后,系统将基于标准答案自动提取",(0,s.jsx)("strong",{style:{color:"#bae6fd"},className:"jsx-29dfb32d17c16cd9",children:"关键观点"}),"(回答中必须包含的核心信息)和",(0,s.jsx)("strong",{style:{color:"#bae6fd"},className:"jsx-29dfb32d17c16cd9",children:"关键动作"}),"(Agent 必须执行的操作步骤),用于后续的细致评估打分。此过程在后台执行,无需等待。"]})})]}),(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:"12px",marginTop:"1.5rem",paddingTop:"1rem",borderTop:"1px solid #334155"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("button",{onClick:()=>{s_(!1),sz(!1)},style:{padding:"8px 24px",background:"#1e293b",color:"#94a3b8",border:"1px solid #334155",borderRadius:"6px",cursor:"pointer",fontSize:"0.9rem",fontWeight:500,transition:"all 0.2s"},className:"jsx-29dfb32d17c16cd9",children:"取消"}),(0,s.jsx)("button",{onClick:sW,disabled:sC,style:{padding:"8px 28px",background:sC?"#1e3a5f":"#38bdf8",color:sC?"#64748b":"#0f172a",border:"none",borderRadius:"6px",cursor:sC?"not-allowed":"pointer",fontSize:"0.9rem",fontWeight:600,transition:"all 0.2s",boxShadow:sC?"none":"0 2px 8px rgba(56, 189, 248, 0.25)"},className:"jsx-29dfb32d17c16cd9",children:sC?"保存中...":"保存"})]})]})}),eb&&(0,s.jsx)("div",{onClick:()=>eh(null),className:"jsx-29dfb32d17c16cd9 modal-overlay",children:(0,s.jsxs)("div",{onClick:e=>e.stopPropagation(),style:{width:"800px",maxWidth:"95%",maxHeight:"90vh",overflowY:"auto"},className:"jsx-29dfb32d17c16cd9 modal-content card",children:[(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"1rem"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("h3",{className:"jsx-29dfb32d17c16cd9",children:"记录详情"}),(0,s.jsx)("button",{onClick:()=>eh(null),style:{background:"transparent",border:"none",color:"white",fontSize:"1.5rem",cursor:"pointer"},className:"jsx-29dfb32d17c16cd9",children:"×"})]}),(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9 detail-section",children:[(0,s.jsx)("h4",{className:"jsx-29dfb32d17c16cd9",children:"基本信息"}),(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9 detail-grid",children:[(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("strong",{className:"jsx-29dfb32d17c16cd9",children:"Time:"})," ",O(eb.timestamp)]}),(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("strong",{className:"jsx-29dfb32d17c16cd9",children:"Framework:"})," ",eb.framework]}),(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("strong",{className:"jsx-29dfb32d17c16cd9",children:"Latency:"})," ",z(eb.latency),(e=eb.upload_id||eb.task_id||"",(d=sG.get(e))?D(d.latencyDiff,!0):null)]}),(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("strong",{className:"jsx-29dfb32d17c16cd9",children:"Token:"})," ",eb.tokens,(h=eb.upload_id||eb.task_id||"",(g=sG.get(h))?D(g.tokenDiff,!0):null)]}),(j=eb.upload_id||eb.task_id||"",(y=sG.get(j))?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("strong",{className:"jsx-29dfb32d17c16cd9",children:"准确率变化:"})," ",D(y.accuracyDiff,!1)]}),(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("strong",{className:"jsx-29dfb32d17c16cd9",children:"成本变化:"})," ",D(y.costDiff,!0)]})]}):null)]})]}),(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9 detail-section",children:[(0,s.jsx)("h4",{className:"jsx-29dfb32d17c16cd9",children:"Input / Output"}),(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9 detail-row",children:[(0,s.jsx)("strong",{style:{display:"block",marginBottom:"0.2rem",color:"#94a3b8"},className:"jsx-29dfb32d17c16cd9",children:"Query:"}),(0,s.jsx)("div",{className:"jsx-29dfb32d17c16cd9 code-block",children:eb.query})]}),(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9 detail-row",children:[(0,s.jsx)("strong",{style:{display:"block",marginBottom:"0.2rem",color:"#94a3b8"},className:"jsx-29dfb32d17c16cd9",children:"Skills Used:"}),(0,s.jsx)("div",{className:"jsx-29dfb32d17c16cd9 code-block",children:(0,s.jsx)(f.SkillLinks,{skills:eb.skills,skill:eb.skill,skillVersion:eb.skill_version?parseInt(eb.skill_version):null,user:eb.user})})]}),(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9 detail-row",children:[(0,s.jsx)("strong",{style:{display:"block",marginBottom:"0.2rem",color:"#94a3b8"},className:"jsx-29dfb32d17c16cd9",children:"Final Result:"}),(0,s.jsx)("div",{style:{maxHeight:"200px",overflowY:"auto"},className:"jsx-29dfb32d17c16cd9 code-block",children:eb.final_result||"(None)"})]})]}),(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9 detail-section",children:[(0,s.jsx)("h4",{className:"jsx-29dfb32d17c16cd9",children:"评估结果"}),(0,s.jsx)("div",{style:{display:"grid",gridTemplateColumns:"1fr",gap:"1rem",marginBottom:"1.5rem"},className:"jsx-29dfb32d17c16cd9",children:(0,s.jsxs)("div",{style:null===eb.answer_score?{borderLeft:"4px solid #94a3b8",background:"rgba(148, 163, 184, 0.1)",color:"#94a3b8"}:{},className:`jsx-29dfb32d17c16cd9 status-box ${null===eb.answer_score?"warning":(eb.answer_score||0)>.8?"good":"bad"}`,children:[(0,s.jsx)("strong",{className:"jsx-29dfb32d17c16cd9",children:"回答评分:"})," ",null===eb.answer_score?"--":(eb.answer_score||0).toFixed(2)]})}),eb.failures&&eb.failures.length>0&&(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9 detail-section",children:[(0,s.jsx)("h4",{style:{color:"#f87171"},className:"jsx-29dfb32d17c16cd9",children:"中间故障 / 异常分析"}),(0,s.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"1rem"},className:"jsx-29dfb32d17c16cd9",children:eb.failures.map((e,t)=>(0,s.jsxs)("div",{style:{background:"rgba(248, 113, 113, 0.1)",border:"1px solid #7f1d1d",borderRadius:"6px",padding:"1rem"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",marginBottom:"0.5rem"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("span",{style:{background:"#f87171",color:"#0f172a",padding:"2px 8px",borderRadius:"4px",fontSize:"0.8rem",fontWeight:"bold"},className:"jsx-29dfb32d17c16cd9",children:e.failure_type}),(0,s.jsx)("span",{style:{color:"#fca5a5",fontWeight:"bold"},className:"jsx-29dfb32d17c16cd9",children:e.description})]}),e.context&&(0,s.jsx)("div",{style:{marginBottom:"0.5rem",fontSize:"0.9rem",color:"#cbd5e1",fontFamily:"monospace",background:"rgba(0,0,0,0.3)",padding:"0.5rem",borderRadius:"4px"},className:"jsx-29dfb32d17c16cd9",children:e.context}),e.recovery&&(0,s.jsxs)("div",{style:{fontSize:"0.9rem",color:"#86efac"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("strong",{style:{color:"#94a3b8"},className:"jsx-29dfb32d17c16cd9",children:"修复建议:"})," ",e.recovery]}),(e.attribution||e.attribution_reason)&&(0,s.jsxs)("div",{style:{marginTop:"0.8rem",paddingTop:"0.8rem",borderTop:"1px dashed #7f1d1d"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",marginBottom:"0.3rem"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("strong",{style:{color:"#fbbf24"},className:"jsx-29dfb32d17c16cd9",children:"归因分析:"}),e.attribution&&(0,s.jsx)("span",{style:{background:"#fbbf24",color:"#451a03",padding:"1px 6px",borderRadius:"4px",fontSize:"0.75rem",fontWeight:"bold",border:"1px solid #d97706"},className:"jsx-29dfb32d17c16cd9",children:e.attribution})]}),e.attribution_reason&&(0,s.jsx)("div",{style:{fontSize:"0.9rem",color:"#fcd34d",fontStyle:"italic"},className:"jsx-29dfb32d17c16cd9",children:e.attribution_reason})]})]},t))})]}),(0,s.jsxs)("div",{style:{marginTop:"1rem"},className:"jsx-29dfb32d17c16cd9 detail-row",children:[(0,s.jsx)("strong",{style:{color:"#94a3b8"},className:"jsx-29dfb32d17c16cd9",children:"Reason:"}),(0,s.jsx)("div",{style:{marginTop:"0.2rem",fontSize:"0.9rem",color:"#e2e8f0",whiteSpace:"pre-wrap"},className:"jsx-29dfb32d17c16cd9",children:eb.judgment_reason||"-"})]})]}),(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9 detail-section",children:[(0,s.jsx)("h4",{className:"jsx-29dfb32d17c16cd9",children:"用户反馈 (User Feedback)"}),(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"1rem"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsxs)("div",{style:{display:"flex",gap:"1rem",alignItems:"center"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("button",{onClick:()=>sy("like"),style:{display:"flex",alignItems:"center",gap:"0.5rem",background:eb.user_feedback?.type==="like"?"#38bdf8":"#334155",color:eb.user_feedback?.type==="like"?"#0f172a":"#94a3b8",border:"none",padding:"6px 12px",borderRadius:"4px",cursor:"pointer",fontWeight:eb.user_feedback?.type==="like"?"bold":"normal",transition:"all 0.2s"},className:"jsx-29dfb32d17c16cd9",children:"👍 Like"}),(0,s.jsx)("button",{onClick:()=>sy("dislike"),style:{display:"flex",alignItems:"center",gap:"0.5rem",background:eb.user_feedback?.type==="dislike"?"#f87171":"#334155",color:eb.user_feedback?.type==="dislike"?"#0f172a":"#94a3b8",border:"none",padding:"6px 12px",borderRadius:"4px",cursor:"pointer",fontWeight:eb.user_feedback?.type==="dislike"?"bold":"normal",transition:"all 0.2s"},className:"jsx-29dfb32d17c16cd9",children:"👎 Dislike"})]}),(0,s.jsxs)("div",{style:{display:"flex",gap:"0.5rem",alignItems:"flex-start"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("textarea",{value:eQ,onChange:e=>eX(e.target.value),placeholder:"添加评论 (可选)...",style:{flex:1,minHeight:"60px",padding:"8px",background:"#0f172a",border:"1px solid #334155",color:"#e2e8f0",borderRadius:"4px",fontSize:"0.9rem"},className:"jsx-29dfb32d17c16cd9"}),(0,s.jsx)("button",{onClick:()=>sy(eb.user_feedback?.type||null),style:{padding:"8px 16px",fontSize:"0.9rem",height:"fit-content",whiteSpace:"nowrap"},className:"jsx-29dfb32d17c16cd9 btn-primary",children:"保存评论"})]})]})]})]})}),(0,s.jsx)("button",{onClick:()=>ea(!0),style:{position:"fixed",top:"1.5rem",right:"2rem",width:"3rem",height:"3rem",borderRadius:"50%",background:"#38bdf8",color:"#0f172a",border:"none",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.5rem",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",cursor:"pointer",zIndex:900,transition:"transform 0.2s"},onMouseOver:e=>e.currentTarget.style.transform="scale(1.1)",onMouseOut:e=>e.currentTarget.style.transform="scale(1)",title:"User Settings",className:"jsx-29dfb32d17c16cd9",children:"👤"}),ed&&(0,s.jsx)("div",{onClick:()=>ea(!1),style:{alignItems:"flex-start",paddingTop:"10vh"},className:"jsx-29dfb32d17c16cd9 modal-overlay",children:(0,s.jsxs)("div",{style:{width:"500px",maxWidth:"90vw",background:"#0f172a",border:"1px solid #334155",borderRadius:"12px",padding:"0",overflow:"hidden"},onClick:e=>e.stopPropagation(),className:"jsx-29dfb32d17c16cd9 modal-content",children:[(0,s.jsxs)("div",{style:{padding:"1.5rem",background:"linear-gradient(to right, #1e293b, #0f172a)",borderBottom:"1px solid #334155",display:"flex",justifyContent:"space-between",alignItems:"center"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"12px"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("div",{style:{width:"40px",height:"40px",borderRadius:"50%",background:"#38bdf8",color:"#0f172a",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.2rem",fontWeight:"bold"},className:"jsx-29dfb32d17c16cd9",children:k?k.substring(0,1).toUpperCase():"?"}),(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("h3",{style:{margin:0,color:"#f8fafc",fontSize:"1.1rem"},className:"jsx-29dfb32d17c16cd9",children:k}),(0,s.jsx)("span",{style:{fontSize:"0.8rem",color:"#94a3b8"},className:"jsx-29dfb32d17c16cd9",children:"User Profile"})]})]}),(0,s.jsx)("button",{onClick:()=>ea(!1),style:{background:"transparent",border:"none",color:"#64748b",fontSize:"1.5rem",cursor:"pointer",lineHeight:1},className:"jsx-29dfb32d17c16cd9",children:"×"})]}),(0,s.jsx)("div",{style:{padding:"1.5rem"},className:"jsx-29dfb32d17c16cd9",children:H?(0,s.jsxs)("div",{style:{background:"#1e293b",padding:"1.25rem",borderRadius:"8px",border:"1px solid #334155"},className:"jsx-29dfb32d17c16cd9 form-group",children:[(0,s.jsx)("label",{style:{color:"#94a3b8",fontSize:"0.8rem",textTransform:"uppercase",letterSpacing:"0.5px",marginBottom:"0.75rem",display:"block"},className:"jsx-29dfb32d17c16cd9",children:"API Key"}),(0,s.jsxs)("div",{style:{display:"flex",gap:"10px"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("div",{style:{flex:1,padding:"0.75rem 1rem",background:"#0f172a",borderRadius:"6px",border:"1px solid #334155",color:"#e2e8f0",fontFamily:"monospace",fontSize:"0.9rem",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},className:"jsx-29dfb32d17c16cd9",children:H}),(0,s.jsx)("button",{onClick:()=>{let e=()=>{eZ(!0),setTimeout(()=>eZ(!1),2e3)};if(navigator.clipboard&&window.isSecureContext)navigator.clipboard.writeText(H).then(e);else{let s=document.createElement("textarea");s.value=H,s.style.position="fixed",s.style.left="-9999px",s.style.top="0",document.body.appendChild(s),s.focus(),s.select();try{document.execCommand("copy"),e()}catch(e){console.error("Fallback: Oops, unable to copy",e),alert("复制失败,请手动复制")}document.body.removeChild(s)}},style:{padding:"0 1.25rem",display:"flex",alignItems:"center",gap:"6px",background:eG?"#4ade80":void 0},className:"jsx-29dfb32d17c16cd9 btn-primary",children:eG?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"jsx-29dfb32d17c16cd9",children:"✅"})," Copied"]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"jsx-29dfb32d17c16cd9",children:"📋"})," Copy"]})})]})]}):(0,s.jsx)("div",{style:{textAlign:"center",padding:"2rem",color:"#64748b"},className:"jsx-29dfb32d17c16cd9",children:"No API Key found."})}),(0,s.jsx)("div",{style:{padding:"0 1.5rem 1.5rem"},className:"jsx-29dfb32d17c16cd9",children:(0,s.jsx)("div",{style:{background:"#1e293b",padding:"1.25rem",borderRadius:"8px",border:"1px solid #334155"},className:"jsx-29dfb32d17c16cd9",children:(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsxs)("div",{className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("h4",{style:{margin:"0 0 0.25rem 0",color:"#f8fafc",fontSize:"0.95rem"},className:"jsx-29dfb32d17c16cd9",children:"新手引导"}),(0,s.jsx)("p",{style:{margin:0,fontSize:"0.8rem",color:"#94a3b8"},className:"jsx-29dfb32d17c16cd9",children:J?.guideDisabled?"引导已关闭":"引导已开启"})]}),(0,s.jsx)("button",{onClick:async()=>{J?.guideDisabled?(await (0,u.apiFetch)("/api/guide",{method:"POST",headers:{"Content-Type":"application/json","x-user-id":k},body:JSON.stringify({guideDisabled:!1,dismissedAt:null})})).ok&&window.location.reload():(await (0,u.apiFetch)("/api/guide",{method:"POST",headers:{"Content-Type":"application/json","x-user-id":k},body:JSON.stringify({currentStep:0,completedSteps:[],skippedSteps:[],dismissedAt:null})})).ok&&(ea(!1),Q(!0))},style:{background:J?.guideDisabled?"#4ade80":"#38bdf8",border:"none",color:"#0f172a",padding:"0.5rem 1rem",borderRadius:"6px",fontWeight:"600",cursor:"pointer",fontSize:"0.85rem"},className:"jsx-29dfb32d17c16cd9",children:J?.guideDisabled?"启用引导":"重新开始引导"})]})})}),(0,s.jsxs)("div",{style:{padding:"1.25rem 1.5rem",background:"#0f172a",borderTop:"1px solid #334155",display:"flex",justifyContent:"flex-end",gap:"1rem"},className:"jsx-29dfb32d17c16cd9",children:[(0,s.jsx)("button",{onClick:()=>ea(!1),style:{background:"transparent",border:"1px solid #334155",color:"#94a3b8",padding:"0.6rem 1.25rem",borderRadius:"6px",fontWeight:"500",cursor:"pointer"},className:"jsx-29dfb32d17c16cd9",children:"Close"}),!S&&(0,s.jsx)("button",{onClick:()=>{localStorage.removeItem("user_id"),localStorage.removeItem("api_key"),window.location.reload()},style:{background:"#ef4444",border:"none",color:"white",padding:"0.6rem 1.25rem",borderRadius:"6px",fontWeight:"600",cursor:"pointer",boxShadow:"0 2px 4px rgba(239, 68, 68, 0.2)"},className:"jsx-29dfb32d17c16cd9",children:"Sign Out"})]})]})}),(0,s.jsx)(t.default,{id:"29dfb32d17c16cd9",children:'.tab-btn.jsx-29dfb32d17c16cd9{color:#94a3b8;cursor:pointer;background:0 0;border:none;border-bottom:2px solid #0000;padding:.5rem 1rem;font-size:1rem}.tab-btn.active.jsx-29dfb32d17c16cd9{color:#38bdf8;border-bottom-color:#38bdf8}.p-2.jsx-29dfb32d17c16cd9{padding:.75rem}.btn-primary.jsx-29dfb32d17c16cd9{color:#0f172a;cursor:pointer;background:#38bdf8;border:none;border-radius:4px;padding:.5rem 1rem;font-weight:700}.btn-sm.jsx-29dfb32d17c16cd9{color:#fff;cursor:pointer;border:none;border-radius:4px;padding:4px 8px;font-size:.8rem}.modal-overlay.jsx-29dfb32d17c16cd9{alignItems:center;z-index:1000;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);background:#000c;justify-content:center;display:flex;position:fixed;inset:0}.modal-content.jsx-29dfb32d17c16cd9{background:#1e293b;border:1px solid #334155;width:66vw;max-width:1200px;padding:2rem}.form-group.jsx-29dfb32d17c16cd9{margin-bottom:1rem}.form-group.jsx-29dfb32d17c16cd9 label.jsx-29dfb32d17c16cd9{marginBottom:.5rem;color:#cbd5e1;display:block}input.jsx-29dfb32d17c16cd9,textarea.jsx-29dfb32d17c16cd9{color:#fff;borderRadius:4px;background:#0f172a;border:1px solid #334155}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}details[open].jsx-29dfb32d17c16cd9>summary.jsx-29dfb32d17c16cd9 .details-arrow.jsx-29dfb32d17c16cd9{transform:rotate(90deg)}details.jsx-29dfb32d17c16cd9>summary.jsx-29dfb32d17c16cd9:hover{background:#1e293bcc!important}details.jsx-29dfb32d17c16cd9>summary.jsx-29dfb32d17c16cd9::-webkit-details-marker{display:none}details.jsx-29dfb32d17c16cd9>summary.jsx-29dfb32d17c16cd9::marker{content:"";display:none}@keyframes pulse-dot{0%,to{opacity:1;transform:scale(1)}50%{opacity:.5;transform:scale(1.3)}}.detail-section.jsx-29dfb32d17c16cd9{border-bottom:1px solid #334155;margin-bottom:1.5rem;padding-bottom:1.5rem}.detail-section.jsx-29dfb32d17c16cd9:last-child{border-bottom:none}.detail-grid.jsx-29dfb32d17c16cd9{grid-template-columns:1fr 1fr;gap:1rem;display:grid}.detail-row.jsx-29dfb32d17c16cd9{margin-bottom:1rem}.code-block.jsx-29dfb32d17c16cd9{white-space:pre-wrap;color:#e2e8f0;background:#0f172a;border-radius:6px;padding:.8rem;font-family:monospace;font-size:.9rem}.status-box.jsx-29dfb32d17c16cd9{text-align:center;border-radius:6px;padding:1rem}.status-box.good.jsx-29dfb32d17c16cd9{color:#4ade80;background:#4ade801a;border:1px solid #4ade80}.status-box.bad.jsx-29dfb32d17c16cd9{color:#f87171;background:#f871711a;border:1px solid #f87171}h4.jsx-29dfb32d17c16cd9{color:#38bdf8;margin-top:0;margin-bottom:1rem}.text-sm.jsx-29dfb32d17c16cd9{font-size:.875rem}.text-xl.jsx-29dfb32d17c16cd9{font-size:1.25rem}.text-2xl.jsx-29dfb32d17c16cd9{font-size:1.5rem}.font-bold.jsx-29dfb32d17c16cd9{font-weight:700}.text-slate-400.jsx-29dfb32d17c16cd9{color:#94a3b8}.text-green-400.jsx-29dfb32d17c16cd9{color:#4ade80}.text-red-400.jsx-29dfb32d17c16cd9{color:#f87171}.dropdown-content.jsx-29dfb32d17c16cd9{display:none}.dropdown-trigger.jsx-29dfb32d17c16cd9:hover+.dropdown-content.jsx-29dfb32d17c16cd9,.dropdown-content.jsx-29dfb32d17c16cd9:hover{display:block}'}),Y&&ee.length>0&&!V&&(0,s.jsx)(w,{steps:ee,onComplete:async()=>{Q(!1),await Z()},onSkip:async e=>{await X(e)},onDontShowAgain:async()=>{await G()}})]})}e.s(["default",()=>P],58116)}]);