@dickpy/dsh-imagegen 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -10
- package/docs/images/agent-chat-edit.png +0 -0
- package/docs/images/agent-chat-generate.png +0 -0
- package/lib/client.js +687 -355
- package/lib/client.js.map +1 -1
- package/lib/index.js +664 -164
- package/package.json +4 -1
- package/src/agent-image-tools.ts +289 -0
- package/src/client/ImageGenPanel.tsx +30 -22
- package/src/client/SettingsCard.tsx +261 -70
- package/src/client/locales.ts +40 -0
- package/src/client/settings-card.module.css +180 -0
- package/src/client/settings-form.ts +12 -0
- package/src/client/settings-scope.ts +2 -0
- package/src/engine.ts +29 -2
- package/src/generation-runtime.ts +48 -0
- package/src/image-models.ts +19 -0
- package/src/index.ts +48 -2
- package/src/prompt-enhancer.ts +17 -5
- package/src/protocol.ts +6 -1
- package/src/routes.ts +41 -33
- package/src/task-queue.ts +36 -3
package/lib/client.js
CHANGED
|
@@ -11,8 +11,6 @@ window.__ModuleLoader__.load({
|
|
|
11
11
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
12
12
|
let _deepseek_ai_dsh_client_runtime_client = require("@deepseek-ai/dsh-client-runtime/client");
|
|
13
13
|
//#region src/protocol.ts
|
|
14
|
-
/** Published package version shared by the host updater and the client UI. */
|
|
15
|
-
const PLUGIN_VERSION = "1.1.0";
|
|
16
14
|
/** Same-origin route family (loopback-only, mirroring the dsh-ssh fence). */
|
|
17
15
|
const SETTINGS_API = {
|
|
18
16
|
describe: "/api/dsh-imagegen/settings/describe",
|
|
@@ -25,6 +23,8 @@ window.__ModuleLoader__.load({
|
|
|
25
23
|
models: "/api/dsh-imagegen/prompt-enhance/models",
|
|
26
24
|
enhance: "/api/dsh-imagegen/prompt-enhance"
|
|
27
25
|
};
|
|
26
|
+
/** Host-mediated candidate discovery for the configured image API. */
|
|
27
|
+
const IMAGE_MODEL_API = { models: "/api/dsh-imagegen/image-models" };
|
|
28
28
|
/** Host-resident generation queue endpoints. */
|
|
29
29
|
const TASK_API = {
|
|
30
30
|
submit: "/api/dsh-imagegen/tasks/submit",
|
|
@@ -436,6 +436,20 @@ window.__ModuleLoader__.load({
|
|
|
436
436
|
"settings.apiKeyHint": "Bearer 密钥,明文存于本机设置文档;界面只显示是否已设置",
|
|
437
437
|
"settings.apiKeySet": "已保存密钥;输入新值可更换,点击「清除」可删除",
|
|
438
438
|
"settings.apiKeyClear": "清除",
|
|
439
|
+
"settings.imageModelsTitle": "生图模型",
|
|
440
|
+
"settings.imageModelsHint": "保存 API 地址和密钥后检测候选模型;请只选择实际支持生图的项。",
|
|
441
|
+
"settings.imageModels": "允许使用的生图模型",
|
|
442
|
+
"settings.imageModelsManualHint": "一行一个模型;API 未提供 /models 时可手动填写。面板和 Agent 只能使用此列表。",
|
|
443
|
+
"settings.imageModelsFetch": "检测可用模型",
|
|
444
|
+
"settings.imageModelsLoading": "检测中…",
|
|
445
|
+
"settings.imageModelsCandidates": "检测到的候选模型(勾选后保存)",
|
|
446
|
+
"settings.addModel": "+ 手动添加",
|
|
447
|
+
"settings.cancelAddModel": "收起添加",
|
|
448
|
+
"settings.addModelPlaceholder": "输入模型名称,例如 qwen-image",
|
|
449
|
+
"settings.addModelConfirm": "添加",
|
|
450
|
+
"settings.removeModel": "移除模型",
|
|
451
|
+
"settings.optional": "可选",
|
|
452
|
+
"settings.moreOptions": "更多设置",
|
|
439
453
|
"settings.promptEnhanceTitle": "提示词增强模型",
|
|
440
454
|
"settings.promptEnhanceHint": "用于将简短描述扩写为更完整的生图提示词;留空的地址和密钥会复用生图配置。",
|
|
441
455
|
"settings.promptApiUrl": "对话 API 地址(可选)",
|
|
@@ -444,11 +458,17 @@ window.__ModuleLoader__.load({
|
|
|
444
458
|
"settings.promptApiKeyHint": "留空则复用图像 API 密钥。",
|
|
445
459
|
"settings.promptModel": "对话模型",
|
|
446
460
|
"settings.promptModelHint": "选择或填写支持 /chat/completions 的模型。",
|
|
461
|
+
"settings.promptModelDetectionHint": "默认复用生图 API;检测后点选一个模型即可。",
|
|
447
462
|
"settings.promptModelsFetch": "获取可用模型",
|
|
448
463
|
"settings.promptModelsLoading": "正在获取…",
|
|
449
464
|
"settings.promptModelsSelect": "选择一个模型",
|
|
465
|
+
"settings.promptModelsCandidates": "检测到的候选对话模型",
|
|
466
|
+
"settings.addPromptModelPlaceholder": "输入对话模型名称,例如 gpt-4.1-mini",
|
|
467
|
+
"settings.promptApiAdvanced": "使用独立对话 API(可选)",
|
|
450
468
|
"settings.announceToAgent": "向 Agent 播报本插件",
|
|
451
469
|
"settings.announceToAgentHint": "开启后,本插件的存在与能力会写入每个 Agent 的系统提示词",
|
|
470
|
+
"settings.allowAgentImageGeneration": "允许 Agent 调用生图",
|
|
471
|
+
"settings.allowAgentImageGenerationHint": "默认开启。关闭后,Agent 无法提交、查询或取消生图任务;侧边栏工作台不受影响。",
|
|
452
472
|
"settings.enabled": "启用插件",
|
|
453
473
|
"settings.enabledHint": "关闭后生图面板不可用(设置卡片始终可用)",
|
|
454
474
|
"settings.save": "保存",
|
|
@@ -651,6 +671,20 @@ window.__ModuleLoader__.load({
|
|
|
651
671
|
"settings.apiKeyHint": "Bearer key, stored in plaintext in the local settings document; the UI only shows whether it is set",
|
|
652
672
|
"settings.apiKeySet": "A key is stored; type a new value to replace it, or click \"Clear\" to remove it",
|
|
653
673
|
"settings.apiKeyClear": "Clear",
|
|
674
|
+
"settings.imageModelsTitle": "Image generation models",
|
|
675
|
+
"settings.imageModelsHint": "Save the API URL and key, then detect candidate models. Select only models that actually support image generation.",
|
|
676
|
+
"settings.imageModels": "Allowed image models",
|
|
677
|
+
"settings.imageModelsManualHint": "One model per line. Add models manually when the API does not provide /models. The panel and Agent can use only this list.",
|
|
678
|
+
"settings.imageModelsFetch": "Detect available models",
|
|
679
|
+
"settings.imageModelsLoading": "Detecting…",
|
|
680
|
+
"settings.imageModelsCandidates": "Detected candidate models (select, then save)",
|
|
681
|
+
"settings.addModel": "+ Add manually",
|
|
682
|
+
"settings.cancelAddModel": "Hide add",
|
|
683
|
+
"settings.addModelPlaceholder": "Enter a model name, e.g. qwen-image",
|
|
684
|
+
"settings.addModelConfirm": "Add",
|
|
685
|
+
"settings.removeModel": "Remove model",
|
|
686
|
+
"settings.optional": "Optional",
|
|
687
|
+
"settings.moreOptions": "More settings",
|
|
654
688
|
"settings.promptEnhanceTitle": "Prompt enhancement model",
|
|
655
689
|
"settings.promptEnhanceHint": "Expands short requests into complete image prompts. Blank URL and key reuse the image API configuration.",
|
|
656
690
|
"settings.promptApiUrl": "Chat API URL (optional)",
|
|
@@ -659,11 +693,17 @@ window.__ModuleLoader__.load({
|
|
|
659
693
|
"settings.promptApiKeyHint": "Leave blank to reuse the image API key.",
|
|
660
694
|
"settings.promptModel": "Chat model",
|
|
661
695
|
"settings.promptModelHint": "Select or enter a model supporting /chat/completions.",
|
|
696
|
+
"settings.promptModelDetectionHint": "Uses the image API by default. Detect and select one model.",
|
|
662
697
|
"settings.promptModelsFetch": "Fetch available models",
|
|
663
698
|
"settings.promptModelsLoading": "Fetching…",
|
|
664
699
|
"settings.promptModelsSelect": "Select a model",
|
|
700
|
+
"settings.promptModelsCandidates": "Detected chat model candidates",
|
|
701
|
+
"settings.addPromptModelPlaceholder": "Enter a chat model name, e.g. gpt-4.1-mini",
|
|
702
|
+
"settings.promptApiAdvanced": "Use a separate chat API (optional)",
|
|
665
703
|
"settings.announceToAgent": "Announce this plugin to agents",
|
|
666
704
|
"settings.announceToAgentHint": "When on, the plugin presence and capabilities are written into every agent system prompt",
|
|
705
|
+
"settings.allowAgentImageGeneration": "Allow agents to generate images",
|
|
706
|
+
"settings.allowAgentImageGenerationHint": "On by default. When off, agents cannot submit, query, or cancel image tasks; the sidebar studio remains available.",
|
|
667
707
|
"settings.enabled": "Enable plugin",
|
|
668
708
|
"settings.enabledHint": "When off, the generation studio is unavailable (this card stays available)",
|
|
669
709
|
"settings.save": "Save",
|
|
@@ -745,47 +785,47 @@ window.__ModuleLoader__.load({
|
|
|
745
785
|
document.head.appendChild(tag);
|
|
746
786
|
}
|
|
747
787
|
var templates_module_css_default = {
|
|
748
|
-
"overlay": "o0mAxG_overlay",
|
|
749
|
-
"spinner": "o0mAxG_spinner",
|
|
750
788
|
"categoryRow": "o0mAxG_categoryRow",
|
|
751
|
-
"
|
|
752
|
-
"
|
|
789
|
+
"header": "o0mAxG_header",
|
|
790
|
+
"thumbPlaceholder": "o0mAxG_thumbPlaceholder",
|
|
791
|
+
"dsh-imagegen-templates-spin": "o0mAxG_dsh-imagegen-templates-spin",
|
|
753
792
|
"detailInfo": "o0mAxG_detailInfo",
|
|
754
793
|
"card": "o0mAxG_card",
|
|
755
|
-
"cardMeta": "o0mAxG_cardMeta",
|
|
756
|
-
"notice": "o0mAxG_notice",
|
|
757
|
-
"detailMeta": "o0mAxG_detailMeta",
|
|
758
|
-
"body": "o0mAxG_body",
|
|
759
|
-
"detailPrompt": "o0mAxG_detailPrompt",
|
|
760
|
-
"grid": "o0mAxG_grid",
|
|
761
794
|
"detailLink": "o0mAxG_detailLink",
|
|
762
|
-
"
|
|
763
|
-
"detailOverlay": "o0mAxG_detailOverlay",
|
|
795
|
+
"detailPrompt": "o0mAxG_detailPrompt",
|
|
764
796
|
"thumb": "o0mAxG_thumb",
|
|
765
|
-
"
|
|
766
|
-
"
|
|
767
|
-
"shell": "o0mAxG_shell",
|
|
768
|
-
"state": "o0mAxG_state",
|
|
769
|
-
"toolbar": "o0mAxG_toolbar",
|
|
770
|
-
"detailImage": "o0mAxG_detailImage",
|
|
771
|
-
"cardTitle": "o0mAxG_cardTitle",
|
|
772
|
-
"title": "o0mAxG_title",
|
|
797
|
+
"cardCategory": "o0mAxG_cardCategory",
|
|
798
|
+
"detailMedia": "o0mAxG_detailMedia",
|
|
773
799
|
"detailActions": "o0mAxG_detailActions",
|
|
800
|
+
"title": "o0mAxG_title",
|
|
801
|
+
"heading": "o0mAxG_heading",
|
|
802
|
+
"overlay": "o0mAxG_overlay",
|
|
803
|
+
"headerActions": "o0mAxG_headerActions",
|
|
804
|
+
"cardSource": "o0mAxG_cardSource",
|
|
774
805
|
"sourceLink": "o0mAxG_sourceLink",
|
|
775
|
-
"footer": "o0mAxG_footer",
|
|
776
|
-
"cardCategory": "o0mAxG_cardCategory",
|
|
777
|
-
"header": "o0mAxG_header",
|
|
778
|
-
"featuredBadge": "o0mAxG_featuredBadge",
|
|
779
|
-
"attribution": "o0mAxG_attribution",
|
|
780
|
-
"detail": "o0mAxG_detail",
|
|
781
|
-
"thumbWrap": "o0mAxG_thumbWrap",
|
|
782
806
|
"meta": "o0mAxG_meta",
|
|
783
807
|
"search": "o0mAxG_search",
|
|
784
|
-
"
|
|
785
|
-
"
|
|
808
|
+
"notice": "o0mAxG_notice",
|
|
809
|
+
"categoryPill": "o0mAxG_categoryPill",
|
|
810
|
+
"cardTitle": "o0mAxG_cardTitle",
|
|
811
|
+
"featuredBadge": "o0mAxG_featuredBadge",
|
|
812
|
+
"spinner": "o0mAxG_spinner",
|
|
813
|
+
"cardMeta": "o0mAxG_cardMeta",
|
|
814
|
+
"body": "o0mAxG_body",
|
|
786
815
|
"close": "o0mAxG_close",
|
|
787
|
-
"
|
|
788
|
-
"
|
|
816
|
+
"footer": "o0mAxG_footer",
|
|
817
|
+
"attribution": "o0mAxG_attribution",
|
|
818
|
+
"detailOverlay": "o0mAxG_detailOverlay",
|
|
819
|
+
"detailImage": "o0mAxG_detailImage",
|
|
820
|
+
"grid": "o0mAxG_grid",
|
|
821
|
+
"detailTitle": "o0mAxG_detailTitle",
|
|
822
|
+
"detailMeta": "o0mAxG_detailMeta",
|
|
823
|
+
"cardBody": "o0mAxG_cardBody",
|
|
824
|
+
"toolbar": "o0mAxG_toolbar",
|
|
825
|
+
"shell": "o0mAxG_shell",
|
|
826
|
+
"state": "o0mAxG_state",
|
|
827
|
+
"thumbWrap": "o0mAxG_thumbWrap",
|
|
828
|
+
"detail": "o0mAxG_detail"
|
|
789
829
|
};
|
|
790
830
|
//#endregion
|
|
791
831
|
//#region src/client/TemplateLibrary.tsx
|
|
@@ -1261,6 +1301,25 @@ window.__ModuleLoader__.load({
|
|
|
1261
1301
|
}), document.body);
|
|
1262
1302
|
}
|
|
1263
1303
|
//#endregion
|
|
1304
|
+
//#region src/image-models.ts
|
|
1305
|
+
/**
|
|
1306
|
+
* Image-model configuration shared by the host, panel, and Agent tools.
|
|
1307
|
+
* `/models` exposes candidates only: the configured list is the explicit
|
|
1308
|
+
* allow-list because OpenAI-compatible gateways rarely advertise modalities.
|
|
1309
|
+
*/
|
|
1310
|
+
const DEFAULT_IMAGE_MODELS = ["gpt-image-2", "grok-imagine-image"];
|
|
1311
|
+
/** Normalize user-entered model identifiers and retain a usable legacy default. */
|
|
1312
|
+
function normalizeImageModels(value) {
|
|
1313
|
+
const candidates = Array.isArray(value) ? value : [];
|
|
1314
|
+
const unique = /* @__PURE__ */ new Set();
|
|
1315
|
+
for (const candidate of candidates) {
|
|
1316
|
+
if (typeof candidate !== "string") continue;
|
|
1317
|
+
const model = candidate.trim();
|
|
1318
|
+
if (model !== "") unique.add(model);
|
|
1319
|
+
}
|
|
1320
|
+
return unique.size > 0 ? [...unique] : [...DEFAULT_IMAGE_MODELS];
|
|
1321
|
+
}
|
|
1322
|
+
//#endregion
|
|
1264
1323
|
//#region \0dsh-css:E:\dsh-plugin\src\client\panel.module.css.mjs
|
|
1265
1324
|
const css$1 = "[data-pane=conversation],[class*=centerCol]{position:relative}[data-dsh-imagegen-view]{z-index:60;background:var(--dsw-alias-bg-base);display:none;position:absolute;inset:0}html[data-dsh-imagegen-active]:not([data-dsh-taskboard-active]):not([data-dsh-ssh-active]) [data-dsh-imagegen-view]{display:block}html[data-dsh-imagegen-active]:not([data-dsh-taskboard-active]):not([data-dsh-ssh-active]) [data-pane=conversation]>:not([data-dsh-imagegen-view]),html[data-dsh-imagegen-active]:not([data-dsh-taskboard-active]):not([data-dsh-ssh-active]) [class*=centerCol]>:not([data-dsh-imagegen-view]){display:none!important}.Yvqh9W_entry{width:100%;height:32px;color:var(--dsw-alias-label-secondary);cursor:pointer;white-space:nowrap;background:0 0;border:none;border-radius:8px;align-items:center;gap:8px;padding:0 12px;font-size:13px;display:flex}.Yvqh9W_entry:hover{background:var(--dsw-specific-sidebar-nav-item-hover);color:var(--dsw-alias-label-primary)}.Yvqh9W_entry[data-active]{background:var(--dsw-specific-sidebar-nav-item-active);color:var(--dsw-alias-label-primary);font-weight:600}.Yvqh9W_entryIcon{flex:none;justify-content:center;align-items:center;display:inline-flex}.Yvqh9W_entryLabel{text-overflow:ellipsis;overflow:hidden}[data-dsh-frame][data-sidebar-collapsed] .Yvqh9W_entry{justify-content:center;width:100%;padding:0}[data-dsh-frame][data-sidebar-collapsed] .Yvqh9W_entryLabel{display:none}.Yvqh9W_view{overflow:hidden}.Yvqh9W_panel,.Yvqh9W_panel *,.Yvqh9W_panel :before,.Yvqh9W_panel :after{box-sizing:border-box}.Yvqh9W_panel{background:var(--dsw-alias-bg-base);min-width:0;height:100%;min-height:0;color:var(--dsw-alias-label-primary);font-family:var(--dsw-font-family);flex-direction:column;gap:10px;padding:14px 16px 16px;display:flex;position:relative;overflow:hidden}.Yvqh9W_panelHeader{flex:none;justify-content:space-between;align-items:center;gap:12px;display:flex}.Yvqh9W_panelHeading{align-items:baseline;gap:10px;min-width:0;display:flex}.Yvqh9W_panelTitle{color:var(--dsw-alias-label-primary);white-space:nowrap;margin:0;font-size:16px;font-weight:700}.Yvqh9W_githubLink{width:22px;height:22px;color:var(--dsw-alias-label-secondary);border-radius:6px;flex:none;justify-content:center;align-items:center;text-decoration:none;transition:color .12s,background .12s;display:inline-flex}.Yvqh9W_githubLink:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-2)}.Yvqh9W_connectionStatus{border:1px solid var(--dsw-alias-label-error);height:28px;color:var(--dsw-alias-label-error);font:inherit;white-space:nowrap;background:0 0;border-radius:8px;flex:none;align-items:center;gap:6px;padding:0 10px;font-size:12px;line-height:1;display:inline-flex}.Yvqh9W_connectionStatus[data-connected=true]{border-color:var(--dsw-alias-state-success-primary);color:var(--dsw-alias-state-success-primary)}.Yvqh9W_connectionDot{background:currentColor;border-radius:50%;width:6px;height:6px}.Yvqh9W_updateBanner{border:1px solid var(--dsw-alias-state-warn-primary);color:var(--dsw-alias-state-warn-primary);overflow-wrap:anywhere;border-radius:10px;flex:none;justify-content:space-between;align-items:center;gap:12px;padding:7px 10px 7px 12px;font-size:12px;line-height:1.5;display:flex}.Yvqh9W_updateBanner[data-kind=ok]{color:var(--dsw-alias-state-success-primary);border-color:var(--dsw-alias-state-success-primary)}.Yvqh9W_updateText{min-width:0}.Yvqh9W_updateActions{flex:none;align-items:center;gap:10px;display:inline-flex}.Yvqh9W_updateRelease{color:inherit;text-underline-offset:2px;white-space:nowrap;text-decoration:underline}@media (width<=700px){.Yvqh9W_panelHeader{align-items:flex-start}.Yvqh9W_panelHeading{flex-direction:column;align-items:flex-start;gap:2px}.Yvqh9W_updateBanner{flex-direction:column;align-items:flex-start}.Yvqh9W_updateActions{justify-content:space-between;width:100%}}.Yvqh9W_studio{flex:1;gap:14px;min-width:0;min-height:0;display:flex}.Yvqh9W_config{flex-direction:column;flex:none;gap:12px;width:300px;min-width:260px;max-width:340px;height:100%;min-height:0;display:flex;overflow:hidden}.Yvqh9W_configScroll{scrollbar-width:thin;scrollbar-color:var(--dsw-alias-border-l2) transparent;flex-direction:column;flex:1;gap:12px;min-height:0;padding-right:2px;display:flex;overflow-y:auto}.Yvqh9W_configScroll::-webkit-scrollbar{width:8px}.Yvqh9W_configScroll::-webkit-scrollbar-thumb{background:var(--dsw-alias-border-l2);border-radius:999px}.Yvqh9W_canvas{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:12px;flex-direction:column;flex:1;min-width:0;min-height:0;display:flex;position:relative;overflow:hidden}.Yvqh9W_taskTray{z-index:6;border:1px solid var(--dsw-alias-border-l2);background:color-mix(in srgb, var(--dsw-alias-bg-layer-1) 92%, transparent);backdrop-filter:blur(10px);border-radius:9px;width:min(360px,100% - 24px);position:absolute;top:12px;right:12px;overflow:hidden;box-shadow:0 8px 24px #0000001f}.Yvqh9W_taskTrayHeader{color:var(--dsw-alias-label-primary);border-bottom:1px solid var(--dsw-alias-border-l1);justify-content:space-between;padding:8px 10px;font-size:12px;font-weight:600;display:flex}.Yvqh9W_taskRow{border-top:1px solid var(--dsw-alias-border-l1);grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:7px;padding:7px 10px;display:grid}.Yvqh9W_taskRow:first-of-type{border-top:0}.Yvqh9W_taskStatus{color:var(--dsw-alias-label-tertiary);white-space:nowrap;font-size:11px}.Yvqh9W_taskRow[data-status=running] .Yvqh9W_taskStatus{color:var(--dsw-alias-brand-primary)}.Yvqh9W_taskRow[data-status=failed] .Yvqh9W_taskStatus{color:var(--dsw-alias-label-error)}.Yvqh9W_taskPrompt{color:var(--dsw-alias-label-secondary);text-overflow:ellipsis;white-space:nowrap;font-size:11px;overflow:hidden}.Yvqh9W_taskRow button{color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-2);cursor:pointer;font:inherit;border:0;border-radius:5px;padding:2px 7px;font-size:11px}.Yvqh9W_taskRow button:hover{color:var(--dsw-alias-brand-primary)}.Yvqh9W_configGuide{z-index:1100;background:#00000059;place-items:center;padding:20px;display:grid;position:fixed;inset:0}.Yvqh9W_configGuideBody{border:1px solid var(--dsw-alias-border-l2);width:min(360px,100%);color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-1);border-radius:10px;flex-direction:column;gap:12px;padding:18px;display:flex;box-shadow:0 14px 40px #0003}.Yvqh9W_configGuideBody span{color:var(--dsw-alias-label-secondary);font-size:13px;line-height:1.55}.Yvqh9W_configGuideBody button{min-height:30px;color:var(--dsw-alias-bg-layer-1);background:var(--dsw-alias-brand-primary);cursor:pointer;font:inherit;border:0;border-radius:7px;align-self:flex-end;padding:0 12px;font-size:12px}.Yvqh9W_history{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:12px;flex-direction:column;flex:none;width:240px;min-width:200px;max-width:280px;min-height:0;display:flex;overflow:hidden}.Yvqh9W_historyHeader{border-bottom:1px solid var(--dsw-alias-border-l1);flex:none;justify-content:space-between;align-items:center;gap:8px;padding:10px 12px;display:flex}.Yvqh9W_historyFilters{border-bottom:1px solid var(--dsw-alias-border-l1);grid-template-columns:1fr 1fr;gap:6px;padding:8px 10px;display:grid}.Yvqh9W_historySearch,.Yvqh9W_historyFilters select,.Yvqh9W_gallerySearch{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);min-width:0;min-height:29px;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-2);font:inherit;border-radius:7px;padding:0 8px;font-size:11px}.Yvqh9W_historySearch{grid-column:1/-1}.Yvqh9W_gallerySearch{width:156px}.Yvqh9W_galleryTagInput{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);width:130px;min-height:29px;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-2);font:inherit;border-radius:7px;padding:0 8px;font-size:11px}.Yvqh9W_galleryBulkButton{border:1px solid var(--dsw-alias-border-l2);min-height:29px;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-1);cursor:pointer;font:inherit;border-radius:7px;padding:0 8px;font-size:11px}.Yvqh9W_galleryBulkButton:hover:not(:disabled){color:var(--dsw-alias-brand-primary);border-color:var(--dsw-alias-brand-primary)}.Yvqh9W_galleryBulkButton:disabled{opacity:.45;cursor:default}.Yvqh9W_historyTitle{color:var(--dsw-alias-label-primary);font-size:13px;font-weight:600}.Yvqh9W_historyClear{font:inherit;color:var(--dsw-alias-label-tertiary);border:1px solid var(--dsw-alias-border-l2);cursor:pointer;background:0 0;border-radius:999px;padding:2px 8px;font-size:11.5px}.Yvqh9W_historyClear:hover{color:var(--dsw-alias-label-error);border-color:var(--dsw-alias-label-error)}.Yvqh9W_historyList{scrollbar-width:thin;scrollbar-color:var(--dsw-alias-border-l2) transparent;flex-direction:column;flex:1;gap:8px;min-height:0;padding:10px;display:flex;overflow-y:auto}.Yvqh9W_historyList::-webkit-scrollbar{width:8px}.Yvqh9W_historyList::-webkit-scrollbar-thumb{background:var(--dsw-alias-border-l2);border-radius:999px}.Yvqh9W_historyEmpty{text-align:center;color:var(--dsw-alias-label-tertiary);flex:1;justify-content:center;align-items:center;padding:20px;font-size:12px;line-height:1.6;display:flex}.Yvqh9W_historyItem{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);border-radius:10px;flex-direction:column;flex:none;gap:6px;padding:8px;display:flex}.Yvqh9W_historyItem:hover{border-color:var(--dsw-alias-border-l2)}.Yvqh9W_historyItem[data-active]{border-color:var(--dsw-alias-brand-primary)}.Yvqh9W_historyMain{font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:none;align-items:flex-start;gap:8px;min-width:0;padding:0;display:flex}.Yvqh9W_historyThumb{object-fit:cover;background:var(--dsw-alias-bg-base);border-radius:8px;flex:none;width:52px;height:52px}.Yvqh9W_historyThumbPlaceholder{background:var(--dsw-alias-bg-layer-3);border-radius:8px;flex:none;width:52px;height:52px}.Yvqh9W_historyInfo{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}.Yvqh9W_historyPrompt{color:var(--dsw-alias-label-primary);-webkit-line-clamp:2;-webkit-box-orient:vertical;font-size:12px;line-height:1.4;display:-webkit-box;overflow:hidden}.Yvqh9W_historyMeta{color:var(--dsw-alias-label-tertiary);white-space:nowrap;text-overflow:ellipsis;font-size:11px;overflow:hidden}.Yvqh9W_historyActions{justify-content:flex-end;gap:6px;display:flex}.Yvqh9W_historyAction{font:inherit;color:var(--dsw-alias-label-secondary);border:1px solid var(--dsw-alias-border-l2);cursor:pointer;background:0 0;border-radius:999px;padding:2px 8px;font-size:11.5px}.Yvqh9W_historyAction:hover{color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-dimmed)}.Yvqh9W_historyAction[data-danger]:hover{color:var(--dsw-alias-label-error);border-color:var(--dsw-alias-label-error)}.Yvqh9W_card{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1);border-radius:12px;flex-direction:column;flex:none;gap:10px;padding:12px;display:flex}.Yvqh9W_modeRow{align-items:center;gap:8px;display:flex}.Yvqh9W_modePill{flex:1;justify-content:center;height:28px;font-size:13px}.Yvqh9W_uploadBox{min-height:128px;color:var(--dsw-alias-label-secondary);border:1.5px dashed var(--dsw-alias-border-l2);cursor:pointer;font:inherit;text-align:center;background:0 0;border-radius:12px;flex-direction:column;justify-content:center;align-items:center;gap:6px;padding:16px;font-size:12.5px;display:flex}.Yvqh9W_uploadBox:hover{color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-dimmed);background:var(--dsw-alias-interactive-bg-hover)}.Yvqh9W_uploadBox:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}.Yvqh9W_uploadIcon{color:var(--dsw-alias-label-tertiary);display:inline-flex}.Yvqh9W_uploadHint{color:var(--dsw-alias-label-tertiary);font-size:11px}.Yvqh9W_reference{flex-direction:column;gap:8px;display:flex}.Yvqh9W_referenceImage{object-fit:contain;background:var(--dsw-alias-bg-base);border:1px solid var(--dsw-alias-border-l1);border-radius:10px;width:100%;max-height:176px}.Yvqh9W_referenceActions{gap:8px;display:flex}.Yvqh9W_hiddenFile{display:none}.Yvqh9W_prompt{width:100%;min-height:120px;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-3);border:1px solid var(--dsw-alias-border-l2);resize:vertical;box-sizing:border-box;border-radius:10px;outline:none;padding:10px 12px;font-family:inherit;font-size:13px;line-height:1.6}.Yvqh9W_prompt:focus-visible{border-color:var(--dsw-alias-brand-primary)}.Yvqh9W_prompt::placeholder{color:var(--dsw-alias-label-tertiary)}.Yvqh9W_promptFooter{justify-content:space-between;align-items:center;gap:8px;margin-top:-6px;display:flex}.Yvqh9W_templatesButton{border:1px solid var(--dsw-alias-brand-primary);background:linear-gradient(135deg, color-mix(in srgb, var(--dsw-alias-brand-primary) 14%, transparent), color-mix(in srgb, var(--dsw-alias-brand-primary) 5%, transparent));height:26px;color:var(--dsw-alias-brand-primary);cursor:pointer;box-shadow:0 1px 0 color-mix(in srgb, var(--dsw-alias-brand-primary) 22%, transparent);border-radius:999px;align-items:center;gap:6px;padding:0 12px;font-family:inherit;font-size:12px;font-weight:600;transition:transform .12s,box-shadow .12s,background .12s;display:inline-flex}.Yvqh9W_templatesButton svg{flex:none}.Yvqh9W_templatesButton:hover{background:linear-gradient(135deg, color-mix(in srgb, var(--dsw-alias-brand-primary) 24%, transparent), color-mix(in srgb, var(--dsw-alias-brand-primary) 8%, transparent));color:var(--dsw-alias-brand-primary);box-shadow:0 2px 6px color-mix(in srgb, var(--dsw-alias-brand-primary) 30%, transparent);transform:translateY(-1px)}.Yvqh9W_templatesButton:active{transform:translateY(0)}.Yvqh9W_enhanceButton{border:1px solid var(--dsw-alias-border-l2);height:26px;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-2);font:inherit;cursor:pointer;border-radius:999px;margin-left:auto;padding:0 11px;font-size:12px}.Yvqh9W_enhanceButton:hover:not(:disabled){color:var(--dsw-alias-brand-primary);border-color:var(--dsw-alias-brand-primary)}.Yvqh9W_enhanceButton:disabled{opacity:.5;cursor:default}.Yvqh9W_promptCount{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:11px}.Yvqh9W_paramGroup{flex-direction:column;gap:8px;display:flex}.Yvqh9W_paramLabel{color:var(--dsw-alias-label-secondary);font-size:12px;font-weight:600}.Yvqh9W_optionRow{flex-wrap:wrap;gap:6px;display:flex}.Yvqh9W_optionGrid{grid-template-columns:repeat(3,1fr);gap:6px;display:grid}.Yvqh9W_optionPill{justify-content:center}.Yvqh9W_paramHint{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:1.45}.Yvqh9W_footer{border-top:1px solid var(--dsw-alias-border-l1);flex-direction:column;flex:none;align-items:stretch;gap:8px;padding:10px 2px 0 0;display:flex}.Yvqh9W_modelWrap{flex-direction:column;gap:5px;min-width:0;display:flex}.Yvqh9W_modelLabel{color:var(--dsw-alias-label-secondary);font-size:12px;font-weight:600}.Yvqh9W_modelSelect{width:100%;height:36px;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);cursor:pointer;text-align:left;border-radius:18px;outline:none;justify-content:space-between;align-items:center;gap:8px;padding:0 12px;font-family:inherit;font-size:13px;display:flex}.Yvqh9W_modelSelect:focus-visible{border-color:var(--dsw-alias-brand-primary)}.Yvqh9W_modelSelect:disabled{opacity:.55;cursor:default}.Yvqh9W_modelMenu{min-width:0;display:block;position:relative}.Yvqh9W_modelMenuList{z-index:40;background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:12px;flex-direction:column;padding:4px;display:flex;position:absolute;bottom:calc(100% + 6px);left:0;right:0;overflow:hidden;box-shadow:0 -8px 24px #0000002e}.Yvqh9W_modelMenuItem{width:100%;font:inherit;color:var(--dsw-alias-label-primary);cursor:pointer;text-align:left;white-space:nowrap;text-overflow:ellipsis;background:0 0;border:none;border-radius:8px;padding:7px 10px;font-size:13px;display:block;overflow:hidden}.Yvqh9W_modelMenuItem:hover{background:var(--dsw-alias-bg-hover)}.Yvqh9W_modelMenuItem[data-selected]{color:var(--dsw-alias-brand-primary);background:var(--dsw-alias-bg-layer-1);font-weight:600}.Yvqh9W_generateButton{width:100%}.Yvqh9W_generateInner{align-items:center;gap:7px;display:inline-flex}.Yvqh9W_canvasState{text-align:center;color:var(--dsw-alias-label-tertiary);flex-direction:column;flex:1;justify-content:center;align-items:center;gap:8px;padding:24px;display:flex}.Yvqh9W_canvasStateTitle{color:var(--dsw-alias-label-secondary);font-size:14px;font-weight:600}.Yvqh9W_canvasStateHint{max-width:380px;font-size:12px;line-height:1.6}.Yvqh9W_canvasEmptyIcon{color:var(--dsw-alias-label-tertiary);margin-bottom:4px;display:inline-flex}.Yvqh9W_canvasError{color:var(--dsw-alias-label-error);background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-label-error);overflow-wrap:anywhere;border-radius:10px;flex:none;margin:14px;padding:10px 14px;font-size:12.5px;line-height:1.6}.Yvqh9W_canvasBody{scrollbar-width:thin;scrollbar-color:var(--dsw-alias-border-l2) transparent;flex-direction:column;flex:1;gap:10px;min-height:0;padding:14px;display:flex;overflow-y:auto}.Yvqh9W_canvasBody::-webkit-scrollbar{width:8px}.Yvqh9W_canvasBody::-webkit-scrollbar-thumb{background:var(--dsw-alias-border-l2);border-radius:999px}.Yvqh9W_canvasMeta{color:var(--dsw-alias-label-tertiary);flex:none;align-items:center;gap:8px;font-size:12px;display:flex}.Yvqh9W_canvasHistoryTag{color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);white-space:nowrap;border-radius:999px;padding:1px 8px;font-size:11px}.Yvqh9W_grid{flex:1;grid-template-rows:repeat(2,minmax(0,1fr));grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;min-height:0;display:grid}.Yvqh9W_grid[data-count=\"1\"] .Yvqh9W_imageCard{grid-area:1/1/3/3}.Yvqh9W_imageCard{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);cursor:zoom-in;border-radius:12px;flex-direction:column;min-height:0;margin:0;display:flex;position:relative;overflow:hidden}.Yvqh9W_imageCard:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}.Yvqh9W_image{object-fit:cover;background:var(--dsw-alias-bg-base);flex:1;width:100%;min-height:0;display:block}.Yvqh9W_imageCaption{color:var(--dsw-alias-label-tertiary);white-space:nowrap;text-overflow:ellipsis;border-top:1px solid var(--dsw-alias-border-l1);padding:7px 10px;font-size:11px;line-height:1.5;overflow:hidden}.Yvqh9W_download{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-mask-1);border:1px solid var(--dsw-alias-border-l2);opacity:0;backdrop-filter:blur(4px);border-radius:999px;padding:2px 10px;font-size:12px;font-weight:500;line-height:20px;text-decoration:none;transition:opacity .12s;position:absolute;top:8px;right:8px}.Yvqh9W_imageCard:hover .Yvqh9W_download{opacity:1}.Yvqh9W_download:hover{background:var(--dsw-alias-bg-base)}.Yvqh9W_galleryAdd{font:inherit;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-mask-1);border:1px solid var(--dsw-alias-border-l2);cursor:pointer;opacity:0;backdrop-filter:blur(4px);border-radius:999px;align-items:center;gap:5px;padding:2px 10px;font-size:12px;font-weight:500;line-height:20px;transition:opacity .12s;display:inline-flex;position:absolute;top:8px;left:8px}.Yvqh9W_imageCard:hover .Yvqh9W_galleryAdd{opacity:1}.Yvqh9W_galleryAdd:hover{background:var(--dsw-alias-bg-base)}.Yvqh9W_galleryAdd:disabled{opacity:.4;cursor:default}.Yvqh9W_zoomHint{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-mask-1);border:1px solid var(--dsw-alias-border-l2);opacity:0;backdrop-filter:blur(4px);pointer-events:none;border-radius:999px;align-items:center;gap:5px;padding:2px 10px;font-size:12px;font-weight:500;line-height:20px;transition:opacity .12s;display:inline-flex;position:absolute;bottom:8px;left:8px}.Yvqh9W_imageCard:hover .Yvqh9W_zoomHint{opacity:1}.Yvqh9W_spinner,.Yvqh9W_bigSpinner{border:2px solid;border-top-color:#0000;border-radius:50%;flex:none;animation:.8s linear infinite Yvqh9W_dshImageGenSpin;display:inline-block}.Yvqh9W_spinner{width:11px;height:11px}.Yvqh9W_bigSpinner{width:30px;height:30px;color:var(--dsw-alias-state-business-primary);border-width:3px;margin-bottom:6px}.Yvqh9W_lightbox{z-index:1000;backdrop-filter:blur(6px);background:#000000b8;justify-content:center;align-items:center;padding:24px;display:flex;position:fixed;inset:0}.Yvqh9W_lightboxClose{color:#fff;cursor:pointer;background:#ffffff24;border:1px solid #ffffff47;border-radius:50%;justify-content:center;align-items:center;width:38px;height:38px;display:inline-flex;position:absolute;top:16px;right:16px}.Yvqh9W_lightboxClose:hover{background:#ffffff42}.Yvqh9W_lightboxNav{color:#fff;cursor:pointer;background:#ffffff24;border:1px solid #ffffff47;border-radius:50%;justify-content:center;align-items:center;width:42px;height:42px;display:inline-flex;position:absolute;top:50%;transform:translateY(-50%)}.Yvqh9W_lightboxNav:hover{background:#ffffff42}.Yvqh9W_lightboxNav[data-dir=prev]{left:max(20px,50% - 640px)}.Yvqh9W_lightboxNav[data-dir=next]{right:max(20px,50% - 640px)}.Yvqh9W_lightboxFigure{flex-direction:column;gap:10px;width:min(1100px,100vw - 160px);max-width:min(1100px,100vw - 160px);height:min(820px,100vh - 48px);min-height:0;margin:0;display:flex}.Yvqh9W_lightboxStage{background:#ffffff0a;border-radius:10px;flex:1;min-height:0;position:relative;overflow:auto}.Yvqh9W_lightboxScaleFrame{justify-content:center;align-items:center;min-width:100%;min-height:100%;display:flex}.Yvqh9W_lightboxImage{object-fit:contain;border-radius:10px;max-width:100%;max-height:100%;display:block;box-shadow:0 24px 80px #00000080}.Yvqh9W_lightboxTools{justify-content:center;align-items:center;gap:6px;display:flex}.Yvqh9W_lightboxTool,.Yvqh9W_lightboxZoomLevel,.Yvqh9W_lightboxCopy{color:#fff;cursor:pointer;background:#ffffff24;border:1px solid #ffffff47;justify-content:center;align-items:center;display:inline-flex}.Yvqh9W_lightboxTool,.Yvqh9W_lightboxZoomLevel{height:32px}.Yvqh9W_lightboxTool{border-radius:50%;width:32px}.Yvqh9W_lightboxZoomLevel{min-width:58px;font:inherit;font-variant-numeric:tabular-nums;border-radius:999px;padding:0 9px;font-size:12px}.Yvqh9W_lightboxTool:hover,.Yvqh9W_lightboxZoomLevel:hover,.Yvqh9W_lightboxCopy:hover{background:#ffffff42}.Yvqh9W_lightboxCaptionRow{align-items:flex-start;gap:8px;min-width:0;display:flex}.Yvqh9W_lightboxCaption{color:#ffffffe6;-webkit-line-clamp:3;-webkit-box-orient:vertical;flex:1;min-width:0;font-size:12px;line-height:1.6;display:-webkit-box;overflow:hidden}.Yvqh9W_lightboxCopy{min-height:28px;font:inherit;white-space:nowrap;border-radius:999px;flex:none;gap:5px;padding:4px 9px;font-size:12px}.Yvqh9W_lightboxMeta{justify-content:space-between;align-items:center;gap:12px;display:flex}.Yvqh9W_lightboxIndex{color:#fffc;font-variant-numeric:tabular-nums;font-size:12px}.Yvqh9W_lightboxActions{align-items:center;gap:8px;display:inline-flex}.Yvqh9W_lightboxDownload,.Yvqh9W_lightboxEdit{font:inherit;color:#fff;cursor:pointer;background:#ffffff24;border:1px solid #ffffff47;border-radius:999px;padding:4px 14px;font-size:12.5px;font-weight:500;text-decoration:none}.Yvqh9W_lightboxDownload:hover,.Yvqh9W_lightboxEdit:hover{background:#ffffff42}.Yvqh9W_lightboxEdit{color:#fff;background:#ffffff24;border:1px solid #ffffff47;border-radius:999px}@media (width<=720px){.Yvqh9W_lightbox{padding:16px}.Yvqh9W_lightboxFigure{width:calc(100vw - 32px);max-width:none}.Yvqh9W_lightboxNav[data-dir=prev]{left:20px}.Yvqh9W_lightboxNav[data-dir=next]{right:20px}.Yvqh9W_lightboxCaptionRow,.Yvqh9W_lightboxMeta{flex-direction:column;align-items:stretch}.Yvqh9W_lightboxCopy,.Yvqh9W_lightboxActions{align-self:flex-end}}@keyframes Yvqh9W_dshImageGenSpin{to{transform:rotate(360deg)}}.Yvqh9W_galleryToast{z-index:30;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-mask-1);border:1px solid var(--dsw-alias-border-l2);backdrop-filter:blur(6px);pointer-events:none;border-radius:999px;align-items:center;gap:7px;padding:6px 16px;font-size:13px;font-weight:500;animation:.16s ease-out Yvqh9W_dshImageGenToastIn;display:inline-flex;position:absolute;bottom:24px;left:50%;transform:translate(-50%);box-shadow:0 8px 24px #00000038}@keyframes Yvqh9W_dshImageGenToastIn{0%{opacity:0;transform:translate(-50%,6px)}to{opacity:1;transform:translate(-50%)}}@media (prefers-reduced-motion:reduce){.Yvqh9W_download,.Yvqh9W_spinner,.Yvqh9W_bigSpinner{transition:none;animation-duration:1.5s}}.Yvqh9W_config[data-gallery=true] .Yvqh9W_configScroll>:not(:first-child),.Yvqh9W_config[data-gallery=true] .Yvqh9W_footer,.Yvqh9W_canvas[data-gallery=true]>.Yvqh9W_canvasState,.Yvqh9W_canvas[data-gallery=true]>.Yvqh9W_canvasError,.Yvqh9W_canvas[data-gallery=true]>.Yvqh9W_canvasBody,.Yvqh9W_studio:has(.Yvqh9W_config[data-gallery=true])>.Yvqh9W_history{display:none}.Yvqh9W_config[data-gallery=true] .Yvqh9W_configScroll{flex:none;order:1;display:flex;overflow:visible}.Yvqh9W_config[data-gallery=true] .Yvqh9W_galleryFilters{flex:1;order:2;min-height:0}.Yvqh9W_galleryFilters{padding:18px 14px;overflow:hidden auto}.Yvqh9W_galleryFilterHeading{color:var(--dsw-alias-label-tertiary);margin:0 4px 10px;font-size:12px;font-weight:600}.Yvqh9W_galleryFilter{width:100%;min-height:34px;color:var(--dsw-alias-label-secondary);cursor:pointer;text-align:left;background:0 0;border:0;border-radius:9px;justify-content:space-between;align-items:center;padding:0 10px;display:flex}.Yvqh9W_galleryFilter:hover,.Yvqh9W_galleryFilter[data-active]{color:var(--dsw-alias-brand-primary);background:color-mix(in srgb, var(--dsw-alias-brand-primary) 10%, transparent)}.Yvqh9W_galleryFilterCount{min-width:20px;color:var(--dsw-alias-label-tertiary);background:var(--dsw-alias-bg-layer-2);text-align:center;border-radius:999px;padding:1px 6px;font-size:11px}.Yvqh9W_galleryFilterDivider{background:var(--dsw-alias-border-l1);height:1px;margin:18px 4px}.Yvqh9W_galleryRatioList{flex-wrap:wrap;gap:6px;display:flex}.Yvqh9W_galleryRatio{color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-2);cursor:pointer;border:0;border-radius:999px;padding:6px 10px;font-size:12px}.Yvqh9W_galleryRatio[data-active]{color:var(--dsw-alias-brand-primary);background:color-mix(in srgb, var(--dsw-alias-brand-primary) 13%, transparent)}.Yvqh9W_galleryTagFilterList{flex-wrap:wrap;gap:6px;display:flex}.Yvqh9W_galleryTagFilter{border:1px solid var(--dsw-alias-border-l1);min-width:0;max-width:100%;min-height:27px;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-2);cursor:pointer;font:inherit;border-radius:6px;align-items:center;gap:5px;padding:0 8px;font-size:11px;display:inline-flex}.Yvqh9W_galleryTagFilter span:first-child{text-overflow:ellipsis;white-space:nowrap;max-width:112px;overflow:hidden}.Yvqh9W_galleryTagFilter span:last-child{color:var(--dsw-alias-label-tertiary);font-size:10px}.Yvqh9W_galleryTagFilter:hover,.Yvqh9W_galleryTagFilter[data-active]{color:var(--dsw-alias-brand-primary);background:color-mix(in srgb, var(--dsw-alias-brand-primary) 10%, transparent)}.Yvqh9W_galleryFilterNote{color:var(--dsw-alias-label-quaternary);margin:20px 4px 0;font-size:11px;line-height:1.5}.Yvqh9W_galleryWorkspace{box-sizing:border-box;flex-direction:column;width:100%;min-width:0;height:100%;min-height:0;padding:22px 24px 26px;display:flex;position:absolute;inset:0;overflow:hidden}.Yvqh9W_galleryToolbar{flex:none;justify-content:space-between;align-items:center;gap:16px;min-width:0;margin-bottom:18px;display:flex}.Yvqh9W_galleryHeading{color:var(--dsw-alias-label-primary);margin:0;font-size:20px;font-weight:700;display:inline}.Yvqh9W_galleryCount{color:var(--dsw-alias-label-tertiary);margin-left:8px;font-size:13px}.Yvqh9W_galleryToolbarActions{flex-wrap:wrap;align-items:center;gap:10px;min-width:0;display:flex}.Yvqh9W_gallerySelectMode,.Yvqh9W_galleryBulkButton,.Yvqh9W_gallerySelectionClear{border:1px solid var(--dsw-alias-border-l1);min-height:30px;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-1);cursor:pointer;font:inherit;border-radius:7px;padding:0 10px;font-size:12px}.Yvqh9W_gallerySelectMode:hover,.Yvqh9W_gallerySelectMode[data-active],.Yvqh9W_galleryBulkButton:hover:not(:disabled){color:var(--dsw-alias-brand-primary);border-color:color-mix(in srgb, var(--dsw-alias-brand-primary) 38%, var(--dsw-alias-border-l1));background:color-mix(in srgb, var(--dsw-alias-brand-primary) 11%, transparent)}.Yvqh9W_galleryBulkButton:disabled{cursor:not-allowed;opacity:.45}.Yvqh9W_gallerySelectionBar{border:1px solid color-mix(in srgb, var(--dsw-alias-brand-primary) 35%, var(--dsw-alias-border-l1));background:color-mix(in srgb, var(--dsw-alias-brand-primary) 7%, var(--dsw-alias-bg-layer-1));border-radius:9px;flex:none;align-items:center;gap:10px;min-width:0;margin:-4px 0 16px;padding:10px 12px;display:flex}.Yvqh9W_gallerySelectionBar strong{color:var(--dsw-alias-brand-primary);flex:none;font-size:12px}.Yvqh9W_gallerySelectionClear{margin-left:auto}.Yvqh9W_gallerySelectionClear:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-2)}.Yvqh9W_galleryTagInput,.Yvqh9W_gallerySearch{border:1px solid var(--dsw-alias-border-l1);min-width:0;height:30px;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-1);font:inherit;border-radius:7px;outline:none;padding:0 10px;font-size:12px}.Yvqh9W_galleryTagInput{flex:190px}.Yvqh9W_galleryTagInput:focus,.Yvqh9W_gallerySearch:focus{border-color:var(--dsw-alias-brand-primary)}.Yvqh9W_galleryViewToggle{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:9px;padding:3px;display:flex}.Yvqh9W_galleryViewToggle button,.Yvqh9W_gallerySort,.Yvqh9W_galleryClear{min-height:30px;color:var(--dsw-alias-label-secondary);cursor:pointer;font:inherit;background:0 0;border:0;border-radius:7px;padding:0 10px;font-size:12px}.Yvqh9W_galleryViewToggle button[data-active],.Yvqh9W_galleryViewToggle button:hover,.Yvqh9W_gallerySort:hover,.Yvqh9W_galleryClear:hover{color:var(--dsw-alias-brand-primary);background:color-mix(in srgb, var(--dsw-alias-brand-primary) 11%, transparent)}.Yvqh9W_gallerySort{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1)}.Yvqh9W_galleryClear{border:1px solid var(--dsw-alias-border-l1)}.Yvqh9W_compareControl{flex-direction:column;gap:6px;margin:0 0 10px;display:flex}.Yvqh9W_compareToggle,.Yvqh9W_compareModelChoices label{color:var(--dsw-alias-label-secondary);cursor:pointer;align-items:center;gap:6px;font-size:12px;display:flex}.Yvqh9W_compareToggle input,.Yvqh9W_compareModelChoices input{accent-color:var(--dsw-alias-brand-primary)}.Yvqh9W_compareModelChoices{flex-wrap:wrap;gap:6px;display:flex}.Yvqh9W_compareModelChoices label{border:1px solid var(--dsw-alias-border-l1);border-radius:5px;padding:4px 6px;font-size:10px}.Yvqh9W_comparisonBoard{z-index:4;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);border-radius:8px;flex-direction:column;display:flex;position:absolute;inset:126px 14px 14px;overflow:hidden;box-shadow:0 8px 24px #0000001f}.Yvqh9W_comparisonBoard>header{border-bottom:1px solid var(--dsw-alias-border-l1);justify-content:space-between;align-items:center;padding:10px 12px;display:flex}.Yvqh9W_comparisonBoard>header div{align-items:baseline;gap:7px;display:flex}.Yvqh9W_comparisonBoard>header strong{color:var(--dsw-alias-label-primary);font-size:13px}.Yvqh9W_comparisonBoard>header span{color:var(--dsw-alias-label-tertiary);font-size:11px}.Yvqh9W_comparisonBoard>header button{border:1px solid var(--dsw-alias-border-l1);min-height:28px;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-2);cursor:pointer;font:inherit;border-radius:5px;padding:0 9px;font-size:11px}.Yvqh9W_comparisonGrid{flex:1;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;padding:12px;display:grid;overflow:auto}.Yvqh9W_comparisonGrid article{flex-direction:column;gap:7px;min-width:0;display:flex}.Yvqh9W_comparisonGrid article>strong{color:var(--dsw-alias-label-primary);font-size:12px}.Yvqh9W_comparisonGrid article>span{min-height:160px;color:var(--dsw-alias-label-tertiary);background:var(--dsw-alias-bg-layer-2);place-items:center;font-size:12px;display:grid}.Yvqh9W_comparisonGrid img{object-fit:contain;background:var(--dsw-alias-bg-base);width:100%;min-height:160px;max-height:calc(100vh - 260px);display:block}.Yvqh9W_comparisonFullscreen{z-index:1200;background:#000000eb;padding:54px 24px 24px;position:fixed;inset:0;overflow:auto}.Yvqh9W_comparisonFullscreenGrid{grid-template-columns:repeat(auto-fit,minmax(300px,1fr));align-items:start;gap:18px;min-height:100%;display:grid}.Yvqh9W_comparisonFullscreen figure{min-width:0;margin:0}.Yvqh9W_comparisonFullscreen figcaption{color:#fff;margin-bottom:8px;font-size:13px;font-weight:600}.Yvqh9W_comparisonFullscreen img{background:#111;width:100%;margin-bottom:10px;display:block}.Yvqh9W_galleryMasonry{box-sizing:border-box;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--dsw-alias-border-l2) transparent;flex:auto;grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:max-content;align-content:start;gap:16px;width:100%;min-width:0;max-width:100%;height:0;min-height:0;padding:2px 8px 16px 2px;display:grid;overflow:hidden scroll}.Yvqh9W_galleryMasonry::-webkit-scrollbar{width:8px}.Yvqh9W_galleryMasonry::-webkit-scrollbar-thumb{background:var(--dsw-alias-border-l2);border-radius:999px}.Yvqh9W_galleryCard{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:14px;width:100%;margin:0;display:block;position:relative;overflow:hidden;box-shadow:0 5px 18px #18203612}.Yvqh9W_galleryCard[data-selected]{border-color:var(--dsw-alias-brand-primary);box-shadow:0 0 0 2px color-mix(in srgb, var(--dsw-alias-brand-primary) 26%, transparent), 0 5px 18px #18203612}.Yvqh9W_gallerySelect{z-index:2;cursor:pointer;background:#00000094;border:1px solid #ffffffbf;border-radius:7px;place-items:center;width:26px;height:26px;display:grid;position:absolute;top:9px;right:9px}.Yvqh9W_gallerySelect input{width:16px;height:16px;accent-color:var(--dsw-alias-brand-primary);cursor:pointer;margin:0}.Yvqh9W_galleryImageButton{background:var(--dsw-alias-bg-base);cursor:zoom-in;border:0;width:100%;padding:0;display:block;position:relative}.Yvqh9W_galleryImageButton[data-selecting]{cursor:pointer}.Yvqh9W_galleryImage{aspect-ratio:4/3;object-fit:cover;width:100%;display:block}.Yvqh9W_galleryMasonry[data-view=masonry] .Yvqh9W_galleryCard:nth-child(3n+1) .Yvqh9W_galleryImage{aspect-ratio:4/5}.Yvqh9W_galleryMasonry[data-view=masonry] .Yvqh9W_galleryCard:nth-child(3n+2) .Yvqh9W_galleryImage{aspect-ratio:4/3}.Yvqh9W_galleryMasonry[data-view=masonry] .Yvqh9W_galleryCard:nth-child(3n) .Yvqh9W_galleryImage{aspect-ratio:3/4}.Yvqh9W_galleryBadge{color:#fff;backdrop-filter:blur(4px);background:#121724c2;border-radius:999px;padding:4px 9px;font-size:11px;position:absolute;top:10px;left:10px}.Yvqh9W_galleryCardFooter{align-items:center;gap:9px;min-width:0;padding:10px 12px;display:flex}.Yvqh9W_galleryAvatar{color:#fff;background:var(--dsw-alias-brand-primary);border-radius:50%;flex:none;place-items:center;width:27px;height:27px;font-size:12px;font-weight:700;display:grid}.Yvqh9W_galleryCardInfo{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.Yvqh9W_galleryCardInfo strong,.Yvqh9W_galleryCardInfo small{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.Yvqh9W_galleryCardInfo strong{color:var(--dsw-alias-label-primary);font-size:12px}.Yvqh9W_galleryCardInfo small{color:var(--dsw-alias-label-tertiary);font-size:10px}.Yvqh9W_galleryTags{flex-wrap:wrap;gap:4px;margin-top:4px;display:flex}.Yvqh9W_galleryTags button{max-width:96px;min-height:19px;color:var(--dsw-alias-brand-primary);background:color-mix(in srgb, var(--dsw-alias-brand-primary) 10%, transparent);cursor:pointer;font:inherit;text-overflow:ellipsis;white-space:nowrap;border:0;border-radius:4px;padding:1px 6px;font-size:10px;line-height:1.35;overflow:hidden}.Yvqh9W_galleryTags button:hover{background:color-mix(in srgb, var(--dsw-alias-brand-primary) 17%, transparent)}.Yvqh9W_galleryTags .Yvqh9W_galleryTagEdit{color:var(--dsw-alias-label-tertiary);background:0 0;flex:none}.Yvqh9W_galleryTagEditor{align-items:center;gap:6px;padding:0 12px 10px 48px;display:flex}.Yvqh9W_galleryTagEditor input{border:1px solid var(--dsw-alias-border-l2);min-width:0;height:27px;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-2);font:inherit;border-radius:6px;outline:none;flex:1;padding:0 8px;font-size:11px}.Yvqh9W_galleryTagEditor input:focus{border-color:var(--dsw-alias-brand-primary)}.Yvqh9W_galleryTagEditor button{border:1px solid var(--dsw-alias-border-l2);height:27px;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-1);cursor:pointer;font:inherit;border-radius:6px;padding:0 8px;font-size:11px}.Yvqh9W_galleryTagEditor button[type=submit]{color:var(--dsw-alias-brand-primary)}.Yvqh9W_galleryRemove{width:24px;height:24px;color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:0;border-radius:50%;flex:none;padding:0;font-size:18px}.Yvqh9W_galleryRemove:hover{color:var(--dsw-alias-state-error);background:var(--dsw-alias-bg-layer-2)}@media (width<=1100px){.Yvqh9W_galleryMasonry{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (width<=760px){.Yvqh9W_studio{flex-direction:column;overflow:auto}.Yvqh9W_config{width:auto;max-width:none;height:auto;min-height:0}.Yvqh9W_config[data-gallery=true]{flex:none}.Yvqh9W_canvas{min-height:560px}.Yvqh9W_galleryToolbar{flex-direction:column;align-items:flex-start}.Yvqh9W_galleryToolbarActions{flex-wrap:wrap;width:100%}.Yvqh9W_galleryMasonry{grid-template-columns:1fr}}";
|
|
1266
1325
|
const tagId$1 = "@dickpy/dsh-imagegen/panel.module.css";
|
|
@@ -1272,161 +1331,161 @@ window.__ModuleLoader__.load({
|
|
|
1272
1331
|
document.head.appendChild(tag);
|
|
1273
1332
|
}
|
|
1274
1333
|
var panel_module_css_default = {
|
|
1334
|
+
"compareToggle": "Yvqh9W_compareToggle",
|
|
1335
|
+
"panelTitle": "Yvqh9W_panelTitle",
|
|
1336
|
+
"taskStatus": "Yvqh9W_taskStatus",
|
|
1337
|
+
"galleryTagInput": "Yvqh9W_galleryTagInput",
|
|
1275
1338
|
"canvas": "Yvqh9W_canvas",
|
|
1276
|
-
"
|
|
1277
|
-
"
|
|
1278
|
-
"
|
|
1279
|
-
"
|
|
1339
|
+
"history": "Yvqh9W_history",
|
|
1340
|
+
"lightboxTools": "Yvqh9W_lightboxTools",
|
|
1341
|
+
"taskPrompt": "Yvqh9W_taskPrompt",
|
|
1342
|
+
"galleryRatio": "Yvqh9W_galleryRatio",
|
|
1343
|
+
"updateBanner": "Yvqh9W_updateBanner",
|
|
1344
|
+
"canvasMeta": "Yvqh9W_canvasMeta",
|
|
1345
|
+
"historyThumbPlaceholder": "Yvqh9W_historyThumbPlaceholder",
|
|
1346
|
+
"historyFilters": "Yvqh9W_historyFilters",
|
|
1347
|
+
"historyList": "Yvqh9W_historyList",
|
|
1280
1348
|
"uploadBox": "Yvqh9W_uploadBox",
|
|
1281
|
-
"
|
|
1282
|
-
"
|
|
1283
|
-
"imageCard": "Yvqh9W_imageCard",
|
|
1284
|
-
"reference": "Yvqh9W_reference",
|
|
1285
|
-
"lightboxEdit": "Yvqh9W_lightboxEdit",
|
|
1286
|
-
"galleryBadge": "Yvqh9W_galleryBadge",
|
|
1287
|
-
"taskStatus": "Yvqh9W_taskStatus",
|
|
1288
|
-
"galleryTags": "Yvqh9W_galleryTags",
|
|
1289
|
-
"panelTitle": "Yvqh9W_panelTitle",
|
|
1290
|
-
"footer": "Yvqh9W_footer",
|
|
1291
|
-
"galleryHeading": "Yvqh9W_galleryHeading",
|
|
1292
|
-
"panelHeading": "Yvqh9W_panelHeading",
|
|
1293
|
-
"uploadIcon": "Yvqh9W_uploadIcon",
|
|
1349
|
+
"updateActions": "Yvqh9W_updateActions",
|
|
1350
|
+
"lightboxTool": "Yvqh9W_lightboxTool",
|
|
1294
1351
|
"lightboxDownload": "Yvqh9W_lightboxDownload",
|
|
1295
|
-
"canvasStateTitle": "Yvqh9W_canvasStateTitle",
|
|
1296
|
-
"canvasError": "Yvqh9W_canvasError",
|
|
1297
|
-
"githubLink": "Yvqh9W_githubLink",
|
|
1298
|
-
"galleryCardFooter": "Yvqh9W_galleryCardFooter",
|
|
1299
|
-
"historyEmpty": "Yvqh9W_historyEmpty",
|
|
1300
|
-
"historyAction": "Yvqh9W_historyAction",
|
|
1301
|
-
"paramHint": "Yvqh9W_paramHint",
|
|
1302
|
-
"canvasState": "Yvqh9W_canvasState",
|
|
1303
|
-
"config": "Yvqh9W_config",
|
|
1304
|
-
"galleryWorkspace": "Yvqh9W_galleryWorkspace",
|
|
1305
|
-
"galleryCardInfo": "Yvqh9W_galleryCardInfo",
|
|
1306
|
-
"canvasBody": "Yvqh9W_canvasBody",
|
|
1307
|
-
"historyPrompt": "Yvqh9W_historyPrompt",
|
|
1308
|
-
"canvasEmptyIcon": "Yvqh9W_canvasEmptyIcon",
|
|
1309
|
-
"compareModelChoices": "Yvqh9W_compareModelChoices",
|
|
1310
|
-
"galleryMasonry": "Yvqh9W_galleryMasonry",
|
|
1311
|
-
"lightboxClose": "Yvqh9W_lightboxClose",
|
|
1312
|
-
"gallerySelectMode": "Yvqh9W_gallerySelectMode",
|
|
1313
|
-
"compareControl": "Yvqh9W_compareControl",
|
|
1314
|
-
"historyItem": "Yvqh9W_historyItem",
|
|
1315
|
-
"galleryTagInput": "Yvqh9W_galleryTagInput",
|
|
1316
|
-
"entryLabel": "Yvqh9W_entryLabel",
|
|
1317
|
-
"canvasStateHint": "Yvqh9W_canvasStateHint",
|
|
1318
1352
|
"comparisonFullscreenGrid": "Yvqh9W_comparisonFullscreenGrid",
|
|
1319
|
-
"
|
|
1320
|
-
"
|
|
1321
|
-
"
|
|
1322
|
-
"
|
|
1323
|
-
"
|
|
1324
|
-
"gallerySort": "Yvqh9W_gallerySort",
|
|
1325
|
-
"connectionDot": "Yvqh9W_connectionDot",
|
|
1326
|
-
"entryIcon": "Yvqh9W_entryIcon",
|
|
1327
|
-
"comparisonGrid": "Yvqh9W_comparisonGrid",
|
|
1328
|
-
"galleryTagFilter": "Yvqh9W_galleryTagFilter",
|
|
1353
|
+
"connectionStatus": "Yvqh9W_connectionStatus",
|
|
1354
|
+
"panelHeading": "Yvqh9W_panelHeading",
|
|
1355
|
+
"gallerySearch": "Yvqh9W_gallerySearch",
|
|
1356
|
+
"bigSpinner": "Yvqh9W_bigSpinner",
|
|
1357
|
+
"canvasEmptyIcon": "Yvqh9W_canvasEmptyIcon",
|
|
1329
1358
|
"imageCaption": "Yvqh9W_imageCaption",
|
|
1330
|
-
"
|
|
1331
|
-
"
|
|
1359
|
+
"entryLabel": "Yvqh9W_entryLabel",
|
|
1360
|
+
"config": "Yvqh9W_config",
|
|
1361
|
+
"configGuideBody": "Yvqh9W_configGuideBody",
|
|
1332
1362
|
"historyTitle": "Yvqh9W_historyTitle",
|
|
1333
|
-
"historyInfo": "Yvqh9W_historyInfo",
|
|
1334
1363
|
"galleryFilter": "Yvqh9W_galleryFilter",
|
|
1335
|
-
"
|
|
1336
|
-
"generateInner": "Yvqh9W_generateInner",
|
|
1337
|
-
"galleryToolbar": "Yvqh9W_galleryToolbar",
|
|
1338
|
-
"dshImageGenSpin": "Yvqh9W_dshImageGenSpin",
|
|
1339
|
-
"historyMain": "Yvqh9W_historyMain",
|
|
1340
|
-
"galleryRatio": "Yvqh9W_galleryRatio",
|
|
1341
|
-
"card": "Yvqh9W_card",
|
|
1342
|
-
"historySearch": "Yvqh9W_historySearch",
|
|
1343
|
-
"prompt": "Yvqh9W_prompt",
|
|
1344
|
-
"gallerySelect": "Yvqh9W_gallerySelect",
|
|
1345
|
-
"galleryImageButton": "Yvqh9W_galleryImageButton",
|
|
1346
|
-
"canvasMeta": "Yvqh9W_canvasMeta",
|
|
1347
|
-
"updateActions": "Yvqh9W_updateActions",
|
|
1348
|
-
"galleryBulkButton": "Yvqh9W_galleryBulkButton",
|
|
1349
|
-
"historyFilters": "Yvqh9W_historyFilters",
|
|
1350
|
-
"enhanceButton": "Yvqh9W_enhanceButton",
|
|
1351
|
-
"download": "Yvqh9W_download",
|
|
1352
|
-
"modelMenuList": "Yvqh9W_modelMenuList",
|
|
1364
|
+
"galleryFilterCount": "Yvqh9W_galleryFilterCount",
|
|
1353
1365
|
"galleryTagEditor": "Yvqh9W_galleryTagEditor",
|
|
1366
|
+
"historyAction": "Yvqh9W_historyAction",
|
|
1354
1367
|
"galleryRemove": "Yvqh9W_galleryRemove",
|
|
1355
|
-
"
|
|
1356
|
-
"
|
|
1357
|
-
"
|
|
1358
|
-
"
|
|
1359
|
-
"galleryTagFilterList": "Yvqh9W_galleryTagFilterList",
|
|
1368
|
+
"lightboxClose": "Yvqh9W_lightboxClose",
|
|
1369
|
+
"modelMenuList": "Yvqh9W_modelMenuList",
|
|
1370
|
+
"modePill": "Yvqh9W_modePill",
|
|
1371
|
+
"zoomHint": "Yvqh9W_zoomHint",
|
|
1360
1372
|
"taskRow": "Yvqh9W_taskRow",
|
|
1361
|
-
"
|
|
1362
|
-
"
|
|
1363
|
-
"
|
|
1364
|
-
"
|
|
1365
|
-
"
|
|
1366
|
-
"
|
|
1367
|
-
"
|
|
1368
|
-
"
|
|
1369
|
-
"
|
|
1370
|
-
"hiddenFile": "Yvqh9W_hiddenFile",
|
|
1371
|
-
"galleryToast": "Yvqh9W_galleryToast",
|
|
1373
|
+
"referenceImage": "Yvqh9W_referenceImage",
|
|
1374
|
+
"galleryWorkspace": "Yvqh9W_galleryWorkspace",
|
|
1375
|
+
"panel": "Yvqh9W_panel",
|
|
1376
|
+
"connectionDot": "Yvqh9W_connectionDot",
|
|
1377
|
+
"galleryImage": "Yvqh9W_galleryImage",
|
|
1378
|
+
"image": "Yvqh9W_image",
|
|
1379
|
+
"galleryTagFilter": "Yvqh9W_galleryTagFilter",
|
|
1380
|
+
"galleryCard": "Yvqh9W_galleryCard",
|
|
1381
|
+
"historyPrompt": "Yvqh9W_historyPrompt",
|
|
1372
1382
|
"historyHeader": "Yvqh9W_historyHeader",
|
|
1373
|
-
"updateBanner": "Yvqh9W_updateBanner",
|
|
1374
|
-
"modelSelect": "Yvqh9W_modelSelect",
|
|
1375
|
-
"historyClear": "Yvqh9W_historyClear",
|
|
1376
|
-
"lightboxActions": "Yvqh9W_lightboxActions",
|
|
1377
|
-
"galleryFilterNote": "Yvqh9W_galleryFilterNote",
|
|
1378
|
-
"optionPill": "Yvqh9W_optionPill",
|
|
1379
1383
|
"modelLabel": "Yvqh9W_modelLabel",
|
|
1380
|
-
"
|
|
1381
|
-
"
|
|
1382
|
-
"
|
|
1384
|
+
"canvasState": "Yvqh9W_canvasState",
|
|
1385
|
+
"dshImageGenSpin": "Yvqh9W_dshImageGenSpin",
|
|
1386
|
+
"historyItem": "Yvqh9W_historyItem",
|
|
1387
|
+
"historyInfo": "Yvqh9W_historyInfo",
|
|
1383
1388
|
"taskTrayHeader": "Yvqh9W_taskTrayHeader",
|
|
1384
|
-
"
|
|
1385
|
-
"
|
|
1389
|
+
"uploadIcon": "Yvqh9W_uploadIcon",
|
|
1390
|
+
"paramLabel": "Yvqh9W_paramLabel",
|
|
1391
|
+
"modelMenu": "Yvqh9W_modelMenu",
|
|
1392
|
+
"canvasStateTitle": "Yvqh9W_canvasStateTitle",
|
|
1393
|
+
"historyEmpty": "Yvqh9W_historyEmpty",
|
|
1394
|
+
"canvasBody": "Yvqh9W_canvasBody",
|
|
1395
|
+
"canvasHistoryTag": "Yvqh9W_canvasHistoryTag",
|
|
1396
|
+
"galleryCount": "Yvqh9W_galleryCount",
|
|
1397
|
+
"gallerySelectionClear": "Yvqh9W_gallerySelectionClear",
|
|
1398
|
+
"historyActions": "Yvqh9W_historyActions",
|
|
1399
|
+
"galleryTags": "Yvqh9W_galleryTags",
|
|
1400
|
+
"hiddenFile": "Yvqh9W_hiddenFile",
|
|
1401
|
+
"lightboxIndex": "Yvqh9W_lightboxIndex",
|
|
1386
1402
|
"modeRow": "Yvqh9W_modeRow",
|
|
1387
|
-
"
|
|
1388
|
-
"
|
|
1403
|
+
"githubLink": "Yvqh9W_githubLink",
|
|
1404
|
+
"download": "Yvqh9W_download",
|
|
1389
1405
|
"view": "Yvqh9W_view",
|
|
1406
|
+
"galleryTagFilterList": "Yvqh9W_galleryTagFilterList",
|
|
1407
|
+
"lightbox": "Yvqh9W_lightbox",
|
|
1408
|
+
"galleryToolbarActions": "Yvqh9W_galleryToolbarActions",
|
|
1409
|
+
"spinner": "Yvqh9W_spinner",
|
|
1410
|
+
"lightboxEdit": "Yvqh9W_lightboxEdit",
|
|
1411
|
+
"comparisonGrid": "Yvqh9W_comparisonGrid",
|
|
1412
|
+
"galleryAvatar": "Yvqh9W_galleryAvatar",
|
|
1413
|
+
"grid": "Yvqh9W_grid",
|
|
1414
|
+
"modelWrap": "Yvqh9W_modelWrap",
|
|
1415
|
+
"comparisonFullscreen": "Yvqh9W_comparisonFullscreen",
|
|
1416
|
+
"modelMenuItem": "Yvqh9W_modelMenuItem",
|
|
1417
|
+
"compareControl": "Yvqh9W_compareControl",
|
|
1418
|
+
"updateText": "Yvqh9W_updateText",
|
|
1419
|
+
"footer": "Yvqh9W_footer",
|
|
1420
|
+
"lightboxActions": "Yvqh9W_lightboxActions",
|
|
1421
|
+
"lightboxMeta": "Yvqh9W_lightboxMeta",
|
|
1422
|
+
"prompt": "Yvqh9W_prompt",
|
|
1423
|
+
"optionPill": "Yvqh9W_optionPill",
|
|
1390
1424
|
"galleryViewToggle": "Yvqh9W_galleryViewToggle",
|
|
1391
|
-
"
|
|
1425
|
+
"imageCard": "Yvqh9W_imageCard",
|
|
1426
|
+
"compareModelChoices": "Yvqh9W_compareModelChoices",
|
|
1427
|
+
"galleryImageButton": "Yvqh9W_galleryImageButton",
|
|
1392
1428
|
"comparisonBoard": "Yvqh9W_comparisonBoard",
|
|
1393
|
-
"
|
|
1394
|
-
"
|
|
1429
|
+
"paramHint": "Yvqh9W_paramHint",
|
|
1430
|
+
"uploadHint": "Yvqh9W_uploadHint",
|
|
1431
|
+
"optionRow": "Yvqh9W_optionRow",
|
|
1432
|
+
"optionGrid": "Yvqh9W_optionGrid",
|
|
1433
|
+
"lightboxNav": "Yvqh9W_lightboxNav",
|
|
1434
|
+
"galleryCardInfo": "Yvqh9W_galleryCardInfo",
|
|
1435
|
+
"reference": "Yvqh9W_reference",
|
|
1436
|
+
"historyClear": "Yvqh9W_historyClear",
|
|
1395
1437
|
"lightboxScaleFrame": "Yvqh9W_lightboxScaleFrame",
|
|
1396
|
-
"
|
|
1438
|
+
"galleryFilterHeading": "Yvqh9W_galleryFilterHeading",
|
|
1439
|
+
"galleryFilterDivider": "Yvqh9W_galleryFilterDivider",
|
|
1440
|
+
"historyThumb": "Yvqh9W_historyThumb",
|
|
1441
|
+
"lightboxFigure": "Yvqh9W_lightboxFigure",
|
|
1442
|
+
"gallerySelect": "Yvqh9W_gallerySelect",
|
|
1443
|
+
"galleryBadge": "Yvqh9W_galleryBadge",
|
|
1444
|
+
"galleryRatioList": "Yvqh9W_galleryRatioList",
|
|
1445
|
+
"entryIcon": "Yvqh9W_entryIcon",
|
|
1446
|
+
"lightboxCaptionRow": "Yvqh9W_lightboxCaptionRow",
|
|
1447
|
+
"lightboxImage": "Yvqh9W_lightboxImage",
|
|
1448
|
+
"galleryHeading": "Yvqh9W_galleryHeading",
|
|
1449
|
+
"panelHeader": "Yvqh9W_panelHeader",
|
|
1450
|
+
"generateInner": "Yvqh9W_generateInner",
|
|
1451
|
+
"galleryCardFooter": "Yvqh9W_galleryCardFooter",
|
|
1452
|
+
"galleryTagEdit": "Yvqh9W_galleryTagEdit",
|
|
1453
|
+
"configScroll": "Yvqh9W_configScroll",
|
|
1397
1454
|
"referenceActions": "Yvqh9W_referenceActions",
|
|
1398
|
-
"
|
|
1399
|
-
"
|
|
1400
|
-
"history": "Yvqh9W_history",
|
|
1401
|
-
"historyThumbPlaceholder": "Yvqh9W_historyThumbPlaceholder",
|
|
1402
|
-
"historyActions": "Yvqh9W_historyActions",
|
|
1455
|
+
"canvasStateHint": "Yvqh9W_canvasStateHint",
|
|
1456
|
+
"galleryAdd": "Yvqh9W_galleryAdd",
|
|
1403
1457
|
"generateButton": "Yvqh9W_generateButton",
|
|
1458
|
+
"galleryToast": "Yvqh9W_galleryToast",
|
|
1459
|
+
"canvasError": "Yvqh9W_canvasError",
|
|
1460
|
+
"lightboxZoomLevel": "Yvqh9W_lightboxZoomLevel",
|
|
1404
1461
|
"gallerySelectionBar": "Yvqh9W_gallerySelectionBar",
|
|
1405
|
-
"
|
|
1406
|
-
"
|
|
1407
|
-
"
|
|
1408
|
-
"
|
|
1409
|
-
"
|
|
1410
|
-
"
|
|
1411
|
-
"
|
|
1412
|
-
"
|
|
1413
|
-
"
|
|
1414
|
-
"modePill": "Yvqh9W_modePill",
|
|
1415
|
-
"galleryRatioList": "Yvqh9W_galleryRatioList",
|
|
1416
|
-
"lightbox": "Yvqh9W_lightbox",
|
|
1417
|
-
"configGuideBody": "Yvqh9W_configGuideBody",
|
|
1418
|
-
"lightboxTools": "Yvqh9W_lightboxTools",
|
|
1462
|
+
"galleryMasonry": "Yvqh9W_galleryMasonry",
|
|
1463
|
+
"galleryFilters": "Yvqh9W_galleryFilters",
|
|
1464
|
+
"lightboxCopy": "Yvqh9W_lightboxCopy",
|
|
1465
|
+
"lightboxStage": "Yvqh9W_lightboxStage",
|
|
1466
|
+
"card": "Yvqh9W_card",
|
|
1467
|
+
"taskTray": "Yvqh9W_taskTray",
|
|
1468
|
+
"galleryBulkButton": "Yvqh9W_galleryBulkButton",
|
|
1469
|
+
"promptCount": "Yvqh9W_promptCount",
|
|
1470
|
+
"modelSelect": "Yvqh9W_modelSelect",
|
|
1419
1471
|
"lightboxCaption": "Yvqh9W_lightboxCaption",
|
|
1420
|
-
"
|
|
1421
|
-
"
|
|
1422
|
-
"
|
|
1423
|
-
"
|
|
1472
|
+
"updateRelease": "Yvqh9W_updateRelease",
|
|
1473
|
+
"historySearch": "Yvqh9W_historySearch",
|
|
1474
|
+
"galleryToolbar": "Yvqh9W_galleryToolbar",
|
|
1475
|
+
"dshImageGenToastIn": "Yvqh9W_dshImageGenToastIn",
|
|
1476
|
+
"paramGroup": "Yvqh9W_paramGroup",
|
|
1477
|
+
"galleryFilterNote": "Yvqh9W_galleryFilterNote",
|
|
1478
|
+
"enhanceButton": "Yvqh9W_enhanceButton",
|
|
1479
|
+
"gallerySelectMode": "Yvqh9W_gallerySelectMode",
|
|
1480
|
+
"configGuide": "Yvqh9W_configGuide",
|
|
1481
|
+
"studio": "Yvqh9W_studio",
|
|
1482
|
+
"templatesButton": "Yvqh9W_templatesButton",
|
|
1483
|
+
"gallerySort": "Yvqh9W_gallerySort",
|
|
1484
|
+
"historyMain": "Yvqh9W_historyMain",
|
|
1485
|
+
"galleryClear": "Yvqh9W_galleryClear",
|
|
1486
|
+
"entry": "Yvqh9W_entry",
|
|
1424
1487
|
"historyMeta": "Yvqh9W_historyMeta",
|
|
1425
|
-
"
|
|
1426
|
-
"lightboxCaptionRow": "Yvqh9W_lightboxCaptionRow",
|
|
1427
|
-
"lightboxCopy": "Yvqh9W_lightboxCopy",
|
|
1428
|
-
"spinner": "Yvqh9W_spinner",
|
|
1429
|
-
"lightboxFigure": "Yvqh9W_lightboxFigure"
|
|
1488
|
+
"promptFooter": "Yvqh9W_promptFooter"
|
|
1430
1489
|
};
|
|
1431
1490
|
//#endregion
|
|
1432
1491
|
//#region src/client/ImageGenPanel.tsx
|
|
@@ -1439,10 +1498,6 @@ window.__ModuleLoader__.load({
|
|
|
1439
1498
|
* Controls ride the system UI primitives (@deepseek-ai/dsh-client-ui-primitives,
|
|
1440
1499
|
* a platform module) so the studio matches the dsh shell look by construction.
|
|
1441
1500
|
*/
|
|
1442
|
-
/** Models offered by the dropdown. Anything OpenAI-compatible that answers
|
|
1443
|
-
* /images/generations (+ /images/edits) works; grok-imagine-image is handled
|
|
1444
|
-
* specially host-side (JSON /images/edits, aspect_ratio, b64_json). */
|
|
1445
|
-
const MODELS = ["gpt-image-2", "grok-imagine-image"];
|
|
1446
1501
|
/** Size options, presented as aspect ratios (auto = let the model decide).
|
|
1447
1502
|
* The host maps each ratio onto the model's own vocabulary: aspect_ratio for
|
|
1448
1503
|
* Grok Imagine, the closest pixel size for OpenAI-compatible endpoints. */
|
|
@@ -1586,15 +1641,16 @@ window.__ModuleLoader__.load({
|
|
|
1586
1641
|
const apiKeySet = useSecretSet(scope, "apiKey");
|
|
1587
1642
|
const promptKeySet = useSecretSet(scope, "promptApiKey");
|
|
1588
1643
|
const connected = enabled && configured && apiKeySet;
|
|
1644
|
+
const imageModels = normalizeImageModels(config?.imageModels);
|
|
1589
1645
|
const [tab, setTab] = (0, react.useState)("text");
|
|
1590
1646
|
const [prompt, setPrompt] = (0, react.useState)("");
|
|
1591
1647
|
const [size, setSize] = (0, react.useState)("auto");
|
|
1592
1648
|
const [quality, setQuality] = (0, react.useState)("auto");
|
|
1593
1649
|
const [count, setCount] = (0, react.useState)(1);
|
|
1594
1650
|
const [detail, setDetail] = (0, react.useState)("");
|
|
1595
|
-
const [model, setModel] = (0, react.useState)(
|
|
1651
|
+
const [model, setModel] = (0, react.useState)(DEFAULT_IMAGE_MODELS[0]);
|
|
1596
1652
|
const [compareEnabled, setCompareEnabled] = (0, react.useState)(false);
|
|
1597
|
-
const [compareModels, setCompareModels] = (0, react.useState)([...
|
|
1653
|
+
const [compareModels, setCompareModels] = (0, react.useState)([...DEFAULT_IMAGE_MODELS]);
|
|
1598
1654
|
const [modelOpen, setModelOpen] = (0, react.useState)(false);
|
|
1599
1655
|
const [refImage, setRefImage] = (0, react.useState)(null);
|
|
1600
1656
|
const [images, setImages] = (0, react.useState)([]);
|
|
@@ -1637,12 +1693,20 @@ window.__ModuleLoader__.load({
|
|
|
1637
1693
|
const fileInput = (0, react.useRef)(null);
|
|
1638
1694
|
const previewStage = (0, react.useRef)(null);
|
|
1639
1695
|
const elapsed = useElapsed(generating, startedAt);
|
|
1696
|
+
(0, react.useEffect)(() => {
|
|
1697
|
+
setModel((previous) => imageModels.includes(previous) ? previous : imageModels[0]);
|
|
1698
|
+
setCompareModels((previous) => {
|
|
1699
|
+
const retained = previous.filter((candidate) => imageModels.includes(candidate));
|
|
1700
|
+
return retained.length > 0 ? retained : [imageModels[0]];
|
|
1701
|
+
});
|
|
1702
|
+
}, [imageModels.join("\0")]);
|
|
1640
1703
|
const filteredGallery = gallery.filter((entry) => {
|
|
1641
1704
|
if (galleryFilter === "all") return true;
|
|
1642
1705
|
if (galleryFilter === "text" || galleryFilter === "edit") return entry.mode === galleryFilter;
|
|
1643
1706
|
return entry.model === galleryFilter;
|
|
1644
1707
|
}).filter((entry) => galleryRatio === "all" || normalizeSize(entry.size) === galleryRatio).filter((entry) => galleryTagFilter === null || (entry.tags ?? []).includes(galleryTagFilter)).filter((entry) => galleryQuery.trim() === "" || `${entry.prompt} ${entry.model} ${(entry.tags ?? []).join(" ")}`.toLocaleLowerCase().includes(galleryQuery.trim().toLocaleLowerCase())).slice().sort((a, b) => gallerySort === "newest" ? b.createdAt - a.createdAt : a.createdAt - b.createdAt);
|
|
1645
1708
|
const galleryTagOptions = [...new Set(gallery.flatMap((entry) => entry.tags ?? []))].sort((a, b) => a.localeCompare(b));
|
|
1709
|
+
const galleryModels = [.../* @__PURE__ */ new Set([...imageModels, ...gallery.map((entry) => entry.model)])];
|
|
1646
1710
|
const filteredHistory = history.filter((entry) => {
|
|
1647
1711
|
const query = historyQuery.trim().toLocaleLowerCase();
|
|
1648
1712
|
return (query === "" || `${entry.prompt} ${entry.model}`.toLocaleLowerCase().includes(query)) && (historyModelFilter === "all" || entry.model === historyModelFilter) && (historyRatioFilter === "all" || normalizeSize(entry.size) === historyRatioFilter);
|
|
@@ -1797,7 +1861,7 @@ window.__ModuleLoader__.load({
|
|
|
1797
1861
|
}
|
|
1798
1862
|
const request = {
|
|
1799
1863
|
mode: tab === "gallery" ? "text" : tab,
|
|
1800
|
-
model,
|
|
1864
|
+
model: imageModels.includes(model) ? model : imageModels[0],
|
|
1801
1865
|
prompt: promptText,
|
|
1802
1866
|
size,
|
|
1803
1867
|
quality,
|
|
@@ -1808,7 +1872,7 @@ window.__ModuleLoader__.load({
|
|
|
1808
1872
|
};
|
|
1809
1873
|
setError(null);
|
|
1810
1874
|
try {
|
|
1811
|
-
const targetModels = compareEnabled ? compareModels : [model];
|
|
1875
|
+
const targetModels = (compareEnabled ? compareModels : [request.model]).filter((candidate) => imageModels.includes(candidate));
|
|
1812
1876
|
if (targetModels.length === 0) {
|
|
1813
1877
|
setError(tt("compare.selectRequired"));
|
|
1814
1878
|
return;
|
|
@@ -1897,7 +1961,7 @@ window.__ModuleLoader__.load({
|
|
|
1897
1961
|
setQuality(normalizeQuality(entry.quality));
|
|
1898
1962
|
setDetail(DETAILS.includes(entry.detail) ? entry.detail : "");
|
|
1899
1963
|
setCount(entry.n >= 1 && entry.n <= 4 ? entry.n : 1);
|
|
1900
|
-
setModel(
|
|
1964
|
+
setModel(imageModels.includes(entry.model) ? entry.model : imageModels[0]);
|
|
1901
1965
|
setRefImage(null);
|
|
1902
1966
|
setImages(restored);
|
|
1903
1967
|
setError(null);
|
|
@@ -1999,7 +2063,7 @@ window.__ModuleLoader__.load({
|
|
|
1999
2063
|
setQuality(normalizeQuality(entry.quality));
|
|
2000
2064
|
setDetail(DETAILS.includes(entry.detail) ? entry.detail : "");
|
|
2001
2065
|
setCount(entry.n >= 1 && entry.n <= 4 ? entry.n : 1);
|
|
2002
|
-
setModel(
|
|
2066
|
+
setModel(imageModels.includes(entry.model) ? entry.model : imageModels[0]);
|
|
2003
2067
|
setRefImage(null);
|
|
2004
2068
|
setImages(restored);
|
|
2005
2069
|
setError(null);
|
|
@@ -2204,11 +2268,10 @@ window.__ModuleLoader__.load({
|
|
|
2204
2268
|
children: tt("gallery.categories")
|
|
2205
2269
|
}),
|
|
2206
2270
|
[
|
|
2207
|
-
["all", "gallery.all"],
|
|
2208
|
-
["text", "mode.text"],
|
|
2209
|
-
["edit", "mode.edit"],
|
|
2210
|
-
[
|
|
2211
|
-
["grok-imagine-image", "gallery.grok"]
|
|
2271
|
+
["all", tt("gallery.all")],
|
|
2272
|
+
["text", tt("mode.text")],
|
|
2273
|
+
["edit", tt("mode.edit")],
|
|
2274
|
+
...galleryModels.map((value) => [value, value])
|
|
2212
2275
|
].map(([value, label]) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
2213
2276
|
type: "button",
|
|
2214
2277
|
className: panel_module_css_default.galleryFilter,
|
|
@@ -2216,7 +2279,7 @@ window.__ModuleLoader__.load({
|
|
|
2216
2279
|
onClick: () => {
|
|
2217
2280
|
setGalleryFilter(value);
|
|
2218
2281
|
},
|
|
2219
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children:
|
|
2282
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: label }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2220
2283
|
className: panel_module_css_default.galleryFilterCount,
|
|
2221
2284
|
children: gallery.filter((entry) => value === "all" || value === "text" || value === "edit" ? value === "all" ? true : entry.mode === value : entry.model === value).length
|
|
2222
2285
|
})]
|
|
@@ -2555,7 +2618,7 @@ window.__ModuleLoader__.load({
|
|
|
2555
2618
|
className: panel_module_css_default.modelMenuList,
|
|
2556
2619
|
role: "listbox",
|
|
2557
2620
|
"aria-label": tt("model.label"),
|
|
2558
|
-
children:
|
|
2621
|
+
children: imageModels.map((option) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2559
2622
|
type: "button",
|
|
2560
2623
|
role: "option",
|
|
2561
2624
|
"aria-selected": model === option,
|
|
@@ -2585,7 +2648,7 @@ window.__ModuleLoader__.load({
|
|
|
2585
2648
|
className: panel_module_css_default.compareModelChoices,
|
|
2586
2649
|
role: "group",
|
|
2587
2650
|
"aria-label": tt("compare.models"),
|
|
2588
|
-
children:
|
|
2651
|
+
children: imageModels.map((option) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
2589
2652
|
type: "checkbox",
|
|
2590
2653
|
checked: compareModels.includes(option),
|
|
2591
2654
|
onChange: () => {
|
|
@@ -3877,6 +3940,20 @@ window.__ModuleLoader__.load({
|
|
|
3877
3940
|
}
|
|
3878
3941
|
};
|
|
3879
3942
|
}
|
|
3943
|
+
/** A newline/comma-separated model list, persisted as a normalized string array. */
|
|
3944
|
+
function stringListField(field) {
|
|
3945
|
+
return {
|
|
3946
|
+
field,
|
|
3947
|
+
format: (value) => Array.isArray(value) ? value.filter((item) => typeof item === "string").join("\n") : "",
|
|
3948
|
+
parse: (text) => {
|
|
3949
|
+
const values = [...new Set(text.split(/[\n,]/).map((item) => item.trim()).filter(Boolean))];
|
|
3950
|
+
return values.length === 0 ? { kind: "clear" } : {
|
|
3951
|
+
kind: "set",
|
|
3952
|
+
value: values
|
|
3953
|
+
};
|
|
3954
|
+
}
|
|
3955
|
+
};
|
|
3956
|
+
}
|
|
3880
3957
|
/** A boolean field, edited through true/false draft text. */
|
|
3881
3958
|
function booleanField(field) {
|
|
3882
3959
|
return {
|
|
@@ -4106,7 +4183,7 @@ window.__ModuleLoader__.load({
|
|
|
4106
4183
|
};
|
|
4107
4184
|
//#endregion
|
|
4108
4185
|
//#region \0dsh-css:E:\dsh-plugin\src\client\settings-card.module.css.mjs
|
|
4109
|
-
const css = ".i1cc5G_card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:12px;list-style:none;transition:border-color .16s,background .16s}.i1cc5G_card:hover{border-color:var(--dsw-alias-label-dimmed)}.i1cc5G_card:has(.i1cc5G_body){background:var(--dsw-alias-bg-layer-2);border-color:var(--dsw-alias-label-dimmed)}.i1cc5G_header{appearance:none;width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:12px;align-items:center;gap:12px;padding:14px 16px;display:flex}.i1cc5G_header:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px}.i1cc5G_headText{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}.i1cc5G_name{color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:1.4}.i1cc5G_description{color:var(--dsw-alias-label-tertiary);font-size:13px;line-height:1.5}.i1cc5G_chevron,.i1cc5G_chevronOpen{color:var(--dsw-alias-label-tertiary);flex:none;transition:transform .16s}.i1cc5G_chevronOpen{transform:rotate(180deg)}.i1cc5G_pending{white-space:nowrap;background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-secondary);border-radius:999px;flex:none;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.i1cc5G_body{border-top:1px solid var(--dsw-alias-border-l2);margin:0 16px;padding-bottom:8px}.i1cc5G_versionRow{border-bottom:1px solid var(--dsw-alias-border-l2);justify-content:space-between;align-items:center;gap:12px;padding:12px 0;display:flex}.i1cc5G_versionLabel{color:var(--dsw-alias-label-primary);font-size:13px;font-weight:500;line-height:1.5}.i1cc5G_versionValue{background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-secondary);font-family:var(--dsw-font-family-mono,monospace);border-radius:999px;padding:1px 8px;font-size:12px;line-height:1.5}.i1cc5G_field{flex-direction:column;gap:6px;padding:12px 0;display:flex}.i1cc5G_field+.i1cc5G_field{border-top:1px solid var(--dsw-alias-border-l2)}.i1cc5G_head{align-items:center;gap:8px;display:flex}.i1cc5G_label{min-width:0;color:var(--dsw-alias-label-primary);flex:1;font-size:13px;font-weight:500;line-height:1.5}.i1cc5G_badges{align-items:center;gap:8px;display:inline-flex}.i1cc5G_badge{white-space:nowrap;background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-secondary);border-radius:999px;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.i1cc5G_reset{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;padding:0;font-size:12px;line-height:1.5}.i1cc5G_reset:hover:not(:disabled){color:var(--dsw-alias-label-primary)}.i1cc5G_reset:disabled{cursor:default;opacity:.5}.i1cc5G_input,.i1cc5G_select{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);height:34px;font:inherit;color:var(--dsw-alias-label-primary);border-radius:8px;outline:none;padding:0 12px;font-size:13px;line-height:1.5}.i1cc5G_input:focus-visible,.i1cc5G_select:focus-visible{border-color:var(--dsw-alias-brand-primary)}.i1cc5G_input:disabled,.i1cc5G_select:disabled{color:var(--dsw-alias-label-tertiary);cursor:default}.i1cc5G_inputInvalid{border:1px solid var(--dsw-alias-label-error);background:var(--dsw-alias-bg-layer-3);height:34px;font:inherit;color:var(--dsw-alias-label-primary);border-radius:8px;outline:none;padding:0 12px;font-size:13px;line-height:1.5}.i1cc5G_hint,.i1cc5G_invalid{margin:0;font-size:12px;line-height:1.5}.i1cc5G_hint{color:var(--dsw-alias-label-tertiary)}.i1cc5G_invalid{color:var(--dsw-alias-label-error)}.i1cc5G_readOnly,.i1cc5G_notExposed{color:var(--dsw-alias-label-tertiary);margin:12px 0 0;font-size:12px;line-height:1.5}.i1cc5G_sectionDivider{background:var(--dsw-alias-border-l2);height:1px;margin:18px 0 14px}.i1cc5G_sectionTitle{color:var(--dsw-alias-label-primary);margin:0;font-size:14px;line-height:1.4}.i1cc5G_sectionHint{color:var(--dsw-alias-label-tertiary);margin:-4px 0 2px;font-size:12px;line-height:1.5}.i1cc5G_modelFetchRow{align-items:center;gap:8px;display:flex}.i1cc5G_modelFetch,.i1cc5G_modelChoices{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);min-height:32px;color:var(--dsw-alias-label-secondary);font:inherit;border-radius:7px;font-size:12px}.i1cc5G_modelFetch{cursor:pointer;padding:0 10px}.i1cc5G_modelFetch:hover:not(:disabled){color:var(--dsw-alias-brand-primary);border-color:var(--dsw-alias-brand-primary)}.i1cc5G_modelFetch:disabled{opacity:.5;cursor:default}.i1cc5G_modelChoices{flex:1;min-width:0;padding:0 8px}.i1cc5G_footer{border-top:1px solid var(--dsw-alias-border-l2);justify-content:flex-end;align-items:center;gap:8px;padding:12px 0 4px;display:flex}.i1cc5G_failed{min-width:0;color:var(--dsw-alias-label-error);flex:1;margin:0;font-size:12px;line-height:1.5}.i1cc5G_discard,.i1cc5G_save{appearance:none;font:inherit;cursor:pointer;border:1px solid #0000;border-radius:8px;padding:5px 14px;font-size:13px;line-height:1.5}.i1cc5G_discard{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);background:0 0}.i1cc5G_discard:hover:not(:disabled){color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-dimmed)}.i1cc5G_save{background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-layer-3)}.i1cc5G_discard:disabled,.i1cc5G_save:disabled{opacity:.4;cursor:default}.i1cc5G_discard:focus-visible,.i1cc5G_save:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}@media (prefers-reduced-motion:reduce){.i1cc5G_card,.i1cc5G_chevron,.i1cc5G_chevronOpen{transition:none}}";
|
|
4186
|
+
const css = ".i1cc5G_card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:12px;list-style:none;transition:border-color .16s,background .16s}.i1cc5G_card:hover{border-color:var(--dsw-alias-label-dimmed)}.i1cc5G_card:has(.i1cc5G_body){background:var(--dsw-alias-bg-layer-2);border-color:var(--dsw-alias-label-dimmed)}.i1cc5G_header{appearance:none;width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:12px;align-items:center;gap:12px;padding:14px 16px;display:flex}.i1cc5G_header:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px}.i1cc5G_headText{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}.i1cc5G_name{color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:1.4}.i1cc5G_description{color:var(--dsw-alias-label-tertiary);font-size:13px;line-height:1.5}.i1cc5G_chevron,.i1cc5G_chevronOpen{color:var(--dsw-alias-label-tertiary);flex:none;transition:transform .16s}.i1cc5G_chevronOpen{transform:rotate(180deg)}.i1cc5G_pending{white-space:nowrap;background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-secondary);border-radius:999px;flex:none;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.i1cc5G_body{border-top:1px solid var(--dsw-alias-border-l2);margin:0 16px;padding-bottom:8px}.i1cc5G_versionRow{border-bottom:1px solid var(--dsw-alias-border-l2);justify-content:space-between;align-items:center;gap:12px;padding:12px 0;display:flex}.i1cc5G_versionLabel{color:var(--dsw-alias-label-primary);font-size:13px;font-weight:500;line-height:1.5}.i1cc5G_versionValue{background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-secondary);font-family:var(--dsw-font-family-mono,monospace);border-radius:999px;padding:1px 8px;font-size:12px;line-height:1.5}.i1cc5G_field{flex-direction:column;gap:6px;padding:12px 0;display:flex}.i1cc5G_field+.i1cc5G_field{border-top:1px solid var(--dsw-alias-border-l2)}.i1cc5G_head{align-items:center;gap:8px;display:flex}.i1cc5G_label{min-width:0;color:var(--dsw-alias-label-primary);flex:1;font-size:13px;font-weight:500;line-height:1.5}.i1cc5G_badges{align-items:center;gap:8px;display:inline-flex}.i1cc5G_badge{white-space:nowrap;background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-secondary);border-radius:999px;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.i1cc5G_reset{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;padding:0;font-size:12px;line-height:1.5}.i1cc5G_reset:hover:not(:disabled){color:var(--dsw-alias-label-primary)}.i1cc5G_reset:disabled{cursor:default;opacity:.5}.i1cc5G_input,.i1cc5G_select{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);height:34px;font:inherit;color:var(--dsw-alias-label-primary);border-radius:8px;outline:none;padding:0 12px;font-size:13px;line-height:1.5}.i1cc5G_input:focus-visible,.i1cc5G_select:focus-visible{border-color:var(--dsw-alias-brand-primary)}.i1cc5G_input:disabled,.i1cc5G_select:disabled{color:var(--dsw-alias-label-tertiary);cursor:default}.i1cc5G_inputInvalid{border:1px solid var(--dsw-alias-label-error);background:var(--dsw-alias-bg-layer-3);height:34px;font:inherit;color:var(--dsw-alias-label-primary);border-radius:8px;outline:none;padding:0 12px;font-size:13px;line-height:1.5}.i1cc5G_textarea,.i1cc5G_textareaInvalid{resize:vertical;background:var(--dsw-alias-bg-layer-3);min-height:70px;font:inherit;color:var(--dsw-alias-label-primary);border-radius:8px;outline:none;padding:8px 12px;font-size:13px;line-height:1.5}.i1cc5G_textarea{border:1px solid var(--dsw-alias-border-l2)}.i1cc5G_textareaInvalid{border:1px solid var(--dsw-alias-label-error)}.i1cc5G_textarea:focus-visible{border-color:var(--dsw-alias-brand-primary)}.i1cc5G_textarea:disabled{color:var(--dsw-alias-label-tertiary);cursor:default}.i1cc5G_hint,.i1cc5G_invalid{margin:0;font-size:12px;line-height:1.5}.i1cc5G_hint{color:var(--dsw-alias-label-tertiary)}.i1cc5G_invalid{color:var(--dsw-alias-label-error)}.i1cc5G_readOnly,.i1cc5G_notExposed{color:var(--dsw-alias-label-tertiary);margin:12px 0 0;font-size:12px;line-height:1.5}.i1cc5G_sectionDivider{background:var(--dsw-alias-border-l2);height:1px;margin:18px 0 14px}.i1cc5G_sectionTitle{color:var(--dsw-alias-label-primary);margin:0;font-size:14px;line-height:1.4}.i1cc5G_sectionHint{color:var(--dsw-alias-label-tertiary);margin:-4px 0 2px;font-size:12px;line-height:1.5}.i1cc5G_modelSection{padding:2px 0 14px}.i1cc5G_sectionHeader{justify-content:space-between;align-items:flex-start;gap:12px;display:flex}.i1cc5G_sectionHeader .i1cc5G_sectionHint{max-width:430px}.i1cc5G_modelSummary{flex-wrap:wrap;align-items:center;gap:6px;margin-top:12px;display:flex}.i1cc5G_modelChip{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);max-width:100%;color:var(--dsw-alias-label-primary);font-family:var(--dsw-font-family-mono,monospace);border-radius:6px;align-items:center;gap:5px;padding:3px 5px 3px 8px;font-size:12px;line-height:1.5;display:inline-flex}.i1cc5G_modelChip>span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.i1cc5G_modelChip button{appearance:none;width:18px;height:18px;color:var(--dsw-alias-label-tertiary);font:inherit;cursor:pointer;background:0 0;border:0;border-radius:4px;padding:0;line-height:18px}.i1cc5G_modelChip button:hover:not(:disabled){color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-module-platform)}.i1cc5G_modelChip button:disabled{cursor:default;opacity:.45}.i1cc5G_addModel{appearance:none;border:1px dashed var(--dsw-alias-border-l2);min-height:28px;color:var(--dsw-alias-label-secondary);font:inherit;cursor:pointer;background:0 0;border-radius:6px;padding:0 9px;font-size:12px}.i1cc5G_addModel:hover:not(:disabled){color:var(--dsw-alias-brand-primary);border-color:var(--dsw-alias-brand-primary)}.i1cc5G_addModel:disabled{opacity:.45;cursor:default}.i1cc5G_manualModelRow{gap:8px;margin-top:10px;display:flex}.i1cc5G_manualModelRow .i1cc5G_input{flex:1;min-width:0}.i1cc5G_disclosure{appearance:none;border:0;border-top:1px solid var(--dsw-alias-border-l2);width:100%;color:var(--dsw-alias-label-primary);font:inherit;text-align:left;cursor:pointer;background:0 0;align-items:center;gap:8px;padding:13px 0;font-size:13px;font-weight:500;display:flex}.i1cc5G_disclosure>span:nth-child(2){color:var(--dsw-alias-label-tertiary);margin-left:auto;font-size:12px;font-weight:400}.i1cc5G_disclosure>span:last-child{color:var(--dsw-alias-label-tertiary)}.i1cc5G_disclosure:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:2px}.i1cc5G_optionalContent{padding:0 0 8px}.i1cc5G_inlineDisclosure{appearance:none;color:var(--dsw-alias-label-secondary);font:inherit;cursor:pointer;background:0 0;border:0;align-items:center;gap:6px;margin-top:12px;padding:0;font-size:12px;display:inline-flex}.i1cc5G_inlineDisclosure:hover{color:var(--dsw-alias-label-primary)}.i1cc5G_modelFetchRow{align-items:center;gap:8px;display:flex}.i1cc5G_modelFetch,.i1cc5G_modelChoices{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);min-height:32px;color:var(--dsw-alias-label-secondary);font:inherit;border-radius:7px;font-size:12px}.i1cc5G_modelFetch{cursor:pointer;padding:0 10px}.i1cc5G_modelFetch:hover:not(:disabled){color:var(--dsw-alias-brand-primary);border-color:var(--dsw-alias-brand-primary)}.i1cc5G_modelFetch:disabled{opacity:.5;cursor:default}.i1cc5G_modelChoices{flex:1;min-width:0;padding:0 8px}.i1cc5G_modelCandidateList{flex-wrap:wrap;gap:6px 10px;margin-top:10px;display:flex}.i1cc5G_modelCandidateLabel{width:100%;color:var(--dsw-alias-label-tertiary);font-size:12px}.i1cc5G_modelCandidate{appearance:none;min-width:0;color:var(--dsw-alias-label-secondary);cursor:pointer;background:var(--dsw-alias-bg-layer-3);font-size:12px;line-height:1.5;font:inherit;border:1px solid #0000;border-radius:5px;align-items:center;gap:5px;padding:3px 6px;display:inline-flex}.i1cc5G_modelCandidate input{margin:0}.i1cc5G_modelCandidate[data-selected]{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-primary)}.i1cc5G_footer{border-top:1px solid var(--dsw-alias-border-l2);justify-content:flex-end;align-items:center;gap:8px;padding:12px 0 4px;display:flex}.i1cc5G_failed{min-width:0;color:var(--dsw-alias-label-error);flex:1;margin:0;font-size:12px;line-height:1.5}.i1cc5G_discard,.i1cc5G_save{appearance:none;font:inherit;cursor:pointer;border:1px solid #0000;border-radius:8px;padding:5px 14px;font-size:13px;line-height:1.5}.i1cc5G_discard{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);background:0 0}.i1cc5G_discard:hover:not(:disabled){color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-dimmed)}.i1cc5G_save{background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-layer-3)}.i1cc5G_discard:disabled,.i1cc5G_save:disabled{opacity:.4;cursor:default}.i1cc5G_discard:focus-visible,.i1cc5G_save:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}@media (prefers-reduced-motion:reduce){.i1cc5G_card,.i1cc5G_chevron,.i1cc5G_chevronOpen{transition:none}}";
|
|
4110
4187
|
const tagId = "@dickpy/dsh-imagegen/settings-card.module.css";
|
|
4111
4188
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
|
4112
4189
|
const tag = document.createElement("style");
|
|
@@ -4116,41 +4193,55 @@ window.__ModuleLoader__.load({
|
|
|
4116
4193
|
document.head.appendChild(tag);
|
|
4117
4194
|
}
|
|
4118
4195
|
var settings_card_module_css_default = {
|
|
4119
|
-
"
|
|
4120
|
-
"
|
|
4121
|
-
"header": "i1cc5G_header",
|
|
4122
|
-
"description": "i1cc5G_description",
|
|
4123
|
-
"input": "i1cc5G_input",
|
|
4124
|
-
"field": "i1cc5G_field",
|
|
4125
|
-
"invalid": "i1cc5G_invalid",
|
|
4126
|
-
"reset": "i1cc5G_reset",
|
|
4196
|
+
"manualModelRow": "i1cc5G_manualModelRow",
|
|
4197
|
+
"modelFetchRow": "i1cc5G_modelFetchRow",
|
|
4127
4198
|
"modelFetch": "i1cc5G_modelFetch",
|
|
4128
|
-
"
|
|
4129
|
-
"
|
|
4130
|
-
"
|
|
4131
|
-
"
|
|
4132
|
-
"
|
|
4133
|
-
"inputInvalid": "i1cc5G_inputInvalid",
|
|
4199
|
+
"chevronOpen": "i1cc5G_chevronOpen",
|
|
4200
|
+
"name": "i1cc5G_name",
|
|
4201
|
+
"badges": "i1cc5G_badges",
|
|
4202
|
+
"textarea": "i1cc5G_textarea",
|
|
4203
|
+
"input": "i1cc5G_input",
|
|
4134
4204
|
"sectionHint": "i1cc5G_sectionHint",
|
|
4205
|
+
"modelSection": "i1cc5G_modelSection",
|
|
4135
4206
|
"sectionDivider": "i1cc5G_sectionDivider",
|
|
4207
|
+
"optionalContent": "i1cc5G_optionalContent",
|
|
4208
|
+
"head": "i1cc5G_head",
|
|
4209
|
+
"select": "i1cc5G_select",
|
|
4210
|
+
"sectionTitle": "i1cc5G_sectionTitle",
|
|
4211
|
+
"label": "i1cc5G_label",
|
|
4212
|
+
"failed": "i1cc5G_failed",
|
|
4213
|
+
"addModel": "i1cc5G_addModel",
|
|
4214
|
+
"versionRow": "i1cc5G_versionRow",
|
|
4215
|
+
"discard": "i1cc5G_discard",
|
|
4216
|
+
"reset": "i1cc5G_reset",
|
|
4217
|
+
"field": "i1cc5G_field",
|
|
4218
|
+
"hint": "i1cc5G_hint",
|
|
4219
|
+
"modelCandidate": "i1cc5G_modelCandidate",
|
|
4220
|
+
"save": "i1cc5G_save",
|
|
4221
|
+
"description": "i1cc5G_description",
|
|
4222
|
+
"chevron": "i1cc5G_chevron",
|
|
4223
|
+
"headText": "i1cc5G_headText",
|
|
4136
4224
|
"card": "i1cc5G_card",
|
|
4225
|
+
"modelCandidateLabel": "i1cc5G_modelCandidateLabel",
|
|
4226
|
+
"footer": "i1cc5G_footer",
|
|
4227
|
+
"modelSummary": "i1cc5G_modelSummary",
|
|
4228
|
+
"modelChoices": "i1cc5G_modelChoices",
|
|
4137
4229
|
"notExposed": "i1cc5G_notExposed",
|
|
4138
|
-
"
|
|
4230
|
+
"modelCandidateList": "i1cc5G_modelCandidateList",
|
|
4139
4231
|
"pending": "i1cc5G_pending",
|
|
4140
|
-
"
|
|
4141
|
-
"
|
|
4142
|
-
"
|
|
4232
|
+
"invalid": "i1cc5G_invalid",
|
|
4233
|
+
"inputInvalid": "i1cc5G_inputInvalid",
|
|
4234
|
+
"body": "i1cc5G_body",
|
|
4235
|
+
"disclosure": "i1cc5G_disclosure",
|
|
4143
4236
|
"readOnly": "i1cc5G_readOnly",
|
|
4144
|
-
"chevronOpen": "i1cc5G_chevronOpen",
|
|
4145
|
-
"headText": "i1cc5G_headText",
|
|
4146
|
-
"head": "i1cc5G_head",
|
|
4147
|
-
"hint": "i1cc5G_hint",
|
|
4148
|
-
"versionRow": "i1cc5G_versionRow",
|
|
4149
4237
|
"versionLabel": "i1cc5G_versionLabel",
|
|
4150
|
-
"
|
|
4238
|
+
"badge": "i1cc5G_badge",
|
|
4151
4239
|
"versionValue": "i1cc5G_versionValue",
|
|
4152
|
-
"
|
|
4153
|
-
"
|
|
4240
|
+
"sectionHeader": "i1cc5G_sectionHeader",
|
|
4241
|
+
"header": "i1cc5G_header",
|
|
4242
|
+
"modelChip": "i1cc5G_modelChip",
|
|
4243
|
+
"textareaInvalid": "i1cc5G_textareaInvalid",
|
|
4244
|
+
"inlineDisclosure": "i1cc5G_inlineDisclosure"
|
|
4154
4245
|
};
|
|
4155
4246
|
//#endregion
|
|
4156
4247
|
//#region src/client/SettingsCard.tsx
|
|
@@ -4171,8 +4262,10 @@ window.__ModuleLoader__.load({
|
|
|
4171
4262
|
this.form = new CardForm(scope, [
|
|
4172
4263
|
booleanField("enabled"),
|
|
4173
4264
|
booleanField("announceToAgent"),
|
|
4265
|
+
booleanField("allowAgentImageGeneration"),
|
|
4174
4266
|
textField("apiUrl"),
|
|
4175
4267
|
secretField("apiKey"),
|
|
4268
|
+
stringListField("imageModels"),
|
|
4176
4269
|
textField("promptApiUrl"),
|
|
4177
4270
|
secretField("promptApiKey"),
|
|
4178
4271
|
textField("promptModel")
|
|
@@ -4183,8 +4276,10 @@ window.__ModuleLoader__.load({
|
|
|
4183
4276
|
...this.form.shell(),
|
|
4184
4277
|
enabled: this.form.field("enabled"),
|
|
4185
4278
|
announceToAgent: this.form.field("announceToAgent"),
|
|
4279
|
+
allowAgentImageGeneration: this.form.field("allowAgentImageGeneration"),
|
|
4186
4280
|
apiUrl: this.form.field("apiUrl"),
|
|
4187
4281
|
apiKey: this.form.field("apiKey"),
|
|
4282
|
+
imageModels: this.form.field("imageModels"),
|
|
4188
4283
|
promptApiUrl: this.form.field("promptApiUrl"),
|
|
4189
4284
|
promptApiKey: this.form.field("promptApiKey"),
|
|
4190
4285
|
promptModel: this.form.field("promptModel")
|
|
@@ -4219,9 +4314,19 @@ window.__ModuleLoader__.load({
|
|
|
4219
4314
|
const state = props.useImageGenSettingsCard((snapshot) => snapshot);
|
|
4220
4315
|
const keySet = props.useImageGenKeySet((snapshot) => snapshot);
|
|
4221
4316
|
const [open, setOpen] = (0, react.useState)(false);
|
|
4222
|
-
const [
|
|
4223
|
-
const [
|
|
4224
|
-
const [
|
|
4317
|
+
const [promptModels, setPromptModels] = (0, react.useState)([]);
|
|
4318
|
+
const [loadingPromptModels, setLoadingPromptModels] = (0, react.useState)(false);
|
|
4319
|
+
const [promptModelsError, setPromptModelsError] = (0, react.useState)(null);
|
|
4320
|
+
const [imageModelCandidates, setImageModelCandidates] = (0, react.useState)([]);
|
|
4321
|
+
const [loadingImageModels, setLoadingImageModels] = (0, react.useState)(false);
|
|
4322
|
+
const [imageModelsError, setImageModelsError] = (0, react.useState)(null);
|
|
4323
|
+
const [manualModelsOpen, setManualModelsOpen] = (0, react.useState)(false);
|
|
4324
|
+
const [manualModel, setManualModel] = (0, react.useState)("");
|
|
4325
|
+
const [enhancementOpen, setEnhancementOpen] = (0, react.useState)(false);
|
|
4326
|
+
const [manualPromptModelOpen, setManualPromptModelOpen] = (0, react.useState)(false);
|
|
4327
|
+
const [manualPromptModel, setManualPromptModel] = (0, react.useState)("");
|
|
4328
|
+
const [promptApiOpen, setPromptApiOpen] = (0, react.useState)(false);
|
|
4329
|
+
const [moreOpen, setMoreOpen] = (0, react.useState)(false);
|
|
4225
4330
|
if (!state.available) return null;
|
|
4226
4331
|
const title = t("settings.title");
|
|
4227
4332
|
const blocked = !state.dirty || state.invalid || state.saving;
|
|
@@ -4302,37 +4407,6 @@ window.__ModuleLoader__.load({
|
|
|
4302
4407
|
role: "status",
|
|
4303
4408
|
children: t("settings.readOnly")
|
|
4304
4409
|
}) : null,
|
|
4305
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4306
|
-
className: settings_card_module_css_default.versionRow,
|
|
4307
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4308
|
-
className: settings_card_module_css_default.versionLabel,
|
|
4309
|
-
children: t("settings.currentVersion")
|
|
4310
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("code", {
|
|
4311
|
-
className: settings_card_module_css_default.versionValue,
|
|
4312
|
-
children: ["v", PLUGIN_VERSION]
|
|
4313
|
-
})]
|
|
4314
|
-
}),
|
|
4315
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ValueField, {
|
|
4316
|
-
id: "dsh-imagegen-settings-apikey",
|
|
4317
|
-
label: t("settings.apiKey"),
|
|
4318
|
-
hint: keySet ? t("settings.apiKeySet") : t("settings.apiKeyHint"),
|
|
4319
|
-
placeholder: "sk-…",
|
|
4320
|
-
secret: true,
|
|
4321
|
-
...fieldProps,
|
|
4322
|
-
...state.apiKey,
|
|
4323
|
-
overridden: false,
|
|
4324
|
-
onEdit: (text) => {
|
|
4325
|
-
props.edit("apiKey", text);
|
|
4326
|
-
},
|
|
4327
|
-
onReset: () => {
|
|
4328
|
-
props.resetField("apiKey");
|
|
4329
|
-
},
|
|
4330
|
-
clearLabel: t("settings.apiKeyClear"),
|
|
4331
|
-
onClear: () => {
|
|
4332
|
-
props.resetField("apiKey");
|
|
4333
|
-
},
|
|
4334
|
-
canClear: keySet
|
|
4335
|
-
}),
|
|
4336
4410
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ValueField, {
|
|
4337
4411
|
id: "dsh-imagegen-settings-apiurl",
|
|
4338
4412
|
label: t("settings.apiUrl"),
|
|
@@ -4347,131 +4421,376 @@ window.__ModuleLoader__.load({
|
|
|
4347
4421
|
props.resetField("apiUrl");
|
|
4348
4422
|
}
|
|
4349
4423
|
}),
|
|
4350
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: settings_card_module_css_default.sectionDivider }),
|
|
4351
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
|
|
4352
|
-
className: settings_card_module_css_default.sectionTitle,
|
|
4353
|
-
children: t("settings.promptEnhanceTitle")
|
|
4354
|
-
}),
|
|
4355
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4356
|
-
className: settings_card_module_css_default.sectionHint,
|
|
4357
|
-
children: t("settings.promptEnhanceHint")
|
|
4358
|
-
}),
|
|
4359
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ValueField, {
|
|
4360
|
-
id: "dsh-imagegen-settings-prompt-apiurl",
|
|
4361
|
-
label: t("settings.promptApiUrl"),
|
|
4362
|
-
hint: t("settings.promptApiUrlHint"),
|
|
4363
|
-
placeholder: "https://api.openai.com/v1",
|
|
4364
|
-
...fieldProps,
|
|
4365
|
-
...state.promptApiUrl,
|
|
4366
|
-
onEdit: (text) => {
|
|
4367
|
-
props.edit("promptApiUrl", text);
|
|
4368
|
-
},
|
|
4369
|
-
onReset: () => {
|
|
4370
|
-
props.resetField("promptApiUrl");
|
|
4371
|
-
}
|
|
4372
|
-
}),
|
|
4373
4424
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ValueField, {
|
|
4374
|
-
id: "dsh-imagegen-settings-
|
|
4375
|
-
label: t("settings.
|
|
4376
|
-
hint: t("settings.
|
|
4425
|
+
id: "dsh-imagegen-settings-apikey",
|
|
4426
|
+
label: t("settings.apiKey"),
|
|
4427
|
+
hint: keySet ? t("settings.apiKeySet") : t("settings.apiKeyHint"),
|
|
4377
4428
|
placeholder: "sk-…",
|
|
4378
4429
|
secret: true,
|
|
4379
4430
|
...fieldProps,
|
|
4380
|
-
...state.
|
|
4431
|
+
...state.apiKey,
|
|
4381
4432
|
overridden: false,
|
|
4382
4433
|
onEdit: (text) => {
|
|
4383
|
-
props.edit("
|
|
4434
|
+
props.edit("apiKey", text);
|
|
4384
4435
|
},
|
|
4385
4436
|
onReset: () => {
|
|
4386
|
-
props.resetField("
|
|
4387
|
-
}
|
|
4388
|
-
}),
|
|
4389
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ValueField, {
|
|
4390
|
-
id: "dsh-imagegen-settings-prompt-model",
|
|
4391
|
-
label: t("settings.promptModel"),
|
|
4392
|
-
hint: t("settings.promptModelHint"),
|
|
4393
|
-
placeholder: "gpt-4.1-mini",
|
|
4394
|
-
...fieldProps,
|
|
4395
|
-
...state.promptModel,
|
|
4396
|
-
onEdit: (text) => {
|
|
4397
|
-
props.edit("promptModel", text);
|
|
4437
|
+
props.resetField("apiKey");
|
|
4398
4438
|
},
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4439
|
+
clearLabel: t("settings.apiKeyClear"),
|
|
4440
|
+
onClear: () => {
|
|
4441
|
+
props.resetField("apiKey");
|
|
4442
|
+
},
|
|
4443
|
+
canClear: keySet
|
|
4402
4444
|
}),
|
|
4403
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
}).
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
},
|
|
4436
|
-
|
|
4445
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: settings_card_module_css_default.sectionDivider }),
|
|
4446
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
4447
|
+
className: settings_card_module_css_default.modelSection,
|
|
4448
|
+
"aria-label": t("settings.imageModelsTitle"),
|
|
4449
|
+
children: [
|
|
4450
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4451
|
+
className: settings_card_module_css_default.sectionHeader,
|
|
4452
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
|
|
4453
|
+
className: settings_card_module_css_default.sectionTitle,
|
|
4454
|
+
children: t("settings.imageModelsTitle")
|
|
4455
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4456
|
+
className: settings_card_module_css_default.sectionHint,
|
|
4457
|
+
children: t("settings.imageModelsHint")
|
|
4458
|
+
})] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4459
|
+
type: "button",
|
|
4460
|
+
className: settings_card_module_css_default.modelFetch,
|
|
4461
|
+
disabled: disabled || loadingImageModels,
|
|
4462
|
+
onClick: () => {
|
|
4463
|
+
setLoadingImageModels(true);
|
|
4464
|
+
setImageModelsError(null);
|
|
4465
|
+
fetch(IMAGE_MODEL_API.models, { method: "POST" }).then(async (response) => {
|
|
4466
|
+
const body = await response.json();
|
|
4467
|
+
if (!response.ok || body.ok !== true) throw new Error(body.message ?? `HTTP ${response.status}`);
|
|
4468
|
+
setImageModelCandidates(body.models ?? []);
|
|
4469
|
+
}).catch((error) => {
|
|
4470
|
+
setImageModelsError(error instanceof Error ? error.message : String(error));
|
|
4471
|
+
}).finally(() => {
|
|
4472
|
+
setLoadingImageModels(false);
|
|
4473
|
+
});
|
|
4474
|
+
},
|
|
4475
|
+
children: loadingImageModels ? t("settings.imageModelsLoading") : t("settings.imageModelsFetch")
|
|
4476
|
+
})]
|
|
4477
|
+
}),
|
|
4478
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4479
|
+
className: settings_card_module_css_default.modelSummary,
|
|
4480
|
+
children: [splitModels(state.imageModels.text).map((model) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
4481
|
+
className: settings_card_module_css_default.modelChip,
|
|
4482
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: model }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4483
|
+
type: "button",
|
|
4484
|
+
disabled,
|
|
4485
|
+
"aria-label": `${t("settings.removeModel")}: ${model}`,
|
|
4486
|
+
onClick: () => {
|
|
4487
|
+
props.edit("imageModels", splitModels(state.imageModels.text).filter((value) => value !== model).join("\n"));
|
|
4488
|
+
},
|
|
4489
|
+
children: "×"
|
|
4490
|
+
})]
|
|
4491
|
+
}, model)), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4492
|
+
type: "button",
|
|
4493
|
+
className: settings_card_module_css_default.addModel,
|
|
4494
|
+
disabled,
|
|
4495
|
+
onClick: () => {
|
|
4496
|
+
setManualModelsOpen((open) => !open);
|
|
4497
|
+
},
|
|
4498
|
+
children: manualModelsOpen ? t("settings.cancelAddModel") : t("settings.addModel")
|
|
4499
|
+
})]
|
|
4500
|
+
}),
|
|
4501
|
+
manualModelsOpen ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4502
|
+
className: settings_card_module_css_default.manualModelRow,
|
|
4503
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
4504
|
+
className: settings_card_module_css_default.input,
|
|
4505
|
+
value: manualModel,
|
|
4506
|
+
placeholder: t("settings.addModelPlaceholder"),
|
|
4507
|
+
disabled,
|
|
4508
|
+
onChange: (event) => {
|
|
4509
|
+
setManualModel(event.target.value);
|
|
4510
|
+
},
|
|
4511
|
+
onKeyDown: (event) => {
|
|
4512
|
+
if (event.key !== "Enter") return;
|
|
4513
|
+
event.preventDefault();
|
|
4514
|
+
const next = manualModel.trim();
|
|
4515
|
+
if (next === "") return;
|
|
4516
|
+
props.edit("imageModels", [...splitModels(state.imageModels.text), next].join("\n"));
|
|
4517
|
+
setManualModel("");
|
|
4518
|
+
}
|
|
4519
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4520
|
+
type: "button",
|
|
4521
|
+
className: settings_card_module_css_default.addModel,
|
|
4522
|
+
disabled: disabled || manualModel.trim() === "",
|
|
4523
|
+
onClick: () => {
|
|
4524
|
+
props.edit("imageModels", [...splitModels(state.imageModels.text), manualModel.trim()].join("\n"));
|
|
4525
|
+
setManualModel("");
|
|
4526
|
+
},
|
|
4527
|
+
children: t("settings.addModelConfirm")
|
|
4528
|
+
})]
|
|
4529
|
+
}) : null,
|
|
4530
|
+
imageModelCandidates.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4531
|
+
className: settings_card_module_css_default.modelCandidateList,
|
|
4532
|
+
role: "group",
|
|
4533
|
+
"aria-label": t("settings.imageModelsCandidates"),
|
|
4534
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4535
|
+
className: settings_card_module_css_default.modelCandidateLabel,
|
|
4536
|
+
children: t("settings.imageModelsCandidates")
|
|
4537
|
+
}), imageModelCandidates.map((candidate) => {
|
|
4538
|
+
const selected = splitModels(state.imageModels.text).includes(candidate);
|
|
4539
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
4540
|
+
className: settings_card_module_css_default.modelCandidate,
|
|
4541
|
+
"data-selected": selected ? "" : void 0,
|
|
4542
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
4543
|
+
type: "checkbox",
|
|
4544
|
+
checked: selected,
|
|
4545
|
+
disabled,
|
|
4546
|
+
onChange: () => {
|
|
4547
|
+
const selectedModels = splitModels(state.imageModels.text);
|
|
4548
|
+
const next = selected ? selectedModels.filter((model) => model !== candidate) : [...selectedModels, candidate];
|
|
4549
|
+
props.edit("imageModels", next.join("\n"));
|
|
4550
|
+
}
|
|
4551
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: candidate })]
|
|
4552
|
+
}, candidate);
|
|
4553
|
+
})]
|
|
4554
|
+
}) : null,
|
|
4555
|
+
imageModelsError !== null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4556
|
+
className: settings_card_module_css_default.failed,
|
|
4557
|
+
role: "status",
|
|
4558
|
+
children: imageModelsError
|
|
4559
|
+
}) : null
|
|
4560
|
+
]
|
|
4437
4561
|
}),
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
id: "dsh-imagegen-settings-enabled",
|
|
4445
|
-
label: t("settings.enabled"),
|
|
4446
|
-
hint: t("settings.enabledHint"),
|
|
4447
|
-
inheritLabel: t("settings.inherit"),
|
|
4448
|
-
onLabel: t("settings.on"),
|
|
4449
|
-
offLabel: t("settings.off"),
|
|
4450
|
-
...fieldProps,
|
|
4451
|
-
...state.enabled,
|
|
4452
|
-
onEdit: (text) => {
|
|
4453
|
-
props.edit("enabled", text);
|
|
4562
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
4563
|
+
type: "button",
|
|
4564
|
+
className: settings_card_module_css_default.disclosure,
|
|
4565
|
+
"aria-expanded": enhancementOpen,
|
|
4566
|
+
onClick: () => {
|
|
4567
|
+
setEnhancementOpen((open) => !open);
|
|
4454
4568
|
},
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4569
|
+
children: [
|
|
4570
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("settings.promptEnhanceTitle") }),
|
|
4571
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("settings.optional") }),
|
|
4572
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4573
|
+
"aria-hidden": "true",
|
|
4574
|
+
children: enhancementOpen ? "⌃" : "⌄"
|
|
4575
|
+
})
|
|
4576
|
+
]
|
|
4458
4577
|
}),
|
|
4459
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
4460
|
-
|
|
4461
|
-
label: t("settings.
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4578
|
+
enhancementOpen ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
4579
|
+
className: settings_card_module_css_default.optionalContent,
|
|
4580
|
+
"aria-label": t("settings.promptEnhanceTitle"),
|
|
4581
|
+
children: [
|
|
4582
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4583
|
+
className: settings_card_module_css_default.sectionHint,
|
|
4584
|
+
children: t("settings.promptEnhanceHint")
|
|
4585
|
+
}),
|
|
4586
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4587
|
+
className: settings_card_module_css_default.sectionHeader,
|
|
4588
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
|
|
4589
|
+
className: settings_card_module_css_default.sectionTitle,
|
|
4590
|
+
children: t("settings.promptModel")
|
|
4591
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4592
|
+
className: settings_card_module_css_default.sectionHint,
|
|
4593
|
+
children: t("settings.promptModelDetectionHint")
|
|
4594
|
+
})] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4595
|
+
type: "button",
|
|
4596
|
+
className: settings_card_module_css_default.modelFetch,
|
|
4597
|
+
disabled: disabled || loadingPromptModels,
|
|
4598
|
+
onClick: () => {
|
|
4599
|
+
setLoadingPromptModels(true);
|
|
4600
|
+
setPromptModelsError(null);
|
|
4601
|
+
fetch(PROMPT_ENHANCE_API.models, { method: "POST" }).then(async (response) => {
|
|
4602
|
+
const body = await response.json();
|
|
4603
|
+
if (!response.ok || body.ok !== true) throw new Error(body.message ?? `HTTP ${response.status}`);
|
|
4604
|
+
setPromptModels(body.models ?? []);
|
|
4605
|
+
}).catch((error) => {
|
|
4606
|
+
setPromptModelsError(error instanceof Error ? error.message : String(error));
|
|
4607
|
+
}).finally(() => {
|
|
4608
|
+
setLoadingPromptModels(false);
|
|
4609
|
+
});
|
|
4610
|
+
},
|
|
4611
|
+
children: loadingPromptModels ? t("settings.promptModelsLoading") : t("settings.promptModelsFetch")
|
|
4612
|
+
})]
|
|
4613
|
+
}),
|
|
4614
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4615
|
+
className: settings_card_module_css_default.modelSummary,
|
|
4616
|
+
children: [state.promptModel.text.trim() !== "" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
4617
|
+
className: settings_card_module_css_default.modelChip,
|
|
4618
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: state.promptModel.text }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4619
|
+
type: "button",
|
|
4620
|
+
disabled,
|
|
4621
|
+
"aria-label": `${t("settings.removeModel")}: ${state.promptModel.text}`,
|
|
4622
|
+
onClick: () => {
|
|
4623
|
+
props.edit("promptModel", "");
|
|
4624
|
+
},
|
|
4625
|
+
children: "×"
|
|
4626
|
+
})]
|
|
4627
|
+
}) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4628
|
+
type: "button",
|
|
4629
|
+
className: settings_card_module_css_default.addModel,
|
|
4630
|
+
disabled,
|
|
4631
|
+
onClick: () => {
|
|
4632
|
+
setManualPromptModelOpen((open) => !open);
|
|
4633
|
+
},
|
|
4634
|
+
children: manualPromptModelOpen ? t("settings.cancelAddModel") : t("settings.addModel")
|
|
4635
|
+
})]
|
|
4636
|
+
}),
|
|
4637
|
+
manualPromptModelOpen ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4638
|
+
className: settings_card_module_css_default.manualModelRow,
|
|
4639
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
4640
|
+
className: settings_card_module_css_default.input,
|
|
4641
|
+
value: manualPromptModel,
|
|
4642
|
+
placeholder: t("settings.addPromptModelPlaceholder"),
|
|
4643
|
+
disabled,
|
|
4644
|
+
onChange: (event) => {
|
|
4645
|
+
setManualPromptModel(event.target.value);
|
|
4646
|
+
}
|
|
4647
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4648
|
+
type: "button",
|
|
4649
|
+
className: settings_card_module_css_default.addModel,
|
|
4650
|
+
disabled: disabled || manualPromptModel.trim() === "",
|
|
4651
|
+
onClick: () => {
|
|
4652
|
+
props.edit("promptModel", manualPromptModel);
|
|
4653
|
+
setManualPromptModel("");
|
|
4654
|
+
},
|
|
4655
|
+
children: t("settings.addModelConfirm")
|
|
4656
|
+
})]
|
|
4657
|
+
}) : null,
|
|
4658
|
+
promptModels.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4659
|
+
className: settings_card_module_css_default.modelCandidateList,
|
|
4660
|
+
role: "radiogroup",
|
|
4661
|
+
"aria-label": t("settings.promptModelsCandidates"),
|
|
4662
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4663
|
+
className: settings_card_module_css_default.modelCandidateLabel,
|
|
4664
|
+
children: t("settings.promptModelsCandidates")
|
|
4665
|
+
}), promptModels.map((candidate) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4666
|
+
type: "button",
|
|
4667
|
+
role: "radio",
|
|
4668
|
+
className: settings_card_module_css_default.modelCandidate,
|
|
4669
|
+
"aria-checked": state.promptModel.text === candidate,
|
|
4670
|
+
"data-selected": state.promptModel.text === candidate ? "" : void 0,
|
|
4671
|
+
disabled,
|
|
4672
|
+
onClick: () => {
|
|
4673
|
+
props.edit("promptModel", candidate);
|
|
4674
|
+
},
|
|
4675
|
+
children: candidate
|
|
4676
|
+
}, candidate))]
|
|
4677
|
+
}) : null,
|
|
4678
|
+
promptModelsError !== null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4679
|
+
className: settings_card_module_css_default.failed,
|
|
4680
|
+
role: "status",
|
|
4681
|
+
children: promptModelsError
|
|
4682
|
+
}) : null,
|
|
4683
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
4684
|
+
type: "button",
|
|
4685
|
+
className: settings_card_module_css_default.inlineDisclosure,
|
|
4686
|
+
"aria-expanded": promptApiOpen,
|
|
4687
|
+
onClick: () => {
|
|
4688
|
+
setPromptApiOpen((open) => !open);
|
|
4689
|
+
},
|
|
4690
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("settings.promptApiAdvanced") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4691
|
+
"aria-hidden": "true",
|
|
4692
|
+
children: promptApiOpen ? "⌃" : "⌄"
|
|
4693
|
+
})]
|
|
4694
|
+
}),
|
|
4695
|
+
promptApiOpen ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4696
|
+
className: settings_card_module_css_default.optionalContent,
|
|
4697
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ValueField, {
|
|
4698
|
+
id: "dsh-imagegen-settings-prompt-apiurl",
|
|
4699
|
+
label: t("settings.promptApiUrl"),
|
|
4700
|
+
hint: t("settings.promptApiUrlHint"),
|
|
4701
|
+
placeholder: "https://api.openai.com/v1",
|
|
4702
|
+
...fieldProps,
|
|
4703
|
+
...state.promptApiUrl,
|
|
4704
|
+
onEdit: (text) => {
|
|
4705
|
+
props.edit("promptApiUrl", text);
|
|
4706
|
+
},
|
|
4707
|
+
onReset: () => {
|
|
4708
|
+
props.resetField("promptApiUrl");
|
|
4709
|
+
}
|
|
4710
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ValueField, {
|
|
4711
|
+
id: "dsh-imagegen-settings-prompt-apikey",
|
|
4712
|
+
label: t("settings.promptApiKey"),
|
|
4713
|
+
hint: t("settings.promptApiKeyHint"),
|
|
4714
|
+
placeholder: "sk-…",
|
|
4715
|
+
secret: true,
|
|
4716
|
+
...fieldProps,
|
|
4717
|
+
...state.promptApiKey,
|
|
4718
|
+
overridden: false,
|
|
4719
|
+
onEdit: (text) => {
|
|
4720
|
+
props.edit("promptApiKey", text);
|
|
4721
|
+
},
|
|
4722
|
+
onReset: () => {
|
|
4723
|
+
props.resetField("promptApiKey");
|
|
4724
|
+
}
|
|
4725
|
+
})]
|
|
4726
|
+
}) : null
|
|
4727
|
+
]
|
|
4728
|
+
}) : null,
|
|
4729
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
4730
|
+
type: "button",
|
|
4731
|
+
className: settings_card_module_css_default.disclosure,
|
|
4732
|
+
"aria-expanded": moreOpen,
|
|
4733
|
+
onClick: () => {
|
|
4734
|
+
setMoreOpen((open) => !open);
|
|
4470
4735
|
},
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4736
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("settings.moreOptions") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4737
|
+
"aria-hidden": "true",
|
|
4738
|
+
children: moreOpen ? "⌃" : "⌄"
|
|
4739
|
+
})]
|
|
4474
4740
|
}),
|
|
4741
|
+
moreOpen ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4742
|
+
className: settings_card_module_css_default.optionalContent,
|
|
4743
|
+
children: [
|
|
4744
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(BooleanField, {
|
|
4745
|
+
id: "dsh-imagegen-settings-enabled",
|
|
4746
|
+
label: t("settings.enabled"),
|
|
4747
|
+
hint: t("settings.enabledHint"),
|
|
4748
|
+
inheritLabel: t("settings.inherit"),
|
|
4749
|
+
onLabel: t("settings.on"),
|
|
4750
|
+
offLabel: t("settings.off"),
|
|
4751
|
+
...fieldProps,
|
|
4752
|
+
...state.enabled,
|
|
4753
|
+
onEdit: (text) => {
|
|
4754
|
+
props.edit("enabled", text);
|
|
4755
|
+
},
|
|
4756
|
+
onReset: () => {
|
|
4757
|
+
props.resetField("enabled");
|
|
4758
|
+
}
|
|
4759
|
+
}),
|
|
4760
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(BooleanField, {
|
|
4761
|
+
id: "dsh-imagegen-settings-announce",
|
|
4762
|
+
label: t("settings.announceToAgent"),
|
|
4763
|
+
hint: t("settings.announceToAgentHint"),
|
|
4764
|
+
inheritLabel: t("settings.inherit"),
|
|
4765
|
+
onLabel: t("settings.on"),
|
|
4766
|
+
offLabel: t("settings.off"),
|
|
4767
|
+
...fieldProps,
|
|
4768
|
+
...state.announceToAgent,
|
|
4769
|
+
onEdit: (text) => {
|
|
4770
|
+
props.edit("announceToAgent", text);
|
|
4771
|
+
},
|
|
4772
|
+
onReset: () => {
|
|
4773
|
+
props.resetField("announceToAgent");
|
|
4774
|
+
}
|
|
4775
|
+
}),
|
|
4776
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(BooleanField, {
|
|
4777
|
+
id: "dsh-imagegen-settings-agent-generation",
|
|
4778
|
+
label: t("settings.allowAgentImageGeneration"),
|
|
4779
|
+
hint: t("settings.allowAgentImageGenerationHint"),
|
|
4780
|
+
inheritLabel: t("settings.inherit"),
|
|
4781
|
+
onLabel: t("settings.on"),
|
|
4782
|
+
offLabel: t("settings.off"),
|
|
4783
|
+
...fieldProps,
|
|
4784
|
+
...state.allowAgentImageGeneration,
|
|
4785
|
+
onEdit: (text) => {
|
|
4786
|
+
props.edit("allowAgentImageGeneration", text);
|
|
4787
|
+
},
|
|
4788
|
+
onReset: () => {
|
|
4789
|
+
props.resetField("allowAgentImageGeneration");
|
|
4790
|
+
}
|
|
4791
|
+
})
|
|
4792
|
+
]
|
|
4793
|
+
}) : null,
|
|
4475
4794
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4476
4795
|
className: settings_card_module_css_default.footer,
|
|
4477
4796
|
children: [
|
|
@@ -4535,7 +4854,17 @@ window.__ModuleLoader__.load({
|
|
|
4535
4854
|
}) : null
|
|
4536
4855
|
]
|
|
4537
4856
|
}),
|
|
4538
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("
|
|
4857
|
+
props.multiline === true ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
|
|
4858
|
+
id: props.id,
|
|
4859
|
+
className: props.invalid ? settings_card_module_css_default.textareaInvalid : settings_card_module_css_default.textarea,
|
|
4860
|
+
...props.invalid ? { "aria-invalid": true } : {},
|
|
4861
|
+
value: props.text,
|
|
4862
|
+
placeholder: props.placeholder ?? "",
|
|
4863
|
+
disabled: props.disabled,
|
|
4864
|
+
onChange: (event) => {
|
|
4865
|
+
props.onEdit(event.target.value);
|
|
4866
|
+
}
|
|
4867
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
4539
4868
|
id: props.id,
|
|
4540
4869
|
className: props.invalid ? settings_card_module_css_default.inputInvalid : settings_card_module_css_default.input,
|
|
4541
4870
|
type: props.secret === true ? "password" : "text",
|
|
@@ -4555,6 +4884,9 @@ window.__ModuleLoader__.load({
|
|
|
4555
4884
|
]
|
|
4556
4885
|
});
|
|
4557
4886
|
}
|
|
4887
|
+
function splitModels(value) {
|
|
4888
|
+
return [...new Set(value.split(/[\n,]/).map((model) => model.trim()).filter(Boolean))];
|
|
4889
|
+
}
|
|
4558
4890
|
/** A staged boolean field: 继承 / 开 / 关. */
|
|
4559
4891
|
function BooleanField(props) {
|
|
4560
4892
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|