@weppy/roblox-mcp 2.17.3 → 2.17.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +2 -2
  3. package/dashboard/dist/assets/{AiPromptExamples-DniGyTTn.js → AiPromptExamples-B3LZ06_M.js} +1 -1
  4. package/dashboard/dist/assets/AssetsPage-DBMNmn9Z.js +61 -0
  5. package/dashboard/dist/assets/ChangelogPage-D_G_HjiK.js +1 -0
  6. package/dashboard/dist/assets/{ConfirmModal-Dp7bIaIr.js → ConfirmModal-CL0Z5xwJ.js} +1 -1
  7. package/dashboard/dist/assets/{ConnectionPage-C9BrvjSI.js → ConnectionPage-DaYME7QT.js} +1 -1
  8. package/dashboard/dist/assets/{ControlsPage-Cz7l6oLO.js → ControlsPage-gnKyi48F.js} +1 -1
  9. package/dashboard/dist/assets/CurrentPlaceScope-CHRh7s-z.js +1 -0
  10. package/dashboard/dist/assets/{GameChangeDetail-COMtVAQK.js → GameChangeDetail-CbYXbvWl.js} +1 -1
  11. package/dashboard/dist/assets/{InfoLabel-Duu_xBC8.js → InfoLabel-BaayM8hW.js} +1 -1
  12. package/dashboard/dist/assets/{OverviewPage-Bw6nCN_K.js → OverviewPage-DuPB7VBe.js} +1 -1
  13. package/dashboard/dist/assets/{PageHeader-DCh0GrcW.js → PageHeader-C1A4pFFD.js} +2 -2
  14. package/dashboard/dist/assets/PlaceSelectOptions-DU7Ka-gE.js +1 -0
  15. package/dashboard/dist/assets/PlaytestAiPromptExamples-Bf494cNk.js +1 -0
  16. package/dashboard/dist/assets/PlaytestPage-BkuJr8Va.css +1 -0
  17. package/dashboard/dist/assets/PlaytestPage-JPS-_xPE.js +127 -0
  18. package/dashboard/dist/assets/{SettingsPage-DOx4zPQB.js → SettingsPage-Om-hGqIQ.js} +1 -1
  19. package/dashboard/dist/assets/{StatusBadge-DB7SzHxU.js → StatusBadge-CiHSf_o_.js} +1 -1
  20. package/dashboard/dist/assets/SyncPage-BTADHgCn.js +1 -0
  21. package/dashboard/dist/assets/{Tabs-8coaSlFl.js → Tabs-C0QQfjUl.js} +1 -1
  22. package/dashboard/dist/assets/{TierPromoPanel-C6AtGEJN.js → TierPromoPanel-DI3EP06A.js} +1 -1
  23. package/dashboard/dist/assets/ToolsPage-CCsd60Kh.js +1 -0
  24. package/dashboard/dist/assets/{TooltipText-B2gmJunf.js → TooltipText-INE_h7BS.js} +1 -1
  25. package/dashboard/dist/assets/{UiStudioPage-CNWTVJ4w.js → UiStudioPage-TfbhZvt5.js} +2 -2
  26. package/dashboard/dist/assets/{WhatsNewPage-CX_N1RVO.js → WhatsNewPage-BPKMcfVs.js} +1 -1
  27. package/dashboard/dist/assets/{bot-DRBnM_Dv.js → bot-TMxhORyF.js} +1 -1
  28. package/dashboard/dist/assets/{check-DFGDcGQp.js → check-C5Uo2cs_.js} +1 -1
  29. package/dashboard/dist/assets/{copy-DGkh5PJA.js → copy-BENnfclm.js} +1 -1
  30. package/dashboard/dist/assets/{index-UFZ5peom.js → index-ZP3F-qh6.js} +66 -258
  31. package/dashboard/dist/assets/{sample-requests-CcJyTFj5.js → sample-requests-DVllzgEu.js} +1 -1
  32. package/dashboard/dist/assets/{trash-2-OtWthCQY.js → trash-2-C7bZq3Km.js} +1 -1
  33. package/dashboard/dist/assets/{useLiveUptime-hS0F15wX.js → useLiveUptime-CBpmama-.js} +1 -1
  34. package/dashboard/dist/assets/{useSettings-B6gBfQjz.js → useSettings-Ug_fLuUn.js} +1 -1
  35. package/dashboard/dist/index.html +1 -1
  36. package/dist/index.js +147 -147
  37. package/package.json +2 -2
  38. package/roblox-plugin/WeppyRobloxMCP.rbxm +0 -0
  39. package/dashboard/dist/assets/AssetsPage--90xGzmZ.js +0 -61
  40. package/dashboard/dist/assets/ChangelogPage-Bg9Kg_qZ.js +0 -1
  41. package/dashboard/dist/assets/CurrentPlaceScope-BjpoPQlM.js +0 -1
  42. package/dashboard/dist/assets/PlaytestAiPromptExamples-Cv4yOTd0.js +0 -1
  43. package/dashboard/dist/assets/PlaytestPage-C3Vjgtlg.css +0 -1
  44. package/dashboard/dist/assets/PlaytestPage-DM7NkrhI.js +0 -127
  45. package/dashboard/dist/assets/SyncPage-Bgb0V6Yy.js +0 -1
  46. package/dashboard/dist/assets/ToolsPage-DkCD8pPL.js +0 -1
package/CHANGELOG.md CHANGED
@@ -49,6 +49,14 @@ All notable changes to this project will be documented in this file.
49
49
 
50
50
 
51
51
 
52
+
53
+
54
+ ## [2.17.4] - 2026-09-16
55
+
56
+ ### Features
57
+
58
+ - **Run repeatable game actions during Playtest** — Test Values profiles can now store actions that increase numeric values, defeat a selected player or monster, or call reviewed Test Adapter operations such as granting experience and rewards. Each action validates its inputs, reports its result in the Dashboard, and avoids repeating the same request. Deaths, rewards, saved game data, and external requests are not restored by Reset all, so use test data and a test environment when an action can create lasting effects.
59
+ - **Start Playtest with clearer guidance** — Empty Test Values views now explain how to prepare both values and actions, including a copyable AI request for creating an experience-grant action. The Dashboard also separates connected Studio places from places with stored data, presents Playtest apply settings as switches, and uses clearer detail controls.
52
60
 
53
61
  ## [2.17.3] - 2026-09-15
54
62
 
package/README.md CHANGED
@@ -98,7 +98,7 @@ On Windows Antigravity, CLI installation has been verified to expose skills and
98
98
  |:-----------:|:--------------:|:------:|:---------:|:----------:|:-----------------------------:|
99
99
  | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
100
100
 
101
- **Requirements:** Node.js 18+, Roblox Studio, Windows 10+ or macOS 12+
101
+ **Requirements:** Node.js 22+, Roblox Studio, Windows 10+ or macOS 12+
102
102
 
103
103
  ## What It Does
104
104
 
@@ -292,6 +292,6 @@ Use of the Weppy name and logos is governed by [TRADEMARKS.md](TRADEMARKS.md).
292
292
 
293
293
  ---
294
294
 
