(filePath)
| 663 | } |
| 664 | |
| 665 | function basename(filePath) { |
| 666 | const normalized = String(filePath).replace(/\\/g, "/"); |
| 667 | const parts = normalized.split("/").filter(Boolean); |
| 668 | return parts[parts.length - 1] || String(filePath); |
| 669 | } |
| 670 | |
| 671 | function buildFileDownloadUrl(filePath) { |
| 672 | return `${state.API_BASE}/api/files?path=${encodeURIComponent(filePath)}`; |