@nextclaw/ui 0.6.11 → 0.6.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/assets/ChannelsList-DBDjwf-X.js +1 -0
  3. package/dist/assets/{ChatPage-DIx05c6s.js → ChatPage-C18sGGk1.js} +1 -1
  4. package/dist/assets/DocBrowser-ZOplDEMS.js +1 -0
  5. package/dist/assets/LogoBadge-2LMzEMwe.js +1 -0
  6. package/dist/assets/{MarketplacePage-BOzko5s9.js → MarketplacePage-D4JHYcB5.js} +2 -2
  7. package/dist/assets/ModelConfig-DZVvdLFq.js +1 -0
  8. package/dist/assets/ProvidersList-Dum31480.js +1 -0
  9. package/dist/assets/{RuntimeConfig-Dt9pLB9P.js → RuntimeConfig-4sb3mpkd.js} +1 -1
  10. package/dist/assets/SearchConfig-B4u_MxRG.js +1 -0
  11. package/dist/assets/{SecretsConfig-C1PU0Yy8.js → SecretsConfig-BQXblZvb.js} +2 -2
  12. package/dist/assets/SessionsConfig-Jk29xjQU.js +2 -0
  13. package/dist/assets/{card-C7Gtw2Vs.js → card-BekAnCgX.js} +1 -1
  14. package/dist/assets/config-layout-BHnOoweL.js +1 -0
  15. package/dist/assets/{index-nEYGCJTC.css → index-BXwjfCEO.css} +1 -1
  16. package/dist/assets/index-Dl6t70wA.js +8 -0
  17. package/dist/assets/{input-oBvxsnV9.js → input-MMn_Na9q.js} +1 -1
  18. package/dist/assets/{label-C7F8lMpQ.js → label-Dg2ydpN0.js} +1 -1
  19. package/dist/assets/{page-layout-DO8BlScF.js → page-layout-7K0rcz0I.js} +1 -1
  20. package/dist/assets/{session-run-status-Kg0FwAPn.js → session-run-status-CAdjSqeb.js} +1 -1
  21. package/dist/assets/{switch-C6a5GyZB.js → switch-DnDMlDVu.js} +1 -1
  22. package/dist/assets/{tabs-custom-BatFap5k.js → tabs-custom-khLM8lWj.js} +1 -1
  23. package/dist/assets/{useConfirmDialog-zJzVKMdu.js → useConfirmDialog-BYA1XnVU.js} +1 -1
  24. package/dist/assets/{vendor-TlME1INH.js → vendor-d7E8OgNx.js} +1 -1
  25. package/dist/index.html +3 -3
  26. package/package.json +1 -1
  27. package/src/App.tsx +2 -0
  28. package/src/api/config.ts +13 -0
  29. package/src/api/types.ts +57 -0
  30. package/src/components/config/SearchConfig.tsx +297 -0
  31. package/src/components/layout/Sidebar.tsx +6 -1
  32. package/src/hooks/useConfig.ts +17 -0
  33. package/src/lib/i18n.ts +22 -0
  34. package/dist/assets/ChannelsList-C49JQ-Zt.js +0 -1
  35. package/dist/assets/DocBrowser-CpOosDEI.js +0 -1
  36. package/dist/assets/LogoBadge-CL_8ZPXU.js +0 -1
  37. package/dist/assets/ModelConfig-BZ4ZfaQB.js +0 -1
  38. package/dist/assets/ProvidersList-fPpJ5gl6.js +0 -1
  39. package/dist/assets/SessionsConfig-EskBOofQ.js +0 -2
  40. package/dist/assets/index-Cn6_2To7.js +0 -8
package/src/api/types.ts CHANGED
@@ -74,6 +74,52 @@ export type ProviderConnectionTestResult = {
74
74
  hint?: string;
75
75
  };
76
76
 
77
+ export type SearchProviderName = "bocha" | "brave";
78
+ export type BochaFreshnessValue = "noLimit" | "oneDay" | "oneWeek" | "oneMonth" | "oneYear" | string;
79
+
80
+ export type SearchProviderConfigView = {
81
+ enabled: boolean;
82
+ apiKeySet: boolean;
83
+ apiKeyMasked?: string;
84
+ baseUrl: string;
85
+ docsUrl?: string;
86
+ summary?: boolean;
87
+ freshness?: BochaFreshnessValue;
88
+ };
89
+
90
+ export type SearchConfigView = {
91
+ provider: SearchProviderName;
92
+ enabledProviders: SearchProviderName[];
93
+ defaults: {
94
+ maxResults: number;
95
+ };
96
+ providers: {
97
+ bocha: SearchProviderConfigView;
98
+ brave: SearchProviderConfigView;
99
+ };
100
+ };
101
+
102
+ export type SearchConfigUpdate = {
103
+ provider?: SearchProviderName;
104
+ enabledProviders?: SearchProviderName[];
105
+ defaults?: {
106
+ maxResults?: number;
107
+ };
108
+ providers?: {
109
+ bocha?: {
110
+ apiKey?: string | null;
111
+ baseUrl?: string | null;
112
+ docsUrl?: string | null;
113
+ summary?: boolean;
114
+ freshness?: BochaFreshnessValue | null;
115
+ };
116
+ brave?: {
117
+ apiKey?: string | null;
118
+ baseUrl?: string | null;
119
+ };
120
+ };
121
+ };
122
+
77
123
  export type ProviderAuthStartResult = {
78
124
  provider: string;
79
125
  kind: "device_code";
@@ -445,6 +491,7 @@ export type ConfigView = {
445
491
  };
446
492
  };
447
493
  providers: Record<string, ProviderConfigView>;
494
+ search: SearchConfigView;
448
495
  channels: Record<string, Record<string, unknown>>;
449
496
  bindings?: AgentBindingView[];
450
497
  session?: SessionConfigView;
@@ -507,8 +554,18 @@ export type ChannelSpecView = {
507
554
  };
508
555
  };
509
556
 
557
+ export type SearchProviderSpecView = {
558
+ name: SearchProviderName;
559
+ displayName: string;
560
+ description: string;
561
+ docsUrl?: string;
562
+ isDefault?: boolean;
563
+ supportsSummary?: boolean;
564
+ };
565
+
510
566
  export type ConfigMetaView = {
511
567
  providers: ProviderSpecView[];
568
+ search: SearchProviderSpecView[];
512
569
  channels: ChannelSpecView[];
513
570
  };
514
571
 