295
- [![npm version](https://img.shields.io/npm/v/@weppy/roblox-mcp)](https://www.npmjs.com/package/@weppy/roblox-mcp) [![Node.js](https://img.shields.io/badge/node-%3E%3D18-brightgreen)](https://nodejs.org/) [![Smithery](https://smithery.ai/badge/@hope1026/weppy-roblox-mcp)](https://smithery.ai/server/@hope1026/weppy-roblox-mcp)
295
+ [![npm version](https://img.shields.io/npm/v/@weppy/roblox-mcp)](https://www.npmjs.com/package/@weppy/roblox-mcp) [![Node.js](https://img.shields.io/badge/node-%3E%3D22-brightgreen)](https://nodejs.org/) [![Smithery](https://smithery.ai/badge/@hope1026/weppy-roblox-mcp)](https://smithery.ai/server/@hope1026/weppy-roblox-mcp)
296
296
 
297
297
  [GitHub Issues](https://github.com/hope1026/weppy-roblox-mcp/issues) · [npm](https://www.npmjs.com/package/@weppy/roblox-mcp)
@@ -1 +1 @@
1
- import{r as i,j as t}from"./index-UFZ5peom.js";import{C as d}from"./copy-DGkh5PJA.js";const _="_examples_1sykl_1",m="_example_1sykl_1",h="_request_1sykl_15",j="_nextStep_1sykl_16",b="_actionRow_1sykl_40",f="_copyButton_1sykl_47",k="_success_1sykl_79",w="_error_1sykl_80",c={examples:_,example:m,request:h,nextStep:j,actionRow:b,copyButton:f,success:k,error:w};function N(s){const[p,a]=i.useState({}),n=i.useRef(0),x=s.examples.map(e=>e.id).join("|");i.useEffect(()=>(n.current+=1,a({}),()=>{n.current+=1}),[x,s.resetKey]);const y=async(e,r)=>{var u;const l=++n.current;a(o=>({...o,[e]:"copying"}));try{if(!((u=navigator.clipboard)!=null&&u.writeText))throw new Error("clipboard_unavailable");if(await navigator.clipboard.writeText(r),l!==n.current)return;a(o=>({...o,[e]:"copied"}))}catch{if(l!==n.current)return;a(o=>({...o,[e]:"error"}))}};return t.jsxs("div",{className:c.examples,children:[s.examples.map(e=>{const r=p[e.id]??"idle";return t.jsxs("section",{className:c.example,children:[t.jsx("h4",{children:e.title}),t.jsx("p",{className:c.request,children:e.request}),t.jsxs("div",{className:c.actionRow,children:[t.jsxs("button",{type:"button",className:c.copyButton,disabled:r==="copying",onClick:()=>void y(e.id,e.request),children:[t.jsx(d,{size:14,"aria-hidden":"true"}),r==="copying"?s.labels.copying:s.labels.copy]}),r==="copied"&&t.jsx("span",{className:c.success,role:"status",children:s.labels.copied})]}),r==="error"&&t.jsx("p",{className:c.error,role:"alert",children:s.labels.copyFailed})]},e.id)}),s.nextStep&&t.jsx("p",{className:c.nextStep,children:s.nextStep})]})}export{N as A};
1
+ import{r as i,j as t}from"./index-ZP3F-qh6.js";import{C as d}from"./copy-BENnfclm.js";const _="_examples_1sykl_1",m="_example_1sykl_1",h="_request_1sykl_15",j="_nextStep_1sykl_16",b="_actionRow_1sykl_40",f="_copyButton_1sykl_47",k="_success_1sykl_79",w="_error_1sykl_80",c={examples:_,example:m,request:h,nextStep:j,actionRow:b,copyButton:f,success:k,error:w};function N(s){const[p,a]=i.useState({}),n=i.useRef(0),x=s.examples.map(e=>e.id).join("|");i.useEffect(()=>(n.current+=1,a({}),()=>{n.current+=1}),[x,s.resetKey]);const y=async(e,r)=>{var u;const l=++n.current;a(o=>({...o,[e]:"copying"}));try{if(!((u=navigator.clipboard)!=null&&u.writeText))throw new Error("clipboard_unavailable");if(await navigator.clipboard.writeText(r),l!==n.current)return;a(o=>({...o,[e]:"copied"}))}catch{if(l!==n.current)return;a(o=>({...o,[e]:"error"}))}};return t.jsxs("div",{className:c.examples,children:[s.examples.map(e=>{const r=p[e.id]??"idle";return t.jsxs("section",{className:c.example,children:[t.jsx("h4",{children:e.title}),t.jsx("p",{className:c.request,children:e.request}),t.jsxs("div",{className:c.actionRow,children:[t.jsxs("button",{type:"button",className:c.copyButton,disabled:r==="copying",onClick:()=>void y(e.id,e.request),children:[t.jsx(d,{size:14,"aria-hidden":"true"}),r==="copying"?s.labels.copying:s.labels.copy]}),r==="copied"&&t.jsx("span",{className:c.success,role:"status",children:s.labels.copied})]}),r==="error"&&t.jsx("p",{className:c.error,role:"alert",children:s.labels.copyFailed})]},e.id)}),s.nextStep&&t.jsx("p",{className:c.nextStep,children:s.nextStep})]})}export{N as A};
@@ -0,0 +1,61 @@
1
+ import{f as re,b as O,l as Ne,u as pe,j as s,P as Ns,I as As,r as c,F as Ps,m as Is,R as ms,X as Ke,E as ws,n as hs,g as Rs,a as $s,e as Ls}from"./index-ZP3F-qh6.js";import{C as gs}from"./ConfirmModal-CL0Z5xwJ.js";import{B as _e,C as Ts,D as qe,b as Bs,P as Us}from"./PageHeader-C1A4pFFD.js";import{P as Es}from"./PlaceSelectOptions-DU7Ka-gE.js";import{T as Z}from"./TooltipText-INE_h7BS.js";import{A as Gs}from"./AiPromptExamples-B3LZ06_M.js";import{B as Ds}from"./bot-TMxhORyF.js";import{T as Ms}from"./trash-2-C7bZq3Km.js";import{C as xs}from"./copy-BENnfclm.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 Fs=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Os=re("arrow-left",Fs);/**
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 Hs=[["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"}]],zs=re("audio-lines",Hs);/**
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 Ks=[["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"}]],Ws=re("badge",Ks);/**
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 Vs=[["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"}]],Ys=re("box",Vs);/**
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 qs=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],De=re("chevron-right",qs);/**
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 Xs=[["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"}]],Js=re("clapperboard",Xs);/**
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 Zs=[["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"}]],Qs=re("film",Zs);/**
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 et=[["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"}]],st=re("folder-input",et);/**
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 tt=[["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"}]],at=re("grid-2x2",tt);/**
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 nt=[["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"}]],rt=re("list",nt);/**
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 ot=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],lt=re("search",ot);/**
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 it=[["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"}]],ct=re("upload",it);function fs(e){if(e.scope==="place"&&typeof e.placeId=="number")return{placeId:String(e.placeId)}}function oe(e){const t=fs(e);return t?`?placeId=${encodeURIComponent(t.placeId)}`:""}function Pe(e){return`/api/assets/${encodeURIComponent(e.scope)}/${encodeURIComponent(e.category)}`}function me(e,t){return`${Pe(e)}/${encodeURIComponent(t)}`}async function dt(e){return O.get(Pe(e),fs(e))}async function ut(e){return O.post(`${Pe(e)}/rescan${oe(e)}`,{})}async function pt(e,t,r){return(await O.patch(`${me(e,t)}${oe(e)}`,r)).asset}async function mt(e,t){return O.delete(`${me(e,t)}${oe(e)}`)}async function ht(e,t,r){return(await O.post(`${me(e,t)}/upload${oe(e)}`,r)).asset}async function Xe(e,t){return(await O.post(`${me(e,t)}/status-refresh${oe(e)}`,{})).asset}async function gt(e,t,r){const n={...e,placeId:r??e.placeId};return O.post(`${me(e,t)}/usage-scan${oe(n)}`,{})}async function xt(e,t){return O.post(`${Pe(e)}/export-selection-rbxm${oe(e)}`,t)}async function ft(e,t,r){return O.post(`${me(e,t)}/import-rbxm${oe(e)}`,r)}async function bt(e,t){return(await O.post(`${me(e,t)}/thumbnail-generate${oe(e)}`,{})).asset}function bs(e){return e.fileUrl?`${Ne}${e.fileUrl}`:`${Ne}/api/assets/${e.scope.kind}/${e.category}/${encodeURIComponent(e.id)}/file${oe({scope:e.scope.kind,placeId:e.scope.kind==="place"?e.scope.placeId:void 0})}`}function He(e){return e.previewUrl?`${Ne}${e.previewUrl}`:`${Ne}/api/assets/${e.scope.kind}/${e.category}/${encodeURIComponent(e.id)}/preview${oe({scope:e.scope.kind,placeId:e.scope.kind==="place"?e.scope.placeId:void 0})}`}const ys=["all","image","decal","rbxm"],yt=new Set(ys),Je=["model","animation"];function Se(e){return/\.(rbxm|rbxmx)$/i.test(e.file.original)}function jt(e){return yt.has(e)}function ze(e,t){return e==="all"?t("assets.category.all","All"):t(`assets.category.${e}`,e==="rbxm"?"RBXM":e)}function de(e,t){return ze(Se(e)?"rbxm":e.category,t)}function vt(e){return e==="all"?["image","decal",...Je]:e==="rbxm"?Je:[e]}function Ct(e,t){return t==="all"?e.category==="image"||e.category==="decal"||Se(e):t==="rbxm"?Se(e):(t==="model"||t==="animation")&&Se(e)?!1:e.category===t}function _t(e){return[...e].sort((t,r)=>r.createdAt.localeCompare(t.createdAt)||r.id.localeCompare(t.id))}function Ie(e){return e?e.split("/").filter(Boolean):[]}function We(e,t){return t.every((r,n)=>e[n]===r)}function js(e,t){return t.createdAt.localeCompare(e.createdAt)||t.id.localeCompare(e.id)}function te(e){const t=e.scope.kind==="place"?e.scope.placeId:"-";return`${e.scope.kind}:${t}:${e.category}:${e.id}`}function Ve(e){return Ie(e.folderPath)}function St(e,t){const r=Ie(t),n=new Map;for(const o of e){const b=Ve(o);if(b.length<=r.length||!We(b,r))continue;const f=b[r.length],x=[...r,f].join("/"),p=n.get(x);p?p.descendantCount+=1:n.set(x,{name:f,path:x,descendantCount:1})}return[...n.values()].sort((o,b)=>o.name.localeCompare(b.name))}function kt(e,t){const r=Ie(t);return e.filter(n=>{const o=Ve(n);return o.length===r.length&&We(o,r)}).sort(js)}function Nt(e){return[...e].sort(js)}function At(e,t){const r=Ie(t);for(;r.length>0;){if(e.some(o=>{const b=Ve(o);return b.length>=r.length&&We(b,r)}))return r.join("/");r.pop()}return""}const Pt="_page_7mrkg_1",It="_experimentalBadge_7mrkg_9",wt="_toolbarShell_7mrkg_23",Rt="_toolbar_7mrkg_23",$t="_segmented_7mrkg_41",Lt="_placeContextSlot_7mrkg_45",Tt="_listContextSummary_7mrkg_50",Bt="_toolbarActions_7mrkg_54",Ut="_categoryControl_7mrkg_59",Et="_contextDivider_7mrkg_84",Gt="_categoryControlLabel_7mrkg_88",Dt="_categoryRail_7mrkg_94",Mt="_categoryButton_7mrkg_102",Ft="_categoryButtonActive_7mrkg_131",Ot="_copyRow_7mrkg_144",Ht="_buttonRow_7mrkg_145",zt="_segmentedActive_7mrkg_187",Kt="_placeSelectorLabel_7mrkg_192",Wt="_placeSelect_7mrkg_192",Vt="_sharedPlaceContext_7mrkg_218",Yt="_commandButton_7mrkg_244",qt="_primaryButton_7mrkg_245",Xt="_iconButton_7mrkg_246",Jt="_dangerButton_7mrkg_286",Zt="_iconButtonActive_7mrkg_307",Qt="_grid_7mrkg_320",ea="_folderGrid_7mrkg_328",sa="_explorer_7mrkg_337",ta="_explorerToolbar_7mrkg_344",aa="_explorerLocation_7mrkg_354",na="_breadcrumb_7mrkg_380",ra="_breadcrumbSegment_7mrkg_381",oa="_viewOptions_7mrkg_424",la="_organizationModeControl_7mrkg_432",ia="_viewModeControl_7mrkg_433",ca="_gridSizeControl_7mrkg_434",da="_explorerSection_7mrkg_487",ua="_folderTile_7mrkg_510",pa="_folderListRow_7mrkg_535",ma="_assetListRow_7mrkg_536",ha="_assetCard_7mrkg_537",ga="_folderIcon_7mrkg_542",xa="_folderName_7mrkg_554",fa="_folderCount_7mrkg_566",ba="_assetList_7mrkg_536",ya="_folderList_7mrkg_535",ja="_assetListHeader_7mrkg_580",va="_listPreviewWrap_7mrkg_617",Ca="_listPreview_7mrkg_617",_a="_listPreviewFallback_7mrkg_619",Sa="_listAssetName_7mrkg_648",ka="_listAssetCategory_7mrkg_660",Na="_listAssetScope_7mrkg_661",Aa="_listAssetUpdated_7mrkg_662",Pa="_folderType_7mrkg_663",Ia="_folderScope_7mrkg_664",wa="_folderStatus_7mrkg_665",Ra="_folderUpdated_7mrkg_666",$a="_assetCardSelected_7mrkg_695",La="_thumbnailWrap_7mrkg_700",Ta="_thumbnail_7mrkg_700",Ba="_thumbnailFallback_7mrkg_716",Ua="_assetCardBody_7mrkg_727",Ea="_assetName_7mrkg_734",Ga="_assetMeta_7mrkg_742",Da="_statusChip_7mrkg_749",Ma="_categoryPill_7mrkg_750",Fa="_assetId_7mrkg_755",Oa="_scopeText_7mrkg_756",Ha="_muted_7mrkg_757",za="_emptyState_7mrkg_762",Ka="_notice_7mrkg_763",Wa="_errorState_7mrkg_764",Va="_messageState_7mrkg_765",Ya="_emptyGuide_7mrkg_789",qa="_emptyGuideHeader_7mrkg_799",Xa="_emptyGuideMethod_7mrkg_800",Ja="_emptyGuideSteps_7mrkg_822",Za="_emptyGuideMethods_7mrkg_828",Qa="_emptyGuideMethodTitle_7mrkg_842",en="_emptyGuideTierNote_7mrkg_860",sn="_emptyGuideMethodHelp_7mrkg_865",tn="_emptyGuideCapabilityDescription_7mrkg_866",an="_emptyGuideChoices_7mrkg_872",nn="_emptyGuideChoice_7mrkg_872",rn="_emptyGuideChoiceSelected_7mrkg_900",on="_emptyGuideChoiceLabel_7mrkg_910",ln="_emptyGuideCapability_7mrkg_866",cn="_emptyGuideAction_7mrkg_926",dn="_proNotice_7mrkg_956",un="_rbxmGuide_7mrkg_974",pn="_settingsInlinePanel_7mrkg_1014",mn="_settingsDrawer_7mrkg_1034",hn="_detailPopupLayer_7mrkg_1050",gn="_detailDialog_7mrkg_1066",xn="_detailDialogHeader_7mrkg_1083",fn="_detailTitleBlock_7mrkg_1094",bn="_detailEyebrow_7mrkg_1116",yn="_detailHeaderActions_7mrkg_1125",jn="_detailDialogBody_7mrkg_1133",vn="_detailPreviewPane_7mrkg_1142",Cn="_detailPreview_7mrkg_1142",_n="_detailPreviewFallback_7mrkg_1154",Sn="_detailContentPane_7mrkg_1190",kn="_formStack_7mrkg_1196",Nn="_drawerHeader_7mrkg_1200",An="_detailSection_7mrkg_1251",Pn="_noticeList_7mrkg_1252",In="_settingsPanel_7mrkg_1253",wn="_setupNotice_7mrkg_1270",Rn="_field_7mrkg_1295",$n="_fieldLabelRow_7mrkg_1303",Ln="_fieldHelp_7mrkg_1327",Tn="_twoColumn_7mrkg_1332",Bn="_technicalDetails_7mrkg_1343",Un="_detailGrid_7mrkg_1360",En="_metadataList_7mrkg_1361",Gn="_compactMeta_7mrkg_1372",Dn="_copyableValue_7mrkg_1399",Mn="_inlineCopyButton_7mrkg_1410",Fn="_hashText_7mrkg_1431",On="_usageList_7mrkg_1435",Hn="_usageItem_7mrkg_1441",zn="_metadataItem_7mrkg_1442",Kn="_settingsSubsection_7mrkg_1490",Wn="_settingsSectionHeader_7mrkg_1495",Vn="_settingsDefinitionList_7mrkg_1508",Yn="_toggleRow_7mrkg_1530",qn="_inlineHelp_7mrkg_1544",a={page:Pt,experimentalBadge:It,toolbarShell:wt,toolbar:Rt,segmented:$t,placeContextSlot:Lt,listContextSummary:Tt,toolbarActions:Bt,categoryControl:Ut,contextDivider:Et,categoryControlLabel:Gt,categoryRail:Dt,categoryButton:Mt,categoryButtonActive:Ft,copyRow:Ot,buttonRow:Ht,segmentedActive:zt,placeSelectorLabel:Kt,placeSelect:Wt,sharedPlaceContext:Vt,commandButton:Yt,primaryButton:qt,iconButton:Xt,dangerButton:Jt,iconButtonActive:Zt,grid:Qt,folderGrid:ea,explorer:sa,explorerToolbar:ta,explorerLocation:aa,breadcrumb:na,breadcrumbSegment:ra,viewOptions:oa,organizationModeControl:la,viewModeControl:ia,gridSizeControl:ca,explorerSection:da,folderTile:ua,folderListRow:pa,assetListRow:ma,assetCard:ha,folderIcon:ga,folderName:xa,folderCount:fa,assetList:ba,folderList:ya,assetListHeader:ja,listPreviewWrap:va,listPreview:Ca,listPreviewFallback:_a,listAssetName:Sa,listAssetCategory:ka,listAssetScope:Na,listAssetUpdated:Aa,folderType:Pa,folderScope:Ia,folderStatus:wa,folderUpdated:Ra,assetCardSelected:$a,thumbnailWrap:La,thumbnail:Ta,thumbnailFallback:Ba,assetCardBody:Ua,assetName:Ea,assetMeta:Ga,statusChip:Da,categoryPill:Ma,assetId:Fa,scopeText:Oa,muted:Ha,emptyState:za,notice:Ka,errorState:Wa,messageState:Va,emptyGuide:Ya,emptyGuideHeader:qa,emptyGuideMethod:Xa,emptyGuideSteps:Ja,emptyGuideMethods:Za,emptyGuideMethodTitle:Qa,emptyGuideTierNote:en,emptyGuideMethodHelp:sn,emptyGuideCapabilityDescription:tn,emptyGuideChoices:an,emptyGuideChoice:nn,emptyGuideChoiceSelected:rn,emptyGuideChoiceLabel:on,emptyGuideCapability:ln,emptyGuideAction:cn,proNotice:dn,rbxmGuide:un,settingsInlinePanel:pn,settingsDrawer:mn,detailPopupLayer:hn,detailDialog:gn,detailDialogHeader:xn,detailTitleBlock:fn,detailEyebrow:bn,detailHeaderActions:yn,detailDialogBody:jn,detailPreviewPane:vn,detailPreview:Cn,detailPreviewFallback:_n,detailContentPane:Sn,formStack:kn,drawerHeader:Nn,detailSection:An,noticeList:Pn,settingsPanel:In,setupNotice:wn,field:Rn,fieldLabelRow:$n,fieldHelp:Ln,twoColumn:Tn,technicalDetails:Bn,detailGrid:Un,metadataList:En,compactMeta:Gn,copyableValue:Dn,inlineCopyButton:Mn,hashText:Fn,usageList:On,usageItem:Hn,metadataItem:zn,settingsSubsection:Kn,settingsSectionHeader:Wn,settingsDefinitionList:Vn,toggleRow:Yn,inlineHelp:qn},Xn={image:As,decal:Ws,audio:zs,mesh:Ys,model:Ns,video:Qs,animation:Js};function Ae(e,t){return t(`assets.status.${e}`,e)}function Ze(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 Qe(e){return e.category==="image"||e.category==="decal"||!!e.file.preview}function Jn(e){return e.category==="decal"?e.roblox.creatorAssetId??e.roblox.assetId:e.roblox.assetId}function vs(e,t){var f;const r=((f=e.rbxm)==null?void 0:f.studioUploads)??[];if(r.length===0)return null;const n=r.filter(x=>x.status==="uploaded").length,o=r.filter(x=>x.status==="failed").length,b=[n>0?`${n} ${t("assets.detail.rbxmStudioUploadsUploaded","uploaded")}`:null,o>0?`${o} ${t("assets.detail.rbxmStudioUploadsFailed","failed")}`:null].filter(Boolean);return`${t("assets.detail.rbxmStudioUploadsLabel","Studio uploads")}: ${b.join(", ")}`}function Zn({assets:e,selectedAssetId:t,selectedAssetKey:r=null,viewMode:n="grid",gridSize:o="medium",onSelect:b}){const{t:f}=pe();return e.length===0?s.jsxs("div",{className:a.emptyState,children:[s.jsx("p",{children:f("assets.empty.title","No assets yet")}),s.jsx("span",{children:f("assets.empty.body","Choose a scope and category, then rescan that inbox folder.")})]}):s.jsx("div",{className:n==="list"?a.assetList:a.grid,"data-view-mode":n,"data-grid-size":o,children:e.map(x=>{const p=Xn[x.category],$=Jn(x),V=vs(x,f),B=te(x),R=r?r===B:t===x.id,l=x.scope.kind==="shared"?f("assets.scope.shared","Shared"):f("assets.scope.place","Current Place");return n==="list"?s.jsxs("button",{type:"button",className:[a.assetListRow,R?a.assetCardSelected:""].filter(Boolean).join(" "),onClick:()=>b(B),children:[s.jsx("span",{className:a.listPreviewWrap,children:Qe(x)?s.jsx("img",{className:a.listPreview,src:He(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:de(x,f)}),s.jsx("span",{className:a.listAssetScope,children:l}),s.jsx(_e,{variant:Ze(x.status),className:a.statusChip,children:Ae(x.status,f)}),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:()=>b(B),children:[s.jsx("span",{className:a.thumbnailWrap,children:Qe(x)?s.jsx("img",{className:a.thumbnail,src:He(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(_e,{variant:"neutral",className:a.categoryPill,children:de(x,f)}),s.jsx(_e,{variant:Ze(x.status),className:a.statusChip,children:Ae(x.status,f)})]}),s.jsxs("span",{className:a.assetMeta,children:[s.jsx("span",{className:a.scopeText,children:l}),s.jsx("span",{className:a.assetId,children:$?`#${$}`:V??f("assets.status.localOnly","Local only")})]})]})]},B)})})}function es(e){return{scope:e==="all"?null:e,folderPath:""}}function Me(e,t,r){return t==="shared"?e.scope.kind==="shared":e.scope.kind==="place"&&(r===null||e.scope.placeId===r)}function Qn(e,t){var r;return t?e.folderPath===t||((r=e.folderPath)==null?void 0:r.startsWith(`${t}/`))===!0:!0}function er({displayScope:e,assets:t,place:r,categoryFilter:n,organizationMode:o,viewMode:b,gridSize:f,selectedAssetKey:x,onSelectAsset:p,onClearSelection:$,onOrganizationModeChange:V,onViewModeChange:B,onGridSizeChange:R,emptyContent:l}){const{t:y}=pe(),[N,T]=c.useState(()=>es(e)),Y=c.useRef(`${e}:${r.placeId??"-"}`),q=c.useRef(!1),z=c.useRef(null),D=m=>m==="shared"?y("assets.scope.shared","Shared"):r.placeName??y("assets.scope.place","Current Place"),U=m=>{q.current=!0,T(m),$()};c.useEffect(()=>{const m=`${e}:${r.placeId??"-"}`;Y.current!==m&&(Y.current=m,q.current=!0,T(es(e)),$())},[e,$,r.placeId]),c.useEffect(()=>{var m;q.current&&(q.current=!1,(m=z.current)==null||m.focus())},[N]);const K=c.useMemo(()=>N.scope===null?[]:t.filter(m=>Me(m,N.scope,r.placeId)),[t,N.scope,r.placeId]);c.useEffect(()=>{if(N.scope===null)return;const m=At(K,N.folderPath);m!==N.folderPath&&(q.current=!0,T(A=>({...A,folderPath:m})),$())},[n,N.folderPath,N.scope,$,K]);const M=c.useMemo(()=>o==="folders"?St(K,N.folderPath):[],[N.folderPath,o,K]),J=c.useMemo(()=>e==="all"?t:t.filter(m=>Me(m,e,r.placeId)),[t,e,r.placeId]),P=c.useMemo(()=>o==="all-assets"?Nt(J):kt(K,N.folderPath),[J,N.folderPath,o,K]);c.useEffect(()=>{x&&(P.some(m=>te(m)===x)||$())},[$,x,P]);const w=N.folderPath?N.folderPath.split("/"):[],E=o==="all-assets"?y("assets.organization.all","All assets"):w[w.length-1]??(N.scope?D(N.scope):y("assets.scope.all","All scopes")),j=N.scope===null?t.length:K.filter(m=>Qn(m,N.folderPath)).length,g=Math.max(0,j-P.length),i=o==="all-assets"?y("assets.organization.summary","{count} assets").replace("{count}",String(P.length)):y("assets.explorer.summary","{direct} in this folder · {descendant} in subfolders").replace("{direct}",String(P.length)).replace("{descendant}",String(g)),I=m=>m===1?y("assets.folder.count.one","1 asset"):y("assets.folder.count.many","{count} assets").replace("{count}",String(m)),Q=(m,A,h,F,v)=>s.jsxs("button",{type:"button",className:b==="list"?a.folderListRow:a.folderTile,"aria-label":`${A}, ${I(h)}`,onClick:v,children:[s.jsx("span",{className:a.folderIcon,"aria-hidden":"true",children:s.jsx(Ps,{size:b==="list"?22:28})}),s.jsx("span",{className:a.folderName,children:A}),b==="list"?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:a.folderType,children:y("assets.folder.type","Folder")}),s.jsx("span",{className:a.folderScope,children:D(F)}),s.jsx("span",{className:a.folderStatus,children:I(h)}),s.jsx("span",{className:a.folderUpdated,children:"—"})]}):s.jsx("span",{className:a.folderCount,children:I(h)})]},m),W=o==="folders"&&e==="all"&&N.scope===null?[{scope:"place",name:D("place")},{scope:"shared",name:D("shared")}].map(({scope:m,name:A})=>({scope:m,name:A,count:t.filter(h=>Me(h,m,r.placeId)).length})):[];return s.jsxs("section",{className:a.explorer,"aria-label":y("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":y("assets.breadcrumb.label","Asset path"),children:[o==="all-assets"?s.jsxs(s.Fragment,{children:[s.jsx("span",{children:e==="all"?y("assets.scope.all","All scopes"):D(e)}),s.jsx(De,{size:14,"aria-hidden":"true"}),s.jsx("span",{"aria-current":"page",children:y("assets.organization.all","All assets")})]}):e==="all"?N.scope===null?s.jsx("span",{"aria-current":"page",children:y("assets.scope.all","All scopes")}):s.jsx("button",{type:"button",onClick:()=>U({scope:null,folderPath:""}),children:y("assets.scope.all","All scopes")}):null,o==="folders"&&N.scope?s.jsxs(s.Fragment,{children:[e==="all"?s.jsx(De,{size:14,"aria-hidden":"true"}):null,w.length>0?s.jsx("button",{type:"button",onClick:()=>U({scope:N.scope,folderPath:""}),children:D(N.scope)}):s.jsx("span",{"aria-current":"page",children:D(N.scope)})]}):null,o==="folders"&&w.map((m,A)=>{const h=w.slice(0,A+1).join("/"),F=A===w.length-1;return s.jsxs("span",{className:a.breadcrumbSegment,children:[s.jsx(De,{size:14,"aria-hidden":"true"}),F?s.jsx("span",{"aria-current":"page",children:m}):s.jsx("button",{type:"button",onClick:()=>U({scope:N.scope,folderPath:h}),children:m})]},h)})]}),s.jsx("h2",{ref:z,tabIndex:-1,children:E}),s.jsx("p",{children:i})]}),s.jsxs("div",{className:a.viewOptions,"aria-label":y("assets.view.options","View options"),children:[s.jsxs("div",{className:a.organizationModeControl,role:"group","aria-label":y("assets.organization.label","Browse"),children:[s.jsx("button",{type:"button","aria-pressed":o==="folders",onClick:()=>V("folders"),children:y("assets.organization.folders","Folders")}),s.jsx("button",{type:"button","aria-pressed":o==="all-assets",onClick:()=>V("all-assets"),children:y("assets.organization.all","All assets")})]}),s.jsxs("div",{className:a.viewModeControl,role:"group","aria-label":y("assets.view.mode","View mode"),children:[s.jsxs("button",{type:"button","aria-pressed":b==="grid",onClick:()=>B("grid"),children:[s.jsx(at,{size:14}),y("assets.view.grid","Grid")]}),s.jsxs("button",{type:"button","aria-pressed":b==="list",onClick:()=>B("list"),children:[s.jsx(rt,{size:14}),y("assets.view.list","List")]})]}),s.jsx("div",{className:a.gridSizeControl,role:"group","aria-label":y("assets.view.thumbnailSize","Thumbnail size"),title:b==="list"?y("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":f===m,disabled:b==="list",onClick:()=>R(m),children:y(`assets.view.size.${m}`,m[0].toUpperCase()+m.slice(1))},m))})]})]}),b==="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:y("assets.list.name","Name")}),s.jsx("span",{children:y("assets.list.type","Type")}),s.jsx("span",{children:y("assets.list.scope","Scope")}),s.jsx("span",{children:y("assets.list.status","Status")}),s.jsx("span",{children:y("assets.list.updated","Updated")})]}):null,W.length>0?s.jsxs("section",{className:a.explorerSection,children:[s.jsx("h3",{children:y("assets.folders.title","Folders")}),s.jsx("div",{className:b==="list"?a.folderList:a.folderGrid,"data-grid-size":f,children:W.map(m=>Q(`scope:${m.scope}`,m.name,m.count,m.scope,()=>U({scope:m.scope,folderPath:""})))})]}):null,M.length>0?s.jsxs("section",{className:a.explorerSection,children:[s.jsx("h3",{children:y("assets.folders.title","Folders")}),s.jsx("div",{className:b==="list"?a.folderList:a.folderGrid,"data-grid-size":f,children:M.map(m=>Q(m.path,m.name,m.descendantCount,N.scope,()=>U({scope:N.scope,folderPath:m.path})))})]}):null,P.length>0?s.jsxs("section",{className:a.explorerSection,"aria-label":o==="all-assets"?y("assets.organization.all","All assets"):void 0,children:[o==="folders"?s.jsx("h3",{children:y("assets.folder.assetsTitle","Assets in this folder")}):null,s.jsx(Zn,{assets:P,selectedAssetId:null,selectedAssetKey:x,viewMode:b,gridSize:f,onSelect:p})]}):null,M.length===0&&P.length===0&&(W.length===0||t.length===0)?n==="all"&&t.length===0&&l?l:s.jsxs("div",{className:a.emptyState,children:[s.jsx("p",{children:t.length===0?n==="all"?y("assets.empty.title","No assets yet"):y("assets.empty.filteredTitle","No assets match this filter"):y("assets.empty.folderTitle","No matching assets in this folder")}),s.jsx("span",{children:t.length===0?n==="all"?y("assets.empty.body","Choose a scope and category, then rescan that inbox folder."):y("assets.empty.filteredBody","Choose another category or rescan the matching inbox folders."):y("assets.empty.folderBody","Try another folder or category filter.")})]}):null]})}function sr(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 tr(e){const{locale:t,t:r}=pe(),[n,o]=c.useState("register"),b=sr(r),f=e.scope==="all"?r("assets.emptyGuide.scope.all","Choose Current Place or Shared before adding files."):e.scope==="shared"?r("assets.emptyGuide.scope.shared","New files will be registered in the Shared library."):r("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:r("assets.emptyGuide.title","Collect assets for your game")}),s.jsx("p",{children:r("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(Ds,{size:16,"aria-hidden":"true"}),s.jsx("h4",{children:r("assets.emptyGuide.ai.title","Ask AI")})]}),s.jsx("p",{className:a.emptyGuideMethodHelp,children:r("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":r("assets.emptyGuide.ai.methodLabel","Image preparation method"),children:[s.jsxs("button",{type:"button",role:"radio","aria-checked":n==="register",className:`${a.emptyGuideChoice} ${n==="register"?a.emptyGuideChoiceSelected:""}`,onClick:()=>o("register"),children:[s.jsx("span",{className:a.emptyGuideChoiceLabel,children:r("assets.emptyGuide.ai.registerOption","Register an existing image")}),s.jsx("span",{className:a.emptyGuideCapability,children:r("assets.emptyGuide.ai.registerCapability","Image generation not required")})]}),s.jsxs("button",{type:"button",role:"radio","aria-checked":n==="generate",className:`${a.emptyGuideChoice} ${n==="generate"?a.emptyGuideChoiceSelected:""}`,onClick:()=>o("generate"),children:[s.jsx("span",{className:a.emptyGuideChoiceLabel,children:r("assets.emptyGuide.ai.generateOption","Generate a new image")}),s.jsx("span",{className:a.emptyGuideCapability,children:r("assets.emptyGuide.ai.generateCapability","Image generation required")})]})]}),s.jsx("p",{className:a.emptyGuideCapabilityDescription,children:n==="register"?r("assets.emptyGuide.ai.registerDescription","Use this when you already have an image file or are unsure whether your AI can generate images."):r("assets.emptyGuide.ai.generateDescription","Use this only when your AI can create PNG or JPG files or has an image generation tool.")}),s.jsx(Gs,{examples:[b[n]],resetKey:`${t}|assets-${n}`,labels:{copy:r("guidance.ai.copy","Copy request"),copying:r("guidance.ai.copying","Copying…"),copied:r("guidance.ai.copied","Copied"),copyFailed:r("guidance.ai.copyFailed","Could not copy. Select the request text and copy it manually.")},nextStep:r("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(st,{size:16,"aria-hidden":"true"}),s.jsx("h4",{children:r("assets.emptyGuide.direct.title","Add files yourself")})]}),s.jsx("p",{children:f}),s.jsxs("ol",{className:a.emptyGuideSteps,children:[s.jsx("li",{children:r("assets.emptyGuide.direct.image","Put image or decal files in the inbox for the selected scope, then rescan.")}),s.jsx("li",{children:r("assets.emptyGuide.direct.model","For models, select objects in Studio and save them from WEPPY Plugin > Assets.")}),s.jsx("li",{children:r("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:r("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:r("assets.emptyGuide.direct.rescan","Rescan inbox")})]})]})]})}const ar="https://create.roblox.com/dashboard/creations/store",nr=/^https:\/\/create\.roblox\.com\/store\/asset\/\d+(?:\/.*)?$/;function rr(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 r=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),o=String(t.getDate()).padStart(2,"0"),b=String(t.getHours()).padStart(2,"0"),f=String(t.getMinutes()).padStart(2,"0");return`${r}-${n}-${o} ${b}:${f}`}function or(e){return e.category==="image"||e.category==="decal"||!!e.file.preview}function lr(e){return e.file.preview?He(e):bs(e)}function ir(e){var r;const t=Object.entries(((r=e.rbxm)==null?void 0:r.classCounts)??{}).sort((n,o)=>o[1]-n[1]).slice(0,8);return t.length===0?"-":t.map(([n,o])=>`${n} ${o}`).join(", ")}function ss(e){var o;const t=(o=e.rbxm)==null?void 0:o.thumbnail;if(!t)return"-";const r=t.source?` via ${t.source}`:"",n=t.message?` · ${t.message}`:"";return`${t.status}${r}${n}`}function cr(e){var o,b;const t=(b=(o=e.rbxm)==null?void 0:o.review)==null?void 0:b.summary;if(!t)return"-";const r=[["roots",t.rootCount],["parts",t.partCount],["mesh parts",t.meshPartCount],["scripts",t.scriptCount],["unanchored",t.unanchoredPartCount]].flatMap(([f,x])=>typeof x=="number"?[`${f} ${x}`]:[]),n=t.bounds;if(n&&typeof n=="object"&&"size"in n){const f=n.size;if(f&&typeof f=="object"){const{x,y:p,z:$}=f;typeof x=="number"&&typeof p=="number"&&typeof $=="number"&&r.push(`bounds ${x} x ${p} x ${$}`)}}return r.length>0?r.join(", "):"-"}function dr(e){var r,n;const t=(r=e.rbxm)==null?void 0:r.generation;return t?t.schemaMode==="custom"&&((n=t.schemaGroups)!=null&&n.length)?`custom · ${t.schemaGroups.join(", ")}`:t.predefinedSchema?`${t.schemaMode??"predefined"} · ${t.predefinedSchema}`:t.schemaMode??"-":"-"}function ts(e){const{width:t,height:r}=e.file;return t===null||r===null?null:`${t} x ${r}px`}function as(e){const{durationMs:t}=e.file;return t===null?null:t<1e3?`${t} ms`:`${(t/1e3).toFixed(1)} s`}function ur(e){return`${ar}/${e}/configure`}function pr(e){return e.category==="decal"?e.roblox.creatorAssetId??e.roblox.assetId??null:e.roblox.assetId??null}function mr(e){const t=pr(e),r=t?ur(t):null,n=e.category==="decal"?e.roblox.creatorAssetWebUrl??e.roblox.assetWebUrl:e.roblox.assetWebUrl;return!n||r&&nr.test(n)?r:n}function hr(e){return`${ke(e.startedAt)} -> ${e.status}`}function ns(e){return!e.creatorType||!e.creatorId?null:`${e.creatorType} ${e.creatorId}`}function rs(e){return e.assetRole?`Asset role: ${e.assetRole}`:null}function gr(e){const t=e.sourceProperty?` · ${e.sourceProperty}`:"";return`${e.path} · ${e.assetType} · ${e.status}${t}`}function xr(e){return e.assetUri&&e.assetId?`${e.assetUri} (#${e.assetId})`:e.assetUri?e.assetUri:e.assetId?`#${e.assetId}`:e.message??"-"}function ve({label:e,value:t}){return t?s.jsx("button",{type:"button",className:a.inlineCopyButton,"aria-label":e,title:e,onClick:()=>{var r;return void((r=navigator.clipboard)==null?void 0:r.writeText(t))},children:s.jsx(xs,{size:13})}):null}function fr({asset:e,busyAction:t,canUpload:r,canImportRbxm:n,importRbxmTooltip:o,importRbxmTargetParent:b,onClose:f,onSave:x,onUpload:p,onDelete:$,onImportRbxm:V,onRefreshStatus:B,onScanUsage:R}){var j,g;const{t:l}=pe(),y=c.useRef(null),[N,T]=c.useState(""),[Y,q]=c.useState("");if(c.useEffect(()=>{T((e==null?void 0:e.displayName)??""),q((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 I;if(!e)return;(I=y.current)==null||I.focus();const i=Q=>{Q.key==="Escape"&&f()};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[e,f]),!e)return null;const z=e.status==="processing"&&!!(e.roblox.operationId??e.roblox.operationPath),D=!!e.roblox.assetUri,U=mr(e),K=e.roblox.uploadAttempts??[],M=e.category==="decal"&&!!(e.roblox.creatorAssetId||e.roblox.backingImageAssetId||e.roblox.assetId),J=e.roblox.creatorAssetId??e.roblox.assetId,P=e.roblox.backingImageAssetId??e.roblox.assetId,w=vs(e,l),E=e.roblox.assetId?e.usage.lastScannedAt?l("assets.detail.noUsageAfterScan","No references were found in local Sync files during the last check."):l("assets.detail.noUsageUnscanned","Run Scan usage to search local Sync files for this Roblox Asset ID."):l("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:f,role:"presentation",children:s.jsxs("section",{ref:y,className:a.detailDialog,role:"dialog","aria-modal":"true","aria-label":l("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:[de(e,l)," · ",Ae(e.status,l)]}),s.jsx("h2",{children:e.displayName}),s.jsx("span",{children:e.id})]}),s.jsxs("div",{className:a.detailHeaderActions,children:[s.jsx(Z,{text:r?l("assets.upload.open.tooltip","Upload this local file to Roblox through Open Cloud."):l("assets.proOnly.tooltip","Roblox upload is available on Pro."),children:s.jsxs("button",{type:"button",className:a.commandButton,disabled:!r,onClick:p,children:[s.jsx(ct,{size:15}),l("assets.upload.open","Upload")]})}),n&&s.jsx(Z,{text:o,children:s.jsxs("button",{type:"button",className:a.commandButton,disabled:t==="import-rbxm",onClick:()=>void V(),children:[s.jsx(Is,{size:15}),l("assets.detail.importRbxm","Insert into Studio")]})}),s.jsxs("button",{type:"button",className:a.commandButton,disabled:!z||t==="status-refresh",onClick:()=>void B(),children:[s.jsx(ms,{size:15}),l("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(lt,{size:15}),l("assets.detail.scanUsage","Scan usage")]}),s.jsx(Z,{text:l("assets.delete.tooltip","Delete this local Asset Library item."),children:s.jsxs("button",{type:"button",className:`${a.commandButton} ${a.dangerButton}`,disabled:t==="delete",onClick:$,children:[s.jsx(Ms,{size:15}),l("common.delete","Delete")]})}),s.jsx(Z,{text:l("common.close","Close"),children:s.jsx("button",{type:"button",className:a.iconButton,onClick:f,"aria-label":l("common.close","Close"),children:s.jsx(Ke,{size:16})})})]})]}),s.jsxs("div",{className:a.detailDialogBody,children:[s.jsx("div",{className:a.detailPreviewPane,children:or(e)?s.jsx("img",{className:a.detailPreview,src:lr(e),alt:e.displayName}):s.jsxs("div",{className:a.detailPreviewFallback,children:[s.jsx("span",{children:de(e,l)}),s.jsx("code",{children:e.file.original}),((j=e.rbxm)==null?void 0:j.thumbnail)&&s.jsx("small",{children:ss(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:l("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:l("assets.detail.description","Description")}),s.jsx("textarea",{value:Y,rows:3,onChange:i=>q(i.target.value)})]}),s.jsx("button",{type:"button",className:a.primaryButton,disabled:t==="update",onClick:()=>void x(N,Y),children:l("assets.detail.save","Save metadata")})]}),s.jsxs("section",{className:a.detailSection,children:[s.jsx("h3",{children:l("assets.detail.localFile","Local file")}),s.jsxs("dl",{className:a.detailGrid,children:[s.jsx("dt",{children:l("assets.detail.fileName","File")}),s.jsx("dd",{children:e.file.original}),s.jsx("dt",{children:l("assets.detail.source","Source path")}),s.jsx("dd",{children:e.source.originalPath}),s.jsx("dt",{children:l("assets.detail.category","Category")}),s.jsx("dd",{children:de(e,l)}),s.jsx("dt",{children:l("assets.detail.scope","Scope")}),s.jsx("dd",{children:e.scope.kind==="shared"?l("assets.scope.shared","Shared"):l("assets.scope.place","Current Place")}),s.jsx("dt",{children:l("assets.detail.mimeType","Type")}),s.jsx("dd",{children:e.file.mimeType}),s.jsx("dt",{children:l("assets.detail.size","Size")}),s.jsx("dd",{children:rr(e.file.sizeBytes)}),ts(e)&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:l("assets.detail.dimensions","Dimensions")}),s.jsx("dd",{children:ts(e)})]}),as(e)&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:l("assets.detail.duration","Duration")}),s.jsx("dd",{children:as(e)})]})]})]}),e.rbxm&&s.jsxs("section",{className:a.detailSection,children:[s.jsx("h3",{children:l("assets.detail.rbxm","RBXM contents")}),s.jsxs("dl",{className:a.detailGrid,children:[s.jsx("dt",{children:l("assets.detail.rbxmExportedCount","Exported roots")}),s.jsx("dd",{children:e.rbxm.exportedCount}),s.jsx("dt",{children:l("assets.detail.rbxmClasses","Classes")}),s.jsx("dd",{children:ir(e)}),s.jsx("dt",{children:l("assets.detail.rbxmThumbnail","Thumbnail")}),s.jsx("dd",{children:ss(e)}),w&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:l("assets.detail.rbxmStudioUploadsLabel","Studio uploads")}),s.jsx("dd",{children:w})]}),n&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:l("assets.detail.studioInsertTarget","Studio insert target")}),s.jsx("dd",{children:b})]})]}),e.rbxm.roots.length>0&&s.jsxs("div",{className:a.metadataList,children:[s.jsx("strong",{children:l("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:l("assets.detail.rbxmReferences","Asset references")}),e.rbxm.resourceReferences.map((i,I)=>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}-${I}`))]}),e.rbxm.studioUploads&&e.rbxm.studioUploads.length>0&&s.jsxs("div",{className:a.metadataList,children:[s.jsx("strong",{children:l("assets.detail.rbxmStudioUploads","Embedded Studio uploads")}),e.rbxm.studioUploads.map((i,I)=>s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:gr(i)}),s.jsx("code",{children:xr(i)})]},`${i.path}-${i.assetType}-${i.sourceProperty??""}-${I}`))]}),e.rbxm.generation&&s.jsxs("div",{className:a.metadataList,children:[s.jsx("strong",{children:l("assets.detail.rbxmGeneration","Generated model")}),s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:l("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:l("assets.detail.rbxmGenerationPrompt","Prompt")}),s.jsx("code",{children:e.rbxm.generation.prompt})]}),s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:l("assets.detail.rbxmGenerationSchema","Schema")}),s.jsx("code",{children:dr(e)})]}),e.rbxm.generation.path&&s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:l("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:l("assets.detail.rbxmReview","Model review")}),s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:l("assets.detail.rbxmReviewReadiness","Readiness")}),s.jsx("code",{children:e.rbxm.review.readiness})]}),s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:l("assets.detail.rbxmReviewSummary","Summary")}),s.jsx("code",{children:cr(e)})]}),e.rbxm.review.findings.slice(0,8).map((i,I)=>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}-${I}`))]})]}),s.jsxs("section",{className:a.detailSection,children:[s.jsx("h3",{children:l("assets.detail.roblox","Roblox upload status")}),s.jsxs("dl",{className:a.detailGrid,children:[s.jsx("dt",{children:l("assets.detail.status","Status")}),s.jsx("dd",{children:Ae(e.status,l)}),M?s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:l("assets.detail.decalAssetId","Roblox Decal ID")}),s.jsxs("dd",{className:a.copyableValue,children:[s.jsx("span",{children:J??l("assets.status.localOnly","Local only")}),s.jsx(ve,{label:l("assets.detail.copyDecalAssetId","Copy Roblox Decal ID"),value:J})]}),s.jsx("dt",{children:l("assets.detail.studioTextureImageId","Studio Texture Image ID")}),s.jsxs("dd",{className:a.copyableValue,children:[s.jsx("span",{children:P??"-"}),s.jsx(ve,{label:l("assets.detail.copyStudioTextureImageId","Copy Studio Texture Image ID"),value:P})]})]}):s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:l("assets.detail.assetId","Asset ID")}),s.jsxs("dd",{className:a.copyableValue,children:[s.jsx("span",{children:e.roblox.assetId??l("assets.status.localOnly","Local only")}),s.jsx(ve,{label:l("assets.detail.copyAssetId","Copy Asset ID"),value:e.roblox.assetId})]})]}),s.jsx("dt",{children:l("assets.detail.studioUri","Studio URI")}),s.jsx("dd",{children:e.roblox.assetUri??"-"}),s.jsx("dt",{children:l("assets.detail.robloxWebUrl","Creator Dashboard URL")}),s.jsxs("dd",{className:a.copyableValue,children:[s.jsx("span",{children:U??"-"}),s.jsx(ve,{label:l("assets.detail.copyWebUrl","Copy configure URL"),value:U})]}),e.roblox.errorMessage&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:l("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:!D,onClick:()=>{var i;return e.roblox.assetUri&&void((i=navigator.clipboard)==null?void 0:i.writeText(e.roblox.assetUri))},children:[s.jsx(xs,{size:15}),l("assets.detail.copyStudioUri","Copy Studio URI")]}),U&&s.jsxs("a",{className:a.commandButton,href:U,target:"_blank",rel:"noreferrer",children:[s.jsx(ws,{size:15}),l("assets.detail.openRobloxPage","Open configure page")]})]}),e.roblox.assetId&&s.jsx("p",{className:a.muted,children:l("assets.detail.robloxWebUrlNotice","Opening this page requires the Roblox account that owns or can manage the uploaded asset.")}),K.length>0&&s.jsxs("div",{className:a.metadataList,children:[s.jsx("strong",{children:l("assets.detail.uploadHistory","Upload history")}),K.slice().reverse().map((i,I)=>s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:hr(i)}),ns(i)&&s.jsx("code",{children:ns(i)}),rs(i)&&s.jsx("code",{children:rs(i)}),i.operationPath&&s.jsx("code",{children:i.operationPath}),i.assetId&&s.jsxs("code",{children:[l("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??I}`))]})]}),s.jsxs("section",{className:a.detailSection,children:[s.jsx("h3",{children:l("assets.detail.usedInPlace","Where this asset is used in this Place")}),s.jsxs("dl",{className:a.detailGrid,children:[s.jsx("dt",{children:l("assets.detail.usageSource","Checked against")}),s.jsx("dd",{children:e.usage.scanSource==="localSync"?l("assets.detail.usageSource.localSync","Local Sync files"):l("assets.detail.usageSource.notScanned","Not checked yet")}),s.jsx("dt",{children:l("assets.detail.lastScanned","Last checked")}),s.jsx("dd",{children:e.usage.lastScannedAt?l("assets.detail.lastScannedAt","Last checked: {time}").replace("{time}",ke(e.usage.lastScannedAt)):l("assets.detail.lastScanned.never","No check yet")})]}),e.usage.references.length===0?s.jsx("p",{className:a.muted,children:E}):s.jsx("div",{className:a.usageList,children:e.usage.references.map((i,I)=>s.jsxs("div",{className:a.usageItem,children:[s.jsx("strong",{children:i.kind==="property"?i.instancePath:i.filePath}),s.jsx("span",{children:i.property??l("assets.detail.line","line {line}").replace("{line}",String(i.line??"-"))}),s.jsx("code",{children:i.value})]},`${i.kind}-${I}`))})]}),s.jsxs("details",{className:a.technicalDetails,children:[s.jsx("summary",{children:l("assets.detail.technicalDetails","Technical details")}),s.jsxs("dl",{className:a.detailGrid,children:[s.jsx("dt",{children:l("assets.detail.stableId","Stable ID")}),s.jsx("dd",{className:a.hashText,children:e.id}),s.jsx("dt",{children:l("assets.detail.sourceKind","Source kind")}),s.jsx("dd",{children:e.source.kind}),s.jsx("dt",{children:l("assets.detail.sha256","SHA-256")}),s.jsx("dd",{className:a.hashText,children:e.file.sha256}),s.jsx("dt",{children:l("assets.detail.createdAt","Created")}),s.jsx("dd",{children:ke(e.createdAt)}),s.jsx("dt",{children:l("assets.detail.updatedAt","Updated")}),s.jsx("dd",{children:ke(e.updatedAt)}),e.roblox.operationId&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:l("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:l("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:l("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:l("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:l("assets.detail.moderationState","Moderation")}),s.jsx("dd",{children:e.roblox.moderationState})]})]}),((g=e.rbxm)==null?void 0:g.thumbnail.attempts)&&e.rbxm.thumbnail.attempts.length>0&&s.jsxs("div",{className:a.metadataList,children:[s.jsx("strong",{children:l("assets.detail.rbxmThumbnailAttempts","Thumbnail attempts")}),e.rbxm.thumbnail.attempts.map((i,I)=>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}-${I}`))]})]})]})]})]})})}function Cs(e){return{assetUploadByOpenCloudEnabled:e.hot.ENABLE_ASSET_UPLOAD_BY_OPEN_CLOUD===!0}}function br(e){const t={};return typeof e.assetUploadByOpenCloudEnabled=="boolean"&&(t.ENABLE_ASSET_UPLOAD_BY_OPEN_CLOUD=e.assetUploadByOpenCloudEnabled),t}async function _s(){const e=await O.get("/api/dashboard/settings");return Cs(e)}async function yr(e){const t=await O.patch("/api/dashboard/settings",br(e));return Cs(t)}async function Ss(){return O.get("/api/dashboard/open-cloud/credential-profiles")}async function jr(e){return O.post("/api/dashboard/open-cloud/credential-profiles",e)}async function vr(e){return O.patch("/api/dashboard/open-cloud/credential-profiles/active",{profileId:e})}async function Cr(e,t){return O.put(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}/api-key`,t)}async function _r(e){return O.delete(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}`)}async function Sr(e,t){return O.post(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}/creators`,t)}async function kr(e,t){return O.patch(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}/creators/${encodeURIComponent(t)}/default`,{})}async function Nr(e,t){return O.delete(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}/creators/${encodeURIComponent(t)}`)}async function Ar(e,t){return O.post(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}/test`,t?{creatorPresetId:t}:{})}async function Pr(e){return O.post("/api/dashboard/open-cloud/credential/test",e?{apiKey:e}:{})}function Ir(e){return e.category==="image"||e.category==="decal"}function wr(e,t){return e==="group"?t("assets.creator.group","Group"):t("assets.creator.user","User")}function Rr(e,t){return`${e.label} · ${wr(e.creatorType,t)} ${e.creatorId}`}function os(e){if(!e)return null;if(e.defaultCreatorId){const t=e.creators.find(r=>r.id===e.defaultCreatorId);if(t)return t}return e.creators[0]??null}function $r({asset:e,open:t,canUpload:r,busyAction:n,onClose:o,onBack:b,onOpenSettings:f,onUpload:x}){const{t:p}=pe(),$=c.useRef(null),[V,B]=c.useState(null),[R,l]=c.useState(null),[y,N]=c.useState(!1),[T,Y]=c.useState(null),[q,z]=c.useState(""),[D,U]=c.useState(""),[K,M]=c.useState(""),[J,P]=c.useState("user"),[w,E]=c.useState("");if(c.useEffect(()=>{z((e==null?void 0:e.displayName)??""),U((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 v=!1;return N(!0),Y(null),(async()=>{try{const[H,X]=await Promise.all([_s(),Ss()]);if(v)return;B(H);const le=X.profiles.find(ae=>ae.id===X.activeProfileId)??X.profiles[0]??null;l(le);const ee=os(le);M((ee==null?void 0:ee.id)??""),P((ee==null?void 0:ee.creatorType)??"user"),E((ee==null?void 0:ee.creatorId)??"")}catch(H){if(v)return;Y(H instanceof Error?H.message:p("assets.upload.settingsLoadFailed","Failed to load upload settings.")),B(null),l(null)}finally{v||N(!1)}})(),()=>{v=!0}},[t,p]),c.useEffect(()=>{var H;if(!t||!e)return;(H=$.current)==null||H.focus();const v=X=>{X.key==="Escape"&&o()};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[e,o,t]),!t||!e)return null;const j=(V==null?void 0:V.assetUploadByOpenCloudEnabled)===!0,g=!!R,i=os(R),I=(R==null?void 0:R.creators.find(v=>v.id===K))??null,Q=!!i,m=(R==null?void 0:R.storageProvider)==="env"&&g&&!Q,A=m&&w.trim().length>0,h=r&&!y&&!T&&(!j||!g||!Q&&!m),F=r&&!y&&!T&&j&&g&&(Q||A)&&n!=="upload";return s.jsx("div",{className:a.detailPopupLayer,onClick:o,role:"presentation",children:s.jsxs("section",{ref:$,className:a.detailDialog,role:"dialog","aria-modal":"true","aria-label":p("assets.upload.title","Upload asset"),tabIndex:-1,onClick:v=>v.stopPropagation(),children:[s.jsxs("div",{className:a.detailDialogHeader,children:[s.jsxs("div",{className:a.detailTitleBlock,children:[s.jsxs("span",{className:a.detailEyebrow,children:[de(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:b,children:[s.jsx(Os,{size:15}),p("assets.upload.backToDetails","Back to details")]}),s.jsx(Z,{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(Ke,{size:16})})})]})]}),s.jsxs("div",{className:a.detailDialogBody,children:[s.jsx("div",{className:a.detailPreviewPane,children:Ir(e)?s.jsx("img",{className:a.detailPreview,src:bs(e),alt:e.displayName}):s.jsxs("div",{className:a.detailPreviewFallback,children:[s.jsx("span",{children:de(e,p)}),s.jsx("code",{children:e.file.original})]})}),s.jsxs("div",{className:a.detailContentPane,children:[!r&&s.jsx("div",{className:a.notice,children:p("assets.proOnly.upload","Roblox upload is available on Pro.")}),y&&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:de(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:g?j?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:f,children:[s.jsx(hs,{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:q,disabled:!r,onChange:v=>z(v.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:D,rows:3,disabled:!r,onChange:v=>U(v.target.value)}),s.jsx("small",{className:a.fieldHelp,children:p("assets.upload.descriptionHelp","Saved to Roblox as the asset description.")})]}),Q&&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:K,disabled:!r||y,onChange:v=>M(v.target.value),children:R==null?void 0:R.creators.map(v=>s.jsx("option",{value:v.id,children:Rr(v,p)},v.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:J,disabled:!r,onChange:v=>P(v.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:w,disabled:!r,onChange:v=>E(v.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:!F,onClick:()=>{const v=w.trim(),H=m&&v?{creatorType:J,creatorId:v}:{},X=!m&&I&&i&&I.id!==i.id?{creatorType:I.creatorType,creatorId:I.creatorId}:{};x({displayName:q,description:D,...H,...X})},children:n==="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 ls(e,t){return e==="env"?t("assets.settings.credential.env","Environment variable"):t("assets.settings.credential.local","Local encrypted file")}function Fe(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 Lr(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 Tr(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 Br(e,t){return e==="group"?t("assets.creator.group","Group"):t("assets.creator.user","User")}function Ur(e,t){return`${Br(e.creatorType,t)} ${e.creatorId}`}function Er({open:e,tier:t,onClose:r}){const{t:n}=pe(),[o,b]=c.useState(null),[f,x]=c.useState(null),[p,$]=c.useState(""),[V,B]=c.useState(!1),[R,l]=c.useState(""),[y,N]=c.useState(""),[T,Y]=c.useState("user"),[q,z]=c.useState(""),[D,U]=c.useState(""),[K,M]=c.useState(!0),[J,P]=c.useState(null),[w,E]=c.useState(null),[j,g]=c.useState(!1),i=t==="basic",I=c.useCallback(async()=>{g(!0),P(null);try{const[u,S]=await Promise.all([_s(),Ss()]);b(u),x(S);const L=S.profiles.find(ue=>ue.id===S.activeProfileId)??S.profiles[0]??null;$((L==null?void 0:L.id)??""),B(!L),M(!L||L.creators.length===0),Y("user"),z(""),U("")}catch(u){P(u instanceof Error?u.message:n("assets.settings.loadFailed","Failed to load upload settings."))}finally{g(!1)}},[n]);if(c.useEffect(()=>{e&&I()},[I,e]),!e)return null;const Q=(o==null?void 0:o.assetUploadByOpenCloudEnabled)===!0,W=y.trim(),m=q.trim(),A=(f==null?void 0:f.profiles)??[],h=A.find(u=>u.id===p)??A[0]??null,F=!!h,v=F&&(h==null?void 0:h.storageProvider)==="localFile",H=F&&(h==null?void 0:h.storageProvider)==="env",X=h!=null&&h.defaultCreatorId?h.creators.find(u=>u.id===h.defaultCreatorId):h==null?void 0:h.creators[0],le=!!(h!=null&&h.creators.length),ee=!le||K,ae=A.length>1,ie=i?n("assets.settings.action.proRequired","Asset upload settings are available on Pro."):j?n("assets.settings.action.busy","Wait for the current settings action to finish."):null,we=i||j||!W,Re=ie??(W?n("assets.settings.saveApiKey.tooltip.ready","Save this API key to local encrypted storage."):n("assets.settings.saveApiKey.tooltip.enter","Enter an Open Cloud API key to save it locally.")),fe=i||j||!W&&!F,be=ie??(W?n("assets.settings.testConnection.tooltip.entered","Test the entered API key before saving it."):F?n("assets.settings.testConnection.tooltip.saved","Test the saved Open Cloud API key."):n("assets.settings.testConnection.tooltip.enterOrSaved","Enter an API key or save one before testing the connection.")),ye=i||j||!v,je=ie??(v?n("assets.settings.removeApiKey.tooltip.ready","Remove the locally saved Open Cloud API key."):H?n("assets.settings.removeApiKey.tooltip.env","Environment API keys cannot be removed from Dashboard. Remove ROBLOX_OPEN_CLOUD_API_KEY outside WEPPY."):n("assets.settings.removeApiKey.tooltip.none","No local Open Cloud API key is saved.")),$e=i||j||!v||!m,Le=ie??(H?n("assets.settings.saveCreator.tooltip.env","Environment API keys cannot save a default Creator here. Enter Creator details in the upload dialog."):v?m?n("assets.settings.saveCreator.tooltip.ready","Save this Creator as the default owner for uploads."):n("assets.settings.saveCreator.tooltip.enterId","Enter a user or group ID before saving the default Creator."):n("assets.settings.saveCreator.tooltip.noLocal","Save a local Open Cloud API key before saving a default Creator.")),Te=ie??(v?n("assets.settings.addCreator.tooltip.ready","Add another User or Group Creator preset to this profile."):n("assets.settings.saveCreator.tooltip.noLocal","Save a local Open Cloud API key before saving a default Creator.")),Be=i||j||H||!v,Ue=ie??(v?n("assets.settings.unregisterCreator.tooltip.ready","Unregister this Creator from the selected profile."):H?n("assets.settings.saveCreator.tooltip.env","Environment API keys cannot save a default Creator here. Enter Creator details in the upload dialog."):n("assets.settings.saveCreator.tooltip.noLocal","Save a local Open Cloud API key before saving a default Creator.")),Ee=X?n("assets.settings.saveCreatorPreset","Save Creator"):n("assets.settings.saveCreator","Save default Creator"),d=(h==null?void 0:h.label)??n("assets.settings.credential.none","No API key saved"),C=u=>{const S=u.profiles.find(L=>L.id===u.activeProfileId)??u.profiles[0]??null;x(u),$((S==null?void 0:S.id)??""),M(!S||S.creators.length===0),B(u.profiles.length===0)},_=async()=>{if(h){g(!0);try{const u=await Ar(h.id,X==null?void 0:X.id);C(u),P(Tr(u.validation,n))}catch(u){P(u instanceof Error?u.message:n("assets.settings.testFailed","Connection test failed."))}finally{g(!1)}}},k=async()=>{if(w){g(!0);try{if(w.kind==="apiKey"){const u=await _r(w.profileId);C(u),P(n("assets.settings.apiKeyRemoved","Open Cloud API key unregistered from local storage."))}else{const u=await Nr(w.profileId,w.creatorPresetId);C(u),P(n("assets.settings.creatorUnregistered","Creator unregistered from this profile."))}E(null)}catch(u){P(u instanceof Error?u.message:w.kind==="apiKey"?n("assets.settings.removeFailed","Failed to unregister API key."):n("assets.settings.creatorUnregisterFailed","Failed to unregister Creator."))}finally{g(!1)}}},G=(w==null?void 0:w.kind)==="apiKey"?n("assets.settings.unregisterApiKey.title","Unregister API Key?"):n("assets.settings.unregisterCreator.title","Unregister Creator?"),ne=(w==null?void 0:w.kind)==="apiKey"?n("assets.settings.unregisterApiKey.message","Roblox API key is not revoked. WEPPY only removes the local Credential Profile registration on this device."):n("assets.settings.unregisterCreator.message","Roblox user or group is not deleted. WEPPY only removes this Creator from the selected API Key profile."),se=(w==null?void 0:w.kind)==="apiKey"?n("assets.settings.removeApiKey","Unregister API Key"):n("assets.settings.unregisterCreator","Unregister Creator");return s.jsxs("section",{id:"asset-library-settings-panel",className:`${a.settingsInlinePanel} ${a.settingsDrawer}`,role:"region","aria-label":n("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:n("assets.settings.title","Asset Library settings")}),s.jsx("span",{children:d})]}),s.jsx(Z,{text:n("common.close","Close"),children:s.jsx("button",{type:"button",className:a.iconButton,onClick:r,"aria-label":n("common.close","Close"),children:s.jsx(Ke,{size:16})})})]}),i&&s.jsx("div",{className:`${a.notice} ${a.proNotice}`,children:n("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:n("assets.settings.openCloudToggle","Open Cloud upload")}),s.jsx("small",{children:n("assets.settings.openCloudToggle.help","Controls whether server-side Open Cloud upload mutations can run.")})]}),s.jsx(Ts,{checked:Q,disabled:i||j,onChange:u=>{(async()=>{g(!0);try{const S=await yr({assetUploadByOpenCloudEnabled:u.target.checked});b(S),P(n("assets.settings.saved","Upload settings saved."))}catch(S){P(S instanceof Error?S.message:n("assets.settings.saveFailed","Failed to save upload settings."))}finally{g(!1)}})()}})]}),ae&&s.jsx("div",{className:a.metadataList,children:A.map(u=>{const S=u.id===(h==null?void 0:h.id);return s.jsxs("div",{className:a.metadataItem,children:[s.jsx("strong",{children:u.label}),s.jsxs("span",{children:[n("assets.settings.field.storage","Storage"),": ",ls(u.storageProvider,n)]}),s.jsxs("span",{children:[n("assets.settings.field.validationStatus","Validation status"),": ",Fe(u.validationStatus,n)]}),S&&s.jsx("code",{children:n("assets.settings.activeProfileBadge","Active")}),!S&&u.storageProvider==="localFile"&&s.jsx("button",{type:"button",className:a.commandButton,disabled:i||j,onClick:()=>{(async()=>{g(!0);try{const L=await vr(u.id),ue=L.profiles.find(Ge=>Ge.id===(L.activeProfileId??u.id))??u;x(L),$(ue.id),M(ue.creators.length===0),Y("user"),z(""),U(""),P(n("assets.settings.profileSelected","Open Cloud credential profile selected."))}catch(L){P(L instanceof Error?L.message:n("assets.settings.saveFailed","Failed to save upload settings."))}finally{g(!1)}})()},children:n("assets.settings.useProfile","Use profile")})]},u.id)})}),h&&s.jsxs("div",{className:a.settingsSubsection,children:[s.jsx("div",{className:a.settingsSectionHeader,children:s.jsx("h3",{children:n("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:n("assets.settings.field.profile","Profile")}),s.jsx("dd",{children:h.label})]}),h.maskedKey&&s.jsxs("div",{children:[s.jsx("dt",{children:n("assets.settings.field.apiKey","API Key")}),s.jsx("dd",{children:h.maskedKey})]}),s.jsxs("div",{children:[s.jsx("dt",{children:n("assets.settings.field.storage","Storage")}),s.jsx("dd",{children:ls(h.storageProvider,n)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:n("assets.settings.field.validationStatus","Validation status")}),s.jsx("dd",{children:Fe(h.validationStatus,n)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:n("assets.settings.field.creators","Creators")}),s.jsx("dd",{children:h.creators.length})]})]}),!V&&s.jsxs("div",{className:a.buttonRow,children:[s.jsx(Z,{text:be,children:s.jsx("button",{type:"button",className:a.commandButton,disabled:fe,onClick:()=>{_()},children:n("assets.settings.testConnection","Test Connection")})}),v&&s.jsx("button",{type:"button",className:a.commandButton,disabled:i||j,onClick:()=>B(!0),children:n("assets.settings.replaceApiKey","Replace API Key")}),s.jsx(Z,{text:je,children:s.jsx("button",{type:"button",className:`${a.commandButton} ${a.dangerButton}`,disabled:ye,onClick:()=>E({kind:"apiKey",profileId:h.id}),children:n("assets.settings.removeApiKey","Unregister API Key")})})]})]})]}),V&&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:n("assets.settings.profileLabel","Profile name")})}),s.jsx("input",{id:"asset-settings-open-cloud-profile-label",value:R,disabled:i||j,onChange:u=>l(u.target.value),placeholder:n("assets.settings.profileLabel.placeholder","Studio automation key")}),s.jsx("p",{className:a.inlineHelp,children:n("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:n("assets.settings.apiKey","Open Cloud API Key")}),s.jsx(qe,{topicId:"openCloudApiKey",variant:"field",state:{hasOpenCloudCredential:F}})]}),s.jsx("input",{id:"asset-settings-open-cloud-api-key",value:y,type:"password",disabled:i||j,onChange:u=>N(u.target.value)}),s.jsx("p",{className:a.inlineHelp,children:n("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.")})]}),!F&&s.jsx("p",{className:a.inlineHelp,children:s.jsx("a",{href:Bs["open_cloud.api_key"].docsUrl,target:"_blank",rel:"noreferrer",children:n("assets.settings.apiKeyGuide","Create a Roblox API key with Assets Read and Write permissions.")})}),s.jsxs("div",{className:a.buttonRow,children:[s.jsx(Z,{text:Re,children:s.jsx("button",{type:"button",className:a.commandButton,disabled:we,onClick:()=>{(async()=>{var u;g(!0);try{const S={apiKey:W,...R.trim()?{label:R.trim()}:{}},L=(h==null?void 0:h.storageProvider)==="localFile"?await Cr(h.id,S):await jr(S),ue=L.profiles.find(Ge=>{var Ye;return Ge.id===(L.activeProfileId??((Ye=L.profile)==null?void 0:Ye.id))});x(L),$(L.activeProfileId??((u=L.profile)==null?void 0:u.id)??""),M(!ue||ue.creators.length===0),B(!1),N(""),l(""),P(n("assets.settings.apiKeySaved","Open Cloud API key saved locally."))}catch(S){P(S instanceof Error?S.message:n("assets.settings.saveFailed","Failed to save upload settings."))}finally{g(!1)}})()},children:n("assets.settings.saveApiKey","Save API Key")})}),s.jsx(Z,{text:be,children:s.jsx("button",{type:"button",className:a.commandButton,disabled:fe,onClick:()=>{(async()=>{g(!0);try{const u=await Pr(W||void 0);P(Lr(u.validation,n))}catch(u){P(u instanceof Error?u.message:n("assets.settings.testFailed","Connection test failed."))}finally{g(!1)}})()},children:n("assets.settings.testConnection","Test Connection")})}),s.jsx(Z,{text:je,children:s.jsx("button",{type:"button",className:`${a.commandButton} ${a.dangerButton}`,disabled:ye,onClick:()=>{h&&E({kind:"apiKey",profileId:h.id})},children:n("assets.settings.removeApiKey","Unregister API Key")})})]})]}),s.jsx("div",{className:a.metadataList,children:h==null?void 0:h.creators.map(u=>s.jsxs("div",{className:a.metadataItem,children:[s.jsx("strong",{children:u.label}),s.jsx("span",{children:Ur(u,n)}),u.id===h.defaultCreatorId&&s.jsx("code",{children:n("assets.settings.defaultCreatorBadge","Default")}),s.jsxs("span",{children:[n("assets.settings.field.validationStatus","Validation status"),": ",Fe(u.validationStatus,n)]}),s.jsxs("div",{className:a.buttonRow,children:[u.id!==h.defaultCreatorId&&h.storageProvider==="localFile"&&s.jsx("button",{type:"button",className:a.commandButton,disabled:i||j,onClick:()=>{(async()=>{if(h){g(!0);try{const S=await kr(h.id,u.id);x(S),P(n("assets.settings.defaultCreatorSaved","Open Cloud default Creator saved locally."))}catch(S){P(S instanceof Error?S.message:n("assets.settings.saveFailed","Failed to save upload settings."))}finally{g(!1)}}})()},children:n("assets.settings.makeDefaultCreator","Make default")}),s.jsx(Z,{text:Ue,children:s.jsx("button",{type:"button",className:`${a.commandButton} ${a.dangerButton}`,disabled:Be,onClick:()=>E({kind:"creator",profileId:h.id,creatorPresetId:u.id}),children:n("assets.settings.unregisterCreator","Unregister Creator")})})]})]},u.id))}),le&&!K&&s.jsx(Z,{text:Te,children:s.jsx("button",{type:"button",className:a.commandButton,disabled:i||j||H||!v,onClick:()=>{Y("user"),z(""),U(""),M(!0)},children:n("assets.settings.addCreator","Add Creator")})}),ee&&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:n("assets.upload.creatorType","Creator type")})}),s.jsxs("select",{id:"asset-settings-creator-type",value:T,disabled:i||j||H||!v,onChange:u=>Y(u.target.value),children:[s.jsx("option",{value:"user",children:n("assets.creator.user","User")}),s.jsx("option",{value:"group",children:n("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:n("assets.upload.creatorId","Creator ID")}),s.jsx(qe,{topicId:"openCloudCreatorId",variant:"field",state:{hasDefaultCreator:!!X}})]}),s.jsx("input",{id:"asset-settings-creator-id",value:q,disabled:i||j||H||!v,onChange:u=>z(u.target.value)}),s.jsx("p",{className:a.inlineHelp,children:n("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:n("assets.settings.creatorLabel","Creator label")})}),s.jsx("input",{id:"asset-settings-creator-label",value:D,disabled:i||j||H||!v,onChange:u=>U(u.target.value),placeholder:n("assets.settings.creatorLabel.placeholder","Main studio group")}),s.jsx("p",{className:a.inlineHelp,children:n("assets.settings.creatorLabel.help","Optional. If left blank, WEPPY automatically saves a label like User 123 or Group 456.")})]}),!X&&s.jsx("p",{className:a.inlineHelp,children:n("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(Z,{text:Le,children:s.jsx("button",{type:"button",className:a.primaryButton,disabled:$e,onClick:()=>{(async()=>{if(h){g(!0);try{const u=await Sr(h.id,{creatorType:T,creatorId:m,makeDefault:!X,...D.trim()?{label:D.trim()}:{}});x(u),z(""),U(""),M(!1),P(n("assets.settings.defaultCreatorSaved","Open Cloud default Creator saved locally."))}catch(u){P(u instanceof Error?u.message:n("assets.settings.saveFailed","Failed to save upload settings."))}finally{g(!1)}}})()},children:Ee})}),le&&s.jsx("button",{type:"button",className:a.commandButton,disabled:i||j,onClick:()=>{Y("user"),z(""),U(""),M(!1)},children:n("assets.settings.cancelCreator","Cancel")})]})]})]}),J&&s.jsx("div",{className:a.messageState,children:J}),s.jsx(gs,{open:w!==null,title:G,message:ne,cancelLabel:n("common.cancel","Cancel"),confirmLabel:se,loading:j,onCancel:()=>E(null),onConfirm:()=>{k()}})]})}const Gr=12,Dr=5e3;function ce(e,t){return e instanceof Error&&e.message.trim().length>0?e.message:t}function is(e,t){return e.some(n=>xe(n,t))?e.map(n=>xe(n,t)?t:n):[t,...e]}function xe(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 Mr(e,t){return e.some(r=>xe(r,t))?e.map(r=>xe(r,t)?t:r):e}function Oe(e,t){return _t(e.filter(r=>Ct(r,t)))}function ge(e,t){return e?`${e.displayName} (${e.id})`:t??"unknown asset"}function Fr(e){return e.length===0?"none":e.map(t=>ge(t)).join(", ")}function cs(e){const t=`status ${e.status}`;return e.roblox.assetId?`Roblox asset ${e.roblox.assetId}; ${t}`:t}function Or(e,t){const r=ge(t);return e==="update"?`Updated metadata for asset: ${r}.`:e==="upload"?`Uploaded asset: ${r} -> ${cs(t)}.`:e==="thumbnail-generate"?`Generated thumbnail for asset: ${r}.`:e==="status-refresh"?`Refreshed Roblox status for asset: ${r} -> ${cs(t)}.`:e==="usage-scan"?`Scanned usage for asset: ${r} -> ${t.usage.references.length} reference(s).`:`Updated asset: ${r}.`}function Hr(e){return e!=="upload"&&e!=="status-refresh"}function ds(e){return e.status==="processing"&&!!(e.roblox.operationId??e.roblox.operationPath)}function Ce(e){return{scope:e.scope.kind,placeId:e.scope.kind==="place"?e.scope.placeId:void 0,category:e.category}}function zr(e,t){return e==="shared"?[{scope:"shared"}]:e==="place"?t===null?[]:[{scope:"place",placeId:t}]:[...t===null?[]:[{scope:"place",placeId:t}],{scope:"shared"}]}function us(e,t,r){return zr(e,t).flatMap(n=>vt(r).map(o=>({request:{...n,category:o},label:`${n.scope}/${o}`})))}function ps(e,t){if(t.length===0)return null;const r=t.map(({label:n,reason:o})=>`${n}: ${ce(o,"request failed")}`);return`${e}: ${r.join("; ")}`}function Kr(e){if(e.pluginConnected&&e.activePlaceId!==null)return{placeId:e.activePlaceId,placeName:e.activePlaceName,studioConnected:!0};if(e.lastActivePlaceId!==null)return{placeId:e.lastActivePlaceId,placeName:e.lastActivePlaceName,studioConnected:!1};const t=e.places[0];return{placeId:(t==null?void 0:t.placeId)??null,placeName:(t==null?void 0:t.placeName)??null,studioConnected:!1}}function Wr(e,t){if(typeof t=="number"){const r=e.places.find(n=>n.placeId===t);if(r)return{placeId:r.placeId,placeName:r.placeName,studioConnected:r.isConnected,overrideStillValid:!0}}return{...Kr(e),overrideStillValid:t===null}}function Vr(){const[e,t]=c.useState([]),[r,n]=c.useState(0),[o,b]=c.useState(null),[f,x]=c.useState("place"),[p,$]=c.useState("all"),[V,B]=c.useState([]),[R,l]=c.useState(null),[y,N]=c.useState(null),[T,Y]=c.useState(null),[q,z]=c.useState(null),[D,U]=c.useState(!1),[K,M]=c.useState(!1),[J,P]=c.useState(!0),[w,E]=c.useState(null),[j,g]=c.useState(null),[i,I]=c.useState(null),Q=c.useRef(!0),W=c.useRef(new Map),m=c.useRef(new Set),A=c.useMemo(()=>e.find(d=>te(d)===o)??null,[e,o]),h=(A==null?void 0:A.id)??null;c.useEffect(()=>{o&&(e.some(d=>te(d)===o)||b(null))},[e,o]);const F=c.useCallback(d=>{const C=W.current.get(d);C!==void 0&&(clearTimeout(C),W.current.delete(d))},[]),v=c.useCallback((d,C=Gr)=>{const _=te(d);if(!ds(d)||C<=0){F(_);return}m.current.has(_)||(F(_),m.current.add(_),(async()=>{try{const k=await Xe(Ce(d),d.id);if(!Q.current)return;if(t(G=>Mr(G,k)),ds(k)&&C>1){const G=te(k),ne=setTimeout(()=>{W.current.delete(G),v(k,C-1)},Dr);W.current.set(G,ne);return}F(te(k))}catch(k){if(!Q.current)return;F(_),g(ce(k,"Asset Library status refresh failed."))}finally{m.current.delete(_)}})())},[F]);c.useEffect(()=>()=>{Q.current=!1;for(const d of W.current.values())clearTimeout(d);W.current.clear(),m.current.clear()},[]);const H=c.useCallback(()=>f==="shared"?{scope:"shared"}:{scope:"place",placeId:T??void 0},[T,f]),X=c.useCallback(d=>({...H(),category:d}),[H]),le=c.useCallback(async()=>{try{const d=await Rs(),C=Wr(d,R);return B(d.places),C.overrideStillValid||l(null),N(C.placeId),Y(C.placeId),z(C.placeName),U(C.studioConnected),M(C.studioConnected),C.placeId}catch{return B([]),N(null),Y(null),z(null),U(!1),M(!1),null}},[R]),ee=c.useCallback(async()=>{g(null);try{const d=await le();if(f==="place"&&d===null){t([]),n(0),P(!1),g("No active place is connected for place-scoped assets.");return}const C=us(f,d,p),_=await Promise.allSettled(C.map(({request:se})=>dt(se))),k=_.flatMap(se=>se.status==="fulfilled"?[se.value]:[]),G=_.flatMap((se,u)=>se.status==="rejected"?[{label:C[u].label,reason:se.reason}]:[]);f==="all"&&d===null&&G.unshift({label:"place",reason:new Error("No active place is available")});const ne=Oe(k.flatMap(se=>se.assets),p);t(ne),n(ne.length);for(const se of ne)v(se);g(ps("Some Asset Library requests failed",G))}catch(d){g(ce(d,"Failed to load Asset Library."))}finally{P(!1)}},[p,le,f,v]);c.useEffect(()=>{ee()},[ee]);const ae=c.useCallback(async(d,C,_)=>{const k=(A==null?void 0:A.id)===C?A:e.find(G=>G.id===C)??null;if(!k)return g("Asset context is unavailable."),null;E(d),g(null),I(null);try{const G=await _(Ce(k));return t(ne=>is(ne,G)),b(te(G)),Hr(d)&&I(Or(d,G)),G}catch(G){return g(ce(G,"Asset Library action failed.")),null}finally{E(null)}},[e,A]),ie=c.useCallback(async()=>{E("rescan"),g(null),I(null);try{const d=us(f,T,p);if(f==="place"&&T===null){g("No active place is connected for place-scoped assets.");return}const C=await Promise.allSettled(d.map(({request:S})=>ut(S))),_=C.flatMap(S=>S.status==="fulfilled"?[S.value]:[]),k=C.flatMap((S,L)=>S.status==="rejected"?[{label:d[L].label,reason:S.reason}]:[]);f==="all"&&T===null&&k.unshift({label:"place",reason:new Error("No active place is available")});const G=Oe(_.flatMap(S=>S.assets),p),ne=_.reduce((S,L)=>S+L.adoptedCount,0),se=_.reduce((S,L)=>S+L.skippedCount,0),u=Oe(_.flatMap(S=>S.adopted),p);t(G),n(G.length),I(`Rescan complete for ${p}: ${ne} asset(s) added, ${se} skipped. Added: ${Fr(u)}.`),g(ps("Some Asset Library rescans failed",k))}catch(d){g(ce(d,"Asset Library rescan failed."))}finally{E(null)}},[T,p,f]),we=c.useCallback(async(d,C)=>{E("export-selection-rbxm"),g(null),I(null);try{const _=await xt(X(d),C);return t(k=>is(k,_.asset)),b(te(_.asset)),I(`Exported Studio selection as RBXM asset: ${ge(_.asset)}${_.deduplicated?" (reused existing local asset)":""}.`),_}catch(_){return g(ce(_,"Asset Library .rbxm export failed.")),null}finally{E(null)}},[X]),Re=c.useCallback((d,C)=>ae("update",d,_=>pt(_,d,C)),[ae]),fe=c.useCallback(async(d,C)=>{const _=await ae("upload",d,k=>ht(k,d,C));return _&&v(_),_},[ae,v]),be=c.useCallback(async d=>{const C=(A==null?void 0:A.id)===d?A:e.find(k=>k.id===d)??null;if(!C)return g("Asset context is unavailable."),!1;const _=te(C);F(_),E("delete"),g(null),I(null);try{return await mt(Ce(C),d),t(k=>{const G=k.filter(ne=>!xe(ne,C));return n(G.length),G}),b(k=>k===_?null:k),I(`Deleted asset: ${ge(C,d)}. Local files removed; uploaded Roblox assets were not deleted.`),!0}catch(k){return g(ce(k,"Asset Library delete failed.")),!1}finally{E(null)}},[e,F,A]),ye=c.useCallback(async(d,C)=>{const _=(A==null?void 0:A.id)===d?A:e.find(k=>k.id===d)??null;if(!_)return g("Asset context is unavailable."),null;E("import-rbxm"),g(null),I(null);try{const k=await ft(Ce(_),d,C);return b(te(_)),I(`Imported RBXM asset: ${ge(_,d)} -> ${k.importedCount} instance(s) to ${k.targetParent}.`),k}catch(k){return g(ce(k,"Asset Library .rbxm import failed.")),null}finally{E(null)}},[e,A]),je=c.useCallback(d=>ae("thumbnail-generate",d,C=>bt(C,d)),[ae]),$e=c.useCallback(d=>{const C=(A==null?void 0:A.id)===d?A:e.find(_=>_.id===d)??null;return C&&F(te(C)),ae("status-refresh",d,_=>Xe(_,d))},[e,F,ae,A]),Le=c.useCallback((d,C)=>ae("usage-scan",d,async _=>(await gt(_,d,C)).asset),[ae]),Te=c.useCallback(d=>{x(d),b(null)},[]),Be=c.useCallback(d=>{l(d),b(null)},[]),Ue=c.useCallback(d=>{jt(d)&&$(d)},[]),Ee=c.useCallback(d=>{if(d===null){b(null);return}const _=e.find(k=>te(k)===d)??e.find(k=>k.id===d);b(_?te(_):d)},[e]);return{assets:e,totalCount:r,selectedAsset:A,selectedAssetId:h,selectedAssetKey:o,scope:f,categoryFilter:p,availablePlaces:V,selectedPlaceId:y,activePlaceId:T,activePlaceName:q,selectedPlaceIsConnected:D,studioConnected:K,loading:J,busyAction:w,error:j,lastMessage:i,setScope:Te,setSelectedPlaceId:Be,setCategoryFilter:Ue,selectAsset:Ee,refresh:ee,rescan:ie,exportSelectionRbxm:we,updateMetadata:Re,uploadAsset:fe,deleteAsset:be,importRbxm:ye,generateThumbnail:je,refreshStatus:$e,scanUsage:Le}}const ks="weppy-assets-view-preferences-v1",he={organizationMode:"folders",viewMode:"grid",gridSize:"medium"};function Yr(e){return e==="folders"||e==="all-assets"}function qr(e){return e==="grid"||e==="list"}function Xr(e){return e==="small"||e==="medium"||e==="large"}function Jr(){if(typeof window>"u")return he;try{const e=window.localStorage.getItem(ks);if(!e)return he;const t=JSON.parse(e);return{organizationMode:Yr(t.organizationMode)?t.organizationMode:he.organizationMode,viewMode:qr(t.viewMode)?t.viewMode:he.viewMode,gridSize:Xr(t.gridSize)?t.gridSize:he.gridSize}}catch{return he}}function Zr(){const[e,t]=c.useState(Jr);return c.useEffect(()=>{try{window.localStorage.setItem(ks,JSON.stringify(e))}catch{}},[e]),{...e,setOrganizationMode:r=>{t(n=>({...n,organizationMode:r}))},setViewMode:r=>{t(n=>({...n,viewMode:r}))},setGridSize:r=>{t(n=>({...n,gridSize:r}))}}}function Qr(e,t){return t("assets.count.shown","Shown assets: {count}").replace("{count}",String(e))}function eo(e,t){return e===null?null:t("assets.place.id","Place ID {placeId}").replace("{placeId}",String(e))}function po(){const{t:e}=pe(),{trackEvent:t}=$s(),{tier:r,loading:n}=Ls(),o=Vr(),b=Zr(),[f,x]=c.useState(!1),[p,$]=c.useState(!1),[V,B]=c.useState(!1),R=!n&&r==="pro",l=o.selectedAsset,y=(l==null?void 0:l.file.original.toLowerCase().endsWith(".rbxm"))??!1,N=(l==null?void 0:l.category)==="model"||(l==null?void 0:l.category)==="animation",T="game.Workspace",q=!!(R&&o.studioConnected&&l&&y&&N),z=o.availablePlaces??[],D=o.selectedPlaceId??o.activePlaceId,U=o.selectedAssetKey??(l?te(l):null),K=c.useCallback(()=>{o.selectAsset(null)},[o.selectAsset]),M=c.useMemo(()=>o.scope==="shared"?[e("assets.scope.shared","Shared")]:o.scope==="all"?[e("assets.scope.all","All scopes"),o.activePlaceName??e("assets.scope.place","Current Place"),e("assets.scope.shared","Shared")]:[o.activePlaceName??e("assets.scope.place","Current Place"),eo(o.activePlaceId,e)].filter(j=>!!j),[o.activePlaceId,o.activePlaceName,o.scope,e]),J=o.scope==="place"&&typeof D=="number"?o.selectedPlaceIsConnected?e("placeScope.connected","Studio connected"):e("placeScope.stored","Stored data"):null,P=c.useMemo(()=>ze(o.categoryFilter,e),[o.categoryFilter,e]),w=Qr(o.totalCount,e),E=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(Us,{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:r}}),s.jsxs("div",{className:a.toolbarShell,children:[s.jsxs("div",{className:a.toolbar,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")}):z.length>0?s.jsxs("label",{className:a.placeSelectorLabel,children:[s.jsx("span",{children:e("assets.place.selector","Asset place")}),s.jsx("select",{className:a.placeSelect,value:typeof D=="number"?String(D):"",onChange:j=>{const g=Number.parseInt(j.currentTarget.value,10);Number.isInteger(g)&&o.setSelectedPlaceId(g)},children:s.jsx(Es,{places:z,t:e})})]}):s.jsx("span",{className:a.sharedPlaceContext,children:o.activePlaceName??e("assets.scope.place","Current Place")})}),s.jsxs("div",{className:a.listContextSummary,children:[J?s.jsxs(s.Fragment,{children:[s.jsx(_e,{variant:o.selectedPlaceIsConnected?"success":"neutral",shape:"pill",children:J}),s.jsx("span",{className:a.contextDivider,children:" · "})]}):null,M.map((j,g)=>s.jsxs("span",{children:[g>0?s.jsx("span",{className:a.contextDivider,children:" · "}):null,j]},`${j}-${g}`)),s.jsx("span",{className:a.contextDivider,children:" · "}),s.jsx("span",{children:P}),s.jsx("span",{className:a.contextDivider,children:" · "}),s.jsx("strong",{children:w})]}),s.jsxs("div",{className:a.toolbarActions,children:[s.jsx(Z,{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(ms,{size:15}),e("assets.rescan","Rescan")]})}),s.jsx(Z,{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"}),$(j=>!j)},"aria-label":e("assets.settings.open","Open settings"),"aria-controls":"asset-library-settings-panel","aria-expanded":p,children:s.jsx(hs,{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:ys.map(j=>{const g=o.categoryFilter===j,i=ze(j,e);return s.jsx("button",{type:"button",role:"radio","aria-checked":g,className:[a.categoryButton,g?a.categoryButtonActive:""].filter(Boolean).join(" "),onClick:()=>{o.setCategoryFilter(j)},children:i},j)})})]})]}),s.jsx(Er,{open:p,tier:r,onClose:()=>$(!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&&!n&&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(er,{displayScope:o.scope,assets:o.assets,place:{placeId:o.activePlaceId,placeName:o.activePlaceName},categoryFilter:o.categoryFilter,organizationMode:b.organizationMode,viewMode:b.viewMode,gridSize:b.gridSize,selectedAssetKey:U,onSelectAsset:o.selectAsset,onClearSelection:K,onOrganizationModeChange:b.setOrganizationMode,onViewModeChange:b.setViewMode,onGridSizeChange:b.setGridSize,emptyContent:o.error?void 0:s.jsx(tr,{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(fr,{asset:f||p||V?null:l,busyAction:o.busyAction,canUpload:R,canImportRbxm:q,importRbxmTooltip:E,importRbxmTargetParent:T,onClose:()=>o.selectAsset(null),onSave:async(j,g)=>{l&&await o.updateMetadata(l.id,{displayName:j,description:g})},onUpload:()=>x(!0),onDelete:()=>B(!0),onImportRbxm:async()=>{l&&(t("dashboard_click_event",{click_target:"assets_import_rbxm",page:"assets"}),await o.importRbxm(l.id,{targetParent:T}))},onRefreshStatus:async()=>{l&&await o.refreshStatus(l.id)},onScanUsage:async()=>{l&&(t("dashboard_click_event",{click_target:"assets_usage_scan",page:"assets"}),await o.scanUsage(l.id,o.activePlaceId??void 0))}}),s.jsx(gs,{open:V&&!!l,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:()=>{l&&(t("dashboard_click_event",{click_target:"assets_delete",page:"assets"}),o.deleteAsset(l.id).then(j=>{j&&B(!1)}))}}),s.jsx($r,{asset:l,open:f,canUpload:R,busyAction:o.busyAction,onClose:()=>{x(!1),o.selectAsset(null)},onBack:()=>x(!1),onOpenSettings:()=>{x(!1),$(!0)},onUpload:async j=>{if(!l)return;t("dashboard_click_event",{click_target:"assets_upload_submit",page:"assets"}),await o.uploadAsset(l.id,j)&&x(!1)}})]})}export{po as Component};
@@ -0,0 +1 @@
1
+ import{r as o,b as P,D as Q,u as q,j as e,X as W,a as X,o as Y,c as J,e as ee,i as te,T as ae}from"./index-ZP3F-qh6.js";import{B as ne,P as se}from"./PageHeader-C1A4pFFD.js";import{C as ie}from"./ConfirmModal-CL0Z5xwJ.js";import{C as ce}from"./CurrentPlaceScope-CHRh7s-z.js";import{T as O}from"./TooltipText-INE_h7BS.js";import{C as oe,T as re}from"./Tabs-C0QQfjUl.js";import{I as le}from"./InfoLabel-BaayM8hW.js";import{G as de}from"./GameChangeDetail-CbYXbvWl.js";import"./ConfirmModal.module-DJksQHBd.js";import"./PlaceSelectOptions-DU7Ka-gE.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 +1 @@
1
- import{r as t,j as s}from"./index-UFZ5peom.js";import{s as r}from"./ConfirmModal.module-DJksQHBd.js";function D({open:a,title:y,message:E,cancelLabel:R,confirmLabel:j,loading:n=!1,onCancel:c,onConfirm:k}){const i=t.useId(),o=t.useRef(null),f=t.useRef(null),d=t.useRef(null),m=t.useRef(c),h=t.useRef(n);return m.current=c,h.current=n,t.useEffect(()=>{var b;if(!a)return;d.current=document.activeElement instanceof HTMLElement?document.activeElement:null,(b=f.current)==null||b.focus();const l=e=>{if(e.key==="Escape"){e.preventDefault(),h.current||m.current();return}if(e.key!=="Tab"||!o.current)return;const u=Array.from(o.current.querySelectorAll("button:not([disabled])"));if(u.length===0){e.preventDefault(),o.current.focus();return}const p=u[0],x=u[u.length-1];e.shiftKey&&document.activeElement===p?(e.preventDefault(),x.focus()):!e.shiftKey&&document.activeElement===x&&(e.preventDefault(),p.focus())};return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l);const e=d.current;e&&document.contains(e)&&e.focus()}},[a]),a?s.jsx("div",{className:r.backdrop,onClick:n?void 0:c,children:s.jsxs("div",{ref:o,className:r.modal,role:"dialog","aria-modal":"true","aria-labelledby":i,tabIndex:-1,onClick:l=>l.stopPropagation(),children:[s.jsx("h2",{id:i,className:r.title,children:y}),s.jsx("p",{className:r.message,children:E}),s.jsxs("div",{className:r.actions,children:[s.jsx("button",{ref:f,className:r.cancelButton,onClick:c,disabled:n,children:R}),s.jsx("button",{className:r.confirmButton,onClick:k,disabled:n,children:n?"...":j})]})]})}):null}export{D as C};
1
+ import{r as t,j as s}from"./index-ZP3F-qh6.js";import{s as r}from"./ConfirmModal.module-DJksQHBd.js";function D({open:a,title:y,message:E,cancelLabel:R,confirmLabel:j,loading:n=!1,onCancel:c,onConfirm:k}){const i=t.useId(),o=t.useRef(null),f=t.useRef(null),d=t.useRef(null),m=t.useRef(c),h=t.useRef(n);return m.current=c,h.current=n,t.useEffect(()=>{var b;if(!a)return;d.current=document.activeElement instanceof HTMLElement?document.activeElement:null,(b=f.current)==null||b.focus();const l=e=>{if(e.key==="Escape"){e.preventDefault(),h.current||m.current();return}if(e.key!=="Tab"||!o.current)return;const u=Array.from(o.current.querySelectorAll("button:not([disabled])"));if(u.length===0){e.preventDefault(),o.current.focus();return}const p=u[0],x=u[u.length-1];e.shiftKey&&document.activeElement===p?(e.preventDefault(),x.focus()):!e.shiftKey&&document.activeElement===x&&(e.preventDefault(),p.focus())};return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l);const e=d.current;e&&document.contains(e)&&e.focus()}},[a]),a?s.jsx("div",{className:r.backdrop,onClick:n?void 0:c,children:s.jsxs("div",{ref:o,className:r.modal,role:"dialog","aria-modal":"true","aria-labelledby":i,tabIndex:-1,onClick:l=>l.stopPropagation(),children:[s.jsx("h2",{id:i,className:r.title,children:y}),s.jsx("p",{className:r.message,children:E}),s.jsxs("div",{className:r.actions,children:[s.jsx("button",{ref:f,className:r.cancelButton,onClick:c,disabled:n,children:R}),s.jsx("button",{className:r.confirmButton,onClick:k,disabled:n,children:n?"...":j})]})]})}):null}export{D as C};
@@ -1,4 +1,4 @@
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-UFZ5peom.js";import{I as u}from"./InfoLabel-Duu_xBC8.js";import{P as uo}from"./PageHeader-DCh0GrcW.js";import{S as to}from"./StatusBadge-DB7SzHxU.js";import{T as X}from"./TooltipText-B2gmJunf.js";import{C as J}from"./ConfirmModal-Dp7bIaIr.js";import{f as no,u as ho}from"./useLiveUptime-hS0F15wX.js";import{B as yo}from"./bot-DRBnM_Dv.js";import{C as V}from"./copy-DGkh5PJA.js";import"./ConfirmModal.module-DJksQHBd.js";/**
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-ZP3F-qh6.js";import{I as u}from"./InfoLabel-BaayM8hW.js";import{P as uo}from"./PageHeader-C1A4pFFD.js";import{S as to}from"./StatusBadge-CiHSf_o_.js";import{T as X}from"./TooltipText-INE_h7BS.js";import{C as J}from"./ConfirmModal-CL0Z5xwJ.js";import{f as no,u as ho}from"./useLiveUptime-CBpmama-.js";import{B as yo}from"./bot-TMxhORyF.js";import{C as V}from"./copy-BENnfclm.js";import"./ConfirmModal.module-DJksQHBd.js";/**
2
2
  * @license lucide-react v1.8.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.