@weppy/roblox-mcp 2.9.0 → 2.9.2
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.
- package/CHANGELOG.md +14 -0
- package/README.md +1 -1
- package/dashboard/dist/assets/{AssetsPage-Bg2-L4ZA.js → AssetsPage-CC3FW3XG.js} +1 -1
- package/dashboard/dist/assets/{ChangelogDetailPage-BfKpoGXf.js → ChangelogDetailPage-B1zg2f56.js} +1 -1
- package/dashboard/dist/assets/{ChangelogPage-CJgsI7aS.js → ChangelogPage-CbfWdVtL.js} +1 -1
- package/dashboard/dist/assets/{ConfirmModal-C9EhZCHZ.js → ConfirmModal-BCviiJ3_.js} +1 -1
- package/dashboard/dist/assets/{ConnectionPage-DGUYptQR.js → ConnectionPage-Dskqof1W.js} +1 -1
- package/dashboard/dist/assets/{ControlsPage-rqArYVq2.js → ControlsPage-C_38U6b0.js} +1 -1
- package/dashboard/dist/assets/{CurrentPlaceScope-BMyP2w7Z.js → CurrentPlaceScope-CHEqGWYd.js} +1 -1
- package/dashboard/dist/assets/{GameChangeDetail-DKAKmyGF.js → GameChangeDetail-DAEU3IYH.js} +1 -1
- package/dashboard/dist/assets/{InfoLabel-ZfsTcz5c.js → InfoLabel-DCq3Fmko.js} +1 -1
- package/dashboard/dist/assets/{OverviewPage-C9OL33DV.js → OverviewPage-lOYmwxzd.js} +1 -1
- package/dashboard/dist/assets/{PageHeader-Cqg4GMtU.js → PageHeader-Do_AQ2vQ.js} +1 -1
- package/dashboard/dist/assets/{PlaytestPage-CczAQ-A8.js → PlaytestPage-CKcxZyhl.js} +1 -1
- package/dashboard/dist/assets/{SettingsPage-DNp4oJDT.js → SettingsPage-C0PubIFP.js} +1 -1
- package/dashboard/dist/assets/{StatusBadge-BSFzbkXM.js → StatusBadge-DRbLpCd0.js} +1 -1
- package/dashboard/dist/assets/{SyncPage-DzOONMOM.js → SyncPage-BFsgItgP.js} +1 -1
- package/dashboard/dist/assets/{Tabs-B8mbzhmZ.js → Tabs-CGfFE3L1.js} +1 -1
- package/dashboard/dist/assets/{ToolsPage-DFh7yyab.js → ToolsPage-DHhF-Y_W.js} +1 -1
- package/dashboard/dist/assets/{TooltipText-ZamrETeK.js → TooltipText-CfI7WgY4.js} +1 -1
- package/dashboard/dist/assets/{UiStudioPage-D7awEU2z.js → UiStudioPage-RAd0qXzL.js} +1 -1
- package/dashboard/dist/assets/{WhatsNewPage-CTZEuf65.js → WhatsNewPage-CLnx6v4u.js} +1 -1
- package/dashboard/dist/assets/{copy-Cey6jv67.js → copy-BIZzQcB-.js} +1 -1
- package/dashboard/dist/assets/index-DYezp9b1.js +606 -0
- package/dashboard/dist/assets/{sample-requests-CS0o0F7H.js → sample-requests-CnV4bBG4.js} +1 -1
- package/dashboard/dist/assets/{useLiveUptime-BGlwL1Q-.js → useLiveUptime-BYmnk4Ph.js} +1 -1
- package/dashboard/dist/assets/{useSettings-mbARvRgI.js → useSettings-HzhprVq7.js} +1 -1
- package/dashboard/dist/index.html +1 -1
- package/dist/index.js +62 -62
- package/package.json +1 -1
- package/roblox-plugin/WeppyRobloxMCP.rbxm +0 -0
- package/dashboard/dist/assets/index-B9LVK3-K.js +0 -606
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as V,e as ae,r as u,j as e,g as le,a as I,d as re,T as ce,A as de,S as ue}from"./index-B9LVK3-K.js";import{P as pe}from"./PageHeader-Cqg4GMtU.js";import{I as v}from"./InfoLabel-ZfsTcz5c.js";import{T as d}from"./TooltipText-ZamrETeK.js";import{s as i,u as ge}from"./useSettings-mbARvRgI.js";import{C as he}from"./ConfirmModal-C9EhZCHZ.js";import{D as ie,f as ne,r as me,s as ye,a as oe,d as K,S as te,b as ve}from"./sample-requests-CS0o0F7H.js";import"./ConfirmModal.module-NrFlfTWy.js";const xe="_card_1jlvt_4",je="_cardEmbedded_1jlvt_14",fe="_cardTitle_1jlvt_21",Se="_usageRow_1jlvt_30",be="_usageTotal_1jlvt_36",_e="_usageBreakdown_1jlvt_42",Ne="_usageCounts_1jlvt_47",Ce="_divider_1jlvt_53",ke="_lastRunRow_1jlvt_60",Re="_lastRunLabel_1jlvt_69",Le="_errorIcon_1jlvt_75",we="_tooltip_1jlvt_83",He="_cleanupRow_1jlvt_106",Pe="_cleanupLabel_1jlvt_113",Be="_cleanupBtn_1jlvt_120",De="_cleanupBtnDanger_1jlvt_143",Ae="_retentionSection_1jlvt_155",Te="_retentionTitle_1jlvt_161",Me="_retentionFieldset_1jlvt_170",Ee="_proOverlay_1jlvt_185",$e="_radioRow_1jlvt_197",Ie="_radioLabel_1jlvt_204",Ue="_presetGroup_1jlvt_224",ze="_presetBtn_1jlvt_232",Oe="_presetBtnActive_1jlvt_249",Fe="_freeInput_1jlvt_256",qe="_inputError_1jlvt_272",Ge="_inputUnit_1jlvt_276",We="_cascadeRow_1jlvt_283",Ye="_retentionActions_1jlvt_302",Ke="_saveBtn_1jlvt_308",Ve="_runNowBtn_1jlvt_330",Je="_errorMsg_1jlvt_353",n={card:xe,cardEmbedded:je,cardTitle:fe,usageRow:Se,usageTotal:be,usageBreakdown:_e,usageCounts:Ne,divider:Ce,lastRunRow:ke,lastRunLabel:Re,errorIcon:Le,tooltip:we,cleanupRow:He,cleanupLabel:Pe,cleanupBtn:Be,cleanupBtnDanger:De,retentionSection:Ae,retentionTitle:Te,retentionFieldset:Me,proOverlay:Ee,radioRow:$e,radioLabel:Ie,presetGroup:Ue,presetBtn:ze,presetBtnActive:Oe,freeInput:Fe,inputError:qe,inputUnit:Ge,cascadeRow:We,retentionActions:Ye,saveBtn:Ke,runNowBtn:Ve,errorMsg:Je};function Qe(t,s){return!!(t.mode==="off"&&s.mode!=="off"||t.mode==="age"&&s.mode==="age"&&(s.ageDays??0)<(t.ageDays??0)||t.mode==="size"&&s.mode==="size"&&(s.sizeMb??0)<(t.sizeMb??0)||!t.cascadeSnapshots&&s.cascadeSnapshots)}function se(t){return t.mode==="age"?Number.isInteger(t.ageDays)&&t.ageDays>=1&&t.ageDays<=365:t.mode==="size"?Number.isInteger(t.sizeMb)&&t.sizeMb>=50&&t.sizeMb<=1e4:!0}function Xe(t,s){return t.mode===s.mode&&t.ageDays===s.ageDays&&t.sizeMb===s.sizeMb&&t.cascadeSnapshots===s.cascadeSnapshots}function z(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:t<1024*1024*1024?`${(t/(1024*1024)).toFixed(1)} MB`:`${(t/(1024*1024*1024)).toFixed(2)} GB`}function Ze({placeId:t,tier:s,currentPolicy:l,onSaved:x}){const{t:o}=V(),{trackEvent:N}=ae(),[a,g]=u.useState(l),[p,P]=u.useState(()=>[7,14,30,90].includes(l.ageDays??-1)?"":String(l.ageDays??30)),[k,B]=u.useState(()=>[100,500,1e3].includes(l.sizeMb??-1)?"":String(l.sizeMb??500)),[S,D]=u.useState(null),[h,y]=u.useState(!1),[A,R]=u.useState(!1),[_,L]=u.useState(!1),[w,H]=u.useState(null);u.useEffect(()=>{g(l);const c=[7,14,30,90],b=[100,500,1e3];P(c.includes(l.ageDays??-1)?"":String(l.ageDays??30)),B(b.includes(l.sizeMb??-1)?"":String(l.sizeMb??500))},[l]);const C=s==="basic",j=se(a),r=Xe(l,a),T=j&&!r&&!A,f=c=>{g(b=>{const U={...b,mode:c};return c==="age"&&(U.ageDays=parseInt(p,10)||30),c==="size"&&(U.sizeMb=parseInt(k,10)||500),U})},m=c=>{P(""),g(b=>({...b,ageDays:c}))},O=c=>{B(""),g(b=>({...b,sizeMb:c}))},J=c=>{P(c);const b=parseInt(c,10);Number.isNaN(b)||g(U=>({...U,ageDays:b}))},E=c=>{B(c);const b=parseInt(c,10);Number.isNaN(b)||g(U=>({...U,sizeMb:b}))},Q=async()=>{if(H(null),N("dashboard_click_event",{click_target:"ui_studio_cleanup_save",page:"settings"}),Qe(l,a)){try{const c=await ne(t,{mode:a.mode,ageDays:a.ageDays,sizeMb:a.sizeMb,cascadeSnapshots:a.cascadeSnapshots});D(c.dryRun),y(!0)}catch(c){H(c.message)}return}await Y()},Y=async()=>{R(!0);try{await ye(t,a),y(!1),x()}catch(c){throw H(c.message),c}finally{R(!1)}},X=async()=>{H(null),N("dashboard_click_event",{click_target:"ui_studio_cleanup_run_now",page:"settings"}),L(!0);try{await me(t),x()}catch(c){H(c.message)}finally{L(!1)}},Z=S?`${o("uiStudio.cleanup.policy.confirm.messageStrict","이 정책으로 즉시")} ${S.wouldRemoveRequests}${o("uiStudio.cleanup.policy.confirm.requests","건")} / ${S.wouldRemoveSnapshots}${o("uiStudio.cleanup.policy.confirm.snapshots","개 화면 캡처")} / ${z(S.wouldFreeBytes)} ${o("uiStudio.cleanup.policy.confirm.freed","가 삭제됩니다 — 적용?")}`:"",$=a.mode==="age"&&!se(a),ee=a.mode==="size"&&!se(a);return e.jsxs("div",{className:n.retentionSection,children:[e.jsx("h3",{className:n.retentionTitle,children:e.jsx(v,{label:o("uiStudio.cleanup.policy.title","자동 삭제 정책"),tooltip:o("uiStudio.cleanup.policy.title.tooltip","Rules that automatically remove old or large captures.")})}),e.jsxs("div",{style:{position:"relative"},children:[C&&e.jsx("div",{className:n.proOverlay,title:o("uiStudio.cleanup.policy.proRequired","Pro에서 사용 가능"),children:e.jsx("div",{className:n.tooltip,children:o("uiStudio.cleanup.policy.proRequired","Pro에서 사용 가능")})}),e.jsxs("fieldset",{className:n.retentionFieldset,disabled:C,style:C?{opacity:.45,pointerEvents:"none"}:void 0,children:[e.jsx("div",{className:n.radioRow,children:e.jsx(d,{text:o("uiStudio.cleanup.policy.modeOff.tooltip","Turn off auto-cleanup. Data stays until you remove it manually."),children:e.jsxs("label",{className:n.radioLabel,children:[e.jsx("input",{type:"radio",name:"cleanupMode",value:"off",checked:a.mode==="off",onChange:()=>f("off")}),o("uiStudio.cleanup.policy.modeOff","사용 안 함 (off)")]})})}),e.jsxs("div",{children:[e.jsx("div",{className:n.radioRow,children:e.jsx(d,{text:o("uiStudio.cleanup.policy.modeAge.tooltip","Automatically delete data older than the configured number of days."),children:e.jsxs("label",{className:n.radioLabel,children:[e.jsx("input",{type:"radio",name:"cleanupMode",value:"age",checked:a.mode==="age",onChange:()=>f("age")}),o("uiStudio.cleanup.policy.modeAge","기간 기반 (age)")]})})}),a.mode==="age"&&e.jsxs("div",{className:n.presetGroup,children:[[7,14,30,90].map(c=>e.jsx(d,{text:o("uiStudio.cleanup.policy.agePreset.tooltip","Delete data older than this many days."),children:e.jsxs("button",{type:"button",className:`${n.presetBtn} ${a.ageDays===c&&p===""?n.presetBtnActive:""}`,onClick:()=>m(c),children:[c,o("uiStudio.cleanup.policy.daysUnit","일")]})},c)),e.jsx(d,{text:o("uiStudio.cleanup.policy.ageInput.tooltip","Enter any value between 1 and 365 days."),children:e.jsx("input",{type:"number",className:`${n.freeInput} ${$?n.inputError:""}`,value:p,min:1,max:365,onChange:c=>J(c.target.value)})}),e.jsxs("span",{className:n.inputUnit,children:["1–365",o("uiStudio.cleanup.policy.daysUnit","일")]})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:n.radioRow,children:e.jsx(d,{text:o("uiStudio.cleanup.policy.modeSize.tooltip","When total usage exceeds the limit, the oldest data is removed first."),children:e.jsxs("label",{className:n.radioLabel,children:[e.jsx("input",{type:"radio",name:"cleanupMode",value:"size",checked:a.mode==="size",onChange:()=>f("size")}),o("uiStudio.cleanup.policy.modeSize","용량 기반 (size)")]})})}),a.mode==="size"&&e.jsxs("div",{className:n.presetGroup,children:[[100,500,1e3].map(c=>e.jsx(d,{text:o("uiStudio.cleanup.policy.sizePreset.tooltip","Keep total usage under this size."),children:e.jsxs("button",{type:"button",className:`${n.presetBtn} ${a.sizeMb===c&&k===""?n.presetBtnActive:""}`,onClick:()=>O(c),children:[c,o("uiStudio.cleanup.policy.mbUnit","MB")]})},c)),e.jsx(d,{text:o("uiStudio.cleanup.policy.sizeInput.tooltip","Enter any value between 50 MB and 10000 MB (10 GB)."),children:e.jsx("input",{type:"number",className:`${n.freeInput} ${ee?n.inputError:""}`,value:k,min:50,max:1e4,onChange:c=>E(c.target.value)})}),e.jsxs("span",{className:n.inputUnit,children:["50–10000",o("uiStudio.cleanup.policy.mbUnit","MB")]})]})]}),e.jsx(d,{text:o("uiStudio.cleanup.policy.cascade.tooltip","Also delete the capture images linked to those records. If off, the images stay."),children:e.jsxs("label",{className:n.cascadeRow,children:[e.jsx("input",{type:"checkbox",checked:a.cascadeSnapshots,onChange:c=>g(b=>({...b,cascadeSnapshots:c.target.checked}))}),o("uiStudio.cleanup.policy.cascade","연결된 화면 캡처도 함께 삭제")]})}),e.jsxs("div",{className:n.retentionActions,children:[e.jsx(d,{text:o("uiStudio.cleanup.policy.save.tooltip","Save the current cleanup rule. It runs in the background from then on."),children:e.jsx("button",{type:"button",className:n.saveBtn,onClick:()=>void Q(),disabled:!T,children:o("uiStudio.cleanup.policy.save","정책 저장")})}),e.jsx(d,{text:o("uiStudio.cleanup.policy.runNow.tooltip","Run the current rule once now, without waiting for the next scheduled run."),children:e.jsx("button",{type:"button",className:n.runNowBtn,onClick:()=>void X(),disabled:_,children:o("uiStudio.cleanup.policy.runNow","지금 정리")})})]}),w&&e.jsx("div",{className:n.errorMsg,children:w})]})]}),h&&S&&e.jsx(ie,{title:o("uiStudio.cleanup.policy.confirm.title","정책 적용 확인"),message:Z,danger:!0,confirmLabel:o("uiStudio.cleanup.policy.save","정책 저장"),busy:A,onConfirm:Y,onClose:()=>y(!1)})]})}function et({placeId:t,tier:s,onChanged:l,sampleUsage:x,sampleRetention:o,embedded:N=!1}){const{t:a}=V(),g=s==="basic"&&x!=null&&o!=null,[p,P]=u.useState(g?x:null),[k,B]=u.useState(g?o:null),[S,D]=u.useState(null),[h,y]=u.useState(null),[A,R]=u.useState(null),_=u.useCallback(async()=>{if(!g&&t!=null){D(null);try{const[f,m]=await Promise.all([oe(t),ne(t)]);P(f),B(m.policy)}catch(f){D(f.message)}}},[t,g]);u.useEffect(()=>{_()},[_]);const L=u.useCallback(()=>{_(),l==null||l()},[_,l]),w=u.useCallback(async()=>{if(h&&t!=null){R(null);try{h.kind==="keep7"?await K(t,{olderThanDays:7,alsoSnapshots:!0}):h.kind==="keep30"?await K(t,{olderThanDays:30,alsoSnapshots:!0}):await K(t,{all:!0,alsoSnapshots:!0}),y(null),_(),l==null||l()}catch(f){throw R(f.message),f}}},[h,t,_,l]);function H(f){const m=a("uiStudio.cleanup.studioPreservedNote","This deletes saved change records and screenshots on disk only; Roblox Studio instances are not affected.");return f.kind==="keep7"?`${a("uiStudio.cleanup.cleanupConfirmMessage.keep7","7일 이전 변경 기록과 화면 캡처가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.")} ${m}`:f.kind==="keep30"?`${a("uiStudio.cleanup.cleanupConfirmMessage.keep30","30일 이전 변경 기록과 화면 캡처가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.")} ${m}`:`${((p==null?void 0:p.requestCount)??0)+((p==null?void 0:p.snapshotCount)??0)}${a("uiStudio.cleanup.cleanupConfirmMessage.all","개의 저장된 변경 기록과 화면 캡처가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.")} ${m}`}if(t==null&&!g)return null;if(S)return e.jsx("div",{className:`${n.card} ${N?n.cardEmbedded:""}`,children:e.jsx("p",{className:n.errorMsg,children:S})});if(!p||!k)return e.jsx("div",{className:`${n.card} ${N?n.cardEmbedded:""}`,children:e.jsx("p",{style:{fontSize:12,color:"var(--text-muted)",margin:0},children:a("uiStudio.storage.loading","로딩 중...")})});const C=k.lastRunAt,j=k.lastRunStats,r=C?new Date(C).toLocaleString():null,T=t??0;return e.jsxs("div",{className:`${n.card} ${N?n.cardEmbedded:""}`,children:[e.jsx("h3",{className:n.cardTitle,children:e.jsx(v,{label:a("uiStudio.storage.title","UI Studio 저장 데이터"),tooltip:a("uiStudio.storage.title.tooltip","Disk usage of UI Studio change records and screenshots.")})}),e.jsxs("div",{className:n.usageRow,children:[e.jsx(d,{text:a("uiStudio.storage.usageLabel.tooltip","Disk space currently used by UI Studio for this project."),children:e.jsxs("div",{className:n.usageTotal,children:[a("uiStudio.storage.usageLabel","사용 중")," ",z(p.totalBytes)]})}),e.jsxs("div",{className:n.usageBreakdown,children:[e.jsx(d,{text:a("uiStudio.storage.historyBytes.tooltip","Space taken by change record data (JSON)."),children:e.jsxs("span",{children:[a("uiStudio.storage.historyBytes","변경 이력")," ",z(p.historyBytes)]})})," · ",e.jsx(d,{text:a("uiStudio.storage.snapshotBytes.tooltip","Space taken by captured PNG image files."),children:e.jsxs("span",{children:[a("uiStudio.storage.snapshotBytes","화면 캡처")," ",z(p.snapshotBytes)]})})]}),e.jsxs("div",{className:n.usageCounts,children:[e.jsx(d,{text:a("uiStudio.storage.requestCount.tooltip","Number of actions where AI changed the UI."),children:e.jsxs("span",{children:[a("uiStudio.storage.requestCount","변경 기록")," ",p.requestCount.toLocaleString(),a("uiStudio.storage.countSuffix","개")]})})," · ",e.jsx(d,{text:a("uiStudio.storage.mutationCount.tooltip","Number of detail changes inside actions (one property edit = 1)."),children:e.jsxs("span",{children:[a("uiStudio.storage.mutationCount","변경 상세")," ",p.mutationCount.toLocaleString(),a("uiStudio.storage.countSuffix","개")]})})," · ",e.jsx(d,{text:a("uiStudio.storage.snapshotCount.tooltip","Number of saved capture image files."),children:e.jsxs("span",{children:[a("uiStudio.storage.snapshotCount","화면 캡처")," ",p.snapshotCount.toLocaleString(),a("uiStudio.storage.countSuffix","개")]})})]})]}),e.jsx("hr",{className:n.divider}),e.jsx(Ze,{placeId:T,tier:s,currentPolicy:k,onSaved:L}),e.jsx("hr",{className:n.divider}),e.jsxs("div",{className:n.lastRunRow,children:[e.jsx("span",{className:n.lastRunLabel,children:e.jsx(v,{label:a("uiStudio.storage.lastRun","마지막 자동 정리"),tooltip:a("uiStudio.storage.lastRun.tooltip","When the auto-cleanup policy last ran, and what it removed.")})}),r?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:r}),j&&e.jsxs("span",{children:["· ",a("uiStudio.storage.requestCount","변경 기록")," ",j.removedRequests,a("uiStudio.storage.countSuffix","개")," / ",a("uiStudio.storage.snapshotCount","화면 캡처")," ",j.removedSnapshots,a("uiStudio.storage.countSuffix","개")," / ",z(j.freedBytes)," ",a("uiStudio.storage.lastRunFreed","회수")]}),j&&j.errors>0&&e.jsxs("span",{className:n.errorIcon,title:`${a("uiStudio.storage.lastRunErrors","오류")} ${j.errors}건`,children:["⚠",e.jsxs("span",{className:n.tooltip,children:[a("uiStudio.storage.lastRunErrors","오류")," ",j.errors,a("uiStudio.storage.countSuffix","건")]})]})]}):e.jsx("span",{children:a("uiStudio.storage.lastRunNever","—")})]}),e.jsx("hr",{className:n.divider}),e.jsxs("div",{className:n.cleanupRow,children:[e.jsx("span",{className:n.cleanupLabel,children:e.jsx(v,{label:a("uiStudio.cleanup.label","수동 정리"),tooltip:a("uiStudio.cleanup.label.tooltip","Manually clean up change records and captures whenever you want.")})}),e.jsx(d,{text:a("uiStudio.cleanup.keep7.tooltip","Delete change records and captures older than 7 days."),children:e.jsx("button",{type:"button",className:n.cleanupBtn,onClick:()=>y({kind:"keep7"}),disabled:s==="basic",children:a("uiStudio.cleanup.keepLastNDays","최근 7일만 남기기").replace("{n}","7")})}),e.jsx(d,{text:a("uiStudio.cleanup.keep30.tooltip","Delete change records and captures older than 30 days."),children:e.jsx("button",{type:"button",className:n.cleanupBtn,onClick:()=>y({kind:"keep30"}),disabled:s==="basic",children:a("uiStudio.cleanup.keepLastNDays","최근 30일만 남기기").replace("{n}","30")})}),e.jsx(d,{text:a("uiStudio.cleanup.deleteAll.tooltip","Delete every change record and capture for this project. The actual UI in Roblox Studio is not affected."),children:e.jsx("button",{type:"button",className:`${n.cleanupBtn} ${n.cleanupBtnDanger}`,onClick:()=>y({kind:"all"}),disabled:s==="basic",children:a("uiStudio.cleanup.deleteAll","전체 삭제…")})})]}),A&&e.jsx("div",{className:n.errorMsg,children:A}),h&&e.jsx(ie,{title:a("uiStudio.cleanup.cleanupConfirmTitle","정리 확인"),message:H(h),danger:!0,confirmLabel:a("common.delete","삭제"),onConfirm:w,onClose:()=>{y(null),R(null)}})]})}const tt={toolsActivity:null,toolStats:null,toolSessions:null,syncLog:null,playtestReports:null,projectChanges:null,connectionLog:null},st={toolsActivity:null,toolStats:null,syncLog:null,playtestReports:null,projectChanges:null,connectionLog:null};function at(t){var s;return t?t.pluginConnected?t.activePlaceId:t.lastActivePlaceId??((s=t.places[0])==null?void 0:s.placeId)??null:null}async function M(t){try{return await t}catch{return null}}function G(t){return t?typeof t.total=="number"?t.total:Array.isArray(t.entries)?t.entries.length:null:null}function W(t,s,l,x){return s===null?t("settings.dataHistory.metric.unavailable","Unavailable"):`${s.toLocaleString()} ${t(l,x)}`}function F(t,s,l){const x=l===null?t("settings.dataHistory.metric.sizeUnavailable","size unavailable"):z(l);return`${s} · ${x}`}function q(t,s){var x;const l=(x=t==null?void 0:t[s])==null?void 0:x.bytes;return typeof l=="number"&&Number.isFinite(l)?l:null}function it(t,s){return s?[`${s.requestCount.toLocaleString()} ${t("uiStudio.storage.requestCount","change records")}`,`${s.snapshotCount.toLocaleString()} ${t("uiStudio.storage.snapshotCount","screenshots")}`,z(s.totalBytes)].join(" · "):t("settings.dataHistory.metric.unavailable","Unavailable")}function nt({tier:t}){const{t:s}=V(),[l,x]=u.useState(tt),[o,N]=u.useState(st),[a,g]=u.useState(t==="basic"?te:null),[p,P]=u.useState(null),[k,B]=u.useState(!0),[S,D]=u.useState(!0),[h,y]=u.useState(null),[A,R]=u.useState(!1),[_,L]=u.useState(null),w=u.useCallback(async()=>{B(!0);const m=await M(le()),O=at(m);P(O);const[J,E,Q,Y,X,Z,$]=await Promise.all([M(I.get("/api/dashboard/history",{limit:"1",offset:"0"})),M(I.get("/api/dashboard/tool-stats")),M(I.get("/sync/history",{limit:"1",offset:"0"})),M(I.get("/api/dashboard/playtest/history")),M(I.get("/api/dashboard/changelog",{limit:"1",offset:"0"})),M(I.get("/api/dashboard/connection-log")),M(I.get("/api/dashboard/storage-summary"))]),ee=t==="basic"?te:O===null?null:await M(oe(O));x({toolsActivity:G(J),toolStats:(E==null?void 0:E.totalCalls)??null,toolSessions:(E==null?void 0:E.totalSessions)??null,syncLog:G(Q),playtestReports:G(Y),projectChanges:G(X),connectionLog:G(Z)}),N({toolsActivity:q($,"toolsActivity"),toolStats:q($,"toolStats"),syncLog:q($,"syncLog"),playtestReports:q($,"playtestReports"),projectChanges:q($,"projectChanges"),connectionLog:q($,"connectionLog")}),g(ee),B(!1)},[t]);u.useEffect(()=>{w()},[w]);const H=u.useMemo(()=>[{key:"toolsActivity",title:s("settings.dataHistory.toolsActivity.title","Tool activity"),description:s("settings.dataHistory.toolsActivity.description","Saved tool runs shown on the Tools page."),metric:F(s,W(s,l.toolsActivity,"settings.dataHistory.metric.records","records"),o.toolsActivity),metricTooltip:s("settings.dataHistory.toolsActivity.metric.tooltip","Number of saved tool runs and the disk space they use."),route:"/tools",clearEndpoint:"/api/dashboard/tools/history/clear"},{key:"toolStats",title:s("settings.dataHistory.toolStats.title","Tool usage statistics"),description:s("settings.dataHistory.toolStats.description","Aggregated tool counts and status totals."),metric:F(s,l.toolStats===null?s("settings.dataHistory.metric.unavailable","Unavailable"):`${l.toolStats.toLocaleString()} ${s("settings.dataHistory.metric.runs","runs")} · ${(l.toolSessions??0).toLocaleString()} ${s("settings.dataHistory.metric.sessions","sessions")}`,o.toolStats),metricTooltip:s("settings.dataHistory.toolStats.metric.tooltip","Aggregated total runs and session counts."),route:"/tools",clearEndpoint:"/api/dashboard/tools/statistics/clear"},{key:"syncLog",title:s("settings.dataHistory.syncLog.title","Sync log"),description:s("settings.dataHistory.syncLog.description","Saved file sync events for the active place."),metric:F(s,W(s,l.syncLog,"settings.dataHistory.metric.records","records"),o.syncLog),metricTooltip:s("settings.dataHistory.syncLog.metric.tooltip","Number of saved sync events and the disk space they use."),route:"/sync",clearEndpoint:"/api/dashboard/sync/history/clear"},{key:"playtestReports",title:s("settings.dataHistory.playtest.title","Playtest reports"),description:s("settings.dataHistory.playtest.description","Saved automated playtest reports and logs."),metric:F(s,W(s,l.playtestReports,"settings.dataHistory.metric.reports","reports"),o.playtestReports),metricTooltip:s("settings.dataHistory.playtestReports.metric.tooltip","Number of saved playtest reports and the disk space they use."),route:"/playtest",clearEndpoint:"/api/dashboard/playtest/history/clear"},{key:"projectChanges",title:s("settings.dataHistory.projectChanges.title","Project change summary"),description:s("settings.dataHistory.projectChanges.description","Saved summaries of project changes."),metric:F(s,W(s,l.projectChanges,"settings.dataHistory.metric.records","records"),o.projectChanges),metricTooltip:s("settings.dataHistory.projectChanges.metric.tooltip","Number of saved project change summaries and the disk space they use."),route:"/changelog",clearEndpoint:"/api/dashboard/changelog/clear"},{key:"connectionLog",title:s("settings.dataHistory.connectionLog.title","Connection log"),description:s("settings.dataHistory.connectionLog.description","Saved MCP and Studio connection events."),metric:F(s,W(s,l.connectionLog,"settings.dataHistory.metric.records","records"),o.connectionLog),metricTooltip:s("settings.dataHistory.connectionLog.metric.tooltip","Number of saved connection events and the disk space they use."),route:"/connection",clearEndpoint:"/api/dashboard/connection-log/clear"}],[l,o,s]),C=async()=>{if(h){R(!0),L(null);try{if(h.kind==="uiStudio"){if(t!=="pro"||p===null)throw new Error("UI Studio place is unavailable");await K(p,{all:!0,alsoSnapshots:!0}),L(s("settings.dataHistory.uiStudio.clear.success","UI Studio saved data cleared."))}else await I.post(h.row.clearEndpoint),L(s("settings.dataHistory.clear.success","Saved data cleared."));y(null),await w()}catch{L(h.kind==="uiStudio"?s("settings.dataHistory.uiStudio.clear.failed","Failed to clear UI Studio saved data."):s("settings.dataHistory.clear.failed","Failed to clear saved data."))}finally{R(!1)}}},j=t==="pro"?p:0,r=t==="pro"&&p!==null,T=(h==null?void 0:h.kind)==="uiStudio",f=s("settings.dataHistory.title","Data & History");return e.jsxs(e.Fragment,{children:[e.jsxs("section",{id:"data-history",className:i.card,children:[e.jsxs("div",{className:i.cardHeader,children:[e.jsx(v,{label:s("settings.dataHistory.title","Data & History"),tooltip:s("settings.dataHistory.title.tooltip","Manage saved dashboard data in one place.")}),e.jsxs("div",{className:i.cardHeaderActions,children:[e.jsx(d,{text:s("settings.dataHistory.scope.tooltip","Clear actions apply to the current project and active place where applicable."),children:e.jsx("span",{className:i.headerBadge,children:k?s("common.loading","Loading"):s("settings.dataHistory.scope","Current project")})}),e.jsx(d,{text:s("settings.dataHistory.toggle.tooltip","Collapse or expand this section."),children:e.jsx("button",{className:i.collapseButton,type:"button","aria-expanded":S,"aria-controls":"settings-data-history-body","aria-label":S?s("settings.dataHistory.collapse","Collapse {title}").replace("{title}",f):s("settings.dataHistory.expand","Expand {title}").replace("{title}",f),onClick:()=>D(m=>!m),children:S?"▾":"▸"})})]})]}),S&&e.jsxs("div",{id:"settings-data-history-body",children:[e.jsx("p",{className:i.dataHistoryIntro,children:s("settings.dataHistory.intro","Review saved dashboard data, open the related page, or clear stored records from one place.")}),e.jsxs("div",{className:i.dataHistoryList,children:[H.map(m=>e.jsxs("div",{className:i.dataHistoryRow,children:[e.jsxs("div",{className:i.dataHistoryMain,children:[e.jsx("div",{className:i.dataHistoryTitle,children:m.title}),e.jsx("div",{className:i.dataHistoryDescription,children:m.description})]}),e.jsx(d,{text:m.metricTooltip,children:e.jsx("div",{className:i.dataHistoryMetric,children:m.metric})}),e.jsxs("div",{className:i.dataHistoryActions,children:[e.jsx(d,{text:s("settings.dataHistory.open.tooltip","Open the page that shows this item in detail."),children:e.jsx("a",{className:i.linkButton,href:`#${m.route}`,children:s("settings.dataHistory.open","Open")})}),e.jsx(d,{text:s("settings.dataHistory.clear.tooltip","Delete only the records saved for this item. Roblox Studio data is not changed."),children:e.jsx("button",{className:i.dangerButton,type:"button",onClick:()=>y({kind:"row",row:m}),children:s("common.clear","Clear")})})]})]},m.key)),e.jsxs("div",{className:`${i.dataHistoryRow} ${i.uiStudioDataHistoryRow}`,children:[e.jsxs("div",{className:i.dataHistoryMain,children:[e.jsx("div",{className:i.dataHistoryTitle,children:s("settings.dataHistory.uiStudio.title","UI Studio history and screenshots")}),e.jsx("div",{className:i.dataHistoryDescription,children:s("settings.dataHistory.uiStudio.description","Saved UI Studio change records, screenshots, and cleanup policy.")})]}),e.jsx(d,{text:s("settings.dataHistory.uiStudio.metric.tooltip","UI Studio change record and capture counts, plus total disk usage."),children:e.jsx("div",{className:i.dataHistoryMetric,children:it(s,a)})}),e.jsxs("div",{className:i.dataHistoryActions,children:[e.jsx(d,{text:s("settings.dataHistory.open.tooltip","Open the page that shows this item in detail."),children:e.jsx("a",{className:i.linkButton,href:"#/ui-studio?tab=history",children:s("settings.dataHistory.open","Open")})}),e.jsx(d,{text:s("settings.dataHistory.clear.tooltip","Delete only the records saved for this item. Roblox Studio data is not changed."),children:e.jsx("button",{className:i.dangerButton,type:"button",disabled:!r,onClick:()=>y({kind:"uiStudio"}),children:s("common.clear","Clear")})})]})]}),e.jsx("div",{className:`${i.dataHistoryDetail} ${i.uiStudioDataHistoryDetail}`,children:e.jsx(et,{placeId:j,tier:t,onChanged:w,embedded:!0,...t==="basic"?{sampleUsage:te,sampleRetention:ve}:{}})})]}),_&&e.jsx("p",{className:i.inlineStatus,children:_})]})]}),e.jsx(he,{open:h!==null,title:T?s("settings.dataHistory.uiStudio.clear.title","Clear UI Studio saved data?"):s("settings.dataHistory.clear.title","Clear saved data?"),message:T?s("settings.dataHistory.uiStudio.clear.message","This deletes saved UI Studio change records and screenshots only. Roblox Studio instances and project objects are not changed."):s("settings.dataHistory.clear.message","This deletes saved dashboard records only. Roblox Studio instances and project objects are not changed."),cancelLabel:s("common.cancel","Cancel"),confirmLabel:s("common.clear","Clear"),loading:A,onCancel:()=>!A&&y(null),onConfirm:()=>void C()})]})}const ot={en:"English",ko:"한국어",es:"Español","pt-br":"Português (BR)",ja:"日本語",id:"Bahasa Indonesia",de:"Deutsch","fr-fr":"Français"};function lt(t){return t==="active"?i.statusActive:t==="grace"?i.statusGrace:t==="invalid"||t==="revoked"?i.statusError:i.statusInactive}function rt(t,s){return t.refreshBlockedReason==="missing_session_token"?{label:s("settings.license.status.activationRequired","Activation Required"),tooltip:s("settings.license.status.activationRequired.tooltip","Manual license activation is required before WEPPY Dashboard can refresh this status."),detail:s("settings.license.detail.missingSessionToken","Refresh is blocked because the current session token is missing."),detailTone:i.licenseNoticeWarning}:t.statusDetail==="active_cancel_pending"?{label:s("settings.license.active","Active"),tooltip:s("settings.license.status.activeCancelPending.tooltip","Cancellation is pending, but Pro access remains active until the current billing period ends."),detail:s("settings.license.detail.cancelPending","Cancellation is scheduled. Pro access remains active until the current billing period ends."),detailTone:i.licenseNoticeInfo}:t.statusDetail==="grace_provider_unavailable"?{label:s("settings.license.status.grace","Grace"),tooltip:s("settings.license.status.grace.tooltip","Provider verification is temporarily unavailable, but Pro access remains active during the grace period."),detail:s("settings.license.detail.graceProviderUnavailable","Provider unavailable. Pro access remains active during grace mode."),detailTone:i.licenseNoticeInfo}:t.statusDetail==="grace_expired"||t.statusDetail==="grace_payment_failed"?{label:s("settings.license.status.grace","Grace"),tooltip:s("settings.license.status.graceBilling.tooltip","Pro access is still available during a billing-related grace period."),detail:s("settings.license.detail.graceBilling","Pro access remains available during a billing grace period."),detailTone:i.licenseNoticeInfo}:{label:s(`settings.license.${t.status}`,t.status),tooltip:s(`settings.license.${t.status}.tooltip`,"Current license activation state."),detail:t.refreshRequired?s("settings.license.detail.refreshRecommended","License verification should be refreshed soon."):null,detailTone:i.licenseNoticeMuted}}function vt(){const{t,selectedLocale:s,setLocale:l}=V(),{trackEvent:x}=ae(),{search:o}=re(),{settings:N,license:a,licenseControlsDisabled:g,licenseSubmitting:p,licenseMessage:P,activateLicense:k,refreshLicense:B,resetLicense:S,loading:D}=ge(),[h,y]=u.useState(""),A=a?rt(a,t):null,R=(a==null?void 0:a.tier)==="pro",_=(a==null?void 0:a.tier)==="pro"?a.maskedKey:void 0,L=a!=null&&a.provider&&a.provider!=="auto"?a.provider:void 0,w=(a==null?void 0:a.tier)==="pro"?"pro":"basic",H=u.useRef(null),C=u.useRef(null),j=u.useMemo(()=>new URLSearchParams(o).get("section")==="license",[o]);return u.useEffect(()=>{var T;if(!j||D)return;const r=H.current;if((T=r==null?void 0:r.scrollIntoView)==null||T.call(r,{block:"start",behavior:"smooth"}),C.current&&!C.current.disabled){C.current.focus();return}r==null||r.focus()},[D,g,p,j]),D?e.jsx("div",{className:i.page,children:e.jsx("div",{className:i.loading,children:t("common.loading")})}):e.jsxs("div",{className:i.page,children:[e.jsx(pe,{title:t("page.settings.title","Settings"),description:t("page.settings.description","Manage license, saved data, server environment, and language."),helpTopicId:"settings",helpState:{tier:w}}),e.jsxs("div",{id:"settings-license",ref:H,tabIndex:-1,"data-testid":"settings-license-card",className:[i.card,j?i.licenseCardTarget:"",(a==null?void 0:a.tier)==="pro"?i.licenseCardPro:""].filter(Boolean).join(" "),children:[e.jsxs("div",{className:i.cardHeader,children:[e.jsx(v,{label:t("settings.license.title","License"),tooltip:t("settings.license.title.tooltip","Current license status and subscription tier.")}),e.jsx(d,{text:g?t("settings.license.disconnected.tooltip","Reconnect to the MCP server to manage license actions from WEPPY Dashboard."):t("settings.license.live.tooltip","License actions are sent to the MCP server immediately."),children:e.jsx("span",{className:`${i.headerBadge} ${g?"":i.headerBadgeLive}`,children:g?t("settings.license.disconnected","Disconnected"):t("settings.general.liveApply","Live Apply")})})]}),e.jsxs(e.Fragment,{children:[a?e.jsxs(e.Fragment,{children:[(()=>{const r=A;return e.jsxs(e.Fragment,{children:[e.jsxs("dl",{className:i.licenseGrid,children:[e.jsx("dt",{children:e.jsx(v,{label:t("settings.license.status","Status"),tooltip:t("settings.license.status.tooltip","Current license activation state.")})}),e.jsxs("dd",{children:[e.jsx("span",{className:`${i.statusDot} ${lt(a.status)}`}),e.jsx(d,{text:(r==null?void 0:r.tooltip)??t(`settings.license.${a.status}.tooltip`,"Current license activation state."),children:(r==null?void 0:r.label)??t(`settings.license.${a.status}`,a.status)})]}),e.jsx("dt",{children:e.jsx(v,{label:t("settings.license.tier","Tier"),tooltip:t("settings.license.tier.tooltip","Current subscription tier for available WEPPY Dashboard features.")})}),e.jsx("dd",{className:a.tier==="pro"?i.proBadge:"",children:e.jsx(d,{text:t(`tier.${a.tier}.tooltip`,"Available feature set for the connected license."),children:a.tier==="pro"?t("tier.pro","Pro"):t("tier.basic","Basic")})}),_&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(v,{label:t("settings.license.key","Key"),tooltip:t("settings.license.key.tooltip","Masked license key currently loaded by the server.")})}),e.jsx("dd",{children:e.jsx(d,{text:t("settings.license.keyValue.tooltip","Masked license key currently loaded by the server."),children:_})})]}),L&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(v,{label:t("settings.license.provider","Provider"),tooltip:t("settings.license.provider.tooltip","License provider used to validate this key.")})}),e.jsx("dd",{children:e.jsx(d,{text:t("settings.license.providerValue.tooltip","License provider used to validate this key."),children:L})})]})]}),(r==null?void 0:r.detail)&&e.jsx("p",{className:`${i.licenseNotice} ${r.detailTone}`,children:a.refreshBlockedReason==="missing_session_token"?t("settings.license.detail.manualActivation","Manual activation required to restore Pro access."):r.detail}),a.refreshBlockedReason==="missing_session_token"&&e.jsx("p",{className:`${i.licenseNotice} ${i.licenseNoticeMuted}`,children:r==null?void 0:r.detail})]})})(),a.tier==="basic"&&e.jsx(d,{text:t("tier.upgrade.tooltip","View Pro features and purchase options."),children:e.jsx("a",{className:i.upgradeLink,href:ce.settingsLicense,target:"_blank",rel:"noopener noreferrer",onClick:()=>x("dashboard_click_event",{click_target:"upgrade_cta",placement:"settings_license",page:"settings"}),children:t("tier.upgrade","View Pro")})})]}):e.jsx("div",{className:i.loading,children:t("settings.license.unavailable")}),e.jsxs("div",{className:i.licenseControls,children:[e.jsxs("div",{className:i.licenseControlRow,children:[e.jsx(d,{text:t("settings.license.refresh.tooltip","Re-fetch the current state from the license server. Useful when a billing change hasn't appeared yet."),children:e.jsx("button",{type:"button",className:i.actionBtn,disabled:g||p||!R,onClick:()=>{B()},children:p?t("common.loading"):t("settings.license.refresh","Refresh License")})}),e.jsx(d,{text:t("settings.license.reset.tooltip","Remove the currently registered license key. Use this before activating with a different key."),children:e.jsx("button",{type:"button",className:i.actionBtn,disabled:g||p||!R,onClick:()=>{S()},children:p?t("common.loading"):t("settings.license.reset","Reset License")})})]}),e.jsxs("div",{className:i.licenseControlRow,children:[e.jsxs("label",{className:`${i.licenseField} ${i.licenseFieldGrow}`,children:[e.jsx("span",{className:i.controlLabel,children:e.jsx(v,{label:t("settings.license.keyInput","License Key"),tooltip:t("settings.license.key.tooltip","Masked license key currently loaded by the server.")})}),e.jsx("input",{ref:C,"aria-label":t("settings.license.keyInput","License Key"),className:i.textInput,type:"text",value:h,disabled:g||p,onChange:r=>y(r.target.value)})]}),e.jsx(d,{text:t("settings.license.activate.tooltip","Activate Pro features with the entered license key."),children:e.jsx("button",{type:"button",className:i.actionBtn,disabled:g||p,onClick:()=>{(async()=>await k(h)&&y(""))()},children:p?t("common.loading"):t("settings.license.activate","Activate License")})})]}),P&&e.jsx("p",{className:i.licenseMessage,children:P})]})]})]}),e.jsx(nt,{tier:w}),e.jsxs("div",{className:i.card,children:[e.jsxs("div",{className:i.cardHeader,children:[e.jsx(v,{label:t("settings.cold.title","Server Environment"),tooltip:t("settings.cold.title.tooltip","Read-only server environment values loaded at startup.")}),e.jsx(d,{text:t("settings.readOnly.tooltip","This section shows values that cannot be edited from WEPPY Dashboard."),children:e.jsx("span",{className:i.headerBadge,children:t("settings.readOnly","Read-only")})})]}),N?e.jsxs(e.Fragment,{children:[e.jsxs("dl",{className:i.coldGrid,children:[e.jsx("dt",{children:e.jsx(v,{label:"HTTP_PORT",tooltip:t("settings.cold.httpPort.tooltip","Port number used by the MCP WEPPY Dashboard HTTP server.")})}),e.jsx("dd",{children:N.cold.HTTP_PORT}),e.jsx("dt",{children:e.jsx(v,{label:"HTTP_HOST",tooltip:t("settings.cold.httpHost.tooltip","Host interface that the MCP WEPPY Dashboard HTTP server binds to.")})}),e.jsx("dd",{children:N.cold.HTTP_HOST}),e.jsx("dt",{children:e.jsx(v,{label:"DASHBOARD_AUTO_OPEN",tooltip:t("settings.cold.dashboardAutoOpen.tooltip","Controls whether WEPPY Dashboard opens automatically in the browser when the server starts.")})}),e.jsx("dd",{children:e.jsx(d,{text:t("settings.cold.dashboardAutoOpen.value.tooltip","Current startup behavior for opening WEPPY Dashboard in a browser."),children:String(N.cold.DASHBOARD_AUTO_OPEN)})})]}),e.jsx("p",{className:i.coldHint,children:t("settings.cold.hint","Set via environment variables to change these values.")})]}):e.jsx("div",{className:i.loading,children:t("settings.unavailable")})]}),e.jsxs("div",{className:i.card,children:[e.jsx("div",{className:i.cardHeader,children:e.jsx(v,{label:t("settings.language.title","Language"),tooltip:t("settings.language.title.tooltip","Choose how the WEPPY Dashboard interface text is localized.")})}),e.jsxs("div",{className:i.langRow,children:[e.jsx("label",{children:e.jsx(v,{label:t("settings.language.dashboard","WEPPY Dashboard Language"),tooltip:t("settings.language.dashboard.tooltip","Overrides the WEPPY Dashboard language or follows the system language when set to Auto.")})}),e.jsx(d,{text:t("settings.language.auto.tooltip","Follow the operating system's language. Falls back to English when not supported."),children:e.jsxs("select",{className:i.select,value:s,onChange:r=>l(r.target.value),children:[e.jsx("option",{value:de,children:t("settings.language.auto","Auto")}),ue.map(r=>e.jsx("option",{value:r,children:ot[r]??r},r))]})})]})]})]})}export{vt as Component};
|
|
1
|
+
import{u as V,e as ae,r as u,j as e,g as le,a as I,d as re,T as ce,A as de,S as ue}from"./index-DYezp9b1.js";import{P as pe}from"./PageHeader-Do_AQ2vQ.js";import{I as v}from"./InfoLabel-DCq3Fmko.js";import{T as d}from"./TooltipText-CfI7WgY4.js";import{s as i,u as ge}from"./useSettings-HzhprVq7.js";import{C as he}from"./ConfirmModal-BCviiJ3_.js";import{D as ie,f as ne,r as me,s as ye,a as oe,d as K,S as te,b as ve}from"./sample-requests-CnV4bBG4.js";import"./ConfirmModal.module-NrFlfTWy.js";const xe="_card_1jlvt_4",je="_cardEmbedded_1jlvt_14",fe="_cardTitle_1jlvt_21",Se="_usageRow_1jlvt_30",be="_usageTotal_1jlvt_36",_e="_usageBreakdown_1jlvt_42",Ne="_usageCounts_1jlvt_47",Ce="_divider_1jlvt_53",ke="_lastRunRow_1jlvt_60",Re="_lastRunLabel_1jlvt_69",Le="_errorIcon_1jlvt_75",we="_tooltip_1jlvt_83",He="_cleanupRow_1jlvt_106",Pe="_cleanupLabel_1jlvt_113",Be="_cleanupBtn_1jlvt_120",De="_cleanupBtnDanger_1jlvt_143",Ae="_retentionSection_1jlvt_155",Te="_retentionTitle_1jlvt_161",Me="_retentionFieldset_1jlvt_170",Ee="_proOverlay_1jlvt_185",$e="_radioRow_1jlvt_197",Ie="_radioLabel_1jlvt_204",Ue="_presetGroup_1jlvt_224",ze="_presetBtn_1jlvt_232",Oe="_presetBtnActive_1jlvt_249",Fe="_freeInput_1jlvt_256",qe="_inputError_1jlvt_272",Ge="_inputUnit_1jlvt_276",We="_cascadeRow_1jlvt_283",Ye="_retentionActions_1jlvt_302",Ke="_saveBtn_1jlvt_308",Ve="_runNowBtn_1jlvt_330",Je="_errorMsg_1jlvt_353",n={card:xe,cardEmbedded:je,cardTitle:fe,usageRow:Se,usageTotal:be,usageBreakdown:_e,usageCounts:Ne,divider:Ce,lastRunRow:ke,lastRunLabel:Re,errorIcon:Le,tooltip:we,cleanupRow:He,cleanupLabel:Pe,cleanupBtn:Be,cleanupBtnDanger:De,retentionSection:Ae,retentionTitle:Te,retentionFieldset:Me,proOverlay:Ee,radioRow:$e,radioLabel:Ie,presetGroup:Ue,presetBtn:ze,presetBtnActive:Oe,freeInput:Fe,inputError:qe,inputUnit:Ge,cascadeRow:We,retentionActions:Ye,saveBtn:Ke,runNowBtn:Ve,errorMsg:Je};function Qe(t,s){return!!(t.mode==="off"&&s.mode!=="off"||t.mode==="age"&&s.mode==="age"&&(s.ageDays??0)<(t.ageDays??0)||t.mode==="size"&&s.mode==="size"&&(s.sizeMb??0)<(t.sizeMb??0)||!t.cascadeSnapshots&&s.cascadeSnapshots)}function se(t){return t.mode==="age"?Number.isInteger(t.ageDays)&&t.ageDays>=1&&t.ageDays<=365:t.mode==="size"?Number.isInteger(t.sizeMb)&&t.sizeMb>=50&&t.sizeMb<=1e4:!0}function Xe(t,s){return t.mode===s.mode&&t.ageDays===s.ageDays&&t.sizeMb===s.sizeMb&&t.cascadeSnapshots===s.cascadeSnapshots}function z(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:t<1024*1024*1024?`${(t/(1024*1024)).toFixed(1)} MB`:`${(t/(1024*1024*1024)).toFixed(2)} GB`}function Ze({placeId:t,tier:s,currentPolicy:l,onSaved:x}){const{t:o}=V(),{trackEvent:N}=ae(),[a,g]=u.useState(l),[p,P]=u.useState(()=>[7,14,30,90].includes(l.ageDays??-1)?"":String(l.ageDays??30)),[k,B]=u.useState(()=>[100,500,1e3].includes(l.sizeMb??-1)?"":String(l.sizeMb??500)),[S,D]=u.useState(null),[h,y]=u.useState(!1),[A,R]=u.useState(!1),[_,L]=u.useState(!1),[w,H]=u.useState(null);u.useEffect(()=>{g(l);const c=[7,14,30,90],b=[100,500,1e3];P(c.includes(l.ageDays??-1)?"":String(l.ageDays??30)),B(b.includes(l.sizeMb??-1)?"":String(l.sizeMb??500))},[l]);const C=s==="basic",j=se(a),r=Xe(l,a),T=j&&!r&&!A,f=c=>{g(b=>{const U={...b,mode:c};return c==="age"&&(U.ageDays=parseInt(p,10)||30),c==="size"&&(U.sizeMb=parseInt(k,10)||500),U})},m=c=>{P(""),g(b=>({...b,ageDays:c}))},O=c=>{B(""),g(b=>({...b,sizeMb:c}))},J=c=>{P(c);const b=parseInt(c,10);Number.isNaN(b)||g(U=>({...U,ageDays:b}))},E=c=>{B(c);const b=parseInt(c,10);Number.isNaN(b)||g(U=>({...U,sizeMb:b}))},Q=async()=>{if(H(null),N("dashboard_click_event",{click_target:"ui_studio_cleanup_save",page:"settings"}),Qe(l,a)){try{const c=await ne(t,{mode:a.mode,ageDays:a.ageDays,sizeMb:a.sizeMb,cascadeSnapshots:a.cascadeSnapshots});D(c.dryRun),y(!0)}catch(c){H(c.message)}return}await Y()},Y=async()=>{R(!0);try{await ye(t,a),y(!1),x()}catch(c){throw H(c.message),c}finally{R(!1)}},X=async()=>{H(null),N("dashboard_click_event",{click_target:"ui_studio_cleanup_run_now",page:"settings"}),L(!0);try{await me(t),x()}catch(c){H(c.message)}finally{L(!1)}},Z=S?`${o("uiStudio.cleanup.policy.confirm.messageStrict","이 정책으로 즉시")} ${S.wouldRemoveRequests}${o("uiStudio.cleanup.policy.confirm.requests","건")} / ${S.wouldRemoveSnapshots}${o("uiStudio.cleanup.policy.confirm.snapshots","개 화면 캡처")} / ${z(S.wouldFreeBytes)} ${o("uiStudio.cleanup.policy.confirm.freed","가 삭제됩니다 — 적용?")}`:"",$=a.mode==="age"&&!se(a),ee=a.mode==="size"&&!se(a);return e.jsxs("div",{className:n.retentionSection,children:[e.jsx("h3",{className:n.retentionTitle,children:e.jsx(v,{label:o("uiStudio.cleanup.policy.title","자동 삭제 정책"),tooltip:o("uiStudio.cleanup.policy.title.tooltip","Rules that automatically remove old or large captures.")})}),e.jsxs("div",{style:{position:"relative"},children:[C&&e.jsx("div",{className:n.proOverlay,title:o("uiStudio.cleanup.policy.proRequired","Pro에서 사용 가능"),children:e.jsx("div",{className:n.tooltip,children:o("uiStudio.cleanup.policy.proRequired","Pro에서 사용 가능")})}),e.jsxs("fieldset",{className:n.retentionFieldset,disabled:C,style:C?{opacity:.45,pointerEvents:"none"}:void 0,children:[e.jsx("div",{className:n.radioRow,children:e.jsx(d,{text:o("uiStudio.cleanup.policy.modeOff.tooltip","Turn off auto-cleanup. Data stays until you remove it manually."),children:e.jsxs("label",{className:n.radioLabel,children:[e.jsx("input",{type:"radio",name:"cleanupMode",value:"off",checked:a.mode==="off",onChange:()=>f("off")}),o("uiStudio.cleanup.policy.modeOff","사용 안 함 (off)")]})})}),e.jsxs("div",{children:[e.jsx("div",{className:n.radioRow,children:e.jsx(d,{text:o("uiStudio.cleanup.policy.modeAge.tooltip","Automatically delete data older than the configured number of days."),children:e.jsxs("label",{className:n.radioLabel,children:[e.jsx("input",{type:"radio",name:"cleanupMode",value:"age",checked:a.mode==="age",onChange:()=>f("age")}),o("uiStudio.cleanup.policy.modeAge","기간 기반 (age)")]})})}),a.mode==="age"&&e.jsxs("div",{className:n.presetGroup,children:[[7,14,30,90].map(c=>e.jsx(d,{text:o("uiStudio.cleanup.policy.agePreset.tooltip","Delete data older than this many days."),children:e.jsxs("button",{type:"button",className:`${n.presetBtn} ${a.ageDays===c&&p===""?n.presetBtnActive:""}`,onClick:()=>m(c),children:[c,o("uiStudio.cleanup.policy.daysUnit","일")]})},c)),e.jsx(d,{text:o("uiStudio.cleanup.policy.ageInput.tooltip","Enter any value between 1 and 365 days."),children:e.jsx("input",{type:"number",className:`${n.freeInput} ${$?n.inputError:""}`,value:p,min:1,max:365,onChange:c=>J(c.target.value)})}),e.jsxs("span",{className:n.inputUnit,children:["1–365",o("uiStudio.cleanup.policy.daysUnit","일")]})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:n.radioRow,children:e.jsx(d,{text:o("uiStudio.cleanup.policy.modeSize.tooltip","When total usage exceeds the limit, the oldest data is removed first."),children:e.jsxs("label",{className:n.radioLabel,children:[e.jsx("input",{type:"radio",name:"cleanupMode",value:"size",checked:a.mode==="size",onChange:()=>f("size")}),o("uiStudio.cleanup.policy.modeSize","용량 기반 (size)")]})})}),a.mode==="size"&&e.jsxs("div",{className:n.presetGroup,children:[[100,500,1e3].map(c=>e.jsx(d,{text:o("uiStudio.cleanup.policy.sizePreset.tooltip","Keep total usage under this size."),children:e.jsxs("button",{type:"button",className:`${n.presetBtn} ${a.sizeMb===c&&k===""?n.presetBtnActive:""}`,onClick:()=>O(c),children:[c,o("uiStudio.cleanup.policy.mbUnit","MB")]})},c)),e.jsx(d,{text:o("uiStudio.cleanup.policy.sizeInput.tooltip","Enter any value between 50 MB and 10000 MB (10 GB)."),children:e.jsx("input",{type:"number",className:`${n.freeInput} ${ee?n.inputError:""}`,value:k,min:50,max:1e4,onChange:c=>E(c.target.value)})}),e.jsxs("span",{className:n.inputUnit,children:["50–10000",o("uiStudio.cleanup.policy.mbUnit","MB")]})]})]}),e.jsx(d,{text:o("uiStudio.cleanup.policy.cascade.tooltip","Also delete the capture images linked to those records. If off, the images stay."),children:e.jsxs("label",{className:n.cascadeRow,children:[e.jsx("input",{type:"checkbox",checked:a.cascadeSnapshots,onChange:c=>g(b=>({...b,cascadeSnapshots:c.target.checked}))}),o("uiStudio.cleanup.policy.cascade","연결된 화면 캡처도 함께 삭제")]})}),e.jsxs("div",{className:n.retentionActions,children:[e.jsx(d,{text:o("uiStudio.cleanup.policy.save.tooltip","Save the current cleanup rule. It runs in the background from then on."),children:e.jsx("button",{type:"button",className:n.saveBtn,onClick:()=>void Q(),disabled:!T,children:o("uiStudio.cleanup.policy.save","정책 저장")})}),e.jsx(d,{text:o("uiStudio.cleanup.policy.runNow.tooltip","Run the current rule once now, without waiting for the next scheduled run."),children:e.jsx("button",{type:"button",className:n.runNowBtn,onClick:()=>void X(),disabled:_,children:o("uiStudio.cleanup.policy.runNow","지금 정리")})})]}),w&&e.jsx("div",{className:n.errorMsg,children:w})]})]}),h&&S&&e.jsx(ie,{title:o("uiStudio.cleanup.policy.confirm.title","정책 적용 확인"),message:Z,danger:!0,confirmLabel:o("uiStudio.cleanup.policy.save","정책 저장"),busy:A,onConfirm:Y,onClose:()=>y(!1)})]})}function et({placeId:t,tier:s,onChanged:l,sampleUsage:x,sampleRetention:o,embedded:N=!1}){const{t:a}=V(),g=s==="basic"&&x!=null&&o!=null,[p,P]=u.useState(g?x:null),[k,B]=u.useState(g?o:null),[S,D]=u.useState(null),[h,y]=u.useState(null),[A,R]=u.useState(null),_=u.useCallback(async()=>{if(!g&&t!=null){D(null);try{const[f,m]=await Promise.all([oe(t),ne(t)]);P(f),B(m.policy)}catch(f){D(f.message)}}},[t,g]);u.useEffect(()=>{_()},[_]);const L=u.useCallback(()=>{_(),l==null||l()},[_,l]),w=u.useCallback(async()=>{if(h&&t!=null){R(null);try{h.kind==="keep7"?await K(t,{olderThanDays:7,alsoSnapshots:!0}):h.kind==="keep30"?await K(t,{olderThanDays:30,alsoSnapshots:!0}):await K(t,{all:!0,alsoSnapshots:!0}),y(null),_(),l==null||l()}catch(f){throw R(f.message),f}}},[h,t,_,l]);function H(f){const m=a("uiStudio.cleanup.studioPreservedNote","This deletes saved change records and screenshots on disk only; Roblox Studio instances are not affected.");return f.kind==="keep7"?`${a("uiStudio.cleanup.cleanupConfirmMessage.keep7","7일 이전 변경 기록과 화면 캡처가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.")} ${m}`:f.kind==="keep30"?`${a("uiStudio.cleanup.cleanupConfirmMessage.keep30","30일 이전 변경 기록과 화면 캡처가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.")} ${m}`:`${((p==null?void 0:p.requestCount)??0)+((p==null?void 0:p.snapshotCount)??0)}${a("uiStudio.cleanup.cleanupConfirmMessage.all","개의 저장된 변경 기록과 화면 캡처가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.")} ${m}`}if(t==null&&!g)return null;if(S)return e.jsx("div",{className:`${n.card} ${N?n.cardEmbedded:""}`,children:e.jsx("p",{className:n.errorMsg,children:S})});if(!p||!k)return e.jsx("div",{className:`${n.card} ${N?n.cardEmbedded:""}`,children:e.jsx("p",{style:{fontSize:12,color:"var(--text-muted)",margin:0},children:a("uiStudio.storage.loading","로딩 중...")})});const C=k.lastRunAt,j=k.lastRunStats,r=C?new Date(C).toLocaleString():null,T=t??0;return e.jsxs("div",{className:`${n.card} ${N?n.cardEmbedded:""}`,children:[e.jsx("h3",{className:n.cardTitle,children:e.jsx(v,{label:a("uiStudio.storage.title","UI Studio 저장 데이터"),tooltip:a("uiStudio.storage.title.tooltip","Disk usage of UI Studio change records and screenshots.")})}),e.jsxs("div",{className:n.usageRow,children:[e.jsx(d,{text:a("uiStudio.storage.usageLabel.tooltip","Disk space currently used by UI Studio for this project."),children:e.jsxs("div",{className:n.usageTotal,children:[a("uiStudio.storage.usageLabel","사용 중")," ",z(p.totalBytes)]})}),e.jsxs("div",{className:n.usageBreakdown,children:[e.jsx(d,{text:a("uiStudio.storage.historyBytes.tooltip","Space taken by change record data (JSON)."),children:e.jsxs("span",{children:[a("uiStudio.storage.historyBytes","변경 이력")," ",z(p.historyBytes)]})})," · ",e.jsx(d,{text:a("uiStudio.storage.snapshotBytes.tooltip","Space taken by captured PNG image files."),children:e.jsxs("span",{children:[a("uiStudio.storage.snapshotBytes","화면 캡처")," ",z(p.snapshotBytes)]})})]}),e.jsxs("div",{className:n.usageCounts,children:[e.jsx(d,{text:a("uiStudio.storage.requestCount.tooltip","Number of actions where AI changed the UI."),children:e.jsxs("span",{children:[a("uiStudio.storage.requestCount","변경 기록")," ",p.requestCount.toLocaleString(),a("uiStudio.storage.countSuffix","개")]})})," · ",e.jsx(d,{text:a("uiStudio.storage.mutationCount.tooltip","Number of detail changes inside actions (one property edit = 1)."),children:e.jsxs("span",{children:[a("uiStudio.storage.mutationCount","변경 상세")," ",p.mutationCount.toLocaleString(),a("uiStudio.storage.countSuffix","개")]})})," · ",e.jsx(d,{text:a("uiStudio.storage.snapshotCount.tooltip","Number of saved capture image files."),children:e.jsxs("span",{children:[a("uiStudio.storage.snapshotCount","화면 캡처")," ",p.snapshotCount.toLocaleString(),a("uiStudio.storage.countSuffix","개")]})})]})]}),e.jsx("hr",{className:n.divider}),e.jsx(Ze,{placeId:T,tier:s,currentPolicy:k,onSaved:L}),e.jsx("hr",{className:n.divider}),e.jsxs("div",{className:n.lastRunRow,children:[e.jsx("span",{className:n.lastRunLabel,children:e.jsx(v,{label:a("uiStudio.storage.lastRun","마지막 자동 정리"),tooltip:a("uiStudio.storage.lastRun.tooltip","When the auto-cleanup policy last ran, and what it removed.")})}),r?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:r}),j&&e.jsxs("span",{children:["· ",a("uiStudio.storage.requestCount","변경 기록")," ",j.removedRequests,a("uiStudio.storage.countSuffix","개")," / ",a("uiStudio.storage.snapshotCount","화면 캡처")," ",j.removedSnapshots,a("uiStudio.storage.countSuffix","개")," / ",z(j.freedBytes)," ",a("uiStudio.storage.lastRunFreed","회수")]}),j&&j.errors>0&&e.jsxs("span",{className:n.errorIcon,title:`${a("uiStudio.storage.lastRunErrors","오류")} ${j.errors}건`,children:["⚠",e.jsxs("span",{className:n.tooltip,children:[a("uiStudio.storage.lastRunErrors","오류")," ",j.errors,a("uiStudio.storage.countSuffix","건")]})]})]}):e.jsx("span",{children:a("uiStudio.storage.lastRunNever","—")})]}),e.jsx("hr",{className:n.divider}),e.jsxs("div",{className:n.cleanupRow,children:[e.jsx("span",{className:n.cleanupLabel,children:e.jsx(v,{label:a("uiStudio.cleanup.label","수동 정리"),tooltip:a("uiStudio.cleanup.label.tooltip","Manually clean up change records and captures whenever you want.")})}),e.jsx(d,{text:a("uiStudio.cleanup.keep7.tooltip","Delete change records and captures older than 7 days."),children:e.jsx("button",{type:"button",className:n.cleanupBtn,onClick:()=>y({kind:"keep7"}),disabled:s==="basic",children:a("uiStudio.cleanup.keepLastNDays","최근 7일만 남기기").replace("{n}","7")})}),e.jsx(d,{text:a("uiStudio.cleanup.keep30.tooltip","Delete change records and captures older than 30 days."),children:e.jsx("button",{type:"button",className:n.cleanupBtn,onClick:()=>y({kind:"keep30"}),disabled:s==="basic",children:a("uiStudio.cleanup.keepLastNDays","최근 30일만 남기기").replace("{n}","30")})}),e.jsx(d,{text:a("uiStudio.cleanup.deleteAll.tooltip","Delete every change record and capture for this project. The actual UI in Roblox Studio is not affected."),children:e.jsx("button",{type:"button",className:`${n.cleanupBtn} ${n.cleanupBtnDanger}`,onClick:()=>y({kind:"all"}),disabled:s==="basic",children:a("uiStudio.cleanup.deleteAll","전체 삭제…")})})]}),A&&e.jsx("div",{className:n.errorMsg,children:A}),h&&e.jsx(ie,{title:a("uiStudio.cleanup.cleanupConfirmTitle","정리 확인"),message:H(h),danger:!0,confirmLabel:a("common.delete","삭제"),onConfirm:w,onClose:()=>{y(null),R(null)}})]})}const tt={toolsActivity:null,toolStats:null,toolSessions:null,syncLog:null,playtestReports:null,projectChanges:null,connectionLog:null},st={toolsActivity:null,toolStats:null,syncLog:null,playtestReports:null,projectChanges:null,connectionLog:null};function at(t){var s;return t?t.pluginConnected?t.activePlaceId:t.lastActivePlaceId??((s=t.places[0])==null?void 0:s.placeId)??null:null}async function M(t){try{return await t}catch{return null}}function G(t){return t?typeof t.total=="number"?t.total:Array.isArray(t.entries)?t.entries.length:null:null}function W(t,s,l,x){return s===null?t("settings.dataHistory.metric.unavailable","Unavailable"):`${s.toLocaleString()} ${t(l,x)}`}function F(t,s,l){const x=l===null?t("settings.dataHistory.metric.sizeUnavailable","size unavailable"):z(l);return`${s} · ${x}`}function q(t,s){var x;const l=(x=t==null?void 0:t[s])==null?void 0:x.bytes;return typeof l=="number"&&Number.isFinite(l)?l:null}function it(t,s){return s?[`${s.requestCount.toLocaleString()} ${t("uiStudio.storage.requestCount","change records")}`,`${s.snapshotCount.toLocaleString()} ${t("uiStudio.storage.snapshotCount","screenshots")}`,z(s.totalBytes)].join(" · "):t("settings.dataHistory.metric.unavailable","Unavailable")}function nt({tier:t}){const{t:s}=V(),[l,x]=u.useState(tt),[o,N]=u.useState(st),[a,g]=u.useState(t==="basic"?te:null),[p,P]=u.useState(null),[k,B]=u.useState(!0),[S,D]=u.useState(!0),[h,y]=u.useState(null),[A,R]=u.useState(!1),[_,L]=u.useState(null),w=u.useCallback(async()=>{B(!0);const m=await M(le()),O=at(m);P(O);const[J,E,Q,Y,X,Z,$]=await Promise.all([M(I.get("/api/dashboard/history",{limit:"1",offset:"0"})),M(I.get("/api/dashboard/tool-stats")),M(I.get("/sync/history",{limit:"1",offset:"0"})),M(I.get("/api/dashboard/playtest/history")),M(I.get("/api/dashboard/changelog",{limit:"1",offset:"0"})),M(I.get("/api/dashboard/connection-log")),M(I.get("/api/dashboard/storage-summary"))]),ee=t==="basic"?te:O===null?null:await M(oe(O));x({toolsActivity:G(J),toolStats:(E==null?void 0:E.totalCalls)??null,toolSessions:(E==null?void 0:E.totalSessions)??null,syncLog:G(Q),playtestReports:G(Y),projectChanges:G(X),connectionLog:G(Z)}),N({toolsActivity:q($,"toolsActivity"),toolStats:q($,"toolStats"),syncLog:q($,"syncLog"),playtestReports:q($,"playtestReports"),projectChanges:q($,"projectChanges"),connectionLog:q($,"connectionLog")}),g(ee),B(!1)},[t]);u.useEffect(()=>{w()},[w]);const H=u.useMemo(()=>[{key:"toolsActivity",title:s("settings.dataHistory.toolsActivity.title","Tool activity"),description:s("settings.dataHistory.toolsActivity.description","Saved tool runs shown on the Tools page."),metric:F(s,W(s,l.toolsActivity,"settings.dataHistory.metric.records","records"),o.toolsActivity),metricTooltip:s("settings.dataHistory.toolsActivity.metric.tooltip","Number of saved tool runs and the disk space they use."),route:"/tools",clearEndpoint:"/api/dashboard/tools/history/clear"},{key:"toolStats",title:s("settings.dataHistory.toolStats.title","Tool usage statistics"),description:s("settings.dataHistory.toolStats.description","Aggregated tool counts and status totals."),metric:F(s,l.toolStats===null?s("settings.dataHistory.metric.unavailable","Unavailable"):`${l.toolStats.toLocaleString()} ${s("settings.dataHistory.metric.runs","runs")} · ${(l.toolSessions??0).toLocaleString()} ${s("settings.dataHistory.metric.sessions","sessions")}`,o.toolStats),metricTooltip:s("settings.dataHistory.toolStats.metric.tooltip","Aggregated total runs and session counts."),route:"/tools",clearEndpoint:"/api/dashboard/tools/statistics/clear"},{key:"syncLog",title:s("settings.dataHistory.syncLog.title","Sync log"),description:s("settings.dataHistory.syncLog.description","Saved file sync events for the active place."),metric:F(s,W(s,l.syncLog,"settings.dataHistory.metric.records","records"),o.syncLog),metricTooltip:s("settings.dataHistory.syncLog.metric.tooltip","Number of saved sync events and the disk space they use."),route:"/sync",clearEndpoint:"/api/dashboard/sync/history/clear"},{key:"playtestReports",title:s("settings.dataHistory.playtest.title","Playtest reports"),description:s("settings.dataHistory.playtest.description","Saved automated playtest reports and logs."),metric:F(s,W(s,l.playtestReports,"settings.dataHistory.metric.reports","reports"),o.playtestReports),metricTooltip:s("settings.dataHistory.playtestReports.metric.tooltip","Number of saved playtest reports and the disk space they use."),route:"/playtest",clearEndpoint:"/api/dashboard/playtest/history/clear"},{key:"projectChanges",title:s("settings.dataHistory.projectChanges.title","Project change summary"),description:s("settings.dataHistory.projectChanges.description","Saved summaries of project changes."),metric:F(s,W(s,l.projectChanges,"settings.dataHistory.metric.records","records"),o.projectChanges),metricTooltip:s("settings.dataHistory.projectChanges.metric.tooltip","Number of saved project change summaries and the disk space they use."),route:"/changelog",clearEndpoint:"/api/dashboard/changelog/clear"},{key:"connectionLog",title:s("settings.dataHistory.connectionLog.title","Connection log"),description:s("settings.dataHistory.connectionLog.description","Saved MCP and Studio connection events."),metric:F(s,W(s,l.connectionLog,"settings.dataHistory.metric.records","records"),o.connectionLog),metricTooltip:s("settings.dataHistory.connectionLog.metric.tooltip","Number of saved connection events and the disk space they use."),route:"/connection",clearEndpoint:"/api/dashboard/connection-log/clear"}],[l,o,s]),C=async()=>{if(h){R(!0),L(null);try{if(h.kind==="uiStudio"){if(t!=="pro"||p===null)throw new Error("UI Studio place is unavailable");await K(p,{all:!0,alsoSnapshots:!0}),L(s("settings.dataHistory.uiStudio.clear.success","UI Studio saved data cleared."))}else await I.post(h.row.clearEndpoint),L(s("settings.dataHistory.clear.success","Saved data cleared."));y(null),await w()}catch{L(h.kind==="uiStudio"?s("settings.dataHistory.uiStudio.clear.failed","Failed to clear UI Studio saved data."):s("settings.dataHistory.clear.failed","Failed to clear saved data."))}finally{R(!1)}}},j=t==="pro"?p:0,r=t==="pro"&&p!==null,T=(h==null?void 0:h.kind)==="uiStudio",f=s("settings.dataHistory.title","Data & History");return e.jsxs(e.Fragment,{children:[e.jsxs("section",{id:"data-history",className:i.card,children:[e.jsxs("div",{className:i.cardHeader,children:[e.jsx(v,{label:s("settings.dataHistory.title","Data & History"),tooltip:s("settings.dataHistory.title.tooltip","Manage saved dashboard data in one place.")}),e.jsxs("div",{className:i.cardHeaderActions,children:[e.jsx(d,{text:s("settings.dataHistory.scope.tooltip","Clear actions apply to the current project and active place where applicable."),children:e.jsx("span",{className:i.headerBadge,children:k?s("common.loading","Loading"):s("settings.dataHistory.scope","Current project")})}),e.jsx(d,{text:s("settings.dataHistory.toggle.tooltip","Collapse or expand this section."),children:e.jsx("button",{className:i.collapseButton,type:"button","aria-expanded":S,"aria-controls":"settings-data-history-body","aria-label":S?s("settings.dataHistory.collapse","Collapse {title}").replace("{title}",f):s("settings.dataHistory.expand","Expand {title}").replace("{title}",f),onClick:()=>D(m=>!m),children:S?"▾":"▸"})})]})]}),S&&e.jsxs("div",{id:"settings-data-history-body",children:[e.jsx("p",{className:i.dataHistoryIntro,children:s("settings.dataHistory.intro","Review saved dashboard data, open the related page, or clear stored records from one place.")}),e.jsxs("div",{className:i.dataHistoryList,children:[H.map(m=>e.jsxs("div",{className:i.dataHistoryRow,children:[e.jsxs("div",{className:i.dataHistoryMain,children:[e.jsx("div",{className:i.dataHistoryTitle,children:m.title}),e.jsx("div",{className:i.dataHistoryDescription,children:m.description})]}),e.jsx(d,{text:m.metricTooltip,children:e.jsx("div",{className:i.dataHistoryMetric,children:m.metric})}),e.jsxs("div",{className:i.dataHistoryActions,children:[e.jsx(d,{text:s("settings.dataHistory.open.tooltip","Open the page that shows this item in detail."),children:e.jsx("a",{className:i.linkButton,href:`#${m.route}`,children:s("settings.dataHistory.open","Open")})}),e.jsx(d,{text:s("settings.dataHistory.clear.tooltip","Delete only the records saved for this item. Roblox Studio data is not changed."),children:e.jsx("button",{className:i.dangerButton,type:"button",onClick:()=>y({kind:"row",row:m}),children:s("common.clear","Clear")})})]})]},m.key)),e.jsxs("div",{className:`${i.dataHistoryRow} ${i.uiStudioDataHistoryRow}`,children:[e.jsxs("div",{className:i.dataHistoryMain,children:[e.jsx("div",{className:i.dataHistoryTitle,children:s("settings.dataHistory.uiStudio.title","UI Studio history and screenshots")}),e.jsx("div",{className:i.dataHistoryDescription,children:s("settings.dataHistory.uiStudio.description","Saved UI Studio change records, screenshots, and cleanup policy.")})]}),e.jsx(d,{text:s("settings.dataHistory.uiStudio.metric.tooltip","UI Studio change record and capture counts, plus total disk usage."),children:e.jsx("div",{className:i.dataHistoryMetric,children:it(s,a)})}),e.jsxs("div",{className:i.dataHistoryActions,children:[e.jsx(d,{text:s("settings.dataHistory.open.tooltip","Open the page that shows this item in detail."),children:e.jsx("a",{className:i.linkButton,href:"#/ui-studio?tab=history",children:s("settings.dataHistory.open","Open")})}),e.jsx(d,{text:s("settings.dataHistory.clear.tooltip","Delete only the records saved for this item. Roblox Studio data is not changed."),children:e.jsx("button",{className:i.dangerButton,type:"button",disabled:!r,onClick:()=>y({kind:"uiStudio"}),children:s("common.clear","Clear")})})]})]}),e.jsx("div",{className:`${i.dataHistoryDetail} ${i.uiStudioDataHistoryDetail}`,children:e.jsx(et,{placeId:j,tier:t,onChanged:w,embedded:!0,...t==="basic"?{sampleUsage:te,sampleRetention:ve}:{}})})]}),_&&e.jsx("p",{className:i.inlineStatus,children:_})]})]}),e.jsx(he,{open:h!==null,title:T?s("settings.dataHistory.uiStudio.clear.title","Clear UI Studio saved data?"):s("settings.dataHistory.clear.title","Clear saved data?"),message:T?s("settings.dataHistory.uiStudio.clear.message","This deletes saved UI Studio change records and screenshots only. Roblox Studio instances and project objects are not changed."):s("settings.dataHistory.clear.message","This deletes saved dashboard records only. Roblox Studio instances and project objects are not changed."),cancelLabel:s("common.cancel","Cancel"),confirmLabel:s("common.clear","Clear"),loading:A,onCancel:()=>!A&&y(null),onConfirm:()=>void C()})]})}const ot={en:"English",ko:"한국어",es:"Español","pt-br":"Português (BR)",ja:"日本語",id:"Bahasa Indonesia",de:"Deutsch","fr-fr":"Français"};function lt(t){return t==="active"?i.statusActive:t==="grace"?i.statusGrace:t==="invalid"||t==="revoked"?i.statusError:i.statusInactive}function rt(t,s){return t.refreshBlockedReason==="missing_session_token"?{label:s("settings.license.status.activationRequired","Activation Required"),tooltip:s("settings.license.status.activationRequired.tooltip","Manual license activation is required before WEPPY Dashboard can refresh this status."),detail:s("settings.license.detail.missingSessionToken","Refresh is blocked because the current session token is missing."),detailTone:i.licenseNoticeWarning}:t.statusDetail==="active_cancel_pending"?{label:s("settings.license.active","Active"),tooltip:s("settings.license.status.activeCancelPending.tooltip","Cancellation is pending, but Pro access remains active until the current billing period ends."),detail:s("settings.license.detail.cancelPending","Cancellation is scheduled. Pro access remains active until the current billing period ends."),detailTone:i.licenseNoticeInfo}:t.statusDetail==="grace_provider_unavailable"?{label:s("settings.license.status.grace","Grace"),tooltip:s("settings.license.status.grace.tooltip","Provider verification is temporarily unavailable, but Pro access remains active during the grace period."),detail:s("settings.license.detail.graceProviderUnavailable","Provider unavailable. Pro access remains active during grace mode."),detailTone:i.licenseNoticeInfo}:t.statusDetail==="grace_expired"||t.statusDetail==="grace_payment_failed"?{label:s("settings.license.status.grace","Grace"),tooltip:s("settings.license.status.graceBilling.tooltip","Pro access is still available during a billing-related grace period."),detail:s("settings.license.detail.graceBilling","Pro access remains available during a billing grace period."),detailTone:i.licenseNoticeInfo}:{label:s(`settings.license.${t.status}`,t.status),tooltip:s(`settings.license.${t.status}.tooltip`,"Current license activation state."),detail:t.refreshRequired?s("settings.license.detail.refreshRecommended","License verification should be refreshed soon."):null,detailTone:i.licenseNoticeMuted}}function vt(){const{t,selectedLocale:s,setLocale:l}=V(),{trackEvent:x}=ae(),{search:o}=re(),{settings:N,license:a,licenseControlsDisabled:g,licenseSubmitting:p,licenseMessage:P,activateLicense:k,refreshLicense:B,resetLicense:S,loading:D}=ge(),[h,y]=u.useState(""),A=a?rt(a,t):null,R=(a==null?void 0:a.tier)==="pro",_=(a==null?void 0:a.tier)==="pro"?a.maskedKey:void 0,L=a!=null&&a.provider&&a.provider!=="auto"?a.provider:void 0,w=(a==null?void 0:a.tier)==="pro"?"pro":"basic",H=u.useRef(null),C=u.useRef(null),j=u.useMemo(()=>new URLSearchParams(o).get("section")==="license",[o]);return u.useEffect(()=>{var T;if(!j||D)return;const r=H.current;if((T=r==null?void 0:r.scrollIntoView)==null||T.call(r,{block:"start",behavior:"smooth"}),C.current&&!C.current.disabled){C.current.focus();return}r==null||r.focus()},[D,g,p,j]),D?e.jsx("div",{className:i.page,children:e.jsx("div",{className:i.loading,children:t("common.loading")})}):e.jsxs("div",{className:i.page,children:[e.jsx(pe,{title:t("page.settings.title","Settings"),description:t("page.settings.description","Manage license, saved data, server environment, and language."),helpTopicId:"settings",helpState:{tier:w}}),e.jsxs("div",{id:"settings-license",ref:H,tabIndex:-1,"data-testid":"settings-license-card",className:[i.card,j?i.licenseCardTarget:"",(a==null?void 0:a.tier)==="pro"?i.licenseCardPro:""].filter(Boolean).join(" "),children:[e.jsxs("div",{className:i.cardHeader,children:[e.jsx(v,{label:t("settings.license.title","License"),tooltip:t("settings.license.title.tooltip","Current license status and subscription tier.")}),e.jsx(d,{text:g?t("settings.license.disconnected.tooltip","Reconnect to the MCP server to manage license actions from WEPPY Dashboard."):t("settings.license.live.tooltip","License actions are sent to the MCP server immediately."),children:e.jsx("span",{className:`${i.headerBadge} ${g?"":i.headerBadgeLive}`,children:g?t("settings.license.disconnected","Disconnected"):t("settings.general.liveApply","Live Apply")})})]}),e.jsxs(e.Fragment,{children:[a?e.jsxs(e.Fragment,{children:[(()=>{const r=A;return e.jsxs(e.Fragment,{children:[e.jsxs("dl",{className:i.licenseGrid,children:[e.jsx("dt",{children:e.jsx(v,{label:t("settings.license.status","Status"),tooltip:t("settings.license.status.tooltip","Current license activation state.")})}),e.jsxs("dd",{children:[e.jsx("span",{className:`${i.statusDot} ${lt(a.status)}`}),e.jsx(d,{text:(r==null?void 0:r.tooltip)??t(`settings.license.${a.status}.tooltip`,"Current license activation state."),children:(r==null?void 0:r.label)??t(`settings.license.${a.status}`,a.status)})]}),e.jsx("dt",{children:e.jsx(v,{label:t("settings.license.tier","Tier"),tooltip:t("settings.license.tier.tooltip","Current subscription tier for available WEPPY Dashboard features.")})}),e.jsx("dd",{className:a.tier==="pro"?i.proBadge:"",children:e.jsx(d,{text:t(`tier.${a.tier}.tooltip`,"Available feature set for the connected license."),children:a.tier==="pro"?t("tier.pro","Pro"):t("tier.basic","Basic")})}),_&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(v,{label:t("settings.license.key","Key"),tooltip:t("settings.license.key.tooltip","Masked license key currently loaded by the server.")})}),e.jsx("dd",{children:e.jsx(d,{text:t("settings.license.keyValue.tooltip","Masked license key currently loaded by the server."),children:_})})]}),L&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(v,{label:t("settings.license.provider","Provider"),tooltip:t("settings.license.provider.tooltip","License provider used to validate this key.")})}),e.jsx("dd",{children:e.jsx(d,{text:t("settings.license.providerValue.tooltip","License provider used to validate this key."),children:L})})]})]}),(r==null?void 0:r.detail)&&e.jsx("p",{className:`${i.licenseNotice} ${r.detailTone}`,children:a.refreshBlockedReason==="missing_session_token"?t("settings.license.detail.manualActivation","Manual activation required to restore Pro access."):r.detail}),a.refreshBlockedReason==="missing_session_token"&&e.jsx("p",{className:`${i.licenseNotice} ${i.licenseNoticeMuted}`,children:r==null?void 0:r.detail})]})})(),a.tier==="basic"&&e.jsx(d,{text:t("tier.upgrade.tooltip","View Pro features and purchase options."),children:e.jsx("a",{className:i.upgradeLink,href:ce.settingsLicense,target:"_blank",rel:"noopener noreferrer",onClick:()=>x("dashboard_click_event",{click_target:"upgrade_cta",placement:"settings_license",page:"settings"}),children:t("tier.upgrade","View Pro")})})]}):e.jsx("div",{className:i.loading,children:t("settings.license.unavailable")}),e.jsxs("div",{className:i.licenseControls,children:[e.jsxs("div",{className:i.licenseControlRow,children:[e.jsx(d,{text:t("settings.license.refresh.tooltip","Re-fetch the current state from the license server. Useful when a billing change hasn't appeared yet."),children:e.jsx("button",{type:"button",className:i.actionBtn,disabled:g||p||!R,onClick:()=>{B()},children:p?t("common.loading"):t("settings.license.refresh","Refresh License")})}),e.jsx(d,{text:t("settings.license.reset.tooltip","Remove the currently registered license key. Use this before activating with a different key."),children:e.jsx("button",{type:"button",className:i.actionBtn,disabled:g||p||!R,onClick:()=>{S()},children:p?t("common.loading"):t("settings.license.reset","Reset License")})})]}),e.jsxs("div",{className:i.licenseControlRow,children:[e.jsxs("label",{className:`${i.licenseField} ${i.licenseFieldGrow}`,children:[e.jsx("span",{className:i.controlLabel,children:e.jsx(v,{label:t("settings.license.keyInput","License Key"),tooltip:t("settings.license.key.tooltip","Masked license key currently loaded by the server.")})}),e.jsx("input",{ref:C,"aria-label":t("settings.license.keyInput","License Key"),className:i.textInput,type:"text",value:h,disabled:g||p,onChange:r=>y(r.target.value)})]}),e.jsx(d,{text:t("settings.license.activate.tooltip","Activate Pro features with the entered license key."),children:e.jsx("button",{type:"button",className:i.actionBtn,disabled:g||p,onClick:()=>{(async()=>await k(h)&&y(""))()},children:p?t("common.loading"):t("settings.license.activate","Activate License")})})]}),P&&e.jsx("p",{className:i.licenseMessage,children:P})]})]})]}),e.jsx(nt,{tier:w}),e.jsxs("div",{className:i.card,children:[e.jsxs("div",{className:i.cardHeader,children:[e.jsx(v,{label:t("settings.cold.title","Server Environment"),tooltip:t("settings.cold.title.tooltip","Read-only server environment values loaded at startup.")}),e.jsx(d,{text:t("settings.readOnly.tooltip","This section shows values that cannot be edited from WEPPY Dashboard."),children:e.jsx("span",{className:i.headerBadge,children:t("settings.readOnly","Read-only")})})]}),N?e.jsxs(e.Fragment,{children:[e.jsxs("dl",{className:i.coldGrid,children:[e.jsx("dt",{children:e.jsx(v,{label:"HTTP_PORT",tooltip:t("settings.cold.httpPort.tooltip","Port number used by the MCP WEPPY Dashboard HTTP server.")})}),e.jsx("dd",{children:N.cold.HTTP_PORT}),e.jsx("dt",{children:e.jsx(v,{label:"HTTP_HOST",tooltip:t("settings.cold.httpHost.tooltip","Host interface that the MCP WEPPY Dashboard HTTP server binds to.")})}),e.jsx("dd",{children:N.cold.HTTP_HOST}),e.jsx("dt",{children:e.jsx(v,{label:"DASHBOARD_AUTO_OPEN",tooltip:t("settings.cold.dashboardAutoOpen.tooltip","Controls whether WEPPY Dashboard opens automatically in the browser when the server starts.")})}),e.jsx("dd",{children:e.jsx(d,{text:t("settings.cold.dashboardAutoOpen.value.tooltip","Current startup behavior for opening WEPPY Dashboard in a browser."),children:String(N.cold.DASHBOARD_AUTO_OPEN)})})]}),e.jsx("p",{className:i.coldHint,children:t("settings.cold.hint","Set via environment variables to change these values.")})]}):e.jsx("div",{className:i.loading,children:t("settings.unavailable")})]}),e.jsxs("div",{className:i.card,children:[e.jsx("div",{className:i.cardHeader,children:e.jsx(v,{label:t("settings.language.title","Language"),tooltip:t("settings.language.title.tooltip","Choose how the WEPPY Dashboard interface text is localized.")})}),e.jsxs("div",{className:i.langRow,children:[e.jsx("label",{children:e.jsx(v,{label:t("settings.language.dashboard","WEPPY Dashboard Language"),tooltip:t("settings.language.dashboard.tooltip","Overrides the WEPPY Dashboard language or follows the system language when set to Auto.")})}),e.jsx(d,{text:t("settings.language.auto.tooltip","Follow the operating system's language. Falls back to English when not supported."),children:e.jsxs("select",{className:i.select,value:s,onChange:r=>l(r.target.value),children:[e.jsx("option",{value:de,children:t("settings.language.auto","Auto")}),ue.map(r=>e.jsx("option",{value:r,children:ot[r]??r},r))]})})]})]})]})}export{vt as Component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as o,j as s}from"./index-
|
|
1
|
+
import{u as o,j as s}from"./index-DYezp9b1.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,4 +1,4 @@
|
|
|
1
|
-
import{r as l,a as P,D as E,e as R,d as $,m as A,j as t,u as D,f as O,h as B,l as H,k as M,T as F}from"./index-
|
|
1
|
+
import{r as l,a as P,D as E,e as R,d as $,m as A,j as t,u as D,f as O,h as B,l as H,k as M,T as F}from"./index-DYezp9b1.js";import{P as U}from"./PageHeader-Do_AQ2vQ.js";import{I as _}from"./InfoLabel-DCq3Fmko.js";import{T as b}from"./TooltipText-CfI7WgY4.js";import{C as W}from"./ConfirmModal-BCviiJ3_.js";import{C as S}from"./CurrentPlaceScope-CHEqGWYd.js";import{S as q}from"./StatusBadge-DRbLpCd0.js";import"./ConfirmModal.module-NrFlfTWy.js";const G=5e3;function z(){const[e,i]=l.useState(null),[c,o]=l.useState([]),[d,r]=l.useState(!0),[y,w]=l.useState(null),m=l.useRef(null),g=l.useRef(null),p=l.useCallback(async()=>{var u;try{const[T,I]=await Promise.all([P.get("/sync/status"),P.get("/api/dashboard/place-summary")]);i(T);const a=(u=I.places)==null?void 0:u.find(j=>j.isActive);w((a==null?void 0:a.placeDirName)??null)}catch{}},[]),f=l.useCallback(async()=>{try{const u=await P.get("/sync/history",{limit:"30"});o(u.entries??[])}catch{o([])}},[]),x=l.useCallback(async()=>{await Promise.all([p(),f()]),r(!1)},[p,f]),N=l.useCallback(()=>{x()},[x]),n=l.useCallback(async()=>{await P.post("/api/dashboard/sync/history/clear"),o([]),p()},[p]);return l.useEffect(()=>(x(),g.current=setInterval(x,G),()=>{g.current&&clearInterval(g.current)}),[x]),l.useEffect(()=>{const u=new E;m.current=u,u.connect();const T=u.on("sync",()=>{p(),f()});return()=>{T(),u.disconnect(),m.current=null}},[p,f]),{status:e,history:c,loading:d,activePlaceDirName:y,refresh:N,clearHistory:n}}const V="_actions_1j3p3_60",Y="_btn_1j3p3_68",J="_btnPrimary_1j3p3_99",Q="_panel_1j3p3_109",X="_panelIcon_1j3p3_116",Z="_panelTitle_1j3p3_122",K="_panelDesc_1j3p3_131",ee="_benefitList_1j3p3_139",te="_benefitItem_1j3p3_148",h={actions:V,btn:Y,btnPrimary:J,panel:Q,panelIcon:X,panelTitle:Z,panelDesc:K,benefitList:ee,benefitItem:te};function se({icon:e,title:i,description:c,benefits:o,upgradeLabel:d,upgradeHref:r}){const{trackEvent:y}=R(),{pathname:w,search:m}=$(),g=A(w,m);return t.jsxs("div",{className:h.panel,children:[e&&t.jsx("div",{className:h.panelIcon,children:e}),t.jsx("div",{className:h.panelTitle,children:i}),t.jsx("div",{className:h.panelDesc,children:c}),t.jsx("ul",{className:h.benefitList,children:o.map(p=>t.jsx("li",{className:h.benefitItem,children:p},p))}),t.jsx("div",{className:h.actions,children:t.jsx("a",{className:`${h.btn} ${h.btnPrimary}`,href:r,target:"_blank",rel:"noreferrer",onClick:()=>y("dashboard_click_event",{click_target:"upgrade_cta",placement:"tier_panel",...g}),children:d})})]})}const ne="_page_siyu4_2",ie="_card_siyu4_10",ae="_cardHeader_siyu4_17",ce="_clearButton_siyu4_29",oe="_statusRow_siyu4_39",le="_metaItem_siyu4_46",re="_statusGrid_siyu4_52",de="_table_siyu4_71",pe="_directionRail_siyu4_99",ue="_endpointLabel_siyu4_105",ye="_optionRail_siyu4_109",_e="_directionOption_siyu4_115",he="_directionOptionActive_siyu4_129",me="_directionOptionInactive_siyu4_133",ge="_direction_forward_siyu4_139",fe="_direction_bidirectional_siyu4_143",xe="_direction_reverse_siyu4_147",be="_lockBadge_siyu4_152",je="_proBadge_siyu4_160",ve="_forwardBadge_siyu4_174",we="_logContainer_siyu4_187",Te="_logEntry_siyu4_194",Ne="_logTime_siyu4_206",Pe="_logType_siyu4_212",Ie="_logTypeWrite_siyu4_221",Ce="_logTypeUpdate_siyu4_225",Le="_logTypeDelete_siyu4_229",Se="_logTypeIdle_siyu4_233",ke="_logPath_siyu4_237",Re="_logEmpty_siyu4_244",Ee="_overlay_siyu4_251",$e="_overlayTitle_siyu4_261",Ae="_overlayMessage_siyu4_268",De="_checklist_siyu4_274",Oe="_checkItem_siyu4_284",Be="_upgradePanel_siyu4_300",He="_upgradePanelHeader_siyu4_307",Me="_benefitList_siyu4_315",Fe="_benefitItem_siyu4_324",Ue="_upgradeActions_siyu4_339",We="_btn_siyu4_344",qe="_btnPrimary_siyu4_361",Ge="_disabled_siyu4_372",s={page:ne,card:ie,cardHeader:ae,clearButton:ce,statusRow:oe,metaItem:le,statusGrid:re,table:de,directionRail:pe,endpointLabel:ue,optionRail:ye,directionOption:_e,directionOptionActive:he,directionOptionInactive:me,direction_forward:ge,direction_bidirectional:fe,direction_reverse:xe,lockBadge:be,proBadge:je,forwardBadge:ve,logContainer:we,logEntry:Te,logTime:Ne,logType:Pe,logTypeWrite:Ie,logTypeUpdate:Ce,logTypeDelete:Le,logTypeIdle:Se,logPath:ke,logEmpty:Re,overlay:Ee,overlayTitle:$e,overlayMessage:Ae,checklist:De,checkItem:Oe,upgradePanel:Be,upgradePanelHeader:He,benefitList:Me,benefitItem:Fe,upgradeActions:Ue,btn:We,btnPrimary:qe,disabled:Ge},ze=[{key:"forward",symbol:"←"},{key:"bidirectional",symbol:"↔"},{key:"reverse",symbol:"→"}];function Ve(e){const i=new Date(e);return`${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}`}function Ye(e){switch(e){case"write":return s.logTypeWrite;case"update":return s.logTypeUpdate;case"delete":return s.logTypeDelete;default:return s.logTypeIdle}}function Je(e){switch(e){case"syncing":return"syncing";case"initializing":return"initializing";case"idle":return"idle";default:return"offline"}}function Qe(e,i,c,o){const d=e(`sync.directions.cat.${i}`,i.charAt(0).toUpperCase()+i.slice(1)),r=e("sync.directions.endpoint.local","Local"),y=e("sync.directions.endpoint.studio","Studio");switch(c){case"forward":return[`${d}: ${r} <- ${y}`,e("sync.directions.tooltip.forward.body","Studio changes sync to local files only")].join(`
|
|
2
2
|
`);case"bidirectional":return[`${d}: ${r} <-> ${y}`,e("sync.directions.tooltip.bidirectional.body","Two-way sync between Local and Studio"),o?e("sync.directions.tooltip.proRequired","Pro required in Basic tier"):""].filter(Boolean).join(`
|
|
3
3
|
`);case"reverse":return[`${d}: ${r} -> ${y}`,e("sync.directions.tooltip.reverse.body","Push local file changes to Studio"),o?e("sync.directions.tooltip.proRequired","Pro required in Basic tier"):""].filter(Boolean).join(`
|
|
4
4
|
`);default:return d}}const Xe=["scripts","values","containers","data","services"];function Ze(e,i){return i==="manual"?e("sync.directions.mode.manual","Manual"):i==="auto"?e("sync.directions.mode.auto","Auto"):"-"}function k(...e){const i=e[0]??"",c=i.includes("\\")&&!i.includes("/")?"\\":"/";return e.filter(o=>o.length>0).map((o,d)=>d===0?o.replace(/[\\/]+$/g,""):o.replace(/^[\\/]+|[\\/]+$/g,"")).join(c)}function Ke(e){const i=e.replace(/[\\/]+$/g,""),c=i.split(/[\\/]+/);return c[c.length-1]??i}function et(e,i){const c=Ke(e);return c==="explorer"?e:c===i?k(e,"explorer"):k(e,i,"explorer")}function tt(e,i){return i==="manual"?e("sync.directions.mode.manual.tooltip","Applies sync changes only when you trigger them manually."):i==="auto"?e("sync.directions.mode.auto.tooltip","Applies sync changes automatically when updates arrive."):""}function st(e,i){switch(i){case"write":return e("sync.log.type.write","WRITE");case"update":return e("sync.log.type.update","UPDATE");case"delete":return e("sync.log.type.delete","DELETE");default:return e("sync.log.type.idle","IDLE")}}function nt(e,i){switch(i){case"write":return e("sync.log.type.write.tooltip","A new sync output was written to disk.");case"update":return e("sync.log.type.update.tooltip","An existing synced file or instance was updated.");case"delete":return e("sync.log.type.delete.tooltip","A synced file or instance was removed.");default:return e("sync.log.type.idle.tooltip","A sync event was recorded without a file mutation.")}}function ut(){const{t:e}=D(),{trackEvent:i}=R(),{level:c}=O(),{tier:o,loading:d}=B(),r=z(),{show:y}=H(),[w,m]=l.useState(!1),[g,p]=l.useState(!1),f=!d&&o==="basic",x=c==="disconnected"||c==="serverOnly",N=t.jsx(U,{title:e("page.sync.title","Sync"),description:e("page.sync.description","Monitor Studio to local sync status, direction, apply mode, and recent sync logs."),helpTopicId:"sync",helpState:{connectionLevel:c,tier:o}});if(x)return t.jsxs("div",{className:s.page,children:[N,t.jsx(S,{surface:"sync"}),t.jsx("div",{className:s.card,children:t.jsxs("div",{className:s.overlay,children:[t.jsx("div",{className:s.overlayTitle,children:e("sync.overlay.title","Roblox Studio plugin required")}),t.jsx("div",{className:s.overlayMessage,children:e("sync.overlay.message","Sync status will be available once the Roblox Studio plugin connects.")}),t.jsxs("ul",{className:s.checklist,children:[t.jsx("li",{className:s.checkItem,children:e("sync.overlay.check1","Is Roblox Studio running?")}),t.jsx("li",{className:s.checkItem,children:e("sync.overlay.check2","Is the WEPPY Plugin installed?")})]})]})})]});const n=r.status,u=r.history,T=Je(n==null?void 0:n.state),I=async()=>{p(!0);try{await r.clearHistory(),y(e("toast.clearSuccess","Cleared successfully"),"success"),m(!1)}catch{y(e("toast.clearFailed","Failed to clear data"),"error")}finally{p(!1)}};return t.jsxs("div",{className:s.page,children:[N,t.jsx(S,{surface:"sync"}),t.jsxs("div",{className:s.card,children:[t.jsxs("div",{className:s.cardHeader,children:[t.jsx(b,{text:e("sync.status.title.tooltip","Current Studio and local file sync status for this place."),children:e("sync.status.title","Sync Status")}),f&&t.jsx(b,{text:e("sync.status.forwardOnly.tooltip","Basic tier allows Studio to local forward sync only."),children:t.jsx("span",{className:s.forwardBadge,children:e("sync.status.forwardOnly","Forward Only")})})]}),t.jsxs("div",{className:s.statusRow,children:[t.jsx(q,{status:T}),(n==null?void 0:n.placeName)&&t.jsxs("span",{className:s.metaItem,children:[t.jsx(_,{label:e("sync.status.place","Place"),tooltip:e("sync.status.place.tooltip","Connected Roblox place name and place ID.")}),": ",n.placeName,n.placeId?` (${n.placeId})`:""]})]}),t.jsxs("dl",{className:s.statusGrid,children:[(n==null?void 0:n.syncRoot)&&t.jsxs(t.Fragment,{children:[t.jsx("dt",{children:t.jsx(_,{label:e("sync.status.path","Place Root"),tooltip:e("sync.status.path.tooltip","Local filesystem root currently used for this place sync output.")})}),t.jsx("dd",{children:n.syncRoot})]}),r.activePlaceDirName&&(n==null?void 0:n.syncRoot)&&t.jsxs(t.Fragment,{children:[t.jsx("dt",{children:t.jsx(_,{label:e("sync.status.placePath","Explorer Path"),tooltip:e("sync.status.placePath.tooltip","Explorer files path for the active place.")})}),t.jsx("dd",{children:et(n.syncRoot,r.activePlaceDirName)})]}),(n==null?void 0:n.instanceCount)!=null&&t.jsxs(t.Fragment,{children:[t.jsx("dt",{children:t.jsx(_,{label:e("sync.status.instances","Instances"),tooltip:e("sync.status.instances.tooltip","Total synced Roblox instances tracked in the local mirror.")})}),t.jsx("dd",{children:n.instanceCount})]}),(n==null?void 0:n.scriptCount)!=null&&t.jsxs(t.Fragment,{children:[t.jsx("dt",{children:t.jsx(_,{label:e("sync.status.scripts","Scripts"),tooltip:e("sync.status.scripts.tooltip","Total synced script files currently indexed for this place.")})}),t.jsx("dd",{children:n.scriptCount})]}),(n==null?void 0:n.state)==="syncing"&&t.jsxs(t.Fragment,{children:[t.jsx("dt",{children:t.jsx(_,{label:e("sync.status.state","State"),tooltip:e("sync.status.state.tooltip","Current runtime sync state reported by the server.")})}),t.jsx("dd",{children:e("status.syncing","Syncing")})]})]})]}),(n==null?void 0:n.directions)&&t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:t.jsx(b,{text:e("sync.directions.title.tooltip","Per-category sync direction and apply behavior between Local and Studio."),children:e("sync.directions.title","Sync Directions")})}),t.jsxs("table",{className:s.table,children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{children:t.jsx(_,{label:e("sync.directions.type","Type"),tooltip:e("sync.directions.type.tooltip","Sync category affected by this rule.")})}),t.jsx("th",{children:t.jsx(_,{label:e("sync.directions.direction","Direction"),tooltip:e("sync.directions.direction.tooltip","Whether each category syncs from Studio, to Studio, or both ways.")})}),t.jsx("th",{children:t.jsx(_,{label:e("sync.directions.applyMode","Apply Mode"),tooltip:e("sync.directions.applyMode.tooltip","How incoming sync changes are applied for this category.")})})]})}),t.jsx("tbody",{children:Xe.map(a=>{var L;const j=n.directions[a],C=(L=n.applyModes)==null?void 0:L[a];return t.jsxs("tr",{children:[t.jsx("td",{children:e(`sync.directions.cat.${a}`,a.charAt(0).toUpperCase()+a.slice(1))}),t.jsx("td",{children:t.jsxs("div",{className:s.directionRail,"aria-label":`${a}-direction-rail`,children:[t.jsx(b,{text:e("sync.directions.endpoint.local.tooltip","Local files on disk are always shown on the left side of the direction rail."),children:t.jsx("span",{className:s.endpointLabel,children:e("sync.directions.endpoint.local","Local")})}),t.jsx("span",{className:s.optionRail,children:ze.map(v=>t.jsx(M,{text:Qe(e,a,v.key,f),children:t.jsx("span",{className:`${s.directionOption} ${j===v.key?s.directionOptionActive:s.directionOptionInactive} ${s[`direction_${v.key}`]??""}`,"data-active":j===v.key?"true":"false",children:v.symbol})},v.key))}),t.jsx(b,{text:e("sync.directions.endpoint.studio.tooltip","Roblox Studio is always shown on the right side of the direction rail."),children:t.jsx("span",{className:s.endpointLabel,children:e("sync.directions.endpoint.studio","Studio")})})]})}),t.jsx("td",{children:t.jsx(b,{text:tt(e,C),children:Ze(e,C)})})]},a)})})]})]}),t.jsxs("div",{className:s.card,children:[t.jsxs("div",{className:s.cardHeader,children:[t.jsx("span",{children:e("sync.log.title","Sync Log")}),t.jsx("button",{className:s.clearButton,onClick:()=>{i("dashboard_click_event",{click_target:"sync_clear_log",page:"sync"}),m(!0)},children:e("common.clear","Clear")})]}),t.jsx("div",{className:s.logContainer,children:u.length===0?t.jsx("div",{className:s.logEmpty,children:e("sync.log.empty","No sync events yet")}):u.map((a,j)=>t.jsxs("div",{className:s.logEntry,children:[t.jsx("span",{className:s.logTime,children:Ve(a.timestamp)}),t.jsx(b,{text:nt(e,a.type),children:t.jsx("span",{className:`${s.logType} ${Ye(a.type)}`,children:st(e,a.type)})}),t.jsxs("span",{className:s.logPath,children:[a.path,a.details?` — ${a.details}`:""]})]},j))})]}),f&&t.jsx(se,{title:e("sync.upgrade.title","Explore Full Sync with Pro"),description:e("tier.banner.save","Save AI tokens with Pro!"),benefits:[e("sync.upgrade.benefit1","Bidirectional sync — edit files, auto-apply to Studio"),e("sync.upgrade.benefit2","Reverse sync — push file changes back to Studio"),e("sync.upgrade.benefit3","Full sync history and detailed change log")],upgradeLabel:e("sync.upgrade.buy","View Pro"),upgradeHref:F.sync}),t.jsx(W,{open:w,title:e("sync.clear.title","Clear sync log?"),message:e("sync.clear.message","This permanently removes the stored sync log for the current place."),cancelLabel:e("common.cancel","Cancel"),confirmLabel:e("common.clear","Clear"),loading:g,onCancel:()=>!g&&m(!1),onConfirm:I})]})}export{ut as Component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./index-
|
|
1
|
+
import{j as s}from"./index-DYezp9b1.js";const r="_tabBar_1o4kh_2",_="_tabs_1o4kh_9",d="_actions_1o4kh_14",k="_tab_1o4kh_2",h="_tabActive_1o4kh_39",a={tabBar:r,tabs:_,actions:d,tab:k,tabActive:h};function v({items:n,value:c,onChange:l,ariaLabel:b,className:i,rightActions:e}){return s.jsxs("div",{className:[a.tabBar,i].filter(Boolean).join(" "),role:"tablist","aria-label":b,children:[s.jsx("div",{className:a.tabs,children:n.map(t=>{const o=t.key===c;return s.jsx("button",{type:"button",role:"tab","aria-selected":o,"data-testid":t.testId,className:[a.tab,o?a.tabActive:""].filter(Boolean).join(" "),onClick:()=>l(t.key),children:t.label},t.key)})}),e?s.jsx("div",{className:a.actions,children:e}):null]})}export{v as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s,r as n,a as F,D as nt,u as ct,e as dt,l as ut}from"./index-B9LVK3-K.js";import{P as pt}from"./PageHeader-Cqg4GMtU.js";import{T as M}from"./TooltipText-ZamrETeK.js";import{C as xt}from"./ConfirmModal-C9EhZCHZ.js";import{C as ht}from"./CurrentPlaceScope-BMyP2w7Z.js";import{T as mt}from"./Tabs-B8mbzhmZ.js";import"./ConfirmModal.module-NrFlfTWy.js";const bt="_wrapper_hzgda_2",ft="_table_hzgda_7",gt="_sortable_hzgda_32",_t="_sortArrow_hzgda_41",yt="_clickable_hzgda_52",Ct="_empty_hzgda_57",jt="_expandedRow_hzgda_65",vt="_expandedCell_hzgda_74",T={wrapper:bt,table:ft,sortable:gt,sortArrow:_t,clickable:yt,empty:Ct,expandedRow:jt,expandedCell:vt};function kt({columns:t,data:a,sortBy:b,sortDir:P="asc",onSort:B,onRowClick:i,rowKey:v,emptyMessage:k,expandedKey:E,renderExpandedRow:N}){return s.jsx("div",{className:T.wrapper,children:s.jsxs("table",{className:T.table,children:[s.jsx("thead",{children:s.jsx("tr",{children:t.map(u=>s.jsxs("th",{style:u.width?{width:u.width}:void 0,className:u.sortable?T.sortable:void 0,onClick:u.sortable&&B?()=>B(u.key):void 0,children:[s.jsx("span",{children:u.label}),u.sortable&&b===u.key&&s.jsx("span",{className:T.sortArrow,children:P==="asc"?"▴":"▾"})]},u.key))})}),s.jsx("tbody",{children:a.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:t.length,className:T.empty,children:k||"No data"})}):a.map((u,R)=>{const L=v?v(u):String(R),x=E!=null&&L===E&&N?N(u):null;return s.jsxs(n.Fragment,{children:[s.jsx("tr",{className:i?T.clickable:void 0,onClick:i?()=>i(u):void 0,children:t.map(C=>s.jsx("td",{children:C.render?C.render(u):String(u[C.key]??"")},C.key))}),x&&s.jsx("tr",{className:T.expandedRow,children:s.jsx("td",{colSpan:t.length,className:T.expandedCell,children:x})})]},L)})})]})})}function St(t){return{...t,sequenceNumber:typeof t.sequenceNumber=="number"?t.sequenceNumber:void 0,executionTimeMs:typeof t.executionTimeMs=="number"?t.executionTimeMs:void 0}}const Tt=50;function Nt(t){if(typeof t=="number")return{placeId:String(t)}}function Z(t,a){return typeof a!="number"?t:`${t}?placeId=${encodeURIComponent(String(a))}`}function wt(t){const a=(t==null?void 0:t.placeId)??null,[b,P]=n.useState(null),[B,i]=n.useState(!0),[v,k]=n.useState([]),[E,N]=n.useState(0),[u,R]=n.useState(!1),[L,y]=n.useState(!0),[x,C]=n.useState(0),[f,I]=n.useState(""),$=n.useRef(null),h=n.useCallback(async()=>{i(!0);try{const c=Nt(a),j=c?await F.get("/api/dashboard/tool-stats",c):await F.get("/api/dashboard/tool-stats");P(j)}catch{}finally{i(!1)}},[a]),_=n.useCallback(async(c,j)=>{y(!0);try{const O={limit:String(Tt),offset:String(c)};j&&(O.tool=j),typeof a=="number"&&(O.placeId=String(a));const A=await F.get("/api/dashboard/history",O);k(A.entries.map(St)),N(A.total),R(A.hasMore)}catch{k([]),N(0),R(!1)}finally{y(!1)}},[a]),U=n.useCallback(()=>{h(),_(x,f)},[_,h,x,f]),V=n.useCallback(async()=>{await F.post(Z("/api/dashboard/tools/history/clear",a)),_(x,f)},[_,x,f,a]),q=n.useCallback(async()=>{await F.post(Z("/api/dashboard/tools/statistics/clear",a)),h()},[h,a]);return n.useEffect(()=>{h()},[h]),n.useEffect(()=>{_(x,f)},[_,x,f]),n.useEffect(()=>{const c=new nt;$.current=c,c.connect();const j=c.on("command",()=>{h(),_(x,f)});return()=>{j(),c.disconnect(),$.current=null}},[_,h,x,f]),{statistics:b,statsLoading:B,history:v,historyTotal:E,historyHasMore:u,historyLoading:L,historyOffset:x,historyToolFilter:f,setHistoryOffset:C,setHistoryToolFilter:I,refresh:U,clearHistory:V,clearStatistics:q}}const Mt="_page_16x6v_2",Pt="_card_16x6v_12",Bt="_cardToolbar_16x6v_19",Et="_sectionTitle_16x6v_27",Rt="_dangerButton_16x6v_33",Lt="_proBadge_16x6v_52",It="_statusOk_16x6v_67",At="_statusFallback_16x6v_76",Ht="_statusUnsupported_16x6v_85",Ot="_statusWarning_16x6v_94",Ft="_statusError_16x6v_103",$t="_tierBasic_16x6v_113",qt="_tierPro_16x6v_117",Dt="_tierMixed_16x6v_122",Wt="_filterRow_16x6v_133",zt="_filterLabel_16x6v_140",Ut="_filterSelect_16x6v_149",Vt="_expandedRow_16x6v_160",Kt="_expandedSection_16x6v_165",Gt="_detailList_16x6v_175",Jt="_detailItem_16x6v_181",Qt="_detailLabel_16x6v_187",Zt="_detailValue_16x6v_192",Xt="_pre_16x6v_197",Yt="_pagination_16x6v_214",te="_pageInfo_16x6v_222",ee="_btn_16x6v_228",se="_tierDistribution_16x6v_251",oe="_tierBarWrap_16x6v_255",ae="_tierBarBasic_16x6v_263",re="_tierBarPro_16x6v_268",le="_tierLabels_16x6v_273",ie="_statsTableWrap_16x6v_282",ne="_statsTable_16x6v_282",ce="_sortableHeader_16x6v_313",de="_sortArrow_16x6v_318",ue="_statsToolRow_16x6v_322",pe="_statsActionRow_16x6v_330",xe="_expandButton_16x6v_334",he="_expandIcon_16x6v_346",me="_actionLabel_16x6v_351",be="_emptyStats_16x6v_358",fe="_summaryLine_16x6v_364",o={page:Mt,card:Pt,cardToolbar:Bt,sectionTitle:Et,dangerButton:Rt,proBadge:Lt,statusOk:It,statusFallback:At,statusUnsupported:Ht,statusWarning:Ot,statusError:Ft,tierBasic:$t,tierPro:qt,tierMixed:Dt,filterRow:Wt,filterLabel:zt,filterSelect:Ut,expandedRow:Vt,expandedSection:Kt,detailList:Gt,detailItem:Jt,detailLabel:Qt,detailValue:Zt,pre:Xt,pagination:Yt,pageInfo:te,btn:ee,tierDistribution:se,tierBarWrap:oe,tierBarBasic:ae,tierBarPro:re,tierLabels:le,statsTableWrap:ie,statsTable:ne,sortableHeader:ce,sortArrow:de,statsToolRow:ue,statsActionRow:pe,expandButton:xe,expandIcon:he,actionLabel:me,emptyStats:be,summaryLine:fe},K=50,ge=new Set(["clientId","placeId","pinnedTarget","recentPriority","globalQueue"]);function _e(t){const a=new Date(t);return`${String(a.getHours()).padStart(2,"0")}:${String(a.getMinutes()).padStart(2,"0")}:${String(a.getSeconds()).padStart(2,"0")}`}function z(t){return typeof t!="number"||!Number.isFinite(t)?"-":t<1e3?`${t}ms`:`${(t/1e3).toFixed(1)}s`}function H(t,a){return a==="pro"?t("tier.pro","Pro"):a==="mixed"?t("tier.mixed","Mixed"):t("tier.basic","Basic")}function tt(t,a){return a!==t&&a.startsWith(`${t}_`)?a.slice(t.length+1):""}function ye(t,a){const b=tt(t,a);return b?`${t}.${b}`:t}function X(t){return typeof t=="string"&&t.length>0?t:void 0}function Ce(t){if(!Array.isArray(t))return;const a=t.filter(b=>typeof b=="string"&&b.length>0);return a.length>0?a:void 0}function je(t){const a=t.result??{};return{requestedCommand:t.requestedCommand??X(a.requestedCommand),executedCommand:t.executedCommand??X(a.executedCommand),alternatives:t.alternatives??Ce(a.alternatives)}}function ve(t,a){switch(t.status){case"fallback":return{label:a("tools.badge.fallback","FALLBACK"),tooltip:a("tools.badge.fallback.tooltip","The requested Pro action succeeded via a Basic fallback."),className:o.statusFallback};case"unsupported":return{label:a("tools.badge.unsupported","UNSUPPORTED"),tooltip:a("tools.badge.unsupported.tooltip","The requested Pro action was blocked and no fallback ran."),className:o.statusUnsupported};case"warning":return{label:a("tools.badge.warn","WARN"),tooltip:a("tools.badge.warn.tooltip","The tool call failed as an expected caller, project, policy, or user-code issue."),className:o.statusWarning};case"error":return{label:a("tools.badge.err","FAILED"),tooltip:a("tools.badge.err.tooltip","The tool run failed."),className:o.statusError};default:return{label:a("tools.status.ok","OK"),tooltip:a("tools.status.ok.tooltip","The tool run completed successfully."),className:o.statusOk}}}function g(t,a){return s.jsxs("div",{className:o.detailItem,children:[s.jsx("span",{className:o.detailLabel,children:t}),s.jsx("span",{className:o.detailValue,children:a})]})}function ke(t){if(!t||typeof t!="object")return;const a=t;if(typeof a.selectionMode=="string"&&ge.has(a.selectionMode))return a}function Y(t){if(!(!t||typeof t!="object"||!("routing"in t)))return ke(t.routing)}function Se(t){return t.routing??Y(t.result)??Y(t.data)}function Te(t,a){return t.requestedClientId?t.requestedClientId:t.requestedPlaceId!==void 0?t.requestedPlaceId:a("tools.history.routing.none","No Studio target named")}function Ne(t){return t.actualPlaceName?`${t.actualPlaceName} · ${t.actualPlaceId??"-"}`:t.actualClientId??"-"}function Ae(){const{t}=ct(),{trackEvent:a,trackPageView:b}=dt(),[P,B]=n.useState(null),i=wt({placeId:P}),{show:v}=ut(),[k,E]=n.useState("history"),[N,u]=n.useState(null),[R,L]=n.useState(null),[y,x]=n.useState(null),[C,f]=n.useState(!1),[I,$]=n.useState("totalCalls"),[h,_]=n.useState("desc"),U=n.useCallback(e=>{$(r=>r===e?(_(l=>l==="asc"?"desc":"asc"),e):(_("desc"),e))},[]),V=n.useMemo(()=>{var r;const e=new Set;return Object.keys(((r=i.statistics)==null?void 0:r.tools)??{}).forEach(l=>e.add(l)),i.history.forEach(l=>{l.tool&&e.add(l.tool)}),i.historyToolFilter&&e.add(i.historyToolFilter),Array.from(e).sort()},[i.history,i.historyToolFilter,i.statistics]),q=n.useMemo(()=>{var e;return(e=i.statistics)!=null&&e.tools?Object.values(i.statistics.tools).map(r=>{var Q;const l=Object.entries(r.commands??{}).map(([p,d])=>({toolName:r.tool,commandName:d.command??p,label:tt(r.tool,d.command??p)||(d.command??p),tier:d.tier,totalCalls:d.totalCalls,successCount:d.successCount,fallbackCount:d.fallbackCount,unsupportedCount:d.unsupportedCount,warningCount:d.warningCount??0,failureCount:d.failureCount,totalExecutionTimeMs:d.totalExecutionTimeMs,avgExecutionTimeMs:d.avgExecutionTimeMs})),m=l.reduce((p,d)=>p+d.totalCalls,0),S=l.reduce((p,d)=>p+d.successCount,0),D=l.reduce((p,d)=>p+d.fallbackCount,0),W=l.reduce((p,d)=>p+d.unsupportedCount,0),rt=l.reduce((p,d)=>p+d.warningCount,0),lt=l.reduce((p,d)=>p+d.failureCount,0),J=l.reduce((p,d)=>p+d.totalExecutionTimeMs,0),it=new Set(l.map(p=>p.tier)).size>1?"mixed":((Q=l[0])==null?void 0:Q.tier)??r.tier;return{toolName:r.tool,tier:it,commands:l,totalCalls:m,successCount:S,fallbackCount:D,unsupportedCount:W,warningCount:rt,failureCount:lt,totalExecutionTimeMs:J,avgExecutionTimeMs:m>0?Math.round(J/m):0}}):[]},[i.statistics]),c=n.useCallback((e,r,l,m)=>s.jsx(M,{text:t(l,m),children:t(e,r)}),[t]),j=n.useMemo(()=>[...q].sort((r,l)=>{const m=r[I],S=l[I];if(typeof m=="number"&&typeof S=="number")return h==="asc"?m-S:S-m;const D=String(m??""),W=String(S??"");return h==="asc"?D.localeCompare(W):W.localeCompare(D)}),[q,I,h]),O=n.useMemo(()=>[{key:"timestamp",label:c("tools.col.time","Time","tools.col.time.tooltip","When the tool run was recorded."),width:"80px",render:e=>_e(e.timestamp)},{key:"toolName",label:c("tools.col.toolAction","Tool.Action","tools.col.toolAction.tooltip","Tool name and action that were executed."),render:e=>s.jsxs("span",{children:[ye(e.tool,e.command),e.tier==="pro"&&s.jsx(M,{text:t("tools.badge.pro.tooltip","This entry used a Pro-only tool or action."),children:s.jsx("span",{className:o.proBadge,children:t("tools.badge.pro","PRO")})})]})},{key:"executionTimeMs",label:c("tools.col.duration","Duration","tools.col.duration.tooltip","How long the tool took to finish."),width:"80px",render:e=>z(e.executionTimeMs)},{key:"status",label:c("tools.col.status","Status","tools.col.status.tooltip","Outcome of the recorded tool run."),width:"120px",render:e=>{const r=ve(e,t);return s.jsx(M,{text:r.tooltip,children:s.jsx("span",{className:r.className,children:r.label})})}},{key:"tier",label:c("tools.col.tier","Tier","tools.col.tier.tooltip","License tier required for the tool or action."),width:"60px",render:e=>s.jsx("span",{className:e.tier==="pro"?o.tierPro:o.tierBasic,children:H(t,e.tier)})}],[t,c]),A=n.useMemo(()=>[{key:"toolName",label:c("tools.col.tool","Tool","tools.col.tool.tooltip","Consolidated tool name in the statistics table."),sortable:!0},{key:"totalCalls",label:c("tools.col.calls","Calls","tools.col.calls.tooltip","Total number of recorded calls for this tool."),sortable:!0,width:"70px"},{key:"successCount",label:c("tools.col.ok","OK","tools.col.ok.tooltip","Number of direct successful runs."),sortable:!0,width:"70px"},{key:"fallbackCount",label:c("tools.col.fallback","FALLBACK","tools.col.fallback.tooltip","Number of runs that succeeded through fallback execution."),sortable:!0,width:"110px"},{key:"unsupportedCount",label:c("tools.col.unsupported","UNSUPPORTED","tools.col.unsupported.tooltip","Number of blocked runs without fallback execution."),sortable:!0,width:"130px"},{key:"warningCount",label:c("tools.col.warn","WARN","tools.col.warn.tooltip","Number of expected failures caused by caller input, project state, Roblox policy, or user code."),sortable:!0,width:"80px"},{key:"failureCount",label:c("tools.col.err","FAILED","tools.col.err.tooltip","Number of runs that failed."),sortable:!0,width:"70px"},{key:"avgExecutionTimeMs",label:c("tools.col.avgTime","Avg Time","tools.col.avgTime.tooltip","Average execution time across recorded calls."),sortable:!0,width:"90px",render:e=>z(e.avgExecutionTimeMs)},{key:"tier",label:c("tools.col.tier","Tier","tools.col.tierStats.tooltip","Basic, Pro, or Mixed summary for the tool statistics row."),sortable:!0,width:"70px",render:e=>s.jsx(M,{text:e.tier==="mixed"?t("tools.tier.mixed.tooltip","This tool includes both Basic and Pro actions."):"",children:s.jsx("span",{className:e.tier==="pro"?o.tierPro:e.tier==="mixed"?o.tierMixed:o.tierBasic,children:H(t,e.tier)})})}],[t,c]),w=n.useMemo(()=>{if(!i.statistics)return null;const e=i.statistics.tierSummary.basic.totalCalls,r=i.statistics.tierSummary.pro.totalCalls,l=e+r;if(l===0)return null;const m=Math.round(e/l*100),S=100-m;return{basic:e,pro:r,basicPct:m,proPct:S}},[i.statistics]),G=n.useCallback(e=>{L(r=>r===e?null:e)},[]),et=n.useCallback(async()=>{if(y){f(!0);try{y==="history"?await i.clearHistory():await i.clearStatistics(),v(t("toast.clearSuccess","Cleared successfully"),"success"),x(null)}catch{v(t("toast.clearFailed","Failed to clear data"),"error")}finally{f(!1)}}},[y,v,t,i]),st=n.useCallback(e=>{const r=e==="history"?"tools_history":"tools_statistics";a("dashboard_click_event",{click_target:e==="history"?"tools_tab_history":"tools_tab_statistics",page:"tools",tab:r}),b({page:"tools",tab:r}),E(e)},[a,b]),ot=n.useCallback(e=>{const r=je(e),l=Se(e);return s.jsxs("div",{className:o.expandedRow,children:[s.jsxs("div",{className:o.expandedSection,children:[s.jsxs("strong",{children:[s.jsx(M,{text:t("tools.detail.params.tooltip","Input parameters passed to this tool run."),children:t("tools.detail.params","Parameters")}),":"]}),s.jsx("pre",{className:o.pre,children:JSON.stringify(e.parameters,null,2)})]}),e.result&&s.jsxs("div",{className:o.expandedSection,children:[s.jsxs("strong",{children:[s.jsx(M,{text:t("tools.detail.result.tooltip","Returned result payload for this tool run."),children:t("tools.detail.result","Result")}),":"]}),s.jsx("pre",{className:o.pre,children:JSON.stringify(e.result,null,2)})]}),l?s.jsxs("div",{className:o.expandedSection,children:[s.jsx("strong",{children:t("tools.history.routing","Routing")}),s.jsxs("div",{className:o.detailList,children:[g(t("tools.history.routing.mode","Mode"),l.selectionMode),g(t("tools.history.routing.requested","Requested"),Te(l,t)),g(t("tools.history.routing.actual","Actual"),Ne(l))]})]}):null,(e.status==="fallback"||e.status==="unsupported"||e.status==="warning"||e.status==="error")&&s.jsx("div",{className:o.expandedSection,children:s.jsxs("div",{className:o.detailList,children:[e.status==="fallback"&&(r==null?void 0:r.requestedCommand)&&g(t("tools.detail.requestedCommand","Requested Command"),r.requestedCommand),e.status==="fallback"&&(r==null?void 0:r.executedCommand)&&g(t("tools.detail.executedCommand","Executed Command"),r.executedCommand),e.status==="fallback"&&(r==null?void 0:r.alternatives)&&g(t("tools.detail.alternatives","Alternatives"),r.alternatives.join(", ")),e.status==="unsupported"&&e.blockedMessage&&g(t("tools.detail.blockedMessage","Blocked Reason"),e.blockedMessage),e.status==="unsupported"&&g(t("tools.detail.noFallback","No Fallback"),t("tools.detail.noFallback.value","No fallback ran.")),e.status==="warning"&&e.warningMessage&&g(t("tools.detail.warningMessage","Warning Message"),e.warningMessage),e.status==="error"&&e.errorMessage&&g(t("tools.detail.errorMessage","Error Message"),e.errorMessage),e.status==="error"&&e.blockedMessage&&g(t("tools.detail.blockedMessage","Blocked Reason"),e.blockedMessage),e.status==="error"&&e.fallbackCommand&&g(t("tools.detail.executedCommand","Executed Command"),e.fallbackCommand)]})})]})},[t]),at=["history","statistics"].map(e=>({key:e,label:t(`tools.tab.${e}`,e.charAt(0).toUpperCase()+e.slice(1))}));return s.jsxs("div",{className:o.page,children:[s.jsx(pt,{title:t("page.tools.title","Tools"),description:t("page.tools.description","Inspect tool history, outcomes, fallback details, and usage statistics."),helpTopicId:"tools"}),s.jsx(ht,{surface:"tools",selectable:!0,selectedPlaceId:P,onSelectedPlaceIdChange:e=>{B(e),i.setHistoryOffset(0)}}),s.jsx(mt,{items:at,value:k,onChange:st}),k==="history"&&s.jsxs("div",{className:o.card,children:[s.jsxs("div",{className:o.cardToolbar,children:[s.jsx("div",{className:o.sectionTitle,children:t("tools.tab.history","History")}),s.jsx("button",{className:o.dangerButton,onClick:()=>{a("dashboard_click_event",{click_target:"tools_clear_history",page:"tools",tab:"tools_history"}),x("history")},children:t("common.clear","Clear")})]}),s.jsx("div",{className:o.filterRow,children:s.jsxs("label",{className:o.filterLabel,children:[t("tools.filter.tool","Tool"),":",s.jsxs("select",{className:o.filterSelect,value:i.historyToolFilter,onChange:e=>{i.setHistoryToolFilter(e.target.value),i.setHistoryOffset(0)},children:[s.jsx("option",{value:"",children:t("tools.filter.all","All")}),V.map(e=>s.jsx("option",{value:e,children:e},e))]})]})}),s.jsx(kt,{columns:O,data:i.history,rowKey:e=>e.id,onRowClick:e=>u(r=>r===e.id?null:e.id),emptyMessage:t("tools.empty.history","No tool history entries for this place"),expandedKey:N,renderExpandedRow:ot}),s.jsxs("div",{className:o.pagination,children:[s.jsx("button",{className:o.btn,disabled:i.historyOffset===0,title:t("tools.page.prev.tooltip","Go to the previous page of tool history results."),onClick:()=>i.setHistoryOffset(Math.max(0,i.historyOffset-K)),children:t("tools.page.prev","Prev")}),s.jsxs("span",{className:o.pageInfo,children:[i.historyOffset+1,"–",Math.min(i.historyOffset+K,i.historyTotal)," / ",i.historyTotal]}),s.jsx("button",{className:o.btn,disabled:!i.historyHasMore,title:t("tools.page.next.tooltip","Go to the next page of tool history results."),onClick:()=>i.setHistoryOffset(i.historyOffset+K),children:t("tools.page.next","Next")})]})]}),k==="statistics"&&s.jsxs("div",{className:o.card,children:[s.jsxs("div",{className:o.cardToolbar,children:[s.jsx("div",{className:o.sectionTitle,children:t("tools.tab.statistics","Statistics")}),s.jsx("button",{className:o.dangerButton,onClick:()=>{a("dashboard_click_event",{click_target:"tools_clear_statistics",page:"tools",tab:"tools_statistics"}),x("statistics")},children:t("common.clear","Clear")})]}),w&&s.jsxs("div",{className:o.tierDistribution,children:[s.jsxs("div",{className:o.tierBarWrap,children:[s.jsx("div",{className:o.tierBarBasic,style:{width:`${w.basicPct}%`}}),s.jsx("div",{className:o.tierBarPro,style:{width:`${w.proPct}%`}})]}),s.jsxs("div",{className:o.tierLabels,children:[s.jsxs("span",{children:[H(t,"basic")," ",w.basicPct,"% (",w.basic,")"]}),s.jsxs("span",{children:[H(t,"pro")," ",w.proPct,"% (",w.pro,")"]})]})]}),s.jsx("div",{className:o.statsTableWrap,children:s.jsxs("table",{className:o.statsTable,children:[s.jsx("thead",{children:s.jsx("tr",{children:A.map(e=>s.jsxs("th",{style:e.width?{width:e.width}:void 0,className:e.sortable?o.sortableHeader:void 0,onClick:e.sortable?()=>U(e.key):void 0,children:[s.jsx("span",{children:e.label}),e.sortable&&I===e.key&&s.jsx("span",{className:o.sortArrow,children:h==="asc"?"▴":"▾"})]},e.key))})}),s.jsx("tbody",{children:j.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:A.length,className:o.emptyStats,children:t("tools.empty.stats","No tool statistics for this place")})}):j.map(e=>{const r=R===e.toolName;return s.jsxs(n.Fragment,{children:[s.jsxs("tr",{className:o.statsToolRow,onClick:()=>G(e.toolName),children:[s.jsx("td",{children:s.jsxs("button",{type:"button",className:o.expandButton,"aria-expanded":r,"aria-label":`${e.toolName} ${r?t("common.collapse","Collapse"):t("common.expand","Expand")}`,onClick:l=>{l.stopPropagation(),G(e.toolName)},children:[s.jsx("span",{className:o.expandIcon,"aria-hidden":"true",children:r?"▾":"▸"}),s.jsx("span",{children:e.toolName})]})}),s.jsx("td",{children:e.totalCalls}),s.jsx("td",{children:e.successCount}),s.jsx("td",{children:e.fallbackCount}),s.jsx("td",{children:e.unsupportedCount}),s.jsx("td",{children:e.warningCount}),s.jsx("td",{children:e.failureCount}),s.jsx("td",{children:z(e.avgExecutionTimeMs)}),s.jsx("td",{children:s.jsx(M,{text:e.tier==="mixed"?t("tools.tier.mixed.tooltip","This tool includes both Basic and Pro actions."):"",children:s.jsx("span",{className:e.tier==="pro"?o.tierPro:e.tier==="mixed"?o.tierMixed:o.tierBasic,children:H(t,e.tier)})})})]}),r&&e.commands.map(l=>s.jsxs("tr",{className:o.statsActionRow,children:[s.jsx("td",{children:s.jsx("span",{className:o.actionLabel,children:l.label})}),s.jsx("td",{children:l.totalCalls}),s.jsx("td",{children:l.successCount}),s.jsx("td",{children:l.fallbackCount}),s.jsx("td",{children:l.unsupportedCount}),s.jsx("td",{children:l.warningCount}),s.jsx("td",{children:l.failureCount}),s.jsx("td",{children:z(l.avgExecutionTimeMs)}),s.jsx("td",{children:s.jsx("span",{className:l.tier==="pro"?o.tierPro:o.tierBasic,children:H(t,l.tier)})})]},`${e.toolName}:${l.commandName}`))]},e.toolName)})})]})}),i.statistics&&s.jsxs("div",{className:o.summaryLine,children:[t("tools.summary.total","Total"),": ",i.statistics.totalCalls," ",t("tools.summary.calls","calls")," | ",t("tools.summary.sessions","Sessions"),": ",i.statistics.totalSessions]})]}),s.jsx(xt,{open:y!==null,title:y==="history"?t("tools.clear.history.title","Clear history?"):t("tools.clear.statistics.title","Clear statistics?"),message:y==="history"?t("tools.clear.history.message","This permanently removes the current place tools history."):t("tools.clear.statistics.message","This permanently resets the current place tool statistics."),cancelLabel:t("common.cancel","Cancel"),confirmLabel:t("common.clear","Clear"),loading:C,onCancel:()=>!C&&x(null),onConfirm:et})]})}export{Ae as Component};
|
|
1
|
+
import{j as s,r as n,a as F,D as nt,u as ct,e as dt,l as ut}from"./index-DYezp9b1.js";import{P as pt}from"./PageHeader-Do_AQ2vQ.js";import{T as M}from"./TooltipText-CfI7WgY4.js";import{C as xt}from"./ConfirmModal-BCviiJ3_.js";import{C as ht}from"./CurrentPlaceScope-CHEqGWYd.js";import{T as mt}from"./Tabs-CGfFE3L1.js";import"./ConfirmModal.module-NrFlfTWy.js";const bt="_wrapper_hzgda_2",ft="_table_hzgda_7",gt="_sortable_hzgda_32",_t="_sortArrow_hzgda_41",yt="_clickable_hzgda_52",Ct="_empty_hzgda_57",jt="_expandedRow_hzgda_65",vt="_expandedCell_hzgda_74",T={wrapper:bt,table:ft,sortable:gt,sortArrow:_t,clickable:yt,empty:Ct,expandedRow:jt,expandedCell:vt};function kt({columns:t,data:a,sortBy:b,sortDir:P="asc",onSort:B,onRowClick:i,rowKey:v,emptyMessage:k,expandedKey:E,renderExpandedRow:N}){return s.jsx("div",{className:T.wrapper,children:s.jsxs("table",{className:T.table,children:[s.jsx("thead",{children:s.jsx("tr",{children:t.map(u=>s.jsxs("th",{style:u.width?{width:u.width}:void 0,className:u.sortable?T.sortable:void 0,onClick:u.sortable&&B?()=>B(u.key):void 0,children:[s.jsx("span",{children:u.label}),u.sortable&&b===u.key&&s.jsx("span",{className:T.sortArrow,children:P==="asc"?"▴":"▾"})]},u.key))})}),s.jsx("tbody",{children:a.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:t.length,className:T.empty,children:k||"No data"})}):a.map((u,R)=>{const L=v?v(u):String(R),x=E!=null&&L===E&&N?N(u):null;return s.jsxs(n.Fragment,{children:[s.jsx("tr",{className:i?T.clickable:void 0,onClick:i?()=>i(u):void 0,children:t.map(C=>s.jsx("td",{children:C.render?C.render(u):String(u[C.key]??"")},C.key))}),x&&s.jsx("tr",{className:T.expandedRow,children:s.jsx("td",{colSpan:t.length,className:T.expandedCell,children:x})})]},L)})})]})})}function St(t){return{...t,sequenceNumber:typeof t.sequenceNumber=="number"?t.sequenceNumber:void 0,executionTimeMs:typeof t.executionTimeMs=="number"?t.executionTimeMs:void 0}}const Tt=50;function Nt(t){if(typeof t=="number")return{placeId:String(t)}}function Z(t,a){return typeof a!="number"?t:`${t}?placeId=${encodeURIComponent(String(a))}`}function wt(t){const a=(t==null?void 0:t.placeId)??null,[b,P]=n.useState(null),[B,i]=n.useState(!0),[v,k]=n.useState([]),[E,N]=n.useState(0),[u,R]=n.useState(!1),[L,y]=n.useState(!0),[x,C]=n.useState(0),[f,I]=n.useState(""),$=n.useRef(null),h=n.useCallback(async()=>{i(!0);try{const c=Nt(a),j=c?await F.get("/api/dashboard/tool-stats",c):await F.get("/api/dashboard/tool-stats");P(j)}catch{}finally{i(!1)}},[a]),_=n.useCallback(async(c,j)=>{y(!0);try{const O={limit:String(Tt),offset:String(c)};j&&(O.tool=j),typeof a=="number"&&(O.placeId=String(a));const A=await F.get("/api/dashboard/history",O);k(A.entries.map(St)),N(A.total),R(A.hasMore)}catch{k([]),N(0),R(!1)}finally{y(!1)}},[a]),U=n.useCallback(()=>{h(),_(x,f)},[_,h,x,f]),V=n.useCallback(async()=>{await F.post(Z("/api/dashboard/tools/history/clear",a)),_(x,f)},[_,x,f,a]),q=n.useCallback(async()=>{await F.post(Z("/api/dashboard/tools/statistics/clear",a)),h()},[h,a]);return n.useEffect(()=>{h()},[h]),n.useEffect(()=>{_(x,f)},[_,x,f]),n.useEffect(()=>{const c=new nt;$.current=c,c.connect();const j=c.on("command",()=>{h(),_(x,f)});return()=>{j(),c.disconnect(),$.current=null}},[_,h,x,f]),{statistics:b,statsLoading:B,history:v,historyTotal:E,historyHasMore:u,historyLoading:L,historyOffset:x,historyToolFilter:f,setHistoryOffset:C,setHistoryToolFilter:I,refresh:U,clearHistory:V,clearStatistics:q}}const Mt="_page_16x6v_2",Pt="_card_16x6v_12",Bt="_cardToolbar_16x6v_19",Et="_sectionTitle_16x6v_27",Rt="_dangerButton_16x6v_33",Lt="_proBadge_16x6v_52",It="_statusOk_16x6v_67",At="_statusFallback_16x6v_76",Ht="_statusUnsupported_16x6v_85",Ot="_statusWarning_16x6v_94",Ft="_statusError_16x6v_103",$t="_tierBasic_16x6v_113",qt="_tierPro_16x6v_117",Dt="_tierMixed_16x6v_122",Wt="_filterRow_16x6v_133",zt="_filterLabel_16x6v_140",Ut="_filterSelect_16x6v_149",Vt="_expandedRow_16x6v_160",Kt="_expandedSection_16x6v_165",Gt="_detailList_16x6v_175",Jt="_detailItem_16x6v_181",Qt="_detailLabel_16x6v_187",Zt="_detailValue_16x6v_192",Xt="_pre_16x6v_197",Yt="_pagination_16x6v_214",te="_pageInfo_16x6v_222",ee="_btn_16x6v_228",se="_tierDistribution_16x6v_251",oe="_tierBarWrap_16x6v_255",ae="_tierBarBasic_16x6v_263",re="_tierBarPro_16x6v_268",le="_tierLabels_16x6v_273",ie="_statsTableWrap_16x6v_282",ne="_statsTable_16x6v_282",ce="_sortableHeader_16x6v_313",de="_sortArrow_16x6v_318",ue="_statsToolRow_16x6v_322",pe="_statsActionRow_16x6v_330",xe="_expandButton_16x6v_334",he="_expandIcon_16x6v_346",me="_actionLabel_16x6v_351",be="_emptyStats_16x6v_358",fe="_summaryLine_16x6v_364",o={page:Mt,card:Pt,cardToolbar:Bt,sectionTitle:Et,dangerButton:Rt,proBadge:Lt,statusOk:It,statusFallback:At,statusUnsupported:Ht,statusWarning:Ot,statusError:Ft,tierBasic:$t,tierPro:qt,tierMixed:Dt,filterRow:Wt,filterLabel:zt,filterSelect:Ut,expandedRow:Vt,expandedSection:Kt,detailList:Gt,detailItem:Jt,detailLabel:Qt,detailValue:Zt,pre:Xt,pagination:Yt,pageInfo:te,btn:ee,tierDistribution:se,tierBarWrap:oe,tierBarBasic:ae,tierBarPro:re,tierLabels:le,statsTableWrap:ie,statsTable:ne,sortableHeader:ce,sortArrow:de,statsToolRow:ue,statsActionRow:pe,expandButton:xe,expandIcon:he,actionLabel:me,emptyStats:be,summaryLine:fe},K=50,ge=new Set(["clientId","placeId","pinnedTarget","recentPriority","globalQueue"]);function _e(t){const a=new Date(t);return`${String(a.getHours()).padStart(2,"0")}:${String(a.getMinutes()).padStart(2,"0")}:${String(a.getSeconds()).padStart(2,"0")}`}function z(t){return typeof t!="number"||!Number.isFinite(t)?"-":t<1e3?`${t}ms`:`${(t/1e3).toFixed(1)}s`}function H(t,a){return a==="pro"?t("tier.pro","Pro"):a==="mixed"?t("tier.mixed","Mixed"):t("tier.basic","Basic")}function tt(t,a){return a!==t&&a.startsWith(`${t}_`)?a.slice(t.length+1):""}function ye(t,a){const b=tt(t,a);return b?`${t}.${b}`:t}function X(t){return typeof t=="string"&&t.length>0?t:void 0}function Ce(t){if(!Array.isArray(t))return;const a=t.filter(b=>typeof b=="string"&&b.length>0);return a.length>0?a:void 0}function je(t){const a=t.result??{};return{requestedCommand:t.requestedCommand??X(a.requestedCommand),executedCommand:t.executedCommand??X(a.executedCommand),alternatives:t.alternatives??Ce(a.alternatives)}}function ve(t,a){switch(t.status){case"fallback":return{label:a("tools.badge.fallback","FALLBACK"),tooltip:a("tools.badge.fallback.tooltip","The requested Pro action succeeded via a Basic fallback."),className:o.statusFallback};case"unsupported":return{label:a("tools.badge.unsupported","UNSUPPORTED"),tooltip:a("tools.badge.unsupported.tooltip","The requested Pro action was blocked and no fallback ran."),className:o.statusUnsupported};case"warning":return{label:a("tools.badge.warn","WARN"),tooltip:a("tools.badge.warn.tooltip","The tool call failed as an expected caller, project, policy, or user-code issue."),className:o.statusWarning};case"error":return{label:a("tools.badge.err","FAILED"),tooltip:a("tools.badge.err.tooltip","The tool run failed."),className:o.statusError};default:return{label:a("tools.status.ok","OK"),tooltip:a("tools.status.ok.tooltip","The tool run completed successfully."),className:o.statusOk}}}function g(t,a){return s.jsxs("div",{className:o.detailItem,children:[s.jsx("span",{className:o.detailLabel,children:t}),s.jsx("span",{className:o.detailValue,children:a})]})}function ke(t){if(!t||typeof t!="object")return;const a=t;if(typeof a.selectionMode=="string"&&ge.has(a.selectionMode))return a}function Y(t){if(!(!t||typeof t!="object"||!("routing"in t)))return ke(t.routing)}function Se(t){return t.routing??Y(t.result)??Y(t.data)}function Te(t,a){return t.requestedClientId?t.requestedClientId:t.requestedPlaceId!==void 0?t.requestedPlaceId:a("tools.history.routing.none","No Studio target named")}function Ne(t){return t.actualPlaceName?`${t.actualPlaceName} · ${t.actualPlaceId??"-"}`:t.actualClientId??"-"}function Ae(){const{t}=ct(),{trackEvent:a,trackPageView:b}=dt(),[P,B]=n.useState(null),i=wt({placeId:P}),{show:v}=ut(),[k,E]=n.useState("history"),[N,u]=n.useState(null),[R,L]=n.useState(null),[y,x]=n.useState(null),[C,f]=n.useState(!1),[I,$]=n.useState("totalCalls"),[h,_]=n.useState("desc"),U=n.useCallback(e=>{$(r=>r===e?(_(l=>l==="asc"?"desc":"asc"),e):(_("desc"),e))},[]),V=n.useMemo(()=>{var r;const e=new Set;return Object.keys(((r=i.statistics)==null?void 0:r.tools)??{}).forEach(l=>e.add(l)),i.history.forEach(l=>{l.tool&&e.add(l.tool)}),i.historyToolFilter&&e.add(i.historyToolFilter),Array.from(e).sort()},[i.history,i.historyToolFilter,i.statistics]),q=n.useMemo(()=>{var e;return(e=i.statistics)!=null&&e.tools?Object.values(i.statistics.tools).map(r=>{var Q;const l=Object.entries(r.commands??{}).map(([p,d])=>({toolName:r.tool,commandName:d.command??p,label:tt(r.tool,d.command??p)||(d.command??p),tier:d.tier,totalCalls:d.totalCalls,successCount:d.successCount,fallbackCount:d.fallbackCount,unsupportedCount:d.unsupportedCount,warningCount:d.warningCount??0,failureCount:d.failureCount,totalExecutionTimeMs:d.totalExecutionTimeMs,avgExecutionTimeMs:d.avgExecutionTimeMs})),m=l.reduce((p,d)=>p+d.totalCalls,0),S=l.reduce((p,d)=>p+d.successCount,0),D=l.reduce((p,d)=>p+d.fallbackCount,0),W=l.reduce((p,d)=>p+d.unsupportedCount,0),rt=l.reduce((p,d)=>p+d.warningCount,0),lt=l.reduce((p,d)=>p+d.failureCount,0),J=l.reduce((p,d)=>p+d.totalExecutionTimeMs,0),it=new Set(l.map(p=>p.tier)).size>1?"mixed":((Q=l[0])==null?void 0:Q.tier)??r.tier;return{toolName:r.tool,tier:it,commands:l,totalCalls:m,successCount:S,fallbackCount:D,unsupportedCount:W,warningCount:rt,failureCount:lt,totalExecutionTimeMs:J,avgExecutionTimeMs:m>0?Math.round(J/m):0}}):[]},[i.statistics]),c=n.useCallback((e,r,l,m)=>s.jsx(M,{text:t(l,m),children:t(e,r)}),[t]),j=n.useMemo(()=>[...q].sort((r,l)=>{const m=r[I],S=l[I];if(typeof m=="number"&&typeof S=="number")return h==="asc"?m-S:S-m;const D=String(m??""),W=String(S??"");return h==="asc"?D.localeCompare(W):W.localeCompare(D)}),[q,I,h]),O=n.useMemo(()=>[{key:"timestamp",label:c("tools.col.time","Time","tools.col.time.tooltip","When the tool run was recorded."),width:"80px",render:e=>_e(e.timestamp)},{key:"toolName",label:c("tools.col.toolAction","Tool.Action","tools.col.toolAction.tooltip","Tool name and action that were executed."),render:e=>s.jsxs("span",{children:[ye(e.tool,e.command),e.tier==="pro"&&s.jsx(M,{text:t("tools.badge.pro.tooltip","This entry used a Pro-only tool or action."),children:s.jsx("span",{className:o.proBadge,children:t("tools.badge.pro","PRO")})})]})},{key:"executionTimeMs",label:c("tools.col.duration","Duration","tools.col.duration.tooltip","How long the tool took to finish."),width:"80px",render:e=>z(e.executionTimeMs)},{key:"status",label:c("tools.col.status","Status","tools.col.status.tooltip","Outcome of the recorded tool run."),width:"120px",render:e=>{const r=ve(e,t);return s.jsx(M,{text:r.tooltip,children:s.jsx("span",{className:r.className,children:r.label})})}},{key:"tier",label:c("tools.col.tier","Tier","tools.col.tier.tooltip","License tier required for the tool or action."),width:"60px",render:e=>s.jsx("span",{className:e.tier==="pro"?o.tierPro:o.tierBasic,children:H(t,e.tier)})}],[t,c]),A=n.useMemo(()=>[{key:"toolName",label:c("tools.col.tool","Tool","tools.col.tool.tooltip","Consolidated tool name in the statistics table."),sortable:!0},{key:"totalCalls",label:c("tools.col.calls","Calls","tools.col.calls.tooltip","Total number of recorded calls for this tool."),sortable:!0,width:"70px"},{key:"successCount",label:c("tools.col.ok","OK","tools.col.ok.tooltip","Number of direct successful runs."),sortable:!0,width:"70px"},{key:"fallbackCount",label:c("tools.col.fallback","FALLBACK","tools.col.fallback.tooltip","Number of runs that succeeded through fallback execution."),sortable:!0,width:"110px"},{key:"unsupportedCount",label:c("tools.col.unsupported","UNSUPPORTED","tools.col.unsupported.tooltip","Number of blocked runs without fallback execution."),sortable:!0,width:"130px"},{key:"warningCount",label:c("tools.col.warn","WARN","tools.col.warn.tooltip","Number of expected failures caused by caller input, project state, Roblox policy, or user code."),sortable:!0,width:"80px"},{key:"failureCount",label:c("tools.col.err","FAILED","tools.col.err.tooltip","Number of runs that failed."),sortable:!0,width:"70px"},{key:"avgExecutionTimeMs",label:c("tools.col.avgTime","Avg Time","tools.col.avgTime.tooltip","Average execution time across recorded calls."),sortable:!0,width:"90px",render:e=>z(e.avgExecutionTimeMs)},{key:"tier",label:c("tools.col.tier","Tier","tools.col.tierStats.tooltip","Basic, Pro, or Mixed summary for the tool statistics row."),sortable:!0,width:"70px",render:e=>s.jsx(M,{text:e.tier==="mixed"?t("tools.tier.mixed.tooltip","This tool includes both Basic and Pro actions."):"",children:s.jsx("span",{className:e.tier==="pro"?o.tierPro:e.tier==="mixed"?o.tierMixed:o.tierBasic,children:H(t,e.tier)})})}],[t,c]),w=n.useMemo(()=>{if(!i.statistics)return null;const e=i.statistics.tierSummary.basic.totalCalls,r=i.statistics.tierSummary.pro.totalCalls,l=e+r;if(l===0)return null;const m=Math.round(e/l*100),S=100-m;return{basic:e,pro:r,basicPct:m,proPct:S}},[i.statistics]),G=n.useCallback(e=>{L(r=>r===e?null:e)},[]),et=n.useCallback(async()=>{if(y){f(!0);try{y==="history"?await i.clearHistory():await i.clearStatistics(),v(t("toast.clearSuccess","Cleared successfully"),"success"),x(null)}catch{v(t("toast.clearFailed","Failed to clear data"),"error")}finally{f(!1)}}},[y,v,t,i]),st=n.useCallback(e=>{const r=e==="history"?"tools_history":"tools_statistics";a("dashboard_click_event",{click_target:e==="history"?"tools_tab_history":"tools_tab_statistics",page:"tools",tab:r}),b({page:"tools",tab:r}),E(e)},[a,b]),ot=n.useCallback(e=>{const r=je(e),l=Se(e);return s.jsxs("div",{className:o.expandedRow,children:[s.jsxs("div",{className:o.expandedSection,children:[s.jsxs("strong",{children:[s.jsx(M,{text:t("tools.detail.params.tooltip","Input parameters passed to this tool run."),children:t("tools.detail.params","Parameters")}),":"]}),s.jsx("pre",{className:o.pre,children:JSON.stringify(e.parameters,null,2)})]}),e.result&&s.jsxs("div",{className:o.expandedSection,children:[s.jsxs("strong",{children:[s.jsx(M,{text:t("tools.detail.result.tooltip","Returned result payload for this tool run."),children:t("tools.detail.result","Result")}),":"]}),s.jsx("pre",{className:o.pre,children:JSON.stringify(e.result,null,2)})]}),l?s.jsxs("div",{className:o.expandedSection,children:[s.jsx("strong",{children:t("tools.history.routing","Routing")}),s.jsxs("div",{className:o.detailList,children:[g(t("tools.history.routing.mode","Mode"),l.selectionMode),g(t("tools.history.routing.requested","Requested"),Te(l,t)),g(t("tools.history.routing.actual","Actual"),Ne(l))]})]}):null,(e.status==="fallback"||e.status==="unsupported"||e.status==="warning"||e.status==="error")&&s.jsx("div",{className:o.expandedSection,children:s.jsxs("div",{className:o.detailList,children:[e.status==="fallback"&&(r==null?void 0:r.requestedCommand)&&g(t("tools.detail.requestedCommand","Requested Command"),r.requestedCommand),e.status==="fallback"&&(r==null?void 0:r.executedCommand)&&g(t("tools.detail.executedCommand","Executed Command"),r.executedCommand),e.status==="fallback"&&(r==null?void 0:r.alternatives)&&g(t("tools.detail.alternatives","Alternatives"),r.alternatives.join(", ")),e.status==="unsupported"&&e.blockedMessage&&g(t("tools.detail.blockedMessage","Blocked Reason"),e.blockedMessage),e.status==="unsupported"&&g(t("tools.detail.noFallback","No Fallback"),t("tools.detail.noFallback.value","No fallback ran.")),e.status==="warning"&&e.warningMessage&&g(t("tools.detail.warningMessage","Warning Message"),e.warningMessage),e.status==="error"&&e.errorMessage&&g(t("tools.detail.errorMessage","Error Message"),e.errorMessage),e.status==="error"&&e.blockedMessage&&g(t("tools.detail.blockedMessage","Blocked Reason"),e.blockedMessage),e.status==="error"&&e.fallbackCommand&&g(t("tools.detail.executedCommand","Executed Command"),e.fallbackCommand)]})})]})},[t]),at=["history","statistics"].map(e=>({key:e,label:t(`tools.tab.${e}`,e.charAt(0).toUpperCase()+e.slice(1))}));return s.jsxs("div",{className:o.page,children:[s.jsx(pt,{title:t("page.tools.title","Tools"),description:t("page.tools.description","Inspect tool history, outcomes, fallback details, and usage statistics."),helpTopicId:"tools"}),s.jsx(ht,{surface:"tools",selectable:!0,selectedPlaceId:P,onSelectedPlaceIdChange:e=>{B(e),i.setHistoryOffset(0)}}),s.jsx(mt,{items:at,value:k,onChange:st}),k==="history"&&s.jsxs("div",{className:o.card,children:[s.jsxs("div",{className:o.cardToolbar,children:[s.jsx("div",{className:o.sectionTitle,children:t("tools.tab.history","History")}),s.jsx("button",{className:o.dangerButton,onClick:()=>{a("dashboard_click_event",{click_target:"tools_clear_history",page:"tools",tab:"tools_history"}),x("history")},children:t("common.clear","Clear")})]}),s.jsx("div",{className:o.filterRow,children:s.jsxs("label",{className:o.filterLabel,children:[t("tools.filter.tool","Tool"),":",s.jsxs("select",{className:o.filterSelect,value:i.historyToolFilter,onChange:e=>{i.setHistoryToolFilter(e.target.value),i.setHistoryOffset(0)},children:[s.jsx("option",{value:"",children:t("tools.filter.all","All")}),V.map(e=>s.jsx("option",{value:e,children:e},e))]})]})}),s.jsx(kt,{columns:O,data:i.history,rowKey:e=>e.id,onRowClick:e=>u(r=>r===e.id?null:e.id),emptyMessage:t("tools.empty.history","No tool history entries for this place"),expandedKey:N,renderExpandedRow:ot}),s.jsxs("div",{className:o.pagination,children:[s.jsx("button",{className:o.btn,disabled:i.historyOffset===0,title:t("tools.page.prev.tooltip","Go to the previous page of tool history results."),onClick:()=>i.setHistoryOffset(Math.max(0,i.historyOffset-K)),children:t("tools.page.prev","Prev")}),s.jsxs("span",{className:o.pageInfo,children:[i.historyOffset+1,"–",Math.min(i.historyOffset+K,i.historyTotal)," / ",i.historyTotal]}),s.jsx("button",{className:o.btn,disabled:!i.historyHasMore,title:t("tools.page.next.tooltip","Go to the next page of tool history results."),onClick:()=>i.setHistoryOffset(i.historyOffset+K),children:t("tools.page.next","Next")})]})]}),k==="statistics"&&s.jsxs("div",{className:o.card,children:[s.jsxs("div",{className:o.cardToolbar,children:[s.jsx("div",{className:o.sectionTitle,children:t("tools.tab.statistics","Statistics")}),s.jsx("button",{className:o.dangerButton,onClick:()=>{a("dashboard_click_event",{click_target:"tools_clear_statistics",page:"tools",tab:"tools_statistics"}),x("statistics")},children:t("common.clear","Clear")})]}),w&&s.jsxs("div",{className:o.tierDistribution,children:[s.jsxs("div",{className:o.tierBarWrap,children:[s.jsx("div",{className:o.tierBarBasic,style:{width:`${w.basicPct}%`}}),s.jsx("div",{className:o.tierBarPro,style:{width:`${w.proPct}%`}})]}),s.jsxs("div",{className:o.tierLabels,children:[s.jsxs("span",{children:[H(t,"basic")," ",w.basicPct,"% (",w.basic,")"]}),s.jsxs("span",{children:[H(t,"pro")," ",w.proPct,"% (",w.pro,")"]})]})]}),s.jsx("div",{className:o.statsTableWrap,children:s.jsxs("table",{className:o.statsTable,children:[s.jsx("thead",{children:s.jsx("tr",{children:A.map(e=>s.jsxs("th",{style:e.width?{width:e.width}:void 0,className:e.sortable?o.sortableHeader:void 0,onClick:e.sortable?()=>U(e.key):void 0,children:[s.jsx("span",{children:e.label}),e.sortable&&I===e.key&&s.jsx("span",{className:o.sortArrow,children:h==="asc"?"▴":"▾"})]},e.key))})}),s.jsx("tbody",{children:j.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:A.length,className:o.emptyStats,children:t("tools.empty.stats","No tool statistics for this place")})}):j.map(e=>{const r=R===e.toolName;return s.jsxs(n.Fragment,{children:[s.jsxs("tr",{className:o.statsToolRow,onClick:()=>G(e.toolName),children:[s.jsx("td",{children:s.jsxs("button",{type:"button",className:o.expandButton,"aria-expanded":r,"aria-label":`${e.toolName} ${r?t("common.collapse","Collapse"):t("common.expand","Expand")}`,onClick:l=>{l.stopPropagation(),G(e.toolName)},children:[s.jsx("span",{className:o.expandIcon,"aria-hidden":"true",children:r?"▾":"▸"}),s.jsx("span",{children:e.toolName})]})}),s.jsx("td",{children:e.totalCalls}),s.jsx("td",{children:e.successCount}),s.jsx("td",{children:e.fallbackCount}),s.jsx("td",{children:e.unsupportedCount}),s.jsx("td",{children:e.warningCount}),s.jsx("td",{children:e.failureCount}),s.jsx("td",{children:z(e.avgExecutionTimeMs)}),s.jsx("td",{children:s.jsx(M,{text:e.tier==="mixed"?t("tools.tier.mixed.tooltip","This tool includes both Basic and Pro actions."):"",children:s.jsx("span",{className:e.tier==="pro"?o.tierPro:e.tier==="mixed"?o.tierMixed:o.tierBasic,children:H(t,e.tier)})})})]}),r&&e.commands.map(l=>s.jsxs("tr",{className:o.statsActionRow,children:[s.jsx("td",{children:s.jsx("span",{className:o.actionLabel,children:l.label})}),s.jsx("td",{children:l.totalCalls}),s.jsx("td",{children:l.successCount}),s.jsx("td",{children:l.fallbackCount}),s.jsx("td",{children:l.unsupportedCount}),s.jsx("td",{children:l.warningCount}),s.jsx("td",{children:l.failureCount}),s.jsx("td",{children:z(l.avgExecutionTimeMs)}),s.jsx("td",{children:s.jsx("span",{className:l.tier==="pro"?o.tierPro:o.tierBasic,children:H(t,l.tier)})})]},`${e.toolName}:${l.commandName}`))]},e.toolName)})})]})}),i.statistics&&s.jsxs("div",{className:o.summaryLine,children:[t("tools.summary.total","Total"),": ",i.statistics.totalCalls," ",t("tools.summary.calls","calls")," | ",t("tools.summary.sessions","Sessions"),": ",i.statistics.totalSessions]})]}),s.jsx(xt,{open:y!==null,title:y==="history"?t("tools.clear.history.title","Clear history?"):t("tools.clear.statistics.title","Clear statistics?"),message:y==="history"?t("tools.clear.history.message","This permanently removes the current place tools history."):t("tools.clear.statistics.message","This permanently resets the current place tool statistics."),cancelLabel:t("common.cancel","Cancel"),confirmLabel:t("common.clear","Clear"),loading:C,onCancel:()=>!C&&x(null),onConfirm:et})]})}export{Ae as Component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as r,k as s}from"./index-
|
|
1
|
+
import{j as r,k as s}from"./index-DYezp9b1.js";function p({text:o,children:t}){return r.jsx(s,{text:o,children:t})}export{p as T};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as xe,n as q,q as Le,r as g,u as M,j as t,e as H,R as $e,X as Ee,T as Se,h as He,t as Oe}from"./index-
|
|
1
|
+
import{i as xe,n as q,q as Le,r as g,u as M,j as t,e as H,R as $e,X as Ee,T as Se,h as He,t as Oe}from"./index-DYezp9b1.js";import{I as G}from"./InfoLabel-DCq3Fmko.js";import{T as y}from"./TooltipText-CfI7WgY4.js";import{D as se,c as oe,e as Fe,g as Ue,h as ze,i as le,j as je,k as qe,l as ce,d as Ve}from"./sample-requests-CnV4bBG4.js";import{T as We}from"./Tabs-CGfFE3L1.js";import{P as Ke}from"./PageHeader-Do_AQ2vQ.js";import{C as Qe}from"./CurrentPlaceScope-CHEqGWYd.js";/**
|
|
2
2
|
* @license lucide-react v1.8.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u,j as e,G as y,r as N,H as w}from"./index-
|
|
1
|
+
import{u,j as e,G as y,r as N,H as w}from"./index-DYezp9b1.js";import{P as x}from"./PageHeader-Do_AQ2vQ.js";const j="_card_f20gt_2",C="_cardUnread_f20gt_15",R="_cardRead_f20gt_20",k="_topRow_f20gt_25",v="_categoryChip_f20gt_32",b="_versionChip_f20gt_45",S="_date_f20gt_57",T="_title_f20gt_65",E="_body_f20gt_74",A="_linkList_f20gt_82",U="_link_f20gt_82",B="_newBadge_f20gt_104",a={card:j,cardUnread:C,cardRead:R,topRow:k,categoryChip:v,versionChip:b,date:S,title:T,body:E,linkList:A,link:U,newBadge:B},L={release:"whatsNew.category.release",notice:"whatsNew.category.notice",deprecation:"whatsNew.category.deprecation",tip:"whatsNew.category.tip"};function f({announcement:s,isNew:p}){const{locale:r,t:o}=u(),i=p?a.cardUnread:a.cardRead,g=s.title[r]??s.title.en,l=s.body[r]??s.body.en,d=s.links??(s.link?[s.link]:[]),h=n=>typeof n=="string"?n:n[r]??n.en;return e.jsxs("div",{className:`${a.card} ${i}`,children:[e.jsxs("div",{className:a.topRow,children:[e.jsx("span",{className:a.categoryChip,children:o(L[s.category])}),s.version&&e.jsx("span",{className:a.versionChip,children:s.version}),p&&e.jsx("span",{className:a.newBadge,children:o("whatsNew.newBadge","NEW")}),e.jsx("span",{className:a.date,children:s.date})]}),e.jsx("h3",{className:a.title,children:g}),e.jsx("p",{className:a.body,children:l}),d.length>0&&e.jsx("div",{className:a.linkList,children:d.map(n=>{const _=h(n.url),t=h(n.label);return e.jsxs("a",{className:a.link,href:_,target:"_blank",rel:"noopener noreferrer",children:["↗"," ",t]},_)})})]})}const $="_page_1talg_2",M="_section_1talg_10",z="_sectionTitle_1talg_16",H="_unreadCount_1talg_28",P="_empty_1talg_43",W="_divider_1talg_51",c={page:$,section:M,sectionTitle:z,unreadCount:H,empty:P,divider:W};function O(){const{t:s}=u(),{readSet:p,markRead:r}=y(),o=N.useMemo(()=>{const t=[];for(const m of w)p.has(m.id)||t.push(m.id);return t},[]),i=N.useRef(o);i.current=o,N.useEffect(()=>()=>{i.current.length>0&&r(i.current)},[]);const g=N.useMemo(()=>new Set(o),[o]),l=w.filter(t=>g.has(t.id)),d=w.filter(t=>!g.has(t.id)),h=l.length>0,n=d.length>0,_=e.jsx(x,{title:s("whatsNew.pageTitle","What's New"),description:s("whatsNew.pageSubtitle","Stay up to date with MCP changes"),helpTopicId:"whatsNew"});return w.length===0?e.jsxs("div",{className:c.page,children:[_,e.jsx("p",{className:c.empty,children:s("whatsNew.empty","No announcements yet")})]}):e.jsxs("div",{className:c.page,children:[_,h&&e.jsxs("section",{className:c.section,children:[e.jsxs("h2",{className:c.sectionTitle,children:[s("whatsNew.unreadSection","Unread"),e.jsx("span",{className:c.unreadCount,children:l.length})]}),l.map(t=>e.jsx(f,{announcement:t,isNew:!0},`unread-${t.id}`))]}),h&&n&&e.jsx("hr",{className:c.divider}),n&&e.jsxs("section",{className:c.section,children:[e.jsx("h2",{className:c.sectionTitle,children:s("whatsNew.allSection","All Announcements")}),d.map(t=>e.jsx(f,{announcement:t,isNew:!1},`all-${t.id}`))]})]})}export{O as Component};
|