@weppy/roblox-mcp 2.12.3 → 2.13.0

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 (35) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dashboard/dist/assets/AssetsPage-BVUpssWN.css +1 -0
  3. package/dashboard/dist/assets/AssetsPage-CV9wxK10.js +61 -0
  4. package/dashboard/dist/assets/{ChangelogDetailPage-wOW2p_bi.js → ChangelogDetailPage-gpaNW7UJ.js} +1 -1
  5. package/dashboard/dist/assets/{ChangelogPage-Bqesm1RS.js → ChangelogPage-DKIsatBF.js} +1 -1
  6. package/dashboard/dist/assets/{ConfirmModal-Ca_Jx1Np.js → ConfirmModal-reOnA0XQ.js} +1 -1
  7. package/dashboard/dist/assets/{ConnectionPage-B3UgV_LY.js → ConnectionPage-oMLfhLWb.js} +1 -1
  8. package/dashboard/dist/assets/{ControlsPage-DafNZ79n.js → ControlsPage-Y8OiNJre.js} +1 -1
  9. package/dashboard/dist/assets/{CurrentPlaceScope-B3Jcq1x_.js → CurrentPlaceScope-7RO-JoyN.js} +1 -1
  10. package/dashboard/dist/assets/{GameChangeDetail-yngTJA2H.js → GameChangeDetail-D07BEk9j.js} +1 -1
  11. package/dashboard/dist/assets/{InfoLabel-B7ZSx6u2.js → InfoLabel-mGrfFfvs.js} +1 -1
  12. package/dashboard/dist/assets/{OverviewPage-XoLRIqct.js → OverviewPage-BRwPqjqA.js} +1 -1
  13. package/dashboard/dist/assets/{PageHeader-0cqG2PEX.js → PageHeader-CKFvQ2T_.js} +2 -2
  14. package/dashboard/dist/assets/{PlaytestPage-CLr4FbdX.js → PlaytestPage-C00WHKjP.js} +1 -1
  15. package/dashboard/dist/assets/{SettingsPage-D50mSMpC.js → SettingsPage-Camuqp3Q.js} +1 -1
  16. package/dashboard/dist/assets/{StatusBadge-CenFXcbO.js → StatusBadge-BuYWRuwX.js} +1 -1
  17. package/dashboard/dist/assets/{SyncPage-3VfsXSAB.js → SyncPage-pGT5Kghx.js} +1 -1
  18. package/dashboard/dist/assets/{Tabs-C6KgB85r.js → Tabs-Bzvy3UJR.js} +1 -1
  19. package/dashboard/dist/assets/{ToolsPage-Wya7O-1C.js → ToolsPage-B31Hx606.js} +1 -1
  20. package/dashboard/dist/assets/{TooltipText-YDig3E2P.js → TooltipText-Vj0LEsyy.js} +1 -1
  21. package/dashboard/dist/assets/{UiPrimitive-_I4FkOJy.js → UiPrimitive-tKQal2XA.js} +1 -1
  22. package/dashboard/dist/assets/{UiStudioPage-DntH7wMe.js → UiStudioPage-Dtp8HLCl.js} +1 -1
  23. package/dashboard/dist/assets/{WhatsNewPage-hjoGNMqF.js → WhatsNewPage-BGcnIkzC.js} +1 -1
  24. package/dashboard/dist/assets/{copy-LteGG3Jy.js → copy-DHQ0v8nJ.js} +1 -1
  25. package/dashboard/dist/assets/{index-CtLyZZKX.js → index-CahJTtjv.js} +26 -26
  26. package/dashboard/dist/assets/{index-jDDNKuJU.css → index-CkZeRxRT.css} +1 -1
  27. package/dashboard/dist/assets/{sample-requests-_5Ss5L0Z.js → sample-requests-C1hU0rd2.js} +1 -1
  28. package/dashboard/dist/assets/{useLiveUptime-sXHLge7C.js → useLiveUptime-CcseIxAd.js} +1 -1
  29. package/dashboard/dist/assets/{useSettings-7vvqoIou.js → useSettings-CZEc0yGK.js} +1 -1
  30. package/dashboard/dist/index.html +2 -2
  31. package/dist/index.js +100 -100
  32. package/package.json +1 -1
  33. package/roblox-plugin/WeppyRobloxMCP.rbxm +0 -0
  34. package/dashboard/dist/assets/AssetsPage-Czc93xoU.css +0 -1
  35. package/dashboard/dist/assets/AssetsPage-DnMPjYnI.js +0 -46
package/CHANGELOG.md CHANGED
@@ -25,6 +25,37 @@ All notable changes to this project will be documented in this file.
25
25
 
26
26
 
27
27
 
28
+
29
+
30
+
31
+ ## [2.13.0] - 2026-08-13
32
+
33
+ ### Features
34
+
35
+ - **Browse Dashboard Assets by folder or as one searchable collection** — The Assets page now shows the folders created in your asset library, with breadcrumbs for nested navigation. Switch to **All assets** whenever you need one flat list across the selected category and scope, including **All scopes** for the current Place and shared assets together. Existing category filters remain unchanged.
36
+ - **Choose the asset view that fits your workflow** — Keep the familiar Grid or List layout and choose Small, Medium, or Large thumbnails independently. Your organization and view preferences are remembered when you return to the Assets page.
37
+
38
+ ### Bug Fixes
39
+
40
+ - **Keep the Assets toolbar in one place while changing scopes** — Rescan, settings, scope context, and category filters now stay aligned when switching between All scopes, Current Place, and Shared assets, even when one result set needs a scrollbar.
41
+ - **Keep folder navigation usable in narrow Dashboard windows** — Folder navigation now preserves focus and avoids horizontal overflow on smaller screens.
42
+
43
+ ## [2.12.4] - 2026-08-13
44
+
45
+ ### Features
46
+
47
+ - **Keep Open Cloud uploads in the Asset Library** — Uploading an image, audio file, model, or video through Open Cloud now creates or reuses the matching shared or Place asset record automatically. Existing non-Decal Roblox assets can also be linked to a local file without uploading them again, and repeated requests return the same library item.
48
+
49
+ ### Bug Fixes
50
+
51
+ - **Resume Project Sync after its WebSocket reconnects** — If the local MCP server restarts or the command connection drops while Sync is active, the Studio plugin now reconnects, cleans up the previous session, and starts a fresh full sync with the same one-time or continuous intent, direction settings, and preserved-file choices.
52
+ - **Keep one stable folder for each Place during Sync** — Concurrent starts and Place ID promotion now use the same canonical folder. Duplicate folders are archived only after a successful full sync, so interrupted or failed syncs keep recoverable local data.
53
+ - **Keep Project Change Summary writes reliable on Windows** — Concurrent history writes and cleanup now share one file-access queue, preventing transient Windows rename locks from losing a session or stopping later cleanup work.
54
+ - **Reject unsafe Open Cloud library writes before local state changes** — Disabled uploads stop before creating a local library item, links require a verified matching Roblox asset type, and concurrent duplicate links converge on one item instead of producing duplicates.
55
+
56
+ ### Stability
57
+
58
+ - **Safer local MCP restarts during Studio development** — The local stop script now targets only processes listening on the MCP ports, so an attached Roblox Studio client is not mistaken for the server.
28
59
 
29
60
  ## [2.12.3] - 2026-08-12
30
61
 
