@weppy/roblox-mcp 2.16.0 → 2.16.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dashboard/dist/assets/{AssetsPage-Dcj0TWe9.js → AssetsPage-_CPMetwm.js} +2 -2
  3. package/dashboard/dist/assets/ChangelogPage-B9Ct115r.css +1 -0
  4. package/dashboard/dist/assets/ChangelogPage-BpTjHwvr.js +1 -0
  5. package/dashboard/dist/assets/{ConfirmModal-CyjUVYwz.js → ConfirmModal-BSbhJt6x.js} +1 -1
  6. package/dashboard/dist/assets/{ConnectionPage-B1tZK4zW.js → ConnectionPage-BMIbBueG.js} +2 -2
  7. package/dashboard/dist/assets/ContentScopedDialog-D92wgDaU.js +1 -0
  8. package/dashboard/dist/assets/ContentScopedDialog-DCgVfmeB.css +1 -0
  9. package/dashboard/dist/assets/{ControlsPage-zlLRwkt6.js → ControlsPage-C828Cgwo.js} +2 -2
  10. package/dashboard/dist/assets/CurrentPlaceScope-BFYSAg2T.js +1 -0
  11. package/dashboard/dist/assets/{GameChangeDetail-CONsGQ2-.js → GameChangeDetail-CCQ8h1ft.js} +1 -1
  12. package/dashboard/dist/assets/{InfoLabel-Cf_fu0ZE.js → InfoLabel-D6WxKFnG.js} +1 -1
  13. package/dashboard/dist/assets/OverviewPage-B8RMrIaQ.js +1 -0
  14. package/dashboard/dist/assets/{UiPrimitive-BMSNRGwI.css → PageHeader-CrhjZjgp.css} +1 -1
  15. package/dashboard/dist/assets/PageHeader-Xrn6BpcL.js +6 -0
  16. package/dashboard/dist/assets/PlaytestPage-C-WO2SsY.css +1 -0
  17. package/dashboard/dist/assets/PlaytestPage-CrCurhRT.js +11 -0
  18. package/dashboard/dist/assets/SettingsPage-B_9NwPEF.js +1 -0
  19. package/dashboard/dist/assets/{StatusBadge-DPEvJdzm.js → StatusBadge-Ddzg1cSk.js} +1 -1
  20. package/dashboard/dist/assets/SyncPage-BNadN0NU.js +1 -0
  21. package/dashboard/dist/assets/{Tabs-BXHuo9Wk.js → Tabs-DZDOsT6_.js} +1 -1
  22. package/dashboard/dist/assets/ToolsPage-B4t6LvfV.css +1 -0
  23. package/dashboard/dist/assets/ToolsPage-bHm2QbDR.js +1 -0
  24. package/dashboard/dist/assets/{TooltipText-55u9HaGy.js → TooltipText-B1An7dUI.js} +1 -1
  25. package/dashboard/dist/assets/UiStudioPage-CWQgLMHO.js +11 -0
  26. package/dashboard/dist/assets/{UiStudioPage-Cej06eXQ.css → UiStudioPage-Ds-eaGvd.css} +1 -1
  27. package/dashboard/dist/assets/WhatsNewPage-D-iibgAc.js +1 -0
  28. package/dashboard/dist/assets/{copy-szgBQciT.js → copy-B03ftJiE.js} +1 -1
  29. package/dashboard/dist/assets/{index-CACN5u4J.js → index-Ygt1Wh6v.js} +26 -26
  30. package/dashboard/dist/assets/sample-requests-r6iFLFba.js +1 -0
  31. package/dashboard/dist/assets/{useLiveUptime-kOkM_pqk.js → useLiveUptime-CnfGQ_vS.js} +1 -1
  32. package/dashboard/dist/assets/useSettings-BrnGUYZY.js +1 -0
  33. package/dashboard/dist/index.html +1 -1
  34. package/dist/index.js +91 -91
  35. package/package.json +1 -1
  36. package/roblox-plugin/WeppyRobloxMCP.rbxm +0 -0
  37. package/dashboard/dist/assets/ChangelogDetailPage-Bw3gyr1A.js +0 -1
  38. package/dashboard/dist/assets/ChangelogDetailPage-vGgnpq1q.css +0 -1
  39. package/dashboard/dist/assets/ChangelogPage-0WZSh2m-.js +0 -1
  40. package/dashboard/dist/assets/ChangelogPage-DsP0fTsc.css +0 -1
  41. package/dashboard/dist/assets/CurrentPlaceScope-BdkdaT7r.js +0 -1
  42. package/dashboard/dist/assets/OverviewPage-B7Y5VEFH.js +0 -1
  43. package/dashboard/dist/assets/PageHeader-CTOJDcG8.js +0 -6
  44. package/dashboard/dist/assets/PageHeader-CV_rjuG8.css +0 -1
  45. package/dashboard/dist/assets/PlaytestPage-BJq2ns66.css +0 -1
  46. package/dashboard/dist/assets/PlaytestPage-Zab8aOB7.js +0 -11
  47. package/dashboard/dist/assets/SettingsPage-CizCAf2d.js +0 -1
  48. package/dashboard/dist/assets/SyncPage-M1CTHa74.js +0 -1
  49. package/dashboard/dist/assets/ToolsPage-CAaH9fIQ.css +0 -1
  50. package/dashboard/dist/assets/ToolsPage-oPc2T58z.js +0 -1
  51. package/dashboard/dist/assets/UiPrimitive-BUpeGXNh.js +0 -1
  52. package/dashboard/dist/assets/UiStudioPage-Ck1kJetD.js +0 -11
  53. package/dashboard/dist/assets/WhatsNewPage-BoTRERVd.js +0 -1
  54. package/dashboard/dist/assets/sample-requests-DOSLzn1v.js +0 -1
  55. package/dashboard/dist/assets/useSettings-COna4-LR.js +0 -1
package/CHANGELOG.md CHANGED
@@ -43,6 +43,24 @@ All notable changes to this project will be documented in this file.
43
43
 
44
44
 
45
45
 
46
+
47
+
48
+
49
+ ## [2.16.2] - 2026-08-30
50
+
51
+ ### Features
52
+
53
+ - **Review What's New details without leaving the release list** — Dashboard Changelog entries now open in a focused dialog while deep links and browser Back and Forward continue to work. Closing the dialog restores your list position, filters, and keyboard focus, while Game Change details remain inline.
54
+
55
+ ## [2.16.1] - 2026-08-29
56
+
57
+ ### Features
58
+
59
+ - **Review Dashboard records without losing the list** — Playtest history now uses the full content area instead of reserving an empty report panel, and Playtest, Tools History, and UI Studio open record details in the same focused dialog. You can compare more runs at once, inspect the full evidence or routing details, then return to the same list position and filters.
60
+
61
+ ### Bug Fixes
62
+
63
+ - **Show the correct Playtest outcome and newest runs first** — Structured Playtest history now keeps passed, failed, timed out, cancelled, and insufficient-evidence results distinct, and sorts legacy and structured timestamps by their actual time instead of their text format.
46
64
 
47
65
  ## [2.16.0] - 2026-08-29
48
66
 
