@weppy/roblox-mcp 2.17.8 → 2.17.10
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 +27 -0
- package/README.md +14 -5
- package/dashboard/dist/assets/{AiPromptExamples-FjV57hJp.js → AiPromptExamples-BSFrFYar.js} +1 -1
- package/dashboard/dist/assets/AssetsPage-Bt9gZnJ_.js +61 -0
- package/dashboard/dist/assets/ChangelogPage-C4tBBoXT.js +1 -0
- package/dashboard/dist/assets/{ConfirmModal-Ddk0UX_P.js → ConfirmModal-BbqpSaVw.js} +1 -1
- package/dashboard/dist/assets/ConnectionPage-BStKoHK8.css +1 -0
- package/dashboard/dist/assets/ConnectionPage-Sy7xUWtJ.js +6 -0
- package/dashboard/dist/assets/{ControlsPage-Cl_mQpzx.js → ControlsPage-ECpr55X_.js} +1 -1
- package/dashboard/dist/assets/{GameChangeDetail-br9EgICc.js → GameChangeDetail-DJ0xywJq.js} +1 -1
- package/dashboard/dist/assets/InfoLabel-DAd1I756.js +1 -0
- package/dashboard/dist/assets/OverviewPage-C2xJb1Wf.js +1 -0
- package/dashboard/dist/assets/{PageHeader-Dc41DgFB.js → PageHeader-_z4Dtkbg.js} +1 -1
- package/dashboard/dist/assets/PlaceSelectOptions-Dd_m61bQ.js +1 -0
- package/dashboard/dist/assets/{PlaytestAiPromptExamples-CkR6t6Na.js → PlaytestAiPromptExamples-CNe0qWb1.js} +1 -1
- package/dashboard/dist/assets/{PlaytestPage-ShadLIAO.js → PlaytestPage-DZa14JH0.js} +18 -23
- package/dashboard/dist/assets/{SettingsPage-CGGHBxbL.js → SettingsPage-BiDPnuz8.js} +1 -1
- package/dashboard/dist/assets/SyncPage-BIm9tW0s.css +1 -0
- package/dashboard/dist/assets/SyncPage-EcDvwdB8.js +1 -0
- package/dashboard/dist/assets/Tabs-BoD1I6c5.js +1 -0
- package/dashboard/dist/assets/{CurrentPlaceScope-B6NllTmu.css → Tabs-Ci4-OJm-.css} +1 -1
- package/dashboard/dist/assets/{TierPromoPanel-B0BctivD.js → TierPromoPanel-CQQdO5mK.js} +1 -1
- package/dashboard/dist/assets/ToolsPage-D7ovZ3QM.js +1 -0
- package/dashboard/dist/assets/TooltipText-NA7u0bu6.js +1 -0
- package/dashboard/dist/assets/{UiStudioPage-DzG_JVxv.js → UiStudioPage-wYZQClUu.js} +2 -2
- package/dashboard/dist/assets/{WhatsNewPage-BpSGOLxW.js → WhatsNewPage-D3cvOOAD.js} +1 -1
- package/dashboard/dist/assets/{bot-BCKWpJd_.js → bot-D89pfHg8.js} +1 -1
- package/dashboard/dist/assets/{check-DvBWmDvn.js → check-GVlTbKVy.js} +1 -1
- package/dashboard/dist/assets/{copy-vqzBh0XB.js → copy-DVGVC27v.js} +1 -1
- package/dashboard/dist/assets/index-uP4eoQi-.js +746 -0
- package/dashboard/dist/assets/rotate-ccw-Dxk8CuFi.js +6 -0
- package/dashboard/dist/assets/sample-requests-CQy_WSFJ.js +1 -0
- package/dashboard/dist/assets/{trash-2-zj182u9_.js → trash-2-CEfHj47n.js} +1 -1
- package/dashboard/dist/assets/useLiveUptime-BGDr-4gk.js +1 -0
- package/dashboard/dist/assets/{useSettings-Cme-nLG9.js → useSettings-kOu_k9zT.js} +1 -1
- package/dashboard/dist/index.html +1 -1
- package/dist/index.js +170 -170
- package/package.json +1 -1
- package/roblox-plugin/WeppyRobloxMCP.rbxm +0 -0
- package/dashboard/dist/assets/AssetsPage-DvCSWpoy.js +0 -61
- package/dashboard/dist/assets/ChangelogPage-BrNOX2vc.js +0 -1
- package/dashboard/dist/assets/ConnectionPage-B3fGIK2X.css +0 -1
- package/dashboard/dist/assets/ConnectionPage-B62B5vSh.js +0 -6
- package/dashboard/dist/assets/CurrentPlaceScope-Y25KxsHT.js +0 -1
- package/dashboard/dist/assets/InfoLabel-CAGC3efT.js +0 -1
- package/dashboard/dist/assets/OverviewPage-DxRlbjwz.js +0 -1
- package/dashboard/dist/assets/PlaceSelectOptions-Gd2pK9DL.js +0 -1
- package/dashboard/dist/assets/StatusBadge-Cdfb5vyE.js +0 -1
- package/dashboard/dist/assets/SyncPage-BgbrC3SP.css +0 -1
- package/dashboard/dist/assets/SyncPage-CT2ECSYt.js +0 -1
- package/dashboard/dist/assets/Tabs-CPTkUoYi.css +0 -1
- package/dashboard/dist/assets/Tabs-Dl0dNd8V.js +0 -1
- package/dashboard/dist/assets/ToolsPage-CsFjwKOz.js +0 -1
- package/dashboard/dist/assets/TooltipText-C0DmdntK.js +0 -1
- package/dashboard/dist/assets/index-CG4GxcAc.js +0 -714
- package/dashboard/dist/assets/sample-requests-BqgMpTlQ.js +0 -1
- package/dashboard/dist/assets/useLiveUptime-yZ9iKJ1B.js +0 -1
- /package/dashboard/dist/assets/{StatusBadge-C2zYt5iE.css → useLiveUptime-C2zYt5iE.css} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weppy/roblox-mcp",
|
|
3
|
-
"version": "2.17.
|
|
3
|
+
"version": "2.17.10",
|
|
4
4
|
"description": "MCP (Model Context Protocol) server for Roblox Studio integration - enables AI coding agents to interact with Roblox Studio in real-time",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
Binary file
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import{f as le,b as F,l as we,u as ce,j as s,P as ws,I as Rs,r as c,F as $s,m as Ls,R as fs,X as Xe,E as Us,n as bs,g as Ts,o as Ve,p as be,q as Pe,t as Bs,a as Es,e as Gs}from"./index-CG4GxcAc.js";import{C as ys}from"./ConfirmModal-Ddk0UX_P.js";import{B as me,C as Ms,D as Qe,b as Ds,P as Fs}from"./PageHeader-Dc41DgFB.js";import{P as Os,a as Hs}from"./PlaceSelectOptions-Gd2pK9DL.js";import{T as ee}from"./TooltipText-C0DmdntK.js";import{A as zs}from"./AiPromptExamples-FjV57hJp.js";import{B as Ks}from"./bot-BCKWpJd_.js";import{T as Ws}from"./trash-2-zj182u9_.js";import{C as js}from"./copy-vqzBh0XB.js";import"./ConfirmModal.module-DJksQHBd.js";/**
|
|
2
|
-
* @license lucide-react v1.8.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const Vs=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Ys=le("arrow-left",Vs);/**
|
|
7
|
-
* @license lucide-react v1.8.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const qs=[["path",{d:"M2 10v3",key:"1fnikh"}],["path",{d:"M6 6v11",key:"11sgs0"}],["path",{d:"M10 3v18",key:"yhl04a"}],["path",{d:"M14 8v7",key:"3a1oy3"}],["path",{d:"M18 5v13",key:"123xd1"}],["path",{d:"M22 10v3",key:"154ddg"}]],Xs=le("audio-lines",qs);/**
|
|
12
|
-
* @license lucide-react v1.8.0 - ISC
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the ISC license.
|
|
15
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const Js=[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}]],Zs=le("badge",Js);/**
|
|
17
|
-
* @license lucide-react v1.8.0 - ISC
|
|
18
|
-
*
|
|
19
|
-
* This source code is licensed under the ISC license.
|
|
20
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const Qs=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],et=le("box",Qs);/**
|
|
22
|
-
* @license lucide-react v1.8.0 - ISC
|
|
23
|
-
*
|
|
24
|
-
* This source code is licensed under the ISC license.
|
|
25
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/const st=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],He=le("chevron-right",st);/**
|
|
27
|
-
* @license lucide-react v1.8.0 - ISC
|
|
28
|
-
*
|
|
29
|
-
* This source code is licensed under the ISC license.
|
|
30
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
-
*/const tt=[["path",{d:"m12.296 3.464 3.02 3.956",key:"qash78"}],["path",{d:"M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3z",key:"1h7j8b"}],["path",{d:"M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"4lm6w1"}],["path",{d:"m6.18 5.276 3.1 3.899",key:"zjj9t3"}]],at=le("clapperboard",tt);/**
|
|
32
|
-
* @license lucide-react v1.8.0 - ISC
|
|
33
|
-
*
|
|
34
|
-
* This source code is licensed under the ISC license.
|
|
35
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/const lt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M3 7.5h4",key:"zfgn84"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 16.5h4",key:"1230mu"}],["path",{d:"M17 3v18",key:"in4fa5"}],["path",{d:"M17 7.5h4",key:"myr1c1"}],["path",{d:"M17 16.5h4",key:"go4c1d"}]],nt=le("film",lt);/**
|
|
37
|
-
* @license lucide-react v1.8.0 - ISC
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the ISC license.
|
|
40
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/const ot=[["path",{d:"M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1",key:"fm4g5t"}],["path",{d:"M2 13h10",key:"pgb2dq"}],["path",{d:"m9 16 3-3-3-3",key:"6m91ic"}]],rt=le("folder-input",ot);/**
|
|
42
|
-
* @license lucide-react v1.8.0 - ISC
|
|
43
|
-
*
|
|
44
|
-
* This source code is licensed under the ISC license.
|
|
45
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
-
*/const it=[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 12h18",key:"1i2n21"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]],dt=le("grid-2x2",it);/**
|
|
47
|
-
* @license lucide-react v1.8.0 - ISC
|
|
48
|
-
*
|
|
49
|
-
* This source code is licensed under the ISC license.
|
|
50
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
-
*/const ct=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],ut=le("list",ct);/**
|
|
52
|
-
* @license lucide-react v1.8.0 - ISC
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the ISC license.
|
|
55
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
-
*/const pt=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],ht=le("search",pt);/**
|
|
57
|
-
* @license lucide-react v1.8.0 - ISC
|
|
58
|
-
*
|
|
59
|
-
* This source code is licensed under the ISC license.
|
|
60
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
-
*/const mt=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],xt=le("upload",mt);function vs(e){if(e.scope==="place"&&typeof e.placeId=="number")return{placeId:String(e.placeId)}}function ne(e){const t=vs(e);return t?`?placeId=${encodeURIComponent(t.placeId)}`:""}function $e(e){return`/api/assets/${encodeURIComponent(e.scope)}/${encodeURIComponent(e.category)}`}function ue(e,t){return`${$e(e)}/${encodeURIComponent(t)}`}async function gt(e){return F.get($e(e),vs(e))}async function ft(e){return F.post(`${$e(e)}/rescan${ne(e)}`,{})}async function bt(e,t,n){return(await F.patch(`${ue(e,t)}${ne(e)}`,n)).asset}async function yt(e,t){return F.delete(`${ue(e,t)}${ne(e)}`)}async function jt(e,t,n){return(await F.post(`${ue(e,t)}/upload${ne(e)}`,n)).asset}async function es(e,t){return(await F.post(`${ue(e,t)}/status-refresh${ne(e)}`,{})).asset}async function vt(e,t,n){const l={...e,placeId:n??e.placeId};return F.post(`${ue(e,t)}/usage-scan${ne(l)}`,{})}async function Ct(e,t){return F.post(`${$e(e)}/export-selection-rbxm${ne(e)}`,t)}async function _t(e,t,n){return F.post(`${ue(e,t)}/import-rbxm${ne(e)}`,n)}async function St(e,t){return(await F.post(`${ue(e,t)}/thumbnail-generate${ne(e)}`,{})).asset}function Cs(e){return e.fileUrl?`${we}${e.fileUrl}`:`${we}/api/assets/${e.scope.kind}/${e.category}/${encodeURIComponent(e.id)}/file${ne({scope:e.scope.kind,placeId:e.scope.kind==="place"?e.scope.placeId:void 0})}`}function Ye(e){return e.previewUrl?`${we}${e.previewUrl}`:`${we}/api/assets/${e.scope.kind}/${e.category}/${encodeURIComponent(e.id)}/preview${ne({scope:e.scope.kind,placeId:e.scope.kind==="place"?e.scope.placeId:void 0})}`}const _s=["all","image","decal","rbxm"],Nt=new Set(_s),ss=["model","animation"];function Ie(e){return/\.(rbxm|rbxmx)$/i.test(e.file.original)}function At(e){return Nt.has(e)}function qe(e,t){return e==="all"?t("assets.category.all","All"):t(`assets.category.${e}`,e==="rbxm"?"RBXM":e)}function ie(e,t){return qe(Ie(e)?"rbxm":e.category,t)}function Pt(e){return e==="all"?["image","decal",...ss]:e==="rbxm"?ss:[e]}function It(e,t){return t==="all"?e.category==="image"||e.category==="decal"||Ie(e):t==="rbxm"?Ie(e):(t==="model"||t==="animation")&&Ie(e)?!1:e.category===t}function kt(e){return[...e].sort((t,n)=>n.createdAt.localeCompare(t.createdAt)||n.id.localeCompare(t.id))}function Le(e){return e?e.split("/").filter(Boolean):[]}function Je(e,t){return t.every((n,l)=>e[l]===n)}function Ss(e,t){return t.createdAt.localeCompare(e.createdAt)||t.id.localeCompare(e.id)}function se(e){const t=e.scope.kind==="place"?e.scope.placeId:"-";return`${e.scope.kind}:${t}:${e.category}:${e.id}`}function Ze(e){return Le(e.folderPath)}function wt(e,t){const n=Le(t),l=new Map;for(const o of e){const f=Ze(o);if(f.length<=n.length||!Je(f,n))continue;const g=f[n.length],x=[...n,g].join("/"),p=l.get(x);p?p.descendantCount+=1:l.set(x,{name:g,path:x,descendantCount:1})}return[...l.values()].sort((o,f)=>o.name.localeCompare(f.name))}function Rt(e,t){const n=Le(t);return e.filter(l=>{const o=Ze(l);return o.length===n.length&&Je(o,n)}).sort(Ss)}function $t(e){return[...e].sort(Ss)}function Lt(e,t){const n=Le(t);for(;n.length>0;){if(e.some(o=>{const f=Ze(o);return f.length>=n.length&&Je(f,n)}))return n.join("/");n.pop()}return""}const Ut="_page_leed4_1",Tt="_experimentalBadge_leed4_9",Bt="_toolbarShell_leed4_23",Et="_toolbar_leed4_23",Gt="_segmented_leed4_41",Mt="_placeContextSlot_leed4_45",Dt="_listContextSummary_leed4_50",Ft="_toolbarActions_leed4_54",Ot="_toolbarExpandedSummary_leed4_59",Ht="_placeFolderDetails_leed4_67",zt="_categoryControl_leed4_72",Kt="_placeStatusGroup_leed4_94",Wt="_contextTextSummary_leed4_95",Vt="_contextDivider_leed4_116",Yt="_categoryControlLabel_leed4_120",qt="_categoryRail_leed4_126",Xt="_categoryButton_leed4_134",Jt="_categoryButtonActive_leed4_163",Zt="_copyRow_leed4_176",Qt="_buttonRow_leed4_177",ea="_segmentedActive_leed4_219",sa="_placeSelectorLabel_leed4_224",ta="_placeSelect_leed4_224",aa="_sharedPlaceContext_leed4_251",la="_commandButton_leed4_277",na="_primaryButton_leed4_278",oa="_iconButton_leed4_279",ra="_dangerButton_leed4_319",ia="_iconButtonActive_leed4_340",da="_grid_leed4_353",ca="_folderGrid_leed4_361",ua="_explorer_leed4_370",pa="_explorerToolbar_leed4_377",ha="_explorerLocation_leed4_387",ma="_breadcrumb_leed4_413",xa="_breadcrumbSegment_leed4_414",ga="_viewOptions_leed4_457",fa="_organizationModeControl_leed4_465",ba="_viewModeControl_leed4_466",ya="_gridSizeControl_leed4_467",ja="_explorerSection_leed4_520",va="_folderTile_leed4_543",Ca="_folderListRow_leed4_568",_a="_assetListRow_leed4_569",Sa="_assetCard_leed4_570",Na="_folderIcon_leed4_575",Aa="_folderName_leed4_587",Pa="_folderCount_leed4_599",Ia="_assetList_leed4_569",ka="_folderList_leed4_568",wa="_assetListHeader_leed4_613",Ra="_listPreviewWrap_leed4_650",$a="_listPreview_leed4_650",La="_listPreviewFallback_leed4_652",Ua="_listAssetName_leed4_681",Ta="_listAssetCategory_leed4_693",Ba="_listAssetScope_leed4_694",Ea="_listAssetUpdated_leed4_695",Ga="_folderType_leed4_696",Ma="_folderScope_leed4_697",Da="_folderStatus_leed4_698",Fa="_folderUpdated_leed4_699",Oa="_assetCardSelected_leed4_728",Ha="_thumbnailWrap_leed4_733",za="_thumbnail_leed4_733",Ka="_thumbnailFallback_leed4_749",Wa="_assetCardBody_leed4_760",Va="_assetName_leed4_767",Ya="_assetMeta_leed4_775",qa="_statusChip_leed4_782",Xa="_categoryPill_leed4_783",Ja="_assetId_leed4_788",Za="_scopeText_leed4_789",Qa="_muted_leed4_790",el="_emptyState_leed4_795",sl="_notice_leed4_796",tl="_errorState_leed4_797",al="_messageState_leed4_798",ll="_emptyGuide_leed4_822",nl="_emptyGuideHeader_leed4_832",ol="_emptyGuideMethod_leed4_833",rl="_emptyGuideSteps_leed4_855",il="_emptyGuideMethods_leed4_861",dl="_emptyGuideMethodTitle_leed4_875",cl="_emptyGuideTierNote_leed4_893",ul="_emptyGuideMethodHelp_leed4_898",pl="_emptyGuideCapabilityDescription_leed4_899",hl="_emptyGuideChoices_leed4_905",ml="_emptyGuideChoice_leed4_905",xl="_emptyGuideChoiceSelected_leed4_933",gl="_emptyGuideChoiceLabel_leed4_943",fl="_emptyGuideCapability_leed4_899",bl="_emptyGuideAction_leed4_959",yl="_proNotice_leed4_989",jl="_rbxmGuide_leed4_1007",vl="_settingsInlinePanel_leed4_1047",Cl="_settingsDrawer_leed4_1067",_l="_detailPopupLayer_leed4_1083",Sl="_detailDialog_leed4_1099",Nl="_detailDialogHeader_leed4_1116",Al="_detailTitleBlock_leed4_1127",Pl="_detailEyebrow_leed4_1149",Il="_detailHeaderActions_leed4_1158",kl="_detailDialogBody_leed4_1166",wl="_detailPreviewPane_leed4_1175",Rl="_detailPreview_leed4_1175",$l="_detailPreviewFallback_leed4_1187",Ll="_detailContentPane_leed4_1223",Ul="_formStack_leed4_1229",Tl="_drawerHeader_leed4_1233",Bl="_detailSection_leed4_1284",El="_noticeList_leed4_1285",Gl="_settingsPanel_leed4_1286",Ml="_setupNotice_leed4_1303",Dl="_field_leed4_1328",Fl="_fieldLabelRow_leed4_1336",Ol="_fieldHelp_leed4_1360",Hl="_twoColumn_leed4_1365",zl="_technicalDetails_leed4_1376",Kl="_detailGrid_leed4_1393",Wl="_metadataList_leed4_1394",Vl="_compactMeta_leed4_1405",Yl="_copyableValue_leed4_1432",ql="_inlineCopyButton_leed4_1443",Xl="_hashText_leed4_1464",Jl="_usageList_leed4_1468",Zl="_usageItem_leed4_1474",Ql="_metadataItem_leed4_1475",en="_settingsSubsection_leed4_1523",sn="_settingsSectionHeader_leed4_1528",tn="_settingsDefinitionList_leed4_1541",an="_toggleRow_leed4_1563",ln="_inlineHelp_leed4_1577",a={page:Ut,experimentalBadge:Tt,toolbarShell:Bt,toolbar:Et,segmented:Gt,placeContextSlot:Mt,listContextSummary:Dt,toolbarActions:Ft,toolbarExpandedSummary:Ot,placeFolderDetails:Ht,categoryControl:zt,placeStatusGroup:Kt,contextTextSummary:Wt,contextDivider:Vt,categoryControlLabel:Yt,categoryRail:qt,categoryButton:Xt,categoryButtonActive:Jt,copyRow:Zt,buttonRow:Qt,segmentedActive:ea,placeSelectorLabel:sa,placeSelect:ta,sharedPlaceContext:aa,commandButton:la,primaryButton:na,iconButton:oa,dangerButton:ra,iconButtonActive:ia,grid:da,folderGrid:ca,explorer:ua,explorerToolbar:pa,explorerLocation:ha,breadcrumb:ma,breadcrumbSegment:xa,viewOptions:ga,organizationModeControl:fa,viewModeControl:ba,gridSizeControl:ya,explorerSection:ja,folderTile:va,folderListRow:Ca,assetListRow:_a,assetCard:Sa,folderIcon:Na,folderName:Aa,folderCount:Pa,assetList:Ia,folderList:ka,assetListHeader:wa,listPreviewWrap:Ra,listPreview:$a,listPreviewFallback:La,listAssetName:Ua,listAssetCategory:Ta,listAssetScope:Ba,listAssetUpdated:Ea,folderType:Ga,folderScope:Ma,folderStatus:Da,folderUpdated:Fa,assetCardSelected:Oa,thumbnailWrap:Ha,thumbnail:za,thumbnailFallback:Ka,assetCardBody:Wa,assetName:Va,assetMeta:Ya,statusChip:qa,categoryPill:Xa,assetId:Ja,scopeText:Za,muted:Qa,emptyState:el,notice:sl,errorState:tl,messageState:al,emptyGuide:ll,emptyGuideHeader:nl,emptyGuideMethod:ol,emptyGuideSteps:rl,emptyGuideMethods:il,emptyGuideMethodTitle:dl,emptyGuideTierNote:cl,emptyGuideMethodHelp:ul,emptyGuideCapabilityDescription:pl,emptyGuideChoices:hl,emptyGuideChoice:ml,emptyGuideChoiceSelected:xl,emptyGuideChoiceLabel:gl,emptyGuideCapability:fl,emptyGuideAction:bl,proNotice:yl,rbxmGuide:jl,settingsInlinePanel:vl,settingsDrawer:Cl,detailPopupLayer:_l,detailDialog:Sl,detailDialogHeader:Nl,detailTitleBlock:Al,detailEyebrow:Pl,detailHeaderActions:Il,detailDialogBody:kl,detailPreviewPane:wl,detailPreview:Rl,detailPreviewFallback:$l,detailContentPane:Ll,formStack:Ul,drawerHeader:Tl,detailSection:Bl,noticeList:El,settingsPanel:Gl,setupNotice:Ml,field:Dl,fieldLabelRow:Fl,fieldHelp:Ol,twoColumn:Hl,technicalDetails:zl,detailGrid:Kl,metadataList:Wl,compactMeta:Vl,copyableValue:Yl,inlineCopyButton:ql,hashText:Xl,usageList:Jl,usageItem:Zl,metadataItem:Ql,settingsSubsection:en,settingsSectionHeader:sn,settingsDefinitionList:tn,toggleRow:an,inlineHelp:ln},nn={image:Rs,decal:Zs,audio:Xs,mesh:et,model:ws,video:nt,animation:at};function Re(e,t){return t(`assets.status.${e}`,e)}function ts(e){switch(e){case"uploaded":return"success";case"failed":return"error";case"processing":case"uploading":return"warning";case"localOnly":case"superseded":default:return"neutral"}}function as(e){return e.category==="image"||e.category==="decal"||!!e.file.preview}function on(e){return e.category==="decal"?e.roblox.creatorAssetId??e.roblox.assetId:e.roblox.assetId}function Ns(e,t){var g;const n=((g=e.rbxm)==null?void 0:g.studioUploads)??[];if(n.length===0)return null;const l=n.filter(x=>x.status==="uploaded").length,o=n.filter(x=>x.status==="failed").length,f=[l>0?`${l} ${t("assets.detail.rbxmStudioUploadsUploaded","uploaded")}`:null,o>0?`${o} ${t("assets.detail.rbxmStudioUploadsFailed","failed")}`:null].filter(Boolean);return`${t("assets.detail.rbxmStudioUploadsLabel","Studio uploads")}: ${f.join(", ")}`}function rn({assets:e,selectedAssetId:t,selectedAssetKey:n=null,viewMode:l="grid",gridSize:o="medium",onSelect:f}){const{t:g}=ce();return e.length===0?s.jsxs("div",{className:a.emptyState,children:[s.jsx("p",{children:g("assets.empty.title","No assets yet")}),s.jsx("span",{children:g("assets.empty.body","Choose a scope and category, then rescan that inbox folder.")})]}):s.jsx("div",{className:l==="list"?a.assetList:a.grid,"data-view-mode":l,"data-grid-size":o,children:e.map(x=>{const p=nn[x.category],L=on(x),K=Ns(x,g),B=se(x),R=n?n===B:t===x.id,r=x.scope.kind==="shared"?g("assets.scope.shared","Shared"):g("assets.scope.place","Current Place");return l==="list"?s.jsxs("button",{type:"button",className:[a.assetListRow,R?a.assetCardSelected:""].filter(Boolean).join(" "),onClick:()=>f(B),children:[s.jsx("span",{className:a.listPreviewWrap,children:as(x)?s.jsx("img",{className:a.listPreview,src:Ye(x),alt:"",loading:"lazy"}):s.jsx("span",{className:a.listPreviewFallback,"aria-hidden":"true",children:s.jsx(p,{size:18})})}),s.jsx("span",{className:a.listAssetName,children:x.displayName}),s.jsx("span",{className:a.listAssetCategory,children:ie(x,g)}),s.jsx("span",{className:a.listAssetScope,children:r}),s.jsx(me,{variant:ts(x.status),className:a.statusChip,children:Re(x.status,g)}),s.jsx("time",{className:a.listAssetUpdated,dateTime:x.updatedAt,children:new Date(x.updatedAt).toLocaleDateString()})]},B):s.jsxs("button",{type:"button",className:[a.assetCard,R?a.assetCardSelected:""].filter(Boolean).join(" "),onClick:()=>f(B),children:[s.jsx("span",{className:a.thumbnailWrap,children:as(x)?s.jsx("img",{className:a.thumbnail,src:Ye(x),alt:x.displayName,loading:"lazy"}):s.jsx("span",{className:a.thumbnailFallback,"aria-hidden":"true",children:s.jsx(p,{size:30})})}),s.jsxs("span",{className:a.assetCardBody,children:[s.jsx("span",{className:a.assetName,children:x.displayName}),s.jsxs("span",{className:a.assetMeta,children:[s.jsx(me,{variant:"neutral",className:a.categoryPill,children:ie(x,g)}),s.jsx(me,{variant:ts(x.status),className:a.statusChip,children:Re(x.status,g)})]}),s.jsxs("span",{className:a.assetMeta,children:[s.jsx("span",{className:a.scopeText,children:r}),s.jsx("span",{className:a.assetId,children:L?`#${L}`:K??g("assets.status.localOnly","Local only")})]})]})]},B)})})}function ls(e){return{scope:e==="all"?null:e,folderPath:""}}function ze(e,t,n){return t==="shared"?e.scope.kind==="shared":e.scope.kind==="place"&&(n===null||e.scope.placeId===n)}function dn(e,t){var n;return t?e.folderPath===t||((n=e.folderPath)==null?void 0:n.startsWith(`${t}/`))===!0:!0}function cn({displayScope:e,assets:t,place:n,categoryFilter:l,organizationMode:o,viewMode:f,gridSize:g,selectedAssetKey:x,onSelectAsset:p,onClearSelection:L,onOrganizationModeChange:K,onViewModeChange:B,onGridSizeChange:R,emptyContent:r}){const{t:b}=ce(),[N,T]=c.useState(()=>ls(e)),W=c.useRef(`${e}:${n.placeId??"-"}`),V=c.useRef(!1),D=c.useRef(null),G=m=>m==="shared"?b("assets.scope.shared","Shared"):n.placeName??b("assets.scope.place","Current Place"),E=m=>{V.current=!0,T(m),L()};c.useEffect(()=>{const m=`${e}:${n.placeId??"-"}`;W.current!==m&&(W.current=m,V.current=!0,T(ls(e)),L())},[e,L,n.placeId]),c.useEffect(()=>{var m;V.current&&(V.current=!1,(m=D.current)==null||m.focus())},[N]);const H=c.useMemo(()=>N.scope===null?[]:t.filter(m=>ze(m,N.scope,n.placeId)),[t,N.scope,n.placeId]);c.useEffect(()=>{if(N.scope===null)return;const m=Lt(H,N.folderPath);m!==N.folderPath&&(V.current=!0,T(U=>({...U,folderPath:m})),L())},[l,N.folderPath,N.scope,L,H]);const M=c.useMemo(()=>o==="folders"?wt(H,N.folderPath):[],[N.folderPath,o,H]),q=c.useMemo(()=>e==="all"?t:t.filter(m=>ze(m,e,n.placeId)),[t,e,n.placeId]),P=c.useMemo(()=>o==="all-assets"?$t(q):Rt(H,N.folderPath),[q,N.folderPath,o,H]);c.useEffect(()=>{x&&(P.some(m=>se(m)===x)||L())},[L,x,P]);const I=N.folderPath?N.folderPath.split("/"):[],X=o==="all-assets"?b("assets.organization.all","All assets"):I[I.length-1]??(N.scope?G(N.scope):b("assets.scope.all","All scopes")),$=N.scope===null?t.length:H.filter(m=>dn(m,N.folderPath)).length,y=Math.max(0,$-P.length),i=o==="all-assets"?b("assets.organization.summary","{count} assets").replace("{count}",String(P.length)):b("assets.explorer.summary","{direct} in this folder · {descendant} in subfolders").replace("{direct}",String(P.length)).replace("{descendant}",String(y)),A=m=>m===1?b("assets.folder.count.one","1 asset"):b("assets.folder.count.many","{count} assets").replace("{count}",String(m)),te=(m,U,h,z,_)=>s.jsxs("button",{type:"button",className:f==="list"?a.folderListRow:a.folderTile,"aria-label":`${U}, ${A(h)}`,onClick:_,children:[s.jsx("span",{className:a.folderIcon,"aria-hidden":"true",children:s.jsx($s,{size:f==="list"?22:28})}),s.jsx("span",{className:a.folderName,children:U}),f==="list"?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:a.folderType,children:b("assets.folder.type","Folder")}),s.jsx("span",{className:a.folderScope,children:G(z)}),s.jsx("span",{className:a.folderStatus,children:A(h)}),s.jsx("span",{className:a.folderUpdated,children:"—"})]}):s.jsx("span",{className:a.folderCount,children:A(h)})]},m),w=o==="folders"&&e==="all"&&N.scope===null?[{scope:"place",name:G("place")},{scope:"shared",name:G("shared")}].map(({scope:m,name:U})=>({scope:m,name:U,count:t.filter(h=>ze(h,m,n.placeId)).length})):[];return s.jsxs("section",{className:a.explorer,"aria-label":b("assets.explorer.label","Asset explorer"),children:[s.jsxs("div",{className:a.explorerToolbar,children:[s.jsxs("div",{className:a.explorerLocation,children:[s.jsxs("nav",{className:a.breadcrumb,"aria-label":b("assets.breadcrumb.label","Asset path"),children:[o==="all-assets"?s.jsxs(s.Fragment,{children:[s.jsx("span",{children:e==="all"?b("assets.scope.all","All scopes"):G(e)}),s.jsx(He,{size:14,"aria-hidden":"true"}),s.jsx("span",{"aria-current":"page",children:b("assets.organization.all","All assets")})]}):e==="all"?N.scope===null?s.jsx("span",{"aria-current":"page",children:b("assets.scope.all","All scopes")}):s.jsx("button",{type:"button",onClick:()=>E({scope:null,folderPath:""}),children:b("assets.scope.all","All scopes")}):null,o==="folders"&&N.scope?s.jsxs(s.Fragment,{children:[e==="all"?s.jsx(He,{size:14,"aria-hidden":"true"}):null,I.length>0?s.jsx("button",{type:"button",onClick:()=>E({scope:N.scope,folderPath:""}),children:G(N.scope)}):s.jsx("span",{"aria-current":"page",children:G(N.scope)})]}):null,o==="folders"&&I.map((m,U)=>{const h=I.slice(0,U+1).join("/"),z=U===I.length-1;return s.jsxs("span",{className:a.breadcrumbSegment,children:[s.jsx(He,{size:14,"aria-hidden":"true"}),z?s.jsx("span",{"aria-current":"page",children:m}):s.jsx("button",{type:"button",onClick:()=>E({scope:N.scope,folderPath:h}),children:m})]},h)})]}),s.jsx("h2",{ref:D,tabIndex:-1,children:X}),s.jsx("p",{children:i})]}),s.jsxs("div",{className:a.viewOptions,"aria-label":b("assets.view.options","View options"),children:[s.jsxs("div",{className:a.organizationModeControl,role:"group","aria-label":b("assets.organization.label","Browse"),children:[s.jsx("button",{type:"button","aria-pressed":o==="folders",onClick:()=>K("folders"),children:b("assets.organization.folders","Folders")}),s.jsx("button",{type:"button","aria-pressed":o==="all-assets",onClick:()=>K("all-assets"),children:b("assets.organization.all","All assets")})]}),s.jsxs("div",{className:a.viewModeControl,role:"group","aria-label":b("assets.view.mode","View mode"),children:[s.jsxs("button",{type:"button","aria-pressed":f==="grid",onClick:()=>B("grid"),children:[s.jsx(dt,{size:14}),b("assets.view.grid","Grid")]}),s.jsxs("button",{type:"button","aria-pressed":f==="list",onClick:()=>B("list"),children:[s.jsx(ut,{size:14}),b("assets.view.list","List")]})]}),s.jsx("div",{className:a.gridSizeControl,role:"group","aria-label":b("assets.view.thumbnailSize","Thumbnail size"),title:f==="list"?b("assets.view.thumbnailSize.listReason","Thumbnail size is available in Grid view."):void 0,children:["small","medium","large"].map(m=>s.jsx("button",{type:"button","aria-pressed":g===m,disabled:f==="list",onClick:()=>R(m),children:b(`assets.view.size.${m}`,m[0].toUpperCase()+m.slice(1))},m))})]})]}),f==="list"&&(w.length>0||M.length>0||P.length>0)?s.jsxs("div",{className:a.assetListHeader,"aria-hidden":"true",children:[s.jsx("span",{}),s.jsx("span",{children:b("assets.list.name","Name")}),s.jsx("span",{children:b("assets.list.type","Type")}),s.jsx("span",{children:b("assets.list.scope","Scope")}),s.jsx("span",{children:b("assets.list.status","Status")}),s.jsx("span",{children:b("assets.list.updated","Updated")})]}):null,w.length>0?s.jsxs("section",{className:a.explorerSection,children:[s.jsx("h3",{children:b("assets.folders.title","Folders")}),s.jsx("div",{className:f==="list"?a.folderList:a.folderGrid,"data-grid-size":g,children:w.map(m=>te(`scope:${m.scope}`,m.name,m.count,m.scope,()=>E({scope:m.scope,folderPath:""})))})]}):null,M.length>0?s.jsxs("section",{className:a.explorerSection,children:[s.jsx("h3",{children:b("assets.folders.title","Folders")}),s.jsx("div",{className:f==="list"?a.folderList:a.folderGrid,"data-grid-size":g,children:M.map(m=>te(m.path,m.name,m.descendantCount,N.scope,()=>E({scope:N.scope,folderPath:m.path})))})]}):null,P.length>0?s.jsxs("section",{className:a.explorerSection,"aria-label":o==="all-assets"?b("assets.organization.all","All assets"):void 0,children:[o==="folders"?s.jsx("h3",{children:b("assets.folder.assetsTitle","Assets in this folder")}):null,s.jsx(rn,{assets:P,selectedAssetId:null,selectedAssetKey:x,viewMode:f,gridSize:g,onSelect:p})]}):null,M.length===0&&P.length===0&&(w.length===0||t.length===0)?l==="all"&&t.length===0&&r?r:s.jsxs("div",{className:a.emptyState,children:[s.jsx("p",{children:t.length===0?l==="all"?b("assets.empty.title","No assets yet"):b("assets.empty.filteredTitle","No assets match this filter"):b("assets.empty.folderTitle","No matching assets in this folder")}),s.jsx("span",{children:t.length===0?l==="all"?b("assets.empty.body","Choose a scope and category, then rescan that inbox folder."):b("assets.empty.filteredBody","Choose another category or rescan the matching inbox folders."):b("assets.empty.folderBody","Try another folder or category filter.")})]}):null]})}function un(e){return{generate:{id:"generate-image",title:e("assets.emptyGuide.ai.generateTitle","Generate and register a new image"),request:e("assets.emptyGuide.ai.generateRequest","Create an image asset for this project. If your current tools can generate image files, first confirm its intended use, size, style, transparent-background needs, and whether to save it for the current Place or Shared. Generate the file, avoid duplicating an existing asset, register it in the WEPPY Asset Library, and make the result available on the Assets page. If you cannot generate image files, tell me and ask for an existing file location instead. Do not upload it to Roblox unless I ask.")},register:{id:"register-image",title:e("assets.emptyGuide.ai.imageTitle","Register an image file you already have"),request:e("assets.emptyGuide.ai.imageRequest","Register an image file for this project in the WEPPY Asset Library. First confirm the file location and whether to save it for the current Place or Shared. Avoid creating a duplicate of an existing asset, do not upload it to Roblox, and make the result available on the Assets page.")}}}function pn(e){const{locale:t,t:n}=ce(),[l,o]=c.useState("register"),f=un(n),g=e.scope==="all"?n("assets.emptyGuide.scope.all","Choose Current Place or Shared before adding files."):e.scope==="shared"?n("assets.emptyGuide.scope.shared","New files will be registered in the Shared library."):n("assets.emptyGuide.scope.place","New files will be registered for the selected Place.");return s.jsxs("section",{className:a.emptyGuide,children:[s.jsxs("header",{className:a.emptyGuideHeader,children:[s.jsx("h3",{children:n("assets.emptyGuide.title","Collect assets for your game")}),s.jsx("p",{children:n("assets.emptyGuide.description","Register image files or save a selected Studio model, then manage them here.")})]}),s.jsxs("div",{className:a.emptyGuideMethods,children:[s.jsxs("section",{className:a.emptyGuideMethod,children:[s.jsxs("div",{className:a.emptyGuideMethodTitle,children:[s.jsx(Ks,{size:16,"aria-hidden":"true"}),s.jsx("h4",{children:n("assets.emptyGuide.ai.title","Ask AI")})]}),s.jsx("p",{className:a.emptyGuideMethodHelp,children:n("assets.emptyGuide.ai.methodHelp","Choose a method that matches your AI. If you are unsure, register an existing image.")}),s.jsxs("div",{className:a.emptyGuideChoices,role:"radiogroup","aria-label":n("assets.emptyGuide.ai.methodLabel","Image preparation method"),children:[s.jsxs("button",{type:"button",role:"radio","aria-checked":l==="register",className:`${a.emptyGuideChoice} ${l==="register"?a.emptyGuideChoiceSelected:""}`,onClick:()=>o("register"),children:[s.jsx("span",{className:a.emptyGuideChoiceLabel,children:n("assets.emptyGuide.ai.registerOption","Register an existing image")}),s.jsx("span",{className:a.emptyGuideCapability,children:n("assets.emptyGuide.ai.registerCapability","Image generation not required")})]}),s.jsxs("button",{type:"button",role:"radio","aria-checked":l==="generate",className:`${a.emptyGuideChoice} ${l==="generate"?a.emptyGuideChoiceSelected:""}`,onClick:()=>o("generate"),children:[s.jsx("span",{className:a.emptyGuideChoiceLabel,children:n("assets.emptyGuide.ai.generateOption","Generate a new image")}),s.jsx("span",{className:a.emptyGuideCapability,children:n("assets.emptyGuide.ai.generateCapability","Image generation required")})]})]}),s.jsx("p",{className:a.emptyGuideCapabilityDescription,children:l==="register"?n("assets.emptyGuide.ai.registerDescription","Use this when you already have an image file or are unsure whether your AI can generate images."):n("assets.emptyGuide.ai.generateDescription","Use this only when your AI can create PNG or JPG files or has an image generation tool.")}),s.jsx(zs,{examples:[f[l]],resetKey:`${t}|assets-${l}`,labels:{copy:n("guidance.ai.copy","Copy request"),copying:n("guidance.ai.copying","Copying…"),copied:n("guidance.ai.copied","Copied"),copyFailed:n("guidance.ai.copyFailed","Could not copy. Select the request text and copy it manually.")},nextStep:n("guidance.ai.nextStep","Paste this request into an AI chat connected to WEPPY.")})]}),s.jsxs("section",{className:a.emptyGuideMethod,children:[s.jsxs("div",{className:a.emptyGuideMethodTitle,children:[s.jsx(rt,{size:16,"aria-hidden":"true"}),s.jsx("h4",{children:n("assets.emptyGuide.direct.title","Add files yourself")})]}),s.jsx("p",{children:g}),s.jsxs("ol",{className:a.emptyGuideSteps,children:[s.jsx("li",{children:n("assets.emptyGuide.direct.image","Put image or decal files in the inbox for the selected scope, then rescan.")}),s.jsx("li",{children:n("assets.emptyGuide.direct.model","For models, select objects in Studio and save them from WEPPY Plugin > Assets.")}),s.jsx("li",{children:n("assets.emptyGuide.direct.upload","Upload registered assets to Roblox from the asset details with Roblox Open Cloud (Pro).")})]}),!e.isPro&&s.jsx("p",{className:a.emptyGuideTierNote,children:n("assets.emptyGuide.direct.pro","Saving Studio models as RBXM and uploading assets to Roblox are available with Pro. Local image and decal registration is available on Basic.")}),s.jsx("button",{type:"button",className:a.emptyGuideAction,disabled:e.busy,onClick:e.onRescan,children:n("assets.emptyGuide.direct.rescan","Rescan inbox")})]})]})]})}const hn="https://create.roblox.com/dashboard/creations/store",mn=/^https:\/\/create\.roblox\.com\/store\/asset\/\d+(?:\/.*)?$/;function xn(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function ke(e){const t=new Date(e);if(Number.isNaN(t.getTime()))return e;const n=t.getFullYear(),l=String(t.getMonth()+1).padStart(2,"0"),o=String(t.getDate()).padStart(2,"0"),f=String(t.getHours()).padStart(2,"0"),g=String(t.getMinutes()).padStart(2,"0");return`${n}-${l}-${o} ${f}:${g}`}function gn(e){return e.category==="image"||e.category==="decal"||!!e.file.preview}function fn(e){return e.file.preview?Ye(e):Cs(e)}function bn(e){var n;const t=Object.entries(((n=e.rbxm)==null?void 0:n.classCounts)??{}).sort((l,o)=>o[1]-l[1]).slice(0,8);return t.length===0?"-":t.map(([l,o])=>`${l} ${o}`).join(", ")}function ns(e){var o;const t=(o=e.rbxm)==null?void 0:o.thumbnail;if(!t)return"-";const n=t.source?` via ${t.source}`:"",l=t.message?` · ${t.message}`:"";return`${t.status}${n}${l}`}function yn(e){var o,f;const t=(f=(o=e.rbxm)==null?void 0:o.review)==null?void 0:f.summary;if(!t)return"-";const n=[["roots",t.rootCount],["parts",t.partCount],["mesh parts",t.meshPartCount],["scripts",t.scriptCount],["unanchored",t.unanchoredPartCount]].flatMap(([g,x])=>typeof x=="number"?[`${g} ${x}`]:[]),l=t.bounds;if(l&&typeof l=="object"&&"size"in l){const g=l.size;if(g&&typeof g=="object"){const{x,y:p,z:L}=g;typeof x=="number"&&typeof p=="number"&&typeof L=="number"&&n.push(`bounds ${x} x ${p} x ${L}`)}}return n.length>0?n.join(", "):"-"}function jn(e){var n,l;const t=(n=e.rbxm)==null?void 0:n.generation;return t?t.schemaMode==="custom"&&((l=t.schemaGroups)!=null&&l.length)?`custom · ${t.schemaGroups.join(", ")}`:t.predefinedSchema?`${t.schemaMode??"predefined"} · ${t.predefinedSchema}`:t.schemaMode??"-":"-"}function os(e){const{width:t,height:n}=e.file;return t===null||n===null?null:`${t} x ${n}px`}function rs(e){const{durationMs:t}=e.file;return t===null?null:t<1e3?`${t} ms`:`${(t/1e3).toFixed(1)} s`}function vn(e){return`${hn}/${e}/configure`}function Cn(e){return e.category==="decal"?e.roblox.creatorAssetId??e.roblox.assetId??null:e.roblox.assetId??null}function _n(e){const t=Cn(e),n=t?vn(t):null,l=e.category==="decal"?e.roblox.creatorAssetWebUrl??e.roblox.assetWebUrl:e.roblox.assetWebUrl;return!l||n&&mn.test(l)?n:l}function Sn(e){return`${ke(e.startedAt)} -> ${e.status}`}function is(e){return!e.creatorType||!e.creatorId?null:`${e.creatorType} ${e.creatorId}`}function ds(e){return e.assetRole?`Asset role: ${e.assetRole}`:null}function Nn(e){const t=e.sourceProperty?` · ${e.sourceProperty}`:"";return`${e.path} · ${e.assetType} · ${e.status}${t}`}function An(e){return e.assetUri&&e.assetId?`${e.assetUri} (#${e.assetId})`:e.assetUri?e.assetUri:e.assetId?`#${e.assetId}`:e.message??"-"}function Ne({label:e,value:t}){return t?s.jsx("button",{type:"button",className:a.inlineCopyButton,"aria-label":e,title:e,onClick:()=>{var n;return void((n=navigator.clipboard)==null?void 0:n.writeText(t))},children:s.jsx(js,{size:13})}):null}function Pn({asset:e,busyAction:t,canUpload:n,canImportRbxm:l,importRbxmTooltip:o,importRbxmTargetParent:f,onClose:g,onSave:x,onUpload:p,onDelete:L,onImportRbxm:K,onRefreshStatus:B,onScanUsage:R}){var $,y;const{t:r}=ce(),b=c.useRef(null),[N,T]=c.useState(""),[W,V]=c.useState("");if(c.useEffect(()=>{T((e==null?void 0:e.displayName)??""),V((e==null?void 0:e.description)??"")},[e==null?void 0:e.description,e==null?void 0:e.displayName,e==null?void 0:e.id]),c.useEffect(()=>{var A;if(!e)return;(A=b.current)==null||A.focus();const i=te=>{te.key==="Escape"&&g()};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[e,g]),!e)return null;const D=e.status==="processing"&&!!(e.roblox.operationId??e.roblox.operationPath),G=!!e.roblox.assetUri,E=_n(e),H=e.roblox.uploadAttempts??[],M=e.category==="decal"&&!!(e.roblox.creatorAssetId||e.roblox.backingImageAssetId||e.roblox.assetId),q=e.roblox.creatorAssetId??e.roblox.assetId,P=e.roblox.backingImageAssetId??e.roblox.assetId,I=Ns(e,r),X=e.roblox.assetId?e.usage.lastScannedAt?r("assets.detail.noUsageAfterScan","No references were found in local Sync files during the last check."):r("assets.detail.noUsageUnscanned","Run Scan usage to search local Sync files for this Roblox Asset ID."):r("assets.detail.noUsageNoRobloxId","This asset does not have a Roblox Asset ID yet, so usage cannot be checked. Upload it before scanning usage.");return s.jsx("div",{className:a.detailPopupLayer,onClick:g,role:"presentation",children:s.jsxs("section",{ref:b,className:a.detailDialog,role:"dialog","aria-modal":"true","aria-label":r("assets.detail.title","Asset details"),tabIndex:-1,onClick:i=>i.stopPropagation(),children:[s.jsxs("div",{className:a.detailDialogHeader,children:[s.jsxs("div",{className:a.detailTitleBlock,children:[s.jsxs("span",{className:a.detailEyebrow,children:[ie(e,r)," · ",Re(e.status,r)]}),s.jsx("h2",{children:e.displayName}),s.jsx("span",{children:e.id})]}),s.jsxs("div",{className:a.detailHeaderActions,children:[s.jsx(ee,{text:n?r("assets.upload.open.tooltip","Upload this local file to Roblox through Open Cloud."):r("assets.proOnly.tooltip","Roblox upload is available on Pro."),children:s.jsxs("button",{type:"button",className:a.commandButton,disabled:!n,onClick:p,children:[s.jsx(xt,{size:15}),r("assets.upload.open","Upload")]})}),l&&s.jsx(ee,{text:o,children:s.jsxs("button",{type:"button",className:a.commandButton,disabled:t==="import-rbxm",onClick:()=>void K(),children:[s.jsx(Ls,{size:15}),r("assets.detail.importRbxm","Insert into Studio")]})}),s.jsxs("button",{type:"button",className:a.commandButton,disabled:!D||t==="status-refresh",onClick:()=>void B(),children:[s.jsx(fs,{size:15}),r("assets.detail.refreshStatus","Refresh")]}),s.jsxs("button",{type:"button",className:a.commandButton,disabled:!e.roblox.assetId||t==="usage-scan",onClick:()=>void R(),children:[s.jsx(ht,{size:15}),r("assets.detail.scanUsage","Scan usage")]}),s.jsx(ee,{text:r("assets.delete.tooltip","Delete this local Asset Library item."),children:s.jsxs("button",{type:"button",className:`${a.commandButton} ${a.dangerButton}`,disabled:t==="delete",onClick:L,children:[s.jsx(Ws,{size:15}),r("common.delete","Delete")]})}),s.jsx(ee,{text:r("common.close","Close"),children:s.jsx("button",{type:"button",className:a.iconButton,onClick:g,"aria-label":r("common.close","Close"),children:s.jsx(Xe,{size:16})})})]})]}),s.jsxs("div",{className:a.detailDialogBody,children:[s.jsx("div",{className:a.detailPreviewPane,children:gn(e)?s.jsx("img",{className:a.detailPreview,src:fn(e),alt:e.displayName}):s.jsxs("div",{className:a.detailPreviewFallback,children:[s.jsx("span",{children:ie(e,r)}),s.jsx("code",{children:e.file.original}),(($=e.rbxm)==null?void 0:$.thumbnail)&&s.jsx("small",{children:ns(e)})]})}),s.jsxs("div",{className:a.detailContentPane,children:[s.jsxs("div",{className:a.formStack,children:[s.jsxs("label",{className:a.field,children:[s.jsx("span",{children:r("assets.detail.displayName","Display name")}),s.jsx("input",{value:N,onChange:i=>T(i.target.value)})]}),s.jsxs("label",{className:a.field,children:[s.jsx("span",{children:r("assets.detail.description","Description")}),s.jsx("textarea",{value:W,rows:3,onChange:i=>V(i.target.value)})]}),s.jsx("button",{type:"button",className:a.primaryButton,disabled:t==="update",onClick:()=>void x(N,W),children:r("assets.detail.save","Save metadata")})]}),s.jsxs("section",{className:a.detailSection,children:[s.jsx("h3",{children:r("assets.detail.localFile","Local file")}),s.jsxs("dl",{className:a.detailGrid,children:[s.jsx("dt",{children:r("assets.detail.fileName","File")}),s.jsx("dd",{children:e.file.original}),s.jsx("dt",{children:r("assets.detail.source","Source path")}),s.jsx("dd",{children:e.source.originalPath}),s.jsx("dt",{children:r("assets.detail.category","Category")}),s.jsx("dd",{children:ie(e,r)}),s.jsx("dt",{children:r("assets.detail.scope","Scope")}),s.jsx("dd",{children:e.scope.kind==="shared"?r("assets.scope.shared","Shared"):r("assets.scope.place","Current Place")}),s.jsx("dt",{children:r("assets.detail.mimeType","Type")}),s.jsx("dd",{children:e.file.mimeType}),s.jsx("dt",{children:r("assets.detail.size","Size")}),s.jsx("dd",{children:xn(e.file.sizeBytes)}),os(e)&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:r("assets.detail.dimensions","Dimensions")}),s.jsx("dd",{children:os(e)})]}),rs(e)&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:r("assets.detail.duration","Duration")}),s.jsx("dd",{children:rs(e)})]})]})]}),e.rbxm&&s.jsxs("section",{className:a.detailSection,children:[s.jsx("h3",{children:r("assets.detail.rbxm","RBXM contents")}),s.jsxs("dl",{className:a.detailGrid,children:[s.jsx("dt",{children:r("assets.detail.rbxmExportedCount","Exported roots")}),s.jsx("dd",{children:e.rbxm.exportedCount}),s.jsx("dt",{children:r("assets.detail.rbxmClasses","Classes")}),s.jsx("dd",{children:bn(e)}),s.jsx("dt",{children:r("assets.detail.rbxmThumbnail","Thumbnail")}),s.jsx("dd",{children:ns(e)}),I&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:r("assets.detail.rbxmStudioUploadsLabel","Studio uploads")}),s.jsx("dd",{children:I})]}),l&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:r("assets.detail.studioInsertTarget","Studio insert target")}),s.jsx("dd",{children:f})]})]}),e.rbxm.roots.length>0&&s.jsxs("div",{className:a.metadataList,children:[s.jsx("strong",{children:r("assets.detail.rbxmRoots","Root tree")}),e.rbxm.roots.map(i=>s.jsxs("div",{className:a.metadataItem,children:[s.jsxs("span",{children:[i.name," (",i.className,")"]}),s.jsx("code",{children:i.path})]},`${i.path}-${i.className}`))]}),e.rbxm.resourceReferences.length>0&&s.jsxs("div",{className:a.metadataList,children:[s.jsx("strong",{children:r("assets.detail.rbxmReferences","Asset references")}),e.rbxm.resourceReferences.map((i,A)=>s.jsxs("div",{className:a.metadataItem,children:[s.jsxs("span",{children:[i.path," · ",i.property]}),s.jsx("code",{children:i.assetId?`${i.value} (#${i.assetId})`:i.value})]},`${i.path}-${i.property}-${A}`))]}),e.rbxm.studioUploads&&e.rbxm.studioUploads.length>0&&s.jsxs("div",{className:a.metadataList,children:[s.jsx("strong",{children:r("assets.detail.rbxmStudioUploads","Embedded Studio uploads")}),e.rbxm.studioUploads.map((i,A)=>s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:Nn(i)}),s.jsx("code",{children:An(i)})]},`${i.path}-${i.assetType}-${i.sourceProperty??""}-${A}`))]}),e.rbxm.generation&&s.jsxs("div",{className:a.metadataList,children:[s.jsx("strong",{children:r("assets.detail.rbxmGeneration","Generated model")}),s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:r("assets.detail.rbxmGenerationProvider","Provider")}),s.jsx("code",{children:e.rbxm.generation.provider})]}),e.rbxm.generation.prompt&&s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:r("assets.detail.rbxmGenerationPrompt","Prompt")}),s.jsx("code",{children:e.rbxm.generation.prompt})]}),s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:r("assets.detail.rbxmGenerationSchema","Schema")}),s.jsx("code",{children:jn(e)})]}),e.rbxm.generation.path&&s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:r("assets.detail.rbxmGenerationPath","Studio path")}),s.jsx("code",{children:e.rbxm.generation.path})]})]}),e.rbxm.review&&s.jsxs("div",{className:a.metadataList,children:[s.jsx("strong",{children:r("assets.detail.rbxmReview","Model review")}),s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:r("assets.detail.rbxmReviewReadiness","Readiness")}),s.jsx("code",{children:e.rbxm.review.readiness})]}),s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:r("assets.detail.rbxmReviewSummary","Summary")}),s.jsx("code",{children:yn(e)})]}),e.rbxm.review.findings.slice(0,8).map((i,A)=>s.jsxs("div",{className:a.metadataItem,children:[s.jsxs("span",{children:[i.severity," · ",i.category," · ",i.code]}),s.jsx("code",{children:i.path?`${i.path}: ${i.message}`:i.message})]},`${i.code}-${i.path}-${A}`))]})]}),s.jsxs("section",{className:a.detailSection,children:[s.jsx("h3",{children:r("assets.detail.roblox","Roblox upload status")}),s.jsxs("dl",{className:a.detailGrid,children:[s.jsx("dt",{children:r("assets.detail.status","Status")}),s.jsx("dd",{children:Re(e.status,r)}),M?s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:r("assets.detail.decalAssetId","Roblox Decal ID")}),s.jsxs("dd",{className:a.copyableValue,children:[s.jsx("span",{children:q??r("assets.status.localOnly","Local only")}),s.jsx(Ne,{label:r("assets.detail.copyDecalAssetId","Copy Roblox Decal ID"),value:q})]}),s.jsx("dt",{children:r("assets.detail.studioTextureImageId","Studio Texture Image ID")}),s.jsxs("dd",{className:a.copyableValue,children:[s.jsx("span",{children:P??"-"}),s.jsx(Ne,{label:r("assets.detail.copyStudioTextureImageId","Copy Studio Texture Image ID"),value:P})]})]}):s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:r("assets.detail.assetId","Asset ID")}),s.jsxs("dd",{className:a.copyableValue,children:[s.jsx("span",{children:e.roblox.assetId??r("assets.status.localOnly","Local only")}),s.jsx(Ne,{label:r("assets.detail.copyAssetId","Copy Asset ID"),value:e.roblox.assetId})]})]}),s.jsx("dt",{children:r("assets.detail.studioUri","Studio URI")}),s.jsx("dd",{children:e.roblox.assetUri??"-"}),s.jsx("dt",{children:r("assets.detail.robloxWebUrl","Creator Dashboard URL")}),s.jsxs("dd",{className:a.copyableValue,children:[s.jsx("span",{children:E??"-"}),s.jsx(Ne,{label:r("assets.detail.copyWebUrl","Copy configure URL"),value:E})]}),e.roblox.errorMessage&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:r("assets.detail.error","Error")}),s.jsx("dd",{children:e.roblox.errorMessage})]})]}),s.jsxs("div",{className:a.copyRow,children:[s.jsxs("button",{type:"button",className:a.commandButton,disabled:!G,onClick:()=>{var i;return e.roblox.assetUri&&void((i=navigator.clipboard)==null?void 0:i.writeText(e.roblox.assetUri))},children:[s.jsx(js,{size:15}),r("assets.detail.copyStudioUri","Copy Studio URI")]}),E&&s.jsxs("a",{className:a.commandButton,href:E,target:"_blank",rel:"noreferrer",children:[s.jsx(Us,{size:15}),r("assets.detail.openRobloxPage","Open configure page")]})]}),e.roblox.assetId&&s.jsx("p",{className:a.muted,children:r("assets.detail.robloxWebUrlNotice","Opening this page requires the Roblox account that owns or can manage the uploaded asset.")}),H.length>0&&s.jsxs("div",{className:a.metadataList,children:[s.jsx("strong",{children:r("assets.detail.uploadHistory","Upload history")}),H.slice().reverse().map((i,A)=>s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:Sn(i)}),is(i)&&s.jsx("code",{children:is(i)}),ds(i)&&s.jsx("code",{children:ds(i)}),i.operationPath&&s.jsx("code",{children:i.operationPath}),i.assetId&&s.jsxs("code",{children:[r("assets.detail.assetId","Asset ID"),": ",i.assetId]}),i.remotePath&&s.jsx("code",{children:i.remotePath}),i.message&&s.jsx("code",{children:i.message}),i.errorMessage&&s.jsx("code",{children:i.errorMessage})]},`${i.startedAt}-${i.operationPath??A}`))]})]}),s.jsxs("section",{className:a.detailSection,children:[s.jsx("h3",{children:r("assets.detail.usedInPlace","Where this asset is used in this Place")}),s.jsxs("dl",{className:a.detailGrid,children:[s.jsx("dt",{children:r("assets.detail.usageSource","Checked against")}),s.jsx("dd",{children:e.usage.scanSource==="localSync"?r("assets.detail.usageSource.localSync","Local Sync files"):r("assets.detail.usageSource.notScanned","Not checked yet")}),s.jsx("dt",{children:r("assets.detail.lastScanned","Last checked")}),s.jsx("dd",{children:e.usage.lastScannedAt?r("assets.detail.lastScannedAt","Last checked: {time}").replace("{time}",ke(e.usage.lastScannedAt)):r("assets.detail.lastScanned.never","No check yet")})]}),e.usage.references.length===0?s.jsx("p",{className:a.muted,children:X}):s.jsx("div",{className:a.usageList,children:e.usage.references.map((i,A)=>s.jsxs("div",{className:a.usageItem,children:[s.jsx("strong",{children:i.kind==="property"?i.instancePath:i.filePath}),s.jsx("span",{children:i.property??r("assets.detail.line","line {line}").replace("{line}",String(i.line??"-"))}),s.jsx("code",{children:i.value})]},`${i.kind}-${A}`))})]}),s.jsxs("details",{className:a.technicalDetails,children:[s.jsx("summary",{children:r("assets.detail.technicalDetails","Technical details")}),s.jsxs("dl",{className:a.detailGrid,children:[s.jsx("dt",{children:r("assets.detail.stableId","Stable ID")}),s.jsx("dd",{className:a.hashText,children:e.id}),s.jsx("dt",{children:r("assets.detail.sourceKind","Source kind")}),s.jsx("dd",{children:e.source.kind}),s.jsx("dt",{children:r("assets.detail.sha256","SHA-256")}),s.jsx("dd",{className:a.hashText,children:e.file.sha256}),s.jsx("dt",{children:r("assets.detail.createdAt","Created")}),s.jsx("dd",{children:ke(e.createdAt)}),s.jsx("dt",{children:r("assets.detail.updatedAt","Updated")}),s.jsx("dd",{children:ke(e.updatedAt)}),e.roblox.operationId&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:r("assets.detail.operationId","Operation ID")}),s.jsx("dd",{className:a.hashText,children:e.roblox.operationId})]}),e.roblox.operationPath&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:r("assets.detail.operationPath","Operation path")}),s.jsx("dd",{className:a.hashText,children:e.roblox.operationPath})]}),e.roblox.versionId&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:r("assets.detail.versionId","Version ID")}),s.jsx("dd",{className:a.hashText,children:e.roblox.versionId})]}),e.roblox.remotePath&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:r("assets.detail.remotePath","Remote path")}),s.jsx("dd",{className:a.hashText,children:e.roblox.remotePath})]}),e.roblox.moderationState&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:r("assets.detail.moderationState","Moderation")}),s.jsx("dd",{children:e.roblox.moderationState})]})]}),((y=e.rbxm)==null?void 0:y.thumbnail.attempts)&&e.rbxm.thumbnail.attempts.length>0&&s.jsxs("div",{className:a.metadataList,children:[s.jsx("strong",{children:r("assets.detail.rbxmThumbnailAttempts","Thumbnail attempts")}),e.rbxm.thumbnail.attempts.map((i,A)=>s.jsxs("div",{className:a.metadataItem,children:[s.jsxs("span",{children:[i.method," · ",i.status]}),i.message&&s.jsx("code",{children:i.message})]},`${i.method}-${A}`))]})]})]})]})]})})}function As(e){return{assetUploadByOpenCloudEnabled:e.hot.ENABLE_ASSET_UPLOAD_BY_OPEN_CLOUD===!0}}function In(e){const t={};return typeof e.assetUploadByOpenCloudEnabled=="boolean"&&(t.ENABLE_ASSET_UPLOAD_BY_OPEN_CLOUD=e.assetUploadByOpenCloudEnabled),t}async function Ps(){const e=await F.get("/api/dashboard/settings");return As(e)}async function kn(e){const t=await F.patch("/api/dashboard/settings",In(e));return As(t)}async function Is(){return F.get("/api/dashboard/open-cloud/credential-profiles")}async function wn(e){return F.post("/api/dashboard/open-cloud/credential-profiles",e)}async function Rn(e){return F.patch("/api/dashboard/open-cloud/credential-profiles/active",{profileId:e})}async function $n(e,t){return F.put(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}/api-key`,t)}async function Ln(e){return F.delete(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}`)}async function Un(e,t){return F.post(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}/creators`,t)}async function Tn(e,t){return F.patch(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}/creators/${encodeURIComponent(t)}/default`,{})}async function Bn(e,t){return F.delete(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}/creators/${encodeURIComponent(t)}`)}async function En(e,t){return F.post(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}/test`,t?{creatorPresetId:t}:{})}async function Gn(e){return F.post("/api/dashboard/open-cloud/credential/test",e?{apiKey:e}:{})}function Mn(e){return e.category==="image"||e.category==="decal"}function Dn(e,t){return e==="group"?t("assets.creator.group","Group"):t("assets.creator.user","User")}function Fn(e,t){return`${e.label} · ${Dn(e.creatorType,t)} ${e.creatorId}`}function cs(e){if(!e)return null;if(e.defaultCreatorId){const t=e.creators.find(n=>n.id===e.defaultCreatorId);if(t)return t}return e.creators[0]??null}function On({asset:e,open:t,canUpload:n,busyAction:l,onClose:o,onBack:f,onOpenSettings:g,onUpload:x}){const{t:p}=ce(),L=c.useRef(null),[K,B]=c.useState(null),[R,r]=c.useState(null),[b,N]=c.useState(!1),[T,W]=c.useState(null),[V,D]=c.useState(""),[G,E]=c.useState(""),[H,M]=c.useState(""),[q,P]=c.useState("user"),[I,X]=c.useState("");if(c.useEffect(()=>{D((e==null?void 0:e.displayName)??""),E((e==null?void 0:e.description)??"")},[e==null?void 0:e.description,e==null?void 0:e.displayName,e==null?void 0:e.id]),c.useEffect(()=>{if(!t)return;let _=!1;return N(!0),W(null),(async()=>{try{const[S,J]=await Promise.all([Ps(),Is()]);if(_)return;B(S);const Q=J.profiles.find(pe=>pe.id===J.activeProfileId)??J.profiles[0]??null;r(Q);const Z=cs(Q);M((Z==null?void 0:Z.id)??""),P((Z==null?void 0:Z.creatorType)??"user"),X((Z==null?void 0:Z.creatorId)??"")}catch(S){if(_)return;W(S instanceof Error?S.message:p("assets.upload.settingsLoadFailed","Failed to load upload settings.")),B(null),r(null)}finally{_||N(!1)}})(),()=>{_=!0}},[t,p]),c.useEffect(()=>{var S;if(!t||!e)return;(S=L.current)==null||S.focus();const _=J=>{J.key==="Escape"&&o()};return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[e,o,t]),!t||!e)return null;const $=(K==null?void 0:K.assetUploadByOpenCloudEnabled)===!0,y=!!R,i=cs(R),A=(R==null?void 0:R.creators.find(_=>_.id===H))??null,te=!!i,m=(R==null?void 0:R.storageProvider)==="env"&&y&&!te,U=m&&I.trim().length>0,h=n&&!b&&!T&&(!$||!y||!te&&!m),z=n&&!b&&!T&&$&&y&&(te||U)&&l!=="upload";return s.jsx("div",{className:a.detailPopupLayer,onClick:o,role:"presentation",children:s.jsxs("section",{ref:L,className:a.detailDialog,role:"dialog","aria-modal":"true","aria-label":p("assets.upload.title","Upload asset"),tabIndex:-1,onClick:_=>_.stopPropagation(),children:[s.jsxs("div",{className:a.detailDialogHeader,children:[s.jsxs("div",{className:a.detailTitleBlock,children:[s.jsxs("span",{className:a.detailEyebrow,children:[ie(e,p)," · ",p("assets.upload.intent","Upload to Roblox")]}),s.jsx("h2",{children:p("assets.upload.title","Upload asset")}),s.jsx("span",{children:e.displayName})]}),s.jsxs("div",{className:a.detailHeaderActions,children:[s.jsxs("button",{type:"button",className:a.commandButton,onClick:f,children:[s.jsx(Ys,{size:15}),p("assets.upload.backToDetails","Back to details")]}),s.jsx(ee,{text:p("common.close","Close"),children:s.jsx("button",{type:"button",className:a.iconButton,onClick:o,"aria-label":p("common.close","Close"),children:s.jsx(Xe,{size:16})})})]})]}),s.jsxs("div",{className:a.detailDialogBody,children:[s.jsx("div",{className:a.detailPreviewPane,children:Mn(e)?s.jsx("img",{className:a.detailPreview,src:Cs(e),alt:e.displayName}):s.jsxs("div",{className:a.detailPreviewFallback,children:[s.jsx("span",{children:ie(e,p)}),s.jsx("code",{children:e.file.original})]})}),s.jsxs("div",{className:a.detailContentPane,children:[!n&&s.jsx("div",{className:a.notice,children:p("assets.proOnly.upload","Roblox upload is available on Pro.")}),b&&s.jsx("div",{className:a.notice,children:p("assets.upload.checkingSettings","Checking upload settings...")}),T&&s.jsx("div",{className:a.errorState,children:T}),s.jsxs("dl",{className:a.compactMeta,children:[s.jsx("dt",{children:p("assets.detail.category","Category")}),s.jsx("dd",{children:ie(e,p)}),s.jsx("dt",{children:p("assets.detail.source","Source")}),s.jsx("dd",{children:e.source.originalPath})]}),h&&s.jsxs("div",{className:a.setupNotice,children:[s.jsx("strong",{children:p("assets.upload.settingsRequired","Upload settings required")}),s.jsx("p",{children:y?$?p("assets.upload.settingsRequired.creator","Save a default Creator before uploading."):p("assets.upload.settingsRequired.toggle","Enable Open Cloud upload before uploading."):p("assets.upload.settingsRequired.apiKey","Save an Open Cloud API key before uploading.")}),s.jsxs("button",{type:"button",className:a.commandButton,onClick:g,children:[s.jsx(bs,{size:15}),p("assets.upload.openSettings","Open Asset Library settings")]})]}),s.jsxs("div",{className:a.formStack,children:[s.jsxs("label",{className:a.field,children:[s.jsx("span",{children:p("assets.detail.displayName","Display name")}),s.jsx("input",{value:V,disabled:!n,onChange:_=>D(_.target.value)}),s.jsx("small",{className:a.fieldHelp,children:p("assets.upload.displayNameHelp","Saved to Roblox as the asset display name.")})]}),s.jsxs("label",{className:a.field,children:[s.jsx("span",{children:p("assets.detail.description","Description")}),s.jsx("textarea",{value:G,rows:3,disabled:!n,onChange:_=>E(_.target.value)}),s.jsx("small",{className:a.fieldHelp,children:p("assets.upload.descriptionHelp","Saved to Roblox as the asset description.")})]}),te&&s.jsxs("label",{className:a.field,children:[s.jsx("span",{children:p("assets.upload.creator","Creator")}),s.jsx("select",{"aria-label":p("assets.upload.creator","Creator"),value:H,disabled:!n||b,onChange:_=>M(_.target.value),children:R==null?void 0:R.creators.map(_=>s.jsx("option",{value:_.id,children:Fn(_,p)},_.id))}),s.jsx("small",{className:a.fieldHelp,children:p("assets.upload.creatorHelp","Used by Open Cloud as the owner of the uploaded asset.")})]}),m&&s.jsxs(s.Fragment,{children:[s.jsx("p",{className:a.inlineHelp,children:p("assets.upload.envCreatorHelp","Environment API keys cannot save a default Creator here. Enter the Creator for this upload.")}),s.jsxs("div",{className:a.twoColumn,children:[s.jsxs("label",{className:a.field,children:[s.jsx("span",{children:p("assets.upload.creatorType","Creator type")}),s.jsxs("select",{value:q,disabled:!n,onChange:_=>P(_.target.value),children:[s.jsx("option",{value:"user",children:p("assets.creator.user","User")}),s.jsx("option",{value:"group",children:p("assets.creator.group","Group")})]}),s.jsx("small",{className:a.fieldHelp,children:p("assets.upload.creatorTypeHelp","Sent to Open Cloud as the Creator type.")})]}),s.jsxs("label",{className:a.field,children:[s.jsx("span",{children:p("assets.upload.creatorId","Creator ID")}),s.jsx("input",{value:I,disabled:!n,onChange:_=>X(_.target.value)}),s.jsx("small",{className:a.fieldHelp,children:p("assets.upload.creatorIdHelp","Sent to Open Cloud as the User or Group ID that owns the uploaded asset.")})]})]})]}),s.jsx("button",{type:"button",className:a.primaryButton,disabled:!z,onClick:()=>{const _=I.trim(),S=m&&_?{creatorType:q,creatorId:_}:{},J=!m&&A&&i&&A.id!==i.id?{creatorType:A.creatorType,creatorId:A.creatorId}:{};x({displayName:V,description:G,...S,...J})},children:l==="upload"?p("assets.upload.uploading","Uploading..."):p("assets.upload.submit","Upload with Roblox Open Cloud")})]}),s.jsxs("div",{className:a.noticeList,children:[s.jsx("p",{children:p("assets.upload.noDelete","WEPPY does not provide Roblox asset deletion.")}),s.jsx("p",{children:p("assets.upload.delay","Roblox processing and moderation can delay visibility in Studio or Creator Dashboard.")})]})]})]})]})})}function us(e,t){return e==="env"?t("assets.settings.credential.env","Environment variable"):t("assets.settings.credential.local","Local encrypted file")}function Ke(e,t){return e==="valid"?t("assets.settings.validation.valid","Connected"):e==="invalid"?t("assets.settings.validation.invalid","Needs attention"):t("assets.settings.validation.unknown","Not tested")}function Hn(e,t){return(e==null?void 0:e.status)==="valid"?t("assets.settings.apiKeyTested","Open Cloud API key connection tested."):(e==null?void 0:e.message)??t("assets.settings.tested","Connection tested.")}function zn(e,t){return(e==null?void 0:e.status)==="valid"?t("assets.settings.apiKeyTested","Open Cloud API key connection tested."):(e==null?void 0:e.message)??t("assets.settings.tested","Connection tested.")}function Kn(e,t){return e==="group"?t("assets.creator.group","Group"):t("assets.creator.user","User")}function Wn(e,t){return`${Kn(e.creatorType,t)} ${e.creatorId}`}function Vn({open:e,tier:t,onClose:n}){const{t:l}=ce(),[o,f]=c.useState(null),[g,x]=c.useState(null),[p,L]=c.useState(""),[K,B]=c.useState(!1),[R,r]=c.useState(""),[b,N]=c.useState(""),[T,W]=c.useState("user"),[V,D]=c.useState(""),[G,E]=c.useState(""),[H,M]=c.useState(!0),[q,P]=c.useState(null),[I,X]=c.useState(null),[$,y]=c.useState(!1),i=t==="basic",A=c.useCallback(async()=>{y(!0),P(null);try{const[d,j]=await Promise.all([Ps(),Is()]);f(d),x(j);const k=j.profiles.find(O=>O.id===j.activeProfileId)??j.profiles[0]??null;L((k==null?void 0:k.id)??""),B(!k),M(!k||k.creators.length===0),W("user"),D(""),E("")}catch(d){P(d instanceof Error?d.message:l("assets.settings.loadFailed","Failed to load upload settings."))}finally{y(!1)}},[l]);if(c.useEffect(()=>{e&&A()},[A,e]),!e)return null;const te=(o==null?void 0:o.assetUploadByOpenCloudEnabled)===!0,w=b.trim(),m=V.trim(),U=(g==null?void 0:g.profiles)??[],h=U.find(d=>d.id===p)??U[0]??null,z=!!h,_=z&&(h==null?void 0:h.storageProvider)==="localFile",S=z&&(h==null?void 0:h.storageProvider)==="env",J=h!=null&&h.defaultCreatorId?h.creators.find(d=>d.id===h.defaultCreatorId):h==null?void 0:h.creators[0],Q=!!(h!=null&&h.creators.length),Z=!Q||H,pe=U.length>1,oe=i?l("assets.settings.action.proRequired","Asset upload settings are available on Pro."):$?l("assets.settings.action.busy","Wait for the current settings action to finish."):null,ve=i||$||!w,xe=oe??(w?l("assets.settings.saveApiKey.tooltip.ready","Save this API key to local encrypted storage."):l("assets.settings.saveApiKey.tooltip.enter","Enter an Open Cloud API key to save it locally.")),ae=i||$||!w&&!z,Ce=oe??(w?l("assets.settings.testConnection.tooltip.entered","Test the entered API key before saving it."):z?l("assets.settings.testConnection.tooltip.saved","Test the saved Open Cloud API key."):l("assets.settings.testConnection.tooltip.enterOrSaved","Enter an API key or save one before testing the connection.")),_e=i||$||!_,Se=oe??(_?l("assets.settings.removeApiKey.tooltip.ready","Remove the locally saved Open Cloud API key."):S?l("assets.settings.removeApiKey.tooltip.env","Environment API keys cannot be removed from Dashboard. Remove ROBLOX_OPEN_CLOUD_API_KEY outside WEPPY."):l("assets.settings.removeApiKey.tooltip.none","No local Open Cloud API key is saved.")),Ue=i||$||!_||!m,Te=oe??(S?l("assets.settings.saveCreator.tooltip.env","Environment API keys cannot save a default Creator here. Enter Creator details in the upload dialog."):_?m?l("assets.settings.saveCreator.tooltip.ready","Save this Creator as the default owner for uploads."):l("assets.settings.saveCreator.tooltip.enterId","Enter a user or group ID before saving the default Creator."):l("assets.settings.saveCreator.tooltip.noLocal","Save a local Open Cloud API key before saving a default Creator.")),Be=oe??(_?l("assets.settings.addCreator.tooltip.ready","Add another User or Group Creator preset to this profile."):l("assets.settings.saveCreator.tooltip.noLocal","Save a local Open Cloud API key before saving a default Creator.")),Ee=i||$||S||!_,Ge=oe??(_?l("assets.settings.unregisterCreator.tooltip.ready","Unregister this Creator from the selected profile."):S?l("assets.settings.saveCreator.tooltip.env","Environment API keys cannot save a default Creator here. Enter Creator details in the upload dialog."):l("assets.settings.saveCreator.tooltip.noLocal","Save a local Open Cloud API key before saving a default Creator.")),Me=J?l("assets.settings.saveCreatorPreset","Save Creator"):l("assets.settings.saveCreator","Save default Creator"),De=(h==null?void 0:h.label)??l("assets.settings.credential.none","No API key saved"),ge=d=>{const j=d.profiles.find(k=>k.id===d.activeProfileId)??d.profiles[0]??null;x(d),L((j==null?void 0:j.id)??""),M(!j||j.creators.length===0),B(d.profiles.length===0)},Fe=async()=>{if(h){y(!0);try{const d=await En(h.id,J==null?void 0:J.id);ge(d),P(zn(d.validation,l))}catch(d){P(d instanceof Error?d.message:l("assets.settings.testFailed","Connection test failed."))}finally{y(!1)}}},Oe=async()=>{if(I){y(!0);try{if(I.kind==="apiKey"){const d=await Ln(I.profileId);ge(d),P(l("assets.settings.apiKeyRemoved","Open Cloud API key unregistered from local storage."))}else{const d=await Bn(I.profileId,I.creatorPresetId);ge(d),P(l("assets.settings.creatorUnregistered","Creator unregistered from this profile."))}X(null)}catch(d){P(d instanceof Error?d.message:I.kind==="apiKey"?l("assets.settings.removeFailed","Failed to unregister API key."):l("assets.settings.creatorUnregisterFailed","Failed to unregister Creator."))}finally{y(!1)}}},u=(I==null?void 0:I.kind)==="apiKey"?l("assets.settings.unregisterApiKey.title","Unregister API Key?"):l("assets.settings.unregisterCreator.title","Unregister Creator?"),v=(I==null?void 0:I.kind)==="apiKey"?l("assets.settings.unregisterApiKey.message","Roblox API key is not revoked. WEPPY only removes the local Credential Profile registration on this device."):l("assets.settings.unregisterCreator.message","Roblox user or group is not deleted. WEPPY only removes this Creator from the selected API Key profile."),C=(I==null?void 0:I.kind)==="apiKey"?l("assets.settings.removeApiKey","Unregister API Key"):l("assets.settings.unregisterCreator","Unregister Creator");return s.jsxs("section",{id:"asset-library-settings-panel",className:`${a.settingsInlinePanel} ${a.settingsDrawer}`,role:"region","aria-label":l("assets.settings.title","Asset Library settings"),"data-panel-placement":"toolbar-popover",children:[s.jsxs("div",{className:a.drawerHeader,children:[s.jsxs("div",{children:[s.jsx("h2",{children:l("assets.settings.title","Asset Library settings")}),s.jsx("span",{children:De})]}),s.jsx(ee,{text:l("common.close","Close"),children:s.jsx("button",{type:"button",className:a.iconButton,onClick:n,"aria-label":l("common.close","Close"),children:s.jsx(Xe,{size:16})})})]}),i&&s.jsx("div",{className:`${a.notice} ${a.proNotice}`,children:l("assets.settings.proOnly","Roblox upload settings and Open Cloud credential controls are available on Pro.")}),s.jsxs("section",{className:a.settingsPanel,children:[s.jsxs("label",{className:a.toggleRow,children:[s.jsxs("span",{children:[s.jsx("strong",{children:l("assets.settings.openCloudToggle","Open Cloud upload")}),s.jsx("small",{children:l("assets.settings.openCloudToggle.help","Controls whether server-side Open Cloud upload mutations can run.")})]}),s.jsx(Ms,{checked:te,disabled:i||$,onChange:d=>{(async()=>{y(!0);try{const j=await kn({assetUploadByOpenCloudEnabled:d.target.checked});f(j),P(l("assets.settings.saved","Upload settings saved."))}catch(j){P(j instanceof Error?j.message:l("assets.settings.saveFailed","Failed to save upload settings."))}finally{y(!1)}})()}})]}),pe&&s.jsx("div",{className:a.metadataList,children:U.map(d=>{const j=d.id===(h==null?void 0:h.id);return s.jsxs("div",{className:a.metadataItem,children:[s.jsx("strong",{children:d.label}),s.jsxs("span",{children:[l("assets.settings.field.storage","Storage"),": ",us(d.storageProvider,l)]}),s.jsxs("span",{children:[l("assets.settings.field.validationStatus","Validation status"),": ",Ke(d.validationStatus,l)]}),j&&s.jsx("code",{children:l("assets.settings.activeProfileBadge","Active")}),!j&&d.storageProvider==="localFile"&&s.jsx("button",{type:"button",className:a.commandButton,disabled:i||$,onClick:()=>{(async()=>{y(!0);try{const k=await Rn(d.id),O=k.profiles.find(de=>de.id===(k.activeProfileId??d.id))??d;x(k),L(O.id),M(O.creators.length===0),W("user"),D(""),E(""),P(l("assets.settings.profileSelected","Open Cloud credential profile selected."))}catch(k){P(k instanceof Error?k.message:l("assets.settings.saveFailed","Failed to save upload settings."))}finally{y(!1)}})()},children:l("assets.settings.useProfile","Use profile")})]},d.id)})}),h&&s.jsxs("div",{className:a.settingsSubsection,children:[s.jsx("div",{className:a.settingsSectionHeader,children:s.jsx("h3",{children:l("assets.settings.credentialProfile","Credential Profile")})}),s.jsxs("div",{className:a.metadataItem,children:[s.jsxs("dl",{className:a.settingsDefinitionList,children:[s.jsxs("div",{children:[s.jsx("dt",{children:l("assets.settings.field.profile","Profile")}),s.jsx("dd",{children:h.label})]}),h.maskedKey&&s.jsxs("div",{children:[s.jsx("dt",{children:l("assets.settings.field.apiKey","API Key")}),s.jsx("dd",{children:h.maskedKey})]}),s.jsxs("div",{children:[s.jsx("dt",{children:l("assets.settings.field.storage","Storage")}),s.jsx("dd",{children:us(h.storageProvider,l)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:l("assets.settings.field.validationStatus","Validation status")}),s.jsx("dd",{children:Ke(h.validationStatus,l)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:l("assets.settings.field.creators","Creators")}),s.jsx("dd",{children:h.creators.length})]})]}),!K&&s.jsxs("div",{className:a.buttonRow,children:[s.jsx(ee,{text:Ce,children:s.jsx("button",{type:"button",className:a.commandButton,disabled:ae,onClick:()=>{Fe()},children:l("assets.settings.testConnection","Test Connection")})}),_&&s.jsx("button",{type:"button",className:a.commandButton,disabled:i||$,onClick:()=>B(!0),children:l("assets.settings.replaceApiKey","Replace API Key")}),s.jsx(ee,{text:Se,children:s.jsx("button",{type:"button",className:`${a.commandButton} ${a.dangerButton}`,disabled:_e,onClick:()=>X({kind:"apiKey",profileId:h.id}),children:l("assets.settings.removeApiKey","Unregister API Key")})})]})]})]}),K&&s.jsxs("div",{className:a.formStack,children:[s.jsxs("div",{className:a.field,children:[s.jsx("div",{className:a.fieldLabelRow,children:s.jsx("label",{htmlFor:"asset-settings-open-cloud-profile-label",children:l("assets.settings.profileLabel","Profile name")})}),s.jsx("input",{id:"asset-settings-open-cloud-profile-label",value:R,disabled:i||$,onChange:d=>r(d.target.value),placeholder:l("assets.settings.profileLabel.placeholder","Studio automation key")}),s.jsx("p",{className:a.inlineHelp,children:l("assets.settings.profileLabel.help","Optional. If left blank, WEPPY saves this profile as Open Cloud key automatically.")})]}),s.jsxs("div",{className:a.field,children:[s.jsxs("div",{className:a.fieldLabelRow,children:[s.jsx("label",{htmlFor:"asset-settings-open-cloud-api-key",children:l("assets.settings.apiKey","Open Cloud API Key")}),s.jsx(Qe,{topicId:"openCloudApiKey",variant:"field",state:{hasOpenCloudCredential:z}})]}),s.jsx("input",{id:"asset-settings-open-cloud-api-key",value:b,type:"password",disabled:i||$,onChange:d=>N(d.target.value)}),s.jsx("p",{className:a.inlineHelp,children:l("assets.settings.apiKey.inlineHelp","WEPPY uses this key only for Roblox Open Cloud requests. The key is encrypted on this device and is not sent to WEPPY servers or stored in any other external storage.")})]}),!z&&s.jsx("p",{className:a.inlineHelp,children:s.jsx("a",{href:Ds["open_cloud.api_key"].docsUrl,target:"_blank",rel:"noreferrer",children:l("assets.settings.apiKeyGuide","Create a Roblox API key with Assets Read and Write permissions.")})}),s.jsxs("div",{className:a.buttonRow,children:[s.jsx(ee,{text:xe,children:s.jsx("button",{type:"button",className:a.commandButton,disabled:ve,onClick:()=>{(async()=>{var d;y(!0);try{const j={apiKey:w,...R.trim()?{label:R.trim()}:{}},k=(h==null?void 0:h.storageProvider)==="localFile"?await $n(h.id,j):await wn(j),O=k.profiles.find(de=>{var Y;return de.id===(k.activeProfileId??((Y=k.profile)==null?void 0:Y.id))});x(k),L(k.activeProfileId??((d=k.profile)==null?void 0:d.id)??""),M(!O||O.creators.length===0),B(!1),N(""),r(""),P(l("assets.settings.apiKeySaved","Open Cloud API key saved locally."))}catch(j){P(j instanceof Error?j.message:l("assets.settings.saveFailed","Failed to save upload settings."))}finally{y(!1)}})()},children:l("assets.settings.saveApiKey","Save API Key")})}),s.jsx(ee,{text:Ce,children:s.jsx("button",{type:"button",className:a.commandButton,disabled:ae,onClick:()=>{(async()=>{y(!0);try{const d=await Gn(w||void 0);P(Hn(d.validation,l))}catch(d){P(d instanceof Error?d.message:l("assets.settings.testFailed","Connection test failed."))}finally{y(!1)}})()},children:l("assets.settings.testConnection","Test Connection")})}),s.jsx(ee,{text:Se,children:s.jsx("button",{type:"button",className:`${a.commandButton} ${a.dangerButton}`,disabled:_e,onClick:()=>{h&&X({kind:"apiKey",profileId:h.id})},children:l("assets.settings.removeApiKey","Unregister API Key")})})]})]}),s.jsx("div",{className:a.metadataList,children:h==null?void 0:h.creators.map(d=>s.jsxs("div",{className:a.metadataItem,children:[s.jsx("strong",{children:d.label}),s.jsx("span",{children:Wn(d,l)}),d.id===h.defaultCreatorId&&s.jsx("code",{children:l("assets.settings.defaultCreatorBadge","Default")}),s.jsxs("span",{children:[l("assets.settings.field.validationStatus","Validation status"),": ",Ke(d.validationStatus,l)]}),s.jsxs("div",{className:a.buttonRow,children:[d.id!==h.defaultCreatorId&&h.storageProvider==="localFile"&&s.jsx("button",{type:"button",className:a.commandButton,disabled:i||$,onClick:()=>{(async()=>{if(h){y(!0);try{const j=await Tn(h.id,d.id);x(j),P(l("assets.settings.defaultCreatorSaved","Open Cloud default Creator saved locally."))}catch(j){P(j instanceof Error?j.message:l("assets.settings.saveFailed","Failed to save upload settings."))}finally{y(!1)}}})()},children:l("assets.settings.makeDefaultCreator","Make default")}),s.jsx(ee,{text:Ge,children:s.jsx("button",{type:"button",className:`${a.commandButton} ${a.dangerButton}`,disabled:Ee,onClick:()=>X({kind:"creator",profileId:h.id,creatorPresetId:d.id}),children:l("assets.settings.unregisterCreator","Unregister Creator")})})]})]},d.id))}),Q&&!H&&s.jsx(ee,{text:Be,children:s.jsx("button",{type:"button",className:a.commandButton,disabled:i||$||S||!_,onClick:()=>{W("user"),D(""),E(""),M(!0)},children:l("assets.settings.addCreator","Add Creator")})}),Z&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:a.twoColumn,children:[s.jsxs("div",{className:a.field,children:[s.jsx("div",{className:a.fieldLabelRow,children:s.jsx("label",{htmlFor:"asset-settings-creator-type",children:l("assets.upload.creatorType","Creator type")})}),s.jsxs("select",{id:"asset-settings-creator-type",value:T,disabled:i||$||S||!_,onChange:d=>W(d.target.value),children:[s.jsx("option",{value:"user",children:l("assets.creator.user","User")}),s.jsx("option",{value:"group",children:l("assets.creator.group","Group")})]})]}),s.jsxs("div",{className:a.field,children:[s.jsxs("div",{className:a.fieldLabelRow,children:[s.jsx("label",{htmlFor:"asset-settings-creator-id",children:l("assets.upload.creatorId","Creator ID")}),s.jsx(Qe,{topicId:"openCloudCreatorId",variant:"field",state:{hasDefaultCreator:!!J}})]}),s.jsx("input",{id:"asset-settings-creator-id",value:V,disabled:i||$||S||!_,onChange:d=>D(d.target.value)}),s.jsx("p",{className:a.inlineHelp,children:l("assets.settings.creatorId.inlineHelp","Default owner for new Roblox assets: your User ID or a Group ID.")})]})]}),s.jsxs("div",{className:a.field,children:[s.jsx("div",{className:a.fieldLabelRow,children:s.jsx("label",{htmlFor:"asset-settings-creator-label",children:l("assets.settings.creatorLabel","Creator label")})}),s.jsx("input",{id:"asset-settings-creator-label",value:G,disabled:i||$||S||!_,onChange:d=>E(d.target.value),placeholder:l("assets.settings.creatorLabel.placeholder","Main studio group")}),s.jsx("p",{className:a.inlineHelp,children:l("assets.settings.creatorLabel.help","Optional. If left blank, WEPPY automatically saves a label like User 123 or Group 456.")})]}),!J&&s.jsx("p",{className:a.inlineHelp,children:l("assets.settings.creatorHelp","Use the numeric user ID from a profile URL or group ID from a group URL.")}),s.jsxs("div",{className:a.buttonRow,children:[s.jsx(ee,{text:Te,children:s.jsx("button",{type:"button",className:a.primaryButton,disabled:Ue,onClick:()=>{(async()=>{if(h){y(!0);try{const d=await Un(h.id,{creatorType:T,creatorId:m,makeDefault:!J,...G.trim()?{label:G.trim()}:{}});x(d),D(""),E(""),M(!1),P(l("assets.settings.defaultCreatorSaved","Open Cloud default Creator saved locally."))}catch(d){P(d instanceof Error?d.message:l("assets.settings.saveFailed","Failed to save upload settings."))}finally{y(!1)}}})()},children:Me})}),Q&&s.jsx("button",{type:"button",className:a.commandButton,disabled:i||$,onClick:()=>{W("user"),D(""),E(""),M(!1)},children:l("assets.settings.cancelCreator","Cancel")})]})]})]}),q&&s.jsx("div",{className:a.messageState,children:q}),s.jsx(ys,{open:I!==null,title:u,message:v,cancelLabel:l("common.cancel","Cancel"),confirmLabel:C,loading:$,onCancel:()=>X(null),onConfirm:()=>{Oe()}})]})}const Yn=12,qn=5e3;function re(e,t){return e instanceof Error&&e.message.trim().length>0?e.message:t}function ps(e,t){return e.some(l=>je(l,t))?e.map(l=>je(l,t)?t:l):[t,...e]}function je(e,t){return e.id!==t.id||e.category!==t.category||e.scope.kind!==t.scope.kind?!1:e.scope.kind==="shared"||t.scope.kind==="place"&&e.scope.placeId===t.scope.placeId}function Xn(e,t){return e.some(n=>je(n,t))?e.map(n=>je(n,t)?t:n):e}function We(e,t){return kt(e.filter(n=>It(n,t)))}function ye(e,t){return e?`${e.displayName} (${e.id})`:t??"unknown asset"}function Jn(e){return e.length===0?"none":e.map(t=>ye(t)).join(", ")}function hs(e){const t=`status ${e.status}`;return e.roblox.assetId?`Roblox asset ${e.roblox.assetId}; ${t}`:t}function Zn(e,t){const n=ye(t);return e==="update"?`Updated metadata for asset: ${n}.`:e==="upload"?`Uploaded asset: ${n} -> ${hs(t)}.`:e==="thumbnail-generate"?`Generated thumbnail for asset: ${n}.`:e==="status-refresh"?`Refreshed Roblox status for asset: ${n} -> ${hs(t)}.`:e==="usage-scan"?`Scanned usage for asset: ${n} -> ${t.usage.references.length} reference(s).`:`Updated asset: ${n}.`}function Qn(e){return e!=="upload"&&e!=="status-refresh"}function ms(e){return e.status==="processing"&&!!(e.roblox.operationId??e.roblox.operationPath)}function Ae(e){return{scope:e.scope.kind,placeId:e.scope.kind==="place"?e.scope.placeId:void 0,category:e.category}}function eo(e,t){return e==="shared"?[{scope:"shared"}]:e==="place"?t===null?[]:[{scope:"place",placeId:t}]:[...t===null?[]:[{scope:"place",placeId:t}],{scope:"shared"}]}function xs(e,t,n){return eo(e,t).flatMap(l=>Pt(n).map(o=>({request:{...l,category:o},label:`${l.scope}/${o}`})))}function gs(e,t){if(t.length===0)return null;const n=t.map(({label:l,reason:o})=>`${l}: ${re(o,"request failed")}`);return`${e}: ${n.join("; ")}`}function so(e){if(e.pluginConnected&&e.activePlaceId!==null){const n=Ve(e.places,e.activePlaceId),l=n?be(e.places,n.placeId):!1;return{placeId:e.activePlaceId,placeName:e.activePlaceName??(l?null:(n==null?void 0:n.placeName)??null),studioConnected:!0,folderUnresolved:l,hasSyncMetadata:n?Pe(e.places,n):void 0}}if(e.lastActivePlaceId!==null){const n=Ve(e.places,e.lastActivePlaceId),l=n?be(e.places,n.placeId):!1;return{placeId:e.lastActivePlaceId,placeName:e.lastActivePlaceName??(l?null:(n==null?void 0:n.placeName)??null),studioConnected:!1,folderUnresolved:l,hasSyncMetadata:n?Pe(e.places,n):void 0}}const t=Bs(e.places);return{placeId:(t==null?void 0:t.placeId)??null,placeName:t&&!be(e.places,t.placeId)?t.placeName:null,studioConnected:!1,folderUnresolved:t?be(e.places,t.placeId):!1,hasSyncMetadata:t?Pe(e.places,t):void 0}}function to(e,t){if(typeof t=="number"){const n=Ve(e.places,t);if(n){const l=be(e.places,n.placeId);return{placeId:n.placeId,placeName:l?null:n.placeName,studioConnected:n.isConnected,folderUnresolved:l,hasSyncMetadata:Pe(e.places,n),overrideStillValid:!0}}}return{...so(e),overrideStillValid:t===null}}function ao(){const[e,t]=c.useState([]),[n,l]=c.useState(0),[o,f]=c.useState(null),[g,x]=c.useState("place"),[p,L]=c.useState("all"),[K,B]=c.useState([]),[R,r]=c.useState(null),[b,N]=c.useState(null),[T,W]=c.useState(null),[V,D]=c.useState(null),[G,E]=c.useState(!1),[H,M]=c.useState(!1),[q,P]=c.useState(void 0),[I,X]=c.useState(!1),[$,y]=c.useState(!0),[i,A]=c.useState(null),[te,w]=c.useState(null),[m,U]=c.useState(null),h=c.useRef(!0),z=c.useRef(new Map),_=c.useRef(new Set),S=c.useMemo(()=>e.find(u=>se(u)===o)??null,[e,o]),J=(S==null?void 0:S.id)??null;c.useEffect(()=>{o&&(e.some(u=>se(u)===o)||f(null))},[e,o]);const Q=c.useCallback(u=>{const v=z.current.get(u);v!==void 0&&(clearTimeout(v),z.current.delete(u))},[]),Z=c.useCallback((u,v=Yn)=>{const C=se(u);if(!ms(u)||v<=0){Q(C);return}_.current.has(C)||(Q(C),_.current.add(C),(async()=>{try{const d=await es(Ae(u),u.id);if(!h.current)return;if(t(j=>Xn(j,d)),ms(d)&&v>1){const j=se(d),k=setTimeout(()=>{z.current.delete(j),Z(d,v-1)},qn);z.current.set(j,k);return}Q(se(d))}catch(d){if(!h.current)return;Q(C),w(re(d,"Asset Library status refresh failed."))}finally{_.current.delete(C)}})())},[Q]);c.useEffect(()=>()=>{h.current=!1;for(const u of z.current.values())clearTimeout(u);z.current.clear(),_.current.clear()},[]);const pe=c.useCallback(()=>g==="shared"?{scope:"shared"}:{scope:"place",placeId:T??void 0},[T,g]),oe=c.useCallback(u=>({...pe(),category:u}),[pe]),ve=c.useCallback(async()=>{try{const u=await Ts(),v=to(u,R);return B(u.places),v.overrideStillValid||r(null),N(v.placeId),W(v.placeId),D(v.placeName),E(v.studioConnected),M(v.folderUnresolved),P(v.hasSyncMetadata),X(v.studioConnected),v.placeId}catch{return B([]),N(null),W(null),D(null),E(!1),M(!1),P(void 0),X(!1),null}},[R]),xe=c.useCallback(async()=>{w(null);try{const u=await ve();if(g==="place"&&u===null){t([]),l(0),y(!1),w("No active place is connected for place-scoped assets.");return}const v=xs(g,u,p),C=await Promise.allSettled(v.map(({request:O})=>gt(O))),d=C.flatMap(O=>O.status==="fulfilled"?[O.value]:[]),j=C.flatMap((O,de)=>O.status==="rejected"?[{label:v[de].label,reason:O.reason}]:[]);g==="all"&&u===null&&j.unshift({label:"place",reason:new Error("No active place is available")});const k=We(d.flatMap(O=>O.assets),p);t(k),l(k.length);for(const O of k)Z(O);w(gs("Some Asset Library requests failed",j))}catch(u){w(re(u,"Failed to load Asset Library."))}finally{y(!1)}},[p,ve,g,Z]);c.useEffect(()=>{xe()},[xe]);const ae=c.useCallback(async(u,v,C)=>{const d=(S==null?void 0:S.id)===v?S:e.find(j=>j.id===v)??null;if(!d)return w("Asset context is unavailable."),null;A(u),w(null),U(null);try{const j=await C(Ae(d));return t(k=>ps(k,j)),f(se(j)),Qn(u)&&U(Zn(u,j)),j}catch(j){return w(re(j,"Asset Library action failed.")),null}finally{A(null)}},[e,S]),Ce=c.useCallback(async()=>{A("rescan"),w(null),U(null);try{const u=xs(g,T,p);if(g==="place"&&T===null){w("No active place is connected for place-scoped assets.");return}const v=await Promise.allSettled(u.map(({request:Y})=>ft(Y))),C=v.flatMap(Y=>Y.status==="fulfilled"?[Y.value]:[]),d=v.flatMap((Y,fe)=>Y.status==="rejected"?[{label:u[fe].label,reason:Y.reason}]:[]);g==="all"&&T===null&&d.unshift({label:"place",reason:new Error("No active place is available")});const j=We(C.flatMap(Y=>Y.assets),p),k=C.reduce((Y,fe)=>Y+fe.adoptedCount,0),O=C.reduce((Y,fe)=>Y+fe.skippedCount,0),de=We(C.flatMap(Y=>Y.adopted),p);t(j),l(j.length),U(`Rescan complete for ${p}: ${k} asset(s) added, ${O} skipped. Added: ${Jn(de)}.`),w(gs("Some Asset Library rescans failed",d))}catch(u){w(re(u,"Asset Library rescan failed."))}finally{A(null)}},[T,p,g]),_e=c.useCallback(async(u,v)=>{A("export-selection-rbxm"),w(null),U(null);try{const C=await Ct(oe(u),v);return t(d=>ps(d,C.asset)),f(se(C.asset)),U(`Exported Studio selection as RBXM asset: ${ye(C.asset)}${C.deduplicated?" (reused existing local asset)":""}.`),C}catch(C){return w(re(C,"Asset Library .rbxm export failed.")),null}finally{A(null)}},[oe]),Se=c.useCallback((u,v)=>ae("update",u,C=>bt(C,u,v)),[ae]),Ue=c.useCallback(async(u,v)=>{const C=await ae("upload",u,d=>jt(d,u,v));return C&&Z(C),C},[ae,Z]),Te=c.useCallback(async u=>{const v=(S==null?void 0:S.id)===u?S:e.find(d=>d.id===u)??null;if(!v)return w("Asset context is unavailable."),!1;const C=se(v);Q(C),A("delete"),w(null),U(null);try{return await yt(Ae(v),u),t(d=>{const j=d.filter(k=>!je(k,v));return l(j.length),j}),f(d=>d===C?null:d),U(`Deleted asset: ${ye(v,u)}. Local files removed; uploaded Roblox assets were not deleted.`),!0}catch(d){return w(re(d,"Asset Library delete failed.")),!1}finally{A(null)}},[e,Q,S]),Be=c.useCallback(async(u,v)=>{const C=(S==null?void 0:S.id)===u?S:e.find(d=>d.id===u)??null;if(!C)return w("Asset context is unavailable."),null;A("import-rbxm"),w(null),U(null);try{const d=await _t(Ae(C),u,v);return f(se(C)),U(`Imported RBXM asset: ${ye(C,u)} -> ${d.importedCount} instance(s) to ${d.targetParent}.`),d}catch(d){return w(re(d,"Asset Library .rbxm import failed.")),null}finally{A(null)}},[e,S]),Ee=c.useCallback(u=>ae("thumbnail-generate",u,v=>St(v,u)),[ae]),Ge=c.useCallback(u=>{const v=(S==null?void 0:S.id)===u?S:e.find(C=>C.id===u)??null;return v&&Q(se(v)),ae("status-refresh",u,C=>es(C,u))},[e,Q,ae,S]),Me=c.useCallback((u,v)=>ae("usage-scan",u,async C=>(await vt(C,u,v)).asset),[ae]),De=c.useCallback(u=>{x(u),f(null)},[]),ge=c.useCallback(u=>{r(u),f(null)},[]),Fe=c.useCallback(u=>{At(u)&&L(u)},[]),Oe=c.useCallback(u=>{if(u===null){f(null);return}const C=e.find(d=>se(d)===u)??e.find(d=>d.id===u);f(C?se(C):u)},[e]);return{assets:e,totalCount:n,selectedAsset:S,selectedAssetId:J,selectedAssetKey:o,scope:g,categoryFilter:p,availablePlaces:K,selectedPlaceId:b,activePlaceId:T,activePlaceName:V,selectedPlaceIsConnected:G,selectedPlaceFolderUnresolved:H,selectedPlaceHasSyncMetadata:q,studioConnected:I,loading:$,busyAction:i,error:te,lastMessage:m,setScope:De,setSelectedPlaceId:ge,setCategoryFilter:Fe,selectAsset:Oe,refresh:xe,rescan:Ce,exportSelectionRbxm:_e,updateMetadata:Se,uploadAsset:Ue,deleteAsset:Te,importRbxm:Be,generateThumbnail:Ee,refreshStatus:Ge,scanUsage:Me}}const ks="weppy-assets-view-preferences-v1",he={organizationMode:"folders",viewMode:"grid",gridSize:"medium"};function lo(e){return e==="folders"||e==="all-assets"}function no(e){return e==="grid"||e==="list"}function oo(e){return e==="small"||e==="medium"||e==="large"}function ro(){if(typeof window>"u")return he;try{const e=window.localStorage.getItem(ks);if(!e)return he;const t=JSON.parse(e);return{organizationMode:lo(t.organizationMode)?t.organizationMode:he.organizationMode,viewMode:no(t.viewMode)?t.viewMode:he.viewMode,gridSize:oo(t.gridSize)?t.gridSize:he.gridSize}}catch{return he}}function io(){const[e,t]=c.useState(ro);return c.useEffect(()=>{try{window.localStorage.setItem(ks,JSON.stringify(e))}catch{}},[e]),{...e,setOrganizationMode:n=>{t(l=>({...l,organizationMode:n}))},setViewMode:n=>{t(l=>({...l,viewMode:n}))},setGridSize:n=>{t(l=>({...l,gridSize:n}))}}}function co(e,t){return t("assets.count.shown","Shown assets: {count}").replace("{count}",String(e))}function uo(e,t){return e===null?null:t("assets.place.id","Place ID {placeId}").replace("{placeId}",String(e))}function Co(){const{t:e}=ce(),{trackEvent:t}=Es(),{tier:n,loading:l}=Gs(),o=ao(),f=io(),[g,x]=c.useState(!1),[p,L]=c.useState(!1),[K,B]=c.useState(!1),R=!l&&n==="pro",r=o.selectedAsset,b=(r==null?void 0:r.file.original.toLowerCase().endsWith(".rbxm"))??!1,N=(r==null?void 0:r.category)==="model"||(r==null?void 0:r.category)==="animation",T="game.Workspace",V=!!(R&&o.studioConnected&&r&&b&&N),D=o.availablePlaces??[],G=o.selectedPlaceId??o.activePlaceId,E=o.selectedAssetKey??(r?se(r):null),H=c.useCallback(()=>{o.selectAsset(null)},[o.selectAsset]),M=c.useMemo(()=>{const y=typeof o.activePlaceId=="number"?e("placeScope.folder.unresolvedPlace","Place {placeId}").replace("{placeId}",String(o.activePlaceId)):e("assets.scope.place","Current Place"),i=o.selectedPlaceFolderUnresolved?y:o.activePlaceName??y;return o.scope==="shared"?[e("assets.scope.shared","Shared")]:o.scope==="all"?[e("assets.scope.all","All scopes"),i,e("assets.scope.shared","Shared")]:[i,o.selectedPlaceFolderUnresolved?null:uo(o.activePlaceId,e)].filter(A=>!!A)},[o.activePlaceId,o.activePlaceName,o.scope,o.selectedPlaceFolderUnresolved,e]),q=o.scope==="place"&&typeof G=="number"?o.selectedPlaceIsConnected?e("placeScope.connected","Studio connected"):e("placeScope.stored","Stored data"):null,P=c.useMemo(()=>qe(o.categoryFilter,e),[o.categoryFilter,e]),I=co(o.totalCount,e),X=o.scope==="place"&&(o.selectedPlaceFolderUnresolved||o.selectedPlaceHasSyncMetadata===!1),$=e("assets.detail.importRbxm.tooltip","Insert this local RBXM asset into {target} in the connected Studio place.").replace("{target}",T);return s.jsxs("div",{className:a.page,children:[s.jsx(Fs,{title:e("assets.title","Assets"),description:e("assets.subtitle","Browse local originals, upload to Roblox, and inspect synced usage by place."),badge:s.jsx("span",{className:a.experimentalBadge,children:e("assets.experimental","Experimental")}),helpTopicId:"assets",helpState:{tier:n}}),s.jsxs("div",{className:a.toolbarShell,children:[s.jsxs("div",{className:[a.toolbar,X?a.toolbarExpandedSummary:""].filter(Boolean).join(" "),children:[s.jsxs("div",{className:a.segmented,role:"group","aria-label":e("assets.scope.label","Asset scope"),children:[s.jsx("button",{type:"button","aria-pressed":o.scope==="all",className:o.scope==="all"?a.segmentedActive:"",onClick:()=>o.setScope("all"),children:e("assets.scope.all","All scopes")}),s.jsx("button",{type:"button","aria-pressed":o.scope==="place",className:o.scope==="place"?a.segmentedActive:"",onClick:()=>o.setScope("place"),children:e("assets.scope.place","Current Place")}),s.jsx("button",{type:"button","aria-pressed":o.scope==="shared",className:o.scope==="shared"?a.segmentedActive:"",onClick:()=>o.setScope("shared"),children:e("assets.scope.shared","Shared")})]}),s.jsx("div",{className:a.placeContextSlot,role:"group","aria-label":e("assets.place.context","Asset place context"),children:o.scope==="shared"?s.jsx("span",{className:a.sharedPlaceContext,children:e("assets.place.sharedLibrary","Shared library")}):D.length>0?s.jsxs("label",{className:a.placeSelectorLabel,children:[s.jsx("span",{children:e("assets.place.selector","Asset place")}),s.jsxs("select",{className:a.placeSelect,value:typeof G=="number"?String(G):"",onChange:y=>{const i=Number.parseInt(y.currentTarget.value,10);Number.isInteger(i)&&o.setSelectedPlaceId(i)},children:[typeof G!="number"?s.jsx("option",{value:"",disabled:!0,children:e("placeScope.selector.noneSelectable","No selectable Place folder")}):null,s.jsx(Os,{places:D,t:e})]})]}):s.jsx("span",{className:a.sharedPlaceContext,children:o.activePlaceName??e("assets.scope.place","Current Place")})}),s.jsxs("div",{className:a.listContextSummary,children:[q||o.scope==="place"&&(o.selectedPlaceFolderUnresolved||o.selectedPlaceHasSyncMetadata===!1)?s.jsxs("div",{className:a.placeStatusGroup,children:[q?s.jsx(me,{variant:o.selectedPlaceIsConnected?"success":"neutral",shape:"pill",children:q}):null,o.scope==="place"&&o.selectedPlaceFolderUnresolved?s.jsx(me,{variant:"neutral",shape:"pill",children:e("placeScope.folder.unresolved","Representative folder unconfirmed")}):null,o.scope==="place"&&o.selectedPlaceHasSyncMetadata===!1?s.jsx(me,{variant:"neutral",shape:"pill",children:e("placeScope.folder.noSyncHistory","No sync history")}):null]}):null,s.jsxs("div",{className:a.contextTextSummary,children:[M.map((y,i)=>s.jsxs("span",{children:[i>0?s.jsx("span",{className:a.contextDivider,children:" · "}):null,y]},`${y}-${i}`)),M.length>0?s.jsx("span",{className:a.contextDivider,children:" · "}):null,s.jsx("span",{children:P}),s.jsx("span",{className:a.contextDivider,children:" · "}),s.jsx("strong",{children:I})]})]}),s.jsxs("div",{className:a.toolbarActions,children:[s.jsx(ee,{text:e("assets.rescan.tooltip","Scan inbox folders for the current filter."),children:s.jsxs("button",{type:"button",className:a.commandButton,disabled:o.busyAction==="rescan",onClick:()=>{t("dashboard_click_event",{click_target:"assets_rescan",page:"assets"}),o.rescan()},children:[s.jsx(fs,{size:15}),e("assets.rescan","Rescan")]})}),s.jsx(ee,{text:p?"":e("assets.settings.open.tooltip","Open Roblox upload settings."),children:s.jsx("button",{type:"button",className:[a.iconButton,p?a.iconButtonActive:""].filter(Boolean).join(" "),onClick:()=>{t("dashboard_click_event",{click_target:"assets_open_settings",page:"assets"}),L(y=>!y)},"aria-label":e("assets.settings.open","Open settings"),"aria-controls":"asset-library-settings-panel","aria-expanded":p,children:s.jsx(bs,{size:16})})})]}),s.jsxs("div",{className:a.categoryControl,children:[s.jsx("span",{id:"assets-category-filter-label",className:a.categoryControlLabel,children:e("assets.category.filter","Category")}),s.jsx("div",{className:a.categoryRail,role:"radiogroup","aria-labelledby":"assets-category-filter-label",children:_s.map(y=>{const i=o.categoryFilter===y,A=qe(y,e);return s.jsx("button",{type:"button",role:"radio","aria-checked":i,className:[a.categoryButton,i?a.categoryButtonActive:""].filter(Boolean).join(" "),onClick:()=>{o.setCategoryFilter(y)},children:A},y)})})]})]}),D.some(y=>y.folderStatus==="duplicate"||y.folderStatus==="unresolved")?s.jsx("div",{className:a.placeFolderDetails,children:s.jsx(Hs,{places:D,t:e})}):null,s.jsx(Vn,{open:p,tier:n,onClose:()=>L(!1)})]}),o.error&&s.jsxs("div",{className:a.errorState,children:[o.scope==="all"?s.jsx("strong",{children:e("assets.partial.title","Some locations could not be loaded")}):null,s.jsx("span",{children:o.error})]}),o.lastMessage&&s.jsx("div",{className:a.messageState,children:o.lastMessage}),o.categoryFilter==="rbxm"&&s.jsxs("section",{className:a.rbxmGuide,"aria-label":e("assets.rbxmGuide.title","Save RBXM from Studio"),children:[s.jsx("h2",{children:e("assets.rbxmGuide.title","Save RBXM from Studio")}),s.jsx("p",{children:e("assets.rbxmGuide.body","Select objects in Roblox Studio, then use WEPPY Plugin > Assets to save the selection as a local RBXM asset.")}),s.jsx("p",{children:e("assets.rbxmGuide.thumbnail","The plugin save flow includes a thumbnail option, and saved RBXM assets appear here for management, upload, and insertion.")})]}),!R&&!l&&s.jsx("div",{className:`${a.notice} ${a.proNotice}`,children:e("assets.basic.notice","Browse, preview, edit metadata, and scan usage on Basic. Roblox upload controls are available on Pro.")}),o.loading?s.jsx("div",{className:a.emptyState,children:e("assets.loading.scope","Loading {scope} assets...").replace("{scope}",o.scope==="all"?e("assets.scope.all","All scopes"):o.scope==="shared"?e("assets.scope.shared","Shared"):e("assets.scope.place","Current Place"))}):s.jsx(cn,{displayScope:o.scope,assets:o.assets,place:{placeId:o.activePlaceId,placeName:o.activePlaceName},categoryFilter:o.categoryFilter,organizationMode:f.organizationMode,viewMode:f.viewMode,gridSize:f.gridSize,selectedAssetKey:E,onSelectAsset:o.selectAsset,onClearSelection:H,onOrganizationModeChange:f.setOrganizationMode,onViewModeChange:f.setViewMode,onGridSizeChange:f.setGridSize,emptyContent:o.error?void 0:s.jsx(pn,{scope:o.scope,isPro:R,busy:o.busyAction==="rescan",onRescan:()=>{t("dashboard_click_event",{click_target:"assets_empty_rescan",page:"assets"}),o.rescan()}})}),s.jsx(Pn,{asset:g||p||K?null:r,busyAction:o.busyAction,canUpload:R,canImportRbxm:V,importRbxmTooltip:$,importRbxmTargetParent:T,onClose:()=>o.selectAsset(null),onSave:async(y,i)=>{r&&await o.updateMetadata(r.id,{displayName:y,description:i})},onUpload:()=>x(!0),onDelete:()=>B(!0),onImportRbxm:async()=>{r&&(t("dashboard_click_event",{click_target:"assets_import_rbxm",page:"assets"}),await o.importRbxm(r.id,{targetParent:T}))},onRefreshStatus:async()=>{r&&await o.refreshStatus(r.id)},onScanUsage:async()=>{r&&(t("dashboard_click_event",{click_target:"assets_usage_scan",page:"assets"}),await o.scanUsage(r.id,o.activePlaceId??void 0))}}),s.jsx(ys,{open:K&&!!r,title:e("assets.delete.title","Delete asset"),message:e("assets.delete.message","This removes the local Asset Library files only. Uploaded Roblox assets are not deleted."),cancelLabel:e("common.cancel","Cancel"),confirmLabel:e("common.delete","Delete"),loading:o.busyAction==="delete",onCancel:()=>B(!1),onConfirm:()=>{r&&(t("dashboard_click_event",{click_target:"assets_delete",page:"assets"}),o.deleteAsset(r.id).then(y=>{y&&B(!1)}))}}),s.jsx(On,{asset:r,open:g,canUpload:R,busyAction:o.busyAction,onClose:()=>{x(!1),o.selectAsset(null)},onBack:()=>x(!1),onOpenSettings:()=>{x(!1),L(!0)},onUpload:async y=>{if(!r)return;t("dashboard_click_event",{click_target:"assets_upload_submit",page:"assets"}),await o.uploadAsset(r.id,y)&&x(!1)}})]})}export{Co as Component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,b as P,D as Q,u as q,j as e,X as W,a as X,v as Y,c as J,e as ee,i as te,T as ae}from"./index-CG4GxcAc.js";import{B as ne,P as se}from"./PageHeader-Dc41DgFB.js";import{C as ie}from"./ConfirmModal-Ddk0UX_P.js";import{C as ce}from"./CurrentPlaceScope-Y25KxsHT.js";import{T as O}from"./TooltipText-C0DmdntK.js";import{C as oe,T as re}from"./Tabs-Dl0dNd8V.js";import{I as le}from"./InfoLabel-CAGC3efT.js";import{G as de}from"./GameChangeDetail-br9EgICc.js";import"./ConfirmModal.module-DJksQHBd.js";import"./PlaceSelectOptions-Gd2pK9DL.js";const ge=10;function me(t,i){return typeof i!="number"?t:`${t}?placeId=${encodeURIComponent(String(i))}`}function he(t){const i=(t==null?void 0:t.placeId)??null,[m,c]=o.useState([]),[n,s]=o.useState(0),[u,p]=o.useState(!1),[r,T]=o.useState(!0),[C,E]=o.useState(0),[f,z]=o.useState("all"),B=o.useRef(null),S=o.useCallback(async(y,v)=>{T(!0);try{const k={limit:String(ge),offset:String(y)};v!=="all"&&(k.status=v),typeof i=="number"&&(k.placeId=String(i));const w=await P.get("/api/dashboard/changelog",k);c(w.entries),s(w.total),p(w.hasMore)}catch{c([]),s(0),p(!1)}finally{T(!1)}},[i]),I=o.useCallback(()=>{S(C,f)},[S,C,f]),$=o.useCallback(async()=>{await P.post(me("/api/dashboard/changelog/clear",i)),c([]),s(0),p(!1)},[i]);return o.useEffect(()=>{S(C,f)},[S,C,f]),o.useEffect(()=>{const y=new Q;B.current=y,y.connect();const v=y.on("command",()=>{S(C,f)});return()=>{v(),y.disconnect(),B.current=null}},[S,C,f]),{entries:m,total:n,hasMore:u,loading:r,offset:C,statusFilter:f,setOffset:E,setStatusFilter:z,refresh:I,clear:$}}const ue="_card_qniob_2",pe="_header_qniob_27",fe="_statusBadge_qniob_34",ye="_statusDot_qniob_45",xe="_active_qniob_51",_e="_completed_qniob_60",be="_timeRange_qniob_68",Ce="_summaryList_qniob_75",Se="_summaryItem_qniob_81",ve="_summaryIcon_qniob_90",je="_summaryText_qniob_96",Ne="_progressBar_qniob_101",Te="_progressFill_qniob_110",Ie="_emptySummary_qniob_124",ke="_contextBlock_qniob_132",we="_contextLabel_qniob_141",$e="_contextValue_qniob_149",h={card:ue,header:pe,statusBadge:fe,statusDot:ye,active:xe,completed:_e,timeRange:be,summaryList:Ce,summaryItem:Se,summaryIcon:ve,summaryText:je,progressBar:Ne,progressFill:Te,emptySummary:Ie,contextBlock:ke,contextLabel:we,contextValue:$e};function H(t){if(!t)return"--:--";const i=new Date(t);return`${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}`}function Be({entry:t,onClick:i,buttonRef:m}){var v,k,w,L,A,R,d,_,D,M;const{t:c}=q(),n=t.changeSummary,s=t.status==="active",u=t.isBootstrapOnly===!0,p=[],r=n.scriptsModified+n.scriptsCreated;if(r>0){const g=[];n.scriptsModified>0&&g.push(`${n.scriptsModified} ${c("changelog.card.modified","modified")}`),n.scriptsCreated>0&&g.push(`${n.scriptsCreated} ${c("changelog.card.created","created")}`);const x=`${r} ${c("changelog.card.scripts","scripts")} ${g.join(", ")}`;p.push({icon:"📝",text:x,tooltip:c("changelog.card.scripts.tooltip","Script changes made in this session.")})}const T=n.instancesCreated+n.instancesDeleted+n.instancesMoved;if(T>0){const g=[];n.instancesCreated>0&&g.push(`${n.instancesCreated} ${c("changelog.card.created","created")}`),n.instancesDeleted>0&&g.push(`${n.instancesDeleted} ${c("changelog.card.deleted","deleted")}`),n.instancesMoved>0&&g.push(`${n.instancesMoved} ${c("changelog.card.moved","moved")}`);const x=`${T} ${c("changelog.card.instances","instances")} ${g.join(", ")}`;p.push({icon:"🧱",text:x,tooltip:c("changelog.card.instances.tooltip","Instance create, delete, move, or clone changes in this session.")})}n.propertiesChanged>0&&p.push({icon:"🎨",text:`${n.propertiesChanged} ${c("changelog.card.propertiesChanged","properties changed")}`,tooltip:c("changelog.card.propertiesChanged.tooltip","Property value changes recorded for this session.")}),n.lightingChanged&&p.push({icon:"🌅",text:c("changelog.card.lightingConfigured","Lighting configured"),tooltip:c("changelog.card.lightingConfigured.tooltip","Lighting or atmosphere settings changed in this session.")}),n.terrainChanged&&p.push({icon:"⛰️",text:c("changelog.card.terrainConfigured","Terrain configured"),tooltip:c("changelog.card.terrainConfigured.tooltip","Terrain data or terrain settings changed in this session.")}),n.assetsInserted>0&&p.push({icon:"📦",text:`${n.assetsInserted} ${c("changelog.card.assetsInserted","assets inserted")}`,tooltip:c("changelog.card.assetsInserted.tooltip","Assets inserted into the place during this session.")});const C=H(t.startTime),E=s?c("changelog.card.inProgress","in progress"):t.endTime?H(t.endTime):"--:--",f=u?c("changelog.card.bootstrapStatus","Bootstrap"):s?c("changelog.card.active","Active"):c("changelog.card.completed","Completed"),z=u?c("changelog.card.bootstrapStatus.tooltip","This session only contains the initial sync bootstrap snapshot."):s?c("changelog.card.active.tooltip","This session is still receiving new game changes."):c("changelog.card.completed.tooltip","This session has ended and no more changes are expected."),B=u?c("changelog.card.bootstrapSummary","Initial sync snapshot"):c("changelog.card.noChanges","No changes yet"),S=u?c("changelog.card.bootstrapSummary.tooltip","Initial file sync writes are collapsed into a single bootstrap snapshot row."):c("changelog.card.noChanges.tooltip","No game changes have been extracted for this session yet."),I=(k=(v=t.contextSummary)==null?void 0:v.intent)==null?void 0:k.trim(),$=((R=(A=(L=(w=t.contextSummary)==null?void 0:w.affectedAreas)==null?void 0:L[0])==null?void 0:A.label)==null?void 0:R.trim())||((_=(d=t.contextSummary)==null?void 0:d.testScenario)==null?void 0:_.trim()),y=(M=(D=t.verificationSummary)==null?void 0:D.label)==null?void 0:M.trim();return e.jsxs("button",{ref:m,className:h.card,type:"button",onClick:g=>i(g.currentTarget),children:[e.jsxs("span",{className:h.header,children:[e.jsx(O,{text:z,children:e.jsxs("span",{className:`${h.statusBadge} ${s?h.active:h.completed}`,children:[e.jsx("span",{className:h.statusDot}),f]})}),e.jsxs("span",{className:h.timeRange,children:[C,"~",E]})]}),e.jsx("span",{className:h.summaryList,children:p.length>0?p.map((g,x)=>e.jsxs("span",{className:h.summaryItem,children:[e.jsx("span",{className:h.summaryIcon,children:g.icon}),e.jsx(O,{text:g.tooltip,children:e.jsx("span",{className:h.summaryText,children:g.text})})]},x)):e.jsx(O,{text:S,children:e.jsx("span",{className:h.emptySummary,style:{display:"block"},children:B})})}),I&&e.jsxs("span",{className:h.contextBlock,children:[e.jsx("span",{className:h.contextLabel,children:c("changelog.card.sessionIntent","Session intent")}),e.jsx("span",{className:h.contextValue,children:I})]}),!I&&$&&e.jsxs("span",{className:h.contextBlock,children:[e.jsx("span",{className:h.contextLabel,children:c("changelog.card.representativeArea","Representative area")}),e.jsx("span",{className:h.contextValue,children:$})]}),y&&e.jsxs("span",{className:h.contextBlock,children:[e.jsx("span",{className:h.contextLabel,children:c("changelog.card.verification","Verification")}),e.jsx("span",{className:h.contextValue,children:y})]}),s&&e.jsx("span",{className:h.progressBar,children:e.jsx("span",{className:h.progressFill})})]})}function ze(t){const i={scriptsModified:0,scriptsCreated:0,instancesCreated:0,instancesDeleted:0,instancesMoved:0,propertiesChanged:0,lightingChanged:!1,terrainChanged:!1,assetsInserted:0};for(const m of t)switch(m.category){case"script":m.changeType==="create"?i.scriptsCreated++:i.scriptsModified++;break;case"instance":m.changeType==="create"?i.instancesCreated++:m.changeType==="delete"?i.instancesDeleted++:m.changeType==="move"&&i.instancesMoved++;break;case"property":i.propertiesChanged++;break;case"lighting":i.lightingChanged=!0;break;case"terrain":i.terrainChanged=!0;break;case"asset":i.assetsInserted++;break}return i}function Ee(t){if(typeof t=="number")return{placeId:String(t)}}function Le(t,i){const[m,c]=o.useState(""),[n,s]=o.useState(""),[u,p]=o.useState(),[r,T]=o.useState("completed"),[C,E]=o.useState([]),[f,z]=o.useState([]),[B,S]=o.useState([]),[I,$]=o.useState(),[y,v]=o.useState(),[k,w]=o.useState(),[L,A]=o.useState({scriptsModified:0,scriptsCreated:0,instancesCreated:0,instancesDeleted:0,instancesMoved:0,propertiesChanged:0,lightingChanged:!1,terrainChanged:!1,assetsInserted:0}),[R,d]=o.useState(!0),[_,D]=o.useState(null),M=o.useCallback(async()=>{if(t){d(!0),D(null);try{const g=Ee(i),[x,G]=await Promise.all([g?P.get(`/api/dashboard/changelog/${t}`,g):P.get(`/api/dashboard/changelog/${t}`),g?P.get(`/api/dashboard/changelog/${t}/changes`,g):P.get(`/api/dashboard/changelog/${t}/changes`)]);c(x.entryId),s(x.startTime),p(x.endTime),T(x.status),E(x.entries),z(x.failures),$(x.contextSummary),v(x.replayMetadata),w(x.verificationSummary),S(G.changes),A(ze(G.changes))}catch(g){D(g instanceof Error?g.message:"Failed to load changelog detail")}finally{d(!1)}}},[t,i]);return o.useEffect(()=>{M()},[M]),{entryId:m,startTime:n,endTime:u,status:r,entries:C,failures:f,changes:B,changeSummary:L,contextSummary:I,replayMetadata:y,verificationSummary:k,loading:R,error:_,refresh:M}}const Ae={script:"📝",instance:"🧱",property:"🎨",lighting:"🌅",terrain:"⛰️",asset:"📦"};function Re(t){return Ae[t]??"❓"}const Me="_dialogContent_197zf_2",Oe="_dialogHeader_197zf_10",De="_dialogTitleGroup_197zf_20",Fe="_dialogTitle_197zf_20",Pe="_dialogMeta_197zf_36",Ge="_dialogClose_197zf_43",Ke="_dialogBody_197zf_68",Ve="_page_197zf_77",qe="_headerTime_197zf_84",Ue="_dialogActions_197zf_90",He="_retryButton_197zf_96",Ze="_statusActive_197zf_129",Qe="_statusCompleted_197zf_134",We="_section_197zf_139",Xe="_sectionTitle_197zf_146",Ye="_summaryGrid_197zf_159",Je="_summaryCard_197zf_165",et="_summaryCardActive_197zf_188",tt="_summaryIcon_197zf_193",at="_summaryCount_197zf_199",nt="_summaryLabel_197zf_207",st="_contextGrid_197zf_217",it="_contextRow_197zf_223",ct="_contextKey_197zf_229",ot="_contextValue_197zf_237",rt="_timelineFilter_197zf_245",lt="_filterLabel_197zf_253",dt="_filterSelect_197zf_259",gt="_ownershipToggle_197zf_269",mt="_timeline_197zf_245",ht="_timelineEntry_197zf_297",ut="_timelineTime_197zf_326",pt="_timelineIcon_197zf_334",ft="_timelineBody_197zf_339",yt="_timelineSummary_197zf_345",xt="_timelineTarget_197zf_353",_t="_timelineConfidence_197zf_361",bt="_ownershipBadge_197zf_370",Ct="_confidenceExact_197zf_378",St="_confidencePartial_197zf_383",vt="_confidenceAfterOnly_197zf_388",jt="_confidenceIntentOnly_197zf_393",Nt="_confidenceUnknown_197zf_398",Tt="_timelineExpanded_197zf_404",It="_empty_197zf_413",kt="_loading_197zf_422",wt="_error_197zf_431",a={dialogContent:Me,dialogHeader:Oe,dialogTitleGroup:De,dialogTitle:Fe,dialogMeta:Pe,dialogClose:Ge,dialogBody:Ke,page:Ve,headerTime:qe,dialogActions:Ue,retryButton:He,statusActive:Ze,statusCompleted:Qe,section:We,sectionTitle:Xe,summaryGrid:Ye,summaryCard:Je,summaryCardActive:et,summaryIcon:tt,summaryCount:at,summaryLabel:nt,contextGrid:st,contextRow:it,contextKey:ct,contextValue:ot,timelineFilter:rt,filterLabel:lt,filterSelect:dt,ownershipToggle:gt,timeline:mt,timelineEntry:ht,timelineTime:ut,timelineIcon:pt,timelineBody:ft,timelineSummary:yt,timelineTarget:xt,timelineConfidence:_t,ownershipBadge:bt,confidenceExact:Ct,confidencePartial:St,confidenceAfterOnly:vt,confidenceIntentOnly:jt,confidenceUnknown:Nt,timelineExpanded:Tt,empty:It,loading:kt,error:wt},Z=[{key:"script",icon:"📝",labelKey:"changelog.category.script"},{key:"instance",icon:"🧱",labelKey:"changelog.category.instance"},{key:"property",icon:"🎨",labelKey:"changelog.category.property"},{key:"lighting",icon:"🌅",labelKey:"changelog.category.lighting"},{key:"terrain",icon:"⛰️",labelKey:"changelog.category.terrain"},{key:"asset",icon:"📦",labelKey:"changelog.category.asset"}];function V(t){if(!t)return"--:--";const i=new Date(t);return`${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}`}function $t(t){if(!t)return"--:--:--";const i=new Date(t);return`${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}:${String(i.getSeconds()).padStart(2,"0")}`}function Bt(t,i){if(!t||!i)return"";const m=new Date(i).getTime()-new Date(t).getTime();return m<0?"":`${Math.round(m/6e4)}min`}function zt(t){switch(t){case"exact":return a.confidenceExact;case"partial":return a.confidencePartial;case"after-only":return a.confidenceAfterOnly;case"intent-only":return a.confidenceIntentOnly;default:return a.confidenceUnknown}}function Et(t,i){switch(i){case"exact":return t("changelog.detail.confidence.exact","Exact");case"partial":return t("changelog.detail.confidence.partial","Partial");case"after-only":return t("changelog.detail.confidence.afterOnly","After only");case"intent-only":return t("changelog.detail.confidence.intentOnly","Intent only");default:return t("changelog.detail.confidence.unknown","Unknown")}}function Lt(t,i){switch(i){case"exact":return t("changelog.detail.confidence.exact.tooltip","Both the before and after state were confirmed for this change.");case"partial":return t("changelog.detail.confidence.partial.tooltip","Only part of the before and after state could be confirmed for this change.");case"after-only":return t("changelog.detail.confidence.afterOnly.tooltip","Only the resulting state after the change could be confirmed.");case"intent-only":return t("changelog.detail.confidence.intentOnly.tooltip","Only the requested action was recorded, not the resulting state.");default:return t("changelog.detail.confidence.unknown.tooltip","This change could not be confidently classified from the available data.")}}function At(t,i){switch(i){case"user_source":return t("changelog.ownership.userSource","User source");case"canonical_mirror":return t("changelog.ownership.canonicalMirror","Mirror metadata");case"generated":return t("changelog.ownership.generated","Generated");default:return null}}function Rt({entryId:t,placeId:i,onClose:m,returnFocusTo:c=null}){var v,k,w,L,A,R,d,_,D,M,g,x,G,U;const{t:n}=q(),s=Le(t,i),[u,p]=o.useState("all"),[r,T]=o.useState(!0),[C,E]=o.useState(null),f=o.useMemo(()=>{const l=r?s.changes:s.changes.filter(b=>b.artifactOwnership!=="generated");return[...u==="all"?l:l.filter(b=>b.category===u)].reverse()},[s.changes,u,r]),z=s.changes.some(l=>l.artifactOwnership==="generated"),B=Bt(s.startTime,s.endTime),S=s.endTime?`${V(s.startTime)} → ${V(s.endTime)} (${B})`:`${V(s.startTime)} → ${n("changelog.card.inProgress","in progress")}`,I=!!((v=s.contextSummary)!=null&&v.intent||(k=s.contextSummary)!=null&&k.testScenario||(w=s.contextSummary)!=null&&w.expectedBehavior||(L=s.contextSummary)!=null&&L.observedBehavior),$=!!((A=s.verificationSummary)!=null&&A.label||(R=s.verificationSummary)!=null&&R.status||(d=s.verificationSummary)!=null&&d.testTimestamp),y=n("changelog.detail.dialogLabel","Changelog detail");return e.jsx(oe,{open:!0,ariaLabel:y,onClose:m,returnFocusTo:c,testId:"changelog-detail-backdrop",children:e.jsxs("div",{className:a.dialogContent,children:[e.jsxs("div",{className:a.dialogHeader,children:[e.jsxs("div",{className:a.dialogTitleGroup,children:[e.jsx("h2",{className:a.dialogTitle,children:y}),!s.loading&&!s.error&&e.jsxs("div",{className:a.dialogMeta,children:[e.jsx("span",{className:a.headerTime,children:S}),e.jsx(O,{text:s.status==="active"?n("changelog.card.active.tooltip","This session is still receiving new game changes."):n("changelog.card.completed.tooltip","This session has ended and no more changes are expected."),children:e.jsx("span",{className:s.status==="active"?a.statusActive:a.statusCompleted,children:s.status==="active"?n("changelog.card.active","Active"):n("changelog.card.completed","Completed")})})]})]}),e.jsx("button",{className:a.dialogClose,type:"button","aria-label":n("common.close","Close"),onClick:m,children:e.jsx(W,{size:18,"aria-hidden":"true"})})]}),e.jsxs("div",{className:a.dialogBody,children:[s.loading&&e.jsx("div",{className:a.loading,children:n("common.loading","Loading...")}),s.error&&e.jsxs("div",{className:a.error,children:[e.jsx("span",{children:s.error}),e.jsxs("div",{className:a.dialogActions,children:[e.jsx("button",{className:a.retryButton,type:"button",onClick:s.refresh,children:n("common.retry","Retry")}),e.jsx("button",{className:a.retryButton,type:"button",onClick:m,children:n("common.close","Close")})]})]}),!s.loading&&!s.error&&e.jsxs("div",{className:a.page,children:[e.jsxs("div",{className:a.section,children:[e.jsx("div",{className:a.sectionTitle,children:e.jsx(O,{text:n("changelog.detail.changeSummary.tooltip","Counts of extracted game changes grouped by category for this session."),children:e.jsx("span",{children:n("changelog.detail.changeSummary","Change Summary")})})}),e.jsx("div",{className:a.summaryGrid,children:Z.map(l=>{const j=s.changeSummary;let b;switch(l.key){case"script":b=j.scriptsModified+j.scriptsCreated;break;case"instance":b=j.instancesCreated+j.instancesDeleted+j.instancesMoved;break;case"property":b=j.propertiesChanged;break;case"lighting":b=j.lightingChanged?1:0;break;case"terrain":b=j.terrainChanged?1:0;break;case"asset":b=j.assetsInserted;break;default:b=0}const F=u===l.key;return e.jsxs("button",{type:"button",className:`${a.summaryCard} ${F?a.summaryCardActive:""}`,"aria-label":`${n(l.labelKey,l.key)}: ${b}`,"aria-pressed":F,onClick:()=>p(F?"all":l.key),children:[e.jsx("span",{className:a.summaryIcon,children:l.icon}),e.jsx("span",{className:a.summaryCount,children:b}),e.jsx("span",{className:a.summaryLabel,children:n(l.labelKey,l.key)})]},l.key)})})]}),I&&e.jsxs("div",{className:a.section,children:[e.jsx("div",{className:a.sectionTitle,children:e.jsx(O,{text:n("changelog.detail.context.tooltip","Structured execution context captured for this changelog session."),children:e.jsx("span",{children:n("changelog.detail.context.title","Context Summary")})})}),e.jsxs("div",{className:a.contextGrid,children:[((_=s.contextSummary)==null?void 0:_.intent)&&e.jsxs("div",{className:a.contextRow,children:[e.jsx("span",{className:a.contextKey,children:n("changelog.card.sessionIntent","Session intent")}),e.jsx("span",{className:a.contextValue,children:s.contextSummary.intent})]}),((D=s.contextSummary)==null?void 0:D.testScenario)&&e.jsxs("div",{className:a.contextRow,children:[e.jsx("span",{className:a.contextKey,children:n("playtest.context.why","Why this test ran")}),e.jsx("span",{className:a.contextValue,children:s.contextSummary.testScenario})]}),((M=s.contextSummary)==null?void 0:M.expectedBehavior)&&e.jsxs("div",{className:a.contextRow,children:[e.jsx("span",{className:a.contextKey,children:n("playtest.context.expected","Expected")}),e.jsx("span",{className:a.contextValue,children:s.contextSummary.expectedBehavior})]}),((g=s.contextSummary)==null?void 0:g.observedBehavior)&&e.jsxs("div",{className:a.contextRow,children:[e.jsx("span",{className:a.contextKey,children:n("playtest.context.observed","Observed")}),e.jsx("span",{className:a.contextValue,children:s.contextSummary.observedBehavior})]})]})]}),$&&e.jsxs("div",{className:a.section,children:[e.jsx("div",{className:a.sectionTitle,children:e.jsx(O,{text:n("changelog.detail.verification.tooltip","Verification signals linked to this changelog session."),children:e.jsx("span",{children:n("changelog.detail.verification.title","Verification")})})}),e.jsxs("div",{className:a.contextGrid,children:[((x=s.verificationSummary)==null?void 0:x.label)&&e.jsxs("div",{className:a.contextRow,children:[e.jsx("span",{className:a.contextKey,children:n("changelog.detail.verification.label","Result")}),e.jsx("span",{className:a.contextValue,children:s.verificationSummary.label})]}),((G=s.verificationSummary)==null?void 0:G.status)&&e.jsxs("div",{className:a.contextRow,children:[e.jsx("span",{className:a.contextKey,children:n("changelog.detail.verification.status","Status")}),e.jsx("span",{className:a.contextValue,children:s.verificationSummary.status})]}),((U=s.verificationSummary)==null?void 0:U.testTimestamp)&&e.jsxs("div",{className:a.contextRow,children:[e.jsx("span",{className:a.contextKey,children:n("changelog.detail.verification.timestamp","Recorded at")}),e.jsx("span",{className:a.contextValue,children:s.verificationSummary.testTimestamp})]})]})]}),e.jsxs("div",{className:a.section,children:[e.jsx("div",{className:a.sectionTitle,children:e.jsx(O,{text:n("changelog.detail.changeTimeline.tooltip","Chronological list of extracted game changes for this session."),children:e.jsx("span",{children:n("changelog.detail.changeTimeline","Change Timeline")})})}),e.jsxs("div",{className:a.timelineFilter,children:[e.jsx("span",{className:a.filterLabel,children:e.jsx(le,{label:`${n("changelog.detail.filterCategory","Category")}:`,tooltip:n("changelog.detail.filterCategory.tooltip","Filter the timeline to a single change category.")})}),e.jsxs("select",{className:a.filterSelect,value:u,onChange:l=>p(l.target.value),children:[e.jsx("option",{value:"all",children:n("tools.filter.all","All")}),Z.map(l=>e.jsxs("option",{value:l.key,children:[l.icon," ",n(l.labelKey,l.key)]},l.key))]}),z&&e.jsxs("label",{className:a.ownershipToggle,children:[e.jsx("input",{type:"checkbox",checked:r,onChange:l=>T(l.target.checked)}),n("changelog.ownership.showGenerated","Show generated metadata")]})]}),f.length===0?e.jsx("div",{className:a.empty,children:n("changelog.detail.noChanges","No changes in this category")}):e.jsx("div",{className:a.timeline,children:f.map((l,j)=>{const b=C===j,F=At(n,l.artifactOwnership);return e.jsxs("div",{children:[e.jsxs("button",{type:"button",className:a.timelineEntry,"aria-expanded":b,onClick:()=>E(b?null:j),children:[e.jsx("span",{className:a.timelineTime,children:$t(l.timestamp)}),e.jsx("span",{className:a.timelineIcon,children:Re(l.category)}),e.jsxs("span",{className:a.timelineBody,children:[e.jsxs("span",{className:a.timelineSummary,children:[l.summary,F&&e.jsx(ne,{variant:l.artifactOwnership==="generated"?"neutral":"accent",className:a.ownershipBadge,children:F}),e.jsx(O,{text:Lt(n,l.confidence),children:e.jsx("span",{className:`${a.timelineConfidence} ${zt(l.confidence)}`,children:Et(n,l.confidence)})})]}),e.jsx("span",{className:a.timelineTarget,children:l.target})]})]}),b&&e.jsx("div",{className:a.timelineExpanded,children:e.jsx(de,{change:l})})]},j)})})]})]})]})]})})}const Mt="_page_1tggr_2",Ot="_limitNotice_1tggr_9",Dt="_limitNoticeContent_1tggr_23",Ft="_limitNoticeTitle_1tggr_28",Pt="_limitNoticeText_1tggr_35",Gt="_primaryAction_1tggr_41",Kt="_clearButton_1tggr_67",Vt="_list_1tggr_88",qt="_empty_1tggr_95",Ut="_loading_1tggr_104",Ht="_pagination_1tggr_113",Zt="_pageInfo_1tggr_121",Qt="_btn_1tggr_127",N={page:Mt,limitNotice:Ot,limitNoticeContent:Dt,limitNoticeTitle:Ft,limitNoticeText:Pt,primaryAction:Gt,clearButton:Kt,list:Vt,empty:qt,loading:Ut,pagination:Ht,pageInfo:Zt,btn:Qt},K=10;function Wt(t,i){return typeof i!="number"?`/changelog/${t}`:`/changelog/${t}?placeId=${encodeURIComponent(String(i))}`}function Xt(t){const i=/^\/changelog\/([^/]+)$/.exec(t);if(!i)return null;try{return decodeURIComponent(i[1])}catch{return i[1]}}function Yt(t){const i=new URLSearchParams(t).get("placeId");if(!i)return null;const m=Number.parseInt(i,10);return Number.isInteger(m)&&m>=0?m:null}const Jt=[{key:"all",labelKey:"changelog.filter.all"},{key:"active",labelKey:"changelog.filter.active"},{key:"completed",labelKey:"changelog.filter.completed"}];function da(){const{t}=q(),{trackEvent:i,trackPageView:m}=X(),c=Y(),n=J(),s=Xt(n.pathname),[u,p]=o.useState(()=>Yt(n.search)),r=he({placeId:u}),T=ee(),{show:C}=te(),[E,f]=o.useState(!1),[z,B]=o.useState(!1),[S,I]=o.useState(null),$=o.useRef(null),y=s??S,v=!T.loading&&T.tier==="basic",k=v?r.entries.slice(0,3):r.entries,w=!v&&r.total>K;o.useEffect(()=>{s&&s===S&&I(null)},[S,s]);const L=async()=>{B(!0);try{await r.clear(),C(t("toast.clearSuccess","Cleared successfully"),"success"),f(!1)}catch{C(t("toast.clearFailed","Failed to clear data"),"error")}finally{B(!1)}},A=(d,_)=>{$.current=_,I(d),c(Wt(d,u))},R=()=>{I(null),c("/changelog",{replace:!0})};return e.jsxs("div",{className:N.page,children:[e.jsx(se,{title:t("page.changelog.title","Changelog"),description:t("page.changelog.description","Review game-change sessions captured from AI actions and sync events."),helpTopicId:"changelog",helpState:{tier:T.tier}}),e.jsx(ce,{surface:"changelog",selectable:!0,selectedPlaceId:u,onSelectedPlaceIdChange:d=>{p(d),r.setOffset(0)}}),e.jsx(re,{items:Jt.map(d=>({key:d.key,label:t(d.labelKey,d.key.charAt(0).toUpperCase()+d.key.slice(1))})),value:r.statusFilter,onChange:d=>{const _=`changelog_${d}`;i("dashboard_click_event",{click_target:`changelog_tab_${d}`,page:"changelog",tab:_}),m({page:"changelog",tab:_}),r.setStatusFilter(d),r.setOffset(0)},rightActions:e.jsx("button",{className:N.clearButton,onClick:()=>{i("dashboard_click_event",{click_target:"changelog_clear",page:"changelog",tab:`changelog_${r.statusFilter}`}),f(!0)},children:t("common.clear","Clear")})}),r.loading&&r.entries.length===0&&e.jsx("div",{className:N.loading,children:t("common.loading","Loading...")}),!r.loading&&r.entries.length===0?e.jsx("div",{className:N.empty,children:t("changelog.empty","No changelog entries for the current place yet")}):e.jsx("div",{className:N.list,children:k.map(d=>e.jsx(Be,{entry:d,onClick:_=>A(d.entryId,_),buttonRef:_=>{d.entryId===y&&_&&($.current=_)}},d.entryId))}),w&&e.jsxs("div",{className:N.pagination,children:[e.jsx("button",{className:N.btn,disabled:r.offset===0,onClick:()=>r.setOffset(Math.max(0,r.offset-K)),children:t("tools.page.prev","Prev")}),e.jsxs("span",{className:N.pageInfo,children:[r.offset+1,"–",Math.min(r.offset+K,r.total)," / ",r.total]}),e.jsx("button",{className:N.btn,disabled:!r.hasMore,onClick:()=>r.setOffset(r.offset+K),children:t("tools.page.next","Next")})]}),v&&e.jsx(e.Fragment,{children:e.jsxs("div",{className:N.limitNotice,children:[e.jsxs("div",{className:N.limitNoticeContent,children:[e.jsx("div",{className:N.limitNoticeTitle,children:t("changelog.basic.limit.title","Basic preview shows the latest 3 sessions")}),e.jsx("div",{className:N.limitNoticeText,children:t("changelog.basic.limit.body","Full changelog timeline browsing is available with Pro.")})]}),e.jsx("a",{className:N.primaryAction,href:ae.changelog,target:"_blank",rel:"noreferrer",onClick:()=>i("dashboard_click_event",{click_target:"upgrade_cta",placement:"changelog_limit_notice",page:"changelog",tab:`changelog_${r.statusFilter}`}),children:t("tier.upgrade","View Pro")})]})}),e.jsx(ie,{open:E,title:t("changelog.clear.title","Clear changelog?"),message:t("changelog.clear.message","This permanently removes the stored changelog for the current place."),cancelLabel:t("common.cancel","Cancel"),confirmLabel:t("common.clear","Clear"),loading:z,onCancel:()=>!z&&f(!1),onConfirm:L}),y&&e.jsx(Rt,{entryId:y,placeId:u,onClose:R,returnFocusTo:$.current})]})}export{da as Component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._container_1h084_2{max-height:200px;overflow-y:auto;font-family:var(--font-code);font-size:12px;line-height:1.6;padding:8px 12px;background:var(--bg-secondary);border-radius:4px}._entry_1h084_14{display:flex;gap:8px;white-space:nowrap}._timestamp_1h084_21{color:var(--text-muted);flex-shrink:0}._message_1h084_27{color:var(--text-primary);overflow:hidden;text-overflow:ellipsis}._warn_1h084_34 ._message_1h084_27{color:var(--warning)}._error_1h084_39 ._message_1h084_27{color:var(--error)}._empty_1h084_44{color:var(--text-muted);font-style:italic;padding:8px 0}._page_cozq1_2{display:flex;flex-direction:column;gap:var(--space-page);width:100%;max-width:1180px}._card_cozq1_11{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:var(--card-padding-block) var(--card-padding-inline)}._topologyCard_cozq1_19{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:18px 20px 20px}._topologyDisconnected_cozq1_26{border-color:var(--error-border)}._topologyHeader_cozq1_30{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;margin-bottom:18px}._topologyIntro_cozq1_38{margin:-6px 0 0;color:var(--text-secondary);font-size:13px;line-height:1.5}._topologyNetwork_cozq1_45{position:relative}._topologyLinks_cozq1_49{position:absolute;top:0;right:0;bottom:0;left:0;z-index:0;width:100%;height:100%;pointer-events:none;overflow:visible}._topologyLink_cozq1_49{stroke:color-mix(in srgb,var(--accent) 62%,var(--border));stroke-linecap:round;stroke-width:1.5;opacity:.82}._topologyLink_agent_cozq1_66{stroke:color-mix(in srgb,var(--accent) 58%,var(--border))}._topologyLink_studio_cozq1_70{stroke:color-mix(in srgb,var(--accent) 66%,var(--border))}._topologyGrid_cozq1_74{position:relative;z-index:1;display:grid;grid-template-columns:minmax(220px,1fr) minmax(220px,.82fr) minmax(240px,1.18fr);align-items:start;gap:52px}._topologyColumn_cozq1_83{min-width:0;display:flex;flex-direction:column;gap:10px}._topologyColumnHeader_cozq1_90{display:flex;align-items:center;gap:8px;min-height:28px;color:var(--text-primary);font-family:var(--font-label);font-size:12px;font-weight:700}._topologyColumnHeaderSpacer_cozq1_101{min-height:28px}._topologyCount_cozq1_105{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:20px;padding:0 6px;border-radius:var(--radius-pill);background:var(--bg-secondary);border:1px solid var(--border);color:var(--text-secondary);font-family:var(--font-code);font-size:11px}._topologyList_cozq1_120{display:flex;flex-direction:column;gap:8px;justify-content:flex-start;min-height:178px}._topologyListCentered_cozq1_128{justify-content:center}._topologyNode_cozq1_132{min-width:0;border:1px solid var(--border);border-radius:8px;background:var(--bg-secondary);padding:10px 12px}._topologyNodeTitle_cozq1_140{display:flex;align-items:center;min-width:0;gap:8px;color:var(--text-primary);font-family:var(--font-label);font-size:13px;font-weight:600}._topologyNodeTitle_cozq1_140 strong,._topologyNodeTitle_cozq1_140 span{min-width:0}._topologyNodeMeta_cozq1_156,._topologyNodeSubtle_cozq1_157{margin-top:6px;color:var(--text-secondary);font-family:var(--font-code);font-size:11px;line-height:1.4;overflow-wrap:anywhere}._topologyNodeSubtle_cozq1_157{color:var(--text-muted)}._topologyState_cozq1_170{margin-left:auto;flex:0 0 auto;border:1px solid var(--border);border-radius:var(--radius-pill);padding:2px 7px;background:color-mix(in srgb,var(--bg-card) 76%,transparent);color:var(--text-secondary);font-family:var(--font-label);font-size:10px;font-weight:600}._topologyEmpty_cozq1_183{min-height:82px;display:flex;align-items:center;justify-content:center;border:1px dashed var(--border);border-radius:8px;color:var(--text-muted);background:color-mix(in srgb,var(--bg-secondary) 58%,transparent);padding:12px;text-align:center;font-size:12px;line-height:1.45}._topologyOverflow_cozq1_198{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:34px;padding:6px 8px 6px 12px;border:1px solid var(--border);border-radius:7px;background:color-mix(in srgb,var(--bg-card) 72%,transparent);color:var(--text-secondary);font-family:var(--font-label);font-size:12px}._topologyOverflowButton_cozq1_213{flex:0 0 auto;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--bg-secondary);color:var(--text-primary);cursor:pointer;font-family:var(--font-label);font-size:11px;font-weight:600;padding:4px 8px;transition:background var(--transition),border-color var(--transition),color var(--transition)}._topologyOverflowButton_cozq1_213:hover{border-color:var(--border-highlight);background:var(--accent-dim);color:var(--accent)}._topologyServerColumn_cozq1_236{min-width:0;display:flex;flex-direction:column;gap:10px}._topologyServer_cozq1_236{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;min-height:178px;border-color:color-mix(in srgb,var(--accent) 42%,var(--border));box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 16%,transparent)}._topologyServerIcon_cozq1_254{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border:1px solid var(--border-highlight);border-radius:50%;background:var(--accent-dim);color:var(--accent);margin-bottom:10px}._topologyServerBody_cozq1_267{display:flex;flex-direction:column;align-items:center;gap:8px;min-width:0;width:100%}._topologyServerTitle_cozq1_276{color:var(--text-primary);font-family:var(--font-label);font-size:15px;font-weight:700}._topologyServerMeta_cozq1_283{color:var(--text-secondary);font-family:var(--font-code);font-size:11px;overflow-wrap:anywhere}._routingSummaryCompact_cozq1_290{display:flex;justify-content:center;width:100%;min-width:0}._disabled_cozq1_298{opacity:.4;pointer-events:none}._cardHeader_cozq1_304{font-family:var(--font-label);font-weight:600;font-size:var(--type-card-title-size);text-transform:uppercase;letter-spacing:.05em;color:var(--text-primary);margin-bottom:var(--space-section);display:flex;align-items:center;justify-content:space-between}._cardHint_cozq1_317{margin:-4px 0 12px;color:var(--text-muted);font-size:12px;line-height:1.5}._clearButton_cozq1_324{border:1px solid var(--danger-border);background:var(--danger-bg);color:var(--danger-text);border-radius:var(--radius-control);padding:6px 12px;font-family:var(--font-label);font-size:12px;font-weight:600;cursor:pointer;transition:background var(--transition),border-color var(--transition),color var(--transition)}._clearButton_cozq1_324:hover{background:var(--danger-hover-bg);border-color:var(--danger)}._clearButton_cozq1_324:focus-visible{outline:none;box-shadow:var(--focus-ring)}._serverGrid_cozq1_348{display:grid;grid-template-columns:auto 1fr;gap:4px 16px;font-family:var(--font-code);font-size:13px}._serverGrid_cozq1_348 dt{color:var(--text-muted)}._serverGrid_cozq1_348 dd{color:var(--text-primary);margin:0}._statusRow_cozq1_366{display:flex;align-items:center;gap:16px;margin-bottom:12px}._metaItem_cozq1_373{font-family:var(--font-code);font-size:12px;color:var(--text-secondary)}._table_cozq1_380{width:100%;border-collapse:collapse;font-family:var(--font-code);font-size:12px}._table_cozq1_380 th{text-align:left;color:var(--text-muted);font-weight:400;padding:4px 8px 4px 0;border-bottom:1px solid var(--border)}._table_cozq1_380 td{padding:6px 8px 6px 0;color:var(--text-primary)}._tableWrap_cozq1_400{overflow-x:auto}._table_cozq1_380 tr:hover td{background:var(--accent-dim)}._routingSummary_cozq1_290{display:inline-flex;align-items:center;gap:10px;margin-bottom:12px;flex-wrap:wrap}._manageLink_cozq1_416{display:inline-flex;align-items:center;height:24px;padding:0 8px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-secondary);color:var(--text-primary);font-family:var(--font-label);font-size:11px;font-weight:600;text-decoration:none;transition:border-color var(--transition),background var(--transition),color var(--transition)}._manageLink_cozq1_416:hover{border-color:var(--border-highlight);background:var(--accent-dim);color:var(--accent);text-decoration:none}._segment_cozq1_442,._segmentActive_cozq1_443{height:28px;padding:0 10px;border:none;border-right:1px solid var(--border);background:transparent;color:var(--text-secondary);font-family:var(--font-label);font-size:12px;cursor:pointer}._segment_cozq1_442:last-child,._segmentActive_cozq1_443:last-child{border-right:none}._segment_cozq1_442:hover:not(:disabled){background:var(--accent-dim);color:var(--accent)}._segmentActive_cozq1_443{background:var(--accent-dim);color:var(--text-primary);font-weight:600}._segment_cozq1_442:disabled,._segmentActive_cozq1_443:disabled{cursor:default;opacity:.55}._targetPrimary_cozq1_477{white-space:nowrap}._monoMuted_cozq1_481{color:var(--text-secondary)}._copyIconButton_cozq1_485{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;margin-left:6px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-secondary);color:var(--text-secondary);cursor:pointer;vertical-align:middle;transition:border-color var(--transition),background var(--transition),color var(--transition)}._copyIconButton_cozq1_485:hover{color:var(--accent);border-color:var(--border-highlight);background:var(--accent-dim)}._routingBadge_cozq1_510{display:inline-flex;align-items:center;min-height:22px;padding:0 8px;border:1px solid var(--border-highlight);border-radius:var(--radius-control);background:var(--accent-dim);color:var(--text-primary);font-family:var(--font-label);font-size:11px;font-weight:600}._studioStateBadge_cozq1_524{display:inline-flex;align-items:center;min-height:22px;padding:0 8px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-secondary);color:var(--text-secondary);font-family:var(--font-label);font-size:11px;font-weight:600;white-space:nowrap}._studioState_running_cozq1_539{border-color:color-mix(in srgb,var(--success) 42%,var(--border));background:color-mix(in srgb,var(--success) 12%,var(--bg-secondary));color:var(--success)}._studioState_paused_cozq1_545{border-color:color-mix(in srgb,var(--warning) 42%,var(--border));background:color-mix(in srgb,var(--warning) 12%,var(--bg-secondary));color:var(--warning)}._studioState_edit_cozq1_551{border-color:var(--border-highlight);background:color-mix(in srgb,var(--accent) 9%,var(--bg-secondary));color:var(--text-primary)}._studioState_unknown_cozq1_557{border-color:var(--border);background:var(--bg-secondary);color:var(--text-muted)}._toggleBtn_cozq1_564{background:none;border:none;color:var(--text-secondary);cursor:pointer;font-size:12px;padding:0 4px;transition:color var(--transition)}._toggleBtn_cozq1_564:hover{color:var(--accent)}._disconnected_cozq1_579{text-align:center;padding:32px 16px}._disconnected_cozq1_579 h3{color:var(--error);font-size:16px;margin:0 0 8px}._disconnected_cozq1_579 p{color:var(--text-secondary);font-size:13px;margin:0 0 4px}._disconnectedActions_cozq1_596{display:flex;gap:8px;justify-content:center;margin-top:16px}._btn_cozq1_603{font-family:var(--font-label);font-size:12px;padding:6px 14px;border-radius:var(--radius-control);border:1px solid var(--border);background:var(--bg-secondary);color:var(--text-primary);cursor:pointer;transition:background var(--transition),border-color var(--transition)}._btn_cozq1_603:hover{border-color:var(--accent);background:var(--accent-dim)}._activity_active_cozq1_621,._activity_stale_cozq1_622,._activity_unknown_cozq1_623{display:inline-block;width:7px;height:7px;border-radius:50%;margin-right:6px;vertical-align:middle}._activity_active_cozq1_621{background:var(--success);box-shadow:0 0 4px var(--success)}._activity_stale_cozq1_622{background:var(--text-muted)}._activity_unknown_cozq1_623{background:var(--text-muted);opacity:.4}._killBtn_cozq1_647{font-family:var(--font-label);font-size:11px;padding:3px 10px;border-radius:var(--radius-control);border:1px solid var(--danger-border);background:var(--danger-bg);color:var(--danger-text);cursor:pointer;transition:background var(--transition),border-color var(--transition)}._killBtn_cozq1_647:hover{background:var(--danger-hover-bg);border-color:var(--danger);color:var(--danger-text)}._killBtn_cozq1_647:focus-visible{outline:none;box-shadow:var(--focus-ring)}._emptyRow_cozq1_671{color:var(--text-muted);font-style:italic}@media(max-width:980px){._topologyHeader_cozq1_30{flex-direction:column;align-items:stretch}._topologyGrid_cozq1_74{grid-template-columns:1fr;gap:10px}._topologyColumnHeaderSpacer_cozq1_101{display:none}._topologyServer_cozq1_236{min-height:150px}}@media(max-width:640px){._card_cozq1_11,._topologyCard_cozq1_19{padding:14px}._topologyNodeTitle_cozq1_140{flex-wrap:wrap}._topologyState_cozq1_170{margin-left:0}}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{f as so,u as eo,r as d,j as o,d as co,b as U,D as io,L as lo,M as ao,h as Y,a as ro,i as po,s as go}from"./index-CG4GxcAc.js";import{I as u}from"./InfoLabel-CAGC3efT.js";import{P as uo}from"./PageHeader-Dc41DgFB.js";import{S as to}from"./StatusBadge-Cdfb5vyE.js";import{T as X}from"./TooltipText-C0DmdntK.js";import{C as J}from"./ConfirmModal-Ddk0UX_P.js";import{f as no,u as ho}from"./useLiveUptime-yZ9iKJ1B.js";import{B as yo}from"./bot-BCKWpJd_.js";import{C as V}from"./copy-vqzBh0XB.js";import"./ConfirmModal.module-DJksQHBd.js";/**
|
|
2
|
-
* @license lucide-react v1.8.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const mo=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],xo=so("server",mo),_o="_container_1h084_2",So="_entry_1h084_14",jo="_timestamp_1h084_21",vo="_message_1h084_27",fo="_warn_1h084_34",bo="_error_1h084_39",Co="_empty_1h084_44",O={container:_o,entry:So,timestamp:jo,message:vo,warn:fo,error:bo,empty:Co};function No(e){const s=new Date(e);return Number.isNaN(s.getTime())?e:`${String(s.getHours()).padStart(2,"0")}:${String(s.getMinutes()).padStart(2,"0")}`}function wo({entries:e}){const{t:s}=eo(),n=d.useRef(null);return d.useEffect(()=>{const l=n.current;l&&(l.scrollTop=l.scrollHeight)},[e.length]),o.jsx("div",{ref:n,className:O.container,children:e.length===0?o.jsx("div",{className:O.empty,children:s("connection.log.empty","No events yet")}):e.map((l,c)=>o.jsxs("div",{className:`${O.entry} ${l.type?O[l.type]:""}`,children:[o.jsx("span",{className:O.timestamp,children:No(l.timestamp)}),o.jsx("span",{className:O.message,children:l.message})]},c))})}const Q=50;function ko(){const e=new Date;return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`}function Io(){const{level:e,status:s,error:n}=co(),[l,c]=d.useState(null),[y,p]=d.useState(null),[i,k]=d.useState([]),C=d.useRef(null),z=d.useCallback((g,j)=>{k(w=>{const S=[...w,{timestamp:ko(),message:g,type:j}];return S.length>Q?S.slice(-Q):S})},[]),m=d.useCallback(async()=>{try{const g=await U.get("/connection-info");c(g)}catch{c(null)}},[]),A=d.useCallback(async()=>{try{const g=await U.get("/api/dashboard/studio-routing");p(g)}catch{p(null)}},[]),I=d.useCallback(async g=>{const j=await U.patch("/api/dashboard/studio-routing",g);return p(j),await m(),j},[m]),B=d.useCallback(async()=>{try{const g=await U.get("/api/dashboard/connection-log");k(g.entries??[])}catch{k([])}},[]),E=d.useCallback(async()=>{await U.post("/api/dashboard/connection-log/clear"),k([])},[]),N=d.useCallback(async g=>{await U.post("/api/dashboard/kill-agent",{instanceId:g}),await m()},[m]);return d.useEffect(()=>{e!=="disconnected"&&s?(m(),A()):p(null),B()},[e,s,m,B,A]),d.useEffect(()=>{const g=new io;C.current=g,g.connect();const j=g.on("connection",S=>{const h=S;h.status!=="updated"&&h.clientId&&z(`Plugin ${h.status} — ${h.clientId}`,h.status==="disconnected"?"warn":"info"),m(),A()}),w=g.on("mcp_status",S=>{const h=S,F=h.status==="registered"?"registered":"unregistered";z(`MCP ${F} — ${h.aiClientName}`,h.status==="registered"?"info":"warn"),m(),A()});return()=>{j(),w(),g.disconnect(),C.current=null}},[z,m,A]),{status:s,connectionInfo:l,studioRouting:y,connectionLog:i,level:e,error:n,clearConnectionLog:E,killAgent:N,updateStudioRouting:I}}const Lo="_page_cozq1_2",zo="_card_cozq1_11",Ao="_topologyCard_cozq1_19",Po="_topologyDisconnected_cozq1_26",qo="_topologyHeader_cozq1_30",Bo="_topologyIntro_cozq1_38",$o="_topologyNetwork_cozq1_45",Mo="_topologyLinks_cozq1_49",Eo="_topologyLink_cozq1_49",To="_topologyLink_agent_cozq1_66",Do="_topologyLink_studio_cozq1_70",Ho="_topologyGrid_cozq1_74",Uo="_topologyColumn_cozq1_83",Oo="_topologyColumnHeader_cozq1_90",Fo="_topologyColumnHeaderSpacer_cozq1_101",Wo="_topologyCount_cozq1_105",Yo="_topologyList_cozq1_120",Go="_topologyListCentered_cozq1_128",Vo="_topologyNode_cozq1_132",Ro="_topologyNodeTitle_cozq1_140",Ko="_topologyNodeMeta_cozq1_156",Xo="_topologyNodeSubtle_cozq1_157",Jo="_topologyState_cozq1_170",Qo="_topologyEmpty_cozq1_183",Zo="_topologyOverflow_cozq1_198",oe="_topologyOverflowButton_cozq1_213",ee="_topologyServerColumn_cozq1_236",te="_topologyServer_cozq1_236",ne="_topologyServerIcon_cozq1_254",se="_topologyServerBody_cozq1_267",ce="_topologyServerTitle_cozq1_276",ie="_topologyServerMeta_cozq1_283",le="_routingSummaryCompact_cozq1_290",ae="_disabled_cozq1_298",re="_cardHeader_cozq1_304",de="_cardHint_cozq1_317",pe="_clearButton_cozq1_324",ge="_serverGrid_cozq1_348",ue="_statusRow_cozq1_366",he="_metaItem_cozq1_373",ye="_table_cozq1_380",me="_tableWrap_cozq1_400",xe="_routingSummary_cozq1_290",_e="_manageLink_cozq1_416",Se="_segment_cozq1_442",je="_segmentActive_cozq1_443",ve="_targetPrimary_cozq1_477",fe="_monoMuted_cozq1_481",be="_copyIconButton_cozq1_485",Ce="_routingBadge_cozq1_510",Ne="_studioStateBadge_cozq1_524",we="_studioState_running_cozq1_539",ke="_studioState_paused_cozq1_545",Ie="_studioState_edit_cozq1_551",Le="_studioState_unknown_cozq1_557",ze="_toggleBtn_cozq1_564",Ae="_disconnected_cozq1_579",Pe="_disconnectedActions_cozq1_596",qe="_btn_cozq1_603",Be="_activity_active_cozq1_621",$e="_activity_stale_cozq1_622",Me="_activity_unknown_cozq1_623",Ee="_killBtn_cozq1_647",Te="_emptyRow_cozq1_671",t={page:Lo,card:zo,topologyCard:Ao,topologyDisconnected:Po,topologyHeader:qo,topologyIntro:Bo,topologyNetwork:$o,topologyLinks:Mo,topologyLink:Eo,topologyLink_agent:To,topologyLink_studio:Do,topologyGrid:Ho,topologyColumn:Uo,topologyColumnHeader:Oo,topologyColumnHeaderSpacer:Fo,topologyCount:Wo,topologyList:Yo,topologyListCentered:Go,topologyNode:Vo,topologyNodeTitle:Ro,topologyNodeMeta:Ko,topologyNodeSubtle:Xo,topologyState:Jo,topologyEmpty:Qo,topologyOverflow:Zo,topologyOverflowButton:oe,topologyServerColumn:ee,topologyServer:te,topologyServerIcon:ne,topologyServerBody:se,topologyServerTitle:ce,topologyServerMeta:ie,routingSummaryCompact:le,disabled:ae,cardHeader:re,cardHint:de,clearButton:pe,serverGrid:ge,statusRow:ue,metaItem:he,table:ye,tableWrap:me,routingSummary:xe,manageLink:_e,segment:Se,segmentActive:je,targetPrimary:ve,monoMuted:fe,copyIconButton:be,routingBadge:Ce,studioStateBadge:Ne,studioState_running:we,studioState_paused:ke,studioState_edit:Ie,studioState_unknown:Le,toggleBtn:ze,disconnected:Ae,disconnectedActions:Pe,btn:qe,activity_active:Be,activity_stale:$e,activity_unknown:Me,killBtn:Ee,emptyRow:Te},G=5;function De(e){return e?Date.now()-e<3e4?"active":"stale":"unknown"}function He(e,s){return e==="active"?s("connection.topology.active","Active"):e==="stale"?s("connection.topology.stale","Stale"):s("connection.topology.unknown","Unknown")}function Z(e){return e.length>10?e.slice(0,10):e}function oo(e,s){return e.replace("{count}",String(s))}function Ue(e,s,n){const l=e.studioState??"unknown",c={edit:s("connection.targets.studioState.edit","Edit"),running:s("connection.targets.studioState.running","Running"),paused:s("connection.targets.studioState.paused","Paused"),unknown:s("connection.targets.studioState.unknown","Unknown")},y=e.studioStateSource==="thread"?s("connection.targets.studioState.source.thread","WEPPY play command"):e.studioStateSource==="pluginConnection"?s("connection.targets.studioState.source.pluginConnection","Studio Play/Test connection"):e.studioStateSource==="runService"?s("connection.targets.studioState.source.runService","Studio RunService"):s("connection.targets.studioState.source.unknown","Unknown source"),p=e.studioStateUpdatedAt?n(e.studioStateUpdatedAt):s("connection.targets.studioState.updatedUnknown","not reported");return{state:l,label:c[l],tooltip:`${y} · ${p}`}}function Oe(e,s){return e.length!==s.length?!1:e.every((n,l)=>{const c=s[l];return c!==void 0&&n.id===c.id&&n.side===c.side&&Math.abs(n.x1-c.x1)<.5&&Math.abs(n.y1-c.y1)<.5&&Math.abs(n.x2-c.x2)<.5&&Math.abs(n.y2-c.y2)<.5})}function b(e,s,n){return{x:s-e.left,y:n-e.top}}function Fe(e,s,n,l){if(s.right<=n.left){const p=b(l,s.right,s.top+s.height/2),i=b(l,n.left,n.top+n.height/2);return{id:e,side:"agent",x1:p.x,y1:p.y,x2:i.x,y2:i.y}}if(s.bottom<=n.top){const p=b(l,s.left+s.width/2,s.bottom),i=b(l,n.left+n.width/2,n.top);return{id:e,side:"agent",x1:p.x,y1:p.y,x2:i.x,y2:i.y}}const c=b(l,s.left+s.width/2,s.top),y=b(l,n.left+n.width/2,n.bottom);return{id:e,side:"agent",x1:c.x,y1:c.y,x2:y.x,y2:y.y}}function We(e,s,n,l){if(n.right<=s.left){const p=b(l,s.left,s.top+s.height/2),i=b(l,n.right,n.top+n.height/2);return{id:e,side:"studio",x1:p.x,y1:p.y,x2:i.x,y2:i.y}}if(n.bottom<=s.top){const p=b(l,s.left+s.width/2,s.top),i=b(l,n.left+n.width/2,n.bottom);return{id:e,side:"studio",x1:p.x,y1:p.y,x2:i.x,y2:i.y}}const c=b(l,s.left+s.width/2,s.bottom),y=b(l,n.left+n.width/2,n.top);return{id:e,side:"studio",x1:c.x,y1:c.y,x2:y.x,y2:y.y}}function Ye({agents:e,isDisconnected:s,pinnedTargetClientId:n,priorityTarget:l,status:c,studioRoutingMode:y,studioTargets:p,t:i,timeAgo:k,onCopySelector:C,onManageRouting:z}){const[m,A]=d.useState(!1),[I,B]=d.useState(!1),[E,N]=d.useState([]),g=d.useRef(null),j=d.useRef(null),w=d.useRef(new Map),S=d.useRef(new Map),h=y==="pinned"?i("connection.routing.pinned","Manual: Pinned Studio"):i("connection.routing.recentPriority","Automatic: Recent priority"),F=s?"offline":"online",f=d.useMemo(()=>m?e:e.slice(0,G),[e,m]),T=Math.max(0,e.length-f.length),v=d.useMemo(()=>I?p:p.slice(0,G),[p,I]),$=Math.max(0,p.length-v.length),R=[t.topologyList,f.length<=1?t.topologyListCentered:""].filter(Boolean).join(" "),K=[t.topologyList,v.length<=1?t.topologyListCentered:""].filter(Boolean).join(" "),D=d.useCallback(a=>x=>{if(x){w.current.set(a,x);return}w.current.delete(a)},[]),r=d.useCallback(a=>x=>{if(x){S.current.set(a,x);return}S.current.delete(a)},[]),L=d.useCallback(()=>{const a=g.current,x=j.current;if(!a||!x){N([]);return}const _=a.getBoundingClientRect(),P=x.getBoundingClientRect(),H=[];f.forEach(q=>{const W=w.current.get(q.instanceId);W&&H.push(Fe(`agent-${q.instanceId}`,W.getBoundingClientRect(),P,_))}),v.forEach(q=>{const W=S.current.get(q.clientId);W&&H.push(We(`studio-${q.clientId}`,W.getBoundingClientRect(),P,_))}),N(q=>Oe(q,H)?q:H)},[f,v]);return d.useLayoutEffect(()=>{L();const a=[g.current,j.current,...f.map(_=>w.current.get(_.instanceId)),...v.map(_=>S.current.get(_.clientId))].filter(_=>_!=null);if(window.addEventListener("resize",L),typeof ResizeObserver>"u")return()=>{window.removeEventListener("resize",L)};const x=new ResizeObserver(L);return a.forEach(_=>x.observe(_)),()=>{window.removeEventListener("resize",L),x.disconnect()}},[L,f,v]),o.jsxs("section",{className:`${t.topologyCard} ${s?t.topologyDisconnected:""}`,"aria-label":i("connection.topology.ariaLabel","Connection topology"),children:[o.jsxs("div",{className:t.topologyHeader,children:[o.jsxs("div",{children:[o.jsx("div",{className:t.cardHeader,children:i("connection.topology.title","Connection topology")}),o.jsx("p",{className:t.topologyIntro,children:i("connection.topology.description","Each AI agent connects through its own MCP Adapter to one shared WEPPY Bridge, which keeps Roblox Studio connected.")})]}),o.jsx(lo,{to:"/controls?section=studio-routing",className:t.manageLink,onClick:z,children:i("connection.routing.manage","Manage routing")})]}),o.jsxs("div",{className:t.topologyNetwork,ref:g,children:[o.jsx("svg",{"aria-hidden":"true",className:t.topologyLinks,"data-testid":"topology-connection-lines",focusable:"false",children:E.map(a=>o.jsx("line",{className:`${t.topologyLink} ${t[`topologyLink_${a.side}`]}`,"data-side":a.side,vectorEffect:"non-scaling-stroke",x1:a.x1,x2:a.x2,y1:a.y1,y2:a.y2},a.id))}),o.jsxs("div",{className:t.topologyGrid,children:[o.jsxs("div",{className:t.topologyColumn,children:[o.jsxs("div",{className:t.topologyColumnHeader,children:[o.jsx(yo,{size:15,"aria-hidden":"true"}),o.jsx("span",{children:i("connection.agents.title","AI Agents")}),o.jsx("span",{className:t.topologyCount,children:e.length})]}),o.jsxs("div",{className:R,children:[e.length>0?f.map(a=>{const x=De(a.lastSeen),_=a.aiClientName??Z(a.instanceId),P=a.lastSeen??a.lastCommandAt??a.connectedAt,H=a.mcpVersion?`${i("connection.topology.adapterRole","MCP Adapter")} v${a.mcpVersion}`:i("connection.topology.adapterRole","MCP Adapter");return o.jsxs("div",{className:t.topologyNode,ref:D(a.instanceId),children:[o.jsxs("div",{className:t.topologyNodeTitle,children:[o.jsx("span",{className:t[`activity_${x}`]}),o.jsx("strong",{children:_}),o.jsx("span",{className:t.topologyState,children:He(x,i)})]}),o.jsxs("div",{className:t.topologyNodeMeta,children:[o.jsx("span",{children:H})," ·"," ",i("connection.server.session","Session")," ",Z(a.instanceId)," ·"," ",P?`${i("connection.topology.lastActivity","Last activity")} ${k(P)}`:i("connection.topology.noActivity","No recent activity")]})]},a.instanceId)}):o.jsx("div",{className:t.topologyEmpty,children:i("connection.agents.none","No agents connected")}),e.length>G?o.jsxs("div",{className:t.topologyOverflow,children:[T>0?o.jsx("span",{children:oo(i("connection.topology.moreAgents","+{count} more agents"),T)}):o.jsx("span",{children:i("connection.topology.allAgentsVisible","All agents visible")}),o.jsx("button",{type:"button",className:t.topologyOverflowButton,"aria-label":m?i("connection.topology.showLessAgents","Show less AI agents"):i("connection.topology.showAllAgents","Show all AI agents"),onClick:()=>A(a=>!a),children:m?i("connection.topology.showLess","Show less"):i("connection.topology.showAll","Show all")})]}):null]})]}),o.jsxs("div",{className:t.topologyServerColumn,children:[o.jsx("div",{className:t.topologyColumnHeaderSpacer,"aria-hidden":"true"}),o.jsxs("div",{className:`${t.topologyNode} ${t.topologyServer}`,ref:j,children:[o.jsx("div",{className:t.topologyServerIcon,children:o.jsx(xo,{size:18,"aria-hidden":"true"})}),o.jsxs("div",{className:t.topologyServerBody,children:[o.jsx("div",{className:t.topologyServerTitle,children:i("connection.topology.serverTitle","WEPPY Bridge")}),o.jsx(to,{status:F}),o.jsxs("div",{className:t.topologyServerMeta,children:[c!=null&&c.version?`v${c.version}`:i("connection.topology.versionUnknown","Version unknown"),c!=null&&c.sessionId?` · ${i("connection.server.session","Session")} ${c.sessionId.slice(0,8)}`:""]}),(c==null?void 0:c.pid)!=null||(c==null?void 0:c.uptime)!=null?o.jsxs("div",{className:t.topologyNodeSubtle,children:[(c==null?void 0:c.pid)!=null?o.jsx("span",{children:`${i("connection.server.pid","PID")} ${c.pid}`}):null,(c==null?void 0:c.pid)!=null&&(c==null?void 0:c.uptime)!=null?" · ":"",(c==null?void 0:c.uptime)!=null?o.jsx("span",{children:`${i("connection.server.uptime","Uptime")} ${no(c.uptime)}`}):null]}):null,o.jsx("div",{className:t.routingSummaryCompact,children:o.jsx("span",{className:t.routingBadge,children:h})})]})]})]}),o.jsxs("div",{className:t.topologyColumn,children:[o.jsxs("div",{className:t.topologyColumnHeader,children:[o.jsx(ao,{size:15,"aria-hidden":"true"}),o.jsx("span",{children:i("connection.targets.title","Studio Targets")}),o.jsx("span",{className:t.topologyCount,children:p.length})]}),o.jsxs("div",{className:K,children:[p.length>0?v.map(a=>{const x=y==="pinned"&&n===a.clientId,_=y==="recentPriority"&&(l==null?void 0:l.clientId)===a.clientId,P=Ue(a,i,k);return o.jsxs("div",{className:t.topologyNode,ref:r(a.clientId),children:[o.jsxs("div",{className:t.topologyNodeTitle,children:[o.jsx("span",{className:t.targetPrimary,children:a.targetAlias}),o.jsx(Y,{text:i("connection.targets.copyTargetAlias","Copy Studio ID"),children:o.jsx("button",{type:"button",className:t.copyIconButton,"aria-label":i("connection.targets.copyTargetAlias","Copy Studio ID"),onClick:()=>C(a.targetAlias,"target_alias"),children:o.jsx(V,{size:13,"aria-hidden":"true"})})}),x?o.jsx("span",{className:t.routingBadge,children:i("connection.routing.pinnedBadge","Pinned")}):_?o.jsx("span",{className:t.routingBadge,children:i("connection.routing.priorityBadge","Priority")}):null,o.jsx(Y,{text:P.tooltip,children:o.jsx("span",{className:`${t.studioStateBadge} ${t[`studioState_${P.state}`]}`,children:P.label})})]}),o.jsxs("div",{className:t.topologyNodeMeta,children:[o.jsx("span",{children:a.placeName??i("connection.topology.placeUnknown","Place unknown")}),a.placeId!==void 0?` · ${a.placeId}`:""]}),o.jsxs("div",{className:t.topologyNodeSubtle,children:[a.connectionState," · ",i("connection.targets.lastSeen","Last Seen")," ",k(a.lastSeen)]})]},a.clientId)}):o.jsx("div",{className:t.topologyEmpty,children:i("connection.targets.none","No Studio targets connected. Open Roblox Studio and connect WEPPY Plugin.")}),p.length>G?o.jsxs("div",{className:t.topologyOverflow,children:[$>0?o.jsx("span",{children:oo(i("connection.topology.moreStudios","+{count} more studios"),$)}):o.jsx("span",{children:i("connection.topology.allStudiosVisible","All studios visible")}),o.jsx("button",{type:"button",className:t.topologyOverflowButton,"aria-label":I?i("connection.topology.showLessStudios","Show less Studio targets"):i("connection.topology.showAllStudios","Show all Studio targets"),onClick:()=>B(a=>!a),children:I?i("connection.topology.showLess","Show less"):i("connection.topology.showAll","Show all")})]}):null]})]})]})]})]})}function M(e,s){const n=Math.max(0,Math.floor((Date.now()-e)/1e3));return n<60?`${n}${s("connection.time.secondsAgo","s ago")}`:n<3600?`${Math.floor(n/60)}${s("connection.time.minutesAgo","m ago")}`:`${Math.floor(n/3600)}${s("connection.time.hoursAgo","h ago")}`}function Ge(e){return e?Date.now()-e<3e4?"active":"stale":"unknown"}function Ve(e,s){const n=e.studioState??"unknown",l={edit:s("connection.targets.studioState.edit","Edit"),running:s("connection.targets.studioState.running","Running"),paused:s("connection.targets.studioState.paused","Paused"),unknown:s("connection.targets.studioState.unknown","Unknown")},c=e.studioStateSource==="thread"?s("connection.targets.studioState.source.thread","WEPPY play command"):e.studioStateSource==="pluginConnection"?s("connection.targets.studioState.source.pluginConnection","Studio Play/Test connection"):e.studioStateSource==="runService"?s("connection.targets.studioState.source.runService","Studio RunService"):s("connection.targets.studioState.source.unknown","Unknown source"),y=e.studioStateUpdatedAt?M(e.studioStateUpdatedAt,s):s("connection.targets.studioState.updatedUnknown","not reported"),p=e.playtestMode&&e.playtestMode!=="unknown"?` · ${e.playtestMode}`:"";return{state:n,label:`${l[n]}${p}`,tooltip:`${c} · ${y}`}}function st(){const{t:e}=eo(),{trackEvent:s}=ro(),{status:n,connectionInfo:l,studioRouting:c,connectionLog:y,level:p,clearConnectionLog:i,killAgent:k}=Io(),{show:C}=po(),[z,m]=d.useState(!0),[A,I]=d.useState(!1),[B,E]=d.useState(!1),[N,g]=d.useState(null),[j,w]=d.useState(!1),S=ho(n==null?void 0:n.uptime),h=p==="disconnected",F=h?"offline":"online",f=(c==null?void 0:c.studioRoutingMode)??(n==null?void 0:n.studioRoutingMode)??"recentPriority",T=(c==null?void 0:c.pinnedTargetClientId)??(n==null?void 0:n.pinnedTargetClientId)??null,v=go((c==null?void 0:c.targets)??(n==null?void 0:n.pluginClients)??[],f,T),$=(c==null?void 0:c.priorityTarget)??v[0],R=async()=>{if(N){w(!0);try{await k(N.instanceId),C(e("connection.agents.killed","Agent killed"),"success"),g(null)}catch{C(e("connection.agents.killFailed","Failed to kill agent"),"error")}finally{w(!1)}}},K=async()=>{E(!0);try{await i(),C(e("toast.clearSuccess","Cleared successfully"),"success"),I(!1)}catch{C(e("toast.clearFailed","Failed to clear data"),"error")}finally{E(!1)}},D=async(r,L)=>{try{await navigator.clipboard.writeText(r),C(e("connection.targets.copied","Copied value"),"success"),s("dashboard_click_event",{click_target:`connection_copy_${L}`,page:"connection"})}catch{C(e("connection.targets.copyFailed","Failed to copy value"),"error")}};return o.jsxs("div",{className:t.page,children:[o.jsx(uo,{title:e("page.connection.title","Connection"),description:e("page.connection.description","Inspect WEPPY Bridge, MCP Adapter, Studio Plugin, and connection log status."),helpTopicId:"connection",helpState:{connectionLevel:p}}),o.jsx(Ye,{agents:(l==null?void 0:l.mcpInstances)??[],isDisconnected:h,pinnedTargetClientId:T,priorityTarget:$,status:n??null,studioRoutingMode:f,studioTargets:v,t:e,timeAgo:r=>M(r,e),onCopySelector:D,onManageRouting:()=>s("dashboard_click_event",{click_target:"connection_manage_routing",page:"connection"})}),o.jsxs("div",{className:t.card,children:[o.jsx("div",{className:t.cardHeader,children:e("connection.server.title","Bridge Status")}),h?o.jsxs("div",{className:t.disconnected,children:[o.jsx("h3",{children:e("level.l0.title")}),o.jsx("p",{children:e("level.l0.message")}),o.jsx("p",{children:e("common.reconnecting")}),o.jsxs("div",{className:t.disconnectedActions,children:[o.jsx("button",{className:t.btn,onClick:()=>window.location.reload(),children:e("connection.reconnect","Reconnect")}),o.jsx("button",{className:t.btn,onClick:()=>{window.location.hash="#/settings"},children:e("connection.checkSettings","Check Settings")})]})]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:t.statusRow,children:o.jsx(to,{status:F})}),o.jsxs("dl",{className:t.serverGrid,children:[(n==null?void 0:n.version)&&o.jsxs(o.Fragment,{children:[o.jsx("dt",{children:o.jsx(u,{label:e("connection.server.version","Version"),tooltip:e("connection.server.version.tooltip","WEPPY Bridge runtime version")})}),o.jsx("dd",{children:o.jsx(X,{text:e("connection.server.version.tooltip","WEPPY Bridge runtime version"),children:`v${n.version}`})})]}),(n==null?void 0:n.pid)!=null&&o.jsxs(o.Fragment,{children:[o.jsx("dt",{children:o.jsx(u,{label:e("connection.server.pid","PID"),tooltip:e("connection.server.pid.tooltip","Operating system process identifier")})}),o.jsx("dd",{children:n.pid})]}),(n==null?void 0:n.uptime)!=null&&o.jsxs(o.Fragment,{children:[o.jsx("dt",{children:o.jsx(u,{label:e("connection.server.uptime","Uptime"),tooltip:e("connection.server.uptime.tooltip","Time elapsed since the WEPPY Bridge started")})}),o.jsx("dd",{children:no(S??n.uptime)})]}),(n==null?void 0:n.sessionId)&&o.jsxs(o.Fragment,{children:[o.jsx("dt",{children:o.jsx(u,{label:e("connection.server.session","Session"),tooltip:e("connection.server.session.tooltip","Current WEPPY Bridge session identifier")})}),o.jsx("dd",{children:n.sessionId.slice(0,8)})]}),(l==null?void 0:l.serverExecutable)&&o.jsxs(o.Fragment,{children:[o.jsx("dt",{children:o.jsx(u,{label:e("connection.server.exec","Exec"),tooltip:e("connection.server.exec.tooltip","Executable path used to launch the WEPPY Bridge")})}),o.jsx("dd",{children:l.serverExecutable})]})]})]})]}),o.jsxs("div",{className:`${t.card} ${h?t.disabled:""}`,children:[o.jsxs("div",{className:t.cardHeader,children:[o.jsxs("span",{children:[e("connection.agents.title","AI Agents")," ","(",(l==null?void 0:l.mcpInstanceCount)??0,")"]}),o.jsx("button",{className:t.toggleBtn,onClick:()=>m(r=>!r),"aria-label":z?e("common.collapse","Collapse"):e("common.expand","Expand"),children:z?"▾":"▸"})]}),z&&o.jsxs("table",{className:t.table,children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:e("connection.agents.name","Agent")}),o.jsx("th",{children:o.jsx(u,{label:e("connection.agents.version","Version"),tooltip:e("connection.agents.version.tooltip","MCP Adapter package version for this agent session")})}),o.jsx("th",{children:o.jsx(u,{label:e("connection.server.pid","PID"),tooltip:e("connection.server.pid.tooltip","Operating system process identifier")})}),o.jsx("th",{children:o.jsx(u,{label:e("connection.agents.projectRoot","Project Root"),tooltip:e("connection.agents.projectRoot.tooltip","Authoritative project root for sync ownership")})}),o.jsx("th",{children:e("connection.agents.connected","Connected")}),o.jsx("th",{children:o.jsx(u,{label:e("connection.agents.lastSeen","Last Seen"),tooltip:e("connection.agents.lastSeen.tooltip","Most recent heartbeat or activity from this agent")})}),o.jsx("th",{children:o.jsx(u,{label:e("connection.agents.lastCommand","Last Command"),tooltip:e("connection.agents.lastCommand.tooltip","Most recent tool call executed by this agent")})}),o.jsx("th",{})]})}),o.jsx("tbody",{children:l!=null&&l.mcpInstances&&l.mcpInstances.length>0?l.mcpInstances.map(r=>o.jsxs("tr",{children:[o.jsxs("td",{children:[o.jsx("span",{className:t[`activity_${Ge(r.lastSeen)}`]}),r.aiClientName??e("connection.agents.unknown","Unknown")]}),o.jsx("td",{children:r.mcpVersion??"-"}),o.jsx("td",{children:r.pid}),o.jsx("td",{children:r.projectRoot??r.cwd??e("connection.agents.projectRoot.unresolved","Unresolved")}),o.jsx("td",{children:M(r.connectedAt,e)}),o.jsx("td",{children:r.lastSeen?M(r.lastSeen,e):"-"}),o.jsx("td",{children:r.lastCommandAt?M(r.lastCommandAt,e):"-"}),o.jsx("td",{children:!r.isServer&&o.jsx("button",{className:t.killBtn,onClick:()=>{s("dashboard_click_event",{click_target:"connection_kill_agent",page:"connection"}),g({instanceId:r.instanceId,name:r.aiClientName??r.instanceId.slice(0,8)})},children:e("connection.agents.kill","Kill")})})]},r.instanceId)):o.jsx("tr",{children:o.jsx("td",{colSpan:8,className:t.emptyRow,children:e("connection.agents.none","No agents connected")})})})]})]}),o.jsxs("div",{className:`${t.card} ${h?t.disabled:""}`,children:[o.jsxs("div",{className:t.cardHeader,children:[e("connection.targets.title","Studio Targets")," ","(",v.length,")"]}),o.jsx("p",{className:t.cardHint,children:e("connection.targets.help","When multiple Studio windows are connected, tell the agent to use Studio ID studio-1 to choose one.")}),o.jsx("div",{className:t.tableWrap,children:o.jsxs("table",{className:t.table,children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:o.jsx(u,{label:e("connection.targets.target","Studio ID"),tooltip:e("connection.targets.target.tooltip","Short name for this Roblox Studio window")})}),o.jsx("th",{children:e("connection.targets.place","Place")}),o.jsx("th",{children:o.jsx(u,{label:e("connection.targets.placeId","Place ID"),tooltip:e("connection.targets.placeId.tooltip","Roblox Place ID for this Studio window")})}),o.jsx("th",{children:o.jsx(u,{label:e("connection.targets.clientId","Connection ID"),tooltip:e("connection.targets.clientId.tooltip","Full connection ID for diagnostics. Usually use Studio ID instead.")})}),o.jsx("th",{children:o.jsx(u,{label:e("connection.targets.studioState","Studio State"),tooltip:e("connection.targets.studioState.tooltip","Current edit/play runtime state reported by this Studio window")})}),o.jsx("th",{children:o.jsx(u,{label:e("connection.targets.session","Session"),tooltip:e("connection.targets.session.tooltip","Command channel state for this Studio target")})}),o.jsx("th",{children:o.jsx(u,{label:e("connection.targets.lastUsed","Last Used"),tooltip:e("connection.targets.lastUsed.tooltip","Most recent plugin-route request routed to this Studio target")})}),o.jsx("th",{children:o.jsx(u,{label:e("connection.targets.lastSeen","Last Seen"),tooltip:e("connection.targets.lastSeen.tooltip","Most recent heartbeat received from this Studio target")})}),o.jsx("th",{children:o.jsx(u,{label:e("connection.targets.version","Version"),tooltip:e("connection.targets.version.tooltip","Installed plugin version reported by Studio")})}),o.jsx("th",{children:o.jsx(u,{label:e("connection.targets.routing","Routing"),tooltip:e("connection.targets.routing.tooltip","Routing priority for requests without a named Studio target")})}),o.jsx("th",{children:o.jsx(u,{label:e("connection.targets.inFlight","In Flight"),tooltip:e("connection.targets.inFlight.tooltip","Active command request currently routed to this Studio target")})})]})}),o.jsx("tbody",{children:v.length>0?v.map(r=>{const L=r.clientId.slice(0,10),a=Ve(r,e);return o.jsxs("tr",{children:[o.jsxs("td",{children:[o.jsx("span",{className:t.monoMuted,title:r.clientId,children:r.targetAlias}),o.jsx(Y,{text:e("connection.targets.copyTargetAlias","Copy Studio ID"),children:o.jsx("button",{type:"button",className:t.copyIconButton,"aria-label":e("connection.targets.copyTargetAlias","Copy Studio ID"),onClick:()=>D(r.targetAlias,"target_alias"),children:o.jsx(V,{size:13,"aria-hidden":"true"})})})]}),o.jsx("td",{children:o.jsx("span",{className:t.targetPrimary,children:r.placeName??"-"})}),o.jsxs("td",{children:[r.placeId??"-",r.placeId!==void 0?o.jsx(Y,{text:e("connection.targets.copyPlaceId","Copy Place ID"),children:o.jsx("button",{type:"button",className:t.copyIconButton,"aria-label":e("connection.targets.copyPlaceId","Copy Place ID"),onClick:()=>D(String(r.placeId),"place_id"),children:o.jsx(V,{size:13,"aria-hidden":"true"})})}):null]}),o.jsxs("td",{children:[o.jsx("span",{className:t.monoMuted,title:r.clientId,children:L}),o.jsx(Y,{text:e("connection.targets.copyClientId","Copy Connection ID"),children:o.jsx("button",{type:"button",className:t.copyIconButton,"aria-label":e("connection.targets.copyClientId","Copy Connection ID"),onClick:()=>D(r.clientId,"client_id"),children:o.jsx(V,{size:13,"aria-hidden":"true"})})})]}),o.jsx("td",{children:o.jsx(X,{text:a.tooltip,children:o.jsx("span",{className:`${t.studioStateBadge} ${t[`studioState_${a.state}`]}`,children:a.label})})}),o.jsx("td",{children:r.connectionState}),o.jsx("td",{children:r.lastRoutedAt?M(r.lastRoutedAt,e):"-"}),o.jsx("td",{children:M(r.lastSeen,e)}),o.jsx("td",{children:r.pluginVersion??"-"}),o.jsx("td",{children:f==="pinned"&&T===r.clientId?o.jsx("span",{className:t.routingBadge,children:e("connection.routing.pinnedBadge","Pinned")}):f==="recentPriority"&&($==null?void 0:$.clientId)===r.clientId?o.jsx("span",{className:t.routingBadge,children:e("connection.routing.priorityBadge","Priority")}):o.jsx("span",{className:t.monoMuted,children:"-"})}),o.jsx("td",{children:r.inFlightRequestId?r.inFlightRequestId.slice(0,8):"-"})]},r.clientId)}):o.jsx("tr",{children:o.jsx("td",{colSpan:11,className:t.emptyRow,children:e("connection.targets.none","No Studio targets connected. Open Roblox Studio and connect WEPPY Plugin.")})})})]})})]}),o.jsxs("div",{className:`${t.card} ${h?t.disabled:""}`,children:[o.jsxs("div",{className:t.cardHeader,children:[o.jsx("span",{children:e("connection.log.title","Connection Log")}),o.jsx("button",{className:t.clearButton,onClick:()=>{s("dashboard_click_event",{click_target:"connection_clear_log",page:"connection"}),I(!0)},children:e("common.clear","Clear")})]}),o.jsx(wo,{entries:y})]}),o.jsx(J,{open:A,title:e("connection.clear.title","Clear connection log?"),message:e("connection.clear.message","This permanently removes the stored connection log for the current project."),cancelLabel:e("common.cancel","Cancel"),confirmLabel:e("common.clear","Clear"),loading:B,onCancel:()=>!B&&I(!1),onConfirm:K}),o.jsx(J,{open:!!N,title:e("connection.agents.kill.title","Kill agent?"),message:`"${N==null?void 0:N.name}" 프로세스를 강제 종료합니다. 해당 에이전트의 진행 중인 작업이 중단됩니다.`,cancelLabel:e("common.cancel","Cancel"),confirmLabel:e("connection.agents.kill","Kill"),loading:j,onCancel:()=>!j&&g(null),onConfirm:R})]})}export{st as Component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as C,r as d,j as a,z as D,g as O,t as V,o as W,p as w,q as k}from"./index-CG4GxcAc.js";import{B as y}from"./PageHeader-Dc41DgFB.js";import{P as Y,a as z}from"./PlaceSelectOptions-Gd2pK9DL.js";const G="_scope_1i8qy_1",H="_main_1i8qy_13",Q="_label_1i8qy_22",J="_selectorLabel_1i8qy_30",X="_placeSelect_1i8qy_38",Z="_name_1i8qy_54",m="_id_1i8qy_65",ee="_scopeBadge_1i8qy_72",le="_copy_1i8qy_76",ce="_note_1i8qy_88",ae="_folderDetails_1i8qy_92",ne="_shortcuts_1i8qy_96",te="_shortcutsTrigger_1i8qy_103",se="_shortcutLink_1i8qy_126",oe="_shortcutsPopover_1i8qy_131",o={scope:G,main:H,label:Q,selectorLabel:J,placeSelect:X,name:Z,id:m,scopeBadge:ee,copy:le,note:ce,folderDetails:ae,shortcuts:ne,shortcutsTrigger:te,shortcutLink:se,shortcutsPopover:oe};function B(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0}function u(e,l){return W(e.places,l)}function T(e){var l;return e.lastActivePlaceId!==null?e.lastActivePlaceId:((l=e.places[0])==null?void 0:l.placeId)??null}function A(e){var l;if(e.pluginConnected&&e.activePlaceId!==null){const c=e.places.filter(n=>n.placeId===e.activePlaceId);if(u(e,e.activePlaceId)||c.length===0)return e.activePlaceId}if(e.lastActivePlaceId!==null){const c=e.places.filter(n=>n.placeId===e.lastActivePlaceId);if(u(e,e.lastActivePlaceId)||c.length===0)return e.lastActivePlaceId}return((l=V(e.places))==null?void 0:l.placeId)??null}function re(e,l,c){var n;return l?((n=u(e,typeof c=="number"?c:null))==null?void 0:n.placeId)??A(e):e.pluginConnected&&e.activePlaceId!==null?e.activePlaceId:T(e)}function R(e,l){const c=u(e,l);return(c==null?void 0:c.universeId)!==void 0?c.universeId:l===e.activePlaceId?e.activeUniverseId??null:l===e.lastActivePlaceId?e.lastActiveUniverseId??null:null}function ie(e,l,c){if(!B(e))return[];const n=[];return B(l)&&n.push({label:c("placeScope.shortcuts.settings","Place settings"),href:`https://create.roblox.com/dashboard/creations/experiences/${l}/places/${e}/configure`},{label:c("placeScope.shortcuts.experience","Experience management"),href:`https://create.roblox.com/dashboard/creations/experiences/${l}/overview`}),n.push({label:c("placeScope.shortcuts.roblox","View on Roblox"),href:`https://www.roblox.com/games/${e}`}),n}function pe(e,l){if(e.pluginConnected&&e.activePlaceId!==null){const t=u(e,e.activePlaceId),s=t?w(e.places,t.placeId):!1,i=l("placeScope.folder.unresolvedPlace","Place {placeId}").replace("{placeId}",String(e.activePlaceId));return{label:l("placeScope.current.label","Current Place"),placeId:e.activePlaceId,placeName:e.activePlaceName??(s?i:t==null?void 0:t.placeName)??l("placeScope.unknownPlace","Unknown place"),badge:l("placeScope.connected","Studio connected"),connected:(t==null?void 0:t.isConnected)??!0,folderUnresolved:s,hasSyncMetadata:t?k(e.places,t):void 0,note:null}}const c=T(e),n=u(e,c);if(c!==null){const t=c===e.lastActivePlaceId?e.lastActivePlaceName:null,s=n?w(e.places,n.placeId):!1,i=l("placeScope.folder.unresolvedPlace","Place {placeId}").replace("{placeId}",String(c));return{label:l("placeScope.lastActive.label","Last Active Place"),placeId:c,placeName:t??(s?i:n==null?void 0:n.placeName)??l("placeScope.unknownPlace","Unknown place"),badge:l("placeScope.stored","Stored data"),connected:!1,folderUnresolved:s,hasSyncMetadata:n?k(e.places,n):void 0,note:l("placeScope.stored.note","No connected Studio currently has this place open.")}}return{label:l("placeScope.noPlace.label","Place scope"),placeId:null,placeName:l("placeScope.noPlace.value","No place data available yet"),badge:l("placeScope.noPlace.badge","No place"),connected:!1,folderUnresolved:!1,hasSyncMetadata:void 0,note:l("placeScope.noPlace.note","Connect WEPPY Plugin and sync a place to create place-scoped data.")}}function de(e,l,c){const n=typeof l=="number"?u(e,l):null,t=A(e),s=(n==null?void 0:n.placeId)??t,i=u(e,s);if(s===null)return{label:c("placeScope.noPlace.label","Place scope"),placeId:null,placeName:c("placeScope.noPlace.value","No place data available yet"),badge:c("placeScope.noPlace.badge","No place"),connected:!1,folderUnresolved:!1,hasSyncMetadata:void 0,note:c("placeScope.noPlace.note","Connect WEPPY Plugin and sync a place to create place-scoped data.")};const S=(i==null?void 0:i.isConnected)??!1,g=e.activePlaceId===s,v=s===e.lastActivePlaceId?e.lastActivePlaceName:null,h=g?e.activePlaceName:null,P=i?w(e.places,i.placeId):!1,N=c("placeScope.folder.unresolvedPlace","Place {placeId}").replace("{placeId}",String(s));return{label:g?c("placeScope.current.label","Current Place"):c("placeScope.selected.label","Selected Place"),placeId:s,placeName:h??v??(P?N:i==null?void 0:i.placeName)??c("placeScope.unknownPlace","Unknown place"),badge:S?c("placeScope.connected","Studio connected"):c("placeScope.stored","Stored data"),connected:S,folderUnresolved:P,hasSyncMetadata:i?k(e.places,i):void 0,note:S?null:c("placeScope.stored.note","No connected Studio currently has this place open.")}}function ue(e,l){switch(e){case"sync":return l("placeScope.surface.sync","Sync status and logs use this place.");case"changelog":return l("placeScope.surface.changelog","Changelog sessions use this place.");case"playtest":return l("placeScope.surface.playtest","Playtest reports use this place.");case"uiStudio":return l("placeScope.surface.uiStudio","UI captures and change history use this place.");case"tools":return l("placeScope.surface.tools","Tool history and statistics use this place.")}}function Se({surface:e,selectable:l=!1,selectedPlaceId:c=null,onSelectedPlaceIdChange:n}){const{t}=C(),[s,i]=d.useState(null),[S,g]=d.useState(!0),[v,h]=d.useState(null),P=d.useRef(null),N=d.useRef(null),q=d.useId();d.useEffect(()=>{let r=!1;async function f(){try{const x=await O();r||i(x)}catch{r||i(null)}finally{r||g(!1)}}return f(),()=>{r=!0}},[]),d.useEffect(()=>{if(!l||!s)return;const r=A(s);(typeof c!="number"||!u(s,c))&&c!==r&&(n==null||n(r))},[n,l,c,s]);const L=s?re(s,l,c):null,M=s?R(s,L):null,_=`${L??"none"}:${M??"none"}`;if(d.useEffect(()=>{h(r=>r===_?r:null)},[_]),d.useEffect(()=>{function r(){h(null)}function f(I){var b;v!==null&&!((b=P.current)!=null&&b.contains(I.target))&&r()}function x(I){var b;v!==null&&I.key==="Escape"&&(I.preventDefault(),r(),(b=N.current)==null||b.focus())}return document.addEventListener("pointerdown",f),document.addEventListener("keydown",x),()=>{document.removeEventListener("pointerdown",f),document.removeEventListener("keydown",x)}},[v]),S)return a.jsx("div",{className:o.scope,"aria-live":"polite",children:a.jsx("span",{className:o.label,children:t("placeScope.loading","Loading place scope...")})});if(!s)return a.jsx("div",{className:o.scope,"aria-live":"polite",children:a.jsx("span",{className:o.label,children:t("placeScope.unavailable","Place scope unavailable")})});const p=l?de(s,c,t):pe(s,t),$=typeof p.placeId=="number"?String(p.placeId):"",F=l&&s.places.length>0,K=R(s,p.placeId),U=ie(p.placeId,K,t),E=_,j=v===E;return a.jsxs("div",{className:o.scope,"aria-live":"polite",children:[a.jsxs("div",{className:o.main,children:[F?a.jsxs(a.Fragment,{children:[a.jsxs("label",{className:o.selectorLabel,children:[a.jsx("span",{className:o.label,children:t("placeScope.selector.label","Place data")}),a.jsxs("select",{className:o.placeSelect,value:$,onChange:r=>{const f=Number.parseInt(r.currentTarget.value,10);h(null),n==null||n(Number.isInteger(f)?f:null)},children:[p.placeId===null?a.jsx("option",{value:"",disabled:!0,children:t("placeScope.selector.noneSelectable","No selectable Place folder")}):null,a.jsx(Y,{places:s.places,t})]})]}),a.jsx("span",{className:o.label,children:p.label}),a.jsx("span",{className:o.name,children:p.placeName})]}):a.jsxs(a.Fragment,{children:[a.jsx("span",{className:o.label,children:p.label}),a.jsx("span",{className:o.name,children:p.placeName})]}),p.placeId!==null?a.jsx("span",{className:o.id,children:p.placeId}):null,a.jsx(y,{variant:p.connected?"success":"neutral",shape:"pill",className:o.scopeBadge,children:p.badge}),p.folderUnresolved?a.jsx(y,{variant:"neutral",shape:"pill",className:o.scopeBadge,children:t("placeScope.folder.unresolved","Representative folder unconfirmed")}):null,p.hasSyncMetadata===!1?a.jsx(y,{variant:"neutral",shape:"pill",className:o.scopeBadge,children:t("placeScope.folder.noSyncHistory","No sync history")}):null]}),a.jsxs("div",{className:o.copy,children:[a.jsx("span",{children:ue(e,t)}),p.note?a.jsx("span",{className:o.note,children:p.note}):null]}),s.places.some(r=>D(r)==="duplicate"||D(r)==="unresolved")?a.jsx("div",{className:o.folderDetails,children:a.jsx(z,{places:s.places,t})}):null,U.length>0?a.jsxs("div",{className:o.shortcuts,ref:P,children:[a.jsxs("button",{ref:N,type:"button",className:o.shortcutsTrigger,"aria-controls":q,"aria-expanded":j,onClick:()=>{h(j?null:E)},children:[t("placeScope.shortcuts.trigger","Quick links"),a.jsx("span",{"aria-hidden":"true",children:"↗"})]}),j?a.jsx("div",{id:q,className:o.shortcutsPopover,role:"group","aria-label":t("placeScope.shortcuts.label","Place shortcuts"),children:U.map(r=>a.jsxs("a",{className:o.shortcutLink,href:r.href,target:"_blank",rel:"noopener noreferrer",children:[a.jsx("span",{children:r.label}),a.jsx("span",{"aria-hidden":"true",children:"↗"})]},r.href))}):null]}):null]})}export{Se as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r,h as e}from"./index-CG4GxcAc.js";function s({label:t,tooltip:o}){return r.jsx(e,{text:o,children:t})}export{s as I};
|