@weppy/roblox-mcp 2.0.8 → 2.0.9

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 (143) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +9 -1
  3. package/COMMERCIAL-LICENSE.md +1 -1
  4. package/README.md +10 -10
  5. package/TRADEMARKS.md +1 -1
  6. package/docs/assets/screenshots/plugin_main.png +0 -0
  7. package/docs/assets/screenshots/plugins_menu.png +0 -0
  8. package/docs/assets/screenshots/weppy_plugin_toolbar.png +0 -0
  9. package/docs/en/dashboard/changelog.md +1 -1
  10. package/docs/en/dashboard/connection.md +1 -1
  11. package/docs/en/dashboard/overview.md +1 -1
  12. package/docs/en/dashboard/playtest.md +1 -1
  13. package/docs/en/dashboard/settings.md +1 -1
  14. package/docs/en/dashboard/sync.md +1 -1
  15. package/docs/en/dashboard/tools.md +1 -1
  16. package/docs/en/installation/README.md +5 -3
  17. package/docs/en/installation/ai-apps/antigravity.md +1 -1
  18. package/docs/en/installation/ai-apps/claude-app.md +1 -1
  19. package/docs/en/installation/ai-apps/claude-code.md +1 -1
  20. package/docs/en/installation/ai-apps/codex-app.md +1 -1
  21. package/docs/en/installation/ai-apps/codex-cli.md +1 -1
  22. package/docs/en/installation/ai-apps/cursor.md +1 -1
  23. package/docs/en/installation/ai-apps/gemini-cli.md +1 -1
  24. package/docs/en/installation/roblox-explorer.md +9 -9
  25. package/docs/en/installation/roblox-plugin.md +3 -3
  26. package/docs/en/pro-upgrade.md +3 -3
  27. package/docs/en/sync/overview.md +2 -2
  28. package/docs/es/README.md +7 -7
  29. package/docs/es/dashboard/changelog.md +1 -1
  30. package/docs/es/dashboard/connection.md +1 -1
  31. package/docs/es/dashboard/overview.md +1 -1
  32. package/docs/es/dashboard/playtest.md +1 -1
  33. package/docs/es/dashboard/settings.md +1 -1
  34. package/docs/es/dashboard/sync.md +1 -1
  35. package/docs/es/dashboard/tools.md +1 -1
  36. package/docs/es/installation/README.md +2 -2
  37. package/docs/es/installation/ai-apps/antigravity.md +1 -1
  38. package/docs/es/installation/ai-apps/claude-app.md +1 -1
  39. package/docs/es/installation/ai-apps/claude-code.md +1 -1
  40. package/docs/es/installation/ai-apps/codex-app.md +1 -1
  41. package/docs/es/installation/ai-apps/codex-cli.md +1 -1
  42. package/docs/es/installation/ai-apps/cursor.md +1 -1
  43. package/docs/es/installation/ai-apps/gemini-cli.md +1 -1
  44. package/docs/es/installation/roblox-explorer.md +9 -9
  45. package/docs/es/installation/roblox-plugin.md +3 -3
  46. package/docs/es/pro-upgrade.md +1 -1
  47. package/docs/es/sync/overview.md +2 -2
  48. package/docs/id/README.md +7 -7
  49. package/docs/id/dashboard/changelog.md +1 -1
  50. package/docs/id/dashboard/connection.md +1 -1
  51. package/docs/id/dashboard/overview.md +1 -1
  52. package/docs/id/dashboard/playtest.md +1 -1
  53. package/docs/id/dashboard/settings.md +1 -1
  54. package/docs/id/dashboard/sync.md +1 -1
  55. package/docs/id/dashboard/tools.md +1 -1
  56. package/docs/id/installation/README.md +3 -3
  57. package/docs/id/installation/ai-apps/antigravity.md +1 -1
  58. package/docs/id/installation/ai-apps/claude-app.md +1 -1
  59. package/docs/id/installation/ai-apps/claude-code.md +1 -1
  60. package/docs/id/installation/ai-apps/codex-app.md +1 -1
  61. package/docs/id/installation/ai-apps/codex-cli.md +1 -1
  62. package/docs/id/installation/ai-apps/cursor.md +1 -1
  63. package/docs/id/installation/ai-apps/gemini-cli.md +1 -1
  64. package/docs/id/installation/roblox-explorer.md +9 -9
  65. package/docs/id/installation/roblox-plugin.md +3 -3
  66. package/docs/id/pro-upgrade.md +1 -1
  67. package/docs/id/sync/overview.md +2 -2
  68. package/docs/ja/README.md +7 -7
  69. package/docs/ja/installation/README.md +3 -3
  70. package/docs/ja/installation/ai-apps/antigravity.md +1 -1
  71. package/docs/ja/installation/ai-apps/claude-app.md +1 -1
  72. package/docs/ja/installation/ai-apps/claude-code.md +1 -1
  73. package/docs/ja/installation/ai-apps/codex-app.md +1 -1
  74. package/docs/ja/installation/ai-apps/codex-cli.md +1 -1
  75. package/docs/ja/installation/ai-apps/cursor.md +1 -1
  76. package/docs/ja/installation/ai-apps/gemini-cli.md +1 -1
  77. package/docs/ja/installation/roblox-explorer.md +9 -9
  78. package/docs/ja/installation/roblox-plugin.md +3 -3
  79. package/docs/ja/pro-upgrade.md +1 -1
  80. package/docs/ja/sync/overview.md +2 -2
  81. package/docs/ko/README.md +7 -7
  82. package/docs/ko/installation/README.md +5 -3
  83. package/docs/ko/installation/ai-apps/antigravity.md +1 -1
  84. package/docs/ko/installation/ai-apps/claude-app.md +1 -1
  85. package/docs/ko/installation/ai-apps/claude-code.md +1 -1
  86. package/docs/ko/installation/ai-apps/codex-app.md +1 -1
  87. package/docs/ko/installation/ai-apps/codex-cli.md +1 -1
  88. package/docs/ko/installation/ai-apps/cursor.md +1 -1
  89. package/docs/ko/installation/ai-apps/gemini-cli.md +1 -1
  90. package/docs/ko/installation/roblox-explorer.md +9 -9
  91. package/docs/ko/installation/roblox-plugin.md +3 -3
  92. package/docs/ko/pro-upgrade.md +1 -1
  93. package/docs/ko/sync/overview.md +2 -2
  94. package/docs/pt-br/README.md +8 -8
  95. package/docs/pt-br/dashboard/changelog.md +1 -1
  96. package/docs/pt-br/dashboard/connection.md +1 -1
  97. package/docs/pt-br/dashboard/overview.md +1 -1
  98. package/docs/pt-br/dashboard/playtest.md +1 -1
  99. package/docs/pt-br/dashboard/settings.md +1 -1
  100. package/docs/pt-br/dashboard/sync.md +1 -1
  101. package/docs/pt-br/dashboard/tools.md +1 -1
  102. package/docs/pt-br/installation/README.md +3 -3
  103. package/docs/pt-br/installation/ai-apps/antigravity.md +1 -1
  104. package/docs/pt-br/installation/ai-apps/claude-app.md +1 -1
  105. package/docs/pt-br/installation/ai-apps/claude-code.md +1 -1
  106. package/docs/pt-br/installation/ai-apps/codex-app.md +1 -1
  107. package/docs/pt-br/installation/ai-apps/codex-cli.md +1 -1
  108. package/docs/pt-br/installation/ai-apps/cursor.md +1 -1
  109. package/docs/pt-br/installation/ai-apps/gemini-cli.md +1 -1
  110. package/docs/pt-br/installation/roblox-explorer.md +9 -9
  111. package/docs/pt-br/installation/roblox-plugin.md +3 -3
  112. package/docs/pt-br/pro-upgrade.md +1 -1
  113. package/docs/pt-br/sync/overview.md +2 -2
  114. package/docs/troubleshooting.md +1 -1
  115. package/install.ps1 +37 -14
  116. package/install.sh +38 -3
  117. package/llms-full.txt +7 -7
  118. package/llms.txt +4 -4
  119. package/package.json +1 -1
  120. package/plugins/weppy-roblox-mcp/.claude-plugin/plugin.json +1 -1
  121. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{ChangelogDetailPage-D1JOF_uS.js → ChangelogDetailPage-DRPIGDB0.js} +1 -1
  122. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{ChangelogPage-C4ftyN_p.js → ChangelogPage-DVPYTw2L.js} +1 -1
  123. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{ConfirmModal-DPwJWgnH.js → ConfirmModal-Db4rfrTo.js} +1 -1
  124. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{ConnectionPage-CBB0jpB4.js → ConnectionPage-Cv2i3LSr.js} +1 -1
  125. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{InfoLabel-CYxzWZMs.js → InfoLabel-DzXzzs6Q.js} +1 -1
  126. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{OverviewPage-DkTqzsFx.js → OverviewPage-FoC28UL8.js} +1 -1
  127. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{PlaytestPage-qErtShLw.js → PlaytestPage-BjBAsHLz.js} +2 -2
  128. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{PropertyDiff-C4VtcZO2.js → PropertyDiff-BZMdMzMr.js} +1 -1
  129. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/SettingsPage-BKp2VKMW.js +1 -0
  130. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{StatusBadge-Ch9hAD89.js → StatusBadge-DtcYlxe-.js} +1 -1
  131. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/SyncPage-DcELF5_j.js +4 -0
  132. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{TierPromoProgress-DsH0LxDt.js → TierPromoProgress-r5fgmYI5.js} +1 -1
  133. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{ToolsPage-D6x4enqI.js → ToolsPage-Cfau3bX3.js} +1 -1
  134. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/index-DWRH2iF4.js +129 -0
  135. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{tier-promo-config-DU-2XXTa.js → tier-promo-config-CQFDWwo4.js} +1 -1
  136. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{useLiveUptime-C7E1-LNV.js → useLiveUptime-5lD1XKnw.js} +1 -1
  137. package/plugins/weppy-roblox-mcp/dashboard/dist/index.html +3 -3
  138. package/plugins/weppy-roblox-mcp/dashboard/dist/wrox-icon.png +0 -0
  139. package/plugins/weppy-roblox-mcp/dist/index.js +2 -2
  140. package/plugins/weppy-roblox-mcp/roblox-plugin/WeppyRobloxMCP.rbxm +0 -0
  141. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/SettingsPage-DJLwbREH.js +0 -1
  142. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/SyncPage-CbegjDPX.js +0 -4
  143. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/index-CQdnwaWW.js +0 -129
