From 7cd2dbbe0da62a75ba09adda90f5bfe1bea76249 Mon Sep 17 00:00:00 2001 From: Tera-Dark Date: Fri, 23 Oct 2026 17:05:50 +0800 Subject: [PATCH] chore(release): package verified 1.8.0 local synchronization candidate --- AGENTS.md | 7 +- CHANGELOG.md | 34 + README.md | 9 + docs/architecture.md | 16 +- docs/releases/1.8.0.json | 42 ++ docs/synchronization-performance.zh-CN.md | 73 +++ docs/validation/1.8.0-sync.json | 156 +++++ gallery_ui/dist/.vite/manifest.json | 132 ++-- .../dist/assets/BoardShareModal-CNeucGS-.js | 1 + .../dist/assets/BoardShareModal-DrZ4X-PT.js | 1 - .../assets/DualFolderWorkspace-D8G_E4xN.js | 1 + .../assets/DualFolderWorkspace-Dl7afjQz.js | 1 - .../dist/assets/I18nProvider-DEfiLn3N.js | 1 + .../dist/assets/I18nProvider-cZczvL7B.js | 1 - .../dist/assets/ImageDetailModal-Bv5UXO0m.js | 3 + .../dist/assets/ImageDetailModal-DaLI34MR.js | 3 - .../dist/assets/ImageSearchModal-CH4E-SEH.js | 1 + .../dist/assets/ImageSearchModal-DZp0PXl_.js | 1 - .../dist/assets/LibraryWorkspace-CPcrzo6d.js | 3 + .../dist/assets/LibraryWorkspace-CT02q7ep.js | 3 - .../assets/MetadataViewerModal-CEAQlgmV.js | 1 - .../assets/MetadataViewerModal-zQM0uYbS.js | 1 + .../dist/assets/SettingsWorkspace-BaJRJ6EV.js | 1 + .../dist/assets/SettingsWorkspace-CZMkuJbF.js | 1 - .../dist/assets/VariantGroupsView-BT_Lf8GR.js | 1 + .../dist/assets/VariantGroupsView-BdO8HmPI.js | 1 - .../assets/WorkbenchWorkspace-CpFPCzJz.js | 1 + .../assets/WorkbenchWorkspace-KwG36plb.js | 1 - .../{boxes--0yaGReH.js => boxes-GTo8RUgH.js} | 2 +- .../{copy-Dp5BPX7F.js => copy-CoBcvjUE.js} | 2 +- ...nload-Bn9yrFnw.js => download-CSrVSIDj.js} | 2 +- ...lus-C2AXraiD.js => image-plus-C8PYGAuQ.js} | 2 +- gallery_ui/dist/assets/index-CKow1Wte.js | 13 + gallery_ui/dist/assets/index-DWGqjUOp.js | 13 - ...cw-CfRNSMuu.js => refresh-ccw-bV8xzBtF.js} | 2 +- .../{save-DFeVqt65.js => save-DQG0Zsqx.js} | 2 +- ...rkles-Bu6QFW9h.js => sparkles-elJjV352.js} | 2 +- ...-C_uDcQtj.js => wand-sparkles-262S5lQG.js} | 2 +- gallery_ui/dist/index.html | 2 +- gallery_ui/dist/release-version.json | 2 +- gallery_ui/package-lock.json | 603 +++++++++++++----- gallery_ui/package.json | 6 +- pyproject.toml | 2 +- 43 files changed, 881 insertions(+), 273 deletions(-) create mode 100644 docs/releases/1.8.0.json create mode 100644 docs/synchronization-performance.zh-CN.md create mode 100644 docs/validation/1.8.0-sync.json create mode 100644 gallery_ui/dist/assets/BoardShareModal-CNeucGS-.js delete mode 100644 gallery_ui/dist/assets/BoardShareModal-DrZ4X-PT.js create mode 100644 gallery_ui/dist/assets/DualFolderWorkspace-D8G_E4xN.js delete mode 100644 gallery_ui/dist/assets/DualFolderWorkspace-Dl7afjQz.js create mode 100644 gallery_ui/dist/assets/I18nProvider-DEfiLn3N.js delete mode 100644 gallery_ui/dist/assets/I18nProvider-cZczvL7B.js create mode 100644 gallery_ui/dist/assets/ImageDetailModal-Bv5UXO0m.js delete mode 100644 gallery_ui/dist/assets/ImageDetailModal-DaLI34MR.js create mode 100644 gallery_ui/dist/assets/ImageSearchModal-CH4E-SEH.js delete mode 100644 gallery_ui/dist/assets/ImageSearchModal-DZp0PXl_.js create mode 100644 gallery_ui/dist/assets/LibraryWorkspace-CPcrzo6d.js delete mode 100644 gallery_ui/dist/assets/LibraryWorkspace-CT02q7ep.js delete mode 100644 gallery_ui/dist/assets/MetadataViewerModal-CEAQlgmV.js create mode 100644 gallery_ui/dist/assets/MetadataViewerModal-zQM0uYbS.js create mode 100644 gallery_ui/dist/assets/SettingsWorkspace-BaJRJ6EV.js delete mode 100644 gallery_ui/dist/assets/SettingsWorkspace-CZMkuJbF.js create mode 100644 gallery_ui/dist/assets/VariantGroupsView-BT_Lf8GR.js delete mode 100644 gallery_ui/dist/assets/VariantGroupsView-BdO8HmPI.js create mode 100644 gallery_ui/dist/assets/WorkbenchWorkspace-CpFPCzJz.js delete mode 100644 gallery_ui/dist/assets/WorkbenchWorkspace-KwG36plb.js rename gallery_ui/dist/assets/{boxes--0yaGReH.js => boxes-GTo8RUgH.js} (92%) rename gallery_ui/dist/assets/{copy-Dp5BPX7F.js => copy-CoBcvjUE.js} (72%) rename gallery_ui/dist/assets/{download-Bn9yrFnw.js => download-CSrVSIDj.js} (71%) rename gallery_ui/dist/assets/{image-plus-C2AXraiD.js => image-plus-C8PYGAuQ.js} (82%) create mode 100644 gallery_ui/dist/assets/index-CKow1Wte.js delete mode 100644 gallery_ui/dist/assets/index-DWGqjUOp.js rename gallery_ui/dist/assets/{refresh-ccw-CfRNSMuu.js => refresh-ccw-bV8xzBtF.js} (79%) rename gallery_ui/dist/assets/{save-DFeVqt65.js => save-DQG0Zsqx.js} (80%) rename gallery_ui/dist/assets/{sparkles-Bu6QFW9h.js => sparkles-elJjV352.js} (86%) rename gallery_ui/dist/assets/{wand-sparkles-C_uDcQtj.js => wand-sparkles-262S5lQG.js} (87%) diff --git a/AGENTS.md b/AGENTS.md index 384bae2..6ab35e4 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -79,12 +79,17 @@ Before manually publishing to the Comfy registry, make sure the version in `pypr - `gallery_index.sqlite3` uses `PRAGMA user_version`, a `gallery_schema_migrations` audit table, WAL with a busy timeout, and derived tables including `gallery_images`, `gallery_index_meta`, `gallery_images_fts`, `gallery_image_color_family`, and `gallery_image_fingerprints`. The index is rebuildable; if the SQLite file looks corrupt, move it aside as `.corrupt-*` and rebuild instead of touching `gallery_state.json`. - `gallery_images` caches stable `asset_id` and `content_revision`; identity survives index rebuilds and plugin moves/trash/restore. JSON annotations remain authoritative. Never use duplicate hashes to merge identity or state. +- `gallery_fts_rows` maps paths to FTS rowids independently of image rowids. Update/delete FTS through this map; clear both on rebuild. Never delete FTS by its UNINDEXED path in a per-image loop. - `gallery_images` includes cached real image dimensions (`image_width`, `image_height`) exposed as optional frontend `width`/`height`. Missing dimensions are filled gradually and must not block listing. - `gallery_state.json` writes are locked and atomic. Legacy paths never recorded in the catalog retain conservative suffix recovery with a backup and target metadata priority. Paths already known to the catalog (including old namespaces/tombstones) never use suffix recovery: external moves leave old identity/state missing and create a new asset at the new location. - Pillow decode work for metadata, dimensions, thumbnails, and color analysis goes through `py/gallery/image_safety.py`. `UNIVERSAL_EXTRACTOR_MAX_IMAGE_PIXELS` defaults to `160000000`; `0` or empty leaves Pillow's default untouched. Oversized images should stay listable while derived metadata fails softly with diagnostics. - Variant fingerprints are rebuildable derived cache only: SHA-256 file hashes back exact duplicate groups, Pillow dHash backs near-duplicate groups, metadata hashes back same prompt/workflow groups, and filename sequence keys back series groups. They must not replace `gallery_state.json` user state. - `list_images_page()` should query SQLite directly and avoid loading every image into Python. -- HTTP context/folder queries read committed `gallery_folders` snapshots, including empty folders; only the scan lane traverses directory trees. Keep covering color-status and stable pagination indexes when evolving derived schema 10. +- HTTP context/folder queries read committed `gallery_folders` snapshots, including empty folders; only the scan lane traverses directory trees. Derived schema 11 caches image nanosecond mtimes. Preserve covering color-status and stable pagination indexes. Incremental scans collect folder metadata during the same traversal and synchronize identities only for changed observations, without a second physical stat pass. Scoped folder commits must preserve sibling scopes and inaccessible-source snapshots. +- `galleryJobMonitor.ts` is the sole application task observer, shared by status feedback and refresh waiters. `/jobs` returns an optional `revision`; `after` plus `wait_ms` asynchronously waits for changes without a read worker, with two-second fallback for older servers. Do not reinstate per-hook/per-job polling. Link feedback by explicit job ID, never guessed task kind, and reset quiet timing for a new job in a reused scope record. +- Backend completion discovery uses the injected ComfyUI `prompt_queue.get_history` reader, maps only bounded terminal output hints and primes historical IDs at startup. Do not wrap ComfyUI queue or socket methods. API clients' private completion events may never reach ordinary ComfyUI tabs. `/sync-status` is a visible-only one-second hint check; it never scans files or runs tasks. The optional same-origin `/sync-notifications` bridge and BroadcastChannel deduplicate with history discovery by prompt ID. Only validated registered-source scopes can trigger existing refresh jobs. Keep 15-second physical freshness fallback and the auto-sync preference. +- Refresh coalescing must respect output boot instance/sequence: a running scan cannot absorb a newer completion, but queued covering work can be upgraded. New output invalidates earlier shared frontend promises. Keep unchanged context collection identities and reuse the folder `Intl.Collator`; repeated folder sorting during a count update caused measurable main-thread stalls. +- Internal color/dimension backfills allow one running and one coalesced follow-up per kind/signature; never run duplicate same-kind whole-library backfills in parallel. Do not enqueue dimensions for a complete index. Pillow RGBA `get_flattened_data` can return pixel tuples, not scalar channels. - Reverse image search is `POST /images/search-by-image` (one multipart `image`, <=20 MB, minimum score 55–95). References stay in memory and never enter import/file transactions. Search all enabled sources independently of UI filters, using fingerprint v3 (SHA-256 + EXIF-normalized pHash/dHash/color/aspect). Full-library preparation reuses persistent `fingerprint_assets` with `whole_library: true`; never cap this path to recent items. Reference decode, ranking and backfill stay in analysis; ordinary read workers remain available. Results include asset ID and validated full path. Refuse stale physical nanosecond mtimes. Clipboard images may be re-encoded and should match visually, not necessarily by file hash. Keep the modal lazy, abort obsolete requests, and preserve it across resize. - `get_gallery_context()` should use SQLite aggregates for source counts, Pin count, subfolders, `subfolder_details`, and move targets; do not reintroduce full image-index reads for context. A forced context refresh must not rescan in `list_boards()`; board queries read only actual members, not every persisted state path. - `_sync_image_state_to_index_db()` compares saved state to indexed fields in <=900-bind batches and only rewrites changed rows and FTS helpers, including removed-state clearing. Fingerprint/prewarm path queries share `sqlite_batch.py` bounds. The live freshness scan still stats files for in-place edits, hashes in deterministic traversal order, and limits its scope cache to 32; keep the Settings switch to disable live polling on very large/slow sources. diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d94345..afd1e44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,39 @@ # Changelog +## 1.8.0 - 2026-10-23 + +### 同步与效率 +- 单次遍历同时更新图片和目录,只登记变化的资源身份,缓存纳秒时间并加速全文索引的局部更新。 +- 后端发现 API 客户端的工作流完成记录,不再依赖普通 ComfyUI 网页收到事件;明确输出目录时优先同步相关范围。 +- 任务中心与刷新等待共用变化通知,避免重复轮询、重复提示和旧任务隐藏状态影响新任务。 +- 复用未变化的卡片、目录与移动目标,复用自然排序器消除目录刷新热点;元数据回填保持布局,保护请求期间新建的选择。 + +### 可靠性修复 +- 修复新版 Pillow 的颜色像素解析错误,合并后台分析排队,不再创建空尺寸分析任务。 +- 新完成事件不会被更早的扫描吞掉;重复输出只保留必要的后续同步。 +- 保留单图、批量文件事务、资源 ID、图源权限和 LoRA Manager 行为。 + +### 候选版与升级 +- 此版本为本地验证候选,尚未自动推送 GitHub 或发布 Registry。 +- 部署前停止 ComfyUI,备份用户数据和未解决日志,完整替换代码及 dist,重启并刷新页面。 +- 目录库和用户 JSON 不迁移;派生索引升级到 schema 11,不要删除 catalog.sqlite3 或恢复日志。 + +### Synchronization and performance +- Collect image and folder snapshots in one traversal, register only changed identities, cache nanosecond mtimes, and update FTS rows through indexed row IDs. +- Discover API workflow completions on the backend without requiring an ordinary ComfyUI page to receive the event; reconcile known output scopes first. +- Share one change-driven task monitor between feedback and refresh waiters, avoiding duplicate polling, duplicate messages and stale hidden state. +- Reuse unchanged cards, folders and move targets plus one natural-sort collator, keep metadata backfill stable, and protect in-flight selections. + +### Reliability fixes +- Fix modern Pillow RGBA pixel extraction, coalesce analysis backlogs, and avoid empty dimension jobs. +- Do not acknowledge new workflow output through an older scan; merge only the necessary follow-up reconciliation. +- Preserve file journals, resource IDs, registered-source permissions and LoRA Manager behavior. + +### Candidate and upgrade notes +- This is a local validation candidate; no automatic GitHub push or Registry publication. +- Stop ComfyUI, back up user data and unresolved journals, replace code and the complete dist, restart, and refresh the pages. +- Catalog identities and user JSON remain unchanged. The derived index upgrades to schema 11; never delete catalog.sqlite3 or recovery evidence. + ## 1.7.0 - 2026-10-16 ### 主要变化 diff --git a/README.md b/README.md index 4ea0b00..059ded6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,14 @@ # ComfyUI Universal Extractor +## 1.8.0 · 同步与性能修复(本地候选) + +- 图片与目录只遍历一次,只同步变化的资源身份;加速全文索引局部更新。 +- 后端发现 API 跑图完成记录,图库不再依赖另一个 ComfyUI 网页收到事件。 +- 刷新与任务中心共用变化通知,修复重复提示、陈旧扫描吞掉新图和新版 Pillow 颜色分析失败。 +- 保持资源 ID、用户 JSON、文件事务和既有 ComfyUI/LoRA Manager 行为。 + +[排查、接口与验收说明](docs/synchronization-performance.zh-CN.md)。这是未发布候选,部署前须停止 ComfyUI,完整替换代码及 dist,再重启并刷新页面。 + ## 1.7.0 · 自动同步与日常体验优化 - ComfyUI 工作流完成后自动同步图库,保留整理位置;可见时每 15 秒检查遗漏。 diff --git a/docs/architecture.md b/docs/architecture.md index 5dade61..233bcd6 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -62,7 +62,7 @@ Runtime gallery data is stored under `data/`. User state remains JSON-backed, wh - `gallery_sources.json`: configured gallery sources. - `catalog.sqlite3`: authoritative identity and jobs (`assets`, `jobs`, `catalog_meta`, `catalog_migrations`), independent schema/backup, never deleted as a cache. Asset IDs survive index rebuilds and plugin moves/trash/restoration; duplicate content and external moves do not automatically merge identities. - `upload_journal/`: session-owned temporary upload recovery records. -- `gallery_index.sqlite3`: derived image index, schema 10 with cached asset IDs/content revisions, versioned fingerprints, committed `gallery_folders` snapshots and covering/stable-order indexes. Fingerprints include the search descriptor and physical nanosecond mtime. Hot context requests never traverse directories; initial upgrades may discover empty folders asynchronously after serving existing image rows. +- `gallery_index.sqlite3`: derived image index, schema 11 with cached asset IDs/content revisions and physical nanosecond mtimes, versioned fingerprints, committed `gallery_folders` snapshots and covering/stable-order indexes. Fingerprints also include the search descriptor and physical nanosecond mtime. Hot context requests never traverse directories; initial upgrades may discover empty folders asynchronously after serving existing image rows. - `library_summary_cache.json`: derived prompt-library counts keyed by filename, file size, and `mtime_ns`; it is runtime state, not a user library. - `thumb_cache/`: generated thumbnails. - `trash/`: plugin-managed trash storage. @@ -75,6 +75,7 @@ The important tables are: - `gallery_index_meta`: source signature, built timestamp, color index version, state digest, auxiliary-table version, and FTS availability. - `gallery_schema_migrations`: append-only migration audit rows recording schema version bumps. - `gallery_images_fts`: FTS5 search table for filename/path/title/category/notes text. If FTS5 is unavailable, search falls back to the existing LIKE expression. +- `gallery_fts_rows`: derived B-tree mapping from path to FTS rowid. Incremental updates delete FTS entries by rowid, avoiding a full scan per UNINDEXED path. Initialize existing rowids once; clear the map together with a full FTS rebuild, never reuse the unrelated `gallery_images` rowid. - `gallery_image_color_family`: normalized color-family rows used by color filtering, while legacy color fields remain in `gallery_images` for response compatibility. - `gallery_image_fingerprints`: local-only derived fingerprints used by variant organization. It stores file hashes, lightweight visual dHash values, prompt/workflow metadata hashes, filename sequence keys, and soft-failure diagnostics keyed by `relative_path`. @@ -86,14 +87,13 @@ HTTP image listing prepares its index outside the read pool, then uses `list_ima The first gallery load should use the existing SQLite index without `force_refresh=true`. Forced image refresh is reserved for user-triggered refreshes and freshness-detected changes, where the backend can prefer incremental sync over a full rebuild. -Automatic gallery sync is a two-step flow: +Automatic gallery sync shares the existing durable refresh coordinator with manual refresh. A visible gallery reads `/api/sync-status` once per second for bounded terminal output hints, discovered through the injected ComfyUI history reader or same-origin bridge. Browser broadcasts are an optional fast path. Prompt IDs deduplicate these transports; one-second bursts merge to a common registered-source scope. API clients with private sockets do not require an ordinary ComfyUI page. Startup history is primed without replaying old runs. -1. The frontend calls `/universal_gallery/api/images/freshness` for the current folder/source view while the page is visible. -2. If the fingerprint changed, the frontend calls `/api/images?force_refresh=true`; the backend performs incremental index sync when the existing DB signature is current. +Known output goes straight to a `refresh_index` job without an extra physical freshness scan. Refresh jobs capture the output boot instance/sequence: a running scan predating new output cannot satisfy it, while a queued covering scan can absorb the latest sequence. Frontend shared promises are invalidated by new output. Visible-only 15-second physical freshness remains the fallback for external file edits/old hosts; acknowledge its fingerprint only after successful synchronization. Initial indexed browsing is followed by an asynchronous reconciliation. The auto-sync preference controls all automatic paths. Incremental sync scans only the affected scope, upserts new or modified files, deletes missing files, and queues only changed paths for color backfill. Full rebuild remains the cold-start and repair fallback. Scan commits validate the source mutation generation; inaccessible subtrees do not become deletion signals. Identity is registered in bounded batches, independently of decoding; failed analysis remains soft. -`get_gallery_context()` avoids full image reads. It derives source counts, pinned count, subfolders, and move targets from SQLite aggregates plus lightweight directory discovery. Its forced refresh runs the index sync once; board summaries reuse the resulting database. `list_boards()` selects only actual indexed board members, ordered by creation time for automatic covers, rather than building a potentially over-limit `IN` query for every pinned/note state path. +`get_gallery_context()` avoids full image reads and directory discovery. It derives source counts, pinned count, subfolders, and move targets from committed SQLite snapshots. Its forced refresh awaits the shared index task; board summaries reuse the resulting database. `list_boards()` selects only actual indexed board members, ordered by creation time for automatic covers, rather than building a potentially over-limit `IN` query for every pinned/note state path. Frontend context snapshots retain unchanged collection identities so count updates do not invalidate folder/move calculations. Folder sorting reuses an `Intl.Collator` and one per-sort key cache instead of parsing pins/dates and constructing locale options for each comparison. Only the active tree or list presentation is built. The freshness endpoint still stats in-scope image files (file-in-place edits must be detectable); it now hashes in deterministic directory order without retaining the entire image record list. The in-process cache retains the 32 most recently visited scopes. Disabling live gallery refresh from Settings is appropriate for exceptionally large or slow network-mounted sources. @@ -195,9 +195,9 @@ Explicit gallery refresh waits for both context and image/trash requests to fini - `GET /universal_gallery/api/release-notes?locale=zh-CN|en`: installed `current_version`, `source`, and up to five `releases`, current first. Structured bilingual files ship in `docs/releases`; older CHANGELOG sections remain readable offline. `update-status` preserves old fields and adds `check_status` (`checked`, `cached`, `failed`, `preview`), `notes_source`, `last_success_at`. Remote calls share one in-flight check and cache successful results for 30 minutes. Safe Markdown uses React text, never raw HTML or remote images. - `GET /universal_gallery/api/images/locate?asset_id=...&limit=48&sort_by=created_at&sort_order=desc`: returns `asset_id`, `relative_path`, canonical parent `subfolder`, one-based `page`, zero-based page `index`, and `limit`. A legacy `relative_path` can replace the ID. Source resolution, namespace checks, same-origin guards and the list's stable SQL ordering apply. The folder page includes descendants, matching ordinary list semantics. -- ComfyUI extension listens to `execution_success`, terminal `executing`, `execution_error` and `execution_interrupted`. Channel `universal-extractor-gallery-events` carries `{version:1,type:"outputs-changed",prompt_id:string}` (1–200 chars); both ends deduplicate a bounded 256 prompt IDs. The current terminal event does not provide a trusted complete source list, so it conservatively refreshes all registered sources. No arbitrary path is accepted from an event. -- `useGalleryAutoSync` owns dirty generations, visible-only fallback checks, first-baseline reconciliation and 2s/10s retry for transient failures. `gallerySync` coalesces persistent scan jobs across manual and automatic callers, cancelling polling when all subscribers leave; submitted backend jobs retain their normal durable lifecycle. A new event during a scan requires a trailing sync. Fingerprints are acknowledged only after success. -- The global task observer polls every 2 seconds while visible and active jobs exist; startup/visibility/activity events discover jobs without permanent idle polling. UI feedback retains errors/active operations and at most 50 completed session records. Only registered cancellable scan/fingerprint jobs expose cancellation. Ordinary toast history is not persisted. +- ComfyUI extension listens to `execution_success`, terminal `executing`, `execution_error` and `execution_interrupted`. Channel `universal-extractor-gallery-events` carries `{version:1,type:"outputs-changed",prompt_id:string}` (1–200 chars); both ends deduplicate a bounded 256 prompt IDs. The bridge now relays bounded output folder hints through `/sync-notifications`; server validation maps them to registered-source scopes. Unknown scope falls back to all registered sources. No arbitrary path is accepted from an event. +- `useGalleryAutoSync` owns dirty generations, visible-only fallback checks, one initial all-source reconciliation even when an old folder is open, and 2s/10s retry for transient failures. `gallerySync` coalesces persistent scan jobs across manual and automatic callers, cancelling polling when all subscribers leave; submitted backend jobs retain their normal durable lifecycle. A new event during a scan requires a trailing sync. Fingerprints are acknowledged only after success. +- The global task observer and refresh waiters share one `galleryJobMonitor` subscription. Modern servers return a revision and wake one asynchronous long poll on task changes; older servers retain the visible-only two-second fallback. Waiting holds no query worker/SQLite transaction; no active jobs means no continuing task polling. UI feedback retains errors/active operations and at most 50 completed session records. Feedback links only explicit job IDs. Each new job resets its scope record's quiet timer and hidden state. Ordinary toast history is not persisted. - `UiPreferences.interfaceDensity` is optional for older callers and normalizes to `standard` or `compact`. It never changes saved column count. Shared dimensions set card gaps to 14/10px and estimated chrome to 50/44px, respectively. Image search retains its in-memory session through detail/locate; explicit close releases URLs and requests. - Virtual masonry measures its scroll margin below the toolbar, uses fixed estimated card heights, and shares actual cached lane positions with offscreen box selection. Media ratios remain stable for existing content versions during the loaded page; a new content version or page entry can use newly available dimensions. Width/density changes restore the visible asset and pixel offset. Browser anchoring is disabled for the virtual surface to avoid double correction. Thumbnail load/retry state is keyed by source URL/content version; cached complete images are recognized at attachment, prefetch waits for decode and does not clear successful sources. Placeholders are static and photos do not fade in on every mount. Legacy trash previews reserve a fixed 1/1.36 frame with `object-fit:contain` rather than growing CSS columns after decode. - Trash batches execute sequentially, stop at the first failed commit, retain unfinished selections and perform a single snapshot reload without forcing a source scan. Each file retains the existing recovery journal semantics. Refresh deduplication ignores the enqueue-time catalog generation: each attempt captures a fresh generation after acquiring the scan lock and validates it before commit. I/O/conflict retries remain bounded to three attempts in the same task. A terminal auto-sync failure blocks timer/focus retries for that scope and dirty generation; a user retry or new output permits another attempt. Historical refresh jobs coalesce into one UI record per scope rather than restoring a stack of identical failures. On scheduler startup, equivalent queued legacy refresh jobs retain only the newest executable request; older records become cancelled with a `superseded_by` result. No file-operation journal, asset identity or versioned analysis work is consolidated. diff --git a/docs/releases/1.8.0.json b/docs/releases/1.8.0.json new file mode 100644 index 0000000..0b7267c --- /dev/null +++ b/docs/releases/1.8.0.json @@ -0,0 +1,42 @@ +{ + "version": "1.8.0", + "date": "2026-10-23", + "locales": { + "zh-CN": [ + {"title": "同步与效率", "items": [ + "单次遍历同时更新图片和目录,只登记变化的资源身份,缓存纳秒时间并加速全文索引的局部更新。", + "后端发现 API 客户端的工作流完成记录,不再依赖普通 ComfyUI 网页收到事件;明确输出目录时优先同步相关范围。", + "任务中心与刷新等待共用变化通知,避免重复轮询、重复提示和旧任务隐藏状态影响新任务。", + "复用未变化的卡片、目录与移动目标,复用自然排序器消除目录刷新热点;元数据回填保持布局,保护请求期间新建的选择。" + ]}, + {"title": "可靠性修复", "items": [ + "修复新版 Pillow 的颜色像素解析错误,合并后台分析排队,不再创建空尺寸分析任务。", + "新完成事件不会被更早的扫描吞掉;重复输出只保留必要的后续同步。", + "保留单图、批量文件事务、资源 ID、图源权限和 LoRA Manager 行为。" + ]}, + {"title": "候选版与升级", "items": [ + "此版本为本地验证候选,尚未自动推送 GitHub 或发布 Registry。", + "部署前停止 ComfyUI,备份用户数据和未解决日志,完整替换代码及 dist,重启并刷新页面。", + "目录库和用户 JSON 不迁移;派生索引升级到 schema 11,不要删除 catalog.sqlite3 或恢复日志。" + ]} + ], + "en": [ + {"title": "Synchronization and performance", "items": [ + "Collect image and folder snapshots in one traversal, register only changed identities, cache nanosecond mtimes, and update FTS rows through indexed row IDs.", + "Discover API workflow completions on the backend without requiring an ordinary ComfyUI page to receive the event; reconcile known output scopes first.", + "Share one change-driven task monitor between feedback and refresh waiters, avoiding duplicate polling, duplicate messages and stale hidden state.", + "Reuse unchanged cards, folders and move targets plus one natural-sort collator, keep metadata backfill stable, and protect in-flight selections." + ]}, + {"title": "Reliability fixes", "items": [ + "Fix modern Pillow RGBA pixel extraction, coalesce analysis backlogs, and avoid empty dimension jobs.", + "Do not acknowledge new workflow output through an older scan; merge only the necessary follow-up reconciliation.", + "Preserve file journals, resource IDs, registered-source permissions and LoRA Manager behavior." + ]}, + {"title": "Candidate and upgrade notes", "items": [ + "This is a local validation candidate; no automatic GitHub push or Registry publication.", + "Stop ComfyUI, back up user data and unresolved journals, replace code and the complete dist, restart, and refresh the pages.", + "Catalog identities and user JSON remain unchanged. The derived index upgrades to schema 11; never delete catalog.sqlite3 or recovery evidence." + ]} + ] + } +} diff --git a/docs/synchronization-performance.zh-CN.md b/docs/synchronization-performance.zh-CN.md new file mode 100644 index 0000000..3c54118 --- /dev/null +++ b/docs/synchronization-performance.zh-CN.md @@ -0,0 +1,73 @@ +# 1.8.0 同步与性能修复:本地候选 + +基于已发布 1.7.0 的后续修复,仍保留 React/Vite、aiohttp、SQLite、用户 JSON、资源 ID 与文件事务。此文记录 1.8.0 候选源码的行为;不表示正在运行的 ComfyUI 已部署,也不替代正式版本发布说明。 + +## 排查结论 + +- 实际安装版本为 1.7.0,检查时已有 14,317 条在线索引。近期刷新任务从入队到完成约 6–20 秒;历史记录中还存在数分钟等待。这包含排队时间,不能作为单独的扫描耗时。 +- 增量刷新仍重复遍历目录并两次核对全库身份。当前改为一次目录遍历,同时记录图片和空目录;提交只处理变化的身份,复用已读取的纳秒 mtime。无变化不改写目录库,目录局部更新不删除其他范围快照。 +- 颜色分析记录中有 348 次像素类型错误。修正新版 Pillow 返回 RGBA 元组时的解析;尺寸完整时不再建立空任务。同种分析只运行一项,额外变化合并为一项后续任务。 +- 刷新等待与全局状态中心原本分别读取任务状态;设置和错误路径还会建立额外提示。现在共用一个监听器,以真实 job ID 关联记录,不再根据相同任务类型猜测归属。 +- 真实 ComfyUI 的 API 工作流完成事件可能只发给该 API 客户端;普通网页和 BroadcastChannel 都收不到。新后端从注入的 ComfyUI 完成历史读取紧凑的输出范围,不读取工作流模型参数,也不包裹或修改宿主方法。 + +## 同步和反馈 + +工作流完成历史、HTTP 桥接和浏览器广播按 prompt ID 去重。可见且启用自动同步的图库每秒读取轻量通知,合并一秒内的输出范围后提交一个公共父范围刷新。通知检查不遍历磁盘、不创建任务;初次历史只建基线。关闭同步或隐藏页面后暂停检查;外部文件和旧宿主仍保留 15 秒 freshness 兜底。 + +明确的完成通知不再先排一次 freshness 扫描。索引成功后并行读取页面与目录;相同快照复用原卡片和数组,不重建瀑布流。只有最新页、靠近顶部且没有选择/拖动/详情时自动替换;其他位置保留浏览状态。用户在请求期间新建的选择也受保护。元数据回填本身不显示“有新图片”。 + +首次校准覆盖所有已注册来源,避免首次打开旧文件夹时遗漏其他目录的旧完成记录。后续已知输出才缩小到对应范围。任务记录内部的输出进程标识和序号;比新输出更早启动的扫描不能替它确认成功,尚未执行的覆盖任务则可吸收最新序号。前端也会使较早的共享等待失效,保留必要的后续同步。 + +前端采样发现目录排序是插入新图时的主线程热点。当前复用一个自然排序器,每次排序只解析一次各目录的 Pin、日期和修改时间;只计算正在使用的树形或列表视图。未变化的目录、图版和移动目标保留对象引用。派生全文索引另用 `gallery_fts_rows` 保存路径到 FTS rowid 的映射,避免每个变化图片都按未索引的路径字段全表删除;全文重建时同时清空映射。 + +状态中心与刷新等待共用任务观察器。新服务通过变化版本唤醒异步等待,旧服务降级为每两秒查询;取消订阅不取消服务端工作,隐藏页面中断 HTTP,失败退避。浮层仍最多三条,后台维护延迟两秒显示,失败保留。新的任务不继承上一任务已经隐藏的状态或旧的等待时间。 + +## 兼容接口 + +| 接口 | 行为与限制 | +| --- | --- | +| `GET /universal_gallery/api/sync-status?since=N` | 只读通知快照,返回进程 instance、sequence 和事件;非负安全整数,最多保留 256 个 prompt,不写用户状态,不扫描文件 | +| `POST /universal_gallery/api/sync-notifications` | 同源 JSON:`version:1`、1–200 字符 `prompt_id`、最多 128 条 `outputs`;只消费 output/input/temp 的相对 subfolder,验证注册来源和路径边界,最多 32 个范围 | +| `GET /universal_gallery/api/jobs` | 原字段保留,新增 `revision`;可传 `after` 和 `wait_ms`(0–20000),最多 32 个异步等待者,不占查询线程 | + +只公开原有 `refresh_index` / `fingerprint_assets` 任务类型。新增通知不接收函数、命令或任意磁盘路径。来源离线、目录库故障和文件事务恢复门禁仍有效。目录库身份与用户 JSON 不迁移;派生索引通过现有迁移机制增加纳秒时间缓存。 + +## 验证方式和边界 + +运行 `scripts/verify.ps1`,并单独运行固定版本 LoRA Manager 集成。新增用例覆盖单次扫描/变化身份计数、同秒编辑、父范围合并、源权限、完成历史去重、无网页 API 工作流、共享任务监听、异步等待取消、陈旧 POST 响应和提示生命周期。 + +扫描优化阶段使用 `scripts/compare_refresh.py --baseline-root <1.7源码> --source <隔离PNG目录> --output artifacts/comparison.json`,在同一个只读物理目录上交替 A/B、B/A 运行,两边使用不同临时目录库。14,317 张生成 PNG,5 次预热、30 次采样,P95 使用 nearest-rank。旧基线为 `d83cba9`。此记录测量单次扫描和身份增量改造,早于之后的 FTS rowid、无用 URL 构造移除和前端排序改造;不是最终源码逐项重新采样的结果。 + +| 操作 | 1.7 P50 / P95 | 扫描优化阶段 P50 / P95 | +| --- | --- | --- | +| 全库刷新 | 2508 / 4275ms | 932 / 1876ms | +| 50 张图片的局部目录刷新 | 1370 / 3982ms | 70 / 241ms | +| 热列表查询 | 42 / 50ms | 42 / 49ms | +| 热上下文查询 | 122 / 138ms | 122 / 141ms | + +全库无变化时,身份登记从每次 28,634 项降为 0,目录访问从 578 降为 289;局部目录从 290 降为 1。两个普通查询的 P95 均在基线 120% 内。独立树的早期比较受 Windows 文件创建及并发负载影响,保留原始日志但不用于上述结论。`benchmark_refresh.py` 仍可单独创建样本;配对比较优先使用同一来源的 `compare_refresh.py`。 + +这些有效 PNG 均为 64×64 的相同生成小图;扫描比较关闭解码和分析。样本创建、首次建库不计入热刷新。它们不代表真实大原图解码、GPU 跑图耗时或任意磁盘吞吐。原始记录和中间失败日志保存在未提交的 `artifacts/`;可携带的汇总为 [1.8.0-sync.json](validation/1.8.0-sync.json)。 + +最终真实完成链路在独立 CPU ComfyUI、独立 input/output/data 中使用 LoadImage→SaveImage,不使用模型、不访问用户图源。普通 ComfyUI 网页关闭,通过无 `client_id` 的 API 连续提交 30 轮,开始时索引 14,399 项(输出 14,398、输入 1)。30 张新图全部入库、显示并解码,无手动刷新;服务端这段时间恰有 30 个成功刷新任务、0 个失败刷新。完成时间取宿主 `execution_success` 历史时间戳,显示取 DOM 新图片到达,解码取 `complete && naturalWidth > 0`。 + +| 最终候选指标 | P50 | P95 | 最大 | +| --- | --- | --- | --- | +| 完成→入库 | 2019ms | 2594ms | 2621ms | +| 完成→卡片显示 | 2232ms | 2811ms | 2895ms | +| 完成→缩略图解码 | 2324ms | 2893ms | 2995ms | + +这 30 轮中,PerformanceObserver 记录的 ≥50ms 主线程长任务为 **0**,浮动任务卡最多 **0**(短维护任务保持安静)。早期未完成目录排序优化的两组采样仍有每轮 50–176ms 的长任务,已保留作为定位证据。一次无变化的手动刷新只发出 1 次扫描 POST、1 次 context GET 和 1 次分页 GET;24 个已挂载图片框均无卸载/新增,未重建照片节点。长轮询进度请求、轻量完成通知和缩略图预热是不同用途,不应算作额外扫描。 + +| 验收范围 | 结果 | +| --- | --- | +| 后端、compileall | 171 项通过,编译通过 | +| 前端、类型、lint、i18n | 255 项通过,961 个翻译键审计通过 | +| ComfyUI 桥接 | LoRA 11 项、完成通知 2 项通过 | +| 固定上游 LoRA Manager | `0a262cbe0c0a773c174e6b4570c44671d6e2b9a3` 的 6 项通过 | +| 依赖、构建、dist、版本 | 0 个审计漏洞,26 个静态引用审计及 1.8.0 元数据检查通过 | +| 自动同步与浏览保护 | API 独立客户端、去重、进行中再次完成、取消/503/失败阻断、旧目录首次校准、共享监听及选择保护通过 | + +完整验证日志为 `artifacts/sync-core-1.8-final-verify.log`;最后的目录排序改造重新运行完整前端验证,日志为 `artifacts/sync-core-frontend-final.log`。最终宿主/浏览器逐轮记录为 `artifacts/sync-core-comfy-acceptance.json` 和 `artifacts/sync-core-browser-candidate.json`。无旧测试删除或跳过。真实用户原图库只做只读检查;安装目录仍运行旧版,本记录不宣称已经完成用户安装环境的部署后验收。 + +部署必须停止 ComfyUI,备份数据和未解决日志,完整替换源码及 dist,重启并刷新页面。不要覆盖用户 `data`,不要删除目录库或恢复日志。未收到明确发布指令时不推送、不改旧标签、不提交 Registry。 diff --git a/docs/validation/1.8.0-sync.json b/docs/validation/1.8.0-sync.json new file mode 100644 index 0000000..1a9235e --- /dev/null +++ b/docs/validation/1.8.0-sync.json @@ -0,0 +1,156 @@ +{ + "version": "1.8.0", + "date": "2026-10-23", + "status": "local_candidate", + "environment": { + "os": "Windows", + "python": "3.12.8", + "comfy_mode": "isolated CPU/offline, own plugin only", + "real_user_sources_modified": false + }, + "scan_comparison": { + "baseline_commit": "d83cba9", + "candidate_stage": "single-walk/changed-identity stage; before later FTS-rowid and unused-URL refinements", + "images": 14317, + "warmups": 5, + "samples": 30, + "method": "A/B and B/A alternating on same read-only generated 64x64 PNG tree; separate temp catalogs; decoding and analysis disabled", + "metrics": { + "all": { + "before": { + "p50_ms": 2508.3912000000055, + "p95_ms": 4274.6564999997645, + "counts": { + "ms": 4274.6564999997645, + "observed_assets": 28634, + "directory_visits": 578 + } + }, + "after": { + "p50_ms": 931.7863999995097, + "p95_ms": 1875.876299999618, + "counts": { + "ms": 1290.765800000372, + "observed_assets": 0, + "directory_visits": 289 + } + } + }, + "folder": { + "before": { + "p50_ms": 1369.7821499999918, + "p95_ms": 3981.710899999598, + "counts": { + "ms": 3122.6615999994465, + "observed_assets": 28634, + "directory_visits": 290 + } + }, + "after": { + "p50_ms": 70.18509999988964, + "p95_ms": 240.87650000001304, + "counts": { + "ms": 182.15049999980693, + "observed_assets": 0, + "directory_visits": 1 + } + } + }, + "list": { + "before": { + "p50_ms": 42.11390000000392, + "p95_ms": 49.68800000006013, + "counts": { + "ms": 36.489199999778066, + "observed_assets": 0, + "directory_visits": 0 + } + }, + "after": { + "p50_ms": 42.37534999992931, + "p95_ms": 48.76590000003489, + "counts": { + "ms": 36.44590000021708, + "observed_assets": 0, + "directory_visits": 0 + } + } + }, + "context": { + "before": { + "p50_ms": 122.03900000031354, + "p95_ms": 138.1562999995367, + "counts": { + "ms": 86.55679999992572, + "observed_assets": 0, + "directory_visits": 0 + } + }, + "after": { + "p50_ms": 122.00475000008737, + "p95_ms": 140.8638000002611, + "counts": { + "ms": 138.71910000034404, + "observed_assets": 0, + "directory_visits": 0 + } + } + } + } + }, + "final_comfy_workflow": { + "baseline_all_sources": 14399, + "rounds": 30, + "displayed": 30, + "decoded": 30, + "long_tasks_50ms": 0, + "max_floating_cards": 0, + "index_latency_ms": { + "p50": 2019.0, + "p95": 2594, + "max": 2621 + }, + "display_latency_ms": { + "p50": 2231.5, + "p95": 2811, + "max": 2895 + }, + "loaded_latency_ms": { + "p50": 2324.0, + "p95": 2893, + "max": 2995 + }, + "workflow": "API LoadImage -> SaveImage, no client_id, no ordinary ComfyUI page", + "refresh_jobs_succeeded": 30, + "refresh_jobs_failed": 0, + "source_hint_check_ms": 1000, + "coalescing_ms": 1000 + }, + "manual_refresh": { + "scan_post_requests": 1, + "context_get_requests": 1, + "page_get_requests": 1, + "mounted_image_shells_removed": 0, + "mounted_image_shells_added": 0, + "max_floating_cards": 0 + }, + "verification": { + "python_tests": 171, + "frontend_tests": 255, + "lora_bridge_tests": 11, + "completion_bridge_tests": 2, + "pinned_lora_upstream_tests": 6, + "security_vulnerabilities": 0, + "i18n_keys": 961, + "dist_references": 26, + "typecheck": true, + "lint": true, + "compileall": true, + "build": true, + "release_metadata": true + }, + "limits": [ + "Generated tiny images measure metadata scanning and synchronization, not full-resolution decoding or GPU throughput.", + "Real installed plugin remains 1.7.0 until ComfyUI is stopped and candidate code/dist are deployed." + ] +} diff --git a/gallery_ui/dist/.vite/manifest.json b/gallery_ui/dist/.vite/manifest.json index a32de5f..3742817 100644 --- a/gallery_ui/dist/.vite/manifest.json +++ b/gallery_ui/dist/.vite/manifest.json @@ -1,71 +1,71 @@ { - "_I18nProvider-cZczvL7B.js": { - "file": "assets/I18nProvider-cZczvL7B.js", + "_I18nProvider-DEfiLn3N.js": { + "file": "assets/I18nProvider-DEfiLn3N.js", "name": "I18nProvider" }, - "_boxes--0yaGReH.js": { - "file": "assets/boxes--0yaGReH.js", + "_boxes-GTo8RUgH.js": { + "file": "assets/boxes-GTo8RUgH.js", "name": "boxes", "imports": [ - "_I18nProvider-cZczvL7B.js" + "_I18nProvider-DEfiLn3N.js" ] }, - "_copy-Dp5BPX7F.js": { - "file": "assets/copy-Dp5BPX7F.js", + "_copy-CoBcvjUE.js": { + "file": "assets/copy-CoBcvjUE.js", "name": "copy", "imports": [ - "_I18nProvider-cZczvL7B.js" + "_I18nProvider-DEfiLn3N.js" ] }, - "_download-Bn9yrFnw.js": { - "file": "assets/download-Bn9yrFnw.js", + "_download-CSrVSIDj.js": { + "file": "assets/download-CSrVSIDj.js", "name": "download", "imports": [ - "_I18nProvider-cZczvL7B.js" + "_I18nProvider-DEfiLn3N.js" ] }, - "_image-plus-C2AXraiD.js": { - "file": "assets/image-plus-C2AXraiD.js", + "_image-plus-C8PYGAuQ.js": { + "file": "assets/image-plus-C8PYGAuQ.js", "name": "image-plus", "imports": [ - "_I18nProvider-cZczvL7B.js" + "_I18nProvider-DEfiLn3N.js" ] }, - "_refresh-ccw-CfRNSMuu.js": { - "file": "assets/refresh-ccw-CfRNSMuu.js", + "_refresh-ccw-bV8xzBtF.js": { + "file": "assets/refresh-ccw-bV8xzBtF.js", "name": "refresh-ccw", "imports": [ - "_I18nProvider-cZczvL7B.js" + "_I18nProvider-DEfiLn3N.js" ] }, - "_save-DFeVqt65.js": { - "file": "assets/save-DFeVqt65.js", + "_save-DQG0Zsqx.js": { + "file": "assets/save-DQG0Zsqx.js", "name": "save", "imports": [ - "_I18nProvider-cZczvL7B.js" + "_I18nProvider-DEfiLn3N.js" ] }, - "_sparkles-Bu6QFW9h.js": { - "file": "assets/sparkles-Bu6QFW9h.js", + "_sparkles-elJjV352.js": { + "file": "assets/sparkles-elJjV352.js", "name": "sparkles", "imports": [ - "_I18nProvider-cZczvL7B.js" + "_I18nProvider-DEfiLn3N.js" ] }, - "_wand-sparkles-C_uDcQtj.js": { - "file": "assets/wand-sparkles-C_uDcQtj.js", + "_wand-sparkles-262S5lQG.js": { + "file": "assets/wand-sparkles-262S5lQG.js", "name": "wand-sparkles", "imports": [ - "_I18nProvider-cZczvL7B.js" + "_I18nProvider-DEfiLn3N.js" ] }, "index.html": { - "file": "assets/index-DWGqjUOp.js", + "file": "assets/index-CKow1Wte.js", "name": "index", "src": "index.html", "isEntry": true, "imports": [ - "_I18nProvider-cZczvL7B.js" + "_I18nProvider-DEfiLn3N.js" ], "dynamicImports": [ "src/components/gallery/DualFolderWorkspace.tsx", @@ -83,40 +83,40 @@ ] }, "src/components/gallery/BoardShareModal.tsx": { - "file": "assets/BoardShareModal-DrZ4X-PT.js", + "file": "assets/BoardShareModal-CNeucGS-.js", "name": "BoardShareModal", "src": "src/components/gallery/BoardShareModal.tsx", "isDynamicEntry": true, "imports": [ - "_I18nProvider-cZczvL7B.js", - "_copy-Dp5BPX7F.js", - "_download-Bn9yrFnw.js", + "_I18nProvider-DEfiLn3N.js", + "_copy-CoBcvjUE.js", + "_download-CSrVSIDj.js", "index.html" ] }, "src/components/gallery/DualFolderWorkspace.tsx": { - "file": "assets/DualFolderWorkspace-Dl7afjQz.js", + "file": "assets/DualFolderWorkspace-D8G_E4xN.js", "name": "DualFolderWorkspace", "src": "src/components/gallery/DualFolderWorkspace.tsx", "isDynamicEntry": true, "imports": [ - "_I18nProvider-cZczvL7B.js", - "_refresh-ccw-CfRNSMuu.js", + "_I18nProvider-DEfiLn3N.js", + "_refresh-ccw-bV8xzBtF.js", "index.html", "src/components/gallery/MetadataViewerModal.tsx" ] }, "src/components/gallery/ImageDetailModal.tsx": { - "file": "assets/ImageDetailModal-DaLI34MR.js", + "file": "assets/ImageDetailModal-Bv5UXO0m.js", "name": "ImageDetailModal", "src": "src/components/gallery/ImageDetailModal.tsx", "isDynamicEntry": true, "imports": [ - "_I18nProvider-cZczvL7B.js", - "_sparkles-Bu6QFW9h.js", - "_boxes--0yaGReH.js", - "_copy-Dp5BPX7F.js", - "_save-DFeVqt65.js", + "_I18nProvider-DEfiLn3N.js", + "_boxes-GTo8RUgH.js", + "_copy-CoBcvjUE.js", + "_save-DQG0Zsqx.js", + "_sparkles-elJjV352.js", "index.html" ], "css": [ @@ -124,13 +124,13 @@ ] }, "src/components/gallery/ImageSearchModal.tsx": { - "file": "assets/ImageSearchModal-DZp0PXl_.js", + "file": "assets/ImageSearchModal-CH4E-SEH.js", "name": "ImageSearchModal", "src": "src/components/gallery/ImageSearchModal.tsx", "isDynamicEntry": true, "imports": [ - "_I18nProvider-cZczvL7B.js", - "_image-plus-C2AXraiD.js", + "_I18nProvider-DEfiLn3N.js", + "_image-plus-C8PYGAuQ.js", "index.html" ], "css": [ @@ -138,51 +138,51 @@ ] }, "src/components/gallery/MetadataViewerModal.tsx": { - "file": "assets/MetadataViewerModal-CEAQlgmV.js", + "file": "assets/MetadataViewerModal-zQM0uYbS.js", "name": "MetadataViewerModal", "src": "src/components/gallery/MetadataViewerModal.tsx", "isDynamicEntry": true, "imports": [ - "_I18nProvider-cZczvL7B.js", + "_I18nProvider-DEfiLn3N.js", "index.html" ] }, "src/components/gallery/VariantGroupsView.tsx": { - "file": "assets/VariantGroupsView-BdO8HmPI.js", + "file": "assets/VariantGroupsView-BT_Lf8GR.js", "name": "VariantGroupsView", "src": "src/components/gallery/VariantGroupsView.tsx", "isDynamicEntry": true, "imports": [ - "_I18nProvider-cZczvL7B.js", + "_I18nProvider-DEfiLn3N.js", "index.html" ] }, "src/components/library/LibraryWorkspace.tsx": { - "file": "assets/LibraryWorkspace-CT02q7ep.js", + "file": "assets/LibraryWorkspace-CPcrzo6d.js", "name": "LibraryWorkspace", "src": "src/components/library/LibraryWorkspace.tsx", "isDynamicEntry": true, "imports": [ - "_I18nProvider-cZczvL7B.js", - "_sparkles-Bu6QFW9h.js", - "_wand-sparkles-C_uDcQtj.js", - "_boxes--0yaGReH.js", - "_copy-Dp5BPX7F.js", - "_download-Bn9yrFnw.js", - "_refresh-ccw-CfRNSMuu.js", - "_save-DFeVqt65.js", + "_I18nProvider-DEfiLn3N.js", + "_boxes-GTo8RUgH.js", + "_copy-CoBcvjUE.js", + "_download-CSrVSIDj.js", + "_refresh-ccw-bV8xzBtF.js", + "_save-DQG0Zsqx.js", + "_sparkles-elJjV352.js", + "_wand-sparkles-262S5lQG.js", "index.html" ] }, "src/components/settings/SettingsWorkspace.tsx": { - "file": "assets/SettingsWorkspace-CZMkuJbF.js", + "file": "assets/SettingsWorkspace-BaJRJ6EV.js", "name": "SettingsWorkspace", "src": "src/components/settings/SettingsWorkspace.tsx", "isDynamicEntry": true, "imports": [ - "_I18nProvider-cZczvL7B.js", - "_image-plus-C2AXraiD.js", - "_save-DFeVqt65.js", + "_I18nProvider-DEfiLn3N.js", + "_image-plus-C8PYGAuQ.js", + "_save-DQG0Zsqx.js", "index.html" ], "css": [ @@ -190,15 +190,15 @@ ] }, "src/components/workbench/WorkbenchWorkspace.tsx": { - "file": "assets/WorkbenchWorkspace-KwG36plb.js", + "file": "assets/WorkbenchWorkspace-CpFPCzJz.js", "name": "WorkbenchWorkspace", "src": "src/components/workbench/WorkbenchWorkspace.tsx", "isDynamicEntry": true, "imports": [ - "_I18nProvider-cZczvL7B.js", - "_sparkles-Bu6QFW9h.js", - "_wand-sparkles-C_uDcQtj.js", - "_copy-Dp5BPX7F.js", + "_I18nProvider-DEfiLn3N.js", + "_copy-CoBcvjUE.js", + "_sparkles-elJjV352.js", + "_wand-sparkles-262S5lQG.js", "index.html" ], "css": [ diff --git a/gallery_ui/dist/assets/BoardShareModal-CNeucGS-.js b/gallery_ui/dist/assets/BoardShareModal-CNeucGS-.js new file mode 100644 index 0000000..27559fe --- /dev/null +++ b/gallery_ui/dist/assets/BoardShareModal-CNeucGS-.js @@ -0,0 +1 @@ +import{a as e,n as t,r as n,s as r}from"./I18nProvider-DEfiLn3N.js";import{t as i}from"./copy-CoBcvjUE.js";import{t as a}from"./download-CSrVSIDj.js";import{C as o,T as s,W as c,f as l}from"./index-CKow1Wte.js";var u=r(e(),1),d=n(),f=5,p=20,m=220,h=34,g=1224,_=1110,v=e=>new Promise((t,n)=>{let r=new Image;r.crossOrigin=`anonymous`,r.onload=()=>t(r),r.onerror=n,r.src=e}),y=(e,t,n,r,i,a)=>{let o=t.width/t.height,s=i/a,c=o>s?t.height*s:t.width,l=o>s?t.height:t.width/s,u=(t.width-c)/2,d=(t.height-l)/2;e.drawImage(t,u,d,c,l,n,r,i,a)},b=({open:e,board:n,onClose:r})=>{let{t:b}=t(),{pushToast:x}=l(),S=(0,u.useRef)(null),[C,w]=(0,u.useState)([]),[T,E]=(0,u.useState)(!1),[D,O]=(0,u.useState)(!1),k=n?.name??``,A=(0,u.useMemo)(()=>n?b(`boardShareSubtitle`,{count:n.count}):``,[n,b]);(0,u.useEffect)(()=>{if(!e||!n)return;let t=!1;return E(!0),o.listImages(1,p,``,``,``,n.id,``,``,!1,``,`created_at`,`desc`,!1).then(e=>{t||w(e.images??[])}).catch(e=>{t||x(e instanceof Error?e.message:b(`boardShareError`),`error`)}).finally(()=>{t||E(!1)}),()=>{t=!0}},[n,e,x,b]),(0,u.useEffect)(()=>{if(!e||!n||!S.current)return;let t=!1;return(async()=>{O(!0);let e=S.current;if(!e)return;e.width=g,e.height=_;let n=e.getContext(`2d`);if(!n)return;n.fillStyle=`#ffffff`,n.fillRect(0,0,g,_),n.fillStyle=`#18181b`,n.font=`700 46px Inter, Arial, sans-serif`,n.fillText(k,h,76,1156),n.fillStyle=`#71717a`,n.font=`500 22px Inter, Arial, sans-serif`,n.fillText(A,h,114,1156),n.fillStyle=`#f4f4f5`;for(let e=0;ev(e.thumb_url||e.url)));t||(r.forEach((e,t)=>{if(e.status!==`fulfilled`)return;let r=t%f,i=Math.floor(t/f),a=h+r*234,o=154+i*234;y(n,e.value,a,o,m,m)}),O(!1))})(),()=>{t=!0}},[n,C,e,A,k]);let j=()=>new Promise(e=>{S.current?.toBlob(t=>e(t),`image/png`,.94)}),M=async()=>{let e=await j();if(!e||!n)return;let t=URL.createObjectURL(e),r=document.createElement(`a`);r.href=t,r.download=`${n.name}-share.png`,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(t)},N=async()=>{let e=await j();if(!e||!(`ClipboardItem`in window))x(b(`contextCopyImageError`),`error`);else try{await navigator.clipboard.write([new ClipboardItem({"image/png":e})]),x(b(`contextCopyImageSuccess`),`success`)}catch{x(b(`contextCopyImageError`),`error`)}};return!e||!n?null:(0,d.jsx)(`div`,{className:`ue-modal-backdrop`,onClick:r,children:(0,d.jsxs)(`div`,{className:`ue-library-modal ue-board-share-modal`,onClick:e=>e.stopPropagation(),children:[(0,d.jsx)(`button`,{className:`ue-modal-close ue-modal-close--light`,onClick:r,"aria-label":b(`modalClose`),children:(0,d.jsx)(s,{size:18})}),(0,d.jsxs)(`div`,{className:`ue-pane-copy`,children:[(0,d.jsx)(`p`,{className:`ue-pane-kicker`,children:b(`boardShareTitle`)}),(0,d.jsx)(`h2`,{children:n.name}),(0,d.jsx)(`p`,{children:b(T||D?`commonLoading`:`boardShareText`)})]}),(0,d.jsx)(`div`,{className:`ue-board-share-preview`,children:C.length?(0,d.jsx)(`canvas`,{ref:S,"aria-label":b(`boardShareTitle`)}):(0,d.jsxs)(`div`,{className:`ue-gallery-state ue-gallery-state--empty`,children:[(0,d.jsx)(c,{size:32}),(0,d.jsx)(`p`,{children:b(T?`commonLoading`:`boardEmptyText`)})]})}),(0,d.jsxs)(`div`,{className:`ue-library-modal-actions`,children:[(0,d.jsx)(`button`,{className:`ue-icon-action`,onClick:r,"aria-label":b(`libraryCancel`),title:b(`libraryCancel`),children:(0,d.jsx)(s,{size:14})}),(0,d.jsx)(`button`,{className:`ue-icon-action`,onClick:()=>void N(),disabled:!C.length||D,"aria-label":b(`contextCopyImage`),title:b(`contextCopyImage`),children:(0,d.jsx)(i,{size:14})}),(0,d.jsx)(`button`,{className:`ue-icon-action ue-icon-action--filled`,onClick:()=>void M(),disabled:!C.length||D,"aria-label":b(`boardShareDownload`),title:b(`boardShareDownload`),children:(0,d.jsx)(a,{size:14})})]})]})})};export{b as BoardShareModal}; \ No newline at end of file diff --git a/gallery_ui/dist/assets/BoardShareModal-DrZ4X-PT.js b/gallery_ui/dist/assets/BoardShareModal-DrZ4X-PT.js deleted file mode 100644 index 7973c97..0000000 --- a/gallery_ui/dist/assets/BoardShareModal-DrZ4X-PT.js +++ /dev/null @@ -1 +0,0 @@ -import{a as e,n as t,r as n,s as r}from"./I18nProvider-cZczvL7B.js";import{t as i}from"./copy-Dp5BPX7F.js";import{t as a}from"./download-Bn9yrFnw.js";import{B as o,C as s,T as c,f as l}from"./index-DWGqjUOp.js";var u=r(e(),1),d=n(),f=5,p=f*4,m=220,h=34,g=1224,_=1110,v=e=>new Promise((t,n)=>{let r=new Image;r.crossOrigin=`anonymous`,r.onload=()=>t(r),r.onerror=n,r.src=e}),y=(e,t,n,r,i,a)=>{let o=t.width/t.height,s=i/a,c=o>s?t.height*s:t.width,l=o>s?t.height:t.width/s,u=(t.width-c)/2,d=(t.height-l)/2;e.drawImage(t,u,d,c,l,n,r,i,a)},b=({open:e,board:n,onClose:r})=>{let{t:b}=t(),{pushToast:x}=l(),S=(0,u.useRef)(null),[C,w]=(0,u.useState)([]),[T,E]=(0,u.useState)(!1),[D,O]=(0,u.useState)(!1),k=n?.name??``,A=(0,u.useMemo)(()=>n?b(`boardShareSubtitle`,{count:n.count}):``,[n,b]);(0,u.useEffect)(()=>{if(!e||!n)return;let t=!1;return E(!0),s.listImages(1,p,``,``,``,n.id,``,``,!1,``,`created_at`,`desc`,!1).then(e=>{t||w(e.images??[])}).catch(e=>{t||x(e instanceof Error?e.message:b(`boardShareError`),`error`)}).finally(()=>{t||E(!1)}),()=>{t=!0}},[n,e,x,b]),(0,u.useEffect)(()=>{if(!e||!n||!S.current)return;let t=!1;return(async()=>{O(!0);let e=S.current;if(!e)return;e.width=g,e.height=_;let n=e.getContext(`2d`);if(!n)return;n.fillStyle=`#ffffff`,n.fillRect(0,0,g,_),n.fillStyle=`#18181b`,n.font=`700 46px Inter, Arial, sans-serif`,n.fillText(k,h,76,g-h*2),n.fillStyle=`#71717a`,n.font=`500 22px Inter, Arial, sans-serif`,n.fillText(A,h,114,g-h*2),n.fillStyle=`#f4f4f5`;for(let e=0;ev(e.thumb_url||e.url)));t||(r.forEach((e,t)=>{if(e.status!==`fulfilled`)return;let r=t%f,i=Math.floor(t/f),a=h+r*234,o=154+i*234;y(n,e.value,a,o,m,m)}),O(!1))})(),()=>{t=!0}},[n,C,e,A,k]);let j=()=>new Promise(e=>{S.current?.toBlob(t=>e(t),`image/png`,.94)}),M=async()=>{let e=await j();if(!e||!n)return;let t=URL.createObjectURL(e),r=document.createElement(`a`);r.href=t,r.download=`${n.name}-share.png`,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(t)},N=async()=>{let e=await j();if(!e||!(`ClipboardItem`in window)){x(b(`contextCopyImageError`),`error`);return}try{await navigator.clipboard.write([new ClipboardItem({"image/png":e})]),x(b(`contextCopyImageSuccess`),`success`)}catch{x(b(`contextCopyImageError`),`error`)}};return!e||!n?null:(0,d.jsx)(`div`,{className:`ue-modal-backdrop`,onClick:r,children:(0,d.jsxs)(`div`,{className:`ue-library-modal ue-board-share-modal`,onClick:e=>e.stopPropagation(),children:[(0,d.jsx)(`button`,{className:`ue-modal-close ue-modal-close--light`,onClick:r,"aria-label":b(`modalClose`),children:(0,d.jsx)(c,{size:18})}),(0,d.jsxs)(`div`,{className:`ue-pane-copy`,children:[(0,d.jsx)(`p`,{className:`ue-pane-kicker`,children:b(`boardShareTitle`)}),(0,d.jsx)(`h2`,{children:n.name}),(0,d.jsx)(`p`,{children:b(T||D?`commonLoading`:`boardShareText`)})]}),(0,d.jsx)(`div`,{className:`ue-board-share-preview`,children:C.length?(0,d.jsx)(`canvas`,{ref:S,"aria-label":b(`boardShareTitle`)}):(0,d.jsxs)(`div`,{className:`ue-gallery-state ue-gallery-state--empty`,children:[(0,d.jsx)(o,{size:32}),(0,d.jsx)(`p`,{children:b(T?`commonLoading`:`boardEmptyText`)})]})}),(0,d.jsxs)(`div`,{className:`ue-library-modal-actions`,children:[(0,d.jsx)(`button`,{className:`ue-icon-action`,onClick:r,"aria-label":b(`libraryCancel`),title:b(`libraryCancel`),children:(0,d.jsx)(c,{size:14})}),(0,d.jsx)(`button`,{className:`ue-icon-action`,onClick:()=>void N(),disabled:!C.length||D,"aria-label":b(`contextCopyImage`),title:b(`contextCopyImage`),children:(0,d.jsx)(i,{size:14})}),(0,d.jsx)(`button`,{className:`ue-icon-action ue-icon-action--filled`,onClick:()=>void M(),disabled:!C.length||D,"aria-label":b(`boardShareDownload`),title:b(`boardShareDownload`),children:(0,d.jsx)(a,{size:14})})]})]})})};export{b as BoardShareModal}; \ No newline at end of file diff --git a/gallery_ui/dist/assets/DualFolderWorkspace-D8G_E4xN.js b/gallery_ui/dist/assets/DualFolderWorkspace-D8G_E4xN.js new file mode 100644 index 0000000..398ec5c --- /dev/null +++ b/gallery_ui/dist/assets/DualFolderWorkspace-D8G_E4xN.js @@ -0,0 +1 @@ +import{a as e,i as t,n,r,s as i}from"./I18nProvider-DEfiLn3N.js";import{t as a}from"./refresh-ccw-bV8xzBtF.js";import{B as o,C as s,D as c,G as l,J as u,L as d,M as f,N as p,O as m,Q as ee,S as h,X as te,Z as g,_ as ne,c as _,ct as re,et as ie,f as ae,g as v,h as oe,i as se,it as y,k as ce,l as le,lt as ue,m as de,n as fe,o as pe,ot as me,p as he,r as ge,rt as _e,s as ve,st as ye,u as be,ut as xe,w as Se}from"./index-CKow1Wte.js";import{MetadataViewerModal as Ce}from"./MetadataViewerModal-zQM0uYbS.js";var b=t(`move-right`,[[`path`,{d:`M18 8L22 12L18 16`,key:`1r0oui`}],[`path`,{d:`M2 12H22`,key:`1m8cig`}]]),we=t(`move-left`,[[`path`,{d:`M6 8L2 12L6 16`,key:`kyvwex`}],[`path`,{d:`M2 12H22`,key:`1m8cig`}]]),x=i(e(),1),S=r(),C=e=>{let t=Number(e.width??0),n=Number(e.height??0);return t>0&&n>0?`${t} × ${n}`:``},Te=({image:e,selected:t,focused:r,draggedPaths:i,deselectLabel:a,onClick:o,onDoubleClick:s,onContextMenu:c,onDragStart:l,onDragEnd:u,onToggleSelected:d})=>{let{locale:f}=n(),p=C(e);return(0,S.jsxs)(`article`,{className:`ue-dual-card ${t?`is-selected`:``} ${r?`is-focused`:``}`,draggable:!0,onClick:o,onDoubleClick:s,onContextMenu:c,onDragStart:e=>l(e,i),onDragEnd:u,children:[(0,S.jsx)(`button`,{className:`ue-dual-card-preview`,type:`button`,tabIndex:-1,children:(0,S.jsx)(`img`,{src:fe(e),alt:e.title||e.filename,loading:`lazy`,decoding:`async`})}),(0,S.jsxs)(`div`,{className:`ue-dual-card-copy`,children:[(0,S.jsxs)(`div`,{className:`ue-dual-card-heading`,children:[(0,S.jsx)(`strong`,{title:e.filename,children:e.filename}),p?(0,S.jsx)(`span`,{className:`ue-dual-card-resolution`,children:p}):null]}),(0,S.jsxs)(`span`,{className:`ue-dual-card-meta`,children:[le(e.created_at,f),(0,S.jsx)(`i`,{"aria-hidden":`true`,children:`/`}),be(e.size)]}),e.title?(0,S.jsx)(`em`,{title:e.title,children:e.title}):null]}),t?(0,S.jsx)(`button`,{className:`ue-dual-card-check`,type:`button`,"aria-label":a,title:a,onClick:e=>{e.stopPropagation(),d()},onDoubleClick:e=>e.stopPropagation(),children:(0,S.jsx)(y,{size:16})}):null]})},Ee=`application/x-universal-gallery-image`,De=()=>({selectedPaths:[],focusedPath:``,lastSelectedPath:``}),Oe=e=>Array.from(e).includes(Ee),ke=e=>e===`left`||e===`right`,Ae=e=>{if(!e||typeof e!=`object`)return!1;let t=e;return ke(t.from)&&Array.isArray(t.relativePaths)&&t.relativePaths.every(e=>typeof e==`string`&&e.trim().length>0)&&!!(t.image&&typeof t.image==`object`&&typeof t.image.relative_path==`string`)&&typeof t.sourceFolder==`string`},je=e=>{try{let t=e(Ee);if(!t)return null;let n=JSON.parse(t);return Ae(n)?n:null}catch{return null}},Me=({current:e,paths:t,path:n,shiftKey:r,toggleKey:i})=>{if(r&&e.lastSelectedPath){let r=t.indexOf(e.lastSelectedPath),i=t.indexOf(n);if(r!==-1&&i!==-1){let[a,o]=re!==n):[...e.selectedPaths,n],focusedPath:n,lastSelectedPath:n}:{selectedPaths:[n],focusedPath:n,lastSelectedPath:n}},Ne=(e,t)=>{let n=new Set(t.selectedPaths),r=e.filter(e=>!n.has(e));return{selectedPaths:r,focusedPath:r[0]||t.focusedPath,lastSelectedPath:r[0]||t.lastSelectedPath}},Pe=(e,t)=>{let n=t.selectedPaths.includes(e),r=n?t.selectedPaths.filter(t=>t!==e):[...t.selectedPaths,e];return{selectedPaths:r,focusedPath:n?r.at(-1)??``:e,lastSelectedPath:n?t.lastSelectedPath:e}},Fe=e=>{let t=e.key.toLowerCase();return(e.ctrlKey||e.metaKey)&&t===`a`?`selectAll`:(e.ctrlKey||e.metaKey)&&t===`m`?`moveToOtherPane`:(e.ctrlKey||e.metaKey)&&t===`r`?`refresh`:e.key===`Escape`?`escape`:e.key===`Delete`?`delete`:e.key===`Enter`?`openDetail`:e.key===`Tab`?`togglePane`:null},Ie=80,w=()=>({scopeKey:``,images:[],total:0,loading:!1,error:``}),T=(e,t)=>{let{sourceId:n}=v(e);return t?.sources.find(e=>e.id===n)},E=(e,t,n)=>de(e,t?.sources??[],(e,t)=>e?.kind===`output`?n(`sidebarOutputSource`):e?.kind===`input`?n(`sidebarInputSource`):e?.name||t),Le=(e,t,n)=>{let{sourceId:r,relativePath:i}=v(e),a=t?.sources.find(e=>e.id===r),o=a?.kind===`output`?n(`sidebarOutputSource`):a?.kind===`input`?n(`sidebarInputSource`):a?.name||r,s=i.split(`/`).filter(Boolean);return{value:e,label:s.at(-1)||`./`,parent:s.length>1?s.slice(0,-1).join(`/`):o,sourceName:o,searchText:`${E(e,t,n)} ${o} ${i}`.toLowerCase()}},Re=e=>{let{sourceId:t,relativePath:n}=v(e);return{targetSourceId:t,targetSubfolder:n}},ze=({label:e,value:t,options:r,onChange:i,emptyText:a})=>{let{t:o}=n(),[s,c]=(0,x.useState)(!1),[l,d]=(0,x.useState)(``),[f,m]=(0,x.useState)(0),ee=(0,x.useRef)(null),h=r.find(e=>e.value===t)??r[0],te=l.trim().toLowerCase(),g=te?r.filter(e=>e.searchText.includes(te)):r;(0,x.useEffect)(()=>{if(!s)return;let e=e=>{ee.current?.contains(e.target)||(c(!1),d(``))};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[s]),(0,x.useEffect)(()=>{m(0)},[l,s]);let ne=e=>{e&&(i(e.value),c(!1),d(``))};return(0,S.jsxs)(`div`,{className:`ue-folder-combobox`,ref:ee,children:[(0,S.jsxs)(`button`,{className:`ue-folder-combobox-trigger ${s?`is-open`:``}`,type:`button`,onClick:()=>c(e=>!e),"aria-label":e,children:[(0,S.jsx)(u,{size:14}),(0,S.jsxs)(`span`,{children:[(0,S.jsx)(`strong`,{children:h?.label??`./`}),h?.parent?(0,S.jsx)(`em`,{children:h.parent}):null]}),(0,S.jsx)(_e,{size:14})]}),s?(0,S.jsxs)(`div`,{className:`ue-folder-combobox-menu`,children:[(0,S.jsxs)(`label`,{className:`ue-folder-combobox-search`,children:[(0,S.jsx)(p,{size:14}),(0,S.jsx)(`input`,{autoFocus:!0,value:l,onChange:e=>d(e.target.value),onKeyDown:e=>{e.key===`Escape`?(c(!1),d(``)):e.key===`ArrowDown`?(e.preventDefault(),m(e=>Math.min(e+1,g.length-1))):e.key===`ArrowUp`?(e.preventDefault(),m(e=>Math.max(e-1,0))):e.key===`Enter`&&(e.preventDefault(),ne(g[f]))},placeholder:o(`sidebarFolderSearch`)})]}),(0,S.jsx)(`div`,{className:`ue-folder-combobox-list`,role:`listbox`,"aria-label":e,children:g.length?g.map((e,n)=>(0,S.jsxs)(`button`,{className:`${e.value===t?`is-selected`:``} ${n===f?`is-active`:``}`,type:`button`,onMouseEnter:()=>m(n),onClick:()=>ne(e),role:`option`,"aria-selected":e.value===t,children:[(0,S.jsx)(u,{size:14}),(0,S.jsxs)(`span`,{children:[(0,S.jsx)(`strong`,{children:e.label}),(0,S.jsx)(`em`,{children:e.parent})]})]},e.value)):(0,S.jsx)(`div`,{className:`ue-folder-combobox-empty`,children:a})})]}):null]})},Be=({onExit:e,context:t,initialFolder:r,sortBy:i,sortOrder:p,boards:v,onOpenDetail:y,onSelectionChange:le,onVisibleImagesChange:de,inspectorClearSignal:fe,onOpenWorkflow:_e,onMoveImages:C,onDeleteImages:ke,onUpdateImageState:Ae,onCreateBoard:Be,onUpdateBoardPins:Ve})=>{let{t:D,locale:He}=n(),{confirm:O}=ne(),{pushToast:k}=ae(),{runOperation:A}=Se(),j=(0,x.useMemo)(()=>({title:D(`dual_title`),hint:D(`dual_hint`),left:D(`dual_left`),right:D(`dual_right`),selected:e=>D(`dual_selected`,{count:e}),selectAll:D(`dual_selectAll`),invertSelection:D(`dual_invertSelection`),clearSelection:D(`dual_clearSelection`),refresh:D(`dual_refresh`),moveOther:D(`dual_moveOther`),dropHint:D(`dual_dropHint`),readOnly:D(`dual_readOnly`),empty:D(`dual_empty`),loading:D(`dual_loading`),moving:D(`dual_moving`),moved:D(`dual_moved`),moveConfirmTitle:D(`dual_moveConfirmTitle`),moveConfirm:(e,t)=>D(`dual_moveConfirm`,{count:e,target:t}),pinConfirm:e=>D(`dual_pinConfirm`,{count:e}),unpinConfirm:e=>D(`dual_unpinConfirm`,{count:e}),addToBoardConfirm:(e,t)=>D(`dual_addToBoardConfirm`,{count:e,target:t}),sameFolder:D(`dual_sameFolder`),noMatch:D(`dual_noMatch`),loadError:D(`dual_loadError`),moveError:D(`dual_moveError`),openDetail:D(`dual_openDetail`),openFull:D(`dual_openFull`),openWorkflow:D(`dual_openWorkflow`),metadata:D(`dual_metadata`),copyImage:D(`dual_copyImage`),copyFilename:D(`dual_copyFilename`),copyPath:D(`dual_copyPath`),copyPrompt:D(`dual_copyPrompt`),copySuccess:D(`dual_copySuccess`),copyImageSuccess:D(`dual_copyImageSuccess`),copyError:D(`dual_copyError`),promptMissing:D(`dual_promptMissing`),select:D(`dual_select`),deselect:D(`dual_deselect`),pin:D(`dual_pin`),unpin:D(`dual_unpin`),addToBoard:D(`dual_addToBoard`),delete:D(`dual_delete`),deleteTitle:D(`dual_deleteTitle`),deleteMessage:e=>D(`dual_deleteMessage`,{count:e}),deleteSuccess:D(`dual_deleteSuccess`),deleteError:D(`dual_deleteError`),metadataError:D(`dual_metadataError`),swapFolders:D(`dual_swapFolders`),moveToRight:D(`dual_moveToRight`),moveToLeft:D(`dual_moveToLeft`),refreshBoth:D(`dual_refreshBoth`)}),[D]),M=(0,x.useMemo)(()=>{let e=new Set;for(let n of t?.sources??[])n.enabled&&n.exists&&e.add(oe(n.id));for(let n of t?.subfolders??[])e.add(n);return[...e].sort((e,n)=>E(e,t,D).localeCompare(E(n,t,D),He,{numeric:!0,sensitivity:`base`}))},[t,D,He]),Ue=(0,x.useMemo)(()=>M.map(e=>Le(e,t,D)),[t,M,D]),We=oe(he),N=r&&r!==`__trash__`?r:We,Ge=M.find(e=>e!==N)??N,[P,Ke]=(0,x.useState)(N),[F,qe]=(0,x.useState)(Ge),[I,Je]=(0,x.useState)(()=>w()),[L,Ye]=(0,x.useState)(()=>w()),[R,Xe]=(0,x.useState)(()=>De()),[Ze,Qe]=(0,x.useState)(()=>De()),[$e,z]=(0,x.useState)(`left`),[et,tt]=(0,x.useState)(null),[nt,rt]=(0,x.useState)(``),[B,it]=(0,x.useState)(!1),at=(0,x.useRef)(!1),V=(0,x.useRef)({left:0,right:0}),ot=(0,x.useRef)({left:1,right:1}),st=(0,x.useRef)(void 0);(0,x.useEffect)(()=>()=>{V.current.left++,V.current.right++,window.clearTimeout(st.current)},[]);let[ct,lt]=(0,x.useState)(!1),[H,ut]=(0,x.useState)(null),[U,dt]=(0,x.useState)([]),[ft,pt]=(0,x.useState)(null),W=(0,x.useCallback)(e=>{let t=e===`left`?I:L,n=e===`left`?P:F;return t.scopeKey===JSON.stringify([n,i,p])?t:{...w(),loading:!0}},[P,I,F,L,i,p]),G=(0,x.useCallback)(e=>e===`left`?P:F,[P,F]),K=(0,x.useCallback)(e=>e===`left`?R:Ze,[R,Ze]),q=(0,x.useCallback)((e,t)=>{e===`left`?Xe(t):Qe(t)},[]),J=(0,x.useCallback)(e=>{q(e,()=>De())},[q]),mt=(0,x.useMemo)(()=>{let e=I.scopeKey===JSON.stringify([P,i,p])?I.images:[],t=L.scopeKey===JSON.stringify([F,i,p])?L.images:[];return[...new Map([...e,...t].map(e=>[e.relative_path,e])).values()]},[P,I.images,I.scopeKey,F,L.images,L.scopeKey,i,p]);(0,x.useEffect)(()=>{de?.(mt)},[de,mt]),(0,x.useEffect)(()=>{let e=new Set(mt.map(e=>e.relative_path));le?.([...new Set([...R.selectedPaths,...Ze.selectedPaths])].filter(t=>e.has(t)))},[R.selectedPaths,le,Ze.selectedPaths,mt]),(0,x.useEffect)(()=>{fe&&(J(`left`),J(`right`))},[J,fe]),(0,x.useEffect)(()=>{N&&Ke(N)},[N]),(0,x.useEffect)(()=>{M.includes(F)||qe(M.find(e=>e!==P)??P)},[M,P,F]),(0,x.useEffect)(()=>{J(`left`)},[P,J]),(0,x.useEffect)(()=>{J(`right`)},[F,J]);let Y=(0,x.useCallback)(async(e,t,n=!1,r=!1)=>{let a=++V.current[e],o=JSON.stringify([t,i,p]),c=r?ot.current[e]+1:1,l=e===`left`?Je:Ye;l(e=>({...e.scopeKey===o?e:w(),scopeKey:o,loading:!0,error:``}));try{let u=await s.listImages(c,Ie,``,``,t,``,``,``,!1,``,i,p,n);if(a!==V.current[e])return;ot.current[e]=c,l(e=>({scopeKey:o,images:r?[...new Map([...e.images,...u.images].map(e=>[e.relative_path,e])).values()]:u.images,total:u.total,loading:!1,error:``}))}catch{if(a!==V.current[e])return;l(e=>({...e,loading:!1,error:j.loadError}))}},[i,p,j.loadError]),X=(0,x.useCallback)(async(e=!0)=>{await Promise.all([Y(`left`,P,e),Y(`right`,F,e)])},[P,Y,F]);(0,x.useEffect)(()=>{let e=()=>lt(!0);return window.addEventListener(`universal-gallery:index-synced`,e),()=>window.removeEventListener(`universal-gallery:index-synced`,e)},[]),(0,x.useEffect)(()=>{let e=()=>{X(!1)};return window.addEventListener(`universal-gallery:files-changed`,e),()=>window.removeEventListener(`universal-gallery:files-changed`,e)},[X]),(0,x.useEffect)(()=>{Y(`left`,P)},[P,Y]),(0,x.useEffect)(()=>{Y(`right`,F)},[F,Y]);let Z=(0,x.useCallback)((e,t=1800)=>{window.clearTimeout(st.current),rt(e),t>0&&(st.current=window.setTimeout(()=>rt(``),t))},[]),ht=(0,x.useCallback)((e,t)=>{let n=K(e);return n.selectedPaths.includes(t.relative_path)&&n.selectedPaths.length>1?n.selectedPaths:[t.relative_path]},[K]),gt=(e,t,n)=>{let r=W(e),i=t.relative_path,a=r.images.map(e=>e.relative_path);z(e),q(e,e=>Me({current:e,paths:a,path:i,shiftKey:n.shiftKey,toggleKey:n.ctrlKey||n.metaKey}))},_t=(0,x.useCallback)(e=>{let t=W(e).images.map(e=>e.relative_path);z(e),q(e,e=>({selectedPaths:t,focusedPath:e.focusedPath||t[0]||``,lastSelectedPath:e.lastSelectedPath||t[0]||``}))},[W,q]),vt=e=>{let t=W(e).images.map(e=>e.relative_path);z(e),q(e,e=>Ne(t,e))},yt=(e,t)=>{let n=t.relative_path;z(e),q(e,e=>Pe(n,e))},bt=(0,x.useCallback)(async(e,n,r)=>{let i=G(r);if(!e.length)return;if(i===n){Z(j.sameFolder,1200);return}let a=T(i,t);if(!T(n,t)?.writable||!a?.writable)Z(j.readOnly);else if(!at.current){at.current=!0,it(!0);try{if(!await O({title:j.moveConfirmTitle,message:D(`qolMoveConfirm`,{count:e.length,source:E(n,t,D),target:E(i,t,D)}),tone:`warning`,confirmLabel:D(`commonMove`),cancelLabel:D(`libraryCancel`)}))return;Z(D(`qolMoveBusy`),0);let{targetSourceId:a,targetSubfolder:o}=Re(i),s=await A(()=>C(e,o,a),{pending:D(`operationMoveImages`),success:t=>{let{unaccounted:n}=_(e,t);return[D(`qolMoveResult`,{moved:t.moved.length,missing:t.missing.length,blocked:t.blocked?.length??0}),t.unchanged?.length?D(`operationMoveUnchanged`,{count:t.unchanged.length}):``,n?D(`operationUnaccounted`,{count:n}):``].filter(Boolean).join(` `)},successTone:t=>_(e,t).complete?`success`:`error`,successRetry:r=>h({paths:_(e,r).failedPaths,confirm:O,confirmation:e=>({title:j.moveConfirmTitle,message:D(`qolMoveConfirm`,{count:e,source:E(n,t,D),target:E(i,t,D)}),tone:`warning`,confirmLabel:D(`commonMove`),cancelLabel:D(`libraryCancel`)}),execute:e=>C(e,o,a),failed:(e,t)=>_(e,t).failedPaths,summary:(e,t)=>D(`qolMoveResult`,{moved:t.moved.length,missing:t.missing.length,blocked:t.blocked?.length??0}),run:A,pending:D(`operationMoveImages`)}),successDetail:t=>{let{failedPaths:n}=_(e,t);return n.length?D(`operationUnprocessedPaths`,{target:pe(n)}):``},error:e=>e instanceof Error?e.message:j.moveError}),{movedSources:c}=_(e,s);Z(D(`qolMoveResult`,{moved:s.moved.length,missing:s.missing.length,blocked:s.blocked?.length??0}),0),q(r===`left`?`right`:`left`,e=>{let t=e.selectedPaths.filter(e=>!c.has(e));return{...e,selectedPaths:t,focusedPath:c.has(e.focusedPath)?t.at(-1)??``:e.focusedPath,lastSelectedPath:c.has(e.lastSelectedPath)?t.at(-1)??``:e.lastSelectedPath}}),await X(!0)}catch(e){Z(e instanceof Error?e.message:j.moveError,0)}finally{at.current=!1,it(!1)}}},[O,t,G,C,X,A,q,Z,D,j]),Q=(0,x.useCallback)(async e=>{let t=K(e),n=G(e);await bt(t.selectedPaths,n,e===`left`?`right`:`left`)},[G,K,bt]),xt=async(e,t)=>{if(!Oe(t.dataTransfer.types??[]))return;t.preventDefault(),t.stopPropagation();let n=et??je(t.dataTransfer.getData.bind(t.dataTransfer));tt(null),n&&await bt(n.relativePaths,n.sourceFolder,e)},$=async(e,t=j.copySuccess)=>{try{await navigator.clipboard.writeText(e),k(t,`success`)}catch(e){k(e instanceof Error?e.message:j.copyError,`error`)}},St=e=>new URL(e.original_url||e.url,window.location.origin).toString(),Ct=async e=>{try{if(!(`clipboard`in navigator)||typeof ClipboardItem>`u`){await $(St(e),j.copySuccess);return}let t=await(await fetch(St(e))).blob();if(!t.type.startsWith(`image/`))throw Error(j.copyError);await navigator.clipboard.write([new ClipboardItem({[t.type]:t})]),k(j.copyImageSuccess,`success`)}catch(e){k(e instanceof Error?e.message:j.copyError,`error`)}},wt=async e=>{try{let t=await s.getImageMetadata(e.relative_path),n=se(t);if(!n){k(j.promptMissing,`info`);return}await $(n,j.copySuccess)}catch(e){k(e instanceof Error?e.message:j.metadataError,`error`)}},Tt=(0,x.useCallback)(async e=>{if(e.length&&await O({title:j.deleteTitle,message:j.deleteMessage(e.length),tone:e.length>=20?`danger`:`warning`,confirmLabel:j.delete,cancelLabel:D(`libraryCancel`)}))try{let t=await A(()=>ke(e),{pending:D(`operationDeleteImages`),success:t=>D(`operationDeleteImagesResult`,{count:t.deleted.length,missing:ve(e,t).failedPaths.length}),successTone:t=>ve(e,t).complete?`success`:`error`,successDetail:t=>{let{failedPaths:n}=ve(e,t);return n.length?D(`operationUnprocessedPaths`,{target:pe(n)}):``},error:e=>e instanceof Error?e.message:j.deleteError}),{deletedPaths:n}=ve(e,t);for(let e of[`left`,`right`])q(e,e=>{let t=e.selectedPaths.filter(e=>!n.has(e));return{...e,selectedPaths:t,focusedPath:n.has(e.focusedPath)?t.at(-1)??``:e.focusedPath,lastSelectedPath:n.has(e.lastSelectedPath)?t.at(-1)??``:e.lastSelectedPath}});await X(!0)}catch(e){Z(e instanceof Error?e.message:j.deleteError)}},[O,ke,X,A,q,Z,D,j]),Et=(e,t,n)=>{e.preventDefault(),e.stopPropagation(),z(t),K(t).selectedPaths.includes(n.relative_path)?q(t,e=>({...e,focusedPath:n.relative_path})):q(t,()=>({selectedPaths:[n.relative_path],focusedPath:n.relative_path,lastSelectedPath:n.relative_path}));let r=ue(e,{width:292,height:430},`pointer`);ut({pane:t,image:n,x:r.x,y:r.y})},Dt=(0,x.useCallback)(()=>ut(null),[]);xe(!!H,Dt),(0,x.useEffect)(()=>{let e=e=>{if(document.querySelector(`[aria-modal="true"]`)||at.current||re(e.target))return;let t=$e,n=K(t),r=W(t),i=r.images.find(e=>e.relative_path===n.focusedPath)??r.images[0],a=Fe(e);a===`selectAll`?(e.preventDefault(),_t(t)):a===`moveToOtherPane`?(e.preventDefault(),Q(t)):a===`refresh`?(e.preventDefault(),X(!0)):a===`escape`?(e.preventDefault(),H?ut(null):J(t)):a===`delete`?(e.preventDefault(),Tt(n.selectedPaths)):a===`openDetail`&&i?(e.preventDefault(),y(i,r.images)):a===`togglePane`&&(e.preventDefault(),z(e=>e===`left`?`right`:`left`))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[$e,J,H,Tt,K,W,Q,y,X,_t]);let Ot=async e=>{if(!U.length)return;let t=v.find(t=>t.id===e);await O({title:j.addToBoard,message:j.addToBoardConfirm(U.length,t?.name||e),tone:`warning`,confirmLabel:D(`commonAdd`),cancelLabel:D(`libraryCancel`)})&&(await A(()=>Ve(e,U,!0),{pending:D(`operationAddToBoard`),success:D(`boardAddSuccess`,{count:U.length})}),dt([]))},kt=async(e,t)=>{if(e.length&&await O({title:t?j.pin:j.unpin,message:t?j.pinConfirm(e.length):j.unpinConfirm(e.length),tone:`warning`,confirmLabel:t?j.pin:j.unpin,cancelLabel:D(`libraryCancel`)}))for(let n of e)await Ae(n,{pinned:t})},At=(e,n,r,i)=>{let s=!!T(n,t)?.writable,c=et&&et.from!==e,u=!!(c&&et?.sourceFolder===n),d=K(e),f=new Set(d.selectedPaths);return(0,S.jsxs)(`section`,{className:`ue-dual-pane ${$e===e?`is-active-pane`:``} ${c?`is-drop-active`:``} ${s?``:`is-read-only`}`,onClick:()=>z(e),onDragEnter:e=>{Oe(e.dataTransfer.types??[])&&(e.preventDefault(),e.stopPropagation())},onDragOver:e=>{Oe(e.dataTransfer.types??[])&&(e.preventDefault(),e.stopPropagation())},onDrop:t=>{xt(e,t)},children:[(0,S.jsxs)(`div`,{className:`ue-dual-pane-head`,children:[(0,S.jsxs)(`div`,{children:[(0,S.jsx)(`span`,{children:e===`left`?j.left:j.right}),(0,S.jsx)(`strong`,{children:i.total}),d.selectedPaths.length?(0,S.jsx)(`em`,{children:j.selected(d.selectedPaths.length)}):null]}),(0,S.jsx)(ze,{label:e===`left`?j.left:j.right,value:n,options:Ue,onChange:r,emptyText:j.noMatch})]}),(0,S.jsxs)(`div`,{className:`ue-dual-pane-actions`,"aria-label":e===`left`?j.left:j.right,children:[(0,S.jsxs)(`button`,{type:`button`,onClick:()=>_t(e),title:j.selectAll,"aria-label":j.selectAll,children:[(0,S.jsx)(ce,{size:14}),(0,S.jsx)(`span`,{children:j.selectAll})]}),(0,S.jsxs)(`button`,{type:`button`,onClick:()=>vt(e),title:j.invertSelection,"aria-label":j.invertSelection,children:[(0,S.jsx)(m,{size:14}),(0,S.jsx)(`span`,{children:j.invertSelection})]}),(0,S.jsxs)(`button`,{type:`button`,onClick:()=>J(e),title:j.clearSelection,"aria-label":j.clearSelection,children:[(0,S.jsx)(m,{size:14}),(0,S.jsx)(`span`,{children:j.clearSelection})]}),(0,S.jsxs)(`button`,{type:`button`,onClick:()=>void Y(e,n,!0),title:j.refresh,"aria-label":j.refresh,children:[(0,S.jsx)(a,{size:14}),(0,S.jsx)(`span`,{children:j.refresh})]}),(0,S.jsxs)(`button`,{type:`button`,disabled:B||!d.selectedPaths.length||n===G(e===`left`?`right`:`left`)||!T(G(e===`left`?`right`:`left`),t)?.writable,onClick:()=>void Q(e),title:j.moveOther,"aria-label":j.moveOther,children:[(0,S.jsx)(b,{size:14}),(0,S.jsx)(`span`,{children:j.moveOther})]})]}),c?(0,S.jsxs)(`div`,{className:`ue-dual-drop-hint`,children:[(0,S.jsx)(b,{size:16}),(0,S.jsx)(`span`,{children:u?j.sameFolder:s?j.dropHint:j.readOnly})]}):null,(0,S.jsx)(`p`,{className:`ue-qol-note`,children:D(`qolPaneScope`,{loaded:i.images.length,total:i.total})}),i.loading&&!i.images.length?(0,S.jsxs)(`div`,{className:`ue-dual-pane-state`,children:[(0,S.jsx)(o,{size:18}),(0,S.jsx)(`span`,{children:j.loading})]}):i.error?(0,S.jsx)(`div`,{className:`ue-dual-pane-state ue-dual-pane-state--error`,children:i.error}):i.images.length===0?(0,S.jsxs)(`div`,{className:`ue-dual-pane-state`,children:[(0,S.jsx)(l,{size:28}),(0,S.jsx)(`span`,{children:j.empty})]}):(0,S.jsx)(`div`,{className:`ue-dual-grid`,children:i.images.map(t=>{let r=f.has(t.relative_path),a=d.focusedPath===t.relative_path,o=r&&d.selectedPaths.length>1?d.selectedPaths:[t.relative_path];return(0,S.jsx)(Te,{image:t,selected:r,focused:a,draggedPaths:o,deselectLabel:j.deselect,onClick:n=>{n.stopPropagation(),gt(e,t,n)},onDoubleClick:e=>{e.stopPropagation(),y(t,i.images)},onContextMenu:n=>Et(n,e,t),onDragStart:(i,a)=>{i.stopPropagation(),i.dataTransfer.effectAllowed=`move`;let o={from:e,image:t,relativePaths:a,sourceFolder:n};i.dataTransfer.setData(Ee,JSON.stringify(o)),z(e),tt(o),r||q(e,()=>({selectedPaths:[t.relative_path],focusedPath:t.relative_path,lastSelectedPath:t.relative_path}))},onDragEnd:()=>tt(null),onToggleSelected:()=>yt(e,t)},t.relative_path)})}),i.images.lengthvoid Y(e,n,!1,!0),children:i.loading?j.loading:D(`qolLoadMore`)}):null]})},jt=()=>{if(!H)return null;let{pane:e,image:n}=H,r=ht(e,n),i=K(e).selectedPaths.includes(n.relative_path),a=e===`left`?`right`:`left`,o=!!T(G(a),t)?.writable,s=e=>{e(),ut(null)};return(0,S.jsx)(ye,{children:(0,S.jsxs)(`div`,{className:`ue-context-menu ue-context-menu--gallery ue-dual-context-menu`,style:{top:H.y,left:H.x},onClick:e=>e.stopPropagation(),onContextMenu:e=>e.preventDefault(),children:[(0,S.jsxs)(`div`,{className:`ue-context-menu-head`,children:[(0,S.jsx)(`strong`,{title:n.filename,children:n.filename}),(0,S.jsx)(`span`,{children:r.length>1?j.selected(r.length):be(n.size)})]}),(0,S.jsxs)(`div`,{className:`ue-context-menu-grid`,children:[(0,S.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>s(()=>y(n,W(H.pane).images)),children:[(0,S.jsx)(l,{size:14}),(0,S.jsx)(`span`,{children:j.openDetail})]}),(0,S.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>s(()=>window.open(St(n),`_blank`,`noopener,noreferrer`)),children:[(0,S.jsx)(ee,{size:14}),(0,S.jsx)(`span`,{children:j.openFull})]}),(0,S.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>s(()=>void _e(n)),children:[(0,S.jsx)(f,{size:14}),(0,S.jsx)(`span`,{children:j.openWorkflow})]}),(0,S.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>s(()=>pt(n)),children:[(0,S.jsx)(g,{size:14}),(0,S.jsx)(`span`,{children:j.metadata})]})]}),(0,S.jsxs)(`div`,{className:`ue-context-menu-grid ue-context-menu-grid--copy`,children:[(0,S.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>s(()=>void Ct(n)),children:[(0,S.jsx)(ce,{size:14}),(0,S.jsx)(`span`,{children:j.copyImage})]}),(0,S.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>s(()=>void $(n.filename)),children:[(0,S.jsx)(ie,{size:14}),(0,S.jsx)(`span`,{children:j.copyFilename})]}),(0,S.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>s(()=>void $(n.relative_path)),children:[(0,S.jsx)(u,{size:14}),(0,S.jsx)(`span`,{children:j.copyPath})]}),(0,S.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>s(()=>void wt(n)),children:[(0,S.jsx)(ie,{size:14}),(0,S.jsx)(`span`,{children:j.copyPrompt})]})]}),(0,S.jsxs)(`div`,{className:`ue-context-menu-section`,children:[(0,S.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>s(()=>{i?q(e,e=>({...e,selectedPaths:e.selectedPaths.filter(e=>e!==n.relative_path)})):q(e,e=>({selectedPaths:[...e.selectedPaths,n.relative_path],focusedPath:n.relative_path,lastSelectedPath:n.relative_path}))}),children:[i?(0,S.jsx)(ce,{size:14}):(0,S.jsx)(m,{size:14}),(0,S.jsx)(`span`,{children:i?j.deselect:j.select})]}),(0,S.jsxs)(`button`,{className:`ue-context-menu-item`,disabled:!o,onClick:()=>s(()=>void bt(r,G(e),a)),children:[(0,S.jsx)(b,{size:14}),(0,S.jsx)(`span`,{children:o?j.moveOther:j.readOnly})]}),(0,S.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>s(()=>{kt(r,!n.pinned)}),children:[(0,S.jsx)(d,{size:14,fill:n.pinned?`currentColor`:`none`}),(0,S.jsx)(`span`,{children:n.pinned?j.unpin:j.pin})]}),(0,S.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>s(()=>dt(r)),children:[(0,S.jsx)(te,{size:14}),(0,S.jsx)(`span`,{children:j.addToBoard})]}),(0,S.jsxs)(`button`,{className:`ue-context-menu-item ue-context-menu-item--danger`,onClick:()=>s(()=>void Tt(r)),children:[(0,S.jsx)(c,{size:14}),(0,S.jsx)(`span`,{children:j.delete})]})]})]})})},Mt=()=>{let e=P;Ke(F),qe(e)};return(0,S.jsxs)(`div`,{className:`ue-dual-workspace`,children:[ct&&(0,S.jsx)(`button`,{className:`ue-live-refresh-pill ue-dual-sync-pending`,onClick:()=>{X(!1).then(()=>lt(!1))},children:D(`galleryLiveRefreshPending`)}),(0,S.jsx)(`div`,{className:`ue-dual-intro`,children:(0,S.jsxs)(`div`,{children:[(0,S.jsx)(me,{size:18}),(0,S.jsxs)(`div`,{children:[(0,S.jsx)(`strong`,{children:j.title}),(0,S.jsx)(`span`,{children:j.hint})]})]})}),(0,S.jsx)(`div`,{className:`ue-qol-mode-actions`,children:e?(0,S.jsx)(`button`,{className:`ue-secondary-action`,type:`button`,disabled:B,onClick:e,children:D(`qolBackGallery`)}):null}),(0,S.jsx)(`p`,{className:`ue-qol-note`,children:D(`qolMoveScope`)}),nt?(0,S.jsx)(`div`,{className:`ue-qol-status`,role:`status`,"aria-live":`polite`,children:nt}):null,(0,S.jsx)(`fieldset`,{className:`ue-dual-operation-lock`,disabled:B,"aria-busy":B,children:(0,S.jsxs)(`div`,{className:`ue-dual-layout`,children:[At(`left`,P,Ke,W(`left`)),(()=>{let e=K(`left`),n=K(`right`),r=e.selectedPaths.length,i=n.selectedPaths.length,o=T(F,t),s=T(P,t),c=!!o?.writable&&P!==F,l=!!s?.writable&&P!==F;return(0,S.jsxs)(`aside`,{className:`ue-dual-transfer-rail`,"aria-label":D(`dual_moveOther`),children:[(0,S.jsx)(`div`,{className:`ue-dual-transfer-group`,children:(0,S.jsx)(`button`,{type:`button`,className:`ue-dual-transfer-btn`,onClick:Mt,title:j.swapFolders,"aria-label":j.swapFolders,children:(0,S.jsx)(me,{size:15})})}),(0,S.jsxs)(`div`,{className:`ue-dual-transfer-group ue-dual-transfer-group--actions`,children:[(0,S.jsxs)(`button`,{type:`button`,className:`ue-dual-transfer-btn ue-dual-transfer-btn--action ${r>0&&c?`is-active`:``}`,disabled:r===0||!c,onClick:()=>void Q(`left`),title:j.moveToRight,"aria-label":j.moveToRight,children:[(0,S.jsx)(b,{size:17}),r>0?(0,S.jsx)(`span`,{className:`ue-dual-transfer-badge`,children:r}):null]}),(0,S.jsxs)(`button`,{type:`button`,className:`ue-dual-transfer-btn ue-dual-transfer-btn--action ${i>0&&l?`is-active`:``}`,disabled:i===0||!l,onClick:()=>void Q(`right`),title:j.moveToLeft,"aria-label":j.moveToLeft,children:[(0,S.jsx)(we,{size:17}),i>0?(0,S.jsx)(`span`,{className:`ue-dual-transfer-badge`,children:i}):null]})]}),(0,S.jsx)(`div`,{className:`ue-dual-transfer-group`,children:(0,S.jsx)(`button`,{type:`button`,className:`ue-dual-transfer-btn`,onClick:()=>void X(!0),title:j.refreshBoth,"aria-label":j.refreshBoth,children:(0,S.jsx)(a,{size:14})})})]})})(),At(`right`,F,qe,W(`right`))]})}),jt(),(0,S.jsx)(ge,{open:U.length>0,boards:v,selectedCount:U.length,onClose:()=>dt([]),onCreateBoard:Be,onAddToBoard:Ot}),ft?(0,S.jsx)(Ce,{image:ft,onClose:()=>pt(null)}):null]})};export{Be as DualFolderWorkspace}; \ No newline at end of file diff --git a/gallery_ui/dist/assets/DualFolderWorkspace-Dl7afjQz.js b/gallery_ui/dist/assets/DualFolderWorkspace-Dl7afjQz.js deleted file mode 100644 index 661d01c..0000000 --- a/gallery_ui/dist/assets/DualFolderWorkspace-Dl7afjQz.js +++ /dev/null @@ -1 +0,0 @@ -import{a as e,i as t,n,r,s as i}from"./I18nProvider-cZczvL7B.js";import{t as a}from"./refresh-ccw-CfRNSMuu.js";import{$ as o,A as s,C as c,D as l,E as u,F as d,K as f,Q as p,S as m,V as h,W as ee,Y as g,_,c as v,ct as te,f as ne,g as y,h as re,i as ie,it as ae,j as oe,l as se,lt as ce,m as le,n as ue,o as de,ot as fe,p as pe,q as me,r as he,rt as ge,s as _e,st as ve,tt as ye,u as be,ut as xe,w as Se}from"./index-DWGqjUOp.js";import{MetadataViewerModal as Ce}from"./MetadataViewerModal-CEAQlgmV.js";var we=t(`move-left`,[[`path`,{d:`M6 8L2 12L6 16`,key:`kyvwex`}],[`path`,{d:`M2 12H22`,key:`1m8cig`}]]),b=t(`move-right`,[[`path`,{d:`M18 8L22 12L18 16`,key:`1r0oui`}],[`path`,{d:`M2 12H22`,key:`1m8cig`}]]),x=i(e(),1),S=r(),C=e=>{let t=Number(e.width??0),n=Number(e.height??0);return t>0&&n>0?`${t} × ${n}`:``},Te=({image:e,selected:t,focused:r,draggedPaths:i,deselectLabel:a,onClick:s,onDoubleClick:c,onContextMenu:l,onDragStart:u,onDragEnd:d,onToggleSelected:f})=>{let{locale:p}=n(),m=C(e);return(0,S.jsxs)(`article`,{className:`ue-dual-card ${t?`is-selected`:``} ${r?`is-focused`:``}`,draggable:!0,onClick:s,onDoubleClick:c,onContextMenu:l,onDragStart:e=>u(e,i),onDragEnd:d,children:[(0,S.jsx)(`button`,{className:`ue-dual-card-preview`,type:`button`,tabIndex:-1,children:(0,S.jsx)(`img`,{src:ue(e),alt:e.title||e.filename,loading:`lazy`,decoding:`async`})}),(0,S.jsxs)(`div`,{className:`ue-dual-card-copy`,children:[(0,S.jsxs)(`div`,{className:`ue-dual-card-heading`,children:[(0,S.jsx)(`strong`,{title:e.filename,children:e.filename}),m?(0,S.jsx)(`span`,{className:`ue-dual-card-resolution`,children:m}):null]}),(0,S.jsxs)(`span`,{className:`ue-dual-card-meta`,children:[se(e.created_at,p),(0,S.jsx)(`i`,{"aria-hidden":`true`,children:`/`}),be(e.size)]}),e.title?(0,S.jsx)(`em`,{title:e.title,children:e.title}):null]}),t?(0,S.jsx)(`button`,{className:`ue-dual-card-check`,type:`button`,"aria-label":a,title:a,onClick:e=>{e.stopPropagation(),f()},onDoubleClick:e=>e.stopPropagation(),children:(0,S.jsx)(o,{size:16})}):null]})},Ee=`application/x-universal-gallery-image`,De=()=>({selectedPaths:[],focusedPath:``,lastSelectedPath:``}),Oe=e=>Array.from(e).includes(Ee),ke=e=>e===`left`||e===`right`,Ae=e=>{if(!e||typeof e!=`object`)return!1;let t=e;return ke(t.from)&&Array.isArray(t.relativePaths)&&t.relativePaths.every(e=>typeof e==`string`&&e.trim().length>0)&&!!(t.image&&typeof t.image==`object`&&typeof t.image.relative_path==`string`)&&typeof t.sourceFolder==`string`},je=e=>{try{let t=e(Ee);if(!t)return null;let n=JSON.parse(t);return Ae(n)?n:null}catch{return null}},Me=({current:e,paths:t,path:n,shiftKey:r,toggleKey:i})=>{if(r&&e.lastSelectedPath){let r=t.indexOf(e.lastSelectedPath),i=t.indexOf(n);if(r!==-1&&i!==-1){let[a,o]=re!==n):[...e.selectedPaths,n],focusedPath:n,lastSelectedPath:n}:{selectedPaths:[n],focusedPath:n,lastSelectedPath:n}},Ne=(e,t)=>{let n=new Set(t.selectedPaths),r=e.filter(e=>!n.has(e));return{selectedPaths:r,focusedPath:r[0]||t.focusedPath,lastSelectedPath:r[0]||t.lastSelectedPath}},Pe=(e,t)=>{let n=t.selectedPaths.includes(e),r=n?t.selectedPaths.filter(t=>t!==e):[...t.selectedPaths,e];return{selectedPaths:r,focusedPath:n?r.at(-1)??``:e,lastSelectedPath:n?t.lastSelectedPath:e}},Fe=e=>{let t=e.key.toLowerCase();return(e.ctrlKey||e.metaKey)&&t===`a`?`selectAll`:(e.ctrlKey||e.metaKey)&&t===`m`?`moveToOtherPane`:(e.ctrlKey||e.metaKey)&&t===`r`?`refresh`:e.key===`Escape`?`escape`:e.key===`Delete`?`delete`:e.key===`Enter`?`openDetail`:e.key===`Tab`?`togglePane`:null},Ie=80,w=()=>({scopeKey:``,images:[],total:0,loading:!1,error:``}),T=(e,t)=>{let{sourceId:n}=y(e);return t?.sources.find(e=>e.id===n)},E=(e,t,n)=>le(e,t?.sources??[],(e,t)=>e?.kind===`output`?n(`sidebarOutputSource`):e?.kind===`input`?n(`sidebarInputSource`):e?.name||t),Le=(e,t,n)=>{let{sourceId:r,relativePath:i}=y(e),a=t?.sources.find(e=>e.id===r),o=a?.kind===`output`?n(`sidebarOutputSource`):a?.kind===`input`?n(`sidebarInputSource`):a?.name||r,s=i.split(`/`).filter(Boolean);return{value:e,label:s.at(-1)||`./`,parent:s.length>1?s.slice(0,-1).join(`/`):o,sourceName:o,searchText:`${E(e,t,n)} ${o} ${i}`.toLowerCase()}},Re=e=>{let{sourceId:t,relativePath:n}=y(e);return{targetSourceId:t,targetSubfolder:n}},ze=({label:e,value:t,options:r,onChange:i,emptyText:a})=>{let{t:o}=n(),[s,c]=(0,x.useState)(!1),[l,u]=(0,x.useState)(``),[d,f]=(0,x.useState)(0),m=(0,x.useRef)(null),h=r.find(e=>e.value===t)??r[0],g=l.trim().toLowerCase(),_=g?r.filter(e=>e.searchText.includes(g)):r;(0,x.useEffect)(()=>{if(!s)return;let e=e=>{m.current?.contains(e.target)||(c(!1),u(``))};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[s]),(0,x.useEffect)(()=>{f(0)},[l,s]);let v=e=>{e&&(i(e.value),c(!1),u(``))};return(0,S.jsxs)(`div`,{className:`ue-folder-combobox`,ref:m,children:[(0,S.jsxs)(`button`,{className:`ue-folder-combobox-trigger ${s?`is-open`:``}`,type:`button`,onClick:()=>c(e=>!e),"aria-label":e,children:[(0,S.jsx)(ee,{size:14}),(0,S.jsxs)(`span`,{children:[(0,S.jsx)(`strong`,{children:h?.label??`./`}),h?.parent?(0,S.jsx)(`em`,{children:h.parent}):null]}),(0,S.jsx)(p,{size:14})]}),s?(0,S.jsxs)(`div`,{className:`ue-folder-combobox-menu`,children:[(0,S.jsxs)(`label`,{className:`ue-folder-combobox-search`,children:[(0,S.jsx)(oe,{size:14}),(0,S.jsx)(`input`,{autoFocus:!0,value:l,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Escape`?(c(!1),u(``)):e.key===`ArrowDown`?(e.preventDefault(),f(e=>Math.min(e+1,_.length-1))):e.key===`ArrowUp`?(e.preventDefault(),f(e=>Math.max(e-1,0))):e.key===`Enter`&&(e.preventDefault(),v(_[d]))},placeholder:o(`sidebarFolderSearch`)})]}),(0,S.jsx)(`div`,{className:`ue-folder-combobox-list`,role:`listbox`,"aria-label":e,children:_.length?_.map((e,n)=>(0,S.jsxs)(`button`,{className:`${e.value===t?`is-selected`:``} ${n===d?`is-active`:``}`,type:`button`,onMouseEnter:()=>f(n),onClick:()=>v(e),role:`option`,"aria-selected":e.value===t,children:[(0,S.jsx)(ee,{size:14}),(0,S.jsxs)(`span`,{children:[(0,S.jsx)(`strong`,{children:e.label}),(0,S.jsx)(`em`,{children:e.parent})]})]},e.value)):(0,S.jsx)(`div`,{className:`ue-folder-combobox-empty`,children:a})})]}):null]})},Be=({onExit:e,context:t,initialFolder:r,sortBy:i,sortOrder:o,boards:p,onOpenDetail:y,onSelectionChange:oe,onVisibleImagesChange:se,inspectorClearSignal:le,onOpenWorkflow:ue,onMoveImages:C,onDeleteImages:ke,onUpdateImageState:Ae,onCreateBoard:Be,onUpdateBoardPins:Ve})=>{let{t:D,locale:He}=n(),{confirm:O}=_(),{pushToast:k}=ne(),{runOperation:A}=Se(),j=(0,x.useMemo)(()=>({title:D(`dual_title`),hint:D(`dual_hint`),left:D(`dual_left`),right:D(`dual_right`),selected:e=>D(`dual_selected`,{count:e}),selectAll:D(`dual_selectAll`),invertSelection:D(`dual_invertSelection`),clearSelection:D(`dual_clearSelection`),refresh:D(`dual_refresh`),moveOther:D(`dual_moveOther`),dropHint:D(`dual_dropHint`),readOnly:D(`dual_readOnly`),empty:D(`dual_empty`),loading:D(`dual_loading`),moving:D(`dual_moving`),moved:D(`dual_moved`),moveConfirmTitle:D(`dual_moveConfirmTitle`),moveConfirm:(e,t)=>D(`dual_moveConfirm`,{count:e,target:t}),pinConfirm:e=>D(`dual_pinConfirm`,{count:e}),unpinConfirm:e=>D(`dual_unpinConfirm`,{count:e}),addToBoardConfirm:(e,t)=>D(`dual_addToBoardConfirm`,{count:e,target:t}),sameFolder:D(`dual_sameFolder`),noMatch:D(`dual_noMatch`),loadError:D(`dual_loadError`),moveError:D(`dual_moveError`),openDetail:D(`dual_openDetail`),openFull:D(`dual_openFull`),openWorkflow:D(`dual_openWorkflow`),metadata:D(`dual_metadata`),copyImage:D(`dual_copyImage`),copyFilename:D(`dual_copyFilename`),copyPath:D(`dual_copyPath`),copyPrompt:D(`dual_copyPrompt`),copySuccess:D(`dual_copySuccess`),copyImageSuccess:D(`dual_copyImageSuccess`),copyError:D(`dual_copyError`),promptMissing:D(`dual_promptMissing`),select:D(`dual_select`),deselect:D(`dual_deselect`),pin:D(`dual_pin`),unpin:D(`dual_unpin`),addToBoard:D(`dual_addToBoard`),delete:D(`dual_delete`),deleteTitle:D(`dual_deleteTitle`),deleteMessage:e=>D(`dual_deleteMessage`,{count:e}),deleteSuccess:D(`dual_deleteSuccess`),deleteError:D(`dual_deleteError`),metadataError:D(`dual_metadataError`),swapFolders:D(`dual_swapFolders`),moveToRight:D(`dual_moveToRight`),moveToLeft:D(`dual_moveToLeft`),refreshBoth:D(`dual_refreshBoth`)}),[D]),M=(0,x.useMemo)(()=>{let e=new Set;for(let n of t?.sources??[])n.enabled&&n.exists&&e.add(re(n.id));for(let n of t?.subfolders??[])e.add(n);return[...e].sort((e,n)=>E(e,t,D).localeCompare(E(n,t,D),He,{numeric:!0,sensitivity:`base`}))},[t,D,He]),Ue=(0,x.useMemo)(()=>M.map(e=>Le(e,t,D)),[t,M,D]),We=re(pe),N=r&&r!==`__trash__`?r:We,Ge=M.find(e=>e!==N)??N,[P,Ke]=(0,x.useState)(N),[F,qe]=(0,x.useState)(Ge),[I,Je]=(0,x.useState)(()=>w()),[L,Ye]=(0,x.useState)(()=>w()),[R,Xe]=(0,x.useState)(()=>De()),[Ze,Qe]=(0,x.useState)(()=>De()),[$e,z]=(0,x.useState)(`left`),[et,tt]=(0,x.useState)(null),[nt,rt]=(0,x.useState)(``),[B,it]=(0,x.useState)(!1),at=(0,x.useRef)(!1),V=(0,x.useRef)({left:0,right:0}),ot=(0,x.useRef)({left:1,right:1}),st=(0,x.useRef)(void 0);(0,x.useEffect)(()=>()=>{V.current.left++,V.current.right++,window.clearTimeout(st.current)},[]);let[ct,lt]=(0,x.useState)(!1),[H,ut]=(0,x.useState)(null),[U,dt]=(0,x.useState)([]),[ft,pt]=(0,x.useState)(null),W=(0,x.useCallback)(e=>{let t=e===`left`?I:L,n=e===`left`?P:F;return t.scopeKey===JSON.stringify([n,i,o])?t:{...w(),loading:!0}},[P,I,F,L,i,o]),G=(0,x.useCallback)(e=>e===`left`?P:F,[P,F]),K=(0,x.useCallback)(e=>e===`left`?R:Ze,[R,Ze]),q=(0,x.useCallback)((e,t)=>{e===`left`?Xe(t):Qe(t)},[]),J=(0,x.useCallback)(e=>{q(e,()=>De())},[q]),mt=(0,x.useMemo)(()=>{let e=I.scopeKey===JSON.stringify([P,i,o])?I.images:[],t=L.scopeKey===JSON.stringify([F,i,o])?L.images:[];return[...new Map([...e,...t].map(e=>[e.relative_path,e])).values()]},[P,I.images,I.scopeKey,F,L.images,L.scopeKey,i,o]);(0,x.useEffect)(()=>{se?.(mt)},[se,mt]),(0,x.useEffect)(()=>{let e=new Set(mt.map(e=>e.relative_path));oe?.([...new Set([...R.selectedPaths,...Ze.selectedPaths])].filter(t=>e.has(t)))},[R.selectedPaths,oe,Ze.selectedPaths,mt]),(0,x.useEffect)(()=>{le&&(J(`left`),J(`right`))},[J,le]),(0,x.useEffect)(()=>{N&&Ke(N)},[N]),(0,x.useEffect)(()=>{M.includes(F)||qe(M.find(e=>e!==P)??P)},[M,P,F]),(0,x.useEffect)(()=>{J(`left`)},[P,J]),(0,x.useEffect)(()=>{J(`right`)},[F,J]);let Y=(0,x.useCallback)(async(e,t,n=!1,r=!1)=>{let a=++V.current[e],s=JSON.stringify([t,i,o]),l=r?ot.current[e]+1:1,u=e===`left`?Je:Ye;u(e=>({...e.scopeKey===s?e:w(),scopeKey:s,loading:!0,error:``}));try{let d=await c.listImages(l,Ie,``,``,t,``,``,``,!1,``,i,o,n);if(a!==V.current[e])return;ot.current[e]=l,u(e=>({scopeKey:s,images:r?[...new Map([...e.images,...d.images].map(e=>[e.relative_path,e])).values()]:d.images,total:d.total,loading:!1,error:``}))}catch{if(a!==V.current[e])return;u(e=>({...e,loading:!1,error:j.loadError}))}},[i,o,j.loadError]),X=(0,x.useCallback)(async(e=!0)=>{await Promise.all([Y(`left`,P,e),Y(`right`,F,e)])},[P,Y,F]);(0,x.useEffect)(()=>{let e=()=>lt(!0);return window.addEventListener(`universal-gallery:index-synced`,e),()=>window.removeEventListener(`universal-gallery:index-synced`,e)},[]),(0,x.useEffect)(()=>{let e=()=>{X(!1)};return window.addEventListener(`universal-gallery:files-changed`,e),()=>window.removeEventListener(`universal-gallery:files-changed`,e)},[X]),(0,x.useEffect)(()=>{Y(`left`,P)},[P,Y]),(0,x.useEffect)(()=>{Y(`right`,F)},[F,Y]);let Z=(0,x.useCallback)((e,t=1800)=>{window.clearTimeout(st.current),rt(e),t>0&&(st.current=window.setTimeout(()=>rt(``),t))},[]),ht=(0,x.useCallback)((e,t)=>{let n=K(e);return n.selectedPaths.includes(t.relative_path)&&n.selectedPaths.length>1?n.selectedPaths:[t.relative_path]},[K]),gt=(e,t,n)=>{let r=W(e),i=t.relative_path,a=r.images.map(e=>e.relative_path);z(e),q(e,e=>Me({current:e,paths:a,path:i,shiftKey:n.shiftKey,toggleKey:n.ctrlKey||n.metaKey}))},_t=(0,x.useCallback)(e=>{let t=W(e).images.map(e=>e.relative_path);z(e),q(e,e=>({selectedPaths:t,focusedPath:e.focusedPath||t[0]||``,lastSelectedPath:e.lastSelectedPath||t[0]||``}))},[W,q]),vt=e=>{let t=W(e).images.map(e=>e.relative_path);z(e),q(e,e=>Ne(t,e))},yt=(e,t)=>{let n=t.relative_path;z(e),q(e,e=>Pe(n,e))},bt=(0,x.useCallback)(async(e,n,r)=>{let i=G(r);if(!e.length)return;if(i===n){Z(j.sameFolder,1200);return}let a=T(i,t);if(!T(n,t)?.writable||!a?.writable){Z(j.readOnly);return}if(!at.current){at.current=!0,it(!0);try{if(!await O({title:j.moveConfirmTitle,message:D(`qolMoveConfirm`,{count:e.length,source:E(n,t,D),target:E(i,t,D)}),tone:`warning`,confirmLabel:D(`commonMove`),cancelLabel:D(`libraryCancel`)}))return;Z(D(`qolMoveBusy`),0);let{targetSourceId:a,targetSubfolder:o}=Re(i),s=await A(()=>C(e,o,a),{pending:D(`operationMoveImages`),success:t=>{let{unaccounted:n}=v(e,t);return[D(`qolMoveResult`,{moved:t.moved.length,missing:t.missing.length,blocked:t.blocked?.length??0}),t.unchanged?.length?D(`operationMoveUnchanged`,{count:t.unchanged.length}):``,n?D(`operationUnaccounted`,{count:n}):``].filter(Boolean).join(` `)},successTone:t=>v(e,t).complete?`success`:`error`,successRetry:r=>m({paths:v(e,r).failedPaths,confirm:O,confirmation:e=>({title:j.moveConfirmTitle,message:D(`qolMoveConfirm`,{count:e,source:E(n,t,D),target:E(i,t,D)}),tone:`warning`,confirmLabel:D(`commonMove`),cancelLabel:D(`libraryCancel`)}),execute:e=>C(e,o,a),failed:(e,t)=>v(e,t).failedPaths,summary:(e,t)=>D(`qolMoveResult`,{moved:t.moved.length,missing:t.missing.length,blocked:t.blocked?.length??0}),run:A,pending:D(`operationMoveImages`)}),successDetail:t=>{let{failedPaths:n}=v(e,t);return n.length?D(`operationUnprocessedPaths`,{target:de(n)}):``},error:e=>e instanceof Error?e.message:j.moveError}),{movedSources:c}=v(e,s);Z(D(`qolMoveResult`,{moved:s.moved.length,missing:s.missing.length,blocked:s.blocked?.length??0}),0),q(r===`left`?`right`:`left`,e=>{let t=e.selectedPaths.filter(e=>!c.has(e));return{...e,selectedPaths:t,focusedPath:c.has(e.focusedPath)?t.at(-1)??``:e.focusedPath,lastSelectedPath:c.has(e.lastSelectedPath)?t.at(-1)??``:e.lastSelectedPath}}),await X(!0)}catch(e){Z(e instanceof Error?e.message:j.moveError,0)}finally{at.current=!1,it(!1)}}},[O,t,G,C,X,A,q,Z,D,j]),Q=(0,x.useCallback)(async e=>{let t=K(e),n=G(e);await bt(t.selectedPaths,n,e===`left`?`right`:`left`)},[G,K,bt]),xt=async(e,t)=>{if(!Oe(t.dataTransfer.types??[]))return;t.preventDefault(),t.stopPropagation();let n=et??je(t.dataTransfer.getData.bind(t.dataTransfer));tt(null),n&&await bt(n.relativePaths,n.sourceFolder,e)},$=async(e,t=j.copySuccess)=>{try{await navigator.clipboard.writeText(e),k(t,`success`)}catch(e){k(e instanceof Error?e.message:j.copyError,`error`)}},St=e=>new URL(e.original_url||e.url,window.location.origin).toString(),Ct=async e=>{try{if(!(`clipboard`in navigator)||typeof ClipboardItem>`u`){await $(St(e),j.copySuccess);return}let t=await(await fetch(St(e))).blob();if(!t.type.startsWith(`image/`))throw Error(j.copyError);await navigator.clipboard.write([new ClipboardItem({[t.type]:t})]),k(j.copyImageSuccess,`success`)}catch(e){k(e instanceof Error?e.message:j.copyError,`error`)}},wt=async e=>{try{let t=ie(await c.getImageMetadata(e.relative_path));if(!t){k(j.promptMissing,`info`);return}await $(t,j.copySuccess)}catch(e){k(e instanceof Error?e.message:j.metadataError,`error`)}},Tt=(0,x.useCallback)(async e=>{if(e.length&&await O({title:j.deleteTitle,message:j.deleteMessage(e.length),tone:e.length>=20?`danger`:`warning`,confirmLabel:j.delete,cancelLabel:D(`libraryCancel`)}))try{let{deletedPaths:t}=_e(e,await A(()=>ke(e),{pending:D(`operationDeleteImages`),success:t=>D(`operationDeleteImagesResult`,{count:t.deleted.length,missing:_e(e,t).failedPaths.length}),successTone:t=>_e(e,t).complete?`success`:`error`,successDetail:t=>{let{failedPaths:n}=_e(e,t);return n.length?D(`operationUnprocessedPaths`,{target:de(n)}):``},error:e=>e instanceof Error?e.message:j.deleteError}));for(let e of[`left`,`right`])q(e,e=>{let n=e.selectedPaths.filter(e=>!t.has(e));return{...e,selectedPaths:n,focusedPath:t.has(e.focusedPath)?n.at(-1)??``:e.focusedPath,lastSelectedPath:t.has(e.lastSelectedPath)?n.at(-1)??``:e.lastSelectedPath}});await X(!0)}catch(e){Z(e instanceof Error?e.message:j.deleteError)}},[O,ke,X,A,q,Z,D,j]),Et=(e,t,n)=>{e.preventDefault(),e.stopPropagation(),z(t),K(t).selectedPaths.includes(n.relative_path)?q(t,e=>({...e,focusedPath:n.relative_path})):q(t,()=>({selectedPaths:[n.relative_path],focusedPath:n.relative_path,lastSelectedPath:n.relative_path}));let r=ce(e,{width:292,height:430},`pointer`);ut({pane:t,image:n,x:r.x,y:r.y})},Dt=(0,x.useCallback)(()=>ut(null),[]);xe(!!H,Dt),(0,x.useEffect)(()=>{let e=e=>{if(document.querySelector(`[aria-modal="true"]`)||at.current||te(e.target))return;let t=$e,n=K(t),r=W(t),i=r.images.find(e=>e.relative_path===n.focusedPath)??r.images[0],a=Fe(e);a===`selectAll`?(e.preventDefault(),_t(t)):a===`moveToOtherPane`?(e.preventDefault(),Q(t)):a===`refresh`?(e.preventDefault(),X(!0)):a===`escape`?(e.preventDefault(),H?ut(null):J(t)):a===`delete`?(e.preventDefault(),Tt(n.selectedPaths)):a===`openDetail`&&i?(e.preventDefault(),y(i,r.images)):a===`togglePane`&&(e.preventDefault(),z(e=>e===`left`?`right`:`left`))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[$e,J,H,Tt,K,W,Q,y,X,_t]);let Ot=async e=>{if(!U.length)return;let t=p.find(t=>t.id===e);await O({title:j.addToBoard,message:j.addToBoardConfirm(U.length,t?.name||e),tone:`warning`,confirmLabel:D(`commonAdd`),cancelLabel:D(`libraryCancel`)})&&(await A(()=>Ve(e,U,!0),{pending:D(`operationAddToBoard`),success:D(`boardAddSuccess`,{count:U.length})}),dt([]))},kt=async(e,t)=>{if(e.length&&await O({title:t?j.pin:j.unpin,message:t?j.pinConfirm(e.length):j.unpinConfirm(e.length),tone:`warning`,confirmLabel:t?j.pin:j.unpin,cancelLabel:D(`libraryCancel`)}))for(let n of e)await Ae(n,{pinned:t})},At=(e,n,r,i)=>{let o=!!T(n,t)?.writable,s=et&&et.from!==e,c=!!(s&&et?.sourceFolder===n),u=K(e),d=new Set(u.selectedPaths);return(0,S.jsxs)(`section`,{className:`ue-dual-pane ${$e===e?`is-active-pane`:``} ${s?`is-drop-active`:``} ${o?``:`is-read-only`}`,onClick:()=>z(e),onDragEnter:e=>{Oe(e.dataTransfer.types??[])&&(e.preventDefault(),e.stopPropagation())},onDragOver:e=>{Oe(e.dataTransfer.types??[])&&(e.preventDefault(),e.stopPropagation())},onDrop:t=>{xt(e,t)},children:[(0,S.jsxs)(`div`,{className:`ue-dual-pane-head`,children:[(0,S.jsxs)(`div`,{children:[(0,S.jsx)(`span`,{children:e===`left`?j.left:j.right}),(0,S.jsx)(`strong`,{children:i.total}),u.selectedPaths.length?(0,S.jsx)(`em`,{children:j.selected(u.selectedPaths.length)}):null]}),(0,S.jsx)(ze,{label:e===`left`?j.left:j.right,value:n,options:Ue,onChange:r,emptyText:j.noMatch})]}),(0,S.jsxs)(`div`,{className:`ue-dual-pane-actions`,"aria-label":e===`left`?j.left:j.right,children:[(0,S.jsxs)(`button`,{type:`button`,onClick:()=>_t(e),title:j.selectAll,"aria-label":j.selectAll,children:[(0,S.jsx)(ge,{size:14}),(0,S.jsx)(`span`,{children:j.selectAll})]}),(0,S.jsxs)(`button`,{type:`button`,onClick:()=>vt(e),title:j.invertSelection,"aria-label":j.invertSelection,children:[(0,S.jsx)(l,{size:14}),(0,S.jsx)(`span`,{children:j.invertSelection})]}),(0,S.jsxs)(`button`,{type:`button`,onClick:()=>J(e),title:j.clearSelection,"aria-label":j.clearSelection,children:[(0,S.jsx)(l,{size:14}),(0,S.jsx)(`span`,{children:j.clearSelection})]}),(0,S.jsxs)(`button`,{type:`button`,onClick:()=>void Y(e,n,!0),title:j.refresh,"aria-label":j.refresh,children:[(0,S.jsx)(a,{size:14}),(0,S.jsx)(`span`,{children:j.refresh})]}),(0,S.jsxs)(`button`,{type:`button`,disabled:B||!u.selectedPaths.length||n===G(e===`left`?`right`:`left`)||!T(G(e===`left`?`right`:`left`),t)?.writable,onClick:()=>void Q(e),title:j.moveOther,"aria-label":j.moveOther,children:[(0,S.jsx)(b,{size:14}),(0,S.jsx)(`span`,{children:j.moveOther})]})]}),s?(0,S.jsxs)(`div`,{className:`ue-dual-drop-hint`,children:[(0,S.jsx)(b,{size:16}),(0,S.jsx)(`span`,{children:c?j.sameFolder:o?j.dropHint:j.readOnly})]}):null,(0,S.jsx)(`p`,{className:`ue-qol-note`,children:D(`qolPaneScope`,{loaded:i.images.length,total:i.total})}),i.loading&&!i.images.length?(0,S.jsxs)(`div`,{className:`ue-dual-pane-state`,children:[(0,S.jsx)(ae,{size:18}),(0,S.jsx)(`span`,{children:j.loading})]}):i.error?(0,S.jsx)(`div`,{className:`ue-dual-pane-state ue-dual-pane-state--error`,children:i.error}):i.images.length===0?(0,S.jsxs)(`div`,{className:`ue-dual-pane-state`,children:[(0,S.jsx)(h,{size:28}),(0,S.jsx)(`span`,{children:j.empty})]}):(0,S.jsx)(`div`,{className:`ue-dual-grid`,children:i.images.map(t=>{let r=d.has(t.relative_path);return(0,S.jsx)(Te,{image:t,selected:r,focused:u.focusedPath===t.relative_path,draggedPaths:r&&u.selectedPaths.length>1?u.selectedPaths:[t.relative_path],deselectLabel:j.deselect,onClick:n=>{n.stopPropagation(),gt(e,t,n)},onDoubleClick:e=>{e.stopPropagation(),y(t,i.images)},onContextMenu:n=>Et(n,e,t),onDragStart:(i,a)=>{i.stopPropagation(),i.dataTransfer.effectAllowed=`move`;let o={from:e,image:t,relativePaths:a,sourceFolder:n};i.dataTransfer.setData(Ee,JSON.stringify(o)),z(e),tt(o),r||q(e,()=>({selectedPaths:[t.relative_path],focusedPath:t.relative_path,lastSelectedPath:t.relative_path}))},onDragEnd:()=>tt(null),onToggleSelected:()=>yt(e,t)},t.relative_path)})}),i.images.lengthvoid Y(e,n,!1,!0),children:i.loading?j.loading:D(`qolLoadMore`)}):null]})},jt=()=>{if(!H)return null;let{pane:e,image:n}=H,r=ht(e,n),i=K(e).selectedPaths.includes(n.relative_path),a=e===`left`?`right`:`left`,o=!!T(G(a),t)?.writable,c=e=>{e(),ut(null)};return(0,S.jsx)(ve,{children:(0,S.jsxs)(`div`,{className:`ue-context-menu ue-context-menu--gallery ue-dual-context-menu`,style:{top:H.y,left:H.x},onClick:e=>e.stopPropagation(),onContextMenu:e=>e.preventDefault(),children:[(0,S.jsxs)(`div`,{className:`ue-context-menu-head`,children:[(0,S.jsx)(`strong`,{title:n.filename,children:n.filename}),(0,S.jsx)(`span`,{children:r.length>1?j.selected(r.length):be(n.size)})]}),(0,S.jsxs)(`div`,{className:`ue-context-menu-grid`,children:[(0,S.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>c(()=>y(n,W(H.pane).images)),children:[(0,S.jsx)(h,{size:14}),(0,S.jsx)(`span`,{children:j.openDetail})]}),(0,S.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>c(()=>window.open(St(n),`_blank`,`noopener,noreferrer`)),children:[(0,S.jsx)(me,{size:14}),(0,S.jsx)(`span`,{children:j.openFull})]}),(0,S.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>c(()=>void ue(n)),children:[(0,S.jsx)(s,{size:14}),(0,S.jsx)(`span`,{children:j.openWorkflow})]}),(0,S.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>c(()=>pt(n)),children:[(0,S.jsx)(fe,{size:14}),(0,S.jsx)(`span`,{children:j.metadata})]})]}),(0,S.jsxs)(`div`,{className:`ue-context-menu-grid ue-context-menu-grid--copy`,children:[(0,S.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>c(()=>void Ct(n)),children:[(0,S.jsx)(ge,{size:14}),(0,S.jsx)(`span`,{children:j.copyImage})]}),(0,S.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>c(()=>void $(n.filename)),children:[(0,S.jsx)(g,{size:14}),(0,S.jsx)(`span`,{children:j.copyFilename})]}),(0,S.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>c(()=>void $(n.relative_path)),children:[(0,S.jsx)(ee,{size:14}),(0,S.jsx)(`span`,{children:j.copyPath})]}),(0,S.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>c(()=>void wt(n)),children:[(0,S.jsx)(g,{size:14}),(0,S.jsx)(`span`,{children:j.copyPrompt})]})]}),(0,S.jsxs)(`div`,{className:`ue-context-menu-section`,children:[(0,S.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>c(()=>{i?q(e,e=>({...e,selectedPaths:e.selectedPaths.filter(e=>e!==n.relative_path)})):q(e,e=>({selectedPaths:[...e.selectedPaths,n.relative_path],focusedPath:n.relative_path,lastSelectedPath:n.relative_path}))}),children:[i?(0,S.jsx)(ge,{size:14}):(0,S.jsx)(l,{size:14}),(0,S.jsx)(`span`,{children:i?j.deselect:j.select})]}),(0,S.jsxs)(`button`,{className:`ue-context-menu-item`,disabled:!o,onClick:()=>c(()=>void bt(r,G(e),a)),children:[(0,S.jsx)(b,{size:14}),(0,S.jsx)(`span`,{children:o?j.moveOther:j.readOnly})]}),(0,S.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>c(()=>{kt(r,!n.pinned)}),children:[(0,S.jsx)(d,{size:14,fill:n.pinned?`currentColor`:`none`}),(0,S.jsx)(`span`,{children:n.pinned?j.unpin:j.pin})]}),(0,S.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>c(()=>dt(r)),children:[(0,S.jsx)(f,{size:14}),(0,S.jsx)(`span`,{children:j.addToBoard})]}),(0,S.jsxs)(`button`,{className:`ue-context-menu-item ue-context-menu-item--danger`,onClick:()=>c(()=>void Tt(r)),children:[(0,S.jsx)(u,{size:14}),(0,S.jsx)(`span`,{children:j.delete})]})]})]})})},Mt=()=>{let e=P;Ke(F),qe(e)};return(0,S.jsxs)(`div`,{className:`ue-dual-workspace`,children:[ct&&(0,S.jsx)(`button`,{className:`ue-live-refresh-pill ue-dual-sync-pending`,onClick:()=>{X(!1).then(()=>lt(!1))},children:D(`galleryLiveRefreshPending`)}),(0,S.jsx)(`div`,{className:`ue-dual-intro`,children:(0,S.jsxs)(`div`,{children:[(0,S.jsx)(ye,{size:18}),(0,S.jsxs)(`div`,{children:[(0,S.jsx)(`strong`,{children:j.title}),(0,S.jsx)(`span`,{children:j.hint})]})]})}),(0,S.jsx)(`div`,{className:`ue-qol-mode-actions`,children:e?(0,S.jsx)(`button`,{className:`ue-secondary-action`,type:`button`,disabled:B,onClick:e,children:D(`qolBackGallery`)}):null}),(0,S.jsx)(`p`,{className:`ue-qol-note`,children:D(`qolMoveScope`)}),nt?(0,S.jsx)(`div`,{className:`ue-qol-status`,role:`status`,"aria-live":`polite`,children:nt}):null,(0,S.jsx)(`fieldset`,{className:`ue-dual-operation-lock`,disabled:B,"aria-busy":B,children:(0,S.jsxs)(`div`,{className:`ue-dual-layout`,children:[At(`left`,P,Ke,W(`left`)),(()=>{let e=K(`left`),n=K(`right`),r=e.selectedPaths.length,i=n.selectedPaths.length,o=T(F,t),s=T(P,t),c=!!o?.writable&&P!==F,l=!!s?.writable&&P!==F;return(0,S.jsxs)(`aside`,{className:`ue-dual-transfer-rail`,"aria-label":D(`dual_moveOther`),children:[(0,S.jsx)(`div`,{className:`ue-dual-transfer-group`,children:(0,S.jsx)(`button`,{type:`button`,className:`ue-dual-transfer-btn`,onClick:Mt,title:j.swapFolders,"aria-label":j.swapFolders,children:(0,S.jsx)(ye,{size:15})})}),(0,S.jsxs)(`div`,{className:`ue-dual-transfer-group ue-dual-transfer-group--actions`,children:[(0,S.jsxs)(`button`,{type:`button`,className:`ue-dual-transfer-btn ue-dual-transfer-btn--action ${r>0&&c?`is-active`:``}`,disabled:r===0||!c,onClick:()=>void Q(`left`),title:j.moveToRight,"aria-label":j.moveToRight,children:[(0,S.jsx)(b,{size:17}),r>0?(0,S.jsx)(`span`,{className:`ue-dual-transfer-badge`,children:r}):null]}),(0,S.jsxs)(`button`,{type:`button`,className:`ue-dual-transfer-btn ue-dual-transfer-btn--action ${i>0&&l?`is-active`:``}`,disabled:i===0||!l,onClick:()=>void Q(`right`),title:j.moveToLeft,"aria-label":j.moveToLeft,children:[(0,S.jsx)(we,{size:17}),i>0?(0,S.jsx)(`span`,{className:`ue-dual-transfer-badge`,children:i}):null]})]}),(0,S.jsx)(`div`,{className:`ue-dual-transfer-group`,children:(0,S.jsx)(`button`,{type:`button`,className:`ue-dual-transfer-btn`,onClick:()=>void X(!0),title:j.refreshBoth,"aria-label":j.refreshBoth,children:(0,S.jsx)(a,{size:14})})})]})})(),At(`right`,F,qe,W(`right`))]})}),jt(),(0,S.jsx)(he,{open:U.length>0,boards:p,selectedCount:U.length,onClose:()=>dt([]),onCreateBoard:Be,onAddToBoard:Ot}),ft?(0,S.jsx)(Ce,{image:ft,onClose:()=>pt(null)}):null]})};export{Be as DualFolderWorkspace}; \ No newline at end of file diff --git a/gallery_ui/dist/assets/I18nProvider-DEfiLn3N.js b/gallery_ui/dist/assets/I18nProvider-DEfiLn3N.js new file mode 100644 index 0000000..d3cd1c8 --- /dev/null +++ b/gallery_ui/dist/assets/I18nProvider-DEfiLn3N.js @@ -0,0 +1 @@ +var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;li[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n)),l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u{t.exports=l()})),d=c(u()),f=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),p=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),m=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),h=e=>{let t=m(e);return t.charAt(0).toUpperCase()+t.slice(1)},g={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},_=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},v=(0,d.createContext)({}),y=()=>(0,d.useContext)(v),b=(0,d.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:p=!1,color:m=`currentColor`,className:h=``}=y()??{},v=r??p?Number(n??u)*24/Number(t??l):n??u;return(0,d.createElement)(`svg`,{ref:c,...g,width:t??l??g.width,height:t??l??g.height,stroke:e??m,strokeWidth:v,className:f(`lucide`,h,i),...!a&&!_(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,d.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),x=(e,t)=>{let n=(0,d.forwardRef)(({className:n,...r},i)=>(0,d.createElement)(b,{ref:i,iconNode:t,className:f(`lucide-${p(h(e))}`,`lucide-${e}`,n),...r}));return n.displayName=h(e),n},S={"zh-CN":{libraryWorkspaceIntro:`管理词库条目与提示词,支持 JSON 导入和编辑。`,imageSearchClose:`关闭以图搜图`,operationBatchResult:`成功 {updated} · 跳过 {count} · 未完成 {missing}`,operationRetryBatchConfirm:`仅重试未完成的 {count} 项,修改内容:{target}`,galleryMode:`图库模式`,galleryModeBrowse:`浏览`,galleryFolderPath:`目录路径`,librarySelectInlineHint:`直接选择词库,或新建、导入 JSON 文件。`,libraryCreateInline:`新建词库`,detailBrowse:`浏览`,detailReuse:`复用`,detailManage:`管理`,detailNoWorkflow:`此图片没有可发送的工作流`,imageSearchReturn:`返回搜图结果与原浏览位置`,imageSearchLegacyLocate:`服务端版本较旧,已定位目录;可按文件名查找。`,imageSearchLocateFailed:`定位失败,请检查图源并刷新图库。`,settingsDensity:`界面密度`,densityStandard:`标准`,settingsDensityHint:`仅调整间距,不改变网格列数。`,operationCenter:`任务中心`,operationTab_pending:`进行中`,operationTab_error:`失败`,operationTab_recent:`最近完成`,operationEmpty:`暂无记录`,operationClear:`清除记录`,jobRequestCancel:`请求取消`,galleryAutoSyncFailed:`图库自动同步失败,可重试`,updatesInstalledNotes:`v{version} 更新说明`,updatesPreview:`本地示例 · 未检查远端`,updatesCached:`使用已核验缓存`,updatesLocalOnly:`当前安装版本说明`,updatesLastSuccess:`上次检查成功`,updatesInstalled:`当前版本说明`,updatesHistory:`历史版本`,imageSearchTitle:`以图搜图`,imageSearchIntro:`用社交平台上的老图,找回图库中的原图和所在文件夹。搜索全部已启用图源,不受当前筛选限制。`,imageSearchChoose:`选择参考图片`,imageSearchReplace:`更换参考图`,imageSearchPaste:`Ctrl / ⌘ + V 粘贴,或将图片拖到这里`,imageSearchReference:`参考图片`,imageSearchBroader:`扩大匹配范围`,imageSearchPrivacy:`仅在本机搜索,参考图不会导入图库。首次搜索会后台建立全库索引,关闭窗口后索引仍会继续。`,imageSearchLimits:`支持压缩、缩放后的近似匹配。大幅裁剪、拼图或遮挡可能找不到;匹配分不是确认同一张图的概率。单张参考图最多 20 MB。`,imageSearchInvalid:`请选择不超过 20 MB 的图片文件。`,imageSearchSearching:`正在查找相同和相似图片…`,imageSearchIndexing:`正在建立全库检索索引 · {loaded} / {total}`,imageSearchIndexFailed:`检索索引未完成,请重试。`,imageSearchReady:`粘贴、拖入或选择一张图片开始搜索`,imageSearchCoverage:`已检索 {loaded} / {total} 张 · 返回前 {count} 个匹配`,imageSearchFailedCount:`{count} 张图片无法生成视觉指纹,仍可按完全相同的文件查找。`,imageSearchPartial:`部分资源尚未完成索引,或文件已经变化。可刷新图库后重试。`,imageSearchRetry:`重新搜索`,imageSearchEmpty:`未找到匹配。可尝试扩大匹配范围,或使用裁剪、遮挡更少的图片。也请确认原图目录已添加到图源。`,imageSearchExact:`文件完全相同`,imageSearchScore:`视觉匹配分 {count}`,imageSearchLocate:`定位文件夹`,imageSearchCopyPath:`复制完整路径`,imageSearchCopied:`已复制完整路径`,imageSearchView:`查看图片`,qolBackGallery:`返回图库`,qolDiscardTitle:`放弃未保存的资源设置?`,qolDiscardBody:`当前资源的修改尚未保存。切换后将丢弃这些修改。`,qolUnsaved:`有未保存的修改`,qolSaved:`与已保存设置一致`,qolMoveConfirm:`将 {count} 张图片从「{source}」移动到「{target}」?同名冲突由服务器处理,不会直接覆盖已有文件;请确认目录后继续。`,qolMoveResult:`已移动 {moved} 张;未找到 {missing} 张;被阻止 {blocked} 张。`,qolMoveBusy:`正在处理移动,请勿重复操作…`,qolPaneScope:`已加载 {loaded} / {total} 张;全选只作用于已加载图片。`,qolLoadMore:`加载更多`,qolMoveScope:`左右目录独立读取,不继承图库筛选。移动前确认来源与目标;失败时保留选择。`,qolVariantSearch:`搜索当前已加载分组`,qolVariantSort:`分组排序`,qolVariantNewest:`最近更新`,qolVariantLargest:`图片数量`,qolVariantScore:`规则得分`,qolVariantCount:`显示 {shown} / {total} 个已加载分组`,qolVariantSafety:`分组用于辅助核对,不代表可以安全删除。相似图、同提示词与同工作流不等于重复文件。`,qolNoMatches:`当前条件没有匹配项,可清除条件后重试。`,qolResetSort:`恢复默认排序`,qolFilterHint:`筛选即时生效;清除筛选不会更改排序。`,qolFormatDetails:`格式转换(可选)`,bulkDeleteConfirm:`将选中的 {count} 张图片移入插件垃圾箱?可在垃圾箱中恢复。`,bulkDeleteHeavyConfirm:`即将把 {count} 张图片移入插件垃圾箱。请确认所选范围,操作可能需要一些时间。`,filterReset:`清除筛选`,loraModelWeight:`模型权重`,loraClipWeight:`文本编码器权重`,workspaceDesc_gallery:`浏览、筛选与整理图片`,workspaceDesc_library:`管理可复用的提示词`,workspaceDesc_workbench:`组合画师与风格提示词`,workspaceDesc_settings:`图源、偏好与诊断`,densityTitle:`网格密度`,densityShort:`密度`,densityHint:`大图看细节,小图快速浏览。`,densityPresets:`选择浏览密度`,densitySpacious:`宽松`,densityBalanced:`适中`,densityCompact:`紧凑`,densityMobileSingle:`舒适单列`,densityMobileDouble:`紧凑双列`,densityEffectiveColumns:`当前实际每行 {count} 列`,densityColumns:`{count} 张 / 行`,densityColumnsLabel:`每行最多图片数`,densityLarger:`放大缩略图`,densitySmaller:`缩小缩略图`,densityResponsiveNote:`设置的是每行上限;窗口较窄时会自动减少列数。`,densityResetDefault:`恢复默认(每行 6 张)`,tourClose:`关闭引导`,tourDensityTitle:`选择舒服的浏览密度`,tourDensityBody:`点击“密度”,选择宽松、适中或紧凑,也可以用滑块微调。设置即时生效;窄屏会自动适配。`,imageRetry:`重试加载`,imageRetryShort:`重试`,imageRetryFull:`重试加载图片`,imageOpenTab:`在新标签页打开`,imageFilmstrip:`图片缩略图导航`,imageFilmstripToggle:`显示或隐藏缩略图导航`,imageLoading:`正在载入原图…`,clearSearch:`清除搜索`,clearCategory:`清除分类筛选`,clearColor:`清除色系筛选`,clearDate:`清除日期筛选`,clearPinned:`清除置顶筛选`,commonMove:`移动`,commonAdd:`加入`,dual_title:`双栏目录整理`,dual_hint:`左右各打开一个目录,可选择、右键或拖拽图片进行整理。`,dual_left:`左侧目录`,dual_right:`右侧目录`,dual_selected:`已选 {count} 张`,dual_selectAll:`全选`,dual_invertSelection:`反选`,dual_clearSelection:`清空`,dual_refresh:`刷新`,dual_moveOther:`移动到另一栏`,dual_dropHint:`拖到这里移动`,dual_readOnly:`目标目录只读`,dual_empty:`这个目录没有图片`,dual_loading:`正在加载目录...`,dual_moving:`正在移动图片...`,dual_moved:`已移动`,dual_moveConfirmTitle:`移动选中图片`,dual_moveConfirm:`将 {count} 张图片移动到“{target}”吗?`,dual_pinConfirm:`将选中的 {count} 张图片设为 Pin 吗?`,dual_unpinConfirm:`取消选中 {count} 张图片的 Pin 吗?`,dual_addToBoardConfirm:`将选中的 {count} 张图片加入“{target}”吗?`,dual_sameFolder:`已在这个目录`,dual_noMatch:`没有匹配目录`,dual_loadError:`目录图片加载失败。`,dual_moveError:`图片移动失败。`,dual_openDetail:`打开详情`,dual_openFull:`打开原图`,dual_openWorkflow:`打开工作流`,dual_metadata:`查看 Metadata`,dual_copyImage:`复制图片`,dual_copyFilename:`复制文件名`,dual_copyPath:`复制路径`,dual_copyPrompt:`复制正向提示词`,dual_copySuccess:`已复制`,dual_copyImageSuccess:`已复制图片`,dual_copyError:`复制失败`,dual_promptMissing:`没有找到正向提示词`,dual_select:`选择`,dual_deselect:`取消选择`,dual_pin:`置顶`,dual_unpin:`取消置顶`,dual_addToBoard:`加入图版`,dual_delete:`删除`,dual_deleteTitle:`删除所选图片`,dual_deleteMessage:`确定删除选中的 {count} 张图片吗?`,dual_deleteSuccess:`已删除`,dual_deleteError:`删除图片失败`,dual_metadataError:`Metadata 加载失败`,dual_swapFolders:`左右目录对调`,dual_moveToRight:`将选中项移入右侧目录`,dual_moveToLeft:`将选中项移入左侧目录`,dual_refreshBoth:`同时刷新双栏`,workspaceSwitch:`切换工作区`,moreActions:`更多操作`,organizeFolders:`双栏整理`,organizeFoldersOpen:`开启双栏目录整理`,organizeFoldersClose:`关闭双栏目录整理`,metadataPartialWarning:`参数摘要可能不完整,请以原始元数据为准。动态提示词不会被重新执行。`,variantRuleScore:`规则评分(非概率)`,variantScopeNotice:`每次最多分析当前排序下的 2,000 张图片;未完成指纹的图片会在后续刷新中补充。分组只是整理建议。`,galleryFilters:`筛选`,appTitle:`Universal Extractor`,appSubtitle:`ComfyUI 图库与词库工作区`,navGallery:`图库`,navLibrary:`词库`,navWorkbench:`工作台`,navSettings:`设置`,navBrand:`Universal Extractor`,navSearchGalleryPlaceholder:`搜索图片、分类或备注...`,navSearchLibraryPlaceholder:`搜索词库文件或词条...`,navRefresh:`刷新`,updatesTitle:`更新`,updatesChecking:`正在检查更新...`,updatesAvailable:`发现新版本`,updatesCurrent:`当前已是最新版本`,updatesCheckNow:`检查更新`,updatesCheckFailed:`无法检查更新`,updatesCurrentVersion:`当前版本`,updatesLatestVersion:`最新版本`,updatesOpenGithub:`在 GitHub 查看`,updatesChangelog:`更新日志`,updatesNoChangelog:`暂无更新日志。`,navLanguage:`语言`,navLanguageZh:`中文`,navLanguageEn:`English`,navLanguageZhShort:`中`,navLanguageEnShort:`EN`,navSwitchToChinese:`切换到中文`,navSwitchToEnglish:`切换到 English`,navToggleSidebar:`切换侧边栏`,sidebarExpand:`展开侧边栏`,sidebarCollapse:`收起侧边栏`,navToggleSearch:`展开搜索`,sidebarResources:`资源目录`,sidebarQuickAccess:`快捷入口`,sidebarOutputDirs:`输出目录`,sidebarInputDirs:`输入目录`,sidebarCustomDirs:`来源目录`,sidebarSourceDirs:`图库目录`,sidebarOutputSource:`输出图库`,sidebarInputSource:`输入图库`,sidebarFolderViewMode:`目录视图模式`,sidebarInputReadOnly:`输入图库为只读`,sidebarSourceReadOnly:`当前来源为只读`,sidebarFolderCount:`{count} 个目录`,sidebarBoardCount:`{count} 个图版`,sidebarCategoryCount:`{count} 个分类`,sidebarLibraries:`JSON 词库`,sidebarCreateLibrary:`新建词库`,sidebarCreateLibraryPlaceholder:`artists-neo.json`,sidebarNoLibraries:`还没有可用词库`,sidebarListView:`列表视图`,sidebarTreeView:`树形视图`,sidebarTrash:`垃圾箱`,sidebarCreateFolder:`新建目录`,sidebarMergeFolder:`合并目录`,sidebarDeleteFolder:`删除目录`,sidebarExpandAll:`全部展开`,sidebarCollapseAll:`全部收起`,sidebarBoards:`图版`,sidebarAllPins:`全部 Pin 图`,sidebarCreateBoard:`新建图版`,sidebarFolderSearch:`搜索目录`,sidebarClearFolderSearch:`清空目录搜索`,sidebarNoFolderMatches:`没有匹配的目录`,sidebarMoreActions:`更多操作`,topStatus:{gallery:`输出图库`,library:`词库资产`,workbench:`工具工作区`,settings:`图库设置`},galleryBannerTitle:`输出图库工作台`,galleryBannerText:`浏览 ComfyUI 默认 output 目录,支持拖拽导入,并用 Pin、图版、分类、备注和元数据检查来管理图片。`,galleryBannerAction:`刷新输出目录`,gallerySectionTitle:`最新输出`,gallerySectionMeta:`悬停卡片可快速查看 prompt 参数,点击卡片查看完整详情。`,galleryEmptyTitle:`没有找到图片`,galleryEmptyText:`试试更换搜索词,或者先在 ComfyUI 中生成一些输出。`,galleryEmptyNoSourceTitle:`暂无可用图源`,galleryEmptyNoSourceText:`前往设置启用或修复图源,然后刷新。`,galleryEmptySourceTitle:`这个图源还没有图片`,galleryEmptySourceText:`可在 ComfyUI 中生成图片,或拖入图片导入 universal_gallery_imports/。`,galleryEmptyFilteredTitle:`没有符合筛选条件的图片`,galleryEmptyFilteredText:`可更换搜索词或清除筛选;现有图片未被删除。`,galleryEmptyErrorTitle:`图库加载失败`,galleryLoading:`正在读取输出图片...`,galleryInspect:`查看详情`,galleryPage:`第 {page} / {totalPages} 页`,galleryPrevious:`上一页`,galleryNext:`下一页`,galleryJumpTo:`跳转到`,galleryJump:`跳转`,galleryStatsTotal:`总图片数`,galleryStatsVisible:`当前载入`,galleryStatsPage:`当前页码`,galleryFilterLabel:`当前结果`,galleryFilterResult:`{count} 张图片`,variantToolbar:`变体`,variantKicker:`本地分析`,variantTitle:`变体整理`,variantSubtitle:`把重复图、近似图、同 Prompt、同 Workflow 和文件名序列的 ComfyUI 输出聚在一起,方便挑图和清理。`,variantFilters:`变体筛选`,variantFilterAll:`全部`,variantRefresh:`分析变体`,variantAnalyzing:`正在分析变体...`,variantEmptyTitle:`还没有变体组`,variantEmptyText:`先分析当前视图,或放宽筛选条件以包含相关的 ComfyUI 输出。`,variantBackToGroups:`返回变体组`,variantRelated:`相关变体`,variantSelectRest:`选择其余项`,variantSelectedGroup:`变体组`,variantImageCount:`{count} 张图片`,variantIndexed:`已分析 {count} 张`,variantPending:`待分析 {count} 张`,variantFailed:`失败 {count} 张`,variantType_exact_duplicate:`重复图`,variantType_near_duplicate:`近似图`,variantType_same_prompt:`同 Prompt`,variantType_same_workflow:`同 Workflow`,variantType_filename_series:`文件序列`,galleryFiltersRealtime:`实时应用`,galleryLiveRefreshPending:`有新图`,galleryLiveRefreshAction:`刷新当前视图`,galleryActiveFilters:`当前条件`,galleryFilterNone:`暂无额外筛选`,galleryFilterStickyHint:`顶部和底部固定,小屏也不会被挡住。`,galleryFilterClose:`关闭`,galleryFavoriteOnly:`仅看 Pin 图`,galleryPinnedOnly:`仅看 Pin 图`,galleryCategory:`分类`,galleryAllCategories:`全部分类`,gallerySort:`排序`,gallerySortBy:`排序`,gallerySortOrder:`顺序`,gallerySortNewest:`最新`,gallerySortName:`名称`,gallerySortSize:`大小`,gallerySortDesc:`降序`,gallerySortAsc:`升序`,gallerySortNewestHint:`按创建时间`,gallerySortNameHint:`按文件名`,gallerySortSizeHint:`按文件大小`,gallerySortDescHint:`从大到小 / 新到旧`,gallerySortAscHint:`从小到大 / 旧到新`,galleryDateFrom:`开始`,galleryDateTo:`结束`,galleryDateRange:`日期范围`,galleryDateClear:`清空日期`,galleryColorFamily:`色系`,galleryAllColors:`全部色系`,galleryColorIndexing:`色系索引补全中`,galleryColorThreshold:`色系占比达到 25% 才会命中筛选。`,colorFamily_red:`红色`,colorFamily_orange:`橙色`,colorFamily_yellow:`黄色`,colorFamily_green:`绿色`,colorFamily_cyan:`青色`,colorFamily_blue:`蓝色`,colorFamily_purple:`紫色`,colorFamily_pink:`粉色`,colorFamily_brown:`棕色`,colorFamily_black:`黑色`,colorFamily_white:`白色`,colorFamily_gray:`灰色`,colorFamily_warm:`暖色`,colorFamily_cool:`冷色`,colorFamily_low_saturation:`低饱和`,galleryBackToTop:`回到顶部`,galleryColumns:`每行列数`,galleryMoreCategories:`更多`,galleryCategoryBrowse:`浏览全部分类`,galleryCategoryBrowseHint:`从所有可用分类中搜索并选择。`,galleryOutputFolder:`输出目录`,galleryOutputImportPath:`拖拽导入路径`,galleryImportTarget:`导入目标`,galleryDropTitle:`拖拽文件到这里导入`,galleryDropText:`图片存入所选图源的 universal_gallery_imports/ 目录;JSON 存入词库(data/)。`,trashTitle:`垃圾箱`,trashEmptyTitle:`垃圾箱为空`,trashEmptyText:`删除的内容暂存在这里。移出到系统回收站失败时,文件仍保留在这里。`,trashRestore:`恢复`,trashDeleteForever:`移至系统回收站`,trashItemCount:`{count} 个项目`,trashSelectionHint:`默认可左键点选,也可以按住左键拖出选区多选。`,trashSelectAll:`全选`,trashClearSelection:`清空选择`,trashRestoreSelected:`恢复所选`,trashDeleteSelectedForever:`所选移至系统回收站`,trashRestoreSelectedConfirm:`确定恢复选中的 {count} 个项目吗?`,trashDeleteSelectedConfirm:`将所选 {count} 个项目移至系统回收站?成功后请在操作系统中恢复或清空。`,trashRestoreSelectedSuccess:`已恢复 {count} 个项目`,trashDeleteSelectedSuccess:`已将 {count} 个项目移至系统回收站`,trashBatchPartial:`已完成 {completed} 项,未完成 {unfinished} 项;请查看原因后重试`,trashOperationBusy:`正在处理垃圾箱,请等待本次操作完成`,trashKindImage:`图片`,trashKindFolder:`文件夹`,trashKindLibrary:`词库`,trashImageCount:`{count} 张图片`,galleryImportSuccess:`导入完成:{count} 个文件`,galleryImportSavedTo:`图片已存入 {target}`,galleryImportLibrariesSavedTo:`{count} 个 JSON 文件已存入词库 data/`,galleryOpenImportFolder:`打开导入目录`,galleryImportSkipped:`跳过 {count} 个不支持的文件`,galleryCategoryPlaceholder:`分类,例如:角色 / 风格 / 草图`,galleryNotesPlaceholder:`备注、来源或整理说明`,galleryTitlePlaceholder:`自定义标题`,galleryFavorite:`Pin 图`,galleryUnfavorite:`取消 Pin`,galleryPin:`Pin 图`,galleryUnpin:`取消 Pin`,gallerySelectImage:`选择图片`,galleryDeselectImage:`取消选择图片`,galleryHoverTitle:`快速元数据`,galleryHoverPrompt:`正向 Prompt`,galleryHoverNegative:`负向 Prompt`,galleryHoverArtists:`画师串`,galleryHoverNoPrompt:`未读取到 Prompt 内容`,libraryBannerTitle:`词库管理工作台`,libraryBannerText:"统一管理 `data/*.json` 词库文件,直接在网页中查看、编辑和保存 Prompt 数据。",libraryBannerAction:`刷新词库`,librarySelectTitle:`选择一个词库文件`,librarySelectText:`从左侧列表中选择一个 JSON 文件,或直接新建一个词库开始编辑。`,libraryWorkspaceSubtitle:`{name} · 共 {count} 条,可直接搜索、编辑和生成`,libraryEntries:`词条数量`,libraryActive:`当前文件`,libraryEdit:`编辑 JSON`,libraryImport:`导入`,libraryAddFile:`添加词库`,libraryExport:`导出`,libraryFormat:`格式化 JSON`,librarySave:`保存`,libraryCancel:`取消`,libraryLoading:`正在读取词库内容...`,libraryDetail:`词库详情`,libraryNoDescription:`暂无描述`,libraryEmptyTitle:`这个词库还是空的`,libraryEmptyText:`可以先用新手模板起步,或手动添加第一条记录,再通过搜索和生成慢慢打磨。`,librarySaveSuccess:`词库已保存({count} 条)`,libraryCreateSuccess:`词库已创建`,libraryImportSuccess:`已导入到 {name}({count} 条)`,libraryUnsavedChanges:`有未保存修改`,librarySavedState:`已保存`,libraryUnsavedTitle:`有未保存修改`,libraryUnsavedConfirm:`是否放弃未保存的词库修改?`,libraryDiscardChanges:`放弃修改`,libraryLargeEditHint:`大词库请使用单条编辑`,libraryAddEntry:`新增词条`,libraryStarterTemplate:`新手模板`,libraryEntryEditorHint:`按单条 JSON 记录编辑,避免整份大文件载入浏览器后卡顿。`,libraryDeleteEntryConfirm:`确定删除这条词库记录吗?`,libraryOverviewEntries:`词库规模`,libraryOverviewEntriesHint:`先看条目规模,再决定用单条编辑还是整库 JSON 编辑。`,libraryOverviewAliases:`别名覆盖`,libraryOverviewAliasesHint:`带别名的条目更容易在后期整理和搜索时被找到。`,libraryOverviewTags:`标签密度`,libraryOverviewTagsHint:`标签越清晰,后面做筛选、迁移和复用就越省力。`,libraryOverviewModels:`模型提示`,libraryOverviewModelsHint:`模型备注能帮助新手快速判断这条更适合在哪类模型里用。`,libraryGuideTitle:`新手上手路径`,libraryGuideStepOne:`先分清词库用途:画师、风格、角色,还是常用提示片段。`,libraryGuideStepTwo:"把 `name` 或 `title` 保持简短稳定,把真正要复用的内容写进 `prompt`。",libraryGuideStepThree:`补齐别名、标签和说明,后续搜索与整理会轻松很多。`,libraryGuideStepFour:`编辑完就去工作区测试,哪些条目好用、哪些不稳,再回头继续修正。`,libraryFieldGuideTitle:`推荐字段`,libraryFieldNameHint:`优先保存原始标签名,或最稳定、最短的检索名。`,libraryFieldPromptHint:`保存真正会被复用的提示词片段,方便后面直接复制进工作流。`,libraryFieldAliasHint:`补充别称、缩写和译名,提升后续搜索命中率。`,libraryFieldTagsHint:`用小颗粒标签标识用途,比如 artist、portrait、pony、sdxl。`,libraryFieldModelHint:`记录这一条更适合的模型族或 checkpoint。`,libraryFieldDescriptionHint:`写实用备注,比如优点、缺点、适用场景或不推荐搭配。`,librarySearchActive:`当前搜索:{name}`,librarySearchReady:`搜索已就绪`,librarySearchHint:`顶部搜索会匹配 name、prompt、tags、other_names、model、description,以及该条 JSON 中的其他文本。`,librarySearchClear:`清空搜索`,libraryTopTags:`当前页高频标签`,libraryTopModels:`当前页模型备注`,libraryNoTagsYet:`当前结果里还没有标签`,libraryNoModelsYet:`当前结果里还没有模型备注`,libraryReadyToCopy:`可复用`,libraryEntryStatus:`第 {count} 条`,libraryCopyJson:`复制 JSON`,libraryCopyJsonSuccess:`已复制词条 JSON`,libraryCopyPrompt:`复制提示词`,libraryTemplateArtist:`画师条目`,libraryTemplateArtistHint:`适合画师名、Danbooru 画师标签和可复用画师提示词。`,libraryTemplateArtistDescription:`画师条目优先保留原始标签名,方便生成器和检索一起工作。`,libraryTemplateStyle:`风格条目`,libraryTemplateStyleHint:`适合整段风格、氛围、光影类提示词模板。`,libraryTemplateStyleDescription:`风格条目适合保存整段提示词,后续可直接复制进工作流。`,libraryTemplateCharacter:`角色条目`,libraryTemplateCharacterHint:`适合角色、主体、服装外观等重复使用的设定。`,libraryTemplateCharacterDescription:`角色条目建议把核心外观特征写进 prompt,把俗称放到 other_names。`,libraryTemplatePanelTitle:`快捷模板`,libraryValidationTitle:`校验问题`,libraryValidationGlobal:`全局`,libraryImportTitle:`导入词库 JSON`,libraryImportText:`可以选择新建词库、替换现有词库,或合并到当前词库。`,libraryImportModeCreate:`新建词库`,libraryImportModeReplace:`替换词库`,libraryImportModeMerge:`合并到词库`,libraryImportFile:`JSON 文件`,libraryImportFileEmpty:`未选择文件`,libraryImportNewName:`新词库名称`,libraryImportTarget:`目标词库`,libraryImportChooseTarget:`选择目标词库`,libraryImportConfirm:`导入 JSON`,libraryImportConfirmAsk:`是否将“{name}”作为词库文件导入?`,libraryImportConfirmTitle:`确认导入词库`,libraryImportCreateConfirm:`从“{name}”创建新词库吗?`,libraryImportReplaceConfirm:`用导入的 JSON 覆盖“{name}”中的所有条目吗?`,libraryImportMergeConfirm:`将导入条目合并到“{name}”中吗?`,librarySaveConfirmTitle:`保存词库修改`,librarySaveConfirm:`用当前编辑器内容覆盖“{name}”吗?`,librarySaveEntryConfirmTitle:`保存条目`,librarySaveEntryConfirm:`将这个条目保存到当前词库吗?`,libraryDropTitle:`将 JSON 词库拖到这里`,libraryDropText:`会先检查文件是否为 JSON,再询问你要如何添加。`,workbenchTitle:`工作区`,workbenchSubtitle:`预置多个工具卡片,用于提示词拼装、画师串生成和后续扩展工具。`,workbenchAppTitle:`工作台`,workbenchAppSubtitle:`从词库组合提示词,管理预选内容与灵感。`,workbenchToolShelf:`工具架`,workbenchToolShelfHint:`点击当前需要的工具图标即可切换,后续扩展新工具也不会打乱工作区布局。`,workbenchToolReady:`可用`,workbenchToolNew:`新增`,workbenchStatusStrip:`工作区状态`,workbenchActiveTool:`当前工具`,workbenchLibraryCount:`词库`,workbenchQueueCount:`预选`,workbenchGeneratorMetrics:`生成器摘要`,workbenchResultTokens:`结果段`,workbenchRecipeSection:`生成配方`,workbenchOutputSection:`生成输出`,workbenchFormatSection:`格式后处理`,workbenchFormattedTokens:`已转换 {count} 个片段`,toolArtistGenerator:`画师串生成器`,toolArtistGeneratorDesc:`从当前 JSON 词库预设中生成可复用的画师提示词组合。`,toolInspirationHub:`灵感收集站`,inspirationHubTitle:`图库与视觉参考聚合`,inspirationHubDesc:`把高价值图库、作品集和灵感站点集中成一个简洁入口,可按推荐程度或日常使用频率排序。`,inspirationMetricSites:`站点`,inspirationRecommendation:`推荐`,inspirationFrequency:`频率`,inspirationSearchPlaceholder:`搜索站点、类型或适用场景...`,inspirationSortRecommendation:`按推荐排序`,inspirationSortFrequency:`按频率排序`,inspirationSortName:`按名称排序`,inspirationType_all:`全部类型`,inspirationType_moodboard:`灵感板`,inspirationType_portfolio:`作品集`,inspirationType_illustration:`插画概念`,inspirationType_product:`产品界面`,inspirationType_ai:`AI 图像`,inspirationRegionGlobal:`全球`,inspirationRegionChina:`中国`,inspirationOpenSite:`打开站点`,inspirationPinterestDesc:`综合型灵感板,适合快速找构图、配色、服装、室内、摄影和视觉方向参考。`,inspirationPinterestBest:`快速拼灵感板和发散想法`,inspirationHuabanDesc:`中文视觉采集社区,插画、设计、摄影、生活方式和素材板都比较丰富。`,inspirationHuabanBest:`中文语境参考和素材板`,inspirationBehanceDesc:`偏作品集与案例展示,适合看品牌、版式、活动视觉和完整设计系统的呈现方式。`,inspirationBehanceBest:`成熟案例和成套设计系统`,inspirationArtStationDesc:`概念艺术、角色、场景、3D、游戏和影视娱乐设计质量很高,适合找生产级风格参考。`,inspirationArtStationBest:`概念艺术和高完成度风格`,inspirationDribbbleDesc:`聚焦 UI、图标、应用界面、动效和产品视觉片段,适合找界面细节和视觉手感。`,inspirationDribbbleBest:`UI 细节和产品界面灵感`,inspirationCosmosDesc:`干净的个人收藏平台,适合保存视觉参考、截图、链接和连续的创作线索。`,inspirationCosmosBest:`个人灵感收纳`,inspirationArenaDesc:`偏研究型的视觉板,适合艺术方向、设计理论、视觉文化和概念参考整理。`,inspirationArenaBest:`深度研究和主题板`,inspirationDesignspirationDesc:`搜索体验直接,适合找字体、配色、海报、编辑设计和网页视觉情绪。`,inspirationDesignspirationBest:`配色与字体方向搜索`,inspirationLapaDesc:`真实落地页图库,适合参考产品首页、首屏结构、版式节奏和转化路径。`,inspirationLapaBest:`落地页和网页布局参考`,inspirationLexicaDesc:`AI 图像搜索与提示词相关浏览,适合快速探索风格方向和生成参考。`,inspirationLexicaBest:`AI 风格探索`,toolComingSoon:`敬请期待`,artistLibrarySource:`词库来源`,artistGenerate:`生成`,artistCount:`数量`,artistMode:`模式`,artistRandom:`随机`,artistSequential:`顺序`,artistPrefix:`前缀`,artistSuffix:`后缀`,artistSeparator:`分隔符`,artistSeed:`种子`,artistResult:`生成结果`,artistCopyResult:`复制结果`,artistNoLibraries:`没有可用词库`,workbenchMode:`模式`,workbenchModePure:`纯净`,workbenchModeStandard:`标准权重`,workbenchModeCreative:`创意括号`,workbenchModeNai:`NAI`,workbenchPostFilter:`作品数过滤`,workbenchPostThreshold:`作品数阈值`,workbenchFilterNone:`不过滤`,workbenchFilterGreater:`大于`,workbenchFilterLess:`小于`,workbenchWeightMin:`权重下限`,workbenchWeightMax:`权重上限`,workbenchBracketStyle:`括号样式`,workbenchNestLevels:`嵌套层数`,workbenchCustomFormat:`自定义格式`,workbenchFormatString:`格式字符串`,workbenchFormatTool:`格式转换`,workbenchFormatToolAnima:`Anima 格式`,workbenchFormatToolCustom:`自定义格式`,workbenchFormatToolTemplate:`模板`,workbenchFormatToolApply:`执行转换`,workbenchFormatToolResult:`转换结果`,workbenchFormatToolAnimaHint:`把 name_(group) 这类标签转换为 @name \\(group\\) 形式,方便用于 Anima 后处理。`,workbenchFormatApplied:`格式转换已完成`,workbenchPreselected:`预选画师`,workbenchPreselectedEmpty:`在右侧画师池里添加画师,生成时会优先使用这些名字。`,workbenchArtistPool:`画师池`,workbenchArtistPoolHint:`按名称或别名搜索画师,然后加入预选队列。`,workbenchGenerateSuccess:`画师串已生成`,workbenchCopyError:`复制生成结果失败`,workbenchEmptyHint:`先生成一次结果,这里会显示选中的词条和最终拼接文本预览。`,workbenchPreviewHint:`在生成前先预览当前词库的部分词条,更容易确认来源是否正确。`,commonLoading:`加载中...`,commonEnabled:`已启用`,commonDisabled:`未启用`,viewMode:`排列方式`,viewGrid:`网格`,viewList:`列表`,bulkActions:`批量操作`,bulkSelectMode:`选择模式`,bulkSelectionHint:`仅作用于当前页。开启后可左键点选,或按住左键框选当前页图片。`,bulkSelected:`已选 {count} 项`,bulkFavorite:`批量 Pin`,bulkUnfavorite:`取消 Pin`,bulkPin:`Pin 所选`,bulkUnpin:`取消 Pin`,bulkAddToBoard:`加入图版`,bulkRemoveFromBoard:`移出图版`,bulkSetCategory:`设置分类`,bulkMoveTo:`移动到目录`,bulkPinConfirm:`将选中的 {count} 张图片设为 Pin 吗?`,bulkUnpinConfirm:`取消选中 {count} 张图片的 Pin 吗?`,bulkAddToBoardConfirm:`将选中的 {count} 张图片加入“{target}”吗?`,bulkRemoveFromBoardConfirm:`将选中的 {count} 张图片从“{target}”移出吗?`,bulkSetCategoryConfirm:`将选中的 {count} 张图片分类设为“{target}”吗?`,bulkMoveConfirm:`将选中的 {count} 张图片移动到“{target}”吗?`,bulkRenameConfirm:`用“{target}”规则重命名选中的 {count} 张图片吗?`,bulkRenameTemplatePlaceholder:`重命名规则,例如 set-{page}-{n} 或 {name}-v2`,bulkRenameStart:`起始`,bulkRenamePadding:`补位`,bulkRenameApply:`重命名`,bulkRenameRuleTitle:`规则说明`,bulkRenameRuleHint:`支持 {n}=序号,{name}=原文件名(不含扩展名),{page}=当前页码。原扩展名会自动保留。`,bulkRenameSuccess:`已重命名 {count} 张图片`,bulkRenameError:`批量重命名失败`,bulkDelete:`删除所选`,imageDelete:`删除图片`,bulkClear:`清空选择`,bulkSelectVisible:`全选当前页`,imageRenameError:`重命名图片失败`,imageDeleteError:`删除图片失败`,inspectorFolderTitle:`当前视图`,inspectorFolderHint:`未选择图片时,这里显示当前目录、筛选结果和快捷操作。`,inspectorVisibleCount:`当前页`,inspectorSingleHint:`这里仅处理已选图片的批量管理:Pin、移动、分类、重命名、加入图版或删除。`,inspectorFilename:`文件名`,inspectorCategory:`分类`,inspectorSource:`来源`,inspectorSize:`大小`,inspectorCreated:`创建时间`,inspectorEmptyValue:`未设置`,modalClose:`关闭详情`,modalTitle:`图像详情`,modalOpenFull:`打开原图`,modalOpenWorkflow:`在 ComfyUI 中打开工作流`,modalExpandImage:`展开图片`,modalZoomIn:`放大图片`,modalZoomOut:`缩小图片`,modalFitImage:`适应窗口`,modalToggleInspector:`显示或隐藏侧边信息`,modalGestureHint:`滚轮缩放,左键拖拽平移,双击重置`,modalPromptHits:`命中画师串`,modalMetadataBlocks:`元数据块`,modalLoading:`正在读取嵌入的工作流元数据...`,modalPromptSection:`命中的词库提示词`,modalMetadataSection:`元数据块`,modalRawMetadata:`原始元数据`,modalNoMetadata:`这张图片中没有检测到 prompt 或 workflow 元数据。`,metadataView:`查看 Metadata`,metadataPromptSummary:`提示词摘要`,metadataPositivePrompt:`正面提示词`,metadataNegativePrompt:`负面提示词`,metadataCopyPositive:`复制正面提示词`,metadataCopyPositiveSuccess:`正面提示词已复制`,metadataCopyRaw:`复制原始 Metadata`,metadataCopyRawSuccess:`原始 Metadata 已复制`,metadataNoPositivePrompt:`未找到正面提示词`,metadataNoNegativePrompt:`未找到负面提示词`,metadataLoadError:`读取图片 Metadata 失败`,recipeTitle:`生成配方 (Recipe)`,recipeCheckpoint:`模型 Checkpoint`,recipeLoras:`LoRA 堆栈`,recipeParams:`生成参数`,recipeSeed:`Seed 种子`,recipeSteps:`步数 Steps`,recipeCfg:`CFG Scale`,recipeSampler:`采样器 Sampler`,recipeScheduler:`调度器 Scheduler`,recipeSize:`分辨率 Size`,recipeDenoise:`降噪 Denoise`,recipeCopyPositive:`复制正面提示词`,recipeCopyNegative:`复制负面提示词`,recipeCopySeed:`复制种子`,recipeCopyFull:`复制完整配方`,recipeCopiedSuccess:`已复制到剪贴板`,recipeApplyLoraStack:`应用 LoRA 堆栈`,recipeSendWorkflow:`发送工作流到 ComfyUI`,modalEditSection:`图像管理`,modalCategory:`分类`,modalTitleField:`标题`,modalFilenameField:`文件名`,modalNotesField:`备注`,modalSaveState:`保存图像信息`,modalSaveHint:`这里保存标题、分类、备注和 Pin 状态;文件名需要单独重命名。`,modalFilenameRenameHint:`文件名尚未保存;请点“重命名文件”,保存图像信息不会更改文件名。`,modalUnsavedStateTitle:`还有未保存的图像修改`,modalUnsavedStateText:`当前图像信息尚未保存。保存后继续、放弃修改,还是取消操作?`,modalUnsavedFilenameText:`文件名拟改为“{target}”,可能还有其他修改。保存后继续将先保存信息并重命名文件;也可以放弃或取消。`,modalUnsavedLoadingText:`图像信息仍在加载,暂不能保存。请稍候再试,或放弃草稿。`,modalSaveAndContinue:`保存并继续`,modalWaitForMetadata:`图像信息仍在加载,请稍后再保存。`,modalFilenameRequired:`文件名不能为空。`,modalDiscardChanges:`放弃修改`,modalUnsavedStateBadge:`未保存`,modalSavedStateBadge:`已保存`,modalRenameFile:`重命名文件`,modalDeleteFile:`删除文件`,commonEntries:`{count} 条记录`,commonDelete:`删除`,commonConfirm:`确认`,commonCreate:`创建`,commonSend:`发送`,commonNoneSelected:`未选择`,commonCopy:`复制`,notificationDismiss:`关闭提醒`,operationRefresh:`正在刷新...`,operationRefreshSuccess:`图库刷新完成`,galleryRefreshInterrupted:`切换视图后已中断刷新`,operationCreateLibrary:`正在创建词库...`,operationSaveLibrary:`正在保存词库...`,operationImportLibrary:`正在导入词库...`,operationDeleteLibrary:`正在删除词库...`,operationCreateBoard:`正在创建图版...`,operationDeleteBoard:`正在删除图版...`,operationAddToBoard:`正在加入图版...`,operationRemoveFromBoard:`正在移出图版...`,operationUpdateImages:`正在更新图片...`,operationUpdateImagesSuccess:`图片已更新`,operationMoveImages:`正在移动图片...`,operationMoveImagesSuccess:`图片已移动`,operationMoveUnchanged:`已在目标目录 {count} 张(未移动)。`,operationUnaccounted:`结果未确认 {count} 张(保留选择)。`,operationUnprocessedPaths:`未处理:{target}`,operationViewDetails:`查看详情`,operationRenameImages:`正在重命名图片...`,operationDeleteImages:`正在删除图片...`,operationDeleteImagesResult:`已移入垃圾箱 {count} 张;未处理 {missing} 张。`,operationCreateFolder:`正在创建目录...`,operationMergeFolder:`正在合并目录...`,operationMoveFolder:`正在移动目录...`,operationRenameFolder:`正在重命名目录...`,operationDeleteFolder:`正在删除目录...`,operationImportFiles:`正在导入文件...`,operationRenameImage:`正在重命名图片...`,operationDeleteImage:`正在删除图片...`,operationRestoreTrash:`正在恢复垃圾箱项目...`,operationPurgeTrash:`正在移至系统回收站...`,operationSendWorkflow:`正在发送工作流...`,operationApplyLoraStack:`正在应用 LoRA 堆...`,operationRunDiagnostics:`正在运行诊断...`,operationTestPath:`正在测试路径...`,operationSaveSource:`正在保存目录源...`,operationDeleteSource:`正在删除目录源...`,operationGenerateArtists:`正在生成画师串...`,contextCopyImage:`复制图片`,contextCopyFilename:`复制文件名`,contextCopyPath:`复制路径`,contextCopyImageSuccess:`已复制图片到剪贴板`,contextCopyImageLinkSuccess:`已复制图片链接到剪贴板`,contextCopyFilenameSuccess:`已复制文件名`,contextCopyPathSuccess:`已复制路径`,contextCopyError:`复制失败`,contextCopyImageError:`复制图片失败`,imageDeleteConfirm:`确定删除图片“{name}”吗?`,imageDeleteMissing:`图片未被删除:文件不存在或图源为只读。`,imageRenameConfirm:`将“{name}”重命名为“{target}”吗?`,imageRenameWithStateConfirm:`将先保存当前图像信息的修改,再把“{name}”重命名为“{target}”。继续吗?`,imageStateSaveConfirm:`保存“{name}”的图像信息修改吗?`,imagePinConfirm:`将“{name}”设为 Pin 吗?`,imageUnpinConfirm:`取消“{name}”的 Pin 吗?`,confirmDeleteLibrary:`确定删除“{name}”吗?`,galleryImportConfirmTitle:`导入文件`,galleryImportConfirm:`导入 {count} 个文件?图片将存入 {target};JSON 词库将存入 data/*.json。`,folderCreatePrompt:`输入新的输出目录路径`,folderDeleteConfirm:`确定删除目录“{name}”及其内部所有文件吗?`,folderMergePrompt:`输入要合并到的目标目录路径`,folderCreateTitle:`新建输出目录`,folderCreateText:`请输入相对于 ComfyUI output 的目录路径。`,folderMergeTitle:`合并输出目录`,folderMergeText:`将当前选中的目录移动并合并到另一个输出目录。`,folderMergeConfirm:`将“{name}”合并到“{target}”吗?目录内文件可能会被移动到目标目录。`,folderMoveTitle:`移动目录`,folderMoveConfirm:`将“{name}”移动到“{target}”中吗?`,folderRenameTitle:`重命名输出目录`,folderRenameText:`修改目录路径。可输入同级新名称,也可以输入新的相对目录路径。`,folderRenameConfirm:`将“{name}”重命名或移动为“{target}”吗?`,folderRenamePrompt:`输入新的输出目录路径`,folderPathPlaceholder:`目录/子目录`,folderCreateSuccess:`目录已创建`,folderDeleteSuccess:`目录已删除`,folderMergeSuccess:`目录已合并`,folderMoveSuccess:`目录已移动`,folderRenameSuccess:`目录已重命名`,folderCreateError:`创建目录失败`,folderDeleteError:`删除目录失败`,folderMergeError:`合并目录失败`,folderMoveError:`移动目录失败`,folderRenameError:`重命名目录失败`,folderMove:`移动`,folderRename:`重命名`,folderPin:`置顶目录`,folderUnpin:`取消置顶`,folderSortByName:`按名称排序`,folderSortByModified:`按修改时间排序`,folderSortAsc:`按名称升序`,folderSortDesc:`按名称降序`,boardCreateTitle:`新建图版`,boardCreateText:`图版用于收集 Pin 图,不会移动原始输出文件。`,boardCreateConfirm:`创建图版“{name}”吗?`,boardNameLabel:`图版名称`,boardNamePlaceholder:`角色参考 / 光影测试`,boardCreateSuccess:`图版已创建`,boardCreateError:`创建图版失败`,boardAddToTitle:`加入图版`,boardAddToText:`为已选的 {count} 张图片选择一个图版。`,boardAddToAction:`加入图版`,boardAddSuccess:`已将 {count} 张图片加入图版`,boardEmptyText:`还没有图版`,boardCreateInline:`也可以直接新建图版`,boardDeleteTitle:`删除图版`,boardDeleteConfirm:`确定删除图版“{name}”吗?图片会保留在输出目录中。`,boardDeleteSuccess:`图版已删除`,boardShareTitle:`生成分享图`,boardShareText:`5 列 x 4 行的小型预览图已准备好。`,boardShareSubtitle:`{count} 张 Pin 图`,boardShareDownload:`下载分享图`,boardShareError:`生成分享图失败`,settingsKicker:`目录源管理`,settingsTitle:`设置`,settingsSubtitle:`管理图片目录、浏览偏好与资源诊断。`,settingsActiveSources:`启用目录源`,settingsIndexedImages:`已索引图片`,settingsSourcesTitle:`图片目录`,settingsSourcesHint:`可启用多个目录,支持跨盘路径,并指定拖拽导入的落点。`,settingsAddSource:`添加自定义目录`,settingsNewSource:`新的自定义目录`,settingsDefaultLockedHint:`默认 ComfyUI 目录会锁定名称和路径,但仍可启用或禁用。`,settingsCustomHint:`自定义目录可以指向任意本地或挂载目录,并融合进图库浏览。`,settingsSourceName:`目录名称`,settingsSourceNamePlaceholder:`参考盘 / 归档目录`,settingsSourcePath:`目录路径`,settingsSourcePathPlaceholder:`D:\\images\\reference-library`,settingsSourceEnabled:`启用`,settingsSourceWritable:`允许文件操作`,settingsSourceRecursive:`扫描子目录`,settingsSourceImportTarget:`导入落点`,settingsSourceTest:`测试路径`,settingsSourceSave:`保存目录源`,settingsSourceDelete:`删除目录源`,settingsSourceScan:`重新扫描`,settingsPreferencesTitle:`界面与交互偏好`,settingsPreferencesHint:`这些开关只保存在当前浏览器,用来控制图库的默认交互方式。`,settingsOnboardingTitle:`新手互动教程`,settingsOnboardingHint:`重新播放图库、词库、画师工作台和图源设置的引导流程。`,settingsOnboardingRestart:`重新打开新手教程`,settingsPrefDefaultSelection:`默认进入选择模式`,settingsPrefDefaultSelectionHint:`关闭后,单击图片默认打开详情;需要框选时再手动点选选择模式。`,settingsPrefConfirmWorkflow:`发送工作流前确认`,settingsPrefConfirmWorkflowHint:`关闭后,点击“在 ComfyUI 中打开工作流”会直接发送到已打开的 ComfyUI 页面。`,settingsPrefCollapseSidebar:`启动时收起侧边栏`,settingsPrefCollapseSidebarHint:`桌面端打开图库时默认收起左侧资源栏,适合小屏或专注看图。`,settingsPrefImagePrefetch:`预加载附近图片`,settingsPrefImagePrefetchHint:`滚动图库时提前加载附近缩略图,关闭后可减少后台网络和磁盘读取。`,settingsPrefLiveRefresh:`图库自动同步最新输出`,settingsPrefLiveRefreshHint:`工作流完成后自动同步;可见时每 15 秒检查遗漏。整理时保持位置,关闭后仅手动刷新。`,settingsPrefFolderTree:`目录默认树形视图`,settingsPrefFolderTreeHint:`关闭后输出目录默认使用平铺列表,更适合目录层级很浅的图库。`,tourWelcomeTitle:`欢迎使用 Universal Gallery`,tourWelcomeBody:`用一分钟了解常用功能。每一步都会高亮对应的位置;你可以随时跳过,之后在设置中重新开始。`,tourTopbarTitle:`在工作区之间切换`,tourTopbarBody:`点击左上角的工作区名称,在图库、词库、工作台和设置之间切换。每个选项都附有用途说明。`,tourSidebarTitle:`浏览图源与目录`,tourSidebarBody:`这里按图源组织目录。点击目录查看图片;目录右侧的更多菜单可切换树形/列表视图、排序和整理文件夹。`,tourGalleryTitle:`浏览、筛选与排序图片`,tourGalleryBody:`从这里搜索图片名称、分类或备注。旁边的“筛选”可限定日期、颜色与置顶状态;按 / 可快速定位搜索框。`,tourSelectionTitle:`选择与批量操作`,tourSelectionBody:`打开选择模式后,可以点击选择、Shift 连选,或直接框选。框选会保持拖拽开始时的布局,滚动页面时也会继续命中正确图片。`,tourDetailTitle:`查看详情并发送工作流`,tourDetailBody:`点击图片查看大图和参数,使用左右方向键切换。双击图片可放大,双击空白处退出;工作流操作在详情工具栏中。`,tourLibraryTitle:`管理提示词词库`,tourLibraryBody:`在词库中搜索、导入、导出和编辑 JSON 提示词。条目可以用于抽取节点,也可以在工作台中组合。`,tourWorkbenchTitle:`组合可复用提示词`,tourWorkbenchBody:`从词库中选择画师和标签,调整格式并复制生成的提示词。未加载词库时可以先回到词库导入。`,tourSettingsTitle:`调整图源与偏好`,tourSettingsBody:`在设置中管理图源与偏好,检查诊断信息。以后想再看这份引导,点击这里的“重新开始教程”。`,tourDoneTitle:`可以开始使用了`,tourDoneBody:`已经准备好了。完成后可以自由浏览;这份引导不会自动重开,需要时可从设置进入。`,tourSkip:`跳过`,tourPrevious:`上一步`,tourNext:`下一步`,tourFinish:`完成`,tourStepProgress:`第 {page} / {totalPages} 步`,tourTargetMissing:`这里目前没有可高亮的内容(可能尚无图片或词库)。可以继续下一步。`,settingsPathOk:`路径可用,顶层发现 {count} 张图片。`,settingsPathMissing:`路径不存在,或不是文件夹。`,settingsPathError:`测试路径失败`,settingsSourceSaved:`目录源已保存`,settingsSourceSaveError:`保存目录源失败`,settingsSourceSaveConfirm:`保存目录源“{name}”的修改吗?这可能改变可写目录或索引范围。`,settingsSourceCreateConfirm:`将“{name}”添加为图库目录源吗?`,settingsSourceDeleted:`目录源已删除`,settingsSourceDeleteError:`删除目录源失败`,settingsSourceDeleteConfirm:`确定从图库目录源中移除“{name}”吗?`,settingsDiagnostics:`源状态诊断`,settingsDiagnosticsHint:`检查可访问性、读写权限、目录重叠、图片数量和磁盘空间。`,settingsDiagnosticsRun:`运行诊断`,settingsDiagnosticsDone:`诊断完成`,settingsDiagnosticsError:`诊断失败`,settingsDiagnosticImages:`{count} 张图片`,settingsDiagnosticFolders:`{count} 个文件夹`,settingsDiagnosticOverlap:`{count} 处重叠`,settingsStatus_ok:`正常`,settingsStatus_missing:`缺失`,settingsStatus_error:`异常`,settingsStatus_unreadable:`不可读`,settingsStatus_write_blocked:`不可写`,settingsStatus_overlap:`路径重叠`,workflowSendSuccess:`工作流已发送到 ComfyUI`,workflowSendConfirm:`是否将“{name}”中的工作流发送到 ComfyUI?`,loraStackApply:`应用 LoRA 堆到当前工作流`,loraStackReading:`读取图片的 LoRA 堆…`,loraStackApplyConfirm:`将“{name}”中的 {count} 个 LoRA 应用到当前工作流?仅修改选中的 LoRA Manager 节点;未选中时修改第一个。追加保留旧条目并更新同名 LoRA;覆盖则替换该节点的旧堆。`,loraStackClipWarning:`其中 {count} 个 LoRA 的 CLIP 强度与主强度不同:发送时会折叠但保留原值;若在折叠状态下调整主强度,LoRA Manager 会同步覆盖 CLIP。`,loraStackAppend:`追加到原堆`,loraStackReplace:`覆盖旧堆`,loraStackAppendedSuccess:`已将 {count} 个 LoRA 合并到“{name}”`,loraStackReplacedSuccess:`已用 {count} 个 LoRA 覆盖“{name}”`,loraStackAppendDetail:`新增 {added} 项,同名更新 {updated} 项;其他旧条目保持原样。`,loraStackReplaceDetail:`移除旧条目 {removed} 项,同名更新 {updated} 项。`,loraStackApplyNoStack:`这张图未识别到可用的 ComfyUI-Lora-Manager LoRA 堆。`,loraStackApplyNoComfyPage:`未找到可接收的 ComfyUI 页面。请保持 ComfyUI 主界面已打开并刷新一次。`,loraStackBridgeOutdated:`当前 ComfyUI 页面仍运行旧版插件脚本;本次发送已被拦截,以免“追加”误删旧 LoRA。请重启 ComfyUI,并强制刷新主页面及图库后重试。`,loraStackApplyNoTargetNode:`当前工作流里未找到可写入的 LoRA Manager 节点。`,loraStackApplySuccess:`LoRA 堆已应用到当前工作流`,trashRestoreConfirm:`将这个回收站项目恢复到原位置吗?`,workflowNoComfyPage:`没有检测到已刷新并可接收工作流的 ComfyUI 页面。请刷新现有 ComfyUI 页面后重试。`,errorOpenLibrary:`打开词库失败`,errorCreateLibrary:`创建词库失败`,errorDeleteLibrary:`删除词库失败`,errorSaveLibrary:`保存词库失败`,errorImportLibrary:`导入词库失败`,errorNoLibrarySelected:`尚未选择词库`,errorLibraryNameRequired:`请输入词库文件名`,imageStateSaveError:`保存图像信息失败`,errorJsonInvalid:`JSON 格式不正确`,jobRetry:`重试`,jobRefresh:`刷新资源库`,jobFingerprints:`分析图片`,jobRunning:`处理中`,jobFailed:`失败`,jobCancelled:`已取消`,jobCompleted:`已完成`},en:{libraryWorkspaceIntro:`Manage prompt and tag libraries with JSON import and editing.`,imageSearchClose:`Close image search`,operationBatchResult:`{updated} succeeded · {count} skipped · {missing} unfinished`,operationRetryBatchConfirm:`Retry only {count} unfinished items. Changes: {target}`,galleryMode:`Gallery mode`,galleryModeBrowse:`Browse`,galleryFolderPath:`Folder path`,librarySelectInlineHint:`Choose a library here, or create one or import JSON.`,libraryCreateInline:`New library`,detailBrowse:`Browse`,detailReuse:`Reuse`,detailManage:`Manage`,detailNoWorkflow:`No reusable workflow in this image`,imageSearchReturn:`Return to image search and previous view`,imageSearchLegacyLocate:`Older server: folder located. Find the image by filename.`,imageSearchLocateFailed:`Unable to locate. Check the source and refresh.`,settingsDensity:`Interface density`,densityStandard:`Standard`,settingsDensityHint:`Changes spacing independently of grid columns.`,operationCenter:`Task center`,operationTab_pending:`Active`,operationTab_error:`Failed`,operationTab_recent:`Recent`,operationEmpty:`No records`,operationClear:`Clear record`,jobRequestCancel:`Request cancellation`,galleryAutoSyncFailed:`Gallery sync failed. Retry when ready.`,updatesInstalledNotes:`What’s new in v{version}`,updatesPreview:`Local preview · remote not checked`,updatesCached:`Using verified cache`,updatesLocalOnly:`Installed release notes`,updatesLastSuccess:`Last successful check`,updatesInstalled:`Installed release`,updatesHistory:`History`,imageSearchTitle:`Search by image`,imageSearchIntro:`Find the original of an old social media image and its folder. Searches all enabled sources, independent of current filters.`,imageSearchChoose:`Choose reference image`,imageSearchReplace:`Replace reference`,imageSearchPaste:`Ctrl / ⌘ + V to paste, or drop an image here`,imageSearchReference:`Reference image`,imageSearchBroader:`Broaden matching`,imageSearchPrivacy:`Local search only. Your reference is never imported. The first search builds a library index in the background, which continues after closing this dialog.`,imageSearchLimits:`Matches compressed and resized copies. Heavy cropping, collages or occlusion may not match. Scores are rankings, not identity probabilities. Reference limit: 20 MB.`,imageSearchInvalid:`Choose an image file up to 20 MB.`,imageSearchSearching:`Finding identical and similar images…`,imageSearchIndexing:`Building library search index · {loaded} / {total}`,imageSearchIndexFailed:`Search index did not finish. Please retry.`,imageSearchReady:`Paste, drop or choose an image to search`,imageSearchCoverage:`Searched {loaded} / {total} images · Top {count} matches`,imageSearchFailedCount:`Visual fingerprints unavailable for {count} images; identical file matches remain available.`,imageSearchPartial:`Some assets are not indexed or have changed. Refresh the gallery and try again.`,imageSearchRetry:`Search again`,imageSearchEmpty:`No matches. Try broader matching or a less cropped or obscured reference. Check that the original folder is registered as a source.`,imageSearchExact:`Identical file`,imageSearchScore:`Visual match score {count}`,imageSearchLocate:`Locate folder`,imageSearchCopyPath:`Copy full path`,imageSearchCopied:`Full path copied`,imageSearchView:`View image`,qolBackGallery:`Back to gallery`,qolDiscardTitle:`Discard unsaved source settings?`,qolDiscardBody:`Changes to this source have not been saved. Switching will discard them.`,qolUnsaved:`Unsaved changes`,qolSaved:`No unsaved changes`,qolMoveConfirm:`Move {count} images from “{source}” to “{target}”? Name conflicts are handled by the server without directly overwriting existing files. Check both folders before continuing.`,qolMoveResult:`Moved {moved}; missing {missing}; blocked {blocked}.`,qolMoveBusy:`Moving images. Please do not repeat the action…`,qolPaneScope:`Loaded {loaded} of {total}; select all affects loaded images only.`,qolLoadMore:`Load more`,qolMoveScope:`Panes load independently of gallery filters. Confirm source and destination before moving; selections are kept on failure.`,qolVariantSearch:`Search loaded groups`,qolVariantSort:`Group order`,qolVariantNewest:`Recently updated`,qolVariantLargest:`Image count`,qolVariantScore:`Rule score`,qolVariantCount:`Showing {shown} of {total} loaded groups`,qolVariantSafety:`Groups help you review images; they do not establish that deletion is safe. Similar images, prompts or workflows are not identical files.`,qolNoMatches:`No matches for these conditions. Clear them and try again.`,qolResetSort:`Reset sorting`,qolFilterHint:`Filters apply immediately. Clearing filters keeps your sort order.`,qolFormatDetails:`Format conversion (optional)`,bulkDeleteConfirm:`Move {count} selected images to the gallery trash? You can restore them there.`,bulkDeleteHeavyConfirm:`Move {count} images to the gallery trash? Check your selection first; this may take some time.`,filterReset:`Clear filters`,loraModelWeight:`Model weight`,loraClipWeight:`CLIP weight`,workspaceDesc_gallery:`Browse, filter and organize images`,workspaceDesc_library:`Manage reusable prompt collections`,workspaceDesc_workbench:`Compose artist and style prompts`,workspaceDesc_settings:`Sources, preferences and diagnostics`,densityTitle:`Grid density`,densityShort:`Density`,densityHint:`Larger cards for detail. Smaller cards for browsing.`,densityPresets:`Choose a density preset`,densitySpacious:`Spacious`,densityBalanced:`Balanced`,densityCompact:`Compact`,densityMobileSingle:`Comfortable`,densityMobileDouble:`Compact ×2`,densityEffectiveColumns:`Currently {count} per row`,densityColumns:`{count} per row`,densityColumnsLabel:`Maximum images per row`,densityLarger:`Larger thumbnails`,densitySmaller:`Smaller thumbnails`,densityResponsiveNote:`This is the maximum per row. Narrow windows automatically use fewer columns.`,densityResetDefault:`Reset to default (6 per row)`,tourClose:`Close tour`,tourDensityTitle:`Choose a comfortable grid`,tourDensityBody:`Open Density for Spacious, Balanced or Compact cards, or fine-tune with the slider. Changes apply instantly; smaller screens adapt automatically.`,imageRetry:`Retry loading`,imageRetryShort:`Retry`,imageRetryFull:`Retry image`,imageOpenTab:`Open in new tab`,imageFilmstrip:`Image thumbnail navigation`,imageFilmstripToggle:`Toggle thumbnail navigation`,imageLoading:`Loading full-size image…`,clearSearch:`Clear search`,clearCategory:`Clear category filter`,clearColor:`Clear color filter`,clearDate:`Clear date filter`,clearPinned:`Clear pinned filter`,commonMove:`Move`,commonAdd:`Add`,dual_title:`Dual folder mode`,dual_hint:`Open two folders side by side. Select, right-click, or drag images to organize them.`,dual_left:`Left folder`,dual_right:`Right folder`,dual_selected:`{count} selected`,dual_selectAll:`Select all`,dual_invertSelection:`Invert`,dual_clearSelection:`Clear`,dual_refresh:`Refresh`,dual_moveOther:`Move to other pane`,dual_dropHint:`Drop here to move`,dual_readOnly:`Target is read-only`,dual_empty:`No images in this folder`,dual_loading:`Loading folder...`,dual_moving:`Moving images...`,dual_moved:`Moved`,dual_moveConfirmTitle:`Move selected images`,dual_moveConfirm:`Move {count} image(s) to "{target}"?`,dual_pinConfirm:`Pin {count} selected image(s)?`,dual_unpinConfirm:`Unpin {count} selected image(s)?`,dual_addToBoardConfirm:`Add {count} selected image(s) to "{target}"?`,dual_sameFolder:`Already in this folder`,dual_noMatch:`No matching folders`,dual_loadError:`Failed to load folder images.`,dual_moveError:`Failed to move images.`,dual_openDetail:`Open detail`,dual_openFull:`Open full size`,dual_openWorkflow:`Open workflow`,dual_metadata:`View Metadata`,dual_copyImage:`Copy image`,dual_copyFilename:`Copy filename`,dual_copyPath:`Copy path`,dual_copyPrompt:`Copy positive prompt`,dual_copySuccess:`Copied`,dual_copyImageSuccess:`Image copied`,dual_copyError:`Failed to copy`,dual_promptMissing:`No positive prompt found`,dual_select:`Select`,dual_deselect:`Deselect`,dual_pin:`Pin`,dual_unpin:`Unpin`,dual_addToBoard:`Add to board`,dual_delete:`Delete`,dual_deleteTitle:`Delete selected images`,dual_deleteMessage:`Delete {count} selected image(s)?`,dual_deleteSuccess:`Deleted`,dual_deleteError:`Failed to delete images`,dual_metadataError:`Failed to load metadata`,dual_swapFolders:`Swap left and right folders`,dual_moveToRight:`Move selected to right folder`,dual_moveToLeft:`Move selected to left folder`,dual_refreshBoth:`Refresh both folders`,workspaceSwitch:`Switch workspace`,moreActions:`More actions`,organizeFolders:`Organize folders`,organizeFoldersOpen:`Open folder organizer`,organizeFoldersClose:`Close folder organizer`,metadataPartialWarning:`This summary may be incomplete. Check the original metadata; dynamic prompts are not re-executed.`,variantRuleScore:`Rule score, not probability`,variantScopeNotice:`Analyzes up to 2,000 images in the current sort order. Refresh to continue pending fingerprints. Groups are suggestions only.`,appTitle:`Universal Extractor`,appSubtitle:`ComfyUI gallery and prompt library workspace`,navGallery:`Gallery`,navLibrary:`Library`,navWorkbench:`Workbench`,navSettings:`Settings`,navBrand:`Universal Extractor`,navSearchGalleryPlaceholder:`Search images, categories, or notes...`,navSearchLibraryPlaceholder:`Search library files or entries...`,navRefresh:`Refresh`,updatesTitle:`Updates`,updatesChecking:`Checking for updates...`,updatesAvailable:`New version available`,updatesCurrent:`You are up to date`,updatesCheckNow:`Check for updates`,updatesCheckFailed:`Unable to check for updates`,updatesCurrentVersion:`Current`,updatesLatestVersion:`Latest`,updatesOpenGithub:`View on GitHub`,updatesChangelog:`Changelog`,updatesNoChangelog:`No changelog available.`,navLanguage:`Language`,navLanguageZh:`Chinese`,navLanguageEn:`English`,navLanguageZhShort:`ZH`,navLanguageEnShort:`EN`,navSwitchToChinese:`Switch to Chinese`,navSwitchToEnglish:`Switch to English`,navToggleSidebar:`Toggle sidebar`,sidebarExpand:`Expand sidebar`,sidebarCollapse:`Collapse sidebar`,navToggleSearch:`Toggle search`,sidebarResources:`Resources`,sidebarQuickAccess:`Quick access`,sidebarOutputDirs:`Output folders`,sidebarInputDirs:`Input folders`,sidebarCustomDirs:`Source folders`,sidebarSourceDirs:`Source folders`,sidebarOutputSource:`Output gallery`,sidebarInputSource:`Input gallery`,sidebarFolderViewMode:`Folder view mode`,sidebarInputReadOnly:`Input gallery is read-only`,sidebarSourceReadOnly:`This source is read-only`,sidebarFolderCount:`{count} folders`,sidebarBoardCount:`{count} boards`,sidebarCategoryCount:`{count} categories`,sidebarLibraries:`JSON Libraries`,sidebarCreateLibrary:`Create library`,sidebarCreateLibraryPlaceholder:`artists-neo.json`,sidebarNoLibraries:`No libraries yet`,sidebarListView:`List view`,sidebarTreeView:`Tree view`,sidebarTrash:`Trash`,sidebarCreateFolder:`Create folder`,sidebarMergeFolder:`Merge folder`,sidebarDeleteFolder:`Delete folder`,sidebarExpandAll:`Expand all`,sidebarCollapseAll:`Collapse all`,sidebarBoards:`Boards`,sidebarAllPins:`All pins`,sidebarCreateBoard:`Create board`,sidebarFolderSearch:`Search folders`,sidebarClearFolderSearch:`Clear folder search`,sidebarNoFolderMatches:`No matching folders`,sidebarMoreActions:`More actions`,topStatus:{gallery:`Output gallery`,library:`Library assets`,workbench:`Tool workspace`,settings:`Gallery settings`},galleryBannerTitle:`Output gallery workspace`,galleryBannerText:`Browse the default ComfyUI output folder, drag files in, and manage images with pins, boards, categories, notes, and metadata inspection.`,galleryBannerAction:`Refresh output folder`,gallerySectionTitle:`Latest outputs`,gallerySectionMeta:`Hover a card for a quick prompt panel and click a card for the full metadata inspector.`,galleryEmptyTitle:`No images found`,galleryEmptyText:`Try another search term or generate some fresh outputs in ComfyUI first.`,galleryEmptyNoSourceTitle:`No available image source`,galleryEmptyNoSourceText:`Enable or repair a gallery source in Settings, then refresh.`,galleryEmptySourceTitle:`This source has no images yet`,galleryEmptySourceText:`Generate an image in ComfyUI, or drop an image here to import it into universal_gallery_imports/.`,galleryEmptyFilteredTitle:`No images match these filters`,galleryEmptyFilteredText:`Try a different search or clear the filters; your images have not been removed.`,galleryEmptyErrorTitle:`Couldn't load this gallery`,galleryLoading:`Loading output images...`,galleryInspect:`View details`,galleryPage:`Page {page} / {totalPages}`,galleryPrevious:`Previous`,galleryNext:`Next`,galleryJumpTo:`Go to`,galleryJump:`Jump`,galleryStatsTotal:`Total outputs`,galleryStatsVisible:`Loaded now`,galleryStatsPage:`Current page`,galleryFilterLabel:`Current result`,galleryFilterResult:`{count} images`,galleryFilters:`Filters`,variantToolbar:`Variants`,variantKicker:`Local analysis`,variantTitle:`Variant organizer`,variantSubtitle:`Group duplicate, near-duplicate, same-prompt, same-workflow, and filename-series outputs for quick cleanup.`,variantFilters:`Variant filters`,variantFilterAll:`All`,variantRefresh:`Analyze variants`,variantAnalyzing:`Analyzing variants...`,variantEmptyTitle:`No variant groups yet`,variantEmptyText:`Run analysis on this view, or adjust filters to include related ComfyUI outputs.`,variantBackToGroups:`Back to variant groups`,variantRelated:`Related variants`,variantSelectRest:`Select others`,variantSelectedGroup:`Variant group`,variantImageCount:`{count} images`,variantIndexed:`{count} analyzed`,variantPending:`{count} pending`,variantFailed:`{count} failed`,variantType_exact_duplicate:`Duplicates`,variantType_near_duplicate:`Near matches`,variantType_same_prompt:`Same Prompt`,variantType_same_workflow:`Same Workflow`,variantType_filename_series:`Filename series`,galleryFiltersRealtime:`Live`,galleryLiveRefreshPending:`New images`,galleryLiveRefreshAction:`Refresh this view`,galleryActiveFilters:`Active filters`,galleryFilterNone:`No extra filters`,galleryFilterStickyHint:`Header and footer stay visible on small screens.`,galleryFilterClose:`Close`,galleryFavoriteOnly:`Pins only`,galleryPinnedOnly:`Pins only`,galleryCategory:`Category`,galleryAllCategories:`All categories`,gallerySort:`Sort`,gallerySortBy:`Sort`,gallerySortOrder:`Order`,gallerySortNewest:`Newest`,gallerySortName:`Name`,gallerySortSize:`Size`,gallerySortDesc:`Descending`,gallerySortAsc:`Ascending`,gallerySortNewestHint:`Creation time`,gallerySortNameHint:`Filename`,gallerySortSizeHint:`File size`,gallerySortDescHint:`Large/new first`,gallerySortAscHint:`Small/old first`,galleryDateFrom:`From`,galleryDateTo:`To`,galleryDateRange:`Date range`,galleryDateClear:`Clear dates`,galleryColorFamily:`Color family`,galleryAllColors:`All colors`,galleryColorIndexing:`Color index is catching up`,galleryColorThreshold:`A color must cover at least 25% of the image to match.`,colorFamily_red:`Red`,colorFamily_orange:`Orange`,colorFamily_yellow:`Yellow`,colorFamily_green:`Green`,colorFamily_cyan:`Cyan`,colorFamily_blue:`Blue`,colorFamily_purple:`Purple`,colorFamily_pink:`Pink`,colorFamily_brown:`Brown`,colorFamily_black:`Black`,colorFamily_white:`White`,colorFamily_gray:`Gray`,colorFamily_warm:`Warm`,colorFamily_cool:`Cool`,colorFamily_low_saturation:`Low saturation`,galleryBackToTop:`Back to top`,galleryColumns:`Columns`,galleryMoreCategories:`More`,galleryCategoryBrowse:`Browse categories`,galleryCategoryBrowseHint:`Search and select from every available image category.`,galleryOutputFolder:`Output folder`,galleryOutputImportPath:`Drop import path`,galleryImportTarget:`Import target`,galleryDropTitle:`Drop files here to import`,galleryDropText:`Images go to the selected source's universal_gallery_imports/ folder; JSON goes to the prompt library (data/).`,trashTitle:`Trash`,trashEmptyTitle:`Trash is empty`,trashEmptyText:`Deleted items stay here. If transfer to the system trash fails, they remain here.`,trashRestore:`Restore`,trashDeleteForever:`Move to system trash`,trashItemCount:`{count} items`,trashSelectionHint:`Click to select by default, or drag with the left mouse button to select multiple items.`,trashSelectAll:`Select all`,trashClearSelection:`Clear selection`,trashRestoreSelected:`Restore selected`,trashDeleteSelectedForever:`Move selected to system trash`,trashRestoreSelectedConfirm:`Restore the selected {count} items?`,trashDeleteSelectedConfirm:`Move {count} items to the system trash? Restore or empty them through your operating system afterwards.`,trashRestoreSelectedSuccess:`Restored {count} items`,trashDeleteSelectedSuccess:`Moved {count} items to system trash`,trashBatchPartial:`Completed {completed}; {unfinished} unfinished. Review the reason before retrying.`,trashOperationBusy:`A trash operation is in progress. Wait for it to finish.`,trashKindImage:`Image`,trashKindFolder:`Folder`,trashKindLibrary:`Library`,trashImageCount:`{count} images`,galleryImportSuccess:`Import complete: {count} files`,galleryImportSavedTo:`Images saved to {target}`,galleryImportLibrariesSavedTo:`{count} JSON file(s) saved to prompt library data/`,galleryOpenImportFolder:`Open import folder`,galleryImportSkipped:`Skipped {count} unsupported files`,galleryCategoryPlaceholder:`Category, e.g. character / style / sketch`,galleryNotesPlaceholder:`Notes, source, or organization info`,galleryTitlePlaceholder:`Custom title`,galleryFavorite:`Pin`,galleryUnfavorite:`Unpin`,galleryPin:`Pin`,galleryUnpin:`Unpin`,gallerySelectImage:`Select image`,galleryDeselectImage:`Deselect image`,galleryHoverTitle:`Quick metadata`,galleryHoverPrompt:`Positive prompt`,galleryHoverNegative:`Negative prompt`,galleryHoverArtists:`Artist string`,galleryHoverNoPrompt:`No prompt content found`,libraryBannerTitle:`Library management workspace`,libraryBannerText:"Manage `data/*.json` prompt sources directly in the browser and keep artist or prompt collections tidy.",libraryBannerAction:`Refresh libraries`,librarySelectTitle:`Choose a library file`,librarySelectText:`Pick a JSON file from the left panel, or create a new one to start editing.`,libraryWorkspaceSubtitle:`{name} · {count} entries ready for search, editing, and generation`,libraryEntries:`Entries`,libraryActive:`Active file`,libraryEdit:`Edit JSON`,libraryImport:`Import`,libraryAddFile:`Add library`,libraryExport:`Export`,libraryFormat:`Format JSON`,librarySave:`Save`,libraryCancel:`Cancel`,libraryLoading:`Loading library content...`,libraryDetail:`Library detail`,libraryNoDescription:`No description`,libraryEmptyTitle:`This library is still empty`,libraryEmptyText:`Start with a starter template or add your first entry manually, then refine it through search and generation.`,librarySaveSuccess:`Library saved ({count} entries)`,libraryCreateSuccess:`Library created`,libraryImportSuccess:`Imported into {name} ({count} entries)`,libraryUnsavedChanges:`Unsaved changes`,librarySavedState:`Saved`,libraryUnsavedTitle:`Unsaved changes`,libraryUnsavedConfirm:`Discard unsaved library changes?`,libraryDiscardChanges:`Discard`,libraryLargeEditHint:`Large library: use entry editor`,libraryAddEntry:`Add entry`,libraryStarterTemplate:`Starter template`,libraryEntryEditorHint:`Edit a single library record as JSON to avoid loading the entire file into the browser.`,libraryDeleteEntryConfirm:`Delete this library entry?`,libraryOverviewEntries:`Library size`,libraryOverviewEntriesHint:`Use this to estimate whether JSON mode or single-entry editing is faster.`,libraryOverviewAliases:`Alias coverage`,libraryOverviewAliasesHint:`Entries with other names are easier to find later during search and cleanup.`,libraryOverviewTags:`Tag density`,libraryOverviewTagsHint:`Structured tags make filtering, regrouping, and reuse much easier.`,libraryOverviewModels:`Model guidance`,libraryOverviewModelsHint:`Model hints help beginners know where a prompt library works best.`,libraryGuideTitle:`Beginner workflow`,libraryGuideStepOne:`Start with a clear library type: artist, style, character, or utility snippets.`,libraryGuideStepTwo:"Keep `name` or `title` short, and put the reusable prompt body into `prompt`.",libraryGuideStepThree:"Use `other_names`, `tags`, and `description` so future search can find the right entry fast.",libraryGuideStepFour:`After editing, test the library in the workbench and refine the entries that copy best into your workflow.`,libraryFieldGuideTitle:`Recommended fields`,libraryFieldNameHint:`Use the original tag or the shortest stable lookup name.`,libraryFieldPromptHint:`Store the exact prompt fragment you want to reuse or paste into generation.`,libraryFieldAliasHint:`Add nicknames, alternate spellings, or translated names for easier search.`,libraryFieldTagsHint:`Use small reusable labels like artist, warm-light, portrait, pony, sdxl.`,libraryFieldModelHint:`Record the model family or checkpoint where this entry performs well.`,libraryFieldDescriptionHint:`Leave practical notes: strengths, weak points, or when to avoid using it.`,librarySearchActive:`Searching: {name}`,librarySearchReady:`Search is ready`,librarySearchHint:`Top search matches name, prompt, tags, aliases, model, description, and any other JSON text in the current library.`,librarySearchClear:`Clear search`,libraryTopTags:`Top tags on this page`,libraryTopModels:`Model notes on this page`,libraryNoTagsYet:`No tags in the current results`,libraryNoModelsYet:`No model notes in the current results`,libraryReadyToCopy:`Reusable`,libraryEntryStatus:`Entry {count}`,libraryCopyJson:`Copy JSON`,libraryCopyJsonSuccess:`Entry JSON copied`,libraryCopyPrompt:`Copy prompt`,libraryTemplateArtist:`Artist entry`,libraryTemplateArtistHint:`Best for Danbooru-style artist names and reusable artist prompts.`,libraryTemplateArtistDescription:`Artist entries should keep the original tag name first so generators and search can work together.`,libraryTemplateStyle:`Style entry`,libraryTemplateStyleHint:`Best for long-form visual style phrases or atmosphere presets.`,libraryTemplateStyleDescription:`Style entries are useful for complete prompt fragments that can be copied into a workflow later.`,libraryTemplateCharacter:`Character entry`,libraryTemplateCharacterHint:`Best for original characters, subjects, and repeatable appearance setups.`,libraryTemplateCharacterDescription:`Character entries should put core visual traits in prompt and aliases in other_names.`,libraryTemplatePanelTitle:`Quick templates`,libraryValidationTitle:`Validation issues`,libraryValidationGlobal:`Global`,libraryImportTitle:`Import library JSON`,libraryImportText:`Choose whether to create a new library, replace an existing one, or merge entries into a current file.`,libraryImportModeCreate:`Create new`,libraryImportModeReplace:`Replace current`,libraryImportModeMerge:`Merge into current`,libraryImportFile:`JSON file`,libraryImportFileEmpty:`No file selected`,libraryImportNewName:`New library name`,libraryImportTarget:`Target library`,libraryImportChooseTarget:`Choose a target library`,libraryImportConfirm:`Import JSON`,libraryImportConfirmAsk:`Import "{name}" as a library file?`,libraryImportConfirmTitle:`Confirm library import`,libraryImportCreateConfirm:`Create a new library from "{name}"?`,libraryImportReplaceConfirm:`Replace all entries in "{name}" with the imported JSON?`,libraryImportMergeConfirm:`Merge imported entries into "{name}"?`,librarySaveConfirmTitle:`Save library changes`,librarySaveConfirm:`Overwrite "{name}" with the current editor content?`,librarySaveEntryConfirmTitle:`Save entry`,librarySaveEntryConfirm:`Save this entry to the active library?`,libraryDropTitle:`Drop a JSON library here`,libraryDropText:`We will validate the file first, then ask how you want to add it.`,workbenchTitle:`Workbench`,workbenchSubtitle:`Preset tools for prompt assembly, artist string generation, and future utilities.`,workbenchAppTitle:`Workbench`,workbenchAppSubtitle:`Compose prompts from libraries and organize your selections and inspiration.`,workbenchToolShelf:`Tool shelf`,workbenchToolShelfHint:`Pick the icon for the task you need now. More tools can be added without changing the workspace layout.`,workbenchToolReady:`Ready`,workbenchToolNew:`New`,workbenchStatusStrip:`Workbench status`,workbenchActiveTool:`Active tool`,workbenchLibraryCount:`Libraries`,workbenchQueueCount:`Queued`,workbenchGeneratorMetrics:`Generator summary`,workbenchResultTokens:`Tokens`,workbenchRecipeSection:`Generation recipe`,workbenchOutputSection:`Generated output`,workbenchFormatSection:`Format post-process`,workbenchFormattedTokens:`{count} converted fragments`,toolArtistGenerator:`Artist String Generator`,toolArtistGeneratorDesc:`Generate reusable artist prompt strings from the current JSON library preset.`,toolInspirationHub:`Inspiration Hub`,inspirationHubTitle:`Curated visual reference sites`,inspirationHubDesc:`A compact launcher for high-value gallery and moodboard sources, sorted by recommendation or daily usage frequency.`,inspirationMetricSites:`sites`,inspirationRecommendation:`Recommended`,inspirationFrequency:`Usage`,inspirationSearchPlaceholder:`Search source, type, or best use...`,inspirationSortRecommendation:`Sort by recommendation`,inspirationSortFrequency:`Sort by usage`,inspirationSortName:`Sort by name`,inspirationType_all:`All types`,inspirationType_moodboard:`Moodboard`,inspirationType_portfolio:`Portfolio`,inspirationType_illustration:`Illustration`,inspirationType_product:`Product UI`,inspirationType_ai:`AI image`,inspirationRegionGlobal:`Global`,inspirationRegionChina:`China`,inspirationOpenSite:`Open site`,inspirationPinterestDesc:`Broad moodboard discovery for composition, color, outfit, interior, and visual direction references.`,inspirationPinterestBest:`Fast moodboards and adjacent ideas`,inspirationHuabanDesc:`Chinese visual board community with strong illustration, design, photography, and lifestyle reference boards.`,inspirationHuabanBest:`Chinese-language reference boards`,inspirationBehanceDesc:`Portfolio-grade case studies for branding, layout systems, campaigns, and polished creative presentation.`,inspirationBehanceBest:`Finished design systems and case studies`,inspirationArtStationDesc:`High-quality concept art, character, environment, 3D, game, and entertainment design references.`,inspirationArtStationBest:`Concept art and production-grade style`,inspirationDribbbleDesc:`Compact UI, icon, app screen, motion, and product visual snippets with strong interface taste.`,inspirationDribbbleBest:`UI details and app surface ideas`,inspirationCosmosDesc:`Clean personal collection platform for saving visual references, screenshots, links, and creative trails.`,inspirationCosmosBest:`Personal reference collection`,inspirationArenaDesc:`Research-oriented boards for art direction, design theory, visual culture, and conceptual references.`,inspirationArenaBest:`Deep research and theme boards`,inspirationDesignspirationDesc:`Search-driven design inspiration for typography, color palettes, posters, editorial, and web mood.`,inspirationDesignspirationBest:`Color and typography searches`,inspirationLapaDesc:`Landing page gallery focused on real product pages, hero sections, layout structure, and conversion patterns.`,inspirationLapaBest:`Landing page and web layout ideas`,inspirationLexicaDesc:`AI image search and prompt-adjacent visual browsing for style exploration and quick generation references.`,inspirationLexicaBest:`AI style exploration`,toolComingSoon:`Coming soon`,artistLibrarySource:`Library source`,artistGenerate:`Generate`,artistCount:`Count`,artistMode:`Mode`,artistRandom:`Random`,artistSequential:`Sequential`,artistPrefix:`Prefix`,artistSuffix:`Suffix`,artistSeparator:`Separator`,artistSeed:`Seed`,artistResult:`Generated result`,artistCopyResult:`Copy result`,artistNoLibraries:`No suitable library found`,workbenchMode:`Mode`,workbenchModePure:`Pure`,workbenchModeStandard:`Standard`,workbenchModeCreative:`Creative`,workbenchModeNai:`NAI`,workbenchPostFilter:`Post filter`,workbenchPostThreshold:`Post threshold`,workbenchFilterNone:`No filter`,workbenchFilterGreater:`Greater than`,workbenchFilterLess:`Less than`,workbenchWeightMin:`Weight min`,workbenchWeightMax:`Weight max`,workbenchBracketStyle:`Bracket style`,workbenchNestLevels:`Nest levels`,workbenchCustomFormat:`Custom format`,workbenchFormatString:`Format string`,workbenchFormatTool:`Format conversion`,workbenchFormatToolAnima:`Anima format`,workbenchFormatToolCustom:`Custom format`,workbenchFormatToolTemplate:`Template`,workbenchFormatToolApply:`Apply conversion`,workbenchFormatToolResult:`Converted result`,workbenchFormatToolAnimaHint:`Converts tags like name_(group) into @name \\(group\\) for Anima post-processing.`,workbenchFormatApplied:`Format conversion applied`,workbenchPreselected:`Preselected artists`,workbenchPreselectedEmpty:`Add artists from the pool on the right, and generation will prioritize them first.`,workbenchArtistPool:`Artist pool`,workbenchArtistPoolHint:`Search artists by name or alias, then add them into the preselected queue.`,workbenchGenerateSuccess:`Artist string generated`,workbenchCopyError:`Failed to copy generated result`,workbenchEmptyHint:`Generate a result to preview selected entries and the final assembled string here.`,workbenchPreviewHint:`Preview a few source entries to confirm you are generating from the correct library.`,commonLoading:`Loading...`,commonEnabled:`Enabled`,commonDisabled:`Disabled`,viewMode:`View mode`,viewGrid:`Grid`,viewList:`List`,bulkActions:`Batch actions`,bulkSelectMode:`Selection mode`,bulkSelectionHint:`Current page only. Turn on selection mode to click-select or drag a box with the left mouse button.`,bulkSelected:`{count} selected`,bulkFavorite:`Pin`,bulkUnfavorite:`Unpin`,bulkPin:`Pin selected`,bulkUnpin:`Unpin selected`,bulkAddToBoard:`Add to board`,bulkRemoveFromBoard:`Remove from board`,bulkSetCategory:`Set category`,bulkMoveTo:`Move to folder`,bulkPinConfirm:`Pin {count} selected image(s)?`,bulkUnpinConfirm:`Unpin {count} selected image(s)?`,bulkAddToBoardConfirm:`Add {count} selected image(s) to "{target}"?`,bulkRemoveFromBoardConfirm:`Remove {count} selected image(s) from "{target}"?`,bulkSetCategoryConfirm:`Set category "{target}" on {count} selected image(s)?`,bulkMoveConfirm:`Move {count} selected image(s) to "{target}"?`,bulkRenameConfirm:`Rename {count} selected image(s) using "{target}"?`,bulkRenameTemplatePlaceholder:`rename rule, e.g. set-{page}-{n} or {name}-v2`,bulkRenameStart:`Start`,bulkRenamePadding:`Pad`,bulkRenameApply:`Rename`,bulkRenameRuleTitle:`Rename rule`,bulkRenameRuleHint:`Use {n} for sequence number, {name} for original filename without extension, and {page} for the current page number. The original extension is kept automatically.`,bulkRenameSuccess:`Renamed {count} images`,bulkRenameError:`Failed to batch rename images`,bulkDelete:`Delete selected`,imageDelete:`Delete image`,bulkClear:`Clear`,bulkSelectVisible:`Select visible`,imageRenameError:`Failed to rename image`,imageDeleteError:`Failed to delete image`,inspectorFolderTitle:`Current view`,inspectorFolderHint:`When nothing is selected, this panel shows the current folder, filtered results, and quick actions.`,inspectorVisibleCount:`Current page`,inspectorSingleHint:`Selected images can be pinned, moved, categorized, renamed, added to boards, or deleted here.`,inspectorFilename:`Filename`,inspectorCategory:`Category`,inspectorSource:`Source`,inspectorSize:`Size`,inspectorCreated:`Created`,inspectorEmptyValue:`Not set`,modalClose:`Close detail`,modalTitle:`Image detail`,modalOpenFull:`Open full size`,modalOpenWorkflow:`Open workflow in ComfyUI`,modalExpandImage:`Expand image`,modalZoomIn:`Zoom in`,modalZoomOut:`Zoom out`,modalFitImage:`Fit image`,modalToggleInspector:`Toggle inspector`,modalGestureHint:`Wheel to zoom, drag to pan, double-click to reset`,modalPromptHits:`Artist hits`,modalMetadataBlocks:`Metadata blocks`,modalLoading:`Reading embedded workflow metadata...`,modalPromptSection:`Matched library prompts`,modalMetadataSection:`Embedded blocks`,modalRawMetadata:`Raw metadata`,modalNoMetadata:`No prompt or workflow metadata was detected in this image.`,metadataView:`View metadata`,metadataPromptSummary:`Prompt summary`,metadataPositivePrompt:`Positive prompt`,metadataNegativePrompt:`Negative prompt`,metadataCopyPositive:`Copy positive prompt`,metadataCopyPositiveSuccess:`Positive prompt copied`,metadataCopyRaw:`Copy raw metadata`,metadataCopyRawSuccess:`Raw metadata copied`,metadataNoPositivePrompt:`No positive prompt found`,metadataNoNegativePrompt:`No negative prompt found`,metadataLoadError:`Failed to read image metadata`,recipeTitle:`Generation Recipe`,recipeCheckpoint:`Base Checkpoint`,recipeLoras:`LoRA Stack`,recipeParams:`Parameters`,recipeSeed:`Seed`,recipeSteps:`Steps`,recipeCfg:`CFG Scale`,recipeSampler:`Sampler`,recipeScheduler:`Scheduler`,recipeSize:`Dimensions`,recipeDenoise:`Denoise`,recipeCopyPositive:`Copy Positive Prompt`,recipeCopyNegative:`Copy Negative Prompt`,recipeCopySeed:`Copy Seed`,recipeCopyFull:`Copy Full Recipe`,recipeCopiedSuccess:`Copied to clipboard`,recipeApplyLoraStack:`Apply LoRA Stack`,recipeSendWorkflow:`Send Workflow to ComfyUI`,modalEditSection:`Image management`,modalCategory:`Category`,modalTitleField:`Title`,modalFilenameField:`Filename`,modalNotesField:`Notes`,modalSaveState:`Save image info`,modalSaveHint:`Save the title, category, notes and pin state here. Rename the filename separately.`,modalFilenameRenameHint:`The filename has not been saved. Choose Rename file; Save image info does not rename it.`,modalUnsavedStateTitle:`Unsaved image edits`,modalUnsavedStateText:`The image info has unsaved changes. Save and continue, discard them, or cancel?`,modalUnsavedFilenameText:`The filename will become “{target}”; there may be other edits. Save and continue will save the info and rename the file. You can also discard or cancel.`,modalUnsavedLoadingText:`Image info is still loading and cannot be saved yet. Wait and try again, or discard the draft.`,modalSaveAndContinue:`Save and continue`,modalWaitForMetadata:`Image info is still loading. Please wait before saving.`,modalFilenameRequired:`Filename cannot be empty.`,modalDiscardChanges:`Discard changes`,modalUnsavedStateBadge:`Unsaved`,modalSavedStateBadge:`Saved`,modalRenameFile:`Rename file`,modalDeleteFile:`Delete file`,commonEntries:`{count} entries`,commonDelete:`Delete`,commonConfirm:`Confirm`,commonCreate:`Create`,commonSend:`Send`,commonNoneSelected:`None`,commonCopy:`Copy`,notificationDismiss:`Dismiss notification`,operationRefresh:`Refreshing...`,operationRefreshSuccess:`Gallery refreshed`,galleryRefreshInterrupted:`Refresh interrupted by a view change`,operationCreateLibrary:`Creating library...`,operationSaveLibrary:`Saving library...`,operationImportLibrary:`Importing library...`,operationDeleteLibrary:`Deleting library...`,operationCreateBoard:`Creating board...`,operationDeleteBoard:`Deleting board...`,operationAddToBoard:`Adding to board...`,operationRemoveFromBoard:`Removing from board...`,operationUpdateImages:`Updating images...`,operationUpdateImagesSuccess:`Images updated`,operationMoveImages:`Moving images...`,operationMoveImagesSuccess:`Images moved`,operationMoveUnchanged:`Already in the target folder: {count} (not moved).`,operationUnaccounted:`Outcome unconfirmed for {count}; selection kept.`,operationUnprocessedPaths:`Not processed: {target}`,operationViewDetails:`View details`,operationRenameImages:`Renaming images...`,operationDeleteImages:`Deleting images...`,operationDeleteImagesResult:`Moved {count} to trash; {missing} not processed.`,operationCreateFolder:`Creating folder...`,operationMergeFolder:`Merging folder...`,operationMoveFolder:`Moving folder...`,operationRenameFolder:`Renaming folder...`,operationDeleteFolder:`Deleting folder...`,operationImportFiles:`Importing files...`,operationRenameImage:`Renaming image...`,operationDeleteImage:`Deleting image...`,operationRestoreTrash:`Restoring from trash...`,operationPurgeTrash:`Moving to system trash...`,operationSendWorkflow:`Sending workflow...`,operationApplyLoraStack:`Applying LoRA stack...`,operationRunDiagnostics:`Running diagnostics...`,operationTestPath:`Testing path...`,operationSaveSource:`Saving source...`,operationDeleteSource:`Deleting source...`,operationGenerateArtists:`Generating artist string...`,contextCopyImage:`Copy image`,contextCopyFilename:`Copy filename`,contextCopyPath:`Copy path`,contextCopyImageSuccess:`Image copied to clipboard`,contextCopyImageLinkSuccess:`Image link copied to clipboard`,contextCopyFilenameSuccess:`Filename copied to clipboard`,contextCopyPathSuccess:`Path copied to clipboard`,contextCopyError:`Failed to copy`,contextCopyImageError:`Failed to copy image`,imageDeleteConfirm:`Delete image "{name}"?`,imageDeleteMissing:`Image was not deleted: the file is missing or its source is read-only.`,imageRenameConfirm:`Rename "{name}" to "{target}"?`,imageRenameWithStateConfirm:`Save the current image info edits, then rename "{name}" to "{target}"?`,imageStateSaveConfirm:`Save image info changes for "{name}"?`,imagePinConfirm:`Pin "{name}"?`,imageUnpinConfirm:`Unpin "{name}"?`,confirmDeleteLibrary:`Delete "{name}"?`,galleryImportConfirmTitle:`Import files`,galleryImportConfirm:`Import {count} file(s)? Images go to {target}; JSON prompt libraries go to data/*.json.`,folderCreatePrompt:`Enter a new output folder path`,folderDeleteConfirm:`Delete folder "{name}" and all files inside it?`,folderMergePrompt:`Enter the target folder path to merge into`,folderCreateTitle:`Create output folder`,folderCreateText:`Enter a folder path relative to the ComfyUI output directory.`,folderMergeTitle:`Merge output folder`,folderMergeText:`Move the selected folder into another output folder.`,folderMergeConfirm:`Merge "{name}" into "{target}"? Files may be moved into the target folder.`,folderMoveTitle:`Move folder`,folderMoveConfirm:`Move "{name}" into "{target}"?`,folderRenameTitle:`Rename output folder`,folderRenameText:`Change the folder path. Enter a new sibling name or another relative output path.`,folderRenameConfirm:`Rename or move "{name}" to "{target}"?`,folderRenamePrompt:`Enter the new output folder path`,folderPathPlaceholder:`folder/subfolder`,folderCreateSuccess:`Folder created`,folderDeleteSuccess:`Folder deleted`,folderMergeSuccess:`Folder merged`,folderMoveSuccess:`Folder moved`,folderRenameSuccess:`Folder renamed`,folderCreateError:`Failed to create folder`,folderDeleteError:`Failed to delete folder`,folderMergeError:`Failed to merge folder`,folderMoveError:`Failed to move folder`,folderRenameError:`Failed to rename folder`,folderMove:`Move`,folderRename:`Rename`,folderPin:`Pin folder`,folderUnpin:`Unpin folder`,folderSortByName:`Sort by name`,folderSortByModified:`Sort by modified time`,folderSortAsc:`Sort by name ascending`,folderSortDesc:`Sort by name descending`,boardCreateTitle:`Create board`,boardCreateText:`Boards collect pinned images without moving the original files.`,boardCreateConfirm:`Create board "{name}"?`,boardNameLabel:`Board name`,boardNamePlaceholder:`Character references / lighting tests`,boardCreateSuccess:`Board created`,boardCreateError:`Failed to create board`,boardAddToTitle:`Add to board`,boardAddToText:`Choose a board for {count} selected images.`,boardAddToAction:`Add to board`,boardAddSuccess:`Added {count} images to board`,boardEmptyText:`No boards yet`,boardCreateInline:`Create a new board instead`,boardDeleteTitle:`Delete board`,boardDeleteConfirm:`Delete board "{name}"? Images will stay in the output folder.`,boardDeleteSuccess:`Board deleted`,boardShareTitle:`Share board`,boardShareText:`A 5 by 4 preview image is ready.`,boardShareSubtitle:`{count} pinned images`,boardShareDownload:`Download share image`,boardShareError:`Failed to render share image`,settingsKicker:`Directory sources`,settingsTitle:`Settings`,settingsSubtitle:`Manage image directories, browsing preferences, and source diagnostics.`,settingsActiveSources:`active sources`,settingsIndexedImages:`indexed images`,settingsSourcesTitle:`Image directories`,settingsSourcesHint:`Enable multiple folders, even across drives, and choose where imports should land.`,settingsAddSource:`Add custom source`,settingsNewSource:`New custom source`,settingsDefaultLockedHint:`Default ComfyUI sources keep their name and path, but can still be enabled or disabled.`,settingsCustomHint:`Custom folders can point to any local or mounted directory you want merged into the gallery.`,settingsSourceName:`Source name`,settingsSourceNamePlaceholder:`Reference drive / archive folder`,settingsSourcePath:`Directory path`,settingsSourcePathPlaceholder:`D:\\images\\reference-library`,settingsSourceEnabled:`Enabled`,settingsSourceWritable:`Allow file operations`,settingsSourceRecursive:`Scan subfolders`,settingsSourceImportTarget:`Import target`,settingsSourceTest:`Test path`,settingsSourceSave:`Save source`,settingsSourceDelete:`Delete source`,settingsSourceScan:`Rescan sources`,settingsPreferencesTitle:`Interface preferences`,settingsPreferencesHint:`These switches are stored in this browser and control the gallery's default interaction behavior.`,settingsOnboardingTitle:`New user tour`,settingsOnboardingHint:`Replay the guided walkthrough for the gallery, libraries, workbench, and source settings.`,settingsOnboardingRestart:`Restart onboarding tour`,settingsPrefDefaultSelection:`Start in selection mode`,settingsPrefDefaultSelectionHint:`When off, clicking an image opens detail by default; turn selection mode on only when you need box selection.`,settingsPrefConfirmWorkflow:`Confirm before sending workflow`,settingsPrefConfirmWorkflowHint:`When off, Open workflow in ComfyUI sends directly to the already-open ComfyUI page.`,settingsPrefCollapseSidebar:`Collapse sidebar on launch`,settingsPrefCollapseSidebarHint:`Start with the resource sidebar collapsed on desktop, useful for smaller screens or focused browsing.`,settingsPrefImagePrefetch:`Preload nearby images`,settingsPrefImagePrefetchHint:`Preloads nearby thumbnails while scrolling; turn off to reduce background network and disk reads.`,settingsPrefLiveRefresh:`Keep gallery live`,settingsPrefLiveRefreshHint:`Sync after each workflow; check for missed changes every 15 seconds while visible. Preserve browsing positions. Turn off for manual refresh only.`,settingsPrefFolderTree:`Use folder tree by default`,settingsPrefFolderTreeHint:`When off, output folders default to a flat list, useful for shallow folder sets.`,tourWelcomeTitle:`Welcome to Universal Gallery`,tourWelcomeBody:`Take a minute to discover the essentials. Each step highlights its control. Skip anytime and restart from Settings.`,tourTopbarTitle:`Move between workspaces`,tourTopbarBody:`Click the workspace name at the top left to switch between Gallery, Library, Workbench and Settings. Each option includes a short description.`,tourSidebarTitle:`Browse sources and folders`,tourSidebarBody:`Folders are organized by source. Select a folder to browse it. Its More menu contains tree/list views, sorting and folder tools.`,tourGalleryTitle:`Browse and filter images`,tourGalleryBody:`Search filenames, categories or notes here. Filters narrow results by date, color or pinned status. Press / to focus search.`,tourSelectionTitle:`Select and batch edit`,tourSelectionBody:`Turn on selection mode to click-select, Shift-select, or drag a box. Box selection keeps working while the page scrolls.`,tourDetailTitle:`Inspect images and send workflows`,tourDetailBody:`Click an image for its full-size view and metadata. Use arrow keys to navigate. Double-click the image to zoom, or empty space to close. Workflow actions are in the detail toolbar.`,tourLibraryTitle:`Manage prompt libraries`,tourLibraryBody:`Search, import, export and edit JSON prompt collections. Use entries in the extractor node or combine them in Workbench.`,tourWorkbenchTitle:`Build reusable prompt strings`,tourWorkbenchBody:`Choose artists and tags from a library, adjust the format and copy the resulting prompt. Import a collection in Library first if none is loaded.`,tourSettingsTitle:`Tune sources and preferences`,tourSettingsBody:`Manage sources and preferences and check diagnostics in Settings. Use the restart tutorial control here to see this tour again.`,tourDoneTitle:`You are ready to work`,tourDoneBody:`You are ready to explore. This tour will not automatically reopen. Find it again in Settings whenever you need it.`,tourSkip:`Skip`,tourPrevious:`Previous step`,tourNext:`Next`,tourFinish:`Finish`,tourStepProgress:`Step {page} of {totalPages}`,tourTargetMissing:`There is no visible target here yet, possibly because no images or library are loaded. You can continue to the next step.`,settingsPathOk:`Path is ready, {count} images found at the top level.`,settingsPathMissing:`Path does not exist or is not a folder.`,settingsPathError:`Failed to test path`,settingsSourceSaved:`Source saved`,settingsSourceSaveError:`Failed to save source`,settingsSourceSaveConfirm:`Save changes to source "{name}"? This can change what folders are writable or indexed.`,settingsSourceCreateConfirm:`Add "{name}" as a gallery source?`,settingsSourceDeleted:`Source deleted`,settingsSourceDeleteError:`Failed to delete source`,settingsSourceDeleteConfirm:`Remove "{name}" from the gallery source list?`,settingsDiagnostics:`Source diagnostics`,settingsDiagnosticsHint:`Check reachability, permissions, overlap, image counts, and available disk space.`,settingsDiagnosticsRun:`Run diagnostics`,settingsDiagnosticsDone:`Diagnostics complete`,settingsDiagnosticsError:`Failed to run diagnostics`,settingsDiagnosticImages:`{count} images`,settingsDiagnosticFolders:`{count} folders`,settingsDiagnosticOverlap:`{count} overlaps`,settingsStatus_ok:`OK`,settingsStatus_missing:`Missing`,settingsStatus_error:`Error`,settingsStatus_unreadable:`Unreadable`,settingsStatus_write_blocked:`Write blocked`,settingsStatus_overlap:`Overlap`,workflowSendSuccess:`Workflow sent to ComfyUI`,workflowSendConfirm:`Send the workflow from "{name}" to ComfyUI?`,loraStackApply:`Apply LoRA stack to current workflow`,loraStackReading:`Reading LoRA stack from image…`,loraStackApplyConfirm:`Apply {count} LoRAs from "{name}" to the current workflow? Only the selected LoRA Manager node is changed, or the first compatible node if none is selected. Append keeps other entries and updates names that match; Replace removes the target node's old stack.`,loraStackClipWarning:`{count} LoRAs have a different CLIP strength. The rows will be collapsed but the values kept; changing model strength while collapsed will sync CLIP in LoRA Manager.`,loraStackAppend:`Append to stack`,loraStackReplace:`Replace stack`,loraStackAppendedSuccess:`Merged {count} LoRAs into "{name}"`,loraStackReplacedSuccess:`Replaced "{name}" with {count} LoRAs`,loraStackAppendDetail:`{added} new, {updated} updated; all other entries unchanged.`,loraStackReplaceDetail:`{removed} old entries removed; {updated} names updated.`,loraStackApplyNoStack:`No usable ComfyUI-Lora-Manager LoRA stack was detected in this image.`,loraStackApplyNoComfyPage:`No ComfyUI page is ready to receive this request. Keep the main ComfyUI page open and refresh it once.`,loraStackBridgeOutdated:`The ComfyUI page is still running an older plugin script. Sending was blocked because its Append button could delete existing LoRAs. Restart ComfyUI, then hard-refresh the main page and gallery before retrying.`,loraStackApplyNoTargetNode:`No writable LoRA Manager node was found in the current workflow.`,loraStackApplySuccess:`LoRA stack applied to the current workflow`,trashRestoreConfirm:`Restore this trash item to its original location?`,workflowNoComfyPage:`No refreshed ComfyUI page is ready to receive workflows. Refresh the existing ComfyUI page and try again.`,errorOpenLibrary:`Failed to open library`,errorCreateLibrary:`Failed to create library`,errorDeleteLibrary:`Failed to delete library`,errorSaveLibrary:`Failed to save library`,errorImportLibrary:`Failed to import library`,errorNoLibrarySelected:`No library selected`,errorLibraryNameRequired:`Library name is required`,imageStateSaveError:`Failed to save image info`,errorJsonInvalid:`JSON format error`,jobRetry:`Retry`,jobRefresh:`Refresh library`,jobFingerprints:`Analyze images`,jobRunning:`Running`,jobFailed:`Failed`,jobCancelled:`Cancelled`,jobCompleted:`Completed`}},C=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),w=o(((e,t)=>{t.exports=C()})),T=w(),E=(0,d.createContext)(null),D=`universal-extractor-locale`,O=(e,t)=>t?e.replace(/\{(\w+)\}/g,(e,n)=>{let r=t[n];return r===void 0?``:String(r)}):e,k=({children:e})=>{let[t,n]=(0,d.useState)(()=>{try{let e=window.localStorage.getItem(D);return e===`en`||e===`zh-CN`?e:`zh-CN`}catch{return`zh-CN`}});(0,d.useEffect)(()=>{document.documentElement.lang=t;try{window.localStorage.setItem(D,t)}catch{}},[t]),(0,d.useEffect)(()=>{let e=e=>{e.key===D&&(e.newValue===`en`||e.newValue===`zh-CN`)&&n(e.newValue)};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[]);let r=(0,d.useMemo)(()=>({locale:t,setLocale:n,t:(e,n)=>{let r=S[t][e]??S.en[e];return r?typeof r==`string`?O(r,n):r[n?.tab??`gallery`]??e:e}}),[t]);return(0,T.jsx)(E.Provider,{value:r,children:e})},A=()=>{let e=(0,d.useContext)(E);if(!e)throw Error(`useI18n must be used within I18nProvider`);return e};export{u as a,x as i,A as n,o,w as r,c as s,k as t}; \ No newline at end of file diff --git a/gallery_ui/dist/assets/I18nProvider-cZczvL7B.js b/gallery_ui/dist/assets/I18nProvider-cZczvL7B.js deleted file mode 100644 index 4d841a1..0000000 --- a/gallery_ui/dist/assets/I18nProvider-cZczvL7B.js +++ /dev/null @@ -1 +0,0 @@ -var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;li[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u{t.exports=l()})),d=c(u()),f=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),p=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),m=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),h=e=>{let t=m(e);return t.charAt(0).toUpperCase()+t.slice(1)},g={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},_=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},v=(0,d.createContext)({}),y=()=>(0,d.useContext)(v),b=(0,d.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:p=!1,color:m=`currentColor`,className:h=``}=y()??{},v=r??p?Number(n??u)*24/Number(t??l):n??u;return(0,d.createElement)(`svg`,{ref:c,...g,width:t??l??g.width,height:t??l??g.height,stroke:e??m,strokeWidth:v,className:f(`lucide`,h,i),...!a&&!_(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,d.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),x=(e,t)=>{let n=(0,d.forwardRef)(({className:n,...r},i)=>(0,d.createElement)(b,{ref:i,iconNode:t,className:f(`lucide-${p(h(e))}`,`lucide-${e}`,n),...r}));return n.displayName=h(e),n},S={"zh-CN":{libraryWorkspaceIntro:`管理词库条目与提示词,支持 JSON 导入和编辑。`,imageSearchClose:`关闭以图搜图`,operationBatchResult:`成功 {updated} · 跳过 {count} · 未完成 {missing}`,operationRetryBatchConfirm:`仅重试未完成的 {count} 项,修改内容:{target}`,galleryMode:`图库模式`,galleryModeBrowse:`浏览`,galleryFolderPath:`目录路径`,librarySelectInlineHint:`直接选择词库,或新建、导入 JSON 文件。`,libraryCreateInline:`新建词库`,detailBrowse:`浏览`,detailReuse:`复用`,detailManage:`管理`,detailNoWorkflow:`此图片没有可发送的工作流`,imageSearchReturn:`返回搜图结果与原浏览位置`,imageSearchLegacyLocate:`服务端版本较旧,已定位目录;可按文件名查找。`,imageSearchLocateFailed:`定位失败,请检查图源并刷新图库。`,settingsDensity:`界面密度`,densityStandard:`标准`,settingsDensityHint:`仅调整间距,不改变网格列数。`,operationCenter:`任务中心`,operationTab_pending:`进行中`,operationTab_error:`失败`,operationTab_recent:`最近完成`,operationEmpty:`暂无记录`,operationClear:`清除记录`,jobRequestCancel:`请求取消`,galleryAutoSyncFailed:`图库自动同步失败,可重试`,updatesInstalledNotes:`v{version} 更新说明`,updatesPreview:`本地示例 · 未检查远端`,updatesCached:`使用已核验缓存`,updatesLocalOnly:`当前安装版本说明`,updatesLastSuccess:`上次检查成功`,updatesInstalled:`当前版本说明`,updatesHistory:`历史版本`,imageSearchTitle:`以图搜图`,imageSearchIntro:`用社交平台上的老图,找回图库中的原图和所在文件夹。搜索全部已启用图源,不受当前筛选限制。`,imageSearchChoose:`选择参考图片`,imageSearchReplace:`更换参考图`,imageSearchPaste:`Ctrl / ⌘ + V 粘贴,或将图片拖到这里`,imageSearchReference:`参考图片`,imageSearchBroader:`扩大匹配范围`,imageSearchPrivacy:`仅在本机搜索,参考图不会导入图库。首次搜索会后台建立全库索引,关闭窗口后索引仍会继续。`,imageSearchLimits:`支持压缩、缩放后的近似匹配。大幅裁剪、拼图或遮挡可能找不到;匹配分不是确认同一张图的概率。单张参考图最多 20 MB。`,imageSearchInvalid:`请选择不超过 20 MB 的图片文件。`,imageSearchSearching:`正在查找相同和相似图片…`,imageSearchIndexing:`正在建立全库检索索引 · {loaded} / {total}`,imageSearchIndexFailed:`检索索引未完成,请重试。`,imageSearchReady:`粘贴、拖入或选择一张图片开始搜索`,imageSearchCoverage:`已检索 {loaded} / {total} 张 · 返回前 {count} 个匹配`,imageSearchFailedCount:`{count} 张图片无法生成视觉指纹,仍可按完全相同的文件查找。`,imageSearchPartial:`部分资源尚未完成索引,或文件已经变化。可刷新图库后重试。`,imageSearchRetry:`重新搜索`,imageSearchEmpty:`未找到匹配。可尝试扩大匹配范围,或使用裁剪、遮挡更少的图片。也请确认原图目录已添加到图源。`,imageSearchExact:`文件完全相同`,imageSearchScore:`视觉匹配分 {count}`,imageSearchLocate:`定位文件夹`,imageSearchCopyPath:`复制完整路径`,imageSearchCopied:`已复制完整路径`,imageSearchView:`查看图片`,qolBackGallery:`返回图库`,qolDiscardTitle:`放弃未保存的资源设置?`,qolDiscardBody:`当前资源的修改尚未保存。切换后将丢弃这些修改。`,qolUnsaved:`有未保存的修改`,qolSaved:`与已保存设置一致`,qolMoveConfirm:`将 {count} 张图片从「{source}」移动到「{target}」?同名冲突由服务器处理,不会直接覆盖已有文件;请确认目录后继续。`,qolMoveResult:`已移动 {moved} 张;未找到 {missing} 张;被阻止 {blocked} 张。`,qolMoveBusy:`正在处理移动,请勿重复操作…`,qolPaneScope:`已加载 {loaded} / {total} 张;全选只作用于已加载图片。`,qolLoadMore:`加载更多`,qolMoveScope:`左右目录独立读取,不继承图库筛选。移动前确认来源与目标;失败时保留选择。`,qolVariantSearch:`搜索当前已加载分组`,qolVariantSort:`分组排序`,qolVariantNewest:`最近更新`,qolVariantLargest:`图片数量`,qolVariantScore:`规则得分`,qolVariantCount:`显示 {shown} / {total} 个已加载分组`,qolVariantSafety:`分组用于辅助核对,不代表可以安全删除。相似图、同提示词与同工作流不等于重复文件。`,qolNoMatches:`当前条件没有匹配项,可清除条件后重试。`,qolResetSort:`恢复默认排序`,qolFilterHint:`筛选即时生效;清除筛选不会更改排序。`,qolFormatDetails:`格式转换(可选)`,bulkDeleteConfirm:`将选中的 {count} 张图片移入插件垃圾箱?可在垃圾箱中恢复。`,bulkDeleteHeavyConfirm:`即将把 {count} 张图片移入插件垃圾箱。请确认所选范围,操作可能需要一些时间。`,filterReset:`清除筛选`,loraModelWeight:`模型权重`,loraClipWeight:`文本编码器权重`,workspaceDesc_gallery:`浏览、筛选与整理图片`,workspaceDesc_library:`管理可复用的提示词`,workspaceDesc_workbench:`组合画师与风格提示词`,workspaceDesc_settings:`图源、偏好与诊断`,densityTitle:`网格密度`,densityShort:`密度`,densityHint:`大图看细节,小图快速浏览。`,densityPresets:`选择浏览密度`,densitySpacious:`宽松`,densityBalanced:`适中`,densityCompact:`紧凑`,densityMobileSingle:`舒适单列`,densityMobileDouble:`紧凑双列`,densityEffectiveColumns:`当前实际每行 {count} 列`,densityColumns:`{count} 张 / 行`,densityColumnsLabel:`每行最多图片数`,densityLarger:`放大缩略图`,densitySmaller:`缩小缩略图`,densityResponsiveNote:`设置的是每行上限;窗口较窄时会自动减少列数。`,densityResetDefault:`恢复默认(每行 6 张)`,tourClose:`关闭引导`,tourDensityTitle:`选择舒服的浏览密度`,tourDensityBody:`点击“密度”,选择宽松、适中或紧凑,也可以用滑块微调。设置即时生效;窄屏会自动适配。`,imageRetry:`重试加载`,imageRetryShort:`重试`,imageRetryFull:`重试加载图片`,imageOpenTab:`在新标签页打开`,imageFilmstrip:`图片缩略图导航`,imageFilmstripToggle:`显示或隐藏缩略图导航`,imageLoading:`正在载入原图…`,clearSearch:`清除搜索`,clearCategory:`清除分类筛选`,clearColor:`清除色系筛选`,clearDate:`清除日期筛选`,clearPinned:`清除置顶筛选`,commonMove:`移动`,commonAdd:`加入`,dual_title:`双栏目录整理`,dual_hint:`左右各打开一个目录,可选择、右键或拖拽图片进行整理。`,dual_left:`左侧目录`,dual_right:`右侧目录`,dual_selected:`已选 {count} 张`,dual_selectAll:`全选`,dual_invertSelection:`反选`,dual_clearSelection:`清空`,dual_refresh:`刷新`,dual_moveOther:`移动到另一栏`,dual_dropHint:`拖到这里移动`,dual_readOnly:`目标目录只读`,dual_empty:`这个目录没有图片`,dual_loading:`正在加载目录...`,dual_moving:`正在移动图片...`,dual_moved:`已移动`,dual_moveConfirmTitle:`移动选中图片`,dual_moveConfirm:`将 {count} 张图片移动到“{target}”吗?`,dual_pinConfirm:`将选中的 {count} 张图片设为 Pin 吗?`,dual_unpinConfirm:`取消选中 {count} 张图片的 Pin 吗?`,dual_addToBoardConfirm:`将选中的 {count} 张图片加入“{target}”吗?`,dual_sameFolder:`已在这个目录`,dual_noMatch:`没有匹配目录`,dual_loadError:`目录图片加载失败。`,dual_moveError:`图片移动失败。`,dual_openDetail:`打开详情`,dual_openFull:`打开原图`,dual_openWorkflow:`打开工作流`,dual_metadata:`查看 Metadata`,dual_copyImage:`复制图片`,dual_copyFilename:`复制文件名`,dual_copyPath:`复制路径`,dual_copyPrompt:`复制正向提示词`,dual_copySuccess:`已复制`,dual_copyImageSuccess:`已复制图片`,dual_copyError:`复制失败`,dual_promptMissing:`没有找到正向提示词`,dual_select:`选择`,dual_deselect:`取消选择`,dual_pin:`置顶`,dual_unpin:`取消置顶`,dual_addToBoard:`加入图版`,dual_delete:`删除`,dual_deleteTitle:`删除所选图片`,dual_deleteMessage:`确定删除选中的 {count} 张图片吗?`,dual_deleteSuccess:`已删除`,dual_deleteError:`删除图片失败`,dual_metadataError:`Metadata 加载失败`,dual_swapFolders:`左右目录对调`,dual_moveToRight:`将选中项移入右侧目录`,dual_moveToLeft:`将选中项移入左侧目录`,dual_refreshBoth:`同时刷新双栏`,workspaceSwitch:`切换工作区`,moreActions:`更多操作`,organizeFolders:`双栏整理`,organizeFoldersOpen:`开启双栏目录整理`,organizeFoldersClose:`关闭双栏目录整理`,metadataPartialWarning:`参数摘要可能不完整,请以原始元数据为准。动态提示词不会被重新执行。`,variantRuleScore:`规则评分(非概率)`,variantScopeNotice:`每次最多分析当前排序下的 2,000 张图片;未完成指纹的图片会在后续刷新中补充。分组只是整理建议。`,galleryFilters:`筛选`,appTitle:`Universal Extractor`,appSubtitle:`ComfyUI 图库与词库工作区`,navGallery:`图库`,navLibrary:`词库`,navWorkbench:`工作台`,navSettings:`设置`,navBrand:`Universal Extractor`,navSearchGalleryPlaceholder:`搜索图片、分类或备注...`,navSearchLibraryPlaceholder:`搜索词库文件或词条...`,navRefresh:`刷新`,updatesTitle:`更新`,updatesChecking:`正在检查更新...`,updatesAvailable:`发现新版本`,updatesCurrent:`当前已是最新版本`,updatesCheckNow:`检查更新`,updatesCheckFailed:`无法检查更新`,updatesCurrentVersion:`当前版本`,updatesLatestVersion:`最新版本`,updatesOpenGithub:`在 GitHub 查看`,updatesChangelog:`更新日志`,updatesNoChangelog:`暂无更新日志。`,navLanguage:`语言`,navLanguageZh:`中文`,navLanguageEn:`English`,navLanguageZhShort:`中`,navLanguageEnShort:`EN`,navSwitchToChinese:`切换到中文`,navSwitchToEnglish:`切换到 English`,navToggleSidebar:`切换侧边栏`,sidebarExpand:`展开侧边栏`,sidebarCollapse:`收起侧边栏`,navToggleSearch:`展开搜索`,sidebarResources:`资源目录`,sidebarQuickAccess:`快捷入口`,sidebarOutputDirs:`输出目录`,sidebarInputDirs:`输入目录`,sidebarCustomDirs:`来源目录`,sidebarSourceDirs:`图库目录`,sidebarOutputSource:`输出图库`,sidebarInputSource:`输入图库`,sidebarFolderViewMode:`目录视图模式`,sidebarInputReadOnly:`输入图库为只读`,sidebarSourceReadOnly:`当前来源为只读`,sidebarFolderCount:`{count} 个目录`,sidebarBoardCount:`{count} 个图版`,sidebarCategoryCount:`{count} 个分类`,sidebarLibraries:`JSON 词库`,sidebarCreateLibrary:`新建词库`,sidebarCreateLibraryPlaceholder:`artists-neo.json`,sidebarNoLibraries:`还没有可用词库`,sidebarListView:`列表视图`,sidebarTreeView:`树形视图`,sidebarTrash:`垃圾箱`,sidebarCreateFolder:`新建目录`,sidebarMergeFolder:`合并目录`,sidebarDeleteFolder:`删除目录`,sidebarExpandAll:`全部展开`,sidebarCollapseAll:`全部收起`,sidebarBoards:`图版`,sidebarAllPins:`全部 Pin 图`,sidebarCreateBoard:`新建图版`,sidebarFolderSearch:`搜索目录`,sidebarClearFolderSearch:`清空目录搜索`,sidebarNoFolderMatches:`没有匹配的目录`,sidebarMoreActions:`更多操作`,topStatus:{gallery:`输出图库`,library:`词库资产`,workbench:`工具工作区`,settings:`图库设置`},galleryBannerTitle:`输出图库工作台`,galleryBannerText:`浏览 ComfyUI 默认 output 目录,支持拖拽导入,并用 Pin、图版、分类、备注和元数据检查来管理图片。`,galleryBannerAction:`刷新输出目录`,gallerySectionTitle:`最新输出`,gallerySectionMeta:`悬停卡片可快速查看 prompt 参数,点击卡片查看完整详情。`,galleryEmptyTitle:`没有找到图片`,galleryEmptyText:`试试更换搜索词,或者先在 ComfyUI 中生成一些输出。`,galleryEmptyNoSourceTitle:`暂无可用图源`,galleryEmptyNoSourceText:`前往设置启用或修复图源,然后刷新。`,galleryEmptySourceTitle:`这个图源还没有图片`,galleryEmptySourceText:`可在 ComfyUI 中生成图片,或拖入图片导入 universal_gallery_imports/。`,galleryEmptyFilteredTitle:`没有符合筛选条件的图片`,galleryEmptyFilteredText:`可更换搜索词或清除筛选;现有图片未被删除。`,galleryEmptyErrorTitle:`图库加载失败`,galleryLoading:`正在读取输出图片...`,galleryInspect:`查看详情`,galleryPage:`第 {page} / {totalPages} 页`,galleryPrevious:`上一页`,galleryNext:`下一页`,galleryJumpTo:`跳转到`,galleryJump:`跳转`,galleryStatsTotal:`总图片数`,galleryStatsVisible:`当前载入`,galleryStatsPage:`当前页码`,galleryFilterLabel:`当前结果`,galleryFilterResult:`{count} 张图片`,variantToolbar:`变体`,variantKicker:`本地分析`,variantTitle:`变体整理`,variantSubtitle:`把重复图、近似图、同 Prompt、同 Workflow 和文件名序列的 ComfyUI 输出聚在一起,方便挑图和清理。`,variantFilters:`变体筛选`,variantFilterAll:`全部`,variantRefresh:`分析变体`,variantAnalyzing:`正在分析变体...`,variantEmptyTitle:`还没有变体组`,variantEmptyText:`先分析当前视图,或放宽筛选条件以包含相关的 ComfyUI 输出。`,variantBackToGroups:`返回变体组`,variantRelated:`相关变体`,variantSelectRest:`选择其余项`,variantSelectedGroup:`变体组`,variantImageCount:`{count} 张图片`,variantIndexed:`已分析 {count} 张`,variantPending:`待分析 {count} 张`,variantFailed:`失败 {count} 张`,variantType_exact_duplicate:`重复图`,variantType_near_duplicate:`近似图`,variantType_same_prompt:`同 Prompt`,variantType_same_workflow:`同 Workflow`,variantType_filename_series:`文件序列`,galleryFiltersRealtime:`实时应用`,galleryLiveRefreshPending:`有新图`,galleryLiveRefreshAction:`刷新当前视图`,galleryActiveFilters:`当前条件`,galleryFilterNone:`暂无额外筛选`,galleryFilterStickyHint:`顶部和底部固定,小屏也不会被挡住。`,galleryFilterClose:`关闭`,galleryFavoriteOnly:`仅看 Pin 图`,galleryPinnedOnly:`仅看 Pin 图`,galleryCategory:`分类`,galleryAllCategories:`全部分类`,gallerySort:`排序`,gallerySortBy:`排序`,gallerySortOrder:`顺序`,gallerySortNewest:`最新`,gallerySortName:`名称`,gallerySortSize:`大小`,gallerySortDesc:`降序`,gallerySortAsc:`升序`,gallerySortNewestHint:`按创建时间`,gallerySortNameHint:`按文件名`,gallerySortSizeHint:`按文件大小`,gallerySortDescHint:`从大到小 / 新到旧`,gallerySortAscHint:`从小到大 / 旧到新`,galleryDateFrom:`开始`,galleryDateTo:`结束`,galleryDateRange:`日期范围`,galleryDateClear:`清空日期`,galleryColorFamily:`色系`,galleryAllColors:`全部色系`,galleryColorIndexing:`色系索引补全中`,galleryColorThreshold:`色系占比达到 25% 才会命中筛选。`,colorFamily_red:`红色`,colorFamily_orange:`橙色`,colorFamily_yellow:`黄色`,colorFamily_green:`绿色`,colorFamily_cyan:`青色`,colorFamily_blue:`蓝色`,colorFamily_purple:`紫色`,colorFamily_pink:`粉色`,colorFamily_brown:`棕色`,colorFamily_black:`黑色`,colorFamily_white:`白色`,colorFamily_gray:`灰色`,colorFamily_warm:`暖色`,colorFamily_cool:`冷色`,colorFamily_low_saturation:`低饱和`,galleryBackToTop:`回到顶部`,galleryColumns:`每行列数`,galleryMoreCategories:`更多`,galleryCategoryBrowse:`浏览全部分类`,galleryCategoryBrowseHint:`从所有可用分类中搜索并选择。`,galleryOutputFolder:`输出目录`,galleryOutputImportPath:`拖拽导入路径`,galleryImportTarget:`导入目标`,galleryDropTitle:`拖拽文件到这里导入`,galleryDropText:`图片存入所选图源的 universal_gallery_imports/ 目录;JSON 存入词库(data/)。`,trashTitle:`垃圾箱`,trashEmptyTitle:`垃圾箱为空`,trashEmptyText:`删除的内容暂存在这里。移出到系统回收站失败时,文件仍保留在这里。`,trashRestore:`恢复`,trashDeleteForever:`移至系统回收站`,trashItemCount:`{count} 个项目`,trashSelectionHint:`默认可左键点选,也可以按住左键拖出选区多选。`,trashSelectAll:`全选`,trashClearSelection:`清空选择`,trashRestoreSelected:`恢复所选`,trashDeleteSelectedForever:`所选移至系统回收站`,trashRestoreSelectedConfirm:`确定恢复选中的 {count} 个项目吗?`,trashDeleteSelectedConfirm:`将所选 {count} 个项目移至系统回收站?成功后请在操作系统中恢复或清空。`,trashRestoreSelectedSuccess:`已恢复 {count} 个项目`,trashDeleteSelectedSuccess:`已将 {count} 个项目移至系统回收站`,trashBatchPartial:`已完成 {completed} 项,未完成 {unfinished} 项;请查看原因后重试`,trashOperationBusy:`正在处理垃圾箱,请等待本次操作完成`,trashKindImage:`图片`,trashKindFolder:`文件夹`,trashKindLibrary:`词库`,trashImageCount:`{count} 张图片`,galleryImportSuccess:`导入完成:{count} 个文件`,galleryImportSavedTo:`图片已存入 {target}`,galleryImportLibrariesSavedTo:`{count} 个 JSON 文件已存入词库 data/`,galleryOpenImportFolder:`打开导入目录`,galleryImportSkipped:`跳过 {count} 个不支持的文件`,galleryCategoryPlaceholder:`分类,例如:角色 / 风格 / 草图`,galleryNotesPlaceholder:`备注、来源或整理说明`,galleryTitlePlaceholder:`自定义标题`,galleryFavorite:`Pin 图`,galleryUnfavorite:`取消 Pin`,galleryPin:`Pin 图`,galleryUnpin:`取消 Pin`,gallerySelectImage:`选择图片`,galleryDeselectImage:`取消选择图片`,galleryHoverTitle:`快速元数据`,galleryHoverPrompt:`正向 Prompt`,galleryHoverNegative:`负向 Prompt`,galleryHoverArtists:`画师串`,galleryHoverNoPrompt:`未读取到 Prompt 内容`,libraryBannerTitle:`词库管理工作台`,libraryBannerText:"统一管理 `data/*.json` 词库文件,直接在网页中查看、编辑和保存 Prompt 数据。",libraryBannerAction:`刷新词库`,librarySelectTitle:`选择一个词库文件`,librarySelectText:`从左侧列表中选择一个 JSON 文件,或直接新建一个词库开始编辑。`,libraryWorkspaceSubtitle:`{name} · 共 {count} 条,可直接搜索、编辑和生成`,libraryEntries:`词条数量`,libraryActive:`当前文件`,libraryEdit:`编辑 JSON`,libraryImport:`导入`,libraryAddFile:`添加词库`,libraryExport:`导出`,libraryFormat:`格式化 JSON`,librarySave:`保存`,libraryCancel:`取消`,libraryLoading:`正在读取词库内容...`,libraryDetail:`词库详情`,libraryNoDescription:`暂无描述`,libraryEmptyTitle:`这个词库还是空的`,libraryEmptyText:`可以先用新手模板起步,或手动添加第一条记录,再通过搜索和生成慢慢打磨。`,librarySaveSuccess:`词库已保存({count} 条)`,libraryCreateSuccess:`词库已创建`,libraryImportSuccess:`已导入到 {name}({count} 条)`,libraryUnsavedChanges:`有未保存修改`,librarySavedState:`已保存`,libraryUnsavedTitle:`有未保存修改`,libraryUnsavedConfirm:`是否放弃未保存的词库修改?`,libraryDiscardChanges:`放弃修改`,libraryLargeEditHint:`大词库请使用单条编辑`,libraryAddEntry:`新增词条`,libraryStarterTemplate:`新手模板`,libraryEntryEditorHint:`按单条 JSON 记录编辑,避免整份大文件载入浏览器后卡顿。`,libraryDeleteEntryConfirm:`确定删除这条词库记录吗?`,libraryOverviewEntries:`词库规模`,libraryOverviewEntriesHint:`先看条目规模,再决定用单条编辑还是整库 JSON 编辑。`,libraryOverviewAliases:`别名覆盖`,libraryOverviewAliasesHint:`带别名的条目更容易在后期整理和搜索时被找到。`,libraryOverviewTags:`标签密度`,libraryOverviewTagsHint:`标签越清晰,后面做筛选、迁移和复用就越省力。`,libraryOverviewModels:`模型提示`,libraryOverviewModelsHint:`模型备注能帮助新手快速判断这条更适合在哪类模型里用。`,libraryGuideTitle:`新手上手路径`,libraryGuideStepOne:`先分清词库用途:画师、风格、角色,还是常用提示片段。`,libraryGuideStepTwo:"把 `name` 或 `title` 保持简短稳定,把真正要复用的内容写进 `prompt`。",libraryGuideStepThree:`补齐别名、标签和说明,后续搜索与整理会轻松很多。`,libraryGuideStepFour:`编辑完就去工作区测试,哪些条目好用、哪些不稳,再回头继续修正。`,libraryFieldGuideTitle:`推荐字段`,libraryFieldNameHint:`优先保存原始标签名,或最稳定、最短的检索名。`,libraryFieldPromptHint:`保存真正会被复用的提示词片段,方便后面直接复制进工作流。`,libraryFieldAliasHint:`补充别称、缩写和译名,提升后续搜索命中率。`,libraryFieldTagsHint:`用小颗粒标签标识用途,比如 artist、portrait、pony、sdxl。`,libraryFieldModelHint:`记录这一条更适合的模型族或 checkpoint。`,libraryFieldDescriptionHint:`写实用备注,比如优点、缺点、适用场景或不推荐搭配。`,librarySearchActive:`当前搜索:{name}`,librarySearchReady:`搜索已就绪`,librarySearchHint:`顶部搜索会匹配 name、prompt、tags、other_names、model、description,以及该条 JSON 中的其他文本。`,librarySearchClear:`清空搜索`,libraryTopTags:`当前页高频标签`,libraryTopModels:`当前页模型备注`,libraryNoTagsYet:`当前结果里还没有标签`,libraryNoModelsYet:`当前结果里还没有模型备注`,libraryReadyToCopy:`可复用`,libraryEntryStatus:`第 {count} 条`,libraryCopyJson:`复制 JSON`,libraryCopyJsonSuccess:`已复制词条 JSON`,libraryCopyPrompt:`复制提示词`,libraryTemplateArtist:`画师条目`,libraryTemplateArtistHint:`适合画师名、Danbooru 画师标签和可复用画师提示词。`,libraryTemplateArtistDescription:`画师条目优先保留原始标签名,方便生成器和检索一起工作。`,libraryTemplateStyle:`风格条目`,libraryTemplateStyleHint:`适合整段风格、氛围、光影类提示词模板。`,libraryTemplateStyleDescription:`风格条目适合保存整段提示词,后续可直接复制进工作流。`,libraryTemplateCharacter:`角色条目`,libraryTemplateCharacterHint:`适合角色、主体、服装外观等重复使用的设定。`,libraryTemplateCharacterDescription:`角色条目建议把核心外观特征写进 prompt,把俗称放到 other_names。`,libraryTemplatePanelTitle:`快捷模板`,libraryValidationTitle:`校验问题`,libraryValidationGlobal:`全局`,libraryImportTitle:`导入词库 JSON`,libraryImportText:`可以选择新建词库、替换现有词库,或合并到当前词库。`,libraryImportModeCreate:`新建词库`,libraryImportModeReplace:`替换词库`,libraryImportModeMerge:`合并到词库`,libraryImportFile:`JSON 文件`,libraryImportFileEmpty:`未选择文件`,libraryImportNewName:`新词库名称`,libraryImportTarget:`目标词库`,libraryImportChooseTarget:`选择目标词库`,libraryImportConfirm:`导入 JSON`,libraryImportConfirmAsk:`是否将“{name}”作为词库文件导入?`,libraryImportConfirmTitle:`确认导入词库`,libraryImportCreateConfirm:`从“{name}”创建新词库吗?`,libraryImportReplaceConfirm:`用导入的 JSON 覆盖“{name}”中的所有条目吗?`,libraryImportMergeConfirm:`将导入条目合并到“{name}”中吗?`,librarySaveConfirmTitle:`保存词库修改`,librarySaveConfirm:`用当前编辑器内容覆盖“{name}”吗?`,librarySaveEntryConfirmTitle:`保存条目`,librarySaveEntryConfirm:`将这个条目保存到当前词库吗?`,libraryDropTitle:`将 JSON 词库拖到这里`,libraryDropText:`会先检查文件是否为 JSON,再询问你要如何添加。`,workbenchTitle:`工作区`,workbenchSubtitle:`预置多个工具卡片,用于提示词拼装、画师串生成和后续扩展工具。`,workbenchAppTitle:`工作台`,workbenchAppSubtitle:`从词库组合提示词,管理预选内容与灵感。`,workbenchToolShelf:`工具架`,workbenchToolShelfHint:`点击当前需要的工具图标即可切换,后续扩展新工具也不会打乱工作区布局。`,workbenchToolReady:`可用`,workbenchToolNew:`新增`,workbenchStatusStrip:`工作区状态`,workbenchActiveTool:`当前工具`,workbenchLibraryCount:`词库`,workbenchQueueCount:`预选`,workbenchGeneratorMetrics:`生成器摘要`,workbenchResultTokens:`结果段`,workbenchRecipeSection:`生成配方`,workbenchOutputSection:`生成输出`,workbenchFormatSection:`格式后处理`,workbenchFormattedTokens:`已转换 {count} 个片段`,toolArtistGenerator:`画师串生成器`,toolArtistGeneratorDesc:`从当前 JSON 词库预设中生成可复用的画师提示词组合。`,toolInspirationHub:`灵感收集站`,inspirationHubTitle:`图库与视觉参考聚合`,inspirationHubDesc:`把高价值图库、作品集和灵感站点集中成一个简洁入口,可按推荐程度或日常使用频率排序。`,inspirationMetricSites:`站点`,inspirationRecommendation:`推荐`,inspirationFrequency:`频率`,inspirationSearchPlaceholder:`搜索站点、类型或适用场景...`,inspirationSortRecommendation:`按推荐排序`,inspirationSortFrequency:`按频率排序`,inspirationSortName:`按名称排序`,inspirationType_all:`全部类型`,inspirationType_moodboard:`灵感板`,inspirationType_portfolio:`作品集`,inspirationType_illustration:`插画概念`,inspirationType_product:`产品界面`,inspirationType_ai:`AI 图像`,inspirationRegionGlobal:`全球`,inspirationRegionChina:`中国`,inspirationOpenSite:`打开站点`,inspirationPinterestDesc:`综合型灵感板,适合快速找构图、配色、服装、室内、摄影和视觉方向参考。`,inspirationPinterestBest:`快速拼灵感板和发散想法`,inspirationHuabanDesc:`中文视觉采集社区,插画、设计、摄影、生活方式和素材板都比较丰富。`,inspirationHuabanBest:`中文语境参考和素材板`,inspirationBehanceDesc:`偏作品集与案例展示,适合看品牌、版式、活动视觉和完整设计系统的呈现方式。`,inspirationBehanceBest:`成熟案例和成套设计系统`,inspirationArtStationDesc:`概念艺术、角色、场景、3D、游戏和影视娱乐设计质量很高,适合找生产级风格参考。`,inspirationArtStationBest:`概念艺术和高完成度风格`,inspirationDribbbleDesc:`聚焦 UI、图标、应用界面、动效和产品视觉片段,适合找界面细节和视觉手感。`,inspirationDribbbleBest:`UI 细节和产品界面灵感`,inspirationCosmosDesc:`干净的个人收藏平台,适合保存视觉参考、截图、链接和连续的创作线索。`,inspirationCosmosBest:`个人灵感收纳`,inspirationArenaDesc:`偏研究型的视觉板,适合艺术方向、设计理论、视觉文化和概念参考整理。`,inspirationArenaBest:`深度研究和主题板`,inspirationDesignspirationDesc:`搜索体验直接,适合找字体、配色、海报、编辑设计和网页视觉情绪。`,inspirationDesignspirationBest:`配色与字体方向搜索`,inspirationLapaDesc:`真实落地页图库,适合参考产品首页、首屏结构、版式节奏和转化路径。`,inspirationLapaBest:`落地页和网页布局参考`,inspirationLexicaDesc:`AI 图像搜索与提示词相关浏览,适合快速探索风格方向和生成参考。`,inspirationLexicaBest:`AI 风格探索`,toolComingSoon:`敬请期待`,artistLibrarySource:`词库来源`,artistGenerate:`生成`,artistCount:`数量`,artistMode:`模式`,artistRandom:`随机`,artistSequential:`顺序`,artistPrefix:`前缀`,artistSuffix:`后缀`,artistSeparator:`分隔符`,artistSeed:`种子`,artistResult:`生成结果`,artistCopyResult:`复制结果`,artistNoLibraries:`没有可用词库`,workbenchMode:`模式`,workbenchModePure:`纯净`,workbenchModeStandard:`标准权重`,workbenchModeCreative:`创意括号`,workbenchModeNai:`NAI`,workbenchPostFilter:`作品数过滤`,workbenchPostThreshold:`作品数阈值`,workbenchFilterNone:`不过滤`,workbenchFilterGreater:`大于`,workbenchFilterLess:`小于`,workbenchWeightMin:`权重下限`,workbenchWeightMax:`权重上限`,workbenchBracketStyle:`括号样式`,workbenchNestLevels:`嵌套层数`,workbenchCustomFormat:`自定义格式`,workbenchFormatString:`格式字符串`,workbenchFormatTool:`格式转换`,workbenchFormatToolAnima:`Anima 格式`,workbenchFormatToolCustom:`自定义格式`,workbenchFormatToolTemplate:`模板`,workbenchFormatToolApply:`执行转换`,workbenchFormatToolResult:`转换结果`,workbenchFormatToolAnimaHint:`把 name_(group) 这类标签转换为 @name \\(group\\) 形式,方便用于 Anima 后处理。`,workbenchFormatApplied:`格式转换已完成`,workbenchPreselected:`预选画师`,workbenchPreselectedEmpty:`在右侧画师池里添加画师,生成时会优先使用这些名字。`,workbenchArtistPool:`画师池`,workbenchArtistPoolHint:`按名称或别名搜索画师,然后加入预选队列。`,workbenchGenerateSuccess:`画师串已生成`,workbenchCopyError:`复制生成结果失败`,workbenchEmptyHint:`先生成一次结果,这里会显示选中的词条和最终拼接文本预览。`,workbenchPreviewHint:`在生成前先预览当前词库的部分词条,更容易确认来源是否正确。`,commonLoading:`加载中...`,commonEnabled:`已启用`,commonDisabled:`未启用`,viewMode:`排列方式`,viewGrid:`网格`,viewList:`列表`,bulkActions:`批量操作`,bulkSelectMode:`选择模式`,bulkSelectionHint:`仅作用于当前页。开启后可左键点选,或按住左键框选当前页图片。`,bulkSelected:`已选 {count} 项`,bulkFavorite:`批量 Pin`,bulkUnfavorite:`取消 Pin`,bulkPin:`Pin 所选`,bulkUnpin:`取消 Pin`,bulkAddToBoard:`加入图版`,bulkRemoveFromBoard:`移出图版`,bulkSetCategory:`设置分类`,bulkMoveTo:`移动到目录`,bulkPinConfirm:`将选中的 {count} 张图片设为 Pin 吗?`,bulkUnpinConfirm:`取消选中 {count} 张图片的 Pin 吗?`,bulkAddToBoardConfirm:`将选中的 {count} 张图片加入“{target}”吗?`,bulkRemoveFromBoardConfirm:`将选中的 {count} 张图片从“{target}”移出吗?`,bulkSetCategoryConfirm:`将选中的 {count} 张图片分类设为“{target}”吗?`,bulkMoveConfirm:`将选中的 {count} 张图片移动到“{target}”吗?`,bulkRenameConfirm:`用“{target}”规则重命名选中的 {count} 张图片吗?`,bulkRenameTemplatePlaceholder:`重命名规则,例如 set-{page}-{n} 或 {name}-v2`,bulkRenameStart:`起始`,bulkRenamePadding:`补位`,bulkRenameApply:`重命名`,bulkRenameRuleTitle:`规则说明`,bulkRenameRuleHint:`支持 {n}=序号,{name}=原文件名(不含扩展名),{page}=当前页码。原扩展名会自动保留。`,bulkRenameSuccess:`已重命名 {count} 张图片`,bulkRenameError:`批量重命名失败`,bulkDelete:`删除所选`,imageDelete:`删除图片`,bulkClear:`清空选择`,bulkSelectVisible:`全选当前页`,imageRenameError:`重命名图片失败`,imageDeleteError:`删除图片失败`,inspectorFolderTitle:`当前视图`,inspectorFolderHint:`未选择图片时,这里显示当前目录、筛选结果和快捷操作。`,inspectorVisibleCount:`当前页`,inspectorSingleHint:`这里仅处理已选图片的批量管理:Pin、移动、分类、重命名、加入图版或删除。`,inspectorFilename:`文件名`,inspectorCategory:`分类`,inspectorSource:`来源`,inspectorSize:`大小`,inspectorCreated:`创建时间`,inspectorEmptyValue:`未设置`,modalClose:`关闭详情`,modalTitle:`图像详情`,modalOpenFull:`打开原图`,modalOpenWorkflow:`在 ComfyUI 中打开工作流`,modalExpandImage:`展开图片`,modalZoomIn:`放大图片`,modalZoomOut:`缩小图片`,modalFitImage:`适应窗口`,modalToggleInspector:`显示或隐藏侧边信息`,modalGestureHint:`滚轮缩放,左键拖拽平移,双击重置`,modalPromptHits:`命中画师串`,modalMetadataBlocks:`元数据块`,modalLoading:`正在读取嵌入的工作流元数据...`,modalPromptSection:`命中的词库提示词`,modalMetadataSection:`元数据块`,modalRawMetadata:`原始元数据`,modalNoMetadata:`这张图片中没有检测到 prompt 或 workflow 元数据。`,metadataView:`查看 Metadata`,metadataPromptSummary:`提示词摘要`,metadataPositivePrompt:`正面提示词`,metadataNegativePrompt:`负面提示词`,metadataCopyPositive:`复制正面提示词`,metadataCopyPositiveSuccess:`正面提示词已复制`,metadataCopyRaw:`复制原始 Metadata`,metadataCopyRawSuccess:`原始 Metadata 已复制`,metadataNoPositivePrompt:`未找到正面提示词`,metadataNoNegativePrompt:`未找到负面提示词`,metadataLoadError:`读取图片 Metadata 失败`,recipeTitle:`生成配方 (Recipe)`,recipeCheckpoint:`模型 Checkpoint`,recipeLoras:`LoRA 堆栈`,recipeParams:`生成参数`,recipeSeed:`Seed 种子`,recipeSteps:`步数 Steps`,recipeCfg:`CFG Scale`,recipeSampler:`采样器 Sampler`,recipeScheduler:`调度器 Scheduler`,recipeSize:`分辨率 Size`,recipeDenoise:`降噪 Denoise`,recipeCopyPositive:`复制正面提示词`,recipeCopyNegative:`复制负面提示词`,recipeCopySeed:`复制种子`,recipeCopyFull:`复制完整配方`,recipeCopiedSuccess:`已复制到剪贴板`,recipeApplyLoraStack:`应用 LoRA 堆栈`,recipeSendWorkflow:`发送工作流到 ComfyUI`,modalEditSection:`图像管理`,modalCategory:`分类`,modalTitleField:`标题`,modalFilenameField:`文件名`,modalNotesField:`备注`,modalSaveState:`保存图像信息`,modalSaveHint:`这里保存标题、分类、备注和 Pin 状态;文件名需要单独重命名。`,modalFilenameRenameHint:`文件名尚未保存;请点“重命名文件”,保存图像信息不会更改文件名。`,modalUnsavedStateTitle:`还有未保存的图像修改`,modalUnsavedStateText:`当前图像信息尚未保存。保存后继续、放弃修改,还是取消操作?`,modalUnsavedFilenameText:`文件名拟改为“{target}”,可能还有其他修改。保存后继续将先保存信息并重命名文件;也可以放弃或取消。`,modalUnsavedLoadingText:`图像信息仍在加载,暂不能保存。请稍候再试,或放弃草稿。`,modalSaveAndContinue:`保存并继续`,modalWaitForMetadata:`图像信息仍在加载,请稍后再保存。`,modalFilenameRequired:`文件名不能为空。`,modalDiscardChanges:`放弃修改`,modalUnsavedStateBadge:`未保存`,modalSavedStateBadge:`已保存`,modalRenameFile:`重命名文件`,modalDeleteFile:`删除文件`,commonEntries:`{count} 条记录`,commonDelete:`删除`,commonConfirm:`确认`,commonCreate:`创建`,commonSend:`发送`,commonNoneSelected:`未选择`,commonCopy:`复制`,notificationDismiss:`关闭提醒`,operationRefresh:`正在刷新...`,operationRefreshSuccess:`图库刷新完成`,galleryRefreshInterrupted:`切换视图后已中断刷新`,operationCreateLibrary:`正在创建词库...`,operationSaveLibrary:`正在保存词库...`,operationImportLibrary:`正在导入词库...`,operationDeleteLibrary:`正在删除词库...`,operationCreateBoard:`正在创建图版...`,operationDeleteBoard:`正在删除图版...`,operationAddToBoard:`正在加入图版...`,operationRemoveFromBoard:`正在移出图版...`,operationUpdateImages:`正在更新图片...`,operationUpdateImagesSuccess:`图片已更新`,operationMoveImages:`正在移动图片...`,operationMoveImagesSuccess:`图片已移动`,operationMoveUnchanged:`已在目标目录 {count} 张(未移动)。`,operationUnaccounted:`结果未确认 {count} 张(保留选择)。`,operationUnprocessedPaths:`未处理:{target}`,operationViewDetails:`查看详情`,operationRenameImages:`正在重命名图片...`,operationDeleteImages:`正在删除图片...`,operationDeleteImagesResult:`已移入垃圾箱 {count} 张;未处理 {missing} 张。`,operationCreateFolder:`正在创建目录...`,operationMergeFolder:`正在合并目录...`,operationMoveFolder:`正在移动目录...`,operationRenameFolder:`正在重命名目录...`,operationDeleteFolder:`正在删除目录...`,operationImportFiles:`正在导入文件...`,operationRenameImage:`正在重命名图片...`,operationDeleteImage:`正在删除图片...`,operationRestoreTrash:`正在恢复垃圾箱项目...`,operationPurgeTrash:`正在移至系统回收站...`,operationSendWorkflow:`正在发送工作流...`,operationApplyLoraStack:`正在应用 LoRA 堆...`,operationRunDiagnostics:`正在运行诊断...`,operationTestPath:`正在测试路径...`,operationSaveSource:`正在保存目录源...`,operationDeleteSource:`正在删除目录源...`,operationGenerateArtists:`正在生成画师串...`,contextCopyImage:`复制图片`,contextCopyFilename:`复制文件名`,contextCopyPath:`复制路径`,contextCopyImageSuccess:`已复制图片到剪贴板`,contextCopyImageLinkSuccess:`已复制图片链接到剪贴板`,contextCopyFilenameSuccess:`已复制文件名`,contextCopyPathSuccess:`已复制路径`,contextCopyError:`复制失败`,contextCopyImageError:`复制图片失败`,imageDeleteConfirm:`确定删除图片“{name}”吗?`,imageDeleteMissing:`图片未被删除:文件不存在或图源为只读。`,imageRenameConfirm:`将“{name}”重命名为“{target}”吗?`,imageRenameWithStateConfirm:`将先保存当前图像信息的修改,再把“{name}”重命名为“{target}”。继续吗?`,imageStateSaveConfirm:`保存“{name}”的图像信息修改吗?`,imagePinConfirm:`将“{name}”设为 Pin 吗?`,imageUnpinConfirm:`取消“{name}”的 Pin 吗?`,confirmDeleteLibrary:`确定删除“{name}”吗?`,galleryImportConfirmTitle:`导入文件`,galleryImportConfirm:`导入 {count} 个文件?图片将存入 {target};JSON 词库将存入 data/*.json。`,folderCreatePrompt:`输入新的输出目录路径`,folderDeleteConfirm:`确定删除目录“{name}”及其内部所有文件吗?`,folderMergePrompt:`输入要合并到的目标目录路径`,folderCreateTitle:`新建输出目录`,folderCreateText:`请输入相对于 ComfyUI output 的目录路径。`,folderMergeTitle:`合并输出目录`,folderMergeText:`将当前选中的目录移动并合并到另一个输出目录。`,folderMergeConfirm:`将“{name}”合并到“{target}”吗?目录内文件可能会被移动到目标目录。`,folderMoveTitle:`移动目录`,folderMoveConfirm:`将“{name}”移动到“{target}”中吗?`,folderRenameTitle:`重命名输出目录`,folderRenameText:`修改目录路径。可输入同级新名称,也可以输入新的相对目录路径。`,folderRenameConfirm:`将“{name}”重命名或移动为“{target}”吗?`,folderRenamePrompt:`输入新的输出目录路径`,folderPathPlaceholder:`目录/子目录`,folderCreateSuccess:`目录已创建`,folderDeleteSuccess:`目录已删除`,folderMergeSuccess:`目录已合并`,folderMoveSuccess:`目录已移动`,folderRenameSuccess:`目录已重命名`,folderCreateError:`创建目录失败`,folderDeleteError:`删除目录失败`,folderMergeError:`合并目录失败`,folderMoveError:`移动目录失败`,folderRenameError:`重命名目录失败`,folderMove:`移动`,folderRename:`重命名`,folderPin:`置顶目录`,folderUnpin:`取消置顶`,folderSortByName:`按名称排序`,folderSortByModified:`按修改时间排序`,folderSortAsc:`按名称升序`,folderSortDesc:`按名称降序`,boardCreateTitle:`新建图版`,boardCreateText:`图版用于收集 Pin 图,不会移动原始输出文件。`,boardCreateConfirm:`创建图版“{name}”吗?`,boardNameLabel:`图版名称`,boardNamePlaceholder:`角色参考 / 光影测试`,boardCreateSuccess:`图版已创建`,boardCreateError:`创建图版失败`,boardAddToTitle:`加入图版`,boardAddToText:`为已选的 {count} 张图片选择一个图版。`,boardAddToAction:`加入图版`,boardAddSuccess:`已将 {count} 张图片加入图版`,boardEmptyText:`还没有图版`,boardCreateInline:`也可以直接新建图版`,boardDeleteTitle:`删除图版`,boardDeleteConfirm:`确定删除图版“{name}”吗?图片会保留在输出目录中。`,boardDeleteSuccess:`图版已删除`,boardShareTitle:`生成分享图`,boardShareText:`5 列 x 4 行的小型预览图已准备好。`,boardShareSubtitle:`{count} 张 Pin 图`,boardShareDownload:`下载分享图`,boardShareError:`生成分享图失败`,settingsKicker:`目录源管理`,settingsTitle:`设置`,settingsSubtitle:`管理图片目录、浏览偏好与资源诊断。`,settingsActiveSources:`启用目录源`,settingsIndexedImages:`已索引图片`,settingsSourcesTitle:`图片目录`,settingsSourcesHint:`可启用多个目录,支持跨盘路径,并指定拖拽导入的落点。`,settingsAddSource:`添加自定义目录`,settingsNewSource:`新的自定义目录`,settingsDefaultLockedHint:`默认 ComfyUI 目录会锁定名称和路径,但仍可启用或禁用。`,settingsCustomHint:`自定义目录可以指向任意本地或挂载目录,并融合进图库浏览。`,settingsSourceName:`目录名称`,settingsSourceNamePlaceholder:`参考盘 / 归档目录`,settingsSourcePath:`目录路径`,settingsSourcePathPlaceholder:`D:\\images\\reference-library`,settingsSourceEnabled:`启用`,settingsSourceWritable:`允许文件操作`,settingsSourceRecursive:`扫描子目录`,settingsSourceImportTarget:`导入落点`,settingsSourceTest:`测试路径`,settingsSourceSave:`保存目录源`,settingsSourceDelete:`删除目录源`,settingsSourceScan:`重新扫描`,settingsPreferencesTitle:`界面与交互偏好`,settingsPreferencesHint:`这些开关只保存在当前浏览器,用来控制图库的默认交互方式。`,settingsOnboardingTitle:`新手互动教程`,settingsOnboardingHint:`重新播放图库、词库、画师工作台和图源设置的引导流程。`,settingsOnboardingRestart:`重新打开新手教程`,settingsPrefDefaultSelection:`默认进入选择模式`,settingsPrefDefaultSelectionHint:`关闭后,单击图片默认打开详情;需要框选时再手动点选选择模式。`,settingsPrefConfirmWorkflow:`发送工作流前确认`,settingsPrefConfirmWorkflowHint:`关闭后,点击“在 ComfyUI 中打开工作流”会直接发送到已打开的 ComfyUI 页面。`,settingsPrefCollapseSidebar:`启动时收起侧边栏`,settingsPrefCollapseSidebarHint:`桌面端打开图库时默认收起左侧资源栏,适合小屏或专注看图。`,settingsPrefImagePrefetch:`预加载附近图片`,settingsPrefImagePrefetchHint:`滚动图库时提前加载附近缩略图,关闭后可减少后台网络和磁盘读取。`,settingsPrefLiveRefresh:`图库自动同步最新输出`,settingsPrefLiveRefreshHint:`工作流完成后自动同步;可见时每 15 秒检查遗漏。整理时保持位置,关闭后仅手动刷新。`,settingsPrefFolderTree:`目录默认树形视图`,settingsPrefFolderTreeHint:`关闭后输出目录默认使用平铺列表,更适合目录层级很浅的图库。`,tourWelcomeTitle:`欢迎使用 Universal Gallery`,tourWelcomeBody:`用一分钟了解常用功能。每一步都会高亮对应的位置;你可以随时跳过,之后在设置中重新开始。`,tourTopbarTitle:`在工作区之间切换`,tourTopbarBody:`点击左上角的工作区名称,在图库、词库、工作台和设置之间切换。每个选项都附有用途说明。`,tourSidebarTitle:`浏览图源与目录`,tourSidebarBody:`这里按图源组织目录。点击目录查看图片;目录右侧的更多菜单可切换树形/列表视图、排序和整理文件夹。`,tourGalleryTitle:`浏览、筛选与排序图片`,tourGalleryBody:`从这里搜索图片名称、分类或备注。旁边的“筛选”可限定日期、颜色与置顶状态;按 / 可快速定位搜索框。`,tourSelectionTitle:`选择与批量操作`,tourSelectionBody:`打开选择模式后,可以点击选择、Shift 连选,或直接框选。框选会保持拖拽开始时的布局,滚动页面时也会继续命中正确图片。`,tourDetailTitle:`查看详情并发送工作流`,tourDetailBody:`点击图片查看大图和参数,使用左右方向键切换。双击图片可放大,双击空白处退出;工作流操作在详情工具栏中。`,tourLibraryTitle:`管理提示词词库`,tourLibraryBody:`在词库中搜索、导入、导出和编辑 JSON 提示词。条目可以用于抽取节点,也可以在工作台中组合。`,tourWorkbenchTitle:`组合可复用提示词`,tourWorkbenchBody:`从词库中选择画师和标签,调整格式并复制生成的提示词。未加载词库时可以先回到词库导入。`,tourSettingsTitle:`调整图源与偏好`,tourSettingsBody:`在设置中管理图源与偏好,检查诊断信息。以后想再看这份引导,点击这里的“重新开始教程”。`,tourDoneTitle:`可以开始使用了`,tourDoneBody:`已经准备好了。完成后可以自由浏览;这份引导不会自动重开,需要时可从设置进入。`,tourSkip:`跳过`,tourPrevious:`上一步`,tourNext:`下一步`,tourFinish:`完成`,tourStepProgress:`第 {page} / {totalPages} 步`,tourTargetMissing:`这里目前没有可高亮的内容(可能尚无图片或词库)。可以继续下一步。`,settingsPathOk:`路径可用,顶层发现 {count} 张图片。`,settingsPathMissing:`路径不存在,或不是文件夹。`,settingsPathError:`测试路径失败`,settingsSourceSaved:`目录源已保存`,settingsSourceSaveError:`保存目录源失败`,settingsSourceSaveConfirm:`保存目录源“{name}”的修改吗?这可能改变可写目录或索引范围。`,settingsSourceCreateConfirm:`将“{name}”添加为图库目录源吗?`,settingsSourceDeleted:`目录源已删除`,settingsSourceDeleteError:`删除目录源失败`,settingsSourceDeleteConfirm:`确定从图库目录源中移除“{name}”吗?`,settingsDiagnostics:`源状态诊断`,settingsDiagnosticsHint:`检查可访问性、读写权限、目录重叠、图片数量和磁盘空间。`,settingsDiagnosticsRun:`运行诊断`,settingsDiagnosticsDone:`诊断完成`,settingsDiagnosticsError:`诊断失败`,settingsDiagnosticImages:`{count} 张图片`,settingsDiagnosticFolders:`{count} 个文件夹`,settingsDiagnosticOverlap:`{count} 处重叠`,settingsStatus_ok:`正常`,settingsStatus_missing:`缺失`,settingsStatus_error:`异常`,settingsStatus_unreadable:`不可读`,settingsStatus_write_blocked:`不可写`,settingsStatus_overlap:`路径重叠`,workflowSendSuccess:`工作流已发送到 ComfyUI`,workflowSendConfirm:`是否将“{name}”中的工作流发送到 ComfyUI?`,loraStackApply:`应用 LoRA 堆到当前工作流`,loraStackReading:`读取图片的 LoRA 堆…`,loraStackApplyConfirm:`将“{name}”中的 {count} 个 LoRA 应用到当前工作流?仅修改选中的 LoRA Manager 节点;未选中时修改第一个。追加保留旧条目并更新同名 LoRA;覆盖则替换该节点的旧堆。`,loraStackClipWarning:`其中 {count} 个 LoRA 的 CLIP 强度与主强度不同:发送时会折叠但保留原值;若在折叠状态下调整主强度,LoRA Manager 会同步覆盖 CLIP。`,loraStackAppend:`追加到原堆`,loraStackReplace:`覆盖旧堆`,loraStackAppendedSuccess:`已将 {count} 个 LoRA 合并到“{name}”`,loraStackReplacedSuccess:`已用 {count} 个 LoRA 覆盖“{name}”`,loraStackAppendDetail:`新增 {added} 项,同名更新 {updated} 项;其他旧条目保持原样。`,loraStackReplaceDetail:`移除旧条目 {removed} 项,同名更新 {updated} 项。`,loraStackApplyNoStack:`这张图未识别到可用的 ComfyUI-Lora-Manager LoRA 堆。`,loraStackApplyNoComfyPage:`未找到可接收的 ComfyUI 页面。请保持 ComfyUI 主界面已打开并刷新一次。`,loraStackBridgeOutdated:`当前 ComfyUI 页面仍运行旧版插件脚本;本次发送已被拦截,以免“追加”误删旧 LoRA。请重启 ComfyUI,并强制刷新主页面及图库后重试。`,loraStackApplyNoTargetNode:`当前工作流里未找到可写入的 LoRA Manager 节点。`,loraStackApplySuccess:`LoRA 堆已应用到当前工作流`,trashRestoreConfirm:`将这个回收站项目恢复到原位置吗?`,workflowNoComfyPage:`没有检测到已刷新并可接收工作流的 ComfyUI 页面。请刷新现有 ComfyUI 页面后重试。`,errorOpenLibrary:`打开词库失败`,errorCreateLibrary:`创建词库失败`,errorDeleteLibrary:`删除词库失败`,errorSaveLibrary:`保存词库失败`,errorImportLibrary:`导入词库失败`,errorNoLibrarySelected:`尚未选择词库`,errorLibraryNameRequired:`请输入词库文件名`,imageStateSaveError:`保存图像信息失败`,errorJsonInvalid:`JSON 格式不正确`,jobRetry:`重试`,jobRefresh:`刷新资源库`,jobFingerprints:`分析图片`,jobRunning:`处理中`,jobFailed:`失败`,jobCancelled:`已取消`,jobCompleted:`已完成`},en:{libraryWorkspaceIntro:`Manage prompt and tag libraries with JSON import and editing.`,imageSearchClose:`Close image search`,operationBatchResult:`{updated} succeeded · {count} skipped · {missing} unfinished`,operationRetryBatchConfirm:`Retry only {count} unfinished items. Changes: {target}`,galleryMode:`Gallery mode`,galleryModeBrowse:`Browse`,galleryFolderPath:`Folder path`,librarySelectInlineHint:`Choose a library here, or create one or import JSON.`,libraryCreateInline:`New library`,detailBrowse:`Browse`,detailReuse:`Reuse`,detailManage:`Manage`,detailNoWorkflow:`No reusable workflow in this image`,imageSearchReturn:`Return to image search and previous view`,imageSearchLegacyLocate:`Older server: folder located. Find the image by filename.`,imageSearchLocateFailed:`Unable to locate. Check the source and refresh.`,settingsDensity:`Interface density`,densityStandard:`Standard`,settingsDensityHint:`Changes spacing independently of grid columns.`,operationCenter:`Task center`,operationTab_pending:`Active`,operationTab_error:`Failed`,operationTab_recent:`Recent`,operationEmpty:`No records`,operationClear:`Clear record`,jobRequestCancel:`Request cancellation`,galleryAutoSyncFailed:`Gallery sync failed. Retry when ready.`,updatesInstalledNotes:`What’s new in v{version}`,updatesPreview:`Local preview · remote not checked`,updatesCached:`Using verified cache`,updatesLocalOnly:`Installed release notes`,updatesLastSuccess:`Last successful check`,updatesInstalled:`Installed release`,updatesHistory:`History`,imageSearchTitle:`Search by image`,imageSearchIntro:`Find the original of an old social media image and its folder. Searches all enabled sources, independent of current filters.`,imageSearchChoose:`Choose reference image`,imageSearchReplace:`Replace reference`,imageSearchPaste:`Ctrl / ⌘ + V to paste, or drop an image here`,imageSearchReference:`Reference image`,imageSearchBroader:`Broaden matching`,imageSearchPrivacy:`Local search only. Your reference is never imported. The first search builds a library index in the background, which continues after closing this dialog.`,imageSearchLimits:`Matches compressed and resized copies. Heavy cropping, collages or occlusion may not match. Scores are rankings, not identity probabilities. Reference limit: 20 MB.`,imageSearchInvalid:`Choose an image file up to 20 MB.`,imageSearchSearching:`Finding identical and similar images…`,imageSearchIndexing:`Building library search index · {loaded} / {total}`,imageSearchIndexFailed:`Search index did not finish. Please retry.`,imageSearchReady:`Paste, drop or choose an image to search`,imageSearchCoverage:`Searched {loaded} / {total} images · Top {count} matches`,imageSearchFailedCount:`Visual fingerprints unavailable for {count} images; identical file matches remain available.`,imageSearchPartial:`Some assets are not indexed or have changed. Refresh the gallery and try again.`,imageSearchRetry:`Search again`,imageSearchEmpty:`No matches. Try broader matching or a less cropped or obscured reference. Check that the original folder is registered as a source.`,imageSearchExact:`Identical file`,imageSearchScore:`Visual match score {count}`,imageSearchLocate:`Locate folder`,imageSearchCopyPath:`Copy full path`,imageSearchCopied:`Full path copied`,imageSearchView:`View image`,qolBackGallery:`Back to gallery`,qolDiscardTitle:`Discard unsaved source settings?`,qolDiscardBody:`Changes to this source have not been saved. Switching will discard them.`,qolUnsaved:`Unsaved changes`,qolSaved:`No unsaved changes`,qolMoveConfirm:`Move {count} images from “{source}” to “{target}”? Name conflicts are handled by the server without directly overwriting existing files. Check both folders before continuing.`,qolMoveResult:`Moved {moved}; missing {missing}; blocked {blocked}.`,qolMoveBusy:`Moving images. Please do not repeat the action…`,qolPaneScope:`Loaded {loaded} of {total}; select all affects loaded images only.`,qolLoadMore:`Load more`,qolMoveScope:`Panes load independently of gallery filters. Confirm source and destination before moving; selections are kept on failure.`,qolVariantSearch:`Search loaded groups`,qolVariantSort:`Group order`,qolVariantNewest:`Recently updated`,qolVariantLargest:`Image count`,qolVariantScore:`Rule score`,qolVariantCount:`Showing {shown} of {total} loaded groups`,qolVariantSafety:`Groups help you review images; they do not establish that deletion is safe. Similar images, prompts or workflows are not identical files.`,qolNoMatches:`No matches for these conditions. Clear them and try again.`,qolResetSort:`Reset sorting`,qolFilterHint:`Filters apply immediately. Clearing filters keeps your sort order.`,qolFormatDetails:`Format conversion (optional)`,bulkDeleteConfirm:`Move {count} selected images to the gallery trash? You can restore them there.`,bulkDeleteHeavyConfirm:`Move {count} images to the gallery trash? Check your selection first; this may take some time.`,filterReset:`Clear filters`,loraModelWeight:`Model weight`,loraClipWeight:`CLIP weight`,workspaceDesc_gallery:`Browse, filter and organize images`,workspaceDesc_library:`Manage reusable prompt collections`,workspaceDesc_workbench:`Compose artist and style prompts`,workspaceDesc_settings:`Sources, preferences and diagnostics`,densityTitle:`Grid density`,densityShort:`Density`,densityHint:`Larger cards for detail. Smaller cards for browsing.`,densityPresets:`Choose a density preset`,densitySpacious:`Spacious`,densityBalanced:`Balanced`,densityCompact:`Compact`,densityMobileSingle:`Comfortable`,densityMobileDouble:`Compact ×2`,densityEffectiveColumns:`Currently {count} per row`,densityColumns:`{count} per row`,densityColumnsLabel:`Maximum images per row`,densityLarger:`Larger thumbnails`,densitySmaller:`Smaller thumbnails`,densityResponsiveNote:`This is the maximum per row. Narrow windows automatically use fewer columns.`,densityResetDefault:`Reset to default (6 per row)`,tourClose:`Close tour`,tourDensityTitle:`Choose a comfortable grid`,tourDensityBody:`Open Density for Spacious, Balanced or Compact cards, or fine-tune with the slider. Changes apply instantly; smaller screens adapt automatically.`,imageRetry:`Retry loading`,imageRetryShort:`Retry`,imageRetryFull:`Retry image`,imageOpenTab:`Open in new tab`,imageFilmstrip:`Image thumbnail navigation`,imageFilmstripToggle:`Toggle thumbnail navigation`,imageLoading:`Loading full-size image…`,clearSearch:`Clear search`,clearCategory:`Clear category filter`,clearColor:`Clear color filter`,clearDate:`Clear date filter`,clearPinned:`Clear pinned filter`,commonMove:`Move`,commonAdd:`Add`,dual_title:`Dual folder mode`,dual_hint:`Open two folders side by side. Select, right-click, or drag images to organize them.`,dual_left:`Left folder`,dual_right:`Right folder`,dual_selected:`{count} selected`,dual_selectAll:`Select all`,dual_invertSelection:`Invert`,dual_clearSelection:`Clear`,dual_refresh:`Refresh`,dual_moveOther:`Move to other pane`,dual_dropHint:`Drop here to move`,dual_readOnly:`Target is read-only`,dual_empty:`No images in this folder`,dual_loading:`Loading folder...`,dual_moving:`Moving images...`,dual_moved:`Moved`,dual_moveConfirmTitle:`Move selected images`,dual_moveConfirm:`Move {count} image(s) to "{target}"?`,dual_pinConfirm:`Pin {count} selected image(s)?`,dual_unpinConfirm:`Unpin {count} selected image(s)?`,dual_addToBoardConfirm:`Add {count} selected image(s) to "{target}"?`,dual_sameFolder:`Already in this folder`,dual_noMatch:`No matching folders`,dual_loadError:`Failed to load folder images.`,dual_moveError:`Failed to move images.`,dual_openDetail:`Open detail`,dual_openFull:`Open full size`,dual_openWorkflow:`Open workflow`,dual_metadata:`View Metadata`,dual_copyImage:`Copy image`,dual_copyFilename:`Copy filename`,dual_copyPath:`Copy path`,dual_copyPrompt:`Copy positive prompt`,dual_copySuccess:`Copied`,dual_copyImageSuccess:`Image copied`,dual_copyError:`Failed to copy`,dual_promptMissing:`No positive prompt found`,dual_select:`Select`,dual_deselect:`Deselect`,dual_pin:`Pin`,dual_unpin:`Unpin`,dual_addToBoard:`Add to board`,dual_delete:`Delete`,dual_deleteTitle:`Delete selected images`,dual_deleteMessage:`Delete {count} selected image(s)?`,dual_deleteSuccess:`Deleted`,dual_deleteError:`Failed to delete images`,dual_metadataError:`Failed to load metadata`,dual_swapFolders:`Swap left and right folders`,dual_moveToRight:`Move selected to right folder`,dual_moveToLeft:`Move selected to left folder`,dual_refreshBoth:`Refresh both folders`,workspaceSwitch:`Switch workspace`,moreActions:`More actions`,organizeFolders:`Organize folders`,organizeFoldersOpen:`Open folder organizer`,organizeFoldersClose:`Close folder organizer`,metadataPartialWarning:`This summary may be incomplete. Check the original metadata; dynamic prompts are not re-executed.`,variantRuleScore:`Rule score, not probability`,variantScopeNotice:`Analyzes up to 2,000 images in the current sort order. Refresh to continue pending fingerprints. Groups are suggestions only.`,appTitle:`Universal Extractor`,appSubtitle:`ComfyUI gallery and prompt library workspace`,navGallery:`Gallery`,navLibrary:`Library`,navWorkbench:`Workbench`,navSettings:`Settings`,navBrand:`Universal Extractor`,navSearchGalleryPlaceholder:`Search images, categories, or notes...`,navSearchLibraryPlaceholder:`Search library files or entries...`,navRefresh:`Refresh`,updatesTitle:`Updates`,updatesChecking:`Checking for updates...`,updatesAvailable:`New version available`,updatesCurrent:`You are up to date`,updatesCheckNow:`Check for updates`,updatesCheckFailed:`Unable to check for updates`,updatesCurrentVersion:`Current`,updatesLatestVersion:`Latest`,updatesOpenGithub:`View on GitHub`,updatesChangelog:`Changelog`,updatesNoChangelog:`No changelog available.`,navLanguage:`Language`,navLanguageZh:`Chinese`,navLanguageEn:`English`,navLanguageZhShort:`ZH`,navLanguageEnShort:`EN`,navSwitchToChinese:`Switch to Chinese`,navSwitchToEnglish:`Switch to English`,navToggleSidebar:`Toggle sidebar`,sidebarExpand:`Expand sidebar`,sidebarCollapse:`Collapse sidebar`,navToggleSearch:`Toggle search`,sidebarResources:`Resources`,sidebarQuickAccess:`Quick access`,sidebarOutputDirs:`Output folders`,sidebarInputDirs:`Input folders`,sidebarCustomDirs:`Source folders`,sidebarSourceDirs:`Source folders`,sidebarOutputSource:`Output gallery`,sidebarInputSource:`Input gallery`,sidebarFolderViewMode:`Folder view mode`,sidebarInputReadOnly:`Input gallery is read-only`,sidebarSourceReadOnly:`This source is read-only`,sidebarFolderCount:`{count} folders`,sidebarBoardCount:`{count} boards`,sidebarCategoryCount:`{count} categories`,sidebarLibraries:`JSON Libraries`,sidebarCreateLibrary:`Create library`,sidebarCreateLibraryPlaceholder:`artists-neo.json`,sidebarNoLibraries:`No libraries yet`,sidebarListView:`List view`,sidebarTreeView:`Tree view`,sidebarTrash:`Trash`,sidebarCreateFolder:`Create folder`,sidebarMergeFolder:`Merge folder`,sidebarDeleteFolder:`Delete folder`,sidebarExpandAll:`Expand all`,sidebarCollapseAll:`Collapse all`,sidebarBoards:`Boards`,sidebarAllPins:`All pins`,sidebarCreateBoard:`Create board`,sidebarFolderSearch:`Search folders`,sidebarClearFolderSearch:`Clear folder search`,sidebarNoFolderMatches:`No matching folders`,sidebarMoreActions:`More actions`,topStatus:{gallery:`Output gallery`,library:`Library assets`,workbench:`Tool workspace`,settings:`Gallery settings`},galleryBannerTitle:`Output gallery workspace`,galleryBannerText:`Browse the default ComfyUI output folder, drag files in, and manage images with pins, boards, categories, notes, and metadata inspection.`,galleryBannerAction:`Refresh output folder`,gallerySectionTitle:`Latest outputs`,gallerySectionMeta:`Hover a card for a quick prompt panel and click a card for the full metadata inspector.`,galleryEmptyTitle:`No images found`,galleryEmptyText:`Try another search term or generate some fresh outputs in ComfyUI first.`,galleryEmptyNoSourceTitle:`No available image source`,galleryEmptyNoSourceText:`Enable or repair a gallery source in Settings, then refresh.`,galleryEmptySourceTitle:`This source has no images yet`,galleryEmptySourceText:`Generate an image in ComfyUI, or drop an image here to import it into universal_gallery_imports/.`,galleryEmptyFilteredTitle:`No images match these filters`,galleryEmptyFilteredText:`Try a different search or clear the filters; your images have not been removed.`,galleryEmptyErrorTitle:`Couldn't load this gallery`,galleryLoading:`Loading output images...`,galleryInspect:`View details`,galleryPage:`Page {page} / {totalPages}`,galleryPrevious:`Previous`,galleryNext:`Next`,galleryJumpTo:`Go to`,galleryJump:`Jump`,galleryStatsTotal:`Total outputs`,galleryStatsVisible:`Loaded now`,galleryStatsPage:`Current page`,galleryFilterLabel:`Current result`,galleryFilterResult:`{count} images`,galleryFilters:`Filters`,variantToolbar:`Variants`,variantKicker:`Local analysis`,variantTitle:`Variant organizer`,variantSubtitle:`Group duplicate, near-duplicate, same-prompt, same-workflow, and filename-series outputs for quick cleanup.`,variantFilters:`Variant filters`,variantFilterAll:`All`,variantRefresh:`Analyze variants`,variantAnalyzing:`Analyzing variants...`,variantEmptyTitle:`No variant groups yet`,variantEmptyText:`Run analysis on this view, or adjust filters to include related ComfyUI outputs.`,variantBackToGroups:`Back to variant groups`,variantRelated:`Related variants`,variantSelectRest:`Select others`,variantSelectedGroup:`Variant group`,variantImageCount:`{count} images`,variantIndexed:`{count} analyzed`,variantPending:`{count} pending`,variantFailed:`{count} failed`,variantType_exact_duplicate:`Duplicates`,variantType_near_duplicate:`Near matches`,variantType_same_prompt:`Same Prompt`,variantType_same_workflow:`Same Workflow`,variantType_filename_series:`Filename series`,galleryFiltersRealtime:`Live`,galleryLiveRefreshPending:`New images`,galleryLiveRefreshAction:`Refresh this view`,galleryActiveFilters:`Active filters`,galleryFilterNone:`No extra filters`,galleryFilterStickyHint:`Header and footer stay visible on small screens.`,galleryFilterClose:`Close`,galleryFavoriteOnly:`Pins only`,galleryPinnedOnly:`Pins only`,galleryCategory:`Category`,galleryAllCategories:`All categories`,gallerySort:`Sort`,gallerySortBy:`Sort`,gallerySortOrder:`Order`,gallerySortNewest:`Newest`,gallerySortName:`Name`,gallerySortSize:`Size`,gallerySortDesc:`Descending`,gallerySortAsc:`Ascending`,gallerySortNewestHint:`Creation time`,gallerySortNameHint:`Filename`,gallerySortSizeHint:`File size`,gallerySortDescHint:`Large/new first`,gallerySortAscHint:`Small/old first`,galleryDateFrom:`From`,galleryDateTo:`To`,galleryDateRange:`Date range`,galleryDateClear:`Clear dates`,galleryColorFamily:`Color family`,galleryAllColors:`All colors`,galleryColorIndexing:`Color index is catching up`,galleryColorThreshold:`A color must cover at least 25% of the image to match.`,colorFamily_red:`Red`,colorFamily_orange:`Orange`,colorFamily_yellow:`Yellow`,colorFamily_green:`Green`,colorFamily_cyan:`Cyan`,colorFamily_blue:`Blue`,colorFamily_purple:`Purple`,colorFamily_pink:`Pink`,colorFamily_brown:`Brown`,colorFamily_black:`Black`,colorFamily_white:`White`,colorFamily_gray:`Gray`,colorFamily_warm:`Warm`,colorFamily_cool:`Cool`,colorFamily_low_saturation:`Low saturation`,galleryBackToTop:`Back to top`,galleryColumns:`Columns`,galleryMoreCategories:`More`,galleryCategoryBrowse:`Browse categories`,galleryCategoryBrowseHint:`Search and select from every available image category.`,galleryOutputFolder:`Output folder`,galleryOutputImportPath:`Drop import path`,galleryImportTarget:`Import target`,galleryDropTitle:`Drop files here to import`,galleryDropText:`Images go to the selected source's universal_gallery_imports/ folder; JSON goes to the prompt library (data/).`,trashTitle:`Trash`,trashEmptyTitle:`Trash is empty`,trashEmptyText:`Deleted items stay here. If transfer to the system trash fails, they remain here.`,trashRestore:`Restore`,trashDeleteForever:`Move to system trash`,trashItemCount:`{count} items`,trashSelectionHint:`Click to select by default, or drag with the left mouse button to select multiple items.`,trashSelectAll:`Select all`,trashClearSelection:`Clear selection`,trashRestoreSelected:`Restore selected`,trashDeleteSelectedForever:`Move selected to system trash`,trashRestoreSelectedConfirm:`Restore the selected {count} items?`,trashDeleteSelectedConfirm:`Move {count} items to the system trash? Restore or empty them through your operating system afterwards.`,trashRestoreSelectedSuccess:`Restored {count} items`,trashDeleteSelectedSuccess:`Moved {count} items to system trash`,trashBatchPartial:`Completed {completed}; {unfinished} unfinished. Review the reason before retrying.`,trashOperationBusy:`A trash operation is in progress. Wait for it to finish.`,trashKindImage:`Image`,trashKindFolder:`Folder`,trashKindLibrary:`Library`,trashImageCount:`{count} images`,galleryImportSuccess:`Import complete: {count} files`,galleryImportSavedTo:`Images saved to {target}`,galleryImportLibrariesSavedTo:`{count} JSON file(s) saved to prompt library data/`,galleryOpenImportFolder:`Open import folder`,galleryImportSkipped:`Skipped {count} unsupported files`,galleryCategoryPlaceholder:`Category, e.g. character / style / sketch`,galleryNotesPlaceholder:`Notes, source, or organization info`,galleryTitlePlaceholder:`Custom title`,galleryFavorite:`Pin`,galleryUnfavorite:`Unpin`,galleryPin:`Pin`,galleryUnpin:`Unpin`,gallerySelectImage:`Select image`,galleryDeselectImage:`Deselect image`,galleryHoverTitle:`Quick metadata`,galleryHoverPrompt:`Positive prompt`,galleryHoverNegative:`Negative prompt`,galleryHoverArtists:`Artist string`,galleryHoverNoPrompt:`No prompt content found`,libraryBannerTitle:`Library management workspace`,libraryBannerText:"Manage `data/*.json` prompt sources directly in the browser and keep artist or prompt collections tidy.",libraryBannerAction:`Refresh libraries`,librarySelectTitle:`Choose a library file`,librarySelectText:`Pick a JSON file from the left panel, or create a new one to start editing.`,libraryWorkspaceSubtitle:`{name} · {count} entries ready for search, editing, and generation`,libraryEntries:`Entries`,libraryActive:`Active file`,libraryEdit:`Edit JSON`,libraryImport:`Import`,libraryAddFile:`Add library`,libraryExport:`Export`,libraryFormat:`Format JSON`,librarySave:`Save`,libraryCancel:`Cancel`,libraryLoading:`Loading library content...`,libraryDetail:`Library detail`,libraryNoDescription:`No description`,libraryEmptyTitle:`This library is still empty`,libraryEmptyText:`Start with a starter template or add your first entry manually, then refine it through search and generation.`,librarySaveSuccess:`Library saved ({count} entries)`,libraryCreateSuccess:`Library created`,libraryImportSuccess:`Imported into {name} ({count} entries)`,libraryUnsavedChanges:`Unsaved changes`,librarySavedState:`Saved`,libraryUnsavedTitle:`Unsaved changes`,libraryUnsavedConfirm:`Discard unsaved library changes?`,libraryDiscardChanges:`Discard`,libraryLargeEditHint:`Large library: use entry editor`,libraryAddEntry:`Add entry`,libraryStarterTemplate:`Starter template`,libraryEntryEditorHint:`Edit a single library record as JSON to avoid loading the entire file into the browser.`,libraryDeleteEntryConfirm:`Delete this library entry?`,libraryOverviewEntries:`Library size`,libraryOverviewEntriesHint:`Use this to estimate whether JSON mode or single-entry editing is faster.`,libraryOverviewAliases:`Alias coverage`,libraryOverviewAliasesHint:`Entries with other names are easier to find later during search and cleanup.`,libraryOverviewTags:`Tag density`,libraryOverviewTagsHint:`Structured tags make filtering, regrouping, and reuse much easier.`,libraryOverviewModels:`Model guidance`,libraryOverviewModelsHint:`Model hints help beginners know where a prompt library works best.`,libraryGuideTitle:`Beginner workflow`,libraryGuideStepOne:`Start with a clear library type: artist, style, character, or utility snippets.`,libraryGuideStepTwo:"Keep `name` or `title` short, and put the reusable prompt body into `prompt`.",libraryGuideStepThree:"Use `other_names`, `tags`, and `description` so future search can find the right entry fast.",libraryGuideStepFour:`After editing, test the library in the workbench and refine the entries that copy best into your workflow.`,libraryFieldGuideTitle:`Recommended fields`,libraryFieldNameHint:`Use the original tag or the shortest stable lookup name.`,libraryFieldPromptHint:`Store the exact prompt fragment you want to reuse or paste into generation.`,libraryFieldAliasHint:`Add nicknames, alternate spellings, or translated names for easier search.`,libraryFieldTagsHint:`Use small reusable labels like artist, warm-light, portrait, pony, sdxl.`,libraryFieldModelHint:`Record the model family or checkpoint where this entry performs well.`,libraryFieldDescriptionHint:`Leave practical notes: strengths, weak points, or when to avoid using it.`,librarySearchActive:`Searching: {name}`,librarySearchReady:`Search is ready`,librarySearchHint:`Top search matches name, prompt, tags, aliases, model, description, and any other JSON text in the current library.`,librarySearchClear:`Clear search`,libraryTopTags:`Top tags on this page`,libraryTopModels:`Model notes on this page`,libraryNoTagsYet:`No tags in the current results`,libraryNoModelsYet:`No model notes in the current results`,libraryReadyToCopy:`Reusable`,libraryEntryStatus:`Entry {count}`,libraryCopyJson:`Copy JSON`,libraryCopyJsonSuccess:`Entry JSON copied`,libraryCopyPrompt:`Copy prompt`,libraryTemplateArtist:`Artist entry`,libraryTemplateArtistHint:`Best for Danbooru-style artist names and reusable artist prompts.`,libraryTemplateArtistDescription:`Artist entries should keep the original tag name first so generators and search can work together.`,libraryTemplateStyle:`Style entry`,libraryTemplateStyleHint:`Best for long-form visual style phrases or atmosphere presets.`,libraryTemplateStyleDescription:`Style entries are useful for complete prompt fragments that can be copied into a workflow later.`,libraryTemplateCharacter:`Character entry`,libraryTemplateCharacterHint:`Best for original characters, subjects, and repeatable appearance setups.`,libraryTemplateCharacterDescription:`Character entries should put core visual traits in prompt and aliases in other_names.`,libraryTemplatePanelTitle:`Quick templates`,libraryValidationTitle:`Validation issues`,libraryValidationGlobal:`Global`,libraryImportTitle:`Import library JSON`,libraryImportText:`Choose whether to create a new library, replace an existing one, or merge entries into a current file.`,libraryImportModeCreate:`Create new`,libraryImportModeReplace:`Replace current`,libraryImportModeMerge:`Merge into current`,libraryImportFile:`JSON file`,libraryImportFileEmpty:`No file selected`,libraryImportNewName:`New library name`,libraryImportTarget:`Target library`,libraryImportChooseTarget:`Choose a target library`,libraryImportConfirm:`Import JSON`,libraryImportConfirmAsk:`Import "{name}" as a library file?`,libraryImportConfirmTitle:`Confirm library import`,libraryImportCreateConfirm:`Create a new library from "{name}"?`,libraryImportReplaceConfirm:`Replace all entries in "{name}" with the imported JSON?`,libraryImportMergeConfirm:`Merge imported entries into "{name}"?`,librarySaveConfirmTitle:`Save library changes`,librarySaveConfirm:`Overwrite "{name}" with the current editor content?`,librarySaveEntryConfirmTitle:`Save entry`,librarySaveEntryConfirm:`Save this entry to the active library?`,libraryDropTitle:`Drop a JSON library here`,libraryDropText:`We will validate the file first, then ask how you want to add it.`,workbenchTitle:`Workbench`,workbenchSubtitle:`Preset tools for prompt assembly, artist string generation, and future utilities.`,workbenchAppTitle:`Workbench`,workbenchAppSubtitle:`Compose prompts from libraries and organize your selections and inspiration.`,workbenchToolShelf:`Tool shelf`,workbenchToolShelfHint:`Pick the icon for the task you need now. More tools can be added without changing the workspace layout.`,workbenchToolReady:`Ready`,workbenchToolNew:`New`,workbenchStatusStrip:`Workbench status`,workbenchActiveTool:`Active tool`,workbenchLibraryCount:`Libraries`,workbenchQueueCount:`Queued`,workbenchGeneratorMetrics:`Generator summary`,workbenchResultTokens:`Tokens`,workbenchRecipeSection:`Generation recipe`,workbenchOutputSection:`Generated output`,workbenchFormatSection:`Format post-process`,workbenchFormattedTokens:`{count} converted fragments`,toolArtistGenerator:`Artist String Generator`,toolArtistGeneratorDesc:`Generate reusable artist prompt strings from the current JSON library preset.`,toolInspirationHub:`Inspiration Hub`,inspirationHubTitle:`Curated visual reference sites`,inspirationHubDesc:`A compact launcher for high-value gallery and moodboard sources, sorted by recommendation or daily usage frequency.`,inspirationMetricSites:`sites`,inspirationRecommendation:`Recommended`,inspirationFrequency:`Usage`,inspirationSearchPlaceholder:`Search source, type, or best use...`,inspirationSortRecommendation:`Sort by recommendation`,inspirationSortFrequency:`Sort by usage`,inspirationSortName:`Sort by name`,inspirationType_all:`All types`,inspirationType_moodboard:`Moodboard`,inspirationType_portfolio:`Portfolio`,inspirationType_illustration:`Illustration`,inspirationType_product:`Product UI`,inspirationType_ai:`AI image`,inspirationRegionGlobal:`Global`,inspirationRegionChina:`China`,inspirationOpenSite:`Open site`,inspirationPinterestDesc:`Broad moodboard discovery for composition, color, outfit, interior, and visual direction references.`,inspirationPinterestBest:`Fast moodboards and adjacent ideas`,inspirationHuabanDesc:`Chinese visual board community with strong illustration, design, photography, and lifestyle reference boards.`,inspirationHuabanBest:`Chinese-language reference boards`,inspirationBehanceDesc:`Portfolio-grade case studies for branding, layout systems, campaigns, and polished creative presentation.`,inspirationBehanceBest:`Finished design systems and case studies`,inspirationArtStationDesc:`High-quality concept art, character, environment, 3D, game, and entertainment design references.`,inspirationArtStationBest:`Concept art and production-grade style`,inspirationDribbbleDesc:`Compact UI, icon, app screen, motion, and product visual snippets with strong interface taste.`,inspirationDribbbleBest:`UI details and app surface ideas`,inspirationCosmosDesc:`Clean personal collection platform for saving visual references, screenshots, links, and creative trails.`,inspirationCosmosBest:`Personal reference collection`,inspirationArenaDesc:`Research-oriented boards for art direction, design theory, visual culture, and conceptual references.`,inspirationArenaBest:`Deep research and theme boards`,inspirationDesignspirationDesc:`Search-driven design inspiration for typography, color palettes, posters, editorial, and web mood.`,inspirationDesignspirationBest:`Color and typography searches`,inspirationLapaDesc:`Landing page gallery focused on real product pages, hero sections, layout structure, and conversion patterns.`,inspirationLapaBest:`Landing page and web layout ideas`,inspirationLexicaDesc:`AI image search and prompt-adjacent visual browsing for style exploration and quick generation references.`,inspirationLexicaBest:`AI style exploration`,toolComingSoon:`Coming soon`,artistLibrarySource:`Library source`,artistGenerate:`Generate`,artistCount:`Count`,artistMode:`Mode`,artistRandom:`Random`,artistSequential:`Sequential`,artistPrefix:`Prefix`,artistSuffix:`Suffix`,artistSeparator:`Separator`,artistSeed:`Seed`,artistResult:`Generated result`,artistCopyResult:`Copy result`,artistNoLibraries:`No suitable library found`,workbenchMode:`Mode`,workbenchModePure:`Pure`,workbenchModeStandard:`Standard`,workbenchModeCreative:`Creative`,workbenchModeNai:`NAI`,workbenchPostFilter:`Post filter`,workbenchPostThreshold:`Post threshold`,workbenchFilterNone:`No filter`,workbenchFilterGreater:`Greater than`,workbenchFilterLess:`Less than`,workbenchWeightMin:`Weight min`,workbenchWeightMax:`Weight max`,workbenchBracketStyle:`Bracket style`,workbenchNestLevels:`Nest levels`,workbenchCustomFormat:`Custom format`,workbenchFormatString:`Format string`,workbenchFormatTool:`Format conversion`,workbenchFormatToolAnima:`Anima format`,workbenchFormatToolCustom:`Custom format`,workbenchFormatToolTemplate:`Template`,workbenchFormatToolApply:`Apply conversion`,workbenchFormatToolResult:`Converted result`,workbenchFormatToolAnimaHint:`Converts tags like name_(group) into @name \\(group\\) for Anima post-processing.`,workbenchFormatApplied:`Format conversion applied`,workbenchPreselected:`Preselected artists`,workbenchPreselectedEmpty:`Add artists from the pool on the right, and generation will prioritize them first.`,workbenchArtistPool:`Artist pool`,workbenchArtistPoolHint:`Search artists by name or alias, then add them into the preselected queue.`,workbenchGenerateSuccess:`Artist string generated`,workbenchCopyError:`Failed to copy generated result`,workbenchEmptyHint:`Generate a result to preview selected entries and the final assembled string here.`,workbenchPreviewHint:`Preview a few source entries to confirm you are generating from the correct library.`,commonLoading:`Loading...`,commonEnabled:`Enabled`,commonDisabled:`Disabled`,viewMode:`View mode`,viewGrid:`Grid`,viewList:`List`,bulkActions:`Batch actions`,bulkSelectMode:`Selection mode`,bulkSelectionHint:`Current page only. Turn on selection mode to click-select or drag a box with the left mouse button.`,bulkSelected:`{count} selected`,bulkFavorite:`Pin`,bulkUnfavorite:`Unpin`,bulkPin:`Pin selected`,bulkUnpin:`Unpin selected`,bulkAddToBoard:`Add to board`,bulkRemoveFromBoard:`Remove from board`,bulkSetCategory:`Set category`,bulkMoveTo:`Move to folder`,bulkPinConfirm:`Pin {count} selected image(s)?`,bulkUnpinConfirm:`Unpin {count} selected image(s)?`,bulkAddToBoardConfirm:`Add {count} selected image(s) to "{target}"?`,bulkRemoveFromBoardConfirm:`Remove {count} selected image(s) from "{target}"?`,bulkSetCategoryConfirm:`Set category "{target}" on {count} selected image(s)?`,bulkMoveConfirm:`Move {count} selected image(s) to "{target}"?`,bulkRenameConfirm:`Rename {count} selected image(s) using "{target}"?`,bulkRenameTemplatePlaceholder:`rename rule, e.g. set-{page}-{n} or {name}-v2`,bulkRenameStart:`Start`,bulkRenamePadding:`Pad`,bulkRenameApply:`Rename`,bulkRenameRuleTitle:`Rename rule`,bulkRenameRuleHint:`Use {n} for sequence number, {name} for original filename without extension, and {page} for the current page number. The original extension is kept automatically.`,bulkRenameSuccess:`Renamed {count} images`,bulkRenameError:`Failed to batch rename images`,bulkDelete:`Delete selected`,imageDelete:`Delete image`,bulkClear:`Clear`,bulkSelectVisible:`Select visible`,imageRenameError:`Failed to rename image`,imageDeleteError:`Failed to delete image`,inspectorFolderTitle:`Current view`,inspectorFolderHint:`When nothing is selected, this panel shows the current folder, filtered results, and quick actions.`,inspectorVisibleCount:`Current page`,inspectorSingleHint:`Selected images can be pinned, moved, categorized, renamed, added to boards, or deleted here.`,inspectorFilename:`Filename`,inspectorCategory:`Category`,inspectorSource:`Source`,inspectorSize:`Size`,inspectorCreated:`Created`,inspectorEmptyValue:`Not set`,modalClose:`Close detail`,modalTitle:`Image detail`,modalOpenFull:`Open full size`,modalOpenWorkflow:`Open workflow in ComfyUI`,modalExpandImage:`Expand image`,modalZoomIn:`Zoom in`,modalZoomOut:`Zoom out`,modalFitImage:`Fit image`,modalToggleInspector:`Toggle inspector`,modalGestureHint:`Wheel to zoom, drag to pan, double-click to reset`,modalPromptHits:`Artist hits`,modalMetadataBlocks:`Metadata blocks`,modalLoading:`Reading embedded workflow metadata...`,modalPromptSection:`Matched library prompts`,modalMetadataSection:`Embedded blocks`,modalRawMetadata:`Raw metadata`,modalNoMetadata:`No prompt or workflow metadata was detected in this image.`,metadataView:`View metadata`,metadataPromptSummary:`Prompt summary`,metadataPositivePrompt:`Positive prompt`,metadataNegativePrompt:`Negative prompt`,metadataCopyPositive:`Copy positive prompt`,metadataCopyPositiveSuccess:`Positive prompt copied`,metadataCopyRaw:`Copy raw metadata`,metadataCopyRawSuccess:`Raw metadata copied`,metadataNoPositivePrompt:`No positive prompt found`,metadataNoNegativePrompt:`No negative prompt found`,metadataLoadError:`Failed to read image metadata`,recipeTitle:`Generation Recipe`,recipeCheckpoint:`Base Checkpoint`,recipeLoras:`LoRA Stack`,recipeParams:`Parameters`,recipeSeed:`Seed`,recipeSteps:`Steps`,recipeCfg:`CFG Scale`,recipeSampler:`Sampler`,recipeScheduler:`Scheduler`,recipeSize:`Dimensions`,recipeDenoise:`Denoise`,recipeCopyPositive:`Copy Positive Prompt`,recipeCopyNegative:`Copy Negative Prompt`,recipeCopySeed:`Copy Seed`,recipeCopyFull:`Copy Full Recipe`,recipeCopiedSuccess:`Copied to clipboard`,recipeApplyLoraStack:`Apply LoRA Stack`,recipeSendWorkflow:`Send Workflow to ComfyUI`,modalEditSection:`Image management`,modalCategory:`Category`,modalTitleField:`Title`,modalFilenameField:`Filename`,modalNotesField:`Notes`,modalSaveState:`Save image info`,modalSaveHint:`Save the title, category, notes and pin state here. Rename the filename separately.`,modalFilenameRenameHint:`The filename has not been saved. Choose Rename file; Save image info does not rename it.`,modalUnsavedStateTitle:`Unsaved image edits`,modalUnsavedStateText:`The image info has unsaved changes. Save and continue, discard them, or cancel?`,modalUnsavedFilenameText:`The filename will become “{target}”; there may be other edits. Save and continue will save the info and rename the file. You can also discard or cancel.`,modalUnsavedLoadingText:`Image info is still loading and cannot be saved yet. Wait and try again, or discard the draft.`,modalSaveAndContinue:`Save and continue`,modalWaitForMetadata:`Image info is still loading. Please wait before saving.`,modalFilenameRequired:`Filename cannot be empty.`,modalDiscardChanges:`Discard changes`,modalUnsavedStateBadge:`Unsaved`,modalSavedStateBadge:`Saved`,modalRenameFile:`Rename file`,modalDeleteFile:`Delete file`,commonEntries:`{count} entries`,commonDelete:`Delete`,commonConfirm:`Confirm`,commonCreate:`Create`,commonSend:`Send`,commonNoneSelected:`None`,commonCopy:`Copy`,notificationDismiss:`Dismiss notification`,operationRefresh:`Refreshing...`,operationRefreshSuccess:`Gallery refreshed`,galleryRefreshInterrupted:`Refresh interrupted by a view change`,operationCreateLibrary:`Creating library...`,operationSaveLibrary:`Saving library...`,operationImportLibrary:`Importing library...`,operationDeleteLibrary:`Deleting library...`,operationCreateBoard:`Creating board...`,operationDeleteBoard:`Deleting board...`,operationAddToBoard:`Adding to board...`,operationRemoveFromBoard:`Removing from board...`,operationUpdateImages:`Updating images...`,operationUpdateImagesSuccess:`Images updated`,operationMoveImages:`Moving images...`,operationMoveImagesSuccess:`Images moved`,operationMoveUnchanged:`Already in the target folder: {count} (not moved).`,operationUnaccounted:`Outcome unconfirmed for {count}; selection kept.`,operationUnprocessedPaths:`Not processed: {target}`,operationViewDetails:`View details`,operationRenameImages:`Renaming images...`,operationDeleteImages:`Deleting images...`,operationDeleteImagesResult:`Moved {count} to trash; {missing} not processed.`,operationCreateFolder:`Creating folder...`,operationMergeFolder:`Merging folder...`,operationMoveFolder:`Moving folder...`,operationRenameFolder:`Renaming folder...`,operationDeleteFolder:`Deleting folder...`,operationImportFiles:`Importing files...`,operationRenameImage:`Renaming image...`,operationDeleteImage:`Deleting image...`,operationRestoreTrash:`Restoring from trash...`,operationPurgeTrash:`Moving to system trash...`,operationSendWorkflow:`Sending workflow...`,operationApplyLoraStack:`Applying LoRA stack...`,operationRunDiagnostics:`Running diagnostics...`,operationTestPath:`Testing path...`,operationSaveSource:`Saving source...`,operationDeleteSource:`Deleting source...`,operationGenerateArtists:`Generating artist string...`,contextCopyImage:`Copy image`,contextCopyFilename:`Copy filename`,contextCopyPath:`Copy path`,contextCopyImageSuccess:`Image copied to clipboard`,contextCopyImageLinkSuccess:`Image link copied to clipboard`,contextCopyFilenameSuccess:`Filename copied to clipboard`,contextCopyPathSuccess:`Path copied to clipboard`,contextCopyError:`Failed to copy`,contextCopyImageError:`Failed to copy image`,imageDeleteConfirm:`Delete image "{name}"?`,imageDeleteMissing:`Image was not deleted: the file is missing or its source is read-only.`,imageRenameConfirm:`Rename "{name}" to "{target}"?`,imageRenameWithStateConfirm:`Save the current image info edits, then rename "{name}" to "{target}"?`,imageStateSaveConfirm:`Save image info changes for "{name}"?`,imagePinConfirm:`Pin "{name}"?`,imageUnpinConfirm:`Unpin "{name}"?`,confirmDeleteLibrary:`Delete "{name}"?`,galleryImportConfirmTitle:`Import files`,galleryImportConfirm:`Import {count} file(s)? Images go to {target}; JSON prompt libraries go to data/*.json.`,folderCreatePrompt:`Enter a new output folder path`,folderDeleteConfirm:`Delete folder "{name}" and all files inside it?`,folderMergePrompt:`Enter the target folder path to merge into`,folderCreateTitle:`Create output folder`,folderCreateText:`Enter a folder path relative to the ComfyUI output directory.`,folderMergeTitle:`Merge output folder`,folderMergeText:`Move the selected folder into another output folder.`,folderMergeConfirm:`Merge "{name}" into "{target}"? Files may be moved into the target folder.`,folderMoveTitle:`Move folder`,folderMoveConfirm:`Move "{name}" into "{target}"?`,folderRenameTitle:`Rename output folder`,folderRenameText:`Change the folder path. Enter a new sibling name or another relative output path.`,folderRenameConfirm:`Rename or move "{name}" to "{target}"?`,folderRenamePrompt:`Enter the new output folder path`,folderPathPlaceholder:`folder/subfolder`,folderCreateSuccess:`Folder created`,folderDeleteSuccess:`Folder deleted`,folderMergeSuccess:`Folder merged`,folderMoveSuccess:`Folder moved`,folderRenameSuccess:`Folder renamed`,folderCreateError:`Failed to create folder`,folderDeleteError:`Failed to delete folder`,folderMergeError:`Failed to merge folder`,folderMoveError:`Failed to move folder`,folderRenameError:`Failed to rename folder`,folderMove:`Move`,folderRename:`Rename`,folderPin:`Pin folder`,folderUnpin:`Unpin folder`,folderSortByName:`Sort by name`,folderSortByModified:`Sort by modified time`,folderSortAsc:`Sort by name ascending`,folderSortDesc:`Sort by name descending`,boardCreateTitle:`Create board`,boardCreateText:`Boards collect pinned images without moving the original files.`,boardCreateConfirm:`Create board "{name}"?`,boardNameLabel:`Board name`,boardNamePlaceholder:`Character references / lighting tests`,boardCreateSuccess:`Board created`,boardCreateError:`Failed to create board`,boardAddToTitle:`Add to board`,boardAddToText:`Choose a board for {count} selected images.`,boardAddToAction:`Add to board`,boardAddSuccess:`Added {count} images to board`,boardEmptyText:`No boards yet`,boardCreateInline:`Create a new board instead`,boardDeleteTitle:`Delete board`,boardDeleteConfirm:`Delete board "{name}"? Images will stay in the output folder.`,boardDeleteSuccess:`Board deleted`,boardShareTitle:`Share board`,boardShareText:`A 5 by 4 preview image is ready.`,boardShareSubtitle:`{count} pinned images`,boardShareDownload:`Download share image`,boardShareError:`Failed to render share image`,settingsKicker:`Directory sources`,settingsTitle:`Settings`,settingsSubtitle:`Manage image directories, browsing preferences, and source diagnostics.`,settingsActiveSources:`active sources`,settingsIndexedImages:`indexed images`,settingsSourcesTitle:`Image directories`,settingsSourcesHint:`Enable multiple folders, even across drives, and choose where imports should land.`,settingsAddSource:`Add custom source`,settingsNewSource:`New custom source`,settingsDefaultLockedHint:`Default ComfyUI sources keep their name and path, but can still be enabled or disabled.`,settingsCustomHint:`Custom folders can point to any local or mounted directory you want merged into the gallery.`,settingsSourceName:`Source name`,settingsSourceNamePlaceholder:`Reference drive / archive folder`,settingsSourcePath:`Directory path`,settingsSourcePathPlaceholder:`D:\\images\\reference-library`,settingsSourceEnabled:`Enabled`,settingsSourceWritable:`Allow file operations`,settingsSourceRecursive:`Scan subfolders`,settingsSourceImportTarget:`Import target`,settingsSourceTest:`Test path`,settingsSourceSave:`Save source`,settingsSourceDelete:`Delete source`,settingsSourceScan:`Rescan sources`,settingsPreferencesTitle:`Interface preferences`,settingsPreferencesHint:`These switches are stored in this browser and control the gallery's default interaction behavior.`,settingsOnboardingTitle:`New user tour`,settingsOnboardingHint:`Replay the guided walkthrough for the gallery, libraries, workbench, and source settings.`,settingsOnboardingRestart:`Restart onboarding tour`,settingsPrefDefaultSelection:`Start in selection mode`,settingsPrefDefaultSelectionHint:`When off, clicking an image opens detail by default; turn selection mode on only when you need box selection.`,settingsPrefConfirmWorkflow:`Confirm before sending workflow`,settingsPrefConfirmWorkflowHint:`When off, Open workflow in ComfyUI sends directly to the already-open ComfyUI page.`,settingsPrefCollapseSidebar:`Collapse sidebar on launch`,settingsPrefCollapseSidebarHint:`Start with the resource sidebar collapsed on desktop, useful for smaller screens or focused browsing.`,settingsPrefImagePrefetch:`Preload nearby images`,settingsPrefImagePrefetchHint:`Preloads nearby thumbnails while scrolling; turn off to reduce background network and disk reads.`,settingsPrefLiveRefresh:`Keep gallery live`,settingsPrefLiveRefreshHint:`Sync after each workflow; check for missed changes every 15 seconds while visible. Preserve browsing positions. Turn off for manual refresh only.`,settingsPrefFolderTree:`Use folder tree by default`,settingsPrefFolderTreeHint:`When off, output folders default to a flat list, useful for shallow folder sets.`,tourWelcomeTitle:`Welcome to Universal Gallery`,tourWelcomeBody:`Take a minute to discover the essentials. Each step highlights its control. Skip anytime and restart from Settings.`,tourTopbarTitle:`Move between workspaces`,tourTopbarBody:`Click the workspace name at the top left to switch between Gallery, Library, Workbench and Settings. Each option includes a short description.`,tourSidebarTitle:`Browse sources and folders`,tourSidebarBody:`Folders are organized by source. Select a folder to browse it. Its More menu contains tree/list views, sorting and folder tools.`,tourGalleryTitle:`Browse and filter images`,tourGalleryBody:`Search filenames, categories or notes here. Filters narrow results by date, color or pinned status. Press / to focus search.`,tourSelectionTitle:`Select and batch edit`,tourSelectionBody:`Turn on selection mode to click-select, Shift-select, or drag a box. Box selection keeps working while the page scrolls.`,tourDetailTitle:`Inspect images and send workflows`,tourDetailBody:`Click an image for its full-size view and metadata. Use arrow keys to navigate. Double-click the image to zoom, or empty space to close. Workflow actions are in the detail toolbar.`,tourLibraryTitle:`Manage prompt libraries`,tourLibraryBody:`Search, import, export and edit JSON prompt collections. Use entries in the extractor node or combine them in Workbench.`,tourWorkbenchTitle:`Build reusable prompt strings`,tourWorkbenchBody:`Choose artists and tags from a library, adjust the format and copy the resulting prompt. Import a collection in Library first if none is loaded.`,tourSettingsTitle:`Tune sources and preferences`,tourSettingsBody:`Manage sources and preferences and check diagnostics in Settings. Use the restart tutorial control here to see this tour again.`,tourDoneTitle:`You are ready to work`,tourDoneBody:`You are ready to explore. This tour will not automatically reopen. Find it again in Settings whenever you need it.`,tourSkip:`Skip`,tourPrevious:`Previous step`,tourNext:`Next`,tourFinish:`Finish`,tourStepProgress:`Step {page} of {totalPages}`,tourTargetMissing:`There is no visible target here yet, possibly because no images or library are loaded. You can continue to the next step.`,settingsPathOk:`Path is ready, {count} images found at the top level.`,settingsPathMissing:`Path does not exist or is not a folder.`,settingsPathError:`Failed to test path`,settingsSourceSaved:`Source saved`,settingsSourceSaveError:`Failed to save source`,settingsSourceSaveConfirm:`Save changes to source "{name}"? This can change what folders are writable or indexed.`,settingsSourceCreateConfirm:`Add "{name}" as a gallery source?`,settingsSourceDeleted:`Source deleted`,settingsSourceDeleteError:`Failed to delete source`,settingsSourceDeleteConfirm:`Remove "{name}" from the gallery source list?`,settingsDiagnostics:`Source diagnostics`,settingsDiagnosticsHint:`Check reachability, permissions, overlap, image counts, and available disk space.`,settingsDiagnosticsRun:`Run diagnostics`,settingsDiagnosticsDone:`Diagnostics complete`,settingsDiagnosticsError:`Failed to run diagnostics`,settingsDiagnosticImages:`{count} images`,settingsDiagnosticFolders:`{count} folders`,settingsDiagnosticOverlap:`{count} overlaps`,settingsStatus_ok:`OK`,settingsStatus_missing:`Missing`,settingsStatus_error:`Error`,settingsStatus_unreadable:`Unreadable`,settingsStatus_write_blocked:`Write blocked`,settingsStatus_overlap:`Overlap`,workflowSendSuccess:`Workflow sent to ComfyUI`,workflowSendConfirm:`Send the workflow from "{name}" to ComfyUI?`,loraStackApply:`Apply LoRA stack to current workflow`,loraStackReading:`Reading LoRA stack from image…`,loraStackApplyConfirm:`Apply {count} LoRAs from "{name}" to the current workflow? Only the selected LoRA Manager node is changed, or the first compatible node if none is selected. Append keeps other entries and updates names that match; Replace removes the target node's old stack.`,loraStackClipWarning:`{count} LoRAs have a different CLIP strength. The rows will be collapsed but the values kept; changing model strength while collapsed will sync CLIP in LoRA Manager.`,loraStackAppend:`Append to stack`,loraStackReplace:`Replace stack`,loraStackAppendedSuccess:`Merged {count} LoRAs into "{name}"`,loraStackReplacedSuccess:`Replaced "{name}" with {count} LoRAs`,loraStackAppendDetail:`{added} new, {updated} updated; all other entries unchanged.`,loraStackReplaceDetail:`{removed} old entries removed; {updated} names updated.`,loraStackApplyNoStack:`No usable ComfyUI-Lora-Manager LoRA stack was detected in this image.`,loraStackApplyNoComfyPage:`No ComfyUI page is ready to receive this request. Keep the main ComfyUI page open and refresh it once.`,loraStackBridgeOutdated:`The ComfyUI page is still running an older plugin script. Sending was blocked because its Append button could delete existing LoRAs. Restart ComfyUI, then hard-refresh the main page and gallery before retrying.`,loraStackApplyNoTargetNode:`No writable LoRA Manager node was found in the current workflow.`,loraStackApplySuccess:`LoRA stack applied to the current workflow`,trashRestoreConfirm:`Restore this trash item to its original location?`,workflowNoComfyPage:`No refreshed ComfyUI page is ready to receive workflows. Refresh the existing ComfyUI page and try again.`,errorOpenLibrary:`Failed to open library`,errorCreateLibrary:`Failed to create library`,errorDeleteLibrary:`Failed to delete library`,errorSaveLibrary:`Failed to save library`,errorImportLibrary:`Failed to import library`,errorNoLibrarySelected:`No library selected`,errorLibraryNameRequired:`Library name is required`,imageStateSaveError:`Failed to save image info`,errorJsonInvalid:`JSON format error`,jobRetry:`Retry`,jobRefresh:`Refresh library`,jobFingerprints:`Analyze images`,jobRunning:`Running`,jobFailed:`Failed`,jobCancelled:`Cancelled`,jobCompleted:`Completed`}},C=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),w=o(((e,t)=>{t.exports=C()})),T=w(),E=(0,d.createContext)(null),D=`universal-extractor-locale`,O=(e,t)=>t?e.replace(/\{(\w+)\}/g,(e,n)=>{let r=t[n];return r===void 0?``:String(r)}):e,k=({children:e})=>{let[t,n]=(0,d.useState)(()=>{try{let e=window.localStorage.getItem(D);return e===`en`||e===`zh-CN`?e:`zh-CN`}catch{return`zh-CN`}});(0,d.useEffect)(()=>{document.documentElement.lang=t;try{window.localStorage.setItem(D,t)}catch{}},[t]),(0,d.useEffect)(()=>{let e=e=>{e.key===D&&(e.newValue===`en`||e.newValue===`zh-CN`)&&n(e.newValue)};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[]);let r=(0,d.useMemo)(()=>({locale:t,setLocale:n,t:(e,n)=>{let r=S[t][e]??S.en[e];return r?typeof r==`string`?O(r,n):r[n?.tab??`gallery`]??e:e}}),[t]);return(0,T.jsx)(E.Provider,{value:r,children:e})},A=()=>{let e=(0,d.useContext)(E);if(!e)throw Error(`useI18n must be used within I18nProvider`);return e};export{u as a,x as i,A as n,o,w as r,c as s,k as t}; \ No newline at end of file diff --git a/gallery_ui/dist/assets/ImageDetailModal-Bv5UXO0m.js b/gallery_ui/dist/assets/ImageDetailModal-Bv5UXO0m.js new file mode 100644 index 0000000..face467 --- /dev/null +++ b/gallery_ui/dist/assets/ImageDetailModal-Bv5UXO0m.js @@ -0,0 +1,3 @@ +import{a as e,i as t,n,r,s as i}from"./I18nProvider-DEfiLn3N.js";import{t as a}from"./boxes-GTo8RUgH.js";import{t as o}from"./copy-CoBcvjUE.js";import{t as s}from"./save-DQG0Zsqx.js";import{t as ee}from"./sparkles-elJjV352.js";import{C as te,D as ne,K as re,L as ie,M as ae,P as oe,Q as se,R as ce,T as le,U as ue,Z as de,_ as fe,at as pe,b as me,ct as he,d as ge,dt as _e,et as ve,f as ye,i as c,it as be,nt as xe,t as Se,tt as Ce,u as we,x as Te,z as Ee}from"./index-CKow1Wte.js";var De=t(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),Oe=t(`expand`,[[`path`,{d:`m15 15 6 6`,key:`1s409w`}],[`path`,{d:`m15 9 6-6`,key:`ko1vev`}],[`path`,{d:`M21 16v5h-5`,key:`1ck2sf`}],[`path`,{d:`M21 8V3h-5`,key:`1qoq8a`}],[`path`,{d:`M3 16v5h5`,key:`1t08am`}],[`path`,{d:`m3 21 6-6`,key:`wwnumi`}],[`path`,{d:`M3 8V3h5`,key:`1ln10m`}],[`path`,{d:`M9 9 3 3`,key:`v551iv`}]]),ke=t(`film`,[[`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`}]]),Ae=t(`shrink`,[[`path`,{d:`m15 15 6 6m-6-6v4.8m0-4.8h4.8`,key:`17vawe`}],[`path`,{d:`M9 19.8V15m0 0H4.2M9 15l-6 6`,key:`chjx8e`}],[`path`,{d:`M15 4.2V9m0 0h4.8M15 9l6-6`,key:`lav6yq`}],[`path`,{d:`M9 4.2V9m0 0H4.2M9 9 3 3`,key:`1pxi2q`}]]),je=t(`sliders-vertical`,[[`path`,{d:`M10 8h4`,key:`1sr2af`}],[`path`,{d:`M12 21v-9`,key:`17s77i`}],[`path`,{d:`M12 8V3`,key:`13r4qs`}],[`path`,{d:`M17 16h4`,key:`h1uq16`}],[`path`,{d:`M19 12V3`,key:`o1uvq1`}],[`path`,{d:`M19 21v-5`,key:`qua636`}],[`path`,{d:`M3 14h4`,key:`bcjad9`}],[`path`,{d:`M5 10V3`,key:`cb8scm`}],[`path`,{d:`M5 21v-7`,key:`1w1uti`}]]),l=i(e(),1),Me=_e(),u=r(),Ne=e=>({title:e.title||``,category:e.category||``,notes:e.notes||``,pinned:e.pinned||e.favorite||!1,filename:e.filename||``}),Pe=e=>{let t=Ne(e);return{imagePath:e.relative_path,draft:t,saved:t,touched:{}}},d=1,Fe=5,Ie=(e,t,n)=>Math.min(n,Math.max(t,e)),f=(e,t,n)=>{if(t<=d)return 0;let r=(t-1)*n/2+48;return Ie(e,-r,r)},Le=e=>({key:e.relative_path,src:e.original_url||e.url,bg:e.thumb_url||e.original_url||e.url,alt:e.title||e.filename}),Re=({image:e,onClose:t,onSaveState:r,onRenameFile:i,onDeleteFile:_e,onOpenWorkflow:Ne,onApplyLoraStack:Re,navigation:p,onNavigate:ze,onRegisterLeave:m})=>{let{t:h,locale:Be}=n(),{confirm:Ve,choose:He}=fe(),{pushToast:g}=ye(),[_,Ue]=(0,l.useState)(null),[We,Ge]=(0,l.useState)([]),[v,Ke]=(0,l.useState)(!0),[qe,Je]=(0,l.useState)(null),[Ye,Xe]=(0,l.useState)(()=>Pe(e)),{title:y,category:b,notes:x,pinned:S,filename:C}=Ye.draft,w=Ye.saved,[Ze,Qe]=(0,l.useState)(!1),[T,$e]=(0,l.useState)(!1),[E,et]=(0,l.useState)(!1),[D,tt]=(0,l.useState)(!1),[nt,rt]=(0,l.useState)(!1),[O,it]=(0,l.useState)(null),[at,k]=(0,l.useState)(null),A=(0,l.useRef)(!1),ot=(0,l.useRef)(async()=>!1),j=nt||E||D,M=(e,t)=>{A.current||j||Xe(n=>({...n,draft:{...n.draft,[e]:t},touched:{...n.touched,[e]:!0}}))},[N,st]=(0,l.useState)(d),[P,F]=(0,l.useState)({x:0,y:0}),[ct,I]=(0,l.useState)(!1),lt=(0,l.useRef)(null),L=(0,l.useRef)(null),ut=(0,l.useRef)(``),[R,dt]=(0,l.useState)(()=>({...Le(e),src:e.thumb_url||e.original_url||e.url})),[z,ft]=(0,l.useState)(!0),[pt,B]=(0,l.useState)(!1);(0,l.useEffect)(()=>{if(!pt)return;let e=window.setTimeout(()=>B(!1),180);return()=>window.clearTimeout(e)},[pt]);let mt=(0,l.useRef)(null),ht=(0,l.useRef)(!1),[V,gt]=(0,l.useState)(!0),[_t,H]=(0,l.useState)(!1),[vt,yt]=(0,l.useState)(0),bt=(0,l.useRef)(null);(0,l.useEffect)(()=>{let t=new AbortController,n={key:e.relative_path,src:e.original_url||e.url,bg:e.thumb_url||e.url,alt:e.title||e.filename};return vt&&(n.src+=`${n.src.includes(`?`)?`&`:`?`}_retry=${vt}`),ft(!0),H(!1),me(n.src,t.signal).then(e=>{t.signal.aborted||(e&&dt(n),H(!e),ft(!1))}),()=>t.abort()},[e.relative_path,e.original_url,e.url,e.thumb_url,e.title,e.filename,vt]),(0,l.useEffect)(()=>{V&&bt.current&&bt.current.scrollIntoView({behavior:Te(),block:`nearest`,inline:`center`})},[p?.currentIndex,V]),(0,l.useEffect)(()=>{let e=new AbortController,t=p?.items??[],n=p?.currentIndex??-1;return[t[n-1],t[n+1]].filter(e=>!!e).forEach(t=>{me(Le(t).src,e.signal)}),()=>e.abort()},[p]),(0,l.useEffect)(()=>{let t=!1;return(async()=>{Ke(!0),Je(null),Ue(null);try{let n=await te.getImageMetadata(e.relative_path);if(t)return;Ue(n);let r={title:n.state.title??e.title??``,category:n.state.category??e.category??``,notes:n.state.notes??e.notes??``,pinned:n.state.pinned??n.state.favorite??e.pinned??e.favorite??!1,filename:n.filename||e.filename||``};Xe(t=>t.imagePath===e.relative_path?{...t,saved:r,draft:{title:t.touched.title?t.draft.title:r.title,category:t.touched.category?t.draft.category:r.category,notes:t.touched.notes?t.draft.notes:r.notes,pinned:t.touched.pinned?t.draft.pinned:r.pinned,filename:t.touched.filename?t.draft.filename:r.filename}}:t)}catch(e){t||Je(e instanceof Error?e.message:h(`modalLoading`))}finally{t||Ke(!1)}})(),()=>{t=!0}},[e,h]),(0,l.useEffect)(()=>{let t=!1;return te.listVariantGroups({subfolder:e.subfolder,limit:80}).then(n=>{if(t)return;let r=n.groups.filter(t=>t.images_preview.some(t=>t.relative_path===e.relative_path));Ge(r.slice(0,4))}).catch(()=>{t||(Ge([]),te.prewarmFingerprints({relativePaths:[e.relative_path],limit:1}).catch(()=>void 0))}),()=>{t=!0}},[e.relative_path,e.subfolder]),(0,l.useEffect)(()=>(ut.current=document.body.style.overflow,document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=ut.current}),[]),(0,l.useEffect)(()=>{let e=document.activeElement instanceof HTMLElement?document.activeElement:null,t=document.getElementById(`root`),n=t?.inert??!1;t&&(t.inert=!0);let r=mt.current;r?.querySelector(`.ue-lightbox-close`)?.focus({preventScroll:!0});let i=()=>Array.from(r?.querySelectorAll(`button:not(:disabled), a[href], input:not(:disabled), textarea:not(:disabled), select:not(:disabled), [tabindex]:not([tabindex="-1"])`)??[]).filter(e=>!e.closest(`[inert], [hidden], [aria-hidden='true']`)),a=()=>!!document.querySelector(`.ue-confirm-backdrop, .ue-onboarding-layer`),o=e=>{if(e.key!==`Tab`||a())return;let t=i();if(!t.length){e.preventDefault(),r?.focus({preventScroll:!0});return}let n=t[0],o=t[t.length-1];!r?.contains(document.activeElement)||document.activeElement===r?(e.preventDefault(),(e.shiftKey?o:n).focus()):e.shiftKey&&document.activeElement===n?(e.preventDefault(),o.focus()):!e.shiftKey&&document.activeElement===o&&(e.preventDefault(),n.focus())},s=e=>{!a()&&!r?.contains(e.target)&&r?.querySelector(`.ue-lightbox-close`)?.focus({preventScroll:!0})};return document.addEventListener(`keydown`,o,!0),document.addEventListener(`focusin`,s),()=>{document.removeEventListener(`keydown`,o,!0),document.removeEventListener(`focusin`,s),t&&(t.inert=n),e?.isConnected&&!e.closest(`[inert]`)&&e.focus({preventScroll:!0})}},[]);let xt=_?.metadata?Object.keys(_.metadata):[],St=!!(_?.workflow||_?.metadata&&typeof _.metadata==`object`&&`prompt`in _.metadata),U=p?.currentIndex??0,W=p?.items.length??1,Ct=N>1.01,wt=Math.round(N*100),Tt=h(S?`galleryUnpin`:`galleryPin`),G=e=>({title:e,"data-tooltip":e}),Et=[we(e.size),ge(e.created_at,Be)],K=y!==w.title||b!==w.category||x!==w.notes||S!==w.pinned,q=C!==w.filename,Dt=K||q,Ot=()=>{L.current=null,F({x:0,y:0}),st(d),Qe(!1),I(!1)},J=(e,t,n)=>{let r=lt.current,i=Ie(e,d,Fe);if(!r||t===void 0||n===void 0||N===d&&i===d){if(i===d){Ot();return}st(i),F({x:0,y:0}),Qe(i>d);return}let a=r.getBoundingClientRect(),o=t-a.left-a.width/2,s=n-a.top-a.height/2,ee=i/N;F(e=>({x:i===d?0:f(e.x+(o-e.x)*(1-ee),i,a.width),y:i===d?0:f(e.y+(s-e.y)*(1-ee),i,a.height)})),st(i),Qe(i>d),i===d&&I(!1)},kt=e=>{if(e.preventDefault(),z)return;B(!1);let t=e.deltaY<0?1.16:.86,n=Number((N*t).toFixed(3));J(n,e.clientX,e.clientY)},At=e=>{e.button===0&&Ct&&(e.preventDefault(),B(!1),L.current={pointerId:e.pointerId,startX:e.clientX,startY:e.clientY,originX:P.x,originY:P.y},e.currentTarget.setPointerCapture(e.pointerId),I(!0))},jt=e=>{let t=L.current,n=lt.current;if(!t||!n||t.pointerId!==e.pointerId)return;let r=n.getBoundingClientRect();F({x:f(t.originX+e.clientX-t.startX,N,r.width),y:f(t.originY+e.clientY-t.startY,N,r.height)})},Mt=e=>{let t=L.current;t&&t.pointerId===e.pointerId&&(e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),L.current=null,I(!1))},Nt=e=>{e.target instanceof HTMLImageElement?(e.stopPropagation(),!z&&(B(!0),Ct?Ot():J(2,e.clientX,e.clientY))):Q()},Pt=e=>{let t=e.target;!t||he(t)||t.closest(`button, a, .ue-lightbox-inspector, .ue-lightbox-toolbar`)||t instanceof HTMLImageElement||Q()},Ft=async()=>{if(!K)return!0;if(v)return it(h(`modalWaitForMetadata`)),!1;let t={title:y,category:b,notes:x,pinned:S};et(!0),it(null);try{return await r(e.relative_path,t),Xe(n=>n.imagePath===e.relative_path?{...n,saved:{...n.saved,...t}}:n),g(h(`modalSaveState`),`success`),!0}catch(e){let t=e instanceof Error?e.message:h(`imageStateSaveError`);return it(t),g(t,`error`),!1}finally{et(!1)}},It=async()=>{if(!q)return!0;if(!C.trim())return k(h(`modalFilenameRequired`)),!1;tt(!0),k(null);try{return await i(e.relative_path,C),!0}catch(e){return k(e instanceof Error?e.message:h(`imageRenameError`)),!1}finally{tt(!1)}},Y=async()=>{!K||E||v||await Ve({title:h(`modalSaveState`),message:h(`imageStateSaveConfirm`,{name:e.filename}),tone:`warning`,confirmLabel:h(`librarySave`),cancelLabel:h(`libraryCancel`)})&&await Ft()},Lt=async()=>{E||D||A.current||(q?!await Ve({title:h(`modalRenameFile`),message:h(K?`imageRenameWithStateConfirm`:`imageRenameConfirm`,{name:e.filename,target:C}),tone:`warning`,confirmLabel:h(`folderRename`),cancelLabel:h(`libraryCancel`)})||K&&!await Ft()||await It():$e(!0))},Rt=async()=>{if(!(E||D||A.current)&&await Ve({title:h(`modalDeleteFile`),message:h(`imageDeleteConfirm`,{name:e.filename}),tone:`warning`,confirmLabel:h(`commonDelete`),cancelLabel:h(`libraryCancel`)})){k(null);try{await _e(e.relative_path),t()}catch(e){k(e instanceof Error?e.message:h(`imageDeleteError`))}}},[X,zt]=(0,l.useState)(null),Z=async(e,t,n)=>{if(!e||!e.trim())g(h(`metadataNoPositivePrompt`),`info`);else try{await navigator.clipboard.writeText(e),n&&(zt(n),setTimeout(()=>zt(e=>e===n?null:e),1500)),g(t,`success`)}catch(e){g(e instanceof Error?e.message:h(`contextCopyError`),`error`)}},Bt=async()=>{let e=c(_);await Z(e,h(`metadataCopyPositiveSuccess`),`positive`)},Vt=async()=>{let e=_?.recipe?.negative_prompt||_?.summary?.negative_prompt||``;await Z(e,h(`recipeCopiedSuccess`),`negative`)},Ht=async e=>{await Z(String(e),h(`recipeCopiedSuccess`),`seed`)},Ut=async()=>{if(!_)return;let e=_.recipe,t=c(_),n=e?.negative_prompt||_.summary?.negative_prompt||``,r=[];t&&r.push(t),n&&r.push(`Negative prompt: ${n}`);let i=[];if(e?.steps&&i.push(`Steps: ${e.steps}`),e?.sampler&&i.push(`Sampler: ${e.sampler}${e.scheduler?` ${e.scheduler}`:``}`),e?.cfg&&i.push(`CFG scale: ${e.cfg}`),e?.seed!==null&&e?.seed!==void 0&&i.push(`Seed: ${e.seed}`),e?.width&&e?.height&&i.push(`Size: ${e.width}x${e.height}`),e?.checkpoint&&i.push(`Model: ${e.checkpoint}`),e?.denoise!==null&&e?.denoise!==void 0&&i.push(`Denoise: ${e.denoise}`),e?.loras?.length){let t=e.loras.map(e=>``).join(` `);i.push(`Lora: ${t}`)}i.length&&r.push(i.join(`, `)),await Z(r.join(` + +`),h(`recipeCopiedSuccess`),`full`)},Wt=async e=>{if(A.current||ht.current||E||D)return!1;A.current=!0,rt(!0);try{if(Dt){let e=await He({title:h(`modalUnsavedStateTitle`),message:h(v?`modalUnsavedLoadingText`:q?`modalUnsavedFilenameText`:`modalUnsavedStateText`,{target:C}),tone:`warning`,confirmLabel:h(`modalSaveAndContinue`),alternativeLabel:h(`modalDiscardChanges`),cancelLabel:h(`libraryCancel`),confirmDisabled:v});if(e===`cancel`||e===`confirm`&&(!await Ft()||!await It()))return!1}return await e(),!0}finally{A.current=!1,rt(!1)}};(0,l.useEffect)(()=>{ot.current=()=>Wt(()=>{})}),(0,l.useEffect)(()=>m?(m(()=>ot.current()),()=>m(null)):void 0,[m]);let Q=()=>Wt(async()=>{ht.current=!0;let e=mt.current,n=typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches;e?.animate&&!n&&await e.animate([{opacity:1},{opacity:0}],{duration:100,easing:`ease-out`,fill:`forwards`}).finished.catch(()=>void 0),t()}),$=e=>{p?.items[e]&&e!==U&&Wt(()=>ze(e))};return(0,l.useEffect)(()=>{let e=e=>{(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`s`&&(e.preventDefault(),q&&!K?Lt():Y()),e.key===`Escape`&&(e.preventDefault(),Q()),!he(e.target)&&e.key===`ArrowLeft`&&p&&U>0&&(e.preventDefault(),$(U-1)),!he(e.target)&&e.key===`ArrowRight`&&p&&Uwindow.removeEventListener(`keydown`,e)}),(0,Me.createPortal)((0,u.jsx)(`div`,{ref:mt,role:`dialog`,"aria-modal":`true`,"aria-label":e.title||e.filename,tabIndex:-1,className:`ue-modal-backdrop ue-modal-backdrop--lightbox`,onClick:()=>void Q(),children:(0,u.jsxs)(`div`,{className:`ue-lightbox-shell`,onClick:e=>e.stopPropagation(),onDoubleClick:Pt,children:[(0,u.jsx)(`div`,{className:`ue-lightbox-backdrop-stack`,children:(0,u.jsx)(`div`,{className:`ue-lightbox-backdrop`,style:{backgroundImage:`url(${R.bg})`}})}),(0,u.jsx)(`button`,{className:`ue-lightbox-close`,onClick:()=>void Q(),"aria-label":h(`modalClose`),...G(h(`modalClose`)),children:(0,u.jsx)(le,{size:20})}),(0,u.jsx)(`button`,{className:`ue-lightbox-side-nav ue-lightbox-side-nav--prev`,disabled:!p||U<=0,onClick:()=>$(Math.max(0,U-1)),"aria-label":h(`galleryPrevious`),...G(h(`galleryPrevious`)),children:(0,u.jsx)(xe,{size:28})}),(0,u.jsx)(`button`,{className:`ue-lightbox-side-nav ue-lightbox-side-nav--next`,disabled:!p||U>=W-1,onClick:()=>$(Math.min(W-1,U+1)),"aria-label":h(`galleryNext`),...G(h(`galleryNext`)),children:(0,u.jsx)(Ce,{size:28})}),(0,u.jsxs)(`div`,{className:`ue-lightbox-stage ${T?`has-inspector`:``}`,children:[(0,u.jsxs)(`div`,{ref:lt,"aria-busy":z,className:`ue-lightbox-media ${pt?`is-zoom-transition`:``} ${Ze?`is-expanded`:`is-fit`} ${Ct?`is-zoomed`:``} ${ct?`is-dragging`:``}`,onWheel:kt,onPointerDown:At,onPointerMove:jt,onPointerUp:Mt,onPointerCancel:Mt,onDoubleClick:Nt,children:[z?(0,u.jsx)(`div`,{className:`ue-lightbox-loading`,role:`status`,children:h(`imageLoading`)}):null,(0,u.jsx)(`div`,{className:`ue-lightbox-gesture-hint`,children:h(`modalGestureHint`)}),_t?(0,u.jsxs)(`div`,{className:`ue-lightbox-fallback-card`,children:[(0,u.jsx)(`div`,{className:`ue-lightbox-fallback-icon`,children:(0,u.jsx)(re,{size:44})}),(0,u.jsx)(`h3`,{children:e.filename}),(0,u.jsx)(`p`,{className:`ue-lightbox-fallback-path`,children:e.relative_path}),(0,u.jsxs)(`div`,{className:`ue-lightbox-fallback-actions`,children:[(0,u.jsxs)(`button`,{type:`button`,className:`ue-lightbox-retry-btn`,onClick:()=>{H(!1),yt(e=>e+1)},children:[(0,u.jsx)(oe,{size:14}),(0,u.jsx)(`span`,{children:h(`imageRetryFull`)})]}),(0,u.jsxs)(`a`,{href:e.original_url||e.url,target:`_blank`,rel:`noreferrer`,className:`ue-lightbox-link-btn`,children:[(0,u.jsx)(se,{size:14}),(0,u.jsx)(`span`,{children:h(`imageOpenTab`)})]})]})]}):(0,u.jsx)(`img`,{className:`ue-lightbox-image ue-lightbox-image--active`,src:R.src,alt:R.alt,draggable:!1,onError:()=>{z||H(!0)},style:{"--ue-pan-x":`${P.x}px`,"--ue-pan-y":`${P.y}px`,"--ue-zoom":N}},R.src)]}),(0,u.jsxs)(`aside`,{className:`ue-lightbox-inspector ${T?`is-open`:``}`,inert:!T,"aria-hidden":!T,children:[(0,u.jsxs)(`div`,{className:`ue-lightbox-inspector-head`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`h3`,{children:C||e.filename}),(0,u.jsx)(`p`,{children:Et.join(` · `)})]}),(0,u.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,className:`ue-detail-link ue-detail-link--icon`,"aria-label":h(`modalOpenFull`),title:h(`modalOpenFull`),children:(0,u.jsx)(se,{size:14})})]}),(0,u.jsxs)(`section`,{className:`ue-detail-section`,children:[(0,u.jsxs)(`div`,{className:`ue-detail-section-title`,children:[(0,u.jsx)(Ee,{size:15}),(0,u.jsx)(`span`,{children:h(`modalEditSection`)})]}),(0,u.jsxs)(`div`,{className:`ue-detail-form`,children:[(0,u.jsxs)(`label`,{children:[(0,u.jsx)(`span`,{children:h(`modalTitleField`)}),(0,u.jsx)(`input`,{value:y,disabled:j,onChange:e=>M(`title`,e.target.value),placeholder:h(`galleryTitlePlaceholder`)})]}),(0,u.jsxs)(`label`,{children:[(0,u.jsx)(`span`,{children:h(`modalFilenameField`)}),(0,u.jsx)(`input`,{value:C,disabled:j,onChange:e=>{M(`filename`,e.target.value),k(null)}})]}),(0,u.jsxs)(`label`,{children:[(0,u.jsx)(`span`,{children:h(`modalCategory`)}),(0,u.jsx)(`input`,{value:b,disabled:j,onChange:e=>M(`category`,e.target.value),placeholder:h(`galleryCategoryPlaceholder`)})]}),(0,u.jsxs)(`label`,{children:[(0,u.jsx)(`span`,{children:h(`modalNotesField`)}),(0,u.jsx)(`textarea`,{value:x,disabled:j,onChange:e=>M(`notes`,e.target.value),placeholder:h(`galleryNotesPlaceholder`)})]})]}),(0,u.jsxs)(`div`,{className:`ue-detail-savebar`,children:[(0,u.jsxs)(`div`,{className:`ue-detail-savecopy`,children:[(0,u.jsx)(`strong`,{children:h(Dt?`modalUnsavedStateBadge`:`modalSavedStateBadge`)}),(0,u.jsx)(`span`,{children:h(q?`modalFilenameRenameHint`:`modalSaveHint`)})]}),(0,u.jsx)(`button`,{className:`ue-icon-action ue-icon-action--filled`,onClick:()=>void Y(),disabled:!K||E||v,"aria-label":h(E?`commonLoading`:`modalSaveState`),title:h(E?`commonLoading`:`modalSaveState`),children:(0,u.jsx)(s,{size:14})})]}),O?(0,u.jsx)(`div`,{className:`ue-inline-error`,children:O}):null]}),v?(0,u.jsxs)(`div`,{className:`ue-detail-state`,children:[(0,u.jsx)(`div`,{className:`ue-loading-orb`}),(0,u.jsx)(`p`,{children:h(`modalLoading`)})]}):qe?(0,u.jsx)(`div`,{className:`ue-inline-error`,children:qe}):(0,u.jsxs)(`div`,{className:`ue-recipe-container`,children:[c(_)?(0,u.jsxs)(`div`,{className:`ue-recipe-card ue-recipe-card--positive`,children:[(0,u.jsxs)(`div`,{className:`ue-recipe-card-head`,children:[(0,u.jsxs)(`div`,{className:`ue-recipe-card-title`,children:[(0,u.jsx)(`span`,{className:`ue-recipe-indicator ue-recipe-indicator--positive`}),(0,u.jsx)(`span`,{children:h(`metadataPositivePrompt`)})]}),(0,u.jsxs)(`button`,{className:`ue-recipe-copy-btn ${X===`positive`?`is-copied`:``}`,onClick:()=>void Bt(),type:`button`,"aria-label":h(`metadataCopyPositive`),children:[X===`positive`?(0,u.jsx)(be,{size:12}):(0,u.jsx)(o,{size:12}),(0,u.jsx)(`span`,{children:h(X===`positive`?`recipeCopiedSuccess`:`recipeCopyPositive`)})]})]}),(0,u.jsx)(`div`,{className:`ue-recipe-prompt-body`,children:c(_)})]}):null,_?.recipe?.negative_prompt||_?.summary?.negative_prompt?(0,u.jsxs)(`div`,{className:`ue-recipe-card ue-recipe-card--negative`,children:[(0,u.jsxs)(`div`,{className:`ue-recipe-card-head`,children:[(0,u.jsxs)(`div`,{className:`ue-recipe-card-title`,children:[(0,u.jsx)(`span`,{className:`ue-recipe-indicator ue-recipe-indicator--negative`}),(0,u.jsx)(`span`,{children:h(`metadataNegativePrompt`)})]}),(0,u.jsxs)(`button`,{className:`ue-recipe-copy-btn ${X===`negative`?`is-copied`:``}`,onClick:()=>void Vt(),type:`button`,"aria-label":h(`recipeCopyNegative`),children:[X===`negative`?(0,u.jsx)(be,{size:12}):(0,u.jsx)(o,{size:12}),(0,u.jsx)(`span`,{children:h(X===`negative`?`recipeCopiedSuccess`:`recipeCopyNegative`)})]})]}),(0,u.jsx)(`div`,{className:`ue-recipe-prompt-body`,children:_.recipe?.negative_prompt||_.summary.negative_prompt})]}):null,_?.recipe?.checkpoint||_?.recipe?.loras&&_.recipe.loras.length>0?(0,u.jsxs)(`div`,{className:`ue-recipe-card`,children:[(0,u.jsx)(`div`,{className:`ue-recipe-card-head`,children:(0,u.jsxs)(`div`,{className:`ue-recipe-card-title`,children:[(0,u.jsx)(De,{size:14}),(0,u.jsxs)(`span`,{children:[h(`recipeCheckpoint`),` & `,h(`recipeLoras`)]})]})}),_.recipe?.checkpoint?(0,u.jsxs)(`div`,{className:`ue-recipe-model-badge`,title:_.recipe.checkpoint,children:[(0,u.jsx)(a,{size:13}),(0,u.jsx)(`span`,{children:_.recipe.checkpoint})]}):null,_.recipe?.loras&&_.recipe.loras.length>0?(0,u.jsx)(`div`,{className:`ue-recipe-lora-list`,children:_.recipe.loras.map((e,t)=>(0,u.jsxs)(`div`,{className:`ue-recipe-lora-chip`,children:[(0,u.jsx)(`span`,{className:`ue-recipe-lora-name`,title:e.name,children:e.name}),(0,u.jsxs)(`div`,{className:`ue-recipe-lora-weights`,children:[(0,u.jsxs)(`span`,{className:`ue-recipe-lora-weight-tag`,title:h(`loraModelWeight`),children:[`M:`,e.strength_model]}),e.strength_clip===e.strength_model?null:(0,u.jsxs)(`span`,{className:`ue-recipe-lora-weight-tag`,title:h(`loraClipWeight`),children:[`C:`,e.strength_clip]})]})]},`${e.name}-${t}`))}):null]}):null,_?.recipe&&(_.recipe.steps||_.recipe.cfg||_.recipe.sampler||_.recipe.seed!==null||_.recipe.width)?(0,u.jsxs)(`div`,{className:`ue-recipe-card`,children:[(0,u.jsxs)(`div`,{className:`ue-recipe-card-head`,children:[(0,u.jsxs)(`div`,{className:`ue-recipe-card-title`,children:[(0,u.jsx)(je,{size:14}),(0,u.jsx)(`span`,{children:h(`recipeParams`)})]}),(0,u.jsxs)(`button`,{className:`ue-recipe-copy-btn ${X===`full`?`is-copied`:``}`,onClick:()=>void Ut(),type:`button`,"aria-label":h(`recipeCopyFull`),children:[X===`full`?(0,u.jsx)(be,{size:12}):(0,u.jsx)(o,{size:12}),(0,u.jsx)(`span`,{children:h(X===`full`?`recipeCopiedSuccess`:`recipeCopyFull`)})]})]}),(0,u.jsxs)(`div`,{className:`ue-recipe-params-grid`,children:[_.recipe.seed!==null&&_.recipe.seed!==void 0?(0,u.jsxs)(`div`,{className:`ue-recipe-param-item`,children:[(0,u.jsx)(`span`,{className:`ue-recipe-param-label`,children:h(`recipeSeed`)}),(0,u.jsxs)(`div`,{className:`ue-recipe-param-value`,children:[(0,u.jsx)(`span`,{title:String(_.recipe.seed),children:String(_.recipe.seed)}),(0,u.jsx)(`button`,{className:`ue-recipe-param-copy-btn`,onClick:()=>void Ht(_.recipe.seed),title:h(`recipeCopySeed`),type:`button`,children:(0,u.jsx)(o,{size:11})})]})]}):null,_.recipe.steps?(0,u.jsxs)(`div`,{className:`ue-recipe-param-item`,children:[(0,u.jsx)(`span`,{className:`ue-recipe-param-label`,children:h(`recipeSteps`)}),(0,u.jsx)(`div`,{className:`ue-recipe-param-value`,children:_.recipe.steps})]}):null,_.recipe.cfg?(0,u.jsxs)(`div`,{className:`ue-recipe-param-item`,children:[(0,u.jsx)(`span`,{className:`ue-recipe-param-label`,children:h(`recipeCfg`)}),(0,u.jsx)(`div`,{className:`ue-recipe-param-value`,children:_.recipe.cfg})]}):null,_.recipe.sampler?(0,u.jsxs)(`div`,{className:`ue-recipe-param-item`,children:[(0,u.jsx)(`span`,{className:`ue-recipe-param-label`,children:h(`recipeSampler`)}),(0,u.jsx)(`div`,{className:`ue-recipe-param-value`,title:`${_.recipe.sampler} / ${_.recipe.scheduler||`normal`}`,children:_.recipe.sampler})]}):null,_.recipe.width&&_.recipe.height?(0,u.jsxs)(`div`,{className:`ue-recipe-param-item`,children:[(0,u.jsx)(`span`,{className:`ue-recipe-param-label`,children:h(`recipeSize`)}),(0,u.jsx)(`div`,{className:`ue-recipe-param-value`,children:`${_.recipe.width} × ${_.recipe.height}`})]}):null,_.recipe.denoise!==null&&_.recipe.denoise!==void 0?(0,u.jsxs)(`div`,{className:`ue-recipe-param-item`,children:[(0,u.jsx)(`span`,{className:`ue-recipe-param-label`,children:h(`recipeDenoise`)}),(0,u.jsx)(`div`,{className:`ue-recipe-param-value`,children:_.recipe.denoise})]}):null]}),(0,u.jsxs)(`div`,{className:`ue-recipe-bottom-actions`,children:[St?(0,u.jsxs)(`button`,{className:`ue-secondary-btn`,type:`button`,onClick:()=>void Ne(e),children:[(0,u.jsx)(ae,{size:13}),(0,u.jsx)(`span`,{children:h(`recipeSendWorkflow`)})]}):null,_.recipe.loras&&_.recipe.loras.length>0?(0,u.jsxs)(`button`,{className:`ue-secondary-btn`,type:`button`,onClick:()=>void Re(e),children:[(0,u.jsx)(ue,{size:13}),(0,u.jsx)(`span`,{children:h(`recipeApplyLoraStack`)})]}):null]})]}):null,_?.artist_prompts?.length?(0,u.jsxs)(`details`,{className:`ue-detail-disclosure`,children:[(0,u.jsxs)(`summary`,{children:[(0,u.jsx)(ee,{size:14}),(0,u.jsx)(`span`,{children:h(`modalPromptSection`)}),(0,u.jsx)(`strong`,{children:_.artist_prompts.length})]}),(0,u.jsx)(`div`,{className:`ue-detail-pill-list`,children:_.artist_prompts.map((e,t)=>(0,u.jsx)(`div`,{className:`ue-detail-pill`,children:e},`${e}-${t}`))})]}):null,(0,u.jsxs)(`details`,{className:`ue-detail-disclosure`,children:[(0,u.jsxs)(`summary`,{children:[(0,u.jsx)(Ee,{size:14}),(0,u.jsx)(`span`,{children:h(`modalEditSection`)})]}),(0,u.jsxs)(`div`,{className:`ue-detail-form`,style:{marginTop:`12px`},children:[(0,u.jsxs)(`label`,{children:[(0,u.jsx)(`span`,{children:h(`modalTitleField`)}),(0,u.jsx)(`input`,{value:y,disabled:j,onChange:e=>M(`title`,e.target.value),placeholder:h(`galleryTitlePlaceholder`)})]}),(0,u.jsxs)(`label`,{children:[(0,u.jsx)(`span`,{children:h(`modalFilenameField`)}),(0,u.jsx)(`input`,{value:C,disabled:j,onChange:e=>{M(`filename`,e.target.value),k(null)}})]}),(0,u.jsxs)(`label`,{children:[(0,u.jsx)(`span`,{children:h(`modalCategory`)}),(0,u.jsx)(`input`,{value:b,disabled:j,onChange:e=>M(`category`,e.target.value),placeholder:h(`galleryCategoryPlaceholder`)})]}),(0,u.jsxs)(`label`,{children:[(0,u.jsx)(`span`,{children:h(`modalNotesField`)}),(0,u.jsx)(`textarea`,{value:x,disabled:j,onChange:e=>M(`notes`,e.target.value),placeholder:h(`galleryNotesPlaceholder`)})]})]}),(0,u.jsxs)(`div`,{className:`ue-detail-savebar`,children:[(0,u.jsxs)(`div`,{className:`ue-detail-savecopy`,children:[(0,u.jsx)(`strong`,{children:h(Dt?`modalUnsavedStateBadge`:`modalSavedStateBadge`)}),(0,u.jsx)(`span`,{children:h(q?`modalFilenameRenameHint`:`modalSaveHint`)})]}),(0,u.jsx)(`button`,{className:`ue-icon-action ue-icon-action--filled`,onClick:()=>void Y(),disabled:!K||E||v,"aria-label":h(E?`commonLoading`:`modalSaveState`),title:h(E?`commonLoading`:`modalSaveState`),children:(0,u.jsx)(s,{size:14})})]}),O?(0,u.jsx)(`div`,{className:`ue-inline-error`,children:O}):null]}),_?.metadata&&xt.length?(0,u.jsxs)(`details`,{className:`ue-detail-disclosure`,children:[(0,u.jsxs)(`summary`,{children:[(0,u.jsx)(de,{size:14}),(0,u.jsx)(`span`,{children:h(`modalMetadataSection`)}),(0,u.jsx)(`strong`,{children:xt.length})]}),(0,u.jsx)(`pre`,{className:`ue-meta-raw`,children:JSON.stringify(_.metadata,null,2)})]}):!c(_)&&!_?.recipe?(0,u.jsx)(`div`,{className:`ue-detail-state ue-detail-state--empty`,children:(0,u.jsx)(`p`,{children:h(`modalNoMetadata`)})}):null,We.length?(0,u.jsxs)(`details`,{className:`ue-detail-disclosure`,children:[(0,u.jsxs)(`summary`,{children:[(0,u.jsx)(a,{size:14}),(0,u.jsx)(`span`,{children:h(`variantRelated`)}),(0,u.jsx)(`strong`,{children:We.length})]}),(0,u.jsx)(`div`,{className:`ue-detail-variant-list`,children:We.map(e=>(0,u.jsxs)(`div`,{className:`ue-detail-variant-item`,children:[(0,u.jsx)(`img`,{src:e.cover_image.thumb_url,alt:e.cover_image.filename,loading:`lazy`,decoding:`async`}),(0,u.jsxs)(`span`,{children:[(0,u.jsx)(`strong`,{children:h(`variantType_${e.type}`)}),(0,u.jsx)(`small`,{children:h(`variantImageCount`,{count:e.count})})]})]},e.id))})]}):null]})]}),p&&p.items.length>1&&V?(0,u.jsx)(`div`,{className:`ue-lightbox-filmstrip`,role:`region`,"aria-label":h(`imageFilmstrip`),children:(0,u.jsx)(`div`,{className:`ue-lightbox-filmstrip-track`,children:p.items.map((e,t)=>{let n=t===U,r=e.thumb_url||e.url;return(0,u.jsx)(`button`,{ref:n?bt:void 0,type:`button`,className:`ue-lightbox-filmstrip-item ${n?`is-active`:``}`,onClick:()=>$(t),title:e.title||e.filename,"aria-label":e.title||e.filename,children:(0,u.jsx)(`img`,{src:r,alt:e.filename,loading:`lazy`})},e.relative_path||t)})})}):null]}),(0,u.jsxs)(`div`,{className:`ue-lightbox-toolbar`,children:[at?(0,u.jsx)(`div`,{className:`ue-inline-error ue-lightbox-action-error`,role:`alert`,children:at}):null,(0,u.jsxs)(`div`,{className:`ue-detail-action-group`,role:`group`,"aria-label":h(`detailBrowse`),children:[(0,u.jsx)(`button`,{className:`ue-toolbar-btn`,disabled:!p||U<=0,onClick:()=>$(Math.max(0,U-1)),"aria-label":h(`galleryPrevious`),...G(h(`galleryPrevious`)),children:(0,u.jsx)(xe,{size:17})}),(0,u.jsxs)(`span`,{className:`ue-lightbox-page-indicator`,children:[U+1,`/`,W]}),(0,u.jsx)(`button`,{className:`ue-toolbar-btn`,disabled:!p||U>=W-1,onClick:()=>$(Math.min(W-1,U+1)),"aria-label":h(`galleryNext`),...G(h(`galleryNext`)),children:(0,u.jsx)(Ce,{size:17})}),(0,u.jsx)(`button`,{className:`ue-toolbar-btn`,onClick:()=>$e(e=>!e),"aria-label":h(`modalToggleInspector`),...G(h(`modalToggleInspector`)),children:(0,u.jsx)(pe,{size:17})})]}),(0,u.jsxs)(`div`,{className:`ue-detail-action-group`,role:`group`,"aria-label":h(`detailReuse`),children:[(0,u.jsxs)(`button`,{className:`ue-toolbar-btn ue-toolbar-btn--label`,onClick:()=>void Bt(),"aria-label":h(`metadataCopyPositive`),...G(h(`metadataCopyPositive`)),children:[(0,u.jsx)(ve,{size:17}),(0,u.jsx)(`span`,{children:h(`metadataCopyPositive`)})]}),(0,u.jsxs)(`button`,{className:`ue-toolbar-btn ue-toolbar-btn--label`,disabled:!St,title:h(St?`modalOpenWorkflow`:`detailNoWorkflow`),onClick:()=>void Ne(e),"aria-label":h(`modalOpenWorkflow`),children:[(0,u.jsx)(a,{size:17}),(0,u.jsx)(`span`,{children:h(`modalOpenWorkflow`)})]})]}),(0,u.jsxs)(`div`,{className:`ue-detail-action-group`,role:`group`,"aria-label":h(`detailManage`),children:[(0,u.jsx)(`button`,{className:`ue-toolbar-btn ue-toolbar-btn--filled`,onClick:()=>void Y(),"aria-label":h(`modalSaveState`),...G(h(`modalSaveState`)),disabled:!K||E||v,children:(0,u.jsx)(s,{size:17})}),(0,u.jsx)(`button`,{className:`ue-toolbar-btn`,onClick:()=>M(`pinned`,!S),disabled:j,"aria-label":Tt,...G(Tt),children:(0,u.jsx)(ie,{size:17,fill:S?`currentColor`:`none`})})]}),(0,u.jsxs)(Se,{label:h(`moreActions`),icon:(0,u.jsx)(`span`,{children:h(`moreActions`)}),className:`ue-detail-more`,children:[(0,u.jsxs)(`span`,{className:`ue-lightbox-zoom-indicator`,children:[wt,`%`]}),p&&p.items.length>1?(0,u.jsx)(`button`,{className:`ue-toolbar-btn ${V?`is-active`:``}`,onClick:()=>gt(e=>!e),"aria-label":h(`imageFilmstripToggle`),title:h(`imageFilmstripToggle`),children:(0,u.jsx)(ke,{size:17})}):null,(0,u.jsxs)(`button`,{className:`ue-toolbar-btn`,onClick:()=>$e(!0),"aria-label":h(`metadataView`),...G(h(`metadataView`)),children:[(0,u.jsx)(de,{size:17}),(0,u.jsx)(`span`,{children:h(`metadataView`)})]}),(0,u.jsxs)(`button`,{className:`ue-toolbar-btn`,onClick:Ot,"aria-label":h(`modalFitImage`),...G(h(`modalFitImage`)),children:[(0,u.jsx)(Ae,{size:17}),(0,u.jsx)(`span`,{children:h(`modalFitImage`)})]}),(0,u.jsxs)(`button`,{className:`ue-toolbar-btn`,onClick:()=>J(Math.max(N,2)),"aria-label":h(`modalExpandImage`),...G(h(`modalExpandImage`)),children:[(0,u.jsx)(Oe,{size:17}),(0,u.jsx)(`span`,{children:h(`modalExpandImage`)})]}),_?(0,u.jsxs)(`button`,{className:`ue-toolbar-btn`,onClick:()=>void Re(e),"aria-label":h(`loraStackApply`),...G(h(`loraStackApply`)),children:[(0,u.jsx)(ue,{size:17}),(0,u.jsx)(`span`,{children:h(`loraStackApply`)})]}):null,(0,u.jsxs)(`button`,{className:`ue-toolbar-btn`,onClick:()=>void Lt(),"aria-label":h(`modalRenameFile`),...G(h(`modalRenameFile`)),children:[(0,u.jsx)(ce,{size:17}),(0,u.jsx)(`span`,{children:h(`modalRenameFile`)})]}),(0,u.jsxs)(`button`,{className:`ue-toolbar-btn ue-toolbar-btn--danger`,onClick:()=>void Rt(),"aria-label":h(`modalDeleteFile`),...G(h(`modalDeleteFile`)),children:[(0,u.jsx)(ne,{size:17}),(0,u.jsx)(`span`,{children:h(`modalDeleteFile`)})]}),(0,u.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,className:`ue-toolbar-btn`,"aria-label":h(`modalOpenFull`),...G(h(`modalOpenFull`)),children:[(0,u.jsx)(se,{size:17}),(0,u.jsx)(`span`,{children:h(`modalOpenFull`)})]})]})]})]})}),document.body)};export{Re as ImageDetailModal}; \ No newline at end of file diff --git a/gallery_ui/dist/assets/ImageDetailModal-DaLI34MR.js b/gallery_ui/dist/assets/ImageDetailModal-DaLI34MR.js deleted file mode 100644 index 7a965f7..0000000 --- a/gallery_ui/dist/assets/ImageDetailModal-DaLI34MR.js +++ /dev/null @@ -1,3 +0,0 @@ -import{a as e,i as t,n,r,s as i}from"./I18nProvider-cZczvL7B.js";import{t as a}from"./sparkles-Bu6QFW9h.js";import{t as o}from"./boxes--0yaGReH.js";import{t as s}from"./copy-Dp5BPX7F.js";import{t as c}from"./save-DFeVqt65.js";import{$ as ee,A as te,C as ne,E as re,F as ie,H as ae,I as oe,L as se,M as ce,T as le,X as ue,Y as de,Z as fe,_ as pe,at as me,b as he,ct as ge,d as _e,dt as ve,et as ye,f as be,i as l,ot as xe,q as Se,t as Ce,u as we,x as Te}from"./index-DWGqjUOp.js";var Ee=t(`sliders-vertical`,[[`path`,{d:`M10 8h4`,key:`1sr2af`}],[`path`,{d:`M12 21v-9`,key:`17s77i`}],[`path`,{d:`M12 8V3`,key:`13r4qs`}],[`path`,{d:`M17 16h4`,key:`h1uq16`}],[`path`,{d:`M19 12V3`,key:`o1uvq1`}],[`path`,{d:`M19 21v-5`,key:`qua636`}],[`path`,{d:`M3 14h4`,key:`bcjad9`}],[`path`,{d:`M5 10V3`,key:`cb8scm`}],[`path`,{d:`M5 21v-7`,key:`1w1uti`}]]),De=t(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),Oe=t(`expand`,[[`path`,{d:`m15 15 6 6`,key:`1s409w`}],[`path`,{d:`m15 9 6-6`,key:`ko1vev`}],[`path`,{d:`M21 16v5h-5`,key:`1ck2sf`}],[`path`,{d:`M21 8V3h-5`,key:`1qoq8a`}],[`path`,{d:`M3 16v5h5`,key:`1t08am`}],[`path`,{d:`m3 21 6-6`,key:`wwnumi`}],[`path`,{d:`M3 8V3h5`,key:`1ln10m`}],[`path`,{d:`M9 9 3 3`,key:`v551iv`}]]),ke=t(`film`,[[`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`}]]),Ae=t(`shrink`,[[`path`,{d:`m15 15 6 6m-6-6v4.8m0-4.8h4.8`,key:`17vawe`}],[`path`,{d:`M9 19.8V15m0 0H4.2M9 15l-6 6`,key:`chjx8e`}],[`path`,{d:`M15 4.2V9m0 0h4.8M15 9l6-6`,key:`lav6yq`}],[`path`,{d:`M9 4.2V9m0 0H4.2M9 9 3 3`,key:`1pxi2q`}]]),u=i(e(),1),je=ve(),d=r(),Me=e=>({title:e.title||``,category:e.category||``,notes:e.notes||``,pinned:e.pinned||e.favorite||!1,filename:e.filename||``}),Ne=e=>{let t=Me(e);return{imagePath:e.relative_path,draft:t,saved:t,touched:{}}},f=1,Pe=5,Fe=(e,t,n)=>Math.min(n,Math.max(t,e)),p=(e,t,n)=>{if(t<=f)return 0;let r=(t-1)*n/2+48;return Fe(e,-r,r)},Ie=e=>({key:e.relative_path,src:e.original_url||e.url,bg:e.thumb_url||e.original_url||e.url,alt:e.title||e.filename}),Le=({image:e,onClose:t,onSaveState:r,onRenameFile:i,onDeleteFile:ve,onOpenWorkflow:Me,onApplyLoraStack:Le,navigation:m,onNavigate:Re,onRegisterLeave:h})=>{let{t:g,locale:ze}=n(),{confirm:Be,choose:Ve}=pe(),{pushToast:_}=be(),[v,He]=(0,u.useState)(null),[Ue,We]=(0,u.useState)([]),[y,Ge]=(0,u.useState)(!0),[Ke,qe]=(0,u.useState)(null),[Je,Ye]=(0,u.useState)(()=>Ne(e)),{title:b,category:x,notes:S,pinned:C,filename:w}=Je.draft,T=Je.saved,[Xe,Ze]=(0,u.useState)(!1),[E,Qe]=(0,u.useState)(!1),[D,$e]=(0,u.useState)(!1),[O,et]=(0,u.useState)(!1),[tt,nt]=(0,u.useState)(!1),[k,rt]=(0,u.useState)(null),[it,A]=(0,u.useState)(null),j=(0,u.useRef)(!1),at=(0,u.useRef)(async()=>!1),M=tt||D||O,N=(e,t)=>{j.current||M||Ye(n=>({...n,draft:{...n.draft,[e]:t},touched:{...n.touched,[e]:!0}}))},[P,ot]=(0,u.useState)(f),[F,I]=(0,u.useState)({x:0,y:0}),[st,L]=(0,u.useState)(!1),ct=(0,u.useRef)(null),R=(0,u.useRef)(null),lt=(0,u.useRef)(``),[z,ut]=(0,u.useState)(()=>({...Ie(e),src:e.thumb_url||e.original_url||e.url})),[B,dt]=(0,u.useState)(!0),[ft,V]=(0,u.useState)(!1);(0,u.useEffect)(()=>{if(!ft)return;let e=window.setTimeout(()=>V(!1),180);return()=>window.clearTimeout(e)},[ft]);let pt=(0,u.useRef)(null),mt=(0,u.useRef)(!1),[H,ht]=(0,u.useState)(!0),[gt,U]=(0,u.useState)(!1),[_t,vt]=(0,u.useState)(0),yt=(0,u.useRef)(null);(0,u.useEffect)(()=>{let t=new AbortController,n={key:e.relative_path,src:e.original_url||e.url,bg:e.thumb_url||e.url,alt:e.title||e.filename};return _t&&(n.src+=`${n.src.includes(`?`)?`&`:`?`}_retry=${_t}`),dt(!0),U(!1),he(n.src,t.signal).then(e=>{t.signal.aborted||(e&&ut(n),U(!e),dt(!1))}),()=>t.abort()},[e.relative_path,e.original_url,e.url,e.thumb_url,e.title,e.filename,_t]),(0,u.useEffect)(()=>{H&&yt.current&&yt.current.scrollIntoView({behavior:Te(),block:`nearest`,inline:`center`})},[m?.currentIndex,H]),(0,u.useEffect)(()=>{let e=new AbortController,t=m?.items??[],n=m?.currentIndex??-1;return[t[n-1],t[n+1]].filter(e=>!!e).forEach(t=>{he(Ie(t).src,e.signal)}),()=>e.abort()},[m]),(0,u.useEffect)(()=>{let t=!1;return(async()=>{Ge(!0),qe(null),He(null);try{let n=await ne.getImageMetadata(e.relative_path);if(t)return;He(n);let r={title:n.state.title??e.title??``,category:n.state.category??e.category??``,notes:n.state.notes??e.notes??``,pinned:n.state.pinned??n.state.favorite??e.pinned??e.favorite??!1,filename:n.filename||e.filename||``};Ye(t=>t.imagePath===e.relative_path?{...t,saved:r,draft:{title:t.touched.title?t.draft.title:r.title,category:t.touched.category?t.draft.category:r.category,notes:t.touched.notes?t.draft.notes:r.notes,pinned:t.touched.pinned?t.draft.pinned:r.pinned,filename:t.touched.filename?t.draft.filename:r.filename}}:t)}catch(e){t||qe(e instanceof Error?e.message:g(`modalLoading`))}finally{t||Ge(!1)}})(),()=>{t=!0}},[e,g]),(0,u.useEffect)(()=>{let t=!1;return ne.listVariantGroups({subfolder:e.subfolder,limit:80}).then(n=>{t||We(n.groups.filter(t=>t.images_preview.some(t=>t.relative_path===e.relative_path)).slice(0,4))}).catch(()=>{t||(We([]),ne.prewarmFingerprints({relativePaths:[e.relative_path],limit:1}).catch(()=>void 0))}),()=>{t=!0}},[e.relative_path,e.subfolder]),(0,u.useEffect)(()=>(lt.current=document.body.style.overflow,document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=lt.current}),[]),(0,u.useEffect)(()=>{let e=document.activeElement instanceof HTMLElement?document.activeElement:null,t=document.getElementById(`root`),n=t?.inert??!1;t&&(t.inert=!0);let r=pt.current;r?.querySelector(`.ue-lightbox-close`)?.focus({preventScroll:!0});let i=()=>Array.from(r?.querySelectorAll(`button:not(:disabled), a[href], input:not(:disabled), textarea:not(:disabled), select:not(:disabled), [tabindex]:not([tabindex="-1"])`)??[]).filter(e=>!e.closest(`[inert], [hidden], [aria-hidden='true']`)),a=()=>!!document.querySelector(`.ue-confirm-backdrop, .ue-onboarding-layer`),o=e=>{if(e.key!==`Tab`||a())return;let t=i();if(!t.length){e.preventDefault(),r?.focus({preventScroll:!0});return}let n=t[0],o=t[t.length-1];!r?.contains(document.activeElement)||document.activeElement===r?(e.preventDefault(),(e.shiftKey?o:n).focus()):e.shiftKey&&document.activeElement===n?(e.preventDefault(),o.focus()):!e.shiftKey&&document.activeElement===o&&(e.preventDefault(),n.focus())},s=e=>{!a()&&!r?.contains(e.target)&&r?.querySelector(`.ue-lightbox-close`)?.focus({preventScroll:!0})};return document.addEventListener(`keydown`,o,!0),document.addEventListener(`focusin`,s),()=>{document.removeEventListener(`keydown`,o,!0),document.removeEventListener(`focusin`,s),t&&(t.inert=n),e?.isConnected&&!e.closest(`[inert]`)&&e.focus({preventScroll:!0})}},[]);let bt=v?.metadata?Object.keys(v.metadata):[],xt=!!(v?.workflow||v?.metadata&&typeof v.metadata==`object`&&`prompt`in v.metadata),W=m?.currentIndex??0,G=m?.items.length??1,St=P>1.01,Ct=Math.round(P*100),wt=g(C?`galleryUnpin`:`galleryPin`),K=e=>({title:e,"data-tooltip":e}),Tt=[we(e.size),_e(e.created_at,ze)],q=b!==T.title||x!==T.category||S!==T.notes||C!==T.pinned,J=w!==T.filename,Et=q||J,Dt=()=>{R.current=null,I({x:0,y:0}),ot(f),Ze(!1),L(!1)},Ot=(e,t,n)=>{let r=ct.current,i=Fe(e,f,Pe);if(!r||t===void 0||n===void 0||P===f&&i===f){if(i===f){Dt();return}ot(i),I({x:0,y:0}),Ze(i>f);return}let a=r.getBoundingClientRect(),o=t-a.left-a.width/2,s=n-a.top-a.height/2,c=i/P;I(e=>({x:i===f?0:p(e.x+(o-e.x)*(1-c),i,a.width),y:i===f?0:p(e.y+(s-e.y)*(1-c),i,a.height)})),ot(i),Ze(i>f),i===f&&L(!1)},kt=e=>{if(e.preventDefault(),B)return;V(!1);let t=e.deltaY<0?1.16:.86;Ot(Number((P*t).toFixed(3)),e.clientX,e.clientY)},At=e=>{e.button!==0||!St||(e.preventDefault(),V(!1),R.current={pointerId:e.pointerId,startX:e.clientX,startY:e.clientY,originX:F.x,originY:F.y},e.currentTarget.setPointerCapture(e.pointerId),L(!0))},jt=e=>{let t=R.current,n=ct.current;if(!t||!n||t.pointerId!==e.pointerId)return;let r=n.getBoundingClientRect();I({x:p(t.originX+e.clientX-t.startX,P,r.width),y:p(t.originY+e.clientY-t.startY,P,r.height)})},Mt=e=>{let t=R.current;!t||t.pointerId!==e.pointerId||(e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),R.current=null,L(!1))},Nt=e=>{if(!(e.target instanceof HTMLImageElement)){Q();return}if(e.stopPropagation(),!B){if(V(!0),St){Dt();return}Ot(2,e.clientX,e.clientY)}},Pt=e=>{let t=e.target;!t||ge(t)||t.closest(`button, a, .ue-lightbox-inspector, .ue-lightbox-toolbar`)||t instanceof HTMLImageElement||Q()},Ft=async()=>{if(!q)return!0;if(y)return rt(g(`modalWaitForMetadata`)),!1;let t={title:b,category:x,notes:S,pinned:C};$e(!0),rt(null);try{return await r(e.relative_path,t),Ye(n=>n.imagePath===e.relative_path?{...n,saved:{...n.saved,...t}}:n),_(g(`modalSaveState`),`success`),!0}catch(e){let t=e instanceof Error?e.message:g(`imageStateSaveError`);return rt(t),_(t,`error`),!1}finally{$e(!1)}},It=async()=>{if(!J)return!0;if(!w.trim())return A(g(`modalFilenameRequired`)),!1;et(!0),A(null);try{return await i(e.relative_path,w),!0}catch(e){return A(e instanceof Error?e.message:g(`imageRenameError`)),!1}finally{et(!1)}},Y=async()=>{!q||D||y||await Be({title:g(`modalSaveState`),message:g(`imageStateSaveConfirm`,{name:e.filename}),tone:`warning`,confirmLabel:g(`librarySave`),cancelLabel:g(`libraryCancel`)})&&await Ft()},Lt=async()=>{if(!(D||O||j.current)){if(!J){Qe(!0);return}!await Be({title:g(`modalRenameFile`),message:g(q?`imageRenameWithStateConfirm`:`imageRenameConfirm`,{name:e.filename,target:w}),tone:`warning`,confirmLabel:g(`folderRename`),cancelLabel:g(`libraryCancel`)})||q&&!await Ft()||await It()}},Rt=async()=>{if(!(D||O||j.current)&&await Be({title:g(`modalDeleteFile`),message:g(`imageDeleteConfirm`,{name:e.filename}),tone:`warning`,confirmLabel:g(`commonDelete`),cancelLabel:g(`libraryCancel`)})){A(null);try{await ve(e.relative_path),t()}catch(e){A(e instanceof Error?e.message:g(`imageDeleteError`))}}},[X,zt]=(0,u.useState)(null),Z=async(e,t,n)=>{if(!e||!e.trim()){_(g(`metadataNoPositivePrompt`),`info`);return}try{await navigator.clipboard.writeText(e),n&&(zt(n),setTimeout(()=>zt(e=>e===n?null:e),1500)),_(t,`success`)}catch(e){_(e instanceof Error?e.message:g(`contextCopyError`),`error`)}},Bt=async()=>{await Z(l(v),g(`metadataCopyPositiveSuccess`),`positive`)},Vt=async()=>{await Z(v?.recipe?.negative_prompt||v?.summary?.negative_prompt||``,g(`recipeCopiedSuccess`),`negative`)},Ht=async e=>{await Z(String(e),g(`recipeCopiedSuccess`),`seed`)},Ut=async()=>{if(!v)return;let e=v.recipe,t=l(v),n=e?.negative_prompt||v.summary?.negative_prompt||``,r=[];t&&r.push(t),n&&r.push(`Negative prompt: ${n}`);let i=[];if(e?.steps&&i.push(`Steps: ${e.steps}`),e?.sampler&&i.push(`Sampler: ${e.sampler}${e.scheduler?` ${e.scheduler}`:``}`),e?.cfg&&i.push(`CFG scale: ${e.cfg}`),e?.seed!==null&&e?.seed!==void 0&&i.push(`Seed: ${e.seed}`),e?.width&&e?.height&&i.push(`Size: ${e.width}x${e.height}`),e?.checkpoint&&i.push(`Model: ${e.checkpoint}`),e?.denoise!==null&&e?.denoise!==void 0&&i.push(`Denoise: ${e.denoise}`),e?.loras?.length){let t=e.loras.map(e=>``).join(` `);i.push(`Lora: ${t}`)}i.length&&r.push(i.join(`, `)),await Z(r.join(` - -`),g(`recipeCopiedSuccess`),`full`)},Wt=async e=>{if(j.current||mt.current||D||O)return!1;j.current=!0,nt(!0);try{if(Et){let e=await Ve({title:g(`modalUnsavedStateTitle`),message:g(y?`modalUnsavedLoadingText`:J?`modalUnsavedFilenameText`:`modalUnsavedStateText`,{target:w}),tone:`warning`,confirmLabel:g(`modalSaveAndContinue`),alternativeLabel:g(`modalDiscardChanges`),cancelLabel:g(`libraryCancel`),confirmDisabled:y});if(e===`cancel`||e===`confirm`&&(!await Ft()||!await It()))return!1}return await e(),!0}finally{j.current=!1,nt(!1)}};(0,u.useEffect)(()=>{at.current=()=>Wt(()=>{})}),(0,u.useEffect)(()=>h?(h(()=>at.current()),()=>h(null)):void 0,[h]);let Q=()=>Wt(async()=>{mt.current=!0;let e=pt.current,n=typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches;e?.animate&&!n&&await e.animate([{opacity:1},{opacity:0}],{duration:100,easing:`ease-out`,fill:`forwards`}).finished.catch(()=>void 0),t()}),$=e=>{!m?.items[e]||e===W||Wt(()=>Re(e))};return(0,u.useEffect)(()=>{let e=e=>{(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`s`&&(e.preventDefault(),J&&!q?Lt():Y()),e.key===`Escape`&&(e.preventDefault(),Q()),!ge(e.target)&&e.key===`ArrowLeft`&&m&&W>0&&(e.preventDefault(),$(W-1)),!ge(e.target)&&e.key===`ArrowRight`&&m&&Wwindow.removeEventListener(`keydown`,e)}),(0,je.createPortal)((0,d.jsx)(`div`,{ref:pt,role:`dialog`,"aria-modal":`true`,"aria-label":e.title||e.filename,tabIndex:-1,className:`ue-modal-backdrop ue-modal-backdrop--lightbox`,onClick:()=>void Q(),children:(0,d.jsxs)(`div`,{className:`ue-lightbox-shell`,onClick:e=>e.stopPropagation(),onDoubleClick:Pt,children:[(0,d.jsx)(`div`,{className:`ue-lightbox-backdrop-stack`,children:(0,d.jsx)(`div`,{className:`ue-lightbox-backdrop`,style:{backgroundImage:`url(${z.bg})`}})}),(0,d.jsx)(`button`,{className:`ue-lightbox-close`,onClick:()=>void Q(),"aria-label":g(`modalClose`),...K(g(`modalClose`)),children:(0,d.jsx)(le,{size:20})}),(0,d.jsx)(`button`,{className:`ue-lightbox-side-nav ue-lightbox-side-nav--prev`,disabled:!m||W<=0,onClick:()=>$(Math.max(0,W-1)),"aria-label":g(`galleryPrevious`),...K(g(`galleryPrevious`)),children:(0,d.jsx)(fe,{size:28})}),(0,d.jsx)(`button`,{className:`ue-lightbox-side-nav ue-lightbox-side-nav--next`,disabled:!m||W>=G-1,onClick:()=>$(Math.min(G-1,W+1)),"aria-label":g(`galleryNext`),...K(g(`galleryNext`)),children:(0,d.jsx)(ue,{size:28})}),(0,d.jsxs)(`div`,{className:`ue-lightbox-stage ${E?`has-inspector`:``}`,children:[(0,d.jsxs)(`div`,{ref:ct,"aria-busy":B,className:`ue-lightbox-media ${ft?`is-zoom-transition`:``} ${Xe?`is-expanded`:`is-fit`} ${St?`is-zoomed`:``} ${st?`is-dragging`:``}`,onWheel:kt,onPointerDown:At,onPointerMove:jt,onPointerUp:Mt,onPointerCancel:Mt,onDoubleClick:Nt,children:[B?(0,d.jsx)(`div`,{className:`ue-lightbox-loading`,role:`status`,children:g(`imageLoading`)}):null,(0,d.jsx)(`div`,{className:`ue-lightbox-gesture-hint`,children:g(`modalGestureHint`)}),gt?(0,d.jsxs)(`div`,{className:`ue-lightbox-fallback-card`,children:[(0,d.jsx)(`div`,{className:`ue-lightbox-fallback-icon`,children:(0,d.jsx)(ae,{size:44})}),(0,d.jsx)(`h3`,{children:e.filename}),(0,d.jsx)(`p`,{className:`ue-lightbox-fallback-path`,children:e.relative_path}),(0,d.jsxs)(`div`,{className:`ue-lightbox-fallback-actions`,children:[(0,d.jsxs)(`button`,{type:`button`,className:`ue-lightbox-retry-btn`,onClick:()=>{U(!1),vt(e=>e+1)},children:[(0,d.jsx)(ce,{size:14}),(0,d.jsx)(`span`,{children:g(`imageRetryFull`)})]}),(0,d.jsxs)(`a`,{href:e.original_url||e.url,target:`_blank`,rel:`noreferrer`,className:`ue-lightbox-link-btn`,children:[(0,d.jsx)(Se,{size:14}),(0,d.jsx)(`span`,{children:g(`imageOpenTab`)})]})]})]}):(0,d.jsx)(`img`,{className:`ue-lightbox-image ue-lightbox-image--active`,src:z.src,alt:z.alt,draggable:!1,onError:()=>{B||U(!0)},style:{"--ue-pan-x":`${F.x}px`,"--ue-pan-y":`${F.y}px`,"--ue-zoom":P}},z.src)]}),(0,d.jsxs)(`aside`,{className:`ue-lightbox-inspector ${E?`is-open`:``}`,inert:!E,"aria-hidden":!E,children:[(0,d.jsxs)(`div`,{className:`ue-lightbox-inspector-head`,children:[(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`h3`,{children:w||e.filename}),(0,d.jsx)(`p`,{children:Tt.join(` · `)})]}),(0,d.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,className:`ue-detail-link ue-detail-link--icon`,"aria-label":g(`modalOpenFull`),title:g(`modalOpenFull`),children:(0,d.jsx)(Se,{size:14})})]}),(0,d.jsxs)(`section`,{className:`ue-detail-section`,children:[(0,d.jsxs)(`div`,{className:`ue-detail-section-title`,children:[(0,d.jsx)(se,{size:15}),(0,d.jsx)(`span`,{children:g(`modalEditSection`)})]}),(0,d.jsxs)(`div`,{className:`ue-detail-form`,children:[(0,d.jsxs)(`label`,{children:[(0,d.jsx)(`span`,{children:g(`modalTitleField`)}),(0,d.jsx)(`input`,{value:b,disabled:M,onChange:e=>N(`title`,e.target.value),placeholder:g(`galleryTitlePlaceholder`)})]}),(0,d.jsxs)(`label`,{children:[(0,d.jsx)(`span`,{children:g(`modalFilenameField`)}),(0,d.jsx)(`input`,{value:w,disabled:M,onChange:e=>{N(`filename`,e.target.value),A(null)}})]}),(0,d.jsxs)(`label`,{children:[(0,d.jsx)(`span`,{children:g(`modalCategory`)}),(0,d.jsx)(`input`,{value:x,disabled:M,onChange:e=>N(`category`,e.target.value),placeholder:g(`galleryCategoryPlaceholder`)})]}),(0,d.jsxs)(`label`,{children:[(0,d.jsx)(`span`,{children:g(`modalNotesField`)}),(0,d.jsx)(`textarea`,{value:S,disabled:M,onChange:e=>N(`notes`,e.target.value),placeholder:g(`galleryNotesPlaceholder`)})]})]}),(0,d.jsxs)(`div`,{className:`ue-detail-savebar`,children:[(0,d.jsxs)(`div`,{className:`ue-detail-savecopy`,children:[(0,d.jsx)(`strong`,{children:g(Et?`modalUnsavedStateBadge`:`modalSavedStateBadge`)}),(0,d.jsx)(`span`,{children:g(J?`modalFilenameRenameHint`:`modalSaveHint`)})]}),(0,d.jsx)(`button`,{className:`ue-icon-action ue-icon-action--filled`,onClick:()=>void Y(),disabled:!q||D||y,"aria-label":g(D?`commonLoading`:`modalSaveState`),title:g(D?`commonLoading`:`modalSaveState`),children:(0,d.jsx)(c,{size:14})})]}),k?(0,d.jsx)(`div`,{className:`ue-inline-error`,children:k}):null]}),y?(0,d.jsxs)(`div`,{className:`ue-detail-state`,children:[(0,d.jsx)(`div`,{className:`ue-loading-orb`}),(0,d.jsx)(`p`,{children:g(`modalLoading`)})]}):Ke?(0,d.jsx)(`div`,{className:`ue-inline-error`,children:Ke}):(0,d.jsxs)(`div`,{className:`ue-recipe-container`,children:[l(v)?(0,d.jsxs)(`div`,{className:`ue-recipe-card ue-recipe-card--positive`,children:[(0,d.jsxs)(`div`,{className:`ue-recipe-card-head`,children:[(0,d.jsxs)(`div`,{className:`ue-recipe-card-title`,children:[(0,d.jsx)(`span`,{className:`ue-recipe-indicator ue-recipe-indicator--positive`}),(0,d.jsx)(`span`,{children:g(`metadataPositivePrompt`)})]}),(0,d.jsxs)(`button`,{className:`ue-recipe-copy-btn ${X===`positive`?`is-copied`:``}`,onClick:()=>void Bt(),type:`button`,"aria-label":g(`metadataCopyPositive`),children:[X===`positive`?(0,d.jsx)(ee,{size:12}):(0,d.jsx)(s,{size:12}),(0,d.jsx)(`span`,{children:g(X===`positive`?`recipeCopiedSuccess`:`recipeCopyPositive`)})]})]}),(0,d.jsx)(`div`,{className:`ue-recipe-prompt-body`,children:l(v)})]}):null,v?.recipe?.negative_prompt||v?.summary?.negative_prompt?(0,d.jsxs)(`div`,{className:`ue-recipe-card ue-recipe-card--negative`,children:[(0,d.jsxs)(`div`,{className:`ue-recipe-card-head`,children:[(0,d.jsxs)(`div`,{className:`ue-recipe-card-title`,children:[(0,d.jsx)(`span`,{className:`ue-recipe-indicator ue-recipe-indicator--negative`}),(0,d.jsx)(`span`,{children:g(`metadataNegativePrompt`)})]}),(0,d.jsxs)(`button`,{className:`ue-recipe-copy-btn ${X===`negative`?`is-copied`:``}`,onClick:()=>void Vt(),type:`button`,"aria-label":g(`recipeCopyNegative`),children:[X===`negative`?(0,d.jsx)(ee,{size:12}):(0,d.jsx)(s,{size:12}),(0,d.jsx)(`span`,{children:g(X===`negative`?`recipeCopiedSuccess`:`recipeCopyNegative`)})]})]}),(0,d.jsx)(`div`,{className:`ue-recipe-prompt-body`,children:v.recipe?.negative_prompt||v.summary.negative_prompt})]}):null,v?.recipe?.checkpoint||v?.recipe?.loras&&v.recipe.loras.length>0?(0,d.jsxs)(`div`,{className:`ue-recipe-card`,children:[(0,d.jsx)(`div`,{className:`ue-recipe-card-head`,children:(0,d.jsxs)(`div`,{className:`ue-recipe-card-title`,children:[(0,d.jsx)(De,{size:14}),(0,d.jsxs)(`span`,{children:[g(`recipeCheckpoint`),` & `,g(`recipeLoras`)]})]})}),v.recipe?.checkpoint?(0,d.jsxs)(`div`,{className:`ue-recipe-model-badge`,title:v.recipe.checkpoint,children:[(0,d.jsx)(o,{size:13}),(0,d.jsx)(`span`,{children:v.recipe.checkpoint})]}):null,v.recipe?.loras&&v.recipe.loras.length>0?(0,d.jsx)(`div`,{className:`ue-recipe-lora-list`,children:v.recipe.loras.map((e,t)=>(0,d.jsxs)(`div`,{className:`ue-recipe-lora-chip`,children:[(0,d.jsx)(`span`,{className:`ue-recipe-lora-name`,title:e.name,children:e.name}),(0,d.jsxs)(`div`,{className:`ue-recipe-lora-weights`,children:[(0,d.jsxs)(`span`,{className:`ue-recipe-lora-weight-tag`,title:g(`loraModelWeight`),children:[`M:`,e.strength_model]}),e.strength_clip===e.strength_model?null:(0,d.jsxs)(`span`,{className:`ue-recipe-lora-weight-tag`,title:g(`loraClipWeight`),children:[`C:`,e.strength_clip]})]})]},`${e.name}-${t}`))}):null]}):null,v?.recipe&&(v.recipe.steps||v.recipe.cfg||v.recipe.sampler||v.recipe.seed!==null||v.recipe.width)?(0,d.jsxs)(`div`,{className:`ue-recipe-card`,children:[(0,d.jsxs)(`div`,{className:`ue-recipe-card-head`,children:[(0,d.jsxs)(`div`,{className:`ue-recipe-card-title`,children:[(0,d.jsx)(Ee,{size:14}),(0,d.jsx)(`span`,{children:g(`recipeParams`)})]}),(0,d.jsxs)(`button`,{className:`ue-recipe-copy-btn ${X===`full`?`is-copied`:``}`,onClick:()=>void Ut(),type:`button`,"aria-label":g(`recipeCopyFull`),children:[X===`full`?(0,d.jsx)(ee,{size:12}):(0,d.jsx)(s,{size:12}),(0,d.jsx)(`span`,{children:g(X===`full`?`recipeCopiedSuccess`:`recipeCopyFull`)})]})]}),(0,d.jsxs)(`div`,{className:`ue-recipe-params-grid`,children:[v.recipe.seed!==null&&v.recipe.seed!==void 0?(0,d.jsxs)(`div`,{className:`ue-recipe-param-item`,children:[(0,d.jsx)(`span`,{className:`ue-recipe-param-label`,children:g(`recipeSeed`)}),(0,d.jsxs)(`div`,{className:`ue-recipe-param-value`,children:[(0,d.jsx)(`span`,{title:String(v.recipe.seed),children:String(v.recipe.seed)}),(0,d.jsx)(`button`,{className:`ue-recipe-param-copy-btn`,onClick:()=>void Ht(v.recipe.seed),title:g(`recipeCopySeed`),type:`button`,children:(0,d.jsx)(s,{size:11})})]})]}):null,v.recipe.steps?(0,d.jsxs)(`div`,{className:`ue-recipe-param-item`,children:[(0,d.jsx)(`span`,{className:`ue-recipe-param-label`,children:g(`recipeSteps`)}),(0,d.jsx)(`div`,{className:`ue-recipe-param-value`,children:v.recipe.steps})]}):null,v.recipe.cfg?(0,d.jsxs)(`div`,{className:`ue-recipe-param-item`,children:[(0,d.jsx)(`span`,{className:`ue-recipe-param-label`,children:g(`recipeCfg`)}),(0,d.jsx)(`div`,{className:`ue-recipe-param-value`,children:v.recipe.cfg})]}):null,v.recipe.sampler?(0,d.jsxs)(`div`,{className:`ue-recipe-param-item`,children:[(0,d.jsx)(`span`,{className:`ue-recipe-param-label`,children:g(`recipeSampler`)}),(0,d.jsx)(`div`,{className:`ue-recipe-param-value`,title:`${v.recipe.sampler} / ${v.recipe.scheduler||`normal`}`,children:v.recipe.sampler})]}):null,v.recipe.width&&v.recipe.height?(0,d.jsxs)(`div`,{className:`ue-recipe-param-item`,children:[(0,d.jsx)(`span`,{className:`ue-recipe-param-label`,children:g(`recipeSize`)}),(0,d.jsx)(`div`,{className:`ue-recipe-param-value`,children:`${v.recipe.width} × ${v.recipe.height}`})]}):null,v.recipe.denoise!==null&&v.recipe.denoise!==void 0?(0,d.jsxs)(`div`,{className:`ue-recipe-param-item`,children:[(0,d.jsx)(`span`,{className:`ue-recipe-param-label`,children:g(`recipeDenoise`)}),(0,d.jsx)(`div`,{className:`ue-recipe-param-value`,children:v.recipe.denoise})]}):null]}),(0,d.jsxs)(`div`,{className:`ue-recipe-bottom-actions`,children:[xt?(0,d.jsxs)(`button`,{className:`ue-secondary-btn`,type:`button`,onClick:()=>void Me(e),children:[(0,d.jsx)(te,{size:13}),(0,d.jsx)(`span`,{children:g(`recipeSendWorkflow`)})]}):null,v.recipe.loras&&v.recipe.loras.length>0?(0,d.jsxs)(`button`,{className:`ue-secondary-btn`,type:`button`,onClick:()=>void Le(e),children:[(0,d.jsx)(me,{size:13}),(0,d.jsx)(`span`,{children:g(`recipeApplyLoraStack`)})]}):null]})]}):null,v?.artist_prompts?.length?(0,d.jsxs)(`details`,{className:`ue-detail-disclosure`,children:[(0,d.jsxs)(`summary`,{children:[(0,d.jsx)(a,{size:14}),(0,d.jsx)(`span`,{children:g(`modalPromptSection`)}),(0,d.jsx)(`strong`,{children:v.artist_prompts.length})]}),(0,d.jsx)(`div`,{className:`ue-detail-pill-list`,children:v.artist_prompts.map((e,t)=>(0,d.jsx)(`div`,{className:`ue-detail-pill`,children:e},`${e}-${t}`))})]}):null,(0,d.jsxs)(`details`,{className:`ue-detail-disclosure`,children:[(0,d.jsxs)(`summary`,{children:[(0,d.jsx)(se,{size:14}),(0,d.jsx)(`span`,{children:g(`modalEditSection`)})]}),(0,d.jsxs)(`div`,{className:`ue-detail-form`,style:{marginTop:`12px`},children:[(0,d.jsxs)(`label`,{children:[(0,d.jsx)(`span`,{children:g(`modalTitleField`)}),(0,d.jsx)(`input`,{value:b,disabled:M,onChange:e=>N(`title`,e.target.value),placeholder:g(`galleryTitlePlaceholder`)})]}),(0,d.jsxs)(`label`,{children:[(0,d.jsx)(`span`,{children:g(`modalFilenameField`)}),(0,d.jsx)(`input`,{value:w,disabled:M,onChange:e=>{N(`filename`,e.target.value),A(null)}})]}),(0,d.jsxs)(`label`,{children:[(0,d.jsx)(`span`,{children:g(`modalCategory`)}),(0,d.jsx)(`input`,{value:x,disabled:M,onChange:e=>N(`category`,e.target.value),placeholder:g(`galleryCategoryPlaceholder`)})]}),(0,d.jsxs)(`label`,{children:[(0,d.jsx)(`span`,{children:g(`modalNotesField`)}),(0,d.jsx)(`textarea`,{value:S,disabled:M,onChange:e=>N(`notes`,e.target.value),placeholder:g(`galleryNotesPlaceholder`)})]})]}),(0,d.jsxs)(`div`,{className:`ue-detail-savebar`,children:[(0,d.jsxs)(`div`,{className:`ue-detail-savecopy`,children:[(0,d.jsx)(`strong`,{children:g(Et?`modalUnsavedStateBadge`:`modalSavedStateBadge`)}),(0,d.jsx)(`span`,{children:g(J?`modalFilenameRenameHint`:`modalSaveHint`)})]}),(0,d.jsx)(`button`,{className:`ue-icon-action ue-icon-action--filled`,onClick:()=>void Y(),disabled:!q||D||y,"aria-label":g(D?`commonLoading`:`modalSaveState`),title:g(D?`commonLoading`:`modalSaveState`),children:(0,d.jsx)(c,{size:14})})]}),k?(0,d.jsx)(`div`,{className:`ue-inline-error`,children:k}):null]}),v?.metadata&&bt.length?(0,d.jsxs)(`details`,{className:`ue-detail-disclosure`,children:[(0,d.jsxs)(`summary`,{children:[(0,d.jsx)(xe,{size:14}),(0,d.jsx)(`span`,{children:g(`modalMetadataSection`)}),(0,d.jsx)(`strong`,{children:bt.length})]}),(0,d.jsx)(`pre`,{className:`ue-meta-raw`,children:JSON.stringify(v.metadata,null,2)})]}):!l(v)&&!v?.recipe?(0,d.jsx)(`div`,{className:`ue-detail-state ue-detail-state--empty`,children:(0,d.jsx)(`p`,{children:g(`modalNoMetadata`)})}):null,Ue.length?(0,d.jsxs)(`details`,{className:`ue-detail-disclosure`,children:[(0,d.jsxs)(`summary`,{children:[(0,d.jsx)(o,{size:14}),(0,d.jsx)(`span`,{children:g(`variantRelated`)}),(0,d.jsx)(`strong`,{children:Ue.length})]}),(0,d.jsx)(`div`,{className:`ue-detail-variant-list`,children:Ue.map(e=>(0,d.jsxs)(`div`,{className:`ue-detail-variant-item`,children:[(0,d.jsx)(`img`,{src:e.cover_image.thumb_url,alt:e.cover_image.filename,loading:`lazy`,decoding:`async`}),(0,d.jsxs)(`span`,{children:[(0,d.jsx)(`strong`,{children:g(`variantType_${e.type}`)}),(0,d.jsx)(`small`,{children:g(`variantImageCount`,{count:e.count})})]})]},e.id))})]}):null]})]}),m&&m.items.length>1&&H?(0,d.jsx)(`div`,{className:`ue-lightbox-filmstrip`,role:`region`,"aria-label":g(`imageFilmstrip`),children:(0,d.jsx)(`div`,{className:`ue-lightbox-filmstrip-track`,children:m.items.map((e,t)=>{let n=t===W,r=e.thumb_url||e.url;return(0,d.jsx)(`button`,{ref:n?yt:void 0,type:`button`,className:`ue-lightbox-filmstrip-item ${n?`is-active`:``}`,onClick:()=>$(t),title:e.title||e.filename,"aria-label":e.title||e.filename,children:(0,d.jsx)(`img`,{src:r,alt:e.filename,loading:`lazy`})},e.relative_path||t)})})}):null]}),(0,d.jsxs)(`div`,{className:`ue-lightbox-toolbar`,children:[it?(0,d.jsx)(`div`,{className:`ue-inline-error ue-lightbox-action-error`,role:`alert`,children:it}):null,(0,d.jsxs)(`div`,{className:`ue-detail-action-group`,role:`group`,"aria-label":g(`detailBrowse`),children:[(0,d.jsx)(`button`,{className:`ue-toolbar-btn`,disabled:!m||W<=0,onClick:()=>$(Math.max(0,W-1)),"aria-label":g(`galleryPrevious`),...K(g(`galleryPrevious`)),children:(0,d.jsx)(fe,{size:17})}),(0,d.jsxs)(`span`,{className:`ue-lightbox-page-indicator`,children:[W+1,`/`,G]}),(0,d.jsx)(`button`,{className:`ue-toolbar-btn`,disabled:!m||W>=G-1,onClick:()=>$(Math.min(G-1,W+1)),"aria-label":g(`galleryNext`),...K(g(`galleryNext`)),children:(0,d.jsx)(ue,{size:17})}),(0,d.jsx)(`button`,{className:`ue-toolbar-btn`,onClick:()=>Qe(e=>!e),"aria-label":g(`modalToggleInspector`),...K(g(`modalToggleInspector`)),children:(0,d.jsx)(ye,{size:17})})]}),(0,d.jsxs)(`div`,{className:`ue-detail-action-group`,role:`group`,"aria-label":g(`detailReuse`),children:[(0,d.jsxs)(`button`,{className:`ue-toolbar-btn ue-toolbar-btn--label`,onClick:()=>void Bt(),"aria-label":g(`metadataCopyPositive`),...K(g(`metadataCopyPositive`)),children:[(0,d.jsx)(de,{size:17}),(0,d.jsx)(`span`,{children:g(`metadataCopyPositive`)})]}),(0,d.jsxs)(`button`,{className:`ue-toolbar-btn ue-toolbar-btn--label`,disabled:!xt,title:g(xt?`modalOpenWorkflow`:`detailNoWorkflow`),onClick:()=>void Me(e),"aria-label":g(`modalOpenWorkflow`),children:[(0,d.jsx)(o,{size:17}),(0,d.jsx)(`span`,{children:g(`modalOpenWorkflow`)})]})]}),(0,d.jsxs)(`div`,{className:`ue-detail-action-group`,role:`group`,"aria-label":g(`detailManage`),children:[(0,d.jsx)(`button`,{className:`ue-toolbar-btn ue-toolbar-btn--filled`,onClick:()=>void Y(),"aria-label":g(`modalSaveState`),...K(g(`modalSaveState`)),disabled:!q||D||y,children:(0,d.jsx)(c,{size:17})}),(0,d.jsx)(`button`,{className:`ue-toolbar-btn`,onClick:()=>N(`pinned`,!C),disabled:M,"aria-label":wt,...K(wt),children:(0,d.jsx)(ie,{size:17,fill:C?`currentColor`:`none`})})]}),(0,d.jsxs)(Ce,{label:g(`moreActions`),icon:(0,d.jsx)(`span`,{children:g(`moreActions`)}),className:`ue-detail-more`,children:[(0,d.jsxs)(`span`,{className:`ue-lightbox-zoom-indicator`,children:[Ct,`%`]}),m&&m.items.length>1?(0,d.jsx)(`button`,{className:`ue-toolbar-btn ${H?`is-active`:``}`,onClick:()=>ht(e=>!e),"aria-label":g(`imageFilmstripToggle`),title:g(`imageFilmstripToggle`),children:(0,d.jsx)(ke,{size:17})}):null,(0,d.jsxs)(`button`,{className:`ue-toolbar-btn`,onClick:()=>Qe(!0),"aria-label":g(`metadataView`),...K(g(`metadataView`)),children:[(0,d.jsx)(xe,{size:17}),(0,d.jsx)(`span`,{children:g(`metadataView`)})]}),(0,d.jsxs)(`button`,{className:`ue-toolbar-btn`,onClick:Dt,"aria-label":g(`modalFitImage`),...K(g(`modalFitImage`)),children:[(0,d.jsx)(Ae,{size:17}),(0,d.jsx)(`span`,{children:g(`modalFitImage`)})]}),(0,d.jsxs)(`button`,{className:`ue-toolbar-btn`,onClick:()=>Ot(Math.max(P,2)),"aria-label":g(`modalExpandImage`),...K(g(`modalExpandImage`)),children:[(0,d.jsx)(Oe,{size:17}),(0,d.jsx)(`span`,{children:g(`modalExpandImage`)})]}),v?(0,d.jsxs)(`button`,{className:`ue-toolbar-btn`,onClick:()=>void Le(e),"aria-label":g(`loraStackApply`),...K(g(`loraStackApply`)),children:[(0,d.jsx)(me,{size:17}),(0,d.jsx)(`span`,{children:g(`loraStackApply`)})]}):null,(0,d.jsxs)(`button`,{className:`ue-toolbar-btn`,onClick:()=>void Lt(),"aria-label":g(`modalRenameFile`),...K(g(`modalRenameFile`)),children:[(0,d.jsx)(oe,{size:17}),(0,d.jsx)(`span`,{children:g(`modalRenameFile`)})]}),(0,d.jsxs)(`button`,{className:`ue-toolbar-btn ue-toolbar-btn--danger`,onClick:()=>void Rt(),"aria-label":g(`modalDeleteFile`),...K(g(`modalDeleteFile`)),children:[(0,d.jsx)(re,{size:17}),(0,d.jsx)(`span`,{children:g(`modalDeleteFile`)})]}),(0,d.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,className:`ue-toolbar-btn`,"aria-label":g(`modalOpenFull`),...K(g(`modalOpenFull`)),children:[(0,d.jsx)(Se,{size:17}),(0,d.jsx)(`span`,{children:g(`modalOpenFull`)})]})]})]})]})}),document.body)};export{Le as ImageDetailModal}; \ No newline at end of file diff --git a/gallery_ui/dist/assets/ImageSearchModal-CH4E-SEH.js b/gallery_ui/dist/assets/ImageSearchModal-CH4E-SEH.js new file mode 100644 index 0000000..03db988 --- /dev/null +++ b/gallery_ui/dist/assets/ImageSearchModal-CH4E-SEH.js @@ -0,0 +1 @@ +import{a as e,n as t,r as n,s as r}from"./I18nProvider-DEfiLn3N.js";import{t as i}from"./image-plus-C8PYGAuQ.js";import{B as a,C as o,N as s,T as c,Y as l,et as u,st as d,ut as f,w as p}from"./index-CKow1Wte.js";var m=r(e(),1),h=n(),g=({initialFile:e,onClose:n,onOpenDetail:r,onLocate:g,suspended:_=!1})=>{let{t:v}=t(),{notify:y}=p(),[b,x]=(0,m.useState)(e??null),[S,C]=(0,m.useState)(``),[w,T]=(0,m.useState)(null),[E,D]=(0,m.useState)(!1),[O,k]=(0,m.useState)(``),[A,j]=(0,m.useState)(``),[M,N]=(0,m.useState)(!1),[P,F]=(0,m.useState)(0),I=(0,m.useRef)(null),L=(0,m.useRef)(null);f(!_,n,{closeOnResize:!1}),(0,m.useEffect)(()=>{e&&x(e)},[e]);let R=(0,m.useCallback)(e=>{e&&(!e.type.startsWith(`image/`)&&!/\.(png|jpe?g|webp|gif|bmp|tiff?)$/i.test(e.name)||e.size>20971520?j(v(`imageSearchInvalid`)):(x(e),F(e=>e+1)))},[v]);(0,m.useEffect)(()=>{if(_)return;let e=document.activeElement;L.current?.focus();let t=e=>{let t=[...e.clipboardData?.files??[]].find(e=>e.type.startsWith(`image/`));t&&(e.preventDefault(),R(t))},n=e=>{if(e.key!==`Tab`)return;let t=L.current?.querySelectorAll(`button:not(:disabled), input, a[href]`);if(!t?.length)return;let n=t[0],r=t[t.length-1];e.shiftKey&&(document.activeElement===n||document.activeElement===L.current)?(e.preventDefault(),r.focus()):e.shiftKey||document.activeElement!==r&&document.activeElement!==L.current||(e.preventDefault(),n.focus())};return window.addEventListener(`paste`,t),window.addEventListener(`keydown`,n),()=>{window.removeEventListener(`paste`,t),window.removeEventListener(`keydown`,n),e instanceof HTMLElement&&e.isConnected&&e.focus({preventScroll:!0})}},[R,_]),(0,m.useEffect)(()=>{if(!b)return;if(b.size>20971520){j(v(`imageSearchInvalid`)),D(!1);return}let e=URL.createObjectURL(b);return C(e),()=>URL.revokeObjectURL(e)},[b,v]),(0,m.useEffect)(()=>{if(!b||_||b.size>20971520)return;let e=new AbortController,t,n=()=>new Promise((n,r)=>{let i=()=>{window.clearTimeout(t),r(new DOMException(`Aborted`,`AbortError`))};e.signal.addEventListener(`abort`,i,{once:!0}),t=window.setTimeout(()=>{e.signal.removeEventListener(`abort`,i),n()},2e3)});return(async()=>{D(!0),j(``),k(v(`imageSearchSearching`));try{let t=await o.searchByImage(b,M?55:70,e.signal);if(e.signal.aborted)return;if(T(t),t.job){let r=t.job;for(;[`queued`,`running`,`cancelling`].includes(r.state);){for(k(v(`imageSearchIndexing`,{loaded:r.completed,total:r.total||t.total})),await n();document.visibilityState===`hidden`;)await n();r=(await o.getJob(r.id,e.signal)).job}if(r.state!==`succeeded`)throw Error(r.error||v(`imageSearchIndexFailed`));let i=await o.searchByImage(b,M?55:70,e.signal);e.signal.aborted||T(i)}}catch(t){e.signal.aborted||j(t instanceof Error?t.message:v(`imageSearchIndexFailed`))}finally{e.signal.aborted||(D(!1),k(``))}})(),()=>{e.abort(),window.clearTimeout(t)}},[b,M,P,v,_]);let z=async e=>{try{await navigator.clipboard.writeText(e),y(v(`imageSearchCopied`),`success`)}catch{y(v(`contextCopyError`),`error`)}};return(0,h.jsx)(d,{children:(0,h.jsx)(`div`,{className:`ue-modal-backdrop ue-image-search-backdrop`,style:_?{display:`none`}:void 0,"aria-hidden":_||void 0,onClick:e=>{e.stopPropagation(),n()},onDragOver:e=>{e.preventDefault(),e.stopPropagation()},onDrop:e=>{e.preventDefault(),e.stopPropagation(),R(e.dataTransfer.files[0])},children:(0,h.jsxs)(`section`,{ref:L,tabIndex:-1,className:`ue-image-search`,role:`dialog`,"aria-modal":!_||void 0,"aria-labelledby":`image-search-title`,onClick:e=>e.stopPropagation(),children:[(0,h.jsxs)(`header`,{children:[(0,h.jsxs)(`div`,{children:[(0,h.jsxs)(`h2`,{id:`image-search-title`,children:[(0,h.jsx)(l,{size:20}),v(`imageSearchTitle`)]}),(0,h.jsx)(`p`,{children:v(`imageSearchIntro`)})]}),(0,h.jsx)(`button`,{type:`button`,className:`ue-icon-action`,"aria-label":v(`imageSearchClose`),onClick:n,children:(0,h.jsx)(c,{size:18})})]}),(0,h.jsxs)(`div`,{className:`ue-image-search-body`,children:[(0,h.jsxs)(`aside`,{children:[(0,h.jsxs)(`button`,{type:`button`,className:`ue-image-search-drop`,onClick:()=>I.current?.click(),children:[S?(0,h.jsx)(`img`,{src:S,alt:v(`imageSearchReference`)}):(0,h.jsx)(i,{size:32}),(0,h.jsx)(`strong`,{children:v(S?`imageSearchReplace`:`imageSearchChoose`)}),(0,h.jsx)(`span`,{children:v(`imageSearchPaste`)})]}),(0,h.jsx)(`input`,{ref:I,type:`file`,accept:`image/*`,"aria-label":v(`imageSearchChoose`),hidden:!0,onChange:e=>{R(e.target.files?.[0]),e.target.value=``}}),b?(0,h.jsx)(`p`,{className:`ue-image-search-filename`,title:b.name,children:b.name}):null,(0,h.jsxs)(`label`,{className:`ue-image-search-broad`,children:[(0,h.jsx)(`input`,{type:`checkbox`,checked:M,onChange:e=>N(e.target.checked)}),v(`imageSearchBroader`)]}),(0,h.jsx)(`p`,{className:`ue-image-search-hint`,children:v(`imageSearchPrivacy`)}),(0,h.jsx)(`p`,{className:`ue-image-search-hint`,children:v(`imageSearchLimits`)})]}),(0,h.jsxs)(`main`,{children:[(0,h.jsx)(`div`,{role:`status`,"aria-live":`polite`,className:`ue-image-search-status`,children:E?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(a,{className:`ue-image-search-spin`,size:16}),O]}):w?v(`imageSearchCoverage`,{loaded:w.indexed,total:w.total,count:w.matches.length}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s,{size:17}),v(`imageSearchReady`)]})}),w?.failed?(0,h.jsx)(`p`,{className:`ue-image-search-hint`,children:v(`imageSearchFailedCount`,{count:w.failed})}):null,w?.pending&&!E?(0,h.jsx)(`p`,{className:`ue-image-search-hint`,children:v(`imageSearchPartial`)}):null,A?(0,h.jsxs)(`div`,{role:`alert`,className:`ue-inline-error`,children:[A,(0,h.jsx)(`button`,{type:`button`,className:`ue-secondary-action`,onClick:()=>F(e=>e+1),children:v(`imageSearchRetry`)})]}):null,w&&!E&&!w.matches.length?(0,h.jsx)(`p`,{className:`ue-image-search-empty`,children:v(`imageSearchEmpty`)}):null,(0,h.jsx)(`div`,{className:`ue-image-search-results`,children:w?.matches.map(e=>(0,h.jsxs)(`article`,{className:`ue-image-search-result`,children:[(0,h.jsx)(`button`,{type:`button`,className:`ue-image-search-thumb`,onClick:()=>{r(e.image,w.matches.map(e=>e.image))},"aria-label":`${v(`imageSearchView`)} ${e.image.filename}`,children:(0,h.jsx)(`img`,{src:e.image.thumb_url,alt:e.image.filename,loading:`lazy`})}),(0,h.jsxs)(`div`,{className:`ue-image-search-result-info`,children:[(0,h.jsx)(`span`,{className:`ue-image-search-match ${e.match_type===`exact`?`is-exact`:``}`,children:e.match_type===`exact`?v(`imageSearchExact`):v(`imageSearchScore`,{count:e.score})}),(0,h.jsx)(`strong`,{title:e.image.filename,children:e.image.filename}),(0,h.jsx)(`code`,{title:e.full_path,children:e.full_path}),(0,h.jsxs)(`div`,{className:`ue-image-search-actions`,children:[(0,h.jsxs)(`button`,{type:`button`,className:`ue-secondary-action`,onClick:()=>g(e.image),children:[(0,h.jsx)(l,{size:13}),v(`imageSearchLocate`)]}),(0,h.jsxs)(`button`,{type:`button`,className:`ue-secondary-action`,onClick:()=>void z(e.full_path),children:[(0,h.jsx)(u,{size:13}),v(`imageSearchCopyPath`)]})]})]})]},e.image.relative_path))})]})]})]})})})};export{g as ImageSearchModal}; \ No newline at end of file diff --git a/gallery_ui/dist/assets/ImageSearchModal-DZp0PXl_.js b/gallery_ui/dist/assets/ImageSearchModal-DZp0PXl_.js deleted file mode 100644 index 63a8b1c..0000000 --- a/gallery_ui/dist/assets/ImageSearchModal-DZp0PXl_.js +++ /dev/null @@ -1 +0,0 @@ -import{a as e,n as t,r as n,s as r}from"./I18nProvider-cZczvL7B.js";import{t as i}from"./image-plus-C2AXraiD.js";import{C as a,G as o,T as s,Y as c,it as l,j as u,st as d,ut as f,w as p}from"./index-DWGqjUOp.js";var m=r(e(),1),h=n(),g=({initialFile:e,onClose:n,onOpenDetail:r,onLocate:g,suspended:_=!1})=>{let{t:v}=t(),{notify:y}=p(),[b,x]=(0,m.useState)(e??null),[S,C]=(0,m.useState)(``),[w,T]=(0,m.useState)(null),[E,D]=(0,m.useState)(!1),[O,k]=(0,m.useState)(``),[A,j]=(0,m.useState)(``),[M,N]=(0,m.useState)(!1),[P,F]=(0,m.useState)(0),I=(0,m.useRef)(null),L=(0,m.useRef)(null);f(!_,n,{closeOnResize:!1}),(0,m.useEffect)(()=>{e&&x(e)},[e]);let R=(0,m.useCallback)(e=>{if(e){if(!e.type.startsWith(`image/`)&&!/\.(png|jpe?g|webp|gif|bmp|tiff?)$/i.test(e.name)||e.size>20*1024*1024){j(v(`imageSearchInvalid`));return}x(e),F(e=>e+1)}},[v]);(0,m.useEffect)(()=>{if(_)return;let e=document.activeElement;L.current?.focus();let t=e=>{let t=[...e.clipboardData?.files??[]].find(e=>e.type.startsWith(`image/`));t&&(e.preventDefault(),R(t))},n=e=>{if(e.key!==`Tab`)return;let t=L.current?.querySelectorAll(`button:not(:disabled), input, a[href]`);if(!t?.length)return;let n=t[0],r=t[t.length-1];e.shiftKey&&(document.activeElement===n||document.activeElement===L.current)?(e.preventDefault(),r.focus()):!e.shiftKey&&(document.activeElement===r||document.activeElement===L.current)&&(e.preventDefault(),n.focus())};return window.addEventListener(`paste`,t),window.addEventListener(`keydown`,n),()=>{window.removeEventListener(`paste`,t),window.removeEventListener(`keydown`,n),e instanceof HTMLElement&&e.isConnected&&e.focus({preventScroll:!0})}},[R,_]),(0,m.useEffect)(()=>{if(!b)return;if(b.size>20*1024*1024){j(v(`imageSearchInvalid`)),D(!1);return}let e=URL.createObjectURL(b);return C(e),()=>URL.revokeObjectURL(e)},[b,v]),(0,m.useEffect)(()=>{if(!b||_||b.size>20*1024*1024)return;let e=new AbortController,t,n=()=>new Promise((n,r)=>{let i=()=>{window.clearTimeout(t),r(new DOMException(`Aborted`,`AbortError`))};e.signal.addEventListener(`abort`,i,{once:!0}),t=window.setTimeout(()=>{e.signal.removeEventListener(`abort`,i),n()},2e3)});return(async()=>{D(!0),j(``),k(v(`imageSearchSearching`));try{let t=await a.searchByImage(b,M?55:70,e.signal);if(e.signal.aborted)return;if(T(t),t.job){let r=t.job;for(;[`queued`,`running`,`cancelling`].includes(r.state);){for(k(v(`imageSearchIndexing`,{loaded:r.completed,total:r.total||t.total})),await n();document.visibilityState===`hidden`;)await n();r=(await a.getJob(r.id,e.signal)).job}if(r.state!==`succeeded`)throw Error(r.error||v(`imageSearchIndexFailed`));let i=await a.searchByImage(b,M?55:70,e.signal);e.signal.aborted||T(i)}}catch(t){e.signal.aborted||j(t instanceof Error?t.message:v(`imageSearchIndexFailed`))}finally{e.signal.aborted||(D(!1),k(``))}})(),()=>{e.abort(),window.clearTimeout(t)}},[b,M,P,v,_]);let z=async e=>{try{await navigator.clipboard.writeText(e),y(v(`imageSearchCopied`),`success`)}catch{y(v(`contextCopyError`),`error`)}};return(0,h.jsx)(d,{children:(0,h.jsx)(`div`,{className:`ue-modal-backdrop ue-image-search-backdrop`,style:_?{display:`none`}:void 0,"aria-hidden":_||void 0,onClick:e=>{e.stopPropagation(),n()},onDragOver:e=>{e.preventDefault(),e.stopPropagation()},onDrop:e=>{e.preventDefault(),e.stopPropagation(),R(e.dataTransfer.files[0])},children:(0,h.jsxs)(`section`,{ref:L,tabIndex:-1,className:`ue-image-search`,role:`dialog`,"aria-modal":!_||void 0,"aria-labelledby":`image-search-title`,onClick:e=>e.stopPropagation(),children:[(0,h.jsxs)(`header`,{children:[(0,h.jsxs)(`div`,{children:[(0,h.jsxs)(`h2`,{id:`image-search-title`,children:[(0,h.jsx)(o,{size:20}),v(`imageSearchTitle`)]}),(0,h.jsx)(`p`,{children:v(`imageSearchIntro`)})]}),(0,h.jsx)(`button`,{type:`button`,className:`ue-icon-action`,"aria-label":v(`imageSearchClose`),onClick:n,children:(0,h.jsx)(s,{size:18})})]}),(0,h.jsxs)(`div`,{className:`ue-image-search-body`,children:[(0,h.jsxs)(`aside`,{children:[(0,h.jsxs)(`button`,{type:`button`,className:`ue-image-search-drop`,onClick:()=>I.current?.click(),children:[S?(0,h.jsx)(`img`,{src:S,alt:v(`imageSearchReference`)}):(0,h.jsx)(i,{size:32}),(0,h.jsx)(`strong`,{children:v(S?`imageSearchReplace`:`imageSearchChoose`)}),(0,h.jsx)(`span`,{children:v(`imageSearchPaste`)})]}),(0,h.jsx)(`input`,{ref:I,type:`file`,accept:`image/*`,"aria-label":v(`imageSearchChoose`),hidden:!0,onChange:e=>{R(e.target.files?.[0]),e.target.value=``}}),b?(0,h.jsx)(`p`,{className:`ue-image-search-filename`,title:b.name,children:b.name}):null,(0,h.jsxs)(`label`,{className:`ue-image-search-broad`,children:[(0,h.jsx)(`input`,{type:`checkbox`,checked:M,onChange:e=>N(e.target.checked)}),v(`imageSearchBroader`)]}),(0,h.jsx)(`p`,{className:`ue-image-search-hint`,children:v(`imageSearchPrivacy`)}),(0,h.jsx)(`p`,{className:`ue-image-search-hint`,children:v(`imageSearchLimits`)})]}),(0,h.jsxs)(`main`,{children:[(0,h.jsx)(`div`,{role:`status`,"aria-live":`polite`,className:`ue-image-search-status`,children:E?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(l,{className:`ue-image-search-spin`,size:16}),O]}):w?v(`imageSearchCoverage`,{loaded:w.indexed,total:w.total,count:w.matches.length}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(u,{size:17}),v(`imageSearchReady`)]})}),w?.failed?(0,h.jsx)(`p`,{className:`ue-image-search-hint`,children:v(`imageSearchFailedCount`,{count:w.failed})}):null,w?.pending&&!E?(0,h.jsx)(`p`,{className:`ue-image-search-hint`,children:v(`imageSearchPartial`)}):null,A?(0,h.jsxs)(`div`,{role:`alert`,className:`ue-inline-error`,children:[A,(0,h.jsx)(`button`,{type:`button`,className:`ue-secondary-action`,onClick:()=>F(e=>e+1),children:v(`imageSearchRetry`)})]}):null,w&&!E&&!w.matches.length?(0,h.jsx)(`p`,{className:`ue-image-search-empty`,children:v(`imageSearchEmpty`)}):null,(0,h.jsx)(`div`,{className:`ue-image-search-results`,children:w?.matches.map(e=>(0,h.jsxs)(`article`,{className:`ue-image-search-result`,children:[(0,h.jsx)(`button`,{type:`button`,className:`ue-image-search-thumb`,onClick:()=>{r(e.image,w.matches.map(e=>e.image))},"aria-label":`${v(`imageSearchView`)} ${e.image.filename}`,children:(0,h.jsx)(`img`,{src:e.image.thumb_url,alt:e.image.filename,loading:`lazy`})}),(0,h.jsxs)(`div`,{className:`ue-image-search-result-info`,children:[(0,h.jsx)(`span`,{className:`ue-image-search-match ${e.match_type===`exact`?`is-exact`:``}`,children:e.match_type===`exact`?v(`imageSearchExact`):v(`imageSearchScore`,{count:e.score})}),(0,h.jsx)(`strong`,{title:e.image.filename,children:e.image.filename}),(0,h.jsx)(`code`,{title:e.full_path,children:e.full_path}),(0,h.jsxs)(`div`,{className:`ue-image-search-actions`,children:[(0,h.jsxs)(`button`,{type:`button`,className:`ue-secondary-action`,onClick:()=>g(e.image),children:[(0,h.jsx)(o,{size:13}),v(`imageSearchLocate`)]}),(0,h.jsxs)(`button`,{type:`button`,className:`ue-secondary-action`,onClick:()=>void z(e.full_path),children:[(0,h.jsx)(c,{size:13}),v(`imageSearchCopyPath`)]})]})]})]},e.image.relative_path))})]})]})]})})})};export{g as ImageSearchModal}; \ No newline at end of file diff --git a/gallery_ui/dist/assets/LibraryWorkspace-CPcrzo6d.js b/gallery_ui/dist/assets/LibraryWorkspace-CPcrzo6d.js new file mode 100644 index 0000000..a3c50b4 --- /dev/null +++ b/gallery_ui/dist/assets/LibraryWorkspace-CPcrzo6d.js @@ -0,0 +1,3 @@ +import{a as e,i as t,n,r,s as i}from"./I18nProvider-DEfiLn3N.js";import{t as a}from"./boxes-GTo8RUgH.js";import{t as o}from"./copy-CoBcvjUE.js";import{t as s}from"./download-CSrVSIDj.js";import{t as c}from"./refresh-ccw-bV8xzBtF.js";import{t as l}from"./save-DQG0Zsqx.js";import{t as u}from"./sparkles-elJjV352.js";import{t as d}from"./wand-sparkles-262S5lQG.js";import{$ as f,D as p,F as m,H as h,N as g,R as _,T as v,V as ee,Z as y,_ as te,at as ne,f as re,lt as ie,nt as ae,st as oe,tt as se,ut as ce,v as b,y as le}from"./index-CKow1Wte.js";var ue=t(`file-plus-corner`,[[`path`,{d:`M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35`,key:`17jvcc`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 19h6`,key:`bvotb8`}],[`path`,{d:`M17 16v6`,key:`18yu1i`}]]),x=t(`file-up`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]),S=t(`git-merge`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]),de=t(`tags`,[[`path`,{d:`M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z`,key:`16rjxf`}],[`path`,{d:`M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193`,key:`178nd4`}],[`circle`,{cx:`10.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`12ikhr`}]]),C=i(e(),1),w=r(),fe=({open:e,title:t,initialEntry:r,templates:i=[],isSubmitting:a,onClose:o,onSave:s,onDelete:c})=>{let{t:d}=n(),{pushToast:f}=re(),[m,h]=(0,C.useState)(()=>JSON.stringify(r??{},null,2));return e?(0,w.jsx)(`div`,{className:`ue-modal-backdrop`,onClick:o,children:(0,w.jsxs)(`div`,{className:`ue-library-modal ue-library-modal--wide`,onClick:e=>e.stopPropagation(),children:[(0,w.jsx)(`button`,{className:`ue-modal-close ue-modal-close--light`,onClick:o,"aria-label":d(`modalClose`),children:(0,w.jsx)(v,{size:18})}),(0,w.jsxs)(`div`,{className:`ue-pane-copy`,children:[(0,w.jsx)(`p`,{className:`ue-pane-kicker`,children:d(`libraryDetail`)}),(0,w.jsx)(`h2`,{children:t}),(0,w.jsx)(`p`,{children:d(`libraryEntryEditorHint`)})]}),i.length?(0,w.jsxs)(`section`,{className:`ue-library-template-panel`,children:[(0,w.jsxs)(`div`,{className:`ue-library-guide-head`,children:[(0,w.jsx)(u,{size:15}),(0,w.jsx)(`strong`,{children:d(`libraryTemplatePanelTitle`)})]}),(0,w.jsx)(`div`,{className:`ue-library-template-grid`,children:i.map(e=>(0,w.jsxs)(`button`,{className:`ue-library-template-card`,onClick:()=>h(JSON.stringify(e.entry,null,2)),type:`button`,children:[(0,w.jsx)(`strong`,{children:e.label}),(0,w.jsx)(`span`,{children:e.description})]},e.id))})]}):null,(0,w.jsxs)(`div`,{className:`ue-library-field-guide-inline`,children:[(0,w.jsx)(`span`,{children:`name`}),(0,w.jsx)(`span`,{children:`prompt`}),(0,w.jsx)(`span`,{children:`other_names`}),(0,w.jsx)(`span`,{children:`tags`}),(0,w.jsx)(`span`,{children:`model`}),(0,w.jsx)(`span`,{children:`description`})]}),(0,w.jsx)(`textarea`,{className:`ue-library-entry-editor`,value:m,onChange:e=>h(e.target.value)}),(0,w.jsxs)(`div`,{className:`ue-library-modal-actions`,children:[c?(0,w.jsx)(`button`,{className:`ue-icon-action ue-icon-action--danger`,onClick:async()=>{await c()&&o()},disabled:a,"aria-label":d(`commonDelete`),title:d(`commonDelete`),children:(0,w.jsx)(p,{size:14})}):null,(0,w.jsx)(`button`,{className:`ue-icon-action`,onClick:o,"aria-label":d(`libraryCancel`),title:d(`libraryCancel`),children:(0,w.jsx)(v,{size:14})}),(0,w.jsx)(`button`,{className:`ue-icon-action ue-icon-action--filled`,disabled:a,"aria-label":d(`librarySave`),title:d(`librarySave`),onClick:async()=>{try{await s(JSON.parse(m))&&o()}catch(e){f(e instanceof Error?e.message:d(`errorJsonInvalid`),`error`)}},children:(0,w.jsx)(l,{size:14})})]})]})}):null},T=[{mode:`create`,icon:x},{mode:`replace`,icon:c},{mode:`merge`,icon:S}],pe=({open:e,libraries:t,activeLibraryName:r,initialFile:i=null,isSubmitting:a,onClose:o,onImport:s})=>{let{t:c}=n(),[l,u]=(0,C.useState)(null),[d,f]=(0,C.useState)(`create`),[p,m]=(0,C.useState)(``),[h,g]=(0,C.useState)(``);(0,C.useEffect)(()=>{e&&(f(`create`),u(i),m(r||t[0]?.filename||``),g(``))},[r,i,t,e]);let _=d===`replace`||d===`merge`,ee=(0,C.useMemo)(()=>!(!l||_&&!p.trim()),[l,_,p]);return e?(0,w.jsx)(`div`,{className:`ue-modal-backdrop`,onClick:o,children:(0,w.jsxs)(`div`,{className:`ue-library-modal`,onClick:e=>e.stopPropagation(),children:[(0,w.jsx)(`button`,{className:`ue-modal-close ue-modal-close--light`,onClick:o,"aria-label":c(`modalClose`),children:(0,w.jsx)(v,{size:18})}),(0,w.jsxs)(`div`,{className:`ue-pane-copy`,children:[(0,w.jsx)(`p`,{className:`ue-pane-kicker`,children:c(`libraryImport`)}),(0,w.jsx)(`h2`,{children:c(`libraryImportTitle`)}),(0,w.jsx)(`p`,{children:c(`libraryImportText`)})]}),(0,w.jsx)(`div`,{className:`ue-import-mode-grid`,children:T.map(({mode:e,icon:t})=>(0,w.jsxs)(`button`,{className:`ue-import-mode-card ${d===e?`active`:``}`,onClick:()=>f(e),children:[(0,w.jsx)(t,{size:15}),(0,w.jsx)(`strong`,{children:c(`libraryImportMode${e[0].toUpperCase()}${e.slice(1)}`)})]},e))}),(0,w.jsxs)(`label`,{className:`ue-import-file-field`,children:[(0,w.jsx)(`span`,{children:c(`libraryImportFile`)}),(0,w.jsx)(`input`,{type:`file`,accept:`.json,application/json`,onChange:e=>u(e.target.files?.[0]??null)}),(0,w.jsx)(`em`,{children:l?.name||c(`libraryImportFileEmpty`)})]}),d===`create`?(0,w.jsxs)(`label`,{className:`ue-import-text-field`,children:[(0,w.jsx)(`span`,{children:c(`libraryImportNewName`)}),(0,w.jsx)(`input`,{value:h,onChange:e=>g(e.target.value),placeholder:`artists-new.json`})]}):(0,w.jsxs)(`label`,{className:`ue-import-text-field`,children:[(0,w.jsx)(`span`,{children:c(`libraryImportTarget`)}),(0,w.jsxs)(`select`,{value:p,onChange:e=>m(e.target.value),children:[(0,w.jsx)(`option`,{value:``,children:c(`libraryImportChooseTarget`)}),t.map(e=>(0,w.jsx)(`option`,{value:e.filename,children:e.filename},e.filename))]})]}),(0,w.jsxs)(`div`,{className:`ue-library-modal-actions`,children:[(0,w.jsx)(`button`,{className:`ue-icon-action`,onClick:o,"aria-label":c(`libraryCancel`),title:c(`libraryCancel`),children:(0,w.jsx)(v,{size:14})}),(0,w.jsx)(`button`,{className:`ue-icon-action ue-icon-action--filled`,disabled:!ee||a,"aria-label":c(`libraryImportConfirm`),title:c(`libraryImportConfirm`),onClick:async()=>{l&&await s(l,d,p,h)&&o()},children:(0,w.jsx)(x,{size:14})})]})]})}):null},E=`universal-extractor:library-view-mode`,me=(e,t)=>{let n=b(e);return n===`grid`||n===`list`?n:t},D=e=>Array.isArray(e)?e.filter(Boolean):typeof e==`string`&&e.trim()?e.split(/[,/]/).map(e=>e.trim()).filter(Boolean):[],O=({libraries:e,onSelectLibrary:t,onCreateLibrary:r,activeLibraryName:i,entries:c,page:b,totalPages:S,totalEntries:T,editorValue:O,isEditing:k,isDirty:A,isLoading:he,isRefreshing:ge,isSubmitting:j,error:M,statusMessage:N,validationIssues:_e,canUseRawEditor:ve,searchTerm:P,onSearchClear:ye,onEditorValueChange:be,onPageChange:F,onStartEditing:xe,onCancelEditing:Se,onFormatEditor:Ce,onSaveLibrary:we,onRefresh:Te,onExportLibrary:Ee,onImportLibrary:De,onSaveEntry:Oe,onDeleteEntry:ke})=>{let{t:I}=n(),{confirm:L}=te(),{pushToast:R}=re(),[Ae,z]=(0,C.useState)(!1),[je,B]=(0,C.useState)(null),[Me,V]=(0,C.useState)(!1),[H,Ne]=(0,C.useState)(null),[U,Pe]=(0,C.useState)(null),[W,Fe]=(0,C.useState)(()=>me(E,`list`)),[G,K]=(0,C.useState)(null),q=(0,C.useRef)(null),J=(0,C.useRef)(null),Y=(0,C.useRef)(0),Ie=(0,C.useMemo)(()=>{let e=Math.max(O.split(` +`).length,1);return Array.from({length:e},(e,t)=>t+1).join(` +`)},[O]);(0,C.useEffect)(()=>{le(E,W)},[W]);let Le=(0,C.useCallback)(()=>K(null),[]);ce(!!G,Le,{closeOnContextMenu:!0,closeOnScroll:!0});let Re=(0,C.useMemo)(()=>[{id:`artist`,label:I(`libraryTemplateArtist`),description:I(`libraryTemplateArtistHint`),entry:{name:`tapioka_(coconuts)`,title:`Tapioka`,prompt:`tapioka_(coconuts)`,other_names:[`tapioka`],post_count:3200,tags:[`artist`,`soft-light`,`anime`],model:`Pony / SDXL`,description:I(`libraryTemplateArtistDescription`)}},{id:`style`,label:I(`libraryTemplateStyle`),description:I(`libraryTemplateStyleHint`),entry:{title:`Dreamy pastel portrait`,prompt:`pastel lighting, soft bloom, clean lineart, airy composition`,tags:[`style`,`portrait`,`pastel`],model:`SDXL`,description:I(`libraryTemplateStyleDescription`)}},{id:`character`,label:I(`libraryTemplateCharacter`),description:I(`libraryTemplateCharacterHint`),entry:{title:`Original sleepy hoodie girl`,prompt:`sleepy girl, oversized monster hoodie, cross necklace, wink`,other_names:[`hoodie girl`],tags:[`character`,`original`,`hoodie`],description:I(`libraryTemplateCharacterDescription`)}}],[I]),ze=(0,C.useMemo)(()=>[{label:`name`,value:I(`libraryFieldNameHint`)},{label:`prompt`,value:I(`libraryFieldPromptHint`)},{label:`other_names`,value:I(`libraryFieldAliasHint`)},{label:`tags`,value:I(`libraryFieldTagsHint`)},{label:`model`,value:I(`libraryFieldModelHint`)},{label:`description`,value:I(`libraryFieldDescriptionHint`)}],[I]),Be=(0,C.useMemo)(()=>[I(`libraryGuideStepOne`),I(`libraryGuideStepTwo`),I(`libraryGuideStepThree`),I(`libraryGuideStepFour`)],[I]),X=(0,C.useMemo)(()=>{let e=c.filter(e=>D(e.other_names).length>0).length,t=c.filter(e=>typeof e.prompt==`string`&&e.prompt.trim()).length,n=c.filter(e=>typeof e.model==`string`&&e.model.trim()).length,r=c.filter(e=>typeof e.description==`string`&&e.description.trim()).length,i=new Map,a=new Map;c.forEach(e=>{if(D(e.tags).forEach(e=>{i.set(e,(i.get(e)??0)+1)}),typeof e.model==`string`&&e.model.trim()){let t=e.model.trim();a.set(t,(a.get(t)??0)+1)}});let o=[...i.entries()].sort((e,t)=>t[1]-e[1]).slice(0,6),s=[...a.entries()].sort((e,t)=>t[1]-e[1]).slice(0,4);return{aliasEntries:e,promptEntries:t,modelEntries:n,describedEntries:r,uniqueTags:i.size,topTags:o,topModels:s}},[c]),Ve=(e,t)=>String(e.title||e.name||e.prompt||`${I(`libraryDetail`)} ${t+1}`),He=e=>typeof e.prompt==`string`&&e.prompt.trim()?e.prompt:Array.isArray(e.other_names)&&e.other_names.length?e.other_names.slice(0,4).join(` · `):typeof e.other_names==`string`&&e.other_names.trim()?e.other_names:typeof e.description==`string`&&e.description.trim()?e.description:``,Ue=e=>String(e.prompt||e.name||e.title||``).trim(),Z=async(e,t)=>{try{await navigator.clipboard.writeText(e),R(t,`success`)}catch{R(I(`contextCopyError`),`error`)}},We=async e=>{e&&(e.name.toLowerCase().endsWith(`.json`)||e.type.includes(`json`)?await L({title:I(`libraryImport`),message:I(`libraryImportConfirmAsk`,{name:e.name}),tone:`info`,confirmLabel:I(`libraryImport`),cancelLabel:I(`libraryCancel`)})&&(B(e),z(!0)):R(I(`errorImportLibrary`),`error`))},Q=(e,t=null)=>{Ne(t),Pe(e)},Ge=(e,t,n)=>{e.preventDefault(),e.stopPropagation();let r=ie(e,{width:220,height:240},`pointer`);K({entry:t,index:n,x:r.x,y:r.y})},$=async e=>{await L({title:I(`commonDelete`),message:I(`libraryDeleteEntryConfirm`),tone:`warning`,confirmLabel:I(`commonDelete`),cancelLabel:I(`libraryCancel`)})&&await ke(e)&&R(I(`commonDelete`),`success`)},Ke=e=>{let t=Number(e.get(`page`));if(!Number.isFinite(t))return;let n=Math.min(Math.max(1,Math.trunc(t)),S);n!==b&&F(n)};return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(`section`,{className:`ue-workspace ue-animate-in ${Me?`is-dragging-library`:``}`,"data-tour-id":`library-workspace`,onDragEnter:e=>{e.preventDefault(),Y.current+=1,V(!0)},onDragOver:e=>e.preventDefault(),onDragLeave:e=>{e.preventDefault(),--Y.current,Y.current<=0&&(Y.current=0,V(!1))},onDrop:e=>{e.preventDefault(),Y.current=0,V(!1);let t=e.dataTransfer.files?.[0]??null;We(t)},children:[(0,w.jsxs)(`div`,{className:`ue-pane-header`,children:[(0,w.jsxs)(`div`,{className:`ue-pane-copy`,children:[(0,w.jsx)(`p`,{className:`ue-pane-kicker`,children:I(`sidebarLibraries`)}),(0,w.jsx)(`h2`,{children:i||I(`sidebarLibraries`)}),(0,w.jsx)(`p`,{children:i?I(`libraryWorkspaceSubtitle`,{count:T,name:i}):I(`libraryWorkspaceIntro`)})]}),(0,w.jsxs)(`div`,{className:`ue-library-actions ${i?``:`is-empty`}`,"data-tour-id":`library-actions`,children:[(0,w.jsxs)(`div`,{className:`ue-segmented-control ue-segmented-control--compact ue-view-toggle`,"aria-label":I(`viewMode`),children:[(0,w.jsxs)(`button`,{className:W===`grid`?`active`:``,onClick:()=>Fe(`grid`),type:`button`,"aria-label":I(`viewGrid`),title:I(`viewGrid`),children:[(0,w.jsx)(h,{size:13}),(0,w.jsx)(`span`,{children:I(`viewGrid`)})]}),(0,w.jsxs)(`button`,{className:W===`list`?`active`:``,onClick:()=>Fe(`list`),type:`button`,"aria-label":I(`viewList`),title:I(`viewList`),children:[(0,w.jsx)(ee,{size:13}),(0,w.jsx)(`span`,{children:I(`viewList`)})]})]}),(0,w.jsx)(`input`,{ref:J,className:`ue-hidden-input`,type:`file`,accept:`.json,application/json`,onChange:e=>void We(e.target.files?.[0]??null)}),(0,w.jsxs)(`button`,{className:`ue-icon-action`,onClick:()=>J.current?.click(),"aria-label":I(`libraryAddFile`),title:I(`libraryAddFile`),children:[(0,w.jsx)(x,{size:14}),(0,w.jsx)(`span`,{children:I(`libraryAddFile`)})]}),(0,w.jsx)(`button`,{className:`ue-icon-action`,onClick:()=>{B(null),z(!0)},"aria-label":I(`libraryImport`),title:I(`libraryImport`),children:(0,w.jsx)(s,{size:14})}),(0,w.jsx)(`button`,{className:`ue-icon-action`,onClick:Te,"aria-label":I(`navRefresh`),title:I(`navRefresh`),children:(0,w.jsx)(m,{size:14})}),(0,w.jsx)(`button`,{className:`ue-icon-action`,onClick:Ee,disabled:!i,"aria-label":I(`libraryExport`),title:I(`libraryExport`),children:(0,w.jsx)(s,{size:14})}),(0,w.jsx)(`button`,{className:`ue-icon-action`,onClick:()=>Q(Re[0].entry,null),disabled:!i,"aria-label":I(`libraryStarterTemplate`),title:I(`libraryStarterTemplate`),children:(0,w.jsx)(u,{size:14})}),(0,w.jsxs)(`button`,{className:`ue-icon-action`,onClick:()=>Q({},null),disabled:!i,"aria-label":I(`libraryAddEntry`),title:I(`libraryAddEntry`),children:[(0,w.jsx)(ue,{size:14}),(0,w.jsx)(`span`,{children:I(`libraryAddEntry`)})]}),k&&ve?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`button`,{className:`ue-icon-action`,onClick:Ce,"aria-label":I(`libraryFormat`),title:I(`libraryFormat`),children:(0,w.jsx)(d,{size:14})}),(0,w.jsxs)(`button`,{className:`ue-icon-action ue-icon-action--filled`,onClick:we,disabled:j,"aria-label":I(`librarySave`),title:I(`librarySave`),children:[(0,w.jsx)(l,{size:14}),(0,w.jsx)(`span`,{children:I(`librarySave`)})]}),(0,w.jsx)(`button`,{className:`ue-icon-action`,onClick:Se,"aria-label":I(`libraryCancel`),title:I(`libraryCancel`),children:(0,w.jsx)(v,{size:14})})]}):ve?(0,w.jsx)(`button`,{className:`ue-icon-action`,onClick:xe,disabled:!i,"aria-label":I(`libraryEdit`),title:I(`libraryEdit`),children:(0,w.jsx)(_,{size:14})}):(0,w.jsx)(`span`,{className:`ue-editor-status`,children:I(`libraryLargeEditHint`)})]})]}),k?(0,w.jsxs)(`div`,{className:`ue-editor-meta`,children:[(0,w.jsx)(`span`,{className:`ue-editor-status ${A?`is-dirty`:``}`,children:I(A?`libraryUnsavedChanges`:`librarySavedState`)}),ge?(0,w.jsx)(`span`,{className:`ue-editor-status`,children:I(`commonLoading`)}):null]}):null,N?(0,w.jsx)(`div`,{className:`ue-inline-success`,children:N}):null,M?(0,w.jsx)(`div`,{className:`ue-inline-error`,children:M}):null,_e.length>0?(0,w.jsxs)(`div`,{className:`ue-validation-panel`,children:[(0,w.jsx)(`strong`,{children:I(`libraryValidationTitle`)}),(0,w.jsx)(`div`,{className:`ue-validation-list`,children:_e.map((e,t)=>(0,w.jsxs)(`p`,{children:[e.index===null?I(`libraryValidationGlobal`):`#${e.index+1}`,` · `,e.message]},`${e.index}-${e.field}-${t}`))})]}):null,i?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(`div`,{className:`ue-library-overview-grid`,children:[(0,w.jsxs)(`article`,{className:`ue-library-overview-card`,children:[(0,w.jsx)(`span`,{children:I(`libraryOverviewEntries`)}),(0,w.jsx)(`strong`,{children:T}),(0,w.jsx)(`p`,{children:I(`libraryOverviewEntriesHint`)})]}),(0,w.jsxs)(`article`,{className:`ue-library-overview-card`,children:[(0,w.jsx)(`span`,{children:I(`libraryOverviewAliases`)}),(0,w.jsx)(`strong`,{children:X.aliasEntries}),(0,w.jsx)(`p`,{children:I(`libraryOverviewAliasesHint`)})]}),(0,w.jsxs)(`article`,{className:`ue-library-overview-card`,children:[(0,w.jsx)(`span`,{children:I(`libraryOverviewTags`)}),(0,w.jsx)(`strong`,{children:X.uniqueTags}),(0,w.jsx)(`p`,{children:I(`libraryOverviewTagsHint`)})]}),(0,w.jsxs)(`article`,{className:`ue-library-overview-card`,children:[(0,w.jsx)(`span`,{children:I(`libraryOverviewModels`)}),(0,w.jsx)(`strong`,{children:X.modelEntries}),(0,w.jsx)(`p`,{children:I(`libraryOverviewModelsHint`)})]})]}),(0,w.jsxs)(`div`,{className:`ue-library-guidance-grid`,children:[(0,w.jsxs)(`article`,{className:`ue-library-guide-card`,children:[(0,w.jsxs)(`div`,{className:`ue-library-guide-head`,children:[(0,w.jsx)(u,{size:16}),(0,w.jsx)(`strong`,{children:I(`libraryGuideTitle`)})]}),(0,w.jsx)(`div`,{className:`ue-library-guide-steps`,children:Be.map((e,t)=>(0,w.jsxs)(`div`,{className:`ue-library-guide-step`,children:[(0,w.jsx)(`span`,{children:t+1}),(0,w.jsx)(`p`,{children:e})]},`${e}-${t}`))})]}),(0,w.jsxs)(`article`,{className:`ue-library-guide-card`,children:[(0,w.jsxs)(`div`,{className:`ue-library-guide-head`,children:[(0,w.jsx)(a,{size:16}),(0,w.jsx)(`strong`,{children:I(`libraryFieldGuideTitle`)})]}),(0,w.jsx)(`div`,{className:`ue-library-guide-fields`,children:ze.map(e=>(0,w.jsxs)(`div`,{className:`ue-library-guide-field`,children:[(0,w.jsx)(`span`,{children:e.label}),(0,w.jsx)(`p`,{children:e.value})]},e.label))})]})]}),(0,w.jsxs)(`div`,{className:`ue-library-search-summary`,children:[(0,w.jsxs)(`div`,{className:`ue-library-search-copy`,children:[(0,w.jsxs)(`div`,{className:`ue-library-guide-head`,children:[(0,w.jsx)(g,{size:15}),(0,w.jsx)(`strong`,{children:P.trim()?I(`librarySearchActive`,{name:P}):I(`librarySearchReady`)})]}),(0,w.jsx)(`p`,{children:I(`librarySearchHint`)})]}),P.trim()?(0,w.jsx)(`button`,{className:`ue-icon-action`,onClick:ye,"aria-label":I(`librarySearchClear`),title:I(`librarySearchClear`),children:(0,w.jsx)(v,{size:14})}):null]}),X.topTags.length||X.topModels.length?(0,w.jsxs)(`div`,{className:`ue-library-signal-grid`,children:[(0,w.jsxs)(`article`,{className:`ue-library-signal-card`,children:[(0,w.jsxs)(`div`,{className:`ue-library-guide-head`,children:[(0,w.jsx)(de,{size:15}),(0,w.jsx)(`strong`,{children:I(`libraryTopTags`)})]}),(0,w.jsx)(`div`,{className:`ue-library-token-list`,children:X.topTags.length?X.topTags.map(([e,t])=>(0,w.jsxs)(`span`,{className:`ue-library-token`,children:[e,` · `,t]},`${e}-${t}`)):(0,w.jsx)(`span`,{className:`ue-library-token ue-library-token--muted`,children:I(`libraryNoTagsYet`)})})]}),(0,w.jsxs)(`article`,{className:`ue-library-signal-card`,children:[(0,w.jsxs)(`div`,{className:`ue-library-guide-head`,children:[(0,w.jsx)(ne,{size:15}),(0,w.jsx)(`strong`,{children:I(`libraryTopModels`)})]}),(0,w.jsx)(`div`,{className:`ue-library-token-list`,children:X.topModels.length?X.topModels.map(([e,t])=>(0,w.jsxs)(`span`,{className:`ue-library-token`,children:[e,` · `,t]},`${e}-${t}`)):(0,w.jsx)(`span`,{className:`ue-library-token ue-library-token--muted`,children:I(`libraryNoModelsYet`)})})]})]}):null]}):(0,w.jsxs)(`div`,{className:`ue-gallery-state ue-gallery-state--empty`,children:[(0,w.jsx)(y,{size:38,strokeWidth:1.1}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`h3`,{children:I(`librarySelectTitle`)}),(0,w.jsx)(`p`,{children:I(`librarySelectInlineHint`)}),(0,w.jsxs)(`div`,{className:`ue-library-empty-actions`,children:[(0,w.jsxs)(`label`,{children:[I(`librarySelectTitle`),(0,w.jsxs)(`select`,{"aria-label":I(`librarySelectTitle`),disabled:!e.length,value:``,onChange:e=>t?.(e.target.value),children:[(0,w.jsx)(`option`,{value:``,disabled:!0,children:I(`librarySelectTitle`)}),e.map(e=>(0,w.jsx)(`option`,{value:e.filename,children:e.filename},e.filename))]})]}),r&&(0,w.jsxs)(`button`,{className:`ue-secondary-action`,onClick:r,children:[(0,w.jsx)(ue,{size:15}),I(`libraryCreateInline`)]}),(0,w.jsxs)(`button`,{className:`ue-secondary-action`,onClick:()=>J.current?.click(),children:[(0,w.jsx)(x,{size:15}),I(`libraryImport`)]})]})]})]}),i?he&&c.length===0?(0,w.jsxs)(`div`,{className:`ue-gallery-state`,children:[(0,w.jsx)(`div`,{className:`ue-loading-orb`}),(0,w.jsx)(`p`,{children:I(`libraryLoading`)})]}):k?(0,w.jsxs)(`div`,{className:`ue-json-shell`,children:[(0,w.jsx)(`pre`,{className:`ue-json-gutter`,ref:q,"aria-hidden":`true`,children:Ie}),(0,w.jsx)(`textarea`,{className:`ue-json-editor`,value:O,onChange:e=>be(e.target.value),onScroll:e=>{q.current&&(q.current.scrollTop=e.currentTarget.scrollTop)}})]}):i&&c.length===0?(0,w.jsxs)(`div`,{className:`ue-gallery-state ue-gallery-state--empty`,children:[(0,w.jsx)(ne,{size:38,strokeWidth:1.1}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`h3`,{children:I(`libraryEmptyTitle`)}),(0,w.jsx)(`p`,{children:I(`libraryEmptyText`)})]})]}):i?(0,w.jsxs)(`div`,{className:`ue-library-listing ${W===`grid`?`ue-library-listing--grid`:``}`,children:[c.map((e,t)=>{let n=e.source_index,r=He(e),a=D(e.other_names),s=D(e.tags),c=Ue(e);return(0,w.jsxs)(`article`,{className:`ue-library-row`,onContextMenu:t=>Ge(t,e,n),children:[(0,w.jsxs)(`div`,{className:`ue-library-row-index`,children:[`#`,String(n+1).padStart(2,`0`)]}),(0,w.jsxs)(`div`,{className:`ue-library-row-main`,children:[(0,w.jsxs)(`div`,{className:`ue-library-row-heading`,children:[(0,w.jsx)(`h3`,{children:Ve(e,n)}),(0,w.jsxs)(`div`,{className:`ue-library-inline-chips`,children:[e.model?(0,w.jsx)(`span`,{className:`ue-library-token`,children:e.model}):null,typeof e.post_count==`number`?(0,w.jsxs)(`span`,{className:`ue-library-token`,children:[e.post_count,` posts`]}):null,c?(0,w.jsx)(`span`,{className:`ue-library-token`,children:I(`libraryReadyToCopy`)}):null]})]}),r?(0,w.jsx)(`p`,{className:`ue-library-row-preview`,children:r}):null,a.length?(0,w.jsx)(`div`,{className:`ue-library-inline-chips`,children:a.slice(0,6).map(t=>(0,w.jsx)(`span`,{className:`ue-library-token ue-library-token--soft`,children:t},`${e.source_index}-${t}`))}):null,s.length?(0,w.jsx)(`div`,{className:`ue-library-inline-chips`,children:s.slice(0,8).map(t=>(0,w.jsxs)(`span`,{className:`ue-library-token ue-library-token--subtle`,children:[`#`,t]},`${e.source_index}-${t}`))}):null,e.description&&r!==e.description?(0,w.jsx)(`p`,{className:`ue-library-row-description`,children:e.description}):null]}),(0,w.jsxs)(`div`,{className:`ue-library-row-side`,children:[(0,w.jsx)(`span`,{children:I(`libraryEntryStatus`,{count:t+1})}),(0,w.jsxs)(`div`,{className:`ue-library-row-actions`,children:[(0,w.jsx)(`button`,{className:`ue-library-row-action`,onClick:()=>Q(e,n),"aria-label":I(`libraryEdit`),title:I(`libraryEdit`),children:(0,w.jsx)(_,{size:13})}),(0,w.jsx)(`button`,{className:`ue-library-row-action`,onClick:()=>void Z(JSON.stringify(e,null,2),I(`libraryCopyJsonSuccess`)),"aria-label":I(`libraryCopyJson`),title:I(`libraryCopyJson`),children:(0,w.jsx)(y,{size:13})}),(0,w.jsx)(`button`,{className:`ue-library-row-action`,onClick:()=>void Z(c||JSON.stringify(e,null,2),I(`artistCopyResult`)),"aria-label":I(`libraryCopyPrompt`),title:I(`libraryCopyPrompt`),children:(0,w.jsx)(o,{size:13})}),(0,w.jsx)(`button`,{className:`ue-library-row-action ue-library-row-action--danger`,onClick:()=>void $(n),"aria-label":I(`commonDelete`),title:I(`commonDelete`),children:(0,w.jsx)(p,{size:13})})]})]})]},`${i}-${e.source_index}-${t}`)}),S>1?(0,w.jsxs)(`div`,{className:`ue-pagination ue-pagination--library`,children:[(0,w.jsxs)(`div`,{className:`ue-pagination-meta`,children:[(0,w.jsx)(`span`,{children:I(`galleryPage`,{page:b,totalPages:S})}),(0,w.jsx)(`i`,{"aria-hidden":`true`,children:`·`}),(0,w.jsx)(`span`,{children:I(`commonEntries`,{count:T})})]}),(0,w.jsxs)(`div`,{className:`ue-pagination-actions`,children:[(0,w.jsx)(`button`,{disabled:b<=1,onClick:()=>F(Math.max(1,b-1)),"aria-label":I(`galleryPrevious`),title:I(`galleryPrevious`),children:(0,w.jsx)(ae,{size:14})}),(0,w.jsx)(`button`,{disabled:b>=S,onClick:()=>F(Math.min(S,b+1)),"aria-label":I(`galleryNext`),title:I(`galleryNext`),children:(0,w.jsx)(se,{size:14})}),(0,w.jsxs)(`form`,{className:`ue-pagination-jump`,onSubmit:e=>{e.preventDefault(),Ke(new FormData(e.currentTarget))},children:[(0,w.jsxs)(`label`,{className:`ue-select-field ue-pagination-jump-field`,children:[(0,w.jsx)(`span`,{children:I(`galleryJumpTo`)}),(0,w.jsx)(`input`,{name:`page`,type:`number`,min:1,max:S,defaultValue:b,"aria-label":I(`galleryJumpTo`)})]}),(0,w.jsx)(`button`,{type:`submit`,"aria-label":I(`galleryJump`),title:I(`galleryJump`),children:(0,w.jsx)(f,{size:14})})]},b)]})]}):null]}):null:null,Me?(0,w.jsx)(`div`,{className:`ue-drop-overlay ue-drop-overlay--inline`,children:(0,w.jsxs)(`div`,{className:`ue-drop-overlay-card`,children:[(0,w.jsx)(`h3`,{children:I(`libraryDropTitle`)}),(0,w.jsx)(`p`,{children:I(`libraryDropText`)})]})}):null]}),(0,w.jsx)(pe,{open:Ae,libraries:e,activeLibraryName:i,initialFile:je,isSubmitting:j,onClose:()=>{z(!1),B(null)},onImport:De}),(0,w.jsx)(fe,{open:U!==null,title:H===null?I(`libraryAddEntry`):`${I(`libraryDetail`)} #${(H??0)+1}`,initialEntry:U,templates:Re,isSubmitting:j,onClose:()=>{Ne(null),Pe(null)},onSave:async e=>Oe(H??void 0,e),onDelete:H===null?void 0:async()=>await L({title:I(`commonDelete`),message:I(`libraryDeleteEntryConfirm`),tone:`warning`,confirmLabel:I(`commonDelete`),cancelLabel:I(`libraryCancel`)})?ke(H):!1},H===null?`draft-${U?JSON.stringify(U):`empty`}`:`entry-${H}`),G?(0,w.jsx)(oe,{children:(0,w.jsxs)(`div`,{className:`ue-context-menu`,style:{top:G.y,left:G.x},onClick:e=>e.stopPropagation(),onContextMenu:e=>e.preventDefault(),children:[(0,w.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>{Q(G.entry,G.index),K(null)},children:[(0,w.jsx)(_,{size:14}),(0,w.jsx)(`span`,{children:I(`libraryEdit`)})]}),(0,w.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>{Z(Ue(G.entry)||JSON.stringify(G.entry,null,2),I(`artistCopyResult`)),K(null)},children:[(0,w.jsx)(o,{size:14}),(0,w.jsx)(`span`,{children:I(`libraryCopyPrompt`)})]}),(0,w.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>{Z(JSON.stringify(G.entry,null,2),I(`libraryCopyJsonSuccess`)),K(null)},children:[(0,w.jsx)(y,{size:14}),(0,w.jsx)(`span`,{children:I(`libraryCopyJson`)})]}),(0,w.jsxs)(`button`,{className:`ue-context-menu-item ue-context-menu-item--danger`,onClick:()=>{$(G.index),K(null)},children:[(0,w.jsx)(p,{size:14}),(0,w.jsx)(`span`,{children:I(`commonDelete`)})]})]})}):null]})};export{O as LibraryWorkspace}; \ No newline at end of file diff --git a/gallery_ui/dist/assets/LibraryWorkspace-CT02q7ep.js b/gallery_ui/dist/assets/LibraryWorkspace-CT02q7ep.js deleted file mode 100644 index 0a088b7..0000000 --- a/gallery_ui/dist/assets/LibraryWorkspace-CT02q7ep.js +++ /dev/null @@ -1,3 +0,0 @@ -import{a as e,i as t,n,r,s as i}from"./I18nProvider-cZczvL7B.js";import{t as a}from"./sparkles-Bu6QFW9h.js";import{t as o}from"./wand-sparkles-C_uDcQtj.js";import{t as s}from"./boxes--0yaGReH.js";import{t as c}from"./copy-Dp5BPX7F.js";import{t as l}from"./download-Bn9yrFnw.js";import{t as u}from"./refresh-ccw-CfRNSMuu.js";import{t as d}from"./save-DFeVqt65.js";import{E as f,I as p,J as m,N as h,R as g,T as _,X as v,Z as ee,_ as te,et as ne,f as y,j as re,lt as ie,ot as b,st as ae,ut as oe,v as x,y as se,z as ce}from"./index-DWGqjUOp.js";var le=t(`file-plus-corner`,[[`path`,{d:`M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35`,key:`17jvcc`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 19h6`,key:`bvotb8`}],[`path`,{d:`M17 16v6`,key:`18yu1i`}]]),S=t(`file-up`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]),C=t(`git-merge`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]),ue=t(`tags`,[[`path`,{d:`M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z`,key:`16rjxf`}],[`path`,{d:`M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193`,key:`178nd4`}],[`circle`,{cx:`10.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`12ikhr`}]]),w=i(e(),1),T=r(),de=({open:e,title:t,initialEntry:r,templates:i=[],isSubmitting:o,onClose:s,onSave:c,onDelete:l})=>{let{t:u}=n(),{pushToast:p}=y(),[m,h]=(0,w.useState)(()=>JSON.stringify(r??{},null,2));return e?(0,T.jsx)(`div`,{className:`ue-modal-backdrop`,onClick:s,children:(0,T.jsxs)(`div`,{className:`ue-library-modal ue-library-modal--wide`,onClick:e=>e.stopPropagation(),children:[(0,T.jsx)(`button`,{className:`ue-modal-close ue-modal-close--light`,onClick:s,"aria-label":u(`modalClose`),children:(0,T.jsx)(_,{size:18})}),(0,T.jsxs)(`div`,{className:`ue-pane-copy`,children:[(0,T.jsx)(`p`,{className:`ue-pane-kicker`,children:u(`libraryDetail`)}),(0,T.jsx)(`h2`,{children:t}),(0,T.jsx)(`p`,{children:u(`libraryEntryEditorHint`)})]}),i.length?(0,T.jsxs)(`section`,{className:`ue-library-template-panel`,children:[(0,T.jsxs)(`div`,{className:`ue-library-guide-head`,children:[(0,T.jsx)(a,{size:15}),(0,T.jsx)(`strong`,{children:u(`libraryTemplatePanelTitle`)})]}),(0,T.jsx)(`div`,{className:`ue-library-template-grid`,children:i.map(e=>(0,T.jsxs)(`button`,{className:`ue-library-template-card`,onClick:()=>h(JSON.stringify(e.entry,null,2)),type:`button`,children:[(0,T.jsx)(`strong`,{children:e.label}),(0,T.jsx)(`span`,{children:e.description})]},e.id))})]}):null,(0,T.jsxs)(`div`,{className:`ue-library-field-guide-inline`,children:[(0,T.jsx)(`span`,{children:`name`}),(0,T.jsx)(`span`,{children:`prompt`}),(0,T.jsx)(`span`,{children:`other_names`}),(0,T.jsx)(`span`,{children:`tags`}),(0,T.jsx)(`span`,{children:`model`}),(0,T.jsx)(`span`,{children:`description`})]}),(0,T.jsx)(`textarea`,{className:`ue-library-entry-editor`,value:m,onChange:e=>h(e.target.value)}),(0,T.jsxs)(`div`,{className:`ue-library-modal-actions`,children:[l?(0,T.jsx)(`button`,{className:`ue-icon-action ue-icon-action--danger`,onClick:async()=>{await l()&&s()},disabled:o,"aria-label":u(`commonDelete`),title:u(`commonDelete`),children:(0,T.jsx)(f,{size:14})}):null,(0,T.jsx)(`button`,{className:`ue-icon-action`,onClick:s,"aria-label":u(`libraryCancel`),title:u(`libraryCancel`),children:(0,T.jsx)(_,{size:14})}),(0,T.jsx)(`button`,{className:`ue-icon-action ue-icon-action--filled`,disabled:o,"aria-label":u(`librarySave`),title:u(`librarySave`),onClick:async()=>{try{await c(JSON.parse(m))&&s()}catch(e){p(e instanceof Error?e.message:u(`errorJsonInvalid`),`error`)}},children:(0,T.jsx)(d,{size:14})})]})]})}):null},E=[{mode:`create`,icon:S},{mode:`replace`,icon:u},{mode:`merge`,icon:C}],fe=({open:e,libraries:t,activeLibraryName:r,initialFile:i=null,isSubmitting:a,onClose:o,onImport:s})=>{let{t:c}=n(),[l,u]=(0,w.useState)(null),[d,f]=(0,w.useState)(`create`),[p,m]=(0,w.useState)(``),[h,g]=(0,w.useState)(``);(0,w.useEffect)(()=>{e&&(f(`create`),u(i),m(r||t[0]?.filename||``),g(``))},[r,i,t,e]);let v=d===`replace`||d===`merge`,ee=(0,w.useMemo)(()=>!(!l||v&&!p.trim()),[l,v,p]);return e?(0,T.jsx)(`div`,{className:`ue-modal-backdrop`,onClick:o,children:(0,T.jsxs)(`div`,{className:`ue-library-modal`,onClick:e=>e.stopPropagation(),children:[(0,T.jsx)(`button`,{className:`ue-modal-close ue-modal-close--light`,onClick:o,"aria-label":c(`modalClose`),children:(0,T.jsx)(_,{size:18})}),(0,T.jsxs)(`div`,{className:`ue-pane-copy`,children:[(0,T.jsx)(`p`,{className:`ue-pane-kicker`,children:c(`libraryImport`)}),(0,T.jsx)(`h2`,{children:c(`libraryImportTitle`)}),(0,T.jsx)(`p`,{children:c(`libraryImportText`)})]}),(0,T.jsx)(`div`,{className:`ue-import-mode-grid`,children:E.map(({mode:e,icon:t})=>(0,T.jsxs)(`button`,{className:`ue-import-mode-card ${d===e?`active`:``}`,onClick:()=>f(e),children:[(0,T.jsx)(t,{size:15}),(0,T.jsx)(`strong`,{children:c(`libraryImportMode${e[0].toUpperCase()}${e.slice(1)}`)})]},e))}),(0,T.jsxs)(`label`,{className:`ue-import-file-field`,children:[(0,T.jsx)(`span`,{children:c(`libraryImportFile`)}),(0,T.jsx)(`input`,{type:`file`,accept:`.json,application/json`,onChange:e=>u(e.target.files?.[0]??null)}),(0,T.jsx)(`em`,{children:l?.name||c(`libraryImportFileEmpty`)})]}),d===`create`?(0,T.jsxs)(`label`,{className:`ue-import-text-field`,children:[(0,T.jsx)(`span`,{children:c(`libraryImportNewName`)}),(0,T.jsx)(`input`,{value:h,onChange:e=>g(e.target.value),placeholder:`artists-new.json`})]}):(0,T.jsxs)(`label`,{className:`ue-import-text-field`,children:[(0,T.jsx)(`span`,{children:c(`libraryImportTarget`)}),(0,T.jsxs)(`select`,{value:p,onChange:e=>m(e.target.value),children:[(0,T.jsx)(`option`,{value:``,children:c(`libraryImportChooseTarget`)}),t.map(e=>(0,T.jsx)(`option`,{value:e.filename,children:e.filename},e.filename))]})]}),(0,T.jsxs)(`div`,{className:`ue-library-modal-actions`,children:[(0,T.jsx)(`button`,{className:`ue-icon-action`,onClick:o,"aria-label":c(`libraryCancel`),title:c(`libraryCancel`),children:(0,T.jsx)(_,{size:14})}),(0,T.jsx)(`button`,{className:`ue-icon-action ue-icon-action--filled`,disabled:!ee||a,"aria-label":c(`libraryImportConfirm`),title:c(`libraryImportConfirm`),onClick:async()=>{l&&await s(l,d,p,h)&&o()},children:(0,T.jsx)(S,{size:14})})]})]})}):null},D=`universal-extractor:library-view-mode`,pe=(e,t)=>{let n=x(e);return n===`grid`||n===`list`?n:t},O=e=>Array.isArray(e)?e.filter(Boolean):typeof e==`string`&&e.trim()?e.split(/[,/]/).map(e=>e.trim()).filter(Boolean):[],k=({libraries:e,onSelectLibrary:t,onCreateLibrary:r,activeLibraryName:i,entries:u,page:x,totalPages:C,totalEntries:E,editorValue:k,isEditing:A,isDirty:j,isLoading:me,isRefreshing:he,isSubmitting:M,error:N,statusMessage:P,validationIssues:ge,canUseRawEditor:_e,searchTerm:F,onSearchClear:ve,onEditorValueChange:ye,onPageChange:I,onStartEditing:be,onCancelEditing:xe,onFormatEditor:Se,onSaveLibrary:Ce,onRefresh:we,onExportLibrary:Te,onImportLibrary:Ee,onSaveEntry:De,onDeleteEntry:Oe})=>{let{t:L}=n(),{confirm:R}=te(),{pushToast:z}=y(),[ke,B]=(0,w.useState)(!1),[Ae,V]=(0,w.useState)(null),[je,H]=(0,w.useState)(!1),[U,Me]=(0,w.useState)(null),[W,Ne]=(0,w.useState)(null),[G,Pe]=(0,w.useState)(()=>pe(D,`list`)),[K,q]=(0,w.useState)(null),J=(0,w.useRef)(null),Y=(0,w.useRef)(null),X=(0,w.useRef)(0),Fe=(0,w.useMemo)(()=>{let e=Math.max(k.split(` -`).length,1);return Array.from({length:e},(e,t)=>t+1).join(` -`)},[k]);(0,w.useEffect)(()=>{se(D,G)},[G]);let Ie=(0,w.useCallback)(()=>q(null),[]);oe(!!K,Ie,{closeOnContextMenu:!0,closeOnScroll:!0});let Le=(0,w.useMemo)(()=>[{id:`artist`,label:L(`libraryTemplateArtist`),description:L(`libraryTemplateArtistHint`),entry:{name:`tapioka_(coconuts)`,title:`Tapioka`,prompt:`tapioka_(coconuts)`,other_names:[`tapioka`],post_count:3200,tags:[`artist`,`soft-light`,`anime`],model:`Pony / SDXL`,description:L(`libraryTemplateArtistDescription`)}},{id:`style`,label:L(`libraryTemplateStyle`),description:L(`libraryTemplateStyleHint`),entry:{title:`Dreamy pastel portrait`,prompt:`pastel lighting, soft bloom, clean lineart, airy composition`,tags:[`style`,`portrait`,`pastel`],model:`SDXL`,description:L(`libraryTemplateStyleDescription`)}},{id:`character`,label:L(`libraryTemplateCharacter`),description:L(`libraryTemplateCharacterHint`),entry:{title:`Original sleepy hoodie girl`,prompt:`sleepy girl, oversized monster hoodie, cross necklace, wink`,other_names:[`hoodie girl`],tags:[`character`,`original`,`hoodie`],description:L(`libraryTemplateCharacterDescription`)}}],[L]),Re=(0,w.useMemo)(()=>[{label:`name`,value:L(`libraryFieldNameHint`)},{label:`prompt`,value:L(`libraryFieldPromptHint`)},{label:`other_names`,value:L(`libraryFieldAliasHint`)},{label:`tags`,value:L(`libraryFieldTagsHint`)},{label:`model`,value:L(`libraryFieldModelHint`)},{label:`description`,value:L(`libraryFieldDescriptionHint`)}],[L]),ze=(0,w.useMemo)(()=>[L(`libraryGuideStepOne`),L(`libraryGuideStepTwo`),L(`libraryGuideStepThree`),L(`libraryGuideStepFour`)],[L]),Z=(0,w.useMemo)(()=>{let e=u.filter(e=>O(e.other_names).length>0).length,t=u.filter(e=>typeof e.prompt==`string`&&e.prompt.trim()).length,n=u.filter(e=>typeof e.model==`string`&&e.model.trim()).length,r=u.filter(e=>typeof e.description==`string`&&e.description.trim()).length,i=new Map,a=new Map;u.forEach(e=>{if(O(e.tags).forEach(e=>{i.set(e,(i.get(e)??0)+1)}),typeof e.model==`string`&&e.model.trim()){let t=e.model.trim();a.set(t,(a.get(t)??0)+1)}});let o=[...i.entries()].sort((e,t)=>t[1]-e[1]).slice(0,6),s=[...a.entries()].sort((e,t)=>t[1]-e[1]).slice(0,4);return{aliasEntries:e,promptEntries:t,modelEntries:n,describedEntries:r,uniqueTags:i.size,topTags:o,topModels:s}},[u]),Be=(e,t)=>String(e.title||e.name||e.prompt||`${L(`libraryDetail`)} ${t+1}`),Ve=e=>typeof e.prompt==`string`&&e.prompt.trim()?e.prompt:Array.isArray(e.other_names)&&e.other_names.length?e.other_names.slice(0,4).join(` · `):typeof e.other_names==`string`&&e.other_names.trim()?e.other_names:typeof e.description==`string`&&e.description.trim()?e.description:``,He=e=>String(e.prompt||e.name||e.title||``).trim(),Q=async(e,t)=>{try{await navigator.clipboard.writeText(e),z(t,`success`)}catch{z(L(`contextCopyError`),`error`)}},Ue=async e=>{if(e){if(!(e.name.toLowerCase().endsWith(`.json`)||e.type.includes(`json`))){z(L(`errorImportLibrary`),`error`);return}await R({title:L(`libraryImport`),message:L(`libraryImportConfirmAsk`,{name:e.name}),tone:`info`,confirmLabel:L(`libraryImport`),cancelLabel:L(`libraryCancel`)})&&(V(e),B(!0))}},$=(e,t=null)=>{Me(t),Ne(e)},We=(e,t,n)=>{e.preventDefault(),e.stopPropagation();let r=ie(e,{width:220,height:240},`pointer`);q({entry:t,index:n,x:r.x,y:r.y})},Ge=async e=>{await R({title:L(`commonDelete`),message:L(`libraryDeleteEntryConfirm`),tone:`warning`,confirmLabel:L(`commonDelete`),cancelLabel:L(`libraryCancel`)})&&await Oe(e)&&z(L(`commonDelete`),`success`)},Ke=e=>{let t=Number(e.get(`page`));if(!Number.isFinite(t))return;let n=Math.min(Math.max(1,Math.trunc(t)),C);n!==x&&I(n)};return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`section`,{className:`ue-workspace ue-animate-in ${je?`is-dragging-library`:``}`,"data-tour-id":`library-workspace`,onDragEnter:e=>{e.preventDefault(),X.current+=1,H(!0)},onDragOver:e=>e.preventDefault(),onDragLeave:e=>{e.preventDefault(),--X.current,X.current<=0&&(X.current=0,H(!1))},onDrop:e=>{e.preventDefault(),X.current=0,H(!1),Ue(e.dataTransfer.files?.[0]??null)},children:[(0,T.jsxs)(`div`,{className:`ue-pane-header`,children:[(0,T.jsxs)(`div`,{className:`ue-pane-copy`,children:[(0,T.jsx)(`p`,{className:`ue-pane-kicker`,children:L(`sidebarLibraries`)}),(0,T.jsx)(`h2`,{children:i||L(`sidebarLibraries`)}),(0,T.jsx)(`p`,{children:i?L(`libraryWorkspaceSubtitle`,{count:E,name:i}):L(`libraryWorkspaceIntro`)})]}),(0,T.jsxs)(`div`,{className:`ue-library-actions ${i?``:`is-empty`}`,"data-tour-id":`library-actions`,children:[(0,T.jsxs)(`div`,{className:`ue-segmented-control ue-segmented-control--compact ue-view-toggle`,"aria-label":L(`viewMode`),children:[(0,T.jsxs)(`button`,{className:G===`grid`?`active`:``,onClick:()=>Pe(`grid`),type:`button`,"aria-label":L(`viewGrid`),title:L(`viewGrid`),children:[(0,T.jsx)(ce,{size:13}),(0,T.jsx)(`span`,{children:L(`viewGrid`)})]}),(0,T.jsxs)(`button`,{className:G===`list`?`active`:``,onClick:()=>Pe(`list`),type:`button`,"aria-label":L(`viewList`),title:L(`viewList`),children:[(0,T.jsx)(g,{size:13}),(0,T.jsx)(`span`,{children:L(`viewList`)})]})]}),(0,T.jsx)(`input`,{ref:Y,className:`ue-hidden-input`,type:`file`,accept:`.json,application/json`,onChange:e=>void Ue(e.target.files?.[0]??null)}),(0,T.jsxs)(`button`,{className:`ue-icon-action`,onClick:()=>Y.current?.click(),"aria-label":L(`libraryAddFile`),title:L(`libraryAddFile`),children:[(0,T.jsx)(S,{size:14}),(0,T.jsx)(`span`,{children:L(`libraryAddFile`)})]}),(0,T.jsx)(`button`,{className:`ue-icon-action`,onClick:()=>{V(null),B(!0)},"aria-label":L(`libraryImport`),title:L(`libraryImport`),children:(0,T.jsx)(l,{size:14})}),(0,T.jsx)(`button`,{className:`ue-icon-action`,onClick:we,"aria-label":L(`navRefresh`),title:L(`navRefresh`),children:(0,T.jsx)(h,{size:14})}),(0,T.jsx)(`button`,{className:`ue-icon-action`,onClick:Te,disabled:!i,"aria-label":L(`libraryExport`),title:L(`libraryExport`),children:(0,T.jsx)(l,{size:14})}),(0,T.jsx)(`button`,{className:`ue-icon-action`,onClick:()=>$(Le[0].entry,null),disabled:!i,"aria-label":L(`libraryStarterTemplate`),title:L(`libraryStarterTemplate`),children:(0,T.jsx)(a,{size:14})}),(0,T.jsxs)(`button`,{className:`ue-icon-action`,onClick:()=>$({},null),disabled:!i,"aria-label":L(`libraryAddEntry`),title:L(`libraryAddEntry`),children:[(0,T.jsx)(le,{size:14}),(0,T.jsx)(`span`,{children:L(`libraryAddEntry`)})]}),A&&_e?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`button`,{className:`ue-icon-action`,onClick:Se,"aria-label":L(`libraryFormat`),title:L(`libraryFormat`),children:(0,T.jsx)(o,{size:14})}),(0,T.jsxs)(`button`,{className:`ue-icon-action ue-icon-action--filled`,onClick:Ce,disabled:M,"aria-label":L(`librarySave`),title:L(`librarySave`),children:[(0,T.jsx)(d,{size:14}),(0,T.jsx)(`span`,{children:L(`librarySave`)})]}),(0,T.jsx)(`button`,{className:`ue-icon-action`,onClick:xe,"aria-label":L(`libraryCancel`),title:L(`libraryCancel`),children:(0,T.jsx)(_,{size:14})})]}):_e?(0,T.jsx)(`button`,{className:`ue-icon-action`,onClick:be,disabled:!i,"aria-label":L(`libraryEdit`),title:L(`libraryEdit`),children:(0,T.jsx)(p,{size:14})}):(0,T.jsx)(`span`,{className:`ue-editor-status`,children:L(`libraryLargeEditHint`)})]})]}),A?(0,T.jsxs)(`div`,{className:`ue-editor-meta`,children:[(0,T.jsx)(`span`,{className:`ue-editor-status ${j?`is-dirty`:``}`,children:L(j?`libraryUnsavedChanges`:`librarySavedState`)}),he?(0,T.jsx)(`span`,{className:`ue-editor-status`,children:L(`commonLoading`)}):null]}):null,P?(0,T.jsx)(`div`,{className:`ue-inline-success`,children:P}):null,N?(0,T.jsx)(`div`,{className:`ue-inline-error`,children:N}):null,ge.length>0?(0,T.jsxs)(`div`,{className:`ue-validation-panel`,children:[(0,T.jsx)(`strong`,{children:L(`libraryValidationTitle`)}),(0,T.jsx)(`div`,{className:`ue-validation-list`,children:ge.map((e,t)=>(0,T.jsxs)(`p`,{children:[e.index===null?L(`libraryValidationGlobal`):`#${e.index+1}`,` · `,e.message]},`${e.index}-${e.field}-${t}`))})]}):null,i?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`div`,{className:`ue-library-overview-grid`,children:[(0,T.jsxs)(`article`,{className:`ue-library-overview-card`,children:[(0,T.jsx)(`span`,{children:L(`libraryOverviewEntries`)}),(0,T.jsx)(`strong`,{children:E}),(0,T.jsx)(`p`,{children:L(`libraryOverviewEntriesHint`)})]}),(0,T.jsxs)(`article`,{className:`ue-library-overview-card`,children:[(0,T.jsx)(`span`,{children:L(`libraryOverviewAliases`)}),(0,T.jsx)(`strong`,{children:Z.aliasEntries}),(0,T.jsx)(`p`,{children:L(`libraryOverviewAliasesHint`)})]}),(0,T.jsxs)(`article`,{className:`ue-library-overview-card`,children:[(0,T.jsx)(`span`,{children:L(`libraryOverviewTags`)}),(0,T.jsx)(`strong`,{children:Z.uniqueTags}),(0,T.jsx)(`p`,{children:L(`libraryOverviewTagsHint`)})]}),(0,T.jsxs)(`article`,{className:`ue-library-overview-card`,children:[(0,T.jsx)(`span`,{children:L(`libraryOverviewModels`)}),(0,T.jsx)(`strong`,{children:Z.modelEntries}),(0,T.jsx)(`p`,{children:L(`libraryOverviewModelsHint`)})]})]}),(0,T.jsxs)(`div`,{className:`ue-library-guidance-grid`,children:[(0,T.jsxs)(`article`,{className:`ue-library-guide-card`,children:[(0,T.jsxs)(`div`,{className:`ue-library-guide-head`,children:[(0,T.jsx)(a,{size:16}),(0,T.jsx)(`strong`,{children:L(`libraryGuideTitle`)})]}),(0,T.jsx)(`div`,{className:`ue-library-guide-steps`,children:ze.map((e,t)=>(0,T.jsxs)(`div`,{className:`ue-library-guide-step`,children:[(0,T.jsx)(`span`,{children:t+1}),(0,T.jsx)(`p`,{children:e})]},`${e}-${t}`))})]}),(0,T.jsxs)(`article`,{className:`ue-library-guide-card`,children:[(0,T.jsxs)(`div`,{className:`ue-library-guide-head`,children:[(0,T.jsx)(s,{size:16}),(0,T.jsx)(`strong`,{children:L(`libraryFieldGuideTitle`)})]}),(0,T.jsx)(`div`,{className:`ue-library-guide-fields`,children:Re.map(e=>(0,T.jsxs)(`div`,{className:`ue-library-guide-field`,children:[(0,T.jsx)(`span`,{children:e.label}),(0,T.jsx)(`p`,{children:e.value})]},e.label))})]})]}),(0,T.jsxs)(`div`,{className:`ue-library-search-summary`,children:[(0,T.jsxs)(`div`,{className:`ue-library-search-copy`,children:[(0,T.jsxs)(`div`,{className:`ue-library-guide-head`,children:[(0,T.jsx)(re,{size:15}),(0,T.jsx)(`strong`,{children:F.trim()?L(`librarySearchActive`,{name:F}):L(`librarySearchReady`)})]}),(0,T.jsx)(`p`,{children:L(`librarySearchHint`)})]}),F.trim()?(0,T.jsx)(`button`,{className:`ue-icon-action`,onClick:ve,"aria-label":L(`librarySearchClear`),title:L(`librarySearchClear`),children:(0,T.jsx)(_,{size:14})}):null]}),Z.topTags.length||Z.topModels.length?(0,T.jsxs)(`div`,{className:`ue-library-signal-grid`,children:[(0,T.jsxs)(`article`,{className:`ue-library-signal-card`,children:[(0,T.jsxs)(`div`,{className:`ue-library-guide-head`,children:[(0,T.jsx)(ue,{size:15}),(0,T.jsx)(`strong`,{children:L(`libraryTopTags`)})]}),(0,T.jsx)(`div`,{className:`ue-library-token-list`,children:Z.topTags.length?Z.topTags.map(([e,t])=>(0,T.jsxs)(`span`,{className:`ue-library-token`,children:[e,` · `,t]},`${e}-${t}`)):(0,T.jsx)(`span`,{className:`ue-library-token ue-library-token--muted`,children:L(`libraryNoTagsYet`)})})]}),(0,T.jsxs)(`article`,{className:`ue-library-signal-card`,children:[(0,T.jsxs)(`div`,{className:`ue-library-guide-head`,children:[(0,T.jsx)(ne,{size:15}),(0,T.jsx)(`strong`,{children:L(`libraryTopModels`)})]}),(0,T.jsx)(`div`,{className:`ue-library-token-list`,children:Z.topModels.length?Z.topModels.map(([e,t])=>(0,T.jsxs)(`span`,{className:`ue-library-token`,children:[e,` · `,t]},`${e}-${t}`)):(0,T.jsx)(`span`,{className:`ue-library-token ue-library-token--muted`,children:L(`libraryNoModelsYet`)})})]})]}):null]}):(0,T.jsxs)(`div`,{className:`ue-gallery-state ue-gallery-state--empty`,children:[(0,T.jsx)(b,{size:38,strokeWidth:1.1}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`h3`,{children:L(`librarySelectTitle`)}),(0,T.jsx)(`p`,{children:L(`librarySelectInlineHint`)}),(0,T.jsxs)(`div`,{className:`ue-library-empty-actions`,children:[(0,T.jsxs)(`label`,{children:[L(`librarySelectTitle`),(0,T.jsxs)(`select`,{"aria-label":L(`librarySelectTitle`),disabled:!e.length,value:``,onChange:e=>t?.(e.target.value),children:[(0,T.jsx)(`option`,{value:``,disabled:!0,children:L(`librarySelectTitle`)}),e.map(e=>(0,T.jsx)(`option`,{value:e.filename,children:e.filename},e.filename))]})]}),r&&(0,T.jsxs)(`button`,{className:`ue-secondary-action`,onClick:r,children:[(0,T.jsx)(le,{size:15}),L(`libraryCreateInline`)]}),(0,T.jsxs)(`button`,{className:`ue-secondary-action`,onClick:()=>Y.current?.click(),children:[(0,T.jsx)(S,{size:15}),L(`libraryImport`)]})]})]})]}),i?me&&u.length===0?(0,T.jsxs)(`div`,{className:`ue-gallery-state`,children:[(0,T.jsx)(`div`,{className:`ue-loading-orb`}),(0,T.jsx)(`p`,{children:L(`libraryLoading`)})]}):A?(0,T.jsxs)(`div`,{className:`ue-json-shell`,children:[(0,T.jsx)(`pre`,{className:`ue-json-gutter`,ref:J,"aria-hidden":`true`,children:Fe}),(0,T.jsx)(`textarea`,{className:`ue-json-editor`,value:k,onChange:e=>ye(e.target.value),onScroll:e=>{J.current&&(J.current.scrollTop=e.currentTarget.scrollTop)}})]}):i&&u.length===0?(0,T.jsxs)(`div`,{className:`ue-gallery-state ue-gallery-state--empty`,children:[(0,T.jsx)(ne,{size:38,strokeWidth:1.1}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`h3`,{children:L(`libraryEmptyTitle`)}),(0,T.jsx)(`p`,{children:L(`libraryEmptyText`)})]})]}):i?(0,T.jsxs)(`div`,{className:`ue-library-listing ${G===`grid`?`ue-library-listing--grid`:``}`,children:[u.map((e,t)=>{let n=e.source_index,r=Ve(e),a=O(e.other_names),o=O(e.tags),s=He(e);return(0,T.jsxs)(`article`,{className:`ue-library-row`,onContextMenu:t=>We(t,e,n),children:[(0,T.jsxs)(`div`,{className:`ue-library-row-index`,children:[`#`,String(n+1).padStart(2,`0`)]}),(0,T.jsxs)(`div`,{className:`ue-library-row-main`,children:[(0,T.jsxs)(`div`,{className:`ue-library-row-heading`,children:[(0,T.jsx)(`h3`,{children:Be(e,n)}),(0,T.jsxs)(`div`,{className:`ue-library-inline-chips`,children:[e.model?(0,T.jsx)(`span`,{className:`ue-library-token`,children:e.model}):null,typeof e.post_count==`number`?(0,T.jsxs)(`span`,{className:`ue-library-token`,children:[e.post_count,` posts`]}):null,s?(0,T.jsx)(`span`,{className:`ue-library-token`,children:L(`libraryReadyToCopy`)}):null]})]}),r?(0,T.jsx)(`p`,{className:`ue-library-row-preview`,children:r}):null,a.length?(0,T.jsx)(`div`,{className:`ue-library-inline-chips`,children:a.slice(0,6).map(t=>(0,T.jsx)(`span`,{className:`ue-library-token ue-library-token--soft`,children:t},`${e.source_index}-${t}`))}):null,o.length?(0,T.jsx)(`div`,{className:`ue-library-inline-chips`,children:o.slice(0,8).map(t=>(0,T.jsxs)(`span`,{className:`ue-library-token ue-library-token--subtle`,children:[`#`,t]},`${e.source_index}-${t}`))}):null,e.description&&r!==e.description?(0,T.jsx)(`p`,{className:`ue-library-row-description`,children:e.description}):null]}),(0,T.jsxs)(`div`,{className:`ue-library-row-side`,children:[(0,T.jsx)(`span`,{children:L(`libraryEntryStatus`,{count:t+1})}),(0,T.jsxs)(`div`,{className:`ue-library-row-actions`,children:[(0,T.jsx)(`button`,{className:`ue-library-row-action`,onClick:()=>$(e,n),"aria-label":L(`libraryEdit`),title:L(`libraryEdit`),children:(0,T.jsx)(p,{size:13})}),(0,T.jsx)(`button`,{className:`ue-library-row-action`,onClick:()=>void Q(JSON.stringify(e,null,2),L(`libraryCopyJsonSuccess`)),"aria-label":L(`libraryCopyJson`),title:L(`libraryCopyJson`),children:(0,T.jsx)(b,{size:13})}),(0,T.jsx)(`button`,{className:`ue-library-row-action`,onClick:()=>void Q(s||JSON.stringify(e,null,2),L(`artistCopyResult`)),"aria-label":L(`libraryCopyPrompt`),title:L(`libraryCopyPrompt`),children:(0,T.jsx)(c,{size:13})}),(0,T.jsx)(`button`,{className:`ue-library-row-action ue-library-row-action--danger`,onClick:()=>void Ge(n),"aria-label":L(`commonDelete`),title:L(`commonDelete`),children:(0,T.jsx)(f,{size:13})})]})]})]},`${i}-${e.source_index}-${t}`)}),C>1?(0,T.jsxs)(`div`,{className:`ue-pagination ue-pagination--library`,children:[(0,T.jsxs)(`div`,{className:`ue-pagination-meta`,children:[(0,T.jsx)(`span`,{children:L(`galleryPage`,{page:x,totalPages:C})}),(0,T.jsx)(`i`,{"aria-hidden":`true`,children:`·`}),(0,T.jsx)(`span`,{children:L(`commonEntries`,{count:E})})]}),(0,T.jsxs)(`div`,{className:`ue-pagination-actions`,children:[(0,T.jsx)(`button`,{disabled:x<=1,onClick:()=>I(Math.max(1,x-1)),"aria-label":L(`galleryPrevious`),title:L(`galleryPrevious`),children:(0,T.jsx)(ee,{size:14})}),(0,T.jsx)(`button`,{disabled:x>=C,onClick:()=>I(Math.min(C,x+1)),"aria-label":L(`galleryNext`),title:L(`galleryNext`),children:(0,T.jsx)(v,{size:14})}),(0,T.jsxs)(`form`,{className:`ue-pagination-jump`,onSubmit:e=>{e.preventDefault(),Ke(new FormData(e.currentTarget))},children:[(0,T.jsxs)(`label`,{className:`ue-select-field ue-pagination-jump-field`,children:[(0,T.jsx)(`span`,{children:L(`galleryJumpTo`)}),(0,T.jsx)(`input`,{name:`page`,type:`number`,min:1,max:C,defaultValue:x,"aria-label":L(`galleryJumpTo`)})]}),(0,T.jsx)(`button`,{type:`submit`,"aria-label":L(`galleryJump`),title:L(`galleryJump`),children:(0,T.jsx)(m,{size:14})})]},x)]})]}):null]}):null:null,je?(0,T.jsx)(`div`,{className:`ue-drop-overlay ue-drop-overlay--inline`,children:(0,T.jsxs)(`div`,{className:`ue-drop-overlay-card`,children:[(0,T.jsx)(`h3`,{children:L(`libraryDropTitle`)}),(0,T.jsx)(`p`,{children:L(`libraryDropText`)})]})}):null]}),(0,T.jsx)(fe,{open:ke,libraries:e,activeLibraryName:i,initialFile:Ae,isSubmitting:M,onClose:()=>{B(!1),V(null)},onImport:Ee}),(0,T.jsx)(de,{open:W!==null,title:U===null?L(`libraryAddEntry`):`${L(`libraryDetail`)} #${(U??0)+1}`,initialEntry:W,templates:Le,isSubmitting:M,onClose:()=>{Me(null),Ne(null)},onSave:async e=>De(U??void 0,e),onDelete:U===null?void 0:async()=>await R({title:L(`commonDelete`),message:L(`libraryDeleteEntryConfirm`),tone:`warning`,confirmLabel:L(`commonDelete`),cancelLabel:L(`libraryCancel`)})?Oe(U):!1},U===null?`draft-${W?JSON.stringify(W):`empty`}`:`entry-${U}`),K?(0,T.jsx)(ae,{children:(0,T.jsxs)(`div`,{className:`ue-context-menu`,style:{top:K.y,left:K.x},onClick:e=>e.stopPropagation(),onContextMenu:e=>e.preventDefault(),children:[(0,T.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>{$(K.entry,K.index),q(null)},children:[(0,T.jsx)(p,{size:14}),(0,T.jsx)(`span`,{children:L(`libraryEdit`)})]}),(0,T.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>{Q(He(K.entry)||JSON.stringify(K.entry,null,2),L(`artistCopyResult`)),q(null)},children:[(0,T.jsx)(c,{size:14}),(0,T.jsx)(`span`,{children:L(`libraryCopyPrompt`)})]}),(0,T.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>{Q(JSON.stringify(K.entry,null,2),L(`libraryCopyJsonSuccess`)),q(null)},children:[(0,T.jsx)(b,{size:14}),(0,T.jsx)(`span`,{children:L(`libraryCopyJson`)})]}),(0,T.jsxs)(`button`,{className:`ue-context-menu-item ue-context-menu-item--danger`,onClick:()=>{Ge(K.index),q(null)},children:[(0,T.jsx)(f,{size:14}),(0,T.jsx)(`span`,{children:L(`commonDelete`)})]})]})}):null]})};export{k as LibraryWorkspace}; \ No newline at end of file diff --git a/gallery_ui/dist/assets/MetadataViewerModal-CEAQlgmV.js b/gallery_ui/dist/assets/MetadataViewerModal-CEAQlgmV.js deleted file mode 100644 index 89a51a7..0000000 --- a/gallery_ui/dist/assets/MetadataViewerModal-CEAQlgmV.js +++ /dev/null @@ -1 +0,0 @@ -import{a as e,n as t,r as n,s as r}from"./I18nProvider-cZczvL7B.js";import{C as i,T as a,Y as o,a as s,f as c,i as l,ot as u}from"./index-DWGqjUOp.js";var d=r(e(),1),f=n(),p=({image:e,onClose:n})=>{let{t:r}=t(),{pushToast:p}=c(),[m,h]=(0,d.useState)(null),[g,_]=(0,d.useState)(!0),[v,y]=(0,d.useState)(null);(0,d.useEffect)(()=>{let t=!1;return _(!0),y(null),(async()=>{try{let n=await i.getImageMetadata(e.relative_path);t||h(n)}catch(e){t||y(e instanceof Error?e.message:r(`metadataLoadError`))}finally{t||_(!1)}})(),()=>{t=!0}},[e.relative_path,r]);let b=async(e,t)=>{if(!e.trim()){p(r(`metadataNoPositivePrompt`),`info`);return}try{await navigator.clipboard.writeText(e),p(t,`success`)}catch(e){p(e instanceof Error?e.message:r(`contextCopyError`),`error`)}},x=l(m),S=s(m),C=!!(m?.metadata||m?.workflow||m?.summary?.positive_prompt||m?.summary?.negative_prompt);return(0,f.jsx)(`div`,{className:`ue-modal-backdrop ue-metadata-backdrop`,onClick:n,children:(0,f.jsxs)(`section`,{className:`ue-metadata-modal`,onClick:e=>e.stopPropagation(),"aria-label":r(`metadataView`),children:[(0,f.jsxs)(`header`,{className:`ue-metadata-head`,children:[(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`span`,{children:r(`metadataView`)}),(0,f.jsx)(`h2`,{title:e.filename,children:e.filename})]}),(0,f.jsx)(`button`,{className:`ue-icon-action`,type:`button`,onClick:n,"aria-label":r(`modalClose`),children:(0,f.jsx)(a,{size:15})})]}),g?(0,f.jsxs)(`div`,{className:`ue-detail-state`,children:[(0,f.jsx)(`div`,{className:`ue-loading-orb`}),(0,f.jsx)(`p`,{children:r(`modalLoading`)})]}):v?(0,f.jsx)(`div`,{className:`ue-inline-error`,children:v}):C?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(`div`,{className:`ue-metadata-actions`,children:[(0,f.jsxs)(`button`,{className:`ue-secondary-btn`,type:`button`,onClick:()=>void b(x,r(`metadataCopyPositiveSuccess`)),children:[(0,f.jsx)(o,{size:14}),(0,f.jsx)(`span`,{children:r(`metadataCopyPositive`)})]}),(0,f.jsxs)(`button`,{className:`ue-secondary-btn`,type:`button`,onClick:()=>void b(S,r(`metadataCopyRawSuccess`)),children:[(0,f.jsx)(u,{size:14}),(0,f.jsx)(`span`,{children:r(`metadataCopyRaw`)})]})]}),m?.recipe?.warnings?.length?(0,f.jsx)(`p`,{className:`ue-metadata-warning`,role:`status`,children:r(`metadataPartialWarning`)}):null,(0,f.jsxs)(`div`,{className:`ue-metadata-summary`,children:[(0,f.jsxs)(`label`,{children:[(0,f.jsx)(`span`,{children:r(`metadataPositivePrompt`)}),(0,f.jsx)(`textarea`,{value:x||r(`metadataNoPositivePrompt`),readOnly:!0})]}),(0,f.jsxs)(`label`,{children:[(0,f.jsx)(`span`,{children:r(`metadataNegativePrompt`)}),(0,f.jsx)(`textarea`,{value:m?.summary?.negative_prompt||r(`metadataNoNegativePrompt`),readOnly:!0})]})]}),(0,f.jsxs)(`details`,{className:`ue-detail-disclosure`,open:!0,children:[(0,f.jsxs)(`summary`,{children:[(0,f.jsx)(u,{size:15}),(0,f.jsx)(`span`,{children:r(`modalRawMetadata`)})]}),(0,f.jsx)(`pre`,{className:`ue-meta-raw`,children:S})]})]}):(0,f.jsx)(`div`,{className:`ue-detail-state ue-detail-state--empty`,children:(0,f.jsx)(`p`,{children:r(`modalNoMetadata`)})})]})})};export{p as MetadataViewerModal}; \ No newline at end of file diff --git a/gallery_ui/dist/assets/MetadataViewerModal-zQM0uYbS.js b/gallery_ui/dist/assets/MetadataViewerModal-zQM0uYbS.js new file mode 100644 index 0000000..6ca45d6 --- /dev/null +++ b/gallery_ui/dist/assets/MetadataViewerModal-zQM0uYbS.js @@ -0,0 +1 @@ +import{a as e,n as t,r as n,s as r}from"./I18nProvider-DEfiLn3N.js";import{C as i,T as a,Z as o,a as s,et as c,f as l,i as u}from"./index-CKow1Wte.js";var d=r(e(),1),f=n(),p=({image:e,onClose:n})=>{let{t:r}=t(),{pushToast:p}=l(),[m,h]=(0,d.useState)(null),[g,_]=(0,d.useState)(!0),[v,y]=(0,d.useState)(null);(0,d.useEffect)(()=>{let t=!1;return _(!0),y(null),(async()=>{try{let n=await i.getImageMetadata(e.relative_path);t||h(n)}catch(e){t||y(e instanceof Error?e.message:r(`metadataLoadError`))}finally{t||_(!1)}})(),()=>{t=!0}},[e.relative_path,r]);let b=async(e,t)=>{if(!e.trim())p(r(`metadataNoPositivePrompt`),`info`);else try{await navigator.clipboard.writeText(e),p(t,`success`)}catch(e){p(e instanceof Error?e.message:r(`contextCopyError`),`error`)}},x=u(m),S=s(m),C=!!(m?.metadata||m?.workflow||m?.summary?.positive_prompt||m?.summary?.negative_prompt);return(0,f.jsx)(`div`,{className:`ue-modal-backdrop ue-metadata-backdrop`,onClick:n,children:(0,f.jsxs)(`section`,{className:`ue-metadata-modal`,onClick:e=>e.stopPropagation(),"aria-label":r(`metadataView`),children:[(0,f.jsxs)(`header`,{className:`ue-metadata-head`,children:[(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`span`,{children:r(`metadataView`)}),(0,f.jsx)(`h2`,{title:e.filename,children:e.filename})]}),(0,f.jsx)(`button`,{className:`ue-icon-action`,type:`button`,onClick:n,"aria-label":r(`modalClose`),children:(0,f.jsx)(a,{size:15})})]}),g?(0,f.jsxs)(`div`,{className:`ue-detail-state`,children:[(0,f.jsx)(`div`,{className:`ue-loading-orb`}),(0,f.jsx)(`p`,{children:r(`modalLoading`)})]}):v?(0,f.jsx)(`div`,{className:`ue-inline-error`,children:v}):C?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(`div`,{className:`ue-metadata-actions`,children:[(0,f.jsxs)(`button`,{className:`ue-secondary-btn`,type:`button`,onClick:()=>void b(x,r(`metadataCopyPositiveSuccess`)),children:[(0,f.jsx)(c,{size:14}),(0,f.jsx)(`span`,{children:r(`metadataCopyPositive`)})]}),(0,f.jsxs)(`button`,{className:`ue-secondary-btn`,type:`button`,onClick:()=>void b(S,r(`metadataCopyRawSuccess`)),children:[(0,f.jsx)(o,{size:14}),(0,f.jsx)(`span`,{children:r(`metadataCopyRaw`)})]})]}),m?.recipe?.warnings?.length?(0,f.jsx)(`p`,{className:`ue-metadata-warning`,role:`status`,children:r(`metadataPartialWarning`)}):null,(0,f.jsxs)(`div`,{className:`ue-metadata-summary`,children:[(0,f.jsxs)(`label`,{children:[(0,f.jsx)(`span`,{children:r(`metadataPositivePrompt`)}),(0,f.jsx)(`textarea`,{value:x||r(`metadataNoPositivePrompt`),readOnly:!0})]}),(0,f.jsxs)(`label`,{children:[(0,f.jsx)(`span`,{children:r(`metadataNegativePrompt`)}),(0,f.jsx)(`textarea`,{value:m?.summary?.negative_prompt||r(`metadataNoNegativePrompt`),readOnly:!0})]})]}),(0,f.jsxs)(`details`,{className:`ue-detail-disclosure`,open:!0,children:[(0,f.jsxs)(`summary`,{children:[(0,f.jsx)(o,{size:15}),(0,f.jsx)(`span`,{children:r(`modalRawMetadata`)})]}),(0,f.jsx)(`pre`,{className:`ue-meta-raw`,children:S})]})]}):(0,f.jsx)(`div`,{className:`ue-detail-state ue-detail-state--empty`,children:(0,f.jsx)(`p`,{children:r(`modalNoMetadata`)})})]})})};export{p as MetadataViewerModal}; \ No newline at end of file diff --git a/gallery_ui/dist/assets/SettingsWorkspace-BaJRJ6EV.js b/gallery_ui/dist/assets/SettingsWorkspace-BaJRJ6EV.js new file mode 100644 index 0000000..3021925 --- /dev/null +++ b/gallery_ui/dist/assets/SettingsWorkspace-BaJRJ6EV.js @@ -0,0 +1 @@ +import{a as e,i as t,n,r,s as i}from"./I18nProvider-DEfiLn3N.js";import{t as a}from"./image-plus-C8PYGAuQ.js";import{t as o}from"./save-DQG0Zsqx.js";import{C as s,D as c,E as l,F as u,X as d,_ as f,it as p,j as m,q as h,u as g,w as _}from"./index-CKow1Wte.js";var v=t(`chevrons-left`,[[`path`,{d:`m11 17-5-5 5-5`,key:`13zhaf`}],[`path`,{d:`m18 17-5-5 5-5`,key:`h8a8et`}]]),y=t(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),b=t(`mouse-pointer-2`,[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z`,key:`edeuup`}]]),x=t(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),S=t(`square-split-vertical`,[[`path`,{d:`M5 8V5c0-1 1-2 2-2h10c1 0 2 1 2 2v3`,key:`1pi83i`}],[`path`,{d:`M19 16v3c0 1-1 2-2 2H7c-1 0-2-1-2-2v-3`,key:`ido5k7`}],[`line`,{x1:`4`,x2:`20`,y1:`12`,y2:`12`,key:`1e0a9i`}]]),C=i(e(),1),w=r(),T=()=>({name:``,path:``,kind:`custom`,enabled:!0,writable:!1,recursive:!0,import_target:!1}),E=e=>e===`output`?(0,w.jsx)(h,{size:16}):(0,w.jsx)(d,{size:16}),D=[{key:`defaultSelectionMode`,icon:b,titleKey:`settingsPrefDefaultSelection`,descriptionKey:`settingsPrefDefaultSelectionHint`},{key:`collapseSidebarOnLaunch`,icon:v,titleKey:`settingsPrefCollapseSidebar`,descriptionKey:`settingsPrefCollapseSidebarHint`},{key:`enableImagePrefetch`,icon:a,titleKey:`settingsPrefImagePrefetch`,descriptionKey:`settingsPrefImagePrefetchHint`},{key:`enableLiveGalleryRefresh`,icon:u,titleKey:`settingsPrefLiveRefresh`,descriptionKey:`settingsPrefLiveRefreshHint`},{key:`defaultFolderTreeView`,icon:S,titleKey:`settingsPrefFolderTree`,descriptionKey:`settingsPrefFolderTreeHint`}],O=({sources:e,preferences:t,onPreferencesChange:r,onSourcesChange:i,onRestartOnboarding:a,onDirtyChange:v})=>{let{t:b}=n(),{confirm:S}=f(),{runOperation:O}=_(),[k,A]=(0,C.useState)(e),[j,M]=(0,C.useState)(e[0]?.id??`new`),[N,P]=(0,C.useState)(()=>T()),[F,I]=(0,C.useState)(()=>T()),L=(0,C.useRef)(!1),R=(0,C.useRef)(null),[z,B]=(0,C.useState)(!1),[V,H]=(0,C.useState)(``),[U,W]=(0,C.useState)([]),[G,K]=(0,C.useState)(null);(0,C.useEffect)(()=>{A(e),M(t=>t!==`new`&&!e.some(e=>e.id===t)&&e[0]?e[0].id:t)},[e]);let q=(0,C.useMemo)(()=>k.find(e=>e.id===j)??null,[k,j]);(0,C.useEffect)(()=>{L.current&&R.current===j||(R.current=j,q?(I({...q}),P({...q}),H(``)):(P(T()),I(T())))},[q,j]),(0,C.useEffect)(()=>{s.getFingerprintStatus().then(K).catch(()=>K(null))},[]);let J=async(e=!1)=>{let t=await s.listGallerySources(e);return A(t),i(),t},Y=async()=>{B(!0);try{let e=await O(()=>s.diagnoseGallerySources(),{pending:b(`operationRunDiagnostics`),success:b(`settingsDiagnosticsDone`),error:e=>e instanceof Error?e.message:b(`settingsDiagnosticsError`)});W(e)}catch{W([])}finally{B(!1)}},X=[`name`,`path`,`enabled`,`writable`,`recursive`,`import_target`],Z=F,Q=X.some(e=>N[e]!==Z[e]);(0,C.useEffect)(()=>{L.current=Q},[Q]),(0,C.useEffect)(()=>(v?.(Q),()=>v?.(!1)),[Q,v]),(0,C.useEffect)(()=>{if(!Q)return;let e=e=>{e.preventDefault(),e.returnValue=``};return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[Q]);let $=async e=>{z||e===j||(!Q||await S({title:b(`qolDiscardTitle`),message:b(`qolDiscardBody`),tone:`warning`,confirmLabel:b(`modalDiscardChanges`),cancelLabel:b(`libraryCancel`)}))&&(M(e),e===`new`&&P(T()),H(``))},ee=()=>{$(`new`)},te=e=>{P(t=>({...t,[e]:!t[e]}))},ne=async()=>{B(!0);try{let e=await O(()=>s.testGallerySourcePath(N.path),{pending:b(`operationTestPath`),success:e=>e.ok?b(`settingsPathOk`,{count:e.image_count}):b(`settingsPathMissing`),error:e=>e instanceof Error?e.message:b(`settingsPathError`)});H(e.ok?b(`settingsPathOk`,{count:e.image_count}):b(`settingsPathMissing`))}catch(e){let t=e instanceof Error?e.message:b(`settingsPathError`);H(t)}finally{B(!1)}},re=async()=>{if(await S({title:b(`settingsSourceSave`),message:q?b(`settingsSourceSaveConfirm`,{name:q.name}):b(`settingsSourceCreateConfirm`,{name:N.name||N.path}),tone:`warning`,confirmLabel:b(`settingsSourceSave`),cancelLabel:b(`libraryCancel`)})){B(!0);try{let e=await O(()=>s.saveGallerySource(N),{pending:b(`operationSaveSource`),success:b(`settingsSourceSaved`),error:e=>e instanceof Error?e.message:b(`settingsSourceSaveError`)});A(e.sources),P({...e.source}),I({...e.source}),M(e.source.id),i()}catch{}finally{B(!1)}}},ie=async()=>{if(q&&!q.locked&&await S({title:b(`settingsSourceDelete`),message:b(`settingsSourceDeleteConfirm`,{name:q.name}),tone:`danger`,confirmLabel:b(`commonDelete`),cancelLabel:b(`libraryCancel`)})){B(!0);try{let e=await O(()=>s.deleteGallerySource(q.id),{pending:b(`operationDeleteSource`),success:b(`settingsSourceDeleted`),error:e=>e instanceof Error?e.message:b(`settingsSourceDeleteError`)});A(e.sources),M(e.sources[0]?.id??`new`),i()}catch{}finally{B(!1)}}},ae=k.reduce((e,t)=>e+(t.image_count??0),0),oe=k.filter(e=>e.enabled&&e.exists).length;return(0,w.jsxs)(`section`,{className:`ue-settings-workspace`,children:[(0,w.jsxs)(`div`,{className:`ue-settings-hero`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`span`,{className:`ue-section-kicker`,children:b(`settingsKicker`)}),(0,w.jsx)(`h1`,{children:b(`settingsTitle`)}),(0,w.jsx)(`p`,{children:b(`settingsSubtitle`)})]}),(0,w.jsxs)(`div`,{className:`ue-settings-metrics`,"aria-label":b(`settingsSourcesTitle`),children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`strong`,{children:oe}),(0,w.jsx)(`span`,{children:b(`settingsActiveSources`)})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`strong`,{children:ae}),(0,w.jsx)(`span`,{children:b(`settingsIndexedImages`)})]})]})]}),(0,w.jsxs)(`nav`,{className:`ue-qol-section-nav`,"aria-label":b(`navSettings`),children:[(0,w.jsx)(`a`,{href:`#ue-preferences`,children:b(`settingsPreferencesTitle`)}),(0,w.jsx)(`a`,{href:`#ue-sources`,children:b(`settingsSourcesTitle`)}),(0,w.jsx)(`a`,{href:`#ue-diagnostics`,children:b(`settingsDiagnostics`)})]}),(0,w.jsxs)(`div`,{className:`ue-settings-preferences`,id:`ue-preferences`,children:[(0,w.jsxs)(`div`,{className:`ue-settings-panel-heading`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`h2`,{children:b(`settingsPreferencesTitle`)}),(0,w.jsx)(`p`,{children:b(`settingsPreferencesHint`)})]}),(0,w.jsx)(m,{size:18})]}),(0,w.jsxs)(`label`,{className:`ue-density-setting`,children:[(0,w.jsx)(`span`,{children:b(`settingsDensity`)}),(0,w.jsxs)(`select`,{value:t.interfaceDensity||`standard`,onChange:e=>r({interfaceDensity:e.target.value===`compact`?`compact`:`standard`}),children:[(0,w.jsx)(`option`,{value:`standard`,children:b(`densityStandard`)}),(0,w.jsx)(`option`,{value:`compact`,children:b(`densityCompact`)})]}),(0,w.jsx)(`small`,{children:b(`settingsDensityHint`)})]}),(0,w.jsxs)(`div`,{className:`ue-settings-onboarding-card`,"data-tour-id":`settings-onboarding`,children:[(0,w.jsx)(`span`,{className:`ue-settings-onboarding-icon`,children:(0,w.jsx)(y,{size:18})}),(0,w.jsxs)(`span`,{className:`ue-settings-onboarding-copy`,children:[(0,w.jsx)(`strong`,{children:b(`settingsOnboardingTitle`)}),(0,w.jsx)(`small`,{children:b(`settingsOnboardingHint`)})]}),(0,w.jsxs)(`button`,{className:`ue-secondary-action`,type:`button`,disabled:Q||z,onClick:a,children:[(0,w.jsx)(y,{size:16}),(0,w.jsx)(`span`,{children:b(`settingsOnboardingRestart`)})]})]}),(0,w.jsx)(`div`,{className:`ue-preference-grid`,children:D.map(e=>{let n=e.icon,i=t[e.key];return(0,w.jsxs)(`button`,{className:`ue-preference-card ${i?`active`:``}`,type:`button`,onClick:()=>r({[e.key]:!i}),"aria-pressed":i,children:[(0,w.jsx)(`span`,{className:`ue-preference-icon`,children:(0,w.jsx)(n,{size:16})}),(0,w.jsxs)(`span`,{className:`ue-preference-copy`,children:[(0,w.jsx)(`strong`,{children:b(e.titleKey)}),(0,w.jsx)(`small`,{children:b(e.descriptionKey)})]}),(0,w.jsx)(`span`,{className:`ue-toggle-dot`,children:i?(0,w.jsx)(p,{size:13}):null})]},e.key)})})]}),(0,w.jsxs)(`div`,{className:`ue-settings-layout`,id:`ue-sources`,children:[(0,w.jsxs)(`aside`,{className:`ue-settings-source-list`,"data-tour-id":`settings-sources`,children:[(0,w.jsxs)(`div`,{className:`ue-settings-panel-heading`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`h2`,{children:b(`settingsSourcesTitle`)}),(0,w.jsx)(`p`,{children:b(`settingsSourcesHint`)})]}),(0,w.jsx)(`button`,{className:`ue-icon-btn`,type:`button`,disabled:z||Q,onClick:()=>{B(!0),J(!0).catch(e=>H(e instanceof Error?e.message:b(`settingsDiagnosticsError`))).finally(()=>B(!1))},title:b(`settingsSourceScan`),children:(0,w.jsx)(u,{size:15})}),(0,w.jsx)(`button`,{className:`ue-icon-btn`,type:`button`,onClick:()=>void Y(),title:b(`settingsDiagnostics`),children:(0,w.jsx)(x,{size:15})})]}),(0,w.jsx)(`div`,{className:`ue-source-stack`,children:k.map(e=>(0,w.jsxs)(`button`,{className:`ue-source-card ${e.id===j?`active`:``} ${e.exists?``:`is-missing`}`,type:`button`,disabled:z,"aria-pressed":e.id===j,onClick:()=>void $(e.id),children:[(0,w.jsx)(`span`,{className:`ue-source-icon`,children:E(e.kind)}),(0,w.jsxs)(`span`,{className:`ue-source-main`,children:[(0,w.jsx)(`strong`,{children:e.name}),(0,w.jsx)(`small`,{children:e.path})]}),(0,w.jsx)(`span`,{className:`ue-source-meta`,children:e.image_count??0})]},e.id))}),(0,w.jsxs)(`button`,{className:`ue-secondary-action`,type:`button`,onClick:ee,children:[(0,w.jsx)(d,{size:16}),(0,w.jsx)(`span`,{children:b(`settingsAddSource`)})]})]}),(0,w.jsxs)(`div`,{className:`ue-settings-editor`,children:[(0,w.jsxs)(`div`,{className:`ue-settings-panel-heading`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`h2`,{children:q?q.name:b(`settingsNewSource`)}),(0,w.jsx)(`p`,{children:q?.locked?b(`settingsDefaultLockedHint`):b(`settingsCustomHint`)})]}),(0,w.jsx)(m,{size:18})]}),(0,w.jsxs)(`div`,{className:`ue-settings-form`,children:[(0,w.jsx)(`p`,{className:`ue-qol-note`,role:`status`,children:b(Q?`qolUnsaved`:`qolSaved`)}),(0,w.jsxs)(`label`,{children:[(0,w.jsx)(`span`,{children:b(`settingsSourceName`)}),(0,w.jsx)(`input`,{value:N.name,disabled:z||!!q?.locked,onChange:e=>P(t=>({...t,name:e.target.value})),placeholder:b(`settingsSourceNamePlaceholder`)})]}),(0,w.jsxs)(`label`,{children:[(0,w.jsx)(`span`,{children:b(`settingsSourcePath`)}),(0,w.jsx)(`input`,{value:N.path,disabled:z||!!q?.locked,onChange:e=>P(t=>({...t,path:e.target.value})),placeholder:b(`settingsSourcePathPlaceholder`)})]}),(0,w.jsx)(`div`,{className:`ue-settings-toggle-grid`,children:[`enabled`,`writable`,`recursive`,`import_target`].map(e=>(0,w.jsxs)(`button`,{className:`ue-toggle-row ${N[e]?`active`:``}`,type:`button`,disabled:z,"aria-pressed":N[e],onClick:()=>te(e),children:[(0,w.jsx)(`span`,{children:b(`settingsSource${e===`import_target`?`ImportTarget`:e[0].toUpperCase()+e.slice(1)}`)}),(0,w.jsx)(`span`,{className:`ue-toggle-dot`,children:N[e]?(0,w.jsx)(p,{size:13}):null})]},e))}),V?(0,w.jsx)(`p`,{className:`ue-settings-test-result`,children:V}):null,(0,w.jsxs)(`div`,{className:`ue-settings-actions`,children:[(0,w.jsxs)(`button`,{className:`ue-secondary-action`,type:`button`,onClick:ne,disabled:z,children:[(0,w.jsx)(h,{size:16}),(0,w.jsx)(`span`,{children:b(`settingsSourceTest`)})]}),(0,w.jsxs)(`button`,{className:`ue-primary-action`,type:`button`,onClick:re,disabled:z||!Q||!N.path.trim()||!N.name.trim(),children:[(0,w.jsx)(o,{size:16}),(0,w.jsx)(`span`,{children:b(`settingsSourceSave`)})]}),q&&!q.locked?(0,w.jsxs)(`button`,{className:`ue-danger-action`,type:`button`,onClick:ie,disabled:z,children:[(0,w.jsx)(c,{size:16}),(0,w.jsx)(`span`,{children:b(`settingsSourceDelete`)})]}):null]})]})]})]}),(0,w.jsxs)(`div`,{id:`ue-diagnostics`,className:`ue-settings-diagnostics`,"data-tour-id":`settings-diagnostics`,children:[(0,w.jsxs)(`div`,{className:`ue-settings-panel-heading`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`h2`,{children:b(`settingsDiagnostics`)}),(0,w.jsx)(`p`,{children:b(`settingsDiagnosticsHint`)})]}),(0,w.jsxs)(`button`,{className:`ue-secondary-action`,type:`button`,onClick:()=>void Y(),disabled:z,children:[(0,w.jsx)(x,{size:16}),(0,w.jsx)(`span`,{children:b(`settingsDiagnosticsRun`)})]})]}),(0,w.jsxs)(`div`,{className:`ue-diagnostics-grid`,children:[G?(0,w.jsxs)(`div`,{className:`ue-diagnostic-card status-ok`,children:[(0,w.jsxs)(`div`,{className:`ue-diagnostic-title`,children:[(0,w.jsx)(x,{size:16}),(0,w.jsx)(`strong`,{children:b(`variantTitle`)}),(0,w.jsx)(`span`,{children:b(`variantIndexed`,{count:G.indexed})})]}),(0,w.jsx)(`p`,{children:b(`variantSubtitle`)}),(0,w.jsxs)(`div`,{className:`ue-diagnostic-meta`,children:[(0,w.jsx)(`span`,{children:b(`settingsDiagnosticImages`,{count:G.total})}),(0,w.jsx)(`span`,{children:b(`variantPending`,{count:G.pending})}),G.failed?(0,w.jsx)(`span`,{children:b(`variantFailed`,{count:G.failed})}):null]}),G.last_error?(0,w.jsx)(`small`,{children:G.last_error}):null]}):null,(U.length?U:k).map(e=>{let t=U.find(t=>t.id===e.id)??null,n=t?.status??(e.exists?`ok`:`missing`);return(0,w.jsxs)(`div`,{className:`ue-diagnostic-card status-${n}`,children:[(0,w.jsxs)(`div`,{className:`ue-diagnostic-title`,children:[n===`ok`?(0,w.jsx)(x,{size:16}):(0,w.jsx)(l,{size:16}),(0,w.jsx)(`strong`,{children:e.name}),(0,w.jsx)(`span`,{children:b(`settingsStatus_${n}`)})]}),(0,w.jsx)(`p`,{children:e.path}),(0,w.jsxs)(`div`,{className:`ue-diagnostic-meta`,children:[(0,w.jsx)(`span`,{children:b(`settingsDiagnosticImages`,{count:e.image_count??0})}),t?(0,w.jsx)(`span`,{children:b(`settingsDiagnosticFolders`,{count:t.directory_count})}):null,t?.free_bytes==null?null:(0,w.jsx)(`span`,{children:g(t.free_bytes)}),t?.overlaps.length?(0,w.jsx)(`span`,{children:b(`settingsDiagnosticOverlap`,{count:t.overlaps.length})}):null]}),t?.error?(0,w.jsx)(`small`,{children:t.error}):null]},e.id)})]})]})]})};export{O as SettingsWorkspace}; \ No newline at end of file diff --git a/gallery_ui/dist/assets/SettingsWorkspace-CZMkuJbF.js b/gallery_ui/dist/assets/SettingsWorkspace-CZMkuJbF.js deleted file mode 100644 index 764fc3f..0000000 --- a/gallery_ui/dist/assets/SettingsWorkspace-CZMkuJbF.js +++ /dev/null @@ -1 +0,0 @@ -import{a as e,i as t,n,r,s as i}from"./I18nProvider-cZczvL7B.js";import{t as a}from"./image-plus-C2AXraiD.js";import{t as o}from"./save-DFeVqt65.js";import{$ as s,C as c,E as l,K as u,N as d,U as f,_ as p,k as m,nt as h,u as g,w as _}from"./index-DWGqjUOp.js";var v=t(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),y=t(`square-split-vertical`,[[`path`,{d:`M5 8V5c0-1 1-2 2-2h10c1 0 2 1 2 2v3`,key:`1pi83i`}],[`path`,{d:`M19 16v3c0 1-1 2-2 2H7c-1 0-2-1-2-2v-3`,key:`ido5k7`}],[`line`,{x1:`4`,x2:`20`,y1:`12`,y2:`12`,key:`1e0a9i`}]]),b=t(`chevrons-left`,[[`path`,{d:`m11 17-5-5 5-5`,key:`13zhaf`}],[`path`,{d:`m18 17-5-5 5-5`,key:`h8a8et`}]]),x=t(`mouse-pointer-2`,[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z`,key:`edeuup`}]]),S=t(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),C=i(e(),1),w=r(),T=()=>({name:``,path:``,kind:`custom`,enabled:!0,writable:!1,recursive:!0,import_target:!1}),E=e=>e===`output`?(0,w.jsx)(f,{size:16}):(0,w.jsx)(u,{size:16}),D=[{key:`defaultSelectionMode`,icon:x,titleKey:`settingsPrefDefaultSelection`,descriptionKey:`settingsPrefDefaultSelectionHint`},{key:`collapseSidebarOnLaunch`,icon:b,titleKey:`settingsPrefCollapseSidebar`,descriptionKey:`settingsPrefCollapseSidebarHint`},{key:`enableImagePrefetch`,icon:a,titleKey:`settingsPrefImagePrefetch`,descriptionKey:`settingsPrefImagePrefetchHint`},{key:`enableLiveGalleryRefresh`,icon:d,titleKey:`settingsPrefLiveRefresh`,descriptionKey:`settingsPrefLiveRefreshHint`},{key:`defaultFolderTreeView`,icon:y,titleKey:`settingsPrefFolderTree`,descriptionKey:`settingsPrefFolderTreeHint`}],O=({sources:e,preferences:t,onPreferencesChange:r,onSourcesChange:i,onRestartOnboarding:a,onDirtyChange:y})=>{let{t:b}=n(),{confirm:x}=p(),{runOperation:O}=_(),[k,A]=(0,C.useState)(e),[j,M]=(0,C.useState)(e[0]?.id??`new`),[N,P]=(0,C.useState)(()=>T()),[F,I]=(0,C.useState)(()=>T()),L=(0,C.useRef)(!1),R=(0,C.useRef)(null),[z,B]=(0,C.useState)(!1),[V,H]=(0,C.useState)(``),[U,W]=(0,C.useState)([]),[G,K]=(0,C.useState)(null);(0,C.useEffect)(()=>{A(e),M(t=>t!==`new`&&!e.some(e=>e.id===t)&&e[0]?e[0].id:t)},[e]);let q=(0,C.useMemo)(()=>k.find(e=>e.id===j)??null,[k,j]);(0,C.useEffect)(()=>{if(!(L.current&&R.current===j)){if(R.current=j,q){I({...q}),P({...q}),H(``);return}P(T()),I(T())}},[q,j]),(0,C.useEffect)(()=>{c.getFingerprintStatus().then(K).catch(()=>K(null))},[]);let J=async(e=!1)=>{let t=await c.listGallerySources(e);return A(t),i(),t},Y=async()=>{B(!0);try{W(await O(()=>c.diagnoseGallerySources(),{pending:b(`operationRunDiagnostics`),success:b(`settingsDiagnosticsDone`),error:e=>e instanceof Error?e.message:b(`settingsDiagnosticsError`)}))}catch{W([])}finally{B(!1)}},X=[`name`,`path`,`enabled`,`writable`,`recursive`,`import_target`],Z=F,Q=X.some(e=>N[e]!==Z[e]);(0,C.useEffect)(()=>{L.current=Q},[Q]),(0,C.useEffect)(()=>(y?.(Q),()=>y?.(!1)),[Q,y]),(0,C.useEffect)(()=>{if(!Q)return;let e=e=>{e.preventDefault(),e.returnValue=``};return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[Q]);let $=async e=>{z||e===j||Q&&!await x({title:b(`qolDiscardTitle`),message:b(`qolDiscardBody`),tone:`warning`,confirmLabel:b(`modalDiscardChanges`),cancelLabel:b(`libraryCancel`)})||(M(e),e===`new`&&P(T()),H(``))},ee=()=>{$(`new`)},te=e=>{P(t=>({...t,[e]:!t[e]}))},ne=async()=>{B(!0);try{let e=await O(()=>c.testGallerySourcePath(N.path),{pending:b(`operationTestPath`),success:e=>e.ok?b(`settingsPathOk`,{count:e.image_count}):b(`settingsPathMissing`),error:e=>e instanceof Error?e.message:b(`settingsPathError`)});H(e.ok?b(`settingsPathOk`,{count:e.image_count}):b(`settingsPathMissing`))}catch(e){H(e instanceof Error?e.message:b(`settingsPathError`))}finally{B(!1)}},re=async()=>{if(await x({title:b(`settingsSourceSave`),message:q?b(`settingsSourceSaveConfirm`,{name:q.name}):b(`settingsSourceCreateConfirm`,{name:N.name||N.path}),tone:`warning`,confirmLabel:b(`settingsSourceSave`),cancelLabel:b(`libraryCancel`)})){B(!0);try{let e=await O(()=>c.saveGallerySource(N),{pending:b(`operationSaveSource`),success:b(`settingsSourceSaved`),error:e=>e instanceof Error?e.message:b(`settingsSourceSaveError`)});A(e.sources),P({...e.source}),I({...e.source}),M(e.source.id),i()}catch{}finally{B(!1)}}},ie=async()=>{if(!(!q||q.locked)&&await x({title:b(`settingsSourceDelete`),message:b(`settingsSourceDeleteConfirm`,{name:q.name}),tone:`danger`,confirmLabel:b(`commonDelete`),cancelLabel:b(`libraryCancel`)})){B(!0);try{let e=await O(()=>c.deleteGallerySource(q.id),{pending:b(`operationDeleteSource`),success:b(`settingsSourceDeleted`),error:e=>e instanceof Error?e.message:b(`settingsSourceDeleteError`)});A(e.sources),M(e.sources[0]?.id??`new`),i()}catch{}finally{B(!1)}}},ae=k.reduce((e,t)=>e+(t.image_count??0),0),oe=k.filter(e=>e.enabled&&e.exists).length;return(0,w.jsxs)(`section`,{className:`ue-settings-workspace`,children:[(0,w.jsxs)(`div`,{className:`ue-settings-hero`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`span`,{className:`ue-section-kicker`,children:b(`settingsKicker`)}),(0,w.jsx)(`h1`,{children:b(`settingsTitle`)}),(0,w.jsx)(`p`,{children:b(`settingsSubtitle`)})]}),(0,w.jsxs)(`div`,{className:`ue-settings-metrics`,"aria-label":b(`settingsSourcesTitle`),children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`strong`,{children:oe}),(0,w.jsx)(`span`,{children:b(`settingsActiveSources`)})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`strong`,{children:ae}),(0,w.jsx)(`span`,{children:b(`settingsIndexedImages`)})]})]})]}),(0,w.jsxs)(`nav`,{className:`ue-qol-section-nav`,"aria-label":b(`navSettings`),children:[(0,w.jsx)(`a`,{href:`#ue-preferences`,children:b(`settingsPreferencesTitle`)}),(0,w.jsx)(`a`,{href:`#ue-sources`,children:b(`settingsSourcesTitle`)}),(0,w.jsx)(`a`,{href:`#ue-diagnostics`,children:b(`settingsDiagnostics`)})]}),(0,w.jsxs)(`div`,{className:`ue-settings-preferences`,id:`ue-preferences`,children:[(0,w.jsxs)(`div`,{className:`ue-settings-panel-heading`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`h2`,{children:b(`settingsPreferencesTitle`)}),(0,w.jsx)(`p`,{children:b(`settingsPreferencesHint`)})]}),(0,w.jsx)(m,{size:18})]}),(0,w.jsxs)(`label`,{className:`ue-density-setting`,children:[(0,w.jsx)(`span`,{children:b(`settingsDensity`)}),(0,w.jsxs)(`select`,{value:t.interfaceDensity||`standard`,onChange:e=>r({interfaceDensity:e.target.value===`compact`?`compact`:`standard`}),children:[(0,w.jsx)(`option`,{value:`standard`,children:b(`densityStandard`)}),(0,w.jsx)(`option`,{value:`compact`,children:b(`densityCompact`)})]}),(0,w.jsx)(`small`,{children:b(`settingsDensityHint`)})]}),(0,w.jsxs)(`div`,{className:`ue-settings-onboarding-card`,"data-tour-id":`settings-onboarding`,children:[(0,w.jsx)(`span`,{className:`ue-settings-onboarding-icon`,children:(0,w.jsx)(v,{size:18})}),(0,w.jsxs)(`span`,{className:`ue-settings-onboarding-copy`,children:[(0,w.jsx)(`strong`,{children:b(`settingsOnboardingTitle`)}),(0,w.jsx)(`small`,{children:b(`settingsOnboardingHint`)})]}),(0,w.jsxs)(`button`,{className:`ue-secondary-action`,type:`button`,disabled:Q||z,onClick:a,children:[(0,w.jsx)(v,{size:16}),(0,w.jsx)(`span`,{children:b(`settingsOnboardingRestart`)})]})]}),(0,w.jsx)(`div`,{className:`ue-preference-grid`,children:D.map(e=>{let n=e.icon,i=t[e.key];return(0,w.jsxs)(`button`,{className:`ue-preference-card ${i?`active`:``}`,type:`button`,onClick:()=>r({[e.key]:!i}),"aria-pressed":i,children:[(0,w.jsx)(`span`,{className:`ue-preference-icon`,children:(0,w.jsx)(n,{size:16})}),(0,w.jsxs)(`span`,{className:`ue-preference-copy`,children:[(0,w.jsx)(`strong`,{children:b(e.titleKey)}),(0,w.jsx)(`small`,{children:b(e.descriptionKey)})]}),(0,w.jsx)(`span`,{className:`ue-toggle-dot`,children:i?(0,w.jsx)(s,{size:13}):null})]},e.key)})})]}),(0,w.jsxs)(`div`,{className:`ue-settings-layout`,id:`ue-sources`,children:[(0,w.jsxs)(`aside`,{className:`ue-settings-source-list`,"data-tour-id":`settings-sources`,children:[(0,w.jsxs)(`div`,{className:`ue-settings-panel-heading`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`h2`,{children:b(`settingsSourcesTitle`)}),(0,w.jsx)(`p`,{children:b(`settingsSourcesHint`)})]}),(0,w.jsx)(`button`,{className:`ue-icon-btn`,type:`button`,disabled:z||Q,onClick:()=>{B(!0),J(!0).catch(e=>H(e instanceof Error?e.message:b(`settingsDiagnosticsError`))).finally(()=>B(!1))},title:b(`settingsSourceScan`),children:(0,w.jsx)(d,{size:15})}),(0,w.jsx)(`button`,{className:`ue-icon-btn`,type:`button`,onClick:()=>void Y(),title:b(`settingsDiagnostics`),children:(0,w.jsx)(S,{size:15})})]}),(0,w.jsx)(`div`,{className:`ue-source-stack`,children:k.map(e=>(0,w.jsxs)(`button`,{className:`ue-source-card ${e.id===j?`active`:``} ${e.exists?``:`is-missing`}`,type:`button`,disabled:z,"aria-pressed":e.id===j,onClick:()=>void $(e.id),children:[(0,w.jsx)(`span`,{className:`ue-source-icon`,children:E(e.kind)}),(0,w.jsxs)(`span`,{className:`ue-source-main`,children:[(0,w.jsx)(`strong`,{children:e.name}),(0,w.jsx)(`small`,{children:e.path})]}),(0,w.jsx)(`span`,{className:`ue-source-meta`,children:e.image_count??0})]},e.id))}),(0,w.jsxs)(`button`,{className:`ue-secondary-action`,type:`button`,onClick:ee,children:[(0,w.jsx)(u,{size:16}),(0,w.jsx)(`span`,{children:b(`settingsAddSource`)})]})]}),(0,w.jsxs)(`div`,{className:`ue-settings-editor`,children:[(0,w.jsxs)(`div`,{className:`ue-settings-panel-heading`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`h2`,{children:q?q.name:b(`settingsNewSource`)}),(0,w.jsx)(`p`,{children:q?.locked?b(`settingsDefaultLockedHint`):b(`settingsCustomHint`)})]}),(0,w.jsx)(m,{size:18})]}),(0,w.jsxs)(`div`,{className:`ue-settings-form`,children:[(0,w.jsx)(`p`,{className:`ue-qol-note`,role:`status`,children:b(Q?`qolUnsaved`:`qolSaved`)}),(0,w.jsxs)(`label`,{children:[(0,w.jsx)(`span`,{children:b(`settingsSourceName`)}),(0,w.jsx)(`input`,{value:N.name,disabled:z||!!q?.locked,onChange:e=>P(t=>({...t,name:e.target.value})),placeholder:b(`settingsSourceNamePlaceholder`)})]}),(0,w.jsxs)(`label`,{children:[(0,w.jsx)(`span`,{children:b(`settingsSourcePath`)}),(0,w.jsx)(`input`,{value:N.path,disabled:z||!!q?.locked,onChange:e=>P(t=>({...t,path:e.target.value})),placeholder:b(`settingsSourcePathPlaceholder`)})]}),(0,w.jsx)(`div`,{className:`ue-settings-toggle-grid`,children:[`enabled`,`writable`,`recursive`,`import_target`].map(e=>(0,w.jsxs)(`button`,{className:`ue-toggle-row ${N[e]?`active`:``}`,type:`button`,disabled:z,"aria-pressed":N[e],onClick:()=>te(e),children:[(0,w.jsx)(`span`,{children:b(`settingsSource${e===`import_target`?`ImportTarget`:e[0].toUpperCase()+e.slice(1)}`)}),(0,w.jsx)(`span`,{className:`ue-toggle-dot`,children:N[e]?(0,w.jsx)(s,{size:13}):null})]},e))}),V?(0,w.jsx)(`p`,{className:`ue-settings-test-result`,children:V}):null,(0,w.jsxs)(`div`,{className:`ue-settings-actions`,children:[(0,w.jsxs)(`button`,{className:`ue-secondary-action`,type:`button`,onClick:ne,disabled:z,children:[(0,w.jsx)(f,{size:16}),(0,w.jsx)(`span`,{children:b(`settingsSourceTest`)})]}),(0,w.jsxs)(`button`,{className:`ue-primary-action`,type:`button`,onClick:re,disabled:z||!Q||!N.path.trim()||!N.name.trim(),children:[(0,w.jsx)(o,{size:16}),(0,w.jsx)(`span`,{children:b(`settingsSourceSave`)})]}),q&&!q.locked?(0,w.jsxs)(`button`,{className:`ue-danger-action`,type:`button`,onClick:ie,disabled:z,children:[(0,w.jsx)(l,{size:16}),(0,w.jsx)(`span`,{children:b(`settingsSourceDelete`)})]}):null]})]})]})]}),(0,w.jsxs)(`div`,{id:`ue-diagnostics`,className:`ue-settings-diagnostics`,"data-tour-id":`settings-diagnostics`,children:[(0,w.jsxs)(`div`,{className:`ue-settings-panel-heading`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`h2`,{children:b(`settingsDiagnostics`)}),(0,w.jsx)(`p`,{children:b(`settingsDiagnosticsHint`)})]}),(0,w.jsxs)(`button`,{className:`ue-secondary-action`,type:`button`,onClick:()=>void Y(),disabled:z,children:[(0,w.jsx)(S,{size:16}),(0,w.jsx)(`span`,{children:b(`settingsDiagnosticsRun`)})]})]}),(0,w.jsxs)(`div`,{className:`ue-diagnostics-grid`,children:[G?(0,w.jsxs)(`div`,{className:`ue-diagnostic-card status-ok`,children:[(0,w.jsxs)(`div`,{className:`ue-diagnostic-title`,children:[(0,w.jsx)(S,{size:16}),(0,w.jsx)(`strong`,{children:b(`variantTitle`)}),(0,w.jsx)(`span`,{children:b(`variantIndexed`,{count:G.indexed})})]}),(0,w.jsx)(`p`,{children:b(`variantSubtitle`)}),(0,w.jsxs)(`div`,{className:`ue-diagnostic-meta`,children:[(0,w.jsx)(`span`,{children:b(`settingsDiagnosticImages`,{count:G.total})}),(0,w.jsx)(`span`,{children:b(`variantPending`,{count:G.pending})}),G.failed?(0,w.jsx)(`span`,{children:b(`variantFailed`,{count:G.failed})}):null]}),G.last_error?(0,w.jsx)(`small`,{children:G.last_error}):null]}):null,(U.length?U:k).map(e=>{let t=U.find(t=>t.id===e.id)??null,n=t?.status??(e.exists?`ok`:`missing`);return(0,w.jsxs)(`div`,{className:`ue-diagnostic-card status-${n}`,children:[(0,w.jsxs)(`div`,{className:`ue-diagnostic-title`,children:[n===`ok`?(0,w.jsx)(S,{size:16}):(0,w.jsx)(h,{size:16}),(0,w.jsx)(`strong`,{children:e.name}),(0,w.jsx)(`span`,{children:b(`settingsStatus_${n}`)})]}),(0,w.jsx)(`p`,{children:e.path}),(0,w.jsxs)(`div`,{className:`ue-diagnostic-meta`,children:[(0,w.jsx)(`span`,{children:b(`settingsDiagnosticImages`,{count:e.image_count??0})}),t?(0,w.jsx)(`span`,{children:b(`settingsDiagnosticFolders`,{count:t.directory_count})}):null,t?.free_bytes==null?null:(0,w.jsx)(`span`,{children:g(t.free_bytes)}),t?.overlaps.length?(0,w.jsx)(`span`,{children:b(`settingsDiagnosticOverlap`,{count:t.overlaps.length})}):null]}),t?.error?(0,w.jsx)(`small`,{children:t.error}):null]},e.id)})]})]})]})};export{O as SettingsWorkspace}; \ No newline at end of file diff --git a/gallery_ui/dist/assets/VariantGroupsView-BT_Lf8GR.js b/gallery_ui/dist/assets/VariantGroupsView-BT_Lf8GR.js new file mode 100644 index 0000000..1eba8a5 --- /dev/null +++ b/gallery_ui/dist/assets/VariantGroupsView-BT_Lf8GR.js @@ -0,0 +1 @@ +import{a as e,i as t,n,r,s as i}from"./I18nProvider-DEfiLn3N.js";import{G as a,P as o,U as s,l as c,n as l}from"./index-CKow1Wte.js";var u=t(`copy-check`,[[`path`,{d:`m12 15 2 2 4-4`,key:`2c609p`}],[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),d=t(`file-stack`,[[`path`,{d:`M11 21a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1`,key:`likhh7`}],[`path`,{d:`M16 16a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1`,key:`17ky3x`}],[`path`,{d:`M21 6a2 2 0 0 0-.586-1.414l-2-2A2 2 0 0 0 17 2h-3a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1z`,key:`1hyeo0`}]]),f=t(`fingerprint-pattern`,[[`path`,{d:`M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4`,key:`1nerag`}],[`path`,{d:`M14 13.12c0 2.38 0 6.38-1 8.88`,key:`o46ks0`}],[`path`,{d:`M17.29 21.02c.12-.6.43-2.3.5-3.02`,key:`ptglia`}],[`path`,{d:`M2 12a10 10 0 0 1 18-6`,key:`ydlgp0`}],[`path`,{d:`M2 16h.01`,key:`1gqxmh`}],[`path`,{d:`M21.8 16c.2-2 .131-5.354 0-6`,key:`drycrb`}],[`path`,{d:`M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2`,key:`1tidbn`}],[`path`,{d:`M8.65 22c.21-.66.45-1.32.57-2`,key:`13wd9y`}],[`path`,{d:`M9 6.8a6 6 0 0 1 9 5.2v2`,key:`1fr1j5`}]]),p=t(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),m=i(e(),1),h=r(),g=[{value:``,icon:s,key:`variantFilterAll`},{value:`exact_duplicate`,icon:u,key:`variantType_exact_duplicate`},{value:`near_duplicate`,icon:f,key:`variantType_near_duplicate`},{value:`same_prompt`,icon:d,key:`variantType_same_prompt`},{value:`same_workflow`,icon:p,key:`variantType_same_workflow`},{value:`filename_series`,icon:a,key:`variantType_filename_series`}],_=({onExit:e,groups:t,selectedType:r,status:i,loading:a,error:u,onTypeChange:d,onRefresh:f,onOpenGroup:p})=>{let{t:_,locale:v}=n(),[y,b]=(0,m.useState)(``),[x,S]=(0,m.useState)(`latest`),C=(0,m.useMemo)(()=>t.filter(e=>`${e.title} ${e.cover_image.filename}`.toLocaleLowerCase(v).includes(y.trim().toLocaleLowerCase(v))).sort((e,t)=>x===`count`?t.count-e.count:x===`score`?t.confidence-e.confidence:t.latest_created_at-e.latest_created_at),[t,y,x,v]);return(0,h.jsxs)(`div`,{className:`ue-variant-workspace`,"aria-busy":a,children:[(0,h.jsxs)(`header`,{className:`ue-variant-hero`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`span`,{className:`ue-section-kicker`,children:_(`variantKicker`)}),(0,h.jsx)(`h2`,{children:_(`variantTitle`)}),(0,h.jsx)(`p`,{children:_(`variantSubtitle`)}),(0,h.jsx)(`p`,{className:`ue-scope-note`,children:_(`variantScopeNotice`)})]}),(0,h.jsxs)(`div`,{className:`ue-qol-mode-actions`,children:[e?(0,h.jsx)(`button`,{className:`ue-secondary-action`,type:`button`,onClick:e,children:_(`qolBackGallery`)}):null,(0,h.jsxs)(`button`,{className:`ue-secondary-action`,type:`button`,onClick:f,disabled:a,children:[(0,h.jsx)(o,{size:15}),(0,h.jsx)(`span`,{children:_(a?`variantAnalyzing`:`variantRefresh`)})]})]})]}),(0,h.jsx)(`div`,{className:`ue-variant-filter-row`,"aria-label":_(`variantFilters`),children:g.map(({value:e,icon:t,key:n})=>(0,h.jsxs)(`button`,{className:r===e?`is-active`:``,type:`button`,"aria-pressed":r===e,onClick:()=>d(e),children:[(0,h.jsx)(t,{size:14}),(0,h.jsx)(`span`,{children:_(n)})]},e||`all`))}),(0,h.jsx)(`p`,{className:`ue-qol-note`,children:_(`qolVariantSafety`)}),(0,h.jsxs)(`div`,{className:`ue-variant-tools`,children:[(0,h.jsx)(`input`,{"aria-label":_(`qolVariantSearch`),placeholder:_(`qolVariantSearch`),value:y,onChange:e=>b(e.target.value)}),(0,h.jsxs)(`select`,{"aria-label":_(`qolVariantSort`),value:x,onChange:e=>S(e.target.value),children:[(0,h.jsx)(`option`,{value:`latest`,children:_(`qolVariantNewest`)}),(0,h.jsx)(`option`,{value:`count`,children:_(`qolVariantLargest`)}),(0,h.jsx)(`option`,{value:`score`,children:_(`qolVariantScore`)})]}),y?(0,h.jsx)(`button`,{type:`button`,className:`ue-secondary-action`,onClick:()=>b(``),children:_(`filterReset`)}):null]}),(0,h.jsx)(`p`,{className:`ue-qol-note`,role:`status`,children:_(`qolVariantCount`,{shown:C.length,total:t.length})}),t.length>0&&!C.length?(0,h.jsx)(`p`,{className:`ue-qol-note`,children:_(`qolNoMatches`)}):null,i?(0,h.jsxs)(`div`,{className:`ue-variant-status`,children:[(0,h.jsx)(`span`,{children:_(`variantIndexed`,{count:i.indexed})}),(0,h.jsx)(`span`,{children:_(`variantPending`,{count:i.pending})}),i.failed?(0,h.jsx)(`span`,{children:_(`variantFailed`,{count:i.failed})}):null]}):null,u?(0,h.jsx)(`div`,{className:`ue-inline-error`,children:u}):null,a&&!t.length?(0,h.jsxs)(`div`,{className:`ue-gallery-state`,children:[(0,h.jsx)(`div`,{className:`ue-loading-orb`}),(0,h.jsx)(`p`,{children:_(`variantAnalyzing`)})]}):t.length===0?(0,h.jsxs)(`div`,{className:`ue-gallery-state ue-gallery-state--empty`,children:[(0,h.jsx)(s,{size:42,strokeWidth:1.2}),(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`h3`,{children:_(`variantEmptyTitle`)}),(0,h.jsx)(`p`,{children:_(`variantEmptyText`)})]})]}):(0,h.jsx)(`div`,{className:`ue-variant-grid`,children:C.map(e=>(0,h.jsxs)(`button`,{className:`ue-variant-card`,type:`button`,onClick:()=>p(e),children:[(0,h.jsx)(`span`,{className:`ue-variant-cover`,children:(0,h.jsx)(`img`,{src:l(e.cover_image),alt:e.cover_image.filename,loading:`lazy`,decoding:`async`})}),(0,h.jsxs)(`span`,{className:`ue-variant-card-main`,children:[(0,h.jsxs)(`span`,{className:`ue-variant-card-topline`,children:[(0,h.jsx)(`strong`,{children:_(`variantType_${e.type}`)}),(0,h.jsxs)(`em`,{title:_(`variantRuleScore`),"aria-label":`${_(`variantRuleScore`)}: ${Math.round(e.confidence*100)}`,children:[Math.round(e.confidence*100),`/100`]})]}),(0,h.jsx)(`span`,{className:`ue-variant-card-title`,title:e.title,children:e.title}),(0,h.jsxs)(`span`,{className:`ue-variant-card-meta`,children:[_(`variantImageCount`,{count:e.count}),(0,h.jsx)(`span`,{children:c(e.latest_created_at,v)})]}),(0,h.jsx)(`span`,{className:`ue-variant-preview-strip`,children:e.images_preview.slice(0,4).map(e=>(0,h.jsx)(`img`,{src:l(e),alt:e.filename,loading:`lazy`,decoding:`async`},e.relative_path))})]})]},e.id))})]})};export{_ as VariantGroupsView}; \ No newline at end of file diff --git a/gallery_ui/dist/assets/VariantGroupsView-BdO8HmPI.js b/gallery_ui/dist/assets/VariantGroupsView-BdO8HmPI.js deleted file mode 100644 index 67b8bf2..0000000 --- a/gallery_ui/dist/assets/VariantGroupsView-BdO8HmPI.js +++ /dev/null @@ -1 +0,0 @@ -import{a as e,i as t,n,r,s as i}from"./I18nProvider-cZczvL7B.js";import{M as a,V as o,at as s,l as c,n as l}from"./index-DWGqjUOp.js";var u=t(`fingerprint-pattern`,[[`path`,{d:`M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4`,key:`1nerag`}],[`path`,{d:`M14 13.12c0 2.38 0 6.38-1 8.88`,key:`o46ks0`}],[`path`,{d:`M17.29 21.02c.12-.6.43-2.3.5-3.02`,key:`ptglia`}],[`path`,{d:`M2 12a10 10 0 0 1 18-6`,key:`ydlgp0`}],[`path`,{d:`M2 16h.01`,key:`1gqxmh`}],[`path`,{d:`M21.8 16c.2-2 .131-5.354 0-6`,key:`drycrb`}],[`path`,{d:`M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2`,key:`1tidbn`}],[`path`,{d:`M8.65 22c.21-.66.45-1.32.57-2`,key:`13wd9y`}],[`path`,{d:`M9 6.8a6 6 0 0 1 9 5.2v2`,key:`1fr1j5`}]]),d=t(`copy-check`,[[`path`,{d:`m12 15 2 2 4-4`,key:`2c609p`}],[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),f=t(`file-stack`,[[`path`,{d:`M11 21a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1`,key:`likhh7`}],[`path`,{d:`M16 16a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1`,key:`17ky3x`}],[`path`,{d:`M21 6a2 2 0 0 0-.586-1.414l-2-2A2 2 0 0 0 17 2h-3a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1z`,key:`1hyeo0`}]]),p=t(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),m=i(e(),1),h=r(),g=[{value:``,icon:s,key:`variantFilterAll`},{value:`exact_duplicate`,icon:d,key:`variantType_exact_duplicate`},{value:`near_duplicate`,icon:u,key:`variantType_near_duplicate`},{value:`same_prompt`,icon:f,key:`variantType_same_prompt`},{value:`same_workflow`,icon:p,key:`variantType_same_workflow`},{value:`filename_series`,icon:o,key:`variantType_filename_series`}],_=({onExit:e,groups:t,selectedType:r,status:i,loading:o,error:u,onTypeChange:d,onRefresh:f,onOpenGroup:p})=>{let{t:_,locale:v}=n(),[y,b]=(0,m.useState)(``),[x,S]=(0,m.useState)(`latest`),C=(0,m.useMemo)(()=>t.filter(e=>`${e.title} ${e.cover_image.filename}`.toLocaleLowerCase(v).includes(y.trim().toLocaleLowerCase(v))).sort((e,t)=>x===`count`?t.count-e.count:x===`score`?t.confidence-e.confidence:t.latest_created_at-e.latest_created_at),[t,y,x,v]);return(0,h.jsxs)(`div`,{className:`ue-variant-workspace`,"aria-busy":o,children:[(0,h.jsxs)(`header`,{className:`ue-variant-hero`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`span`,{className:`ue-section-kicker`,children:_(`variantKicker`)}),(0,h.jsx)(`h2`,{children:_(`variantTitle`)}),(0,h.jsx)(`p`,{children:_(`variantSubtitle`)}),(0,h.jsx)(`p`,{className:`ue-scope-note`,children:_(`variantScopeNotice`)})]}),(0,h.jsxs)(`div`,{className:`ue-qol-mode-actions`,children:[e?(0,h.jsx)(`button`,{className:`ue-secondary-action`,type:`button`,onClick:e,children:_(`qolBackGallery`)}):null,(0,h.jsxs)(`button`,{className:`ue-secondary-action`,type:`button`,onClick:f,disabled:o,children:[(0,h.jsx)(a,{size:15}),(0,h.jsx)(`span`,{children:_(o?`variantAnalyzing`:`variantRefresh`)})]})]})]}),(0,h.jsx)(`div`,{className:`ue-variant-filter-row`,"aria-label":_(`variantFilters`),children:g.map(({value:e,icon:t,key:n})=>(0,h.jsxs)(`button`,{className:r===e?`is-active`:``,type:`button`,"aria-pressed":r===e,onClick:()=>d(e),children:[(0,h.jsx)(t,{size:14}),(0,h.jsx)(`span`,{children:_(n)})]},e||`all`))}),(0,h.jsx)(`p`,{className:`ue-qol-note`,children:_(`qolVariantSafety`)}),(0,h.jsxs)(`div`,{className:`ue-variant-tools`,children:[(0,h.jsx)(`input`,{"aria-label":_(`qolVariantSearch`),placeholder:_(`qolVariantSearch`),value:y,onChange:e=>b(e.target.value)}),(0,h.jsxs)(`select`,{"aria-label":_(`qolVariantSort`),value:x,onChange:e=>S(e.target.value),children:[(0,h.jsx)(`option`,{value:`latest`,children:_(`qolVariantNewest`)}),(0,h.jsx)(`option`,{value:`count`,children:_(`qolVariantLargest`)}),(0,h.jsx)(`option`,{value:`score`,children:_(`qolVariantScore`)})]}),y?(0,h.jsx)(`button`,{type:`button`,className:`ue-secondary-action`,onClick:()=>b(``),children:_(`filterReset`)}):null]}),(0,h.jsx)(`p`,{className:`ue-qol-note`,role:`status`,children:_(`qolVariantCount`,{shown:C.length,total:t.length})}),t.length>0&&!C.length?(0,h.jsx)(`p`,{className:`ue-qol-note`,children:_(`qolNoMatches`)}):null,i?(0,h.jsxs)(`div`,{className:`ue-variant-status`,children:[(0,h.jsx)(`span`,{children:_(`variantIndexed`,{count:i.indexed})}),(0,h.jsx)(`span`,{children:_(`variantPending`,{count:i.pending})}),i.failed?(0,h.jsx)(`span`,{children:_(`variantFailed`,{count:i.failed})}):null]}):null,u?(0,h.jsx)(`div`,{className:`ue-inline-error`,children:u}):null,o&&!t.length?(0,h.jsxs)(`div`,{className:`ue-gallery-state`,children:[(0,h.jsx)(`div`,{className:`ue-loading-orb`}),(0,h.jsx)(`p`,{children:_(`variantAnalyzing`)})]}):t.length===0?(0,h.jsxs)(`div`,{className:`ue-gallery-state ue-gallery-state--empty`,children:[(0,h.jsx)(s,{size:42,strokeWidth:1.2}),(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`h3`,{children:_(`variantEmptyTitle`)}),(0,h.jsx)(`p`,{children:_(`variantEmptyText`)})]})]}):(0,h.jsx)(`div`,{className:`ue-variant-grid`,children:C.map(e=>(0,h.jsxs)(`button`,{className:`ue-variant-card`,type:`button`,onClick:()=>p(e),children:[(0,h.jsx)(`span`,{className:`ue-variant-cover`,children:(0,h.jsx)(`img`,{src:l(e.cover_image),alt:e.cover_image.filename,loading:`lazy`,decoding:`async`})}),(0,h.jsxs)(`span`,{className:`ue-variant-card-main`,children:[(0,h.jsxs)(`span`,{className:`ue-variant-card-topline`,children:[(0,h.jsx)(`strong`,{children:_(`variantType_${e.type}`)}),(0,h.jsxs)(`em`,{title:_(`variantRuleScore`),"aria-label":`${_(`variantRuleScore`)}: ${Math.round(e.confidence*100)}`,children:[Math.round(e.confidence*100),`/100`]})]}),(0,h.jsx)(`span`,{className:`ue-variant-card-title`,title:e.title,children:e.title}),(0,h.jsxs)(`span`,{className:`ue-variant-card-meta`,children:[_(`variantImageCount`,{count:e.count}),(0,h.jsx)(`span`,{children:c(e.latest_created_at,v)})]}),(0,h.jsx)(`span`,{className:`ue-variant-preview-strip`,children:e.images_preview.slice(0,4).map(e=>(0,h.jsx)(`img`,{src:l(e),alt:e.filename,loading:`lazy`,decoding:`async`},e.relative_path))})]})]},e.id))})]})};export{_ as VariantGroupsView}; \ No newline at end of file diff --git a/gallery_ui/dist/assets/WorkbenchWorkspace-CpFPCzJz.js b/gallery_ui/dist/assets/WorkbenchWorkspace-CpFPCzJz.js new file mode 100644 index 0000000..3007925 --- /dev/null +++ b/gallery_ui/dist/assets/WorkbenchWorkspace-CpFPCzJz.js @@ -0,0 +1 @@ +import{a as e,i as t,n,r,s as i}from"./I18nProvider-DEfiLn3N.js";import{t as ee}from"./copy-CoBcvjUE.js";import{t as a}from"./sparkles-elJjV352.js";import{t as o}from"./wand-sparkles-262S5lQG.js";import{A as te,C as ne,I as re,N as ie,Q as ae,T as oe,W as s,f as se,w as ce}from"./index-CKow1Wte.js";var le=t(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),ue=t(`bookmark-plus`,[[`path`,{d:`M12 7v6`,key:`lw1j43`}],[`path`,{d:`M15 10H9`,key:`o6yqo3`}],[`path`,{d:`M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z`,key:`oz39mx`}]]),de=t(`compass`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]),fe=t(`earth`,[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),pe=t(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),me=t(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),he=t(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),ge=t(`toggle-left`,[[`circle`,{cx:`9`,cy:`12`,r:`3`,key:`u3jwor`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`7`,key:`g7kal2`}]]),_e=t(`toggle-right`,[[`circle`,{cx:`15`,cy:`12`,r:`3`,key:`1afu0r`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`7`,key:`g7kal2`}]]),c=i(e(),1),l=r(),ve=`ue-artist-generator-v2`,u=[{id:`pinterest`,title:`Pinterest`,url:`https://www.pinterest.com/`,type:`moodboard`,frequency:96,recommendation:95,regionKey:`inspirationRegionGlobal`,descriptionKey:`inspirationPinterestDesc`,bestForKey:`inspirationPinterestBest`},{id:`huaban`,title:`Huaban`,url:`https://huaban.com/`,type:`moodboard`,frequency:88,recommendation:90,regionKey:`inspirationRegionChina`,descriptionKey:`inspirationHuabanDesc`,bestForKey:`inspirationHuabanBest`},{id:`behance`,title:`Behance`,url:`https://www.behance.net/`,type:`portfolio`,frequency:84,recommendation:92,regionKey:`inspirationRegionGlobal`,descriptionKey:`inspirationBehanceDesc`,bestForKey:`inspirationBehanceBest`},{id:`artstation`,title:`ArtStation`,url:`https://www.artstation.com/`,type:`illustration`,frequency:82,recommendation:91,regionKey:`inspirationRegionGlobal`,descriptionKey:`inspirationArtStationDesc`,bestForKey:`inspirationArtStationBest`},{id:`dribbble`,title:`Dribbble`,url:`https://dribbble.com/`,type:`product`,frequency:78,recommendation:86,regionKey:`inspirationRegionGlobal`,descriptionKey:`inspirationDribbbleDesc`,bestForKey:`inspirationDribbbleBest`},{id:`cosmos`,title:`Cosmos`,url:`https://www.cosmos.so/`,type:`moodboard`,frequency:68,recommendation:84,regionKey:`inspirationRegionGlobal`,descriptionKey:`inspirationCosmosDesc`,bestForKey:`inspirationCosmosBest`},{id:`arena`,title:`Are.na`,url:`https://www.are.na/`,type:`moodboard`,frequency:61,recommendation:80,regionKey:`inspirationRegionGlobal`,descriptionKey:`inspirationArenaDesc`,bestForKey:`inspirationArenaBest`},{id:`designspiration`,title:`Designspiration`,url:`https://www.designspiration.com/`,type:`moodboard`,frequency:59,recommendation:78,regionKey:`inspirationRegionGlobal`,descriptionKey:`inspirationDesignspirationDesc`,bestForKey:`inspirationDesignspirationBest`},{id:`lapa`,title:`Lapa Ninja`,url:`https://www.lapa.ninja/`,type:`product`,frequency:54,recommendation:76,regionKey:`inspirationRegionGlobal`,descriptionKey:`inspirationLapaDesc`,bestForKey:`inspirationLapaBest`},{id:`lexica`,title:`Lexica`,url:`https://lexica.art/`,type:`ai`,frequency:64,recommendation:74,regionKey:`inspirationRegionGlobal`,descriptionKey:`inspirationLexicaDesc`,bestForKey:`inspirationLexicaBest`}],d=e=>{let t={"[":`]`,"(":`)`,"{":`}`},n=e.trim();for(;n.length>1;){let e=n[0],r=n[n.length-1];if(t[e]!==r)break;n=n.slice(1,-1).trim()}return n},ye=e=>d(e).replace(/^\d+(\.\d+)?::/,``).replace(/::$/,``).replace(/:\d+(\.\d+)?$/,``).replace(/^artist:/i,``).replace(/^by\s+/i,``).trim(),f=e=>e.replace(/_/g,` `).replace(/\s+/g,` `).trim(),p=e=>{let t=ye(e).replace(/^@+/,``),n=t.match(/^(.+?)_\((.+)\)$/)??t.match(/^(.+?)\((.+)\)$/);return n?`@${f(n[1].replace(/_+$/g,``).trim())} \\(${f(n[2].trim())}\\)`:`@${f(t)}`},m=({libraries:e,activeLibraryName:t,onLibrarySelect:r})=>{let{t:i}=n(),{pushToast:d}=se(),{runOperation:f}=ce(),[m,h]=(0,c.useState)(`artist`),[g,be]=(0,c.useState)(``),[_,xe]=(0,c.useState)(``),[v,Se]=(0,c.useState)(`standard`),[y,Ce]=(0,c.useState)(3),[b,x]=(0,c.useState)(``),[S,C]=(0,c.useState)([]),[w,T]=(0,c.useState)(`none`),[E,D]=(0,c.useState)(0),[O,k]=(0,c.useState)(`paren`),[A,j]=(0,c.useState)(0),[M,N]=(0,c.useState)(.5),[P,we]=(0,c.useState)(1.5),[F,Te]=(0,c.useState)(.5),[I,Ee]=(0,c.useState)(1.5),[L,De]=(0,c.useState)(!1),[R,Oe]=(0,c.useState)(`artist:{name}`),[z,ke]=(0,c.useState)(`anima`),[B,Ae]=(0,c.useState)(`@{tag},`),[V,H]=(0,c.useState)(``),[je,U]=(0,c.useState)([]),[W,G]=(0,c.useState)(0),[Me,Ne]=(0,c.useState)(!1),[K,Pe]=(0,c.useState)(``),[q,Fe]=(0,c.useState)(`recommendation`),[J,Y]=(0,c.useState)(`all`),[X,Ie]=(0,c.useState)(`pinterest`),Z=(0,c.useMemo)(()=>e.find(e=>e.filename.toLowerCase().includes(`artists`))?.filename??e[0]?.filename??``,[e]),Q=(0,c.useMemo)(()=>u.find(e=>e.id===X)??u[0],[X]),Le=(0,c.useMemo)(()=>b.split(`,`).map(e=>e.trim()).filter(Boolean).length,[b]),Re=(0,c.useMemo)(()=>V.split(`,`).map(e=>e.trim()).filter(Boolean).length,[V]),$=(0,c.useMemo)(()=>{let e=K.trim().toLowerCase();return u.filter(t=>{let n=J===`all`||t.type===J,r=[t.title,i(t.descriptionKey),i(t.bestForKey),i(t.regionKey),i(`inspirationType_${t.type}`)].join(` `).toLowerCase();return n&&(!e||r.includes(e))}).sort((e,t)=>q===`frequency`?t.frequency-e.frequency:q===`name`?e.title.localeCompare(t.title):t.recommendation-e.recommendation)},[K,q,J,i]);(0,c.useEffect)(()=>{$.length&&($.some(e=>e.id===X)||Ie($[0].id))},[$,X]),(0,c.useEffect)(()=>{!g&&Z&&be(Z)},[Z,g]),(0,c.useEffect)(()=>{g&&g!==t&&r(g)},[g,t,r]),(0,c.useEffect)(()=>{try{let e=window.localStorage.getItem(ve);if(!e)return;let t=JSON.parse(e);typeof t.mode==`string`&&Se(t.mode),typeof t.artistCount==`number`&&Ce(t.artistCount),typeof t.postCountFilterMode==`string`&&T(t.postCountFilterMode),typeof t.postCountThreshold==`number`&&D(t.postCountThreshold),typeof t.creativeBracketStyle==`string`&&k(t.creativeBracketStyle),typeof t.creativeNestLevels==`number`&&j(t.creativeNestLevels),typeof t.standardWeightMin==`number`&&N(t.standardWeightMin),typeof t.standardWeightMax==`number`&&we(t.standardWeightMax),typeof t.naiWeightMin==`number`&&Te(t.naiWeightMin),typeof t.naiWeightMax==`number`&&Ee(t.naiWeightMax),typeof t.enableCustomFormat==`boolean`&&De(t.enableCustomFormat),typeof t.customFormatString==`string`&&Oe(t.customFormatString),typeof t.formatToolMode==`string`&&ke(t.formatToolMode),typeof t.customFormatToolString==`string`&&Ae(t.customFormatToolString),Array.isArray(t.preselectedNames)&&C(t.preselectedNames.filter(e=>typeof e==`string`)),typeof t.finalResult==`string`&&x(t.finalResult),typeof t.formattedOutput==`string`&&H(t.formattedOutput),typeof t.activeTool==`string`&&h(t.activeTool),typeof t.inspirationSort==`string`&&Fe(t.inspirationSort),typeof t.inspirationType==`string`&&Y(t.inspirationType)}catch{}},[]),(0,c.useEffect)(()=>{let e={mode:v,artistCount:y,postCountFilterMode:w,postCountThreshold:E,creativeBracketStyle:O,creativeNestLevels:A,standardWeightMin:M,standardWeightMax:P,naiWeightMin:F,naiWeightMax:I,enableCustomFormat:L,customFormatString:R,formatToolMode:z,customFormatToolString:B,preselectedNames:S,finalResult:b,formattedOutput:V,activeTool:m,inspirationSort:q,inspirationType:J};try{window.localStorage.setItem(ve,JSON.stringify(e))}catch{}},[v,y,w,E,O,A,M,P,F,I,L,R,z,B,S,b,V,m,q,J]);let ze=()=>{if(!b.trim()){d(i(`artistNoLibraries`),`error`);return}let e=b.split(`,`).map(e=>e.trim()).filter(Boolean);if(z===`anima`){let t=e.map(e=>p(e)).join(`, `);H(t),d(i(`workbenchFormatApplied`),`success`);return}let t=B||`{tag}`,n=e.map(e=>t.replace(/{tag}/g,ye(e)).replace(/{anima}/g,p(e))).join(`, `);H(n),d(i(`workbenchFormatApplied`),`success`)};(0,c.useEffect)(()=>{if(!g){U([]),G(0);return}let e=!1;return Ne(!0),ne.searchLibraryArtists(g,_,w,E,12).then(t=>{e||(U(t.data??[]),G(t.total??0))}).catch(()=>{e||(U([]),G(0))}).finally(()=>{e||Ne(!1)}),()=>{e=!0}},[g,_,w,E]);let Be=async()=>{if(!g)d(i(`artistNoLibraries`),`error`);else try{let e=await f(()=>ne.generateArtistString({name:g,query:_,count:y,mode:v,preselected_names:S,filter_mode:w,post_threshold:E,creative_bracket_style:O,creative_nest_levels:A,standard_weight_min:M,standard_weight_max:P,nai_weight_min:F,nai_weight_max:I,enable_custom_format:L,custom_format_string:R}),{pending:i(`operationGenerateArtists`),success:i(`workbenchGenerateSuccess`),error:e=>e instanceof Error?e.message:i(`artistNoLibraries`)});x(e.formatted),e.names.length{if(e)try{await navigator.clipboard.writeText(e),d(i(`artistCopyResult`),`success`)}catch{d(i(`workbenchCopyError`),`error`)}};return(0,l.jsxs)(`section`,{className:`ue-workspace ue-workspace--workbench ue-animate-in`,"data-tour-id":`workbench-workspace`,children:[(0,l.jsx)(`div`,{className:`ue-pane-header ue-pane-header--compact ue-workbench-hero`,children:(0,l.jsxs)(`div`,{className:`ue-pane-copy`,children:[(0,l.jsx)(`p`,{className:`ue-pane-kicker`,children:i(`workbenchTitle`)}),(0,l.jsx)(`h2`,{children:i(`workbenchAppTitle`)}),(0,l.jsx)(`p`,{children:i(`workbenchAppSubtitle`)})]})}),(0,l.jsxs)(`div`,{className:`ue-workbench-app-shell`,children:[(0,l.jsxs)(`aside`,{className:`ue-workbench-rail`,"aria-label":i(`workbenchToolShelf`),children:[(0,l.jsxs)(`button`,{className:`ue-workbench-tool-tab ${m===`artist`?`is-active`:``}`,"aria-pressed":m===`artist`,onClick:()=>h(`artist`),children:[(0,l.jsx)(o,{size:17}),(0,l.jsx)(`span`,{children:i(`toolArtistGenerator`)})]}),(0,l.jsxs)(`button`,{className:`ue-workbench-tool-tab ${m===`inspiration`?`is-active`:``}`,"aria-pressed":m===`inspiration`,onClick:()=>h(`inspiration`),children:[(0,l.jsx)(s,{size:17}),(0,l.jsx)(`span`,{children:i(`toolInspirationHub`)})]})]}),(0,l.jsx)(`div`,{className:`ue-workbench-stage`,children:m===`artist`?(0,l.jsxs)(`div`,{className:`ue-workbench-grid ue-workbench-grid--expanded`,children:[(0,l.jsxs)(`article`,{className:`ue-tool-panel ue-tool-panel--generator`,"data-tour-id":`workbench-generator`,children:[(0,l.jsxs)(`div`,{className:`ue-tool-panel-head ue-tool-panel-head--split`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsxs)(`div`,{className:`ue-section-kicker`,children:[(0,l.jsx)(a,{size:14}),(0,l.jsx)(`span`,{children:i(`toolArtistGenerator`)})]}),(0,l.jsx)(`p`,{children:i(`toolArtistGeneratorDesc`)})]}),(0,l.jsxs)(`div`,{className:`ue-workbench-mini-metrics`,"aria-label":i(`workbenchGeneratorMetrics`),children:[(0,l.jsxs)(`span`,{children:[(0,l.jsx)(`strong`,{children:y}),i(`artistCount`)]}),(0,l.jsxs)(`span`,{children:[(0,l.jsx)(`strong`,{children:Le}),i(`workbenchResultTokens`)]})]})]}),(0,l.jsxs)(`div`,{className:`ue-tool-form`,children:[(0,l.jsxs)(`div`,{className:`ue-tool-subsection`,children:[(0,l.jsx)(`span`,{children:`01`}),(0,l.jsx)(`strong`,{children:i(`workbenchRecipeSection`)})]}),(0,l.jsxs)(`div`,{className:`ue-tool-grid ue-tool-grid--wide ue-tool-grid--recipe`,children:[(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:i(`artistLibrarySource`)}),(0,l.jsx)(`select`,{value:g,onChange:e=>be(e.target.value),children:e.map(e=>(0,l.jsx)(`option`,{value:e.filename,children:e.filename},e.filename))})]}),(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:i(`artistCount`)}),(0,l.jsx)(`input`,{type:`number`,min:1,max:20,value:y,onChange:e=>Ce(Number(e.target.value)||1)})]}),(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:i(`workbenchMode`)}),(0,l.jsxs)(`select`,{value:v,onChange:e=>Se(e.target.value),children:[(0,l.jsx)(`option`,{value:`pure`,children:i(`workbenchModePure`)}),(0,l.jsx)(`option`,{value:`standard`,children:i(`workbenchModeStandard`)}),(0,l.jsx)(`option`,{value:`creative`,children:i(`workbenchModeCreative`)}),(0,l.jsx)(`option`,{value:`nai`,children:i(`workbenchModeNai`)})]})]})]}),(0,l.jsxs)(`div`,{className:`ue-tool-grid ue-tool-grid--wide`,children:[(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:i(`workbenchPostFilter`)}),(0,l.jsxs)(`select`,{value:w,onChange:e=>T(e.target.value),children:[(0,l.jsx)(`option`,{value:`none`,children:i(`workbenchFilterNone`)}),(0,l.jsx)(`option`,{value:`gt`,children:i(`workbenchFilterGreater`)}),(0,l.jsx)(`option`,{value:`lt`,children:i(`workbenchFilterLess`)})]})]}),(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:i(`workbenchPostThreshold`)}),(0,l.jsx)(`input`,{type:`number`,min:0,value:E,onChange:e=>D(Number(e.target.value)||0)})]}),(0,l.jsxs)(`label`,{className:`ue-toggle-field`,children:[(0,l.jsx)(`span`,{children:i(`workbenchCustomFormat`)}),(0,l.jsx)(`button`,{className:`ue-chip-toggle ue-chip-toggle--icon ${L?`active`:``}`,onClick:()=>De(e=>!e),type:`button`,"aria-label":i(`workbenchCustomFormat`),title:i(L?`commonEnabled`:`commonDisabled`),children:L?(0,l.jsx)(_e,{size:15}):(0,l.jsx)(ge,{size:15})})]})]}),v===`standard`?(0,l.jsxs)(`div`,{className:`ue-tool-grid ue-tool-grid--wide`,children:[(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:i(`workbenchWeightMin`)}),(0,l.jsx)(`input`,{type:`number`,min:0,max:2,step:.1,value:M,onChange:e=>N(Number(e.target.value)||0)})]}),(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:i(`workbenchWeightMax`)}),(0,l.jsx)(`input`,{type:`number`,min:0,max:2,step:.1,value:P,onChange:e=>we(Number(e.target.value)||0)})]})]}):null,v===`nai`?(0,l.jsxs)(`div`,{className:`ue-tool-grid ue-tool-grid--wide`,children:[(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:i(`workbenchWeightMin`)}),(0,l.jsx)(`input`,{type:`number`,min:0,max:2,step:.1,value:F,onChange:e=>Te(Number(e.target.value)||0)})]}),(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:i(`workbenchWeightMax`)}),(0,l.jsx)(`input`,{type:`number`,min:0,max:2,step:.1,value:I,onChange:e=>Ee(Number(e.target.value)||0)})]})]}):null,v===`creative`?(0,l.jsxs)(`div`,{className:`ue-tool-grid ue-tool-grid--wide`,children:[(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:i(`workbenchBracketStyle`)}),(0,l.jsxs)(`select`,{value:O,onChange:e=>k(e.target.value),children:[(0,l.jsx)(`option`,{value:`paren`,children:`( )`}),(0,l.jsx)(`option`,{value:`curly`,children:`{ }`}),(0,l.jsx)(`option`,{value:`square`,children:`[ ]`})]})]}),(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:i(`workbenchNestLevels`)}),(0,l.jsx)(`input`,{type:`number`,min:0,max:5,value:A,onChange:e=>j(Number(e.target.value)||0)})]})]}):null,L?(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:i(`workbenchFormatString`)}),(0,l.jsx)(`input`,{value:R,onChange:e=>Oe(e.target.value)})]}):null,(0,l.jsxs)(`div`,{className:`ue-tool-subsection`,children:[(0,l.jsx)(`span`,{children:`02`}),(0,l.jsx)(`strong`,{children:i(`workbenchOutputSection`)})]}),(0,l.jsxs)(`div`,{className:`ue-tool-actions`,children:[(0,l.jsxs)(`button`,{className:`ue-icon-action ue-icon-action--filled`,onClick:()=>void Be(),"aria-label":i(`artistGenerate`),title:i(`artistGenerate`),children:[(0,l.jsx)(o,{size:15}),(0,l.jsx)(`span`,{children:i(`artistGenerate`)})]}),(0,l.jsxs)(`button`,{className:`ue-icon-action`,onClick:()=>void Ve(),disabled:!b,"aria-label":i(`artistCopyResult`),title:i(`artistCopyResult`),children:[(0,l.jsx)(ee,{size:15}),(0,l.jsx)(`span`,{children:i(`artistCopyResult`)})]})]}),(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:i(`artistResult`)}),(0,l.jsx)(`textarea`,{className:`ue-tool-result`,value:b,onChange:e=>x(e.target.value)})]}),(0,l.jsxs)(`details`,{className:`ue-qol-disclosure`,children:[(0,l.jsxs)(`summary`,{children:[i(`qolFormatDetails`),` · `,i(`workbenchFormatTool`),`: `,i(z===`anima`?`workbenchFormatToolAnima`:`workbenchFormatToolCustom`),` · `,i(`workbenchCustomFormat`),`: `,i(L?`commonEnabled`:`commonDisabled`)]}),(0,l.jsxs)(`div`,{className:`ue-tool-subsection`,children:[(0,l.jsx)(`span`,{children:`03`}),(0,l.jsx)(`strong`,{children:i(`workbenchFormatSection`)})]}),(0,l.jsxs)(`div`,{className:`ue-tool-grid ue-tool-grid--wide`,children:[(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:i(`workbenchFormatTool`)}),(0,l.jsxs)(`select`,{value:z,onChange:e=>ke(e.target.value),children:[(0,l.jsx)(`option`,{value:`anima`,children:i(`workbenchFormatToolAnima`)}),(0,l.jsx)(`option`,{value:`custom`,children:i(`workbenchFormatToolCustom`)})]})]}),z===`custom`?(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:i(`workbenchFormatToolTemplate`)}),(0,l.jsx)(`input`,{value:B,onChange:e=>Ae(e.target.value)})]}):(0,l.jsx)(`div`,{className:`ue-tool-helper ue-tool-helper--inline`,children:i(`workbenchFormatToolAnimaHint`)})]}),(0,l.jsxs)(`div`,{className:`ue-tool-actions`,children:[(0,l.jsx)(`button`,{className:`ue-icon-action ue-icon-action--accent`,onClick:ze,disabled:!b,"aria-label":i(`workbenchFormatToolApply`),title:i(`workbenchFormatToolApply`),children:(0,l.jsx)(a,{size:14})}),(0,l.jsxs)(`button`,{className:`ue-icon-action`,onClick:()=>void Ve(V),disabled:!V,"aria-label":i(`artistCopyResult`),title:i(`artistCopyResult`),children:[(0,l.jsx)(ee,{size:14}),(0,l.jsx)(`span`,{children:i(`artistCopyResult`)})]})]}),(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:i(`workbenchFormatToolResult`)}),(0,l.jsx)(`textarea`,{className:`ue-tool-result`,value:V,readOnly:!0})]}),V?(0,l.jsxs)(`div`,{className:`ue-workbench-result-meta`,children:[(0,l.jsx)(a,{size:13}),(0,l.jsx)(`span`,{children:i(`workbenchFormattedTokens`,{count:Re})})]}):null]})]})]}),(0,l.jsxs)(`div`,{className:`ue-workbench-stack`,children:[(0,l.jsxs)(`article`,{className:`ue-tool-panel ue-tool-panel--summary ue-workbench-queue-card`,children:[(0,l.jsxs)(`div`,{className:`ue-tool-panel-head ue-tool-panel-head--split`,children:[(0,l.jsx)(`div`,{children:(0,l.jsxs)(`div`,{className:`ue-section-kicker`,children:[(0,l.jsx)(a,{size:14}),(0,l.jsx)(`span`,{children:i(`workbenchPreselected`)})]})}),(0,l.jsx)(`span`,{className:`ue-workbench-count-pill`,children:S.length})]}),(0,l.jsx)(`div`,{className:`ue-generated-list`,children:S.length?S.map((e,t)=>(0,l.jsxs)(`div`,{className:`ue-generated-chip`,children:[(0,l.jsx)(`span`,{children:e}),(0,l.jsx)(`button`,{className:`ue-chip-remove`,onClick:()=>C(e=>e.filter((e,n)=>n!==t)),"aria-label":i(`commonDelete`),title:i(`commonDelete`),children:(0,l.jsx)(oe,{size:12})})]},`${e}-${t}`)):(0,l.jsx)(`p`,{className:`ue-tool-helper`,children:i(`workbenchPreselectedEmpty`)})})]}),(0,l.jsxs)(`article`,{className:`ue-tool-panel ue-tool-panel--source`,children:[(0,l.jsxs)(`div`,{className:`ue-tool-panel-head ue-tool-panel-head--split`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsxs)(`div`,{className:`ue-section-kicker`,children:[(0,l.jsx)(ie,{size:14}),(0,l.jsx)(`span`,{children:i(`workbenchArtistPool`)})]}),(0,l.jsx)(`p`,{children:i(`workbenchArtistPoolHint`)})]}),(0,l.jsx)(`span`,{className:`ue-workbench-count-pill`,children:W})]}),(0,l.jsx)(`div`,{className:`ue-tool-form`,children:(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:i(`navSearchLibraryPlaceholder`)}),(0,l.jsx)(`input`,{value:_,onChange:e=>xe(e.target.value)})]})}),(0,l.jsx)(`div`,{className:`ue-tool-helper`,children:Me?i(`commonLoading`):`${W} ${i(`commonEntries`,{count:W})}`}),(0,l.jsx)(`div`,{className:`ue-preview-list`,children:je.map(e=>(0,l.jsxs)(`article`,{className:`ue-preview-row`,children:[(0,l.jsxs)(`div`,{className:`ue-preview-row-main`,children:[(0,l.jsx)(`strong`,{children:e.name}),Array.isArray(e.other_names)&&e.other_names.length?(0,l.jsx)(`span`,{children:e.other_names.slice(0,4).join(` · `)}):typeof e.other_names==`string`&&e.other_names.trim()?(0,l.jsx)(`span`,{children:e.other_names}):null]}),(0,l.jsxs)(`div`,{className:`ue-preview-row-side`,children:[(0,l.jsx)(`span`,{children:e.post_count??0}),(0,l.jsx)(`button`,{className:`ue-icon-action ue-icon-action--tiny`,onClick:()=>{S.includes(e.name)||C(t=>[...t,e.name].slice(0,20))},"aria-label":i(`commonCreate`),title:i(`commonCreate`),children:(0,l.jsx)(re,{size:13})})]})]},e.name))})]})]})]}):(0,l.jsxs)(`div`,{className:`ue-inspiration-workspace`,children:[(0,l.jsxs)(`article`,{className:`ue-tool-panel ue-inspiration-hero`,children:[(0,l.jsxs)(`div`,{className:`ue-tool-panel-head`,children:[(0,l.jsxs)(`div`,{className:`ue-section-kicker`,children:[(0,l.jsx)(de,{size:14}),(0,l.jsx)(`span`,{children:i(`toolInspirationHub`)})]}),(0,l.jsx)(`h3`,{children:i(`inspirationHubTitle`)}),(0,l.jsx)(`p`,{children:i(`inspirationHubDesc`)})]}),(0,l.jsxs)(`div`,{className:`ue-inspiration-hero-metrics`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(s,{size:15}),(0,l.jsx)(`strong`,{children:u.length}),(0,l.jsx)(`span`,{children:i(`inspirationMetricSites`)})]}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(he,{size:15}),(0,l.jsx)(`strong`,{children:Q.recommendation}),(0,l.jsx)(`span`,{children:i(`inspirationRecommendation`)})]}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(pe,{size:15}),(0,l.jsx)(`strong`,{children:Q.frequency}),(0,l.jsx)(`span`,{children:i(`inspirationFrequency`)})]})]})]}),(0,l.jsxs)(`div`,{className:`ue-inspiration-controls`,children:[(0,l.jsxs)(`label`,{className:`ue-inspiration-search`,children:[(0,l.jsx)(ie,{size:14}),(0,l.jsx)(`input`,{value:K,onChange:e=>Pe(e.target.value),placeholder:i(`inspirationSearchPlaceholder`)})]}),(0,l.jsxs)(`label`,{className:`ue-inspiration-select`,children:[(0,l.jsx)(te,{size:14}),(0,l.jsxs)(`select`,{value:q,onChange:e=>Fe(e.target.value),children:[(0,l.jsx)(`option`,{value:`recommendation`,children:i(`inspirationSortRecommendation`)}),(0,l.jsx)(`option`,{value:`frequency`,children:i(`inspirationSortFrequency`)}),(0,l.jsx)(`option`,{value:`name`,children:i(`inspirationSortName`)})]})]}),(0,l.jsxs)(`label`,{className:`ue-inspiration-select`,children:[(0,l.jsx)(fe,{size:14}),(0,l.jsxs)(`select`,{value:J,onChange:e=>Y(e.target.value),children:[(0,l.jsx)(`option`,{value:`all`,children:i(`inspirationType_all`)}),(0,l.jsx)(`option`,{value:`moodboard`,children:i(`inspirationType_moodboard`)}),(0,l.jsx)(`option`,{value:`portfolio`,children:i(`inspirationType_portfolio`)}),(0,l.jsx)(`option`,{value:`illustration`,children:i(`inspirationType_illustration`)}),(0,l.jsx)(`option`,{value:`product`,children:i(`inspirationType_product`)}),(0,l.jsx)(`option`,{value:`ai`,children:i(`inspirationType_ai`)})]})]})]}),(0,l.jsxs)(`div`,{className:`ue-inspiration-layout`,children:[(0,l.jsx)(`div`,{className:`ue-inspiration-list`,children:$.map((e,t)=>(0,l.jsxs)(`button`,{className:`ue-inspiration-card ${X===e.id?`is-active`:``}`,onClick:()=>Ie(e.id),children:[(0,l.jsx)(`span`,{className:`ue-inspiration-rank`,children:String(t+1).padStart(2,`0`)}),(0,l.jsxs)(`div`,{className:`ue-inspiration-card-main`,children:[(0,l.jsxs)(`div`,{className:`ue-inspiration-card-title`,children:[(0,l.jsx)(`strong`,{children:e.title}),(0,l.jsx)(`span`,{children:i(`inspirationType_${e.type}`)})]}),(0,l.jsx)(`p`,{children:i(e.descriptionKey)}),(0,l.jsxs)(`div`,{className:`ue-inspiration-score-row`,children:[(0,l.jsx)(`span`,{children:i(`inspirationRecommendation`)}),(0,l.jsx)(`i`,{children:(0,l.jsx)(`b`,{style:{width:`${e.recommendation}%`}})}),(0,l.jsx)(`em`,{children:e.recommendation})]}),(0,l.jsxs)(`div`,{className:`ue-inspiration-score-row`,children:[(0,l.jsx)(`span`,{children:i(`inspirationFrequency`)}),(0,l.jsx)(`i`,{children:(0,l.jsx)(`b`,{style:{width:`${e.frequency}%`}})}),(0,l.jsx)(`em`,{children:e.frequency})]})]}),(0,l.jsx)(le,{size:15})]},e.id))}),(0,l.jsxs)(`aside`,{className:`ue-inspiration-detail`,children:[(0,l.jsxs)(`div`,{className:`ue-inspiration-detail-head`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`p`,{className:`ue-pane-kicker`,children:i(Q.regionKey)}),(0,l.jsx)(`h3`,{children:Q.title})]}),(0,l.jsx)(`a`,{className:`ue-icon-action ue-icon-action--filled`,href:Q.url,target:`_blank`,rel:`noreferrer`,"aria-label":i(`inspirationOpenSite`),title:i(`inspirationOpenSite`),children:(0,l.jsx)(ae,{size:14})})]}),(0,l.jsx)(`p`,{children:i(Q.descriptionKey)}),(0,l.jsxs)(`div`,{className:`ue-inspiration-detail-tags`,children:[(0,l.jsxs)(`span`,{children:[(0,l.jsx)(ue,{size:13}),i(Q.bestForKey)]}),(0,l.jsxs)(`span`,{children:[(0,l.jsx)(me,{size:13}),Q.url.replace(/^https?:\/\//,``).replace(/\/$/,``)]})]}),(0,l.jsxs)(`div`,{className:`ue-inspiration-detail-grid`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`strong`,{children:Q.recommendation}),(0,l.jsx)(`span`,{children:i(`inspirationRecommendation`)})]}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`strong`,{children:Q.frequency}),(0,l.jsx)(`span`,{children:i(`inspirationFrequency`)})]})]})]})]})]})})]})]})};export{m as WorkbenchWorkspace}; \ No newline at end of file diff --git a/gallery_ui/dist/assets/WorkbenchWorkspace-KwG36plb.js b/gallery_ui/dist/assets/WorkbenchWorkspace-KwG36plb.js deleted file mode 100644 index b821bd1..0000000 --- a/gallery_ui/dist/assets/WorkbenchWorkspace-KwG36plb.js +++ /dev/null @@ -1 +0,0 @@ -import{a as e,i as t,n,r,s as i}from"./I18nProvider-cZczvL7B.js";import{t as a}from"./sparkles-Bu6QFW9h.js";import{t as ee}from"./wand-sparkles-C_uDcQtj.js";import{t as te}from"./copy-Dp5BPX7F.js";import{B as o,C as ne,O as re,P as ie,T as ae,f as oe,j as s,q as se,w as ce}from"./index-DWGqjUOp.js";var le=t(`earth`,[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),ue=t(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),de=t(`bookmark-plus`,[[`path`,{d:`M12 7v6`,key:`lw1j43`}],[`path`,{d:`M15 10H9`,key:`o6yqo3`}],[`path`,{d:`M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z`,key:`oz39mx`}]]),fe=t(`compass`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]),pe=t(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),me=t(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),he=t(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),ge=t(`toggle-left`,[[`circle`,{cx:`9`,cy:`12`,r:`3`,key:`u3jwor`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`7`,key:`g7kal2`}]]),_e=t(`toggle-right`,[[`circle`,{cx:`15`,cy:`12`,r:`3`,key:`1afu0r`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`7`,key:`g7kal2`}]]),c=i(e(),1),l=r(),u=`ue-artist-generator-v2`,d=[{id:`pinterest`,title:`Pinterest`,url:`https://www.pinterest.com/`,type:`moodboard`,frequency:96,recommendation:95,regionKey:`inspirationRegionGlobal`,descriptionKey:`inspirationPinterestDesc`,bestForKey:`inspirationPinterestBest`},{id:`huaban`,title:`Huaban`,url:`https://huaban.com/`,type:`moodboard`,frequency:88,recommendation:90,regionKey:`inspirationRegionChina`,descriptionKey:`inspirationHuabanDesc`,bestForKey:`inspirationHuabanBest`},{id:`behance`,title:`Behance`,url:`https://www.behance.net/`,type:`portfolio`,frequency:84,recommendation:92,regionKey:`inspirationRegionGlobal`,descriptionKey:`inspirationBehanceDesc`,bestForKey:`inspirationBehanceBest`},{id:`artstation`,title:`ArtStation`,url:`https://www.artstation.com/`,type:`illustration`,frequency:82,recommendation:91,regionKey:`inspirationRegionGlobal`,descriptionKey:`inspirationArtStationDesc`,bestForKey:`inspirationArtStationBest`},{id:`dribbble`,title:`Dribbble`,url:`https://dribbble.com/`,type:`product`,frequency:78,recommendation:86,regionKey:`inspirationRegionGlobal`,descriptionKey:`inspirationDribbbleDesc`,bestForKey:`inspirationDribbbleBest`},{id:`cosmos`,title:`Cosmos`,url:`https://www.cosmos.so/`,type:`moodboard`,frequency:68,recommendation:84,regionKey:`inspirationRegionGlobal`,descriptionKey:`inspirationCosmosDesc`,bestForKey:`inspirationCosmosBest`},{id:`arena`,title:`Are.na`,url:`https://www.are.na/`,type:`moodboard`,frequency:61,recommendation:80,regionKey:`inspirationRegionGlobal`,descriptionKey:`inspirationArenaDesc`,bestForKey:`inspirationArenaBest`},{id:`designspiration`,title:`Designspiration`,url:`https://www.designspiration.com/`,type:`moodboard`,frequency:59,recommendation:78,regionKey:`inspirationRegionGlobal`,descriptionKey:`inspirationDesignspirationDesc`,bestForKey:`inspirationDesignspirationBest`},{id:`lapa`,title:`Lapa Ninja`,url:`https://www.lapa.ninja/`,type:`product`,frequency:54,recommendation:76,regionKey:`inspirationRegionGlobal`,descriptionKey:`inspirationLapaDesc`,bestForKey:`inspirationLapaBest`},{id:`lexica`,title:`Lexica`,url:`https://lexica.art/`,type:`ai`,frequency:64,recommendation:74,regionKey:`inspirationRegionGlobal`,descriptionKey:`inspirationLexicaDesc`,bestForKey:`inspirationLexicaBest`}],f=e=>{let t={"[":`]`,"(":`)`,"{":`}`},n=e.trim();for(;n.length>1;){let e=n[0],r=n[n.length-1];if(t[e]!==r)break;n=n.slice(1,-1).trim()}return n},ve=e=>f(e).replace(/^\d+(\.\d+)?::/,``).replace(/::$/,``).replace(/:\d+(\.\d+)?$/,``).replace(/^artist:/i,``).replace(/^by\s+/i,``).trim(),p=e=>e.replace(/_/g,` `).replace(/\s+/g,` `).trim(),m=e=>{let t=ve(e).replace(/^@+/,``),n=t.match(/^(.+?)_\((.+)\)$/)??t.match(/^(.+?)\((.+)\)$/);return n?`@${p(n[1].replace(/_+$/g,``).trim())} \\(${p(n[2].trim())}\\)`:`@${p(t)}`},h=({libraries:e,activeLibraryName:t,onLibrarySelect:r})=>{let{t:i}=n(),{pushToast:f}=oe(),{runOperation:p}=ce(),[h,g]=(0,c.useState)(`artist`),[_,ye]=(0,c.useState)(``),[v,be]=(0,c.useState)(``),[y,xe]=(0,c.useState)(`standard`),[b,Se]=(0,c.useState)(3),[x,S]=(0,c.useState)(``),[C,w]=(0,c.useState)([]),[T,E]=(0,c.useState)(`none`),[D,O]=(0,c.useState)(0),[k,A]=(0,c.useState)(`paren`),[j,M]=(0,c.useState)(0),[N,Ce]=(0,c.useState)(.5),[P,we]=(0,c.useState)(1.5),[F,Te]=(0,c.useState)(.5),[I,Ee]=(0,c.useState)(1.5),[L,De]=(0,c.useState)(!1),[R,Oe]=(0,c.useState)(`artist:{name}`),[z,ke]=(0,c.useState)(`anima`),[B,Ae]=(0,c.useState)(`@{tag},`),[V,H]=(0,c.useState)(``),[je,U]=(0,c.useState)([]),[W,G]=(0,c.useState)(0),[Me,Ne]=(0,c.useState)(!1),[K,Pe]=(0,c.useState)(``),[q,Fe]=(0,c.useState)(`recommendation`),[J,Y]=(0,c.useState)(`all`),[X,Ie]=(0,c.useState)(`pinterest`),Z=(0,c.useMemo)(()=>e.find(e=>e.filename.toLowerCase().includes(`artists`))?.filename??e[0]?.filename??``,[e]),Q=(0,c.useMemo)(()=>d.find(e=>e.id===X)??d[0],[X]),Le=(0,c.useMemo)(()=>x.split(`,`).map(e=>e.trim()).filter(Boolean).length,[x]),Re=(0,c.useMemo)(()=>V.split(`,`).map(e=>e.trim()).filter(Boolean).length,[V]),$=(0,c.useMemo)(()=>{let e=K.trim().toLowerCase();return d.filter(t=>{let n=J===`all`||t.type===J,r=[t.title,i(t.descriptionKey),i(t.bestForKey),i(t.regionKey),i(`inspirationType_${t.type}`)].join(` `).toLowerCase();return n&&(!e||r.includes(e))}).sort((e,t)=>q===`frequency`?t.frequency-e.frequency:q===`name`?e.title.localeCompare(t.title):t.recommendation-e.recommendation)},[K,q,J,i]);(0,c.useEffect)(()=>{$.length&&($.some(e=>e.id===X)||Ie($[0].id))},[$,X]),(0,c.useEffect)(()=>{!_&&Z&&ye(Z)},[Z,_]),(0,c.useEffect)(()=>{_&&_!==t&&r(_)},[_,t,r]),(0,c.useEffect)(()=>{try{let e=window.localStorage.getItem(u);if(!e)return;let t=JSON.parse(e);typeof t.mode==`string`&&xe(t.mode),typeof t.artistCount==`number`&&Se(t.artistCount),typeof t.postCountFilterMode==`string`&&E(t.postCountFilterMode),typeof t.postCountThreshold==`number`&&O(t.postCountThreshold),typeof t.creativeBracketStyle==`string`&&A(t.creativeBracketStyle),typeof t.creativeNestLevels==`number`&&M(t.creativeNestLevels),typeof t.standardWeightMin==`number`&&Ce(t.standardWeightMin),typeof t.standardWeightMax==`number`&&we(t.standardWeightMax),typeof t.naiWeightMin==`number`&&Te(t.naiWeightMin),typeof t.naiWeightMax==`number`&&Ee(t.naiWeightMax),typeof t.enableCustomFormat==`boolean`&&De(t.enableCustomFormat),typeof t.customFormatString==`string`&&Oe(t.customFormatString),typeof t.formatToolMode==`string`&&ke(t.formatToolMode),typeof t.customFormatToolString==`string`&&Ae(t.customFormatToolString),Array.isArray(t.preselectedNames)&&w(t.preselectedNames.filter(e=>typeof e==`string`)),typeof t.finalResult==`string`&&S(t.finalResult),typeof t.formattedOutput==`string`&&H(t.formattedOutput),typeof t.activeTool==`string`&&g(t.activeTool),typeof t.inspirationSort==`string`&&Fe(t.inspirationSort),typeof t.inspirationType==`string`&&Y(t.inspirationType)}catch{}},[]),(0,c.useEffect)(()=>{let e={mode:y,artistCount:b,postCountFilterMode:T,postCountThreshold:D,creativeBracketStyle:k,creativeNestLevels:j,standardWeightMin:N,standardWeightMax:P,naiWeightMin:F,naiWeightMax:I,enableCustomFormat:L,customFormatString:R,formatToolMode:z,customFormatToolString:B,preselectedNames:C,finalResult:x,formattedOutput:V,activeTool:h,inspirationSort:q,inspirationType:J};try{window.localStorage.setItem(u,JSON.stringify(e))}catch{}},[y,b,T,D,k,j,N,P,F,I,L,R,z,B,C,x,V,h,q,J]);let ze=()=>{if(!x.trim()){f(i(`artistNoLibraries`),`error`);return}let e=x.split(`,`).map(e=>e.trim()).filter(Boolean);if(z===`anima`){H(e.map(e=>m(e)).join(`, `)),f(i(`workbenchFormatApplied`),`success`);return}let t=B||`{tag}`;H(e.map(e=>t.replace(/{tag}/g,ve(e)).replace(/{anima}/g,m(e))).join(`, `)),f(i(`workbenchFormatApplied`),`success`)};(0,c.useEffect)(()=>{if(!_){U([]),G(0);return}let e=!1;return Ne(!0),ne.searchLibraryArtists(_,v,T,D,12).then(t=>{e||(U(t.data??[]),G(t.total??0))}).catch(()=>{e||(U([]),G(0))}).finally(()=>{e||Ne(!1)}),()=>{e=!0}},[_,v,T,D]);let Be=async()=>{if(!_){f(i(`artistNoLibraries`),`error`);return}try{let e=await p(()=>ne.generateArtistString({name:_,query:v,count:b,mode:y,preselected_names:C,filter_mode:T,post_threshold:D,creative_bracket_style:k,creative_nest_levels:j,standard_weight_min:N,standard_weight_max:P,nai_weight_min:F,nai_weight_max:I,enable_custom_format:L,custom_format_string:R}),{pending:i(`operationGenerateArtists`),success:i(`workbenchGenerateSuccess`),error:e=>e instanceof Error?e.message:i(`artistNoLibraries`)});S(e.formatted),e.names.length{if(e)try{await navigator.clipboard.writeText(e),f(i(`artistCopyResult`),`success`)}catch{f(i(`workbenchCopyError`),`error`)}};return(0,l.jsxs)(`section`,{className:`ue-workspace ue-workspace--workbench ue-animate-in`,"data-tour-id":`workbench-workspace`,children:[(0,l.jsx)(`div`,{className:`ue-pane-header ue-pane-header--compact ue-workbench-hero`,children:(0,l.jsxs)(`div`,{className:`ue-pane-copy`,children:[(0,l.jsx)(`p`,{className:`ue-pane-kicker`,children:i(`workbenchTitle`)}),(0,l.jsx)(`h2`,{children:i(`workbenchAppTitle`)}),(0,l.jsx)(`p`,{children:i(`workbenchAppSubtitle`)})]})}),(0,l.jsxs)(`div`,{className:`ue-workbench-app-shell`,children:[(0,l.jsxs)(`aside`,{className:`ue-workbench-rail`,"aria-label":i(`workbenchToolShelf`),children:[(0,l.jsxs)(`button`,{className:`ue-workbench-tool-tab ${h===`artist`?`is-active`:``}`,"aria-pressed":h===`artist`,onClick:()=>g(`artist`),children:[(0,l.jsx)(ee,{size:17}),(0,l.jsx)(`span`,{children:i(`toolArtistGenerator`)})]}),(0,l.jsxs)(`button`,{className:`ue-workbench-tool-tab ${h===`inspiration`?`is-active`:``}`,"aria-pressed":h===`inspiration`,onClick:()=>g(`inspiration`),children:[(0,l.jsx)(o,{size:17}),(0,l.jsx)(`span`,{children:i(`toolInspirationHub`)})]})]}),(0,l.jsx)(`div`,{className:`ue-workbench-stage`,children:h===`artist`?(0,l.jsxs)(`div`,{className:`ue-workbench-grid ue-workbench-grid--expanded`,children:[(0,l.jsxs)(`article`,{className:`ue-tool-panel ue-tool-panel--generator`,"data-tour-id":`workbench-generator`,children:[(0,l.jsxs)(`div`,{className:`ue-tool-panel-head ue-tool-panel-head--split`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsxs)(`div`,{className:`ue-section-kicker`,children:[(0,l.jsx)(a,{size:14}),(0,l.jsx)(`span`,{children:i(`toolArtistGenerator`)})]}),(0,l.jsx)(`p`,{children:i(`toolArtistGeneratorDesc`)})]}),(0,l.jsxs)(`div`,{className:`ue-workbench-mini-metrics`,"aria-label":i(`workbenchGeneratorMetrics`),children:[(0,l.jsxs)(`span`,{children:[(0,l.jsx)(`strong`,{children:b}),i(`artistCount`)]}),(0,l.jsxs)(`span`,{children:[(0,l.jsx)(`strong`,{children:Le}),i(`workbenchResultTokens`)]})]})]}),(0,l.jsxs)(`div`,{className:`ue-tool-form`,children:[(0,l.jsxs)(`div`,{className:`ue-tool-subsection`,children:[(0,l.jsx)(`span`,{children:`01`}),(0,l.jsx)(`strong`,{children:i(`workbenchRecipeSection`)})]}),(0,l.jsxs)(`div`,{className:`ue-tool-grid ue-tool-grid--wide ue-tool-grid--recipe`,children:[(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:i(`artistLibrarySource`)}),(0,l.jsx)(`select`,{value:_,onChange:e=>ye(e.target.value),children:e.map(e=>(0,l.jsx)(`option`,{value:e.filename,children:e.filename},e.filename))})]}),(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:i(`artistCount`)}),(0,l.jsx)(`input`,{type:`number`,min:1,max:20,value:b,onChange:e=>Se(Number(e.target.value)||1)})]}),(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:i(`workbenchMode`)}),(0,l.jsxs)(`select`,{value:y,onChange:e=>xe(e.target.value),children:[(0,l.jsx)(`option`,{value:`pure`,children:i(`workbenchModePure`)}),(0,l.jsx)(`option`,{value:`standard`,children:i(`workbenchModeStandard`)}),(0,l.jsx)(`option`,{value:`creative`,children:i(`workbenchModeCreative`)}),(0,l.jsx)(`option`,{value:`nai`,children:i(`workbenchModeNai`)})]})]})]}),(0,l.jsxs)(`div`,{className:`ue-tool-grid ue-tool-grid--wide`,children:[(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:i(`workbenchPostFilter`)}),(0,l.jsxs)(`select`,{value:T,onChange:e=>E(e.target.value),children:[(0,l.jsx)(`option`,{value:`none`,children:i(`workbenchFilterNone`)}),(0,l.jsx)(`option`,{value:`gt`,children:i(`workbenchFilterGreater`)}),(0,l.jsx)(`option`,{value:`lt`,children:i(`workbenchFilterLess`)})]})]}),(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:i(`workbenchPostThreshold`)}),(0,l.jsx)(`input`,{type:`number`,min:0,value:D,onChange:e=>O(Number(e.target.value)||0)})]}),(0,l.jsxs)(`label`,{className:`ue-toggle-field`,children:[(0,l.jsx)(`span`,{children:i(`workbenchCustomFormat`)}),(0,l.jsx)(`button`,{className:`ue-chip-toggle ue-chip-toggle--icon ${L?`active`:``}`,onClick:()=>De(e=>!e),type:`button`,"aria-label":i(`workbenchCustomFormat`),title:i(L?`commonEnabled`:`commonDisabled`),children:L?(0,l.jsx)(_e,{size:15}):(0,l.jsx)(ge,{size:15})})]})]}),y===`standard`?(0,l.jsxs)(`div`,{className:`ue-tool-grid ue-tool-grid--wide`,children:[(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:i(`workbenchWeightMin`)}),(0,l.jsx)(`input`,{type:`number`,min:0,max:2,step:.1,value:N,onChange:e=>Ce(Number(e.target.value)||0)})]}),(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:i(`workbenchWeightMax`)}),(0,l.jsx)(`input`,{type:`number`,min:0,max:2,step:.1,value:P,onChange:e=>we(Number(e.target.value)||0)})]})]}):null,y===`nai`?(0,l.jsxs)(`div`,{className:`ue-tool-grid ue-tool-grid--wide`,children:[(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:i(`workbenchWeightMin`)}),(0,l.jsx)(`input`,{type:`number`,min:0,max:2,step:.1,value:F,onChange:e=>Te(Number(e.target.value)||0)})]}),(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:i(`workbenchWeightMax`)}),(0,l.jsx)(`input`,{type:`number`,min:0,max:2,step:.1,value:I,onChange:e=>Ee(Number(e.target.value)||0)})]})]}):null,y===`creative`?(0,l.jsxs)(`div`,{className:`ue-tool-grid ue-tool-grid--wide`,children:[(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:i(`workbenchBracketStyle`)}),(0,l.jsxs)(`select`,{value:k,onChange:e=>A(e.target.value),children:[(0,l.jsx)(`option`,{value:`paren`,children:`( )`}),(0,l.jsx)(`option`,{value:`curly`,children:`{ }`}),(0,l.jsx)(`option`,{value:`square`,children:`[ ]`})]})]}),(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:i(`workbenchNestLevels`)}),(0,l.jsx)(`input`,{type:`number`,min:0,max:5,value:j,onChange:e=>M(Number(e.target.value)||0)})]})]}):null,L?(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:i(`workbenchFormatString`)}),(0,l.jsx)(`input`,{value:R,onChange:e=>Oe(e.target.value)})]}):null,(0,l.jsxs)(`div`,{className:`ue-tool-subsection`,children:[(0,l.jsx)(`span`,{children:`02`}),(0,l.jsx)(`strong`,{children:i(`workbenchOutputSection`)})]}),(0,l.jsxs)(`div`,{className:`ue-tool-actions`,children:[(0,l.jsxs)(`button`,{className:`ue-icon-action ue-icon-action--filled`,onClick:()=>void Be(),"aria-label":i(`artistGenerate`),title:i(`artistGenerate`),children:[(0,l.jsx)(ee,{size:15}),(0,l.jsx)(`span`,{children:i(`artistGenerate`)})]}),(0,l.jsxs)(`button`,{className:`ue-icon-action`,onClick:()=>void Ve(),disabled:!x,"aria-label":i(`artistCopyResult`),title:i(`artistCopyResult`),children:[(0,l.jsx)(te,{size:15}),(0,l.jsx)(`span`,{children:i(`artistCopyResult`)})]})]}),(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:i(`artistResult`)}),(0,l.jsx)(`textarea`,{className:`ue-tool-result`,value:x,onChange:e=>S(e.target.value)})]}),(0,l.jsxs)(`details`,{className:`ue-qol-disclosure`,children:[(0,l.jsxs)(`summary`,{children:[i(`qolFormatDetails`),` · `,i(`workbenchFormatTool`),`: `,i(z===`anima`?`workbenchFormatToolAnima`:`workbenchFormatToolCustom`),` · `,i(`workbenchCustomFormat`),`: `,i(L?`commonEnabled`:`commonDisabled`)]}),(0,l.jsxs)(`div`,{className:`ue-tool-subsection`,children:[(0,l.jsx)(`span`,{children:`03`}),(0,l.jsx)(`strong`,{children:i(`workbenchFormatSection`)})]}),(0,l.jsxs)(`div`,{className:`ue-tool-grid ue-tool-grid--wide`,children:[(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:i(`workbenchFormatTool`)}),(0,l.jsxs)(`select`,{value:z,onChange:e=>ke(e.target.value),children:[(0,l.jsx)(`option`,{value:`anima`,children:i(`workbenchFormatToolAnima`)}),(0,l.jsx)(`option`,{value:`custom`,children:i(`workbenchFormatToolCustom`)})]})]}),z===`custom`?(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:i(`workbenchFormatToolTemplate`)}),(0,l.jsx)(`input`,{value:B,onChange:e=>Ae(e.target.value)})]}):(0,l.jsx)(`div`,{className:`ue-tool-helper ue-tool-helper--inline`,children:i(`workbenchFormatToolAnimaHint`)})]}),(0,l.jsxs)(`div`,{className:`ue-tool-actions`,children:[(0,l.jsx)(`button`,{className:`ue-icon-action ue-icon-action--accent`,onClick:ze,disabled:!x,"aria-label":i(`workbenchFormatToolApply`),title:i(`workbenchFormatToolApply`),children:(0,l.jsx)(a,{size:14})}),(0,l.jsxs)(`button`,{className:`ue-icon-action`,onClick:()=>void Ve(V),disabled:!V,"aria-label":i(`artistCopyResult`),title:i(`artistCopyResult`),children:[(0,l.jsx)(te,{size:14}),(0,l.jsx)(`span`,{children:i(`artistCopyResult`)})]})]}),(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:i(`workbenchFormatToolResult`)}),(0,l.jsx)(`textarea`,{className:`ue-tool-result`,value:V,readOnly:!0})]}),V?(0,l.jsxs)(`div`,{className:`ue-workbench-result-meta`,children:[(0,l.jsx)(a,{size:13}),(0,l.jsx)(`span`,{children:i(`workbenchFormattedTokens`,{count:Re})})]}):null]})]})]}),(0,l.jsxs)(`div`,{className:`ue-workbench-stack`,children:[(0,l.jsxs)(`article`,{className:`ue-tool-panel ue-tool-panel--summary ue-workbench-queue-card`,children:[(0,l.jsxs)(`div`,{className:`ue-tool-panel-head ue-tool-panel-head--split`,children:[(0,l.jsx)(`div`,{children:(0,l.jsxs)(`div`,{className:`ue-section-kicker`,children:[(0,l.jsx)(a,{size:14}),(0,l.jsx)(`span`,{children:i(`workbenchPreselected`)})]})}),(0,l.jsx)(`span`,{className:`ue-workbench-count-pill`,children:C.length})]}),(0,l.jsx)(`div`,{className:`ue-generated-list`,children:C.length?C.map((e,t)=>(0,l.jsxs)(`div`,{className:`ue-generated-chip`,children:[(0,l.jsx)(`span`,{children:e}),(0,l.jsx)(`button`,{className:`ue-chip-remove`,onClick:()=>w(e=>e.filter((e,n)=>n!==t)),"aria-label":i(`commonDelete`),title:i(`commonDelete`),children:(0,l.jsx)(ae,{size:12})})]},`${e}-${t}`)):(0,l.jsx)(`p`,{className:`ue-tool-helper`,children:i(`workbenchPreselectedEmpty`)})})]}),(0,l.jsxs)(`article`,{className:`ue-tool-panel ue-tool-panel--source`,children:[(0,l.jsxs)(`div`,{className:`ue-tool-panel-head ue-tool-panel-head--split`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsxs)(`div`,{className:`ue-section-kicker`,children:[(0,l.jsx)(s,{size:14}),(0,l.jsx)(`span`,{children:i(`workbenchArtistPool`)})]}),(0,l.jsx)(`p`,{children:i(`workbenchArtistPoolHint`)})]}),(0,l.jsx)(`span`,{className:`ue-workbench-count-pill`,children:W})]}),(0,l.jsx)(`div`,{className:`ue-tool-form`,children:(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:i(`navSearchLibraryPlaceholder`)}),(0,l.jsx)(`input`,{value:v,onChange:e=>be(e.target.value)})]})}),(0,l.jsx)(`div`,{className:`ue-tool-helper`,children:Me?i(`commonLoading`):`${W} ${i(`commonEntries`,{count:W})}`}),(0,l.jsx)(`div`,{className:`ue-preview-list`,children:je.map(e=>(0,l.jsxs)(`article`,{className:`ue-preview-row`,children:[(0,l.jsxs)(`div`,{className:`ue-preview-row-main`,children:[(0,l.jsx)(`strong`,{children:e.name}),Array.isArray(e.other_names)&&e.other_names.length?(0,l.jsx)(`span`,{children:e.other_names.slice(0,4).join(` · `)}):typeof e.other_names==`string`&&e.other_names.trim()?(0,l.jsx)(`span`,{children:e.other_names}):null]}),(0,l.jsxs)(`div`,{className:`ue-preview-row-side`,children:[(0,l.jsx)(`span`,{children:e.post_count??0}),(0,l.jsx)(`button`,{className:`ue-icon-action ue-icon-action--tiny`,onClick:()=>{C.includes(e.name)||w(t=>[...t,e.name].slice(0,20))},"aria-label":i(`commonCreate`),title:i(`commonCreate`),children:(0,l.jsx)(ie,{size:13})})]})]},e.name))})]})]})]}):(0,l.jsxs)(`div`,{className:`ue-inspiration-workspace`,children:[(0,l.jsxs)(`article`,{className:`ue-tool-panel ue-inspiration-hero`,children:[(0,l.jsxs)(`div`,{className:`ue-tool-panel-head`,children:[(0,l.jsxs)(`div`,{className:`ue-section-kicker`,children:[(0,l.jsx)(fe,{size:14}),(0,l.jsx)(`span`,{children:i(`toolInspirationHub`)})]}),(0,l.jsx)(`h3`,{children:i(`inspirationHubTitle`)}),(0,l.jsx)(`p`,{children:i(`inspirationHubDesc`)})]}),(0,l.jsxs)(`div`,{className:`ue-inspiration-hero-metrics`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(o,{size:15}),(0,l.jsx)(`strong`,{children:d.length}),(0,l.jsx)(`span`,{children:i(`inspirationMetricSites`)})]}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(he,{size:15}),(0,l.jsx)(`strong`,{children:Q.recommendation}),(0,l.jsx)(`span`,{children:i(`inspirationRecommendation`)})]}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(pe,{size:15}),(0,l.jsx)(`strong`,{children:Q.frequency}),(0,l.jsx)(`span`,{children:i(`inspirationFrequency`)})]})]})]}),(0,l.jsxs)(`div`,{className:`ue-inspiration-controls`,children:[(0,l.jsxs)(`label`,{className:`ue-inspiration-search`,children:[(0,l.jsx)(s,{size:14}),(0,l.jsx)(`input`,{value:K,onChange:e=>Pe(e.target.value),placeholder:i(`inspirationSearchPlaceholder`)})]}),(0,l.jsxs)(`label`,{className:`ue-inspiration-select`,children:[(0,l.jsx)(re,{size:14}),(0,l.jsxs)(`select`,{value:q,onChange:e=>Fe(e.target.value),children:[(0,l.jsx)(`option`,{value:`recommendation`,children:i(`inspirationSortRecommendation`)}),(0,l.jsx)(`option`,{value:`frequency`,children:i(`inspirationSortFrequency`)}),(0,l.jsx)(`option`,{value:`name`,children:i(`inspirationSortName`)})]})]}),(0,l.jsxs)(`label`,{className:`ue-inspiration-select`,children:[(0,l.jsx)(le,{size:14}),(0,l.jsxs)(`select`,{value:J,onChange:e=>Y(e.target.value),children:[(0,l.jsx)(`option`,{value:`all`,children:i(`inspirationType_all`)}),(0,l.jsx)(`option`,{value:`moodboard`,children:i(`inspirationType_moodboard`)}),(0,l.jsx)(`option`,{value:`portfolio`,children:i(`inspirationType_portfolio`)}),(0,l.jsx)(`option`,{value:`illustration`,children:i(`inspirationType_illustration`)}),(0,l.jsx)(`option`,{value:`product`,children:i(`inspirationType_product`)}),(0,l.jsx)(`option`,{value:`ai`,children:i(`inspirationType_ai`)})]})]})]}),(0,l.jsxs)(`div`,{className:`ue-inspiration-layout`,children:[(0,l.jsx)(`div`,{className:`ue-inspiration-list`,children:$.map((e,t)=>(0,l.jsxs)(`button`,{className:`ue-inspiration-card ${X===e.id?`is-active`:``}`,onClick:()=>Ie(e.id),children:[(0,l.jsx)(`span`,{className:`ue-inspiration-rank`,children:String(t+1).padStart(2,`0`)}),(0,l.jsxs)(`div`,{className:`ue-inspiration-card-main`,children:[(0,l.jsxs)(`div`,{className:`ue-inspiration-card-title`,children:[(0,l.jsx)(`strong`,{children:e.title}),(0,l.jsx)(`span`,{children:i(`inspirationType_${e.type}`)})]}),(0,l.jsx)(`p`,{children:i(e.descriptionKey)}),(0,l.jsxs)(`div`,{className:`ue-inspiration-score-row`,children:[(0,l.jsx)(`span`,{children:i(`inspirationRecommendation`)}),(0,l.jsx)(`i`,{children:(0,l.jsx)(`b`,{style:{width:`${e.recommendation}%`}})}),(0,l.jsx)(`em`,{children:e.recommendation})]}),(0,l.jsxs)(`div`,{className:`ue-inspiration-score-row`,children:[(0,l.jsx)(`span`,{children:i(`inspirationFrequency`)}),(0,l.jsx)(`i`,{children:(0,l.jsx)(`b`,{style:{width:`${e.frequency}%`}})}),(0,l.jsx)(`em`,{children:e.frequency})]})]}),(0,l.jsx)(ue,{size:15})]},e.id))}),(0,l.jsxs)(`aside`,{className:`ue-inspiration-detail`,children:[(0,l.jsxs)(`div`,{className:`ue-inspiration-detail-head`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`p`,{className:`ue-pane-kicker`,children:i(Q.regionKey)}),(0,l.jsx)(`h3`,{children:Q.title})]}),(0,l.jsx)(`a`,{className:`ue-icon-action ue-icon-action--filled`,href:Q.url,target:`_blank`,rel:`noreferrer`,"aria-label":i(`inspirationOpenSite`),title:i(`inspirationOpenSite`),children:(0,l.jsx)(se,{size:14})})]}),(0,l.jsx)(`p`,{children:i(Q.descriptionKey)}),(0,l.jsxs)(`div`,{className:`ue-inspiration-detail-tags`,children:[(0,l.jsxs)(`span`,{children:[(0,l.jsx)(de,{size:13}),i(Q.bestForKey)]}),(0,l.jsxs)(`span`,{children:[(0,l.jsx)(me,{size:13}),Q.url.replace(/^https?:\/\//,``).replace(/\/$/,``)]})]}),(0,l.jsxs)(`div`,{className:`ue-inspiration-detail-grid`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`strong`,{children:Q.recommendation}),(0,l.jsx)(`span`,{children:i(`inspirationRecommendation`)})]}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`strong`,{children:Q.frequency}),(0,l.jsx)(`span`,{children:i(`inspirationFrequency`)})]})]})]})]})]})})]})]})};export{h as WorkbenchWorkspace}; \ No newline at end of file diff --git a/gallery_ui/dist/assets/boxes--0yaGReH.js b/gallery_ui/dist/assets/boxes-GTo8RUgH.js similarity index 92% rename from gallery_ui/dist/assets/boxes--0yaGReH.js rename to gallery_ui/dist/assets/boxes-GTo8RUgH.js index 06b7d76..dc8d1a8 100644 --- a/gallery_ui/dist/assets/boxes--0yaGReH.js +++ b/gallery_ui/dist/assets/boxes-GTo8RUgH.js @@ -1 +1 @@ -import{i as e}from"./I18nProvider-cZczvL7B.js";var t=e(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]);export{t}; \ No newline at end of file +import{i as e}from"./I18nProvider-DEfiLn3N.js";var t=e(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]);export{t}; \ No newline at end of file diff --git a/gallery_ui/dist/assets/copy-Dp5BPX7F.js b/gallery_ui/dist/assets/copy-CoBcvjUE.js similarity index 72% rename from gallery_ui/dist/assets/copy-Dp5BPX7F.js rename to gallery_ui/dist/assets/copy-CoBcvjUE.js index 1782b33..265980d 100644 --- a/gallery_ui/dist/assets/copy-Dp5BPX7F.js +++ b/gallery_ui/dist/assets/copy-CoBcvjUE.js @@ -1 +1 @@ -import{i as e}from"./I18nProvider-cZczvL7B.js";var t=e(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]);export{t}; \ No newline at end of file +import{i as e}from"./I18nProvider-DEfiLn3N.js";var t=e(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]);export{t}; \ No newline at end of file diff --git a/gallery_ui/dist/assets/download-Bn9yrFnw.js b/gallery_ui/dist/assets/download-CSrVSIDj.js similarity index 71% rename from gallery_ui/dist/assets/download-Bn9yrFnw.js rename to gallery_ui/dist/assets/download-CSrVSIDj.js index f172f02..06c1255 100644 --- a/gallery_ui/dist/assets/download-Bn9yrFnw.js +++ b/gallery_ui/dist/assets/download-CSrVSIDj.js @@ -1 +1 @@ -import{i as e}from"./I18nProvider-cZczvL7B.js";var t=e(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]);export{t}; \ No newline at end of file +import{i as e}from"./I18nProvider-DEfiLn3N.js";var t=e(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]);export{t}; \ No newline at end of file diff --git a/gallery_ui/dist/assets/image-plus-C2AXraiD.js b/gallery_ui/dist/assets/image-plus-C8PYGAuQ.js similarity index 82% rename from gallery_ui/dist/assets/image-plus-C2AXraiD.js rename to gallery_ui/dist/assets/image-plus-C8PYGAuQ.js index 979f06a..98f397a 100644 --- a/gallery_ui/dist/assets/image-plus-C2AXraiD.js +++ b/gallery_ui/dist/assets/image-plus-C8PYGAuQ.js @@ -1 +1 @@ -import{i as e}from"./I18nProvider-cZczvL7B.js";var t=e(`image-plus`,[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]);export{t}; \ No newline at end of file +import{i as e}from"./I18nProvider-DEfiLn3N.js";var t=e(`image-plus`,[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]);export{t}; \ No newline at end of file diff --git a/gallery_ui/dist/assets/index-CKow1Wte.js b/gallery_ui/dist/assets/index-CKow1Wte.js new file mode 100644 index 0000000..564805c --- /dev/null +++ b/gallery_ui/dist/assets/index-CKow1Wte.js @@ -0,0 +1,13 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ImageSearchModal-B9S2m0Ex.css","assets/ImageDetailModal-CVSn-Zgk.css","assets/SettingsWorkspace-BYcQA0t0.css","assets/WorkbenchWorkspace-CGgZT8xC.css"])))=>i.map(i=>d[i]); +import{a as e,i as t,n,o as r,r as i,s as a,t as o}from"./I18nProvider-DEfiLn3N.js";var s=r((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&te(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-Tt&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&te(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,ee=k.port2;k.port1.onmessage=D,O=function(){ee.postMessage(null)}}else O=function(){_(D,0)};function te(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,te(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),c=r(((e,t)=>{t.exports=s()})),l=r((t=>{var n=e();function r(e){var t=`https://react.dev/errors/`+e;if(1{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=l()})),d=r((t=>{var n=c(),r=e(),i=u();function a(e){var t=`https://react.dev/errors/`+e;if(1L||(e.current=I[L],I[L]=null,L--)}function z(e,t){L++,I[L]=e.current,e.current=t}var ie=re(null),ae=re(null),oe=re(null),se=re(null);function ce(e,t){switch(z(oe,t),z(ae,e),z(ie,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}R(ie),z(ie,e)}function le(){R(ie),R(ae),R(oe)}function ue(e){e.memoizedState!==null&&z(se,e);var t=ie.current,n=Hd(t,e.type);t!==n&&(z(ae,e),z(ie,n))}function de(e){ae.current===e&&(R(ie),R(ae)),se.current===e&&(R(se),Qf._currentValue=F)}var fe,pe;function me(e){if(fe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);fe=t&&t[1]||``,pe=-1)`:-1i||c[r]!==l[i]){var u=` +`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(``)&&(u=u.replace(``,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{he=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?me(n):``}function _e(e,t){switch(e.tag){case 26:case 27:case 5:return me(e.type);case 16:return me(`Lazy`);case 13:return e.child!==t&&t!==null?me(`Suspense Fallback`):me(`Suspense`);case 19:return me(`SuspenseList`);case 0:case 15:return ge(e.type,!1);case 11:return ge(e.type.render,!1);case 1:return ge(e.type,!0);case 31:return me(`Activity`);default:return``}}function ve(e){try{var t=``,n=null;do t+=_e(e,n),n=e,e=e.return;while(e);return t}catch(e){return` +Error generating stack: `+e.message+` +`+e.stack}}var ye=Object.prototype.hasOwnProperty,be=n.unstable_scheduleCallback,xe=n.unstable_cancelCallback,Se=n.unstable_shouldYield,Ce=n.unstable_requestPaint,B=n.unstable_now,we=n.unstable_getCurrentPriorityLevel,Te=n.unstable_ImmediatePriority,Ee=n.unstable_UserBlockingPriority,De=n.unstable_NormalPriority,V=n.unstable_LowPriority,Oe=n.unstable_IdlePriority,ke=n.log,Ae=n.unstable_setDisableYieldValue,je=null,Me=null;function Ne(e){if(typeof ke==`function`&&Ae(e),Me&&typeof Me.setStrictMode==`function`)try{Me.setStrictMode(je,e)}catch{}}var Pe=Math.clz32?Math.clz32:Le,Fe=Math.log,Ie=Math.LN2;function Le(e){return e>>>=0,e===0?32:31-(Fe(e)/Ie|0)|0}var Re=256,ze=262144,Be=4194304;function Ve(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function H(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ve(n))):i=Ve(o):i=Ve(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ve(n))):i=Ve(o)):i=Ve(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function U(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function He(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function W(){var e=Be;return Be<<=1,!(Be&62914560)&&(Be=4194304),e}function Ue(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function We(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ge(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0=Rn),Vn=` `,Hn=!1;function Un(e,t){switch(e){case`keyup`:return In.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Wn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Gn=!1;function Kn(e,t){switch(e){case`compositionend`:return Wn(t);case`keypress`:return t.which===32?(Hn=!0,Vn):null;case`textInput`:return e=t.data,e===Vn&&Hn?null:e;default:return null}}function qn(e,t){if(Gn)return e===`compositionend`||!Ln&&Un(e,t)?(e=on(),an=rn=nn=null,Gn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=mr(n)}}function gr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?gr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function _r(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Dt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Dt(e.document)}return t}function vr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var yr=$t&&`documentMode`in document&&11>=document.documentMode,br=null,xr=null,Sr=null,Cr=!1;function wr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Cr||br==null||br!==Dt(r)||(r=br,`selectionStart`in r&&vr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Sr&&pr(Sr,r)||(Sr=r,r=Td(xr,`onSelect`),0>=o,i-=o,gi=1<<32-Pe(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Y&&vi(i,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),Y&&vi(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Y&&vi(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),Y&&vi(i,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=i(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&va(l)===r.type){n(e,r.sibling),c=i(r,o.props),Ta(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===y?(c=ri(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ni(o.type,o.key,o.props,null,e.mode,c),Ta(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=i(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=oi(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=va(o),b(e,r,o,c)}if(ne(o))return h(e,r,o,c);if(A(o)){if(l=A(o),typeof l!=`function`)throw Error(a(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,wa(o),c);if(o.$$typeof===C)return b(e,r,Ki(e,o),c);Ea(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,o),c.return=e,e=c):(n(e,r),c=ii(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ca=0;var i=b(e,t,n,r);return Sa=null,i}catch(t){if(t===fa||t===ma)throw t;var a=Qr(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Oa=Da(!0),ka=Da(!1),Aa=!1;function ja(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ma(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Na(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Pa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Pl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Yr(e),Jr(e,null,n),t}return Gr(e,r,t,n),Yr(e)}function Fa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,qe(e,n)}}function Ia(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var La=!1;function Ra(){if(La){var e=ra;if(e!==null)throw e}}function za(e,t,n,r){La=!1;var i=e.updateQueue;Aa=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Q&f)===f:(r&f)===f){f!==0&&f===na&&(La=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Aa=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Ul|=o,e.lanes=o,e.memoizedState=d}}function Ba(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function Va(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=N.T,s={};N.T=s,Ds(e,!1,t,n);try{var c=i(),l=N.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Es(e,t,oa(c,r),du(e)):Es(e,t,r,du(e))}catch(n){Es(e,t,{then:function(){},status:`rejected`,reason:n},du())}finally{P.p=a,o!==null&&s.types!==null&&(o.types=s.types),N.T=o}}function gs(){}function _s(e,t,n,r){if(e.tag!==5)throw Error(a(476));var i=vs(e).queue;hs(e,i,t,F,n===null?gs:function(){return ys(e),n(r)})}function vs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oo,lastRenderedState:F},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ys(e){var t=vs(e);t.next===null&&(t=e.alternate.memoizedState),Es(e,t.next.queue,{},du())}function bs(){return Gi(Qf)}function xs(){return Co().memoizedState}function Ss(){return Co().memoizedState}function Cs(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=du();e=Na(n);var r=Pa(t,e,n);r!==null&&(pu(r,t,n),Fa(r,t,n)),t={cache:Qi()},e.payload=t;return}t=t.return}}function ws(e,t,n){var r=du();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Os(e)?ks(t,n):(n=Kr(e,t,n,r),n!==null&&(pu(n,e,r),As(n,t,r)))}function Ts(e,t,n){Es(e,t,n,du())}function Es(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Os(e))ks(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,fr(s,o))return Gr(e,t,i,0),Fl===null&&Wr(),!1}catch{}if(n=Kr(e,t,i,r),n!==null)return pu(n,e,r),As(n,t,r),!0}return!1}function Ds(e,t,n,r){if(r={lane:2,revertLane:ud(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Os(e)){if(t)throw Error(a(479))}else t=Kr(e,n,r,2),t!==null&&pu(t,e,2)}function Os(e){var t=e.alternate;return e===X||t!==null&&t===X}function ks(e,t){oo=ao=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function As(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,qe(e,n)}}var js={readContext:Gi,use:Eo,useCallback:po,useContext:po,useEffect:po,useImperativeHandle:po,useLayoutEffect:po,useInsertionEffect:po,useMemo:po,useReducer:po,useRef:po,useState:po,useDebugValue:po,useDeferredValue:po,useTransition:po,useSyncExternalStore:po,useId:po,useHostTransitionStatus:po,useFormState:po,useActionState:po,useOptimistic:po,useMemoCache:po,useCacheRefresh:po};js.useEffectEvent=po;var Ms={readContext:Gi,use:Eo,useCallback:function(e,t){return So().memoizedState=[e,t===void 0?null:t],e},useContext:Gi,useEffect:ns,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),es(4194308,4,cs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return es(4194308,4,e,t)},useInsertionEffect:function(e,t){es(4,2,e,t)},useMemo:function(e,t){var n=So();t=t===void 0?null:t;var r=e();if(so){Ne(!0);try{e()}finally{Ne(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=So();if(n!==void 0){var i=n(t);if(so){Ne(!0);try{n(t)}finally{Ne(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=ws.bind(null,X,e),[r.memoizedState,e]},useRef:function(e){var t=So();return e={current:e},t.memoizedState=e},useState:function(e){e=Ro(e);var t=e.queue,n=Ts.bind(null,X,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:us,useDeferredValue:function(e,t){return ps(So(),e,t)},useTransition:function(){var e=Ro(!1);return e=hs.bind(null,X,e.queue,!0,!1),So().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=X,i=So();if(Y){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),Fl===null)throw Error(a(349));Q&127||No(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,ns(Fo.bind(null,r,o,e),[e]),r.flags|=2048,Qo(9,{destroy:void 0},Po.bind(null,r,o,n,t),null),n},useId:function(){var e=So(),t=Fl.identifierPrefix;if(Y){var n=_i,r=gi;n=(r&~(1<<32-Pe(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=co++,0<\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}o[Qe]=t,o[$e]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Pd(o,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Ec(t)}}return jc(t),Dc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ec(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=oe.current,ji(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=Ci,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[Qe]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||jd(e.nodeValue,n)),e||Oi(t,!0)}else e=Bd(e).createTextNode(r),e[Qe]=t,t.stateNode=e}return jc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ji(t),n!==null){if(e===null){if(!r)throw Error(a(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(557));e[Qe]=t}else Mi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;jc(t),e=!1}else n=Ni(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?($a(t),t):($a(t),null);if(t.flags&128)throw Error(a(558))}return jc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=ji(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(a(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(a(317));i[Qe]=t}else Mi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;jc(t),i=!1}else i=Ni(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?($a(t),t):($a(t),null)}return $a(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),kc(t,t.updateQueue),jc(t),null);case 4:return le(),e===null&&xd(t.stateNode.containerInfo),jc(t),null;case 10:return zi(t.type),jc(t),null;case 19:if(R(eo),r=t.memoizedState,r===null)return jc(t),null;if(i=!!(t.flags&128),o=r.rendering,o===null){if(i)Ac(r,!1);else{if(Hl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=to(e),o!==null){for(t.flags|=128,Ac(r,!1),e=o.updateQueue,t.updateQueue=e,kc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ti(n,e),n=n.sibling;return z(eo,eo.current&1|2),Y&&vi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&B()>$l&&(t.flags|=128,i=!0,Ac(r,!1),t.lanes=4194304)}}else{if(!i){if(e=to(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,kc(t,e),Ac(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Y)return jc(t),null}else 2*B()-r.renderingStartTime>$l&&n!==536870912&&(t.flags|=128,i=!0,Ac(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(jc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=B(),e.sibling=null,n=eo.current,z(eo,i?n&1|2:n&1),Y&&vi(t,r.treeForkCount),e);case 22:case 23:return $a(t),Ka(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(jc(t),t.subtreeFlags&6&&(t.flags|=8192)):jc(t),n=t.updateQueue,n!==null&&kc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&R(ca),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),zi(Zi),jc(t),null;case 25:return null;case 30:return null}throw Error(a(156,t.tag))}function Nc(e,t){switch(xi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return zi(Zi),le(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return de(t),null;case 31:if(t.memoizedState!==null){if($a(t),t.alternate===null)throw Error(a(340));Mi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if($a(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));Mi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return R(eo),null;case 4:return le(),null;case 10:return zi(t.type),null;case 22:case 23:return $a(t),Ka(),e!==null&&R(ca),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return zi(Zi),null;case 25:return null;default:return null}}function Pc(e,t){switch(xi(t),t.tag){case 3:zi(Zi),le();break;case 26:case 27:case 5:de(t);break;case 4:le();break;case 31:t.memoizedState!==null&&$a(t);break;case 13:$a(t);break;case 19:R(eo);break;case 10:zi(t.type);break;case 22:case 23:$a(t),Ka(),e!==null&&R(ca);break;case 24:zi(Zi)}}function Fc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Uu(t,t.return,e)}}function Ic(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Uu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Uu(t,t.return,e)}}function Lc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Va(t,n)}catch(t){Uu(e,e.return,t)}}}function Rc(e,t,n){n.props=zs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Uu(e,t,n)}}function zc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Uu(e,t,n)}}function Bc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Uu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Uu(e,t,n)}else n.current=null}}function Vc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Uu(e,e.return,t)}}function Hc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[$e]=t}catch(t){Uu(e,e.return,t)}}function Uc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Wc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Uc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Gc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Wt));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Gc(e,t,n),e=e.sibling;e!==null;)Gc(e,t,n),e=e.sibling}function Kc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Kc(e,t,n),e=e.sibling;e!==null;)Kc(e,t,n),e=e.sibling}function qc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[Qe]=e,t[$e]=n}catch(t){Uu(e,e.return,t)}}var Jc=!1,Yc=!1,Xc=!1,Zc=typeof WeakSet==`function`?WeakSet:Set,Qc=null;function $c(e,t){if(e=e.containerInfo,Rd=sp,e=_r(e),vr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||i!==0&&f.nodeType!==3||(c=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===i&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,Qc=t;Qc!==null;)if(t=Qc,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,Qc=e;else for(;Qc!==null;){switch(t=Qc,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n title`))),Pd(o,r,n),o[Qe]=e,ut(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,i).get(r+(n.href||``));if(s){for(var c=0;cg&&(o=g,g=h,h=o);var _=hr(s,h),v=hr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;sn?32:n,N.T=null,n=su,su=null;var o=ru,s=au;if(nu=0,iu=ru=null,au=0,Pl&6)throw Error(a(331));var c=Pl;if(Pl|=4,kl(o.current),xl(o,o.current,s,n),Pl=c,rd(0,!1),Me&&typeof Me.onPostCommitFiberRoot==`function`)try{Me.onPostCommitFiberRoot(je,o)}catch{}return!0}finally{P.p=i,N.T=r,zu(e,t)}}function Hu(e,t,n){t=ci(n,t),t=Gs(e.stateNode,t,2),e=Pa(e,t,2),e!==null&&(We(e,2),nd(e))}function Uu(e,t,n){if(e.tag===3)Hu(e,e,n);else for(;t!==null;){if(t.tag===3){Hu(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(tu===null||!tu.has(r))){e=ci(n,e),n=Ks(2),r=Pa(t,n,2),r!==null&&(qs(n,r,t,e),We(r,2),nd(r));break}}t=t.return}}function Wu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Nl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Bl=!0,i.add(n),e=Gu.bind(null,e,t,n),t.then(e,e))}function Gu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Fl===e&&(Q&n)===n&&(Hl===4||Hl===3&&(Q&62914560)===Q&&300>B()-Zl?!(Pl&2)&&bu(e,0):Gl|=n,ql===Q&&(ql=0)),nd(e)}function Ku(e,t){t===0&&(t=W()),e=qr(e,t),e!==null&&(We(e,t),nd(e))}function qu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ku(e,n)}function Ju(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(t),Ku(e,n)}function Yu(e,t){return be(e,t)}var Xu=null,Zu=null,Qu=!1,$u=!1,ed=!1,td=0;function nd(e){e!==Zu&&e.next===null&&(Zu===null?Xu=Zu=e:Zu=Zu.next=e),$u=!0,Qu||(Qu=!0,ld())}function rd(e,t){if(!ed&&$u){ed=!0;do for(var n=!1,r=Xu;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Pe(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,cd(r,a))}else a=Q,a=H(r,r===Fl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||U(r,a)||(n=!0,cd(r,a))}r=r.next}while(n);ed=!1}}function id(){ad()}function ad(){$u=Qu=!1;var e=0;td!==0&&Gd()&&(e=td);for(var t=B(),n=null,r=Xu;r!==null;){var i=r.next,a=od(r,t);a===0?(r.next=null,n===null?Xu=i:n.next=i,i===null&&(Zu=n)):(n=r,(e!==0||a&3)&&($u=!0)),r=i}nu!==0&&nu!==5||rd(e,!1),td!==0&&(td=0)}function od(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=kt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),ut(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+kt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+kt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+kt(n.imageSizes)+`"]`)):i+=`[href="`+kt(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),ut(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+kt(r)+`"][href="`+kt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),ut(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=lt(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);ut(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=lt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),ut(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=lt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),ut(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var i=(i=oe.current)?gf(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=lt(i).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=lt(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(i,e,n,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=lt(i).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Af(e){return`href="`+kt(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),ut(t),e.head.appendChild(t))}function Pf(e){return`[src="`+kt(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+kt(n.href)+`"]`);if(r)return t.instance=r,ut(r),r;var i=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),ut(r),Pd(r,`style`,i),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Af(n.href);var o=e.querySelector(jf(i));if(o)return t.state.loading|=4,t.instance=o,ut(o),o;r=Mf(n),(i=mf.get(i))&&Rf(r,i),o=(e.ownerDocument||e).createElement(`link`),ut(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(i=e.querySelector(Ff(o)))?(t.instance=i,ut(i),i):(r=n,(i=mf.get(o))&&(r=h({},n),zf(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),ut(i),Pd(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,ut(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),ut(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=d()})),p=a(e(),1),m=f(),h=u(),g=12,_=10,v=e=>e instanceof HTMLElement&&!!e.closest(`input, textarea, select, [contenteditable='true']`),y=(e,t,{width:n,height:r},i={width:window.innerWidth,height:window.innerHeight})=>({x:e+n>i.width-g?Math.max(g,e-n):Math.max(g,e),y:t+r>i.height-g?Math.max(g,t-r):Math.max(g,t)}),b=(e,{width:t,height:n},r={width:window.innerWidth,height:window.innerHeight})=>({x:e.right+_+t<=r.width-g?e.right+_:Math.max(g,e.left-_-t),y:Math.min(Math.max(g,e.top),Math.max(g,r.height-n-g))}),x=(e,t,n=`target`)=>{if(n===`pointer`)return y(e.clientX,e.clientY,t);let r=e.currentTarget instanceof HTMLElement?e.currentTarget.getBoundingClientRect():null;return r?b(r,t):y(e.clientX,e.clientY,t)},S=({children:e})=>typeof document>`u`?null:(0,h.createPortal)(e,document.body),C=(e,t,n={})=>{(0,p.useEffect)(()=>{if(!e)return;let r=e=>{e.key===`Escape`&&t()},i=e=>{e.target instanceof HTMLElement&&(e.target.closest(`.ue-update-popover`)||e.target.closest(`.ue-floating-layer`)||e.target.closest(`.ue-filter-popover`)||e.target.closest(`.ue-select-field__menu`)||e.target.closest(`.ue-context-menu`))||t()};return window.addEventListener(`click`,t),n.closeOnResize!==!1&&window.addEventListener(`resize`,t),window.addEventListener(`keydown`,r),n.closeOnContextMenu&&window.addEventListener(`contextmenu`,t),n.closeOnScroll&&window.addEventListener(`scroll`,i,!0),()=>{window.removeEventListener(`click`,t),n.closeOnResize!==!1&&window.removeEventListener(`resize`,t),window.removeEventListener(`keydown`,r),n.closeOnContextMenu&&window.removeEventListener(`contextmenu`,t),n.closeOnScroll&&window.removeEventListener(`scroll`,i,!0)}},[e,t,n.closeOnContextMenu,n.closeOnScroll,n.closeOnResize])},w=t(`arrow-right-left`,[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]),T=t(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),E=t(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),D=t(`calendar-x`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`m14 14-4 4`,key:`rymu2i`}],[`path`,{d:`m10 14 4 4`,key:`3sz06r`}]]),O=t(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),k=t(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),ee=t(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),te=t(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),A=t(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),j=t(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),M=t(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),ne=t(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),N=t(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),P=t(`clipboard-copy`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2`,key:`4jdomd`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v4`,key:`3hqy98`}],[`path`,{d:`M21 14H11`,key:`1bme5i`}],[`path`,{d:`m15 10-4 4 4 4`,key:`5dvupr`}]]),F=t(`corner-down-right`,[[`path`,{d:`m15 10 5 5-5 5`,key:`qqa56n`}],[`path`,{d:`M4 4v7a4 4 0 0 0 4 4h12`,key:`z08zvw`}]]),I=t(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),L=t(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),re=t(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),R=t(`file-braces`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`1oajmo`}],[`path`,{d:`M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`mpwhp6`}]]),z=t(`folder-minus`,[[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),ie=t(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),ae=t(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),oe=t(`folder-search`,[[`path`,{d:`M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1`,key:`1bw5m7`}],[`path`,{d:`m21 21-1.9-1.9`,key:`1g2n9r`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}]]),se=t(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),ce=t(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),le=t(`grid-2x2`,[[`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`}]]),ue=t(`hard-drive`,[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]),de=t(`image-off`,[[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}],[`path`,{d:`M10.41 10.41a2 2 0 1 1-2.83-2.83`,key:`1bzlo9`}],[`line`,{x1:`13.5`,x2:`6`,y1:`13.5`,y2:`21`,key:`1q0aeu`}],[`line`,{x1:`18`,x2:`21`,y1:`12`,y2:`15`,key:`5mozeu`}],[`path`,{d:`M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59`,key:`mmje98`}],[`path`,{d:`M21 15V5a2 2 0 0 0-2-2H9`,key:`43el77`}]]),fe=t(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),pe=t(`images`,[[`path`,{d:`m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16`,key:`9kzy35`}],[`path`,{d:`M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2`,key:`1t0f0t`}],[`circle`,{cx:`13`,cy:`7`,r:`1`,fill:`currentColor`,key:`1obus6`}],[`rect`,{x:`8`,y:`2`,width:`14`,height:`14`,rx:`2`,key:`1gvhby`}]]),me=t(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),he=t(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),ge=t(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),_e=t(`library`,[[`path`,{d:`m16 6 4 14`,key:`ji33uf`}],[`path`,{d:`M12 6v14`,key:`1n7gus`}],[`path`,{d:`M8 8v12`,key:`1gg7y9`}],[`path`,{d:`M4 4v16`,key:`6qkkli`}]]),ve=t(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),ye=t(`list-tree`,[[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`M3 10a2 2 0 0 0 2 2h3`,key:`1npucw`}],[`path`,{d:`M3 5v12a2 2 0 0 0 2 2h3`,key:`x1gjn2`}]]),be=t(`list`,[[`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`}]]),xe=t(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Se=t(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),Ce=t(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),B=t(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),we=t(`panel-left-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]]),Te=t(`panel-left-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]]),Ee=t(`pencil-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),De=t(`pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]),V=t(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Oe=t(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),ke=t(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),Ae=t(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),je=t(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),Me=t(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Ne=t(`share-2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]),Pe=t(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),Fe=t(`square-check-big`,[[`path`,{d:`M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344`,key:`2acyp4`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),Ie=t(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),Le=t(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),Re=t(`trash-2`,[[`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`}]]),ze=t(`trash`,[[`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`}]]),Be=t(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Ve=t(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),H=t(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),U=i(),He=(0,p.createContext)(null),W=3e3,Ue=()=>`${Date.now()}-${Math.random().toString(36).slice(2,8)}`,We=(e,t)=>e instanceof Error?e.message:t,Ge=e=>{let t=[...e];for(;t.filter(e=>e.tone===`success`||e.tone===`info`).length>50;){let e=[...t].reverse().findIndex(e=>e.tone===`success`||e.tone===`info`);if(e===-1)break;t.splice(t.length-1-e,1)}return t},Ke=({children:e})=>{let{t}=n(),[r,i]=(0,p.useState)([]),[a,o]=(0,p.useState)(!1),[s,c]=(0,p.useState)(`pending`);C(a,(0,p.useCallback)(()=>o(!1),[]),{closeOnScroll:!1});let[l,u]=(0,p.useState)(()=>Date.now()),d=(0,p.useRef)(new Map),f=(0,p.useRef)(new Map),m=(0,p.useCallback)(e=>{let t=d.current.get(e);t!==void 0&&(window.clearTimeout(t),d.current.delete(e))},[]),h=(0,p.useCallback)(e=>{m(e),i(t=>t.map(t=>t.id===e?{...t,hidden:!0}:t))},[m]),g=(0,p.useCallback)((e,t)=>{if(m(e),t===`pending`||t===`error`)return;let n=window.setTimeout(()=>h(e),W);d.current.set(e,n)},[m,h]),_=(0,p.useCallback)(e=>{u(Date.now()),i(t=>{let n=(e.jobId?t.find(t=>t.jobId===e.jobId):void 0)?.id??e.id,r=t.filter(e=>e.id!==n),i=t.find(e=>e.id===n),a=!!(e.jobId&&i?.jobId&&e.jobId!==i.jobId),o=a?e.createdAt:i?.createdAt??e.createdAt,s=e.quiet&&e.tone!==`error`&&e.tone!==`pending`&&(!i||Date.now()-o<2e3);return Ge([{...i,...e,id:n,createdAt:o,hidden:e.tone===`error`&&i?.tone!==`error`?!1:!a&&i?.hidden||s,occurrences:i?.tone===`error`&&e.tone===`error`&&!e.jobId?(i.occurrences??1)+1:i?.occurrences},...r])})},[]);(0,p.useEffect)(()=>{for(let e of r)e.tone===`pending`||e.tone===`error`?m(e.id):!e.hidden&&!d.current.has(e.id)&&g(e.id,e.tone)},[m,r,g]);let v=(0,p.useCallback)((e,t=`info`,n=``)=>{let r=`${e}\n${n}`,i=t===`error`?f.current.get(r)??Ue():Ue();return t===`error`&&f.current.set(r,i),_({id:i,tone:t,message:e,detail:n,createdAt:Date.now()}),i},[_]),y=(0,p.useCallback)((e,t=``,n)=>{let r=Ue();return _({id:r,tone:`pending`,message:e,detail:t,...n,createdAt:Date.now()}),r},[_]),b=(0,p.useCallback)((e,t,n,r=``,i)=>{_({id:e,tone:n,message:t,detail:r,retry:i,cancel:void 0,createdAt:Date.now()})},[_]),x=(0,p.useCallback)(async(e,t)=>{let n=y(t.pending,``,{taskKind:t.taskKind,source:t.source});try{let r=await e();return t.success?b(n,typeof t.success==`function`?t.success(r):t.success,t.successTone?.(r)??`success`,t.successDetail?.(r)??``,t.successRetry?.(r)):h(n),r}catch(e){let r=typeof t.error==`string`?t.error:`Operation failed`;throw b(n,typeof t.error==`function`?t.error(e):We(e,r),`error`),e}},[h,y,b]),S=(0,p.useCallback)((e,t,n,r,i,a)=>{_({id:`task:${e}`,message:t,tone:n,detail:r,retry:i,...a,createdAt:Date.now()})},[_]);(0,p.useEffect)(()=>{let e=r.filter(e=>!e.hidden&&e.quiet&&e.tone===`pending`&&Date.now()-e.createdAt<2e3);if(!e.length)return;let t=window.setTimeout(()=>u(Date.now()),Math.max(0,Math.min(...e.map(e=>e.createdAt+2e3-Date.now()))));return()=>window.clearTimeout(t)},[r,l]),(0,p.useEffect)(()=>()=>{d.current.forEach(e=>window.clearTimeout(e)),d.current.clear()},[]);let w=(0,p.useMemo)(()=>({notify:v,startOperation:y,updateOperation:b,dismissOperation:h,runOperation:x,syncTask:S}),[h,v,x,y,b,S]),T=r.filter(e=>!e.hidden&&(!e.quiet||e.tone!==`pending`||l-e.createdAt>=2e3)),E=e=>e.tone===`error`?0:e.tone===`pending`?1:2,D=[...T].sort((e,t)=>E(e)-E(t)).slice(0,3),O=r.filter(e=>s===`recent`?[`success`,`info`].includes(e.tone):e.tone===s),k=r.filter(e=>e.tone===`pending`).length,ee=r.filter(e=>e.tone===`error`).length,te=(e,n=!1)=>(0,U.jsxs)(`article`,{className:`ue-operation-card ue-operation-card--${e.tone}`,role:n||e.tone===`pending`?void 0:e.tone===`error`?`alert`:`status`,children:[(0,U.jsx)(`div`,{className:`ue-operation-icon`,"aria-hidden":`true`,children:e.tone===`pending`?(0,U.jsx)(xe,{size:16,className:`ue-operation-spinner`}):e.tone===`success`?(0,U.jsx)(N,{size:16}):e.tone===`error`?(0,U.jsx)(ne,{size:16}):(0,U.jsx)(me,{size:16})}),(0,U.jsxs)(`div`,{className:`ue-operation-copy`,children:[(0,U.jsxs)(`strong`,{children:[e.message,(e.occurrences??1)>1?` ×${e.occurrences}`:``]}),e.retry&&(0,U.jsx)(`button`,{type:`button`,onClick:e.retry,children:t(`jobRetry`)}),e.cancel&&e.tone===`pending`&&(0,U.jsx)(`button`,{type:`button`,onClick:e.cancel,children:t(`jobRequestCancel`)}),e.detail&&e.tone===`error`?(0,U.jsxs)(`details`,{className:`ue-operation-details`,children:[(0,U.jsx)(`summary`,{children:t(`operationViewDetails`)}),(0,U.jsx)(`span`,{children:e.detail})]}):e.detail?(0,U.jsx)(`span`,{children:e.detail}):null]}),(0,U.jsx)(`button`,{className:`ue-operation-dismiss`,"aria-label":t(n&&e.tone!==`pending`?`operationClear`:`notificationDismiss`),onClick:()=>n&&e.tone!==`pending`?i(t=>t.filter(t=>t.id!==e.id)):h(e.id),children:(0,U.jsx)(H,{size:14})})]},e.id);return(0,U.jsxs)(He.Provider,{value:w,children:[e,(0,U.jsxs)(`div`,{className:`ue-operation-status-center`,onClick:e=>e.stopPropagation(),children:[a?(0,U.jsxs)(`section`,{className:`ue-task-panel`,"aria-label":t(`operationCenter`),children:[(0,U.jsxs)(`header`,{children:[(0,U.jsx)(`strong`,{children:t(`operationCenter`)}),(0,U.jsx)(`button`,{onClick:()=>o(!1),"aria-label":t(`notificationDismiss`),children:(0,U.jsx)(H,{size:16})})]}),(0,U.jsx)(`nav`,{"aria-label":t(`operationCenter`),children:[`pending`,`error`,`recent`].map(e=>(0,U.jsx)(`button`,{"aria-pressed":s===e,onClick:()=>c(e),children:t(`operationTab_${e}`)},e))}),(0,U.jsx)(`div`,{className:`ue-task-history`,children:O.length?O.map(e=>te(e,!0)):(0,U.jsx)(`p`,{children:t(`operationEmpty`)})})]}):D.map(e=>te(e)),(0,U.jsxs)(`button`,{className:`ue-task-center-toggle`,"aria-expanded":a,onClick:()=>{a||c(k?`pending`:ee?`error`:`recent`),o(e=>!e)},children:[(0,U.jsx)(ve,{size:16}),(0,U.jsx)(`span`,{children:t(`operationCenter`)}),k>0&&(0,U.jsxs)(`span`,{children:[k,` `,t(`operationTab_pending`)]}),ee>0&&(0,U.jsxs)(`span`,{className:`ue-task-error-count`,children:[ee,` `,t(`operationTab_error`)]})]})]})]})},qe=()=>{let e=(0,p.useContext)(He);if(!e)throw Error(`useOperationStatus must be used within OperationStatusProvider`);return e},Je=`universal-gallery:job-activity`,Ye=e=>{window.dispatchEvent(new CustomEvent(Je,{detail:e}))},Xe=class extends Error{status;details;constructor(e,t,n){super(e),this.name=`ApiRequestError`,this.status=t,this.details=n}},G=async(e,t)=>{let n=typeof e==`string`&&(e.includes(`force_refresh=true`)||e.includes(`fingerprints/prewarm`)||e.includes(`/images/variant-`)||e.includes(`/images/search-by-image`)||e.endsWith(`/jobs`)&&t?.method===`POST`);n&&Ye(1);try{let n=await fetch(e,t);if(!n.ok){let e=null;try{let t=await n.text();try{e=JSON.parse(t)}catch{e=t.slice(0,1e3)}}catch{}throw new Xe(typeof e==`object`&&e&&`error`in e&&typeof e.error==`string`?e.error:typeof e==`string`&&e.trim()&&!e.trim().startsWith(`<`)?e.trim().slice(0,200):`Request failed: ${n.status}`,n.status,e)}return await n.json()}finally{n&&Ye(-1)}},K={async getSyncStatus(e,t){return G(`/universal_gallery/api/sync-status?since=${e}`,{signal:t})},async locateImage(e,t,n,r,i){let a=new URLSearchParams({limit:String(t),sort_by:n,sort_order:r});return a.set(e.asset_id?`asset_id`:`relative_path`,e.asset_id||e.relative_path),G(`/universal_gallery/api/images/locate?${a}`,{signal:i})},async getReleaseNotes(e=`zh-CN`){return G(`/universal_gallery/api/release-notes?locale=${encodeURIComponent(e)}`)},async searchByImage(e,t=70,n){let r=new FormData;return r.append(`image`,e),G(`/universal_gallery/api/images/search-by-image?minimum=${t}`,{method:`POST`,body:r,signal:n})},async listJobs(e,t){return G(`/universal_gallery/api/jobs?limit=50${t===void 0?``:`&after=${t}&wait_ms=15000`}`,{signal:e,cache:`no-store`})},async getJob(e,t){return G(`/universal_gallery/api/jobs/${encodeURIComponent(e)}`,{signal:t})},async createJob(e,t){return G(`/universal_gallery/api/jobs`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:e,payload:t})})},async cancelJob(e){return G(`/universal_gallery/api/jobs/${encodeURIComponent(e)}/cancel`,{method:`POST`})},async getContext(e=!1,t){let n=new URLSearchParams;return e&&n.set(`force_refresh`,`true`),G(`/universal_gallery/api/context${n.size?`?${n}`:``}`,t?{signal:t}:void 0)},async getUpdateStatus(e=!1){return G(`/universal_gallery/api/update-status${e?`?force=true`:``}`)},async listImages(e,t,n,r=``,i=``,a=``,o=``,s=``,c=!1,l=``,u=`created_at`,d=`desc`,f=!1,p){let m=new URLSearchParams({page:String(e),limit:String(t)});return n.trim()&&m.set(`search`,n.trim()),r.trim()&&m.set(`category`,r.trim()),i.trim()&&m.set(`subfolder`,i.trim()),a.trim()&&m.set(`board_id`,a.trim()),o.trim()&&m.set(`date_from`,o.trim()),s.trim()&&m.set(`date_to`,s.trim()),c&&m.set(`pinned`,`true`),l.trim()&&m.set(`color_family`,l.trim()),m.set(`sort_by`,u),m.set(`sort_order`,d),f&&m.set(`force_refresh`,`true`),G(`/universal_gallery/api/images?${m}`,p?{signal:p}:void 0)},async getImageFreshness(e=``,t=``,n){let r=new URLSearchParams;return e.trim()&&r.set(`subfolder`,e.trim()),t.trim()&&r.set(`known`,t.trim()),G(`/universal_gallery/api/images/freshness${r.size?`?${r}`:``}`,n?{signal:n}:void 0)},async listVariantGroups(e={},t){let n=new URLSearchParams;return e.search?.trim()&&n.set(`search`,e.search.trim()),e.category?.trim()&&n.set(`category`,e.category.trim()),e.subfolder?.trim()&&n.set(`subfolder`,e.subfolder.trim()),e.boardId?.trim()&&n.set(`board_id`,e.boardId.trim()),e.dateFrom?.trim()&&n.set(`date_from`,e.dateFrom.trim()),e.dateTo?.trim()&&n.set(`date_to`,e.dateTo.trim()),e.favoritesOnly&&n.set(`pinned`,`true`),e.colorFamily?.trim()&&n.set(`color_family`,e.colorFamily.trim()),e.sortBy&&n.set(`sort_by`,e.sortBy),e.sortOrder&&n.set(`sort_order`,e.sortOrder),e.type&&n.set(`type`,e.type),e.limit&&n.set(`limit`,String(e.limit)),e.forceRefresh&&n.set(`force_refresh`,`true`),G(`/universal_gallery/api/images/variant-groups?${n}`,{signal:t})},async getVariantGroupImages(e,t){let n=new URLSearchParams({group_id:e.groupId,page:String(e.page??1),limit:String(e.limit??60)});return e.type&&n.set(`type`,e.type),e.search?.trim()&&n.set(`search`,e.search.trim()),e.category?.trim()&&n.set(`category`,e.category.trim()),e.subfolder?.trim()&&n.set(`subfolder`,e.subfolder.trim()),e.boardId?.trim()&&n.set(`board_id`,e.boardId.trim()),e.dateFrom?.trim()&&n.set(`date_from`,e.dateFrom.trim()),e.dateTo?.trim()&&n.set(`date_to`,e.dateTo.trim()),e.favoritesOnly&&n.set(`pinned`,`true`),e.colorFamily?.trim()&&n.set(`color_family`,e.colorFamily.trim()),e.sortBy&&n.set(`sort_by`,e.sortBy),e.sortOrder&&n.set(`sort_order`,e.sortOrder),G(`/universal_gallery/api/images/variant-group?${n}`,{signal:t})},async prewarmFingerprints(e={}){return G(`/universal_gallery/api/images/fingerprints/prewarm`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({relative_paths:e.relativePaths,subfolder:e.subfolder,search:e.search,category:e.category,board_id:e.boardId,date_from:e.dateFrom,date_to:e.dateTo,pinned:e.favoritesOnly,color_family:e.colorFamily,limit:e.limit})})},async getFingerprintStatus(){return G(`/universal_gallery/api/images/fingerprints/status`)},async getImageMetadata(e){return G(`/universal_gallery/api/metadata?relative_path=${encodeURIComponent(e)}`)},async prewarmThumbnails(e,t=80){return G(`/universal_gallery/api/thumb/prewarm`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({relative_paths:e,limit:t})})},async getThumbnailPrewarmStatus(){return G(`/universal_gallery/api/thumb/prewarm-status`)},async getColorIndexStatus(){return G(`/universal_gallery/api/color-index/status`)},async updateImageState(e,t){return G(`/universal_gallery/api/image-state`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({relative_path:e,updates:t})})},async importFiles(e,t=``,n=`universal_gallery_imports`){let r=new FormData;return t.trim()&&r.append(`target_source_id`,t.trim()),n.trim()&&r.append(`target_subfolder`,n.trim()),e.forEach(e=>{r.append(`files`,e,e.name)}),G(`/universal_gallery/api/import`,{method:`POST`,body:r})},async deleteImages(e){return G(`/universal_gallery/api/images/delete`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({relative_paths:e})})},async batchUpdateImages(e,t){return G(`/universal_gallery/api/images/batch-update`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({relative_paths:e,updates:t})})},async listBoards(e=!1){let t=new URLSearchParams;return e&&t.set(`force_refresh`,`true`),(await G(`/universal_gallery/api/boards${t.size?`?${t}`:``}`)).boards??[]},async createBoard(e,t=``){return G(`/universal_gallery/api/boards`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({name:e,description:t})})},async updateBoard(e,t){return G(`/universal_gallery/api/boards`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({id:e,updates:t})})},async deleteBoard(e){return G(`/universal_gallery/api/boards`,{method:`DELETE`,headers:{"Content-Type":`application/json`},body:JSON.stringify({id:e})})},async updateBoardPins(e,t,n=!0){return G(`/universal_gallery/api/boards/pins`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({id:e,relative_paths:t,pinned:n})})},async moveImages(e,t,n=``){return G(`/universal_gallery/api/images/move`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({relative_paths:e,target_subfolder:t,target_source_id:n})})},async renameImage(e,t){return G(`/universal_gallery/api/images/rename`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({relative_path:e,new_filename:t})})},async batchRenameImages(e,t,n=1,r=2,i=1){return G(`/universal_gallery/api/images/batch-rename`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({relative_paths:e,template:t,start_number:n,padding:r,current_page:i})})},async listLibraries(){return(await G(`/universal_gallery/api/libraries`)).libraries??[]},async getLibrary(e){return(await G(`/universal_gallery/api/library?name=${encodeURIComponent(e)}`)).data??[]},async getLibraryEntries(e,t=``,n=1,r=120){let i=new URLSearchParams({name:e,page:String(n),limit:String(r)});return t.trim()&&i.set(`search`,t.trim()),G(`/universal_gallery/api/library/entries?${i}`)},async getLibraryRaw(e){return G(`/universal_gallery/api/library/raw?name=${encodeURIComponent(e)}`)},async searchLibraryArtists(e,t=``,n=`none`,r=0,i=12){return G(`/universal_gallery/api/library/artists?${new URLSearchParams({name:e,query:t,filter_mode:n,post_threshold:String(r),limit:String(i)})}`)},async generateArtistString(e){return G(`/universal_gallery/api/library/generate-artists`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})},async saveLibrary(e,t){return G(`/universal_gallery/api/library`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({name:e,data:t})})},async deleteLibrary(e){return G(`/universal_gallery/api/library?name=${encodeURIComponent(e)}`,{method:`DELETE`})},async saveLibraryEntry(e,t,n){return G(`/universal_gallery/api/library/entry`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(n===void 0?{name:e,entry:t}:{name:e,entry:t,index:n})})},async deleteLibraryEntry(e,t){return G(`/universal_gallery/api/library/entry`,{method:`DELETE`,headers:{"Content-Type":`application/json`},body:JSON.stringify({name:e,index:t})})},async createFolder(e){return G(`/universal_gallery/api/folders/create`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e})})},async deleteFolder(e){return G(`/universal_gallery/api/folders/delete`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e})})},async mergeFolder(e,t){return G(`/universal_gallery/api/folders/merge`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({source_path:e,target_path:t})})},async renameFolder(e,t){return G(`/universal_gallery/api/folders/rename`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({source_path:e,target_path:t})})},async importLibrary(e,t,n=``,r=``){let i=new FormData;return i.append(`file`,e,e.name),i.append(`mode`,t),n.trim()&&i.append(`target_name`,n.trim()),r.trim()&&i.append(`new_name`,r.trim()),G(`/universal_gallery/api/library/import`,{method:`POST`,body:i})},async listTrash(e){return(await G(`/universal_gallery/api/trash`,e?{signal:e}:void 0)).items??[]},async restoreTrashItem(e){return G(`/universal_gallery/api/trash/restore`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({id:e})})},async purgeTrashItem(e){return G(`/universal_gallery/api/trash/purge`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({id:e})})},async listGallerySources(e=!1){let t=new URLSearchParams;return e&&t.set(`force_refresh`,`true`),(await G(`/universal_gallery/api/settings/gallery-sources${t.size?`?${t}`:``}`)).sources??[]},async saveGallerySource(e){return G(`/universal_gallery/api/settings/gallery-sources`,{method:e.id?`PATCH`:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})},async deleteGallerySource(e){return G(`/universal_gallery/api/settings/gallery-sources`,{method:`DELETE`,headers:{"Content-Type":`application/json`},body:JSON.stringify({id:e})})},async testGallerySourcePath(e){return G(`/universal_gallery/api/settings/gallery-sources/test-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e})})},async diagnoseGallerySources(){return(await G(`/universal_gallery/api/settings/gallery-sources/diagnostics`)).sources??[]}},Ze=e=>[`queued`,`running`,`cancelling`].includes(e.state),Qe=new Set,$e=new Map,et,tt,nt,rt=0,it=0,at,ot=0,st=()=>{if(window.clearTimeout(et),!Qe.size||document.visibilityState===`hidden`)return Promise.resolve();if(nt)return tt?.signal.aborted?nt.then(()=>st()):nt;let e=it,t=new AbortController;return tt=t,nt=(async()=>{let n=2e3;try{let r=await K.listJobs(t.signal,at);if(t.signal.aborted||e!==it)return;at=r.revision,ot=0,n=at===void 0?2e3:25;let i=new Set(r.jobs.map(e=>e.id)),a=new Map,o=[...$e.values()].filter(e=>Ze(e)&&!i.has(e.id));for(let n=0;n{try{return(await K.getJob(e.id,t.signal)).job}catch(t){return t instanceof Xe&&t.status===404&&($e.delete(e.id),a.set(e.id,t)),null}}));if(t.signal.aborted||e!==it)return;r.jobs.push(...i.filter(e=>e!==null))}for(let e of r.jobs)$e.set(e.id,e);for(let[e,t]of $e)i.has(e)||Ze(t)||o.some(t=>t.id===e)||$e.delete(e);for(let e of[...Qe])e(r.jobs,a)}catch(r){if(!t.signal.aborted&&e===it&&(n=[2e3,1e4,3e4][Math.min(ot++,2)],ot>=3)){let e=new Map([...$e].filter(([,e])=>Ze(e)).map(([e])=>[e,r]));for(let t of[...Qe])t([],e)}}finally{e===it&&(nt=void 0,Qe.size&&document.visibilityState!==`hidden`&&(rt>0||[...$e.values()].some(Ze))&&(et=window.setTimeout(()=>{st()},n)))}})(),nt},q=e=>{rt=Math.max(0,rt+Number(e.detail||0)),st()},ct=()=>{document.visibilityState===`hidden`?(tt?.abort(),window.clearTimeout(et)):st()},lt=e=>(Qe.add(e),Qe.size===1&&(window.addEventListener(Je,q),document.addEventListener(`visibilitychange`,ct),et=window.setTimeout(()=>{st()},500)),()=>{Qe.delete(e),Qe.size||(it++,tt?.abort(),window.clearTimeout(et),nt=void 0,$e.clear(),at=void 0,ot=0,rt=0,window.removeEventListener(Je,q),document.removeEventListener(`visibilitychange`,ct))}),ut=(e,t)=>{if(t.aborted)return Promise.reject(new DOMException(`Aborted`,`AbortError`));if(!Ze(e))return Promise.resolve(e);let n=$e.get(e.id);return n&&!Ze(n)?Promise.resolve(n):new Promise((r,i)=>{let a=lt((t,n)=>{if(n?.has(e.id)){o(),i(n.get(e.id));return}let a=t.find(t=>t.id===e.id);a&&!Ze(a)&&(o(),r(a))}),o=()=>{t.removeEventListener(`abort`,s),a()},s=()=>{o(),i(new DOMException(`Aborted`,`AbortError`))};t.addEventListener(`abort`,s,{once:!0}),(!n||e.updated_at>n.updated_at)&&$e.set(e.id,e),st()})},dt=e=>[`queued`,`running`,`cancelling`].includes(e.state),ft=e=>{let{syncTask:t,notify:r}=qe(),{t:i}=n(),a=(0,p.useRef)(new Map);(0,p.useEffect)(()=>{if(!e||typeof K.listJobs!=`function`||!t)return;let n=async e=>{if(e.kind!==`refresh_index`&&e.kind!==`fingerprint_assets`)return;let t=Object.fromEntries(Object.entries(e.payload).filter(([e])=>!e.startsWith(`_`)));try{await K.createJob(e.kind,t),st()}catch(e){r(e instanceof Error?e.message:i(`jobFailed`),`error`)}};return lt(e=>{let o=new Map;for(let t of e){if(t.kind!==`refresh_index`)continue;let e=String(t.payload.subfolder??``),n=o.get(e);(!n||Number(dt(t))>Number(dt(n))||dt(t)===dt(n)&&(t.created_at>n.created_at||t.created_at===n.created_at&&t.id>n.id))&&o.set(e,t)}for(let s of e){let e=s.kind===`refresh_index`||s.kind===`fingerprint_assets`,c=a.current.get(s.id);if(!e||!dt(s)&&!c&&(s.state!==`failed`||Date.now()/1e3-s.updated_at>86400))continue;let l=`${s.state}:${s.completed}:${s.total}:${s.error}`;if(c===l)continue;a.current.set(s.id,l);let u=String(s.payload.subfolder??``);if(s.kind===`refresh_index`&&o.get(u)?.id!==s.id)continue;let d=i(s.kind===`refresh_index`?`jobRefresh`:`jobFingerprints`),f=dt(s)?`pending`:s.state===`failed`?`error`:s.state===`succeeded`?`success`:`info`;t(s.kind===`refresh_index`?`refresh:${u}`:s.id,`${d} · ${i(dt(s)?`jobRunning`:s.state===`failed`?`jobFailed`:s.state===`cancelled`?`jobCancelled`:`jobCompleted`)}`,f,s.error||`${s.completed} / ${s.total}`,s.state===`failed`?()=>{n(s)}:void 0,{taskKind:s.kind,source:`gallery`,phase:s.state,completed:s.completed,total:s.total,jobId:s.id,quiet:s.kind===`refresh_index`,cancel:dt(s)&&s.state!==`cancelling`?()=>{K.cancelJob(s.id).then(()=>st()).catch(e=>r(e instanceof Error?e.message:i(`jobFailed`),`error`))}:void 0})}})},[e,r,t,i])},pt=e=>{let t=[...new Set(e.paths)];if(t.length)return()=>{(async()=>{await e.confirm(e.confirmation(t.length))&&await e.run(async()=>{let n=await e.execute(t);return window.dispatchEvent(new Event(`universal-gallery:files-changed`)),n},{pending:e.pending,success:n=>e.summary(t,n),successTone:n=>e.failed(t,n).length?`error`:`success`,successDetail:n=>e.failed(t,n).join(`; `),successRetry:n=>pt({...e,paths:e.failed(t,n)})})})().catch(()=>void 0)}},mt=(e=`standard`)=>e===`compact`?{gap:10,chrome:44,bodyHeight:42,padding:3}:{gap:14,chrome:50,bodyHeight:48,padding:6},ht=()=>{let e=(0,p.useRef)(0),t=(0,p.useRef)(null),n=(0,p.useCallback)(()=>{e.current+=1,t.current?.abort()},[]),r=(0,p.useCallback)(()=>{n(),t.current=new AbortController;let r=e.current;return{signal:t.current.signal,isCurrent:()=>r===e.current}},[n]);return(0,p.useEffect)(()=>n,[n]),{begin:r,invalidate:n}},gt=(e,t)=>{let n=new Set(t);return e.filter((e,t,r)=>n.has(e)&&r.indexOf(e)===t)},_t=(e,t)=>e.includes(t)?e.filter(e=>e!==t):[...e,t],vt=({anchorPath:e,targetPath:t,selectedPaths:n,visibleSelectionPaths:r})=>{let i=r.indexOf(e),a=r.indexOf(t);if(i<0||a<0)return _t(n,t);let o=Math.min(i,a),s=Math.max(i,a);return gt([...n,...r.slice(o,s+1)],r)},yt=e=>({left:Math.min(e.startX,e.currentX),right:Math.max(e.startX,e.currentX),top:Math.min(e.startY,e.currentY),bottom:Math.max(e.startY,e.currentY)}),bt=(e,t)=>!(t.righte.right||t.bottome.bottom),xt=(e,t)=>t?{left:e.left,right:e.right,top:e.top-t,bottom:e.bottom-t}:e,St=({selectionBox:e,keys:t,getRect:n,scrollDelta:r=0})=>{let i=yt({...e,startY:e.startY-r});return t.filter(e=>{let t=n(e);return t?bt(i,xt(t,r)):!1})},Ct=({visibleSelectionPaths:e,pageSelectedPaths:t,onSelectionChange:n})=>{let r=(0,p.useRef)(``),i=(0,p.useCallback)(t=>{n(gt(t,e))},[n,e]);return{setSelection:i,handleImageSelectionClick:(n,a)=>{if(a?.shiftKey){let a=r.current||t[t.length-1]||n;i(vt({anchorPath:a,targetPath:n,selectedPaths:t,visibleSelectionPaths:e})),r.current=a}else i(_t(t,n)),r.current=n},selectAllVisible:(0,p.useCallback)(()=>{i(e),r.current=e[0]||``},[i,e]),clearSelection:(0,p.useCallback)(()=>{n([]),r.current=``},[n]),lastSelectedPathRef:r}};function wt(e,t,n=15e3){return new Promise(r=>{if(t.aborted||!e){r(!1);return}let i=new Image;i.decoding=`async`;let a=!1,o=e=>{a||(a=!0,clearTimeout(c),t.removeEventListener(`abort`,s),i.onload=null,i.onerror=null,e||(i.src=``),r(e))},s=()=>o(!1),c=window.setTimeout(()=>o(!1),n);i.onload=async()=>{try{await i.decode?.()}catch{}o(!t.aborted)},i.onerror=()=>o(!1),t.addEventListener(`abort`,s,{once:!0}),i.src=e})}function Tt(){return typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches?`instant`:`smooth`}var Et=e=>{try{return typeof window>`u`?null:window.localStorage.getItem(e)}catch{return null}},Dt=(e,t)=>{try{return typeof window>`u`?!1:(window.localStorage.setItem(e,t),!0)}catch{return!1}},Ot=(0,p.createContext)(null),kt=({children:e})=>{let{t}=n(),[r,i]=(0,p.useState)(null),a=(0,p.useRef)(null),o=(0,p.useRef)(null),s=(0,p.useMemo)(()=>{let e=e=>new Promise(t=>{a.current?.resolve(`cancel`),a.current={...e,resolve:t},i(a.current)});return{choose:e,confirm:async t=>await e(t)===`confirm`}},[]),c=e=>{a.current?.resolve(e),a.current=null,i(null)};return(0,p.useEffect)(()=>()=>{a.current?.resolve(`cancel`),a.current=null},[]),(0,p.useEffect)(()=>{if(!r)return;let e=document.activeElement instanceof HTMLElement?document.activeElement:null,t=document.getElementById(`root`),n=t?.inert??!1;t&&(t.inert=!0),o.current?.querySelector(`.ue-secondary-btn`)?.focus({preventScroll:!0});let s=e=>{if(e.stopPropagation(),e.key===`Escape`&&(e.preventDefault(),a.current?.resolve(`cancel`),a.current=null,i(null)),e.key!==`Tab`)return;let t=o.current?.querySelectorAll(`button:not(:disabled)`);if(!t?.length)return;let n=t[0],r=t[t.length-1];e.shiftKey&&document.activeElement===n?(e.preventDefault(),r.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n.focus())};return document.addEventListener(`keydown`,s,!0),()=>{document.removeEventListener(`keydown`,s,!0),t&&(t.inert=n),e?.isConnected&&!e.closest(`[inert]`)&&e.focus({preventScroll:!0})}},[r]),(0,U.jsxs)(Ot.Provider,{value:s,children:[e,r?(0,h.createPortal)((0,U.jsx)(`div`,{className:`ue-modal-backdrop ue-confirm-backdrop`,onClick:()=>{c(`cancel`)},children:(0,U.jsxs)(`div`,{ref:o,role:`alertdialog`,"aria-modal":`true`,"aria-labelledby":`ue-confirm-title`,"aria-describedby":`ue-confirm-body`,className:`ue-confirm-modal ue-dialog-modal`,onClick:e=>e.stopPropagation(),children:[(0,U.jsx)(`button`,{className:`ue-modal-close ue-modal-close--light`,onClick:()=>{c(`cancel`)},"aria-label":t(`modalClose`),children:(0,U.jsx)(H,{size:18})}),(0,U.jsx)(`div`,{className:`ue-confirm-icon ue-confirm-icon--${r.tone||`info`}`,children:r.tone===`danger`||r.tone===`warning`?(0,U.jsx)(Be,{size:18}):(0,U.jsx)(me,{size:18})}),(0,U.jsxs)(`div`,{className:`ue-pane-copy ue-dialog-heading`,children:[(0,U.jsx)(`h2`,{id:`ue-confirm-title`,children:r.title}),(0,U.jsx)(`p`,{id:`ue-confirm-body`,children:r.message})]}),(0,U.jsxs)(`div`,{className:`ue-library-modal-actions ue-dialog-actions${r.alternativeLabel?` ue-dialog-actions--choice`:``}`,children:[(0,U.jsxs)(`button`,{className:`ue-secondary-btn`,onClick:()=>c(`cancel`),children:[(0,U.jsx)(H,{size:14}),(0,U.jsx)(`span`,{children:r.cancelLabel||t(`libraryCancel`)})]}),r.alternativeLabel?(0,U.jsx)(`button`,{className:`ue-secondary-btn`,onClick:()=>c(`alternative`),children:(0,U.jsx)(`span`,{children:r.alternativeLabel})}):null,(0,U.jsxs)(`button`,{className:`ue-primary-btn ${r.tone===`danger`?`ue-primary-btn--danger`:``}`,disabled:r.confirmDisabled,onClick:()=>c(`confirm`),children:[(0,U.jsx)(k,{size:14}),(0,U.jsx)(`span`,{children:r.confirmLabel||t(`commonConfirm`)})]})]})]})}),document.body):null]})},At=()=>{let e=(0,p.useContext)(Ot);if(!e)throw Error(`useConfirm must be used within ConfirmProvider`);return e},jt=`default_output`,Mt=e=>e.split(/[\\/]+/).filter(Boolean),Nt=/(?:^|[^\d])(\d{4})[-_.](\d{1,2})[-_.](\d{1,2})(?:$|[^\d])/,Pt=new Intl.Collator(void 0,{numeric:!0,sensitivity:`base`}),Ft=`universal-extractor:pinned-folders`,It=`universal-extractor:folder-sort`,Lt=()=>{try{let e=JSON.parse(Et(`universal-extractor:pinned-folders`)||`[]`);return new Set(Array.isArray(e)?e.filter(e=>typeof e==`string`):[])}catch{return new Set}},Rt=()=>Et(`universal-extractor:folder-sort`)===`name`?`name`:`modified`,zt=e=>{let t=e.trim().replace(/\\/g,`/`).replace(/^\/+|\/+$/g,``);if(t.includes(`::`)){let[e,...n]=t.split(`::`);return{sourceId:e||`default_output`,relativePath:n.join(`::`).replace(/^\/+|\/+$/g,``)}}return{sourceId:jt,relativePath:t}},Bt=e=>`${e||`default_output`}::`,Vt=(e,t)=>{let n=t.replace(/\\/g,`/`).replace(/^\/+|\/+$/g,``);return n?`${e||`default_output`}::${n}`:Bt(e)},Ht=e=>{let{relativePath:t}=zt(e);return Mt(t).at(-1)??``},Ut=(e,t)=>{let{sourceId:n,relativePath:r}=zt(e),i=t.replace(/\\/g,`/`).replace(/^\/+|\/+$/g,``);return Vt(n,r?`${r}/${i}`:i)},Wt=e=>zt(e).sourceId,Gt=e=>{let{relativePath:t}=zt(e);return!t},Kt=(e,t)=>zt(e).sourceId===zt(t).sourceId,qt=(e,t)=>{let n=zt(e),r=zt(t);return n.sourceId!==r.sourceId||!r.relativePath?!1:n.relativePath.startsWith(`${r.relativePath}/`)},Jt=e=>{let{sourceId:t,relativePath:n}=zt(e);return t===`default_output`&&n?[e,n]:[e]},Yt=(e,t)=>t.size>0&&Jt(e).some(e=>t.has(e)),Xt=e=>{let t=Ht(e).match(Nt);if(!t)return 0;let n=Number(t[1]),r=Number(t[2]),i=Number(t[3]),a=new Date(n,r-1,i);return a.getFullYear()!==n||a.getMonth()!==r-1||a.getDate()!==i?0:n*1e4+r*100+i},Zt=(e,t,n=new Map)=>{let r=new Map,i=i=>{let a=r.get(i);return a||(a={pinned:Yt(i,e),date:t===`modified`?Xt(i):0,modified:n.get(i)??0},r.set(i,a)),a};return(e,n)=>{let r=i(e),a=i(n);if(r.pinned!==a.pinned)return r.pinned?-1:1;if(t===`modified`){if(r.date&&a.date&&r.date!==a.date)return a.date-r.date;if(r.modified!==a.modified)return a.modified-r.modified}return Pt.compare(e,n)}},Qt=(e,t)=>e?.name||t,$t=(e,t,n,r=``)=>{let{sourceId:i,relativePath:a}=zt(e);if(r&&i===r||i===`default_output`)return a||`./`;let o=n(t.find(e=>e.id===i),i);return a?`${o} / ${a}`:o},en=(e,t)=>[...e].sort((e,n)=>t(e.path,n.path)).map(e=>({...e,children:en(e.children,t)})),tn=(e,t,n,r=[],i=Qt,a=``,o=new Map)=>{let s=[],c=new Map,l=new Map(r.map(e=>[e.id,e]));return e.forEach(e=>{let{sourceId:t,relativePath:n}=zt(e);if(a&&t!==a)return;let r=Mt(n),o=``,u=s;if(!a&&t!==`default_output`){o=Bt(t);let e=c.get(o);e||(e={path:o,name:i(l.get(t),t),children:[]},c.set(o,e),s.push(e)),u=e.children}r.forEach(e=>{let n=o?zt(o).relativePath:``,r=n?`${n}/${e}`:e;o=Vt(t,r);let i=c.get(o);i||(i={path:o,name:e,children:[]},c.set(o,i),u.push(i)),u=i.children})}),en(s,Zt(t,n,o))},nn=e=>{let{sourceId:t,relativePath:n}=zt(e),r=Mt(n),i=t===`default_output`?[]:[Bt(t)];return r.slice(0,-1).map((e,n)=>Vt(t,r.slice(0,n+1).join(`/`))).reduce((e,t)=>[...e,t],i)},rn=(e,t)=>{let n=t.trim().toLowerCase();if(!n)return e;let r=new Set;return e.forEach(e=>{e.toLowerCase().includes(n)&&(nn(e).forEach(e=>r.add(e)),r.add(e))}),e.filter(e=>r.has(e))},an=(e,t)=>e.filter(e=>Wt(e)===t),on=e=>{let t=[],n=e=>{for(let r of e)r.children.length>0&&(t.push(r.path),n(r.children))};return n(e),t},sn=(0,p.createContext)(null),cn=({children:e})=>{let{notify:t}=qe(),n=(0,p.useCallback)((e,n=`info`,r=``)=>{t(e,n,r)},[t]),r=(0,p.useMemo)(()=>({pushToast:n}),[n]);return(0,U.jsx)(sn.Provider,{value:r,children:e})},ln=()=>{let e=(0,p.useContext)(sn);if(!e)throw Error(`useToast must be used within ToastProvider`);return e},un=e=>{let t=Number.isFinite(e)?Math.max(0,e):0;return t<1024?`${t} B`:t<1048576?`${(t/1024).toFixed(0)} KB`:`${(t/1048576).toFixed(2)} MB`},dn=e=>{if(!Number.isFinite(e)||e<=0)return null;let t=new Date(e*1e3);return Number.isNaN(t.getTime())?null:t},fn=(e,t)=>dn(e)?.toLocaleDateString(t)??`--`,pn=(e,t)=>{let n=dn(e);if(!n)return`--`;if(t)return n.toLocaleString(t,{year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`});let r=e=>String(e).padStart(2,`0`);return[`${n.getFullYear()}/${r(n.getMonth()+1)}/${r(n.getDate())}`,`${r(n.getHours())}:${r(n.getMinutes())}:${r(n.getSeconds())}`].join(` `)},mn=(e,t)=>dn(e)?.toLocaleString(t)??`--`,hn=(e,t)=>{let n=new Set(t.updated),r=[...new Set(e)].filter(e=>!n.has(e));return{failedPaths:r,complete:r.length===0}},gn=(e,t)=>{let n=[...new Set(e)],r=new Set(n),i=new Set([...t.missing,...t.blocked??[],...t.unchanged??[]].filter(e=>r.has(e))),a=t.moved.length===n.length-i.size?n.filter(e=>!i.has(e)):[],o=new Set((t.moved_sources??a).filter(e=>r.has(e)&&!i.has(e))),s=n.filter(e=>!o.has(e));return{movedSources:o,failedPaths:s,unaccounted:s.filter(e=>!i.has(e)).length,complete:s.length===0&&t.moved.length===n.length}},_n=(e,t)=>{let n=[...new Set(e)],r=new Set(n),i=new Set(t.deleted.filter(e=>r.has(e))),a=n.filter(e=>!i.has(e)),o=new Set(t.missing);return{deletedPaths:i,failedPaths:a,unaccounted:a.filter(e=>!o.has(e)).length,complete:a.length===0&&t.deleted.length===n.length}},vn=e=>e.join(`; `),yn=e=>typeof e==`string`?e.trim():``,bn=e=>{let t=yn(e?.summary?.positive_prompt);if(t)return t;let n=e?.metadata?.prompt;return typeof n==`string`?n.trim():``},xn=e=>JSON.stringify({summary:e?.summary??null,recipe:e?.recipe??null,artist_prompts:e?.artist_prompts??[],metadata:e?.metadata??null,workflow:e?.workflow??null,state:e?.state??null},null,2),Sn=({open:e,boards:t,selectedCount:r,onClose:i,onCreateBoard:a,onAddToBoard:o})=>{let{t:s}=n(),{confirm:c}=At(),[l,u]=(0,p.useState)(``),[d,f]=(0,p.useState)(``),[m,h]=(0,p.useState)(!1),g=(0,p.useMemo)(()=>t[0]?.id??``,[t]),_=l||g;if(!e)return null;let v=async()=>{if(_||d.trim()){h(!0);try{let e=_;if(d.trim()){if(!await c({title:s(`boardCreateTitle`),message:s(`boardCreateConfirm`,{name:d.trim()}),tone:`warning`,confirmLabel:s(`commonCreate`),cancelLabel:s(`libraryCancel`)}))return;e=(await a(d.trim())).board?.id??``}e&&(await o(e),f(``),u(``),i())}finally{h(!1)}}};return(0,U.jsx)(`div`,{className:`ue-modal-backdrop`,onClick:i,children:(0,U.jsxs)(`div`,{className:`ue-library-modal ue-board-picker-modal`,onClick:e=>e.stopPropagation(),children:[(0,U.jsx)(`button`,{className:`ue-modal-close ue-modal-close--light`,onClick:i,"aria-label":s(`modalClose`),children:(0,U.jsx)(H,{size:18})}),(0,U.jsxs)(`div`,{className:`ue-pane-copy`,children:[(0,U.jsx)(`p`,{className:`ue-pane-kicker`,children:s(`sidebarBoards`)}),(0,U.jsx)(`h2`,{children:s(`boardAddToTitle`)}),(0,U.jsx)(`p`,{children:s(`boardAddToText`,{count:r})})]}),(0,U.jsxs)(`div`,{className:`ue-board-picker-list`,children:[t.map(e=>(0,U.jsxs)(`button`,{className:`ue-board-picker-item ${_===e.id&&!d.trim()?`is-active`:``}`,onClick:()=>{u(e.id),f(``)},children:[(0,U.jsx)(`span`,{className:`ue-board-cover`,children:e.cover_image?(0,U.jsx)(`img`,{src:e.cover_image.thumb_url,alt:``,loading:`lazy`}):(0,U.jsx)(pe,{size:15})}),(0,U.jsx)(`span`,{children:e.name}),(0,U.jsx)(`em`,{children:e.count})]},e.id)),t.length===0?(0,U.jsx)(`p`,{className:`ue-tool-helper`,children:s(`boardEmptyText`)}):null]}),(0,U.jsxs)(`label`,{className:`ue-import-text-field`,children:[(0,U.jsx)(`span`,{children:s(`boardCreateInline`)}),(0,U.jsx)(`input`,{value:d,onChange:e=>f(e.target.value),placeholder:s(`boardNamePlaceholder`)})]}),(0,U.jsxs)(`div`,{className:`ue-library-modal-actions`,children:[(0,U.jsx)(`button`,{className:`ue-icon-action`,onClick:i,"aria-label":s(`libraryCancel`),title:s(`libraryCancel`),children:(0,U.jsx)(H,{size:14})}),(0,U.jsx)(`button`,{className:`ue-icon-action ue-icon-action--filled`,onClick:()=>void v(),disabled:m||!_&&!d.trim(),"aria-label":d.trim()?s(`sidebarCreateBoard`):s(`boardAddToAction`),title:d.trim()?s(`sidebarCreateBoard`):s(`boardAddToAction`),children:d.trim()?(0,U.jsx)(ae,{size:14}):(0,U.jsx)(k,{size:14})})]})]})})},Cn=({open:e,categories:t,selectedCategory:r,onClose:i,onSelect:a})=>{let{t:o}=n(),[s,c]=(0,p.useState)(``),l=(0,p.useMemo)(()=>{let e=s.trim().toLowerCase();return e?t.filter(t=>t.toLowerCase().includes(e)):t},[t,s]);return e?(0,U.jsx)(`div`,{className:`ue-modal-backdrop`,onClick:i,children:(0,U.jsxs)(`div`,{className:`ue-library-modal`,onClick:e=>e.stopPropagation(),children:[(0,U.jsx)(`button`,{className:`ue-modal-close ue-modal-close--light`,onClick:i,"aria-label":o(`modalClose`),children:(0,U.jsx)(H,{size:18})}),(0,U.jsxs)(`div`,{className:`ue-pane-copy`,children:[(0,U.jsx)(`p`,{className:`ue-pane-kicker`,children:o(`galleryAllCategories`)}),(0,U.jsx)(`h2`,{children:o(`galleryCategoryBrowse`)}),(0,U.jsx)(`p`,{children:o(`galleryCategoryBrowseHint`)})]}),(0,U.jsxs)(`label`,{className:`ue-import-text-field`,children:[(0,U.jsx)(`span`,{children:o(`navSearchGalleryPlaceholder`)}),(0,U.jsxs)(`div`,{className:`ue-picker-search`,children:[(0,U.jsx)(Ae,{size:14}),(0,U.jsx)(`input`,{value:s,onChange:e=>c(e.target.value)})]})]}),(0,U.jsxs)(`div`,{className:`ue-category-picker-list`,children:[(0,U.jsx)(`button`,{className:`ue-pill ue-pill--block ${r===``?`active`:``}`,onClick:()=>{a(``),i()},children:o(`galleryAllCategories`)}),l.map(e=>(0,U.jsx)(`button`,{className:`ue-pill ue-pill--block ${r===e?`active`:``}`,onClick:()=>{a(e),i()},children:e},e))]})]})}):null},wn=class{capacity;set=new Set;constructor(e=2500){this.capacity=e}has(e){return this.set.has(e)}add(e){if(this.set.has(e))this.set.delete(e),this.set.add(e);else{if(this.set.size>=this.capacity){let e=this.set.values().next().value;e!==void 0&&this.set.delete(e)}this.set.add(e)}}delete(e){return this.set.delete(e)}clear(){this.set.clear()}get size(){return this.set.size}},Tn=new wn(2500),En=new wn(2500),Dn=new Set,On=[],kn=4,An=80,jn=0,Mn=e=>{let t=e.thumb_url||e.url;return e.asset_id?`${t}${t.includes(`?`)?`&`:`?`}content_version=${encodeURIComponent(`${e.asset_id}:${e.content_revision??1}`)}`:t},Nn=e=>Tn.has(e),Pn=e=>{Tn.add(e)},Fn=()=>{for(;jni(!1),15e3),i=i=>{n||(n=!0,window.clearTimeout(r),t.onload=null,t.onerror=null,i||(t.src=``),i?Tn.add(e):En.delete(e),jn=Math.max(0,jn-1),Fn())};t.onload=()=>{typeof t.decode==`function`?t.decode().then(()=>i(!0),()=>i(!1)):i(!0)},t.onerror=()=>i(!1),t.src=e}},In=e=>{let t=Mn(e);if(!(!t||Tn.has(t)||En.has(t)||Dn.has(t))){if(On.length>=An){let e=On.shift();e&&(Dn.delete(e),En.delete(e))}En.add(t),Dn.add(t),On.push(t),Fn()}},Ln=e=>{let t=Mn(e.image);return(0,U.jsx)(Rn,{...e,imageUrl:t},t)},Rn=({image:e,priority:t=!1,onOpenDetail:r,imageUrl:i})=>{let{t:a}=n(),[o,s]=(0,p.useState)(()=>Nn(i)),[c,l]=(0,p.useState)(!1),[u,d]=(0,p.useState)(0),f=(0,p.useCallback)(()=>{Pn(i),s(!0),l(!1)},[i]),m=(0,p.useCallback)(e=>{e?.complete&&e.naturalWidth>0&&f()},[f]),h=()=>{s(!0),l(!0)},g=e=>{e.stopPropagation(),l(!1),s(!1),d(e=>e+1)},_=u>0?`${i}${i.includes(`?`)?`&`:`?`}_retry=${u}`:i;return(0,U.jsx)(`div`,{className:`ue-gallery-image-shell ${o?`is-loaded`:``} ${c?`has-error`:``}`,children:c?(0,U.jsxs)(`div`,{className:`ue-gallery-image-fallback`,onClick:t=>r(e,t),role:`button`,tabIndex:0,onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.currentTarget.click())},title:e.filename,children:[(0,U.jsx)(`div`,{className:`ue-gallery-image-fallback-icon`,children:(0,U.jsx)(de,{size:22})}),(0,U.jsx)(`span`,{className:`ue-gallery-image-fallback-text`,children:e.filename}),(0,U.jsxs)(`button`,{type:`button`,className:`ue-gallery-image-retry-btn`,onClick:g,title:a(`imageRetry`),"aria-label":a(`imageRetry`),children:[(0,U.jsx)(ke,{size:12}),(0,U.jsx)(`span`,{children:a(`imageRetryShort`)})]})]}):(0,U.jsx)(`img`,{ref:m,src:_,alt:e.title||e.filename,role:`button`,tabIndex:0,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.currentTarget.click())},loading:t?`eager`:`lazy`,decoding:`async`,draggable:!1,onLoad:f,onError:h,onClick:t=>r(e,t)},u)})};function zn(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o;n.key&&n.debug?.call(n)&&(o=Date.now());let s=e();if(!(s.length!==r.length||s.some((e,t)=>r[t]!==e)))return i;r=s;let c;if(n.key&&n.debug?.call(n)&&(c=Date.now()),i=t(...s),n.key&&n.debug?.call(n)){let e=Math.round((Date.now()-o)*100)/100,t=Math.round((Date.now()-c)*100)/100,r=t/16,i=(e,t)=>{for(e=String(e);e.length{r=e},o}function Bn(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var Vn=(e,t)=>Math.abs(e-t)<1.01,Hn=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},Un=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Wn=e=>e,Gn=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let e=t;e<=n;e++)r.push(e);return r},Kn=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(Un(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(Un(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},qn={passive:!0},Jn=typeof window>`u`||`onscrollend`in window,Yn=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=0,a=e.options.useScrollendEvent&&Jn?()=>void 0:Hn(r,()=>{t(i,!1)},e.options.isScrollingResetDelay),o=r=>()=>{let{horizontal:o,isRtl:s}=e.options;i=o?n.scrollLeft*(s&&-1||1):n.scrollTop,a(),t(i,r)},s=o(!0),c=o(!1);n.addEventListener(`scroll`,s,qn);let l=e.options.useScrollendEvent&&Jn;return l&&n.addEventListener(`scrollend`,c,qn),()=>{n.removeEventListener(`scroll`,s),l&&n.removeEventListener(`scrollend`,c)}},Xn=(e,t,n)=>{if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},Zn=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;let o=e+t;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:o,behavior:n})},Qn=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);t.isConnected?this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this)):this.observer.unobserve(t)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([t,n])=>{n===void 0&&delete e[t]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Wn,rangeExtractor:Gn,onChange:()=>{},measureElement:Xn,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,...e}},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=zn(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}this.scrollElement=e,this.targetWindow=this.scrollElement&&`ownerDocument`in this.scrollElement?this.scrollElement.ownerDocument.defaultView:this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{let n=new Map,r=new Map;for(let i=t-1;i>=0;i--){let t=e[i];if(n.has(t.lane))continue;let a=r.get(t.lane);if(a==null||t.end>a.end?r.set(t.lane,t):t.ende.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=zn(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(e,t,n,r,i,a,o)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o}),{key:!1}),this.getMeasurements=zn(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o},s)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let c=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1);let l=this.measurementsCache.slice(0,c),u=Array(a).fill(void 0);for(let e=0;e1){c=a;let e=u[c],r=e===void 0?void 0:l[e];d=r?r.end+this.options.gap:t+n}else{let e=this.options.lanes===1?l[i-1]:this.getFurthestMeasurement(l,i);d=e?e.end+this.options.gap:t+n,c=e?e.lane:i%this.options.lanes,this.options.lanes>1&&f&&this.laneAssignments.set(i,c)}let p=s.get(e),m=typeof p==`number`?p:this.options.estimateSize(i),h=d+m;l[i]={index:i,start:d,size:m,end:h,key:e,lane:c},u[c]=i}return this.measurementsCache=l,l},{key:!1,debug:()=>this.options.debug}),this.calculateRange=zn(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>this.range=e.length>0&&t>0?er({measurements:e,outerSize:t,scrollOffset:n,lanes:r}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=zn(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e),n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{let n=this.measurementsCache[e];if(!n)return;let r=t-(this.itemSizeCache.get(n.key)??n.size);r!==0&&(this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?n.start[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;rthis.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length!==0)return Bn(t[$n(0,t.length-1,e=>Bn(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`){if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t]}if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{let r=this.getOffsetForAlignment(e,t),i=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:`start`,behavior:t,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1)t=e[e.length-1]?.end??0;else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){this.targetWindow?this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}):this.scrollState=null}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&Vn(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.scrollState=null;return}}else this.scrollState.stableFrames=0,n&&(this.scrollState.lastTargetOffset=t,this.scrollState.behavior=`auto`,this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}));this.scheduleScrollReconcile()}},$n=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(ar)t=i-1;else return i}return e>0?e-1:0};function er({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){let i=e.length-1,a=t=>e[t].start;if(e.length<=r)return{startIndex:0,endIndex:i};let o=$n(0,i,a,n),s=o;if(r===1)for(;s1){let a=Array(r).fill(0);for(;se=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(i,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}var tr=typeof document<`u`?p.useLayoutEffect:p.useEffect;function nr({useFlushSync:e=!0,...t}){let n=p.useReducer(()=>({}),{})[1],r={...t,onChange:(r,i)=>{var a;e&&i?(0,h.flushSync)(n):n(),(a=t.onChange)==null||a.call(t,r,i)}},[i]=p.useState(()=>new Qn(r));return i.setOptions(r),tr(()=>i._didMount(),[]),tr(()=>i._willUpdate()),i}function rr(e){return nr({observeElementRect:Kn,observeElementOffset:Yn,scrollToFn:Zn,...e})}var ir=160,J=190,ar=145,or=160,sr=1.36,cr=2,lr=100,ur=e=>{let t=Number(e?.width??0),n=Number(e?.height??0),r=t>0&&n>0?n/t:0;return Number.isFinite(r)&&r>0?r:sr},dr=e=>JSON.stringify([e.relative_path,e.asset_id??``,e.content_revision??0,e.size,e.created_at]),fr=(e,t,n)=>{let r=t<=560?ar:t<=960?J:ir,i=Math.max(1,Math.floor((t+n)/(r+n)));return Math.max(1,Math.min(e,i))},pr=(e,t,n)=>Math.max(or,(e-n*(t-1))/t),mr=(e,t,n=`standard`)=>{let r=ur(t);return Math.round(Math.max(lr,(e-cr)*r)+mt(n).chrome)},hr=({images:e,virtualItems:t,columnWidth:n,gap:r,scrollMargin:i=0})=>t.map(t=>{let a=e[t.index];return a?{image:a,index:t.index,top:t.start-i,left:t.lane*(n+r),width:n,lane:t.lane}:null}).filter(e=>e!==null),gr=({images:e,requestedColumns:t,gridWidth:n,viewportWidth:r,scrollElement:i,gap:a,density:o=`standard`,scrollMargin:s=0})=>{let c=n>0?n:Math.max(320,r-32),l=(0,p.useMemo)(()=>fr(t,c,a),[c,a,t]),u=(0,p.useMemo)(()=>pr(c,l,a),[c,l,a]),d=JSON.stringify(e.map(dr)),f=(0,p.useMemo)(()=>JSON.parse(d),[d]),[m,h]=(0,p.useState)(()=>({keys:f,ratios:e.map(ur)})),g=m.ratios;if(m.keys!==f){let t=new Map(m.keys.map((e,t)=>[e,m.ratios[t]])),n={keys:f,ratios:e.map((e,n)=>t.get(f[n])??ur(e))};h(n),g=n.ratios}let _=(0,p.useCallback)(e=>f[e]??e,[f]),v=(0,p.useCallback)(e=>mr(u,{width:1,height:g[e]},o),[u,o,g]),y=rr({count:e.length,getScrollElement:()=>i,getItemKey:_,estimateSize:v,scrollMargin:s,gap:a,lanes:l,overscan:Math.max(l*3,8),useAnimationFrameWithResizeObserver:!0,laneAssignmentMode:`estimate`}),b=(0,p.useRef)(u),x=(0,p.useRef)(o),S=(0,p.useRef)(null);(0,p.useLayoutEffect)(()=>{if(Math.abs(b.current-u)>.5||x.current!==o){b.current=u,x.current=o;let e=S.current;if(y.measure(),e){let t=f.findIndex(t=>t===e.key);y.getTotalSize();let n=y.measurementsCache[t];n&&y.scrollToOffset(n.start-e.offset,{align:`start`})}}let e=y.scrollOffset??0,t=y.getVirtualItems().find(t=>t.end>=e);S.current=t?{key:t.key,offset:t.start-e}:null});let C=y.getVirtualItems(),w=(0,p.useMemo)(()=>hr({images:e,virtualItems:C,columnWidth:u,gap:a,scrollMargin:s}).map(e=>({...e,height:v(e.index),mediaRatio:g[e.index]})),[u,a,e,C,s,v,g]),T=(0,p.useCallback)(e=>{let t=y.measurementsCache[e];return t?{top:t.start-s,left:t.lane*(u+a),width:u,height:t.size}:null},[y,s,u,a]);return{columnCount:l,columnWidth:u,items:w,totalHeight:y.getTotalSize(),measureElement:y.measureElement,scrollToIndex:y.scrollToIndex,getItemLayout:T}},_r=({selectionEnabled:e,selectionBox:t})=>!e||!t||typeof document>`u`?null:(0,h.createPortal)((0,U.jsx)(`div`,{className:`ue-selection-box`,style:{left:Math.min(t.startX,t.currentX),top:Math.max(60,Math.min(t.startY-(t.scrollDelta??0),t.currentY)),width:Math.abs(t.currentX-t.startX),height:Math.max(0,Math.min(window.innerHeight,Math.max(t.startY-(t.scrollDelta??0),t.currentY))-Math.max(60,Math.min(t.startY-(t.scrollDelta??0),t.currentY)))}}),document.body),vr=({images:e,highlightPath:t,emptyState:r,galleryViewMode:i,selectionMode:a,selectionEnabled:o,selectionBox:s,pageSelectedPaths:c,page:l,totalPages:u,total:d,effectiveColumns:f,masonryLayout:p,gridRef:m,cardRefs:h,isDraggingSelectionRef:g,onOpenDetail:_,onOpenWorkflow:v,onUpdateImageState:y,onBoardPickerPathsChange:b,onImageSelectionClick:x,onOpenContextMenu:S,onSelectAllVisible:C,onPageChange:w,onPageJump:T})=>{let{t:E,locale:D}=n(),O=(e,t)=>{t&&c.length>1?b(c):b([e.relative_path])};return e.length===0?(0,U.jsxs)(`div`,{className:`ue-gallery-state ue-gallery-state--empty`,children:[(0,U.jsx)(fe,{size:44,strokeWidth:1.2}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{children:r?.title||E(`galleryEmptyTitle`)}),(0,U.jsx)(`p`,{children:r?.description||E(`galleryEmptyText`)}),r?.onAction&&r.actionLabel?(0,U.jsx)(`button`,{className:`ue-secondary-action`,type:`button`,onClick:r.onAction,children:r.actionLabel}):null]})]}):(0,U.jsxs)(U.Fragment,{children:[i===`list`?(0,U.jsxs)(`div`,{className:`ue-gallery-selection-surface`,children:[(0,U.jsx)(`div`,{ref:m,className:`ue-gallery-list ue-gallery-list--selectable`,children:e.map((e,n)=>{let r=c.includes(e.relative_path);return(0,U.jsxs)(`article`,{"data-tour-id":n===0?`gallery-card`:void 0,ref:t=>{h.current[e.relative_path]=t},className:`ue-gallery-list-row ${r?`is-selected`:``} ${t===e.relative_path?`is-located`:``}`,onContextMenu:t=>S(t,e),onClick:t=>{a?x(e.relative_path,t):g.current||_(e)},children:[(0,U.jsx)(`button`,{className:`ue-trash-card-check ${r?`active`:``}`,onClick:t=>{t.stopPropagation(),x(e.relative_path,t)},"aria-label":E(r?`galleryDeselectImage`:`gallerySelectImage`),title:E(r?`galleryDeselectImage`:`gallerySelectImage`),children:r?(0,U.jsx)(Fe,{size:14}):(0,U.jsx)(Ie,{size:14})}),(0,U.jsx)(`button`,{className:`ue-gallery-list-thumb`,onClick:t=>{t.stopPropagation(),a?x(e.relative_path,t):_(e)},"aria-label":E(`galleryInspect`),title:E(`galleryInspect`),children:(0,U.jsx)(`img`,{src:Mn(e),alt:e.title||e.filename,loading:`lazy`,decoding:`async`})}),(0,U.jsxs)(`div`,{className:`ue-gallery-list-main`,children:[(0,U.jsxs)(`div`,{className:`ue-gallery-list-heading`,children:[(0,U.jsx)(`h3`,{title:e.title||e.filename,children:e.title||e.filename}),e.category?(0,U.jsx)(`span`,{children:e.category}):null]}),(0,U.jsx)(`p`,{title:e.relative_path,children:e.relative_path}),(0,U.jsxs)(`div`,{className:`ue-gallery-list-meta`,children:[(0,U.jsx)(`span`,{children:pn(e.created_at,D)}),(0,U.jsx)(`span`,{children:un(e.size)}),e.width&&e.height?(0,U.jsx)(`span`,{children:`${e.width} x ${e.height}`}):null,e.pinned?(0,U.jsx)(`span`,{children:E(`galleryPin`)}):null]})]}),(0,U.jsxs)(`div`,{className:`ue-gallery-list-actions`,children:[(0,U.jsx)(`button`,{className:`ue-icon-action`,"data-tour-id":n===0?`gallery-workflow`:void 0,onClick:t=>{t.stopPropagation(),v(e)},"aria-label":E(`modalOpenWorkflow`),title:E(`modalOpenWorkflow`),children:(0,U.jsx)(je,{size:14})}),(0,U.jsx)(`button`,{className:`ue-icon-action`,onClick:t=>{t.stopPropagation(),_(e)},"aria-label":E(`galleryInspect`),title:E(`galleryInspect`),children:(0,U.jsx)(re,{size:14})}),(0,U.jsx)(`button`,{className:`ue-icon-action`,onClick:t=>{t.stopPropagation(),O(e,r)},"aria-label":E(`bulkAddToBoard`),title:E(`bulkAddToBoard`),children:(0,U.jsx)(ae,{size:14})}),(0,U.jsx)(`button`,{className:`ue-icon-action ${e.pinned?`ue-icon-action--accent`:``}`,onClick:t=>{t.stopPropagation(),y(e.relative_path,{pinned:!e.pinned})},"aria-label":e.pinned?E(`galleryUnpin`):E(`galleryPin`),title:e.pinned?E(`galleryUnpin`):E(`galleryPin`),children:(0,U.jsx)(De,{size:14,fill:e.pinned?`currentColor`:`none`})})]})]},e.relative_path)})}),(0,U.jsx)(_r,{selectionEnabled:o,selectionBox:s})]}):(0,U.jsxs)(`div`,{className:`ue-gallery-selection-surface`,children:[(0,U.jsx)(`div`,{ref:m,className:`ue-gallery-grid ue-gallery-grid--virtual`,style:{height:`${p.totalHeight}px`},children:p.items.map(({image:e,index:n,top:r,left:i,width:o,lane:s,height:l,mediaRatio:u})=>{let d=c.includes(e.relative_path),m=Number(e.width??0),b=Number(e.height??0),C=m>0&&b>0?`${m} × ${b}`:``,w={aspectRatio:`1 / ${u??ur(e)}`};return(0,U.jsxs)(`article`,{className:`ue-gallery-card ${d?`is-selected`:``} ${t===e.relative_path?`is-located`:``}`,"data-tour-id":n===0?`gallery-card`:void 0,"data-index":n,"data-lane":s,style:{top:`${r}px`,left:`${i}px`,width:`${o}px`,height:l===void 0?void 0:`${l}px`},onContextMenu:t=>S(t,e),ref:t=>{h.current[e.relative_path]=t,p.measureElement(t)},children:[(0,U.jsxs)(`div`,{className:`ue-gallery-media`,style:w,children:[(0,U.jsx)(Ln,{image:e,priority:n{a?x(e.relative_path,t):g.current||_(e)}}),(0,U.jsxs)(`div`,{className:`ue-gallery-actions ${a?`is-selecting`:``}`,children:[(0,U.jsx)(`button`,{className:`ue-send-btn`,"data-tour-id":n===0?`gallery-workflow`:void 0,onClick:t=>{t.stopPropagation(),v(e)},"aria-label":E(`modalOpenWorkflow`),title:E(`modalOpenWorkflow`),children:(0,U.jsx)(je,{size:13})}),(0,U.jsx)(`button`,{className:`ue-select-btn ${d?`active`:``}`,onClick:t=>{t.stopPropagation(),x(e.relative_path,t)},"aria-label":E(d?`galleryDeselectImage`:`gallerySelectImage`),title:E(d?`galleryDeselectImage`:`gallerySelectImage`),children:d?(0,U.jsx)(Fe,{size:13}):(0,U.jsx)(Ie,{size:13})}),(0,U.jsx)(`button`,{className:`ue-board-btn`,onClick:t=>{t.stopPropagation(),S(t,e)},"aria-label":E(`moreActions`),title:E(`moreActions`),children:(0,U.jsx)(I,{size:13})}),(0,U.jsx)(`button`,{className:`ue-pin-btn ${e.pinned?`active`:``}`,onClick:t=>{t.stopPropagation(),y(e.relative_path,{pinned:!e.pinned})},"aria-label":e.pinned?E(`galleryUnpin`):E(`galleryPin`),title:e.pinned?E(`galleryUnpin`):E(`galleryPin`),children:(0,U.jsx)(De,{size:13,fill:e.pinned?`currentColor`:`none`})})]})]}),(0,U.jsxs)(`button`,{className:`ue-gallery-body`,onClick:t=>{a?x(e.relative_path,t):g.current||_(e)},children:[(0,U.jsx)(`span`,{className:`ue-gallery-title`,title:e.title||e.filename,children:e.title||e.filename}),(0,U.jsxs)(`span`,{className:`ue-gallery-meta`,children:[(0,U.jsx)(`span`,{children:fn(e.created_at,D)}),(0,U.jsx)(`i`,{"aria-hidden":`true`,children:`·`}),(0,U.jsx)(`span`,{children:un(e.size)}),C?(0,U.jsx)(`span`,{className:`ue-gallery-resolution-chip`,children:C}):null,e.category?(0,U.jsx)(`span`,{className:`ue-gallery-category-chip`,title:e.category,children:e.category}):null]})]})]},e.relative_path)})}),(0,U.jsx)(_r,{selectionEnabled:o,selectionBox:s})]}),(0,U.jsxs)(`div`,{className:`ue-pagination`,children:[(0,U.jsxs)(`div`,{className:`ue-pagination-meta`,children:[(0,U.jsx)(`span`,{children:E(`galleryPage`,{page:l,totalPages:u})}),(0,U.jsx)(`i`,{"aria-hidden":`true`,children:`/`}),(0,U.jsxs)(`span`,{children:[d,` `,E(`galleryStatsTotal`)]})]}),(0,U.jsxs)(`div`,{className:`ue-pagination-actions`,children:[a?(0,U.jsx)(`button`,{"aria-label":E(`bulkSelectVisible`),title:E(`bulkSelectVisible`),onClick:C,children:(0,U.jsx)(Fe,{size:14})}):null,(0,U.jsx)(`button`,{disabled:l<=1,onClick:()=>w(l-1),"aria-label":E(`galleryPrevious`),title:E(`galleryPrevious`),children:(0,U.jsx)(te,{size:14})}),(0,U.jsx)(`button`,{disabled:l>=u,onClick:()=>w(l+1),"aria-label":E(`galleryNext`),title:E(`galleryNext`),children:(0,U.jsx)(A,{size:14})}),(0,U.jsxs)(`form`,{className:`ue-pagination-jump`,onSubmit:e=>{e.preventDefault(),T(new FormData(e.currentTarget))},children:[(0,U.jsxs)(`label`,{className:`ue-select-field ue-pagination-jump-field`,children:[(0,U.jsx)(`span`,{children:E(`galleryJumpTo`)}),(0,U.jsx)(`input`,{name:`page`,type:`number`,min:1,max:u,defaultValue:l,"aria-label":E(`galleryJumpTo`)})]}),(0,U.jsx)(`button`,{type:`submit`,"aria-label":E(`galleryJump`),title:E(`galleryJump`),children:(0,U.jsx)(F,{size:14})})]},l)]})]})]})},yr=({label:e,icon:t,children:n,className:r=``,closeOnAction:i=!0,tourId:a})=>{let o=(0,p.useRef)(null);return(0,p.useEffect)(()=>{let e=e=>{let t=o.current;if(t?.open){if(e instanceof KeyboardEvent){if(e.key!==`Escape`)return;t.open=!1,t.querySelector(`summary`)?.focus()}else e.target instanceof Node&&!t.contains(e.target)&&(t.open=!1)}};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,e)}},[]),(0,U.jsxs)(`details`,{ref:o,className:`ue-disclosure-menu ${r}`,children:[(0,U.jsx)(`summary`,{"data-tour-id":a,"aria-label":e,title:e,children:t}),(0,U.jsx)(`div`,{className:`ue-disclosure-panel`,"aria-label":e,onClick:e=>{i&&e.target instanceof Element&&e.target.closest(`button`)&&o.current&&(o.current.open=!1,o.current.querySelector(`summary`)?.focus())},children:n})]})};function br({value:e,open:t,onToggle:r,onClose:i,onChange:a,effectiveColumns:o,isMobile:s=!1,mobilePreset:c=`single`,onMobilePresetChange:l,onListView:u}){let{t:d}=n(),f=(0,p.useRef)(null),m=(0,p.useRef)(null),[h,g]=(0,p.useState)({left:12,top:80}),_=(0,p.useCallback)(()=>{i(),f.current?.focus({preventScroll:!0})},[i]);return C(t,_),(0,p.useEffect)(()=>{if(!t)return;let e=()=>{let e=f.current?.getBoundingClientRect();if(!e)return;let t=m.current?.getBoundingClientRect().height||290,n=Math.min(320,window.innerWidth-24);g({left:Math.max(12,Math.min(e.right-n,window.innerWidth-n-12)),top:e.bottom+8+t{n.disconnect(),window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[t]),(0,U.jsxs)(`div`,{className:`ue-density-control`,children:[(0,U.jsxs)(`button`,{ref:f,className:`ue-density-trigger ${t?`is-open`:``}`,type:`button`,"data-tour-id":`gallery-density`,"aria-expanded":t,"aria-haspopup":`dialog`,"aria-label":d(`densityTitle`),title:d(`densityTitle`),onClick:e=>{e.stopPropagation(),r()},children:[(0,U.jsx)(le,{size:15}),(0,U.jsx)(`span`,{children:d(`densityShort`)})]}),t?(0,U.jsx)(S,{children:(0,U.jsxs)(`div`,{ref:m,role:`dialog`,tabIndex:-1,"aria-label":d(`densityTitle`),className:`ue-density-panel`,style:h,onClick:e=>e.stopPropagation(),onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),_())},children:[(0,U.jsxs)(`header`,{children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:d(`densityTitle`)}),(0,U.jsx)(`p`,{children:d(`densityHint`)})]}),(0,U.jsx)(`button`,{type:`button`,onClick:_,"aria-label":d(`modalClose`),children:(0,U.jsx)(H,{size:16})})]}),s?(0,U.jsxs)(`div`,{className:`ue-density-presets ue-density-presets--mobile`,role:`group`,"aria-label":d(`densityPresets`),children:[[`single`,`double`].map(e=>(0,U.jsxs)(`button`,{type:`button`,"aria-pressed":c===e,onClick:()=>l?.(e),children:[(0,U.jsx)(`span`,{className:`ue-density-preview`,"aria-hidden":`true`,style:{gridTemplateColumns:`repeat(${e===`single`?1:2},1fr)`},children:Array.from({length:e===`single`?2:4},(e,t)=>(0,U.jsx)(`i`,{},t))}),(0,U.jsx)(`strong`,{children:d(e===`single`?`densityMobileSingle`:`densityMobileDouble`)})]},e)),(0,U.jsxs)(`button`,{type:`button`,onClick:u,children:[(0,U.jsxs)(`span`,{className:`ue-density-preview ue-density-preview--list`,"aria-hidden":`true`,children:[(0,U.jsx)(`i`,{}),(0,U.jsx)(`i`,{}),(0,U.jsx)(`i`,{})]}),(0,U.jsx)(`strong`,{children:d(`viewList`)})]})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`ue-density-presets`,role:`group`,"aria-label":d(`densityPresets`),children:[{n:3,key:`densitySpacious`,cells:6},{n:4,key:`densityBalanced`,cells:8},{n:6,key:`densityCompact`,cells:12}].map(({n:t,key:n,cells:r})=>(0,U.jsxs)(`button`,{type:`button`,"aria-pressed":e===t,onClick:()=>a(t),children:[(0,U.jsx)(`span`,{className:`ue-density-preview`,"aria-hidden":`true`,style:{gridTemplateColumns:`repeat(${t},1fr)`},children:Array.from({length:r},(e,t)=>(0,U.jsx)(`i`,{},t))}),(0,U.jsx)(`strong`,{children:d(n)}),(0,U.jsx)(`small`,{children:d(`densityColumns`,{count:t})})]},t))}),(0,U.jsxs)(`div`,{className:`ue-density-adjust`,children:[(0,U.jsx)(`button`,{type:`button`,disabled:e<=3,onClick:()=>a(e-1),"aria-label":d(`densityLarger`),children:(0,U.jsx)(Ce,{size:16})}),(0,U.jsx)(`input`,{type:`range`,min:3,max:8,step:1,value:e,"aria-label":d(`densityColumnsLabel`),"aria-valuetext":d(`densityColumns`,{count:e}),onChange:e=>a(Number(e.target.value))}),(0,U.jsx)(`button`,{type:`button`,disabled:e>=8,onClick:()=>a(e+1),"aria-label":d(`densitySmaller`),children:(0,U.jsx)(V,{size:16})}),(0,U.jsx)(`output`,{"aria-live":`polite`,children:e})]}),(0,U.jsx)(`button`,{className:`ue-density-reset`,type:`button`,disabled:e===6,onClick:()=>a(6),children:d(`densityResetDefault`)})]}),(0,U.jsxs)(`p`,{className:`ue-density-note`,role:`status`,children:[o===void 0?null:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`strong`,{children:d(`densityEffectiveColumns`,{count:o})}),` · `]}),d(`densityResponsiveNote`)]})]})}):null]})}var xr=[{value:`red`,color:`#dc2626`},{value:`orange`,color:`#f97316`},{value:`yellow`,color:`#eab308`},{value:`green`,color:`#16a34a`},{value:`cyan`,color:`#06b6d4`},{value:`blue`,color:`#2563eb`},{value:`purple`,color:`#7c3aed`},{value:`pink`,color:`#ec4899`},{value:`brown`,color:`#92400e`},{value:`black`,color:`#18181b`},{value:`white`,color:`#ffffff`},{value:`gray`,color:`#71717a`},{value:`warm`,color:`linear-gradient(135deg, #dc2626, #f97316, #eab308)`},{value:`cool`,color:`linear-gradient(135deg, #16a34a, #06b6d4, #2563eb)`},{value:`low_saturation`,color:`linear-gradient(135deg, #d4d4d8, #71717a)`}],Sr=[{value:`created_at`,labelKey:`gallerySortNewest`,hintKey:`gallerySortNewestHint`},{value:`filename`,labelKey:`gallerySortName`,hintKey:`gallerySortNameHint`},{value:`size`,labelKey:`gallerySortSize`,hintKey:`gallerySortSizeHint`}],Cr=[{value:`desc`,labelKey:`gallerySortDesc`,hintKey:`gallerySortDescHint`},{value:`asc`,labelKey:`gallerySortAsc`,hintKey:`gallerySortAscHint`}],wr=(e,t)=>{let n=Et(e);return n===`grid`||n===`list`?n:t},Tr=({selectedCategory:e,dateFrom:t,dateTo:n,favoritesOnly:r,selectedColorFamily:i,sortBy:a,sortOrder:o})=>[e,t,n,r,i].filter(Boolean).length+ +(a!==`created_at`||o!==`desc`),Er=(e,t)=>e===`low_saturation`?t.includes(` `)?t.split(` `)[0]:t:t.endsWith(`色`)&&t.length<=3?t.slice(0,-1):t,Dr=({total:e,activeFilterControlCount:t,categories:r,selectedCategory:i,dateFrom:a,dateTo:o,favoritesOnly:s,selectedColorFamily:c,colorIndexStatus:l,sortBy:u,sortOrder:d,onClose:f,onOpenCategoryPicker:m,onCategoryChange:h,onDateFromChange:g,onDateToChange:_,onFavoritesOnlyChange:v,onColorFamilyChange:y,onSortByChange:b,onSortOrderChange:x,onPageChange:S})=>{let{t:C}=n(),w=(0,p.useRef)(null),T=(0,p.useRef)(null);(0,p.useEffect)(()=>{T.current=document.activeElement instanceof HTMLElement?document.activeElement:null,w.current?.focus({preventScroll:!0})},[]);let E=()=>{f(),T.current?.focus({preventScroll:!0})},O=xr.find(e=>e.value===c),ee=Sr.find(e=>e.value===u)??Sr[0],te=Cr.find(e=>e.value===d)??Cr[0],A=r.slice(0,8),j=e=>C(`colorFamily_${e}`),M=e=>Er(e,j(e)),ne=()=>{h(``),g(``),_(``),v(!1),y(``),S(1)},N=[i?{key:`category`,label:i,onClear:()=>{h(``),S(1)}}:null,O?{key:`color`,label:j(O.value),color:O.color,onClear:()=>{y(``),S(1)}}:null,a?{key:`dateFrom`,label:`${C(`galleryDateFrom`)} ${a}`,onClear:()=>{g(``),S(1)}}:null,o?{key:`dateTo`,label:`${C(`galleryDateTo`)} ${o}`,onClear:()=>{_(``),S(1)}}:null,s?{key:`favorites`,label:C(`galleryPinnedOnly`),onClear:()=>{v(!1),S(1)}}:null].filter(Boolean);return(0,U.jsxs)(`div`,{ref:w,role:`dialog`,"aria-label":C(`galleryFilters`),tabIndex:-1,onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),E())},className:`ue-filter-menu`,onClick:e=>e.stopPropagation(),children:[(0,U.jsxs)(`div`,{className:`ue-filter-menu-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{children:C(`galleryFilters`)}),(0,U.jsxs)(`strong`,{children:[C(`galleryFilterResult`,{count:e}),` · `,C(`galleryFiltersRealtime`)]})]}),(0,U.jsx)(`div`,{className:`ue-filter-menu-head-actions`,children:t?(0,U.jsxs)(`button`,{className:`ue-filter-reset-btn`,onClick:ne,"aria-label":C(`filterReset`),title:C(`filterReset`),type:`button`,children:[(0,U.jsx)(D,{size:13}),(0,U.jsx)(`span`,{children:C(`filterReset`)})]}):null})]}),(0,U.jsxs)(`div`,{className:`ue-filter-menu-body`,children:[(0,U.jsx)(`p`,{className:`ue-qol-note`,children:C(`qolFilterHint`)}),u!==`created_at`||d!==`desc`?(0,U.jsx)(`button`,{type:`button`,className:`ue-filter-link`,onClick:()=>{b(`created_at`),x(`desc`),S(1)},children:C(`qolResetSort`)}):null,(0,U.jsxs)(`section`,{className:`ue-filter-section ue-filter-section--summary`,children:[(0,U.jsx)(`div`,{className:`ue-filter-section-head`,children:(0,U.jsx)(`span`,{children:C(`galleryActiveFilters`)})}),(0,U.jsx)(`div`,{className:`ue-active-filter-row`,children:N.length?N.map(e=>(0,U.jsxs)(`button`,{className:`ue-active-filter-chip`,onClick:e.onClear,type:`button`,title:`${e.label} · ${C(`filterReset`)}`,children:[e.color?(0,U.jsx)(`span`,{className:`ue-active-filter-dot`,style:{background:e.color}}):null,(0,U.jsx)(`span`,{children:e.label}),(0,U.jsx)(`span`,{"aria-hidden":`true`,children:`×`})]},e.key)):(0,U.jsx)(`span`,{className:`ue-active-filter-empty`,children:C(`galleryFilterNone`)})})]}),(0,U.jsxs)(`section`,{className:`ue-filter-section`,children:[(0,U.jsxs)(`div`,{className:`ue-filter-section-head`,children:[(0,U.jsx)(`span`,{children:C(`galleryCategory`)}),r.length>8?(0,U.jsx)(`button`,{className:`ue-filter-link`,onClick:m,type:`button`,children:C(`galleryMoreCategories`)}):null]}),(0,U.jsxs)(`div`,{className:`ue-filter-chip-grid`,children:[(0,U.jsx)(`button`,{className:`ue-filter-chip ${i===``?`active`:``}`,onClick:()=>{h(``),S(1)},type:`button`,children:C(`galleryAllCategories`)}),A.map(e=>(0,U.jsx)(`button`,{className:`ue-filter-chip ${i===e?`active`:``}`,onClick:()=>{h(e),S(1)},type:`button`,children:e},e))]})]}),(0,U.jsxs)(`section`,{className:`ue-filter-section`,children:[(0,U.jsx)(`div`,{className:`ue-filter-section-head`,children:(0,U.jsx)(`span`,{children:C(`gallerySort`)})}),(0,U.jsxs)(`div`,{className:`ue-filter-sort-row`,children:[(0,U.jsx)(`div`,{className:`ue-sort-segment`,role:`group`,"aria-label":C(`gallerySort`),children:Sr.map(e=>(0,U.jsx)(`button`,{className:u===e.value?`active`:``,onClick:()=>{b(e.value),S(1)},type:`button`,title:C(e.hintKey),children:C(e.labelKey)},e.value))}),(0,U.jsx)(`div`,{className:`ue-sort-direction`,children:Cr.map(e=>(0,U.jsxs)(`button`,{className:d===e.value?`active`:``,onClick:()=>{x(e.value),S(1)},type:`button`,children:[(0,U.jsx)(`strong`,{children:C(e.labelKey)}),(0,U.jsx)(`span`,{children:C(e.hintKey)})]},e.value))})]}),(0,U.jsxs)(`p`,{className:`ue-sort-current`,children:[C(ee.hintKey),` · `,C(te.hintKey)]})]}),(0,U.jsxs)(`section`,{className:`ue-filter-section`,children:[(0,U.jsxs)(`div`,{className:`ue-filter-section-head ue-filter-section-head--inline`,children:[(0,U.jsx)(`span`,{children:C(`galleryColorFamily`)}),(0,U.jsx)(`em`,{children:C(`galleryColorThreshold`)})]}),(0,U.jsxs)(`div`,{className:`ue-color-palette-grid`,children:[(0,U.jsxs)(`button`,{className:`ue-color-palette ${c===``?`active`:``}`,onClick:()=>{y(``),S(1)},type:`button`,children:[(0,U.jsx)(`span`,{className:`ue-color-palette-swatch ue-color-swatch--all`}),(0,U.jsx)(`em`,{children:C(`galleryAllColors`).replace(/色系$/,``).replace(/ colors$/i,``)})]}),xr.map(e=>(0,U.jsxs)(`button`,{className:`ue-color-palette ${c===e.value?`active`:``}`,onClick:()=>{y(e.value),S(1)},type:`button`,title:j(e.value),children:[(0,U.jsx)(`span`,{className:`ue-color-palette-swatch`,style:{background:e.color}}),(0,U.jsx)(`em`,{children:M(e.value)})]},e.value))]}),l&&!l.complete?(0,U.jsxs)(`p`,{className:`ue-color-index-note`,children:[C(`galleryColorIndexing`),` `,l.indexed,`/`,l.total]}):null]}),(0,U.jsxs)(`section`,{className:`ue-filter-section`,children:[(0,U.jsx)(`div`,{className:`ue-filter-section-head`,children:(0,U.jsx)(`span`,{children:C(`galleryDateRange`)})}),(0,U.jsxs)(`div`,{className:`ue-filter-menu-grid ue-filter-menu-grid--date`,children:[(0,U.jsxs)(`label`,{className:`ue-select-field ue-select-field--input ue-date-filter-field`,children:[(0,U.jsx)(`span`,{children:C(`galleryDateFrom`)}),(0,U.jsx)(`input`,{type:`date`,value:a,max:o||void 0,onChange:e=>{g(e.target.value),S(1)}})]}),(0,U.jsxs)(`label`,{className:`ue-select-field ue-select-field--input ue-date-filter-field`,children:[(0,U.jsx)(`span`,{children:C(`galleryDateTo`)}),(0,U.jsx)(`input`,{type:`date`,value:o,min:a||void 0,onChange:e=>{_(e.target.value),S(1)}})]}),(0,U.jsxs)(`button`,{className:`ue-filter-option ${s?`active`:``}`,onClick:()=>{v(!s),S(1)},type:`button`,children:[(0,U.jsx)(De,{size:14,fill:s?`currentColor`:`none`}),(0,U.jsx)(`span`,{children:C(`galleryPinnedOnly`)}),(0,U.jsx)(k,{size:14})]})]})]})]}),(0,U.jsxs)(`div`,{className:`ue-filter-menu-foot`,children:[(0,U.jsx)(`span`,{children:C(`galleryFilterStickyHint`)}),(0,U.jsx)(`button`,{type:`button`,onClick:E,children:C(`galleryFilterClose`)})]})]})},Or=({isTrashView:e,selectedBoard:t,selectedSubfolder:r,total:i,trashCount:a,favoritesOnly:o,isRefreshing:s,hasPendingLiveRefresh:c,activeFilterControlCount:l,showFiltersMenu:u,showColumnsMenu:d,galleryViewMode:f,gridColumns:m,effectiveColumns:h,isMobile:g=!1,mobileDensity:_=`single`,onMobileDensityChange:y,dualFolderMode:b,variantMode:x=!1,selectionMode:S,writableSources:C,sources:w,importSubfolder:T,activeImportSourceId:E,categories:D,selectedCategory:k,dateFrom:ee,dateTo:te,selectedColorFamily:A,colorIndexStatus:j,sortBy:M,sortOrder:ne,searchValue:N=``,onSearchChange:P,onImageSearch:F,onApplyPendingLiveRefresh:L,onToggleFiltersMenu:re,onCloseFiltersMenu:R,onToggleColumnsMenu:z,onCloseColumnsMenu:ie,onOpenCategoryPicker:ae,onGalleryViewModeChange:se,onGridColumnsChange:ce,onDualFolderModeChange:le,onVariantModeChange:ue,onSelectionModeChange:de,onImportTargetSourceIdChange:fe,onShareBoard:pe,onDeleteBoard:me,onClearSelection:he,onCategoryChange:_e,onDateFromChange:ve,onDateToChange:ye,onFavoritesOnlyChange:xe,onColorFamilyChange:Se,onSortByChange:Ce,onSortOrderChange:we,onPageChange:Te,onFolderNavigate:Ee})=>{let{t:V}=n(),Oe=(0,p.useRef)(null),je=(0,p.useRef)(!1),[Me,Ie]=(0,p.useState)(N);(0,p.useEffect)(()=>{je.current||Ie(N)},[N]);let ze=e?a:i,{sourceId:Be,relativePath:Ve}=zt(r),He=w.find(e=>e.id===Be)?.name||(Be===`default_output`?V(`galleryOutputFolder`):Be),W=Ve?`${He} / ${Ve}`:He;(0,p.useEffect)(()=>{let e=e=>{document.querySelector(`[aria-modal="true"]`)||((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`k`||e.key===`/`&&!v(e.target))&&(e.preventDefault(),Oe.current?.focus())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let Ue=!!(N.trim()||k||A||ee||te||o),We=()=>{P?.(``),_e(``),Se(``),ve(``),ye(``),xe(!1),Te(1)},Ge=(0,U.jsxs)(`div`,{className:`ue-segmented-control ue-segmented-control--compact ue-view-toggle`,"aria-label":V(`viewMode`),children:[(0,U.jsxs)(`button`,{className:f===`grid`?`active`:``,onClick:()=>se(`grid`),"aria-pressed":f===`grid`,type:`button`,"aria-label":V(`viewGrid`),title:V(`viewGrid`),children:[(0,U.jsx)(ge,{size:13}),(0,U.jsx)(`span`,{children:V(`viewGrid`)})]}),(0,U.jsxs)(`button`,{className:f===`list`?`active`:``,onClick:()=>se(`list`),"aria-pressed":f===`list`,type:`button`,"aria-label":V(`viewList`),title:V(`viewList`),children:[(0,U.jsx)(be,{size:13}),(0,U.jsx)(`span`,{children:V(`viewList`)})]})]});return(0,U.jsxs)(`div`,{className:`ue-filter-bar ue-filter-bar--gallery ${b?`is-organizer`:x?`is-variants`:``}`,"data-tour-id":`gallery-toolbar`,children:[(0,U.jsxs)(`div`,{className:`ue-filter-copy`,children:[(0,U.jsx)(`p`,{className:`ue-filter-kicker`,children:e?V(`trashTitle`):b?V(`dual_title`):t?t.name:o?V(`galleryPinnedOnly`):W}),!e&&Ve&&Ee&&(0,U.jsxs)(`nav`,{className:`ue-gallery-breadcrumbs`,"aria-label":V(`galleryFolderPath`),children:[(0,U.jsx)(`button`,{onClick:()=>Ee(`${Be}::`),children:He}),Ve.split(`/`).filter(Boolean).map((e,t,n)=>(0,U.jsxs)(`span`,{children:[` / `,(0,U.jsx)(`button`,{title:e,onClick:()=>Ee(`${Be}::${n.slice(0,t+1).join(`/`)}`),children:e})]},t))]}),(0,U.jsxs)(`div`,{className:`ue-filter-summary`,children:[(0,U.jsx)(`strong`,{children:ze}),(0,U.jsx)(`span`,{children:V(e?`trashItemCount`:`galleryFilterResult`,{count:ze})}),o?(0,U.jsx)(`em`,{children:V(`galleryPinnedOnly`)}):null,t?(0,U.jsx)(`em`,{children:V(`sidebarBoards`)}):null,s?(0,U.jsx)(`em`,{children:V(`commonLoading`)}):null,c&&!e?(0,U.jsxs)(`button`,{className:`ue-live-refresh-pill`,type:`button`,onClick:L,title:V(`galleryLiveRefreshAction`),children:[(0,U.jsx)(ke,{size:12}),(0,U.jsx)(`span`,{children:V(`galleryLiveRefreshPending`)})]}):null]})]}),e?(0,U.jsx)(`div`,{className:`ue-filter-controls ue-filter-controls--gallery`,children:Ge}):(0,U.jsxs)(U.Fragment,{children:[P?(0,U.jsxs)(`div`,{className:`ue-gallery-search-box`,"data-tour-id":`gallery-search`,children:[(0,U.jsx)(Ae,{size:14,className:`ue-gallery-search-icon`}),(0,U.jsx)(`input`,{ref:Oe,className:`ue-gallery-search-input`,value:Me,onCompositionStart:()=>{je.current=!0},onCompositionEnd:e=>{je.current=!1,Ie(e.currentTarget.value),P(e.currentTarget.value)},onChange:e=>{Ie(e.target.value),!je.current&&!e.nativeEvent.isComposing&&P(e.target.value)},placeholder:V(`navSearchGalleryPlaceholder`),"aria-label":V(`navSearchGalleryPlaceholder`)}),N?(0,U.jsx)(`button`,{className:`ue-gallery-search-clear`,onClick:()=>{Ie(``),P(``)},type:`button`,"aria-label":V(`sidebarClearFolderSearch`),children:(0,U.jsx)(H,{size:12})}):(0,U.jsx)(`span`,{className:`ue-gallery-search-shortcut`,children:`/`})]}):null,F?(0,U.jsxs)(`button`,{type:`button`,className:`ue-filter-trigger`,onClick:e=>{e.stopPropagation(),F()},title:V(`imageSearchPaste`),children:[(0,U.jsx)(oe,{size:15}),(0,U.jsx)(`span`,{children:V(`imageSearchTitle`)})]}):null,(0,U.jsxs)(`div`,{className:`ue-filter-controls ue-filter-controls--gallery`,children:[(0,U.jsxs)(`div`,{className:`ue-toolbar-group ue-toolbar-group--browse`,children:[(0,U.jsxs)(`div`,{className:`ue-filter-popover`,children:[(0,U.jsxs)(`button`,{className:`ue-filter-trigger ${u?`is-open`:``} ${l?`active`:``}`,"data-tour-id":`gallery-filters`,onClick:e=>{e.stopPropagation(),re()},type:`button`,"aria-expanded":u,"aria-label":V(`galleryFilters`),title:V(`galleryFilters`),children:[(0,U.jsx)(Pe,{size:14}),(0,U.jsx)(`span`,{children:V(`galleryFilters`)}),l?(0,U.jsx)(`strong`,{children:l}):null]}),u?(0,U.jsx)(Dr,{total:i,activeFilterControlCount:l,categories:D,selectedCategory:k,dateFrom:ee,dateTo:te,favoritesOnly:o,selectedColorFamily:A,colorIndexStatus:j,sortBy:M,sortOrder:ne,onClose:R,onOpenCategoryPicker:ae,onCategoryChange:_e,onDateFromChange:ve,onDateToChange:ye,onFavoritesOnlyChange:xe,onColorFamilyChange:Se,onSortByChange:Ce,onSortOrderChange:we,onPageChange:Te}):null]}),Ge,f===`grid`?(0,U.jsx)(br,{value:m,effectiveColumns:h,isMobile:g,mobilePreset:_,onMobilePresetChange:y,onListView:()=>{se(`list`),ie()},open:d,onToggle:z,onClose:ie,onChange:ce}):null]}),(0,U.jsxs)(`button`,{className:`ue-chip-toggle ue-chip-toggle--icon ${S?`active`:``}`,"data-tour-id":`gallery-selection`,"aria-pressed":S,title:V(`bulkSelectionHint`),"aria-label":V(`bulkSelectMode`),onClick:()=>{de(!S),he()},type:`button`,children:[(0,U.jsx)(Fe,{size:15}),(0,U.jsx)(`span`,{children:V(`bulkSelectMode`)})]}),(0,U.jsxs)(`label`,{className:`ue-select-field ue-select-field--compact ue-gallery-mode-control`,children:[(0,U.jsx)(`span`,{children:V(`galleryMode`)}),(0,U.jsxs)(`select`,{"aria-label":V(`galleryMode`),value:b?`organize`:x?`variants`:`browse`,onChange:e=>{le(e.target.value===`organize`),ue?.(e.target.value===`variants`),he()},children:[(0,U.jsx)(`option`,{value:`browse`,children:V(`galleryModeBrowse`)}),(0,U.jsx)(`option`,{value:`organize`,children:V(`organizeFolders`)}),(0,U.jsx)(`option`,{value:`variants`,children:V(`variantToolbar`)})]})]}),(0,U.jsxs)(yr,{label:V(`moreActions`),icon:(0,U.jsx)(I,{size:18}),className:`ue-toolbar-more`,children:[(0,U.jsx)(`div`,{className:`ue-toolbar-group ue-toolbar-group--state`,children:t?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`button`,{className:`ue-chip-toggle ue-chip-toggle--icon`,onClick:()=>pe(t.id),"aria-label":V(`boardShareTitle`),title:V(`boardShareTitle`),type:`button`,children:[(0,U.jsx)(Ne,{size:15}),(0,U.jsx)(`span`,{children:V(`boardShareTitle`)})]}),(0,U.jsxs)(`button`,{className:`ue-chip-toggle ue-chip-toggle--icon`,onClick:me,"aria-label":V(`boardDeleteTitle`),title:V(`boardDeleteTitle`),type:`button`,children:[(0,U.jsx)(Re,{size:15}),(0,U.jsx)(`span`,{children:V(`boardDeleteTitle`)})]})]}):null}),C.length>0?(0,U.jsx)(`div`,{className:`ue-toolbar-group ue-toolbar-group--source`,children:(0,U.jsx)(`label`,{className:`ue-select-field ue-select-field--compact`,title:V(`galleryImportTarget`),children:(0,U.jsx)(`select`,{value:E,onChange:e=>fe(e.target.value),"aria-label":V(`galleryImportTarget`),children:C.map(e=>(0,U.jsxs)(`option`,{value:e.id,children:[e.name,` / `,T,`/`]},e.id))})})}):null]})]}),Ue?(0,U.jsxs)(`div`,{className:`ue-active-filters-row`,children:[N?(0,U.jsxs)(`div`,{className:`ue-filter-active-chip`,children:[(0,U.jsx)(Ae,{size:11}),(0,U.jsxs)(`span`,{children:[`"`,N,`"`]}),(0,U.jsx)(`button`,{onClick:()=>P?.(``),type:`button`,"aria-label":V(`clearSearch`),children:(0,U.jsx)(H,{size:10})})]}):null,k?(0,U.jsxs)(`div`,{className:`ue-filter-active-chip`,children:[(0,U.jsx)(Le,{size:11}),(0,U.jsx)(`span`,{children:k}),(0,U.jsx)(`button`,{onClick:()=>_e(``),type:`button`,"aria-label":V(`clearCategory`),children:(0,U.jsx)(H,{size:10})})]}):null,A?(0,U.jsxs)(`div`,{className:`ue-filter-active-chip`,children:[(0,U.jsx)(B,{size:11}),(0,U.jsx)(`span`,{children:A}),(0,U.jsx)(`button`,{onClick:()=>Se(``),type:`button`,"aria-label":V(`clearColor`),children:(0,U.jsx)(H,{size:10})})]}):null,ee||te?(0,U.jsxs)(`div`,{className:`ue-filter-active-chip`,children:[(0,U.jsx)(O,{size:11}),(0,U.jsxs)(`span`,{children:[ee||`...`,` ~ `,te||`...`]}),(0,U.jsx)(`button`,{onClick:()=>{ve(``),ye(``)},type:`button`,"aria-label":V(`clearDate`),children:(0,U.jsx)(H,{size:10})})]}):null,o?(0,U.jsxs)(`div`,{className:`ue-filter-active-chip`,children:[(0,U.jsx)(De,{size:11}),(0,U.jsx)(`span`,{children:V(`galleryPinnedOnly`)}),(0,U.jsx)(`button`,{onClick:()=>xe(!1),type:`button`,"aria-label":V(`clearPinned`),children:(0,U.jsx)(H,{size:10})})]}):null,(0,U.jsx)(`button`,{className:`ue-filter-clear-all-btn`,onClick:We,type:`button`,children:V(`filterReset`)})]}):null]})]})},kr=({busy:e=!1,trashItems:t,selectedCount:r,selectedTrashCount:i,hasSelection:a,pageSelectedPaths:o,galleryViewMode:s,selectionEnabled:c,selectionBox:l,isDraggingSelectionRef:u,cardRefs:d,gridRef:f,onSelectAllVisible:p,onClearSelection:m,onRestoreSelectedTrash:h,onPurgeSelectedTrash:g,onRestoreTrashItem:_,onPurgeTrashItem:v,onTrashContextMenu:y,onImageSelectionClick:b,onSelectionPointerDown:x,onSelectionPointerMove:S,onSelectionPointerEnd:C})=>{let{t:w,locale:T}=n();return t.length===0?(0,U.jsxs)(`div`,{className:`ue-gallery-state ue-gallery-state--empty`,children:[(0,U.jsx)(Re,{size:44,strokeWidth:1.2}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{children:w(`trashEmptyTitle`)}),(0,U.jsx)(`p`,{children:w(`trashEmptyText`)})]})]}):(0,U.jsxs)(`div`,{className:`ue-trash-workspace`,children:[(0,U.jsxs)(`div`,{className:`ue-trash-toolbar`,children:[(0,U.jsxs)(`div`,{className:`ue-trash-toolbar-copy`,children:[(0,U.jsx)(`strong`,{children:w(`bulkSelected`,{count:r})}),(0,U.jsx)(`span`,{children:w(`trashSelectionHint`)})]}),(0,U.jsxs)(`div`,{className:`ue-trash-toolbar-actions`,children:[(0,U.jsxs)(`button`,{className:`ue-secondary-btn`,onClick:p,children:[(0,U.jsx)(Fe,{size:14}),(0,U.jsx)(`span`,{children:w(`trashSelectAll`)})]}),(0,U.jsxs)(`button`,{className:`ue-secondary-btn`,onClick:m,disabled:!a,children:[(0,U.jsx)(Ie,{size:14}),(0,U.jsx)(`span`,{children:w(`trashClearSelection`)})]}),(0,U.jsxs)(`button`,{className:`ue-secondary-btn ue-secondary-btn--accent`,onClick:h,disabled:e||!i,children:[(0,U.jsx)(ke,{size:14}),(0,U.jsx)(`span`,{children:w(`trashRestoreSelected`)})]}),(0,U.jsxs)(`button`,{className:`ue-secondary-btn ue-secondary-btn--danger`,onClick:g,disabled:e||!i,children:[(0,U.jsx)(Re,{size:14}),(0,U.jsx)(`span`,{children:w(`trashDeleteSelectedForever`)})]})]})]}),(0,U.jsxs)(`div`,{ref:f,className:`ue-trash-list ue-trash-list--selectable ${s===`grid`?`ue-trash-list--grid`:``}`,onPointerDown:x,onPointerMove:S,onPointerUp:C,onPointerCancel:C,children:[t.map(t=>{let n=o.includes(t.id),r=t.kind===`folder`?w(`trashKindFolder`):t.kind===`library`?w(`trashKindLibrary`):w(`trashKindImage`);return(0,U.jsxs)(`article`,{ref:e=>{d.current[t.id]=e},className:`ue-trash-card ${n?`is-selected`:``}`,onContextMenu:e=>y(e,t),onClick:e=>{u.current||b(t.id,e)},children:[(0,U.jsx)(`button`,{className:`ue-trash-card-check ${n?`active`:``}`,onClick:e=>{e.stopPropagation(),b(t.id,e)},"aria-label":w(n?`galleryDeselectImage`:`gallerySelectImage`),title:w(n?`galleryDeselectImage`:`gallerySelectImage`),children:n?(0,U.jsx)(Fe,{size:14}):(0,U.jsx)(Ie,{size:14})}),(0,U.jsxs)(`div`,{className:`ue-trash-card-main`,children:[t.kind===`image`&&t.thumb_url?(0,U.jsx)(`img`,{src:t.thumb_url,alt:t.name}):(0,U.jsx)(`div`,{className:`ue-trash-card-icon`,children:t.kind===`folder`?(0,U.jsx)(ce,{size:22}):(0,U.jsx)(Re,{size:22})}),(0,U.jsxs)(`div`,{className:`ue-trash-card-copy`,children:[(0,U.jsxs)(`div`,{className:`ue-trash-card-title-row`,children:[(0,U.jsx)(`h4`,{children:t.name}),(0,U.jsx)(`span`,{children:r})]}),(0,U.jsx)(`p`,{title:t.original_path,children:t.original_path}),(0,U.jsxs)(`div`,{className:`ue-trash-card-meta`,children:[(0,U.jsx)(`span`,{children:fn(t.deleted_at,T)}),t.image_count?(0,U.jsx)(`span`,{children:w(`trashImageCount`,{count:t.image_count})}):null]})]})]}),(0,U.jsxs)(`div`,{className:`ue-trash-card-actions`,children:[(0,U.jsx)(`button`,{className:`ue-icon-action`,disabled:e,onClick:e=>{e.stopPropagation(),_(t.id)},"aria-label":w(`trashRestore`),title:w(`trashRestore`),children:(0,U.jsx)(ke,{size:14})}),(0,U.jsx)(`button`,{className:`ue-icon-action ue-icon-action--danger`,disabled:e,onClick:e=>{e.stopPropagation(),v(t.id)},"aria-label":w(`trashDeleteForever`),title:w(`trashDeleteForever`),children:(0,U.jsx)(Re,{size:14})})]})]},t.id)}),c&&l?(0,U.jsx)(`div`,{className:`ue-selection-box`,style:{left:Math.min(l.startX,l.currentX),top:Math.min(l.startY,l.currentY),width:Math.abs(l.currentX-l.startX),height:Math.abs(l.currentY-l.startY)}}):null]})]})},Ar=(function(){let e=typeof document<`u`&&document.createElement(`link`).relList;return e&&e.supports&&e.supports(`modulepreload`)?`modulepreload`:`preload`})(),jr=function(e){return`/gallery/`+e},Mr={},Nr=function(e){return e.pathname.endsWith(`.css`)},Pr=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},Fr=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=jr(t,n);let r=s(t),i=Nr(r);return Pr(Mr,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:Ar,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Ir=(0,p.lazy)(()=>Fr(()=>import(`./DualFolderWorkspace-D8G_E4xN.js`).then(e=>({default:e.DualFolderWorkspace})),[])),Lr=(0,p.lazy)(()=>Fr(()=>import(`./VariantGroupsView-BT_Lf8GR.js`).then(e=>({default:e.VariantGroupsView})),[])),Rr=(0,p.lazy)(()=>Fr(()=>import(`./BoardShareModal-CNeucGS-.js`).then(e=>({default:e.BoardShareModal})),[])),zr=(0,p.lazy)(()=>Fr(()=>import(`./MetadataViewerModal-zQM0uYbS.js`).then(e=>({default:e.MetadataViewerModal})),[])),Br=(0,p.lazy)(()=>Fr(()=>import(`./ImageSearchModal-CH4E-SEH.js`).then(e=>({default:e.ImageSearchModal})),__vite__mapDeps([0]))),Vr=72,Hr=30,Ur=`universal-extractor:gallery-view-mode`,Wr=`universal-extractor:mobile-density`,Gr=({images:e,context:t,total:r,page:i,totalPages:a,selectedCategory:o,selectedSubfolder:s,selectedBoardId:c,dateFrom:l,dateTo:u,favoritesOnly:d,selectedColorFamily:f,colorIndexStatus:m,sortBy:h,sortOrder:g,gridColumns:_,selectedImagePaths:y,trashItems:b,isTrashView:w,importMessage:T,importFolderRef:E,onOpenImportFolder:D,isLoading:O,isRefreshing:k,hasPendingLiveRefresh:ee,error:te,boards:A,defaultSelectionMode:M,enableImagePrefetch:ne,interfaceDensity:N=`standard`,imageDetailOpen:F=!1,onSelectionDragChange:I,onSelectionModeActiveChange:re,onOpenDetail:z,onVisibleImagesChange:ie,inspectorClearSignal:oe,onPageChange:se,onCategoryChange:le,onBoardChange:ue,onDateFromChange:de,onDateToChange:pe,onFavoritesOnlyChange:me,onColorFamilyChange:ge,onSortByChange:_e,onSortOrderChange:ve,onGridColumnsChange:ye,onOpenWorkflow:be,onApplyLoraStack:xe,onSelectionChange:Se,onUpdateImageState:Ce,onCreateBoard:B,onUpdateBoardPins:we,onDeleteBoard:Te,onDeleteImages:Ee,onMoveImages:V,onImportFiles:Oe,onApplyPendingLiveRefresh:Ae,onOpenSettings:Me,searchValue:Ne,onSearchChange:Pe,onRestoreTrashItem:ze,onRestoreTrashItems:Be,onPurgeTrashItem:Ve,onPurgeTrashItems:H,trashBusy:He=!1})=>{let{t:W}=n(),Ue=mt(N),We=Ue.gap,{confirm:Ge}=At(),{pushToast:Ke}=ln(),{runOperation:Je,notify:Ye}=qe(),[G,Ze]=(0,p.useState)(!1),[Qe,$e]=(0,p.useState)(``),[et,tt]=(0,p.useState)([]),[nt,rt]=(0,p.useState)(``),[it,at]=(0,p.useState)(!1),[ot,st]=(0,p.useState)(()=>window.innerWidth),[q,ct]=(0,p.useState)(null),[lt,ut]=(0,p.useState)(null),[dt,ft]=(0,p.useState)(!1),[_t,vt]=(0,p.useState)(!1),[yt,bt]=(0,p.useState)(null),[xt,wt]=(0,p.useState)(M),[Ot,kt]=(0,p.useState)(null),[jt,Mt]=(0,p.useState)(()=>wr(Ur,`grid`)),[Nt,Pt]=(0,p.useState)(()=>Et(Wr)===`double`?`double`:`single`),[Ft,It]=(0,p.useState)(!1),[Lt,Rt]=(0,p.useState)(!1),[Bt,Vt]=(0,p.useState)(!1),[Ht,Ut]=(0,p.useState)(null),[Wt,Gt]=(0,p.useState)(!1),[Kt,qt]=(0,p.useState)(null),[Jt,Yt]=(0,p.useState)(null),Xt=(0,p.useRef)(null),Zt=(0,p.useRef)(null),Qt=(0,p.useCallback)(()=>{Zt.current?.abort(),Vt(!1),Ut(null),Gt(!1),Xt.current=null},[]);(0,p.useEffect)(()=>()=>Zt.current?.abort(),[]),(0,p.useEffect)(()=>{if(w)return;let e=e=>{if(v(e.target)||document.querySelector(`[aria-modal="true"]`))return;let t=[...e.clipboardData?.files??[]].find(e=>e.type.startsWith(`image/`));t&&(e.preventDefault(),Ut(t),Gt(!1),Vt(!0))};return window.addEventListener(`paste`,e),()=>window.removeEventListener(`paste`,e)},[w]);let[$t,en]=(0,p.useState)(``),{begin:tn,invalidate:nn}=ht(),[rn,an]=(0,p.useState)([]),[on,sn]=(0,p.useState)(null),[cn,dn]=(0,p.useState)(!1),[fn,pn]=(0,p.useState)(``),[mn,hn]=(0,p.useState)(null),[gn,yn]=(0,p.useState)([]),[xn,wn]=(0,p.useState)(0),[Tn,En]=(0,p.useState)(1),[Dn,On]=(0,p.useState)(!1),[kn,An]=(0,p.useState)(0),[jn,Mn]=(0,p.useState)(0),[Nn,Pn]=(0,p.useState)(0),[Fn,Ln]=(0,p.useState)(null),Rn=(0,p.useRef)(0),zn=(0,p.useRef)(null),Bn=(0,p.useRef)(null),Vn=(0,p.useRef)({}),Hn=(0,p.useRef)(!1),Un=(0,p.useRef)(null),Wn=(0,p.useRef)([]),Gn=(0,p.useRef)([]),Kn=(0,p.useRef)({}),qn=(0,p.useRef)(0),Jn=(0,p.useRef)(!1),Yn=(0,p.useRef)(null),Xn=Lt&&mn?gn:e;(0,p.useEffect)(()=>{Ft||ie?.(w||Lt&&!mn?[]:Xn)},[Xn,Ft,w,ie,mn,Lt]);let Zn=(0,p.useCallback)(e=>z(e,Xn),[Xn,z]),Qn=Lt&&mn?Tn:i,$n=Lt&&mn?xn:r,er=Lt&&mn?Math.max(1,Math.ceil(xn/60)):a,tr=(0,p.useMemo)(()=>Lt&&!mn?[]:Xn.map(e=>e.relative_path),[Xn,mn,Lt]),nr=(0,p.useMemo)(()=>new Map(Xn.map((e,t)=>[e.relative_path,t])),[Xn]),rr=(0,p.useMemo)(()=>w?b.map(e=>e.id):tr,[w,b,tr]),ir=(0,p.useMemo)(()=>new Set(y),[y]),J=(0,p.useMemo)(()=>rr.filter(e=>ir.has(e)),[ir,rr]),ar=J.length,or=ar>0,sr=!!Ot;(0,p.useEffect)(()=>(I?.(sr),()=>I?.(!1)),[sr,I]);let cr=!Ft,lr=!w&&(Ft?y.length>0:xt||ar>0),ur=(0,p.useMemo)(()=>w?b.filter(e=>ir.has(e.id)):[],[w,ir,b]),dr=Tr({selectedCategory:o,dateFrom:l,dateTo:u,favoritesOnly:d,selectedColorFamily:f,sortBy:h,sortOrder:g}),fr=(0,p.useMemo)(()=>A.find(e=>e.id===c)??null,[A,c]),pr=(0,p.useMemo)(()=>A.find(e=>e.id===nt)??null,[A,nt]),mr=(0,p.useMemo)(()=>(t?.sources??[]).filter(e=>e.enabled&&e.exists&&e.writable),[t?.sources]),hr=mr.some(e=>e.id===Qe)&&Qe||mr.find(e=>e.import_target)?.id||mr[0]?.id||``;(0,p.useEffect)(()=>{hr&&hr!==Qe&&$e(hr)},[hr,Qe]),(0,p.useEffect)(()=>{let e=()=>st(window.innerWidth);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,p.useEffect)(()=>{Dt(Ur,jt)},[jt]),(0,p.useEffect)(()=>{Dt(Wr,Nt)},[Nt]);let _r=(0,p.useCallback)(()=>{ct(null),ut(null)},[]);C(!!(q||lt),_r,{closeOnContextMenu:!0,closeOnScroll:!0}),(0,p.useEffect)(()=>{if(!_t)return;let e=()=>vt(!1);return window.addEventListener(`click`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`click`,e),window.removeEventListener(`resize`,e)}},[_t]),(0,p.useEffect)(()=>{re?.(lr)},[lr,re]),(0,p.useEffect)(()=>{Ft||y.length===J.length&&y.every(e=>J.includes(e))||Se(J)},[Ft,Se,J,y]),(0,p.useEffect)(()=>{cr||(kt(null),Hn.current=!1,Wn.current=[],Gn.current=[],Kn.current={},qn.current=0,Pn(0),Jn.current=!1)},[cr]),(0,p.useEffect)(()=>()=>{Un.current!==null&&window.clearTimeout(Un.current)},[]),(0,p.useLayoutEffect)(()=>{let e=zn.current?.closest(`.ue-main-shell`);if(Yn.current=e,Ln(e),!e)return;let t=()=>{On(e.scrollTop>320)};return t(),e.addEventListener(`scroll`,t,{passive:!0}),()=>e.removeEventListener(`scroll`,t)},[Ft,jt,Xn.length,w,b.length]),(0,p.useLayoutEffect)(()=>{let e=zn.current;if(Ft||!e){An(0);return}let t=()=>{let t=e.getBoundingClientRect();An(e=>Math.abs(e-t.width)>.5?t.width:e);let n=e.closest(`.ue-main-shell`),r=n?t.top-n.getBoundingClientRect().top+n.scrollTop-n.clientTop:0;Mn(e=>Math.abs(e-r)>.5?r:e)};if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),Bn.current&&n.observe(Bn.current),()=>n.disconnect()},[Ft,jt,Xn.length,w,b.length]);let yr=gr({images:Xn,requestedColumns:ot<=560?Nt===`double`?2:1:_,gridWidth:sr&&Nn>0?Nn:kn,viewportWidth:ot,scrollElement:Fn,gap:We,density:N,scrollMargin:jn}),br=yr.scrollToIndex;(0,p.useEffect)(()=>{if(!Kt||O||!e.some(e=>e.relative_path===Kt.path))return;br(Kt.index,{align:`center`});let t=window.requestAnimationFrame(()=>Vn.current[Kt.path]?.scrollIntoView?.({block:`center`}));return()=>window.cancelAnimationFrame(t)},[Kt,O,e,br]),(0,p.useEffect)(()=>{if(!Kt)return;let e=window.setTimeout(()=>qt(null),5e3);return()=>window.clearTimeout(e)},[Kt]),(0,p.useEffect)(()=>{if(!Jt||O||s!==Jt.folder||i!==Jt.page||(Ne||``)!==Jt.query)return;let e=window.requestAnimationFrame(()=>{let e=document.querySelector(`.ue-main-shell`);e&&(e.scrollTop=Jt.top),Yt(null)});return()=>window.cancelAnimationFrame(e)},[Jt,O,s,i,Ne,e]);let xr=yr.columnCount,Sr=yr.getItemLayout,Cr=(0,p.useCallback)(e=>{if(w||jt!==`grid`)return null;let t=nr.get(e);if(t===void 0||!zn.current)return null;let n=Sr(t);if(!n)return null;let r=zn.current.getBoundingClientRect(),i=r.left+n.left,a=r.top+n.top;return{left:i,right:i+n.width,top:a,bottom:a+n.height}},[jt,nr,w,Sr]);(0,p.useEffect)(()=>{if(!ne||!Xn.length||w||typeof IntersectionObserver>`u`)return;let e=new Map(Xn.map((e,t)=>[e.relative_path,t])),t=Math.max(xr*2,6),n=zn.current?.closest(`.ue-main-shell`),r=new IntersectionObserver(n=>{n.forEach(n=>{if(!n.isIntersecting)return;let i=n.target.dataset.imagePath,a=i?e.get(i):void 0;if(a===void 0)return;let o=Math.min(Xn.length,a+t);for(let e=a;e{let t=Vn.current[e.relative_path];t&&(t.dataset.imagePath=e.relative_path,r.observe(t))}),()=>r.disconnect()},[xr,ne,Xn,w]),(0,p.useEffect)(()=>{wt(M),!M&&!w&&Se([])},[M,w,Se]);let Er=e=>Array.from(e.dataTransfer.types??[]).includes(`Files`)&&(e.dataTransfer.files?.length??0)>0,Dr=e=>{Er(e)&&(e.preventDefault(),Rn.current+=1,Ze(!0))},Ar=e=>{Er(e)&&(e.preventDefault(),--Rn.current,Rn.current<=0&&(Rn.current=0,Ze(!1)))},jr=async e=>{if(!Er(e))return;e.preventDefault(),Rn.current=0,Ze(!1);let t=Array.from(e.dataTransfer.files??[]);t.length&&await Oe(t,hr)},{setSelection:Mr,handleImageSelectionClick:Nr,selectAllVisible:Pr,clearSelection:Fr,lastSelectedPathRef:Gr}=Ct({visibleSelectionPaths:rr,pageSelectedPaths:J,onSelectionChange:Se}),Kr=(0,p.useMemo)(()=>({search:``,category:o,subfolder:s,boardId:c,dateFrom:l,dateTo:u,favoritesOnly:d,colorFamily:f,sortBy:h,sortOrder:g}),[l,u,d,c,o,f,s,h,g]),qr=(0,p.useCallback)(async(e=!1)=>{let t=tn();dn(!0),pn(``);try{let n=await K.listVariantGroups({...Kr,type:$t,limit:120,forceRefresh:e},t.signal);if(!t.isCurrent())return;an(n.groups),sn(n.fingerprint_status)}catch(e){t.isCurrent()&&pn(e instanceof Error?e.message:W(`variantEmptyText`))}finally{t.isCurrent()&&dn(!1)}},[W,Kr,$t,tn]),Jr=(0,p.useCallback)(async(e,t=1)=>{let n=tn();dn(!0),yn([]),Fr(),pn(``);try{let r=await K.getVariantGroupImages({...Kr,groupId:e.id,type:e.type,page:t,limit:60},n.signal);if(!n.isCurrent())return;hn(r.group??e),yn(r.images),wn(r.total),En(r.page),Fr()}catch(e){n.isCurrent()&&pn(e instanceof Error?e.message:W(`variantEmptyText`))}finally{n.isCurrent()&&dn(!1)}},[Fr,W,Kr,tn]);(0,p.useEffect)(()=>{!Lt||mn||w||qr()},[w,qr,mn,Lt]),(0,p.useEffect)(()=>{Lt?(hn(null),yn([]),Fr(),w||qr()):(nn(),dn(!1),hn(null),yn([]))},[Fr,w,qr,Lt,Kr,$t,nn]),(0,p.useEffect)(()=>{let e=e=>{if(!(document.querySelector(`[aria-modal="true"]`)||v(e.target))&&((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`a`&&(e.preventDefault(),Pr()),e.key===`Escape`&&y.length&&(e.preventDefault(),Fr()),e.key===`Enter`&&xt&&y.length&&!w)){let t=Gr.current&&y.includes(Gr.current)?Gr.current:y[y.length-1],n=Xn.find(e=>e.relative_path===t);n&&(e.preventDefault(),Zn(n))}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[Xn,Fr,w,Zn,y,Pr,xt,Gr]);let Yr=async()=>{if(or&&await Ge({title:W(`bulkDelete`),message:W(ar>=20?`bulkDeleteHeavyConfirm`:`bulkDeleteConfirm`,{count:ar}),tone:ar>=20?`danger`:`warning`,confirmLabel:W(`commonDelete`),cancelLabel:W(`libraryCancel`)}))try{await Je(()=>Ee(J),{pending:W(`operationDeleteImages`),success:e=>W(`operationDeleteImagesResult`,{count:e.deleted.length,missing:_n(J,e).failedPaths.length}),successTone:e=>_n(J,e).complete?`success`:`error`,successRetry:e=>pt({paths:_n(J,e).failedPaths,confirm:Ge,confirmation:e=>({title:W(`bulkDelete`),message:W(`bulkDeleteConfirm`,{count:e}),tone:`warning`,confirmLabel:W(`commonDelete`),cancelLabel:W(`libraryCancel`)}),execute:Ee,failed:(e,t)=>_n(e,t).failedPaths,summary:(e,t)=>W(`operationDeleteImagesResult`,{count:t.deleted.length,missing:_n(e,t).failedPaths.length}),run:Je,pending:W(`operationDeleteImages`)}),successDetail:e=>{let{failedPaths:t}=_n(J,e);return t.length?W(`operationUnprocessedPaths`,{target:vn(t)}):``},error:e=>e instanceof Error?e.message:W(`imageDeleteError`)})}catch{}},Xr=async e=>{if(!et.length)return;let t=A.find(t=>t.id===e);await Ge({title:W(`bulkAddToBoard`),message:W(`bulkAddToBoardConfirm`,{count:et.length,target:t?.name||e}),tone:`warning`,confirmLabel:W(`boardAddToAction`),cancelLabel:W(`libraryCancel`)})&&(await Je(()=>we(e,et,!0),{pending:W(`operationAddToBoard`),success:W(`boardAddSuccess`,{count:et.length})}),tt([]))},Zr=async e=>{let t=!e.pinned;await Ge({title:W(t?`galleryPin`:`galleryUnpin`),message:W(t?`imagePinConfirm`:`imageUnpinConfirm`,{name:e.filename}),tone:`warning`,confirmLabel:W(t?`galleryPin`:`galleryUnpin`),cancelLabel:W(`libraryCancel`)})&&await Ce(e.relative_path,{pinned:t})},Qr=async(e,t)=>{if(Object.keys(t).length===1&&typeof t.pinned==`boolean`){let t=Xn.find(t=>t.relative_path===e);if(t){await Zr(t);return}}await Ce(e,t)},$r=async()=>{fr&&await Ge({title:W(`boardDeleteTitle`),message:W(`boardDeleteConfirm`,{name:fr.name}),tone:`warning`,confirmLabel:W(`commonDelete`),cancelLabel:W(`libraryCancel`)})&&(await Je(()=>Te(fr.id),{pending:W(`operationDeleteBoard`),success:W(`boardDeleteSuccess`)}),ue(``))},ei=async()=>{ur.length&&await Ge({title:W(`trashRestoreSelected`),message:W(`trashRestoreSelectedConfirm`,{count:ur.length}),tone:`warning`,confirmLabel:W(`trashRestore`),cancelLabel:W(`libraryCancel`)})&&(await Be(ur.map(e=>e.id))||Fr())},ti=async()=>{ur.length&&await Ge({title:W(`trashDeleteSelectedForever`),message:W(`trashDeleteSelectedConfirm`,{count:ur.length}),tone:`danger`,confirmLabel:W(`trashDeleteForever`),cancelLabel:W(`libraryCancel`)})&&(await H(ur.map(e=>e.id))||Fr())},ni=e=>{e!==i&&(se(e),(Yn.current||Bn.current?.closest(`.ue-main-shell`))?.scrollTo?.({top:0,behavior:`instant`}))},ri=e=>{let t=Number(e.get(`page`));Number.isFinite(t)&&ni(Math.min(Math.max(1,Math.trunc(t)),a))},ii=e=>new URL(e.original_url||e.url,window.location.origin).toString(),ai=(0,p.useCallback)(e=>{let t=w?b.map(e=>({key:e.id})):Xn.map(e=>({key:e.relative_path})),n=(Yn.current?.scrollTop??0)-qn.current,r=St({selectionBox:e,keys:t.map(e=>e.key),scrollDelta:n,getRect:e=>Kn.current[e]??Vn.current[e]?.getBoundingClientRect()??Cr(e)});kt(e=>e&&e.scrollDelta!==n?{...e,scrollDelta:n}:e),Mr(Jn.current?gt([...Wn.current,...r],rr):r)},[Xn,Cr,w,Mr,b,rr]),oi=(0,p.useCallback)(e=>{cr&&e.button===0&&e.pointerType!==`touch`&&(e.target.closest(`button, input, select, textarea, a, label, .ue-filter-bar`)||(Hn.current=!1,Un.current!==null&&(window.clearTimeout(Un.current),Un.current=null),Wn.current=J,Gn.current=[],Kn.current=Object.fromEntries(rr.map(e=>{let t=Vn.current[e]?.getBoundingClientRect()??Cr(e);return t?[e,t]:null}).filter(e=>e!==null)),Pn(zn.current?.getBoundingClientRect().width||kn),qn.current=Yn.current?.scrollTop??0,Jn.current=e.ctrlKey||e.metaKey,kt({startX:e.clientX,startY:e.clientY,currentX:e.clientX,currentY:e.clientY})))},[Cr,kn,J,cr,rr]),si=(0,p.useCallback)(e=>{if(!cr||!Ot)return;let t=Yn.current?.getBoundingClientRect(),n={...Ot,currentX:t&&t.width>0?Math.max(t.left,Math.min(e.clientX,t.right)):e.clientX,currentY:t&&t.height>0?Math.max(Math.max(60,t.top),Math.min(e.clientY,Math.min(window.innerHeight,t.bottom))):e.clientY};(Math.abs(n.currentX-n.startX)>6||Math.abs(n.currentY-n.startY)>6)&&!Hn.current&&(Hn.current=!0,Yn.current?.setPointerCapture?.(e.pointerId)),kt(n),Hn.current&&ai(n)},[Ot,cr,ai]),ci=(0,p.useCallback)(e=>{Ot&&(typeof e?.currentTarget.hasPointerCapture==`function`&&typeof e.currentTarget.releasePointerCapture==`function`&&e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),Hn.current?(kt(null),Wn.current=[],Gn.current=[],Kn.current={},qn.current=0,Pn(0),Jn.current=!1,Un.current=window.setTimeout(()=>{Hn.current=!1,Un.current=null},160)):(kt(null),Wn.current=[],Gn.current=[],Kn.current={},qn.current=0,Pn(0),Jn.current=!1))},[Ot]);(0,p.useEffect)(()=>{if(!Fn||!Ot)return;let e=0,t=()=>{Hn.current&&(e&&window.cancelAnimationFrame(e),e=window.requestAnimationFrame(()=>{e=0,ai(Ot)}))};return Fn.addEventListener(`scroll`,t,{passive:!0}),()=>{e&&window.cancelAnimationFrame(e),Fn.removeEventListener(`scroll`,t)}},[Fn,Ot,ai]),(0,p.useEffect)(()=>{if(!Fn||!Ot)return;let e=0,t=()=>{if(e=window.requestAnimationFrame(t),!Hn.current)return;let n=Fn.getBoundingClientRect(),r={top:Math.max(60,n.top),bottom:Math.min(window.innerHeight,n.bottom)},i=Math.max(0,Fn.scrollHeight-Fn.clientHeight);if(i<=0)return;let a=0;if(Ot.currentY>r.bottom-Vr){let e=Vr-(r.bottom-Ot.currentY);a=Math.ceil(Math.min(1,e/Vr)*Hr)}else if(Ot.currentYwindow.cancelAnimationFrame(e)},[Fn,Ot,ai]),(0,p.useEffect)(()=>{if(!cr||!Fn)return;let e=e=>{let t=e.target;t instanceof Node&&Bn.current?.contains(t)||oi(e)},t=e=>{si(e)},n=e=>{ci(e)},r=()=>{Hn.current=!1,kt(null),Pn(0),Kn.current={},Wn.current=[],Gn.current=[],Jn.current=!1},i=e=>{e.key===`Escape`&&r()};return window.addEventListener(`blur`,r),window.addEventListener(`resize`,r),window.addEventListener(`keydown`,i,!0),Fn.addEventListener(`lostpointercapture`,r),Fn.addEventListener(`pointerdown`,e),Fn.addEventListener(`pointermove`,t),Fn.addEventListener(`pointerup`,n),Fn.addEventListener(`pointercancel`,n),()=>{window.removeEventListener(`blur`,r),window.removeEventListener(`resize`,r),window.removeEventListener(`keydown`,i,!0),Fn.removeEventListener(`lostpointercapture`,r),Fn.removeEventListener(`pointerdown`,e),Fn.removeEventListener(`pointermove`,t),Fn.removeEventListener(`pointerup`,n),Fn.removeEventListener(`pointercancel`,n)}},[oi,ci,si,Fn,cr]);let li=async(e,t)=>{try{await navigator.clipboard.writeText(e),Ke(t,`success`)}catch(e){Ke(e instanceof Error?e.message:W(`contextCopyError`),`error`)}},ui=async e=>{try{if(!(`clipboard`in navigator)||typeof ClipboardItem>`u`){await li(ii(e),W(`contextCopyImageLinkSuccess`));return}let t=await(await fetch(ii(e))).blob();if(!t.type.startsWith(`image/`))throw Error(W(`contextCopyImageError`));await navigator.clipboard.write([new ClipboardItem({[t.type]:t})]),Ke(W(`contextCopyImageSuccess`),`success`)}catch(e){Ke(e instanceof Error?e.message:W(`contextCopyImageError`),`error`)}},di=async e=>{try{let t=bn(await K.getImageMetadata(e.relative_path));if(!t){Ke(W(`metadataNoPositivePrompt`),`info`);return}await li(t,W(`metadataCopyPositiveSuccess`))}catch(e){Ke(e instanceof Error?e.message:W(`metadataLoadError`),`error`)}},fi=async e=>{await Ge({title:W(`modalDeleteFile`),message:W(`imageDeleteConfirm`,{name:e.filename}),tone:`warning`,confirmLabel:W(`commonDelete`),cancelLabel:W(`libraryCancel`)})&&await Je(()=>Ee([e.relative_path]),{pending:W(`operationDeleteImage`),success:t=>_n([e.relative_path],t).complete?W(`imageDelete`):W(`imageDeleteMissing`),successTone:t=>_n([e.relative_path],t).complete?`success`:`error`,error:e=>e instanceof Error?e.message:W(`imageDeleteError`)}).catch(()=>void 0)},pi=(e,t)=>{e.preventDefault(),e.stopPropagation();let n=x(e,{width:292,height:356},`pointer`);ct({image:t,x:n.x,y:n.y})},mi=(e,t)=>{e.preventDefault(),e.stopPropagation();let n=x(e,{width:220,height:220},`pointer`);ut({item:t,x:n.x,y:n.y})},hi=()=>{Yn.current?.scrollTo({top:0,behavior:Tt()})},gi=()=>{Pe?.(``),le(``),ge(``),de(``),pe(``),me(!1),ni(1)},_i=s?zt(s).sourceId:``,vi=(t?.sources??[]).filter(e=>e.enabled&&e.exists),yi=_i?vi.some(e=>e.id===_i):vi.length>0,bi=!!(Ne?.trim()||o||f||l||u||d),xi=te?{title:W(`galleryEmptyErrorTitle`),description:te,actionLabel:W(`navRefresh`),onAction:Ae}:yi?bi?{title:W(`galleryEmptyFilteredTitle`),description:W(`galleryEmptyFilteredText`),actionLabel:W(`filterReset`),onAction:gi}:{title:W(`galleryEmptySourceTitle`),description:W(`galleryEmptySourceText`)}:{title:W(`galleryEmptyNoSourceTitle`),description:W(`galleryEmptyNoSourceText`),actionLabel:Me?W(`navSettings`):void 0,onAction:Me};return(0,U.jsxs)(`div`,{className:`ue-drop-shell ${G?`is-dragging`:``}`,onDragEnter:Dr,onDragLeave:Ar,onDragOver:e=>e.preventDefault(),onDrop:jr,children:[(0,U.jsxs)(`section`,{ref:Bn,"data-gallery-interacting":sr?`true`:void 0,style:{"--ue-gallery-gap":`${Ue.gap}px`,"--ue-card-body-height":`${Ue.bodyHeight}px`,"--ue-card-body-padding":`${Ue.padding}px`},className:`ue-workspace ue-workspace--gallery ue-animate-in`,onPointerDown:oi,onPointerMove:si,onPointerUp:ci,onPointerCancel:ci,children:[Wt&&(0,U.jsx)(`button`,{className:`ue-secondary-action ue-search-return`,onClick:e=>{e.stopPropagation(),Xt.current?.(),Xt.current=null,Gt(!1),qt(null)},children:W(`imageSearchReturn`)}),(0,U.jsx)(Or,{onFolderNavigate:D,isTrashView:w,selectedBoard:fr,selectedSubfolder:s,total:r,trashCount:b.length,favoritesOnly:d,isRefreshing:k,hasPendingLiveRefresh:ee,activeFilterControlCount:dr,showFiltersMenu:_t,showColumnsMenu:dt,galleryViewMode:jt,gridColumns:_,effectiveColumns:xr,isMobile:ot<=560,mobileDensity:Nt,onMobileDensityChange:Pt,dualFolderMode:Ft,variantMode:Lt,selectionMode:xt,writableSources:mr,sources:t?.sources??[],importSubfolder:t?.import_image_subfolder||`universal_gallery_imports`,activeImportSourceId:hr,categories:t?.categories??[],selectedCategory:o,dateFrom:l,dateTo:u,selectedColorFamily:f,colorIndexStatus:m,sortBy:h,sortOrder:g,searchValue:Ne,onSearchChange:Pe,onImageSearch:()=>{Ut(null),Gt(!1),Vt(!0)},onApplyPendingLiveRefresh:Ae,onToggleFiltersMenu:()=>vt(e=>!e),onCloseFiltersMenu:()=>vt(!1),onToggleColumnsMenu:()=>ft(e=>!e),onCloseColumnsMenu:()=>ft(!1),onOpenCategoryPicker:()=>at(!0),onGalleryViewModeChange:Mt,onGridColumnsChange:ye,onDualFolderModeChange:It,onVariantModeChange:Rt,onSelectionModeChange:wt,onImportTargetSourceIdChange:$e,onShareBoard:rt,onDeleteBoard:()=>void $r(),onClearSelection:Fr,onCategoryChange:le,onDateFromChange:de,onDateToChange:pe,onFavoritesOnlyChange:me,onColorFamilyChange:ge,onSortByChange:_e,onSortOrderChange:ve,onPageChange:ni}),T?(0,U.jsxs)(`div`,{className:`ue-inline-success`,role:`status`,children:[(0,U.jsx)(`span`,{children:T}),E&&D?(0,U.jsx)(`button`,{type:`button`,className:`ue-secondary-action`,onClick:()=>{It(!1),Rt(!1),Fr(),D(E)},children:W(`galleryOpenImportFolder`)}):null]}):null,te&&(e.length>0||w||Ft||Lt)?(0,U.jsx)(`div`,{className:`ue-inline-error`,children:te}):null,(0,U.jsx)(p.Suspense,{fallback:(0,U.jsxs)(`div`,{className:`ue-gallery-state`,children:[(0,U.jsx)(`div`,{className:`ue-loading-orb`}),(0,U.jsx)(`p`,{children:W(`galleryLoading`)})]}),children:Ft&&!w?(0,U.jsx)(Ir,{onExit:()=>{It(!1),Fr()},context:t,initialFolder:s,sortBy:h,sortOrder:g,boards:A,onOpenDetail:z,onSelectionChange:Se,onVisibleImagesChange:ie,inspectorClearSignal:oe,onOpenWorkflow:be,onMoveImages:V,onDeleteImages:Ee,onUpdateImageState:Qr,onCreateBoard:B,onUpdateBoardPins:we}):Lt&&!w&&!mn?(0,U.jsx)(Lr,{onExit:()=>{Rt(!1),Fr()},groups:rn,selectedType:$t,status:on,loading:cn,error:fn,onTypeChange:en,onRefresh:()=>void qr(!0),onOpenGroup:e=>void Jr(e)}):Lt&&!w&&mn?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`ue-variant-detail-head`,children:[(0,U.jsxs)(`button`,{className:`ue-secondary-action`,type:`button`,onClick:()=>{hn(null),yn([]),Fr(),qr()},children:[(0,U.jsx)(j,{size:15}),(0,U.jsx)(`span`,{children:W(`variantBackToGroups`)})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{children:W(`variantType_${mn.type}`)}),(0,U.jsx)(`strong`,{children:mn.title})]}),(0,U.jsxs)(`button`,{className:`ue-secondary-action`,type:`button`,onClick:()=>{let e=gn[0]?.relative_path;Se(gn.map(e=>e.relative_path).filter(t=>t!==e)),wt(!0)},children:[(0,U.jsx)(Fe,{size:15}),(0,U.jsx)(`span`,{children:W(`variantSelectRest`)})]})]}),cn&&gn.length===0?(0,U.jsxs)(`div`,{className:`ue-gallery-state`,children:[(0,U.jsx)(`div`,{className:`ue-loading-orb`}),(0,U.jsx)(`p`,{children:W(`variantAnalyzing`)})]}):(0,U.jsx)(vr,{images:Xn,galleryViewMode:jt,selectionMode:xt,selectionEnabled:cr,selectionBox:Ot,pageSelectedPaths:J,page:Qn,totalPages:er,total:$n,effectiveColumns:xr,highlightPath:Kt?.path,masonryLayout:yr,gridRef:zn,cardRefs:Vn,isDraggingSelectionRef:Hn,onOpenDetail:Zn,onOpenWorkflow:be,onUpdateImageState:Qr,onBoardPickerPathsChange:tt,onImageSelectionClick:Nr,onOpenContextMenu:pi,onSelectAllVisible:Pr,onPageChange:e=>void Jr(mn,e),onPageJump:e=>{let t=Number(e.get(`page`)||1);Jr(mn,Number.isFinite(t)?t:1)}})]}):O&&e.length===0?(0,U.jsxs)(`div`,{className:`ue-gallery-state`,children:[(0,U.jsx)(`div`,{className:`ue-loading-orb`}),(0,U.jsx)(`p`,{children:W(`galleryLoading`)})]}):w?(0,U.jsx)(kr,{busy:He,trashItems:b,selectedCount:ar,selectedTrashCount:ur.length,hasSelection:or,pageSelectedPaths:J,galleryViewMode:jt,selectionEnabled:cr,selectionBox:Ot,isDraggingSelectionRef:Hn,cardRefs:Vn,gridRef:zn,onSelectAllVisible:Pr,onClearSelection:Fr,onRestoreSelectedTrash:()=>void ei(),onPurgeSelectedTrash:()=>void ti(),onRestoreTrashItem:e=>void ze(e),onPurgeTrashItem:e=>void Ve(e),onTrashContextMenu:mi,onImageSelectionClick:Nr,onSelectionPointerDown:oi,onSelectionPointerMove:si,onSelectionPointerEnd:ci}):(0,U.jsx)(vr,{images:Xn,emptyState:xi,galleryViewMode:jt,selectionMode:xt,selectionEnabled:cr,selectionBox:Ot,pageSelectedPaths:J,page:Qn,totalPages:er,total:$n,effectiveColumns:xr,highlightPath:Kt?.path,masonryLayout:yr,gridRef:zn,cardRefs:Vn,isDraggingSelectionRef:Hn,onOpenDetail:Zn,onOpenWorkflow:be,onUpdateImageState:Qr,onBoardPickerPathsChange:tt,onImageSelectionClick:Nr,onOpenContextMenu:pi,onSelectAllVisible:Pr,onPageChange:ni,onPageJump:ri})})]}),G?(0,U.jsx)(`div`,{className:`ue-drop-overlay`,children:(0,U.jsxs)(`div`,{className:`ue-drop-overlay-card`,children:[(0,U.jsx)(`h3`,{children:W(`galleryDropTitle`)}),(0,U.jsx)(`p`,{children:W(`galleryDropText`)})]})}):null,(0,U.jsx)(Cn,{open:it,categories:t?.categories??[],selectedCategory:o,onClose:()=>at(!1),onSelect:e=>{le(e),ni(1)}}),(0,U.jsx)(Sn,{open:et.length>0,boards:A,selectedCount:et.length,onClose:()=>tt([]),onCreateBoard:B,onAddToBoard:Xr}),pr?(0,U.jsx)(p.Suspense,{fallback:null,children:(0,U.jsx)(Rr,{open:!0,board:pr,onClose:()=>rt(``)})}):null,q?(0,U.jsx)(S,{children:(0,U.jsxs)(`div`,{className:`ue-context-menu ue-context-menu--gallery`,style:{top:q.y,left:q.x},onClick:e=>e.stopPropagation(),onContextMenu:e=>e.preventDefault(),children:[(0,U.jsxs)(`div`,{className:`ue-context-menu-head`,children:[(0,U.jsx)(`strong`,{title:q.image.filename,children:q.image.filename}),(0,U.jsx)(`span`,{children:un(q.image.size)})]}),(0,U.jsxs)(`div`,{className:`ue-context-menu-grid`,children:[(0,U.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>{Zn(q.image),ct(null)},children:[(0,U.jsx)(fe,{size:14}),(0,U.jsx)(`span`,{children:W(`galleryInspect`)})]}),(0,U.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>{Nr(q.image.relative_path,{ctrlKey:!0,metaKey:!1,shiftKey:!1}),ct(null)},children:[J.includes(q.image.relative_path)?(0,U.jsx)(Fe,{size:14}):(0,U.jsx)(Ie,{size:14}),(0,U.jsx)(`span`,{children:J.includes(q.image.relative_path)?W(`galleryDeselectImage`):W(`gallerySelectImage`)})]}),(0,U.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>{Zr(q.image),ct(null)},children:[(0,U.jsx)(De,{size:14,fill:q.image.pinned?`currentColor`:`none`}),(0,U.jsx)(`span`,{children:q.image.pinned?W(`galleryUnpin`):W(`galleryPin`)})]}),(0,U.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>{tt(J.includes(q.image.relative_path)&&J.length>1?J:[q.image.relative_path]),ct(null)},children:[(0,U.jsx)(ae,{size:14}),(0,U.jsx)(`span`,{children:W(`bulkAddToBoard`)})]})]}),(0,U.jsxs)(`div`,{className:`ue-context-menu-section`,children:[(0,U.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>{be(q.image),ct(null)},children:[(0,U.jsx)(je,{size:14}),(0,U.jsx)(`span`,{children:W(`modalOpenWorkflow`)})]}),(0,U.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>{xe(q.image),ct(null)},children:[(0,U.jsx)(he,{size:14}),(0,U.jsx)(`span`,{children:W(`loraStackApply`)})]}),(0,U.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>{bt(q.image),ct(null)},children:[(0,U.jsx)(R,{size:14}),(0,U.jsx)(`span`,{children:W(`metadataView`)})]})]}),(0,U.jsxs)(`div`,{className:`ue-context-menu-grid ue-context-menu-grid--copy`,children:[(0,U.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>{di(q.image),ct(null)},children:[(0,U.jsx)(P,{size:14}),(0,U.jsx)(`span`,{children:W(`metadataCopyPositive`)})]}),(0,U.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>{ui(q.image),ct(null)},children:[(0,U.jsx)(Fe,{size:14}),(0,U.jsx)(`span`,{children:W(`contextCopyImage`)})]}),(0,U.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>{li(q.image.filename,W(`contextCopyFilenameSuccess`)),ct(null)},children:[(0,U.jsx)(Le,{size:14}),(0,U.jsx)(`span`,{children:W(`contextCopyFilename`)})]}),(0,U.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>{li(q.image.relative_path,W(`contextCopyPathSuccess`)),ct(null)},children:[(0,U.jsx)(ce,{size:14}),(0,U.jsx)(`span`,{children:W(`contextCopyPath`)})]}),(0,U.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>{window.open(ii(q.image),`_blank`,`noopener,noreferrer`),ct(null)},children:[(0,U.jsx)(L,{size:14}),(0,U.jsx)(`span`,{children:W(`modalOpenFull`)})]})]}),(0,U.jsxs)(`button`,{className:`ue-context-menu-item ue-context-menu-item--danger`,onClick:()=>{J.includes(q.image.relative_path)&&J.length>1?Yr():fi(q.image),ct(null)},children:[(0,U.jsx)(Re,{size:14}),(0,U.jsx)(`span`,{children:J.includes(q.image.relative_path)&&J.length>1?W(`bulkDelete`):W(`commonDelete`)})]})]})}):null,yt?(0,U.jsx)(p.Suspense,{fallback:null,children:(0,U.jsx)(zr,{image:yt,onClose:()=>bt(null)})}):null,lt?(0,U.jsx)(S,{children:(0,U.jsxs)(`div`,{className:`ue-context-menu`,style:{top:lt.y,left:lt.x},onClick:e=>e.stopPropagation(),onContextMenu:e=>e.preventDefault(),children:[(0,U.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>{Nr(lt.item.id,{ctrlKey:!0,metaKey:!1,shiftKey:!1}),ut(null)},children:[J.includes(lt.item.id)?(0,U.jsx)(Fe,{size:14}):(0,U.jsx)(Ie,{size:14}),(0,U.jsx)(`span`,{children:J.includes(lt.item.id)?W(`galleryDeselectImage`):W(`gallerySelectImage`)})]}),(0,U.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>{J.includes(lt.item.id)&&J.length>1?ei():ze(lt.item.id),ut(null)},children:[(0,U.jsx)(ke,{size:14}),(0,U.jsx)(`span`,{children:J.includes(lt.item.id)&&J.length>1?W(`trashRestoreSelected`):W(`trashRestore`)})]}),(0,U.jsxs)(`button`,{className:`ue-context-menu-item ue-context-menu-item--danger`,onClick:()=>{J.includes(lt.item.id)&&J.length>1?ti():Ve(lt.item.id),ut(null)},children:[(0,U.jsx)(Re,{size:14}),(0,U.jsx)(`span`,{children:J.includes(lt.item.id)&&J.length>1?W(`trashDeleteSelectedForever`):W(`trashDeleteForever`)})]})]})}):null,Bt&&!w?(0,U.jsx)(p.Suspense,{fallback:null,children:(0,U.jsx)(Br,{initialFile:Ht,onClose:Qt,onOpenDetail:z,suspended:F||Wt,onLocate:e=>{Zt.current?.abort();let t=new AbortController;Zt.current=t,(async()=>{try{let n,r=!1;try{n=await K.locateImage(e,48,h,g,t.signal)}catch(t){if(!(t instanceof Xe)||![404,405].includes(t.status)||t.details&&typeof t.details==`object`)throw t;let i=e.source_relative_path||e.relative_path.replace(/^[^:]+::/,``);n={subfolder:`${e.source_id||`default_output`}::${i.includes(`/`)?i.slice(0,i.lastIndexOf(`/`)):``}`,page:1,index:0,relative_path:e.relative_path},r=!0,Ye(W(`imageSearchLegacyLocate`),`info`)}if(t.signal.aborted)return;let a=document.querySelector(`.ue-main-shell`)?.scrollTop??0;Xt.current=()=>{D?.(s),se(i),le(o),ue(c),me(d),de(l),pe(u),ge(f),Pe?.(Ne||``),_e(h),ve(g),It(Ft),Rt(Lt),Yt({folder:s,page:i,query:Ne||``,top:a})},It(!1),Rt(!1),Fr(),le(``),ue(``),me(!1),de(``),pe(``),ge(``),Pe?.(r?e.filename:``),D?.(n.subfolder),se(n.page),qt({path:n.relative_path,index:n.index}),Gt(!0)}catch(e){t.signal.aborted||Ye(e instanceof Error?e.message:W(`imageSearchLocateFailed`),`error`)}})()}})}):null,Dn?(0,U.jsx)(`button`,{className:`ue-scrolltop-btn`,onClick:hi,"aria-label":W(`galleryBackToTop`),title:W(`galleryBackToTop`),children:(0,U.jsx)(j,{size:18})}):null]})},Kr=({selectedPaths:e,selectedSubfolder:t,selectedBoard:r,boards:i,page:a,targetFolderOptions:o,onClose:s,onBatchUpdateImages:c,onCreateBoard:l,onUpdateBoardPins:u,onMoveImages:d,onBatchRenameImages:f,onDeleteImages:m})=>{let{t:h}=n(),{confirm:g}=At(),{runOperation:_}=qe(),[v,y]=(0,p.useState)([]),[b,x]=(0,p.useState)(``),[S,C]=(0,p.useState)(``),[w,T]=(0,p.useState)(`set-{page}-{n}`),[E,D]=(0,p.useState)(1),[O,ee]=(0,p.useState)(2),te=e.length,A=h(`bulkSelected`,{count:te}),j=(0,p.useMemo)(()=>o.filter(e=>e.value!==t),[t,o]),M=async e=>{if(!v.length)return;let t=i.find(t=>t.id===e);await g({title:h(`bulkAddToBoard`),message:h(`bulkAddToBoardConfirm`,{count:v.length,target:t?.name||e}),tone:`warning`,confirmLabel:h(`boardAddToAction`),cancelLabel:h(`libraryCancel`)})&&(await _(()=>u(e,v,!0),{pending:h(`operationAddToBoard`),success:h(`boardAddSuccess`,{count:v.length})}),y([]))},ne=async()=>{if(e.length&&await g({title:h(`bulkDelete`),message:e.length>=20?h(`bulkDeleteHeavyConfirm`,{count:e.length}):h(`bulkDeleteConfirm`,{count:e.length}),tone:e.length>=20?`danger`:`warning`,confirmLabel:h(`commonDelete`),cancelLabel:h(`libraryCancel`)}))try{_n(e,await _(()=>m(e),{pending:h(`operationDeleteImages`),success:t=>h(`operationDeleteImagesResult`,{count:t.deleted.length,missing:_n(e,t).failedPaths.length}),successTone:t=>_n(e,t).complete?`success`:`error`,successRetry:t=>pt({paths:_n(e,t).failedPaths,confirm:g,confirmation:e=>({title:h(`bulkDelete`),message:h(`bulkDeleteConfirm`,{count:e}),tone:`warning`,confirmLabel:h(`commonDelete`),cancelLabel:h(`libraryCancel`)}),execute:m,failed:(e,t)=>_n(e,t).failedPaths,summary:(e,t)=>h(`operationDeleteImagesResult`,{count:t.deleted.length,missing:_n(e,t).failedPaths.length}),run:_,pending:h(`operationDeleteImages`)}),successDetail:t=>{let{failedPaths:n}=_n(e,t);return n.length?h(`operationUnprocessedPaths`,{target:vn(n)}):``},error:e=>e instanceof Error?e.message:h(`imageDeleteError`)})).complete&&s()}catch{}},N=async()=>{r&&e.length&&await g({title:h(`bulkRemoveFromBoard`),message:h(`bulkRemoveFromBoardConfirm`,{count:e.length,target:r.name}),tone:`warning`,confirmLabel:h(`bulkRemoveFromBoard`),cancelLabel:h(`libraryCancel`)})&&(await _(()=>u(r.id,e,!1),{pending:h(`operationRemoveFromBoard`),success:h(`bulkRemoveFromBoard`)}),s())},P=async()=>{if(!e.length||!S)return;let t=o.find(e=>e.value===S);if(await g({title:h(`bulkMoveTo`),message:h(`bulkMoveConfirm`,{count:e.length,target:t?.label||S}),tone:`warning`,confirmLabel:h(`folderMove`),cancelLabel:h(`libraryCancel`)}))try{gn(e,await _(()=>d(e,S,t?.source_id),{pending:h(`operationMoveImages`),success:t=>{let{unaccounted:n}=gn(e,t);return[h(`qolMoveResult`,{moved:t.moved.length,missing:t.missing.length,blocked:t.blocked?.length??0}),t.unchanged?.length?h(`operationMoveUnchanged`,{count:t.unchanged.length}):``,n?h(`operationUnaccounted`,{count:n}):``].filter(Boolean).join(` `)},successTone:t=>gn(e,t).complete?`success`:`error`,successRetry:n=>pt({paths:gn(e,n).failedPaths,confirm:g,confirmation:e=>({title:h(`bulkMoveTo`),message:h(`bulkMoveConfirm`,{count:e,target:t?.label||S}),tone:`warning`,confirmLabel:h(`folderMove`),cancelLabel:h(`libraryCancel`)}),execute:e=>d(e,S,t?.source_id),failed:(e,t)=>gn(e,t).failedPaths,summary:(e,t)=>h(`qolMoveResult`,{moved:t.moved.length,missing:t.missing.length,blocked:t.blocked?.length??0}),run:_,pending:h(`operationMoveImages`)}),successDetail:t=>{let{failedPaths:n}=gn(e,t);return n.length?h(`operationUnprocessedPaths`,{target:vn(n)}):``},error:e=>e instanceof Error?e.message:h(`operationMoveImages`)})).complete&&s()}catch{}},F=async()=>{if(e.length&&w.trim()&&await g({title:h(`bulkRenameApply`),message:h(`bulkRenameConfirm`,{count:e.length,target:w.trim()}),tone:`warning`,confirmLabel:h(`folderRename`),cancelLabel:h(`libraryCancel`)}))try{await f(e,w.trim(),E,O,a),s()}catch{}},I=t=>({pending:h(`operationUpdateImages`),success:t=>h(`operationBatchResult`,{updated:t.updated.length,count:0,missing:hn(e,t).failedPaths.length}),successTone:t=>hn(e,t).complete?`success`:`error`,successDetail:t=>hn(e,t).failedPaths.join(`; `),successRetry:n=>pt({paths:hn(e,n).failedPaths,confirm:g,confirmation:e=>({title:h(`operationUpdateImages`),message:h(`operationRetryBatchConfirm`,{count:e,target:typeof t.pinned==`boolean`?h(t.pinned?`bulkPin`:`bulkUnpin`):`${h(`bulkSetCategory`)}: ${String(t.category||``)}`}),tone:`warning`,confirmLabel:h(`commonConfirm`),cancelLabel:h(`libraryCancel`)}),execute:e=>c(e,t),failed:(e,t)=>hn(e,t).failedPaths,summary:(e,t)=>h(`operationBatchResult`,{updated:t.updated.length,count:0,missing:hn(e,t).failedPaths.length}),run:_,pending:h(`operationUpdateImages`)})}),L=async t=>{e.length&&await g({title:h(t?`bulkPin`:`bulkUnpin`),message:h(t?`bulkPinConfirm`:`bulkUnpinConfirm`,{count:e.length}),tone:`warning`,confirmLabel:h(t?`bulkPin`:`bulkUnpin`),cancelLabel:h(`libraryCancel`)})&&await _(()=>c(e,{pinned:t}),I({pinned:t})).catch(()=>void 0)},re=async()=>{let t=b.trim();e.length&&t&&await g({title:h(`bulkSetCategory`),message:h(`bulkSetCategoryConfirm`,{count:e.length,target:t}),tone:`warning`,confirmLabel:h(`commonConfirm`),cancelLabel:h(`libraryCancel`)})&&await _(()=>c(e,{category:t}),I({category:t})).catch(()=>void 0)};return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`button`,{className:`ue-inspector-backdrop`,onClick:s,"aria-label":h(`bulkClear`)}),(0,U.jsxs)(`aside`,{className:`ue-gallery-inspector`,"aria-label":h(`bulkActions`),children:[(0,U.jsxs)(`div`,{className:`ue-gallery-inspector-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{children:h(`bulkActions`)}),(0,U.jsx)(`strong`,{title:A,children:A})]}),(0,U.jsx)(`button`,{className:`ue-icon-action`,onClick:s,"aria-label":h(`bulkClear`),title:h(`bulkClear`),children:(0,U.jsx)(H,{size:14})})]}),(0,U.jsxs)(`div`,{className:`ue-gallery-inspector-summary`,children:[(0,U.jsxs)(`div`,{className:`ue-gallery-inspector-title`,children:[(0,U.jsx)(Fe,{size:16}),(0,U.jsx)(`strong`,{children:A})]}),(0,U.jsx)(`span`,{children:t||h(`galleryOutputFolder`)}),(0,U.jsx)(`p`,{children:h(`bulkSelectionHint`)})]}),(0,U.jsxs)(`div`,{className:`ue-gallery-inspector-quick-actions`,"aria-label":h(`bulkActions`),children:[(0,U.jsxs)(`button`,{className:`ue-icon-action`,onClick:s,"aria-label":h(`bulkClear`),title:h(`bulkClear`),children:[(0,U.jsx)(Ie,{size:14}),(0,U.jsx)(`span`,{children:h(`bulkClear`)})]}),(0,U.jsxs)(`button`,{className:`ue-icon-action`,onClick:()=>void L(!0),"aria-label":h(`bulkPin`),title:h(`bulkPin`),children:[(0,U.jsx)(De,{size:14}),(0,U.jsx)(`span`,{children:h(`bulkPin`)})]}),(0,U.jsxs)(`button`,{className:`ue-icon-action`,onClick:()=>void L(!1),"aria-label":h(`bulkUnpin`),title:h(`bulkUnpin`),children:[(0,U.jsx)(De,{size:14}),(0,U.jsx)(`span`,{children:h(`bulkUnpin`)})]}),(0,U.jsxs)(`button`,{className:`ue-icon-action`,onClick:()=>y(e),"aria-label":h(`bulkAddToBoard`),title:h(`bulkAddToBoard`),children:[(0,U.jsx)(ae,{size:14}),(0,U.jsx)(`span`,{children:h(`bulkAddToBoard`)})]}),r?(0,U.jsxs)(`button`,{className:`ue-icon-action`,onClick:()=>void N(),"aria-label":h(`bulkRemoveFromBoard`),title:h(`bulkRemoveFromBoard`),children:[(0,U.jsx)(z,{size:14}),(0,U.jsx)(`span`,{children:h(`bulkRemoveFromBoard`)})]}):null,(0,U.jsxs)(`button`,{className:`ue-icon-action ue-icon-action--danger`,onClick:()=>void ne(),"aria-label":h(`bulkDelete`),title:h(`bulkDelete`),children:[(0,U.jsx)(Re,{size:14}),(0,U.jsx)(`span`,{children:h(`bulkDelete`)})]})]}),(0,U.jsxs)(`div`,{className:`ue-gallery-inspector-tools`,children:[(0,U.jsxs)(`div`,{className:`ue-bulk-tool`,children:[(0,U.jsxs)(`span`,{className:`ue-bulk-tool-title`,children:[(0,U.jsx)(Le,{size:13}),h(`bulkSetCategory`)]}),(0,U.jsxs)(`div`,{className:`ue-bulk-tool-field`,children:[(0,U.jsx)(`label`,{className:`ue-select-field ue-select-field--input`,children:(0,U.jsx)(`input`,{value:b,onChange:e=>x(e.target.value),placeholder:h(`galleryCategoryPlaceholder`)})}),(0,U.jsxs)(`button`,{className:`ue-icon-action ue-icon-action--filled`,onClick:()=>void re(),"aria-label":h(`bulkSetCategory`),title:h(`bulkSetCategory`),disabled:!b.trim(),children:[(0,U.jsx)(k,{size:14}),(0,U.jsx)(`span`,{children:h(`bulkSetCategory`)})]})]})]}),(0,U.jsxs)(`div`,{className:`ue-bulk-tool`,children:[(0,U.jsxs)(`span`,{className:`ue-bulk-tool-title`,children:[(0,U.jsx)(fe,{size:13}),h(`bulkMoveTo`)]}),(0,U.jsxs)(`div`,{className:`ue-bulk-tool-field`,children:[(0,U.jsx)(`label`,{className:`ue-select-field ue-select-field--input`,children:(0,U.jsxs)(`select`,{value:S,onChange:e=>C(e.target.value),children:[(0,U.jsx)(`option`,{value:``,disabled:!0,children:h(`bulkMoveTo`)}),j.map(e=>(0,U.jsx)(`option`,{value:e.value,children:e.label},e.value))]})}),(0,U.jsxs)(`button`,{className:`ue-icon-action ue-icon-action--filled`,onClick:()=>void P(),"aria-label":h(`bulkMoveTo`),title:h(`bulkMoveTo`),disabled:!S,children:[(0,U.jsx)(k,{size:14}),(0,U.jsx)(`span`,{children:h(`bulkMoveTo`)})]})]})]}),(0,U.jsxs)(`div`,{className:`ue-bulk-tool ue-bulk-tool--rename`,children:[(0,U.jsxs)(`span`,{className:`ue-bulk-tool-title`,children:[(0,U.jsx)(Ee,{size:13}),h(`bulkRenameApply`)]}),(0,U.jsxs)(`div`,{className:`ue-bulk-tool-field`,children:[(0,U.jsx)(`label`,{className:`ue-select-field ue-select-field--input ue-bulk-rename-field`,children:(0,U.jsx)(`input`,{value:w,onChange:e=>T(e.target.value),placeholder:h(`bulkRenameTemplatePlaceholder`)})}),(0,U.jsxs)(`label`,{className:`ue-select-field ue-bulk-number-field`,children:[(0,U.jsx)(`span`,{children:h(`bulkRenameStart`)}),(0,U.jsx)(`input`,{type:`number`,min:0,value:E,onChange:e=>D(Number(e.target.value)||0)})]}),(0,U.jsxs)(`label`,{className:`ue-select-field ue-bulk-number-field`,children:[(0,U.jsx)(`span`,{children:h(`bulkRenamePadding`)}),(0,U.jsx)(`input`,{type:`number`,min:1,max:8,value:O,onChange:e=>ee(Number(e.target.value)||1)})]}),(0,U.jsxs)(`button`,{className:`ue-icon-action ue-icon-action--accent`,onClick:()=>void F(),"aria-label":h(`bulkRenameApply`),title:h(`bulkRenameRuleHint`),disabled:!w.trim(),children:[(0,U.jsx)(Ee,{size:13}),(0,U.jsx)(`span`,{children:h(`bulkRenameApply`)})]})]})]})]}),(0,U.jsxs)(`div`,{className:`ue-gallery-inspector-note`,children:[(0,U.jsx)(`strong`,{children:h(`bulkRenameRuleTitle`)}),(0,U.jsx)(`span`,{children:h(`bulkRenameRuleHint`)})]})]}),(0,U.jsx)(Sn,{open:v.length>0,boards:i,selectedCount:v.length,onClose:()=>y([]),onCreateBoard:l,onAddToBoard:M})]})},qr=e=>{try{let t=new URL(e);return[`http:`,`https:`].includes(t.protocol)?t.href:void 0}catch{return}},Jr=e=>e.split(/(`[^`]+`|\[[^\]]+\]\([^\s)]+\))/g).map((e,t)=>{if(e.startsWith("`"))return(0,U.jsx)(`code`,{children:e.slice(1,-1)},t);let n=/^\[([^\]]+)\]\(([^)]+)\)$/.exec(e);if(n){let e=qr(n[2]);return e?(0,U.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,children:n[1]},t):n[1]}return e}),Yr=({body:e})=>{let t=e.split(/\r?\n/),n=[],r=[],i=()=>{r.length&&n.push((0,U.jsx)(`ul`,{children:r},`list-${n.length}`)),r=[]};return t.forEach((e,t)=>{/^\s*[-*] /.test(e)?r.push((0,U.jsx)(`li`,{children:Jr(e.replace(/^\s*[-*] /,``))},t)):(i(),/^#{1,6} /.test(e)?n.push((0,U.jsx)(`h3`,{children:Jr(e.replace(/^#{1,6} /,``))},t)):e.trim()&&n.push((0,U.jsx)(`p`,{children:Jr(e)},t)))}),i(),(0,U.jsx)(`div`,{className:`ue-release-markdown`,children:n})},Xr=null,Zr=e=>{if(!e)return!1;let t=Xr??[];try{let e=JSON.parse(Et(`universal-extractor:seen-releases`)||`null`);Array.isArray(e)&&(t=e.filter(e=>typeof e==`string`).slice(-20))}catch{}let n=t.length>0&&!t.includes(e);return Xr=[...t.filter(t=>t!==e),e].slice(-20),Dt(`universal-extractor:seen-releases`,JSON.stringify(Xr)),n},Qr=({activeTab:e,onTabChange:t,searchValue:r,onSearchChange:i,onRefresh:a,sidebarCollapsed:o,onSidebarToggle:s})=>{let{locale:c,setLocale:l,t:u}=n(),[d,f]=(0,p.useState)(!1),[m,h]=(0,p.useState)(r),[g,_]=(0,p.useState)(!1),[v,y]=(0,p.useState)(null),[b,x]=(0,p.useState)(null),[w,E]=(0,p.useState)(!1),[D,O]=(0,p.useState)(``),[k,te]=(0,p.useState)(!1),[A,j]=(0,p.useState)(!1),[M,ne]=(0,p.useState)({x:12,y:56}),N=(0,p.useRef)(null),P=(0,p.useRef)(!1),F=(0,p.useRef)(null),I=e===`library`,re=I&&(d||!!r.trim()),R=!!v?.update_available;C(A,(0,p.useCallback)(()=>j(!1),[]),{closeOnScroll:!0});let z=(0,p.useCallback)(async(e=!1)=>{te(!0),O(``);try{let t=await K.getUpdateStatus(e);y(t),O(t.error||``)}catch(e){O(e instanceof Error?e.message:u(`updatesCheckFailed`))}finally{te(!1)}},[u]);(0,p.useEffect)(()=>{z(!1)},[z]),(0,p.useEffect)(()=>{let e=!1;if(typeof K.getReleaseNotes==`function`)return K.getReleaseNotes(c).then(t=>{e||(x(t),Zr(t.current_version)&&E(!0))}).catch(()=>void 0),()=>{e=!0}},[c]),(0,p.useEffect)(()=>{g||h(r)},[g,r]),(0,p.useEffect)(()=>{re&&N.current?.focus()},[re]),(0,p.useEffect)(()=>{I||f(!1)},[I]);let ie=()=>{l(c===`zh-CN`?`en`:`zh-CN`)},ae=e=>{e.stopPropagation();let t=F.current?.getBoundingClientRect();if(t){let e=Math.min(400,window.innerWidth-24),n=Math.max(12,Math.min(window.innerWidth-e-12,t.right-e)),r=Math.min(Math.max(12,window.innerHeight-560-12),t.bottom+8);ne({x:n,y:r})}j(e=>!e),E(!1)},oe=e=>{if(!e)return``;let t=new Date(e);return Number.isNaN(t.getTime())?``:new Intl.DateTimeFormat(c,{month:`short`,day:`numeric`}).format(t)};return(0,U.jsxs)(`header`,{className:`ue-topbar`,children:[(0,U.jsxs)(`div`,{className:`ue-topbar-brand`,children:[(0,U.jsx)(`button`,{className:`ue-topbar-icon-btn`,onClick:s,"aria-label":u(`navToggleSidebar`),title:u(`navToggleSidebar`),"data-tour-id":`topbar-sidebar-toggle`,children:o?(0,U.jsx)(Te,{size:16}):(0,U.jsx)(we,{size:16})}),(0,U.jsx)(`strong`,{children:`Universal`}),(0,U.jsx)(`span`,{className:`ue-topbar-scope`,children:u(`topStatus`,{tab:e})})]}),(0,U.jsx)(yr,{tourId:`workspace-switcher`,label:u(`workspaceSwitch`),icon:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{children:u(e===`gallery`?`navGallery`:e===`library`?`navLibrary`:e===`workbench`?`navWorkbench`:`navSettings`)}),(0,U.jsx)(ee,{size:14})]}),className:`ue-workspace-switcher`,children:(0,U.jsxs)(`nav`,{className:`ue-topbar-tabs`,"aria-label":u(`workspaceSwitch`),"data-tour-id":`topbar-tabs`,children:[(0,U.jsxs)(`button`,{className:`ue-topbar-tab ${e===`gallery`?`active`:``}`,onClick:()=>t(`gallery`),"aria-current":e===`gallery`?`page`:void 0,"aria-label":u(`navGallery`),"aria-describedby":`ue-workspace-desc-gallery`,children:[(0,U.jsx)(ge,{size:16}),(0,U.jsxs)(`span`,{className:`ue-workspace-option-copy`,children:[(0,U.jsx)(`strong`,{children:u(`navGallery`)}),(0,U.jsx)(`small`,{id:`ue-workspace-desc-gallery`,children:u(`workspaceDesc_gallery`)})]})]}),(0,U.jsxs)(`button`,{className:`ue-topbar-tab ${e===`library`?`active`:``}`,onClick:()=>t(`library`),"aria-current":e===`library`?`page`:void 0,"aria-label":u(`navLibrary`),"aria-describedby":`ue-workspace-desc-library`,children:[(0,U.jsx)(_e,{size:16}),(0,U.jsxs)(`span`,{className:`ue-workspace-option-copy`,children:[(0,U.jsx)(`strong`,{children:u(`navLibrary`)}),(0,U.jsx)(`small`,{id:`ue-workspace-desc-library`,children:u(`workspaceDesc_library`)})]})]}),(0,U.jsxs)(`button`,{className:`ue-topbar-tab ${e===`workbench`?`active`:``}`,onClick:()=>t(`workbench`),"aria-current":e===`workbench`?`page`:void 0,"aria-label":u(`navWorkbench`),"aria-describedby":`ue-workspace-desc-workbench`,children:[(0,U.jsx)(Ve,{size:16}),(0,U.jsxs)(`span`,{className:`ue-workspace-option-copy`,children:[(0,U.jsx)(`strong`,{children:u(`navWorkbench`)}),(0,U.jsx)(`small`,{id:`ue-workspace-desc-workbench`,children:u(`workspaceDesc_workbench`)})]})]}),(0,U.jsxs)(`button`,{className:`ue-topbar-tab ${e===`settings`?`active`:``}`,onClick:()=>t(`settings`),"aria-current":e===`settings`?`page`:void 0,"aria-label":u(`navSettings`),"aria-describedby":`ue-workspace-desc-settings`,children:[(0,U.jsx)(Me,{size:16}),(0,U.jsxs)(`span`,{className:`ue-workspace-option-copy`,children:[(0,U.jsx)(`strong`,{children:u(`navSettings`)}),(0,U.jsx)(`small`,{id:`ue-workspace-desc-settings`,children:u(`workspaceDesc_settings`)})]})]})]})}),(0,U.jsxs)(`div`,{className:`ue-topbar-tools`,children:[I?(0,U.jsxs)(`div`,{className:`ue-topbar-search-wrap ${re?`is-open`:``}`,"data-tour-id":`topbar-search`,children:[(0,U.jsx)(`button`,{className:`ue-topbar-icon-btn ${re?`is-active`:``}`,onClick:()=>f(e=>!e),"aria-label":u(`navToggleSearch`),title:u(`navToggleSearch`),children:(0,U.jsx)(Ae,{size:16})}),(0,U.jsx)(`label`,{className:`ue-topbar-search`,htmlFor:`ue-topbar-search`,children:(0,U.jsx)(`input`,{ref:N,id:`ue-topbar-search`,value:m,placeholder:u(`navSearchLibraryPlaceholder`),onCompositionStart:()=>{P.current=!0,_(!0)},onCompositionEnd:e=>{P.current=!1,_(!1),h(e.currentTarget.value),i(e.currentTarget.value)},onChange:e=>{h(e.target.value),!P.current&&!e.nativeEvent.isComposing&&i(e.target.value)}})})]}):null,(0,U.jsx)(`button`,{className:`ue-topbar-icon-btn ue-locale-toggle`,onClick:ie,"aria-label":u(`navLanguage`),title:u(c===`zh-CN`?`navSwitchToEnglish`:`navSwitchToChinese`),"data-tour-id":`topbar-language`,children:(0,U.jsx)(`span`,{children:u(c===`zh-CN`?`navLanguageZhShort`:`navLanguageEnShort`)})}),(0,U.jsx)(`button`,{className:`ue-topbar-icon-btn`,onClick:a,"aria-label":u(`navRefresh`),title:u(`navRefresh`),"data-tour-id":`topbar-refresh`,children:(0,U.jsx)(Oe,{size:16})}),w&&(0,U.jsx)(`button`,{className:`ue-release-notice`,onClick:ae,children:u(`updatesInstalledNotes`,{version:b?.current_version||``})}),(0,U.jsxs)(`button`,{ref:F,className:`ue-topbar-icon-btn ue-update-bell ${A?`is-open`:``} ${R?`has-update`:``}`,onClick:ae,"aria-label":u(`updatesTitle`),title:u(`updatesTitle`),"data-tour-id":`topbar-updates`,children:[(0,U.jsx)(T,{size:16}),R&&(0,U.jsx)(`span`,{className:`ue-update-dot`,"aria-hidden":`true`})]})]}),A&&(0,U.jsx)(S,{children:(0,U.jsxs)(`section`,{className:`ue-update-popover`,style:{left:M.x,top:M.y},onClick:e=>e.stopPropagation(),"aria-label":u(`updatesTitle`),children:[(0,U.jsxs)(`header`,{className:`ue-update-popover-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:u(`updatesTitle`)}),(0,U.jsx)(`span`,{children:u(k?`updatesChecking`:D?`updatesCheckFailed`:v?.check_status===`preview`?`updatesPreview`:R?`updatesAvailable`:v?.check_status===`cached`?`updatesCached`:v?`updatesCurrent`:`updatesLocalOnly`)})]}),(0,U.jsx)(`button`,{type:`button`,className:`ue-icon-action`,onClick:()=>void z(!0),disabled:k,"aria-label":u(`updatesCheckNow`),title:u(`updatesCheckNow`),children:k?(0,U.jsx)(xe,{className:`ue-spin`,size:16}):(0,U.jsx)(Oe,{size:16})})]}),(0,U.jsxs)(`div`,{className:`ue-update-version-box`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{children:u(`updatesCurrentVersion`)}),(0,U.jsx)(`strong`,{children:b?.current_version||v?.current_version||`-`})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{children:u(`updatesLatestVersion`)}),(0,U.jsx)(`strong`,{className:R?`is-new`:``,children:v?.latest_version||`-`})]}),(0,U.jsxs)(`a`,{className:`ue-secondary-btn`,href:qr(v?.release_url||v?.repository_url||`https://github.com/Tera-Dark/ComfyUI-Universal-Extractor`),target:`_blank`,rel:`noreferrer`,children:[(0,U.jsx)(L,{size:16}),(0,U.jsx)(`span`,{children:u(`updatesOpenGithub`)})]})]}),D&&(0,U.jsx)(`p`,{className:`ue-update-error`,children:D}),(0,U.jsxs)(`div`,{className:`ue-update-log`,children:[(0,U.jsx)(`h2`,{children:u(`updatesChangelog`)}),v?.last_success_at?(0,U.jsxs)(`small`,{children:[u(`updatesLastSuccess`),`: `,new Date(v.last_success_at*1e3).toLocaleString(c)]}):null,(()=>{let e=b?.current_version||v?.current_version,t=[...b?.releases||[]];for(let e of v?.releases||[])t.some(t=>t.version===e.version)||t.push(e);return t.sort((t,n)=>Number(n.version===e)-Number(t.version===e)),t.length?t.map(t=>(0,U.jsxs)(`details`,{className:`ue-update-release`,open:t.version===e||void 0,children:[(0,U.jsxs)(`summary`,{className:`ue-update-release-title`,children:[(0,U.jsxs)(`strong`,{children:[t.version===e?u(`updatesInstalled`):u(R&&t.version===v?.latest_version?`updatesAvailable`:`updatesHistory`),` · `,t.name||t.version]}),(0,U.jsx)(`span`,{children:oe(t.published_at)})]}),(0,U.jsx)(Yr,{body:t.body||u(`updatesNoChangelog`)})]},t.version)):(0,U.jsx)(`p`,{className:`ue-update-empty`,children:u(k?`updatesChecking`:`updatesNoChangelog`)})})()]})]})})]})},$r=({node:e,depth:t,expandedPaths:n,selectedSubfolder:r,onToggle:i,onSelect:a,onContextMenu:o,onFolderDragStart:s,onFolderDragEnd:c,onFolderDragOver:l,onFolderDrop:u,canDragFolder:d,pinnedFolders:f,searchActive:p,draggingPath:m,dropTargetPath:h})=>{let g=e.children.length>0,_=p||n.has(e.path),v=Yt(e.path,f),y=g&&_?ie:ce;return(0,U.jsxs)(`div`,{className:`ue-tree-branch`,children:[(0,U.jsxs)(`div`,{className:`ue-tree-row ${r===e.path?`active`:``}`,children:[g?(0,U.jsx)(`button`,{className:`ue-tree-toggle ${_?`is-expanded`:``}`,onClick:()=>i(e.path),"aria-label":_?`Collapse folder`:`Expand folder`,children:(0,U.jsx)(A,{size:12})}):(0,U.jsx)(`span`,{className:`ue-tree-spacer`,"aria-hidden":`true`}),(0,U.jsxs)(`button`,{className:`ue-tree-label ${v?`is-pinned`:``} ${m===e.path?`is-dragging`:``} ${h===e.path?`is-drop-target`:``}`,onClick:()=>a(e.path),onContextMenu:t=>o(t,e.path),draggable:d(e.path),onDragStart:t=>s(t,e.path),onDragEnd:c,onDragOver:t=>l(t,e.path),onDrop:t=>u(t,e.path),title:e.path,children:[(0,U.jsx)(y,{size:15}),(0,U.jsx)(`span`,{children:e.name}),v?(0,U.jsx)(`span`,{className:`ue-pin-dot`,"aria-hidden":`true`}):null]})]}),g&&_?(0,U.jsx)(`div`,{className:`ue-tree-children`,children:e.children.map(e=>(0,U.jsx)($r,{node:e,depth:t+1,expandedPaths:n,selectedSubfolder:r,onToggle:i,onSelect:a,onContextMenu:o,onFolderDragStart:s,onFolderDragEnd:c,onFolderDragOver:l,onFolderDrop:u,canDragFolder:d,pinnedFolders:f,searchActive:p,draggingPath:m,dropTargetPath:h},e.path))}):null]})},ei=({collapsed:e,onToggle:t,activeTab:r,galleryContext:i,folderViewMode:a,onFolderViewModeChange:o,selectedCategory:s,selectedSubfolder:c,selectedBoardId:l,pinnedOnly:u,onCategorySelect:d,onSubfolderSelect:f,onBoardSelect:m,onPinnedOnlySelect:h,onCreateBoard:g,onCreateFolder:_,onDeleteFolder:v,onMergeFolder:y,onRenameFolder:b,onMoveFolder:T,libraries:D,activeLibraryName:O,onLibrarySelect:k,onLibraryDelete:te,draftName:j,onDraftNameChange:ne,onCreateLibrary:N})=>{let{t:P}=n(),F=i?.boards??[],[L,re]=(0,p.useState)(()=>Lt()),[R,z]=(0,p.useState)(()=>Rt()),[oe,le]=(0,p.useState)(null),[de,fe]=(0,p.useState)(null),[me,he]=(0,p.useState)(``),[ge,_e]=(0,p.useState)(``),[ve,be]=(0,p.useState)(``),[xe,Ce]=(0,p.useState)(()=>new Set([`folders`,`boards`,`categories`])),B=c===`__trash__`?jt:Wt(c),we=(0,p.useMemo)(()=>(i?.sources??[]).find(e=>e.id===B)??null,[B,i?.sources]),Te=!!(we?.enabled&&we.exists&&we.writable),V=!(!c||c===`__trash__`||Gt(c)),Oe=Te&&V&&Wt(c)===B,ke=(0,p.useMemo)(()=>new Map((i?.sources??[]).map(e=>[e.id,e])),[i?.sources]),je=(0,p.useMemo)(()=>an(i?.subfolders??[],B),[B,i?.subfolders]),Me=(0,p.useMemo)(()=>new Map((i?.subfolder_details??[]).map(e=>{let t=Number(e.modified_at);return[e.path,Number.isFinite(t)?t:0]})),[i?.subfolder_details]),Ne=(0,p.useMemo)(()=>rn(je,me),[me,je]),Pe=(0,p.useMemo)(()=>a===`tree`?[]:[...Ne].sort(Zt(L,R,Me)),[a,Me,R,L,Ne]),Fe=(0,p.useCallback)((e,t)=>e?.id===`default_output`||e?.kind===`output`?P(`sidebarOutputSource`):e?.kind===`input`?P(`sidebarInputSource`):e?.name||t,[P]),Ie=(0,p.useMemo)(()=>(i?.sources??[]).filter(e=>e.enabled&&e.exists),[i?.sources]),Be=we?.kind===`input`?P(`sidebarInputDirs`):we?.kind===`custom`?P(`sidebarCustomDirs`):P(`sidebarOutputDirs`),Ve=we?.kind===`input`?P(`sidebarInputReadOnly`):P(`sidebarSourceReadOnly`),He=(0,p.useMemo)(()=>a===`tree`?tn(Ne,L,R,i?.sources??[],Fe,B,Me):[],[B,a,Me,R,i?.sources,Fe,L,Ne]),[W,Ue]=(0,p.useState)(new Set),We=me.trim().length>0;(0,p.useEffect)(()=>{Dt(Ft,JSON.stringify([...L]))},[L]),(0,p.useEffect)(()=>{Dt(It,R)},[R]);let Ge=(0,p.useCallback)(()=>le(null),[]);C(!!oe,Ge,{closeOnContextMenu:!0,closeOnScroll:!0});let Ke=(0,p.useCallback)(()=>fe(null),[]);C(!!de,Ke,{closeOnContextMenu:!0,closeOnScroll:!0}),(0,p.useEffect)(()=>{Ue(new Set)},[i?.output_dir_absolute]),(0,p.useEffect)(()=>{c&&Ue(e=>{let t=new Set(e);return nn(c).forEach(e=>t.add(e)),t})},[c]);let qe=e=>{Ue(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},Je=()=>{Ue(new Set)},Ye=()=>{Ue(new Set(on(He)))},Xe=(e,t)=>{e.preventDefault(),e.stopPropagation();let n=x(e,{width:220,height:220},`pointer`);le({path:t,x:n.x,y:n.y})},G=e=>{e.preventDefault(),e.stopPropagation();let t=x(e,{width:220,height:a===`tree`?340:250});fe(e=>e?null:t)},K=e=>{e(),Ke()},Ze=e=>{re(t=>{let n=new Set(t),r=Jt(e);return r.some(e=>n.has(e))?r.forEach(e=>n.delete(e)):n.add(e),n})},Qe=()=>{z(e=>e===`modified`?`name`:`modified`)},$e=(0,p.useCallback)(e=>{if(!e||e===`__trash__`||Gt(e))return!1;let t=ke.get(Wt(e));return!!(t?.enabled&&t.exists&&t.writable)},[ke]),et=(0,p.useCallback)((e,t)=>{if(!$e(e)||!$e(t)||e===t||!Kt(e,t)||qt(t,e))return``;let n=Ht(e);if(!n)return``;let r=Ut(t,n);return r===e||je.includes(r)?``:r},[$e,je]),tt=(e,t)=>{$e(t)?(e.stopPropagation(),e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`application/x-universal-gallery-folder`,t),e.dataTransfer.setData(`text/plain`,t),_e(t),be(``)):e.preventDefault()},nt=()=>{_e(``),be(``)},rt=(e,t)=>{let n=ge||e.dataTransfer.getData(`application/x-universal-gallery-folder`);et(n,t)?(e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect=`move`,be(t),Ue(e=>{if(e.has(t))return e;let n=new Set(e);return n.add(t),n})):be(e=>e===t?``:e)},it=(e,t)=>{let n=ge||e.dataTransfer.getData(`application/x-universal-gallery-folder`),r=et(n,t);r?(e.preventDefault(),e.stopPropagation(),nt(),T(n,r)):nt()},at=e=>{Ce(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},ot=Bt(B);return(0,U.jsxs)(`aside`,{className:`ue-sidebar ${e?`is-collapsed`:``}`,"data-tour-id":`sidebar`,inert:e,"aria-hidden":e,children:[(0,U.jsx)(`button`,{className:`ue-mobile-sidebar-close`,onClick:t,"aria-label":P(`navToggleSidebar`),children:(0,U.jsx)(H,{size:18})}),(0,U.jsx)(`button`,{className:`ue-sidebar-toggle-edge`,onClick:t,"aria-label":P(e?`sidebarExpand`:`sidebarCollapse`),title:P(e?`sidebarExpand`:`sidebarCollapse`),children:(0,U.jsx)(A,{size:14,className:`ue-sidebar-toggle-icon`})}),r===`gallery`?(0,U.jsxs)(`div`,{className:`ue-sidebar-section ue-sidebar-section--grow`,children:[(0,U.jsxs)(`div`,{className:`ue-sidebar-heading`,children:[(0,U.jsx)(`span`,{children:P(`sidebarResources`)}),(0,U.jsx)(`strong`,{children:i?.active_source_count??0})]}),(0,U.jsxs)(`div`,{className:`ue-sidebar-quick`,"data-tour-id":`sidebar-quick`,children:[(0,U.jsx)(`div`,{className:`ue-sidebar-quick-label`,children:P(`sidebarQuickAccess`)}),Ie.length>0?Ie.map(e=>{let t=Bt(e.id),n=B===e.id&&c!==`__trash__`&&l===``&&!u,r=e.kind===`input`?pe:e.kind===`custom`?ce:ue;return(0,U.jsxs)(`button`,{className:`ue-tree-item ue-tree-item--root ${n?`active`:``}`,onClick:()=>f(t),title:e.path,children:[(0,U.jsx)(r,{size:15}),(0,U.jsx)(`span`,{children:Fe(e,e.id)})]},e.id)}):(0,U.jsxs)(`button`,{className:`ue-tree-item ue-tree-item--root ${c===``&&l===``&&!u?`active`:``}`,onClick:()=>f(``),children:[(0,U.jsx)(ue,{size:15}),(0,U.jsx)(`span`,{children:i?.output_dir_relative||`./output`})]}),(0,U.jsxs)(`button`,{className:`ue-tree-item ue-tree-item--root ${c===`__trash__`&&l===``?`active`:``}`,onClick:()=>f(`__trash__`),children:[(0,U.jsx)(ze,{size:15}),(0,U.jsx)(`span`,{children:P(`sidebarTrash`)})]})]}),(0,U.jsxs)(`div`,{className:`ue-sidebar-scroll`,"data-has-query":We?`true`:`false`,children:[(0,U.jsxs)(`div`,{className:`ue-sidebar-group`,"data-tour-id":`sidebar-folders`,children:[(0,U.jsxs)(`div`,{className:`ue-sidebar-group-header ue-sidebar-group-header--folders`,children:[(0,U.jsxs)(`button`,{className:`ue-sidebar-group-title`,onClick:()=>at(`folders`),"aria-expanded":xe.has(`folders`),children:[(0,U.jsx)(`span`,{className:`ue-sidebar-group-chevron`,children:xe.has(`folders`)?(0,U.jsx)(ee,{size:13}):(0,U.jsx)(A,{size:13})}),(0,U.jsx)(`span`,{className:`ue-sidebar-group-icon`,children:we?.kind===`input`?(0,U.jsx)(pe,{size:14}):we?.kind===`custom`?(0,U.jsx)(ie,{size:14}):(0,U.jsx)(ue,{size:14})}),(0,U.jsx)(`strong`,{className:`ue-sidebar-group-name`,children:Be}),(0,U.jsx)(`span`,{className:`ue-sidebar-count-badge`,children:je.length})]}),(0,U.jsxs)(`div`,{className:`ue-sidebar-subactions`,children:[Te?(0,U.jsx)(`button`,{className:`ue-sidebar-subaction`,onClick:_,title:P(`sidebarCreateFolder`),"aria-label":P(`sidebarCreateFolder`),children:(0,U.jsx)(ae,{size:14})}):(0,U.jsx)(`button`,{className:`ue-sidebar-subaction`,disabled:!0,title:Ve,"aria-label":Ve,children:(0,U.jsx)(ae,{size:14})}),(0,U.jsx)(`div`,{className:`ue-sidebar-more`,children:(0,U.jsx)(`button`,{className:`ue-sidebar-subaction ${de?`active`:``}`,onClick:G,title:P(`sidebarMoreActions`),"aria-label":P(`sidebarMoreActions`),children:(0,U.jsx)(I,{size:14})})})]})]}),xe.has(`folders`)?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`ue-sidebar-folder-toolbar`,children:(0,U.jsxs)(`label`,{className:`ue-sidebar-search`,children:[(0,U.jsx)(Ae,{size:13}),(0,U.jsx)(`input`,{value:me,placeholder:P(`sidebarFolderSearch`),onChange:e=>he(e.target.value)}),We?(0,U.jsx)(`button`,{type:`button`,onClick:()=>he(``),title:P(`sidebarClearFolderSearch`),"aria-label":P(`sidebarClearFolderSearch`),children:(0,U.jsx)(H,{size:12})}):null]})}),We&&Ne.length===0?(0,U.jsx)(`div`,{className:`ue-sidebar-empty`,children:P(`sidebarNoFolderMatches`)}):a===`tree`?(0,U.jsx)(`div`,{className:`ue-tree-panel`,children:He.map(e=>(0,U.jsx)($r,{node:e,depth:0,expandedPaths:W,selectedSubfolder:c,onToggle:qe,onSelect:f,onContextMenu:Xe,onFolderDragStart:tt,onFolderDragEnd:nt,onFolderDragOver:rt,onFolderDrop:it,canDragFolder:$e,pinnedFolders:L,searchActive:We,draggingPath:ge,dropTargetPath:ve},e.path))}):(0,U.jsxs)(`div`,{className:`ue-tree-list ue-tree-list--flat`,children:[We?null:(0,U.jsxs)(`button`,{className:`ue-tree-item ue-tree-item--compact ${c===ot&&l===``&&!u?`active`:``}`,onClick:()=>f(ot),children:[(0,U.jsx)(ce,{size:15}),(0,U.jsx)(`span`,{children:`./`})]}),Pe.map(e=>(0,U.jsxs)(`button`,{className:`ue-tree-item ue-tree-item--compact ${c===e?`active`:``} ${Yt(e,L)?`is-pinned`:``} ${ge===e?`is-dragging`:``} ${ve===e?`is-drop-target`:``}`,onClick:()=>f(e),onContextMenu:t=>Xe(t,e),draggable:$e(e),onDragStart:t=>tt(t,e),onDragEnd:nt,onDragOver:t=>rt(t,e),onDrop:t=>it(t,e),title:e,children:[(0,U.jsx)(ce,{size:15}),(0,U.jsx)(`span`,{children:$t(e,i?.sources??[],Fe,B)}),Yt(e,L)?(0,U.jsx)(`span`,{className:`ue-pin-dot`,"aria-hidden":`true`}):null]},e))]})]}):null]}),(0,U.jsxs)(`div`,{className:`ue-sidebar-group`,children:[(0,U.jsxs)(`div`,{className:`ue-sidebar-group-header`,children:[(0,U.jsxs)(`button`,{className:`ue-sidebar-group-title`,onClick:()=>at(`boards`),"aria-expanded":xe.has(`boards`),children:[(0,U.jsx)(`span`,{className:`ue-sidebar-group-chevron`,children:xe.has(`boards`)?(0,U.jsx)(ee,{size:13}):(0,U.jsx)(A,{size:13})}),(0,U.jsx)(`span`,{className:`ue-sidebar-group-icon`,children:(0,U.jsx)(pe,{size:14})}),(0,U.jsx)(`strong`,{className:`ue-sidebar-group-name`,children:P(`sidebarBoards`)}),(0,U.jsx)(`span`,{className:`ue-sidebar-count-badge`,children:F.length})]}),(0,U.jsx)(`div`,{className:`ue-sidebar-subactions`,children:(0,U.jsx)(`button`,{className:`ue-sidebar-subaction`,onClick:g,title:P(`sidebarCreateBoard`),"aria-label":P(`sidebarCreateBoard`),children:(0,U.jsx)(ae,{size:14})})})]}),xe.has(`boards`)?(0,U.jsxs)(`div`,{className:`ue-board-list`,children:[(0,U.jsxs)(`button`,{className:`ue-board-list-item ${l===``&&u?`active`:``}`,onClick:h,children:[(0,U.jsx)(`span`,{className:`ue-board-cover ue-board-cover--empty`,children:(0,U.jsx)(De,{size:14})}),(0,U.jsx)(`span`,{children:P(`sidebarAllPins`)}),(0,U.jsx)(`em`,{children:i?.pinned_count??0})]}),F.map(e=>(0,U.jsxs)(`button`,{className:`ue-board-list-item ${l===e.id?`active`:``}`,onClick:()=>m(e.id),title:e.name,children:[(0,U.jsx)(`span`,{className:`ue-board-cover`,children:e.cover_image?(0,U.jsx)(`img`,{src:e.cover_image.thumb_url,alt:``,loading:`lazy`}):(0,U.jsx)(pe,{size:14})}),(0,U.jsx)(`span`,{children:e.name}),(0,U.jsx)(`em`,{children:e.count})]},e.id))]}):null]}),(0,U.jsxs)(`div`,{className:`ue-sidebar-group`,children:[(0,U.jsx)(`div`,{className:`ue-sidebar-group-header`,children:(0,U.jsxs)(`button`,{className:`ue-sidebar-group-title`,onClick:()=>at(`categories`),"aria-expanded":xe.has(`categories`),children:[(0,U.jsx)(`span`,{className:`ue-sidebar-group-chevron`,children:xe.has(`categories`)?(0,U.jsx)(ee,{size:13}):(0,U.jsx)(A,{size:13})}),(0,U.jsx)(`span`,{className:`ue-sidebar-group-icon`,children:(0,U.jsx)(Le,{size:14})}),(0,U.jsx)(`strong`,{className:`ue-sidebar-group-name`,children:P(`galleryAllCategories`)}),(0,U.jsx)(`span`,{className:`ue-sidebar-count-badge`,children:i?.categories.length??0})]})}),xe.has(`categories`)?(0,U.jsxs)(`div`,{className:`ue-tree-list ue-tree-list--compact`,children:[(0,U.jsxs)(`button`,{className:`ue-tree-item ue-tree-item--compact ${s===``?`active`:``}`,onClick:()=>d(``),children:[(0,U.jsx)(Le,{size:14}),(0,U.jsx)(`span`,{children:P(`galleryAllCategories`)})]}),(i?.categories??[]).map(e=>(0,U.jsxs)(`button`,{className:`ue-tree-item ue-tree-item--compact ${s===e?`active`:``}`,onClick:()=>d(e),children:[(0,U.jsx)(Le,{size:14}),(0,U.jsx)(`span`,{children:e})]},e))]}):null]})]})]}):(0,U.jsxs)(`div`,{className:`ue-sidebar-section ue-sidebar-section--grow`,children:[(0,U.jsxs)(`div`,{className:`ue-sidebar-heading`,children:[(0,U.jsx)(`span`,{children:P(`sidebarLibraries`)}),(0,U.jsx)(`span`,{children:D.length})]}),(0,U.jsxs)(`div`,{className:`ue-library-list`,role:`list`,"aria-label":P(`sidebarLibraries`),children:[D.length===0?(0,U.jsx)(`div`,{className:`ue-sidebar-empty`,children:P(`sidebarNoLibraries`)}):null,D.map(e=>(0,U.jsxs)(`div`,{role:`listitem`,className:`ue-library-list-item ${O===e.filename?`active`:``}`,children:[(0,U.jsxs)(`button`,{type:`button`,className:`ue-library-main`,"aria-current":O===e.filename?`page`:void 0,onClick:()=>k(e.filename),children:[(0,U.jsx)(E,{size:14}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`strong`,{children:e.filename}),(0,U.jsx)(`small`,{children:P(`commonEntries`,{count:e.count})})]})]}),(0,U.jsx)(`button`,{type:`button`,className:`ue-library-delete`,onClick:()=>te(e.filename),"aria-label":`${P(`commonDelete`)} ${e.filename}`,children:(0,U.jsx)(Re,{size:14})})]},e.filename))]}),(0,U.jsxs)(`div`,{className:`ue-sidebar-create`,children:[(0,U.jsx)(`label`,{htmlFor:`ue-library-name`,children:P(`sidebarCreateLibrary`)}),(0,U.jsxs)(`div`,{className:`ue-sidebar-create-row`,children:[(0,U.jsx)(`input`,{id:`ue-library-name`,value:j,placeholder:P(`sidebarCreateLibraryPlaceholder`),onChange:e=>ne(e.target.value),onKeyDown:e=>{e.key===`Enter`&&N()}}),(0,U.jsx)(`button`,{onClick:N,"aria-label":P(`commonCreate`),children:(0,U.jsx)(ae,{size:15})})]})]})]}),de?(0,U.jsx)(S,{children:(0,U.jsxs)(`div`,{className:`ue-sidebar-action-menu`,style:{top:de.y,left:de.x},onClick:e=>e.stopPropagation(),onContextMenu:e=>e.preventDefault(),children:[(0,U.jsxs)(`button`,{onClick:()=>K(()=>o(a===`tree`?`list`:`tree`)),children:[(0,U.jsx)(se,{size:14}),(0,U.jsx)(`span`,{children:P(a===`tree`?`sidebarListView`:`sidebarTreeView`)})]}),a===`tree`?(0,U.jsxs)(`button`,{onClick:()=>K(Ye),children:[(0,U.jsx)(M,{size:14}),(0,U.jsx)(`span`,{children:P(`sidebarExpandAll`)})]}):null,(0,U.jsxs)(`button`,{onClick:()=>K(Qe),children:[(0,U.jsx)(ye,{size:14}),(0,U.jsx)(`span`,{children:P(R===`modified`?`folderSortByName`:`folderSortByModified`)})]}),(0,U.jsxs)(`button`,{onClick:()=>K(()=>Ze(c)),disabled:!V,children:[(0,U.jsx)(De,{size:14,fill:c&&Yt(c,L)?`currentColor`:`none`}),(0,U.jsx)(`span`,{children:c&&Yt(c,L)?P(`folderUnpin`):P(`folderPin`)})]}),(0,U.jsxs)(`button`,{onClick:()=>K(()=>b(c)),disabled:!Oe,title:Oe?void 0:Ve,children:[(0,U.jsx)(Ee,{size:14}),(0,U.jsx)(`span`,{children:P(`folderRename`)})]}),(0,U.jsxs)(`button`,{onClick:()=>K(()=>y(c)),disabled:!Oe,title:Oe?void 0:Ve,children:[(0,U.jsx)(w,{size:14}),(0,U.jsx)(`span`,{children:P(`sidebarMergeFolder`)})]}),(0,U.jsxs)(`button`,{onClick:()=>K(()=>v(c)),disabled:!Oe,className:`is-danger`,title:Oe?void 0:Ve,children:[(0,U.jsx)(Re,{size:14}),(0,U.jsx)(`span`,{children:P(`sidebarDeleteFolder`)})]}),a===`tree`?(0,U.jsxs)(`button`,{onClick:()=>K(Je),children:[(0,U.jsx)(Se,{size:14}),(0,U.jsx)(`span`,{children:P(`sidebarCollapseAll`)})]}):null]})}):null,oe?(0,U.jsx)(S,{children:(0,U.jsxs)(`div`,{className:`ue-sidebar-context-menu`,style:{top:oe.y,left:oe.x},onClick:e=>e.stopPropagation(),onContextMenu:e=>e.preventDefault(),children:[(0,U.jsxs)(`button`,{className:`ue-sidebar-context-item`,onClick:()=>{b(oe.path),le(null)},children:[(0,U.jsx)(Ee,{size:14}),(0,U.jsx)(`span`,{children:P(`folderRename`)})]}),(0,U.jsxs)(`button`,{className:`ue-sidebar-context-item`,onClick:()=>{Ze(oe.path),le(null)},children:[(0,U.jsx)(De,{size:14,fill:Yt(oe.path,L)?`currentColor`:`none`}),(0,U.jsx)(`span`,{children:Yt(oe.path,L)?P(`folderUnpin`):P(`folderPin`)})]}),(0,U.jsxs)(`button`,{className:`ue-sidebar-context-item`,onClick:()=>{y(oe.path),le(null)},children:[(0,U.jsx)(w,{size:14}),(0,U.jsx)(`span`,{children:P(`sidebarMergeFolder`)})]}),(0,U.jsxs)(`button`,{className:`ue-sidebar-context-item ue-sidebar-context-item--danger`,onClick:()=>{v(oe.path),le(null)},children:[(0,U.jsx)(Re,{size:14}),(0,U.jsx)(`span`,{children:P(`sidebarDeleteFolder`)})]})]})}):null]})},ti=({open:e,title:t,text:r,label:i,placeholder:a=``,initialValue:o=``,confirmLabel:s,onClose:c,onSubmit:l})=>{let{t:u}=n(),[d,f]=(0,p.useState)(o),[m,h]=(0,p.useState)(!1);if((0,p.useEffect)(()=>{e&&(f(o),h(!1))},[o,e]),!e)return null;let g=d.trim();return(0,U.jsx)(`div`,{className:`ue-modal-backdrop`,onClick:c,children:(0,U.jsxs)(`form`,{className:`ue-library-modal ue-dialog-modal ue-text-input-modal`,onClick:e=>e.stopPropagation(),onSubmit:async e=>{if(e.preventDefault(),g&&!m){h(!0);try{await l(g),h(!1),c()}catch{h(!1)}}},children:[(0,U.jsx)(`button`,{className:`ue-modal-close ue-modal-close--light`,onClick:c,"aria-label":u(`modalClose`),type:`button`,children:(0,U.jsx)(H,{size:18})}),(0,U.jsxs)(`div`,{className:`ue-pane-copy ue-dialog-heading`,children:[(0,U.jsx)(`h2`,{children:t}),(0,U.jsx)(`p`,{children:r})]}),(0,U.jsxs)(`label`,{className:`ue-import-text-field ue-dialog-field`,children:[(0,U.jsx)(`span`,{children:i}),(0,U.jsx)(`input`,{autoFocus:!0,value:d,onChange:e=>f(e.target.value),placeholder:a})]}),(0,U.jsxs)(`div`,{className:`ue-library-modal-actions ue-dialog-actions`,children:[(0,U.jsxs)(`button`,{className:`ue-secondary-btn`,onClick:c,type:`button`,children:[(0,U.jsx)(H,{size:14}),(0,U.jsx)(`span`,{children:u(`libraryCancel`)})]}),(0,U.jsxs)(`button`,{className:`ue-primary-btn`,disabled:!g||m,"aria-label":s,title:s,type:`submit`,children:[(0,U.jsx)(k,{size:14}),(0,U.jsx)(`span`,{children:s})]})]})]})})},ni=12,ri=14,ii=(e,t,n)=>Math.max(t,Math.min(e,Math.max(t,n)));function ai(e,t,n){let r=Math.min(t.width,n.width-24),i=Math.min(t.height,n.height-24);if(!e)return{left:(n.width-r)/2,top:(n.height-i)/2,side:`center`};let a=e.left+e.width/2-r/2,o=e.top+e.height/2-i/2,s=[{left:a,top:e.top+e.height+ri,side:`bottom`},{left:a,top:e.top-i-ri,side:`top`},{left:e.left+e.width+ri,top:o,side:`right`},{left:e.left-r-ri,top:o,side:`left`}].map(e=>({...e,left:ii(e.left,ni,n.width-r-ni),top:ii(e.top,ni,n.height-i-ni)})),c=t=>Math.max(0,Math.min(t.left+t.width,e.left+e.width)-Math.max(t.left,e.left))*Math.max(0,Math.min(t.top+t.height,e.top+e.height)-Math.max(t.top,e.top));return s.sort((e,t)=>c({...e,width:r,height:i})-c({...t,width:r,height:i}))[0]}function oi(e,t,n){return!e||Math.max(e.left-ni-ri,n.width-e.left-e.width-ni-ri)>=t?n.height-24:Math.max(140,Math.max(e.top-ni-ri,n.height-e.top-e.height-ni-ri))}var si=[{id:`welcome`,title:`tourWelcomeTitle`,body:`tourWelcomeBody`},{id:`topbar`,target:`workspace-switcher`,title:`tourTopbarTitle`,body:`tourTopbarBody`},{id:`sidebar`,target:`sidebar-folders`,tab:`gallery`,sidebar:!0,title:`tourSidebarTitle`,body:`tourSidebarBody`},{id:`gallery`,target:`gallery-search`,tab:`gallery`,title:`tourGalleryTitle`,body:`tourGalleryBody`},{id:`density`,target:`gallery-density`,tab:`gallery`,title:`tourDensityTitle`,body:`tourDensityBody`},{id:`selection`,target:`gallery-selection`,tab:`gallery`,title:`tourSelectionTitle`,body:`tourSelectionBody`},{id:`detail`,target:`gallery-card`,tab:`gallery`,title:`tourDetailTitle`,body:`tourDetailBody`},{id:`library`,target:`library-actions`,tab:`library`,title:`tourLibraryTitle`,body:`tourLibraryBody`},{id:`workbench`,target:`workbench-generator`,tab:`workbench`,title:`tourWorkbenchTitle`,body:`tourWorkbenchBody`},{id:`settings`,target:`settings-onboarding`,tab:`settings`,title:`tourSettingsTitle`,body:`tourSettingsBody`},{id:`done`,title:`tourDoneTitle`,body:`tourDoneBody`}],ci=e=>{let{open:t,onSkip:r,onComplete:i}=e,{t:a}=n(),[o,s]=(0,p.useState)(0),[c,l]=(0,p.useState)(null),[u,d]=(0,p.useState)(!1),[f,m]=(0,p.useState)({width:window.innerWidth,height:window.innerHeight}),[g,_]=(0,p.useState)({width:352,height:250}),v=(0,p.useRef)(null),y=(0,p.useRef)(e);(0,p.useEffect)(()=>{y.current=e});let b=si[o];if((0,p.useEffect)(()=>{t||s(0)},[t]),(0,p.useEffect)(()=>{if(!t)return;let e=document.activeElement instanceof HTMLElement?document.activeElement:null,n=document.getElementById(`root`),r=n?.inert??!1;n&&(n.inert=!0),v.current?.focus({preventScroll:!0});let i=e=>{if(e.key===`Escape`){e.preventDefault(),y.current.onSkip();return}if(e.key!==`Tab`)return;let t=Array.from(v.current?.querySelectorAll(`button:not(:disabled)`)??[]),n=t[0],r=t[t.length-1];n&&(e.shiftKey&&(document.activeElement===n||document.activeElement===v.current)?(e.preventDefault(),r.focus()):e.shiftKey||document.activeElement!==r&&document.activeElement!==v.current||(e.preventDefault(),n.focus()))};return document.addEventListener(`keydown`,i,!0),()=>{document.removeEventListener(`keydown`,i,!0),n&&(n.inert=r),e?.isConnected&&!e.closest(`[inert]`)&&e.focus({preventScroll:!0})}},[t]),(0,p.useEffect)(()=>{if(!t)return;l(null),d(!1),b.tab&&y.current.onRequestTabChange(b.tab),b.sidebar?y.current.onRequestSidebarOpen():window.innerWidth<=960&&y.current.onRequestSidebarClose?.();let e=0,n=!1,r=!1,i=null,a=typeof ResizeObserver<`u`?new ResizeObserver(()=>s()):null,o=()=>{if(e=0,r)return;let t=window.innerWidth,o=window.innerHeight;m(e=>e.width===t&&e.height===o?e:{width:t,height:o});let s=v.current?.getBoundingClientRect();s?.height&&_(e=>e.width===s.width&&e.height===s.height?e:{width:s.width,height:s.height});let c=b.target?document.querySelector(`[data-tour-id="${b.target}"]`):null;if(c!==i&&(i&&a?.unobserve(i),i=c,c&&a?.observe(c)),!c){l(null);return}let u=c.getBoundingClientRect();if(!u.width||!u.height){l(null);return}n||(n=!0,(u.top<65||u.top>o*.55)&&(c.scrollIntoView?.({block:`start`,inline:`nearest`,behavior:`instant`}),u=c.getBoundingClientRect()));let f=Math.max(8,u.left-6),p=Math.max(8,u.top-6),h={left:f,top:p,width:Math.max(0,Math.min(u.right+6,t-8)-f),height:Math.max(0,Math.min(u.bottom+6,p+(b.id===`sidebar`?112:100),o-8)-p)};!h.width||!h.height?l(null):(l(e=>e&&Object.keys(h).every(t=>Math.abs(e[t]-h[t])<.5)?e:h),d(!1))};function s(){!e&&!r&&(e=window.requestAnimationFrame(o))}let c=new MutationObserver(e=>{e.some(e=>!(e.target instanceof Element&&e.target.closest(`.ue-onboarding-layer`)))&&s()});c.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`class`,`style`,`open`,`inert`]}),v.current&&a?.observe(v.current),s();let u=window.setTimeout(()=>d(!0),1400);return window.addEventListener(`resize`,s),window.addEventListener(`scroll`,s,!0),document.addEventListener(`transitionend`,s,!0),()=>{r=!0,window.cancelAnimationFrame(e),window.clearTimeout(u),a?.disconnect(),c.disconnect(),window.removeEventListener(`resize`,s),window.removeEventListener(`scroll`,s,!0),document.removeEventListener(`transitionend`,s,!0)}},[t,b]),!t)return null;let x=ai(c,g,f),S=o===si.length-1,C=c?`M${c.left},${c.top}h${c.width}v${c.height}h-${c.width}Z`:``;return(0,h.createPortal)((0,U.jsxs)(`div`,{className:`ue-onboarding-layer`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`ue-onboarding-title`,"aria-describedby":`ue-onboarding-body`,children:[(0,U.jsx)(`svg`,{className:`ue-onboarding-scrim`,"aria-hidden":`true`,width:`100%`,height:`100%`,children:(0,U.jsx)(`path`,{d:`M0,0H${f.width}V${f.height}H0Z ${C}`,fillRule:`evenodd`})}),c?(0,U.jsx)(`div`,{className:`ue-onboarding-highlight`,"data-target":b.target,style:{left:c.left,top:c.top,width:c.width,height:c.height}}):null,(0,U.jsxs)(`article`,{ref:v,tabIndex:-1,className:`ue-onboarding-card`,"data-step":b.id,"data-placement":x.side,style:{left:x.left,top:x.top,maxHeight:oi(c,g.width,f)},children:[(0,U.jsxs)(`header`,{className:`ue-onboarding-progress`,children:[(0,U.jsx)(`span`,{children:a(`tourStepProgress`,{page:o+1,totalPages:si.length})}),(0,U.jsx)(`button`,{className:`ue-onboarding-close`,type:`button`,onClick:r,"aria-label":a(`tourClose`),children:(0,U.jsx)(H,{size:17})})]}),(0,U.jsx)(`div`,{className:`ue-onboarding-meter`,"aria-hidden":`true`,children:(0,U.jsx)(`span`,{style:{width:`${(o+1)/si.length*100}%`}})}),(0,U.jsxs)(`div`,{className:`ue-onboarding-content`,"aria-live":`polite`,"aria-atomic":`true`,children:[(0,U.jsx)(`h2`,{id:`ue-onboarding-title`,children:a(b.title)}),(0,U.jsx)(`p`,{id:`ue-onboarding-body`,children:a(b.body)}),b.target&&!c&&u?(0,U.jsx)(`small`,{children:a(`tourTargetMissing`)}):null]}),(0,U.jsxs)(`footer`,{className:`ue-onboarding-actions`,children:[(0,U.jsx)(`button`,{type:`button`,className:`ue-tour-skip`,onClick:r,children:a(`tourSkip`)}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`button`,{type:`button`,className:`ue-tour-back`,onClick:()=>s(e=>Math.max(0,e-1)),disabled:!o,"aria-label":a(`tourPrevious`),children:(0,U.jsx)(te,{size:17})}),(0,U.jsxs)(`button`,{type:`button`,className:`ue-tour-next`,onClick:()=>S?i():s(e=>e+1),children:[(0,U.jsx)(`span`,{children:a(S?`tourFinish`:`tourNext`)}),S?(0,U.jsx)(k,{size:16}):(0,U.jsx)(A,{size:16})]})]})]})]})]}),document.body)},li=new Map,ui=()=>{for(let e of li.values())e.obsolete=!0},di=class extends Error{jobId;scope;constructor(e,t,n){super(e),this.jobId=t,this.scope=n}},fi=()=>new DOMException(`Aborted`,`AbortError`),pi=(e,t)=>{if(t.aborted)return Promise.reject(fi());if(typeof K.createJob!=`function`)return Promise.resolve(!0);let n=li.get(``),r=n&&!n.obsolete?n:li.get(e);if(r?.obsolete&&(r=void 0),!r||r.controller.signal.aborted){let t={controller:new AbortController,clients:0,promise:Promise.resolve(!1),obsolete:!1};r=t,li.set(e,t),t.promise=(async()=>{try{let n=await K.createJob(`refresh_index`,{subfolder:e,force:!0}).catch(e=>{if(e instanceof Xe&&[404,405].includes(e.status))return null;throw e});if(!n)return!0;let r=await ut(n.job,t.controller.signal);if(r.state!==`succeeded`)throw new di(r.error||`Index sync: ${r.state}`,r.id,String(r.payload?.subfolder??e));return!1}finally{li.get(e)===t&&li.delete(e)}})()}let i=r;return i.clients++,new Promise((e,n)=>{let r=!1,a=()=>!r&&(r=!0,t.removeEventListener(`abort`,o),--i.clients===0&&i.controller.abort(),!0),o=()=>{a()&&n(fi())};t.addEventListener(`abort`,o,{once:!0}),i.promise.then(t=>{a()&&e(t)},e=>{a()&&n(e)})})},mi=`universal-extractor-gallery-events`,hi=e=>{if(!e||typeof e!=`object`)return!1;let t=e;return t.version===1&&t.type===`outputs-changed`&&typeof t.prompt_id==`string`&&t.prompt_id.length>0&&t.prompt_id.length<=200&&(t.scopes===void 0||Array.isArray(t.scopes)&&t.scopes.length<=32&&t.scopes.every(e=>typeof e==`string`&&e.length<=2e3))},gi=e=>{if(!e.length||e.includes(``))return``;let t=e.map(e=>e.includes(`::`)?e.split(`::`,2):[`default_output`,e]),n=t[0][0];if(t.some(([e])=>e!==n))return``;let r=t[0][1].split(`/`).filter(Boolean);for(let[,e]of t.slice(1)){let t=e.split(`/`).filter(Boolean);for(;r.some((e,n)=>e!==t[n]);)r.pop()}return`${n}::${r.join(`/`)}`},_i=e=>{let t=(0,p.useRef)(0),n=(0,p.useRef)(0),r=(0,p.useRef)(new Set),i=(0,p.useRef)([]),a=(0,p.useRef)(!1),o=(0,p.useRef)({instance:``,sequence:0,started:0,supported:!0}),s=(0,p.useRef)(new Map),c=(0,p.useRef)(new Map),l=(0,p.useRef)(e);(0,p.useEffect)(()=>{l.current=e}),(0,p.useEffect)(()=>{o.current.started=Date.now()/1e3},[]);let u=(0,p.useCallback)(e=>{hi(e)&&!r.current.has(e.prompt_id)&&(r.current.add(e.prompt_id),r.current.size>256&&r.current.delete(r.current.values().next().value),t.current++,ui(),i.current.push({generation:t.current,scopes:e.scopes?.length?e.scopes:[``]}),i.current.length>256&&(i.current=[{generation:t.current,scopes:[``]}]),window.dispatchEvent(new Event(`universal-gallery:outputs-dirty`)))},[]);(0,p.useEffect)(()=>{if(!e.enabled||typeof BroadcastChannel>`u`)return;let t=new BroadcastChannel(mi);return t.onmessage=({data:e})=>{u(e)},()=>t.close()},[e.enabled,u]),(0,p.useEffect)(()=>{if(!e.enabled||!e.active||typeof K.getSyncStatus!=`function`||!o.current.supported)return;let t=new AbortController,n,r=!1,i=async()=>{if(r||t.signal.aborted||document.visibilityState===`hidden`)return;r=!0;let e=1e3;try{let e=await K.getSyncStatus(o.current.sequence,t.signal);if(t.signal.aborted)return;o.current.instance&&o.current.instance!==e.instance?o.current.sequence=0:o.current.sequence=e.sequence,o.current.instance=e.instance;for(let t of e.events)(!t.created_at||t.created_at>=o.current.started)&&u(t)}catch(t){if(t instanceof Xe&&[404,405].includes(t.status)){o.current.supported=!1;return}e=1e4}finally{r=!1,!t.signal.aborted&&o.current.supported&&(n=window.setTimeout(()=>{i()},e))}},a=()=>{window.clearTimeout(n),document.visibilityState===`visible`&&i()};return document.addEventListener(`visibilitychange`,a),i(),()=>{t.abort(),window.clearTimeout(n),document.removeEventListener(`visibilitychange`,a)}},[e.enabled,e.active,u]),(0,p.useEffect)(()=>{if(!e.enabled||!e.active||!e.loaded)return;let r=new AbortController,{signal:o}=r,u=!1,d,f=0,p=e=>{window.clearTimeout(d),d=window.setTimeout(()=>{m()},e)},m=async()=>{if(o.aborted||u||document.visibilityState===`hidden`||c.current.get(e.scope)===t.current)return;u=!0;let r=t.current,d=r!==n.current,m=s.current.get(e.scope)??``;try{let t=d?null:await K.getImageFreshness(e.scope,m,o);if(o.aborted)return;if(d||!m||t?.changed){t?.changed&&ui();let s=new Set(i.current.filter(e=>e.generation<=r).flatMap(e=>e.scopes)),c=a.current?d?[gi([...s])]:[e.scope]:[``],u=(await Promise.all(c.map(e=>pi(e,o)))).some(Boolean);if(o.aborted||(t?.changed?await l.current.refresh(u,o,!0):await l.current.refresh(u,o),o.aborted))return;a.current=!0,n.current=r,i.current=i.current.filter(e=>e.generation>r)}t&&s.current.set(e.scope,t.fingerprint),c.current.delete(e.scope),f=0}catch(n){if(o.aborted)return;(n instanceof TypeError||n instanceof Xe&&[502,503,504].includes(n.status))&&f<2?p([2e3,1e4][f++]):(c.current.set(e.scope,r),l.current.onError(n,()=>{f=0,t.current++,window.dispatchEvent(new Event(`universal-gallery:outputs-dirty`))}))}finally{u=!1,!o.aborted&&t.current!==r&&p(1e3)}},h=()=>{f=0,u||p(1e3)},g=()=>{document.visibilityState===`visible`&&p(0)},_=window.setInterval(()=>{m()},15e3);return window.addEventListener(`universal-gallery:outputs-dirty`,h),window.addEventListener(`focus`,g),document.addEventListener(`visibilitychange`,g),p(1e3),()=>{r.abort(),window.clearTimeout(d),window.clearInterval(_),window.removeEventListener(`universal-gallery:outputs-dirty`,h),window.removeEventListener(`focus`,g),document.removeEventListener(`visibilitychange`,g)}},[e.enabled,e.active,e.loaded,e.scope,e.viewKey])},vi=e=>{let t=(0,p.useRef)(new Map),n=(0,p.useCallback)((e,n,r)=>{let i=t.current.get(e);i&&(i.parts.delete(n),r&&(i.error??=r),i.parts.size||(t.current.delete(e),i.error?i.reject(i.error):i.resolve()))},[]);return(0,p.useEffect)(()=>{let n=t.current;return()=>{n.forEach(t=>t.reject(Error(e))),n.clear()}},[e]),{completeRefreshPart:n,waitForRefresh:e=>new Promise((n,r)=>{let i=e();t.current.set(i,{parts:new Set([`context`,`images`]),error:null,resolve:n,reject:r})})}},yi=(e,t)=>Object.is(e,t)||Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((e,n)=>Object.is(e,t[n])),bi=(e,t)=>{let n=new Map(e.map(e=>[e.asset_id||e.relative_path,e])),r=t.map(e=>{let t=n.get(e.asset_id||e.relative_path);return t&&Object.keys(t).length===Object.keys(e).length&&Object.entries(e).every(([e,n])=>yi(t[e],n))?t:e});return r.length===e.length&&r.every((t,n)=>t===e[n])?e:r},xi=(e,t)=>e.length===t.length&&e.every((e,n)=>[`relative_path`,`filename`,`asset_id`,`content_revision`,`created_at`,`size`].every(r=>e[r]===t[n][r])),Si=(e,t)=>{if(Object.is(e,t))return!0;if(!e||!t||typeof e!=`object`||typeof t!=`object`||Array.isArray(e)!==Array.isArray(t))return!1;let n=e,r=t;return Object.keys(n).length===Object.keys(r).length&&Object.entries(r).every(([e,t])=>Object.hasOwn(n,e)&&Si(n[e],t))},Ci=(e,t)=>{if(!e)return t;let n=Object.entries(t).map(([t,n])=>{let r=e[t];return[t,Si(r,n)?r:n]});return Object.keys(e).length===n.length&&n.every(([t,n])=>e[t]===n)?e:Object.fromEntries(n)},wi=e=>{let{t}=n(),{page:r,deferredSearchTerm:i,selectedCategory:a,selectedSubfolder:o,selectedBoardId:s,dateFrom:c,dateTo:l,favoritesOnly:u,selectedColorFamily:d,sortBy:f,sortOrder:m,refreshKey:h,refreshIndex:g=!0,isTrashView:_,isActive:v,scheduleThumbnailPrewarm:y,liveRefreshViewKey:b,completeRefreshPart:x}=e,[S,C]=(0,p.useState)([]),[w,T]=(0,p.useState)(null),[E,D]=(0,p.useState)(null),[O,k]=(0,p.useState)(0),[ee,te]=(0,p.useState)(!0),[A,j]=(0,p.useState)(!1),[M,ne]=(0,p.useState)(null),[N,P]=(0,p.useState)([]),F=(0,p.useRef)(!1),I=(0,p.useRef)(!1),L=(0,p.useRef)(0),re=(0,p.useRef)(0),[R,z]=(0,p.useState)(null),ie=(0,p.useRef)(null);return(0,p.useEffect)(()=>{let e=!1,n=new AbortController,r=h>0&&L.current!==h;return r&&(L.current=h),(async()=>{let i;try{let a=r&&g?await pi(v?o:``,n.signal):!1;if(e)return;let s=await K.getContext(a,n.signal);if(e)return;if(T(e=>Ci(e,s)),D(s.color_index_status??null),s.index_error||s.catalog_error){let e=s.index_error||s.catalog_error||t(`galleryLoading`);ne(e),i=Error(e)}}catch(n){e||(i=n instanceof Error?n:Error(t(`galleryLoading`)),ne(i.message))}finally{e||x(h,`context`,i)}})(),()=>{e=!0,n.abort(),r&&x(h,`context`,Error(t(`galleryRefreshInterrupted`)))}},[x,h,g,o,v,t]),(0,p.useEffect)(()=>{let e=!1,n=new AbortController,p=h>0&&re.current!==h;if(!v&&!p)return;p&&(re.current=h);let S=ie.current===b;return S?j(!0):(te(!0),j(!1)),ne(null),(async()=>{let v,w=!1;try{if(_){let t=await K.listTrash(n.signal);if(e)return;P(t),k(t.length);return}let t=p&&g?await pi(o,n.signal):!1;if(e)return;let h=await K.listImages(r,48,i,a,o,s,c,l,u,d,f,m,t,n.signal);if(e)return;C(e=>bi(e,h.images??[])),w=!0,P([]),k(h.total??0),D(h.color_index_status??null),h.index_error&&(ne(h.index_error),v=Error(h.index_error)),e||y(h.images??[])}catch(n){e||(!S&&!w&&(C([]),P([]),k(0)),v=n instanceof Error?n:Error(t(`galleryLoading`)),ne(v.message))}finally{e||(x(h,`images`,v),ie.current=b,z(b),_?I.current=!0:F.current=!0,te(!1),j(!1))}})(),()=>{e=!0,n.abort(),p&&x(h,`images`,Error(t(`galleryRefreshInterrupted`)))}},[r,i,a,o,s,c,l,u,d,f,m,h,g,t,_,v,y,b,x]),{images:S,setImages:C,context:w,setContext:T,colorIndexStatus:E,setColorIndexStatus:D,total:O,setTotal:k,isLoading:ee,isRefreshing:A,error:M,trashItems:N,setTrashItems:P,hasLoadedImagesRef:F,loadedViewKey:R}},Y=(e,t,n)=>{let r=t.states?.[e.relative_path];if(r)return{...e,...r};let i={};for(let e of Object.keys(n))[`favorite`,`pinned`,`boards`,`category`,`title`,`notes`].includes(e)&&(i[e]=t.last_state?.[e]??n[e]);return(`pinned`in i||`favorite`in i)&&(i.pinned=!!(i.pinned??i.favorite),i.favorite=i.pinned,!i.pinned&&!(`boards`in n)&&(i.boards=[])),{...e,...i}},Ti=(e,t)=>Array.isArray(e)?e.filter(e=>typeof e==`string`):typeof e==`string`?[e]:t,Ei=({selectedImage:e,setImages:t,setSelectedImage:r,setSelectedImagePaths:i,applyContextPatch:a,refresh:o,stateFiltersActive:s})=>{let{t:c}=n();return{batchUpdateImages:async(n,c)=>{let l=`pinned`in c||`favorite`in c,u=new Set(n),d=new Map,f=e;if(l){let e=!!(c.pinned??c.favorite);t(t=>t.map(t=>u.has(t.relative_path)?(d.set(t.relative_path,t),{...t,favorite:e,pinned:e}):t)),r(t=>t&&u.has(t.relative_path)?{...t,favorite:e,pinned:e}:t)}let p;try{p=await K.batchUpdateImages(n,c)}catch(e){throw d.size>0&&t(e=>e.map(e=>d.get(e.relative_path)??e)),r(f),e}let m=Ti(p.updated,n);a(e=>({...e,categories:p.categories??e.categories,boards:p.boards??e.boards,pinned_count:l?Math.max(0,e.pinned_count+m.reduce((e,t)=>{let n=d.get(t);return!n||!p.last_state||typeof p.last_state.pinned!=`boolean`?e:e+ +!!p.last_state.pinned-+!!n.pinned},0)):e.pinned_count}));let h=new Set(m);return t(e=>e.map(e=>h.has(e.relative_path)?Y(e,p,c):d.get(e.relative_path)??e)),r(e=>e&&h.has(e.relative_path)?Y(e,p,c):e&&f?.relative_path===e.relative_path&&u.has(e.relative_path)?f:e),i(e=>e.filter(e=>!h.has(e))),s&&o(),{...p,updated:m}},moveImages:async(e,t,n=``)=>{let r=await K.moveImages(e,t,n);if(!r.ok)throw Error(c(`dual_moveError`));a(e=>({...e,categories:r.categories??e.categories,subfolders:r.subfolders??e.subfolders}));let{movedSources:s}=gn(e,r);return i(e=>e.filter(e=>!s.has(e))),o(),r},batchRenameImages:async(e,t,n,r,a)=>{let s=await K.batchRenameImages(e,t,n,r,a);return i([]),o(),s},deleteImages:async e=>{let t=await K.deleteImages(e);if(!t.ok)throw Error(c(`dual_deleteError`));a(e=>({...e,categories:t.categories??e.categories}));let{deletedPaths:n}=_n(e,t);return i(e=>e.filter(e=>!n.has(e))),o(),t}}},Di=async(e,t)=>{let n=[...new Set(e)],r=[],i=``;for(let e of n)try{if(!(await t(e)).ok)throw Error(`Trash operation was not committed`);r.push(e)}catch(e){i=e instanceof Error?e.message:String(e);break}return{completed:r,unfinished:n.slice(r.length),error:i}},Oi=`__trash__`,ki=`default_output::`,Ai=`::`,ji=24,Mi=[],Ni=[],Pi=e=>e.includes(Ai)?`${e.split(Ai,1)[0]}${Ai}`:ki,Fi=(e={})=>{let t=e.isActive??!0,r=e.liveRefreshEnabled??!0,i=e.thumbnailPrewarmEnabled??!0,{t:a}=n(),[o,s]=(0,p.useState)(()=>e.initialScope?.page??1),[c,l]=(0,p.useState)(()=>e.initialScope?.query??``),[u,d]=(0,p.useState)(()=>e.initialScope?.category??``),[f,m]=(0,p.useState)(()=>e.initialScope?.folder??ki),[h,g]=(0,p.useState)(()=>e.initialScope?.board??``),[_,v]=(0,p.useState)(()=>e.initialScope?.dateFrom??``),[y,b]=(0,p.useState)(()=>e.initialScope?.dateTo??``),[x,S]=(0,p.useState)(()=>e.initialScope?.favorites??!1),[C,w]=(0,p.useState)(()=>e.initialScope?.color??``),[T,E]=(0,p.useState)(()=>e.initialScope?.sort??`created_at`),[D,O]=(0,p.useState)(()=>e.initialScope?.order??`desc`),[k,ee]=(0,p.useState)(()=>{let e=Et(`universal-extractor:grid-columns`),t=Number(e);return Number.isFinite(t)&&t>=3&&t<=8?t:6}),[te,A]=(0,p.useState)(!1),[j,M]=(0,p.useState)(null),[ne,N]=(0,p.useState)(null),[P,F]=(0,p.useState)([]),[I,L]=(0,p.useState)(``),[re,R]=(0,p.useState)(``),[{key:z,scan:ie},ae]=(0,p.useState)({key:0,scan:!1}),oe=(0,p.useRef)(!1),[se,ce]=(0,p.useState)(!1),le=(0,p.useRef)(0),{completeRefreshPart:ue,waitForRefresh:de}=vi(a(`galleryRefreshInterrupted`)),[fe,pe]=(0,p.useState)(null),me=(0,p.useRef)(null),he=(0,p.useRef)(null),[ge,_e]=(0,p.useState)(c);(0,p.useEffect)(()=>{if(c===ge)return;let e=window.setTimeout(()=>_e(c),c?280:0);return()=>window.clearTimeout(e)},[ge,c]);let ve=(0,p.useDeferredValue)(ge),ye=f===Oi,be=(0,p.useMemo)(()=>JSON.stringify({subfolder:f,search:ve,category:u,board:h,dateFrom:_,dateTo:y,favoritesOnly:x,color:C,sortBy:T,sortOrder:D,page:o}),[_,y,ve,x,o,h,u,C,f,T,D]),xe=(0,p.useCallback)(()=>{let e=window;he.current!==null&&(e.cancelIdleCallback?.(he.current),he.current=null),me.current!==null&&(window.clearTimeout(me.current),me.current=null)},[]),Se=(0,p.useCallback)(e=>{if(!i)return;let t=e.slice(0,ji).map(e=>e.relative_path);if(!t.length)return;xe();let n=()=>{he.current=null,me.current=null,K.prewarmThumbnails(t,ji).catch(()=>void 0)},r=window;typeof r.requestIdleCallback==`function`?he.current=r.requestIdleCallback(n,{timeout:1500}):me.current=window.setTimeout(n,250)},[xe,i]);(0,p.useEffect)(()=>{i||xe()},[xe,i]),(0,p.useEffect)(()=>()=>xe(),[xe]),(0,p.useEffect)(()=>{Dt(`universal-extractor:grid-columns`,String(k))},[k]);let{images:Ce,setImages:B,context:we,setContext:Te,colorIndexStatus:Ee,setColorIndexStatus:De,total:V,setTotal:Oe,isLoading:ke,isRefreshing:Ae,error:je,trashItems:Me,loadedViewKey:Ne}=wi({page:o,deferredSearchTerm:ve,selectedCategory:u,selectedSubfolder:f,selectedBoardId:h,dateFrom:_,dateTo:y,favoritesOnly:x,selectedColorFamily:C,sortBy:T,sortOrder:D,refreshKey:z,refreshIndex:ie,isTrashView:ye,isActive:t,scheduleThumbnailPrewarm:Se,liveRefreshViewKey:be,completeRefreshPart:ue}),Pe=(0,p.useRef)({images:Ce,total:V,selectedImage:j,selectedImagePaths:P,blocked:e.interactionBlocked});(0,p.useEffect)(()=>{Pe.current={images:Ce,total:V,selectedImage:j,selectedImagePaths:P,blocked:e.interactionBlocked}},[Ce,V,j,P,e.interactionBlocked]),_i({enabled:r,active:t&&!ye,scope:f,viewKey:be,loaded:Ne===be&&!ke,onError:(e,t)=>pe({error:e,retry:t}),refresh:async(e,t,n=!1)=>{let[r,i]=await Promise.all([K.listImages(o,48,ve,u,f,h,_,y,x,C,T,D,e,t),K.getContext(!1,t)]);if(t.aborted)return;Te(e=>Ci(e,i)),De(i.color_index_status??r.color_index_status??null),pe(null),window.dispatchEvent(new Event(`universal-gallery:index-synced`));let a=Pe.current;o===1&&T===`created_at`&&D===`desc`&&!a.blocked&&a.selectedImagePaths.length===0&&!a.selectedImage&&!document.querySelector(`[data-gallery-interacting="true"]`)&&(document.querySelector(`.ue-main-shell`)?.scrollTop??0)<=80?(B(e=>bi(e,r.images??[])),Oe(r.total??0),A(!1),Se(r.images??[])):n||a.total!==r.total||!xi(a.images,r.images??[])?A(!0):B(e=>bi(e,r.images??[]))}}),(0,p.useEffect)(()=>{A(!1)},[be]),(0,p.useEffect)(()=>{if(!t||!Ee||Ee.complete||ye)return;let e=window.setInterval(()=>{K.getColorIndexStatus().then(De).catch(()=>void 0)},5e3);return()=>window.clearInterval(e)},[Ee,ye,t,De]);let Fe=(0,p.useCallback)((e=!0)=>{let t=++le.current;return A(!1),ae({key:t,scan:e}),t},[]),Ie=e=>{s(e.page),l(e.query),_e(e.query),m(e.folder),g(e.board),d(e.category),v(e.dateFrom),b(e.dateTo),S(e.favorites),w(e.color),E(e.sort),O(e.order),F([]),M(null),N(null)},Le=()=>{Fe()},Re=()=>de(Fe),ze=e=>{Te(t=>t&&e(t))},Be=async(e,t)=>{let n=`pinned`in t||`favorite`in t,r=null,i=null;if(n){let n=!!(t.pinned??t.favorite);B(t=>t.map(t=>t.relative_path===e?(r=t,{...t,favorite:n,pinned:n}):t)),M(t=>!t||t.relative_path!==e?t:(i=t,{...t,favorite:n,pinned:n}))}let a;try{a=await K.updateImageState(e,t)}catch(t){if(r){let t=r;B(n=>n.map(n=>n.relative_path===e?t:n))}if(i){let t=i;M(n=>n&&n.relative_path===e?t:n)}throw t}ze(e=>{let t=n&&r&&typeof a.state.pinned==`boolean`?+!!a.state.pinned-!!r.pinned:0;return{...e,categories:a.categories??e.categories,boards:a.boards??e.boards,pinned_count:Math.max(0,e.pinned_count+t)}}),B(t=>t.map(t=>t.relative_path===e?{...t,...a.state}:t)),M(t=>t&&t.relative_path===e?{...t,...a.state}:t),!n&&(ve.trim()||u||h)&&Le()},{batchUpdateImages:Ve,moveImages:H,batchRenameImages:U,deleteImages:He}=Ei({selectedImage:j,setImages:B,setSelectedImage:M,setSelectedImagePaths:F,applyContextPatch:ze,refresh:Le,stateFiltersActive:!!(ve.trim()||u||h||x)}),W=async(e,t)=>{let n=await K.renameImage(e,t);return ze(e=>({...e,categories:n.categories??e.categories})),M(t=>t&&t.relative_path===e?n.image:t),F(t=>t.map(t=>t===e?n.image.relative_path:t)),Le(),n},Ue=async e=>{let t=await K.createFolder(e);return ze(e=>({...e,subfolders:t.subfolders??e.subfolders})),t.path&&(m(t.path),g(``),S(!1),s(1)),t},We=async e=>{let t=await K.deleteFolder(e);return ze(e=>({...e,subfolders:t.subfolders??e.subfolders,categories:t.categories??e.categories})),(f===e||f.startsWith(`${e}/`))&&m(Pi(e)),Le(),t},Ge=async(e,t)=>{let n=await K.mergeFolder(e,t);return ze(e=>({...e,subfolders:n.subfolders??e.subfolders,categories:n.categories??e.categories})),(f===e||f.startsWith(`${e}/`))&&m(n.target_path??t),Le(),n},Ke=async(e,t)=>{let n=await K.renameFolder(e,t);if(ze(e=>({...e,subfolders:n.subfolders??e.subfolders,categories:n.categories??e.categories})),f===e||f.startsWith(`${e}/`)){let r=f.slice(e.length);m(`${n.target_path??t}${r}`)}return Le(),n},qe=async(e,t=``)=>{L(``),R(``);let n=await K.importFiles(e,t),r=n.imported_images.length+n.imported_libraries.length,i=n.skipped.length,o=n.imported_images[0]?.relative_path??``,s=o.includes(`/`)?o.slice(0,o.lastIndexOf(`/`)):``,c=s&&!s.includes(Ai)?`${ki}${s}`:s;R(c);let l=Pi(c).replace(Ai,``),u=we?.sources.find(e=>e.id===l)?.name||l,d=c.split(Ai).pop()||we?.import_image_subfolder||`universal_gallery_imports`,f=[];return r>0&&f.push(a(`galleryImportSuccess`,{count:r})),n.imported_images.length&&f.push(a(`galleryImportSavedTo`,{target:`${u} / ${d}/`})),n.imported_libraries.length&&f.push(a(`galleryImportLibrariesSavedTo`,{count:n.imported_libraries.length})),i>0&&f.push(a(`galleryImportSkipped`,{count:i})),L(f.join(` · `)),(0,p.startTransition)(()=>{Le()}),n},Je=(0,p.useMemo)(()=>we?.move_targets??[],[we?.move_targets]),Ye=(0,p.useMemo)(()=>we?.boards??[],[we?.boards]),Xe=e=>{ze(t=>({...t,boards:e}))},G=async(e,t=``)=>{let n=await K.createBoard(e,t);return Xe(n.boards??Ye),n},Ze=async(e,t)=>{let n=await K.updateBoard(e,t);return Xe(n.boards??Ye),n},Qe=async e=>{let t=await K.deleteBoard(e);return ze(e=>({...e,boards:t.boards??e.boards,categories:t.categories??e.categories})),h===e&&g(``),Le(),t},$e=async(e,t,n=!0)=>{let r=await K.updateBoardPins(e,t,n);return ze(e=>({...e,boards:r.boards??e.boards,categories:r.categories??e.categories})),Le(),r},et=async(e,t)=>{if(oe.current)throw Error(a(`trashOperationBusy`));oe.current=!0,ce(!0);try{let n=await Di(e,e=>t?K.restoreTrashItem(e):K.purgeTrashItem(e)),r=new Set(n.completed);return F(e=>e.filter(e=>!r.has(e))),n}finally{e.length&&Fe(!1),oe.current=!1,ce(!1)}},tt=e=>et(e,!0),nt=e=>et(e,!1),rt=async e=>{let t=await tt([e]);if(t.unfinished.length)throw Error(t.error)},it=async e=>{let t=await nt([e]);if(t.unfinished.length)throw Error(t.error)},at=Ne===be&&(ye||c===ve),ot=at?V:0;return{images:at?Ce:Mi,context:we,colorIndexStatus:Ee,total:ot,page:o,setPage:s,totalPages:Math.max(1,Math.ceil(ot/48)),searchTerm:c,setSearchTerm:l,selectedCategory:u,setSelectedCategory:d,selectedSubfolder:f,setSelectedSubfolder:m,selectedBoardId:h,setSelectedBoardId:g,dateFrom:_,setDateFrom:v,dateTo:y,setDateTo:b,favoritesOnly:x,selectedColorFamily:C,setFavoritesOnly:S,setSelectedColorFamily:w,sortBy:T,setSortBy:E,sortOrder:D,setSortOrder:O,gridColumns:k,setGridColumns:ee,isLoading:ke||!at,isRefreshing:Ae&&at,hasPendingLiveRefresh:te,autoSyncFailure:fe,error:at?je:null,selectedImage:j,setSelectedImage:M,detailNavigation:ne,setDetailNavigation:N,selectedImagePaths:at?P:[],setSelectedImagePaths:F,trashItems:at?Me:Ni,isTrashView:ye,importMessage:I,importFolderRef:re,setImportMessage:L,targetFolderOptions:Je,boards:Ye,refresh:Le,refreshAndWait:Re,applyUrlScope:Ie,updateImageState:Be,batchUpdateImages:Ve,moveImages:H,batchRenameImages:U,deleteImages:He,renameImage:W,createFolder:Ue,deleteFolder:We,mergeFolder:Ge,renameFolder:Ke,createBoard:G,updateBoard:Ze,deleteBoard:Qe,updateBoardPins:$e,importFiles:qe,restoreTrashItem:rt,purgeTrashItem:it,restoreTrashItems:tt,purgeTrashItems:nt,trashBusy:se}},Ii=[],Li=e=>e instanceof Xe&&typeof e.details==`object`&&e.details!==null&&`validation_errors`in e.details&&Array.isArray(e.details.validation_errors)?e.details.validation_errors:Ii,Ri=e=>{let{t}=n(),[r,i]=(0,p.useState)([]),[a,o]=(0,p.useState)(null),[s,c]=(0,p.useState)([]),[l,u]=(0,p.useState)([]),[d,f]=(0,p.useState)(``),[m,h]=(0,p.useState)(`[]`),[g,_]=(0,p.useState)(``),[v,y]=(0,p.useState)(``),[b,x]=(0,p.useState)(1),[S,C]=(0,p.useState)(0),[w]=(0,p.useState)(120),[T,E]=(0,p.useState)(!1),[D,O]=(0,p.useState)(!1),[k,ee]=(0,p.useState)(!1),[te,A]=(0,p.useState)(!1),[j,M]=(0,p.useState)(null),[ne,N]=(0,p.useState)(``),[P,F]=(0,p.useState)([]),I=(0,p.useRef)(!1),L=(0,p.useRef)(0),re=(0,p.useRef)(0),R=(0,p.useRef)(0),[z,ie]=(0,p.useState)(``),ae=(0,p.useRef)(``),oe=(0,p.useRef)(v),se=JSON.stringify([a,v,b]),ce=(0,p.useCallback)(async()=>{I.current?ee(!0):O(!0),M(null);try{let e=await K.listLibraries();i(e)}catch(e){M(e instanceof Error?e.message:t(`errorOpenLibrary`))}finally{I.current=!0,O(!1),ee(!1)}},[t]),le=(0,p.useCallback)(async(e,n,r)=>{let i=++L.current,a=JSON.stringify([e,n,r]);ae.current===a?ee(!0):(O(!0),ee(!1)),M(null);try{let t=await K.getLibraryEntries(e,n,r,w);if(L.current!==i)return;c(t.data??[]),C(t.total??0),x(t.page??r),ae.current=JSON.stringify([e,n,t.page??r]),ie(ae.current)}catch(e){if(L.current!==i)return;throw M(e instanceof Error?e.message:t(`errorOpenLibrary`)),c([]),C(0),ae.current=a,ie(a),e}finally{L.current===i&&(O(!1),ee(!1))}},[w,t]),ue=async()=>{a&&await le(a,v,b)},de=async e=>{e!==a&&(++L.current,++re.current,++R.current,c([]),C(0),ee(!1),o(e),M(null),N(``),F([]),u([]),x(1),E(!1),f(``))},fe=async e=>{let t=e||a;if(!t)return[];if(l.length>0&&t===a)return l;let n=++re.current,r=await K.getLibrary(t);return re.current===n&&u(r),r},pe=async()=>{if(!a)return;let e=++R.current;ee(!0),F([]),N(``);try{let t=await K.getLibraryRaw(a);if(R.current!==e)return;f(t.text),h(t.text),E(!0)}catch(n){R.current===e&&M(n instanceof Error?n.message:t(`errorOpenLibrary`))}finally{R.current===e&&ee(!1)}},me=()=>{f(``),F([]),E(!1)},he=()=>{try{let e=JSON.parse(d);return f(JSON.stringify(e,null,2)),F([]),{ok:!0,message:``}}catch(e){let n=e instanceof Error?e.message:t(`errorJsonInvalid`);return M(n),{ok:!1,message:n}}},ge=async()=>{if(!a)return{ok:!1,message:t(`errorNoLibrarySelected`)};M(null),N(``),F([]);let e;try{e=JSON.parse(d)}catch{return{ok:!1,message:t(`errorJsonInvalid`)}}A(!0);try{let n=await K.saveLibrary(a,e);return await ce(),h(JSON.stringify(e,null,2)),u(e),await le(n.name,v,1),o(n.name),N(t(`librarySaveSuccess`,{count:n.count})),{ok:!0,message:``}}catch(e){let n=Li(e);return n.length&&F(n),{ok:!1,message:e instanceof Error?e.message:t(`errorSaveLibrary`)}}finally{A(!1)}},_e=async()=>{let e=g.trim();if(!e)return{ok:!1,message:t(`errorLibraryNameRequired`)};M(null),N(``),F([]),A(!0);try{let n=e.endsWith(`.json`)?e:`${e}.json`,r=await K.saveLibrary(n,[]);return _(``),await ce(),u([]),o(r.name),await le(r.name,``,1),N(t(`libraryCreateSuccess`)),{ok:!0,message:``}}catch(e){return{ok:!1,message:e instanceof Error?e.message:t(`errorCreateLibrary`)}}finally{A(!1)}},ve=async(e,n,r=``,i=``)=>{M(null),N(``),F([]),A(!0);try{let a=await K.importLibrary(e,n,r,i);return await ce(),u([]),o(a.name),await le(a.name,``,1),N(t(`libraryImportSuccess`,{count:a.count,name:a.name})),{ok:!0,message:``}}catch(e){let n=Li(e);return n.length&&F(n),{ok:!1,message:e instanceof Error?e.message:t(`errorImportLibrary`)}}finally{A(!1)}},ye=async e=>{A(!0),M(null),N(``),F([]);try{await K.deleteLibrary(e),await ce(),a===e&&(o(null),c([]),u([]),C(0),h(`[]`),E(!1),f(``))}finally{A(!1)}},be=async(e,n)=>{if(!a)return{ok:!1,message:t(`errorNoLibrarySelected`)};A(!0),M(null),F([]);try{let r=await K.saveLibraryEntry(a,n,e);return await le(a,v,b),u([]),N(t(`librarySaveSuccess`,{count:r.count})),{ok:!0,message:``}}catch(e){let n=Li(e);return n.length&&F(n),{ok:!1,message:e instanceof Error?e.message:t(`errorSaveLibrary`)}}finally{A(!1)}},xe=async e=>{if(!a)return{ok:!1,message:t(`errorNoLibrarySelected`)};A(!0),M(null);try{let t=await K.deleteLibraryEntry(a,e),n=Math.min(b,Math.max(1,Math.ceil(t.count/w)));return await le(a,v,n),u([]),{ok:!0,message:``}}catch(e){return{ok:!1,message:e instanceof Error?e.message:t(`errorDeleteLibrary`)}}finally{A(!1)}};(0,p.useEffect)(()=>{e&&ce()},[e,ce]),(0,p.useEffect)(()=>{++L.current;let e=oe.current!==v;if(oe.current=v,!a||T)return;let t=window.setTimeout(()=>{le(a,v,b).catch(()=>void 0)},e?250:0),n=L;return()=>{window.clearTimeout(t),++n.current}},[a,v,b,T,le]);let Se=z===se;return{libraries:r,activeLibraryName:a,entries:Se?s:[],generatorEntries:l,editorValue:d,setEditorValue:f,draftName:g,setDraftName:_,searchTerm:v,setSearchTerm:y,entryPage:b,setEntryPage:x,entryTotal:Se?S:0,entryLimit:w,isEditing:T,isDirty:T&&d!==m,isLoading:D||!!a&&!Se&&!T,isRefreshing:k,isSubmitting:te,error:j,statusMessage:ne,setStatusMessage:N,validationIssues:P,openLibrary:de,refreshActiveLibrary:ue,ensureGeneratorEntries:fe,startEditing:pe,cancelEditing:me,formatEditor:he,saveLibrary:ge,createLibrary:_e,importLibrary:ve,deleteLibrary:ye,saveEntry:be,removeEntry:xe,refreshLibraries:ce}},zi=`universal-extractor:ui-preferences`,Bi={interfaceDensity:`standard`,defaultSelectionMode:!1,collapseSidebarOnLaunch:!1,enableImagePrefetch:!0,enableLiveGalleryRefresh:!0,defaultFolderTreeView:!0},Vi=()=>{try{let e=JSON.parse(Et(zi)||`{}`);return{interfaceDensity:e.interfaceDensity===`compact`?`compact`:`standard`,defaultSelectionMode:typeof e.defaultSelectionMode==`boolean`?e.defaultSelectionMode:Bi.defaultSelectionMode,collapseSidebarOnLaunch:typeof e.collapseSidebarOnLaunch==`boolean`?e.collapseSidebarOnLaunch:Bi.collapseSidebarOnLaunch,enableImagePrefetch:typeof e.enableImagePrefetch==`boolean`?e.enableImagePrefetch:Bi.enableImagePrefetch,enableLiveGalleryRefresh:typeof e.enableLiveGalleryRefresh==`boolean`?e.enableLiveGalleryRefresh:Bi.enableLiveGalleryRefresh,defaultFolderTreeView:typeof e.defaultFolderTreeView==`boolean`?e.defaultFolderTreeView:Bi.defaultFolderTreeView}}catch{return Bi}},Hi=()=>{let[e,t]=(0,p.useState)(Vi),n=(0,p.useCallback)(e=>{t(t=>({...t,...e}))},[]);return(0,p.useEffect)(()=>{Dt(zi,JSON.stringify(e))},[e]),{preferences:e,update:n}},Ui={folder:`default_output::`,board:``,query:``,category:``,dateFrom:``,dateTo:``,favorites:!1,color:``,sort:`created_at`,order:`desc`,page:1},Wi=[`tab`,`library`,`folder`,`board`,`q`,`category`,`from`,`to`,`pinned`,`color`,`sort`,`order`,`page`],Gi=e=>(e||``).slice(0,256),Ki=e=>/^\d{4}-\d{2}-\d{2}$/.test(e||``)?e:``,qi=e=>{let t=new URLSearchParams(e),n=t.get(`tab`),r=n===`library`||n===`workbench`||n===`settings`?n:`gallery`,i=Number(t.get(`page`)||1),a=Number.isSafeInteger(i)&&i>=1&&i<=1e5?i:1,o=t.get(`sort`),s=t.get(`order`),c=Gi(t.get(`board`)),l=t.get(`pinned`)===`1`,u=Gi(t.get(`folder`))||(c||l?``:Ui.folder);return{tab:r,library:Gi(t.get(`library`)),gallery:{folder:u,board:c,query:Gi(t.get(`q`)),category:Gi(t.get(`category`)),dateFrom:Ki(t.get(`from`)),dateTo:Ki(t.get(`to`)),favorites:l,color:Gi(t.get(`color`)),sort:o===`filename`||o===`size`?o:Ui.sort,order:s===`asc`?`asc`:Ui.order,page:a}}},Ji=(e,t)=>{let n=new URL(e);Wi.forEach(e=>n.searchParams.delete(e));let r=(e,t,r)=>{t!==r&&t!==``&&n.searchParams.set(e,String(t))};return r(`tab`,t.tab,`gallery`),(t.tab===`library`||t.tab===`workbench`)&&r(`library`,t.library,``),r(`folder`,t.gallery.folder,Ui.folder),r(`board`,t.gallery.board,``),r(`q`,t.gallery.query,``),r(`category`,t.gallery.category,``),r(`from`,t.gallery.dateFrom,``),r(`to`,t.gallery.dateTo,``),t.gallery.favorites&&n.searchParams.set(`pinned`,`1`),r(`color`,t.gallery.color,``),r(`sort`,t.gallery.sort,Ui.sort),r(`order`,t.gallery.order,Ui.order),r(`page`,t.gallery.page,1),`${n.pathname}${n.search}${n.hash}`},Yi=(e,t)=>{let n=e=>({...e,gallery:{...e.gallery,query:``}});return e.gallery.query!==t.gallery.query&&JSON.stringify(n(e))===JSON.stringify(n(t))},Xi=`universal-extractor:onboarding-tour-v1-completed`,Zi=()=>{try{return window.localStorage.getItem(Xi)===`true`}catch{return!1}},Qi=()=>{try{window.localStorage.setItem(Xi,`true`)}catch{}},$i=`universal-extractor-workflow`,ea=`universal-extractor:workflow-message`,ta=`universal-extractor:lora-stack-message`,na=`universal-extractor:workflow-probe`,ra=`universal-extractor:workflow-ack`,ia=`universal-extractor:workflow-delivered`,aa=`universal-extractor:lora-stack-delivered`,oa=900,sa=8e3,ca=2,la=e=>{if(!e||typeof e!=`object`)return;let t=e,n=[t.applied,t.added,t.updated,t.removed];if(typeof t.target==`string`&&n.every(e=>Number.isSafeInteger(e)&&e>=0))return{target:t.target.slice(0,120),applied:t.applied,added:t.added,updated:t.updated,removed:t.removed}},ua=(e,t,n,r=!1)=>new Promise(i=>{if(!(`BroadcastChannel`in window)){i({delivered:!1,ok:!1});return}let a=!1,o=null,s=`${e.id}-probe`,c=new BroadcastChannel($i),l=[],u=0,d=0,f=()=>{window.clearTimeout(u),window.clearTimeout(d),c.close()},p=e=>{a||(a=!0,f(),i(e))};c.addEventListener(`message`,t=>{let i=t.data;if(i&&typeof i==`object`){if(i.type===ra&&i.probeId===s&&typeof i.instanceId==`string`)l.push(i);else if(i.type===n&&i.payloadId===e.id&&o&&i.instanceId===o){if(r&&i.loraStackProtocol!==ca){p({delivered:!0,ok:!1,outdatedBridge:!0});return}let e=la(i.summary);if(r&&i.ok!==!1&&!e){p({delivered:!0,ok:!1,outdatedBridge:!0});return}p({delivered:!0,ok:i.ok!==!1,error:typeof i.error==`string`?i.error:void 0,summary:e})}}}),c.postMessage({type:na,probeId:s,payloadId:e.id}),d=window.setTimeout(()=>{if(a)return;let n=l.find(e=>e.focused)??l.find(e=>e.visibilityState===`visible`)??l[0];n?r&&n.loraStackProtocol!==ca?p({delivered:!1,ok:!1,outdatedBridge:!0}):(o=n.instanceId,c.postMessage({type:t,targetInstanceId:n.instanceId,payload:e}),u=window.setTimeout(()=>p({delivered:!1,ok:!1}),sa)):p({delivered:!1,ok:!1})},oa)}),da=async e=>{let t=await ua(e,ea,ia);return t.delivered&&t.ok},fa=e=>ua(e,ta,aa,!0),pa=(0,p.lazy)(()=>Fr(()=>import(`./ImageDetailModal-Bv5UXO0m.js`).then(e=>({default:e.ImageDetailModal})),__vite__mapDeps([1]))),ma=(0,p.lazy)(()=>Fr(()=>import(`./LibraryWorkspace-CPcrzo6d.js`).then(e=>({default:e.LibraryWorkspace})),[])),ha=(0,p.lazy)(()=>Fr(()=>import(`./SettingsWorkspace-BaJRJ6EV.js`).then(e=>({default:e.SettingsWorkspace})),__vite__mapDeps([2]))),ga=(0,p.lazy)(()=>Fr(()=>import(`./WorkbenchWorkspace-CpFPCzJz.js`).then(e=>({default:e.WorkbenchWorkspace})),__vite__mapDeps([3]))),_a=`universal-extractor:pending-workflow`,va=`default_output::`,ya=`::`,ba=e=>e.includes(ya)&&e.split(ya,2)[1]===``,xa=e=>e.startsWith(va)?e.slice(16):e,Sa=(e,t)=>{let n=t.trim().toLowerCase();return!n||e.filename.toLowerCase().includes(n)},Ca=()=>{try{window.localStorage.removeItem(_a)}catch{}},wa=e=>{try{window.localStorage.setItem(_a,JSON.stringify(e))}catch{Ca()}};function Ta(){let{t:e}=n(),{confirm:t,choose:r}=At(),{pushToast:i}=ln(),{runOperation:a,syncTask:o}=qe(),s=(0,p.useMemo)(()=>qi(window.location.search),[]),[c,l]=(0,p.useState)(s.tab===`workbench`),[u,d]=(0,p.useState)(!1),[f,m]=(0,p.useState)(s.tab),[h,g]=(0,p.useState)(``),{preferences:_,update:v}=Hi(),[y,b]=(0,p.useState)(()=>_.defaultFolderTreeView?`tree`:`list`),[x,S]=(0,p.useState)(()=>window.innerWidth<=960||_.collapseSidebarOnLaunch),[C,w]=(0,p.useState)(!1),[T,E]=(0,p.useState)(!1),[D,O]=(0,p.useState)([]),[k,ee]=(0,p.useState)(0),te=(0,p.useRef)(null),A=(0,p.useCallback)(e=>{te.current=e},[]),[j,M]=(0,p.useState)(null),[ne,N]=(0,p.useState)(!1),[P,F]=(0,p.useState)(()=>!Zi()),I=Fi({interactionBlocked:T||C,isActive:f===`gallery`,liveRefreshEnabled:_.enableLiveGalleryRefresh,thumbnailPrewarmEnabled:_.enableImagePrefetch,initialScope:s.gallery});ft(!0);let L=(0,p.useRef)(null);(0,p.useEffect)(()=>{if(!I.autoSyncFailure){L.current&&=(o(L.current,e(`jobRefresh`),`success`,e(`jobCompleted`)),null);return}let t=I.autoSyncFailure,n=t.error instanceof di?t.error:null;L.current=n?`refresh:${n.scope}`:`auto-sync`,o(L.current,e(`galleryAutoSyncFailed`),`error`,t.error instanceof Error?t.error.message:String(t.error),t.retry,n?{jobId:n.jobId,taskKind:`refresh_index`,source:`gallery`}:void 0)},[I.autoSyncFailure,o,e]);let re=f===`library`||f===`workbench`,R=(n,r)=>{let i=r?I.restoreTrashItems:I.purgeTrashItems,o=e(r?`operationRestoreTrash`:`operationPurgeTrash`),s=(t,n)=>n.unfinished.length?e(`trashBatchPartial`,{completed:n.completed.length,unfinished:n.unfinished.length}):e(r?`trashRestoreSelectedSuccess`:`trashDeleteSelectedSuccess`,{count:n.completed.length});return a(()=>i(n),{pending:o,success:e=>s(n,e),successTone:e=>e.unfinished.length?`error`:`success`,successDetail:e=>e.error,successRetry:n=>pt({paths:n.unfinished,execute:i,confirm:t,run:a,pending:o,failed:(e,t)=>t.unfinished,summary:s,confirmation:t=>({title:e(r?`trashRestoreSelected`:`trashDeleteSelectedForever`),message:e(r?`trashRestoreSelectedConfirm`:`trashDeleteSelectedConfirm`,{count:t}),tone:r?`warning`:`danger`,confirmLabel:e(r?`trashRestore`:`trashDeleteForever`),cancelLabel:e(`libraryCancel`)})})})},z=Ri(re),ie=(0,p.useRef)(s.tab===`library`||s.tab===`workbench`?s.library:``);(0,p.useEffect)(()=>{let e=ie.current;e&&(ie.current=``,z.openLibrary(e))},[z]);let ae=(0,p.useMemo)(()=>z.libraries.filter(e=>Sa(e,h)),[z.libraries,h]),oe=z.entryTotal<=5e3,se=e=>{v(e),e.defaultFolderTreeView!==void 0&&b(e.defaultFolderTreeView?`tree`:`list`),e.collapseSidebarOnLaunch!==void 0&&window.innerWidth>960&&S(e.collapseSidebarOnLaunch)},ce=(0,p.useCallback)(async()=>!z.isDirty||t({title:e(`libraryUnsavedTitle`),message:e(`libraryUnsavedConfirm`),tone:`warning`,confirmLabel:e(`libraryDiscardChanges`),cancelLabel:e(`libraryCancel`)}),[t,z.isDirty,e]),le=async({confirmOptions:e,operation:n,operationOptions:r})=>{if(await t(e))return a(n,r)},ue=I.selectedImage,de=I.setSelectedImage,fe=(0,p.useCallback)(async()=>{if(!ue)return!0;let e=te.current;return!e||!await e()?!1:(de(null),!0)},[ue,de]),pe=async n=>{n!==f&&(f!==`settings`||n===`settings`||!u||await t({title:e(`qolDiscardTitle`),message:e(`qolDiscardBody`),tone:`warning`,confirmLabel:e(`modalDiscardChanges`),cancelLabel:e(`libraryCancel`)}))&&(f!==`library`||n===`library`||await ce())&&await fe()&&(0,p.startTransition)(()=>{n===`workbench`&&l(!0),m(n)})},me=e=>{f===`gallery`?(0,p.startTransition)(()=>{I.setSearchTerm(e),I.setPage(1)}):(0,p.startTransition)(()=>{g(e),z.setSearchTerm(e),z.setEntryPage(1)})},he=async n=>{if((f!==`settings`||!u||await t({title:e(`qolDiscardTitle`),message:e(`qolDiscardBody`),tone:`warning`,confirmLabel:e(`modalDiscardChanges`),cancelLabel:e(`libraryCancel`)}))&&(f!==`library`||z.activeLibraryName===n||await ce())&&await fe()){(0,p.startTransition)(()=>{m(`library`)});try{await z.openLibrary(n)}catch(t){i(t instanceof Error?t.message:e(`errorOpenLibrary`),`error`)}}},ge=async()=>{await a(async()=>{let e=await z.createLibrary();if(!e.ok&&e.message)throw Error(e.message);return I.refresh(),e},{pending:e(`operationCreateLibrary`),success:e(`libraryCreateSuccess`),error:t=>t instanceof Error?t.message:e(`errorCreateLibrary`)}).catch(()=>void 0)},_e=async t=>{(z.activeLibraryName!==t||await ce())&&await le({confirmOptions:{title:e(`commonDelete`),message:e(`confirmDeleteLibrary`,{name:t}),tone:`warning`,confirmLabel:e(`commonDelete`),cancelLabel:e(`libraryCancel`)},operation:()=>z.deleteLibrary(t),operationOptions:{pending:e(`operationDeleteLibrary`),success:e(`commonDelete`),error:t=>t instanceof Error?t.message:e(`errorDeleteLibrary`)}}).catch(()=>void 0)},ve=async()=>{await le({confirmOptions:{title:e(`librarySaveConfirmTitle`),message:e(`librarySaveConfirm`,{name:z.activeLibraryName??``}),tone:`warning`,confirmLabel:e(`librarySave`),cancelLabel:e(`libraryCancel`)},operation:async()=>{let e=await z.saveLibrary();if(!e.ok&&e.message)throw Error(e.message);return e},operationOptions:{pending:e(`operationSaveLibrary`),success:e(`librarySaveSuccess`,{count:z.entryTotal}),error:t=>t instanceof Error?t.message:e(`errorSaveLibrary`)}}).catch(()=>void 0)},ye=async()=>{(f!==`library`||await ce())&&(f===`gallery`||f===`settings`?await I.refreshAndWait().catch(t=>{let n=t instanceof di?t:null;o(`refresh:${n?.scope??I.selectedSubfolder}`,e(`jobRefresh`),`error`,t instanceof Error?t.message:e(`galleryEmptyErrorTitle`),()=>{ye()},n?{jobId:n.jobId,taskKind:`refresh_index`,source:`gallery`}:void 0)}):await a(async()=>{await z.refreshLibraries(),z.activeLibraryName&&await z.refreshActiveLibrary()},{taskKind:`library_refresh`,pending:e(`operationRefresh`)}))},be=()=>{z.activeLibraryName&&K.getLibraryRaw(z.activeLibraryName).then(e=>{let t=new Blob([e.text],{type:`application/json;charset=utf-8`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=z.activeLibraryName,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(n)}).catch(t=>{i(t instanceof Error?t.message:e(`errorOpenLibrary`),`error`)})},xe=()=>{let e=!I.selectedSubfolder||I.selectedSubfolder===va?``:ba(I.selectedSubfolder)?I.selectedSubfolder:`${xa(I.selectedSubfolder)}/`;M({mode:`create`,initialValue:e})},Se=()=>{Qi(),F(!1)},Ce=async n=>{if(!await t({title:e(`boardCreateTitle`),message:e(`boardCreateConfirm`,{name:n}),tone:`warning`,confirmLabel:e(`commonCreate`),cancelLabel:e(`libraryCancel`)}))return;let r=await a(()=>I.createBoard(n),{pending:e(`operationCreateBoard`),success:e(`boardCreateSuccess`),error:t=>t instanceof Error?t.message:e(`boardCreateError`)});r.board?.id&&(I.setSelectedBoardId(r.board.id),I.setSelectedSubfolder(``),I.setFavoritesOnly(!1),I.setPage(1))},B=async n=>{if(j){if(j.mode===`create`)await a(()=>I.createFolder(n),{pending:e(`operationCreateFolder`),success:e(`folderCreateSuccess`),error:t=>t instanceof Error?t.message:e(`folderCreateError`)}),I.refresh();else if(j.mode===`merge`){if(!await t({title:e(`folderMergeTitle`),message:e(`folderMergeConfirm`,{name:xa(j.sourcePath??I.selectedSubfolder),target:n}),tone:`warning`,confirmLabel:e(`sidebarMergeFolder`),cancelLabel:e(`libraryCancel`)}))return;await a(()=>I.mergeFolder(j.sourcePath??I.selectedSubfolder,n),{pending:e(`operationMergeFolder`),success:e(`folderMergeSuccess`),error:t=>t instanceof Error?t.message:e(`folderMergeError`)})}else if(j.sourcePath){let r=j.sourcePath;if(!await t({title:e(`folderRenameTitle`),message:e(`folderRenameConfirm`,{name:xa(r),target:n}),tone:`warning`,confirmLabel:e(`folderRename`),cancelLabel:e(`libraryCancel`)}))return;await a(()=>I.renameFolder(r,n),{pending:e(`operationRenameFolder`),success:e(`folderRenameSuccess`),error:t=>t instanceof Error?t.message:e(`folderRenameError`)})}}},we=async(t=I.selectedSubfolder)=>{t&&await le({confirmOptions:{title:e(`commonDelete`),message:e(`folderDeleteConfirm`,{name:xa(t)}),tone:t.includes(`/`)?`warning`:`danger`,confirmLabel:e(`commonDelete`),cancelLabel:e(`libraryCancel`)},operation:()=>I.deleteFolder(t),operationOptions:{pending:e(`operationDeleteFolder`),success:e(`folderDeleteSuccess`),error:t=>t instanceof Error?t.message:e(`folderDeleteError`)}}).catch(()=>void 0)},Te=(e=I.selectedSubfolder)=>{e&&M({mode:`merge`,initialValue:``,sourcePath:e})},Ee=e=>{e&&M({mode:`rename`,initialValue:xa(e),sourcePath:e})},De=async(n,r)=>{if(!n||!r)return;let i=Ht(n)||xa(n);await t({title:e(`folderMoveTitle`),message:e(`folderMoveConfirm`,{name:i,target:xa(r)}),tone:`warning`,confirmLabel:e(`folderMove`),cancelLabel:e(`libraryCancel`)})&&await a(()=>I.renameFolder(n,r),{pending:e(`operationMoveFolder`),success:e(`folderMoveSuccess`),error:t=>t instanceof Error?t.message:e(`folderMoveError`)}).catch(()=>void 0)},V=async t=>{try{await z.openLibrary(t)}catch(t){i(t instanceof Error?t.message:e(`errorOpenLibrary`),`error`)}},Oe=async(n,r=``)=>{if(!n.length)return;let o=I.context?.sources.find(e=>e.id===r)||I.context?.sources.find(e=>e.enabled&&e.writable&&e.import_target),s=I.context?.import_image_subfolder||`universal_gallery_imports`;if(!await t({title:e(`galleryImportConfirmTitle`),message:e(`galleryImportConfirm`,{count:n.length,target:`${o?.name||r||e(`galleryOutputFolder`)} / ${s}/`}),tone:`info`,confirmLabel:e(`libraryImport`),cancelLabel:e(`libraryCancel`)}))return;let c=await a(()=>I.importFiles(n,r),{pending:e(`operationImportFiles`),success:t=>e(`galleryImportSuccess`,{count:t.imported_images.length+t.imported_libraries.length}),error:t=>t instanceof Error?t.message:e(`errorImportLibrary`)});await z.refreshLibraries(),c.skipped.length>0&&i(e(`galleryImportSkipped`,{count:c.skipped.length}),`info`)},ke=async(e,t)=>{await I.updateImageState(e,t),I.searchTerm.trim()&&I.refresh()},Ae=async(t,n)=>{await a(()=>I.renameImage(t,n),{pending:e(`operationRenameImage`),success:e(`modalRenameFile`),error:t=>t instanceof Error?t.message:e(`imageRenameError`)})},je=async t=>{await a(async()=>{if((await I.deleteImages([t])).deleted.length!==1)throw Error(e(`imageDeleteMissing`))},{pending:e(`operationDeleteImage`),success:e(`imageDelete`),error:t=>t instanceof Error?t.message:e(`imageDeleteError`)})},Me=async n=>{await t({title:e(`modalOpenWorkflow`),message:e(`workflowSendConfirm`,{name:n.relative_path}),tone:`warning`,confirmLabel:e(`commonSend`),cancelLabel:e(`libraryCancel`)})&&await a(async()=>{let t=await K.getImageMetadata(n.relative_path),r={id:`wf-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,workflow:t.workflow,prompt:t.metadata&&typeof t.metadata==`object`?t.metadata.prompt??null:null,image:n.relative_path,imageUrl:n.original_url||n.url||null,ts:Date.now()};if(!r.workflow&&!r.prompt)throw Error(e(`modalNoMetadata`));if(wa(r),!await da(r))throw Error(e(`workflowNoComfyPage`));Ca()},{pending:e(`operationSendWorkflow`),success:e(`workflowSendSuccess`),error:t=>t instanceof Error?t.message:e(`modalNoMetadata`)}).catch(()=>void 0)},Ne=async t=>{let n=await a(async()=>{let n=(await K.getImageMetadata(t.relative_path)).recipe?.lora_manager;if(!n?.detected||!Array.isArray(n.loras)||!n.loras.some(e=>e&&e.enabled!==!1&&typeof e.name==`string`&&e.name.trim()))throw Error(e(`loraStackApplyNoStack`));return n},{pending:e(`loraStackReading`),error:t=>t instanceof Error?t.message:e(`loraStackApplyNoStack`)}).catch(()=>null);if(!n)return;let i=new Map(n.loras.filter(e=>e&&e.enabled!==!1&&typeof e.name==`string`&&e.name.trim()).map(e=>[e.name.trim(),e])),o=[...i.values()].filter(e=>{let t=Number(e.strength_model??1),n=Number(e.strength_clip??t);return Number.isFinite(t)&&Number.isFinite(n)&&t!==n}).length,s=await r({title:e(`loraStackApply`),message:e(`loraStackApplyConfirm`,{name:t.relative_path,count:i.size})+(o?`\n${e(`loraStackClipWarning`,{count:o})}`:``),tone:`warning`,confirmLabel:e(`loraStackAppend`),alternativeLabel:e(`loraStackReplace`),cancelLabel:e(`libraryCancel`)});if(s===`cancel`)return;let c=s===`confirm`?`append`:`replace`;await a(async()=>{let r=await fa({id:`lora-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,mode:c,loraManager:n,image:t.relative_path,imageUrl:t.original_url||t.url||null,ts:Date.now()});if(r.outdatedBridge)throw Error(e(`loraStackBridgeOutdated`));if(!r.delivered)throw Error(e(`loraStackApplyNoComfyPage`));if(!r.ok)throw Error(r.error||e(`loraStackApplyNoTargetNode`));return r.summary},{pending:e(`operationApplyLoraStack`),success:t=>t?e(c===`append`?`loraStackAppendedSuccess`:`loraStackReplacedSuccess`,{count:t.applied,name:t.target}):e(`loraStackApplySuccess`),successDetail:t=>t?e(c===`append`?`loraStackAppendDetail`:`loraStackReplaceDetail`,{added:t.added,updated:t.updated,removed:t.removed}):``,error:t=>t instanceof Error?t.message:e(`loraStackApplyNoStack`)}).catch(()=>void 0)},Pe=(0,p.useMemo)(()=>{let e=new Set(I.selectedImagePaths);return D.filter(t=>e.has(t.relative_path))},[D,I.selectedImagePaths]),Fe=(0,p.useMemo)(()=>I.boards.find(e=>e.id===I.selectedBoardId)??null,[I.boards,I.selectedBoardId]),[Ie,Le]=(0,p.useState)(!1),Re=(0,p.useRef)(!1);(0,p.useEffect)(()=>{Re.current=T&&Pe.length>0},[T,Pe.length]);let ze=(0,p.useCallback)(e=>{e&&Le(Re.current),w(e)},[]),Be=f===`gallery`&&T&&!I.isTrashView&&(C?Ie:Pe.length>0),Ve=(e,t)=>{let n=t?.some(t=>t.relative_path===e.relative_path)?t:[e];I.setSelectedImage(e),I.setDetailNavigation({items:n,currentIndex:n.findIndex(t=>t.relative_path===e.relative_path)})},H=(0,p.useMemo)(()=>({tab:f,library:f===`library`||f===`workbench`?z.activeLibraryName??``:``,gallery:{folder:I.selectedSubfolder,board:I.selectedBoardId,query:I.searchTerm,category:I.selectedCategory,dateFrom:I.dateFrom,dateTo:I.dateTo,favorites:I.favoritesOnly,color:I.selectedColorFamily,sort:I.sortBy,order:I.sortOrder,page:I.page}}),[f,z.activeLibraryName,I.selectedSubfolder,I.selectedBoardId,I.searchTerm,I.selectedCategory,I.dateFrom,I.dateTo,I.favoritesOnly,I.selectedColorFamily,I.sortBy,I.sortOrder,I.page]),He=(0,p.useRef)(`${window.location.pathname}${window.location.search}${window.location.hash}`),W=(0,p.useRef)(s),Ue=(0,p.useRef)(!1),We=(0,p.useRef)(!1);return(0,p.useEffect)(()=>{if(s.library&&(s.tab===`library`||s.tab===`workbench`)&&!z.activeLibraryName)return;let e=Ji(window.location.href,H),t=`${window.location.pathname}${window.location.search}${window.location.hash}`;if(Ue.current){e===t&&(Ue.current=!1,W.current=H,He.current=t);return}if(e===t){W.current=H,He.current=t;return}let n=Yi(W.current,H),r=()=>{`${window.location.pathname}${window.location.search}${window.location.hash}`!==e&&window.history[n?`replaceState`:`pushState`](window.history.state,``,e),W.current=H,He.current=e};if(n){let e=window.setTimeout(r,400);return()=>window.clearTimeout(e)}r()},[s,z.activeLibraryName,H]),(0,p.useEffect)(()=>{let n=()=>window.history.pushState(window.history.state,``,He.current),r=async()=>{if(We.current)n();else{We.current=!0;try{let r=qi(window.location.search),i=f===`library`&&(r.tab!==`library`||r.library!==(z.activeLibraryName??``));if(i&&!await ce()||f===`settings`&&r.tab!==`settings`&&u&&!await t({title:e(`qolDiscardTitle`),message:e(`qolDiscardBody`),tone:`warning`,confirmLabel:e(`modalDiscardChanges`),cancelLabel:e(`libraryCancel`)})||!await fe()){n();return}i&&z.isEditing&&z.cancelEditing();let a=Ji(window.location.href,r);a!==`${window.location.pathname}${window.location.search}${window.location.hash}`&&window.history.replaceState(window.history.state,``,a),Ue.current=!0,I.applyUrlScope(r.gallery),(r.tab===`library`||r.tab===`workbench`)&&z.openLibrary(r.library||null),r.tab===`workbench`&&l(!0),m(r.tab),Ji(window.location.href,H)===a&&(Ue.current=!1,W.current=r,He.current=a)}catch{n()}finally{We.current=!1}}};return window.addEventListener(`popstate`,r),()=>window.removeEventListener(`popstate`,r)},[f,fe,t,ce,I,z,u,e,H]),(0,U.jsxs)(`div`,{className:`ue-app-shell`,"data-density":_.interfaceDensity||`standard`,children:[(0,U.jsx)(Qr,{activeTab:f,onTabChange:pe,searchValue:f===`gallery`?I.searchTerm:f===`library`?h:``,onSearchChange:me,onRefresh:ye,sidebarCollapsed:x,onSidebarToggle:()=>S(e=>!e)}),!x&&(0,U.jsx)(`div`,{className:`ue-sidebar-overlay`,onClick:()=>S(!0),"aria-hidden":`true`}),(0,U.jsxs)(`div`,{className:`ue-body-shell ${x?`is-sidebar-collapsed`:``} ${Be?`has-inspector`:``}`,children:[(0,U.jsx)(ei,{collapsed:x,onToggle:()=>S(e=>!e),activeTab:f,galleryContext:I.context,folderViewMode:y,onFolderViewModeChange:b,selectedCategory:I.selectedCategory,selectedSubfolder:I.selectedSubfolder,selectedBoardId:I.selectedBoardId,pinnedOnly:I.favoritesOnly,onCategorySelect:e=>{I.setSelectedCategory(e),I.setPage(1)},onSubfolderSelect:e=>{I.setSelectedBoardId(``),I.setFavoritesOnly(!1),I.setSelectedSubfolder(e),I.setPage(1)},onBoardSelect:e=>{I.setSelectedBoardId(e),I.setFavoritesOnly(!1),I.setSelectedSubfolder(``),I.setPage(1)},onPinnedOnlySelect:()=>{I.setSelectedBoardId(``),I.setSelectedSubfolder(``),I.setFavoritesOnly(!0),I.setPage(1)},onCreateBoard:()=>N(!0),onCreateFolder:xe,onDeleteFolder:we,onMergeFolder:Te,onRenameFolder:Ee,onMoveFolder:De,libraries:ae,activeLibraryName:z.activeLibraryName,onLibrarySelect:he,onLibraryDelete:_e,draftName:z.draftName,onDraftNameChange:z.setDraftName,onCreateLibrary:ge}),(0,U.jsxs)(`main`,{className:`ue-main-shell`,children:[f===`gallery`?(0,U.jsx)(Gr,{images:I.images,context:I.context,total:I.total,page:I.page,totalPages:I.totalPages,selectedCategory:I.selectedCategory,selectedSubfolder:I.selectedSubfolder,selectedBoardId:I.selectedBoardId,dateFrom:I.dateFrom,dateTo:I.dateTo,favoritesOnly:I.favoritesOnly,selectedColorFamily:I.selectedColorFamily,colorIndexStatus:I.colorIndexStatus,sortBy:I.sortBy,sortOrder:I.sortOrder,gridColumns:I.gridColumns,selectedImagePaths:I.selectedImagePaths,trashItems:I.trashItems,isTrashView:I.isTrashView,importMessage:I.importMessage,importFolderRef:I.importFolderRef,onOpenImportFolder:e=>{I.setSelectedBoardId(``),I.setFavoritesOnly(!1),I.setSelectedSubfolder(e),I.setPage(1)},isLoading:I.isLoading,isRefreshing:I.isRefreshing,hasPendingLiveRefresh:I.hasPendingLiveRefresh,error:I.error,boards:I.boards,searchValue:I.searchTerm,onSearchChange:e=>{I.setSearchTerm(e),I.setPage(1)},defaultSelectionMode:_.defaultSelectionMode,enableImagePrefetch:_.enableImagePrefetch,interfaceDensity:_.interfaceDensity,imageDetailOpen:!!I.selectedImage,onSelectionDragChange:ze,onSelectionModeActiveChange:E,onOpenDetail:Ve,onVisibleImagesChange:O,inspectorClearSignal:k,onPageChange:I.setPage,onCategoryChange:I.setSelectedCategory,onBoardChange:I.setSelectedBoardId,onDateFromChange:I.setDateFrom,onDateToChange:I.setDateTo,onFavoritesOnlyChange:I.setFavoritesOnly,onColorFamilyChange:I.setSelectedColorFamily,onSortByChange:I.setSortBy,onSortOrderChange:I.setSortOrder,onGridColumnsChange:I.setGridColumns,onOpenWorkflow:Me,onApplyLoraStack:Ne,onSelectionChange:I.setSelectedImagePaths,onUpdateImageState:ke,onCreateBoard:I.createBoard,onUpdateBoardPins:I.updateBoardPins,onDeleteBoard:I.deleteBoard,onDeleteImages:I.deleteImages,onMoveImages:I.moveImages,onImportFiles:Oe,onApplyPendingLiveRefresh:I.refresh,onOpenSettings:()=>void pe(`settings`),onRestoreTrashItem:async n=>{await t({title:e(`trashRestore`),message:e(`trashRestoreConfirm`),tone:`warning`,confirmLabel:e(`trashRestore`),cancelLabel:e(`libraryCancel`)})&&await a(()=>I.restoreTrashItem(n),{pending:e(`operationRestoreTrash`),success:e(`trashRestore`)})},onRestoreTrashItems:async e=>R(e,!0),onPurgeTrashItem:async n=>{await t({title:e(`trashDeleteForever`),message:e(`trashEmptyText`),tone:`danger`,confirmLabel:e(`trashDeleteForever`),cancelLabel:e(`libraryCancel`)})&&await a(()=>I.purgeTrashItem(n),{pending:e(`operationPurgeTrash`),success:e(`trashDeleteForever`)})},onPurgeTrashItems:async e=>R(e,!1),trashBusy:I.trashBusy}):f===`library`?(0,U.jsx)(p.Suspense,{fallback:(0,U.jsxs)(`div`,{className:`ue-gallery-state`,children:[(0,U.jsx)(`div`,{className:`ue-loading-orb`}),(0,U.jsx)(`p`,{children:e(`galleryLoading`)})]}),children:(0,U.jsx)(ma,{onSelectLibrary:e=>void he(e),onCreateLibrary:()=>void ge(),libraries:z.libraries,activeLibraryName:z.activeLibraryName,entries:z.entries,searchTerm:h,onSearchClear:()=>{g(``),z.setSearchTerm(``),z.setEntryPage(1)},editorValue:z.editorValue,isEditing:z.isEditing,isDirty:z.isDirty,isLoading:z.isLoading,isRefreshing:z.isRefreshing,isSubmitting:z.isSubmitting,error:z.error,statusMessage:z.statusMessage,validationIssues:z.validationIssues,canUseRawEditor:oe,page:z.entryPage,totalPages:Math.max(1,Math.ceil(z.entryTotal/z.entryLimit)),totalEntries:z.entryTotal,onEditorValueChange:z.setEditorValue,onStartEditing:z.startEditing,onPageChange:z.setEntryPage,onCancelEditing:async()=>{await ce()&&z.cancelEditing()},onFormatEditor:()=>{let e=z.formatEditor();!e.ok&&e.message&&i(e.message,`error`)},onSaveLibrary:ve,onRefresh:ye,onExportLibrary:be,onImportLibrary:async(n,r,i,o)=>await t({title:e(`libraryImportConfirmTitle`),message:r===`create`?e(`libraryImportCreateConfirm`,{name:o||n.name}):e(r===`replace`?`libraryImportReplaceConfirm`:`libraryImportMergeConfirm`,{name:i}),tone:r===`replace`?`danger`:`warning`,confirmLabel:e(`libraryImportConfirm`),cancelLabel:e(`libraryCancel`)})?(await a(async()=>{let e=await z.importLibrary(n,r,i,o);if(!e.ok&&e.message)throw Error(e.message);return e},{pending:e(`operationImportLibrary`),success:e(`libraryImportSuccess`,{count:z.entryTotal,name:i||o||n.name}),error:t=>t instanceof Error?t.message:e(`errorImportLibrary`)}).catch(()=>({ok:!1,message:``}))).ok:!1,onSaveEntry:async(n,r)=>await t({title:e(`librarySaveEntryConfirmTitle`),message:e(`librarySaveEntryConfirm`),tone:`warning`,confirmLabel:e(`librarySave`),cancelLabel:e(`libraryCancel`)})?(await a(async()=>{let e=await z.saveEntry(n,r);if(!e.ok&&e.message)throw Error(e.message);return e},{pending:e(`operationSaveLibrary`),success:e(`librarySaveSuccess`,{count:z.entryTotal}),error:t=>t instanceof Error?t.message:e(`errorSaveLibrary`)}).catch(()=>({ok:!1,message:``}))).ok:!1,onDeleteEntry:async t=>(await a(async()=>{let e=await z.removeEntry(t);if(!e.ok&&e.message)throw Error(e.message);return e},{pending:e(`operationDeleteLibrary`),success:e(`commonDelete`),error:t=>t instanceof Error?t.message:e(`errorDeleteLibrary`)}).catch(()=>({ok:!1,message:``}))).ok})}):f===`workbench`?null:(0,U.jsx)(p.Suspense,{fallback:(0,U.jsxs)(`div`,{className:`ue-gallery-state`,children:[(0,U.jsx)(`div`,{className:`ue-loading-orb`}),(0,U.jsx)(`p`,{children:e(`galleryLoading`)})]}),children:(0,U.jsx)(ha,{sources:I.context?.sources??[],preferences:_,onDirtyChange:d,onPreferencesChange:se,onSourcesChange:()=>I.refresh(),onRestartOnboarding:()=>F(!0)})}),c?(0,U.jsx)(p.Activity,{mode:f===`workbench`?`visible`:`hidden`,children:(0,U.jsx)(p.Suspense,{fallback:(0,U.jsxs)(`div`,{className:`ue-gallery-state`,children:[(0,U.jsx)(`div`,{className:`ue-loading-orb`}),(0,U.jsx)(`p`,{children:e(`galleryLoading`)})]}),children:(0,U.jsx)(ga,{libraries:z.libraries,activeLibraryName:z.activeLibraryName,onLibrarySelect:V})})}):null]}),Be?(0,U.jsx)(`div`,{className:`ue-gallery-inspector-layer`,children:(0,U.jsx)(Kr,{selectedPaths:Pe.map(e=>e.relative_path),selectedSubfolder:I.selectedSubfolder,selectedBoard:Fe,boards:I.boards,page:I.page,targetFolderOptions:I.targetFolderOptions,onClose:()=>{I.setSelectedImagePaths([]),ee(e=>e+1)},onBatchUpdateImages:I.batchUpdateImages,onCreateBoard:I.createBoard,onUpdateBoardPins:I.updateBoardPins,onMoveImages:I.moveImages,onBatchRenameImages:async(t,n,r,i,o)=>a(()=>I.batchRenameImages(t,n,r,i,o),{pending:e(`operationRenameImages`),success:t=>e(`bulkRenameSuccess`,{count:t.renamed.length}),error:t=>t instanceof Error?t.message:e(`bulkRenameError`)}),onDeleteImages:I.deleteImages})}):null]}),I.selectedImage?(0,U.jsx)(p.Suspense,{fallback:null,children:(0,U.jsx)(pa,{image:I.selectedImage,onClose:()=>I.setSelectedImage(null),onSaveState:ke,onRenameFile:Ae,onDeleteFile:je,onOpenWorkflow:Me,onApplyLoraStack:Ne,navigation:I.detailNavigation,onRegisterLeave:A,onNavigate:e=>{let t=I.detailNavigation?.items??[],n=t[e];n&&(I.setSelectedImage(n),I.setDetailNavigation({items:t,currentIndex:e}))}},I.selectedImage.relative_path)}):null,(0,U.jsx)(ti,{open:j!==null,title:j?.mode===`merge`?e(`folderMergeTitle`):j?.mode===`rename`?e(`folderRenameTitle`):e(`folderCreateTitle`),text:j?.mode===`merge`?e(`folderMergeText`):j?.mode===`rename`?e(`folderRenameText`):e(`folderCreateText`),label:j?.mode===`merge`?e(`folderMergePrompt`):j?.mode===`rename`?e(`folderRenamePrompt`):e(`folderCreatePrompt`),placeholder:e(`folderPathPlaceholder`),initialValue:j?.initialValue??``,confirmLabel:j?.mode===`merge`?e(`sidebarMergeFolder`):j?.mode===`rename`?e(`folderRename`):e(`commonCreate`),onClose:()=>M(null),onSubmit:B}),(0,U.jsx)(ti,{open:ne,title:e(`boardCreateTitle`),text:e(`boardCreateText`),label:e(`boardNameLabel`),placeholder:e(`boardNamePlaceholder`),initialValue:``,confirmLabel:e(`commonCreate`),onClose:()=>N(!1),onSubmit:Ce}),(0,U.jsx)(ci,{open:P,onRequestTabChange:e=>{pe(e)},onRequestSidebarOpen:()=>S(!1),onRequestSidebarClose:()=>S(!0),onSkip:Se,onComplete:Se})]})}(0,m.createRoot)(document.getElementById(`root`)).render((0,U.jsx)(p.StrictMode,{children:(0,U.jsx)(o,{children:(0,U.jsx)(kt,{children:(0,U.jsx)(Ke,{children:(0,U.jsx)(cn,{children:(0,U.jsx)(Ta,{})})})})})}));export{F as $,Pe as A,xe as B,K as C,Re as D,Be as E,Oe as F,fe as G,ge as H,V as I,ce as J,de as K,De as L,je as M,Ae as N,Ie as O,ke as P,L as Q,Ee as R,pt as S,H as T,he as U,be as V,pe as W,ae as X,oe as Y,R as Z,At as _,xn as a,E as at,wt as b,gn as c,v as ct,mn as d,u as dt,P as et,ln as f,zt as g,Bt as h,bn as i,k as it,Me as j,Fe as k,fn as l,x as lt,$t as m,Mn as n,te as nt,vn as o,w as ot,jt as p,ue as q,Sn as r,ee as rt,_n as s,S as st,yr as t,A as tt,un as u,C as ut,Et as v,qe as w,Tt as x,Dt as y,B as z}; \ No newline at end of file diff --git a/gallery_ui/dist/assets/index-DWGqjUOp.js b/gallery_ui/dist/assets/index-DWGqjUOp.js deleted file mode 100644 index 84211e6..0000000 --- a/gallery_ui/dist/assets/index-DWGqjUOp.js +++ /dev/null @@ -1,13 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ImageSearchModal-B9S2m0Ex.css","assets/ImageDetailModal-CVSn-Zgk.css","assets/SettingsWorkspace-BYcQA0t0.css","assets/WorkbenchWorkspace-CGgZT8xC.css"])))=>i.map(i=>d[i]); -import{a as e,i as t,n,o as r,r as i,s as a,t as o}from"./I18nProvider-cZczvL7B.js";var s=r((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,D());else{var t=n(l);t!==null&&re(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function ee(){return g?!0:!(e.unstable_now()-Tt&&ee());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&re(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?D():S=!1}}}var D;if(typeof y==`function`)D=function(){y(E)};else if(typeof MessageChannel<`u`){var te=new MessageChannel,ne=te.port2;te.port1.onmessage=E,D=function(){ne.postMessage(null)}}else D=function(){_(E,0)};function re(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,re(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,D()))),r},e.unstable_shouldYield=ee,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),c=r(((e,t)=>{t.exports=s()})),l=r((t=>{var n=e();function r(e){var t=`https://react.dev/errors/`+e;if(1{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=l()})),d=r((t=>{var n=c(),r=e(),i=u();function a(e){var t=`https://react.dev/errors/`+e;if(1F||(e.current=P[F],P[F]=null,F--)}function L(e,t){F++,P[F]=e.current,e.current=t}var R=ae(null),oe=ae(null),se=ae(null),ce=ae(null);function le(e,t){switch(L(se,t),L(oe,e),L(R,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}I(R),L(R,e)}function ue(){I(R),I(oe),I(se)}function de(e){e.memoizedState!==null&&L(ce,e);var t=R.current,n=Hd(t,e.type);t!==n&&(L(oe,e),L(R,n))}function fe(e){oe.current===e&&(I(R),I(oe)),ce.current===e&&(I(ce),Qf._currentValue=N)}var pe,me;function he(e){if(pe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);pe=t&&t[1]||``,me=-1)`:-1i||c[r]!==l[i]){var u=` -`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(``)&&(u=u.replace(``,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{ge=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?he(n):``}function ve(e,t){switch(e.tag){case 26:case 27:case 5:return he(e.type);case 16:return he(`Lazy`);case 13:return e.child!==t&&t!==null?he(`Suspense Fallback`):he(`Suspense`);case 19:return he(`SuspenseList`);case 0:case 15:return _e(e.type,!1);case 11:return _e(e.type.render,!1);case 1:return _e(e.type,!0);case 31:return he(`Activity`);default:return``}}function ye(e){try{var t=``,n=null;do t+=ve(e,n),n=e,e=e.return;while(e);return t}catch(e){return` -Error generating stack: `+e.message+` -`+e.stack}}var be=Object.prototype.hasOwnProperty,xe=n.unstable_scheduleCallback,Se=n.unstable_cancelCallback,Ce=n.unstable_shouldYield,we=n.unstable_requestPaint,Te=n.unstable_now,Ee=n.unstable_getCurrentPriorityLevel,De=n.unstable_ImmediatePriority,Oe=n.unstable_UserBlockingPriority,ke=n.unstable_NormalPriority,z=n.unstable_LowPriority,Ae=n.unstable_IdlePriority,je=n.log,Me=n.unstable_setDisableYieldValue,Ne=null,Pe=null;function Fe(e){if(typeof je==`function`&&Me(e),Pe&&typeof Pe.setStrictMode==`function`)try{Pe.setStrictMode(Ne,e)}catch{}}var B=Math.clz32?Math.clz32:Re,Ie=Math.log,Le=Math.LN2;function Re(e){return e>>>=0,e===0?32:31-(Ie(e)/Le|0)|0}var ze=256,Be=262144,Ve=4194304;function He(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function V(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=He(n))):i=He(o):i=He(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=He(n))):i=He(o)):i=He(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function H(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ue(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function U(){var e=Ve;return Ve<<=1,!(Ve&62914560)&&(Ve=4194304),e}function We(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ge(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ke(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0`u`||window.document===void 0||window.document.createElement===void 0),tn=!1;if(en)try{var nn={};Object.defineProperty(nn,"passive",{get:function(){tn=!0}}),window.addEventListener(`test`,nn,nn),window.removeEventListener(`test`,nn,nn)}catch{tn=!1}var rn=null,an=null,on=null;function sn(){if(on)return on;var e,t=an,n=t.length,r,i=`value`in rn?rn.value:rn.textContent,a=i.length;for(e=0;e=zn),Hn=` `,Un=!1;function Wn(e,t){switch(e){case`keyup`:return Ln.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Gn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Kn=!1;function qn(e,t){switch(e){case`compositionend`:return Gn(t);case`keypress`:return t.which===32?(Un=!0,Hn):null;case`textInput`:return e=t.data,e===Hn&&Un?null:e;default:return null}}function Jn(e,t){if(Kn)return e===`compositionend`||!Rn&&Wn(e,t)?(e=sn(),on=an=rn=null,Kn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=hr(n)}}function _r(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?_r(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function vr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ot(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ot(e.document)}return t}function yr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var br=en&&`documentMode`in document&&11>=document.documentMode,xr=null,Sr=null,Cr=null,wr=!1;function Tr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;wr||xr==null||xr!==Ot(r)||(r=xr,`selectionStart`in r&&yr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Cr&&mr(Cr,r)||(Cr=r,r=Td(Sr,`onSelect`),0>=o,i-=o,_i=1<<32-B(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),J&&yi(i,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),J&&yi(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return J&&yi(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),J&&yi(i,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=i(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===D&&ya(l)===r.type){n(e,r.sibling),c=i(r,o.props),Ea(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=ii(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ri(o.type,o.key,o.props,null,e.mode,c),Ea(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=i(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=si(o,e.mode,c),c.return=e,e=c}return s(e);case D:return o=ya(o),b(e,r,o,c)}if(ie(o))return h(e,r,o,c);if(O(o)){if(l=O(o),typeof l!=`function`)throw Error(a(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Ta(o),c);if(o.$$typeof===C)return b(e,r,qi(e,o),c);Da(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,o),c.return=e,e=c):(n(e,r),c=ai(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{wa=0;var i=b(e,t,n,r);return Ca=null,i}catch(t){if(t===pa||t===ha)throw t;var a=$r(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var ka=Oa(!0),Aa=Oa(!1),ja=!1;function Ma(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Na(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Pa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Fa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,X&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Xr(e),Yr(e,null,n),t}return Kr(e,r,t,n),Xr(e)}function Ia(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Je(e,n)}}function La(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ra=!1;function za(){if(Ra){var e=ia;if(e!==null)throw e}}function Ba(e,t,n,r){Ra=!1;var i=e.updateQueue;ja=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Q&f)===f:(r&f)===f){f!==0&&f===ra&&(Ra=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:ja=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Ul|=o,e.lanes=o,e.memoizedState=d}}function Va(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function Ha(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=j.T,s={};j.T=s,Os(e,!1,t,n);try{var c=i(),l=j.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ds(e,t,sa(c,r),du(e)):Ds(e,t,r,du(e))}catch(n){Ds(e,t,{then:function(){},status:`rejected`,reason:n},du())}finally{M.p=a,o!==null&&s.types!==null&&(o.types=s.types),j.T=o}}function _s(){}function vs(e,t,n,r){if(e.tag!==5)throw Error(a(476));var i=ys(e).queue;gs(e,i,t,N,n===null?_s:function(){return bs(e),n(r)})}function ys(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:N,baseState:N,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ko,lastRenderedState:N},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ko,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function bs(e){var t=ys(e);t.next===null&&(t=e.alternate.memoizedState),Ds(e,t.next.queue,{},du())}function xs(){return Ki(Qf)}function Ss(){return wo().memoizedState}function Cs(){return wo().memoizedState}function ws(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=du();e=Pa(n);var r=Fa(t,e,n);r!==null&&(pu(r,t,n),Ia(r,t,n)),t={cache:$i()},e.payload=t;return}t=t.return}}function Ts(e,t,n){var r=du();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ks(e)?As(t,n):(n=qr(e,t,n,r),n!==null&&(pu(n,e,r),js(n,t,r)))}function Es(e,t,n){Ds(e,t,n,du())}function Ds(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(ks(e))As(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,pr(s,o))return Kr(e,t,i,0),Fl===null&&Gr(),!1}catch{}if(n=qr(e,t,i,r),n!==null)return pu(n,e,r),js(n,t,r),!0}return!1}function Os(e,t,n,r){if(r={lane:2,revertLane:ud(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ks(e)){if(t)throw Error(a(479))}else t=qr(e,n,r,2),t!==null&&pu(t,e,2)}function ks(e){var t=e.alternate;return e===Y||t!==null&&t===Y}function As(e,t){so=oo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function js(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Je(e,n)}}var Ms={readContext:Ki,use:Do,useCallback:mo,useContext:mo,useEffect:mo,useImperativeHandle:mo,useLayoutEffect:mo,useInsertionEffect:mo,useMemo:mo,useReducer:mo,useRef:mo,useState:mo,useDebugValue:mo,useDeferredValue:mo,useTransition:mo,useSyncExternalStore:mo,useId:mo,useHostTransitionStatus:mo,useFormState:mo,useActionState:mo,useOptimistic:mo,useMemoCache:mo,useCacheRefresh:mo};Ms.useEffectEvent=mo;var Ns={readContext:Ki,use:Do,useCallback:function(e,t){return Co().memoizedState=[e,t===void 0?null:t],e},useContext:Ki,useEffect:rs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ts(4194308,4,ls.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ts(4194308,4,e,t)},useInsertionEffect:function(e,t){ts(4,2,e,t)},useMemo:function(e,t){var n=Co();t=t===void 0?null:t;var r=e();if(co){Fe(!0);try{e()}finally{Fe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Co();if(n!==void 0){var i=n(t);if(co){Fe(!0);try{n(t)}finally{Fe(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ts.bind(null,Y,e),[r.memoizedState,e]},useRef:function(e){var t=Co();return e={current:e},t.memoizedState=e},useState:function(e){e=zo(e);var t=e.queue,n=Es.bind(null,Y,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ds,useDeferredValue:function(e,t){return ms(Co(),e,t)},useTransition:function(){var e=zo(!1);return e=gs.bind(null,Y,e.queue,!0,!1),Co().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Y,i=Co();if(J){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),Fl===null)throw Error(a(349));Q&127||Po(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,rs(Io.bind(null,r,o,e),[e]),r.flags|=2048,$o(9,{destroy:void 0},Fo.bind(null,r,o,n,t),null),n},useId:function(){var e=Co(),t=Fl.identifierPrefix;if(J){var n=vi,r=_i;n=(r&~(1<<32-B(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=lo++,0<\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}o[$e]=t,o[et]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Pd(o,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Dc(t)}}return Mc(t),Oc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Dc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=se.current,Mi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=wi,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[$e]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||jd(e.nodeValue,n)),e||ki(t,!0)}else e=Bd(e).createTextNode(r),e[$e]=t,t.stateNode=e}return Mc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Mi(t),n!==null){if(e===null){if(!r)throw Error(a(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(557));e[$e]=t}else Ni(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Mc(t),e=!1}else n=Pi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(eo(t),t):(eo(t),null);if(t.flags&128)throw Error(a(558))}return Mc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Mi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(a(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(a(317));i[$e]=t}else Ni(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Mc(t),i=!1}else i=Pi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(eo(t),t):(eo(t),null)}return eo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ac(t,t.updateQueue),Mc(t),null);case 4:return ue(),e===null&&xd(t.stateNode.containerInfo),Mc(t),null;case 10:return Bi(t.type),Mc(t),null;case 19:if(I(to),r=t.memoizedState,r===null)return Mc(t),null;if(i=(t.flags&128)!=0,o=r.rendering,o===null)if(i)jc(r,!1);else{if(Hl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=no(e),o!==null){for(t.flags|=128,jc(r,!1),e=o.updateQueue,t.updateQueue=e,Ac(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ni(n,e),n=n.sibling;return L(to,to.current&1|2),J&&yi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Te()>$l&&(t.flags|=128,i=!0,jc(r,!1),t.lanes=4194304)}else{if(!i)if(e=no(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Ac(t,e),jc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!J)return Mc(t),null}else 2*Te()-r.renderingStartTime>$l&&n!==536870912&&(t.flags|=128,i=!0,jc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Mc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Te(),e.sibling=null,n=to.current,L(to,i?n&1|2:n&1),J&&yi(t,r.treeForkCount),e);case 22:case 23:return eo(t),qa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Mc(t),t.subtreeFlags&6&&(t.flags|=8192)):Mc(t),n=t.updateQueue,n!==null&&Ac(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&I(la),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Bi(Qi),Mc(t),null;case 25:return null;case 30:return null}throw Error(a(156,t.tag))}function Pc(e,t){switch(Si(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Bi(Qi),ue(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return fe(t),null;case 31:if(t.memoizedState!==null){if(eo(t),t.alternate===null)throw Error(a(340));Ni()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(eo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));Ni()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return I(to),null;case 4:return ue(),null;case 10:return Bi(t.type),null;case 22:case 23:return eo(t),qa(),e!==null&&I(la),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Bi(Qi),null;case 25:return null;default:return null}}function Fc(e,t){switch(Si(t),t.tag){case 3:Bi(Qi),ue();break;case 26:case 27:case 5:fe(t);break;case 4:ue();break;case 31:t.memoizedState!==null&&eo(t);break;case 13:eo(t);break;case 19:I(to);break;case 10:Bi(t.type);break;case 22:case 23:eo(t),qa(),e!==null&&I(la);break;case 24:Bi(Qi)}}function Ic(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Uu(t,t.return,e)}}function Lc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Uu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Uu(t,t.return,e)}}function Rc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ha(t,n)}catch(t){Uu(e,e.return,t)}}}function zc(e,t,n){n.props=Bs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Uu(e,t,n)}}function Bc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Uu(e,t,n)}}function Vc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Uu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Uu(e,t,n)}else n.current=null}function Hc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Uu(e,e.return,t)}}function Uc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[et]=t}catch(t){Uu(e,e.return,t)}}function Wc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Gc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Wc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Kc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Gt));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Kc(e,t,n),e=e.sibling;e!==null;)Kc(e,t,n),e=e.sibling}function qc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(qc(e,t,n),e=e.sibling;e!==null;)qc(e,t,n),e=e.sibling}function Jc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[$e]=e,t[et]=n}catch(t){Uu(e,e.return,t)}}var Yc=!1,Xc=!1,Zc=!1,Qc=typeof WeakSet==`function`?WeakSet:Set,$c=null;function el(e,t){if(e=e.containerInfo,Rd=sp,e=vr(e),yr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||i!==0&&f.nodeType!==3||(c=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===i&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,$c=t;$c!==null;)if(t=$c,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,$c=e;else for(;$c!==null;){switch(t=$c,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n title`))),Pd(o,r,n),o[$e]=e,ft(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,i).get(r+(n.href||``));if(s){for(var c=0;cg&&(o=g,g=h,h=o);var _=gr(s,h),v=gr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;sn?32:n,j.T=null,n=su,su=null;var o=ru,s=au;if(nu=0,iu=ru=null,au=0,X&6)throw Error(a(331));var c=X;if(X|=4,Al(o.current),Sl(o,o.current,s,n),X=c,rd(0,!1),Pe&&typeof Pe.onPostCommitFiberRoot==`function`)try{Pe.onPostCommitFiberRoot(Ne,o)}catch{}return!0}finally{M.p=i,j.T=r,zu(e,t)}}function Hu(e,t,n){t=li(n,t),t=Ks(e.stateNode,t,2),e=Fa(e,t,2),e!==null&&(Ge(e,2),nd(e))}function Uu(e,t,n){if(e.tag===3)Hu(e,e,n);else for(;t!==null;){if(t.tag===3){Hu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(tu===null||!tu.has(r))){e=li(n,e),n=qs(2),r=Fa(t,n,2),r!==null&&(Js(n,r,t,e),Ge(r,2),nd(r));break}}t=t.return}}function Wu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Pl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Bl=!0,i.add(n),e=Gu.bind(null,e,t,n),t.then(e,e))}function Gu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Fl===e&&(Q&n)===n&&(Hl===4||Hl===3&&(Q&62914560)===Q&&300>Te()-Zl?!(X&2)&&bu(e,0):Gl|=n,ql===Q&&(ql=0)),nd(e)}function Ku(e,t){t===0&&(t=U()),e=Jr(e,t),e!==null&&(Ge(e,t),nd(e))}function qu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ku(e,n)}function Ju(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(t),Ku(e,n)}function Yu(e,t){return xe(e,t)}var Xu=null,Zu=null,Qu=!1,$u=!1,ed=!1,td=0;function nd(e){e!==Zu&&e.next===null&&(Zu===null?Xu=Zu=e:Zu=Zu.next=e),$u=!0,Qu||(Qu=!0,ld())}function rd(e,t){if(!ed&&$u){ed=!0;do for(var n=!1,r=Xu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-B(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,cd(r,a))}else a=Q,a=V(r,r===Fl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||H(r,a)||(n=!0,cd(r,a));r=r.next}while(n);ed=!1}}function id(){ad()}function ad(){$u=Qu=!1;var e=0;td!==0&&Gd()&&(e=td);for(var t=Te(),n=null,r=Xu;r!==null;){var i=r.next,a=od(r,t);a===0?(r.next=null,n===null?Xu=i:n.next=i,i===null&&(Zu=n)):(n=r,(e!==0||a&3)&&($u=!0)),r=i}nu!==0&&nu!==5||rd(e,!1),td!==0&&(td=0)}function od(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=At(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),ft(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+At(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+At(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+At(n.imageSizes)+`"]`)):i+=`[href="`+At(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),ft(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+At(r)+`"][href="`+At(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),ft(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=dt(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);ft(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=dt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),ft(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=dt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),ft(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var i=(i=se.current)?gf(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=dt(i).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=dt(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(i,e,n,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=dt(i).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Af(e){return`href="`+At(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),ft(t),e.head.appendChild(t))}function Pf(e){return`[src="`+At(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+At(n.href)+`"]`);if(r)return t.instance=r,ft(r),r;var i=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),ft(r),Pd(r,`style`,i),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Af(n.href);var o=e.querySelector(jf(i));if(o)return t.state.loading|=4,t.instance=o,ft(o),o;r=Mf(n),(i=mf.get(i))&&Rf(r,i),o=(e.ownerDocument||e).createElement(`link`),ft(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(i=e.querySelector(Ff(o)))?(t.instance=i,ft(i),i):(r=n,(i=mf.get(o))&&(r=h({},n),zf(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),ft(i),Pd(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,ft(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),ft(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=d()})),p=a(e(),1),m=f(),h=u(),g=12,_=10,v=e=>e instanceof HTMLElement&&!!e.closest(`input, textarea, select, [contenteditable='true']`),y=(e,t,{width:n,height:r},i={width:window.innerWidth,height:window.innerHeight})=>({x:e+n>i.width-g?Math.max(g,e-n):Math.max(g,e),y:t+r>i.height-g?Math.max(g,t-r):Math.max(g,t)}),b=(e,{width:t,height:n},r={width:window.innerWidth,height:window.innerHeight})=>({x:e.right+_+t<=r.width-g?e.right+_:Math.max(g,e.left-_-t),y:Math.min(Math.max(g,e.top),Math.max(g,r.height-n-g))}),x=(e,t,n=`target`)=>{if(n===`pointer`)return y(e.clientX,e.clientY,t);let r=e.currentTarget instanceof HTMLElement?e.currentTarget.getBoundingClientRect():null;return r?b(r,t):y(e.clientX,e.clientY,t)},S=({children:e})=>typeof document>`u`?null:(0,h.createPortal)(e,document.body),C=(e,t,n={})=>{(0,p.useEffect)(()=>{if(!e)return;let r=e=>{e.key===`Escape`&&t()},i=e=>{e.target instanceof HTMLElement&&(e.target.closest(`.ue-update-popover`)||e.target.closest(`.ue-floating-layer`)||e.target.closest(`.ue-filter-popover`)||e.target.closest(`.ue-select-field__menu`)||e.target.closest(`.ue-context-menu`))||t()};return window.addEventListener(`click`,t),n.closeOnResize!==!1&&window.addEventListener(`resize`,t),window.addEventListener(`keydown`,r),n.closeOnContextMenu&&window.addEventListener(`contextmenu`,t),n.closeOnScroll&&window.addEventListener(`scroll`,i,!0),()=>{window.removeEventListener(`click`,t),n.closeOnResize!==!1&&window.removeEventListener(`resize`,t),window.removeEventListener(`keydown`,r),n.closeOnContextMenu&&window.removeEventListener(`contextmenu`,t),n.closeOnScroll&&window.removeEventListener(`scroll`,i,!0)}},[e,t,n.closeOnContextMenu,n.closeOnScroll,n.closeOnResize])},w=t(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),T=t(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),ee=t(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),E=t(`file-braces`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`1oajmo`}],[`path`,{d:`M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`mpwhp6`}]]),D=t(`grid-2x2`,[[`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`}]]),te=t(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),ne=t(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),re=t(`panel-left-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]]),O=t(`panel-left-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]]),k=t(`square-check-big`,[[`path`,{d:`M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344`,key:`2acyp4`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),A=t(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),ie=t(`arrow-right-left`,[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]),j=t(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),M=t(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),N=t(`calendar-x`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`m14 14-4 4`,key:`rymu2i`}],[`path`,{d:`m10 14 4 4`,key:`3sz06r`}]]),P=t(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),F=t(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),ae=t(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),I=t(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),L=t(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),R=t(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),oe=t(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),se=t(`clipboard-copy`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2`,key:`4jdomd`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v4`,key:`3hqy98`}],[`path`,{d:`M21 14H11`,key:`1bme5i`}],[`path`,{d:`m15 10-4 4 4 4`,key:`5dvupr`}]]),ce=t(`corner-down-right`,[[`path`,{d:`m15 10 5 5-5 5`,key:`qqa56n`}],[`path`,{d:`M4 4v7a4 4 0 0 0 4 4h12`,key:`z08zvw`}]]),le=t(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),ue=t(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),de=t(`folder-minus`,[[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),fe=t(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),pe=t(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),me=t(`folder-search`,[[`path`,{d:`M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1`,key:`1bw5m7`}],[`path`,{d:`m21 21-1.9-1.9`,key:`1g2n9r`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}]]),he=t(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),ge=t(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),_e=t(`hard-drive`,[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]),ve=t(`image-off`,[[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}],[`path`,{d:`M10.41 10.41a2 2 0 1 1-2.83-2.83`,key:`1bzlo9`}],[`line`,{x1:`13.5`,x2:`6`,y1:`13.5`,y2:`21`,key:`1q0aeu`}],[`line`,{x1:`18`,x2:`21`,y1:`12`,y2:`15`,key:`5mozeu`}],[`path`,{d:`M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59`,key:`mmje98`}],[`path`,{d:`M21 15V5a2 2 0 0 0-2-2H9`,key:`43el77`}]]),ye=t(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),be=t(`images`,[[`path`,{d:`m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16`,key:`9kzy35`}],[`path`,{d:`M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2`,key:`1t0f0t`}],[`circle`,{cx:`13`,cy:`7`,r:`1`,fill:`currentColor`,key:`1obus6`}],[`rect`,{x:`8`,y:`2`,width:`14`,height:`14`,rx:`2`,key:`1gvhby`}]]),xe=t(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Se=t(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),Ce=t(`library`,[[`path`,{d:`m16 6 4 14`,key:`ji33uf`}],[`path`,{d:`M12 6v14`,key:`1n7gus`}],[`path`,{d:`M8 8v12`,key:`1gg7y9`}],[`path`,{d:`M4 4v16`,key:`6qkkli`}]]),we=t(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),Te=t(`list-tree`,[[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`M3 10a2 2 0 0 0 2 2h3`,key:`1npucw`}],[`path`,{d:`M3 5v12a2 2 0 0 0 2 2h3`,key:`x1gjn2`}]]),Ee=t(`list`,[[`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`}]]),De=t(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),Oe=t(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),ke=t(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),z=t(`pencil-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),Ae=t(`pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]),je=t(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Me=t(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Ne=t(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),Pe=t(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Fe=t(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),B=t(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Ie=t(`share-2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]),Le=t(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),Re=t(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),ze=t(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),Be=t(`trash-2`,[[`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`}]]),Ve=t(`trash`,[[`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`}]]),He=t(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),V=t(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),H=i(),Ue=(0,p.createContext)(null),U=3e3,We=()=>`${Date.now()}-${Math.random().toString(36).slice(2,8)}`,Ge=(e,t)=>e instanceof Error?e.message:t,Ke=e=>{let t=[...e];for(;t.filter(e=>e.tone===`success`||e.tone===`info`).length>50;){let e=[...t].reverse().findIndex(e=>e.tone===`success`||e.tone===`info`);if(e===-1)break;t.splice(t.length-1-e,1)}return t},qe=({children:e})=>{let{t}=n(),[r,i]=(0,p.useState)([]),[a,o]=(0,p.useState)(!1),[s,c]=(0,p.useState)(`pending`);C(a,(0,p.useCallback)(()=>o(!1),[]),{closeOnScroll:!1});let[l,u]=(0,p.useState)(()=>Date.now()),d=(0,p.useRef)(new Map),f=(0,p.useRef)(new Map),m=(0,p.useCallback)(e=>{let t=d.current.get(e);t!==void 0&&(window.clearTimeout(t),d.current.delete(e))},[]),h=(0,p.useCallback)(e=>{m(e),i(t=>t.map(t=>t.id===e?{...t,hidden:!0}:t))},[m]),g=(0,p.useCallback)((e,t)=>{if(m(e),t===`pending`||t===`error`)return;let n=window.setTimeout(()=>h(e),U);d.current.set(e,n)},[m,h]),_=(0,p.useCallback)(e=>{u(Date.now()),i(t=>{let n=(e.jobId?t.find(t=>t.jobId===e.jobId)??t.find(t=>t.tone===`pending`&&t.taskKind===e.taskKind&&e.taskKind&&!t.jobId):void 0)?.id??e.id,r=t.filter(e=>e.id!==n),i=t.find(e=>e.id===n),a=e.quiet&&e.tone!==`error`&&e.tone!==`pending`&&(!i||Date.now()-i.createdAt<2e3);return Ke([{...i,...e,id:n,createdAt:i?.createdAt??e.createdAt,hidden:e.tone===`error`&&i?.tone!==`error`?!1:i?.hidden||a,occurrences:i?.tone===`error`&&e.tone===`error`&&!e.jobId?(i.occurrences??1)+1:i?.occurrences},...r])})},[]);(0,p.useEffect)(()=>{for(let e of r)e.tone===`pending`||e.tone===`error`?m(e.id):!e.hidden&&!d.current.has(e.id)&&g(e.id,e.tone)},[m,r,g]);let v=(0,p.useCallback)((e,t=`info`,n=``)=>{let r=`${e}\n${n}`,i=t===`error`?f.current.get(r)??We():We();return t===`error`&&f.current.set(r,i),_({id:i,tone:t,message:e,detail:n,createdAt:Date.now()}),i},[_]),y=(0,p.useCallback)((e,t=``,n)=>{let r=We();return _({id:r,tone:`pending`,message:e,detail:t,...n,createdAt:Date.now()}),r},[_]),b=(0,p.useCallback)((e,t,n,r=``,i)=>{_({id:e,tone:n,message:t,detail:r,retry:i,cancel:void 0,createdAt:Date.now()})},[_]),x=(0,p.useCallback)(async(e,t)=>{let n=y(t.pending,``,{taskKind:t.taskKind,source:t.source});try{let r=await e();return t.success?b(n,typeof t.success==`function`?t.success(r):t.success,t.successTone?.(r)??`success`,t.successDetail?.(r)??``,t.successRetry?.(r)):h(n),r}catch(e){let r=typeof t.error==`string`?t.error:`Operation failed`;throw b(n,typeof t.error==`function`?t.error(e):Ge(e,r),`error`),e}},[h,y,b]),S=(0,p.useCallback)((e,t,n,r,i,a)=>{_({id:`task:${e}`,message:t,tone:n,detail:r,retry:i,...a,createdAt:Date.now()})},[_]);(0,p.useEffect)(()=>{let e=r.filter(e=>!e.hidden&&e.quiet&&e.tone===`pending`&&Date.now()-e.createdAt<2e3);if(!e.length)return;let t=window.setTimeout(()=>u(Date.now()),Math.max(0,Math.min(...e.map(e=>e.createdAt+2e3-Date.now()))));return()=>window.clearTimeout(t)},[r,l]),(0,p.useEffect)(()=>()=>{d.current.forEach(e=>window.clearTimeout(e)),d.current.clear()},[]);let ee=(0,p.useMemo)(()=>({notify:v,startOperation:y,updateOperation:b,dismissOperation:h,runOperation:x,syncTask:S}),[h,v,x,y,b,S]),E=r.filter(e=>!e.hidden&&(!e.quiet||e.tone!==`pending`||l-e.createdAt>=2e3)),D=e=>e.tone===`error`?0:e.tone===`pending`?1:2,te=[...E].sort((e,t)=>D(e)-D(t)).slice(0,3),re=r.filter(e=>s===`recent`?[`success`,`info`].includes(e.tone):e.tone===s),O=r.filter(e=>e.tone===`pending`).length,k=r.filter(e=>e.tone===`error`).length,A=(e,n=!1)=>(0,H.jsxs)(`article`,{className:`ue-operation-card ue-operation-card--${e.tone}`,role:n||e.tone===`pending`?void 0:e.tone===`error`?`alert`:`status`,children:[(0,H.jsx)(`div`,{className:`ue-operation-icon`,"aria-hidden":`true`,children:e.tone===`pending`?(0,H.jsx)(ne,{size:16,className:`ue-operation-spinner`}):e.tone===`success`?(0,H.jsx)(T,{size:16}):e.tone===`error`?(0,H.jsx)(w,{size:16}):(0,H.jsx)(xe,{size:16})}),(0,H.jsxs)(`div`,{className:`ue-operation-copy`,children:[(0,H.jsxs)(`strong`,{children:[e.message,(e.occurrences??1)>1?` ×${e.occurrences}`:``]}),e.retry&&(0,H.jsx)(`button`,{type:`button`,onClick:e.retry,children:t(`jobRetry`)}),e.cancel&&e.tone===`pending`&&(0,H.jsx)(`button`,{type:`button`,onClick:e.cancel,children:t(`jobRequestCancel`)}),e.detail&&e.tone===`error`?(0,H.jsxs)(`details`,{className:`ue-operation-details`,children:[(0,H.jsx)(`summary`,{children:t(`operationViewDetails`)}),(0,H.jsx)(`span`,{children:e.detail})]}):e.detail?(0,H.jsx)(`span`,{children:e.detail}):null]}),(0,H.jsx)(`button`,{className:`ue-operation-dismiss`,"aria-label":t(n&&e.tone!==`pending`?`operationClear`:`notificationDismiss`),onClick:()=>n&&e.tone!==`pending`?i(t=>t.filter(t=>t.id!==e.id)):h(e.id),children:(0,H.jsx)(V,{size:14})})]},e.id);return(0,H.jsxs)(Ue.Provider,{value:ee,children:[e,(0,H.jsxs)(`div`,{className:`ue-operation-status-center`,onClick:e=>e.stopPropagation(),children:[a?(0,H.jsxs)(`section`,{className:`ue-task-panel`,"aria-label":t(`operationCenter`),children:[(0,H.jsxs)(`header`,{children:[(0,H.jsx)(`strong`,{children:t(`operationCenter`)}),(0,H.jsx)(`button`,{onClick:()=>o(!1),"aria-label":t(`notificationDismiss`),children:(0,H.jsx)(V,{size:16})})]}),(0,H.jsx)(`nav`,{"aria-label":t(`operationCenter`),children:[`pending`,`error`,`recent`].map(e=>(0,H.jsx)(`button`,{"aria-pressed":s===e,onClick:()=>c(e),children:t(`operationTab_${e}`)},e))}),(0,H.jsx)(`div`,{className:`ue-task-history`,children:re.length?re.map(e=>A(e,!0)):(0,H.jsx)(`p`,{children:t(`operationEmpty`)})})]}):te.map(e=>A(e)),(0,H.jsxs)(`button`,{className:`ue-task-center-toggle`,"aria-expanded":a,onClick:()=>{a||c(O?`pending`:k?`error`:`recent`),o(e=>!e)},children:[(0,H.jsx)(we,{size:16}),(0,H.jsx)(`span`,{children:t(`operationCenter`)}),O>0&&(0,H.jsxs)(`span`,{children:[O,` `,t(`operationTab_pending`)]}),k>0&&(0,H.jsxs)(`span`,{className:`ue-task-error-count`,children:[k,` `,t(`operationTab_error`)]})]})]})]})},Je=()=>{let e=(0,p.useContext)(Ue);if(!e)throw Error(`useOperationStatus must be used within OperationStatusProvider`);return e},Ye=`universal-gallery:job-activity`,Xe=e=>{window.dispatchEvent(new CustomEvent(Ye,{detail:e}))},Ze=class extends Error{status;details;constructor(e,t,n){super(e),this.name=`ApiRequestError`,this.status=t,this.details=n}},W=async(e,t)=>{let n=typeof e==`string`&&(e.includes(`force_refresh=true`)||e.includes(`fingerprints/prewarm`)||e.includes(`/images/variant-`)||e.includes(`/images/search-by-image`)||e.endsWith(`/jobs`)&&t?.method===`POST`);n&&Xe(1);try{let n=await fetch(e,t);if(!n.ok){let e=null;try{let t=await n.text();try{e=JSON.parse(t)}catch{e=t.slice(0,1e3)}}catch{}throw new Ze(typeof e==`object`&&e&&`error`in e&&typeof e.error==`string`?e.error:typeof e==`string`&&e.trim()&&!e.trim().startsWith(`<`)?e.trim().slice(0,200):`Request failed: ${n.status}`,n.status,e)}return await n.json()}finally{n&&Xe(-1)}},G={async locateImage(e,t,n,r,i){let a=new URLSearchParams({limit:String(t),sort_by:n,sort_order:r});return a.set(e.asset_id?`asset_id`:`relative_path`,e.asset_id||e.relative_path),W(`/universal_gallery/api/images/locate?${a}`,{signal:i})},async getReleaseNotes(e=`zh-CN`){return W(`/universal_gallery/api/release-notes?locale=${encodeURIComponent(e)}`)},async searchByImage(e,t=70,n){let r=new FormData;return r.append(`image`,e),W(`/universal_gallery/api/images/search-by-image?minimum=${t}`,{method:`POST`,body:r,signal:n})},async listJobs(e){return W(`/universal_gallery/api/jobs?limit=50`,{signal:e})},async getJob(e,t){return W(`/universal_gallery/api/jobs/${encodeURIComponent(e)}`,{signal:t})},async createJob(e,t){return W(`/universal_gallery/api/jobs`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:e,payload:t})})},async cancelJob(e){return W(`/universal_gallery/api/jobs/${encodeURIComponent(e)}/cancel`,{method:`POST`})},async getContext(e=!1,t){let n=new URLSearchParams;return e&&n.set(`force_refresh`,`true`),W(`/universal_gallery/api/context${n.size?`?${n}`:``}`,t?{signal:t}:void 0)},async getUpdateStatus(e=!1){return W(`/universal_gallery/api/update-status${e?`?force=true`:``}`)},async listImages(e,t,n,r=``,i=``,a=``,o=``,s=``,c=!1,l=``,u=`created_at`,d=`desc`,f=!1,p){let m=new URLSearchParams({page:String(e),limit:String(t)});return n.trim()&&m.set(`search`,n.trim()),r.trim()&&m.set(`category`,r.trim()),i.trim()&&m.set(`subfolder`,i.trim()),a.trim()&&m.set(`board_id`,a.trim()),o.trim()&&m.set(`date_from`,o.trim()),s.trim()&&m.set(`date_to`,s.trim()),c&&m.set(`pinned`,`true`),l.trim()&&m.set(`color_family`,l.trim()),m.set(`sort_by`,u),m.set(`sort_order`,d),f&&m.set(`force_refresh`,`true`),W(`/universal_gallery/api/images?${m}`,p?{signal:p}:void 0)},async getImageFreshness(e=``,t=``,n){let r=new URLSearchParams;return e.trim()&&r.set(`subfolder`,e.trim()),t.trim()&&r.set(`known`,t.trim()),W(`/universal_gallery/api/images/freshness${r.size?`?${r}`:``}`,n?{signal:n}:void 0)},async listVariantGroups(e={},t){let n=new URLSearchParams;return e.search?.trim()&&n.set(`search`,e.search.trim()),e.category?.trim()&&n.set(`category`,e.category.trim()),e.subfolder?.trim()&&n.set(`subfolder`,e.subfolder.trim()),e.boardId?.trim()&&n.set(`board_id`,e.boardId.trim()),e.dateFrom?.trim()&&n.set(`date_from`,e.dateFrom.trim()),e.dateTo?.trim()&&n.set(`date_to`,e.dateTo.trim()),e.favoritesOnly&&n.set(`pinned`,`true`),e.colorFamily?.trim()&&n.set(`color_family`,e.colorFamily.trim()),e.sortBy&&n.set(`sort_by`,e.sortBy),e.sortOrder&&n.set(`sort_order`,e.sortOrder),e.type&&n.set(`type`,e.type),e.limit&&n.set(`limit`,String(e.limit)),e.forceRefresh&&n.set(`force_refresh`,`true`),W(`/universal_gallery/api/images/variant-groups?${n}`,{signal:t})},async getVariantGroupImages(e,t){let n=new URLSearchParams({group_id:e.groupId,page:String(e.page??1),limit:String(e.limit??60)});return e.type&&n.set(`type`,e.type),e.search?.trim()&&n.set(`search`,e.search.trim()),e.category?.trim()&&n.set(`category`,e.category.trim()),e.subfolder?.trim()&&n.set(`subfolder`,e.subfolder.trim()),e.boardId?.trim()&&n.set(`board_id`,e.boardId.trim()),e.dateFrom?.trim()&&n.set(`date_from`,e.dateFrom.trim()),e.dateTo?.trim()&&n.set(`date_to`,e.dateTo.trim()),e.favoritesOnly&&n.set(`pinned`,`true`),e.colorFamily?.trim()&&n.set(`color_family`,e.colorFamily.trim()),e.sortBy&&n.set(`sort_by`,e.sortBy),e.sortOrder&&n.set(`sort_order`,e.sortOrder),W(`/universal_gallery/api/images/variant-group?${n}`,{signal:t})},async prewarmFingerprints(e={}){return W(`/universal_gallery/api/images/fingerprints/prewarm`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({relative_paths:e.relativePaths,subfolder:e.subfolder,search:e.search,category:e.category,board_id:e.boardId,date_from:e.dateFrom,date_to:e.dateTo,pinned:e.favoritesOnly,color_family:e.colorFamily,limit:e.limit})})},async getFingerprintStatus(){return W(`/universal_gallery/api/images/fingerprints/status`)},async getImageMetadata(e){return W(`/universal_gallery/api/metadata?relative_path=${encodeURIComponent(e)}`)},async prewarmThumbnails(e,t=80){return W(`/universal_gallery/api/thumb/prewarm`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({relative_paths:e,limit:t})})},async getThumbnailPrewarmStatus(){return W(`/universal_gallery/api/thumb/prewarm-status`)},async getColorIndexStatus(){return W(`/universal_gallery/api/color-index/status`)},async updateImageState(e,t){return W(`/universal_gallery/api/image-state`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({relative_path:e,updates:t})})},async importFiles(e,t=``,n=`universal_gallery_imports`){let r=new FormData;return t.trim()&&r.append(`target_source_id`,t.trim()),n.trim()&&r.append(`target_subfolder`,n.trim()),e.forEach(e=>{r.append(`files`,e,e.name)}),W(`/universal_gallery/api/import`,{method:`POST`,body:r})},async deleteImages(e){return W(`/universal_gallery/api/images/delete`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({relative_paths:e})})},async batchUpdateImages(e,t){return W(`/universal_gallery/api/images/batch-update`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({relative_paths:e,updates:t})})},async listBoards(e=!1){let t=new URLSearchParams;return e&&t.set(`force_refresh`,`true`),(await W(`/universal_gallery/api/boards${t.size?`?${t}`:``}`)).boards??[]},async createBoard(e,t=``){return W(`/universal_gallery/api/boards`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({name:e,description:t})})},async updateBoard(e,t){return W(`/universal_gallery/api/boards`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({id:e,updates:t})})},async deleteBoard(e){return W(`/universal_gallery/api/boards`,{method:`DELETE`,headers:{"Content-Type":`application/json`},body:JSON.stringify({id:e})})},async updateBoardPins(e,t,n=!0){return W(`/universal_gallery/api/boards/pins`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({id:e,relative_paths:t,pinned:n})})},async moveImages(e,t,n=``){return W(`/universal_gallery/api/images/move`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({relative_paths:e,target_subfolder:t,target_source_id:n})})},async renameImage(e,t){return W(`/universal_gallery/api/images/rename`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({relative_path:e,new_filename:t})})},async batchRenameImages(e,t,n=1,r=2,i=1){return W(`/universal_gallery/api/images/batch-rename`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({relative_paths:e,template:t,start_number:n,padding:r,current_page:i})})},async listLibraries(){return(await W(`/universal_gallery/api/libraries`)).libraries??[]},async getLibrary(e){return(await W(`/universal_gallery/api/library?name=${encodeURIComponent(e)}`)).data??[]},async getLibraryEntries(e,t=``,n=1,r=120){let i=new URLSearchParams({name:e,page:String(n),limit:String(r)});return t.trim()&&i.set(`search`,t.trim()),W(`/universal_gallery/api/library/entries?${i}`)},async getLibraryRaw(e){return W(`/universal_gallery/api/library/raw?name=${encodeURIComponent(e)}`)},async searchLibraryArtists(e,t=``,n=`none`,r=0,i=12){return W(`/universal_gallery/api/library/artists?${new URLSearchParams({name:e,query:t,filter_mode:n,post_threshold:String(r),limit:String(i)})}`)},async generateArtistString(e){return W(`/universal_gallery/api/library/generate-artists`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})},async saveLibrary(e,t){return W(`/universal_gallery/api/library`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({name:e,data:t})})},async deleteLibrary(e){return W(`/universal_gallery/api/library?name=${encodeURIComponent(e)}`,{method:`DELETE`})},async saveLibraryEntry(e,t,n){return W(`/universal_gallery/api/library/entry`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(n===void 0?{name:e,entry:t}:{name:e,entry:t,index:n})})},async deleteLibraryEntry(e,t){return W(`/universal_gallery/api/library/entry`,{method:`DELETE`,headers:{"Content-Type":`application/json`},body:JSON.stringify({name:e,index:t})})},async createFolder(e){return W(`/universal_gallery/api/folders/create`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e})})},async deleteFolder(e){return W(`/universal_gallery/api/folders/delete`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e})})},async mergeFolder(e,t){return W(`/universal_gallery/api/folders/merge`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({source_path:e,target_path:t})})},async renameFolder(e,t){return W(`/universal_gallery/api/folders/rename`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({source_path:e,target_path:t})})},async importLibrary(e,t,n=``,r=``){let i=new FormData;return i.append(`file`,e,e.name),i.append(`mode`,t),n.trim()&&i.append(`target_name`,n.trim()),r.trim()&&i.append(`new_name`,r.trim()),W(`/universal_gallery/api/library/import`,{method:`POST`,body:i})},async listTrash(e){return(await W(`/universal_gallery/api/trash`,e?{signal:e}:void 0)).items??[]},async restoreTrashItem(e){return W(`/universal_gallery/api/trash/restore`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({id:e})})},async purgeTrashItem(e){return W(`/universal_gallery/api/trash/purge`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({id:e})})},async listGallerySources(e=!1){let t=new URLSearchParams;return e&&t.set(`force_refresh`,`true`),(await W(`/universal_gallery/api/settings/gallery-sources${t.size?`?${t}`:``}`)).sources??[]},async saveGallerySource(e){return W(`/universal_gallery/api/settings/gallery-sources`,{method:e.id?`PATCH`:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})},async deleteGallerySource(e){return W(`/universal_gallery/api/settings/gallery-sources`,{method:`DELETE`,headers:{"Content-Type":`application/json`},body:JSON.stringify({id:e})})},async testGallerySourcePath(e){return W(`/universal_gallery/api/settings/gallery-sources/test-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e})})},async diagnoseGallerySources(){return(await W(`/universal_gallery/api/settings/gallery-sources/diagnostics`)).sources??[]}},Qe=e=>[`queued`,`running`,`cancelling`].includes(e.state),$e=e=>{let{syncTask:t,notify:r}=Je(),{t:i}=n(),a=(0,p.useRef)(new Map);(0,p.useEffect)(()=>{if(!e||typeof G.listJobs!=`function`||!t)return;let n,o,s=!1,c=0,l=!1,u=!1,d=async e=>{if(e.kind!==`refresh_index`&&e.kind!==`fingerprint_assets`)return;let t=Object.fromEntries(Object.entries(e.payload).filter(([e])=>!e.startsWith(`_`)));try{await G.createJob(e.kind,t)}catch(e){r(e instanceof Error?e.message:i(`jobFailed`),`error`)}},f=async()=>{if(window.clearTimeout(n),s||document.visibilityState===`hidden`)return;if(l){u=!0;return}l=!0,o=new AbortController;let e=()=>[...a.current.values()].some(e=>[`queued`,`running`,`cancelling`].includes(e.split(`:`,1)[0])),p=e();try{let n=await G.listJobs(o.signal);if(s||o.signal.aborted)return;let c=new Set(n.jobs.map(e=>e.id)),l=[...a.current].filter(([e,t])=>!c.has(e)&&[`queued`,`running`,`cancelling`].includes(t.split(`:`,1)[0]));if(typeof G.getJob==`function`)for(let e=0;e{try{return(await G.getJob(e,o.signal)).job}catch{return null}}));if(s||o.signal.aborted)return;n.jobs.push(...t.filter(e=>e!==null))}let u=new Map;for(let e of n.jobs){if(e.kind!==`refresh_index`)continue;let t=String(e.payload.subfolder??``),n=u.get(t);(!n||e.created_at>n.created_at||e.created_at===n.created_at&&e.id>n.id)&&u.set(t,e)}for(let e of n.jobs){p||=Qe(e);let n=e.kind===`refresh_index`||e.kind===`fingerprint_assets`,o=a.current.get(e.id);if(!n||!Qe(e)&&!o&&(e.state!==`failed`||Date.now()/1e3-e.updated_at>86400))continue;let s=`${e.state}:${e.completed}:${e.total}:${e.error}`;if(o===s)continue;a.current.set(e.id,s);let c=String(e.payload.subfolder??``);if(e.kind===`refresh_index`&&u.get(c)?.id!==e.id)continue;let l=i(e.kind===`refresh_index`?`jobRefresh`:`jobFingerprints`),m=Qe(e)?`pending`:e.state===`failed`?`error`:e.state===`succeeded`?`success`:`info`;t(e.kind===`refresh_index`?`refresh:${c}`:e.id,`${l} · ${i(Qe(e)?`jobRunning`:e.state===`failed`?`jobFailed`:e.state===`cancelled`?`jobCancelled`:`jobCompleted`)}`,m,e.error||`${e.completed} / ${e.total}`,e.state===`failed`?()=>{d(e)}:void 0,{taskKind:e.kind,source:`gallery`,phase:e.state,completed:e.completed,total:e.total,jobId:e.id,quiet:e.kind===`refresh_index`,cancel:Qe(e)&&e.state!==`cancelling`?()=>{G.cancelJob(e.id).then(()=>f()).catch(e=>r(e instanceof Error?e.message:i(`jobFailed`),`error`))}:void 0})}p=n.jobs.some(Qe)||e()}catch{}finally{l=!1,!s&&(p||c>0||u)&&(u=!1,n=window.setTimeout(()=>{f()},2e3))}},p=e=>{c=Math.max(0,c+Number(e.detail||0)),f()},m=()=>{document.visibilityState===`hidden`?(o?.abort(),window.clearTimeout(n)):f()};return window.addEventListener(Ye,p),document.addEventListener(`visibilitychange`,m),n=window.setTimeout(()=>{f()},500),()=>{s=!0,o?.abort(),window.clearTimeout(n),window.removeEventListener(Ye,p),document.removeEventListener(`visibilitychange`,m)}},[e,r,t,i])},et=e=>{let t=[...new Set(e.paths)];if(t.length)return()=>{(async()=>{await e.confirm(e.confirmation(t.length))&&await e.run(async()=>{let n=await e.execute(t);return window.dispatchEvent(new Event(`universal-gallery:files-changed`)),n},{pending:e.pending,success:n=>e.summary(t,n),successTone:n=>e.failed(t,n).length?`error`:`success`,successDetail:n=>e.failed(t,n).join(`; `),successRetry:n=>et({...e,paths:e.failed(t,n)})})})().catch(()=>void 0)}},tt=(e=`standard`)=>e===`compact`?{gap:10,chrome:44,bodyHeight:42,padding:3}:{gap:14,chrome:50,bodyHeight:48,padding:6},nt=()=>{let e=(0,p.useRef)(0),t=(0,p.useRef)(null),n=(0,p.useCallback)(()=>{e.current+=1,t.current?.abort()},[]),r=(0,p.useCallback)(()=>{n(),t.current=new AbortController;let r=e.current;return{signal:t.current.signal,isCurrent:()=>r===e.current}},[n]);return(0,p.useEffect)(()=>n,[n]),{begin:r,invalidate:n}},rt=(e,t)=>{let n=new Set(t);return e.filter((e,t,r)=>n.has(e)&&r.indexOf(e)===t)},it=(e,t)=>e.includes(t)?e.filter(e=>e!==t):[...e,t],at=({anchorPath:e,targetPath:t,selectedPaths:n,visibleSelectionPaths:r})=>{let i=r.indexOf(e),a=r.indexOf(t);if(i<0||a<0)return it(n,t);let o=Math.min(i,a),s=Math.max(i,a);return rt([...n,...r.slice(o,s+1)],r)},ot=e=>({left:Math.min(e.startX,e.currentX),right:Math.max(e.startX,e.currentX),top:Math.min(e.startY,e.currentY),bottom:Math.max(e.startY,e.currentY)}),st=(e,t)=>!(t.righte.right||t.bottome.bottom),ct=(e,t)=>t?{left:e.left,right:e.right,top:e.top-t,bottom:e.bottom-t}:e,lt=({selectionBox:e,keys:t,getRect:n,scrollDelta:r=0})=>{let i=ot({...e,startY:e.startY-r});return t.filter(e=>{let t=n(e);return t?st(i,ct(t,r)):!1})},ut=({visibleSelectionPaths:e,pageSelectedPaths:t,onSelectionChange:n})=>{let r=(0,p.useRef)(``),i=(0,p.useCallback)(t=>{n(rt(t,e))},[n,e]);return{setSelection:i,handleImageSelectionClick:(n,a)=>{if(a?.shiftKey){let a=r.current||t[t.length-1]||n;i(at({anchorPath:a,targetPath:n,selectedPaths:t,visibleSelectionPaths:e})),r.current=a;return}i(it(t,n)),r.current=n},selectAllVisible:(0,p.useCallback)(()=>{i(e),r.current=e[0]||``},[i,e]),clearSelection:(0,p.useCallback)(()=>{n([]),r.current=``},[n]),lastSelectedPathRef:r}};function dt(e,t,n=15e3){return new Promise(r=>{if(t.aborted||!e){r(!1);return}let i=new Image;i.decoding=`async`;let a=!1,o=e=>{a||(a=!0,clearTimeout(c),t.removeEventListener(`abort`,s),i.onload=null,i.onerror=null,e||(i.src=``),r(e))},s=()=>o(!1),c=window.setTimeout(()=>o(!1),n);i.onload=async()=>{try{await i.decode?.()}catch{}o(!t.aborted)},i.onerror=()=>o(!1),t.addEventListener(`abort`,s,{once:!0}),i.src=e})}function ft(){return typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches?`instant`:`smooth`}var pt=e=>{try{return typeof window>`u`?null:window.localStorage.getItem(e)}catch{return null}},mt=(e,t)=>{try{return typeof window>`u`?!1:(window.localStorage.setItem(e,t),!0)}catch{return!1}},ht=(0,p.createContext)(null),gt=({children:e})=>{let{t}=n(),[r,i]=(0,p.useState)(null),a=(0,p.useRef)(null),o=(0,p.useRef)(null),s=(0,p.useMemo)(()=>{let e=e=>new Promise(t=>{a.current?.resolve(`cancel`),a.current={...e,resolve:t},i(a.current)});return{choose:e,confirm:async t=>await e(t)===`confirm`}},[]),c=e=>{a.current?.resolve(e),a.current=null,i(null)};return(0,p.useEffect)(()=>()=>{a.current?.resolve(`cancel`),a.current=null},[]),(0,p.useEffect)(()=>{if(!r)return;let e=document.activeElement instanceof HTMLElement?document.activeElement:null,t=document.getElementById(`root`),n=t?.inert??!1;t&&(t.inert=!0),o.current?.querySelector(`.ue-secondary-btn`)?.focus({preventScroll:!0});let s=e=>{if(e.stopPropagation(),e.key===`Escape`&&(e.preventDefault(),a.current?.resolve(`cancel`),a.current=null,i(null)),e.key!==`Tab`)return;let t=o.current?.querySelectorAll(`button:not(:disabled)`);if(!t?.length)return;let n=t[0],r=t[t.length-1];e.shiftKey&&document.activeElement===n?(e.preventDefault(),r.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n.focus())};return document.addEventListener(`keydown`,s,!0),()=>{document.removeEventListener(`keydown`,s,!0),t&&(t.inert=n),e?.isConnected&&!e.closest(`[inert]`)&&e.focus({preventScroll:!0})}},[r]),(0,H.jsxs)(ht.Provider,{value:s,children:[e,r?(0,h.createPortal)((0,H.jsx)(`div`,{className:`ue-modal-backdrop ue-confirm-backdrop`,onClick:()=>{c(`cancel`)},children:(0,H.jsxs)(`div`,{ref:o,role:`alertdialog`,"aria-modal":`true`,"aria-labelledby":`ue-confirm-title`,"aria-describedby":`ue-confirm-body`,className:`ue-confirm-modal ue-dialog-modal`,onClick:e=>e.stopPropagation(),children:[(0,H.jsx)(`button`,{className:`ue-modal-close ue-modal-close--light`,onClick:()=>{c(`cancel`)},"aria-label":t(`modalClose`),children:(0,H.jsx)(V,{size:18})}),(0,H.jsx)(`div`,{className:`ue-confirm-icon ue-confirm-icon--${r.tone||`info`}`,children:r.tone===`danger`||r.tone===`warning`?(0,H.jsx)(A,{size:18}):(0,H.jsx)(xe,{size:18})}),(0,H.jsxs)(`div`,{className:`ue-pane-copy ue-dialog-heading`,children:[(0,H.jsx)(`h2`,{id:`ue-confirm-title`,children:r.title}),(0,H.jsx)(`p`,{id:`ue-confirm-body`,children:r.message})]}),(0,H.jsxs)(`div`,{className:`ue-library-modal-actions ue-dialog-actions${r.alternativeLabel?` ue-dialog-actions--choice`:``}`,children:[(0,H.jsxs)(`button`,{className:`ue-secondary-btn`,onClick:()=>c(`cancel`),children:[(0,H.jsx)(V,{size:14}),(0,H.jsx)(`span`,{children:r.cancelLabel||t(`libraryCancel`)})]}),r.alternativeLabel?(0,H.jsx)(`button`,{className:`ue-secondary-btn`,onClick:()=>c(`alternative`),children:(0,H.jsx)(`span`,{children:r.alternativeLabel})}):null,(0,H.jsxs)(`button`,{className:`ue-primary-btn ${r.tone===`danger`?`ue-primary-btn--danger`:``}`,disabled:r.confirmDisabled,onClick:()=>c(`confirm`),children:[(0,H.jsx)(F,{size:14}),(0,H.jsx)(`span`,{children:r.confirmLabel||t(`commonConfirm`)})]})]})]})}),document.body):null]})},_t=()=>{let e=(0,p.useContext)(ht);if(!e)throw Error(`useConfirm must be used within ConfirmProvider`);return e},vt=`default_output`,K=e=>e.split(/[\\/]+/).filter(Boolean),yt=/(?:^|[^\d])(\d{4})[-_.](\d{1,2})[-_.](\d{1,2})(?:$|[^\d])/,bt=`universal-extractor:pinned-folders`,xt=`universal-extractor:folder-sort`,St=()=>{try{let e=JSON.parse(pt(`universal-extractor:pinned-folders`)||`[]`);return new Set(Array.isArray(e)?e.filter(e=>typeof e==`string`):[])}catch{return new Set}},Ct=()=>pt(`universal-extractor:folder-sort`)===`name`?`name`:`modified`,wt=e=>{let t=e.trim().replace(/\\/g,`/`).replace(/^\/+|\/+$/g,``);if(t.includes(`::`)){let[e,...n]=t.split(`::`);return{sourceId:e||`default_output`,relativePath:n.join(`::`).replace(/^\/+|\/+$/g,``)}}return{sourceId:vt,relativePath:t}},Tt=e=>`${e||`default_output`}::`,Et=(e,t)=>{let n=t.replace(/\\/g,`/`).replace(/^\/+|\/+$/g,``);return n?`${e||`default_output`}::${n}`:Tt(e)},Dt=e=>{let{relativePath:t}=wt(e);return K(t).at(-1)??``},Ot=(e,t)=>{let{sourceId:n,relativePath:r}=wt(e),i=t.replace(/\\/g,`/`).replace(/^\/+|\/+$/g,``);return Et(n,r?`${r}/${i}`:i)},kt=e=>wt(e).sourceId,At=e=>{let{relativePath:t}=wt(e);return!t},jt=(e,t)=>wt(e).sourceId===wt(t).sourceId,Mt=(e,t)=>{let n=wt(e),r=wt(t);return n.sourceId!==r.sourceId||!r.relativePath?!1:n.relativePath.startsWith(`${r.relativePath}/`)},Nt=e=>{let{sourceId:t,relativePath:n}=wt(e);return t===`default_output`&&n?[e,n]:[e]},Pt=(e,t)=>Nt(e).some(e=>t.has(e)),Ft=e=>{let t=Dt(e).match(yt);if(!t)return 0;let n=Number(t[1]),r=Number(t[2]),i=Number(t[3]),a=new Date(n,r-1,i);return a.getFullYear()!==n||a.getMonth()!==r-1||a.getDate()!==i?0:n*1e4+r*100+i},It=(e,t,n,r,i=new Map)=>{let a=Pt(e,n);if(a!==Pt(t,n))return a?-1:1;if(r===`modified`){let n=Ft(e),r=Ft(t);if(n&&r&&n!==r)return r-n;let a=(i.get(t)??0)-(i.get(e)??0);if(a!==0)return a}return e.localeCompare(t,void 0,{numeric:!0,sensitivity:`base`})},Lt=(e,t)=>e?.name||t,Rt=(e,t,n,r=``)=>{let{sourceId:i,relativePath:a}=wt(e);if(r&&i===r||i===`default_output`)return a||`./`;let o=n(t.find(e=>e.id===i),i);return a?`${o} / ${a}`:o},zt=(e,t,n,r=new Map)=>[...e].sort((e,i)=>It(e.path,i.path,t,n,r)).map(e=>({...e,children:zt(e.children,t,n,r)})),Bt=(e,t,n,r=[],i=Lt,a=``,o=new Map)=>{let s=[],c=new Map,l=new Map(r.map(e=>[e.id,e]));return e.forEach(e=>{let{sourceId:t,relativePath:n}=wt(e);if(a&&t!==a)return;let r=K(n),o=``,u=s;if(!a&&t!==`default_output`){o=Tt(t);let e=c.get(o);e||(e={path:o,name:i(l.get(t),t),children:[]},c.set(o,e),s.push(e)),u=e.children}r.forEach(e=>{let n=o?wt(o).relativePath:``;o=Et(t,n?`${n}/${e}`:e);let r=c.get(o);r||(r={path:o,name:e,children:[]},c.set(o,r),u.push(r)),u=r.children})}),zt(s,t,n,o)},Vt=e=>{let{sourceId:t,relativePath:n}=wt(e),r=K(n),i=t===`default_output`?[]:[Tt(t)];return r.slice(0,-1).map((e,n)=>Et(t,r.slice(0,n+1).join(`/`))).reduce((e,t)=>[...e,t],i)},Ht=(e,t)=>{let n=t.trim().toLowerCase();if(!n)return e;let r=new Set;return e.forEach(e=>{e.toLowerCase().includes(n)&&(Vt(e).forEach(e=>r.add(e)),r.add(e))}),e.filter(e=>r.has(e))},Ut=(e,t)=>e.filter(e=>kt(e)===t),Wt=e=>{let t=[],n=e=>{for(let r of e)r.children.length>0&&(t.push(r.path),n(r.children))};return n(e),t},Gt=(0,p.createContext)(null),Kt=({children:e})=>{let{notify:t}=Je(),n=(0,p.useCallback)((e,n=`info`,r=``)=>{t(e,n,r)},[t]),r=(0,p.useMemo)(()=>({pushToast:n}),[n]);return(0,H.jsx)(Gt.Provider,{value:r,children:e})},qt=()=>{let e=(0,p.useContext)(Gt);if(!e)throw Error(`useToast must be used within ToastProvider`);return e},Jt=e=>{let t=Number.isFinite(e)?Math.max(0,e):0;return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(0)} KB`:`${(t/(1024*1024)).toFixed(2)} MB`},Yt=e=>{if(!Number.isFinite(e)||e<=0)return null;let t=new Date(e*1e3);return Number.isNaN(t.getTime())?null:t},Xt=(e,t)=>Yt(e)?.toLocaleDateString(t)??`--`,Zt=(e,t)=>{let n=Yt(e);if(!n)return`--`;if(t)return n.toLocaleString(t,{year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`});let r=e=>String(e).padStart(2,`0`);return[`${n.getFullYear()}/${r(n.getMonth()+1)}/${r(n.getDate())}`,`${r(n.getHours())}:${r(n.getMinutes())}:${r(n.getSeconds())}`].join(` `)},Qt=(e,t)=>Yt(e)?.toLocaleString(t)??`--`,$t=(e,t)=>{let n=new Set(t.updated),r=[...new Set(e)].filter(e=>!n.has(e));return{failedPaths:r,complete:r.length===0}},en=(e,t)=>{let n=[...new Set(e)],r=new Set(n),i=new Set([...t.missing,...t.blocked??[],...t.unchanged??[]].filter(e=>r.has(e))),a=t.moved.length===n.length-i.size?n.filter(e=>!i.has(e)):[],o=new Set((t.moved_sources??a).filter(e=>r.has(e)&&!i.has(e))),s=n.filter(e=>!o.has(e));return{movedSources:o,failedPaths:s,unaccounted:s.filter(e=>!i.has(e)).length,complete:s.length===0&&t.moved.length===n.length}},tn=(e,t)=>{let n=[...new Set(e)],r=new Set(n),i=new Set(t.deleted.filter(e=>r.has(e))),a=n.filter(e=>!i.has(e)),o=new Set(t.missing);return{deletedPaths:i,failedPaths:a,unaccounted:a.filter(e=>!o.has(e)).length,complete:a.length===0&&t.deleted.length===n.length}},nn=e=>e.join(`; `),rn=e=>typeof e==`string`?e.trim():``,an=e=>{let t=rn(e?.summary?.positive_prompt);if(t)return t;let n=e?.metadata?.prompt;return typeof n==`string`?n.trim():``},on=e=>JSON.stringify({summary:e?.summary??null,recipe:e?.recipe??null,artist_prompts:e?.artist_prompts??[],metadata:e?.metadata??null,workflow:e?.workflow??null,state:e?.state??null},null,2),sn=({open:e,boards:t,selectedCount:r,onClose:i,onCreateBoard:a,onAddToBoard:o})=>{let{t:s}=n(),{confirm:c}=_t(),[l,u]=(0,p.useState)(``),[d,f]=(0,p.useState)(``),[m,h]=(0,p.useState)(!1),g=(0,p.useMemo)(()=>t[0]?.id??``,[t]),_=l||g;if(!e)return null;let v=async()=>{if(!(!_&&!d.trim())){h(!0);try{let e=_;if(d.trim()){if(!await c({title:s(`boardCreateTitle`),message:s(`boardCreateConfirm`,{name:d.trim()}),tone:`warning`,confirmLabel:s(`commonCreate`),cancelLabel:s(`libraryCancel`)}))return;e=(await a(d.trim())).board?.id??``}e&&(await o(e),f(``),u(``),i())}finally{h(!1)}}};return(0,H.jsx)(`div`,{className:`ue-modal-backdrop`,onClick:i,children:(0,H.jsxs)(`div`,{className:`ue-library-modal ue-board-picker-modal`,onClick:e=>e.stopPropagation(),children:[(0,H.jsx)(`button`,{className:`ue-modal-close ue-modal-close--light`,onClick:i,"aria-label":s(`modalClose`),children:(0,H.jsx)(V,{size:18})}),(0,H.jsxs)(`div`,{className:`ue-pane-copy`,children:[(0,H.jsx)(`p`,{className:`ue-pane-kicker`,children:s(`sidebarBoards`)}),(0,H.jsx)(`h2`,{children:s(`boardAddToTitle`)}),(0,H.jsx)(`p`,{children:s(`boardAddToText`,{count:r})})]}),(0,H.jsxs)(`div`,{className:`ue-board-picker-list`,children:[t.map(e=>(0,H.jsxs)(`button`,{className:`ue-board-picker-item ${_===e.id&&!d.trim()?`is-active`:``}`,onClick:()=>{u(e.id),f(``)},children:[(0,H.jsx)(`span`,{className:`ue-board-cover`,children:e.cover_image?(0,H.jsx)(`img`,{src:e.cover_image.thumb_url,alt:``,loading:`lazy`}):(0,H.jsx)(be,{size:15})}),(0,H.jsx)(`span`,{children:e.name}),(0,H.jsx)(`em`,{children:e.count})]},e.id)),t.length===0?(0,H.jsx)(`p`,{className:`ue-tool-helper`,children:s(`boardEmptyText`)}):null]}),(0,H.jsxs)(`label`,{className:`ue-import-text-field`,children:[(0,H.jsx)(`span`,{children:s(`boardCreateInline`)}),(0,H.jsx)(`input`,{value:d,onChange:e=>f(e.target.value),placeholder:s(`boardNamePlaceholder`)})]}),(0,H.jsxs)(`div`,{className:`ue-library-modal-actions`,children:[(0,H.jsx)(`button`,{className:`ue-icon-action`,onClick:i,"aria-label":s(`libraryCancel`),title:s(`libraryCancel`),children:(0,H.jsx)(V,{size:14})}),(0,H.jsx)(`button`,{className:`ue-icon-action ue-icon-action--filled`,onClick:()=>void v(),disabled:m||!_&&!d.trim(),"aria-label":d.trim()?s(`sidebarCreateBoard`):s(`boardAddToAction`),title:d.trim()?s(`sidebarCreateBoard`):s(`boardAddToAction`),children:d.trim()?(0,H.jsx)(pe,{size:14}):(0,H.jsx)(F,{size:14})})]})]})})},cn=({open:e,categories:t,selectedCategory:r,onClose:i,onSelect:a})=>{let{t:o}=n(),[s,c]=(0,p.useState)(``),l=(0,p.useMemo)(()=>{let e=s.trim().toLowerCase();return e?t.filter(t=>t.toLowerCase().includes(e)):t},[t,s]);return e?(0,H.jsx)(`div`,{className:`ue-modal-backdrop`,onClick:i,children:(0,H.jsxs)(`div`,{className:`ue-library-modal`,onClick:e=>e.stopPropagation(),children:[(0,H.jsx)(`button`,{className:`ue-modal-close ue-modal-close--light`,onClick:i,"aria-label":o(`modalClose`),children:(0,H.jsx)(V,{size:18})}),(0,H.jsxs)(`div`,{className:`ue-pane-copy`,children:[(0,H.jsx)(`p`,{className:`ue-pane-kicker`,children:o(`galleryAllCategories`)}),(0,H.jsx)(`h2`,{children:o(`galleryCategoryBrowse`)}),(0,H.jsx)(`p`,{children:o(`galleryCategoryBrowseHint`)})]}),(0,H.jsxs)(`label`,{className:`ue-import-text-field`,children:[(0,H.jsx)(`span`,{children:o(`navSearchGalleryPlaceholder`)}),(0,H.jsxs)(`div`,{className:`ue-picker-search`,children:[(0,H.jsx)(Pe,{size:14}),(0,H.jsx)(`input`,{value:s,onChange:e=>c(e.target.value)})]})]}),(0,H.jsxs)(`div`,{className:`ue-category-picker-list`,children:[(0,H.jsx)(`button`,{className:`ue-pill ue-pill--block ${r===``?`active`:``}`,onClick:()=>{a(``),i()},children:o(`galleryAllCategories`)}),l.map(e=>(0,H.jsx)(`button`,{className:`ue-pill ue-pill--block ${r===e?`active`:``}`,onClick:()=>{a(e),i()},children:e},e))]})]})}):null},ln=class{capacity;set=new Set;constructor(e=2500){this.capacity=e}has(e){return this.set.has(e)}add(e){if(this.set.has(e)){this.set.delete(e),this.set.add(e);return}if(this.set.size>=this.capacity){let e=this.set.values().next().value;e!==void 0&&this.set.delete(e)}this.set.add(e)}delete(e){return this.set.delete(e)}clear(){this.set.clear()}get size(){return this.set.size}},un=new ln(2500),dn=new ln(2500),fn=new Set,pn=[],mn=4,hn=80,gn=0,_n=e=>{let t=e.thumb_url||e.url;return e.asset_id?`${t}${t.includes(`?`)?`&`:`?`}content_version=${encodeURIComponent(`${e.asset_id}:${e.content_revision??1}`)}`:t},vn=e=>un.has(e),yn=e=>{un.add(e)},bn=()=>{for(;gni(!1),15e3),i=i=>{n||(n=!0,window.clearTimeout(r),t.onload=null,t.onerror=null,i||(t.src=``),i?un.add(e):dn.delete(e),gn=Math.max(0,gn-1),bn())};t.onload=()=>{typeof t.decode==`function`?t.decode().then(()=>i(!0),()=>i(!1)):i(!0)},t.onerror=()=>i(!1),t.src=e}},xn=e=>{let t=_n(e);if(!(!t||un.has(t)||dn.has(t)||fn.has(t))){if(pn.length>=hn){let e=pn.shift();e&&(fn.delete(e),dn.delete(e))}dn.add(t),fn.add(t),pn.push(t),bn()}},Sn=e=>{let t=_n(e.image);return(0,H.jsx)(Cn,{...e,imageUrl:t},t)},Cn=({image:e,priority:t=!1,onOpenDetail:r,imageUrl:i})=>{let{t:a}=n(),[o,s]=(0,p.useState)(()=>vn(i)),[c,l]=(0,p.useState)(!1),[u,d]=(0,p.useState)(0),f=(0,p.useCallback)(()=>{yn(i),s(!0),l(!1)},[i]),m=(0,p.useCallback)(e=>{e?.complete&&e.naturalWidth>0&&f()},[f]),h=()=>{s(!0),l(!0)},g=e=>{e.stopPropagation(),l(!1),s(!1),d(e=>e+1)},_=u>0?`${i}${i.includes(`?`)?`&`:`?`}_retry=${u}`:i;return(0,H.jsx)(`div`,{className:`ue-gallery-image-shell ${o?`is-loaded`:``} ${c?`has-error`:``}`,children:c?(0,H.jsxs)(`div`,{className:`ue-gallery-image-fallback`,onClick:t=>r(e,t),role:`button`,tabIndex:0,onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.currentTarget.click())},title:e.filename,children:[(0,H.jsx)(`div`,{className:`ue-gallery-image-fallback-icon`,children:(0,H.jsx)(ve,{size:22})}),(0,H.jsx)(`span`,{className:`ue-gallery-image-fallback-text`,children:e.filename}),(0,H.jsxs)(`button`,{type:`button`,className:`ue-gallery-image-retry-btn`,onClick:g,title:a(`imageRetry`),"aria-label":a(`imageRetry`),children:[(0,H.jsx)(Ne,{size:12}),(0,H.jsx)(`span`,{children:a(`imageRetryShort`)})]})]}):(0,H.jsx)(`img`,{ref:m,src:_,alt:e.title||e.filename,role:`button`,tabIndex:0,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.currentTarget.click())},loading:t?`eager`:`lazy`,decoding:`async`,draggable:!1,onLoad:f,onError:h,onClick:t=>r(e,t)},u)})};function wn(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o;n.key&&n.debug?.call(n)&&(o=Date.now());let s=e();if(!(s.length!==r.length||s.some((e,t)=>r[t]!==e)))return i;r=s;let c;if(n.key&&n.debug?.call(n)&&(c=Date.now()),i=t(...s),n.key&&n.debug?.call(n)){let e=Math.round((Date.now()-o)*100)/100,t=Math.round((Date.now()-c)*100)/100,r=t/16,i=(e,t)=>{for(e=String(e);e.length{r=e},o}function Tn(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var En=(e,t)=>Math.abs(e-t)<1.01,Dn=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},On=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},kn=e=>e,An=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let e=t;e<=n;e++)r.push(e);return r},jn=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(On(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(On(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},Mn={passive:!0},Nn=typeof window>`u`?!0:`onscrollend`in window,Pn=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=0,a=e.options.useScrollendEvent&&Nn?()=>void 0:Dn(r,()=>{t(i,!1)},e.options.isScrollingResetDelay),o=r=>()=>{let{horizontal:o,isRtl:s}=e.options;i=o?n.scrollLeft*(s&&-1||1):n.scrollTop,a(),t(i,r)},s=o(!0),c=o(!1);n.addEventListener(`scroll`,s,Mn);let l=e.options.useScrollendEvent&&Nn;return l&&n.addEventListener(`scrollend`,c,Mn),()=>{n.removeEventListener(`scroll`,s),l&&n.removeEventListener(`scrollend`,c)}},Fn=(e,t,n)=>{if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},In=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;let o=e+t;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:o,behavior:n})},Ln=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);return}this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([t,n])=>{n===void 0&&delete e[t]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:kn,rangeExtractor:An,onChange:()=>{},measureElement:Fn,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,...e}},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=wn(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}this.scrollElement=e,this.scrollElement&&`ownerDocument`in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{let n=new Map,r=new Map;for(let i=t-1;i>=0;i--){let t=e[i];if(n.has(t.lane))continue;let a=r.get(t.lane);if(a==null||t.end>a.end?r.set(t.lane,t):t.ende.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=wn(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(e,t,n,r,i,a,o)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o}),{key:!1}),this.getMeasurements=wn(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o},s)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let c=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1);let l=this.measurementsCache.slice(0,c),u=Array(a).fill(void 0);for(let e=0;e1){c=a;let e=u[c],r=e===void 0?void 0:l[e];d=r?r.end+this.options.gap:t+n}else{let e=this.options.lanes===1?l[i-1]:this.getFurthestMeasurement(l,i);d=e?e.end+this.options.gap:t+n,c=e?e.lane:i%this.options.lanes,this.options.lanes>1&&f&&this.laneAssignments.set(i,c)}let p=s.get(e),m=typeof p==`number`?p:this.options.estimateSize(i),h=d+m;l[i]={index:i,start:d,size:m,end:h,key:e,lane:c},u[c]=i}return this.measurementsCache=l,l},{key:!1,debug:()=>this.options.debug}),this.calculateRange=wn(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>this.range=e.length>0&&t>0?zn({measurements:e,outerSize:t,scrollOffset:n,lanes:r}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=wn(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e),n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{let n=this.measurementsCache[e];if(!n)return;let r=t-(this.itemSizeCache.get(n.key)??n.size);r!==0&&(this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?n.start[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;rthis.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length!==0)return Tn(t[Rn(0,t.length-1,e=>Tn(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`)if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t];if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{let r=this.getOffsetForAlignment(e,t),i=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:`start`,behavior:t,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1)t=e[e.length-1]?.end??0;else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&En(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.scrollState=null;return}}else this.scrollState.stableFrames=0,n&&(this.scrollState.lastTargetOffset=t,this.scrollState.behavior=`auto`,this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}));this.scheduleScrollReconcile()}},Rn=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(ar)t=i-1;else return i}return e>0?e-1:0};function zn({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){let i=e.length-1,a=t=>e[t].start;if(e.length<=r)return{startIndex:0,endIndex:i};let o=Rn(0,i,a,n),s=o;if(r===1)for(;s1){let a=Array(r).fill(0);for(;se=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(i,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}var Bn=typeof document<`u`?p.useLayoutEffect:p.useEffect;function Vn({useFlushSync:e=!0,...t}){let n=p.useReducer(()=>({}),{})[1],r={...t,onChange:(r,i)=>{var a;e&&i?(0,h.flushSync)(n):n(),(a=t.onChange)==null||a.call(t,r,i)}},[i]=p.useState(()=>new Ln(r));return i.setOptions(r),Bn(()=>i._didMount(),[]),Bn(()=>i._willUpdate()),i}function Hn(e){return Vn({observeElementRect:jn,observeElementOffset:Pn,scrollToFn:In,...e})}var Un=160,Wn=190,Gn=145,Kn=160,qn=1.36,Jn=2,Yn=100,Xn=e=>{let t=Number(e?.width??0),n=Number(e?.height??0),r=t>0&&n>0?n/t:0;return Number.isFinite(r)&&r>0?r:qn},Zn=e=>JSON.stringify([e.relative_path,e.asset_id??``,e.content_revision??0,e.size,e.created_at]),Qn=(e,t,n)=>{let r=t<=560?Gn:t<=960?Wn:Un,i=Math.max(1,Math.floor((t+n)/(r+n)));return Math.max(1,Math.min(e,i))},$n=(e,t,n)=>Math.max(Kn,(e-n*(t-1))/t),er=(e,t,n=`standard`)=>{let r=Xn(t);return Math.round(Math.max(Yn,(e-Jn)*r)+tt(n).chrome)},tr=({images:e,virtualItems:t,columnWidth:n,gap:r,scrollMargin:i=0})=>t.map(t=>{let a=e[t.index];return a?{image:a,index:t.index,top:t.start-i,left:t.lane*(n+r),width:n,lane:t.lane}:null}).filter(e=>e!==null),nr=({images:e,requestedColumns:t,gridWidth:n,viewportWidth:r,scrollElement:i,gap:a,density:o=`standard`,scrollMargin:s=0})=>{let c=n>0?n:Math.max(320,r-32),l=(0,p.useMemo)(()=>Qn(t,c,a),[c,a,t]),u=(0,p.useMemo)(()=>$n(c,l,a),[c,l,a]),d=JSON.stringify(e.map(Zn)),f=(0,p.useMemo)(()=>JSON.parse(d),[d]),[m,h]=(0,p.useState)(()=>({keys:f,ratios:e.map(Xn)})),g=m.ratios;if(m.keys!==f){let t=new Map(m.keys.map((e,t)=>[e,m.ratios[t]])),n={keys:f,ratios:e.map((e,n)=>t.get(f[n])??Xn(e))};h(n),g=n.ratios}let _=(0,p.useCallback)(e=>f[e]??e,[f]),v=(0,p.useCallback)(e=>er(u,{width:1,height:g[e]},o),[u,o,g]),y=Hn({count:e.length,getScrollElement:()=>i,getItemKey:_,estimateSize:v,scrollMargin:s,gap:a,lanes:l,overscan:Math.max(l*3,8),useAnimationFrameWithResizeObserver:!0,laneAssignmentMode:`estimate`}),b=(0,p.useRef)(u),x=(0,p.useRef)(o),S=(0,p.useRef)(null);(0,p.useLayoutEffect)(()=>{if(Math.abs(b.current-u)>.5||x.current!==o){b.current=u,x.current=o;let e=S.current;if(y.measure(),e){let t=f.findIndex(t=>t===e.key);y.getTotalSize();let n=y.measurementsCache[t];n&&y.scrollToOffset(n.start-e.offset,{align:`start`})}}let e=y.scrollOffset??0,t=y.getVirtualItems().find(t=>t.end>=e);S.current=t?{key:t.key,offset:t.start-e}:null});let C=y.getVirtualItems(),w=(0,p.useMemo)(()=>tr({images:e,virtualItems:C,columnWidth:u,gap:a,scrollMargin:s}).map(e=>({...e,height:v(e.index),mediaRatio:g[e.index]})),[u,a,e,C,s,v,g]),T=(0,p.useCallback)(e=>{let t=y.measurementsCache[e];return t?{top:t.start-s,left:t.lane*(u+a),width:u,height:t.size}:null},[y,s,u,a]);return{columnCount:l,columnWidth:u,items:w,totalHeight:y.getTotalSize(),measureElement:y.measureElement,scrollToIndex:y.scrollToIndex,getItemLayout:T}},rr=({selectionEnabled:e,selectionBox:t})=>!e||!t||typeof document>`u`?null:(0,h.createPortal)((0,H.jsx)(`div`,{className:`ue-selection-box`,style:{left:Math.min(t.startX,t.currentX),top:Math.max(60,Math.min(t.startY-(t.scrollDelta??0),t.currentY)),width:Math.abs(t.currentX-t.startX),height:Math.max(0,Math.min(window.innerHeight,Math.max(t.startY-(t.scrollDelta??0),t.currentY))-Math.max(60,Math.min(t.startY-(t.scrollDelta??0),t.currentY)))}}),document.body),ir=({images:e,highlightPath:t,emptyState:r,galleryViewMode:i,selectionMode:a,selectionEnabled:o,selectionBox:s,pageSelectedPaths:c,page:l,totalPages:u,total:d,effectiveColumns:f,masonryLayout:p,gridRef:m,cardRefs:h,isDraggingSelectionRef:g,onOpenDetail:_,onOpenWorkflow:v,onUpdateImageState:y,onBoardPickerPathsChange:b,onImageSelectionClick:x,onOpenContextMenu:S,onSelectAllVisible:C,onPageChange:w,onPageJump:T})=>{let{t:E,locale:D}=n(),te=(e,t)=>{if(t&&c.length>1){b(c);return}b([e.relative_path])};return e.length===0?(0,H.jsxs)(`div`,{className:`ue-gallery-state ue-gallery-state--empty`,children:[(0,H.jsx)(ye,{size:44,strokeWidth:1.2}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`h3`,{children:r?.title||E(`galleryEmptyTitle`)}),(0,H.jsx)(`p`,{children:r?.description||E(`galleryEmptyText`)}),r?.onAction&&r.actionLabel?(0,H.jsx)(`button`,{className:`ue-secondary-action`,type:`button`,onClick:r.onAction,children:r.actionLabel}):null]})]}):(0,H.jsxs)(H.Fragment,{children:[i===`list`?(0,H.jsxs)(`div`,{className:`ue-gallery-selection-surface`,children:[(0,H.jsx)(`div`,{ref:m,className:`ue-gallery-list ue-gallery-list--selectable`,children:e.map((e,n)=>{let r=c.includes(e.relative_path);return(0,H.jsxs)(`article`,{"data-tour-id":n===0?`gallery-card`:void 0,ref:t=>{h.current[e.relative_path]=t},className:`ue-gallery-list-row ${r?`is-selected`:``} ${t===e.relative_path?`is-located`:``}`,onContextMenu:t=>S(t,e),onClick:t=>{if(a){x(e.relative_path,t);return}g.current||_(e)},children:[(0,H.jsx)(`button`,{className:`ue-trash-card-check ${r?`active`:``}`,onClick:t=>{t.stopPropagation(),x(e.relative_path,t)},"aria-label":E(r?`galleryDeselectImage`:`gallerySelectImage`),title:E(r?`galleryDeselectImage`:`gallerySelectImage`),children:r?(0,H.jsx)(k,{size:14}):(0,H.jsx)(Re,{size:14})}),(0,H.jsx)(`button`,{className:`ue-gallery-list-thumb`,onClick:t=>{if(t.stopPropagation(),a){x(e.relative_path,t);return}_(e)},"aria-label":E(`galleryInspect`),title:E(`galleryInspect`),children:(0,H.jsx)(`img`,{src:_n(e),alt:e.title||e.filename,loading:`lazy`,decoding:`async`})}),(0,H.jsxs)(`div`,{className:`ue-gallery-list-main`,children:[(0,H.jsxs)(`div`,{className:`ue-gallery-list-heading`,children:[(0,H.jsx)(`h3`,{title:e.title||e.filename,children:e.title||e.filename}),e.category?(0,H.jsx)(`span`,{children:e.category}):null]}),(0,H.jsx)(`p`,{title:e.relative_path,children:e.relative_path}),(0,H.jsxs)(`div`,{className:`ue-gallery-list-meta`,children:[(0,H.jsx)(`span`,{children:Zt(e.created_at,D)}),(0,H.jsx)(`span`,{children:Jt(e.size)}),e.width&&e.height?(0,H.jsx)(`span`,{children:`${e.width} x ${e.height}`}):null,e.pinned?(0,H.jsx)(`span`,{children:E(`galleryPin`)}):null]})]}),(0,H.jsxs)(`div`,{className:`ue-gallery-list-actions`,children:[(0,H.jsx)(`button`,{className:`ue-icon-action`,"data-tour-id":n===0?`gallery-workflow`:void 0,onClick:t=>{t.stopPropagation(),v(e)},"aria-label":E(`modalOpenWorkflow`),title:E(`modalOpenWorkflow`),children:(0,H.jsx)(Fe,{size:14})}),(0,H.jsx)(`button`,{className:`ue-icon-action`,onClick:t=>{t.stopPropagation(),_(e)},"aria-label":E(`galleryInspect`),title:E(`galleryInspect`),children:(0,H.jsx)(ue,{size:14})}),(0,H.jsx)(`button`,{className:`ue-icon-action`,onClick:t=>{t.stopPropagation(),te(e,r)},"aria-label":E(`bulkAddToBoard`),title:E(`bulkAddToBoard`),children:(0,H.jsx)(pe,{size:14})}),(0,H.jsx)(`button`,{className:`ue-icon-action ${e.pinned?`ue-icon-action--accent`:``}`,onClick:t=>{t.stopPropagation(),y(e.relative_path,{pinned:!e.pinned})},"aria-label":e.pinned?E(`galleryUnpin`):E(`galleryPin`),title:e.pinned?E(`galleryUnpin`):E(`galleryPin`),children:(0,H.jsx)(Ae,{size:14,fill:e.pinned?`currentColor`:`none`})})]})]},e.relative_path)})}),(0,H.jsx)(rr,{selectionEnabled:o,selectionBox:s})]}):(0,H.jsxs)(`div`,{className:`ue-gallery-selection-surface`,children:[(0,H.jsx)(`div`,{ref:m,className:`ue-gallery-grid ue-gallery-grid--virtual`,style:{height:`${p.totalHeight}px`},children:p.items.map(({image:e,index:n,top:r,left:i,width:o,lane:s,height:l,mediaRatio:u})=>{let d=c.includes(e.relative_path),m=Number(e.width??0),b=Number(e.height??0),C=m>0&&b>0?`${m} × ${b}`:``,w={aspectRatio:`1 / ${u??Xn(e)}`};return(0,H.jsxs)(`article`,{className:`ue-gallery-card ${d?`is-selected`:``} ${t===e.relative_path?`is-located`:``}`,"data-tour-id":n===0?`gallery-card`:void 0,"data-index":n,"data-lane":s,style:{top:`${r}px`,left:`${i}px`,width:`${o}px`,height:l===void 0?void 0:`${l}px`},onContextMenu:t=>S(t,e),ref:t=>{h.current[e.relative_path]=t,p.measureElement(t)},children:[(0,H.jsxs)(`div`,{className:`ue-gallery-media`,style:w,children:[(0,H.jsx)(Sn,{image:e,priority:n{if(a){x(e.relative_path,t);return}g.current||_(e)}}),(0,H.jsxs)(`div`,{className:`ue-gallery-actions ${a?`is-selecting`:``}`,children:[(0,H.jsx)(`button`,{className:`ue-send-btn`,"data-tour-id":n===0?`gallery-workflow`:void 0,onClick:t=>{t.stopPropagation(),v(e)},"aria-label":E(`modalOpenWorkflow`),title:E(`modalOpenWorkflow`),children:(0,H.jsx)(Fe,{size:13})}),(0,H.jsx)(`button`,{className:`ue-select-btn ${d?`active`:``}`,onClick:t=>{t.stopPropagation(),x(e.relative_path,t)},"aria-label":E(d?`galleryDeselectImage`:`gallerySelectImage`),title:E(d?`galleryDeselectImage`:`gallerySelectImage`),children:d?(0,H.jsx)(k,{size:13}):(0,H.jsx)(Re,{size:13})}),(0,H.jsx)(`button`,{className:`ue-board-btn`,onClick:t=>{t.stopPropagation(),S(t,e)},"aria-label":E(`moreActions`),title:E(`moreActions`),children:(0,H.jsx)(ee,{size:13})}),(0,H.jsx)(`button`,{className:`ue-pin-btn ${e.pinned?`active`:``}`,onClick:t=>{t.stopPropagation(),y(e.relative_path,{pinned:!e.pinned})},"aria-label":e.pinned?E(`galleryUnpin`):E(`galleryPin`),title:e.pinned?E(`galleryUnpin`):E(`galleryPin`),children:(0,H.jsx)(Ae,{size:13,fill:e.pinned?`currentColor`:`none`})})]})]}),(0,H.jsxs)(`button`,{className:`ue-gallery-body`,onClick:t=>{if(a){x(e.relative_path,t);return}g.current||_(e)},children:[(0,H.jsx)(`span`,{className:`ue-gallery-title`,title:e.title||e.filename,children:e.title||e.filename}),(0,H.jsxs)(`span`,{className:`ue-gallery-meta`,children:[(0,H.jsx)(`span`,{children:Xt(e.created_at,D)}),(0,H.jsx)(`i`,{"aria-hidden":`true`,children:`·`}),(0,H.jsx)(`span`,{children:Jt(e.size)}),C?(0,H.jsx)(`span`,{className:`ue-gallery-resolution-chip`,children:C}):null,e.category?(0,H.jsx)(`span`,{className:`ue-gallery-category-chip`,title:e.category,children:e.category}):null]})]})]},e.relative_path)})}),(0,H.jsx)(rr,{selectionEnabled:o,selectionBox:s})]}),(0,H.jsxs)(`div`,{className:`ue-pagination`,children:[(0,H.jsxs)(`div`,{className:`ue-pagination-meta`,children:[(0,H.jsx)(`span`,{children:E(`galleryPage`,{page:l,totalPages:u})}),(0,H.jsx)(`i`,{"aria-hidden":`true`,children:`/`}),(0,H.jsxs)(`span`,{children:[d,` `,E(`galleryStatsTotal`)]})]}),(0,H.jsxs)(`div`,{className:`ue-pagination-actions`,children:[a?(0,H.jsx)(`button`,{"aria-label":E(`bulkSelectVisible`),title:E(`bulkSelectVisible`),onClick:C,children:(0,H.jsx)(k,{size:14})}):null,(0,H.jsx)(`button`,{disabled:l<=1,onClick:()=>w(l-1),"aria-label":E(`galleryPrevious`),title:E(`galleryPrevious`),children:(0,H.jsx)(I,{size:14})}),(0,H.jsx)(`button`,{disabled:l>=u,onClick:()=>w(l+1),"aria-label":E(`galleryNext`),title:E(`galleryNext`),children:(0,H.jsx)(L,{size:14})}),(0,H.jsxs)(`form`,{className:`ue-pagination-jump`,onSubmit:e=>{e.preventDefault(),T(new FormData(e.currentTarget))},children:[(0,H.jsxs)(`label`,{className:`ue-select-field ue-pagination-jump-field`,children:[(0,H.jsx)(`span`,{children:E(`galleryJumpTo`)}),(0,H.jsx)(`input`,{name:`page`,type:`number`,min:1,max:u,defaultValue:l,"aria-label":E(`galleryJumpTo`)})]}),(0,H.jsx)(`button`,{type:`submit`,"aria-label":E(`galleryJump`),title:E(`galleryJump`),children:(0,H.jsx)(ce,{size:14})})]},l)]})]})]})},ar=({label:e,icon:t,children:n,className:r=``,closeOnAction:i=!0,tourId:a})=>{let o=(0,p.useRef)(null);return(0,p.useEffect)(()=>{let e=e=>{let t=o.current;if(t?.open)if(e instanceof KeyboardEvent){if(e.key!==`Escape`)return;t.open=!1,t.querySelector(`summary`)?.focus()}else e.target instanceof Node&&!t.contains(e.target)&&(t.open=!1)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,e)}},[]),(0,H.jsxs)(`details`,{ref:o,className:`ue-disclosure-menu ${r}`,children:[(0,H.jsx)(`summary`,{"data-tour-id":a,"aria-label":e,title:e,children:t}),(0,H.jsx)(`div`,{className:`ue-disclosure-panel`,"aria-label":e,onClick:e=>{i&&e.target instanceof Element&&e.target.closest(`button`)&&o.current&&(o.current.open=!1,o.current.querySelector(`summary`)?.focus())},children:n})]})};function or({value:e,open:t,onToggle:r,onClose:i,onChange:a,effectiveColumns:o,isMobile:s=!1,mobilePreset:c=`single`,onMobilePresetChange:l,onListView:u}){let{t:d}=n(),f=(0,p.useRef)(null),m=(0,p.useRef)(null),[h,g]=(0,p.useState)({left:12,top:80}),_=(0,p.useCallback)(()=>{i(),f.current?.focus({preventScroll:!0})},[i]);return C(t,_),(0,p.useEffect)(()=>{if(!t)return;let e=()=>{let e=f.current?.getBoundingClientRect();if(!e)return;let t=m.current?.getBoundingClientRect().height||290,n=Math.min(320,window.innerWidth-24);g({left:Math.max(12,Math.min(e.right-n,window.innerWidth-n-12)),top:e.bottom+8+t{n.disconnect(),window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[t]),(0,H.jsxs)(`div`,{className:`ue-density-control`,children:[(0,H.jsxs)(`button`,{ref:f,className:`ue-density-trigger ${t?`is-open`:``}`,type:`button`,"data-tour-id":`gallery-density`,"aria-expanded":t,"aria-haspopup":`dialog`,"aria-label":d(`densityTitle`),title:d(`densityTitle`),onClick:e=>{e.stopPropagation(),r()},children:[(0,H.jsx)(D,{size:15}),(0,H.jsx)(`span`,{children:d(`densityShort`)})]}),t?(0,H.jsx)(S,{children:(0,H.jsxs)(`div`,{ref:m,role:`dialog`,tabIndex:-1,"aria-label":d(`densityTitle`),className:`ue-density-panel`,style:h,onClick:e=>e.stopPropagation(),onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),_())},children:[(0,H.jsxs)(`header`,{children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`strong`,{children:d(`densityTitle`)}),(0,H.jsx)(`p`,{children:d(`densityHint`)})]}),(0,H.jsx)(`button`,{type:`button`,onClick:_,"aria-label":d(`modalClose`),children:(0,H.jsx)(V,{size:16})})]}),s?(0,H.jsxs)(`div`,{className:`ue-density-presets ue-density-presets--mobile`,role:`group`,"aria-label":d(`densityPresets`),children:[[`single`,`double`].map(e=>(0,H.jsxs)(`button`,{type:`button`,"aria-pressed":c===e,onClick:()=>l?.(e),children:[(0,H.jsx)(`span`,{className:`ue-density-preview`,"aria-hidden":`true`,style:{gridTemplateColumns:`repeat(${e===`single`?1:2},1fr)`},children:Array.from({length:e===`single`?2:4},(e,t)=>(0,H.jsx)(`i`,{},t))}),(0,H.jsx)(`strong`,{children:d(e===`single`?`densityMobileSingle`:`densityMobileDouble`)})]},e)),(0,H.jsxs)(`button`,{type:`button`,onClick:u,children:[(0,H.jsxs)(`span`,{className:`ue-density-preview ue-density-preview--list`,"aria-hidden":`true`,children:[(0,H.jsx)(`i`,{}),(0,H.jsx)(`i`,{}),(0,H.jsx)(`i`,{})]}),(0,H.jsx)(`strong`,{children:d(`viewList`)})]})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{className:`ue-density-presets`,role:`group`,"aria-label":d(`densityPresets`),children:[{n:3,key:`densitySpacious`,cells:6},{n:4,key:`densityBalanced`,cells:8},{n:6,key:`densityCompact`,cells:12}].map(({n:t,key:n,cells:r})=>(0,H.jsxs)(`button`,{type:`button`,"aria-pressed":e===t,onClick:()=>a(t),children:[(0,H.jsx)(`span`,{className:`ue-density-preview`,"aria-hidden":`true`,style:{gridTemplateColumns:`repeat(${t},1fr)`},children:Array.from({length:r},(e,t)=>(0,H.jsx)(`i`,{},t))}),(0,H.jsx)(`strong`,{children:d(n)}),(0,H.jsx)(`small`,{children:d(`densityColumns`,{count:t})})]},t))}),(0,H.jsxs)(`div`,{className:`ue-density-adjust`,children:[(0,H.jsx)(`button`,{type:`button`,disabled:e<=3,onClick:()=>a(e-1),"aria-label":d(`densityLarger`),children:(0,H.jsx)(Oe,{size:16})}),(0,H.jsx)(`input`,{type:`range`,min:3,max:8,step:1,value:e,"aria-label":d(`densityColumnsLabel`),"aria-valuetext":d(`densityColumns`,{count:e}),onChange:e=>a(Number(e.target.value))}),(0,H.jsx)(`button`,{type:`button`,disabled:e>=8,onClick:()=>a(e+1),"aria-label":d(`densitySmaller`),children:(0,H.jsx)(je,{size:16})}),(0,H.jsx)(`output`,{"aria-live":`polite`,children:e})]}),(0,H.jsx)(`button`,{className:`ue-density-reset`,type:`button`,disabled:e===6,onClick:()=>a(6),children:d(`densityResetDefault`)})]}),(0,H.jsxs)(`p`,{className:`ue-density-note`,role:`status`,children:[o===void 0?null:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`strong`,{children:d(`densityEffectiveColumns`,{count:o})}),` · `]}),d(`densityResponsiveNote`)]})]})}):null]})}var sr=[{value:`red`,color:`#dc2626`},{value:`orange`,color:`#f97316`},{value:`yellow`,color:`#eab308`},{value:`green`,color:`#16a34a`},{value:`cyan`,color:`#06b6d4`},{value:`blue`,color:`#2563eb`},{value:`purple`,color:`#7c3aed`},{value:`pink`,color:`#ec4899`},{value:`brown`,color:`#92400e`},{value:`black`,color:`#18181b`},{value:`white`,color:`#ffffff`},{value:`gray`,color:`#71717a`},{value:`warm`,color:`linear-gradient(135deg, #dc2626, #f97316, #eab308)`},{value:`cool`,color:`linear-gradient(135deg, #16a34a, #06b6d4, #2563eb)`},{value:`low_saturation`,color:`linear-gradient(135deg, #d4d4d8, #71717a)`}],q=[{value:`created_at`,labelKey:`gallerySortNewest`,hintKey:`gallerySortNewestHint`},{value:`filename`,labelKey:`gallerySortName`,hintKey:`gallerySortNameHint`},{value:`size`,labelKey:`gallerySortSize`,hintKey:`gallerySortSizeHint`}],cr=[{value:`desc`,labelKey:`gallerySortDesc`,hintKey:`gallerySortDescHint`},{value:`asc`,labelKey:`gallerySortAsc`,hintKey:`gallerySortAscHint`}],lr=(e,t)=>{let n=pt(e);return n===`grid`||n===`list`?n:t},ur=({selectedCategory:e,dateFrom:t,dateTo:n,favoritesOnly:r,selectedColorFamily:i,sortBy:a,sortOrder:o})=>[e,t,n,r,i].filter(Boolean).length+ +(a!==`created_at`||o!==`desc`),dr=(e,t)=>e===`low_saturation`?t.includes(` `)?t.split(` `)[0]:t:t.endsWith(`色`)&&t.length<=3?t.slice(0,-1):t,fr=({total:e,activeFilterControlCount:t,categories:r,selectedCategory:i,dateFrom:a,dateTo:o,favoritesOnly:s,selectedColorFamily:c,colorIndexStatus:l,sortBy:u,sortOrder:d,onClose:f,onOpenCategoryPicker:m,onCategoryChange:h,onDateFromChange:g,onDateToChange:_,onFavoritesOnlyChange:v,onColorFamilyChange:y,onSortByChange:b,onSortOrderChange:x,onPageChange:S})=>{let{t:C}=n(),w=(0,p.useRef)(null),T=(0,p.useRef)(null);(0,p.useEffect)(()=>{T.current=document.activeElement instanceof HTMLElement?document.activeElement:null,w.current?.focus({preventScroll:!0})},[]);let ee=()=>{f(),T.current?.focus({preventScroll:!0})},E=sr.find(e=>e.value===c),D=q.find(e=>e.value===u)??q[0],te=cr.find(e=>e.value===d)??cr[0],ne=r.slice(0,8),re=e=>C(`colorFamily_${e}`),O=e=>dr(e,re(e)),k=()=>{h(``),g(``),_(``),v(!1),y(``),S(1)},A=[i?{key:`category`,label:i,onClear:()=>{h(``),S(1)}}:null,E?{key:`color`,label:re(E.value),color:E.color,onClear:()=>{y(``),S(1)}}:null,a?{key:`dateFrom`,label:`${C(`galleryDateFrom`)} ${a}`,onClear:()=>{g(``),S(1)}}:null,o?{key:`dateTo`,label:`${C(`galleryDateTo`)} ${o}`,onClear:()=>{_(``),S(1)}}:null,s?{key:`favorites`,label:C(`galleryPinnedOnly`),onClear:()=>{v(!1),S(1)}}:null].filter(Boolean);return(0,H.jsxs)(`div`,{ref:w,role:`dialog`,"aria-label":C(`galleryFilters`),tabIndex:-1,onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),ee())},className:`ue-filter-menu`,onClick:e=>e.stopPropagation(),children:[(0,H.jsxs)(`div`,{className:`ue-filter-menu-head`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`span`,{children:C(`galleryFilters`)}),(0,H.jsxs)(`strong`,{children:[C(`galleryFilterResult`,{count:e}),` · `,C(`galleryFiltersRealtime`)]})]}),(0,H.jsx)(`div`,{className:`ue-filter-menu-head-actions`,children:t?(0,H.jsxs)(`button`,{className:`ue-filter-reset-btn`,onClick:k,"aria-label":C(`filterReset`),title:C(`filterReset`),type:`button`,children:[(0,H.jsx)(N,{size:13}),(0,H.jsx)(`span`,{children:C(`filterReset`)})]}):null})]}),(0,H.jsxs)(`div`,{className:`ue-filter-menu-body`,children:[(0,H.jsx)(`p`,{className:`ue-qol-note`,children:C(`qolFilterHint`)}),u!==`created_at`||d!==`desc`?(0,H.jsx)(`button`,{type:`button`,className:`ue-filter-link`,onClick:()=>{b(`created_at`),x(`desc`),S(1)},children:C(`qolResetSort`)}):null,(0,H.jsxs)(`section`,{className:`ue-filter-section ue-filter-section--summary`,children:[(0,H.jsx)(`div`,{className:`ue-filter-section-head`,children:(0,H.jsx)(`span`,{children:C(`galleryActiveFilters`)})}),(0,H.jsx)(`div`,{className:`ue-active-filter-row`,children:A.length?A.map(e=>(0,H.jsxs)(`button`,{className:`ue-active-filter-chip`,onClick:e.onClear,type:`button`,title:`${e.label} · ${C(`filterReset`)}`,children:[e.color?(0,H.jsx)(`span`,{className:`ue-active-filter-dot`,style:{background:e.color}}):null,(0,H.jsx)(`span`,{children:e.label}),(0,H.jsx)(`span`,{"aria-hidden":`true`,children:`×`})]},e.key)):(0,H.jsx)(`span`,{className:`ue-active-filter-empty`,children:C(`galleryFilterNone`)})})]}),(0,H.jsxs)(`section`,{className:`ue-filter-section`,children:[(0,H.jsxs)(`div`,{className:`ue-filter-section-head`,children:[(0,H.jsx)(`span`,{children:C(`galleryCategory`)}),r.length>8?(0,H.jsx)(`button`,{className:`ue-filter-link`,onClick:m,type:`button`,children:C(`galleryMoreCategories`)}):null]}),(0,H.jsxs)(`div`,{className:`ue-filter-chip-grid`,children:[(0,H.jsx)(`button`,{className:`ue-filter-chip ${i===``?`active`:``}`,onClick:()=>{h(``),S(1)},type:`button`,children:C(`galleryAllCategories`)}),ne.map(e=>(0,H.jsx)(`button`,{className:`ue-filter-chip ${i===e?`active`:``}`,onClick:()=>{h(e),S(1)},type:`button`,children:e},e))]})]}),(0,H.jsxs)(`section`,{className:`ue-filter-section`,children:[(0,H.jsx)(`div`,{className:`ue-filter-section-head`,children:(0,H.jsx)(`span`,{children:C(`gallerySort`)})}),(0,H.jsxs)(`div`,{className:`ue-filter-sort-row`,children:[(0,H.jsx)(`div`,{className:`ue-sort-segment`,role:`group`,"aria-label":C(`gallerySort`),children:q.map(e=>(0,H.jsx)(`button`,{className:u===e.value?`active`:``,onClick:()=>{b(e.value),S(1)},type:`button`,title:C(e.hintKey),children:C(e.labelKey)},e.value))}),(0,H.jsx)(`div`,{className:`ue-sort-direction`,children:cr.map(e=>(0,H.jsxs)(`button`,{className:d===e.value?`active`:``,onClick:()=>{x(e.value),S(1)},type:`button`,children:[(0,H.jsx)(`strong`,{children:C(e.labelKey)}),(0,H.jsx)(`span`,{children:C(e.hintKey)})]},e.value))})]}),(0,H.jsxs)(`p`,{className:`ue-sort-current`,children:[C(D.hintKey),` · `,C(te.hintKey)]})]}),(0,H.jsxs)(`section`,{className:`ue-filter-section`,children:[(0,H.jsxs)(`div`,{className:`ue-filter-section-head ue-filter-section-head--inline`,children:[(0,H.jsx)(`span`,{children:C(`galleryColorFamily`)}),(0,H.jsx)(`em`,{children:C(`galleryColorThreshold`)})]}),(0,H.jsxs)(`div`,{className:`ue-color-palette-grid`,children:[(0,H.jsxs)(`button`,{className:`ue-color-palette ${c===``?`active`:``}`,onClick:()=>{y(``),S(1)},type:`button`,children:[(0,H.jsx)(`span`,{className:`ue-color-palette-swatch ue-color-swatch--all`}),(0,H.jsx)(`em`,{children:C(`galleryAllColors`).replace(/色系$/,``).replace(/ colors$/i,``)})]}),sr.map(e=>(0,H.jsxs)(`button`,{className:`ue-color-palette ${c===e.value?`active`:``}`,onClick:()=>{y(e.value),S(1)},type:`button`,title:re(e.value),children:[(0,H.jsx)(`span`,{className:`ue-color-palette-swatch`,style:{background:e.color}}),(0,H.jsx)(`em`,{children:O(e.value)})]},e.value))]}),l&&!l.complete?(0,H.jsxs)(`p`,{className:`ue-color-index-note`,children:[C(`galleryColorIndexing`),` `,l.indexed,`/`,l.total]}):null]}),(0,H.jsxs)(`section`,{className:`ue-filter-section`,children:[(0,H.jsx)(`div`,{className:`ue-filter-section-head`,children:(0,H.jsx)(`span`,{children:C(`galleryDateRange`)})}),(0,H.jsxs)(`div`,{className:`ue-filter-menu-grid ue-filter-menu-grid--date`,children:[(0,H.jsxs)(`label`,{className:`ue-select-field ue-select-field--input ue-date-filter-field`,children:[(0,H.jsx)(`span`,{children:C(`galleryDateFrom`)}),(0,H.jsx)(`input`,{type:`date`,value:a,max:o||void 0,onChange:e=>{g(e.target.value),S(1)}})]}),(0,H.jsxs)(`label`,{className:`ue-select-field ue-select-field--input ue-date-filter-field`,children:[(0,H.jsx)(`span`,{children:C(`galleryDateTo`)}),(0,H.jsx)(`input`,{type:`date`,value:o,min:a||void 0,onChange:e=>{_(e.target.value),S(1)}})]}),(0,H.jsxs)(`button`,{className:`ue-filter-option ${s?`active`:``}`,onClick:()=>{v(!s),S(1)},type:`button`,children:[(0,H.jsx)(Ae,{size:14,fill:s?`currentColor`:`none`}),(0,H.jsx)(`span`,{children:C(`galleryPinnedOnly`)}),(0,H.jsx)(F,{size:14})]})]})]})]}),(0,H.jsxs)(`div`,{className:`ue-filter-menu-foot`,children:[(0,H.jsx)(`span`,{children:C(`galleryFilterStickyHint`)}),(0,H.jsx)(`button`,{type:`button`,onClick:ee,children:C(`galleryFilterClose`)})]})]})},pr=({isTrashView:e,selectedBoard:t,selectedSubfolder:r,total:i,trashCount:a,favoritesOnly:o,isRefreshing:s,hasPendingLiveRefresh:c,activeFilterControlCount:l,showFiltersMenu:u,showColumnsMenu:d,galleryViewMode:f,gridColumns:m,effectiveColumns:h,isMobile:g=!1,mobileDensity:_=`single`,onMobileDensityChange:y,dualFolderMode:b,variantMode:x=!1,selectionMode:S,writableSources:C,sources:w,importSubfolder:T,activeImportSourceId:E,categories:D,selectedCategory:te,dateFrom:ne,dateTo:re,selectedColorFamily:O,colorIndexStatus:A,sortBy:ie,sortOrder:j,searchValue:M=``,onSearchChange:N,onImageSearch:F,onApplyPendingLiveRefresh:ae,onToggleFiltersMenu:I,onCloseFiltersMenu:L,onToggleColumnsMenu:R,onCloseColumnsMenu:oe,onOpenCategoryPicker:se,onGalleryViewModeChange:ce,onGridColumnsChange:le,onDualFolderModeChange:ue,onVariantModeChange:de,onSelectionModeChange:fe,onImportTargetSourceIdChange:pe,onShareBoard:he,onDeleteBoard:ge,onClearSelection:_e,onCategoryChange:ve,onDateFromChange:ye,onDateToChange:be,onFavoritesOnlyChange:xe,onColorFamilyChange:Ce,onSortByChange:we,onSortOrderChange:Te,onPageChange:De,onFolderNavigate:Oe})=>{let{t:z}=n(),je=(0,p.useRef)(null),Me=(0,p.useRef)(!1),[Fe,B]=(0,p.useState)(M);(0,p.useEffect)(()=>{Me.current||B(M)},[M]);let Re=e?a:i,{sourceId:Ve,relativePath:He}=wt(r),Ue=w.find(e=>e.id===Ve)?.name||(Ve===`default_output`?z(`galleryOutputFolder`):Ve),U=He?`${Ue} / ${He}`:Ue;(0,p.useEffect)(()=>{let e=e=>{document.querySelector(`[aria-modal="true"]`)||((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`k`||e.key===`/`&&!v(e.target))&&(e.preventDefault(),je.current?.focus())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let We=!!(M.trim()||te||O||ne||re||o),Ge=()=>{N?.(``),ve(``),Ce(``),ye(``),be(``),xe(!1),De(1)},Ke=(0,H.jsxs)(`div`,{className:`ue-segmented-control ue-segmented-control--compact ue-view-toggle`,"aria-label":z(`viewMode`),children:[(0,H.jsxs)(`button`,{className:f===`grid`?`active`:``,onClick:()=>ce(`grid`),"aria-pressed":f===`grid`,type:`button`,"aria-label":z(`viewGrid`),title:z(`viewGrid`),children:[(0,H.jsx)(Se,{size:13}),(0,H.jsx)(`span`,{children:z(`viewGrid`)})]}),(0,H.jsxs)(`button`,{className:f===`list`?`active`:``,onClick:()=>ce(`list`),"aria-pressed":f===`list`,type:`button`,"aria-label":z(`viewList`),title:z(`viewList`),children:[(0,H.jsx)(Ee,{size:13}),(0,H.jsx)(`span`,{children:z(`viewList`)})]})]});return(0,H.jsxs)(`div`,{className:`ue-filter-bar ue-filter-bar--gallery ${b?`is-organizer`:x?`is-variants`:``}`,"data-tour-id":`gallery-toolbar`,children:[(0,H.jsxs)(`div`,{className:`ue-filter-copy`,children:[(0,H.jsx)(`p`,{className:`ue-filter-kicker`,children:e?z(`trashTitle`):b?z(`dual_title`):t?t.name:o?z(`galleryPinnedOnly`):U}),!e&&He&&Oe&&(0,H.jsxs)(`nav`,{className:`ue-gallery-breadcrumbs`,"aria-label":z(`galleryFolderPath`),children:[(0,H.jsx)(`button`,{onClick:()=>Oe(`${Ve}::`),children:Ue}),He.split(`/`).filter(Boolean).map((e,t,n)=>(0,H.jsxs)(`span`,{children:[` / `,(0,H.jsx)(`button`,{title:e,onClick:()=>Oe(`${Ve}::${n.slice(0,t+1).join(`/`)}`),children:e})]},t))]}),(0,H.jsxs)(`div`,{className:`ue-filter-summary`,children:[(0,H.jsx)(`strong`,{children:Re}),(0,H.jsx)(`span`,{children:z(e?`trashItemCount`:`galleryFilterResult`,{count:Re})}),o?(0,H.jsx)(`em`,{children:z(`galleryPinnedOnly`)}):null,t?(0,H.jsx)(`em`,{children:z(`sidebarBoards`)}):null,s?(0,H.jsx)(`em`,{children:z(`commonLoading`)}):null,c&&!e?(0,H.jsxs)(`button`,{className:`ue-live-refresh-pill`,type:`button`,onClick:ae,title:z(`galleryLiveRefreshAction`),children:[(0,H.jsx)(Ne,{size:12}),(0,H.jsx)(`span`,{children:z(`galleryLiveRefreshPending`)})]}):null]})]}),e?(0,H.jsx)(`div`,{className:`ue-filter-controls ue-filter-controls--gallery`,children:Ke}):(0,H.jsxs)(H.Fragment,{children:[N?(0,H.jsxs)(`div`,{className:`ue-gallery-search-box`,"data-tour-id":`gallery-search`,children:[(0,H.jsx)(Pe,{size:14,className:`ue-gallery-search-icon`}),(0,H.jsx)(`input`,{ref:je,className:`ue-gallery-search-input`,value:Fe,onCompositionStart:()=>{Me.current=!0},onCompositionEnd:e=>{Me.current=!1,B(e.currentTarget.value),N(e.currentTarget.value)},onChange:e=>{B(e.target.value),!Me.current&&!e.nativeEvent.isComposing&&N(e.target.value)},placeholder:z(`navSearchGalleryPlaceholder`),"aria-label":z(`navSearchGalleryPlaceholder`)}),M?(0,H.jsx)(`button`,{className:`ue-gallery-search-clear`,onClick:()=>{B(``),N(``)},type:`button`,"aria-label":z(`sidebarClearFolderSearch`),children:(0,H.jsx)(V,{size:12})}):(0,H.jsx)(`span`,{className:`ue-gallery-search-shortcut`,children:`/`})]}):null,F?(0,H.jsxs)(`button`,{type:`button`,className:`ue-filter-trigger`,onClick:e=>{e.stopPropagation(),F()},title:z(`imageSearchPaste`),children:[(0,H.jsx)(me,{size:15}),(0,H.jsx)(`span`,{children:z(`imageSearchTitle`)})]}):null,(0,H.jsxs)(`div`,{className:`ue-filter-controls ue-filter-controls--gallery`,children:[(0,H.jsxs)(`div`,{className:`ue-toolbar-group ue-toolbar-group--browse`,children:[(0,H.jsxs)(`div`,{className:`ue-filter-popover`,children:[(0,H.jsxs)(`button`,{className:`ue-filter-trigger ${u?`is-open`:``} ${l?`active`:``}`,"data-tour-id":`gallery-filters`,onClick:e=>{e.stopPropagation(),I()},type:`button`,"aria-expanded":u,"aria-label":z(`galleryFilters`),title:z(`galleryFilters`),children:[(0,H.jsx)(Le,{size:14}),(0,H.jsx)(`span`,{children:z(`galleryFilters`)}),l?(0,H.jsx)(`strong`,{children:l}):null]}),u?(0,H.jsx)(fr,{total:i,activeFilterControlCount:l,categories:D,selectedCategory:te,dateFrom:ne,dateTo:re,favoritesOnly:o,selectedColorFamily:O,colorIndexStatus:A,sortBy:ie,sortOrder:j,onClose:L,onOpenCategoryPicker:se,onCategoryChange:ve,onDateFromChange:ye,onDateToChange:be,onFavoritesOnlyChange:xe,onColorFamilyChange:Ce,onSortByChange:we,onSortOrderChange:Te,onPageChange:De}):null]}),Ke,f===`grid`?(0,H.jsx)(or,{value:m,effectiveColumns:h,isMobile:g,mobilePreset:_,onMobilePresetChange:y,onListView:()=>{ce(`list`),oe()},open:d,onToggle:R,onClose:oe,onChange:le}):null]}),(0,H.jsxs)(`button`,{className:`ue-chip-toggle ue-chip-toggle--icon ${S?`active`:``}`,"data-tour-id":`gallery-selection`,"aria-pressed":S,title:z(`bulkSelectionHint`),"aria-label":z(`bulkSelectMode`),onClick:()=>{fe(!S),_e()},type:`button`,children:[(0,H.jsx)(k,{size:15}),(0,H.jsx)(`span`,{children:z(`bulkSelectMode`)})]}),(0,H.jsxs)(`label`,{className:`ue-select-field ue-select-field--compact ue-gallery-mode-control`,children:[(0,H.jsx)(`span`,{children:z(`galleryMode`)}),(0,H.jsxs)(`select`,{"aria-label":z(`galleryMode`),value:b?`organize`:x?`variants`:`browse`,onChange:e=>{ue(e.target.value===`organize`),de?.(e.target.value===`variants`),_e()},children:[(0,H.jsx)(`option`,{value:`browse`,children:z(`galleryModeBrowse`)}),(0,H.jsx)(`option`,{value:`organize`,children:z(`organizeFolders`)}),(0,H.jsx)(`option`,{value:`variants`,children:z(`variantToolbar`)})]})]}),(0,H.jsxs)(ar,{label:z(`moreActions`),icon:(0,H.jsx)(ee,{size:18}),className:`ue-toolbar-more`,children:[(0,H.jsx)(`div`,{className:`ue-toolbar-group ue-toolbar-group--state`,children:t?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`button`,{className:`ue-chip-toggle ue-chip-toggle--icon`,onClick:()=>he(t.id),"aria-label":z(`boardShareTitle`),title:z(`boardShareTitle`),type:`button`,children:[(0,H.jsx)(Ie,{size:15}),(0,H.jsx)(`span`,{children:z(`boardShareTitle`)})]}),(0,H.jsxs)(`button`,{className:`ue-chip-toggle ue-chip-toggle--icon`,onClick:ge,"aria-label":z(`boardDeleteTitle`),title:z(`boardDeleteTitle`),type:`button`,children:[(0,H.jsx)(Be,{size:15}),(0,H.jsx)(`span`,{children:z(`boardDeleteTitle`)})]})]}):null}),C.length>0?(0,H.jsx)(`div`,{className:`ue-toolbar-group ue-toolbar-group--source`,children:(0,H.jsx)(`label`,{className:`ue-select-field ue-select-field--compact`,title:z(`galleryImportTarget`),children:(0,H.jsx)(`select`,{value:E,onChange:e=>pe(e.target.value),"aria-label":z(`galleryImportTarget`),children:C.map(e=>(0,H.jsxs)(`option`,{value:e.id,children:[e.name,` / `,T,`/`]},e.id))})})}):null]})]}),We?(0,H.jsxs)(`div`,{className:`ue-active-filters-row`,children:[M?(0,H.jsxs)(`div`,{className:`ue-filter-active-chip`,children:[(0,H.jsx)(Pe,{size:11}),(0,H.jsxs)(`span`,{children:[`"`,M,`"`]}),(0,H.jsx)(`button`,{onClick:()=>N?.(``),type:`button`,"aria-label":z(`clearSearch`),children:(0,H.jsx)(V,{size:10})})]}):null,te?(0,H.jsxs)(`div`,{className:`ue-filter-active-chip`,children:[(0,H.jsx)(ze,{size:11}),(0,H.jsx)(`span`,{children:te}),(0,H.jsx)(`button`,{onClick:()=>ve(``),type:`button`,"aria-label":z(`clearCategory`),children:(0,H.jsx)(V,{size:10})})]}):null,O?(0,H.jsxs)(`div`,{className:`ue-filter-active-chip`,children:[(0,H.jsx)(ke,{size:11}),(0,H.jsx)(`span`,{children:O}),(0,H.jsx)(`button`,{onClick:()=>Ce(``),type:`button`,"aria-label":z(`clearColor`),children:(0,H.jsx)(V,{size:10})})]}):null,ne||re?(0,H.jsxs)(`div`,{className:`ue-filter-active-chip`,children:[(0,H.jsx)(P,{size:11}),(0,H.jsxs)(`span`,{children:[ne||`...`,` ~ `,re||`...`]}),(0,H.jsx)(`button`,{onClick:()=>{ye(``),be(``)},type:`button`,"aria-label":z(`clearDate`),children:(0,H.jsx)(V,{size:10})})]}):null,o?(0,H.jsxs)(`div`,{className:`ue-filter-active-chip`,children:[(0,H.jsx)(Ae,{size:11}),(0,H.jsx)(`span`,{children:z(`galleryPinnedOnly`)}),(0,H.jsx)(`button`,{onClick:()=>xe(!1),type:`button`,"aria-label":z(`clearPinned`),children:(0,H.jsx)(V,{size:10})})]}):null,(0,H.jsx)(`button`,{className:`ue-filter-clear-all-btn`,onClick:Ge,type:`button`,children:z(`filterReset`)})]}):null]})]})},mr=({busy:e=!1,trashItems:t,selectedCount:r,selectedTrashCount:i,hasSelection:a,pageSelectedPaths:o,galleryViewMode:s,selectionEnabled:c,selectionBox:l,isDraggingSelectionRef:u,cardRefs:d,gridRef:f,onSelectAllVisible:p,onClearSelection:m,onRestoreSelectedTrash:h,onPurgeSelectedTrash:g,onRestoreTrashItem:_,onPurgeTrashItem:v,onTrashContextMenu:y,onImageSelectionClick:b,onSelectionPointerDown:x,onSelectionPointerMove:S,onSelectionPointerEnd:C})=>{let{t:w,locale:T}=n();return t.length===0?(0,H.jsxs)(`div`,{className:`ue-gallery-state ue-gallery-state--empty`,children:[(0,H.jsx)(Be,{size:44,strokeWidth:1.2}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`h3`,{children:w(`trashEmptyTitle`)}),(0,H.jsx)(`p`,{children:w(`trashEmptyText`)})]})]}):(0,H.jsxs)(`div`,{className:`ue-trash-workspace`,children:[(0,H.jsxs)(`div`,{className:`ue-trash-toolbar`,children:[(0,H.jsxs)(`div`,{className:`ue-trash-toolbar-copy`,children:[(0,H.jsx)(`strong`,{children:w(`bulkSelected`,{count:r})}),(0,H.jsx)(`span`,{children:w(`trashSelectionHint`)})]}),(0,H.jsxs)(`div`,{className:`ue-trash-toolbar-actions`,children:[(0,H.jsxs)(`button`,{className:`ue-secondary-btn`,onClick:p,children:[(0,H.jsx)(k,{size:14}),(0,H.jsx)(`span`,{children:w(`trashSelectAll`)})]}),(0,H.jsxs)(`button`,{className:`ue-secondary-btn`,onClick:m,disabled:!a,children:[(0,H.jsx)(Re,{size:14}),(0,H.jsx)(`span`,{children:w(`trashClearSelection`)})]}),(0,H.jsxs)(`button`,{className:`ue-secondary-btn ue-secondary-btn--accent`,onClick:h,disabled:e||!i,children:[(0,H.jsx)(Ne,{size:14}),(0,H.jsx)(`span`,{children:w(`trashRestoreSelected`)})]}),(0,H.jsxs)(`button`,{className:`ue-secondary-btn ue-secondary-btn--danger`,onClick:g,disabled:e||!i,children:[(0,H.jsx)(Be,{size:14}),(0,H.jsx)(`span`,{children:w(`trashDeleteSelectedForever`)})]})]})]}),(0,H.jsxs)(`div`,{ref:f,className:`ue-trash-list ue-trash-list--selectable ${s===`grid`?`ue-trash-list--grid`:``}`,onPointerDown:x,onPointerMove:S,onPointerUp:C,onPointerCancel:C,children:[t.map(t=>{let n=o.includes(t.id),r=t.kind===`folder`?w(`trashKindFolder`):t.kind===`library`?w(`trashKindLibrary`):w(`trashKindImage`);return(0,H.jsxs)(`article`,{ref:e=>{d.current[t.id]=e},className:`ue-trash-card ${n?`is-selected`:``}`,onContextMenu:e=>y(e,t),onClick:e=>{u.current||b(t.id,e)},children:[(0,H.jsx)(`button`,{className:`ue-trash-card-check ${n?`active`:``}`,onClick:e=>{e.stopPropagation(),b(t.id,e)},"aria-label":w(n?`galleryDeselectImage`:`gallerySelectImage`),title:w(n?`galleryDeselectImage`:`gallerySelectImage`),children:n?(0,H.jsx)(k,{size:14}):(0,H.jsx)(Re,{size:14})}),(0,H.jsxs)(`div`,{className:`ue-trash-card-main`,children:[t.kind===`image`&&t.thumb_url?(0,H.jsx)(`img`,{src:t.thumb_url,alt:t.name}):(0,H.jsx)(`div`,{className:`ue-trash-card-icon`,children:t.kind===`folder`?(0,H.jsx)(ge,{size:22}):(0,H.jsx)(Be,{size:22})}),(0,H.jsxs)(`div`,{className:`ue-trash-card-copy`,children:[(0,H.jsxs)(`div`,{className:`ue-trash-card-title-row`,children:[(0,H.jsx)(`h4`,{children:t.name}),(0,H.jsx)(`span`,{children:r})]}),(0,H.jsx)(`p`,{title:t.original_path,children:t.original_path}),(0,H.jsxs)(`div`,{className:`ue-trash-card-meta`,children:[(0,H.jsx)(`span`,{children:Xt(t.deleted_at,T)}),t.image_count?(0,H.jsx)(`span`,{children:w(`trashImageCount`,{count:t.image_count})}):null]})]})]}),(0,H.jsxs)(`div`,{className:`ue-trash-card-actions`,children:[(0,H.jsx)(`button`,{className:`ue-icon-action`,disabled:e,onClick:e=>{e.stopPropagation(),_(t.id)},"aria-label":w(`trashRestore`),title:w(`trashRestore`),children:(0,H.jsx)(Ne,{size:14})}),(0,H.jsx)(`button`,{className:`ue-icon-action ue-icon-action--danger`,disabled:e,onClick:e=>{e.stopPropagation(),v(t.id)},"aria-label":w(`trashDeleteForever`),title:w(`trashDeleteForever`),children:(0,H.jsx)(Be,{size:14})})]})]},t.id)}),c&&l?(0,H.jsx)(`div`,{className:`ue-selection-box`,style:{left:Math.min(l.startX,l.currentX),top:Math.min(l.startY,l.currentY),width:Math.abs(l.currentX-l.startX),height:Math.abs(l.currentY-l.startY)}}):null]})]})},hr=(function(){let e=typeof document<`u`&&document.createElement(`link`).relList;return e&&e.supports&&e.supports(`modulepreload`)?`modulepreload`:`preload`})(),gr=function(e){return`/gallery/`+e},_r={},vr=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,new URL(`../../../src/node/plugins/importAnalysisBuild.ts`,import.meta.url)).href}r=o(t.map(t=>{if(t=gr(t,n),t=s(t),t in _r)return;_r[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:hr,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},yr=(0,p.lazy)(()=>vr(()=>import(`./DualFolderWorkspace-Dl7afjQz.js`).then(e=>({default:e.DualFolderWorkspace})),[])),br=(0,p.lazy)(()=>vr(()=>import(`./VariantGroupsView-BdO8HmPI.js`).then(e=>({default:e.VariantGroupsView})),[])),xr=(0,p.lazy)(()=>vr(()=>import(`./BoardShareModal-DrZ4X-PT.js`).then(e=>({default:e.BoardShareModal})),[])),Sr=(0,p.lazy)(()=>vr(()=>import(`./MetadataViewerModal-CEAQlgmV.js`).then(e=>({default:e.MetadataViewerModal})),[])),Cr=(0,p.lazy)(()=>vr(()=>import(`./ImageSearchModal-DZp0PXl_.js`).then(e=>({default:e.ImageSearchModal})),__vite__mapDeps([0]))),wr=72,Tr=30,Er=`universal-extractor:gallery-view-mode`,Dr=`universal-extractor:mobile-density`,Or=({images:e,context:t,total:r,page:i,totalPages:a,selectedCategory:o,selectedSubfolder:s,selectedBoardId:c,dateFrom:l,dateTo:u,favoritesOnly:d,selectedColorFamily:f,colorIndexStatus:m,sortBy:h,sortOrder:g,gridColumns:_,selectedImagePaths:y,trashItems:b,isTrashView:w,importMessage:T,importFolderRef:ee,onOpenImportFolder:D,isLoading:ne,isRefreshing:re,hasPendingLiveRefresh:O,error:A,boards:ie,defaultSelectionMode:j,enableImagePrefetch:M,interfaceDensity:N=`standard`,imageDetailOpen:P=!1,onSelectionDragChange:F,onSelectionModeActiveChange:ae,onOpenDetail:I,onVisibleImagesChange:L,inspectorClearSignal:oe,onPageChange:ce,onCategoryChange:ue,onBoardChange:de,onDateFromChange:fe,onDateToChange:me,onFavoritesOnlyChange:he,onColorFamilyChange:_e,onSortByChange:ve,onSortOrderChange:be,onGridColumnsChange:xe,onOpenWorkflow:Se,onApplyLoraStack:Ce,onSelectionChange:we,onUpdateImageState:Te,onCreateBoard:Ee,onUpdateBoardPins:De,onDeleteBoard:Oe,onDeleteImages:ke,onMoveImages:z,onImportFiles:je,onApplyPendingLiveRefresh:Me,onOpenSettings:Pe,searchValue:B,onSearchChange:Ie,onRestoreTrashItem:Le,onRestoreTrashItems:Ve,onPurgeTrashItem:He,onPurgeTrashItems:V,trashBusy:Ue=!1})=>{let{t:U}=n(),We=tt(N),Ge=We.gap,{confirm:Ke}=_t(),{pushToast:qe}=qt(),{runOperation:Ye,notify:Xe}=Je(),[W,Qe]=(0,p.useState)(!1),[$e,it]=(0,p.useState)(``),[at,ot]=(0,p.useState)([]),[st,ct]=(0,p.useState)(``),[dt,ht]=(0,p.useState)(!1),[gt,vt]=(0,p.useState)(()=>window.innerWidth),[K,yt]=(0,p.useState)(null),[bt,xt]=(0,p.useState)(null),[St,Ct]=(0,p.useState)(!1),[Tt,Et]=(0,p.useState)(!1),[Dt,Ot]=(0,p.useState)(null),[kt,At]=(0,p.useState)(j),[jt,Mt]=(0,p.useState)(null),[Nt,Pt]=(0,p.useState)(()=>lr(Er,`grid`)),[Ft,It]=(0,p.useState)(()=>pt(Dr)===`double`?`double`:`single`),[Lt,Rt]=(0,p.useState)(!1),[zt,Bt]=(0,p.useState)(!1),[Vt,Ht]=(0,p.useState)(!1),[Ut,Wt]=(0,p.useState)(null),[Gt,Kt]=(0,p.useState)(!1),[Yt,Xt]=(0,p.useState)(null),[Zt,Qt]=(0,p.useState)(null),$t=(0,p.useRef)(null),en=(0,p.useRef)(null),rn=(0,p.useCallback)(()=>{en.current?.abort(),Ht(!1),Wt(null),Kt(!1),$t.current=null},[]);(0,p.useEffect)(()=>()=>en.current?.abort(),[]),(0,p.useEffect)(()=>{if(w)return;let e=e=>{if(v(e.target)||document.querySelector(`[aria-modal="true"]`))return;let t=[...e.clipboardData?.files??[]].find(e=>e.type.startsWith(`image/`));t&&(e.preventDefault(),Wt(t),Kt(!1),Ht(!0))};return window.addEventListener(`paste`,e),()=>window.removeEventListener(`paste`,e)},[w]);let[on,ln]=(0,p.useState)(``),{begin:un,invalidate:dn}=nt(),[fn,pn]=(0,p.useState)([]),[mn,hn]=(0,p.useState)(null),[gn,_n]=(0,p.useState)(!1),[vn,yn]=(0,p.useState)(``),[bn,Sn]=(0,p.useState)(null),[Cn,wn]=(0,p.useState)([]),[Tn,En]=(0,p.useState)(0),[Dn,On]=(0,p.useState)(1),[kn,An]=(0,p.useState)(!1),[jn,Mn]=(0,p.useState)(0),[Nn,Pn]=(0,p.useState)(0),[Fn,In]=(0,p.useState)(0),[Ln,Rn]=(0,p.useState)(null),zn=(0,p.useRef)(0),Bn=(0,p.useRef)(null),Vn=(0,p.useRef)(null),Hn=(0,p.useRef)({}),Un=(0,p.useRef)(!1),Wn=(0,p.useRef)(null),Gn=(0,p.useRef)([]),Kn=(0,p.useRef)([]),qn=(0,p.useRef)({}),Jn=(0,p.useRef)(0),Yn=(0,p.useRef)(!1),Xn=(0,p.useRef)(null),Zn=zt&&bn?Cn:e;(0,p.useEffect)(()=>{Lt||L?.(w||zt&&!bn?[]:Zn)},[Zn,Lt,w,L,bn,zt]);let Qn=(0,p.useCallback)(e=>I(e,Zn),[Zn,I]),$n=zt&&bn?Dn:i,er=zt&&bn?Tn:r,tr=zt&&bn?Math.max(1,Math.ceil(Tn/60)):a,rr=(0,p.useMemo)(()=>zt&&!bn?[]:Zn.map(e=>e.relative_path),[Zn,bn,zt]),ar=(0,p.useMemo)(()=>new Map(Zn.map((e,t)=>[e.relative_path,t])),[Zn]),or=(0,p.useMemo)(()=>w?b.map(e=>e.id):rr,[w,b,rr]),sr=(0,p.useMemo)(()=>new Set(y),[y]),q=(0,p.useMemo)(()=>or.filter(e=>sr.has(e)),[sr,or]),cr=q.length,dr=cr>0,fr=!!jt;(0,p.useEffect)(()=>(F?.(fr),()=>F?.(!1)),[fr,F]);let hr=!Lt,gr=!w&&(Lt?y.length>0:kt||cr>0),_r=(0,p.useMemo)(()=>w?b.filter(e=>sr.has(e.id)):[],[w,sr,b]),vr=ur({selectedCategory:o,dateFrom:l,dateTo:u,favoritesOnly:d,selectedColorFamily:f,sortBy:h,sortOrder:g}),Or=(0,p.useMemo)(()=>ie.find(e=>e.id===c)??null,[ie,c]),kr=(0,p.useMemo)(()=>ie.find(e=>e.id===st)??null,[ie,st]),Ar=(0,p.useMemo)(()=>(t?.sources??[]).filter(e=>e.enabled&&e.exists&&e.writable),[t?.sources]),jr=Ar.some(e=>e.id===$e)&&$e||Ar.find(e=>e.import_target)?.id||Ar[0]?.id||``;(0,p.useEffect)(()=>{jr&&jr!==$e&&it(jr)},[jr,$e]),(0,p.useEffect)(()=>{let e=()=>vt(window.innerWidth);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,p.useEffect)(()=>{mt(Er,Nt)},[Nt]),(0,p.useEffect)(()=>{mt(Dr,Ft)},[Ft]);let Mr=(0,p.useCallback)(()=>{yt(null),xt(null)},[]);C(!!(K||bt),Mr,{closeOnContextMenu:!0,closeOnScroll:!0}),(0,p.useEffect)(()=>{if(!Tt)return;let e=()=>Et(!1);return window.addEventListener(`click`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`click`,e),window.removeEventListener(`resize`,e)}},[Tt]),(0,p.useEffect)(()=>{ae?.(gr)},[gr,ae]),(0,p.useEffect)(()=>{Lt||y.length===q.length&&y.every(e=>q.includes(e))||we(q)},[Lt,we,q,y]),(0,p.useEffect)(()=>{hr||(Mt(null),Un.current=!1,Gn.current=[],Kn.current=[],qn.current={},Jn.current=0,In(0),Yn.current=!1)},[hr]),(0,p.useEffect)(()=>()=>{Wn.current!==null&&window.clearTimeout(Wn.current)},[]),(0,p.useLayoutEffect)(()=>{let e=Bn.current?.closest(`.ue-main-shell`);if(Xn.current=e,Rn(e),!e)return;let t=()=>{An(e.scrollTop>320)};return t(),e.addEventListener(`scroll`,t,{passive:!0}),()=>e.removeEventListener(`scroll`,t)},[Lt,Nt,Zn.length,w,b.length]),(0,p.useLayoutEffect)(()=>{let e=Bn.current;if(Lt||!e){Mn(0);return}let t=()=>{let t=e.getBoundingClientRect();Mn(e=>Math.abs(e-t.width)>.5?t.width:e);let n=e.closest(`.ue-main-shell`),r=n?t.top-n.getBoundingClientRect().top+n.scrollTop-n.clientTop:0;Pn(e=>Math.abs(e-r)>.5?r:e)};if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),Vn.current&&n.observe(Vn.current),()=>n.disconnect()},[Lt,Nt,Zn.length,w,b.length]);let Nr=nr({images:Zn,requestedColumns:gt<=560?Ft===`double`?2:1:_,gridWidth:fr&&Fn>0?Fn:jn,viewportWidth:gt,scrollElement:Ln,gap:Ge,density:N,scrollMargin:Nn}),Pr=Nr.scrollToIndex;(0,p.useEffect)(()=>{if(!Yt||ne||!e.some(e=>e.relative_path===Yt.path))return;Pr(Yt.index,{align:`center`});let t=window.requestAnimationFrame(()=>Hn.current[Yt.path]?.scrollIntoView?.({block:`center`}));return()=>window.cancelAnimationFrame(t)},[Yt,ne,e,Pr]),(0,p.useEffect)(()=>{if(!Yt)return;let e=window.setTimeout(()=>Xt(null),5e3);return()=>window.clearTimeout(e)},[Yt]),(0,p.useEffect)(()=>{if(!Zt||ne||s!==Zt.folder||i!==Zt.page||(B||``)!==Zt.query)return;let e=window.requestAnimationFrame(()=>{let e=document.querySelector(`.ue-main-shell`);e&&(e.scrollTop=Zt.top),Qt(null)});return()=>window.cancelAnimationFrame(e)},[Zt,ne,s,i,B,e]);let Fr=Nr.columnCount,Ir=Nr.getItemLayout,Lr=(0,p.useCallback)(e=>{if(w||Nt!==`grid`)return null;let t=ar.get(e);if(t===void 0||!Bn.current)return null;let n=Ir(t);if(!n)return null;let r=Bn.current.getBoundingClientRect(),i=r.left+n.left,a=r.top+n.top;return{left:i,right:i+n.width,top:a,bottom:a+n.height}},[Nt,ar,w,Ir]);(0,p.useEffect)(()=>{if(!M||!Zn.length||w||typeof IntersectionObserver>`u`)return;let e=new Map(Zn.map((e,t)=>[e.relative_path,t])),t=Math.max(Fr*2,6),n=Bn.current?.closest(`.ue-main-shell`),r=new IntersectionObserver(n=>{n.forEach(n=>{if(!n.isIntersecting)return;let i=n.target.dataset.imagePath,a=i?e.get(i):void 0;if(a===void 0)return;let o=Math.min(Zn.length,a+t);for(let e=a;e{let t=Hn.current[e.relative_path];t&&(t.dataset.imagePath=e.relative_path,r.observe(t))}),()=>r.disconnect()},[Fr,M,Zn,w]),(0,p.useEffect)(()=>{At(j),!j&&!w&&we([])},[j,w,we]);let Rr=e=>Array.from(e.dataTransfer.types??[]).includes(`Files`)&&(e.dataTransfer.files?.length??0)>0,zr=e=>{Rr(e)&&(e.preventDefault(),zn.current+=1,Qe(!0))},Br=e=>{Rr(e)&&(e.preventDefault(),--zn.current,zn.current<=0&&(zn.current=0,Qe(!1)))},Vr=async e=>{if(!Rr(e))return;e.preventDefault(),zn.current=0,Qe(!1);let t=Array.from(e.dataTransfer.files??[]);t.length&&await je(t,jr)},{setSelection:Hr,handleImageSelectionClick:Ur,selectAllVisible:Wr,clearSelection:Gr,lastSelectedPathRef:Kr}=ut({visibleSelectionPaths:or,pageSelectedPaths:q,onSelectionChange:we}),qr=(0,p.useMemo)(()=>({search:``,category:o,subfolder:s,boardId:c,dateFrom:l,dateTo:u,favoritesOnly:d,colorFamily:f,sortBy:h,sortOrder:g}),[l,u,d,c,o,f,s,h,g]),Jr=(0,p.useCallback)(async(e=!1)=>{let t=un();_n(!0),yn(``);try{let n=await G.listVariantGroups({...qr,type:on,limit:120,forceRefresh:e},t.signal);if(!t.isCurrent())return;pn(n.groups),hn(n.fingerprint_status)}catch(e){t.isCurrent()&&yn(e instanceof Error?e.message:U(`variantEmptyText`))}finally{t.isCurrent()&&_n(!1)}},[U,qr,on,un]),Yr=(0,p.useCallback)(async(e,t=1)=>{let n=un();_n(!0),wn([]),Gr(),yn(``);try{let r=await G.getVariantGroupImages({...qr,groupId:e.id,type:e.type,page:t,limit:60},n.signal);if(!n.isCurrent())return;Sn(r.group??e),wn(r.images),En(r.total),On(r.page),Gr()}catch(e){n.isCurrent()&&yn(e instanceof Error?e.message:U(`variantEmptyText`))}finally{n.isCurrent()&&_n(!1)}},[Gr,U,qr,un]);(0,p.useEffect)(()=>{!zt||bn||w||Jr()},[w,Jr,bn,zt]),(0,p.useEffect)(()=>{if(!zt){dn(),_n(!1),Sn(null),wn([]);return}Sn(null),wn([]),Gr(),w||Jr()},[Gr,w,Jr,zt,qr,on,dn]),(0,p.useEffect)(()=>{let e=e=>{if(!(document.querySelector(`[aria-modal="true"]`)||v(e.target))&&((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`a`&&(e.preventDefault(),Wr()),e.key===`Escape`&&y.length&&(e.preventDefault(),Gr()),e.key===`Enter`&&kt&&y.length&&!w)){let t=Kr.current&&y.includes(Kr.current)?Kr.current:y[y.length-1],n=Zn.find(e=>e.relative_path===t);n&&(e.preventDefault(),Qn(n))}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[Zn,Gr,w,Qn,y,Wr,kt,Kr]);let Xr=async()=>{if(dr&&await Ke({title:U(`bulkDelete`),message:U(cr>=20?`bulkDeleteHeavyConfirm`:`bulkDeleteConfirm`,{count:cr}),tone:cr>=20?`danger`:`warning`,confirmLabel:U(`commonDelete`),cancelLabel:U(`libraryCancel`)}))try{await Ye(()=>ke(q),{pending:U(`operationDeleteImages`),success:e=>U(`operationDeleteImagesResult`,{count:e.deleted.length,missing:tn(q,e).failedPaths.length}),successTone:e=>tn(q,e).complete?`success`:`error`,successRetry:e=>et({paths:tn(q,e).failedPaths,confirm:Ke,confirmation:e=>({title:U(`bulkDelete`),message:U(`bulkDeleteConfirm`,{count:e}),tone:`warning`,confirmLabel:U(`commonDelete`),cancelLabel:U(`libraryCancel`)}),execute:ke,failed:(e,t)=>tn(e,t).failedPaths,summary:(e,t)=>U(`operationDeleteImagesResult`,{count:t.deleted.length,missing:tn(e,t).failedPaths.length}),run:Ye,pending:U(`operationDeleteImages`)}),successDetail:e=>{let{failedPaths:t}=tn(q,e);return t.length?U(`operationUnprocessedPaths`,{target:nn(t)}):``},error:e=>e instanceof Error?e.message:U(`imageDeleteError`)})}catch{}},Zr=async e=>{if(!at.length)return;let t=ie.find(t=>t.id===e);await Ke({title:U(`bulkAddToBoard`),message:U(`bulkAddToBoardConfirm`,{count:at.length,target:t?.name||e}),tone:`warning`,confirmLabel:U(`boardAddToAction`),cancelLabel:U(`libraryCancel`)})&&(await Ye(()=>De(e,at,!0),{pending:U(`operationAddToBoard`),success:U(`boardAddSuccess`,{count:at.length})}),ot([]))},Qr=async e=>{let t=!e.pinned;await Ke({title:U(t?`galleryPin`:`galleryUnpin`),message:U(t?`imagePinConfirm`:`imageUnpinConfirm`,{name:e.filename}),tone:`warning`,confirmLabel:U(t?`galleryPin`:`galleryUnpin`),cancelLabel:U(`libraryCancel`)})&&await Te(e.relative_path,{pinned:t})},$r=async(e,t)=>{if(Object.keys(t).length===1&&typeof t.pinned==`boolean`){let t=Zn.find(t=>t.relative_path===e);if(t){await Qr(t);return}}await Te(e,t)},ei=async()=>{Or&&await Ke({title:U(`boardDeleteTitle`),message:U(`boardDeleteConfirm`,{name:Or.name}),tone:`warning`,confirmLabel:U(`commonDelete`),cancelLabel:U(`libraryCancel`)})&&(await Ye(()=>Oe(Or.id),{pending:U(`operationDeleteBoard`),success:U(`boardDeleteSuccess`)}),de(``))},ti=async()=>{_r.length&&await Ke({title:U(`trashRestoreSelected`),message:U(`trashRestoreSelectedConfirm`,{count:_r.length}),tone:`warning`,confirmLabel:U(`trashRestore`),cancelLabel:U(`libraryCancel`)})&&(await Ve(_r.map(e=>e.id))||Gr())},ni=async()=>{_r.length&&await Ke({title:U(`trashDeleteSelectedForever`),message:U(`trashDeleteSelectedConfirm`,{count:_r.length}),tone:`danger`,confirmLabel:U(`trashDeleteForever`),cancelLabel:U(`libraryCancel`)})&&(await V(_r.map(e=>e.id))||Gr())},ri=e=>{e!==i&&(ce(e),(Xn.current||Vn.current?.closest(`.ue-main-shell`))?.scrollTo?.({top:0,behavior:`instant`}))},ii=e=>{let t=Number(e.get(`page`));Number.isFinite(t)&&ri(Math.min(Math.max(1,Math.trunc(t)),a))},ai=e=>new URL(e.original_url||e.url,window.location.origin).toString(),oi=(0,p.useCallback)(e=>{let t=w?b.map(e=>({key:e.id})):Zn.map(e=>({key:e.relative_path})),n=(Xn.current?.scrollTop??0)-Jn.current,r=lt({selectionBox:e,keys:t.map(e=>e.key),scrollDelta:n,getRect:e=>qn.current[e]??Hn.current[e]?.getBoundingClientRect()??Lr(e)});Mt(e=>e&&e.scrollDelta!==n?{...e,scrollDelta:n}:e),Hr(Yn.current?rt([...Gn.current,...r],or):r)},[Zn,Lr,w,Hr,b,or]),si=(0,p.useCallback)(e=>{!hr||e.button!==0||e.pointerType===`touch`||e.target.closest(`button, input, select, textarea, a, label, .ue-filter-bar`)||(Un.current=!1,Wn.current!==null&&(window.clearTimeout(Wn.current),Wn.current=null),Gn.current=q,Kn.current=[],qn.current=Object.fromEntries(or.map(e=>{let t=Hn.current[e]?.getBoundingClientRect()??Lr(e);return t?[e,t]:null}).filter(e=>e!==null)),In(Bn.current?.getBoundingClientRect().width||jn),Jn.current=Xn.current?.scrollTop??0,Yn.current=e.ctrlKey||e.metaKey,Mt({startX:e.clientX,startY:e.clientY,currentX:e.clientX,currentY:e.clientY}))},[Lr,jn,q,hr,or]),ci=(0,p.useCallback)(e=>{if(!hr||!jt)return;let t=Xn.current?.getBoundingClientRect(),n={...jt,currentX:t&&t.width>0?Math.max(t.left,Math.min(e.clientX,t.right)):e.clientX,currentY:t&&t.height>0?Math.max(Math.max(60,t.top),Math.min(e.clientY,Math.min(window.innerHeight,t.bottom))):e.clientY};(Math.abs(n.currentX-n.startX)>6||Math.abs(n.currentY-n.startY)>6)&&!Un.current&&(Un.current=!0,Xn.current?.setPointerCapture?.(e.pointerId)),Mt(n),Un.current&&oi(n)},[jt,hr,oi]),li=(0,p.useCallback)(e=>{if(jt){if(typeof e?.currentTarget.hasPointerCapture==`function`&&typeof e.currentTarget.releasePointerCapture==`function`&&e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),!Un.current){Mt(null),Gn.current=[],Kn.current=[],qn.current={},Jn.current=0,In(0),Yn.current=!1;return}Mt(null),Gn.current=[],Kn.current=[],qn.current={},Jn.current=0,In(0),Yn.current=!1,Wn.current=window.setTimeout(()=>{Un.current=!1,Wn.current=null},160)}},[jt]);(0,p.useEffect)(()=>{if(!Ln||!jt)return;let e=0,t=()=>{Un.current&&(e&&window.cancelAnimationFrame(e),e=window.requestAnimationFrame(()=>{e=0,oi(jt)}))};return Ln.addEventListener(`scroll`,t,{passive:!0}),()=>{e&&window.cancelAnimationFrame(e),Ln.removeEventListener(`scroll`,t)}},[Ln,jt,oi]),(0,p.useEffect)(()=>{if(!Ln||!jt)return;let e=0,t=()=>{if(e=window.requestAnimationFrame(t),!Un.current)return;let n=Ln.getBoundingClientRect(),r={top:Math.max(60,n.top),bottom:Math.min(window.innerHeight,n.bottom)},i=Math.max(0,Ln.scrollHeight-Ln.clientHeight);if(i<=0)return;let a=0;if(jt.currentY>r.bottom-wr){let e=wr-(r.bottom-jt.currentY);a=Math.ceil(Math.min(1,e/wr)*Tr)}else if(jt.currentYwindow.cancelAnimationFrame(e)},[Ln,jt,oi]),(0,p.useEffect)(()=>{if(!hr||!Ln)return;let e=e=>{let t=e.target;t instanceof Node&&Vn.current?.contains(t)||si(e)},t=e=>{ci(e)},n=e=>{li(e)},r=()=>{Un.current=!1,Mt(null),In(0),qn.current={},Gn.current=[],Kn.current=[],Yn.current=!1},i=e=>{e.key===`Escape`&&r()};return window.addEventListener(`blur`,r),window.addEventListener(`resize`,r),window.addEventListener(`keydown`,i,!0),Ln.addEventListener(`lostpointercapture`,r),Ln.addEventListener(`pointerdown`,e),Ln.addEventListener(`pointermove`,t),Ln.addEventListener(`pointerup`,n),Ln.addEventListener(`pointercancel`,n),()=>{window.removeEventListener(`blur`,r),window.removeEventListener(`resize`,r),window.removeEventListener(`keydown`,i,!0),Ln.removeEventListener(`lostpointercapture`,r),Ln.removeEventListener(`pointerdown`,e),Ln.removeEventListener(`pointermove`,t),Ln.removeEventListener(`pointerup`,n),Ln.removeEventListener(`pointercancel`,n)}},[si,li,ci,Ln,hr]);let ui=async(e,t)=>{try{await navigator.clipboard.writeText(e),qe(t,`success`)}catch(e){qe(e instanceof Error?e.message:U(`contextCopyError`),`error`)}},di=async e=>{try{if(!(`clipboard`in navigator)||typeof ClipboardItem>`u`){await ui(ai(e),U(`contextCopyImageLinkSuccess`));return}let t=await(await fetch(ai(e))).blob();if(!t.type.startsWith(`image/`))throw Error(U(`contextCopyImageError`));await navigator.clipboard.write([new ClipboardItem({[t.type]:t})]),qe(U(`contextCopyImageSuccess`),`success`)}catch(e){qe(e instanceof Error?e.message:U(`contextCopyImageError`),`error`)}},fi=async e=>{try{let t=an(await G.getImageMetadata(e.relative_path));if(!t){qe(U(`metadataNoPositivePrompt`),`info`);return}await ui(t,U(`metadataCopyPositiveSuccess`))}catch(e){qe(e instanceof Error?e.message:U(`metadataLoadError`),`error`)}},pi=async e=>{await Ke({title:U(`modalDeleteFile`),message:U(`imageDeleteConfirm`,{name:e.filename}),tone:`warning`,confirmLabel:U(`commonDelete`),cancelLabel:U(`libraryCancel`)})&&await Ye(()=>ke([e.relative_path]),{pending:U(`operationDeleteImage`),success:t=>tn([e.relative_path],t).complete?U(`imageDelete`):U(`imageDeleteMissing`),successTone:t=>tn([e.relative_path],t).complete?`success`:`error`,error:e=>e instanceof Error?e.message:U(`imageDeleteError`)}).catch(()=>void 0)},mi=(e,t)=>{e.preventDefault(),e.stopPropagation();let n=x(e,{width:292,height:356},`pointer`);yt({image:t,x:n.x,y:n.y})},hi=(e,t)=>{e.preventDefault(),e.stopPropagation();let n=x(e,{width:220,height:220},`pointer`);xt({item:t,x:n.x,y:n.y})},gi=()=>{Xn.current?.scrollTo({top:0,behavior:ft()})},_i=()=>{Ie?.(``),ue(``),_e(``),fe(``),me(``),he(!1),ri(1)},vi=s?wt(s).sourceId:``,yi=(t?.sources??[]).filter(e=>e.enabled&&e.exists),bi=vi?yi.some(e=>e.id===vi):yi.length>0,xi=!!(B?.trim()||o||f||l||u||d),Si=A?{title:U(`galleryEmptyErrorTitle`),description:A,actionLabel:U(`navRefresh`),onAction:Me}:bi?xi?{title:U(`galleryEmptyFilteredTitle`),description:U(`galleryEmptyFilteredText`),actionLabel:U(`filterReset`),onAction:_i}:{title:U(`galleryEmptySourceTitle`),description:U(`galleryEmptySourceText`)}:{title:U(`galleryEmptyNoSourceTitle`),description:U(`galleryEmptyNoSourceText`),actionLabel:Pe?U(`navSettings`):void 0,onAction:Pe};return(0,H.jsxs)(`div`,{className:`ue-drop-shell ${W?`is-dragging`:``}`,onDragEnter:zr,onDragLeave:Br,onDragOver:e=>e.preventDefault(),onDrop:Vr,children:[(0,H.jsxs)(`section`,{ref:Vn,"data-gallery-interacting":fr?`true`:void 0,style:{"--ue-gallery-gap":`${We.gap}px`,"--ue-card-body-height":`${We.bodyHeight}px`,"--ue-card-body-padding":`${We.padding}px`},className:`ue-workspace ue-workspace--gallery ue-animate-in`,onPointerDown:si,onPointerMove:ci,onPointerUp:li,onPointerCancel:li,children:[Gt&&(0,H.jsx)(`button`,{className:`ue-secondary-action ue-search-return`,onClick:e=>{e.stopPropagation(),$t.current?.(),$t.current=null,Kt(!1),Xt(null)},children:U(`imageSearchReturn`)}),(0,H.jsx)(pr,{onFolderNavigate:D,isTrashView:w,selectedBoard:Or,selectedSubfolder:s,total:r,trashCount:b.length,favoritesOnly:d,isRefreshing:re,hasPendingLiveRefresh:O,activeFilterControlCount:vr,showFiltersMenu:Tt,showColumnsMenu:St,galleryViewMode:Nt,gridColumns:_,effectiveColumns:Fr,isMobile:gt<=560,mobileDensity:Ft,onMobileDensityChange:It,dualFolderMode:Lt,variantMode:zt,selectionMode:kt,writableSources:Ar,sources:t?.sources??[],importSubfolder:t?.import_image_subfolder||`universal_gallery_imports`,activeImportSourceId:jr,categories:t?.categories??[],selectedCategory:o,dateFrom:l,dateTo:u,selectedColorFamily:f,colorIndexStatus:m,sortBy:h,sortOrder:g,searchValue:B,onSearchChange:Ie,onImageSearch:()=>{Wt(null),Kt(!1),Ht(!0)},onApplyPendingLiveRefresh:Me,onToggleFiltersMenu:()=>Et(e=>!e),onCloseFiltersMenu:()=>Et(!1),onToggleColumnsMenu:()=>Ct(e=>!e),onCloseColumnsMenu:()=>Ct(!1),onOpenCategoryPicker:()=>ht(!0),onGalleryViewModeChange:Pt,onGridColumnsChange:xe,onDualFolderModeChange:Rt,onVariantModeChange:Bt,onSelectionModeChange:At,onImportTargetSourceIdChange:it,onShareBoard:ct,onDeleteBoard:()=>void ei(),onClearSelection:Gr,onCategoryChange:ue,onDateFromChange:fe,onDateToChange:me,onFavoritesOnlyChange:he,onColorFamilyChange:_e,onSortByChange:ve,onSortOrderChange:be,onPageChange:ri}),T?(0,H.jsxs)(`div`,{className:`ue-inline-success`,role:`status`,children:[(0,H.jsx)(`span`,{children:T}),ee&&D?(0,H.jsx)(`button`,{type:`button`,className:`ue-secondary-action`,onClick:()=>{Rt(!1),Bt(!1),Gr(),D(ee)},children:U(`galleryOpenImportFolder`)}):null]}):null,A&&(e.length>0||w||Lt||zt)?(0,H.jsx)(`div`,{className:`ue-inline-error`,children:A}):null,(0,H.jsx)(p.Suspense,{fallback:(0,H.jsxs)(`div`,{className:`ue-gallery-state`,children:[(0,H.jsx)(`div`,{className:`ue-loading-orb`}),(0,H.jsx)(`p`,{children:U(`galleryLoading`)})]}),children:Lt&&!w?(0,H.jsx)(yr,{onExit:()=>{Rt(!1),Gr()},context:t,initialFolder:s,sortBy:h,sortOrder:g,boards:ie,onOpenDetail:I,onSelectionChange:we,onVisibleImagesChange:L,inspectorClearSignal:oe,onOpenWorkflow:Se,onMoveImages:z,onDeleteImages:ke,onUpdateImageState:$r,onCreateBoard:Ee,onUpdateBoardPins:De}):zt&&!w&&!bn?(0,H.jsx)(br,{onExit:()=>{Bt(!1),Gr()},groups:fn,selectedType:on,status:mn,loading:gn,error:vn,onTypeChange:ln,onRefresh:()=>void Jr(!0),onOpenGroup:e=>void Yr(e)}):zt&&!w&&bn?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`ue-variant-detail-head`,children:[(0,H.jsxs)(`button`,{className:`ue-secondary-action`,type:`button`,onClick:()=>{Sn(null),wn([]),Gr(),Jr()},children:[(0,H.jsx)(R,{size:15}),(0,H.jsx)(`span`,{children:U(`variantBackToGroups`)})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`span`,{children:U(`variantType_${bn.type}`)}),(0,H.jsx)(`strong`,{children:bn.title})]}),(0,H.jsxs)(`button`,{className:`ue-secondary-action`,type:`button`,onClick:()=>{let e=Cn[0]?.relative_path;we(Cn.map(e=>e.relative_path).filter(t=>t!==e)),At(!0)},children:[(0,H.jsx)(k,{size:15}),(0,H.jsx)(`span`,{children:U(`variantSelectRest`)})]})]}),gn&&Cn.length===0?(0,H.jsxs)(`div`,{className:`ue-gallery-state`,children:[(0,H.jsx)(`div`,{className:`ue-loading-orb`}),(0,H.jsx)(`p`,{children:U(`variantAnalyzing`)})]}):(0,H.jsx)(ir,{images:Zn,galleryViewMode:Nt,selectionMode:kt,selectionEnabled:hr,selectionBox:jt,pageSelectedPaths:q,page:$n,totalPages:tr,total:er,effectiveColumns:Fr,highlightPath:Yt?.path,masonryLayout:Nr,gridRef:Bn,cardRefs:Hn,isDraggingSelectionRef:Un,onOpenDetail:Qn,onOpenWorkflow:Se,onUpdateImageState:$r,onBoardPickerPathsChange:ot,onImageSelectionClick:Ur,onOpenContextMenu:mi,onSelectAllVisible:Wr,onPageChange:e=>void Yr(bn,e),onPageJump:e=>{let t=Number(e.get(`page`)||1);Yr(bn,Number.isFinite(t)?t:1)}})]}):ne&&e.length===0?(0,H.jsxs)(`div`,{className:`ue-gallery-state`,children:[(0,H.jsx)(`div`,{className:`ue-loading-orb`}),(0,H.jsx)(`p`,{children:U(`galleryLoading`)})]}):w?(0,H.jsx)(mr,{busy:Ue,trashItems:b,selectedCount:cr,selectedTrashCount:_r.length,hasSelection:dr,pageSelectedPaths:q,galleryViewMode:Nt,selectionEnabled:hr,selectionBox:jt,isDraggingSelectionRef:Un,cardRefs:Hn,gridRef:Bn,onSelectAllVisible:Wr,onClearSelection:Gr,onRestoreSelectedTrash:()=>void ti(),onPurgeSelectedTrash:()=>void ni(),onRestoreTrashItem:e=>void Le(e),onPurgeTrashItem:e=>void He(e),onTrashContextMenu:hi,onImageSelectionClick:Ur,onSelectionPointerDown:si,onSelectionPointerMove:ci,onSelectionPointerEnd:li}):(0,H.jsx)(ir,{images:Zn,emptyState:Si,galleryViewMode:Nt,selectionMode:kt,selectionEnabled:hr,selectionBox:jt,pageSelectedPaths:q,page:$n,totalPages:tr,total:er,effectiveColumns:Fr,highlightPath:Yt?.path,masonryLayout:Nr,gridRef:Bn,cardRefs:Hn,isDraggingSelectionRef:Un,onOpenDetail:Qn,onOpenWorkflow:Se,onUpdateImageState:$r,onBoardPickerPathsChange:ot,onImageSelectionClick:Ur,onOpenContextMenu:mi,onSelectAllVisible:Wr,onPageChange:ri,onPageJump:ii})})]}),W?(0,H.jsx)(`div`,{className:`ue-drop-overlay`,children:(0,H.jsxs)(`div`,{className:`ue-drop-overlay-card`,children:[(0,H.jsx)(`h3`,{children:U(`galleryDropTitle`)}),(0,H.jsx)(`p`,{children:U(`galleryDropText`)})]})}):null,(0,H.jsx)(cn,{open:dt,categories:t?.categories??[],selectedCategory:o,onClose:()=>ht(!1),onSelect:e=>{ue(e),ri(1)}}),(0,H.jsx)(sn,{open:at.length>0,boards:ie,selectedCount:at.length,onClose:()=>ot([]),onCreateBoard:Ee,onAddToBoard:Zr}),kr?(0,H.jsx)(p.Suspense,{fallback:null,children:(0,H.jsx)(xr,{open:!0,board:kr,onClose:()=>ct(``)})}):null,K?(0,H.jsx)(S,{children:(0,H.jsxs)(`div`,{className:`ue-context-menu ue-context-menu--gallery`,style:{top:K.y,left:K.x},onClick:e=>e.stopPropagation(),onContextMenu:e=>e.preventDefault(),children:[(0,H.jsxs)(`div`,{className:`ue-context-menu-head`,children:[(0,H.jsx)(`strong`,{title:K.image.filename,children:K.image.filename}),(0,H.jsx)(`span`,{children:Jt(K.image.size)})]}),(0,H.jsxs)(`div`,{className:`ue-context-menu-grid`,children:[(0,H.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>{Qn(K.image),yt(null)},children:[(0,H.jsx)(ye,{size:14}),(0,H.jsx)(`span`,{children:U(`galleryInspect`)})]}),(0,H.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>{Ur(K.image.relative_path,{ctrlKey:!0,metaKey:!1,shiftKey:!1}),yt(null)},children:[q.includes(K.image.relative_path)?(0,H.jsx)(k,{size:14}):(0,H.jsx)(Re,{size:14}),(0,H.jsx)(`span`,{children:q.includes(K.image.relative_path)?U(`galleryDeselectImage`):U(`gallerySelectImage`)})]}),(0,H.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>{Qr(K.image),yt(null)},children:[(0,H.jsx)(Ae,{size:14,fill:K.image.pinned?`currentColor`:`none`}),(0,H.jsx)(`span`,{children:K.image.pinned?U(`galleryUnpin`):U(`galleryPin`)})]}),(0,H.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>{ot(q.includes(K.image.relative_path)&&q.length>1?q:[K.image.relative_path]),yt(null)},children:[(0,H.jsx)(pe,{size:14}),(0,H.jsx)(`span`,{children:U(`bulkAddToBoard`)})]})]}),(0,H.jsxs)(`div`,{className:`ue-context-menu-section`,children:[(0,H.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>{Se(K.image),yt(null)},children:[(0,H.jsx)(Fe,{size:14}),(0,H.jsx)(`span`,{children:U(`modalOpenWorkflow`)})]}),(0,H.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>{Ce(K.image),yt(null)},children:[(0,H.jsx)(te,{size:14}),(0,H.jsx)(`span`,{children:U(`loraStackApply`)})]}),(0,H.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>{Ot(K.image),yt(null)},children:[(0,H.jsx)(E,{size:14}),(0,H.jsx)(`span`,{children:U(`metadataView`)})]})]}),(0,H.jsxs)(`div`,{className:`ue-context-menu-grid ue-context-menu-grid--copy`,children:[(0,H.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>{fi(K.image),yt(null)},children:[(0,H.jsx)(se,{size:14}),(0,H.jsx)(`span`,{children:U(`metadataCopyPositive`)})]}),(0,H.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>{di(K.image),yt(null)},children:[(0,H.jsx)(k,{size:14}),(0,H.jsx)(`span`,{children:U(`contextCopyImage`)})]}),(0,H.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>{ui(K.image.filename,U(`contextCopyFilenameSuccess`)),yt(null)},children:[(0,H.jsx)(ze,{size:14}),(0,H.jsx)(`span`,{children:U(`contextCopyFilename`)})]}),(0,H.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>{ui(K.image.relative_path,U(`contextCopyPathSuccess`)),yt(null)},children:[(0,H.jsx)(ge,{size:14}),(0,H.jsx)(`span`,{children:U(`contextCopyPath`)})]}),(0,H.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>{window.open(ai(K.image),`_blank`,`noopener,noreferrer`),yt(null)},children:[(0,H.jsx)(le,{size:14}),(0,H.jsx)(`span`,{children:U(`modalOpenFull`)})]})]}),(0,H.jsxs)(`button`,{className:`ue-context-menu-item ue-context-menu-item--danger`,onClick:()=>{q.includes(K.image.relative_path)&&q.length>1?Xr():pi(K.image),yt(null)},children:[(0,H.jsx)(Be,{size:14}),(0,H.jsx)(`span`,{children:q.includes(K.image.relative_path)&&q.length>1?U(`bulkDelete`):U(`commonDelete`)})]})]})}):null,Dt?(0,H.jsx)(p.Suspense,{fallback:null,children:(0,H.jsx)(Sr,{image:Dt,onClose:()=>Ot(null)})}):null,bt?(0,H.jsx)(S,{children:(0,H.jsxs)(`div`,{className:`ue-context-menu`,style:{top:bt.y,left:bt.x},onClick:e=>e.stopPropagation(),onContextMenu:e=>e.preventDefault(),children:[(0,H.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>{Ur(bt.item.id,{ctrlKey:!0,metaKey:!1,shiftKey:!1}),xt(null)},children:[q.includes(bt.item.id)?(0,H.jsx)(k,{size:14}):(0,H.jsx)(Re,{size:14}),(0,H.jsx)(`span`,{children:q.includes(bt.item.id)?U(`galleryDeselectImage`):U(`gallerySelectImage`)})]}),(0,H.jsxs)(`button`,{className:`ue-context-menu-item`,onClick:()=>{q.includes(bt.item.id)&&q.length>1?ti():Le(bt.item.id),xt(null)},children:[(0,H.jsx)(Ne,{size:14}),(0,H.jsx)(`span`,{children:q.includes(bt.item.id)&&q.length>1?U(`trashRestoreSelected`):U(`trashRestore`)})]}),(0,H.jsxs)(`button`,{className:`ue-context-menu-item ue-context-menu-item--danger`,onClick:()=>{q.includes(bt.item.id)&&q.length>1?ni():He(bt.item.id),xt(null)},children:[(0,H.jsx)(Be,{size:14}),(0,H.jsx)(`span`,{children:q.includes(bt.item.id)&&q.length>1?U(`trashDeleteSelectedForever`):U(`trashDeleteForever`)})]})]})}):null,Vt&&!w?(0,H.jsx)(p.Suspense,{fallback:null,children:(0,H.jsx)(Cr,{initialFile:Ut,onClose:rn,onOpenDetail:I,suspended:P||Gt,onLocate:e=>{en.current?.abort();let t=new AbortController;en.current=t,(async()=>{try{let n,r=!1;try{n=await G.locateImage(e,48,h,g,t.signal)}catch(t){if(!(t instanceof Ze)||![404,405].includes(t.status)||t.details&&typeof t.details==`object`)throw t;let i=e.source_relative_path||e.relative_path.replace(/^[^:]+::/,``);n={subfolder:`${e.source_id||`default_output`}::${i.includes(`/`)?i.slice(0,i.lastIndexOf(`/`)):``}`,page:1,index:0,relative_path:e.relative_path},r=!0,Xe(U(`imageSearchLegacyLocate`),`info`)}if(t.signal.aborted)return;let a=document.querySelector(`.ue-main-shell`)?.scrollTop??0;$t.current=()=>{D?.(s),ce(i),ue(o),de(c),he(d),fe(l),me(u),_e(f),Ie?.(B||``),ve(h),be(g),Rt(Lt),Bt(zt),Qt({folder:s,page:i,query:B||``,top:a})},Rt(!1),Bt(!1),Gr(),ue(``),de(``),he(!1),fe(``),me(``),_e(``),Ie?.(r?e.filename:``),D?.(n.subfolder),ce(n.page),Xt({path:n.relative_path,index:n.index}),Kt(!0)}catch(e){t.signal.aborted||Xe(e instanceof Error?e.message:U(`imageSearchLocateFailed`),`error`)}})()}})}):null,kn?(0,H.jsx)(`button`,{className:`ue-scrolltop-btn`,onClick:gi,"aria-label":U(`galleryBackToTop`),title:U(`galleryBackToTop`),children:(0,H.jsx)(R,{size:18})}):null]})},kr=({selectedPaths:e,selectedSubfolder:t,selectedBoard:r,boards:i,page:a,targetFolderOptions:o,onClose:s,onBatchUpdateImages:c,onCreateBoard:l,onUpdateBoardPins:u,onMoveImages:d,onBatchRenameImages:f,onDeleteImages:m})=>{let{t:h}=n(),{confirm:g}=_t(),{runOperation:_}=Je(),[v,y]=(0,p.useState)([]),[b,x]=(0,p.useState)(``),[S,C]=(0,p.useState)(``),[w,T]=(0,p.useState)(`set-{page}-{n}`),[ee,E]=(0,p.useState)(1),[D,te]=(0,p.useState)(2),ne=e.length,re=h(`bulkSelected`,{count:ne}),O=(0,p.useMemo)(()=>o.filter(e=>e.value!==t),[t,o]),A=async e=>{if(!v.length)return;let t=i.find(t=>t.id===e);await g({title:h(`bulkAddToBoard`),message:h(`bulkAddToBoardConfirm`,{count:v.length,target:t?.name||e}),tone:`warning`,confirmLabel:h(`boardAddToAction`),cancelLabel:h(`libraryCancel`)})&&(await _(()=>u(e,v,!0),{pending:h(`operationAddToBoard`),success:h(`boardAddSuccess`,{count:v.length})}),y([]))},ie=async()=>{if(e.length&&await g({title:h(`bulkDelete`),message:e.length>=20?h(`bulkDeleteHeavyConfirm`,{count:e.length}):h(`bulkDeleteConfirm`,{count:e.length}),tone:e.length>=20?`danger`:`warning`,confirmLabel:h(`commonDelete`),cancelLabel:h(`libraryCancel`)}))try{tn(e,await _(()=>m(e),{pending:h(`operationDeleteImages`),success:t=>h(`operationDeleteImagesResult`,{count:t.deleted.length,missing:tn(e,t).failedPaths.length}),successTone:t=>tn(e,t).complete?`success`:`error`,successRetry:t=>et({paths:tn(e,t).failedPaths,confirm:g,confirmation:e=>({title:h(`bulkDelete`),message:h(`bulkDeleteConfirm`,{count:e}),tone:`warning`,confirmLabel:h(`commonDelete`),cancelLabel:h(`libraryCancel`)}),execute:m,failed:(e,t)=>tn(e,t).failedPaths,summary:(e,t)=>h(`operationDeleteImagesResult`,{count:t.deleted.length,missing:tn(e,t).failedPaths.length}),run:_,pending:h(`operationDeleteImages`)}),successDetail:t=>{let{failedPaths:n}=tn(e,t);return n.length?h(`operationUnprocessedPaths`,{target:nn(n)}):``},error:e=>e instanceof Error?e.message:h(`imageDeleteError`)})).complete&&s()}catch{}},j=async()=>{!r||!e.length||await g({title:h(`bulkRemoveFromBoard`),message:h(`bulkRemoveFromBoardConfirm`,{count:e.length,target:r.name}),tone:`warning`,confirmLabel:h(`bulkRemoveFromBoard`),cancelLabel:h(`libraryCancel`)})&&(await _(()=>u(r.id,e,!1),{pending:h(`operationRemoveFromBoard`),success:h(`bulkRemoveFromBoard`)}),s())},M=async()=>{if(!e.length||!S)return;let t=o.find(e=>e.value===S);if(await g({title:h(`bulkMoveTo`),message:h(`bulkMoveConfirm`,{count:e.length,target:t?.label||S}),tone:`warning`,confirmLabel:h(`folderMove`),cancelLabel:h(`libraryCancel`)}))try{en(e,await _(()=>d(e,S,t?.source_id),{pending:h(`operationMoveImages`),success:t=>{let{unaccounted:n}=en(e,t);return[h(`qolMoveResult`,{moved:t.moved.length,missing:t.missing.length,blocked:t.blocked?.length??0}),t.unchanged?.length?h(`operationMoveUnchanged`,{count:t.unchanged.length}):``,n?h(`operationUnaccounted`,{count:n}):``].filter(Boolean).join(` `)},successTone:t=>en(e,t).complete?`success`:`error`,successRetry:n=>et({paths:en(e,n).failedPaths,confirm:g,confirmation:e=>({title:h(`bulkMoveTo`),message:h(`bulkMoveConfirm`,{count:e,target:t?.label||S}),tone:`warning`,confirmLabel:h(`folderMove`),cancelLabel:h(`libraryCancel`)}),execute:e=>d(e,S,t?.source_id),failed:(e,t)=>en(e,t).failedPaths,summary:(e,t)=>h(`qolMoveResult`,{moved:t.moved.length,missing:t.missing.length,blocked:t.blocked?.length??0}),run:_,pending:h(`operationMoveImages`)}),successDetail:t=>{let{failedPaths:n}=en(e,t);return n.length?h(`operationUnprocessedPaths`,{target:nn(n)}):``},error:e=>e instanceof Error?e.message:h(`operationMoveImages`)})).complete&&s()}catch{}},N=async()=>{if(!(!e.length||!w.trim())&&await g({title:h(`bulkRenameApply`),message:h(`bulkRenameConfirm`,{count:e.length,target:w.trim()}),tone:`warning`,confirmLabel:h(`folderRename`),cancelLabel:h(`libraryCancel`)}))try{await f(e,w.trim(),ee,D,a),s()}catch{}},P=t=>({pending:h(`operationUpdateImages`),success:t=>h(`operationBatchResult`,{updated:t.updated.length,count:0,missing:$t(e,t).failedPaths.length}),successTone:t=>$t(e,t).complete?`success`:`error`,successDetail:t=>$t(e,t).failedPaths.join(`; `),successRetry:n=>et({paths:$t(e,n).failedPaths,confirm:g,confirmation:e=>({title:h(`operationUpdateImages`),message:h(`operationRetryBatchConfirm`,{count:e,target:typeof t.pinned==`boolean`?h(t.pinned?`bulkPin`:`bulkUnpin`):`${h(`bulkSetCategory`)}: ${String(t.category||``)}`}),tone:`warning`,confirmLabel:h(`commonConfirm`),cancelLabel:h(`libraryCancel`)}),execute:e=>c(e,t),failed:(e,t)=>$t(e,t).failedPaths,summary:(e,t)=>h(`operationBatchResult`,{updated:t.updated.length,count:0,missing:$t(e,t).failedPaths.length}),run:_,pending:h(`operationUpdateImages`)})}),ae=async t=>{e.length&&await g({title:h(t?`bulkPin`:`bulkUnpin`),message:h(t?`bulkPinConfirm`:`bulkUnpinConfirm`,{count:e.length}),tone:`warning`,confirmLabel:h(t?`bulkPin`:`bulkUnpin`),cancelLabel:h(`libraryCancel`)})&&await _(()=>c(e,{pinned:t}),P({pinned:t})).catch(()=>void 0)},I=async()=>{let t=b.trim();!e.length||!t||await g({title:h(`bulkSetCategory`),message:h(`bulkSetCategoryConfirm`,{count:e.length,target:t}),tone:`warning`,confirmLabel:h(`commonConfirm`),cancelLabel:h(`libraryCancel`)})&&await _(()=>c(e,{category:t}),P({category:t})).catch(()=>void 0)};return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`button`,{className:`ue-inspector-backdrop`,onClick:s,"aria-label":h(`bulkClear`)}),(0,H.jsxs)(`aside`,{className:`ue-gallery-inspector`,"aria-label":h(`bulkActions`),children:[(0,H.jsxs)(`div`,{className:`ue-gallery-inspector-head`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`span`,{children:h(`bulkActions`)}),(0,H.jsx)(`strong`,{title:re,children:re})]}),(0,H.jsx)(`button`,{className:`ue-icon-action`,onClick:s,"aria-label":h(`bulkClear`),title:h(`bulkClear`),children:(0,H.jsx)(V,{size:14})})]}),(0,H.jsxs)(`div`,{className:`ue-gallery-inspector-summary`,children:[(0,H.jsxs)(`div`,{className:`ue-gallery-inspector-title`,children:[(0,H.jsx)(k,{size:16}),(0,H.jsx)(`strong`,{children:re})]}),(0,H.jsx)(`span`,{children:t||h(`galleryOutputFolder`)}),(0,H.jsx)(`p`,{children:h(`bulkSelectionHint`)})]}),(0,H.jsxs)(`div`,{className:`ue-gallery-inspector-quick-actions`,"aria-label":h(`bulkActions`),children:[(0,H.jsxs)(`button`,{className:`ue-icon-action`,onClick:s,"aria-label":h(`bulkClear`),title:h(`bulkClear`),children:[(0,H.jsx)(Re,{size:14}),(0,H.jsx)(`span`,{children:h(`bulkClear`)})]}),(0,H.jsxs)(`button`,{className:`ue-icon-action`,onClick:()=>void ae(!0),"aria-label":h(`bulkPin`),title:h(`bulkPin`),children:[(0,H.jsx)(Ae,{size:14}),(0,H.jsx)(`span`,{children:h(`bulkPin`)})]}),(0,H.jsxs)(`button`,{className:`ue-icon-action`,onClick:()=>void ae(!1),"aria-label":h(`bulkUnpin`),title:h(`bulkUnpin`),children:[(0,H.jsx)(Ae,{size:14}),(0,H.jsx)(`span`,{children:h(`bulkUnpin`)})]}),(0,H.jsxs)(`button`,{className:`ue-icon-action`,onClick:()=>y(e),"aria-label":h(`bulkAddToBoard`),title:h(`bulkAddToBoard`),children:[(0,H.jsx)(pe,{size:14}),(0,H.jsx)(`span`,{children:h(`bulkAddToBoard`)})]}),r?(0,H.jsxs)(`button`,{className:`ue-icon-action`,onClick:()=>void j(),"aria-label":h(`bulkRemoveFromBoard`),title:h(`bulkRemoveFromBoard`),children:[(0,H.jsx)(de,{size:14}),(0,H.jsx)(`span`,{children:h(`bulkRemoveFromBoard`)})]}):null,(0,H.jsxs)(`button`,{className:`ue-icon-action ue-icon-action--danger`,onClick:()=>void ie(),"aria-label":h(`bulkDelete`),title:h(`bulkDelete`),children:[(0,H.jsx)(Be,{size:14}),(0,H.jsx)(`span`,{children:h(`bulkDelete`)})]})]}),(0,H.jsxs)(`div`,{className:`ue-gallery-inspector-tools`,children:[(0,H.jsxs)(`div`,{className:`ue-bulk-tool`,children:[(0,H.jsxs)(`span`,{className:`ue-bulk-tool-title`,children:[(0,H.jsx)(ze,{size:13}),h(`bulkSetCategory`)]}),(0,H.jsxs)(`div`,{className:`ue-bulk-tool-field`,children:[(0,H.jsx)(`label`,{className:`ue-select-field ue-select-field--input`,children:(0,H.jsx)(`input`,{value:b,onChange:e=>x(e.target.value),placeholder:h(`galleryCategoryPlaceholder`)})}),(0,H.jsxs)(`button`,{className:`ue-icon-action ue-icon-action--filled`,onClick:()=>void I(),"aria-label":h(`bulkSetCategory`),title:h(`bulkSetCategory`),disabled:!b.trim(),children:[(0,H.jsx)(F,{size:14}),(0,H.jsx)(`span`,{children:h(`bulkSetCategory`)})]})]})]}),(0,H.jsxs)(`div`,{className:`ue-bulk-tool`,children:[(0,H.jsxs)(`span`,{className:`ue-bulk-tool-title`,children:[(0,H.jsx)(ye,{size:13}),h(`bulkMoveTo`)]}),(0,H.jsxs)(`div`,{className:`ue-bulk-tool-field`,children:[(0,H.jsx)(`label`,{className:`ue-select-field ue-select-field--input`,children:(0,H.jsxs)(`select`,{value:S,onChange:e=>C(e.target.value),children:[(0,H.jsx)(`option`,{value:``,disabled:!0,children:h(`bulkMoveTo`)}),O.map(e=>(0,H.jsx)(`option`,{value:e.value,children:e.label},e.value))]})}),(0,H.jsxs)(`button`,{className:`ue-icon-action ue-icon-action--filled`,onClick:()=>void M(),"aria-label":h(`bulkMoveTo`),title:h(`bulkMoveTo`),disabled:!S,children:[(0,H.jsx)(F,{size:14}),(0,H.jsx)(`span`,{children:h(`bulkMoveTo`)})]})]})]}),(0,H.jsxs)(`div`,{className:`ue-bulk-tool ue-bulk-tool--rename`,children:[(0,H.jsxs)(`span`,{className:`ue-bulk-tool-title`,children:[(0,H.jsx)(z,{size:13}),h(`bulkRenameApply`)]}),(0,H.jsxs)(`div`,{className:`ue-bulk-tool-field`,children:[(0,H.jsx)(`label`,{className:`ue-select-field ue-select-field--input ue-bulk-rename-field`,children:(0,H.jsx)(`input`,{value:w,onChange:e=>T(e.target.value),placeholder:h(`bulkRenameTemplatePlaceholder`)})}),(0,H.jsxs)(`label`,{className:`ue-select-field ue-bulk-number-field`,children:[(0,H.jsx)(`span`,{children:h(`bulkRenameStart`)}),(0,H.jsx)(`input`,{type:`number`,min:0,value:ee,onChange:e=>E(Number(e.target.value)||0)})]}),(0,H.jsxs)(`label`,{className:`ue-select-field ue-bulk-number-field`,children:[(0,H.jsx)(`span`,{children:h(`bulkRenamePadding`)}),(0,H.jsx)(`input`,{type:`number`,min:1,max:8,value:D,onChange:e=>te(Number(e.target.value)||1)})]}),(0,H.jsxs)(`button`,{className:`ue-icon-action ue-icon-action--accent`,onClick:()=>void N(),"aria-label":h(`bulkRenameApply`),title:h(`bulkRenameRuleHint`),disabled:!w.trim(),children:[(0,H.jsx)(z,{size:13}),(0,H.jsx)(`span`,{children:h(`bulkRenameApply`)})]})]})]})]}),(0,H.jsxs)(`div`,{className:`ue-gallery-inspector-note`,children:[(0,H.jsx)(`strong`,{children:h(`bulkRenameRuleTitle`)}),(0,H.jsx)(`span`,{children:h(`bulkRenameRuleHint`)})]})]}),(0,H.jsx)(sn,{open:v.length>0,boards:i,selectedCount:v.length,onClose:()=>y([]),onCreateBoard:l,onAddToBoard:A})]})},Ar=e=>{try{let t=new URL(e);return[`http:`,`https:`].includes(t.protocol)?t.href:void 0}catch{return}},jr=e=>e.split(/(`[^`]+`|\[[^\]]+\]\([^\s)]+\))/g).map((e,t)=>{if(e.startsWith("`"))return(0,H.jsx)(`code`,{children:e.slice(1,-1)},t);let n=/^\[([^\]]+)\]\(([^)]+)\)$/.exec(e);if(n){let e=Ar(n[2]);return e?(0,H.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,children:n[1]},t):n[1]}return e}),Mr=({body:e})=>{let t=e.split(/\r?\n/),n=[],r=[],i=()=>{r.length&&n.push((0,H.jsx)(`ul`,{children:r},`list-${n.length}`)),r=[]};return t.forEach((e,t)=>{if(/^\s*[-*] /.test(e)){r.push((0,H.jsx)(`li`,{children:jr(e.replace(/^\s*[-*] /,``))},t));return}i(),/^#{1,6} /.test(e)?n.push((0,H.jsx)(`h3`,{children:jr(e.replace(/^#{1,6} /,``))},t)):e.trim()&&n.push((0,H.jsx)(`p`,{children:jr(e)},t))}),i(),(0,H.jsx)(`div`,{className:`ue-release-markdown`,children:n})},Nr=null,Pr=e=>{if(!e)return!1;let t=Nr??[];try{let e=JSON.parse(pt(`universal-extractor:seen-releases`)||`null`);Array.isArray(e)&&(t=e.filter(e=>typeof e==`string`).slice(-20))}catch{}let n=t.length>0&&!t.includes(e);return Nr=[...t.filter(t=>t!==e),e].slice(-20),mt(`universal-extractor:seen-releases`,JSON.stringify(Nr)),n},Fr=({activeTab:e,onTabChange:t,searchValue:r,onSearchChange:i,onRefresh:a,sidebarCollapsed:o,onSidebarToggle:s})=>{let{locale:c,setLocale:l,t:u}=n(),[d,f]=(0,p.useState)(!1),[m,h]=(0,p.useState)(r),[g,_]=(0,p.useState)(!1),[v,y]=(0,p.useState)(null),[b,x]=(0,p.useState)(null),[w,T]=(0,p.useState)(!1),[ee,E]=(0,p.useState)(``),[D,te]=(0,p.useState)(!1),[k,A]=(0,p.useState)(!1),[ie,M]=(0,p.useState)({x:12,y:56}),N=(0,p.useRef)(null),P=(0,p.useRef)(!1),F=(0,p.useRef)(null),I=e===`library`,L=I&&(d||!!r.trim()),R=!!v?.update_available;C(k,(0,p.useCallback)(()=>A(!1),[]),{closeOnScroll:!0});let oe=(0,p.useCallback)(async(e=!1)=>{te(!0),E(``);try{let t=await G.getUpdateStatus(e);y(t),E(t.error||``)}catch(e){E(e instanceof Error?e.message:u(`updatesCheckFailed`))}finally{te(!1)}},[u]);(0,p.useEffect)(()=>{oe(!1)},[oe]),(0,p.useEffect)(()=>{let e=!1;if(typeof G.getReleaseNotes==`function`)return G.getReleaseNotes(c).then(t=>{e||(x(t),Pr(t.current_version)&&T(!0))}).catch(()=>void 0),()=>{e=!0}},[c]),(0,p.useEffect)(()=>{g||h(r)},[g,r]),(0,p.useEffect)(()=>{L&&N.current?.focus()},[L]),(0,p.useEffect)(()=>{I||f(!1)},[I]);let se=()=>{l(c===`zh-CN`?`en`:`zh-CN`)},ce=e=>{e.stopPropagation();let t=F.current?.getBoundingClientRect();if(t){let e=Math.min(400,window.innerWidth-24);M({x:Math.max(12,Math.min(window.innerWidth-e-12,t.right-e)),y:Math.min(Math.max(12,window.innerHeight-560-12),t.bottom+8)})}A(e=>!e),T(!1)},ue=e=>{if(!e)return``;let t=new Date(e);return Number.isNaN(t.getTime())?``:new Intl.DateTimeFormat(c,{month:`short`,day:`numeric`}).format(t)};return(0,H.jsxs)(`header`,{className:`ue-topbar`,children:[(0,H.jsxs)(`div`,{className:`ue-topbar-brand`,children:[(0,H.jsx)(`button`,{className:`ue-topbar-icon-btn`,onClick:s,"aria-label":u(`navToggleSidebar`),title:u(`navToggleSidebar`),"data-tour-id":`topbar-sidebar-toggle`,children:o?(0,H.jsx)(O,{size:16}):(0,H.jsx)(re,{size:16})}),(0,H.jsx)(`strong`,{children:`Universal`}),(0,H.jsx)(`span`,{className:`ue-topbar-scope`,children:u(`topStatus`,{tab:e})})]}),(0,H.jsx)(ar,{tourId:`workspace-switcher`,label:u(`workspaceSwitch`),icon:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{children:u(e===`gallery`?`navGallery`:e===`library`?`navLibrary`:e===`workbench`?`navWorkbench`:`navSettings`)}),(0,H.jsx)(ae,{size:14})]}),className:`ue-workspace-switcher`,children:(0,H.jsxs)(`nav`,{className:`ue-topbar-tabs`,"aria-label":u(`workspaceSwitch`),"data-tour-id":`topbar-tabs`,children:[(0,H.jsxs)(`button`,{className:`ue-topbar-tab ${e===`gallery`?`active`:``}`,onClick:()=>t(`gallery`),"aria-current":e===`gallery`?`page`:void 0,"aria-label":u(`navGallery`),"aria-describedby":`ue-workspace-desc-gallery`,children:[(0,H.jsx)(Se,{size:16}),(0,H.jsxs)(`span`,{className:`ue-workspace-option-copy`,children:[(0,H.jsx)(`strong`,{children:u(`navGallery`)}),(0,H.jsx)(`small`,{id:`ue-workspace-desc-gallery`,children:u(`workspaceDesc_gallery`)})]})]}),(0,H.jsxs)(`button`,{className:`ue-topbar-tab ${e===`library`?`active`:``}`,onClick:()=>t(`library`),"aria-current":e===`library`?`page`:void 0,"aria-label":u(`navLibrary`),"aria-describedby":`ue-workspace-desc-library`,children:[(0,H.jsx)(Ce,{size:16}),(0,H.jsxs)(`span`,{className:`ue-workspace-option-copy`,children:[(0,H.jsx)(`strong`,{children:u(`navLibrary`)}),(0,H.jsx)(`small`,{id:`ue-workspace-desc-library`,children:u(`workspaceDesc_library`)})]})]}),(0,H.jsxs)(`button`,{className:`ue-topbar-tab ${e===`workbench`?`active`:``}`,onClick:()=>t(`workbench`),"aria-current":e===`workbench`?`page`:void 0,"aria-label":u(`navWorkbench`),"aria-describedby":`ue-workspace-desc-workbench`,children:[(0,H.jsx)(He,{size:16}),(0,H.jsxs)(`span`,{className:`ue-workspace-option-copy`,children:[(0,H.jsx)(`strong`,{children:u(`navWorkbench`)}),(0,H.jsx)(`small`,{id:`ue-workspace-desc-workbench`,children:u(`workspaceDesc_workbench`)})]})]}),(0,H.jsxs)(`button`,{className:`ue-topbar-tab ${e===`settings`?`active`:``}`,onClick:()=>t(`settings`),"aria-current":e===`settings`?`page`:void 0,"aria-label":u(`navSettings`),"aria-describedby":`ue-workspace-desc-settings`,children:[(0,H.jsx)(B,{size:16}),(0,H.jsxs)(`span`,{className:`ue-workspace-option-copy`,children:[(0,H.jsx)(`strong`,{children:u(`navSettings`)}),(0,H.jsx)(`small`,{id:`ue-workspace-desc-settings`,children:u(`workspaceDesc_settings`)})]})]})]})}),(0,H.jsxs)(`div`,{className:`ue-topbar-tools`,children:[I?(0,H.jsxs)(`div`,{className:`ue-topbar-search-wrap ${L?`is-open`:``}`,"data-tour-id":`topbar-search`,children:[(0,H.jsx)(`button`,{className:`ue-topbar-icon-btn ${L?`is-active`:``}`,onClick:()=>f(e=>!e),"aria-label":u(`navToggleSearch`),title:u(`navToggleSearch`),children:(0,H.jsx)(Pe,{size:16})}),(0,H.jsx)(`label`,{className:`ue-topbar-search`,htmlFor:`ue-topbar-search`,children:(0,H.jsx)(`input`,{ref:N,id:`ue-topbar-search`,value:m,placeholder:u(`navSearchLibraryPlaceholder`),onCompositionStart:()=>{P.current=!0,_(!0)},onCompositionEnd:e=>{P.current=!1,_(!1),h(e.currentTarget.value),i(e.currentTarget.value)},onChange:e=>{h(e.target.value),!P.current&&!e.nativeEvent.isComposing&&i(e.target.value)}})})]}):null,(0,H.jsx)(`button`,{className:`ue-topbar-icon-btn ue-locale-toggle`,onClick:se,"aria-label":u(`navLanguage`),title:u(c===`zh-CN`?`navSwitchToEnglish`:`navSwitchToChinese`),"data-tour-id":`topbar-language`,children:(0,H.jsx)(`span`,{children:u(c===`zh-CN`?`navLanguageZhShort`:`navLanguageEnShort`)})}),(0,H.jsx)(`button`,{className:`ue-topbar-icon-btn`,onClick:a,"aria-label":u(`navRefresh`),title:u(`navRefresh`),"data-tour-id":`topbar-refresh`,children:(0,H.jsx)(Me,{size:16})}),w&&(0,H.jsx)(`button`,{className:`ue-release-notice`,onClick:ce,children:u(`updatesInstalledNotes`,{version:b?.current_version||``})}),(0,H.jsxs)(`button`,{ref:F,className:`ue-topbar-icon-btn ue-update-bell ${k?`is-open`:``} ${R?`has-update`:``}`,onClick:ce,"aria-label":u(`updatesTitle`),title:u(`updatesTitle`),"data-tour-id":`topbar-updates`,children:[(0,H.jsx)(j,{size:16}),R&&(0,H.jsx)(`span`,{className:`ue-update-dot`,"aria-hidden":`true`})]})]}),k&&(0,H.jsx)(S,{children:(0,H.jsxs)(`section`,{className:`ue-update-popover`,style:{left:ie.x,top:ie.y},onClick:e=>e.stopPropagation(),"aria-label":u(`updatesTitle`),children:[(0,H.jsxs)(`header`,{className:`ue-update-popover-head`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`strong`,{children:u(`updatesTitle`)}),(0,H.jsx)(`span`,{children:u(D?`updatesChecking`:ee?`updatesCheckFailed`:v?.check_status===`preview`?`updatesPreview`:R?`updatesAvailable`:v?.check_status===`cached`?`updatesCached`:v?`updatesCurrent`:`updatesLocalOnly`)})]}),(0,H.jsx)(`button`,{type:`button`,className:`ue-icon-action`,onClick:()=>void oe(!0),disabled:D,"aria-label":u(`updatesCheckNow`),title:u(`updatesCheckNow`),children:D?(0,H.jsx)(ne,{className:`ue-spin`,size:16}):(0,H.jsx)(Me,{size:16})})]}),(0,H.jsxs)(`div`,{className:`ue-update-version-box`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`span`,{children:u(`updatesCurrentVersion`)}),(0,H.jsx)(`strong`,{children:b?.current_version||v?.current_version||`-`})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`span`,{children:u(`updatesLatestVersion`)}),(0,H.jsx)(`strong`,{className:R?`is-new`:``,children:v?.latest_version||`-`})]}),(0,H.jsxs)(`a`,{className:`ue-secondary-btn`,href:Ar(v?.release_url||v?.repository_url||`https://github.com/Tera-Dark/ComfyUI-Universal-Extractor`),target:`_blank`,rel:`noreferrer`,children:[(0,H.jsx)(le,{size:16}),(0,H.jsx)(`span`,{children:u(`updatesOpenGithub`)})]})]}),ee&&(0,H.jsx)(`p`,{className:`ue-update-error`,children:ee}),(0,H.jsxs)(`div`,{className:`ue-update-log`,children:[(0,H.jsx)(`h2`,{children:u(`updatesChangelog`)}),v?.last_success_at?(0,H.jsxs)(`small`,{children:[u(`updatesLastSuccess`),`: `,new Date(v.last_success_at*1e3).toLocaleString(c)]}):null,(()=>{let e=b?.current_version||v?.current_version,t=[...b?.releases||[]];for(let e of v?.releases||[])t.some(t=>t.version===e.version)||t.push(e);return t.sort((t,n)=>Number(n.version===e)-Number(t.version===e)),t.length?t.map(t=>(0,H.jsxs)(`details`,{className:`ue-update-release`,open:t.version===e||void 0,children:[(0,H.jsxs)(`summary`,{className:`ue-update-release-title`,children:[(0,H.jsxs)(`strong`,{children:[t.version===e?u(`updatesInstalled`):u(R&&t.version===v?.latest_version?`updatesAvailable`:`updatesHistory`),` · `,t.name||t.version]}),(0,H.jsx)(`span`,{children:ue(t.published_at)})]}),(0,H.jsx)(Mr,{body:t.body||u(`updatesNoChangelog`)})]},t.version)):(0,H.jsx)(`p`,{className:`ue-update-empty`,children:u(D?`updatesChecking`:`updatesNoChangelog`)})})()]})]})})]})},Ir=({node:e,depth:t,expandedPaths:n,selectedSubfolder:r,onToggle:i,onSelect:a,onContextMenu:o,onFolderDragStart:s,onFolderDragEnd:c,onFolderDragOver:l,onFolderDrop:u,canDragFolder:d,pinnedFolders:f,searchActive:p,draggingPath:m,dropTargetPath:h})=>{let g=e.children.length>0,_=p||n.has(e.path),v=Pt(e.path,f),y=g&&_?fe:ge;return(0,H.jsxs)(`div`,{className:`ue-tree-branch`,children:[(0,H.jsxs)(`div`,{className:`ue-tree-row ${r===e.path?`active`:``}`,children:[g?(0,H.jsx)(`button`,{className:`ue-tree-toggle ${_?`is-expanded`:``}`,onClick:()=>i(e.path),"aria-label":_?`Collapse folder`:`Expand folder`,children:(0,H.jsx)(L,{size:12})}):(0,H.jsx)(`span`,{className:`ue-tree-spacer`,"aria-hidden":`true`}),(0,H.jsxs)(`button`,{className:`ue-tree-label ${v?`is-pinned`:``} ${m===e.path?`is-dragging`:``} ${h===e.path?`is-drop-target`:``}`,onClick:()=>a(e.path),onContextMenu:t=>o(t,e.path),draggable:d(e.path),onDragStart:t=>s(t,e.path),onDragEnd:c,onDragOver:t=>l(t,e.path),onDrop:t=>u(t,e.path),title:e.path,children:[(0,H.jsx)(y,{size:15}),(0,H.jsx)(`span`,{children:e.name}),v?(0,H.jsx)(`span`,{className:`ue-pin-dot`,"aria-hidden":`true`}):null]})]}),g&&_?(0,H.jsx)(`div`,{className:`ue-tree-children`,children:e.children.map(e=>(0,H.jsx)(Ir,{node:e,depth:t+1,expandedPaths:n,selectedSubfolder:r,onToggle:i,onSelect:a,onContextMenu:o,onFolderDragStart:s,onFolderDragEnd:c,onFolderDragOver:l,onFolderDrop:u,canDragFolder:d,pinnedFolders:f,searchActive:p,draggingPath:m,dropTargetPath:h},e.path))}):null]})},Lr=({collapsed:e,onToggle:t,activeTab:r,galleryContext:i,folderViewMode:a,onFolderViewModeChange:o,selectedCategory:s,selectedSubfolder:c,selectedBoardId:l,pinnedOnly:u,onCategorySelect:d,onSubfolderSelect:f,onBoardSelect:m,onPinnedOnlySelect:h,onCreateBoard:g,onCreateFolder:_,onDeleteFolder:v,onMergeFolder:y,onRenameFolder:b,onMoveFolder:w,libraries:T,activeLibraryName:E,onLibrarySelect:D,onLibraryDelete:te,draftName:ne,onDraftNameChange:re,onCreateLibrary:O})=>{let{t:k}=n(),A=i?.boards??[],[j,N]=(0,p.useState)(()=>St()),[P,F]=(0,p.useState)(()=>Ct()),[I,R]=(0,p.useState)(null),[se,ce]=(0,p.useState)(null),[le,ue]=(0,p.useState)(``),[de,me]=(0,p.useState)(``),[ve,ye]=(0,p.useState)(``),[xe,Se]=(0,p.useState)(()=>new Set([`folders`,`boards`,`categories`])),Ce=c===`__trash__`?vt:kt(c),we=(0,p.useMemo)(()=>(i?.sources??[]).find(e=>e.id===Ce)??null,[Ce,i?.sources]),Ee=!!(we?.enabled&&we.exists&&we.writable),Oe=!!(c&&c!==`__trash__`&&!At(c)),ke=Ee&&Oe&&kt(c)===Ce,je=(0,p.useMemo)(()=>new Map((i?.sources??[]).map(e=>[e.id,e])),[i?.sources]),Me=(0,p.useMemo)(()=>Ut(i?.subfolders??[],Ce),[Ce,i?.subfolders]),Ne=(0,p.useMemo)(()=>new Map((i?.subfolder_details??[]).map(e=>{let t=Number(e.modified_at);return[e.path,Number.isFinite(t)?t:0]})),[i?.subfolder_details]),Fe=(0,p.useMemo)(()=>Ht(Me,le),[le,Me]),B=(0,p.useMemo)(()=>[...Fe].sort((e,t)=>It(e,t,j,P,Ne)),[Ne,P,j,Fe]),Ie=(0,p.useCallback)((e,t)=>e?.id===`default_output`||e?.kind===`output`?k(`sidebarOutputSource`):e?.kind===`input`?k(`sidebarInputSource`):e?.name||t,[k]),Le=(0,p.useMemo)(()=>(i?.sources??[]).filter(e=>e.enabled&&e.exists),[i?.sources]),Re=we?.kind===`input`?k(`sidebarInputDirs`):we?.kind===`custom`?k(`sidebarCustomDirs`):k(`sidebarOutputDirs`),He=we?.kind===`input`?k(`sidebarInputReadOnly`):k(`sidebarSourceReadOnly`),Ue=(0,p.useMemo)(()=>Bt(Fe,j,P,i?.sources??[],Ie,Ce,Ne),[Ce,Ne,P,i?.sources,Ie,j,Fe]),[U,We]=(0,p.useState)(new Set),Ge=le.trim().length>0;(0,p.useEffect)(()=>{mt(bt,JSON.stringify([...j]))},[j]),(0,p.useEffect)(()=>{mt(xt,P)},[P]);let Ke=(0,p.useCallback)(()=>R(null),[]);C(!!I,Ke,{closeOnContextMenu:!0,closeOnScroll:!0});let qe=(0,p.useCallback)(()=>ce(null),[]);C(!!se,qe,{closeOnContextMenu:!0,closeOnScroll:!0}),(0,p.useEffect)(()=>{We(new Set)},[i?.output_dir_absolute]),(0,p.useEffect)(()=>{c&&We(e=>{let t=new Set(e);return Vt(c).forEach(e=>t.add(e)),t})},[c]);let Je=e=>{We(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},Ye=()=>{We(new Set)},Xe=()=>{We(new Set(Wt(Ue)))},Ze=(e,t)=>{e.preventDefault(),e.stopPropagation();let n=x(e,{width:220,height:220},`pointer`);R({path:t,x:n.x,y:n.y})},W=e=>{e.preventDefault(),e.stopPropagation();let t=x(e,{width:220,height:a===`tree`?340:250});ce(e=>e?null:t)},G=e=>{e(),qe()},Qe=e=>{N(t=>{let n=new Set(t),r=Nt(e);return r.some(e=>n.has(e))?r.forEach(e=>n.delete(e)):n.add(e),n})},$e=()=>{F(e=>e===`modified`?`name`:`modified`)},et=(0,p.useCallback)(e=>{if(!e||e===`__trash__`||At(e))return!1;let t=je.get(kt(e));return!!(t?.enabled&&t.exists&&t.writable)},[je]),tt=(0,p.useCallback)((e,t)=>{if(!et(e)||!et(t)||e===t||!jt(e,t)||Mt(t,e))return``;let n=Dt(e);if(!n)return``;let r=Ot(t,n);return r===e||Me.includes(r)?``:r},[et,Me]),nt=(e,t)=>{if(!et(t)){e.preventDefault();return}e.stopPropagation(),e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`application/x-universal-gallery-folder`,t),e.dataTransfer.setData(`text/plain`,t),me(t),ye(``)},rt=()=>{me(``),ye(``)},it=(e,t)=>{if(!tt(de||e.dataTransfer.getData(`application/x-universal-gallery-folder`),t)){ye(e=>e===t?``:e);return}e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect=`move`,ye(t),We(e=>{if(e.has(t))return e;let n=new Set(e);return n.add(t),n})},at=(e,t)=>{let n=de||e.dataTransfer.getData(`application/x-universal-gallery-folder`),r=tt(n,t);if(!r){rt();return}e.preventDefault(),e.stopPropagation(),rt(),w(n,r)},ot=e=>{Se(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},st=Tt(Ce);return(0,H.jsxs)(`aside`,{className:`ue-sidebar ${e?`is-collapsed`:``}`,"data-tour-id":`sidebar`,inert:e,"aria-hidden":e,children:[(0,H.jsx)(`button`,{className:`ue-mobile-sidebar-close`,onClick:t,"aria-label":k(`navToggleSidebar`),children:(0,H.jsx)(V,{size:18})}),(0,H.jsx)(`button`,{className:`ue-sidebar-toggle-edge`,onClick:t,"aria-label":k(e?`sidebarExpand`:`sidebarCollapse`),title:k(e?`sidebarExpand`:`sidebarCollapse`),children:(0,H.jsx)(L,{size:14,className:`ue-sidebar-toggle-icon`})}),r===`gallery`?(0,H.jsxs)(`div`,{className:`ue-sidebar-section ue-sidebar-section--grow`,children:[(0,H.jsxs)(`div`,{className:`ue-sidebar-heading`,children:[(0,H.jsx)(`span`,{children:k(`sidebarResources`)}),(0,H.jsx)(`strong`,{children:i?.active_source_count??0})]}),(0,H.jsxs)(`div`,{className:`ue-sidebar-quick`,"data-tour-id":`sidebar-quick`,children:[(0,H.jsx)(`div`,{className:`ue-sidebar-quick-label`,children:k(`sidebarQuickAccess`)}),Le.length>0?Le.map(e=>{let t=Tt(e.id),n=Ce===e.id&&c!==`__trash__`&&l===``&&!u,r=e.kind===`input`?be:e.kind===`custom`?ge:_e;return(0,H.jsxs)(`button`,{className:`ue-tree-item ue-tree-item--root ${n?`active`:``}`,onClick:()=>f(t),title:e.path,children:[(0,H.jsx)(r,{size:15}),(0,H.jsx)(`span`,{children:Ie(e,e.id)})]},e.id)}):(0,H.jsxs)(`button`,{className:`ue-tree-item ue-tree-item--root ${c===``&&l===``&&!u?`active`:``}`,onClick:()=>f(``),children:[(0,H.jsx)(_e,{size:15}),(0,H.jsx)(`span`,{children:i?.output_dir_relative||`./output`})]}),(0,H.jsxs)(`button`,{className:`ue-tree-item ue-tree-item--root ${c===`__trash__`&&l===``?`active`:``}`,onClick:()=>f(`__trash__`),children:[(0,H.jsx)(Ve,{size:15}),(0,H.jsx)(`span`,{children:k(`sidebarTrash`)})]})]}),(0,H.jsxs)(`div`,{className:`ue-sidebar-scroll`,"data-has-query":Ge?`true`:`false`,children:[(0,H.jsxs)(`div`,{className:`ue-sidebar-group`,"data-tour-id":`sidebar-folders`,children:[(0,H.jsxs)(`div`,{className:`ue-sidebar-group-header ue-sidebar-group-header--folders`,children:[(0,H.jsxs)(`button`,{className:`ue-sidebar-group-title`,onClick:()=>ot(`folders`),"aria-expanded":xe.has(`folders`),children:[(0,H.jsx)(`span`,{className:`ue-sidebar-group-chevron`,children:xe.has(`folders`)?(0,H.jsx)(ae,{size:13}):(0,H.jsx)(L,{size:13})}),(0,H.jsx)(`span`,{className:`ue-sidebar-group-icon`,children:we?.kind===`input`?(0,H.jsx)(be,{size:14}):we?.kind===`custom`?(0,H.jsx)(fe,{size:14}):(0,H.jsx)(_e,{size:14})}),(0,H.jsx)(`strong`,{className:`ue-sidebar-group-name`,children:Re}),(0,H.jsx)(`span`,{className:`ue-sidebar-count-badge`,children:Me.length})]}),(0,H.jsxs)(`div`,{className:`ue-sidebar-subactions`,children:[Ee?(0,H.jsx)(`button`,{className:`ue-sidebar-subaction`,onClick:_,title:k(`sidebarCreateFolder`),"aria-label":k(`sidebarCreateFolder`),children:(0,H.jsx)(pe,{size:14})}):(0,H.jsx)(`button`,{className:`ue-sidebar-subaction`,disabled:!0,title:He,"aria-label":He,children:(0,H.jsx)(pe,{size:14})}),(0,H.jsx)(`div`,{className:`ue-sidebar-more`,children:(0,H.jsx)(`button`,{className:`ue-sidebar-subaction ${se?`active`:``}`,onClick:W,title:k(`sidebarMoreActions`),"aria-label":k(`sidebarMoreActions`),children:(0,H.jsx)(ee,{size:14})})})]})]}),xe.has(`folders`)?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{className:`ue-sidebar-folder-toolbar`,children:(0,H.jsxs)(`label`,{className:`ue-sidebar-search`,children:[(0,H.jsx)(Pe,{size:13}),(0,H.jsx)(`input`,{value:le,placeholder:k(`sidebarFolderSearch`),onChange:e=>ue(e.target.value)}),Ge?(0,H.jsx)(`button`,{type:`button`,onClick:()=>ue(``),title:k(`sidebarClearFolderSearch`),"aria-label":k(`sidebarClearFolderSearch`),children:(0,H.jsx)(V,{size:12})}):null]})}),Ge&&Fe.length===0?(0,H.jsx)(`div`,{className:`ue-sidebar-empty`,children:k(`sidebarNoFolderMatches`)}):a===`tree`?(0,H.jsx)(`div`,{className:`ue-tree-panel`,children:Ue.map(e=>(0,H.jsx)(Ir,{node:e,depth:0,expandedPaths:U,selectedSubfolder:c,onToggle:Je,onSelect:f,onContextMenu:Ze,onFolderDragStart:nt,onFolderDragEnd:rt,onFolderDragOver:it,onFolderDrop:at,canDragFolder:et,pinnedFolders:j,searchActive:Ge,draggingPath:de,dropTargetPath:ve},e.path))}):(0,H.jsxs)(`div`,{className:`ue-tree-list ue-tree-list--flat`,children:[Ge?null:(0,H.jsxs)(`button`,{className:`ue-tree-item ue-tree-item--compact ${c===st&&l===``&&!u?`active`:``}`,onClick:()=>f(st),children:[(0,H.jsx)(ge,{size:15}),(0,H.jsx)(`span`,{children:`./`})]}),B.map(e=>(0,H.jsxs)(`button`,{className:`ue-tree-item ue-tree-item--compact ${c===e?`active`:``} ${Pt(e,j)?`is-pinned`:``} ${de===e?`is-dragging`:``} ${ve===e?`is-drop-target`:``}`,onClick:()=>f(e),onContextMenu:t=>Ze(t,e),draggable:et(e),onDragStart:t=>nt(t,e),onDragEnd:rt,onDragOver:t=>it(t,e),onDrop:t=>at(t,e),title:e,children:[(0,H.jsx)(ge,{size:15}),(0,H.jsx)(`span`,{children:Rt(e,i?.sources??[],Ie,Ce)}),Pt(e,j)?(0,H.jsx)(`span`,{className:`ue-pin-dot`,"aria-hidden":`true`}):null]},e))]})]}):null]}),(0,H.jsxs)(`div`,{className:`ue-sidebar-group`,children:[(0,H.jsxs)(`div`,{className:`ue-sidebar-group-header`,children:[(0,H.jsxs)(`button`,{className:`ue-sidebar-group-title`,onClick:()=>ot(`boards`),"aria-expanded":xe.has(`boards`),children:[(0,H.jsx)(`span`,{className:`ue-sidebar-group-chevron`,children:xe.has(`boards`)?(0,H.jsx)(ae,{size:13}):(0,H.jsx)(L,{size:13})}),(0,H.jsx)(`span`,{className:`ue-sidebar-group-icon`,children:(0,H.jsx)(be,{size:14})}),(0,H.jsx)(`strong`,{className:`ue-sidebar-group-name`,children:k(`sidebarBoards`)}),(0,H.jsx)(`span`,{className:`ue-sidebar-count-badge`,children:A.length})]}),(0,H.jsx)(`div`,{className:`ue-sidebar-subactions`,children:(0,H.jsx)(`button`,{className:`ue-sidebar-subaction`,onClick:g,title:k(`sidebarCreateBoard`),"aria-label":k(`sidebarCreateBoard`),children:(0,H.jsx)(pe,{size:14})})})]}),xe.has(`boards`)?(0,H.jsxs)(`div`,{className:`ue-board-list`,children:[(0,H.jsxs)(`button`,{className:`ue-board-list-item ${l===``&&u?`active`:``}`,onClick:h,children:[(0,H.jsx)(`span`,{className:`ue-board-cover ue-board-cover--empty`,children:(0,H.jsx)(Ae,{size:14})}),(0,H.jsx)(`span`,{children:k(`sidebarAllPins`)}),(0,H.jsx)(`em`,{children:i?.pinned_count??0})]}),A.map(e=>(0,H.jsxs)(`button`,{className:`ue-board-list-item ${l===e.id?`active`:``}`,onClick:()=>m(e.id),title:e.name,children:[(0,H.jsx)(`span`,{className:`ue-board-cover`,children:e.cover_image?(0,H.jsx)(`img`,{src:e.cover_image.thumb_url,alt:``,loading:`lazy`}):(0,H.jsx)(be,{size:14})}),(0,H.jsx)(`span`,{children:e.name}),(0,H.jsx)(`em`,{children:e.count})]},e.id))]}):null]}),(0,H.jsxs)(`div`,{className:`ue-sidebar-group`,children:[(0,H.jsx)(`div`,{className:`ue-sidebar-group-header`,children:(0,H.jsxs)(`button`,{className:`ue-sidebar-group-title`,onClick:()=>ot(`categories`),"aria-expanded":xe.has(`categories`),children:[(0,H.jsx)(`span`,{className:`ue-sidebar-group-chevron`,children:xe.has(`categories`)?(0,H.jsx)(ae,{size:13}):(0,H.jsx)(L,{size:13})}),(0,H.jsx)(`span`,{className:`ue-sidebar-group-icon`,children:(0,H.jsx)(ze,{size:14})}),(0,H.jsx)(`strong`,{className:`ue-sidebar-group-name`,children:k(`galleryAllCategories`)}),(0,H.jsx)(`span`,{className:`ue-sidebar-count-badge`,children:i?.categories.length??0})]})}),xe.has(`categories`)?(0,H.jsxs)(`div`,{className:`ue-tree-list ue-tree-list--compact`,children:[(0,H.jsxs)(`button`,{className:`ue-tree-item ue-tree-item--compact ${s===``?`active`:``}`,onClick:()=>d(``),children:[(0,H.jsx)(ze,{size:14}),(0,H.jsx)(`span`,{children:k(`galleryAllCategories`)})]}),(i?.categories??[]).map(e=>(0,H.jsxs)(`button`,{className:`ue-tree-item ue-tree-item--compact ${s===e?`active`:``}`,onClick:()=>d(e),children:[(0,H.jsx)(ze,{size:14}),(0,H.jsx)(`span`,{children:e})]},e))]}):null]})]})]}):(0,H.jsxs)(`div`,{className:`ue-sidebar-section ue-sidebar-section--grow`,children:[(0,H.jsxs)(`div`,{className:`ue-sidebar-heading`,children:[(0,H.jsx)(`span`,{children:k(`sidebarLibraries`)}),(0,H.jsx)(`span`,{children:T.length})]}),(0,H.jsxs)(`div`,{className:`ue-library-list`,role:`list`,"aria-label":k(`sidebarLibraries`),children:[T.length===0?(0,H.jsx)(`div`,{className:`ue-sidebar-empty`,children:k(`sidebarNoLibraries`)}):null,T.map(e=>(0,H.jsxs)(`div`,{role:`listitem`,className:`ue-library-list-item ${E===e.filename?`active`:``}`,children:[(0,H.jsxs)(`button`,{type:`button`,className:`ue-library-main`,"aria-current":E===e.filename?`page`:void 0,onClick:()=>D(e.filename),children:[(0,H.jsx)(M,{size:14}),(0,H.jsxs)(`span`,{children:[(0,H.jsx)(`strong`,{children:e.filename}),(0,H.jsx)(`small`,{children:k(`commonEntries`,{count:e.count})})]})]}),(0,H.jsx)(`button`,{type:`button`,className:`ue-library-delete`,onClick:()=>te(e.filename),"aria-label":`${k(`commonDelete`)} ${e.filename}`,children:(0,H.jsx)(Be,{size:14})})]},e.filename))]}),(0,H.jsxs)(`div`,{className:`ue-sidebar-create`,children:[(0,H.jsx)(`label`,{htmlFor:`ue-library-name`,children:k(`sidebarCreateLibrary`)}),(0,H.jsxs)(`div`,{className:`ue-sidebar-create-row`,children:[(0,H.jsx)(`input`,{id:`ue-library-name`,value:ne,placeholder:k(`sidebarCreateLibraryPlaceholder`),onChange:e=>re(e.target.value),onKeyDown:e=>{e.key===`Enter`&&O()}}),(0,H.jsx)(`button`,{onClick:O,"aria-label":k(`commonCreate`),children:(0,H.jsx)(pe,{size:15})})]})]})]}),se?(0,H.jsx)(S,{children:(0,H.jsxs)(`div`,{className:`ue-sidebar-action-menu`,style:{top:se.y,left:se.x},onClick:e=>e.stopPropagation(),onContextMenu:e=>e.preventDefault(),children:[(0,H.jsxs)(`button`,{onClick:()=>G(()=>o(a===`tree`?`list`:`tree`)),children:[(0,H.jsx)(he,{size:14}),(0,H.jsx)(`span`,{children:k(a===`tree`?`sidebarListView`:`sidebarTreeView`)})]}),a===`tree`?(0,H.jsxs)(`button`,{onClick:()=>G(Xe),children:[(0,H.jsx)(oe,{size:14}),(0,H.jsx)(`span`,{children:k(`sidebarExpandAll`)})]}):null,(0,H.jsxs)(`button`,{onClick:()=>G($e),children:[(0,H.jsx)(Te,{size:14}),(0,H.jsx)(`span`,{children:k(P===`modified`?`folderSortByName`:`folderSortByModified`)})]}),(0,H.jsxs)(`button`,{onClick:()=>G(()=>Qe(c)),disabled:!Oe,children:[(0,H.jsx)(Ae,{size:14,fill:c&&Pt(c,j)?`currentColor`:`none`}),(0,H.jsx)(`span`,{children:c&&Pt(c,j)?k(`folderUnpin`):k(`folderPin`)})]}),(0,H.jsxs)(`button`,{onClick:()=>G(()=>b(c)),disabled:!ke,title:ke?void 0:He,children:[(0,H.jsx)(z,{size:14}),(0,H.jsx)(`span`,{children:k(`folderRename`)})]}),(0,H.jsxs)(`button`,{onClick:()=>G(()=>y(c)),disabled:!ke,title:ke?void 0:He,children:[(0,H.jsx)(ie,{size:14}),(0,H.jsx)(`span`,{children:k(`sidebarMergeFolder`)})]}),(0,H.jsxs)(`button`,{onClick:()=>G(()=>v(c)),disabled:!ke,className:`is-danger`,title:ke?void 0:He,children:[(0,H.jsx)(Be,{size:14}),(0,H.jsx)(`span`,{children:k(`sidebarDeleteFolder`)})]}),a===`tree`?(0,H.jsxs)(`button`,{onClick:()=>G(Ye),children:[(0,H.jsx)(De,{size:14}),(0,H.jsx)(`span`,{children:k(`sidebarCollapseAll`)})]}):null]})}):null,I?(0,H.jsx)(S,{children:(0,H.jsxs)(`div`,{className:`ue-sidebar-context-menu`,style:{top:I.y,left:I.x},onClick:e=>e.stopPropagation(),onContextMenu:e=>e.preventDefault(),children:[(0,H.jsxs)(`button`,{className:`ue-sidebar-context-item`,onClick:()=>{b(I.path),R(null)},children:[(0,H.jsx)(z,{size:14}),(0,H.jsx)(`span`,{children:k(`folderRename`)})]}),(0,H.jsxs)(`button`,{className:`ue-sidebar-context-item`,onClick:()=>{Qe(I.path),R(null)},children:[(0,H.jsx)(Ae,{size:14,fill:Pt(I.path,j)?`currentColor`:`none`}),(0,H.jsx)(`span`,{children:Pt(I.path,j)?k(`folderUnpin`):k(`folderPin`)})]}),(0,H.jsxs)(`button`,{className:`ue-sidebar-context-item`,onClick:()=>{y(I.path),R(null)},children:[(0,H.jsx)(ie,{size:14}),(0,H.jsx)(`span`,{children:k(`sidebarMergeFolder`)})]}),(0,H.jsxs)(`button`,{className:`ue-sidebar-context-item ue-sidebar-context-item--danger`,onClick:()=>{v(I.path),R(null)},children:[(0,H.jsx)(Be,{size:14}),(0,H.jsx)(`span`,{children:k(`sidebarDeleteFolder`)})]})]})}):null]})},Rr=({open:e,title:t,text:r,label:i,placeholder:a=``,initialValue:o=``,confirmLabel:s,onClose:c,onSubmit:l})=>{let{t:u}=n(),[d,f]=(0,p.useState)(o),[m,h]=(0,p.useState)(!1);if((0,p.useEffect)(()=>{e&&(f(o),h(!1))},[o,e]),!e)return null;let g=d.trim();return(0,H.jsx)(`div`,{className:`ue-modal-backdrop`,onClick:c,children:(0,H.jsxs)(`form`,{className:`ue-library-modal ue-dialog-modal ue-text-input-modal`,onClick:e=>e.stopPropagation(),onSubmit:async e=>{if(e.preventDefault(),!(!g||m)){h(!0);try{await l(g),h(!1),c()}catch{h(!1)}}},children:[(0,H.jsx)(`button`,{className:`ue-modal-close ue-modal-close--light`,onClick:c,"aria-label":u(`modalClose`),type:`button`,children:(0,H.jsx)(V,{size:18})}),(0,H.jsxs)(`div`,{className:`ue-pane-copy ue-dialog-heading`,children:[(0,H.jsx)(`h2`,{children:t}),(0,H.jsx)(`p`,{children:r})]}),(0,H.jsxs)(`label`,{className:`ue-import-text-field ue-dialog-field`,children:[(0,H.jsx)(`span`,{children:i}),(0,H.jsx)(`input`,{autoFocus:!0,value:d,onChange:e=>f(e.target.value),placeholder:a})]}),(0,H.jsxs)(`div`,{className:`ue-library-modal-actions ue-dialog-actions`,children:[(0,H.jsxs)(`button`,{className:`ue-secondary-btn`,onClick:c,type:`button`,children:[(0,H.jsx)(V,{size:14}),(0,H.jsx)(`span`,{children:u(`libraryCancel`)})]}),(0,H.jsxs)(`button`,{className:`ue-primary-btn`,disabled:!g||m,"aria-label":s,title:s,type:`submit`,children:[(0,H.jsx)(F,{size:14}),(0,H.jsx)(`span`,{children:s})]})]})]})})},zr=12,Br=14,Vr=(e,t,n)=>Math.max(t,Math.min(e,Math.max(t,n)));function Hr(e,t,n){let r=Math.min(t.width,n.width-zr*2),i=Math.min(t.height,n.height-zr*2);if(!e)return{left:(n.width-r)/2,top:(n.height-i)/2,side:`center`};let a=e.left+e.width/2-r/2,o=e.top+e.height/2-i/2,s=[{left:a,top:e.top+e.height+Br,side:`bottom`},{left:a,top:e.top-i-Br,side:`top`},{left:e.left+e.width+Br,top:o,side:`right`},{left:e.left-r-Br,top:o,side:`left`}].map(e=>({...e,left:Vr(e.left,zr,n.width-r-zr),top:Vr(e.top,zr,n.height-i-zr)})),c=t=>Math.max(0,Math.min(t.left+t.width,e.left+e.width)-Math.max(t.left,e.left))*Math.max(0,Math.min(t.top+t.height,e.top+e.height)-Math.max(t.top,e.top));return s.sort((e,t)=>c({...e,width:r,height:i})-c({...t,width:r,height:i}))[0]}function Ur(e,t,n){return!e||Math.max(e.left-zr-Br,n.width-e.left-e.width-zr-Br)>=t?n.height-zr*2:Math.max(140,Math.max(e.top-zr-Br,n.height-e.top-e.height-zr-Br))}var Wr=[{id:`welcome`,title:`tourWelcomeTitle`,body:`tourWelcomeBody`},{id:`topbar`,target:`workspace-switcher`,title:`tourTopbarTitle`,body:`tourTopbarBody`},{id:`sidebar`,target:`sidebar-folders`,tab:`gallery`,sidebar:!0,title:`tourSidebarTitle`,body:`tourSidebarBody`},{id:`gallery`,target:`gallery-search`,tab:`gallery`,title:`tourGalleryTitle`,body:`tourGalleryBody`},{id:`density`,target:`gallery-density`,tab:`gallery`,title:`tourDensityTitle`,body:`tourDensityBody`},{id:`selection`,target:`gallery-selection`,tab:`gallery`,title:`tourSelectionTitle`,body:`tourSelectionBody`},{id:`detail`,target:`gallery-card`,tab:`gallery`,title:`tourDetailTitle`,body:`tourDetailBody`},{id:`library`,target:`library-actions`,tab:`library`,title:`tourLibraryTitle`,body:`tourLibraryBody`},{id:`workbench`,target:`workbench-generator`,tab:`workbench`,title:`tourWorkbenchTitle`,body:`tourWorkbenchBody`},{id:`settings`,target:`settings-onboarding`,tab:`settings`,title:`tourSettingsTitle`,body:`tourSettingsBody`},{id:`done`,title:`tourDoneTitle`,body:`tourDoneBody`}],Gr=e=>{let{open:t,onSkip:r,onComplete:i}=e,{t:a}=n(),[o,s]=(0,p.useState)(0),[c,l]=(0,p.useState)(null),[u,d]=(0,p.useState)(!1),[f,m]=(0,p.useState)({width:window.innerWidth,height:window.innerHeight}),[g,_]=(0,p.useState)({width:352,height:250}),v=(0,p.useRef)(null),y=(0,p.useRef)(e);(0,p.useEffect)(()=>{y.current=e});let b=Wr[o];if((0,p.useEffect)(()=>{t||s(0)},[t]),(0,p.useEffect)(()=>{if(!t)return;let e=document.activeElement instanceof HTMLElement?document.activeElement:null,n=document.getElementById(`root`),r=n?.inert??!1;n&&(n.inert=!0),v.current?.focus({preventScroll:!0});let i=e=>{if(e.key===`Escape`){e.preventDefault(),y.current.onSkip();return}if(e.key!==`Tab`)return;let t=Array.from(v.current?.querySelectorAll(`button:not(:disabled)`)??[]),n=t[0],r=t[t.length-1];n&&(e.shiftKey&&(document.activeElement===n||document.activeElement===v.current)?(e.preventDefault(),r.focus()):!e.shiftKey&&(document.activeElement===r||document.activeElement===v.current)&&(e.preventDefault(),n.focus()))};return document.addEventListener(`keydown`,i,!0),()=>{document.removeEventListener(`keydown`,i,!0),n&&(n.inert=r),e?.isConnected&&!e.closest(`[inert]`)&&e.focus({preventScroll:!0})}},[t]),(0,p.useEffect)(()=>{if(!t)return;l(null),d(!1),b.tab&&y.current.onRequestTabChange(b.tab),b.sidebar?y.current.onRequestSidebarOpen():window.innerWidth<=960&&y.current.onRequestSidebarClose?.();let e=0,n=!1,r=!1,i=null,a=typeof ResizeObserver<`u`?new ResizeObserver(()=>s()):null,o=()=>{if(e=0,r)return;let t=window.innerWidth,o=window.innerHeight;m(e=>e.width===t&&e.height===o?e:{width:t,height:o});let s=v.current?.getBoundingClientRect();s?.height&&_(e=>e.width===s.width&&e.height===s.height?e:{width:s.width,height:s.height});let c=b.target?document.querySelector(`[data-tour-id="${b.target}"]`):null;if(c!==i&&(i&&a?.unobserve(i),i=c,c&&a?.observe(c)),!c){l(null);return}let u=c.getBoundingClientRect();if(!u.width||!u.height){l(null);return}n||(n=!0,(u.top<65||u.top>o*.55)&&(c.scrollIntoView?.({block:`start`,inline:`nearest`,behavior:`instant`}),u=c.getBoundingClientRect()));let f=Math.max(8,u.left-6),p=Math.max(8,u.top-6),h={left:f,top:p,width:Math.max(0,Math.min(u.right+6,t-8)-f),height:Math.max(0,Math.min(u.bottom+6,p+(b.id===`sidebar`?112:100),o-8)-p)};if(!h.width||!h.height){l(null);return}l(e=>e&&Object.keys(h).every(t=>Math.abs(e[t]-h[t])<.5)?e:h),d(!1)};function s(){!e&&!r&&(e=window.requestAnimationFrame(o))}let c=new MutationObserver(e=>{e.some(e=>!(e.target instanceof Element&&e.target.closest(`.ue-onboarding-layer`)))&&s()});c.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`class`,`style`,`open`,`inert`]}),v.current&&a?.observe(v.current),s();let u=window.setTimeout(()=>d(!0),1400);return window.addEventListener(`resize`,s),window.addEventListener(`scroll`,s,!0),document.addEventListener(`transitionend`,s,!0),()=>{r=!0,window.cancelAnimationFrame(e),window.clearTimeout(u),a?.disconnect(),c.disconnect(),window.removeEventListener(`resize`,s),window.removeEventListener(`scroll`,s,!0),document.removeEventListener(`transitionend`,s,!0)}},[t,b]),!t)return null;let x=Hr(c,g,f),S=o===Wr.length-1,C=c?`M${c.left},${c.top}h${c.width}v${c.height}h-${c.width}Z`:``;return(0,h.createPortal)((0,H.jsxs)(`div`,{className:`ue-onboarding-layer`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`ue-onboarding-title`,"aria-describedby":`ue-onboarding-body`,children:[(0,H.jsx)(`svg`,{className:`ue-onboarding-scrim`,"aria-hidden":`true`,width:`100%`,height:`100%`,children:(0,H.jsx)(`path`,{d:`M0,0H${f.width}V${f.height}H0Z ${C}`,fillRule:`evenodd`})}),c?(0,H.jsx)(`div`,{className:`ue-onboarding-highlight`,"data-target":b.target,style:{left:c.left,top:c.top,width:c.width,height:c.height}}):null,(0,H.jsxs)(`article`,{ref:v,tabIndex:-1,className:`ue-onboarding-card`,"data-step":b.id,"data-placement":x.side,style:{left:x.left,top:x.top,maxHeight:Ur(c,g.width,f)},children:[(0,H.jsxs)(`header`,{className:`ue-onboarding-progress`,children:[(0,H.jsx)(`span`,{children:a(`tourStepProgress`,{page:o+1,totalPages:Wr.length})}),(0,H.jsx)(`button`,{className:`ue-onboarding-close`,type:`button`,onClick:r,"aria-label":a(`tourClose`),children:(0,H.jsx)(V,{size:17})})]}),(0,H.jsx)(`div`,{className:`ue-onboarding-meter`,"aria-hidden":`true`,children:(0,H.jsx)(`span`,{style:{width:`${(o+1)/Wr.length*100}%`}})}),(0,H.jsxs)(`div`,{className:`ue-onboarding-content`,"aria-live":`polite`,"aria-atomic":`true`,children:[(0,H.jsx)(`h2`,{id:`ue-onboarding-title`,children:a(b.title)}),(0,H.jsx)(`p`,{id:`ue-onboarding-body`,children:a(b.body)}),b.target&&!c&&u?(0,H.jsx)(`small`,{children:a(`tourTargetMissing`)}):null]}),(0,H.jsxs)(`footer`,{className:`ue-onboarding-actions`,children:[(0,H.jsx)(`button`,{type:`button`,className:`ue-tour-skip`,onClick:r,children:a(`tourSkip`)}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`button`,{type:`button`,className:`ue-tour-back`,onClick:()=>s(e=>Math.max(0,e-1)),disabled:!o,"aria-label":a(`tourPrevious`),children:(0,H.jsx)(I,{size:17})}),(0,H.jsxs)(`button`,{type:`button`,className:`ue-tour-next`,onClick:()=>S?i():s(e=>e+1),children:[(0,H.jsx)(`span`,{children:a(S?`tourFinish`:`tourNext`)}),S?(0,H.jsx)(F,{size:16}):(0,H.jsx)(L,{size:16})]})]})]})]})]}),document.body)},Kr=new Map,qr=class extends Error{jobId;scope;constructor(e,t,n){super(e),this.jobId=t,this.scope=n}},Jr=()=>new DOMException(`Aborted`,`AbortError`),Yr=e=>new Promise((t,n)=>{if(e.aborted){n(Jr());return}let r=()=>{window.clearTimeout(i),n(Jr())},i=window.setTimeout(()=>{e.removeEventListener(`abort`,r),t()},250);e.addEventListener(`abort`,r,{once:!0})}),Xr=(e,t)=>{if(t.aborted)return Promise.reject(Jr());if(typeof G.createJob!=`function`)return Promise.resolve(!0);let n=Kr.get(``)??Kr.get(e);if(!n||n.controller.signal.aborted){let t={controller:new AbortController,clients:0,promise:Promise.resolve(!1)};n=t,Kr.set(e,t),t.promise=(async()=>{try{let n=await G.createJob(`refresh_index`,{subfolder:e,force:!0}).catch(e=>{if(e instanceof Ze&&[404,405].includes(e.status))return null;throw e});if(!n)return!0;let{job:r}=n;for(;[`queued`,`running`,`cancelling`].includes(r.state);)await Yr(t.controller.signal),r=(await G.getJob(r.id,t.controller.signal)).job;if(r.state!==`succeeded`)throw new qr(r.error||`Index sync: ${r.state}`,r.id,e);return!1}finally{Kr.get(e)===t&&Kr.delete(e)}})()}let r=n;return r.clients++,new Promise((e,n)=>{let i=!1,a=()=>i?!1:(i=!0,t.removeEventListener(`abort`,o),--r.clients===0&&r.controller.abort(),!0),o=()=>{a()&&n(Jr())};t.addEventListener(`abort`,o,{once:!0}),r.promise.then(t=>{a()&&e(t)},e=>{a()&&n(e)})})},Zr=`universal-extractor-gallery-events`,Qr=e=>{if(!e||typeof e!=`object`)return!1;let t=e;return t.version===1&&t.type===`outputs-changed`&&typeof t.prompt_id==`string`&&t.prompt_id.length>0&&t.prompt_id.length<=200},$r=e=>{let t=(0,p.useRef)(0),n=(0,p.useRef)(0),r=(0,p.useRef)(new Set),i=(0,p.useRef)(new Map),a=(0,p.useRef)(new Map),o=(0,p.useRef)(e);(0,p.useEffect)(()=>{o.current=e}),(0,p.useEffect)(()=>{if(!e.enabled||typeof BroadcastChannel>`u`)return;let n=new BroadcastChannel(Zr);return n.onmessage=({data:e})=>{!Qr(e)||r.current.has(e.prompt_id)||(r.current.add(e.prompt_id),r.current.size>256&&r.current.delete(r.current.values().next().value),t.current++,window.dispatchEvent(new Event(`universal-gallery:outputs-dirty`)))},()=>n.close()},[e.enabled]),(0,p.useEffect)(()=>{if(!e.enabled||!e.active||!e.loaded)return;let r=new AbortController,{signal:s}=r,c=!1,l,u=0,d=e=>{window.clearTimeout(l),l=window.setTimeout(()=>{f()},e)},f=async()=>{if(s.aborted||c||document.visibilityState===`hidden`||a.current.get(e.scope)===t.current)return;c=!0;let r=t.current,l=r!==n.current,f=i.current.get(e.scope)??``;try{let t=await G.getImageFreshness(e.scope,f,s);if(s.aborted)return;if(l||!f||t.changed){let t=await Xr(l?``:e.scope,s);if(s.aborted||(await o.current.refresh(t,s),s.aborted))return;n.current=r}i.current.set(e.scope,t.fingerprint),a.current.delete(e.scope),u=0}catch(n){if(s.aborted)return;(n instanceof TypeError||n instanceof Ze&&[502,503,504].includes(n.status))&&u<2?d([2e3,1e4][u++]):(a.current.set(e.scope,r),o.current.onError(n,()=>{u=0,t.current++,window.dispatchEvent(new Event(`universal-gallery:outputs-dirty`))}))}finally{c=!1,!s.aborted&&t.current!==r&&d(1e3)}},p=()=>{u=0,c||d(1e3)},m=()=>{document.visibilityState===`visible`&&d(0)},h=window.setInterval(()=>{f()},15e3);return window.addEventListener(`universal-gallery:outputs-dirty`,p),window.addEventListener(`focus`,m),document.addEventListener(`visibilitychange`,m),d(1e3),()=>{r.abort(),window.clearTimeout(l),window.clearInterval(h),window.removeEventListener(`universal-gallery:outputs-dirty`,p),window.removeEventListener(`focus`,m),document.removeEventListener(`visibilitychange`,m)}},[e.enabled,e.active,e.loaded,e.scope,e.viewKey])},ei=e=>{let t=(0,p.useRef)(new Map),n=(0,p.useCallback)((e,n,r)=>{let i=t.current.get(e);i&&(i.parts.delete(n),r&&(i.error??=r),i.parts.size||(t.current.delete(e),i.error?i.reject(i.error):i.resolve()))},[]);return(0,p.useEffect)(()=>{let n=t.current;return()=>{n.forEach(t=>t.reject(Error(e))),n.clear()}},[e]),{completeRefreshPart:n,waitForRefresh:e=>new Promise((n,r)=>{let i=e();t.current.set(i,{parts:new Set([`context`,`images`]),error:null,resolve:n,reject:r})})}},ti=e=>{let{t}=n(),{page:r,deferredSearchTerm:i,selectedCategory:a,selectedSubfolder:o,selectedBoardId:s,dateFrom:c,dateTo:l,favoritesOnly:u,selectedColorFamily:d,sortBy:f,sortOrder:m,refreshKey:h,refreshIndex:g=!0,isTrashView:_,isActive:v,scheduleThumbnailPrewarm:y,liveRefreshViewKey:b,completeRefreshPart:x}=e,[S,C]=(0,p.useState)([]),[w,T]=(0,p.useState)(null),[ee,E]=(0,p.useState)(null),[D,te]=(0,p.useState)(0),[ne,re]=(0,p.useState)(!0),[O,k]=(0,p.useState)(!1),[A,ie]=(0,p.useState)(null),[j,M]=(0,p.useState)([]),N=(0,p.useRef)(!1),P=(0,p.useRef)(!1),F=(0,p.useRef)(0),ae=(0,p.useRef)(0),[I,L]=(0,p.useState)(null),R=(0,p.useRef)(null);return(0,p.useEffect)(()=>{let e=!1,n=new AbortController,r=h>0&&F.current!==h;return r&&(F.current=h),(async()=>{let i;try{let a=r&&g?await Xr(``,n.signal):!1;if(e)return;let o=await G.getContext(a,n.signal);if(e)return;if(T(o),E(o.color_index_status??null),o.index_error||o.catalog_error){let e=o.index_error||o.catalog_error||t(`galleryLoading`);ie(e),i=Error(e)}}catch(n){e||(i=n instanceof Error?n:Error(t(`galleryLoading`)),ie(i.message))}finally{e||x(h,`context`,i)}})(),()=>{e=!0,n.abort(),r&&x(h,`context`,Error(t(`galleryRefreshInterrupted`)))}},[x,h,g,t]),(0,p.useEffect)(()=>{let e=!1,n=new AbortController,p=h>0&&ae.current!==h;if(!v&&!p)return;p&&(ae.current=h);let S=R.current===b;return S?k(!0):(re(!0),k(!1)),ie(null),(async()=>{let v,w=!1;try{if(_){let t=await G.listTrash(n.signal);if(e)return;M(t),te(t.length);return}let t=p&&g?await Xr(o,n.signal):!1;if(e)return;let h=await G.listImages(r,48,i,a,o,s,c,l,u,d,f,m,t,n.signal);if(e)return;if(C(h.images??[]),w=!0,M([]),te(h.total??0),E(h.color_index_status??null),h.index_error&&(ie(h.index_error),v=Error(h.index_error)),p){let t=await G.getContext(!1,n.signal);e||(T(t),E(t.color_index_status??h.color_index_status??null),t.index_error&&(ie(t.index_error),v=Error(t.index_error)))}e||y(h.images??[])}catch(n){e||(!S&&!w&&(C([]),M([]),te(0)),v=n instanceof Error?n:Error(t(`galleryLoading`)),ie(v.message))}finally{e||(x(h,`images`,v),R.current=b,L(b),_?P.current=!0:N.current=!0,re(!1),k(!1))}})(),()=>{e=!0,n.abort(),p&&x(h,`images`,Error(t(`galleryRefreshInterrupted`)))}},[r,i,a,o,s,c,l,u,d,f,m,h,g,t,_,v,y,b,x]),{images:S,setImages:C,context:w,setContext:T,colorIndexStatus:ee,setColorIndexStatus:E,total:D,setTotal:te,isLoading:ne,isRefreshing:O,error:A,trashItems:j,setTrashItems:M,hasLoadedImagesRef:N,loadedViewKey:I}},ni=(e,t,n)=>{let r=t.states?.[e.relative_path];if(r)return{...e,...r};let i={};for(let e of Object.keys(n))[`favorite`,`pinned`,`boards`,`category`,`title`,`notes`].includes(e)&&(i[e]=t.last_state?.[e]??n[e]);return(`pinned`in i||`favorite`in i)&&(i.pinned=!!(i.pinned??i.favorite),i.favorite=i.pinned,!i.pinned&&!(`boards`in n)&&(i.boards=[])),{...e,...i}},ri=(e,t)=>Array.isArray(e)?e.filter(e=>typeof e==`string`):typeof e==`string`?[e]:t,ii=({selectedImage:e,setImages:t,setSelectedImage:r,setSelectedImagePaths:i,applyContextPatch:a,refresh:o,stateFiltersActive:s})=>{let{t:c}=n();return{batchUpdateImages:async(n,c)=>{let l=`pinned`in c||`favorite`in c,u=new Set(n),d=new Map,f=e;if(l){let e=!!(c.pinned??c.favorite);t(t=>t.map(t=>u.has(t.relative_path)?(d.set(t.relative_path,t),{...t,favorite:e,pinned:e}):t)),r(t=>t&&u.has(t.relative_path)?{...t,favorite:e,pinned:e}:t)}let p;try{p=await G.batchUpdateImages(n,c)}catch(e){throw d.size>0&&t(e=>e.map(e=>d.get(e.relative_path)??e)),r(f),e}let m=ri(p.updated,n);a(e=>({...e,categories:p.categories??e.categories,boards:p.boards??e.boards,pinned_count:l?Math.max(0,e.pinned_count+m.reduce((e,t)=>{let n=d.get(t);return!n||!p.last_state||typeof p.last_state.pinned!=`boolean`?e:e+ +!!p.last_state.pinned-+!!n.pinned},0)):e.pinned_count}));let h=new Set(m);return t(e=>e.map(e=>h.has(e.relative_path)?ni(e,p,c):d.get(e.relative_path)??e)),r(e=>e&&h.has(e.relative_path)?ni(e,p,c):e&&f?.relative_path===e.relative_path&&u.has(e.relative_path)?f:e),i(e=>e.filter(e=>!h.has(e))),s&&o(),{...p,updated:m}},moveImages:async(e,t,n=``)=>{let r=await G.moveImages(e,t,n);if(!r.ok)throw Error(c(`dual_moveError`));a(e=>({...e,categories:r.categories??e.categories,subfolders:r.subfolders??e.subfolders}));let{movedSources:s}=en(e,r);return i(e=>e.filter(e=>!s.has(e))),o(),r},batchRenameImages:async(e,t,n,r,a)=>{let s=await G.batchRenameImages(e,t,n,r,a);return i([]),o(),s},deleteImages:async e=>{let t=await G.deleteImages(e);if(!t.ok)throw Error(c(`dual_deleteError`));a(e=>({...e,categories:t.categories??e.categories}));let{deletedPaths:n}=tn(e,t);return i(e=>e.filter(e=>!n.has(e))),o(),t}}},ai=async(e,t)=>{let n=[...new Set(e)],r=[],i=``;for(let e of n)try{if(!(await t(e)).ok)throw Error(`Trash operation was not committed`);r.push(e)}catch(e){i=e instanceof Error?e.message:String(e);break}return{completed:r,unfinished:n.slice(r.length),error:i}},oi=`__trash__`,si=`default_output::`,ci=`::`,li=24,ui=[],di=[],fi=e=>e.includes(ci)?`${e.split(ci,1)[0]}${ci}`:si,pi=(e={})=>{let t=e.isActive??!0,r=e.liveRefreshEnabled??!0,i=e.thumbnailPrewarmEnabled??!0,{t:a}=n(),[o,s]=(0,p.useState)(()=>e.initialScope?.page??1),[c,l]=(0,p.useState)(()=>e.initialScope?.query??``),[u,d]=(0,p.useState)(()=>e.initialScope?.category??``),[f,m]=(0,p.useState)(()=>e.initialScope?.folder??si),[h,g]=(0,p.useState)(()=>e.initialScope?.board??``),[_,v]=(0,p.useState)(()=>e.initialScope?.dateFrom??``),[y,b]=(0,p.useState)(()=>e.initialScope?.dateTo??``),[x,S]=(0,p.useState)(()=>e.initialScope?.favorites??!1),[C,w]=(0,p.useState)(()=>e.initialScope?.color??``),[T,ee]=(0,p.useState)(()=>e.initialScope?.sort??`created_at`),[E,D]=(0,p.useState)(()=>e.initialScope?.order??`desc`),[te,ne]=(0,p.useState)(()=>{let e=pt(`universal-extractor:grid-columns`),t=Number(e);return Number.isFinite(t)&&t>=3&&t<=8?t:6}),[re,O]=(0,p.useState)(!1),[k,A]=(0,p.useState)(null),[ie,j]=(0,p.useState)(null),[M,N]=(0,p.useState)([]),[P,F]=(0,p.useState)(``),[ae,I]=(0,p.useState)(``),[{key:L,scan:R},oe]=(0,p.useState)({key:0,scan:!1}),se=(0,p.useRef)(!1),[ce,le]=(0,p.useState)(!1),ue=(0,p.useRef)(0),{completeRefreshPart:de,waitForRefresh:fe}=ei(a(`galleryRefreshInterrupted`)),[pe,me]=(0,p.useState)(null),he=(0,p.useRef)(null),ge=(0,p.useRef)(null),[_e,ve]=(0,p.useState)(c);(0,p.useEffect)(()=>{if(c===_e)return;let e=window.setTimeout(()=>ve(c),c?280:0);return()=>window.clearTimeout(e)},[_e,c]);let ye=(0,p.useDeferredValue)(_e),be=f===oi,xe=(0,p.useMemo)(()=>JSON.stringify({subfolder:f,search:ye,category:u,board:h,dateFrom:_,dateTo:y,favoritesOnly:x,color:C,sortBy:T,sortOrder:E,page:o}),[_,y,ye,x,o,h,u,C,f,T,E]),Se=(0,p.useCallback)(()=>{let e=window;ge.current!==null&&(e.cancelIdleCallback?.(ge.current),ge.current=null),he.current!==null&&(window.clearTimeout(he.current),he.current=null)},[]),Ce=(0,p.useCallback)(e=>{if(!i)return;let t=e.slice(0,li).map(e=>e.relative_path);if(!t.length)return;Se();let n=()=>{ge.current=null,he.current=null,G.prewarmThumbnails(t,li).catch(()=>void 0)},r=window;if(typeof r.requestIdleCallback==`function`){ge.current=r.requestIdleCallback(n,{timeout:1500});return}he.current=window.setTimeout(n,250)},[Se,i]);(0,p.useEffect)(()=>{i||Se()},[Se,i]),(0,p.useEffect)(()=>()=>Se(),[Se]),(0,p.useEffect)(()=>{mt(`universal-extractor:grid-columns`,String(te))},[te]);let{images:we,setImages:Te,context:Ee,setContext:De,colorIndexStatus:Oe,setColorIndexStatus:ke,total:z,setTotal:Ae,isLoading:je,isRefreshing:Me,error:Ne,trashItems:Pe,loadedViewKey:Fe}=ti({page:o,deferredSearchTerm:ye,selectedCategory:u,selectedSubfolder:f,selectedBoardId:h,dateFrom:_,dateTo:y,favoritesOnly:x,selectedColorFamily:C,sortBy:T,sortOrder:E,refreshKey:L,refreshIndex:R,isTrashView:be,isActive:t,scheduleThumbnailPrewarm:Ce,liveRefreshViewKey:xe,completeRefreshPart:de});$r({enabled:r,active:t&&!be,scope:f,viewKey:xe,loaded:Fe===xe&&!je,onError:(e,t)=>me({error:e,retry:t}),refresh:async(t,n)=>{let r=await G.listImages(o,48,ye,u,f,h,_,y,x,C,T,E,t,n),i=await G.getContext(!1,n);n.aborted||(De(i),ke(i.color_index_status??r.color_index_status??null),me(null),window.dispatchEvent(new Event(`universal-gallery:index-synced`)),o===1&&T===`created_at`&&E===`desc`&&!e.interactionBlocked&&M.length===0&&!k&&!document.querySelector(`[data-gallery-interacting="true"]`)&&(document.querySelector(`.ue-main-shell`)?.scrollTop??0)<=80?(Te(r.images??[]),Ae(r.total??0),O(!1),Ce(r.images??[])):O(!0))}}),(0,p.useEffect)(()=>{O(!1)},[xe]),(0,p.useEffect)(()=>{if(!t||!Oe||Oe.complete||be)return;let e=window.setInterval(()=>{G.getColorIndexStatus().then(ke).catch(()=>void 0)},5e3);return()=>window.clearInterval(e)},[Oe,be,t,ke]);let B=(0,p.useCallback)((e=!0)=>{let t=++ue.current;return O(!1),oe({key:t,scan:e}),t},[]),Ie=e=>{s(e.page),l(e.query),ve(e.query),m(e.folder),g(e.board),d(e.category),v(e.dateFrom),b(e.dateTo),S(e.favorites),w(e.color),ee(e.sort),D(e.order),N([]),A(null),j(null)},Le=()=>{B()},Re=()=>fe(B),ze=e=>{De(t=>t&&e(t))},Be=async(e,t)=>{let n=`pinned`in t||`favorite`in t,r=null,i=null;if(n){let n=!!(t.pinned??t.favorite);Te(t=>t.map(t=>t.relative_path===e?(r=t,{...t,favorite:n,pinned:n}):t)),A(t=>!t||t.relative_path!==e?t:(i=t,{...t,favorite:n,pinned:n}))}let a;try{a=await G.updateImageState(e,t)}catch(t){if(r){let t=r;Te(n=>n.map(n=>n.relative_path===e?t:n))}if(i){let t=i;A(n=>n&&n.relative_path===e?t:n)}throw t}ze(e=>{let t=n&&r&&typeof a.state.pinned==`boolean`?!!a.state.pinned-+!!r.pinned:0;return{...e,categories:a.categories??e.categories,boards:a.boards??e.boards,pinned_count:Math.max(0,e.pinned_count+t)}}),Te(t=>t.map(t=>t.relative_path===e?{...t,...a.state}:t)),A(t=>t&&t.relative_path===e?{...t,...a.state}:t),!n&&(ye.trim()||u||h)&&Le()},{batchUpdateImages:Ve,moveImages:He,batchRenameImages:V,deleteImages:H}=ii({selectedImage:k,setImages:Te,setSelectedImage:A,setSelectedImagePaths:N,applyContextPatch:ze,refresh:Le,stateFiltersActive:!!(ye.trim()||u||h||x)}),Ue=async(e,t)=>{let n=await G.renameImage(e,t);return ze(e=>({...e,categories:n.categories??e.categories})),A(t=>t&&t.relative_path===e?n.image:t),N(t=>t.map(t=>t===e?n.image.relative_path:t)),Le(),n},U=async e=>{let t=await G.createFolder(e);return ze(e=>({...e,subfolders:t.subfolders??e.subfolders})),t.path&&(m(t.path),g(``),S(!1),s(1)),t},We=async e=>{let t=await G.deleteFolder(e);return ze(e=>({...e,subfolders:t.subfolders??e.subfolders,categories:t.categories??e.categories})),(f===e||f.startsWith(`${e}/`))&&m(fi(e)),Le(),t},Ge=async(e,t)=>{let n=await G.mergeFolder(e,t);return ze(e=>({...e,subfolders:n.subfolders??e.subfolders,categories:n.categories??e.categories})),(f===e||f.startsWith(`${e}/`))&&m(n.target_path??t),Le(),n},Ke=async(e,t)=>{let n=await G.renameFolder(e,t);if(ze(e=>({...e,subfolders:n.subfolders??e.subfolders,categories:n.categories??e.categories})),f===e||f.startsWith(`${e}/`)){let r=f.slice(e.length);m(`${n.target_path??t}${r}`)}return Le(),n},qe=async(e,t=``)=>{F(``),I(``);let n=await G.importFiles(e,t),r=n.imported_images.length+n.imported_libraries.length,i=n.skipped.length,o=n.imported_images[0]?.relative_path??``,s=o.includes(`/`)?o.slice(0,o.lastIndexOf(`/`)):``,c=s&&!s.includes(ci)?`${si}${s}`:s;I(c);let l=fi(c).replace(ci,``),u=Ee?.sources.find(e=>e.id===l)?.name||l,d=c.split(ci).pop()||Ee?.import_image_subfolder||`universal_gallery_imports`,f=[];return r>0&&f.push(a(`galleryImportSuccess`,{count:r})),n.imported_images.length&&f.push(a(`galleryImportSavedTo`,{target:`${u} / ${d}/`})),n.imported_libraries.length&&f.push(a(`galleryImportLibrariesSavedTo`,{count:n.imported_libraries.length})),i>0&&f.push(a(`galleryImportSkipped`,{count:i})),F(f.join(` · `)),(0,p.startTransition)(()=>{Le()}),n},Je=(0,p.useMemo)(()=>Ee?.move_targets??[],[Ee?.move_targets]),Ye=(0,p.useMemo)(()=>Ee?.boards??[],[Ee?.boards]),Xe=e=>{ze(t=>({...t,boards:e}))},Ze=async(e,t=``)=>{let n=await G.createBoard(e,t);return Xe(n.boards??Ye),n},W=async(e,t)=>{let n=await G.updateBoard(e,t);return Xe(n.boards??Ye),n},Qe=async e=>{let t=await G.deleteBoard(e);return ze(e=>({...e,boards:t.boards??e.boards,categories:t.categories??e.categories})),h===e&&g(``),Le(),t},$e=async(e,t,n=!0)=>{let r=await G.updateBoardPins(e,t,n);return ze(e=>({...e,boards:r.boards??e.boards,categories:r.categories??e.categories})),Le(),r},et=async(e,t)=>{if(se.current)throw Error(a(`trashOperationBusy`));se.current=!0,le(!0);try{let n=await ai(e,e=>t?G.restoreTrashItem(e):G.purgeTrashItem(e)),r=new Set(n.completed);return N(e=>e.filter(e=>!r.has(e))),n}finally{e.length&&B(!1),se.current=!1,le(!1)}},tt=e=>et(e,!0),nt=e=>et(e,!1),rt=async e=>{let t=await tt([e]);if(t.unfinished.length)throw Error(t.error)},it=async e=>{let t=await nt([e]);if(t.unfinished.length)throw Error(t.error)},at=Fe===xe&&(be||c===ye),ot=at?z:0;return{images:at?we:ui,context:Ee,colorIndexStatus:Oe,total:ot,page:o,setPage:s,totalPages:Math.max(1,Math.ceil(ot/48)),searchTerm:c,setSearchTerm:l,selectedCategory:u,setSelectedCategory:d,selectedSubfolder:f,setSelectedSubfolder:m,selectedBoardId:h,setSelectedBoardId:g,dateFrom:_,setDateFrom:v,dateTo:y,setDateTo:b,favoritesOnly:x,selectedColorFamily:C,setFavoritesOnly:S,setSelectedColorFamily:w,sortBy:T,setSortBy:ee,sortOrder:E,setSortOrder:D,gridColumns:te,setGridColumns:ne,isLoading:je||!at,isRefreshing:Me&&at,hasPendingLiveRefresh:re,autoSyncFailure:pe,error:at?Ne:null,selectedImage:k,setSelectedImage:A,detailNavigation:ie,setDetailNavigation:j,selectedImagePaths:at?M:[],setSelectedImagePaths:N,trashItems:at?Pe:di,isTrashView:be,importMessage:P,importFolderRef:ae,setImportMessage:F,targetFolderOptions:Je,boards:Ye,refresh:Le,refreshAndWait:Re,applyUrlScope:Ie,updateImageState:Be,batchUpdateImages:Ve,moveImages:He,batchRenameImages:V,deleteImages:H,renameImage:Ue,createFolder:U,deleteFolder:We,mergeFolder:Ge,renameFolder:Ke,createBoard:Ze,updateBoard:W,deleteBoard:Qe,updateBoardPins:$e,importFiles:qe,restoreTrashItem:rt,purgeTrashItem:it,restoreTrashItems:tt,purgeTrashItems:nt,trashBusy:ce}},mi=[],hi=e=>e instanceof Ze&&typeof e.details==`object`&&e.details!==null&&`validation_errors`in e.details&&Array.isArray(e.details.validation_errors)?e.details.validation_errors:mi,gi=e=>{let{t}=n(),[r,i]=(0,p.useState)([]),[a,o]=(0,p.useState)(null),[s,c]=(0,p.useState)([]),[l,u]=(0,p.useState)([]),[d,f]=(0,p.useState)(``),[m,h]=(0,p.useState)(`[]`),[g,_]=(0,p.useState)(``),[v,y]=(0,p.useState)(``),[b,x]=(0,p.useState)(1),[S,C]=(0,p.useState)(0),[w]=(0,p.useState)(120),[T,ee]=(0,p.useState)(!1),[E,D]=(0,p.useState)(!1),[te,ne]=(0,p.useState)(!1),[re,O]=(0,p.useState)(!1),[k,A]=(0,p.useState)(null),[ie,j]=(0,p.useState)(``),[M,N]=(0,p.useState)([]),P=(0,p.useRef)(!1),F=(0,p.useRef)(0),ae=(0,p.useRef)(0),I=(0,p.useRef)(0),[L,R]=(0,p.useState)(``),oe=(0,p.useRef)(``),se=(0,p.useRef)(v),ce=JSON.stringify([a,v,b]),le=(0,p.useCallback)(async()=>{P.current?ne(!0):D(!0),A(null);try{i(await G.listLibraries())}catch(e){A(e instanceof Error?e.message:t(`errorOpenLibrary`))}finally{P.current=!0,D(!1),ne(!1)}},[t]),ue=(0,p.useCallback)(async(e,n,r)=>{let i=++F.current,a=JSON.stringify([e,n,r]);oe.current===a?ne(!0):(D(!0),ne(!1)),A(null);try{let t=await G.getLibraryEntries(e,n,r,w);if(F.current!==i)return;c(t.data??[]),C(t.total??0),x(t.page??r),oe.current=JSON.stringify([e,n,t.page??r]),R(oe.current)}catch(e){if(F.current!==i)return;throw A(e instanceof Error?e.message:t(`errorOpenLibrary`)),c([]),C(0),oe.current=a,R(a),e}finally{F.current===i&&(D(!1),ne(!1))}},[w,t]),de=async()=>{a&&await ue(a,v,b)},fe=async e=>{e!==a&&(++F.current,++ae.current,++I.current,c([]),C(0),ne(!1),o(e),A(null),j(``),N([]),u([]),x(1),ee(!1),f(``))},pe=async e=>{let t=e||a;if(!t)return[];if(l.length>0&&t===a)return l;let n=++ae.current,r=await G.getLibrary(t);return ae.current===n&&u(r),r},me=async()=>{if(!a)return;let e=++I.current;ne(!0),N([]),j(``);try{let t=await G.getLibraryRaw(a);if(I.current!==e)return;f(t.text),h(t.text),ee(!0)}catch(n){I.current===e&&A(n instanceof Error?n.message:t(`errorOpenLibrary`))}finally{I.current===e&&ne(!1)}},he=()=>{f(``),N([]),ee(!1)},ge=()=>{try{let e=JSON.parse(d);return f(JSON.stringify(e,null,2)),N([]),{ok:!0,message:``}}catch(e){let n=e instanceof Error?e.message:t(`errorJsonInvalid`);return A(n),{ok:!1,message:n}}},_e=async()=>{if(!a)return{ok:!1,message:t(`errorNoLibrarySelected`)};A(null),j(``),N([]);let e;try{e=JSON.parse(d)}catch{return{ok:!1,message:t(`errorJsonInvalid`)}}O(!0);try{let n=await G.saveLibrary(a,e);return await le(),h(JSON.stringify(e,null,2)),u(e),await ue(n.name,v,1),o(n.name),j(t(`librarySaveSuccess`,{count:n.count})),{ok:!0,message:``}}catch(e){let n=hi(e);return n.length&&N(n),{ok:!1,message:e instanceof Error?e.message:t(`errorSaveLibrary`)}}finally{O(!1)}},ve=async()=>{let e=g.trim();if(!e)return{ok:!1,message:t(`errorLibraryNameRequired`)};A(null),j(``),N([]),O(!0);try{let n=e.endsWith(`.json`)?e:`${e}.json`,r=await G.saveLibrary(n,[]);return _(``),await le(),u([]),o(r.name),await ue(r.name,``,1),j(t(`libraryCreateSuccess`)),{ok:!0,message:``}}catch(e){return{ok:!1,message:e instanceof Error?e.message:t(`errorCreateLibrary`)}}finally{O(!1)}},ye=async(e,n,r=``,i=``)=>{A(null),j(``),N([]),O(!0);try{let a=await G.importLibrary(e,n,r,i);return await le(),u([]),o(a.name),await ue(a.name,``,1),j(t(`libraryImportSuccess`,{count:a.count,name:a.name})),{ok:!0,message:``}}catch(e){let n=hi(e);return n.length&&N(n),{ok:!1,message:e instanceof Error?e.message:t(`errorImportLibrary`)}}finally{O(!1)}},be=async e=>{O(!0),A(null),j(``),N([]);try{await G.deleteLibrary(e),await le(),a===e&&(o(null),c([]),u([]),C(0),h(`[]`),ee(!1),f(``))}finally{O(!1)}},xe=async(e,n)=>{if(!a)return{ok:!1,message:t(`errorNoLibrarySelected`)};O(!0),A(null),N([]);try{let r=await G.saveLibraryEntry(a,n,e);return await ue(a,v,b),u([]),j(t(`librarySaveSuccess`,{count:r.count})),{ok:!0,message:``}}catch(e){let n=hi(e);return n.length&&N(n),{ok:!1,message:e instanceof Error?e.message:t(`errorSaveLibrary`)}}finally{O(!1)}},Se=async e=>{if(!a)return{ok:!1,message:t(`errorNoLibrarySelected`)};O(!0),A(null);try{let t=await G.deleteLibraryEntry(a,e);return await ue(a,v,Math.min(b,Math.max(1,Math.ceil(t.count/w)))),u([]),{ok:!0,message:``}}catch(e){return{ok:!1,message:e instanceof Error?e.message:t(`errorDeleteLibrary`)}}finally{O(!1)}};(0,p.useEffect)(()=>{e&&le()},[e,le]),(0,p.useEffect)(()=>{++F.current;let e=se.current!==v;if(se.current=v,!a||T)return;let t=window.setTimeout(()=>{ue(a,v,b).catch(()=>void 0)},e?250:0),n=F;return()=>{window.clearTimeout(t),++n.current}},[a,v,b,T,ue]);let Ce=L===ce;return{libraries:r,activeLibraryName:a,entries:Ce?s:[],generatorEntries:l,editorValue:d,setEditorValue:f,draftName:g,setDraftName:_,searchTerm:v,setSearchTerm:y,entryPage:b,setEntryPage:x,entryTotal:Ce?S:0,entryLimit:w,isEditing:T,isDirty:T&&d!==m,isLoading:E||!!a&&!Ce&&!T,isRefreshing:te,isSubmitting:re,error:k,statusMessage:ie,setStatusMessage:j,validationIssues:M,openLibrary:fe,refreshActiveLibrary:de,ensureGeneratorEntries:pe,startEditing:me,cancelEditing:he,formatEditor:ge,saveLibrary:_e,createLibrary:ve,importLibrary:ye,deleteLibrary:be,saveEntry:xe,removeEntry:Se,refreshLibraries:le}},_i=`universal-extractor:ui-preferences`,vi={interfaceDensity:`standard`,defaultSelectionMode:!1,collapseSidebarOnLaunch:!1,enableImagePrefetch:!0,enableLiveGalleryRefresh:!0,defaultFolderTreeView:!0},yi=()=>{try{let e=JSON.parse(pt(_i)||`{}`);return{interfaceDensity:e.interfaceDensity===`compact`?`compact`:`standard`,defaultSelectionMode:typeof e.defaultSelectionMode==`boolean`?e.defaultSelectionMode:vi.defaultSelectionMode,collapseSidebarOnLaunch:typeof e.collapseSidebarOnLaunch==`boolean`?e.collapseSidebarOnLaunch:vi.collapseSidebarOnLaunch,enableImagePrefetch:typeof e.enableImagePrefetch==`boolean`?e.enableImagePrefetch:vi.enableImagePrefetch,enableLiveGalleryRefresh:typeof e.enableLiveGalleryRefresh==`boolean`?e.enableLiveGalleryRefresh:vi.enableLiveGalleryRefresh,defaultFolderTreeView:typeof e.defaultFolderTreeView==`boolean`?e.defaultFolderTreeView:vi.defaultFolderTreeView}}catch{return vi}},bi=()=>{let[e,t]=(0,p.useState)(yi),n=(0,p.useCallback)(e=>{t(t=>({...t,...e}))},[]);return(0,p.useEffect)(()=>{mt(_i,JSON.stringify(e))},[e]),{preferences:e,update:n}},xi={folder:`default_output::`,board:``,query:``,category:``,dateFrom:``,dateTo:``,favorites:!1,color:``,sort:`created_at`,order:`desc`,page:1},Si=[`tab`,`library`,`folder`,`board`,`q`,`category`,`from`,`to`,`pinned`,`color`,`sort`,`order`,`page`],Ci=e=>(e||``).slice(0,256),wi=e=>/^\d{4}-\d{2}-\d{2}$/.test(e||``)?e:``,Ti=e=>{let t=new URLSearchParams(e),n=t.get(`tab`),r=n===`library`||n===`workbench`||n===`settings`?n:`gallery`,i=Number(t.get(`page`)||1),a=Number.isSafeInteger(i)&&i>=1&&i<=1e5?i:1,o=t.get(`sort`),s=t.get(`order`),c=Ci(t.get(`board`)),l=t.get(`pinned`)===`1`,u=Ci(t.get(`folder`))||(c||l?``:xi.folder);return{tab:r,library:Ci(t.get(`library`)),gallery:{folder:u,board:c,query:Ci(t.get(`q`)),category:Ci(t.get(`category`)),dateFrom:wi(t.get(`from`)),dateTo:wi(t.get(`to`)),favorites:l,color:Ci(t.get(`color`)),sort:o===`filename`||o===`size`?o:xi.sort,order:s===`asc`?`asc`:xi.order,page:a}}},J=(e,t)=>{let n=new URL(e);Si.forEach(e=>n.searchParams.delete(e));let r=(e,t,r)=>{t!==r&&t!==``&&n.searchParams.set(e,String(t))};return r(`tab`,t.tab,`gallery`),(t.tab===`library`||t.tab===`workbench`)&&r(`library`,t.library,``),r(`folder`,t.gallery.folder,xi.folder),r(`board`,t.gallery.board,``),r(`q`,t.gallery.query,``),r(`category`,t.gallery.category,``),r(`from`,t.gallery.dateFrom,``),r(`to`,t.gallery.dateTo,``),t.gallery.favorites&&n.searchParams.set(`pinned`,`1`),r(`color`,t.gallery.color,``),r(`sort`,t.gallery.sort,xi.sort),r(`order`,t.gallery.order,xi.order),r(`page`,t.gallery.page,1),`${n.pathname}${n.search}${n.hash}`},Ei=(e,t)=>{let n=e=>({...e,gallery:{...e.gallery,query:``}});return e.gallery.query!==t.gallery.query&&JSON.stringify(n(e))===JSON.stringify(n(t))},Di=`universal-extractor:onboarding-tour-v1-completed`,Oi=()=>{try{return window.localStorage.getItem(Di)===`true`}catch{return!1}},ki=()=>{try{window.localStorage.setItem(Di,`true`)}catch{}},Ai=`universal-extractor-workflow`,ji=`universal-extractor:workflow-message`,Mi=`universal-extractor:lora-stack-message`,Ni=`universal-extractor:workflow-probe`,Pi=`universal-extractor:workflow-ack`,Fi=`universal-extractor:workflow-delivered`,Ii=`universal-extractor:lora-stack-delivered`,Li=900,Ri=8e3,zi=2,Bi=e=>{if(!e||typeof e!=`object`)return;let t=e,n=[t.applied,t.added,t.updated,t.removed];if(!(typeof t.target!=`string`||!n.every(e=>Number.isSafeInteger(e)&&e>=0)))return{target:t.target.slice(0,120),applied:t.applied,added:t.added,updated:t.updated,removed:t.removed}},Vi=(e,t,n,r=!1)=>new Promise(i=>{if(!(`BroadcastChannel`in window)){i({delivered:!1,ok:!1});return}let a=!1,o=null,s=`${e.id}-probe`,c=new BroadcastChannel(Ai),l=[],u=0,d=0,f=()=>{window.clearTimeout(u),window.clearTimeout(d),c.close()},p=e=>{a||(a=!0,f(),i(e))};c.addEventListener(`message`,t=>{let i=t.data;if(!(!i||typeof i!=`object`)){if(i.type===Pi&&i.probeId===s&&typeof i.instanceId==`string`){l.push(i);return}if(i.type===n&&i.payloadId===e.id&&o&&i.instanceId===o){if(r&&i.loraStackProtocol!==zi){p({delivered:!0,ok:!1,outdatedBridge:!0});return}let e=Bi(i.summary);if(r&&i.ok!==!1&&!e){p({delivered:!0,ok:!1,outdatedBridge:!0});return}p({delivered:!0,ok:i.ok!==!1,error:typeof i.error==`string`?i.error:void 0,summary:e})}}}),c.postMessage({type:Ni,probeId:s,payloadId:e.id}),d=window.setTimeout(()=>{if(a)return;let n=l.find(e=>e.focused)??l.find(e=>e.visibilityState===`visible`)??l[0];if(!n){p({delivered:!1,ok:!1});return}if(r&&n.loraStackProtocol!==zi){p({delivered:!1,ok:!1,outdatedBridge:!0});return}o=n.instanceId,c.postMessage({type:t,targetInstanceId:n.instanceId,payload:e}),u=window.setTimeout(()=>p({delivered:!1,ok:!1}),Ri)},Li)}),Hi=async e=>{let t=await Vi(e,ji,Fi);return t.delivered&&t.ok},Ui=e=>Vi(e,Mi,Ii,!0),Wi=(0,p.lazy)(()=>vr(()=>import(`./ImageDetailModal-DaLI34MR.js`).then(e=>({default:e.ImageDetailModal})),__vite__mapDeps([1]))),Gi=(0,p.lazy)(()=>vr(()=>import(`./LibraryWorkspace-CT02q7ep.js`).then(e=>({default:e.LibraryWorkspace})),[])),Ki=(0,p.lazy)(()=>vr(()=>import(`./SettingsWorkspace-CZMkuJbF.js`).then(e=>({default:e.SettingsWorkspace})),__vite__mapDeps([2]))),qi=(0,p.lazy)(()=>vr(()=>import(`./WorkbenchWorkspace-KwG36plb.js`).then(e=>({default:e.WorkbenchWorkspace})),__vite__mapDeps([3]))),Ji=`universal-extractor:pending-workflow`,Yi=`default_output::`,Xi=`::`,Zi=e=>e.includes(Xi)&&e.split(Xi,2)[1]===``,Qi=e=>e.startsWith(Yi)?e.slice(16):e,$i=(e,t)=>{let n=t.trim().toLowerCase();return n?e.filename.toLowerCase().includes(n):!0},ea=()=>{try{window.localStorage.removeItem(Ji)}catch{}},ta=e=>{try{window.localStorage.setItem(Ji,JSON.stringify(e))}catch{ea()}};function na(){let{t:e}=n(),{confirm:t,choose:r}=_t(),{pushToast:i}=qt(),{runOperation:a,syncTask:o}=Je(),s=(0,p.useMemo)(()=>Ti(window.location.search),[]),[c,l]=(0,p.useState)(s.tab===`workbench`),[u,d]=(0,p.useState)(!1),[f,m]=(0,p.useState)(s.tab),[h,g]=(0,p.useState)(``),{preferences:_,update:v}=bi(),[y,b]=(0,p.useState)(()=>_.defaultFolderTreeView?`tree`:`list`),[x,S]=(0,p.useState)(()=>window.innerWidth<=960||_.collapseSidebarOnLaunch),[C,w]=(0,p.useState)(!1),[T,ee]=(0,p.useState)(!1),[E,D]=(0,p.useState)([]),[te,ne]=(0,p.useState)(0),re=(0,p.useRef)(null),O=(0,p.useCallback)(e=>{re.current=e},[]),[k,A]=(0,p.useState)(null),[ie,j]=(0,p.useState)(!1),[M,N]=(0,p.useState)(()=>!Oi()),P=pi({interactionBlocked:T||C,isActive:f===`gallery`,liveRefreshEnabled:_.enableLiveGalleryRefresh,thumbnailPrewarmEnabled:_.enableImagePrefetch,initialScope:s.gallery});$e(!0);let F=(0,p.useRef)(null);(0,p.useEffect)(()=>{if(!P.autoSyncFailure){F.current&&=(o(F.current,e(`jobRefresh`),`success`,e(`jobCompleted`)),null);return}let t=P.autoSyncFailure,n=t.error instanceof qr?t.error:null;F.current=n?`refresh:${n.scope}`:`auto-sync`,o(F.current,e(`galleryAutoSyncFailed`),`error`,t.error instanceof Error?t.error.message:String(t.error),t.retry,n?{jobId:n.jobId,taskKind:`refresh_index`,source:`gallery`}:void 0)},[P.autoSyncFailure,o,e]);let ae=f===`library`||f===`workbench`,I=(n,r)=>{let i=r?P.restoreTrashItems:P.purgeTrashItems,o=e(r?`operationRestoreTrash`:`operationPurgeTrash`),s=(t,n)=>n.unfinished.length?e(`trashBatchPartial`,{completed:n.completed.length,unfinished:n.unfinished.length}):e(r?`trashRestoreSelectedSuccess`:`trashDeleteSelectedSuccess`,{count:n.completed.length});return a(()=>i(n),{pending:o,success:e=>s(n,e),successTone:e=>e.unfinished.length?`error`:`success`,successDetail:e=>e.error,successRetry:n=>et({paths:n.unfinished,execute:i,confirm:t,run:a,pending:o,failed:(e,t)=>t.unfinished,summary:s,confirmation:t=>({title:e(r?`trashRestoreSelected`:`trashDeleteSelectedForever`),message:e(r?`trashRestoreSelectedConfirm`:`trashDeleteSelectedConfirm`,{count:t}),tone:r?`warning`:`danger`,confirmLabel:e(r?`trashRestore`:`trashDeleteForever`),cancelLabel:e(`libraryCancel`)})})})},L=gi(ae),R=(0,p.useRef)(s.tab===`library`||s.tab===`workbench`?s.library:``);(0,p.useEffect)(()=>{let e=R.current;e&&(R.current=``,L.openLibrary(e))},[L]);let oe=(0,p.useMemo)(()=>L.libraries.filter(e=>$i(e,h)),[L.libraries,h]),se=L.entryTotal<=5e3,ce=e=>{v(e),e.defaultFolderTreeView!==void 0&&b(e.defaultFolderTreeView?`tree`:`list`),e.collapseSidebarOnLaunch!==void 0&&window.innerWidth>960&&S(e.collapseSidebarOnLaunch)},le=(0,p.useCallback)(async()=>L.isDirty?t({title:e(`libraryUnsavedTitle`),message:e(`libraryUnsavedConfirm`),tone:`warning`,confirmLabel:e(`libraryDiscardChanges`),cancelLabel:e(`libraryCancel`)}):!0,[t,L.isDirty,e]),ue=async({confirmOptions:e,operation:n,operationOptions:r})=>{if(await t(e))return a(n,r)},de=P.selectedImage,fe=P.setSelectedImage,pe=(0,p.useCallback)(async()=>{if(!de)return!0;let e=re.current;return!e||!await e()?!1:(fe(null),!0)},[de,fe]),me=async n=>{n!==f&&(f===`settings`&&n!==`settings`&&u&&!await t({title:e(`qolDiscardTitle`),message:e(`qolDiscardBody`),tone:`warning`,confirmLabel:e(`modalDiscardChanges`),cancelLabel:e(`libraryCancel`)})||f===`library`&&n!==`library`&&!await le()||await pe()&&(0,p.startTransition)(()=>{n===`workbench`&&l(!0),m(n)}))},he=e=>{if(f===`gallery`){(0,p.startTransition)(()=>{P.setSearchTerm(e),P.setPage(1)});return}(0,p.startTransition)(()=>{g(e),L.setSearchTerm(e),L.setEntryPage(1)})},ge=async n=>{if(!(f===`settings`&&u&&!await t({title:e(`qolDiscardTitle`),message:e(`qolDiscardBody`),tone:`warning`,confirmLabel:e(`modalDiscardChanges`),cancelLabel:e(`libraryCancel`)}))&&!(f===`library`&&L.activeLibraryName!==n&&!await le())&&await pe()){(0,p.startTransition)(()=>{m(`library`)});try{await L.openLibrary(n)}catch(t){i(t instanceof Error?t.message:e(`errorOpenLibrary`),`error`)}}},_e=async()=>{await a(async()=>{let e=await L.createLibrary();if(!e.ok&&e.message)throw Error(e.message);return P.refresh(),e},{pending:e(`operationCreateLibrary`),success:e(`libraryCreateSuccess`),error:t=>t instanceof Error?t.message:e(`errorCreateLibrary`)}).catch(()=>void 0)},ve=async t=>{L.activeLibraryName===t&&!await le()||await ue({confirmOptions:{title:e(`commonDelete`),message:e(`confirmDeleteLibrary`,{name:t}),tone:`warning`,confirmLabel:e(`commonDelete`),cancelLabel:e(`libraryCancel`)},operation:()=>L.deleteLibrary(t),operationOptions:{pending:e(`operationDeleteLibrary`),success:e(`commonDelete`),error:t=>t instanceof Error?t.message:e(`errorDeleteLibrary`)}}).catch(()=>void 0)},ye=async()=>{await ue({confirmOptions:{title:e(`librarySaveConfirmTitle`),message:e(`librarySaveConfirm`,{name:L.activeLibraryName??``}),tone:`warning`,confirmLabel:e(`librarySave`),cancelLabel:e(`libraryCancel`)},operation:async()=>{let e=await L.saveLibrary();if(!e.ok&&e.message)throw Error(e.message);return e},operationOptions:{pending:e(`operationSaveLibrary`),success:e(`librarySaveSuccess`,{count:L.entryTotal}),error:t=>t instanceof Error?t.message:e(`errorSaveLibrary`)}}).catch(()=>void 0)},be=async()=>{if(!(f===`library`&&!await le())){if(f===`gallery`){await P.refreshAndWait().catch(t=>{i(t instanceof Error?t.message:e(`galleryEmptyErrorTitle`),`error`)});return}if(f===`settings`){await a(()=>P.refreshAndWait(),{taskKind:`refresh_index`,pending:e(`operationRefresh`),success:e(`operationRefreshSuccess`),error:t=>t instanceof Error?t.message:e(`galleryEmptyErrorTitle`)}).catch(()=>void 0);return}await a(async()=>{await L.refreshLibraries(),L.activeLibraryName&&await L.refreshActiveLibrary()},{taskKind:`refresh_index`,pending:e(`operationRefresh`)})}},xe=()=>{L.activeLibraryName&&G.getLibraryRaw(L.activeLibraryName).then(e=>{let t=new Blob([e.text],{type:`application/json;charset=utf-8`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=L.activeLibraryName,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(n)}).catch(t=>{i(t instanceof Error?t.message:e(`errorOpenLibrary`),`error`)})},Se=()=>{A({mode:`create`,initialValue:!P.selectedSubfolder||P.selectedSubfolder===Yi?``:Zi(P.selectedSubfolder)?P.selectedSubfolder:`${Qi(P.selectedSubfolder)}/`})},Ce=()=>{ki(),N(!1)},we=async n=>{if(!await t({title:e(`boardCreateTitle`),message:e(`boardCreateConfirm`,{name:n}),tone:`warning`,confirmLabel:e(`commonCreate`),cancelLabel:e(`libraryCancel`)}))return;let r=await a(()=>P.createBoard(n),{pending:e(`operationCreateBoard`),success:e(`boardCreateSuccess`),error:t=>t instanceof Error?t.message:e(`boardCreateError`)});r.board?.id&&(P.setSelectedBoardId(r.board.id),P.setSelectedSubfolder(``),P.setFavoritesOnly(!1),P.setPage(1))},Te=async n=>{if(k){if(k.mode===`create`)await a(()=>P.createFolder(n),{pending:e(`operationCreateFolder`),success:e(`folderCreateSuccess`),error:t=>t instanceof Error?t.message:e(`folderCreateError`)}),P.refresh();else if(k.mode===`merge`){if(!await t({title:e(`folderMergeTitle`),message:e(`folderMergeConfirm`,{name:Qi(k.sourcePath??P.selectedSubfolder),target:n}),tone:`warning`,confirmLabel:e(`sidebarMergeFolder`),cancelLabel:e(`libraryCancel`)}))return;await a(()=>P.mergeFolder(k.sourcePath??P.selectedSubfolder,n),{pending:e(`operationMergeFolder`),success:e(`folderMergeSuccess`),error:t=>t instanceof Error?t.message:e(`folderMergeError`)})}else if(k.sourcePath){let r=k.sourcePath;if(!await t({title:e(`folderRenameTitle`),message:e(`folderRenameConfirm`,{name:Qi(r),target:n}),tone:`warning`,confirmLabel:e(`folderRename`),cancelLabel:e(`libraryCancel`)}))return;await a(()=>P.renameFolder(r,n),{pending:e(`operationRenameFolder`),success:e(`folderRenameSuccess`),error:t=>t instanceof Error?t.message:e(`folderRenameError`)})}}},Ee=async(t=P.selectedSubfolder)=>{t&&await ue({confirmOptions:{title:e(`commonDelete`),message:e(`folderDeleteConfirm`,{name:Qi(t)}),tone:t.includes(`/`)?`warning`:`danger`,confirmLabel:e(`commonDelete`),cancelLabel:e(`libraryCancel`)},operation:()=>P.deleteFolder(t),operationOptions:{pending:e(`operationDeleteFolder`),success:e(`folderDeleteSuccess`),error:t=>t instanceof Error?t.message:e(`folderDeleteError`)}}).catch(()=>void 0)},De=(e=P.selectedSubfolder)=>{e&&A({mode:`merge`,initialValue:``,sourcePath:e})},Oe=e=>{e&&A({mode:`rename`,initialValue:Qi(e),sourcePath:e})},ke=async(n,r)=>{if(!n||!r)return;let i=Dt(n)||Qi(n);await t({title:e(`folderMoveTitle`),message:e(`folderMoveConfirm`,{name:i,target:Qi(r)}),tone:`warning`,confirmLabel:e(`folderMove`),cancelLabel:e(`libraryCancel`)})&&await a(()=>P.renameFolder(n,r),{pending:e(`operationMoveFolder`),success:e(`folderMoveSuccess`),error:t=>t instanceof Error?t.message:e(`folderMoveError`)}).catch(()=>void 0)},z=async t=>{try{await L.openLibrary(t)}catch(t){i(t instanceof Error?t.message:e(`errorOpenLibrary`),`error`)}},Ae=async(n,r=``)=>{if(!n.length)return;let o=P.context?.sources.find(e=>e.id===r)||P.context?.sources.find(e=>e.enabled&&e.writable&&e.import_target),s=P.context?.import_image_subfolder||`universal_gallery_imports`;if(!await t({title:e(`galleryImportConfirmTitle`),message:e(`galleryImportConfirm`,{count:n.length,target:`${o?.name||r||e(`galleryOutputFolder`)} / ${s}/`}),tone:`info`,confirmLabel:e(`libraryImport`),cancelLabel:e(`libraryCancel`)}))return;let c=await a(()=>P.importFiles(n,r),{pending:e(`operationImportFiles`),success:t=>e(`galleryImportSuccess`,{count:t.imported_images.length+t.imported_libraries.length}),error:t=>t instanceof Error?t.message:e(`errorImportLibrary`)});await L.refreshLibraries(),c.skipped.length>0&&i(e(`galleryImportSkipped`,{count:c.skipped.length}),`info`)},je=async(e,t)=>{await P.updateImageState(e,t),P.searchTerm.trim()&&P.refresh()},Me=async(t,n)=>{await a(()=>P.renameImage(t,n),{pending:e(`operationRenameImage`),success:e(`modalRenameFile`),error:t=>t instanceof Error?t.message:e(`imageRenameError`)})},Ne=async t=>{await a(async()=>{if((await P.deleteImages([t])).deleted.length!==1)throw Error(e(`imageDeleteMissing`))},{pending:e(`operationDeleteImage`),success:e(`imageDelete`),error:t=>t instanceof Error?t.message:e(`imageDeleteError`)})},Pe=async n=>{await t({title:e(`modalOpenWorkflow`),message:e(`workflowSendConfirm`,{name:n.relative_path}),tone:`warning`,confirmLabel:e(`commonSend`),cancelLabel:e(`libraryCancel`)})&&await a(async()=>{let t=await G.getImageMetadata(n.relative_path),r={id:`wf-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,workflow:t.workflow,prompt:t.metadata&&typeof t.metadata==`object`?t.metadata.prompt??null:null,image:n.relative_path,imageUrl:n.original_url||n.url||null,ts:Date.now()};if(!r.workflow&&!r.prompt)throw Error(e(`modalNoMetadata`));if(ta(r),!await Hi(r))throw Error(e(`workflowNoComfyPage`));ea()},{pending:e(`operationSendWorkflow`),success:e(`workflowSendSuccess`),error:t=>t instanceof Error?t.message:e(`modalNoMetadata`)}).catch(()=>void 0)},Fe=async t=>{let n=await a(async()=>{let n=(await G.getImageMetadata(t.relative_path)).recipe?.lora_manager;if(!n?.detected||!Array.isArray(n.loras)||!n.loras.some(e=>e&&e.enabled!==!1&&typeof e.name==`string`&&e.name.trim()))throw Error(e(`loraStackApplyNoStack`));return n},{pending:e(`loraStackReading`),error:t=>t instanceof Error?t.message:e(`loraStackApplyNoStack`)}).catch(()=>null);if(!n)return;let i=new Map(n.loras.filter(e=>e&&e.enabled!==!1&&typeof e.name==`string`&&e.name.trim()).map(e=>[e.name.trim(),e])),o=[...i.values()].filter(e=>{let t=Number(e.strength_model??1),n=Number(e.strength_clip??t);return Number.isFinite(t)&&Number.isFinite(n)&&t!==n}).length,s=await r({title:e(`loraStackApply`),message:e(`loraStackApplyConfirm`,{name:t.relative_path,count:i.size})+(o?`\n${e(`loraStackClipWarning`,{count:o})}`:``),tone:`warning`,confirmLabel:e(`loraStackAppend`),alternativeLabel:e(`loraStackReplace`),cancelLabel:e(`libraryCancel`)});if(s===`cancel`)return;let c=s===`confirm`?`append`:`replace`;await a(async()=>{let r=await Ui({id:`lora-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,mode:c,loraManager:n,image:t.relative_path,imageUrl:t.original_url||t.url||null,ts:Date.now()});if(r.outdatedBridge)throw Error(e(`loraStackBridgeOutdated`));if(!r.delivered)throw Error(e(`loraStackApplyNoComfyPage`));if(!r.ok)throw Error(r.error||e(`loraStackApplyNoTargetNode`));return r.summary},{pending:e(`operationApplyLoraStack`),success:t=>t?e(c===`append`?`loraStackAppendedSuccess`:`loraStackReplacedSuccess`,{count:t.applied,name:t.target}):e(`loraStackApplySuccess`),successDetail:t=>t?e(c===`append`?`loraStackAppendDetail`:`loraStackReplaceDetail`,{added:t.added,updated:t.updated,removed:t.removed}):``,error:t=>t instanceof Error?t.message:e(`loraStackApplyNoStack`)}).catch(()=>void 0)},B=(0,p.useMemo)(()=>{let e=new Set(P.selectedImagePaths);return E.filter(t=>e.has(t.relative_path))},[E,P.selectedImagePaths]),Ie=(0,p.useMemo)(()=>P.boards.find(e=>e.id===P.selectedBoardId)??null,[P.boards,P.selectedBoardId]),[Le,Re]=(0,p.useState)(!1),ze=(0,p.useRef)(!1);(0,p.useEffect)(()=>{ze.current=T&&B.length>0},[T,B.length]);let Be=(0,p.useCallback)(e=>{e&&Re(ze.current),w(e)},[]),Ve=f===`gallery`&&T&&!P.isTrashView&&(C?Le:B.length>0),He=(e,t)=>{let n=t?.some(t=>t.relative_path===e.relative_path)?t:[e];P.setSelectedImage(e),P.setDetailNavigation({items:n,currentIndex:n.findIndex(t=>t.relative_path===e.relative_path)})},V=(0,p.useMemo)(()=>({tab:f,library:f===`library`||f===`workbench`?L.activeLibraryName??``:``,gallery:{folder:P.selectedSubfolder,board:P.selectedBoardId,query:P.searchTerm,category:P.selectedCategory,dateFrom:P.dateFrom,dateTo:P.dateTo,favorites:P.favoritesOnly,color:P.selectedColorFamily,sort:P.sortBy,order:P.sortOrder,page:P.page}}),[f,L.activeLibraryName,P.selectedSubfolder,P.selectedBoardId,P.searchTerm,P.selectedCategory,P.dateFrom,P.dateTo,P.favoritesOnly,P.selectedColorFamily,P.sortBy,P.sortOrder,P.page]),Ue=(0,p.useRef)(`${window.location.pathname}${window.location.search}${window.location.hash}`),U=(0,p.useRef)(s),We=(0,p.useRef)(!1),Ge=(0,p.useRef)(!1);return(0,p.useEffect)(()=>{if(s.library&&(s.tab===`library`||s.tab===`workbench`)&&!L.activeLibraryName)return;let e=J(window.location.href,V),t=`${window.location.pathname}${window.location.search}${window.location.hash}`;if(We.current){e===t&&(We.current=!1,U.current=V,Ue.current=t);return}if(e===t){U.current=V,Ue.current=t;return}let n=Ei(U.current,V),r=()=>{`${window.location.pathname}${window.location.search}${window.location.hash}`!==e&&window.history[n?`replaceState`:`pushState`](window.history.state,``,e),U.current=V,Ue.current=e};if(n){let e=window.setTimeout(r,400);return()=>window.clearTimeout(e)}r()},[s,L.activeLibraryName,V]),(0,p.useEffect)(()=>{let n=()=>window.history.pushState(window.history.state,``,Ue.current),r=async()=>{if(Ge.current){n();return}Ge.current=!0;try{let r=Ti(window.location.search),i=f===`library`&&(r.tab!==`library`||r.library!==(L.activeLibraryName??``));if(i&&!await le()){n();return}if(f===`settings`&&r.tab!==`settings`&&u&&!await t({title:e(`qolDiscardTitle`),message:e(`qolDiscardBody`),tone:`warning`,confirmLabel:e(`modalDiscardChanges`),cancelLabel:e(`libraryCancel`)})){n();return}if(!await pe()){n();return}i&&L.isEditing&&L.cancelEditing();let a=J(window.location.href,r);a!==`${window.location.pathname}${window.location.search}${window.location.hash}`&&window.history.replaceState(window.history.state,``,a),We.current=!0,P.applyUrlScope(r.gallery),(r.tab===`library`||r.tab===`workbench`)&&L.openLibrary(r.library||null),r.tab===`workbench`&&l(!0),m(r.tab),J(window.location.href,V)===a&&(We.current=!1,U.current=r,Ue.current=a)}catch{n()}finally{Ge.current=!1}};return window.addEventListener(`popstate`,r),()=>window.removeEventListener(`popstate`,r)},[f,pe,t,le,P,L,u,e,V]),(0,H.jsxs)(`div`,{className:`ue-app-shell`,"data-density":_.interfaceDensity||`standard`,children:[(0,H.jsx)(Fr,{activeTab:f,onTabChange:me,searchValue:f===`gallery`?P.searchTerm:f===`library`?h:``,onSearchChange:he,onRefresh:be,sidebarCollapsed:x,onSidebarToggle:()=>S(e=>!e)}),!x&&(0,H.jsx)(`div`,{className:`ue-sidebar-overlay`,onClick:()=>S(!0),"aria-hidden":`true`}),(0,H.jsxs)(`div`,{className:`ue-body-shell ${x?`is-sidebar-collapsed`:``} ${Ve?`has-inspector`:``}`,children:[(0,H.jsx)(Lr,{collapsed:x,onToggle:()=>S(e=>!e),activeTab:f,galleryContext:P.context,folderViewMode:y,onFolderViewModeChange:b,selectedCategory:P.selectedCategory,selectedSubfolder:P.selectedSubfolder,selectedBoardId:P.selectedBoardId,pinnedOnly:P.favoritesOnly,onCategorySelect:e=>{P.setSelectedCategory(e),P.setPage(1)},onSubfolderSelect:e=>{P.setSelectedBoardId(``),P.setFavoritesOnly(!1),P.setSelectedSubfolder(e),P.setPage(1)},onBoardSelect:e=>{P.setSelectedBoardId(e),P.setFavoritesOnly(!1),P.setSelectedSubfolder(``),P.setPage(1)},onPinnedOnlySelect:()=>{P.setSelectedBoardId(``),P.setSelectedSubfolder(``),P.setFavoritesOnly(!0),P.setPage(1)},onCreateBoard:()=>j(!0),onCreateFolder:Se,onDeleteFolder:Ee,onMergeFolder:De,onRenameFolder:Oe,onMoveFolder:ke,libraries:oe,activeLibraryName:L.activeLibraryName,onLibrarySelect:ge,onLibraryDelete:ve,draftName:L.draftName,onDraftNameChange:L.setDraftName,onCreateLibrary:_e}),(0,H.jsxs)(`main`,{className:`ue-main-shell`,children:[f===`gallery`?(0,H.jsx)(Or,{images:P.images,context:P.context,total:P.total,page:P.page,totalPages:P.totalPages,selectedCategory:P.selectedCategory,selectedSubfolder:P.selectedSubfolder,selectedBoardId:P.selectedBoardId,dateFrom:P.dateFrom,dateTo:P.dateTo,favoritesOnly:P.favoritesOnly,selectedColorFamily:P.selectedColorFamily,colorIndexStatus:P.colorIndexStatus,sortBy:P.sortBy,sortOrder:P.sortOrder,gridColumns:P.gridColumns,selectedImagePaths:P.selectedImagePaths,trashItems:P.trashItems,isTrashView:P.isTrashView,importMessage:P.importMessage,importFolderRef:P.importFolderRef,onOpenImportFolder:e=>{P.setSelectedBoardId(``),P.setFavoritesOnly(!1),P.setSelectedSubfolder(e),P.setPage(1)},isLoading:P.isLoading,isRefreshing:P.isRefreshing,hasPendingLiveRefresh:P.hasPendingLiveRefresh,error:P.error,boards:P.boards,searchValue:P.searchTerm,onSearchChange:e=>{P.setSearchTerm(e),P.setPage(1)},defaultSelectionMode:_.defaultSelectionMode,enableImagePrefetch:_.enableImagePrefetch,interfaceDensity:_.interfaceDensity,imageDetailOpen:!!P.selectedImage,onSelectionDragChange:Be,onSelectionModeActiveChange:ee,onOpenDetail:He,onVisibleImagesChange:D,inspectorClearSignal:te,onPageChange:P.setPage,onCategoryChange:P.setSelectedCategory,onBoardChange:P.setSelectedBoardId,onDateFromChange:P.setDateFrom,onDateToChange:P.setDateTo,onFavoritesOnlyChange:P.setFavoritesOnly,onColorFamilyChange:P.setSelectedColorFamily,onSortByChange:P.setSortBy,onSortOrderChange:P.setSortOrder,onGridColumnsChange:P.setGridColumns,onOpenWorkflow:Pe,onApplyLoraStack:Fe,onSelectionChange:P.setSelectedImagePaths,onUpdateImageState:je,onCreateBoard:P.createBoard,onUpdateBoardPins:P.updateBoardPins,onDeleteBoard:P.deleteBoard,onDeleteImages:P.deleteImages,onMoveImages:P.moveImages,onImportFiles:Ae,onApplyPendingLiveRefresh:P.refresh,onOpenSettings:()=>void me(`settings`),onRestoreTrashItem:async n=>{await t({title:e(`trashRestore`),message:e(`trashRestoreConfirm`),tone:`warning`,confirmLabel:e(`trashRestore`),cancelLabel:e(`libraryCancel`)})&&await a(()=>P.restoreTrashItem(n),{pending:e(`operationRestoreTrash`),success:e(`trashRestore`)})},onRestoreTrashItems:async e=>I(e,!0),onPurgeTrashItem:async n=>{await t({title:e(`trashDeleteForever`),message:e(`trashEmptyText`),tone:`danger`,confirmLabel:e(`trashDeleteForever`),cancelLabel:e(`libraryCancel`)})&&await a(()=>P.purgeTrashItem(n),{pending:e(`operationPurgeTrash`),success:e(`trashDeleteForever`)})},onPurgeTrashItems:async e=>I(e,!1),trashBusy:P.trashBusy}):f===`library`?(0,H.jsx)(p.Suspense,{fallback:(0,H.jsxs)(`div`,{className:`ue-gallery-state`,children:[(0,H.jsx)(`div`,{className:`ue-loading-orb`}),(0,H.jsx)(`p`,{children:e(`galleryLoading`)})]}),children:(0,H.jsx)(Gi,{onSelectLibrary:e=>void ge(e),onCreateLibrary:()=>void _e(),libraries:L.libraries,activeLibraryName:L.activeLibraryName,entries:L.entries,searchTerm:h,onSearchClear:()=>{g(``),L.setSearchTerm(``),L.setEntryPage(1)},editorValue:L.editorValue,isEditing:L.isEditing,isDirty:L.isDirty,isLoading:L.isLoading,isRefreshing:L.isRefreshing,isSubmitting:L.isSubmitting,error:L.error,statusMessage:L.statusMessage,validationIssues:L.validationIssues,canUseRawEditor:se,page:L.entryPage,totalPages:Math.max(1,Math.ceil(L.entryTotal/L.entryLimit)),totalEntries:L.entryTotal,onEditorValueChange:L.setEditorValue,onStartEditing:L.startEditing,onPageChange:L.setEntryPage,onCancelEditing:async()=>{await le()&&L.cancelEditing()},onFormatEditor:()=>{let e=L.formatEditor();!e.ok&&e.message&&i(e.message,`error`)},onSaveLibrary:ye,onRefresh:be,onExportLibrary:xe,onImportLibrary:async(n,r,i,o)=>await t({title:e(`libraryImportConfirmTitle`),message:r===`create`?e(`libraryImportCreateConfirm`,{name:o||n.name}):e(r===`replace`?`libraryImportReplaceConfirm`:`libraryImportMergeConfirm`,{name:i}),tone:r===`replace`?`danger`:`warning`,confirmLabel:e(`libraryImportConfirm`),cancelLabel:e(`libraryCancel`)})?(await a(async()=>{let e=await L.importLibrary(n,r,i,o);if(!e.ok&&e.message)throw Error(e.message);return e},{pending:e(`operationImportLibrary`),success:e(`libraryImportSuccess`,{count:L.entryTotal,name:i||o||n.name}),error:t=>t instanceof Error?t.message:e(`errorImportLibrary`)}).catch(()=>({ok:!1,message:``}))).ok:!1,onSaveEntry:async(n,r)=>await t({title:e(`librarySaveEntryConfirmTitle`),message:e(`librarySaveEntryConfirm`),tone:`warning`,confirmLabel:e(`librarySave`),cancelLabel:e(`libraryCancel`)})?(await a(async()=>{let e=await L.saveEntry(n,r);if(!e.ok&&e.message)throw Error(e.message);return e},{pending:e(`operationSaveLibrary`),success:e(`librarySaveSuccess`,{count:L.entryTotal}),error:t=>t instanceof Error?t.message:e(`errorSaveLibrary`)}).catch(()=>({ok:!1,message:``}))).ok:!1,onDeleteEntry:async t=>(await a(async()=>{let e=await L.removeEntry(t);if(!e.ok&&e.message)throw Error(e.message);return e},{pending:e(`operationDeleteLibrary`),success:e(`commonDelete`),error:t=>t instanceof Error?t.message:e(`errorDeleteLibrary`)}).catch(()=>({ok:!1,message:``}))).ok})}):f===`workbench`?null:(0,H.jsx)(p.Suspense,{fallback:(0,H.jsxs)(`div`,{className:`ue-gallery-state`,children:[(0,H.jsx)(`div`,{className:`ue-loading-orb`}),(0,H.jsx)(`p`,{children:e(`galleryLoading`)})]}),children:(0,H.jsx)(Ki,{sources:P.context?.sources??[],preferences:_,onDirtyChange:d,onPreferencesChange:ce,onSourcesChange:()=>P.refresh(),onRestartOnboarding:()=>N(!0)})}),c?(0,H.jsx)(p.Activity,{mode:f===`workbench`?`visible`:`hidden`,children:(0,H.jsx)(p.Suspense,{fallback:(0,H.jsxs)(`div`,{className:`ue-gallery-state`,children:[(0,H.jsx)(`div`,{className:`ue-loading-orb`}),(0,H.jsx)(`p`,{children:e(`galleryLoading`)})]}),children:(0,H.jsx)(qi,{libraries:L.libraries,activeLibraryName:L.activeLibraryName,onLibrarySelect:z})})}):null]}),Ve?(0,H.jsx)(`div`,{className:`ue-gallery-inspector-layer`,children:(0,H.jsx)(kr,{selectedPaths:B.map(e=>e.relative_path),selectedSubfolder:P.selectedSubfolder,selectedBoard:Ie,boards:P.boards,page:P.page,targetFolderOptions:P.targetFolderOptions,onClose:()=>{P.setSelectedImagePaths([]),ne(e=>e+1)},onBatchUpdateImages:P.batchUpdateImages,onCreateBoard:P.createBoard,onUpdateBoardPins:P.updateBoardPins,onMoveImages:P.moveImages,onBatchRenameImages:async(t,n,r,i,o)=>a(()=>P.batchRenameImages(t,n,r,i,o),{pending:e(`operationRenameImages`),success:t=>e(`bulkRenameSuccess`,{count:t.renamed.length}),error:t=>t instanceof Error?t.message:e(`bulkRenameError`)}),onDeleteImages:P.deleteImages})}):null]}),P.selectedImage?(0,H.jsx)(p.Suspense,{fallback:null,children:(0,H.jsx)(Wi,{image:P.selectedImage,onClose:()=>P.setSelectedImage(null),onSaveState:je,onRenameFile:Me,onDeleteFile:Ne,onOpenWorkflow:Pe,onApplyLoraStack:Fe,navigation:P.detailNavigation,onRegisterLeave:O,onNavigate:e=>{let t=P.detailNavigation?.items??[],n=t[e];n&&(P.setSelectedImage(n),P.setDetailNavigation({items:t,currentIndex:e}))}},P.selectedImage.relative_path)}):null,(0,H.jsx)(Rr,{open:k!==null,title:k?.mode===`merge`?e(`folderMergeTitle`):k?.mode===`rename`?e(`folderRenameTitle`):e(`folderCreateTitle`),text:k?.mode===`merge`?e(`folderMergeText`):k?.mode===`rename`?e(`folderRenameText`):e(`folderCreateText`),label:k?.mode===`merge`?e(`folderMergePrompt`):k?.mode===`rename`?e(`folderRenamePrompt`):e(`folderCreatePrompt`),placeholder:e(`folderPathPlaceholder`),initialValue:k?.initialValue??``,confirmLabel:k?.mode===`merge`?e(`sidebarMergeFolder`):k?.mode===`rename`?e(`folderRename`):e(`commonCreate`),onClose:()=>A(null),onSubmit:Te}),(0,H.jsx)(Rr,{open:ie,title:e(`boardCreateTitle`),text:e(`boardCreateText`),label:e(`boardNameLabel`),placeholder:e(`boardNamePlaceholder`),initialValue:``,confirmLabel:e(`commonCreate`),onClose:()=>j(!1),onSubmit:we}),(0,H.jsx)(Gr,{open:M,onRequestTabChange:e=>{me(e)},onRequestSidebarOpen:()=>S(!1),onRequestSidebarClose:()=>S(!0),onSkip:Ce,onComplete:Ce})]})}(0,m.createRoot)(document.getElementById(`root`)).render((0,H.jsx)(p.StrictMode,{children:(0,H.jsx)(o,{children:(0,H.jsx)(gt,{children:(0,H.jsx)(qe,{children:(0,H.jsx)(Kt,{children:(0,H.jsx)(na,{})})})})})}));export{F as $,Fe as A,be as B,G as C,Re as D,Be as E,Ae as F,me as G,ve as H,z as I,ce as J,pe as K,ke as L,Ne as M,Me as N,Le as O,je as P,ae as Q,Ee as R,et as S,V as T,_e as U,ye as V,ge as W,L as X,se as Y,I as Z,_t as _,on as a,te as at,dt as b,en as c,v as ct,Qt as d,u as dt,M as et,qt as f,wt as g,Tt as h,an as i,ne as it,Pe as j,B as k,Xt as l,x as lt,Rt as m,_n as n,A as nt,nn as o,E as ot,vt as p,le as q,sn as r,k as rt,tn as s,S as st,ar as t,ie as tt,Jt as u,C as ut,pt as v,Je as w,ft as x,mt as y,Se as z}; \ No newline at end of file diff --git a/gallery_ui/dist/assets/refresh-ccw-CfRNSMuu.js b/gallery_ui/dist/assets/refresh-ccw-bV8xzBtF.js similarity index 79% rename from gallery_ui/dist/assets/refresh-ccw-CfRNSMuu.js rename to gallery_ui/dist/assets/refresh-ccw-bV8xzBtF.js index 99b11a4..27d140e 100644 --- a/gallery_ui/dist/assets/refresh-ccw-CfRNSMuu.js +++ b/gallery_ui/dist/assets/refresh-ccw-bV8xzBtF.js @@ -1 +1 @@ -import{i as e}from"./I18nProvider-cZczvL7B.js";var t=e(`refresh-ccw`,[[`path`,{d:`M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`14sxne`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16`,key:`1hlbsb`}],[`path`,{d:`M16 16h5v5`,key:`ccwih5`}]]);export{t}; \ No newline at end of file +import{i as e}from"./I18nProvider-DEfiLn3N.js";var t=e(`refresh-ccw`,[[`path`,{d:`M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`14sxne`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16`,key:`1hlbsb`}],[`path`,{d:`M16 16h5v5`,key:`ccwih5`}]]);export{t}; \ No newline at end of file diff --git a/gallery_ui/dist/assets/save-DFeVqt65.js b/gallery_ui/dist/assets/save-DQG0Zsqx.js similarity index 80% rename from gallery_ui/dist/assets/save-DFeVqt65.js rename to gallery_ui/dist/assets/save-DQG0Zsqx.js index c195a45..3079450 100644 --- a/gallery_ui/dist/assets/save-DFeVqt65.js +++ b/gallery_ui/dist/assets/save-DQG0Zsqx.js @@ -1 +1 @@ -import{i as e}from"./I18nProvider-cZczvL7B.js";var t=e(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]);export{t}; \ No newline at end of file +import{i as e}from"./I18nProvider-DEfiLn3N.js";var t=e(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]);export{t}; \ No newline at end of file diff --git a/gallery_ui/dist/assets/sparkles-Bu6QFW9h.js b/gallery_ui/dist/assets/sparkles-elJjV352.js similarity index 86% rename from gallery_ui/dist/assets/sparkles-Bu6QFW9h.js rename to gallery_ui/dist/assets/sparkles-elJjV352.js index cd71030..99aff14 100644 --- a/gallery_ui/dist/assets/sparkles-Bu6QFW9h.js +++ b/gallery_ui/dist/assets/sparkles-elJjV352.js @@ -1 +1 @@ -import{i as e}from"./I18nProvider-cZczvL7B.js";var t=e(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]);export{t}; \ No newline at end of file +import{i as e}from"./I18nProvider-DEfiLn3N.js";var t=e(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]);export{t}; \ No newline at end of file diff --git a/gallery_ui/dist/assets/wand-sparkles-C_uDcQtj.js b/gallery_ui/dist/assets/wand-sparkles-262S5lQG.js similarity index 87% rename from gallery_ui/dist/assets/wand-sparkles-C_uDcQtj.js rename to gallery_ui/dist/assets/wand-sparkles-262S5lQG.js index 5cd1e3e..940e1f3 100644 --- a/gallery_ui/dist/assets/wand-sparkles-C_uDcQtj.js +++ b/gallery_ui/dist/assets/wand-sparkles-262S5lQG.js @@ -1 +1 @@ -import{i as e}from"./I18nProvider-cZczvL7B.js";var t=e(`wand-sparkles`,[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]]);export{t}; \ No newline at end of file +import{i as e}from"./I18nProvider-DEfiLn3N.js";var t=e(`wand-sparkles`,[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]]);export{t}; \ No newline at end of file diff --git a/gallery_ui/dist/index.html b/gallery_ui/dist/index.html index 809ec67..1204728 100644 --- a/gallery_ui/dist/index.html +++ b/gallery_ui/dist/index.html @@ -6,7 +6,7 @@ ComfyUI Universal Extractor - + diff --git a/gallery_ui/dist/release-version.json b/gallery_ui/dist/release-version.json index 89e21a0..0ec96b9 100644 --- a/gallery_ui/dist/release-version.json +++ b/gallery_ui/dist/release-version.json @@ -1 +1 @@ -{"version":"1.7.0"} \ No newline at end of file +{"version":"1.8.0"} \ No newline at end of file diff --git a/gallery_ui/package-lock.json b/gallery_ui/package-lock.json index 33d69d5..f92093a 100644 --- a/gallery_ui/package-lock.json +++ b/gallery_ui/package-lock.json @@ -1,12 +1,12 @@ { "name": "gallery_ui", - "version": "1.7.0", + "version": "1.8.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "gallery_ui", - "version": "1.7.0", + "version": "1.8.0", "dependencies": { "@tanstack/react-virtual": "^3.13.24", "lucide-react": "^1.8.0", @@ -31,8 +31,8 @@ "tailwindcss": "^4.2.2", "typescript": "~6.0.2", "typescript-eslint": "^8.58.0", - "vite": "^8.0.4", - "vitest": "^4.1.5" + "vite": "^8.3.5", + "vitest": "^4.1.12" } }, "node_modules/@adobe/css-tools": { @@ -841,19 +841,36 @@ } }, "node_modules/@oxc-project/types": { - "version": "0.137.0", - "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.137.0.tgz", - "integrity": "sha512-WT+Gb24i8hmvo85AIv2oEYouEXkRlKAlT9WaCa3TfLgNCN+GhrJOGZuIlMouAh38Qe4QOx26eUOVsq70qXrywA==", + "version": "0.155.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.155.0.tgz", + "integrity": "sha512-SeE8JPwW1xs1tHeNycjUtUBdhorRa8o4jlvjwk49R7/Z291i+4DQa7JJIgOm/TaYQZx+QrPQbVJ/9c8dMIZN8Q==", "dev": true, "license": "MIT", "funding": { - "url": "https://github.com/sponsors/Boshen" + "url": "https://github.com/sponsors/oxc-project" + } + }, + "node_modules/@rolldown/binding-android-arm-eabi": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.15.tgz", + "integrity": "sha512-aLcgK9gIJ3YRvrrtfSBbRa27F5WrpiTaPulnFpsHPxpUHgFlSgnU4854MHwoRGEBhfRJDWCS2WQ7lIjskE9Olw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, "node_modules/@rolldown/binding-android-arm64": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.1.3.tgz", - "integrity": "sha512-DT6Z3PhvioeHMvxo+xHc3KtqggrI7CCTXCmC2h/5zUlp5jVitv7XEy+9q5/7v8IolhlioawpMo8Kg0EEBy7J0g==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.15.tgz", + "integrity": "sha512-xD7DdZCrbThKuxNg7ooQmvp07ys4J/pnSEMTG3/OdOWl6daC67m/Q4fL78sRHMxTH/N4fGUbYhcPM0MF5WFHkg==", "cpu": [ "arm64" ], @@ -868,9 +885,9 @@ } }, "node_modules/@rolldown/binding-darwin-arm64": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.1.3.tgz", - "integrity": "sha512-0NwgwsjM7LrsuVnXMK3koTpagBNOhloc/BNjKqZjv4V5zI5r13qx69uVhRx+o5Z0yy4Hzq+lpy7TAgUG/ocvrw==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.15.tgz", + "integrity": "sha512-m2WuQ6r0B4OTYxyPpNLtXaMRbRDUbG8YQV2Q3KTdSSK8Th6KHCnC8jVCJt8bvYeSB5WivkkNbc85mKadaSdOxA==", "cpu": [ "arm64" ], @@ -885,9 +902,9 @@ } }, "node_modules/@rolldown/binding-darwin-x64": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.1.3.tgz", - "integrity": "sha512-YtiBp4disu6V560loT6PjMdiRaWmVvDNrUunAalbiFx2ggeJwxdAsgZMcoGP17uyAsTwAj5V1niksxlHnVQ1Sw==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.15.tgz", + "integrity": "sha512-5RtnsHM36nodM9WbMy+zip0LGS/G+y5wro5RHrpOlr4ac24+1zSi9kiV2MP1myZeZ/ifEHfulQcWjnAXzc2C2A==", "cpu": [ "x64" ], @@ -902,9 +919,9 @@ } }, "node_modules/@rolldown/binding-freebsd-x64": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.1.3.tgz", - "integrity": "sha512-yD3EkEdXk2LypPxnf/kSZHirarsI8gcPzc62SukhR9VJTyvV+F9Q/GxWNuCojc7sXyuVC4DxRGhdDK4X8VSsbw==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.15.tgz", + "integrity": "sha512-g3l09pyFqhu+135JKkbkwiKGQmwU5hUMUPJ4VdBADvuqR8d33L6H578rh8m7rtxbdp+VmX/+nzI7nvhSZlzpUQ==", "cpu": [ "x64" ], @@ -919,9 +936,9 @@ } }, "node_modules/@rolldown/binding-linux-arm-gnueabihf": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.1.3.tgz", - "integrity": "sha512-c+8vieQbsD7HNAHKIA34w0GJ9FedFFuJGD+7E6vz7Q3uqAIugL5p45fhlsj4UaAsHpcmlqugBWMhA0/j7o0sIg==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.15.tgz", + "integrity": "sha512-nIe3VugI97nGQtspPxDqA4sXMUpeiocKIP/CqpY/u/vgbT+alX+cVxu1C/oVBPKg4feNTmYovE91v4DgXvXNwQ==", "cpu": [ "arm" ], @@ -936,13 +953,16 @@ } }, "node_modules/@rolldown/binding-linux-arm64-gnu": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.1.3.tgz", - "integrity": "sha512-50jD0uUwLvur7Zz9LHz17kaAdTPjn5wN93hEgjvmYFRZwiR7ZJYovTd5ipyWJDAnXKvZ+wgc+/Ika6dwSF5OcA==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.15.tgz", + "integrity": "sha512-iTBjXx+B5QSvgI89lJfmqh4wTh8NabR1YZIIN3hNx4zSG0EVfVqkOvLulNpG4251pbd6/IAmZ/LefVk1Y4rPhw==", "cpu": [ "arm64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -953,13 +973,16 @@ } }, "node_modules/@rolldown/binding-linux-arm64-musl": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.1.3.tgz", - "integrity": "sha512-BO9+oPL8K9poZJBfYPsXNtYjPE5uM3qeehT3aFcW4LITOl+iSqhp0abzjR2nWBUNjIZeKXjAEWBZ64WjNoHd6w==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.15.tgz", + "integrity": "sha512-uN26XOnVR7rqQupG3V9oAG2EGGatWjcJHOeDOHUFCh4TBWmP2tHTFoVN13aYbwfm0aHqJAEmcwhAu6sooIjfqQ==", "cpu": [ "arm64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -970,13 +993,16 @@ } }, "node_modules/@rolldown/binding-linux-ppc64-gnu": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.1.3.tgz", - "integrity": "sha512-f3VpLB1vQ0Eo6ecr/6cekLnvYMFF4YBFoVGkfkvPLq1bAkbAwHYQPZKoAmG6OJyTcxxoC+AvezGx/S1obNC0Mw==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.15.tgz", + "integrity": "sha512-9nWkcdd+H+XhaA3fQIwpHnKIrfx/PQ6rO0pivr78Og07tXlUlctBBJoEYLPfhTmCR/QxEVdn6uPjHV5SymPhdw==", "cpu": [ "ppc64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -987,13 +1013,16 @@ } }, "node_modules/@rolldown/binding-linux-s390x-gnu": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.1.3.tgz", - "integrity": "sha512-AmurZ26Pqx/RI9N1gzEOCklkKXl927yjfXWUUS0O7Puh8ARM/Ob8qfrD3qnWksScdw6cSrW5PSHE9DyLu7+PtA==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.15.tgz", + "integrity": "sha512-Ggh0ciFjLwIusLSLz7LZYEaGdxOAUJXI+Qu5JCbhPJJHEt8vP+IjRATTJheiJsdzzTYgUiHUiw3X1Ea3ZpMBdA==", "cpu": [ "s390x" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -1004,13 +1033,16 @@ } }, "node_modules/@rolldown/binding-linux-x64-gnu": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.1.3.tgz", - "integrity": "sha512-JJpqs8bRGITDOdbkNKnlojzBabbOHrqjSvDr0IVsZObE1lBcPjxItUEY9eWIDbxaJ3cGrXPWGfGkIxFijg/URg==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.15.tgz", + "integrity": "sha512-FHg60rS6DBePAYZ9X9F67x+JObFdmgn6tupA1C/a3B+CufFmTD4mX+e8M75tCiAO3foR/6xwVBI0KQiI7sn/rw==", "cpu": [ "x64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -1021,13 +1053,16 @@ } }, "node_modules/@rolldown/binding-linux-x64-musl": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.1.3.tgz", - "integrity": "sha512-rSJcdjPxzA/by/6/rYs+v+bXU7UjvnbUWz8MJb6kh6+knqB1dCrtHg0uu7C/4haqJvqdkYHQ5IGn+tCH9GLW/g==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.15.tgz", + "integrity": "sha512-/cvV/7v5VGz/moiz0XKRj2dE8DzsKyhIu1KpOvJGPjRywg3yscON889UGvAe8zfiJLHup7VLjBduoGWi3HusWQ==", "cpu": [ "x64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -1038,9 +1073,9 @@ } }, "node_modules/@rolldown/binding-openharmony-arm64": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.1.3.tgz", - "integrity": "sha512-hQ3/PYkDJICgevvyNcVrihVeqq7k1Pp3VZ9lY+dauAYUJKO+auqApvANhvR1An9BhmqYKvW2Mu1F9u4DXSMLxQ==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.15.tgz", + "integrity": "sha512-MyzC5Hrv/sm+Z7TSGKP/j8001RO2xQm1zOpCNVL4j0cY/VhBZviludA2YFQ7i4lH6ZAXxQm0lcMdBzM+99mE7w==", "cpu": [ "arm64" ], @@ -1054,29 +1089,10 @@ "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@rolldown/binding-wasm32-wasi": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.1.3.tgz", - "integrity": "sha512-Elcv/BtML9lXrV6JuKITc/grN2kYV9gjsQpW8Jfw4ioK0TOkjBjye0nnyqQNy9STNaI20lXNaQBRrD5gSgR0Yg==", - "cpu": [ - "wasm32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "@emnapi/core": "1.11.1", - "@emnapi/runtime": "1.11.1", - "@napi-rs/wasm-runtime": "^1.1.6" - }, - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, "node_modules/@rolldown/binding-win32-arm64-msvc": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.1.3.tgz", - "integrity": "sha512-2DrEfhluH9yhiaFApmsjsjwrSYbNcY1oFTzYSP1a535jDbV98zCFanA/96TBUd0iDFcxGmw9QRExwGCXz3U+/g==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.15.tgz", + "integrity": "sha512-+PgYiS+AH5omy6L45ZLxybasauJaj3M8buoT83D+nzPmCayXlxUV9hydhciCKVyIg0B/v0BtXPDE1uGqNwCPpg==", "cpu": [ "arm64" ], @@ -1091,9 +1107,9 @@ } }, "node_modules/@rolldown/binding-win32-x64-msvc": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.1.3.tgz", - "integrity": "sha512-OL4OMk7UPXOeVGGd3qo5zJyPIljf4AFgk5QAkPPS+OoLuOOozhuaQGC18MxVTnw/06q93gShAJzlwnSCY9YtqA==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.15.tgz", + "integrity": "sha512-HFZd2QNQYn1JbIi+Hpd7H+r/lkWxcfIu28nirZ6eCn2LafuvmExMlb/P96Sfx5tf7pPArw39IdhmCF8vmV+NhQ==", "cpu": [ "x64" ], @@ -1913,16 +1929,16 @@ } }, "node_modules/@vitest/expect": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.1.11.tgz", - "integrity": "sha512-VX2x5vNJXET47KAFzwERI+KRMtTTCSWTfSMKsW7JsUsXV4psq++e3DvZpuTDOpHcxytiDs6p2nhVb2tVDiiUYw==", + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.1.12.tgz", + "integrity": "sha512-vFlTt+YEu9WBpNjdGayNmlMVzrWPi1+sv853/7t2FU7hpO5gAFBKHzQmkCq5Xjpr+evegF2994LQT3hF3mRlqQ==", "dev": true, "license": "MIT", "dependencies": { "@standard-schema/spec": "^1.1.0", "@types/chai": "^5.2.2", - "@vitest/spy": "4.1.11", - "@vitest/utils": "4.1.11", + "@vitest/spy": "4.1.12", + "@vitest/utils": "4.1.12", "chai": "^6.2.2", "tinyrainbow": "^3.1.0" }, @@ -1931,13 +1947,13 @@ } }, "node_modules/@vitest/mocker": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-4.1.11.tgz", - "integrity": "sha512-2XJVD55d1o5AZous5CCGKS74g/riOj9odEt2bQpCVZeblHyHdnMeFl4jl0XjU21stf4mbjUkew2eXQZt65g5CQ==", + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-4.1.12.tgz", + "integrity": "sha512-fKShNpKZzupWZuY0z7egydvL0sqW4INEZBEExMBMAa6izlENEVHwoXgdaTCaBZ5fwlr4xf2o1wXC83n9RpO+NA==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/spy": "4.1.11", + "@vitest/spy": "4.1.12", "estree-walker": "^3.0.3", "magic-string": "^0.30.21" }, @@ -1958,9 +1974,9 @@ } }, "node_modules/@vitest/pretty-format": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-4.1.11.tgz", - "integrity": "sha512-yiZzPbGTS9Sr/JpFl8zHrcIkAofNbFV6k21vIgQN/cY/oxZeXhJv5sc/MBJ5jFKWmWs+oJHw0UXLZjmf931+Vw==", + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-4.1.12.tgz", + "integrity": "sha512-XW9O8+Mxx4VpCtkYdMJLZQQwsVryP9wk7cPKDxtXFfwSak6yRh5+2fep/Y0XF/ElBvJHq8bcYdi6aeuai0opZA==", "dev": true, "license": "MIT", "dependencies": { @@ -1971,13 +1987,13 @@ } }, "node_modules/@vitest/runner": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-4.1.11.tgz", - "integrity": "sha512-LztvUgdwMNJMIkj3hQnnxiC2Xy1zNxq928W/xhjCLaNCzqTZOudjwbQf6v9IntZGPw132i2Lq2rgTRZHD3JHNw==", + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-4.1.12.tgz", + "integrity": "sha512-NKlVKCr5QnCe8jijdMnmkpHHU+WTqiLFR6G0pHji9uRjXK9xJl1k1nTw6F3pOOj2PDcsDt2GKQMI7wIsaT491w==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/utils": "4.1.11", + "@vitest/utils": "4.1.12", "pathe": "^2.0.3" }, "funding": { @@ -1985,14 +2001,14 @@ } }, "node_modules/@vitest/snapshot": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-4.1.11.tgz", - "integrity": "sha512-pN7ikn1ON7h8ee4gIAp4AzyK+zBtJPzVbqOgu5LCEh4VaJVbPQcgYQYJIMGQPXVeJJq1fnfazis7a5pFNPahog==", + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-4.1.12.tgz", + "integrity": "sha512-ko1y1Qgb/slzQ9mr+b89Cuqud8WG1TKtsPD8r7ZUBdvVOGt85Af2HwCqHujrhwJq95hs/9RM7fcAPg57o1vlzw==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/pretty-format": "4.1.11", - "@vitest/utils": "4.1.11", + "@vitest/pretty-format": "4.1.12", + "@vitest/utils": "4.1.12", "magic-string": "^0.30.21", "pathe": "^2.0.3" }, @@ -2001,9 +2017,9 @@ } }, "node_modules/@vitest/spy": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-4.1.11.tgz", - "integrity": "sha512-apNa/prQy2qCeywhnixOHPRCgGNhvg7T4Dapfl1GahLp/R+uhBm5cPyFoNVyqsNd2h1nJxL6BqqdIjiABL60YA==", + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-4.1.12.tgz", + "integrity": "sha512-RGq9x4JNGNTZHEJxvN0oSiJjeSCExm0n2gZKKJZHY9cX5AVA6M7VJILBT3ZJ/tJ/0J9uWT7fETV9/btoi//vSg==", "dev": true, "license": "MIT", "funding": { @@ -2011,13 +2027,13 @@ } }, "node_modules/@vitest/utils": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-4.1.11.tgz", - "integrity": "sha512-zTCVGpyFsGWBhllOyKlTw/vnr6D9qxsfSDyfbyZmTyjHw5N/VuvzHpHoQjm2ZJzn4RJgx5w4r7V0er69CmLgPQ==", + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-4.1.12.tgz", + "integrity": "sha512-Q3awXrwOfEV+qc3WmO5ONyE0yO7Q1gQ9/oyHxGLZ/pl7N3NO/ZztqQwKLuwMkV+CA1JYSIeO3gkHnRDIo4AVaA==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/pretty-format": "4.1.11", + "@vitest/pretty-format": "4.1.12", "convert-source-map": "^2.0.0", "tinyrainbow": "^3.1.0" }, @@ -2226,9 +2242,9 @@ "license": "CC-BY-4.0" }, "node_modules/chai": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/chai/-/chai-6.2.2.tgz", - "integrity": "sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-6.3.0.tgz", + "integrity": "sha512-XWAtwJ6OHO+tj0EKCs0Y2UamnyOxseZWltU4x2U2wh8g4AigdjwvtUjvLP2tqkA/avxHEtzxNaqGq/YGNwckKg==", "dev": true, "license": "MIT", "engines": { @@ -3467,9 +3483,9 @@ "license": "MIT" }, "node_modules/nanoid": { - "version": "3.3.18", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.18.tgz", - "integrity": "sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w==", + "version": "3.3.20", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz", + "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==", "dev": true, "funding": [ { @@ -3624,9 +3640,9 @@ "license": "ISC" }, "node_modules/picomatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", - "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", + "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", "dev": true, "license": "MIT", "engines": { @@ -3637,9 +3653,9 @@ } }, "node_modules/postcss": { - "version": "8.5.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.26.tgz", - "integrity": "sha512-u82N74LFzG8ca+dD8puPnplTXoGH4fTPpVGuIbt36G3qvNlkvfD0lEAZSxaly3KX8TS/L1A1gsCEmvKmBcVbkQ==", + "version": "8.5.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.31.tgz", + "integrity": "sha512-YUbWYCgErwnMAVkjUnYa+KlMBzGpHwiIt/DE7f0G33AuX2LH9UcTk6KgWxd3zRU+pN3u/C+Xl3EnMLM4Hea7Sg==", "dev": true, "funding": [ { @@ -3657,9 +3673,9 @@ ], "license": "MIT", "dependencies": { - "nanoid": "^3.3.17", + "nanoid": "^3.3.20", "picocolors": "^1.1.1", - "source-map-js": "^1.2.1" + "source-map-js": "^1.2.2" }, "engines": { "node": "^10 || ^12 || >=14" @@ -3779,13 +3795,13 @@ } }, "node_modules/rolldown": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.1.3.tgz", - "integrity": "sha512-1F1eEtUBtFvcGm1HQ9TiUIUHPQG7mSAODrhIzjxoUEFuo8OcbrGLiVLkevNgj84TE4lnHvnumwFjhJO5Eu135g==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.15.tgz", + "integrity": "sha512-6odND+fel5zVw3I4Yc2e69gvguDnX0CAAGiNDZSq4ik5WUcaLrkD2GLuog0XcODbor31hZ5ayEMgVDno+KPV5g==", "dev": true, "license": "MIT", "dependencies": { - "@oxc-project/types": "=0.137.0", + "@oxc-project/types": "=0.155.0", "@rolldown/pluginutils": "^1.0.0" }, "bin": { @@ -3795,21 +3811,21 @@ "node": "^20.19.0 || >=22.12.0" }, "optionalDependencies": { - "@rolldown/binding-android-arm64": "1.1.3", - "@rolldown/binding-darwin-arm64": "1.1.3", - "@rolldown/binding-darwin-x64": "1.1.3", - "@rolldown/binding-freebsd-x64": "1.1.3", - "@rolldown/binding-linux-arm-gnueabihf": "1.1.3", - "@rolldown/binding-linux-arm64-gnu": "1.1.3", - "@rolldown/binding-linux-arm64-musl": "1.1.3", - "@rolldown/binding-linux-ppc64-gnu": "1.1.3", - "@rolldown/binding-linux-s390x-gnu": "1.1.3", - "@rolldown/binding-linux-x64-gnu": "1.1.3", - "@rolldown/binding-linux-x64-musl": "1.1.3", - "@rolldown/binding-openharmony-arm64": "1.1.3", - "@rolldown/binding-wasm32-wasi": "1.1.3", - "@rolldown/binding-win32-arm64-msvc": "1.1.3", - "@rolldown/binding-win32-x64-msvc": "1.1.3" + "@rolldown/binding-android-arm-eabi": "1.2.15", + "@rolldown/binding-android-arm64": "1.2.15", + "@rolldown/binding-darwin-arm64": "1.2.15", + "@rolldown/binding-darwin-x64": "1.2.15", + "@rolldown/binding-freebsd-x64": "1.2.15", + "@rolldown/binding-linux-arm-gnueabihf": "1.2.15", + "@rolldown/binding-linux-arm64-gnu": "1.2.15", + "@rolldown/binding-linux-arm64-musl": "1.2.15", + "@rolldown/binding-linux-ppc64-gnu": "1.2.15", + "@rolldown/binding-linux-s390x-gnu": "1.2.15", + "@rolldown/binding-linux-x64-gnu": "1.2.15", + "@rolldown/binding-linux-x64-musl": "1.2.15", + "@rolldown/binding-openharmony-arm64": "1.2.15", + "@rolldown/binding-win32-arm64-msvc": "1.2.15", + "@rolldown/binding-win32-x64-msvc": "1.2.15" } }, "node_modules/rolldown/node_modules/@rolldown/pluginutils": { @@ -4004,9 +4020,9 @@ } }, "node_modules/tinyrainbow": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-3.1.1.tgz", - "integrity": "sha512-yau8yJdTt989Mm0Bd/236QnzEiPf2xLLTqUZRUJOo/3CB078LSwzei343DgtJVmfJKJE3TMINY1u42SQsP6mXw==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-3.2.0.tgz", + "integrity": "sha512-LgO3D9yZJjApUiuUfl9iFAwrtaX4+lok3wJIqttGoKCHlWUqHqbQpnxCf82L8FjgKsh4iGo78hqJwgL8F6To2A==", "dev": true, "license": "MIT", "engines": { @@ -4190,16 +4206,16 @@ } }, "node_modules/vite": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/vite/-/vite-8.1.0.tgz", - "integrity": "sha512-BuJcQK/56NQTWDGn4ABea3q4SSBdNPWwNZKTkkUpcMPnLoquSYH8llRtSUIgoL1KSCpHt5eghLShn50mH36y7Q==", + "version": "8.3.5", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.3.5.tgz", + "integrity": "sha512-z1YpjieJ9g0ebTmQpLBv/oq9E3F9EIlOe+7LahW8SrE3LTiG3udBRUXQOlYXP9b+IC2q2phHeVxj9xGlw34OEQ==", "dev": true, "license": "MIT", "dependencies": { - "lightningcss": "^1.32.0", - "picomatch": "^4.0.4", - "postcss": "^8.5.15", - "rolldown": "~1.1.2", + "lightningcss": "^1.33.0", + "picomatch": "^4.0.7", + "postcss": "^8.5.30", + "rolldown": "~1.2.14", "tinyglobby": "^0.2.17" }, "bin": { @@ -4216,7 +4232,7 @@ }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", - "@vitejs/devtools": "^0.3.0", + "@vitejs/devtools": "^0.7.1 || ^0.8.0", "esbuild": "^0.27.0 || ^0.28.0", "jiti": ">=1.21.0", "less": "^4.0.0", @@ -4267,20 +4283,293 @@ } } }, + "node_modules/vite/node_modules/lightningcss": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.33.0.tgz", + "integrity": "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.33.0", + "lightningcss-darwin-arm64": "1.33.0", + "lightningcss-darwin-x64": "1.33.0", + "lightningcss-freebsd-x64": "1.33.0", + "lightningcss-linux-arm-gnueabihf": "1.33.0", + "lightningcss-linux-arm64-gnu": "1.33.0", + "lightningcss-linux-arm64-musl": "1.33.0", + "lightningcss-linux-x64-gnu": "1.33.0", + "lightningcss-linux-x64-musl": "1.33.0", + "lightningcss-win32-arm64-msvc": "1.33.0", + "lightningcss-win32-x64-msvc": "1.33.0" + } + }, + "node_modules/vite/node_modules/lightningcss-android-arm64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.33.0.tgz", + "integrity": "sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/vite/node_modules/lightningcss-darwin-arm64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.33.0.tgz", + "integrity": "sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/vite/node_modules/lightningcss-darwin-x64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.33.0.tgz", + "integrity": "sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/vite/node_modules/lightningcss-freebsd-x64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.33.0.tgz", + "integrity": "sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/vite/node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.33.0.tgz", + "integrity": "sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/vite/node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.33.0.tgz", + "integrity": "sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/vite/node_modules/lightningcss-linux-arm64-musl": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.33.0.tgz", + "integrity": "sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/vite/node_modules/lightningcss-linux-x64-gnu": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.33.0.tgz", + "integrity": "sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/vite/node_modules/lightningcss-linux-x64-musl": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.33.0.tgz", + "integrity": "sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/vite/node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.33.0.tgz", + "integrity": "sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/vite/node_modules/lightningcss-win32-x64-msvc": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.33.0.tgz", + "integrity": "sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, "node_modules/vitest": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-4.1.11.tgz", - "integrity": "sha512-fhACrNXUidIbGSBr5FlbuBkO7VWC1ZyLl0DO4CU2DrQoAPxX84Ysxs+HeGQpii5lZWV1Q4gBZTTu49mF+A6Edw==", + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-4.1.12.tgz", + "integrity": "sha512-5eWdz2yb3ajxWF3C8C4TjkXl7FGm3n2E/VlazALrQHzK7nYMSGFnCZto0bbPNl77AwkOZVLk0YnBAejUu0NiWA==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/expect": "4.1.11", - "@vitest/mocker": "4.1.11", - "@vitest/pretty-format": "4.1.11", - "@vitest/runner": "4.1.11", - "@vitest/snapshot": "4.1.11", - "@vitest/spy": "4.1.11", - "@vitest/utils": "4.1.11", + "@vitest/expect": "4.1.12", + "@vitest/mocker": "4.1.12", + "@vitest/pretty-format": "4.1.12", + "@vitest/runner": "4.1.12", + "@vitest/snapshot": "4.1.12", + "@vitest/spy": "4.1.12", + "@vitest/utils": "4.1.12", "es-module-lexer": "^2.0.0", "expect-type": "^1.3.0", "magic-string": "^0.30.21", @@ -4308,12 +4597,12 @@ "@edge-runtime/vm": "*", "@opentelemetry/api": "^1.9.0", "@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0", - "@vitest/browser-playwright": "4.1.11", - "@vitest/browser-preview": "4.1.11", - "@vitest/browser-webdriverio": "4.1.11", - "@vitest/coverage-istanbul": "4.1.11", - "@vitest/coverage-v8": "4.1.11", - "@vitest/ui": "4.1.11", + "@vitest/browser-playwright": "4.1.12", + "@vitest/browser-preview": "4.1.12", + "@vitest/browser-webdriverio": "^4.1.11", + "@vitest/coverage-istanbul": "4.1.12", + "@vitest/coverage-v8": "4.1.12", + "@vitest/ui": "4.1.12", "happy-dom": "*", "jsdom": "*", "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" diff --git a/gallery_ui/package.json b/gallery_ui/package.json index 906b4d4..32cf32f 100644 --- a/gallery_ui/package.json +++ b/gallery_ui/package.json @@ -1,7 +1,7 @@ { "name": "gallery_ui", "private": true, - "version": "1.7.0", + "version": "1.8.0", "type": "module", "scripts": { "dev": "vite", @@ -41,7 +41,7 @@ "tailwindcss": "^4.2.2", "typescript": "~6.0.2", "typescript-eslint": "^8.58.0", - "vite": "^8.0.4", - "vitest": "^4.1.5" + "vite": "^8.3.5", + "vitest": "^4.1.12" } } diff --git a/pyproject.toml b/pyproject.toml index 69872b9..d8b2d93 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "tera-universal-extractor" description = "ComfyUI custom node and gallery workspace for prompt libraries, searchable image notes, and reusable extraction workflows." -version = "1.7.0" +version = "1.8.0" license = { file = "LICENSE.txt" } readme = "README.md" requires-python = ">=3.10"