@@ -0,0 +1 @@
1
+ ._page_1w259_1{display:flex;flex-direction:column;gap:14px;min-height:100%;max-width:var(--content-max)}._experimentalBadge_1w259_9{display:inline-flex;align-items:center;min-height:20px;border:1px solid color-mix(in srgb,var(--accent) 45%,var(--border));border-radius:var(--radius-control);background:color-mix(in srgb,var(--accent) 14%,var(--bg-card));color:var(--accent);padding:0 7px;font-family:var(--font-label);font-size:11px;line-height:1}._toolbarShell_1w259_23{position:relative;z-index:30;border-top:1px solid var(--border);border-bottom:1px solid var(--border);padding:12px 0}._toolbar_1w259_23{display:grid;grid-template-columns:auto minmax(220px,320px) minmax(0,1fr) auto;grid-template-areas:"scope place summary actions" "category category category category";align-items:center;gap:12px}._toolbar_1w259_23>._segmented_1w259_41{grid-area:scope}._placeContextSlot_1w259_45{grid-area:place;min-width:0}._toolbar_1w259_23>._listContextSummary_1w259_50{grid-area:summary}._toolbar_1w259_23>._toolbarActions_1w259_54{grid-area:actions;justify-self:end}._categoryControl_1w259_59{grid-area:category;display:inline-flex;align-items:center;gap:8px;width:100%;min-width:0}._listContextSummary_1w259_50{min-width:0;overflow:hidden;color:var(--text-secondary);font-size:12px;line-height:1.4;text-overflow:ellipsis;white-space:nowrap}._listContextSummary_1w259_50 strong{color:var(--text-primary);font-family:var(--font-label);font-weight:600}._contextDivider_1w259_84{color:var(--text-muted)}._categoryControlLabel_1w259_88{flex:0 0 auto;color:var(--text-secondary);font-size:12px}._categoryRail_1w259_94{display:flex;align-items:center;gap:4px;flex-wrap:wrap;min-width:0}._categoryButton_1w259_102{min-height:32px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-card);color:var(--text-secondary);padding:0 10px;font-family:var(--font-label);font-size:12px;line-height:1;cursor:pointer;transition:border-color var(--transition),color var(--transition),background var(--transition)}._categoryButton_1w259_102:hover{border-color:var(--accent);color:var(--text-primary)}._categoryButton_1w259_102:disabled{cursor:not-allowed;opacity:.48}._categoryButton_1w259_102:disabled:hover{border-color:var(--border);color:var(--text-secondary)}._categoryButtonActive_1w259_131{border-color:color-mix(in srgb,var(--accent) 76%,var(--border));background:var(--accent-dim);color:var(--accent)}._categoryButton_1w259_102:focus-visible{outline:none;box-shadow:var(--focus-ring)}._toolbarActions_1w259_54,._actionRow_1w259_143,._copyRow_1w259_144,._buttonRow_1w259_145{display:flex;align-items:center;gap:8px;flex-wrap:wrap}._segmented_1w259_41{display:inline-flex;min-height:32px;border:1px solid var(--border);border-radius:var(--radius-control);overflow:hidden;background:var(--bg-card)}._segmented_1w259_41 button{border:0;border-right:1px solid var(--border);background:transparent;color:var(--text-secondary);padding:0 10px;font-family:var(--font-label);font-size:12px;cursor:pointer;transition:background var(--transition),color var(--transition)}._segmented_1w259_41 button:hover:not(:disabled){background:var(--accent-dim);color:var(--accent)}._segmented_1w259_41 button:focus-visible{outline:none;box-shadow:inset var(--focus-ring)}._segmented_1w259_41 button:last-child{border-right:0}._segmented_1w259_41 ._segmentedActive_1w259_187{background:var(--accent-dim);color:var(--accent)}._placeSelectorLabel_1w259_192{display:inline-flex;align-items:center;gap:8px;width:100%;min-width:0;color:var(--text-secondary);font-size:12px}._placeSelectorLabel_1w259_192 span{flex:0 0 auto}._placeSelect_1w259_192{width:100%;min-width:0;min-height:32px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-card);color:var(--text-primary);padding:0 8px;font:inherit}._sharedPlaceContext_1w259_218{display:inline-flex;align-items:center;min-height:32px;color:var(--text-secondary);font-size:12px}._filterLabel_1w259_226{display:inline-flex;align-items:center;gap:8px;color:var(--text-secondary);font-size:12px}._filterLabel_1w259_226 select{min-height:32px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-card);color:var(--text-primary);padding:0 8px;font:inherit}._commandButton_1w259_244,._primaryButton_1w259_245,._iconButton_1w259_246{display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-card);color:var(--text-primary);font-family:var(--font-label);font-size:12px;cursor:pointer;transition:border-color var(--transition),color var(--transition),background var(--transition),opacity var(--transition)}._commandButton_1w259_244{min-height:32px;padding:6px 10px;text-decoration:none}._primaryButton_1w259_245{min-height:34px;padding:7px 12px;border-color:var(--accent);color:var(--accent)}._iconButton_1w259_246{width:32px;height:32px;padding:0}._commandButton_1w259_244:hover,._primaryButton_1w259_245:hover,._iconButton_1w259_246:hover{border-color:var(--accent)}._dangerButton_1w259_286{border-color:var(--danger-border);background:var(--danger-bg);color:var(--danger-text)}._dangerButton_1w259_286:hover{border-color:var(--danger);background:var(--danger-hover-bg);color:var(--danger-text)}._commandButton_1w259_244:focus-visible,._primaryButton_1w259_245:focus-visible,._iconButton_1w259_246:focus-visible,._placeSelect_1w259_192:focus-visible,._filterLabel_1w259_226 select:focus-visible{outline:none;box-shadow:var(--focus-ring)}._iconButtonActive_1w259_307{border-color:var(--accent);background:var(--accent-dim);color:var(--accent)}._commandButton_1w259_244:disabled,._primaryButton_1w259_245:disabled,._iconButton_1w259_246:disabled{cursor:not-allowed;opacity:.5}._grid_1w259_320{--asset-card-min: 190px;display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,var(--asset-card-min)),1fr));gap:12px}._grid_1w259_320[data-grid-size=small],._folderGrid_1w259_328[data-grid-size=small]{--asset-card-min: 144px}._grid_1w259_320[data-grid-size=large],._folderGrid_1w259_328[data-grid-size=large]{--asset-card-min: 260px}._explorer_1w259_337{display:flex;min-width:0;flex-direction:column;gap:14px}._explorerToolbar_1w259_344{display:flex;min-width:0;align-items:flex-start;justify-content:space-between;gap:16px;border-bottom:1px solid var(--border);padding-bottom:12px}._explorerLocation_1w259_354{min-width:0}._explorerLocation_1w259_354 h2{margin:5px 0 2px;overflow-wrap:anywhere;color:var(--text-primary);font-size:17px;letter-spacing:0}._explorerLocation_1w259_354 h2:focus-visible{outline:none;box-shadow:var(--focus-ring)}._explorerLocation_1w259_354 p{margin:0;color:var(--text-muted);font-size:12px}._breadcrumb_1w259_377,._breadcrumbSegment_1w259_378{display:inline-flex;min-width:0;align-items:center;gap:2px;color:var(--text-muted);font-size:12px}._breadcrumb_1w259_377{max-width:100%;flex-wrap:wrap}._breadcrumb_1w259_377 button{min-height:44px;border:0;border-radius:var(--radius-control);background:transparent;color:var(--text-secondary);padding:0 7px;font:inherit;cursor:pointer;transition:background var(--transition),color var(--transition)}._breadcrumb_1w259_377 button:hover{background:var(--accent-dim);color:var(--accent)}._breadcrumb_1w259_377 button:focus-visible{outline:none;box-shadow:var(--focus-ring)}._breadcrumb_1w259_377 [aria-current=page]{min-width:0;overflow-wrap:anywhere;color:var(--text-primary);padding:0 5px}._viewOptions_1w259_421{display:flex;flex:0 0 auto;align-items:center;gap:8px;min-height:44px}._organizationModeControl_1w259_429,._viewModeControl_1w259_430,._gridSizeControl_1w259_431{display:inline-flex;overflow:hidden;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-card)}._organizationModeControl_1w259_429 button,._viewModeControl_1w259_430 button,._gridSizeControl_1w259_431 button{display:inline-flex;min-height:32px;align-items:center;justify-content:center;gap:5px;border:0;border-right:1px solid var(--border);background:transparent;color:var(--text-secondary);padding:0 9px;font-family:var(--font-label);font-size:11px;cursor:pointer;transition:background var(--transition),color var(--transition)}._organizationModeControl_1w259_429 button:last-child,._viewModeControl_1w259_430 button:last-child,._gridSizeControl_1w259_431 button:last-child{border-right:0}._organizationModeControl_1w259_429 button[aria-pressed=true],._viewModeControl_1w259_430 button[aria-pressed=true],._gridSizeControl_1w259_431 button[aria-pressed=true]{background:var(--accent-dim);color:var(--accent)}._organizationModeControl_1w259_429 button:focus-visible,._viewModeControl_1w259_430 button:focus-visible,._gridSizeControl_1w259_431 button:focus-visible{z-index:1;outline:none;box-shadow:inset var(--focus-ring)}._gridSizeControl_1w259_431 button:disabled{cursor:not-allowed;opacity:.42}._explorerSection_1w259_484{display:flex;min-width:0;flex-direction:column;gap:8px}._explorerSection_1w259_484 h3{margin:0;color:var(--text-secondary);font-family:var(--font-label);font-size:12px;font-weight:600;letter-spacing:0}._folderGrid_1w259_328{--asset-card-min: 190px;display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,var(--asset-card-min)),1fr));gap:12px}._folderTile_1w259_507{display:grid;min-width:0;min-height:84px;grid-template-columns:46px minmax(0,1fr);grid-template-rows:auto auto;align-items:center;column-gap:10px;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg-card);color:var(--text-primary);padding:11px;text-align:left;cursor:pointer;transition:border-color var(--transition),background var(--transition),transform var(--transition)}._folderTile_1w259_507:hover{border-color:var(--accent);background:color-mix(in srgb,var(--accent) 6%,var(--bg-card));transform:translateY(-1px)}._folderTile_1w259_507:focus-visible,._folderListRow_1w259_532:focus-visible,._assetListRow_1w259_533:focus-visible,._assetCard_1w259_534:focus-visible{outline:none;box-shadow:var(--focus-ring)}._folderIcon_1w259_539{display:grid;grid-row:1 / span 2;place-items:center;width:40px;height:40px;border:1px solid color-mix(in srgb,var(--accent) 30%,var(--border));border-radius:8px;background:var(--accent-dim);color:var(--accent)}._folderName_1w259_551{min-width:0;align-self:end;overflow:hidden;color:var(--text-primary);font-family:var(--font-label);font-size:13px;font-weight:600;overflow-wrap:anywhere;text-overflow:ellipsis}._folderCount_1w259_563{align-self:start;color:var(--text-muted);font-size:12px}._assetList_1w259_533,._folderList_1w259_532{display:flex;min-width:0;flex-direction:column;gap:4px}._assetListHeader_1w259_577,._assetListRow_1w259_533,._folderListRow_1w259_532{display:grid;min-width:0;grid-template-columns:44px minmax(160px,1fr) 110px 120px 110px 110px;align-items:center;gap:10px}._assetListHeader_1w259_577{min-height:28px;border-bottom:1px solid var(--border);color:var(--text-muted);padding:0 10px 5px;font-size:11px}._assetListRow_1w259_533,._folderListRow_1w259_532{min-height:52px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-card);color:var(--text-secondary);padding:7px 10px;text-align:left;cursor:pointer;transition:border-color var(--transition),background var(--transition)}._assetListRow_1w259_533:hover,._folderListRow_1w259_532:hover{border-color:var(--accent);background:color-mix(in srgb,var(--accent) 5%,var(--bg-card))}._listPreviewWrap_1w259_614,._listPreview_1w259_614,._listPreviewFallback_1w259_616{width:36px;height:36px;border-radius:6px}._listPreviewWrap_1w259_614{display:grid;overflow:hidden;place-items:center;background:var(--bg-secondary)}._listPreview_1w259_614{object-fit:contain}._listPreviewFallback_1w259_616{display:grid;place-items:center;color:var(--text-secondary)}._folderListRow_1w259_532 ._folderIcon_1w259_539{grid-row:auto;width:36px;height:36px}._listAssetName_1w259_645,._folderListRow_1w259_532 ._folderName_1w259_551{min-width:0;overflow:hidden;color:var(--text-primary);font-family:var(--font-label);font-size:12px;font-weight:600;text-overflow:ellipsis;white-space:nowrap}._listAssetCategory_1w259_657,._listAssetScope_1w259_658,._listAssetUpdated_1w259_659,._folderType_1w259_660,._folderScope_1w259_661,._folderStatus_1w259_662,._folderUpdated_1w259_663{min-width:0;overflow:hidden;color:var(--text-muted);font-size:12px;text-overflow:ellipsis;white-space:nowrap}._assetCard_1w259_534{display:flex;flex-direction:column;gap:8px;min-width:0;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg-card);padding:8px;color:var(--text-primary);text-align:left;cursor:pointer;transition:border-color var(--transition),background var(--transition),transform var(--transition)}._assetCard_1w259_534:hover{border-color:var(--accent);transform:translateY(-1px)}._assetCardSelected_1w259_692{border-color:var(--accent);box-shadow:0 0 0 1px color-mix(in srgb,var(--accent) 40%,transparent)}._thumbnailWrap_1w259_697{display:grid;place-items:center;width:100%;aspect-ratio:1;overflow:hidden;border-radius:6px;background:var(--bg-secondary)}._thumbnail_1w259_697{width:100%;height:100%;object-fit:contain}._thumbnailFallback_1w259_713{display:grid;place-items:center;width:48px;height:48px;border:1px solid var(--border);border-radius:8px;color:var(--text-secondary);background:var(--bg-card)}._assetCardBody_1w259_724{display:flex;flex-direction:column;gap:6px;min-width:0}._assetName_1w259_731{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--font-label);font-size:13px}._assetMeta_1w259_739{display:flex;align-items:center;justify-content:space-between;gap:8px}._statusChip_1w259_746,._categoryPill_1w259_747{min-height:20px;padding:2px 7px}._assetId_1w259_752,._scopeText_1w259_753,._muted_1w259_754{color:var(--text-muted);font-size:12px}._emptyState_1w259_759,._notice_1w259_760,._errorState_1w259_761,._messageState_1w259_762{border:1px solid var(--border);border-radius:var(--radius);background:var(--bg-card);padding:14px;color:var(--text-secondary)}._emptyState_1w259_759{min-height:160px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;text-align:center}._emptyState_1w259_759 p{margin:0;color:var(--text-primary);font-family:var(--font-label)}._notice_1w259_760{color:var(--warning-text);border-color:var(--warning-border);background:var(--warning-bg)}._proNotice_1w259_792{color:var(--pro-text);border-color:var(--pro-border);background:var(--pro-bg-soft)}._errorState_1w259_761{display:grid;gap:4px;color:var(--error);border-color:var(--error)}._messageState_1w259_762{color:var(--success);border-color:var(--success)}._rbxmGuide_1w259_810{display:flex;flex-direction:column;gap:6px;border:1px solid color-mix(in srgb,var(--accent) 35%,var(--border));border-radius:var(--radius);background:color-mix(in srgb,var(--accent) 8%,var(--bg-card));padding:14px}._rbxmGuide_1w259_810 h2{margin:0;color:var(--text-primary);font-family:var(--font-label);font-size:14px;letter-spacing:0}._rbxmGuide_1w259_810 p{margin:0;max-width:760px;color:var(--text-secondary);font-size:12px;line-height:1.5}._drawer_1w259_836{position:fixed;top:0;right:0;z-index:40;width:min(460px,100vw);height:100vh;overflow-y:auto;border-left:1px solid var(--border);background:var(--bg-primary);padding:18px;box-shadow:-12px 0 24px #00000047}._settingsInlinePanel_1w259_850{position:absolute;top:calc(100% + 8px);right:0;z-index:35;display:flex;flex-direction:column;gap:12px;width:min(560px,100%);max-height:min(680px,calc(100vh - var(--header-height) - 112px));overflow-y:auto;border:1px solid var(--border);border-radius:8px;background:var(--bg-card);padding:14px;box-shadow:0 18px 44px #00000057;animation:_settingsPopoverIn_1w259_1 .12s ease-out;transform-origin:top right}._settingsDrawer_1w259_870{width:min(560px,100%)}@keyframes _settingsPopoverIn_1w259_1{0%{opacity:0;transform:translateY(-4px) scale(.99)}to{opacity:1;transform:translateY(0) scale(1)}}._detailPopupLayer_1w259_886{position:fixed;top:calc(var(--header-height) + 16px);right:24px;bottom:24px;left:calc(var(--sidebar-width) + 24px);z-index:900;display:flex;align-items:stretch;justify-content:center;padding:clamp(12px,2vw,24px);background:#03071294;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);box-sizing:border-box}._detailDialog_1w259_902{width:min(1120px,100%);min-height:0;display:flex;flex-direction:column;overflow:hidden;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg-card);color:var(--text-primary);box-shadow:0 24px 60px #0000006b}._detailDialog_1w259_902:focus{outline:none}._detailDialogHeader_1w259_919{flex:0 0 auto;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:16px;padding:14px 16px;border-bottom:1px solid var(--border);background:color-mix(in srgb,var(--bg-card) 92%,var(--bg-secondary))}._detailTitleBlock_1w259_930{min-width:0;display:flex;flex-direction:column;gap:3px}._detailTitleBlock_1w259_930 h2{margin:0;font-size:18px;letter-spacing:0}._detailTitleBlock_1w259_930 span:last-child{overflow:hidden;color:var(--text-muted);font-family:var(--font-code);font-size:12px;text-overflow:ellipsis;white-space:nowrap}._detailEyebrow_1w259_952{color:var(--text-muted);font-family:var(--font-label);font-size:11px;font-weight:600;letter-spacing:0;text-transform:uppercase}._detailHeaderActions_1w259_961{display:flex;align-items:center;justify-content:flex-end;gap:8px;min-width:0}._detailDialogBody_1w259_969{flex:1 1 auto;min-height:0;display:grid;grid-template-columns:minmax(260px,.9fr) minmax(360px,1.1fr);gap:0;overflow:hidden}._detailPreviewPane_1w259_978{min-width:0;min-height:0;display:flex;align-items:center;justify-content:center;padding:24px;border-right:1px solid var(--border);background:var(--bg-secondary)}._detailPreview_1w259_978,._detailPreviewFallback_1w259_990{width:100%;max-width:520px;aspect-ratio:1;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg-card)}._detailPreview_1w259_978{display:block;object-fit:contain}._detailPreviewFallback_1w259_990{display:grid;place-items:center;gap:8px;color:var(--text-secondary)}._detailPreviewFallback_1w259_990 code{color:var(--text-muted);font-family:var(--font-code);font-size:12px}._detailPreviewFallback_1w259_990 small{max-width:88%;color:var(--text-muted);font-size:12px;line-height:1.35;overflow-wrap:anywhere;text-align:center}._detailContentPane_1w259_1026{min-width:0;overflow-y:auto;padding:18px 22px 24px}._detailContentPane_1w259_1026 ._formStack_1w259_1032{margin-top:0}._drawerHeader_1w259_1036{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px}._settingsInlinePanel_1w259_850 ._drawerHeader_1w259_1036{margin-bottom:0}._drawerHeader_1w259_1036 h2{margin:0;font-size:18px;letter-spacing:0}._drawerHeader_1w259_1036 span{color:var(--text-muted);font-size:12px}._preview_1w259_1059,._previewFallback_1w259_1060{width:100%;aspect-ratio:1;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg-secondary);margin-bottom:14px}._preview_1w259_1059{object-fit:contain}._previewFallback_1w259_1060{display:grid;place-items:center;gap:8px;color:var(--text-secondary)}._previewFallback_1w259_1060 code{color:var(--text-muted);font-family:var(--font-code);font-size:12px}._formStack_1w259_1032,._detailSection_1w259_1087,._noticeList_1w259_1088,._settingsPanel_1w259_1089{display:flex;flex-direction:column;gap:10px;margin-top:14px}._noticeList_1w259_1088{color:var(--text-muted);font-size:12px;line-height:1.45}._noticeList_1w259_1088 p{margin:0}._setupNotice_1w259_1106{display:grid;gap:8px;margin-top:14px;border:1px solid var(--warning-border);border-radius:6px;background:var(--warning-bg);color:var(--warning-text);padding:12px;font-size:12px}._setupNotice_1w259_1106 strong{color:var(--text-primary);font-size:13px}._setupNotice_1w259_1106 p{margin:0}._setupNotice_1w259_1106 ._commandButton_1w259_244{justify-self:start}._field_1w259_1131{display:flex;flex-direction:column;gap:6px;font-size:12px;color:var(--text-secondary)}._fieldLabelRow_1w259_1139{display:flex;align-items:center;gap:4px;min-height:24px}._fieldLabelRow_1w259_1139 label,._fieldLabelRow_1w259_1139 span{min-width:0}._field_1w259_1131 input,._field_1w259_1131 textarea,._field_1w259_1131 select{width:100%;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-secondary);color:var(--text-primary);padding:8px;font:inherit}._fieldHelp_1w259_1163{color:var(--text-muted);line-height:1.35}._twoColumn_1w259_1168{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px}._detailSection_1w259_1087{padding-top:12px;border-top:1px solid var(--border)}._technicalDetails_1w259_1179{margin-top:14px;padding-top:12px;border-top:1px solid var(--border)}._technicalDetails_1w259_1179 summary{cursor:pointer;color:var(--text-secondary);font-size:13px;font-weight:600}._technicalDetails_1w259_1179 summary:hover{color:var(--text-primary)}._technicalDetails_1w259_1179 ._detailGrid_1w259_1196,._technicalDetails_1w259_1179 ._metadataList_1w259_1197{margin-top:10px}._detailSection_1w259_1087 h3{margin:0;font-size:13px;letter-spacing:0}._detailGrid_1w259_1196,._compactMeta_1w259_1208{display:grid;grid-template-columns:90px minmax(0,1fr);gap:6px 10px;margin:0;font-size:12px}._compactMeta_1w259_1208{border:1px solid var(--border);border-radius:var(--radius);padding:10px;background:var(--bg-card)}._detailGrid_1w259_1196 dt,._compactMeta_1w259_1208 dt{color:var(--text-muted)}._detailGrid_1w259_1196 dd,._compactMeta_1w259_1208 dd{margin:0;min-width:0;overflow-wrap:anywhere}._copyableValue_1w259_1235{display:inline-flex;align-items:center;gap:6px}._copyableValue_1w259_1235 span{min-width:0;overflow-wrap:anywhere}._inlineCopyButton_1w259_1246{display:inline-flex;flex:0 0 auto;align-items:center;justify-content:center;width:24px;height:24px;border:1px solid var(--border);border-radius:var(--radius-control);background:transparent;color:var(--text-muted);cursor:pointer;transition:border-color var(--transition),color var(--transition),background var(--transition)}._inlineCopyButton_1w259_1246:hover{border-color:var(--accent);color:var(--accent);background:var(--accent-dim)}._hashText_1w259_1267{font-family:var(--font-code)}._usageList_1w259_1271{display:flex;flex-direction:column;gap:8px}._usageItem_1w259_1277,._metadataItem_1w259_1278{display:grid;gap:4px;border:1px solid var(--border);border-radius:6px;padding:8px;background:var(--bg-card);font-size:12px}._metadataList_1w259_1197{display:flex;flex-direction:column;gap:8px}._metadataList_1w259_1197 strong,._usageItem_1w259_1277 strong{color:var(--text-primary);overflow-wrap:anywhere}._metadataItem_1w259_1278 span{color:var(--text-secondary);overflow-wrap:anywhere}._metadataItem_1w259_1278 code,._usageItem_1w259_1277 code{color:var(--accent);overflow-wrap:anywhere}._settingsPanel_1w259_1089{border:1px solid var(--border);border-radius:8px;padding:12px;background:var(--bg-card)}._settingsInlinePanel_1w259_850 ._settingsPanel_1w259_1089{border:0;border-radius:0;background:transparent;padding:0;margin-top:0}._settingsSubsection_1w259_1326{display:grid;gap:8px}._settingsSectionHeader_1w259_1331{display:flex;align-items:center;justify-content:space-between;gap:10px}._settingsSectionHeader_1w259_1331 h3{margin:0;color:var(--text-primary);font-size:13px}._settingsDefinitionList_1w259_1344{display:grid;gap:6px;margin:0}._settingsDefinitionList_1w259_1344 div{display:grid;grid-template-columns:minmax(96px,max-content) minmax(0,1fr);gap:10px}._settingsDefinitionList_1w259_1344 dt{color:var(--text-muted)}._settingsDefinitionList_1w259_1344 dd{margin:0;color:var(--text-primary);overflow-wrap:anywhere}._toggleRow_1w259_1366{display:flex;align-items:center;justify-content:space-between;gap:16px;font-size:13px}._toggleRow_1w259_1366 span{display:grid;gap:3px}._toggleRow_1w259_1366 small,._inlineHelp_1w259_1380{color:var(--text-muted);font-size:12px}._toggleRow_1w259_1366 input{width:18px;height:18px}._inlineHelp_1w259_1380{margin:0}._inlineHelp_1w259_1380 a{color:var(--accent)}@media(max-width:1120px){._detailPopupLayer_1w259_886{right:16px;bottom:16px;left:calc(var(--sidebar-width) + 16px);padding:12px}._detailDialogBody_1w259_969{grid-template-columns:minmax(240px,.8fr) minmax(320px,1.2fr)}}@media(max-width:820px){._detailPopupLayer_1w259_886{top:calc(var(--header-height) + 10px);right:10px;bottom:10px;left:calc(var(--sidebar-collapsed) + 10px);padding:8px}._detailDialogHeader_1w259_919{grid-template-columns:minmax(0,1fr);align-items:stretch;gap:10px;padding:12px}._detailHeaderActions_1w259_961{justify-content:flex-start;overflow-x:auto;padding-bottom:2px}._detailDialogBody_1w259_969{grid-template-columns:minmax(0,1fr);overflow-y:auto}._detailPreviewPane_1w259_978{min-height:auto;padding:14px;border-right:0;border-bottom:1px solid var(--border)}._detailPreview_1w259_978,._detailPreviewFallback_1w259_990{max-width:340px}._detailContentPane_1w259_1026{overflow:visible;padding:14px}}@media(max-width:720px){._headerRow_1w259_1457{align-items:stretch;flex-direction:column}._toolbar_1w259_23{grid-template-columns:minmax(0,1fr);grid-template-areas:"scope" "place" "summary" "actions" "category";align-items:stretch}._toolbar_1w259_23>._segmented_1w259_41,._placeContextSlot_1w259_45,._toolbar_1w259_23>._toolbarActions_1w259_54,._categoryControl_1w259_59{width:100%}._toolbar_1w259_23>._toolbarActions_1w259_54{justify-self:stretch}._headerMeta_1w259_1484{justify-items:start}._toolbarActions_1w259_54{justify-content:flex-start}._explorerToolbar_1w259_344{align-items:stretch;flex-direction:column}._viewOptions_1w259_421{width:100%;align-items:stretch;flex-direction:column}._organizationModeControl_1w259_429,._viewModeControl_1w259_430,._gridSizeControl_1w259_431{display:grid;width:100%;grid-template-columns:repeat(2,minmax(0,1fr))}._gridSizeControl_1w259_431{grid-template-columns:repeat(3,minmax(0,1fr))}._organizationModeControl_1w259_429 button,._viewModeControl_1w259_430 button,._gridSizeControl_1w259_431 button{min-width:0}._assetListHeader_1w259_577{display:none}._assetListRow_1w259_533,._folderListRow_1w259_532{grid-template-columns:40px minmax(0,1fr) auto;grid-template-areas:"preview name status" "preview type type" "preview scope updated";gap:3px 8px}._listPreviewWrap_1w259_614,._folderListRow_1w259_532 ._folderIcon_1w259_539{grid-area:preview}._listAssetName_1w259_645,._folderListRow_1w259_532 ._folderName_1w259_551{grid-area:name}._listAssetCategory_1w259_657,._folderType_1w259_660{grid-area:type}._listAssetScope_1w259_658,._folderScope_1w259_661{grid-area:scope}._assetListRow_1w259_533 ._statusChip_1w259_746,._folderStatus_1w259_662{grid-area:status;justify-self:end}._listAssetUpdated_1w259_659,._folderUpdated_1w259_663{grid-area:updated;justify-self:end}._placeSelectorLabel_1w259_192,._placeSelect_1w259_192{width:100%}._settingsInlinePanel_1w259_850{right:auto;left:0;width:100%;transform-origin:top left}._twoColumn_1w259_1168{grid-template-columns:1fr}}
@@ -0,0 +1,61 @@
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-CahJTtjv.js";import{C as xs}from"./ConfirmModal-reOnA0XQ.js";import{D as Xe,a as Bs,P as Us}from"./PageHeader-CKFvQ2T_.js";import{T as Z}from"./TooltipText-Vj0LEsyy.js";import{B as De,C as Ts}from"./UiPrimitive-tKQal2XA.js";import{C as gs}from"./copy-DHQ0v8nJ.js";import"./ConfirmModal.module-DJksQHBd.js";/**
2
+ * @license lucide-react v1.8.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const Es=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Ds=oe("arrow-left",Es);/**
7
+ * @license lucide-react v1.8.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const Fs=[["path",{d:"M2 10v3",key:"1fnikh"}],["path",{d:"M6 6v11",key:"11sgs0"}],["path",{d:"M10 3v18",key:"yhl04a"}],["path",{d:"M14 8v7",key:"3a1oy3"}],["path",{d:"M18 5v13",key:"123xd1"}],["path",{d:"M22 10v3",key:"154ddg"}]],Ms=oe("audio-lines",Fs);/**
12
+ * @license lucide-react v1.8.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const Os=[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}]],zs=oe("badge",Os);/**
17
+ * @license lucide-react v1.8.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const Hs=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],Ks=oe("box",Hs);/**
22
+ * @license lucide-react v1.8.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */const Gs=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Fe=oe("chevron-right",Gs);/**
27
+ * @license lucide-react v1.8.0 - ISC
28
+ *
29
+ * This source code is licensed under the ISC license.
30
+ * See the LICENSE file in the root directory of this source tree.
31
+ */const Ws=[["path",{d:"m12.296 3.464 3.02 3.956",key:"qash78"}],["path",{d:"M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3z",key:"1h7j8b"}],["path",{d:"M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"4lm6w1"}],["path",{d:"m6.18 5.276 3.1 3.899",key:"zjj9t3"}]],Vs=oe("clapperboard",Ws);/**
32
+ * @license lucide-react v1.8.0 - ISC
33
+ *
34
+ * This source code is licensed under the ISC license.
35
+ * See the LICENSE file in the root directory of this source tree.
36
+ */const Ys=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M3 7.5h4",key:"zfgn84"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 16.5h4",key:"1230mu"}],["path",{d:"M17 3v18",key:"in4fa5"}],["path",{d:"M17 7.5h4",key:"myr1c1"}],["path",{d:"M17 16.5h4",key:"go4c1d"}]],Xs=oe("film",Ys);/**
37
+ * @license lucide-react v1.8.0 - ISC
38
+ *
39
+ * This source code is licensed under the ISC license.
40
+ * See the LICENSE file in the root directory of this source tree.
41
+ */const qs=[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 12h18",key:"1i2n21"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]],Js=oe("grid-2x2",qs);/**
42
+ * @license lucide-react v1.8.0 - ISC
43
+ *
44
+ * This source code is licensed under the ISC license.
45
+ * See the LICENSE file in the root directory of this source tree.
46
+ */const Zs=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],Qs=oe("list",Zs);/**
47
+ * @license lucide-react v1.8.0 - ISC
48
+ *
49
+ * This source code is licensed under the ISC license.
50
+ * See the LICENSE file in the root directory of this source tree.
51
+ */const et=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],st=oe("search",et);/**
52
+ * @license lucide-react v1.8.0 - ISC
53
+ *
54
+ * This source code is licensed under the ISC license.
55
+ * See the LICENSE file in the root directory of this source tree.
56
+ */const tt=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],at=oe("trash-2",tt);/**
57
+ * @license lucide-react v1.8.0 - ISC
58
+ *
59
+ * This source code is licensed under the ISC license.
60
+ * See the LICENSE file in the root directory of this source tree.
61
+ */const 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};
@@ -1 +1 @@
1
- import{r as c,a as O,u as P,b as U,c as H,d as q,j as e}from"./index-CtLyZZKX.js";import{I as W}from"./InfoLabel-B7ZSx6u2.js";import{G as Y}from"./GameChangeDetail-yngTJA2H.js";import{T as u}from"./TooltipText-YDig3E2P.js";import{B as z}from"./UiPrimitive-_I4FkOJy.js";function J(t){const s={scriptsModified:0,scriptsCreated:0,instancesCreated:0,instancesDeleted:0,instancesMoved:0,propertiesChanged:0,lightingChanged:!1,terrainChanged:!1,assetsInserted:0};for(const r of t)switch(r.category){case"script":r.changeType==="create"?s.scriptsCreated++:s.scriptsModified++;break;case"instance":r.changeType==="create"?s.instancesCreated++:r.changeType==="delete"?s.instancesDeleted++:r.changeType==="move"&&s.instancesMoved++;break;case"property":s.propertiesChanged++;break;case"lighting":s.lightingChanged=!0;break;case"terrain":s.terrainChanged=!0;break;case"asset":s.assetsInserted++;break}return s}function Q(t){if(typeof t=="number")return{placeId:String(t)}}function X(t,s){const[r,p]=c.useState(""),[L,a]=c.useState(""),[h,w]=c.useState(),[y,B]=c.useState("completed"),[$,M]=c.useState([]),[v,R]=c.useState([]),[A,G]=c.useState([]),[K,V]=c.useState(),[S,C]=c.useState(),[b,N]=c.useState(),[T,k]=c.useState({scriptsModified:0,scriptsCreated:0,instancesCreated:0,instancesDeleted:0,instancesMoved:0,propertiesChanged:0,lightingChanged:!1,terrainChanged:!1,assetsInserted:0}),[I,x]=c.useState(!0),[E,f]=c.useState(null),g=c.useCallback(async()=>{if(t){x(!0),f(null);try{const m=Q(s),[d,_]=await Promise.all([m?O.get(`/api/dashboard/changelog/${t}`,m):O.get(`/api/dashboard/changelog/${t}`),m?O.get(`/api/dashboard/changelog/${t}/changes`,m):O.get(`/api/dashboard/changelog/${t}/changes`)]);p(d.entryId),a(d.startTime),w(d.endTime),B(d.status),M(d.entries),R(d.failures),V(d.contextSummary),C(d.replayMetadata),N(d.verificationSummary),G(_.changes),k(J(_.changes))}catch(m){f(m instanceof Error?m.message:"Failed to load changelog detail")}finally{x(!1)}}},[t,s]);return c.useEffect(()=>{g()},[g]),{entryId:r,startTime:L,endTime:h,status:y,entries:$,failures:v,changes:A,changeSummary:T,contextSummary:K,replayMetadata:S,verificationSummary:b,loading:I,error:E,refresh:g}}const Z={script:"📝",instance:"🧱",property:"🎨",lighting:"🌅",terrain:"⛰️",asset:"📦"};function ee(t){return Z[t]??"❓"}const te="_page_11hjw_2",ne="_header_11hjw_10",ae="_backLink_11hjw_16",se="_headerTitle_11hjw_29",ie="_headerTime_11hjw_37",ce="_statusActive_11hjw_44",re="_statusCompleted_11hjw_49",oe="_section_11hjw_54",le="_sectionTitle_11hjw_61",de="_summaryGrid_11hjw_74",me="_summaryCard_11hjw_80",he="_summaryCardActive_11hjw_94",ge="_summaryIcon_11hjw_99",ue="_summaryCount_11hjw_105",pe="_summaryLabel_11hjw_112",ye="_contextGrid_11hjw_121",xe="_contextRow_11hjw_127",fe="_contextKey_11hjw_133",_e="_contextValue_11hjw_141",je="_timelineFilter_11hjw_149",we="_filterLabel_11hjw_157",ve="_filterSelect_11hjw_163",Se="_ownershipToggle_11hjw_173",Ce="_timeline_11hjw_149",be="_timelineEntry_11hjw_201",Ne="_timelineTime_11hjw_218",Te="_timelineIcon_11hjw_226",ke="_timelineBody_11hjw_231",Ie="_timelineSummary_11hjw_236",Ee="_timelineTarget_11hjw_243",Oe="_timelineConfidence_11hjw_250",Le="_ownershipBadge_11hjw_259",Be="_confidenceExact_11hjw_267",$e="_confidencePartial_11hjw_272",Me="_confidenceAfterOnly_11hjw_277",Re="_confidenceIntentOnly_11hjw_282",Ae="_confidenceUnknown_11hjw_287",Ge="_timelineExpanded_11hjw_293",Ke="_empty_11hjw_365",Ve="_loading_11hjw_374",Fe="_error_11hjw_383",n={page:te,header:ne,backLink:ae,headerTitle:se,headerTime:ie,statusActive:ce,statusCompleted:re,section:oe,sectionTitle:le,summaryGrid:de,summaryCard:me,summaryCardActive:he,summaryIcon:ge,summaryCount:ue,summaryLabel:pe,contextGrid:ye,contextRow:xe,contextKey:fe,contextValue:_e,timelineFilter:je,filterLabel:we,filterSelect:ve,ownershipToggle:Se,timeline:Ce,timelineEntry:be,timelineTime:Ne,timelineIcon:Te,timelineBody:ke,timelineSummary:Ie,timelineTarget:Ee,timelineConfidence:Oe,ownershipBadge:Le,confidenceExact:Be,confidencePartial:$e,confidenceAfterOnly:Me,confidenceIntentOnly:Re,confidenceUnknown:Ae,timelineExpanded:Ge,empty:Ke,loading:Ve,error:Fe},D=[{key:"script",icon:"📝",labelKey:"changelog.category.script"},{key:"instance",icon:"🧱",labelKey:"changelog.category.instance"},{key:"property",icon:"🎨",labelKey:"changelog.category.property"},{key:"lighting",icon:"🌅",labelKey:"changelog.category.lighting"},{key:"terrain",icon:"⛰️",labelKey:"changelog.category.terrain"},{key:"asset",icon:"📦",labelKey:"changelog.category.asset"}];function F(t){if(!t)return"--:--";const s=new Date(t);return`${String(s.getHours()).padStart(2,"0")}:${String(s.getMinutes()).padStart(2,"0")}`}function De(t){if(!t)return"--:--:--";const s=new Date(t);return`${String(s.getHours()).padStart(2,"0")}:${String(s.getMinutes()).padStart(2,"0")}:${String(s.getSeconds()).padStart(2,"0")}`}function Pe(t,s){if(!t||!s)return"";const r=new Date(s).getTime()-new Date(t).getTime();return r<0?"":`${Math.round(r/6e4)}min`}function Ue(t){switch(t){case"exact":return n.confidenceExact;case"partial":return n.confidencePartial;case"after-only":return n.confidenceAfterOnly;case"intent-only":return n.confidenceIntentOnly;default:return n.confidenceUnknown}}function He(t,s){switch(s){case"exact":return t("changelog.detail.confidence.exact","Exact");case"partial":return t("changelog.detail.confidence.partial","Partial");case"after-only":return t("changelog.detail.confidence.afterOnly","After only");case"intent-only":return t("changelog.detail.confidence.intentOnly","Intent only");default:return t("changelog.detail.confidence.unknown","Unknown")}}function qe(t,s){switch(s){case"exact":return t("changelog.detail.confidence.exact.tooltip","Both the before and after state were confirmed for this change.");case"partial":return t("changelog.detail.confidence.partial.tooltip","Only part of the before and after state could be confirmed for this change.");case"after-only":return t("changelog.detail.confidence.afterOnly.tooltip","Only the resulting state after the change could be confirmed.");case"intent-only":return t("changelog.detail.confidence.intentOnly.tooltip","Only the requested action was recorded, not the resulting state.");default:return t("changelog.detail.confidence.unknown.tooltip","This change could not be confidently classified from the available data.")}}function We(t,s){switch(s){case"user_source":return t("changelog.ownership.userSource","User source");case"canonical_mirror":return t("changelog.ownership.canonicalMirror","Mirror metadata");case"generated":return t("changelog.ownership.generated","Generated");default:return null}}function Ye(t){const s=new URLSearchParams(t).get("placeId");if(!s)return null;const r=Number.parseInt(s,10);return Number.isInteger(r)&&r>=0?r:null}function et(){var S,C,b,N,T,k,I,x,E,f,g,m,d,_;const{t}=P(),{id:s}=U(),r=H(),p=q(),L=c.useMemo(()=>Ye(p.search),[p.search]),a=X(s,L),[h,w]=c.useState("all"),[y,B]=c.useState(!0),[$,M]=c.useState(null),v=c.useMemo(()=>{const i=y?a.changes:a.changes.filter(o=>o.artifactOwnership!=="generated");return[...h==="all"?i:i.filter(o=>o.category===h)].reverse()},[a.changes,h,y]),R=a.changes.some(i=>i.artifactOwnership==="generated");if(a.loading)return e.jsx("div",{className:n.loading,children:t("common.loading","Loading...")});if(a.error)return e.jsxs("div",{className:n.error,children:[a.error,e.jsx("br",{}),e.jsxs("span",{className:n.backLink,onClick:()=>r("/changelog"),children:["←"," ",t("changelog.detail.backToList","Back to list")]})]});const A=Pe(a.startTime,a.endTime),G=a.endTime?`${F(a.startTime)} → ${F(a.endTime)} (${A})`:`${F(a.startTime)} → ${t("changelog.card.inProgress","in progress")}`,K=!!((S=a.contextSummary)!=null&&S.intent||(C=a.contextSummary)!=null&&C.testScenario||(b=a.contextSummary)!=null&&b.expectedBehavior||(N=a.contextSummary)!=null&&N.observedBehavior),V=!!((T=a.verificationSummary)!=null&&T.label||(k=a.verificationSummary)!=null&&k.status||(I=a.verificationSummary)!=null&&I.testTimestamp);return e.jsxs("div",{className:n.page,children:[e.jsxs("div",{className:n.header,children:[e.jsxs("span",{className:n.backLink,onClick:()=>r("/changelog"),children:["←"," ",t("sidebar.changelog","Changelog")]}),e.jsx("span",{className:n.headerTitle,children:"|"}),e.jsx("span",{className:n.headerTime,children:G}),e.jsx(u,{text:a.status==="active"?t("changelog.card.active.tooltip","This session is still receiving new game changes."):t("changelog.card.completed.tooltip","This session has ended and no more changes are expected."),children:e.jsx("span",{className:a.status==="active"?n.statusActive:n.statusCompleted,children:a.status==="active"?t("changelog.card.active","Active"):t("changelog.card.completed","Completed")})})]}),e.jsxs("div",{className:n.section,children:[e.jsx("div",{className:n.sectionTitle,children:e.jsx(u,{text:t("changelog.detail.changeSummary.tooltip","Counts of extracted game changes grouped by category for this session."),children:e.jsx("span",{children:t("changelog.detail.changeSummary","Change Summary")})})}),e.jsx("div",{className:n.summaryGrid,children:D.map(i=>{const l=a.changeSummary;let o;switch(i.key){case"script":o=l.scriptsModified+l.scriptsCreated;break;case"instance":o=l.instancesCreated+l.instancesDeleted+l.instancesMoved;break;case"property":o=l.propertiesChanged;break;case"lighting":o=l.lightingChanged?1:0;break;case"terrain":o=l.terrainChanged?1:0;break;case"asset":o=l.assetsInserted;break;default:o=0}const j=h===i.key;return e.jsxs("div",{className:`${n.summaryCard} ${j?n.summaryCardActive:""}`,onClick:()=>w(j?"all":i.key),children:[e.jsx("span",{className:n.summaryIcon,children:i.icon}),e.jsx("div",{className:n.summaryCount,children:o}),e.jsx("div",{className:n.summaryLabel,children:t(i.labelKey,i.key)})]},i.key)})})]}),K&&e.jsxs("div",{className:n.section,children:[e.jsx("div",{className:n.sectionTitle,children:e.jsx(u,{text:t("changelog.detail.context.tooltip","Structured execution context captured for this changelog session."),children:e.jsx("span",{children:t("changelog.detail.context.title","Context Summary")})})}),e.jsxs("div",{className:n.contextGrid,children:[((x=a.contextSummary)==null?void 0:x.intent)&&e.jsxs("div",{className:n.contextRow,children:[e.jsx("span",{className:n.contextKey,children:t("changelog.card.sessionIntent","Session intent")}),e.jsx("span",{className:n.contextValue,children:a.contextSummary.intent})]}),((E=a.contextSummary)==null?void 0:E.testScenario)&&e.jsxs("div",{className:n.contextRow,children:[e.jsx("span",{className:n.contextKey,children:t("playtest.context.why","Why this test ran")}),e.jsx("span",{className:n.contextValue,children:a.contextSummary.testScenario})]}),((f=a.contextSummary)==null?void 0:f.expectedBehavior)&&e.jsxs("div",{className:n.contextRow,children:[e.jsx("span",{className:n.contextKey,children:t("playtest.context.expected","Expected")}),e.jsx("span",{className:n.contextValue,children:a.contextSummary.expectedBehavior})]}),((g=a.contextSummary)==null?void 0:g.observedBehavior)&&e.jsxs("div",{className:n.contextRow,children:[e.jsx("span",{className:n.contextKey,children:t("playtest.context.observed","Observed")}),e.jsx("span",{className:n.contextValue,children:a.contextSummary.observedBehavior})]})]})]}),V&&e.jsxs("div",{className:n.section,children:[e.jsx("div",{className:n.sectionTitle,children:e.jsx(u,{text:t("changelog.detail.verification.tooltip","Verification signals linked to this changelog session."),children:e.jsx("span",{children:t("changelog.detail.verification.title","Verification")})})}),e.jsxs("div",{className:n.contextGrid,children:[((m=a.verificationSummary)==null?void 0:m.label)&&e.jsxs("div",{className:n.contextRow,children:[e.jsx("span",{className:n.contextKey,children:t("changelog.detail.verification.label","Result")}),e.jsx("span",{className:n.contextValue,children:a.verificationSummary.label})]}),((d=a.verificationSummary)==null?void 0:d.status)&&e.jsxs("div",{className:n.contextRow,children:[e.jsx("span",{className:n.contextKey,children:t("changelog.detail.verification.status","Status")}),e.jsx("span",{className:n.contextValue,children:a.verificationSummary.status})]}),((_=a.verificationSummary)==null?void 0:_.testTimestamp)&&e.jsxs("div",{className:n.contextRow,children:[e.jsx("span",{className:n.contextKey,children:t("changelog.detail.verification.timestamp","Recorded at")}),e.jsx("span",{className:n.contextValue,children:a.verificationSummary.testTimestamp})]})]})]}),e.jsxs("div",{className:n.section,children:[e.jsx("div",{className:n.sectionTitle,children:e.jsx(u,{text:t("changelog.detail.changeTimeline.tooltip","Chronological list of extracted game changes for this session."),children:e.jsx("span",{children:t("changelog.detail.changeTimeline","Change Timeline")})})}),e.jsxs("div",{className:n.timelineFilter,children:[e.jsx("span",{className:n.filterLabel,children:e.jsx(W,{label:`${t("changelog.detail.filterCategory","Category")}:`,tooltip:t("changelog.detail.filterCategory.tooltip","Filter the timeline to a single change category.")})}),e.jsxs("select",{className:n.filterSelect,value:h,onChange:i=>w(i.target.value),children:[e.jsx("option",{value:"all",children:t("tools.filter.all","All")}),D.map(i=>e.jsxs("option",{value:i.key,children:[i.icon," ",t(i.labelKey,i.key)]},i.key))]}),R&&e.jsxs("label",{className:n.ownershipToggle,children:[e.jsx("input",{type:"checkbox",checked:y,onChange:i=>B(i.target.checked)}),t("changelog.ownership.showGenerated","Show generated metadata")]})]}),v.length===0?e.jsx("div",{className:n.empty,children:t("changelog.detail.noChanges","No changes in this category")}):e.jsx("div",{className:n.timeline,children:v.map((i,l)=>{const o=$===l,j=We(t,i.artifactOwnership);return e.jsxs("div",{children:[e.jsxs("div",{className:n.timelineEntry,onClick:()=>M(o?null:l),children:[e.jsx("span",{className:n.timelineTime,children:De(i.timestamp)}),e.jsx("span",{className:n.timelineIcon,children:ee(i.category)}),e.jsxs("div",{className:n.timelineBody,children:[e.jsxs("div",{className:n.timelineSummary,children:[i.summary,j&&e.jsx(z,{variant:i.artifactOwnership==="generated"?"neutral":"accent",className:n.ownershipBadge,children:j}),e.jsx(u,{text:qe(t,i.confidence),children:e.jsx("span",{className:`${n.timelineConfidence} ${Ue(i.confidence)}`,children:He(t,i.confidence)})})]}),e.jsx("div",{className:n.timelineTarget,children:i.target})]})]}),o&&e.jsx("div",{className:n.timelineExpanded,children:e.jsx(Y,{change:i})})]},l)})})]})]})}export{et as Component};
1
+ import{r as c,a as O,u as P,b as U,c as H,d as q,j as e}from"./index-CahJTtjv.js";import{I as W}from"./InfoLabel-mGrfFfvs.js";import{G as Y}from"./GameChangeDetail-D07BEk9j.js";import{T as u}from"./TooltipText-Vj0LEsyy.js";import{B as z}from"./UiPrimitive-tKQal2XA.js";function J(t){const s={scriptsModified:0,scriptsCreated:0,instancesCreated:0,instancesDeleted:0,instancesMoved:0,propertiesChanged:0,lightingChanged:!1,terrainChanged:!1,assetsInserted:0};for(const r of t)switch(r.category){case"script":r.changeType==="create"?s.scriptsCreated++:s.scriptsModified++;break;case"instance":r.changeType==="create"?s.instancesCreated++:r.changeType==="delete"?s.instancesDeleted++:r.changeType==="move"&&s.instancesMoved++;break;case"property":s.propertiesChanged++;break;case"lighting":s.lightingChanged=!0;break;case"terrain":s.terrainChanged=!0;break;case"asset":s.assetsInserted++;break}return s}function Q(t){if(typeof t=="number")return{placeId:String(t)}}function X(t,s){const[r,p]=c.useState(""),[L,a]=c.useState(""),[h,w]=c.useState(),[y,B]=c.useState("completed"),[$,M]=c.useState([]),[v,R]=c.useState([]),[A,G]=c.useState([]),[K,V]=c.useState(),[S,C]=c.useState(),[b,N]=c.useState(),[T,k]=c.useState({scriptsModified:0,scriptsCreated:0,instancesCreated:0,instancesDeleted:0,instancesMoved:0,propertiesChanged:0,lightingChanged:!1,terrainChanged:!1,assetsInserted:0}),[I,x]=c.useState(!0),[E,f]=c.useState(null),g=c.useCallback(async()=>{if(t){x(!0),f(null);try{const m=Q(s),[d,_]=await Promise.all([m?O.get(`/api/dashboard/changelog/${t}`,m):O.get(`/api/dashboard/changelog/${t}`),m?O.get(`/api/dashboard/changelog/${t}/changes`,m):O.get(`/api/dashboard/changelog/${t}/changes`)]);p(d.entryId),a(d.startTime),w(d.endTime),B(d.status),M(d.entries),R(d.failures),V(d.contextSummary),C(d.replayMetadata),N(d.verificationSummary),G(_.changes),k(J(_.changes))}catch(m){f(m instanceof Error?m.message:"Failed to load changelog detail")}finally{x(!1)}}},[t,s]);return c.useEffect(()=>{g()},[g]),{entryId:r,startTime:L,endTime:h,status:y,entries:$,failures:v,changes:A,changeSummary:T,contextSummary:K,replayMetadata:S,verificationSummary:b,loading:I,error:E,refresh:g}}const Z={script:"📝",instance:"🧱",property:"🎨",lighting:"🌅",terrain:"⛰️",asset:"📦"};function ee(t){return Z[t]??"❓"}const te="_page_11hjw_2",ne="_header_11hjw_10",ae="_backLink_11hjw_16",se="_headerTitle_11hjw_29",ie="_headerTime_11hjw_37",ce="_statusActive_11hjw_44",re="_statusCompleted_11hjw_49",oe="_section_11hjw_54",le="_sectionTitle_11hjw_61",de="_summaryGrid_11hjw_74",me="_summaryCard_11hjw_80",he="_summaryCardActive_11hjw_94",ge="_summaryIcon_11hjw_99",ue="_summaryCount_11hjw_105",pe="_summaryLabel_11hjw_112",ye="_contextGrid_11hjw_121",xe="_contextRow_11hjw_127",fe="_contextKey_11hjw_133",_e="_contextValue_11hjw_141",je="_timelineFilter_11hjw_149",we="_filterLabel_11hjw_157",ve="_filterSelect_11hjw_163",Se="_ownershipToggle_11hjw_173",Ce="_timeline_11hjw_149",be="_timelineEntry_11hjw_201",Ne="_timelineTime_11hjw_218",Te="_timelineIcon_11hjw_226",ke="_timelineBody_11hjw_231",Ie="_timelineSummary_11hjw_236",Ee="_timelineTarget_11hjw_243",Oe="_timelineConfidence_11hjw_250",Le="_ownershipBadge_11hjw_259",Be="_confidenceExact_11hjw_267",$e="_confidencePartial_11hjw_272",Me="_confidenceAfterOnly_11hjw_277",Re="_confidenceIntentOnly_11hjw_282",Ae="_confidenceUnknown_11hjw_287",Ge="_timelineExpanded_11hjw_293",Ke="_empty_11hjw_365",Ve="_loading_11hjw_374",Fe="_error_11hjw_383",n={page:te,header:ne,backLink:ae,headerTitle:se,headerTime:ie,statusActive:ce,statusCompleted:re,section:oe,sectionTitle:le,summaryGrid:de,summaryCard:me,summaryCardActive:he,summaryIcon:ge,summaryCount:ue,summaryLabel:pe,contextGrid:ye,contextRow:xe,contextKey:fe,contextValue:_e,timelineFilter:je,filterLabel:we,filterSelect:ve,ownershipToggle:Se,timeline:Ce,timelineEntry:be,timelineTime:Ne,timelineIcon:Te,timelineBody:ke,timelineSummary:Ie,timelineTarget:Ee,timelineConfidence:Oe,ownershipBadge:Le,confidenceExact:Be,confidencePartial:$e,confidenceAfterOnly:Me,confidenceIntentOnly:Re,confidenceUnknown:Ae,timelineExpanded:Ge,empty:Ke,loading:Ve,error:Fe},D=[{key:"script",icon:"📝",labelKey:"changelog.category.script"},{key:"instance",icon:"🧱",labelKey:"changelog.category.instance"},{key:"property",icon:"🎨",labelKey:"changelog.category.property"},{key:"lighting",icon:"🌅",labelKey:"changelog.category.lighting"},{key:"terrain",icon:"⛰️",labelKey:"changelog.category.terrain"},{key:"asset",icon:"📦",labelKey:"changelog.category.asset"}];function F(t){if(!t)return"--:--";const s=new Date(t);return`${String(s.getHours()).padStart(2,"0")}:${String(s.getMinutes()).padStart(2,"0")}`}function De(t){if(!t)return"--:--:--";const s=new Date(t);return`${String(s.getHours()).padStart(2,"0")}:${String(s.getMinutes()).padStart(2,"0")}:${String(s.getSeconds()).padStart(2,"0")}`}function Pe(t,s){if(!t||!s)return"";const r=new Date(s).getTime()-new Date(t).getTime();return r<0?"":`${Math.round(r/6e4)}min`}function Ue(t){switch(t){case"exact":return n.confidenceExact;case"partial":return n.confidencePartial;case"after-only":return n.confidenceAfterOnly;case"intent-only":return n.confidenceIntentOnly;default:return n.confidenceUnknown}}function He(t,s){switch(s){case"exact":return t("changelog.detail.confidence.exact","Exact");case"partial":return t("changelog.detail.confidence.partial","Partial");case"after-only":return t("changelog.detail.confidence.afterOnly","After only");case"intent-only":return t("changelog.detail.confidence.intentOnly","Intent only");default:return t("changelog.detail.confidence.unknown","Unknown")}}function qe(t,s){switch(s){case"exact":return t("changelog.detail.confidence.exact.tooltip","Both the before and after state were confirmed for this change.");case"partial":return t("changelog.detail.confidence.partial.tooltip","Only part of the before and after state could be confirmed for this change.");case"after-only":return t("changelog.detail.confidence.afterOnly.tooltip","Only the resulting state after the change could be confirmed.");case"intent-only":return t("changelog.detail.confidence.intentOnly.tooltip","Only the requested action was recorded, not the resulting state.");default:return t("changelog.detail.confidence.unknown.tooltip","This change could not be confidently classified from the available data.")}}function We(t,s){switch(s){case"user_source":return t("changelog.ownership.userSource","User source");case"canonical_mirror":return t("changelog.ownership.canonicalMirror","Mirror metadata");case"generated":return t("changelog.ownership.generated","Generated");default:return null}}function Ye(t){const s=new URLSearchParams(t).get("placeId");if(!s)return null;const r=Number.parseInt(s,10);return Number.isInteger(r)&&r>=0?r:null}function et(){var S,C,b,N,T,k,I,x,E,f,g,m,d,_;const{t}=P(),{id:s}=U(),r=H(),p=q(),L=c.useMemo(()=>Ye(p.search),[p.search]),a=X(s,L),[h,w]=c.useState("all"),[y,B]=c.useState(!0),[$,M]=c.useState(null),v=c.useMemo(()=>{const i=y?a.changes:a.changes.filter(o=>o.artifactOwnership!=="generated");return[...h==="all"?i:i.filter(o=>o.category===h)].reverse()},[a.changes,h,y]),R=a.changes.some(i=>i.artifactOwnership==="generated");if(a.loading)return e.jsx("div",{className:n.loading,children:t("common.loading","Loading...")});if(a.error)return e.jsxs("div",{className:n.error,children:[a.error,e.jsx("br",{}),e.jsxs("span",{className:n.backLink,onClick:()=>r("/changelog"),children:["←"," ",t("changelog.detail.backToList","Back to list")]})]});const A=Pe(a.startTime,a.endTime),G=a.endTime?`${F(a.startTime)} → ${F(a.endTime)} (${A})`:`${F(a.startTime)} → ${t("changelog.card.inProgress","in progress")}`,K=!!((S=a.contextSummary)!=null&&S.intent||(C=a.contextSummary)!=null&&C.testScenario||(b=a.contextSummary)!=null&&b.expectedBehavior||(N=a.contextSummary)!=null&&N.observedBehavior),V=!!((T=a.verificationSummary)!=null&&T.label||(k=a.verificationSummary)!=null&&k.status||(I=a.verificationSummary)!=null&&I.testTimestamp);return e.jsxs("div",{className:n.page,children:[e.jsxs("div",{className:n.header,children:[e.jsxs("span",{className:n.backLink,onClick:()=>r("/changelog"),children:["←"," ",t("sidebar.changelog","Changelog")]}),e.jsx("span",{className:n.headerTitle,children:"|"}),e.jsx("span",{className:n.headerTime,children:G}),e.jsx(u,{text:a.status==="active"?t("changelog.card.active.tooltip","This session is still receiving new game changes."):t("changelog.card.completed.tooltip","This session has ended and no more changes are expected."),children:e.jsx("span",{className:a.status==="active"?n.statusActive:n.statusCompleted,children:a.status==="active"?t("changelog.card.active","Active"):t("changelog.card.completed","Completed")})})]}),e.jsxs("div",{className:n.section,children:[e.jsx("div",{className:n.sectionTitle,children:e.jsx(u,{text:t("changelog.detail.changeSummary.tooltip","Counts of extracted game changes grouped by category for this session."),children:e.jsx("span",{children:t("changelog.detail.changeSummary","Change Summary")})})}),e.jsx("div",{className:n.summaryGrid,children:D.map(i=>{const l=a.changeSummary;let o;switch(i.key){case"script":o=l.scriptsModified+l.scriptsCreated;break;case"instance":o=l.instancesCreated+l.instancesDeleted+l.instancesMoved;break;case"property":o=l.propertiesChanged;break;case"lighting":o=l.lightingChanged?1:0;break;case"terrain":o=l.terrainChanged?1:0;break;case"asset":o=l.assetsInserted;break;default:o=0}const j=h===i.key;return e.jsxs("div",{className:`${n.summaryCard} ${j?n.summaryCardActive:""}`,onClick:()=>w(j?"all":i.key),children:[e.jsx("span",{className:n.summaryIcon,children:i.icon}),e.jsx("div",{className:n.summaryCount,children:o}),e.jsx("div",{className:n.summaryLabel,children:t(i.labelKey,i.key)})]},i.key)})})]}),K&&e.jsxs("div",{className:n.section,children:[e.jsx("div",{className:n.sectionTitle,children:e.jsx(u,{text:t("changelog.detail.context.tooltip","Structured execution context captured for this changelog session."),children:e.jsx("span",{children:t("changelog.detail.context.title","Context Summary")})})}),e.jsxs("div",{className:n.contextGrid,children:[((x=a.contextSummary)==null?void 0:x.intent)&&e.jsxs("div",{className:n.contextRow,children:[e.jsx("span",{className:n.contextKey,children:t("changelog.card.sessionIntent","Session intent")}),e.jsx("span",{className:n.contextValue,children:a.contextSummary.intent})]}),((E=a.contextSummary)==null?void 0:E.testScenario)&&e.jsxs("div",{className:n.contextRow,children:[e.jsx("span",{className:n.contextKey,children:t("playtest.context.why","Why this test ran")}),e.jsx("span",{className:n.contextValue,children:a.contextSummary.testScenario})]}),((f=a.contextSummary)==null?void 0:f.expectedBehavior)&&e.jsxs("div",{className:n.contextRow,children:[e.jsx("span",{className:n.contextKey,children:t("playtest.context.expected","Expected")}),e.jsx("span",{className:n.contextValue,children:a.contextSummary.expectedBehavior})]}),((g=a.contextSummary)==null?void 0:g.observedBehavior)&&e.jsxs("div",{className:n.contextRow,children:[e.jsx("span",{className:n.contextKey,children:t("playtest.context.observed","Observed")}),e.jsx("span",{className:n.contextValue,children:a.contextSummary.observedBehavior})]})]})]}),V&&e.jsxs("div",{className:n.section,children:[e.jsx("div",{className:n.sectionTitle,children:e.jsx(u,{text:t("changelog.detail.verification.tooltip","Verification signals linked to this changelog session."),children:e.jsx("span",{children:t("changelog.detail.verification.title","Verification")})})}),e.jsxs("div",{className:n.contextGrid,children:[((m=a.verificationSummary)==null?void 0:m.label)&&e.jsxs("div",{className:n.contextRow,children:[e.jsx("span",{className:n.contextKey,children:t("changelog.detail.verification.label","Result")}),e.jsx("span",{className:n.contextValue,children:a.verificationSummary.label})]}),((d=a.verificationSummary)==null?void 0:d.status)&&e.jsxs("div",{className:n.contextRow,children:[e.jsx("span",{className:n.contextKey,children:t("changelog.detail.verification.status","Status")}),e.jsx("span",{className:n.contextValue,children:a.verificationSummary.status})]}),((_=a.verificationSummary)==null?void 0:_.testTimestamp)&&e.jsxs("div",{className:n.contextRow,children:[e.jsx("span",{className:n.contextKey,children:t("changelog.detail.verification.timestamp","Recorded at")}),e.jsx("span",{className:n.contextValue,children:a.verificationSummary.testTimestamp})]})]})]}),e.jsxs("div",{className:n.section,children:[e.jsx("div",{className:n.sectionTitle,children:e.jsx(u,{text:t("changelog.detail.changeTimeline.tooltip","Chronological list of extracted game changes for this session."),children:e.jsx("span",{children:t("changelog.detail.changeTimeline","Change Timeline")})})}),e.jsxs("div",{className:n.timelineFilter,children:[e.jsx("span",{className:n.filterLabel,children:e.jsx(W,{label:`${t("changelog.detail.filterCategory","Category")}:`,tooltip:t("changelog.detail.filterCategory.tooltip","Filter the timeline to a single change category.")})}),e.jsxs("select",{className:n.filterSelect,value:h,onChange:i=>w(i.target.value),children:[e.jsx("option",{value:"all",children:t("tools.filter.all","All")}),D.map(i=>e.jsxs("option",{value:i.key,children:[i.icon," ",t(i.labelKey,i.key)]},i.key))]}),R&&e.jsxs("label",{className:n.ownershipToggle,children:[e.jsx("input",{type:"checkbox",checked:y,onChange:i=>B(i.target.checked)}),t("changelog.ownership.showGenerated","Show generated metadata")]})]}),v.length===0?e.jsx("div",{className:n.empty,children:t("changelog.detail.noChanges","No changes in this category")}):e.jsx("div",{className:n.timeline,children:v.map((i,l)=>{const o=$===l,j=We(t,i.artifactOwnership);return e.jsxs("div",{children:[e.jsxs("div",{className:n.timelineEntry,onClick:()=>M(o?null:l),children:[e.jsx("span",{className:n.timelineTime,children:De(i.timestamp)}),e.jsx("span",{className:n.timelineIcon,children:ee(i.category)}),e.jsxs("div",{className:n.timelineBody,children:[e.jsxs("div",{className:n.timelineSummary,children:[i.summary,j&&e.jsx(z,{variant:i.artifactOwnership==="generated"?"neutral":"accent",className:n.ownershipBadge,children:j}),e.jsx(u,{text:qe(t,i.confidence),children:e.jsx("span",{className:`${n.timelineConfidence} ${Ue(i.confidence)}`,children:He(t,i.confidence)})})]}),e.jsx("div",{className:n.timelineTarget,children:i.target})]})]}),o&&e.jsx("div",{className:n.timelineExpanded,children:e.jsx(Y,{change:i})})]},l)})})]})]})}export{et as Component};
@@ -1 +1 @@
1
- import{r as l,a as F,D,u as M,j as e,e as O,c as V,h as U,l as K,T as G}from"./index-CtLyZZKX.js";import{P as H}from"./PageHeader-0cqG2PEX.js";import{C as Z}from"./ConfirmModal-Ca_Jx1Np.js";import{C as Q}from"./CurrentPlaceScope-B3Jcq1x_.js";import{T as k}from"./TooltipText-YDig3E2P.js";import{T as q}from"./Tabs-C6KgB85r.js";import"./UiPrimitive-_I4FkOJy.js";import"./ConfirmModal.module-DJksQHBd.js";const z=10;function J(t,o){return typeof o!="number"?t:`${t}?placeId=${encodeURIComponent(String(o))}`}function W(t){const o=(t==null?void 0:t.placeId)??null,[s,n]=l.useState([]),[u,_]=l.useState(0),[a,f]=l.useState(!1),[x,v]=l.useState(!0),[g,C]=l.useState(0),[d,y]=l.useState("all"),N=l.useRef(null),m=l.useCallback(async(h,b)=>{v(!0);try{const j={limit:String(z),offset:String(h)};b!=="all"&&(j.status=b),typeof o=="number"&&(j.placeId=String(o));const I=await F.get("/api/dashboard/changelog",j);n(I.entries),_(I.total),f(I.hasMore)}catch{n([]),_(0),f(!1)}finally{v(!1)}},[o]),S=l.useCallback(()=>{m(g,d)},[m,g,d]),i=l.useCallback(async()=>{await F.post(J("/api/dashboard/changelog/clear",o)),n([]),_(0),f(!1)},[o]);return l.useEffect(()=>{m(g,d)},[m,g,d]),l.useEffect(()=>{const h=new D;N.current=h,h.connect();const b=h.on("command",()=>{m(g,d)});return()=>{b(),h.disconnect(),N.current=null}},[m,g,d]),{entries:s,total:u,hasMore:a,loading:x,offset:g,statusFilter:d,setOffset:C,setStatusFilter:y,refresh:S,clear:i}}const X="_card_1n89u_2",Y="_header_1n89u_17",ee="_statusBadge_1n89u_24",te="_statusDot_1n89u_35",se="_active_1n89u_41",ae="_completed_1n89u_50",ne="_timeRange_1n89u_58",ce="_summaryList_1n89u_65",oe="_summaryItem_1n89u_71",ie="_summaryIcon_1n89u_80",le="_summaryText_1n89u_86",re="_progressBar_1n89u_91",ge="_progressFill_1n89u_99",de="_emptySummary_1n89u_112",me="_contextBlock_1n89u_120",he="_contextLabel_1n89u_129",pe="_contextValue_1n89u_137",c={card:X,header:Y,statusBadge:ee,statusDot:te,active:se,completed:ae,timeRange:ne,summaryList:ce,summaryItem:oe,summaryIcon:ie,summaryText:le,progressBar:re,progressFill:ge,emptySummary:de,contextBlock:me,contextLabel:he,contextValue:pe};function R(t){if(!t)return"--:--";const o=new Date(t);return`${String(o.getHours()).padStart(2,"0")}:${String(o.getMinutes()).padStart(2,"0")}`}function ue({entry:t,onClick:o}){var h,b,j,I,B,L,A,P,w,E;const{t:s}=M(),n=t.changeSummary,u=t.status==="active",_=t.isBootstrapOnly===!0,a=[],f=n.scriptsModified+n.scriptsCreated;if(f>0){const p=[];n.scriptsModified>0&&p.push(`${n.scriptsModified} ${s("changelog.card.modified","modified")}`),n.scriptsCreated>0&&p.push(`${n.scriptsCreated} ${s("changelog.card.created","created")}`);const T=`${f} ${s("changelog.card.scripts","scripts")} ${p.join(", ")}`;a.push({icon:"📝",text:T,tooltip:s("changelog.card.scripts.tooltip","Script changes made in this session.")})}const x=n.instancesCreated+n.instancesDeleted+n.instancesMoved;if(x>0){const p=[];n.instancesCreated>0&&p.push(`${n.instancesCreated} ${s("changelog.card.created","created")}`),n.instancesDeleted>0&&p.push(`${n.instancesDeleted} ${s("changelog.card.deleted","deleted")}`),n.instancesMoved>0&&p.push(`${n.instancesMoved} ${s("changelog.card.moved","moved")}`);const T=`${x} ${s("changelog.card.instances","instances")} ${p.join(", ")}`;a.push({icon:"🧱",text:T,tooltip:s("changelog.card.instances.tooltip","Instance create, delete, move, or clone changes in this session.")})}n.propertiesChanged>0&&a.push({icon:"🎨",text:`${n.propertiesChanged} ${s("changelog.card.propertiesChanged","properties changed")}`,tooltip:s("changelog.card.propertiesChanged.tooltip","Property value changes recorded for this session.")}),n.lightingChanged&&a.push({icon:"🌅",text:s("changelog.card.lightingConfigured","Lighting configured"),tooltip:s("changelog.card.lightingConfigured.tooltip","Lighting or atmosphere settings changed in this session.")}),n.terrainChanged&&a.push({icon:"⛰️",text:s("changelog.card.terrainConfigured","Terrain configured"),tooltip:s("changelog.card.terrainConfigured.tooltip","Terrain data or terrain settings changed in this session.")}),n.assetsInserted>0&&a.push({icon:"📦",text:`${n.assetsInserted} ${s("changelog.card.assetsInserted","assets inserted")}`,tooltip:s("changelog.card.assetsInserted.tooltip","Assets inserted into the place during this session.")});const v=R(t.startTime),g=u?s("changelog.card.inProgress","in progress"):t.endTime?R(t.endTime):"--:--",C=_?s("changelog.card.bootstrapStatus","Bootstrap"):u?s("changelog.card.active","Active"):s("changelog.card.completed","Completed"),d=_?s("changelog.card.bootstrapStatus.tooltip","This session only contains the initial sync bootstrap snapshot."):u?s("changelog.card.active.tooltip","This session is still receiving new game changes."):s("changelog.card.completed.tooltip","This session has ended and no more changes are expected."),y=_?s("changelog.card.bootstrapSummary","Initial sync snapshot"):s("changelog.card.noChanges","No changes yet"),N=_?s("changelog.card.bootstrapSummary.tooltip","Initial file sync writes are collapsed into a single bootstrap snapshot row."):s("changelog.card.noChanges.tooltip","No game changes have been extracted for this session yet."),m=(b=(h=t.contextSummary)==null?void 0:h.intent)==null?void 0:b.trim(),S=((L=(B=(I=(j=t.contextSummary)==null?void 0:j.affectedAreas)==null?void 0:I[0])==null?void 0:B.label)==null?void 0:L.trim())||((P=(A=t.contextSummary)==null?void 0:A.testScenario)==null?void 0:P.trim()),i=(E=(w=t.verificationSummary)==null?void 0:w.label)==null?void 0:E.trim();return e.jsxs("div",{className:c.card,onClick:o,children:[e.jsxs("div",{className:c.header,children:[e.jsx(k,{text:d,children:e.jsxs("span",{className:`${c.statusBadge} ${u?c.active:c.completed}`,children:[e.jsx("span",{className:c.statusDot}),C]})}),e.jsxs("span",{className:c.timeRange,children:[v,"~",g]})]}),e.jsx("div",{className:c.summaryList,children:a.length>0?a.map((p,T)=>e.jsxs("div",{className:c.summaryItem,children:[e.jsx("span",{className:c.summaryIcon,children:p.icon}),e.jsx(k,{text:p.tooltip,children:e.jsx("span",{className:c.summaryText,children:p.text})})]},T)):e.jsx(k,{text:N,children:e.jsx("span",{className:c.emptySummary,style:{display:"block"},children:y})})}),m&&e.jsxs("div",{className:c.contextBlock,children:[e.jsx("span",{className:c.contextLabel,children:s("changelog.card.sessionIntent","Session intent")}),e.jsx("span",{className:c.contextValue,children:m})]}),!m&&S&&e.jsxs("div",{className:c.contextBlock,children:[e.jsx("span",{className:c.contextLabel,children:s("changelog.card.representativeArea","Representative area")}),e.jsx("span",{className:c.contextValue,children:S})]}),i&&e.jsxs("div",{className:c.contextBlock,children:[e.jsx("span",{className:c.contextLabel,children:s("changelog.card.verification","Verification")}),e.jsx("span",{className:c.contextValue,children:i})]}),u&&e.jsx("div",{className:c.progressBar,children:e.jsx("div",{className:c.progressFill})})]})}const _e="_page_1tggr_2",fe="_limitNotice_1tggr_9",xe="_limitNoticeContent_1tggr_23",ye="_limitNoticeTitle_1tggr_28",be="_limitNoticeText_1tggr_35",ve="_primaryAction_1tggr_41",Ce="_clearButton_1tggr_67",Ne="_list_1tggr_88",Se="_empty_1tggr_95",je="_loading_1tggr_104",Ie="_pagination_1tggr_113",Te="_pageInfo_1tggr_121",$e="_btn_1tggr_127",r={page:_e,limitNotice:fe,limitNoticeContent:xe,limitNoticeTitle:ye,limitNoticeText:be,primaryAction:ve,clearButton:Ce,list:Ne,empty:Se,loading:je,pagination:Ie,pageInfo:Te,btn:$e},$=10;function ke(t,o){return typeof o!="number"?`/changelog/${t}`:`/changelog/${t}?placeId=${encodeURIComponent(String(o))}`}const Be=[{key:"all",labelKey:"changelog.filter.all"},{key:"active",labelKey:"changelog.filter.active"},{key:"completed",labelKey:"changelog.filter.completed"}];function De(){const{t}=M(),{trackEvent:o,trackPageView:s}=O(),n=V(),[u,_]=l.useState(null),a=W({placeId:u}),f=U(),{show:x}=K(),[v,g]=l.useState(!1),[C,d]=l.useState(!1),y=!f.loading&&f.tier==="basic",N=y?a.entries.slice(0,3):a.entries,m=!y&&a.total>$,S=async()=>{d(!0);try{await a.clear(),x(t("toast.clearSuccess","Cleared successfully"),"success"),g(!1)}catch{x(t("toast.clearFailed","Failed to clear data"),"error")}finally{d(!1)}};return e.jsxs("div",{className:r.page,children:[e.jsx(H,{title:t("page.changelog.title","Changelog"),description:t("page.changelog.description","Review game-change sessions captured from AI actions and sync events."),helpTopicId:"changelog",helpState:{tier:f.tier}}),e.jsx(Q,{surface:"changelog",selectable:!0,selectedPlaceId:u,onSelectedPlaceIdChange:i=>{_(i),a.setOffset(0)}}),e.jsx(q,{items:Be.map(i=>({key:i.key,label:t(i.labelKey,i.key.charAt(0).toUpperCase()+i.key.slice(1))})),value:a.statusFilter,onChange:i=>{const h=`changelog_${i}`;o("dashboard_click_event",{click_target:`changelog_tab_${i}`,page:"changelog",tab:h}),s({page:"changelog",tab:h}),a.setStatusFilter(i),a.setOffset(0)},rightActions:e.jsx("button",{className:r.clearButton,onClick:()=>{o("dashboard_click_event",{click_target:"changelog_clear",page:"changelog",tab:`changelog_${a.statusFilter}`}),g(!0)},children:t("common.clear","Clear")})}),a.loading&&a.entries.length===0&&e.jsx("div",{className:r.loading,children:t("common.loading","Loading...")}),!a.loading&&a.entries.length===0?e.jsx("div",{className:r.empty,children:t("changelog.empty","No changelog entries for the current place yet")}):e.jsx("div",{className:r.list,children:N.map(i=>e.jsx(ue,{entry:i,onClick:()=>n(ke(i.entryId,u))},i.entryId))}),m&&e.jsxs("div",{className:r.pagination,children:[e.jsx("button",{className:r.btn,disabled:a.offset===0,onClick:()=>a.setOffset(Math.max(0,a.offset-$)),children:t("tools.page.prev","Prev")}),e.jsxs("span",{className:r.pageInfo,children:[a.offset+1,"–",Math.min(a.offset+$,a.total)," / ",a.total]}),e.jsx("button",{className:r.btn,disabled:!a.hasMore,onClick:()=>a.setOffset(a.offset+$),children:t("tools.page.next","Next")})]}),y&&e.jsx(e.Fragment,{children:e.jsxs("div",{className:r.limitNotice,children:[e.jsxs("div",{className:r.limitNoticeContent,children:[e.jsx("div",{className:r.limitNoticeTitle,children:t("changelog.basic.limit.title","Basic preview shows the latest 3 sessions")}),e.jsx("div",{className:r.limitNoticeText,children:t("changelog.basic.limit.body","Full changelog timeline browsing is available with Pro.")})]}),e.jsx("a",{className:r.primaryAction,href:G.changelog,target:"_blank",rel:"noreferrer",onClick:()=>o("dashboard_click_event",{click_target:"upgrade_cta",placement:"changelog_limit_notice",page:"changelog",tab:`changelog_${a.statusFilter}`}),children:t("tier.upgrade","View Pro")})]})}),e.jsx(Z,{open:v,title:t("changelog.clear.title","Clear changelog?"),message:t("changelog.clear.message","This permanently removes the stored changelog for the current place."),cancelLabel:t("common.cancel","Cancel"),confirmLabel:t("common.clear","Clear"),loading:C,onCancel:()=>!C&&g(!1),onConfirm:S})]})}export{De as Component};
1
+ import{r as l,a as F,D,u as M,j as e,e as O,c as V,h as U,l as K,T as G}from"./index-CahJTtjv.js";import{P as H}from"./PageHeader-CKFvQ2T_.js";import{C as Z}from"./ConfirmModal-reOnA0XQ.js";import{C as Q}from"./CurrentPlaceScope-7RO-JoyN.js";import{T as k}from"./TooltipText-Vj0LEsyy.js";import{T as q}from"./Tabs-Bzvy3UJR.js";import"./UiPrimitive-tKQal2XA.js";import"./ConfirmModal.module-DJksQHBd.js";const z=10;function J(t,o){return typeof o!="number"?t:`${t}?placeId=${encodeURIComponent(String(o))}`}function W(t){const o=(t==null?void 0:t.placeId)??null,[s,n]=l.useState([]),[u,_]=l.useState(0),[a,f]=l.useState(!1),[x,v]=l.useState(!0),[g,C]=l.useState(0),[d,y]=l.useState("all"),N=l.useRef(null),m=l.useCallback(async(h,b)=>{v(!0);try{const j={limit:String(z),offset:String(h)};b!=="all"&&(j.status=b),typeof o=="number"&&(j.placeId=String(o));const I=await F.get("/api/dashboard/changelog",j);n(I.entries),_(I.total),f(I.hasMore)}catch{n([]),_(0),f(!1)}finally{v(!1)}},[o]),S=l.useCallback(()=>{m(g,d)},[m,g,d]),i=l.useCallback(async()=>{await F.post(J("/api/dashboard/changelog/clear",o)),n([]),_(0),f(!1)},[o]);return l.useEffect(()=>{m(g,d)},[m,g,d]),l.useEffect(()=>{const h=new D;N.current=h,h.connect();const b=h.on("command",()=>{m(g,d)});return()=>{b(),h.disconnect(),N.current=null}},[m,g,d]),{entries:s,total:u,hasMore:a,loading:x,offset:g,statusFilter:d,setOffset:C,setStatusFilter:y,refresh:S,clear:i}}const X="_card_1n89u_2",Y="_header_1n89u_17",ee="_statusBadge_1n89u_24",te="_statusDot_1n89u_35",se="_active_1n89u_41",ae="_completed_1n89u_50",ne="_timeRange_1n89u_58",ce="_summaryList_1n89u_65",oe="_summaryItem_1n89u_71",ie="_summaryIcon_1n89u_80",le="_summaryText_1n89u_86",re="_progressBar_1n89u_91",ge="_progressFill_1n89u_99",de="_emptySummary_1n89u_112",me="_contextBlock_1n89u_120",he="_contextLabel_1n89u_129",pe="_contextValue_1n89u_137",c={card:X,header:Y,statusBadge:ee,statusDot:te,active:se,completed:ae,timeRange:ne,summaryList:ce,summaryItem:oe,summaryIcon:ie,summaryText:le,progressBar:re,progressFill:ge,emptySummary:de,contextBlock:me,contextLabel:he,contextValue:pe};function R(t){if(!t)return"--:--";const o=new Date(t);return`${String(o.getHours()).padStart(2,"0")}:${String(o.getMinutes()).padStart(2,"0")}`}function ue({entry:t,onClick:o}){var h,b,j,I,B,L,A,P,w,E;const{t:s}=M(),n=t.changeSummary,u=t.status==="active",_=t.isBootstrapOnly===!0,a=[],f=n.scriptsModified+n.scriptsCreated;if(f>0){const p=[];n.scriptsModified>0&&p.push(`${n.scriptsModified} ${s("changelog.card.modified","modified")}`),n.scriptsCreated>0&&p.push(`${n.scriptsCreated} ${s("changelog.card.created","created")}`);const T=`${f} ${s("changelog.card.scripts","scripts")} ${p.join(", ")}`;a.push({icon:"📝",text:T,tooltip:s("changelog.card.scripts.tooltip","Script changes made in this session.")})}const x=n.instancesCreated+n.instancesDeleted+n.instancesMoved;if(x>0){const p=[];n.instancesCreated>0&&p.push(`${n.instancesCreated} ${s("changelog.card.created","created")}`),n.instancesDeleted>0&&p.push(`${n.instancesDeleted} ${s("changelog.card.deleted","deleted")}`),n.instancesMoved>0&&p.push(`${n.instancesMoved} ${s("changelog.card.moved","moved")}`);const T=`${x} ${s("changelog.card.instances","instances")} ${p.join(", ")}`;a.push({icon:"🧱",text:T,tooltip:s("changelog.card.instances.tooltip","Instance create, delete, move, or clone changes in this session.")})}n.propertiesChanged>0&&a.push({icon:"🎨",text:`${n.propertiesChanged} ${s("changelog.card.propertiesChanged","properties changed")}`,tooltip:s("changelog.card.propertiesChanged.tooltip","Property value changes recorded for this session.")}),n.lightingChanged&&a.push({icon:"🌅",text:s("changelog.card.lightingConfigured","Lighting configured"),tooltip:s("changelog.card.lightingConfigured.tooltip","Lighting or atmosphere settings changed in this session.")}),n.terrainChanged&&a.push({icon:"⛰️",text:s("changelog.card.terrainConfigured","Terrain configured"),tooltip:s("changelog.card.terrainConfigured.tooltip","Terrain data or terrain settings changed in this session.")}),n.assetsInserted>0&&a.push({icon:"📦",text:`${n.assetsInserted} ${s("changelog.card.assetsInserted","assets inserted")}`,tooltip:s("changelog.card.assetsInserted.tooltip","Assets inserted into the place during this session.")});const v=R(t.startTime),g=u?s("changelog.card.inProgress","in progress"):t.endTime?R(t.endTime):"--:--",C=_?s("changelog.card.bootstrapStatus","Bootstrap"):u?s("changelog.card.active","Active"):s("changelog.card.completed","Completed"),d=_?s("changelog.card.bootstrapStatus.tooltip","This session only contains the initial sync bootstrap snapshot."):u?s("changelog.card.active.tooltip","This session is still receiving new game changes."):s("changelog.card.completed.tooltip","This session has ended and no more changes are expected."),y=_?s("changelog.card.bootstrapSummary","Initial sync snapshot"):s("changelog.card.noChanges","No changes yet"),N=_?s("changelog.card.bootstrapSummary.tooltip","Initial file sync writes are collapsed into a single bootstrap snapshot row."):s("changelog.card.noChanges.tooltip","No game changes have been extracted for this session yet."),m=(b=(h=t.contextSummary)==null?void 0:h.intent)==null?void 0:b.trim(),S=((L=(B=(I=(j=t.contextSummary)==null?void 0:j.affectedAreas)==null?void 0:I[0])==null?void 0:B.label)==null?void 0:L.trim())||((P=(A=t.contextSummary)==null?void 0:A.testScenario)==null?void 0:P.trim()),i=(E=(w=t.verificationSummary)==null?void 0:w.label)==null?void 0:E.trim();return e.jsxs("div",{className:c.card,onClick:o,children:[e.jsxs("div",{className:c.header,children:[e.jsx(k,{text:d,children:e.jsxs("span",{className:`${c.statusBadge} ${u?c.active:c.completed}`,children:[e.jsx("span",{className:c.statusDot}),C]})}),e.jsxs("span",{className:c.timeRange,children:[v,"~",g]})]}),e.jsx("div",{className:c.summaryList,children:a.length>0?a.map((p,T)=>e.jsxs("div",{className:c.summaryItem,children:[e.jsx("span",{className:c.summaryIcon,children:p.icon}),e.jsx(k,{text:p.tooltip,children:e.jsx("span",{className:c.summaryText,children:p.text})})]},T)):e.jsx(k,{text:N,children:e.jsx("span",{className:c.emptySummary,style:{display:"block"},children:y})})}),m&&e.jsxs("div",{className:c.contextBlock,children:[e.jsx("span",{className:c.contextLabel,children:s("changelog.card.sessionIntent","Session intent")}),e.jsx("span",{className:c.contextValue,children:m})]}),!m&&S&&e.jsxs("div",{className:c.contextBlock,children:[e.jsx("span",{className:c.contextLabel,children:s("changelog.card.representativeArea","Representative area")}),e.jsx("span",{className:c.contextValue,children:S})]}),i&&e.jsxs("div",{className:c.contextBlock,children:[e.jsx("span",{className:c.contextLabel,children:s("changelog.card.verification","Verification")}),e.jsx("span",{className:c.contextValue,children:i})]}),u&&e.jsx("div",{className:c.progressBar,children:e.jsx("div",{className:c.progressFill})})]})}const _e="_page_1tggr_2",fe="_limitNotice_1tggr_9",xe="_limitNoticeContent_1tggr_23",ye="_limitNoticeTitle_1tggr_28",be="_limitNoticeText_1tggr_35",ve="_primaryAction_1tggr_41",Ce="_clearButton_1tggr_67",Ne="_list_1tggr_88",Se="_empty_1tggr_95",je="_loading_1tggr_104",Ie="_pagination_1tggr_113",Te="_pageInfo_1tggr_121",$e="_btn_1tggr_127",r={page:_e,limitNotice:fe,limitNoticeContent:xe,limitNoticeTitle:ye,limitNoticeText:be,primaryAction:ve,clearButton:Ce,list:Ne,empty:Se,loading:je,pagination:Ie,pageInfo:Te,btn:$e},$=10;function ke(t,o){return typeof o!="number"?`/changelog/${t}`:`/changelog/${t}?placeId=${encodeURIComponent(String(o))}`}const Be=[{key:"all",labelKey:"changelog.filter.all"},{key:"active",labelKey:"changelog.filter.active"},{key:"completed",labelKey:"changelog.filter.completed"}];function De(){const{t}=M(),{trackEvent:o,trackPageView:s}=O(),n=V(),[u,_]=l.useState(null),a=W({placeId:u}),f=U(),{show:x}=K(),[v,g]=l.useState(!1),[C,d]=l.useState(!1),y=!f.loading&&f.tier==="basic",N=y?a.entries.slice(0,3):a.entries,m=!y&&a.total>$,S=async()=>{d(!0);try{await a.clear(),x(t("toast.clearSuccess","Cleared successfully"),"success"),g(!1)}catch{x(t("toast.clearFailed","Failed to clear data"),"error")}finally{d(!1)}};return e.jsxs("div",{className:r.page,children:[e.jsx(H,{title:t("page.changelog.title","Changelog"),description:t("page.changelog.description","Review game-change sessions captured from AI actions and sync events."),helpTopicId:"changelog",helpState:{tier:f.tier}}),e.jsx(Q,{surface:"changelog",selectable:!0,selectedPlaceId:u,onSelectedPlaceIdChange:i=>{_(i),a.setOffset(0)}}),e.jsx(q,{items:Be.map(i=>({key:i.key,label:t(i.labelKey,i.key.charAt(0).toUpperCase()+i.key.slice(1))})),value:a.statusFilter,onChange:i=>{const h=`changelog_${i}`;o("dashboard_click_event",{click_target:`changelog_tab_${i}`,page:"changelog",tab:h}),s({page:"changelog",tab:h}),a.setStatusFilter(i),a.setOffset(0)},rightActions:e.jsx("button",{className:r.clearButton,onClick:()=>{o("dashboard_click_event",{click_target:"changelog_clear",page:"changelog",tab:`changelog_${a.statusFilter}`}),g(!0)},children:t("common.clear","Clear")})}),a.loading&&a.entries.length===0&&e.jsx("div",{className:r.loading,children:t("common.loading","Loading...")}),!a.loading&&a.entries.length===0?e.jsx("div",{className:r.empty,children:t("changelog.empty","No changelog entries for the current place yet")}):e.jsx("div",{className:r.list,children:N.map(i=>e.jsx(ue,{entry:i,onClick:()=>n(ke(i.entryId,u))},i.entryId))}),m&&e.jsxs("div",{className:r.pagination,children:[e.jsx("button",{className:r.btn,disabled:a.offset===0,onClick:()=>a.setOffset(Math.max(0,a.offset-$)),children:t("tools.page.prev","Prev")}),e.jsxs("span",{className:r.pageInfo,children:[a.offset+1,"–",Math.min(a.offset+$,a.total)," / ",a.total]}),e.jsx("button",{className:r.btn,disabled:!a.hasMore,onClick:()=>a.setOffset(a.offset+$),children:t("tools.page.next","Next")})]}),y&&e.jsx(e.Fragment,{children:e.jsxs("div",{className:r.limitNotice,children:[e.jsxs("div",{className:r.limitNoticeContent,children:[e.jsx("div",{className:r.limitNoticeTitle,children:t("changelog.basic.limit.title","Basic preview shows the latest 3 sessions")}),e.jsx("div",{className:r.limitNoticeText,children:t("changelog.basic.limit.body","Full changelog timeline browsing is available with Pro.")})]}),e.jsx("a",{className:r.primaryAction,href:G.changelog,target:"_blank",rel:"noreferrer",onClick:()=>o("dashboard_click_event",{click_target:"upgrade_cta",placement:"changelog_limit_notice",page:"changelog",tab:`changelog_${a.statusFilter}`}),children:t("tier.upgrade","View Pro")})]})}),e.jsx(Z,{open:v,title:t("changelog.clear.title","Clear changelog?"),message:t("changelog.clear.message","This permanently removes the stored changelog for the current place."),cancelLabel:t("common.cancel","Cancel"),confirmLabel:t("common.clear","Clear"),loading:C,onCancel:()=>!C&&g(!1),onConfirm:S})]})}export{De as Component};
@@ -1 +1 @@
1
- import{r as u,j as s}from"./index-CtLyZZKX.js";import{s as a}from"./ConfirmModal.module-DJksQHBd.js";function p({open:r,title:t,message:o,cancelLabel:c,confirmLabel:n,loading:e=!1,onCancel:l,onConfirm:d}){const i=u.useId();return r?s.jsx("div",{className:a.backdrop,onClick:e?void 0:l,children:s.jsxs("div",{className:a.modal,role:"dialog","aria-modal":"true","aria-labelledby":i,onClick:m=>m.stopPropagation(),children:[s.jsx("h2",{id:i,className:a.title,children:t}),s.jsx("p",{className:a.message,children:o}),s.jsxs("div",{className:a.actions,children:[s.jsx("button",{className:a.cancelButton,onClick:l,disabled:e,children:c}),s.jsx("button",{className:a.confirmButton,onClick:d,disabled:e,children:e?"...":n})]})]})}):null}export{p as C};
1
+ import{r as u,j as s}from"./index-CahJTtjv.js";import{s as a}from"./ConfirmModal.module-DJksQHBd.js";function p({open:r,title:t,message:o,cancelLabel:c,confirmLabel:n,loading:e=!1,onCancel:l,onConfirm:d}){const i=u.useId();return r?s.jsx("div",{className:a.backdrop,onClick:e?void 0:l,children:s.jsxs("div",{className:a.modal,role:"dialog","aria-modal":"true","aria-labelledby":i,onClick:m=>m.stopPropagation(),children:[s.jsx("h2",{id:i,className:a.title,children:t}),s.jsx("p",{className:a.message,children:o}),s.jsxs("div",{className:a.actions,children:[s.jsx("button",{className:a.cancelButton,onClick:l,disabled:e,children:c}),s.jsx("button",{className:a.confirmButton,onClick:d,disabled:e,children:e?"...":n})]})]})}):null}export{p as C};
@@ -1,4 +1,4 @@
1
- import{i as tt,u as et,r as d,j as t,f as nt,a as U,D as st,L as it,M as ct,k as W,e as at,l as lt,s as rt}from"./index-CtLyZZKX.js";import{I as p}from"./InfoLabel-B7ZSx6u2.js";import{P as dt}from"./PageHeader-0cqG2PEX.js";import{S as ot}from"./StatusBadge-CenFXcbO.js";import{T as X}from"./TooltipText-YDig3E2P.js";import{C as J}from"./ConfirmModal-Ca_Jx1Np.js";import{u as gt,f as ut}from"./useLiveUptime-sXHLge7C.js";import{C as K}from"./copy-LteGG3Jy.js";import"./UiPrimitive-_I4FkOJy.js";import"./ConfirmModal.module-DJksQHBd.js";/**
1
+ import{i as tt,u as et,r as d,j as t,f as nt,a as U,D as st,L as it,M as ct,k as W,e as at,l as lt,s as rt}from"./index-CahJTtjv.js";import{I as p}from"./InfoLabel-mGrfFfvs.js";import{P as dt}from"./PageHeader-CKFvQ2T_.js";import{S as ot}from"./StatusBadge-BuYWRuwX.js";import{T as X}from"./TooltipText-Vj0LEsyy.js";import{C as J}from"./ConfirmModal-reOnA0XQ.js";import{u as gt,f as ut}from"./useLiveUptime-CcseIxAd.js";import{C as K}from"./copy-DHQ0v8nJ.js";import"./UiPrimitive-tKQal2XA.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.
@@ -1,4 +1,4 @@
1
- import{i as K,u as P,j as e,f as q,l as z,d as k,r as l,v as Z,w as J,x as ee,a as U,s as te,y as ne,k as D,N as oe}from"./index-CtLyZZKX.js";import{D as Q,P as ae}from"./PageHeader-0cqG2PEX.js";import{I as T}from"./InfoLabel-B7ZSx6u2.js";import{s as j}from"./ConfirmModal.module-DJksQHBd.js";import{T as F}from"./TooltipText-YDig3E2P.js";import{s as t,u as ie}from"./useSettings-7vvqoIou.js";import{C as B}from"./copy-LteGG3Jy.js";import"./UiPrimitive-_I4FkOJy.js";/**
1
+ import{i as K,u as P,j as e,f as q,l as z,d as k,r as l,v as Z,w as J,x as ee,a as U,s as te,y as ne,k as D,N as oe}from"./index-CahJTtjv.js";import{D as Q,P as ae}from"./PageHeader-CKFvQ2T_.js";import{I as T}from"./InfoLabel-mGrfFfvs.js";import{s as j}from"./ConfirmModal.module-DJksQHBd.js";import{T as F}from"./TooltipText-Vj0LEsyy.js";import{s as t,u as ie}from"./useSettings-CZEc0yGK.js";import{C as B}from"./copy-DHQ0v8nJ.js";import"./UiPrimitive-tKQal2XA.js";/**
2
2
  * @license lucide-react v1.8.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.