@@ -0,0 +1,297 @@
1
+ import { useEffect, useMemo, useState } from 'react';
2
+ import { ExternalLink, KeyRound, Search as SearchIcon } from 'lucide-react';
3
+ import { PageHeader, PageLayout } from '@/components/layout/page-layout';
4
+ import { Button } from '@/components/ui/button';
5
+ import { Input } from '@/components/ui/input';
6
+ import { Label } from '@/components/ui/label';
7
+ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
8
+ import { useConfig, useConfigMeta, useUpdateSearch } from '@/hooks/useConfig';
9
+ import { t } from '@/lib/i18n';
10
+ import { cn } from '@/lib/utils';
11
+ import { CONFIG_DETAIL_CARD_CLASS, CONFIG_SIDEBAR_CARD_CLASS, CONFIG_SPLIT_GRID_CLASS } from './config-layout';
12
+ import type { SearchConfigUpdate, SearchProviderName } from '@/api/types';
13
+
14
+ const FRESHNESS_OPTIONS = [
15
+ { value: 'noLimit', label: 'searchFreshnessNoLimit' },
16
+ { value: 'oneDay', label: 'searchFreshnessOneDay' },
17
+ { value: 'oneWeek', label: 'searchFreshnessOneWeek' },
18
+ { value: 'oneMonth', label: 'searchFreshnessOneMonth' },
19
+ { value: 'oneYear', label: 'searchFreshnessOneYear' }
20
+ ] as const;
21
+
22
+ export function SearchConfig() {
23
+ const { data: config } = useConfig();
24
+ const { data: meta } = useConfigMeta();
25
+ const updateSearch = useUpdateSearch();
26
+ const providers = meta?.search ?? [];
27
+ const search = config?.search;
28
+
29
+ const [selectedProvider, setSelectedProvider] = useState<SearchProviderName>('bocha');
30
+ const [activeProvider, setActiveProvider] = useState<SearchProviderName>('bocha');
31
+ const [enabledProviders, setEnabledProviders] = useState<SearchProviderName[]>(['bocha']);
32
+ const [maxResults, setMaxResults] = useState('10');
33
+ const [bochaApiKey, setBochaApiKey] = useState('');
34
+ const [bochaBaseUrl, setBochaBaseUrl] = useState('https://api.bocha.cn/v1/web-search');
35
+ const [bochaSummary, setBochaSummary] = useState(true);
36
+ const [bochaFreshness, setBochaFreshness] = useState('noLimit');
37
+ const [braveApiKey, setBraveApiKey] = useState('');
38
+ const [braveBaseUrl, setBraveBaseUrl] = useState('https://api.search.brave.com/res/v1/web/search');
39
+
40
+ useEffect(() => {
41
+ if (!search) {
42
+ return;
43
+ }
44
+ setSelectedProvider(search.provider);
45
+ setActiveProvider(search.provider);
46
+ setEnabledProviders(search.enabledProviders);
47
+ setMaxResults(String(search.defaults.maxResults));
48
+ setBochaBaseUrl(search.providers.bocha.baseUrl);
49
+ setBochaSummary(Boolean(search.providers.bocha.summary));
50
+ setBochaFreshness(search.providers.bocha.freshness ?? 'noLimit');
51
+ setBraveBaseUrl(search.providers.brave.baseUrl);
52
+ }, [search]);
53
+
54
+ const selectedMeta = useMemo(
55
+ () => providers.find((provider) => provider.name === selectedProvider),
56
+ [providers, selectedProvider]
57
+ );
58
+ const selectedView = search?.providers[selectedProvider];
59
+ const selectedEnabled = enabledProviders.includes(selectedProvider);
60
+ const bochaDocsUrl = search?.providers.bocha.docsUrl ?? meta?.search.find((provider) => provider.name === 'bocha')?.docsUrl ?? 'https://open.bocha.cn';
61
+ const activationButtonLabel = selectedEnabled
62
+ ? t('searchProviderDeactivate')
63
+ : t('searchProviderActivate');
64
+
65
+ const buildSearchPayload = (
66
+ nextEnabledProviders: SearchProviderName[] = enabledProviders,
67
+ nextActiveProvider: SearchProviderName = activeProvider
68
+ ): SearchConfigUpdate => ({
69
+ provider: nextActiveProvider,
70
+ enabledProviders: nextEnabledProviders,
71
+ defaults: {
72
+ maxResults: Number(maxResults) || 10
73
+ },
74
+ providers: {
75
+ bocha: {
76
+ apiKey: bochaApiKey || undefined,
77
+ baseUrl: bochaBaseUrl,
78
+ summary: bochaSummary,
79
+ freshness: bochaFreshness
80
+ },
81
+ brave: {
82
+ apiKey: braveApiKey || undefined,
83
+ baseUrl: braveBaseUrl
84
+ }
85
+ }
86
+ });
87
+
88
+ const handleToggleEnabled = () => {
89
+ const nextEnabledProviders = selectedEnabled
90
+ ? enabledProviders.filter((provider) => provider !== selectedProvider)
91
+ : [...enabledProviders, selectedProvider];
92
+ setEnabledProviders(nextEnabledProviders);
93
+ updateSearch.mutate({
94
+ data: buildSearchPayload(nextEnabledProviders)
95
+ });
96
+ };
97
+
98
+ const handleActiveProviderChange = (value: string) => {
99
+ setActiveProvider(value as SearchProviderName);
100
+ };
101
+
102
+ const handleSubmit = (event: React.FormEvent) => {
103
+ event.preventDefault();
104
+ updateSearch.mutate({
105
+ data: buildSearchPayload()
106
+ });
107
+ };
108
+
109
+ if (!search || providers.length === 0) {
110
+ return <div className="p-8">{t('loading')}</div>;
111
+ }
112
+
113
+ return (
114
+ <PageLayout>
115
+ <PageHeader title={t('searchPageTitle')} description={t('searchPageDescription')} />
116
+
117
+ <div className={CONFIG_SPLIT_GRID_CLASS}>
118
+ <section className={CONFIG_SIDEBAR_CARD_CLASS}>
119
+ <div className="border-b border-gray-100 px-4 py-4">
120
+ <p className="text-xs font-semibold uppercase tracking-[0.16em] text-gray-500">{t('searchChannels')}</p>
121
+ </div>
122
+ <div className="min-h-0 flex-1 space-y-2 overflow-y-auto p-3">
123
+ {providers.map((provider) => {
124
+ const providerView = search.providers[provider.name];
125
+ const isEnabled = enabledProviders.includes(provider.name);
126
+ const isSelected = selectedProvider === provider.name;
127
+ return (
128
+ <button
129
+ key={provider.name}
130
+ type="button"
131
+ onClick={() => setSelectedProvider(provider.name)}
132
+ className={cn(
133
+ 'w-full rounded-xl border p-3 text-left transition-all',
134
+ isSelected
135
+ ? 'border-primary/30 bg-primary-50/40 shadow-sm'
136
+ : 'border-gray-200/70 bg-white hover:border-gray-300 hover:bg-gray-50/70'
137
+ )}
138
+ >
139
+ <div className="flex items-start justify-between gap-3">
140
+ <div className="min-w-0">
141
+ <p className="truncate text-sm font-semibold text-gray-900">{provider.displayName}</p>
142
+ <p className="line-clamp-2 text-[11px] text-gray-500">
143
+ {provider.name === 'bocha' ? t('searchProviderBochaDescription') : t('searchProviderBraveDescription')}
144
+ </p>
145
+ </div>
146
+ <div className="flex flex-col items-end gap-1">
147
+ <span className="rounded-full bg-gray-100 px-2 py-0.5 text-[11px] font-medium text-gray-600">
148
+ {providerView.apiKeySet ? t('searchStatusConfigured') : t('searchStatusNeedsSetup')}
149
+ </span>
150
+ {isEnabled ? (
151
+ <span className="rounded-full bg-emerald-50 px-2 py-0.5 text-[11px] font-medium text-emerald-700">
152
+ {t('searchProviderActivated')}
153
+ </span>
154
+ ) : null}
155
+ </div>
156
+ </div>
157
+ </button>
158
+ );
159
+ })}
160
+ </div>
161
+ </section>
162
+
163
+ <form onSubmit={handleSubmit} className={cn(CONFIG_DETAIL_CARD_CLASS, 'p-6')}>
164
+ {!selectedMeta || !selectedView ? (
165
+ <div className="flex h-full items-center justify-center text-sm text-gray-500">{t('searchNoProviderSelected')}</div>
166
+ ) : (
167
+ <div className="space-y-6 overflow-y-auto">
168
+ <div className="flex items-start justify-between gap-4">
169
+ <div className="flex items-center gap-3">
170
+ <div className="flex h-10 w-10 items-center justify-center rounded-xl bg-primary text-white">
171
+ <SearchIcon className="h-5 w-5" />
172
+ </div>
173
+ <div>
174
+ <h3 className="text-lg font-semibold text-gray-900">{selectedMeta.displayName}</h3>
175
+ <p className="text-sm text-gray-500">{selectedMeta.description}</p>
176
+ </div>
177
+ </div>
178
+ <Button
179
+ type="button"
180
+ variant={selectedEnabled ? 'secondary' : 'outline'}
181
+ className="rounded-xl"
182
+ onClick={handleToggleEnabled}
183
+ >
184
+ {activationButtonLabel}
185
+ </Button>
186
+ </div>
187
+
188
+ <div className="grid gap-4 md:grid-cols-2">
189
+ <div className="space-y-2">
190
+ <Label>{t('searchActiveProvider')}</Label>
191
+ <Select value={activeProvider} onValueChange={handleActiveProviderChange}>
192
+ <SelectTrigger className="rounded-xl">
193
+ <SelectValue />
194
+ </SelectTrigger>
195
+ <SelectContent>
196
+ {providers.map((provider) => (
197
+ <SelectItem key={provider.name} value={provider.name}>{provider.displayName}</SelectItem>
198
+ ))}
199
+ </SelectContent>
200
+ </Select>
201
+ </div>
202
+
203
+ <div className="space-y-2">
204
+ <Label>{t('searchDefaultMaxResults')}</Label>
205
+ <Input
206
+ value={maxResults}
207
+ onChange={(event) => setMaxResults(event.target.value)}
208
+ inputMode="numeric"
209
+ className="rounded-xl"
210
+ />
211
+ </div>
212
+ </div>
213
+
214
+ {selectedProvider === 'bocha' ? (
215
+ <div className="space-y-4">
216
+ <div className="space-y-2">
217
+ <Label>{t('apiKey')}</Label>
218
+ <Input
219
+ type="password"
220
+ value={bochaApiKey}
221
+ onChange={(event) => setBochaApiKey(event.target.value)}
222
+ placeholder={search.providers.bocha.apiKeyMasked || t('enterApiKey')}
223
+ className="rounded-xl"
224
+ />
225
+ </div>
226
+ <div className="space-y-2">
227
+ <Label>{t('searchProviderBaseUrl')}</Label>
228
+ <Input value={bochaBaseUrl} onChange={(event) => setBochaBaseUrl(event.target.value)} className="rounded-xl" />
229
+ </div>
230
+ <div className="grid gap-4 md:grid-cols-2">
231
+ <div className="space-y-2">
232
+ <Label>{t('searchProviderSummary')}</Label>
233
+ <Select value={bochaSummary ? 'true' : 'false'} onValueChange={(value) => setBochaSummary(value === 'true')}>
234
+ <SelectTrigger className="rounded-xl">
235
+ <SelectValue />
236
+ </SelectTrigger>
237
+ <SelectContent>
238
+ <SelectItem value="true">{t('enabled')}</SelectItem>
239
+ <SelectItem value="false">{t('disabled')}</SelectItem>
240
+ </SelectContent>
241
+ </Select>
242
+ </div>
243
+ <div className="space-y-2">
244
+ <Label>{t('searchProviderFreshness')}</Label>
245
+ <Select value={bochaFreshness} onValueChange={setBochaFreshness}>
246
+ <SelectTrigger className="rounded-xl">
247
+ <SelectValue />
248
+ </SelectTrigger>
249
+ <SelectContent>
250
+ {FRESHNESS_OPTIONS.map((option) => (
251
+ <SelectItem key={option.value} value={option.value}>{t(option.label)}</SelectItem>
252
+ ))}
253
+ </SelectContent>
254
+ </Select>
255
+ </div>
256
+ </div>
257
+ <div className="space-y-2">
258
+ <a href={bochaDocsUrl} target="_blank" rel="noreferrer">
259
+ <Button type="button" variant="outline" className="rounded-xl">
260
+ <ExternalLink className="mr-2 h-4 w-4" />
261
+ {t('searchProviderOpenDocs')}
262
+ </Button>
263
+ </a>
264
+ </div>
265
+ </div>
266
+ ) : (
267
+ <div className="space-y-4">
268
+ <div className="space-y-2">
269
+ <Label>{t('apiKey')}</Label>
270
+ <Input
271
+ type="password"
272
+ value={braveApiKey}
273
+ onChange={(event) => setBraveApiKey(event.target.value)}
274
+ placeholder={search.providers.brave.apiKeyMasked || t('enterApiKey')}
275
+ className="rounded-xl"
276
+ />
277
+ </div>
278
+ <div className="space-y-2">
279
+ <Label>{t('searchProviderBaseUrl')}</Label>
280
+ <Input value={braveBaseUrl} onChange={(event) => setBraveBaseUrl(event.target.value)} className="rounded-xl" />
281
+ </div>
282
+ </div>
283
+ )}
284
+
285
+ <div className="flex justify-end">
286
+ <Button type="submit" disabled={updateSearch.isPending}>
287
+ <KeyRound className="mr-2 h-4 w-4" />
288
+ {updateSearch.isPending ? t('saving') : t('saveChanges')}
289
+ </Button>
290
+ </div>
291
+ </div>
292
+ )}
293
+ </form>
294
+ </div>
295
+ </PageLayout>
296
+ );
297
+ }
@@ -1,7 +1,7 @@
1
1
  import { cn } from '@/lib/utils';
2
2
  import { LANGUAGE_OPTIONS, t, type I18nLanguage } from '@/lib/i18n';
3
3
  import { THEME_OPTIONS, type UiTheme } from '@/lib/theme';
4
- import { Cpu, GitBranch, History, MessageCircle, MessageSquare, Sparkles, BookOpen, Plug, BrainCircuit, AlarmClock, Languages, Palette, KeyRound, Settings, ArrowLeft } from 'lucide-react';
4
+ import { Cpu, GitBranch, History, MessageCircle, MessageSquare, Sparkles, BookOpen, Plug, BrainCircuit, AlarmClock, Languages, Palette, KeyRound, Settings, ArrowLeft, Search } from 'lucide-react';
5
5
  import { NavLink } from 'react-router-dom';
6
6
  import { useDocBrowser } from '@/components/doc-browser';
7
7
  import { BrandHeader } from '@/components/common/BrandHeader';
@@ -67,6 +67,11 @@ export function Sidebar({ mode }: SidebarProps) {
67
67
  label: t('providers'),
68
68
  icon: Sparkles,
69
69
  },
70
+ {
71
+ target: '/search',
72
+ label: t('searchChannels'),
73
+ icon: Search,
74
+ },
70
75
  {
71
76
  target: '/channels',
72
77
  label: t('channels'),
@@ -5,6 +5,7 @@ import {
5
5
  fetchConfigMeta,
6
6
  fetchConfigSchema,
7
7
  updateModel,
8
+ updateSearch,
8
9
  createProvider,
9
10
  deleteProvider,
10
11
  updateProvider,
@@ -81,6 +82,22 @@ export function useUpdateModel() {
81
82
  });
82
83
  }
83
84
 
