Move active frontend into xianyu-go

This commit is contained in:
Christ committed 2026-06-28 12:01:39 +08:00
1 parent 074554a6de
commit 0a0a14687b
38 files changed
+15303 -461

No files matched your search

+5 -1
View File
@@ -20,8 +20,12 @@
/tmp/
*.log
# Frontend dependencies
/frontend/node_modules/
/frontend/.env.local
/frontend/.env.*.local
# OS / editor
.DS_Store
.idea/
.vscode/
+81 -49
View File
@@ -1,70 +1,108 @@
# 闲鱼管家 Go 后端
# 闲鱼管家
这是闲鱼自动回复/自动发货系统的 Go 重写后端。
这是当前活跃版本:Go 后端 + React 前端。
## 运行方式
旧目录 `../xianyu-super-butler/` 是历史 Python/FastAPI 版本。当前 `xianyu-go` 仓库已经包含自己的前端源码,后续功能迭代应改这里:
### 1) 本地开发运行
```text
xianyu-go/
cmd/server/ Go 服务入口
internal/ Go 后端代码
frontend/ 当前活跃 React 前端源码
internal/webui/static/ 前端构建产物,Go 会内置并提供给浏览器
```
先构建前端静态文件:
## 首次运行
### 1. 安装前端依赖并构建
```bash
cd /Users/christ/Workspace/git/xianyu/xianyu-super-butler/frontend
cd /Users/christ/Workspace/git/xianyu/xianyu-go/frontend
npm install
npm run build
```
启动后端:
```bash
cd /Users/christ/Workspace/git/xianyu/xianyu-go
go run ./cmd/server \
-db data/xianyu_data.db \
-addr :8080 \
-web /Users/christ/Workspace/git/xianyu/xianyu-super-butler/static
```
浏览器打开:
构建产物会写入:
```text
http://localhost:8080
xianyu-go/internal/webui/static/
```
### 2) 首次初始化管理员
系统第一次启动前先初始化管理员:
### 2. 初始化管理员
```bash
cd /Users/christ/Workspace/git/xianyu/xianyu-go
go run ./cmd/server -init-admin -db data/xianyu_data.db
```
也可以指定密码:
也可以非交互传密码:
```bash
go run ./cmd/server -init-admin -db data/xianyu_data.db -admin-password '你的密码'
go run ./cmd/server \
-init-admin \
-db data/xianyu_data.db \
-admin-password '你的密码'
```
### 3) 编译后运行
### 3. 启动服务
```bash
cd /Users/christ/Workspace/git/xianyu/xianyu-go
go run ./cmd/server -db data/xianyu_data.db -addr :8080
```
浏览器访问:
```text
http://localhost:8080
```
不传 `-web` 时,Go 会使用 `internal/webui/static` 中的内置前端资源。
## 开发模式
后端:
```bash
cd /Users/christ/Workspace/git/xianyu/xianyu-go
go run ./cmd/server -db data/xianyu_data.db -addr :8080
```
前端开发服务器:
```bash
cd /Users/christ/Workspace/git/xianyu/xianyu-go/frontend
npm run dev
```
访问:
```text
http://localhost:3000
```
Vite 会把 API 请求代理到 `http://localhost:8080`。
## 编译运行
```bash
cd /Users/christ/Workspace/git/xianyu/xianyu-go
go build -o xianyu-server ./cmd/server
go build -o xianyu-init-admin ./cmd/init-admin
./xianyu-server -db data/xianyu_data.db -addr :8080
```
运行:
如果要使用外部前端目录,也可以传:
```bash
./xianyu-server -db data/xianyu_data.db -addr :8080 -web /Users/christ/Workspace/git/xianyu/xianyu-super-butler/static
./xianyu-server -db data/xianyu_data.db -addr :8080 -web /path/to/static
```
### 4) Docker 部署
## Docker 部署注意
批量铺货会用到上传目录,建议挂载持久化数据:
批量铺货会用到上传目录。容器部署时建议挂载持久化数据:
```bash
docker run -v ./data:/app/data ...
-v ./data:/app/data
```
并设置:
@@ -73,39 +111,33 @@ docker run -v ./data:/app/data ...
XIANYU_UPLOAD_DIR=/app/data/uploads
```
数据库建议放在:
```text
/app/data/xianyu_data.db
```
## 常用参数
| 参数 | 说明 |
| --- | --- |
| `-db` | SQLite 数据库路径,默认 `data/xianyu_data.db` |
| `-addr` | HTTP 监听地址,默认 `:8080` |
| `-web` | 前端静态资源目录(包含 `index.html`) |
| `-init-admin` | 初始化/重置管理员后退出 |
| `-web` | 外部前端静态资源目录;不传则用内置前端 |
| `-init-admin` | 初始化或重置管理员后退出 |
| `-admin-email` | 初始化管理员邮箱 |
| `-admin-password` | 初始化管理员密码 |
| `-no-browser` | 禁用内置浏览器自动化 |
| `-secure` | HTTPS 模式(Cookie 加 Secure) |
| `-v` | 输出调试日志 |
| `-secure` | HTTPS 模式,Cookie 加 Secure |
| `-v` | 调试日志 |
## 构建检查
## 验证
```bash
cd /Users/christ/Workspace/git/xianyu/xianyu-go
go test ./...
```
前端:
```bash
cd /Users/christ/Workspace/git/xianyu/xianyu-super-butler/frontend
cd /Users/christ/Workspace/git/xianyu/xianyu-go/frontend
npm run build
```
## 目录说明
- `cmd/server`:主服务入口
- `cmd/init-admin`:管理员初始化 CLI
- `internal/db`:SQLite 和迁移
- `internal/server`:HTTP API
- `internal/engine`:账号运行时
- `internal/xianyu`:协议和 mtop 调用
- `internal/webui`:内置静态前端资源
+24
View File
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
+232
View File
@@ -0,0 +1,232 @@
import React, { useState, useEffect } from 'react';
import Sidebar from './components/Sidebar';
import Dashboard from './components/Dashboard';
import AccountList from './components/AccountList';
import OrderList from './components/OrderList';
import CardList from './components/CardList';
import ItemList from './components/ItemList';
import Settings from './components/Settings';
import Keywords from './components/Keywords';
import { login, verifySession } from './services/api';
import { ShieldCheck, ArrowRight, Loader2, User, Lock } from 'lucide-react';
interface DeliveryRuleTarget {
cookieId: string;
itemId: string;
requestId: number;
}
const App: React.FC = () => {
const [isLoggedIn, setIsLoggedIn] = useState(false);
const [activeTab, setActiveTab] = useState('dashboard');
const [checkingAuth, setCheckingAuth] = useState(true);
const [needsInit, setNeedsInit] = useState(false);
const [username, setUsername] = useState('');
const [password, setPassword] = useState('');
const [loginLoading, setLoginLoading] = useState(false);
const [loginError, setLoginError] = useState('');
const [deliveryRuleTarget, setDeliveryRuleTarget] = useState<DeliveryRuleTarget | undefined>();
// Check auth on mount
useEffect(() => {
verifySession()
.then((res) => {
if (res?.initialized === false) {
setNeedsInit(true);
setIsLoggedIn(false);
return;
}
setNeedsInit(false);
if (res?.authenticated) setIsLoggedIn(true);
})
.catch(() => setIsLoggedIn(false))
.finally(() => setCheckingAuth(false));
const handleLogout = () => setIsLoggedIn(false);
window.addEventListener('auth:logout', handleLogout);
return () => window.removeEventListener('auth:logout', handleLogout);
}, []);
const handleLogin = async (e: React.FormEvent) => {
e.preventDefault();
setLoginLoading(true);
setLoginError('');
try {
const res = await login({ username, password });
if (res.success) {
setIsLoggedIn(true);
} else {
setLoginError(res.message || '登录失败');
}
} catch (err) {
const msg = err instanceof Error ? err.message : String(err);
setLoginError(msg || '登录失败');
} finally {
setLoginLoading(false);
}
};
if (checkingAuth) {
return (
<div className="min-h-screen flex items-center justify-center bg-[#f5f5f7]">
<Loader2 className="w-8 h-8 text-[#0094f7] animate-spin" />
</div>
);
}
// Init Screen (system not initialized)
if (needsInit) {
return (
<div className="min-h-screen flex items-center justify-center bg-[#F4F5F7] p-4 relative overflow-hidden font-sans">
<div className="absolute top-[-10%] left-[-10%] w-[60%] h-[60%] bg-blue-200/40 rounded-full blur-[120px] animate-pulse"></div>
<div className="absolute bottom-[-10%] right-[-10%] w-[60%] h-[60%] bg-blue-200/30 rounded-full blur-[120px] animate-pulse" style={{animationDelay: '2s'}}></div>
<div className="bg-white/80 backdrop-blur-3xl p-8 md:p-12 rounded-[3rem] shadow-[0_20px_60px_-15px_rgba(0,0,0,0.05)] w-full max-w-xl border border-white relative z-10 animate-fade-in">
<div className="text-center mb-8">
<div className="w-24 h-24 bg-[#0094f7] squircle flex items-center justify-center mx-auto mb-6 transition-all duration-500 p-4" style={{ filter: 'drop-shadow(0 8px 20px rgba(0,148,247,0.3))' }}>
<img src="/static/ydisks-logo.svg" alt="Ydisks" className="w-full h-full" />
</div>
<h2 className="text-3xl font-extrabold text-gray-900 mb-2 tracking-tight">系统尚未初始化</h2>
<p className="text-gray-600 font-medium">为避免默认口令风险,管理员必须通过服务器本机 CLI 初始化。</p>
</div>
<div className="space-y-4">
<div className="p-4 rounded-2xl bg-gray-50 border border-gray-100">
<div className="text-sm font-bold text-gray-900 mb-2">请在服务器上执行:</div>
<pre className="text-xs bg-black text-white p-4 rounded-2xl overflow-x-auto">python3 init_admin.py</pre>
<div className="text-xs text-gray-500 mt-2">完成后刷新页面即可进入登录。</div>
</div>
<button
type="button"
onClick={() => window.location.reload()}
className="w-full ios-btn-primary h-14 rounded-2xl text-lg shadow-xl shadow-blue-200 mt-2 flex items-center justify-center gap-2 group"
>
我已初始化,刷新 <ArrowRight className="w-5 h-5 group-hover:translate-x-1 transition-transform" />
</button>
</div>
<div className="mt-8 pt-6 border-t border-gray-100 text-center">
<span className="text-xs text-gray-400 font-medium tracking-widest uppercase">Secure Bootstrap</span>
</div>
</div>
</div>
);
}
// Login Screen Component
if (!isLoggedIn) {
return (
<div className="min-h-screen flex items-center justify-center bg-[#F4F5F7] p-4 relative overflow-hidden font-sans">
{/* Animated Background Blobs */}
<div className="absolute top-[-10%] left-[-10%] w-[60%] h-[60%] bg-blue-200/40 rounded-full blur-[120px] animate-pulse"></div>
<div className="absolute bottom-[-10%] right-[-10%] w-[60%] h-[60%] bg-blue-200/30 rounded-full blur-[120px] animate-pulse" style={{animationDelay: '2s'}}></div>
<div className="bg-white/80 backdrop-blur-3xl p-8 md:p-12 rounded-[3rem] shadow-[0_20px_60px_-15px_rgba(0,0,0,0.05)] w-full max-w-lg border border-white relative z-10 animate-fade-in">
{/* Header with Logo */}
<div className="text-center mb-10">
<div className="w-24 h-24 bg-[#0094f7] squircle flex items-center justify-center mx-auto mb-6 transition-all duration-500 cursor-pointer group p-4" style={{ filter: 'drop-shadow(0 8px 20px rgba(0,148,247,0.3))' }}>
<img src="/static/ydisks-logo.svg" alt="Ydisks" className="w-full h-full group-hover:scale-110 transition-transform" />
</div>
<h2 className="text-3xl font-extrabold text-gray-900 mb-2 tracking-tight">欢迎回来</h2>
<p className="text-gray-500 font-medium">Ydisks闲鱼助手 · 自动发货与管家系统</p>
</div>
<form onSubmit={handleLogin} className="space-y-5">
<div className="space-y-4">
<div className="relative group">
<User className="absolute left-5 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400 group-focus-within:text-black transition-colors" />
<input
type="text"
placeholder="管理员账号"
value={username}
onChange={e => setUsername(e.target.value)}
className="w-full ios-input pl-14 pr-6 py-4.5 rounded-2xl text-base h-14"
/>
</div>
<div className="relative group">
<Lock className="absolute left-5 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400 group-focus-within:text-black transition-colors" />
<input
type="password"
placeholder="密码"
value={password}
onChange={e => setPassword(e.target.value)}
className="w-full ios-input pl-14 pr-6 py-4.5 rounded-2xl text-base h-14"
/>
</div>
</div>
{loginError && (
<div className="p-3 rounded-xl bg-red-50 text-red-500 text-sm text-center font-bold flex items-center justify-center gap-2">
<ShieldCheck className="w-4 h-4" /> {loginError}
</div>
)}
<button
type="submit"
disabled={loginLoading}
className="w-full ios-btn-primary h-14 rounded-2xl text-lg shadow-xl shadow-blue-200 mt-2 flex items-center justify-center gap-2 group disabled:opacity-70"
>
{loginLoading ? <Loader2 className="w-5 h-5 animate-spin" /> : <>立即登录 <ArrowRight className="w-5 h-5 group-hover:translate-x-1 transition-transform" /></>}
</button>
</form>
<div className="mt-8 pt-6 border-t border-gray-100">
<div className="mt-6 text-center">
<span className="text-xs text-gray-400 font-medium tracking-widest uppercase">
Ydisks闲鱼助手 v1.0
</span>
</div>
</div>
</div>
</div>
);
}
// Main App Layout
const renderContent = () => {
switch (activeTab) {
case 'dashboard': return <Dashboard />;
case 'accounts': return <AccountList />;
case 'orders': return <OrderList />;
case 'cards': return <CardList />;
case 'items': return <ItemList onConfigureDelivery={(item) => {
setDeliveryRuleTarget({ cookieId: item.cookie_id, itemId: item.item_id, requestId: Date.now() });
setActiveTab('keywords');
}} />;
case 'keywords': return <Keywords
initialDeliveryTarget={deliveryRuleTarget}
onDeliveryTargetHandled={() => setDeliveryRuleTarget(undefined)}
/>;
case 'settings': return <Settings />;
default: return <Dashboard />;
}
};
return (
<div className="flex min-h-screen bg-[#F4F5F7] text-[#111]">
<Sidebar
activeTab={activeTab}
setActiveTab={setActiveTab}
onLogout={() => {
setIsLoggedIn(false);
}}
/>
<main className="flex-1 ml-64 p-8 md:p-12 overflow-y-auto h-screen relative scroll-smooth">
{/* Subtle background decoration */}
<div className="fixed top-0 right-0 w-[800px] h-[800px] bg-gradient-to-bl from-blue-50 to-transparent rounded-full blur-[120px] pointer-events-none -z-10 opacity-60"></div>
<div className="max-w-[1400px] mx-auto pb-10">
{renderContent()}
</div>
</main>
</div>
);
};
export default App;
+20
View File
@@ -0,0 +1,20 @@
<div align="center">
<img width="1200" height="475" alt="GHBanner" src="https://github.com/user-attachments/assets/0aa67016-6eaf-458a-adb2-6e31a0763ed6" />
</div>
# Run and deploy your AI Studio app
This contains everything you need to run your app locally.
View your app in AI Studio: https://ai.studio/apps/drive/1hYczcAh9GFYFUirg6w2-9S7ImveWBsZT
## Run Locally
**Prerequisites:** Node.js
1. Install dependencies:
`npm install`
2. Set the `GEMINI_API_KEY` in [.env.local](.env.local) to your Gemini API key
3. Run the app:
`npm run dev`
+830
View File
@@ -0,0 +1,830 @@
import React, { useEffect, useState } from 'react';
import { createPortal } from 'react-dom';
import { AccountDetail, AIReplySettings } from '../types';
import {
getAccountDetails,
getAccountRuntimeStatuses,
addAccount,
updateAccountStatus,
deleteAccount,
generateQRLogin,
checkQRLoginStatus,
completeQRVerification,
updateAccountRemark,
updateAccountAutoConfirm,
updateAccountPauseDuration,
updateAccountCookie,
updateAccountLoginInfo,
updateAccountAISettings,
getAllAISettings,
getAccountAISettings
} from '../services/api';
import {
Plus, Power, Edit2, Trash2, QrCode, X, Check, Loader2,
RefreshCw, Save, User, Clock, MessageCircle,
Upload, Key, Eye, EyeOff, Bot, Settings, AlertCircle, ExternalLink
} from 'lucide-react';
type ModalType = 'edit' | 'ai-settings' | null;
const AccountList: React.FC = () => {
const [accounts, setAccounts] = useState<AccountDetail[]>([]);
const [loading, setLoading] = useState(true);
const [showQRModal, setShowQRModal] = useState(false);
const [qrCodeUrl, setQrCodeUrl] = useState<string>('');
const [qrStatus, setQrStatus] = useState<string>('pending');
const [verificationUrl, setVerificationUrl] = useState<string>('');
const [verificationScreenshot, setVerificationScreenshot] = useState<string>('');
const [qrSessionId, setQrSessionId] = useState<string>('');
const [activeModal, setActiveModal] = useState<ModalType>(null);
const [editingAccount, setEditingAccount] = useState<AccountDetail | null>(null);
// 编辑表单状态
const [editForm, setEditForm] = useState({
remark: '',
cookie: '',
auto_confirm: false,
pause_duration: 0,
username: '',
login_password: '',
show_browser: false,
showLoginPassword: false,
});
// AI设置表单状态
const [aiSettings, setAiSettings] = useState<AIReplySettings>({
ai_enabled: false,
max_discount_percent: 10,
max_discount_amount: 100,
max_bargain_rounds: 3,
custom_prompts: '',
});
const [saving, setSaving] = useState(false);
const refreshRuntimeStatuses = async () => {
try {
const statuses = await getAccountRuntimeStatuses();
setAccounts(current => current.map(account => {
const status = statuses[account.id];
if (!status) return account;
return {
...account,
runtime_state: status.state,
runtime_message: status.message || '',
runtime_connected: status.connected,
runtime_updated_at: status.updated_at,
};
}));
} catch (error) {
console.error('Failed to load account runtime statuses:', error);
}
};
const loadAccounts = async () => {
setLoading(true);
try {
const data = await getAccountDetails();
// 获取所有账号的AI设置
let allAISettings: Record<string, AIReplySettings> = {};
try {
allAISettings = await getAllAISettings();
} catch (e) {
console.error('Failed to load AI settings:', e);
}
// 合并AI设置到账号数据
const accountsWithAI = data.map(account => ({
...account,
ai_enabled: allAISettings[account.id]?.ai_enabled ?? false,
max_discount_percent: allAISettings[account.id]?.max_discount_percent ?? 10,
max_discount_amount: allAISettings[account.id]?.max_discount_amount ?? 100,
max_bargain_rounds: allAISettings[account.id]?.max_bargain_rounds ?? 3,
custom_prompts: allAISettings[account.id]?.custom_prompts ?? '',
}));
setAccounts(accountsWithAI);
window.setTimeout(refreshRuntimeStatuses, 0);
} catch (error) {
console.error('Failed to load accounts:', error);
} finally {
setLoading(false);
}
};
useEffect(() => {
loadAccounts();
const timer = window.setInterval(refreshRuntimeStatuses, 10_000);
return () => window.clearInterval(timer);
}, []);
const runtimePresentation = (account: AccountDetail) => {
if (!account.enabled || account.runtime_state === 'disabled') {
return { label: '已停用', badge: 'bg-gray-100 text-gray-500', dot: 'bg-gray-300' };
}
switch (account.runtime_state) {
case 'online':
return { label: '在线', badge: 'bg-green-100 text-green-700', dot: 'bg-green-500' };
case 'starting':
case 'connecting':
return { label: '连接中', badge: 'bg-blue-100 text-blue-700', dot: 'bg-blue-500' };
case 'reconnecting':
return { label: '重连中', badge: 'bg-amber-100 text-amber-700', dot: 'bg-amber-500' };
case 'auth_expired':
return { label: '登录已失效', badge: 'bg-red-100 text-red-700', dot: 'bg-red-500' };
case 'verification_required':
return { label: '需要验证', badge: 'bg-orange-100 text-orange-700', dot: 'bg-orange-500' };
case 'error':
case 'stopped':
return { label: '运行异常', badge: 'bg-red-100 text-red-700', dot: 'bg-red-500' };
default:
return { label: '状态检测中', badge: 'bg-gray-100 text-gray-600', dot: 'bg-gray-400' };
}
};
const handleToggle = async (id: string, currentStatus: boolean) => {
await updateAccountStatus(id, !currentStatus);
loadAccounts();
};
const handleDelete = async (id: string) => {
if (confirm('确认删除该账号吗?')) {
await deleteAccount(id);
loadAccounts();
}
};
const openEditModal = (account: AccountDetail) => {
setEditingAccount(account);
setEditForm({
remark: account.remark || account.note || '',
cookie: account.cookie || account.value || '',
auto_confirm: account.auto_confirm || false,
pause_duration: account.pause_duration || 0,
username: account.username || '',
login_password: account.login_password || '',
show_browser: account.show_browser || false,
showLoginPassword: false,
});
setActiveModal('edit');
};
const openAIModal = async (account: AccountDetail) => {
setEditingAccount(account);
setSaving(true);
try {
const settings = await getAccountAISettings(account.id);
setAiSettings({
ai_enabled: settings.ai_enabled ?? false,
max_discount_percent: settings.max_discount_percent ?? 10,
max_discount_amount: settings.max_discount_amount ?? 100,
max_bargain_rounds: settings.max_bargain_rounds ?? 3,
custom_prompts: settings.custom_prompts ?? '',
});
} catch (e) {
console.error('Failed to load AI settings:', e);
} finally {
setSaving(false);
}
setActiveModal('ai-settings');
};
const handleSaveEdit = async () => {
if (!editingAccount) return;
setSaving(true);
try {
const promises: Promise<any>[] = [];
// 更新备注
if (editForm.remark !== (editingAccount.remark || editingAccount.note || '')) {
promises.push(updateAccountRemark(editingAccount.id, editForm.remark));
}
// 更新Cookie
if (editForm.cookie && editForm.cookie !== (editingAccount.cookie || editingAccount.value || '')) {
promises.push(updateAccountCookie(editingAccount.id, editForm.cookie));
}
// 更新自动确认
if (editForm.auto_confirm !== editingAccount.auto_confirm) {
promises.push(updateAccountAutoConfirm(editingAccount.id, editForm.auto_confirm));
}
// 更新暂停时长
if (editForm.pause_duration !== (editingAccount.pause_duration || 0)) {
promises.push(updateAccountPauseDuration(editingAccount.id, editForm.pause_duration));
}
// 更新登录信息
if (
editForm.username !== (editingAccount.username || '') ||
editForm.login_password !== (editingAccount.login_password || '') ||
editForm.show_browser !== (editingAccount.show_browser || false)
) {
promises.push(updateAccountLoginInfo(editingAccount.id, {
username: editForm.username,
login_password: editForm.login_password,
show_browser: editForm.show_browser,
}));
}
await Promise.all(promises);
setActiveModal(null);
loadAccounts();
} catch (error) {
console.error('更新账号失败:', error);
alert('更新失败,请重试');
} finally {
setSaving(false);
}
};
const handleSaveAISettings = async () => {
if (!editingAccount) return;
setSaving(true);
try {
await updateAccountAISettings(editingAccount.id, aiSettings);
setActiveModal(null);
loadAccounts();
} catch (error) {
console.error('更新AI设置失败:', error);
alert('更新失败,请重试');
} finally {
setSaving(false);
}
};
const startQRLogin = async () => {
setShowQRModal(true);
setQrStatus('loading');
try {
const res = await generateQRLogin();
if (res.success && res.qr_code_url && res.session_id) {
setQrCodeUrl(res.qr_code_url);
setQrSessionId(res.session_id);
setQrStatus('waiting');
const interval = setInterval(async () => {
const statusRes = await checkQRLoginStatus(res.session_id!);
if (statusRes.status === 'success') {
clearInterval(interval);
setQrStatus('success');
// 把扫码拿到的 cookie 入库(cookie_id 用 unb)。
if (statusRes.cookies && statusRes.unb) {
try {
await addAccount(statusRes.unb, statusRes.cookies);
} catch (e) {
console.error('保存扫码账号失败', e);
}
}
setTimeout(() => {
setShowQRModal(false);
loadAccounts();
}, 1000);
} else if (statusRes.status === 'scanned') {
setQrStatus('waiting'); // 已扫描,继续等待确认
} else if (statusRes.status === 'expired' || statusRes.status === 'cancelled' || statusRes.status === 'error' || statusRes.status === 'not_found') {
clearInterval(interval);
setQrStatus('error');
} else if (statusRes.status === 'verification_required') {
setQrStatus('verification');
setVerificationUrl(statusRes.verification_url || '');
if (statusRes.verification_screenshot) {
setVerificationScreenshot(statusRes.verification_screenshot);
}
}
}, 2000);
}
} catch (e) {
setQrStatus('error');
}
};
// 用户完成风控验证后,点"我已完成验证"调用后端提取真实 cookie。
const handleCompleteVerification = async () => {
if (!qrSessionId) return;
setQrStatus('loading');
try {
const res = await completeQRVerification(qrSessionId);
if (res.success && res.cookies && res.unb) {
await addAccount(res.unb, res.cookies);
setQrStatus('success');
setTimeout(() => {
setShowQRModal(false);
loadAccounts();
}, 1000);
} else {
setQrStatus('verification');
alert('验证未完成:' + (res.message || '可能验证尚未通过,请先在验证页面完成验证'));
}
} catch (e) {
setQrStatus('verification');
alert('处理失败:' + (e instanceof Error ? e.message : String(e)));
}
};
if (loading) return <div className="p-20 flex justify-center"><Loader2 className="w-8 h-8 text-[#0094f7] animate-spin"/></div>;
return (
<div className="space-y-8 animate-fade-in relative">
<div className="flex justify-between items-end">
<div>
<h2 className="text-4xl font-extrabold text-gray-900 tracking-tight">账号管理</h2>
<p className="text-gray-500 mt-2 font-medium">管理您的闲鱼授权账号及设置。</p>
</div>
<button
onClick={startQRLogin}
className="ios-btn-primary flex items-center gap-2 px-6 py-3 rounded-2xl font-bold shadow-lg shadow-blue-200 transition-transform hover:scale-105 active:scale-95"
>
<QrCode className="w-5 h-5" />
扫码添加新账号
</button>
</div>
{/* Account Grid */}
<div className="grid grid-cols-1 gap-6">
{accounts.map((account) => {
const runtime = runtimePresentation(account);
const requiresLogin = account.runtime_state === 'auth_expired' || account.runtime_state === 'verification_required';
return (
<div key={account.id} className="ios-card p-6 rounded-[2rem] flex flex-col lg:flex-row lg:items-center justify-between gap-5 group hover:border-[#0094f7] transition-all duration-300">
<div className="flex items-center gap-5 sm:gap-8 min-w-0">
<div className="relative">
{account.avatar_url ? (
<img
src={account.avatar_url}
alt={account.nickname || '账号头像'}
className="w-20 h-20 rounded-3xl object-cover shadow-md ring-4 ring-white bg-gray-100"
/>
) : (
<div className="w-20 h-20 rounded-3xl bg-gray-100 text-gray-400 shadow-md ring-4 ring-white flex items-center justify-center">
<User className="w-9 h-9" />
</div>
)}
<div className={`absolute -bottom-1 -right-1 w-6 h-6 rounded-full border-4 border-white flex items-center justify-center ${runtime.dot}`}>
{account.runtime_state === 'online' && <Check className="w-3 h-3 text-white" />}
</div>
</div>
<div className="min-w-0">
<div className="flex flex-wrap items-center gap-3 mb-1">
<h3 className="text-xl font-extrabold text-gray-900 break-words">{account.nickname || account.remark || `账号 ${account.id.substring(0,6)}...`}</h3>
<span className={`px-2.5 py-0.5 rounded-lg text-xs font-bold ${runtime.badge}`}>{runtime.label}</span>
{account.ai_enabled && (
<span className="px-2.5 py-0.5 rounded-lg bg-purple-100 text-purple-700 text-xs font-bold flex items-center gap-1">
<Bot className="w-3 h-3" /> AI
</span>
)}
{account.profile_error && (
<span
className="px-2.5 py-0.5 rounded-lg bg-amber-100 text-amber-700 text-xs font-bold flex items-center gap-1"
title={account.profile_error}
>
<AlertCircle className="w-3 h-3" /> 资料未同步
</span>
)}
</div>
<p className="text-sm text-gray-500 font-medium mb-3">{account.remark || account.note || '暂无备注'}</p>
{account.runtime_message && account.runtime_state !== 'online' && account.runtime_state !== 'disabled' && (
<div className={`mb-3 flex flex-wrap items-center gap-2 text-sm font-medium ${requiresLogin ? 'text-red-700' : 'text-amber-700'}`}>
<AlertCircle className="w-4 h-4 flex-shrink-0" />
<span>{account.runtime_message}</span>
{requiresLogin && (
<button
type="button"
onClick={startQRLogin}
className="inline-flex items-center gap-1.5 rounded-lg bg-red-50 px-2.5 py-1 text-xs font-bold text-red-700 hover:bg-red-100"
>
<QrCode className="w-3.5 h-3.5" /> 重新扫码登录
</button>
)}
</div>
)}
<div className="flex gap-2">
{account.auto_confirm && <span className="text-xs bg-blue-50 text-blue-700 px-3 py-1.5 rounded-lg font-bold flex items-center gap-1.5"><Check className="w-3 h-3"/> 自动确认发货</span>}
{account.pause_duration > 0 && <span className="text-xs bg-blue-50 text-blue-700 px-3 py-1.5 rounded-lg font-bold flex items-center gap-1.5"><Clock className="w-3 h-3"/> 暂停{account.pause_duration}分钟</span>}
</div>
</div>
</div>
<div className="flex items-center gap-3 self-end lg:self-auto flex-shrink-0">
<button
onClick={() => openEditModal(account)}
className="p-3 rounded-xl hover:bg-gray-100 transition-colors text-gray-600"
title="编辑账号"
>
<Edit2 className="w-5 h-5" />
</button>
<button
onClick={() => openAIModal(account)}
className="p-3 rounded-xl hover:bg-purple-100 transition-colors text-purple-600"
title="AI设置"
>
<Bot className="w-5 h-5" />
</button>
<button
onClick={() => handleToggle(account.id, account.enabled)}
className={`p-3 rounded-xl transition-colors ${account.enabled ? 'text-green-600 hover:bg-green-50' : 'text-gray-400 hover:bg-gray-100'}`}
title={account.enabled ? '停用账号' : '启用账号'}
>
<Power className="w-5 h-5" />
</button>
<button
onClick={() => handleDelete(account.id)}
className="p-3 rounded-xl hover:bg-red-100 transition-colors text-red-500"
>
<Trash2 className="w-5 h-5" />
</button>
</div>
</div>
)})}
{accounts.length === 0 && (
<div className="ios-card p-12 text-center">
<div className="w-20 h-20 bg-gray-100 rounded-full flex items-center justify-center mx-auto mb-4">
<User className="w-10 h-10 text-gray-400" />
</div>
<h3 className="text-lg font-bold text-gray-900">暂无账号</h3>
<p className="text-gray-500 mt-1">请点击右上角扫码添加您的闲鱼账号</p>
</div>
)}
</div>
{/* QR Code Modal */}
{showQRModal && createPortal(
<div className="modal-overlay-centered">
<div className="modal-container relative" style={{maxWidth: '24rem'}}>
<button
onClick={() => setShowQRModal(false)}
className="absolute top-4 right-4 z-10 w-9 h-9 flex items-center justify-center bg-gray-100 hover:bg-gray-200 rounded-full transition-colors"
>
<X className="w-5 h-5 text-gray-600" />
</button>
<div className="modal-body">
<div className="text-center">
<h3 className="text-2xl font-extrabold text-gray-900 mb-2">扫码登录</h3>
<p className="text-gray-500 mb-8 font-medium">请打开闲鱼APP扫描下方二维码</p>
<div className="w-64 h-64 bg-[#F7F8FA] rounded-[2rem] mx-auto flex items-center justify-center overflow-hidden border-4 border-white shadow-inner mb-8 relative">
{qrStatus === 'loading' && <Loader2 className="w-10 h-10 text-[#0094f7] animate-spin" />}
{qrStatus === 'waiting' && <img src={qrCodeUrl} alt="QR Code" className="w-full h-full p-2" />}
{qrStatus === 'success' && (
<div className="absolute inset-0 bg-white/95 flex flex-col items-center justify-center text-green-600 animate-fade-in">
<div className="w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mb-4">
<Check className="w-8 h-8" />
</div>
<span className="font-bold text-lg">登录成功</span>
</div>
)}
{qrStatus === 'error' && (
<div className="flex flex-col items-center">
<span className="text-red-500 font-bold mb-2">获取失败</span>
<button onClick={startQRLogin} className="text-xs bg-gray-200 px-3 py-1 rounded-full flex items-center gap-1 hover:bg-gray-300"><RefreshCw className="w-3 h-3"/> 重试</button>
</div>
)}
{qrStatus === 'verification' && (
<div className="flex flex-col items-center px-4">
<span className="font-bold text-gray-900 mb-2">需要安全验证</span>
<span className="text-xs text-gray-500 mb-3 text-center">
程序已在后台打开验证页面,请用手机完成验证,验证通过后将自动登录。
</span>
{verificationScreenshot ? (
<img src={verificationScreenshot} alt="验证页面" className="w-full rounded-xl border mb-2" style={{maxHeight: 200, objectFit: 'contain'}} />
) : (
<div className="w-full h-32 bg-gray-100 rounded-xl flex items-center justify-center mb-2">
<Loader2 className="w-6 h-6 animate-spin text-gray-400" />
</div>
)}
<span className="text-xs text-gray-400">等待手机验证完成,无需手动操作...</span>
</div>
)}
</div>
<p className="text-xs text-gray-400 font-medium bg-gray-50 py-2 rounded-xl">二维码有效期为5分钟,请尽快扫码。</p>
</div>
</div>
</div>
</div>,
document.body
)}
{/* 编辑账号弹窗 */}
{activeModal === 'edit' && editingAccount && createPortal(
<div className="modal-overlay-centered">
<div className="modal-container" style={{maxWidth: '600px'}}>
<div className="modal-header">
<div>
<h3 className="text-2xl font-extrabold text-gray-900">编辑账号</h3>
<p className="text-sm text-gray-500 mt-1">{editingAccount.nickname || editingAccount.remark || editingAccount.id}</p>
</div>
<button
onClick={() => setActiveModal(null)}
className="p-2 rounded-xl hover:bg-gray-100 transition-colors flex-shrink-0"
>
<X className="w-5 h-5 text-gray-500" />
</button>
</div>
<div className="modal-body space-y-6">
{/* 账号ID */}
<div>
<label className="block text-sm font-bold text-gray-700 mb-2">账号ID</label>
<input
type="text"
value={editingAccount.id}
disabled
className="w-full ios-input px-4 py-3 rounded-xl bg-gray-50 text-gray-500"
/>
</div>
{/* 备注 */}
<div>
<label className="block text-sm font-bold text-gray-700 mb-2">备注</label>
<input
type="text"
value={editForm.remark}
onChange={(e) => setEditForm({ ...editForm, remark: e.target.value })}
placeholder="为账号添加备注"
className="w-full ios-input px-4 py-3 rounded-xl"
/>
</div>
{/* Cookie */}
<div>
<label className="block text-sm font-bold text-gray-700 mb-2">Cookie</label>
<textarea
value={editForm.cookie}
onChange={(e) => setEditForm({ ...editForm, cookie: e.target.value })}
placeholder="更新账号Cookie"
className="w-full ios-input px-4 py-3 rounded-xl h-32 resize-none font-mono text-xs"
/>
<p className="text-xs text-gray-500 mt-1">当前Cookie长度: {editForm.cookie.length} 字符</p>
</div>
{/* 自动确认发货 */}
<div className="flex items-center justify-between p-4 bg-gray-50 rounded-xl">
<div>
<div className="font-bold text-gray-900 flex items-center gap-2">
<Check className="w-4 h-4 text-green-500" />
自动确认发货
</div>
<div className="text-xs text-gray-500">自动将闲鱼订单标记为已发货</div>
</div>
<button
type="button"
onClick={() => setEditForm({ ...editForm, auto_confirm: !editForm.auto_confirm })}
className={`w-14 h-8 rounded-full transition-colors duration-300 relative ${
editForm.auto_confirm ? 'bg-[#0094f7]' : 'bg-gray-300'
}`}
>
<span
className={`absolute left-1 top-1 w-6 h-6 bg-white rounded-full shadow-md transition-transform duration-300 ${
editForm.auto_confirm ? 'translate-x-6' : 'translate-x-0'
}`}
/>
</button>
</div>
{/* 暂停时长 */}
<div>
<label className="block text-sm font-bold text-gray-700 mb-2 flex items-center gap-2">
<Clock className="w-4 h-4 text-blue-500" />
暂停处理时长(分钟)
</label>
<input
type="number"
value={editForm.pause_duration}
onChange={(e) => setEditForm({ ...editForm, pause_duration: parseInt(e.target.value) || 0 })}
placeholder="0"
min="0"
max="1440"
className="w-full ios-input px-4 py-3 rounded-xl"
/>
<p className="text-xs text-gray-500 mt-1">设置后会暂停处理该账号的订单,到时间后自动恢复</p>
</div>
{/* 登录信息 */}
<div className="border-t border-gray-200 pt-6">
<h3 className="text-lg font-bold text-gray-900 mb-4 flex items-center gap-2">
<Key className="w-5 h-5 text-blue-500" />
登录信息
</h3>
<div className="space-y-4">
<div>
<label className="block text-sm font-bold text-gray-700 mb-2">用户名</label>
<input
type="text"
value={editForm.username}
onChange={(e) => setEditForm({ ...editForm, username: e.target.value })}
placeholder="闲鱼账号/手机号"
className="w-full ios-input px-4 py-3 rounded-xl"
/>
</div>
<div>
<label className="block text-sm font-bold text-gray-700 mb-2">登录密码</label>
<div className="relative">
<input
type={editForm.showLoginPassword ? 'text' : 'password'}
value={editForm.login_password}
onChange={(e) => setEditForm({ ...editForm, login_password: e.target.value })}
placeholder="用于自动登录"
className="w-full ios-input px-4 py-3 rounded-xl pr-12"
/>
<button
type="button"
onClick={() => setEditForm({ ...editForm, showLoginPassword: !editForm.showLoginPassword })}
className="absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600"
>
{editForm.showLoginPassword ? <EyeOff className="w-5 h-5" /> : <Eye className="w-5 h-5" />}
</button>
</div>
</div>
<div className="flex items-center justify-between">
<div>
<div className="font-bold text-gray-900">登录时显示浏览器</div>
<div className="text-xs text-gray-500">调试时可开启查看登录过程</div>
</div>
<button
type="button"
onClick={() => setEditForm({ ...editForm, show_browser: !editForm.show_browser })}
className={`w-14 h-8 rounded-full transition-colors duration-300 relative ${
editForm.show_browser ? 'bg-[#0094f7]' : 'bg-gray-300'
}`}
>
<span
className={`absolute left-1 top-1 w-6 h-6 bg-white rounded-full shadow-md transition-transform duration-300 ${
editForm.show_browser ? 'translate-x-6' : 'translate-x-0'
}`}
/>
</button>
</div>
</div>
</div>
</div>
<div className="modal-footer">
<div className="flex gap-3 w-full">
<button
onClick={() => setActiveModal(null)}
className="flex-1 px-6 py-3 rounded-xl font-bold bg-gray-100 text-gray-700 hover:bg-gray-200 transition-colors"
disabled={saving}
>
取消
</button>
<button
onClick={handleSaveEdit}
className="flex-1 ios-btn-primary px-6 py-3 rounded-xl font-bold flex items-center justify-center gap-2"
disabled={saving}
>
{saving ? <Loader2 className="w-4 h-4 animate-spin" /> : <Save className="w-4 h-4" />}
{saving ? '保存中...' : '保存'}
</button>
</div>
</div>
</div>
</div>,
document.body
)}
{/* AI设置弹窗 */}
{activeModal === 'ai-settings' && editingAccount && createPortal(
<div className="modal-overlay-centered">
<div className="modal-container" style={{maxWidth: '600px'}}>
<div className="modal-header">
<div>
<h3 className="text-2xl font-extrabold text-gray-900 flex items-center gap-2">
<Bot className="w-6 h-6 text-purple-500" />
AI助手设置
</h3>
<p className="text-sm text-gray-500 mt-1">{editingAccount.nickname || editingAccount.remark || editingAccount.id}</p>
</div>
<button
onClick={() => setActiveModal(null)}
className="p-2 rounded-xl hover:bg-gray-100 transition-colors flex-shrink-0"
>
<X className="w-5 h-5 text-gray-500" />
</button>
</div>
<div className="modal-body space-y-6">
{/* 启用AI */}
<div className="flex items-center justify-between p-4 bg-purple-50 rounded-xl">
<div>
<div className="font-bold text-gray-900 flex items-center gap-2">
<Bot className="w-4 h-4 text-purple-500" />
启用AI自动回复
</div>
<div className="text-xs text-gray-500">AI将自动处理买家的砍价消息</div>
</div>
<button
type="button"
onClick={() => setAiSettings({ ...aiSettings, ai_enabled: !aiSettings.ai_enabled })}
className={`w-14 h-8 rounded-full transition-colors duration-300 relative ${
aiSettings.ai_enabled ? 'bg-[#0094f7]' : 'bg-gray-300'
}`}
>
<span
className={`absolute left-1 top-1 w-6 h-6 bg-white rounded-full shadow-md transition-transform duration-300 ${
aiSettings.ai_enabled ? 'translate-x-6' : 'translate-x-0'
}`}
/>
</button>
</div>
{/* 砍价策略 */}
<div className="border-t border-gray-200 pt-6">
<h3 className="text-lg font-bold text-gray-900 mb-4">砍价策略</h3>
<div className="grid grid-cols-3 gap-4">
<div>
<label className="block text-sm font-bold text-gray-700 mb-2">最大折扣比例 (%)</label>
<input
type="number"
value={aiSettings.max_discount_percent}
onChange={(e) => setAiSettings({ ...aiSettings, max_discount_percent: parseInt(e.target.value) || 0 })}
className="w-full ios-input px-4 py-3 rounded-xl"
min="0"
max="100"
/>
<p className="text-xs text-gray-500 mt-1">例如:10表示最多降价10%</p>
</div>
<div>
<label className="block text-sm font-bold text-gray-700 mb-2">最大折扣金额 (元)</label>
<input
type="number"
value={aiSettings.max_discount_amount}
onChange={(e) => setAiSettings({ ...aiSettings, max_discount_amount: parseInt(e.target.value) || 0 })}
className="w-full ios-input px-4 py-3 rounded-xl"
min="0"
/>
<p className="text-xs text-gray-500 mt-1">例如:100表示最多降价100元</p>
</div>
<div>
<label className="block text-sm font-bold text-gray-700 mb-2">最大砍价轮次</label>
<input
type="number"
value={aiSettings.max_bargain_rounds}
onChange={(e) => setAiSettings({ ...aiSettings, max_bargain_rounds: parseInt(e.target.value) || 1 })}
className="w-full ios-input px-4 py-3 rounded-xl"
min="1"
max="10"
/>
<p className="text-xs text-gray-500 mt-1">买家最多可以砍价的次数</p>
</div>
</div>
</div>
{/* 自定义提示词 */}
<div>
<label className="block text-sm font-bold text-gray-700 mb-2">自定义提示词(可选)</label>
<textarea
value={aiSettings.custom_prompts}
onChange={(e) => setAiSettings({ ...aiSettings, custom_prompts: e.target.value })}
placeholder="输入自定义的AI回复规则或风格指引...&#10;&#10;例如:回复时保持礼貌专业、使用简洁的语言、强调产品质量等"
className="w-full ios-input px-4 py-3 rounded-xl h-40 resize-none"
/>
</div>
{/* AI如何工作 */}
<div className="bg-blue-50 border border-blue-200 rounded-xl p-4">
<h4 className="font-bold text-blue-900 mb-2 flex items-center gap-2">
<Settings className="w-4 h-4" />
AI如何工作
</h4>
<ul className="text-xs text-blue-800 space-y-1">
<li>• 自动识别买家的砍价请求</li>
<li>• 根据设定的策略智能回复</li>
<li>• 在合理范围内同意降价或礼貌拒绝</li>
<li>• 保持专业友好的沟通风格</li>
</ul>
</div>
</div>
<div className="modal-footer">
<div className="flex gap-3 w-full">
<button
onClick={() => setActiveModal(null)}
className="flex-1 px-6 py-3 rounded-xl font-bold bg-gray-100 text-gray-700 hover:bg-gray-200 transition-colors"
disabled={saving}
>
取消
</button>
<button
onClick={handleSaveAISettings}
className="flex-1 ios-btn-primary px-6 py-3 rounded-xl font-bold flex items-center justify-center gap-2"
disabled={saving}
>
{saving ? <Loader2 className="w-4 h-4 animate-spin" /> : <Save className="w-4 h-4" />}
{saving ? '保存中...' : '保存'}
</button>
</div>
</div>
</div>
</div>,
document.body
)}
</div>
);
};
export default AccountList;
+719
View File
@@ -0,0 +1,719 @@
import React, { useEffect, useState } from 'react';
import { createPortal } from 'react-dom';
import { Card } from '../types';
import { getCards, createCard, updateCard, deleteCard } from '../services/api';
import { Plus, CreditCard, Clock, FileText, Image as ImageIcon, Code, Edit, Trash2, Save, X, Eye, EyeOff, Package } from 'lucide-react';
type AddCardForm = {
name: string;
type: Card['type'];
content: string;
description: string;
enabled: boolean;
delay_seconds: number;
api_method: 'GET' | 'POST';
api_timeout: number;
api_headers: string;
api_params: string;
};
const emptyAddForm = (): AddCardForm => ({
name: '',
type: 'data',
content: '',
description: '',
enabled: true,
delay_seconds: 0,
api_method: 'GET',
api_timeout: 10,
api_headers: '',
api_params: '',
});
const CardList: React.FC = () => {
const [cards, setCards] = useState<Card[]>([]);
const [showEditModal, setShowEditModal] = useState(false);
const [showAddModal, setShowAddModal] = useState(false);
const [selectedCard, setSelectedCard] = useState<Card | null>(null);
const [editForm, setEditForm] = useState<Partial<Card>>({});
const [addForm, setAddForm] = useState<AddCardForm>(emptyAddForm);
useEffect(() => {
getCards().then(setCards);
}, []);
const CardIcon = ({ type }: { type: string }) => {
switch(type) {
case 'text': return <FileText className="w-5 h-5 text-blue-500" />;
case 'image': return <ImageIcon className="w-5 h-5 text-purple-500" />;
case 'api': return <Code className="w-5 h-5 text-blue-500" />;
default: return <CreditCard className="w-5 h-5 text-gray-500" />;
}
};
const handleEdit = (card: Card) => {
setSelectedCard(card);
setEditForm({
id: card.id,
name: card.name || '',
type: card.type || 'text',
// API 配置
api_url: card.api_config?.url || '',
api_method: card.api_config?.method || 'GET',
api_timeout: card.api_config?.timeout || 10,
api_headers: card.api_config?.headers || '',
api_params: card.api_config?.params || '',
// 文本配置
text_content: card.text_content || '',
// 批量数据配置
data_content: card.data_content || '',
// 图片配置
image_url: card.image_url || '',
// 通用配置
delay_seconds: card.delay_seconds || 0,
description: card.description || '',
enabled: card.enabled
});
setShowEditModal(true);
};
const handleSaveEdit = async () => {
if (!selectedCard) return;
// 验证必填字段
if (!editForm.name?.trim()) {
alert('请输入卡密名称');
return;
}
if (!editForm.type) {
alert('请选择卡密类型');
return;
}
try {
const updateData: Partial<Card> = {
name: editForm.name.trim(),
type: editForm.type as any,
description: editForm.description?.trim(),
delay_seconds: editForm.delay_seconds || 0,
enabled: editForm.enabled ?? true,
};
// 根据类型设置内容
if (editForm.type === 'api') {
updateData.api_config = {
url: editForm.api_url?.trim(),
method: editForm.api_method as 'GET' | 'POST',
timeout: editForm.api_timeout || 10,
headers: editForm.api_headers?.trim() || undefined,
params: editForm.api_params?.trim() || undefined
};
} else if (editForm.type === 'text') {
updateData.text_content = editForm.text_content?.trim() || '';
} else if (editForm.type === 'data') {
updateData.data_content = editForm.data_content?.trim() || '';
} else if (editForm.type === 'image') {
updateData.image_url = editForm.image_url?.trim() || '';
}
await updateCard(selectedCard.id, updateData);
setShowEditModal(false);
getCards().then(setCards);
} catch (error) {
console.error('更新卡密失败:', error);
alert('更新失败,请重试');
}
};
const handleDelete = async (id: string | number) => {
if (confirm('确认删除该卡密吗?')) {
try {
await deleteCard(id);
getCards().then(setCards);
} catch (error) {
console.error('删除卡密失败:', error);
alert('删除失败,请重试');
}
}
};
const handleAddCard = async () => {
if (!addForm.name.trim()) {
alert('请输入卡密名称');
return;
}
if (!addForm.content.trim()) {
alert(addForm.type === 'api' ? '请输入 API 地址' : '请输入卡密内容');
return;
}
try {
const payload: Partial<Card> = {
name: addForm.name.trim(),
type: addForm.type,
description: addForm.description.trim(),
enabled: addForm.enabled,
delay_seconds: addForm.delay_seconds,
};
if (addForm.type === 'text') payload.text_content = addForm.content.trim();
if (addForm.type === 'data') payload.data_content = addForm.content.trim();
if (addForm.type === 'image') payload.image_url = addForm.content.trim();
if (addForm.type === 'api') {
payload.api_config = {
url: addForm.content.trim(),
method: addForm.api_method,
timeout: addForm.api_timeout,
headers: addForm.api_headers.trim() || undefined,
params: addForm.api_params.trim() || undefined,
};
}
await createCard(payload);
setShowAddModal(false);
setAddForm(emptyAddForm());
getCards().then(setCards);
} catch (error) {
console.error('添加卡密失败:', error);
alert('添加失败,请重试');
}
};
const toggleCardStatus = async (card: Card) => {
try {
await updateCard(card.id, { ...card, enabled: !card.enabled });
getCards().then(setCards);
} catch (error) {
console.error('切换状态失败:', error);
}
};
return (
<div className="space-y-6 animate-fade-in">
<div className="flex justify-between items-center">
<div>
<h2 className="text-3xl font-bold text-gray-900">卡密库存</h2>
<p className="text-gray-500 mt-2 text-sm">管理自动发货的卡密、链接或图片资源。</p>
</div>
<button
onClick={() => setShowAddModal(true)}
className="ios-btn-primary flex items-center gap-2 px-6 py-3 rounded-2xl font-bold shadow-lg shadow-blue-200 transition-transform hover:scale-105 active:scale-95"
>
<Plus className="w-5 h-5" />
添加新卡密
</button>
</div>
<div className="ios-card rounded-[2rem] overflow-hidden shadow-lg border-0 bg-white">
<div className="overflow-x-auto">
<table className="w-full text-left border-collapse">
<thead>
<tr className="bg-white text-gray-400 text-xs font-bold uppercase tracking-wider border-b border-gray-50">
<th className="px-8 py-5 w-[15%]">卡密名称</th>
<th className="px-6 py-5 w-[12%]">类型</th>
<th className="px-6 py-5 w-[25%]">内容/库存</th>
<th className="px-6 py-5 w-[20%]">描述</th>
<th className="px-6 py-5 w-[10%]">状态</th>
<th className="px-6 py-5 w-[10%] text-right">操作</th>
</tr>
</thead>
<tbody className="divide-y divide-gray-50">
{cards.map((card) => {
// 计算库存或内容预览
let stockInfo = '';
if (card.type === 'data' && card.data_content) {
const lines = card.data_content.split('\n').filter(line => line.trim());
stockInfo = `库存: ${lines.length} 条`;
} else if (card.type === 'text' && card.text_content) {
stockInfo = card.text_content.substring(0, 20) + (card.text_content.length > 20 ? '...' : '');
} else if (card.type === 'api' && card.api_config) {
stockInfo = card.api_config.url;
} else if (card.type === 'image' && card.image_url) {
stockInfo = '图片链接';
}
return (
<tr key={card.id} className="hover:bg-[#FFFDE7]/50 transition-colors group">
<td className="px-8 py-5">
<div className="flex items-center gap-3">
<div className="p-2 bg-gray-50 rounded-xl group-hover:bg-white transition-colors">
<CardIcon type={card.type} />
</div>
<span className="font-bold text-gray-900">{card.name}</span>
</div>
</td>
<td className="px-6 py-5">
<span className={`px-3 py-1.5 rounded-lg text-xs font-bold ${
card.type === 'text' ? 'bg-blue-50 text-blue-600' :
card.type === 'data' ? 'bg-purple-50 text-purple-600' :
card.type === 'api' ? 'bg-blue-50 text-blue-600' :
'bg-pink-50 text-pink-600'
}`}>
{card.type === 'text' ? '文本' :
card.type === 'data' ? '批量' :
card.type === 'api' ? 'API' : '图片'}
</span>
</td>
<td className="px-6 py-5">
<span className="text-sm text-gray-600 font-mono block truncate" title={stockInfo}>
{stockInfo}
</span>
</td>
<td className="px-6 py-5">
<span
className="text-sm text-gray-500 block max-w-[200px] truncate"
title={card.description || '-'}
>
{card.description || '-'}
</span>
</td>
<td className="px-6 py-5">
<button
onClick={() => toggleCardStatus(card)}
className={`w-12 h-8 rounded-full relative transition-colors ${
card.enabled ? 'bg-green-500' : 'bg-gray-300'
}`}
>
<div className={`absolute top-1 w-6 h-6 bg-white rounded-full shadow-sm transition-transform ${
card.enabled ? 'left-5' : 'left-1'
}`}></div>
</button>
</td>
<td className="px-6 py-5">
<div className="flex items-center justify-end gap-2">
<button
onClick={() => handleEdit(card)}
className="p-2 text-gray-400 hover:text-black hover:bg-gray-100 rounded-xl transition-colors"
title="编辑"
>
<Edit className="w-4 h-4" />
</button>
<button
onClick={() => handleDelete(card.id)}
className="p-2 text-gray-400 hover:text-red-500 hover:bg-red-50 rounded-xl transition-colors"
>
<Trash2 className="w-5 h-5" />
</button>
</div>
</td>
</tr>
);
})}
</tbody>
</table>
</div>
{cards.length === 0 && (
<div className="py-20 text-center text-gray-400">
<Package className="w-12 h-12 mx-auto mb-4 opacity-30" />
<p>暂无卡密配置,请点击右上角添加。</p>
</div>
)}
</div>
{/* 编辑卡密弹窗 - 使用 Portal */}
{showEditModal && selectedCard && createPortal(
<div className="modal-overlay-centered">
<div className="modal-container">
<div className="modal-header">
<h3 className="text-2xl font-extrabold text-gray-900">编辑卡密</h3>
<button
onClick={() => setShowEditModal(false)}
className="p-2 rounded-xl hover:bg-gray-100 transition-colors"
>
<X className="w-5 h-5 text-gray-500" />
</button>
</div>
<div className="modal-body">
<div className="space-y-5">
{/* 基本信息 */}
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label className="block text-sm font-bold text-gray-700 mb-2">卡密名称 <span className="text-red-500">*</span></label>
<input
type="text"
value={editForm.name || ''}
onChange={(e) => setEditForm({ ...editForm, name: e.target.value })}
className="w-full ios-input px-4 py-3 rounded-xl"
placeholder="例如:游戏点卡、会员卡等"
/>
</div>
<div>
<label className="block text-sm font-bold text-gray-700 mb-2">卡券类型</label>
<select
value={editForm.type || 'text'}
onChange={(e) => setEditForm({ ...editForm, type: e.target.value as any })}
className="w-full ios-input px-4 py-3 rounded-xl"
>
<option value="">请选择类型</option>
<option value="text">固定文字</option>
<option value="data">批量数据</option>
<option value="api">API接口</option>
<option value="image">图片</option>
</select>
</div>
</div>
{/* API 配置 */}
{editForm.type === 'api' && (
<div className="border border-gray-200 rounded-xl p-4 space-y-4 bg-gray-50">
<h3 className="font-bold text-gray-900">API 配置</h3>
<div>
<label className="block text-sm font-bold text-gray-700 mb-2">API 地址</label>
<input
type="url"
value={editForm.api_url || ''}
onChange={(e) => setEditForm({ ...editForm, api_url: e.target.value })}
className="w-full ios-input px-4 py-3 rounded-xl font-mono text-sm"
placeholder="https://api.example.com/get-card"
/>
</div>
<div className="grid grid-cols-2 gap-4">
<div>
<label className="block text-sm font-bold text-gray-700 mb-2">请求方法</label>
<select
value={editForm.api_method || 'GET'}
onChange={(e) => setEditForm({ ...editForm, api_method: e.target.value as 'GET' | 'POST' })}
className="w-full ios-input px-4 py-3 rounded-xl"
>
<option value="GET">GET</option>
<option value="POST">POST</option>
</select>
</div>
<div>
<label className="block text-sm font-bold text-gray-700 mb-2">超时时间(秒)</label>
<input
type="number"
value={editForm.api_timeout || 10}
onChange={(e) => setEditForm({ ...editForm, api_timeout: parseInt(e.target.value) || 10 })}
className="w-full ios-input px-4 py-3 rounded-xl"
min="1"
max="60"
/>
</div>
</div>
<div>
<label className="block text-sm font-bold text-gray-700 mb-2">请求头(JSON 格式)</label>
<textarea
value={editForm.api_headers || ''}
onChange={(e) => setEditForm({ ...editForm, api_headers: e.target.value })}
className="w-full ios-input px-4 py-3 rounded-xl h-20 resize-none font-mono text-sm"
placeholder='{"Authorization": "Bearer token"}'
/>
</div>
<div>
<label className="block text-sm font-bold text-gray-700 mb-2">请求参数(JSON 格式)</label>
<textarea
value={editForm.api_params || ''}
onChange={(e) => setEditForm({ ...editForm, api_params: e.target.value })}
className="w-full ios-input px-4 py-3 rounded-xl h-20 resize-none font-mono text-sm"
placeholder='{"type": "card", "count": 1}'
/>
</div>
</div>
)}
{/* 固定文字配置 */}
{editForm.type === 'text' && (
<div className="border border-gray-200 rounded-xl p-4 bg-gray-50">
<h3 className="font-bold text-gray-900 mb-3">固定文字配置</h3>
<div>
<label className="block text-sm font-bold text-gray-700 mb-2">文字内容</label>
<textarea
value={editForm.text_content || ''}
onChange={(e) => setEditForm({ ...editForm, text_content: e.target.value })}
className="w-full ios-input px-4 py-3 rounded-xl h-32 resize-none"
placeholder="请输入要发送的固定文字内容..."
/>
</div>
</div>
)}
{/* 批量数据配置 */}
{editForm.type === 'data' && (
<div className="border border-gray-200 rounded-xl p-4 bg-gray-50">
<h3 className="font-bold text-gray-900 mb-3">批量数据配置</h3>
<div>
<label className="block text-sm font-bold text-gray-700 mb-2">数据内容(一行一个)</label>
<textarea
value={editForm.data_content || ''}
onChange={(e) => setEditForm({ ...editForm, data_content: e.target.value })}
className="w-full ios-input px-4 py-3 rounded-xl h-80 resize-none font-mono text-sm"
placeholder="请输入数据,每行一个:&#10;卡号1:密码1&#10;卡号2:密码2&#10;或者&#10;兑换码1&#10;兑换码2"
/>
<p className="text-xs text-gray-500 mt-2">支持格式:卡号:密码 或 单独的兑换码</p>
<p className="text-xs text-gray-500">当前库存:<span className="font-bold text-blue-600">
{editForm.data_content ? editForm.data_content.split('\n').filter(line => line.trim()).length : 0}
</span> 条</p>
</div>
</div>
)}
{/* 图片配置 */}
{editForm.type === 'image' && (
<div className="border border-gray-200 rounded-xl p-4 bg-gray-50">
<h3 className="font-bold text-gray-900 mb-3">图片配置</h3>
<div>
<label className="block text-sm font-bold text-gray-700 mb-2">图片 URL</label>
<input
type="url"
value={editForm.image_url || ''}
onChange={(e) => setEditForm({ ...editForm, image_url: e.target.value })}
className="w-full ios-input px-4 py-3 rounded-xl font-mono text-sm"
placeholder="https://example.com/image.png"
/>
<p className="text-xs text-gray-500 mt-2">输入图片卡密的 URL 地址</p>
</div>
{editForm.image_url && (
<div className="mt-3">
<label className="block text-sm font-bold text-gray-700 mb-2">图片预览</label>
<img
src={editForm.image_url}
alt="预览"
className="max-w-full max-h-48 rounded-xl border border-gray-200"
onError={(e) => { e.currentTarget.src = 'https://via.placeholder.com/400x200?text=图片加载失败'; }}
/>
</div>
)}
</div>
)}
{/* 延时发货时间 */}
<div>
<label className="block text-sm font-bold text-gray-700 mb-2">延时发货时间(秒)</label>
<div className="flex items-center gap-2">
<input
type="number"
value={editForm.delay_seconds || 0}
onChange={(e) => setEditForm({ ...editForm, delay_seconds: parseInt(e.target.value) || 0 })}
className="flex-1 ios-input px-4 py-3 rounded-xl"
min="0"
max="3600"
placeholder="0"
/>
<span className="text-sm text-gray-500 whitespace-nowrap">秒</span>
</div>
<p className="text-xs text-gray-500 mt-1">0表示立即发货,最大3600秒(1小时)</p>
</div>
{/* 备注信息 */}
<div>
<label className="block text-sm font-bold text-gray-700 mb-2">备注信息</label>
<textarea
value={editForm.description || ''}
onChange={(e) => setEditForm({ ...editForm, description: e.target.value })}
className="w-full ios-input px-4 py-3 rounded-xl h-40 resize-none"
placeholder="可选的备注信息"
/>
</div>
{/* 启用状态 */}
<div className="flex items-center justify-between p-4 bg-gray-50 rounded-xl">
<span className="font-bold text-gray-900">启用状态</span>
<button
type="button"
onClick={() => setEditForm({ ...editForm, enabled: !editForm.enabled })}
className={`w-14 h-8 rounded-full transition-colors duration-300 relative ${
editForm.enabled ? 'bg-[#0094f7]' : 'bg-gray-300'
}`}
>
<span
className={`absolute top-1 w-6 h-6 bg-white rounded-full shadow-md transition-transform duration-300 block ${
editForm.enabled ? 'translate-x-7' : 'translate-x-1'
}`}
/>
</button>
</div>
</div>
</div>
<div className="modal-footer">
<div className="flex gap-3 w-full">
<button
onClick={() => setShowEditModal(false)}
className="flex-1 px-6 py-3 rounded-xl font-bold bg-gray-100 text-gray-700 hover:bg-gray-200 transition-colors"
>
取消
</button>
<button
onClick={handleSaveEdit}
className="flex-1 ios-btn-primary px-6 py-3 rounded-xl font-bold flex items-center justify-center gap-2"
>
<Save className="w-4 h-4" />
保存更改
</button>
</div>
</div>
</div>
</div>,
document.body
)}
{/* 添加新卡密弹窗 - 使用 Portal */}
{showAddModal && createPortal(
<div className="modal-overlay-centered">
<div className="modal-container" style={{maxWidth: '780px'}}>
<div className="modal-header flex items-center justify-between gap-4">
<div>
<h3 className="text-2xl font-extrabold text-gray-900">添加新卡密</h3>
<p className="text-sm text-gray-500 mt-1">选择交付方式并录入自动发货内容</p>
</div>
<button
onClick={() => setShowAddModal(false)}
className="p-2 rounded-xl hover:bg-gray-100 transition-colors flex-shrink-0"
title="关闭"
>
<X className="w-5 h-5 text-gray-500" />
</button>
</div>
<div className="modal-body">
<div className="space-y-6">
<div className="space-y-2">
<label className="block text-sm font-bold text-gray-700 mb-2">卡密名称</label>
<input
type="text"
value={addForm.name}
onChange={(e) => setAddForm({ ...addForm, name: e.target.value })}
placeholder="例如:VIP会员卡密"
className="w-full ios-input px-4 py-3 rounded-xl"
/>
</div>
<div className="space-y-2">
<label className="block text-sm font-bold text-gray-700 mb-2">类型</label>
<div className="grid grid-cols-2 sm:grid-cols-4 gap-2">
<button
type="button"
onClick={() => setAddForm({ ...addForm, type: 'data', content: '' })}
className={`p-3 rounded-xl font-bold transition-all ${addForm.type === 'data' ? 'bg-[#0094f7] text-white' : 'bg-gray-100 text-gray-600 hover:bg-gray-200'}`}
>
<CreditCard className="w-5 h-5 mx-auto mb-1" />
批量库存
</button>
<button
type="button"
onClick={() => setAddForm({ ...addForm, type: 'text', content: '' })}
className={`p-3 rounded-xl font-bold transition-all ${addForm.type === 'text' ? 'bg-[#0094f7] text-white' : 'bg-gray-100 text-gray-600'}`}
>
<FileText className="w-5 h-5 mx-auto mb-1" />
文本
</button>
<button
type="button"
onClick={() => setAddForm({ ...addForm, type: 'image', content: '' })}
className={`p-3 rounded-xl font-bold transition-all ${addForm.type === 'image' ? 'bg-[#0094f7] text-white' : 'bg-gray-100 text-gray-600'}`}
>
<ImageIcon className="w-5 h-5 mx-auto mb-1" />
图片
</button>
<button
type="button"
onClick={() => setAddForm({ ...addForm, type: 'api', content: '' })}
className={`p-3 rounded-xl font-bold transition-all ${addForm.type === 'api' ? 'bg-[#0094f7] text-white' : 'bg-gray-100 text-gray-600'}`}
>
<Code className="w-5 h-5 mx-auto mb-1" />
API
</button>
</div>
</div>
<div className="space-y-2">
<label className="block text-sm font-bold text-gray-700 mb-2">
{addForm.type === 'data' ? '库存内容(一行一个)' : addForm.type === 'text' ? '固定回复内容' : addForm.type === 'image' ? '图片 URL' : 'API 地址'}
</label>
{addForm.type === 'api' ? (
<input
type="url"
value={addForm.content}
onChange={(e) => setAddForm({ ...addForm, content: e.target.value })}
placeholder="https://api.example.com/get-code"
className="w-full ios-input px-4 py-3 rounded-xl"
/>
) : addForm.type === 'image' ? (
<input
type="url"
value={addForm.content}
onChange={(e) => setAddForm({ ...addForm, content: e.target.value })}
className="w-full ios-input px-4 py-3 rounded-xl"
placeholder="https://example.com/card.png"
/>
) : (
<textarea
value={addForm.content}
onChange={(e) => setAddForm({ ...addForm, content: e.target.value })}
className={`w-full ios-input px-4 py-3 rounded-xl resize-none text-sm ${addForm.type === 'data' ? 'h-48 font-mono' : 'h-32'}`}
placeholder={addForm.type === 'data' ? 'CODE-123456\nCODE-789012\n...' : '请输入每次发货时发送的固定文字'}
/>
)}
{addForm.type === 'data' && (
<p className="text-xs text-gray-500">当前库存:<span className="font-bold text-[#0094f7]">{addForm.content.split('\n').filter(line => line.trim()).length}</span> 条</p>
)}
</div>
{addForm.type === 'api' && (
<div className="border-t border-gray-100 pt-5 space-y-4">
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
<div className="space-y-2">
<label className="block text-sm font-bold text-gray-700">请求方法</label>
<select value={addForm.api_method} onChange={e => setAddForm({...addForm, api_method: e.target.value as 'GET' | 'POST'})} className="w-full ios-input px-4 py-3 rounded-xl">
<option value="GET">GET</option>
<option value="POST">POST</option>
</select>
</div>
<div className="space-y-2">
<label className="block text-sm font-bold text-gray-700">超时时间(秒)</label>
<input type="number" min="1" max="60" value={addForm.api_timeout} onChange={e => setAddForm({...addForm, api_timeout: parseInt(e.target.value) || 10})} className="w-full ios-input px-4 py-3 rounded-xl" />
</div>
</div>
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
<div className="space-y-2">
<label className="block text-sm font-bold text-gray-700">请求头(JSON)</label>
<textarea value={addForm.api_headers} onChange={e => setAddForm({...addForm, api_headers: e.target.value})} className="w-full ios-input px-4 py-3 rounded-xl h-24 resize-none font-mono text-xs" placeholder='{"Authorization":"Bearer token"}' />
</div>
<div className="space-y-2">
<label className="block text-sm font-bold text-gray-700">请求参数(JSON)</label>
<textarea value={addForm.api_params} onChange={e => setAddForm({...addForm, api_params: e.target.value})} className="w-full ios-input px-4 py-3 rounded-xl h-24 resize-none font-mono text-xs" placeholder='{"order_id":"{order_id}"}' />
</div>
</div>
</div>
)}
<div className="grid grid-cols-1 sm:grid-cols-[1fr_180px] gap-4">
<div className="space-y-2">
<label className="block text-sm font-bold text-gray-700">描述</label>
<input value={addForm.description} onChange={e => setAddForm({...addForm, description: e.target.value})} placeholder="卡密用途描述(可选)" className="w-full ios-input px-4 py-3 rounded-xl" />
</div>
<div className="space-y-2">
<label className="block text-sm font-bold text-gray-700">延时发货(秒)</label>
<input type="number" value={addForm.delay_seconds} onChange={e => setAddForm({...addForm, delay_seconds: parseInt(e.target.value) || 0})} className="w-full ios-input px-4 py-3 rounded-xl" min="0" max="3600" />
</div>
</div>
</div>
</div>
<div className="modal-footer">
<div className="flex gap-3 w-full">
<button
onClick={() => setShowAddModal(false)}
className="flex-1 px-6 py-3 rounded-xl font-bold bg-gray-100 text-gray-700 hover:bg-gray-200 transition-colors"
>
取消
</button>
<button
onClick={handleAddCard}
className="flex-1 ios-btn-primary px-6 py-3 rounded-xl font-bold flex items-center justify-center gap-2"
>
<Plus className="w-4 h-4" />
添加卡密
</button>
</div>
</div>
</div>
</div>,
document.body
)}
</div>
);
};
export default CardList;
+783
View File
@@ -0,0 +1,783 @@
import React, { useEffect, useState } from 'react';
import { AdminStats, OrderAnalytics, Order, OrderStatus, Item } from '../types';
import { getAdminStats, getOrderAnalytics, getValidOrders, getItems } from '../services/api';
import { TrendingUp, Users, ShoppingCart, AlertCircle, DollarSign, Activity, Package, ArrowUpRight, Calendar, X, BarChart3, PackageCheck, ExternalLink, Eye, Edit } from 'lucide-react';
import { AreaChart, Area, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, BarChart, Bar, LineChart, Line, PieChart, Pie, Cell, Legend } from 'recharts';
// 状态徽章组件
const StatusBadge: React.FC<{ status: OrderStatus }> = ({ status }) => {
const styles = {
processing: 'bg-blue-100 text-blue-800',
pending_ship: 'bg-[#0094f7] text-white',
shipped: 'bg-blue-100 text-blue-700',
completed: 'bg-green-100 text-green-700',
cancelled: 'bg-gray-100 text-gray-500',
refunding: 'bg-red-100 text-red-600',
};
const labels = {
processing: '处理中',
pending_ship: '待发货',
shipped: '已发货',
completed: '已完成',
cancelled: '已取消',
refunding: '退款中',
};
return (
<span className={`px-3 py-1.5 rounded-lg text-xs font-bold ${styles[status] || styles.cancelled}`}>
{labels[status] || status}
</span>
);
};
const StatCard: React.FC<{ title: string; value: string | number; icon: React.ElementType; colorClass: string; trend?: string }> = ({ title, value, icon: Icon, colorClass, trend }) => (
<div className="ios-card p-6 rounded-[2rem] flex flex-col justify-between hover:translate-y-[-4px] transition-all duration-300 h-full relative overflow-hidden group border-0">
<div className={`absolute -right-6 -top-6 w-32 h-32 ${colorClass} opacity-10 rounded-full group-hover:scale-125 transition-transform duration-500 blur-2xl`}></div>
<div className="flex justify-between items-start mb-6">
<div className={`p-4 rounded-2xl ${colorClass} bg-opacity-10 backdrop-blur-sm`}>
<Icon className={`w-6 h-6 ${colorClass.replace('bg-', 'text-')}`} />
</div>
{trend && <span className="text-xs font-bold text-white bg-[#0094f7] px-3 py-1.5 rounded-full flex items-center gap-1 shadow-sm">
<TrendingUp className="w-3 h-3" /> {trend}
</span>}
</div>
<div className="relative z-10">
<h3 className="text-3xl font-extrabold text-gray-900 tracking-tight font-feature-settings-tnum">{value}</h3>
<p className="text-gray-500 text-sm font-medium mt-1">{title}</p>
</div>
</div>
);
type TimeRange = 'today' | 'yesterday' | '3days' | '7days' | '30days' | 'custom';
const Dashboard: React.FC = () => {
const [stats, setStats] = useState<AdminStats | null>(null);
const [analytics, setAnalytics] = useState<OrderAnalytics | null>(null);
const [timeRange, setTimeRange] = useState<TimeRange>('7days');
const [customStartDate, setCustomStartDate] = useState('');
const [customEndDate, setCustomEndDate] = useState('');
const [previousAnalytics, setPreviousAnalytics] = useState<OrderAnalytics | null>(null); // 用于计算趋势
// 搜索词
const [searchTerm, setSearchTerm] = useState('');
// 参与统计的订单列表
const [validOrders, setValidOrders] = useState<Order[]>([]);
const [ordersLoading, setOrdersLoading] = useState(false);
// 商品列表
const [items, setItems] = useState<Item[]>([]);
const [itemNames, setItemNames] = useState<Record<string, string>>({});
// 颜色配置
const COLORS = ['#0094f7', '#3B82F6', '#10B981', '#F59E0B', '#8B5CF6'];
const loadAnalytics = (range: TimeRange) => {
// 使用本地时间而不是UTC时间
const now = new Date();
const year = now.getFullYear();
const month = String(now.getMonth() + 1).padStart(2, '0');
const day = String(now.getDate()).padStart(2, '0');
const todayStr = `${year}-${month}-${day}`;
let params: { start_date: string; end_date: string };
switch (range) {
case 'today':
// 今天:从今天00:00:00到今天23:59:59
params = {
start_date: todayStr,
end_date: todayStr
};
break;
case 'yesterday':
// 昨天:从昨天00:00:00到昨天23:59:59
const yesterday = new Date(now);
yesterday.setDate(yesterday.getDate() - 1);
const yYear = yesterday.getFullYear();
const yMonth = String(yesterday.getMonth() + 1).padStart(2, '0');
const yDay = String(yesterday.getDate()).padStart(2, '0');
const yesterdayStr = `${yYear}-${yMonth}-${yDay}`;
params = {
start_date: yesterdayStr,
end_date: yesterdayStr
};
break;
case '3days':
// 3天:从3天前到今天
const threeDaysAgo = new Date(now);
threeDaysAgo.setDate(threeDaysAgo.getDate() - 3);
const tdYear = threeDaysAgo.getFullYear();
const tdMonth = String(threeDaysAgo.getMonth() + 1).padStart(2, '0');
const tdDay = String(threeDaysAgo.getDate()).padStart(2, '0');
params = {
start_date: `${tdYear}-${tdMonth}-${tdDay}`,
end_date: todayStr
};
break;
case '7days':
// 7天:从7天前到今天
const sevenDaysAgo = new Date(now);
sevenDaysAgo.setDate(sevenDaysAgo.getDate() - 7);
const sdYear = sevenDaysAgo.getFullYear();
const sdMonth = String(sevenDaysAgo.getMonth() + 1).padStart(2, '0');
const sdDay = String(sevenDaysAgo.getDate()).padStart(2, '0');
params = {
start_date: `${sdYear}-${sdMonth}-${sdDay}`,
end_date: todayStr
};
break;
case '30days':
// 30天:从30天前到今天
const thirtyDaysAgo = new Date(now);
thirtyDaysAgo.setDate(thirtyDaysAgo.getDate() - 30);
const tdYear2 = thirtyDaysAgo.getFullYear();
const tdMonth2 = String(thirtyDaysAgo.getMonth() + 1).padStart(2, '0');
const tdDay2 = String(thirtyDaysAgo.getDate()).padStart(2, '0');
params = {
start_date: `${tdYear2}-${tdMonth2}-${tdDay2}`,
end_date: todayStr
};
break;
case 'custom':
// 自定义范围
if (customStartDate && customEndDate) {
params = {
start_date: customStartDate,
end_date: customEndDate
};
} else {
// 默认7天
const defaultDaysAgo = new Date(now);
defaultDaysAgo.setDate(defaultDaysAgo.getDate() - 7);
const ddYear = defaultDaysAgo.getFullYear();
const ddMonth = String(defaultDaysAgo.getMonth() + 1).padStart(2, '0');
const ddDay = String(defaultDaysAgo.getDate()).padStart(2, '0');
params = {
start_date: `${ddYear}-${ddMonth}-${ddDay}`,
end_date: todayStr
};
}
break;
default:
// 默认7天
const defaultStart = new Date(now);
defaultStart.setDate(defaultStart.getDate() - 7);
const dsYear = defaultStart.getFullYear();
const dsMonth = String(defaultStart.getMonth() + 1).padStart(2, '0');
const dsDay = String(defaultStart.getDate()).padStart(2, '0');
params = {
start_date: `${dsYear}-${dsMonth}-${dsDay}`,
end_date: todayStr
};
}
// 同时获取上一个周期的数据用于趋势对比
const previousParams = getPreviousPeriodParams(range, now);
if (previousParams) {
getOrderAnalytics(previousParams).then(setPreviousAnalytics).catch(console.error);
}
getOrderAnalytics(params).then(setAnalytics).catch(console.error);
};
// 获取上一个时间段的参数
const getPreviousPeriodParams = (range: TimeRange, now: Date) => {
const year = now.getFullYear();
const month = String(now.getMonth() + 1).padStart(2, '0');
const day = String(now.getDate()).padStart(2, '0');
switch (range) {
case 'today':
// 今天对比昨天
const yesterday = new Date(now);
yesterday.setDate(yesterday.getDate() - 1);
const yYear = yesterday.getFullYear();
const yMonth = String(yesterday.getMonth() + 1).padStart(2, '0');
const yDay = String(yesterday.getDate()).padStart(2, '0');
return {
start_date: `${yYear}-${yMonth}-${yDay}`,
end_date: `${yYear}-${yMonth}-${yDay}`
};
case 'yesterday':
// 昨天对比前天
const dayBefore = new Date(now);
dayBefore.setDate(dayBefore.getDate() - 2);
const dbYear = dayBefore.getFullYear();
const dbMonth = String(dayBefore.getMonth() + 1).padStart(2, '0');
const dbDay = String(dayBefore.getDate()).padStart(2, '0');
return {
start_date: `${dbYear}-${dbMonth}-${dbDay}`,
end_date: `${dbYear}-${dbMonth}-${dbDay}`
};
case '7days':
// 7天对比上一个7天
const prev7DaysEnd = new Date(now);
prev7DaysEnd.setDate(prev7DaysEnd.getDate() - 7);
const prev7DaysStart = new Date(prev7DaysEnd);
prev7DaysStart.setDate(prev7DaysStart.getDate() - 7);
return {
start_date: `${prev7DaysStart.getFullYear()}-${String(prev7DaysStart.getMonth() + 1).padStart(2, '0')}-${String(prev7DaysStart.getDate()).padStart(2, '0')}`,
end_date: `${prev7DaysEnd.getFullYear()}-${String(prev7DaysEnd.getMonth() + 1).padStart(2, '0')}-${String(prev7DaysEnd.getDate()).padStart(2, '0')}`
};
case '30days':
// 30天对比上一个30天
const prev30DaysEnd = new Date(now);
prev30DaysEnd.setDate(prev30DaysEnd.getDate() - 30);
const prev30DaysStart = new Date(prev30DaysEnd);
prev30DaysStart.setDate(prev30DaysStart.getDate() - 30);
return {
start_date: `${prev30DaysStart.getFullYear()}-${String(prev30DaysStart.getMonth() + 1).padStart(2, '0')}-${String(prev30DaysStart.getDate()).padStart(2, '0')}`,
end_date: `${prev30DaysEnd.getFullYear()}-${String(prev30DaysEnd.getMonth() + 1).padStart(2, '0')}-${String(prev30DaysEnd.getDate()).padStart(2, '0')}`
};
default:
return null;
}
};
// 计算趋势百分比
const getTrendPercent = () => {
if (!analytics || !previousAnalytics) return null;
const currentAmount = analytics.revenue_stats.total_amount;
const previousAmount = previousAnalytics.revenue_stats.total_amount;
if (previousAmount === 0) {
return currentAmount > 0 ? '+100%' : '0%';
}
const percent = ((currentAmount - previousAmount) / previousAmount) * 100;
const sign = percent >= 0 ? '+' : '';
return `${sign}${percent.toFixed(1)}%`;
};
useEffect(() => {
getAdminStats().then(setStats).catch(console.error);
loadAnalytics(timeRange);
// 获取商品列表
getItems().then(items => {
setItems(items);
// 建立 item_id 到 item_title 的映射
const nameMap: Record<string, string> = {};
items.forEach(item => {
nameMap[item.item_id] = item.item_title || item.item_id;
});
setItemNames(nameMap);
}).catch(console.error);
}, [timeRange]);
// 加载订单列表
useEffect(() => {
const { startDate, endDate } = getDatesForRange(timeRange);
// 获取参与统计的订单列表
setOrdersLoading(true);
getValidOrders({ start_date: startDate, end_date: endDate })
.then(orders => {
setValidOrders(orders);
})
.catch(console.error)
.finally(() => setOrdersLoading(false));
}, [timeRange]);
// 辅助函数:获取时间范围的日期
const getDatesForRange = (range: TimeRange) => {
const now = new Date();
const endDate = now.toISOString().split('T')[0];
let startDate = endDate;
if (range === '7days') {
const sevenDaysAgo = new Date(now);
sevenDaysAgo.setDate(sevenDaysAgo.getDate() - 7);
startDate = sevenDaysAgo.toISOString().split('T')[0];
} else if (range === '30days') {
const thirtyDaysAgo = new Date(now);
thirtyDaysAgo.setDate(thirtyDaysAgo.getDate() - 30);
startDate = thirtyDaysAgo.toISOString().split('T')[0];
}
// 其他范围类似处理...
return { startDate, endDate };
};
if (!stats || !analytics) return <div className="p-8 flex justify-center text-gray-400"><Activity className="w-8 h-8 animate-spin text-[#0094f7]" /></div>;
const chartData = analytics.daily_stats?.map(d => ({
name: d.date.slice(5), // MM-DD
amount: d.amount,
orders: d.order_count,
avgAmount: d.order_count > 0 ? (d.amount / d.order_count).toFixed(2) : 0
})) || [];
// 计算图表数据(在渲染时直接计算)
const itemStats = analytics.item_stats || [];
const totalOrders = analytics.revenue_stats.total_orders || 0;
const totalAmount = analytics.revenue_stats.total_amount || 0;
// 1. 商品销量排行:按订单数量排序
const productSalesData = itemStats.length > 0 ? itemStats
.map(item => ({
name: (itemNames[item.item_id] || item.item_id).length > 12
? (itemNames[item.item_id] || item.item_id).substring(0, 12) + '...'
: (itemNames[item.item_id] || item.item_id),
sales: item.order_count
}))
.sort((a, b) => b.sales - a.sales)
.slice(0, 10) : [];
// 2. 商品下单占比:每个商品的订单数占总订单数的百分比
const sourceDataData = itemStats.length > 0 ? itemStats
.map(item => ({
name: (itemNames[item.item_id] || item.item_id).length > 10
? (itemNames[item.item_id] || item.item_id).substring(0, 10) + '...'
: (itemNames[item.item_id] || item.item_id),
value: item.order_count,
percent: totalOrders > 0 ? (item.order_count / totalOrders) * 100 : 0
}))
.sort((a, b) => b.value - a.value)
.slice(0, 6)
.map((item, index) => ({
...item,
color: COLORS[index % COLORS.length]
})) : [];
// 3. 商品金额分析:按金额排序,取前5
const categoryDataData = itemStats.length > 0 ? itemStats
.map(item => ({
name: (itemNames[item.item_id] || item.item_id).length > 12
? (itemNames[item.item_id] || item.item_id).substring(0, 12) + '...'
: (itemNames[item.item_id] || item.item_id),
value: item.total_amount,
orderCount: item.order_count,
percentage: totalAmount > 0
? (item.total_amount / totalAmount) * 100
: 0
}))
.sort((a, b) => b.value - a.value)
.slice(0, 5)
.map((item, index) => ({
...item,
color: COLORS[index % COLORS.length],
percentage: item.percentage.toFixed(1)
})) : [];
const timeRangeOptions = [
{ key: 'today' as TimeRange, label: '今天' },
{ key: 'yesterday' as TimeRange, label: '昨天' },
{ key: '3days' as TimeRange, label: '三天内' },
{ key: '7days' as TimeRange, label: '7天内' },
{ key: '30days' as TimeRange, label: '一个月内' },
{ key: 'custom' as TimeRange, label: '自定义' },
];
return (
<div className="space-y-8 animate-fade-in">
<div className="flex flex-col md:flex-row justify-between md:items-end gap-4">
<div>
<h2 className="text-4xl font-extrabold text-gray-900 tracking-tight">运营概览</h2>
<p className="text-gray-500 mt-2 text-base">欢迎回来,以下是闲鱼店铺的实时经营数据。</p>
</div>
<div className="flex items-center gap-3">
<div className="text-sm font-bold text-gray-700 bg-white px-5 py-2.5 rounded-full shadow-sm border border-gray-100 flex items-center gap-2">
<span className="w-2.5 h-2.5 bg-green-500 rounded-full animate-pulse"></span>
系统正常运行
</div>
</div>
</div>
{/* Time Range Selector */}
<div className="flex flex-wrap gap-2 p-2 bg-gray-100/50 rounded-2xl">
{timeRangeOptions.map((option) => (
<button
key={option.key}
onClick={() => setTimeRange(option.key)}
className={`px-5 py-2.5 rounded-xl text-sm font-bold transition-all ${
timeRange === option.key
? 'bg-[#0094f7] text-white shadow-md'
: 'bg-white text-gray-600 hover:text-black hover:bg-gray-50'
}`}
>
{option.label}
</button>
))}
{timeRange === 'custom' && (
<>
<input
type="date"
value={customStartDate}
onChange={(e) => setCustomStartDate(e.target.value)}
className="px-3 py-2 rounded-xl text-sm border border-gray-200 focus:outline-none focus:ring-2 focus:ring-[#0094f7]"
/>
<span className="self-center text-gray-400">-</span>
<input
type="date"
value={customEndDate}
onChange={(e) => setCustomEndDate(e.target.value)}
className="px-3 py-2 rounded-xl text-sm border border-gray-200 focus:outline-none focus:ring-2 focus:ring-[#0094f7]"
/>
<button
onClick={() => loadAnalytics('custom')}
className="px-4 py-2 rounded-xl text-sm font-bold bg-black text-white hover:bg-gray-800 transition-colors"
>
应用
</button>
</>
)}
</div>
{/* Stats Grid */}
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
<StatCard
title="累计营收 (CNY)"
value={`¥${analytics.revenue_stats.total_amount.toLocaleString('zh-CN', { minimumFractionDigits: 2 })}`}
icon={DollarSign}
colorClass="bg-blue-400"
trend={getTrendPercent() || undefined}
/>
<StatCard
title="活跃账号 / 总数"
value={`${stats.active_cookies} / ${stats.total_cookies}`}
icon={Users}
colorClass="bg-blue-500"
/>
<StatCard
title="订单数"
value={analytics.revenue_stats.total_orders.toLocaleString()}
icon={ShoppingCart}
colorClass="bg-blue-500"
/>
<StatCard
title="库存卡密余量"
value={stats.total_cards}
icon={Package}
colorClass="bg-purple-500"
/>
</div>
{/* Main Chart Section */}
<div className="ios-card p-8 rounded-[2rem]">
<div className="mb-10">
<h3 className="text-xl font-bold text-gray-900">营收趋势分析</h3>
<p className="text-sm text-gray-400 mt-1">最近7天的销售额走势</p>
</div>
<div className="h-[350px] w-full">
{chartData.length === 0 || analytics.revenue_stats.total_amount === 0 ? (
<div className="h-full flex flex-col items-center justify-center text-gray-400">
<ShoppingCart className="w-16 h-16 mb-4 opacity-20" />
<p className="text-lg font-medium">暂无营收数据</p>
<p className="text-sm mt-2">所选时间范围内暂无订单记录</p>
</div>
) : chartData.length <= 2 ? (
// 数据点少于等于2个时使用美化柱状图
<ResponsiveContainer width="100%" height="100%">
<BarChart data={chartData} margin={{ top: 30, right: 20, left: -20, bottom: 30 }} barCategoryGap={30}>
<XAxis
dataKey="name"
axisLine={false}
tickLine={false}
tick={{fill: '#374151', fontSize: 14, fontWeight: 600}}
dy={10}
/>
<YAxis
axisLine={false}
tickLine={false}
tick={{fill: '#9CA3AF', fontSize: 13, fontWeight: 500}}
tickFormatter={(value) => `¥${value}`}
/>
<Tooltip
contentStyle={{
backgroundColor: '#1F2937',
borderRadius: '16px',
border: 'none',
boxShadow: '0 20px 40px rgba(0, 0, 0, 0.3)',
padding: '12px 16px'
}}
itemStyle={{ color: '#0094f7', fontWeight: 600 }}
formatter={(value) => {
const num = Number(value);
return `营收: ¥${num.toFixed(2)}`;
}}
/>
<Bar
dataKey="amount"
fill="#0094f7"
radius={[12, 12, 0, 0]}
stroke="#000000"
strokeWidth={0}
>
{chartData.map((entry, index) => (
<Cell key={`cell-${index}`} fill={['#0094f7', '#FCD34D', '#0071e3'][index % 3]} />
))}
</Bar>
</BarChart>
</ResponsiveContainer>
) : (
// 数据点多于2个时使用折线图
<ResponsiveContainer width="100%" height="100%">
<AreaChart data={chartData} margin={{ top: 10, right: 10, left: -20, bottom: 0 }}>
<defs>
<linearGradient id="colorAmount" x1="0" y1="0" x2="0" y2="1">
<stop offset="5%" stopColor="#0094f7" stopOpacity={0.5}/>
<stop offset="95%" stopColor="#0094f7" stopOpacity={0}/>
</linearGradient>
</defs>
<XAxis
dataKey="name"
axisLine={false}
tickLine={false}
tick={{fill: '#9CA3AF', fontSize: 13, fontWeight: 500}}
dy={15}
/>
<YAxis
axisLine={false}
tickLine={false}
tick={{fill: '#9CA3AF', fontSize: 13, fontWeight: 500}}
/>
<CartesianGrid vertical={false} stroke="#F3F4F6" strokeDasharray="3 3" />
<Tooltip
contentStyle={{ background: '#1A1A1A', borderRadius: '16px', border: 'none', boxShadow: '0 10px 40px rgba(0,0,0,0.2)' }}
itemStyle={{ color: '#0094f7', fontWeight: 600 }}
labelStyle={{ color: '#888' }}
cursor={{ stroke: '#0094f7', strokeWidth: 2, strokeDasharray: '4 4' }}
/>
<Area type="monotone" dataKey="amount" stroke="#FACC15" strokeWidth={4} fillOpacity={1} fill="url(#colorAmount)" activeDot={{ r: 8, fill: '#1A1A1A', stroke: "#0094f7", strokeWidth: 2 }} />
</AreaChart>
</ResponsiveContainer>
)}
</div>
</div>
{/* 商品销量排行和订单来源分布 */}
<div className="grid grid-cols-1 lg:grid-cols-2 gap-8">
{/* 商品销量排行 */}
<div className="ios-card p-6 rounded-[2rem]">
<h3 className="font-bold text-lg text-gray-900 mb-6">商品销量排行</h3>
<div className="h-[280px]">
{productSalesData.length === 0 ? (
<div className="flex items-center justify-center h-full text-gray-400">暂无数据</div>
) : (
<ResponsiveContainer width="100%" height="100%">
<BarChart data={productSalesData} layout="vertical">
<CartesianGrid strokeDasharray="3 3" horizontal={true} vertical={false} stroke="#f0f0f0" />
<XAxis
type="number"
axisLine={false}
tickLine={false}
tick={{ fill: '#9CA3AF', fontSize: 12 }}
/>
<YAxis
type="category"
dataKey="name"
axisLine={false}
tickLine={false}
tick={{ fill: '#6B7280', fontSize: 12 }}
width={100}
/>
<Tooltip
contentStyle={{
backgroundColor: '#fff',
border: '1px solid #e5e7eb',
borderRadius: '12px',
boxShadow: '0 4px 6px -1px rgba(0, 0, 0, 0.1)'
}}
/>
<Bar dataKey="sales" fill="#000000" radius={[0, 8, 8, 0]} />
</BarChart>
</ResponsiveContainer>
)}
</div>
</div>
{/* 商品下单占比 */}
<div className="ios-card p-6 rounded-[2rem]">
<h3 className="font-bold text-lg text-gray-900 mb-6">商品下单占比</h3>
<div className="h-[280px]">
{sourceDataData.length === 0 ? (
<div className="flex items-center justify-center h-full text-gray-400">暂无数据</div>
) : (
<ResponsiveContainer width="100%" height="100%">
<PieChart>
<Pie
data={sourceDataData}
cx="50%"
cy="50%"
innerRadius={60}
outerRadius={90}
paddingAngle={2}
dataKey="value"
label={({ name, percent }) => `${name} ${(percent * 100).toFixed(0)}%`}
labelLine={false}
>
{sourceDataData.map((entry, index) => (
<Cell key={`cell-${index}`} fill={entry.color} />
))}
</Pie>
<Legend
verticalAlign="bottom"
height={36}
iconType="circle"
formatter={(value) => <span style={{ color: '#6B7280', fontWeight: 500 }}>{value}</span>}
/>
</PieChart>
</ResponsiveContainer>
)}
</div>
</div>
</div>
{/* 收支明细和品类营收 */}
<div className="grid grid-cols-1 lg:grid-cols-3 gap-8">
{/* 参与统计的订单列表 */}
<div className="lg:col-span-2 ios-card p-0 rounded-[2rem] border-0 bg-white overflow-hidden flex flex-col">
<div className="p-6 border-b border-gray-50 flex justify-between items-center bg-[#FAFAFA]">
<h3 className="font-bold text-lg text-gray-900">参与统计的订单</h3>
<div className="relative">
<input
placeholder="搜索订单号/商品/买家..."
value={searchTerm}
onChange={(e) => setSearchTerm(e.target.value)}
className="pl-4 pr-4 py-2 rounded-xl bg-white border border-gray-100 text-sm focus:border-blue-400 outline-none w-48"
type="text"
/>
</div>
</div>
<div className="overflow-x-auto flex-1 max-h-[400px]">
{ordersLoading ? (
<div className="flex items-center justify-center py-20 text-gray-400">
<Activity className="w-6 h-6 animate-spin mr-2" />
加载中...
</div>
) : validOrders.filter((order) =>
order.order_id?.toLowerCase().includes(searchTerm.toLowerCase()) ||
order.item_id?.toLowerCase().includes(searchTerm.toLowerCase()) ||
order.buyer_id?.toLowerCase().includes(searchTerm.toLowerCase())
).length === 0 ? (
<div className="flex items-center justify-center py-20 text-gray-400">
暂无订单数据
</div>
) : (
<table className="w-full text-left border-collapse">
<thead>
<tr className="bg-white text-gray-400 text-xs font-bold uppercase tracking-wider border-b border-gray-50">
<th className="px-6 py-4">订单信息</th>
<th className="px-6 py-4">买家信息</th>
<th className="px-6 py-4">金额</th>
<th className="px-6 py-4">状态</th>
<th className="px-6 py-4 text-right">操作</th>
</tr>
</thead>
<tbody className="divide-y divide-gray-50">
{validOrders
.filter((order) =>
order.order_id?.toLowerCase().includes(searchTerm.toLowerCase()) ||
order.item_id?.toLowerCase().includes(searchTerm.toLowerCase()) ||
order.buyer_id?.toLowerCase().includes(searchTerm.toLowerCase())
)
.map((order) => (
<tr key={order.order_id} className="hover:bg-[#FFFDE7]/50 transition-colors group">
<td className="px-6 py-4">
<div className="flex items-center gap-3">
<div className="w-12 h-12 rounded-xl bg-gray-100 overflow-hidden shadow-sm border border-gray-100 flex-shrink-0">
<PackageCheck className="w-full h-full text-gray-300 p-2" />
</div>
<div className="min-w-0">
<div className="font-bold text-gray-900 text-sm line-clamp-1">
{order.item_title || order.item_id || '未知商品'}
</div>
<div className="text-xs text-gray-500 mt-1 font-mono">{order.order_id}</div>
<div className="text-xs text-gray-400 mt-0.5">数量: {order.quantity || 1}</div>
</div>
</div>
</td>
<td className="px-6 py-4">
<div className="text-sm font-bold text-gray-800">{order.buyer_id}</div>
{order.created_at && (
<div className="text-xs text-gray-400 mt-1">{order.created_at}</div>
)}
</td>
<td className="px-6 py-4 text-base font-extrabold text-gray-900 font-feature-settings-tnum">
¥{order.amount || '0.00'}
</td>
<td className="px-6 py-4">
<StatusBadge status={order.status || order.order_status || 'unknown'} />
</td>
<td className="px-6 py-4 text-right">
<a
href={`https://www.goofish.com/order-detail?orderId=${order.order_id}&role=seller`}
target="_blank"
rel="noopener noreferrer"
className="inline-flex text-gray-400 hover:text-blue-600 p-2 rounded-xl hover:bg-blue-50 transition-colors"
title="查看闲鱼详情"
>
<ExternalLink className="w-4 h-4" />
</a>
</td>
</tr>
))}
</tbody>
</table>
)}
</div>
</div>
{/* 商品金额分析 */}
<div className="ios-card p-6 rounded-[2rem] bg-white">
<h3 className="font-bold text-lg text-gray-900 mb-6">商品金额分析 (TOP5)</h3>
{categoryDataData.length === 0 ? (
<div className="flex items-center justify-center h-[300px] text-gray-400">暂无数据</div>
) : (
<>
<div className="h-[300px] relative">
<ResponsiveContainer width="100%" height="100%">
<PieChart>
<Pie
data={categoryDataData}
cx="50%"
cy="50%"
innerRadius={60}
outerRadius={100}
paddingAngle={2}
dataKey="value"
label={({ name, percent }) => `${name} ${(percent * 100).toFixed(0)}%`}
>
{categoryDataData.map((entry, index) => (
<Cell key={`cell-${index}`} fill={entry.color || COLORS[index % COLORS.length]} />
))}
</Pie>
<Tooltip
contentStyle={{
backgroundColor: '#fff',
border: '1px solid #e5e7eb',
borderRadius: '12px',
boxShadow: '0 4px 6px -1px rgba(0, 0, 0, 0.1)'
}}
formatter={(value: number) => `¥${value.toLocaleString()}`}
/>
</PieChart>
</ResponsiveContainer>
</div>
<div className="space-y-3 mt-4">
{categoryDataData.map((cat) => (
<div key={cat.name} className="flex justify-between items-center text-sm">
<div className="flex items-center gap-2">
<div
className="w-3 h-3 rounded-full"
style={{ backgroundColor: cat.color || COLORS[categoryDataData.indexOf(cat) % COLORS.length] }}
></div>
<span className="text-gray-600 font-medium">{cat.name}</span>
</div>
<div className="flex items-center gap-3">
<span className="font-bold text-gray-900">¥{cat.value.toLocaleString()}</span>
<span className="text-xs text-gray-500 bg-gray-100 px-2 py-0.5 rounded">{cat.percentage}%</span>
</div>
</div>
))}
</div>
</>
)}
</div>
</div>
</div>
);
};
export default Dashboard;
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+915
View File
@@ -0,0 +1,915 @@
import React, { useEffect, useState } from 'react';
import { createPortal } from 'react-dom';
import { Order, OrderStatus, Item } from '../types';
import { getOrders, syncOrders, syncSingleOrder, manualShipOrder, updateOrder, deleteOrder, importOrders, getItems } from '../services/api';
import { Search, MoreHorizontal, Truck, RefreshCw, Copy, ChevronLeft, ChevronRight, PackageCheck, Edit, Eye, Plus, Save, X, User as UserIcon, Phone, MapPin, Upload, ExternalLink, Trash2 } from 'lucide-react';
const StatusBadge: React.FC<{ status: OrderStatus }> = ({ status }) => {
const styles = {
processing: 'bg-blue-100 text-blue-800',
pending_ship: 'bg-[#0094f7] text-white',
shipped: 'bg-blue-100 text-blue-700',
completed: 'bg-green-100 text-green-700',
cancelled: 'bg-gray-100 text-gray-500',
refunding: 'bg-red-100 text-red-600',
};
const labels = {
processing: '处理中',
pending_ship: '待发货',
shipped: '已发货',
completed: '已完成',
cancelled: '已取消',
refunding: '退款中',
};
return (
<span className={`px-3 py-1.5 rounded-lg text-xs font-bold ${styles[status] || styles.cancelled}`}>
{labels[status] || status}
</span>
);
};
const OrderList: React.FC = () => {
const [orders, setOrders] = useState<Order[]>([]);
const [allOrders, setAllOrders] = useState<Order[]>([]); // 保存所有订单用于搜索
const [items, setItems] = useState<Item[]>([]);
const [itemNames, setItemNames] = useState<Record<string, string>>({});
const [filter, setFilter] = useState('all');
const [searchText, setSearchText] = useState(''); // 搜索文本
const [page, setPage] = useState(1);
const [totalPages, setTotalPages] = useState(1);
const [loading, setLoading] = useState(false);
const [showDetailModal, setShowDetailModal] = useState(false);
const [showEditModal, setShowEditModal] = useState(false);
const [showImportModal, setShowImportModal] = useState(false);
const [selectedOrder, setSelectedOrder] = useState<Order | null>(null);
const [editingOrder, setEditingOrder] = useState<Partial<Order> | null>(null);
const [editForm, setEditForm] = useState<Partial<Order>>({});
const [showShipModal, setShowShipModal] = useState(false);
const [shipOrderId, setShipOrderId] = useState<string>('');
const [shipLoading, setShipLoading] = useState(false);
const [shipResult, setShipResult] = useState<{success: boolean; message: string} | null>(null);
const [importFile, setImportFile] = useState<File | null>(null);
const [syncingOrderId, setSyncingOrderId] = useState<string | null>(null);
const [deletingOrderId, setDeletingOrderId] = useState<string | null>(null);
// 搜索过滤订单
const filterOrders = (ordersToFilter: Order[]): Order[] => {
if (!searchText.trim()) {
return ordersToFilter;
}
const searchLower = searchText.toLowerCase().trim();
return ordersToFilter.filter(order =>
order.order_id?.toLowerCase().includes(searchLower) ||
order.item_id?.toLowerCase().includes(searchLower) ||
order.buyer_id?.toLowerCase().includes(searchLower) ||
order.item_title?.toLowerCase().includes(searchLower) ||
order.receiver_name?.toLowerCase().includes(searchLower) ||
order.receiver_phone?.toLowerCase().includes(searchLower)
);
};
const loadOrders = async () => {
setLoading(true);
try {
// 如果有搜索文本,加载所有页的数据;否则只加载当前页
if (searchText.trim()) {
// 搜索模式:循环加载所有页
let allOrdersData: Order[] = [];
let currentPage = 1;
let hasMore = true;
while (hasMore) {
const res = await getOrders(undefined, filter, currentPage, 100);
allOrdersData = [...allOrdersData, ...res.data];
hasMore = currentPage < res.total_pages;
currentPage++;
}
setAllOrders(allOrdersData);
setOrders(filterOrders(allOrdersData));
setTotalPages(1); // 搜索时不分页
} else {
// 普通模式:只加载当前页
const res = await getOrders(undefined, filter, page, 20);
setAllOrders(res.data);
setOrders(filterOrders(res.data));
setTotalPages(res.total_pages);
}
} catch (e) {
console.error('加载订单失败:', e);
} finally {
setLoading(false);
}
};
// 当订单数据改变时,重新过滤订单
useEffect(() => {
setOrders(filterOrders(allOrders));
}, [allOrders, searchText]);
// 从订单的 item_id 查找对应的商品名称(通过标题匹配)
const getItemNameById = (orderId: string, orderItemTitle?: string): string => {
// 如果订单有 item_title,优先使用
if (orderItemTitle && orderItemTitle.trim()) {
return orderItemTitle;
}
// 尝试通过 item_id 直接匹配
if (itemNames[orderId]) {
return itemNames[orderId];
}
// 尝试在商品列表中查找相似标题的商品
const matchingItem = items.find(item => {
// 如果订单有标题,尝试匹配商品标题
if (orderItemTitle && item.item_title) {
// 检查是否包含关键词
const orderTitleLower = orderItemTitle.toLowerCase();
const itemTitleLower = item.item_title.toLowerCase();
return itemTitleLower.includes(orderTitleLower) || orderTitleLower.includes(itemTitleLower);
}
return false;
});
if (matchingItem?.item_title) {
return matchingItem.item_title;
}
return '未知商品';
};
// 从商品列表构建商品ID到商品名的映射
const buildItemNamesMap = () => {
const namesMap: Record<string, string> = {};
items.forEach(item => {
// 使用 item_id 作为键,商品标题作为值
if (item.item_id) {
namesMap[item.item_id] = item.item_title || item.item_id;
}
});
setItemNames(namesMap);
};
const buildItemNamesMapFrom = (itemsList: Item[]) => {
const namesMap: Record<string, string> = {};
itemsList.forEach(item => {
if (item.item_id) {
namesMap[item.item_id] = item.item_title || item.item_id;
}
});
setItemNames(namesMap);
};
useEffect(() => {
loadOrders();
// 加载商品列表
getItems().then((itemsList) => {
setItems(itemsList);
buildItemNamesMapFrom(itemsList);
}).catch((e) => {
console.error('加载商品列表失败:', e);
});
}, [filter, page, searchText]);
const handleSync = async () => {
setLoading(true);
try {
const result = await syncOrders();
await loadOrders();
if (result?.message) {
alert(result.message);
}
} catch (error: any) {
console.error('同步订单失败:', error);
alert(error?.message || '同步失败,请重试');
} finally {
setLoading(false);
}
};
const handleShip = (id: string) => {
setShipOrderId(id);
setShipResult(null);
setShowShipModal(true);
};
const executeShip = async (mode: 'status_only' | 'full_delivery') => {
setShipLoading(true);
setShipResult(null);
try {
const res = await manualShipOrder([shipOrderId], mode);
const result = res?.results?.[0];
if (result?.success) {
setShipResult({ success: true, message: result.message });
loadOrders();
} else {
setShipResult({ success: false, message: result?.message || '发货失败' });
}
} catch (e: any) {
setShipResult({ success: false, message: e?.message || '请求失败' });
} finally {
setShipLoading(false);
}
};
const handleViewDetail = (order: Order) => {
setSelectedOrder(order);
setShowDetailModal(true);
};
const handleEdit = (order: Order) => {
setEditingOrder({ ...order });
setShowEditModal(true);
};
const handleSaveEdit = async () => {
if (!editingOrder || !editingOrder.order_id) return;
try {
// 映射前端字段到后端期望的字段名
const updateData: Record<string, any> = {};
if (editingOrder.status !== undefined) {
updateData.order_status = editingOrder.status;
}
if (editingOrder.buyer_id !== undefined) {
updateData.buyer_id = editingOrder.buyer_id;
}
if (editingOrder.amount !== undefined) {
updateData.amount = editingOrder.amount;
}
if (editingOrder.receiver_name !== undefined) {
updateData.receiver_name = editingOrder.receiver_name;
}
if (editingOrder.receiver_phone !== undefined) {
updateData.receiver_phone = editingOrder.receiver_phone;
}
if (editingOrder.receiver_address !== undefined) {
updateData.receiver_address = editingOrder.receiver_address;
}
if (editingOrder.item_id !== undefined) {
updateData.item_id = editingOrder.item_id;
}
if (editingOrder.quantity !== undefined) {
updateData.quantity = editingOrder.quantity;
}
await updateOrder(editingOrder.order_id, updateData);
setShowEditModal(false);
setEditingOrder(null);
loadOrders();
} catch (error) {
console.error('更新订单失败:', error);
alert('更新失败,请重试');
}
};
const handleImportOrders = async () => {
if (!importFile) return;
try {
const formData = new FormData();
formData.append('file', importFile);
await importOrders(formData);
setShowImportModal(false);
setImportFile(null);
loadOrders();
alert('订单导入成功');
} catch (error: any) {
alert(error?.message || '导入失败,请检查文件格式');
}
};
const handleSyncSingle = async (orderId: string) => {
setSyncingOrderId(orderId);
try {
const result = await syncSingleOrder(orderId);
if (result.success) {
await loadOrders();
} else {
alert(result.message || '同步失败');
}
} catch (error: any) {
console.error('同步订单失败:', error);
alert(error?.message || '同步失败,请重试');
} finally {
setSyncingOrderId(null);
}
};
const handleDelete = async (orderId: string) => {
if (!confirm('确认删除该订单吗?删除后无法恢复。')) return;
setDeletingOrderId(orderId);
try {
await deleteOrder(orderId);
setAllOrders(prev => prev.filter(o => o.order_id !== orderId));
} catch (error: any) {
console.error('删除订单失败:', error);
alert(error?.message || '删除失败,请重试');
await loadOrders();
} finally {
setDeletingOrderId(null);
}
};
return (
<div className="space-y-6 animate-fade-in">
<div className="flex flex-col md:flex-row justify-between md:items-end gap-4">
<div>
<h2 className="text-4xl font-extrabold text-gray-900 tracking-tight">订单中心</h2>
<p className="text-gray-500 mt-2 font-medium">查看所有闲鱼交易记录与状态。</p>
</div>
<div className="flex items-center gap-3">
<button onClick={loadOrders} className="p-3 rounded-2xl bg-white border border-gray-100 text-gray-600 hover:bg-gray-50 hover:text-black transition-colors shadow-sm">
<RefreshCw className={`w-5 h-5 ${loading ? 'animate-spin' : ''}`} />
</button>
<button
onClick={() => setShowImportModal(true)}
className="px-5 py-3 rounded-2xl font-bold bg-gray-900 text-white hover:bg-gray-800 transition-colors text-sm flex items-center gap-2 shadow-lg"
>
<Plus className="w-4 h-4" />
插入订单
</button>
<button onClick={handleSync} className="ios-btn-primary px-6 py-3 rounded-2xl font-bold shadow-lg shadow-blue-200 text-sm flex items-center gap-2">
<Truck className="w-5 h-5" />
一键同步订单
</button>
</div>
</div>
<div className="ios-card rounded-[2rem] overflow-hidden shadow-lg border-0 bg-white">
{/* Toolbar */}
<div className="p-4 border-b border-gray-50 flex flex-col md:flex-row gap-4 justify-between items-center bg-[#FAFAFA]">
<div className="flex gap-1 p-1 bg-gray-200/50 rounded-xl overflow-x-auto max-w-full">
{[
{k:'all', v:'全部'},
{k:'shipped', v:'已发货'},
{k:'pending_ship', v:'待发货'},
{k:'cancelled', v:'已取消'},
{k:'refunding', v:'其他'}
].map(opt => (
<button
key={opt.k}
onClick={() => { setFilter(opt.k); setPage(1); setSearchText(''); }}
className={`px-5 py-2 rounded-lg text-sm font-bold transition-all whitespace-nowrap ${filter === opt.k ? 'bg-white text-black shadow-sm' : 'text-gray-500 hover:text-gray-700'}`}
>
{opt.v}
</button>
))}
</div>
<div className="relative w-full md:w-auto group">
<Search className="w-4 h-4 absolute left-4 top-1/2 -translate-y-1/2 text-gray-400 group-focus-within:text-[#0094f7] transition-colors" />
<input
type="text"
placeholder="搜索订单号/商品/买家..."
value={searchText}
onChange={(e) => { setSearchText(e.target.value); setPage(1); }}
className="ios-input pl-10 pr-4 py-2.5 rounded-xl w-64 bg-white border-none shadow-sm focus:ring-0"
/>
</div>
</div>
{/* Table */}
<div className="overflow-x-auto min-h-[400px]">
<table className="w-full text-left border-collapse table-fixed">
<thead>
<tr className="bg-white text-gray-400 text-xs font-bold uppercase tracking-wider border-b border-gray-50">
<th className="px-6 py-5" style={{width: '28%'}}>订单信息</th>
<th className="px-6 py-5" style={{width: '26%'}}>买家信息</th>
<th className="px-6 py-5" style={{width: '11%'}}>实付金额</th>
<th className="px-6 py-5" style={{width: '13%'}}>当前状态</th>
<th className="px-6 py-5 text-right" style={{width: '22%'}}>操作</th>
</tr>
</thead>
<tbody className="divide-y divide-gray-50">
{orders.map((order) => (
<tr key={order.id} className="hover:bg-[#FFFDE7]/50 transition-colors group">
<td className="px-6 py-5">
<div className="flex items-center gap-5">
<div className="w-14 h-14 rounded-xl bg-gray-100 overflow-hidden shadow-sm border border-gray-100 flex-shrink-0">
{order.item_image ? (
<img src={order.item_image} alt="" className="w-full h-full object-cover" />
) : (
<div className="w-full h-full flex items-center justify-center text-gray-300"><PackageCheck /></div>
)}
</div>
<div className="min-w-0">
<div className="font-bold text-gray-900 line-clamp-1 text-sm">
{getItemNameById(order.item_id, order.item_title)}
</div>
<div className="text-xs text-gray-500 mt-1 font-medium">订单ID: {order.order_id}</div>
<div className="text-xs text-gray-400 mt-0.5">数量: {order.quantity} • {order.created_at}</div>
</div>
</div>
</td>
<td className="px-6 py-5">
<div className="flex flex-col gap-1">
<div className="text-xs text-gray-500">买家ID</div>
<div className="text-sm font-bold text-gray-800">{order.buyer_id}</div>
{order.receiver_name && (
<>
<div className="text-xs text-gray-500">收货人</div>
<div className="text-xs text-gray-600">{order.receiver_name}</div>
</>
)}
{order.receiver_phone && (
<>
<div className="text-xs text-gray-500">联系电话</div>
<div className="text-xs text-gray-600 font-mono">{order.receiver_phone}</div>
</>
)}
{order.receiver_address && (
<>
<div className="text-xs text-gray-500">收货地址</div>
<div className="text-xs text-gray-600 line-clamp-1">{order.receiver_address}</div>
</>
)}
</div>
</td>
<td className="px-6 py-5 text-base font-extrabold text-gray-900 font-feature-settings-tnum">
{order.amount ? `¥${order.amount}` : <span className="text-xs text-amber-600 font-bold">待获取</span>}
</td>
<td className="px-6 py-5">
<StatusBadge status={order.status} />
</td>
<td className="px-6 py-5 text-right">
{order.status === 'pending_ship' && (
<button
onClick={() => handleShip(order.order_id)}
className="mr-2 text-white bg-black hover:bg-gray-800 shadow-lg shadow-gray-200 text-xs font-bold px-3 py-2 rounded-xl transition-all active:scale-95"
>
立即发货
</button>
)}
<a
href={`https://www.goofish.com/order-detail?orderId=${order.order_id}&role=seller`}
target="_blank"
rel="noopener noreferrer"
className="mr-2 inline-flex text-gray-400 hover:text-blue-600 p-2 rounded-xl hover:bg-blue-50 transition-colors"
title="查看闲鱼详情"
>
<ExternalLink className="w-4 h-4" />
</a>
<button
onClick={() => handleViewDetail(order)}
className="mr-2 text-gray-400 hover:text-blue-600 p-2 rounded-xl hover:bg-blue-50 transition-colors"
title="查看详情"
>
<Eye className="w-4 h-4" />
</button>
<button
onClick={() => handleEdit(order)}
className="mr-2 text-gray-400 hover:text-black p-2 rounded-xl hover:bg-gray-100 transition-colors"
title="编辑订单"
>
<Edit className="w-4 h-4" />
</button>
<button
onClick={() => handleSyncSingle(order.order_id)}
disabled={syncingOrderId === order.order_id}
className="mr-2 text-gray-400 hover:text-green-600 p-2 rounded-xl hover:bg-green-50 transition-colors disabled:opacity-50"
title="同步订单"
>
<RefreshCw className={`w-4 h-4 ${syncingOrderId === order.order_id ? 'animate-spin' : ''}`} />
</button>
<button
onClick={() => handleDelete(order.order_id)}
disabled={deletingOrderId === order.order_id}
className="text-gray-400 hover:text-red-500 p-2 rounded-xl hover:bg-red-50 transition-colors disabled:opacity-50"
title="删除订单"
>
<Trash2 className="w-4 h-4" />
</button>
</td>
</tr>
))}
</tbody>
</table>
</div>
{/* Pagination */}
<div className="p-4 border-t border-gray-50 flex items-center justify-between bg-white">
<div className="text-sm text-gray-500 font-medium pl-2">
第 {page} 页 / 共 {totalPages} 页
</div>
<div className="flex gap-2">
<button
disabled={page <= 1}
onClick={() => setPage(p => p - 1)}
className="p-2.5 rounded-xl bg-gray-50 hover:bg-gray-100 disabled:opacity-50 disabled:cursor-not-allowed text-gray-600 transition-colors"
>
<ChevronLeft className="w-5 h-5" />
</button>
<button
disabled={page >= totalPages}
onClick={() => setPage(p => p + 1)}
className="p-2.5 rounded-xl bg-gray-50 hover:bg-gray-100 disabled:opacity-50 disabled:cursor-not-allowed text-gray-600 transition-colors"
>
<ChevronRight className="w-5 h-5" />
</button>
</div>
</div>
</div>
{/* 订单详情弹窗 - 使用 Portal */}
{showDetailModal && selectedOrder && createPortal(
<div className="modal-overlay-centered">
<div className="modal-container">
<div className="modal-header">
<div className="flex items-center justify-between w-full">
<h3 className="text-2xl font-extrabold text-gray-900">订单详情</h3>
<button
onClick={() => setShowDetailModal(false)}
className="p-2 bg-gray-100 rounded-full hover:bg-gray-200 transition-colors"
>
<X className="w-5 h-5 text-gray-600" />
</button>
</div>
</div>
<div className="modal-body space-y-6">
{/* Order Info */}
<div className="space-y-4">
<h4 className="text-lg font-bold text-gray-800">订单信息</h4>
<div className="grid grid-cols-2 gap-4 p-4 bg-gray-50 rounded-xl">
<div>
<div className="text-xs text-gray-500 mb-1">订单号</div>
<div className="font-mono text-sm font-bold text-gray-900">{selectedOrder.order_id}</div>
</div>
<div>
<div className="text-xs text-gray-500 mb-1">状态</div>
<StatusBadge status={selectedOrder.status} />
</div>
<div>
<div className="text-xs text-gray-500 mb-1">实付金额</div>
<div className="text-lg font-extrabold text-gray-900">{selectedOrder.amount ? `¥${selectedOrder.amount}` : '待获取'}</div>
</div>
<div>
<div className="text-xs text-gray-500 mb-1">数量</div>
<div className="font-bold text-gray-900">{selectedOrder.quantity}</div>
</div>
<div className="col-span-2">
<div className="text-xs text-gray-500 mb-1">创建时间</div>
<div className="text-sm font-medium text-gray-700">{selectedOrder.created_at}</div>
</div>
</div>
</div>
{/* Item Info */}
<div className="space-y-4">
<h4 className="text-lg font-bold text-gray-800">商品信息</h4>
<div className="p-4 bg-gray-50 rounded-xl flex items-center gap-4">
{selectedOrder.item_image && (
<img src={selectedOrder.item_image} alt="" className="w-20 h-20 rounded-xl object-cover border border-gray-200" />
)}
<div className="flex-1">
<div className="font-bold text-gray-900 mb-1">
{getItemNameById(selectedOrder.item_id, selectedOrder.item_title)}
</div>
<div className="text-sm text-gray-500">商品ID: {selectedOrder.item_id}</div>
{selectedOrder.item_price && (
<div className="text-sm text-gray-500 mt-1">标价: ¥{selectedOrder.item_price}</div>
)}
</div>
</div>
</div>
{/* Buyer Info */}
<div className="space-y-4">
<h4 className="text-lg font-bold text-gray-800">买家信息</h4>
<div className="p-4 bg-gray-50 rounded-xl space-y-3">
<div>
<div className="text-xs text-gray-500 mb-1">买家ID</div>
<div className="font-bold text-gray-900">{selectedOrder.buyer_id}</div>
</div>
{selectedOrder.receiver_name && (
<div>
<div className="text-xs text-gray-500 mb-1">收货人</div>
<div className="font-medium text-gray-700">{selectedOrder.receiver_name}</div>
</div>
)}
{selectedOrder.receiver_phone && (
<div>
<div className="text-xs text-gray-500 mb-1">联系电话</div>
<div className="font-mono text-sm text-gray-700">{selectedOrder.receiver_phone}</div>
</div>
)}
{selectedOrder.receiver_address && (
<div>
<div className="text-xs text-gray-500 mb-1">收货地址</div>
<div className="text-sm text-gray-700">{selectedOrder.receiver_address}</div>
</div>
)}
</div>
</div>
</div>
<div className="modal-footer">
<div className="flex gap-3 w-full">
<button
onClick={() => setShowDetailModal(false)}
className="flex-1 px-6 py-3 rounded-xl bg-gray-100 hover:bg-gray-200 text-gray-800 font-bold transition-colors"
>
关闭
</button>
{selectedOrder.status === 'pending_ship' && (
<button
onClick={() => {
setShowDetailModal(false);
handleShip(selectedOrder.order_id);
}}
className="flex-1 px-6 py-3 rounded-xl ios-btn-primary font-bold shadow-lg shadow-blue-200"
>
立即发货
</button>
)}
</div>
</div>
</div>
</div>,
document.body
)}
{/* Import Modal - 使用 Portal */}
{showImportModal && createPortal(
<div className="modal-overlay-centered">
<div className="modal-container">
<div className="modal-header">
<div className="flex items-center justify-between w-full">
<h3 className="text-2xl font-extrabold text-gray-900">插入订单</h3>
<button
onClick={() => setShowImportModal(false)}
className="p-2 bg-gray-100 rounded-full hover:bg-gray-200 transition-colors"
>
<X className="w-5 h-5 text-gray-600" />
</button>
</div>
</div>
<div className="modal-body space-y-5">
<div>
<label className="block text-sm font-bold text-gray-700 mb-2">选择Excel文件</label>
<input
type="file"
accept=".xlsx,.csv,.tsv,.json"
onChange={(e) => setImportFile(e.target.files?.[0] || null)}
className="w-full ios-input px-4 py-3 rounded-xl text-sm"
/>
<p className="text-xs text-gray-500 mt-2">支持 .xlsx、.csv、.tsv、.json 格式</p>
</div>
{importFile && (
<div className="p-3 bg-blue-50 rounded-xl">
<div className="flex items-center gap-2">
<Upload className="w-4 h-4 text-blue-600" />
<span className="text-sm font-medium text-blue-900">{importFile.name}</span>
</div>
</div>
)}
</div>
<div className="modal-footer">
<div className="flex gap-3 w-full">
<button
onClick={() => setShowImportModal(false)}
className="flex-1 px-6 py-3 rounded-xl bg-gray-100 hover:bg-gray-200 text-gray-800 font-bold transition-colors"
>
取消
</button>
<button
onClick={handleImportOrders}
disabled={!importFile}
className="flex-1 px-6 py-3 rounded-xl ios-btn-primary font-bold shadow-lg shadow-blue-200 disabled:opacity-50"
>
导入订单
</button>
</div>
</div>
</div>
</div>,
document.body
)}
{/* Ship Modal - 发货方式选择 */}
{showShipModal && createPortal(
<div className="modal-overlay-centered">
<div className="modal-container" style={{ maxWidth: '480px' }}>
<div className="modal-header">
<div className="flex items-center justify-between w-full">
<h3 className="text-2xl font-extrabold text-gray-900">立即发货</h3>
<button
onClick={() => { setShowShipModal(false); setShipResult(null); }}
className="p-2 bg-gray-100 rounded-full hover:bg-gray-200 transition-colors"
>
<X className="w-5 h-5 text-gray-600" />
</button>
</div>
</div>
<div className="modal-body space-y-4">
<p className="text-sm text-gray-600">请选择发货方式:</p>
{/* 选项A: 仅修改发货状态 */}
<button
onClick={() => executeShip('status_only')}
disabled={shipLoading}
className="w-full text-left p-4 rounded-xl border-2 border-gray-200 hover:border-gray-400 hover:bg-gray-50 transition-all disabled:opacity-50 disabled:cursor-not-allowed"
>
<div className="flex items-start gap-3">
<div className="w-10 h-10 rounded-xl bg-blue-100 flex items-center justify-center flex-shrink-0 mt-0.5">
<Truck className="w-5 h-5 text-blue-600" />
</div>
<div>
<div className="font-bold text-gray-900 text-sm">仅修改闲鱼发货状态</div>
<div className="text-xs text-gray-500 mt-1 leading-relaxed">
不实际扣除或发送卡券,仅在闲鱼平台将订单标记为"已发货"。
适用于已经给客户发过货、只是忘记在闲鱼修改状态的情况。
</div>
</div>
</div>
</button>
{/* 选项B: 完整发货流程 */}
<button
onClick={() => executeShip('full_delivery')}
disabled={shipLoading}
className="w-full text-left p-4 rounded-xl border-2 border-gray-200 hover:border-[#0094f7] hover:bg-blue-50 transition-all disabled:opacity-50 disabled:cursor-not-allowed"
>
<div className="flex items-start gap-3">
<div className="w-10 h-10 rounded-xl bg-blue-100 flex items-center justify-center flex-shrink-0 mt-0.5">
<PackageCheck className="w-5 h-5 text-blue-700" />
</div>
<div>
<div className="font-bold text-gray-900 text-sm">完整发货(匹配卡券并发送)</div>
<div className="text-xs text-gray-500 mt-1 leading-relaxed">
自动匹配发货规则、获取卡券、发送卡券信息给买家,并修改发货状态。
适用于订单既没有发送卡券给买家、也没有修改发货状态的情况。
</div>
</div>
</div>
</button>
{/* 加载状态 */}
{shipLoading && (
<div className="flex items-center justify-center gap-2 py-3">
<RefreshCw className="w-4 h-4 animate-spin text-gray-500" />
<span className="text-sm text-gray-500">正在处理中...</span>
</div>
)}
{/* 结果显示 */}
{shipResult && (
<div className={`p-3 rounded-xl text-sm ${shipResult.success ? 'bg-green-50 text-green-800' : 'bg-red-50 text-red-800'}`}>
{shipResult.success ? '✓ ' : '✗ '}{shipResult.message}
</div>
)}
</div>
<div className="modal-footer">
<button
onClick={() => { setShowShipModal(false); setShipResult(null); }}
className="w-full px-6 py-3 rounded-xl bg-gray-100 hover:bg-gray-200 text-gray-800 font-bold transition-colors"
>
{shipResult?.success ? '完成' : '取消'}
</button>
</div>
</div>
</div>,
document.body
)}
{/* Edit Modal - 使用 Portal */}
{showEditModal && editingOrder && createPortal(
<div className="modal-overlay-centered">
<div className="modal-container">
<div className="modal-header">
<div className="flex items-center justify-between w-full">
<h3 className="text-2xl font-extrabold text-gray-900">编辑订单</h3>
<button
onClick={() => setShowEditModal(false)}
className="p-2 bg-gray-100 rounded-full hover:bg-gray-200 transition-colors"
>
<X className="w-5 h-5 text-gray-600" />
</button>
</div>
</div>
<div className="modal-body space-y-5">
<div className="grid grid-cols-2 gap-4">
<div>
<label className="block text-sm font-bold text-gray-700 mb-2">订单号</label>
<input
type="text"
value={editingOrder.order_id}
disabled
className="w-full ios-input px-4 py-3 rounded-xl bg-gray-50 text-gray-500"
/>
</div>
<div>
<label className="block text-sm font-bold text-gray-700 mb-2">订单状态</label>
<select
value={editingOrder.status}
onChange={(e) => setEditingOrder({ ...editingOrder, status: e.target.value as OrderStatus })}
className="w-full ios-input px-4 py-3 rounded-xl"
>
<option value="processing">处理中</option>
<option value="pending_ship">待发货</option>
<option value="shipped">已发货</option>
<option value="completed">已完成</option>
<option value="cancelled">已取消</option>
<option value="refunding">退款中</option>
</select>
</div>
</div>
<div className="grid grid-cols-2 gap-4">
<div>
<label className="block text-sm font-bold text-gray-700 mb-2">买家ID</label>
<input
type="text"
value={editingOrder.buyer_id}
onChange={(e) => setEditingOrder({ ...editingOrder, buyer_id: e.target.value })}
className="w-full ios-input px-4 py-3 rounded-xl"
/>
</div>
<div>
<label className="block text-sm font-bold text-gray-700 mb-2">实付金额</label>
<input
type="number"
value={editingOrder.amount}
onChange={(e) => setEditingOrder({ ...editingOrder, amount: parseFloat(e.target.value) })}
className="w-full ios-input px-4 py-3 rounded-xl"
/>
</div>
</div>
<div className="grid grid-cols-2 gap-4">
<div>
<label className="block text-sm font-bold text-gray-700 mb-2">收货人</label>
<input
type="text"
value={editingOrder.receiver_name || ''}
onChange={(e) => setEditingOrder({ ...editingOrder, receiver_name: e.target.value })}
className="w-full ios-input px-4 py-3 rounded-xl"
/>
</div>
<div>
<label className="block text-sm font-bold text-gray-700 mb-2">联系电话</label>
<input
type="text"
value={editingOrder.receiver_phone || ''}
onChange={(e) => setEditingOrder({ ...editingOrder, receiver_phone: e.target.value })}
className="w-full ios-input px-4 py-3 rounded-xl"
/>
</div>
</div>
<div>
<label className="block text-sm font-bold text-gray-700 mb-2">收货地址</label>
<textarea
value={editingOrder.receiver_address || ''}
onChange={(e) => setEditingOrder({ ...editingOrder, receiver_address: e.target.value })}
rows={2}
className="w-full ios-input px-4 py-3 rounded-xl resize-none"
/>
</div>
<div>
<label className="block text-sm font-bold text-gray-700 mb-2">商品标题</label>
<input
type="text"
value={editingOrder.item_title || ''}
onChange={(e) => setEditingOrder({ ...editingOrder, item_title: e.target.value })}
className="w-full ios-input px-4 py-3 rounded-xl"
/>
</div>
</div>
<div className="modal-footer">
<div className="flex gap-3 w-full">
<button
onClick={() => setShowEditModal(false)}
className="flex-1 px-6 py-3 rounded-xl font-bold bg-gray-100 text-gray-700 hover:bg-gray-200 transition-colors"
>
取消
</button>
<button
onClick={handleSaveEdit}
className="flex-1 ios-btn-primary px-6 py-3 rounded-xl font-bold flex items-center justify-center gap-2"
>
<Save className="w-4 h-4" />
保存更改
</button>
</div>
</div>
</div>
</div>,
document.body
)}
</div>
);
};
export default OrderList;
+496
View File
@@ -0,0 +1,496 @@
import React, { useEffect, useState } from 'react';
import { ShippingRule, ReplyRule, AccountDetail } from '../types';
import { getShippingRules, getReplyRules, updateShippingRule, deleteShippingRule, updateReplyRule, deleteReplyRule, getAccountDetails } from '../services/api';
import { Zap, MessageCircle, Plus, Trash2, Edit, Save, X, AlertCircle, RefreshCw, Package } from 'lucide-react';
const Rules: React.FC = () => {
const [activeTab, setActiveTab] = useState<'shipping' | 'reply'>('shipping');
const [shippingRules, setShippingRules] = useState<ShippingRule[]>([]);
const [replyRules, setReplyRules] = useState<ReplyRule[]>([]);
const [accounts, setAccounts] = useState<AccountDetail[]>([]);
const [cards, setCards] = useState<any[]>([]); // 需要从卡密API获取
const [loading, setLoading] = useState(false);
const [selectedAccountId, setSelectedAccountId] = useState<string>('');
// 弹窗状态
const [showShippingModal, setShowShippingModal] = useState(false);
const [showReplyModal, setShowReplyModal] = useState(false);
const [editingShippingRule, setEditingShippingRule] = useState<Partial<ShippingRule> | null>(null);
const [editingReplyRule, setEditingReplyRule] = useState<Partial<ReplyRule> | null>(null);
// Load data
const refresh = async () => {
setLoading(true);
try {
if (activeTab === 'shipping') {
const data = await getShippingRules();
setShippingRules(data);
} else {
// 关键词回复需要选择账号
if (!selectedAccountId) {
setReplyRules([]);
return;
}
const data = await getReplyRules(selectedAccountId);
setReplyRules(data);
}
} finally {
setLoading(false);
}
};
useEffect(() => {
getAccountDetails().then((accounts) => {
setAccounts(accounts);
// 自动选择第一个账号
if (accounts.length > 0 && !selectedAccountId) {
setSelectedAccountId(accounts[0].id);
}
});
}, []);
useEffect(() => {
refresh();
}, [activeTab, selectedAccountId]);
// Handlers
const handleToggleShipping = async (rule: ShippingRule) => {
await updateShippingRule({ ...rule, enabled: !rule.enabled });
refresh();
};
const handleDeleteShipping = async (id: string) => {
if(confirm('确定删除该发货规则吗?')) {
await deleteShippingRule(id);
refresh();
}
};
const handleToggleReply = async (rule: ReplyRule) => {
if (!selectedAccountId) return alert('请先选择账号');
await updateReplyRule({ ...rule, enabled: !rule.enabled }, selectedAccountId);
refresh();
};
const handleDeleteReply = async (id: string) => {
if (!selectedAccountId) return alert('请先选择账号');
if(confirm('确定删除该回复规则吗?')) {
await deleteReplyRule(id, selectedAccountId);
refresh();
}
};
// 发货规则增删改
const handleAddShippingRule = () => {
setEditingShippingRule({
name: '',
item_keyword: '',
card_group_id: 0,
card_group_name: '',
priority: 1,
enabled: true
});
setShowShippingModal(true);
};
const handleEditShippingRule = (rule: ShippingRule) => {
setEditingShippingRule({ ...rule });
setShowShippingModal(true);
};
const handleSaveShippingRule = async () => {
if (!editingShippingRule) return;
try {
await updateShippingRule(editingShippingRule);
setShowShippingModal(false);
refresh();
} catch (error) {
console.error('保存发货规则失败:', error);
alert('保存失败,请重试');
}
};
// 关键词回复增删改
const handleAddReplyRule = () => {
if (!selectedAccountId) return alert('请先选择账号');
setEditingReplyRule({
keyword: '',
reply_content: '',
match_type: 'exact',
enabled: true
});
setShowReplyModal(true);
};
const handleEditReplyRule = (rule: ReplyRule) => {
setEditingReplyRule({ ...rule });
setShowReplyModal(true);
};
const handleSaveReplyRule = async () => {
if (!editingReplyRule || !selectedAccountId) return;
try {
await updateReplyRule(editingReplyRule, selectedAccountId);
setShowReplyModal(false);
refresh();
} catch (error) {
console.error('保存回复规则失败:', error);
alert('保存失败,请重试');
}
};
return (
<div className="space-y-6 animate-fade-in pb-20">
<div className="flex justify-between items-center">
<div>
<h2 className="text-3xl font-extrabold text-gray-900">智能策略</h2>
<p className="text-gray-500 mt-2 font-medium">配置自动发货逻辑与关键词自动回复规则。</p>
</div>
<button onClick={refresh} className="p-3 bg-white rounded-xl shadow-sm hover:shadow-md transition-shadow">
<RefreshCw className={`w-5 h-5 text-gray-500 ${loading ? 'animate-spin' : ''}`} />
</button>
</div>
{/* Tabs */}
<div className="flex p-1.5 bg-gray-200/50 rounded-2xl w-fit">
<button
onClick={() => setActiveTab('shipping')}
className={`flex items-center gap-2 px-6 py-3 rounded-xl text-sm font-bold transition-all ${activeTab === 'shipping' ? 'bg-white shadow-sm text-black' : 'text-gray-500 hover:text-gray-700'}`}
>
<Zap className="w-4 h-4" /> 自动发货规则
</button>
<button
onClick={() => setActiveTab('reply')}
className={`flex items-center gap-2 px-6 py-3 rounded-xl text-sm font-bold transition-all ${activeTab === 'reply' ? 'bg-white shadow-sm text-black' : 'text-gray-500 hover:text-gray-700'}`}
>
<MessageCircle className="w-4 h-4" /> 关键词回复
</button>
</div>
{/* Content Area */}
<div className="ios-card bg-white rounded-[2rem] p-6 min-h-[500px]">
{/* SHIPPING RULES */}
{activeTab === 'shipping' && (
<div className="space-y-4">
<div className="flex justify-between items-center mb-6">
<div className="flex items-center gap-2 text-sm text-blue-700 bg-blue-50 px-4 py-2 rounded-xl">
<AlertCircle className="w-4 h-4" />
当订单商品标题包含关键词时,自动发送对应卡密。
</div>
<button onClick={handleAddShippingRule} className="ios-btn-primary px-5 py-3 rounded-2xl text-sm font-bold flex items-center gap-2 shadow-lg shadow-blue-200">
<Plus className="w-4 h-4" /> 新增发货规则
</button>
</div>
<div className="space-y-3">
{shippingRules.map(rule => (
<div key={rule.id} className="flex items-center justify-between p-5 rounded-2xl border border-gray-100 bg-[#F7F8FA] hover:bg-white hover:shadow-lg transition-all duration-300">
<div className="flex items-center gap-4">
<div className={`w-12 h-12 rounded-2xl flex items-center justify-center font-bold text-lg ${rule.enabled ? 'bg-black text-[#0094f7]' : 'bg-gray-200 text-gray-400'}`}>
{rule.priority}
</div>
<div>
<h3 className="font-bold text-gray-900 text-lg">{rule.name}</h3>
<div className="flex items-center gap-3 mt-1 text-sm text-gray-500 font-medium">
<span className="bg-blue-50 text-blue-600 px-2 py-0.5 rounded-lg">关键词: {rule.item_keyword}</span>
<span>→</span>
<span className="bg-purple-50 text-purple-600 px-2 py-0.5 rounded-lg">卡密组: {rule.card_group_name || `ID:${rule.card_group_id}`}</span>
</div>
</div>
</div>
<div className="flex items-center gap-3">
<button
onClick={() => handleEditShippingRule(rule)}
className="p-2 text-gray-400 hover:text-black hover:bg-gray-100 rounded-xl transition-colors"
title="编辑"
>
<Edit className="w-4 h-4" />
</button>
<button
onClick={() => handleToggleShipping(rule)}
className={`w-12 h-8 rounded-full relative transition-colors ${rule.enabled ? 'bg-green-500' : 'bg-gray-300'}`}
>
<div className={`absolute top-1 w-6 h-6 bg-white rounded-full shadow-sm transition-transform ${rule.enabled ? 'left-5' : 'left-1'}`}></div>
</button>
<button onClick={() => handleDeleteShipping(rule.id)} className="p-2 text-gray-400 hover:text-red-500 hover:bg-red-50 rounded-xl transition-colors">
<Trash2 className="w-5 h-5" />
</button>
</div>
</div>
))}
{shippingRules.length === 0 && <div className="text-center py-20 text-gray-400">暂无规则</div>}
</div>
</div>
)}
{/* REPLY RULES */}
{activeTab === 'reply' && (
<div className="space-y-4">
<div className="flex justify-between items-center mb-6">
<div className="flex items-center gap-4">
<div className="flex items-center gap-2 text-sm text-blue-700 bg-blue-50 px-4 py-2 rounded-xl">
<AlertCircle className="w-4 h-4" />
当买家发送包含关键词的消息时,优先触发此回复。
</div>
<select
value={selectedAccountId}
onChange={(e) => setSelectedAccountId(e.target.value)}
className="ios-input px-4 py-3 rounded-xl text-sm"
>
<option value="">选择账号查看关键词</option>
{accounts.map(acc => (
<option key={acc.id} value={acc.id}>{acc.nickname || acc.id}</option>
))}
</select>
</div>
<button
onClick={handleAddReplyRule}
className="ios-btn-primary px-5 py-3 rounded-2xl text-sm font-bold flex items-center gap-2 shadow-lg shadow-blue-200"
>
<Plus className="w-4 h-4" /> 新增回复规则
</button>
</div>
<div className="space-y-3">
{replyRules.map(rule => (
<div key={rule.id} className="flex flex-col md:flex-row md:items-center justify-between p-5 rounded-2xl border border-gray-100 bg-[#F7F8FA] hover:bg-white hover:shadow-lg transition-all duration-300 gap-4">
<div className="flex-1">
<div className="flex items-center gap-3 mb-2">
<span className="px-3 py-1 bg-black text-white rounded-lg text-xs font-bold">{rule.match_type === 'exact' ? '精确匹配' : '模糊包含'}</span>
<h3 className="font-bold text-gray-900">"{rule.keyword}"</h3>
</div>
<div className="bg-white p-3 rounded-xl border border-gray-100 text-sm text-gray-600 leading-relaxed">
{rule.reply_content}
</div>
</div>
<div className="flex items-center gap-4 border-t md:border-t-0 md:border-l border-gray-200 pt-4 md:pt-0 md:pl-6">
<button
onClick={() => handleEditReplyRule(rule)}
className="p-2 text-gray-400 hover:text-black hover:bg-gray-100 rounded-xl transition-colors"
title="编辑"
>
<Edit className="w-4 h-4" />
</button>
<button
onClick={() => handleToggleReply(rule)}
className={`w-12 h-8 rounded-full relative transition-colors ${rule.enabled ? 'bg-green-500' : 'bg-gray-300'}`}
>
<div className={`absolute top-1 w-6 h-6 bg-white rounded-full shadow-sm transition-transform ${rule.enabled ? 'left-5' : 'left-1'}`}></div>
</button>
<button onClick={() => handleDeleteReply(rule.id)} className="p-2 text-gray-400 hover:text-red-500 hover:bg-red-50 rounded-xl transition-colors">
<Trash2 className="w-5 h-5" />
</button>
</div>
</div>
))}
{replyRules.length === 0 && <div className="text-center py-20 text-gray-400">暂无规则</div>}
</div>
</div>
)}
</div>
{/* Shipping Rule Modal */}
{showShippingModal && (
<div className="modal-overlay">
<div className="modal-container">
<div className="modal-header">
<div className="flex items-center justify-between w-full">
<h3 className="text-2xl font-extrabold text-gray-900">
{editingShippingRule?.id ? '编辑发货规则' : '新增发货规则'}
</h3>
<button
onClick={() => setShowShippingModal(false)}
className="p-2 bg-gray-100 rounded-full hover:bg-gray-200 transition-colors"
>
<X className="w-5 h-5 text-gray-600" />
</button>
</div>
</div>
<div className="modal-body space-y-5">
<div>
<label className="block text-sm font-bold text-gray-700 mb-2">规则名称</label>
<input
type="text"
value={editingShippingRule?.name || ''}
onChange={(e) => setEditingShippingRule({ ...editingShippingRule, name: e.target.value })}
placeholder="例如:VIP会员发货"
className="w-full ios-input px-4 py-3 rounded-xl"
/>
</div>
<div>
<label className="block text-sm font-bold text-gray-700 mb-2">商品关键词</label>
<input
type="text"
value={editingShippingRule?.item_keyword || ''}
onChange={(e) => setEditingShippingRule({ ...editingShippingRule, item_keyword: e.target.value })}
placeholder="商品标题中包含的关键词"
className="w-full ios-input px-4 py-3 rounded-xl"
/>
</div>
<div>
<label className="block text-sm font-bold text-gray-700 mb-2">卡密组ID</label>
<input
type="number"
value={editingShippingRule?.card_group_id || 0}
onChange={(e) => setEditingShippingRule({ ...editingShippingRule, card_group_id: parseInt(e.target.value) || 0 })}
placeholder="输入卡密组ID"
className="w-full ios-input px-4 py-3 rounded-xl"
/>
</div>
<div>
<label className="block text-sm font-bold text-gray-700 mb-2">优先级</label>
<input
type="number"
value={editingShippingRule?.priority || 1}
onChange={(e) => setEditingShippingRule({ ...editingShippingRule, priority: parseInt(e.target.value) || 1 })}
min="1"
className="w-full ios-input px-4 py-3 rounded-xl"
/>
<p className="text-xs text-gray-500 mt-1">数字越小优先级越高</p>
</div>
<div className="flex items-center justify-between p-4 bg-gray-50 rounded-xl">
<span className="font-bold text-gray-900">启用状态</span>
<button
type="button"
onClick={() => setEditingShippingRule({ ...editingShippingRule, enabled: !editingShippingRule?.enabled })}
className={`w-14 h-8 rounded-full transition-colors duration-300 relative ${
editingShippingRule?.enabled ? 'bg-[#0094f7]' : 'bg-gray-300'
}`}
>
<span
className={`absolute top-1 w-6 h-6 bg-white rounded-full shadow-md transition-transform duration-300 block ${
editingShippingRule?.enabled ? 'translate-x-7' : 'translate-x-1'
}`}
/>
</button>
</div>
<div className="flex gap-3 pt-4">
<button
onClick={() => setShowShippingModal(false)}
className="flex-1 px-6 py-3 rounded-xl font-bold bg-gray-100 text-gray-700 hover:bg-gray-200 transition-colors"
>
取消
</button>
<button
onClick={handleSaveShippingRule}
className="flex-1 ios-btn-primary px-6 py-3 rounded-xl font-bold flex items-center justify-center gap-2"
>
<Save className="w-4 h-4" />
保存规则
</button>
</div>
</div>
</div>
</div>
)}
{/* Reply Rule Modal */}
{showReplyModal && (
<div className="modal-overlay">
<div className="modal-container">
<div className="modal-header">
<div className="flex items-center justify-between w-full">
<h3 className="text-2xl font-extrabold text-gray-900">
{editingReplyRule?.id ? '编辑回复规则' : '新增回复规则'}
</h3>
<button
onClick={() => setShowReplyModal(false)}
className="p-2 bg-gray-100 rounded-full hover:bg-gray-200 transition-colors"
>
<X className="w-5 h-5 text-gray-600" />
</button>
</div>
</div>
<div className="modal-body space-y-5">
<div>
<label className="block text-sm font-bold text-gray-700 mb-2">关键词</label>
<input
type="text"
value={editingReplyRule?.keyword || ''}
onChange={(e) => setEditingReplyRule({ ...editingReplyRule, keyword: e.target.value })}
placeholder="买家发送的关键词"
className="w-full ios-input px-4 py-3 rounded-xl"
/>
</div>
<div>
<label className="block text-sm font-bold text-gray-700 mb-2">回复内容</label>
<textarea
value={editingReplyRule?.reply_content || ''}
onChange={(e) => setEditingReplyRule({ ...editingReplyRule, reply_content: e.target.value })}
placeholder="自动回复的内容"
className="w-full ios-input px-4 py-3 rounded-xl h-32 resize-none"
/>
</div>
<div>
<label className="block text-sm font-bold text-gray-700 mb-2">匹配类型</label>
<div className="grid grid-cols-2 gap-2">
<button
type="button"
onClick={() => setEditingReplyRule({ ...editingReplyRule, match_type: 'exact' })}
className={`p-3 rounded-xl font-bold transition-all ${
editingReplyRule?.match_type === 'exact' ? 'bg-[#0094f7] text-white' : 'bg-gray-100 text-gray-600'
}`}
>
精确匹配
</button>
<button
type="button"
onClick={() => setEditingReplyRule({ ...editingReplyRule, match_type: 'fuzzy' })}
className={`p-3 rounded-xl font-bold transition-all ${
editingReplyRule?.match_type === 'fuzzy' ? 'bg-[#0094f7] text-white' : 'bg-gray-100 text-gray-600'
}`}
>
模糊包含
</button>
</div>
</div>
<div className="flex items-center justify-between p-4 bg-gray-50 rounded-xl">
<span className="font-bold text-gray-900">启用状态</span>
<button
type="button"
onClick={() => setEditingReplyRule({ ...editingReplyRule, enabled: !editingReplyRule?.enabled })}
className={`w-14 h-8 rounded-full transition-colors duration-300 relative ${
editingReplyRule?.enabled ? 'bg-[#0094f7]' : 'bg-gray-300'
}`}
>
<span
className={`absolute top-1 w-6 h-6 bg-white rounded-full shadow-md transition-transform duration-300 block ${
editingReplyRule?.enabled ? 'translate-x-7' : 'translate-x-1'
}`}
/>
</button>
</div>
<div className="flex gap-3 pt-4">
<button
onClick={() => setShowReplyModal(false)}
className="flex-1 px-6 py-3 rounded-xl font-bold bg-gray-100 text-gray-700 hover:bg-gray-200 transition-colors"
>
取消
</button>
<button
onClick={handleSaveReplyRule}
className="flex-1 ios-btn-primary px-6 py-3 rounded-xl font-bold flex items-center justify-center gap-2"
>
<Save className="w-4 h-4" />
保存规则
</button>
</div>
</div>
</div>
</div>
)}
</div>
);
};
export default Rules;
+611
View File
@@ -0,0 +1,611 @@
import React, { useEffect, useRef, useState } from 'react';
import {
fetchAIModels,
getSystemSettings,
updateLoginCredentials,
updateSystemSettings,
verifySession,
} from '../services/api';
import { SystemSettings } from '../types';
import {
Save, Sparkles, Mail, Settings as SettingsIcon,
Eye, EyeOff, RefreshCw, Database, ChevronDown, Check,
LockKeyhole, UserRound, ShieldCheck
} from 'lucide-react';
const DEFAULT_AI_API_URL = 'https://dashscope.aliyuncs.com/compatible-mode/v1';
const Settings: React.FC = () => {
const [settings, setSettings] = useState<SystemSettings | null>(null);
const [loading, setLoading] = useState(false);
const [saving, setSaving] = useState(false);
const [aiModels, setAiModels] = useState<string[]>([]);
const [modelsLoading, setModelsLoading] = useState(false);
const [modelError, setModelError] = useState('');
const [modelDropdownOpen, setModelDropdownOpen] = useState(false);
const modelPickerRef = useRef<HTMLDivElement>(null);
// Password visibility states
const [showApiKey, setShowApiKey] = useState(false);
const [showSmtpPassword, setShowSmtpPassword] = useState(false);
const [showCurrentPassword, setShowCurrentPassword] = useState(false);
const [showNewPassword, setShowNewPassword] = useState(false);
const [credentialsSaving, setCredentialsSaving] = useState(false);
const [credentialsMessage, setCredentialsMessage] = useState<{type: 'success' | 'error'; text: string} | null>(null);
const [credentials, setCredentials] = useState({
new_username: '',
current_password: '',
new_password: '',
confirm_password: '',
});
useEffect(() => {
loadSettings();
verifySession().then(session => {
if (session.username) {
setCredentials(current => ({...current, new_username: session.username || ''}));
}
}).catch(() => undefined);
}, []);
useEffect(() => {
const handlePointerDown = (event: MouseEvent) => {
if (!modelPickerRef.current?.contains(event.target as Node)) {
setModelDropdownOpen(false);
}
};
document.addEventListener('mousedown', handlePointerDown);
return () => document.removeEventListener('mousedown', handlePointerDown);
}, []);
const loadAIModels = async (source?: SystemSettings | null, openAfterLoad = false) => {
const current = source || settings;
const baseUrl = current?.ai_api_url || current?.ai_base_url || DEFAULT_AI_API_URL;
setModelsLoading(true);
setModelError('');
try {
const models = await fetchAIModels(baseUrl, current?.ai_api_key || '');
setAiModels(models);
setModelDropdownOpen(openAfterLoad && models.length > 0);
if (!current?.ai_model && models.length > 0) {
setSettings(prev => prev ? { ...prev, ai_model: models[0] } : prev);
}
} catch (e) {
setAiModels([]);
setModelDropdownOpen(false);
setModelError((e as Error).message || '读取模型失败');
} finally {
setModelsLoading(false);
}
};
const loadSettings = () => {
setLoading(true);
getSystemSettings()
.then(data => {
setSettings(data);
loadAIModels(data);
})
.finally(() => setLoading(false));
};
const handleSave = async () => {
if(!settings) return;
setSaving(true);
try {
await updateSystemSettings(settings);
alert('系统配置已保存');
} catch (e) {
alert('保存失败:' + (e as Error).message);
} finally {
setSaving(false);
}
};
const handleCredentialsSave = async (event: React.FormEvent) => {
event.preventDefault();
setCredentialsMessage(null);
const username = credentials.new_username.trim();
if (username.length < 3) {
setCredentialsMessage({type: 'error', text: '用户名至少需要 3 个字符'});
return;
}
if (!credentials.current_password) {
setCredentialsMessage({type: 'error', text: '请输入当前密码确认身份'});
return;
}
if (credentials.new_password && credentials.new_password.length < 8) {
setCredentialsMessage({type: 'error', text: '新密码至少需要 8 个字符'});
return;
}
if (credentials.new_password !== credentials.confirm_password) {
setCredentialsMessage({type: 'error', text: '两次输入的新密码不一致'});
return;
}
setCredentialsSaving(true);
try {
const result = await updateLoginCredentials({
current_password: credentials.current_password,
new_username: username,
new_password: credentials.new_password || undefined,
});
if (!result.success) {
setCredentialsMessage({type: 'error', text: result.message || '登录凭据更新失败'});
return;
}
setCredentialsMessage({type: 'success', text: result.message || '登录凭据已更新'});
window.setTimeout(() => window.location.reload(), 1400);
} catch (error) {
setCredentialsMessage({type: 'error', text: (error as Error).message || '登录凭据更新失败'});
} finally {
setCredentialsSaving(false);
}
};
if (!settings) return <div className="p-8 text-center text-gray-400">加载配置中...</div>;
const currentModel = settings.ai_model || '';
const visibleAIModels = aiModels;
return (
<div className="max-w-6xl mx-auto space-y-8 animate-fade-in pb-24">
{/* Header */}
<div className="flex items-center justify-between">
<div className="flex items-center gap-4">
<div className="w-12 h-12 bg-gray-100 rounded-2xl flex items-center justify-center">
<SettingsIcon className="w-6 h-6 text-gray-600" />
</div>
<div>
<h2 className="text-3xl font-extrabold text-gray-900">系统设置</h2>
<p className="text-gray-500 mt-1 text-sm font-medium">配置全局自动化规则与系统参数</p>
</div>
</div>
<button
onClick={loadSettings}
className="px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-xl font-bold text-gray-700 flex items-center gap-2 transition-colors"
>
<RefreshCw className="w-4 h-4" />
刷新
</button>
</div>
<div className="grid grid-cols-1 lg:grid-cols-2 gap-8">
{/* Left Column */}
<div className="space-y-8">
{/* Basic Settings */}
<section className="space-y-4">
<h3 className="text-lg font-extrabold text-gray-800 flex items-center gap-2">
<div className="p-1.5 rounded-lg bg-gray-100 text-gray-600">
<Database className="w-4 h-4" />
</div>
基础设置
</h3>
<div className="ios-card rounded-[2rem] p-6 bg-white space-y-4">
<div className="flex items-center justify-between p-4 bg-gray-50 rounded-xl">
<div>
<div className="font-bold text-gray-900">允许用户注册</div>
<div className="text-xs text-gray-500 mt-1">开启后允许新用户注册账号</div>
</div>
<button
onClick={() => setSettings({...settings, registration_enabled: !settings.registration_enabled})}
className={`w-14 h-8 rounded-full transition-all relative ${
settings.registration_enabled ? 'bg-[#0094f7]' : 'bg-gray-300'
}`}
>
<div
className={`w-6 h-6 bg-white rounded-full absolute top-1 transition-all shadow-md ${
settings.registration_enabled ? 'left-7' : 'left-1'
}`}
/>
</button>
</div>
<div className="flex items-center justify-between p-4 bg-gray-50 rounded-xl">
<div>
<div className="font-bold text-gray-900">显示默认登录信息</div>
<div className="text-xs text-gray-500 mt-1">登录页面显示默认账号密码提示</div>
</div>
<button
onClick={() => setSettings({...settings, show_default_login_info: !settings.show_default_login_info})}
className={`w-14 h-8 rounded-full transition-all relative ${
settings.show_default_login_info ? 'bg-[#0094f7]' : 'bg-gray-300'
}`}
>
<div
className={`w-6 h-6 bg-white rounded-full absolute top-1 transition-all shadow-md ${
settings.show_default_login_info ? 'left-7' : 'left-1'
}`}
/>
</button>
</div>
<div className="flex items-center justify-between p-4 bg-gray-50 rounded-xl">
<div>
<div className="font-bold text-gray-900">登录滑动验证码</div>
<div className="text-xs text-gray-500 mt-1">开启后账号密码登录需要完成滑动验证</div>
</div>
<button
onClick={() => setSettings({...settings, login_captcha_enabled: !settings.login_captcha_enabled})}
className={`w-14 h-8 rounded-full transition-all relative ${
settings.login_captcha_enabled ? 'bg-[#0094f7]' : 'bg-gray-300'
}`}
>
<div
className={`w-6 h-6 bg-white rounded-full absolute top-1 transition-all shadow-md ${
settings.login_captcha_enabled ? 'left-7' : 'left-1'
}`}
/>
</button>
</div>
<div className="flex items-center justify-between p-4 bg-gray-50 rounded-xl">
<div>
<div className="font-bold text-gray-900">启用商品自动同步</div>
<div className="text-xs text-gray-500 mt-1">定时自动获取商品信息到本地数据库</div>
</div>
<button
onClick={() => setSettings({...settings, item_sync_enabled: !settings.item_sync_enabled})}
className={`w-14 h-8 rounded-full transition-all relative ${
settings.item_sync_enabled ? 'bg-[#0094f7]' : 'bg-gray-300'
}`}
>
<div
className={`w-6 h-6 bg-white rounded-full absolute top-1 transition-all shadow-md ${
settings.item_sync_enabled ? 'left-7' : 'left-1'
}`}
/>
</button>
</div>
<div className="space-y-3 px-4">
<label className="block text-sm font-bold text-gray-800">商品同步间隔(分钟)</label>
<input
type="number"
value={Math.round((settings.item_sync_interval || 600) / 60)}
onChange={(e) => {
const minutes = parseInt(e.target.value) || 10;
setSettings({...settings, item_sync_interval: minutes * 60});
}}
className="w-full ios-input px-4 py-3 rounded-xl"
min="1"
max="1440"
/>
<p className="text-xs text-gray-500">建议:10-60分钟</p>
</div>
<div className="space-y-3 px-4">
<label className="block text-sm font-bold text-gray-800">每次最多同步页数</label>
<input
type="number"
value={settings.item_sync_max_pages || 5}
onChange={(e) => setSettings({...settings, item_sync_max_pages: parseInt(e.target.value) || 5})}
className="w-full ios-input px-4 py-3 rounded-xl"
min="1"
max="50"
/>
<p className="text-xs text-gray-500">每页20个商品</p>
</div>
</div>
</section>
{/* AI Configuration */}
<section className="space-y-4">
<h3 className="text-lg font-extrabold text-gray-800 flex items-center gap-2">
<div className="p-1.5 rounded-lg bg-[#0094f7] text-white">
<Sparkles className="w-4 h-4" />
</div>
AI 智能回复配置
</h3>
<div className="ios-card rounded-[2rem] p-6 bg-white space-y-6">
<div className="space-y-3">
<label className="block text-sm font-bold text-gray-800">API 地址</label>
<input
type="text"
value={settings.ai_api_url || DEFAULT_AI_API_URL}
onChange={e => setSettings({...settings, ai_api_url: e.target.value})}
className="w-full ios-input px-4 py-3 rounded-xl text-sm"
placeholder="https://api.openai.com/v1"
/>
<p className="text-xs text-gray-500">无需补全 /chat/completions</p>
</div>
<div className="space-y-3">
<label className="block text-sm font-bold text-gray-800">API Key</label>
<div className="relative">
<input
type={showApiKey ? 'text' : 'password'}
value={settings.ai_api_key || ''}
onChange={e => setSettings({...settings, ai_api_key: e.target.value})}
className="w-full ios-input px-4 py-3 pr-12 rounded-xl font-mono text-sm"
placeholder="sk-..."
/>
<button
type="button"
onClick={() => setShowApiKey(!showApiKey)}
className="absolute right-3 top-1/2 -translate-y-1/2 p-2 text-gray-400 hover:text-gray-600 transition-colors"
>
{showApiKey ? <EyeOff className="w-4 h-4" /> : <Eye className="w-4 h-4" />}
</button>
</div>
</div>
<div className="space-y-3">
<label className="block text-sm font-bold text-gray-800">模型</label>
<div ref={modelPickerRef} className="relative flex flex-col sm:flex-row gap-2">
<div className="relative flex-1">
<input
value={currentModel}
onFocus={() => aiModels.length > 0 && setModelDropdownOpen(true)}
onChange={e => {
setSettings({...settings, ai_model: e.target.value});
if (aiModels.length > 0) setModelDropdownOpen(true);
}}
onKeyDown={e => {
if (e.key === 'Escape') setModelDropdownOpen(false);
if (e.key === 'ArrowDown' && aiModels.length > 0) setModelDropdownOpen(true);
}}
className="w-full ios-input px-4 py-3 pr-10 rounded-xl"
placeholder="从接口读取或手动输入模型名"
/>
<button
type="button"
onClick={() => aiModels.length > 0 && setModelDropdownOpen(open => !open)}
disabled={aiModels.length === 0}
className="absolute right-2 top-1/2 -translate-y-1/2 p-2 text-gray-400 hover:text-gray-600 disabled:opacity-30"
aria-label="展开模型列表"
>
<ChevronDown className={`w-4 h-4 transition-transform ${modelDropdownOpen ? 'rotate-180' : ''}`} />
</button>
{modelDropdownOpen && (
<div className="absolute left-0 right-0 top-[calc(100%+6px)] z-40 max-h-64 overflow-y-auto rounded-xl border border-gray-200 bg-white shadow-xl shadow-gray-200/70 py-1">
{visibleAIModels.length > 0 ? (
visibleAIModels.map(model => (
<button
key={model}
type="button"
onClick={() => {
setSettings({...settings, ai_model: model});
setModelDropdownOpen(false);
}}
className="w-full px-4 py-2.5 text-left text-sm text-gray-700 hover:bg-blue-50 hover:text-[#0094f7] flex items-center justify-between gap-3"
>
<span className="truncate">{model}</span>
{model === currentModel && <Check className="w-4 h-4 shrink-0 text-[#0094f7]" />}
</button>
))
) : (
<div className="px-4 py-3 text-sm text-gray-400">没有匹配的模型</div>
)}
</div>
)}
</div>
<button
type="button"
onClick={() => loadAIModels(undefined, true)}
disabled={modelsLoading}
className="px-4 py-3 rounded-xl bg-gray-100 text-gray-700 hover:bg-gray-200 disabled:opacity-60 font-bold flex items-center justify-center gap-2 whitespace-nowrap"
>
<RefreshCw className={`w-4 h-4 ${modelsLoading ? 'animate-spin' : ''}`} />
读取模型
</button>
</div>
{modelError ? (
<p className="text-xs text-red-500">{modelError}</p>
) : (
<p className="text-xs text-gray-500">
{aiModels.length > 0 ? `已从当前 API 地址读取到 ${aiModels.length} 个模型` : '模型列表从当前 API 地址读取,也可以手动输入模型名'}
</p>
)}
</div>
<div className="space-y-3">
<label className="block text-sm font-bold text-gray-800">默认自动回复内容</label>
<textarea
className="w-full ios-input px-4 py-3 rounded-xl min-h-[100px] text-sm resize-none"
value={settings.default_reply || ''}
onChange={e => setSettings({...settings, default_reply: e.target.value})}
placeholder="设置默认的自动回复内容..."
></textarea>
</div>
<div className="p-3 bg-blue-50 rounded-xl text-xs text-blue-700">
<strong>常见 AI 服务:</strong>
<ul className="list-disc list-inside mt-1 space-y-0.5">
<li>阿里云通义千问: https://dashscope.aliyuncs.com/compatible-mode/v1</li>
<li>OpenAI: https://api.openai.com/v1</li>
</ul>
</div>
</div>
</section>
</div>
{/* Right Column */}
<div className="space-y-8">
<section className="space-y-4">
<h3 className="text-lg font-extrabold text-gray-800 flex items-center gap-2">
<div className="p-1.5 rounded-lg bg-gray-900 text-white">
<LockKeyhole className="w-4 h-4" />
</div>
登录凭据
</h3>
<form onSubmit={handleCredentialsSave} className="ios-card rounded-[2rem] p-6 bg-white space-y-5">
<div className="space-y-2">
<label className="block text-sm font-bold text-gray-800">登录用户名</label>
<div className="relative">
<UserRound className="absolute left-4 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400" />
<input
type="text"
value={credentials.new_username}
onChange={event => setCredentials({...credentials, new_username: event.target.value})}
className="w-full ios-input pl-11 pr-4 py-3 rounded-xl text-sm"
autoComplete="username"
/>
</div>
</div>
<div className="space-y-2">
<label className="block text-sm font-bold text-gray-800">当前密码</label>
<div className="relative">
<input
type={showCurrentPassword ? 'text' : 'password'}
value={credentials.current_password}
onChange={event => setCredentials({...credentials, current_password: event.target.value})}
className="w-full ios-input px-4 py-3 pr-12 rounded-xl text-sm"
placeholder="用于确认当前身份"
autoComplete="current-password"
/>
<button type="button" onClick={() => setShowCurrentPassword(!showCurrentPassword)} className="absolute right-3 top-1/2 -translate-y-1/2 p-2 text-gray-400 hover:text-gray-600" title={showCurrentPassword ? '隐藏密码' : '显示密码'}>
{showCurrentPassword ? <EyeOff className="w-4 h-4" /> : <Eye className="w-4 h-4" />}
</button>
</div>
</div>
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
<div className="space-y-2">
<label className="block text-sm font-bold text-gray-800">新密码</label>
<div className="relative">
<input
type={showNewPassword ? 'text' : 'password'}
value={credentials.new_password}
onChange={event => setCredentials({...credentials, new_password: event.target.value})}
className="w-full ios-input px-4 py-3 pr-11 rounded-xl text-sm"
placeholder="不修改则留空"
autoComplete="new-password"
/>
<button type="button" onClick={() => setShowNewPassword(!showNewPassword)} className="absolute right-2 top-1/2 -translate-y-1/2 p-2 text-gray-400 hover:text-gray-600" title={showNewPassword ? '隐藏密码' : '显示密码'}>
{showNewPassword ? <EyeOff className="w-4 h-4" /> : <Eye className="w-4 h-4" />}
</button>
</div>
</div>
<div className="space-y-2">
<label className="block text-sm font-bold text-gray-800">确认新密码</label>
<input
type={showNewPassword ? 'text' : 'password'}
value={credentials.confirm_password}
onChange={event => setCredentials({...credentials, confirm_password: event.target.value})}
className="w-full ios-input px-4 py-3 rounded-xl text-sm"
placeholder="再次输入新密码"
autoComplete="new-password"
/>
</div>
</div>
{credentialsMessage && (
<div className={`flex items-start gap-2 rounded-xl px-3 py-2.5 text-sm font-medium ${credentialsMessage.type === 'success' ? 'bg-green-50 text-green-700' : 'bg-red-50 text-red-700'}`}>
<ShieldCheck className="w-4 h-4 mt-0.5 flex-shrink-0" />
<span>{credentialsMessage.text}</span>
</div>
)}
<button
type="submit"
disabled={credentialsSaving || !credentials.new_username || !credentials.current_password}
className="w-full bg-gray-900 hover:bg-black text-white px-5 py-3 rounded-xl font-bold text-sm flex items-center justify-center gap-2 transition-colors disabled:opacity-40"
>
<LockKeyhole className="w-4 h-4" />
{credentialsSaving ? '正在更新...' : '更新登录凭据'}
</button>
</form>
</section>
{/* SMTP Settings */}
<section className="space-y-4">
<h3 className="text-lg font-extrabold text-gray-800 flex items-center gap-2">
<div className="p-1.5 rounded-lg bg-blue-100 text-blue-600">
<Mail className="w-4 h-4" />
</div>
SMTP 邮件配置
</h3>
<div className="ios-card rounded-[2rem] p-6 bg-white space-y-6">
<p className="text-sm text-gray-500">配置SMTP服务器用于发送注册验证码等邮件通知</p>
<div className="grid grid-cols-2 gap-4">
<div className="space-y-3">
<label className="block text-sm font-bold text-gray-800">SMTP服务器</label>
<input
type="text"
value={settings.smtp_server || ''}
onChange={e => setSettings({...settings, smtp_server: e.target.value})}
placeholder="smtp.qq.com"
className="w-full ios-input px-4 py-3 rounded-xl text-sm"
/>
</div>
<div className="space-y-3">
<label className="block text-sm font-bold text-gray-800">SMTP端口</label>
<input
type="number"
value={settings.smtp_port || 587}
onChange={e => setSettings({...settings, smtp_port: parseInt(e.target.value)})}
placeholder="587"
className="w-full ios-input px-4 py-3 rounded-xl text-sm"
/>
</div>
</div>
<div className="space-y-3">
<label className="block text-sm font-bold text-gray-800">发件邮箱</label>
<input
type="email"
value={settings.smtp_user || ''}
onChange={e => setSettings({...settings, smtp_user: e.target.value})}
placeholder="your-email@qq.com"
className="w-full ios-input px-4 py-3 rounded-xl text-sm"
/>
</div>
<div className="space-y-3">
<label className="block text-sm font-bold text-gray-800">邮箱密码/授权码</label>
<div className="relative">
<input
type={showSmtpPassword ? 'text' : 'password'}
value={settings.smtp_password || ''}
onChange={e => setSettings({...settings, smtp_password: e.target.value})}
placeholder="输入密码或授权码"
className="w-full ios-input px-4 py-3 pr-12 rounded-xl text-sm"
/>
<button
type="button"
onClick={() => setShowSmtpPassword(!showSmtpPassword)}
className="absolute right-3 top-1/2 -translate-y-1/2 p-2 text-gray-400 hover:text-gray-600 transition-colors"
>
{showSmtpPassword ? <EyeOff className="w-4 h-4" /> : <Eye className="w-4 h-4" />}
</button>
</div>
<p className="text-xs text-gray-500">QQ邮箱需要使用授权码</p>
</div>
<div className="space-y-3">
<label className="block text-sm font-bold text-gray-800">发件人显示名(可选)</label>
<input
type="text"
value={settings.smtp_from || ''}
onChange={e => setSettings({...settings, smtp_from: e.target.value})}
placeholder="闲鱼自动回复系统"
className="w-full ios-input px-4 py-3 rounded-xl text-sm"
/>
</div>
</div>
</section>
</div>
</div>
{/* Save Button */}
<div className="fixed bottom-10 right-10 z-30">
<button
onClick={handleSave}
disabled={saving}
className="ios-btn-primary px-10 py-5 rounded-[2rem] text-lg shadow-2xl shadow-blue-200 flex items-center gap-3 transform hover:scale-105 active:scale-95 transition-all disabled:opacity-70"
>
<Save className="w-6 h-6" />
{saving ? '保存中...' : '保存所有配置'}
</button>
</div>
</div>
);
};
export default Settings;
+67
View File
@@ -0,0 +1,67 @@
import React from 'react';
import { LayoutDashboard, Users, ShoppingBag, CreditCard, Settings, LogOut, Box, Sparkles, Zap, MessageSquare } from 'lucide-react';
interface SidebarProps {
activeTab: string;
setActiveTab: (tab: string) => void;
onLogout: () => void;
}
const Sidebar: React.FC<SidebarProps> = ({ activeTab, setActiveTab, onLogout }) => {
const menuItems = [
{ id: 'dashboard', icon: LayoutDashboard, label: '仪表盘' },
{ id: 'accounts', icon: Users, label: '账号管理' },
{ id: 'orders', icon: ShoppingBag, label: '订单管理' },
{ id: 'cards', icon: CreditCard, label: '卡密库存' },
{ id: 'items', icon: Box, label: '商品列表' },
{ id: 'keywords', icon: MessageSquare, label: '自动化规则' },
{ id: 'settings', icon: Settings, label: '系统与AI' },
];
return (
<div className="w-64 h-screen fixed left-0 top-0 bg-white border-r border-gray-100 flex flex-col justify-between z-20 shadow-[4px_0_24px_rgba(0,0,0,0.02)]">
<div className="p-6">
<div className="flex items-center gap-3 mb-12 px-2">
<div className="w-10 h-10 bg-[#0094f7] squircle flex items-center justify-center shrink-0 p-1.5" style={{ filter: 'drop-shadow(0 4px 12px rgba(0,148,247,0.25))' }}>
<img src="/static/ydisks-logo.svg" alt="Ydisks" className="w-full h-full" />
</div>
<h1 className="text-xl font-extrabold tracking-tight text-gray-900">Ydisks闲鱼助手 <span className="text-xs bg-[#0094f7] text-white px-1.5 py-0.5 rounded ml-1">PRO</span></h1>
</div>
<nav className="space-y-2">
{menuItems.map((item) => {
const Icon = item.icon;
const isActive = activeTab === item.id;
return (
<button
key={item.id}
onClick={() => setActiveTab(item.id)}
className={`w-full flex items-center gap-3 px-4 py-3.5 rounded-2xl transition-all duration-300 group relative overflow-hidden ${
isActive
? 'bg-[#0094f7] text-white font-bold shadow-lg shadow-blue-100 transform scale-[1.02]'
: 'text-gray-500 hover:bg-gray-50 hover:text-gray-900'
}`}
>
<Icon className={`w-5 h-5 transition-colors ${isActive ? 'text-white' : 'text-gray-400 group-hover:text-gray-600'}`} />
<span className="text-sm tracking-wide">{item.label}</span>
{isActive && <Sparkles className="w-4 h-4 absolute right-3 text-white/30 animate-pulse" />}
</button>
);
})}
</nav>
</div>
<div className="p-6 border-t border-gray-50">
<button
onClick={onLogout}
className="w-full flex items-center gap-3 px-4 py-3 text-gray-500 hover:text-red-500 hover:bg-red-50 rounded-2xl transition-all duration-200 font-medium"
>
<LogOut className="w-5 h-5" />
<span className="text-sm">退出登录</span>
</button>
</div>
</div>
);
};
export default Sidebar;
+19
View File
@@ -0,0 +1,19 @@
import React from 'react';
const TestPage: React.FC = () => {
return (
<div className="min-h-screen bg-gray-100 flex items-center justify-center">
<div className="bg-white p-8 rounded-2xl shadow-lg">
<h1 className="text-3xl font-bold text-gray-900 mb-4">测试页面</h1>
<p className="text-gray-600 mb-4">如果你能看到这个页面,说明基础功能正常。</p>
<div className="space-y-2">
<div className="p-4 bg-blue-100 rounded-lg text-blue-800">蓝色卡片</div>
<div className="p-4 bg-green-100 rounded-lg text-green-800">绿色卡片</div>
<div className="p-4 bg-blue-100 rounded-lg text-blue-800">黄色卡片</div>
</div>
</div>
</div>
);
};
export default TestPage;
+385
View File
@@ -0,0 +1,385 @@
/* Tailwind CSS 指令 */
@tailwind base;
@tailwind components;
@tailwind utilities;
/* Ydisks 超椭圆 logo 容器:用 squircle mask 实现真超椭圆(比圆角矩形更鼓)。
mask 让容器背景色(蓝)也裁成超椭圆形状。
shadow 改用 filter:drop-shadow,跟随 mask 后的实际形状(box-shadow 会被 mask 裁掉)。 */
.squircle {
-webkit-mask-image: url(/static/squircle.svg);
mask-image: url(/static/squircle.svg);
-webkit-mask-size: contain;
mask-size: contain;
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
-webkit-mask-position: center;
mask-position: center;
border-radius: 0;
}
/* 闲鱼自动回复系统 - 全局样式 */
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
html, body, #root {
height: 100%;
width: 100%;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
"Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
background-color: #F4F5F7;
color: #ffffff;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
/* 闲鱼风格卡片 */
.ios-card {
background: #FFFFFF;
border-radius: 24px;
border: 1px solid rgba(0, 0, 0, 0.02);
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ios-card:hover {
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.06);
}
/* 闲鱼风格输入框 */
.ios-input {
background: #F7F8FA;
border: 1px solid transparent;
transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
color: #111;
font-weight: 500;
}
.ios-input:focus {
background: #FFFFFF;
border-color: #0094f7;
box-shadow: 0 0 0 4px rgba(0, 148, 247, 0.3);
outline: none;
}
.ios-input::placeholder {
color: #9CA3AF;
font-weight: 400;
}
/* 主按钮 */
.ios-btn-primary {
background: #0094f7;
color: #ffffff;
font-weight: 700;
border: none;
transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
cursor: pointer;
}
.ios-btn-primary:hover:not(:disabled) {
background: #0071e3;
transform: translateY(-1px);
box-shadow: 0 8px 20px rgba(0, 148, 247, 0.3);
}
.ios-btn-primary:active:not(:disabled) {
transform: translateY(1px);
box-shadow: 0 2px 8px rgba(0, 148, 247, 0.2);
}
.ios-btn-primary:disabled {
background: #F0F0F0;
color: #AAAAAA;
box-shadow: none;
transform: none;
cursor: not-allowed;
}
/* 次要按钮 */
.ios-btn-secondary {
background: #F7F8FA;
color: #ffffff;
font-weight: 600;
border: 1px solid transparent;
transition: all 0.2s ease;
cursor: pointer;
}
.ios-btn-secondary:hover {
background: #E5E7EB;
border-color: #D1D5DB;
}
/* 危险按钮 */
.ios-btn-danger {
background: #FEE2E2;
color: #DC2626;
font-weight: 600;
border: 1px solid transparent;
transition: all 0.2s ease;
cursor: pointer;
}
.ios-btn-danger:hover {
background: #FECACA;
border-color: #FCA5A5;
}
/* 自定义滚动条 */
::-webkit-scrollbar {
width: 6px;
height: 6px;
}
::-webkit-scrollbar-track {
background: transparent;
}
::-webkit-scrollbar-thumb {
background: rgba(0, 0, 0, 0.1);
border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
background: rgba(0, 0, 0, 0.2);
}
/* 动画 */
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.animate-fade-in {
animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes slideUp {
from {
opacity: 0;
transform: translateY(30px) scale(0.95);
}
to {
opacity: 1;
transform: translateY(0) scale(1);
}
}
.animate-slide-up {
animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
.animate-spin {
animation: spin 1s linear infinite;
}
@keyframes pulse {
0%, 100% {
opacity: 1;
}
50% {
opacity: 0.5;
}
}
.animate-pulse {
animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
/* 文本选择 */
::selection {
background: #0094f7;
color: #fff;
}
/* 工具类 */
.text-brand {
color: #0094f7;
}
.bg-brand {
background-color: #0094f7;
}
.border-brand {
border-color: #0094f7;
}
/* 状态徽章 */
.status-badge {
display: inline-flex;
align-items: center;
padding: 4px 12px;
border-radius: 9999px;
font-size: 12px;
font-weight: 600;
}
.status-badge-success {
background-color: #D1FAE5;
color: #065F46;
}
.status-badge-warning {
background-color: #FEF3C7;
color: #92400E;
}
.status-badge-error {
background-color: #FEE2E2;
color: #991B1B;
}
.status-badge-info {
background-color: #DBEAFE;
color: #1E40AF;
}
/* 加载状态 */
.loading-skeleton {
background: linear-gradient(90deg,
#F3F4F6 0%,
#E5E7EB 50%,
#F3F4F6 100%);
background-size: 200% 100%;
animation: loading 1.5s ease-in-out infinite;
}
@keyframes loading {
0% {
background-position: 200% 0;
}
100% {
background-position: -200% 0;
}
}
/* 模态框优化 - 修复遮挡和滚动问题 */
.modal-overlay {
position: fixed;
inset: 0;
z-index: 9999;
display: flex;
align-items: center;
justify-content: center;
background-color: rgba(0, 0, 0, 0.4);
backdrop-filter: blur(8px);
padding: 1rem;
overflow-y: auto;
}
.modal-container {
position: relative;
width: 100%;
max-width: 42rem; /* max-w-2xl */
max-height: 85vh;
margin: auto;
display: flex;
flex-direction: column;
background-color: white;
border-radius: 2.5rem;
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
overflow: hidden;
}
.modal-header {
flex-shrink: 0;
padding: 2rem 2rem 1.5rem;
border-bottom: 1px solid #F3F4F6;
background-color: white;
z-index: 10;
}
.modal-body {
flex: 1 1 auto;
overflow-y: auto;
overflow-x: hidden;
padding: 2rem;
}
.modal-footer {
flex-shrink: 0;
padding: 1.5rem 2rem 2rem;
border-top: 1px solid #F3F4F6;
background-color: white;
z-index: 10;
}
/* 大模态框 */
.modal-container-lg {
max-width: 64rem; /* max-w-4xl */
}
/* 自定义弹窗定位 - 上下参考侧边栏中间,左右居中 */
.modal-overlay-centered {
position: fixed;
inset: 0;
z-index: 9999;
display: flex;
justify-content: center;
background-color: rgba(0, 0, 0, 0.4);
backdrop-filter: blur(8px);
padding: 1rem;
overflow-y: auto;
}
.modal-overlay-centered .modal-container {
position: relative;
width: 100%;
max-width: 42rem;
max-height: 85vh;
margin: auto 0;
display: flex;
flex-direction: column;
background-color: white;
border-radius: 2.5rem;
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
overflow: hidden;
}
/* 响应式工具类 */
@media (max-width: 768px) {
.ios-card {
border-radius: 16px;
}
.ios-input {
font-size: 16px; /* 防止iOS自动缩放 */
}
.modal-container {
max-width: calc(100% - 2rem);
max-height: 90vh;
border-radius: 1.5rem;
}
.modal-header,
.modal-body,
.modal-footer {
padding-left: 1.5rem;
padding-right: 1.5rem;
}
}
+14
View File
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/static/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Ydisks闲鱼助手 - 自动发货与管家系统</title>
<meta name="description" content="Ydisks闲鱼助手 - 自动回复、自动发货、订单管理、AI智能议价一体化解决方案" />
</head>
<body>
<div id="root"></div>
<script type="module" src="/index.tsx"></script>
</body>
</html>
+16
View File
@@ -0,0 +1,16 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App';
import './index.css';
const rootElement = document.getElementById('root');
if (!rootElement) {
throw new Error("Could not find root element to mount to");
}
const root = ReactDOM.createRoot(rootElement);
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
);
+5
View File
@@ -0,0 +1,5 @@
{
"name": "闲鱼自动发货 Pro",
"description": "高端商务风格的闲鱼自动发货管理后台,支持多账号管理、自动发货与AI回复配置。",
"requestFramePermissions": []
}
+3473
View File
File diff suppressed because it is too large. Load diff
+27
View File
@@ -0,0 +1,27 @@
{
"name": "闲鱼自动发货-pro",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"axios": "^1.13.2",
"lucide-react": "^0.562.0",
"react": "^19.2.3",
"react-dom": "^19.2.3",
"recharts": "^3.6.0"
},
"devDependencies": {
"@types/node": "^22.14.0",
"@vitejs/plugin-react": "^5.0.0",
"autoprefixer": "^10.4.23",
"postcss": "^8.5.6",
"tailwindcss": "^3.4.17",
"typescript": "~5.8.2",
"vite": "^6.2.0"
}
}
+2146
View File
File diff suppressed because it is too large. Load diff
+6
View File
@@ -0,0 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
+8
View File
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="256" height="256" viewBox="0 0 256 256" xmlns="http://www.w3.org/2000/svg">
<title>Ydisks</title>
<path d="M256.00,128.00 L255.99,144.91 L255.96,151.91 L255.91,157.28 L255.84,161.81 L255.76,165.79 L255.65,169.38 L255.52,172.68 L255.38,175.75 L255.21,178.63 L255.02,181.34 L254.82,183.91 L254.59,186.36 L254.35,188.71 L254.08,190.96 L253.80,193.12 L253.50,195.20 L253.17,197.21 L252.83,199.15 L252.46,201.03 L252.08,202.86 L251.68,204.63 L251.25,206.34 L250.81,208.01 L250.34,209.63 L249.86,211.21 L249.35,212.75 L248.82,214.24 L248.28,215.70 L247.71,217.12 L247.12,218.51 L246.51,219.86 L245.87,221.18 L245.22,222.46 L244.55,223.72 L243.85,224.94 L243.13,226.13 L242.39,227.30 L241.63,228.43 L240.84,229.54 L240.03,230.62 L239.20,231.68 L238.34,232.70 L237.46,233.71 L236.56,234.68 L235.63,235.63 L234.68,236.56 L233.71,237.46 L232.70,238.34 L231.68,239.20 L230.62,240.03 L229.54,240.84 L228.43,241.63 L227.30,242.39 L226.13,243.13 L224.94,243.85 L223.72,244.55 L222.46,245.22 L221.18,245.87 L219.86,246.51 L218.51,247.12 L217.12,247.71 L215.70,248.28 L214.24,248.82 L212.75,249.35 L211.21,249.86 L209.63,250.34 L208.01,250.81 L206.34,251.25 L204.63,251.68 L202.86,252.08 L201.03,252.46 L199.15,252.83 L197.21,253.17 L195.20,253.50 L193.12,253.80 L190.96,254.08 L188.71,254.35 L186.36,254.59 L183.91,254.82 L181.34,255.02 L178.63,255.21 L175.75,255.38 L172.68,255.52 L169.38,255.65 L165.79,255.76 L161.81,255.84 L157.28,255.91 L151.91,255.96 L144.91,255.99 L128.00,256.00 L111.09,255.99 L104.09,255.96 L98.72,255.91 L94.19,255.84 L90.21,255.76 L86.62,255.65 L83.32,255.52 L80.25,255.38 L77.37,255.21 L74.66,255.02 L72.09,254.82 L69.64,254.59 L67.29,254.35 L65.04,254.08 L62.88,253.80 L60.80,253.50 L58.79,253.17 L56.85,252.83 L54.97,252.46 L53.14,252.08 L51.37,251.68 L49.66,251.25 L47.99,250.81 L46.37,250.34 L44.79,249.86 L43.25,249.35 L41.76,248.82 L40.30,248.28 L38.88,247.71 L37.49,247.12 L36.14,246.51 L34.82,245.87 L33.54,245.22 L32.28,244.55 L31.06,243.85 L29.87,243.13 L28.70,242.39 L27.57,241.63 L26.46,240.84 L25.38,240.03 L24.32,239.20 L23.30,238.34 L22.29,237.46 L21.32,236.56 L20.37,235.63 L19.44,234.68 L18.54,233.71 L17.66,232.70 L16.80,231.68 L15.97,230.62 L15.16,229.54 L14.37,228.43 L13.61,227.30 L12.87,226.13 L12.15,224.94 L11.45,223.72 L10.78,222.46 L10.13,221.18 L9.49,219.86 L8.88,218.51 L8.29,217.12 L7.72,215.70 L7.18,214.24 L6.65,212.75 L6.14,211.21 L5.66,209.63 L5.19,208.01 L4.75,206.34 L4.32,204.63 L3.92,202.86 L3.54,201.03 L3.17,199.15 L2.83,197.21 L2.50,195.20 L2.20,193.12 L1.92,190.96 L1.65,188.71 L1.41,186.36 L1.18,183.91 L0.98,181.34 L0.79,178.63 L0.62,175.75 L0.48,172.68 L0.35,169.38 L0.24,165.79 L0.16,161.81 L0.09,157.28 L0.04,151.91 L0.01,144.91 L0.00,128.00 L0.01,111.09 L0.04,104.09 L0.09,98.72 L0.16,94.19 L0.24,90.21 L0.35,86.62 L0.48,83.32 L0.62,80.25 L0.79,77.37 L0.98,74.66 L1.18,72.09 L1.41,69.64 L1.65,67.29 L1.92,65.04 L2.20,62.88 L2.50,60.80 L2.83,58.79 L3.17,56.85 L3.54,54.97 L3.92,53.14 L4.32,51.37 L4.75,49.66 L5.19,47.99 L5.66,46.37 L6.14,44.79 L6.65,43.25 L7.18,41.76 L7.72,40.30 L8.29,38.88 L8.88,37.49 L9.49,36.14 L10.13,34.82 L10.78,33.54 L11.45,32.28 L12.15,31.06 L12.87,29.87 L13.61,28.70 L14.37,27.57 L15.16,26.46 L15.97,25.38 L16.80,24.32 L17.66,23.30 L18.54,22.29 L19.44,21.32 L20.37,20.37 L21.32,19.44 L22.29,18.54 L23.30,17.66 L24.32,16.80 L25.38,15.97 L26.46,15.16 L27.57,14.37 L28.70,13.61 L29.87,12.87 L31.06,12.15 L32.28,11.45 L33.54,10.78 L34.82,10.13 L36.14,9.49 L37.49,8.88 L38.88,8.29 L40.30,7.72 L41.76,7.18 L43.25,6.65 L44.79,6.14 L46.37,5.66 L47.99,5.19 L49.66,4.75 L51.37,4.32 L53.14,3.92 L54.97,3.54 L56.85,3.17 L58.79,2.83 L60.80,2.50 L62.88,2.20 L65.04,1.92 L67.29,1.65 L69.64,1.41 L72.09,1.18 L74.66,0.98 L77.37,0.79 L80.25,0.62 L83.32,0.48 L86.62,0.35 L90.21,0.24 L94.19,0.16 L98.72,0.09 L104.09,0.04 L111.09,0.01 L128.00,0.00 L144.91,0.01 L151.91,0.04 L157.28,0.09 L161.81,0.16 L165.79,0.24 L169.38,0.35 L172.68,0.48 L175.75,0.62 L178.63,0.79 L181.34,0.98 L183.91,1.18 L186.36,1.41 L188.71,1.65 L190.96,1.92 L193.12,2.20 L195.20,2.50 L197.21,2.83 L199.15,3.17 L201.03,3.54 L202.86,3.92 L204.63,4.32 L206.34,4.75 L208.01,5.19 L209.63,5.66 L211.21,6.14 L212.75,6.65 L214.24,7.18 L215.70,7.72 L217.12,8.29 L218.51,8.88 L219.86,9.49 L221.18,10.13 L222.46,10.78 L223.72,11.45 L224.94,12.15 L226.13,12.87 L227.30,13.61 L228.43,14.37 L229.54,15.16 L230.62,15.97 L231.68,16.80 L232.70,17.66 L233.71,18.54 L234.68,19.44 L235.63,20.37 L236.56,21.32 L237.46,22.29 L238.34,23.30 L239.20,24.32 L240.03,25.38 L240.84,26.46 L241.63,27.57 L242.39,28.70 L243.13,29.87 L243.85,31.06 L244.55,32.28 L245.22,33.54 L245.87,34.82 L246.51,36.14 L247.12,37.49 L247.71,38.88 L248.28,40.30 L248.82,41.76 L249.35,43.25 L249.86,44.79 L250.34,46.37 L250.81,47.99 L251.25,49.66 L251.68,51.37 L252.08,53.14 L252.46,54.97 L252.83,56.85 L253.17,58.79 L253.50,60.80 L253.80,62.88 L254.08,65.04 L254.35,67.29 L254.59,69.64 L254.82,72.09 L255.02,74.66 L255.21,77.37 L255.38,80.25 L255.52,83.32 L255.65,86.62 L255.76,90.21 L255.84,94.19 L255.91,98.72 L255.96,104.09 L255.99,111.09 Z" fill="#0094f7"/>
<g transform="translate(0,0)">
<path d="M121.73,57.0003 C138.901,57.0003 154.897,65.5053 164.52,79.7493 C166.029,81.9823 165.441,85.0143 163.209,86.5233 C160.976,88.0323 157.944,87.4433 156.436,85.2113 C148.629,73.6553 135.655,66.7563 121.73,66.7563 C104.076789,66.7563 88.6201962,77.6596007 82.5581814,93.8184545 C83.9120803,93.7133631 85.2800264,93.66 86.6602,93.66 C111.537727,93.66 132.442611,110.997575 137.926382,134.224255 L162.5425,92.109 L162.615557,91.9879406 L162.756884,91.77367 L162.911804,91.5639102 L162.98657,91.4716759 C163.351845,91.025169 163.786059,90.6571744 164.264191,90.3738733 L164.550153,90.2178351 L164.729252,90.1315693 L164.989203,90.021723 L165.230265,89.9354653 L165.542393,89.8445739 C165.666021,89.8126706 165.790834,89.7857324 165.916565,89.7637431 L166.116517,89.7342499 C166.29505,89.7098142 166.475001,89.6957386 166.655596,89.6918808 L166.7539,89.693 C196.8909,89.693 221.4079,114.21 221.4079,144.347 C221.4079,174.482 196.8909,199 166.7539,199 L125.0869,199 C122.3919,199 120.2079,196.815 120.2079,194.122 C120.2079,191.429 122.3919,189.244 125.0869,189.244 L166.7539,189.244 C191.5109,189.244 211.6519,169.104 211.6519,144.347 C211.6519,120.513406 192.985349,100.957891 169.504046,99.5322548 L112.7745,196.584 C111.8995,198.08 110.2965,199 108.5635,199 L86.6602,199 C57.6182,199 33.9902,175.373 33.9902,146.33 C33.9902,122.475163 49.9316132,102.273061 71.7206298,95.817503 L71.9446339,94.967678 C78.0600632,72.5405324 98.33054,57.0003 121.73,57.0003 Z M86.6602,103.417 C62.9972,103.417 43.7462,122.667 43.7462,146.33 C43.7462,169.992 62.9972,189.244 86.6602,189.244 L105.7645,189.244 L129.869462,148.004782 C129.678439,147.482425 129.5742,146.918336 129.5742,146.33 C129.5742,122.667 110.3232,103.417 86.6602,103.417 Z" fill="#FFFFFF"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.7 KiB

+3
View File
@@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
<path d="M100.00,50.00 L100.00,56.61 L99.98,59.34 L99.97,61.44 L99.94,63.21 L99.90,64.76 L99.86,66.17 L99.81,67.45 L99.76,68.65 L99.69,69.78 L99.62,70.84 L99.54,71.84 L99.45,72.80 L99.36,73.71 L99.25,74.59 L99.14,75.44 L99.02,76.25 L98.90,77.04 L98.76,77.79 L98.62,78.53 L98.47,79.24 L98.31,79.93 L98.15,80.60 L97.97,81.25 L97.79,81.89 L97.60,82.50 L97.40,83.10 L97.20,83.69 L96.98,84.26 L96.76,84.81 L96.53,85.36 L96.29,85.88 L96.04,86.40 L95.79,86.90 L95.53,87.39 L95.25,87.87 L94.97,88.33 L94.68,88.79 L94.38,89.23 L94.08,89.66 L93.76,90.09 L93.44,90.50 L93.10,90.90 L92.76,91.29 L92.41,91.67 L92.04,92.04 L91.67,92.41 L91.29,92.76 L90.90,93.10 L90.50,93.44 L90.09,93.76 L89.66,94.08 L89.23,94.38 L88.79,94.68 L88.33,94.97 L87.87,95.25 L87.39,95.53 L86.90,95.79 L86.40,96.04 L85.88,96.29 L85.36,96.53 L84.81,96.76 L84.26,96.98 L83.69,97.20 L83.10,97.40 L82.50,97.60 L81.89,97.79 L81.25,97.97 L80.60,98.15 L79.93,98.31 L79.24,98.47 L78.53,98.62 L77.79,98.76 L77.04,98.90 L76.25,99.02 L75.44,99.14 L74.59,99.25 L73.71,99.36 L72.80,99.45 L71.84,99.54 L70.84,99.62 L69.78,99.69 L68.65,99.76 L67.45,99.81 L66.17,99.86 L64.76,99.90 L63.21,99.94 L61.44,99.97 L59.34,99.98 L56.61,100.00 L50.00,100.00 L43.39,100.00 L40.66,99.98 L38.56,99.97 L36.79,99.94 L35.24,99.90 L33.83,99.86 L32.55,99.81 L31.35,99.76 L30.22,99.69 L29.16,99.62 L28.16,99.54 L27.20,99.45 L26.29,99.36 L25.41,99.25 L24.56,99.14 L23.75,99.02 L22.96,98.90 L22.21,98.76 L21.47,98.62 L20.76,98.47 L20.07,98.31 L19.40,98.15 L18.75,97.97 L18.11,97.79 L17.50,97.60 L16.90,97.40 L16.31,97.20 L15.74,96.98 L15.19,96.76 L14.64,96.53 L14.12,96.29 L13.60,96.04 L13.10,95.79 L12.61,95.53 L12.13,95.25 L11.67,94.97 L11.21,94.68 L10.77,94.38 L10.34,94.08 L9.91,93.76 L9.50,93.44 L9.10,93.10 L8.71,92.76 L8.33,92.41 L7.96,92.04 L7.59,91.67 L7.24,91.29 L6.90,90.90 L6.56,90.50 L6.24,90.09 L5.92,89.66 L5.62,89.23 L5.32,88.79 L5.03,88.33 L4.75,87.87 L4.47,87.39 L4.21,86.90 L3.96,86.40 L3.71,85.88 L3.47,85.36 L3.24,84.81 L3.02,84.26 L2.80,83.69 L2.60,83.10 L2.40,82.50 L2.21,81.89 L2.03,81.25 L1.85,80.60 L1.69,79.93 L1.53,79.24 L1.38,78.53 L1.24,77.79 L1.10,77.04 L0.98,76.25 L0.86,75.44 L0.75,74.59 L0.64,73.71 L0.55,72.80 L0.46,71.84 L0.38,70.84 L0.31,69.78 L0.24,68.65 L0.19,67.45 L0.14,66.17 L0.10,64.76 L0.06,63.21 L0.03,61.44 L0.02,59.34 L0.00,56.61 L0.00,50.00 L0.00,43.39 L0.02,40.66 L0.03,38.56 L0.06,36.79 L0.10,35.24 L0.14,33.83 L0.19,32.55 L0.24,31.35 L0.31,30.22 L0.38,29.16 L0.46,28.16 L0.55,27.20 L0.64,26.29 L0.75,25.41 L0.86,24.56 L0.98,23.75 L1.10,22.96 L1.24,22.21 L1.38,21.47 L1.53,20.76 L1.69,20.07 L1.85,19.40 L2.03,18.75 L2.21,18.11 L2.40,17.50 L2.60,16.90 L2.80,16.31 L3.02,15.74 L3.24,15.19 L3.47,14.64 L3.71,14.12 L3.96,13.60 L4.21,13.10 L4.47,12.61 L4.75,12.13 L5.03,11.67 L5.32,11.21 L5.62,10.77 L5.92,10.34 L6.24,9.91 L6.56,9.50 L6.90,9.10 L7.24,8.71 L7.59,8.33 L7.96,7.96 L8.33,7.59 L8.71,7.24 L9.10,6.90 L9.50,6.56 L9.91,6.24 L10.34,5.92 L10.77,5.62 L11.21,5.32 L11.67,5.03 L12.13,4.75 L12.61,4.47 L13.10,4.21 L13.60,3.96 L14.12,3.71 L14.64,3.47 L15.19,3.24 L15.74,3.02 L16.31,2.80 L16.90,2.60 L17.50,2.40 L18.11,2.21 L18.75,2.03 L19.40,1.85 L20.07,1.69 L20.76,1.53 L21.47,1.38 L22.21,1.24 L22.96,1.10 L23.75,0.98 L24.56,0.86 L25.41,0.75 L26.29,0.64 L27.20,0.55 L28.16,0.46 L29.16,0.38 L30.22,0.31 L31.35,0.24 L32.55,0.19 L33.83,0.14 L35.24,0.10 L36.79,0.06 L38.56,0.03 L40.66,0.02 L43.39,0.00 L50.00,0.00 L56.61,0.00 L59.34,0.02 L61.44,0.03 L63.21,0.06 L64.76,0.10 L66.17,0.14 L67.45,0.19 L68.65,0.24 L69.78,0.31 L70.84,0.38 L71.84,0.46 L72.80,0.55 L73.71,0.64 L74.59,0.75 L75.44,0.86 L76.25,0.98 L77.04,1.10 L77.79,1.24 L78.53,1.38 L79.24,1.53 L79.93,1.69 L80.60,1.85 L81.25,2.03 L81.89,2.21 L82.50,2.40 L83.10,2.60 L83.69,2.80 L84.26,3.02 L84.81,3.24 L85.36,3.47 L85.88,3.71 L86.40,3.96 L86.90,4.21 L87.39,4.47 L87.87,4.75 L88.33,5.03 L88.79,5.32 L89.23,5.62 L89.66,5.92 L90.09,6.24 L90.50,6.56 L90.90,6.90 L91.29,7.24 L91.67,7.59 L92.04,7.96 L92.41,8.33 L92.76,8.71 L93.10,9.10 L93.44,9.50 L93.76,9.91 L94.08,10.34 L94.38,10.77 L94.68,11.21 L94.97,11.67 L95.25,12.13 L95.53,12.61 L95.79,13.10 L96.04,13.60 L96.29,14.12 L96.53,14.64 L96.76,15.19 L96.98,15.74 L97.20,16.31 L97.40,16.90 L97.60,17.50 L97.79,18.11 L97.97,18.75 L98.15,19.40 L98.31,20.07 L98.47,20.76 L98.62,21.47 L98.76,22.21 L98.90,22.96 L99.02,23.75 L99.14,24.56 L99.25,25.41 L99.36,26.29 L99.45,27.20 L99.54,28.16 L99.62,29.16 L99.69,30.22 L99.76,31.35 L99.81,32.55 L99.86,33.83 L99.90,35.24 L99.94,36.79 L99.97,38.56 L99.98,40.66 L100.00,43.39 Z"/>
</svg>

After

Width:  |  Height:  |  Size: 4.5 KiB

+568
View File
@@ -0,0 +1,568 @@
const crypto = require('crypto')
const generate_mid = () => {
return "" + Math.floor(1e3 * Math.random()) + new Date().getTime() + " 0"
}
const generate_uuid = () => {
return "-" + Date.now() + "1"
}
const generate_device_id = (user_id) => {
for (var ee, et = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), en = [], eo = Math.random, ei = 0; ei < 36; ei++)
8 === ei || 13 === ei || 18 === ei || 23 === ei ? en[ei] = "-" : 14 === ei ? en[ei] = "4" : (ee = 0 | 16 * eo(),
en[ei] = et[19 === ei ? 3 & ee | 8 : ee]);
return en.join("") + "-" + user_id
}
const generate_sign = (t, token, data) => {
const j = t
const h = 34839810
const msg = token + "&" + j + "&" + h + "&" + data
const md5 = crypto.createHash('md5')
md5.update(msg)
return md5.digest('hex')
}
eM = new TextDecoder("utf-8");
eL = null
var sv = Array(4096);
function sg() {
var ee, et = eI[aG++];
if (!(et >= 160) || !(et < 192))
return aG--,
sy(a5());
if (et -= 160,
aX >= aG)
return eR.slice(aG - aq, (aG += et) - aq);
if (!(0 == aX && eO < 180))
return se(et);
var en = (et << 5 ^ (et > 1 ? eZ.getUint16(aG) : et > 0 ? eI[aG] : 0)) & 4095
, eo = sv[en]
, ei = aG
, ec = aG + et - 3
, eu = 0;
if (eo && eo.bytes == et) {
for (; ei < ec;) {
if ((ee = eZ.getUint32(ei)) != eo[eu++]) {
ei = 1879048192;
break
}
ei += 4
}
for (ec += 3; ei < ec;)
if ((ee = eI[ei++]) != eo[eu++]) {
ei = 1879048192;
break
}
if (ei === ec)
return aG = ei,
eo.string;
ec -= 3,
ei = aG
}
for (eo = [],
sv[en] = eo,
eo.bytes = et; ei < ec;)
ee = eZ.getUint32(ei),
eo.push(ee),
ei += 4;
for (ec += 3; ei < ec;)
ee = eI[ei++],
eo.push(ee);
var ed = et < 16 ? su(et) : sl(et);
return null != ed ? eo.string = ed : eo.string = se(et)
}
function sy(ee) {
if ("string" == typeof ee)
return ee;
if ("number" == typeof ee || "boolean" == typeof ee || "bigint" == typeof ee)
return ee.toString();
if (null == ee)
return ee + "";
throw Error("Invalid property type for record", typeof ee)
}
r9 = function (ee) {
return atob(rW(ee))
}
rW = function (ee) {
return ee.replace(/[^A-Za-z0-9\+\/]/g, "")
}
aW = {
"useRecords": false,
"mapsAsObjects": true
}
aJ = false
eP = []
function a3(ee) {
if (!aW.trusted && !aJ) {
var et, en, eo = eP.sharedLength || 0;
eo < eP.length && (eP.length = eo)
}
if (aW.randomAccessStructure && eI[aG] < 64 && eI[aG] >= 32 && ej ? (et = ej(eI, aG, eO, aW),
eI = null,
!(ee && ee.lazy) && et && (et = et.toJSON()),
aG = eO) : et = a5(),
eD && (aG = eD.postBundlePosition,
eD = null),
aJ && (eP.restoreStructures = null),
aG == eO)
eP && eP.restoreStructures && a4(),
eP = null,
eI = null,
eL && (eL = null);
else if (aG > eO)
throw Error("Unexpected end of MessagePack data");
else if (!aJ) {
try {
en = JSON.stringify(et, function (ee, et) {
return "bigint" == typeof et ? "".concat(et, "n") : et
}).slice(0, 100)
} catch (ee) {
en = "(JSON view not available " + ee + ")"
}
throw Error("Data read, but end of buffer not reached " + en)
}
return et
}
function so(ee) {
if (ee < 16 && (et = su(ee)))
return et;
if (ee > 64 && eM)
return eM.decode(eI.subarray(aG, aG += ee));
var et, en = aG + ee, eo = [];
for (et = ""; aG < en;) {
var ei = eI[aG++];
if ((128 & ei) === 0)
eo.push(ei);
else if ((224 & ei) === 192) {
var ec = 63 & eI[aG++];
eo.push((31 & ei) << 6 | ec)
} else if ((240 & ei) === 224) {
var eu = 63 & eI[aG++]
, ed = 63 & eI[aG++];
eo.push((31 & ei) << 12 | eu << 6 | ed)
} else if ((248 & ei) === 240) {
var ef = (7 & ei) << 18 | (63 & eI[aG++]) << 12 | (63 & eI[aG++]) << 6 | 63 & eI[aG++];
ef > 65535 && (ef -= 65536,
eo.push(ef >>> 10 & 1023 | 55296),
ef = 56320 | 1023 & ef),
eo.push(ef)
} else
eo.push(ei);
eo.length >= 4096 && (et += sc.apply(String, eo),
eo.length = 0)
}
return eo.length > 0 && (et += sc.apply(String, eo)),
et
}
se = so;
var sc = String.fromCharCode;
function sl(ee) {
for (var et = aG, en = Array(ee), eo = 0; eo < ee; eo++) {
var ei = eI[aG++];
if ((128 & ei) > 0) {
aG = et;
return
}
en[eo] = ei
}
return sc.apply(String, en)
}
function su(ee) {
if (ee < 4) {
if (ee < 2) {
if (0 === ee)
return "";
var et = eI[aG++];
if ((128 & et) > 1) {
aG -= 1;
return
}
return sc(et)
}
var en = eI[aG++]
, eo = eI[aG++];
if ((128 & en) > 0 || (128 & eo) > 0) {
aG -= 2;
return
}
if (ee < 3)
return sc(en, eo);
var ei = eI[aG++];
if ((128 & ei) > 0) {
aG -= 3;
return
}
return sc(en, eo, ei)
}
var ec = eI[aG++]
, eu = eI[aG++]
, ed = eI[aG++]
, ef = eI[aG++];
if ((128 & ec) > 0 || (128 & eu) > 0 || (128 & ed) > 0 || (128 & ef) > 0) {
aG -= 4;
return
}
if (ee < 6) {
if (4 === ee)
return sc(ec, eu, ed, ef);
var ep = eI[aG++];
if ((128 & ep) > 0) {
aG -= 5;
return
}
return sc(ec, eu, ed, ef, ep)
}
if (ee < 8) {
var em = eI[aG++]
, eh = eI[aG++];
if ((128 & em) > 0 || (128 & eh) > 0) {
aG -= 6;
return
}
if (ee < 7)
return sc(ec, eu, ed, ef, em, eh);
var ev = eI[aG++];
if ((128 & ev) > 0) {
aG -= 7;
return
}
return sc(ec, eu, ed, ef, em, eh, ev)
}
var eg = eI[aG++]
, eC = eI[aG++]
, eS = eI[aG++]
, ew = eI[aG++];
if ((128 & eg) > 0 || (128 & eC) > 0 || (128 & eS) > 0 || (128 & ew) > 0) {
aG -= 8;
return
}
if (ee < 10) {
if (8 === ee)
return sc(ec, eu, ed, ef, eg, eC, eS, ew);
var eE = eI[aG++];
if ((128 & eE) > 0) {
aG -= 9;
return
}
return sc(ec, eu, ed, ef, eg, eC, eS, ew, eE)
}
if (ee < 12) {
var ek = eI[aG++]
, e_ = eI[aG++];
if ((128 & ek) > 0 || (128 & e_) > 0) {
aG -= 10;
return
}
if (ee < 11)
return sc(ec, eu, ed, ef, eg, eC, eS, ew, ek, e_);
var eT = eI[aG++];
if ((128 & eT) > 0) {
aG -= 11;
return
}
return sc(ec, eu, ed, ef, eg, eC, eS, ew, ek, e_, eT)
}
var eN = eI[aG++]
, eM = eI[aG++]
, eO = eI[aG++]
, eP = eI[aG++];
if ((128 & eN) > 0 || (128 & eM) > 0 || (128 & eO) > 0 || (128 & eP) > 0) {
aG -= 12;
return
}
if (ee < 14) {
if (12 === ee)
return sc(ec, eu, ed, ef, eg, eC, eS, ew, eN, eM, eO, eP);
var eR = eI[aG++];
if ((128 & eR) > 0) {
aG -= 13;
return
}
return sc(ec, eu, ed, ef, eg, eC, eS, ew, eN, eM, eO, eP, eR)
}
var eD = eI[aG++]
, eL = eI[aG++];
if ((128 & eD) > 0 || (128 & eL) > 0) {
aG -= 14;
return
}
if (ee < 15)
return sc(ec, eu, ed, ef, eg, eC, eS, ew, eN, eM, eO, eP, eD, eL);
var eZ = eI[aG++];
if ((128 & eZ) > 0) {
aG -= 15;
return
}
return sc(ec, eu, ed, ef, eg, eC, eS, ew, eN, eM, eO, eP, eD, eL, eZ)
}
function ss(ee) {
if (aW.mapsAsObjects) {
for (var et = {}, en = 0; en < ee; en++) {
var eo = sg();
"__proto__" === eo && (eo = "__proto_"),
et[eo] = a5()
}
return et
}
for (var ei = new Map, ec = 0; ec < ee; ec++)
ei.set(a5(), a5());
return ei
}
function a5() {
var ee, et = eI[aG++];
if (et < 160) {
if (et < 128) {
if (et < 64)
return et;
var en = eP[63 & et] || aW.getStructures && a9()[63 & et];
return en ? (en.read || (en.read = a8(en, 63 & et)),
en.read()) : et
}
if (et < 144) {
if (et -= 128,
aW.mapsAsObjects) {
for (var eo = {}, ei = 0; ei < et; ei++) {
var ec = sg();
"__proto__" === ec && (ec = "__proto_"),
eo[ec] = a5()
}
return eo
}
for (var eu = new Map, ed = 0; ed < et; ed++)
eu.set(a5(), a5());
return eu
}
for (var ef = Array(et -= 144), ep = 0; ep < et; ep++)
ef[ep] = a5();
return aW.freezeData ? Object.freeze(ef) : ef
}
if (et < 192) {
var em = et - 160;
if (aX >= aG)
return eR.slice(aG - aq, (aG += em) - aq);
if (0 == aX && eO < 140) {
var eh = em < 16 ? su(em) : sl(em);
if (null != eh)
return eh
}
return se(em)
}
switch (et) {
case 192:
return null;
case 193:
if (eD) {
if ((ee = a5()) > 0)
return eD[1].slice(eD.position1, eD.position1 += ee);
return eD[0].slice(eD.position0, eD.position0 -= ee)
}
return aY;
case 194:
return !1;
case 195:
return !0;
case 196:
if (void 0 === (ee = eI[aG++]))
throw Error("Unexpected end of buffer");
return sm(ee);
case 197:
return ee = eZ.getUint16(aG),
aG += 2,
sm(ee);
case 198:
return ee = eZ.getUint32(aG),
aG += 4,
sm(ee);
case 199:
return sh(eI[aG++]);
case 200:
return ee = eZ.getUint16(aG),
aG += 2,
sh(ee);
case 201:
return ee = eZ.getUint32(aG),
aG += 4,
sh(ee);
case 202:
if (ee = eZ.getFloat32(aG),
aW.useFloat32 > 2) {
var ev = sT[(127 & eI[aG]) << 1 | eI[aG + 1] >> 7];
return aG += 4,
(ev * ee + (ee > 0 ? .5 : -.5) >> 0) / ev
}
return aG += 4,
ee;
case 203:
return ee = eZ.getFloat64(aG),
aG += 8,
ee;
case 204:
return eI[aG++];
case 205:
return ee = eZ.getUint16(aG),
aG += 2,
ee;
case 206:
return ee = eZ.getUint32(aG),
aG += 4,
ee;
case 207:
return "number" === aW.int64AsType ? ee = 4294967296 * eZ.getUint32(aG) + eZ.getUint32(aG + 4) : "string" === aW.int64AsType ? ee = eZ.getBigUint64(aG).toString() : "auto" === aW.int64AsType ? (ee = eZ.getBigUint64(aG)) <= BigInt(2) << BigInt(52) && (ee = Number(ee)) : ee = eZ.getBigUint64(aG),
aG += 8,
ee;
case 208:
return eZ.getInt8(aG++);
case 209:
return ee = eZ.getInt16(aG),
aG += 2,
ee;
case 210:
return ee = eZ.getInt32(aG),
aG += 4,
ee;
case 211:
return "number" === aW.int64AsType ? ee = 4294967296 * eZ.getInt32(aG) + eZ.getUint32(aG + 4) : "string" === aW.int64AsType ? ee = eZ.getBigInt64(aG).toString() : "auto" === aW.int64AsType ? (ee = eZ.getBigInt64(aG)) >= BigInt(-2) << BigInt(52) && ee <= BigInt(2) << BigInt(52) && (ee = Number(ee)) : ee = eZ.getBigInt64(aG),
aG += 8,
ee;
case 212:
if (114 == (ee = eI[aG++]))
return sC(63 & eI[aG++]);
var eg = aK[ee];
if (eg) {
if (eg.read)
return aG++,
eg.read(a5());
if (eg.noBuffer)
return aG++,
eg();
return eg(eI.subarray(aG, ++aG))
}
throw Error("Unknown extension " + ee);
case 213:
if (114 == (ee = eI[aG]))
return aG++,
sC(63 & eI[aG++], eI[aG++]);
return sh(2);
case 214:
return sh(4);
case 215:
return sh(8);
case 216:
return sh(16);
case 217:
if (ee = eI[aG++],
aX >= aG)
return eR.slice(aG - aq, (aG += ee) - aq);
return st(ee);
case 218:
if (ee = eZ.getUint16(aG),
aG += 2,
aX >= aG)
return eR.slice(aG - aq, (aG += ee) - aq);
return sn(ee);
case 219:
if (ee = eZ.getUint32(aG),
aG += 4,
aX >= aG)
return eR.slice(aG - aq, (aG += ee) - aq);
return sr(ee);
case 220:
return ee = eZ.getUint16(aG),
aG += 2,
si(ee);
case 221:
return ee = eZ.getUint32(aG),
aG += 4,
si(ee);
case 222:
return ee = eZ.getUint16(aG),
aG += 2,
ss(ee);
case 223:
return ee = eZ.getUint32(aG),
aG += 4,
ss(ee);
default:
if (et >= 224)
return et - 256;
if (void 0 === et) {
var eC = Error("Unexpected end of MessagePack data");
throw eC.incomplete = !0,
eC
}
throw Error("Unknown MessagePack token " + et)
}
}
sn = so
var a6 = /^[a-zA-Z_$][a-zA-Z\d_$]*$/;
const decrypt = (ee) => {
for (var et, en, eo = r9(ee), ei = eo.length, ec = new Uint8Array(ei), eu = 0; eu < ei; eu++) {
var ed = eo.charCodeAt(eu);
ec[eu] = ed
}
en = {}
et = ec;
et.buffer || et.constructor !== ArrayBuffer || (et = "undefined" != typeof Buffer ? Buffer.from(et) : new Uint8Array(et)),
"object" == typeof en ? (eO = en.end || et.length,
aG = en.start || 0) : (aG = 0,
eO = en > -1 ? en : et.length),
aX = 0,
eR = null,
eD = null,
eI = et;
eM = new TextDecoder("utf-8");
eL = null
eP = [];
eZ = et.dataView || (et.dataView = new DataView(et.buffer, et.byteOffset, et.byteLength))
res = a3(en)
// ec = ecc;
// rA = 0;
// rB = 0;
// ed = [];
// eu = ec.length;
// rj = {
// "useRecords": false,
// "mapsAsObjects": true
// }
// // ei 是 TextDecoder
// ei = new TextDecoder("utf-8");
// eh = new DataView(ec.buffer, ec.byteOffset, ec.byteLength);
// ec.dataView = eh;
// let res = rK()
const replacer = (key, value) => {
if (typeof value === 'bigint') {
return value.toString();
}
return value;
};
res = JSON.stringify(res, replacer);
return res;
}
// console.log(generate_mid())
// console.log(generate_uuid())
// console.log(generate_device_id())
// console.log(generate_sign('5f65b00f83994987e334f97360d69557', '{"sessionTypes":"1,19"}'))
// let msg = "ggGLAYEBtTIyMDI2NDA5MTgwNzlAZ29vZmlzaAKzNDc4MTI4NzAwMDBAZ29vZmlzaAOxMzQwMjM5MTQ3MjUwMy5QTjQEAAXPAAABlYW04bIGggFlA4UBoAKjMTExA6AEAQXaADR7ImF0VXNlcnMiOltdLCJjb250ZW50VHlwZSI6MSwidGV4dCI6eyJ0ZXh0IjoiMTExIn19BwIIAQkACoupX3BsYXRmb3Jtp2FuZHJvaWSmYml6VGFn2gBBeyJzb3VyY2VJZCI6IlM6MSIsIm1lc3NhZ2VJZCI6ImYzNjkwMmVmZjQ1NDQ1YmRiMmQxYjBmZDE2OGY4MjY0In2sZGV0YWlsTm90aWNlozExMadleHRKc29u2gBLeyJxdWlja1JlcGx5IjoiMSIsIm1lc3NhZ2VJZCI6ImYzNjkwMmVmZjQ1NDQ1YmRiMmQxYjBmZDE2OGY4MjY0IiwidGFnIjoidSJ9r3JlbWluZGVyQ29udGVudKMxMTGucmVtaW5kZXJOb3RpY2W15Y+R5p2l5LiA5p2h5paw5raI5oGvrXJlbWluZGVyVGl0bGWmc2hh5L+uq3JlbWluZGVyVXJs2gCbZmxlYW1hcmtldDovL21lc3NhZ2VfY2hhdD9pdGVtSWQ9ODk3NzQyNzQ4MDExJnBlZXJVc2VySWQ9MjIwMjY0MDkxODA3OSZwZWVyVXNlck5pY2s9dCoqKjEmc2lkPTQ3ODEyODcwMDAwJm1lc3NhZ2VJZD1mMzY5MDJlZmY0NTQ0NWJkYjJkMWIwZmQxNjhmODI2NCZhZHY9bm+sc2VuZGVyVXNlcklkrTIwMjY0MDkxODA3Oy5zZW5kZXJVc2VyVHlwYaEwq3Nlc3Npb25UeXBloTGqdXBkYXRlSGVhZKR0cnVl";
//
// msg = "ggGLAYEBsjMxNDk2MzcwNjNAZ29vZmlzaAKzNDc5ODMzODkwOTZAZ29vZmlzaAOxMzQxNjU2NTI3NDU0Mi5QTjQEAAXPAAABlbKji20GggFlA4UBoAK6W+aIkeW3suaLjeS4i++8jOW+heS7mOasvl0DoAQaBdoEKnsiY29udGVudFR5cGUiOjI2LCJkeENhcmQiOnsiaXRlbSI6eyJtYWluIjp7ImNsaWNrUGFyYW0iOnsiYXJnMSI6Ik1zZ0NhcmQiLCJhcmdzIjp7InNvdXJjZSI6ImltIiwidGFza19pZCI6IjNleFFKSE9UbVBVMSIsIm1zZ19pZCI6ImNjOGJjMmRmN2M5MzRkZjA4NmUwNTY3Y2I2OWYxNTczIn19LCJleENvbnRlbnQiOnsiYmdDb2xvciI6IiNGRkZGRkYiLCJidXR0b24iOnsiYmdDb2xvciI6IiNGRkU2MEYiLCJib3JkZXJDb2xvciI6IiNGRkU2MEYiLCJjbGlja1BhcmFtIjp7ImFyZzEiOiJNc2dDYXJkQWN0aW9uIiwiYXJncyI6eyJzb3VyY2UiOiJpbSIsInRhc2tfaWQiOiIzZXhRSkhPVG1QVTEiLCJtc2dfaWQiOiJjYzhiYzJkZjdjOTM0ZGYwODZlMDU2N2NiNjlmMTU3MyJ9fSwiZm9udENvbG9yIjoiIzMzMzMzMyIsInRhcmdldFVybCI6ImZsZWFtYXJrZXQ6Ly9hZGp1c3RfcHJpY2U/Zmx1dHRlcj10cnVlJmJpek9yZGVySWQ9MjUwMzY4ODEyNjM1NjYzNjM3MCIsInRleHQiOiLkv67mlLnku7fmoLwifSwiZGVzYyI6Iuivt+WPjOaWueayn+mAmuWPiuaXtuehruiupOS7t+agvCIsImRlc2NDb2xvciI6IiNBM0EzQTMiLCJ0aXRsZSI6IuaIkeW3suaLjeS4i++8jOW+heS7mOasviIsInVwZ3JhZGUiOnsidGFyZ2V0VXJsIjoiaHR0cHM6Ly9oNS5tLmdvb2Zpc2guY29tL2FwcC9pZGxlRmlzaC1GMmUvZm0tZG93bmxvYWQvaG9tZS5odG1sP25vUmVkcmllY3Q9dHJ1ZSZjYW5CYWNrPXRydWUmY2hlY2tWZXJzaW9uPXRydWUiLCJ2ZXJzaW9uIjoiNy43LjkwIn19LCJ0YXJnZXRVcmwiOiJmbGVhbWFya2V0Oi8vb3JkZXJfZGV0YWlsP2lkPTI1MDM2ODgxMjYzNTY2MzYzNzAmcm9sZT1zZWxsZXIifX0sInRlbXBsYXRlIjp7Im5hbWUiOiJpZGxlZmlzaF9tZXNzYWdlX3RyYWRlX2NoYXRfY2FyZCIsInVybCI6Imh0dHBzOi8vZGluYW1pY3guYWxpYmFiYXVzZXJjb250ZW50LmNvbS9wdWIvaWRsZWZpc2hfbWVzc2FnZV90cmFkZV9jaGF0X2NhcmQvMTY2NzIyMjA1Mjc2Ny9pZGxlZmlzaF9tZXNzYWdlX3RyYWRlX2NoYXRfY2FyZC56aXAiLCJ2ZXJzaW9uIjoiMTY2NzIyMjA1Mjc2NyJ9fX0HAQgBCQAK3gAQpmJpelRhZ9oAe3sic291cmNlSWQiOiJDMkM6M2V4UUpIT1RtUFUxIiwidGFza05hbWUiOiLlt7Lmi43kuItf5pyq5LuY5qy+X+WNluWutiIsIm1hdGVyaWFsSWQiOiIzZXhRSkhPVG1QVTEiLCJ0YXNrSWQiOiIzZXhRSkhPVG1QVTEifbFjbG9zZVB1c2hSZWNlaXZlcqVmYWxzZbFjbG9zZVVucmVhZE51bWJlcqVmYWxzZaxkZXRhaWxOb3RpY2W6W+aIkeW3suaLjeS4i++8jOW+heS7mOasvl2nZXh0SnNvbtoBr3sibXNnQXJncyI6eyJ0YXNrX2lkIjoiM2V4UUpIT1RtUFUxIiwic291cmNlIjoiaW0iLCJtc2dfaWQiOiJjYzhiYzJkZjdjOTM0ZGYwODZlMDU2N2NiNjlmMTU3MyJ9LCJxdWlja1JlcGx5IjoiMSIsIm1zZ0FyZzEiOiJNc2dDYXJkIiwidXBkYXRlS2V5IjoiNDc5ODMzODkwOTY6MjUwMzY4ODEyNjM1NjYzNjM3MDoxX25vdF9wYXlfc2VsbGVyIiwibWVzc2FnZUlkIjoiY2M4YmMyZGY3YzkzNGRmMDg2ZTA1NjdjYjY5ZjE1NzMiLCJtdWx0aUNoYW5uZWwiOnsiaHVhd2VpIjoiRVhQUkVTUyIsInhpYW9taSI6IjEwODAwMCIsIm9wcG8iOiJFWFBSRVNTIiwiaG9ub3IiOiJOT1JNQUwiLCJhZ29vIjoicHJvZHVjdCIsInZpdm8iOiJPUkRFUiJ9LCJjb250ZW50VHlwZSI6IjI2IiwiY29ycmVsYXRpb25Hcm91cElkIjoiM2V4UUpIT1RtUFUxX0ZGcjRHT1NuOE9RbyJ9qHJlY2VpdmVyrTIyMDI2NDA5MTgwNzmrcmVkUmVtaW5kZXKy562J5b6F5Lmw5a625LuY5qy+sHJlZFJlbWluZGVyU3R5bGWhMa9yZW1pbmRlckNvbnRlbnS6W+aIkeW3suaLjeS4i++8jOW+heS7mOasvl2ucmVtaW5kZXJOb3RpY2W75Lmw5a625bey5ouN5LiL77yM5b6F5LuY5qy+rXJlbWluZGVyVGl0bGW75Lmw5a625bey5ouN5LiL77yM5b6F5LuY5qy+q3JlbWluZGVyVXJs2gCbZmxlYW1hcmtldDovL21lc3NhZ2VfY2hhdD9pdGVtSWQ9OTAwMDUyNjQ0Mjc3JnBlZXJVc2VySWQ9MzE0OTYzNzA2MyZwZWVyVXNlck5pY2s955S3KioqeSZzaWQ9NDc5ODMzODkwOTYmbWVzc2FnZUlkPWNjOGJjMmRmN2M5MzRkZjA4NmUwNTY3Y2I2OWYxNTczJmFkdj1ub6xzZW5kZXJVc2VySWSqMzE0OTYzNzA2M65zZW5kZXJVc2VyVHlwZaEwq3Nlc3Npb25UeXBloTGqdXBkYXRlSGVhZKR0cnVl"
// msg = "hAGzNDc5ODMzODkwOTZAZ29vZmlzaAIBA4KrcmVkUmVtaW5kZXKy562J5b6F5Lmw5a625LuY5qy+sHJlZFJlbWluZGVyU3R5bGWhMQTPAAABlbMlNng="
// res = decrypt(msg);
// console.log(res);
+10
View File
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="195px" height="150px" viewBox="30 53 195 150" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>单独LOGO</title>
<defs>
<path d="M0,0 L256,0 L256,256 L0,256 L0,0 Z" id="path-1"></path>
</defs>
<g id="单独LOGO" stroke="none" fill="none" xlink:href="#path-1" fill-rule="evenodd">
<path d="M121.73,57.0003 C138.901,57.0003 154.897,65.5053 164.52,79.7493 C166.029,81.9823 165.441,85.0143 163.209,86.5233 C160.976,88.0323 157.944,87.4433 156.436,85.2113 C148.629,73.6553 135.655,66.7563 121.73,66.7563 C104.076789,66.7563 88.6201962,77.6596007 82.5581814,93.8184545 C83.9120803,93.7133631 85.2800264,93.66 86.6602,93.66 C111.537727,93.66 132.442611,110.997575 137.926382,134.224255 L162.5425,92.109 L162.615557,91.9879406 L162.756884,91.77367 L162.911804,91.5639102 L162.98657,91.4716759 C163.351845,91.025169 163.786059,90.6571744 164.264191,90.3738733 L164.550153,90.2178351 L164.729252,90.1315693 L164.989203,90.021723 L165.230265,89.9354653 L165.542393,89.8445739 C165.666021,89.8126706 165.790834,89.7857324 165.916565,89.7637431 L166.116517,89.7342499 C166.29505,89.7098142 166.475001,89.6957386 166.655596,89.6918808 L166.7539,89.693 C196.8909,89.693 221.4079,114.21 221.4079,144.347 C221.4079,174.482 196.8909,199 166.7539,199 L125.0869,199 C122.3919,199 120.2079,196.815 120.2079,194.122 C120.2079,191.429 122.3919,189.244 125.0869,189.244 L166.7539,189.244 C191.5109,189.244 211.6519,169.104 211.6519,144.347 C211.6519,120.513406 192.985349,100.957891 169.504046,99.5322548 L112.7745,196.584 C111.8995,198.08 110.2965,199 108.5635,199 L86.6602,199 C57.6182,199 33.9902,175.373 33.9902,146.33 C33.9902,122.475163 49.9316132,102.273061 71.7206298,95.817503 L71.9446339,94.967678 C78.0600632,72.5405324 98.33054,57.0003 121.73,57.0003 Z M86.6602,103.417 C62.9972,103.417 43.7462,122.667 43.7462,146.33 C43.7462,169.992 62.9972,189.244 86.6602,189.244 L105.7645,189.244 L129.869462,148.004782 C129.678439,147.482425 129.5742,146.918336 129.5742,146.33 C129.5742,122.667 110.3232,103.417 86.6602,103.417 Z" id="LOGO" fill="#FFFFFF"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

+78
View File
@@ -0,0 +1,78 @@
type RequestMethod = 'GET' | 'POST' | 'PUT' | 'DELETE';
type QueryParams = Record<string, string | number | boolean | undefined | null>;
type JsonValue = unknown;
type RequestOptions = {
params?: QueryParams;
body?: JsonValue;
};
const buildQueryString = (params?: QueryParams): string => {
if (!params) return '';
const searchParams = new URLSearchParams();
for (const [key, rawVal] of Object.entries(params)) {
if (rawVal === undefined || rawVal === null) continue;
searchParams.set(key, String(rawVal));
}
const qs = searchParams.toString();
return qs ? `?${qs}` : '';
};
const request = async <T>(method: RequestMethod, url: string, options: RequestOptions = {}): Promise<T> => {
const qs = buildQueryString(options.params);
const fullUrl = `${url}${qs}`;
const res = await fetch(fullUrl, {
method,
credentials: 'include',
headers: {
...(options.body === undefined ? {} : { 'Content-Type': 'application/json' }),
},
body: options.body === undefined ? undefined : JSON.stringify(options.body),
});
const contentType = res.headers.get('content-type') || '';
const isJson = contentType.includes('application/json');
if (!res.ok) {
// 尽量返回后端的detail/message,避免吞错
const payload = isJson ? await res.json().catch(() => undefined) : await res.text().catch(() => undefined);
const detail = typeof payload === 'string' ? payload : (payload?.detail || payload?.message || payload?.msg);
throw new Error(detail || `请求失败: ${res.status}`);
}
if (!isJson) {
// 这里按现有后端习惯基本都会返回JSON;非JSON时直接返回text
return (await res.text()) as unknown as T;
}
return (await res.json()) as T;
};
export const get = async <T>(url: string, params?: QueryParams): Promise<T> => request<T>('GET', url, { params });
export const post = async <T>(url: string, body?: JsonValue): Promise<T> => request<T>('POST', url, { body });
export const put = async <T>(url: string, body?: JsonValue): Promise<T> => request<T>('PUT', url, { body });
export const del = async <T>(url: string, params?: QueryParams): Promise<T> => request<T>('DELETE', url, { params });
export const postForm = async <T>(url: string, body: FormData): Promise<T> => {
const res = await fetch(url, {
method: 'POST',
credentials: 'include',
body,
});
const contentType = res.headers.get('content-type') || '';
const isJson = contentType.includes('application/json');
const payload = isJson ? await res.json().catch(() => undefined) : await res.text().catch(() => undefined);
if (!res.ok) {
const detail = typeof payload === 'string' ? payload : (payload?.detail || payload?.message || payload?.msg);
const err = new Error(detail || ('请求失败: ' + res.status)) as Error & { payload?: unknown };
err.payload = payload;
throw err;
}
return payload as T;
};
+646
View File
@@ -0,0 +1,646 @@
import { get, post, put, del, postForm } from '../request';
import {
LoginResponse, AccountDetail, Order, PaginatedResponse,
AdminStats, Card, SystemSettings, ApiResponse, OrderAnalytics,
Item, AIReplySettings, ShippingRule, ReplyRule, DefaultReply
} from '../types';
// Auth
export const login = async (data: { username?: string; password?: string; email?: string; verification_code?: string }): Promise<LoginResponse> => {
return post('/login', data);
};
export const verifySession = async (): Promise<{ authenticated: boolean; initialized?: boolean; user_id?: number; username?: string; is_admin?: boolean }> => {
return get('/verify');
};
export const logout = async (): Promise<ApiResponse> => {
return post('/logout', {});
};
export const changePassword = async (currentPassword: string, newPassword: string): Promise<ApiResponse> => {
return post('/change-password', { current_password: currentPassword, new_password: newPassword });
};
export const updateLoginCredentials = async (data: {
current_password: string;
new_username: string;
new_password?: string;
}): Promise<ApiResponse & { requires_relogin?: boolean }> => {
return put('/account/credentials', data);
};
// Accounts
export const addAccount = async (id: string, value: string): Promise<ApiResponse> => {
return post('/cookies', { id, value });
};
const accountAvatarURL = (item: any, version: string): string => {
const raw = item.avatar_url || '';
if (!raw) return '';
try {
const url = new URL(raw, window.location.origin);
if (url.hostname.endsWith('alicdn.com')) {
url.searchParams.set('_v', version);
}
return url.toString();
} catch {
return raw;
}
};
export const getAccountDetails = async (): Promise<AccountDetail[]> => {
const data = await get<any[]>('/cookies/details');
const avatarVersion = Date.now().toString();
return data.map(item => ({
id: item.id,
value: '',
cookie: '',
enabled: item.enabled,
auto_confirm: item.auto_confirm,
remark: item.remark,
note: item.remark,
pause_duration: item.pause_duration,
username: item.username || '',
login_password: '',
show_browser: item.show_browser,
nickname: item.nickname || item.remark || `账号 ${item.id.substring(0,6)}`,
avatar_url: accountAvatarURL(item, avatarVersion),
profile_error: item.profile_error || '',
ai_enabled: false,
}));
};
export interface AccountRuntimeStatus {
state: NonNullable<AccountDetail['runtime_state']>;
message?: string;
connected: boolean;
failures: number;
updated_at: string;
}
export const getAccountRuntimeStatuses = async (): Promise<Record<string, AccountRuntimeStatus>> => {
return get('/cookies/runtime-status');
};
export const generateQRLogin = async (): Promise<{ success: boolean; session_id?: string; qr_code_url?: string }> => {
return post('/qr-login/generate');
};
export const checkQRLoginStatus = async (sessionId: string): Promise<any> => {
return get(`/qr-login/check/${sessionId}`);
};
export const completeQRVerification = async (sessionId: string): Promise<{ success: boolean; cookies?: string; unb?: string; message?: string }> => {
return post(`/qr-login/complete-verification/${sessionId}`, {});
};
export const updateAccountStatus = async (id: string, enabled: boolean): Promise<any> => {
return put(`/cookies/${id}/status`, { enabled });
};
export const deleteAccount = async (id: string): Promise<any> => {
return del(`/cookies/${id}`);
};
export const updateAccountRemark = async (id: string, remark: string): Promise<any> => {
return put(`/cookies/${id}/remark`, { remark });
};
export const updateAccountAutoConfirm = async (id: string, autoConfirm: boolean): Promise<any> => {
return put(`/cookies/${id}/auto-confirm`, { auto_confirm: autoConfirm });
};
export const updateAccountPauseDuration = async (id: string, pauseDuration: number): Promise<any> => {
return put(`/cookies/${id}/pause-duration`, { pause_duration: pauseDuration });
};
export const updateAccountCookie = async (id: string, value: string): Promise<any> => {
return put(`/cookies/${id}`, { id, value });
};
export const updateAccountLoginInfo = async (id: string, data: {
username?: string;
login_password?: string;
show_browser?: boolean;
}): Promise<any> => {
return put(`/cookies/${id}/login-info`, data);
};
export const getAllAISettings = async (): Promise<Record<string, AIReplySettings>> => {
return get('/ai-reply-settings');
};
// Orders
export const getOrders = async (
cookieId?: string,
status?: string,
page: number = 1,
pageSize: number = 20
): Promise<PaginatedResponse<Order>> => {
const params: any = { page, page_size: pageSize };
if (cookieId) params.cookie_id = cookieId;
if (status && status !== 'all') params.status = status;
const res = await get<any>('/api/orders', params);
// Handle backend response variations
const rawOrders = res.orders || res.data || [];
const orders = rawOrders.map((item: any) => ({
...item,
id: item.id || item.order_id,
status: item.status || item.order_status || 'processing',
quantity: Number(item.quantity || 1),
}));
return {
success: true,
data: orders,
total: res.total || orders.length,
page: res.page || page,
page_size: res.page_size || pageSize,
total_pages: res.total_pages || 1
};
};
export const getOrderDetail = async (orderId: string): Promise<{ success: boolean; data?: Order }> => {
const result = await get<{ order?: Order; data?: Order }>(`/api/orders/${orderId}`);
return {
success: true,
data: result.order || result.data
};
};
export const updateOrder = async (orderId: string, data: Partial<Order>): Promise<ApiResponse> => {
return put(`/api/orders/${orderId}`, data);
};
export const deleteOrder = async (orderId: string): Promise<ApiResponse> => {
return del(`/api/orders/${orderId}`);
};
export const syncOrders = async (cookieId?: string, status?: string): Promise<any> => {
const formData = new FormData();
if (cookieId) formData.append('cookie_id', cookieId);
if (status) formData.append('status', status);
// 使用 fetch 来发送 FormData(Cookie 会话,自动携带凭证)
const response = await fetch('/api/orders/refresh', {
method: 'POST',
credentials: 'include',
body: formData
});
const result = await response.json().catch(() => ({}));
if (!response.ok || result.success === false) {
throw new Error(result.detail || result.message || `订单同步失败: ${response.status}`);
}
return result;
};
export const syncSingleOrder = async (orderId: string): Promise<any> => {
return post(`/api/orders/${orderId}/refresh`);
};
export const manualShipOrder = async (orderIds: string[], shipMode: 'status_only' | 'full_delivery', content?: string): Promise<any> => {
return post('/api/orders/manual-ship', {
order_ids: orderIds,
ship_mode: shipMode,
custom_content: content
});
}
export const importOrders = async (data: Partial<Order>[] | FormData): Promise<any> => {
const isFormData = data instanceof FormData;
const response = await fetch('/api/orders/import', {
method: 'POST',
credentials: 'include',
headers: {
...(isFormData ? {} : { 'Content-Type': 'application/json' }),
},
body: isFormData ? data : JSON.stringify(data)
});
const result = await response.json().catch(() => ({}));
if (!response.ok || result.success === false) {
throw new Error(result.detail || result.message || `订单导入失败: ${response.status}`);
}
return result;
}
// Stats
export const getAdminStats = async (): Promise<AdminStats> => {
return get('/admin/stats');
};
export const getOrderAnalytics = async (daysOrParams: number | {start_date: string; end_date: string} = 7): Promise<OrderAnalytics> => {
let params: {start_date: string; end_date: string};
if (typeof daysOrParams === 'number') {
const endDate = new Date();
const startDate = new Date();
startDate.setDate(startDate.getDate() - daysOrParams);
params = {
start_date: startDate.toISOString().split('T')[0],
end_date: endDate.toISOString().split('T')[0]
};
} else {
params = daysOrParams;
}
return get('/analytics/orders', params);
}
export const getValidOrders = async (dateRange: {start_date: string; end_date: string}): Promise<Order[]> => {
const res = await get<any>('/analytics/orders/valid', {
start_date: dateRange.start_date,
end_date: dateRange.end_date
});
return res.orders || [];
}
// Cards
const normalizeCard = (item: any): Card => {
let apiConfig = item.api_config;
if (typeof apiConfig === 'string' && apiConfig.trim()) {
try {
apiConfig = JSON.parse(apiConfig);
} catch {
apiConfig = undefined;
}
}
return {...item, api_config: apiConfig || undefined} as Card;
};
const cardPayload = (data: Partial<Card>): Record<string, unknown> => ({
...data,
api_config: data.api_config ? JSON.stringify(data.api_config) : '',
});
export const getCards = async (): Promise<Card[]> => {
const res = await get<any>('/cards');
const cards = Array.isArray(res) ? res : (res.cards || []);
return cards.map(normalizeCard);
};
export const createCard = async (data: Partial<Card>): Promise<{ id: number; message: string }> => {
return post('/cards', cardPayload(data));
};
export const updateCard = async (cardId: string | number, data: Partial<Card>): Promise<ApiResponse> => {
return put(`/cards/${cardId}`, cardPayload(data));
};
export const deleteCard = async (cardId: string | number): Promise<ApiResponse> => {
return del(`/cards/${cardId}`);
};
export const getCardDetails = async (cardId: string | number): Promise<any> => {
const card = await get<any>(`/cards/${cardId}/details`);
return normalizeCard(card);
};
// Items
export const getItems = async (): Promise<Item[]> => {
const res = await get<any>('/items');
const items = Array.isArray(res) ? res : (res.items || []);
return items.map((item: any) => ({
...item,
id: item.id || `${item.cookie_id}-${item.item_id}`,
is_multi_qty_ship: item.is_multi_qty_ship ?? item.multi_quantity_delivery ?? false,
}));
}
export const syncItemsFromAccount = async (cookieId: string): Promise<any> => {
return post('/items/get-all-from-account', { cookie_id: cookieId });
}
export const deleteItem = async (cookieId: string, itemId: string): Promise<any> => {
return del(`/items/${cookieId}/${itemId}`);
}
export const createItem = async (cookieId: string, data: any): Promise<any> => {
return post(`/items/${cookieId}`, data);
}
export const publishItem = async (form: {
cookie_id: string;
title: string;
description: string;
price: string;
original_price?: string;
quantity: string | number;
postage_mode: string;
postage?: string;
images: File[];
}): Promise<any> => {
const body = new FormData();
body.set('cookie_id', form.cookie_id);
body.set('title', form.title);
body.set('description', form.description);
body.set('price', form.price);
body.set('original_price', form.original_price || '');
body.set('quantity', String(form.quantity));
body.set('postage_mode', form.postage_mode);
body.set('postage', form.postage || '');
for (const file of form.images) {
body.append('images', file);
}
return postForm('/items/publish', body);
}
export const previewItemPublishBatch = async (form: {
file: File;
imagesZip?: File | null;
defaultCookieId?: string;
}): Promise<any> => {
const body = new FormData();
body.set('file', form.file);
if (form.imagesZip) body.set('images_zip', form.imagesZip);
if (form.defaultCookieId) body.set('default_cookie_id', form.defaultCookieId);
return postForm('/items/publish-batches/preview', body);
}
export const startItemPublishBatch = async (previewId: string): Promise<any> => {
return post('/items/publish-batches', { preview_id: previewId });
}
export const getItemPublishBatch = async (batchId: string): Promise<any> => {
return get(`/items/publish-batches/${batchId}`);
}
export const cancelItemPublishBatch = async (batchId: string): Promise<any> => {
return post(`/items/publish-batches/${batchId}/cancel`, {});
}
export const retryFailedItemPublishBatch = async (batchId: string): Promise<any> => {
return post(`/items/publish-batches/${batchId}/retry-failed`, {});
}
export const updateItem = async (cookieId: string, itemId: string, data: any): Promise<any> => {
return put(`/items/${cookieId}/${itemId}`, data);
}
export const setItemMultiSpec = async (cookieId: string, itemId: string, enabled: boolean): Promise<any> => {
return put(`/items/${cookieId}/${itemId}/multi-spec`, { is_multi_spec: enabled });
}
export const setItemMultiQuantity = async (cookieId: string, itemId: string, enabled: boolean): Promise<any> => {
return put(`/items/${cookieId}/${itemId}/multi-quantity-delivery`, { multi_quantity_delivery: enabled });
}
// Rules - 发货规则 (使用正确的后端API)
export const getShippingRules = async (): Promise<ShippingRule[]> => {
const res = await get<any>('/delivery-rules');
const rules = Array.isArray(res) ? res : (res.data || res.rules || []);
// 转换后端数据格式到前端格式
return rules.map((item: any) => ({
id: String(item.id),
name: item.description || item.keyword || '',
item_keyword: item.keyword || '',
cookie_id: item.cookie_id || '',
item_id: item.item_id || '',
item_title: item.item_title || '',
card_group_id: item.card_id || 0,
card_group_name: item.card_name || '',
priority: item.delivery_count || 1,
enabled: item.enabled || false,
variants: (item.variants || []).map((variant: any) => ({
id: variant.id ? String(variant.id) : undefined,
spec_name: variant.spec_name || '',
spec_value: variant.spec_value || '',
card_id: Number(variant.card_id || 0),
card_name: variant.card_name || '',
card_type: variant.card_type,
delivery_count: Number(variant.delivery_count || 1),
enabled: variant.enabled !== false,
})),
}));
}
export const updateShippingRule = async (rule: Partial<ShippingRule>): Promise<any> => {
const payload = {
keyword: rule.item_keyword,
cookie_id: rule.cookie_id || '',
item_id: rule.item_id || '',
card_id: rule.card_group_id,
delivery_count: rule.priority,
enabled: rule.enabled ?? true,
description: rule.name,
// 规格映射更新时后端会删除旧记录并重建;不要回传只用于展示的
// id/card_name/card_type,避免把字符串 id 解码到 Go int64 时失败。
variants: (rule.variants || []).map((variant) => ({
spec_name: variant.spec_name,
spec_value: variant.spec_value,
card_id: variant.card_id,
delivery_count: variant.delivery_count,
enabled: variant.enabled,
})),
};
return rule.id ? put(`/delivery-rules/${rule.id}`, payload) : post('/delivery-rules', payload);
}
export const deleteShippingRule = async (id: string): Promise<any> => del(`/delivery-rules/${id}`);
// Rules - 关键词回复规则 (使用关键词API)
export const getReplyRules = async (cookieId?: string): Promise<ReplyRule[]> => {
if (!cookieId) return [];
const res = await get<any>(`/keywords-with-item-id/${cookieId}`);
const keywords = Array.isArray(res) ? res : [];
return keywords.map((item: any, index: number) => ({
id: String(index),
keyword: item.keyword || '',
reply_content: item.reply || '',
match_type: 'exact' as const,
enabled: true
}));
}
export const updateReplyRule = async (rule: Partial<ReplyRule>, cookieId: string): Promise<any> => {
// 获取现有关键词
const existing = await get<any>(`/keywords-with-item-id/${cookieId}`);
const keywords = Array.isArray(existing) ? existing : [];
// 更新或添加关键词
if (rule.id) {
const index = parseInt(rule.id);
if (index >= 0 && index < keywords.length) {
keywords[index] = {
keyword: rule.keyword,
reply: rule.reply_content,
item_id: ''
};
}
} else {
keywords.push({
keyword: rule.keyword,
reply: rule.reply_content,
item_id: ''
});
}
return post(`/keywords-with-item-id/${cookieId}`, { keywords });
}
export const deleteReplyRule = async (id: string, cookieId: string): Promise<any> => {
const existing = await get<any>(`/keywords-with-item-id/${cookieId}`);
const keywords = Array.isArray(existing) ? existing : [];
const index = parseInt(id);
if (index >= 0 && index < keywords.length) {
keywords.splice(index, 1);
}
return post(`/keywords-with-item-id/${cookieId}`, { keywords });
}
// Settings
export const getSystemSettings = async (): Promise<SystemSettings> => {
const res = await get<{data: SystemSettings}>('/system-settings');
return res.data || res; // handle {success:true, data: {...}} wrapper if exists
};
export const updateSystemSettings = async (settings: Partial<SystemSettings>): Promise<ApiResponse> => {
// API expects individual PUTs, but we'll loop in the service for convenience or assume bulk endpoint if updated
// Based on docs 12.2, we iterate.
const promises = Object.entries(settings).map(([key, value]) => {
return put(`/system-settings/${key}`, { value: String(value) });
});
await Promise.all(promises);
return { success: true, message: 'Settings saved' };
};
export const getAccountAISettings = async (cookieId: string): Promise<AIReplySettings> => {
return get(`/ai-reply-settings/${cookieId}`);
}
export const updateAccountAISettings = async (cookieId: string, settings: Partial<AIReplySettings>): Promise<ApiResponse> => {
const payload = {
ai_enabled: settings.ai_enabled ?? false,
max_discount_percent: settings.max_discount_percent ?? 10,
max_discount_amount: settings.max_discount_amount ?? 100,
max_bargain_rounds: settings.max_bargain_rounds ?? 3,
custom_prompts: settings.custom_prompts ?? ''
};
return put(`/ai-reply-settings/${cookieId}`, payload);
}
export const fetchAIModels = async (baseUrl: string, apiKey: string = ''): Promise<string[]> => {
const result = await post<{ models?: string[] }>('/ai-models', {
base_url: baseUrl,
api_key: apiKey,
});
return result.models || [];
};
export const testAIConnection = async (cookieId: string): Promise<ApiResponse> => {
const result = await post<{ success?: boolean; message?: string; reply?: string }>(`/ai-reply-test/${cookieId}`, {
message: '你好,这是一条测试消息',
});
if (result.reply) {
return { success: true, message: `AI 回复: ${result.reply}` };
}
return { success: result.success ?? true, message: result.message || 'AI 连接测试成功' };
}
// Notification Channels
export const getNotificationChannels = async (): Promise<{ success: boolean; data?: any[] }> => {
const result = await get<any[]>('/notification-channels');
const channels = (result || []).map((item: any) => {
let parsedConfig;
try {
parsedConfig = JSON.parse(item.config);
} catch {
parsedConfig = undefined;
}
return {
id: String(item.id),
name: item.name,
type: item.type,
config: parsedConfig,
enabled: item.enabled,
created_at: item.created_at,
updated_at: item.updated_at,
};
});
return { success: true, data: channels };
}
export const createNotificationChannel = async (data: { name: string; type: string; config: Record<string, unknown> }): Promise<ApiResponse> => {
return post('/notification-channels', {
...data,
config: JSON.stringify(data.config)
});
}
export const updateNotificationChannel = async (channelId: string, data: { name?: string; config?: Record<string, unknown>; enabled?: boolean }): Promise<ApiResponse> => {
const payload: Record<string, unknown> = { ...data };
if ('config' in data) {
payload.config = JSON.stringify(data.config);
}
return put(`/notification-channels/${channelId}`, payload);
}
export const deleteNotificationChannel = async (channelId: string): Promise<ApiResponse> => {
return del(`/notification-channels/${channelId}`);
}
// Message Notifications
export const getMessageNotifications = async (): Promise<{ success: boolean; data?: any[] }> => {
const result = await get<Record<string, any[]>>('/message-notifications');
const notifications = [];
for (const [cookieId, channelList] of Object.entries(result || {})) {
if (Array.isArray(channelList)) {
for (const item of channelList) {
notifications.push({
cookie_id: cookieId,
channel_id: item.channel_id,
channel_name: item.channel_name,
enabled: item.enabled,
});
}
}
}
return { success: true, data: notifications };
}
export const setMessageNotification = async (cookieId: string, channelId: number, enabled: boolean): Promise<ApiResponse> => {
return post(`/message-notifications/${cookieId}`, { channel_id: channelId, enabled });
}
export const deleteMessageNotification = async (notificationId: string): Promise<ApiResponse> => {
return del(`/message-notifications/${notificationId}`);
}
export const deleteAccountNotifications = async (cookieId: string): Promise<ApiResponse> => {
return del(`/message-notifications/account/${cookieId}`);
}
// Default Reply
export const getDefaultReplies = async (): Promise<Record<string, DefaultReply>> => {
return get('/api/default-replies');
};
export const getDefaultReply = async (cookieId: string): Promise<DefaultReply> => {
const result = await get<any>(`/api/default-reply/${cookieId}`);
return {
cookie_id: cookieId,
enabled: result.enabled || false,
reply_content: result.reply_content || '',
reply_once: result.reply_once || false,
reply_image_url: result.reply_image_url || ''
};
};
export const updateDefaultReply = async (cookieId: string, data: Partial<DefaultReply>): Promise<ApiResponse> => {
return put(`/api/default-reply/${cookieId}`, {
enabled: data.enabled ?? false,
reply_content: data.reply_content || '',
reply_once: data.reply_once ?? false,
reply_image_url: data.reply_image_url || ''
});
};
export const deleteDefaultReply = async (cookieId: string): Promise<ApiResponse> => {
return del(`/api/default-reply/${cookieId}`);
};
export const clearDefaultReplyRecords = async (cookieId: string): Promise<ApiResponse> => {
return post(`/api/default-reply/${cookieId}/clear-records`, {});
};
+44
View File
@@ -0,0 +1,44 @@
/** @type {import('tailwindcss').Config} */
export default {
content: [
"./index.html",
"./*.{js,ts,jsx,tsx}",
"./components/**/*.{js,ts,jsx,tsx}",
],
theme: {
extend: {
colors: {
// Ydisks 官网配色:Apple 风格蓝色系 + 浅灰背景 + 深色文字。
brand: {
DEFAULT: '#0094f7', // 主品牌蓝(Ydisks logo/按钮色)
dark: '#0071e3', // 深蓝(hover/强调)
light: '#287efe', // 亮蓝(辅助)
},
// Ydisks 中性色
ink: '#1d1d1f', // 主文字
muted: '#86868b', // 次要文字
line: '#d2d2d7', // 边框/分隔
canvas: '#fbfbfd', // 页面背景
surface: '#f5f5f7', // 卡片背景/区块
},
borderRadius: {
'2xl': '1.5rem',
'3xl': '2rem',
},
fontFamily: {
sans: [
'-apple-system',
'BlinkMacSystemFont',
'"PingFang SC"',
'"Hiragino Sans GB"',
'"Microsoft YaHei"',
'"Helvetica Neue"',
'Helvetica',
'Arial',
'sans-serif',
],
},
},
},
plugins: [],
}
+29
View File
@@ -0,0 +1,29 @@
{
"compilerOptions": {
"target": "ES2022",
"experimentalDecorators": true,
"useDefineForClassFields": false,
"module": "ESNext",
"lib": [
"ES2022",
"DOM",
"DOM.Iterable"
],
"skipLibCheck": true,
"types": [
"node"
],
"moduleResolution": "bundler",
"isolatedModules": true,
"moduleDetection": "force",
"allowJs": true,
"jsx": "react-jsx",
"paths": {
"@/*": [
"./*"
]
},
"allowImportingTsExtensions": true,
"noEmit": true
}
}
+222
View File
@@ -0,0 +1,222 @@
// API Response Bases
export interface ApiResponse {
success?: boolean;
message?: string;
msg?: string;
}
export interface PaginatedResponse<T> {
success: boolean;
data: T[];
total: number;
page: number;
page_size: number;
total_pages: number;
}
// Auth
export interface LoginResponse {
success: boolean;
token?: string;
message?: string;
user_id?: number;
username?: string;
is_admin?: boolean;
}
// Accounts
export interface AccountDetail {
id: string;
value?: string; // cookie value from backend
cookie?: string; // alias for value
enabled: boolean;
auto_confirm: boolean;
remark?: string;
note?: string; // alias for remark
pause_duration?: number;
// 登录信息
username?: string;
login_password?: string;
show_browser?: boolean;
// Frontend helpers
nickname?: string;
avatar_url?: string;
profile_error?: string;
runtime_state?: 'starting' | 'connecting' | 'online' | 'reconnecting' | 'auth_expired' | 'verification_required' | 'error' | 'stopped' | 'disabled';
runtime_message?: string;
runtime_connected?: boolean;
runtime_updated_at?: string;
// AI设置
ai_enabled?: boolean;
max_discount_percent?: number;
max_discount_amount?: number;
max_bargain_rounds?: number;
custom_prompts?: string;
}
// Orders
export type OrderStatus =
| 'processing'
| 'pending_ship'
| 'shipped'
| 'completed'
| 'cancelled'
| 'refunding';
export interface Order {
id: string;
order_id: string;
cookie_id: string;
item_id: string;
item_title?: string;
item_image?: string;
item_price?: string;
buyer_id: string;
quantity: number;
amount: string;
status: OrderStatus;
receiver_name?: string;
receiver_phone?: string;
receiver_address?: string;
created_at?: string;
updated_at?: string;
}
// Cards
export interface Card {
id: number;
name: string;
type: 'api' | 'text' | 'data' | 'image';
description?: string;
enabled: boolean;
// 文本类型
text_content?: string;
// 批量数据类型
data_content?: string;
// API 类型配置
api_config?: {
url: string;
method: 'GET' | 'POST';
timeout?: number;
headers?: string;
params?: string;
};
// 图片类型
image_url?: string;
// 通用配置
delay_seconds?: number;
// 多规格配置
is_multi_spec?: boolean;
spec_name?: string;
spec_value?: string;
created_at: string;
updated_at: string;
}
// Items
export interface Item {
id: string | number;
cookie_id: string;
item_id: string;
item_title?: string;
item_description?: string;
item_price?: string;
item_image?: string; // Inferred from common usage, though not explicitly in list model sometimes
item_category?: string;
item_detail?: string;
is_multi_spec?: number | boolean;
multi_quantity_delivery?: number | boolean;
is_multi_qty_ship?: number | boolean;
created_at?: string;
}
// Rules
export interface ShippingRule {
id: string;
name: string;
item_keyword: string; // Matches item title
cookie_id?: string;
item_id?: string;
item_title?: string;
card_group_id: number; // ID from Card list
card_group_name?: string; // UI helper
priority: number;
enabled: boolean;
variants: ShippingVariant[];
}
export interface ShippingVariant {
id?: string;
spec_name: string;
spec_value: string;
card_id: number;
card_name?: string;
card_type?: Card['type'];
delivery_count: number;
enabled: boolean;
}
export interface ReplyRule {
id: string;
keyword: string;
reply_content: string;
match_type: 'exact' | 'fuzzy';
enabled: boolean;
}
// Stats
export interface AdminStats {
total_users: number;
total_cookies: number;
active_cookies: number;
total_cards: number;
total_keywords: number;
total_orders: number;
}
export interface OrderAnalytics {
revenue_stats: {
total_amount: number;
total_orders: number;
};
daily_stats: Array<{ date: string; amount: number }>;
item_stats?: Array<{
item_id: string;
order_count: number;
total_amount: number;
avg_amount: number;
}>;
}
// Settings
export interface SystemSettings {
ai_model?: string;
ai_api_key?: string;
ai_api_url?: string;
ai_base_url?: string;
default_reply?: string;
registration_enabled?: boolean;
smtp_server?: string;
[key: string]: any;
}
export interface AIReplySettings {
ai_enabled: boolean;
model_name?: string;
api_key?: string;
base_url?: string;
max_discount_percent: number;
max_discount_amount?: number;
max_bargain_rounds: number;
custom_prompts: string;
}
// Default Reply
export interface DefaultReply {
cookie_id: string;
enabled: boolean;
reply_content: string;
reply_once: boolean;
reply_image_url?: string;
}
+155
View File
@@ -0,0 +1,155 @@
import path from 'path';
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
export default defineConfig({
base: '/static/',
server: {
port: 3000,
host: '0.0.0.0',
proxy: {
// 代理API请求到后端
'/api': {
target: 'http://localhost:8080',
changeOrigin: true,
},
// 代理其他后端请求
'/cookies': {
target: 'http://localhost:8080',
changeOrigin: true,
},
'/account': {
target: 'http://localhost:8080',
changeOrigin: true,
},
'/qr-login': {
target: 'http://localhost:8080',
changeOrigin: true,
},
'/password-login': {
target: 'http://localhost:8080',
changeOrigin: true,
},
'/keywords': {
target: 'http://localhost:8080',
changeOrigin: true,
},
'/keywords-with-item-id': {
target: 'http://localhost:8080',
changeOrigin: true,
},
'/default-reply': {
target: 'http://localhost:8080',
changeOrigin: true,
},
'/items': {
target: 'http://localhost:8080',
changeOrigin: true,
},
'/cards': {
target: 'http://localhost:8080',
changeOrigin: true,
},
'/delivery-rules': {
target: 'http://localhost:8080',
changeOrigin: true,
},
'/notification-channels': {
target: 'http://localhost:8080',
changeOrigin: true,
},
'/message-notifications': {
target: 'http://localhost:8080',
changeOrigin: true,
},
'/ai-reply-settings': {
target: 'http://localhost:8080',
changeOrigin: true,
},
'/ai-models': {
target: 'http://localhost:8080',
changeOrigin: true,
},
'/system-settings': {
target: 'http://localhost:8080',
changeOrigin: true,
},
'/user-settings': {
target: 'http://localhost:8080',
changeOrigin: true,
},
'/admin': {
target: 'http://localhost:8080',
changeOrigin: true,
},
'/analytics': {
target: 'http://localhost:8080',
changeOrigin: true,
},
'/backup': {
target: 'http://localhost:8080',
changeOrigin: true,
},
'/logs': {
target: 'http://localhost:8080',
changeOrigin: true,
},
'/login': {
target: 'http://localhost:8080',
changeOrigin: true,
},
'/verify': {
target: 'http://localhost:8080',
changeOrigin: true,
},
'/logout': {
target: 'http://localhost:8080',
changeOrigin: true,
},
'/register': {
target: 'http://localhost:8080',
changeOrigin: true,
},
'/generate-captcha': {
target: 'http://localhost:8080',
changeOrigin: true,
},
'/verify-captcha': {
target: 'http://localhost:8080',
changeOrigin: true,
},
'/geetest': {
target: 'http://localhost:8080',
changeOrigin: true,
},
'/send-verification-code': {
target: 'http://localhost:8080',
changeOrigin: true,
},
'/change-password': {
target: 'http://localhost:8080',
changeOrigin: true,
},
'/health': {
target: 'http://localhost:8080',
changeOrigin: true,
},
},
},
plugins: [react()],
resolve: {
alias: {
'@': path.resolve(__dirname, '.'),
},
},
build: {
outDir: '../internal/webui/static',
sourcemap: false,
rollupOptions: {
output: {
manualChunks: undefined,
},
},
emptyOutDir: true,
},
});
@@ -0,0 +1,461 @@
var J4=Object.defineProperty;var eM=(e,t,n)=>t in e?J4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Qc=(e,t,n)=>eM(e,typeof t!="symbol"?t+"":t,n);function tM(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const l in r)if(l!=="default"&&!(l in e)){const s=Object.getOwnPropertyDescriptor(r,l);s&&Object.defineProperty(e,l,s.get?s:{enumerable:!0,get:()=>r[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const s of l)if(s.type==="childList")for(const d of s.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&r(d)}).observe(document,{childList:!0,subtree:!0});function n(l){const s={};return l.integrity&&(s.integrity=l.integrity),l.referrerPolicy&&(s.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?s.credentials="include":l.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(l){if(l.ep)return;l.ep=!0;const s=n(l);fetch(l.href,s)}})();function Pp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $v={exports:{}},Ms={};/**
* @license React
* react-jsx-runtime.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var qw;function nM(){if(qw)return Ms;qw=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,l,s){var d=null;if(s!==void 0&&(d=""+s),l.key!==void 0&&(d=""+l.key),"key"in l){s={};for(var f in l)f!=="key"&&(s[f]=l[f])}else s=l;return l=s.ref,{$$typeof:e,type:r,key:d,ref:l!==void 0?l:null,props:s}}return Ms.Fragment=t,Ms.jsx=n,Ms.jsxs=n,Ms}var Kw;function rM(){return Kw||(Kw=1,$v.exports=nM()),$v.exports}var c=rM(),Iv={exports:{}},Ce={};/**
* @license React
* react.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Yw;function aM(){if(Yw)return Ce;Yw=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),d=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),x=Symbol.iterator;function w(E){return E===null||typeof E!="object"?null:(E=x&&E[x]||E["@@iterator"],typeof E=="function"?E:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,N={};function O(E,L,K){this.props=E,this.context=L,this.refs=N,this.updater=K||j}O.prototype.isReactComponent={},O.prototype.setState=function(E,L){if(typeof E!="object"&&typeof E!="function"&&E!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,E,L,"setState")},O.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function A(){}A.prototype=O.prototype;function D(E,L,K){this.props=E,this.context=L,this.refs=N,this.updater=K||j}var k=D.prototype=new A;k.constructor=D,_(k,O.prototype),k.isPureReactComponent=!0;var z=Array.isArray;function M(){}var $={H:null,A:null,T:null,S:null},U=Object.prototype.hasOwnProperty;function V(E,L,K){var ie=K.ref;return{$$typeof:e,type:E,key:L,ref:ie!==void 0?ie:null,props:K}}function R(E,L){return V(E.type,L,E.props)}function F(E){return typeof E=="object"&&E!==null&&E.$$typeof===e}function Z(E){var L={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(K){return L[K]})}var he=/\/+/g;function fe(E,L){return typeof E=="object"&&E!==null&&E.key!=null?Z(""+E.key):L.toString(36)}function se(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(M,M):(E.status="pending",E.then(function(L){E.status==="pending"&&(E.status="fulfilled",E.value=L)},function(L){E.status==="pending"&&(E.status="rejected",E.reason=L)})),E.status){case"fulfilled":return E.value;case"rejected":throw E.reason}}throw E}function q(E,L,K,ie,me){var ve=typeof E;(ve==="undefined"||ve==="boolean")&&(E=null);var je=!1;if(E===null)je=!0;else switch(ve){case"bigint":case"string":case"number":je=!0;break;case"object":switch(E.$$typeof){case e:case t:je=!0;break;case y:return je=E._init,q(je(E._payload),L,K,ie,me)}}if(je)return me=me(E),je=ie===""?"."+fe(E,0):ie,z(me)?(K="",je!=null&&(K=je.replace(he,"$&/")+"/"),q(me,L,K,"",function(we){return we})):me!=null&&(F(me)&&(me=R(me,K+(me.key==null||E&&E.key===me.key?"":(""+me.key).replace(he,"$&/")+"/")+je)),L.push(me)),1;je=0;var Te=ie===""?".":ie+":";if(z(E))for(var de=0;de<E.length;de++)ie=E[de],ve=Te+fe(ie,de),je+=q(ie,L,K,ve,me);else if(de=w(E),typeof de=="function")for(E=de.call(E),de=0;!(ie=E.next()).done;)ie=ie.value,ve=Te+fe(ie,de++),je+=q(ie,L,K,ve,me);else if(ve==="object"){if(typeof E.then=="function")return q(se(E),L,K,ie,me);throw L=String(E),Error("Objects are not valid as a React child (found: "+(L==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":L)+"). If you meant to render a collection of children, use an array instead.")}return je}function te(E,L,K){if(E==null)return E;var ie=[],me=0;return q(E,ie,"","",function(ve){return L.call(K,ve,me++)}),ie}function re(E){if(E._status===-1){var L=E._result;L=L(),L.then(function(K){(E._status===0||E._status===-1)&&(E._status=1,E._result=K)},function(K){(E._status===0||E._status===-1)&&(E._status=2,E._result=K)}),E._status===-1&&(E._status=0,E._result=L)}if(E._status===1)return E._result.default;throw E._result}var X=typeof reportError=="function"?reportError:function(E){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var L=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof E=="object"&&E!==null&&typeof E.message=="string"?String(E.message):String(E),error:E});if(!window.dispatchEvent(L))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",E);return}console.error(E)},T={map:te,forEach:function(E,L,K){te(E,function(){L.apply(this,arguments)},K)},count:function(E){var L=0;return te(E,function(){L++}),L},toArray:function(E){return te(E,function(L){return L})||[]},only:function(E){if(!F(E))throw Error("React.Children.only expected to receive a single React element child.");return E}};return Ce.Activity=p,Ce.Children=T,Ce.Component=O,Ce.Fragment=n,Ce.Profiler=l,Ce.PureComponent=D,Ce.StrictMode=r,Ce.Suspense=h,Ce.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=$,Ce.__COMPILER_RUNTIME={__proto__:null,c:function(E){return $.H.useMemoCache(E)}},Ce.cache=function(E){return function(){return E.apply(null,arguments)}},Ce.cacheSignal=function(){return null},Ce.cloneElement=function(E,L,K){if(E==Line truncated
* @license React
* scheduler.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Vw;function lM(){return Vw||(Vw=1,(function(e){function t(q,te){var re=q.length;q.push(te);e:for(;0<re;){var X=re-1>>>1,T=q[X];if(0<l(T,te))q[X]=te,q[re]=T,re=X;else break e}}function n(q){return q.length===0?null:q[0]}function r(q){if(q.length===0)return null;var te=q[0],re=q.pop();if(re!==te){q[0]=re;e:for(var X=0,T=q.length,E=T>>>1;X<E;){var L=2*(X+1)-1,K=q[L],ie=L+1,me=q[ie];if(0>l(K,re))ie<T&&0>l(me,K)?(q[X]=me,q[ie]=re,X=ie):(q[X]=K,q[L]=re,X=L);else if(ie<T&&0>l(me,re))q[X]=me,q[ie]=re,X=ie;else break e}}return te}function l(q,te){var re=q.sortIndex-te.sortIndex;return re!==0?re:q.id-te.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var d=Date,f=d.now();e.unstable_now=function(){return d.now()-f}}var h=[],m=[],y=1,p=null,x=3,w=!1,j=!1,_=!1,N=!1,O=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;function k(q){for(var te=n(m);te!==null;){if(te.callback===null)r(m);else if(te.startTime<=q)r(m),te.sortIndex=te.expirationTime,t(h,te);else break;te=n(m)}}function z(q){if(_=!1,k(q),!j)if(n(h)!==null)j=!0,M||(M=!0,Z());else{var te=n(m);te!==null&&se(z,te.startTime-q)}}var M=!1,$=-1,U=5,V=-1;function R(){return N?!0:!(e.unstable_now()-V<U)}function F(){if(N=!1,M){var q=e.unstable_now();V=q;var te=!0;try{e:{j=!1,_&&(_=!1,A($),$=-1),w=!0;var re=x;try{t:{for(k(q),p=n(h);p!==null&&!(p.expirationTime>q&&R());){var X=p.callback;if(typeof X=="function"){p.callback=null,x=p.priorityLevel;var T=X(p.expirationTime<=q);if(q=e.unstable_now(),typeof T=="function"){p.callback=T,k(q),te=!0;break t}p===n(h)&&r(h),k(q)}else r(h);p=n(h)}if(p!==null)te=!0;else{var E=n(m);E!==null&&se(z,E.startTime-q),te=!1}}break e}finally{p=null,x=re,w=!1}te=void 0}}finally{te?Z():M=!1}}}var Z;if(typeof D=="function")Z=function(){D(F)};else if(typeof MessageChannel<"u"){var he=new MessageChannel,fe=he.port2;he.port1.onmessage=F,Z=function(){fe.postMessage(null)}}else Z=function(){O(F,0)};function se(q,te){$=O(function(){q(e.unstable_now())},te)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(q){q.callback=null},e.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<q?Math.floor(1e3/q):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(q){switch(x){case 1:case 2:case 3:var te=3;break;default:te=x}var re=x;x=te;try{return q()}finally{x=re}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(q,te){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var re=x;x=q;try{return te()}finally{x=re}},e.unstable_scheduleCallback=function(q,te,re){var X=e.unstable_now();switch(typeof re=="object"&&re!==null?(re=re.delay,re=typeof re=="number"&&0<re?X+re:X):re=X,q){case 1:var T=-1;break;case 2:T=250;break;case 5:T=1073741823;break;case 4:T=1e4;break;default:T=5e3}return T=re+T,q={id:y++,callback:te,priorityLevel:q,startTime:re,expirationTime:T,sortIndex:-1},re>X?(q.sortIndex=re,t(m,q),n(h)===null&&q===n(m)&&(_?(A($),$=-1):_=!0,se(z,re-X))):(q.sortIndex=T,t(h,q),j||w||(j=!0,M||(M=!0,Z()))),q},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(q){var te=x;return function(){var re=x;x=te;try{return q.apply(this,arguments)}finally{x=re}}}})(Bv)),Bv}var Xw;function oM(){return Xw||(Xw=1,Lv.exports=lM()),Lv.exports}var Uv={exports:{}},an={};/**
* @license React
* react-dom.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Fw;function sM(){if(Fw)return an;Fw=1;var e=No();function t(h){var m="https://react.dev/errors/"+h;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)m+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+h+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},l=Symbol.for("react.portal");function s(h,m,y){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:p==null?null:""+p,children:h,containerInfo:m,implementation:y}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(h,m){if(h==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return an.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,an.createPortal=function(h,m){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(t(299));return s(h,m,null,y)},an.flushSync=function(h){var m=d.T,y=r.p;try{if(d.T=null,r.p=2,h)return h()}finally{d.T=m,r.p=y,r.d.f()}},an.preconnect=function(h,m){typeof h=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,r.d.C(h,m))},an.prefetchDNS=function(h){typeof h=="string"&&r.d.D(h)},an.preinit=function(h,m){if(typeof h=="string"&&m&&typeof m.as=="string"){var y=m.as,p=f(y,m.crossOrigin),x=typeof m.integrity=="string"?m.integrity:void 0,w=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;y==="style"?r.d.S(h,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:p,integrity:x,fetchPriority:w}):y==="script"&&r.d.X(h,{crossOrigin:p,integrity:x,fetchPriority:w,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},an.preinitModule=function(h,m){if(typeof h=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var y=f(m.as,m.crossOrigin);r.d.M(h,{crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&r.d.M(h)},an.preload=function(h,m){if(typeof h=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var y=m.as,p=f(y,m.crossOrigin);r.d.L(h,y,{crossOrigin:p,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},an.preloadModule=function(h,m){if(typeof h=="string")if(m){var y=f(m.as,m.crossOrigin);r.d.m(h,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else r.d.m(h)},an.requestFormReset=function(h){r.d.r(h)},an.unstable_batchedUpdates=function(h,m){return h(m)},an.useFormState=function(h,m,y){return d.H.useFormState(h,m,y)},an.useFormStatus=function(){return d.H.useHostTransitionStatus()},an.version="19.2.7",an}var Zw;function GN(){if(Zw)return Uv.exports;Zw=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Uv.exports=sM(),Uv.exports}/**
* @license React
* react-dom-client.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Ww;function uM(){if(Ww)return Ts;Ww=1;var e=oM(),t=No(),n=GN();function r(a){var i="https://react.dev/errors/"+a;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)i+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+a+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function s(a){var i=a,o=a;if(a.alternate)for(;i.return;)i=i.return;else{a=i;do i=a,(i.flags&4098)!==0&&(o=i.return),a=i.return;while(a)}return i.tag===3?o:null}function d(a){if(a.tag===13){var i=a.memoizedState;if(i===null&&(a=a.alternate,a!==null&&(i=a.memoizedState)),i!==null)return i.dehydrated}return null}function f(a){if(a.tag===31){var i=a.memoizedState;if(i===null&&(a=a.alternate,a!==null&&(i=a.memoizedState)),i!==null)return i.dehydrated}return null}function h(a){if(s(a)!==a)throw Error(r(188))}function m(a){var i=a.alternate;if(!i){if(i=s(a),i===null)throw Error(r(188));return i!==a?null:a}for(var o=a,u=i;;){var v=o.return;if(v===null)break;var g=v.alternate;if(g===null){if(u=v.return,u!==null){o=u;continue}break}if(v.child===g.child){for(g=v.child;g;){if(g===o)return h(v),a;if(g===u)return h(v),i;g=g.sibling}throw Error(r(188))}if(o.return!==u.return)o=v,u=g;else{for(var S=!1,C=v.child;C;){if(C===o){S=!0,o=v,u=g;break}if(C===u){S=!0,u=v,o=g;break}C=C.sibling}if(!S){for(C=g.child;C;){if(C===o){S=!0,o=g,u=v;break}if(C===u){S=!0,u=g,o=v;break}C=C.sibling}if(!S)throw Error(r(189))}}if(o.alternate!==u)throw Error(r(190))}if(o.tag!==3)throw Error(r(188));return o.stateNode.current===o?a:i}function y(a){var i=a.tag;if(i===5||i===26||i===27||i===6)return a;for(a=a.child;a!==null;){if(i=y(a),i!==null)return i;a=a.sibling}return null}var p=Object.assign,x=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),D=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),R=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function Z(a){return a===null||typeof a!="object"?null:(a=F&&a[F]||a["@@iterator"],typeof a=="function"?a:null)}var he=Symbol.for("react.client.reference");function fe(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===he?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case _:return"Fragment";case O:return"Profiler";case N:return"StrictMode";case z:return"Suspense";case M:return"SuspenseList";case V:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case j:return"Portal";case D:return a.displayName||"Context";case A:return(a._context.displayName||"Context")+".Consumer";case k:var i=a.render;return a=a.displayName,a||(a=i.displayName||i.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case $:return i=a.displayName||null,i!==null?i:fe(a.type)||"Memo";case U:i=a._payload,a=a._init;try{return fe(a(i))}catch{}}return null}var se=Array.isArray,q=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},X=[],T=-1;function E(a){return{current:a}}function L(a){0>T||(a.current=X[T],X[T]=null,T--)}function K(a,i){T++,X[T]=a.current,a.current=i}var ie=E(null),me=E(null),ve=E(null),je=E(null);function Te(a,i){switch(K(ve,i),K(me,a),K(ie,null),i.nodeType){case 9:case 11:a=(a=i.documentElement)&&(a=a.namespaceURI)?fw(a):0;break;default:if(a=i.tagName,i=i.namespaceURI)i=fw(i),a=hw(i,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}L(ie),K(ie,a)}function de(){L(ie),L(me),L(ve)}function we(a){a.memoizedState!==null&&K(je,a);var i=ie.current,o=hw(i,a.type);i!==o&&(K(me,a),K(ie,o))}function be(a){me.current===a&&(L(ie),L(me)),je.current===a&&(L(je),Os._currentValue=re)}var ue,$e;function ke(a){if(ue===void 0)try{throw Error()}catch(o){var i=o.stack.trim().match(/\n( *(at )?)/);ue=i&&i[1]||"",$e=-1<o.stack.indexOf(`
at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
`+ue+a+$e}var Se=!1;function st(a,i){if(!a||Se)return"";Se=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(i){var oe=function(){throw Error()};if(Object.defineProperty(oe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(oe,[])}catch(ee){var J=ee}Reflect.construct(a,[],oe)}else{try{oe.call()}catch(ee){J=ee}a.call(oe.prototype)}}else{try{throw Error()}catch(ee){J=ee}(oe=a())&&typeof oe.catch=="function"&&oe.catch(function(){})}}catch(ee){if(ee&&J&&typeof ee.stack=="string")return[ee.stack,J.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var v=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");v&&v.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=u.DetermineComponentFrameRoot(),S=g[0],C=g[1];if(S&&C){var I=S.split(`
`),Q=C.split(`
`);for(v=u=0;u<I.length&&!I[u].includes("DetermineComponentFrameRoot");)u++;for(;v<Q.length&&!Q[v].includes("DetermineComponentFrameRoot");)v++;if(u===I.length||v===Q.length)for(u=I.length-1,v=Q.length-1;1<=u&&0<=v&&I[u]!==Q[v];)v--;for(;1<=u&&0<=v;u--,v--)if(I[u]!==Q[v]){if(u!==1||v!==1)do if(u--,v--,0>v||I[u]!==Q[v]){var ae=`
`+I[u].replace(" at new "," at ");return a.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",a.displayName)),ae}while(1<=u&&0<=v);break}}}finally{Se=!1,Error.prepareStackTrace=o}return(o=a?a.displayName||a.name:"")?ke(o):""}function Pe(a,i){switch(a.tag){case 26:case 27:case 5:return ke(a.type);case 16:return ke("Lazy");case 13:return a.child!==i&&i!==null?ke("Suspense Fallback"):ke("Suspense");case 19:return ke("SuspenseList");case 0:case 15:return st(a.type,!1);case 11:return st(a.type.render,!1);case 1:return st(a.type,!0);case 31:return ke("Activity");default:return""}}function Cn(a){try{var i="",o=null;do i+=Pe(a,o),o=a,a=a.return;while(a);return i}catch(u){return`
Error generating stack: `+u.message+`
`+u.stack}}var hr=Object.prototype.hasOwnProperty,gn=e.unstable_scheduleCallback,ne=e.unstable_cancelCallback,Ee=e.unstable_shouldYield,Ie=e.unstable_requestPaint,H=e.unstable_now,P=e.unstable_getCurrentPriorityLevel,ce=e.unstable_ImmediatePriority,Re=e.unstable_UserBlockingPriority,gt=e.unstable_NormalPriority,Gn=e.unstable_LowPriority,mn=e.unstable_IdlePriority,Vn=e.log,ml=e.unstable_setDisableYieldValue,Lo=null,Mn=null;function Ea(a){if(typeof Vn=="function"&&ml(a),Mn&&typeof Mn.setStrictMode=="function")try{Mn.setStrictMode(Lo,a)}catch{}}var Tn=Math.clz32?Math.clz32:L3,I3=Math.log,R3=Math.LN2;function L3(a){return a>>>=0,a===0?32:31-(I3(a)/R3|0)|0}var $u=256,Iu=262144,Ru=4194304;function yi(a){var i=a&42;if(i!==0)return i;switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function Lu(a,i,o){var u=a.pendingLanes;if(u===0)return 0;var v=0,g=a.suspendedLanes,S=a.pingedLanes;a=a.warmLanes;var C=u&134217727;return C!==0?(u=C&~g,u!==0?v=yi(u):(S&=C,S!==0?v=yi(S):o||(o=C&~a,o!==0&&(v=yi(o))))):(C=u&~g,C!==0?v=yi(C):S!==0?v=yi(S):o||(o=u&~a,o!==0&&(v=yi(o)))),v===0?0:i!==0&&i!==v&&(i&g)===0&&(g=v&-v,o=i&-i,g>=o||g===32&&(o&4194048)!==0)?i:v}function Bo(a,i){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&i)===0}function B3(a,i){switch(a){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Vg(){var a=Ru;return Ru<<=1,(Ru&62914560)===0&&(Ru=4194304),a}function Sh(a){for(var i=[],o=0;31>o;o++)i.push(a);return i}function Uo(a,i){a.pendingLanes|=i,i!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function U3(a,i,o,u,v,g){var S=a.pendingLanes;a.pendingLanes=o,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=o,a.entangledLanes&=o,a.errorRecoveryDisabledLanes&=o,a.shellSuspendCounter=0;var C=a.entanglements,I=a.expirationTimes,Q=a.hiddenUpdates;for(o=S&~o;0<o;){var ae=31-Tn(o),oe=1<<ae;C[ae]=0,I[ae]=-1;var J=Q[ae];if(J!==null)for(Q[ae]=null,ae=0;ae<J.length;ae++){var ee=J[ae];ee!==null&&(ee.lane&=-536870913)}o&=~oe}u!==0&&Xg(a,u,0),g!==0&&v===0&&a.tag!==0&&(a.suspendedLanes|=g&~(S&~i))}function Xg(a,i,o){a.pendingLanes|=i,a.suspendedLanes&=~i;var u=31-Tn(i);a.entangledLanes|=i,a.entanglements[u]=a.entanglements[u]|1073741824|o&261930}function Fg(a,i){var o=a.entangledLanes|=i;for(a=a.entanglements;o;){var u=31-Tn(o),v=1<<u;v&i|a[u]&i&&(a[u]|=i),o&=~v}}function Zg(a,i){var o=i&-i;return o=(o&42)!==0?1:Nh(o),(o&(a.suspendedLanes|i))!==0?0:o}function Nh(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function Ah(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function Wg(){var a=te.p;return a!==0?a:(a=window.event,a===void 0?32:$w(a.type))}function Qg(a,i){var o=te.p;try{return te.p=a,i()}finally{te.p=o}}var ka=Math.random().toString(36).slice(2),Zt="__reactFiber$"+ka,xn="__reactProps$"+ka,vl="__reactContainer$"+ka,Oh="__reactEvents$"+ka,H3="__reactListeners$"+ka,q3="__reactHandles$"+ka,Jg="__reactResources$"+ka,Ho="__reactMarker$"+ka;function Eh(a){delete a[Zt],delete a[xn],delete a[Oh],delete a[H3],delete a[q3]}function yl(a){var i=a[Zt];if(i)return i;for(var o=a.parentNode;o;){if(i=o[vl]||o[Zt]){if(o=i.alternate,i.child!==null||o!==null&&o.child!==null)for(a=bw(a);a!==null;){if(o=a[Zt])return o;a=bw(a)}return i}a=o,o=a.parentNode}return null}function pl(a){if(a=a[Zt]||a[vl]){var i=a.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return a}return null}function qo(a){var i=a.tag;if(i===5||i===26||i===27||i===6)return a.stateNode;throw Error(r(33))}function gl(a){var i=a[Jg];return i||(i=a[Jg]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function qt(a){a[Ho]=!0}var ex=new Set,tx={};function pi(a,i){xl(a,i),xl(a+"Capture",i)}function xl(a,i){for(tx[a]=i,a=0;a<i.length;a++)ex.add(i[a])}var K3=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u Line truncated
`).replace(w4,"")}function cw(a,i){return i=uw(i),uw(a)===i}function tt(a,i,o,u,v,g){switch(o){case"children":typeof u=="string"?i==="body"||i==="textarea"&&u===""||wl(a,u):(typeof u=="number"||typeof u=="bigint")&&i!=="body"&&wl(a,""+u);break;case"className":Uu(a,"class",u);break;case"tabIndex":Uu(a,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":Uu(a,o,u);break;case"style":cx(a,u,g);break;case"data":if(i!=="object"){Uu(a,"data",u);break}case"src":case"href":if(u===""&&(i!=="a"||o!=="href")){a.removeAttribute(o);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){a.removeAttribute(o);break}u=qu(""+u),a.setAttribute(o,u);break;case"action":case"formAction":if(typeof u=="function"){a.setAttribute(o,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof g=="function"&&(o==="formAction"?(i!=="input"&&tt(a,i,"name",v.name,v,null),tt(a,i,"formEncType",v.formEncType,v,null),tt(a,i,"formMethod",v.formMethod,v,null),tt(a,i,"formTarget",v.formTarget,v,null)):(tt(a,i,"encType",v.encType,v,null),tt(a,i,"method",v.method,v,null),tt(a,i,"target",v.target,v,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){a.removeAttribute(o);break}u=qu(""+u),a.setAttribute(o,u);break;case"onClick":u!=null&&(a.onclick=Vr);break;case"onScroll":u!=null&&Be("scroll",a);break;case"onScrollEnd":u!=null&&Be("scrollend",a);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(r(61));if(o=u.__html,o!=null){if(v.children!=null)throw Error(r(60));a.innerHTML=o}}break;case"multiple":a.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":a.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){a.removeAttribute("xlink:href");break}o=qu(""+u),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?a.setAttribute(o,""+u):a.removeAttribute(o);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":u&&typeof u!="function"&&typeof u!="symbol"?a.setAttribute(o,""):a.removeAttribute(o);break;case"capture":case"download":u===!0?a.setAttribute(o,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?a.setAttribute(o,u):a.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?a.setAttribute(o,u):a.removeAttribute(o);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?a.removeAttribute(o):a.setAttribute(o,u);break;case"popover":Be("beforetoggle",a),Be("toggle",a),Bu(a,"popover",u);break;case"xlinkActuate":Gr(a,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Gr(a,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Gr(a,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Gr(a,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Gr(a,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Gr(a,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Gr(a,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Gr(a,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Gr(a,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":Bu(a,"is",u);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=F3.get(o)||o,Bu(a,o,u))}}function gv(a,i,o,u,v,g){switch(o){case"style":cx(a,u,g);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(r(61));if(o=u.__html,o!=null){if(v.children!=null)throw Error(r(60));a.innerHTML=o}}break;case"children":typeof u=="string"?wl(a,u):(typeof u=="number"||typeof u=="bigint")&&wl(a,""+u);break;case"onScroll":u!=null&&Be("scroll",a);break;case"onScrollEnd":u!=null&&Be("scrollend",a);break;case"onClick":u!=null&&(a.onclick=Vr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"inne Line truncated
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const hM=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),mM=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Jw=e=>{const t=mM(e);return t.charAt(0).toUpperCase()+t.slice(1)},VN=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),vM=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/var yM={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const pM=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:l="",children:s,iconNode:d,...f},h)=>b.createElement("svg",{ref:h,...yM,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:VN("lucide",l),...!s&&!vM(f)&&{"aria-hidden":"true"},...f},[...d.map(([m,y])=>b.createElement(m,y)),...Array.isArray(s)?s:[s]]));/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ne=(e,t)=>{const n=b.forwardRef(({className:r,...l},s)=>b.createElement(pM,{ref:s,iconNode:t,className:VN(`lucide-${hM(Jw(e))}`,`lucide-${e}`,r),...l}));return n.displayName=Jw(e),n};/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const gM=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],ej=Ne("activity",gM);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const xM=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Ny=Ne("arrow-right",xM);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const bM=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],da=Ne("bot",bM);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const wM=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],XN=Ne("box",wM);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const jM=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ks=Ne("check",jM);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const _M=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],SM=Ne("chevron-down",_M);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const NM=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],AM=Ne("chevron-left",NM);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const OM=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],EM=Ne("chevron-right",OM);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const kM=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],tj=Ne("circle-alert",kM);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const CM=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],MM=Ne("circle-check",CM);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const TM=[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]],DM=Ne("circle-dashed",TM);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const PM=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],nj=Ne("clock",PM);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const zM=[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],Jc=Ne("cloud-upload",zM);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const $M=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],rj=Ne("code",$M);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const IM=[["line",{x1:"15",x2:"15",y1:"12",y2:"18",key:"1p7wdc"}],["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],aj=Ne("copy-plus",IM);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const RM=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],Ay=Ne("credit-card",RM);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const LM=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],BM=Ne("database",LM);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const UM=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],HM=Ne("dollar-sign",UM);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const qM=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],FN=Ne("external-link",qM);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const KM=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Ys=Ne("eye-off",KM);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const YM=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],oo=Ne("eye",YM);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const GM=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],ij=Ne("file-text",GM);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const VM=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],lj=Ne("image",VM);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const XM=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],Oy=Ne("key",XM);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const FM=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Ey=Ne("layers",FM);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ZM=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],WM=Ne("layout-dashboard",ZM);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const QM=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],JM=Ne("link-2",QM);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const eT=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],ri=Ne("loader-circle",eT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const tT=[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]],oj=Ne("lock-keyhole",tT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const nT=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],rT=Ne("lock",nT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const aT=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],iT=Ne("log-out",aT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const lT=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],oT=Ne("mail",lT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const sT=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],Ri=Ne("message-square",sT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const uT=[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]],ky=Ne("package-check",uT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const cT=[["path",{d:"M16 16h6",key:"100bgy"}],["path",{d:"M19 13v6",key:"85cyf1"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]],Hv=Ne("package-plus",cT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const dT=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],ZN=Ne("package",dT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const fT=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],bd=Ne("pen",fT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const hT=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Qi=Ne("plus",hT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const mT=[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],vT=Ne("power-off",mT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const yT=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],Cy=Ne("power",yT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const pT=[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]],sj=Ne("qr-code",pT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const gT=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],wr=Ne("refresh-cw",gT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const xT=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],va=Ne("save",xT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const bT=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],wT=Ne("search",bT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const jT=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],zp=Ne("settings",jT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const _T=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],WN=Ne("shield-check",_T);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ST=[["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}],["path",{d:"M3.103 6.034h17.794",key:"awc11p"}],["path",{d:"M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z",key:"o988cm"}]],QN=Ne("shopping-bag",ST);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const NT=[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]],uj=Ne("shopping-cart",NT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const AT=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],$p=Ne("sparkles",AT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const OT=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],Ip=Ne("square-pen",OT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ET=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],ii=Ne("trash-2",ET);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const kT=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],CT=Ne("trending-up",kT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const MT=[["path",{d:"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2",key:"wrbu53"}],["path",{d:"M15 18H9",key:"1lyqi6"}],["path",{d:"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14",key:"lysw3i"}],["circle",{cx:"17",cy:"18",r:"2",key:"332jqn"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}]],Fs=Ne("truck",MT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const TT=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],DT=Ne("upload",TT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const PT=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],zT=Ne("user-round",PT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const $T=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],My=Ne("user",$T);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const IT=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],JN=Ne("users",IT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const RT=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],sn=Ne("x",RT),LT=({activeTab:e,setActiveTab:t,onLogout:n})=>{const r=[{id:"dashboard",icon:WM,label:"仪表盘"},{id:"accounts",icon:JN,label:"账号管理"},{id:"orders",icon:QN,label:"订单管理"},{id:"cards",icon:Ay,label:"卡密库存"},{id:"items",icon:XN,label:"商品列表"},{id:"keywords",icon:Ri,label:"自动化规则"},{id:"settings",icon:zp,label:"系统与AI"}];return c.jsxs("div",{className:"w-64 h-screen fixed left-0 top-0 bg-white border-r border-gray-100 flex flex-col justify-between z-20 shadow-[4px_0_24px_rgba(0,0,0,0.02)]",children:[c.jsxs("div",{className:"p-6",children:[c.jsxs("div",{className:"flex items-center gap-3 mb-12 px-2",children:[c.jsx("div",{className:"w-10 h-10 bg-[#0094f7] squircle flex items-center justify-center shrink-0 p-1.5",style:{filter:"drop-shadow(0 4px 12px rgba(0,148,247,0.25))"},children:c.jsx("img",{src:"/static/ydisks-logo.svg",alt:"Ydisks",className:"w-full h-full"})}),c.jsxs("h1",{className:"text-xl font-extrabold tracking-tight text-gray-900",children:["Ydisks闲鱼助手 ",c.jsx("span",{className:"text-xs bg-[#0094f7] text-white px-1.5 py-0.5 rounded ml-1",children:"PRO"})]})]}),c.jsx("nav",{className:"space-y-2",children:r.map(l=>{const s=l.icon,d=e===l.id;return c.jsxs("button",{onClick:()=>t(l.id),className:`w-full flex items-center gap-3 px-4 py-3.5 rounded-2xl transition-all duration-300 group relative overflow-hidden ${d?"bg-[#0094f7] text-white font-bold shadow-lg shadow-blue-100 transform scale-[1.02]":"text-gray-500 hover:bg-gray-50 hover:text-gray-900"}`,children:[c.jsx(s,{className:`w-5 h-5 transition-colors ${d?"text-white":"text-gray-400 group-hover:text-gray-600"}`}),c.jsx("span",{className:"text-sm tracking-wide",children:l.label}),d&&c.jsx($p,{className:"w-4 h-4 absolute right-3 text-white/30 animate-pulse"})]},l.id)})})]}),c.jsx("div",{className:"p-6 border-t border-gray-50",children:c.jsxs("button",{onClick:n,className:"w-full flex items-center gap-3 px-4 py-3 text-gray-500 hover:text-red-500 hover:bg-red-50 rounded-2xl transition-all duration-200 font-medium",children:[c.jsx(iT,{className:"w-5 h-5"}),c.jsx("span",{className:"text-sm",children:"退出登录"})]})})]})},BT=e=>{if(!e)return"";const t=new URLSearchParams;for(const[r,l]of Object.entries(e))l!=null&&t.set(r,String(l));const n=t.toString();return n?`?${n}`:""},kf=async(e,t,n={})=>{const r=BT(n.params),l=`${t}${r}`,s=await fetch(l,{method:e,credentials:"include",headers:{...n.body===void 0?{}:{"Content-Type":"application/json"}},body:n.body===void 0?void 0:JSON.stringify(n.body)}),f=(s.headers.get("content-type")||"").includes("application/json");if(!s.ok){const h=f?await s.json().catch(()=>{}):await s.text().catch(()=>{}),m=typeof h=="string"?h:(h==null?void 0:h.detail)||(h==null?void 0:h.message)||(h==null?void 0:h.msg);throw new Error(m||`请求失败: ${s.status}`)}return f?await s.json():await s.text()},Pt=async(e,t)=>kf("GET",e,{params:t}),cn=async(e,t)=>kf("POST",e,{body:t}),dn=async(e,t)=>kf("PUT",e,{body:t}),Ao=async(e,t)=>kf("DELETE",e,{params:t}),eA=async(e,t)=>{const n=await fetch(e,{method:"POST",credentials:"include",body:t}),s=(n.headers.get("content-type")||"").includes("application/json")?await n.json().catch(()=>{}):await n.text().catch(()=>{});if(!n.ok){const d=typeof s=="string"?s:(s==null?void 0:s.detail)||(s==null?void 0:s.message)||(s==null?void 0:s.msg),f=new Error(d||"请求失败: "+n.status);throw f.payload=s,f}return s},UT=async e=>cn("/login",e),tA=async()=>Pt("/verify"),HT=async e=>dn("/account/credentials",e),qT=async(e,t)=>cn("/cookies",{id:e,value:t}),KT=(e,t)=>{const n=e.avatar_url||"";if(!n)return"";try{const r=new URL(n,window.location.origin);return r.hostname.endsWith("alicdn.com")&&r.searchParams.set("_v",t),r.toString()}catch{return n}},Rp=async()=>{const e=await Pt("/cookies/details"),t=Date.now().toString();return e.map(n=>({id:n.id,value:"",cookie:"",enabled:n.enabled,auto_confirm:n.auto_confirm,remark:n.remark,note:n.remark,pause_duration:n.pause_duration,username:n.username||"",login_password:"",show_browser:n.show_browser,nickname:n.nickname||n.remark||`账号 ${n.id.substring(0,6)}`,avatar_url:KT(n,t),profile_error:n.profile_error||"",ai_enabled:!1}))},YT=async()=>Pt("/cookies/runtime-status"),GT=async()=>cn("/qr-login/generate"),VT=async e=>Pt(`/qr-login/check/${e}`),XT=async(e,t)=>dn(`/cookies/${e}/status`,{enabled:t}),FT=async e=>Ao(`/cookies/${e}`),ZT=async(e,t)=>dn(`/cookies/${e}/remark`,{remark:t}),WT=async(e,t)=>dn(`/cookies/${e}/auto-confirm`,{auto_confirm:t}),QT=async(e,t)=>dn(`/cookies/${e}/pause-duration`,{pause_duration:t}),JT=async(e,t)=>dn(`/cookies/${e}`,{id:e,value:t}),eD=async(e,t)=>dn(`/cookies/${e}/login-info`,t),tD=async()=>Pt("/ai-reply-settings"),cj=async(e,t,n=1,r=20)=>{const l={page:n,page_size:r};t&&t!=="all"&&(l.status=t);const s=await Pt("/api/orders",l),f=(s.orders||s.data||[]).map(h=>({...h,id:h.id||h.order_id,Line truncated
A`).concat(s,",").concat(s,",0,1,1,").concat(2*d,",").concat(l,`
H`).concat(or,"M").concat(2*d,",").concat(l,`
A`).concat(s,",").concat(s,",0,1,1,").concat(d,",").concat(l),className:"recharts-legend-icon"});if(h==="rect")return b.createElement("path",{stroke:"none",fill:f,d:"M0,".concat(or/8,"h").concat(or,"v").concat(or*3/4,"h").concat(-or,"z"),className:"recharts-legend-icon"});if(b.isValidElement(t.legendIcon)){var m=CA({},t);return delete m.legendIcon,b.cloneElement(t.legendIcon,m)}return b.createElement(EA,{fill:f,cx:l,cy:l,size:or,sizeType:"diameter",type:h})}function QP(e){var t=e.payload,n=e.iconSize,r=e.layout,l=e.formatter,s=e.inactiveColor,d=e.iconType,f=e.labelStyle,h={x:0,y:0,width:or,height:or},m={display:r==="horizontal"?"inline-block":"block",marginRight:10},y={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((p,x)=>{var w=p.formatter||l,j=Ze({"recharts-legend-item":!0,["legend-item-".concat(x)]:!0,inactive:p.inactive});if(p.type==="none")return null;var _=typeof f=="object"?CA({},f):{};_.color=p.inactive?s:_.color||p.color;var N=w?w(p.value,p,x):p.value;return b.createElement("li",zd({className:j,style:m,key:"legend-item-".concat(x)},yu(e,p,x)),b.createElement(Bp,{width:n,height:n,viewBox:h,style:y,"aria-label":"".concat(p.value," legend icon")},b.createElement(WP,{data:p,iconType:d,inactiveColor:s})),b.createElement("span",{className:"recharts-legend-item-text",style:_},N))})}var JP=e=>{var t=Vt(e,FP),n=t.payload,r=t.layout,l=t.align;if(!n||!n.length)return null;var s={padding:0,margin:0,textAlign:r==="horizontal"?l:"left"};return b.createElement("ul",{className:"recharts-default-legend",style:s},b.createElement(QP,zd({},t,{payload:n})))};function e6(e,t){const n=new Map;for(let r=0;r<e.length;r++){const l=e[r],s=t(l,r,e);n.has(s)||n.set(s,l)}return Array.from(n.values())}function t6(e,t){return function(...n){return e.apply(this,n.slice(0,t))}}function MA(e){return e}function n6(e){return function(t){return Ir(t,e)}}function By(e){return e==null||typeof e!="object"&&typeof e!="function"}function r6(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function a6(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function Vp(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const i6="[object RegExp]",TA="[object String]",DA="[object Number]",PA="[object Boolean]",zA="[object Arguments]",l6="[object Symbol]",o6="[object Date]",s6="[object Map]",u6="[object Set]",c6="[object Array]",d6="[object ArrayBuffer]",f6="[object Object]",h6="[object DataView]",m6="[object Uint8Array]",v6="[object Uint8ClampedArray]",y6="[object Uint16Array]",p6="[object Uint32Array]",g6="[object Int8Array]",x6="[object Int16Array]",b6="[object Int32Array]",w6="[object Float32Array]",j6="[object Float64Array]",jj=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function _6(e){return typeof jj.Buffer<"u"&&jj.Buffer.isBuffer(e)}function S6(e,t){return qi(e,void 0,e,new Map,t)}function qi(e,t,n,r=new Map,l=void 0){const s=l==null?void 0:l(e,t,n,r);if(s!==void 0)return s;if(By(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){const d=new Array(e.length);r.set(e,d);for(let f=0;f<e.length;f++)d[f]=qi(e[f],f,n,r,l);return Object.hasOwn(e,"index")&&(d.index=e.index),Object.hasOwn(e,"input")&&(d.input=e.input),d}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const d=new RegExp(e.source,e.flags);return d.lastIndex=e.lastIndex,d}if(e instanceof Map){const d=new Map;r.set(e,d);for(const[f,h]of e)d.set(f,qi(h,f,n,r,l));return d}if(e instanceof Set){const d=new Set;r.set(e,d);for(const f of e)d.add(qi(f,void 0,n,r,l));return d}if(_6(e))return e.subarray();if(r6(e)){const d=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,d);for(let f=0;f<e.length;f++)d[f]=qi(e[f],f,n,r,l);return d}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const d=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,d),pr(d,e,n,r,l),d}if(typeof File<"u"&&e instanceof File){const d=new File([e],e.name,{type:e.type});return r.set(e,d),pr(d,e,n,r,l),d}if(typeof Blob<"u"&&e instanceof Blob){const d=new Blob([e],{type:e.type});return r.set(e,d),pr(d,e,n,r,l),d}if(e instanceof Error){const d=structuredClone(e);return r.set(e,d),d.message=e.message,d.name=e.name,d.stack=e.stack,d.cause=e.cause,d.constructor=e.constructor,pr(d,e,n,r,l),d}if(e instanceof Boolean){const d=new Boolean(e.valueOf());return r.set(e,d),pr(d,e,n,r,l),d}if(e instanceof Number){const d=new Number(e.valueOf());return r.set(e,d),pr(d,e,n,r,l),d}if(e instanceof String){const d=new String(e.valueOf());return r.set(e,d),pr(d,e,n,r,l),d}if(typeof e=="object"&&N6(e)){const d=Object.create(Object.getPrototypeOf(e));return r.set(e,d),pr(d,e,n,r,l),d}return e}function pr(e,t,n=e,r,l){const s=[...Object.keys Line truncated
* @license React
* use-sync-external-store-shim.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Sj;function U6(){if(Sj)return Xv;Sj=1;var e=No();function t(p,x){return p===x&&(p!==0||1/p===1/x)||p!==p&&x!==x}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,l=e.useEffect,s=e.useLayoutEffect,d=e.useDebugValue;function f(p,x){var w=x(),j=r({inst:{value:w,getSnapshot:x}}),_=j[0].inst,N=j[1];return s(function(){_.value=w,_.getSnapshot=x,h(_)&&N({inst:_})},[p,w,x]),l(function(){return h(_)&&N({inst:_}),p(function(){h(_)&&N({inst:_})})},[p]),d(w),w}function h(p){var x=p.getSnapshot;p=p.value;try{var w=x();return!n(p,w)}catch{return!0}}function m(p,x){return x()}var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:f;return Xv.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:y,Xv}var Nj;function H6(){return Nj||(Nj=1,Vv.exports=U6()),Vv.exports}/**
* @license React
* use-sync-external-store-shim/with-selector.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Aj;function q6(){if(Aj)return Gv;Aj=1;var e=No(),t=H6();function n(m,y){return m===y&&(m!==0||1/m===1/y)||m!==m&&y!==y}var r=typeof Object.is=="function"?Object.is:n,l=t.useSyncExternalStore,s=e.useRef,d=e.useEffect,f=e.useMemo,h=e.useDebugValue;return Gv.useSyncExternalStoreWithSelector=function(m,y,p,x,w){var j=s(null);if(j.current===null){var _={hasValue:!1,value:null};j.current=_}else _=j.current;j=f(function(){function O(M){if(!A){if(A=!0,D=M,M=x(M),w!==void 0&&_.hasValue){var $=_.value;if(w($,M))return k=$}return k=M}if($=k,r(D,M))return $;var U=x(M);return w!==void 0&&w($,U)?(D=M,$):(D=M,k=U)}var A=!1,D,k,z=p===void 0?null:p;return[function(){return O(y())},z===null?void 0:function(){return O(z())}]},[y,p,x,w]);var N=l(m,j[0],j[1]);return d(function(){_.hasValue=!0,_.value=N},[N]),h(N),N},Gv}var Oj;function K6(){return Oj||(Oj=1,Yv.exports=q6()),Yv.exports}var Y6=K6(),Xp=b.createContext(null),G6=e=>e,at=()=>{var e=b.useContext(Xp);return e?e.store.dispatch:G6},jd=()=>{},V6=()=>jd,X6=(e,t)=>e===t;function pe(e){var t=b.useContext(Xp),n=b.useMemo(()=>t?r=>{if(r!=null)return e(r)}:jd,[t,e]);return Y6.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:V6,t?t.store.getState:jd,t?t.store.getState:jd,n,X6)}function F6(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Z6(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var Ej=e=>Array.isArray(e)?e:[e];function W6(e){const t=Array.isArray(e[0])?e[0]:e;return Z6(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Q6(e,t){const n=[],{length:r}=e;for(let l=0;l<r;l++)n.push(e[l].apply(null,t));return n}var J6=class{constructor(e){this.value=e}deref(){return this.value}},ez=()=>typeof WeakRef>"u"?J6:WeakRef,qA=ez(),tz=0,kj=1;function nd(){return{s:tz,v:void 0,o:null,p:null}}function nz(e){return e instanceof qA?e.deref():e}function KA(e,t={}){let n=nd();const{resultEqualityCheck:r}=t;let l,s=0;function d(){let f=n;const{length:h}=arguments;for(let p=0,x=h;p<x;p++){const w=arguments[p];if(typeof w=="function"||typeof w=="object"&&w!==null){let j=f.o;j===null&&(f.o=j=new WeakMap);const _=j.get(w);_===void 0?(f=nd(),j.set(w,f)):f=_}else{let j=f.p;j===null&&(f.p=j=new Map);const _=j.get(w);_===void 0?(f=nd(),j.set(w,f)):f=_}}const m=f;let y;if(f.s===kj)y=f.v;else if(y=e.apply(null,arguments),s++,r){const p=nz(l);p!=null&&r(p,y)&&(y=p,s!==0&&s--),l=typeof y=="object"&&y!==null||typeof y=="function"?new qA(y):y}return m.s=kj,m.v=y,y}return d.clearCache=()=>{n=nd(),d.resetResultsCount()},d.resultsCount=()=>s,d.resetResultsCount=()=>{s=0},d}function rz(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...l)=>{let s=0,d=0,f,h={},m=l.pop();typeof m=="object"&&(h=m,m=l.pop()),F6(m,`createSelector expects an output function after the inputs, but received: [${typeof m}]`);const y={...n,...h},{memoize:p,memoizeOptions:x=[],argsMemoize:w=KA,argsMemoizeOptions:j=[]}=y,_=Ej(x),N=Ej(j),O=W6(l),A=p(function(){return s++,m.apply(null,arguments)},..._),D=w(function(){d++;const z=Q6(O,arguments);return f=A.apply(null,z),f},...N);return Object.assign(D,{resultFunc:m,memoizedResultFunc:A,dependencies:O,dependencyRecomputations:()=>d,resetDependencyRecomputations:()=>{d=0},lastResult:()=>f,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:p,argsMemoize:w})};return Object.assign(r,{withTypes:()=>r}),r}var G=rz(KA);function az(e,t=1){const n=[],r=Math.floor(t),l=(s,d)=>{for(let f=0;f<s.length;f++){const h=s[f];Array.isArray(h)&&d<r?l(h,d+1):n.push(h)}};return l(e,0),n}function Hy(e,t,n){return $A(n)&&(typeof t=="number"&&UA(n)&&BA(t)&&t<n.length||typeof t=="string"&&t in n)?wd(n[t],e):!1}function Cj(e){return typeof e=="symbol"?1:e===null?2:e===void 0?3:e!==e?4:0}const iz=(e,t,n)=>{if(e!==t){const r=Cj(e),l=Cj(t);if(r===l&&r===0){if(e<t)return n==="desc"?1:-1;if(e>t)return n==="desc"?-1:1}return n==="desc"?l-r:r-l}return 0};function YA(e){return typeof e=="symbol"||e instanceof Symbol}const lz=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,oz=/^\w*$/;function sz(e,t){return Array.isArray(e)?!1:typeof e=="number"||typeof e=="boolean"||e==null||YA(e)?!0:typeof e=="string"&&(oz.test(e)||!lz.test(e))||t!=null}function uz(e,t,n,r){if(e==null)return[];n=n,Array.isArray(e)||(e=Object.values(e)),Array.isArray(t)||(t=t==null?[null]:[t]),t.length===0&&(t=[null]),Array.isArray(n)||(n=n==null?[]:[n]),n=n.map(f=>String(f));const l=(f,h)=>{let m=f;for(let y=0;y<h.length&&m!=null;++y)m=m[h[y]];return m},s=(f,h)=>h==null||f==null?h:typeof f=="object"&&"key"in f?Object.hasOwn(h,f.key)?h[f.key]:l(h,f.path):typeof f=="function"?f(h):Array.isArray(f)?l(h,f):typeof h=="object"?h[f]:h,d=t.map(f=>(Array.isArray(f)&&f.length===1&&(f=f[0]),f==nullLine truncated
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yz(e,t){if(e){if(typeof e=="string")return Mj(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Mj(e,t):void 0}}function Mj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function pz(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,l,s,d,f=[],h=!0,m=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(h=(r=s.call(n)).done)&&(f.push(r.value),f.length!==t);h=!0);}catch(y){m=!0,l=y}finally{try{if(!h&&n.return!=null&&(d=n.return(),Object(d)!==d))return}finally{if(m)throw l}}return f}}function gz(e){if(Array.isArray(e))return e}var rd=1;function Tj(e,t){return Math.abs(e.height-t.height)>rd||Math.abs(e.left-t.left)>rd||Math.abs(e.top-t.top)>rd||Math.abs(e.width-t.width)>rd}function Dj(e){var t=e.getBoundingClientRect();return{height:t.height,left:t.left,top:t.top,width:t.width}}function VA(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=b.useState({height:0,left:0,top:0,width:0}),n=mz(t,2),r=n[0],l=n[1],s=b.useRef(null),d=b.useRef(r);d.current=r;var f=b.useCallback(h=>{if(s.current!=null&&(s.current.disconnect(),s.current=null),h!=null){var m=Dj(h);if(Tj(m,d.current)&&l(m),typeof ResizeObserver<"u"){var y=new ResizeObserver(()=>{var p=Dj(h);Tj(p,d.current)&&l(p)});y.observe(h),s.current=y}}},[...e]);return b.useEffect(()=>()=>{var h;(h=s.current)===null||h===void 0||h.disconnect()},[]),[r,f]}function tn(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var xz=typeof Symbol=="function"&&Symbol.observable||"@@observable",Pj=xz,Fv=()=>Math.random().toString(36).substring(7).split("").join("."),bz={INIT:`@@redux/INIT${Fv()}`,REPLACE:`@@redux/REPLACE${Fv()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Fv()}`},$d=bz;function Fp(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function XA(e,t,n){if(typeof e!="function")throw new Error(tn(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(tn(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(tn(1));return n(XA)(e,t)}let r=e,l=t,s=new Map,d=s,f=0,h=!1;function m(){d===s&&(d=new Map,s.forEach((N,O)=>{d.set(O,N)}))}function y(){if(h)throw new Error(tn(3));return l}function p(N){if(typeof N!="function")throw new Error(tn(4));if(h)throw new Error(tn(5));let O=!0;m();const A=f++;return d.set(A,N),function(){if(O){if(h)throw new Error(tn(6));O=!1,m(),d.delete(A),s=null}}}function x(N){if(!Fp(N))throw new Error(tn(7));if(typeof N.type>"u")throw new Error(tn(8));if(typeof N.type!="string")throw new Error(tn(17));if(h)throw new Error(tn(9));try{h=!0,l=r(l,N)}finally{h=!1}return(s=d).forEach(A=>{A()}),N}function w(N){if(typeof N!="function")throw new Error(tn(10));r=N,x({type:$d.REPLACE})}function j(){const N=p;return{subscribe(O){if(typeof O!="object"||O===null)throw new Error(tn(11));function A(){const k=O;k.next&&k.next(y())}return A(),{unsubscribe:N(A)}},[Pj](){return this}}}return x({type:$d.INIT}),{dispatch:x,subscribe:p,getState:y,replaceReducer:w,[Pj]:j}}function wz(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:$d.INIT})>"u")throw new Error(tn(12));if(typeof n(void 0,{type:$d.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(tn(13))})}function FA(e){const t=Object.keys(e),n={};for(let s=0;s<t.length;s++){const d=t[s];typeof e[d]=="function"&&(n[d]=e[d])}const r=Object.keys(n);let l;try{wz(n)}catch(s){l=s}return function(d={},f){if(l)throw l;let h=!1;const m={};for(let y=0;y<r.length;y++){const p=r[y],x=n[p],w=d[p],j=x(w,f);if(typeof j>"u")throw f&&f.type,new Error(tn(14));m[p]=j,h=h||j!==w}return h=h||r.length!==Object.keys(d).length,h?m:d}}function Id(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function jz(...e){return t=>(n,r)=>{const l=t(n,r);let s=()=>{throw new Error(tn(15))};const d={getState:l.getState,dispatch:(h,...m)=>s(h,...m)},f=e.map(h=>h(d));return s=Id(...f)(l.dispatch),{...l,dispatch:s}}}function ZA(e){return Fp(e)&&"type"in e&&typeof e.type=="string"}var WA=Symbol.for("immer-nothing"),zj=Symbol.for("immer-draftable"),pn=Symbol.for("immer-state");function gr(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Un=Object,vo=Un.getPrototypeOf,Rd="constructor",Pf="prototype",qy="configurable",Ld="enumerable",_d="writable",tu="value",ga=e=>!!e&&!!e[pn];function _r(e){var t;return e?QA(e)||$f(e)||!!e[zj]||!!((t=e[Rd])!=null&&t Line truncated
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oI(e,t){if(e){if(typeof e=="string")return a2(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a2(e,t):void 0}}function a2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function sI(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,l,s,d,f=[],h=!0,m=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(h=(r=s.call(n)).done)&&(f.push(r.value),f.length!==t);h=!0);}catch(y){m=!0,l=y}finally{try{if(!h&&n.return!=null&&(d=n.return(),Object(d)!==d))return}finally{if(m)throw l}}return f}}function uI(e){if(Array.isArray(e))return e}function cI(e,t){if(e==null)return{};var n,r,l=dI(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(l[n]=e[n])}return l}function dI(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var MO=b.createContext(Dr.initialDimension);function fI(e){return Lr(e.width)&&Lr(e.height)}function TO(e){var t=e.children,n=e.width,r=e.height,l=b.useMemo(()=>({width:n,height:r}),[n,r]);return fI(l)?b.createElement(MO.Provider,{value:l},t):null}var n0=()=>b.useContext(MO),hI=b.forwardRef((e,t)=>{var n=e.aspect,r=e.initialDimension,l=r===void 0?Dr.initialDimension:r,s=e.width,d=e.height,f=e.minWidth,h=f===void 0?Dr.minWidth:f,m=e.minHeight,y=e.maxHeight,p=e.children,x=e.debounce,w=x===void 0?Dr.debounce:x,j=e.id,_=e.className,N=e.onResize,O=e.style,A=O===void 0?{}:O,D=cI(e,tI),k=b.useRef(null),z=b.useRef();z.current=N,b.useImperativeHandle(t,()=>k.current);var M=b.useState({containerWidth:l.width,containerHeight:l.height}),$=iI(M,2),U=$[0],V=$[1],R=b.useCallback((q,te)=>{V(re=>{var X=Math.round(q),T=Math.round(te);return re.containerWidth===X&&re.containerHeight===T?re:{containerWidth:X,containerHeight:T}})},[]);b.useEffect(()=>{if(k.current==null||typeof ResizeObserver>"u")return ul;var q=E=>{var L,K=E[0];if(K!=null){var ie=K.contentRect,me=ie.width,ve=ie.height;R(me,ve),(L=z.current)===null||L===void 0||L.call(z,me,ve)}};w>0&&(q=X$(q,w,{trailing:!0,leading:!1}));var te=new ResizeObserver(q),re=k.current.getBoundingClientRect(),X=re.width,T=re.height;return R(X,T),te.observe(k.current),()=>{te.disconnect()}},[R,w]);var F=U.containerWidth,Z=U.containerHeight;Gd(!n||n>0,"The aspect(%s) must be greater than zero.",n);var he=CO(F,Z,{width:s,height:d,aspect:n,maxHeight:y}),fe=he.calculatedWidth,se=he.calculatedHeight;return Gd(F<0||Z<0||fe!=null&&fe>0||se!=null&&se>0,`The width(%s) and height(%s) of chart should be greater than 0,
please check the style of container, or the props width(%s) and height(%s),
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
height and width.`,fe,se,s,d,h,m,n),b.createElement("div",Vd({id:j?"".concat(j):void 0,className:Ze("recharts-responsive-container",_),style:r2(r2({},A),{},{width:s,height:d,minWidth:h,minHeight:m,maxHeight:y}),ref:k},D),b.createElement("div",{style:J$({width:s,height:d})},b.createElement(TO,{width:fe,height:se},p)))}),Ds=b.forwardRef((e,t)=>{var n=n0();if(Lr(n.width)&&Lr(n.height))return e.children;var r=eI({width:e.width,height:e.height,aspect:e.aspect}),l=r.width,s=r.height,d=CO(void 0,void 0,{width:l,height:s,aspect:e.aspect,maxHeight:e.maxHeight}),f=d.calculatedWidth,h=d.calculatedHeight;return ye(f)&&ye(h)?b.createElement(TO,{width:f,height:h},e.children):b.createElement(hI,Vd({},e,{width:l,height:s,ref:t}))});function r0(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var Xf=()=>{var e,t=hn(),n=pe(K$),r=pe(Vf),l=(e=pe(Gf))===null||e===void 0?void 0:e.padding;return!t||!r||!l?n:{width:r.width-l.left-l.right,height:r.height-l.top-l.bottom,x:l.left,y:l.top}},mI={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},DO=()=>{var e;return(e=pe(Bt))!==null&&e!==void 0?e:mI},a0=()=>pe(ja),i0=()=>pe(_a),vI=()=>pe(e=>e.layout.margin),Ye=e=>e.layout.layoutType,cl=()=>pe(Ye),l0=()=>{var e=cl();if(e==="horizontal"||e==="vertical")return e},o0=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},yI=()=>pe(o0),pI=()=>{var e=cl();return e!==void 0},bu=e=>{var t=at(),n=hn(),r=e.width,l=e.height,s=n0(),d=r,f=l;return s&&(d=s.width>0?s.width:r,f=s.height>0?s.height:l),b.useEffect(()=>{!n&&Lr(d)&&Lr(f)&&t(p$({width:d,height:f}))},[t,n,d,f]),null},PO=Symbol.for("immer-nothing"),i2=Symbol.for("immer-draftable"),Yn=Symbol.for("immer-state");function xr(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var au=Object.getPrototypeOf;function po(e){return!!e&&!!e[Yn]}function rl(e){var t;return e?zO(e)||Array.isArray(e)||!!e[i2]||!!((t=e.constructor)!=null&&t[i2])||wu(e)||Zf(e):!1}var gI=Object.prototype.constructor.toString(),l2=new WeakMap;function zO(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(n===Object)return!0;if(typeof n!="function")return!1;let r=l2.get(n);return r===void 0&&(r=Function.toString.call(n),l2.set(n,r)),r===gI}function Xd(e,t,n=!0){Ff(e)===0?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(l=>{t(l,e[l],e)}):e.forEach((r,l)=>t(l,r,e))}function Ff(e){const t=e[Yn];return t?t.type_:Array.isArray(e)?1:wu(e)?2:Zf(e)?3:0}function Jy(e,t){return Ff(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function $O(e,t,n){const r=Ff(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function xI(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function wu(e){return e instanceof Map}function Zf(e){return e instanceof Set}function Bi(e){return e.copy_||e.base_}function ep(e,t){if(wu(e))return new Map(e);if(Zf(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=zO(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Yn];let l=Reflect.ownKeys(r);for(let s=0;s<l.length;s++){const d=l[s],f=r[d];f.writable===!1&&(f.writable=!0,f.configurable=!0),(f.get||f.set)&&(r[d]={configurable:!0,writable:!0,enumerable:f.enumerable,value:e[d]})}return Object.create(au(e),r)}else{const r=au(e);if(r!==null&&n)return{...e};const l=Object.create(r);return Object.assign(l,e)}}function s0(e,t=!1){return Wf(e)||po(e)||!rl(e)||(Ff(e)>1&&Object.defineProperties(e,{set:sd,add:sd,clear:sd,delete:sd}),Object.freeze(e),t&&Object.values(e).forEach(n=>s0(n,!0))),e}function bI(){xr(2)}var sd={value:bI};function Wf(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var wI={};function al(e){const t=wI[e];return t||xr(0,e),t}var iu;function IO(){return iu}function jI(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function o2(e,t){t&&(al("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function tp(e){np(e),e.drafts_.forEach(_I),e.drafts_=null}function np(e){e===iu&&(iu=e.parent_)}function s2(e){return iu=jI(iu,e)}function _I(e){const t=e[Yn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function u2(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Yn].modified_&&(tp(t),xr(4)),rl(e)&&(e=Fd(t,e),t.parent_||Zd(t,e)),t.patches_&&al("Patches").generateReplacementPatches_(n[Yn].base_,e,t.patches_,t.inversePatches_)):e=Fd(t,n,[]),tp(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==PO?e:void 0}function Fd(e,t,n){if(Wf(t))return t;const r=e.immer_.shouldUseStrictIteration(),l=t[Yn];if(!l)return Xd(t,(s,d)=>c2(e,l,t,s,d,n),r),t;if(l.scope_!==e)return t;if(!l.modified_)return Zd(e,l.base_,!0),l.base_;if(!l.finalized_){l.finalized_=!0,l.scope_.unfinalizedDraft Line truncated
* @license React
* use-sync-external-store-with-selector.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var f2;function TI(){if(f2)return ty;f2=1;var e=No();function t(h,m){return h===m&&(h!==0||1/h===1/m)||h!==h&&m!==m}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,l=e.useRef,s=e.useEffect,d=e.useMemo,f=e.useDebugValue;return ty.useSyncExternalStoreWithSelector=function(h,m,y,p,x){var w=l(null);if(w.current===null){var j={hasValue:!1,value:null};w.current=j}else j=w.current;w=d(function(){function N(z){if(!O){if(O=!0,A=z,z=p(z),x!==void 0&&j.hasValue){var M=j.value;if(x(M,z))return D=M}return D=z}if(M=D,n(A,z))return M;var $=p(z);return x!==void 0&&x(M,$)?(A=z,M):(A=z,D=$)}var O=!1,A,D,k=y===void 0?null:y;return[function(){return N(m())},k===null?void 0:function(){return N(k())}]},[m,y,p,x]);var _=r(h,w[0],w[1]);return s(function(){j.hasValue=!0,j.value=_},[_]),f(_),_},ty}var h2;function DI(){return h2||(h2=1,ey.exports=TI()),ey.exports}DI();function PI(e){e()}function zI(){let e=null,t=null;return{clear(){e=null,t=null},notify(){PI(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const l=t={callback:n,next:null,prev:t};return l.prev?l.prev.next=l:e=l,function(){!r||e===null||(r=!1,l.next?l.next.prev=l.prev:t=l.prev,l.prev?l.prev.next=l.next:e=l.next)}}}}var m2={notify(){},get:()=>[]};function $I(e,t){let n,r=m2,l=0,s=!1;function d(_){y();const N=r.subscribe(_);let O=!1;return()=>{O||(O=!0,N(),p())}}function f(){r.notify()}function h(){j.onStateChange&&j.onStateChange()}function m(){return s}function y(){l++,n||(n=e.subscribe(h),r=zI())}function p(){l--,n&&l===0&&(n(),n=void 0,r.clear(),r=m2)}function x(){s||(s=!0,y())}function w(){s&&(s=!1,p())}const j={addNestedSub:d,notifyNestedSubs:f,handleChangeWrapper:h,isSubscribed:m,trySubscribe:x,tryUnsubscribe:w,getListeners:()=>r};return j}var II=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",RI=II(),LI=()=>typeof navigator<"u"&&navigator.product==="ReactNative",BI=LI(),UI=()=>RI||BI?b.useLayoutEffect:b.useEffect,HI=UI();function v2(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function qI(e,t){if(v2(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let l=0;l<n.length;l++)if(!Object.prototype.hasOwnProperty.call(t,n[l])||!v2(e[n[l]],t[n[l]]))return!1;return!0}var ny=Symbol.for("react-redux-context"),ry=typeof globalThis<"u"?globalThis:{};function KI(){if(!b.createContext)return{};const e=ry[ny]??(ry[ny]=new Map);let t=e.get(b.createContext);return t||(t=b.createContext(null),e.set(b.createContext,t)),t}var YI=KI();function GI(e){const{children:t,context:n,serverState:r,store:l}=e,s=b.useMemo(()=>{const h=$I(l);return{store:l,subscription:h,getServerState:r?()=>r:void 0}},[l,r]),d=b.useMemo(()=>l.getState(),[l]);HI(()=>{const{subscription:h}=s;return h.onStateChange=h.notifyNestedSubs,h.trySubscribe(),d!==l.getState()&&h.notifyNestedSubs(),()=>{h.tryUnsubscribe(),h.onStateChange=void 0}},[s,d]);const f=n||YI;return b.createElement(f.Provider,{value:s},t)}var VI=GI,XI=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function FI(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Eo(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(XI.has(r)){if(e[r]==null&&t[r]==null)continue;if(!qI(e[r],t[r]))return!1}else if(!FI(e[r],t[r]))return!1;return!0}var ZI=["contextPayload"];function ip(){return ip=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ip.apply(null,arguments)}function WI(e,t){return t8(e)||e8(e,t)||JI(e,t)||QI()}function QI(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JI(e,t){if(e){if(typeof e=="string")return y2(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y2(e,t):void 0}}function y2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function e8(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,l,s,d,f=[],h=!0,m=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(h=(r=s.call(n)).done)&&(f.push(r.value),f.length!==t);h=!0);}catch(y){m=!0,l=y}finally{try{if(!h&&n.return!=null&&(d=n.return(),Object(d)!==d))return}finally{if(m)throw l}}return f}}function t8(e){if(Array.isArray(e))return e}function p2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,r)}return n}function go(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?p2(Object(n),!0).forEach(function(r){n8(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function n8(e,t,n){return(t=r8(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r8(e){var t=a8(e,"string");return typeof t=="symbol"?t:t+""}function a8(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function i8(e,t){if(e==null)return{};var n,r,l=l8(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(l[n]=e[n])}return l}function l8(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function o8(e){return e.value}function s8(e){var t=e.contextPayload,n=i8(e,ZI),r=HA(t,e.payloadUniqBy,o8),l=go(go({},n),{},{payload:r});return b.isValidElement(e.content)?b.cloneElement(e.content,l):typeof e.content=="function"?b.createElement(e.content,l):b.createElement(JP,l)}function u8(e,t,n,r,l,s){var d=t.layout,f=t.align,h=t.verticalAlign,m,y;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(f==="center"&&d==="vertical"?m={left:((r||0)-s.width)/2}:m=f==="right"?{right:n&&n.right||0}:{left:n&&n.left||0}),(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))&&(h==="middle"?y={top:((l||0)-s.height)/2}:y=h==="bottom"?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),go(go({},m),y)}function c8(e){var t=e.align,n=e.layout,r=e.verticalAlign,l=e.itemSorter,s=at();return b.useLayoutEffect(()=>{s(CI({align:t,layout:n,verticalAlign:r,itemSorter:l}))},[s,t,n,r,l]),null}function d8(e){var t=e.width,n=e.height,r=at();return b.useLayoutEffect(()=>{r(d2({width:t,height:n}))},[r,t,n]),b.useLayoutEffect(()=>()=>{r(d2({width:0,height:0}))},[r]),null}function f8(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var h8={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",labelStyle:{},layout:"horizontal",verticalAlign:"bottom"};function m8(e){var t=Vt(e,h8),n=hz(),r=XD(),l=vI(),s=t.width,d=t.height,f=t.wrapperStyle,h=t.portal,m=VA([n]),y=WI(m,2),p=y[0],x=y[1],w=a0(),j=i0();if(w==null||j==null)return null;var _=w-((l==null?void 0:l.left)||0)-((l==null?void 0:l.right)||0),N=f8(t.layout,d,s,_),O=h?f:go(go({position:"absolute",width:(N==null?void 0:N.width)||s||"auto",height:(N==null?void 0:N.height)||d||"auto"},u8(f,t,l,w,j,p)),f),A=h??r;if(A==null||n==null)return null;var D=b.createElement("div",{className:"recharts-legend-wrapper",style:O,ref:x},b.createElement(c8,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!h&&b.createElement(d8,{width:p.width,height:p.height}),b.createElement(s8,ip({},t,N,{margin:l,chartWidth:w,chartHeight:j,contextPayload:n})));return Lt.createPortal(D,A)}var KO=b.memo(m8,Eo);KO.displayName="Legend";function lp(){return lp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lp.apply(null,arguments)}function g2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,r)}return n}function Ps(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?g2(Object(n),!0).forEach(func Line truncated
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function b8(e,t){if(e){if(typeof e=="string")return x2(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?x2(e,t):void 0}}function x2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function w8(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,l,s,d,f=[],h=!0,m=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(h=(r=s.call(n)).done)&&(f.push(r.value),f.length!==t);h=!0);}catch(y){m=!0,l=y}finally{try{if(!h&&n.return!=null&&(d=n.return(),Object(d)!==d))return}finally{if(m)throw l}}return f}}function j8(e){if(Array.isArray(e))return e}function _8(e){return Array.isArray(e)&&Rr(e[0])&&Rr(e[1])?e.join(" ~ "):e}var Jl={separator:" : ",contentStyle:{margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},itemStyle:{display:"block",paddingTop:4,paddingBottom:4,color:"#000"},labelStyle:{},accessibilityLayer:!1};function S8(e,t){return t==null?e:Df(e,t)}var N8=e=>{var t=e.separator,n=t===void 0?Jl.separator:t,r=e.contentStyle,l=e.itemStyle,s=e.labelStyle,d=s===void 0?Jl.labelStyle:s,f=e.payload,h=e.formatter,m=e.itemSorter,y=e.wrapperClassName,p=e.labelClassName,x=e.label,w=e.labelFormatter,j=e.accessibilityLayer,_=j===void 0?Jl.accessibilityLayer:j,N=()=>{if(f&&f.length){var U={padding:0,margin:0},V=S8(f,m),R=V.map((F,Z)=>{if(!F||F.type==="none")return null;var he=F.formatter||h||_8,fe=F.value,se=F.name,q=fe,te=se;if(he){var re=he(fe,se,F,Z,f);if(Array.isArray(re)){var X=g8(re,2);q=X[0],te=X[1]}else if(re!=null)q=re;else return null}var T=Ps(Ps({},Jl.itemStyle),{},{color:F.color||Jl.itemStyle.color},l);return b.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(Z),style:T},Rr(te)?b.createElement("span",{className:"recharts-tooltip-item-name"},te):null,Rr(te)?b.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,b.createElement("span",{className:"recharts-tooltip-item-value"},q),b.createElement("span",{className:"recharts-tooltip-item-unit"},F.unit||""))});return b.createElement("ul",{className:"recharts-tooltip-item-list",style:U},R)}return null},O=Ps(Ps({},Jl.contentStyle),r),A=Ps({margin:0},d),D=!yt(x),k=D?x:"",z=Ze("recharts-default-tooltip",y),M=Ze("recharts-tooltip-label",p);D&&w&&f!==void 0&&f!==null&&(k=w(x,f));var $=_?{role:"status","aria-live":"assertive"}:{};return b.createElement("div",lp({className:z,style:O},$),b.createElement("p",{className:M,style:A},b.isValidElement(k)?k:"".concat(k)),N())},zs="recharts-tooltip-wrapper",A8={visibility:"hidden"};function O8(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return Ze(zs,{["".concat(zs,"-right")]:ye(n)&&t&&ye(t.x)&&n>=t.x,["".concat(zs,"-left")]:ye(n)&&t&&ye(t.x)&&n<t.x,["".concat(zs,"-bottom")]:ye(r)&&t&&ye(t.y)&&r>=t.y,["".concat(zs,"-top")]:ye(r)&&t&&ye(t.y)&&r<t.y})}function b2(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,l=e.offset,s=e.position,d=e.reverseDirection,f=e.tooltipDimension,h=e.viewBox,m=e.viewBoxDimension;if(s&&ye(s[r]))return s[r];var y=n[r]-f-(l>0?l:0),p=n[r]+l;if(t[r])return d[r]?y:p;var x=h[r];if(x==null)return 0;if(d[r]){var w=y,j=x;return w<j?Math.max(p,x):Math.max(y,x)}if(m==null)return 0;var _=p+f,N=x+m;return _>N?Math.max(y,x):Math.max(p,x)}function E8(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function k8(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTop,l=e.offsetLeft,s=e.position,d=e.reverseDirection,f=e.tooltipBox,h=e.useTranslate3d,m=e.viewBox,y,p,x;return f.height>0&&f.width>0&&n?(p=b2({allowEscapeViewBox:t,coordinate:n,key:"x",offset:l,position:s,reverseDirection:d,tooltipDimension:f.width,viewBox:m,viewBoxDimension:m.width}),x=b2({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:s,reverseDirection:d,tooltipDimension:f.height,viewBox:m,viewBoxDimension:m.height}),y=E8({translateX:p,translateY:x,useTranslate3d:h})):y=A8,{cssProperties:y,cssClasses:O8({translateX:p,translateY:x,coordinate:n})}}var C8=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),_u={isSsr:C8()};function M8(e,t){return z8(e)||P8(e,t)||D8(e,t)||T8()}function T8(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function D8(e,t){if(e){if(typeof e=="string")return w2(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?w2(e,t):void 0}}function w2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function P8(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,l,s,d,f=[],h=!0,m=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(h=(r=s.call(n)).done)&&(f.push(r.value),f.length!==t);h=!0);}catch(y){m=!0,l=y}finally{try{if(!h&&n.return!=null&&(d=n.return(),Object(d)!==d))return}finally{if(m)throw l}}return f}}function z8(e){if(Array.isArray(e))return e}function YO(){var e=b.useState(()=>_u.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches),t=M8(e,2),n=t[0],r=t[1];return b.useEffect(()=>{if(window.matchMedia){var l=window.matchMedia("(prefers-reduced-motion: reduce)"),s=()=>{r(l.matches)};return l.addEventListener("change",s),()=>{l.removeEventListener("change",s)}}},[]),n}function j2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,r)}return n}function eo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?j2(Object(n),!0).forEach(function(r){$8(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $8(e,t,n){return(t=I8(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function I8(e){var t=R8(e,"string");return typeof t=="symbol"?t:t+""}function R8(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function L8(e,t){return q8(e)||H8(e,t)||U8(e,t)||B8()}function B8(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function U8(e,t){if(e){if(typeof e=="string")return _2(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_2(e,t):void 0}}function _2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function H8(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,l,s,d,f=[],h=!0,m=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(h=(r=s.call(n)).done)&&(f.push(r.value),f.length!==t);h=!0);}catch(y){m=!0,l=y}finally{try{if(!h&&n.return!=null&&(d=n.return(),Object(d)!==d))return}finally{if(m)throw l}}return f}}function q8(e){if(Array.isArray(e))return e}function K8(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active){var t=typeof e.animationEasing=="string"?e.animationEasing:"ease";return"transform ".concat(e.animationDuration,"ms ").concat(t)}}function Y8(e){var t,n,r,l,s,d,f=YO(),h=b.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}})),m=L8(h,2),y=m[0],p=m[1];b.useEffect(()=>{var O=A=>{if(A.key==="Escape"){var D,k,z,M;p({dismissed:!0,dismissedAtCoordinate:{x:(D=(k=e.coordinate)===null||k===void 0?void 0:k.x)!==null&&D!==void 0?D:0,y:(z=(M=e.coordinate)===null||M===void 0?void 0:M.y)!==null&&z!==void 0?z:0}})}};return document.addEventListener("keydown",O),()=>{document.removeEventListener("keydown",O)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(n=e.coordinate)===null||n===void 0?void 0:n.y]),y.dismissed&&(((r=(l=e.coordinate)===null||l===void 0?void 0:l.x)!==null&&r!==void 0?r:0)!==y.dismissedAtCoordinate.x||((s=(d=e.coordinate)===null||d===void 0?void 0:d.y)!==null&&s!==void 0?s:0)!==y.dismissedAtCoordinate.y)&&p(eo(eo({},y),{},{dismissed:!1}));var x=k8({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset=="number"?e.offset:e.offset.x,offsetTop:typeof e.offset=="number"?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),w=x.cssClasses,j=x.cssProperties,_=e.hasPortalFromProps?{}:eo(eo({transition:K8({prefersReducedMotion:f,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},j),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),N=eo(eo({},_),{},{visibility:!y.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return b.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:w,style:N,ref:e.innerRef},e.children)}var G8=b.memo(Y8),GO=()=>{var e;return(e=pe(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function op(){return op=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},op.apply(null,arguments)}function S2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,r)}return n}function N2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?S2(Object(n),!0).forEach(function(r){V8(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function V8(e,t,n){return(t=X8(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function X8(e){var t=F8(e,"string");return typeof t=="symbol"?t:t+""}function F8(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var A2={curveBasisClosed:hP,curveBasisOpen:mP,curveBasis:fP,curveBumpX:QD,curveBumpY:JD,curveLinearClosed:vP,curveLinear:Mf,curveMonotoneX:yP,curveMonotoneY:pP,curveNatural:gP,curveStep:xP,curveStepAfter:wP,curveStepBefore:bP},Wd=e=>ze(e.x)&&ze(e.y),O2=e=>e.base!=null&&Wd(e.base)&&Wd(e),$s=e=>e.x,Is=e=>e.y,Z8=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(vu(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=A2["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return A2[n]||Mf},E2={connectNulls:!1,type:"linear"},W8=e=>{var t=e.type,n=t===void 0?E2.type:t,r=e.points,l=r===void 0?[]:r,s=e.baseLine,d=e.layout,f=e.connectNulls,h=f===void 0?E2.connectNulls:f,m=Z8(n,d),y=h?l.filter(Wd):l;if(Array.isArray(s)){var p,x=l.map((O,A)=>N2(N2({},O),{},{base:s[A]}));d==="vertical"?p=td().y(Is).x1($s).x Line truncated
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function NR(e,t){if(e){if(typeof e=="string")return z2(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?z2(e,t):void 0}}function z2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function AR(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,l,s,d,f=[],h=!0,m=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(h=(r=s.call(n)).done)&&(f.push(r.value),f.length!==t);h=!0);}catch(y){m=!0,l=y}finally{try{if(!h&&n.return!=null&&(d=n.return(),Object(d)!==d))return}finally{if(m)throw l}}return f}}function OR(e){if(Array.isArray(e))return e}var ER={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},$2=0,iy=1;function ZO(e){var t=Vt(e,ER),n=t.animationId,r=t.isActive,l=t.canBegin,s=t.duration,d=t.easing,f=t.begin,h=t.onAnimationEnd,m=t.onAnimationStart,y=t.children,p=YO(),x=r==="auto"?!_u.isSsr&&!p:r,w=vR(t.animationController),j=b.useState(x?$2:iy),_=_R(j,2),N=_[0],O=_[1];return b.useEffect(()=>{x||O(iy)},[x]),b.useEffect(()=>{var A=hR(d);if(!x||!l||A==null)return ul;var D=new jR,k=new wR({animationId:n,easing:A,animationDuration:s,animationBegin:f,onAnimationStart:m,onAnimationEnd:h,from:$2,to:iy});return w(D,k,O)},[w,n,x,l,s,d,f,m,h]),y(Number(N))}function WO(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=b.useRef(eu(t)),r=b.useRef(e);return r.current!==e&&(n.current=eu(t),r.current=e),n.current}var kR=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),CR=(e,t,n)=>e.map(r=>"".concat(kR(r)," ").concat(t,"ms ").concat(n)).join(","),MR=["radius"],TR=["radius"],I2,R2,L2,B2,U2,H2,q2,K2,Y2,G2;function V2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,r)}return n}function X2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?V2(Object(n),!0).forEach(function(r){DR(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function DR(e,t,n){return(t=PR(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PR(e){var t=zR(e,"string");return typeof t=="symbol"?t:t+""}function zR(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Jd(){return Jd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jd.apply(null,arguments)}function F2(e,t){if(e==null)return{};var n,r,l=$R(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(l[n]=e[n])}return l}function $R(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function IR(e,t){return UR(e)||BR(e,t)||LR(e,t)||RR()}function RR(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function LR(e,t){if(e){if(typeof e=="string")return Z2(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Z2(e,t):void 0}}function Z2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function BR(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,l,s,d,f=[],h=!0,m=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(h=(r=s.call(n)).done)&&(f.push(r.value),f.length!==t);h=!0);}catch(y){m=!0,l=y}finally{try{if(!h&&n.return!=null&&(d=n.return(),Object(d)!==d))return}finally{if(m)throw l}}return f}}function UR(e){if(Array.isArray(e))return e}function Cr(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var W2=(e,t,n,r,l)=>{var s=li(n),d=li(r),f=Math.min(Math.abs(s)/2,Math.abs(d)/2),h=d>=0?1:-1,m=s>=0?1:-1,y=d>=0&&s>=0||d<0&&s<0?1:0,p;if(f>0&&Array.isArray(l)){for(var x=[0,0,0,0],w=0,j=4;w<j;w++){var _,N=(_=l[w])!==null&&_!==void 0?_:0;x[w]=N>f?f:N}p=nn(I2||(I2=Cr(["M",",",""])),e,t+h*x[0]),x[0]>0&&(p+=nn(R2||(R2=Cr(["A ",",",",0,0,",",",",",""])),x[0],x[0],y,e+m*x[0],t)),p+=nn(L2||(L2=Cr(["L ",",",""])),e+n-m*x[1],t),x[1]>0&&(p+=nn(B2||(B2=Cr(["A ",",",",0,0,",`,
`,",",""])),x[1],x[1],y,e+n,t+h*x[1])),p+=nn(U2||(U2=Cr(["L ",",",""])),e+n,t+r-h*x[2]),x[2]>0&&(p+=nn(H2||(H2=Cr(["A ",",",",0,0,",`,
`,",",""])),x[2],x[2],y,e+n-m*x[2],t+r)),p+=nn(q2||(q2=Cr(["L ",",",""])),e+m*x[3],t+r),x[3]>0&&(p+=nn(K2||(K2=Cr(["A ",",",",0,0,",`,
`,",",""])),x[3],x[3],y,e,t+r-h*x[3])),p+="Z"}else if(f>0&&l===+l&&l>0){var O=Math.min(f,l);p=nn(Y2||(Y2=Cr(["M ",",",`
A `,",",",0,0,",",",",",`
L `,",",`
A `,",",",0,0,",",",",",`
L `,",",`
A `,",",",0,0,",",",",",`
L `,",",`
A `,",",",0,0,",",",","," Z"])),e,t+h*O,O,O,y,e+m*O,t,e+n-m*O,t,O,O,y,e+n,t+h*O,e+n,t+r-h*O,O,O,y,e+n-m*O,t+r,e+m*O,t+r,O,O,y,e,t+r-h*O)}else p=nn(G2||(G2=Cr(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return p},Q2={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},QO=e=>{var t=Vt(e,Q2),n=b.useRef(null),r=b.useState(-1),l=IR(r,2),s=l[0],d=l[1];b.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var re=n.current.getTotalLength();re&&d(re)}catch{}},[]);var f=t.x,h=t.y,m=t.width,y=t.height,p=t.radius,x=t.className,w=t.animationEasing,j=t.animationDuration,_=t.animationBegin,N=t.isAnimationActive,O=t.isUpdateAnimationActive,A=b.useRef(m),D=b.useRef(y),k=b.useRef(f),z=b.useRef(h),M=b.useMemo(()=>({x:f,y:h,width:m,height:y,radius:p}),[f,h,m,y,p]),$=WO(M,"rectangle-");if(f!==+f||h!==+h||m!==+m||y!==+y||m===0||y===0)return null;var U=Ze("recharts-rectangle",x);if(!O){var V=qn(t);V.radius;var R=F2(V,MR);return b.createElement("path",Jd({},R,{x:li(f),y:li(h),width:li(m),height:li(y),radius:typeof p=="number"?p:void 0,className:U,d:W2(f,h,m,y,p)}))}var F=A.current,Z=D.current,he=k.current,fe=z.current,se="0px ".concat(s===-1?1:s,"px"),q="".concat(s,"px ").concat(s,"px"),te=CR(["strokeDasharray"],j,typeof w=="string"?w:Q2.animationEasing);return b.createElement(ZO,{animationId:$,key:$,canBegin:s>0,duration:j,easing:w,isActive:O,begin:_},re=>{var X=wt(F,m,re),T=wt(Z,y,re),E=wt(he,f,re),L=wt(fe,h,re);n.current&&(A.current=X,D.current=T,k.current=E,z.current=L);var K;N?re>0?K={transition:te,strokeDasharray:q}:K={strokeDasharray:se}:K={strokeDasharray:q};var ie=qn(t);ie.radius;var me=F2(ie,TR);return b.createElement("path",Jd({},me,{radius:typeof p=="number"?p:void 0,className:U,d:W2(E,L,X,T,p),ref:n,style:X2(X2({},K),t.style)}))})};function J2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,r)}return n}function e_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?J2(Object(n),!0).forEach(function(r){HR(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function HR(e,t,n){return(t=qR(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qR(e){var t=KR(e,"string");return typeof t=="symbol"?t:t+""}function KR(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ef=Math.PI/180,YR=e=>e*180/Math.PI,Mt=(e,t,n,r)=>({x:e+Math.cos(-ef*r)*n,y:t+Math.sin(-ef*r)*n}),JO=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},GR=(e,t)=>{var n=e.x,r=e.y,l=t.x,s=t.y;return Math.sqrt((n-l)**2+(r-s)**2)},VR=(e,t)=>{var n=e.x,r=e.y,l=t.cx,s=t.cy,d=GR({x:n,y:r},{x:l,y:s});if(d<=0)return{radius:d,angle:0};var f=(n-l)/d,h=Math.acos(f);return r>s&&(h=2*Math.PI-h),{radius:d,angle:YR(h),angleInRadian:h}},XR=e=>{var t=e.startAngle,n=e.endAngle,r=Math.floor(t/360),l=Math.floor(n/360),s=Math.min(r,l);return{startAngle:t-s*360,endAngle:n-s*360}},FR=(e,t)=>{var n=t.startAngle,r=t.endAngle,l=Math.floor(n/360),s=Math.floor(r/360),d=Math.min(l,s);return e+d*360},ZR=(e,t)=>{var n=e.relativeX,r=e.relativeY,l=VR({x:n,y:r},t),s=l.radius,d=l.angle,f=t.innerRadius,h=t.outerRadius;if(s<f||s>h||s===0)return null;var m=XR(t),y=m.startAngle,p=m.endAngle,x=d,w;if(y<=p){for(;x>p;)x-=360;for(;x<y;)x+=360;w=x>=y&&x<=p}else{for(;x>y;)x-=360;for(;x<p;)x+=360;w=x>=p&&x<=y}return w?e_(e_({},t),{},{radius:s,angle:FR(x,t)}):null};function eE(e){var t=e.cx,n=e.cy,r=e.radius,l=e.startAngle,s=e.endAngle,d=Mt(t,n,r,l),f=Mt(t,n,r,s);return{points:[d,f],cx:t,cy:n,radius:r,startAngle:l,endAngle:s}}var t_,n_,r_,a_,i_,l_,o_;function up(){return up=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},up.apply(null,arguments)}function Ki(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var WR=(e,t)=>{var n=Gt(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},ud=e=>{var t=e.cx,n=e.cy,r=e.radius,l=e.angle,s=e.sign,d=e.isExternal,f=e.cornerRadius,h=e.cornerIsExternal,m=f*(d?1:-1)+r,y=Math.asin(f/m)/ef,p=h?l:l+s*y,x=Mt(t,n,m,p),w=Mt(t,n,r,p),j=h?l-s*y:l,_=Mt(t,n,m*Math.cos(y*ef),j);return{center:x,circleTangency:w,lineTangency:_,theta:y}},tE=e=>{var t=e.cx,n=e.cy,r=e.innerRadius,l=e Line truncated
A `,",",`,0,
`,",",`,
`,",",`
`])),m.x,m.y,l,l,+(Math.abs(f)>180),+(s>h),y.x,y.y);if(r>0){var x=Mt(t,n,r,s),w=Mt(t,n,r,h);p+=nn(n_||(n_=Ki(["L ",",",`
A `,",",`,0,
`,",",`,
`,","," Z"])),w.x,w.y,r,r,+(Math.abs(f)>180),+(s<=h),x.x,x.y)}else p+=nn(r_||(r_=Ki(["L ",","," Z"])),t,n);return p},QR=e=>{var t=e.cx,n=e.cy,r=e.innerRadius,l=e.outerRadius,s=e.cornerRadius,d=e.forceCornerRadius,f=e.cornerIsExternal,h=e.startAngle,m=e.endAngle,y=Gt(m-h),p=ud({cx:t,cy:n,radius:l,angle:h,sign:y,cornerRadius:s,cornerIsExternal:f}),x=p.circleTangency,w=p.lineTangency,j=p.theta,_=ud({cx:t,cy:n,radius:l,angle:m,sign:-y,cornerRadius:s,cornerIsExternal:f}),N=_.circleTangency,O=_.lineTangency,A=_.theta,D=f?Math.abs(h-m):Math.abs(h-m)-j-A;if(D<0)return d?nn(a_||(a_=Ki(["M ",",",`
a`,",",",0,0,1,",`,0
a`,",",",0,0,1,",`,0
`])),w.x,w.y,s,s,s*2,s,s,-s*2):tE({cx:t,cy:n,innerRadius:r,outerRadius:l,startAngle:h,endAngle:m});var k=nn(i_||(i_=Ki(["M ",",",`
A`,",",",0,0,",",",",",`
A`,",",",0,",",",",",",",`
A`,",",",0,0,",",",",",`
`])),w.x,w.y,s,s,+(y<0),x.x,x.y,l,l,+(D>180),+(y<0),N.x,N.y,s,s,+(y<0),O.x,O.y);if(r>0){var z=ud({cx:t,cy:n,radius:r,angle:h,sign:y,isExternal:!0,cornerRadius:s,cornerIsExternal:f}),M=z.circleTangency,$=z.lineTangency,U=z.theta,V=ud({cx:t,cy:n,radius:r,angle:m,sign:-y,isExternal:!0,cornerRadius:s,cornerIsExternal:f}),R=V.circleTangency,F=V.lineTangency,Z=V.theta,he=f?Math.abs(h-m):Math.abs(h-m)-U-Z;if(he<0&&s===0)return"".concat(k,"L").concat(t,",").concat(n,"Z");k+=nn(l_||(l_=Ki(["L",",",`
A`,",",",0,0,",",",",",`
A`,",",",0,",",",",",",",`
A`,",",",0,0,",",",",","Z"])),F.x,F.y,s,s,+(y<0),R.x,R.y,r,r,+(he>180),+(y>0),M.x,M.y,s,s,+(y<0),$.x,$.y)}else k+=nn(o_||(o_=Ki(["L",",","Z"])),t,n);return k},JR={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},nE=e=>{var t=Vt(e,JR),n=t.cx,r=t.cy,l=t.innerRadius,s=t.outerRadius,d=t.cornerRadius,f=t.forceCornerRadius,h=t.cornerIsExternal,m=t.startAngle,y=t.endAngle,p=t.className;if(s<l||m===y)return null;var x=Ze("recharts-sector",p),w=s-l,j=un(d,w,0,!0),_;return j>0&&Math.abs(m-y)<360?_=QR({cx:n,cy:r,innerRadius:l,outerRadius:s,cornerRadius:Math.min(j,w/2),forceCornerRadius:f,cornerIsExternal:h,startAngle:m,endAngle:y}):_=tE({cx:n,cy:r,innerRadius:l,outerRadius:s,startAngle:m,endAngle:y}),b.createElement("path",up({},qn(t),{className:x,d:_}))};function e7(e,t,n){if(e==="horizontal")return[{x:t.x,y:n.top},{x:t.x,y:n.top+n.height}];if(e==="vertical")return[{x:n.left,y:t.y},{x:n.left+n.width,y:t.y}];if(kA(t)){if(e==="centric"){var r=t.cx,l=t.cy,s=t.innerRadius,d=t.outerRadius,f=t.angle,h=Mt(r,l,s,f),m=Mt(r,l,d,f);return[{x:h.x,y:h.y},{x:m.x,y:m.y}]}return eE(t)}}function t7(e){return YA(e)?NaN:Number(e)}function ly(e){return e?(e=t7(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}function rE(e,t,n){n&&typeof n!="number"&&Hy(e,t,n)&&(t=n=void 0),e=ly(e),t===void 0?(t=e,e=0):t=ly(t),n=n===void 0?e<t?1:-1:ly(n);const r=Math.max(Math.ceil((t-e)/(n||1)),0),l=new Array(r);for(let s=0;s<r;s++)l[s]=e,e+=n;return l}var Nr=e=>e.chartData,Su=G([Nr],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),Qf=(e,t,n,r)=>r?Su(e):Nr(e),aE=(e,t,n)=>n?Su(e):Nr(e),n7=G([Qf],e=>{var t=e.chartData,n=e.dataStartIndex,r=e.dataEndIndex;return t!=null?t.slice(n,r+1):[]}),r7=G([Su],e=>{var t=e.chartData,n=e.dataStartIndex,r=e.dataEndIndex;return t!=null?t.slice(n,r+1):[]}),a7=G([Nr],e=>{var t=e.chartData,n=e.dataStartIndex,r=e.dataEndIndex;return t!=null?t.slice(n,r+1):[]});function c0(e,t){return s7(e)||o7(e,t)||l7(e,t)||i7()}function i7(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function l7(e,t){if(e){if(typeof e=="string")return s_(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s_(e,t):void 0}}function s_(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function o7(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,l,s,d,f=[],h=!0,m=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(h=(r=s.call(n)).done)&&(f.push(r.value),f.length!==t);h=!0);}catch(y){m=!0,l=y}finally{try{if(!h&&n.return!=null&&(d=n.return(),Object(d)!==d))return}finally{if(m)throw l}}return f}}function s7(e){if(Array.isArray(e))return e}function zr(e){if(Array.isArray(e)&&e.length===2){var t=c0(e,2),n=t[0],r=t[1];if(ze(n)&&ze(r))return!0}return!1}function u_(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function iE(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var n=c0(e,2),r=n[0],l=n[1],s,d;if(ze(r))s=r;else if(typeof r=="function")return;if(ze(l))d=l;else if(typeof l=="function")return;var f=[s,d];if(zr(f))return f}}function u7(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(zr(r))return u_(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var l=c0(e,2),s=l[0],d=l[1],f,h;if(s==="auto")t!=null&&(f=Math.min(...t));else if(ye(s))f=s;else if(typeof s=="function")try{t!=null&&(f=s(t==null?void 0:t[0]))}catch{}else if(typeof s=="string"&&Qj.test(s)){var m=Qj.exec(s);if(m==null||m[1]==null||t==null)f=void 0;else{var y=+m[1];f=t[0]-y}}else f=t==null?void 0:t[0];if(d==="auto")t!=null&&(h=Math.max(...t));else if(ye(d))h=d;else if(typeof d=="function")try{t!=null&&(h=d(t==null?void 0:t[1]))}catch{}else if(typeof d=="string"&&Jj.test(d)){var p=Jj.exec(d);if(p==null||p[1]==null||t==null)h=void 0;else{var x=+p[1];h=t[1]+x}}else h=t==null?void 0:t[1];var w=[f,h];if(zr(w))return t==null?w:u_(w,t,n)}}}var ko=1e9,c7={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},f0,vt=!0,cr="[DecimalError] ",Fi=cr+"Invalid argument: ",d0=cr+"Exponent out of range: ",Co=Math.floor,Ui=Math.pow,d7=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Bn,Yt=1e7,ft=7,lE=9007199254740991,tf=Co(lE/ft),ge={};ge.absoluteValue=ge.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};ge.comparedTo=ge.cmp=function(e){var t,n,r,l,s=this;if(e=new s.constructor(e),s.s!==e.s)return s.s||-e.s;if(s.e!==e.e)return s.e>e.e^s.s<0?1:-1;for(r=s.d.length,l=e.d.length,t=0,n=r<l?r:l;t<n;++t)if(s.d[t]!==e.d[t])return s.d[t]>e.d[t]^s.s<0?1:-1;return r===l?0:r>l^s.s<0?1:-1};ge.decimalPlaces=ge.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*ft;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};ge.dividedBy=ge.div=function(e){return ya(this,new this.constructor(e))};ge.dividedToIntegerBy=ge.idiv=function(e){var t=this,n=t.constructor;return lt(ya(t,new n(e),0,1),n.precision)};ge.equals=ge.eq=function(e){return!this.cmp(e)};ge.exponent=function(){return Dt(this)};ge.greaterThan=ge.gt=function(e){return this.cmp(e)>0};ge.greaterThanOrEqualTo=ge.gte=function(e){return this.cmp(e)>=0};ge.isInteger=ge.isint=function(){return this.e>this.d.length-2};ge.isNegative=ge.isneg=function(){return this.s<0};ge.isPositive=ge.ispos=function(){return this.s>0};ge.isZero=function(){return this.s===0};ge.lessThan=ge.lt=function(e){return this.cmp(e)<0};ge.lessThanOrEqualTo=ge.lte=function(e){return this.cmp(e)<1};ge.logarithm=ge.log=function(e){var t,n=this,r=n.constructor,l=r.precision,s=l+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Bn))throw Error(cr+"NaN");if(n.s<1)throw Error(cr+(n.s?"NaN":"-Infinity"));return n.eq(Bn)?new r(0):(vt=!1,t=ya(ou(n,s),ou(e,s),s),vt=!0,lt(t,l))};ge.minus=ge.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?uE(t,e):oE(t,(e.s=-e.s,e))};ge.modulo=ge.mod=function(e){var t,n=this,r=n.constructor,l=r.precision;if(e=new r(e),!e.s)throw Error(cr+"NaN");return n.s?(vt=!1,t=ya(n,e,0,1).times(e),vt=!0,n.minus(t)):lt(new r(n),l)};ge.naturalExponential=ge.exp=function(){return sE(this)};ge.naturalLogarithm=ge.ln=function(){return ou(this)};ge.negated=ge.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};ge.plus=ge.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?oE(t,e):uE(t,(e.s=-e.s,e))};ge.precision=ge.sd=function(e){var t,n,r,l=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Fi+e);if(t=Dt(l)+1,r=l.d.length-1,n=r*ft+1,r=l.d[r],r){for(;r%10==0;r/=10)n--;for(r=l.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};ge.squareRoot=ge.sqrt=function(){var e,t,n,r,l,s,d,f=this,h=f.constructor;if(f.s<1){if(!f.s)return new h(0);throw Error(cr+"NaN")}for(e=Dt(f),vt=!1,l=Math.sqrt(+f),l==0||l==1/0?(t=Pr(f.d),(t.len Line truncated
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function m7(e,t){if(e){if(typeof e=="string")return f_(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f_(e,t):void 0}}function f_(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function v7(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,l,s,d,f=[],h=!0,m=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(h=(r=s.call(n)).done)&&(f.push(r.value),f.length!==t);h=!0);}catch(y){m=!0,l=y}finally{try{if(!h&&n.return!=null&&(d=n.return(),Object(d)!==d))return}finally{if(m)throw l}}return f}}function y7(e){if(Array.isArray(e))return e}var hE=e=>{var t=su(e,2),n=t[0],r=t[1],l=n,s=r;return n>r&&(l=r,s=n),[l,s]},h0=(e,t,n)=>{if(e.lte(0))return new Ke(0);var r=dE(e.toNumber()),l=new Ke(10).pow(r),s=e.div(l),d=r!==1?.05:.1,f=new Ke(Math.ceil(s.div(d).toNumber())).add(n).mul(d),h=f.mul(l);return t?new Ke(h.toNumber()):new Ke(Math.ceil(h.toNumber()))},mE=(e,t,n)=>{var r;if(e.lte(0))return new Ke(0);var l=[1,2,2.5,5],s=e.toNumber(),d=Math.floor(new Ke(s).abs().log(10).toNumber()),f=new Ke(10).pow(d),h=e.div(f).toNumber(),m=l.findIndex(w=>w>=h-1e-10);if(m===-1&&(f=f.mul(10),m=0),m+=n,m>=l.length){var y=Math.floor(m/l.length);m%=l.length,f=f.mul(new Ke(10).pow(y))}var p=(r=l[m])!==null&&r!==void 0?r:1,x=new Ke(p).mul(f);return t?x:new Ke(Math.ceil(x.toNumber()))},p7=(e,t,n)=>{var r=new Ke(1),l=new Ke(e);if(!l.isint()&&n){var s=Math.abs(e);s<1?(r=new Ke(10).pow(dE(e)-1),l=new Ke(Math.floor(l.div(r).toNumber())).mul(r)):s>1&&(l=new Ke(Math.floor(e)))}else e===0?l=new Ke(Math.floor((t-1)/2)):n||(l=new Ke(Math.floor(e)));for(var d=Math.floor((t-1)/2),f=[],h=0;h<t;h++)f.push(l.add(new Ke(h-d).mul(r)).toNumber());return f},vE=function(t,n,r,l){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,d=arguments.length>5&&arguments[5]!==void 0?arguments[5]:h0;if(!Number.isFinite((n-t)/(r-1)))return{step:new Ke(0),tickMin:new Ke(0),tickMax:new Ke(0)};var f=d(new Ke(n).sub(t).div(r-1),l,s),h;t<=0&&n>=0?h=new Ke(0):(h=new Ke(t).add(n).div(2),h=h.sub(new Ke(h).mod(f)));var m=Math.ceil(h.sub(t).div(f).toNumber()),y=Math.ceil(new Ke(n).sub(h).div(f).toNumber()),p=m+y+1;return p>r?vE(t,n,r,l,s+1,d):(p<r&&(y=n>0?y+(r-p):y,m=n>0?m:m+(r-p)),{step:f,tickMin:h.sub(new Ke(m).mul(f)),tickMax:h.add(new Ke(y).mul(f))})},h_=function(t){var n=su(t,2),r=n[0],l=n[1],s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",h=Math.max(s,2),m=hE([r,l]),y=su(m,2),p=y[0],x=y[1];if(p===-1/0||x===1/0){var w=x===1/0?[p,...Array(s-1).fill(1/0)]:[...Array(s-1).fill(-1/0),x];return r>l?w.reverse():w}if(p===x)return p7(p,s,d);var j=f==="snap125"?mE:h0,_=vE(p,x,h,d,0,j),N=_.step,O=_.tickMin,A=_.tickMax,D=fE(O,A.add(new Ke(.1).mul(N)),N);return r>l?D.reverse():D},m_=function(t,n){var r=su(t,2),l=r[0],s=r[1],d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",h=hE([l,s]),m=su(h,2),y=m[0],p=m[1];if(y===-1/0||p===1/0)return[l,s];if(y===p)return[y];var x=f==="snap125"?mE:h0,w=Math.max(n,2),j=x(new Ke(p).sub(y).div(w-1),d,0),_=[...fE(new Ke(y),new Ke(p),j),p];return d===!1&&(_=_.map(N=>Math.round(N))),l>s?_.reverse():_},yE=e=>e.rootProps.maxBarSize,g7=e=>e.rootProps.barGap,pE=e=>e.rootProps.barCategoryGap,x7=e=>e.rootProps.barSize,Nu=e=>e.rootProps.stackOffset,gE=e=>e.rootProps.reverseStackOrder,m0=e=>e.options.chartName,v0=e=>e.rootProps.syncId,xE=e=>e.rootProps.syncMethod,y0=e=>e.options.eventEmitter,b7=e=>e.rootProps.baseValue,Tt={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},Pi={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},Mr={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},Jf=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function eh(e,t,n){if(n!=="auto")return n;if(e!=null)return Hr(e,t)?"category":"number"}function v_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,r)}return n}function nf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?v_(Object(n),!0).forEach(function(r){w7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}retu Line truncated
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dB(e,t){if(e){if(typeof e=="string")return rS(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?rS(e,t):void 0}}function rS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function fB(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,l,s,d,f=[],h=!0,m=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(h=(r=s.call(n)).done)&&(f.push(r.value),f.length!==t);h=!0);}catch(y){m=!0,l=y}finally{try{if(!h&&n.return!=null&&(d=n.return(),Object(d)!==d))return}finally{if(m)throw l}}return f}}function hB(e){if(Array.isArray(e))return e}var pp=[0,"auto"],$t={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"bottom",padding:{left:0,right:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"category",unit:void 0,niceTicks:"auto"},ck=(e,t)=>e.cartesianAxis.xAxis[t],Na=(e,t)=>{var n=ck(e,t);return n??$t},It={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:pp,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,niceTicks:"auto",width:xu},dk=(e,t)=>e.cartesianAxis.yAxis[t],Aa=(e,t)=>{var n=dk(e,t);return n??It},mB={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},Y0=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??mB},St=(e,t,n)=>{switch(t){case"xAxis":return Na(e,n);case"yAxis":return Aa(e,n);case"zAxis":return Y0(e,n);case"angleAxis":return p0(e,n);case"radiusAxis":return g0(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},vB=(e,t,n)=>{switch(t){case"xAxis":return Na(e,n);case"yAxis":return Aa(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Do=(e,t,n)=>{switch(t){case"xAxis":return Na(e,n);case"yAxis":return Aa(e,n);case"angleAxis":return p0(e,n);case"radiusAxis":return g0(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},fk=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function G0(e,t){return n=>{switch(e){case"xAxis":return"xAxisId"in n&&n.xAxisId===t;case"yAxis":return"yAxisId"in n&&n.yAxisId===t;case"zAxis":return"zAxisId"in n&&n.zAxisId===t;case"angleAxis":return"angleAxisId"in n&&n.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in n&&n.radiusAxisId===t;default:return!1}}}var fh=e=>e.graphicalItems.cartesianItems,yB=G([pt,Au],G0),V0=(e,t,n)=>e.filter(n).filter(r=>(t==null?void 0:t.includeHidden)===!0?!0:!r.hide),Po=G([fh,St,yB],V0,{memoizeOptions:{resultEqualityCheck:ih}}),hk=G([Po],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(rh)),mk=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),pB=G([Po],mk),X0=e=>e.map(t=>t.data).filter(Boolean).flat(1),gB=G([Po],e=>e.some(t=>!t.data)),vk=G([Po],X0,{memoizeOptions:{resultEqualityCheck:ih}}),F0=(e,t)=>{var n=t.chartData,r=n===void 0?[]:n,l=t.dataStartIndex,s=t.dataEndIndex;return e.length>0?e:r.slice(l,s+1)},Z0=G([vk,Qf],F0),yk=(e,t,n)=>(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:We(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(l=>({value:We(l,r)}))):e.map(r=>({value:r})),pk=(e,t,n,r,l,s)=>{var d=r.chartData,f=d===void 0?[]:d,h=r.dataStartIndex,m=r.dataEndIndex,y=yk(e,t,n);if(l&&(t==null?void 0:t.dataKey)!=null&&s.length>0){var p=f.slice(h,m+1),x=p.map(w=>({value:We(w,t.dataKey)})).filter(w=>w.value!=null);return[...x,...y]}return y},Mu=G([Z0,St,Po,Qf,gB,vk],pk);function ho(e){if(Rr(e)||e instanceof Date){var t=Number(e);if(ze(t))return t}}function aS(e){if(Array.isArray(e)){var t=[ho(e[0]),ho(e[1])];return zr(t)?t:void 0}var n=ho(e);if(n!=null)return[n,n]}function Ur(e){return e.map(ho).filter(An)}function xB(e,t){var n=ho(e),r=ho(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var bB=G([Mu],e=>e==null?void 0:e.map(t=>t.value).sort(xB));function gk(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function wB(e,t,n){if(!n)return[];if(!n.length)return[];var r;if(typeof t=="number"&&!jr(t))r=t;else if(Array.isArray(t)){var l=Ur(t);l.length>0&&(r=Math.max(...l))}return r==null?[]:Ur(n.flatMap(s=>{var d=We(e,s.dataKey),f,h;if(Array.isArray(d)){var m=uk(d,2);f=m[0],h=m[1]}else f=h=d;if(!(!ze(f)||!ze(h)))return[r-f,r+h]}))}var Ht=e=>{var t=Xt(e),n=Mo(e);return Do(e,t,n)},jo=G([Ht],e=>e==nu Line truncated
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _q(e,t){if(e){if(typeof e=="string")return _S(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_S(e,t):void 0}}function _S(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Sq(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,l,s,d,f=[],h=!0,m=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(h=(r=s.call(n)).done)&&(f.push(r.value),f.length!==t);h=!0);}catch(y){m=!0,l=y}finally{try{if(!h&&n.return!=null&&(d=n.return(),Object(d)!==d))return}finally{if(m)throw l}}return f}}function Nq(e){if(Array.isArray(e))return e}function Aq(e){return e.dataKey}function Oq(e,t){return b.isValidElement(e)?b.cloneElement(e,t):typeof e=="function"?b.createElement(e,t):b.createElement(N8,t)}var SS=[],Eq={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",axisId:0,contentStyle:{},cursor:!0,filterNull:!0,includeHidden:!1,isAnimationActive:"auto",itemSorter:"name",itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,wrapperStyle:{}};function vd(e){var t,n,r=Vt(e,Eq),l=r.active,s=r.allowEscapeViewBox,d=r.animationDuration,f=r.animationEasing,h=r.content,m=r.filterNull,y=r.isAnimationActive,p=r.offset,x=r.payloadUniqBy,w=r.position,j=r.reverseDirection,_=r.useTranslate3d,N=r.wrapperStyle,O=r.cursor,A=r.shared,D=r.trigger,k=r.defaultIndex,z=r.portal,M=r.axisId,$=at(),U=typeof k=="number"?String(k):k;b.useEffect(()=>{$(yU({shared:A,trigger:D,axisId:M,active:l,defaultIndex:U}))},[$,A,D,M,l,U]);var V=Xf(),R=GO(),F=cU(A),Z=(t=pe(be=>EH(be,F,D,U)))!==null&&t!==void 0?t:{},he=Z.activeIndex,fe=Z.isActive,se=pe(be=>OH(be,F,D,U)),q=pe(be=>dC(be,F,D,U)),te=pe(be=>AH(be,F,D,U)),re=se,X=WH(),T=(n=l??fe)!==null&&n!==void 0?n:!1,E=VA([re,T]),L=wq(E,2),K=L[0],ie=L[1],me=F==="axis"?q:void 0;pq(F,D,te,me,he,T);var ve=z??X;if(ve==null||V==null||F==null)return null;var je=re??SS;T||(je=SS),m&&je.length&&(je=HA(je.filter(be=>be.value!=null&&(be.hide!==!0||r.includeHidden)),x,Aq));var Te=je.length>0,de=jS(jS({},r),{},{payload:je,label:me,active:T,activeIndex:he,coordinate:te,accessibilityLayer:R}),we=b.createElement(G8,{allowEscapeViewBox:s,animationDuration:d,animationEasing:f,isAnimationActive:y,active:T,coordinate:te,hasPayload:Te,offset:p,position:w,reverseDirection:j,useTranslate3d:_,viewBox:V,wrapperStyle:N,lastBoundingBox:K,innerRef:ie,hasPortalFromProps:!!z},Oq(h,de));return b.createElement(b.Fragment,null,Lt.createPortal(we,ve),T&&b.createElement(ZH,{cursor:O,tooltipEventType:F,coordinate:te,payload:je,index:he}))}var Wi=e=>null;Wi.displayName="Cell";function kq(e,t,n){return(t=Cq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cq(e){var t=Mq(e,"string");return typeof t=="symbol"?t:t+""}function Mq(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class Tq{constructor(t){kq(this,"cache",new Map),this.maxSize=t}get(t){var n=this.cache.get(t);return n!==void 0&&(this.cache.delete(t),this.cache.set(t,n)),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var r=this.cache.keys().next().value;r!=null&&this.cache.delete(r)}this.cache.set(t,n)}clear(){this.cache.clear()}size(){return this.cache.size}}function NS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,r)}return n}function Dq(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NS(Object(n),!0).forEach(function(r){Pq(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Pq(e,t,n){return(t=zq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zq(e){var t=$q(e,"string");return typeof t=="symbol"?t:t+""}function $q(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Iq={cacheSize:2e3,enableCache:!0},yC=Dq({},Iq),AS=new Tq(yC.cacheSize),Rq={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},OS="recharts_measurement_span";function Lq(e,t){var n=t.fontSize||"",r=t.fontFami Line truncated
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Uq(e,t){if(e){if(typeof e=="string")return kS(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?kS(e,t):void 0}}function kS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Hq(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,l,s,d,f=[],h=!0,m=!1;try{if(s=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;h=!1}else for(;!(h=(r=s.call(n)).done)&&(f.push(r.value),f.length!==t);h=!0);}catch(y){m=!0,l=y}finally{try{if(!h&&n.return!=null&&(d=n.return(),Object(d)!==d))return}finally{if(m)throw l}}return f}}function qq(e){if(Array.isArray(e))return e}function Kq(e,t,n){return(t=Yq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yq(e){var t=Gq(e,"string");return typeof t=="symbol"?t:t+""}function Gq(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var CS=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,MS=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Vq=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,Xq=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Fq={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Zq=["cm","mm","pt","pc","in","Q","px"];function Wq(e){return Zq.includes(e)}var uo="NaN";function Qq(e,t){return e*Fq[t]}class rn{static parse(t){var n,r=(n=Xq.exec(t))!==null&&n!==void 0?n:[],l=xf(r,3),s=l[1],d=l[2];return s==null?rn.NaN:new rn(parseFloat(s),d??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,jr(t)&&(this.unit=""),n!==""&&!Vq.test(n)&&(this.num=NaN,this.unit=""),Wq(n)&&(this.num=Qq(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new rn(NaN,""):new rn(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new rn(NaN,""):new rn(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new rn(NaN,""):new rn(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new rn(NaN,""):new rn(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return jr(this.num)}}pC=rn;Kq(rn,"NaN",new pC(NaN,""));function gC(e){if(e==null||e.includes(uo))return uo;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=CS.exec(t))!==null&&n!==void 0?n:[],l=xf(r,4),s=l[1],d=l[2],f=l[3],h=rn.parse(s??""),m=rn.parse(f??""),y=d==="*"?h.multiply(m):h.divide(m);if(y.isNaN())return uo;t=t.replace(CS,y.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var p,x=(p=MS.exec(t))!==null&&p!==void 0?p:[],w=xf(x,4),j=w[1],_=w[2],N=w[3],O=rn.parse(j??""),A=rn.parse(N??""),D=_==="+"?O.add(A):O.subtract(A);if(D.isNaN())return uo;t=t.replace(MS,D.toString())}return t}var TS=/\(([^()]*)\)/;function Jq(e){for(var t=e,n;(n=TS.exec(t))!=null;){var r=n,l=xf(r,2),s=l[1];t=t.replace(TS,gC(s))}return t}function eK(e){var t=e.replace(/\s+/g,"");return t=Jq(t),t=gC(t),t}function tK(e){try{return eK(e)}catch{return uo}}function py(e){var t=tK(e.slice(5,-1));return t===uo?"":t}var nK=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],rK=["dx","dy","angle","className","breakAll"];function bp(){return bp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bp.apply(null,arguments)}function DS(e,t){if(e==null)return{};var n,r,l=aK(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(l[n]=e[n])}return l}function aK(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function PS(e,t){return sK(e)||oK(e,t)||lK(e,t)||iK()}function iK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lK(e,t){if(e){if(typeof e=="string")return zS(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zS(e,t):void 0}}function zS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function oK(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,l,s,d,f=[],h=!0,m=!1;try{if(s=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;h=!1}else for(;!(h=(r=s.call(n)).done)&&(f.push(r.value),f.length!==t);h=!0);}catch(y){m=!0,l=y}finally{try{if(!h&&n.return!=null&&(d=n.return(),Object(d)!==d))return}finally{if(m)throw l}}return f}}function sK(e){if(Array.isArray(e))return e}var xC=/[ \f\n\r\t\v\u2028\u2029]+/,bC=e=>{var t=e.children,n=e.breakAll,r=e.style;try{var l=[];yt(t)||(n?l=t.toString().split(""):l=t.toString().split(xC));var s=l.map(f=>({word:f,width:Qs(f,r).width})),d=n?0:Qs(" ",r).width;return{wordsWithComputedWidth:s,spaceWidth:d}}catch{return null}};function wC(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function uK(e){return yt(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var jC=(e,t,n,r)=>e.reduce((l,s)=>{var d=s.word,f=s.width,h=l[l.length-1];if(h&&f!=null&&(t==null||r||h.width+f+n<Number(t)))h.words.push(d),h.width+=f+n;else{var m={words:[d],width:f};l.push(m)}return l},[]),_C=e=>e.reduce((t,n)=>t.width>n.width?t:n),cK="…",$S=(e,t,n,r,l,s,d,f)=>{var h=e.slice(0,t),m=bC({breakAll:n,style:r,children:h+cK});if(!m)return[!1,[]];var y=jC(m.wordsWithComputedWidth,s,d,f),p=y.length>l||_C(y).width>Number(s);return[p,y]},dK=(e,t,n,r,l)=>{var s=e.maxLines,d=e.children,f=e.style,h=e.breakAll,m=ye(s),y=String(d),p=jC(t,r,n,l);if(!m||l)return p;var x=p.length>s||_C(p).width>Number(r);if(!x)return p;for(var w=0,j=y.length-1,_=0,N;w<=j&&_<=y.length-1;){var O=Math.floor((w+j)/2),A=O-1,D=$S(y,A,h,f,s,r,n,l),k=PS(D,2),z=k[0],M=k[1],$=$S(y,O,h,f,s,r,n,l),U=PS($,1),V=U[0];if(!z&&!V&&(w=O+1),z&&V&&(j=O-1),!z&&V){N=M;break}_++}return N||p},IS=e=>{var t=yt(e)?[]:e.toString().split(xC);return[{words:t,width:void 0}]},fK=e=>{var t=e.width,n=e.scaleToFit,r=e.children,l=e.style,s=e.breakAll,d=e.maxLines;if((t||n)&&!_u.isSsr){var f,h,m=bC({breakAll:s,children:r,style:l});if(m){var y=m.wordsWithComputedWidth,p=m.spaceWidth;f=y,h=p}else return IS(r);return dK({breakAll:s,children:r,maxLines:d,style:l},f,h,t,!!n)}return IS(r)},SC="#808080",hK={angle:0,breakAll:!1,capHeight:"0.71em",fill:SC,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},gh=b.forwardRef((e,t)=>{var n=Vt(e,hK),r=n.x,l=n.y,s=n.lineHeight,d=n.capHeight,f=n.fill,h=n.scaleToFit,m=n.textAnchor,y=n.verticalAnchor,p=DS(n,nK),x=b.useMemo(()=>fK({breakAll:p.breakAll,children:p.children,maxLines:p.maxLines,scaleToFit:h,style:p.style,width:p.width}),[p.breakAll,p.children,p.maxLines,h,p.style,p.width]),w=p.dx,j=p.dy,_=p.angle,N=p.className,O=p.breakAll,A=DS(p,rK);if(!Rr(r)||!Rr(l)||x.length===0)return null;var D=Number(r)+(ye(w)?w:0),k=Number(l)+(ye(j)?j:0);if(!ze(D)||!ze(k))return null;var z;switch(y){case"start":z=py("calc(".concat(d,")"));break;case"middle":z=py("calc(".concat((x.length-1)/2," * -").concat(s," + (").concat(d," / 2))"));break;default:z=py("calc(".concat(x.length-1," * -").concat(s,")"));break}var M=[],$=x[0];if(h&&$!=null){var U=$.width,V=p.width;M.push("scale(".concat(ye(V)&&ye(U)?V/U:1,")"))}return _&&M.push("rotate(".concat(_,", ").concat(D,", ").concat(k,")")),M.length&&(A.transform=M.join(" ")),b.createElement("text",bp({},qn(A),{ref:t,x:D,y:k,className:Ze("recharts-text",N),textAnchor:m,fill:f.includes("url")?SC:f}),x.map((R,F)=>{var Z=R.words.join(O?"":" ");return b.createElement("tspan",{x:D,dy:F===0?z:s,key:"".concat(Z,"-").concat(F)},Z)}))});gh.displayName="Text";function RS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,r)}return n}function Tr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RS(Object(n),!0).forEach(function(r){mK(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mK(e,t,n){return(t=vK(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vK(e){var t=yK(e,"string");return typeof t=="symbol"?t:t+""}function yK(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number) Line truncated
A`).concat(j,",").concat(j,",0,1,").concat(A?0:1,`,
`).concat(k.x,",").concat(k.y),M=yt(e.id)?eu("recharts-radial-line-"):e.id;return b.createElement("text",fa({},r,{dominantBaseline:"central",className:Ze("recharts-radial-bar-label",d)}),b.createElement("defs",null,b.createElement("path",{id:M,d:z})),b.createElement("textPath",{xlinkHref:"#".concat(M)},n))},CK=(e,t,n)=>{var r=e.cx,l=e.cy,s=e.innerRadius,d=e.outerRadius,f=e.startAngle,h=e.endAngle,m=(f+h)/2;if(n==="outside"){var y=Mt(r,l,d+t,m),p=y.x,x=y.y;return{x:p,y:x,textAnchor:p>=r?"start":"end",verticalAnchor:"middle"}}if(n==="center")return{x:r,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(n==="centerTop")return{x:r,y:l,textAnchor:"middle",verticalAnchor:"start"};if(n==="centerBottom")return{x:r,y:l,textAnchor:"middle",verticalAnchor:"end"};var w=(s+d)/2,j=Mt(r,l,w,m),_=j.x,N=j.y;return{x:_,y:N,textAnchor:"middle",verticalAnchor:"middle"}},Nd=e=>e!=null&&"cx"in e&&ye(e.cx),MK={angle:0,offset:5,zIndex:Tt.label,position:"middle",textBreakAll:!1};function TK(e){if(!Nd(e))return e;var t=e.cx,n=e.cy,r=e.outerRadius,l=r*2;return{x:t-r,y:n-r,width:l,upperWidth:l,lowerWidth:l,height:l}}function ni(e){var t=Vt(e,MK),n=t.viewBox,r=t.parentViewBox,l=t.position,s=t.value,d=t.children,f=t.content,h=t.className,m=h===void 0?"":h,y=t.textBreakAll,p=t.labelRef,x=AK(),w=AC(),j=l==="center"?w:x??w,_,N,O;n==null?_=j:Nd(n)?_=n:_=r0(n);var A=TK(_);if(!_||yt(s)&&yt(d)&&!b.isValidElement(f)&&typeof f!="function")return null;var D=Xs(Xs({},t),{},{viewBox:_});if(b.isValidElement(f)){D.labelRef;var k=LS(D,gK);return b.cloneElement(f,k)}if(typeof f=="function"){D.content;var z=LS(D,xK);if(N=b.createElement(f,z),b.isValidElement(N))return N}else N=OK(t);var M=qn(t);if(Nd(_)){if(l==="insideStart"||l==="insideEnd"||l==="end")return kK(t,l,N,M,_);O=CK(_,t.offset,t.position)}else{if(!A)return null;var $=pK({viewBox:A,position:l,offset:t.offset,parentViewBox:Nd(r)?void 0:r});O=Xs(Xs({x:$.x,y:$.y,textAnchor:$.horizontalAnchor,verticalAnchor:$.verticalAnchor},$.width!==void 0?{width:$.width}:{}),$.height!==void 0?{height:$.height}:{})}return b.createElement(kn,{zIndex:t.zIndex},b.createElement(gh,fa({ref:p,className:Ze("recharts-label",m)},M,O,{textAnchor:wC(M.textAnchor)?M.textAnchor:O.textAnchor,breakAll:y}),N))}ni.displayName="Label";var DK=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?b.createElement(ni,fa({key:"label-implicit"},r)):Rr(e)?b.createElement(ni,fa({key:"label-implicit",value:e},r)):b.isValidElement(e)?e.type===ni?b.cloneElement(e,Xs({key:"label-implicit"},r)):b.createElement(ni,fa({key:"label-implicit",content:e},r)):wg(e)?b.createElement(ni,fa({key:"label-implicit",content:e},r)):e&&typeof e=="object"?b.createElement(ni,fa({},e,{key:"label-implicit"},r)):null};function PK(e){var t=e.label,n=e.labelRef,r=AC();return DK(t,r,n)||null}var zK=["valueAccessor"],$K=["dataKey","clockWise","id","textBreakAll","zIndex"];function bf(){return bf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bf.apply(null,arguments)}function US(e,t){if(e==null)return{};var n,r,l=IK(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(l[n]=e[n])}return l}function IK(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var RK=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(uK(t))return t},OC=b.createContext(void 0),EC=OC.Provider,kC=b.createContext(void 0),LK=kC.Provider;function BK(){return b.useContext(OC)}function UK(){return b.useContext(kC)}function Ad(e){var t=e.valueAccessor,n=t===void 0?RK:t,r=US(e,zK),l=r.dataKey;r.clockWise;var s=r.id,d=r.textBreakAll,f=r.zIndex,h=US(r,$K),m=BK(),y=UK(),p=m||y;return!p||!p.length?null:b.createElement(kn,{zIndex:f??Tt.label},b.createElement(_t,{className:"recharts-label-list"},p.map((x,w)=>{var j,_=yt(l)?n(x,w):We(x.payload,l),N=yt(s)?{}:{id:"".concat(s,"-").concat(w)};return b.createElement(ni,bf({key:"label-".concat(w)},qn(x),h,N,{fill:(j=r.fill)!==null&&j!==void 0?j:x.fill,parentViewBox:x.parentViewBox,value:_,textBreakAll:d,viewBox:x.viewBox,index:w,zIndex:0}))})))}Ad.displayName="LabelList";function jg(e){var t=e.label;return t?t===!0?b.createElement(Ad,{key:"labelList-implicit"}):b.isValidElement(t)||wg(t)?b.createElement(Ad,{key:"labelList-implicit",content:t}):typeof t=="object"?b.createElement(Ad,bf({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function wp(){return wp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wp.apply(null,arguments)}var CC=e=>{var t=e.cx,n=e.cy,r=e.r,l=e.className,s=Ze("recharts-dot",l);return ye(t)&&ye(n)&&ye(r)?b.createElement("circle",wp({},En(e),Gp(e),{className:s,cx:t,cy:n, Line truncated
* @license React
* react-is.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var YS;function aY(){if(YS)return rt;YS=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),d=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),x=Symbol.for("react.view_transition"),w=Symbol.for("react.client.reference");function j(_){if(typeof _=="object"&&_!==null){var N=_.$$typeof;switch(N){case e:switch(_=_.type,_){case n:case l:case r:case h:case m:case x:return _;default:switch(_=_&&_.$$typeof,_){case d:case f:case p:case y:return _;case s:return _;default:return N}}case t:return N}}}return rt.ContextConsumer=s,rt.ContextProvider=d,rt.Element=e,rt.ForwardRef=f,rt.Fragment=n,rt.Lazy=p,rt.Memo=y,rt.Portal=t,rt.Profiler=l,rt.StrictMode=r,rt.Suspense=h,rt.SuspenseList=m,rt.isContextConsumer=function(_){return j(_)===s},rt.isContextProvider=function(_){return j(_)===d},rt.isElement=function(_){return typeof _=="object"&&_!==null&&_.$$typeof===e},rt.isForwardRef=function(_){return j(_)===f},rt.isFragment=function(_){return j(_)===n},rt.isLazy=function(_){return j(_)===p},rt.isMemo=function(_){return j(_)===y},rt.isPortal=function(_){return j(_)===t},rt.isProfiler=function(_){return j(_)===l},rt.isStrictMode=function(_){return j(_)===r},rt.isSuspense=function(_){return j(_)===h},rt.isSuspenseList=function(_){return j(_)===m},rt.isValidElementType=function(_){return typeof _=="string"||typeof _=="function"||_===n||_===l||_===r||_===h||_===m||typeof _=="object"&&_!==null&&(_.$$typeof===p||_.$$typeof===y||_.$$typeof===d||_.$$typeof===s||_.$$typeof===f||_.$$typeof===w||_.getModuleId!==void 0)},rt.typeOf=j,rt}var GS;function iY(){return GS||(GS=1,gy.exports=aY()),gy.exports}var lY=iY(),VS=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",XS=null,xy=null,$C=e=>{if(e===XS&&Array.isArray(xy))return xy;var t=[];return b.Children.forEach(e,n=>{yt(n)||(lY.isFragment(n)?t=t.concat($C(n.props.children)):t.push(n))}),xy=t,XS=e,t};function Ng(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(l=>VS(l)):r=[VS(t)],$C(e).forEach(l=>{var s=Ir(l,"type.displayName")||Ir(l,"type.name");s&&r.indexOf(s)!==-1&&n.push(l)}),n}var IC=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0;function FS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,r)}return n}function ZS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FS(Object(n),!0).forEach(function(r){oY(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function oY(e,t,n){return(t=sY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sY(e){var t=uY(e,"string");return typeof t=="symbol"?t:t+""}function uY(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function RC(e,t){return ZS(ZS({},t),e)}function cY(e){return b.isValidElement(e)?e.props:e}function dY(e,t){return b.cloneElement(e,RC(cY(e),t))}function fY(e){if("index"in e){var t=e.index;return typeof t=="number"||typeof t=="string"?t:void 0}}function hY(e){return"isActive"in e&&e.isActive===!0}function Ag(e){var t=e.option,n=e.DefaultShape,r=e.shapeProps,l=e.activeClassName,s=l===void 0?"recharts-active-shape":l,d=e.inActiveClassName,f=d===void 0?"recharts-shape":d,h=fY(r),m;return b.isValidElement(t)?m=dY(t,r):t===n?m=b.createElement(n,r):typeof t=="function"?m=t(r,h):typeof t=="object"?m=b.createElement(n,RC(t,r)):m=b.createElement(n,r),hY(r)?b.createElement(_t,{className:s},m):b.createElement(_t,{className:f},m)}var Og=(e,t,n)=>{var r=at();return(l,s)=>d=>{e==null||e(l,s,d),r(qk({activeIndex:String(s),activeDataKey:t,activeCoordinate:l.tooltipPosition,activeGraphicalItemId:n}))}},Eg=e=>{var t=at();return(n,r)=>l=>{e==null||e(n,r,l),t(pU())}},kg=(e,t,n)=>{var r=at();return(l,s)=>d=>{e==null||e(l,s,d),r(gU({activeIndex:String(s),activeDataKey:t,activeCoordinate:l.tooltipPosition,activeGraphicalItemId:n}))}};function Cg(e){var t=e.tooltipEntrySettings,n=at(),r=hn(),l=b.useRef(null);return b.useLayoutEffect(()=>{r||(l.current===null?n(hU(t)):l.current!==t&&n(mU({prev:l.current,next:t})),l.current=t)},[t,n,r]),b.useLayoutEffect(()=>()=>{l.current&&(n(vU(l.current)),l.current=null)},[n]),null}function LC(e){var t=e.legendPayload,n=at(),r=hn(),l=b.useRef(null);return b.useLayoutEffect(()=>{r||(l.current===null?n(UO(t)):l.current!==t&&n(HO({prev:l.currentLine truncated
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pY(e,t){if(e){if(typeof e=="string")return WS(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?WS(e,t):void 0}}function WS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function gY(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,l,s,d,f=[],h=!0,m=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(h=(r=s.call(n)).done)&&(f.push(r.value),f.length!==t);h=!0);}catch(y){m=!0,l=y}finally{try{if(!h&&n.return!=null&&(d=n.return(),Object(d)!==d))return}finally{if(m)throw l}}return f}}function xY(e){if(Array.isArray(e))return e}var Mg="index",Tg="append";function Dg(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],r=[];for(var l of n)r.push({status:"removed",prev:l});for(var s=0;s<t.length;s++){var d=e[s],f=t[s];d!=null?r.push({status:"matched",prev:d,next:f}):r.push({status:"added",next:f})}return r}function bY(e,t){var n=e.length/t.length,r=t.map((l,s)=>e[Math.floor(s*n)]);return Dg(r,t)}function wY(e,t){var n=t.map((r,l)=>e[l]);return Dg(n,t)}function jY(e,t){for(var n=new Map,r=0;r<e.length;r++){var l=e[r];if(l!=null){var s=t(l,r);s!=null&&!n.has(s)&&n.set(s,l)}}return n}function _Y(e,t,n){var r=jY(e,n),l=new Set,s=t.map((p,x)=>{var w=n(p,x);if(w!=null){var j=r.get(w);if(j!==void 0)return l.add(w),j}}),d=[];for(var f of r){var h=vY(f,2),m=h[0],y=h[1];l.has(m)||d.push(y)}return Dg(s,t,d)}function jp(e,t,n){return t==null?null:e==null?t.map(r=>({status:"added",next:r})):n===Mg?bY(e,t):n===Tg?wY(e,t):_Y(e,t,n)}function BC(e,t){var n=b.useRef(e),r=b.useRef(t.current),l=b.useRef(!0);n.current!==e&&(n.current=e,r.current=t.current,l.current=!1);var s=b.useCallback(function(d,f){var h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(f===0){l.current=!0;return}f===1&&(r.current=d),f>0&&l.current&&h&&(t.current=d)},[t]);return{startValue:r.current,syncStepValue:s}}function SY(e,t){return EY(e)||OY(e,t)||AY(e,t)||NY()}function NY(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function AY(e,t){if(e){if(typeof e=="string")return QS(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?QS(e,t):void 0}}function QS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function OY(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,l,s,d,f=[],h=!0,m=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(h=(r=s.call(n)).done)&&(f.push(r.value),f.length!==t);h=!0);}catch(y){m=!0,l=y}finally{try{if(!h&&n.return!=null&&(d=n.return(),Object(d)!==d))return}finally{if(m)throw l}}return f}}function EY(e){if(Array.isArray(e))return e}function Pg(e,t){var n=b.useState(!1),r=SY(n,2),l=r[0],s=r[1],d=b.useCallback(()=>{typeof e=="function"&&e(),s(!0)},[e]),f=b.useCallback(()=>{typeof t=="function"&&t(),s(!1)},[t]);return{isAnimating:l,handleAnimationStart:d,handleAnimationEnd:f}}function zg(e){var t,n=e.animationInput,r=e.animationIdPrefix,l=e.items,s=e.previousItemsRef,d=e.isAnimationActive,f=e.animationBegin,h=e.animationDuration,m=e.animationEasing,y=e.onAnimationStart,p=e.onAnimationEnd,x=e.animationInterpolateFn,w=e.animationMatchBy,j=e.shouldUpdatePreviousRef,_=e.children,N=e.layout,O=WO(n,r),A=BC(O,s),D=(t=A.startValue)!==null&&t!==void 0?t:null,k=jp(D,l,w??Mg);return b.createElement(ZO,{animationId:O,begin:f,duration:h,isActive:d,easing:m,onAnimationEnd:p,onAnimationStart:y,key:O},z=>{var M=D==null,$=l==null?l:x(k,z,N),U=j?j(z):z>0;return A.syncStepValue($,z,U),$==null?null:_($,z,M)})}var by;function kY(e,t){return DY(e)||TY(e,t)||MY(e,t)||CY()}function CY(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function MY(e,t){if(e){if(typeof e=="string")return JS(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?JS(e,t):void 0}}function JS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function TY(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,l,s,d,f=[],h=!0,m=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(h=(r=s.call(n)).done)&&(f.push(r.value),f.length!==t);h=!0);}catch(y){m=!0,l=y}finally{try{if(!h&&n.return!=null&&(d=n.return(),Object(d)!==d))return}finally{if(m)throw l}}return f}}function DY(e){if(Array.isArray(e))return e}var PY=()=>{var e=b.useState(()=>eu("uid-")),t=kY(e,1),n=t[0];return n},UC=(by=iM.useId)!==null&&by!==void 0?by:PY;function zY(e,t){var n=UC();return t||(e?"".concat(e,"-").concat(n):n)}var $Y=b.createContext(void 0),$g=e=>{var t=e.id,n=e.type,r=e.children,l=zY("recharts-".concat(n),t);return b.createElement($Y.Provider,{value:l},r(l))},IY={cartesianItems:[],polarItems:[]},HC=fn({name:"graphicalItems",initialState:IY,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:dt()},replaceCartesianGraphicalItem:{reducer(e,t){var n=t.payload,r=n.prev,l=n.next,s=sr(e).cartesianItems.indexOf(r);s>-1&&(e.cartesianItems[s]=l)},prepare:dt()},removeCartesianGraphicalItem:{reducer(e,t){var n=sr(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:dt()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:dt()},removePolarGraphicalItem:{reducer(e,t){var n=sr(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:dt()},replacePolarGraphicalItem:{reducer(e,t){var n=t.payload,r=n.prev,l=n.next,s=sr(e).polarItems.indexOf(r);s>-1&&(e.polarItems[s]=l)},prepare:dt()}}}),Io=HC.actions,RY=Io.addCartesianGraphicalItem,LY=Io.replaceCartesianGraphicalItem,BY=Io.removeCartesianGraphicalItem,UY=Io.addPolarGraphicalItem,HY=Io.removePolarGraphicalItem,qY=Io.replacePolarGraphicalItem,KY=HC.reducer,YY=e=>{var t=at(),n=b.useRef(null);return b.useLayoutEffect(()=>{n.current===null?t(RY(e)):n.current!==e&&t(LY({prev:n.current,next:e})),n.current=e},[t,e]),b.useLayoutEffect(()=>()=>{n.current&&(t(BY(n.current)),n.current=null)},[t]),null},qC=b.memo(YY),GY=e=>{var t=at(),n=b.useRef(null);return b.useLayoutEffect(()=>{n.current===null?t(UY(e)):n.current!==e&&t(qY({prev:n.current,next:e})),n.current=e},[t,e]),b.useLayoutEffect(()=>()=>{n.current&&(t(HY(n.current)),n.current=null)},[t]),null},VY=b.memo(GY),XY=["key"],FY=["onMouseEnter","onClick","onMouseLeave"],ZY=["id"],WY=["id"];function ol(){return ol=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ol.apply(null,arguments)}function jh(e,t){if(e==null)return{};var n,r,l=QY(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(l[n]=e[n])}return l}function QY(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function eN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,r)}return n}function mt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eN(Object(n),!0).forEach(function(r){JY(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function JY(e,t,n){return(t=eG(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eG(e){var t=tG(e,"string");return typeof t=="symbol"?t:t+""}function tG(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var KC=nE;function nG(e){var t=b.useMemo(()=>Ng(e.children,Wi),[e.children]),n=pe(r=>nY(r,e.id,t));return n==null?null:b.createElement(mY,{legendPayload:n})}function rG(e){if(!(e==null||typeof e=="boolean"||typeof e=="function")){if(b.isValidElement(e)){var t,n=(t=e.props)===null||t===void 0?void 0:t.fill;return typeof n=="string"?n:void 0}var r=e.fill;return typeof r=="string"?r:void 0}}var aG=b.memo(e=>{var t=e.dataKey,n=e.nameKey,r=e.sectors,l=e.stroke,s=e.strokeWidth,d=e.fill,f=e.name,h=e.hide,m=e.tooltipType,y=e.id,p=e.activeShape,x=rG(p Line truncated
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function WG(e,t){if(e){if(typeof e=="string")return lN(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?lN(e,t):void 0}}function lN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function QG(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,l,s,d,f=[],h=!0,m=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(h=(r=s.call(n)).done)&&(f.push(r.value),f.length!==t);h=!0);}catch(y){m=!0,l=y}finally{try{if(!h&&n.return!=null&&(d=n.return(),Object(d)!==d))return}finally{if(m)throw l}}return f}}function JG(e){if(Array.isArray(e))return e}var oN=(e,t,n)=>{var r=n??e;if(!yt(r))return un(r,t,0)},eV=(e,t,n)=>{var r={},l=e.filter(rh),s=e.filter(m=>m.stackId==null),d=l.reduce((m,y)=>{var p=m[y.stackId];return p==null&&(p=[]),p.push(y),m[y.stackId]=p,m},r),f=Object.entries(d).map(m=>{var y,p=FG(m,2),x=p[0],w=p[1],j=w.map(N=>N.dataKey),_=oN(t,n,(y=w[0])===null||y===void 0?void 0:y.barSize);return{stackId:x,dataKeys:j,barSize:_}}),h=s.map(m=>{var y=[m.dataKey].filter(x=>x!=null),p=oN(t,n,m.barSize);return{stackId:void 0,dataKeys:y,barSize:p}});return[...f,...h]};function sN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,r)}return n}function yd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sN(Object(n),!0).forEach(function(r){tV(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tV(e,t,n){return(t=nV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nV(e){var t=rV(e,"string");return typeof t=="symbol"?t:t+""}function rV(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function aV(e,t,n,r,l){var s,d=r.length;if(!(d<1)){var f=un(e,n,0,!0),h,m=[];if(ze((s=r[0])===null||s===void 0?void 0:s.barSize)){var y=!1,p=n/d,x=r.reduce((A,D)=>A+(D.barSize||0),0);x+=(d-1)*f,x>=n&&(x-=(d-1)*f,f=0),x>=n&&p>0&&(y=!0,p*=.9,x=d*p);var w=Math.round((n-x)/2),j={offset:w-f,size:0};h=r.reduce((A,D)=>{var k,z={stackId:D.stackId,dataKeys:D.dataKeys,position:{offset:j.offset+j.size+f,size:y?p:(k=D.barSize)!==null&&k!==void 0?k:0}},M=[...A,z];return j=z.position,M},m)}else{var _=un(t,n,0,!0);n-2*_-(d-1)*f<=0&&(f=0);var N=(n-2*_-(d-1)*f)/d;N>1&&(N=Math.round(N));var O=ze(l)?Math.min(N,l):N;h=r.reduce((A,D,k)=>[...A,{stackId:D.stackId,dataKeys:D.dataKeys,position:{offset:_+(N+f)*k+(N-O)/2,size:O}}],m)}return h}}var iV=(e,t,n,r,l,s,d)=>{var f=yt(d)?t:d,h=aV(n,r,l!==s?l:s,e,f);return l!==s&&h!=null&&(h=h.map(m=>yd(yd({},m),{},{position:yd(yd({},m.position),{},{offset:m.position.offset-l/2})}))),h},lV=(e,t)=>{var n=nh(t);if(!(!e||n==null||t==null)){var r=t.stackId;if(r!=null){var l=e[r];if(l){var s=l.stackedData;if(s)return s.find(d=>d.key===n)}}}},oV=(e,t)=>{if(!(e==null||t==null)){var n=e.find(r=>r.stackId===t.stackId&&t.dataKey!=null&&r.dataKeys.includes(t.dataKey));if(n!=null)return n.position}};function sV(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&ze(e.zIndex)?e.zIndex:t}var VC=e=>{var t=e.chartData,n=at(),r=hn();return b.useEffect(()=>r?()=>{}:(n(xS(t)),()=>{n(xS(void 0))}),[t,n,r]),null},uN={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},XC=fn({name:"brush",initialState:uN,reducers:{setBrushSettings(e,t){return t.payload==null?uN:t.payload}}});XC.actions.setBrushSettings;var uV=XC.reducer;function cV(e){return(e%180+180)%180}var dV=function(t){var n=t.width,r=t.height,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=cV(l),d=s*Math.PI/180,f=Math.atan(r/n),h=d>f&&d<Math.PI-f?r/Math.sin(d):n/Math.cos(d);return Math.abs(h)},fV={dots:[],areas:[],lines:[]},FC=fn({name:"referenceElements",initialState:fV,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=sr(e).dots.findIndex(r=>r===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=sr(e).areas.findIndex(r=>r===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var n=sr(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),Ro=FC.actions;Ro.addDot;Ro.removeDot;Ro.addArea;Ro.removeArea;Ro.addLine;Ro.removeLine;var hV=FC.reducer;function mV(e,t){return gV(e)||pV(e,t)||yV(e,t)||vV()}function vV(){ Line truncated
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yV(e,t){if(e){if(typeof e=="string")return cN(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cN(e,t):void 0}}function cN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function pV(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,l,s,d,f=[],h=!0,m=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(h=(r=s.call(n)).done)&&(f.push(r.value),f.length!==t);h=!0);}catch(y){m=!0,l=y}finally{try{if(!h&&n.return!=null&&(d=n.return(),Object(d)!==d))return}finally{if(m)throw l}}return f}}function gV(e){if(Array.isArray(e))return e}var xV=b.createContext(void 0),bV=e=>{var t=e.children,n=b.useState("".concat(eu("recharts"),"-clip")),r=mV(n,1),l=r[0],s=Ig();if(s==null)return null;var d=s.x,f=s.y,h=s.width,m=s.height;return b.createElement(xV.Provider,{value:l},b.createElement("defs",null,b.createElement("clipPath",{id:l},b.createElement("rect",{x:d,y:f,height:m,width:h}))),t)};function ZC(e,t){if(t<1)return[];if(t===1)return e;for(var n=[],r=0;r<e.length;r+=t){var l=e[r];l!==void 0&&n.push(l)}return n}function wV(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return dV(r,n)}function jV(e,t,n){var r=n==="width",l=e.x,s=e.y,d=e.width,f=e.height;return t===1?{start:r?l:s,end:r?l+d:s+f}:{start:r?l+d:s+f,end:r?l:s}}function mu(e,t,n,r,l){if(e*t<e*r||e*t>e*l)return!1;var s=n();return e*(t-e*s/2-r)>=0&&e*(t+e*s/2-l)<=0}function _V(e,t){return ZC(e,t+1)}function SV(e,t,n,r,l){for(var s=(r||[]).slice(),d=t.start,f=t.end,h=0,m=1,y=d,p=function(){var j=r==null?void 0:r[h];if(j===void 0)return{v:ZC(r,m)};var _=h,N,O=()=>(N===void 0&&(N=n(j,_)),N),A=j.coordinate,D=h===0||mu(e,A,O,y,f);D||(h=0,y=d,m+=1),D&&(y=A+e*(O()/2+l),h+=m)},x;m<=s.length;)if(x=p(),x)return x.v;return[]}function NV(e,t,n,r,l){var s=(r||[]).slice(),d=s.length;if(d===0)return[];for(var f=t.start,h=t.end,m=1;m<=d;m++){for(var y=(d-1)%m,p=f,x=!0,w=function(){var k=r[_];if(k==null)return 0;var z=_,M,$=()=>(M===void 0&&(M=n(k,z)),M),U=k.coordinate,V=_===y||mu(e,U,$,p,h);if(!V)return x=!1,1;V&&(p=U+e*($()/2+l))},j,_=y;_<d&&(j=w(),!(j!==0&&j===1));_+=m);if(x){for(var N=[],O=y;O<d;O+=m){var A=r[O];A!=null&&N.push(A)}return N}}return[]}function dN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,r)}return n}function ln(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dN(Object(n),!0).forEach(function(r){AV(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function AV(e,t,n){return(t=OV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OV(e){var t=EV(e,"string");return typeof t=="symbol"?t:t+""}function EV(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kV(e,t,n,r,l){for(var s=(r||[]).slice(),d=s.length,f=t.start,h=t.end,m=function(x){var w=s[x];if(w==null)return 1;var j=w,_,N=()=>(_===void 0&&(_=n(w,x)),_);if(x===d-1){var O=e*(j.coordinate+e*N()/2-h);s[x]=j=ln(ln({},j),{},{tickCoord:O>0?j.coordinate-O*e:j.coordinate})}else s[x]=j=ln(ln({},j),{},{tickCoord:j.coordinate});if(j.tickCoord!=null){var A=mu(e,j.tickCoord,N,f,h);A&&(h=j.tickCoord-e*(N()/2+l),s[x]=ln(ln({},j),{},{isShow:!0}))}},y=d-1;y>=0;y--)m(y);return s}function CV(e,t,n,r,l,s){var d=(r||[]).slice(),f=d.length,h=t.start,m=t.end;if(s){var y=r[f-1];if(y!=null){var p=n(y,f-1),x=e*(y.coordinate+e*p/2-m);if(d[f-1]=y=ln(ln({},y),{},{tickCoord:x>0?y.coordinate-x*e:y.coordinate}),y.tickCoord!=null){var w=mu(e,y.tickCoord,()=>p,h,m);w&&(m=y.tickCoord-e*(p/2+l),d[f-1]=ln(ln({},y),{},{isShow:!0}))}}}for(var j=s?f-1:f,_=function(A){var D=d[A];if(D==null)return 1;var k=D,z,M=()=>(z===void 0&&(z=n(D,A)),z);if(A===0){var $=e*(k.coordinate-e*M()/2-h);d[A]=k=ln(ln({},k),{},{tickCoord:$<0?k.coordinate-$*e:k.coordinate})}else d[A]=k=ln(ln({},k),{},{tickCoord:k.coordinate});if(k.tickCoord!=null){var U=mu(e,k.tickCoord,M,h,m);U&&(h=k.tickCoord+e*(M()/2+l),d[A]=ln(ln({},k),{},{isShow:!0}))}},N=0;N<j;N++)_(N);return d}function Rg(e,t,n){var r=e.tick,l=e.ticks,s=e.viewBox,d=e.minTickGap,f=e.orientation,h=e.interval,m=e.tickFormatter,y=e.unit,p=e.angle;if(!l||!l.length||!r)return[];if(ye(h)||_u.isSsr){var x;return(x=_V(l,ye(h)?h:0))!==null&&x!==void 0?x:[]}var w=[],j=f==="top"||f==="bottom"?"width": Line truncated
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function RV(e,t){if(e){if(typeof e=="string")return hN(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hN(e,t):void 0}}function hN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function LV(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,l,s,d,f=[],h=!0,m=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(h=(r=s.call(n)).done)&&(f.push(r.value),f.length!==t);h=!0);}catch(y){m=!0,l=y}finally{try{if(!h&&n.return!=null&&(d=n.return(),Object(d)!==d))return}finally{if(m)throw l}}return f}}function BV(e){if(Array.isArray(e))return e}function UV(e,t){if(e==null)return{};var n,r,l=HV(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(l[n]=e[n])}return l}function HV(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function sl(){return sl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sl.apply(null,arguments)}function mN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,r)}return n}function jt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mN(Object(n),!0).forEach(function(r){qV(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qV(e,t,n){return(t=KV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function KV(e){var t=YV(e,"string");return typeof t=="symbol"?t:t+""}function YV(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var pa={x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd",zIndex:Tt.axis};function GV(e){var t=e.x,n=e.y,r=e.width,l=e.height,s=e.orientation,d=e.mirror,f=e.axisLine,h=e.otherSvgProps;if(!f)return null;var m=jt(jt(jt({},h),En(f)),{},{fill:"none"});if(s==="top"||s==="bottom"){var y=+(s==="top"&&!d||s==="bottom"&&d);m=jt(jt({},m),{},{x1:t,y1:n+y*l,x2:t+r,y2:n+y*l})}else{var p=+(s==="left"&&!d||s==="right"&&d);m=jt(jt({},m),{},{x1:t+p*r,y1:n,x2:t+p*r,y2:n+l})}return b.createElement("line",sl({},m,{className:Ze("recharts-cartesian-axis-line",Ir(f,"className"))}))}function VV(e,t,n,r,l,s,d,f,h){var m,y,p,x,w,j,_=f?-1:1,N=e.tickSize||d,O=ye(e.tickCoord)?e.tickCoord:e.coordinate;switch(s){case"top":m=y=e.coordinate,x=n+ +!f*l,p=x-_*N,j=p-_*h,w=O;break;case"left":p=x=e.coordinate,y=t+ +!f*r,m=y-_*N,w=m-_*h,j=O;break;case"right":p=x=e.coordinate,y=t+ +f*r,m=y+_*N,w=m+_*h,j=O;break;default:m=y=e.coordinate,x=n+ +f*l,p=x+_*N,j=p+_*h,w=O;break}return{line:{x1:m,y1:p,x2:y,y2:x},tick:{x:w,y:j}}}function XV(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function FV(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function ZV(e){var t=e.option,n=e.tickProps,r=e.value,l,s=Ze(n.className,"recharts-cartesian-axis-tick-value");if(b.isValidElement(t))l=b.cloneElement(t,jt(jt({},n),{},{className:s}));else if(typeof t=="function")l=t(jt(jt({},n),{},{className:s}));else{var d="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(d=Ze(d,PC(t))),l=b.createElement(gh,sl({},n,{className:d}),r)}return l}function WV(e){var t=e.ticks,n=e.axisType,r=e.axisId,l=at();return b.useEffect(()=>{if(r==null||n==null)return ul;var s=t.map(d=>({value:d.value,coordinate:d.coordinate,offset:d.offset,index:d.index}));return l(DV({ticks:s,axisId:r,axisType:n})),()=>{l(PV({axisId:r,axisType:n}))}},[l,t,r,n]),null}var QV=b.forwardRef((e,t)=>{var n=e.ticks,r=n===void 0?[]:n,l=e.tick,s=e.tickLine,d=e.stroke,f=e.tickFormatter,h=e.unit,m=e.padding,y=e.tickTextProps,p=e.orientation,x=e.mirror,w=e.x,j=e.y,_=e.width,N=e.height,O=e.tickSize,A=e.tickMargin,D=e.fontSize,k=e.letterSpacing,z=e.getTicksConfig,M=e.events,$=e.axisType,U=e.axisId,V=Rg(jt(jt({},z),{},{ticks:r}),D,k),R=En(z),F=Ji(l),Z=wC(R.textAnchor)?R.textAnchor:XV(p,x),he=FV(p,x),fe={};typeo Line truncated
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function RF(e,t){if(e){if(typeof e=="string")return xN(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xN(e,t):void 0}}function xN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function LF(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,l,s,d,f=[],h=!0,m=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(h=(r=s.call(n)).done)&&(f.push(r.value),f.length!==t);h=!0);}catch(y){m=!0,l=y}finally{try{if(!h&&n.return!=null&&(d=n.return(),Object(d)!==d))return}finally{if(m)throw l}}return f}}function BF(e){if(Array.isArray(e))return e}function fi(){return fi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fi.apply(null,arguments)}function bN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,r)}return n}function Rt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bN(Object(n),!0).forEach(function(r){UF(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function UF(e,t,n){return(t=HF(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HF(e){var t=qF(e,"string");return typeof t=="symbol"?t:t+""}function qF(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Nf(e,t){if(e==null)return{};var n,r,l=KF(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(l[n]=e[n])}return l}function KF(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var YF=e=>{var t=e.dataKey,n=e.name,r=e.fill,l=e.legendType,s=e.hide;return[{inactive:s,dataKey:t,type:l,color:r,value:Oo(n,t),payload:e}]},GF=b.memo(e=>{var t=e.dataKey,n=e.stroke,r=e.strokeWidth,l=e.fill,s=e.name,d=e.hide,f=e.unit,h=e.tooltipType,m=e.id,y={dataDefinedOnItem:void 0,getPosition:ul,settings:{stroke:n,strokeWidth:r,fill:l,dataKey:t,nameKey:void 0,name:Oo(s,t),hide:d,type:h,color:l,unit:f,graphicalItemId:m}};return b.createElement(Cg,{tooltipEntrySettings:y})});function VF(e){var t=pe(di),n=e.data,r=e.dataKey,l=e.background,s=e.allOtherBarProps,d=s.onMouseEnter,f=s.onMouseLeave,h=s.onClick,m=Nf(s,DF),y=Og(d,r,s.id),p=Eg(f),x=kg(h,r,s.id);if(!l||n==null)return null;var w=Ji(l);return b.createElement(kn,{zIndex:sV(l,Tt.barBackground)},n.map((j,_)=>{j.value;var N=j.background;j.tooltipPosition;var O=Nf(j,PF);if(!N)return null;var A=y(j,j.originalDataIndex),D=p(j,j.originalDataIndex),k=x(j,j.originalDataIndex),z=Rt(Rt(Rt(Rt(Rt({option:l,isActive:String(j.originalDataIndex)===t},O),{},{fill:"#eee"},N),w),yu(m,j,_)),{},{onMouseEnter:A,onMouseLeave:D,onClick:k,dataKey:r,index:_,className:"recharts-bar-background-rectangle"});return b.createElement(qg,fi({key:"background-bar-".concat(_)},z))}))}function XF(e){var t=e.showLabels,n=e.children,r=e.rects,l=r==null?void 0:r.map(s=>{var d={x:s.x,y:s.y,width:s.width,lowerWidth:s.width,upperWidth:s.width,height:s.height};return Rt(Rt({},d),{},{value:s.value,payload:s.payload,parentViewBox:s.parentViewBox,viewBox:d,fill:s.fill})});return b.createElement(EC,{value:t?l:void 0},n)}function FF(e){var t=e.shape,n=e.activeBar,r=e.baseProps,l=e.entry,s=e.index,d=e.dataKey,f=pe(di),h=pe(mg),m=n&&String(l.originalDataIndex)===f&&(h==null||d===h),y=b.useState(!1),p=gN(y,2),x=p[0],w=p[1],j=b.useState(!1),_=gN(j,2),N=_[0],O=_[1];b.useEffect(()=>{var $;return m?(w(!0),$=requestAnimationFrame(()=>{O(!0)})):O(!1),()=>{cancelAnimationFrame($)}},[m]);var A=b.useCallback(()=>{m||w(!1)},[m]),D=m&&N,k=m||x,z;m?n===!0?z=t:z=n:z=t;var M=b.createElement(qg,fi({},r,{name:String(r.name)},l,{isActive:D,option:z,index:s,dataKey:d,animationElapsedTime:e.animationElapsedTime,isAnimating:e.isAnimating,isEntrance:e.isEntrance,onTransitionEnd:A}));return k?b.createElement(kn,{zIndex:Tt.activeBar},b.createElement(h3,{index:l.originalDataIndex},M)):M}function ZF(e){var t=e.shape,n=e.baseProps,r=e.entry,l=e.index,s=e.dataKey;return b.createElement(qg,fi({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:l,dataKey:s,animationElapsedTime:e.animationElapsedTime,isAn Line truncated
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rW(e,t){if(e){if(typeof e=="string")return TN(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?TN(e,t):void 0}}function TN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function aW(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,l,s,d,f=[],h=!0,m=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(h=(r=s.call(n)).done)&&(f.push(r.value),f.length!==t);h=!0);}catch(y){m=!0,l=y}finally{try{if(!h&&n.return!=null&&(d=n.return(),Object(d)!==d))return}finally{if(m)throw l}}return f}}function iW(e){if(Array.isArray(e))return e}function lW(){var e=at(),t=b.useState(null),n=tW(t,2),r=n[0],l=n[1],s=pe(z$);return b.useEffect(()=>{if(r!=null){var d=r.getBoundingClientRect(),f=d.width/r.offsetWidth;ze(f)&&f!==s&&e(g$(f))}},[r,e,s]),l}function DN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,r)}return n}function oW(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DN(Object(n),!0).forEach(function(r){sW(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sW(e,t,n){return(t=uW(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uW(e){var t=cW(e,"string");return typeof t=="symbol"?t:t+""}function cW(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function si(){return si=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},si.apply(null,arguments)}function Of(e,t){return mW(e)||hW(e,t)||fW(e,t)||dW()}function dW(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fW(e,t){if(e){if(typeof e=="string")return PN(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?PN(e,t):void 0}}function PN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function hW(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,l,s,d,f=[],h=!0,m=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(h=(r=s.call(n)).done)&&(f.push(r.value),f.length!==t);h=!0);}catch(y){m=!0,l=y}finally{try{if(!h&&n.return!=null&&(d=n.return(),Object(d)!==d))return}finally{if(m)throw l}}return f}}function mW(e){if(Array.isArray(e))return e}var vW=()=>(yq(),null);function Ef(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var yW=b.forwardRef((e,t)=>{var n,r,l=b.useRef(null),s=b.useState({containerWidth:Ef((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:Ef((r=e.style)===null||r===void 0?void 0:r.height)}),d=Of(s,2),f=d[0],h=d[1],m=b.useCallback((p,x)=>{h(w=>{var j=Math.round(p),_=Math.round(x);return w.containerWidth===j&&w.containerHeight===_?w:{containerWidth:j,containerHeight:_}})},[]),y=b.useCallback(p=>{if(typeof t=="function"&&t(p),l.current!=null&&(l.current.disconnect(),l.current=null),p!=null&&typeof ResizeObserver<"u"){var x=p.getBoundingClientRect(),w=x.width,j=x.height;m(w,j);var _=O=>{var A=O[0];if(A!=null){var D=A.contentRect,k=D.width,z=D.height;m(k,z)}},N=new ResizeObserver(_);N.observe(p),l.current=N}},[t,m]);return b.useEffect(()=>()=>{var p=l.current;p!=null&&p.disconnect()},[m]),b.createElement(b.Fragment,null,b.createElement(bu,{width:f.containerWidth,height:f.containerHeight}),b.createElement("div",si({ref:y},e)))}),pW=b.forwardRef((e,t)=>{var n=e.width,r=e.height,l=b.useState({containerWidth:Ef(n),containerHeight:Ef(r)}),s=Of(l,2),d=s[0],f=s[1],h=b.useCallback((y,p)=>{f(x=>{var w=Math.round(y),j=Math.round(p);return x.containerWidth===w&&x.containerHeight===j?x:{containerWidth:w,containerHeight:j}})},[]),m=b.useCallback(y=>{if(typeof t=="function"&&t(y),y!=null){var p=y.getBoundingClientRect(),x=p.width,w=p.height;h(x,w)}},[t,h]);return b.createElement(b.Fragment,null,b.createElement(bu,{width:d.containerWidth,height:d.containerHeight}),b.createElement("div",si({ref:m},e)))}),gW=b.forwardRef((e,t)=>{var n=e.width,r=e.height;return b.createElement(b.Fragment,null,b.createElement(bu,{width:n,height:r}),b.createElement("div",si({ref:t},e)))}),xW=b.forwardRef((e,t)=>{var n=e.width,r=e.height;return typeof n=="string"||typeof r=="string"?b.createElement(pW,si({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?b.createElement(gW,si({},e,{width:n,height:r,ref:t})):b.createElement(b.Fragment,null,b.createElement(bu,{width:n,height:r}),b.createElement("div",si({ref:t},e)))});function bW(e){return e?yW:xW}var wW=b.forwardRef((e,t)=>{var n=e.children,r=e.className,l=e.height,s=e.onClick,d=e.onContextMenu,f=e.onDoubleClick,h=e.onMouseDown,m=e.onMouseEnter,y=e.onMouseLeave,p=e.onMouseMove,x=e.onMouseUp,w=e.onTouchEnd,j=e.onTouchMove,_=e.onTouchStart,N=e.style,O=e.width,A=e.responsive,D=e.dispatchTouchEvents,k=D===void 0?!0:D,z=b.useRef(null),M=at(),$=b.useState(null),U=Of($,2),V=U[0],R=U[1],F=b.useState(null),Z=Of(F,2),he=Z[0],fe=Z[1],se=lW(),q=n0(),te=(q==null?void 0:q.width)>0?q.width:O,re=(q==null?void 0:q.height)>0?q.height:l,X=b.useCallback(Se=>{se(Se),typeof t=="function"&&t(Se),R(Se),fe(Se),Se!=null&&(z.current=Se)},[se,t,R,fe]),T=b.useCallback(Se=>{M(y3(Se)),M(lr({handler:s,reactEvent:Se}))},[M,s]),E=b.useCallback(Se=>{M(Mp(Se)),M(lr({handler:m,reactEvent:Se}))},[M,m]),L=b.useCallback(Se=>{M(Kk()),M(lr({handler:y,reactEvent:Se}))},[M,y]),K=b.useCallback(Se=>{M(Mp(Se)),M(lr({handler:p,reactEvent:Se}))},[M,p]),ie=b.useCallback(()=>{M(j3())},[M]),me=b.useCallback(()=>{M(_3())},[M]),ve=b.useCallback(Se=>{M(w3(Se.key))},[M]),je=b.useCallback(Se=>{M(lr({handler:d,reactEvent:Se}))},[M,d]),Te=b.useCallback(Se=>{M(lr({handler:f,reactEvent:Se}))},[M,f]),de=b.useCallback(Se=>{M(lr({handler:h,reactEvent:Se}))},[M,h]),we=b.useCallback(Se=>{M(lr({handler:x,reactEvent:Se}))},[M,x]),be=b.useCallback(Se=>{M(lr({handler:_,reactEvent:Se}))},[M,_]),ue=b.useCallback(Se=>{k&&M(A3(Se)),M(lr({handler:j,reactEvent:Se}))},[M,k,j]),$e=b.useCallback(Se=>{M(lr({handler:w,reactEvent:Se}))},[M,w]),ke=bW(A);return b.createElement(hC.Provider,{value:V},b.createElement(lA.Provider,{value:he},b.createElement(ke,{width:te??(N==null?void 0:N.width),height:re??(N==null?void 0:N.height),className:Ze("recharts-wrapper",r),style:oW({position:"relative",cursor:"default",width:te,height:re},N),onClick:T,onContextMenu:je,onDoubleClick:Te,onFocus:ie,onBlur:me,onKeyDown:ve,onMouseDown:de,onMouseEnter:E,onMouseLeave:L,onMouseMove:K,onMouseUp:we Line truncated
例如:回复时保持礼貌专业、使用简洁的语言、强调产品质量等`,className:"w-full ios-input px-4 py-3 rounded-xl h-40 resize-none"})]}),c.jsxs("div",{className:"bg-blue-50 border border-blue-200 rounded-xl p-4",children:[c.jsxs("h4",{className:"font-bold text-blue-900 mb-2 flex items-center gap-2",children:[c.jsx(zp,{className:"w-4 h-4"}),"AI如何工作"]}),c.jsxs("ul",{className:"text-xs text-blue-800 space-y-1",children:[c.jsx("li",{children:"• 自动识别买家的砍价请求"}),c.jsx("li",{children:"• 根据设定的策略智能回复"}),c.jsx("li",{children:"• 在合理范围内同意降价或礼貌拒绝"}),c.jsx("li",{children:"• 保持专业友好的沟通风格"})]})]})]}),c.jsx("div",{className:"modal-footer",children:c.jsxs("div",{className:"flex gap-3 w-full",children:[c.jsx("button",{onClick:()=>O(null),className:"flex-1 px-6 py-3 rounded-xl font-bold bg-gray-100 text-gray-700 hover:bg-gray-200 transition-colors",disabled:U,children:"取消"}),c.jsxs("button",{onClick:re,className:"flex-1 ios-btn-primary px-6 py-3 rounded-xl font-bold flex items-center justify-center gap-2",disabled:U,children:[U?c.jsx(ri,{className:"w-4 h-4 animate-spin"}):c.jsx(va,{className:"w-4 h-4"}),U?"保存中...":"保存"]})]})})]})}),document.body)]})},HN=({status:e})=>{const t={processing:"bg-blue-100 text-blue-800",pending_ship:"bg-[#0094f7] text-white",shipped:"bg-blue-100 text-blue-700",completed:"bg-green-100 text-green-700",cancelled:"bg-gray-100 text-gray-500",refunding:"bg-red-100 text-red-600"},n={processing:"处理中",pending_ship:"待发货",shipped:"已发货",completed:"已完成",cancelled:"已取消",refunding:"退款中"};return c.jsx("span",{className:`px-3 py-1.5 rounded-lg text-xs font-bold ${t[e]||t.cancelled}`,children:n[e]||e})},WW=()=>{const[e,t]=b.useState([]),[n,r]=b.useState([]),[l,s]=b.useState([]),[d,f]=b.useState({}),[h,m]=b.useState("all"),[y,p]=b.useState(""),[x,w]=b.useState(1),[j,_]=b.useState(1),[N,O]=b.useState(!1),[A,D]=b.useState(!1),[k,z]=b.useState(!1),[M,$]=b.useState(!1),[U,V]=b.useState(null),[R,F]=b.useState(null),[Z,he]=b.useState({}),[fe,se]=b.useState(!1),[q,te]=b.useState(""),[re,X]=b.useState(!1),[T,E]=b.useState(null),[L,K]=b.useState(null),[ie,me]=b.useState(null),[ve,je]=b.useState(null),Te=ne=>{if(!y.trim())return ne;const Ee=y.toLowerCase().trim();return ne.filter(Ie=>{var H,P,ce,Re,gt,Gn;return((H=Ie.order_id)==null?void 0:H.toLowerCase().includes(Ee))||((P=Ie.item_id)==null?void 0:P.toLowerCase().includes(Ee))||((ce=Ie.buyer_id)==null?void 0:ce.toLowerCase().includes(Ee))||((Re=Ie.item_title)==null?void 0:Re.toLowerCase().includes(Ee))||((gt=Ie.receiver_name)==null?void 0:gt.toLowerCase().includes(Ee))||((Gn=Ie.receiver_phone)==null?void 0:Gn.toLowerCase().includes(Ee))})},de=async()=>{O(!0);try{if(y.trim()){let ne=[],Ee=1,Ie=!0;for(;Ie;){const H=await cj(void 0,h,Ee,100);ne=[...ne,...H.data],Ie=Ee<H.total_pages,Ee++}r(ne),t(Te(ne)),_(1)}else{const ne=await cj(void 0,h,x,20);r(ne.data),t(Te(ne.data)),_(ne.total_pages)}}catch(ne){console.error("加载订单失败:",ne)}finally{O(!1)}};b.useEffect(()=>{t(Te(n))},[n,y]);const we=(ne,Ee)=>{if(Ee&&Ee.trim())return Ee;if(d[ne])return d[ne];const Ie=l.find(H=>{if(Ee&&H.item_title){const P=Ee.toLowerCase(),ce=H.item_title.toLowerCase();return ce.includes(P)||P.includes(ce)}return!1});return Ie!=null&&Ie.item_title?Ie.item_title:"未知商品"},be=ne=>{const Ee={};ne.forEach(Ie=>{Ie.item_id&&(Ee[Ie.item_id]=Ie.item_title||Ie.item_id)}),f(Ee)};b.useEffect(()=>{de(),mo().then(ne=>{s(ne),be(ne)}).catch(ne=>{console.error("加载商品列表失败:",ne)})},[h,x,y]);const ue=async()=>{O(!0);try{const ne=await aD();await de(),ne!=null&&ne.message&&alert(ne.message)}catch(ne){console.error("同步订单失败:",ne),alert((ne==null?void 0:ne.message)||"同步失败,请重试")}finally{O(!1)}},$e=ne=>{te(ne),E(null),se(!0)},ke=async ne=>{var Ee;X(!0),E(null);try{const Ie=await lD([q],ne),H=(Ee=Ie==null?void 0:Ie.results)==null?void 0:Ee[0];H!=null&&H.success?(E({success:!0,message:H.message}),de()):E({success:!1,message:(H==null?void 0:H.message)||"发货失败"})}catch(Ie){E({success:!1,message:(Ie==null?void 0:Ie.message)||"请求失败"})}finally{X(!1)}},Se=ne=>{V(ne),D(!0)},st=ne=>{F({...ne}),z(!0)},Pe=async()=>{if(!(!R||!R.order_id))try{const ne={};R.status!==void 0&&(ne.order_status=R.status),R.buyer_id!==void 0&&(ne.buyer_id=R.buyer_id),R.amount!==void 0&&(ne.amount=R.amount),R.receiver_name!==void 0&&(ne.receiver_name=R.receiver_name),R.receiver_phone!==void 0&&(ne.receiver_phone=R.receiver_phone),R.receiver_address!==void 0&&(ne.receiver_address=R.receiver_address),R.item_id!==void 0&&(ne.item_id=R.item_id),R.quantity!==void 0&&(ne.quantity=R.quantity),await nD(R.order_id,ne),z(!1),F(null),de()}catch(ne){console.error("更新订单失败:",ne),alert("更新失败,请重试")}},Cn=async()=>{if(L)try{const ne=new FormData;ne.append("file",L),await oD(ne),$(!1),K(null),de(),alert("订单 Line truncated
`).filter(z=>z.trim()).length} 条`:A.type==="text"&&A.text_content?D=A.text_content.substring(0,20)+(A.text_content.length>20?"...":""):A.type==="api"&&A.api_config?D=A.api_config.url:A.type==="image"&&A.image_url&&(D="图片链接"),c.jsxs("tr",{className:"hover:bg-[#FFFDE7]/50 transition-colors group",children:[c.jsx("td",{className:"px-8 py-5",children:c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("div",{className:"p-2 bg-gray-50 rounded-xl group-hover:bg-white transition-colors",children:c.jsx(x,{type:A.type})}),c.jsx("span",{className:"font-bold text-gray-900",children:A.name})]})}),c.jsx("td",{className:"px-6 py-5",children:c.jsx("span",{className:`px-3 py-1.5 rounded-lg text-xs font-bold ${A.type==="text"?"bg-blue-50 text-blue-600":A.type==="data"?"bg-purple-50 text-purple-600":A.type==="api"?"bg-blue-50 text-blue-600":"bg-pink-50 text-pink-600"}`,children:A.type==="text"?"文本":A.type==="data"?"批量":A.type==="api"?"API":"图片"})}),c.jsx("td",{className:"px-6 py-5",children:c.jsx("span",{className:"text-sm text-gray-600 font-mono block truncate",title:D,children:D})}),c.jsx("td",{className:"px-6 py-5",children:c.jsx("span",{className:"text-sm text-gray-500 block max-w-[200px] truncate",title:A.description||"-",children:A.description||"-"})}),c.jsx("td",{className:"px-6 py-5",children:c.jsx("button",{onClick:()=>O(A),className:`w-12 h-8 rounded-full relative transition-colors ${A.enabled?"bg-green-500":"bg-gray-300"}`,children:c.jsx("div",{className:`absolute top-1 w-6 h-6 bg-white rounded-full shadow-sm transition-transform ${A.enabled?"left-5":"left-1"}`})})}),c.jsx("td",{className:"px-6 py-5",children:c.jsxs("div",{className:"flex items-center justify-end gap-2",children:[c.jsx("button",{onClick:()=>w(A),className:"p-2 text-gray-400 hover:text-black hover:bg-gray-100 rounded-xl transition-colors",title:"编辑",children:c.jsx(Ip,{className:"w-4 h-4"})}),c.jsx("button",{onClick:()=>_(A.id),className:"p-2 text-gray-400 hover:text-red-500 hover:bg-red-50 rounded-xl transition-colors",children:c.jsx(ii,{className:"w-5 h-5"})})]})})]},A.id)})})]})}),e.length===0&&c.jsxs("div",{className:"py-20 text-center text-gray-400",children:[c.jsx(ZN,{className:"w-12 h-12 mx-auto mb-4 opacity-30"}),c.jsx("p",{children:"暂无卡密配置,请点击右上角添加。"})]})]}),n&&d&&Lt.createPortal(c.jsx("div",{className:"modal-overlay-centered",children:c.jsxs("div",{className:"modal-container",children:[c.jsxs("div",{className:"modal-header",children:[c.jsx("h3",{className:"text-2xl font-extrabold text-gray-900",children:"编辑卡密"}),c.jsx("button",{onClick:()=>r(!1),className:"p-2 rounded-xl hover:bg-gray-100 transition-colors",children:c.jsx(sn,{className:"w-5 h-5 text-gray-500"})})]}),c.jsx("div",{className:"modal-body",children:c.jsxs("div",{className:"space-y-5",children:[c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[c.jsxs("div",{children:[c.jsxs("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:["卡密名称 ",c.jsx("span",{className:"text-red-500",children:"*"})]}),c.jsx("input",{type:"text",value:h.name||"",onChange:A=>m({...h,name:A.target.value}),className:"w-full ios-input px-4 py-3 rounded-xl",placeholder:"例如:游戏点卡、会员卡等"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"卡券类型"}),c.jsxs("select",{value:h.type||"text",onChange:A=>m({...h,type:A.target.value}),className:"w-full ios-input px-4 py-3 rounded-xl",children:[c.jsx("option",{value:"",children:"请选择类型"}),c.jsx("option",{value:"text",children:"固定文字"}),c.jsx("option",{value:"data",children:"批量数据"}),c.jsx("option",{value:"api",children:"API接口"}),c.jsx("option",{value:"image",children:"图片"})]})]})]}),h.type==="api"&&c.jsxs("div",{className:"border border-gray-200 rounded-xl p-4 space-y-4 bg-gray-50",children:[c.jsx("h3",{className:"font-bold text-gray-900",children:"API 配置"}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"API 地址"}),c.jsx("input",{type:"url",value:h.api_url||"",onChange:A=>m({...h,api_url:A.target.value}),className:"w-full ios-input px-4 py-3 rounded-xl font-mono text-sm",placeholder:"https://api.example.com/get-card"})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"请求方法"}),c.jsxs("select",{value:h.api_method||"GET",onChange:A=>m({...h,api_method:A.target.value}),className:"w-full ios-input px-4 py-3 rounded-xl",children:[c.jsx("option",{value:"GET",children:"GET"}),c.jsx("option",{value:"POST",children:"POST"})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"超时时间(秒)"}),c.jsx("input",{type:"number",value:h.api_timeout||10,onChange:A=>m({...h,api_timeout:parseInt(A.tarLine truncated
卡号1:密码1
卡号2:密码2
或者
兑换码1
兑换码2`}),c.jsx("p",{className:"text-xs text-gray-500 mt-2",children:"支持格式:卡号:密码 或 单独的兑换码"}),c.jsxs("p",{className:"text-xs text-gray-500",children:["当前库存:",c.jsx("span",{className:"font-bold text-blue-600",children:h.data_content?h.data_content.split(`
`).filter(A=>A.trim()).length:0})," 条"]})]})]}),h.type==="image"&&c.jsxs("div",{className:"border border-gray-200 rounded-xl p-4 bg-gray-50",children:[c.jsx("h3",{className:"font-bold text-gray-900 mb-3",children:"图片配置"}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"图片 URL"}),c.jsx("input",{type:"url",value:h.image_url||"",onChange:A=>m({...h,image_url:A.target.value}),className:"w-full ios-input px-4 py-3 rounded-xl font-mono text-sm",placeholder:"https://example.com/image.png"}),c.jsx("p",{className:"text-xs text-gray-500 mt-2",children:"输入图片卡密的 URL 地址"})]}),h.image_url&&c.jsxs("div",{className:"mt-3",children:[c.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"图片预览"}),c.jsx("img",{src:h.image_url,alt:"预览",className:"max-w-full max-h-48 rounded-xl border border-gray-200",onError:A=>{A.currentTarget.src="https://via.placeholder.com/400x200?text=图片加载失败"}})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"延时发货时间(秒)"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("input",{type:"number",value:h.delay_seconds||0,onChange:A=>m({...h,delay_seconds:parseInt(A.target.value)||0}),className:"flex-1 ios-input px-4 py-3 rounded-xl",min:"0",max:"3600",placeholder:"0"}),c.jsx("span",{className:"text-sm text-gray-500 whitespace-nowrap",children:"秒"})]}),c.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"0表示立即发货,最大3600秒(1小时)"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"备注信息"}),c.jsx("textarea",{value:h.description||"",onChange:A=>m({...h,description:A.target.value}),className:"w-full ios-input px-4 py-3 rounded-xl h-40 resize-none",placeholder:"可选的备注信息"})]}),c.jsxs("div",{className:"flex items-center justify-between p-4 bg-gray-50 rounded-xl",children:[c.jsx("span",{className:"font-bold text-gray-900",children:"启用状态"}),c.jsx("button",{type:"button",onClick:()=>m({...h,enabled:!h.enabled}),className:`w-14 h-8 rounded-full transition-colors duration-300 relative ${h.enabled?"bg-[#0094f7]":"bg-gray-300"}`,children:c.jsx("span",{className:`absolute top-1 w-6 h-6 bg-white rounded-full shadow-md transition-transform duration-300 block ${h.enabled?"translate-x-7":"translate-x-1"}`})})]})]})}),c.jsx("div",{className:"modal-footer",children:c.jsxs("div",{className:"flex gap-3 w-full",children:[c.jsx("button",{onClick:()=>r(!1),className:"flex-1 px-6 py-3 rounded-xl font-bold bg-gray-100 text-gray-700 hover:bg-gray-200 transition-colors",children:"取消"}),c.jsxs("button",{onClick:j,className:"flex-1 ios-btn-primary px-6 py-3 rounded-xl font-bold flex items-center justify-center gap-2",children:[c.jsx(va,{className:"w-4 h-4"}),"保存更改"]})]})})]})}),document.body),l&&Lt.createPortal(c.jsx("div",{className:"modal-overlay-centered",children:c.jsxs("div",{className:"modal-container",style:{maxWidth:"780px"},children:[c.jsxs("div",{className:"modal-header flex items-center justify-between gap-4",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-2xl font-extrabold text-gray-900",children:"添加新卡密"}),c.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"选择交付方式并录入自动发货内容"})]}),c.jsx("button",{onClick:()=>s(!1),className:"p-2 rounded-xl hover:bg-gray-100 transition-colors flex-shrink-0",title:"关闭",children:c.jsx(sn,{className:"w-5 h-5 text-gray-500"})})]}),c.jsx("div",{className:"modal-body",children:c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"卡密名称"}),c.jsx("input",{type:"text",value:y.name,onChange:A=>p({...y,name:A.target.value}),placeholder:"例如:VIP会员卡密",className:"w-full ios-input px-4 py-3 rounded-xl"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"类型"}),c.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2",children:[c.jsxs("button",{type:"button",onClick:()=>p({...y,type:"data",content:""}),className:`p-3 rounded-xl font-bold transition-all ${y.type==="data"?"bg-[#0094f7] text-white":"bg-gray-100 text-gray-600 hover:bg-gray-200"}`,children:[c.jsx(Ay,{className:"w-5 h-5 mx-auto mb-1"}),"批量库存"]}),c.jsxs("button",{type:"button",onClick:()=>p({...y,type:"text",content:""}),className:`p-3 rounded-xl font-bold transition-all ${y.type==="text"?"bg-[#0094f7] text-white":"bg-gray-100 text-gray-600"}`,children:[c.jsx(ij,{className:"w-5 h-5 mx-auto mb-1"}),"文本"]}),c.jsxs("button",{type:"button",onClick:()=>p({...y,type:"image",content:""}),className:`p-3 rounded-xl font-bold transition-all ${y.type==="image"?"bg-[#0094f7] text-white":"bg-gray-100 text-gray-Line truncated
CODE-789012
...`:"请输入每次发货时发送的固定文字"}),y.type==="data"&&c.jsxs("p",{className:"text-xs text-gray-500",children:["当前库存:",c.jsx("span",{className:"font-bold text-[#0094f7]",children:y.content.split(`
`).filter(A=>A.trim()).length})," 条"]})]}),y.type==="api"&&c.jsxs("div",{className:"border-t border-gray-100 pt-5 space-y-4",children:[c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx("label",{className:"block text-sm font-bold text-gray-700",children:"请求方法"}),c.jsxs("select",{value:y.api_method,onChange:A=>p({...y,api_method:A.target.value}),className:"w-full ios-input px-4 py-3 rounded-xl",children:[c.jsx("option",{value:"GET",children:"GET"}),c.jsx("option",{value:"POST",children:"POST"})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("label",{className:"block text-sm font-bold text-gray-700",children:"超时时间(秒)"}),c.jsx("input",{type:"number",min:"1",max:"60",value:y.api_timeout,onChange:A=>p({...y,api_timeout:parseInt(A.target.value)||10}),className:"w-full ios-input px-4 py-3 rounded-xl"})]})]}),c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx("label",{className:"block text-sm font-bold text-gray-700",children:"请求头(JSON)"}),c.jsx("textarea",{value:y.api_headers,onChange:A=>p({...y,api_headers:A.target.value}),className:"w-full ios-input px-4 py-3 rounded-xl h-24 resize-none font-mono text-xs",placeholder:'{"Authorization":"Bearer token"}'})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("label",{className:"block text-sm font-bold text-gray-700",children:"请求参数(JSON)"}),c.jsx("textarea",{value:y.api_params,onChange:A=>p({...y,api_params:A.target.value}),className:"w-full ios-input px-4 py-3 rounded-xl h-24 resize-none font-mono text-xs",placeholder:'{"order_id":"{order_id}"}'})]})]})]}),c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-[1fr_180px] gap-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx("label",{className:"block text-sm font-bold text-gray-700",children:"描述"}),c.jsx("input",{value:y.description,onChange:A=>p({...y,description:A.target.value}),placeholder:"卡密用途描述(可选)",className:"w-full ios-input px-4 py-3 rounded-xl"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("label",{className:"block text-sm font-bold text-gray-700",children:"延时发货(秒)"}),c.jsx("input",{type:"number",value:y.delay_seconds,onChange:A=>p({...y,delay_seconds:parseInt(A.target.value)||0}),className:"w-full ios-input px-4 py-3 rounded-xl",min:"0",max:"3600"})]})]})]})}),c.jsx("div",{className:"modal-footer",children:c.jsxs("div",{className:"flex gap-3 w-full",children:[c.jsx("button",{onClick:()=>s(!1),className:"flex-1 px-6 py-3 rounded-xl font-bold bg-gray-100 text-gray-700 hover:bg-gray-200 transition-colors",children:"取消"}),c.jsxs("button",{onClick:N,className:"flex-1 ios-btn-primary px-6 py-3 rounded-xl font-bold flex items-center justify-center gap-2",children:[c.jsx(Qi,{className:"w-4 h-4"}),"添加卡密"]})]})})]})}),document.body)]})},JW=({onConfigureDelivery:e})=>{const[t,n]=b.useState([]),[r,l]=b.useState([]),[s,d]=b.useState([]),[f,h]=b.useState(""),[m,y]=b.useState(!1),[p,x]=b.useState(!1),[w,j]=b.useState(!1),[_,N]=b.useState(!1),[O,A]=b.useState(!1),[D,k]=b.useState(!1),[z,M]=b.useState(!1),[$,U]=b.useState("upload"),[V,R]=b.useState(null),[F,Z]=b.useState(null),[he,fe]=b.useState(null),[se,q]=b.useState(null),[te,re]=b.useState(null),[X,T]=b.useState({}),[E,L]=b.useState({cookie_id:"",item_id:"",item_title:"",item_price:"",item_image:"",is_multi_spec:!1,is_multi_qty_ship:!1}),[K,ie]=b.useState({cookie_id:"",title:"",description:"",price:"",original_price:"",quantity:"1",postage_mode:"free",postage:"",images:[]}),me=async()=>{const P=await mo();n(P)},ve=async()=>{l(await kd())};b.useEffect(()=>{Promise.all([Rp(),mo(),kd()]).then(([P,ce,Re])=>{d(P),n(ce),l(Re)}).catch(P=>console.error("加载商品配置失败:",P))},[]),b.useEffect(()=>{if(!z||!(se!=null&&se.id)||se.status!=="running")return;const P=window.setInterval(async()=>{try{const ce=await ed(se.id);q(ce),ce.status!=="running"&&(U("done"),await me(),await ve())}catch(ce){console.error("刷新批量铺货进度失败:",ce)}},3e3);return()=>window.clearInterval(P)},[z,se==null?void 0:se.id,se==null?void 0:se.status]);const je=async()=>{if(!f)return alert("请先选择账号");y(!0);try{const P=await hD(f);await me(),alert((P==null?void 0:P.message)||"商品同步完成")}catch(P){console.error("同步商品失败:",P),alert((P==null?void 0:P.message)||"同步失败,请重试")}finally{y(!1)}},Te=P=>{re(P),T({...P}),N(!0)},de=async()=>{if(te)try{await wD(te.cookie_id,te.item_id,{item_title:X.item_title||"",item_description:X.item_description||"",item_category:X.item_category||"",item_price:X.item_price||"",item_detail:X.item_detail||te.item_detail||"",is_multi_spec:!!X.is_multi_spec,multi_quantity_delivery:!!(X.is_multi_qty_ship??X.multi_quantity_delivery)}),await me(),await ve(),N(!1),re(null)}catch(P){console.error("更新商品失败:",P),alert("更新失败,请重 Line truncated
@@ -1 +0,0 @@
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:-apple-system,BlinkMacSystemFont,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.pointer-events-none{pointer-events:none}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.-bottom-1{bottom:-.25rem}.-right-1{rigLine truncated
@@ -0,0 +1 @@
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:-apple-system,BlinkMacSystemFont,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.pointer-events-none{pointer-events:none}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.-bottom-1{bottom:-.25rem}.-right-1{rigLine truncated
@@ -1,408 +0,0 @@
var jM=Object.defineProperty;var _M=(e,t,r)=>t in e?jM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var dp=(e,t,r)=>_M(e,typeof t!="symbol"?t+"":t,r);function SM(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const l in n)if(l!=="default"&&!(l in e)){const s=Object.getOwnPropertyDescriptor(n,l);s&&Object.defineProperty(e,l,s.get?s:{enumerable:!0,get:()=>n[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))n(l);new MutationObserver(l=>{for(const s of l)if(s.type==="childList")for(const c of s.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&n(c)}).observe(document,{childList:!0,subtree:!0});function r(l){const s={};return l.integrity&&(s.integrity=l.integrity),l.referrerPolicy&&(s.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?s.credentials="include":l.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(l){if(l.ep)return;l.ep=!0;const s=r(l);fetch(l.href,s)}})();function kn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var hp={exports:{}},hs={};/**
* @license React
* react-jsx-runtime.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var sj;function NM(){if(sj)return hs;sj=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,l,s){var c=null;if(s!==void 0&&(c=""+s),l.key!==void 0&&(c=""+l.key),"key"in l){s={};for(var d in l)d!=="key"&&(s[d]=l[d])}else s=l;return l=s.ref,{$$typeof:e,type:n,key:c,ref:l!==void 0?l:null,props:s}}return hs.Fragment=t,hs.jsx=r,hs.jsxs=r,hs}var uj;function OM(){return uj||(uj=1,hp.exports=NM()),hp.exports}var f=OM(),mp={exports:{}},Ae={};/**
* @license React
* react.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var cj;function AM(){if(cj)return Ae;cj=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),x=Symbol.iterator;function w(C){return C===null||typeof C!="object"?null:(C=x&&C[x]||C["@@iterator"],typeof C=="function"?C:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,N={};function A(C,U,ee){this.props=C,this.context=U,this.refs=N,this.updater=ee||j}A.prototype.isReactComponent={},A.prototype.setState=function(C,U){if(typeof C!="object"&&typeof C!="function"&&C!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,C,U,"setState")},A.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function O(){}O.prototype=A.prototype;function P(C,U,ee){this.props=C,this.context=U,this.refs=N,this.updater=ee||j}var k=P.prototype=new O;k.constructor=P,_(k,A.prototype),k.isPureReactComponent=!0;var z=Array.isArray;function T(){}var R={H:null,A:null,T:null,S:null},$=Object.prototype.hasOwnProperty;function Z(C,U,ee){var le=ee.ref;return{$$typeof:e,type:C,key:U,ref:le!==void 0?le:null,props:ee}}function X(C,U){return Z(C.type,U,C.props)}function L(C){return typeof C=="object"&&C!==null&&C.$$typeof===e}function K(C){var U={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(ee){return U[ee]})}var se=/\/+/g;function ce(C,U){return typeof C=="object"&&C!==null&&C.key!=null?K(""+C.key):U.toString(36)}function he(C){switch(C.status){case"fulfilled":return C.value;case"rejected":throw C.reason;default:switch(typeof C.status=="string"?C.then(T,T):(C.status="pending",C.then(function(U){C.status==="pending"&&(C.status="fulfilled",C.value=U)},function(U){C.status==="pending"&&(C.status="rejected",C.reason=U)})),C.status){case"fulfilled":return C.value;case"rejected":throw C.reason}}throw C}function q(C,U,ee,le,me){var pe=typeof C;(pe==="undefined"||pe==="boolean")&&(C=null);var be=!1;if(C===null)be=!0;else switch(pe){case"bigint":case"string":case"number":be=!0;break;case"object":switch(C.$$typeof){case e:case t:be=!0;break;case p:return be=C._init,q(be(C._payload),U,ee,le,me)}}if(be)return me=me(C),be=le===""?"."+ce(C,0):le,z(me)?(ee="",be!=null&&(ee=be.replace(se,"$&/")+"/"),q(me,U,ee,"",function(we){return we})):me!=null&&(L(me)&&(me=X(me,ee+(me.key==null||C&&C.key===me.key?"":(""+me.key).replace(se,"$&/")+"/")+be)),U.push(me)),1;be=0;var Me=le===""?".":le+":";if(z(C))for(var J=0;J<C.length;J++)le=C[J],pe=Me+ce(le,J),be+=q(le,U,ee,pe,me);else if(J=w(C),typeof J=="function")for(C=J.call(C),J=0;!(le=C.next()).done;)le=le.value,pe=Me+ce(le,J++),be+=q(le,U,ee,pe,me);else if(pe==="object"){if(typeof C.then=="function")return q(he(C),U,ee,le,me);throw U=String(C),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(C).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return be}function W(C,U,ee){if(C==null)return C;var le=[],me=0;return q(C,le,"","",function(pe){return U.call(ee,pe,me++)}),le}function ue(C){if(C._status===-1){var U=C._result;U=U(),U.then(function(ee){(C._status===0||C._status===-1)&&(C._status=1,C._result=ee)},function(ee){(C._status===0||C._status===-1)&&(C._status=2,C._result=ee)}),C._status===-1&&(C._status=0,C._result=U)}if(C._status===1)return C._result.default;throw C._result}var te=typeof reportError=="function"?reportError:function(C){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof C=="object"&&C!==null&&typeof C.message=="string"?String(C.message):String(C),error:C});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",C);return}console.error(C)},M={map:W,forEach:function(C,U,ee){W(C,function(){U.apply(this,arguments)},ee)},count:function(C){var U=0;return W(C,function(){U++}),U},toArray:function(C){return W(C,function(U){return U})||[]},only:function(C){if(!L(C))throw Error("React.Children.only expected to receive a single React element child.");return C}};return Ae.Activity=y,Ae.Children=M,Ae.Component=A,Ae.Fragment=r,Ae.Profiler=l,Ae.PureComponent=P,Ae.StrictMode=n,Ae.Suspense=h,Ae.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=R,Ae.__COMPILER_RUNTIME={__proto__:null,c:function(C){return R.H.useMemoCache(C)}},Ae.cache=function(C){return function(){return C.apply(null,arguments)}},Ae.cacheSignal=function(){return null},Ae.cloneElement=function(CLine truncated
* @license React
* scheduler.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var dj;function CM(){return dj||(dj=1,(function(e){function t(q,W){var ue=q.length;q.push(W);e:for(;0<ue;){var te=ue-1>>>1,M=q[te];if(0<l(M,W))q[te]=W,q[ue]=M,ue=te;else break e}}function r(q){return q.length===0?null:q[0]}function n(q){if(q.length===0)return null;var W=q[0],ue=q.pop();if(ue!==W){q[0]=ue;e:for(var te=0,M=q.length,C=M>>>1;te<C;){var U=2*(te+1)-1,ee=q[U],le=U+1,me=q[le];if(0>l(ee,ue))le<M&&0>l(me,ee)?(q[te]=me,q[le]=ue,te=le):(q[te]=ee,q[U]=ue,te=U);else if(le<M&&0>l(me,ue))q[te]=me,q[le]=ue,te=le;else break e}}return W}function l(q,W){var ue=q.sortIndex-W.sortIndex;return ue!==0?ue:q.id-W.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var h=[],m=[],p=1,y=null,x=3,w=!1,j=!1,_=!1,N=!1,A=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;function k(q){for(var W=r(m);W!==null;){if(W.callback===null)n(m);else if(W.startTime<=q)n(m),W.sortIndex=W.expirationTime,t(h,W);else break;W=r(m)}}function z(q){if(_=!1,k(q),!j)if(r(h)!==null)j=!0,T||(T=!0,K());else{var W=r(m);W!==null&&he(z,W.startTime-q)}}var T=!1,R=-1,$=5,Z=-1;function X(){return N?!0:!(e.unstable_now()-Z<$)}function L(){if(N=!1,T){var q=e.unstable_now();Z=q;var W=!0;try{e:{j=!1,_&&(_=!1,O(R),R=-1),w=!0;var ue=x;try{t:{for(k(q),y=r(h);y!==null&&!(y.expirationTime>q&&X());){var te=y.callback;if(typeof te=="function"){y.callback=null,x=y.priorityLevel;var M=te(y.expirationTime<=q);if(q=e.unstable_now(),typeof M=="function"){y.callback=M,k(q),W=!0;break t}y===r(h)&&n(h),k(q)}else n(h);y=r(h)}if(y!==null)W=!0;else{var C=r(m);C!==null&&he(z,C.startTime-q),W=!1}}break e}finally{y=null,x=ue,w=!1}W=void 0}}finally{W?K():T=!1}}}var K;if(typeof P=="function")K=function(){P(L)};else if(typeof MessageChannel<"u"){var se=new MessageChannel,ce=se.port2;se.port1.onmessage=L,K=function(){ce.postMessage(null)}}else K=function(){A(L,0)};function he(q,W){R=A(function(){q(e.unstable_now())},W)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(q){q.callback=null},e.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):$=0<q?Math.floor(1e3/q):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(q){switch(x){case 1:case 2:case 3:var W=3;break;default:W=x}var ue=x;x=W;try{return q()}finally{x=ue}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(q,W){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var ue=x;x=q;try{return W()}finally{x=ue}},e.unstable_scheduleCallback=function(q,W,ue){var te=e.unstable_now();switch(typeof ue=="object"&&ue!==null?(ue=ue.delay,ue=typeof ue=="number"&&0<ue?te+ue:te):ue=te,q){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=ue+M,q={id:p++,callback:W,priorityLevel:q,startTime:ue,expirationTime:M,sortIndex:-1},ue>te?(q.sortIndex=ue,t(m,q),r(h)===null&&q===r(m)&&(_?(O(R),R=-1):_=!0,he(z,ue-te))):(q.sortIndex=M,t(h,q),j||w||(j=!0,T||(T=!0,K()))),q},e.unstable_shouldYield=X,e.unstable_wrapCallback=function(q){var W=x;return function(){var ue=x;x=W;try{return q.apply(this,arguments)}finally{x=ue}}}})(yp)),yp}var hj;function kM(){return hj||(hj=1,vp.exports=CM()),vp.exports}var gp={exports:{}},er={};/**
* @license React
* react-dom.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var mj;function MM(){if(mj)return er;mj=1;var e=so();function t(h){var m="https://react.dev/errors/"+h;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)m+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+h+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var n={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},l=Symbol.for("react.portal");function s(h,m,p){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:y==null?null:""+y,children:h,containerInfo:m,implementation:p}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(h,m){if(h==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return er.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,er.createPortal=function(h,m){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(t(299));return s(h,m,null,p)},er.flushSync=function(h){var m=c.T,p=n.p;try{if(c.T=null,n.p=2,h)return h()}finally{c.T=m,n.p=p,n.d.f()}},er.preconnect=function(h,m){typeof h=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,n.d.C(h,m))},er.prefetchDNS=function(h){typeof h=="string"&&n.d.D(h)},er.preinit=function(h,m){if(typeof h=="string"&&m&&typeof m.as=="string"){var p=m.as,y=d(p,m.crossOrigin),x=typeof m.integrity=="string"?m.integrity:void 0,w=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;p==="style"?n.d.S(h,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:y,integrity:x,fetchPriority:w}):p==="script"&&n.d.X(h,{crossOrigin:y,integrity:x,fetchPriority:w,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},er.preinitModule=function(h,m){if(typeof h=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var p=d(m.as,m.crossOrigin);n.d.M(h,{crossOrigin:p,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&n.d.M(h)},er.preload=function(h,m){if(typeof h=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var p=m.as,y=d(p,m.crossOrigin);n.d.L(h,p,{crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},er.preloadModule=function(h,m){if(typeof h=="string")if(m){var p=d(m.as,m.crossOrigin);n.d.m(h,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:p,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else n.d.m(h)},er.requestFormReset=function(h){n.d.r(h)},er.unstable_batchedUpdates=function(h,m){return h(m)},er.useFormState=function(h,m,p){return c.H.useFormState(h,m,p)},er.useFormStatus=function(){return c.H.useHostTransitionStatus()},er.version="19.2.4",er}var pj;function UO(){if(pj)return gp.exports;pj=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),gp.exports=MM(),gp.exports}/**
* @license React
* react-dom-client.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var vj;function TM(){if(vj)return ms;vj=1;var e=kM(),t=so(),r=UO();function n(a){var i="https://react.dev/errors/"+a;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)i+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+a+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function s(a){var i=a,o=a;if(a.alternate)for(;i.return;)i=i.return;else{a=i;do i=a,(i.flags&4098)!==0&&(o=i.return),a=i.return;while(a)}return i.tag===3?o:null}function c(a){if(a.tag===13){var i=a.memoizedState;if(i===null&&(a=a.alternate,a!==null&&(i=a.memoizedState)),i!==null)return i.dehydrated}return null}function d(a){if(a.tag===31){var i=a.memoizedState;if(i===null&&(a=a.alternate,a!==null&&(i=a.memoizedState)),i!==null)return i.dehydrated}return null}function h(a){if(s(a)!==a)throw Error(n(188))}function m(a){var i=a.alternate;if(!i){if(i=s(a),i===null)throw Error(n(188));return i!==a?null:a}for(var o=a,u=i;;){var v=o.return;if(v===null)break;var g=v.alternate;if(g===null){if(u=v.return,u!==null){o=u;continue}break}if(v.child===g.child){for(g=v.child;g;){if(g===o)return h(v),a;if(g===u)return h(v),i;g=g.sibling}throw Error(n(188))}if(o.return!==u.return)o=v,u=g;else{for(var S=!1,E=v.child;E;){if(E===o){S=!0,o=v,u=g;break}if(E===u){S=!0,u=v,o=g;break}E=E.sibling}if(!S){for(E=g.child;E;){if(E===o){S=!0,o=g,u=v;break}if(E===u){S=!0,u=g,o=v;break}E=E.sibling}if(!S)throw Error(n(189))}}if(o.alternate!==u)throw Error(n(190))}if(o.tag!==3)throw Error(n(188));return o.stateNode.current===o?a:i}function p(a){var i=a.tag;if(i===5||i===26||i===27||i===6)return a;for(a=a.child;a!==null;){if(i=p(a),i!==null)return i;a=a.sibling}return null}var y=Object.assign,x=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),P=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),X=Symbol.for("react.memo_cache_sentinel"),L=Symbol.iterator;function K(a){return a===null||typeof a!="object"?null:(a=L&&a[L]||a["@@iterator"],typeof a=="function"?a:null)}var se=Symbol.for("react.client.reference");function ce(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===se?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case _:return"Fragment";case A:return"Profiler";case N:return"StrictMode";case z:return"Suspense";case T:return"SuspenseList";case Z:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case j:return"Portal";case P:return a.displayName||"Context";case O:return(a._context.displayName||"Context")+".Consumer";case k:var i=a.render;return a=a.displayName,a||(a=i.displayName||i.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case R:return i=a.displayName||null,i!==null?i:ce(a.type)||"Memo";case $:i=a._payload,a=a._init;try{return ce(a(i))}catch{}}return null}var he=Array.isArray,q=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue={pending:!1,data:null,method:null,action:null},te=[],M=-1;function C(a){return{current:a}}function U(a){0>M||(a.current=te[M],te[M]=null,M--)}function ee(a,i){M++,te[M]=a.current,a.current=i}var le=C(null),me=C(null),pe=C(null),be=C(null);function Me(a,i){switch(ee(pe,i),ee(me,a),ee(le,null),i.nodeType){case 9:case 11:a=(a=i.documentElement)&&(a=a.namespaceURI)?Mw(a):0;break;default:if(a=i.tagName,i=i.namespaceURI)i=Mw(i),a=Tw(i,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}U(le),ee(le,a)}function J(){U(le),U(me),U(pe)}function we(a){a.memoizedState!==null&&ee(be,a);var i=le.current,o=Tw(i,a.type);i!==o&&(ee(me,a),ee(le,o))}function Oe(a){me.current===a&&(U(le),U(me)),be.current===a&&(U(be),us._currentValue=ue)}var ie,Ie;function _e(a){if(ie===void 0)try{throw Error()}catch(o){var i=o.stack.trim().match(/\n( *(at )?)/);ie=i&&i[1]||"",Ie=-1<o.stack.indexOf(`
at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
`+ie+a+Ie}var ct=!1;function ft(a,i){if(!a||ct)return"";ct=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(i){var ae=function(){throw Error()};if(Object.defineProperty(ae.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ae,[])}catch(Q){var F=Q}Reflect.construct(a,[],ae)}else{try{ae.call()}catch(Q){F=Q}a.call(ae.prototype)}}else{try{throw Error()}catch(Q){F=Q}(ae=a())&&typeof ae.catch=="function"&&ae.catch(function(){})}}catch(Q){if(Q&&F&&typeof Q.stack=="string")return[Q.stack,F.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var v=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");v&&v.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=u.DetermineComponentFrameRoot(),S=g[0],E=g[1];if(S&&E){var I=S.split(`
`),V=E.split(`
`);for(v=u=0;u<I.length&&!I[u].includes("DetermineComponentFrameRoot");)u++;for(;v<V.length&&!V[v].includes("DetermineComponentFrameRoot");)v++;if(u===I.length||v===V.length)for(u=I.length-1,v=V.length-1;1<=u&&0<=v&&I[u]!==V[v];)v--;for(;1<=u&&0<=v;u--,v--)if(I[u]!==V[v]){if(u!==1||v!==1)do if(u--,v--,0>v||I[u]!==V[v]){var re=`
`+I[u].replace(" at new "," at ");return a.displayName&&re.includes("<anonymous>")&&(re=re.replace("<anonymous>",a.displayName)),re}while(1<=u&&0<=v);break}}}finally{ct=!1,Error.prepareStackTrace=o}return(o=a?a.displayName||a.name:"")?_e(o):""}function ht(a,i){switch(a.tag){case 26:case 27:case 5:return _e(a.type);case 16:return _e("Lazy");case 13:return a.child!==i&&i!==null?_e("Suspense Fallback"):_e("Suspense");case 19:return _e("SuspenseList");case 0:case 15:return ft(a.type,!1);case 11:return ft(a.type.render,!1);case 1:return ft(a.type,!0);case 31:return _e("Activity");default:return""}}function nn(a){try{var i="",o=null;do i+=ht(a,o),o=a,a=a.return;while(a);return i}catch(u){return`
Error generating stack: `+u.message+`
`+u.stack}}var Pn=Object.prototype.hasOwnProperty,zn=e.unstable_scheduleCallback,D=e.unstable_cancelCallback,oe=e.unstable_shouldYield,fe=e.unstable_requestPaint,Pe=e.unstable_now,Sr=e.unstable_getCurrentPriorityLevel,pn=e.unstable_ImmediatePriority,fi=e.unstable_UserBlockingPriority,Rn=e.unstable_NormalPriority,vn=e.unstable_LowPriority,mu=e.unstable_IdlePriority,Wd=e.log,Jd=e.unstable_setDisableYieldValue,wo=null,Nr=null;function Sa(a){if(typeof Wd=="function"&&Jd(a),Nr&&typeof Nr.setStrictMode=="function")try{Nr.setStrictMode(wo,a)}catch{}}var Or=Math.clz32?Math.clz32:s5,l5=Math.log,o5=Math.LN2;function s5(a){return a>>>=0,a===0?32:31-(l5(a)/o5|0)|0}var pu=256,vu=262144,yu=4194304;function di(a){var i=a&42;if(i!==0)return i;switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function gu(a,i,o){var u=a.pendingLanes;if(u===0)return 0;var v=0,g=a.suspendedLanes,S=a.pingedLanes;a=a.warmLanes;var E=u&134217727;return E!==0?(u=E&~g,u!==0?v=di(u):(S&=E,S!==0?v=di(S):o||(o=E&~a,o!==0&&(v=di(o))))):(E=u&~g,E!==0?v=di(E):S!==0?v=di(S):o||(o=u&~a,o!==0&&(v=di(o)))),v===0?0:i!==0&&i!==v&&(i&g)===0&&(g=v&-v,o=i&-i,g>=o||g===32&&(o&4194048)!==0)?i:v}function jo(a,i){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&i)===0}function u5(a,i){switch(a){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function dx(){var a=yu;return yu<<=1,(yu&62914560)===0&&(yu=4194304),a}function eh(a){for(var i=[],o=0;31>o;o++)i.push(a);return i}function _o(a,i){a.pendingLanes|=i,i!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function c5(a,i,o,u,v,g){var S=a.pendingLanes;a.pendingLanes=o,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=o,a.entangledLanes&=o,a.errorRecoveryDisabledLanes&=o,a.shellSuspendCounter=0;var E=a.entanglements,I=a.expirationTimes,V=a.hiddenUpdates;for(o=S&~o;0<o;){var re=31-Or(o),ae=1<<re;E[re]=0,I[re]=-1;var F=V[re];if(F!==null)for(V[re]=null,re=0;re<F.length;re++){var Q=F[re];Q!==null&&(Q.lane&=-536870913)}o&=~ae}u!==0&&hx(a,u,0),g!==0&&v===0&&a.tag!==0&&(a.suspendedLanes|=g&~(S&~i))}function hx(a,i,o){a.pendingLanes|=i,a.suspendedLanes&=~i;var u=31-Or(i);a.entangledLanes|=i,a.entanglements[u]=a.entanglements[u]|1073741824|o&261930}function mx(a,i){var o=a.entangledLanes|=i;for(a=a.entanglements;o;){var u=31-Or(o),v=1<<u;v&i|a[u]&i&&(a[u]|=i),o&=~v}}function px(a,i){var o=i&-i;return o=(o&42)!==0?1:th(o),(o&(a.suspendedLanes|i))!==0?0:o}function th(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function rh(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function vx(){var a=W.p;return a!==0?a:(a=window.event,a===void 0?32:tj(a.type))}function yx(a,i){var o=W.p;try{return W.p=a,i()}finally{W.p=o}}var Na=Math.random().toString(36).slice(2),Gt="__reactFiber$"+Na,fr="__reactProps$"+Na,nl="__reactContainer$"+Na,nh="__reactEvents$"+Na,f5="__reactListeners$"+Na,d5="__reactHandles$"+Na,gx="__reactResources$"+Na,So="__reactMarker$"+Na;function ah(a){delete a[Gt],delete a[fr],delete a[nh],delete a[f5],delete a[d5]}function al(a){var i=a[Gt];if(i)return i;for(var o=a.parentNode;o;){if(i=o[nl]||o[Gt]){if(o=i.alternate,i.child!==null||o!==null&&o.child!==null)for(a=$w(a);a!==null;){if(o=a[Gt])return o;a=$w(a)}return i}a=o,o=a.parentNode}return null}function il(a){if(a=a[Gt]||a[nl]){var i=a.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return a}return null}function No(a){var i=a.tag;if(i===5||i===26||i===27||i===6)return a.stateNode;throw Error(n(33))}function ll(a){var i=a[gx];return i||(i=a[gx]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function It(a){a[So]=!0}var xx=new Set,bx={};function hi(a,i){ol(a,i),ol(a+"Capture",i)}function ol(a,i){for(bx[a]=i,a=0;a<i.length;a++)xx.add(i[a])}var h5=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\Line truncated
`).replace(Kk,"")}function Cw(a,i){return i=Ew(i),Ew(a)===i}function Fe(a,i,o,u,v,g){switch(o){case"children":typeof u=="string"?i==="body"||i==="textarea"&&u===""||ul(a,u):(typeof u=="number"||typeof u=="bigint")&&i!=="body"&&ul(a,""+u);break;case"className":bu(a,"class",u);break;case"tabIndex":bu(a,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":bu(a,o,u);break;case"style":Cx(a,u,g);break;case"data":if(i!=="object"){bu(a,"data",u);break}case"src":case"href":if(u===""&&(i!=="a"||o!=="href")){a.removeAttribute(o);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){a.removeAttribute(o);break}u=ju(""+u),a.setAttribute(o,u);break;case"action":case"formAction":if(typeof u=="function"){a.setAttribute(o,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof g=="function"&&(o==="formAction"?(i!=="input"&&Fe(a,i,"name",v.name,v,null),Fe(a,i,"formEncType",v.formEncType,v,null),Fe(a,i,"formMethod",v.formMethod,v,null),Fe(a,i,"formTarget",v.formTarget,v,null)):(Fe(a,i,"encType",v.encType,v,null),Fe(a,i,"method",v.method,v,null),Fe(a,i,"target",v.target,v,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){a.removeAttribute(o);break}u=ju(""+u),a.setAttribute(o,u);break;case"onClick":u!=null&&(a.onclick=In);break;case"onScroll":u!=null&&De("scroll",a);break;case"onScrollEnd":u!=null&&De("scrollend",a);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(n(61));if(o=u.__html,o!=null){if(v.children!=null)throw Error(n(60));a.innerHTML=o}}break;case"multiple":a.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":a.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){a.removeAttribute("xlink:href");break}o=ju(""+u),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?a.setAttribute(o,""+u):a.removeAttribute(o);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":u&&typeof u!="function"&&typeof u!="symbol"?a.setAttribute(o,""):a.removeAttribute(o);break;case"capture":case"download":u===!0?a.setAttribute(o,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?a.setAttribute(o,u):a.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?a.setAttribute(o,u):a.removeAttribute(o);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?a.removeAttribute(o):a.setAttribute(o,u);break;case"popover":De("beforetoggle",a),De("toggle",a),xu(a,"popover",u);break;case"xlinkActuate":Ln(a,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Ln(a,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Ln(a,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Ln(a,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Ln(a,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Ln(a,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Ln(a,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Ln(a,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Ln(a,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":xu(a,"is",u);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=g5.get(o)||o,xu(a,o,u))}}function Xm(a,i,o,u,v,g){switch(o){case"style":Cx(a,u,g);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(n(61));if(o=u.__html,o!=null){if(v.children!=null)throw Error(n(60));a.innerHTML=o}}break;case"children":typeof u=="string"?ul(a,u):(typeof u=="number"||typeof u=="bigint")&&ul(a,""+u);break;case"onScroll":u!=null&&De("scroll",a);break;case"onScrollEnd":u!=null&&De("scrollend",a);break;case"onClick":u!=null&&(a.onclick=In);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"inne Line truncated
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const RM=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),LM=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),gj=e=>{const t=LM(e);return t.charAt(0).toUpperCase()+t.slice(1)},HO=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim(),IM=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/var $M={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const BM=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:l="",children:s,iconNode:c,...d},h)=>b.createElement("svg",{ref:h,...$M,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:HO("lucide",l),...!s&&!IM(d)&&{"aria-hidden":"true"},...d},[...c.map(([m,p])=>b.createElement(m,p)),...Array.isArray(s)?s:[s]]));/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Se=(e,t)=>{const r=b.forwardRef(({className:n,...l},s)=>b.createElement(BM,{ref:s,iconNode:t,className:HO(`lucide-${RM(gj(e))}`,`lucide-${e}`,n),...l}));return r.displayName=gj(e),r};/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const qM=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],xj=Se("activity",qM);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const UM=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],bj=Se("arrow-right",UM);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const HM=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],ra=Se("bot",HM);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const KM=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],KO=Se("box",KM);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const YM=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Zc=Se("check",YM);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const GM=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],VM=Se("chevron-down",GM);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const XM=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],FM=Se("chevron-left",XM);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ZM=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],QM=Se("chevron-right",ZM);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const WM=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],wj=Se("circle-alert",WM);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const JM=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],jj=Se("clock",JM);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const eT=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],_j=Se("code",eT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const tT=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],ty=Se("credit-card",tT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const rT=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],nT=Se("database",rT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const aT=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],iT=Se("dollar-sign",aT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const lT=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],YO=Se("external-link",lT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const oT=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Ns=Se("eye-off",oT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const sT=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Xl=Se("eye",sT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const uT=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Sj=Se("file-text",uT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const cT=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],Nj=Se("image",cT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const fT=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],ry=Se("key",fT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const dT=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],hT=Se("layers",dT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const mT=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],pT=Se("layout-dashboard",mT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const vT=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Wa=Se("loader-circle",vT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const yT=[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]],Oj=Se("lock-keyhole",yT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const gT=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],xT=Se("lock",gT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const bT=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],wT=Se("log-out",bT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const jT=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],_T=Se("mail",jT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ST=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],Fa=Se("message-square",ST);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const NT=[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]],ny=Se("package-check",NT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const OT=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],GO=Se("package",OT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const AT=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],Qc=Se("pen",AT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ET=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Hi=Se("plus",ET);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const CT=[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],kT=Se("power-off",CT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const MT=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],ay=Se("power",MT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const TT=[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]],Aj=Se("qr-code",TT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const DT=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],la=Se("refresh-cw",DT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const PT=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],oa=Se("save",PT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const zT=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],RT=Se("search",zT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const LT=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],u0=Se("settings",LT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const IT=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],VO=Se("shield-check",IT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const $T=[["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}],["path",{d:"M3.103 6.034h17.794",key:"awc11p"}],["path",{d:"M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z",key:"o988cm"}]],XO=Se("shopping-bag",$T);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const BT=[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]],Ej=Se("shopping-cart",BT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const qT=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],c0=Se("sparkles",qT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const UT=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],f0=Se("square-pen",UT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const HT=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],ei=Se("trash-2",HT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const KT=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],YT=Se("trending-up",KT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const GT=[["path",{d:"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2",key:"wrbu53"}],["path",{d:"M15 18H9",key:"1lyqi6"}],["path",{d:"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14",key:"lysw3i"}],["circle",{cx:"17",cy:"18",r:"2",key:"332jqn"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}]],Cs=Se("truck",GT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const VT=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],XT=Se("upload",VT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const FT=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],ZT=Se("user-round",FT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const QT=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],iy=Se("user",QT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const WT=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],FO=Se("users",WT);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const JT=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],gr=Se("x",JT),eD=({activeTab:e,setActiveTab:t,onLogout:r})=>{const n=[{id:"dashboard",icon:pT,label:"仪表盘"},{id:"accounts",icon:FO,label:"账号管理"},{id:"orders",icon:XO,label:"订单管理"},{id:"cards",icon:ty,label:"卡密库存"},{id:"items",icon:KO,label:"商品列表"},{id:"keywords",icon:Fa,label:"自动化规则"},{id:"settings",icon:u0,label:"系统与AI"}];return f.jsxs("div",{className:"w-64 h-screen fixed left-0 top-0 bg-white border-r border-gray-100 flex flex-col justify-between z-20 shadow-[4px_0_24px_rgba(0,0,0,0.02)]",children:[f.jsxs("div",{className:"p-6",children:[f.jsxs("div",{className:"flex items-center gap-3 mb-12 px-2",children:[f.jsx("div",{className:"w-10 h-10 bg-[#0094f7] squircle flex items-center justify-center shrink-0 p-1.5",style:{filter:"drop-shadow(0 4px 12px rgba(0,148,247,0.25))"},children:f.jsx("img",{src:"/static/ydisks-logo.svg",alt:"Ydisks",className:"w-full h-full"})}),f.jsxs("h1",{className:"text-xl font-extrabold tracking-tight text-gray-900",children:["Ydisks闲鱼助手 ",f.jsx("span",{className:"text-xs bg-[#0094f7] text-white px-1.5 py-0.5 rounded ml-1",children:"PRO"})]})]}),f.jsx("nav",{className:"space-y-2",children:n.map(l=>{const s=l.icon,c=e===l.id;return f.jsxs("button",{onClick:()=>t(l.id),className:`w-full flex items-center gap-3 px-4 py-3.5 rounded-2xl transition-all duration-300 group relative overflow-hidden ${c?"bg-[#0094f7] text-white font-bold shadow-lg shadow-blue-100 transform scale-[1.02]":"text-gray-500 hover:bg-gray-50 hover:text-gray-900"}`,children:[f.jsx(s,{className:`w-5 h-5 transition-colors ${c?"text-white":"text-gray-400 group-hover:text-gray-600"}`}),f.jsx("span",{className:"text-sm tracking-wide",children:l.label}),c&&f.jsx(c0,{className:"w-4 h-4 absolute right-3 text-white/30 animate-pulse"})]},l.id)})})]}),f.jsx("div",{className:"p-6 border-t border-gray-50",children:f.jsxs("button",{onClick:r,className:"w-full flex items-center gap-3 px-4 py-3 text-gray-500 hover:text-red-500 hover:bg-red-50 rounded-2xl transition-all duration-200 font-medium",children:[f.jsx(wT,{className:"w-5 h-5"}),f.jsx("span",{className:"text-sm",children:"退出登录"})]})})]})},tD=e=>{if(!e)return"";const t=new URLSearchParams;for(const[n,l]of Object.entries(e))l!=null&&t.set(n,String(l));const r=t.toString();return r?`?${r}`:""},ad=async(e,t,r={})=>{const n=tD(r.params),l=`${t}${n}`,s=await fetch(l,{method:e,credentials:"include",headers:{...r.body===void 0?{}:{"Content-Type":"application/json"}},body:r.body===void 0?void 0:JSON.stringify(r.body)}),d=(s.headers.get("content-type")||"").includes("application/json");if(!s.ok){const h=d?await s.json().catch(()=>{}):await s.text().catch(()=>{}),m=typeof h=="string"?h:(h==null?void 0:h.detail)||(h==null?void 0:h.message)||(h==null?void 0:h.msg);throw new Error(m||`请求失败: ${s.status}`)}return d?await s.json():await s.text()},Pt=async(e,t)=>ad("GET",e,{params:t}),Ir=async(e,t)=>ad("POST",e,{body:t}),ar=async(e,t)=>ad("PUT",e,{body:t}),uo=async(e,t)=>ad("DELETE",e,{params:t}),rD=async e=>Ir("/login",e),ZO=async()=>Pt("/verify"),nD=async e=>ar("/account/credentials",e),aD=async(e,t)=>Ir("/cookies",{id:e,value:t}),iD=(e,t)=>{const r=e.avatar_url||"";if(!r)return"";try{const n=new URL(r,window.location.origin);return n.hostname.endsWith("alicdn.com")&&n.searchParams.set("_v",t),n.toString()}catch{return r}},d0=async()=>{const e=await Pt("/cookies/details"),t=Date.now().toString();return e.map(r=>({id:r.id,value:"",cookie:"",enabled:r.enabled,auto_confirm:r.auto_confirm,remark:r.remark,note:r.remark,pause_duration:r.pause_duration,username:r.username||"",login_password:"",show_browser:r.show_browser,nickname:r.nickname||r.remark||`账号 ${r.id.substring(0,6)}`,avatar_url:iD(r,t),profile_error:r.profile_error||"",ai_enabled:!1}))},lD=async()=>Pt("/cookies/runtime-status"),oD=async()=>Ir("/qr-login/generate"),sD=async e=>Pt(`/qr-login/check/${e}`),uD=async(e,t)=>ar(`/cookies/${e}/status`,{enabled:t}),cD=async e=>uo(`/cookies/${e}`),fD=async(e,t)=>ar(`/cookies/${e}/remark`,{remark:t}),dD=async(e,t)=>ar(`/cookies/${e}/auto-confirm`,{auto_confirm:t}),hD=async(e,t)=>ar(`/cookies/${e}/pause-duration`,{pause_duration:t}),mD=async(e,t)=>ar(`/cookies/${e}`,{id:e,value:t}),pD=async(e,t)=>ar(`/cookies/${e}/login-info`,t),vD=async()=>Pt("/ai-reply-settings"),Cj=async(e,t,r=1,n=20)=>{const l={page:r,page_size:n};t&&t!=="all"&&(l.status=t);const s=await Pt("/api/orders",l),d=(s.orders||s.data||[]).map(h=>({...h,id:h.id||h.order_id,status:h.status||h.order_status||"processing",quantity:Number(h.quantity||1)}));return{success:!0,data:d,total:s.total||d.length,page:s.page||r,page_size:s.page_size||n,total_pages:s.total_pages||1}},yD=async(e,t)=>ar(`/api/orders/${e}`,t),gD=async e=>uo(`/api/orders/${e}`),xD=async(e,t)=>{const r=new FormData,n=await fetch("/api/orders/refresh",{method:"POST",credentials:"include",body:r}),l=awLine truncated
A`).concat(s,",").concat(s,",0,1,1,").concat(2*c,",").concat(l,`
H`).concat(Wr,"M").concat(2*c,",").concat(l,`
A`).concat(s,",").concat(s,",0,1,1,").concat(c,",").concat(l),className:"recharts-legend-icon"});if(h==="rect")return b.createElement("path",{stroke:"none",fill:d,d:"M0,".concat(Wr/8,"h").concat(Wr,"v").concat(Wr*3/4,"h").concat(-Wr,"z"),className:"recharts-legend-icon"});if(b.isValidElement(t.legendIcon)){var p=l6({},t);return delete p.legendIcon,b.cloneElement(t.legendIcon,p)}return b.createElement(w0,{fill:d,cx:l,cy:l,size:Wr,sizeType:"diameter",type:h})}function d6(e){var{payload:t,iconSize:r,layout:n,formatter:l,inactiveColor:s,iconType:c}=e,d={x:0,y:0,width:Wr,height:Wr},h={display:n==="horizontal"?"inline-block":"block",marginRight:10},m={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((p,y)=>{var x=p.formatter||l,w=Ue({"recharts-legend-item":!0,["legend-item-".concat(y)]:!0,inactive:p.inactive});if(p.type==="none")return null;var j=p.inactive?s:p.color,_=x?x(p.value,p,y):p.value;return b.createElement("li",df({className:w,style:h,key:"legend-item-".concat(y)},Vs(e,p,y)),b.createElement(m0,{width:r,height:r,viewBox:d,style:m,"aria-label":"".concat(_," legend icon")},b.createElement(f6,{data:p,iconType:c,inactiveColor:s})),b.createElement("span",{className:"recharts-legend-item-text",style:{color:j}},_))})}var h6=e=>{var t=Mt(e,c6),{payload:r,layout:n,align:l}=t;if(!r||!r.length)return null;var s={padding:0,margin:0,textAlign:n==="horizontal"?l:"left"};return b.createElement("ul",{className:"recharts-default-legend",style:s},b.createElement(d6,df({},t,{payload:r})))},Ep={},Cp={},Xj;function m6(){return Xj||(Xj=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n){const l=new Map;for(let s=0;s<r.length;s++){const c=r[s],d=n(c,s,r);l.has(d)||l.set(d,c)}return Array.from(l.values())}e.uniqBy=t})(Cp)),Cp}var kp={},Fj;function p6(){return Fj||(Fj=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n){return function(...l){return r.apply(this,l.slice(0,n))}}e.ary=t})(kp)),kp}var Mp={},Zj;function _A(){return Zj||(Zj=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r}e.identity=t})(Mp)),Mp}var Tp={},Dp={},Pp={},Qj;function v6(){return Qj||(Qj=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Number.isSafeInteger(r)&&r>=0}e.isLength=t})(Pp)),Pp}var Wj;function _0(){return Wj||(Wj=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=v6();function r(n){return n!=null&&typeof n!="function"&&t.isLength(n.length)}e.isArrayLike=r})(Dp)),Dp}var zp={},Jj;function y6(){return Jj||(Jj=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="object"&&r!==null}e.isObjectLike=t})(zp)),zp}var e_;function g6(){return e_||(e_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_0(),r=y6();function n(l){return r.isObjectLike(l)&&t.isArrayLike(l)}e.isArrayLikeObject=n})(Tp)),Tp}var Rp={},Lp={},t_;function x6(){return t_||(t_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=b0();function r(n){return function(l){return t.get(l,n)}}e.property=r})(Lp)),Lp}var Ip={},$p={},Bp={},qp={},r_;function SA(){return r_||(r_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r!==null&&(typeof r=="object"||typeof r=="function")}e.isObject=t})(qp)),qp}var Up={},n_;function NA(){return n_||(n_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==null||typeof r!="object"&&typeof r!="function"}e.isPrimitive=t})(Up)),Up}var Hp={},a_;function OA(){return a_||(a_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n){return r===n||Number.isNaN(r)&&Number.isNaN(n)}e.isEqualsSameValueZero=t})(Hp)),Hp}var i_;function b6(){return i_||(i_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=SA(),r=NA(),n=OA();function l(p,y,x){return typeof x!="function"?l(p,y,()=>{}):s(p,y,function w(j,_,N,A,O,P){const k=x(j,_,N,A,O,P);return k!==void 0?!!k:s(j,_,w,P)},new Map)}function s(p,y,x,w){if(y===p)return!0;switch(typeof y){case"object":return c(p,y,x,w);case"function":return Object.keys(y).length>0?s(p,{...y},x,w):n.isEqualsSameValueZero(p,y);default:return t.isObject(p)?typeof y=="string"?y==="":!0:n.isEqualsSameValueZero(p,y)}}function c(p,y,x,w){if(y==null)return!0;if(Array.isArray(y))return h(p,y,x,w);if(y instanceof Map)return d(p,y,x,w);if(y instanceof Set)return m(p,y,x,w);const j=Object.keys(y);if(p==null||r.isPrimitive(p))return j.length===0;if(j.length===0)return!0;if(w!=null&&w.has(y))return w.get(y)===p;w==null||w.set(y,p);try{for(let _=0;_<j.length;_++){const N=j[_];if(!r.isPrimitive(p)&&!(N in p)||y[N]===void 0&&p[N]!==void 0||y[N]===null&&p[N]!==null||!x(p[N],y[N],N,p,y,w))return!1}return!0}finally{w==null||w.delete(y)}}function d(p,y,x, Line truncated
* @license React
* use-sync-external-store-shim.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var S_;function P6(){if(S_)return lv;S_=1;var e=so();function t(y,x){return y===x&&(y!==0||1/y===1/x)||y!==y&&x!==x}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,l=e.useEffect,s=e.useLayoutEffect,c=e.useDebugValue;function d(y,x){var w=x(),j=n({inst:{value:w,getSnapshot:x}}),_=j[0].inst,N=j[1];return s(function(){_.value=w,_.getSnapshot=x,h(_)&&N({inst:_})},[y,w,x]),l(function(){return h(_)&&N({inst:_}),y(function(){h(_)&&N({inst:_})})},[y]),c(w),w}function h(y){var x=y.getSnapshot;y=y.value;try{var w=x();return!r(y,w)}catch{return!0}}function m(y,x){return x()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:d;return lv.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,lv}var N_;function z6(){return N_||(N_=1,iv.exports=P6()),iv.exports}/**
* @license React
* use-sync-external-store-shim/with-selector.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var O_;function R6(){if(O_)return av;O_=1;var e=so(),t=z6();function r(m,p){return m===p&&(m!==0||1/m===1/p)||m!==m&&p!==p}var n=typeof Object.is=="function"?Object.is:r,l=t.useSyncExternalStore,s=e.useRef,c=e.useEffect,d=e.useMemo,h=e.useDebugValue;return av.useSyncExternalStoreWithSelector=function(m,p,y,x,w){var j=s(null);if(j.current===null){var _={hasValue:!1,value:null};j.current=_}else _=j.current;j=d(function(){function A(T){if(!O){if(O=!0,P=T,T=x(T),w!==void 0&&_.hasValue){var R=_.value;if(w(R,T))return k=R}return k=T}if(R=k,n(P,T))return R;var $=x(T);return w!==void 0&&w(R,$)?(P=T,R):(P=T,k=$)}var O=!1,P,k,z=y===void 0?null:y;return[function(){return A(p())},z===null?void 0:function(){return A(z())}]},[p,y,x,w]);var N=l(m,j[0],j[1]);return c(function(){_.hasValue=!0,_.value=N},[N]),h(N),N},av}var A_;function L6(){return A_||(A_=1,nv.exports=R6()),nv.exports}var I6=L6(),N0=b.createContext(null),$6=e=>e,rt=()=>{var e=b.useContext(N0);return e?e.store.dispatch:$6},Wc=()=>{},B6=()=>Wc,q6=(e,t)=>e===t;function ge(e){var t=b.useContext(N0),r=b.useMemo(()=>t?n=>{if(n!=null)return e(n)}:Wc,[t,e]);return I6.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:B6,t?t.store.getState:Wc,t?t.store.getState:Wc,r,q6)}function U6(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function H6(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function K6(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){const r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var E_=e=>Array.isArray(e)?e:[e];function Y6(e){const t=Array.isArray(e[0])?e[0]:e;return K6(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function G6(e,t){const r=[],{length:n}=e;for(let l=0;l<n;l++)r.push(e[l].apply(null,t));return r}var V6=class{constructor(e){this.value=e}deref(){return this.value}},X6=typeof WeakRef<"u"?WeakRef:V6,F6=0,C_=1;function Tc(){return{s:F6,v:void 0,o:null,p:null}}function TA(e,t={}){let r=Tc();const{resultEqualityCheck:n}=t;let l,s=0;function c(){var y;let d=r;const{length:h}=arguments;for(let x=0,w=h;x<w;x++){const j=arguments[x];if(typeof j=="function"||typeof j=="object"&&j!==null){let _=d.o;_===null&&(d.o=_=new WeakMap);const N=_.get(j);N===void 0?(d=Tc(),_.set(j,d)):d=N}else{let _=d.p;_===null&&(d.p=_=new Map);const N=_.get(j);N===void 0?(d=Tc(),_.set(j,d)):d=N}}const m=d;let p;if(d.s===C_)p=d.v;else if(p=e.apply(null,arguments),s++,n){const x=((y=l==null?void 0:l.deref)==null?void 0:y.call(l))??l;x!=null&&n(x,p)&&(p=x,s!==0&&s--),l=typeof p=="object"&&p!==null||typeof p=="function"?new X6(p):p}return m.s=C_,m.v=p,p}return c.clearCache=()=>{r=Tc(),c.resetResultsCount()},c.resultsCount=()=>s,c.resetResultsCount=()=>{s=0},c}function Z6(e,...t){const r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...l)=>{let s=0,c=0,d,h={},m=l.pop();typeof m=="object"&&(h=m,m=l.pop()),U6(m,`createSelector expects an output function after the inputs, but received: [${typeof m}]`);const p={...r,...h},{memoize:y,memoizeOptions:x=[],argsMemoize:w=TA,argsMemoizeOptions:j=[]}=p,_=E_(x),N=E_(j),A=Y6(l),O=y(function(){return s++,m.apply(null,arguments)},..._),P=w(function(){c++;const z=G6(A,arguments);return d=O.apply(null,z),d},...N);return Object.assign(P,{resultFunc:m,memoizedResultFunc:O,dependencies:A,dependencyRecomputations:()=>c,resetDependencyRecomputations:()=>{c=0},lastResult:()=>d,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:y,argsMemoize:w})};return Object.assign(n,{withTypes:()=>n}),n}var Y=Z6(TA),Q6=Object.assign((e,t=Y)=>{H6(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const r=Object.keys(e),n=r.map(s=>e[s]);return t(n,(...s)=>s.reduce((c,d,h)=>(c[r[h]]=d,c),{}))},{withTypes:()=>Q6}),ov={},sv={},uv={},k_;function W6(){return k_||(k_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"?1:n===null?2:n===void 0?3:n!==n?4:0}const r=(n,l,s)=>{if(n!==l){const c=t(n),d=t(l);if(c===d&&c===0){if(n<l)return s==="desc"?1:-1;if(n>l)return s==="desc"?-1:1}return s==="desc"?d-c:c-d}return 0};e.compareValues=r})(uv)),uv}var cv={},fv={},M_;function DA(){return M_||(M_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"||r instanceof Symbol}e.isSymbol=t})(fv)),fv}var T_;function J6(){return T_||(T_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=DA(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function l(s,c){return Array.isArray(s)?!1:typeof s=="number"||typeof s=="boolean"||s==null||t.isSymbol(s)?!0:typeof s=="string"&&(n.test(s)||!r.test(s))||c!=nullLine truncated
please check the style of container, or the props width(%s) and height(%s),
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
height and width.`,T,R,l,s,c,d,r),b.createElement("div",{id:y?"".concat(y):void 0,className:Ue("recharts-responsive-container",x),style:f2(f2({},j),{},{width:l,height:s,minWidth:c,minHeight:d,maxHeight:h}),ref:_},b.createElement("div",{style:Y8({width:l,height:s})},b.createElement(wE,{width:T,height:R},m)))}),ps=b.forwardRef((e,t)=>{var r=D0();if(En(r.width)&&En(r.height))return e.children;var{width:n,height:l}=G8({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:s,calculatedHeight:c}=xE(void 0,void 0,{width:n,height:l,aspect:e.aspect,maxHeight:e.maxHeight});return de(s)&&de(c)?b.createElement(wE,{width:s,height:c},e.children):b.createElement(Q8,_y({},e,{width:n,height:l,ref:t}))});function P0(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var _d=()=>{var e,t=ir(),r=ge(D8),n=ge(jd),l=(e=ge(wd))===null||e===void 0?void 0:e.padding;return!t||!n||!l?r:{width:n.width-l.left-l.right,height:n.height-l.top-l.bottom,x:l.left,y:l.top}},W8={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},jE=()=>{var e;return(e=ge(zt))!==null&&e!==void 0?e:W8},z0=()=>ge(ya),R0=()=>ge(ga),J8=()=>ge(e=>e.layout.margin),$e=e=>e.layout.layoutType,el=()=>ge($e),L0=()=>{var e=el();if(e==="horizontal"||e==="vertical")return e},_E=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},eR=()=>{var e=el();return e!==void 0},Qs=e=>{var t=rt(),r=ir(),{width:n,height:l}=e,s=D0(),c=n,d=l;return s&&(c=s.width>0?s.width:n,d=s.height>0?s.height:l),b.useEffect(()=>{!r&&En(c)&&En(d)&&t(l8({width:c,height:d}))},[t,r,c,d]),null},SE=Symbol.for("immer-nothing"),d2=Symbol.for("immer-draftable"),Lr=Symbol.for("immer-state");function un(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var zs=Object.getPrototypeOf;function no(e){return!!e&&!!e[Lr]}function Fi(e){var t;return e?NE(e)||Array.isArray(e)||!!e[d2]||!!((t=e.constructor)!=null&&t[d2])||Ws(e)||Nd(e):!1}var tR=Object.prototype.constructor.toString(),h2=new WeakMap;function NE(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let n=h2.get(r);return n===void 0&&(n=Function.toString.call(r),h2.set(r,n)),n===tR}function Sf(e,t,r=!0){Sd(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(l=>{t(l,e[l],e)}):e.forEach((n,l)=>t(l,n,e))}function Sd(e){const t=e[Lr];return t?t.type_:Array.isArray(e)?1:Ws(e)?2:Nd(e)?3:0}function Sy(e,t){return Sd(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function OE(e,t,r){const n=Sd(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function rR(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Ws(e){return e instanceof Map}function Nd(e){return e instanceof Set}function Ti(e){return e.copy_||e.base_}function Ny(e,t){if(Ws(e))return new Map(e);if(Nd(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=NE(e);if(t===!0||t==="class_only"&&!r){const n=Object.getOwnPropertyDescriptors(e);delete n[Lr];let l=Reflect.ownKeys(n);for(let s=0;s<l.length;s++){const c=l[s],d=n[c];d.writable===!1&&(d.writable=!0,d.configurable=!0),(d.get||d.set)&&(n[c]={configurable:!0,writable:!0,enumerable:d.enumerable,value:e[c]})}return Object.create(zs(e),n)}else{const n=zs(e);if(n!==null&&r)return{...e};const l=Object.create(n);return Object.assign(l,e)}}function I0(e,t=!1){return Od(e)||no(e)||!Fi(e)||(Sd(e)>1&&Object.defineProperties(e,{set:Ic,add:Ic,clear:Ic,delete:Ic}),Object.freeze(e),t&&Object.values(e).forEach(r=>I0(r,!0))),e}function nR(){un(2)}var Ic={value:nR};function Od(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var aR={};function Zi(e){const t=aR[e];return t||un(0,e),t}var Rs;function AE(){return Rs}function iR(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function m2(e,t){t&&(Zi("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Oy(e){Ay(e),e.drafts_.forEach(lR),e.drafts_=null}function Ay(e){e===Rs&&(Rs=e.parent_)}function p2(e){return Rs=iR(Rs,e)}function lR(e){const t=e[Lr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function v2(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[Lr].modified_&&(Oy(t),un(4)),Fi(e)&&(e=Nf(t,e),t.parent_||Of(t,e)),t.patches_&&Zi("Patches").generateReplacementPatches_(r[Lr].base_,e,t.patches_,t.inversePatches_)):e=Nf(t,r,[]),Oy(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==SE?e:void 0}function Nf(e,t,r){if(Od(t))return t;const n=e.immer_.shouldUseStrictIteration(),l=t[Lr];if(!l)return Sf(t,(s,c)=>y2(e,l,t,s,c,r),n),t;if(l.scope_!==e)return t;if(!l.modified_)return Of(e,l.base_,!0),l.base_;if(!l.finalized_){l.finalized_=!0,l.scope_.unfinalizedDrafts_--;const s=l.copy_;let c=s,d=!1 Line truncated
`,",",""])),x[1],x[1],p,e+r,t+h*x[1])),y+=yt($2||($2=wn(["L ",",",""])),e+r,t+n-h*x[2]),x[2]>0&&(y+=yt(B2||(B2=wn(["A ",",",",0,0,",`,
`,",",""])),x[2],x[2],p,e+r-m*x[2],t+n)),y+=yt(q2||(q2=wn(["L ",",",""])),e+m*x[3],t+n),x[3]>0&&(y+=yt(U2||(U2=wn(["A ",",",",0,0,",`,
`,",",""])),x[3],x[3],p,e,t+n-h*x[3])),y+="Z"}else if(d>0&&l===+l&&l>0){var A=Math.min(d,l);y=yt(H2||(H2=wn(["M ",",",`
A `,",",",0,0,",",",",",`
L `,",",`
A `,",",",0,0,",",",",",`
L `,",",`
A `,",",",0,0,",",",",",`
L `,",",`
A `,",",",0,0,",",",","," Z"])),e,t+h*A,A,A,p,e+m*A,t,e+r-m*A,t,A,A,p,e+r,t+h*A,e+r,t+n-h*A,A,A,p,e+r-m*A,t+n,e+m*A,t+n,A,A,p,e,t+n-h*A)}else y=yt(K2||(K2=wn(["M ",","," h "," v "," h "," Z"])),e,t,r,n,-r);return y},F2={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},BE=e=>{var t=Mt(e,F2),r=b.useRef(null),[n,l]=b.useState(-1);b.useEffect(()=>{if(r.current&&r.current.getTotalLength)try{var W=r.current.getTotalLength();W&&l(W)}catch{}},[]);var{x:s,y:c,width:d,height:h,radius:m,className:p}=t,{animationEasing:y,animationDuration:x,animationBegin:w,isAnimationActive:j,isUpdateAnimationActive:_}=t,N=b.useRef(d),A=b.useRef(h),O=b.useRef(s),P=b.useRef(c),k=b.useMemo(()=>({x:s,y:c,width:d,height:h,radius:m}),[s,c,d,h,m]),z=tu(k,"rectangle-");if(s!==+s||c!==+c||d!==+d||h!==+h||d===0||h===0)return null;var T=Ue("recharts-rectangle",p);if(!_){var R=ur(t),{radius:$}=R,Z=V2(R,N7);return b.createElement("path",kf({},Z,{x:ti(s),y:ti(c),width:ti(d),height:ti(h),radius:typeof m=="number"?m:void 0,className:T,d:X2(s,c,d,h,m)}))}var X=N.current,L=A.current,K=O.current,se=P.current,ce="0px ".concat(n===-1?1:n,"px"),he="".concat(n,"px 0px"),q=RE(["strokeDasharray"],x,typeof y=="string"?y:F2.animationEasing);return b.createElement(eu,{animationId:z,key:z,canBegin:n>0,duration:x,easing:y,isActive:_,begin:w},W=>{var ue=lt(X,d,W),te=lt(L,h,W),M=lt(K,s,W),C=lt(se,c,W);r.current&&(N.current=ue,A.current=te,O.current=M,P.current=C);var U;j?W>0?U={transition:q,strokeDasharray:he}:U={strokeDasharray:ce}:U={strokeDasharray:he};var ee=ur(t),{radius:le}=ee,me=V2(ee,O7);return b.createElement("path",kf({},me,{radius:typeof m=="number"?m:void 0,className:T,d:X2(M,C,ue,te,m),ref:r,style:G2(G2({},U),t.style)}))})};function Z2(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),r.push.apply(r,n)}return r}function Q2(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Z2(Object(r),!0).forEach(function(n){M7(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z2(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function M7(e,t,r){return(t=T7(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function T7(e){var t=D7(e,"string");return typeof t=="symbol"?t:t+""}function D7(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Mf=Math.PI/180,P7=e=>e*180/Math.PI,Et=(e,t,r,n)=>({x:e+Math.cos(-Mf*n)*r,y:t+Math.sin(-Mf*n)*r}),qE=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},z7=(e,t)=>{var{x:r,y:n}=e,{x:l,y:s}=t;return Math.sqrt((r-l)**2+(n-s)**2)},R7=(e,t)=>{var{x:r,y:n}=e,{cx:l,cy:s}=t,c=z7({x:r,y:n},{x:l,y:s});if(c<=0)return{radius:c,angle:0};var d=(r-l)/c,h=Math.acos(d);return n>s&&(h=2*Math.PI-h),{radius:c,angle:P7(h),angleInRadian:h}},L7=e=>{var{startAngle:t,endAngle:r}=e,n=Math.floor(t/360),l=Math.floor(r/360),s=Math.min(n,l);return{startAngle:t-s*360,endAngle:r-s*360}},I7=(e,t)=>{var{startAngle:r,endAngle:n}=t,l=Math.floor(r/360),s=Math.floor(n/360),c=Math.min(l,s);return e+c*360},$7=(e,t)=>{var{chartX:r,chartY:n}=e,{radius:l,angle:s}=R7({x:r,y:n},t),{innerRadius:c,outerRadius:d}=t;if(l<c||l>d||l===0)return null;var{startAngle:h,endAngle:m}=L7(t),p=s,y;if(h<=m){for(;p>m;)p-=360;for(;p<h;)p+=360;y=p>=h&&p<=m}else{for(;p>h;)p-=360;for(;p<m;)p+=360;y=p>=m&&p<=h}return y?Q2(Q2({},t),{},{radius:l,angle:I7(p,t)}):null};function UE(e){var{cx:t,cy:r,radius:n,startAngle:l,endAngle:s}=e,c=Et(t,r,n,l),d=Et(t,r,n,s);return{points:[c,d],cx:t,cy:r,radius:n,startAngle:l,endAngle:s}}var W2,J2,eS,tS,rS,nS,aS;function Ry(){return Ry=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ry.apply(null,arguments)}function Pi(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var B7=(e,t)=>{var r=Ht(t-e),n=Math.min(Math.abs(t-e),359.999);return r*n},Bc=e=>{var{cx:t,cy:r,radius:n,angle:l,sign:s,isExternal:c,cornerRadius:d,cornerIsExternal:h}=e,m=d*(c?1:-1)+n,p=Math.asin(d/m)/Mf,y=h?l:l+s*p,x=Et(t,r,m,y),w=Et(t,r,n,y),j=h?l-s*p:l,_=Et(t,r,m*Math.cos(p*Mf),j);return{center:x,circleTangency:w,lineTangency:_,theta:p}},HE=e=>{var{cx:t,cy:r,innerRadius:n,outerRadius:l,startAngle:s,endAngle:c}=e,d=B7(s,c),h=s+d,m=Et(t,r,l,s),p=Et(t,r,l,h),y=yt(W2||(W2=P Line truncated
A `,",",`,0,
`,",",`,
`,",",`
`])),m.x,m.y,l,l,+(Math.abs(d)>180),+(s>h),p.x,p.y);if(n>0){var x=Et(t,r,n,s),w=Et(t,r,n,h);y+=yt(J2||(J2=Pi(["L ",",",`
A `,",",`,0,
`,",",`,
`,","," Z"])),w.x,w.y,n,n,+(Math.abs(d)>180),+(s<=h),x.x,x.y)}else y+=yt(eS||(eS=Pi(["L ",","," Z"])),t,r);return y},q7=e=>{var{cx:t,cy:r,innerRadius:n,outerRadius:l,cornerRadius:s,forceCornerRadius:c,cornerIsExternal:d,startAngle:h,endAngle:m}=e,p=Ht(m-h),{circleTangency:y,lineTangency:x,theta:w}=Bc({cx:t,cy:r,radius:l,angle:h,sign:p,cornerRadius:s,cornerIsExternal:d}),{circleTangency:j,lineTangency:_,theta:N}=Bc({cx:t,cy:r,radius:l,angle:m,sign:-p,cornerRadius:s,cornerIsExternal:d}),A=d?Math.abs(h-m):Math.abs(h-m)-w-N;if(A<0)return c?yt(tS||(tS=Pi(["M ",",",`
a`,",",",0,0,1,",`,0
a`,",",",0,0,1,",`,0
`])),x.x,x.y,s,s,s*2,s,s,-s*2):HE({cx:t,cy:r,innerRadius:n,outerRadius:l,startAngle:h,endAngle:m});var O=yt(rS||(rS=Pi(["M ",",",`
A`,",",",0,0,",",",",",`
A`,",",",0,",",",",",",",`
A`,",",",0,0,",",",",",`
`])),x.x,x.y,s,s,+(p<0),y.x,y.y,l,l,+(A>180),+(p<0),j.x,j.y,s,s,+(p<0),_.x,_.y);if(n>0){var{circleTangency:P,lineTangency:k,theta:z}=Bc({cx:t,cy:r,radius:n,angle:h,sign:p,isExternal:!0,cornerRadius:s,cornerIsExternal:d}),{circleTangency:T,lineTangency:R,theta:$}=Bc({cx:t,cy:r,radius:n,angle:m,sign:-p,isExternal:!0,cornerRadius:s,cornerIsExternal:d}),Z=d?Math.abs(h-m):Math.abs(h-m)-z-$;if(Z<0&&s===0)return"".concat(O,"L").concat(t,",").concat(r,"Z");O+=yt(nS||(nS=Pi(["L",",",`
A`,",",",0,0,",",",",",`
A`,",",",0,",",",",",",",`
A`,",",",0,0,",",",",","Z"])),R.x,R.y,s,s,+(p<0),T.x,T.y,n,n,+(Z>180),+(p>0),P.x,P.y,s,s,+(p<0),k.x,k.y)}else O+=yt(aS||(aS=Pi(["L",",","Z"])),t,r);return O},U7={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},KE=e=>{var t=Mt(e,U7),{cx:r,cy:n,innerRadius:l,outerRadius:s,cornerRadius:c,forceCornerRadius:d,cornerIsExternal:h,startAngle:m,endAngle:p,className:y}=t;if(s<l||m===p)return null;var x=Ue("recharts-sector",y),w=s-l,j=nr(c,w,0,!0),_;return j>0&&Math.abs(m-p)<360?_=q7({cx:r,cy:n,innerRadius:l,outerRadius:s,cornerRadius:Math.min(j,w/2),forceCornerRadius:d,cornerIsExternal:h,startAngle:m,endAngle:p}):_=HE({cx:r,cy:n,innerRadius:l,outerRadius:s,startAngle:m,endAngle:p}),b.createElement("path",Ry({},ur(t),{className:x,d:_}))};function H7(e,t,r){if(e==="horizontal")return[{x:t.x,y:r.top},{x:t.x,y:r.top+r.height}];if(e==="vertical")return[{x:r.left,y:t.y},{x:r.left+r.width,y:t.y}];if(jA(t)){if(e==="centric"){var{cx:n,cy:l,innerRadius:s,outerRadius:c,angle:d}=t,h=Et(n,l,s,d),m=Et(n,l,c,d);return[{x:h.x,y:h.y},{x:m.x,y:m.y}]}return UE(t)}}var Nv={},Ov={},Av={},iS;function K7(){return iS||(iS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=DA();function r(n){return t.isSymbol(n)?NaN:Number(n)}e.toNumber=r})(Av)),Av}var lS;function Y7(){return lS||(lS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=K7();function r(n){return n?(n=t.toNumber(n),n===1/0||n===-1/0?(n<0?-1:1)*Number.MAX_VALUE:n===n?n:0):n===0?n:0}e.toFinite=r})(Ov)),Ov}var oS;function G7(){return oS||(oS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=PA(),r=Y7();function n(l,s,c){c&&typeof c!="number"&&t.isIterateeCall(l,s,c)&&(s=c=void 0),l=r.toFinite(l),s===void 0?(s=l,l=0):s=r.toFinite(s),c=c===void 0?l<s?1:-1:r.toFinite(c);const d=Math.max(Math.ceil((s-l)/(c||1)),0),h=new Array(d);for(let m=0;m<d;m++)h[m]=l,l+=c;return h}e.range=n})(Nv)),Nv}var Ev,sS;function V7(){return sS||(sS=1,Ev=G7().range),Ev}var X7=V7();const YE=kn(X7);function ri(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function F7(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function B0(e){let t,r,n;e.length!==2?(t=ri,r=(d,h)=>ri(e(d),h),n=(d,h)=>e(d)-h):(t=e===ri||e===F7?e:Z7,r=e,n=e);function l(d,h,m=0,p=d.length){if(m<p){if(t(h,h)!==0)return p;do{const y=m+p>>>1;r(d[y],h)<0?m=y+1:p=y}while(m<p)}return m}function s(d,h,m=0,p=d.length){if(m<p){if(t(h,h)!==0)return p;do{const y=m+p>>>1;r(d[y],h)<=0?m=y+1:p=y}while(m<p)}return m}function c(d,h,m=0,p=d.length){const y=l(d,h,m,p-1);return y>m&&n(d[y-1],h)>-n(d[y],h)?y-1:y}return{left:l,center:c,right:s}}function Z7(){return 0}function GE(e){return e===null?NaN:+e}function*Q7(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const W7=B0(ri),ru=W7.right;B0(GE).center;class uS extends Map{constructor(t,r=tL){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,l]of t)this.set(n,l)}get(t){return super.get(cS(this,t))}has(t){return super.has(cS(this,t))}set(t,r){return super.set(J7(this,t),r)}delete(t){return super.delete(eL(this,t))}}function cS({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function J7({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function eL({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function tL(e){return e!==null&&typeof e=="object"?e.valueOf():e}function rL(e=ri){if(e===ri)return VE;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function VE(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const nL=Math.sqrt(50),aL=Math.sqrt(10),iL=Math.sqrt(2);function Tf(e,t,r){const n=(t-e)/Math.max(0,r),l=Math.floor(Math.log10(n)),s=n/Math.pow(10,l),c=s>=nL?10:s>=aL?5:s>=iL?2:1;let d,h,m;return l<0?(m=Math.pow(10,-l)/c,d=Math.round(e*m),h=Math.round(t*m),d/m<e&&++d,h/m>t&&--h,m=-m):(m=Math.pow(10,l)*c,d=Math.round(e/m),h=Math.round(t/m),d*m<e&&++d,h*m>t&&--h),h<d&&.5<=r&&r<2?Tf(e,t,r*2):[d,h,m]}function Ly(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const n=t<e,[l,s,c]=n?Tf(t,e,r):Tf(e,t,r);if(!(s>=l))return[];const d=s-l+1,h=new Array(d);if(n)if(c<0)for(let m=0;m<d;++m)h[m]=(s-m)/-c;else for(let m=0;m<d;++m)h[m]=(s-m)*c;else if(c<0)for(let m=0;m<d;++m)h[m]=(l+m)/-c;else for(let m=0;m<d;++m)h[m]=(l+m)*c;return h}function Iy(e,t,r){return t=+t,e=+e,r=+r,Tf(e,t,r)[2]}function $y(e,t,r){t=+t,e=+e,r=+r;const n=t<e,l=n?Iy(t,e,r):Iy(e,t,r);return(n?-1:1)*(l<0?1/-l:l)}function fS(e,t){let r;for(const n of e)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function dS(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function XE(e,t,r=0,n=1/0,l){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e Line truncated
A`).concat(j,",").concat(j,",0,1,").concat(O?0:1,`,
`).concat(k.x,",").concat(k.y),T=xt(e.id)?Ms("recharts-radial-line-"):e.id;return b.createElement("text",na({},n,{dominantBaseline:"central",className:Ue("recharts-radial-bar-label",c)}),b.createElement("defs",null,b.createElement("path",{id:T,d:z})),b.createElement("textPath",{xlinkHref:"#".concat(T)},r))},HU=(e,t,r)=>{var{cx:n,cy:l,innerRadius:s,outerRadius:c,startAngle:d,endAngle:h}=e,m=(d+h)/2;if(r==="outside"){var{x:p,y}=Et(n,l,c+t,m);return{x:p,y,textAnchor:p>=n?"start":"end",verticalAnchor:"middle"}}if(r==="center")return{x:n,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(r==="centerTop")return{x:n,y:l,textAnchor:"middle",verticalAnchor:"start"};if(r==="centerBottom")return{x:n,y:l,textAnchor:"middle",verticalAnchor:"end"};var x=(s+c)/2,{x:w,y:j}=Et(n,l,x,m);return{x:w,y:j,textAnchor:"middle",verticalAnchor:"middle"}},rf=e=>e!=null&&"cx"in e&&de(e.cx),KU={angle:0,offset:5,zIndex:Ct.label,position:"middle",textBreakAll:!1};function YU(e){if(!rf(e))return e;var{cx:t,cy:r,outerRadius:n}=e,l=n*2;return{x:t-n,y:r-n,width:l,upperWidth:l,lowerWidth:l,height:l}}function Qa(e){var t=Mt(e,KU),{viewBox:r,parentViewBox:n,position:l,value:s,children:c,content:d,className:h="",textBreakAll:m,labelRef:p}=t,y=$U(),x=a4(),w=l==="center"?x:y??x,j,_,N;r==null?j=w:rf(r)?j=r:j=P0(r);var A=YU(j);if(!j||xt(s)&&xt(c)&&!b.isValidElement(d)&&typeof d!="function")return null;var O=Es(Es({},t),{},{viewBox:j});if(b.isValidElement(d)){var{labelRef:P}=O,k=MN(O,MU);return b.cloneElement(d,k)}if(typeof d=="function"){var{content:z}=O,T=MN(O,TU);if(_=b.createElement(d,T),b.isValidElement(_))return _}else _=BU(t);var R=ur(t);if(rf(j)){if(l==="insideStart"||l==="insideEnd"||l==="end")return UU(t,l,_,R,j);N=HU(j,t.offset,t.position)}else{if(!A)return null;var $=kU({viewBox:A,position:l,offset:t.offset,parentViewBox:rf(n)?void 0:n});N=Es(Es({x:$.x,y:$.y,textAnchor:$.horizontalAnchor,verticalAnchor:$.verticalAnchor},$.width!==void 0?{width:$.width}:{}),$.height!==void 0?{height:$.height}:{})}return b.createElement(_r,{zIndex:t.zIndex},b.createElement(Vd,na({ref:p,className:Ue("recharts-label",h)},R,N,{textAnchor:jU(R.textAnchor)?R.textAnchor:N.textAnchor,breakAll:m}),_))}Qa.displayName="Label";var GU=(e,t,r)=>{if(!e)return null;var n={viewBox:t,labelRef:r};return e===!0?b.createElement(Qa,na({key:"label-implicit"},n)):An(e)?b.createElement(Qa,na({key:"label-implicit",value:e},n)):b.isValidElement(e)?e.type===Qa?b.cloneElement(e,Es({key:"label-implicit"},n)):b.createElement(Qa,na({key:"label-implicit",content:e},n)):Fg(e)?b.createElement(Qa,na({key:"label-implicit",content:e},n)):e&&typeof e=="object"?b.createElement(Qa,na({},e,{key:"label-implicit"},n)):null};function VU(e){var{label:t,labelRef:r}=e,n=a4();return GU(t,n,r)||null}var $v={},Bv={},DN;function XU(){return DN||(DN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r[r.length-1]}e.last=t})(Bv)),Bv}var qv={},PN;function FU(){return PN||(PN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Array.isArray(r)?r:Array.from(r)}e.toArray=t})(qv)),qv}var zN;function ZU(){return zN||(zN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=XU(),r=FU(),n=_0();function l(s){if(n.isArrayLike(s))return t.last(r.toArray(s))}e.last=l})($v)),$v}var Uv,RN;function QU(){return RN||(RN=1,Uv=ZU().last),Uv}var WU=QU();const JU=kn(WU);var eH=["valueAccessor"],tH=["dataKey","clockWise","id","textBreakAll","zIndex"];function Xf(){return Xf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xf.apply(null,arguments)}function LN(e,t){if(e==null)return{};var r,n,l=rH(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(l[r]=e[r])}return l}function rH(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var nH=e=>Array.isArray(e.value)?JU(e.value):e.value,i4=b.createContext(void 0),l4=i4.Provider,o4=b.createContext(void 0),aH=o4.Provider;function iH(){return b.useContext(i4)}function lH(){return b.useContext(o4)}function nf(e){var{valueAccessor:t=nH}=e,r=LN(e,eH),{dataKey:n,clockWise:l,id:s,textBreakAll:c,zIndex:d}=r,h=LN(r,tH),m=iH(),p=lH(),y=m||p;return!y||!y.length?null:b.createElement(_r,{zIndex:d??Ct.label},b.createElement(_t,{className:"recharts-label-list"},y.map((x,w)=>{var j,_=xt(n)?t(x,w):We(x.payload,n),N=xt(s)?{}:{id:"".concat(s,"-").concat(w)};return b.createElement(Qa,Xf({key:"label-".concat(w)},ur(x),h,N,{fill:(j=r.fill)!==null&&j!==void 0?j:x.fill,parentViewBox:x.parentViewBox,value:_,textBreakAll:c,viewBox:x.viewBox,index:w,zIndex:0}))})))}nf.displayName="LabelList";function Zg(e){var{label:t}=e;return t?t===!0?b.createElement(nf,{key:"labelList-implicit"}):b.is Line truncated
* @license React
* react-is.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var qN;function _H(){if(qN)return Qe;qN=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),x=Symbol.for("react.view_transition"),w=Symbol.for("react.client.reference");function j(_){if(typeof _=="object"&&_!==null){var N=_.$$typeof;switch(N){case e:switch(_=_.type,_){case r:case l:case n:case h:case m:case x:return _;default:switch(_=_&&_.$$typeof,_){case c:case d:case y:case p:return _;case s:return _;default:return N}}case t:return N}}}return Qe.ContextConsumer=s,Qe.ContextProvider=c,Qe.Element=e,Qe.ForwardRef=d,Qe.Fragment=r,Qe.Lazy=y,Qe.Memo=p,Qe.Portal=t,Qe.Profiler=l,Qe.StrictMode=n,Qe.Suspense=h,Qe.SuspenseList=m,Qe.isContextConsumer=function(_){return j(_)===s},Qe.isContextProvider=function(_){return j(_)===c},Qe.isElement=function(_){return typeof _=="object"&&_!==null&&_.$$typeof===e},Qe.isForwardRef=function(_){return j(_)===d},Qe.isFragment=function(_){return j(_)===r},Qe.isLazy=function(_){return j(_)===y},Qe.isMemo=function(_){return j(_)===p},Qe.isPortal=function(_){return j(_)===t},Qe.isProfiler=function(_){return j(_)===l},Qe.isStrictMode=function(_){return j(_)===n},Qe.isSuspense=function(_){return j(_)===h},Qe.isSuspenseList=function(_){return j(_)===m},Qe.isValidElementType=function(_){return typeof _=="string"||typeof _=="function"||_===r||_===l||_===n||_===h||_===m||typeof _=="object"&&_!==null&&(_.$$typeof===y||_.$$typeof===p||_.$$typeof===c||_.$$typeof===s||_.$$typeof===d||_.$$typeof===w||_.getModuleId!==void 0)},Qe.typeOf=j,Qe}var UN;function SH(){return UN||(UN=1,Hv.exports=_H()),Hv.exports}var NH=SH(),HN=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",KN=null,Kv=null,m4=e=>{if(e===KN&&Array.isArray(Kv))return Kv;var t=[];return b.Children.forEach(e,r=>{xt(r)||(NH.isFragment(r)?t=t.concat(m4(r.props.children)):t.push(r))}),Kv=t,KN=e,t};function Jg(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(l=>HN(l)):n=[HN(t)],m4(e).forEach(l=>{var s=Gi(l,"type.displayName")||Gi(l,"type.name");s&&n.indexOf(s)!==-1&&r.push(l)}),r}var p4=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,Yv={},YN;function OH(){return YN||(YN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){var l;if(typeof r!="object"||r==null)return!1;if(Object.getPrototypeOf(r)===null)return!0;if(Object.prototype.toString.call(r)!=="[object Object]"){const s=r[Symbol.toStringTag];return s==null||!((l=Object.getOwnPropertyDescriptor(r,Symbol.toStringTag))!=null&&l.writable)?!1:r.toString()===`[object ${s}]`}let n=r;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(r)===n}e.isPlainObject=t})(Yv)),Yv}var Gv,GN;function AH(){return GN||(GN=1,Gv=OH().isPlainObject),Gv}var EH=AH();const CH=kn(EH);var VN,XN,FN,ZN,QN;function WN(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),r.push.apply(r,n)}return r}function JN(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?WN(Object(r),!0).forEach(function(n){kH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):WN(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function kH(e,t,r){return(t=MH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function MH(e){var t=TH(e,"string");return typeof t=="symbol"?t:t+""}function TH(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ff(){return Ff=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ff.apply(null,arguments)}function Ss(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var eO=(e,t,r,n,l)=>{var s=r-n,c;return c=yt(VN||(VN=Ss(["M ",",",""])),e,t),c+=yt(XN||(XN=Ss(["L ",",",""])),e+r,t),c+=yt(FN||(FN=Ss(["L ",",",""])),e+r-s/2,t+l),c+=yt(ZN||(ZN=Ss(["L ",",",""])),e+r-s/2-n,t+l),c+=yt(QN||(QN=Ss(["L ",","," Z"])),e,t),c},DH={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},PH=e=>{var t=Mt(e,DH),{x:r,y:n,upperWidth:l,lowerWidth:s,height:c,className:d}=t,{animationEasing:h,animationDuration:m,animationBegin:p,isUpdateAnimationActive:y}=t,x=Line truncated
* @license React
* use-sync-external-store-with-selector.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var pO;function hG(){if(pO)return Qv;pO=1;var e=so();function t(h,m){return h===m&&(h!==0||1/h===1/m)||h!==h&&m!==m}var r=typeof Object.is=="function"?Object.is:t,n=e.useSyncExternalStore,l=e.useRef,s=e.useEffect,c=e.useMemo,d=e.useDebugValue;return Qv.useSyncExternalStoreWithSelector=function(h,m,p,y,x){var w=l(null);if(w.current===null){var j={hasValue:!1,value:null};w.current=j}else j=w.current;w=c(function(){function N(z){if(!A){if(A=!0,O=z,z=y(z),x!==void 0&&j.hasValue){var T=j.value;if(x(T,z))return P=T}return P=z}if(T=P,r(O,z))return T;var R=y(z);return x!==void 0&&x(T,R)?(O=z,T):(O=z,P=R)}var A=!1,O,P,k=p===void 0?null:p;return[function(){return N(m())},k===null?void 0:function(){return N(k())}]},[m,p,y,x]);var _=n(h,w[0],w[1]);return s(function(){j.hasValue=!0,j.value=_},[_]),d(_),_},Qv}var vO;function mG(){return vO||(vO=1,Zv.exports=hG()),Zv.exports}mG();function pG(e){e()}function vG(){let e=null,t=null;return{clear(){e=null,t=null},notify(){pG(()=>{let r=e;for(;r;)r.callback(),r=r.next})},get(){const r=[];let n=e;for(;n;)r.push(n),n=n.next;return r},subscribe(r){let n=!0;const l=t={callback:r,next:null,prev:t};return l.prev?l.prev.next=l:e=l,function(){!n||e===null||(n=!1,l.next?l.next.prev=l.prev:t=l.prev,l.prev?l.prev.next=l.next:e=l.next)}}}}var yO={notify(){},get:()=>[]};function yG(e,t){let r,n=yO,l=0,s=!1;function c(_){p();const N=n.subscribe(_);let A=!1;return()=>{A||(A=!0,N(),y())}}function d(){n.notify()}function h(){j.onStateChange&&j.onStateChange()}function m(){return s}function p(){l++,r||(r=e.subscribe(h),n=vG())}function y(){l--,r&&l===0&&(r(),r=void 0,n.clear(),n=yO)}function x(){s||(s=!0,p())}function w(){s&&(s=!1,y())}const j={addNestedSub:c,notifyNestedSubs:d,handleChangeWrapper:h,isSubscribed:m,trySubscribe:x,tryUnsubscribe:w,getListeners:()=>n};return j}var gG=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",xG=gG(),bG=()=>typeof navigator<"u"&&navigator.product==="ReactNative",wG=bG(),jG=()=>xG||wG?b.useLayoutEffect:b.useEffect,_G=jG();function gO(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function SG(e,t){if(gO(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let l=0;l<r.length;l++)if(!Object.prototype.hasOwnProperty.call(t,r[l])||!gO(e[r[l]],t[r[l]]))return!1;return!0}var Wv=Symbol.for("react-redux-context"),Jv=typeof globalThis<"u"?globalThis:{};function NG(){if(!b.createContext)return{};const e=Jv[Wv]??(Jv[Wv]=new Map);let t=e.get(b.createContext);return t||(t=b.createContext(null),e.set(b.createContext,t)),t}var OG=NG();function AG(e){const{children:t,context:r,serverState:n,store:l}=e,s=b.useMemo(()=>{const h=yG(l);return{store:l,subscription:h,getServerState:n?()=>n:void 0}},[l,n]),c=b.useMemo(()=>l.getState(),[l]);_G(()=>{const{subscription:h}=s;return h.onStateChange=h.notifyNestedSubs,h.trySubscribe(),c!==l.getState()&&h.notifyNestedSubs(),()=>{h.tryUnsubscribe(),h.onStateChange=void 0}},[s,c]);const d=r||OG;return b.createElement(d.Provider,{value:s},t)}var EG=AG,CG=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius"]);function kG(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Qd(e,t){var r=new Set([...Object.keys(e),...Object.keys(t)]);for(var n of r)if(CG.has(n)){if(e[n]==null&&t[n]==null)continue;if(!SG(e[n],t[n]))return!1}else if(!kG(e[n],t[n]))return!1;return!0}function Tn(e,t){var r,n;return(r=(n=e.graphicalItems.cartesianItems.find(l=>l.id===t))===null||n===void 0?void 0:n.xAxisId)!==null&&r!==void 0?r:b4}function Dn(e,t){var r,n;return(r=(n=e.graphicalItems.cartesianItems.find(l=>l.id===t))===null||n===void 0?void 0:n.yAxisId)!==null&&r!==void 0?r:b4}var C4=(e,t,r)=>ii(e,"xAxis",Tn(e,t),r),k4=(e,t,r)=>ai(e,"xAxis",Tn(e,t),r),M4=(e,t,r)=>ii(e,"yAxis",Dn(e,t),r),T4=(e,t,r)=>ai(e,"yAxis",Dn(e,t),r),MG=Y([$e,C4,M4,k4,T4],(e,t,r,n,l)=>Mn(e,"xAxis")?ro(t,n,!1):ro(r,l,!1)),TG=(e,t)=>t,D4=Y([qd,TG],(e,t)=>e.filter(r=>r.type==="area").find(r=>r.id===t)),P4=e=>{var t=$e(e),r=Mn(t,"xAxis");return r?"yAxis":"xAxis"},DG=(e,t)=>{var r=P4(e);return r==="yAxis"?Dn(e,t):Tn(e,t)},PG=(e,t,r)=>Yf(e,P4(e),DG(e,t),r),zG=Y([D4,PG],(e,t)=>{var r;if(!(e==null||t==null)){var{stackId:n}=e,l=Ld(e);if(!(n==null||l==null)){var s=(r=t[n])===null||r===void 0?void 0:r.stackedData,c=s==null?void 0:s.find(d=>d.key===l);if(c!=null)return c.map(d=>[d[0],d[1]])}}}),RG=Y([$e,C4,M4,k4,T4,zG,OC,MG,D4,TI],(e,t,r,n,l,s,c,d,h,m)=>{var{chartData:p,dataStartIndex:y,dataEndIndex:x}=c;if(!(h==null||e!=="horizontal"&&e!=="vertical"||t==null||r==null||n==null||l==null||n.length===0||l.length===0||d==null)){var{data:w}=h,j;if(w&&w.length>0?j=w:j=p==null?void 0:p.slice(y,x+1),j!=null)return tV({layout:e,xAxis:tLine truncated
例如:回复时保持礼貌专业、使用简洁的语言、强调产品质量等`,className:"w-full ios-input px-4 py-3 rounded-xl h-40 resize-none"})]}),f.jsxs("div",{className:"bg-blue-50 border border-blue-200 rounded-xl p-4",children:[f.jsxs("h4",{className:"font-bold text-blue-900 mb-2 flex items-center gap-2",children:[f.jsx(u0,{className:"w-4 h-4"}),"AI如何工作"]}),f.jsxs("ul",{className:"text-xs text-blue-800 space-y-1",children:[f.jsx("li",{children:"• 自动识别买家的砍价请求"}),f.jsx("li",{children:"• 根据设定的策略智能回复"}),f.jsx("li",{children:"• 在合理范围内同意降价或礼貌拒绝"}),f.jsx("li",{children:"• 保持专业友好的沟通风格"})]})]})]}),f.jsx("div",{className:"modal-footer",children:f.jsxs("div",{className:"flex gap-3 w-full",children:[f.jsx("button",{onClick:()=>A(null),className:"flex-1 px-6 py-3 rounded-xl font-bold bg-gray-100 text-gray-700 hover:bg-gray-200 transition-colors",disabled:$,children:"取消"}),f.jsxs("button",{onClick:ue,className:"flex-1 ios-btn-primary px-6 py-3 rounded-xl font-bold flex items-center justify-center gap-2",disabled:$,children:[$?f.jsx(Wa,{className:"w-4 h-4 animate-spin"}):f.jsx(oa,{className:"w-4 h-4"}),$?"保存中...":"保存"]})]})})]})}),document.body)]})},IO=({status:e})=>{const t={processing:"bg-blue-100 text-blue-800",pending_ship:"bg-[#0094f7] text-white",shipped:"bg-blue-100 text-blue-700",completed:"bg-green-100 text-green-700",cancelled:"bg-gray-100 text-gray-500",refunding:"bg-red-100 text-red-600"},r={processing:"处理中",pending_ship:"待发货",shipped:"已发货",completed:"已完成",cancelled:"已取消",refunding:"退款中"};return f.jsx("span",{className:`px-3 py-1.5 rounded-lg text-xs font-bold ${t[e]||t.cancelled}`,children:r[e]||e})},wF=()=>{const[e,t]=b.useState([]),[r,n]=b.useState([]),[l,s]=b.useState([]),[c,d]=b.useState({}),[h,m]=b.useState("all"),[p,y]=b.useState(""),[x,w]=b.useState(1),[j,_]=b.useState(1),[N,A]=b.useState(!1),[O,P]=b.useState(!1),[k,z]=b.useState(!1),[T,R]=b.useState(!1),[$,Z]=b.useState(null),[X,L]=b.useState(null),[K,se]=b.useState({}),[ce,he]=b.useState(!1),[q,W]=b.useState(""),[ue,te]=b.useState(!1),[M,C]=b.useState(null),[U,ee]=b.useState(null),[le,me]=b.useState(null),[pe,be]=b.useState(null),Me=D=>{if(!p.trim())return D;const oe=p.toLowerCase().trim();return D.filter(fe=>{var Pe,Sr,pn,fi,Rn,vn;return((Pe=fe.order_id)==null?void 0:Pe.toLowerCase().includes(oe))||((Sr=fe.item_id)==null?void 0:Sr.toLowerCase().includes(oe))||((pn=fe.buyer_id)==null?void 0:pn.toLowerCase().includes(oe))||((fi=fe.item_title)==null?void 0:fi.toLowerCase().includes(oe))||((Rn=fe.receiver_name)==null?void 0:Rn.toLowerCase().includes(oe))||((vn=fe.receiver_phone)==null?void 0:vn.toLowerCase().includes(oe))})},J=async()=>{A(!0);try{if(p.trim()){let D=[],oe=1,fe=!0;for(;fe;){const Pe=await Cj(void 0,h,oe,100);D=[...D,...Pe.data],fe=oe<Pe.total_pages,oe++}n(D),t(Me(D)),_(1)}else{const D=await Cj(void 0,h,x,20);n(D.data),t(Me(D.data)),_(D.total_pages)}}catch(D){console.error("加载订单失败:",D)}finally{A(!1)}};b.useEffect(()=>{t(Me(r))},[r,p]);const we=(D,oe)=>{if(oe&&oe.trim())return oe;if(c[D])return c[D];const fe=l.find(Pe=>{if(oe&&Pe.item_title){const Sr=oe.toLowerCase(),pn=Pe.item_title.toLowerCase();return pn.includes(Sr)||Sr.includes(pn)}return!1});return fe!=null&&fe.item_title?fe.item_title:"未知商品"},Oe=D=>{const oe={};D.forEach(fe=>{fe.item_id&&(oe[fe.item_id]=fe.item_title||fe.item_id)}),d(oe)};b.useEffect(()=>{J(),id().then(D=>{s(D),Oe(D)}).catch(D=>{console.error("加载商品列表失败:",D)})},[h,x,p]);const ie=async()=>{A(!0);try{const D=await xD();await J(),D!=null&&D.message&&alert(D.message)}catch(D){console.error("同步订单失败:",D),alert((D==null?void 0:D.message)||"同步失败,请重试")}finally{A(!1)}},Ie=D=>{W(D),C(null),he(!0)},_e=async D=>{var oe;te(!0),C(null);try{const fe=await wD([q],D),Pe=(oe=fe==null?void 0:fe.results)==null?void 0:oe[0];Pe!=null&&Pe.success?(C({success:!0,message:Pe.message}),J()):C({success:!1,message:(Pe==null?void 0:Pe.message)||"发货失败"})}catch(fe){C({success:!1,message:(fe==null?void 0:fe.message)||"请求失败"})}finally{te(!1)}},ct=D=>{Z(D),P(!0)},ft=D=>{L({...D}),z(!0)},ht=async()=>{if(!(!X||!X.order_id))try{const D={};X.status!==void 0&&(D.order_status=X.status),X.buyer_id!==void 0&&(D.buyer_id=X.buyer_id),X.amount!==void 0&&(D.amount=X.amount),X.receiver_name!==void 0&&(D.receiver_name=X.receiver_name),X.receiver_phone!==void 0&&(D.receiver_phone=X.receiver_phone),X.receiver_address!==void 0&&(D.receiver_address=X.receiver_address),X.item_id!==void 0&&(D.item_id=X.item_id),X.quantity!==void 0&&(D.quantity=X.quantity),await yD(X.order_id,D),z(!1),L(null),J()}catch(D){console.error("更新订单失败:",D),alert("更新失败,请重试")}},nn=async()=>{if(U)try{const D=new FormData;D.append("file",U),await jD(D),R(!1),ee(null),J(),alert("订单导入成功")}catch(D){alert((D==null Line truncated
`).filter(z=>z.trim()).length} 条`:O.type==="text"&&O.text_content?P=O.text_content.substring(0,20)+(O.text_content.length>20?"...":""):O.type==="api"&&O.api_config?P=O.api_config.url:O.type==="image"&&O.image_url&&(P="图片链接"),f.jsxs("tr",{className:"hover:bg-[#FFFDE7]/50 transition-colors group",children:[f.jsx("td",{className:"px-8 py-5",children:f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("div",{className:"p-2 bg-gray-50 rounded-xl group-hover:bg-white transition-colors",children:f.jsx(x,{type:O.type})}),f.jsx("span",{className:"font-bold text-gray-900",children:O.name})]})}),f.jsx("td",{className:"px-6 py-5",children:f.jsx("span",{className:`px-3 py-1.5 rounded-lg text-xs font-bold ${O.type==="text"?"bg-blue-50 text-blue-600":O.type==="data"?"bg-purple-50 text-purple-600":O.type==="api"?"bg-blue-50 text-blue-600":"bg-pink-50 text-pink-600"}`,children:O.type==="text"?"文本":O.type==="data"?"批量":O.type==="api"?"API":"图片"})}),f.jsx("td",{className:"px-6 py-5",children:f.jsx("span",{className:"text-sm text-gray-600 font-mono block truncate",title:P,children:P})}),f.jsx("td",{className:"px-6 py-5",children:f.jsx("span",{className:"text-sm text-gray-500 block max-w-[200px] truncate",title:O.description||"-",children:O.description||"-"})}),f.jsx("td",{className:"px-6 py-5",children:f.jsx("button",{onClick:()=>A(O),className:`w-12 h-8 rounded-full relative transition-colors ${O.enabled?"bg-green-500":"bg-gray-300"}`,children:f.jsx("div",{className:`absolute top-1 w-6 h-6 bg-white rounded-full shadow-sm transition-transform ${O.enabled?"left-5":"left-1"}`})})}),f.jsx("td",{className:"px-6 py-5",children:f.jsxs("div",{className:"flex items-center justify-end gap-2",children:[f.jsx("button",{onClick:()=>w(O),className:"p-2 text-gray-400 hover:text-black hover:bg-gray-100 rounded-xl transition-colors",title:"编辑",children:f.jsx(f0,{className:"w-4 h-4"})}),f.jsx("button",{onClick:()=>_(O.id),className:"p-2 text-gray-400 hover:text-red-500 hover:bg-red-50 rounded-xl transition-colors",children:f.jsx(ei,{className:"w-5 h-5"})})]})})]},O.id)})})]})}),e.length===0&&f.jsxs("div",{className:"py-20 text-center text-gray-400",children:[f.jsx(GO,{className:"w-12 h-12 mx-auto mb-4 opacity-30"}),f.jsx("p",{children:"暂无卡密配置,请点击右上角添加。"})]})]}),r&&c&&Jt.createPortal(f.jsx("div",{className:"modal-overlay-centered",children:f.jsxs("div",{className:"modal-container",children:[f.jsxs("div",{className:"modal-header",children:[f.jsx("h3",{className:"text-2xl font-extrabold text-gray-900",children:"编辑卡密"}),f.jsx("button",{onClick:()=>n(!1),className:"p-2 rounded-xl hover:bg-gray-100 transition-colors",children:f.jsx(gr,{className:"w-5 h-5 text-gray-500"})})]}),f.jsx("div",{className:"modal-body",children:f.jsxs("div",{className:"space-y-5",children:[f.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[f.jsxs("div",{children:[f.jsxs("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:["卡密名称 ",f.jsx("span",{className:"text-red-500",children:"*"})]}),f.jsx("input",{type:"text",value:h.name||"",onChange:O=>m({...h,name:O.target.value}),className:"w-full ios-input px-4 py-3 rounded-xl",placeholder:"例如:游戏点卡、会员卡等"})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"卡券类型"}),f.jsxs("select",{value:h.type||"text",onChange:O=>m({...h,type:O.target.value}),className:"w-full ios-input px-4 py-3 rounded-xl",children:[f.jsx("option",{value:"",children:"请选择类型"}),f.jsx("option",{value:"text",children:"固定文字"}),f.jsx("option",{value:"data",children:"批量数据"}),f.jsx("option",{value:"api",children:"API接口"}),f.jsx("option",{value:"image",children:"图片"})]})]})]}),h.type==="api"&&f.jsxs("div",{className:"border border-gray-200 rounded-xl p-4 space-y-4 bg-gray-50",children:[f.jsx("h3",{className:"font-bold text-gray-900",children:"API 配置"}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"API 地址"}),f.jsx("input",{type:"url",value:h.api_url||"",onChange:O=>m({...h,api_url:O.target.value}),className:"w-full ios-input px-4 py-3 rounded-xl font-mono text-sm",placeholder:"https://api.example.com/get-card"})]}),f.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"请求方法"}),f.jsxs("select",{value:h.api_method||"GET",onChange:O=>m({...h,api_method:O.target.value}),className:"w-full ios-input px-4 py-3 rounded-xl",children:[f.jsx("option",{value:"GET",children:"GET"}),f.jsx("option",{value:"POST",children:"POST"})]})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"超时时间(秒)"}),f.jsx("input",{type:"number",value:h.api_timeout||10,onChange:O=>m({...h,api_timeout:parseInt(O.tarLine truncated
卡号1:密码1
卡号2:密码2
或者
兑换码1
兑换码2`}),f.jsx("p",{className:"text-xs text-gray-500 mt-2",children:"支持格式:卡号:密码 或 单独的兑换码"}),f.jsxs("p",{className:"text-xs text-gray-500",children:["当前库存:",f.jsx("span",{className:"font-bold text-blue-600",children:h.data_content?h.data_content.split(`
`).filter(O=>O.trim()).length:0})," 条"]})]})]}),h.type==="image"&&f.jsxs("div",{className:"border border-gray-200 rounded-xl p-4 bg-gray-50",children:[f.jsx("h3",{className:"font-bold text-gray-900 mb-3",children:"图片配置"}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"图片 URL"}),f.jsx("input",{type:"url",value:h.image_url||"",onChange:O=>m({...h,image_url:O.target.value}),className:"w-full ios-input px-4 py-3 rounded-xl font-mono text-sm",placeholder:"https://example.com/image.png"}),f.jsx("p",{className:"text-xs text-gray-500 mt-2",children:"输入图片卡密的 URL 地址"})]}),h.image_url&&f.jsxs("div",{className:"mt-3",children:[f.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"图片预览"}),f.jsx("img",{src:h.image_url,alt:"预览",className:"max-w-full max-h-48 rounded-xl border border-gray-200",onError:O=>{O.currentTarget.src="https://via.placeholder.com/400x200?text=图片加载失败"}})]})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"延时发货时间(秒)"}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("input",{type:"number",value:h.delay_seconds||0,onChange:O=>m({...h,delay_seconds:parseInt(O.target.value)||0}),className:"flex-1 ios-input px-4 py-3 rounded-xl",min:"0",max:"3600",placeholder:"0"}),f.jsx("span",{className:"text-sm text-gray-500 whitespace-nowrap",children:"秒"})]}),f.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"0表示立即发货,最大3600秒(1小时)"})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"备注信息"}),f.jsx("textarea",{value:h.description||"",onChange:O=>m({...h,description:O.target.value}),className:"w-full ios-input px-4 py-3 rounded-xl h-40 resize-none",placeholder:"可选的备注信息"})]}),f.jsxs("div",{className:"flex items-center justify-between p-4 bg-gray-50 rounded-xl",children:[f.jsx("span",{className:"font-bold text-gray-900",children:"启用状态"}),f.jsx("button",{type:"button",onClick:()=>m({...h,enabled:!h.enabled}),className:`w-14 h-8 rounded-full transition-colors duration-300 relative ${h.enabled?"bg-[#0094f7]":"bg-gray-300"}`,children:f.jsx("span",{className:`absolute top-1 w-6 h-6 bg-white rounded-full shadow-md transition-transform duration-300 block ${h.enabled?"translate-x-7":"translate-x-1"}`})})]})]})}),f.jsx("div",{className:"modal-footer",children:f.jsxs("div",{className:"flex gap-3 w-full",children:[f.jsx("button",{onClick:()=>n(!1),className:"flex-1 px-6 py-3 rounded-xl font-bold bg-gray-100 text-gray-700 hover:bg-gray-200 transition-colors",children:"取消"}),f.jsxs("button",{onClick:j,className:"flex-1 ios-btn-primary px-6 py-3 rounded-xl font-bold flex items-center justify-center gap-2",children:[f.jsx(oa,{className:"w-4 h-4"}),"保存更改"]})]})})]})}),document.body),l&&Jt.createPortal(f.jsx("div",{className:"modal-overlay-centered",children:f.jsxs("div",{className:"modal-container",style:{maxWidth:"780px"},children:[f.jsxs("div",{className:"modal-header flex items-center justify-between gap-4",children:[f.jsxs("div",{children:[f.jsx("h3",{className:"text-2xl font-extrabold text-gray-900",children:"添加新卡密"}),f.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"选择交付方式并录入自动发货内容"})]}),f.jsx("button",{onClick:()=>s(!1),className:"p-2 rounded-xl hover:bg-gray-100 transition-colors flex-shrink-0",title:"关闭",children:f.jsx(gr,{className:"w-5 h-5 text-gray-500"})})]}),f.jsx("div",{className:"modal-body",children:f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"卡密名称"}),f.jsx("input",{type:"text",value:p.name,onChange:O=>y({...p,name:O.target.value}),placeholder:"例如:VIP会员卡密",className:"w-full ios-input px-4 py-3 rounded-xl"})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"类型"}),f.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2",children:[f.jsxs("button",{type:"button",onClick:()=>y({...p,type:"data",content:""}),className:`p-3 rounded-xl font-bold transition-all ${p.type==="data"?"bg-[#0094f7] text-white":"bg-gray-100 text-gray-600 hover:bg-gray-200"}`,children:[f.jsx(ty,{className:"w-5 h-5 mx-auto mb-1"}),"批量库存"]}),f.jsxs("button",{type:"button",onClick:()=>y({...p,type:"text",content:""}),className:`p-3 rounded-xl font-bold transition-all ${p.type==="text"?"bg-[#0094f7] text-white":"bg-gray-100 text-gray-600"}`,children:[f.jsx(Sj,{className:"w-5 h-5 mx-auto mb-1"}),"文本"]}),f.jsxs("button",{type:"button",onClick:()=>y({...p,type:"image",content:""}),className:`p-3 rounded-xl font-bold transition-all ${p.type==="image"?"bg-[#0094f7] text-white":"bg-gray-100 text-gray-Line truncated
CODE-789012
...`:"请输入每次发货时发送的固定文字"}),p.type==="data"&&f.jsxs("p",{className:"text-xs text-gray-500",children:["当前库存:",f.jsx("span",{className:"font-bold text-[#0094f7]",children:p.content.split(`
`).filter(O=>O.trim()).length})," 条"]})]}),p.type==="api"&&f.jsxs("div",{className:"border-t border-gray-100 pt-5 space-y-4",children:[f.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx("label",{className:"block text-sm font-bold text-gray-700",children:"请求方法"}),f.jsxs("select",{value:p.api_method,onChange:O=>y({...p,api_method:O.target.value}),className:"w-full ios-input px-4 py-3 rounded-xl",children:[f.jsx("option",{value:"GET",children:"GET"}),f.jsx("option",{value:"POST",children:"POST"})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx("label",{className:"block text-sm font-bold text-gray-700",children:"超时时间(秒)"}),f.jsx("input",{type:"number",min:"1",max:"60",value:p.api_timeout,onChange:O=>y({...p,api_timeout:parseInt(O.target.value)||10}),className:"w-full ios-input px-4 py-3 rounded-xl"})]})]}),f.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx("label",{className:"block text-sm font-bold text-gray-700",children:"请求头(JSON)"}),f.jsx("textarea",{value:p.api_headers,onChange:O=>y({...p,api_headers:O.target.value}),className:"w-full ios-input px-4 py-3 rounded-xl h-24 resize-none font-mono text-xs",placeholder:'{"Authorization":"Bearer token"}'})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx("label",{className:"block text-sm font-bold text-gray-700",children:"请求参数(JSON)"}),f.jsx("textarea",{value:p.api_params,onChange:O=>y({...p,api_params:O.target.value}),className:"w-full ios-input px-4 py-3 rounded-xl h-24 resize-none font-mono text-xs",placeholder:'{"order_id":"{order_id}"}'})]})]})]}),f.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-[1fr_180px] gap-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx("label",{className:"block text-sm font-bold text-gray-700",children:"描述"}),f.jsx("input",{value:p.description,onChange:O=>y({...p,description:O.target.value}),placeholder:"卡密用途描述(可选)",className:"w-full ios-input px-4 py-3 rounded-xl"})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx("label",{className:"block text-sm font-bold text-gray-700",children:"延时发货(秒)"}),f.jsx("input",{type:"number",value:p.delay_seconds,onChange:O=>y({...p,delay_seconds:parseInt(O.target.value)||0}),className:"w-full ios-input px-4 py-3 rounded-xl",min:"0",max:"3600"})]})]})]})}),f.jsx("div",{className:"modal-footer",children:f.jsxs("div",{className:"flex gap-3 w-full",children:[f.jsx("button",{onClick:()=>s(!1),className:"flex-1 px-6 py-3 rounded-xl font-bold bg-gray-100 text-gray-700 hover:bg-gray-200 transition-colors",children:"取消"}),f.jsxs("button",{onClick:N,className:"flex-1 ios-btn-primary px-6 py-3 rounded-xl font-bold flex items-center justify-center gap-2",children:[f.jsx(Hi,{className:"w-4 h-4"}),"添加卡密"]})]})})]})}),document.body)]})},_F=()=>{const[e,t]=b.useState([]),[r,n]=b.useState([]),[l,s]=b.useState(""),[c,d]=b.useState(!1),[h,m]=b.useState(!1),[p,y]=b.useState(!1),[x,w]=b.useState(null),[j,_]=b.useState({}),[N,A]=b.useState({cookie_id:"",item_id:"",item_title:"",item_price:"",item_image:"",is_multi_spec:!1,is_multi_qty_ship:!1}),O=async()=>{const L=await id();t(L)};b.useEffect(()=>{d0().then(n),O().catch(L=>{console.error("加载商品失败:",L)})},[]);const P=async()=>{if(!l)return alert("请先选择账号");d(!0);try{const L=await ED(l);await O(),alert((L==null?void 0:L.message)||"商品同步完成")}catch(L){console.error("同步商品失败:",L),alert((L==null?void 0:L.message)||"同步失败,请重试")}finally{d(!1)}},k=L=>{w(L),_({...L}),m(!0)},z=async()=>{if(x)try{await MD(x.cookie_id,x.item_id,{item_title:j.item_title||"",item_description:j.item_description||"",item_category:j.item_category||"",item_price:j.item_price||"",item_detail:j.item_detail||x.item_detail||"",is_multi_spec:!!j.is_multi_spec,multi_quantity_delivery:!!(j.is_multi_qty_ship??j.multi_quantity_delivery)}),await O(),m(!1),w(null)}catch(L){console.error("更新商品失败:",L),alert("更新失败,请重试")}},T=async L=>{if(confirm(`确认删除商品"${L.item_title}"吗?`))try{await CD(L.cookie_id,L.item_id),t(K=>K.filter(se=>!(se.cookie_id===L.cookie_id&&se.item_id===L.item_id)))}catch(K){console.error("删除商品失败:",K),alert("删除失败,请重试")}},R=async()=>{try{if(!N.cookie_id||!N.item_id){alert("请选择账号并填写商品ID");return}await kD(N.cookie_id,{item_id:N.item_id,item_title:N.item_title,item_price:N.item_price,item_detail:N.item_image?JSON.stringify({item_image:N.item_image}):"",is_multi_spec:N.is_multi_spec,is_multi_qty_ship:N.is_multi_qty_ship}),await O(),y(!1),A({cookie_id:"",item_id:"",item_title:"",item_price:"",item_image:"",is_multi_spec:!1,is_multi_qty_ship:!1})}catch(L){console.error("添加商品失败:",L),alert("添加失败,请重试")}},$=async L=>{const K=!L.is_multi_spec;t(se=>se.map(ce=>c Line truncated
+2 -2
View File
@@ -6,8 +6,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Ydisks闲鱼助手 - 自动发货与管家系统</title>
<meta name="description" content="Ydisks闲鱼助手 - 自动回复、自动发货、订单管理、AI智能议价一体化解决方案" />
<script type="module" crossorigin src="/static/assets/index-Iccu2KVx.js"></script>
<link rel="stylesheet" crossorigin href="/static/assets/index-D2SGgSWO.css">
<script type="module" crossorigin src="/static/assets/index-BqbLDbbX.js"></script>
<link rel="stylesheet" crossorigin href="/static/assets/index-D3d7xJxH.css">
</head>
<body>
<div id="root"></div>