@weppy/roblox-mcp 2.8.0 → 2.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dashboard/dist/assets/AssetsPage-yddSUaZg.js +51 -0
- package/dashboard/dist/assets/{ChangelogDetailPage-BQu8E3gB.js → ChangelogDetailPage-BiiG5ZpO.js} +1 -1
- package/dashboard/dist/assets/{ChangelogPage-BYIOvsqN.js → ChangelogPage-oIxW8_VE.js} +1 -1
- package/dashboard/dist/assets/{ConfirmModal-DSKr5eS9.js → ConfirmModal-CpImpY9c.js} +1 -1
- package/dashboard/dist/assets/{ConnectionPage-OvC9gL_W.js → ConnectionPage-zGBwRnwi.js} +1 -1
- package/dashboard/dist/assets/{GameChangeDetail-BmXlRT3i.js → GameChangeDetail-CghOvUm8.js} +1 -1
- package/dashboard/dist/assets/{InfoLabel-CldY9uOT.js → InfoLabel-Cyz7d4Kc.js} +1 -1
- package/dashboard/dist/assets/{OverviewPage-Cdw1CYe4.js → OverviewPage-B6ZL_JXU.js} +1 -1
- package/dashboard/dist/assets/PageHeader-CThGgsAt.js +6 -0
- package/dashboard/dist/assets/{PlaytestPage-azdyKqSE.js → PlaytestPage-CQqE8m04.js} +1 -1
- package/dashboard/dist/assets/{SettingsPage-BLPo-MfN.js → SettingsPage-DX6vgUTw.js} +1 -1
- package/dashboard/dist/assets/{StatusBadge-DxlagIzF.js → StatusBadge-CkLieULy.js} +1 -1
- package/dashboard/dist/assets/{SyncPage-DtqIcJ5z.js → SyncPage-cfQ-4IDk.js} +1 -1
- package/dashboard/dist/assets/{Tabs-BgJY0tsU.js → Tabs-BhkhdCvF.js} +1 -1
- package/dashboard/dist/assets/{ToolsPage-BEq7XLqc.js → ToolsPage-B004HHzX.js} +1 -1
- package/dashboard/dist/assets/{TooltipText-DazmfUnr.js → TooltipText-H3YSCbob.js} +1 -1
- package/dashboard/dist/assets/{UiStudioPage-BR3NgjBs.js → UiStudioPage-CwURRVO9.js} +2 -2
- package/dashboard/dist/assets/WhatsNewPage-CBUk7WTn.js +1 -0
- package/dashboard/dist/assets/index-CjzKb5lS.css +1 -0
- package/dashboard/dist/assets/index-DG2RrKOl.js +532 -0
- package/dashboard/dist/assets/{sample-requests-Cq6wCxhD.js → sample-requests-D1b5Z8FU.js} +1 -1
- package/dashboard/dist/assets/{useLiveUptime-Dg607eVr.js → useLiveUptime-BHqJirBV.js} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/dist/index.js +96 -92
- package/package.json +1 -1
- package/roblox-plugin/WeppyRobloxMCP.rbxm +0 -0
- package/dashboard/dist/assets/AssetsPage-B1-IkNLs.js +0 -56
- package/dashboard/dist/assets/PageHeader-ueZvp6K9.js +0 -11
- package/dashboard/dist/assets/WhatsNewPage-BGAIXqWd.js +0 -1
- package/dashboard/dist/assets/index-1ZlHj3-1.js +0 -523
- package/dashboard/dist/assets/index-BdS5zBaA.css +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weppy/roblox-mcp",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.1",
|
|
4
4
|
"description": "MCP (Model Context Protocol) server for Roblox Studio integration - enables AI coding agents to interact with Roblox Studio in real-time",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
Binary file
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import{q as Q,a as w,s as be,u as he,j as t,P as dt,I as ut,r as i,R as He,E as pt,t as Ke,k as ht,i as mt,m as gt}from"./index-1ZlHj3-1.js";import{C as Ge}from"./ConfirmModal-DSKr5eS9.js";import{X as ke,D as Pe,P as xt}from"./PageHeader-ueZvp6K9.js";import{T as H}from"./TooltipText-DazmfUnr.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 bt=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],yt=Q("arrow-left",bt);/**
|
|
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 ft=[["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"}]],jt=Q("audio-lines",ft);/**
|
|
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 vt=[["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"}]],Ct=Q("badge",vt);/**
|
|
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 _t=[["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"}]],St=Q("box",_t);/**
|
|
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 At=[["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"}]],Nt=Q("clapperboard",At);/**
|
|
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 kt=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],We=Q("copy",kt);/**
|
|
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 It=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Pt=Q("download",It);/**
|
|
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 Rt=[["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"}]],wt=Q("film",Rt);/**
|
|
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 $t=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Lt=Q("search",$t);/**
|
|
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 Bt=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Dt=Q("trash-2",Bt);/**
|
|
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 Et=[["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"}]],Ut=Q("upload",Et);function ze(e){if(e.scope==="place"&&typeof e.placeId=="number")return{placeId:String(e.placeId)}}function ee(e){const a=ze(e);return a?`?placeId=${encodeURIComponent(a.placeId)}`:""}function ye(e){return`/api/assets/${encodeURIComponent(e.scope)}/${encodeURIComponent(e.category)}`}function ce(e,a){return`${ye(e)}/${encodeURIComponent(a)}`}async function Tt(e){return w.get(ye(e),ze(e))}async function Ot(e){return w.post(`${ye(e)}/rescan${ee(e)}`,{})}async function Ft(e,a,u){return(await w.patch(`${ce(e,a)}${ee(e)}`,u)).asset}async function Mt(e,a){return w.delete(`${ce(e,a)}${ee(e)}`)}async function Ht(e,a,u){return(await w.post(`${ce(e,a)}/upload${ee(e)}`,u)).asset}async function Re(e,a){return(await w.post(`${ce(e,a)}/status-refresh${ee(e)}`,{})).asset}async function Kt(e,a,u){const o={...e,placeId:u??e.placeId};return w.post(`${ce(e,a)}/usage-scan${ee(o)}`,{})}async function Gt(e,a){return w.post(`${ye(e)}/export-selection-rbxm${ee(e)}`,a)}async function Wt(e,a,u){return w.post(`${ce(e,a)}/import-rbxm${ee(e)}`,u)}async function zt(e,a){return(await w.post(`${ce(e,a)}/thumbnail-generate${ee(e)}`,{})).asset}function Ve(e){return e.fileUrl?`${be}${e.fileUrl}`:`${be}/api/assets/${e.scope.kind}/${e.category}/${encodeURIComponent(e.id)}/file${ee({scope:e.scope.kind,placeId:e.scope.kind==="place"?e.scope.placeId:void 0})}`}function Ye(e){return e.previewUrl?`${be}${e.previewUrl}`:`${be}/api/assets/${e.scope.kind}/${e.category}/${encodeURIComponent(e.id)}/preview${ee({scope:e.scope.kind,placeId:e.scope.kind==="place"?e.scope.placeId:void 0})}`}const Xe=["all","image","decal","rbxm"],Vt=new Set(Xe),we=["model","animation"];function ge(e){return/\.(rbxm|rbxmx)$/i.test(e.file.original)}function Yt(e){return Vt.has(e)}function Ae(e,a){return e==="all"?a("assets.category.all","All"):a(`assets.category.${e}`,e==="rbxm"?"RBXM":e)}function ie(e,a){return Ae(ge(e)?"rbxm":e.category,a)}function $e(e){return e==="all"?["image","decal",...we]:e==="rbxm"?we:[e]}function Xt(e,a){return a==="all"?e.category==="image"||e.category==="decal"||ge(e):a==="rbxm"?ge(e):(a==="model"||a==="animation")&&ge(e)?!1:e.category===a}function qt(e){return[...e].sort((a,u)=>u.createdAt.localeCompare(a.createdAt)||u.id.localeCompare(a.id))}const Zt="_page_8op6c_1",Jt="_experimentalBadge_8op6c_9",Qt="_toolbarShell_8op6c_23",es="_toolbar_8op6c_23",ts="_segmented_8op6c_39",ss="_listContextSummary_8op6c_43",as="_toolbarActions_8op6c_49",os="_categoryControl_8op6c_54",ns="_contextDivider_8op6c_76",rs="_categoryControlLabel_8op6c_80",ls="_categoryRail_8op6c_86",is="_categoryButton_8op6c_94",cs="_categoryButtonActive_8op6c_123",ds="_actionRow_8op6c_130",us="_copyRow_8op6c_131",ps="_buttonRow_8op6c_132",hs="_segmentedActive_8op6c_163",ms="_filterLabel_8op6c_168",gs="_commandButton_8op6c_186",xs="_primaryButton_8op6c_187",bs="_iconButton_8op6c_188",ys="_dangerButton_8op6c_228",fs="_iconButtonActive_8op6c_238",js="_grid_8op6c_251",vs="_assetCard_8op6c_257",Cs="_assetCardSelected_8op6c_271",_s="_thumbnailWrap_8op6c_276",Ss="_thumbnail_8op6c_276",As="_thumbnailFallback_8op6c_292",Ns="_assetCardBody_8op6c_303",ks="_assetName_8op6c_310",Is="_assetMeta_8op6c_318",Ps="_statusChip_8op6c_325",Rs="_categoryPill_8op6c_326",ws="_status_uploaded_8op6c_339",$s="_status_failed_8op6c_344",Ls="_status_processing_8op6c_349",Bs="_status_uploading_8op6c_350",Ds="_assetId_8op6c_355",Es="_scopeText_8op6c_356",Us="_muted_8op6c_357",Ts="_emptyState_8op6c_362",Os="_notice_8op6c_363",Fs="_errorState_8op6c_364",Ms="_messageState_8op6c_365",Hs="_proNotice_8op6c_395",Ks="_rbxmGuide_8op6c_411",Gs="_drawer_8op6c_437",Ws="_settingsInlinePanel_8op6c_451",zs="_settingsPopoverIn_8op6c_1",Vs="_settingsDrawer_8op6c_471",Ys="_detailPopupLayer_8op6c_487",Xs="_detailDialog_8op6c_503",qs="_detailDialogHeader_8op6c_520",Zs="_detailTitleBlock_8op6c_531",Js="_detailEyebrow_8op6c_553",Qs="_detailHeaderActions_8op6c_562",ea="_detailDialogBody_8op6c_570",ta="_detailPreviewPane_8op6c_579",sa="_detailPreview_8op6c_579",aa="_detailPreviewFallback_8op6c_591",oa="_detailContentPane_8op6c_627",na="_formStack_8op6c_633",ra="_drawerHeader_8op6c_637",la="_preview_8op6c_660",ia="_previewFallback_8op6c_661",ca="_detailSection_8op6c_688",da="_noticeList_8op6c_689",ua="_settingsPanel_8op6c_690",pa="_setupNotice_8op6c_707",ha="_field_8op6c_732",ma="_fieldLabelRow_8op6c_740",ga="_fieldHelp_8op6c_764",xa="_twoColumn_8op6c_769",ba="_technicalDetails_8op6c_780",ya="_detailGrid_8op6c_797",fa="_metadataList_8op6c_798",ja="_compactMeta_8op6c_809",va="_copyableValue_8op6c_836",Ca="_inlineCopyButton_8op6c_847",_a="_hashText_8op6c_868",Sa="_usageList_8op6c_872",Aa="_usageItem_8op6c_878",Na="_metadataItem_8op6c_879",ka="_settingsSubsection_8op6c_927",Ia="_settingsSectionHeader_8op6c_932",Pa="_settingsDefinitionList_8op6c_945",Ra="_toggleRow_8op6c_967",wa="_inlineHelp_8op6c_981",$a="_headerRow_8op6c_1058",La="_headerMeta_8op6c_1064",s={page:Zt,experimentalBadge:Jt,toolbarShell:Qt,toolbar:es,segmented:ts,listContextSummary:ss,toolbarActions:as,categoryControl:os,contextDivider:ns,categoryControlLabel:rs,categoryRail:ls,categoryButton:is,categoryButtonActive:cs,actionRow:ds,copyRow:us,buttonRow:ps,segmentedActive:hs,filterLabel:ms,commandButton:gs,primaryButton:xs,iconButton:bs,dangerButton:ys,iconButtonActive:fs,grid:js,assetCard:vs,assetCardSelected:Cs,thumbnailWrap:_s,thumbnail:Ss,thumbnailFallback:As,assetCardBody:Ns,assetName:ks,assetMeta:Is,statusChip:Ps,categoryPill:Rs,status_uploaded:ws,status_failed:$s,status_processing:Ls,status_uploading:Bs,assetId:Ds,scopeText:Es,muted:Us,emptyState:Ts,notice:Os,errorState:Fs,messageState:Ms,proNotice:Hs,rbxmGuide:Ks,drawer:Gs,settingsInlinePanel:Ws,settingsPopoverIn:zs,settingsDrawer:Vs,detailPopupLayer:Ys,detailDialog:Xs,detailDialogHeader:qs,detailTitleBlock:Zs,detailEyebrow:Js,detailHeaderActions:Qs,detailDialogBody:ea,detailPreviewPane:ta,detailPreview:sa,detailPreviewFallback:aa,detailContentPane:oa,formStack:na,drawerHeader:ra,preview:la,previewFallback:ia,detailSection:ca,noticeList:da,settingsPanel:ua,setupNotice:pa,field:ha,fieldLabelRow:ma,fieldHelp:ga,twoColumn:xa,technicalDetails:ba,detailGrid:ya,metadataList:fa,compactMeta:ja,copyableValue:va,inlineCopyButton:Ca,hashText:_a,usageList:Sa,usageItem:Aa,metadataItem:Na,settingsSubsection:ka,settingsSectionHeader:Ia,settingsDefinitionList:Pa,toggleRow:Ra,inlineHelp:wa,headerRow:$a,headerMeta:La},Ba={image:ut,decal:Ct,audio:jt,mesh:St,model:dt,video:wt,animation:Nt};function Ne(e,a){return a(`assets.status.${e}`,e)}function Da(e){return e.category==="image"||e.category==="decal"||!!e.file.preview}function Ea(e){return e.category==="decal"?e.roblox.creatorAssetId??e.roblox.assetId:e.roblox.assetId}function Ua({assets:e,selectedAssetId:a,onSelect:u}){const{t:o}=he();return e.length===0?t.jsxs("div",{className:s.emptyState,children:[t.jsx("p",{children:o("assets.empty.title","No assets yet")}),t.jsx("span",{children:o("assets.empty.body","Choose a scope and category, then rescan that inbox folder.")})]}):t.jsx("div",{className:s.grid,children:e.map(l=>{const $=Ba[l.category],C=Ea(l);return t.jsxs("button",{type:"button",className:[s.assetCard,a===l.id?s.assetCardSelected:""].filter(Boolean).join(" "),onClick:()=>u(l.id),children:[t.jsx("span",{className:s.thumbnailWrap,children:Da(l)?t.jsx("img",{className:s.thumbnail,src:Ye(l),alt:l.displayName,loading:"lazy"}):t.jsx("span",{className:s.thumbnailFallback,"aria-hidden":"true",children:t.jsx($,{size:30})})}),t.jsxs("span",{className:s.assetCardBody,children:[t.jsx("span",{className:s.assetName,children:l.displayName}),t.jsxs("span",{className:s.assetMeta,children:[t.jsx("span",{className:s.categoryPill,children:ie(l,o)}),t.jsx("span",{className:`${s.statusChip} ${s[`status_${l.status}`]??""}`,children:Ne(l.status,o)})]}),t.jsxs("span",{className:s.assetMeta,children:[t.jsx("span",{className:s.scopeText,children:l.scope.kind==="shared"?o("assets.scope.shared","Shared"):o("assets.scope.place","Current Place")}),t.jsx("span",{className:s.assetId,children:C?`#${C}`:o("assets.status.localOnly","Local only")})]})]})]},l.id)})})}const Ta="https://create.roblox.com/dashboard/creations/store",Oa=/^https:\/\/create\.roblox\.com\/store\/asset\/\d+(?:\/.*)?$/;function Fa(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function xe(e){const a=new Date(e);if(Number.isNaN(a.getTime()))return e;const u=a.getFullYear(),o=String(a.getMonth()+1).padStart(2,"0"),l=String(a.getDate()).padStart(2,"0"),$=String(a.getHours()).padStart(2,"0"),C=String(a.getMinutes()).padStart(2,"0");return`${u}-${o}-${l} ${$}:${C}`}function Ma(e){return e.category==="image"||e.category==="decal"||!!e.file.preview}function Ha(e){return e.file.preview?Ye(e):Ve(e)}function Ka(e){var u;const a=Object.entries(((u=e.rbxm)==null?void 0:u.classCounts)??{}).sort((o,l)=>l[1]-o[1]).slice(0,8);return a.length===0?"-":a.map(([o,l])=>`${o} ${l}`).join(", ")}function Le(e){var l;const a=(l=e.rbxm)==null?void 0:l.thumbnail;if(!a)return"-";const u=a.source?` via ${a.source}`:"",o=a.message?` · ${a.message}`:"";return`${a.status}${u}${o}`}function Be(e){const{width:a,height:u}=e.file;return a===null||u===null?null:`${a} x ${u}px`}function De(e){const{durationMs:a}=e.file;return a===null?null:a<1e3?`${a} ms`:`${(a/1e3).toFixed(1)} s`}function Ga(e){return`${Ta}/${e}/configure`}function Wa(e){return e.category==="decal"?e.roblox.creatorAssetId??e.roblox.assetId??null:e.roblox.assetId??null}function za(e){const a=Wa(e),u=a?Ga(a):null,o=e.category==="decal"?e.roblox.creatorAssetWebUrl??e.roblox.assetWebUrl:e.roblox.assetWebUrl;return!o||u&&Oa.test(o)?u:o}function Va(e){return`${xe(e.startedAt)} -> ${e.status}`}function Ee(e){return!e.creatorType||!e.creatorId?null:`${e.creatorType} ${e.creatorId}`}function Ue(e){return e.assetRole?`Asset role: ${e.assetRole}`:null}function me({label:e,value:a}){return a?t.jsx("button",{type:"button",className:s.inlineCopyButton,"aria-label":e,title:e,onClick:()=>{var u;return void((u=navigator.clipboard)==null?void 0:u.writeText(a))},children:t.jsx(We,{size:13})}):null}function Ya({asset:e,busyAction:a,canUpload:u,canImportRbxm:o,importRbxmTooltip:l,importRbxmTargetParent:$,onClose:C,onSave:D,onUpload:p,onDelete:G,onImportRbxm:O,onRefreshStatus:U,onScanUsage:m}){var L,A;const{t:n}=he(),W=i.useRef(null),[K,V]=i.useState(""),[F,X]=i.useState("");if(i.useEffect(()=>{V((e==null?void 0:e.displayName)??""),X((e==null?void 0:e.description)??"")},[e==null?void 0:e.description,e==null?void 0:e.displayName,e==null?void 0:e.id]),i.useEffect(()=>{var g;if(!e)return;(g=W.current)==null||g.focus();const r=Z=>{Z.key==="Escape"&&C()};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e,C]),!e)return null;const I=e.status==="processing"&&!!(e.roblox.operationId??e.roblox.operationPath),q=!!e.roblox.assetUri,f=za(e),P=e.roblox.uploadAttempts??[],S=e.category==="decal"&&!!(e.roblox.creatorAssetId||e.roblox.backingImageAssetId||e.roblox.assetId),z=e.roblox.creatorAssetId??e.roblox.assetId,j=e.roblox.backingImageAssetId??e.roblox.assetId,v=e.roblox.assetId?e.usage.lastScannedAt?n("assets.detail.noUsageAfterScan","No references were found in local Sync files during the last check."):n("assets.detail.noUsageUnscanned","Run Scan usage to search local Sync files for this Roblox Asset ID."):n("assets.detail.noUsageNoRobloxId","This asset does not have a Roblox Asset ID yet, so usage cannot be checked. Upload it before scanning usage.");return t.jsx("div",{className:s.detailPopupLayer,onClick:C,role:"presentation",children:t.jsxs("section",{ref:W,className:s.detailDialog,role:"dialog","aria-modal":"true","aria-label":n("assets.detail.title","Asset details"),tabIndex:-1,onClick:r=>r.stopPropagation(),children:[t.jsxs("div",{className:s.detailDialogHeader,children:[t.jsxs("div",{className:s.detailTitleBlock,children:[t.jsxs("span",{className:s.detailEyebrow,children:[ie(e,n)," · ",Ne(e.status,n)]}),t.jsx("h2",{children:e.displayName}),t.jsx("span",{children:e.id})]}),t.jsxs("div",{className:s.detailHeaderActions,children:[t.jsx(H,{text:u?n("assets.upload.open.tooltip","Upload this local file to Roblox through Open Cloud."):n("assets.proOnly.tooltip","Roblox upload is available on Pro."),children:t.jsxs("button",{type:"button",className:s.commandButton,disabled:!u,onClick:p,children:[t.jsx(Ut,{size:15}),n("assets.upload.open","Upload")]})}),o&&t.jsx(H,{text:l,children:t.jsxs("button",{type:"button",className:s.commandButton,disabled:a==="import-rbxm",onClick:()=>void O(),children:[t.jsx(Pt,{size:15}),n("assets.detail.importRbxm","Insert into Studio")]})}),t.jsxs("button",{type:"button",className:s.commandButton,disabled:!I||a==="status-refresh",onClick:()=>void U(),children:[t.jsx(He,{size:15}),n("assets.detail.refreshStatus","Refresh")]}),t.jsxs("button",{type:"button",className:s.commandButton,disabled:!e.roblox.assetId||a==="usage-scan",onClick:()=>void m(),children:[t.jsx(Lt,{size:15}),n("assets.detail.scanUsage","Scan usage")]}),t.jsx(H,{text:n("assets.delete.tooltip","Delete this local Asset Library item."),children:t.jsxs("button",{type:"button",className:`${s.commandButton} ${s.dangerButton}`,disabled:a==="delete",onClick:G,children:[t.jsx(Dt,{size:15}),n("common.delete","Delete")]})}),t.jsx(H,{text:n("common.close","Close"),children:t.jsx("button",{type:"button",className:s.iconButton,onClick:C,"aria-label":n("common.close","Close"),children:t.jsx(ke,{size:16})})})]})]}),t.jsxs("div",{className:s.detailDialogBody,children:[t.jsx("div",{className:s.detailPreviewPane,children:Ma(e)?t.jsx("img",{className:s.detailPreview,src:Ha(e),alt:e.displayName}):t.jsxs("div",{className:s.detailPreviewFallback,children:[t.jsx("span",{children:ie(e,n)}),t.jsx("code",{children:e.file.original}),((L=e.rbxm)==null?void 0:L.thumbnail)&&t.jsx("small",{children:Le(e)})]})}),t.jsxs("div",{className:s.detailContentPane,children:[t.jsxs("div",{className:s.formStack,children:[t.jsxs("label",{className:s.field,children:[t.jsx("span",{children:n("assets.detail.displayName","Display name")}),t.jsx("input",{value:K,onChange:r=>V(r.target.value)})]}),t.jsxs("label",{className:s.field,children:[t.jsx("span",{children:n("assets.detail.description","Description")}),t.jsx("textarea",{value:F,rows:3,onChange:r=>X(r.target.value)})]}),t.jsx("button",{type:"button",className:s.primaryButton,disabled:a==="update",onClick:()=>void D(K,F),children:n("assets.detail.save","Save metadata")})]}),t.jsxs("section",{className:s.detailSection,children:[t.jsx("h3",{children:n("assets.detail.localFile","Local file")}),t.jsxs("dl",{className:s.detailGrid,children:[t.jsx("dt",{children:n("assets.detail.fileName","File")}),t.jsx("dd",{children:e.file.original}),t.jsx("dt",{children:n("assets.detail.source","Source path")}),t.jsx("dd",{children:e.source.originalPath}),t.jsx("dt",{children:n("assets.detail.category","Category")}),t.jsx("dd",{children:ie(e,n)}),t.jsx("dt",{children:n("assets.detail.scope","Scope")}),t.jsx("dd",{children:e.scope.kind==="shared"?n("assets.scope.shared","Shared"):n("assets.scope.place","Current Place")}),t.jsx("dt",{children:n("assets.detail.mimeType","Type")}),t.jsx("dd",{children:e.file.mimeType}),t.jsx("dt",{children:n("assets.detail.size","Size")}),t.jsx("dd",{children:Fa(e.file.sizeBytes)}),Be(e)&&t.jsxs(t.Fragment,{children:[t.jsx("dt",{children:n("assets.detail.dimensions","Dimensions")}),t.jsx("dd",{children:Be(e)})]}),De(e)&&t.jsxs(t.Fragment,{children:[t.jsx("dt",{children:n("assets.detail.duration","Duration")}),t.jsx("dd",{children:De(e)})]})]})]}),e.rbxm&&t.jsxs("section",{className:s.detailSection,children:[t.jsx("h3",{children:n("assets.detail.rbxm","RBXM contents")}),t.jsxs("dl",{className:s.detailGrid,children:[t.jsx("dt",{children:n("assets.detail.rbxmExportedCount","Exported roots")}),t.jsx("dd",{children:e.rbxm.exportedCount}),t.jsx("dt",{children:n("assets.detail.rbxmClasses","Classes")}),t.jsx("dd",{children:Ka(e)}),t.jsx("dt",{children:n("assets.detail.rbxmThumbnail","Thumbnail")}),t.jsx("dd",{children:Le(e)}),o&&t.jsxs(t.Fragment,{children:[t.jsx("dt",{children:n("assets.detail.studioInsertTarget","Studio insert target")}),t.jsx("dd",{children:$})]})]}),e.rbxm.roots.length>0&&t.jsxs("div",{className:s.metadataList,children:[t.jsx("strong",{children:n("assets.detail.rbxmRoots","Root tree")}),e.rbxm.roots.map(r=>t.jsxs("div",{className:s.metadataItem,children:[t.jsxs("span",{children:[r.name," (",r.className,")"]}),t.jsx("code",{children:r.path})]},`${r.path}-${r.className}`))]}),e.rbxm.resourceReferences.length>0&&t.jsxs("div",{className:s.metadataList,children:[t.jsx("strong",{children:n("assets.detail.rbxmReferences","Asset references")}),e.rbxm.resourceReferences.map((r,g)=>t.jsxs("div",{className:s.metadataItem,children:[t.jsxs("span",{children:[r.path," · ",r.property]}),t.jsx("code",{children:r.assetId?`${r.value} (#${r.assetId})`:r.value})]},`${r.path}-${r.property}-${g}`))]})]}),t.jsxs("section",{className:s.detailSection,children:[t.jsx("h3",{children:n("assets.detail.roblox","Roblox upload status")}),t.jsxs("dl",{className:s.detailGrid,children:[t.jsx("dt",{children:n("assets.detail.status","Status")}),t.jsx("dd",{children:Ne(e.status,n)}),S?t.jsxs(t.Fragment,{children:[t.jsx("dt",{children:n("assets.detail.decalAssetId","Roblox Decal ID")}),t.jsxs("dd",{className:s.copyableValue,children:[t.jsx("span",{children:z??n("assets.status.localOnly","Local only")}),t.jsx(me,{label:n("assets.detail.copyDecalAssetId","Copy Roblox Decal ID"),value:z})]}),t.jsx("dt",{children:n("assets.detail.studioTextureImageId","Studio Texture Image ID")}),t.jsxs("dd",{className:s.copyableValue,children:[t.jsx("span",{children:j??"-"}),t.jsx(me,{label:n("assets.detail.copyStudioTextureImageId","Copy Studio Texture Image ID"),value:j})]})]}):t.jsxs(t.Fragment,{children:[t.jsx("dt",{children:n("assets.detail.assetId","Asset ID")}),t.jsxs("dd",{className:s.copyableValue,children:[t.jsx("span",{children:e.roblox.assetId??n("assets.status.localOnly","Local only")}),t.jsx(me,{label:n("assets.detail.copyAssetId","Copy Asset ID"),value:e.roblox.assetId})]})]}),t.jsx("dt",{children:n("assets.detail.studioUri","Studio URI")}),t.jsx("dd",{children:e.roblox.assetUri??"-"}),t.jsx("dt",{children:n("assets.detail.robloxWebUrl","Creator Dashboard URL")}),t.jsxs("dd",{className:s.copyableValue,children:[t.jsx("span",{children:f??"-"}),t.jsx(me,{label:n("assets.detail.copyWebUrl","Copy configure URL"),value:f})]}),e.roblox.errorMessage&&t.jsxs(t.Fragment,{children:[t.jsx("dt",{children:n("assets.detail.error","Error")}),t.jsx("dd",{children:e.roblox.errorMessage})]})]}),t.jsxs("div",{className:s.copyRow,children:[t.jsxs("button",{type:"button",className:s.commandButton,disabled:!q,onClick:()=>{var r;return e.roblox.assetUri&&void((r=navigator.clipboard)==null?void 0:r.writeText(e.roblox.assetUri))},children:[t.jsx(We,{size:15}),n("assets.detail.copyStudioUri","Copy Studio URI")]}),f&&t.jsxs("a",{className:s.commandButton,href:f,target:"_blank",rel:"noreferrer",children:[t.jsx(pt,{size:15}),n("assets.detail.openRobloxPage","Open configure page")]})]}),e.roblox.assetId&&t.jsx("p",{className:s.muted,children:n("assets.detail.robloxWebUrlNotice","Opening this page requires the Roblox account that owns or can manage the uploaded asset.")}),P.length>0&&t.jsxs("div",{className:s.metadataList,children:[t.jsx("strong",{children:n("assets.detail.uploadHistory","Upload history")}),P.slice().reverse().map((r,g)=>t.jsxs("div",{className:s.metadataItem,children:[t.jsx("span",{children:Va(r)}),Ee(r)&&t.jsx("code",{children:Ee(r)}),Ue(r)&&t.jsx("code",{children:Ue(r)}),r.operationPath&&t.jsx("code",{children:r.operationPath}),r.assetId&&t.jsxs("code",{children:[n("assets.detail.assetId","Asset ID"),": ",r.assetId]}),r.remotePath&&t.jsx("code",{children:r.remotePath}),r.message&&t.jsx("code",{children:r.message}),r.errorMessage&&t.jsx("code",{children:r.errorMessage})]},`${r.startedAt}-${r.operationPath??g}`))]})]}),t.jsxs("section",{className:s.detailSection,children:[t.jsx("h3",{children:n("assets.detail.usedInPlace","Where this asset is used in this Place")}),t.jsxs("dl",{className:s.detailGrid,children:[t.jsx("dt",{children:n("assets.detail.usageSource","Checked against")}),t.jsx("dd",{children:e.usage.scanSource==="localSync"?n("assets.detail.usageSource.localSync","Local Sync files"):n("assets.detail.usageSource.notScanned","Not checked yet")}),t.jsx("dt",{children:n("assets.detail.lastScanned","Last checked")}),t.jsx("dd",{children:e.usage.lastScannedAt?n("assets.detail.lastScannedAt","Last checked: {time}").replace("{time}",xe(e.usage.lastScannedAt)):n("assets.detail.lastScanned.never","No check yet")})]}),e.usage.references.length===0?t.jsx("p",{className:s.muted,children:v}):t.jsx("div",{className:s.usageList,children:e.usage.references.map((r,g)=>t.jsxs("div",{className:s.usageItem,children:[t.jsx("strong",{children:r.kind==="property"?r.instancePath:r.filePath}),t.jsx("span",{children:r.property??n("assets.detail.line","line {line}").replace("{line}",String(r.line??"-"))}),t.jsx("code",{children:r.value})]},`${r.kind}-${g}`))})]}),t.jsxs("details",{className:s.technicalDetails,children:[t.jsx("summary",{children:n("assets.detail.technicalDetails","Technical details")}),t.jsxs("dl",{className:s.detailGrid,children:[t.jsx("dt",{children:n("assets.detail.stableId","Stable ID")}),t.jsx("dd",{className:s.hashText,children:e.id}),t.jsx("dt",{children:n("assets.detail.sourceKind","Source kind")}),t.jsx("dd",{children:e.source.kind}),t.jsx("dt",{children:n("assets.detail.sha256","SHA-256")}),t.jsx("dd",{className:s.hashText,children:e.file.sha256}),t.jsx("dt",{children:n("assets.detail.createdAt","Created")}),t.jsx("dd",{children:xe(e.createdAt)}),t.jsx("dt",{children:n("assets.detail.updatedAt","Updated")}),t.jsx("dd",{children:xe(e.updatedAt)}),e.roblox.operationId&&t.jsxs(t.Fragment,{children:[t.jsx("dt",{children:n("assets.detail.operationId","Operation ID")}),t.jsx("dd",{className:s.hashText,children:e.roblox.operationId})]}),e.roblox.operationPath&&t.jsxs(t.Fragment,{children:[t.jsx("dt",{children:n("assets.detail.operationPath","Operation path")}),t.jsx("dd",{className:s.hashText,children:e.roblox.operationPath})]}),e.roblox.versionId&&t.jsxs(t.Fragment,{children:[t.jsx("dt",{children:n("assets.detail.versionId","Version ID")}),t.jsx("dd",{className:s.hashText,children:e.roblox.versionId})]}),e.roblox.remotePath&&t.jsxs(t.Fragment,{children:[t.jsx("dt",{children:n("assets.detail.remotePath","Remote path")}),t.jsx("dd",{className:s.hashText,children:e.roblox.remotePath})]}),e.roblox.moderationState&&t.jsxs(t.Fragment,{children:[t.jsx("dt",{children:n("assets.detail.moderationState","Moderation")}),t.jsx("dd",{children:e.roblox.moderationState})]})]}),((A=e.rbxm)==null?void 0:A.thumbnail.attempts)&&e.rbxm.thumbnail.attempts.length>0&&t.jsxs("div",{className:s.metadataList,children:[t.jsx("strong",{children:n("assets.detail.rbxmThumbnailAttempts","Thumbnail attempts")}),e.rbxm.thumbnail.attempts.map((r,g)=>t.jsxs("div",{className:s.metadataItem,children:[t.jsxs("span",{children:[r.method," · ",r.status]}),r.message&&t.jsx("code",{children:r.message})]},`${r.method}-${g}`))]})]})]})]})]})})}function qe(e){return{assetUploadByOpenCloudEnabled:e.hot.ENABLE_ASSET_UPLOAD_BY_OPEN_CLOUD===!0}}function Xa(e){const a={};return typeof e.assetUploadByOpenCloudEnabled=="boolean"&&(a.ENABLE_ASSET_UPLOAD_BY_OPEN_CLOUD=e.assetUploadByOpenCloudEnabled),a}async function Ze(){const e=await w.get("/api/dashboard/settings");return qe(e)}async function qa(e){const a=await w.patch("/api/dashboard/settings",Xa(e));return qe(a)}async function Je(){return w.get("/api/dashboard/open-cloud/credential-profiles")}async function Za(e){return w.post("/api/dashboard/open-cloud/credential-profiles",e)}async function Ja(e){return w.patch("/api/dashboard/open-cloud/credential-profiles/active",{profileId:e})}async function Qa(e,a){return w.put(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}/api-key`,a)}async function eo(e){return w.delete(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}`)}async function to(e,a){return w.post(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}/creators`,a)}async function so(e,a){return w.patch(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}/creators/${encodeURIComponent(a)}/default`,{})}async function ao(e,a){return w.delete(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}/creators/${encodeURIComponent(a)}`)}async function oo(e,a){return w.post(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}/test`,a?{creatorPresetId:a}:{})}async function no(e){return w.post("/api/dashboard/open-cloud/credential/test",e?{apiKey:e}:{})}function ro(e){return e.category==="image"||e.category==="decal"}function lo(e,a){return e==="group"?a("assets.creator.group","Group"):a("assets.creator.user","User")}function io(e,a){return`${e.label} · ${lo(e.creatorType,a)} ${e.creatorId}`}function Te(e){if(!e)return null;if(e.defaultCreatorId){const a=e.creators.find(u=>u.id===e.defaultCreatorId);if(a)return a}return e.creators[0]??null}function co({asset:e,open:a,canUpload:u,busyAction:o,onClose:l,onBack:$,onOpenSettings:C,onUpload:D}){const{t:p}=he(),G=i.useRef(null),[O,U]=i.useState(null),[m,n]=i.useState(null),[W,K]=i.useState(!1),[V,F]=i.useState(null),[X,I]=i.useState(""),[q,f]=i.useState(""),[P,S]=i.useState(""),[z,j]=i.useState("user"),[v,L]=i.useState("");if(i.useEffect(()=>{I((e==null?void 0:e.displayName)??""),f((e==null?void 0:e.description)??"")},[e==null?void 0:e.description,e==null?void 0:e.displayName,e==null?void 0:e.id]),i.useEffect(()=>{if(!a)return;let x=!1;return K(!0),F(null),(async()=>{try{const[B,T]=await Promise.all([Ze(),Je()]);if(x)return;U(B);const oe=T.profiles.find(de=>de.id===T.activeProfileId)??T.profiles[0]??null;n(oe);const Y=Te(oe);S((Y==null?void 0:Y.id)??""),j((Y==null?void 0:Y.creatorType)??"user"),L((Y==null?void 0:Y.creatorId)??"")}catch(B){if(x)return;F(B instanceof Error?B.message:p("assets.upload.settingsLoadFailed","Failed to load upload settings.")),U(null),n(null)}finally{x||K(!1)}})(),()=>{x=!0}},[a,p]),i.useEffect(()=>{var B;if(!a||!e)return;(B=G.current)==null||B.focus();const x=T=>{T.key==="Escape"&&l()};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[e,l,a]),!a||!e)return null;const A=(O==null?void 0:O.assetUploadByOpenCloudEnabled)===!0,r=!!m,g=Te(m),Z=(m==null?void 0:m.creators.find(x=>x.id===P))??null,te=!!g,J=(m==null?void 0:m.storageProvider)==="env"&&r&&!te,ae=J&&v.trim().length>0,h=u&&!W&&!V&&(!A||!r||!te&&!J),se=u&&!W&&!V&&A&&r&&(te||ae)&&o!=="upload";return t.jsx("div",{className:s.detailPopupLayer,onClick:l,role:"presentation",children:t.jsxs("section",{ref:G,className:s.detailDialog,role:"dialog","aria-modal":"true","aria-label":p("assets.upload.title","Upload asset"),tabIndex:-1,onClick:x=>x.stopPropagation(),children:[t.jsxs("div",{className:s.detailDialogHeader,children:[t.jsxs("div",{className:s.detailTitleBlock,children:[t.jsxs("span",{className:s.detailEyebrow,children:[ie(e,p)," · ",p("assets.upload.intent","Upload to Roblox")]}),t.jsx("h2",{children:p("assets.upload.title","Upload asset")}),t.jsx("span",{children:e.displayName})]}),t.jsxs("div",{className:s.detailHeaderActions,children:[t.jsxs("button",{type:"button",className:s.commandButton,onClick:$,children:[t.jsx(yt,{size:15}),p("assets.upload.backToDetails","Back to details")]}),t.jsx(H,{text:p("common.close","Close"),children:t.jsx("button",{type:"button",className:s.iconButton,onClick:l,"aria-label":p("common.close","Close"),children:t.jsx(ke,{size:16})})})]})]}),t.jsxs("div",{className:s.detailDialogBody,children:[t.jsx("div",{className:s.detailPreviewPane,children:ro(e)?t.jsx("img",{className:s.detailPreview,src:Ve(e),alt:e.displayName}):t.jsxs("div",{className:s.detailPreviewFallback,children:[t.jsx("span",{children:ie(e,p)}),t.jsx("code",{children:e.file.original})]})}),t.jsxs("div",{className:s.detailContentPane,children:[!u&&t.jsx("div",{className:s.notice,children:p("assets.proOnly.upload","Roblox upload is available on Pro.")}),W&&t.jsx("div",{className:s.notice,children:p("assets.upload.checkingSettings","Checking upload settings...")}),V&&t.jsx("div",{className:s.errorState,children:V}),t.jsxs("dl",{className:s.compactMeta,children:[t.jsx("dt",{children:p("assets.detail.category","Category")}),t.jsx("dd",{children:ie(e,p)}),t.jsx("dt",{children:p("assets.detail.source","Source")}),t.jsx("dd",{children:e.source.originalPath})]}),h&&t.jsxs("div",{className:s.setupNotice,children:[t.jsx("strong",{children:p("assets.upload.settingsRequired","Upload settings required")}),t.jsx("p",{children:r?A?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.")}),t.jsxs("button",{type:"button",className:s.commandButton,onClick:C,children:[t.jsx(Ke,{size:15}),p("assets.upload.openSettings","Open Asset Library settings")]})]}),t.jsxs("div",{className:s.formStack,children:[t.jsxs("label",{className:s.field,children:[t.jsx("span",{children:p("assets.detail.displayName","Display name")}),t.jsx("input",{value:X,disabled:!u,onChange:x=>I(x.target.value)}),t.jsx("small",{className:s.fieldHelp,children:p("assets.upload.displayNameHelp","Saved to Roblox as the asset display name.")})]}),t.jsxs("label",{className:s.field,children:[t.jsx("span",{children:p("assets.detail.description","Description")}),t.jsx("textarea",{value:q,rows:3,disabled:!u,onChange:x=>f(x.target.value)}),t.jsx("small",{className:s.fieldHelp,children:p("assets.upload.descriptionHelp","Saved to Roblox as the asset description.")})]}),te&&t.jsxs("label",{className:s.field,children:[t.jsx("span",{children:p("assets.upload.creator","Creator")}),t.jsx("select",{"aria-label":p("assets.upload.creator","Creator"),value:P,disabled:!u||W,onChange:x=>S(x.target.value),children:m==null?void 0:m.creators.map(x=>t.jsx("option",{value:x.id,children:io(x,p)},x.id))}),t.jsx("small",{className:s.fieldHelp,children:p("assets.upload.creatorHelp","Used by Open Cloud as the owner of the uploaded asset.")})]}),J&&t.jsxs(t.Fragment,{children:[t.jsx("p",{className:s.inlineHelp,children:p("assets.upload.envCreatorHelp","Environment API keys cannot save a default Creator here. Enter the Creator for this upload.")}),t.jsxs("div",{className:s.twoColumn,children:[t.jsxs("label",{className:s.field,children:[t.jsx("span",{children:p("assets.upload.creatorType","Creator type")}),t.jsxs("select",{value:z,disabled:!u,onChange:x=>j(x.target.value),children:[t.jsx("option",{value:"user",children:p("assets.creator.user","User")}),t.jsx("option",{value:"group",children:p("assets.creator.group","Group")})]}),t.jsx("small",{className:s.fieldHelp,children:p("assets.upload.creatorTypeHelp","Sent to Open Cloud as the Creator type.")})]}),t.jsxs("label",{className:s.field,children:[t.jsx("span",{children:p("assets.upload.creatorId","Creator ID")}),t.jsx("input",{value:v,disabled:!u,onChange:x=>L(x.target.value)}),t.jsx("small",{className:s.fieldHelp,children:p("assets.upload.creatorIdHelp","Sent to Open Cloud as the User or Group ID that owns the uploaded asset.")})]})]})]}),t.jsx("button",{type:"button",className:s.primaryButton,disabled:!se,onClick:()=>{const x=v.trim(),B=J&&x?{creatorType:z,creatorId:x}:{},T=!J&&Z&&g&&Z.id!==g.id?{creatorType:Z.creatorType,creatorId:Z.creatorId}:{};D({displayName:X,description:q,...B,...T})},children:o==="upload"?p("assets.upload.uploading","Uploading..."):p("assets.upload.submit","Upload with Roblox Open Cloud")})]}),t.jsxs("div",{className:s.noticeList,children:[t.jsx("p",{children:p("assets.upload.noDelete","WEPPY does not provide Roblox asset deletion.")}),t.jsx("p",{children:p("assets.upload.delay","Roblox processing and moderation can delay visibility in Studio or Creator Dashboard.")})]})]})]})]})})}function Oe(e,a){return e==="env"?a("assets.settings.credential.env","Environment variable"):a("assets.settings.credential.local","Local encrypted file")}function ve(e,a){return e==="valid"?a("assets.settings.validation.valid","Connected"):e==="invalid"?a("assets.settings.validation.invalid","Needs attention"):a("assets.settings.validation.unknown","Not tested")}function uo(e,a){return(e==null?void 0:e.status)==="valid"?a("assets.settings.apiKeyTested","Open Cloud API key connection tested."):(e==null?void 0:e.message)??a("assets.settings.tested","Connection tested.")}function po(e,a){return(e==null?void 0:e.status)==="valid"?a("assets.settings.apiKeyTested","Open Cloud API key connection tested."):(e==null?void 0:e.message)??a("assets.settings.tested","Connection tested.")}function ho(e,a){return e==="group"?a("assets.creator.group","Group"):a("assets.creator.user","User")}function mo(e,a){return`${ho(e.creatorType,a)} ${e.creatorId}`}function go({open:e,tier:a,onClose:u}){const{t:o}=he(),[l,$]=i.useState(null),[C,D]=i.useState(null),[p,G]=i.useState(""),[O,U]=i.useState(!1),[m,n]=i.useState(""),[W,K]=i.useState(""),[V,F]=i.useState("user"),[X,I]=i.useState(""),[q,f]=i.useState(""),[P,S]=i.useState(!0),[z,j]=i.useState(null),[v,L]=i.useState(null),[A,r]=i.useState(!1),g=a==="basic",Z=i.useCallback(async()=>{r(!0),j(null);try{const[d,N]=await Promise.all([Ze(),Je()]);$(d),D(N);const R=N.profiles.find(re=>re.id===N.activeProfileId)??N.profiles[0]??null;G((R==null?void 0:R.id)??""),U(!R),S(!R||R.creators.length===0),F("user"),I(""),f("")}catch(d){j(d instanceof Error?d.message:o("assets.settings.loadFailed","Failed to load upload settings."))}finally{r(!1)}},[o]);if(i.useEffect(()=>{e&&Z()},[Z,e]),!e)return null;const te=(l==null?void 0:l.assetUploadByOpenCloudEnabled)===!0,E=W.trim(),J=X.trim(),ae=(C==null?void 0:C.profiles)??[],h=ae.find(d=>d.id===p)??ae[0]??null,se=!!h,x=se&&(h==null?void 0:h.storageProvider)==="localFile",B=se&&(h==null?void 0:h.storageProvider)==="env",T=h!=null&&h.defaultCreatorId?h.creators.find(d=>d.id===h.defaultCreatorId):h==null?void 0:h.creators[0],oe=!!(h!=null&&h.creators.length),Y=!oe||P,de=ae.length>1,ne=g?o("assets.settings.action.proRequired","Asset upload settings are available on Pro."):A?o("assets.settings.action.busy","Wait for the current settings action to finish."):null,c=g||A||!E,y=ne??(E?o("assets.settings.saveApiKey.tooltip.ready","Save this API key to local encrypted storage."):o("assets.settings.saveApiKey.tooltip.enter","Enter an Open Cloud API key to save it locally.")),b=g||A||!E&&!se,_=ne??(E?o("assets.settings.testConnection.tooltip.entered","Test the entered API key before saving it."):se?o("assets.settings.testConnection.tooltip.saved","Test the saved Open Cloud API key."):o("assets.settings.testConnection.tooltip.enterOrSaved","Enter an API key or save one before testing the connection.")),k=g||A||!x,M=ne??(x?o("assets.settings.removeApiKey.tooltip.ready","Remove the locally saved Open Cloud API key."):B?o("assets.settings.removeApiKey.tooltip.env","Environment API keys cannot be removed from Dashboard. Remove ROBLOX_OPEN_CLOUD_API_KEY outside WEPPY."):o("assets.settings.removeApiKey.tooltip.none","No local Open Cloud API key is saved.")),ue=g||A||!x||!J,Qe=ne??(B?o("assets.settings.saveCreator.tooltip.env","Environment API keys cannot save a default Creator here. Enter Creator details in the upload dialog."):x?J?o("assets.settings.saveCreator.tooltip.ready","Save this Creator as the default owner for uploads."):o("assets.settings.saveCreator.tooltip.enterId","Enter a user or group ID before saving the default Creator."):o("assets.settings.saveCreator.tooltip.noLocal","Save a local Open Cloud API key before saving a default Creator.")),et=ne??(x?o("assets.settings.addCreator.tooltip.ready","Add another User or Group Creator preset to this profile."):o("assets.settings.saveCreator.tooltip.noLocal","Save a local Open Cloud API key before saving a default Creator.")),tt=g||A||B||!x,st=ne??(x?o("assets.settings.unregisterCreator.tooltip.ready","Unregister this Creator from the selected profile."):B?o("assets.settings.saveCreator.tooltip.env","Environment API keys cannot save a default Creator here. Enter Creator details in the upload dialog."):o("assets.settings.saveCreator.tooltip.noLocal","Save a local Open Cloud API key before saving a default Creator.")),at=T?o("assets.settings.saveCreatorPreset","Save Creator"):o("assets.settings.saveCreator","Save default Creator"),ot=(h==null?void 0:h.label)??o("assets.settings.credential.none","No API key saved"),fe=d=>{const N=d.profiles.find(R=>R.id===d.activeProfileId)??d.profiles[0]??null;D(d),G((N==null?void 0:N.id)??""),S(!N||N.creators.length===0),U(d.profiles.length===0)},nt=async()=>{if(h){r(!0);try{const d=await oo(h.id,T==null?void 0:T.id);fe(d),j(po(d.validation,o))}catch(d){j(d instanceof Error?d.message:o("assets.settings.testFailed","Connection test failed."))}finally{r(!1)}}},rt=async()=>{if(v){r(!0);try{if(v.kind==="apiKey"){const d=await eo(v.profileId);fe(d),j(o("assets.settings.apiKeyRemoved","Open Cloud API key unregistered from local storage."))}else{const d=await ao(v.profileId,v.creatorPresetId);fe(d),j(o("assets.settings.creatorUnregistered","Creator unregistered from this profile."))}L(null)}catch(d){j(d instanceof Error?d.message:v.kind==="apiKey"?o("assets.settings.removeFailed","Failed to unregister API key."):o("assets.settings.creatorUnregisterFailed","Failed to unregister Creator."))}finally{r(!1)}}},lt=(v==null?void 0:v.kind)==="apiKey"?o("assets.settings.unregisterApiKey.title","Unregister API Key?"):o("assets.settings.unregisterCreator.title","Unregister Creator?"),it=(v==null?void 0:v.kind)==="apiKey"?o("assets.settings.unregisterApiKey.message","Roblox API key is not revoked. WEPPY only removes the local Credential Profile registration on this device."):o("assets.settings.unregisterCreator.message","Roblox user or group is not deleted. WEPPY only removes this Creator from the selected API Key profile."),ct=(v==null?void 0:v.kind)==="apiKey"?o("assets.settings.removeApiKey","Unregister API Key"):o("assets.settings.unregisterCreator","Unregister Creator");return t.jsxs("section",{id:"asset-library-settings-panel",className:`${s.settingsInlinePanel} ${s.settingsDrawer}`,role:"region","aria-label":o("assets.settings.title","Asset Library settings"),"data-panel-placement":"toolbar-popover",children:[t.jsxs("div",{className:s.drawerHeader,children:[t.jsxs("div",{children:[t.jsx("h2",{children:o("assets.settings.title","Asset Library settings")}),t.jsx("span",{children:ot})]}),t.jsx(H,{text:o("common.close","Close"),children:t.jsx("button",{type:"button",className:s.iconButton,onClick:u,"aria-label":o("common.close","Close"),children:t.jsx(ke,{size:16})})})]}),g&&t.jsx("div",{className:`${s.notice} ${s.proNotice}`,children:o("assets.settings.proOnly","Roblox upload settings and Open Cloud credential controls are available on Pro.")}),t.jsxs("section",{className:s.settingsPanel,children:[t.jsxs("label",{className:s.toggleRow,children:[t.jsxs("span",{children:[t.jsx("strong",{children:o("assets.settings.openCloudToggle","Open Cloud upload")}),t.jsx("small",{children:o("assets.settings.openCloudToggle.help","Controls whether server-side Open Cloud upload mutations can run.")})]}),t.jsx("input",{type:"checkbox",checked:te,disabled:g||A,onChange:d=>{(async()=>{r(!0);try{const N=await qa({assetUploadByOpenCloudEnabled:d.target.checked});$(N),j(o("assets.settings.saved","Upload settings saved."))}catch(N){j(N instanceof Error?N.message:o("assets.settings.saveFailed","Failed to save upload settings."))}finally{r(!1)}})()}})]}),de&&t.jsx("div",{className:s.metadataList,children:ae.map(d=>{const N=d.id===(h==null?void 0:h.id);return t.jsxs("div",{className:s.metadataItem,children:[t.jsx("strong",{children:d.label}),t.jsxs("span",{children:[o("assets.settings.field.storage","Storage"),": ",Oe(d.storageProvider,o)]}),t.jsxs("span",{children:[o("assets.settings.field.validationStatus","Validation status"),": ",ve(d.validationStatus,o)]}),N&&t.jsx("code",{children:o("assets.settings.activeProfileBadge","Active")}),!N&&d.storageProvider==="localFile"&&t.jsx("button",{type:"button",className:s.commandButton,disabled:g||A,onClick:()=>{(async()=>{r(!0);try{const R=await Ja(d.id),re=R.profiles.find(je=>je.id===(R.activeProfileId??d.id))??d;D(R),G(re.id),S(re.creators.length===0),F("user"),I(""),f(""),j(o("assets.settings.profileSelected","Open Cloud credential profile selected."))}catch(R){j(R instanceof Error?R.message:o("assets.settings.saveFailed","Failed to save upload settings."))}finally{r(!1)}})()},children:o("assets.settings.useProfile","Use profile")})]},d.id)})}),h&&t.jsxs("div",{className:s.settingsSubsection,children:[t.jsx("div",{className:s.settingsSectionHeader,children:t.jsx("h3",{children:o("assets.settings.credentialProfile","Credential Profile")})}),t.jsxs("div",{className:s.metadataItem,children:[t.jsxs("dl",{className:s.settingsDefinitionList,children:[t.jsxs("div",{children:[t.jsx("dt",{children:o("assets.settings.field.profile","Profile")}),t.jsx("dd",{children:h.label})]}),h.maskedKey&&t.jsxs("div",{children:[t.jsx("dt",{children:o("assets.settings.field.apiKey","API Key")}),t.jsx("dd",{children:h.maskedKey})]}),t.jsxs("div",{children:[t.jsx("dt",{children:o("assets.settings.field.storage","Storage")}),t.jsx("dd",{children:Oe(h.storageProvider,o)})]}),t.jsxs("div",{children:[t.jsx("dt",{children:o("assets.settings.field.validationStatus","Validation status")}),t.jsx("dd",{children:ve(h.validationStatus,o)})]}),t.jsxs("div",{children:[t.jsx("dt",{children:o("assets.settings.field.creators","Creators")}),t.jsx("dd",{children:h.creators.length})]})]}),!O&&t.jsxs("div",{className:s.buttonRow,children:[t.jsx(H,{text:_,children:t.jsx("button",{type:"button",className:s.commandButton,disabled:b,onClick:()=>{nt()},children:o("assets.settings.testConnection","Test Connection")})}),x&&t.jsx("button",{type:"button",className:s.commandButton,disabled:g||A,onClick:()=>U(!0),children:o("assets.settings.replaceApiKey","Replace API Key")}),t.jsx(H,{text:M,children:t.jsx("button",{type:"button",className:`${s.commandButton} ${s.dangerButton}`,disabled:k,onClick:()=>L({kind:"apiKey",profileId:h.id}),children:o("assets.settings.removeApiKey","Unregister API Key")})})]})]})]}),O&&t.jsxs("div",{className:s.formStack,children:[t.jsxs("div",{className:s.field,children:[t.jsx("div",{className:s.fieldLabelRow,children:t.jsx("label",{htmlFor:"asset-settings-open-cloud-profile-label",children:o("assets.settings.profileLabel","Profile name")})}),t.jsx("input",{id:"asset-settings-open-cloud-profile-label",value:m,disabled:g||A,onChange:d=>n(d.target.value),placeholder:o("assets.settings.profileLabel.placeholder","Studio automation key")}),t.jsx("p",{className:s.inlineHelp,children:o("assets.settings.profileLabel.help","Optional. If left blank, WEPPY saves this profile as Open Cloud key automatically.")})]}),t.jsxs("div",{className:s.field,children:[t.jsxs("div",{className:s.fieldLabelRow,children:[t.jsx("label",{htmlFor:"asset-settings-open-cloud-api-key",children:o("assets.settings.apiKey","Open Cloud API Key")}),t.jsx(Pe,{topicId:"openCloudApiKey",variant:"field",state:{hasOpenCloudCredential:se}})]}),t.jsx("input",{id:"asset-settings-open-cloud-api-key",value:W,type:"password",disabled:g||A,onChange:d=>K(d.target.value)}),t.jsx("p",{className:s.inlineHelp,children:o("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.")})]}),!se&&t.jsx("p",{className:s.inlineHelp,children:t.jsx("a",{href:"https://create.roblox.com/docs/cloud/auth/api-keys",target:"_blank",rel:"noreferrer",children:o("assets.settings.apiKeyGuide","Create a Roblox API key with Assets Read and Write permissions.")})}),t.jsxs("div",{className:s.buttonRow,children:[t.jsx(H,{text:y,children:t.jsx("button",{type:"button",className:s.commandButton,disabled:c,onClick:()=>{(async()=>{var d;r(!0);try{const N={apiKey:E,...m.trim()?{label:m.trim()}:{}},R=(h==null?void 0:h.storageProvider)==="localFile"?await Qa(h.id,N):await Za(N),re=R.profiles.find(je=>{var Ie;return je.id===(R.activeProfileId??((Ie=R.profile)==null?void 0:Ie.id))});D(R),G(R.activeProfileId??((d=R.profile)==null?void 0:d.id)??""),S(!re||re.creators.length===0),U(!1),K(""),n(""),j(o("assets.settings.apiKeySaved","Open Cloud API key saved locally."))}catch(N){j(N instanceof Error?N.message:o("assets.settings.saveFailed","Failed to save upload settings."))}finally{r(!1)}})()},children:o("assets.settings.saveApiKey","Save API Key")})}),t.jsx(H,{text:_,children:t.jsx("button",{type:"button",className:s.commandButton,disabled:b,onClick:()=>{(async()=>{r(!0);try{const d=await no(E||void 0);j(uo(d.validation,o))}catch(d){j(d instanceof Error?d.message:o("assets.settings.testFailed","Connection test failed."))}finally{r(!1)}})()},children:o("assets.settings.testConnection","Test Connection")})}),t.jsx(H,{text:M,children:t.jsx("button",{type:"button",className:`${s.commandButton} ${s.dangerButton}`,disabled:k,onClick:()=>{h&&L({kind:"apiKey",profileId:h.id})},children:o("assets.settings.removeApiKey","Unregister API Key")})})]})]}),t.jsx("div",{className:s.metadataList,children:h==null?void 0:h.creators.map(d=>t.jsxs("div",{className:s.metadataItem,children:[t.jsx("strong",{children:d.label}),t.jsx("span",{children:mo(d,o)}),d.id===h.defaultCreatorId&&t.jsx("code",{children:o("assets.settings.defaultCreatorBadge","Default")}),t.jsxs("span",{children:[o("assets.settings.field.validationStatus","Validation status"),": ",ve(d.validationStatus,o)]}),t.jsxs("div",{className:s.buttonRow,children:[d.id!==h.defaultCreatorId&&h.storageProvider==="localFile"&&t.jsx("button",{type:"button",className:s.commandButton,disabled:g||A,onClick:()=>{(async()=>{if(h){r(!0);try{const N=await so(h.id,d.id);D(N),j(o("assets.settings.defaultCreatorSaved","Open Cloud default Creator saved locally."))}catch(N){j(N instanceof Error?N.message:o("assets.settings.saveFailed","Failed to save upload settings."))}finally{r(!1)}}})()},children:o("assets.settings.makeDefaultCreator","Make default")}),t.jsx(H,{text:st,children:t.jsx("button",{type:"button",className:`${s.commandButton} ${s.dangerButton}`,disabled:tt,onClick:()=>L({kind:"creator",profileId:h.id,creatorPresetId:d.id}),children:o("assets.settings.unregisterCreator","Unregister Creator")})})]})]},d.id))}),oe&&!P&&t.jsx(H,{text:et,children:t.jsx("button",{type:"button",className:s.commandButton,disabled:g||A||B||!x,onClick:()=>{F("user"),I(""),f(""),S(!0)},children:o("assets.settings.addCreator","Add Creator")})}),Y&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:s.twoColumn,children:[t.jsxs("div",{className:s.field,children:[t.jsx("div",{className:s.fieldLabelRow,children:t.jsx("label",{htmlFor:"asset-settings-creator-type",children:o("assets.upload.creatorType","Creator type")})}),t.jsxs("select",{id:"asset-settings-creator-type",value:V,disabled:g||A||B||!x,onChange:d=>F(d.target.value),children:[t.jsx("option",{value:"user",children:o("assets.creator.user","User")}),t.jsx("option",{value:"group",children:o("assets.creator.group","Group")})]})]}),t.jsxs("div",{className:s.field,children:[t.jsxs("div",{className:s.fieldLabelRow,children:[t.jsx("label",{htmlFor:"asset-settings-creator-id",children:o("assets.upload.creatorId","Creator ID")}),t.jsx(Pe,{topicId:"openCloudCreatorId",variant:"field",state:{hasDefaultCreator:!!T}})]}),t.jsx("input",{id:"asset-settings-creator-id",value:X,disabled:g||A||B||!x,onChange:d=>I(d.target.value)}),t.jsx("p",{className:s.inlineHelp,children:o("assets.settings.creatorId.inlineHelp","Default owner for new Roblox assets: your User ID or a Group ID.")})]})]}),t.jsxs("div",{className:s.field,children:[t.jsx("div",{className:s.fieldLabelRow,children:t.jsx("label",{htmlFor:"asset-settings-creator-label",children:o("assets.settings.creatorLabel","Creator label")})}),t.jsx("input",{id:"asset-settings-creator-label",value:q,disabled:g||A||B||!x,onChange:d=>f(d.target.value),placeholder:o("assets.settings.creatorLabel.placeholder","Main studio group")}),t.jsx("p",{className:s.inlineHelp,children:o("assets.settings.creatorLabel.help","Optional. If left blank, WEPPY automatically saves a label like User 123 or Group 456.")})]}),!T&&t.jsx("p",{className:s.inlineHelp,children:o("assets.settings.creatorHelp","Use the numeric user ID from a profile URL or group ID from a group URL.")}),t.jsxs("div",{className:s.buttonRow,children:[t.jsx(H,{text:Qe,children:t.jsx("button",{type:"button",className:s.primaryButton,disabled:ue,onClick:()=>{(async()=>{if(h){r(!0);try{const d=await to(h.id,{creatorType:V,creatorId:J,makeDefault:!T,...q.trim()?{label:q.trim()}:{}});D(d),I(""),f(""),S(!1),j(o("assets.settings.defaultCreatorSaved","Open Cloud default Creator saved locally."))}catch(d){j(d instanceof Error?d.message:o("assets.settings.saveFailed","Failed to save upload settings."))}finally{r(!1)}}})()},children:at})}),oe&&t.jsx("button",{type:"button",className:s.commandButton,disabled:g||A,onClick:()=>{F("user"),I(""),f(""),S(!1)},children:o("assets.settings.cancelCreator","Cancel")})]})]})]}),z&&t.jsx("div",{className:s.messageState,children:z}),t.jsx(Ge,{open:v!==null,title:lt,message:it,cancelLabel:o("common.cancel","Cancel"),confirmLabel:ct,loading:A,onCancel:()=>L(null),onConfirm:()=>{rt()}})]})}const xo=12,bo=5e3;function le(e,a){return e instanceof Error&&e.message.trim().length>0?e.message:a}function Ce(e,a){return e.some(o=>o.id===a.id)?e.map(o=>o.id===a.id?a:o):[a,...e]}function _e(e,a){return qt(e.filter(u=>Xt(u,a)))}function pe(e,a){return e?`${e.displayName} (${e.id})`:a??"unknown asset"}function yo(e){return e.length===0?"none":e.map(a=>pe(a)).join(", ")}function Fe(e){const a=`status ${e.status}`;return e.roblox.assetId?`Roblox asset ${e.roblox.assetId}; ${a}`:a}function fo(e,a){const u=pe(a);return e==="update"?`Updated metadata for asset: ${u}.`:e==="upload"?`Uploaded asset: ${u} -> ${Fe(a)}.`:e==="thumbnail-generate"?`Generated thumbnail for asset: ${u}.`:e==="status-refresh"?`Refreshed Roblox status for asset: ${u} -> ${Fe(a)}.`:e==="usage-scan"?`Scanned usage for asset: ${u} -> ${a.usage.references.length} reference(s).`:`Updated asset: ${u}.`}function jo(e){return e!=="upload"&&e!=="status-refresh"}function Se(e,a){if((a==null?void 0:a.id)===e)return a.category;const u=/^asset_(image|decal|audio|mesh|model|video|animation)_/.exec(e);return u!=null&&u[1]?u[1]:null}function Me(e){return e.status==="processing"&&!!(e.roblox.operationId??e.roblox.operationPath)}function vo(e){return{scope:e.scope.kind,placeId:e.scope.kind==="place"?e.scope.placeId:void 0,category:e.category}}function Co(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 a=e.places[0];return{placeId:(a==null?void 0:a.placeId)??null,placeName:(a==null?void 0:a.placeName)??null,studioConnected:!1}}function _o(){const[e,a]=i.useState([]),[u,o]=i.useState(0),[l,$]=i.useState(null),[C,D]=i.useState("place"),[p,G]=i.useState("all"),[O,U]=i.useState(null),[m,n]=i.useState(null),[W,K]=i.useState(!1),[V,F]=i.useState(!0),[X,I]=i.useState(null),[q,f]=i.useState(null),[P,S]=i.useState(null),z=i.useRef(!0),j=i.useRef(new Map),v=i.useMemo(()=>e.find(c=>c.id===l)??null,[e,l]),L=i.useCallback(c=>{const y=j.current.get(c);y!==void 0&&(clearTimeout(y),j.current.delete(c))},[]),A=i.useCallback((c,y=xo)=>{if(!Me(c)||y<=0){L(c.id);return}L(c.id),(async()=>{try{const b=await Re(vo(c),c.id);if(!z.current)return;if(a(_=>Ce(_,b)),Me(b)&&y>1){const _=setTimeout(()=>{j.current.delete(b.id),A(b,y-1)},bo);j.current.set(b.id,_);return}L(b.id)}catch(b){if(!z.current)return;L(c.id),f(le(b,"Asset Library status refresh failed."))}})()},[L]);i.useEffect(()=>()=>{z.current=!1;for(const c of j.current.values())clearTimeout(c);j.current.clear()},[]);const r=i.useCallback(()=>({scope:C,placeId:C==="place"?O:void 0}),[O,C]),g=i.useCallback(c=>({...r(),category:c}),[r]),Z=i.useCallback(async()=>{try{const c=await ht(),y=Co(c);return U(y.placeId),n(y.placeName),K(y.studioConnected),y.placeId}catch{return U(null),n(null),K(!1),null}},[]),te=i.useCallback(async()=>{f(null);try{const c=await Z(),y={scope:C,placeId:C==="place"?c:void 0};if(C==="place"&&c===null){a([]),o(0),F(!1),f("No active place is connected for place-scoped assets.");return}const b=await Promise.all($e(p).map(k=>Tt({...y,category:k}))),_=_e(b.flatMap(k=>k.assets),p);a(_),o(_.length)}catch(c){f(le(c,"Failed to load Asset Library."))}finally{F(!1)}},[p,Z,C]);i.useEffect(()=>{te()},[te]);const E=i.useCallback(async(c,y,b)=>{const _=Se(y,v);if(!_)return f("Asset category is unavailable."),null;I(c),f(null),S(null);try{const k=await b(g(_));return a(M=>Ce(M,k)),$(k.id),jo(c)&&S(fo(c,k)),k}catch(k){return f(le(k,"Asset Library action failed.")),null}finally{I(null)}},[g,v]),J=i.useCallback(async()=>{I("rescan"),f(null),S(null);try{const c=await Promise.all($e(p).map(M=>Ot(g(M)))),y=_e(c.flatMap(M=>M.assets),p),b=c.reduce((M,ue)=>M+ue.adoptedCount,0),_=c.reduce((M,ue)=>M+ue.skippedCount,0),k=_e(c.flatMap(M=>M.adopted),p);a(y),o(y.length),S(`Rescan complete for ${p}: ${b} asset(s) added, ${_} skipped. Added: ${yo(k)}.`)}catch(c){f(le(c,"Asset Library rescan failed."))}finally{I(null)}},[p,g]),ae=i.useCallback(async(c,y)=>{I("export-selection-rbxm"),f(null),S(null);try{const b=await Gt(g(c),y);return a(_=>Ce(_,b.asset)),$(b.asset.id),S(`Exported Studio selection as RBXM asset: ${pe(b.asset)}${b.deduplicated?" (reused existing local asset)":""}.`),b}catch(b){return f(le(b,"Asset Library .rbxm export failed.")),null}finally{I(null)}},[g]),h=i.useCallback((c,y)=>E("update",c,b=>Ft(b,c,y)),[E]),se=i.useCallback(async(c,y)=>{const b=await E("upload",c,_=>Ht(_,c,y));return b&&A(b),b},[E,A]),x=i.useCallback(async c=>{const y=Se(c,v);if(!y)return f("Asset category is unavailable."),!1;L(c);const b=e.find(_=>_.id===c)??v;I("delete"),f(null),S(null);try{return await Mt(g(y),c),a(_=>{const k=_.filter(M=>M.id!==c);return o(k.length),k}),$(_=>_===c?null:_),S(`Deleted asset: ${pe(b,c)}. Local files removed; uploaded Roblox assets were not deleted.`),!0}catch(_){return f(le(_,"Asset Library delete failed.")),!1}finally{I(null)}},[e,L,g,v]),B=i.useCallback(async(c,y)=>{const b=Se(c,v);if(!b)return f("Asset category is unavailable."),null;const _=e.find(k=>k.id===c)??v;I("import-rbxm"),f(null),S(null);try{const k=await Wt(g(b),c,y);return $(c),S(`Imported RBXM asset: ${pe(_,c)} -> ${k.importedCount} instance(s) to ${k.targetParent}.`),k}catch(k){return f(le(k,"Asset Library .rbxm import failed.")),null}finally{I(null)}},[e,g,v]),T=i.useCallback(c=>E("thumbnail-generate",c,y=>zt(y,c)),[E]),oe=i.useCallback(c=>(L(c),E("status-refresh",c,y=>Re(y,c))),[L,E]),Y=i.useCallback((c,y)=>E("usage-scan",c,async b=>(await Kt(b,c,y)).asset),[E]),de=i.useCallback(c=>{D(c),$(null)},[]),ne=i.useCallback(c=>{Yt(c)&&(G(c),$(null))},[]);return{assets:e,totalCount:u,selectedAsset:v,selectedAssetId:l,scope:C,categoryFilter:p,activePlaceId:O,activePlaceName:m,studioConnected:W,loading:V,busyAction:X,error:q,lastMessage:P,setScope:de,setCategoryFilter:ne,selectAsset:$,refresh:te,rescan:J,exportSelectionRbxm:ae,updateMetadata:h,uploadAsset:se,deleteAsset:x,importRbxm:B,generateThumbnail:T,refreshStatus:oe,scanUsage:Y}}function So(e,a){return a("assets.count.shown","Shown assets: {count}").replace("{count}",String(e))}function Po(){const{t:e}=he(),{trackEvent:a}=mt(),{tier:u,loading:o}=gt(),l=_o(),[$,C]=i.useState(!1),[D,p]=i.useState(!1),[G,O]=i.useState(!1),U=!o&&u==="pro",m=l.selectedAsset,n=(m==null?void 0:m.file.original.toLowerCase().endsWith(".rbxm"))??!1,W=(m==null?void 0:m.category)==="model"||(m==null?void 0:m.category)==="animation",K="game.Workspace",F=!!(U&&l.studioConnected&&m&&n&&W),X=i.useMemo(()=>l.scope==="place"?l.activePlaceName??e("assets.scope.place","Current Place"):e("assets.scope.shared","Shared"),[l.activePlaceName,l.scope,e]),I=i.useMemo(()=>Ae(l.categoryFilter,e),[l.categoryFilter,e]),q=So(l.totalCount,e),f=e("assets.detail.importRbxm.tooltip","Insert this local RBXM asset into {target} in the connected Studio place.").replace("{target}",K);return t.jsxs("div",{className:s.page,children:[t.jsx(xt,{title:e("assets.title","Assets"),description:e("assets.subtitle","Browse local originals, upload to Roblox, and inspect synced usage by place."),badge:t.jsx("span",{className:s.experimentalBadge,children:e("assets.experimental","Experimental")}),helpTopicId:"assets",helpState:{tier:u}}),t.jsxs("div",{className:s.toolbarShell,children:[t.jsxs("div",{className:s.toolbar,children:[t.jsxs("div",{className:s.segmented,role:"group","aria-label":e("assets.scope.label","Asset scope"),children:[t.jsx("button",{type:"button",className:l.scope==="place"?s.segmentedActive:"",onClick:()=>l.setScope("place"),children:e("assets.scope.place","Current Place")}),t.jsx("button",{type:"button",className:l.scope==="shared"?s.segmentedActive:"",onClick:()=>l.setScope("shared"),children:e("assets.scope.shared","Shared")})]}),t.jsxs("div",{className:s.listContextSummary,children:[t.jsx("span",{children:X}),t.jsx("span",{className:s.contextDivider,children:" · "}),t.jsx("span",{children:I}),t.jsx("span",{className:s.contextDivider,children:" · "}),t.jsx("strong",{children:q})]}),t.jsxs("div",{className:s.toolbarActions,children:[t.jsx(H,{text:e("assets.rescan.tooltip","Scan inbox folders for the current filter."),children:t.jsxs("button",{type:"button",className:s.commandButton,disabled:l.busyAction==="rescan",onClick:()=>{a("dashboard_click_event",{click_target:"assets_rescan",page:"assets"}),l.rescan()},children:[t.jsx(He,{size:15}),e("assets.rescan","Rescan")]})}),t.jsx(H,{text:D?"":e("assets.settings.open.tooltip","Open Roblox upload settings."),children:t.jsx("button",{type:"button",className:[s.iconButton,D?s.iconButtonActive:""].filter(Boolean).join(" "),onClick:()=>{a("dashboard_click_event",{click_target:"assets_open_settings",page:"assets"}),p(P=>!P)},"aria-label":e("assets.settings.open","Open settings"),"aria-controls":"asset-library-settings-panel","aria-expanded":D,children:t.jsx(Ke,{size:16})})})]}),t.jsxs("div",{className:s.categoryControl,children:[t.jsx("span",{id:"assets-category-filter-label",className:s.categoryControlLabel,children:e("assets.category.filter","Category")}),t.jsx("div",{className:s.categoryRail,role:"radiogroup","aria-labelledby":"assets-category-filter-label",children:Xe.map(P=>{const S=l.categoryFilter===P,z=Ae(P,e);return t.jsx("button",{type:"button",role:"radio","aria-checked":S,className:[s.categoryButton,S?s.categoryButtonActive:""].filter(Boolean).join(" "),onClick:()=>{l.setCategoryFilter(P)},children:z},P)})})]})]}),t.jsx(go,{open:D,tier:u,onClose:()=>p(!1)})]}),l.error&&t.jsx("div",{className:s.errorState,children:l.error}),l.lastMessage&&t.jsx("div",{className:s.messageState,children:l.lastMessage}),l.categoryFilter==="rbxm"&&t.jsxs("section",{className:s.rbxmGuide,"aria-label":e("assets.rbxmGuide.title","Save RBXM from Studio"),children:[t.jsx("h2",{children:e("assets.rbxmGuide.title","Save RBXM from Studio")}),t.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.")}),t.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.")})]}),!U&&!o&&t.jsx("div",{className:`${s.notice} ${s.proNotice}`,children:e("assets.basic.notice","Browse, preview, edit metadata, and scan usage on Basic. Roblox upload controls are available on Pro.")}),l.loading?t.jsx("div",{className:s.emptyState,children:e("common.loading","Loading...")}):t.jsx(Ua,{assets:l.assets,selectedAssetId:l.selectedAssetId,onSelect:l.selectAsset}),t.jsx(Ya,{asset:$||D||G?null:m,busyAction:l.busyAction,canUpload:U,canImportRbxm:F,importRbxmTooltip:f,importRbxmTargetParent:K,onClose:()=>l.selectAsset(null),onSave:async(P,S)=>{m&&await l.updateMetadata(m.id,{displayName:P,description:S})},onUpload:()=>C(!0),onDelete:()=>O(!0),onImportRbxm:async()=>{m&&(a("dashboard_click_event",{click_target:"assets_import_rbxm",page:"assets"}),await l.importRbxm(m.id,{targetParent:K}))},onRefreshStatus:async()=>{m&&await l.refreshStatus(m.id)},onScanUsage:async()=>{m&&(a("dashboard_click_event",{click_target:"assets_usage_scan",page:"assets"}),await l.scanUsage(m.id,l.activePlaceId??void 0))}}),t.jsx(Ge,{open:G&&!!m,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:l.busyAction==="delete",onCancel:()=>O(!1),onConfirm:()=>{m&&(a("dashboard_click_event",{click_target:"assets_delete",page:"assets"}),l.deleteAsset(m.id).then(P=>{P&&O(!1)}))}}),t.jsx(co,{asset:m,open:$,canUpload:U,busyAction:l.busyAction,onClose:()=>{C(!1),l.selectAsset(null)},onBack:()=>C(!1),onOpenSettings:()=>{C(!1),p(!0)},onUpload:async P=>{if(!m)return;a("dashboard_click_event",{click_target:"assets_upload_submit",page:"assets"}),await l.uploadAsset(m.id,P)&&C(!1)}})]})}export{Po as Component};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{q as K,u as Q,i as V,r as p,j as t,E as J,B as Z}from"./index-1ZlHj3-1.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 ee=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],te=K("circle-question-mark",ee);/**
|
|
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 ne=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],oe=K("x",ne),a={canDo:{key:"dashboardHelp.section.canDo",fallback:"What you can do here"},needs:{key:"dashboardHelp.section.needs",fallback:"What you need to use it"},currentState:{key:"dashboardHelp.section.currentState",fallback:"Check based on current status"}},se="https://create.roblox.com/docs/cloud/auth/api-keys",ae="https://create.roblox.com/docs/cloud/guides/usage-assets",re="https://create.roblox.com/docs/cloud/reference/features/assets",le="https://create.roblox.com/docs/reference/engine/classes/DataModel#CreatorId",ie="https://create.roblox.com/docs/reference/engine/classes/Player#UserId",ce="https://create.roblox.com/docs/projects/groups",de="https://create.roblox.com/docs/cloud/reference/features/groups";function y(e,s,o,h){return{id:e,title:{key:`dashboardHelp.${e}.title`,fallback:s},sections:o,links:h}}function l(e,s,o,h){return{heading:e,items:h.map((i,v)=>({key:`dashboardHelp.${s}.${o}.${v+1}`,fallback:i}))}}function r(e,s,o){return{heading:a.currentState,items:[{key:`dashboardHelp.${e}.currentState.${s}`,fallback:o}]}}function _(e,s,o,h,i,v){return y(e,s,[l(a.canDo,e,"canDo",o),l(a.needs,e,"needs",h),l(a.currentState,e,"currentState",i)],v)}function ue(e){return e.tier==="basic"?r("assets","basic","Activate Pro before uploading to Roblox."):e.uploadEnabled===!1?r("assets","uploadDisabled","Turn on API Key local upload in Assets settings."):e.hasOpenCloudCredential===!1?r("assets","noCredential","Save and test an Open Cloud API Key."):e.hasDefaultCreator===!1?r("assets","noCreator","Save a default Creator ID or enter Creator details during upload."):r("assets","default","Open an asset detail dialog to start upload or usage scan.")}function pe(e){return e.connectionLevel!==void 0&&e.connectionLevel!=="studioConnected"?r("sync","pluginMissing","Connect WEPPY Plugin in Studio before using live sync details."):e.tier==="basic"?r("sync","basic","Activate Pro to use bidirectional or reverse sync."):r("sync","default","Use the sync log to diagnose stuck or failed sync activity.")}function he(e,s={}){return e==="openCloudApiKey"?y(e,"Open Cloud API Key help",[l(a.canDo,e,"canDo",["WEPPY uses this key only for Roblox Open Cloud requests."]),l(a.needs,e,"needs",["Create a Roblox API key in Creator Hub. Add Assets under Access Permissions, then enable both Read and Write operations.","Set the key target to the same User or Group that you use as the upload Creator.","The raw key is encrypted on this device. It is not sent to WEPPY servers, and it is not stored in any other external storage, browser storage, telemetry, logs, tool history, or Asset Library metadata."]),s.hasOpenCloudCredential?r(e,"saved","Use Test Connection to confirm the saved key still works."):r(e,"empty","Create an API key in Roblox Creator Hub, paste it here, then save and test it.")],[{label:{key:"dashboardHelp.openCloudApiKey.link.apiKeys",fallback:"Roblox API keys"},href:se},{label:{key:"dashboardHelp.openCloudApiKey.link.assetsGuide",fallback:"Assets API usage guide"},href:ae},{label:{key:"dashboardHelp.openCloudApiKey.link.assetsReference",fallback:"Assets API reference"},href:re}]):e==="openCloudCreatorId"?y(e,"Creator ID help",[l(a.canDo,e,"canDo",["The default Creator decides which User or Group owns newly uploaded Roblox assets."]),l(a.needs,e,"needs",["For User, sign in to roblox.com, open your profile from your avatar or username, then copy only the number between /users/ and /profile in the browser URL.","For Group, open the Roblox group or community page, then copy only the number after /groups/ or /communities/ in the browser URL.","Paste only the numeric ID in Creator ID. Do not paste the full URL, rbxassetid://, User, or Group text."]),s.hasDefaultCreator?r(e,"saved","Keep this value if new assets should continue using the same owner."):r(e,"empty","Choose User or Group, paste the numeric ID, then save the default Creator.")],[{label:{key:"dashboardHelp.openCloudCreatorId.link.creatorId",fallback:"Creator ID reference"},href:le},{label:{key:"dashboardHelp.openCloudCreatorId.link.userId",fallback:"User ID reference"},href:ie},{label:{key:"dashboardHelp.openCloudCreatorId.link.groups",fallback:"Roblox groups"},href:ce},{label:{key:"dashboardHelp.openCloudCreatorId.link.groupsApi",fallback:"Groups Cloud API"},href:de}]):{overview:y("overview","Overview help",[l(a.canDo,"overview","canDo",["Check MCP server, WEPPY Plugin, AI Agent, Sync, and recent game changes in one place."]),l(a.needs,"overview","needs",["Useful status requires the MCP server. Live Studio status also needs WEPPY Plugin connected to the active place."]),s.connectionLevel==="serverOnly"?r("overview","serverOnly","Open Roblox Studio and start WEPPY Plugin so live place data can appear."):r("overview","default","If the server disconnects, restart MCP or wait for the automatic reconnect.")]),connection:_("connection","Connection help",["Inspect server process details, connected AI agents, Studio plugin clients, and connection log events."],["The MCP server must be reachable. Plugin rows appear after Studio sends heartbeats."],["If Plugin is missing, open Roblox Studio and run WEPPY Plugin. If AI Agent is missing, reconnect the MCP server from your AI tool."]),sync:y("sync","Sync help",[l(a.canDo,"sync","canDo",["Review Studio to local sync status, direction, apply mode, and sync logs."]),l(a.needs,"sync","needs",["Sync needs an active place and connected WEPPY Plugin. Two-way and reverse workflows depend on Pro."]),pe(s)]),assets:y("assets","Assets help",[l(a.canDo,"assets","canDo",["Browse local Asset Library files, switch place/shared scope, filter categories, scan usage, insert RBXM into Studio, and upload local assets to Roblox."]),l(a.needs,"assets","needs",["Upload needs Pro, the Open Cloud upload toggle, a valid API Key, and a Creator. Browse and preview work on Basic."]),ue(s)]),changelog:_("changelog","Changelog help",["Review real game-change sessions extracted from AI actions and sync events."],["Entries are scoped to the active place. Basic shows only the latest preview entries."],["If the list is empty, ask the AI Agent to make a game change. Clear only deletes saved history records, not Studio objects."]),playtest:y("playtest","Playtest help",[l(a.canDo,"playtest","canDo",["Review Playtest results and reports saved by the AI Agent."]),l(a.needs,"playtest","needs",["Pro shows real stored reports. Basic shows sample preview data. Live active-place confidence needs WEPPY Plugin connected."]),s.tier==="basic"?r("playtest","basic","Activate Pro to use real Playtest history."):r("playtest","default","Ask the AI Agent to run a Playtest when no report is available.")]),uiStudio:y("uiStudio","UI Studio help",[l(a.canDo,"uiStudio","canDo",["Review AI-created UI analysis, improvement suggestions, captures, and before/after history."]),l(a.needs,"uiStudio","needs",["Pro shows real UI Studio data. Basic shows a bundled sample. New capture/check actions need WEPPY Plugin connected."]),s.tier==="basic"?r("uiStudio","basic","Activate Pro to use live UI Studio previews."):r("uiStudio","default","Ask the AI Agent to capture the UI or recheck improvement suggestions, then copy follow-up requests back to the AI chat.")]),tools:_("tools","Tools help",["Inspect tool history, status classification, fallback/unsupported/warn/error details, and usage statistics."],["History and statistics depend on local recording settings and the active place bucket."],["If no records appear, check Settings > General and confirm history/statistics are enabled. Expand failed rows to inspect input, permission, or connection causes."]),settings:_("settings","Settings help",["Manage License, hot settings, saved data cleanup, server environment display, and language."],["License actions need MCP server connection. Server environment values are read-only here. Asset upload controls live in Assets settings."],["Activate a license for Pro features. Change environment values outside WEPPY Dashboard, then restart MCP. Review delete confirmations before clearing saved data."]),whatsNew:_("whatsNew","What's New help",["Review WEPPY Dashboard, MCP, and Plugin announcements, releases, and change notes."],["Announcements are bundled locally. Unread state is stored in this browser."],["After you visit this page, unread announcements from this visit are marked read when you leave. The top header does not show a duplicate What's New button on this page."])}[e]}const fe="_root_rxppj_1",ye="_rootPage_rxppj_7",be="_rootField_rxppj_11",ge="_button_rxppj_15",me="_panel_rxppj_50",ve="_panelField_rxppj_65",Pe="_panelPage_rxppj_69",ke="_panelHeader_rxppj_73",_e="_closeButton_rxppj_91",we="_sectionStack_rxppj_112",xe="_helpSection_rxppj_117",Ce="_linkList_rxppj_118",c={root:fe,rootPage:ye,rootField:be,button:ge,panel:me,panelField:ve,panelPage:Pe,panelHeader:ke,closeButton:_e,sectionStack:we,helpSection:xe,linkList:Ce},b=12,A=8,Ae=120,Ee=360,Ie=340,Y=560;function Re({topicId:e,state:s,variant:o="page",className:h}){const{t:i}=Q(),{trackEvent:v}=V(),[f,w]=p.useState(!1),[x,D]=p.useState(null),j=p.useId(),N=p.useRef(null),O=p.useRef(null),I=p.useRef(null),g=he(e,s),R=i(g.title.key,g.title.fallback),C=p.useCallback(()=>{const n=O.current,d=I.current;if(!n||!d||typeof window>"u")return;const u=n.getBoundingClientRect(),m=d.getBoundingClientRect(),P=window.innerWidth,k=window.innerHeight,q=o==="field"?Ie:Ee,M=m.width||Math.min(q,P-b*2),B=m.height||Y;let S=o==="field"?u.left:u.right-M;S=Math.max(b,Math.min(S,P-M-b));const L=k-u.bottom-A-b,W=u.top-A-b,T=L<Math.min(B,220)&&W>L,z=Math.max(Ae,T?W:L),G=Math.min(Y,z),F=Math.min(B,G);let H=T?u.top-A-F:u.bottom+A;H=Math.max(b,Math.min(H,k-F-b)),D({top:Math.round(H),left:Math.round(S),maxHeight:Math.round(G)})},[o]);p.useLayoutEffect(()=>{f?C():D(null)},[f,C]),p.useEffect(()=>{if(!f)return;const n=u=>{var P,k;const m=u.target;m&&!((P=N.current)!=null&&P.contains(m))&&!((k=I.current)!=null&&k.contains(m))&&w(!1)},d=u=>{u.key==="Escape"&&w(!1)};return document.addEventListener("mousedown",n),document.addEventListener("keydown",d),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("keydown",d)}},[f]),p.useEffect(()=>{if(!f)return;const n=()=>C();return window.addEventListener("scroll",n,!0),window.addEventListener("resize",n),()=>{window.removeEventListener("scroll",n,!0),window.removeEventListener("resize",n)}},[f,C]);const X=o==="field"?i("dashboardHelp.fieldButton.ariaLabel","Open field help"):i("dashboardHelp.pageButton.ariaLabel","Open page help"),$=x?{top:x.top,left:x.left,maxHeight:x.maxHeight}:{top:-9999,left:-9999,visibility:"hidden"},U=f?t.jsxs("section",{ref:I,id:j,className:[c.panel,o==="field"?c.panelField:c.panelPage].filter(Boolean).join(" "),style:$,role:"dialog","aria-label":R,"data-panel-placement":"help-portal",children:[t.jsxs("div",{className:c.panelHeader,children:[t.jsx("h2",{children:R}),t.jsx("button",{type:"button",className:c.closeButton,"aria-label":i("common.close","Close"),onClick:()=>w(!1),children:t.jsx(oe,{size:15,"aria-hidden":"true"})})]}),t.jsx("div",{className:c.sectionStack,children:g.sections.map(n=>t.jsxs("section",{className:c.helpSection,children:[t.jsx("h3",{children:i(n.heading.key,n.heading.fallback)}),t.jsx("ul",{children:n.items.map(d=>t.jsx("li",{children:i(d.key,d.fallback)},d.key))})]},n.heading.key))}),g.links&&g.links.length>0&&t.jsxs("div",{className:c.linkList,children:[t.jsx("h3",{children:i("dashboardHelp.section.links","Related links")}),g.links.map(n=>t.jsxs("a",{href:n.href,target:"_blank",rel:"noreferrer",children:[i(n.label.key,n.label.fallback),t.jsx(J,{size:12,"aria-hidden":"true"})]},n.href))]})]}):null;return t.jsxs(t.Fragment,{children:[t.jsx("div",{ref:N,className:[c.root,o==="field"?c.rootField:c.rootPage,h??""].filter(Boolean).join(" "),children:t.jsxs("button",{ref:O,type:"button",className:c.button,"aria-label":`${X}: ${R}`,"aria-expanded":f,"aria-controls":j,onClick:()=>{w(n=>{const d=!n;return n||v("dashboard_click_event",{click_target:"dashboard_help_open",help_topic:e,placement:o}),d})},children:[t.jsx(te,{size:o==="field"?14:16,"aria-hidden":"true"}),o==="page"&&t.jsx("span",{children:i("dashboardHelp.button","Help")})]})}),U&&typeof document<"u"?Z.createPortal(U,document.body):null]})}const Se="_pageHeader_qym7v_1",Le="_copy_qym7v_9",He="_titleLine_qym7v_16",De="_actions_qym7v_39",E={pageHeader:Se,copy:Le,titleLine:He,actions:De};function Ne({title:e,description:s,badge:o,helpTopicId:h,helpState:i}){return t.jsxs("div",{className:E.pageHeader,children:[t.jsxs("div",{className:E.copy,children:[t.jsxs("div",{className:E.titleLine,children:[t.jsx("h1",{children:e}),o]}),t.jsx("p",{children:s})]}),t.jsx("div",{className:E.actions,children:t.jsx(Re,{topicId:h,state:i})})]})}export{Re as D,Ne as P,oe as X};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u,j as e,y,r as N,z as w}from"./index-1ZlHj3-1.js";import{P as x}from"./PageHeader-ueZvp6K9.js";const j="_card_f20gt_2",C="_cardUnread_f20gt_15",R="_cardRead_f20gt_20",k="_topRow_f20gt_25",v="_categoryChip_f20gt_32",b="_versionChip_f20gt_45",S="_date_f20gt_57",T="_title_f20gt_65",E="_body_f20gt_74",A="_linkList_f20gt_82",U="_link_f20gt_82",B="_newBadge_f20gt_104",a={card:j,cardUnread:C,cardRead:R,topRow:k,categoryChip:v,versionChip:b,date:S,title:T,body:E,linkList:A,link:U,newBadge:B},L={release:"whatsNew.category.release",notice:"whatsNew.category.notice",deprecation:"whatsNew.category.deprecation",tip:"whatsNew.category.tip"};function f({announcement:s,isNew:p}){const{locale:r,t:o}=u(),i=p?a.cardUnread:a.cardRead,g=s.title[r]??s.title.en,l=s.body[r]??s.body.en,d=s.links??(s.link?[s.link]:[]),h=n=>typeof n=="string"?n:n[r]??n.en;return e.jsxs("div",{className:`${a.card} ${i}`,children:[e.jsxs("div",{className:a.topRow,children:[e.jsx("span",{className:a.categoryChip,children:o(L[s.category])}),s.version&&e.jsx("span",{className:a.versionChip,children:s.version}),p&&e.jsx("span",{className:a.newBadge,children:o("whatsNew.newBadge","NEW")}),e.jsx("span",{className:a.date,children:s.date})]}),e.jsx("h3",{className:a.title,children:g}),e.jsx("p",{className:a.body,children:l}),d.length>0&&e.jsx("div",{className:a.linkList,children:d.map(n=>{const _=h(n.url),t=h(n.label);return e.jsxs("a",{className:a.link,href:_,target:"_blank",rel:"noopener noreferrer",children:["↗"," ",t]},_)})})]})}const $="_page_1talg_2",z="_section_1talg_10",M="_sectionTitle_1talg_16",P="_unreadCount_1talg_28",W="_empty_1talg_43",H="_divider_1talg_51",c={page:$,section:z,sectionTitle:M,unreadCount:P,empty:W,divider:H};function Y(){const{t:s}=u(),{readSet:p,markRead:r}=y(),o=N.useMemo(()=>{const t=[];for(const m of w)p.has(m.id)||t.push(m.id);return t},[]),i=N.useRef(o);i.current=o,N.useEffect(()=>()=>{i.current.length>0&&r(i.current)},[]);const g=N.useMemo(()=>new Set(o),[o]),l=w.filter(t=>g.has(t.id)),d=w.filter(t=>!g.has(t.id)),h=l.length>0,n=d.length>0,_=e.jsx(x,{title:s("whatsNew.pageTitle","What's New"),description:s("whatsNew.pageSubtitle","Stay up to date with MCP changes"),helpTopicId:"whatsNew"});return w.length===0?e.jsxs("div",{className:c.page,children:[_,e.jsx("p",{className:c.empty,children:s("whatsNew.empty","No announcements yet")})]}):e.jsxs("div",{className:c.page,children:[_,h&&e.jsxs("section",{className:c.section,children:[e.jsxs("h2",{className:c.sectionTitle,children:[s("whatsNew.unreadSection","Unread"),e.jsx("span",{className:c.unreadCount,children:l.length})]}),l.map(t=>e.jsx(f,{announcement:t,isNew:!0},`unread-${t.id}`))]}),h&&n&&e.jsx("hr",{className:c.divider}),n&&e.jsxs("section",{className:c.section,children:[e.jsx("h2",{className:c.sectionTitle,children:s("whatsNew.allSection","All Announcements")}),d.map(t=>e.jsx(f,{announcement:t,isNew:!1},`all-${t.id}`))]})]})}export{Y as Component};
|