@@ -1,4 +1,4 @@
1
- import{r as n,a as f,u as j,j as e,T as _,i as A}from"./index-CQdnwaWW.js";import{u as H,T as D,a as E}from"./tier-promo-config-DU-2XXTa.js";import{I as P}from"./InfoLabel-CYxzWZMs.js";import{C as U}from"./ConfirmModal-DPwJWgnH.js";const $=5e3;function O(t){const o=(t==null?void 0:t.enabled)??!0,[d,r]=n.useState([]),[a,i]=n.useState(null),[p,l]=n.useState(o),c=n.useRef(null),m=n.useCallback(async()=>{try{const y=await f.get("/api/dashboard/playtest/history");r(y.entries??[])}catch{r([])}},[]),u=n.useCallback(async()=>{if(!o){l(!1);return}await m(),l(!1)},[o,m]),x=n.useCallback(async()=>{o&&(await f.post("/api/dashboard/playtest/history/clear"),r([]),i(null))},[o]),v=n.useCallback(async y=>{if(o)try{const S=await f.get(`/api/dashboard/playtest/report/${y}`);i(S)}catch{i(null)}},[o]);return n.useEffect(()=>{if(!o){l(!1);return}return u(),c.current=setInterval(u,$),()=>{c.current&&clearInterval(c.current)}},[o,u]),{history:d,selectedReport:a,loading:p,loadReport:v,clearHistory:x}}function F(t){const o="2026-03-27T15:26:00.000Z",d={testScenario:t("playtest.sample.context.why","Spawn into the arena, survive the opener, and verify the HUD responds immediately."),expectedBehavior:t("playtest.sample.context.expected","The player spawns safely, the countdown UI appears within one second, and the first wave starts without errors."),observedBehavior:t("playtest.sample.context.observed","Spawn protection held, the HUD updated on time, and wave one completed with no gameplay regressions.")};return{history:[{timestamp:o,testName:t("playtest.sample.history.name","Sample Arena Smoke Test"),mode:"play",status:"passed",durationMs:4820,contextId:"sample_playtest_preview",contextSummary:d}],report:{markdown:t("playtest.sample.report.markdown",`# Sample Arena Smoke Test
1
+ import{r as n,a as f,u as j,j as e,T as _,i as A}from"./index-DWRH2iF4.js";import{u as H,T as D,a as E}from"./tier-promo-config-CQFDWwo4.js";import{I as P}from"./InfoLabel-DzXzzs6Q.js";import{C as U}from"./ConfirmModal-Db4rfrTo.js";const $=5e3;function O(t){const o=(t==null?void 0:t.enabled)??!0,[d,r]=n.useState([]),[a,i]=n.useState(null),[p,l]=n.useState(o),c=n.useRef(null),m=n.useCallback(async()=>{try{const y=await f.get("/api/dashboard/playtest/history");r(y.entries??[])}catch{r([])}},[]),u=n.useCallback(async()=>{if(!o){l(!1);return}await m(),l(!1)},[o,m]),x=n.useCallback(async()=>{o&&(await f.post("/api/dashboard/playtest/history/clear"),r([]),i(null))},[o]),v=n.useCallback(async y=>{if(o)try{const S=await f.get(`/api/dashboard/playtest/report/${y}`);i(S)}catch{i(null)}},[o]);return n.useEffect(()=>{if(!o){l(!1);return}return u(),c.current=setInterval(u,$),()=>{c.current&&clearInterval(c.current)}},[o,u]),{history:d,selectedReport:a,loading:p,loadReport:v,clearHistory:x}}function F(t){const o="2026-03-27T15:26:00.000Z",d={testScenario:t("playtest.sample.context.why","Spawn into the arena, survive the opener, and verify the HUD responds immediately."),expectedBehavior:t("playtest.sample.context.expected","The player spawns safely, the countdown UI appears within one second, and the first wave starts without errors."),observedBehavior:t("playtest.sample.context.observed","Spawn protection held, the HUD updated on time, and wave one completed with no gameplay regressions.")};return{history:[{timestamp:o,testName:t("playtest.sample.history.name","Sample Arena Smoke Test"),mode:"play",status:"passed",durationMs:4820,contextId:"sample_playtest_preview",contextSummary:d}],report:{markdown:t("playtest.sample.report.markdown",`# Sample Arena Smoke Test
2
2
 
3
3
  - Spawn flow: PASS
4
4
  - HUD countdown: PASS
@@ -8,4 +8,4 @@ This is a sample preview. Upgrade to Pro to save and review real automated playt
8
8
  [sample] spawn protection active
9
9
  [sample] hud countdown rendered
10
10
  [sample] wave one completed
11
- [sample] preview report finished`),contextId:"sample_playtest_preview",contextSummary:d}}}const W="_page_1ge4x_2",V="_sampleBanner_1ge4x_9",z="_sampleBannerMain_1ge4x_22",G="_sampleBadge_1ge4x_29",Y="_sampleTitle_1ge4x_44",Z="_sampleMessage_1ge4x_51",q="_sampleActions_1ge4x_58",J="_primaryAction_1ge4x_66",K="_secondaryAction_1ge4x_67",Q="_card_1ge4x_103",X="_cardHeader_1ge4x_110",ee="_clearButton_1ge4x_122",te="_statusRow_1ge4x_137",se="_statusIndicator_1ge4x_144",ae="_statusRunning_1ge4x_152",oe="_statusPaused_1ge4x_157",re="_statusNotRunning_1ge4x_161",ne="_statusLabel_1ge4x_165",le="_statusMeta_1ge4x_172",ie="_controlButtons_1ge4x_178",ce="_btn_1ge4x_185",de="_btnPrimary_1ge4x_207",pe="_btnDanger_1ge4x_217",me="_historyList_1ge4x_227",ue="_historyItem_1ge4x_235",he="_historyItemSelected_1ge4x_254",xe="_historyItemHeader_1ge4x_259",ye="_historyIcon_1ge4x_265",_e="_historyTimestamp_1ge4x_270",ge="_historyName_1ge4x_277",ve="_historyItemMeta_1ge4x_287",Se="_historyMode_1ge4x_296",fe="_historyDuration_1ge4x_300",je="_historyStatus_1ge4x_304",be="_status_passed_1ge4x_311",Ne="_status_failed_1ge4x_315",Ce="_status_running_1ge4x_319",we="_historyError_1ge4x_323",Le="_historyContext_1ge4x_333",Ie="_historyContextLine_1ge4x_342",Pe="_historyContextLabel_1ge4x_348",Te="_reportContainer_1ge4x_357",Re="_reportContextPanel_1ge4x_363",Be="_reportContextRow_1ge4x_373",Me="_reportContextLabel_1ge4x_381",ke="_reportSection_1ge4x_389",Ae="_reportSectionHeader_1ge4x_395",He="_reportMarkdown_1ge4x_407",De="_reportLogs_1ge4x_420",Ee="_emptyState_1ge4x_435",Ue="_emptyStateTitle_1ge4x_442",$e="_emptyStateMessage_1ge4x_450",Oe="_upgradePanel_1ge4x_459",Fe="_upgradePanelIcon_1ge4x_467",We="_upgradePanelTitle_1ge4x_472",Ve="_upgradePanelDesc_1ge4x_480",ze="_benefitList_1ge4x_490",Ge="_benefitItem_1ge4x_501",Ye="_upgradeActions_1ge4x_516",s={page:W,sampleBanner:V,sampleBannerMain:z,sampleBadge:G,sampleTitle:Y,sampleMessage:Z,sampleActions:q,primaryAction:J,secondaryAction:K,card:Q,cardHeader:X,clearButton:ee,statusRow:te,statusIndicator:se,statusRunning:ae,statusPaused:oe,statusNotRunning:re,statusLabel:ne,statusMeta:le,controlButtons:ie,btn:ce,btnPrimary:de,btnDanger:pe,historyList:me,historyItem:ue,historyItemSelected:he,historyItemHeader:xe,historyIcon:ye,historyTimestamp:_e,historyName:ge,historyItemMeta:ve,historyMode:Se,historyDuration:fe,historyStatus:je,status_passed:be,status_failed:Ne,status_running:Ce,historyError:we,historyContext:Le,historyContextLine:Ie,historyContextLabel:Pe,reportContainer:Te,reportContextPanel:Re,reportContextRow:Be,reportContextLabel:Me,reportSection:ke,reportSectionHeader:Ae,reportMarkdown:He,reportLogs:De,emptyState:Ee,emptyStateTitle:Ue,emptyStateMessage:$e,upgradePanel:Oe,upgradePanelIcon:Fe,upgradePanelTitle:We,upgradePanelDesc:Ve,benefitList:ze,benefitItem:Ge,upgradeActions:Ye};function g(t){return t.trim().toLowerCase()}function Ze(t){switch(g(t)){case"passed":return"✅";case"failed":return"❌";case"running":return"⏱";default:return"❓"}}function qe(t,o){switch(g(o)){case"run":return t("playtest.status.mode.run","Run");case"server":return t("playtest.status.mode.server","Server");case"edit":return t("playtest.status.mode.edit","Edit");case"play":return t("playtest.status.mode.play","Play");default:return o}}function Je(t,o){switch(g(o)){case"passed":return t("playtest.history.status.passed","Passed");case"failed":return t("playtest.history.status.failed","Failed");case"running":return t("playtest.history.status.running","Running");default:return t("playtest.history.status.unknown","Unknown")}}function Ke(t){return t<1e3?`${t}ms`:`${(t/1e3).toFixed(1)}s`}function Qe({entries:t,onSelect:o,selectedTimestamp:d}){const{t:r}=j();return t.length===0?e.jsx("div",{className:s.emptyState,children:r("playtest.history.empty","No test results yet")}):e.jsx("div",{className:s.historyList,children:t.map(a=>{var p,l,c,m,u,x;const i=a.timestamp===d;return e.jsxs("button",{className:`${s.historyItem} ${i?s.historyItemSelected:""}`,onClick:()=>o(a.timestamp),children:[e.jsxs("div",{className:s.historyItemHeader,children:[e.jsx("span",{className:s.historyIcon,children:Ze(a.status)}),e.jsx("span",{className:s.historyTimestamp,children:a.timestamp}),e.jsx("span",{className:s.historyName,children:a.testName})]}),e.jsxs("div",{className:s.historyItemMeta,children:[e.jsx(_,{text:r("playtest.history.mode.tooltip","Playtest mode used for this recorded test run."),children:e.jsxs("span",{className:s.historyMode,children:[r("playtest.history.mode","Mode"),": ",qe(r,a.mode)]})}),e.jsx("span",{className:s.historyDuration,children:Ke(a.durationMs)}),e.jsx(_,{text:r("playtest.history.status.tooltip","Recorded result state for this automated playtest run."),children:e.jsx("span",{className:`${s.historyStatus} ${s[`status_${g(a.status)}`]??""}`,children:Je(r,a.status)})})]}),a.errorMessage&&e.jsx("div",{className:s.historyError,children:a.errorMessage}),(a.contextId||((p=a.contextSummary)==null?void 0:p.testScenario)||((l=a.contextSummary)==null?void 0:l.expectedBehavior)||((c=a.contextSummary)==null?void 0:c.observedBehavior))&&e.jsxs("div",{className:s.historyContext,children:[a.contextId&&e.jsxs("div",{className:s.historyContextLine,children:[e.jsx("span",{className:s.historyContextLabel,children:r("playtest.context.contextId","Context ID")}),e.jsx("span",{children:a.contextId})]}),((m=a.contextSummary)==null?void 0:m.testScenario)&&e.jsxs("div",{className:s.historyContextLine,children:[e.jsx("span",{className:s.historyContextLabel,children:r("playtest.context.why","Why this test ran")}),e.jsx("span",{children:a.contextSummary.testScenario})]}),((u=a.contextSummary)==null?void 0:u.expectedBehavior)&&e.jsxs("div",{className:s.historyContextLine,children:[e.jsx("span",{className:s.historyContextLabel,children:r("playtest.context.expected","Expected")}),e.jsx("span",{children:a.contextSummary.expectedBehavior})]}),((x=a.contextSummary)==null?void 0:x.observedBehavior)&&e.jsxs("div",{className:s.historyContextLine,children:[e.jsx("span",{className:s.historyContextLabel,children:r("playtest.context.observed","Observed")}),e.jsx("span",{children:a.contextSummary.observedBehavior})]})]})]},a.timestamp)})})}function Xe({report:t}){var r,a,i,p,l,c;const{t:o}=j(),d=!!((r=t.contextSummary)!=null&&r.testScenario||(a=t.contextSummary)!=null&&a.expectedBehavior||(i=t.contextSummary)!=null&&i.observedBehavior);return e.jsxs("div",{className:s.reportContainer,children:[d&&e.jsxs("div",{className:s.reportContextPanel,children:[((p=t.contextSummary)==null?void 0:p.testScenario)&&e.jsxs("div",{className:s.reportContextRow,children:[e.jsx("span",{className:s.reportContextLabel,children:o("playtest.context.why","Why this test ran")}),e.jsx("span",{children:t.contextSummary.testScenario})]}),((l=t.contextSummary)==null?void 0:l.expectedBehavior)&&e.jsxs("div",{className:s.reportContextRow,children:[e.jsx("span",{className:s.reportContextLabel,children:o("playtest.context.expected","Expected")}),e.jsx("span",{children:t.contextSummary.expectedBehavior})]}),((c=t.contextSummary)==null?void 0:c.observedBehavior)&&e.jsxs("div",{className:s.reportContextRow,children:[e.jsx("span",{className:s.reportContextLabel,children:o("playtest.context.observed","Observed")}),e.jsx("span",{children:t.contextSummary.observedBehavior})]})]}),t.markdown&&e.jsxs("div",{className:s.reportSection,children:[e.jsx("div",{className:s.reportSectionHeader,children:e.jsx(_,{text:o("playtest.report.content.tooltip","Markdown summary for the selected automated playtest run."),children:e.jsx("span",{children:o("playtest.report.content","Report")})})}),e.jsx("pre",{className:s.reportMarkdown,children:t.markdown})]}),t.logs&&e.jsxs("div",{className:s.reportSection,children:[e.jsx("div",{className:s.reportSectionHeader,children:e.jsx(_,{text:o("playtest.report.logs.tooltip","Execution logs captured for the selected automated playtest run."),children:e.jsx("span",{children:o("playtest.report.logs","Logs")})})}),e.jsx("pre",{className:s.reportLogs,children:t.logs})]}),!t.markdown&&!t.logs&&e.jsx("div",{className:s.emptyState,children:o("playtest.report.empty","No report content available")})]})}function ot(){var L;const{t}=j(),{tier:o,loading:d}=H(),r=!d&&o==="basic",a=O({enabled:!r}),{show:i}=A(),[p,l]=n.useState(null),[c,m]=n.useState(!1),[u,x]=n.useState(!1),[v,y]=n.useState(!1),{history:S,selectedReport:T,loading:R}=a,h=r?F(t):null,b=((L=h==null?void 0:h.history[0])==null?void 0:L.timestamp)??null,N=r?p??b:p,C=(h==null?void 0:h.history)??S,w=h&&N===b?h.report:T,B=r?!1:R,M=I=>{l(I),!r&&a.loadReport(I)},k=async()=>{x(!0);try{await a.clearHistory(),i(t("toast.clearSuccess","Cleared successfully"),"success"),m(!1),l(null)}catch{i(t("toast.clearFailed","Failed to clear data"),"error")}finally{x(!1)}};return e.jsxs("div",{className:s.page,children:[r&&e.jsxs("div",{className:s.sampleBanner,children:[e.jsxs("div",{className:s.sampleBannerMain,children:[e.jsx("div",{className:s.sampleBadge,children:t("playtest.sample.badge","Preview of the Pro playtest view")}),e.jsx("div",{className:s.sampleTitle,children:t("playtest.sample.title","You are previewing the report viewer that becomes available after upgrading to Pro.")}),e.jsx("div",{className:s.sampleMessage,children:t("playtest.sample.message","This preview uses sample data. Real playtest history management and stored reports unlock with Pro.")})]}),e.jsxs("div",{className:s.sampleActions,children:[e.jsx("button",{className:s.secondaryAction,onClick:()=>y(!0),children:t("tier.compare","Basic vs Pro")}),e.jsx("a",{className:s.primaryAction,href:D.playtest,target:"_blank",rel:"noreferrer",children:t("tier.upgrade","Upgrade to Pro")})]})]}),e.jsxs("div",{className:s.card,children:[e.jsxs("div",{className:s.cardHeader,children:[e.jsx(P,{label:t("playtest.history.title","Test History"),tooltip:t("playtest.history.title.tooltip","Recorded automated playtest runs for this project.")}),r?e.jsx(_,{text:t("playtest.sample.clearDisabled","Upgrade to Pro to clear live playtest history."),children:e.jsx("span",{children:e.jsx("button",{className:s.clearButton,disabled:!0,children:t("common.clear","Clear")})})}):e.jsx("button",{className:s.clearButton,onClick:()=>m(!0),children:t("common.clear","Clear")})]}),B?e.jsx("div",{className:s.emptyState,children:t("common.loading","Loading...")}):C.length===0?e.jsxs("div",{className:s.emptyState,children:[e.jsx("div",{className:s.emptyStateTitle,children:t("playtest.empty.title","No playtest results yet")}),e.jsxs("div",{className:s.emptyStateMessage,children:[t("playtest.empty.message.before","Test results will appear here when the AI agent runs automated tests via")," ",e.jsx(_,{text:t("playtest.empty.runTest.tooltip","Dashboard automation entry point that runs Roblox playtest checks through the system_info tool."),children:e.jsx("span",{children:"system_info.run_test"})}),t("playtest.empty.message.after",".")]})]}):e.jsx(Qe,{entries:C,onSelect:M,selectedTimestamp:N??void 0})]}),w&&e.jsxs("div",{className:s.card,children:[e.jsx("div",{className:s.cardHeader,children:e.jsx(P,{label:t("playtest.report.title","Selected Report"),tooltip:t("playtest.report.title.tooltip","Detailed output for the currently selected automated playtest run.")})}),e.jsx(Xe,{report:w})]}),!r&&e.jsx(U,{open:c,title:t("playtest.clear.title","Clear test history?"),message:t("playtest.clear.message","This permanently removes the stored playtest reports for the current place."),cancelLabel:t("common.cancel","Cancel"),confirmLabel:t("common.clear","Clear"),loading:u,onCancel:()=>!u&&m(!1),onConfirm:k}),v&&e.jsx(E,{onClose:()=>y(!1)})]})}export{ot as Component};
11
+ [sample] preview report finished`),contextId:"sample_playtest_preview",contextSummary:d}}}const W="_page_1ge4x_2",V="_sampleBanner_1ge4x_9",z="_sampleBannerMain_1ge4x_22",G="_sampleBadge_1ge4x_29",X="_sampleTitle_1ge4x_44",Y="_sampleMessage_1ge4x_51",Z="_sampleActions_1ge4x_58",q="_primaryAction_1ge4x_66",J="_secondaryAction_1ge4x_67",K="_card_1ge4x_103",Q="_cardHeader_1ge4x_110",ee="_clearButton_1ge4x_122",te="_statusRow_1ge4x_137",se="_statusIndicator_1ge4x_144",ae="_statusRunning_1ge4x_152",oe="_statusPaused_1ge4x_157",re="_statusNotRunning_1ge4x_161",ne="_statusLabel_1ge4x_165",le="_statusMeta_1ge4x_172",ie="_controlButtons_1ge4x_178",ce="_btn_1ge4x_185",de="_btnPrimary_1ge4x_207",pe="_btnDanger_1ge4x_217",me="_historyList_1ge4x_227",ue="_historyItem_1ge4x_235",he="_historyItemSelected_1ge4x_254",xe="_historyItemHeader_1ge4x_259",ye="_historyIcon_1ge4x_265",_e="_historyTimestamp_1ge4x_270",ge="_historyName_1ge4x_277",ve="_historyItemMeta_1ge4x_287",Se="_historyMode_1ge4x_296",fe="_historyDuration_1ge4x_300",je="_historyStatus_1ge4x_304",be="_status_passed_1ge4x_311",Ne="_status_failed_1ge4x_315",Ce="_status_running_1ge4x_319",we="_historyError_1ge4x_323",Le="_historyContext_1ge4x_333",Ie="_historyContextLine_1ge4x_342",Pe="_historyContextLabel_1ge4x_348",Re="_reportContainer_1ge4x_357",Te="_reportContextPanel_1ge4x_363",Be="_reportContextRow_1ge4x_373",Me="_reportContextLabel_1ge4x_381",ke="_reportSection_1ge4x_389",Ae="_reportSectionHeader_1ge4x_395",He="_reportMarkdown_1ge4x_407",De="_reportLogs_1ge4x_420",Ee="_emptyState_1ge4x_435",Ue="_emptyStateTitle_1ge4x_442",$e="_emptyStateMessage_1ge4x_450",Oe="_upgradePanel_1ge4x_459",Fe="_upgradePanelIcon_1ge4x_467",We="_upgradePanelTitle_1ge4x_472",Ve="_upgradePanelDesc_1ge4x_480",ze="_benefitList_1ge4x_490",Ge="_benefitItem_1ge4x_501",Xe="_upgradeActions_1ge4x_516",s={page:W,sampleBanner:V,sampleBannerMain:z,sampleBadge:G,sampleTitle:X,sampleMessage:Y,sampleActions:Z,primaryAction:q,secondaryAction:J,card:K,cardHeader:Q,clearButton:ee,statusRow:te,statusIndicator:se,statusRunning:ae,statusPaused:oe,statusNotRunning:re,statusLabel:ne,statusMeta:le,controlButtons:ie,btn:ce,btnPrimary:de,btnDanger:pe,historyList:me,historyItem:ue,historyItemSelected:he,historyItemHeader:xe,historyIcon:ye,historyTimestamp:_e,historyName:ge,historyItemMeta:ve,historyMode:Se,historyDuration:fe,historyStatus:je,status_passed:be,status_failed:Ne,status_running:Ce,historyError:we,historyContext:Le,historyContextLine:Ie,historyContextLabel:Pe,reportContainer:Re,reportContextPanel:Te,reportContextRow:Be,reportContextLabel:Me,reportSection:ke,reportSectionHeader:Ae,reportMarkdown:He,reportLogs:De,emptyState:Ee,emptyStateTitle:Ue,emptyStateMessage:$e,upgradePanel:Oe,upgradePanelIcon:Fe,upgradePanelTitle:We,upgradePanelDesc:Ve,benefitList:ze,benefitItem:Ge,upgradeActions:Xe};function g(t){return t.trim().toLowerCase()}function Ye(t){switch(g(t)){case"passed":return"✅";case"failed":return"❌";case"running":return"⏱";default:return"❓"}}function Ze(t,o){switch(g(o)){case"run":return t("playtest.status.mode.run","Run");case"server":return t("playtest.status.mode.server","Server");case"edit":return t("playtest.status.mode.edit","Edit");case"play":return t("playtest.status.mode.play","Play");default:return o}}function qe(t,o){switch(g(o)){case"passed":return t("playtest.history.status.passed","Passed");case"failed":return t("playtest.history.status.failed","Failed");case"running":return t("playtest.history.status.running","Running");default:return t("playtest.history.status.unknown","Unknown")}}function Je(t){return t<1e3?`${t}ms`:`${(t/1e3).toFixed(1)}s`}function Ke({entries:t,onSelect:o,selectedTimestamp:d}){const{t:r}=j();return t.length===0?e.jsx("div",{className:s.emptyState,children:r("playtest.history.empty","No test results yet")}):e.jsx("div",{className:s.historyList,children:t.map(a=>{var p,l,c,m,u,x;const i=a.timestamp===d;return e.jsxs("button",{className:`${s.historyItem} ${i?s.historyItemSelected:""}`,onClick:()=>o(a.timestamp),children:[e.jsxs("div",{className:s.historyItemHeader,children:[e.jsx("span",{className:s.historyIcon,children:Ye(a.status)}),e.jsx("span",{className:s.historyTimestamp,children:a.timestamp}),e.jsx("span",{className:s.historyName,children:a.testName})]}),e.jsxs("div",{className:s.historyItemMeta,children:[e.jsx(_,{text:r("playtest.history.mode.tooltip","Playtest mode used for this recorded test run."),children:e.jsxs("span",{className:s.historyMode,children:[r("playtest.history.mode","Mode"),": ",Ze(r,a.mode)]})}),e.jsx("span",{className:s.historyDuration,children:Je(a.durationMs)}),e.jsx(_,{text:r("playtest.history.status.tooltip","Recorded result state for this automated playtest run."),children:e.jsx("span",{className:`${s.historyStatus} ${s[`status_${g(a.status)}`]??""}`,children:qe(r,a.status)})})]}),a.errorMessage&&e.jsx("div",{className:s.historyError,children:a.errorMessage}),(a.contextId||((p=a.contextSummary)==null?void 0:p.testScenario)||((l=a.contextSummary)==null?void 0:l.expectedBehavior)||((c=a.contextSummary)==null?void 0:c.observedBehavior))&&e.jsxs("div",{className:s.historyContext,children:[a.contextId&&e.jsxs("div",{className:s.historyContextLine,children:[e.jsx("span",{className:s.historyContextLabel,children:r("playtest.context.contextId","Context ID")}),e.jsx("span",{children:a.contextId})]}),((m=a.contextSummary)==null?void 0:m.testScenario)&&e.jsxs("div",{className:s.historyContextLine,children:[e.jsx("span",{className:s.historyContextLabel,children:r("playtest.context.why","Why this test ran")}),e.jsx("span",{children:a.contextSummary.testScenario})]}),((u=a.contextSummary)==null?void 0:u.expectedBehavior)&&e.jsxs("div",{className:s.historyContextLine,children:[e.jsx("span",{className:s.historyContextLabel,children:r("playtest.context.expected","Expected")}),e.jsx("span",{children:a.contextSummary.expectedBehavior})]}),((x=a.contextSummary)==null?void 0:x.observedBehavior)&&e.jsxs("div",{className:s.historyContextLine,children:[e.jsx("span",{className:s.historyContextLabel,children:r("playtest.context.observed","Observed")}),e.jsx("span",{children:a.contextSummary.observedBehavior})]})]})]},a.timestamp)})})}function Qe({report:t}){var r,a,i,p,l,c;const{t:o}=j(),d=!!((r=t.contextSummary)!=null&&r.testScenario||(a=t.contextSummary)!=null&&a.expectedBehavior||(i=t.contextSummary)!=null&&i.observedBehavior);return e.jsxs("div",{className:s.reportContainer,children:[d&&e.jsxs("div",{className:s.reportContextPanel,children:[((p=t.contextSummary)==null?void 0:p.testScenario)&&e.jsxs("div",{className:s.reportContextRow,children:[e.jsx("span",{className:s.reportContextLabel,children:o("playtest.context.why","Why this test ran")}),e.jsx("span",{children:t.contextSummary.testScenario})]}),((l=t.contextSummary)==null?void 0:l.expectedBehavior)&&e.jsxs("div",{className:s.reportContextRow,children:[e.jsx("span",{className:s.reportContextLabel,children:o("playtest.context.expected","Expected")}),e.jsx("span",{children:t.contextSummary.expectedBehavior})]}),((c=t.contextSummary)==null?void 0:c.observedBehavior)&&e.jsxs("div",{className:s.reportContextRow,children:[e.jsx("span",{className:s.reportContextLabel,children:o("playtest.context.observed","Observed")}),e.jsx("span",{children:t.contextSummary.observedBehavior})]})]}),t.markdown&&e.jsxs("div",{className:s.reportSection,children:[e.jsx("div",{className:s.reportSectionHeader,children:e.jsx(_,{text:o("playtest.report.content.tooltip","Markdown summary for the selected automated playtest run."),children:e.jsx("span",{children:o("playtest.report.content","Report")})})}),e.jsx("pre",{className:s.reportMarkdown,children:t.markdown})]}),t.logs&&e.jsxs("div",{className:s.reportSection,children:[e.jsx("div",{className:s.reportSectionHeader,children:e.jsx(_,{text:o("playtest.report.logs.tooltip","Execution logs captured for the selected automated playtest run."),children:e.jsx("span",{children:o("playtest.report.logs","Logs")})})}),e.jsx("pre",{className:s.reportLogs,children:t.logs})]}),!t.markdown&&!t.logs&&e.jsx("div",{className:s.emptyState,children:o("playtest.report.empty","No report content available")})]})}function ot(){var L;const{t}=j(),{tier:o,loading:d}=H(),r=!d&&o==="basic",a=O({enabled:!r}),{show:i}=A(),[p,l]=n.useState(null),[c,m]=n.useState(!1),[u,x]=n.useState(!1),[v,y]=n.useState(!1),{history:S,selectedReport:R,loading:T}=a,h=r?F(t):null,b=((L=h==null?void 0:h.history[0])==null?void 0:L.timestamp)??null,N=r?p??b:p,C=(h==null?void 0:h.history)??S,w=h&&N===b?h.report:R,B=r?!1:T,M=I=>{l(I),!r&&a.loadReport(I)},k=async()=>{x(!0);try{await a.clearHistory(),i(t("toast.clearSuccess","Cleared successfully"),"success"),m(!1),l(null)}catch{i(t("toast.clearFailed","Failed to clear data"),"error")}finally{x(!1)}};return e.jsxs("div",{className:s.page,children:[r&&e.jsxs("div",{className:s.sampleBanner,children:[e.jsxs("div",{className:s.sampleBannerMain,children:[e.jsx("div",{className:s.sampleBadge,children:t("playtest.sample.badge","Preview of the Pro playtest view")}),e.jsx("div",{className:s.sampleTitle,children:t("playtest.sample.title","You are previewing the report viewer that becomes available after upgrading to Pro.")}),e.jsx("div",{className:s.sampleMessage,children:t("playtest.sample.message","This preview uses sample data. Real playtest history management and stored reports unlock with Pro.")})]}),e.jsxs("div",{className:s.sampleActions,children:[e.jsx("button",{className:s.secondaryAction,onClick:()=>y(!0),children:t("tier.compare","Basic vs Pro")}),e.jsx("a",{className:s.primaryAction,href:D.playtest,target:"_blank",rel:"noreferrer",children:t("tier.upgrade","Upgrade to Pro")})]})]}),e.jsxs("div",{className:s.card,children:[e.jsxs("div",{className:s.cardHeader,children:[e.jsx(P,{label:t("playtest.history.title","Test History"),tooltip:t("playtest.history.title.tooltip","Recorded automated playtest runs for this project.")}),r?e.jsx(_,{text:t("playtest.sample.clearDisabled","Upgrade to Pro to clear live playtest history."),children:e.jsx("span",{children:e.jsx("button",{className:s.clearButton,disabled:!0,children:t("common.clear","Clear")})})}):e.jsx("button",{className:s.clearButton,onClick:()=>m(!0),children:t("common.clear","Clear")})]}),B?e.jsx("div",{className:s.emptyState,children:t("common.loading","Loading...")}):C.length===0?e.jsxs("div",{className:s.emptyState,children:[e.jsx("div",{className:s.emptyStateTitle,children:t("playtest.empty.title","No playtest results yet")}),e.jsxs("div",{className:s.emptyStateMessage,children:[t("playtest.empty.message.before","Test results will appear here when the AI agent runs automated tests via")," ",e.jsx(_,{text:t("playtest.empty.runTest.tooltip","WROX Dashboard automation entry point that runs Roblox playtest checks through the system_info tool."),children:e.jsx("span",{children:"system_info.run_test"})}),t("playtest.empty.message.after",".")]})]}):e.jsx(Ke,{entries:C,onSelect:M,selectedTimestamp:N??void 0})]}),w&&e.jsxs("div",{className:s.card,children:[e.jsx("div",{className:s.cardHeader,children:e.jsx(P,{label:t("playtest.report.title","Selected Report"),tooltip:t("playtest.report.title.tooltip","Detailed output for the currently selected automated playtest run.")})}),e.jsx(Qe,{report:w})]}),!r&&e.jsx(U,{open:c,title:t("playtest.clear.title","Clear test history?"),message:t("playtest.clear.message","This permanently removes the stored playtest reports for the current place."),cancelLabel:t("common.cancel","Cancel"),confirmLabel:t("common.clear","Clear"),loading:u,onCancel:()=>!u&&m(!1),onConfirm:k}),v&&e.jsx(E,{onClose:()=>y(!1)})]})}export{ot as Component};
@@ -1,4 +1,4 @@
1
- import{u as f,r as h,j as n}from"./index-CQdnwaWW.js";const _="_container_uv8oc_2",p="_header_uv8oc_10",N="_modeBtn_uv8oc_18",x="_modeBtnActive_uv8oc_33",v="_unifiedView_uv8oc_40",j="_diffLine_uv8oc_46",y="_lineNum_uv8oc_55",g="_lineContent_uv8oc_64",C="_lineAdded_uv8oc_68",B="_lineRemoved_uv8oc_73",V="_lineContext_uv8oc_78",w="_sideBySide_uv8oc_83",L="_sidePane_uv8oc_90",$="_sideLabel_uv8oc_100",b="_sideContent_uv8oc_112",A="_empty_uv8oc_117",e={container:_,header:p,modeBtn:N,modeBtnActive:x,unifiedView:v,diffLine:j,lineNum:y,lineContent:g,lineAdded:C,lineRemoved:B,lineContext:V,sideBySide:w,sidePane:L,sideLabel:$,sideContent:b,empty:A};function S(t,c){const d=t.split(`
1
+ import{u as f,r as h,j as n}from"./index-DWRH2iF4.js";const _="_container_uv8oc_2",p="_header_uv8oc_10",N="_modeBtn_uv8oc_18",x="_modeBtnActive_uv8oc_33",v="_unifiedView_uv8oc_40",j="_diffLine_uv8oc_46",y="_lineNum_uv8oc_55",g="_lineContent_uv8oc_64",C="_lineAdded_uv8oc_68",B="_lineRemoved_uv8oc_73",V="_lineContext_uv8oc_78",w="_sideBySide_uv8oc_83",L="_sidePane_uv8oc_90",$="_sideLabel_uv8oc_100",b="_sideContent_uv8oc_112",A="_empty_uv8oc_117",e={container:_,header:p,modeBtn:N,modeBtnActive:x,unifiedView:v,diffLine:j,lineNum:y,lineContent:g,lineAdded:C,lineRemoved:B,lineContext:V,sideBySide:w,sidePane:L,sideLabel:$,sideContent:b,empty:A};function S(t,c){const d=t.split(`
2
2
  `),l=c.split(`
3
3
  `),a=[],m=Math.max(d.length,l.length);let s=0,i=0;for(;(s<d.length||i<l.length)&&(s<d.length&&i<l.length?d[s]===l[i]?(a.push({type:"context",content:d[s],lineNum:i+1}),s++,i++):(a.push({type:"removed",content:d[s],lineNum:s+1}),s++,s<d.length&&d[s]===l[i]?(a.push({type:"added",content:l[i],lineNum:i+1}),i++):i<l.length&&(a.push({type:"added",content:l[i],lineNum:i+1}),i++)):s<d.length?(a.push({type:"removed",content:d[s],lineNum:s+1}),s++):i<l.length&&(a.push({type:"added",content:l[i],lineNum:i+1}),i++),!(a.length>m*3)););return a}function E({before:t,after:c}){const{t:d}=f(),[l,a]=h.useState("unified"),m=h.useMemo(()=>S(t??"",c??""),[t,c]);if(!t&&!c)return n.jsx("div",{className:e.container,children:n.jsx("div",{className:e.empty,children:d("changelog.diff.empty","No diff available")})});if(!t&&c){const s=c.split(`
4
4
  `);return n.jsx("div",{className:e.container,children:n.jsx("div",{className:e.unifiedView,children:s.map((i,u)=>n.jsxs("div",{className:`${e.diffLine} ${e.lineAdded}`,children:[n.jsx("span",{className:e.lineNum,children:u+1}),n.jsxs("span",{className:e.lineContent,children:["+ ",i]})]},u))})})}return n.jsxs("div",{className:e.container,children:[n.jsxs("div",{className:e.header,children:[n.jsx("button",{className:`${e.modeBtn} ${l==="unified"?e.modeBtnActive:""}`,onClick:()=>a("unified"),children:d("changelog.diff.unified","Unified")}),n.jsx("button",{className:`${e.modeBtn} ${l==="side-by-side"?e.modeBtnActive:""}`,onClick:()=>a("side-by-side"),children:d("changelog.diff.sideBySide","Side by Side")})]}),l==="unified"?n.jsx("div",{className:e.unifiedView,children:m.map((s,i)=>n.jsxs("div",{className:`${e.diffLine} ${s.type==="added"?e.lineAdded:s.type==="removed"?e.lineRemoved:e.lineContext}`,children:[n.jsx("span",{className:e.lineNum,children:s.lineNum??""}),n.jsxs("span",{className:e.lineContent,children:[s.type==="added"?"+ ":s.type==="removed"?"- ":" ",s.content]})]},i))}):n.jsxs("div",{className:e.sideBySide,children:[n.jsxs("div",{className:e.sidePane,children:[n.jsx("div",{className:e.sideLabel,children:d("changelog.diff.before","Before")}),n.jsx("div",{className:e.sideContent,children:(t??"").split(`
@@ -0,0 +1 @@
1
+ import{d as P,r as c,f as M,D as $,e as F,g as G,h as W,a as w,u as X,j as e,T as b,A as q,S as U}from"./index-DWRH2iF4.js";import{I as o}from"./InfoLabel-DzXzzs6Q.js";function K(){const{level:s}=P(),[r,y]=c.useState(null),[u,i]=c.useState(null),[C,T]=c.useState(null),[A,m]=c.useState(!1),[p,S]=c.useState(!0),[O,f]=c.useState(!1),[B,L]=c.useState(null),g="gumroad",_=s==="L0",h=c.useCallback(n=>{n&&i(l=>({...l,...n,maskedKey:n.maskedKey??(l==null?void 0:l.maskedKey),provider:n.provider??(l==null?void 0:l.provider)??g}))},[g]),N=c.useCallback(n=>{if(!n){i(null);return}i({...n,provider:n.provider??g})},[g]),x=c.useCallback(async()=>{try{return await M(g)}catch{return null}},[g]);c.useEffect(()=>{let n=!1;async function l(){try{const[a,d,v]=await Promise.all([w.get("/api/dashboard/settings").catch(()=>null),x(),w.get("/sync/config").catch(()=>null)]);if(n)return;a&&y(a),d&&h(d),v&&T(v)}catch{}finally{n||S(!1)}}return l(),()=>{n=!0}},[x,h]),c.useEffect(()=>{const n=new $;n.connect();const l=n.on("license",a=>{x().then(d=>{if(d){if((a==null?void 0:a.cleared)===!0){N(d);return}h(d)}})});return()=>{l(),n.disconnect()}},[x,h,N]);const j=c.useCallback((n,l)=>{L(n??l)},[]),R=c.useCallback(async n=>{if(_)return!1;if(!n.trim())return L("License key is required."),!1;f(!0);try{const l=await F({provider:g,licenseKey:n.trim()});return h(l.license),j(l.message,l.ok?"License updated.":"License activation failed."),l.ok}catch{return L("License activation failed."),!1}finally{f(!1)}},[j,_,g,h]),I=c.useCallback(async()=>{if(!_){f(!0);try{const n=await G({provider:g});h(n.license),j(n.message,n.ok?"License updated.":"License refresh failed.")}catch{L("License refresh failed.")}finally{f(!1)}}},[j,_,g,h]),D=c.useCallback(async()=>{if(!_){f(!0);try{const n=await W({provider:g});N(n.license),j(n.message,n.ok?"License reset.":"License reset failed.")}catch{L("License reset failed.")}finally{f(!1)}}},[j,_,g,N]),E=c.useCallback(async(n,l)=>{if(r){y(a=>a&&{...a,hot:{...a.hot,[n]:l}}),m(!0);try{await w.patch("/api/dashboard/settings",{[n]:l})}catch{y(a=>a&&{...a,hot:{...a.hot,[n]:r.hot[n]}})}finally{m(!1)}}},[r]),k=c.useCallback(async n=>{m(!0);try{const l=await w.post("/sync/config",n);T(l)}catch{}finally{m(!1)}},[]);return{settings:r,license:u,syncConfig:C,saving:A,licenseProvider:g,licenseControlsDisabled:_,licenseSubmitting:O,licenseMessage:B,activateLicense:R,refreshLicense:I,resetLicense:D,updateHotSetting:E,updateSyncConfig:k,loading:p}}const V="_page_amh3j_2",Q="_card_amh3j_10",Y="_licenseCardPro_amh3j_17",z="_cardHeader_amh3j_28",J="_headerBadge_amh3j_42",Z="_headerBadgeLive_amh3j_53",ee="_licenseGrid_amh3j_59",se="_statusDot_amh3j_77",te="_statusActive_amh3j_86",ae="_statusGrace_amh3j_91",ne="_statusInactive_amh3j_96",ie="_statusError_amh3j_100",le="_proBadge_amh3j_105",ce="_upgradeLink_amh3j_119",oe="_licenseControls_amh3j_133",re="_licenseControlRow_amh3j_142",de="_licenseField_amh3j_149",ge="_licenseFieldGrow_amh3j_155",ue="_controlLabel_amh3j_160",he="_textInput_amh3j_166",me="_actionBtn_amh3j_182",pe="_licenseMessage_amh3j_204",je="_licenseNotice_amh3j_211",_e="_licenseNoticeInfo_amh3j_221",xe="_licenseNoticeWarning_amh3j_227",ve="_licenseNoticeMuted_amh3j_233",be="_settingRow_amh3j_239",fe="_settingLabel_amh3j_253",Le="_settingControl_amh3j_260",ye="_select_amh3j_269",Ne="_numberInput_amh3j_287",Ce="_toggleSwitch_amh3j_305",Te="_toggleInput_amh3j_312",Se="_toggleTrack_amh3j_320",Re="_toggleThumb_amh3j_342",Ie="_savedIndicator_amh3j_391",Ee="_savedIndicatorHidden_amh3j_402",ke="_coldGrid_amh3j_407",we="_coldHint_amh3j_425",Ae="_syncForm_amh3j_434",Oe="_syncRow_amh3j_440",Be="_syncField_amh3j_447",De="_saveBtn_amh3j_461",He="_langRow_amh3j_485",Pe="_loading_amh3j_498",Me="_unit_amh3j_507",t={page:V,card:Q,licenseCardPro:Y,cardHeader:z,headerBadge:J,headerBadgeLive:Z,licenseGrid:ee,statusDot:se,statusActive:te,statusGrace:ae,statusInactive:ne,statusError:ie,proBadge:le,upgradeLink:ce,licenseControls:oe,licenseControlRow:re,licenseField:de,licenseFieldGrow:ge,controlLabel:ue,textInput:he,actionBtn:me,licenseMessage:pe,licenseNotice:je,licenseNoticeInfo:_e,licenseNoticeWarning:xe,licenseNoticeMuted:ve,settingRow:be,settingLabel:fe,settingControl:Le,select:ye,numberInput:Ne,toggleSwitch:Ce,toggleInput:Te,toggleTrack:Se,toggleThumb:Re,savedIndicator:Ie,savedIndicatorHidden:Ee,coldGrid:ke,coldHint:we,syncForm:Ae,syncRow:Oe,syncField:Be,saveBtn:De,langRow:He,loading:Pe,unit:Me},$e={en:"English",ko:"한국어",es:"Español","pt-br":"Português (BR)",ja:"日本語",id:"Bahasa Indonesia"},Fe=["debug","info","warn","error"];function Ge(s){return s==="active"?t.statusActive:s==="grace"?t.statusGrace:s==="invalid"||s==="revoked"?t.statusError:t.statusInactive}function We(s,r){return s.refreshBlockedReason==="missing_session_token"?{label:r("settings.license.status.activationRequired","Activation Required"),tooltip:r("settings.license.status.activationRequired.tooltip","Manual license activation is required before WROX Dashboard can refresh this status."),detail:r("settings.license.detail.missingSessionToken","Refresh is blocked because the current session token is missing."),detailTone:t.licenseNoticeWarning}:s.statusDetail==="grace_provider_unavailable"?{label:r("settings.license.status.grace","Grace"),tooltip:r("settings.license.status.grace.tooltip","Provider verification is temporarily unavailable, but Pro access remains active during the grace period."),detail:r("settings.license.detail.graceProviderUnavailable","Provider unavailable. Pro access remains active during grace mode."),detailTone:t.licenseNoticeInfo}:s.statusDetail==="grace_cancelled"||s.statusDetail==="grace_expired"||s.statusDetail==="grace_payment_failed"?{label:r("settings.license.status.grace","Grace"),tooltip:r("settings.license.status.graceBilling.tooltip","Pro access is still available during a billing-related grace period."),detail:r("settings.license.detail.graceBilling","Pro access remains available during a billing grace period."),detailTone:t.licenseNoticeInfo}:{label:r(`settings.license.${s.status}`,s.status),tooltip:r(`settings.license.${s.status}.tooltip`,"Current license activation state."),detail:s.refreshRequired?r("settings.license.detail.refreshRecommended","License verification should be refreshed soon."):null,detailTone:t.licenseNoticeMuted}}function H({checked:s,onChange:r,testId:y,ariaLabel:u}){return e.jsxs("label",{className:t.toggleSwitch,"data-testid":y,children:[e.jsx("input",{type:"checkbox",className:t.toggleInput,checked:s,"aria-label":u,onChange:i=>r(i.target.checked)}),e.jsx("span",{className:t.toggleTrack,"aria-hidden":"true",children:e.jsx("span",{className:t.toggleThumb})})]})}function Ue(){const{t:s,selectedLocale:r,setLocale:y}=X(),{settings:u,license:i,syncConfig:C,saving:T,licenseProvider:A,licenseControlsDisabled:m,licenseSubmitting:p,licenseMessage:S,activateLicense:O,refreshLicense:f,resetLicense:B,updateHotSetting:L,updateSyncConfig:g,loading:_}=K(),[h,N]=c.useState(null),[x,j]=c.useState({}),[R,I]=c.useState(""),D=i?We(i,s):null,E=(i==null?void 0:i.tier)==="pro",k=(i==null?void 0:i.tier)==="pro"?i.maskedKey:void 0;c.useEffect(()=>{C&&j({maxDepth:C.maxDepth,maxInstances:C.maxInstances})},[C]);const n=c.useCallback(async(a,d)=>{await L(a,d),N(a),setTimeout(()=>N(v=>v===a?null:v),2e3)},[L]),l=c.useCallback(async()=>{await g(x)},[g,x]);return _?e.jsx("div",{className:t.page,children:e.jsx("div",{className:t.loading,children:s("common.loading")})}):e.jsxs("div",{className:t.page,children:[e.jsxs("div",{"data-testid":"settings-license-card",className:[t.card,(i==null?void 0:i.tier)==="pro"?t.licenseCardPro:""].filter(Boolean).join(" "),children:[e.jsxs("div",{className:t.cardHeader,children:[e.jsx(o,{label:s("settings.license.title","License"),tooltip:s("settings.license.title.tooltip","Current license status and subscription tier.")}),e.jsx(b,{text:m?s("settings.license.disconnected.tooltip","Reconnect to the MCP server to manage license actions from WROX Dashboard."):s("settings.license.live.tooltip","License actions are sent to the MCP server immediately."),children:e.jsx("span",{className:`${t.headerBadge} ${m?"":t.headerBadgeLive}`,children:m?s("settings.license.disconnected","Disconnected"):s("settings.general.liveApply","Live Apply")})})]}),e.jsxs(e.Fragment,{children:[i?e.jsxs(e.Fragment,{children:[(()=>{const a=D;return e.jsxs(e.Fragment,{children:[e.jsxs("dl",{className:t.licenseGrid,children:[e.jsx("dt",{children:e.jsx(o,{label:s("settings.license.status","Status"),tooltip:s("settings.license.status.tooltip","Current license activation state.")})}),e.jsxs("dd",{children:[e.jsx("span",{className:`${t.statusDot} ${Ge(i.status)}`}),e.jsx(b,{text:(a==null?void 0:a.tooltip)??s(`settings.license.${i.status}.tooltip`,"Current license activation state."),children:(a==null?void 0:a.label)??s(`settings.license.${i.status}`,i.status)})]}),e.jsx("dt",{children:e.jsx(o,{label:s("settings.license.tier","Tier"),tooltip:s("settings.license.tier.tooltip","Current subscription tier for available WROX Dashboard features.")})}),e.jsx("dd",{className:i.tier==="pro"?t.proBadge:"",children:e.jsx(b,{text:s(`tier.${i.tier}.tooltip`,"Available feature set for the connected license."),children:i.tier==="pro"?s("tier.pro","Pro"):s("tier.basic","Basic")})}),k&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(o,{label:s("settings.license.key","Key"),tooltip:s("settings.license.key.tooltip","Masked license key currently loaded by the server.")})}),e.jsx("dd",{children:e.jsx(b,{text:s("settings.license.keyValue.tooltip","Masked license key currently loaded by the server."),children:k})})]}),i.provider&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(o,{label:s("settings.license.provider","Provider"),tooltip:s("settings.license.provider.tooltip","License provider used to validate this key.")})}),e.jsx("dd",{children:e.jsx(b,{text:s("settings.license.providerValue.tooltip","License provider used to validate this key."),children:i.provider})})]})]}),(a==null?void 0:a.detail)&&e.jsx("p",{className:`${t.licenseNotice} ${a.detailTone}`,children:i.refreshBlockedReason==="missing_session_token"?s("settings.license.detail.manualActivation","Manual activation required to restore Pro access."):a.detail}),i.refreshBlockedReason==="missing_session_token"&&e.jsx("p",{className:`${t.licenseNotice} ${t.licenseNoticeMuted}`,children:a==null?void 0:a.detail})]})})(),i.tier==="basic"&&e.jsx("a",{className:t.upgradeLink,href:"https://gum.co/u/din5in7h",target:"_blank",rel:"noopener noreferrer",children:s("tier.upgrade")})]}):e.jsx("div",{className:t.loading,children:s("settings.license.unavailable")}),e.jsxs("div",{className:t.licenseControls,children:[e.jsxs("div",{className:t.licenseControlRow,children:[e.jsxs("label",{className:t.licenseField,children:[e.jsx("span",{className:t.controlLabel,children:e.jsx(o,{label:s("settings.license.provider","Provider"),tooltip:s("settings.license.provider.tooltip","License provider used to validate this key.")})}),e.jsx("select",{"aria-label":s("settings.license.provider","Provider"),className:t.select,value:A,disabled:m||p,onChange:()=>{},children:e.jsx("option",{value:"gumroad",children:"gumroad"})})]}),e.jsx("button",{type:"button",className:t.actionBtn,disabled:m||p||!E,onClick:()=>{f()},children:p?s("common.loading"):s("settings.license.refresh","Refresh License")}),e.jsx("button",{type:"button",className:t.actionBtn,disabled:m||p||!E,onClick:()=>{B()},children:p?s("common.loading"):s("settings.license.reset","Reset License")})]}),e.jsxs("div",{className:t.licenseControlRow,children:[e.jsxs("label",{className:`${t.licenseField} ${t.licenseFieldGrow}`,children:[e.jsx("span",{className:t.controlLabel,children:e.jsx(o,{label:s("settings.license.keyInput","License Key"),tooltip:s("settings.license.key.tooltip","Masked license key currently loaded by the server.")})}),e.jsx("input",{"aria-label":s("settings.license.keyInput","License Key"),className:t.textInput,type:"text",value:R,disabled:m||p,onChange:a=>I(a.target.value)})]}),e.jsx("button",{type:"button",className:t.actionBtn,disabled:m||p,onClick:()=>{(async()=>await O(R)&&I(""))()},children:p?s("common.loading"):s("settings.license.activate","Activate License")})]}),S&&e.jsx("p",{className:t.licenseMessage,children:S})]})]})]}),e.jsxs("div",{className:t.card,children:[e.jsxs("div",{className:t.cardHeader,children:[e.jsx(o,{label:s("settings.general.title","General Settings"),tooltip:s("settings.general.title.tooltip","Hot settings that apply immediately when changed.")}),e.jsx(b,{text:s("settings.general.liveApply.tooltip","Changes in this section are applied immediately without a separate save button."),children:e.jsx("span",{className:`${t.headerBadge} ${t.headerBadgeLive}`,children:s("settings.general.liveApply","Live Apply")})})]}),u?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:t.settingRow,children:[e.jsx("span",{className:t.settingLabel,children:e.jsx(o,{label:s("settings.general.logLevel","Log Level"),tooltip:s("settings.general.logLevel.tooltip","Sets how much detail WROX Dashboard writes to its logs.")})}),e.jsxs("div",{className:t.settingControl,children:[e.jsx("select",{className:t.select,value:u.hot.LOG_LEVEL,onChange:a=>n("LOG_LEVEL",a.target.value),children:Fe.map(a=>e.jsx("option",{value:a,children:a},a))}),h==="LOG_LEVEL"&&e.jsx("span",{className:t.savedIndicator,children:s("settings.general.applied")})]})]}),e.jsxs("div",{className:t.settingRow,children:[e.jsx("span",{className:t.settingLabel,children:e.jsx(o,{label:s("settings.general.localHistory","Tool History Recording"),tooltip:s("settings.general.localHistory.tooltip","Stores local tool execution history for the WROX Dashboard history views.")})}),e.jsxs("div",{className:t.settingControl,children:[e.jsx("span",{className:`${t.savedIndicator} ${h==="ENABLE_LOCAL_HISTORY"?"":t.savedIndicatorHidden}`,children:s("settings.general.applied","Applied")}),e.jsx(H,{checked:u.hot.ENABLE_LOCAL_HISTORY,ariaLabel:s("settings.general.localHistory","Tool History Recording"),testId:"settings-toggle-enable-local-history",onChange:a=>n("ENABLE_LOCAL_HISTORY",a)})]})]}),e.jsxs("div",{className:t.settingRow,children:[e.jsx("span",{className:t.settingLabel,children:e.jsx(o,{label:s("settings.general.localStatistics","Tool Statistics Collection"),tooltip:s("settings.general.localStatistics.tooltip","Aggregates local usage statistics for WROX Dashboard reporting.")})}),e.jsxs("div",{className:t.settingControl,children:[e.jsx("span",{className:`${t.savedIndicator} ${h==="ENABLE_LOCAL_STATISTICS"?"":t.savedIndicatorHidden}`,children:s("settings.general.applied","Applied")}),e.jsx(H,{checked:u.hot.ENABLE_LOCAL_STATISTICS,ariaLabel:s("settings.general.localStatistics","Tool Statistics Collection"),testId:"settings-toggle-enable-local-statistics",onChange:a=>n("ENABLE_LOCAL_STATISTICS",a)})]})]}),e.jsxs("div",{className:t.settingRow,children:[e.jsx("span",{className:t.settingLabel,children:e.jsx(o,{label:s("settings.general.contextCapture","Context Capture"),tooltip:s("settings.general.contextCapture.tooltip","When enabled, WROX Dashboard records structured execution context for changelog and playtest views.")})}),e.jsxs("div",{className:t.settingControl,children:[e.jsx("span",{className:`${t.savedIndicator} ${h==="ENABLE_CONTEXT_CAPTURE"?"":t.savedIndicatorHidden}`,children:s("settings.general.applied","Applied")}),e.jsx(H,{checked:u.hot.ENABLE_CONTEXT_CAPTURE,ariaLabel:s("settings.general.contextCapture","Context Capture"),testId:"settings-toggle-enable-context-capture",onChange:a=>n("ENABLE_CONTEXT_CAPTURE",a)})]})]}),e.jsxs("div",{className:t.settingRow,children:[e.jsx("span",{className:t.settingLabel,children:e.jsx(o,{label:s("settings.general.requestTimeout","Request Timeout"),tooltip:s("settings.general.requestTimeout.tooltip","Maximum time WROX Dashboard waits for a request before it fails.")})}),e.jsxs("div",{className:t.settingControl,children:[e.jsx("input",{type:"number",className:t.numberInput,value:u.hot.REQUEST_TIMEOUT,min:1e3,max:12e4,step:1e3,onChange:a=>{const d=parseInt(a.target.value,10);isNaN(d)||n("REQUEST_TIMEOUT",d)}}),e.jsx(b,{text:s("settings.general.requestTimeout.unit.tooltip","Request timeout is measured in milliseconds."),children:e.jsx("span",{className:t.unit,children:s("settings.general.requestTimeout.unit","ms")})}),h==="REQUEST_TIMEOUT"&&e.jsx("span",{className:t.savedIndicator,children:s("settings.general.applied","Applied")})]})]})]}):e.jsx("div",{className:t.loading,children:s("settings.unavailable")})]}),e.jsxs("div",{className:t.card,children:[e.jsxs("div",{className:t.cardHeader,children:[e.jsx(o,{label:s("settings.cold.title","Server Environment"),tooltip:s("settings.cold.title.tooltip","Read-only server environment values loaded at startup.")}),e.jsx(b,{text:s("settings.readOnly.tooltip","This section shows values that cannot be edited from WROX Dashboard."),children:e.jsx("span",{className:t.headerBadge,children:s("settings.readOnly","Read-only")})})]}),u?e.jsxs(e.Fragment,{children:[e.jsxs("dl",{className:t.coldGrid,children:[e.jsx("dt",{children:e.jsx(o,{label:"HTTP_PORT",tooltip:s("settings.cold.httpPort.tooltip","Port number used by the MCP WROX Dashboard HTTP server.")})}),e.jsx("dd",{children:u.cold.HTTP_PORT}),e.jsx("dt",{children:e.jsx(o,{label:"HTTP_HOST",tooltip:s("settings.cold.httpHost.tooltip","Host interface that the MCP WROX Dashboard HTTP server binds to.")})}),e.jsx("dd",{children:u.cold.HTTP_HOST}),e.jsx("dt",{children:e.jsx(o,{label:"DASHBOARD_AUTO_OPEN",tooltip:s("settings.cold.dashboardAutoOpen.tooltip","Controls whether WROX Dashboard opens automatically in the browser when the server starts.")})}),e.jsx("dd",{children:e.jsx(b,{text:s("settings.cold.dashboardAutoOpen.value.tooltip","Current startup behavior for opening WROX Dashboard in a browser."),children:String(u.cold.DASHBOARD_AUTO_OPEN)})})]}),e.jsx("p",{className:t.coldHint,children:s("settings.cold.hint","Set via environment variables to change these values.")})]}):e.jsx("div",{className:t.loading,children:s("settings.unavailable")})]}),e.jsxs("div",{className:t.card,children:[e.jsx("div",{className:t.cardHeader,children:e.jsx(o,{label:s("settings.sync.title","Sync Settings"),tooltip:s("settings.sync.title.tooltip","Saved sync limits for project file indexing and traversal.")})}),e.jsxs("div",{className:t.syncForm,children:[e.jsxs("div",{className:t.syncRow,children:[e.jsxs("div",{className:t.syncField,children:[e.jsx("label",{children:e.jsx(o,{label:s("settings.sync.maxDepth","Max Depth"),tooltip:s("settings.sync.maxDepth.tooltip","Maximum folder depth the sync scanner will traverse.")})}),e.jsx("input",{type:"number",className:t.numberInput,value:x.maxDepth??10,min:1,max:100,onChange:a=>{const d=parseInt(a.target.value,10);isNaN(d)||j(v=>({...v,maxDepth:d}))}})]}),e.jsxs("div",{className:t.syncField,children:[e.jsx("label",{children:e.jsx(o,{label:s("settings.sync.maxInstances","Max Instances"),tooltip:s("settings.sync.maxInstances.tooltip","Maximum number of Roblox instances to index during sync.")})}),e.jsx("input",{type:"number",className:t.numberInput,value:x.maxInstances??5e3,min:100,max:5e4,step:100,onChange:a=>{const d=parseInt(a.target.value,10);isNaN(d)||j(v=>({...v,maxInstances:d}))}})]})]}),e.jsx("button",{className:t.saveBtn,onClick:l,disabled:T,children:T?s("common.loading"):s("settings.sync.save","Save")})]})]}),e.jsxs("div",{className:t.card,children:[e.jsx("div",{className:t.cardHeader,children:e.jsx(o,{label:s("settings.language.title","Language"),tooltip:s("settings.language.title.tooltip","Choose how the WROX Dashboard interface text is localized.")})}),e.jsxs("div",{className:t.langRow,children:[e.jsx("label",{children:e.jsx(o,{label:s("settings.language.dashboard","WROX Dashboard Language"),tooltip:s("settings.language.dashboard.tooltip","Overrides the WROX Dashboard language or follows the system language when set to Auto.")})}),e.jsxs("select",{className:t.select,value:r,onChange:a=>y(a.target.value),children:[e.jsx("option",{value:q,children:s("settings.language.auto","Auto")}),U.map(a=>e.jsx("option",{value:a,children:$e[a]??a},a))]})]})]})]})}export{Ue as Component};
@@ -1 +1 @@
1
- import{u as o,j as s}from"./index-CQdnwaWW.js";const e="_badge_1ucqq_2",c="_dot_1ucqq_12",a="_online_1ucqq_20",l="_offline_1ucqq_25",_="_idle_1ucqq_30",u="_syncing_1ucqq_34",d="_initializing_1ucqq_35",n={badge:e,dot:c,online:a,offline:l,idle:_,syncing:u,initializing:d},g={online:"status.online",offline:"status.offline",idle:"status.idle",syncing:"status.syncing",initializing:"status.initializing"};function f({status:i}){const{t}=o();return s.jsxs("span",{className:n.badge,children:[s.jsx("span",{className:`${n.dot} ${n[i]}`}),t(g[i])]})}export{f as S};
1
+ import{u as o,j as s}from"./index-DWRH2iF4.js";const e="_badge_1ucqq_2",c="_dot_1ucqq_12",a="_online_1ucqq_20",l="_offline_1ucqq_25",_="_idle_1ucqq_30",u="_syncing_1ucqq_34",d="_initializing_1ucqq_35",n={badge:e,dot:c,online:a,offline:l,idle:_,syncing:u,initializing:d},g={online:"status.online",offline:"status.offline",idle:"status.idle",syncing:"status.syncing",initializing:"status.initializing"};function f({status:i}){const{t}=o();return s.jsxs("span",{className:n.badge,children:[s.jsx("span",{className:`${n.dot} ${n[i]}`}),t(g[i])]})}export{f as S};
@@ -0,0 +1,4 @@
1
+ import{r as c,a as N,D as S,u as L,k as R,l as P,j as e,d as B,i as $,T as j,m as E}from"./index-DWRH2iF4.js";import{I as x}from"./InfoLabel-DzXzzs6Q.js";import{C as O}from"./ConfirmModal-Db4rfrTo.js";import{S as A}from"./StatusBadge-DtcYlxe-.js";import{a as D,u as H,T as M}from"./tier-promo-config-CQFDWwo4.js";import{t as p}from"./TierPromo.module-BBX3CVXn.js";const F=5e3;function U(){const[t,i]=c.useState(null),[_,g]=c.useState(null),[o,l]=c.useState([]),[m,f]=c.useState(!0),h=c.useRef(null),y=c.useRef(null),r=c.useCallback(async()=>{try{const d=await N.get("/sync/status");i(d)}catch{}},[]),b=c.useCallback(async()=>{try{const d=await N.get("/sync/config");g(d)}catch{}},[]),n=c.useCallback(async()=>{try{const d=await N.get("/sync/history",{limit:"30"});l(d.entries??[])}catch{l([])}},[]),u=c.useCallback(async()=>{await Promise.all([r(),b(),n()]),f(!1)},[r,b,n]),v=c.useCallback(()=>{u()},[u]),T=c.useCallback(async()=>{await N.post("/api/dashboard/sync/history/clear"),l([]),r()},[r]);return c.useEffect(()=>(u(),y.current=setInterval(u,F),()=>{y.current&&clearInterval(y.current)}),[u]),c.useEffect(()=>{const d=new S;h.current=d,d.connect();const a=d.on("sync",()=>{r(),n()});return()=>{a(),d.disconnect(),h.current=null}},[r,n]),{status:t,config:_,history:o,loading:m,refresh:v,clearHistory:T}}function G({icon:t,title:i,description:_,benefits:g,upgradeLabel:o,upgradeHref:l}){const{t:m}=L(),[f,h]=c.useState(!1),{trackEvent:y}=R(),{pathname:r}=P(),b=r.replace(/^\//,"").split("/")[0]||"overview";return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:p.panel,children:[t&&e.jsx("div",{className:p.panelIcon,children:t}),e.jsx("div",{className:p.panelTitle,children:i}),e.jsx("div",{className:p.panelDesc,children:_}),e.jsx("ul",{className:p.benefitList,children:g.map(n=>e.jsx("li",{className:p.benefitItem,children:n},n))}),e.jsxs("div",{className:p.actions,children:[e.jsx("button",{className:`${p.btn} ${p.btnOutline}`,onClick:()=>{y("dashboard_tier_toggle",{page:b}),h(!0)},children:m("tier.compare","Basic vs Pro")}),e.jsx("a",{className:`${p.btn} ${p.btnPrimary}`,href:l,target:"_blank",rel:"noreferrer",onClick:()=>y("dashboard_upgrade_click",{page:b}),children:o})]})]}),f&&e.jsx(D,{onClose:()=>h(!1)})]})}const V="_page_xmkt1_2",W="_card_xmkt1_10",q="_cardHeader_xmkt1_17",z="_clearButton_xmkt1_29",X="_statusRow_xmkt1_39",Y="_metaItem_xmkt1_46",J="_statusGrid_xmkt1_52",K="_table_xmkt1_71",Q="_directionRail_xmkt1_99",Z="_endpointLabel_xmkt1_105",ee="_optionRail_xmkt1_109",te="_directionOption_xmkt1_115",se="_directionOptionActive_xmkt1_129",ne="_directionOptionInactive_xmkt1_133",ie="_direction_forward_xmkt1_139",ae="_direction_bidirectional_xmkt1_143",ce="_direction_reverse_xmkt1_147",oe="_lockBadge_xmkt1_152",le="_proBadge_xmkt1_160",re="_forwardBadge_xmkt1_174",de="_configGrid_xmkt1_187",pe="_configItem_xmkt1_193",ue="_configLabel_xmkt1_199",me="_configValue_xmkt1_207",ye="_logContainer_xmkt1_214",ge="_logEntry_xmkt1_221",he="_logTime_xmkt1_233",xe="_logType_xmkt1_239",_e="_logTypeWrite_xmkt1_248",fe="_logTypeUpdate_xmkt1_252",je="_logTypeDelete_xmkt1_256",be="_logTypeIdle_xmkt1_260",ke="_logPath_xmkt1_264",ve="_logEmpty_xmkt1_271",we="_overlay_xmkt1_278",Ne="_overlayTitle_xmkt1_288",Te="_overlayMessage_xmkt1_295",Ie="_checklist_xmkt1_301",Ce="_checkItem_xmkt1_311",Le="_upgradePanel_xmkt1_327",Se="_upgradePanelHeader_xmkt1_334",Re="_benefitList_xmkt1_342",Pe="_benefitItem_xmkt1_351",Be="_upgradeActions_xmkt1_366",$e="_btn_xmkt1_371",Ee="_btnPrimary_xmkt1_388",Oe="_disabled_xmkt1_399",s={page:V,card:W,cardHeader:q,clearButton:z,statusRow:X,metaItem:Y,statusGrid:J,table:K,directionRail:Q,endpointLabel:Z,optionRail:ee,directionOption:te,directionOptionActive:se,directionOptionInactive:ne,direction_forward:ie,direction_bidirectional:ae,direction_reverse:ce,lockBadge:oe,proBadge:le,forwardBadge:re,configGrid:de,configItem:pe,configLabel:ue,configValue:me,logContainer:ye,logEntry:ge,logTime:he,logType:xe,logTypeWrite:_e,logTypeUpdate:fe,logTypeDelete:je,logTypeIdle:be,logPath:ke,logEmpty:ve,overlay:we,overlayTitle:Ne,overlayMessage:Te,checklist:Ie,checkItem:Ce,upgradePanel:Le,upgradePanelHeader:Se,benefitList:Re,benefitItem:Pe,upgradeActions:Be,btn:$e,btnPrimary:Ee,disabled:Oe},Ae=[{key:"forward",symbol:"←"},{key:"bidirectional",symbol:"↔"},{key:"reverse",symbol:"→"}];function De(t){const i=new Date(t);return`${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}`}function He(t){return t<1024?`${t}B`:t<1024*1024?`${(t/1024).toFixed(0)}KB`:`${(t/(1024*1024)).toFixed(0)}MB`}function Me(t){switch(t){case"write":return s.logTypeWrite;case"update":return s.logTypeUpdate;case"delete":return s.logTypeDelete;default:return s.logTypeIdle}}function Fe(t){switch(t){case"syncing":return"syncing";case"initializing":return"initializing";case"idle":return"idle";default:return"offline"}}function Ue(t,i,_,g){const o=t(`sync.directions.cat.${i}`,i.charAt(0).toUpperCase()+i.slice(1)),l=t("sync.directions.endpoint.local","Local"),m=t("sync.directions.endpoint.studio","Studio");switch(_){case"forward":return[`${o}: ${l} <- ${m}`,t("sync.directions.tooltip.forward.body","Studio changes sync to local files only")].join(`
2
+ `);case"bidirectional":return[`${o}: ${l} <-> ${m}`,t("sync.directions.tooltip.bidirectional.body","Two-way sync between Local and Studio"),g?t("sync.directions.tooltip.proRequired","Pro required in Basic tier"):""].filter(Boolean).join(`
3
+ `);case"reverse":return[`${o}: ${l} -> ${m}`,t("sync.directions.tooltip.reverse.body","Push local file changes to Studio"),g?t("sync.directions.tooltip.proRequired","Pro required in Basic tier"):""].filter(Boolean).join(`
4
+ `);default:return o}}const Ge=["scripts","values","containers","data","services"];function Ve(t,i){return i==="manual"?t("sync.directions.mode.manual","Manual"):i==="auto"?t("sync.directions.mode.auto","Auto"):"-"}function We(t,i){return i==="manual"?t("sync.directions.mode.manual.tooltip","Applies sync changes only when you trigger them manually."):i==="auto"?t("sync.directions.mode.auto.tooltip","Applies sync changes automatically when updates arrive."):""}function qe(t,i){switch(i){case"write":return t("sync.log.type.write","WRITE");case"update":return t("sync.log.type.update","UPDATE");case"delete":return t("sync.log.type.delete","DELETE");default:return t("sync.log.type.idle","IDLE")}}function ze(t,i){switch(i){case"write":return t("sync.log.type.write.tooltip","A new sync output was written to disk.");case"update":return t("sync.log.type.update.tooltip","An existing synced file or instance was updated.");case"delete":return t("sync.log.type.delete.tooltip","A synced file or instance was removed.");default:return t("sync.log.type.idle.tooltip","A sync event was recorded without a file mutation.")}}function et(){const{t}=L(),{level:i}=B(),{tier:_,loading:g}=H(),o=U(),{show:l}=$(),[m,f]=c.useState(!1),[h,y]=c.useState(!1),r=!g&&_==="basic";if(i==="L0"||i==="L1")return e.jsx("div",{className:s.page,children:e.jsx("div",{className:s.card,children:e.jsxs("div",{className:s.overlay,children:[e.jsx("div",{className:s.overlayTitle,children:t("sync.overlay.title","Roblox Studio plugin required")}),e.jsx("div",{className:s.overlayMessage,children:t("sync.overlay.message","Sync status will be available once the Roblox Studio plugin connects.")}),e.jsxs("ul",{className:s.checklist,children:[e.jsx("li",{className:s.checkItem,children:t("sync.overlay.check1","Is Roblox Studio running?")}),e.jsx("li",{className:s.checkItem,children:t("sync.overlay.check2","Is the WROX Plugin installed?")}),e.jsx("li",{className:s.checkItem,children:t("sync.overlay.check3","Are HTTP Requests enabled in Studio settings?")})]})]})})});const n=o.status,u=o.config,v=o.history,T=Fe(n==null?void 0:n.state),d=async()=>{y(!0);try{await o.clearHistory(),l(t("toast.clearSuccess","Cleared successfully"),"success"),f(!1)}catch{l(t("toast.clearFailed","Failed to clear data"),"error")}finally{y(!1)}};return e.jsxs("div",{className:s.page,children:[e.jsxs("div",{className:s.card,children:[e.jsxs("div",{className:s.cardHeader,children:[e.jsx(j,{text:t("sync.status.title.tooltip","Current Studio and local file sync status for this place."),children:t("sync.status.title","Sync Status")}),r&&e.jsx(j,{text:t("sync.status.forwardOnly.tooltip","Basic tier allows Studio to local forward sync only."),children:e.jsx("span",{className:s.forwardBadge,children:t("sync.status.forwardOnly","Forward Only")})})]}),e.jsxs("div",{className:s.statusRow,children:[e.jsx(A,{status:T}),(n==null?void 0:n.placeName)&&e.jsxs("span",{className:s.metaItem,children:[e.jsx(x,{label:t("sync.status.place","Place"),tooltip:t("sync.status.place.tooltip","Connected Roblox place name and place ID.")}),": ",n.placeName,n.placeId?` (${n.placeId})`:""]})]}),e.jsxs("dl",{className:s.statusGrid,children:[(n==null?void 0:n.syncRoot)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(x,{label:t("sync.status.path","Path"),tooltip:t("sync.status.path.tooltip","Local filesystem root currently used for sync output.")})}),e.jsx("dd",{children:n.syncRoot})]}),(n==null?void 0:n.instanceCount)!=null&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(x,{label:t("sync.status.instances","Instances"),tooltip:t("sync.status.instances.tooltip","Total synced Roblox instances tracked in the local mirror.")})}),e.jsx("dd",{children:n.instanceCount})]}),(n==null?void 0:n.scriptCount)!=null&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(x,{label:t("sync.status.scripts","Scripts"),tooltip:t("sync.status.scripts.tooltip","Total synced script files currently indexed for this place.")})}),e.jsx("dd",{children:n.scriptCount})]}),(n==null?void 0:n.state)==="syncing"&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(x,{label:t("sync.status.state","State"),tooltip:t("sync.status.state.tooltip","Current runtime sync state reported by the server.")})}),e.jsx("dd",{children:t("status.syncing","Syncing")})]})]})]}),(n==null?void 0:n.directions)&&e.jsxs("div",{className:s.card,children:[e.jsx("div",{className:s.cardHeader,children:e.jsx(j,{text:t("sync.directions.title.tooltip","Per-category sync direction and apply behavior between Local and Studio."),children:t("sync.directions.title","Sync Directions")})}),e.jsxs("table",{className:s.table,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:e.jsx(x,{label:t("sync.directions.type","Type"),tooltip:t("sync.directions.type.tooltip","Sync category affected by this rule.")})}),e.jsx("th",{children:e.jsx(x,{label:t("sync.directions.direction","Direction"),tooltip:t("sync.directions.direction.tooltip","Whether each category syncs from Studio, to Studio, or both ways.")})}),e.jsx("th",{children:e.jsx(x,{label:t("sync.directions.applyMode","Apply Mode"),tooltip:t("sync.directions.applyMode.tooltip","How incoming sync changes are applied for this category.")})})]})}),e.jsx("tbody",{children:Ge.map(a=>{var C;const w=n.directions[a],I=(C=n.applyModes)==null?void 0:C[a];return e.jsxs("tr",{children:[e.jsx("td",{children:t(`sync.directions.cat.${a}`,a.charAt(0).toUpperCase()+a.slice(1))}),e.jsx("td",{children:e.jsxs("div",{className:s.directionRail,"aria-label":`${a}-direction-rail`,children:[e.jsx(j,{text:t("sync.directions.endpoint.local.tooltip","Local files on disk are always shown on the left side of the direction rail."),children:e.jsx("span",{className:s.endpointLabel,children:t("sync.directions.endpoint.local","Local")})}),e.jsx("span",{className:s.optionRail,children:Ae.map(k=>e.jsx(E,{text:Ue(t,a,k.key,r),children:e.jsx("span",{className:`${s.directionOption} ${w===k.key?s.directionOptionActive:s.directionOptionInactive} ${s[`direction_${k.key}`]??""}`,"data-active":w===k.key?"true":"false",children:k.symbol})},k.key))}),e.jsx(j,{text:t("sync.directions.endpoint.studio.tooltip","Roblox Studio is always shown on the right side of the direction rail."),children:e.jsx("span",{className:s.endpointLabel,children:t("sync.directions.endpoint.studio","Studio")})})]})}),e.jsx("td",{children:e.jsx(j,{text:We(t,I),children:Ve(t,I)})})]},a)})})]})]}),u&&e.jsxs("div",{className:s.card,children:[e.jsx("div",{className:s.cardHeader,children:t("sync.config.title","Sync Config")}),e.jsxs("div",{className:s.configGrid,children:[e.jsxs("div",{className:s.configItem,children:[e.jsx("span",{className:s.configLabel,children:t("sync.config.maxDepth","Max Depth")}),e.jsx("span",{className:s.configValue,children:u.maxDepth})]}),e.jsxs("div",{className:s.configItem,children:[e.jsx("span",{className:s.configLabel,children:t("sync.config.maxInstances","Max Instances")}),e.jsx("span",{className:s.configValue,children:u.maxInstances})]}),e.jsxs("div",{className:s.configItem,children:[e.jsx("span",{className:s.configLabel,children:t("sync.config.dirLimit","Dir Limit")}),e.jsx("span",{className:s.configValue,children:He(u.directorySizeLimit)})]})]})]}),e.jsxs("div",{className:s.card,children:[e.jsxs("div",{className:s.cardHeader,children:[e.jsx("span",{children:t("sync.log.title","Sync Log")}),e.jsx("button",{className:s.clearButton,onClick:()=>f(!0),children:t("common.clear","Clear")})]}),e.jsx("div",{className:s.logContainer,children:v.length===0?e.jsx("div",{className:s.logEmpty,children:t("sync.log.empty","No sync events yet")}):v.map((a,w)=>e.jsxs("div",{className:s.logEntry,children:[e.jsx("span",{className:s.logTime,children:De(a.timestamp)}),e.jsx(j,{text:ze(t,a.type),children:e.jsx("span",{className:`${s.logType} ${Me(a.type)}`,children:qe(t,a.type)})}),e.jsxs("span",{className:s.logPath,children:[a.path,a.details?` — ${a.details}`:""]})]},w))})]}),r&&e.jsx(G,{title:t("sync.upgrade.title","Unlock Full Sync with Pro"),description:t("tier.banner.save","Save AI tokens with Pro!"),benefits:[t("sync.upgrade.benefit1","Bidirectional sync — edit files, auto-apply to Studio"),t("sync.upgrade.benefit2","Reverse sync — push file changes back to Studio"),t("sync.upgrade.benefit3","Full sync history and detailed change log")],upgradeLabel:t("sync.upgrade.buy","Upgrade to Pro"),upgradeHref:M.sync}),e.jsx(O,{open:m,title:t("sync.clear.title","Clear sync log?"),message:t("sync.clear.message","This permanently removes the stored sync log for the current place."),cancelLabel:t("common.cancel","Cancel"),confirmLabel:t("common.clear","Clear"),loading:h,onCancel:()=>!h&&f(!1),onConfirm:d})]})}export{et as Component};
@@ -1 +1 @@
1
- import{u as h,r as x,k as j,l as g,j as s}from"./index-CQdnwaWW.js";import{a as b}from"./tier-promo-config-DU-2XXTa.js";import{t as e}from"./TierPromo.module-BBX3CVXn.js";function P({basicCalls:n,proCalls:a,totalCalls:l,proUsagePercent:c,upgradeHref:p}){const{t:r}=h(),[d,o]=x.useState(!1),{trackEvent:i}=j(),{pathname:m}=g(),t=m.replace(/^\//,"").split("/")[0]||"overview";return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:e.progressPromo,children:[s.jsxs("div",{className:e.progressMain,children:[s.jsxs("div",{className:e.progressLabel,children:[s.jsx("span",{children:r("tier.progress.label","Pro / Total")}),s.jsxs("span",{children:[a," / ",l]})]}),s.jsx("div",{className:e.progressBar,children:s.jsx("div",{className:e.progressFill,style:{width:`${Math.min(c,100)}%`}})}),s.jsxs("div",{className:e.progressLabel,children:[s.jsxs("span",{children:[r("tier.basic")," ",n]}),s.jsxs("span",{children:[r("tier.pro")," ",a]})]})]}),s.jsx("span",{className:e.progressText,children:r("tier.banner.save","Save AI tokens with Pro!")}),s.jsxs("div",{className:e.actions,children:[s.jsx("button",{className:`${e.btn} ${e.btnOutline}`,onClick:()=>{i("dashboard_tier_toggle",{page:t}),o(!0)},children:r("tier.compare","Basic vs Pro")}),s.jsx("a",{className:`${e.btn} ${e.btnPrimary}`,href:p,target:"_blank",rel:"noreferrer",onClick:()=>i("dashboard_upgrade_click",{page:t}),children:r("tier.upgrade","Upgrade to Pro")})]})]}),d&&s.jsx(b,{onClose:()=>o(!1)})]})}export{P as T};
1
+ import{u as h,r as x,k as j,l as g,j as s}from"./index-DWRH2iF4.js";import{a as b}from"./tier-promo-config-CQFDWwo4.js";import{t as e}from"./TierPromo.module-BBX3CVXn.js";function P({basicCalls:n,proCalls:a,totalCalls:l,proUsagePercent:c,upgradeHref:p}){const{t:r}=h(),[d,o]=x.useState(!1),{trackEvent:i}=j(),{pathname:m}=g(),t=m.replace(/^\//,"").split("/")[0]||"overview";return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:e.progressPromo,children:[s.jsxs("div",{className:e.progressMain,children:[s.jsxs("div",{className:e.progressLabel,children:[s.jsx("span",{children:r("tier.progress.label","Pro / Total")}),s.jsxs("span",{children:[a," / ",l]})]}),s.jsx("div",{className:e.progressBar,children:s.jsx("div",{className:e.progressFill,style:{width:`${Math.min(c,100)}%`}})}),s.jsxs("div",{className:e.progressLabel,children:[s.jsxs("span",{children:[r("tier.basic")," ",n]}),s.jsxs("span",{children:[r("tier.pro")," ",a]})]})]}),s.jsx("span",{className:e.progressText,children:r("tier.banner.save","Save AI tokens with Pro!")}),s.jsxs("div",{className:e.actions,children:[s.jsx("button",{className:`${e.btn} ${e.btnOutline}`,onClick:()=>{i("dashboard_tier_toggle",{page:t}),o(!0)},children:r("tier.compare","Basic vs Pro")}),s.jsx("a",{className:`${e.btn} ${e.btnPrimary}`,href:p,target:"_blank",rel:"noreferrer",onClick:()=>i("dashboard_upgrade_click",{page:t}),children:r("tier.upgrade","Upgrade to Pro")})]})]}),d&&s.jsx(b,{onClose:()=>o(!1)})]})}export{P as T};
@@ -1 +1 @@
1
- import{j as s,r as l,a as R,D as Z,u as q,i as z,T as w}from"./index-CQdnwaWW.js";import{C as Q}from"./ConfirmModal-DPwJWgnH.js";import{u as X,T as Y}from"./tier-promo-config-DU-2XXTa.js";import{T as tt}from"./TierPromoProgress-DsH0LxDt.js";import"./TierPromo.module-BBX3CVXn.js";const st="_wrapper_1s3lp_2",et="_table_1s3lp_7",at="_sortable_1s3lp_32",ot="_sortArrow_1s3lp_41",rt="_clickable_1s3lp_52",lt="_empty_1s3lp_57",M={wrapper:st,table:et,sortable:at,sortArrow:ot,clickable:rt,empty:lt};function it({columns:e,data:o,sortBy:T,sortDir:f="asc",onSort:g,onRowClick:S,rowKey:C,emptyMessage:v}){return s.jsx("div",{className:M.wrapper,children:s.jsxs("table",{className:M.table,children:[s.jsx("thead",{children:s.jsx("tr",{children:e.map(n=>s.jsxs("th",{style:n.width?{width:n.width}:void 0,className:n.sortable?M.sortable:void 0,onClick:n.sortable&&g?()=>g(n.key):void 0,children:[s.jsx("span",{children:n.label}),n.sortable&&T===n.key&&s.jsx("span",{className:M.sortArrow,children:f==="asc"?"▴":"▾"})]},n.key))})}),s.jsx("tbody",{children:o.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:e.length,className:M.empty,children:v||"No data"})}):o.map((n,k)=>s.jsx("tr",{className:S?M.clickable:void 0,onClick:S?()=>S(n):void 0,children:e.map(p=>s.jsx("td",{children:p.render?p.render(n):String(n[p.key]??"")},p.key))},C?C(n):k))})]})})}const V=50;function nt(){const[e,o]=l.useState(null),[T,f]=l.useState(!0),[g,S]=l.useState([]),[C,v]=l.useState(0),[n,k]=l.useState(!1),[p,N]=l.useState(!0),[x,H]=l.useState(0),[u,D]=l.useState(""),[B,E]=l.useState([]),[U,A]=l.useState(0),[O,d]=l.useState(!1),[$,F]=l.useState(!0),[b,j]=l.useState(0),L=l.useRef(null),y=l.useCallback(async()=>{f(!0);try{const m=await R.get("/api/dashboard/tool-stats");o(m)}catch{}finally{f(!1)}},[]),t=l.useCallback(async(m,_)=>{N(!0);try{const K={limit:String(V),offset:String(m)};_&&(K.tool=_);const W=await R.get("/api/dashboard/history",K);S(W.entries),v(W.total),k(W.hasMore)}catch{S([]),v(0),k(!1)}finally{N(!1)}},[]),r=l.useCallback(async m=>{F(!0);try{const _=await R.get("/api/dashboard/failures",{limit:String(V),offset:String(m)});E(_.entries),A(_.total),d(_.hasMore)}catch{E([]),A(0),d(!1)}finally{F(!1)}},[]),i=l.useCallback(()=>{y(),t(x,u),r(b)},[y,t,r,x,u,b]),h=l.useCallback(async()=>{await R.post("/api/dashboard/tools/history/clear"),t(x,u),r(b)},[t,r,x,u,b]),c=l.useCallback(async()=>{await R.post("/api/dashboard/tools/statistics/clear"),y()},[y]);return l.useEffect(()=>{y()},[y]),l.useEffect(()=>{t(x,u)},[t,x,u]),l.useEffect(()=>{r(b)},[r,b]),l.useEffect(()=>{const m=new Z;L.current=m,m.connect();const _=m.on("command",()=>{y(),t(x,u),r(b)});return()=>{_(),m.disconnect(),L.current=null}},[y,t,r,x,u,b]),{statistics:e,statsLoading:T,history:g,historyTotal:C,historyHasMore:n,historyLoading:p,historyOffset:x,historyToolFilter:u,setHistoryOffset:H,setHistoryToolFilter:D,failures:B,failuresTotal:U,failuresHasMore:O,failuresLoading:$,failuresOffset:b,setFailuresOffset:j,refresh:i,clearHistory:h,clearStatistics:c}}const ct="_page_184r6_2",dt="_tabs_184r6_10",ut="_tab_184r6_10",pt="_tabActive_184r6_34",ht="_card_184r6_40",mt="_cardToolbar_184r6_47",xt="_sectionTitle_184r6_55",bt="_dangerButton_184r6_61",ft="_proBadge_184r6_71",_t="_statusOk_184r6_85",yt="_tierBasic_184r6_91",jt="_tierPro_184r6_95",gt="_tierMixed_184r6_100",St="_filterRow_184r6_111",Tt="_filterLabel_184r6_118",Ct="_filterSelect_184r6_127",Nt="_expandedRow_184r6_138",wt="_expandedSection_184r6_146",vt="_pre_184r6_156",kt="_pagination_184r6_173",Bt="_pageInfo_184r6_181",Mt="_btn_184r6_187",Pt="_tierDistribution_184r6_210",Et="_tierBarWrap_184r6_214",Lt="_tierBarBasic_184r6_222",Rt="_tierBarPro_184r6_227",Ht="_tierLabels_184r6_232",At="_statsTableWrap_184r6_241",Ot="_statsTable_184r6_241",$t="_sortableHeader_184r6_272",Ft="_sortArrow_184r6_277",It="_statsToolRow_184r6_281",Dt="_statsActionRow_184r6_289",Ut="_expandButton_184r6_293",Wt="_expandIcon_184r6_305",Gt="_actionLabel_184r6_310",Jt="_emptyStats_184r6_317",Kt="_summaryLine_184r6_323",a={page:ct,tabs:dt,tab:ut,tabActive:pt,card:ht,cardToolbar:mt,sectionTitle:xt,dangerButton:bt,proBadge:ft,statusOk:_t,tierBasic:yt,tierPro:jt,tierMixed:gt,filterRow:St,filterLabel:Tt,filterSelect:Ct,expandedRow:Nt,expandedSection:wt,pre:vt,pagination:kt,pageInfo:Bt,btn:Mt,tierDistribution:Pt,tierBarWrap:Et,tierBarBasic:Lt,tierBarPro:Rt,tierLabels:Ht,statsTableWrap:At,statsTable:Ot,sortableHeader:$t,sortArrow:Ft,statsToolRow:It,statsActionRow:Dt,expandButton:Ut,expandIcon:Wt,actionLabel:Gt,emptyStats:Jt,summaryLine:Kt},G=50;function Vt(e){const o=new Date(e);return`${String(o.getHours()).padStart(2,"0")}:${String(o.getMinutes()).padStart(2,"0")}:${String(o.getSeconds()).padStart(2,"0")}`}function I(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function J(e,o){return o===0?"-":`${Math.round(e/o*100)}%`}function P(e,o){return o==="pro"?e("tier.pro","Pro"):o==="mixed"?e("tier.mixed","Mixed"):e("tier.basic","Basic")}function Yt(){const{t:e}=q(),o=nt(),{show:T}=z(),f=X(),[g,S]=l.useState("history"),[C,v]=l.useState(null),[n,k]=l.useState(null),[p,N]=l.useState(null),[x,H]=l.useState(!1),[u,D]=l.useState("totalCalls"),[B,E]=l.useState("desc"),U=l.useCallback(t=>{D(r=>r===t?(E(i=>i==="asc"?"desc":"asc"),t):(E("desc"),t))},[]),A=l.useMemo(()=>{var t;return(t=o.statistics)!=null&&t.tools?Object.keys(o.statistics.tools).sort():[]},[o.statistics]),O=l.useMemo(()=>{var t;return(t=o.statistics)!=null&&t.tools?Object.values(o.statistics.tools).map(r=>{const i=Object.entries(r.actions??{}).map(([h,c])=>({toolName:r.toolName,actionName:c.action??h,tier:c.tier,totalCalls:c.totalCalls,successCount:c.successCount,failureCount:c.failureCount,totalExecutionTimeMs:c.totalExecutionTimeMs,avgExecutionTimeMs:c.avgExecutionTimeMs,firstUsed:c.firstUsed,lastUsed:c.lastUsed}));return{toolName:r.toolName,tier:r.tier,actions:i,totalCalls:r.totalCalls,successCount:r.successCount,failureCount:r.failureCount,totalExecutionTimeMs:r.totalExecutionTimeMs,avgExecutionTimeMs:r.avgExecutionTimeMs,firstUsed:r.firstUsed,lastUsed:r.lastUsed}}):[]},[o.statistics]),d=l.useCallback((t,r,i,h)=>s.jsx(w,{text:e(i,h),children:e(t,r)}),[e]),$=l.useMemo(()=>[...O].sort((r,i)=>{const h=r[u],c=i[u];if(typeof h=="number"&&typeof c=="number")return B==="asc"?h-c:c-h;const m=String(h??""),_=String(c??"");return B==="asc"?m.localeCompare(_):_.localeCompare(m)}),[O,u,B]),F=l.useMemo(()=>[{key:"timestamp",label:d("tools.col.time","Time","tools.col.time.tooltip","When the tool run was recorded."),width:"80px",render:t=>Vt(t.timestamp)},{key:"toolName",label:d("tools.col.toolAction","Tool.Action","tools.col.toolAction.tooltip","Tool name and action that were executed."),render:t=>{var i;const r=((i=t.parameters)==null?void 0:i.action)??"";return s.jsxs("span",{children:[t.toolName,r?`.${r}`:"",t.tier==="pro"&&s.jsx(w,{text:e("tools.badge.pro.tooltip","This entry used a Pro-only tool or action."),children:s.jsx("span",{className:a.proBadge,children:e("tools.badge.pro","PRO")})})]})}},{key:"executionTimeMs",label:d("tools.col.duration","Duration","tools.col.duration.tooltip","How long the tool took to finish."),width:"80px",render:t=>I(t.executionTimeMs)},{key:"status",label:d("tools.col.status","Status","tools.col.status.tooltip","Outcome of the recorded tool run."),width:"60px",render:()=>s.jsx(w,{text:e("tools.status.ok.tooltip","The tool run completed successfully."),children:s.jsx("span",{className:a.statusOk,children:e("tools.status.ok","OK")})})},{key:"tier",label:d("tools.col.tier","Tier","tools.col.tier.tooltip","License tier required for the tool or action."),width:"60px",render:t=>s.jsx("span",{className:t.tier==="pro"?a.tierPro:a.tierBasic,children:P(e,t.tier)})}],[e,d]),b=l.useMemo(()=>[{key:"toolName",label:d("tools.col.tool","Tool","tools.col.tool.tooltip","Consolidated tool name in the statistics table."),sortable:!0},{key:"totalCalls",label:d("tools.col.calls","Calls","tools.col.calls.tooltip","Total number of recorded calls for this tool."),sortable:!0,width:"70px"},{key:"successRate",label:d("tools.col.okRate","OK%","tools.col.okRate.tooltip","Percentage of calls that finished successfully."),sortable:!1,width:"60px",render:t=>J(t.successCount,t.totalCalls)},{key:"avgExecutionTimeMs",label:d("tools.col.avgTime","Avg Time","tools.col.avgTime.tooltip","Average execution time across recorded calls."),sortable:!0,width:"80px",render:t=>I(t.avgExecutionTimeMs)},{key:"tier",label:d("tools.col.tier","Tier","tools.col.tierStats.tooltip","Basic, Pro, or Mixed summary for the tool statistics row."),sortable:!0,width:"60px",render:t=>s.jsx(w,{text:t.tier==="mixed"?e("tools.tier.mixed.tooltip","This tool includes both Basic and Pro actions."):"",children:s.jsx("span",{className:t.tier==="pro"?a.tierPro:t.tier==="mixed"?a.tierMixed:a.tierBasic,children:P(e,t.tier)})})}],[e,d]),j=l.useMemo(()=>{if(!o.statistics)return null;const t=o.statistics.tierSummary.basic.totalCalls,r=o.statistics.tierSummary.pro.totalCalls,i=t+r;if(i===0)return null;const h=Math.round(t/i*100),c=100-h;return{basic:t,pro:r,total:i,basicPct:h,proPct:c}},[o.statistics]),L=l.useCallback(t=>{k(r=>r===t?null:t)},[]),y=l.useCallback(async()=>{if(p){H(!0);try{p==="history"?await o.clearHistory():await o.clearStatistics(),T(e("toast.clearSuccess","Cleared successfully"),"success"),N(null)}catch{T(e("toast.clearFailed","Failed to clear data"),"error")}finally{H(!1)}}},[p,T,e,o]);return s.jsxs("div",{className:a.page,children:[s.jsx("div",{className:a.tabs,children:["history","statistics"].map(t=>s.jsx("button",{className:`${a.tab} ${g===t?a.tabActive:""}`,onClick:()=>S(t),children:e(`tools.tab.${t}`,t.charAt(0).toUpperCase()+t.slice(1))},t))}),g==="history"&&s.jsxs("div",{className:a.card,children:[s.jsxs("div",{className:a.cardToolbar,children:[s.jsx("div",{className:a.sectionTitle,children:e("tools.tab.history","History")}),s.jsx("button",{className:a.dangerButton,onClick:()=>N("history"),children:e("common.clear","Clear")})]}),s.jsx("div",{className:a.filterRow,children:s.jsxs("label",{className:a.filterLabel,children:[e("tools.filter.tool","Tool"),":",s.jsxs("select",{className:a.filterSelect,value:o.historyToolFilter,onChange:t=>{o.setHistoryToolFilter(t.target.value),o.setHistoryOffset(0)},children:[s.jsx("option",{value:"",children:e("tools.filter.all","All")}),A.map(t=>s.jsx("option",{value:t,children:t},t))]})]})}),s.jsx(it,{columns:F,data:o.history,rowKey:t=>t.id,onRowClick:t=>v(r=>r===t.id?null:t.id),emptyMessage:e("tools.empty.history","No history entries")}),C&&(()=>{const t=o.history.find(r=>r.id===C);return t?s.jsxs("div",{className:a.expandedRow,children:[s.jsxs("div",{className:a.expandedSection,children:[s.jsxs("strong",{children:[s.jsx(w,{text:e("tools.detail.params.tooltip","Input parameters passed to this tool run."),children:e("tools.detail.params","Parameters")}),":"]}),s.jsx("pre",{className:a.pre,children:JSON.stringify(t.parameters,null,2)})]}),t.result&&s.jsxs("div",{className:a.expandedSection,children:[s.jsxs("strong",{children:[s.jsx(w,{text:e("tools.detail.result.tooltip","Returned result payload for this tool run."),children:e("tools.detail.result","Result")}),":"]}),s.jsx("pre",{className:a.pre,children:JSON.stringify(t.result,null,2)})]})]}):null})(),s.jsxs("div",{className:a.pagination,children:[s.jsx("button",{className:a.btn,disabled:o.historyOffset===0,title:e("tools.page.prev.tooltip","Go to the previous page of tool history results."),onClick:()=>o.setHistoryOffset(Math.max(0,o.historyOffset-G)),children:e("tools.page.prev","Prev")}),s.jsxs("span",{className:a.pageInfo,children:[o.historyOffset+1,"–",Math.min(o.historyOffset+G,o.historyTotal)," / ",o.historyTotal]}),s.jsx("button",{className:a.btn,disabled:!o.historyHasMore,title:e("tools.page.next.tooltip","Go to the next page of tool history results."),onClick:()=>o.setHistoryOffset(o.historyOffset+G),children:e("tools.page.next","Next")})]})]}),g==="statistics"&&s.jsxs("div",{className:a.card,children:[s.jsxs("div",{className:a.cardToolbar,children:[s.jsx("div",{className:a.sectionTitle,children:e("tools.tab.statistics","Statistics")}),s.jsx("button",{className:a.dangerButton,onClick:()=>N("statistics"),children:e("common.clear","Clear")})]}),j&&s.jsxs("div",{className:a.tierDistribution,children:[s.jsxs("div",{className:a.tierBarWrap,children:[s.jsx("div",{className:a.tierBarBasic,style:{width:`${j.basicPct}%`}}),s.jsx("div",{className:a.tierBarPro,style:{width:`${j.proPct}%`}})]}),s.jsxs("div",{className:a.tierLabels,children:[s.jsxs("span",{children:[P(e,"basic")," ",j.basicPct,"% (",j.basic,")"]}),s.jsxs("span",{children:[P(e,"pro")," ",j.proPct,"% (",j.pro,")"]})]})]}),s.jsx("div",{className:a.statsTableWrap,children:s.jsxs("table",{className:a.statsTable,children:[s.jsx("thead",{children:s.jsx("tr",{children:b.map(t=>s.jsxs("th",{style:t.width?{width:t.width}:void 0,className:t.sortable?a.sortableHeader:void 0,onClick:t.sortable?()=>U(t.key):void 0,children:[s.jsx("span",{children:t.label}),t.sortable&&u===t.key&&s.jsx("span",{className:a.sortArrow,children:B==="asc"?"▴":"▾"})]},t.key))})}),s.jsx("tbody",{children:$.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:b.length,className:a.emptyStats,children:e("tools.empty.stats","No tool statistics")})}):$.map(t=>{const r=n===t.toolName;return s.jsxs(l.Fragment,{children:[s.jsxs("tr",{className:a.statsToolRow,onClick:()=>L(t.toolName),children:[s.jsx("td",{children:s.jsxs("button",{type:"button",className:a.expandButton,"aria-expanded":r,"aria-label":`${t.toolName} ${r?e("common.collapse","Collapse"):e("common.expand","Expand")}`,onClick:i=>{i.stopPropagation(),L(t.toolName)},children:[s.jsx("span",{className:a.expandIcon,"aria-hidden":"true",children:r?"▾":"▸"}),s.jsx("span",{children:t.toolName})]})}),s.jsx("td",{children:t.totalCalls}),s.jsx("td",{children:J(t.successCount,t.totalCalls)}),s.jsx("td",{children:I(t.avgExecutionTimeMs)}),s.jsx("td",{children:s.jsx(w,{text:t.tier==="mixed"?e("tools.tier.mixed.tooltip","This tool includes both Basic and Pro actions."):"",children:s.jsx("span",{className:t.tier==="pro"?a.tierPro:t.tier==="mixed"?a.tierMixed:a.tierBasic,children:P(e,t.tier)})})})]}),r&&t.actions.map(i=>s.jsxs("tr",{className:a.statsActionRow,children:[s.jsx("td",{children:s.jsx("span",{className:a.actionLabel,children:i.actionName})}),s.jsx("td",{children:i.totalCalls}),s.jsx("td",{children:J(i.successCount,i.totalCalls)}),s.jsx("td",{children:I(i.avgExecutionTimeMs)}),s.jsx("td",{children:s.jsx("span",{className:i.tier==="pro"?a.tierPro:a.tierBasic,children:P(e,i.tier)})})]},`${t.toolName}:${i.actionName}`))]},t.toolName)})})]})}),o.statistics&&s.jsxs("div",{className:a.summaryLine,children:[e("tools.summary.total","Total"),": ",o.statistics.totalCalls," ",e("tools.summary.calls","calls")," | ",e("tools.summary.sessions","Sessions"),": ",o.statistics.totalSessions]})]}),!f.loading&&f.tier==="basic"&&s.jsx(tt,{basicCalls:f.basicCalls,proCalls:f.proCalls,totalCalls:f.totalCalls,proUsagePercent:f.proUsagePercent,upgradeHref:Y.tools}),s.jsx(Q,{open:p!==null,title:p==="history"?e("tools.clear.history.title","Clear history?"):e("tools.clear.statistics.title","Clear statistics?"),message:p==="history"?e("tools.clear.history.message","This permanently removes the current place tool history and failures."):e("tools.clear.statistics.message","This permanently resets the current place tool statistics."),cancelLabel:e("common.cancel","Cancel"),confirmLabel:e("common.clear","Clear"),loading:x,onCancel:()=>!x&&N(null),onConfirm:y})]})}export{Yt as Component};
1
+ import{j as s,r as l,a as R,D as Z,u as q,i as z,T as w}from"./index-DWRH2iF4.js";import{C as Q}from"./ConfirmModal-Db4rfrTo.js";import{u as X,T as Y}from"./tier-promo-config-CQFDWwo4.js";import{T as tt}from"./TierPromoProgress-r5fgmYI5.js";import"./TierPromo.module-BBX3CVXn.js";const st="_wrapper_1s3lp_2",et="_table_1s3lp_7",at="_sortable_1s3lp_32",ot="_sortArrow_1s3lp_41",rt="_clickable_1s3lp_52",lt="_empty_1s3lp_57",M={wrapper:st,table:et,sortable:at,sortArrow:ot,clickable:rt,empty:lt};function it({columns:e,data:o,sortBy:T,sortDir:f="asc",onSort:g,onRowClick:S,rowKey:C,emptyMessage:v}){return s.jsx("div",{className:M.wrapper,children:s.jsxs("table",{className:M.table,children:[s.jsx("thead",{children:s.jsx("tr",{children:e.map(n=>s.jsxs("th",{style:n.width?{width:n.width}:void 0,className:n.sortable?M.sortable:void 0,onClick:n.sortable&&g?()=>g(n.key):void 0,children:[s.jsx("span",{children:n.label}),n.sortable&&T===n.key&&s.jsx("span",{className:M.sortArrow,children:f==="asc"?"▴":"▾"})]},n.key))})}),s.jsx("tbody",{children:o.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:e.length,className:M.empty,children:v||"No data"})}):o.map((n,k)=>s.jsx("tr",{className:S?M.clickable:void 0,onClick:S?()=>S(n):void 0,children:e.map(p=>s.jsx("td",{children:p.render?p.render(n):String(n[p.key]??"")},p.key))},C?C(n):k))})]})})}const V=50;function nt(){const[e,o]=l.useState(null),[T,f]=l.useState(!0),[g,S]=l.useState([]),[C,v]=l.useState(0),[n,k]=l.useState(!1),[p,N]=l.useState(!0),[x,H]=l.useState(0),[u,D]=l.useState(""),[B,E]=l.useState([]),[U,A]=l.useState(0),[O,d]=l.useState(!1),[$,F]=l.useState(!0),[b,j]=l.useState(0),L=l.useRef(null),y=l.useCallback(async()=>{f(!0);try{const m=await R.get("/api/dashboard/tool-stats");o(m)}catch{}finally{f(!1)}},[]),t=l.useCallback(async(m,_)=>{N(!0);try{const K={limit:String(V),offset:String(m)};_&&(K.tool=_);const W=await R.get("/api/dashboard/history",K);S(W.entries),v(W.total),k(W.hasMore)}catch{S([]),v(0),k(!1)}finally{N(!1)}},[]),r=l.useCallback(async m=>{F(!0);try{const _=await R.get("/api/dashboard/failures",{limit:String(V),offset:String(m)});E(_.entries),A(_.total),d(_.hasMore)}catch{E([]),A(0),d(!1)}finally{F(!1)}},[]),i=l.useCallback(()=>{y(),t(x,u),r(b)},[y,t,r,x,u,b]),h=l.useCallback(async()=>{await R.post("/api/dashboard/tools/history/clear"),t(x,u),r(b)},[t,r,x,u,b]),c=l.useCallback(async()=>{await R.post("/api/dashboard/tools/statistics/clear"),y()},[y]);return l.useEffect(()=>{y()},[y]),l.useEffect(()=>{t(x,u)},[t,x,u]),l.useEffect(()=>{r(b)},[r,b]),l.useEffect(()=>{const m=new Z;L.current=m,m.connect();const _=m.on("command",()=>{y(),t(x,u),r(b)});return()=>{_(),m.disconnect(),L.current=null}},[y,t,r,x,u,b]),{statistics:e,statsLoading:T,history:g,historyTotal:C,historyHasMore:n,historyLoading:p,historyOffset:x,historyToolFilter:u,setHistoryOffset:H,setHistoryToolFilter:D,failures:B,failuresTotal:U,failuresHasMore:O,failuresLoading:$,failuresOffset:b,setFailuresOffset:j,refresh:i,clearHistory:h,clearStatistics:c}}const ct="_page_184r6_2",dt="_tabs_184r6_10",ut="_tab_184r6_10",pt="_tabActive_184r6_34",ht="_card_184r6_40",mt="_cardToolbar_184r6_47",xt="_sectionTitle_184r6_55",bt="_dangerButton_184r6_61",ft="_proBadge_184r6_71",_t="_statusOk_184r6_85",yt="_tierBasic_184r6_91",jt="_tierPro_184r6_95",gt="_tierMixed_184r6_100",St="_filterRow_184r6_111",Tt="_filterLabel_184r6_118",Ct="_filterSelect_184r6_127",Nt="_expandedRow_184r6_138",wt="_expandedSection_184r6_146",vt="_pre_184r6_156",kt="_pagination_184r6_173",Bt="_pageInfo_184r6_181",Mt="_btn_184r6_187",Pt="_tierDistribution_184r6_210",Et="_tierBarWrap_184r6_214",Lt="_tierBarBasic_184r6_222",Rt="_tierBarPro_184r6_227",Ht="_tierLabels_184r6_232",At="_statsTableWrap_184r6_241",Ot="_statsTable_184r6_241",$t="_sortableHeader_184r6_272",Ft="_sortArrow_184r6_277",It="_statsToolRow_184r6_281",Dt="_statsActionRow_184r6_289",Ut="_expandButton_184r6_293",Wt="_expandIcon_184r6_305",Gt="_actionLabel_184r6_310",Jt="_emptyStats_184r6_317",Kt="_summaryLine_184r6_323",a={page:ct,tabs:dt,tab:ut,tabActive:pt,card:ht,cardToolbar:mt,sectionTitle:xt,dangerButton:bt,proBadge:ft,statusOk:_t,tierBasic:yt,tierPro:jt,tierMixed:gt,filterRow:St,filterLabel:Tt,filterSelect:Ct,expandedRow:Nt,expandedSection:wt,pre:vt,pagination:kt,pageInfo:Bt,btn:Mt,tierDistribution:Pt,tierBarWrap:Et,tierBarBasic:Lt,tierBarPro:Rt,tierLabels:Ht,statsTableWrap:At,statsTable:Ot,sortableHeader:$t,sortArrow:Ft,statsToolRow:It,statsActionRow:Dt,expandButton:Ut,expandIcon:Wt,actionLabel:Gt,emptyStats:Jt,summaryLine:Kt},G=50;function Vt(e){const o=new Date(e);return`${String(o.getHours()).padStart(2,"0")}:${String(o.getMinutes()).padStart(2,"0")}:${String(o.getSeconds()).padStart(2,"0")}`}function I(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function J(e,o){return o===0?"-":`${Math.round(e/o*100)}%`}function P(e,o){return o==="pro"?e("tier.pro","Pro"):o==="mixed"?e("tier.mixed","Mixed"):e("tier.basic","Basic")}function Yt(){const{t:e}=q(),o=nt(),{show:T}=z(),f=X(),[g,S]=l.useState("history"),[C,v]=l.useState(null),[n,k]=l.useState(null),[p,N]=l.useState(null),[x,H]=l.useState(!1),[u,D]=l.useState("totalCalls"),[B,E]=l.useState("desc"),U=l.useCallback(t=>{D(r=>r===t?(E(i=>i==="asc"?"desc":"asc"),t):(E("desc"),t))},[]),A=l.useMemo(()=>{var t;return(t=o.statistics)!=null&&t.tools?Object.keys(o.statistics.tools).sort():[]},[o.statistics]),O=l.useMemo(()=>{var t;return(t=o.statistics)!=null&&t.tools?Object.values(o.statistics.tools).map(r=>{const i=Object.entries(r.actions??{}).map(([h,c])=>({toolName:r.toolName,actionName:c.action??h,tier:c.tier,totalCalls:c.totalCalls,successCount:c.successCount,failureCount:c.failureCount,totalExecutionTimeMs:c.totalExecutionTimeMs,avgExecutionTimeMs:c.avgExecutionTimeMs,firstUsed:c.firstUsed,lastUsed:c.lastUsed}));return{toolName:r.toolName,tier:r.tier,actions:i,totalCalls:r.totalCalls,successCount:r.successCount,failureCount:r.failureCount,totalExecutionTimeMs:r.totalExecutionTimeMs,avgExecutionTimeMs:r.avgExecutionTimeMs,firstUsed:r.firstUsed,lastUsed:r.lastUsed}}):[]},[o.statistics]),d=l.useCallback((t,r,i,h)=>s.jsx(w,{text:e(i,h),children:e(t,r)}),[e]),$=l.useMemo(()=>[...O].sort((r,i)=>{const h=r[u],c=i[u];if(typeof h=="number"&&typeof c=="number")return B==="asc"?h-c:c-h;const m=String(h??""),_=String(c??"");return B==="asc"?m.localeCompare(_):_.localeCompare(m)}),[O,u,B]),F=l.useMemo(()=>[{key:"timestamp",label:d("tools.col.time","Time","tools.col.time.tooltip","When the tool run was recorded."),width:"80px",render:t=>Vt(t.timestamp)},{key:"toolName",label:d("tools.col.toolAction","Tool.Action","tools.col.toolAction.tooltip","Tool name and action that were executed."),render:t=>{var i;const r=((i=t.parameters)==null?void 0:i.action)??"";return s.jsxs("span",{children:[t.toolName,r?`.${r}`:"",t.tier==="pro"&&s.jsx(w,{text:e("tools.badge.pro.tooltip","This entry used a Pro-only tool or action."),children:s.jsx("span",{className:a.proBadge,children:e("tools.badge.pro","PRO")})})]})}},{key:"executionTimeMs",label:d("tools.col.duration","Duration","tools.col.duration.tooltip","How long the tool took to finish."),width:"80px",render:t=>I(t.executionTimeMs)},{key:"status",label:d("tools.col.status","Status","tools.col.status.tooltip","Outcome of the recorded tool run."),width:"60px",render:()=>s.jsx(w,{text:e("tools.status.ok.tooltip","The tool run completed successfully."),children:s.jsx("span",{className:a.statusOk,children:e("tools.status.ok","OK")})})},{key:"tier",label:d("tools.col.tier","Tier","tools.col.tier.tooltip","License tier required for the tool or action."),width:"60px",render:t=>s.jsx("span",{className:t.tier==="pro"?a.tierPro:a.tierBasic,children:P(e,t.tier)})}],[e,d]),b=l.useMemo(()=>[{key:"toolName",label:d("tools.col.tool","Tool","tools.col.tool.tooltip","Consolidated tool name in the statistics table."),sortable:!0},{key:"totalCalls",label:d("tools.col.calls","Calls","tools.col.calls.tooltip","Total number of recorded calls for this tool."),sortable:!0,width:"70px"},{key:"successRate",label:d("tools.col.okRate","OK%","tools.col.okRate.tooltip","Percentage of calls that finished successfully."),sortable:!1,width:"60px",render:t=>J(t.successCount,t.totalCalls)},{key:"avgExecutionTimeMs",label:d("tools.col.avgTime","Avg Time","tools.col.avgTime.tooltip","Average execution time across recorded calls."),sortable:!0,width:"80px",render:t=>I(t.avgExecutionTimeMs)},{key:"tier",label:d("tools.col.tier","Tier","tools.col.tierStats.tooltip","Basic, Pro, or Mixed summary for the tool statistics row."),sortable:!0,width:"60px",render:t=>s.jsx(w,{text:t.tier==="mixed"?e("tools.tier.mixed.tooltip","This tool includes both Basic and Pro actions."):"",children:s.jsx("span",{className:t.tier==="pro"?a.tierPro:t.tier==="mixed"?a.tierMixed:a.tierBasic,children:P(e,t.tier)})})}],[e,d]),j=l.useMemo(()=>{if(!o.statistics)return null;const t=o.statistics.tierSummary.basic.totalCalls,r=o.statistics.tierSummary.pro.totalCalls,i=t+r;if(i===0)return null;const h=Math.round(t/i*100),c=100-h;return{basic:t,pro:r,total:i,basicPct:h,proPct:c}},[o.statistics]),L=l.useCallback(t=>{k(r=>r===t?null:t)},[]),y=l.useCallback(async()=>{if(p){H(!0);try{p==="history"?await o.clearHistory():await o.clearStatistics(),T(e("toast.clearSuccess","Cleared successfully"),"success"),N(null)}catch{T(e("toast.clearFailed","Failed to clear data"),"error")}finally{H(!1)}}},[p,T,e,o]);return s.jsxs("div",{className:a.page,children:[s.jsx("div",{className:a.tabs,children:["history","statistics"].map(t=>s.jsx("button",{className:`${a.tab} ${g===t?a.tabActive:""}`,onClick:()=>S(t),children:e(`tools.tab.${t}`,t.charAt(0).toUpperCase()+t.slice(1))},t))}),g==="history"&&s.jsxs("div",{className:a.card,children:[s.jsxs("div",{className:a.cardToolbar,children:[s.jsx("div",{className:a.sectionTitle,children:e("tools.tab.history","History")}),s.jsx("button",{className:a.dangerButton,onClick:()=>N("history"),children:e("common.clear","Clear")})]}),s.jsx("div",{className:a.filterRow,children:s.jsxs("label",{className:a.filterLabel,children:[e("tools.filter.tool","Tool"),":",s.jsxs("select",{className:a.filterSelect,value:o.historyToolFilter,onChange:t=>{o.setHistoryToolFilter(t.target.value),o.setHistoryOffset(0)},children:[s.jsx("option",{value:"",children:e("tools.filter.all","All")}),A.map(t=>s.jsx("option",{value:t,children:t},t))]})]})}),s.jsx(it,{columns:F,data:o.history,rowKey:t=>t.id,onRowClick:t=>v(r=>r===t.id?null:t.id),emptyMessage:e("tools.empty.history","No history entries")}),C&&(()=>{const t=o.history.find(r=>r.id===C);return t?s.jsxs("div",{className:a.expandedRow,children:[s.jsxs("div",{className:a.expandedSection,children:[s.jsxs("strong",{children:[s.jsx(w,{text:e("tools.detail.params.tooltip","Input parameters passed to this tool run."),children:e("tools.detail.params","Parameters")}),":"]}),s.jsx("pre",{className:a.pre,children:JSON.stringify(t.parameters,null,2)})]}),t.result&&s.jsxs("div",{className:a.expandedSection,children:[s.jsxs("strong",{children:[s.jsx(w,{text:e("tools.detail.result.tooltip","Returned result payload for this tool run."),children:e("tools.detail.result","Result")}),":"]}),s.jsx("pre",{className:a.pre,children:JSON.stringify(t.result,null,2)})]})]}):null})(),s.jsxs("div",{className:a.pagination,children:[s.jsx("button",{className:a.btn,disabled:o.historyOffset===0,title:e("tools.page.prev.tooltip","Go to the previous page of tool history results."),onClick:()=>o.setHistoryOffset(Math.max(0,o.historyOffset-G)),children:e("tools.page.prev","Prev")}),s.jsxs("span",{className:a.pageInfo,children:[o.historyOffset+1,"–",Math.min(o.historyOffset+G,o.historyTotal)," / ",o.historyTotal]}),s.jsx("button",{className:a.btn,disabled:!o.historyHasMore,title:e("tools.page.next.tooltip","Go to the next page of tool history results."),onClick:()=>o.setHistoryOffset(o.historyOffset+G),children:e("tools.page.next","Next")})]})]}),g==="statistics"&&s.jsxs("div",{className:a.card,children:[s.jsxs("div",{className:a.cardToolbar,children:[s.jsx("div",{className:a.sectionTitle,children:e("tools.tab.statistics","Statistics")}),s.jsx("button",{className:a.dangerButton,onClick:()=>N("statistics"),children:e("common.clear","Clear")})]}),j&&s.jsxs("div",{className:a.tierDistribution,children:[s.jsxs("div",{className:a.tierBarWrap,children:[s.jsx("div",{className:a.tierBarBasic,style:{width:`${j.basicPct}%`}}),s.jsx("div",{className:a.tierBarPro,style:{width:`${j.proPct}%`}})]}),s.jsxs("div",{className:a.tierLabels,children:[s.jsxs("span",{children:[P(e,"basic")," ",j.basicPct,"% (",j.basic,")"]}),s.jsxs("span",{children:[P(e,"pro")," ",j.proPct,"% (",j.pro,")"]})]})]}),s.jsx("div",{className:a.statsTableWrap,children:s.jsxs("table",{className:a.statsTable,children:[s.jsx("thead",{children:s.jsx("tr",{children:b.map(t=>s.jsxs("th",{style:t.width?{width:t.width}:void 0,className:t.sortable?a.sortableHeader:void 0,onClick:t.sortable?()=>U(t.key):void 0,children:[s.jsx("span",{children:t.label}),t.sortable&&u===t.key&&s.jsx("span",{className:a.sortArrow,children:B==="asc"?"▴":"▾"})]},t.key))})}),s.jsx("tbody",{children:$.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:b.length,className:a.emptyStats,children:e("tools.empty.stats","No tool statistics")})}):$.map(t=>{const r=n===t.toolName;return s.jsxs(l.Fragment,{children:[s.jsxs("tr",{className:a.statsToolRow,onClick:()=>L(t.toolName),children:[s.jsx("td",{children:s.jsxs("button",{type:"button",className:a.expandButton,"aria-expanded":r,"aria-label":`${t.toolName} ${r?e("common.collapse","Collapse"):e("common.expand","Expand")}`,onClick:i=>{i.stopPropagation(),L(t.toolName)},children:[s.jsx("span",{className:a.expandIcon,"aria-hidden":"true",children:r?"▾":"▸"}),s.jsx("span",{children:t.toolName})]})}),s.jsx("td",{children:t.totalCalls}),s.jsx("td",{children:J(t.successCount,t.totalCalls)}),s.jsx("td",{children:I(t.avgExecutionTimeMs)}),s.jsx("td",{children:s.jsx(w,{text:t.tier==="mixed"?e("tools.tier.mixed.tooltip","This tool includes both Basic and Pro actions."):"",children:s.jsx("span",{className:t.tier==="pro"?a.tierPro:t.tier==="mixed"?a.tierMixed:a.tierBasic,children:P(e,t.tier)})})})]}),r&&t.actions.map(i=>s.jsxs("tr",{className:a.statsActionRow,children:[s.jsx("td",{children:s.jsx("span",{className:a.actionLabel,children:i.actionName})}),s.jsx("td",{children:i.totalCalls}),s.jsx("td",{children:J(i.successCount,i.totalCalls)}),s.jsx("td",{children:I(i.avgExecutionTimeMs)}),s.jsx("td",{children:s.jsx("span",{className:i.tier==="pro"?a.tierPro:a.tierBasic,children:P(e,i.tier)})})]},`${t.toolName}:${i.actionName}`))]},t.toolName)})})]})}),o.statistics&&s.jsxs("div",{className:a.summaryLine,children:[e("tools.summary.total","Total"),": ",o.statistics.totalCalls," ",e("tools.summary.calls","calls")," | ",e("tools.summary.sessions","Sessions"),": ",o.statistics.totalSessions]})]}),!f.loading&&f.tier==="basic"&&s.jsx(tt,{basicCalls:f.basicCalls,proCalls:f.proCalls,totalCalls:f.totalCalls,proUsagePercent:f.proUsagePercent,upgradeHref:Y.tools}),s.jsx(Q,{open:p!==null,title:p==="history"?e("tools.clear.history.title","Clear history?"):e("tools.clear.statistics.title","Clear statistics?"),message:p==="history"?e("tools.clear.history.message","This permanently removes the current place tool history and failures."):e("tools.clear.statistics.message","This permanently resets the current place tool statistics."),cancelLabel:e("common.cancel","Cancel"),confirmLabel:e("common.clear","Clear"),loading:x,onCancel:()=>!x&&N(null),onConfirm:y})]})}export{Yt as Component};