dsh-audiogen 0.3.0 → 0.3.3
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/lib/client.js +1069 -550
- package/lib/client.js.map +1 -1
- package/lib/index.js +483 -118
- package/package.json +1 -1
- package/skills/music/SKILL.md +30 -7
- package/skills/tts/SKILL.md +42 -4
- package/src/agent-audio-tools.ts +80 -3
- package/src/audio-engine.ts +185 -26
- package/src/audio-models.ts +132 -24
- package/src/audio-presets.ts +27 -33
- package/src/client/AudioGenPanel.tsx +92 -3
- package/src/client/SettingsCard.tsx +520 -176
- package/src/client/audio-panel.module.css +36 -0
- package/src/client/locales.ts +84 -16
- package/src/client/settings-card.module.css +424 -607
- package/src/protocol.ts +39 -1
- package/src/routes.ts +44 -3
package/lib/client.js
CHANGED
|
@@ -125,8 +125,10 @@ window.__ModuleLoader__.load({
|
|
|
125
125
|
"channels.title": "音频渠道",
|
|
126
126
|
"channels.hint": "每个渠道是一个独立的音频厂商/API 端点,可配置多个。",
|
|
127
127
|
"channels.empty": "还没有渠道。",
|
|
128
|
-
"channels.addProvider": "+
|
|
129
|
-
"channels.
|
|
128
|
+
"channels.addProvider": "+ 添加提供方",
|
|
129
|
+
"channels.addProviderLoading": "加载提供方…",
|
|
130
|
+
"channels.addProviderFailed": "提供方目录加载失败,请点击重试。",
|
|
131
|
+
"channels.addCustom": "+ 添加自定义提供方",
|
|
130
132
|
"channels.edit": "编辑",
|
|
131
133
|
"channels.delete": "删除",
|
|
132
134
|
"channels.confirm": "确认删除",
|
|
@@ -138,17 +140,49 @@ window.__ModuleLoader__.load({
|
|
|
138
140
|
"channels.statusReady": "可用",
|
|
139
141
|
"channels.statusIncomplete": "未完成",
|
|
140
142
|
"channels.untitled": "未命名渠道",
|
|
143
|
+
"channel.title": "渠道设置",
|
|
144
|
+
"channel.editTitle": "编辑渠道",
|
|
145
|
+
"channel.provider": "提供方",
|
|
146
|
+
"channel.providerCustom": "自定义渠道",
|
|
147
|
+
"channel.providerCustomHint": "任意 OpenAI 兼容 TTS 或通用音频 POST 接口",
|
|
148
|
+
"channel.site": "官网",
|
|
141
149
|
"channel.name": "名称",
|
|
150
|
+
"channel.namePlaceholder": "渠道名称(如:MiniMax 主渠道)",
|
|
142
151
|
"channel.apiUrl": "API 地址",
|
|
152
|
+
"channel.apiUrlPlaceholder": "提供方默认地址",
|
|
153
|
+
"channel.apiUrlHint": "留空使用提供方默认地址。",
|
|
143
154
|
"channel.apiKey": "API 密钥",
|
|
144
|
-
"channel.apiKeyHint": "
|
|
145
|
-
"channel.
|
|
146
|
-
"channel.
|
|
147
|
-
"channel.
|
|
155
|
+
"channel.apiKeyHint": "输入 API 密钥后即可使用该渠道。",
|
|
156
|
+
"channel.apiKeyStoredHint": "已保存密钥;留空保持不变,输入新值可更换。",
|
|
157
|
+
"channel.clearKey": "清除密钥",
|
|
158
|
+
"channel.customSettings": "自定义设置",
|
|
159
|
+
"channel.modelsTitle": "模型 / 音色目录",
|
|
160
|
+
"channel.modelsCount": "{n} 个模型/音色",
|
|
161
|
+
"channel.modelsNone": "未添加",
|
|
162
|
+
"channel.modelsEmpty": "尚未添加模型/音色:面板与 Agent 将无可选模型;保存后仍可直接输入目录外的 ID 进行生成。",
|
|
163
|
+
"channel.modelAlias": "显示名称",
|
|
164
|
+
"channel.modelId": "上游 ID",
|
|
165
|
+
"channel.modelCategory": "分类",
|
|
166
|
+
"channel.category.auto": "自动",
|
|
167
|
+
"channel.category.tts": "语音",
|
|
168
|
+
"channel.category.music": "音乐",
|
|
169
|
+
"channel.category.sfx": "音效",
|
|
170
|
+
"channel.category.voice_design": "音色设计",
|
|
171
|
+
"channel.category.voice_clone": "音色克隆",
|
|
172
|
+
"channel.addModel": "添加模型",
|
|
173
|
+
"channel.removeModel": "移除",
|
|
174
|
+
"channel.fetchModels": "获取可用模型",
|
|
175
|
+
"channel.fetchingModels": "获取中…",
|
|
176
|
+
"channel.discoverNeedsUrlKey": "填写 API 地址与密钥后可获取模型",
|
|
177
|
+
"channel.fetchEmpty": "未发现音频相关模型。",
|
|
178
|
+
"channel.discoverSource": "来源:{source}",
|
|
179
|
+
"channel.candidates": "发现 {n} 个可用模型/音色",
|
|
180
|
+
"channel.selectAll": "全选",
|
|
181
|
+
"channel.clearSelection": "清空",
|
|
182
|
+
"channel.adoptSelected": "添加所选({n})",
|
|
183
|
+
"channel.default": "设为默认渠道",
|
|
148
184
|
"channel.cancel": "取消",
|
|
149
|
-
"channel.save": "保存渠道"
|
|
150
|
-
"presets.title": "预置厂商",
|
|
151
|
-
"presets.custom": "自定义渠道"
|
|
185
|
+
"channel.save": "保存渠道"
|
|
152
186
|
};
|
|
153
187
|
const en = {
|
|
154
188
|
"entry.label": "AI Audio",
|
|
@@ -189,8 +223,10 @@ window.__ModuleLoader__.load({
|
|
|
189
223
|
"channels.title": "Audio channels",
|
|
190
224
|
"channels.hint": "Each channel is an independent audio vendor/API endpoint.",
|
|
191
225
|
"channels.empty": "No channels yet.",
|
|
192
|
-
"channels.addProvider": "+ Add
|
|
193
|
-
"channels.
|
|
226
|
+
"channels.addProvider": "+ Add provider",
|
|
227
|
+
"channels.addProviderLoading": "Loading providers…",
|
|
228
|
+
"channels.addProviderFailed": "Failed to load the provider catalog. Click to retry.",
|
|
229
|
+
"channels.addCustom": "+ Add custom provider",
|
|
194
230
|
"channels.edit": "Edit",
|
|
195
231
|
"channels.delete": "Delete",
|
|
196
232
|
"channels.confirm": "Confirm delete",
|
|
@@ -202,17 +238,49 @@ window.__ModuleLoader__.load({
|
|
|
202
238
|
"channels.statusReady": "Ready",
|
|
203
239
|
"channels.statusIncomplete": "Incomplete",
|
|
204
240
|
"channels.untitled": "Untitled channel",
|
|
241
|
+
"channel.title": "Channel settings",
|
|
242
|
+
"channel.editTitle": "Edit channel",
|
|
243
|
+
"channel.provider": "Provider",
|
|
244
|
+
"channel.providerCustom": "Custom provider",
|
|
245
|
+
"channel.providerCustomHint": "Any OpenAI-compatible TTS or generic audio POST endpoint",
|
|
246
|
+
"channel.site": "Website",
|
|
205
247
|
"channel.name": "Name",
|
|
248
|
+
"channel.namePlaceholder": "Channel name (e.g. MiniMax main)",
|
|
206
249
|
"channel.apiUrl": "API URL",
|
|
250
|
+
"channel.apiUrlPlaceholder": "Provider default",
|
|
251
|
+
"channel.apiUrlHint": "Leave blank to use the provider default.",
|
|
207
252
|
"channel.apiKey": "API key",
|
|
208
|
-
"channel.apiKeyHint": "
|
|
209
|
-
"channel.
|
|
210
|
-
"channel.
|
|
211
|
-
"channel.
|
|
253
|
+
"channel.apiKeyHint": "Enter the API key to use this channel.",
|
|
254
|
+
"channel.apiKeyStoredHint": "A key is stored; leave blank to keep it, or enter a new one.",
|
|
255
|
+
"channel.clearKey": "Clear key",
|
|
256
|
+
"channel.customSettings": "Custom settings",
|
|
257
|
+
"channel.modelsTitle": "Model / voice catalog",
|
|
258
|
+
"channel.modelsCount": "{n} model(s)/voice(s)",
|
|
259
|
+
"channel.modelsNone": "None",
|
|
260
|
+
"channel.modelsEmpty": "No models yet: the panel and agents will have nothing to pick. You can still send an ID outside the catalog after saving.",
|
|
261
|
+
"channel.modelAlias": "Display name",
|
|
262
|
+
"channel.modelId": "Upstream ID",
|
|
263
|
+
"channel.modelCategory": "Category",
|
|
264
|
+
"channel.category.auto": "Auto",
|
|
265
|
+
"channel.category.tts": "Speech",
|
|
266
|
+
"channel.category.music": "Music",
|
|
267
|
+
"channel.category.sfx": "SFX",
|
|
268
|
+
"channel.category.voice_design": "Voice design",
|
|
269
|
+
"channel.category.voice_clone": "Voice clone",
|
|
270
|
+
"channel.addModel": "Add model",
|
|
271
|
+
"channel.removeModel": "Remove",
|
|
272
|
+
"channel.fetchModels": "Fetch available models",
|
|
273
|
+
"channel.fetchingModels": "Fetching…",
|
|
274
|
+
"channel.discoverNeedsUrlKey": "Fill in the API URL and key to fetch models",
|
|
275
|
+
"channel.fetchEmpty": "No audio-related models found.",
|
|
276
|
+
"channel.discoverSource": "Source: {source}",
|
|
277
|
+
"channel.candidates": "{n} available model(s)/voice(s) found",
|
|
278
|
+
"channel.selectAll": "Select all",
|
|
279
|
+
"channel.clearSelection": "Clear",
|
|
280
|
+
"channel.adoptSelected": "Add selected ({n})",
|
|
281
|
+
"channel.default": "Set as default channel",
|
|
212
282
|
"channel.cancel": "Cancel",
|
|
213
|
-
"channel.save": "Save channel"
|
|
214
|
-
"presets.title": "Preset vendors",
|
|
215
|
-
"presets.custom": "Custom channel"
|
|
283
|
+
"channel.save": "Save channel"
|
|
216
284
|
};
|
|
217
285
|
//#endregion
|
|
218
286
|
//#region src/client/helpers.ts
|
|
@@ -464,7 +532,7 @@ window.__ModuleLoader__.load({
|
|
|
464
532
|
}
|
|
465
533
|
//#endregion
|
|
466
534
|
//#region \0dsh-css:/Users/shimingming/Projects_code/dsh-audiogen/src/client/audio-panel.module.css.mjs
|
|
467
|
-
const css$3 = ".Oo1fpq_panel{background:var(--dsw-alias-bg-base,#f7f7f8);height:100%;color:var(--dsw-alias-label-primary,#1f2328);font-family:var(--dsw-font-family,system-ui, sans-serif);flex-direction:column;gap:12px;padding:14px 16px;display:flex;overflow:hidden}.Oo1fpq_header{justify-content:space-between;align-items:center;display:flex}.Oo1fpq_title{margin:0;font-size:16px;font-weight:700}.Oo1fpq_layout{flex:1;gap:14px;min-height:0;display:flex}.Oo1fpq_form{flex-direction:column;flex:none;gap:12px;width:300px;min-width:260px;max-width:340px;display:flex;overflow-y:auto}.Oo1fpq_result{border:1px solid var(--dsw-alias-border-l1,#e5e7eb);background:var(--dsw-alias-bg-layer-1,#fff);border-radius:12px;flex-direction:column;flex:1;min-width:0;padding:14px;display:flex;overflow-y:auto}.Oo1fpq_label{color:var(--dsw-alias-label-secondary,#6b7280);flex-direction:column;gap:5px;font-size:12px;font-weight:600;display:flex}.Oo1fpq_textarea,.Oo1fpq_input,.Oo1fpq_select{border:1px solid var(--dsw-alias-border-l2,#d1d5db);background:var(--dsw-alias-bg-layer-3,#fff);width:100%;min-height:36px;color:var(--dsw-alias-label-primary,#1f2328);font:inherit;border-radius:8px;outline:none;padding:7px 10px;font-size:13px}.Oo1fpq_textarea{resize:vertical;min-height:110px}.Oo1fpq_modeRow{gap:6px;display:flex}.Oo1fpq_modeButton{border:1px solid var(--dsw-alias-border-l2,#d1d5db);font:inherit;cursor:pointer;background:0 0;border-radius:8px;flex:1;padding:7px 8px;font-size:12px}.Oo1fpq_modeButton[data-active=true]{border-color:var(--dsw-alias-brand-primary,#2563eb);color:var(--dsw-alias-brand-primary,#2563eb);font-weight:600}.Oo1fpq_generate{background:var(--dsw-alias-label-primary,#1f2328);color:var(--dsw-alias-bg-layer-3,#fff);font:inherit;cursor:pointer;border:0;border-radius:10px;padding:9px 14px;font-size:13px}.Oo1fpq_generate:disabled{opacity:.5;cursor:default}.Oo1fpq_empty,.Oo1fpq_error,.Oo1fpq_hint{color:var(--dsw-alias-label-secondary,#6b7280);font-size:13px}.Oo1fpq_error{color:#b91c1c}.Oo1fpq_audioList{gap:10px;margin-top:8px;display:grid}.Oo1fpq_audioCard{border:1px solid var(--dsw-alias-border-l2,#e5e7eb);border-radius:10px;flex-direction:column;gap:6px;padding:10px;display:flex}.Oo1fpq_audio{width:100%;height:36px}.Oo1fpq_download{color:#2563eb;font-size:12px;text-decoration:none}.Oo1fpq_history{border-left:1px solid var(--dsw-alias-border-l1,#e5e7eb);flex:none;width:260px;padding-left:12px;overflow-y:auto}.Oo1fpq_historyTitle{font-size:13px;font-weight:700}.Oo1fpq_historyEmpty{color:var(--dsw-alias-label-tertiary,#9ca3af);font-size:12px}.Oo1fpq_historyItem{border-bottom:1px solid var(--dsw-alias-border-l1,#e5e7eb);padding:8px 0}.Oo1fpq_historyPrompt{text-overflow:ellipsis;white-space:nowrap;font-size:12px;overflow:hidden}.Oo1fpq_historyMeta{color:var(--dsw-alias-label-tertiary,#9ca3af);font-size:11px}.Oo1fpq_historyAudio{width:100%;height:30px;margin-top:4px}";
|
|
535
|
+
const css$3 = ".Oo1fpq_panel{background:var(--dsw-alias-bg-base,#f7f7f8);height:100%;color:var(--dsw-alias-label-primary,#1f2328);font-family:var(--dsw-font-family,system-ui, sans-serif);flex-direction:column;gap:12px;padding:14px 16px;display:flex;overflow:hidden}.Oo1fpq_header{justify-content:space-between;align-items:center;display:flex}.Oo1fpq_title{margin:0;font-size:16px;font-weight:700}.Oo1fpq_layout{flex:1;gap:14px;min-height:0;display:flex}.Oo1fpq_form{flex-direction:column;flex:none;gap:12px;width:300px;min-width:260px;max-width:340px;display:flex;overflow-y:auto}.Oo1fpq_result{border:1px solid var(--dsw-alias-border-l1,#e5e7eb);background:var(--dsw-alias-bg-layer-1,#fff);border-radius:12px;flex-direction:column;flex:1;min-width:0;padding:14px;display:flex;overflow-y:auto}.Oo1fpq_label{color:var(--dsw-alias-label-secondary,#6b7280);flex-direction:column;gap:5px;font-size:12px;font-weight:600;display:flex}.Oo1fpq_textarea,.Oo1fpq_input,.Oo1fpq_select{border:1px solid var(--dsw-alias-border-l2,#d1d5db);background:var(--dsw-alias-bg-layer-3,#fff);width:100%;min-height:36px;color:var(--dsw-alias-label-primary,#1f2328);font:inherit;border-radius:8px;outline:none;padding:7px 10px;font-size:13px}.Oo1fpq_textarea{resize:vertical;min-height:110px}.Oo1fpq_modeRow{gap:6px;display:flex}.Oo1fpq_modeButton{border:1px solid var(--dsw-alias-border-l2,#d1d5db);font:inherit;cursor:pointer;background:0 0;border-radius:8px;flex:1;padding:7px 8px;font-size:12px}.Oo1fpq_modeButton[data-active=true]{border-color:var(--dsw-alias-brand-primary,#2563eb);color:var(--dsw-alias-brand-primary,#2563eb);font-weight:600}.Oo1fpq_generate{background:var(--dsw-alias-label-primary,#1f2328);color:var(--dsw-alias-bg-layer-3,#fff);font:inherit;cursor:pointer;border:0;border-radius:10px;padding:9px 14px;font-size:13px}.Oo1fpq_generate:disabled{opacity:.5;cursor:default}.Oo1fpq_empty,.Oo1fpq_error,.Oo1fpq_hint{color:var(--dsw-alias-label-secondary,#6b7280);font-size:13px}.Oo1fpq_error{color:#b91c1c}.Oo1fpq_audioList{gap:10px;margin-top:8px;display:grid}.Oo1fpq_audioCard{border:1px solid var(--dsw-alias-border-l2,#e5e7eb);border-radius:10px;flex-direction:column;gap:6px;padding:10px;display:flex}.Oo1fpq_audio{width:100%;height:36px}.Oo1fpq_download{color:#2563eb;font-size:12px;text-decoration:none}.Oo1fpq_history{border-left:1px solid var(--dsw-alias-border-l1,#e5e7eb);flex:none;width:260px;padding-left:12px;overflow-y:auto}.Oo1fpq_historyTitle{font-size:13px;font-weight:700}.Oo1fpq_historyEmpty{color:var(--dsw-alias-label-tertiary,#9ca3af);font-size:12px}.Oo1fpq_historyItem{border-bottom:1px solid var(--dsw-alias-border-l1,#e5e7eb);padding:8px 0}.Oo1fpq_historyPrompt{text-overflow:ellipsis;white-space:nowrap;font-size:12px;overflow:hidden}.Oo1fpq_historyMeta{color:var(--dsw-alias-label-tertiary,#9ca3af);font-size:11px}.Oo1fpq_historyAudio{width:100%;height:30px;margin-top:4px}.Oo1fpq_advanced{border:1px dashed var(--dsw-alias-border-l2,#d1d5db);border-radius:8px;flex-direction:column;gap:8px;padding:8px 10px;display:flex}.Oo1fpq_advanced summary{cursor:pointer;color:var(--dsw-alias-label-secondary,#6b7280);font-size:12px;font-weight:600}.Oo1fpq_row{align-items:flex-end;gap:8px;display:flex}.Oo1fpq_row .Oo1fpq_label{flex:1}.Oo1fpq_checkbox{color:var(--dsw-alias-label-secondary,#6b7280);cursor:pointer;align-items:center;gap:6px;font-size:12px;font-weight:600;display:flex}";
|
|
468
536
|
const tagId$3 = "dsh-audiogen/audio-panel.module.css";
|
|
469
537
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$3) + "]") === null) {
|
|
470
538
|
const tag = document.createElement("style");
|
|
@@ -474,33 +542,36 @@ window.__ModuleLoader__.load({
|
|
|
474
542
|
document.head.appendChild(tag);
|
|
475
543
|
}
|
|
476
544
|
var audio_panel_module_css_default = {
|
|
545
|
+
"modeRow": "Oo1fpq_modeRow",
|
|
546
|
+
"result": "Oo1fpq_result",
|
|
477
547
|
"label": "Oo1fpq_label",
|
|
478
|
-
"
|
|
548
|
+
"header": "Oo1fpq_header",
|
|
479
549
|
"panel": "Oo1fpq_panel",
|
|
480
|
-
"
|
|
481
|
-
"
|
|
550
|
+
"title": "Oo1fpq_title",
|
|
551
|
+
"textarea": "Oo1fpq_textarea",
|
|
552
|
+
"select": "Oo1fpq_select",
|
|
553
|
+
"history": "Oo1fpq_history",
|
|
482
554
|
"historyEmpty": "Oo1fpq_historyEmpty",
|
|
483
|
-
"
|
|
484
|
-
"
|
|
485
|
-
"
|
|
555
|
+
"historyTitle": "Oo1fpq_historyTitle",
|
|
556
|
+
"advanced": "Oo1fpq_advanced",
|
|
557
|
+
"input": "Oo1fpq_input",
|
|
486
558
|
"error": "Oo1fpq_error",
|
|
487
|
-
"download": "Oo1fpq_download",
|
|
488
|
-
"result": "Oo1fpq_result",
|
|
489
|
-
"layout": "Oo1fpq_layout",
|
|
490
|
-
"history": "Oo1fpq_history",
|
|
491
559
|
"historyItem": "Oo1fpq_historyItem",
|
|
492
|
-
"
|
|
560
|
+
"audio": "Oo1fpq_audio",
|
|
561
|
+
"generate": "Oo1fpq_generate",
|
|
562
|
+
"row": "Oo1fpq_row",
|
|
563
|
+
"download": "Oo1fpq_download",
|
|
564
|
+
"checkbox": "Oo1fpq_checkbox",
|
|
565
|
+
"historyPrompt": "Oo1fpq_historyPrompt",
|
|
566
|
+
"audioList": "Oo1fpq_audioList",
|
|
493
567
|
"modeButton": "Oo1fpq_modeButton",
|
|
494
|
-
"historyAudio": "Oo1fpq_historyAudio",
|
|
495
|
-
"header": "Oo1fpq_header",
|
|
496
|
-
"textarea": "Oo1fpq_textarea",
|
|
497
|
-
"form": "Oo1fpq_form",
|
|
498
|
-
"title": "Oo1fpq_title",
|
|
499
568
|
"audioCard": "Oo1fpq_audioCard",
|
|
500
569
|
"empty": "Oo1fpq_empty",
|
|
501
|
-
"
|
|
502
|
-
"
|
|
503
|
-
"
|
|
570
|
+
"form": "Oo1fpq_form",
|
|
571
|
+
"hint": "Oo1fpq_hint",
|
|
572
|
+
"historyMeta": "Oo1fpq_historyMeta",
|
|
573
|
+
"historyAudio": "Oo1fpq_historyAudio",
|
|
574
|
+
"layout": "Oo1fpq_layout"
|
|
504
575
|
};
|
|
505
576
|
//#endregion
|
|
506
577
|
//#region src/client/AudioGenPanel.tsx
|
|
@@ -556,11 +627,25 @@ window.__ModuleLoader__.load({
|
|
|
556
627
|
const [voice, setVoice] = (0, react.useState)("");
|
|
557
628
|
const [speed, setSpeed] = (0, react.useState)("");
|
|
558
629
|
const [duration, setDuration] = (0, react.useState)("");
|
|
630
|
+
const [lyrics, setLyrics] = (0, react.useState)("");
|
|
631
|
+
const [instrumental, setInstrumental] = (0, react.useState)(false);
|
|
559
632
|
const [format, setFormat] = (0, react.useState)("mp3");
|
|
633
|
+
const [emotion, setEmotion] = (0, react.useState)("");
|
|
634
|
+
const [vol, setVol] = (0, react.useState)("");
|
|
635
|
+
const [pitch, setPitch] = (0, react.useState)("");
|
|
636
|
+
const [toneText, setToneText] = (0, react.useState)("");
|
|
637
|
+
const [sampleRate, setSampleRate] = (0, react.useState)("");
|
|
638
|
+
const [bitrate, setBitrate] = (0, react.useState)("");
|
|
639
|
+
const [audioChannel, setAudioChannel] = (0, react.useState)("");
|
|
640
|
+
const [subtitle, setSubtitle] = (0, react.useState)(false);
|
|
560
641
|
const [loading, setLoading] = (0, react.useState)(false);
|
|
561
642
|
const [error, setError] = (0, react.useState)(null);
|
|
562
643
|
const [outputs, setOutputs] = (0, react.useState)([]);
|
|
563
644
|
const { entries, reload, clear } = useHistory();
|
|
645
|
+
const isMiniMaxChannel = (0, react.useMemo)(() => {
|
|
646
|
+
const target = channels.find((candidate) => candidate.id === modelOptions.defaultChannelId) ?? channels[0];
|
|
647
|
+
return target !== void 0 && (target.preset === "minimax" || /minimax/i.test(target.apiUrl));
|
|
648
|
+
}, [channels, modelOptions.defaultChannelId]);
|
|
564
649
|
const visibleModels = (0, react.useMemo)(() => {
|
|
565
650
|
if (mode === "voice_design") return [];
|
|
566
651
|
return modelOptions.models.filter((entry) => entry.category === void 0 || entry.category === "tts" && mode === "tts" || entry.category === mode).map((entry) => entry.alias);
|
|
@@ -584,7 +669,17 @@ window.__ModuleLoader__.load({
|
|
|
584
669
|
...voice.trim() !== "" ? { voice: voice.trim() } : {},
|
|
585
670
|
...speed.trim() !== "" ? { speed: Number(speed) } : {},
|
|
586
671
|
...duration.trim() !== "" ? { duration: Number(duration) } : {},
|
|
587
|
-
...
|
|
672
|
+
...lyrics.trim() !== "" ? { lyrics: lyrics.trim() } : {},
|
|
673
|
+
...instrumental ? { isInstrumental: true } : {},
|
|
674
|
+
...format.trim() !== "" ? { format: format.trim() } : {},
|
|
675
|
+
...emotion.trim() !== "" ? { emotion: emotion.trim() } : {},
|
|
676
|
+
...vol.trim() !== "" ? { vol: Number(vol) } : {},
|
|
677
|
+
...pitch.trim() !== "" ? { pitch: Number(pitch) } : {},
|
|
678
|
+
...toneText.trim() !== "" ? { pronunciationTone: toneText.split("\n").map((item) => item.trim()).filter((item) => item !== "") } : {},
|
|
679
|
+
...sampleRate.trim() !== "" ? { sampleRate: Number(sampleRate) } : {},
|
|
680
|
+
...bitrate.trim() !== "" ? { bitrate: Number(bitrate) } : {},
|
|
681
|
+
...audioChannel.trim() !== "" ? { audioChannel: Number(audioChannel) } : {},
|
|
682
|
+
...subtitle ? { subtitleEnable: true } : {}
|
|
588
683
|
});
|
|
589
684
|
if (!response.ok) {
|
|
590
685
|
setError(response.message ?? "生成失败");
|
|
@@ -676,7 +771,7 @@ window.__ModuleLoader__.load({
|
|
|
676
771
|
className: audio_panel_module_css_default.input,
|
|
677
772
|
value: voice,
|
|
678
773
|
onChange: (event) => setVoice(event.target.value),
|
|
679
|
-
placeholder: "alloy / 自定义音色"
|
|
774
|
+
placeholder: isMiniMaxChannel ? "male-qn-qingse / female-shaonv" : "alloy / 自定义音色"
|
|
680
775
|
})]
|
|
681
776
|
}) : null,
|
|
682
777
|
mode === "tts" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
@@ -692,6 +787,118 @@ window.__ModuleLoader__.load({
|
|
|
692
787
|
placeholder: "1.0"
|
|
693
788
|
})]
|
|
694
789
|
}) : null,
|
|
790
|
+
mode === "tts" && isMiniMaxChannel ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
|
|
791
|
+
className: audio_panel_module_css_default.advanced,
|
|
792
|
+
children: [
|
|
793
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", { children: "MiniMax 高级参数" }),
|
|
794
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
795
|
+
className: audio_panel_module_css_default.label,
|
|
796
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: "情绪 emotion" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
797
|
+
className: audio_panel_module_css_default.input,
|
|
798
|
+
value: emotion,
|
|
799
|
+
onChange: (event) => setEmotion(event.target.value),
|
|
800
|
+
placeholder: "happy / sad / angry / nervous…"
|
|
801
|
+
})]
|
|
802
|
+
}),
|
|
803
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
804
|
+
className: audio_panel_module_css_default.row,
|
|
805
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
806
|
+
className: audio_panel_module_css_default.label,
|
|
807
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: "音量 vol (0-10)" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
808
|
+
className: audio_panel_module_css_default.input,
|
|
809
|
+
type: "number",
|
|
810
|
+
min: "0",
|
|
811
|
+
max: "10",
|
|
812
|
+
step: "0.5",
|
|
813
|
+
value: vol,
|
|
814
|
+
onChange: (event) => setVol(event.target.value),
|
|
815
|
+
placeholder: "1"
|
|
816
|
+
})]
|
|
817
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
818
|
+
className: audio_panel_module_css_default.label,
|
|
819
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: "音调 pitch (-12~12)" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
820
|
+
className: audio_panel_module_css_default.input,
|
|
821
|
+
type: "number",
|
|
822
|
+
min: "-12",
|
|
823
|
+
max: "12",
|
|
824
|
+
value: pitch,
|
|
825
|
+
onChange: (event) => setPitch(event.target.value),
|
|
826
|
+
placeholder: "0"
|
|
827
|
+
})]
|
|
828
|
+
})]
|
|
829
|
+
}),
|
|
830
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
831
|
+
className: audio_panel_module_css_default.row,
|
|
832
|
+
children: [
|
|
833
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
834
|
+
className: audio_panel_module_css_default.label,
|
|
835
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: "采样率" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
836
|
+
className: audio_panel_module_css_default.input,
|
|
837
|
+
type: "number",
|
|
838
|
+
min: "16000",
|
|
839
|
+
max: "48000",
|
|
840
|
+
step: "8000",
|
|
841
|
+
value: sampleRate,
|
|
842
|
+
onChange: (event) => setSampleRate(event.target.value),
|
|
843
|
+
placeholder: "32000"
|
|
844
|
+
})]
|
|
845
|
+
}),
|
|
846
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
847
|
+
className: audio_panel_module_css_default.label,
|
|
848
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: "码率 bps" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
849
|
+
className: audio_panel_module_css_default.input,
|
|
850
|
+
type: "number",
|
|
851
|
+
min: "64000",
|
|
852
|
+
max: "320000",
|
|
853
|
+
step: "8000",
|
|
854
|
+
value: bitrate,
|
|
855
|
+
onChange: (event) => setBitrate(event.target.value),
|
|
856
|
+
placeholder: "128000"
|
|
857
|
+
})]
|
|
858
|
+
}),
|
|
859
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
860
|
+
className: audio_panel_module_css_default.label,
|
|
861
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: "声道" }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
862
|
+
className: audio_panel_module_css_default.select,
|
|
863
|
+
value: audioChannel,
|
|
864
|
+
onChange: (event) => setAudioChannel(event.target.value),
|
|
865
|
+
children: [
|
|
866
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
867
|
+
value: "",
|
|
868
|
+
children: "默认(1)"
|
|
869
|
+
}),
|
|
870
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
871
|
+
value: "1",
|
|
872
|
+
children: "1"
|
|
873
|
+
}),
|
|
874
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
875
|
+
value: "2",
|
|
876
|
+
children: "2"
|
|
877
|
+
})
|
|
878
|
+
]
|
|
879
|
+
})]
|
|
880
|
+
})
|
|
881
|
+
]
|
|
882
|
+
}),
|
|
883
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
884
|
+
className: audio_panel_module_css_default.label,
|
|
885
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: "发音词典(每行一条:\"文字/读音\")" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
|
|
886
|
+
className: audio_panel_module_css_default.textarea,
|
|
887
|
+
value: toneText,
|
|
888
|
+
onChange: (event) => setToneText(event.target.value),
|
|
889
|
+
placeholder: "处理/(chu3)(li3)\n危险/dangerous"
|
|
890
|
+
})]
|
|
891
|
+
}),
|
|
892
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
893
|
+
className: audio_panel_module_css_default.checkbox,
|
|
894
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
895
|
+
type: "checkbox",
|
|
896
|
+
checked: subtitle,
|
|
897
|
+
onChange: (event) => setSubtitle(event.target.checked)
|
|
898
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: "生成字幕 subtitle_enable" })]
|
|
899
|
+
})
|
|
900
|
+
]
|
|
901
|
+
}) : null,
|
|
695
902
|
mode === "music" || mode === "sfx" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
696
903
|
className: audio_panel_module_css_default.label,
|
|
697
904
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: tt("duration.label") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
@@ -705,6 +912,22 @@ window.__ModuleLoader__.load({
|
|
|
705
912
|
placeholder: "30"
|
|
706
913
|
})]
|
|
707
914
|
}) : null,
|
|
915
|
+
mode === "music" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
916
|
+
className: audio_panel_module_css_default.label,
|
|
917
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: "歌词(纯音乐模式可留空;多段用空行分隔)" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
|
|
918
|
+
className: audio_panel_module_css_default.textarea,
|
|
919
|
+
value: lyrics,
|
|
920
|
+
onChange: (event) => setLyrics(event.target.value),
|
|
921
|
+
placeholder: "第一段歌词…\n\n第二段歌词…"
|
|
922
|
+
})]
|
|
923
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
924
|
+
className: audio_panel_module_css_default.checkbox,
|
|
925
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
926
|
+
type: "checkbox",
|
|
927
|
+
checked: instrumental,
|
|
928
|
+
onChange: (event) => setInstrumental(event.target.checked)
|
|
929
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: "纯音乐(无歌词/人声)is_instrumental" })]
|
|
930
|
+
})] }) : null,
|
|
708
931
|
needModel ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
709
932
|
className: audio_panel_module_css_default.label,
|
|
710
933
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: tt("format.label") }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
@@ -720,14 +943,13 @@ window.__ModuleLoader__.load({
|
|
|
720
943
|
value: "wav",
|
|
721
944
|
children: "wav"
|
|
722
945
|
}),
|
|
723
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
946
|
+
mode === "tts" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
724
947
|
value: "flac",
|
|
725
948
|
children: "flac"
|
|
726
|
-
}),
|
|
727
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
949
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
728
950
|
value: "ogg",
|
|
729
951
|
children: "ogg"
|
|
730
|
-
}),
|
|
952
|
+
})] }) : null,
|
|
731
953
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
732
954
|
value: "pcm",
|
|
733
955
|
children: "pcm"
|
|
@@ -847,167 +1069,167 @@ window.__ModuleLoader__.load({
|
|
|
847
1069
|
document.head.appendChild(tag);
|
|
848
1070
|
}
|
|
849
1071
|
var panel_module_css_default = {
|
|
850
|
-
"referenceActions": "rwa6qG_referenceActions",
|
|
851
|
-
"taskRows": "rwa6qG_taskRows",
|
|
852
|
-
"canvasError": "rwa6qG_canvasError",
|
|
853
|
-
"galleryRatioList": "rwa6qG_galleryRatioList",
|
|
854
|
-
"historyTitle": "rwa6qG_historyTitle",
|
|
855
|
-
"studio": "rwa6qG_studio",
|
|
856
|
-
"taskRow": "rwa6qG_taskRow",
|
|
857
1072
|
"templatesButton": "rwa6qG_templatesButton",
|
|
1073
|
+
"historyThumbPlaceholder": "rwa6qG_historyThumbPlaceholder",
|
|
1074
|
+
"modePill": "rwa6qG_modePill",
|
|
858
1075
|
"gallerySearch": "rwa6qG_gallerySearch",
|
|
859
|
-
"
|
|
860
|
-
"
|
|
861
|
-
"
|
|
862
|
-
"
|
|
1076
|
+
"historyList": "rwa6qG_historyList",
|
|
1077
|
+
"uploadBox": "rwa6qG_uploadBox",
|
|
1078
|
+
"lightbox": "rwa6qG_lightbox",
|
|
1079
|
+
"historySearch": "rwa6qG_historySearch",
|
|
1080
|
+
"modelWrap": "rwa6qG_modelWrap",
|
|
1081
|
+
"taskTrayClose": "rwa6qG_taskTrayClose",
|
|
1082
|
+
"uploadHint": "rwa6qG_uploadHint",
|
|
1083
|
+
"canvasEmptyIcon": "rwa6qG_canvasEmptyIcon",
|
|
1084
|
+
"generateButton": "rwa6qG_generateButton",
|
|
1085
|
+
"comparisonImageButton": "rwa6qG_comparisonImageButton",
|
|
1086
|
+
"galleryWorkspace": "rwa6qG_galleryWorkspace",
|
|
1087
|
+
"image": "rwa6qG_image",
|
|
1088
|
+
"galleryFilterDivider": "rwa6qG_galleryFilterDivider",
|
|
863
1089
|
"panelHeading": "rwa6qG_panelHeading",
|
|
1090
|
+
"historyAction": "rwa6qG_historyAction",
|
|
1091
|
+
"lightboxActions": "rwa6qG_lightboxActions",
|
|
1092
|
+
"canvasStateHint": "rwa6qG_canvasStateHint",
|
|
1093
|
+
"galleryCardFooter": "rwa6qG_galleryCardFooter",
|
|
1094
|
+
"paramLabel": "rwa6qG_paramLabel",
|
|
864
1095
|
"historyClear": "rwa6qG_historyClear",
|
|
865
|
-
"
|
|
866
|
-
"modePill": "rwa6qG_modePill",
|
|
867
|
-
"historyInfo": "rwa6qG_historyInfo",
|
|
868
|
-
"canvasState": "rwa6qG_canvasState",
|
|
1096
|
+
"hiddenFile": "rwa6qG_hiddenFile",
|
|
869
1097
|
"canvasStateTitle": "rwa6qG_canvasStateTitle",
|
|
870
|
-
"
|
|
871
|
-
"
|
|
872
|
-
"
|
|
1098
|
+
"canvasError": "rwa6qG_canvasError",
|
|
1099
|
+
"galleryRatioList": "rwa6qG_galleryRatioList",
|
|
1100
|
+
"download": "rwa6qG_download",
|
|
1101
|
+
"paramHint": "rwa6qG_paramHint",
|
|
1102
|
+
"compareControl": "rwa6qG_compareControl",
|
|
1103
|
+
"connectionStatus": "rwa6qG_connectionStatus",
|
|
1104
|
+
"promptCount": "rwa6qG_promptCount",
|
|
1105
|
+
"taskTrayHeader": "rwa6qG_taskTrayHeader",
|
|
1106
|
+
"historyActions": "rwa6qG_historyActions",
|
|
1107
|
+
"canvasBody": "rwa6qG_canvasBody",
|
|
1108
|
+
"historyMain": "rwa6qG_historyMain",
|
|
1109
|
+
"lightboxStage": "rwa6qG_lightboxStage",
|
|
1110
|
+
"imageCaption": "rwa6qG_imageCaption",
|
|
1111
|
+
"gallerySelectionBar": "rwa6qG_gallerySelectionBar",
|
|
1112
|
+
"historyHeader": "rwa6qG_historyHeader",
|
|
873
1113
|
"modelMenuItem": "rwa6qG_modelMenuItem",
|
|
874
|
-
"galleryRatio": "rwa6qG_galleryRatio",
|
|
875
|
-
"galleryTagFilterList": "rwa6qG_galleryTagFilterList",
|
|
876
|
-
"comparisonImageButton": "rwa6qG_comparisonImageButton",
|
|
877
1114
|
"comparisonFullscreenGrid": "rwa6qG_comparisonFullscreenGrid",
|
|
878
|
-
"
|
|
879
|
-
"
|
|
880
|
-
"gallerySelect": "rwa6qG_gallerySelect",
|
|
1115
|
+
"modelLabel": "rwa6qG_modelLabel",
|
|
1116
|
+
"canvasState": "rwa6qG_canvasState",
|
|
881
1117
|
"galleryMasonry": "rwa6qG_galleryMasonry",
|
|
1118
|
+
"lightboxCaption": "rwa6qG_lightboxCaption",
|
|
1119
|
+
"lightboxNav": "rwa6qG_lightboxNav",
|
|
1120
|
+
"connectionDot": "rwa6qG_connectionDot",
|
|
1121
|
+
"galleryHeading": "rwa6qG_galleryHeading",
|
|
1122
|
+
"galleryTagEdit": "rwa6qG_galleryTagEdit",
|
|
1123
|
+
"taskTrayChevron": "rwa6qG_taskTrayChevron",
|
|
1124
|
+
"updateText": "rwa6qG_updateText",
|
|
1125
|
+
"comparisonFullscreen": "rwa6qG_comparisonFullscreen",
|
|
1126
|
+
"reference": "rwa6qG_reference",
|
|
1127
|
+
"historyItem": "rwa6qG_historyItem",
|
|
1128
|
+
"galleryImage": "rwa6qG_galleryImage",
|
|
1129
|
+
"galleryCard": "rwa6qG_galleryCard",
|
|
1130
|
+
"lightboxZoomLevel": "rwa6qG_lightboxZoomLevel",
|
|
1131
|
+
"canvas": "rwa6qG_canvas",
|
|
1132
|
+
"lightboxImage": "rwa6qG_lightboxImage",
|
|
1133
|
+
"galleryFilters": "rwa6qG_galleryFilters",
|
|
1134
|
+
"lightboxTools": "rwa6qG_lightboxTools",
|
|
1135
|
+
"generateInner": "rwa6qG_generateInner",
|
|
882
1136
|
"historyFilters": "rwa6qG_historyFilters",
|
|
883
|
-
"
|
|
884
|
-
"
|
|
885
|
-
"
|
|
886
|
-
"
|
|
1137
|
+
"historyTitle": "rwa6qG_historyTitle",
|
|
1138
|
+
"lightboxIndex": "rwa6qG_lightboxIndex",
|
|
1139
|
+
"galleryTagFilterList": "rwa6qG_galleryTagFilterList",
|
|
1140
|
+
"galleryFilterNote": "rwa6qG_galleryFilterNote",
|
|
1141
|
+
"gallerySelect": "rwa6qG_gallerySelect",
|
|
1142
|
+
"spinner": "rwa6qG_spinner",
|
|
1143
|
+
"entryLabel": "rwa6qG_entryLabel",
|
|
1144
|
+
"galleryTagInput": "rwa6qG_galleryTagInput",
|
|
1145
|
+
"lightboxTool": "rwa6qG_lightboxTool",
|
|
1146
|
+
"grid": "rwa6qG_grid",
|
|
1147
|
+
"galleryToolbarActions": "rwa6qG_galleryToolbarActions",
|
|
1148
|
+
"modelMenuList": "rwa6qG_modelMenuList",
|
|
1149
|
+
"dshImageGenSpin": "rwa6qG_dshImageGenSpin",
|
|
1150
|
+
"gallerySort": "rwa6qG_gallerySort",
|
|
1151
|
+
"entry": "rwa6qG_entry",
|
|
1152
|
+
"galleryFilter": "rwa6qG_galleryFilter",
|
|
1153
|
+
"view": "rwa6qG_view",
|
|
1154
|
+
"galleryClear": "rwa6qG_galleryClear",
|
|
1155
|
+
"compareModelChoices": "rwa6qG_compareModelChoices",
|
|
887
1156
|
"comparisonBoard": "rwa6qG_comparisonBoard",
|
|
888
|
-
"historyEmpty": "rwa6qG_historyEmpty",
|
|
889
|
-
"galleryTagFilter": "rwa6qG_galleryTagFilter",
|
|
890
|
-
"image": "rwa6qG_image",
|
|
891
|
-
"canvasStateHint": "rwa6qG_canvasStateHint",
|
|
892
|
-
"galleryAdd": "rwa6qG_galleryAdd",
|
|
893
|
-
"config": "rwa6qG_config",
|
|
894
|
-
"lightboxActions": "rwa6qG_lightboxActions",
|
|
895
1157
|
"galleryTags": "rwa6qG_galleryTags",
|
|
896
|
-
"
|
|
897
|
-
"
|
|
898
|
-
"
|
|
899
|
-
"
|
|
900
|
-
"
|
|
901
|
-
"
|
|
902
|
-
"
|
|
903
|
-
"
|
|
904
|
-
"
|
|
905
|
-
"
|
|
906
|
-
"
|
|
907
|
-
"
|
|
908
|
-
"compareControl": "rwa6qG_compareControl",
|
|
909
|
-
"imageCaption": "rwa6qG_imageCaption",
|
|
910
|
-
"promptCount": "rwa6qG_promptCount",
|
|
911
|
-
"lightboxStage": "rwa6qG_lightboxStage",
|
|
1158
|
+
"galleryBulkButton": "rwa6qG_galleryBulkButton",
|
|
1159
|
+
"historyInfo": "rwa6qG_historyInfo",
|
|
1160
|
+
"modelMenu": "rwa6qG_modelMenu",
|
|
1161
|
+
"galleryAdd": "rwa6qG_galleryAdd",
|
|
1162
|
+
"galleryToolbar": "rwa6qG_galleryToolbar",
|
|
1163
|
+
"lightboxCaptionRow": "rwa6qG_lightboxCaptionRow",
|
|
1164
|
+
"optionRow": "rwa6qG_optionRow",
|
|
1165
|
+
"taskStatus": "rwa6qG_taskStatus",
|
|
1166
|
+
"imageCard": "rwa6qG_imageCard",
|
|
1167
|
+
"lightboxFigure": "rwa6qG_lightboxFigure",
|
|
1168
|
+
"lightboxCopy": "rwa6qG_lightboxCopy",
|
|
1169
|
+
"referenceImage": "rwa6qG_referenceImage",
|
|
912
1170
|
"updateRelease": "rwa6qG_updateRelease",
|
|
1171
|
+
"panel": "rwa6qG_panel",
|
|
1172
|
+
"historyPrompt": "rwa6qG_historyPrompt",
|
|
913
1173
|
"lightboxDownload": "rwa6qG_lightboxDownload",
|
|
914
|
-
"gallerySelectMode": "rwa6qG_gallerySelectMode",
|
|
915
|
-
"compareToggle": "rwa6qG_compareToggle",
|
|
916
|
-
"grid": "rwa6qG_grid",
|
|
917
|
-
"zoomHint": "rwa6qG_zoomHint",
|
|
918
1174
|
"modelSelect": "rwa6qG_modelSelect",
|
|
919
|
-
"modelMenu": "rwa6qG_modelMenu",
|
|
920
|
-
"lightboxFigure": "rwa6qG_lightboxFigure",
|
|
921
|
-
"lightboxTools": "rwa6qG_lightboxTools",
|
|
922
|
-
"compareModelChoices": "rwa6qG_compareModelChoices",
|
|
923
|
-
"gallerySelectionClear": "rwa6qG_gallerySelectionClear",
|
|
924
|
-
"lightboxMeta": "rwa6qG_lightboxMeta",
|
|
925
|
-
"taskPrompt": "rwa6qG_taskPrompt",
|
|
926
|
-
"modelWrap": "rwa6qG_modelWrap",
|
|
927
|
-
"updateBanner": "rwa6qG_updateBanner",
|
|
928
1175
|
"configGuide": "rwa6qG_configGuide",
|
|
929
|
-
"
|
|
930
|
-
"
|
|
931
|
-
"
|
|
932
|
-
"
|
|
933
|
-
"
|
|
934
|
-
"lightboxClose": "rwa6qG_lightboxClose",
|
|
1176
|
+
"taskTray": "rwa6qG_taskTray",
|
|
1177
|
+
"taskRow": "rwa6qG_taskRow",
|
|
1178
|
+
"historyThumb": "rwa6qG_historyThumb",
|
|
1179
|
+
"gallerySelectMode": "rwa6qG_gallerySelectMode",
|
|
1180
|
+
"modeRow": "rwa6qG_modeRow",
|
|
935
1181
|
"entryIcon": "rwa6qG_entryIcon",
|
|
936
|
-
"
|
|
937
|
-
"
|
|
938
|
-
"
|
|
1182
|
+
"lightboxMeta": "rwa6qG_lightboxMeta",
|
|
1183
|
+
"config": "rwa6qG_config",
|
|
1184
|
+
"uploadIcon": "rwa6qG_uploadIcon",
|
|
1185
|
+
"galleryViewToggle": "rwa6qG_galleryViewToggle",
|
|
939
1186
|
"galleryAvatar": "rwa6qG_galleryAvatar",
|
|
940
|
-
"taskTrayChevron": "rwa6qG_taskTrayChevron",
|
|
941
|
-
"canvas": "rwa6qG_canvas",
|
|
942
|
-
"lightboxEdit": "rwa6qG_lightboxEdit",
|
|
943
1187
|
"taskTrayCount": "rwa6qG_taskTrayCount",
|
|
944
|
-
"
|
|
1188
|
+
"comparisonGrid": "rwa6qG_comparisonGrid",
|
|
1189
|
+
"card": "rwa6qG_card",
|
|
1190
|
+
"updateBanner": "rwa6qG_updateBanner",
|
|
1191
|
+
"galleryBadge": "rwa6qG_galleryBadge",
|
|
1192
|
+
"enhanceButton": "rwa6qG_enhanceButton",
|
|
1193
|
+
"galleryRemove": "rwa6qG_galleryRemove",
|
|
1194
|
+
"configScroll": "rwa6qG_configScroll",
|
|
1195
|
+
"panelHeader": "rwa6qG_panelHeader",
|
|
1196
|
+
"taskRows": "rwa6qG_taskRows",
|
|
945
1197
|
"galleryCardInfo": "rwa6qG_galleryCardInfo",
|
|
946
|
-
"imageCard": "rwa6qG_imageCard",
|
|
947
1198
|
"galleryCount": "rwa6qG_galleryCount",
|
|
948
|
-
"
|
|
949
|
-
"
|
|
950
|
-
"
|
|
951
|
-
"
|
|
952
|
-
"
|
|
953
|
-
"
|
|
954
|
-
"
|
|
955
|
-
"
|
|
956
|
-
"
|
|
957
|
-
"
|
|
958
|
-
"
|
|
959
|
-
"
|
|
960
|
-
"
|
|
961
|
-
"
|
|
962
|
-
"
|
|
963
|
-
"
|
|
964
|
-
"
|
|
965
|
-
"
|
|
966
|
-
"
|
|
967
|
-
"
|
|
968
|
-
"
|
|
969
|
-
"lightboxNav": "rwa6qG_lightboxNav",
|
|
1199
|
+
"updateActions": "rwa6qG_updateActions",
|
|
1200
|
+
"galleryToast": "rwa6qG_galleryToast",
|
|
1201
|
+
"paramGroup": "rwa6qG_paramGroup",
|
|
1202
|
+
"configGuideBody": "rwa6qG_configGuideBody",
|
|
1203
|
+
"optionPill": "rwa6qG_optionPill",
|
|
1204
|
+
"footer": "rwa6qG_footer",
|
|
1205
|
+
"galleryTagFilter": "rwa6qG_galleryTagFilter",
|
|
1206
|
+
"referenceActions": "rwa6qG_referenceActions",
|
|
1207
|
+
"historyEmpty": "rwa6qG_historyEmpty",
|
|
1208
|
+
"compareToggle": "rwa6qG_compareToggle",
|
|
1209
|
+
"zoomHint": "rwa6qG_zoomHint",
|
|
1210
|
+
"taskPrompt": "rwa6qG_taskPrompt",
|
|
1211
|
+
"historyMeta": "rwa6qG_historyMeta",
|
|
1212
|
+
"history": "rwa6qG_history",
|
|
1213
|
+
"canvasMeta": "rwa6qG_canvasMeta",
|
|
1214
|
+
"lightboxScaleFrame": "rwa6qG_lightboxScaleFrame",
|
|
1215
|
+
"dshImageGenToastIn": "rwa6qG_dshImageGenToastIn",
|
|
1216
|
+
"gallerySelectionClear": "rwa6qG_gallerySelectionClear",
|
|
1217
|
+
"promptFooter": "rwa6qG_promptFooter",
|
|
1218
|
+
"optionGrid": "rwa6qG_optionGrid",
|
|
1219
|
+
"bigSpinner": "rwa6qG_bigSpinner",
|
|
970
1220
|
"galleryFilterHeading": "rwa6qG_galleryFilterHeading",
|
|
971
|
-
"paramLabel": "rwa6qG_paramLabel",
|
|
972
|
-
"taskTrayClose": "rwa6qG_taskTrayClose",
|
|
973
|
-
"gallerySort": "rwa6qG_gallerySort",
|
|
974
|
-
"galleryTagEditor": "rwa6qG_galleryTagEditor",
|
|
975
|
-
"lightboxCaptionRow": "rwa6qG_lightboxCaptionRow",
|
|
976
|
-
"historyList": "rwa6qG_historyList",
|
|
977
|
-
"galleryTagInput": "rwa6qG_galleryTagInput",
|
|
978
|
-
"lightboxIndex": "rwa6qG_lightboxIndex",
|
|
979
|
-
"galleryFilterCount": "rwa6qG_galleryFilterCount",
|
|
980
|
-
"galleryFilterDivider": "rwa6qG_galleryFilterDivider",
|
|
981
|
-
"enhanceButton": "rwa6qG_enhanceButton",
|
|
982
|
-
"historyItem": "rwa6qG_historyItem",
|
|
983
|
-
"uploadHint": "rwa6qG_uploadHint",
|
|
984
|
-
"connectionStatus": "rwa6qG_connectionStatus",
|
|
985
|
-
"modeRow": "rwa6qG_modeRow",
|
|
986
|
-
"modelMenuList": "rwa6qG_modelMenuList",
|
|
987
|
-
"spinner": "rwa6qG_spinner",
|
|
988
|
-
"lightbox": "rwa6qG_lightbox",
|
|
989
1221
|
"githubLink": "rwa6qG_githubLink",
|
|
990
|
-
"
|
|
991
|
-
"
|
|
992
|
-
"
|
|
993
|
-
"
|
|
994
|
-
"bigSpinner": "rwa6qG_bigSpinner",
|
|
995
|
-
"optionGrid": "rwa6qG_optionGrid",
|
|
996
|
-
"taskStatus": "rwa6qG_taskStatus",
|
|
997
|
-
"configScroll": "rwa6qG_configScroll",
|
|
998
|
-
"gallerySelectionBar": "rwa6qG_gallerySelectionBar",
|
|
1222
|
+
"studio": "rwa6qG_studio",
|
|
1223
|
+
"lightboxEdit": "rwa6qG_lightboxEdit",
|
|
1224
|
+
"galleryRatio": "rwa6qG_galleryRatio",
|
|
1225
|
+
"lightboxClose": "rwa6qG_lightboxClose",
|
|
999
1226
|
"galleryImageButton": "rwa6qG_galleryImageButton",
|
|
1000
|
-
"
|
|
1001
|
-
"
|
|
1002
|
-
"
|
|
1003
|
-
"
|
|
1004
|
-
"
|
|
1005
|
-
"
|
|
1006
|
-
"galleryBadge": "rwa6qG_galleryBadge",
|
|
1007
|
-
"paramGroup": "rwa6qG_paramGroup",
|
|
1008
|
-
"galleryCardFooter": "rwa6qG_galleryCardFooter",
|
|
1009
|
-
"galleryToolbar": "rwa6qG_galleryToolbar",
|
|
1010
|
-
"galleryViewToggle": "rwa6qG_galleryViewToggle"
|
|
1227
|
+
"prompt": "rwa6qG_prompt",
|
|
1228
|
+
"canvasHistoryTag": "rwa6qG_canvasHistoryTag",
|
|
1229
|
+
"panelTitle": "rwa6qG_panelTitle",
|
|
1230
|
+
"galleryTagEditor": "rwa6qG_galleryTagEditor",
|
|
1231
|
+
"galleryFilterCount": "rwa6qG_galleryFilterCount",
|
|
1232
|
+
"taskTrayToggle": "rwa6qG_taskTrayToggle"
|
|
1011
1233
|
};
|
|
1012
1234
|
//#endregion
|
|
1013
1235
|
//#region src/client/mount.tsx
|
|
@@ -1654,7 +1876,7 @@ window.__ModuleLoader__.load({
|
|
|
1654
1876
|
}
|
|
1655
1877
|
//#endregion
|
|
1656
1878
|
//#region \0dsh-css:/Users/shimingming/Projects_code/dsh-audiogen/src/client/settings-card.module.css.mjs
|
|
1657
|
-
const css$1 = ".zmjoSq_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}.zmjoSq_card:hover{border-color:var(--dsw-alias-label-dimmed)}.zmjoSq_card:has(.zmjoSq_body){background:var(--dsw-alias-bg-layer-2);border-color:var(--dsw-alias-label-dimmed)}.zmjoSq_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}.zmjoSq_header:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px}.zmjoSq_headText{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}.zmjoSq_name{color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:1.4}.zmjoSq_description{color:var(--dsw-alias-label-tertiary);font-size:13px;line-height:1.5}.zmjoSq_chevron,.zmjoSq_chevronOpen{color:var(--dsw-alias-label-tertiary);flex:none;transition:transform .16s}.zmjoSq_chevronOpen{transform:rotate(180deg)}.zmjoSq_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}.zmjoSq_body{border-top:1px solid var(--dsw-alias-border-l2);margin:0 16px;padding-bottom:8px}.zmjoSq_versionRow{border-bottom:1px solid var(--dsw-alias-border-l2);justify-content:space-between;align-items:center;gap:12px;padding:12px 0;display:flex}.zmjoSq_versionLabel{color:var(--dsw-alias-label-primary);font-size:13px;font-weight:500;line-height:1.5}.zmjoSq_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}.zmjoSq_field{flex-direction:column;gap:6px;padding:12px 0;display:flex}.zmjoSq_field+.zmjoSq_field{border-top:1px solid var(--dsw-alias-border-l2)}.zmjoSq_head{align-items:center;gap:8px;display:flex}.zmjoSq_label{min-width:0;color:var(--dsw-alias-label-primary);flex:1;font-size:13px;font-weight:500;line-height:1.5}.zmjoSq_badges{align-items:center;gap:8px;display:inline-flex}.zmjoSq_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}.zmjoSq_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}.zmjoSq_reset:hover:not(:disabled){color:var(--dsw-alias-label-primary)}.zmjoSq_reset:disabled{cursor:default;opacity:.5}.zmjoSq_input,.zmjoSq_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}.zmjoSq_input:focus-visible,.zmjoSq_select:focus-visible{border-color:var(--dsw-alias-brand-primary)}.zmjoSq_input:disabled,.zmjoSq_select:disabled{color:var(--dsw-alias-label-tertiary);cursor:default}.zmjoSq_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}.zmjoSq_textarea,.zmjoSq_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}.zmjoSq_textarea{border:1px solid var(--dsw-alias-border-l2)}.zmjoSq_textareaInvalid{border:1px solid var(--dsw-alias-label-error)}.zmjoSq_textarea:focus-visible{border-color:var(--dsw-alias-brand-primary)}.zmjoSq_textarea:disabled{color:var(--dsw-alias-label-tertiary);cursor:default}.zmjoSq_hint,.zmjoSq_invalid{margin:0;font-size:12px;line-height:1.5}.zmjoSq_hint{color:var(--dsw-alias-label-tertiary)}.zmjoSq_invalid{color:var(--dsw-alias-label-error)}.zmjoSq_readOnly,.zmjoSq_notExposed{color:var(--dsw-alias-label-tertiary);margin:12px 0 0;font-size:12px;line-height:1.5}.zmjoSq_sectionDivider{background:var(--dsw-alias-border-l2);height:1px;margin:18px 0 14px}.zmjoSq_sectionTitle{color:var(--dsw-alias-label-primary);margin:0;font-size:14px;line-height:1.4}.zmjoSq_sectionHint{color:var(--dsw-alias-label-tertiary);margin:-4px 0 2px;font-size:12px;line-height:1.5}.zmjoSq_modelSection{padding:2px 0 14px}.zmjoSq_sectionHeader{justify-content:space-between;align-items:flex-start;gap:12px;display:flex}.zmjoSq_sectionHeader .zmjoSq_sectionHint{max-width:430px}.zmjoSq_modelSummary{flex-wrap:wrap;align-items:center;gap:6px;margin-top:12px;display:flex}.zmjoSq_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}.zmjoSq_modelChip>span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.zmjoSq_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}.zmjoSq_modelChip button:hover:not(:disabled){color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-module-platform)}.zmjoSq_modelChip button:disabled{cursor:default;opacity:.45}.zmjoSq_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}.zmjoSq_addModel:hover:not(:disabled){color:var(--dsw-alias-brand-primary);border-color:var(--dsw-alias-brand-primary)}.zmjoSq_addModel:disabled{opacity:.45;cursor:default}.zmjoSq_manualModelRow{gap:8px;margin-top:10px;display:flex}.zmjoSq_manualModelRow .zmjoSq_input{flex:1;min-width:0}.zmjoSq_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}.zmjoSq_disclosure>span:nth-child(2){color:var(--dsw-alias-label-tertiary);margin-left:auto;font-size:12px;font-weight:400}.zmjoSq_disclosure>span:last-child{color:var(--dsw-alias-label-tertiary)}.zmjoSq_disclosure:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:2px}.zmjoSq_optionalContent{padding:0 0 8px}.zmjoSq_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}.zmjoSq_inlineDisclosure:hover{color:var(--dsw-alias-label-primary)}.zmjoSq_modelFetchRow{align-items:center;gap:8px;display:flex}.zmjoSq_modelFetch,.zmjoSq_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}.zmjoSq_modelFetch{cursor:pointer;padding:0 10px}.zmjoSq_modelFetch:hover:not(:disabled){color:var(--dsw-alias-brand-primary);border-color:var(--dsw-alias-brand-primary)}.zmjoSq_modelFetch:disabled{opacity:.5;cursor:default}.zmjoSq_modelChoices{flex:1;min-width:0;padding:0 8px}.zmjoSq_modelCandidateList{flex-wrap:wrap;gap:6px 10px;margin-top:10px;display:flex}.zmjoSq_modelCandidateLabel{width:100%;color:var(--dsw-alias-label-tertiary);font-size:12px}.zmjoSq_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}.zmjoSq_modelCandidate input{margin:0}.zmjoSq_modelCandidate[data-selected]{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-primary)}.zmjoSq_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}.zmjoSq_failed{min-width:0;color:var(--dsw-alias-label-error);flex:1;margin:0;font-size:12px;line-height:1.5}.zmjoSq_discard,.zmjoSq_save{appearance:none;font:inherit;cursor:pointer;border:1px solid #0000;border-radius:8px;padding:5px 14px;font-size:13px;line-height:1.5}.zmjoSq_discard{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);background:0 0}.zmjoSq_discard:hover:not(:disabled){color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-dimmed)}.zmjoSq_save{background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-layer-3)}.zmjoSq_discard:disabled,.zmjoSq_save:disabled{opacity:.4;cursor:default}.zmjoSq_discard:focus-visible,.zmjoSq_save:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}@media (prefers-reduced-motion:reduce){.zmjoSq_card,.zmjoSq_chevron,.zmjoSq_chevronOpen{transition:none}}.zmjoSq_channelSection{padding:6px 0 2px}.zmjoSq_channelEmpty{color:var(--dsw-alias-label-tertiary);margin:10px 0 0;font-size:12px;line-height:1.5}.zmjoSq_channelList{flex-direction:column;gap:6px;margin:10px 0 0;padding:0;list-style:none;display:flex}.zmjoSq_channelRow{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:10px;align-items:center;gap:10px;padding:8px 10px;display:flex}.zmjoSq_channelRow[data-action]{flex-wrap:wrap}.zmjoSq_channelDotReady,.zmjoSq_channelDotWarn{border-radius:50%;flex:none;width:9px;height:9px}.zmjoSq_channelDotReady{background:var(--dsw-color-success,#2fbf71)}.zmjoSq_channelDotWarn{background:var(--dsw-color-danger,#e5484d)}.zmjoSq_channelMain{appearance:none;min-width:0;font:inherit;text-align:left;cursor:pointer;background:0 0;border:0;flex-direction:column;flex:1;gap:3px;padding:0;display:flex}.zmjoSq_channelName{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:600;line-height:1.4;overflow:hidden}.zmjoSq_channelMeta{flex-wrap:wrap;align-items:center;gap:4px 8px;display:flex}.zmjoSq_channelHost{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:1.5;font-family:var(--dsw-font-family-mono,monospace);text-overflow:ellipsis;white-space:nowrap;max-width:180px;overflow:hidden}.zmjoSq_channelBadge{white-space:nowrap;background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-secondary);border-radius:999px;padding:0 7px;font-size:11px;font-weight:500;line-height:17px}.zmjoSq_channelBadge[data-warn]{color:var(--dsw-alias-label-error)}.zmjoSq_channelBadge[data-default]{background:var(--dsw-alias-bg-module-poped,var(--dsw-alias-bg-module-platform));color:var(--dsw-alias-brand-primary)}.zmjoSq_channelAction{appearance:none;font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;border-radius:6px;flex:none;padding:4px 8px;font-size:12px;line-height:1.5}.zmjoSq_channelAction:hover:not(:disabled){color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-module-platform)}.zmjoSq_channelAction[data-danger]{color:var(--dsw-alias-label-error)}.zmjoSq_channelAction:disabled{opacity:.45;cursor:default}.zmjoSq_channelDanger{appearance:none;border:1px solid var(--dsw-alias-label-error);color:var(--dsw-alias-label-error);font:inherit;cursor:pointer;background:0 0;border-radius:6px;flex:none;padding:3px 10px;font-size:12px}.zmjoSq_channelDanger:hover:not(:disabled){background:color-mix(in srgb, var(--dsw-alias-label-error) 12%, transparent)}.zmjoSq_channelDanger:disabled{opacity:.45;cursor:default}.zmjoSq_deleteConfirmText{min-width:0;color:var(--dsw-alias-label-error);flex:1;font-size:12px;line-height:1.5}.zmjoSq_channelAddRow{gap:8px;margin-top:10px;display:flex}.zmjoSq_channelAdd{appearance:none;border:1px dashed var(--dsw-alias-border-l2);min-height:30px;color:var(--dsw-alias-label-secondary);font:inherit;cursor:pointer;background:0 0;border-radius:8px;padding:0 12px;font-size:12px}.zmjoSq_channelAdd:hover:not(:disabled){color:var(--dsw-alias-brand-primary);border-color:var(--dsw-alias-brand-primary)}.zmjoSq_channelAdd:disabled{opacity:.45;cursor:default}.zmjoSq_spacer{flex:1}.zmjoSq_editorBackdrop{z-index:120;background:color-mix(in srgb, var(--dsw-alias-bg-layer-1,#000) 45%, transparent);justify-content:center;align-items:flex-start;padding:9vh 16px 16px;display:flex;position:fixed;inset:0}.zmjoSq_editorPanel{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);border-radius:14px;width:min(560px,100%);max-height:82vh;padding:16px;overflow-y:auto;box-shadow:0 18px 50px #00000059}.zmjoSq_editorHeader{border-bottom:1px solid var(--dsw-alias-border-l2);justify-content:space-between;align-items:flex-start;gap:12px;padding-bottom:10px;display:flex}.zmjoSq_editorClose{appearance:none;width:26px;height:26px;color:var(--dsw-alias-label-tertiary);font:inherit;cursor:pointer;background:0 0;border:0;border-radius:6px;flex:none;font-size:16px;line-height:26px}.zmjoSq_editorClose:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-module-platform)}.zmjoSq_editorField{flex-direction:column;gap:6px;padding:12px 0 0;display:flex}.zmjoSq_editorDivider{background:var(--dsw-alias-border-l2);height:1px;margin:14px 0 4px}.zmjoSq_editorSectionHeader{justify-content:space-between;align-items:center;gap:12px;padding:10px 0 4px;display:flex}.zmjoSq_editorSectionHeader .zmjoSq_label{flex:1}.zmjoSq_editorTools{flex-direction:column;gap:8px;margin-top:10px;display:flex}.zmjoSq_editorFooter{border-top:1px solid var(--dsw-alias-border-l2);align-items:center;gap:8px;padding-top:12px;display:flex}.zmjoSq_detectOk{color:var(--dsw-color-success,var(--dsw-alias-label-secondary));margin:0;font-size:12px;line-height:1.5}.zmjoSq_modelRows{flex-direction:column;gap:8px;margin:8px 0 0;padding:0;list-style:none;display:flex}.zmjoSq_modelRow{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:10px;justify-content:space-between;align-items:center;gap:10px;padding:8px 10px;display:flex}.zmjoSq_modelRowInputs{flex:1;align-items:center;gap:6px;min-width:0;display:flex}.zmjoSq_modelRowInputs .zmjoSq_input{flex:1;min-width:0}.zmjoSq_modelArrow{color:var(--dsw-alias-label-tertiary);flex:none;font-size:12px}.zmjoSq_modelRowBadges{flex:none;align-items:center;gap:6px;display:flex}.zmjoSq_modelBadge{white-space:nowrap;background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-tertiary);border-radius:999px;padding:0 7px;font-size:11px;line-height:17px}.zmjoSq_modelBadge[data-verified]{color:var(--dsw-color-success,var(--dsw-alias-label-secondary))}.zmjoSq_modelBadge[data-warn]{color:var(--dsw-alias-label-error)}.zmjoSq_modelRowRemove{appearance:none;width:20px;height:20px;color:var(--dsw-alias-label-tertiary);font:inherit;cursor:pointer;background:0 0;border:0;border-radius:4px;flex:none;padding:0;line-height:20px}.zmjoSq_modelRowRemove:hover:not(:disabled){color:var(--dsw-alias-label-error);background:var(--dsw-alias-bg-module-platform)}.zmjoSq_modelRowRemove:disabled{opacity:.45;cursor:default}.zmjoSq_modelCandidate>.zmjoSq_modelBadge{flex:none}.zmjoSq_channelControls{position:relative}.zmjoSq_presetInline{z-index:10;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);border-radius:10px;width:min(420px,100vw - 48px);max-height:min(440px,60vh);margin:0;padding:12px;position:absolute;bottom:calc(100% + 8px);left:0;overflow-y:auto;box-shadow:0 12px 30px #0000004d}.zmjoSq_presetInlineHeader{justify-content:space-between;align-items:flex-start;gap:12px;display:flex}.zmjoSq_presetList{flex-direction:column;gap:8px;margin-top:12px;display:flex}.zmjoSq_presetRow{appearance:none;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);width:100%;color:inherit;font:inherit;text-align:left;cursor:pointer;border-radius:10px;flex-direction:column;align-items:flex-start;gap:3px;padding:10px 12px;display:flex}.zmjoSq_presetRow:hover:not(:disabled){border-color:var(--dsw-alias-brand-primary)}.zmjoSq_presetRow[data-custom]{border-style:dashed}.zmjoSq_presetRow:disabled{opacity:.5;cursor:default}.zmjoSq_presetName{color:var(--dsw-alias-label-primary);font-size:13px;font-weight:600;line-height:1.4}.zmjoSq_presetMeta{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:1.5;font-family:var(--dsw-font-family-mono,monospace)}.zmjoSq_presetHint{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:1.5}";
|
|
1879
|
+
const css$1 = ".zmjoSq_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}.zmjoSq_card:hover{border-color:var(--dsw-alias-label-dimmed)}.zmjoSq_card:has(.zmjoSq_body){background:var(--dsw-alias-bg-layer-2);border-color:var(--dsw-alias-label-dimmed)}.zmjoSq_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}.zmjoSq_header:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px}.zmjoSq_headText{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}.zmjoSq_name{color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:1.4}.zmjoSq_description{color:var(--dsw-alias-label-tertiary);font-size:13px;line-height:1.5}.zmjoSq_chevron,.zmjoSq_chevronOpen{color:var(--dsw-alias-label-tertiary);flex:none;transition:transform .16s}.zmjoSq_chevronOpen{transform:rotate(180deg)}.zmjoSq_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}.zmjoSq_body{border-top:1px solid var(--dsw-alias-border-l2);margin:0 16px;padding-bottom:8px}.zmjoSq_field{flex-direction:column;gap:6px;padding:12px 0;display:flex}.zmjoSq_field+.zmjoSq_field{border-top:1px solid var(--dsw-alias-border-l2)}.zmjoSq_head{align-items:center;gap:8px;display:flex}.zmjoSq_label{min-width:0;color:var(--dsw-alias-label-primary);flex:1;font-size:13px;font-weight:500;line-height:1.5}.zmjoSq_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}.zmjoSq_reset:hover:not(:disabled){color:var(--dsw-alias-label-primary)}.zmjoSq_reset:disabled{cursor:default;opacity:.5}.zmjoSq_input,.zmjoSq_select{box-sizing:border-box;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}.zmjoSq_input:focus-visible,.zmjoSq_select:focus-visible{border-color:var(--dsw-alias-brand-primary)}.zmjoSq_input:disabled,.zmjoSq_select:disabled{color:var(--dsw-alias-label-tertiary);cursor:default}.zmjoSq_sectionTitle{color:var(--dsw-alias-label-primary);margin:0;font-size:14px;line-height:1.4}.zmjoSq_sectionHint{color:var(--dsw-alias-label-tertiary);margin:-4px 0 2px;font-size:12px;line-height:1.5}.zmjoSq_sectionHeader{justify-content:space-between;align-items:flex-start;gap:12px;display:flex}.zmjoSq_sectionHeader .zmjoSq_sectionHint{max-width:430px}.zmjoSq_readOnly{color:var(--dsw-alias-label-tertiary);margin:12px 0 0;font-size:12px;line-height:1.5}.zmjoSq_link{color:var(--dsw-alias-brand-primary);text-decoration:none}.zmjoSq_link:hover{text-decoration:underline}.zmjoSq_channelSection{padding:6px 0 2px}.zmjoSq_channelEmpty{color:var(--dsw-alias-label-tertiary);margin:10px 0 0;font-size:12px;line-height:1.5}.zmjoSq_channelList{flex-direction:column;gap:6px;margin:10px 0 0;padding:0;list-style:none;display:flex}.zmjoSq_channelRow{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:10px;align-items:center;gap:10px;padding:8px 10px;display:flex}.zmjoSq_channelRow[data-action]{flex-wrap:wrap}.zmjoSq_channelDotReady,.zmjoSq_channelDotWarn{border-radius:50%;flex:none;width:9px;height:9px}.zmjoSq_channelDotReady{background:var(--dsw-color-success,#2fbf71)}.zmjoSq_channelDotWarn{background:var(--dsw-color-danger,#e5484d)}.zmjoSq_channelMain{appearance:none;min-width:0;font:inherit;text-align:left;cursor:pointer;background:0 0;border:0;flex-direction:column;flex:1;gap:3px;padding:0;display:flex}.zmjoSq_channelName{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:600;line-height:1.4;overflow:hidden}.zmjoSq_channelMeta{flex-wrap:wrap;align-items:center;gap:4px 8px;display:flex}.zmjoSq_channelHost{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:1.5;font-family:var(--dsw-font-family-mono,monospace);text-overflow:ellipsis;white-space:nowrap;max-width:180px;overflow:hidden}.zmjoSq_channelBadge{white-space:nowrap;background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-secondary);border-radius:999px;padding:0 7px;font-size:11px;font-weight:500;line-height:17px}.zmjoSq_channelBadge[data-warn]{color:var(--dsw-alias-label-error)}.zmjoSq_channelAction{appearance:none;font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;border-radius:6px;flex:none;padding:4px 8px;font-size:12px;line-height:1.5}.zmjoSq_channelAction:hover:not(:disabled){color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-module-platform)}.zmjoSq_channelAction[data-danger]{color:var(--dsw-alias-label-error)}.zmjoSq_channelAction:disabled{opacity:.45;cursor:default}.zmjoSq_channelDanger{appearance:none;border:1px solid var(--dsw-alias-label-error);color:var(--dsw-alias-label-error);font:inherit;cursor:pointer;background:0 0;border-radius:6px;flex:none;padding:3px 10px;font-size:12px}.zmjoSq_channelDanger:hover:not(:disabled){background:color-mix(in srgb, var(--dsw-alias-label-error) 12%, transparent)}.zmjoSq_channelDanger:disabled{opacity:.45;cursor:default}.zmjoSq_deleteConfirmText{min-width:0;color:var(--dsw-alias-label-error);flex:1;font-size:12px;line-height:1.5}.zmjoSq_channelAddRow{flex-wrap:wrap;gap:10px;margin-top:10px;display:flex}.zmjoSq_channelAdd{appearance:none;border:1px dashed var(--dsw-alias-border-l3,var(--dsw-alias-border-l2));min-width:180px;min-height:44px;color:var(--dsw-alias-label-secondary);font:inherit;cursor:pointer;background:0 0;border-radius:12px;flex:1 1 0;padding:0 12px;font-size:12px}.zmjoSq_channelAdd:hover:not(:disabled){color:var(--dsw-alias-brand-primary);border-color:var(--dsw-alias-brand-primary)}.zmjoSq_channelAdd:disabled{opacity:.45;cursor:default}.zmjoSq_editorWrap{margin-top:10px}.zmjoSq_channelEditor{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-module-platform);border-radius:12px;flex-direction:column;gap:2px;padding:14px 16px;display:flex}.zmjoSq_editorHeader{align-items:baseline;gap:8px;padding-bottom:4px;display:flex}.zmjoSq_editorTitle{color:var(--dsw-alias-label-primary);font-size:14px;font-weight:600;line-height:22px}.zmjoSq_editorTag{color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:18px}.zmjoSq_customSettings{border-top:1px solid var(--dsw-alias-border-l2);margin-top:6px;padding-top:10px}.zmjoSq_customSettingsSummary{cursor:pointer;width:fit-content;color:var(--dsw-alias-label-secondary);border-radius:6px;align-items:center;gap:6px;margin-left:-4px;padding:2px 4px;font-size:12px;font-weight:500;line-height:18px;list-style:none;display:flex}.zmjoSq_customSettingsSummary::-webkit-details-marker{display:none}.zmjoSq_customSettingsSummary:before{content:\"\";border-bottom:1.5px solid;border-right:1.5px solid;width:5px;height:5px;transition:transform .12s;transform:rotate(-45deg)translate(-1px,-1px)}.zmjoSq_customSettings[open]>.zmjoSq_customSettingsSummary:before{transform:rotate(45deg)translate(-1px,-1px)}.zmjoSq_customSettingsSummary:hover{color:var(--dsw-alias-label-primary)}.zmjoSq_customSettingsSummary:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:2px}.zmjoSq_customSettingsBody{flex-direction:column;gap:6px;padding-top:10px;display:flex}.zmjoSq_modelCatalog{border-top:1px solid var(--dsw-alias-border-l2);flex-direction:column;gap:10px;margin-top:6px;padding-top:12px;display:flex}.zmjoSq_modelCatalogHead{justify-content:space-between;align-items:flex-start;gap:12px;display:flex}.zmjoSq_modelCatalogTitle{color:var(--dsw-alias-label-primary);font-size:13px;font-weight:500;line-height:1.5;display:block}.zmjoSq_modelCatalogMeta{color:var(--dsw-alias-label-tertiary);margin-top:1px;font-size:12px;line-height:1.5;display:block}.zmjoSq_linkButton{box-sizing:border-box;height:28px;color:var(--dsw-alias-label-tertiary);font:inherit;cursor:pointer;background:0 0;border:none;border-radius:14px;align-items:center;padding:0 10px;font-size:12px;line-height:18px;display:inline-flex}.zmjoSq_linkButton:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover,var(--dsw-alias-bg-module-platform));color:var(--dsw-alias-label-secondary)}.zmjoSq_linkButton:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}.zmjoSq_linkButton:disabled{opacity:.5;cursor:default}.zmjoSq_modelEmpty{border:1px dashed var(--dsw-alias-border-l3,var(--dsw-alias-border-l2));text-align:center;color:var(--dsw-alias-label-tertiary);border-radius:8px;margin:0;padding:12px;font-size:12px;line-height:18px}.zmjoSq_modelRows{flex-direction:column;gap:8px;margin:0;padding:0;list-style:none;display:flex}.zmjoSq_modelRow{grid-template-columns:minmax(0,1fr) auto minmax(0,1.2fr) auto auto;align-items:center;gap:6px;display:grid}.zmjoSq_modelInput{min-width:0;height:32px}.zmjoSq_modelArrow{color:var(--dsw-alias-label-tertiary);font-size:12px}.zmjoSq_modelCategorySelect{cursor:pointer;min-width:0;max-width:108px;height:32px;padding:0 6px}.zmjoSq_modelRowRemove{appearance:none;width:24px;height:24px;color:var(--dsw-alias-label-tertiary);font:inherit;cursor:pointer;background:0 0;border:0;border-radius:6px;flex:none;padding:0;font-size:14px;line-height:24px}.zmjoSq_modelRowRemove:hover:not(:disabled){color:var(--dsw-alias-label-error);background:var(--dsw-alias-bg-module-platform)}.zmjoSq_modelRowRemove:disabled{opacity:.45;cursor:default}.zmjoSq_modelCatalogTools{align-items:center;gap:8px;display:flex}.zmjoSq_addModel{appearance:none;border:1px solid var(--dsw-alias-border-l2);min-height:30px;color:var(--dsw-alias-label-secondary);font:inherit;cursor:pointer;background:0 0;border-radius:8px;padding:0 12px;font-size:12px}.zmjoSq_addModel:hover:not(:disabled){color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-dimmed)}.zmjoSq_addModel:disabled{opacity:.45;cursor:default}.zmjoSq_modelBadge{white-space:nowrap;background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-tertiary);border-radius:999px;flex:none;padding:0 7px;font-size:11px;line-height:17px}.zmjoSq_detectOk{color:var(--dsw-color-success,var(--dsw-alias-label-secondary));margin:0;font-size:12px;line-height:1.5}.zmjoSq_candidatePanel{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:10px;flex-direction:column;gap:8px;padding:10px 12px;display:flex}.zmjoSq_candidateHead{justify-content:space-between;align-items:center;gap:12px;display:flex}.zmjoSq_candidateTitle{color:var(--dsw-alias-label-secondary);font-size:12px;font-weight:500;line-height:18px}.zmjoSq_candidateList{flex-direction:column;gap:4px;max-height:220px;margin:0;padding:0;list-style:none;display:flex;overflow-y:auto}.zmjoSq_candidate{align-items:center;display:flex}.zmjoSq_candidateLabel{min-width:0;color:var(--dsw-alias-label-secondary);cursor:pointer;align-items:center;gap:7px;padding:4px 2px;font-size:12px;line-height:1.5;display:inline-flex}.zmjoSq_candidateLabel input{margin:0}.zmjoSq_candidateLabel:has(input:disabled){opacity:.55;cursor:default}.zmjoSq_candidateId{text-overflow:ellipsis;white-space:nowrap;font-family:var(--dsw-font-family-mono,monospace);overflow:hidden}.zmjoSq_candidateActions{justify-content:flex-end;align-items:center;gap:8px;display:flex}.zmjoSq_footer,.zmjoSq_editorFooter{border-top:1px solid var(--dsw-alias-border-l2);justify-content:flex-end;align-items:center;gap:8px;padding:12px 0 4px;display:flex}.zmjoSq_editorFooter{margin-top:8px}.zmjoSq_failed{min-width:0;color:var(--dsw-alias-label-error);flex:1;margin:0;font-size:12px;line-height:1.5}.zmjoSq_discard,.zmjoSq_save{appearance:none;font:inherit;cursor:pointer;border:1px solid #0000;border-radius:8px;padding:5px 14px;font-size:13px;line-height:1.5}.zmjoSq_discard{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);background:0 0}.zmjoSq_discard:hover:not(:disabled){color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-dimmed)}.zmjoSq_save{background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-layer-3)}.zmjoSq_discard:disabled,.zmjoSq_save:disabled{opacity:.4;cursor:default}.zmjoSq_discard:focus-visible,.zmjoSq_save:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}@media (prefers-reduced-motion:reduce){.zmjoSq_card,.zmjoSq_chevron,.zmjoSq_chevronOpen{transition:none}}";
|
|
1658
1880
|
const tagId$1 = "dsh-audiogen/settings-card.module.css";
|
|
1659
1881
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$1) + "]") === null) {
|
|
1660
1882
|
const tag = document.createElement("style");
|
|
@@ -1664,97 +1886,79 @@ window.__ModuleLoader__.load({
|
|
|
1664
1886
|
document.head.appendChild(tag);
|
|
1665
1887
|
}
|
|
1666
1888
|
var settings_card_module_css_default = {
|
|
1667
|
-
"
|
|
1668
|
-
"
|
|
1889
|
+
"modelArrow": "zmjoSq_modelArrow",
|
|
1890
|
+
"editorTag": "zmjoSq_editorTag",
|
|
1891
|
+
"deleteConfirmText": "zmjoSq_deleteConfirmText",
|
|
1892
|
+
"candidateList": "zmjoSq_candidateList",
|
|
1893
|
+
"failed": "zmjoSq_failed",
|
|
1894
|
+
"sectionHeader": "zmjoSq_sectionHeader",
|
|
1895
|
+
"modelInput": "zmjoSq_modelInput",
|
|
1896
|
+
"chevron": "zmjoSq_chevron",
|
|
1897
|
+
"channelAction": "zmjoSq_channelAction",
|
|
1898
|
+
"channelDanger": "zmjoSq_channelDanger",
|
|
1899
|
+
"channelDotWarn": "zmjoSq_channelDotWarn",
|
|
1900
|
+
"channelMain": "zmjoSq_channelMain",
|
|
1669
1901
|
"channelAdd": "zmjoSq_channelAdd",
|
|
1902
|
+
"editorHeader": "zmjoSq_editorHeader",
|
|
1903
|
+
"candidateId": "zmjoSq_candidateId",
|
|
1904
|
+
"customSettings": "zmjoSq_customSettings",
|
|
1905
|
+
"editorFooter": "zmjoSq_editorFooter",
|
|
1906
|
+
"save": "zmjoSq_save",
|
|
1907
|
+
"channelHost": "zmjoSq_channelHost",
|
|
1908
|
+
"card": "zmjoSq_card",
|
|
1909
|
+
"editorTitle": "zmjoSq_editorTitle",
|
|
1910
|
+
"pending": "zmjoSq_pending",
|
|
1911
|
+
"header": "zmjoSq_header",
|
|
1670
1912
|
"modelRowRemove": "zmjoSq_modelRowRemove",
|
|
1671
|
-
"description": "zmjoSq_description",
|
|
1672
|
-
"head": "zmjoSq_head",
|
|
1673
|
-
"modelCandidateList": "zmjoSq_modelCandidateList",
|
|
1674
|
-
"presetHint": "zmjoSq_presetHint",
|
|
1675
1913
|
"select": "zmjoSq_select",
|
|
1676
|
-
"
|
|
1914
|
+
"modelCategorySelect": "zmjoSq_modelCategorySelect",
|
|
1915
|
+
"label": "zmjoSq_label",
|
|
1916
|
+
"channelRow": "zmjoSq_channelRow",
|
|
1917
|
+
"link": "zmjoSq_link",
|
|
1918
|
+
"channelAddRow": "zmjoSq_channelAddRow",
|
|
1919
|
+
"footer": "zmjoSq_footer",
|
|
1920
|
+
"modelCatalogHead": "zmjoSq_modelCatalogHead",
|
|
1921
|
+
"modelEmpty": "zmjoSq_modelEmpty",
|
|
1922
|
+
"modelBadge": "zmjoSq_modelBadge",
|
|
1923
|
+
"channelName": "zmjoSq_channelName",
|
|
1924
|
+
"channelDotReady": "zmjoSq_channelDotReady",
|
|
1925
|
+
"input": "zmjoSq_input",
|
|
1926
|
+
"candidatePanel": "zmjoSq_candidatePanel",
|
|
1927
|
+
"channelEditor": "zmjoSq_channelEditor",
|
|
1928
|
+
"body": "zmjoSq_body",
|
|
1929
|
+
"modelCatalogTitle": "zmjoSq_modelCatalogTitle",
|
|
1677
1930
|
"sectionHint": "zmjoSq_sectionHint",
|
|
1678
|
-
"
|
|
1679
|
-
"modelRowBadges": "zmjoSq_modelRowBadges",
|
|
1680
|
-
"modelFetchRow": "zmjoSq_modelFetchRow",
|
|
1681
|
-
"editorPanel": "zmjoSq_editorPanel",
|
|
1682
|
-
"disclosure": "zmjoSq_disclosure",
|
|
1683
|
-
"sectionHeader": "zmjoSq_sectionHeader",
|
|
1684
|
-
"save": "zmjoSq_save",
|
|
1931
|
+
"addModel": "zmjoSq_addModel",
|
|
1685
1932
|
"channelSection": "zmjoSq_channelSection",
|
|
1686
|
-
"
|
|
1687
|
-
"
|
|
1688
|
-
"
|
|
1689
|
-
"
|
|
1690
|
-
"
|
|
1691
|
-
"
|
|
1933
|
+
"detectOk": "zmjoSq_detectOk",
|
|
1934
|
+
"head": "zmjoSq_head",
|
|
1935
|
+
"modelRows": "zmjoSq_modelRows",
|
|
1936
|
+
"channelBadge": "zmjoSq_channelBadge",
|
|
1937
|
+
"candidateLabel": "zmjoSq_candidateLabel",
|
|
1938
|
+
"readOnly": "zmjoSq_readOnly",
|
|
1939
|
+
"candidate": "zmjoSq_candidate",
|
|
1940
|
+
"candidateActions": "zmjoSq_candidateActions",
|
|
1692
1941
|
"channelMeta": "zmjoSq_channelMeta",
|
|
1693
|
-
"
|
|
1694
|
-
"
|
|
1695
|
-
"
|
|
1696
|
-
"modelFetch": "zmjoSq_modelFetch",
|
|
1942
|
+
"modelCatalogMeta": "zmjoSq_modelCatalogMeta",
|
|
1943
|
+
"customSettingsSummary": "zmjoSq_customSettingsSummary",
|
|
1944
|
+
"field": "zmjoSq_field",
|
|
1697
1945
|
"sectionTitle": "zmjoSq_sectionTitle",
|
|
1698
1946
|
"channelEmpty": "zmjoSq_channelEmpty",
|
|
1699
|
-
"
|
|
1700
|
-
"
|
|
1701
|
-
"
|
|
1702
|
-
"
|
|
1703
|
-
"
|
|
1704
|
-
"headText": "zmjoSq_headText",
|
|
1705
|
-
"versionRow": "zmjoSq_versionRow",
|
|
1706
|
-
"modelCandidate": "zmjoSq_modelCandidate",
|
|
1707
|
-
"channelDotReady": "zmjoSq_channelDotReady",
|
|
1708
|
-
"channelDotWarn": "zmjoSq_channelDotWarn",
|
|
1709
|
-
"footer": "zmjoSq_footer",
|
|
1710
|
-
"channelHost": "zmjoSq_channelHost",
|
|
1711
|
-
"channelRow": "zmjoSq_channelRow",
|
|
1712
|
-
"channelMain": "zmjoSq_channelMain",
|
|
1713
|
-
"editorField": "zmjoSq_editorField",
|
|
1714
|
-
"modelRows": "zmjoSq_modelRows",
|
|
1715
|
-
"presetMeta": "zmjoSq_presetMeta",
|
|
1716
|
-
"reset": "zmjoSq_reset",
|
|
1717
|
-
"name": "zmjoSq_name",
|
|
1718
|
-
"versionValue": "zmjoSq_versionValue",
|
|
1719
|
-
"badges": "zmjoSq_badges",
|
|
1720
|
-
"badge": "zmjoSq_badge",
|
|
1721
|
-
"channelName": "zmjoSq_channelName",
|
|
1722
|
-
"editorSectionHeader": "zmjoSq_editorSectionHeader",
|
|
1723
|
-
"presetName": "zmjoSq_presetName",
|
|
1724
|
-
"pending": "zmjoSq_pending",
|
|
1725
|
-
"invalid": "zmjoSq_invalid",
|
|
1726
|
-
"modelChip": "zmjoSq_modelChip",
|
|
1727
|
-
"header": "zmjoSq_header",
|
|
1728
|
-
"modelRow": "zmjoSq_modelRow",
|
|
1947
|
+
"editorWrap": "zmjoSq_editorWrap",
|
|
1948
|
+
"candidateHead": "zmjoSq_candidateHead",
|
|
1949
|
+
"modelCatalog": "zmjoSq_modelCatalog",
|
|
1950
|
+
"candidateTitle": "zmjoSq_candidateTitle",
|
|
1951
|
+
"linkButton": "zmjoSq_linkButton",
|
|
1729
1952
|
"channelList": "zmjoSq_channelList",
|
|
1730
|
-
"
|
|
1731
|
-
"
|
|
1732
|
-
"editorBackdrop": "zmjoSq_editorBackdrop",
|
|
1733
|
-
"chevron": "zmjoSq_chevron",
|
|
1734
|
-
"card": "zmjoSq_card",
|
|
1735
|
-
"chevronOpen": "zmjoSq_chevronOpen",
|
|
1736
|
-
"editorHeader": "zmjoSq_editorHeader",
|
|
1737
|
-
"modelCandidateLabel": "zmjoSq_modelCandidateLabel",
|
|
1738
|
-
"sectionDivider": "zmjoSq_sectionDivider",
|
|
1739
|
-
"addModel": "zmjoSq_addModel",
|
|
1740
|
-
"channelBadge": "zmjoSq_channelBadge",
|
|
1741
|
-
"editorDivider": "zmjoSq_editorDivider",
|
|
1742
|
-
"input": "zmjoSq_input",
|
|
1743
|
-
"modelArrow": "zmjoSq_modelArrow",
|
|
1744
|
-
"textarea": "zmjoSq_textarea",
|
|
1745
|
-
"presetInlineHeader": "zmjoSq_presetInlineHeader",
|
|
1746
|
-
"modelRowInputs": "zmjoSq_modelRowInputs",
|
|
1747
|
-
"presetInline": "zmjoSq_presetInline",
|
|
1748
|
-
"presetList": "zmjoSq_presetList",
|
|
1953
|
+
"reset": "zmjoSq_reset",
|
|
1954
|
+
"modelCatalogTools": "zmjoSq_modelCatalogTools",
|
|
1749
1955
|
"discard": "zmjoSq_discard",
|
|
1750
|
-
"
|
|
1751
|
-
"
|
|
1752
|
-
"
|
|
1753
|
-
"
|
|
1754
|
-
"
|
|
1755
|
-
"
|
|
1756
|
-
"modelBadge": "zmjoSq_modelBadge",
|
|
1757
|
-
"detectOk": "zmjoSq_detectOk"
|
|
1956
|
+
"chevronOpen": "zmjoSq_chevronOpen",
|
|
1957
|
+
"description": "zmjoSq_description",
|
|
1958
|
+
"name": "zmjoSq_name",
|
|
1959
|
+
"customSettingsBody": "zmjoSq_customSettingsBody",
|
|
1960
|
+
"headText": "zmjoSq_headText",
|
|
1961
|
+
"modelRow": "zmjoSq_modelRow"
|
|
1758
1962
|
};
|
|
1759
1963
|
//#endregion
|
|
1760
1964
|
//#region src/client/SettingsCard.tsx
|
|
@@ -1764,6 +1968,12 @@ window.__ModuleLoader__.load({
|
|
|
1764
1968
|
* Registers into the official `settings.plugin.item` slot. It manages a list
|
|
1765
1969
|
* of audio channels (each with API URL, per-channel secret, and model/voice
|
|
1766
1970
|
* catalog), plus master switches.
|
|
1971
|
+
*
|
|
1972
|
+
* Channel management follows the DSH "模型" settings pattern: provider rows
|
|
1973
|
+
* with a status dot and 编辑/删除 actions, and two equal-width add actions
|
|
1974
|
+
* (「添加提供方」 / 「添加自定义提供方」) below. Both add and edit open the
|
|
1975
|
+
* same inline editor card — provider select, API key, 自定义设置 (API 地址)
|
|
1976
|
+
* and a 模型目录 with 「获取可用模型」 discovery and per-row model editing.
|
|
1767
1977
|
*/
|
|
1768
1978
|
var AudioGenSettingsCardController = class {
|
|
1769
1979
|
scope;
|
|
@@ -1803,110 +2013,580 @@ window.__ModuleLoader__.load({
|
|
|
1803
2013
|
};
|
|
1804
2014
|
}
|
|
1805
2015
|
};
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
return {
|
|
1816
|
-
id,
|
|
1817
|
-
preset: preset.id,
|
|
1818
|
-
name: preset.name,
|
|
1819
|
-
apiUrl: preset.apiUrl,
|
|
1820
|
-
models: preset.models.map((model) => ({ ...model }))
|
|
1821
|
-
};
|
|
1822
|
-
}
|
|
1823
|
-
function modelsToText(models) {
|
|
1824
|
-
return models.map((model) => `${model.alias}=${model.id}${model.category === void 0 ? "" : ` @${model.category}`}`).join("\n");
|
|
2016
|
+
const MODEL_CATEGORIES = [
|
|
2017
|
+
void 0,
|
|
2018
|
+
"tts",
|
|
2019
|
+
"music",
|
|
2020
|
+
"sfx",
|
|
2021
|
+
"voice_design",
|
|
2022
|
+
"voice_clone"
|
|
2023
|
+
];
|
|
2024
|
+
function newChannelId() {
|
|
2025
|
+
return `ch-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 6)}`;
|
|
1825
2026
|
}
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
const
|
|
1830
|
-
const
|
|
1831
|
-
|
|
1832
|
-
const alias = eq >= 0 ? body.slice(0, eq).trim() : body.trim();
|
|
1833
|
-
const id = eq >= 0 ? body.slice(eq + 1).trim() : alias;
|
|
2027
|
+
/** Strip a draft before staging: empty rows removed, aliases default to ids. */
|
|
2028
|
+
function cleanModels(models) {
|
|
2029
|
+
const cleaned = models.map((model) => {
|
|
2030
|
+
const alias = model.alias.trim();
|
|
2031
|
+
const id = model.id.trim() === "" ? alias : model.id.trim();
|
|
2032
|
+
if (alias === "" && id === "") return void 0;
|
|
1834
2033
|
return {
|
|
1835
|
-
alias,
|
|
1836
|
-
id
|
|
1837
|
-
...category === void 0
|
|
2034
|
+
alias: alias === "" ? id : alias,
|
|
2035
|
+
id,
|
|
2036
|
+
...model.category === void 0 ? {} : { category: model.category }
|
|
1838
2037
|
};
|
|
1839
|
-
}).filter((model) => model
|
|
2038
|
+
}).filter((model) => model !== void 0);
|
|
2039
|
+
return [...new Map(cleaned.map((model) => [model.alias, model])).values()];
|
|
1840
2040
|
}
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
const [
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
2041
|
+
/** Translate one key with interpolation (the injected `t` takes no values). */
|
|
2042
|
+
function tpl(t, key, values) {
|
|
2043
|
+
let text = t(key);
|
|
2044
|
+
if (values === void 0) return text;
|
|
2045
|
+
for (const [name, value] of Object.entries(values)) text = text.replaceAll(`{${name}}`, String(value));
|
|
2046
|
+
return text;
|
|
2047
|
+
}
|
|
2048
|
+
function rowsOf(models) {
|
|
2049
|
+
return models.map((model, index) => ({
|
|
2050
|
+
...model,
|
|
2051
|
+
rowKey: `m-${index}-${model.alias}-${model.id}`
|
|
2052
|
+
}));
|
|
2053
|
+
}
|
|
2054
|
+
function ChannelEditor(props) {
|
|
2055
|
+
const { t, writable, mode, presets } = props;
|
|
2056
|
+
const [presetId, setPresetId] = (0, react.useState)(mode.kind === "add-provider" ? presets[0]?.id ?? "" : "");
|
|
2057
|
+
const invited = (0, react.useMemo)(() => mode.kind === "add-provider" ? presets.find((preset) => preset.id === presetId) : void 0, [
|
|
2058
|
+
mode,
|
|
2059
|
+
presets,
|
|
2060
|
+
presetId
|
|
2061
|
+
]);
|
|
2062
|
+
const [name, setName] = (0, react.useState)(props.channel?.name ?? invited?.name ?? "");
|
|
2063
|
+
const [url, setUrl] = (0, react.useState)(props.channel?.apiUrl ?? invited?.apiUrl ?? "");
|
|
2064
|
+
const [models, setModels] = (0, react.useState)(rowsOf(props.channel?.models ?? invited?.models ?? []));
|
|
2065
|
+
const [key, setKey] = (0, react.useState)("");
|
|
2066
|
+
const [keyAction, setKeyAction] = (0, react.useState)("none");
|
|
2067
|
+
const [isDefault, setIsDefault] = (0, react.useState)(props.initiallyDefault);
|
|
1850
2068
|
const [discovering, setDiscovering] = (0, react.useState)(false);
|
|
1851
2069
|
const [discoverError, setDiscoverError] = (0, react.useState)(null);
|
|
1852
|
-
const [
|
|
1853
|
-
const [
|
|
1854
|
-
const [
|
|
1855
|
-
const
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
const existing = channels.find((channel) => channel.id === editingId);
|
|
1872
|
-
const models = textToModels(editModels);
|
|
1873
|
-
const updated = {
|
|
1874
|
-
id: editingId,
|
|
1875
|
-
preset: existing?.preset ?? "",
|
|
1876
|
-
name: editName.trim(),
|
|
1877
|
-
apiUrl: editUrl.trim(),
|
|
1878
|
-
models
|
|
2070
|
+
const [candidates, setCandidates] = (0, react.useState)(null);
|
|
2071
|
+
const [picked, setPicked] = (0, react.useState)(/* @__PURE__ */ new Set());
|
|
2072
|
+
const [sourceNote, setSourceNote] = (0, react.useState)(null);
|
|
2073
|
+
const usePreset = (preset) => {
|
|
2074
|
+
setPresetId(preset?.id ?? "");
|
|
2075
|
+
setName(preset?.name ?? "");
|
|
2076
|
+
setUrl(preset?.apiUrl ?? "");
|
|
2077
|
+
setModels(rowsOf(preset?.models ?? []));
|
|
2078
|
+
setKey("");
|
|
2079
|
+
setKeyAction("none");
|
|
2080
|
+
};
|
|
2081
|
+
const effectiveKeyHeld = props.keyHeld && keyAction !== "clear";
|
|
2082
|
+
const save = () => {
|
|
2083
|
+
const channel = {
|
|
2084
|
+
id: props.channel?.id ?? newChannelId(),
|
|
2085
|
+
preset: mode.kind === "edit" ? props.channel?.preset ?? "" : mode.kind === "add-custom" ? "" : invited?.id ?? "",
|
|
2086
|
+
name: name.trim(),
|
|
2087
|
+
apiUrl: url.trim(),
|
|
2088
|
+
models: cleanModels(models)
|
|
1879
2089
|
};
|
|
1880
|
-
const
|
|
1881
|
-
props.
|
|
1882
|
-
if (editKey.trim() !== "") props.channels.setChannelKey(editingId, editKey.trim());
|
|
1883
|
-
if (editDefault) props.channels.setDefaultChannel(editingId);
|
|
1884
|
-
setEditingId(null);
|
|
2090
|
+
const stagedKey = key.trim() !== "" ? key.trim() : keyAction === "clear" ? "" : void 0;
|
|
2091
|
+
props.onSave(channel, stagedKey, isDefault);
|
|
1885
2092
|
};
|
|
1886
|
-
const
|
|
1887
|
-
|
|
2093
|
+
const discoverable = url.trim() !== "" && (key.trim() !== "" || effectiveKeyHeld);
|
|
2094
|
+
const discover = async () => {
|
|
2095
|
+
if (!discoverable) return;
|
|
1888
2096
|
setDiscovering(true);
|
|
1889
2097
|
setDiscoverError(null);
|
|
2098
|
+
setSourceNote(null);
|
|
1890
2099
|
try {
|
|
1891
|
-
channels.find((channel) => channel.id === editingId);
|
|
1892
2100
|
const response = await fetch(MODEL_API.discover, {
|
|
1893
2101
|
method: "POST",
|
|
1894
2102
|
headers: { "content-type": "application/json" },
|
|
1895
2103
|
body: JSON.stringify({
|
|
1896
|
-
channelId:
|
|
1897
|
-
|
|
1898
|
-
|
|
2104
|
+
channelId: props.channel?.id ?? "preview",
|
|
2105
|
+
preset: mode.kind === "add-provider" ? invited?.id ?? "" : props.channel?.preset ?? "",
|
|
2106
|
+
apiUrl: url.trim(),
|
|
2107
|
+
...key.trim() !== "" ? { apiKey: key.trim() } : {}
|
|
1899
2108
|
})
|
|
1900
2109
|
});
|
|
1901
2110
|
const body = await response.json();
|
|
1902
2111
|
if (body.ok !== true || body.models === void 0) throw new Error(body.message ?? `HTTP ${response.status}`);
|
|
1903
|
-
|
|
2112
|
+
const known = new Set(models.map((model) => model.id.trim()).filter(Boolean));
|
|
2113
|
+
const found = body.models.map((model) => ({
|
|
2114
|
+
...model,
|
|
2115
|
+
id: model.id.trim()
|
|
2116
|
+
})).filter((model) => model.id !== "");
|
|
2117
|
+
if (found.length === 0) {
|
|
2118
|
+
setDiscoverError(t("channel.fetchEmpty"));
|
|
2119
|
+
return;
|
|
2120
|
+
}
|
|
2121
|
+
setCandidates(found);
|
|
2122
|
+
setPicked(new Set(found.filter((model) => !known.has(model.id)).map((model) => model.id)));
|
|
2123
|
+
setSourceNote(body.source ?? null);
|
|
1904
2124
|
} catch (error) {
|
|
1905
2125
|
setDiscoverError(error instanceof Error ? error.message : String(error));
|
|
1906
2126
|
} finally {
|
|
1907
2127
|
setDiscovering(false);
|
|
1908
2128
|
}
|
|
1909
2129
|
};
|
|
2130
|
+
const closeCandidates = () => {
|
|
2131
|
+
setCandidates(null);
|
|
2132
|
+
setPicked(/* @__PURE__ */ new Set());
|
|
2133
|
+
};
|
|
2134
|
+
const adoptCandidates = () => {
|
|
2135
|
+
if (candidates === null) return;
|
|
2136
|
+
const existing = [...models];
|
|
2137
|
+
const byId = new Map(existing.map((model, index) => [model.id.trim(), {
|
|
2138
|
+
model,
|
|
2139
|
+
index
|
|
2140
|
+
}]));
|
|
2141
|
+
for (const candidate of candidates) {
|
|
2142
|
+
const id = candidate.id.trim();
|
|
2143
|
+
if (id === "" || !picked.has(id)) continue;
|
|
2144
|
+
if (byId.has(id)) continue;
|
|
2145
|
+
byId.set(id, {
|
|
2146
|
+
model: {
|
|
2147
|
+
rowKey: `m-${Date.now()}-${existing.length}`,
|
|
2148
|
+
alias: candidate.alias,
|
|
2149
|
+
id,
|
|
2150
|
+
...candidate.category === void 0 ? {} : { category: candidate.category }
|
|
2151
|
+
},
|
|
2152
|
+
index: existing.length
|
|
2153
|
+
});
|
|
2154
|
+
existing.push(byId.get(id).model);
|
|
2155
|
+
}
|
|
2156
|
+
setModels(existing);
|
|
2157
|
+
closeCandidates();
|
|
2158
|
+
};
|
|
2159
|
+
const patchModel = (index, next) => {
|
|
2160
|
+
setModels(models.map((model, at) => at === index ? {
|
|
2161
|
+
...model,
|
|
2162
|
+
...next
|
|
2163
|
+
} : model));
|
|
2164
|
+
};
|
|
2165
|
+
const presetPlaceholder = invited?.apiUrl ?? t("channel.apiUrlPlaceholder");
|
|
2166
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2167
|
+
className: settings_card_module_css_default.channelEditor,
|
|
2168
|
+
children: [
|
|
2169
|
+
mode.kind === "add-provider" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2170
|
+
className: settings_card_module_css_default.field,
|
|
2171
|
+
children: [
|
|
2172
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
2173
|
+
className: settings_card_module_css_default.label,
|
|
2174
|
+
htmlFor: "audiogen-editor-provider",
|
|
2175
|
+
children: t("channel.provider")
|
|
2176
|
+
}),
|
|
2177
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("select", {
|
|
2178
|
+
id: "audiogen-editor-provider",
|
|
2179
|
+
className: settings_card_module_css_default.select,
|
|
2180
|
+
value: presetId,
|
|
2181
|
+
disabled: !writable,
|
|
2182
|
+
onChange: (event) => usePreset(presets.find((preset) => preset.id === event.target.value)),
|
|
2183
|
+
children: presets.map((preset) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
2184
|
+
value: preset.id,
|
|
2185
|
+
children: preset.name
|
|
2186
|
+
}, preset.id))
|
|
2187
|
+
}),
|
|
2188
|
+
invited?.site !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
|
|
2189
|
+
className: settings_card_module_css_default.sectionHint,
|
|
2190
|
+
children: [
|
|
2191
|
+
t("channel.site"),
|
|
2192
|
+
":",
|
|
2193
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
2194
|
+
className: settings_card_module_css_default.link,
|
|
2195
|
+
href: invited.site,
|
|
2196
|
+
target: "_blank",
|
|
2197
|
+
rel: "noreferrer",
|
|
2198
|
+
children: invited.site
|
|
2199
|
+
})
|
|
2200
|
+
]
|
|
2201
|
+
}) : null
|
|
2202
|
+
]
|
|
2203
|
+
}) : null,
|
|
2204
|
+
mode.kind === "add-custom" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2205
|
+
className: settings_card_module_css_default.field,
|
|
2206
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2207
|
+
className: settings_card_module_css_default.label,
|
|
2208
|
+
children: t("channel.provider")
|
|
2209
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
|
|
2210
|
+
className: settings_card_module_css_default.sectionHint,
|
|
2211
|
+
children: [
|
|
2212
|
+
t("channel.providerCustom"),
|
|
2213
|
+
" — ",
|
|
2214
|
+
t("channel.providerCustomHint")
|
|
2215
|
+
]
|
|
2216
|
+
})]
|
|
2217
|
+
}) : null,
|
|
2218
|
+
mode.kind === "edit" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2219
|
+
className: settings_card_module_css_default.editorHeader,
|
|
2220
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2221
|
+
className: settings_card_module_css_default.editorTitle,
|
|
2222
|
+
children: props.channel?.name.trim() !== "" ? props.channel?.name : t("channels.untitled")
|
|
2223
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2224
|
+
className: settings_card_module_css_default.editorTag,
|
|
2225
|
+
children: mode.kind === "edit" ? t("channel.editTitle") : ""
|
|
2226
|
+
})]
|
|
2227
|
+
}) : null,
|
|
2228
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2229
|
+
className: settings_card_module_css_default.field,
|
|
2230
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
2231
|
+
className: settings_card_module_css_default.label,
|
|
2232
|
+
htmlFor: "audiogen-editor-name",
|
|
2233
|
+
children: t("channel.name")
|
|
2234
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
2235
|
+
id: "audiogen-editor-name",
|
|
2236
|
+
className: settings_card_module_css_default.input,
|
|
2237
|
+
value: name,
|
|
2238
|
+
placeholder: t("channel.namePlaceholder"),
|
|
2239
|
+
disabled: !writable,
|
|
2240
|
+
onChange: (event) => setName(event.target.value)
|
|
2241
|
+
})]
|
|
2242
|
+
}),
|
|
2243
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2244
|
+
className: settings_card_module_css_default.field,
|
|
2245
|
+
children: [
|
|
2246
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2247
|
+
className: settings_card_module_css_default.head,
|
|
2248
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
2249
|
+
className: settings_card_module_css_default.label,
|
|
2250
|
+
htmlFor: "audiogen-editor-key",
|
|
2251
|
+
children: t("channel.apiKey")
|
|
2252
|
+
}), effectiveKeyHeld && key.trim() === "" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2253
|
+
type: "button",
|
|
2254
|
+
className: settings_card_module_css_default.reset,
|
|
2255
|
+
disabled: !writable,
|
|
2256
|
+
onClick: () => {
|
|
2257
|
+
setKeyAction("clear");
|
|
2258
|
+
setKey("");
|
|
2259
|
+
},
|
|
2260
|
+
children: t("channel.clearKey")
|
|
2261
|
+
}) : null]
|
|
2262
|
+
}),
|
|
2263
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
2264
|
+
id: "audiogen-editor-key",
|
|
2265
|
+
className: settings_card_module_css_default.input,
|
|
2266
|
+
type: "password",
|
|
2267
|
+
value: key,
|
|
2268
|
+
autoComplete: "off",
|
|
2269
|
+
placeholder: effectiveKeyHeld ? "••••••••" : "",
|
|
2270
|
+
disabled: !writable,
|
|
2271
|
+
onChange: (event) => {
|
|
2272
|
+
setKey(event.target.value);
|
|
2273
|
+
if (event.target.value !== "") setKeyAction("none");
|
|
2274
|
+
}
|
|
2275
|
+
}),
|
|
2276
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2277
|
+
className: settings_card_module_css_default.sectionHint,
|
|
2278
|
+
children: effectiveKeyHeld ? t("channel.apiKeyStoredHint") : t("channel.apiKeyHint")
|
|
2279
|
+
})
|
|
2280
|
+
]
|
|
2281
|
+
}),
|
|
2282
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
|
|
2283
|
+
className: settings_card_module_css_default.customSettings,
|
|
2284
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", {
|
|
2285
|
+
className: settings_card_module_css_default.customSettingsSummary,
|
|
2286
|
+
children: t("channel.customSettings")
|
|
2287
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2288
|
+
className: settings_card_module_css_default.customSettingsBody,
|
|
2289
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2290
|
+
className: settings_card_module_css_default.field,
|
|
2291
|
+
children: [
|
|
2292
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
2293
|
+
className: settings_card_module_css_default.label,
|
|
2294
|
+
htmlFor: "audiogen-editor-url",
|
|
2295
|
+
children: t("channel.apiUrl")
|
|
2296
|
+
}),
|
|
2297
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
2298
|
+
id: "audiogen-editor-url",
|
|
2299
|
+
className: settings_card_module_css_default.input,
|
|
2300
|
+
type: "text",
|
|
2301
|
+
value: url,
|
|
2302
|
+
placeholder: presetPlaceholder,
|
|
2303
|
+
disabled: !writable,
|
|
2304
|
+
onChange: (event) => setUrl(event.target.value)
|
|
2305
|
+
}),
|
|
2306
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2307
|
+
className: settings_card_module_css_default.sectionHint,
|
|
2308
|
+
children: t("channel.apiUrlHint")
|
|
2309
|
+
})
|
|
2310
|
+
]
|
|
2311
|
+
})
|
|
2312
|
+
})]
|
|
2313
|
+
}),
|
|
2314
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModelCatalog, {
|
|
2315
|
+
t,
|
|
2316
|
+
writable,
|
|
2317
|
+
models,
|
|
2318
|
+
discoverable,
|
|
2319
|
+
discovering,
|
|
2320
|
+
discoverError,
|
|
2321
|
+
candidates,
|
|
2322
|
+
picked,
|
|
2323
|
+
sourceNote,
|
|
2324
|
+
onPatchModel: patchModel,
|
|
2325
|
+
onRemoveModel: (index) => setModels(models.filter((_model, at) => at !== index)),
|
|
2326
|
+
onAddModel: () => setModels([...models, {
|
|
2327
|
+
rowKey: `m-${Date.now()}-${models.length}`,
|
|
2328
|
+
alias: "",
|
|
2329
|
+
id: ""
|
|
2330
|
+
}]),
|
|
2331
|
+
onDiscover: () => void discover(),
|
|
2332
|
+
onTogglePicked: (id) => {
|
|
2333
|
+
setPicked((current) => {
|
|
2334
|
+
const next = new Set(current);
|
|
2335
|
+
if (!next.delete(id)) next.add(id);
|
|
2336
|
+
return next;
|
|
2337
|
+
});
|
|
2338
|
+
},
|
|
2339
|
+
onToggleAllPicked: () => {
|
|
2340
|
+
setPicked((current) => candidates !== null && candidates.length > 0 && candidates.every((candidate) => current.has(candidate.id)) ? /* @__PURE__ */ new Set() : new Set((candidates ?? []).map((candidate) => candidate.id)));
|
|
2341
|
+
},
|
|
2342
|
+
onAdopt: () => adoptCandidates(),
|
|
2343
|
+
onCloseCandidates: closeCandidates
|
|
2344
|
+
}),
|
|
2345
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
2346
|
+
className: settings_card_module_css_default.field,
|
|
2347
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
2348
|
+
className: settings_card_module_css_default.label,
|
|
2349
|
+
children: [
|
|
2350
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
2351
|
+
type: "checkbox",
|
|
2352
|
+
checked: isDefault,
|
|
2353
|
+
disabled: !writable,
|
|
2354
|
+
onChange: (event) => setIsDefault(event.target.checked)
|
|
2355
|
+
}),
|
|
2356
|
+
" ",
|
|
2357
|
+
t("channel.default")
|
|
2358
|
+
]
|
|
2359
|
+
})
|
|
2360
|
+
}),
|
|
2361
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2362
|
+
className: settings_card_module_css_default.editorFooter,
|
|
2363
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2364
|
+
type: "button",
|
|
2365
|
+
className: settings_card_module_css_default.discard,
|
|
2366
|
+
onClick: props.onCancel,
|
|
2367
|
+
children: t("channel.cancel")
|
|
2368
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2369
|
+
type: "button",
|
|
2370
|
+
className: settings_card_module_css_default.save,
|
|
2371
|
+
onClick: save,
|
|
2372
|
+
children: t("channel.save")
|
|
2373
|
+
})]
|
|
2374
|
+
})
|
|
2375
|
+
]
|
|
2376
|
+
});
|
|
2377
|
+
}
|
|
2378
|
+
function ModelCatalog(props) {
|
|
2379
|
+
const { t, writable, models, discoverable, discovering, candidates, picked } = props;
|
|
2380
|
+
const allPicked = candidates !== null && candidates.length > 0 && candidates.every((candidate) => picked.has(candidate.id));
|
|
2381
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
2382
|
+
className: settings_card_module_css_default.modelCatalog,
|
|
2383
|
+
"aria-label": t("channel.modelsTitle"),
|
|
2384
|
+
children: [
|
|
2385
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2386
|
+
className: settings_card_module_css_default.modelCatalogHead,
|
|
2387
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2388
|
+
className: settings_card_module_css_default.modelCatalogTitle,
|
|
2389
|
+
children: t("channel.modelsTitle")
|
|
2390
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2391
|
+
className: settings_card_module_css_default.modelCatalogMeta,
|
|
2392
|
+
children: models.length > 0 ? tpl(t, "channel.modelsCount", { n: models.length }) : t("channel.modelsNone")
|
|
2393
|
+
})] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2394
|
+
type: "button",
|
|
2395
|
+
className: settings_card_module_css_default.linkButton,
|
|
2396
|
+
disabled: !writable || discovering || !discoverable,
|
|
2397
|
+
title: discoverable ? void 0 : t("channel.discoverNeedsUrlKey"),
|
|
2398
|
+
onClick: props.onDiscover,
|
|
2399
|
+
children: discovering ? t("channel.fetchingModels") : t("channel.fetchModels")
|
|
2400
|
+
})]
|
|
2401
|
+
}),
|
|
2402
|
+
models.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2403
|
+
className: settings_card_module_css_default.modelEmpty,
|
|
2404
|
+
children: t("channel.modelsEmpty")
|
|
2405
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
2406
|
+
className: settings_card_module_css_default.modelRows,
|
|
2407
|
+
children: models.map((model, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
2408
|
+
className: settings_card_module_css_default.modelRow,
|
|
2409
|
+
children: [
|
|
2410
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
2411
|
+
className: `${settings_card_module_css_default.input} ${settings_card_module_css_default.modelInput}`,
|
|
2412
|
+
type: "text",
|
|
2413
|
+
value: model.alias,
|
|
2414
|
+
placeholder: t("channel.modelAlias"),
|
|
2415
|
+
"aria-label": `${t("channel.modelAlias")} ${index + 1}`,
|
|
2416
|
+
disabled: !writable,
|
|
2417
|
+
onChange: (event) => props.onPatchModel(index, { alias: event.target.value })
|
|
2418
|
+
}),
|
|
2419
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2420
|
+
className: settings_card_module_css_default.modelArrow,
|
|
2421
|
+
"aria-hidden": "true",
|
|
2422
|
+
children: "→"
|
|
2423
|
+
}),
|
|
2424
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
2425
|
+
className: `${settings_card_module_css_default.input} ${settings_card_module_css_default.modelInput}`,
|
|
2426
|
+
type: "text",
|
|
2427
|
+
value: model.id,
|
|
2428
|
+
placeholder: t("channel.modelId"),
|
|
2429
|
+
"aria-label": `${t("channel.modelId")} ${index + 1}`,
|
|
2430
|
+
disabled: !writable,
|
|
2431
|
+
onChange: (event) => props.onPatchModel(index, { id: event.target.value })
|
|
2432
|
+
}),
|
|
2433
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("select", {
|
|
2434
|
+
className: `${settings_card_module_css_default.select} ${settings_card_module_css_default.modelCategorySelect}`,
|
|
2435
|
+
value: model.category ?? "",
|
|
2436
|
+
"aria-label": `${t("channel.modelCategory")} ${index + 1}`,
|
|
2437
|
+
disabled: !writable,
|
|
2438
|
+
onChange: (event) => {
|
|
2439
|
+
const value = event.target.value;
|
|
2440
|
+
props.onPatchModel(index, value === "" ? { category: void 0 } : { category: value });
|
|
2441
|
+
},
|
|
2442
|
+
children: MODEL_CATEGORIES.map((category) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
2443
|
+
value: category ?? "",
|
|
2444
|
+
children: category === void 0 ? t("channel.category.auto") : t(`channel.category.${category}`)
|
|
2445
|
+
}, category ?? "auto"))
|
|
2446
|
+
}),
|
|
2447
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2448
|
+
type: "button",
|
|
2449
|
+
className: settings_card_module_css_default.modelRowRemove,
|
|
2450
|
+
"aria-label": t("channel.removeModel"),
|
|
2451
|
+
disabled: !writable,
|
|
2452
|
+
onClick: () => props.onRemoveModel(index),
|
|
2453
|
+
children: "×"
|
|
2454
|
+
})
|
|
2455
|
+
]
|
|
2456
|
+
}, `${model.rowKey}-${index}`))
|
|
2457
|
+
}),
|
|
2458
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2459
|
+
className: settings_card_module_css_default.modelCatalogTools,
|
|
2460
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2461
|
+
type: "button",
|
|
2462
|
+
className: settings_card_module_css_default.addModel,
|
|
2463
|
+
disabled: !writable,
|
|
2464
|
+
onClick: props.onAddModel,
|
|
2465
|
+
children: t("channel.addModel")
|
|
2466
|
+
})
|
|
2467
|
+
}),
|
|
2468
|
+
props.sourceNote !== null && props.candidates !== null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2469
|
+
className: settings_card_module_css_default.detectOk,
|
|
2470
|
+
children: tpl(t, "channel.discoverSource", { source: props.sourceNote })
|
|
2471
|
+
}) : null,
|
|
2472
|
+
props.discoverError !== null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2473
|
+
className: settings_card_module_css_default.failed,
|
|
2474
|
+
children: props.discoverError
|
|
2475
|
+
}) : null,
|
|
2476
|
+
candidates === null ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2477
|
+
className: settings_card_module_css_default.candidatePanel,
|
|
2478
|
+
children: [
|
|
2479
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2480
|
+
className: settings_card_module_css_default.candidateHead,
|
|
2481
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2482
|
+
className: settings_card_module_css_default.candidateTitle,
|
|
2483
|
+
children: tpl(t, "channel.candidates", { n: candidates.length })
|
|
2484
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2485
|
+
type: "button",
|
|
2486
|
+
className: settings_card_module_css_default.linkButton,
|
|
2487
|
+
onClick: props.onToggleAllPicked,
|
|
2488
|
+
children: allPicked ? t("channel.clearSelection") : t("channel.selectAll")
|
|
2489
|
+
})]
|
|
2490
|
+
}),
|
|
2491
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
2492
|
+
className: settings_card_module_css_default.candidateList,
|
|
2493
|
+
children: candidates.map((candidate) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
|
|
2494
|
+
className: settings_card_module_css_default.candidate,
|
|
2495
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
2496
|
+
className: settings_card_module_css_default.candidateLabel,
|
|
2497
|
+
children: [
|
|
2498
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
2499
|
+
type: "checkbox",
|
|
2500
|
+
checked: picked.has(candidate.id),
|
|
2501
|
+
disabled: models.some((model) => model.id.trim() === candidate.id),
|
|
2502
|
+
onChange: () => props.onTogglePicked(candidate.id)
|
|
2503
|
+
}),
|
|
2504
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2505
|
+
className: settings_card_module_css_default.candidateId,
|
|
2506
|
+
children: candidate.alias === candidate.id ? candidate.id : `${candidate.alias}(${candidate.id})`
|
|
2507
|
+
}),
|
|
2508
|
+
candidate.category !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2509
|
+
className: settings_card_module_css_default.modelBadge,
|
|
2510
|
+
children: t(`channel.category.${candidate.category}`)
|
|
2511
|
+
}) : null
|
|
2512
|
+
]
|
|
2513
|
+
})
|
|
2514
|
+
}, candidate.id))
|
|
2515
|
+
}),
|
|
2516
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2517
|
+
className: settings_card_module_css_default.candidateActions,
|
|
2518
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2519
|
+
type: "button",
|
|
2520
|
+
className: settings_card_module_css_default.discard,
|
|
2521
|
+
onClick: props.onCloseCandidates,
|
|
2522
|
+
children: t("channel.cancel")
|
|
2523
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2524
|
+
type: "button",
|
|
2525
|
+
className: settings_card_module_css_default.save,
|
|
2526
|
+
onClick: props.onAdopt,
|
|
2527
|
+
children: tpl(t, "channel.adoptSelected", { n: Array.from(picked).length })
|
|
2528
|
+
})]
|
|
2529
|
+
})
|
|
2530
|
+
]
|
|
2531
|
+
})
|
|
2532
|
+
]
|
|
2533
|
+
});
|
|
2534
|
+
}
|
|
2535
|
+
function AudioGenSettingsCard(props) {
|
|
2536
|
+
const { t } = props;
|
|
2537
|
+
const state = props.useAudioGenSettingsCard((snapshot) => snapshot);
|
|
2538
|
+
const [open, setOpen] = (0, react.useState)(false);
|
|
2539
|
+
const [editor, setEditor] = (0, react.useState)(null);
|
|
2540
|
+
const [presets, setPresets] = (0, react.useState)([]);
|
|
2541
|
+
const [presetLoading, setPresetLoading] = (0, react.useState)(false);
|
|
2542
|
+
const [presetError, setPresetError] = (0, react.useState)(null);
|
|
2543
|
+
const [confirmDeleteId, setConfirmDeleteId] = (0, react.useState)(null);
|
|
2544
|
+
const channels = state.channels.channels;
|
|
2545
|
+
const editingChannel = editor !== null && editor.kind === "edit" ? channels.find((channel) => channel.id === editor.channelId) : void 0;
|
|
2546
|
+
(0, react.useEffect)(() => {
|
|
2547
|
+
if (editor?.kind === "add-provider" && presets.length === 0 && presetError === null && !presetLoading) {
|
|
2548
|
+
setPresetLoading(true);
|
|
2549
|
+
setPresetError(null);
|
|
2550
|
+
fetch(PRESETS_API, { method: "POST" }).then(async (response) => {
|
|
2551
|
+
const body = await response.json();
|
|
2552
|
+
if (!response.ok || body.ok !== true || body.presets === void 0) throw new Error(body.message ?? `HTTP ${response.status}`);
|
|
2553
|
+
setPresets(body.presets);
|
|
2554
|
+
}).catch((error) => setPresetError(error instanceof Error ? error.message : String(error))).finally(() => setPresetLoading(false));
|
|
2555
|
+
}
|
|
2556
|
+
}, [
|
|
2557
|
+
editor,
|
|
2558
|
+
presets.length,
|
|
2559
|
+
presetError,
|
|
2560
|
+
presetLoading
|
|
2561
|
+
]);
|
|
2562
|
+
if (!state.available) return null;
|
|
2563
|
+
const blocked = !state.dirty || state.invalid || state.saving || state.channels.saving;
|
|
2564
|
+
const closeEditor = () => {
|
|
2565
|
+
setEditor(null);
|
|
2566
|
+
};
|
|
2567
|
+
const saveEditor = (channel, key, isDefault) => {
|
|
2568
|
+
const next = channels.some((candidate) => candidate.id === channel.id) ? channels.map((candidate) => candidate.id === channel.id ? channel : candidate) : [...channels, channel];
|
|
2569
|
+
props.channels.setChannels(next);
|
|
2570
|
+
if (key !== void 0) props.channels.setChannelKey(channel.id, key);
|
|
2571
|
+
if (isDefault) props.channels.setDefaultChannel(channel.id);
|
|
2572
|
+
closeEditor();
|
|
2573
|
+
};
|
|
2574
|
+
const removeChannel = (channel) => {
|
|
2575
|
+
const isDefault = channel.id === state.channels.defaultChannelId;
|
|
2576
|
+
const next = channels.filter((candidate) => candidate.id !== channel.id);
|
|
2577
|
+
props.channels.setChannels(next);
|
|
2578
|
+
if (isDefault && next.length > 0) props.channels.setDefaultChannel(next[0].id);
|
|
2579
|
+
setConfirmDeleteId(null);
|
|
2580
|
+
if (editor?.kind === "edit" && editor.channelId === channel.id) closeEditor();
|
|
2581
|
+
};
|
|
2582
|
+
const openAddProvider = () => {
|
|
2583
|
+
setPresetError(null);
|
|
2584
|
+
setEditor({ kind: "add-provider" });
|
|
2585
|
+
};
|
|
2586
|
+
const openAddCustom = () => {
|
|
2587
|
+
setPresetError(null);
|
|
2588
|
+
setEditor({ kind: "add-custom" });
|
|
2589
|
+
};
|
|
1910
2590
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
1911
2591
|
className: settings_card_module_css_default.card,
|
|
1912
2592
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
@@ -1984,15 +2664,7 @@ window.__ModuleLoader__.load({
|
|
|
1984
2664
|
type: "button",
|
|
1985
2665
|
className: settings_card_module_css_default.channelDanger,
|
|
1986
2666
|
disabled: !state.writable,
|
|
1987
|
-
onClick: () =>
|
|
1988
|
-
props.channels.setChannels(channels.filter((candidate) => candidate.id !== channel.id));
|
|
1989
|
-
if (isDefault && channels.length > 1) {
|
|
1990
|
-
const next = channels.find((candidate) => candidate.id !== channel.id);
|
|
1991
|
-
if (next !== void 0) props.channels.setDefaultChannel(next.id);
|
|
1992
|
-
}
|
|
1993
|
-
setConfirmDeleteId(null);
|
|
1994
|
-
if (editingId === channel.id) setEditingId(null);
|
|
1995
|
-
},
|
|
2667
|
+
onClick: () => removeChannel(channel),
|
|
1996
2668
|
children: t("channels.confirm")
|
|
1997
2669
|
}),
|
|
1998
2670
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
@@ -2015,7 +2687,12 @@ window.__ModuleLoader__.load({
|
|
|
2015
2687
|
type: "button",
|
|
2016
2688
|
className: settings_card_module_css_default.channelMain,
|
|
2017
2689
|
disabled: !state.writable,
|
|
2018
|
-
onClick: () =>
|
|
2690
|
+
onClick: () => {
|
|
2691
|
+
setEditor({
|
|
2692
|
+
kind: "edit",
|
|
2693
|
+
channelId: channel.id
|
|
2694
|
+
});
|
|
2695
|
+
},
|
|
2019
2696
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2020
2697
|
className: settings_card_module_css_default.channelName,
|
|
2021
2698
|
children: isDefault ? `★ ${channel.name || t("channels.untitled")}` : channel.name || t("channels.untitled")
|
|
@@ -2038,7 +2715,12 @@ window.__ModuleLoader__.load({
|
|
|
2038
2715
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2039
2716
|
type: "button",
|
|
2040
2717
|
className: settings_card_module_css_default.channelAction,
|
|
2041
|
-
onClick: () =>
|
|
2718
|
+
onClick: () => {
|
|
2719
|
+
setEditor({
|
|
2720
|
+
kind: "edit",
|
|
2721
|
+
channelId: channel.id
|
|
2722
|
+
});
|
|
2723
|
+
},
|
|
2042
2724
|
children: t("channels.edit")
|
|
2043
2725
|
}),
|
|
2044
2726
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
@@ -2052,208 +2734,45 @@ window.__ModuleLoader__.load({
|
|
|
2052
2734
|
}, channel.id);
|
|
2053
2735
|
})
|
|
2054
2736
|
}),
|
|
2055
|
-
|
|
2056
|
-
className: settings_card_module_css_default.
|
|
2057
|
-
children:
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
children: t("presets.title")
|
|
2061
|
-
}),
|
|
2062
|
-
presetError !== null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2063
|
-
className: settings_card_module_css_default.failed,
|
|
2064
|
-
children: presetError
|
|
2065
|
-
}) : null,
|
|
2066
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2067
|
-
className: settings_card_module_css_default.channelAddRow,
|
|
2068
|
-
children: [
|
|
2069
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2070
|
-
type: "button",
|
|
2071
|
-
className: settings_card_module_css_default.channelAdd,
|
|
2072
|
-
onClick: () => {
|
|
2073
|
-
setPresets([]);
|
|
2074
|
-
setPresetError(null);
|
|
2075
|
-
fetch(PRESETS_API, { method: "POST" }).then(async (response) => {
|
|
2076
|
-
const body = await response.json();
|
|
2077
|
-
if (!response.ok || body.ok !== true || body.presets === void 0) throw new Error(body.message ?? `HTTP ${response.status}`);
|
|
2078
|
-
setPresets(body.presets);
|
|
2079
|
-
}).catch((error) => setPresetError(error instanceof Error ? error.message : String(error)));
|
|
2080
|
-
},
|
|
2081
|
-
children: t("channels.addProvider")
|
|
2082
|
-
}),
|
|
2083
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2084
|
-
type: "button",
|
|
2085
|
-
className: settings_card_module_css_default.channelAdd,
|
|
2086
|
-
onClick: () => {
|
|
2087
|
-
const draft = newChannelDraft(void 0, channels);
|
|
2088
|
-
props.channels.setChannels([...channels, draft]);
|
|
2089
|
-
setPresetPickerOpen(false);
|
|
2090
|
-
setEditingId(draft.id);
|
|
2091
|
-
},
|
|
2092
|
-
children: t("channels.addCustom")
|
|
2093
|
-
}),
|
|
2094
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2095
|
-
type: "button",
|
|
2096
|
-
className: settings_card_module_css_default.channelAction,
|
|
2097
|
-
onClick: () => setPresetPickerOpen(false),
|
|
2098
|
-
children: "×"
|
|
2099
|
-
})
|
|
2100
|
-
]
|
|
2101
|
-
}),
|
|
2102
|
-
presets.map((preset) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
2103
|
-
type: "button",
|
|
2104
|
-
className: settings_card_module_css_default.channelAdd,
|
|
2105
|
-
onClick: () => {
|
|
2106
|
-
const draft = newChannelDraft(preset, channels);
|
|
2107
|
-
props.channels.setChannels([...channels, draft]);
|
|
2108
|
-
setPresetPickerOpen(false);
|
|
2109
|
-
setEditingId(draft.id);
|
|
2110
|
-
},
|
|
2111
|
-
children: [
|
|
2112
|
-
preset.name,
|
|
2113
|
-
" — ",
|
|
2114
|
-
preset.hint
|
|
2115
|
-
]
|
|
2116
|
-
}, preset.id))
|
|
2117
|
-
]
|
|
2118
|
-
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2737
|
+
presetError !== null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2738
|
+
className: settings_card_module_css_default.failed,
|
|
2739
|
+
children: presetError
|
|
2740
|
+
}) : null,
|
|
2741
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2119
2742
|
className: settings_card_module_css_default.channelAddRow,
|
|
2120
2743
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2121
2744
|
type: "button",
|
|
2122
2745
|
className: settings_card_module_css_default.channelAdd,
|
|
2123
2746
|
disabled: !state.writable,
|
|
2124
|
-
onClick:
|
|
2125
|
-
|
|
2126
|
-
setPresetPickerOpen(true);
|
|
2127
|
-
},
|
|
2128
|
-
children: t("channels.addProvider")
|
|
2747
|
+
onClick: openAddProvider,
|
|
2748
|
+
children: presetLoading ? t("channels.addProviderLoading") : t("channels.addProvider")
|
|
2129
2749
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2130
2750
|
type: "button",
|
|
2131
2751
|
className: settings_card_module_css_default.channelAdd,
|
|
2132
2752
|
disabled: !state.writable,
|
|
2133
|
-
onClick:
|
|
2134
|
-
const draft = newChannelDraft(void 0, channels);
|
|
2135
|
-
props.channels.setChannels([...channels, draft]);
|
|
2136
|
-
setEditingId(draft.id);
|
|
2137
|
-
},
|
|
2753
|
+
onClick: openAddCustom,
|
|
2138
2754
|
children: t("channels.addCustom")
|
|
2139
2755
|
})]
|
|
2140
|
-
})
|
|
2141
|
-
]
|
|
2142
|
-
}),
|
|
2143
|
-
editing !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2144
|
-
className: settings_card_module_css_default.body,
|
|
2145
|
-
children: [
|
|
2146
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2147
|
-
className: settings_card_module_css_default.field,
|
|
2148
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
2149
|
-
className: settings_card_module_css_default.label,
|
|
2150
|
-
htmlFor: `audiogen-name-${editing.id}`,
|
|
2151
|
-
children: t("channel.name")
|
|
2152
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
2153
|
-
id: `audiogen-name-${editing.id}`,
|
|
2154
|
-
className: settings_card_module_css_default.input,
|
|
2155
|
-
value: editName,
|
|
2156
|
-
onChange: (event) => setEditName(event.target.value)
|
|
2157
|
-
})]
|
|
2158
|
-
}),
|
|
2159
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2160
|
-
className: settings_card_module_css_default.field,
|
|
2161
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
2162
|
-
className: settings_card_module_css_default.label,
|
|
2163
|
-
htmlFor: `audiogen-url-${editing.id}`,
|
|
2164
|
-
children: t("channel.apiUrl")
|
|
2165
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
2166
|
-
id: `audiogen-url-${editing.id}`,
|
|
2167
|
-
className: settings_card_module_css_default.input,
|
|
2168
|
-
value: editUrl,
|
|
2169
|
-
onChange: (event) => setEditUrl(event.target.value),
|
|
2170
|
-
placeholder: "https://…"
|
|
2171
|
-
})]
|
|
2172
|
-
}),
|
|
2173
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2174
|
-
className: settings_card_module_css_default.field,
|
|
2175
|
-
children: [
|
|
2176
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
2177
|
-
className: settings_card_module_css_default.label,
|
|
2178
|
-
htmlFor: `audiogen-key-${editing.id}`,
|
|
2179
|
-
children: t("channel.apiKey")
|
|
2180
|
-
}),
|
|
2181
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
2182
|
-
id: `audiogen-key-${editing.id}`,
|
|
2183
|
-
className: settings_card_module_css_default.input,
|
|
2184
|
-
type: "password",
|
|
2185
|
-
value: editKey,
|
|
2186
|
-
onChange: (event) => setEditKey(event.target.value),
|
|
2187
|
-
placeholder: state.channels.keySet[editing.id] ? "••••••" : ""
|
|
2188
|
-
}),
|
|
2189
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2190
|
-
className: settings_card_module_css_default.sectionHint,
|
|
2191
|
-
children: t("channel.apiKeyHint")
|
|
2192
|
-
})
|
|
2193
|
-
]
|
|
2194
|
-
}),
|
|
2195
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2196
|
-
className: settings_card_module_css_default.field,
|
|
2197
|
-
children: [
|
|
2198
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
2199
|
-
className: settings_card_module_css_default.label,
|
|
2200
|
-
htmlFor: `audiogen-models-${editing.id}`,
|
|
2201
|
-
children: t("channel.models")
|
|
2202
|
-
}),
|
|
2203
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
|
|
2204
|
-
id: `audiogen-models-${editing.id}`,
|
|
2205
|
-
className: settings_card_module_css_default.textarea,
|
|
2206
|
-
value: editModels,
|
|
2207
|
-
onChange: (event) => setEditModels(event.target.value)
|
|
2208
|
-
}),
|
|
2209
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2210
|
-
className: settings_card_module_css_default.sectionHint,
|
|
2211
|
-
children: t("channel.modelsHint")
|
|
2212
|
-
}),
|
|
2213
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2214
|
-
className: settings_card_module_css_default.channelAddRow,
|
|
2215
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2216
|
-
type: "button",
|
|
2217
|
-
className: settings_card_module_css_default.channelAdd,
|
|
2218
|
-
disabled: discovering || !state.writable,
|
|
2219
|
-
onClick: () => void discoverModels(),
|
|
2220
|
-
children: discovering ? "获取中…" : "获取可用模型"
|
|
2221
|
-
})
|
|
2222
|
-
}),
|
|
2223
|
-
discoverError !== null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2224
|
-
className: settings_card_module_css_default.failed,
|
|
2225
|
-
children: discoverError
|
|
2226
|
-
}) : null
|
|
2227
|
-
]
|
|
2228
2756
|
}),
|
|
2229
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
2230
|
-
className: settings_card_module_css_default.
|
|
2231
|
-
children:
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
onClick: () => setEditingId(null),
|
|
2247
|
-
children: t("channel.cancel")
|
|
2248
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2249
|
-
type: "button",
|
|
2250
|
-
className: settings_card_module_css_default.save,
|
|
2251
|
-
onClick: saveEdit,
|
|
2252
|
-
children: t("channel.save")
|
|
2253
|
-
})]
|
|
2254
|
-
})
|
|
2757
|
+
editor !== null ? editor.kind === "add-provider" && presets.length === 0 && presetError === null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2758
|
+
className: settings_card_module_css_default.sectionHint,
|
|
2759
|
+
children: presetLoading ? t("channels.addProviderLoading") : t("channels.addProviderFailed")
|
|
2760
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2761
|
+
className: settings_card_module_css_default.editorWrap,
|
|
2762
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChannelEditor, {
|
|
2763
|
+
t,
|
|
2764
|
+
writable: state.writable,
|
|
2765
|
+
mode: editor,
|
|
2766
|
+
channel: editingChannel,
|
|
2767
|
+
keyHeld: editor.kind === "edit" ? state.channels.keySet[editor.channelId] === true : false,
|
|
2768
|
+
presets,
|
|
2769
|
+
initiallyDefault: editor.kind === "edit" ? editor.channelId === state.channels.defaultChannelId : channels.length === 0,
|
|
2770
|
+
onCancel: closeEditor,
|
|
2771
|
+
onSave: saveEditor
|
|
2772
|
+
}, editor.kind === "edit" ? `edit-${editor.channelId}` : editor.kind)
|
|
2773
|
+
}) : null
|
|
2255
2774
|
]
|
|
2256
|
-
})
|
|
2775
|
+
}),
|
|
2257
2776
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2258
2777
|
className: settings_card_module_css_default.field,
|
|
2259
2778
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
@@ -2344,17 +2863,17 @@ window.__ModuleLoader__.load({
|
|
|
2344
2863
|
document.head.appendChild(tag);
|
|
2345
2864
|
}
|
|
2346
2865
|
var audio_toolview_module_css_default = {
|
|
2866
|
+
"audioRow": "_7K1QKa_audioRow",
|
|
2867
|
+
"status": "_7K1QKa_status",
|
|
2868
|
+
"audio": "_7K1QKa_audio",
|
|
2347
2869
|
"message": "_7K1QKa_message",
|
|
2348
|
-
"audios": "_7K1QKa_audios",
|
|
2349
2870
|
"download": "_7K1QKa_download",
|
|
2350
|
-
"
|
|
2871
|
+
"audios": "_7K1QKa_audios",
|
|
2351
2872
|
"error": "_7K1QKa_error",
|
|
2352
|
-
"
|
|
2353
|
-
"header": "_7K1QKa_header",
|
|
2354
|
-
"audioRow": "_7K1QKa_audioRow",
|
|
2355
|
-
"empty": "_7K1QKa_empty",
|
|
2873
|
+
"icon": "_7K1QKa_icon",
|
|
2356
2874
|
"root": "_7K1QKa_root",
|
|
2357
|
-
"
|
|
2875
|
+
"header": "_7K1QKa_header",
|
|
2876
|
+
"empty": "_7K1QKa_empty"
|
|
2358
2877
|
};
|
|
2359
2878
|
//#endregion
|
|
2360
2879
|
//#region src/client/audio-toolview.tsx
|