@@ -1,4 +1,4 @@
1
- import{i as oe,a as O,o as we,u as me,j as s,P as Ns,I as As,r as c,F as Is,p as Ps,R as hs,X as Ge,E as ks,q as ms,g as Rs,e as $s,h as Ls}from"./index-CACN5u4J.js";import{C as xs}from"./ConfirmModal-CyjUVYwz.js";import{D as Xe,a as Bs,P as Us}from"./PageHeader-CTOJDcG8.js";import{T as Z}from"./TooltipText-55u9HaGy.js";import{B as De,C as Ts}from"./UiPrimitive-BUpeGXNh.js";import{C as gs}from"./copy-szgBQciT.js";import"./ConfirmModal.module-DJksQHBd.js";/**
1
+ import{f as oe,b as O,m as we,u as me,j as s,P as Ns,I as As,r as c,F as Is,n as Ps,R as hs,X as Ge,E as ks,o as ms,g as Rs,a as $s,e as Ls}from"./index-Ygt1Wh6v.js";import{C as xs}from"./ConfirmModal-BSbhJt6x.js";import{B as De,C as Bs,D as Xe,b as Us,P as Ts}from"./PageHeader-Xrn6BpcL.js";import{T as Z}from"./TooltipText-B1An7dUI.js";import{C as gs}from"./copy-B03ftJiE.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.
@@ -58,4 +58,4 @@ import{i as oe,a as O,o as we,u as me,j as s,P as Ns,I as As,r as c,F as Is,p as
58
58
  *
59
59
  * This source code is licensed under the ISC license.
60
60
  * See the LICENSE file in the root directory of this source tree.
61
- */const nt=[["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"}]],ot=oe("upload",nt);function fs(e){if(e.scope==="place"&&typeof e.placeId=="number")return{placeId:String(e.placeId)}}function le(e){const t=fs(e);return t?`?placeId=${encodeURIComponent(t.placeId)}`:""}function Ae(e){return`/api/assets/${encodeURIComponent(e.scope)}/${encodeURIComponent(e.category)}`}function pe(e,t){return`${Ae(e)}/${encodeURIComponent(t)}`}async function lt(e){return O.get(Ae(e),fs(e))}async function rt(e){return O.post(`${Ae(e)}/rescan${le(e)}`,{})}async function it(e,t,r){return(await O.patch(`${pe(e,t)}${le(e)}`,r)).asset}async function ct(e,t){return O.delete(`${pe(e,t)}${le(e)}`)}async function dt(e,t,r){return(await O.post(`${pe(e,t)}/upload${le(e)}`,r)).asset}async function qe(e,t){return(await O.post(`${pe(e,t)}/status-refresh${le(e)}`,{})).asset}async function ut(e,t,r){const n={...e,placeId:r??e.placeId};return O.post(`${pe(e,t)}/usage-scan${le(n)}`,{})}async function pt(e,t){return O.post(`${Ae(e)}/export-selection-rbxm${le(e)}`,t)}async function ht(e,t,r){return O.post(`${pe(e,t)}/import-rbxm${le(e)}`,r)}async function mt(e,t){return(await O.post(`${pe(e,t)}/thumbnail-generate${le(e)}`,{})).asset}function bs(e){return e.fileUrl?`${we}${e.fileUrl}`:`${we}/api/assets/${e.scope.kind}/${e.category}/${encodeURIComponent(e.id)}/file${le({scope:e.scope.kind,placeId:e.scope.kind==="place"?e.scope.placeId:void 0})}`}function He(e){return e.previewUrl?`${we}${e.previewUrl}`:`${we}/api/assets/${e.scope.kind}/${e.category}/${encodeURIComponent(e.id)}/preview${le({scope:e.scope.kind,placeId:e.scope.kind==="place"?e.scope.placeId:void 0})}`}const ys=["all","image","decal","rbxm"],xt=new Set(ys),Je=["model","animation"];function _e(e){return/\.(rbxm|rbxmx)$/i.test(e.file.original)}function gt(e){return xt.has(e)}function Ke(e,t){return e==="all"?t("assets.category.all","All"):t(`assets.category.${e}`,e==="rbxm"?"RBXM":e)}function de(e,t){return Ke(_e(e)?"rbxm":e.category,t)}function ft(e){return e==="all"?["image","decal",...Je]:e==="rbxm"?Je:[e]}function bt(e,t){return t==="all"?e.category==="image"||e.category==="decal"||_e(e):t==="rbxm"?_e(e):(t==="model"||t==="animation")&&_e(e)?!1:e.category===t}function yt(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 jt(e,t){const r=Ie(t),n=new Map;for(const l of e){const f=Ve(l);if(f.length<=r.length||!We(f,r))continue;const g=f[r.length],m=[...r,g].join("/"),p=n.get(m);p?p.descendantCount+=1:n.set(m,{name:g,path:m,descendantCount:1})}return[...n.values()].sort((l,f)=>l.name.localeCompare(f.name))}function vt(e,t){const r=Ie(t);return e.filter(n=>{const l=Ve(n);return l.length===r.length&&We(l,r)}).sort(js)}function Ct(e){return[...e].sort(js)}function _t(e,t){const r=Ie(t);for(;r.length>0;){if(e.some(l=>{const f=Ve(l);return f.length>=r.length&&We(f,r)}))return r.join("/");r.pop()}return""}const St="_page_1w259_1",wt="_experimentalBadge_1w259_9",Nt="_toolbarShell_1w259_23",At="_toolbar_1w259_23",It="_segmented_1w259_41",Pt="_placeContextSlot_1w259_45",kt="_listContextSummary_1w259_50",Rt="_toolbarActions_1w259_54",$t="_categoryControl_1w259_59",Lt="_contextDivider_1w259_84",Bt="_categoryControlLabel_1w259_88",Ut="_categoryRail_1w259_94",Tt="_categoryButton_1w259_102",Et="_categoryButtonActive_1w259_131",Dt="_copyRow_1w259_144",Ft="_buttonRow_1w259_145",Mt="_segmentedActive_1w259_187",Ot="_placeSelectorLabel_1w259_192",zt="_placeSelect_1w259_192",Ht="_sharedPlaceContext_1w259_218",Kt="_commandButton_1w259_244",Gt="_primaryButton_1w259_245",Wt="_iconButton_1w259_246",Vt="_dangerButton_1w259_286",Yt="_iconButtonActive_1w259_307",Xt="_grid_1w259_320",qt="_folderGrid_1w259_328",Jt="_explorer_1w259_337",Zt="_explorerToolbar_1w259_344",Qt="_explorerLocation_1w259_354",ea="_breadcrumb_1w259_377",sa="_breadcrumbSegment_1w259_378",ta="_viewOptions_1w259_421",aa="_organizationModeControl_1w259_429",na="_viewModeControl_1w259_430",oa="_gridSizeControl_1w259_431",la="_explorerSection_1w259_484",ra="_folderTile_1w259_507",ia="_folderListRow_1w259_532",ca="_assetListRow_1w259_533",da="_assetCard_1w259_534",ua="_folderIcon_1w259_539",pa="_folderName_1w259_551",ha="_folderCount_1w259_563",ma="_assetList_1w259_533",xa="_folderList_1w259_532",ga="_assetListHeader_1w259_577",fa="_listPreviewWrap_1w259_614",ba="_listPreview_1w259_614",ya="_listPreviewFallback_1w259_616",ja="_listAssetName_1w259_645",va="_listAssetCategory_1w259_657",Ca="_listAssetScope_1w259_658",_a="_listAssetUpdated_1w259_659",Sa="_folderType_1w259_660",wa="_folderScope_1w259_661",Na="_folderStatus_1w259_662",Aa="_folderUpdated_1w259_663",Ia="_assetCardSelected_1w259_692",Pa="_thumbnailWrap_1w259_697",ka="_thumbnail_1w259_697",Ra="_thumbnailFallback_1w259_713",$a="_assetCardBody_1w259_724",La="_assetName_1w259_731",Ba="_assetMeta_1w259_739",Ua="_statusChip_1w259_746",Ta="_categoryPill_1w259_747",Ea="_assetId_1w259_752",Da="_scopeText_1w259_753",Fa="_muted_1w259_754",Ma="_emptyState_1w259_759",Oa="_notice_1w259_760",za="_errorState_1w259_761",Ha="_messageState_1w259_762",Ka="_proNotice_1w259_792",Ga="_rbxmGuide_1w259_810",Wa="_settingsInlinePanel_1w259_850",Va="_settingsDrawer_1w259_870",Ya="_detailPopupLayer_1w259_886",Xa="_detailDialog_1w259_902",qa="_detailDialogHeader_1w259_919",Ja="_detailTitleBlock_1w259_930",Za="_detailEyebrow_1w259_952",Qa="_detailHeaderActions_1w259_961",en="_detailDialogBody_1w259_969",sn="_detailPreviewPane_1w259_978",tn="_detailPreview_1w259_978",an="_detailPreviewFallback_1w259_990",nn="_detailContentPane_1w259_1026",on="_formStack_1w259_1032",ln="_drawerHeader_1w259_1036",rn="_detailSection_1w259_1087",cn="_noticeList_1w259_1088",dn="_settingsPanel_1w259_1089",un="_setupNotice_1w259_1106",pn="_field_1w259_1131",hn="_fieldLabelRow_1w259_1139",mn="_fieldHelp_1w259_1163",xn="_twoColumn_1w259_1168",gn="_technicalDetails_1w259_1179",fn="_detailGrid_1w259_1196",bn="_metadataList_1w259_1197",yn="_compactMeta_1w259_1208",jn="_copyableValue_1w259_1235",vn="_inlineCopyButton_1w259_1246",Cn="_hashText_1w259_1267",_n="_usageList_1w259_1271",Sn="_usageItem_1w259_1277",wn="_metadataItem_1w259_1278",Nn="_settingsSubsection_1w259_1326",An="_settingsSectionHeader_1w259_1331",In="_settingsDefinitionList_1w259_1344",Pn="_toggleRow_1w259_1366",kn="_inlineHelp_1w259_1380",a={page:St,experimentalBadge:wt,toolbarShell:Nt,toolbar:At,segmented:It,placeContextSlot:Pt,listContextSummary:kt,toolbarActions:Rt,categoryControl:$t,contextDivider:Lt,categoryControlLabel:Bt,categoryRail:Ut,categoryButton:Tt,categoryButtonActive:Et,copyRow:Dt,buttonRow:Ft,segmentedActive:Mt,placeSelectorLabel:Ot,placeSelect:zt,sharedPlaceContext:Ht,commandButton:Kt,primaryButton:Gt,iconButton:Wt,dangerButton:Vt,iconButtonActive:Yt,grid:Xt,folderGrid:qt,explorer:Jt,explorerToolbar:Zt,explorerLocation:Qt,breadcrumb:ea,breadcrumbSegment:sa,viewOptions:ta,organizationModeControl:aa,viewModeControl:na,gridSizeControl:oa,explorerSection:la,folderTile:ra,folderListRow:ia,assetListRow:ca,assetCard:da,folderIcon:ua,folderName:pa,folderCount:ha,assetList:ma,folderList:xa,assetListHeader:ga,listPreviewWrap:fa,listPreview:ba,listPreviewFallback:ya,listAssetName:ja,listAssetCategory:va,listAssetScope:Ca,listAssetUpdated:_a,folderType:Sa,folderScope:wa,folderStatus:Na,folderUpdated:Aa,assetCardSelected:Ia,thumbnailWrap:Pa,thumbnail:ka,thumbnailFallback:Ra,assetCardBody:$a,assetName:La,assetMeta:Ba,statusChip:Ua,categoryPill:Ta,assetId:Ea,scopeText:Da,muted:Fa,emptyState:Ma,notice:Oa,errorState:za,messageState:Ha,proNotice:Ka,rbxmGuide:Ga,settingsInlinePanel:Wa,settingsDrawer:Va,detailPopupLayer:Ya,detailDialog:Xa,detailDialogHeader:qa,detailTitleBlock:Ja,detailEyebrow:Za,detailHeaderActions:Qa,detailDialogBody:en,detailPreviewPane:sn,detailPreview:tn,detailPreviewFallback:an,detailContentPane:nn,formStack:on,drawerHeader:ln,detailSection:rn,noticeList:cn,settingsPanel:dn,setupNotice:un,field:pn,fieldLabelRow:hn,fieldHelp:mn,twoColumn:xn,technicalDetails:gn,detailGrid:fn,metadataList:bn,compactMeta:yn,copyableValue:jn,inlineCopyButton:vn,hashText:Cn,usageList:_n,usageItem:Sn,metadataItem:wn,settingsSubsection:Nn,settingsSectionHeader:An,settingsDefinitionList:In,toggleRow:Pn,inlineHelp:kn},Rn={image:As,decal:zs,audio:Ms,mesh:Ks,model:Ns,video:Xs,animation:Vs};function Ne(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 $n(e){return e.category==="decal"?e.roblox.creatorAssetId??e.roblox.assetId:e.roblox.assetId}function vs(e,t){var g;const r=((g=e.rbxm)==null?void 0:g.studioUploads)??[];if(r.length===0)return null;const n=r.filter(m=>m.status==="uploaded").length,l=r.filter(m=>m.status==="failed").length,f=[n>0?`${n} ${t("assets.detail.rbxmStudioUploadsUploaded","uploaded")}`:null,l>0?`${l} ${t("assets.detail.rbxmStudioUploadsFailed","failed")}`:null].filter(Boolean);return`${t("assets.detail.rbxmStudioUploadsLabel","Studio uploads")}: ${f.join(", ")}`}function Ln({assets:e,selectedAssetId:t,selectedAssetKey:r=null,viewMode:n="grid",gridSize:l="medium",onSelect:f}){const{t:g}=me();return e.length===0?s.jsxs("div",{className:a.emptyState,children:[s.jsx("p",{children:g("assets.empty.title","No assets yet")}),s.jsx("span",{children:g("assets.empty.body","Choose a scope and category, then rescan that inbox folder.")})]}):s.jsx("div",{className:n==="list"?a.assetList:a.grid,"data-view-mode":n,"data-grid-size":l,children:e.map(m=>{const p=Rn[m.category],R=$n(m),V=vs(m,g),U=te(m),k=r?r===U:t===m.id,o=m.scope.kind==="shared"?g("assets.scope.shared","Shared"):g("assets.scope.place","Current Place");return n==="list"?s.jsxs("button",{type:"button",className:[a.assetListRow,k?a.assetCardSelected:""].filter(Boolean).join(" "),onClick:()=>f(U),children:[s.jsx("span",{className:a.listPreviewWrap,children:Qe(m)?s.jsx("img",{className:a.listPreview,src:He(m),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:m.displayName}),s.jsx("span",{className:a.listAssetCategory,children:de(m,g)}),s.jsx("span",{className:a.listAssetScope,children:o}),s.jsx(De,{variant:Ze(m.status),className:a.statusChip,children:Ne(m.status,g)}),s.jsx("time",{className:a.listAssetUpdated,dateTime:m.updatedAt,children:new Date(m.updatedAt).toLocaleDateString()})]},U):s.jsxs("button",{type:"button",className:[a.assetCard,k?a.assetCardSelected:""].filter(Boolean).join(" "),onClick:()=>f(U),children:[s.jsx("span",{className:a.thumbnailWrap,children:Qe(m)?s.jsx("img",{className:a.thumbnail,src:He(m),alt:m.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:m.displayName}),s.jsxs("span",{className:a.assetMeta,children:[s.jsx(De,{variant:"neutral",className:a.categoryPill,children:de(m,g)}),s.jsx(De,{variant:Ze(m.status),className:a.statusChip,children:Ne(m.status,g)})]}),s.jsxs("span",{className:a.assetMeta,children:[s.jsx("span",{className:a.scopeText,children:o}),s.jsx("span",{className:a.assetId,children:R?`#${R}`:V??g("assets.status.localOnly","Local only")})]})]})]},U)})})}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 Bn(e,t){var r;return t?e.folderPath===t||((r=e.folderPath)==null?void 0:r.startsWith(`${t}/`))===!0:!0}function Un({displayScope:e,assets:t,place:r,categoryFilter:n,organizationMode:l,viewMode:f,gridSize:g,selectedAssetKey:m,onSelectAsset:p,onClearSelection:R,onOrganizationModeChange:V,onViewModeChange:U,onGridSizeChange:k}){const{t:o}=me(),[S,X]=c.useState(()=>es(e)),T=c.useRef(`${e}:${r.placeId??"-"}`),z=c.useRef(!1),Q=c.useRef(null),E=h=>h==="shared"?o("assets.scope.shared","Shared"):r.placeName??o("assets.scope.place","Current Place"),W=h=>{z.current=!0,X(h),R()};c.useEffect(()=>{const h=`${e}:${r.placeId??"-"}`;T.current!==h&&(T.current=h,z.current=!0,X(es(e)),R())},[e,R,r.placeId]),c.useEffect(()=>{var h;z.current&&(z.current=!1,(h=Q.current)==null||h.focus())},[S]);const B=c.useMemo(()=>S.scope===null?[]:t.filter(h=>Me(h,S.scope,r.placeId)),[t,S.scope,r.placeId]);c.useEffect(()=>{if(S.scope===null)return;const h=_t(B,S.folderPath);h!==S.folderPath&&(z.current=!0,X(D=>({...D,folderPath:h})),R())},[n,S.folderPath,S.scope,R,B]);const q=c.useMemo(()=>l==="folders"?jt(B,S.folderPath):[],[S.folderPath,l,B]),K=c.useMemo(()=>e==="all"?t:t.filter(h=>Me(h,e,r.placeId)),[t,e,r.placeId]),M=c.useMemo(()=>l==="all-assets"?Ct(K):vt(B,S.folderPath),[K,S.folderPath,l,B]);c.useEffect(()=>{m&&(M.some(h=>te(h)===m)||R())},[R,m,M]);const I=S.folderPath?S.folderPath.split("/"):[],$=l==="all-assets"?o("assets.organization.all","All assets"):I[I.length-1]??(S.scope?E(S.scope):o("assets.scope.all","All scopes")),v=S.scope===null?t.length:B.filter(h=>Bn(h,S.folderPath)).length,N=Math.max(0,v-M.length),b=l==="all-assets"?o("assets.organization.summary","{count} assets").replace("{count}",String(M.length)):o("assets.explorer.summary","{direct} in this folder · {descendant} in subfolders").replace("{direct}",String(M.length)).replace("{descendant}",String(N)),i=h=>h===1?o("assets.folder.count.one","1 asset"):o("assets.folder.count.many","{count} assets").replace("{count}",String(h)),P=(h,D,A,x,G)=>s.jsxs("button",{type:"button",className:f==="list"?a.folderListRow:a.folderTile,"aria-label":`${D}, ${i(A)}`,onClick:G,children:[s.jsx("span",{className:a.folderIcon,"aria-hidden":"true",children:s.jsx(Is,{size:f==="list"?22:28})}),s.jsx("span",{className:a.folderName,children:D}),f==="list"?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:a.folderType,children:o("assets.folder.type","Folder")}),s.jsx("span",{className:a.folderScope,children:E(x)}),s.jsx("span",{className:a.folderStatus,children:i(A)}),s.jsx("span",{className:a.folderUpdated,children:"—"})]}):s.jsx("span",{className:a.folderCount,children:i(A)})]},h),J=l==="folders"&&e==="all"&&S.scope===null?[{scope:"place",name:E("place")},{scope:"shared",name:E("shared")}].map(({scope:h,name:D})=>({scope:h,name:D,count:t.filter(A=>Me(A,h,r.placeId)).length})):[];return s.jsxs("section",{className:a.explorer,"aria-label":o("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":o("assets.breadcrumb.label","Asset path"),children:[l==="all-assets"?s.jsxs(s.Fragment,{children:[s.jsx("span",{children:e==="all"?o("assets.scope.all","All scopes"):E(e)}),s.jsx(Fe,{size:14,"aria-hidden":"true"}),s.jsx("span",{"aria-current":"page",children:o("assets.organization.all","All assets")})]}):e==="all"?S.scope===null?s.jsx("span",{"aria-current":"page",children:o("assets.scope.all","All scopes")}):s.jsx("button",{type:"button",onClick:()=>W({scope:null,folderPath:""}),children:o("assets.scope.all","All scopes")}):null,l==="folders"&&S.scope?s.jsxs(s.Fragment,{children:[e==="all"?s.jsx(Fe,{size:14,"aria-hidden":"true"}):null,I.length>0?s.jsx("button",{type:"button",onClick:()=>W({scope:S.scope,folderPath:""}),children:E(S.scope)}):s.jsx("span",{"aria-current":"page",children:E(S.scope)})]}):null,l==="folders"&&I.map((h,D)=>{const A=I.slice(0,D+1).join("/"),x=D===I.length-1;return s.jsxs("span",{className:a.breadcrumbSegment,children:[s.jsx(Fe,{size:14,"aria-hidden":"true"}),x?s.jsx("span",{"aria-current":"page",children:h}):s.jsx("button",{type:"button",onClick:()=>W({scope:S.scope,folderPath:A}),children:h})]},A)})]}),s.jsx("h2",{ref:Q,tabIndex:-1,children:$}),s.jsx("p",{children:b})]}),s.jsxs("div",{className:a.viewOptions,"aria-label":o("assets.view.options","View options"),children:[s.jsxs("div",{className:a.organizationModeControl,role:"group","aria-label":o("assets.organization.label","Browse"),children:[s.jsx("button",{type:"button","aria-pressed":l==="folders",onClick:()=>V("folders"),children:o("assets.organization.folders","Folders")}),s.jsx("button",{type:"button","aria-pressed":l==="all-assets",onClick:()=>V("all-assets"),children:o("assets.organization.all","All assets")})]}),s.jsxs("div",{className:a.viewModeControl,role:"group","aria-label":o("assets.view.mode","View mode"),children:[s.jsxs("button",{type:"button","aria-pressed":f==="grid",onClick:()=>U("grid"),children:[s.jsx(Js,{size:14}),o("assets.view.grid","Grid")]}),s.jsxs("button",{type:"button","aria-pressed":f==="list",onClick:()=>U("list"),children:[s.jsx(Qs,{size:14}),o("assets.view.list","List")]})]}),s.jsx("div",{className:a.gridSizeControl,role:"group","aria-label":o("assets.view.thumbnailSize","Thumbnail size"),title:f==="list"?o("assets.view.thumbnailSize.listReason","Thumbnail size is available in Grid view."):void 0,children:["small","medium","large"].map(h=>s.jsx("button",{type:"button","aria-pressed":g===h,disabled:f==="list",onClick:()=>k(h),children:o(`assets.view.size.${h}`,h[0].toUpperCase()+h.slice(1))},h))})]})]}),f==="list"&&(J.length>0||q.length>0||M.length>0)?s.jsxs("div",{className:a.assetListHeader,"aria-hidden":"true",children:[s.jsx("span",{}),s.jsx("span",{children:o("assets.list.name","Name")}),s.jsx("span",{children:o("assets.list.type","Type")}),s.jsx("span",{children:o("assets.list.scope","Scope")}),s.jsx("span",{children:o("assets.list.status","Status")}),s.jsx("span",{children:o("assets.list.updated","Updated")})]}):null,J.length>0?s.jsxs("section",{className:a.explorerSection,children:[s.jsx("h3",{children:o("assets.folders.title","Folders")}),s.jsx("div",{className:f==="list"?a.folderList:a.folderGrid,"data-grid-size":g,children:J.map(h=>P(`scope:${h.scope}`,h.name,h.count,h.scope,()=>W({scope:h.scope,folderPath:""})))})]}):null,q.length>0?s.jsxs("section",{className:a.explorerSection,children:[s.jsx("h3",{children:o("assets.folders.title","Folders")}),s.jsx("div",{className:f==="list"?a.folderList:a.folderGrid,"data-grid-size":g,children:q.map(h=>P(h.path,h.name,h.descendantCount,S.scope,()=>W({scope:S.scope,folderPath:h.path})))})]}):null,M.length>0?s.jsxs("section",{className:a.explorerSection,"aria-label":l==="all-assets"?o("assets.organization.all","All assets"):void 0,children:[l==="folders"?s.jsx("h3",{children:o("assets.folder.assetsTitle","Assets in this folder")}):null,s.jsx(Ln,{assets:M,selectedAssetId:null,selectedAssetKey:m,viewMode:f,gridSize:g,onSelect:p})]}):null,q.length===0&&M.length===0&&(J.length===0||t.length===0)?s.jsxs("div",{className:a.emptyState,children:[s.jsx("p",{children:t.length===0?n==="all"?o("assets.empty.title","No assets yet"):o("assets.empty.filteredTitle","No assets match this filter"):o("assets.empty.folderTitle","No matching assets in this folder")}),s.jsx("span",{children:t.length===0?n==="all"?o("assets.empty.body","Choose a scope and category, then rescan that inbox folder."):o("assets.empty.filteredBody","Choose another category or rescan the matching inbox folders."):o("assets.empty.folderBody","Try another folder or category filter.")})]}):null]})}const Tn="https://create.roblox.com/dashboard/creations/store",En=/^https:\/\/create\.roblox\.com\/store\/asset\/\d+(?:\/.*)?$/;function Dn(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function Se(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"),l=String(t.getDate()).padStart(2,"0"),f=String(t.getHours()).padStart(2,"0"),g=String(t.getMinutes()).padStart(2,"0");return`${r}-${n}-${l} ${f}:${g}`}function Fn(e){return e.category==="image"||e.category==="decal"||!!e.file.preview}function Mn(e){return e.file.preview?He(e):bs(e)}function On(e){var r;const t=Object.entries(((r=e.rbxm)==null?void 0:r.classCounts)??{}).sort((n,l)=>l[1]-n[1]).slice(0,8);return t.length===0?"-":t.map(([n,l])=>`${n} ${l}`).join(", ")}function ss(e){var l;const t=(l=e.rbxm)==null?void 0:l.thumbnail;if(!t)return"-";const r=t.source?` via ${t.source}`:"",n=t.message?` · ${t.message}`:"";return`${t.status}${r}${n}`}function zn(e){var l,f;const t=(f=(l=e.rbxm)==null?void 0:l.review)==null?void 0:f.summary;if(!t)return"-";const r=[["roots",t.rootCount],["parts",t.partCount],["mesh parts",t.meshPartCount],["scripts",t.scriptCount],["unanchored",t.unanchoredPartCount]].flatMap(([g,m])=>typeof m=="number"?[`${g} ${m}`]:[]),n=t.bounds;if(n&&typeof n=="object"&&"size"in n){const g=n.size;if(g&&typeof g=="object"){const{x:m,y:p,z:R}=g;typeof m=="number"&&typeof p=="number"&&typeof R=="number"&&r.push(`bounds ${m} x ${p} x ${R}`)}}return r.length>0?r.join(", "):"-"}function Hn(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 Kn(e){return`${Tn}/${e}/configure`}function Gn(e){return e.category==="decal"?e.roblox.creatorAssetId??e.roblox.assetId??null:e.roblox.assetId??null}function Wn(e){const t=Gn(e),r=t?Kn(t):null,n=e.category==="decal"?e.roblox.creatorAssetWebUrl??e.roblox.assetWebUrl:e.roblox.assetWebUrl;return!n||r&&En.test(n)?r:n}function Vn(e){return`${Se(e.startedAt)} -> ${e.status}`}function ns(e){return!e.creatorType||!e.creatorId?null:`${e.creatorType} ${e.creatorId}`}function os(e){return e.assetRole?`Asset role: ${e.assetRole}`:null}function Yn(e){const t=e.sourceProperty?` · ${e.sourceProperty}`:"";return`${e.path} · ${e.assetType} · ${e.status}${t}`}function Xn(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(gs,{size:13})}):null}function qn({asset:e,busyAction:t,canUpload:r,canImportRbxm:n,importRbxmTooltip:l,importRbxmTargetParent:f,onClose:g,onSave:m,onUpload:p,onDelete:R,onImportRbxm:V,onRefreshStatus:U,onScanUsage:k}){var N,b;const{t:o}=me(),S=c.useRef(null),[X,T]=c.useState(""),[z,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 P;if(!e)return;(P=S.current)==null||P.focus();const i=J=>{J.key==="Escape"&&g()};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[e,g]),!e)return null;const E=e.status==="processing"&&!!(e.roblox.operationId??e.roblox.operationPath),W=!!e.roblox.assetUri,B=Wn(e),q=e.roblox.uploadAttempts??[],K=e.category==="decal"&&!!(e.roblox.creatorAssetId||e.roblox.backingImageAssetId||e.roblox.assetId),M=e.roblox.creatorAssetId??e.roblox.assetId,I=e.roblox.backingImageAssetId??e.roblox.assetId,$=vs(e,o),v=e.roblox.assetId?e.usage.lastScannedAt?o("assets.detail.noUsageAfterScan","No references were found in local Sync files during the last check."):o("assets.detail.noUsageUnscanned","Run Scan usage to search local Sync files for this Roblox Asset ID."):o("assets.detail.noUsageNoRobloxId","This asset does not have a Roblox Asset ID yet, so usage cannot be checked. Upload it before scanning usage.");return s.jsx("div",{className:a.detailPopupLayer,onClick:g,role:"presentation",children:s.jsxs("section",{ref:S,className:a.detailDialog,role:"dialog","aria-modal":"true","aria-label":o("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,o)," · ",Ne(e.status,o)]}),s.jsx("h2",{children:e.displayName}),s.jsx("span",{children:e.id})]}),s.jsxs("div",{className:a.detailHeaderActions,children:[s.jsx(Z,{text:r?o("assets.upload.open.tooltip","Upload this local file to Roblox through Open Cloud."):o("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(ot,{size:15}),o("assets.upload.open","Upload")]})}),n&&s.jsx(Z,{text:l,children:s.jsxs("button",{type:"button",className:a.commandButton,disabled:t==="import-rbxm",onClick:()=>void V(),children:[s.jsx(Ps,{size:15}),o("assets.detail.importRbxm","Insert into Studio")]})}),s.jsxs("button",{type:"button",className:a.commandButton,disabled:!E||t==="status-refresh",onClick:()=>void U(),children:[s.jsx(hs,{size:15}),o("assets.detail.refreshStatus","Refresh")]}),s.jsxs("button",{type:"button",className:a.commandButton,disabled:!e.roblox.assetId||t==="usage-scan",onClick:()=>void k(),children:[s.jsx(st,{size:15}),o("assets.detail.scanUsage","Scan usage")]}),s.jsx(Z,{text:o("assets.delete.tooltip","Delete this local Asset Library item."),children:s.jsxs("button",{type:"button",className:`${a.commandButton} ${a.dangerButton}`,disabled:t==="delete",onClick:R,children:[s.jsx(at,{size:15}),o("common.delete","Delete")]})}),s.jsx(Z,{text:o("common.close","Close"),children:s.jsx("button",{type:"button",className:a.iconButton,onClick:g,"aria-label":o("common.close","Close"),children:s.jsx(Ge,{size:16})})})]})]}),s.jsxs("div",{className:a.detailDialogBody,children:[s.jsx("div",{className:a.detailPreviewPane,children:Fn(e)?s.jsx("img",{className:a.detailPreview,src:Mn(e),alt:e.displayName}):s.jsxs("div",{className:a.detailPreviewFallback,children:[s.jsx("span",{children:de(e,o)}),s.jsx("code",{children:e.file.original}),((N=e.rbxm)==null?void 0:N.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:o("assets.detail.displayName","Display name")}),s.jsx("input",{value:X,onChange:i=>T(i.target.value)})]}),s.jsxs("label",{className:a.field,children:[s.jsx("span",{children:o("assets.detail.description","Description")}),s.jsx("textarea",{value:z,rows:3,onChange:i=>Q(i.target.value)})]}),s.jsx("button",{type:"button",className:a.primaryButton,disabled:t==="update",onClick:()=>void m(X,z),children:o("assets.detail.save","Save metadata")})]}),s.jsxs("section",{className:a.detailSection,children:[s.jsx("h3",{children:o("assets.detail.localFile","Local file")}),s.jsxs("dl",{className:a.detailGrid,children:[s.jsx("dt",{children:o("assets.detail.fileName","File")}),s.jsx("dd",{children:e.file.original}),s.jsx("dt",{children:o("assets.detail.source","Source path")}),s.jsx("dd",{children:e.source.originalPath}),s.jsx("dt",{children:o("assets.detail.category","Category")}),s.jsx("dd",{children:de(e,o)}),s.jsx("dt",{children:o("assets.detail.scope","Scope")}),s.jsx("dd",{children:e.scope.kind==="shared"?o("assets.scope.shared","Shared"):o("assets.scope.place","Current Place")}),s.jsx("dt",{children:o("assets.detail.mimeType","Type")}),s.jsx("dd",{children:e.file.mimeType}),s.jsx("dt",{children:o("assets.detail.size","Size")}),s.jsx("dd",{children:Dn(e.file.sizeBytes)}),ts(e)&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:o("assets.detail.dimensions","Dimensions")}),s.jsx("dd",{children:ts(e)})]}),as(e)&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:o("assets.detail.duration","Duration")}),s.jsx("dd",{children:as(e)})]})]})]}),e.rbxm&&s.jsxs("section",{className:a.detailSection,children:[s.jsx("h3",{children:o("assets.detail.rbxm","RBXM contents")}),s.jsxs("dl",{className:a.detailGrid,children:[s.jsx("dt",{children:o("assets.detail.rbxmExportedCount","Exported roots")}),s.jsx("dd",{children:e.rbxm.exportedCount}),s.jsx("dt",{children:o("assets.detail.rbxmClasses","Classes")}),s.jsx("dd",{children:On(e)}),s.jsx("dt",{children:o("assets.detail.rbxmThumbnail","Thumbnail")}),s.jsx("dd",{children:ss(e)}),$&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:o("assets.detail.rbxmStudioUploadsLabel","Studio uploads")}),s.jsx("dd",{children:$})]}),n&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:o("assets.detail.studioInsertTarget","Studio insert target")}),s.jsx("dd",{children:f})]})]}),e.rbxm.roots.length>0&&s.jsxs("div",{className:a.metadataList,children:[s.jsx("strong",{children:o("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:o("assets.detail.rbxmReferences","Asset references")}),e.rbxm.resourceReferences.map((i,P)=>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}-${P}`))]}),e.rbxm.studioUploads&&e.rbxm.studioUploads.length>0&&s.jsxs("div",{className:a.metadataList,children:[s.jsx("strong",{children:o("assets.detail.rbxmStudioUploads","Embedded Studio uploads")}),e.rbxm.studioUploads.map((i,P)=>s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:Yn(i)}),s.jsx("code",{children:Xn(i)})]},`${i.path}-${i.assetType}-${i.sourceProperty??""}-${P}`))]}),e.rbxm.generation&&s.jsxs("div",{className:a.metadataList,children:[s.jsx("strong",{children:o("assets.detail.rbxmGeneration","Generated model")}),s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:o("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:o("assets.detail.rbxmGenerationPrompt","Prompt")}),s.jsx("code",{children:e.rbxm.generation.prompt})]}),s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:o("assets.detail.rbxmGenerationSchema","Schema")}),s.jsx("code",{children:Hn(e)})]}),e.rbxm.generation.path&&s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:o("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:o("assets.detail.rbxmReview","Model review")}),s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:o("assets.detail.rbxmReviewReadiness","Readiness")}),s.jsx("code",{children:e.rbxm.review.readiness})]}),s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:o("assets.detail.rbxmReviewSummary","Summary")}),s.jsx("code",{children:zn(e)})]}),e.rbxm.review.findings.slice(0,8).map((i,P)=>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}-${P}`))]})]}),s.jsxs("section",{className:a.detailSection,children:[s.jsx("h3",{children:o("assets.detail.roblox","Roblox upload status")}),s.jsxs("dl",{className:a.detailGrid,children:[s.jsx("dt",{children:o("assets.detail.status","Status")}),s.jsx("dd",{children:Ne(e.status,o)}),K?s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:o("assets.detail.decalAssetId","Roblox Decal ID")}),s.jsxs("dd",{className:a.copyableValue,children:[s.jsx("span",{children:M??o("assets.status.localOnly","Local only")}),s.jsx(ve,{label:o("assets.detail.copyDecalAssetId","Copy Roblox Decal ID"),value:M})]}),s.jsx("dt",{children:o("assets.detail.studioTextureImageId","Studio Texture Image ID")}),s.jsxs("dd",{className:a.copyableValue,children:[s.jsx("span",{children:I??"-"}),s.jsx(ve,{label:o("assets.detail.copyStudioTextureImageId","Copy Studio Texture Image ID"),value:I})]})]}):s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:o("assets.detail.assetId","Asset ID")}),s.jsxs("dd",{className:a.copyableValue,children:[s.jsx("span",{children:e.roblox.assetId??o("assets.status.localOnly","Local only")}),s.jsx(ve,{label:o("assets.detail.copyAssetId","Copy Asset ID"),value:e.roblox.assetId})]})]}),s.jsx("dt",{children:o("assets.detail.studioUri","Studio URI")}),s.jsx("dd",{children:e.roblox.assetUri??"-"}),s.jsx("dt",{children:o("assets.detail.robloxWebUrl","Creator Dashboard URL")}),s.jsxs("dd",{className:a.copyableValue,children:[s.jsx("span",{children:B??"-"}),s.jsx(ve,{label:o("assets.detail.copyWebUrl","Copy configure URL"),value:B})]}),e.roblox.errorMessage&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:o("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:!W,onClick:()=>{var i;return e.roblox.assetUri&&void((i=navigator.clipboard)==null?void 0:i.writeText(e.roblox.assetUri))},children:[s.jsx(gs,{size:15}),o("assets.detail.copyStudioUri","Copy Studio URI")]}),B&&s.jsxs("a",{className:a.commandButton,href:B,target:"_blank",rel:"noreferrer",children:[s.jsx(ks,{size:15}),o("assets.detail.openRobloxPage","Open configure page")]})]}),e.roblox.assetId&&s.jsx("p",{className:a.muted,children:o("assets.detail.robloxWebUrlNotice","Opening this page requires the Roblox account that owns or can manage the uploaded asset.")}),q.length>0&&s.jsxs("div",{className:a.metadataList,children:[s.jsx("strong",{children:o("assets.detail.uploadHistory","Upload history")}),q.slice().reverse().map((i,P)=>s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:Vn(i)}),ns(i)&&s.jsx("code",{children:ns(i)}),os(i)&&s.jsx("code",{children:os(i)}),i.operationPath&&s.jsx("code",{children:i.operationPath}),i.assetId&&s.jsxs("code",{children:[o("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??P}`))]})]}),s.jsxs("section",{className:a.detailSection,children:[s.jsx("h3",{children:o("assets.detail.usedInPlace","Where this asset is used in this Place")}),s.jsxs("dl",{className:a.detailGrid,children:[s.jsx("dt",{children:o("assets.detail.usageSource","Checked against")}),s.jsx("dd",{children:e.usage.scanSource==="localSync"?o("assets.detail.usageSource.localSync","Local Sync files"):o("assets.detail.usageSource.notScanned","Not checked yet")}),s.jsx("dt",{children:o("assets.detail.lastScanned","Last checked")}),s.jsx("dd",{children:e.usage.lastScannedAt?o("assets.detail.lastScannedAt","Last checked: {time}").replace("{time}",Se(e.usage.lastScannedAt)):o("assets.detail.lastScanned.never","No check yet")})]}),e.usage.references.length===0?s.jsx("p",{className:a.muted,children:v}):s.jsx("div",{className:a.usageList,children:e.usage.references.map((i,P)=>s.jsxs("div",{className:a.usageItem,children:[s.jsx("strong",{children:i.kind==="property"?i.instancePath:i.filePath}),s.jsx("span",{children:i.property??o("assets.detail.line","line {line}").replace("{line}",String(i.line??"-"))}),s.jsx("code",{children:i.value})]},`${i.kind}-${P}`))})]}),s.jsxs("details",{className:a.technicalDetails,children:[s.jsx("summary",{children:o("assets.detail.technicalDetails","Technical details")}),s.jsxs("dl",{className:a.detailGrid,children:[s.jsx("dt",{children:o("assets.detail.stableId","Stable ID")}),s.jsx("dd",{className:a.hashText,children:e.id}),s.jsx("dt",{children:o("assets.detail.sourceKind","Source kind")}),s.jsx("dd",{children:e.source.kind}),s.jsx("dt",{children:o("assets.detail.sha256","SHA-256")}),s.jsx("dd",{className:a.hashText,children:e.file.sha256}),s.jsx("dt",{children:o("assets.detail.createdAt","Created")}),s.jsx("dd",{children:Se(e.createdAt)}),s.jsx("dt",{children:o("assets.detail.updatedAt","Updated")}),s.jsx("dd",{children:Se(e.updatedAt)}),e.roblox.operationId&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:o("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:o("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:o("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:o("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:o("assets.detail.moderationState","Moderation")}),s.jsx("dd",{children:e.roblox.moderationState})]})]}),((b=e.rbxm)==null?void 0:b.thumbnail.attempts)&&e.rbxm.thumbnail.attempts.length>0&&s.jsxs("div",{className:a.metadataList,children:[s.jsx("strong",{children:o("assets.detail.rbxmThumbnailAttempts","Thumbnail attempts")}),e.rbxm.thumbnail.attempts.map((i,P)=>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}-${P}`))]})]})]})]})]})})}function Cs(e){return{assetUploadByOpenCloudEnabled:e.hot.ENABLE_ASSET_UPLOAD_BY_OPEN_CLOUD===!0}}function Jn(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 Zn(e){const t=await O.patch("/api/dashboard/settings",Jn(e));return Cs(t)}async function Ss(){return O.get("/api/dashboard/open-cloud/credential-profiles")}async function Qn(e){return O.post("/api/dashboard/open-cloud/credential-profiles",e)}async function eo(e){return O.patch("/api/dashboard/open-cloud/credential-profiles/active",{profileId:e})}async function so(e,t){return O.put(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}/api-key`,t)}async function to(e){return O.delete(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}`)}async function ao(e,t){return O.post(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}/creators`,t)}async function no(e,t){return O.patch(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}/creators/${encodeURIComponent(t)}/default`,{})}async function oo(e,t){return O.delete(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}/creators/${encodeURIComponent(t)}`)}async function lo(e,t){return O.post(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}/test`,t?{creatorPresetId:t}:{})}async function ro(e){return O.post("/api/dashboard/open-cloud/credential/test",e?{apiKey:e}:{})}function io(e){return e.category==="image"||e.category==="decal"}function co(e,t){return e==="group"?t("assets.creator.group","Group"):t("assets.creator.user","User")}function uo(e,t){return`${e.label} · ${co(e.creatorType,t)} ${e.creatorId}`}function ls(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 po({asset:e,open:t,canUpload:r,busyAction:n,onClose:l,onBack:f,onOpenSettings:g,onUpload:m}){const{t:p}=me(),R=c.useRef(null),[V,U]=c.useState(null),[k,o]=c.useState(null),[S,X]=c.useState(!1),[T,z]=c.useState(null),[Q,E]=c.useState(""),[W,B]=c.useState(""),[q,K]=c.useState(""),[M,I]=c.useState("user"),[$,v]=c.useState("");if(c.useEffect(()=>{E((e==null?void 0:e.displayName)??""),B((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 C=!1;return X(!0),z(null),(async()=>{try{const[H,Y]=await Promise.all([_s(),Ss()]);if(C)return;U(H);const re=Y.profiles.find(ae=>ae.id===Y.activeProfileId)??Y.profiles[0]??null;o(re);const ee=ls(re);K((ee==null?void 0:ee.id)??""),I((ee==null?void 0:ee.creatorType)??"user"),v((ee==null?void 0:ee.creatorId)??"")}catch(H){if(C)return;z(H instanceof Error?H.message:p("assets.upload.settingsLoadFailed","Failed to load upload settings.")),U(null),o(null)}finally{C||X(!1)}})(),()=>{C=!0}},[t,p]),c.useEffect(()=>{var H;if(!t||!e)return;(H=R.current)==null||H.focus();const C=Y=>{Y.key==="Escape"&&l()};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[e,l,t]),!t||!e)return null;const N=(V==null?void 0:V.assetUploadByOpenCloudEnabled)===!0,b=!!k,i=ls(k),P=(k==null?void 0:k.creators.find(C=>C.id===q))??null,J=!!i,D=(k==null?void 0:k.storageProvider)==="env"&&b&&!J,A=D&&$.trim().length>0,x=r&&!S&&!T&&(!N||!b||!J&&!D),G=r&&!S&&!T&&N&&b&&(J||A)&&n!=="upload";return s.jsx("div",{className:a.detailPopupLayer,onClick:l,role:"presentation",children:s.jsxs("section",{ref:R,className:a.detailDialog,role:"dialog","aria-modal":"true","aria-label":p("assets.upload.title","Upload asset"),tabIndex:-1,onClick:C=>C.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:f,children:[s.jsx(Ds,{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:l,"aria-label":p("common.close","Close"),children:s.jsx(Ge,{size:16})})})]})]}),s.jsxs("div",{className:a.detailDialogBody,children:[s.jsx("div",{className:a.detailPreviewPane,children:io(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.")}),S&&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})]}),x&&s.jsxs("div",{className:a.setupNotice,children:[s.jsx("strong",{children:p("assets.upload.settingsRequired","Upload settings required")}),s.jsx("p",{children:b?N?p("assets.upload.settingsRequired.creator","Save a default Creator before uploading."):p("assets.upload.settingsRequired.toggle","Enable Open Cloud upload before uploading."):p("assets.upload.settingsRequired.apiKey","Save an Open Cloud API key before uploading.")}),s.jsxs("button",{type:"button",className:a.commandButton,onClick:g,children:[s.jsx(ms,{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:C=>E(C.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:W,rows:3,disabled:!r,onChange:C=>B(C.target.value)}),s.jsx("small",{className:a.fieldHelp,children:p("assets.upload.descriptionHelp","Saved to Roblox as the asset description.")})]}),J&&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:q,disabled:!r||S,onChange:C=>K(C.target.value),children:k==null?void 0:k.creators.map(C=>s.jsx("option",{value:C.id,children:uo(C,p)},C.id))}),s.jsx("small",{className:a.fieldHelp,children:p("assets.upload.creatorHelp","Used by Open Cloud as the owner of the uploaded asset.")})]}),D&&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:M,disabled:!r,onChange:C=>I(C.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:$,disabled:!r,onChange:C=>v(C.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:!G,onClick:()=>{const C=$.trim(),H=D&&C?{creatorType:M,creatorId:C}:{},Y=!D&&P&&i&&P.id!==i.id?{creatorType:P.creatorType,creatorId:P.creatorId}:{};m({displayName:Q,description:W,...H,...Y})},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 rs(e,t){return e==="env"?t("assets.settings.credential.env","Environment variable"):t("assets.settings.credential.local","Local encrypted file")}function Oe(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 ho(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 mo(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 xo(e,t){return e==="group"?t("assets.creator.group","Group"):t("assets.creator.user","User")}function go(e,t){return`${xo(e.creatorType,t)} ${e.creatorId}`}function fo({open:e,tier:t,onClose:r}){const{t:n}=me(),[l,f]=c.useState(null),[g,m]=c.useState(null),[p,R]=c.useState(""),[V,U]=c.useState(!1),[k,o]=c.useState(""),[S,X]=c.useState(""),[T,z]=c.useState("user"),[Q,E]=c.useState(""),[W,B]=c.useState(""),[q,K]=c.useState(!0),[M,I]=c.useState(null),[$,v]=c.useState(null),[N,b]=c.useState(!1),i=t==="basic",P=c.useCallback(async()=>{b(!0),I(null);try{const[u,_]=await Promise.all([_s(),Ss()]);f(u),m(_);const L=_.profiles.find(ue=>ue.id===_.activeProfileId)??_.profiles[0]??null;R((L==null?void 0:L.id)??""),U(!L),K(!L||L.creators.length===0),z("user"),E(""),B("")}catch(u){I(u instanceof Error?u.message:n("assets.settings.loadFailed","Failed to load upload settings."))}finally{b(!1)}},[n]);if(c.useEffect(()=>{e&&P()},[P,e]),!e)return null;const J=(l==null?void 0:l.assetUploadByOpenCloudEnabled)===!0,h=S.trim(),D=Q.trim(),A=(g==null?void 0:g.profiles)??[],x=A.find(u=>u.id===p)??A[0]??null,G=!!x,C=G&&(x==null?void 0:x.storageProvider)==="localFile",H=G&&(x==null?void 0:x.storageProvider)==="env",Y=x!=null&&x.defaultCreatorId?x.creators.find(u=>u.id===x.defaultCreatorId):x==null?void 0:x.creators[0],re=!!(x!=null&&x.creators.length),ee=!re||q,ae=A.length>1,ie=i?n("assets.settings.action.proRequired","Asset upload settings are available on Pro."):N?n("assets.settings.action.busy","Wait for the current settings action to finish."):null,Pe=i||N||!h,ke=ie??(h?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||N||!h&&!G,be=ie??(h?n("assets.settings.testConnection.tooltip.entered","Test the entered API key before saving it."):G?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||N||!C,je=ie??(C?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.")),Re=i||N||!C||!D,$e=ie??(H?n("assets.settings.saveCreator.tooltip.env","Environment API keys cannot save a default Creator here. Enter Creator details in the upload dialog."):C?D?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.")),Le=ie??(C?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||N||H||!C,Ue=ie??(C?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.")),Te=Y?n("assets.settings.saveCreatorPreset","Save Creator"):n("assets.settings.saveCreator","Save default Creator"),d=(x==null?void 0:x.label)??n("assets.settings.credential.none","No API key saved"),y=u=>{const _=u.profiles.find(L=>L.id===u.activeProfileId)??u.profiles[0]??null;m(u),R((_==null?void 0:_.id)??""),K(!_||_.creators.length===0),U(u.profiles.length===0)},j=async()=>{if(x){b(!0);try{const u=await lo(x.id,Y==null?void 0:Y.id);y(u),I(mo(u.validation,n))}catch(u){I(u instanceof Error?u.message:n("assets.settings.testFailed","Connection test failed."))}finally{b(!1)}}},w=async()=>{if($){b(!0);try{if($.kind==="apiKey"){const u=await to($.profileId);y(u),I(n("assets.settings.apiKeyRemoved","Open Cloud API key unregistered from local storage."))}else{const u=await oo($.profileId,$.creatorPresetId);y(u),I(n("assets.settings.creatorUnregistered","Creator unregistered from this profile."))}v(null)}catch(u){I(u instanceof Error?u.message:$.kind==="apiKey"?n("assets.settings.removeFailed","Failed to unregister API key."):n("assets.settings.creatorUnregisterFailed","Failed to unregister Creator."))}finally{b(!1)}}},F=($==null?void 0:$.kind)==="apiKey"?n("assets.settings.unregisterApiKey.title","Unregister API Key?"):n("assets.settings.unregisterCreator.title","Unregister Creator?"),ne=($==null?void 0:$.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=($==null?void 0:$.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(Ge,{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:J,disabled:i||N,onChange:u=>{(async()=>{b(!0);try{const _=await Zn({assetUploadByOpenCloudEnabled:u.target.checked});f(_),I(n("assets.settings.saved","Upload settings saved."))}catch(_){I(_ instanceof Error?_.message:n("assets.settings.saveFailed","Failed to save upload settings."))}finally{b(!1)}})()}})]}),ae&&s.jsx("div",{className:a.metadataList,children:A.map(u=>{const _=u.id===(x==null?void 0:x.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"),": ",rs(u.storageProvider,n)]}),s.jsxs("span",{children:[n("assets.settings.field.validationStatus","Validation status"),": ",Oe(u.validationStatus,n)]}),_&&s.jsx("code",{children:n("assets.settings.activeProfileBadge","Active")}),!_&&u.storageProvider==="localFile"&&s.jsx("button",{type:"button",className:a.commandButton,disabled:i||N,onClick:()=>{(async()=>{b(!0);try{const L=await eo(u.id),ue=L.profiles.find(Ee=>Ee.id===(L.activeProfileId??u.id))??u;m(L),R(ue.id),K(ue.creators.length===0),z("user"),E(""),B(""),I(n("assets.settings.profileSelected","Open Cloud credential profile selected."))}catch(L){I(L instanceof Error?L.message:n("assets.settings.saveFailed","Failed to save upload settings."))}finally{b(!1)}})()},children:n("assets.settings.useProfile","Use profile")})]},u.id)})}),x&&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:x.label})]}),x.maskedKey&&s.jsxs("div",{children:[s.jsx("dt",{children:n("assets.settings.field.apiKey","API Key")}),s.jsx("dd",{children:x.maskedKey})]}),s.jsxs("div",{children:[s.jsx("dt",{children:n("assets.settings.field.storage","Storage")}),s.jsx("dd",{children:rs(x.storageProvider,n)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:n("assets.settings.field.validationStatus","Validation status")}),s.jsx("dd",{children:Oe(x.validationStatus,n)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:n("assets.settings.field.creators","Creators")}),s.jsx("dd",{children:x.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:()=>{j()},children:n("assets.settings.testConnection","Test Connection")})}),C&&s.jsx("button",{type:"button",className:a.commandButton,disabled:i||N,onClick:()=>U(!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:()=>v({kind:"apiKey",profileId:x.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:k,disabled:i||N,onChange:u=>o(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(Xe,{topicId:"openCloudApiKey",variant:"field",state:{hasOpenCloudCredential:G}})]}),s.jsx("input",{id:"asset-settings-open-cloud-api-key",value:S,type:"password",disabled:i||N,onChange:u=>X(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.")})]}),!G&&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:ke,children:s.jsx("button",{type:"button",className:a.commandButton,disabled:Pe,onClick:()=>{(async()=>{var u;b(!0);try{const _={apiKey:h,...k.trim()?{label:k.trim()}:{}},L=(x==null?void 0:x.storageProvider)==="localFile"?await so(x.id,_):await Qn(_),ue=L.profiles.find(Ee=>{var Ye;return Ee.id===(L.activeProfileId??((Ye=L.profile)==null?void 0:Ye.id))});m(L),R(L.activeProfileId??((u=L.profile)==null?void 0:u.id)??""),K(!ue||ue.creators.length===0),U(!1),X(""),o(""),I(n("assets.settings.apiKeySaved","Open Cloud API key saved locally."))}catch(_){I(_ instanceof Error?_.message:n("assets.settings.saveFailed","Failed to save upload settings."))}finally{b(!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()=>{b(!0);try{const u=await ro(h||void 0);I(ho(u.validation,n))}catch(u){I(u instanceof Error?u.message:n("assets.settings.testFailed","Connection test failed."))}finally{b(!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:()=>{x&&v({kind:"apiKey",profileId:x.id})},children:n("assets.settings.removeApiKey","Unregister API Key")})})]})]}),s.jsx("div",{className:a.metadataList,children:x==null?void 0:x.creators.map(u=>s.jsxs("div",{className:a.metadataItem,children:[s.jsx("strong",{children:u.label}),s.jsx("span",{children:go(u,n)}),u.id===x.defaultCreatorId&&s.jsx("code",{children:n("assets.settings.defaultCreatorBadge","Default")}),s.jsxs("span",{children:[n("assets.settings.field.validationStatus","Validation status"),": ",Oe(u.validationStatus,n)]}),s.jsxs("div",{className:a.buttonRow,children:[u.id!==x.defaultCreatorId&&x.storageProvider==="localFile"&&s.jsx("button",{type:"button",className:a.commandButton,disabled:i||N,onClick:()=>{(async()=>{if(x){b(!0);try{const _=await no(x.id,u.id);m(_),I(n("assets.settings.defaultCreatorSaved","Open Cloud default Creator saved locally."))}catch(_){I(_ instanceof Error?_.message:n("assets.settings.saveFailed","Failed to save upload settings."))}finally{b(!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:()=>v({kind:"creator",profileId:x.id,creatorPresetId:u.id}),children:n("assets.settings.unregisterCreator","Unregister Creator")})})]})]},u.id))}),re&&!q&&s.jsx(Z,{text:Le,children:s.jsx("button",{type:"button",className:a.commandButton,disabled:i||N||H||!C,onClick:()=>{z("user"),E(""),B(""),K(!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||N||H||!C,onChange:u=>z(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(Xe,{topicId:"openCloudCreatorId",variant:"field",state:{hasDefaultCreator:!!Y}})]}),s.jsx("input",{id:"asset-settings-creator-id",value:Q,disabled:i||N||H||!C,onChange:u=>E(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:W,disabled:i||N||H||!C,onChange:u=>B(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.")})]}),!Y&&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:$e,children:s.jsx("button",{type:"button",className:a.primaryButton,disabled:Re,onClick:()=>{(async()=>{if(x){b(!0);try{const u=await ao(x.id,{creatorType:T,creatorId:D,makeDefault:!Y,...W.trim()?{label:W.trim()}:{}});m(u),E(""),B(""),K(!1),I(n("assets.settings.defaultCreatorSaved","Open Cloud default Creator saved locally."))}catch(u){I(u instanceof Error?u.message:n("assets.settings.saveFailed","Failed to save upload settings."))}finally{b(!1)}}})()},children:Te})}),re&&s.jsx("button",{type:"button",className:a.commandButton,disabled:i||N,onClick:()=>{z("user"),E(""),B(""),K(!1)},children:n("assets.settings.cancelCreator","Cancel")})]})]})]}),M&&s.jsx("div",{className:a.messageState,children:M}),s.jsx(xs,{open:$!==null,title:F,message:ne,cancelLabel:n("common.cancel","Cancel"),confirmLabel:se,loading:N,onCancel:()=>v(null),onConfirm:()=>{w()}})]})}const bo=12,yo=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=>ge(n,t))?e.map(n=>ge(n,t)?t:n):[t,...e]}function ge(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 jo(e,t){return e.some(r=>ge(r,t))?e.map(r=>ge(r,t)?t:r):e}function ze(e,t){return yt(e.filter(r=>bt(r,t)))}function xe(e,t){return e?`${e.displayName} (${e.id})`:t??"unknown asset"}function vo(e){return e.length===0?"none":e.map(t=>xe(t)).join(", ")}function cs(e){const t=`status ${e.status}`;return e.roblox.assetId?`Roblox asset ${e.roblox.assetId}; ${t}`:t}function Co(e,t){const r=xe(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 _o(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 So(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 So(e,t).flatMap(n=>ft(r).map(l=>({request:{...n,category:l},label:`${n.scope}/${l}`})))}function ps(e,t){if(t.length===0)return null;const r=t.map(({label:n,reason:l})=>`${n}: ${ce(l,"request failed")}`);return`${e}: ${r.join("; ")}`}function wo(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 No(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{...wo(e),overrideStillValid:t===null}}function Ao(){const[e,t]=c.useState([]),[r,n]=c.useState(0),[l,f]=c.useState(null),[g,m]=c.useState("place"),[p,R]=c.useState("all"),[V,U]=c.useState([]),[k,o]=c.useState(null),[S,X]=c.useState(null),[T,z]=c.useState(null),[Q,E]=c.useState(null),[W,B]=c.useState(!1),[q,K]=c.useState(!1),[M,I]=c.useState(!0),[$,v]=c.useState(null),[N,b]=c.useState(null),[i,P]=c.useState(null),J=c.useRef(!0),h=c.useRef(new Map),D=c.useRef(new Set),A=c.useMemo(()=>e.find(d=>te(d)===l)??null,[e,l]),x=(A==null?void 0:A.id)??null;c.useEffect(()=>{l&&(e.some(d=>te(d)===l)||f(null))},[e,l]);const G=c.useCallback(d=>{const y=h.current.get(d);y!==void 0&&(clearTimeout(y),h.current.delete(d))},[]),C=c.useCallback((d,y=bo)=>{const j=te(d);if(!ds(d)||y<=0){G(j);return}D.current.has(j)||(G(j),D.current.add(j),(async()=>{try{const w=await qe(Ce(d),d.id);if(!J.current)return;if(t(F=>jo(F,w)),ds(w)&&y>1){const F=te(w),ne=setTimeout(()=>{h.current.delete(F),C(w,y-1)},yo);h.current.set(F,ne);return}G(te(w))}catch(w){if(!J.current)return;G(j),b(ce(w,"Asset Library status refresh failed."))}finally{D.current.delete(j)}})())},[G]);c.useEffect(()=>()=>{J.current=!1;for(const d of h.current.values())clearTimeout(d);h.current.clear(),D.current.clear()},[]);const H=c.useCallback(()=>g==="shared"?{scope:"shared"}:{scope:"place",placeId:T??void 0},[T,g]),Y=c.useCallback(d=>({...H(),category:d}),[H]),re=c.useCallback(async()=>{try{const d=await Rs(),y=No(d,k);return U(d.places),y.overrideStillValid||o(null),X(y.placeId),z(y.placeId),E(y.placeName),B(y.studioConnected),K(y.studioConnected),y.placeId}catch{return U([]),X(null),z(null),E(null),B(!1),K(!1),null}},[k]),ee=c.useCallback(async()=>{b(null);try{const d=await re();if(g==="place"&&d===null){t([]),n(0),I(!1),b("No active place is connected for place-scoped assets.");return}const y=us(g,d,p),j=await Promise.allSettled(y.map(({request:se})=>lt(se))),w=j.flatMap(se=>se.status==="fulfilled"?[se.value]:[]),F=j.flatMap((se,u)=>se.status==="rejected"?[{label:y[u].label,reason:se.reason}]:[]);g==="all"&&d===null&&F.unshift({label:"place",reason:new Error("No active place is available")});const ne=ze(w.flatMap(se=>se.assets),p);t(ne),n(ne.length);for(const se of ne)C(se);b(ps("Some Asset Library requests failed",F))}catch(d){b(ce(d,"Failed to load Asset Library."))}finally{I(!1)}},[p,re,g,C]);c.useEffect(()=>{ee()},[ee]);const ae=c.useCallback(async(d,y,j)=>{const w=(A==null?void 0:A.id)===y?A:e.find(F=>F.id===y)??null;if(!w)return b("Asset context is unavailable."),null;v(d),b(null),P(null);try{const F=await j(Ce(w));return t(ne=>is(ne,F)),f(te(F)),_o(d)&&P(Co(d,F)),F}catch(F){return b(ce(F,"Asset Library action failed.")),null}finally{v(null)}},[e,A]),ie=c.useCallback(async()=>{v("rescan"),b(null),P(null);try{const d=us(g,T,p);if(g==="place"&&T===null){b("No active place is connected for place-scoped assets.");return}const y=await Promise.allSettled(d.map(({request:_})=>rt(_))),j=y.flatMap(_=>_.status==="fulfilled"?[_.value]:[]),w=y.flatMap((_,L)=>_.status==="rejected"?[{label:d[L].label,reason:_.reason}]:[]);g==="all"&&T===null&&w.unshift({label:"place",reason:new Error("No active place is available")});const F=ze(j.flatMap(_=>_.assets),p),ne=j.reduce((_,L)=>_+L.adoptedCount,0),se=j.reduce((_,L)=>_+L.skippedCount,0),u=ze(j.flatMap(_=>_.adopted),p);t(F),n(F.length),P(`Rescan complete for ${p}: ${ne} asset(s) added, ${se} skipped. Added: ${vo(u)}.`),b(ps("Some Asset Library rescans failed",w))}catch(d){b(ce(d,"Asset Library rescan failed."))}finally{v(null)}},[T,p,g]),Pe=c.useCallback(async(d,y)=>{v("export-selection-rbxm"),b(null),P(null);try{const j=await pt(Y(d),y);return t(w=>is(w,j.asset)),f(te(j.asset)),P(`Exported Studio selection as RBXM asset: ${xe(j.asset)}${j.deduplicated?" (reused existing local asset)":""}.`),j}catch(j){return b(ce(j,"Asset Library .rbxm export failed.")),null}finally{v(null)}},[Y]),ke=c.useCallback((d,y)=>ae("update",d,j=>it(j,d,y)),[ae]),fe=c.useCallback(async(d,y)=>{const j=await ae("upload",d,w=>dt(w,d,y));return j&&C(j),j},[ae,C]),be=c.useCallback(async d=>{const y=(A==null?void 0:A.id)===d?A:e.find(w=>w.id===d)??null;if(!y)return b("Asset context is unavailable."),!1;const j=te(y);G(j),v("delete"),b(null),P(null);try{return await ct(Ce(y),d),t(w=>{const F=w.filter(ne=>!ge(ne,y));return n(F.length),F}),f(w=>w===j?null:w),P(`Deleted asset: ${xe(y,d)}. Local files removed; uploaded Roblox assets were not deleted.`),!0}catch(w){return b(ce(w,"Asset Library delete failed.")),!1}finally{v(null)}},[e,G,A]),ye=c.useCallback(async(d,y)=>{const j=(A==null?void 0:A.id)===d?A:e.find(w=>w.id===d)??null;if(!j)return b("Asset context is unavailable."),null;v("import-rbxm"),b(null),P(null);try{const w=await ht(Ce(j),d,y);return f(te(j)),P(`Imported RBXM asset: ${xe(j,d)} -> ${w.importedCount} instance(s) to ${w.targetParent}.`),w}catch(w){return b(ce(w,"Asset Library .rbxm import failed.")),null}finally{v(null)}},[e,A]),je=c.useCallback(d=>ae("thumbnail-generate",d,y=>mt(y,d)),[ae]),Re=c.useCallback(d=>{const y=(A==null?void 0:A.id)===d?A:e.find(j=>j.id===d)??null;return y&&G(te(y)),ae("status-refresh",d,j=>qe(j,d))},[e,G,ae,A]),$e=c.useCallback((d,y)=>ae("usage-scan",d,async j=>(await ut(j,d,y)).asset),[ae]),Le=c.useCallback(d=>{m(d),f(null)},[]),Be=c.useCallback(d=>{o(d),f(null)},[]),Ue=c.useCallback(d=>{gt(d)&&R(d)},[]),Te=c.useCallback(d=>{if(d===null){f(null);return}const j=e.find(w=>te(w)===d)??e.find(w=>w.id===d);f(j?te(j):d)},[e]);return{assets:e,totalCount:r,selectedAsset:A,selectedAssetId:x,selectedAssetKey:l,scope:g,categoryFilter:p,availablePlaces:V,selectedPlaceId:S,activePlaceId:T,activePlaceName:Q,selectedPlaceIsConnected:W,studioConnected:q,loading:M,busyAction:$,error:N,lastMessage:i,setScope:Le,setSelectedPlaceId:Be,setCategoryFilter:Ue,selectAsset:Te,refresh:ee,rescan:ie,exportSelectionRbxm:Pe,updateMetadata:ke,uploadAsset:fe,deleteAsset:be,importRbxm:ye,generateThumbnail:je,refreshStatus:Re,scanUsage:$e}}const ws="weppy-assets-view-preferences-v1",he={organizationMode:"folders",viewMode:"grid",gridSize:"medium"};function Io(e){return e==="folders"||e==="all-assets"}function Po(e){return e==="grid"||e==="list"}function ko(e){return e==="small"||e==="medium"||e==="large"}function Ro(){if(typeof window>"u")return he;try{const e=window.localStorage.getItem(ws);if(!e)return he;const t=JSON.parse(e);return{organizationMode:Io(t.organizationMode)?t.organizationMode:he.organizationMode,viewMode:Po(t.viewMode)?t.viewMode:he.viewMode,gridSize:ko(t.gridSize)?t.gridSize:he.gridSize}}catch{return he}}function $o(){const[e,t]=c.useState(Ro);return c.useEffect(()=>{try{window.localStorage.setItem(ws,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 Lo(e,t){return t("assets.count.shown","Shown assets: {count}").replace("{count}",String(e))}function Bo(e,t){return e===null?null:t("assets.place.id","Place ID {placeId}").replace("{placeId}",String(e))}function zo(){const{t:e}=me(),{trackEvent:t}=$s(),{tier:r,loading:n}=Ls(),l=Ao(),f=$o(),[g,m]=c.useState(!1),[p,R]=c.useState(!1),[V,U]=c.useState(!1),k=!n&&r==="pro",o=l.selectedAsset,S=(o==null?void 0:o.file.original.toLowerCase().endsWith(".rbxm"))??!1,X=(o==null?void 0:o.category)==="model"||(o==null?void 0:o.category)==="animation",T="game.Workspace",Q=!!(k&&l.studioConnected&&o&&S&&X),E=l.availablePlaces??[],W=l.selectedPlaceId??l.activePlaceId,B=l.selectedAssetKey??(o?te(o):null),q=c.useCallback(()=>{l.selectAsset(null)},[l.selectAsset]),K=c.useMemo(()=>l.scope==="shared"?[e("assets.scope.shared","Shared")]:l.scope==="all"?[e("assets.scope.all","All scopes"),l.activePlaceName??e("assets.scope.place","Current Place"),e("assets.scope.shared","Shared")]:[l.activePlaceName??e("assets.scope.place","Current Place"),Bo(l.activePlaceId,e),l.selectedPlaceIsConnected?e("assets.place.connected","Connected"):null].filter(v=>!!v),[l.activePlaceId,l.activePlaceName,l.scope,l.selectedPlaceIsConnected,e]),M=c.useMemo(()=>Ke(l.categoryFilter,e),[l.categoryFilter,e]),I=Lo(l.totalCount,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":l.scope==="all",className:l.scope==="all"?a.segmentedActive:"",onClick:()=>l.setScope("all"),children:e("assets.scope.all","All scopes")}),s.jsx("button",{type:"button","aria-pressed":l.scope==="place",className:l.scope==="place"?a.segmentedActive:"",onClick:()=>l.setScope("place"),children:e("assets.scope.place","Current Place")}),s.jsx("button",{type:"button","aria-pressed":l.scope==="shared",className:l.scope==="shared"?a.segmentedActive:"",onClick:()=>l.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:l.scope==="shared"?s.jsx("span",{className:a.sharedPlaceContext,children:e("assets.place.sharedLibrary","Shared library")}):E.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 W=="number"?String(W):"",onChange:v=>{const N=Number.parseInt(v.currentTarget.value,10);Number.isInteger(N)&&l.setSelectedPlaceId(N)},children:E.map(v=>s.jsxs("option",{value:v.placeId,children:[v.placeName," (",v.placeId,")"]},v.placeId))})]}):s.jsx("span",{className:a.sharedPlaceContext,children:l.activePlaceName??e("assets.scope.place","Current Place")})}),s.jsxs("div",{className:a.listContextSummary,children:[K.map((v,N)=>s.jsxs("span",{children:[N>0?s.jsx("span",{className:a.contextDivider,children:" · "}):null,v]},`${v}-${N}`)),s.jsx("span",{className:a.contextDivider,children:" · "}),s.jsx("span",{children:M}),s.jsx("span",{className:a.contextDivider,children:" · "}),s.jsx("strong",{children:I})]}),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:l.busyAction==="rescan",onClick:()=>{t("dashboard_click_event",{click_target:"assets_rescan",page:"assets"}),l.rescan()},children:[s.jsx(hs,{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"}),R(v=>!v)},"aria-label":e("assets.settings.open","Open settings"),"aria-controls":"asset-library-settings-panel","aria-expanded":p,children:s.jsx(ms,{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(v=>{const N=l.categoryFilter===v,b=Ke(v,e);return s.jsx("button",{type:"button",role:"radio","aria-checked":N,className:[a.categoryButton,N?a.categoryButtonActive:""].filter(Boolean).join(" "),onClick:()=>{l.setCategoryFilter(v)},children:b},v)})})]})]}),s.jsx(fo,{open:p,tier:r,onClose:()=>R(!1)})]}),l.error&&s.jsxs("div",{className:a.errorState,children:[l.scope==="all"?s.jsx("strong",{children:e("assets.partial.title","Some locations could not be loaded")}):null,s.jsx("span",{children:l.error})]}),l.lastMessage&&s.jsx("div",{className:a.messageState,children:l.lastMessage}),l.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.")})]}),!k&&!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.")}),l.loading?s.jsx("div",{className:a.emptyState,children:e("assets.loading.scope","Loading {scope} assets...").replace("{scope}",l.scope==="all"?e("assets.scope.all","All scopes"):l.scope==="shared"?e("assets.scope.shared","Shared"):e("assets.scope.place","Current Place"))}):s.jsx(Un,{displayScope:l.scope,assets:l.assets,place:{placeId:l.activePlaceId,placeName:l.activePlaceName},categoryFilter:l.categoryFilter,organizationMode:f.organizationMode,viewMode:f.viewMode,gridSize:f.gridSize,selectedAssetKey:B,onSelectAsset:l.selectAsset,onClearSelection:q,onOrganizationModeChange:f.setOrganizationMode,onViewModeChange:f.setViewMode,onGridSizeChange:f.setGridSize}),s.jsx(qn,{asset:g||p||V?null:o,busyAction:l.busyAction,canUpload:k,canImportRbxm:Q,importRbxmTooltip:$,importRbxmTargetParent:T,onClose:()=>l.selectAsset(null),onSave:async(v,N)=>{o&&await l.updateMetadata(o.id,{displayName:v,description:N})},onUpload:()=>m(!0),onDelete:()=>U(!0),onImportRbxm:async()=>{o&&(t("dashboard_click_event",{click_target:"assets_import_rbxm",page:"assets"}),await l.importRbxm(o.id,{targetParent:T}))},onRefreshStatus:async()=>{o&&await l.refreshStatus(o.id)},onScanUsage:async()=>{o&&(t("dashboard_click_event",{click_target:"assets_usage_scan",page:"assets"}),await l.scanUsage(o.id,l.activePlaceId??void 0))}}),s.jsx(xs,{open:V&&!!o,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:()=>U(!1),onConfirm:()=>{o&&(t("dashboard_click_event",{click_target:"assets_delete",page:"assets"}),l.deleteAsset(o.id).then(v=>{v&&U(!1)}))}}),s.jsx(po,{asset:o,open:g,canUpload:k,busyAction:l.busyAction,onClose:()=>{m(!1),l.selectAsset(null)},onBack:()=>m(!1),onOpenSettings:()=>{m(!1),R(!0)},onUpload:async v=>{if(!o)return;t("dashboard_click_event",{click_target:"assets_upload_submit",page:"assets"}),await l.uploadAsset(o.id,v)&&m(!1)}})]})}export{zo as Component};
61
+ */const nt=[["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"}]],ot=oe("upload",nt);function fs(e){if(e.scope==="place"&&typeof e.placeId=="number")return{placeId:String(e.placeId)}}function le(e){const t=fs(e);return t?`?placeId=${encodeURIComponent(t.placeId)}`:""}function Ae(e){return`/api/assets/${encodeURIComponent(e.scope)}/${encodeURIComponent(e.category)}`}function pe(e,t){return`${Ae(e)}/${encodeURIComponent(t)}`}async function lt(e){return O.get(Ae(e),fs(e))}async function rt(e){return O.post(`${Ae(e)}/rescan${le(e)}`,{})}async function it(e,t,r){return(await O.patch(`${pe(e,t)}${le(e)}`,r)).asset}async function ct(e,t){return O.delete(`${pe(e,t)}${le(e)}`)}async function dt(e,t,r){return(await O.post(`${pe(e,t)}/upload${le(e)}`,r)).asset}async function qe(e,t){return(await O.post(`${pe(e,t)}/status-refresh${le(e)}`,{})).asset}async function ut(e,t,r){const n={...e,placeId:r??e.placeId};return O.post(`${pe(e,t)}/usage-scan${le(n)}`,{})}async function pt(e,t){return O.post(`${Ae(e)}/export-selection-rbxm${le(e)}`,t)}async function ht(e,t,r){return O.post(`${pe(e,t)}/import-rbxm${le(e)}`,r)}async function mt(e,t){return(await O.post(`${pe(e,t)}/thumbnail-generate${le(e)}`,{})).asset}function bs(e){return e.fileUrl?`${we}${e.fileUrl}`:`${we}/api/assets/${e.scope.kind}/${e.category}/${encodeURIComponent(e.id)}/file${le({scope:e.scope.kind,placeId:e.scope.kind==="place"?e.scope.placeId:void 0})}`}function He(e){return e.previewUrl?`${we}${e.previewUrl}`:`${we}/api/assets/${e.scope.kind}/${e.category}/${encodeURIComponent(e.id)}/preview${le({scope:e.scope.kind,placeId:e.scope.kind==="place"?e.scope.placeId:void 0})}`}const ys=["all","image","decal","rbxm"],xt=new Set(ys),Je=["model","animation"];function _e(e){return/\.(rbxm|rbxmx)$/i.test(e.file.original)}function gt(e){return xt.has(e)}function Ke(e,t){return e==="all"?t("assets.category.all","All"):t(`assets.category.${e}`,e==="rbxm"?"RBXM":e)}function de(e,t){return Ke(_e(e)?"rbxm":e.category,t)}function ft(e){return e==="all"?["image","decal",...Je]:e==="rbxm"?Je:[e]}function bt(e,t){return t==="all"?e.category==="image"||e.category==="decal"||_e(e):t==="rbxm"?_e(e):(t==="model"||t==="animation")&&_e(e)?!1:e.category===t}function yt(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 jt(e,t){const r=Ie(t),n=new Map;for(const l of e){const f=Ve(l);if(f.length<=r.length||!We(f,r))continue;const g=f[r.length],m=[...r,g].join("/"),p=n.get(m);p?p.descendantCount+=1:n.set(m,{name:g,path:m,descendantCount:1})}return[...n.values()].sort((l,f)=>l.name.localeCompare(f.name))}function vt(e,t){const r=Ie(t);return e.filter(n=>{const l=Ve(n);return l.length===r.length&&We(l,r)}).sort(js)}function Ct(e){return[...e].sort(js)}function _t(e,t){const r=Ie(t);for(;r.length>0;){if(e.some(l=>{const f=Ve(l);return f.length>=r.length&&We(f,r)}))return r.join("/");r.pop()}return""}const St="_page_1w259_1",wt="_experimentalBadge_1w259_9",Nt="_toolbarShell_1w259_23",At="_toolbar_1w259_23",It="_segmented_1w259_41",Pt="_placeContextSlot_1w259_45",kt="_listContextSummary_1w259_50",Rt="_toolbarActions_1w259_54",$t="_categoryControl_1w259_59",Lt="_contextDivider_1w259_84",Bt="_categoryControlLabel_1w259_88",Ut="_categoryRail_1w259_94",Tt="_categoryButton_1w259_102",Et="_categoryButtonActive_1w259_131",Dt="_copyRow_1w259_144",Ft="_buttonRow_1w259_145",Mt="_segmentedActive_1w259_187",Ot="_placeSelectorLabel_1w259_192",zt="_placeSelect_1w259_192",Ht="_sharedPlaceContext_1w259_218",Kt="_commandButton_1w259_244",Gt="_primaryButton_1w259_245",Wt="_iconButton_1w259_246",Vt="_dangerButton_1w259_286",Yt="_iconButtonActive_1w259_307",Xt="_grid_1w259_320",qt="_folderGrid_1w259_328",Jt="_explorer_1w259_337",Zt="_explorerToolbar_1w259_344",Qt="_explorerLocation_1w259_354",ea="_breadcrumb_1w259_377",sa="_breadcrumbSegment_1w259_378",ta="_viewOptions_1w259_421",aa="_organizationModeControl_1w259_429",na="_viewModeControl_1w259_430",oa="_gridSizeControl_1w259_431",la="_explorerSection_1w259_484",ra="_folderTile_1w259_507",ia="_folderListRow_1w259_532",ca="_assetListRow_1w259_533",da="_assetCard_1w259_534",ua="_folderIcon_1w259_539",pa="_folderName_1w259_551",ha="_folderCount_1w259_563",ma="_assetList_1w259_533",xa="_folderList_1w259_532",ga="_assetListHeader_1w259_577",fa="_listPreviewWrap_1w259_614",ba="_listPreview_1w259_614",ya="_listPreviewFallback_1w259_616",ja="_listAssetName_1w259_645",va="_listAssetCategory_1w259_657",Ca="_listAssetScope_1w259_658",_a="_listAssetUpdated_1w259_659",Sa="_folderType_1w259_660",wa="_folderScope_1w259_661",Na="_folderStatus_1w259_662",Aa="_folderUpdated_1w259_663",Ia="_assetCardSelected_1w259_692",Pa="_thumbnailWrap_1w259_697",ka="_thumbnail_1w259_697",Ra="_thumbnailFallback_1w259_713",$a="_assetCardBody_1w259_724",La="_assetName_1w259_731",Ba="_assetMeta_1w259_739",Ua="_statusChip_1w259_746",Ta="_categoryPill_1w259_747",Ea="_assetId_1w259_752",Da="_scopeText_1w259_753",Fa="_muted_1w259_754",Ma="_emptyState_1w259_759",Oa="_notice_1w259_760",za="_errorState_1w259_761",Ha="_messageState_1w259_762",Ka="_proNotice_1w259_792",Ga="_rbxmGuide_1w259_810",Wa="_settingsInlinePanel_1w259_850",Va="_settingsDrawer_1w259_870",Ya="_detailPopupLayer_1w259_886",Xa="_detailDialog_1w259_902",qa="_detailDialogHeader_1w259_919",Ja="_detailTitleBlock_1w259_930",Za="_detailEyebrow_1w259_952",Qa="_detailHeaderActions_1w259_961",en="_detailDialogBody_1w259_969",sn="_detailPreviewPane_1w259_978",tn="_detailPreview_1w259_978",an="_detailPreviewFallback_1w259_990",nn="_detailContentPane_1w259_1026",on="_formStack_1w259_1032",ln="_drawerHeader_1w259_1036",rn="_detailSection_1w259_1087",cn="_noticeList_1w259_1088",dn="_settingsPanel_1w259_1089",un="_setupNotice_1w259_1106",pn="_field_1w259_1131",hn="_fieldLabelRow_1w259_1139",mn="_fieldHelp_1w259_1163",xn="_twoColumn_1w259_1168",gn="_technicalDetails_1w259_1179",fn="_detailGrid_1w259_1196",bn="_metadataList_1w259_1197",yn="_compactMeta_1w259_1208",jn="_copyableValue_1w259_1235",vn="_inlineCopyButton_1w259_1246",Cn="_hashText_1w259_1267",_n="_usageList_1w259_1271",Sn="_usageItem_1w259_1277",wn="_metadataItem_1w259_1278",Nn="_settingsSubsection_1w259_1326",An="_settingsSectionHeader_1w259_1331",In="_settingsDefinitionList_1w259_1344",Pn="_toggleRow_1w259_1366",kn="_inlineHelp_1w259_1380",a={page:St,experimentalBadge:wt,toolbarShell:Nt,toolbar:At,segmented:It,placeContextSlot:Pt,listContextSummary:kt,toolbarActions:Rt,categoryControl:$t,contextDivider:Lt,categoryControlLabel:Bt,categoryRail:Ut,categoryButton:Tt,categoryButtonActive:Et,copyRow:Dt,buttonRow:Ft,segmentedActive:Mt,placeSelectorLabel:Ot,placeSelect:zt,sharedPlaceContext:Ht,commandButton:Kt,primaryButton:Gt,iconButton:Wt,dangerButton:Vt,iconButtonActive:Yt,grid:Xt,folderGrid:qt,explorer:Jt,explorerToolbar:Zt,explorerLocation:Qt,breadcrumb:ea,breadcrumbSegment:sa,viewOptions:ta,organizationModeControl:aa,viewModeControl:na,gridSizeControl:oa,explorerSection:la,folderTile:ra,folderListRow:ia,assetListRow:ca,assetCard:da,folderIcon:ua,folderName:pa,folderCount:ha,assetList:ma,folderList:xa,assetListHeader:ga,listPreviewWrap:fa,listPreview:ba,listPreviewFallback:ya,listAssetName:ja,listAssetCategory:va,listAssetScope:Ca,listAssetUpdated:_a,folderType:Sa,folderScope:wa,folderStatus:Na,folderUpdated:Aa,assetCardSelected:Ia,thumbnailWrap:Pa,thumbnail:ka,thumbnailFallback:Ra,assetCardBody:$a,assetName:La,assetMeta:Ba,statusChip:Ua,categoryPill:Ta,assetId:Ea,scopeText:Da,muted:Fa,emptyState:Ma,notice:Oa,errorState:za,messageState:Ha,proNotice:Ka,rbxmGuide:Ga,settingsInlinePanel:Wa,settingsDrawer:Va,detailPopupLayer:Ya,detailDialog:Xa,detailDialogHeader:qa,detailTitleBlock:Ja,detailEyebrow:Za,detailHeaderActions:Qa,detailDialogBody:en,detailPreviewPane:sn,detailPreview:tn,detailPreviewFallback:an,detailContentPane:nn,formStack:on,drawerHeader:ln,detailSection:rn,noticeList:cn,settingsPanel:dn,setupNotice:un,field:pn,fieldLabelRow:hn,fieldHelp:mn,twoColumn:xn,technicalDetails:gn,detailGrid:fn,metadataList:bn,compactMeta:yn,copyableValue:jn,inlineCopyButton:vn,hashText:Cn,usageList:_n,usageItem:Sn,metadataItem:wn,settingsSubsection:Nn,settingsSectionHeader:An,settingsDefinitionList:In,toggleRow:Pn,inlineHelp:kn},Rn={image:As,decal:zs,audio:Ms,mesh:Ks,model:Ns,video:Xs,animation:Vs};function Ne(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 $n(e){return e.category==="decal"?e.roblox.creatorAssetId??e.roblox.assetId:e.roblox.assetId}function vs(e,t){var g;const r=((g=e.rbxm)==null?void 0:g.studioUploads)??[];if(r.length===0)return null;const n=r.filter(m=>m.status==="uploaded").length,l=r.filter(m=>m.status==="failed").length,f=[n>0?`${n} ${t("assets.detail.rbxmStudioUploadsUploaded","uploaded")}`:null,l>0?`${l} ${t("assets.detail.rbxmStudioUploadsFailed","failed")}`:null].filter(Boolean);return`${t("assets.detail.rbxmStudioUploadsLabel","Studio uploads")}: ${f.join(", ")}`}function Ln({assets:e,selectedAssetId:t,selectedAssetKey:r=null,viewMode:n="grid",gridSize:l="medium",onSelect:f}){const{t:g}=me();return e.length===0?s.jsxs("div",{className:a.emptyState,children:[s.jsx("p",{children:g("assets.empty.title","No assets yet")}),s.jsx("span",{children:g("assets.empty.body","Choose a scope and category, then rescan that inbox folder.")})]}):s.jsx("div",{className:n==="list"?a.assetList:a.grid,"data-view-mode":n,"data-grid-size":l,children:e.map(m=>{const p=Rn[m.category],R=$n(m),V=vs(m,g),U=te(m),k=r?r===U:t===m.id,o=m.scope.kind==="shared"?g("assets.scope.shared","Shared"):g("assets.scope.place","Current Place");return n==="list"?s.jsxs("button",{type:"button",className:[a.assetListRow,k?a.assetCardSelected:""].filter(Boolean).join(" "),onClick:()=>f(U),children:[s.jsx("span",{className:a.listPreviewWrap,children:Qe(m)?s.jsx("img",{className:a.listPreview,src:He(m),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:m.displayName}),s.jsx("span",{className:a.listAssetCategory,children:de(m,g)}),s.jsx("span",{className:a.listAssetScope,children:o}),s.jsx(De,{variant:Ze(m.status),className:a.statusChip,children:Ne(m.status,g)}),s.jsx("time",{className:a.listAssetUpdated,dateTime:m.updatedAt,children:new Date(m.updatedAt).toLocaleDateString()})]},U):s.jsxs("button",{type:"button",className:[a.assetCard,k?a.assetCardSelected:""].filter(Boolean).join(" "),onClick:()=>f(U),children:[s.jsx("span",{className:a.thumbnailWrap,children:Qe(m)?s.jsx("img",{className:a.thumbnail,src:He(m),alt:m.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:m.displayName}),s.jsxs("span",{className:a.assetMeta,children:[s.jsx(De,{variant:"neutral",className:a.categoryPill,children:de(m,g)}),s.jsx(De,{variant:Ze(m.status),className:a.statusChip,children:Ne(m.status,g)})]}),s.jsxs("span",{className:a.assetMeta,children:[s.jsx("span",{className:a.scopeText,children:o}),s.jsx("span",{className:a.assetId,children:R?`#${R}`:V??g("assets.status.localOnly","Local only")})]})]})]},U)})})}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 Bn(e,t){var r;return t?e.folderPath===t||((r=e.folderPath)==null?void 0:r.startsWith(`${t}/`))===!0:!0}function Un({displayScope:e,assets:t,place:r,categoryFilter:n,organizationMode:l,viewMode:f,gridSize:g,selectedAssetKey:m,onSelectAsset:p,onClearSelection:R,onOrganizationModeChange:V,onViewModeChange:U,onGridSizeChange:k}){const{t:o}=me(),[S,X]=c.useState(()=>es(e)),T=c.useRef(`${e}:${r.placeId??"-"}`),z=c.useRef(!1),Q=c.useRef(null),E=h=>h==="shared"?o("assets.scope.shared","Shared"):r.placeName??o("assets.scope.place","Current Place"),W=h=>{z.current=!0,X(h),R()};c.useEffect(()=>{const h=`${e}:${r.placeId??"-"}`;T.current!==h&&(T.current=h,z.current=!0,X(es(e)),R())},[e,R,r.placeId]),c.useEffect(()=>{var h;z.current&&(z.current=!1,(h=Q.current)==null||h.focus())},[S]);const B=c.useMemo(()=>S.scope===null?[]:t.filter(h=>Me(h,S.scope,r.placeId)),[t,S.scope,r.placeId]);c.useEffect(()=>{if(S.scope===null)return;const h=_t(B,S.folderPath);h!==S.folderPath&&(z.current=!0,X(D=>({...D,folderPath:h})),R())},[n,S.folderPath,S.scope,R,B]);const q=c.useMemo(()=>l==="folders"?jt(B,S.folderPath):[],[S.folderPath,l,B]),K=c.useMemo(()=>e==="all"?t:t.filter(h=>Me(h,e,r.placeId)),[t,e,r.placeId]),M=c.useMemo(()=>l==="all-assets"?Ct(K):vt(B,S.folderPath),[K,S.folderPath,l,B]);c.useEffect(()=>{m&&(M.some(h=>te(h)===m)||R())},[R,m,M]);const I=S.folderPath?S.folderPath.split("/"):[],$=l==="all-assets"?o("assets.organization.all","All assets"):I[I.length-1]??(S.scope?E(S.scope):o("assets.scope.all","All scopes")),v=S.scope===null?t.length:B.filter(h=>Bn(h,S.folderPath)).length,N=Math.max(0,v-M.length),b=l==="all-assets"?o("assets.organization.summary","{count} assets").replace("{count}",String(M.length)):o("assets.explorer.summary","{direct} in this folder · {descendant} in subfolders").replace("{direct}",String(M.length)).replace("{descendant}",String(N)),i=h=>h===1?o("assets.folder.count.one","1 asset"):o("assets.folder.count.many","{count} assets").replace("{count}",String(h)),P=(h,D,A,x,G)=>s.jsxs("button",{type:"button",className:f==="list"?a.folderListRow:a.folderTile,"aria-label":`${D}, ${i(A)}`,onClick:G,children:[s.jsx("span",{className:a.folderIcon,"aria-hidden":"true",children:s.jsx(Is,{size:f==="list"?22:28})}),s.jsx("span",{className:a.folderName,children:D}),f==="list"?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:a.folderType,children:o("assets.folder.type","Folder")}),s.jsx("span",{className:a.folderScope,children:E(x)}),s.jsx("span",{className:a.folderStatus,children:i(A)}),s.jsx("span",{className:a.folderUpdated,children:"—"})]}):s.jsx("span",{className:a.folderCount,children:i(A)})]},h),J=l==="folders"&&e==="all"&&S.scope===null?[{scope:"place",name:E("place")},{scope:"shared",name:E("shared")}].map(({scope:h,name:D})=>({scope:h,name:D,count:t.filter(A=>Me(A,h,r.placeId)).length})):[];return s.jsxs("section",{className:a.explorer,"aria-label":o("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":o("assets.breadcrumb.label","Asset path"),children:[l==="all-assets"?s.jsxs(s.Fragment,{children:[s.jsx("span",{children:e==="all"?o("assets.scope.all","All scopes"):E(e)}),s.jsx(Fe,{size:14,"aria-hidden":"true"}),s.jsx("span",{"aria-current":"page",children:o("assets.organization.all","All assets")})]}):e==="all"?S.scope===null?s.jsx("span",{"aria-current":"page",children:o("assets.scope.all","All scopes")}):s.jsx("button",{type:"button",onClick:()=>W({scope:null,folderPath:""}),children:o("assets.scope.all","All scopes")}):null,l==="folders"&&S.scope?s.jsxs(s.Fragment,{children:[e==="all"?s.jsx(Fe,{size:14,"aria-hidden":"true"}):null,I.length>0?s.jsx("button",{type:"button",onClick:()=>W({scope:S.scope,folderPath:""}),children:E(S.scope)}):s.jsx("span",{"aria-current":"page",children:E(S.scope)})]}):null,l==="folders"&&I.map((h,D)=>{const A=I.slice(0,D+1).join("/"),x=D===I.length-1;return s.jsxs("span",{className:a.breadcrumbSegment,children:[s.jsx(Fe,{size:14,"aria-hidden":"true"}),x?s.jsx("span",{"aria-current":"page",children:h}):s.jsx("button",{type:"button",onClick:()=>W({scope:S.scope,folderPath:A}),children:h})]},A)})]}),s.jsx("h2",{ref:Q,tabIndex:-1,children:$}),s.jsx("p",{children:b})]}),s.jsxs("div",{className:a.viewOptions,"aria-label":o("assets.view.options","View options"),children:[s.jsxs("div",{className:a.organizationModeControl,role:"group","aria-label":o("assets.organization.label","Browse"),children:[s.jsx("button",{type:"button","aria-pressed":l==="folders",onClick:()=>V("folders"),children:o("assets.organization.folders","Folders")}),s.jsx("button",{type:"button","aria-pressed":l==="all-assets",onClick:()=>V("all-assets"),children:o("assets.organization.all","All assets")})]}),s.jsxs("div",{className:a.viewModeControl,role:"group","aria-label":o("assets.view.mode","View mode"),children:[s.jsxs("button",{type:"button","aria-pressed":f==="grid",onClick:()=>U("grid"),children:[s.jsx(Js,{size:14}),o("assets.view.grid","Grid")]}),s.jsxs("button",{type:"button","aria-pressed":f==="list",onClick:()=>U("list"),children:[s.jsx(Qs,{size:14}),o("assets.view.list","List")]})]}),s.jsx("div",{className:a.gridSizeControl,role:"group","aria-label":o("assets.view.thumbnailSize","Thumbnail size"),title:f==="list"?o("assets.view.thumbnailSize.listReason","Thumbnail size is available in Grid view."):void 0,children:["small","medium","large"].map(h=>s.jsx("button",{type:"button","aria-pressed":g===h,disabled:f==="list",onClick:()=>k(h),children:o(`assets.view.size.${h}`,h[0].toUpperCase()+h.slice(1))},h))})]})]}),f==="list"&&(J.length>0||q.length>0||M.length>0)?s.jsxs("div",{className:a.assetListHeader,"aria-hidden":"true",children:[s.jsx("span",{}),s.jsx("span",{children:o("assets.list.name","Name")}),s.jsx("span",{children:o("assets.list.type","Type")}),s.jsx("span",{children:o("assets.list.scope","Scope")}),s.jsx("span",{children:o("assets.list.status","Status")}),s.jsx("span",{children:o("assets.list.updated","Updated")})]}):null,J.length>0?s.jsxs("section",{className:a.explorerSection,children:[s.jsx("h3",{children:o("assets.folders.title","Folders")}),s.jsx("div",{className:f==="list"?a.folderList:a.folderGrid,"data-grid-size":g,children:J.map(h=>P(`scope:${h.scope}`,h.name,h.count,h.scope,()=>W({scope:h.scope,folderPath:""})))})]}):null,q.length>0?s.jsxs("section",{className:a.explorerSection,children:[s.jsx("h3",{children:o("assets.folders.title","Folders")}),s.jsx("div",{className:f==="list"?a.folderList:a.folderGrid,"data-grid-size":g,children:q.map(h=>P(h.path,h.name,h.descendantCount,S.scope,()=>W({scope:S.scope,folderPath:h.path})))})]}):null,M.length>0?s.jsxs("section",{className:a.explorerSection,"aria-label":l==="all-assets"?o("assets.organization.all","All assets"):void 0,children:[l==="folders"?s.jsx("h3",{children:o("assets.folder.assetsTitle","Assets in this folder")}):null,s.jsx(Ln,{assets:M,selectedAssetId:null,selectedAssetKey:m,viewMode:f,gridSize:g,onSelect:p})]}):null,q.length===0&&M.length===0&&(J.length===0||t.length===0)?s.jsxs("div",{className:a.emptyState,children:[s.jsx("p",{children:t.length===0?n==="all"?o("assets.empty.title","No assets yet"):o("assets.empty.filteredTitle","No assets match this filter"):o("assets.empty.folderTitle","No matching assets in this folder")}),s.jsx("span",{children:t.length===0?n==="all"?o("assets.empty.body","Choose a scope and category, then rescan that inbox folder."):o("assets.empty.filteredBody","Choose another category or rescan the matching inbox folders."):o("assets.empty.folderBody","Try another folder or category filter.")})]}):null]})}const Tn="https://create.roblox.com/dashboard/creations/store",En=/^https:\/\/create\.roblox\.com\/store\/asset\/\d+(?:\/.*)?$/;function Dn(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function Se(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"),l=String(t.getDate()).padStart(2,"0"),f=String(t.getHours()).padStart(2,"0"),g=String(t.getMinutes()).padStart(2,"0");return`${r}-${n}-${l} ${f}:${g}`}function Fn(e){return e.category==="image"||e.category==="decal"||!!e.file.preview}function Mn(e){return e.file.preview?He(e):bs(e)}function On(e){var r;const t=Object.entries(((r=e.rbxm)==null?void 0:r.classCounts)??{}).sort((n,l)=>l[1]-n[1]).slice(0,8);return t.length===0?"-":t.map(([n,l])=>`${n} ${l}`).join(", ")}function ss(e){var l;const t=(l=e.rbxm)==null?void 0:l.thumbnail;if(!t)return"-";const r=t.source?` via ${t.source}`:"",n=t.message?` · ${t.message}`:"";return`${t.status}${r}${n}`}function zn(e){var l,f;const t=(f=(l=e.rbxm)==null?void 0:l.review)==null?void 0:f.summary;if(!t)return"-";const r=[["roots",t.rootCount],["parts",t.partCount],["mesh parts",t.meshPartCount],["scripts",t.scriptCount],["unanchored",t.unanchoredPartCount]].flatMap(([g,m])=>typeof m=="number"?[`${g} ${m}`]:[]),n=t.bounds;if(n&&typeof n=="object"&&"size"in n){const g=n.size;if(g&&typeof g=="object"){const{x:m,y:p,z:R}=g;typeof m=="number"&&typeof p=="number"&&typeof R=="number"&&r.push(`bounds ${m} x ${p} x ${R}`)}}return r.length>0?r.join(", "):"-"}function Hn(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 Kn(e){return`${Tn}/${e}/configure`}function Gn(e){return e.category==="decal"?e.roblox.creatorAssetId??e.roblox.assetId??null:e.roblox.assetId??null}function Wn(e){const t=Gn(e),r=t?Kn(t):null,n=e.category==="decal"?e.roblox.creatorAssetWebUrl??e.roblox.assetWebUrl:e.roblox.assetWebUrl;return!n||r&&En.test(n)?r:n}function Vn(e){return`${Se(e.startedAt)} -> ${e.status}`}function ns(e){return!e.creatorType||!e.creatorId?null:`${e.creatorType} ${e.creatorId}`}function os(e){return e.assetRole?`Asset role: ${e.assetRole}`:null}function Yn(e){const t=e.sourceProperty?` · ${e.sourceProperty}`:"";return`${e.path} · ${e.assetType} · ${e.status}${t}`}function Xn(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(gs,{size:13})}):null}function qn({asset:e,busyAction:t,canUpload:r,canImportRbxm:n,importRbxmTooltip:l,importRbxmTargetParent:f,onClose:g,onSave:m,onUpload:p,onDelete:R,onImportRbxm:V,onRefreshStatus:U,onScanUsage:k}){var N,b;const{t:o}=me(),S=c.useRef(null),[X,T]=c.useState(""),[z,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 P;if(!e)return;(P=S.current)==null||P.focus();const i=J=>{J.key==="Escape"&&g()};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[e,g]),!e)return null;const E=e.status==="processing"&&!!(e.roblox.operationId??e.roblox.operationPath),W=!!e.roblox.assetUri,B=Wn(e),q=e.roblox.uploadAttempts??[],K=e.category==="decal"&&!!(e.roblox.creatorAssetId||e.roblox.backingImageAssetId||e.roblox.assetId),M=e.roblox.creatorAssetId??e.roblox.assetId,I=e.roblox.backingImageAssetId??e.roblox.assetId,$=vs(e,o),v=e.roblox.assetId?e.usage.lastScannedAt?o("assets.detail.noUsageAfterScan","No references were found in local Sync files during the last check."):o("assets.detail.noUsageUnscanned","Run Scan usage to search local Sync files for this Roblox Asset ID."):o("assets.detail.noUsageNoRobloxId","This asset does not have a Roblox Asset ID yet, so usage cannot be checked. Upload it before scanning usage.");return s.jsx("div",{className:a.detailPopupLayer,onClick:g,role:"presentation",children:s.jsxs("section",{ref:S,className:a.detailDialog,role:"dialog","aria-modal":"true","aria-label":o("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,o)," · ",Ne(e.status,o)]}),s.jsx("h2",{children:e.displayName}),s.jsx("span",{children:e.id})]}),s.jsxs("div",{className:a.detailHeaderActions,children:[s.jsx(Z,{text:r?o("assets.upload.open.tooltip","Upload this local file to Roblox through Open Cloud."):o("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(ot,{size:15}),o("assets.upload.open","Upload")]})}),n&&s.jsx(Z,{text:l,children:s.jsxs("button",{type:"button",className:a.commandButton,disabled:t==="import-rbxm",onClick:()=>void V(),children:[s.jsx(Ps,{size:15}),o("assets.detail.importRbxm","Insert into Studio")]})}),s.jsxs("button",{type:"button",className:a.commandButton,disabled:!E||t==="status-refresh",onClick:()=>void U(),children:[s.jsx(hs,{size:15}),o("assets.detail.refreshStatus","Refresh")]}),s.jsxs("button",{type:"button",className:a.commandButton,disabled:!e.roblox.assetId||t==="usage-scan",onClick:()=>void k(),children:[s.jsx(st,{size:15}),o("assets.detail.scanUsage","Scan usage")]}),s.jsx(Z,{text:o("assets.delete.tooltip","Delete this local Asset Library item."),children:s.jsxs("button",{type:"button",className:`${a.commandButton} ${a.dangerButton}`,disabled:t==="delete",onClick:R,children:[s.jsx(at,{size:15}),o("common.delete","Delete")]})}),s.jsx(Z,{text:o("common.close","Close"),children:s.jsx("button",{type:"button",className:a.iconButton,onClick:g,"aria-label":o("common.close","Close"),children:s.jsx(Ge,{size:16})})})]})]}),s.jsxs("div",{className:a.detailDialogBody,children:[s.jsx("div",{className:a.detailPreviewPane,children:Fn(e)?s.jsx("img",{className:a.detailPreview,src:Mn(e),alt:e.displayName}):s.jsxs("div",{className:a.detailPreviewFallback,children:[s.jsx("span",{children:de(e,o)}),s.jsx("code",{children:e.file.original}),((N=e.rbxm)==null?void 0:N.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:o("assets.detail.displayName","Display name")}),s.jsx("input",{value:X,onChange:i=>T(i.target.value)})]}),s.jsxs("label",{className:a.field,children:[s.jsx("span",{children:o("assets.detail.description","Description")}),s.jsx("textarea",{value:z,rows:3,onChange:i=>Q(i.target.value)})]}),s.jsx("button",{type:"button",className:a.primaryButton,disabled:t==="update",onClick:()=>void m(X,z),children:o("assets.detail.save","Save metadata")})]}),s.jsxs("section",{className:a.detailSection,children:[s.jsx("h3",{children:o("assets.detail.localFile","Local file")}),s.jsxs("dl",{className:a.detailGrid,children:[s.jsx("dt",{children:o("assets.detail.fileName","File")}),s.jsx("dd",{children:e.file.original}),s.jsx("dt",{children:o("assets.detail.source","Source path")}),s.jsx("dd",{children:e.source.originalPath}),s.jsx("dt",{children:o("assets.detail.category","Category")}),s.jsx("dd",{children:de(e,o)}),s.jsx("dt",{children:o("assets.detail.scope","Scope")}),s.jsx("dd",{children:e.scope.kind==="shared"?o("assets.scope.shared","Shared"):o("assets.scope.place","Current Place")}),s.jsx("dt",{children:o("assets.detail.mimeType","Type")}),s.jsx("dd",{children:e.file.mimeType}),s.jsx("dt",{children:o("assets.detail.size","Size")}),s.jsx("dd",{children:Dn(e.file.sizeBytes)}),ts(e)&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:o("assets.detail.dimensions","Dimensions")}),s.jsx("dd",{children:ts(e)})]}),as(e)&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:o("assets.detail.duration","Duration")}),s.jsx("dd",{children:as(e)})]})]})]}),e.rbxm&&s.jsxs("section",{className:a.detailSection,children:[s.jsx("h3",{children:o("assets.detail.rbxm","RBXM contents")}),s.jsxs("dl",{className:a.detailGrid,children:[s.jsx("dt",{children:o("assets.detail.rbxmExportedCount","Exported roots")}),s.jsx("dd",{children:e.rbxm.exportedCount}),s.jsx("dt",{children:o("assets.detail.rbxmClasses","Classes")}),s.jsx("dd",{children:On(e)}),s.jsx("dt",{children:o("assets.detail.rbxmThumbnail","Thumbnail")}),s.jsx("dd",{children:ss(e)}),$&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:o("assets.detail.rbxmStudioUploadsLabel","Studio uploads")}),s.jsx("dd",{children:$})]}),n&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:o("assets.detail.studioInsertTarget","Studio insert target")}),s.jsx("dd",{children:f})]})]}),e.rbxm.roots.length>0&&s.jsxs("div",{className:a.metadataList,children:[s.jsx("strong",{children:o("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:o("assets.detail.rbxmReferences","Asset references")}),e.rbxm.resourceReferences.map((i,P)=>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}-${P}`))]}),e.rbxm.studioUploads&&e.rbxm.studioUploads.length>0&&s.jsxs("div",{className:a.metadataList,children:[s.jsx("strong",{children:o("assets.detail.rbxmStudioUploads","Embedded Studio uploads")}),e.rbxm.studioUploads.map((i,P)=>s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:Yn(i)}),s.jsx("code",{children:Xn(i)})]},`${i.path}-${i.assetType}-${i.sourceProperty??""}-${P}`))]}),e.rbxm.generation&&s.jsxs("div",{className:a.metadataList,children:[s.jsx("strong",{children:o("assets.detail.rbxmGeneration","Generated model")}),s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:o("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:o("assets.detail.rbxmGenerationPrompt","Prompt")}),s.jsx("code",{children:e.rbxm.generation.prompt})]}),s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:o("assets.detail.rbxmGenerationSchema","Schema")}),s.jsx("code",{children:Hn(e)})]}),e.rbxm.generation.path&&s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:o("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:o("assets.detail.rbxmReview","Model review")}),s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:o("assets.detail.rbxmReviewReadiness","Readiness")}),s.jsx("code",{children:e.rbxm.review.readiness})]}),s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:o("assets.detail.rbxmReviewSummary","Summary")}),s.jsx("code",{children:zn(e)})]}),e.rbxm.review.findings.slice(0,8).map((i,P)=>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}-${P}`))]})]}),s.jsxs("section",{className:a.detailSection,children:[s.jsx("h3",{children:o("assets.detail.roblox","Roblox upload status")}),s.jsxs("dl",{className:a.detailGrid,children:[s.jsx("dt",{children:o("assets.detail.status","Status")}),s.jsx("dd",{children:Ne(e.status,o)}),K?s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:o("assets.detail.decalAssetId","Roblox Decal ID")}),s.jsxs("dd",{className:a.copyableValue,children:[s.jsx("span",{children:M??o("assets.status.localOnly","Local only")}),s.jsx(ve,{label:o("assets.detail.copyDecalAssetId","Copy Roblox Decal ID"),value:M})]}),s.jsx("dt",{children:o("assets.detail.studioTextureImageId","Studio Texture Image ID")}),s.jsxs("dd",{className:a.copyableValue,children:[s.jsx("span",{children:I??"-"}),s.jsx(ve,{label:o("assets.detail.copyStudioTextureImageId","Copy Studio Texture Image ID"),value:I})]})]}):s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:o("assets.detail.assetId","Asset ID")}),s.jsxs("dd",{className:a.copyableValue,children:[s.jsx("span",{children:e.roblox.assetId??o("assets.status.localOnly","Local only")}),s.jsx(ve,{label:o("assets.detail.copyAssetId","Copy Asset ID"),value:e.roblox.assetId})]})]}),s.jsx("dt",{children:o("assets.detail.studioUri","Studio URI")}),s.jsx("dd",{children:e.roblox.assetUri??"-"}),s.jsx("dt",{children:o("assets.detail.robloxWebUrl","Creator Dashboard URL")}),s.jsxs("dd",{className:a.copyableValue,children:[s.jsx("span",{children:B??"-"}),s.jsx(ve,{label:o("assets.detail.copyWebUrl","Copy configure URL"),value:B})]}),e.roblox.errorMessage&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:o("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:!W,onClick:()=>{var i;return e.roblox.assetUri&&void((i=navigator.clipboard)==null?void 0:i.writeText(e.roblox.assetUri))},children:[s.jsx(gs,{size:15}),o("assets.detail.copyStudioUri","Copy Studio URI")]}),B&&s.jsxs("a",{className:a.commandButton,href:B,target:"_blank",rel:"noreferrer",children:[s.jsx(ks,{size:15}),o("assets.detail.openRobloxPage","Open configure page")]})]}),e.roblox.assetId&&s.jsx("p",{className:a.muted,children:o("assets.detail.robloxWebUrlNotice","Opening this page requires the Roblox account that owns or can manage the uploaded asset.")}),q.length>0&&s.jsxs("div",{className:a.metadataList,children:[s.jsx("strong",{children:o("assets.detail.uploadHistory","Upload history")}),q.slice().reverse().map((i,P)=>s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:Vn(i)}),ns(i)&&s.jsx("code",{children:ns(i)}),os(i)&&s.jsx("code",{children:os(i)}),i.operationPath&&s.jsx("code",{children:i.operationPath}),i.assetId&&s.jsxs("code",{children:[o("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??P}`))]})]}),s.jsxs("section",{className:a.detailSection,children:[s.jsx("h3",{children:o("assets.detail.usedInPlace","Where this asset is used in this Place")}),s.jsxs("dl",{className:a.detailGrid,children:[s.jsx("dt",{children:o("assets.detail.usageSource","Checked against")}),s.jsx("dd",{children:e.usage.scanSource==="localSync"?o("assets.detail.usageSource.localSync","Local Sync files"):o("assets.detail.usageSource.notScanned","Not checked yet")}),s.jsx("dt",{children:o("assets.detail.lastScanned","Last checked")}),s.jsx("dd",{children:e.usage.lastScannedAt?o("assets.detail.lastScannedAt","Last checked: {time}").replace("{time}",Se(e.usage.lastScannedAt)):o("assets.detail.lastScanned.never","No check yet")})]}),e.usage.references.length===0?s.jsx("p",{className:a.muted,children:v}):s.jsx("div",{className:a.usageList,children:e.usage.references.map((i,P)=>s.jsxs("div",{className:a.usageItem,children:[s.jsx("strong",{children:i.kind==="property"?i.instancePath:i.filePath}),s.jsx("span",{children:i.property??o("assets.detail.line","line {line}").replace("{line}",String(i.line??"-"))}),s.jsx("code",{children:i.value})]},`${i.kind}-${P}`))})]}),s.jsxs("details",{className:a.technicalDetails,children:[s.jsx("summary",{children:o("assets.detail.technicalDetails","Technical details")}),s.jsxs("dl",{className:a.detailGrid,children:[s.jsx("dt",{children:o("assets.detail.stableId","Stable ID")}),s.jsx("dd",{className:a.hashText,children:e.id}),s.jsx("dt",{children:o("assets.detail.sourceKind","Source kind")}),s.jsx("dd",{children:e.source.kind}),s.jsx("dt",{children:o("assets.detail.sha256","SHA-256")}),s.jsx("dd",{className:a.hashText,children:e.file.sha256}),s.jsx("dt",{children:o("assets.detail.createdAt","Created")}),s.jsx("dd",{children:Se(e.createdAt)}),s.jsx("dt",{children:o("assets.detail.updatedAt","Updated")}),s.jsx("dd",{children:Se(e.updatedAt)}),e.roblox.operationId&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:o("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:o("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:o("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:o("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:o("assets.detail.moderationState","Moderation")}),s.jsx("dd",{children:e.roblox.moderationState})]})]}),((b=e.rbxm)==null?void 0:b.thumbnail.attempts)&&e.rbxm.thumbnail.attempts.length>0&&s.jsxs("div",{className:a.metadataList,children:[s.jsx("strong",{children:o("assets.detail.rbxmThumbnailAttempts","Thumbnail attempts")}),e.rbxm.thumbnail.attempts.map((i,P)=>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}-${P}`))]})]})]})]})]})})}function Cs(e){return{assetUploadByOpenCloudEnabled:e.hot.ENABLE_ASSET_UPLOAD_BY_OPEN_CLOUD===!0}}function Jn(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 Zn(e){const t=await O.patch("/api/dashboard/settings",Jn(e));return Cs(t)}async function Ss(){return O.get("/api/dashboard/open-cloud/credential-profiles")}async function Qn(e){return O.post("/api/dashboard/open-cloud/credential-profiles",e)}async function eo(e){return O.patch("/api/dashboard/open-cloud/credential-profiles/active",{profileId:e})}async function so(e,t){return O.put(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}/api-key`,t)}async function to(e){return O.delete(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}`)}async function ao(e,t){return O.post(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}/creators`,t)}async function no(e,t){return O.patch(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}/creators/${encodeURIComponent(t)}/default`,{})}async function oo(e,t){return O.delete(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}/creators/${encodeURIComponent(t)}`)}async function lo(e,t){return O.post(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}/test`,t?{creatorPresetId:t}:{})}async function ro(e){return O.post("/api/dashboard/open-cloud/credential/test",e?{apiKey:e}:{})}function io(e){return e.category==="image"||e.category==="decal"}function co(e,t){return e==="group"?t("assets.creator.group","Group"):t("assets.creator.user","User")}function uo(e,t){return`${e.label} · ${co(e.creatorType,t)} ${e.creatorId}`}function ls(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 po({asset:e,open:t,canUpload:r,busyAction:n,onClose:l,onBack:f,onOpenSettings:g,onUpload:m}){const{t:p}=me(),R=c.useRef(null),[V,U]=c.useState(null),[k,o]=c.useState(null),[S,X]=c.useState(!1),[T,z]=c.useState(null),[Q,E]=c.useState(""),[W,B]=c.useState(""),[q,K]=c.useState(""),[M,I]=c.useState("user"),[$,v]=c.useState("");if(c.useEffect(()=>{E((e==null?void 0:e.displayName)??""),B((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 C=!1;return X(!0),z(null),(async()=>{try{const[H,Y]=await Promise.all([_s(),Ss()]);if(C)return;U(H);const re=Y.profiles.find(ae=>ae.id===Y.activeProfileId)??Y.profiles[0]??null;o(re);const ee=ls(re);K((ee==null?void 0:ee.id)??""),I((ee==null?void 0:ee.creatorType)??"user"),v((ee==null?void 0:ee.creatorId)??"")}catch(H){if(C)return;z(H instanceof Error?H.message:p("assets.upload.settingsLoadFailed","Failed to load upload settings.")),U(null),o(null)}finally{C||X(!1)}})(),()=>{C=!0}},[t,p]),c.useEffect(()=>{var H;if(!t||!e)return;(H=R.current)==null||H.focus();const C=Y=>{Y.key==="Escape"&&l()};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[e,l,t]),!t||!e)return null;const N=(V==null?void 0:V.assetUploadByOpenCloudEnabled)===!0,b=!!k,i=ls(k),P=(k==null?void 0:k.creators.find(C=>C.id===q))??null,J=!!i,D=(k==null?void 0:k.storageProvider)==="env"&&b&&!J,A=D&&$.trim().length>0,x=r&&!S&&!T&&(!N||!b||!J&&!D),G=r&&!S&&!T&&N&&b&&(J||A)&&n!=="upload";return s.jsx("div",{className:a.detailPopupLayer,onClick:l,role:"presentation",children:s.jsxs("section",{ref:R,className:a.detailDialog,role:"dialog","aria-modal":"true","aria-label":p("assets.upload.title","Upload asset"),tabIndex:-1,onClick:C=>C.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:f,children:[s.jsx(Ds,{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:l,"aria-label":p("common.close","Close"),children:s.jsx(Ge,{size:16})})})]})]}),s.jsxs("div",{className:a.detailDialogBody,children:[s.jsx("div",{className:a.detailPreviewPane,children:io(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.")}),S&&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})]}),x&&s.jsxs("div",{className:a.setupNotice,children:[s.jsx("strong",{children:p("assets.upload.settingsRequired","Upload settings required")}),s.jsx("p",{children:b?N?p("assets.upload.settingsRequired.creator","Save a default Creator before uploading."):p("assets.upload.settingsRequired.toggle","Enable Open Cloud upload before uploading."):p("assets.upload.settingsRequired.apiKey","Save an Open Cloud API key before uploading.")}),s.jsxs("button",{type:"button",className:a.commandButton,onClick:g,children:[s.jsx(ms,{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:C=>E(C.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:W,rows:3,disabled:!r,onChange:C=>B(C.target.value)}),s.jsx("small",{className:a.fieldHelp,children:p("assets.upload.descriptionHelp","Saved to Roblox as the asset description.")})]}),J&&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:q,disabled:!r||S,onChange:C=>K(C.target.value),children:k==null?void 0:k.creators.map(C=>s.jsx("option",{value:C.id,children:uo(C,p)},C.id))}),s.jsx("small",{className:a.fieldHelp,children:p("assets.upload.creatorHelp","Used by Open Cloud as the owner of the uploaded asset.")})]}),D&&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:M,disabled:!r,onChange:C=>I(C.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:$,disabled:!r,onChange:C=>v(C.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:!G,onClick:()=>{const C=$.trim(),H=D&&C?{creatorType:M,creatorId:C}:{},Y=!D&&P&&i&&P.id!==i.id?{creatorType:P.creatorType,creatorId:P.creatorId}:{};m({displayName:Q,description:W,...H,...Y})},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 rs(e,t){return e==="env"?t("assets.settings.credential.env","Environment variable"):t("assets.settings.credential.local","Local encrypted file")}function Oe(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 ho(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 mo(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 xo(e,t){return e==="group"?t("assets.creator.group","Group"):t("assets.creator.user","User")}function go(e,t){return`${xo(e.creatorType,t)} ${e.creatorId}`}function fo({open:e,tier:t,onClose:r}){const{t:n}=me(),[l,f]=c.useState(null),[g,m]=c.useState(null),[p,R]=c.useState(""),[V,U]=c.useState(!1),[k,o]=c.useState(""),[S,X]=c.useState(""),[T,z]=c.useState("user"),[Q,E]=c.useState(""),[W,B]=c.useState(""),[q,K]=c.useState(!0),[M,I]=c.useState(null),[$,v]=c.useState(null),[N,b]=c.useState(!1),i=t==="basic",P=c.useCallback(async()=>{b(!0),I(null);try{const[u,_]=await Promise.all([_s(),Ss()]);f(u),m(_);const L=_.profiles.find(ue=>ue.id===_.activeProfileId)??_.profiles[0]??null;R((L==null?void 0:L.id)??""),U(!L),K(!L||L.creators.length===0),z("user"),E(""),B("")}catch(u){I(u instanceof Error?u.message:n("assets.settings.loadFailed","Failed to load upload settings."))}finally{b(!1)}},[n]);if(c.useEffect(()=>{e&&P()},[P,e]),!e)return null;const J=(l==null?void 0:l.assetUploadByOpenCloudEnabled)===!0,h=S.trim(),D=Q.trim(),A=(g==null?void 0:g.profiles)??[],x=A.find(u=>u.id===p)??A[0]??null,G=!!x,C=G&&(x==null?void 0:x.storageProvider)==="localFile",H=G&&(x==null?void 0:x.storageProvider)==="env",Y=x!=null&&x.defaultCreatorId?x.creators.find(u=>u.id===x.defaultCreatorId):x==null?void 0:x.creators[0],re=!!(x!=null&&x.creators.length),ee=!re||q,ae=A.length>1,ie=i?n("assets.settings.action.proRequired","Asset upload settings are available on Pro."):N?n("assets.settings.action.busy","Wait for the current settings action to finish."):null,Pe=i||N||!h,ke=ie??(h?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||N||!h&&!G,be=ie??(h?n("assets.settings.testConnection.tooltip.entered","Test the entered API key before saving it."):G?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||N||!C,je=ie??(C?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.")),Re=i||N||!C||!D,$e=ie??(H?n("assets.settings.saveCreator.tooltip.env","Environment API keys cannot save a default Creator here. Enter Creator details in the upload dialog."):C?D?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.")),Le=ie??(C?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||N||H||!C,Ue=ie??(C?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.")),Te=Y?n("assets.settings.saveCreatorPreset","Save Creator"):n("assets.settings.saveCreator","Save default Creator"),d=(x==null?void 0:x.label)??n("assets.settings.credential.none","No API key saved"),y=u=>{const _=u.profiles.find(L=>L.id===u.activeProfileId)??u.profiles[0]??null;m(u),R((_==null?void 0:_.id)??""),K(!_||_.creators.length===0),U(u.profiles.length===0)},j=async()=>{if(x){b(!0);try{const u=await lo(x.id,Y==null?void 0:Y.id);y(u),I(mo(u.validation,n))}catch(u){I(u instanceof Error?u.message:n("assets.settings.testFailed","Connection test failed."))}finally{b(!1)}}},w=async()=>{if($){b(!0);try{if($.kind==="apiKey"){const u=await to($.profileId);y(u),I(n("assets.settings.apiKeyRemoved","Open Cloud API key unregistered from local storage."))}else{const u=await oo($.profileId,$.creatorPresetId);y(u),I(n("assets.settings.creatorUnregistered","Creator unregistered from this profile."))}v(null)}catch(u){I(u instanceof Error?u.message:$.kind==="apiKey"?n("assets.settings.removeFailed","Failed to unregister API key."):n("assets.settings.creatorUnregisterFailed","Failed to unregister Creator."))}finally{b(!1)}}},F=($==null?void 0:$.kind)==="apiKey"?n("assets.settings.unregisterApiKey.title","Unregister API Key?"):n("assets.settings.unregisterCreator.title","Unregister Creator?"),ne=($==null?void 0:$.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=($==null?void 0:$.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(Ge,{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(Bs,{checked:J,disabled:i||N,onChange:u=>{(async()=>{b(!0);try{const _=await Zn({assetUploadByOpenCloudEnabled:u.target.checked});f(_),I(n("assets.settings.saved","Upload settings saved."))}catch(_){I(_ instanceof Error?_.message:n("assets.settings.saveFailed","Failed to save upload settings."))}finally{b(!1)}})()}})]}),ae&&s.jsx("div",{className:a.metadataList,children:A.map(u=>{const _=u.id===(x==null?void 0:x.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"),": ",rs(u.storageProvider,n)]}),s.jsxs("span",{children:[n("assets.settings.field.validationStatus","Validation status"),": ",Oe(u.validationStatus,n)]}),_&&s.jsx("code",{children:n("assets.settings.activeProfileBadge","Active")}),!_&&u.storageProvider==="localFile"&&s.jsx("button",{type:"button",className:a.commandButton,disabled:i||N,onClick:()=>{(async()=>{b(!0);try{const L=await eo(u.id),ue=L.profiles.find(Ee=>Ee.id===(L.activeProfileId??u.id))??u;m(L),R(ue.id),K(ue.creators.length===0),z("user"),E(""),B(""),I(n("assets.settings.profileSelected","Open Cloud credential profile selected."))}catch(L){I(L instanceof Error?L.message:n("assets.settings.saveFailed","Failed to save upload settings."))}finally{b(!1)}})()},children:n("assets.settings.useProfile","Use profile")})]},u.id)})}),x&&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:x.label})]}),x.maskedKey&&s.jsxs("div",{children:[s.jsx("dt",{children:n("assets.settings.field.apiKey","API Key")}),s.jsx("dd",{children:x.maskedKey})]}),s.jsxs("div",{children:[s.jsx("dt",{children:n("assets.settings.field.storage","Storage")}),s.jsx("dd",{children:rs(x.storageProvider,n)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:n("assets.settings.field.validationStatus","Validation status")}),s.jsx("dd",{children:Oe(x.validationStatus,n)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:n("assets.settings.field.creators","Creators")}),s.jsx("dd",{children:x.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:()=>{j()},children:n("assets.settings.testConnection","Test Connection")})}),C&&s.jsx("button",{type:"button",className:a.commandButton,disabled:i||N,onClick:()=>U(!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:()=>v({kind:"apiKey",profileId:x.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:k,disabled:i||N,onChange:u=>o(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(Xe,{topicId:"openCloudApiKey",variant:"field",state:{hasOpenCloudCredential:G}})]}),s.jsx("input",{id:"asset-settings-open-cloud-api-key",value:S,type:"password",disabled:i||N,onChange:u=>X(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.")})]}),!G&&s.jsx("p",{className:a.inlineHelp,children:s.jsx("a",{href:Us["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:ke,children:s.jsx("button",{type:"button",className:a.commandButton,disabled:Pe,onClick:()=>{(async()=>{var u;b(!0);try{const _={apiKey:h,...k.trim()?{label:k.trim()}:{}},L=(x==null?void 0:x.storageProvider)==="localFile"?await so(x.id,_):await Qn(_),ue=L.profiles.find(Ee=>{var Ye;return Ee.id===(L.activeProfileId??((Ye=L.profile)==null?void 0:Ye.id))});m(L),R(L.activeProfileId??((u=L.profile)==null?void 0:u.id)??""),K(!ue||ue.creators.length===0),U(!1),X(""),o(""),I(n("assets.settings.apiKeySaved","Open Cloud API key saved locally."))}catch(_){I(_ instanceof Error?_.message:n("assets.settings.saveFailed","Failed to save upload settings."))}finally{b(!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()=>{b(!0);try{const u=await ro(h||void 0);I(ho(u.validation,n))}catch(u){I(u instanceof Error?u.message:n("assets.settings.testFailed","Connection test failed."))}finally{b(!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:()=>{x&&v({kind:"apiKey",profileId:x.id})},children:n("assets.settings.removeApiKey","Unregister API Key")})})]})]}),s.jsx("div",{className:a.metadataList,children:x==null?void 0:x.creators.map(u=>s.jsxs("div",{className:a.metadataItem,children:[s.jsx("strong",{children:u.label}),s.jsx("span",{children:go(u,n)}),u.id===x.defaultCreatorId&&s.jsx("code",{children:n("assets.settings.defaultCreatorBadge","Default")}),s.jsxs("span",{children:[n("assets.settings.field.validationStatus","Validation status"),": ",Oe(u.validationStatus,n)]}),s.jsxs("div",{className:a.buttonRow,children:[u.id!==x.defaultCreatorId&&x.storageProvider==="localFile"&&s.jsx("button",{type:"button",className:a.commandButton,disabled:i||N,onClick:()=>{(async()=>{if(x){b(!0);try{const _=await no(x.id,u.id);m(_),I(n("assets.settings.defaultCreatorSaved","Open Cloud default Creator saved locally."))}catch(_){I(_ instanceof Error?_.message:n("assets.settings.saveFailed","Failed to save upload settings."))}finally{b(!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:()=>v({kind:"creator",profileId:x.id,creatorPresetId:u.id}),children:n("assets.settings.unregisterCreator","Unregister Creator")})})]})]},u.id))}),re&&!q&&s.jsx(Z,{text:Le,children:s.jsx("button",{type:"button",className:a.commandButton,disabled:i||N||H||!C,onClick:()=>{z("user"),E(""),B(""),K(!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||N||H||!C,onChange:u=>z(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(Xe,{topicId:"openCloudCreatorId",variant:"field",state:{hasDefaultCreator:!!Y}})]}),s.jsx("input",{id:"asset-settings-creator-id",value:Q,disabled:i||N||H||!C,onChange:u=>E(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:W,disabled:i||N||H||!C,onChange:u=>B(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.")})]}),!Y&&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:$e,children:s.jsx("button",{type:"button",className:a.primaryButton,disabled:Re,onClick:()=>{(async()=>{if(x){b(!0);try{const u=await ao(x.id,{creatorType:T,creatorId:D,makeDefault:!Y,...W.trim()?{label:W.trim()}:{}});m(u),E(""),B(""),K(!1),I(n("assets.settings.defaultCreatorSaved","Open Cloud default Creator saved locally."))}catch(u){I(u instanceof Error?u.message:n("assets.settings.saveFailed","Failed to save upload settings."))}finally{b(!1)}}})()},children:Te})}),re&&s.jsx("button",{type:"button",className:a.commandButton,disabled:i||N,onClick:()=>{z("user"),E(""),B(""),K(!1)},children:n("assets.settings.cancelCreator","Cancel")})]})]})]}),M&&s.jsx("div",{className:a.messageState,children:M}),s.jsx(xs,{open:$!==null,title:F,message:ne,cancelLabel:n("common.cancel","Cancel"),confirmLabel:se,loading:N,onCancel:()=>v(null),onConfirm:()=>{w()}})]})}const bo=12,yo=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=>ge(n,t))?e.map(n=>ge(n,t)?t:n):[t,...e]}function ge(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 jo(e,t){return e.some(r=>ge(r,t))?e.map(r=>ge(r,t)?t:r):e}function ze(e,t){return yt(e.filter(r=>bt(r,t)))}function xe(e,t){return e?`${e.displayName} (${e.id})`:t??"unknown asset"}function vo(e){return e.length===0?"none":e.map(t=>xe(t)).join(", ")}function cs(e){const t=`status ${e.status}`;return e.roblox.assetId?`Roblox asset ${e.roblox.assetId}; ${t}`:t}function Co(e,t){const r=xe(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 _o(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 So(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 So(e,t).flatMap(n=>ft(r).map(l=>({request:{...n,category:l},label:`${n.scope}/${l}`})))}function ps(e,t){if(t.length===0)return null;const r=t.map(({label:n,reason:l})=>`${n}: ${ce(l,"request failed")}`);return`${e}: ${r.join("; ")}`}function wo(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 No(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{...wo(e),overrideStillValid:t===null}}function Ao(){const[e,t]=c.useState([]),[r,n]=c.useState(0),[l,f]=c.useState(null),[g,m]=c.useState("place"),[p,R]=c.useState("all"),[V,U]=c.useState([]),[k,o]=c.useState(null),[S,X]=c.useState(null),[T,z]=c.useState(null),[Q,E]=c.useState(null),[W,B]=c.useState(!1),[q,K]=c.useState(!1),[M,I]=c.useState(!0),[$,v]=c.useState(null),[N,b]=c.useState(null),[i,P]=c.useState(null),J=c.useRef(!0),h=c.useRef(new Map),D=c.useRef(new Set),A=c.useMemo(()=>e.find(d=>te(d)===l)??null,[e,l]),x=(A==null?void 0:A.id)??null;c.useEffect(()=>{l&&(e.some(d=>te(d)===l)||f(null))},[e,l]);const G=c.useCallback(d=>{const y=h.current.get(d);y!==void 0&&(clearTimeout(y),h.current.delete(d))},[]),C=c.useCallback((d,y=bo)=>{const j=te(d);if(!ds(d)||y<=0){G(j);return}D.current.has(j)||(G(j),D.current.add(j),(async()=>{try{const w=await qe(Ce(d),d.id);if(!J.current)return;if(t(F=>jo(F,w)),ds(w)&&y>1){const F=te(w),ne=setTimeout(()=>{h.current.delete(F),C(w,y-1)},yo);h.current.set(F,ne);return}G(te(w))}catch(w){if(!J.current)return;G(j),b(ce(w,"Asset Library status refresh failed."))}finally{D.current.delete(j)}})())},[G]);c.useEffect(()=>()=>{J.current=!1;for(const d of h.current.values())clearTimeout(d);h.current.clear(),D.current.clear()},[]);const H=c.useCallback(()=>g==="shared"?{scope:"shared"}:{scope:"place",placeId:T??void 0},[T,g]),Y=c.useCallback(d=>({...H(),category:d}),[H]),re=c.useCallback(async()=>{try{const d=await Rs(),y=No(d,k);return U(d.places),y.overrideStillValid||o(null),X(y.placeId),z(y.placeId),E(y.placeName),B(y.studioConnected),K(y.studioConnected),y.placeId}catch{return U([]),X(null),z(null),E(null),B(!1),K(!1),null}},[k]),ee=c.useCallback(async()=>{b(null);try{const d=await re();if(g==="place"&&d===null){t([]),n(0),I(!1),b("No active place is connected for place-scoped assets.");return}const y=us(g,d,p),j=await Promise.allSettled(y.map(({request:se})=>lt(se))),w=j.flatMap(se=>se.status==="fulfilled"?[se.value]:[]),F=j.flatMap((se,u)=>se.status==="rejected"?[{label:y[u].label,reason:se.reason}]:[]);g==="all"&&d===null&&F.unshift({label:"place",reason:new Error("No active place is available")});const ne=ze(w.flatMap(se=>se.assets),p);t(ne),n(ne.length);for(const se of ne)C(se);b(ps("Some Asset Library requests failed",F))}catch(d){b(ce(d,"Failed to load Asset Library."))}finally{I(!1)}},[p,re,g,C]);c.useEffect(()=>{ee()},[ee]);const ae=c.useCallback(async(d,y,j)=>{const w=(A==null?void 0:A.id)===y?A:e.find(F=>F.id===y)??null;if(!w)return b("Asset context is unavailable."),null;v(d),b(null),P(null);try{const F=await j(Ce(w));return t(ne=>is(ne,F)),f(te(F)),_o(d)&&P(Co(d,F)),F}catch(F){return b(ce(F,"Asset Library action failed.")),null}finally{v(null)}},[e,A]),ie=c.useCallback(async()=>{v("rescan"),b(null),P(null);try{const d=us(g,T,p);if(g==="place"&&T===null){b("No active place is connected for place-scoped assets.");return}const y=await Promise.allSettled(d.map(({request:_})=>rt(_))),j=y.flatMap(_=>_.status==="fulfilled"?[_.value]:[]),w=y.flatMap((_,L)=>_.status==="rejected"?[{label:d[L].label,reason:_.reason}]:[]);g==="all"&&T===null&&w.unshift({label:"place",reason:new Error("No active place is available")});const F=ze(j.flatMap(_=>_.assets),p),ne=j.reduce((_,L)=>_+L.adoptedCount,0),se=j.reduce((_,L)=>_+L.skippedCount,0),u=ze(j.flatMap(_=>_.adopted),p);t(F),n(F.length),P(`Rescan complete for ${p}: ${ne} asset(s) added, ${se} skipped. Added: ${vo(u)}.`),b(ps("Some Asset Library rescans failed",w))}catch(d){b(ce(d,"Asset Library rescan failed."))}finally{v(null)}},[T,p,g]),Pe=c.useCallback(async(d,y)=>{v("export-selection-rbxm"),b(null),P(null);try{const j=await pt(Y(d),y);return t(w=>is(w,j.asset)),f(te(j.asset)),P(`Exported Studio selection as RBXM asset: ${xe(j.asset)}${j.deduplicated?" (reused existing local asset)":""}.`),j}catch(j){return b(ce(j,"Asset Library .rbxm export failed.")),null}finally{v(null)}},[Y]),ke=c.useCallback((d,y)=>ae("update",d,j=>it(j,d,y)),[ae]),fe=c.useCallback(async(d,y)=>{const j=await ae("upload",d,w=>dt(w,d,y));return j&&C(j),j},[ae,C]),be=c.useCallback(async d=>{const y=(A==null?void 0:A.id)===d?A:e.find(w=>w.id===d)??null;if(!y)return b("Asset context is unavailable."),!1;const j=te(y);G(j),v("delete"),b(null),P(null);try{return await ct(Ce(y),d),t(w=>{const F=w.filter(ne=>!ge(ne,y));return n(F.length),F}),f(w=>w===j?null:w),P(`Deleted asset: ${xe(y,d)}. Local files removed; uploaded Roblox assets were not deleted.`),!0}catch(w){return b(ce(w,"Asset Library delete failed.")),!1}finally{v(null)}},[e,G,A]),ye=c.useCallback(async(d,y)=>{const j=(A==null?void 0:A.id)===d?A:e.find(w=>w.id===d)??null;if(!j)return b("Asset context is unavailable."),null;v("import-rbxm"),b(null),P(null);try{const w=await ht(Ce(j),d,y);return f(te(j)),P(`Imported RBXM asset: ${xe(j,d)} -> ${w.importedCount} instance(s) to ${w.targetParent}.`),w}catch(w){return b(ce(w,"Asset Library .rbxm import failed.")),null}finally{v(null)}},[e,A]),je=c.useCallback(d=>ae("thumbnail-generate",d,y=>mt(y,d)),[ae]),Re=c.useCallback(d=>{const y=(A==null?void 0:A.id)===d?A:e.find(j=>j.id===d)??null;return y&&G(te(y)),ae("status-refresh",d,j=>qe(j,d))},[e,G,ae,A]),$e=c.useCallback((d,y)=>ae("usage-scan",d,async j=>(await ut(j,d,y)).asset),[ae]),Le=c.useCallback(d=>{m(d),f(null)},[]),Be=c.useCallback(d=>{o(d),f(null)},[]),Ue=c.useCallback(d=>{gt(d)&&R(d)},[]),Te=c.useCallback(d=>{if(d===null){f(null);return}const j=e.find(w=>te(w)===d)??e.find(w=>w.id===d);f(j?te(j):d)},[e]);return{assets:e,totalCount:r,selectedAsset:A,selectedAssetId:x,selectedAssetKey:l,scope:g,categoryFilter:p,availablePlaces:V,selectedPlaceId:S,activePlaceId:T,activePlaceName:Q,selectedPlaceIsConnected:W,studioConnected:q,loading:M,busyAction:$,error:N,lastMessage:i,setScope:Le,setSelectedPlaceId:Be,setCategoryFilter:Ue,selectAsset:Te,refresh:ee,rescan:ie,exportSelectionRbxm:Pe,updateMetadata:ke,uploadAsset:fe,deleteAsset:be,importRbxm:ye,generateThumbnail:je,refreshStatus:Re,scanUsage:$e}}const ws="weppy-assets-view-preferences-v1",he={organizationMode:"folders",viewMode:"grid",gridSize:"medium"};function Io(e){return e==="folders"||e==="all-assets"}function Po(e){return e==="grid"||e==="list"}function ko(e){return e==="small"||e==="medium"||e==="large"}function Ro(){if(typeof window>"u")return he;try{const e=window.localStorage.getItem(ws);if(!e)return he;const t=JSON.parse(e);return{organizationMode:Io(t.organizationMode)?t.organizationMode:he.organizationMode,viewMode:Po(t.viewMode)?t.viewMode:he.viewMode,gridSize:ko(t.gridSize)?t.gridSize:he.gridSize}}catch{return he}}function $o(){const[e,t]=c.useState(Ro);return c.useEffect(()=>{try{window.localStorage.setItem(ws,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 Lo(e,t){return t("assets.count.shown","Shown assets: {count}").replace("{count}",String(e))}function Bo(e,t){return e===null?null:t("assets.place.id","Place ID {placeId}").replace("{placeId}",String(e))}function Oo(){const{t:e}=me(),{trackEvent:t}=$s(),{tier:r,loading:n}=Ls(),l=Ao(),f=$o(),[g,m]=c.useState(!1),[p,R]=c.useState(!1),[V,U]=c.useState(!1),k=!n&&r==="pro",o=l.selectedAsset,S=(o==null?void 0:o.file.original.toLowerCase().endsWith(".rbxm"))??!1,X=(o==null?void 0:o.category)==="model"||(o==null?void 0:o.category)==="animation",T="game.Workspace",Q=!!(k&&l.studioConnected&&o&&S&&X),E=l.availablePlaces??[],W=l.selectedPlaceId??l.activePlaceId,B=l.selectedAssetKey??(o?te(o):null),q=c.useCallback(()=>{l.selectAsset(null)},[l.selectAsset]),K=c.useMemo(()=>l.scope==="shared"?[e("assets.scope.shared","Shared")]:l.scope==="all"?[e("assets.scope.all","All scopes"),l.activePlaceName??e("assets.scope.place","Current Place"),e("assets.scope.shared","Shared")]:[l.activePlaceName??e("assets.scope.place","Current Place"),Bo(l.activePlaceId,e),l.selectedPlaceIsConnected?e("assets.place.connected","Connected"):null].filter(v=>!!v),[l.activePlaceId,l.activePlaceName,l.scope,l.selectedPlaceIsConnected,e]),M=c.useMemo(()=>Ke(l.categoryFilter,e),[l.categoryFilter,e]),I=Lo(l.totalCount,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(Ts,{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":l.scope==="all",className:l.scope==="all"?a.segmentedActive:"",onClick:()=>l.setScope("all"),children:e("assets.scope.all","All scopes")}),s.jsx("button",{type:"button","aria-pressed":l.scope==="place",className:l.scope==="place"?a.segmentedActive:"",onClick:()=>l.setScope("place"),children:e("assets.scope.place","Current Place")}),s.jsx("button",{type:"button","aria-pressed":l.scope==="shared",className:l.scope==="shared"?a.segmentedActive:"",onClick:()=>l.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:l.scope==="shared"?s.jsx("span",{className:a.sharedPlaceContext,children:e("assets.place.sharedLibrary","Shared library")}):E.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 W=="number"?String(W):"",onChange:v=>{const N=Number.parseInt(v.currentTarget.value,10);Number.isInteger(N)&&l.setSelectedPlaceId(N)},children:E.map(v=>s.jsxs("option",{value:v.placeId,children:[v.placeName," (",v.placeId,")"]},v.placeId))})]}):s.jsx("span",{className:a.sharedPlaceContext,children:l.activePlaceName??e("assets.scope.place","Current Place")})}),s.jsxs("div",{className:a.listContextSummary,children:[K.map((v,N)=>s.jsxs("span",{children:[N>0?s.jsx("span",{className:a.contextDivider,children:" · "}):null,v]},`${v}-${N}`)),s.jsx("span",{className:a.contextDivider,children:" · "}),s.jsx("span",{children:M}),s.jsx("span",{className:a.contextDivider,children:" · "}),s.jsx("strong",{children:I})]}),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:l.busyAction==="rescan",onClick:()=>{t("dashboard_click_event",{click_target:"assets_rescan",page:"assets"}),l.rescan()},children:[s.jsx(hs,{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"}),R(v=>!v)},"aria-label":e("assets.settings.open","Open settings"),"aria-controls":"asset-library-settings-panel","aria-expanded":p,children:s.jsx(ms,{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(v=>{const N=l.categoryFilter===v,b=Ke(v,e);return s.jsx("button",{type:"button",role:"radio","aria-checked":N,className:[a.categoryButton,N?a.categoryButtonActive:""].filter(Boolean).join(" "),onClick:()=>{l.setCategoryFilter(v)},children:b},v)})})]})]}),s.jsx(fo,{open:p,tier:r,onClose:()=>R(!1)})]}),l.error&&s.jsxs("div",{className:a.errorState,children:[l.scope==="all"?s.jsx("strong",{children:e("assets.partial.title","Some locations could not be loaded")}):null,s.jsx("span",{children:l.error})]}),l.lastMessage&&s.jsx("div",{className:a.messageState,children:l.lastMessage}),l.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.")})]}),!k&&!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.")}),l.loading?s.jsx("div",{className:a.emptyState,children:e("assets.loading.scope","Loading {scope} assets...").replace("{scope}",l.scope==="all"?e("assets.scope.all","All scopes"):l.scope==="shared"?e("assets.scope.shared","Shared"):e("assets.scope.place","Current Place"))}):s.jsx(Un,{displayScope:l.scope,assets:l.assets,place:{placeId:l.activePlaceId,placeName:l.activePlaceName},categoryFilter:l.categoryFilter,organizationMode:f.organizationMode,viewMode:f.viewMode,gridSize:f.gridSize,selectedAssetKey:B,onSelectAsset:l.selectAsset,onClearSelection:q,onOrganizationModeChange:f.setOrganizationMode,onViewModeChange:f.setViewMode,onGridSizeChange:f.setGridSize}),s.jsx(qn,{asset:g||p||V?null:o,busyAction:l.busyAction,canUpload:k,canImportRbxm:Q,importRbxmTooltip:$,importRbxmTargetParent:T,onClose:()=>l.selectAsset(null),onSave:async(v,N)=>{o&&await l.updateMetadata(o.id,{displayName:v,description:N})},onUpload:()=>m(!0),onDelete:()=>U(!0),onImportRbxm:async()=>{o&&(t("dashboard_click_event",{click_target:"assets_import_rbxm",page:"assets"}),await l.importRbxm(o.id,{targetParent:T}))},onRefreshStatus:async()=>{o&&await l.refreshStatus(o.id)},onScanUsage:async()=>{o&&(t("dashboard_click_event",{click_target:"assets_usage_scan",page:"assets"}),await l.scanUsage(o.id,l.activePlaceId??void 0))}}),s.jsx(xs,{open:V&&!!o,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:()=>U(!1),onConfirm:()=>{o&&(t("dashboard_click_event",{click_target:"assets_delete",page:"assets"}),l.deleteAsset(o.id).then(v=>{v&&U(!1)}))}}),s.jsx(po,{asset:o,open:g,canUpload:k,busyAction:l.busyAction,onClose:()=>{m(!1),l.selectAsset(null)},onBack:()=>m(!1),onOpenSettings:()=>{m(!1),R(!0)},onUpload:async v=>{if(!o)return;t("dashboard_click_event",{click_target:"assets_upload_submit",page:"assets"}),await l.uploadAsset(o.id,v)&&m(!1)}})]})}export{Oo as Component};
@@ -0,0 +1 @@
1
+ ._card_qniob_2{display:block;width:100%;background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:14px 18px;color:inherit;font:inherit;text-align:left;cursor:pointer;transition:border-color var(--transition),box-shadow var(--transition)}._card_qniob_2:hover{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent-dim)}._card_qniob_2:focus-visible{outline:2px solid var(--accent);outline-offset:2px}._header_qniob_27{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}._statusBadge_qniob_34{display:flex;align-items:center;gap:6px;font-family:var(--font-label);font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em}._statusDot_qniob_45{width:7px;height:7px;border-radius:50%}._active_qniob_51 ._statusDot_qniob_45{background:var(--success);box-shadow:0 0 6px var(--success)}._active_qniob_51{color:var(--success)}._completed_qniob_60 ._statusDot_qniob_45{background:var(--text-muted)}._completed_qniob_60{color:var(--text-secondary)}._timeRange_qniob_68{font-family:var(--font-code);font-size:11px;color:var(--text-secondary)}._summaryList_qniob_75{display:flex;flex-direction:column;gap:4px}._summaryItem_qniob_81{display:flex;align-items:center;gap:8px;font-family:var(--font-code);font-size:12px;color:var(--text-primary)}._summaryIcon_qniob_90{width:20px;text-align:center;flex-shrink:0}._summaryText_qniob_96{color:var(--text-secondary)}._progressBar_qniob_101{display:block;margin-top:10px;height:3px;background:var(--bg-secondary);border-radius:2px;overflow:hidden}._progressFill_qniob_110{display:block;height:100%;background:var(--accent);border-radius:2px;animation:_pulse_qniob_1 2s ease-in-out infinite}@keyframes _pulse_qniob_1{0%,to{opacity:.6;width:30%}50%{opacity:1;width:70%}}._emptySummary_qniob_124{font-family:var(--font-label);font-size:12px;color:var(--text-muted);text-align:center;padding:8px 0}._contextBlock_qniob_132{margin-top:12px;padding-top:12px;border-top:1px solid var(--border);display:flex;flex-direction:column;gap:4px}._contextLabel_qniob_141{font-family:var(--font-label);font-size:10px;text-transform:uppercase;letter-spacing:.05em;color:var(--text-muted)}._contextValue_qniob_149{font-family:var(--font-label);font-size:12px;color:var(--text-primary);line-height:1.5}._dialogContent_djmny_2{display:flex;min-width:0;min-height:0;flex:1;flex-direction:column}._dialogHeader_djmny_10{display:flex;flex:0 0 auto;align-items:center;justify-content:space-between;gap:16px;padding:16px 20px;border-bottom:1px solid var(--border)}._dialogTitleGroup_djmny_20{display:flex;min-width:0;align-items:center;gap:14px}._dialogTitle_djmny_20{margin:0;color:var(--text-primary);font-family:var(--font-label);font-size:16px;font-weight:600}._dialogMeta_djmny_35{display:flex;min-width:0;align-items:center;gap:10px}._dialogClose_djmny_42{display:inline-flex;width:44px;height:44px;flex:0 0 44px;align-items:center;justify-content:center;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--text-secondary);cursor:pointer}._dialogClose_djmny_42:hover{border-color:var(--border);background:var(--bg-secondary);color:var(--text-primary)}._dialogClose_djmny_42:focus-visible{outline:2px solid var(--accent);outline-offset:2px}._dialogBody_djmny_67{min-width:0;min-height:0;flex:1;overflow-x:hidden;overflow-y:auto;padding:20px}._page_djmny_76{display:flex;flex-direction:column;gap:20px;width:100%}._headerTime_djmny_83{font-family:var(--font-code);font-size:12px;color:var(--text-secondary)}._dialogActions_djmny_89{display:flex;gap:8px;margin-top:12px}._retryButton_djmny_95{min-height:44px;padding:8px 14px;border:1px solid var(--border);border-radius:6px;background:var(--bg-secondary);color:var(--text-primary);cursor:pointer}._retryButton_djmny_95:focus-visible{outline:2px solid var(--accent);outline-offset:2px}@media(max-width:760px){._dialogHeader_djmny_10,._dialogTitleGroup_djmny_20,._dialogMeta_djmny_35{align-items:flex-start}._dialogTitleGroup_djmny_20,._dialogMeta_djmny_35{flex-direction:column;gap:4px}._dialogBody_djmny_67{padding:12px}}._statusActive_djmny_128{color:var(--success);font-weight:600}._statusCompleted_djmny_133{color:var(--text-muted)}._section_djmny_138{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:16px 20px}._sectionTitle_djmny_145{font-family:var(--font-label);font-size:12px;font-weight:600;color:var(--text-primary);text-transform:uppercase;letter-spacing:.05em;margin-bottom:12px;padding-bottom:8px;border-bottom:1px solid var(--border)}._summaryGrid_djmny_158{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:10px}._summaryCard_djmny_164{display:block;width:100%;background:var(--bg-secondary);border:1px solid var(--border);border-radius:6px;padding:10px 12px;color:inherit;font:inherit;text-align:center;cursor:pointer;transition:border-color var(--transition)}._summaryCard_djmny_164:hover{border-color:var(--accent)}._summaryCard_djmny_164:focus-visible{outline:2px solid var(--accent);outline-offset:2px}._summaryCardActive_djmny_187{border-color:var(--accent);background:var(--accent-dim)}._summaryIcon_djmny_192{font-size:20px;display:block;margin-bottom:4px}._summaryCount_djmny_198{display:block;font-family:var(--font-code);font-size:18px;font-weight:700;color:var(--text-primary)}._summaryLabel_djmny_206{display:block;font-family:var(--font-label);font-size:10px;color:var(--text-secondary);text-transform:uppercase;letter-spacing:.04em;margin-top:2px}._contextGrid_djmny_216{display:flex;flex-direction:column;gap:10px}._contextRow_djmny_222{display:flex;flex-direction:column;gap:4px}._contextKey_djmny_228{font-family:var(--font-label);font-size:10px;color:var(--text-muted);text-transform:uppercase;letter-spacing:.05em}._contextValue_djmny_236{font-family:var(--font-label);font-size:13px;color:var(--text-primary);line-height:1.5}._timelineFilter_djmny_244{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-bottom:12px}._filterLabel_djmny_252{font-family:var(--font-label);font-size:11px;color:var(--text-secondary)}._filterSelect_djmny_258{font-family:var(--font-code);font-size:11px;padding:3px 8px;border:1px solid var(--border);border-radius:4px;background:var(--bg-secondary);color:var(--text-primary)}._ownershipToggle_djmny_268{display:inline-flex;min-height:44px;align-items:center;gap:8px;margin-left:auto;color:var(--text-secondary);font-family:var(--font-label);font-size:12px;cursor:pointer}._ownershipToggle_djmny_268 input{width:16px;height:16px;accent-color:var(--accent)}._timeline_djmny_244{display:flex;flex-direction:column;gap:0;position:relative;max-height:480px;overflow-y:auto}._timelineEntry_djmny_296{display:flex;width:100%;gap:12px;padding:8px 0;border-bottom:1px solid var(--border);border-top:0;border-right:0;border-left:0;background:transparent;color:inherit;text-align:left;transition:background var(--transition);cursor:pointer}._timelineEntry_djmny_296:last-child{border-bottom:none}._timelineEntry_djmny_296:hover{background:var(--bg-secondary)}._timelineEntry_djmny_296:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}._timelineTime_djmny_325{font-family:var(--font-code);font-size:11px;color:var(--text-muted);min-width:50px;flex-shrink:0}._timelineIcon_djmny_333{font-size:14px;flex-shrink:0}._timelineBody_djmny_338{display:block;flex:1;min-width:0}._timelineSummary_djmny_344{display:block;font-family:var(--font-code);font-size:12px;color:var(--text-primary);word-break:break-all}._timelineTarget_djmny_352{display:block;font-family:var(--font-code);font-size:11px;color:var(--text-secondary);margin-top:2px}._timelineConfidence_djmny_360{font-family:var(--font-label);font-size:9px;padding:1px 5px;border-radius:3px;margin-left:8px;vertical-align:middle}._ownershipBadge_djmny_369{min-height:20px;margin-left:8px;padding:1px 6px;font-size:9px;vertical-align:middle}._confidenceExact_djmny_377{background:#22c55e26;color:var(--success)}._confidencePartial_djmny_382{background:#f59e0b26;color:var(--warning)}._confidenceAfterOnly_djmny_387{background:#22c55e14;color:var(--text-secondary)}._confidenceIntentOnly_djmny_392{background:#ef444426;color:var(--error)}._confidenceUnknown_djmny_397{background:var(--bg-secondary);color:var(--text-muted)}._timelineExpanded_djmny_403{margin-top:8px;padding:8px;background:var(--bg-card);border:1px solid var(--border);border-radius:6px}._empty_djmny_412{text-align:center;padding:20px;color:var(--text-muted);font-family:var(--font-label);font-size:12px}._loading_djmny_421{text-align:center;padding:40px 20px;color:var(--text-secondary);font-family:var(--font-label);font-size:12px}._error_djmny_430{text-align:center;padding:40px 20px;color:var(--error);font-family:var(--font-label);font-size:13px}._page_1tggr_2{display:flex;flex-direction:column;gap:var(--content-gap);max-width:var(--content-max)}._limitNotice_1tggr_9{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:14px 16px;border:1px solid var(--pro-border);border-radius:var(--radius);background:linear-gradient(180deg,rgba(240,189,88,.12),transparent 58%),var(--bg-card)}._limitNoticeContent_1tggr_23{flex:1 1 260px;min-width:0}._limitNoticeTitle_1tggr_28{font-family:var(--font-label);font-size:12px;color:var(--pro-text);margin-bottom:6px}._limitNoticeText_1tggr_35{font-size:12px;color:var(--text-secondary);line-height:1.5}._primaryAction_1tggr_41{display:inline-flex;align-items:center;justify-content:center;min-height:30px;padding:6px 12px;border:1px solid var(--pro-border);border-radius:var(--radius-sm);background:var(--pro-badge);color:var(--pro-text-on-badge);font-family:var(--font-label);font-size:12px;font-weight:600;text-decoration:none;white-space:nowrap;transition:background var(--transition),border-color var(--transition)}._primaryAction_1tggr_41:hover{border-color:var(--pro-badge);background:var(--pro-bg-soft);color:var(--pro-text)}._clearButton_1tggr_67{border:1px solid var(--danger-border);background:var(--danger-bg);color:var(--danger-text);border-radius:var(--radius-sm);padding:6px 12px;font-family:var(--font-label);font-size:12px;font-weight:500;cursor:pointer;transition:background var(--transition),border-color var(--transition)}._clearButton_1tggr_67:hover{background:var(--danger-hover-bg);border-color:var(--danger)}._list_1tggr_88{display:flex;flex-direction:column;gap:10px}._empty_1tggr_95{text-align:center;padding:40px 20px;color:var(--text-muted);font-family:var(--font-label);font-size:13px}._loading_1tggr_104{text-align:center;padding:40px 20px;color:var(--text-secondary);font-family:var(--font-label);font-size:12px}._pagination_1tggr_113{display:flex;align-items:center;justify-content:center;gap:12px;margin-top:4px}._pageInfo_1tggr_121{font-family:var(--font-code);font-size:12px;color:var(--text-secondary)}._btn_1tggr_127{font-family:var(--font-label);font-size:12px;padding:4px 12px;border-radius:4px;border:1px solid var(--border);background:var(--bg-secondary);color:var(--text-primary);cursor:pointer;transition:background var(--transition),border-color var(--transition)}._btn_1tggr_127:hover:not(:disabled){border-color:var(--accent);background:var(--accent-dim)}._btn_1tggr_127:disabled{opacity:.4;cursor:default}