85
+ export function useUpdateSearch() {
86
+ const queryClient = useQueryClient();
87
+
88
+ return useMutation({
89
+ mutationFn: ({ data }: { data: Parameters<typeof updateSearch>[0] }) => updateSearch(data),
90
+ onSuccess: () => {
91
+ queryClient.invalidateQueries({ queryKey: ['config'] });
92
+ queryClient.invalidateQueries({ queryKey: ['config-meta'] });
93
+ toast.success(t('configSavedApplied'));
94
+ },
95
+ onError: (error: Error) => {
96
+ toast.error(t('configSaveFailed') + ': ' + error.message);
97
+ }
98
+ });
99
+ }
100
+
84
101
  export function useUpdateProvider() {
85
102
  const queryClient = useQueryClient();
86
103
 
package/src/lib/i18n.ts CHANGED
@@ -125,6 +125,7 @@ export const LABELS: Record<string, { zh: string; en: string }> = {
125
125
  // Navigation
126
126
  chat: { zh: '对话', en: 'Chat' },
127
127
  model: { zh: '模型', en: 'Model' },
128
+ searchChannels: { zh: '搜索渠道', en: 'Search Channels' },
128
129
  providers: { zh: '提供商', en: 'Providers' },
129
130
  channels: { zh: '渠道', en: 'Channels' },
130
131
  cron: { zh: '定时任务', en: 'Cron Jobs' },
@@ -182,6 +183,27 @@ export const LABELS: Record<string, { zh: string; en: string }> = {
182
183
  saveChanges: { zh: '保存变更', en: 'Save Changes' },
183
184
 
184
185
  // Provider
186
+ searchPageTitle: { zh: '搜索渠道', en: 'Search Channels' },
187
+ searchPageDescription: { zh: '配置网页搜索提供商', en: 'Configure web search providers.' },
188
+ searchActiveProvider: { zh: '当前搜索提供商', en: 'Active Search Provider' },
189
+ searchDefaultMaxResults: { zh: '默认返回条数', en: 'Default Result Count' },
190
+ searchProviderSummary: { zh: '结果摘要', en: 'Result Summary' },
191
+ searchProviderFreshness: { zh: '时间范围', en: 'Freshness' },
192
+ searchProviderBaseUrl: { zh: '接口地址', en: 'API Base URL' },
193
+ searchProviderOpenDocs: { zh: '获取博查 API', en: 'Get Bocha API' },
194
+ searchProviderActivate: { zh: '激活', en: 'Activate' },
195
+ searchProviderActivated: { zh: '已激活', en: 'Activated' },
196
+ searchProviderDeactivate: { zh: '取消激活', en: 'Deactivate' },
197
+ searchProviderBochaDescription: { zh: '更适合中国大陆用户的 AI 搜索。', en: 'AI-ready search that works better for mainland China users.' },
198
+ searchProviderBraveDescription: { zh: '保留 Brave 作为可选 provider。', en: 'Keep Brave as an optional provider.' },
199
+ searchStatusConfigured: { zh: '已配置', en: 'Configured' },
200
+ searchStatusNeedsSetup: { zh: '待配置', en: 'Needs Setup' },
201
+ searchFreshnessNoLimit: { zh: '不限', en: 'No Limit' },
202
+ searchFreshnessOneDay: { zh: '一天内', en: 'One Day' },
203
+ searchFreshnessOneWeek: { zh: '一周内', en: 'One Week' },
204
+ searchFreshnessOneMonth: { zh: '一个月内', en: 'One Month' },
205
+ searchFreshnessOneYear: { zh: '一年内', en: 'One Year' },
206
+ searchNoProviderSelected: { zh: '请选择左侧搜索 provider', en: 'Select a search provider from the left.' },
185
207
  providersPageTitle: { zh: 'AI 提供商', en: 'AI Providers' },
186
208
  providersPageDescription: { zh: '在一个页面内完成提供商切换、配置与保存。', en: 'Switch, configure, and save providers in one continuous workspace.' },
187
209
  providersLoading: { zh: '加载中...', en: 'Loading...' },
@@ -1 +0,0 @@
1
- import{r as v,j as a,aE as Z,z as ee,d as T,K as ae,ad as te,aP as se,aQ as ne,aR as le,w as re,a1 as oe,aA as ce,q as ie}from"./vendor-TlME1INH.js";import{t as e,c as I,K as me,u as q,a as $,b as K,N as pe,O as de,S as be,e as ue,f as xe,g as ye,h as ge}from"./index-Cn6_2To7.js";import{B as U,P as he,a as fe}from"./page-layout-DO8BlScF.js";import{I as A}from"./input-oBvxsnV9.js";import{L as we}from"./label-C7F8lMpQ.js";import{S as ve}from"./switch-C6a5GyZB.js";import{C as je,a as ke,L as H,S as J,c as Se,b as Ce}from"./LogoBadge-CL_8ZPXU.js";import{h as O}from"./config-hints-CApS3K_7.js";import{T as Ne}from"./tabs-custom-BatFap5k.js";function Pe({value:t,onChange:m,className:i,placeholder:r=""}){const[o,u]=v.useState(""),d=x=>{x.key==="Enter"&&o.trim()?(x.preventDefault(),m([...t,o.trim()]),u("")):x.key==="Backspace"&&!o&&t.length>0&&m(t.slice(0,-1))},g=x=>{m(t.filter((j,h)=>h!==x))};return a.jsxs("div",{className:I("flex flex-wrap gap-2 p-2 border rounded-md min-h-[42px]",i),children:[t.map((x,j)=>a.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-primary text-primary-foreground rounded text-sm",children:[x,a.jsx("button",{type:"button",onClick:()=>g(j),className:"hover:text-red-300 transition-colors",children:a.jsx(Z,{className:"h-3 w-3"})})]},j)),a.jsx("input",{type:"text",value:o,onChange:x=>u(x.target.value),onKeyDown:d,className:"flex-1 outline-none min-w-[100px] bg-transparent text-sm",placeholder:r||e("enterTag")})]})}function z(t){var r,o;const m=me();return((r=t.tutorialUrls)==null?void 0:r[m])||((o=t.tutorialUrls)==null?void 0:o.default)||t.tutorialUrl}const Ie={telegram:"telegram.svg",slack:"slack.svg",discord:"discord.svg",whatsapp:"whatsapp.svg",qq:"qq.svg",feishu:"feishu.svg",dingtalk:"dingtalk.svg",wecom:"wecom.svg",mochat:"mochat.svg",email:"email.svg"};function Fe(t,m){const i=m.toLowerCase(),r=t[i];return r?`/logos/${r}`:null}function Y(t){return Fe(Ie,t)}const R=[{value:"pairing",label:"pairing"},{value:"allowlist",label:"allowlist"},{value:"open",label:"open"},{value:"disabled",label:"disabled"}],B=[{value:"open",label:"open"},{value:"allowlist",label:"allowlist"},{value:"disabled",label:"disabled"}],Te=[{value:"off",label:"off"},{value:"partial",label:"partial"},{value:"block",label:"block"},{value:"progress",label:"progress"}],Ae=t=>t.includes("token")||t.includes("secret")||t.includes("password")?a.jsx(ae,{className:"h-3.5 w-3.5 text-gray-500"}):t.includes("url")||t.includes("host")?a.jsx(te,{className:"h-3.5 w-3.5 text-gray-500"}):t.includes("email")||t.includes("mail")?a.jsx(se,{className:"h-3.5 w-3.5 text-gray-500"}):t.includes("id")||t.includes("from")?a.jsx(ne,{className:"h-3.5 w-3.5 text-gray-500"}):t==="enabled"||t==="consentGranted"?a.jsx(le,{className:"h-3.5 w-3.5 text-gray-500"}):a.jsx(re,{className:"h-3.5 w-3.5 text-gray-500"});function G(){return{telegram:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"token",type:"password",label:e("botToken")},{name:"allowFrom",type:"tags",label:e("allowFrom")},{name:"proxy",type:"text",label:e("proxy")},{name:"accountId",type:"text",label:e("accountId")},{name:"dmPolicy",type:"select",label:e("dmPolicy"),options:R},{name:"groupPolicy",type:"select",label:e("groupPolicy"),options:B},{name:"groupAllowFrom",type:"tags",label:e("groupAllowFrom")},{name:"requireMention",type:"boolean",label:e("requireMention")},{name:"mentionPatterns",type:"tags",label:e("mentionPatterns")},{name:"groups",type:"json",label:e("groupRulesJson")}],discord:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"token",type:"password",label:e("botToken")},{name:"allowBots",type:"boolean",label:e("allowBotMessages")},{name:"allowFrom",type:"tags",label:e("allowFrom")},{name:"gatewayUrl",type:"text",label:e("gatewayUrl")},{name:"intents",type:"number",label:e("intents")},{name:"proxy",type:"text",label:e("proxy")},{name:"mediaMaxMb",type:"number",label:e("attachmentMaxSizeMb")},{name:"streaming",type:"select",label:e("streamingMode"),options:Te},{name:"draftChunk",type:"json",label:e("draftChunkingJson")},{name:"textChunkLimit",type:"number",label:e("textChunkLimit")},{name:"accountId",type:"text",label:e("accountId")},{name:"dmPolicy",type:"select",label:e("dmPolicy"),options:R},{name:"groupPolicy",type:"select",label:e("groupPolicy"),options:B},{name:"groupAllowFrom",type:"tags",label:e("groupAllowFrom")},{name:"requireMention",type:"boolean",label:e("requireMention")},{name:"mentionPatterns",type:"tags",label:e("mentionPatterns")},{name:"groups",type:"json",label:e("groupRulesJson")}],whatsapp:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"bridgeUrl",type:"text",label:e("bridgeUrl")},{name:"allowFrom",type:"tags",label:e("allowFrom")}],feishu:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"appId",type:"text",label:e("appId")},{name:"appSecret",type:"password",label:e("appSecret")},{name:"encryptKey",type:"password",label:e("encryptKey")},{name:"verificationToken",type:"password",label:e("verificationToken")},{name:"allowFrom",type:"tags",label:e("allowFrom")}],dingtalk:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"clientId",type:"text",label:e("clientId")},{name:"clientSecret",type:"password",label:e("clientSecret")},{name:"allowFrom",type:"tags",label:e("allowFrom")}],wecom:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"corpId",type:"text",label:e("corpId")},{name:"agentId",type:"text",label:e("agentId")},{name:"secret",type:"password",label:e("secret")},{name:"token",type:"password",label:e("token")},{name:"callbackPort",type:"number",label:e("callbackPort")},{name:"callbackPath",type:"text",label:e("callbackPath")},{name:"allowFrom",type:"tags",label:e("allowFrom")}],slack:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"mode",type:"text",label:e("mode")},{name:"webhookPath",type:"text",label:e("webhookPath")},{name:"allowBots",type:"boolean",label:e("allowBotMessages")},{name:"botToken",type:"password",label:e("botToken")},{name:"appToken",type:"password",label:e("appToken")}],email:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"consentGranted",type:"boolean",label:e("consentGranted")},{name:"imapHost",type:"text",label:e("imapHost")},{name:"imapPort",type:"number",label:e("imapPort")},{name:"imapUsername",type:"text",label:e("imapUsername")},{name:"imapPassword",type:"password",label:e("imapPassword")},{name:"fromAddress",type:"email",label:e("fromAddress")}],mochat:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"baseUrl",type:"text",label:e("baseUrl")},{name:"clawToken",type:"password",label:e("clawToken")},{name:"agentUserId",type:"text",label:e("agentUserId")},{name:"allowFrom",type:"tags",label:e("allowFrom")}],qq:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"appId",type:"text",label:e("appId")},{name:"secret",type:"password",label:e("appSecret")},{name:"markdownSupport",type:"boolean",label:e("markdownSupport")},{name:"allowFrom",type:"tags",label:e("allowFrom")}]}}function D(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Q(t,m){const i={...t};for(const[r,o]of Object.entries(m)){const u=i[r];if(D(u)&&D(o)){i[r]=Q(u,o);continue}i[r]=o}return i}function De(t,m){const i=t.split("."),r={};let o=r;for(let u=0;u<i.length-1;u+=1){const d=i[u];o[d]={},o=o[d]}return o[i[i.length-1]]=m,r}function Le({channelName:t}){var _,E;const{data:m}=q(),{data:i}=$(),{data:r}=K(),o=pe(),u=de(),[d,g]=v.useState({}),[x,j]=v.useState({}),[h,f]=v.useState(null),k=t?m==null?void 0:m.channels[t]:null,w=t?G()[t]??[]:[],c=r==null?void 0:r.uiHints,p=t?`channels.${t}`:null,S=((_=r==null?void 0:r.actions)==null?void 0:_.filter(s=>s.scope===p))??[],C=t&&(((E=O(`channels.${t}`,c))==null?void 0:E.label)??t),P=i==null?void 0:i.channels.find(s=>s.name===t),F=P?z(P):void 0;v.useEffect(()=>{if(k){g({...k});const s={};(t?G()[t]??[]:[]).filter(l=>l.type==="json").forEach(l=>{const y=k[l.name];s[l.name]=JSON.stringify(y??{},null,2)}),j(s)}else g({}),j({})},[k,t]);const N=(s,n)=>{g(l=>({...l,[s]:n}))},L=s=>{if(s.preventDefault(),!t)return;const n={...d};for(const l of w){if(l.type!=="password")continue;const y=n[l.name];(typeof y!="string"||y.length===0)&&delete n[l.name]}for(const l of w){if(l.type!=="json")continue;const y=x[l.name]??"";try{n[l.name]=y.trim()?JSON.parse(y):{}}catch{T.error(`${e("invalidJson")}: ${l.name}`);return}}o.mutate({channel:t,data:n})},V=s=>{if(!s||!t)return;const n=s.channels;if(!D(n))return;const l=n[t];D(l)&&g(y=>Q(y,l))},W=async s=>{if(!(!t||!p)){f(s.id);try{let n={...d};s.saveBeforeRun&&(n={...n,...s.savePatch??{}},g(n),await o.mutateAsync({channel:t,data:n}));const l=await u.mutateAsync({actionId:s.id,data:{scope:p,draftConfig:De(p,n)}});V(l.patch),l.ok?T.success(l.message||e("success")):T.error(l.message||e("error"))}catch(n){const l=n instanceof Error?n.message:String(n);T.error(`${e("error")}: ${l}`)}finally{f(null)}}};if(!t||!P||!k)return a.jsx("div",{className:je,children:a.jsxs("div",{children:[a.jsx("h3",{className:"text-base font-semibold text-gray-900",children:e("channelsSelectTitle")}),a.jsx("p",{className:"mt-2 text-sm text-gray-500",children:e("channelsSelectDescription")})]})});const M=!!k.enabled;return a.jsxs("div",{className:ke,children:[a.jsx("div",{className:"border-b border-gray-100 px-6 py-5",children:a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(H,{name:t,src:Y(t),className:I("h-9 w-9 rounded-lg border",M?"border-primary/30 bg-white":"border-gray-200/70 bg-white"),imgClassName:"h-5 w-5 object-contain",fallback:a.jsx("span",{className:"text-sm font-semibold uppercase text-gray-500",children:t[0]})}),a.jsx("h3",{className:"truncate text-lg font-semibold text-gray-900 capitalize",children:C})]}),a.jsx("p",{className:"mt-2 text-sm text-gray-500",children:e("channelsFormDescription")}),F&&a.jsxs("a",{href:F,className:"mt-2 inline-flex items-center gap-1.5 text-xs text-primary transition-colors hover:text-primary-hover",children:[a.jsx(ee,{className:"h-3.5 w-3.5"}),e("channelsGuideTitle")]})]}),a.jsx(J,{status:M?"active":"inactive",label:M?e("statusActive"):e("statusInactive")})]})}),a.jsxs("form",{onSubmit:L,className:"flex min-h-0 flex-1 flex-col",children:[a.jsx("div",{className:"min-h-0 flex-1 space-y-6 overflow-y-auto overscroll-contain px-6 py-5",children:w.map(s=>{const n=t?O(`channels.${t}.${s.name}`,c):void 0,l=(n==null?void 0:n.label)??s.label,y=n==null?void 0:n.placeholder;return a.jsxs("div",{className:"space-y-2.5",children:[a.jsxs(we,{htmlFor:s.name,className:"flex items-center gap-2 text-sm font-medium text-gray-900",children:[Ae(s.name),l]}),s.type==="boolean"&&a.jsxs("div",{className:"flex items-center justify-between rounded-xl bg-gray-50 p-3",children:[a.jsx("span",{className:"text-sm text-gray-500",children:d[s.name]?e("enabled"):e("disabled")}),a.jsx(ve,{id:s.name,checked:d[s.name]||!1,onCheckedChange:b=>N(s.name,b),className:"data-[state=checked]:bg-emerald-500"})]}),(s.type==="text"||s.type==="email")&&a.jsx(A,{id:s.name,type:s.type,value:d[s.name]||"",onChange:b=>N(s.name,b.target.value),placeholder:y,className:"rounded-xl"}),s.type==="password"&&a.jsx(A,{id:s.name,type:"password",value:d[s.name]||"",onChange:b=>N(s.name,b.target.value),placeholder:y??e("leaveBlankToKeepUnchanged"),className:"rounded-xl"}),s.type==="number"&&a.jsx(A,{id:s.name,type:"number",value:d[s.name]||0,onChange:b=>N(s.name,parseInt(b.target.value,10)||0),placeholder:y,className:"rounded-xl"}),s.type==="tags"&&a.jsx(Pe,{value:d[s.name]||[],onChange:b=>N(s.name,b)}),s.type==="select"&&a.jsxs(be,{value:d[s.name]||"",onValueChange:b=>N(s.name,b),children:[a.jsx(ue,{className:"rounded-xl",children:a.jsx(xe,{})}),a.jsx(ye,{children:(s.options??[]).map(b=>a.jsx(ge,{value:b.value,children:b.label},b.value))})]}),s.type==="json"&&a.jsx("textarea",{id:s.name,value:x[s.name]??"{}",onChange:b=>j(X=>({...X,[s.name]:b.target.value})),className:"min-h-[120px] w-full resize-none rounded-lg border border-gray-200 bg-white px-3 py-2 text-xs font-mono"})]},s.name)})}),a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-t border-gray-100 px-6 py-4",children:[a.jsx("div",{className:"flex flex-wrap items-center gap-2",children:S.filter(s=>s.trigger==="manual").map(s=>a.jsx(U,{type:"button",onClick:()=>W(s),disabled:o.isPending||!!h,variant:"secondary",children:h===s.id?e("connecting"):s.title},s.id))}),a.jsx(U,{type:"submit",disabled:o.isPending||!!h,children:o.isPending?e("saving"):e("save")})]})]})]})}const Me={telegram:"channelDescTelegram",slack:"channelDescSlack",email:"channelDescEmail",webhook:"channelDescWebhook",discord:"channelDescDiscord",feishu:"channelDescFeishu"};function Ke(){const{data:t}=q(),{data:m}=$(),{data:i}=K(),[r,o]=v.useState("enabled"),[u,d]=v.useState(),[g,x]=v.useState(""),j=i==null?void 0:i.uiHints,h=m==null?void 0:m.channels,f=t==null?void 0:t.channels,k=[{id:"enabled",label:e("channelsTabEnabled"),count:(h??[]).filter(c=>{var p;return(p=f==null?void 0:f[c.name])==null?void 0:p.enabled}).length},{id:"all",label:e("channelsTabAll"),count:(h??[]).length}],w=v.useMemo(()=>{const c=g.trim().toLowerCase();return(h??[]).filter(p=>{var C;const S=((C=f==null?void 0:f[p.name])==null?void 0:C.enabled)||!1;return r==="enabled"?S:!0}).filter(p=>c?(p.displayName||p.name).toLowerCase().includes(c)||p.name.toLowerCase().includes(c):!0)},[r,f,h,g]);return v.useEffect(()=>{if(w.length===0){d(void 0);return}w.some(p=>p.name===u)||d(w[0].name)},[w,u]),!t||!m?a.jsx("div",{className:"p-8 text-gray-400",children:e("channelsLoading")}):a.jsxs(he,{className:"xl:flex xl:h-full xl:min-h-0 xl:flex-col xl:pb-0",children:[a.jsx(fe,{title:e("channelsPageTitle"),description:e("channelsPageDescription")}),a.jsxs("div",{className:I(Ce,"xl:min-h-0 xl:flex-1"),children:[a.jsxs("section",{className:Se,children:[a.jsx("div",{className:"border-b border-gray-100 px-4 pt-4",children:a.jsx(Ne,{tabs:k,activeTab:r,onChange:o,className:"mb-0"})}),a.jsx("div",{className:"border-b border-gray-100 px-4 py-3",children:a.jsxs("div",{className:"relative",children:[a.jsx(oe,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400"}),a.jsx(A,{value:g,onChange:c=>x(c.target.value),placeholder:e("channelsFilterPlaceholder"),className:"h-10 rounded-xl pl-9"})]})}),a.jsxs("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto overscroll-contain p-3",children:[w.map(c=>{const p=t.channels[c.name],S=(p==null?void 0:p.enabled)||!1,C=O(`channels.${c.name}`,j),P=z(c),F=(C==null?void 0:C.help)||e(Me[c.name]||"channelDescriptionDefault"),N=u===c.name;return a.jsx("button",{type:"button",onClick:()=>d(c.name),className:I("w-full rounded-xl border p-2.5 text-left transition-all",N?"border-primary/30 bg-primary-50/40 shadow-sm":"border-gray-200/70 bg-white hover:border-gray-300 hover:bg-gray-50/70"),children:a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[a.jsx(H,{name:c.name,src:Y(c.name),className:I("h-10 w-10 rounded-lg border",S?"border-primary/30 bg-white":"border-gray-200/70 bg-white"),imgClassName:"h-5 w-5 object-contain",fallback:a.jsx("span",{className:"text-sm font-semibold uppercase text-gray-500",children:c.name[0]})}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("p",{className:"truncate text-sm font-semibold text-gray-900",children:c.displayName||c.name}),a.jsx("p",{className:"line-clamp-1 text-[11px] text-gray-500",children:F})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[P&&a.jsx("a",{href:P,onClick:L=>L.stopPropagation(),className:"inline-flex h-7 w-7 items-center justify-center rounded-md text-gray-300 transition-colors hover:bg-gray-100/70 hover:text-gray-500",title:e("channelsGuideTitle"),children:a.jsx(ce,{className:"h-3.5 w-3.5"})}),a.jsx(J,{status:S?"active":"inactive",label:S?e("statusActive"):e("statusInactive"),className:"min-w-[56px] justify-center"})]})]})},c.name)}),w.length===0&&a.jsxs("div",{className:"flex h-full min-h-[220px] flex-col items-center justify-center rounded-xl border border-dashed border-gray-200 bg-gray-50/70 py-10 text-center",children:[a.jsx("div",{className:"mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-white",children:a.jsx(ie,{className:"h-5 w-5 text-gray-300"})}),a.jsx("p",{className:"text-sm font-medium text-gray-700",children:e("channelsNoMatch")})]})]})]}),a.jsx(Le,{channelName:u})]})]})}export{Ke as ChannelsList};
@@ -1 +0,0 @@
1
- import{r as s,j as t,z as oe,a_ as ae,a$ as ne,aE as W,a0 as ie,v as le,b0 as ce,a1 as de,aA as ue,b1 as me}from"./vendor-TlME1INH.js";import{X as we,D as Y,t as i,c as X,Z as xe}from"./index-Cn6_2To7.js";function pe(){const{isOpen:T,mode:g,tabs:A,activeTabId:N,currentTab:x,currentUrl:l,navVersion:p,close:F,toggleMode:$,goBack:I,goForward:O,canGoBack:_,canGoForward:G,navigate:y,syncUrl:S,setActiveTab:V,closeTab:H,openNewTab:Z}=we(),[k,j]=s.useState(""),[E,C]=s.useState(!1),[q,h]=s.useState(!1),[d,D]=s.useState(()=>({x:Math.max(40,window.innerWidth-520),y:80})),[n,B]=s.useState({w:480,h:600}),[L,J]=s.useState(420),u=s.useRef(null),m=s.useRef(null),b=s.useRef(null),z=s.useRef(null),P=s.useRef(p),a=(x==null?void 0:x.kind)==="docs";s.useEffect(()=>{if(!a){j("");return}try{const e=new URL(l);j(e.pathname)}catch{j(l)}},[l,N,a]),s.useEffect(()=>{var e;if(a){if(p!==P.current){P.current=p;return}if((e=z.current)!=null&&e.contentWindow)try{const r=new URL(l).pathname;z.current.contentWindow.postMessage({type:"docs-navigate",path:r},"*")}catch{}}},[l,p,a]),s.useEffect(()=>{g==="floating"&&D(e=>({x:Math.max(40,window.innerWidth-n.w-40),y:e.y}))},[g,n.w]),s.useEffect(()=>{const e=r=>{var o;a&&((o=r.data)==null?void 0:o.type)==="docs-route-change"&&typeof r.data.url=="string"&&S(r.data.url)};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)},[S,a]);const K=s.useCallback(e=>{if(e.preventDefault(),!a)return;const r=k.trim();r&&(r.startsWith("/")?y(`${Y}${r}`):r.startsWith("http")?y(r):y(`${Y}/${r}`))},[k,y,a]),Q=s.useCallback(e=>{g==="floating"&&(C(!0),u.current={startX:e.clientX,startY:e.clientY,startPosX:d.x,startPosY:d.y})},[g,d]);s.useEffect(()=>{if(!E)return;const e=o=>{u.current&&D({x:u.current.startPosX+(o.clientX-u.current.startX),y:u.current.startPosY+(o.clientY-u.current.startY)})},r=()=>{C(!1),u.current=null};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",r),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",r)}},[E]);const M=s.useCallback(e=>{e.preventDefault(),e.stopPropagation(),h(!0);const r=e.currentTarget.dataset.axis;m.current={startX:e.clientX,startY:e.clientY,startW:n.w,startH:n.h};const o=w=>{m.current&&B(v=>({w:r==="y"?v.w:Math.max(360,m.current.startW+(w.clientX-m.current.startX)),h:r==="x"?v.h:Math.max(400,m.current.startH+(w.clientY-m.current.startY))}))},f=()=>{h(!1),m.current=null,window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",f)};window.addEventListener("mousemove",o),window.addEventListener("mouseup",f)},[n]),ee=s.useCallback(e=>{e.preventDefault(),e.stopPropagation(),h(!0),b.current={startX:e.clientX,startW:L};const r=f=>{if(!b.current)return;const w=b.current.startX-f.clientX;J(Math.max(320,Math.min(860,b.current.startW+w)))},o=()=>{h(!1),b.current=null,window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",o)};window.addEventListener("mousemove",r),window.addEventListener("mouseup",o)},[L]),te=s.useCallback(e=>{e.preventDefault(),e.stopPropagation(),h(!0);const r=e.clientX,o=n.w,f=d.x,w=re=>{const se=r-re.clientX,U=Math.max(360,o+se);B(R=>({...R,w:U})),D(R=>({...R,x:f-(U-o)}))},v=()=>{h(!1),window.removeEventListener("mousemove",w),window.removeEventListener("mouseup",v)};window.addEventListener("mousemove",w),window.addEventListener("mouseup",v)},[n.w,d.x]);if(!T)return null;const c=g==="docked";return t.jsxs("div",{className:X("flex flex-col bg-white overflow-hidden relative",c?"h-full border-l border-gray-200 shrink-0":"rounded-2xl shadow-2xl border border-gray-200"),style:c?{width:L}:{position:"fixed",left:d.x,top:d.y,width:n.w,height:n.h,zIndex:9999},children:[c&&t.jsx("div",{className:"absolute top-0 left-0 w-1.5 h-full cursor-ew-resize z-20 hover:bg-primary/10 transition-colors",onMouseDown:ee}),t.jsxs("div",{className:X("flex items-center justify-between px-4 py-2.5 bg-gray-50 border-b border-gray-200 shrink-0 select-none",!c&&"cursor-grab active:cursor-grabbing"),onMouseDown:c?void 0:Q,children:[t.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[t.jsx(oe,{className:"w-4 h-4 text-primary shrink-0"}),t.jsx("span",{className:"text-sm font-semibold text-gray-900 truncate",children:i("docBrowserTitle")})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("button",{onClick:$,className:"hover:bg-gray-200 rounded-md p-1.5 text-gray-500 hover:text-gray-700 transition-colors",title:c?i("docBrowserFloatMode"):i("docBrowserDockMode"),children:c?t.jsx(ae,{className:"w-3.5 h-3.5"}):t.jsx(ne,{className:"w-3.5 h-3.5"})}),t.jsx("button",{onClick:F,className:"hover:bg-gray-200 rounded-md p-1.5 text-gray-500 hover:text-gray-700 transition-colors",title:i("docBrowserClose"),children:t.jsx(W,{className:"w-3.5 h-3.5"})})]})]}),t.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-2 bg-white border-b border-gray-100 overflow-x-auto custom-scrollbar",children:[A.map(e=>{const r=e.id===N;return t.jsxs("div",{className:X("inline-flex items-center gap-1 h-7 px-1.5 rounded-lg text-xs border max-w-[220px] shrink-0 transition-colors",r?"bg-blue-50 border-blue-300 text-blue-700":"bg-gray-50 border-gray-200 text-gray-600 hover:bg-gray-100"),children:[t.jsx("button",{type:"button",onClick:()=>V(e.id),className:"truncate text-left px-1",title:e.title,children:e.title||i("docBrowserTabUntitled")}),t.jsx("button",{type:"button",onClick:o=>{o.stopPropagation(),H(e.id)},className:"rounded p-0.5 hover:bg-black/10","aria-label":i("docBrowserCloseTab"),children:t.jsx(W,{className:"w-3 h-3"})})]},e.id)}),t.jsx("button",{onClick:()=>Z(void 0,{kind:"docs",title:"Docs"}),className:"inline-flex items-center justify-center w-7 h-7 rounded-lg border border-gray-200 bg-white text-gray-600 hover:bg-gray-100 shrink-0",title:i("docBrowserNewTab"),children:t.jsx(ie,{className:"w-3.5 h-3.5"})})]}),a&&t.jsxs("div",{className:"flex items-center gap-2 px-3.5 py-2 bg-white border-b border-gray-100 shrink-0",children:[t.jsx("button",{onClick:I,disabled:!_,className:"p-1.5 rounded-md hover:bg-gray-100 disabled:opacity-30 disabled:cursor-not-allowed text-gray-600 transition-colors",children:t.jsx(le,{className:"w-4 h-4"})}),t.jsx("button",{onClick:O,disabled:!G,className:"p-1.5 rounded-md hover:bg-gray-100 disabled:opacity-30 disabled:cursor-not-allowed text-gray-600 transition-colors",children:t.jsx(ce,{className:"w-4 h-4"})}),t.jsxs("form",{onSubmit:K,className:"flex-1 relative",children:[t.jsx(de,{className:"w-3.5 h-3.5 absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),t.jsx("input",{type:"text",value:k,onChange:e=>j(e.target.value),placeholder:i("docBrowserSearchPlaceholder"),className:"w-full h-8 pl-8 pr-3 rounded-lg bg-gray-50 border border-gray-200 text-xs text-gray-700 focus:outline-none focus:ring-1 focus:ring-primary/30 focus:border-primary/40 transition-colors placeholder:text-gray-400"})]})]}),t.jsxs("div",{className:"flex-1 relative overflow-hidden",children:[t.jsx("iframe",{ref:z,src:l,className:"absolute inset-0 w-full h-full border-0",title:(x==null?void 0:x.title)||"NextClaw Docs",sandbox:"allow-same-origin allow-scripts allow-popups allow-forms",allow:"clipboard-read; clipboard-write"},`${N}:${p}`),(q||E)&&t.jsx("div",{className:"absolute inset-0 z-10"})]}),a&&xe(l)&&t.jsx("div",{className:"flex items-center justify-between px-4 py-2 bg-gray-50 border-t border-gray-200 shrink-0",children:t.jsxs("a",{href:l,target:"_blank",rel:"noopener noreferrer","data-doc-external":!0,className:"flex items-center gap-1.5 text-xs text-primary hover:text-primary-hover font-medium transition-colors",children:[i("docBrowserOpenExternal"),t.jsx(ue,{className:"w-3 h-3"})]})}),!c&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"absolute top-0 left-0 w-1.5 h-full cursor-ew-resize z-20 hover:bg-primary/10 transition-colors",onMouseDown:te}),t.jsx("div",{className:"absolute top-0 right-0 w-1.5 h-full cursor-ew-resize z-20 hover:bg-primary/10 transition-colors",onMouseDown:M,"data-axis":"x"}),t.jsx("div",{className:"absolute bottom-0 left-0 h-1.5 w-full cursor-ns-resize z-20 hover:bg-primary/10 transition-colors",onMouseDown:M,"data-axis":"y"}),t.jsx("div",{className:"absolute bottom-0 right-0 w-4 h-4 cursor-se-resize z-30 flex items-center justify-center text-gray-300 hover:text-gray-500 transition-colors",onMouseDown:M,children:t.jsx(me,{className:"w-3 h-3 rotate-[-45deg]"})})]})]})}export{pe as DocBrowser};
@@ -1 +0,0 @@
1
- import{j as e,r as i}from"./vendor-TlME1INH.js";import{c as r}from"./index-Cn6_2To7.js";const c={active:{dot:"bg-emerald-500",text:"text-emerald-600",bg:"bg-emerald-50"},ready:{dot:"bg-emerald-500",text:"text-emerald-600",bg:"bg-emerald-50"},inactive:{dot:"bg-gray-300",text:"text-gray-400",bg:"bg-gray-100/80"},setup:{dot:"bg-gray-300",text:"text-gray-400",bg:"bg-gray-100/80"},warning:{dot:"bg-amber-400",text:"text-amber-600",bg:"bg-amber-50"}};function h({status:a,label:l,className:n}){const t=c[a];return e.jsxs("div",{className:r("inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded-full px-2 py-0.5",t.bg,n),children:[e.jsx("span",{className:r("h-1.5 w-1.5 rounded-full",t.dot)}),e.jsx("span",{className:r("text-[11px] font-medium",t.text),children:l})]})}const b="grid min-h-0 grid-cols-1 gap-5 xl:grid-cols-[340px_minmax(0,1fr)]",p="flex min-h-[520px] min-h-0 min-w-0 flex-col overflow-hidden rounded-2xl border border-gray-200/70 bg-white shadow-card xl:h-[calc(100vh-180px)] xl:min-h-[600px] xl:max-h-[860px]",f="flex min-h-[520px] min-h-0 min-w-0 flex-col overflow-hidden rounded-2xl border border-gray-200/70 bg-white shadow-card xl:h-[calc(100vh-180px)] xl:min-h-[600px] xl:max-h-[860px]",u="flex min-h-[520px] min-w-0 items-center justify-center overflow-hidden rounded-2xl border border-gray-200/70 bg-white px-6 text-center xl:h-[calc(100vh-180px)] xl:min-h-[600px] xl:max-h-[860px]";function w({name:a,src:l,className:n,imgClassName:t,fallback:s}){const[o,x]=i.useState(!1),d=!!l&&!o;return e.jsx("div",{className:r("inline-flex shrink-0 items-center justify-center overflow-hidden",n),children:d?e.jsx("img",{src:l,alt:`${a} logo`,className:r("block h-6 w-6 object-contain",t),onError:()=>x(!0),draggable:!1}):s??e.jsx("span",{className:"text-lg font-bold uppercase",children:a.slice(0,1)})})}export{u as C,w as L,h as S,f as a,b,p as c};
@@ -1 +0,0 @@
1
- import{j as e,r as i,Y,k as B,p as q,z as G,Z as K,_ as Z}from"./vendor-TlME1INH.js";import{P as $,a as J,B as Q}from"./page-layout-DO8BlScF.js";import{C as U}from"./card-C7Gtw2Vs.js";import{I as A}from"./input-oBvxsnV9.js";import{L as _}from"./label-C7F8lMpQ.js";import{c as L,u as X,a as H,b as ee,d as se,t as c,S as te,e as ae,f as le,g as re,h as ne,D as oe}from"./index-Cn6_2To7.js";import{h as R}from"./config-hints-CApS3K_7.js";import{b as ie,f as ce,t as T,c as de}from"./provider-models-y4mUDcGF.js";function h({className:o,...l}){return e.jsx("div",{className:L("animate-pulse rounded-md bg-slate-200",o),...l})}function me(o){const l=new Set;for(const u of o){const m=u.trim();m.length>0&&l.add(m)}return[...l]}function xe({id:o,value:l,onChange:u,options:m,placeholder:N,className:w,inputClassName:y,emptyText:b,createText:f,maxItems:v=Number.POSITIVE_INFINITY,onEnter:M}){const[C,r]=i.useState(!1),d=i.useMemo(()=>me(m),[m]),a=l.trim().toLowerCase(),g=i.useMemo(()=>{const s=d.map((x,j)=>({option:x,index:j}));a.length>0&&s.sort((x,j)=>{const S=x.option.toLowerCase(),k=j.option.toLowerCase(),D=S===a?0:S.startsWith(a)?1:S.includes(a)?2:3,I=k===a?0:k.startsWith(a)?1:k.includes(a)?2:3;return D!==I?D-I:x.index-j.index});const p=s.map(x=>x.option);return Number.isFinite(v)?p.slice(0,Math.max(1,v)):p},[d,a,v]),n=l.trim().length>0&&d.some(s=>s===l.trim());return e.jsxs("div",{className:L("relative",w),onBlur:()=>{setTimeout(()=>r(!1),120)},children:[e.jsx(A,{id:o,value:l,onFocus:()=>r(!0),onChange:s=>{u(s.target.value),C||r(!0)},onKeyDown:s=>{s.key==="Enter"&&(M&&(s.preventDefault(),M()),r(!1))},placeholder:N,className:L("pr-10",y)}),e.jsx("button",{type:"button",onMouseDown:s=>s.preventDefault(),onClick:()=>r(s=>!s),className:"absolute inset-y-0 right-0 inline-flex w-10 items-center justify-center text-gray-400 hover:text-gray-600","aria-label":"toggle model options",children:e.jsx(Y,{className:"h-4 w-4"})}),C&&e.jsx("div",{className:"absolute z-20 mt-1 w-full overflow-hidden rounded-xl border border-gray-200 bg-white shadow-lg",children:e.jsxs("div",{className:"max-h-60 overflow-y-auto py-1",children:[!n&&l.trim().length>0&&e.jsxs("button",{type:"button",onMouseDown:s=>s.preventDefault(),onClick:()=>{u(l.trim()),r(!1)},className:"flex w-full items-center gap-2 px-3 py-2 text-left text-sm hover:bg-gray-50",children:[e.jsx(B,{className:"h-4 w-4 text-transparent"}),e.jsx("span",{className:"truncate text-gray-700",children:f?f.replace("{value}",l.trim()):l.trim()})]}),g.map(s=>e.jsxs("button",{type:"button",onMouseDown:p=>p.preventDefault(),onClick:()=>{u(s),r(!1)},className:"flex w-full items-center gap-2 px-3 py-2 text-left text-sm hover:bg-gray-50",children:[e.jsx(B,{className:L("h-4 w-4",s===l.trim()?"text-primary":"text-transparent")}),e.jsx("span",{className:"truncate text-gray-700",children:s})]},s)),g.length===0&&l.trim().length===0&&e.jsx("div",{className:"px-3 py-2 text-sm text-gray-500",children:b??"No models available"})]})})]})}function ye(){const{data:o,isLoading:l}=X(),{data:u}=H(),{data:m}=ee(),N=se(),[w,y]=i.useState(""),[b,f]=i.useState(""),[v,M]=i.useState(""),C=m==null?void 0:m.uiHints,r=R("agents.defaults.model",C),d=R("agents.defaults.workspace",C),a=i.useMemo(()=>ie({meta:u,config:o}),[o,u]),g=i.useMemo(()=>new Map(a.map(t=>[t.name,t])),[a]),n=g.get(w)??a[0],s=(n==null?void 0:n.name)??"",p=i.useMemo(()=>(n==null?void 0:n.aliases)??[],[n]),x=i.useMemo(()=>(n==null?void 0:n.models)??[],[n]);i.useEffect(()=>{w||a.length===0||y(a[0].name)},[w,a]),i.useEffect(()=>{var E,F,z;if(!((E=o==null?void 0:o.agents)!=null&&E.defaults))return;const t=(o.agents.defaults.model||"").trim(),P=ce(t,a)??((F=a[0])==null?void 0:F.name)??"",W=((z=g.get(P))==null?void 0:z.aliases)??[];y(P),f(T(t,W)),M(o.agents.defaults.workspace||"")},[o,a,g]);const j=i.useMemo(()=>{const t=new Set;for(const O of x){const P=O.trim();P&&t.add(P)}return[...t]},[x]),S=i.useMemo(()=>{const t=T(b,p);return t?de((n==null?void 0:n.prefix)??"",t):""},[b,n,p]),k=c("modelIdentifierHelp")||(r==null?void 0:r.help)||"",D=t=>{y(t),f("")},I=t=>{f(T(t,p))},V=t=>{t.preventDefault(),N.mutate({model:S})};return l?e.jsxs("div",{className:"max-w-2xl space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(h,{className:"h-8 w-32"}),e.jsx(h,{className:"h-4 w-48"})]}),e.jsxs(U,{className:"rounded-2xl border-gray-200 p-6",children:[e.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[e.jsx(h,{className:"h-12 w-12 rounded-xl"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(h,{className:"h-5 w-24"}),e.jsx(h,{className:"h-3 w-32"})]})]}),e.jsx(h,{className:"h-4 w-20 mb-2"}),e.jsx(h,{className:"h-10 w-full rounded-xl"})]}),e.jsxs(U,{className:"rounded-2xl border-gray-200 p-6",children:[e.jsx(h,{className:"h-5 w-24 mb-2"}),e.jsx(h,{className:"h-10 w-full rounded-xl"})]})]}):e.jsxs($,{children:[e.jsx(J,{title:c("modelPageTitle"),description:c("modelPageDescription")}),e.jsxs("form",{onSubmit:V,className:"space-y-8",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[e.jsxs("div",{className:"p-8 rounded-2xl bg-white border border-gray-200 shadow-card",children:[e.jsxs("div",{className:"flex items-center gap-4 mb-8",children:[e.jsx("div",{className:"h-10 w-10 rounded-xl bg-primary flex items-center justify-center text-white",children:e.jsx(q,{className:"h-5 w-5"})}),e.jsx("h3",{className:"text-lg font-bold text-gray-900",children:c("defaultModel")})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(_,{htmlFor:"model",className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:(r==null?void 0:r.label)??"Model Name"}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[e.jsx("div",{className:"sm:w-[38%] sm:min-w-[170px]",children:e.jsxs(te,{value:s,onValueChange:D,children:[e.jsx(ae,{className:"h-10 w-full rounded-xl",children:e.jsx(le,{placeholder:c("providersSelectPlaceholder")})}),e.jsx(re,{children:a.map(t=>e.jsx(ne,{value:t.name,children:t.displayName},t.name))})]})}),e.jsx("span",{className:"hidden h-10 items-center justify-center leading-none text-lg font-semibold text-gray-300 sm:inline-flex",children:"/"}),e.jsx(xe,{id:"model",value:b,onChange:I,options:j,placeholder:(r==null?void 0:r.placeholder)??"gpt-5.1",className:"sm:flex-1",inputClassName:"h-10 rounded-xl",emptyText:c("modelPickerNoOptions"),createText:c("modelPickerUseCustom")},s)]}),e.jsx("p",{className:"text-xs text-gray-400",children:k}),e.jsx("p",{className:"text-xs text-gray-500",children:c("modelInputCustomHint")}),e.jsxs("a",{href:`${oe}/guide/model-selection`,className:"inline-flex items-center gap-1.5 text-xs text-primary hover:text-primary-hover transition-colors",children:[e.jsx(G,{className:"h-3.5 w-3.5"}),c("channelsGuideTitle")]})]})]}),e.jsxs("div",{className:"p-8 rounded-2xl bg-white border border-gray-200 shadow-card",children:[e.jsxs("div",{className:"flex items-center gap-4 mb-8",children:[e.jsx("div",{className:"h-10 w-10 rounded-xl bg-primary flex items-center justify-center text-white",children:e.jsx(K,{className:"h-5 w-5"})}),e.jsx("h3",{className:"text-lg font-bold text-gray-900",children:c("workspace")})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(_,{htmlFor:"workspace",className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:(d==null?void 0:d.label)??"Default Path"}),e.jsx(A,{id:"workspace",value:v,onChange:t=>M(t.target.value),placeholder:(d==null?void 0:d.placeholder)??"/path/to/workspace",className:"rounded-xl"})]})]})]}),e.jsx("div",{className:"flex justify-end pt-4",children:e.jsx(Q,{type:"submit",disabled:N.isPending,size:"lg",children:N.isPending?e.jsx(Z,{className:"h-5 w-5 animate-spin"}):c("saveChanges")})})]})]})}export{ye as ModelConfig};
@@ -1 +0,0 @@
1
- import{r as c,j as e,aL as ht,aM as xt,aF as Xe,a0 as Ce,a as pt,d as z,aE as He,aN as ft,C as yt,aO as gt,a1 as jt,K as bt}from"./vendor-TlME1INH.js";import{c as ie,t as a,u as Ze,a as et,b as tt,E as vt,F as wt,G as Nt,H as Ct,I as At,J as Pt,K as Mt,S as We,e as qe,f as Ue,g as Ge,h as Qe,M as St}from"./index-Cn6_2To7.js";import{B,P as It,a as Dt}from"./page-layout-DO8BlScF.js";import{I as q}from"./input-oBvxsnV9.js";import{L as R}from"./label-C7F8lMpQ.js";import{C as Et,a as Lt,S as st,b as kt,c as $t,L as Bt}from"./LogoBadge-CL_8ZPXU.js";import{h as re}from"./config-hints-CApS3K_7.js";import{T as Tt}from"./tabs-custom-BatFap5k.js";function Ft({isSet:t,className:i,value:r,onChange:l,placeholder:m,...j}){const[h,x]=c.useState(!1),[f,b]=c.useState(!1),v=typeof r=="string"&&r.length>0,D=t&&!v&&!f;return e.jsxs("div",{className:"relative",children:[D?e.jsx("div",{onClick:()=>b(!0),className:ie("flex h-9 w-full rounded-xl border border-gray-200/80 bg-white px-3.5 py-2 text-sm text-gray-500 cursor-text items-center pr-12",i),children:"••••••••••••"}):e.jsx(q,{type:h?"text":"password",className:ie("pr-12",i),value:r,onChange:l,onBlur:()=>{v||b(!1)},placeholder:m,autoFocus:f,...j}),e.jsx("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 flex gap-1",children:(t||v)&&e.jsx(B,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>x(!h),children:h?e.jsx(ht,{className:"h-4 w-4"}):e.jsx(xt,{className:"h-4 w-4"})})})]})}function Kt({value:t,onChange:i,className:r}){const l=t?Object.entries(t):[],m=(x,f,b)=>{const v=[...l];v[x]=[f,b],i(Object.fromEntries(v))},j=()=>{i({...t,"":""})},h=x=>{const f=l.filter((b,v)=>v!==x);i(Object.fromEntries(f))};return e.jsxs("div",{className:ie("space-y-2",r),children:[l.map(([x,f],b)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(q,{type:"text",value:x,onChange:v=>m(b,v.target.value,f),placeholder:a("headerName"),className:"flex-1"}),e.jsx(q,{type:"text",value:f,onChange:v=>m(b,x,v.target.value),placeholder:a("headerValue"),className:"flex-1"}),e.jsx(B,{type:"button",variant:"ghost",size:"icon",onClick:()=>h(b),children:e.jsx(Xe,{className:"h-4 w-4 text-red-500"})})]},b)),e.jsxs(B,{type:"button",variant:"outline",size:"sm",onClick:j,children:[e.jsx(Ce,{className:"h-4 w-4 mr-2"}),a("add")]})]})}const zt={displayName:"",apiKeySet:!1,apiBase:null,extraHeaders:null,wireApi:null,models:[]};function ne(t){if(!t)return null;const i=Object.entries(t).map(([r,l])=>[r.trim(),l]).filter(([r])=>r.length>0);return i.length===0?null:Object.fromEntries(i)}function Ve(t,i){const r=ne(t),l=ne(i);if(r===null&&l===null)return!0;if(!r||!l)return!1;const m=Object.entries(r).sort(([h],[x])=>h.localeCompare(x)),j=Object.entries(l).sort(([h],[x])=>h.localeCompare(x));return m.length!==j.length?!1:m.every(([h,x],f)=>h===j[f][0]&&x===j[f][1])}function we(t){if(!t||t.length===0)return[];const i=new Set;for(const r of t){const l=r.trim();l&&i.add(l)}return[...i]}function Ot(t,i){const r=t.trim();if(!r||!i.trim())return r;const l=`${i.trim()}/`;return r.startsWith(l)?r.slice(l.length):r}function xe(t,i){let r=t.trim();if(!r)return"";for(const l of i){const m=l.trim();m&&(r=Ot(r,m))}return r.trim()}function Ne(t,i){return t.length!==i.length?!1:t.every((r,l)=>r===i[l])}function _t(t,i){const r=[...t];for(const l of i)r.includes(l)||r.push(l);return r}function Rt(t,i){return i.length===0?t:i.every(l=>!t.includes(l))?_t(t,i):i}function Ht(t,i){return Ne(t,i)?[]:t}function Wt(t){var f,b,v,D,E;const{providerName:i,methods:r,defaultMethodId:l,language:m}=t;if(r.length===0)return"";const j=new Map;for(const P of r){const N=P.id.trim();N&&j.set(N.toLowerCase(),N)}const h=(...P)=>{for(const N of P){const C=j.get(N.toLowerCase());if(C)return C}},x=l==null?void 0:l.trim();if(i==="minimax-portal"){if(m==="zh")return h("cn","china-mainland")??h(x??"")??((f=r[0])==null?void 0:f.id)??"";if(m==="en")return h("global","intl","international")??h(x??"")??((b=r[0])==null?void 0:b.id)??""}if(x){const P=h(x);if(P)return P}return m==="zh"?h("cn")??((v=r[0])==null?void 0:v.id)??"":m==="en"?h("global")??((D=r[0])==null?void 0:D.id)??"":((E=r[0])==null?void 0:E.id)??""}function Ye(t){return t.required&&t.hasDefault&&t.optionCount>1&&t.optionCount<=3}function Je(t){const{value:i,onChange:r,options:l}=t;return e.jsx("div",{className:"flex flex-wrap gap-2",children:l.map(m=>{const j=m.value===i;return e.jsx("button",{type:"button",onClick:()=>r(m.value),"aria-pressed":j,className:`rounded-full border px-3 py-1.5 text-xs font-medium transition-colors ${j?"border-primary bg-primary text-white shadow-sm":"border-gray-200 bg-white text-gray-700 hover:border-primary/40 hover:text-primary"}`,children:m.label},m.value)})})}function qt({providerName:t,onProviderDeleted:i}){var Te,Fe,Ke,ze,Oe,_e,Re;const r=pt(),{data:l}=Ze(),{data:m}=et(),{data:j}=tt(),h=vt(),x=wt(),f=Nt(),b=Ct(),v=At(),D=Pt(),[E,P]=c.useState(""),[N,C]=c.useState(""),[O,X]=c.useState(null),[u,g]=c.useState("auto"),[w,A]=c.useState([]),[T,M]=c.useState(""),[$,H]=c.useState(""),[Z,le]=c.useState(!1),[pe,oe]=c.useState(!1),[ce,_]=c.useState(null),[Ae,L]=c.useState(""),[Pe,de]=c.useState(""),ue=c.useRef(null),n=m==null?void 0:m.providers.find(s=>s.name===t),k=(t?l==null?void 0:l.providers[t]:null)??zt,me=j==null?void 0:j.uiHints,U=!!(n!=null&&n.isCustom),G=t?re(`providers.${t}.apiKey`,me):void 0,F=t?re(`providers.${t}.apiBase`,me):void 0,fe=t?re(`providers.${t}.extraHeaders`,me):void 0,ye=t?re(`providers.${t}.wireApi`,me):void 0,Me=(n==null?void 0:n.displayName)||t||"",Q=(k.displayName||"").trim()||Me,at=$.trim()||Q||t||a("providersSelectPlaceholder"),Se=(n==null?void 0:n.modelPrefix)||t||"",V=c.useMemo(()=>we([Se,t||""]),[Se,t]),ge=(n==null?void 0:n.defaultApiBase)||"",ee=k.apiBase||ge,je=ne(k.extraHeaders||null),te=k.wireApi||(n==null?void 0:n.defaultWireApi)||"auto",be=c.useMemo(()=>we(((n==null?void 0:n.defaultModels)??[]).map(s=>xe(s,V))),[n==null?void 0:n.defaultModels,V]),Ie=c.useMemo(()=>we((k.models??[]).map(s=>xe(s,V))),[k.models,V]),se=c.useMemo(()=>Rt(be,Ie),[be,Ie]),W=Mt(),rt=((Te=n==null?void 0:n.apiBaseHelp)==null?void 0:Te[W])||((Fe=n==null?void 0:n.apiBaseHelp)==null?void 0:Fe.en)||(F==null?void 0:F.help)||a("providerApiBaseHelp"),o=n==null?void 0:n.auth,S=c.useMemo(()=>(o==null?void 0:o.methods)??[],[o==null?void 0:o.methods]),De=c.useMemo(()=>S.map(s=>{var d,p;return{value:s.id,label:((d=s.label)==null?void 0:d[W])||((p=s.label)==null?void 0:p.en)||s.id}}),[S,W]),he=c.useMemo(()=>Wt({providerName:t,methods:S,defaultMethodId:o==null?void 0:o.defaultMethodId,language:W}),[t,o==null?void 0:o.defaultMethodId,S,W]),Y=c.useMemo(()=>{var d;if(!S.length)return"";const s=Pe.trim();return s&&S.some(p=>p.id===s)?s:he||((d=S[0])==null?void 0:d.id)||""},[Pe,he,S]),J=c.useMemo(()=>S.find(s=>s.id===Y),[S,Y]),Ee=((Ke=J==null?void 0:J.hint)==null?void 0:Ke[W])||((ze=J==null?void 0:J.hint)==null?void 0:ze.en)||"",nt=Ye({required:(o==null?void 0:o.kind)==="device_code",hasDefault:!!((Oe=o==null?void 0:o.defaultMethodId)!=null&&Oe.trim()),optionCount:S.length}),Le=((_e=o==null?void 0:o.note)==null?void 0:_e[W])||((Re=o==null?void 0:o.note)==null?void 0:Re.en)||(o==null?void 0:o.displayName)||"",ve=((n==null?void 0:n.wireApiOptions)||["auto","chat","responses"]).map(s=>({value:s,label:s==="chat"?a("wireApiChat"):s==="responses"?a("wireApiResponses"):a("wireApiAuto")})),it=Ye({required:!!(n!=null&&n.supportsWireApi),hasDefault:typeof(n==null?void 0:n.defaultWireApi)=="string"&&n.defaultWireApi.length>0,optionCount:ve.length}),I=c.useCallback(()=>{ue.current!==null&&(window.clearTimeout(ue.current),ue.current=null)},[]),ke=c.useCallback((s,d)=>{I(),ue.current=window.setTimeout(()=>{(async()=>{if(t)try{const p=await v.mutateAsync({provider:t,data:{sessionId:s}});if(p.status==="pending"){L(a("providerAuthWaitingBrowser")),ke(s,p.nextPollMs??d);return}if(p.status==="authorized"){_(null),I(),L(a("providerAuthCompleted")),z.success(a("providerAuthCompleted")),r.invalidateQueries({queryKey:["config"]}),r.invalidateQueries({queryKey:["config-meta"]});return}_(null),I(),L(p.message||`Authorization ${p.status}.`),z.error(p.message||`Authorization ${p.status}.`)}catch(p){_(null),I();const y=p instanceof Error?p.message:String(p);L(y),z.error(`Authorization failed: ${y}`)}})()},Math.max(1e3,d))},[I,v,t,r]);c.useEffect(()=>{if(!t){P(""),C(""),X(null),g("auto"),A([]),M(""),H(""),_(null),L(""),de(""),I();return}P(""),C(ee),X(k.extraHeaders||null),g(te),A(se),M(""),H(Q),_(null),L(""),de(he),I()},[t,ee,k.extraHeaders,te,se,Q,he,I]),c.useEffect(()=>()=>I(),[I]);const $e=c.useMemo(()=>{if(!t)return!1;const s=E.trim().length>0,d=N.trim()!==ee.trim(),p=!Ve(O,je),y=n!=null&&n.supportsWireApi?u!==te:!1,K=!Ne(w,se),ae=U?$.trim()!==Q:!1;return s||d||p||y||K||ae},[t,U,$,Q,E,N,ee,O,je,n==null?void 0:n.supportsWireApi,u,te,w,se]),Be=()=>{const s=xe(T,V);if(s){if(w.includes(s)){M("");return}A(d=>[...d,s]),M("")}},lt=s=>{if(s.preventDefault(),!t)return;const d={},p=E.trim(),y=N.trim(),K=ne(O),ae=$.trim();U&&ae!==Q&&(d.displayName=ae.length>0?ae:null),p.length>0&&(d.apiKey=p),y!==ee.trim()&&(d.apiBase=y.length>0&&y!==ge?y:null),Ve(K,je)||(d.extraHeaders=K),n!=null&&n.supportsWireApi&&u!==te&&(d.wireApi=u),Ne(w,se)||(d.models=Ht(w,be)),h.mutate({provider:t,data:d})},ot=async()=>{if(!t)return;const s=w.find(y=>y.trim().length>0)??"",d=xe(s,V),p={apiBase:N.trim(),extraHeaders:ne(O),model:d||null};E.trim().length>0&&(p.apiKey=E.trim()),n!=null&&n.supportsWireApi&&(p.wireApi=u);try{const y=await f.mutateAsync({provider:t,data:p});if(y.success){z.success(`${a("providerTestConnectionSuccess")} (${y.latencyMs}ms)`);return}const K=[`provider=${y.provider}`,`latency=${y.latencyMs}ms`];y.model&&K.push(`model=${y.model}`),z.error(`${a("providerTestConnectionFailed")}: ${y.message} | ${K.join(" | ")}`)}catch(y){const K=y instanceof Error?y.message:String(y);z.error(`${a("providerTestConnectionFailed")}: ${K}`)}},ct=async()=>{if(!(!t||!U||!window.confirm(a("providerDeleteConfirm"))))try{await x.mutateAsync({provider:t}),i==null||i(t)}catch{}},dt=async()=>{if(!(!t||(o==null?void 0:o.kind)!=="device_code"))try{L("");const s=await b.mutateAsync({provider:t,data:Y?{methodId:Y}:{}});if(!s.sessionId||!s.verificationUri)throw new Error(a("providerAuthStartFailed"));_(s.sessionId),L(`${a("providerAuthOpenPrompt")}${s.userCode}${a("providerAuthOpenPromptSuffix")}`),window.open(s.verificationUri,"_blank","noopener,noreferrer"),ke(s.sessionId,s.intervalMs)}catch(s){const d=s instanceof Error?s.message:String(s);_(null),I(),L(d),z.error(`${a("providerAuthStartFailed")}: ${d}`)}},ut=async()=>{if(!(!t||(o==null?void 0:o.kind)!=="device_code"))try{I(),_(null);const s=await D.mutateAsync({provider:t}),d=s.expiresAt?` (expires: ${s.expiresAt})`:"";L(`${a("providerAuthImportStatusPrefix")}${d}`),z.success(a("providerAuthImportSuccess")),r.invalidateQueries({queryKey:["config"]}),r.invalidateQueries({queryKey:["config-meta"]})}catch(s){const d=s instanceof Error?s.message:String(s);L(d),z.error(`${a("providerAuthImportFailed")}: ${d}`)}};if(!t||!n)return e.jsx("div",{className:Et,children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-semibold text-gray-900",children:a("providersSelectTitle")}),e.jsx("p",{className:"mt-2 text-sm text-gray-500",children:a("providersSelectDescription")})]})});const mt=k.apiKeySet?a("statusReady"):a("statusSetup");return e.jsxs("div",{className:Lt,children:[e.jsx("div",{className:"border-b border-gray-100 px-6 py-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"truncate text-lg font-semibold text-gray-900",children:at}),e.jsxs("div",{className:"flex items-center gap-3",children:[U&&e.jsx("button",{type:"button",onClick:ct,disabled:x.isPending,className:"text-gray-400 hover:text-red-500 transition-colors",title:a("providerDelete"),children:e.jsx(Xe,{className:"h-4 w-4"})}),e.jsx(st,{status:k.apiKeySet?"ready":"setup",label:mt})]})]})}),e.jsxs("form",{onSubmit:lt,className:"flex min-h-0 flex-1 flex-col",children:[e.jsxs("div",{className:"min-h-0 flex-1 space-y-5 overflow-y-auto px-6 py-5",children:[U&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(R,{htmlFor:"providerDisplayName",className:"text-sm font-medium text-gray-900",children:a("providerDisplayName")}),e.jsx(q,{id:"providerDisplayName",type:"text",value:$,onChange:s=>H(s.target.value),placeholder:Me||a("providerDisplayNamePlaceholder"),className:"rounded-xl"}),e.jsx("p",{className:"text-xs text-gray-500",children:a("providerDisplayNameHelpShort")})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(R,{htmlFor:"apiKey",className:"text-sm font-medium text-gray-900",children:(G==null?void 0:G.label)??a("apiKey")}),e.jsx(Ft,{id:"apiKey",value:E,isSet:k.apiKeySet,onChange:s=>P(s.target.value),placeholder:(G==null?void 0:G.placeholder)??a("enterApiKey"),className:"rounded-xl"}),e.jsx("p",{className:"text-xs text-gray-500",children:a("leaveBlankToKeepUnchanged")})]}),(o==null?void 0:o.kind)==="device_code"&&e.jsxs("div",{className:"space-y-2 rounded-xl border border-primary/20 bg-primary-50/50 p-3",children:[e.jsx(R,{className:"text-sm font-medium text-gray-900",children:o.displayName||a("providerAuthSectionTitle")}),Le?e.jsx("p",{className:"text-xs text-gray-600",children:Le}):null,S.length>1?e.jsxs("div",{className:"space-y-2",children:[e.jsx(R,{className:"text-xs font-medium text-gray-700",children:a("providerAuthMethodLabel")}),nt?e.jsx(Je,{value:Y,onChange:de,options:De}):e.jsxs(We,{value:Y,onValueChange:de,children:[e.jsx(qe,{className:"h-8 rounded-lg bg-white",children:e.jsx(Ue,{placeholder:a("providerAuthMethodPlaceholder")})}),e.jsx(Ge,{children:De.map(s=>e.jsx(Qe,{value:s.value,children:s.label},s.value))})]}),Ee?e.jsx("p",{className:"text-xs text-gray-500",children:Ee}):null]}):null,e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(B,{type:"button",variant:"outline",size:"sm",onClick:dt,disabled:b.isPending||!!ce,children:b.isPending?a("providerAuthStarting"):ce?a("providerAuthAuthorizing"):a("providerAuthAuthorizeInBrowser")}),o.supportsCliImport?e.jsx(B,{type:"button",variant:"outline",size:"sm",onClick:ut,disabled:D.isPending,children:D.isPending?a("providerAuthImporting"):a("providerAuthImportFromCli")}):null,ce?e.jsxs("span",{className:"text-xs text-gray-500",children:[a("providerAuthSessionLabel"),": ",ce.slice(0,8),"…"]}):null]}),Ae?e.jsx("p",{className:"text-xs text-gray-600",children:Ae}):null]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(R,{htmlFor:"apiBase",className:"text-sm font-medium text-gray-900",children:(F==null?void 0:F.label)??a("apiBase")}),e.jsx(q,{id:"apiBase",type:"text",value:N,onChange:s=>C(s.target.value),placeholder:ge||(F==null?void 0:F.placeholder)||"https://api.example.com",className:"rounded-xl"}),e.jsx("p",{className:"text-xs text-gray-500",children:rt})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(R,{className:"text-sm font-medium text-gray-900",children:a("providerModelsTitle")}),!pe&&e.jsxs("button",{type:"button",onClick:()=>oe(!0),className:"text-xs text-primary hover:text-primary/80 font-medium flex items-center gap-1",children:[e.jsx(Ce,{className:"h-3 w-3"}),a("providerAddModel")]})]}),pe&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(q,{value:T,onChange:s=>M(s.target.value),onKeyDown:s=>{s.key==="Enter"&&(s.preventDefault(),Be()),s.key==="Escape"&&(oe(!1),M(""))},placeholder:a("providerModelInputPlaceholder"),className:"flex-1 rounded-xl",autoFocus:!0}),e.jsx(B,{type:"button",size:"sm",onClick:Be,disabled:T.trim().length===0,children:a("add")}),e.jsx(B,{type:"button",size:"sm",variant:"ghost",onClick:()=>{oe(!1),M("")},children:e.jsx(He,{className:"h-4 w-4"})})]}),w.length===0?e.jsxs("div",{className:"rounded-xl border border-dashed border-gray-200 bg-gray-50 px-4 py-6 text-center",children:[e.jsx("p",{className:"text-sm text-gray-500",children:a("providerModelsEmptyShort")}),!pe&&e.jsx("button",{type:"button",onClick:()=>oe(!0),className:"mt-2 text-sm text-primary hover:text-primary/80 font-medium",children:a("providerAddFirstModel")})]}):e.jsx("div",{className:"flex flex-wrap gap-2",children:w.map(s=>e.jsxs("div",{className:"group inline-flex max-w-full items-center gap-1 rounded-full border border-gray-200 bg-white px-3 py-1.5",children:[e.jsx("span",{className:"max-w-[180px] truncate text-sm text-gray-800 sm:max-w-[240px]",children:s}),e.jsx("button",{type:"button",onClick:()=>A(d=>d.filter(p=>p!==s)),className:"inline-flex h-5 w-5 items-center justify-center rounded-full text-gray-400 transition-opacity hover:bg-gray-100 hover:text-gray-600 opacity-100 md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100","aria-label":a("remove"),children:e.jsx(He,{className:"h-3 w-3"})})]},s))})]}),e.jsxs("div",{className:"border-t border-gray-100 pt-4",children:[e.jsxs("button",{type:"button",onClick:()=>le(!Z),className:"flex w-full items-center justify-between text-sm text-gray-600 hover:text-gray-900 transition-colors",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(ft,{className:"h-3.5 w-3.5"}),a("providerAdvancedSettings")]}),e.jsx(yt,{className:`h-4 w-4 transition-transform ${Z?"rotate-180":""}`})]}),Z&&e.jsxs("div",{className:"mt-4 space-y-5",children:[n.supportsWireApi&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(R,{htmlFor:"wireApi",className:"text-sm font-medium text-gray-900",children:(ye==null?void 0:ye.label)??a("wireApi")}),it?e.jsx(Je,{value:u,onChange:s=>g(s),options:ve}):e.jsxs(We,{value:u,onValueChange:s=>g(s),children:[e.jsx(qe,{className:"rounded-xl",children:e.jsx(Ue,{})}),e.jsx(Ge,{children:ve.map(s=>e.jsx(Qe,{value:s.value,children:s.label},s.value))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(R,{className:"text-sm font-medium text-gray-900",children:(fe==null?void 0:fe.label)??a("extraHeaders")}),e.jsx(Kt,{value:O,onChange:X}),e.jsx("p",{className:"text-xs text-gray-500",children:a("providerExtraHeadersHelpShort")})]})]})]})]}),e.jsxs("div",{className:"flex items-center justify-between border-t border-gray-100 px-6 py-4",children:[e.jsxs(B,{type:"button",variant:"outline",size:"sm",onClick:ot,disabled:f.isPending,children:[e.jsx(gt,{className:"mr-1.5 h-4 w-4"}),f.isPending?a("providerTestingConnection"):a("providerTestConnection")]}),e.jsx(B,{type:"submit",disabled:h.isPending||!$e,children:h.isPending?a("saving"):$e?a("save"):a("unchanged")})]})]})]})}function Ut(t){if(!t)return null;try{const i=new URL(t),r=i.pathname&&i.pathname!=="/"?i.pathname:"";return`${i.host}${r}`}catch{return t.replace(/^https?:\/\//,"")}}function rs(){const{data:t}=Ze(),{data:i}=et(),{data:r}=tt(),l=St(),[m,j]=c.useState("installed"),[h,x]=c.useState(),[f,b]=c.useState(""),v=r==null?void 0:r.uiHints,D=(i==null?void 0:i.providers)??[],E=(t==null?void 0:t.providers)??{},P=D.filter(u=>{var g;return(g=E[u.name])==null?void 0:g.apiKeySet}).length,N=[{id:"installed",label:a("providersTabConfigured"),count:P},{id:"all",label:a("providersTabAll"),count:D.length}],C=c.useMemo(()=>{const u=(i==null?void 0:i.providers)??[],g=(t==null?void 0:t.providers)??{},w=f.trim().toLowerCase();return u.filter(A=>{var T;return m==="installed"?!!((T=g[A.name])!=null&&T.apiKeySet):!0}).filter(A=>{var $,H;return w?(((H=($=g[A.name])==null?void 0:$.displayName)==null?void 0:H.trim())||A.displayName||A.name).toLowerCase().includes(w)||A.name.toLowerCase().includes(w):!0})},[i,t,m,f]);c.useEffect(()=>{if(C.length===0){x(void 0);return}C.some(g=>g.name===h)||x(C[0].name)},[C,h]);const O=h,X=async()=>{try{const u=await l.mutateAsync({data:{}});j("all"),b(""),x(u.name)}catch{}};return!t||!i?e.jsx("div",{className:"p-8",children:a("providersLoading")}):e.jsxs(It,{children:[e.jsx(Dt,{title:a("providersPageTitle"),description:a("providersPageDescription")}),e.jsxs("div",{className:kt,children:[e.jsxs("section",{className:$t,children:[e.jsxs("div",{className:"border-b border-gray-100 px-4 pt-4 pb-3 space-y-3",children:[e.jsx(Tt,{tabs:N,activeTab:m,onChange:j,className:"mb-0"}),e.jsxs(B,{type:"button",variant:"outline",className:"w-full justify-center",onClick:X,disabled:l.isPending,children:[e.jsx(Ce,{className:"mr-2 h-4 w-4"}),l.isPending?a("saving"):a("providerAddCustom")]})]}),e.jsx("div",{className:"border-b border-gray-100 px-4 py-3",children:e.jsxs("div",{className:"relative",children:[e.jsx(jt,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400"}),e.jsx(q,{value:f,onChange:u=>b(u.target.value),placeholder:a("providersFilterPlaceholder"),className:"h-10 rounded-xl pl-9"})]})}),e.jsxs("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto p-3",children:[C.map(u=>{var le;const g=t.providers[u.name],w=!!(g!=null&&g.apiKeySet),A=O===u.name,T=((le=g==null?void 0:g.displayName)==null?void 0:le.trim())||u.displayName||u.name,M=re(`providers.${u.name}`,v),$=(g==null?void 0:g.apiBase)||u.defaultApiBase||"",Z=Ut($)||(M==null?void 0:M.help)||a("providersDefaultDescription");return e.jsx("button",{type:"button",onClick:()=>x(u.name),className:ie("w-full rounded-xl border p-2.5 text-left transition-all",A?"border-primary/30 bg-primary-50/40 shadow-sm":"border-gray-200/70 bg-white hover:border-gray-300 hover:bg-gray-50/70"),children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsx(Bt,{name:u.name,src:u.logo?`/logos/${u.logo}`:null,className:ie("h-10 w-10 rounded-lg border",w?"border-primary/30 bg-white":"border-gray-200/70 bg-white"),imgClassName:"h-5 w-5 object-contain",fallback:e.jsx("span",{className:"text-sm font-semibold uppercase text-gray-500",children:u.name[0]})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-sm font-semibold text-gray-900",children:T}),e.jsx("p",{className:"line-clamp-1 text-[11px] text-gray-500",children:Z})]})]}),e.jsx(st,{status:w?"ready":"setup",label:w?a("statusReady"):a("statusSetup"),className:"min-w-[56px] justify-center"})]})},u.name)}),C.length===0&&e.jsxs("div",{className:"flex h-full min-h-[220px] flex-col items-center justify-center rounded-xl border border-dashed border-gray-200 bg-gray-50/70 py-10 text-center",children:[e.jsx("div",{className:"mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-white",children:e.jsx(bt,{className:"h-5 w-5 text-gray-300"})}),e.jsx("p",{className:"text-sm font-medium text-gray-700",children:a("providersNoMatch")})]})]})]}),e.jsx(qt,{providerName:O,onProviderDeleted:u=>{u===h&&x(void 0)}})]})]})}export{rs as ProvidersList};